@arcgis/coding-components 4.31.0-next.10 → 4.31.0-next.13

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.
Files changed (131) hide show
  1. package/dist/arcgis-coding-components/arcgis-coding-components.esm.js +2 -2
  2. package/dist/arcgis-coding-components/assets/code-editor/sql-expr.worker.js +29 -7
  3. package/dist/arcgis-coding-components/index.esm.js +2 -2
  4. package/dist/arcgis-coding-components/{p-8cf09bcc.js → p-0238f1c9.js} +1 -1
  5. package/dist/arcgis-coding-components/p-056c22f6.js +6 -0
  6. package/dist/arcgis-coding-components/{p-193ac44f.js → p-30a27259.js} +1 -1
  7. package/dist/arcgis-coding-components/{p-8196fa73.js → p-46ee5802.js} +2 -2
  8. package/dist/arcgis-coding-components/{p-960aa9dc.js → p-48800c64.js} +2 -2
  9. package/dist/arcgis-coding-components/{p-6e28fd70.js → p-5f9d02cd.js} +2 -2
  10. package/dist/arcgis-coding-components/p-6b06bf1f.entry.js +6 -0
  11. package/dist/arcgis-coding-components/{p-4fc79a07.entry.js → p-6dd5c8ac.entry.js} +2 -2
  12. package/dist/arcgis-coding-components/{p-767b17ee.entry.js → p-70be15ef.entry.js} +2 -2
  13. package/dist/arcgis-coding-components/{p-ad75160d.js → p-7ce92237.js} +3 -3
  14. package/dist/arcgis-coding-components/p-7db90261.js +6 -0
  15. package/dist/arcgis-coding-components/{p-ab78d6c4.js → p-817249dc.js} +3 -3
  16. package/dist/arcgis-coding-components/{p-790067b1.js → p-9521dcf8.js} +12 -12
  17. package/dist/arcgis-coding-components/{p-da9431ba.js → p-af89dfbf.js} +2 -2
  18. package/dist/arcgis-coding-components/{p-923858b5.js → p-b3831336.js} +2 -2
  19. package/dist/arcgis-coding-components/{p-02cae55d.js → p-b7351b5a.js} +3 -3
  20. package/dist/arcgis-coding-components/{p-22253750.js → p-dc1f177d.js} +1 -1
  21. package/dist/arcgis-coding-components/p-e8f28ec2.js +6 -0
  22. package/dist/arcgis-coding-components/p-f6939275.js +6 -0
  23. package/dist/cjs/{app-globals-bade840e.js → app-globals-5c2eb6c4.js} +1 -1
  24. package/dist/cjs/arcade-defaults-f0f15084.js +349 -0
  25. package/dist/cjs/{arcade-language-features-747fb1da.js → arcade-language-features-d1ca02a6.js} +2 -2
  26. package/dist/cjs/{arcade-mode-dce44622.js → arcade-mode-f16e383a.js} +3 -4
  27. package/dist/cjs/arcgis-arcade-editor_6.cjs.entry.js +7 -14
  28. package/dist/cjs/arcgis-coding-components.cjs.js +3 -3
  29. package/dist/cjs/arcgis-sql-expression-editor.cjs.entry.js +4 -4
  30. package/dist/cjs/arcgis-sql-expression-fields.cjs.entry.js +4 -4
  31. package/dist/cjs/{css-077ba0c5.js → css-f9c7e7cd.js} +1 -1
  32. package/dist/cjs/{cssMode-7f2030db.js → cssMode-22b5188b.js} +2 -3
  33. package/dist/cjs/{html-e3a243e9.js → html-35ace5ce.js} +2 -3
  34. package/dist/cjs/{htmlMode-c273d6dc.js → htmlMode-03149da9.js} +2 -3
  35. package/dist/cjs/{index-37a86ff4.js → index-168881c0.js} +1 -1
  36. package/dist/cjs/index.cjs.js +4 -4
  37. package/dist/cjs/{javascript-7a33cca7.js → javascript-20775679.js} +3 -4
  38. package/dist/cjs/{jsonMode-6b4e0850.js → jsonMode-74a5f024.js} +2 -3
  39. package/dist/cjs/{language-defaults-base-b32cb091.js → language-defaults-base-9b48f557.js} +800 -1024
  40. package/dist/cjs/loader.cjs.js +3 -3
  41. package/dist/cjs/{sql-expr-defaults-8a5834f3.js → sql-expr-defaults-7c0204a1.js} +78 -24
  42. package/dist/cjs/{sql-expr-mode-a72a1f92.js → sql-expr-mode-5d08be72.js} +19971 -20969
  43. package/dist/cjs/{tsMode-c2edcd57.js → tsMode-8ed4166e.js} +2 -3
  44. package/dist/cjs/{typescript-c50c5516.js → typescript-821d6d32.js} +2 -3
  45. package/dist/components/arcade-defaults.js +238 -4
  46. package/dist/components/arcade-language-features.js +1 -1
  47. package/dist/components/arcade-mode.js +1 -1
  48. package/dist/components/arcade-results.js +3 -3
  49. package/dist/components/arcade-suggestions.js +2 -2
  50. package/dist/components/arcade-variables.js +2 -2
  51. package/dist/components/arcgis-arcade-editor.js +2 -2
  52. package/dist/components/arcgis-arcade-results.js +1 -1
  53. package/dist/components/arcgis-arcade-suggestions.js +1 -1
  54. package/dist/components/arcgis-arcade-variables.js +1 -1
  55. package/dist/components/arcgis-assets.d.ts +1 -1
  56. package/dist/components/arcgis-assets.js +1 -1
  57. package/dist/components/arcgis-code-editor.js +1 -1
  58. package/dist/components/arcgis-language-api-panel.js +1 -1
  59. package/dist/components/arcgis-sql-expression-editor.js +2 -2
  60. package/dist/components/arcgis-sql-expression-fields.js +1 -1
  61. package/dist/components/{chunk-3IUJHIAA.js → chunk-2JTWBRMN.js} +2 -2
  62. package/dist/components/code-editor.js +7 -14
  63. package/dist/components/fields.js +4 -4
  64. package/dist/components/index.js +1 -1
  65. package/dist/components/index2.js +2 -2
  66. package/dist/components/language-api-panel.js +2 -2
  67. package/dist/components/language-defaults-base.js +47 -273
  68. package/dist/components/markdown.js +1 -1
  69. package/dist/components/sql-expr-defaults.js +77 -24
  70. package/dist/components/sql-expr-mode.js +19969 -20967
  71. package/dist/components/sql-expression-fields.js +2 -2
  72. package/dist/components/useT9n.js +2 -2
  73. package/dist/components/utilities.js +1 -1
  74. package/dist/esm/{app-globals-ed47e16d.js → app-globals-b9f25e63.js} +1 -1
  75. package/dist/esm/arcade-defaults-0b98d37c.js +344 -0
  76. package/dist/esm/{arcade-language-features-8edb3527.js → arcade-language-features-ca303d47.js} +2 -2
  77. package/dist/esm/{arcade-mode-ad036f46.js → arcade-mode-fca51be8.js} +3 -4
  78. package/dist/esm/arcgis-arcade-editor_6.entry.js +8 -15
  79. package/dist/esm/arcgis-coding-components.js +4 -4
  80. package/dist/esm/arcgis-sql-expression-editor.entry.js +4 -4
  81. package/dist/esm/arcgis-sql-expression-fields.entry.js +4 -4
  82. package/dist/esm/{css-810518f1.js → css-ba350248.js} +1 -1
  83. package/dist/esm/{cssMode-a7208024.js → cssMode-d8267564.js} +2 -3
  84. package/dist/esm/{html-e187d7d8.js → html-8ed39dee.js} +2 -3
  85. package/dist/esm/{htmlMode-06b7bae2.js → htmlMode-b26c455f.js} +2 -3
  86. package/dist/esm/{index-3743d31f.js → index-658e1601.js} +1 -1
  87. package/dist/esm/index.js +4 -4
  88. package/dist/esm/{javascript-04a3f866.js → javascript-a8c18cd8.js} +3 -4
  89. package/dist/esm/{jsonMode-ee8bb2ea.js → jsonMode-1a25e1fd.js} +2 -3
  90. package/dist/esm/{language-defaults-base-52a397f5.js → language-defaults-base-8d2a6ab5.js} +797 -1024
  91. package/dist/esm/loader.js +4 -4
  92. package/dist/esm/{sql-expr-defaults-f7c2d5ef.js → sql-expr-defaults-02ec1eb4.js} +78 -25
  93. package/dist/esm/{sql-expr-mode-433b4a39.js → sql-expr-mode-6e9cd3f1.js} +19971 -20970
  94. package/dist/esm/{tsMode-c80c462e.js → tsMode-36db3afb.js} +2 -3
  95. package/dist/esm/{typescript-a9b8caa7.js → typescript-8ff4383d.js} +2 -3
  96. package/dist/loader/cdn.js +1 -1
  97. package/dist/loader/index.cjs.js +1 -1
  98. package/dist/loader/index.es2017.js +1 -1
  99. package/dist/loader/index.js +1 -1
  100. package/dist/types/utils/arcade-monaco/arcade-profile-strategy.d.ts +9 -0
  101. package/dist/types/utils/fields.d.ts +2 -2
  102. package/dist/types/utils/profile/editor-profile.d.ts +7 -6
  103. package/dist/types/utils/profile/types.d.ts +3 -0
  104. package/dist/types/utils/profile/utils.d.ts +4 -0
  105. package/dist/types/utils/sql-expr-monaco/sql-expr-constants.d.ts +45 -0
  106. package/dist/types/utils/sql-expr-monaco/sql-expr-contribution.d.ts +1 -11
  107. package/dist/types/utils/sql-expr-monaco/sql-expr-defaults.d.ts +0 -1
  108. package/dist/types/utils/sql-expr-monaco/sql-expr-language-features.d.ts +17 -39
  109. package/dist/types/utils/sql-expr-monaco/sql-expr-mode.d.ts +34 -1
  110. package/dist/types/utils/sql-expr-monaco/sql-expr-service-accessors.d.ts +19 -0
  111. package/dist/types/utils/sql-expr-monaco/sql-expr-validation-diagnostic-adapter.d.ts +0 -7
  112. package/dist/types/utils/sql-expr-monaco/sql-expr-validation-utils.d.ts +6 -5
  113. package/dist/types/utils/sql-expr-monaco/sql-expr-validation.d.ts +3 -3
  114. package/dist/types/utils/sql-expr-monaco/sql-expr-worker-manager.d.ts +2 -0
  115. package/dist/types/utils/sql-expr-monaco/sql-expr.worker.d.ts +9 -6
  116. package/dist/types/utils/sql-expr-monaco/sql-expression-profile-strategy.d.ts +9 -0
  117. package/dist/types/utils/sql-expr-monaco/types.d.ts +4 -6
  118. package/package.json +10 -10
  119. package/dist/arcgis-coding-components/p-025fda85.js +0 -6
  120. package/dist/arcgis-coding-components/p-50484a4f.js +0 -6
  121. package/dist/arcgis-coding-components/p-7164c348.js +0 -6
  122. package/dist/arcgis-coding-components/p-9956a574.js +0 -6
  123. package/dist/arcgis-coding-components/p-f452d4b8.entry.js +0 -6
  124. package/dist/cjs/arcade-defaults-8b8d6c07.js +0 -116
  125. package/dist/esm/arcade-defaults-562fe19b.js +0 -111
  126. package/dist/types/utils/profile/predefined-profile.d.ts +0 -4
  127. package/dist/types/utils/sql-expr-monaco/libraries/date/properties/index.d.ts +0 -59
  128. package/dist/types/utils/sql-expr-monaco/libraries/numeric/properties/index.d.ts +0 -295
  129. package/dist/types/utils/sql-expr-monaco/libraries/string/properties/index.d.ts +0 -135
  130. package/dist/types/utils/sql-expr-monaco/sql-expr-validation-adapter.d.ts +0 -3
  131. package/dist/types/utils/sql-expr-profile/predefined-profile.d.ts +0 -2
@@ -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.10
4
+ * v4.31.0-next.13
5
5
  */
6
6
  import { proxyCustomElement, HTMLElement, createEvent, forceUpdate, h } from '@stencil/core/internal/client';
7
- import { u as useControllerManager } from './chunk-3IUJHIAA.js';
7
+ import { u as useControllerManager } from './chunk-2JTWBRMN.js';
8
8
  import { s as sqlExprDefaults } from './sql-expr-defaults.js';
9
9
  import "@esri/calcite-components/dist/components/calcite-block.js";
10
10
  import "@esri/calcite-components/dist/components/calcite-flow.js";
@@ -1,9 +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.10
4
+ * v4.31.0-next.13
5
5
  */
6
- import { m as makeController, w as watch } from './chunk-3IUJHIAA.js';
6
+ import { m as makeController, w as watch } from './chunk-2JTWBRMN.js';
7
7
  import { n as startLocaleObserver, p as getElementLocales } from './index2.js';
8
8
  import { getArcgisAssetPath as getAssetPath } from "./arcgis-assets.js";
9
9
 
@@ -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.10
4
+ * v4.31.0-next.13
5
5
  */
6
6
  import { d as createFilterExpression } from './index2.js';
7
7
 
@@ -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.10
4
+ * v4.31.0-next.13
5
5
  */
6
6
  const globalScripts = () => {};
7
7
 
@@ -0,0 +1,344 @@
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.13
5
+ */
6
+ import { m as main, f as fieldsToProfileValues, i as isPredefinedProfile, a as isFeatureSetCollectionDefinition, b as isFeatureSetDefinition, c as isFeatureDefinition, s as supportedLocales, L as LanguageDefaultsBase, d as fetchT9nStringsBundle, E as EditorProfile, U as Uri } from './language-defaults-base-8d2a6ab5.js';
7
+ import { g as getAssetPath } from './index-658e1601.js';
8
+
9
+ /**
10
+ * Returns the arcade diagnostic service.
11
+ * Example:
12
+ * ```ts
13
+ * const diagnosticService = await getArcadeDiagnosticService();
14
+ * diagnosticService.onDidChangeDiagnostics(({uri, diaganostics }) => {
15
+ * // Filter the diagnostics for the uri of interest
16
+ * // Do something with the diagnostics
17
+ * });
18
+ * ```
19
+ */
20
+ async function getArcadeDiagnosticService() {
21
+ const mode = await getMode();
22
+ return mode.getArcadeDiagnosticService();
23
+ }
24
+ /**
25
+ * Returns the arcade worker for the model.
26
+ * Example:
27
+ * ```ts
28
+ * const arcadeWorker = await getArcadeWorker(model.uri);
29
+ * ```
30
+ * @returns arcade worker
31
+ */
32
+ async function getArcadeWorker(uri) {
33
+ const mode = await getMode();
34
+ return await mode.getArcadeWorker(uri);
35
+ }
36
+ /**
37
+ * Request the arcade mode
38
+ * @returns arcade mode module
39
+ */
40
+ async function getMode() {
41
+ return await import('./arcade-mode-fca51be8.js');
42
+ }
43
+
44
+ // #region convert editor profile to apiProfile
45
+ /**
46
+ * Converts an editor profile to an api profile.
47
+ * The api profile is an optimized version of the editor profile designed for minimal data transfer between the main thread and the worker.
48
+ */
49
+ async function arcadeEditorToApiProfile(editorProfile) {
50
+ const { apiVersion, bundles, hiddenApiItems } = editorProfile.toEditorProfileDefinition();
51
+ const variables = await variablesToLSVariable(editorProfile.dictionaryVariables);
52
+ return { apiVersion, bundles, variables, hiddenApiItems: hiddenApiItems?.map((s) => s.toLowerCase()) };
53
+ }
54
+ async function variablesToLSVariable(editorVariables, kind = main.exports.CompletionItemKind.Variable) {
55
+ return await Promise.all(editorVariables.map(async (editorVariable) => {
56
+ switch (editorVariable.type) {
57
+ case "dictionary":
58
+ return await dictionaryToLSDictionary(editorVariable, kind);
59
+ case "feature":
60
+ return await featureToLSFeature(editorVariable, kind);
61
+ default:
62
+ return variableToLSVariable(editorVariable, kind);
63
+ }
64
+ }));
65
+ }
66
+ function variableToLSVariable(editorVariable, kind) {
67
+ const { name, type } = editorVariable;
68
+ const description = editorVariable.getDescription();
69
+ return {
70
+ name,
71
+ description,
72
+ type,
73
+ completion: {
74
+ label: name,
75
+ detail: name,
76
+ insertText: name,
77
+ insertTextMode: main.exports.InsertTextMode.asIs,
78
+ insertTextFormat: main.exports.InsertTextFormat.PlainText,
79
+ kind,
80
+ documentation: { kind: "markdown", value: description },
81
+ },
82
+ };
83
+ }
84
+ async function featureToLSFeature(editorFeature, kind) {
85
+ // Get the source for the definition
86
+ const source = await editorFeature.loadSource();
87
+ const { name } = editorFeature;
88
+ const description = editorFeature.getDescription();
89
+ const resultCompletion = {
90
+ label: name,
91
+ detail: name,
92
+ insertText: name,
93
+ insertTextMode: main.exports.InsertTextMode.asIs,
94
+ insertTextFormat: main.exports.InsertTextFormat.PlainText,
95
+ kind,
96
+ };
97
+ const result = {
98
+ name,
99
+ description,
100
+ type: "dictionary",
101
+ properties: [],
102
+ completion: resultCompletion,
103
+ };
104
+ // No source definition, then it will be a feature without any known fields
105
+ if (!source) {
106
+ return result;
107
+ }
108
+ // Create properties for the fields and the aliases
109
+ // Also improve the feature completion documentation
110
+ const [properties, featureCompletionDescription] = fieldsToProfileValues(source.fields, description, true);
111
+ result.properties = properties;
112
+ resultCompletion.documentation = { kind: "markdown", value: featureCompletionDescription };
113
+ return result;
114
+ }
115
+ async function dictionaryToLSDictionary(editorDictionary, kind) {
116
+ const { name, dictionaryVariables: variables } = editorDictionary;
117
+ const description = editorDictionary.getDescription();
118
+ const completionDescription = variables.reduce((previous, p) => {
119
+ if (previous !== "") {
120
+ previous += " \n \n";
121
+ }
122
+ previous += `**${p.name}** \n${p.type}`;
123
+ const description = p.getDescription();
124
+ if (description) {
125
+ previous += ` \n${description}`;
126
+ }
127
+ return previous;
128
+ }, description);
129
+ return {
130
+ name,
131
+ description,
132
+ type: "dictionary",
133
+ properties: await variablesToLSVariable(variables, main.exports.CompletionItemKind.Field),
134
+ completion: {
135
+ label: name,
136
+ detail: name,
137
+ insertText: name,
138
+ insertTextMode: main.exports.InsertTextMode.asIs,
139
+ insertTextFormat: main.exports.InsertTextFormat.PlainText,
140
+ kind,
141
+ documentation: { kind: "markdown", value: completionDescription },
142
+ },
143
+ };
144
+ }
145
+ // #endregion
146
+ // #region predefined profile to editor profile definition
147
+ /**
148
+ * Get a PredefinedProfile for a locale. If not already loaded then fetch it.
149
+ * If the locale doesn't exist or the locale profile file doesn't exist then returns
150
+ * the english version of the profile.
151
+ */
152
+ async function getSdkPredefinedProfiles(locale = "en") {
153
+ const profiles = sdkPredefinedProfilesMap.get(locale);
154
+ if (profiles) {
155
+ return profiles;
156
+ }
157
+ if (!supportedLocales.has(locale)) {
158
+ return await getSdkPredefinedProfiles("en");
159
+ }
160
+ try {
161
+ const response = await fetch(getAssetPath(`./assets/arcade-language/profiles/arcade-profiles.t9n.${locale}.json`));
162
+ if (response.ok) {
163
+ return cacheSdkPredefinedProfiles(locale, (await response.json()));
164
+ }
165
+ if (locale === "en") {
166
+ return null;
167
+ }
168
+ return await getSdkPredefinedProfiles("en");
169
+ }
170
+ catch {
171
+ return null;
172
+ }
173
+ }
174
+ const sdkPredefinedProfilesMap = new Map();
175
+ /**
176
+ * Convert a stored profile into a PredefinedProfile and add it to the in-memory
177
+ * Map of profiles per locale.
178
+ */
179
+ function cacheSdkPredefinedProfiles(locale, profiles) {
180
+ const map = new Map();
181
+ profiles.forEach((profile) => {
182
+ map.set(profile.id, profile);
183
+ });
184
+ sdkPredefinedProfilesMap.set(locale, map);
185
+ return map;
186
+ }
187
+ async function getSdkPredefinedProfile(id, locale = "en") {
188
+ const profiles = await getSdkPredefinedProfiles(locale);
189
+ return profiles?.get(id) ?? null;
190
+ }
191
+ function isExtendedPredefinedProfileDefinition(item) {
192
+ return !!item && typeof item === "object" && "additionalVariables" in item && Array.isArray(item.additionalVariables);
193
+ }
194
+ function convertApiVariables(variables) {
195
+ return variables?.map(convertApiVariable);
196
+ }
197
+ function convertApiVariable(variable) {
198
+ switch (variable.type) {
199
+ case "dictionary":
200
+ return {
201
+ ...variable,
202
+ type: variable.type,
203
+ properties: convertApiVariables(variable.properties),
204
+ };
205
+ case "array": {
206
+ return {
207
+ ...variable,
208
+ type: variable.type,
209
+ elementType: { type: "number", name: "number" },
210
+ };
211
+ }
212
+ default:
213
+ return { ...variable, type: variable.type };
214
+ }
215
+ }
216
+ async function convertToEditorProfileDefinition(predefinedProfile, locale = "en") {
217
+ if (!isPredefinedProfile(predefinedProfile)) {
218
+ return undefined;
219
+ }
220
+ const sdkPredefinedProfile = await getSdkPredefinedProfile(predefinedProfile.id, locale);
221
+ if (!sdkPredefinedProfile) {
222
+ return undefined;
223
+ }
224
+ const editorProfile = {
225
+ bundles: [...sdkPredefinedProfile.bundles],
226
+ variables: [],
227
+ hiddenApiItems: predefinedProfile.hiddenApiItems?.map((s) => s.toLowerCase()),
228
+ };
229
+ // Merge the SDK variables' definitions/properties with the predefined profile definitions.
230
+ sdkPredefinedProfile.variables.forEach((predefinedVariable) => {
231
+ // Don't include disabled variables
232
+ if (predefinedProfile.disabledVariables?.includes(predefinedVariable.name)) {
233
+ return;
234
+ }
235
+ // Try to get a definition from the predefined profile, for the variable that needs one.
236
+ const definition = predefinedProfile.definitions[predefinedVariable.name];
237
+ // Note: Something is weird with TS. The sdkVariables are being casted to the wrong type
238
+ // despite the type checking from the switch statement.
239
+ switch (predefinedVariable.type) {
240
+ case "dictionary": {
241
+ // For dictionary, we support properties overrride
242
+ return editorProfile.variables.push(convertApiVariable({
243
+ ...predefinedVariable,
244
+ type: predefinedVariable.type,
245
+ properties: Array.isArray(definition) ? [...definition] : predefinedVariable.properties,
246
+ }));
247
+ }
248
+ case "feature":
249
+ // If the definition is not valid, then we don't include it.
250
+ if (!isFeatureDefinition(definition)) {
251
+ return;
252
+ }
253
+ return editorProfile.variables.push({ ...predefinedVariable, type: predefinedVariable.type, definition });
254
+ case "featureSet":
255
+ // If the definition is not valid, then we don't include it.
256
+ if (!isFeatureSetDefinition(definition)) {
257
+ return;
258
+ }
259
+ return editorProfile.variables.push({ ...predefinedVariable, type: predefinedVariable.type, definition });
260
+ case "featureSetCollection":
261
+ // If the definition is not valid, then we don't include it.
262
+ if (!isFeatureSetCollectionDefinition(definition)) {
263
+ return;
264
+ }
265
+ return editorProfile.variables.push({ ...predefinedVariable, type: predefinedVariable.type, definition });
266
+ default:
267
+ return editorProfile.variables.push(convertApiVariable(predefinedVariable));
268
+ }
269
+ });
270
+ if (isExtendedPredefinedProfileDefinition(predefinedProfile)) {
271
+ editorProfile.variables.push(...(predefinedProfile.additionalVariables ?? []));
272
+ }
273
+ return editorProfile;
274
+ }
275
+ // #endregion
276
+
277
+ const arcadeLanguageId = "arcade";
278
+ class ArcadeLanguageServiceDefaults extends LanguageDefaultsBase {
279
+ constructor() {
280
+ super(...arguments);
281
+ this._languageId = arcadeLanguageId;
282
+ this._languageOptions = {};
283
+ }
284
+ /**
285
+ * Create an EditorProfile for the given model id using the given definition and locale.
286
+ * The EditorProfile is used by the the Arcade Language service as well by the cosing components.
287
+ * The definition can be a pre-defined profile or an editor profile definition.
288
+ * If the locale is not provided then the 'en' locale is used.
289
+ * @param modelId The model id for which to create the context.
290
+ * @param definition The definition to use for the model context.
291
+ * @param locale The locale to use for the model context.
292
+ * @returns The EditorProfile for the model.
293
+ */
294
+ async setProfileForModel(modelId, definition, apiContext = { locale: "en" }) {
295
+ // Convert pre-defined profile to a runtime profile
296
+ if (isPredefinedProfile(definition)) {
297
+ definition = await convertToEditorProfileDefinition(definition, apiContext.locale);
298
+ }
299
+ const profileStrings = await fetchT9nStringsBundle(apiContext.locale, getAssetPath("./assets/arcade-language/t9n"), "profile.t9n.");
300
+ if (!profileStrings) {
301
+ throw new Error(`Failed to load the language bundle for ${apiContext.locale}`);
302
+ }
303
+ this.disposeForModel(modelId);
304
+ const key = this._getApiKey(modelId);
305
+ const editorProfile = new EditorProfile(definition, profileStrings);
306
+ this._profileMap.set(key, editorProfile);
307
+ const apiProfile = await arcadeEditorToApiProfile(editorProfile);
308
+ this.updateApiContextForModel(modelId, {
309
+ locale: apiContext.locale,
310
+ profile: apiProfile,
311
+ snippets: apiContext.snippets,
312
+ });
313
+ }
314
+ /**
315
+ * Set or update the Arcade language service options.
316
+ * @param languageOptions The language options to set.
317
+ */
318
+ setLanguageOptions(languageOptions = {}) {
319
+ // Check if options have actually changed.
320
+ // Avoid restarting the worker when no updates.
321
+ // Today we only have the 'assetsPath' as a property
322
+ if (this._languageOptions.assetsPath === languageOptions.assetsPath) {
323
+ return;
324
+ }
325
+ this._languageOptions = { ...this._languageOptions, ...languageOptions };
326
+ this._onDidChange.fire(this);
327
+ }
328
+ /**
329
+ * Gets the API library for the given model id.
330
+ * @param modelId The model id for which to get the API library.
331
+ * @returns The API library for the model.
332
+ */
333
+ async getApiLibrary(modelId) {
334
+ const uri = Uri.parse(modelId);
335
+ const worker = await getArcadeWorker(uri);
336
+ return await worker.getApiLibrary(this.getApiContextForModel(uri));
337
+ }
338
+ }
339
+ const arcadeDefaults = new ArcadeLanguageServiceDefaults();
340
+ const arcade = {
341
+ setProfileForModel: arcadeDefaults.setProfileForModel.bind(arcadeDefaults),
342
+ };
343
+
344
+ export { arcade as a, arcadeDefaults as b, getMode as c, getArcadeDiagnosticService as g };
@@ -1,9 +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.10
4
+ * v4.31.0-next.13
5
5
  */
6
- import { e as editor, M as MarkerSeverity, F as main, R as Range, u as languages, N as debounce } from './language-defaults-base-52a397f5.js';
6
+ import { g as editor, P as MarkerSeverity, m as main, R as Range, z as languages, Q as debounce } from './language-defaults-base-8d2a6ab5.js';
7
7
 
8
8
  //#region Diagnostic
9
9
  class DiagnosticsAdapter {
@@ -1,11 +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.10
4
+ * v4.31.0-next.13
5
5
  */
6
- import { F as main, e as editor, u as languages, J as Emitter } from './language-defaults-base-52a397f5.js';
7
- import { C as CompletionProvider, F as FormattingProvider, D as DiagnosticsAdapter } from './arcade-language-features-8edb3527.js';
8
- import './index-3743d31f.js';
6
+ import { m as main, g as editor, z as languages, O as Emitter } from './language-defaults-base-8d2a6ab5.js';
7
+ import { C as CompletionProvider, F as FormattingProvider, D as DiagnosticsAdapter } from './arcade-language-features-ca303d47.js';
9
8
 
10
9
  var V={False:"false",Null:"null",True:"true"},f={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"},Ee=["++","--"],Je=["-","+","!","~"],Qe=["=","/=","*=","%=","+=","-="],Ze=["||","&&"],Lt=["|","&",">>","<<",">>>","^","==","!=","<","<=",">",">=","+","-","*","/","%"];var U=[[],[],[]];Ee.forEach(t=>U[t.length-1]?.push(t));Je.forEach(t=>U[t.length-1]?.push(t));Ze.forEach(t=>U[t.length-1]?.push(t));Qe.forEach(t=>U[t.length-1]?.push(t));Lt.forEach(t=>U[t.length-1]?.push(t));var ft=Object.values(f),gt=Object.values(V);gt.map(t=>({label:t,kind:main.exports.CompletionItemKind.Constant}));ft.map(t=>({label:t,kind:main.exports.CompletionItemKind.Keyword}));
11
10
 
@@ -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.10
4
+ * v4.31.0-next.13
5
5
  */
6
- import { g as getAssetPath, r as registerInstance, c as createEvent, h, F as Fragment, H as Host, a as getElement } from './index-3743d31f.js';
7
- import { a as importArcade, e as editor, s as startLocaleObserver, g as getElementLocales, b as isURL, h as hasSameOrigin, d as importRequest, D as Deferred, j as generateGuid, k as getElementTheme, K as KeyCode, l as setValuesInString, q as quoteString, m as supportedFields, n as generateTokensCSSForColorMap, S as StandaloneServices, I as IStandaloneThemeService, o as commonjsGlobal, p as setFocusOnElement, r as filterCollection, t as createFilterExpression, u as languages, R as Range, v as observeAncestorsMutation, U as Uri, w as KeyMod, x as addLTRMark } from './language-defaults-base-52a397f5.js';
8
- import { m as makeController, w as watch, u as useControllerManager, g as getSet, s as sqlExprDefaults } from './sql-expr-defaults-f7c2d5ef.js';
9
- import { b as arcadeDefaults, g as getArcadeDiagnosticService, c as getMode$1 } from './arcade-defaults-562fe19b.js';
6
+ import { g as getAssetPath, r as registerInstance, c as createEvent, h, F as Fragment, H as Host, a as getElement } from './index-658e1601.js';
7
+ import { e as importArcade, g as editor, h as startLocaleObserver, j as getElementLocales, k as isURL, l as hasSameOrigin, n as importRequest, D as Deferred, o as generateGuid, p as getElementTheme, K as KeyCode, q as setValuesInString, r as quoteString, t as supportedFields, u as generateTokensCSSForColorMap, S as StandaloneServices, I as IStandaloneThemeService, v as commonjsGlobal, w as setFocusOnElement, x as filterCollection, y as createFilterExpression, z as languages, R as Range, A as observeAncestorsMutation, U as Uri, B as KeyMod, C as addLTRMark } from './language-defaults-base-8d2a6ab5.js';
8
+ import { m as makeController, w as watch, u as useControllerManager, g as getSet, s as sqlExprDefaults, a as getMode$1 } from './sql-expr-defaults-02ec1eb4.js';
9
+ import { b as arcadeDefaults, g as getArcadeDiagnosticService, c as getMode } from './arcade-defaults-0b98d37c.js';
10
10
 
11
11
  const DevelopersWebSitePath = "https://developers.arcgis.com/arcade/";
12
12
  const MaxArrayItems = 100;
@@ -4174,7 +4174,7 @@ languages.register({
4174
4174
  languages.onLanguage(arcadeDefaults.languageId, () => {
4175
4175
  setupArcadeTheme();
4176
4176
  arcadeDefaults.setLanguageOptions({ assetsPath: `${getAssetsPath() ?? "."}/arcade-language` });
4177
- getMode$1()
4177
+ getMode()
4178
4178
  .then((mode) => {
4179
4179
  // Setup the language mode
4180
4180
  mode.setupMode(arcadeDefaults);
@@ -4184,13 +4184,6 @@ languages.onLanguage(arcadeDefaults.languageId, () => {
4184
4184
  });
4185
4185
  });
4186
4186
 
4187
- /**
4188
- * Request the sql-expression mode
4189
- * @returns sql-expression mode module
4190
- */
4191
- async function getMode() {
4192
- return await import('./sql-expr-mode-433b4a39.js');
4193
- }
4194
4187
  // Register the language in Monaco
4195
4188
  languages.register({
4196
4189
  id: sqlExprDefaults.languageId,
@@ -4201,8 +4194,8 @@ languages.register({
4201
4194
  // An event emitted when a language is first time needed
4202
4195
  languages.onLanguage(sqlExprDefaults.languageId, () => {
4203
4196
  // setupTheme();
4204
- // sqlExprDefaults.setLanguageOptions({ assetsPath: `${getAssetsPath() ?? "."}/sql-expression-language` });
4205
- getMode()
4197
+ sqlExprDefaults.setLanguageOptions({ assetsPath: `${getAssetsPath() ?? "."}/sql-expression-editor` });
4198
+ getMode$1()
4206
4199
  .then((mode) => {
4207
4200
  // Setup the language mode
4208
4201
  mode.setupMode(sqlExprDefaults);
@@ -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.10
4
+ * v4.31.0-next.13
5
5
  */
6
- import { p as promiseResolve, b as bootstrapLazy } from './index-3743d31f.js';
7
- export { s as setNonce } from './index-3743d31f.js';
8
- import { g as globalScripts } from './app-globals-ed47e16d.js';
6
+ import { p as promiseResolve, b as bootstrapLazy } from './index-658e1601.js';
7
+ export { s as setNonce } from './index-658e1601.js';
8
+ import { g as globalScripts } from './app-globals-b9f25e63.js';
9
9
 
10
10
  /*
11
11
  Stencil Client Patch Browser v4.17.1 | MIT Licensed | https://stenciljs.com
@@ -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.10
4
+ * v4.31.0-next.13
5
5
  */
6
- import { r as registerInstance, h, H as Host, a as getElement } from './index-3743d31f.js';
7
- import { u as useControllerManager, s as sqlExprDefaults } from './sql-expr-defaults-f7c2d5ef.js';
8
- import { j as generateGuid } from './language-defaults-base-52a397f5.js';
6
+ import { r as registerInstance, h, H as Host, a as getElement } from './index-658e1601.js';
7
+ import { u as useControllerManager, s as sqlExprDefaults } from './sql-expr-defaults-02ec1eb4.js';
8
+ import { o as generateGuid } from './language-defaults-base-8d2a6ab5.js';
9
9
 
10
10
  const sqlExpressionEditorCss = "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%}";
11
11
  const ArcgisSqlExpressionEditorStyle0 = sqlExpressionEditorCss;
@@ -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.10
4
+ * v4.31.0-next.13
5
5
  */
6
- import { r as registerInstance, c as createEvent, h, a as getElement } from './index-3743d31f.js';
7
- import { u as useControllerManager, s as sqlExprDefaults } from './sql-expr-defaults-f7c2d5ef.js';
8
- import './language-defaults-base-52a397f5.js';
6
+ import { r as registerInstance, c as createEvent, h, a as getElement } from './index-658e1601.js';
7
+ import { u as useControllerManager, s as sqlExprDefaults } from './sql-expr-defaults-02ec1eb4.js';
8
+ import './language-defaults-base-8d2a6ab5.js';
9
9
 
10
10
  const sqlExpressionFieldsCss = ":host calcite-flow{height:100%}:host calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}";
11
11
  const ArcgisSqlExpressionFieldsStyle0 = sqlExpressionFieldsCss;
@@ -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.10
4
+ * v4.31.0-next.13
5
5
  */
6
6
  /*!-----------------------------------------------------------------------------
7
7
  * 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.10
4
+ * v4.31.0-next.13
5
5
  */
6
- import { G as monaco_editor_core_star } from './language-defaults-base-52a397f5.js';
7
- import './index-3743d31f.js';
6
+ import { M as monaco_editor_core_star } from './language-defaults-base-8d2a6ab5.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.10
4
+ * v4.31.0-next.13
5
5
  */
6
- import { G as monaco_editor_core_star } from './language-defaults-base-52a397f5.js';
7
- import './index-3743d31f.js';
6
+ import { M as monaco_editor_core_star } from './language-defaults-base-8d2a6ab5.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.10
4
+ * v4.31.0-next.13
5
5
  */
6
- import { G as monaco_editor_core_star } from './language-defaults-base-52a397f5.js';
7
- import './index-3743d31f.js';
6
+ import { M as monaco_editor_core_star } from './language-defaults-base-8d2a6ab5.js';
8
7
 
9
8
  /*!-----------------------------------------------------------------------------
10
9
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -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.10
4
+ * v4.31.0-next.13
5
5
  */
6
6
  const NAMESPACE = 'arcgis-coding-components';
7
7
 
package/dist/esm/index.js CHANGED
@@ -1,8 +1,8 @@
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.10
4
+ * v4.31.0-next.13
5
5
  */
6
- export { a as arcade } from './arcade-defaults-562fe19b.js';
7
- import './language-defaults-base-52a397f5.js';
8
- import './index-3743d31f.js';
6
+ export { a as arcade } from './arcade-defaults-0b98d37c.js';
7
+ import './language-defaults-base-8d2a6ab5.js';
8
+ import './index-658e1601.js';
@@ -1,11 +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.10
4
+ * v4.31.0-next.13
5
5
  */
6
- import { conf as conf$1, language as language$1 } from './typescript-a9b8caa7.js';
7
- import './language-defaults-base-52a397f5.js';
8
- import './index-3743d31f.js';
6
+ import { conf as conf$1, language as language$1 } from './typescript-8ff4383d.js';
7
+ import './language-defaults-base-8d2a6ab5.js';
9
8
 
10
9
  /*!-----------------------------------------------------------------------------
11
10
  * 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.10
4
+ * v4.31.0-next.13
5
5
  */
6
- import { G as monaco_editor_core_star } from './language-defaults-base-52a397f5.js';
7
- import './index-3743d31f.js';
6
+ import { M as monaco_editor_core_star } from './language-defaults-base-8d2a6ab5.js';
8
7
 
9
8
  /*!-----------------------------------------------------------------------------
10
9
  * Copyright (c) Microsoft Corporation. All rights reserved.