@arcgis/coding-components 4.31.0-next.10 → 4.31.0-next.11
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/index.esm.js +2 -2
- package/dist/arcgis-coding-components/{p-da9431ba.js → p-21306a37.js} +2 -2
- package/dist/arcgis-coding-components/{p-f452d4b8.entry.js → p-29b05690.entry.js} +2 -2
- package/dist/arcgis-coding-components/p-2db85972.js +6 -0
- package/dist/arcgis-coding-components/{p-8196fa73.js → p-2f2288de.js} +2 -2
- package/dist/arcgis-coding-components/{p-923858b5.js → p-4050b5db.js} +2 -2
- package/dist/arcgis-coding-components/{p-960aa9dc.js → p-44052160.js} +2 -2
- package/dist/arcgis-coding-components/{p-767b17ee.entry.js → p-47bb2fdc.entry.js} +2 -2
- package/dist/arcgis-coding-components/p-4fcb5bf0.js +6 -0
- package/dist/arcgis-coding-components/{p-ad75160d.js → p-79e7d01c.js} +3 -3
- package/dist/arcgis-coding-components/{p-02cae55d.js → p-aedf8504.js} +3 -3
- package/dist/arcgis-coding-components/{p-790067b1.js → p-af7ed920.js} +12 -12
- package/dist/arcgis-coding-components/{p-6e28fd70.js → p-c28eef63.js} +2 -2
- package/dist/arcgis-coding-components/{p-22253750.js → p-ca85726f.js} +1 -1
- package/dist/arcgis-coding-components/{p-193ac44f.js → p-cdc11558.js} +1 -1
- package/dist/arcgis-coding-components/{p-8cf09bcc.js → p-decda64c.js} +1 -1
- package/dist/arcgis-coding-components/p-e6442988.js +6 -0
- package/dist/arcgis-coding-components/{p-4fc79a07.entry.js → p-eb99e7e7.entry.js} +2 -2
- package/dist/arcgis-coding-components/{p-ab78d6c4.js → p-ef0c4126.js} +3 -3
- package/dist/arcgis-coding-components/{p-025fda85.js → p-fa824326.js} +2 -2
- package/dist/cjs/{app-globals-bade840e.js → app-globals-d8d56a70.js} +1 -1
- package/dist/cjs/arcade-defaults-b1300c3f.js +349 -0
- package/dist/cjs/{arcade-language-features-747fb1da.js → arcade-language-features-5c4510c9.js} +2 -2
- package/dist/cjs/{arcade-mode-dce44622.js → arcade-mode-185370a7.js} +3 -4
- package/dist/cjs/arcgis-arcade-editor_6.cjs.entry.js +6 -6
- package/dist/cjs/arcgis-coding-components.cjs.js +3 -3
- 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-077ba0c5.js → css-0d91050a.js} +1 -1
- package/dist/cjs/{cssMode-7f2030db.js → cssMode-e8786e83.js} +2 -3
- package/dist/cjs/{html-e3a243e9.js → html-adbae3fd.js} +2 -3
- package/dist/cjs/{htmlMode-c273d6dc.js → htmlMode-608f8da7.js} +2 -3
- package/dist/cjs/{index-37a86ff4.js → index-1cf75f2d.js} +1 -1
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/{javascript-7a33cca7.js → javascript-c8733e40.js} +3 -4
- package/dist/cjs/{jsonMode-6b4e0850.js → jsonMode-98ec5315.js} +2 -3
- package/dist/cjs/{language-defaults-base-b32cb091.js → language-defaults-base-2b2f9d3e.js} +800 -1024
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{sql-expr-defaults-8a5834f3.js → sql-expr-defaults-a1d5380d.js} +55 -4
- package/dist/cjs/{sql-expr-mode-a72a1f92.js → sql-expr-mode-19618e11.js} +5 -5
- package/dist/cjs/{tsMode-c2edcd57.js → tsMode-ed34ec8f.js} +2 -3
- package/dist/cjs/{typescript-c50c5516.js → typescript-c3d83864.js} +2 -3
- package/dist/components/arcade-defaults.js +238 -4
- package/dist/components/arcade-language-features.js +1 -1
- package/dist/components/arcade-mode.js +1 -1
- package/dist/components/arcade-results.js +2 -2
- package/dist/components/arcade-suggestions.js +1 -1
- package/dist/components/arcade-variables.js +1 -1
- package/dist/components/arcgis-arcade-editor.js +1 -1
- 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 +1 -1
- package/dist/components/arcgis-sql-expression-fields.js +1 -1
- package/dist/components/chunk-3IUJHIAA.js +1 -1
- package/dist/components/code-editor.js +1 -1
- package/dist/components/fields.js +4 -4
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +2 -2
- package/dist/components/language-api-panel.js +1 -1
- package/dist/components/language-defaults-base.js +47 -273
- package/dist/components/markdown.js +1 -1
- package/dist/components/sql-expr-defaults.js +55 -4
- package/dist/components/sql-expr-mode.js +1 -1
- package/dist/components/sql-expression-fields.js +1 -1
- package/dist/components/useT9n.js +1 -1
- package/dist/components/utilities.js +1 -1
- package/dist/esm/{app-globals-ed47e16d.js → app-globals-a48930ca.js} +1 -1
- package/dist/esm/arcade-defaults-3ea67051.js +344 -0
- package/dist/esm/{arcade-language-features-8edb3527.js → arcade-language-features-8274cdc7.js} +2 -2
- package/dist/esm/{arcade-mode-ad036f46.js → arcade-mode-c48c3fc6.js} +3 -4
- package/dist/esm/arcgis-arcade-editor_6.entry.js +6 -6
- package/dist/esm/arcgis-coding-components.js +4 -4
- 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-810518f1.js → css-4f85f426.js} +1 -1
- package/dist/esm/{cssMode-a7208024.js → cssMode-d655f1b9.js} +2 -3
- package/dist/esm/{html-e187d7d8.js → html-dd1552df.js} +2 -3
- package/dist/esm/{htmlMode-06b7bae2.js → htmlMode-0b7c2367.js} +2 -3
- package/dist/esm/{index-3743d31f.js → index-38d652b8.js} +1 -1
- package/dist/esm/index.js +4 -4
- package/dist/esm/{javascript-04a3f866.js → javascript-ef70f152.js} +3 -4
- package/dist/esm/{jsonMode-ee8bb2ea.js → jsonMode-a6ed58a5.js} +2 -3
- package/dist/esm/{language-defaults-base-52a397f5.js → language-defaults-base-77487def.js} +797 -1024
- package/dist/esm/loader.js +4 -4
- package/dist/esm/{sql-expr-defaults-f7c2d5ef.js → sql-expr-defaults-54db53a8.js} +55 -4
- package/dist/esm/{sql-expr-mode-433b4a39.js → sql-expr-mode-5c1d43ea.js} +5 -5
- package/dist/esm/{tsMode-c80c462e.js → tsMode-fce6766b.js} +2 -3
- package/dist/esm/{typescript-a9b8caa7.js → typescript-aed3d402.js} +2 -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/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 +3 -0
- package/dist/types/utils/profile/utils.d.ts +4 -0
- package/dist/types/utils/sql-expr-monaco/sql-expression-profile-strategy.d.ts +9 -0
- package/package.json +10 -10
- package/dist/arcgis-coding-components/p-50484a4f.js +0 -6
- package/dist/arcgis-coding-components/p-7164c348.js +0 -6
- package/dist/arcgis-coding-components/p-9956a574.js +0 -6
- package/dist/cjs/arcade-defaults-8b8d6c07.js +0 -116
- package/dist/esm/arcade-defaults-562fe19b.js +0 -111
- package/dist/types/utils/profile/predefined-profile.d.ts +0 -4
- package/dist/types/utils/sql-expr-profile/predefined-profile.d.ts +0 -2
package/dist/esm/loader.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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.11
|
|
5
5
|
*/
|
|
6
|
-
import { b as bootstrapLazy } from './index-
|
|
7
|
-
export { s as setNonce } from './index-
|
|
8
|
-
import { g as globalScripts } from './app-globals-
|
|
6
|
+
import { b as bootstrapLazy } from './index-38d652b8.js';
|
|
7
|
+
export { s as setNonce } from './index-38d652b8.js';
|
|
8
|
+
import { g as globalScripts } from './app-globals-a48930ca.js';
|
|
9
9
|
|
|
10
10
|
const defineCustomElements = async (win, options) => {
|
|
11
11
|
if (typeof window === 'undefined') return undefined;
|
|
@@ -1,10 +1,10 @@
|
|
|
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.11
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
import { g as getAssetPath } from './index-
|
|
6
|
+
import { F as isNotUndefined, D as Deferred, G as safeAsyncCall, H as devToolsAwareTimeout, J as safeCall, f as fieldsToProfileValues, i as isPredefinedProfile, b as isFeatureSetDefinition, m as main, L as LanguageDefaultsBase, d as fetchT9nStringsBundle, E as EditorProfile, U as Uri } from './language-defaults-base-77487def.js';
|
|
7
|
+
import { g as getAssetPath } from './index-38d652b8.js';
|
|
8
8
|
|
|
9
9
|
// src/framework.ts
|
|
10
10
|
function retrieveComponentMembers(component, isLit) {
|
|
@@ -1152,6 +1152,56 @@ var FunctionalController = class extends Controller {
|
|
|
1152
1152
|
};
|
|
1153
1153
|
var proxy = proxyExports(FunctionalController);
|
|
1154
1154
|
|
|
1155
|
+
// #region convert editor profile to apiProfile
|
|
1156
|
+
/**
|
|
1157
|
+
* Converts an editor profile to an api profile.
|
|
1158
|
+
* The api profile is an optimized version of the editor profile designed for minimal data transfer between the main thread and the worker.
|
|
1159
|
+
*/
|
|
1160
|
+
const sqlExprEditorToApiProfile = (editorProfile) => {
|
|
1161
|
+
const { apiVersion, bundles, hiddenApiItems } = editorProfile.toEditorProfileDefinition();
|
|
1162
|
+
const variable = editorProfile.variables[0];
|
|
1163
|
+
if (!variable || !(variable.type === "featureSet")) {
|
|
1164
|
+
throw Error("No variable found in the editor profile");
|
|
1165
|
+
}
|
|
1166
|
+
const hydratedVariable = variableToApiProfile(variable);
|
|
1167
|
+
return {
|
|
1168
|
+
apiVersion,
|
|
1169
|
+
bundles,
|
|
1170
|
+
variables: [hydratedVariable],
|
|
1171
|
+
hiddenApiItems: hiddenApiItems?.map((s) => s.toLowerCase()),
|
|
1172
|
+
};
|
|
1173
|
+
};
|
|
1174
|
+
function variableToApiProfile(variable) {
|
|
1175
|
+
const { name } = variable;
|
|
1176
|
+
const description = variable.getDescription();
|
|
1177
|
+
const { definition } = variable.toProfileVariableDefinition();
|
|
1178
|
+
const resultCompletion = {
|
|
1179
|
+
label: name,
|
|
1180
|
+
detail: name,
|
|
1181
|
+
insertText: name,
|
|
1182
|
+
insertTextMode: main.exports.InsertTextMode.asIs,
|
|
1183
|
+
insertTextFormat: main.exports.InsertTextFormat.PlainText,
|
|
1184
|
+
kind: main.exports.CompletionItemKind.Field,
|
|
1185
|
+
};
|
|
1186
|
+
const result = {
|
|
1187
|
+
name,
|
|
1188
|
+
description,
|
|
1189
|
+
type: "dictionary",
|
|
1190
|
+
properties: [],
|
|
1191
|
+
completion: resultCompletion,
|
|
1192
|
+
};
|
|
1193
|
+
// No fields or definition, then it will be a feature without any known fields
|
|
1194
|
+
if (!definition || !("fields" in definition)) {
|
|
1195
|
+
return result;
|
|
1196
|
+
}
|
|
1197
|
+
// Create properties for the fields
|
|
1198
|
+
// Also improve the feature completion documentation
|
|
1199
|
+
// TODO: should we add aliases to completion? what about domains?
|
|
1200
|
+
const [properties, featureCompletionDescription] = fieldsToProfileValues(definition.fields, description);
|
|
1201
|
+
result.properties = properties;
|
|
1202
|
+
resultCompletion.documentation = { kind: "markdown", value: featureCompletionDescription };
|
|
1203
|
+
return result;
|
|
1204
|
+
}
|
|
1155
1205
|
const tempHardcodedProfile = {
|
|
1156
1206
|
en: {
|
|
1157
1207
|
id: "field-calculation",
|
|
@@ -1200,6 +1250,7 @@ async function convertToEditorProfileDefinition(predefinedProfile, locale = "en"
|
|
|
1200
1250
|
});
|
|
1201
1251
|
return editorProfile;
|
|
1202
1252
|
}
|
|
1253
|
+
// #endregion
|
|
1203
1254
|
|
|
1204
1255
|
function x(i){return Array.isArray(i.testSdkCategories)}async function S(i,n){try{let e=await i,t=new Map,r=new Map,a=[],o=k(n);return e.forEach(p=>{let c=[];p.items.forEach(s=>V(c,r,t,o,s)),c.length&&a.push({...p,items:c});}),{categories:a,functionDefinitions:t,constantDefinitions:r}}catch{return {categories:[],functionDefinitions:new Map,constantDefinitions:new Map}}}var g=class{constructor(n){this._settings=n;this.sdkCategoriesCache=new Map;}async getApiDatabase(n){let{locale:e="en"}=n,t=this.sdkCategoriesCache.get(e);if(!t){let{assetsPath:r}=this._settings;if(!r)return {categories:[],functionDefinitions:new Map,constantDefinitions:new Map};t=this.loadSdkApiLibrary(e,r),this.sdkCategoriesCache.set(e,t);}return await S(t,n)}async getApiLibrary(n){let{categories:e}=await this.getApiDatabase(n);return e}async loadSdkApiLibrary(n="en",e=""){if(x(this._settings))return this._settings.testSdkCategories;if(e=e.replace(/\/$/u,""),!e)return [];try{let t=this._settings.apiPathTemplate.replace("${assetsPath}",e).replace("${locale}",n),r=await fetch(t);return r.ok?await r.json():n==="en"?[]:await this.loadSdkApiLibrary("en",e)}catch{return []}}};function k(i){let{profile:{apiVersion:n,bundles:e,hiddenApiItems:t=[]}={}}=i,r=A(n),a=Array.isArray(e)&&e.length>0?new Set(["core",...e]):void 0;return o=>h(r,o.sinceVersion)&&(!a||a.has(o.bundle))&&!t.includes(o.name)}function V(i,n,e,t,r){if(Array.isArray(r)){r.forEach(a=>m(i,e,t,a));return}r.type==="constant"?D(i,n,t,r):m(i,e,t,r);}function m(i,n,e,t){if(!e(t))return;t.disableDocumentation||i.push(t);let{completion:{label:r}}=t,a=r.toLowerCase(),o=n.get(a);o||(o={type:"functionDefinition",key:a,overloads:[]},n.set(a,o)),o.overloads.push(t);}function D(i,n,e,t){if(!e(t))return;i.push(t);let{completion:{label:r}}=t,a=r.toLowerCase();n.set(a,t);let[o,p]=t.completion.label.split(".");if(!p)return;let c=o.toLowerCase(),s=n.get(c);s||(s={type:"namespace",key:c,members:[],completion:{label:o,detail:o,insertText:o,insertTextMode:main.exports.InsertTextMode.adjustIndentation,insertTextFormat:main.exports.InsertTextFormat.PlainText,kind:main.exports.CompletionItemKind.Enum}},n.set(c,s));let l=structuredClone(t);l.name=p,l.completion.label=p,l.completion.insertText=p,l.completion.kind=main.exports.CompletionItemKind.Constant,s.members.push(l),s.completion.documentation=s.members.reduce((u,d)=>(u.value=`${u.value}${u.value?`
|
|
1205
1256
|
|
|
@@ -1245,7 +1296,7 @@ class SqlExprDefaults extends LanguageDefaultsBase {
|
|
|
1245
1296
|
const key = this._getApiKey(modelId);
|
|
1246
1297
|
const editorProfile = new EditorProfile(definition, intlStrings);
|
|
1247
1298
|
this._profileMap.set(key, editorProfile);
|
|
1248
|
-
const apiProfile =
|
|
1299
|
+
const apiProfile = sqlExprEditorToApiProfile(editorProfile);
|
|
1249
1300
|
this.updateApiContextForModel(modelId, {
|
|
1250
1301
|
locale: apiContext.locale,
|
|
1251
1302
|
profile: apiProfile,
|
|
@@ -1,12 +1,12 @@
|
|
|
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.11
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
import { s as sqlExprDefaults } from './sql-expr-defaults-
|
|
8
|
-
import { t as toCompletionItemKind } from './arcade-language-features-
|
|
9
|
-
import './index-
|
|
6
|
+
import { g as editor, z as languages, m as main, P as MarkerSeverity } from './language-defaults-base-77487def.js';
|
|
7
|
+
import { s as sqlExprDefaults } from './sql-expr-defaults-54db53a8.js';
|
|
8
|
+
import { t as toCompletionItemKind } from './arcade-language-features-8274cdc7.js';
|
|
9
|
+
import './index-38d652b8.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Manager to create our sql-expression worker and client proxy
|
|
@@ -1,10 +1,9 @@
|
|
|
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.11
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
import './index-3743d31f.js';
|
|
6
|
+
import { N as typescriptDefaults, M as monaco_editor_core_star } from './language-defaults-base-77487def.js';
|
|
8
7
|
|
|
9
8
|
/*!-----------------------------------------------------------------------------
|
|
10
9
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -1,10 +1,9 @@
|
|
|
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.11
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
import './index-3743d31f.js';
|
|
6
|
+
import { M as monaco_editor_core_star } from './language-defaults-base-77487def.js';
|
|
8
7
|
|
|
9
8
|
/*!-----------------------------------------------------------------------------
|
|
10
9
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
package/dist/loader/cdn.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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.11
|
|
5
5
|
*/
|
|
6
6
|
module.exports = require('../cjs/loader.cjs.js');
|
|
7
7
|
module.exports.applyPolyfills = function() { return Promise.resolve() };
|
package/dist/loader/index.cjs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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.11
|
|
5
5
|
*/
|
|
6
6
|
module.exports = require('../cjs/loader.cjs.js');
|
|
7
7
|
module.exports.applyPolyfills = function() { return Promise.resolve() };
|
|
@@ -1,7 +1,7 @@
|
|
|
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.11
|
|
5
5
|
*/
|
|
6
6
|
export * from '../esm/polyfills/index.js';
|
|
7
7
|
export * from '../esm/loader.js';
|
package/dist/loader/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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.11
|
|
5
5
|
*/
|
|
6
6
|
(function(){if("undefined"!==typeof window&&void 0!==window.Reflect&&void 0!==window.customElements){var a=HTMLElement;window.HTMLElement=function(){return Reflect.construct(a,[],this.constructor)};HTMLElement.prototype=a.prototype;HTMLElement.prototype.constructor=HTMLElement;Object.setPrototypeOf(HTMLElement,a)}})();
|
|
7
7
|
export * from '../esm/polyfills/index.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ApiProfile } from "@arcgis/arcade-languageservice";
|
|
2
|
+
import type { EditorProfile } from "../profile/editor-profile";
|
|
3
|
+
import type { IPredefinedProfile, IEditorProfileDefinition } from "../profile/types";
|
|
4
|
+
/**
|
|
5
|
+
* Converts an editor profile to an api profile.
|
|
6
|
+
* The api profile is an optimized version of the editor profile designed for minimal data transfer between the main thread and the worker.
|
|
7
|
+
*/
|
|
8
|
+
export declare function arcadeEditorToApiProfile(editorProfile: EditorProfile): Promise<ApiProfile>;
|
|
9
|
+
export declare function convertToEditorProfileDefinition(predefinedProfile: IPredefinedProfile, locale?: string): Promise<IEditorProfileDefinition | undefined>;
|
|
@@ -4,8 +4,8 @@ import type { ApiValueVariableType } from "@arcgis/arcade-languageservice";
|
|
|
4
4
|
*/
|
|
5
5
|
export declare function fieldTypeToIconName(field: __esri.Field): string;
|
|
6
6
|
/**
|
|
7
|
-
* Returns the
|
|
7
|
+
* Returns the ApiValueVariable type for the given field.
|
|
8
8
|
*/
|
|
9
|
-
export declare function
|
|
9
|
+
export declare function fieldTypeToApiValueVarType(field: __esri.Field): ApiValueVariableType;
|
|
10
10
|
export declare function supportedFields(fields: __esri.Field[] | null | undefined): __esri.Field[];
|
|
11
11
|
export declare function fieldAlias(field: __esri.Field): string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { ApiVariableType
|
|
1
|
+
import type { ApiVariableType } from "@arcgis/arcade-languageservice";
|
|
2
2
|
import type * as types from "./types";
|
|
3
|
+
import type { ApiValueVariable } from "@arcgis/languages-api-utils";
|
|
3
4
|
/**
|
|
4
5
|
* FeatureSetCollection interface. Used in Arcade expressions to represent Web Maps
|
|
5
6
|
* or Feature Services.
|
|
@@ -21,6 +22,10 @@ interface IFeatureSetCollections {
|
|
|
21
22
|
*/
|
|
22
23
|
source: __esri.Map | __esri.WebMap | __esri.WebScene | string;
|
|
23
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* converts fields to profile values and calculates the feature completion description all in one iteration
|
|
27
|
+
*/
|
|
28
|
+
export declare function fieldsToProfileValues(fields: __esri.Field[], initialFeatureCompletionDescription: string, includeAliases?: boolean): [ApiValueVariable[], string];
|
|
24
29
|
type ProfileItemType = ApiVariableType | "group";
|
|
25
30
|
export type EditorVariable = ArrayVariable | DictionaryVariable | FeatureSetCollectionVariable | FeatureSetVariable | FeatureVariable | ValueVariable;
|
|
26
31
|
interface ConstructorProperties<T> {
|
|
@@ -200,7 +205,7 @@ export declare class FeatureSetVariable extends SourceBasedVariable {
|
|
|
200
205
|
constructor(owner: CollectionBasedVariable | undefined, props: ConstructorProperties<types.IProfileFeatureSet>, featureSetSnippets?: ValueVariable[], relationshipProps?: IRelationshipsProperties);
|
|
201
206
|
get title(): types.IIntlString | string;
|
|
202
207
|
protected _loadSource(): Promise<types.SupportedSource | null>;
|
|
203
|
-
toProfileVariableDefinition(): types.
|
|
208
|
+
toProfileVariableDefinition(): types.IProfileFeatureSet;
|
|
204
209
|
}
|
|
205
210
|
export declare class FeatureSetCollectionVariable extends CollectionBasedVariable {
|
|
206
211
|
type: "featureSetCollection";
|
|
@@ -239,10 +244,6 @@ export declare class EditorProfile extends DictionaryVariable {
|
|
|
239
244
|
* Returns true if the profile supports feature set functions for snippets.
|
|
240
245
|
*/
|
|
241
246
|
get supportFeatureSetFunctions(): boolean;
|
|
242
|
-
/**
|
|
243
|
-
* Returns the language service profile. It is different than the editor profile as it is optimized for Monaco.
|
|
244
|
-
*/
|
|
245
|
-
toLSProfile(): Promise<ApiProfile>;
|
|
246
247
|
/**
|
|
247
248
|
* Returns the EditorProfile as a json. The EditorProfile may have been updated. This function allows to
|
|
248
249
|
* get the new json representing mutations.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type * as types from "./types";
|
|
2
|
+
import type { FeatureDefinition, FeatureSetCollectionDefinition, FeatureSetDefinition } from "./types";
|
|
2
3
|
export declare function isFeatureLayerLikeInstance(item: unknown): item is types.IFeatureLayerLikeInstance;
|
|
3
4
|
export declare function isGroupLayerCapable(item: unknown): item is types.IGroupLayerCapable;
|
|
4
5
|
export declare function isMapInstance(item: unknown): item is __esri.Map;
|
|
@@ -8,6 +9,9 @@ export declare function isFeatureLayerItemDefinition(item: unknown): item is typ
|
|
|
8
9
|
export declare function isFieldsDefinition(item: unknown): item is types.IFieldsDefinition;
|
|
9
10
|
export declare function isUrlDefinition(item: unknown): item is types.IUrlDefinition;
|
|
10
11
|
export declare function isSupportedServiceUrlDefinition(item: unknown): item is types.IUrlDefinition;
|
|
12
|
+
export declare function isFeatureDefinition(item: unknown): item is FeatureDefinition;
|
|
13
|
+
export declare function isFeatureSetDefinition(item: unknown): item is FeatureSetDefinition;
|
|
14
|
+
export declare function isFeatureSetCollectionDefinition(item: unknown): item is FeatureSetCollectionDefinition;
|
|
11
15
|
export declare function isSubtypeInstance(item: unknown): item is __esri.Subtype;
|
|
12
16
|
export declare function isCodedValueDomainInstance(item: unknown): item is __esri.CodedValueDomain;
|
|
13
17
|
export declare function isInheritedDomainInstance(item: unknown): item is __esri.InheritedDomain;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { EditorProfile } from "../profile/editor-profile";
|
|
2
|
+
import type { ApiProfile } from "@arcgis/languages-api-utils";
|
|
3
|
+
import type { IPredefinedProfile, IEditorProfileDefinition } from "../profile/types";
|
|
4
|
+
/**
|
|
5
|
+
* Converts an editor profile to an api profile.
|
|
6
|
+
* The api profile is an optimized version of the editor profile designed for minimal data transfer between the main thread and the worker.
|
|
7
|
+
*/
|
|
8
|
+
export declare const sqlExprEditorToApiProfile: (editorProfile: EditorProfile) => ApiProfile;
|
|
9
|
+
export declare function convertToEditorProfileDefinition(predefinedProfile: IPredefinedProfile, locale?: string): Promise<IEditorProfileDefinition | undefined>;
|
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.11",
|
|
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,20 +49,20 @@
|
|
|
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.11",
|
|
53
|
+
"@arcgis/components-controllers": "4.31.0-next.11",
|
|
54
|
+
"@arcgis/components-utils": "4.31.0-next.11",
|
|
55
|
+
"@arcgis/languages-api-utils": "4.31.0-next.11",
|
|
56
56
|
"@stencil/core": "4.17.1",
|
|
57
57
|
"monaco-editor": "0.45.0",
|
|
58
58
|
"vscode-languageserver-types": "^3.17.5"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@arcgis/components-plugins": "4.31.0-next.
|
|
61
|
+
"@arcgis/components-plugins": "4.31.0-next.11",
|
|
62
62
|
"@arcgis/core": ">=4.31.0-next <4.32",
|
|
63
|
-
"@arcgis/core-adapter": "4.31.0-next.
|
|
64
|
-
"@arcgis/storybook-utils": "4.31.0-next.
|
|
65
|
-
"@arcgis/typescript-config": "4.31.0-next.
|
|
63
|
+
"@arcgis/core-adapter": "4.31.0-next.11",
|
|
64
|
+
"@arcgis/storybook-utils": "4.31.0-next.11",
|
|
65
|
+
"@arcgis/typescript-config": "4.31.0-next.11",
|
|
66
66
|
"@esri/calcite-components": "^2.8.0",
|
|
67
67
|
"@stencil/angular-output-target": "0.8.4",
|
|
68
68
|
"@stencil/react-output-target": "0.5.3",
|
|
@@ -102,5 +102,5 @@
|
|
|
102
102
|
"@arcgis/core": ">=4.31.0-next <4.32",
|
|
103
103
|
"@esri/calcite-components": "^2.8.0"
|
|
104
104
|
},
|
|
105
|
-
"gitHead": "
|
|
105
|
+
"gitHead": "5490d4870ed02b53f0fd6d1f611b207be818d9ac"
|
|
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.10
|
|
5
|
-
*/
|
|
6
|
-
import{F as e,e as t,u as n,J as s}from"./p-790067b1.js";import{C as r,F as i,D as o}from"./p-6e28fd70.js";import"./p-22253750.js";var a=[[],[],[]];["++","--"].forEach((e=>a[e.length-1]?.push(e))),["-","+","!","~"].forEach((e=>a[e.length-1]?.push(e))),["||","&&"].forEach((e=>a[e.length-1]?.push(e))),["=","/=","*=","%=","+=","-="].forEach((e=>a[e.length-1]?.push(e))),["|","&",">>","<<",">>>","^","==","!=","<","<=",">",">=","+","-","*","/","%"].forEach((e=>a[e.length-1]?.push(e)));var c=Object.values({Break:"break",Continue:"continue",Else:"else",For:"for",From:"from",Function:"function",If:"if",Import:"import",Export:"export",In:"in",Return:"return",Var:"var",While:"while"});Object.values({False:"false",Null:"null",True:"true"}).map((t=>({label:t,kind:e.exports.CompletionItemKind.Constant}))),c.map((t=>({label:t,kind:e.exports.CompletionItemKind.Keyword})));const u={wordPattern:/(-?\d*\.\d\w*)|([^`~!#%\^&\*\(\)\-=\+\[\{\]\}\\\|;:'",\.<>\/\?\s]+)/gu,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]},{open:"`",close:"`",notIn:["string","comment"]}],autoCloseBefore:";:.,=}])` \n\t",folding:{markers:{start:/^\s*\/\/\s*#?region\b/u,end:/^\s*\/\/\s*#?endregion\b/u}},indentationRules:{decreaseIndentPattern:/^((?!.*?\/\*).*\*\/)?\s*[\}\]\)].*$/u,increaseIndentPattern:/^((?!\/\/).)*(\{[^}"'`]*|\([^)"'`]*|\[[^\]"'`]*)$/u}},g={defaultToken:"invalid",tokenPostfix:".arc",ignoreCase:!0,keywords:c.filter((e=>"from"!==e)),operators:["<=",">=","==","!=","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","=","+=","-=","*=","**=","/=","%="],constants:["true","false","null"],symbols:/[=><!~?:&|+\-*\/\^%]+/u,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/u,digits:/\d+(_+\d+)*/u,octaldigits:/[0-7]+(_+[0-7]+)*/u,binarydigits:/[0-1]+(_+[0-1]+)*/u,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/u,regexpctl:/[(){}\[\]\$\^|\-*+?\.]/u,regexpesc:/\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/u,tokenizer:{root:[[/[{}]/u,"delimiter.bracket"],{include:"common"}],common:[[/import(?=\s)/u,{token:"keyword",next:"@import"}],[/[a-z_$][\w$]*/u,{cases:{"@constants":"constant","@keywords":"keyword","@default":"identifier"}}],{include:"@whitespace"},[/\/(?=([^\\\/]|\\.)+\/([gimsuy]*)(\s*)(\.|;|\/|,|\)|\]|\}|$))/u,{token:"regexp",bracket:"@open",next:"@regexp"}],[/[()\[\]]/u,"@brackets"],[/[<>](?!@symbols)/u,"@brackets"],[/@symbols/u,{cases:{"@operators":"delimiter","@default":""}}],[/(@digits)[eE]([\-+]?(@digits))?/u,"number"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/u,"number"],[/0[xX](@hexdigits)/u,"number"],[/0[oO]?(@octaldigits)/u,"number"],[/0[bB](@binarydigits)/u,"number"],[/(@digits)/u,"number"],[/[;,.]/u,"delimiter"],[/"([^"\\]|\\.)*$/u,"string.invalid"],[/'([^'\\]|\\.)*$/u,"string.invalid"],[/"/u,"string","@string_double"],[/'/u,"string","@string_single"],[/`/u,"string","@string_backtick"]],import:[[/import(?=\s)/u,{token:"keyword"}],{include:"@whitespace"},[/[a-z_$][\w$]*/u,"identifier"],{include:"@whitespace"},[/from/u,{token:"keyword",next:"@popall"}]],whitespace:[[/[ \t\r\n]+/u,""],[/\/\*/u,"comment","@comment"],[/\/\/.*$/u,"comment"]],comment:[[/[^\/*]+/u,"comment"],[/\*\//u,"comment","@pop"],[/[\/*]/u,"comment"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/u,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/u,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/u,["regexp.escape.control","regexp.escape.control"]],[/[()]/u,"regexp.escape.control"],[/@regexpctl/u,"regexp.escape.control"],[/[^\\\/]/u,"regexp"],[/@regexpesc/u,"regexp.escape"],[/\\\./u,"regexp.invalid"],[/(\/)([gimsuy]*)/u,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],regexrange:[[/-/u,"regexp.escape.control"],[/\^/u,"regexp.invalid"],[/@regexpesc/u,"regexp.escape"],[/[^\]]/u,"regexp"],[/\]/u,{token:"regexp.escape.control",next:"@pop",bracket:"@close"}]],string_double:[[/[^\\"]+/u,"string"],[/@escapes/u,"string.escape"],[/\\./u,"string.escape.invalid"],[/"/u,"string","@pop"]],string_single:[[/[^\\']+/u,"string"],[/@escapes/u,"string.escape"],[/\\./u,"string.escape.invalid"],[/'/u,"string","@pop"]],string_backtick:[[/\$\{/u,{token:"delimiter.bracket",next:"@bracketCounting"}],[/[^\\`$]+/u,"string"],[/@escapes/u,"string.escape"],[/\\./u,"string.escape.invalid"],[/`/u,"string","@pop"]],bracketCounting:[[/\{/u,"delimiter.bracket","@bracketCounting"],[/\}/u,"delimiter.bracket","@pop"],{include:"common"}]}};class p{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),this._client=null}async _getClientProxy(){if(!this._client){const{languageId:e,languageOptions:n}=this._defaults;this._worker=t.createWebWorker({moduleId:"ArcadeWorker",label:e,createData:{languageId:e,languageOptions:n}}),this._client=this._worker.getProxy()}return await this._client}async getLanguageServiceWorker(...e){const t=await this._getClientProxy();return await(this._worker?.withSyncedResources(e)),t}}let l;async function d(...e){return await new Promise(((t,n)=>{l?t(l(...e)):n(new Error("TypeScript not registered!"))}))}const m=new class{constructor(){this._onDiagnosticsChange=new s}get onDiagnosticsChange(){return this._onDiagnosticsChange.event}fireDiagnosticsChange(e,t){this._onDiagnosticsChange.fire({uri:e,diagnostics:t})}};function x(){return m}function k(e){const t=new p(e),s=async(...e)=>await t.getLanguageServiceWorker(...e);l=s,n.setMonarchTokensProvider(e.languageId,g),n.setLanguageConfiguration(e.languageId,u),n.registerCompletionItemProvider(e.languageId,new r(s,e)),n.registerDocumentFormattingEditProvider(e.languageId,new i(s,e)),new o(e.languageId,s,{defaults:e,diagnosticsService:m})}export{x as getArcadeDiagnosticService,d as getArcadeWorker,k as setupMode}
|
|
@@ -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.10
|
|
5
|
-
*/
|
|
6
|
-
import{y as t,D as i,z as s,A as e,B as n,i as o,C as r,F as c,L as a,f as h,E as u,U as d}from"./p-790067b1.js";import{g as l}from"./p-22253750.js";var f,p=(t,i)=>t.manager.internals.members?.[i]?.[0],y=Symbol.for("controller");function v(t){f!==t&&(f=t,queueMicrotask((()=>{f===t&&(f=void 0)})))}function g(){return f}var w,b=[];function m(t){if(void 0===t)return void(b=[]);const i=b.indexOf(t);b=-1===i?[...b,t]:b.slice(0,i+1),queueMicrotask((()=>{b=[]}))}var k,L=async(t,i)=>{const s=D(t);if(void 0===s)return t;if(await s.ready,"function"==typeof i){const t=s.watchExports((s=>i(s,t)))}return s.exports},M=async t=>{const i=D(t);return await i.ready,i},D=t=>{const i=function(){const t=w;return w=void 0,t}();if(void 0!==i)return i;const s=g().manager.internals.resolveExports(t);return void 0!==s?s:(t=>"object"==typeof t&&null!==t&&(y in t||"hostConnected"in t||"hostDisconnected"in t||"hostUpdate"in t||"hostUpdated"in t))(t)?t:void 0},j={setter:!1,getter:!1,readOnly:!1},x=new WeakMap,$=class{constructor(t){this._callbacks={hostConnected:[],hostDisconnected:[],hostLoad:[],hostLoaded:[],hostUpdate:[],hostUpdated:[],hostDestroy:[],hostLifecycle:[]},this._ready=new i,this._lifecycleCleanups=[],this.connectedCalled=!1,this.willLoadCalled=!1,this.didLoadCalled=!1,this[k]=!0,this.ready=this._ready.promise,this._exports=U(this),this._exportWatchers=new Set;const s=t??g();this.component=s,this.component.addController(this),m(this),void 0===this.component.manager||queueMicrotask((()=>this.catchUpLifecycle()))}catchUpLifecycle(){const{manager:t}=this.component;!t.connectedCalled||this.connectedCalled||this.triggerConnected(),!t.willLoadCalled||this.triggerLoad().then((()=>{!t.didLoadCalled||this.triggerLoaded()})).catch(console.error)}get exports(){return this._exports}set exports(t){const i=this._exports;i!==t&&(this._exports=t,this._exportWatchers.forEach(n),this.connectedCalled&&!1!==this.assignedProperty&&this.component.requestUpdate(this.assignedProperty,i)),this._ready.resolve(t)}setProvisionalExports(t){this._exports=U(t),this._exportWatchers.forEach(n)}watchExports(t){const i=()=>t(this._exports);return this._exportWatchers.add(i),()=>{this._exportWatchers.delete(i)}}get use(){return v(this.component),L}get useRef(){return v(this.component),M}get useRefSync(){return v(this.component),D}controllerRemoved(){this.component.el.isConnected&&this.triggerDisconnected(),this.triggerDestroy()}onConnected(t){this._callbacks.hostConnected.push(t)}onDisconnected(t){this._callbacks.hostDisconnected.push(t)}onLoad(t){this._callbacks.hostLoad.push(t)}onLoaded(t){this._callbacks.hostLoaded.push(t)}onUpdate(t){this._callbacks.hostUpdate.push(t)}onUpdated(t){this._callbacks.hostUpdated.push(t)}onDestroy(t){this._callbacks.hostDestroy.push(t)}onLifecycle(t){this._callbacks.hostLifecycle.push(t),this.connectedCalled&&this.component.el.isConnected&&this._callLifecycle(t)}triggerConnected(){const t=this;t.hostConnected&&n(t.hostConnected,t),this._callbacks.hostConnected.forEach(n),this.triggerLifecycle(),this.connectedCalled=!0}triggerDisconnected(){const t=this;t.hostDisconnected&&n(t.hostDisconnected,t),this._callbacks.hostDisconnected.forEach(n),this._lifecycleCleanups.forEach(n),this._lifecycleCleanups=[]}async triggerLoad(){if(this.willLoadCalled)return;this.willLoadCalled=!0;const t=this;t.hostLoad&&await s(t.hostLoad,t),this._callbacks.hostLoad.length>0&&await Promise.allSettled(this._callbacks.hostLoad.map(s)),this._ready.resolve(this._exports)}triggerLoaded(){if(this.didLoadCalled)return;const t=this;t.hostLoaded&&n(t.hostLoaded,t),this._callbacks.hostLoaded.forEach(n),this.didLoadCalled=!0}triggerUpdate(t){const i=this;i.hostUpdate&&n(i.hostUpdate,i,t),this._callbacks.hostUpdate.forEach(A,t)}triggerUpdated(t){const i=this;i.hostUpdated&&n(i.hostUpdated,i,t),this._callbacks.hostUpdated.forEach(A,t)}triggerDestroy(){const t=this;t.hostDestroy&&n(t.hostDestroy,t),this._callbacks.hostDestroy.forEach(n)}triggerLifecycle(){const t=this;t.hostLifecycle&&this._callLifecycle((()=>t.hostLifecycle())),this._callbacks.hostLifecycle.forEach(this._callLifecycle,this)}_callLifecycle(t){v(this.component);const i=n(t);(Array.isArray(i)?i:[i]).forEach((t=>{"function"==typeof t?this._lifecycleCleanups.push(t):"object"==typeof t&&"function"==typeof t.remove&&this._lifecycleCleanups.push(t.remove)}))}};function A(t){n(t,void 0,this)}k=y;var P=$;function U(t){if("object"!=typeof t&&"function"!=typeof t||null===t)return t;const i=new Proxy(t,{get(t,s,e){if(!C.has(s)||!(s in t)||t[s]!==i)return s in t||s in Promise.prototype||"symbol"==typeof s?"function"==typeof t?t[s]:Reflect.get(t,s,e):void 0},set:(t,i,s,e)=>Reflect.set(t,i,s,e)});return i}var C=new Set(["exports","_exports"]),S=void 0;function O(){Array.from(S?.entries()??[]).forEach((([t,{callbacks:i}])=>{const s=Object.keys(t);i.forEach((t=>t(s)))})),S=void 0}function q(t,i,s){var e;const o=i,r=t.manager.internals;(e=r.allWatchers)[o]??(e[o]=[]);const c=r.allWatchers[o],a=s,h=(t,i,s)=>n(a,null,t,i,s);return c.push(h),()=>{const t=c.indexOf(h);-1!==t&&c.splice(t,1)}}var T=class{constructor(t){this.enabledWatchers={},this.allWatchers={},this.enableReadonly=()=>{if(this.enableReadonly=void 0,!this.component.manager.isLit)return;const t=this.component.manager.internals;Object.entries(t.members).forEach((([i,[s]])=>{var e;2048&s&&((e=t.setters)[i]??(e[i]=[]),t.setters[i].push(t.readonlySetter))}))},this.trackedValue=F,this.keyTrackers=[],this.getters={},this.setters={},this.accessorGetter={},this.accessorSetter={},this.reactiveUtilsIntegrations=new Set,this._exports=new WeakMap,this.readonlySetter=(t,i,s)=>{if(j.readOnly)return t;throw new Error(`Cannot assign to read-only property "${s}" of ${this.component.el.tagName.toLowerCase()}. Trying to assign "${String(t)}"`)},this.component=t}firePropTrackers(t,i){const s=this.keyTrackers;this.trackedValue=F,this.keyTrackers=[],s.forEach((s=>s(t,i)))}getSetProxy(t){const i=this.component,s=i.constructor.prototype;if(this._getSetProxy(s,t,"class"),i.manager.isLit)return;const e=i.el.constructor.prototype;s!==e&&this._getSetProxy(e,t,"html")}_getSetProxy(t,i,s){const e=p(this.component,i),n=Object.getOwnPropertyDescriptor(t,i);if(!n)return;const o=n.get,r=n.set,c=!(E in o),a=!(E in r);if(!c&&!a)return;const h=c?function(){let t=o.call(this);const s=x.get(this);if(void 0===s)return t;const e=s.manager.internals;t=e.accessorGetter[i](t,i);const n=e.getters[i]??_;for(let s=0;s<n.length;s++)t=n[s](t,i);return t}:o,u=a?function(t){const s=o.call(this),n=x.get(this);if(void 0===n)return void r.call(this,t);let c=n.manager.isLit?t:function(t,i=8){return null==t||"object"==typeof t||"function"==typeof t?t:4&i?"false"!==t&&(""===t||!!t):2&i?Number.parseFloat(t):1&i?String(t):t}(t,e);const a=n.manager.internals;if(c===s)r.call(this,t);else{const t=j.setter?_:a.setters[i]??_;for(let e=0;e<t.length&&(c=t[e](c,s,i),c!==s);e++);c=a.accessorSetter[i](c,s,i),r.call(this,c),c!==s&&a.enabledWatchers[i]?.forEach((t=>t(c,s,i)))}a.keyTrackers.length>0&&a?.firePropTrackers(i,t)}:r;c&&(h[E]=!0),a&&(u[E]=!0),Object.defineProperty(t,i,{...n,get:h,set:u})}markExports(t,i){("object"==typeof i&&null!==i||"function"==typeof i)&&this._exports.set(i,t)}resolveExports(t){return"object"==typeof t&&null!==t||"function"==typeof t?this._exports.get(t):void 0}},_=[],E=Symbol(),F=Symbol(),R=(t,i)=>new I(t,i),I=class extends P{constructor(s,e){const n="addController"in s,o=new Set,r=s;if(r.addController=function(t){o.add(t),n&&!(y in t)&&s.el.isConnected&&t.hostConnected?.()},r.removeController=function(t){o.delete(t),t.controllerRemoved?.()},!n){const t=e??s.constructor.__forceUpdate;r.requestUpdate=()=>t(s)}super(s),this.internals=new T(this.component),this.destroyed=!1,this._updatePromise=new i,this._originalLifecycles={},this.isLit=n,this.component.manager=this,function(i,s){if(s)i.manager.internals.members=Object.fromEntries(Array.from(i.constructor.elementProperties,(([t,i])=>i.noAccessor?void 0:[t,[(i.readOnly?2048:0)|(i.state?32:i.type===Number?2:i.type===Boolean?4:1)]])).filter(t));else{const t=i.constructor,s=t.__registerControllers?.(i)??void 0;if(t.__registerControllers=void 0,"object"!=typeof s)throw new Error("Failed to retrieve component meta");i.manager.internals.members=Object.fromEntries(Object.entries(s).filter((([t,[i]])=>!!(63&i))))}}(s,n),this._controllers=o,this.exports=void 0,this.hasDestroy=N in this.component&&"function"==typeof this.component.destroy,this.hasDestroy&&q(s,N,(()=>this._setAutoDestroyTimeout())),this._bindLifecycleMethods();const c=this.internals;Object.keys(c.members).forEach((t=>{c.accessorGetter[t]=B,c.accessorSetter[t]=B,c.getSetProxy(t)})),n||Object.defineProperty(s,"updateComplete",{get:async()=>await this._updatePromise.promise}),queueMicrotask(c.enableReadonly),m(void 0),v(s),x.set(s.el,s),x.set(s,s)}_bindLifecycleMethods(){const t=this.component,i=this.isLit,s=t.el===t;this._originalLifecycles={connectedCallback:i||s?void 0:t.connectedCallback,disconnectedCallback:i||s?void 0:t.disconnectedCallback,componentWillLoad:i?void 0:t.componentWillLoad,componentDidLoad:i?void 0:t.componentDidLoad,componentWillUpdate:i?void 0:t.componentWillUpdate,componentDidUpdate:i?void 0:t.componentDidUpdate,destroy:t.destroy};const e=this._connectedCallback.bind(this),n=this._disconnectedCallback.bind(this),o=this._update.bind(this),r=this._updated.bind(this);i?t.constructor.prototype.addController.call(t,{hostConnected:e,hostDisconnected:n,hostUpdate:o,hostUpdated:r}):(t.connectedCallback=e,t.disconnectedCallback=n,t.componentWillLoad=this._load.bind(this),t.componentDidLoad=this._loaded.bind(this),t.componentWillUpdate=o,t.componentDidUpdate=r),this.hasDestroy&&(t.destroy=this.destroy.bind(this))}_connectedCallback(){if(this.destroyed){const t=this.component.el.tagName.toLowerCase();throw this.component.el.remove(),new Error(`The ${t} component has already been destroyed. It can not be used again. If you meant to disconnect and reconnect a component without automatic destroy, set the ${N} prop.`)}void 0!==this._autoDestroyTimeout&&clearTimeout(this._autoDestroyTimeout);const t=this.internals;t.enabledWatchers=t.allWatchers,O(),t.enableReadonly?.(),this._controllers.forEach(V),this._originalLifecycles.connectedCallback?.call(this.component)}_disconnectedCallback(){this.destroyed||(this._controllers.forEach(z),this._originalLifecycles.disconnectedCallback?.call(this.component),this.hasDestroy&&this._setAutoDestroyTimeout())}async _load(){const t=this.internals.reactiveUtilsIntegrations;if(t.size>0)for(const i of t)"triggerLoad"in i?await i.triggerLoad():await s(i.hostLoad,i);await Promise.allSettled(Array.from(this._controllers,G,t)),await(this._originalLifecycles.componentWillLoad?.call(this.component))}_loaded(){this._controllers.forEach(H),this._originalLifecycles.componentDidLoad?.call(this.component)}_update(){this._controllers.forEach(J,this.component.changedProperties),this._originalLifecycles.componentWillUpdate?.call(this.component)}_updated(){const t=this.component;if(this._controllers.forEach(K,t.changedProperties),this._originalLifecycles.componentDidUpdate?.call(this.component),this.isLit)t.changedProperties=new Map;else{const t=this._updatePromise;this._updatePromise=new i,t.resolve(!0)}}async destroy(){if(!this.destroyed){if(this.component.el.isConnected){this.hasDestroy=!1;try{this.component.el.remove()}finally{this.hasDestroy=!0}}this._autoDestroyTimeout=void 0,this.destroyed=!0,this._controllers.forEach(Q),this._controllers.clear(),await(this._originalLifecycles.destroy?.call(this.component))}}_setAutoDestroyTimeout(){this.component.el.isConnected||this.component.autoDestroyDisabled||(void 0!==this._autoDestroyTimeout&&clearTimeout(this._autoDestroyTimeout),this._autoDestroyTimeout=e((()=>{this.destroy().catch(console.error)}),W))}},N="autoDestroyDisabled",W=1e3,B=t=>t;function V(t){"triggerConnected"in t?t.triggerConnected():n(t.hostConnected,t)}function z(t){"triggerDisconnected"in t?t.triggerDisconnected():n(t.hostDisconnected,t)}async function G(t){this.has(t)||("triggerLoad"in t?await t.triggerLoad():await s(t.hostLoad,t))}function H(t){"triggerLoaded"in t?t.triggerLoaded():n(t.hostLoaded,t)}function J(t){"triggerUpdate"in t?t.triggerUpdate(this):n(t.hostUpdate,t,this)}function K(t){"triggerUpdated"in t?t.triggerUpdated(this):n(t.hostUpdated,t,this)}function Q(t){"triggerDestroy"in t?t.triggerDestroy():n(t.hostDestroy,t)}function X(t,i,s){const e=t.manager.internals;return e.trackedValue!==F&&e.trackedValue!==s&&e.firePropTrackers(void 0,void 0),0===e.keyTrackers.length&&queueMicrotask((()=>e.firePropTrackers(void 0,void 0))),e.trackedValue=s,e.keyTrackers.push(((t,e)=>n(i,void 0,s===e?t:void 0))),s}function Y(t,i){const s=g();return X(s,(e=>{const n=e,o=s.manager,r=s,c=r[n];if(null!=c&&c!==t&&"function"==typeof i.set&&(i.initialSet??1)){const s=i.set(c,t,n);if(s!==c)if(o.isLit)r[n]=s;else{let t=!0;o.onConnected((()=>{t&&(t=!0,function(){j.setter=!0;try{return void(r[n]=s)}finally{j.setter=!1}}())}))}}!function(t,i,s){var e,n;const o=s,r=t.manager.internals,c="function"==typeof o.get?o.get:void 0;c&&((e=r.getters)[i]??(e[i]=[]),r.getters[i].unshift(c));const a="ignore"===o.set?tt:o.set;a&&((n=r.setters)[i]??(n[i]=[]),r.setters[i].unshift(a))}(s,n,i)}),t)}var Z,tt=(t,i)=>i,it=t=>st(void 0,t),st=(Z=class extends ${constructor(t,i){super(t);const s=this.exports;try{v(this.component);const t=i(this.component,this),e=this.exports!==s;if(t instanceof Promise){e||this.setProvisionalExports(t);const i=t.then((t=>{this.exports=t,super.catchUpLifecycle()})).catch((t=>{this._ready.reject(t),console.error(t)}));this.onLoad((async()=>await i))}else e&&void 0===t||(this.exports=t),queueMicrotask((()=>super.catchUpLifecycle()))}catch(t){this._ready.reject(t),console.error(t)}}catchUpLifecycle(){}},(...t)=>{const i=b,s=new Z(...t),e=s.exports;m(i.at(-1));const o=s.component.manager.internals;var r;return o.markExports(s,e),s.watchExports((t=>o.markExports(s,t))),w!==(r=s)&&(w=r,queueMicrotask((()=>{w===r&&(w=void 0)}))),function(t,i,s){const e=Array.isArray(t)?t:[t];let o=e.length+1;const r=t=>{o-=1,void 0!==t&&(o=0),0===o&&i(t)};e.forEach((t=>function(t,i,s){const e=Object.keys(t),o=e.length;void 0===S&&queueMicrotask(O),S??(S=new Map);let r=S.get(t);return void 0===r&&(r={callbacks:[],keyCount:o},S.set(t,r)),r.keyCount!==o&&(r.callbacks.forEach((t=>t(e))),r.callbacks=[],r.keyCount=o),r.callbacks.push((e=>{const r=e[o];n(i,null,void 0===r?void 0:t[r]===s?r:void 0)})),s}(t,(i=>r(void 0===i?void 0:{key:i,host:t,isReactive:!1})),s)));const c=e.find((t=>"manager"in t&&"object"==typeof t.manager&&t.manager.component===t));return c&&X(c,(t=>r(void 0===t?void 0:{key:t,host:c,isReactive:void 0!==p(c,t)})),s),s}([s.component,...i].reverse(),(t=>void 0===t?void 0:function(t,{host:i,key:s,isReactive:e},n){const o=i,r=o[s]!==n;o[s]!==t.exports&&!r&&n!==t.exports&&(o[s]=t.exports);if(i===t.component){if(e){const i=t.component.manager.internals;r&&i.markExports(t,o[s]),q(t.component,s,(s=>{s!==t.exports&&i.markExports(t,s)}))}t.assignedProperty=e?void 0:s}t.watchExports((()=>{if(o[s]===t.exports)return;const i=t.component.manager,e=i.internals.setters[s]?.includes(i.internals.readonlySetter);e?function(){j.readOnly=!0;try{return void(o[s]=t.exports)}finally{j.readOnly=!1}}():o[s]=t.exports}))}(s,t,e)),e)});const et={en:{id:"field-calculation",variables:[{name:"$layer",type:"featureSet",description:"The layer being calculated."}]}};var nt=class{constructor(t){this._settings=t,this.sdkCategoriesCache=new Map}async getApiDatabase(t){let{locale:i="en"}=t,s=this.sdkCategoriesCache.get(i);if(!s){let{assetsPath:t}=this._settings;if(!t)return{categories:[],functionDefinitions:new Map,constantDefinitions:new Map};s=this.loadSdkApiLibrary(i,t),this.sdkCategoriesCache.set(i,s)}return await async function(t,i){try{let s=await t,e=new Map,n=new Map,o=[],r=function(t){let{profile:{apiVersion:i,bundles:s,hiddenApiItems:e=[]}={}}=t,n=rt(i),o=Array.isArray(s)&&s.length>0?new Set(["core",...s]):void 0;return t=>function(t,i){if(!t)return!0;let s=rt(i);return!s||!(t.major>s.major)&&(void 0===t.minor||void 0===s.minor||s.minor<=t.minor)}(n,t.sinceVersion)&&(!o||o.has(t.bundle))&&!e.includes(t.name)}(i);return s.forEach((t=>{let i=[];t.items.forEach((t=>function(t,i,s,e,n){Array.isArray(n)?n.forEach((i=>ot(t,s,e,i))):"constant"===n.type?function(t,i,s,e){if(!s(e))return;t.push(e);let{completion:{label:n}}=e,o=n.toLowerCase();i.set(o,e);let[r,a]=e.completion.label.split(".");if(!a)return;let h=r.toLowerCase(),u=i.get(h);u||(u={type:"namespace",key:h,members:[],completion:{label:r,detail:r,insertText:r,insertTextMode:c.exports.InsertTextMode.adjustIndentation,insertTextFormat:c.exports.InsertTextFormat.PlainText,kind:c.exports.CompletionItemKind.Enum}},i.set(h,u));let d=structuredClone(e);d.name=a,d.completion.label=a,d.completion.insertText=a,d.completion.kind=c.exports.CompletionItemKind.Constant,u.members.push(d),u.completion.documentation=u.members.reduce(((t,i)=>(t.value=`${t.value}${t.value?"\n\n":""}**${i.completion.label}**: ${i.description}`,t)),{kind:c.exports.MarkupKind.Markdown,value:""})}(t,i,e,n):ot(t,s,e,n)}(i,n,e,r,t))),i.length&&o.push({...t,items:i})})),{categories:o,functionDefinitions:e,constantDefinitions:n}}catch{return{categories:[],functionDefinitions:new Map,constantDefinitions:new Map}}}(s,t)}async getApiLibrary(t){let{categories:i}=await this.getApiDatabase(t);return i}async loadSdkApiLibrary(t="en",i=""){if(Array.isArray(this._settings.testSdkCategories))return this._settings.testSdkCategories;if(!(i=i.replace(/\/$/u,"")))return[];try{let s=this._settings.apiPathTemplate.replace("${assetsPath}",i).replace("${locale}",t),e=await fetch(s);return e.ok?await e.json():"en"===t?[]:await this.loadSdkApiLibrary("en",i)}catch{return[]}}};function ot(t,i,s,e){if(!s(e))return;e.disableDocumentation||t.push(e);let{completion:{label:n}}=e,o=n.toLowerCase(),r=i.get(o);r||(r={type:"functionDefinition",key:o,overloads:[]},i.set(o,r)),r.overloads.push(e)}function rt(t){if(!t||"string"!=typeof t)return null;let i=t.split(".").map((t=>Number.parseInt(t)));if(i.some(Number.isNaN))return console.error("Invalid API version string",t),null;let[s,e]=i.slice(0,2);return{major:s,minor:e}}const ct="arcgis-sql-expression",at=new class extends a{constructor(){super(...arguments),this._languageId=ct,this._languageOptions={},this._layerMap=new Map}updateFeatureLayerForModel(t,i){const s=this._getApiKey(t);this._layerMap.set(s,i),this._onDidChange.fire(this)}setLanguageOptions(t){this._languageOptions=t}getFeatureLayerForModel(t){const i=this._getApiKey(t);return this._layerMap.get(i)}async setProfileForModel(t,i,s={locale:"en"}){o(i)&&(i=await async function(t,i="en"){if(!o(t))return;const s=await async function(t="en"){return await Promise.resolve(et[t])}(i);if(!s)return;const e={variables:[],hiddenApiItems:t.hiddenApiItems?.map((t=>t.toLowerCase()))};return s.variables.forEach((i=>{if(t.disabledVariables?.includes(i.name))return;const s=t.definitions[i.name];if("featureSet"===i.type)return r(s)?e.variables.push({...i,type:i.type,definition:s}):void 0;throw Error(`sdkVariable type not supported (yet) type: ${i.type}`)})),e}(i,s.locale));const e=await h(s.locale,l("./assets/arcade-language/t9n"),"profile.t9n.");if(!e)throw new Error(`Failed to load the language bundle for ${s.locale}`);this.disposeForModel(t);const n=this._getApiKey(t),c=new u(i,e);this._profileMap.set(n,c);const a=await c.toLSProfile();this.updateApiContextForModel(t,{locale:s.locale,profile:a});const d=i?.variables?.find((t=>"$layer"===t.name));d&&this.updateFeatureLayerForModel(t,d.definition)}async getApiLibrary(t){const i=d.parse(t);let s=this._apiService;return s||(s=new nt({assetsPath:l("./assets/sql-expression-editor"),languageId:ct,apiPathTemplate:"${assetsPath}/api/sql-expression-api.t9n.${locale}.json"}),this._apiService=s),await s.getApiLibrary(this.getApiContextForModel(i))}};export{Y as g,it as m,at as s,R as u,q as w}
|
|
@@ -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.10
|
|
5
|
-
*/
|
|
6
|
-
import{L as a,i as t,c as s,f as i,E as n,U as e}from"./p-790067b1.js";import{g as o}from"./p-22253750.js";async function r(){return(await c()).getArcadeDiagnosticService()}async function c(){return await import("./p-50484a4f.js")}const l=new class extends a{constructor(){super(...arguments),this._languageId="arcade",this._languageOptions={}}async setProfileForModel(a,e,r={locale:"en"}){t(e)&&(e=await s(e,r.locale));const c=await i(r.locale,o("./assets/arcade-language/t9n"),"profile.t9n.");if(!c)throw new Error(`Failed to load the language bundle for ${r.locale}`);this.disposeForModel(a);const l=this._getApiKey(a),h=new n(e,c);this._profileMap.set(l,h);const p=await h.toLSProfile();this.updateApiContextForModel(a,{locale:r.locale,profile:p,snippets:r.snippets})}setLanguageOptions(a={}){this._languageOptions.assetsPath!==a.assetsPath&&(this._languageOptions={...this._languageOptions,...a},this._onDidChange.fire(this))}async getApiLibrary(a){const t=e.parse(a),s=await async function(a){const t=await c();return await t.getArcadeWorker(a)}(t);return await s.getApiLibrary(this.getApiContextForModel(t))}},h={setProfileForModel:l.setProfileForModel.bind(l)};export{h as a,l as b,c,r as g}
|
|
@@ -1,116 +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.10
|
|
5
|
-
*/
|
|
6
|
-
'use strict';
|
|
7
|
-
|
|
8
|
-
const languageDefaultsBase = require('./language-defaults-base-b32cb091.js');
|
|
9
|
-
const index = require('./index-37a86ff4.js');
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Returns the arcade diagnostic service.
|
|
13
|
-
* Example:
|
|
14
|
-
* ```ts
|
|
15
|
-
* const diagnosticService = await getArcadeDiagnosticService();
|
|
16
|
-
* diagnosticService.onDidChangeDiagnostics(({uri, diaganostics }) => {
|
|
17
|
-
* // Filter the diagnostics for the uri of interest
|
|
18
|
-
* // Do something with the diagnostics
|
|
19
|
-
* });
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
async function getArcadeDiagnosticService() {
|
|
23
|
-
const mode = await getMode();
|
|
24
|
-
return mode.getArcadeDiagnosticService();
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Returns the arcade worker for the model.
|
|
28
|
-
* Example:
|
|
29
|
-
* ```ts
|
|
30
|
-
* const arcadeWorker = await getArcadeWorker(model.uri);
|
|
31
|
-
* ```
|
|
32
|
-
* @returns arcade worker
|
|
33
|
-
*/
|
|
34
|
-
async function getArcadeWorker(uri) {
|
|
35
|
-
const mode = await getMode();
|
|
36
|
-
return await mode.getArcadeWorker(uri);
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Request the arcade mode
|
|
40
|
-
* @returns arcade mode module
|
|
41
|
-
*/
|
|
42
|
-
async function getMode() {
|
|
43
|
-
return await Promise.resolve().then(function () { return require('./arcade-mode-dce44622.js'); });
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const arcadeLanguageId = "arcade";
|
|
47
|
-
class ArcadeLanguageServiceDefaults extends languageDefaultsBase.LanguageDefaultsBase {
|
|
48
|
-
constructor() {
|
|
49
|
-
super(...arguments);
|
|
50
|
-
this._languageId = arcadeLanguageId;
|
|
51
|
-
this._languageOptions = {};
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Create an EditorProfile for the given model id using the given definition and locale.
|
|
55
|
-
* The EditorProfile is used by the the Arcade Language service as well by the cosing components.
|
|
56
|
-
* The definition can be a pre-defined profile or an editor profile definition.
|
|
57
|
-
* If the locale is not provided then the 'en' locale is used.
|
|
58
|
-
* @param modelId The model id for which to create the context.
|
|
59
|
-
* @param definition The definition to use for the model context.
|
|
60
|
-
* @param locale The locale to use for the model context.
|
|
61
|
-
* @returns The EditorProfile for the model.
|
|
62
|
-
*/
|
|
63
|
-
async setProfileForModel(modelId, definition, apiContext = { locale: "en" }) {
|
|
64
|
-
// Convert pre-defined profile to a runtime profile
|
|
65
|
-
if (languageDefaultsBase.isPredefinedProfile(definition)) {
|
|
66
|
-
definition = await languageDefaultsBase.convertToEditorProfileDefinition(definition, apiContext.locale);
|
|
67
|
-
}
|
|
68
|
-
const profileStrings = await languageDefaultsBase.fetchT9nStringsBundle(apiContext.locale, index.getAssetPath("./assets/arcade-language/t9n"), "profile.t9n.");
|
|
69
|
-
if (!profileStrings) {
|
|
70
|
-
throw new Error(`Failed to load the language bundle for ${apiContext.locale}`);
|
|
71
|
-
}
|
|
72
|
-
this.disposeForModel(modelId);
|
|
73
|
-
const key = this._getApiKey(modelId);
|
|
74
|
-
const editorProfile = new languageDefaultsBase.EditorProfile(definition, profileStrings);
|
|
75
|
-
this._profileMap.set(key, editorProfile);
|
|
76
|
-
const apiProfile = await editorProfile.toLSProfile();
|
|
77
|
-
this.updateApiContextForModel(modelId, {
|
|
78
|
-
locale: apiContext.locale,
|
|
79
|
-
profile: apiProfile,
|
|
80
|
-
snippets: apiContext.snippets,
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Set or update the Arcade language service options.
|
|
85
|
-
* @param languageOptions The language options to set.
|
|
86
|
-
*/
|
|
87
|
-
setLanguageOptions(languageOptions = {}) {
|
|
88
|
-
// Check if options have actually changed.
|
|
89
|
-
// Avoid restarting the worker when no updates.
|
|
90
|
-
// Today we only have the 'assetsPath' as a property
|
|
91
|
-
if (this._languageOptions.assetsPath === languageOptions.assetsPath) {
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
this._languageOptions = { ...this._languageOptions, ...languageOptions };
|
|
95
|
-
this._onDidChange.fire(this);
|
|
96
|
-
}
|
|
97
|
-
/**
|
|
98
|
-
* Gets the API library for the given model id.
|
|
99
|
-
* @param modelId The model id for which to get the API library.
|
|
100
|
-
* @returns The API library for the model.
|
|
101
|
-
*/
|
|
102
|
-
async getApiLibrary(modelId) {
|
|
103
|
-
const uri = languageDefaultsBase.Uri.parse(modelId);
|
|
104
|
-
const worker = await getArcadeWorker(uri);
|
|
105
|
-
return await worker.getApiLibrary(this.getApiContextForModel(uri));
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
const arcadeDefaults = new ArcadeLanguageServiceDefaults();
|
|
109
|
-
const arcade = {
|
|
110
|
-
setProfileForModel: arcadeDefaults.setProfileForModel.bind(arcadeDefaults),
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
exports.arcade = arcade;
|
|
114
|
-
exports.arcadeDefaults = arcadeDefaults;
|
|
115
|
-
exports.getArcadeDiagnosticService = getArcadeDiagnosticService;
|
|
116
|
-
exports.getMode = getMode;
|