@arcgis/coding-components 4.31.0-next.54 → 4.31.0-next.55

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 (122) hide show
  1. package/dist/arcgis-coding-components/arcgis-coding-components.esm.js +2 -2
  2. package/dist/arcgis-coding-components/assets/code-editor/arcade.worker.js +3 -3
  3. package/dist/arcgis-coding-components/assets/code-editor/sql-expr.worker.js +2 -2
  4. package/dist/arcgis-coding-components/assets/sql-expression-editor/t9n/sql-expression-editor.t9n.en.json +4 -0
  5. package/dist/arcgis-coding-components/index.esm.js +2 -2
  6. package/dist/arcgis-coding-components/{p-f048c26d.js → p-091cdb1e.js} +2 -2
  7. package/dist/arcgis-coding-components/p-0e602e10.js +6 -0
  8. package/dist/arcgis-coding-components/{p-eac1cf63.js → p-141487fe.js} +2 -2
  9. package/dist/arcgis-coding-components/{p-9cfd8c44.js → p-32cb6ea2.js} +1 -1
  10. package/dist/arcgis-coding-components/{p-8157c6db.entry.js → p-54f78145.entry.js} +2 -2
  11. package/dist/arcgis-coding-components/{p-26d3fcc7.js → p-5cf73c57.js} +1 -1
  12. package/dist/arcgis-coding-components/{p-187be214.js → p-67b27736.js} +2 -2
  13. package/dist/arcgis-coding-components/{p-40c8e02b.js → p-74e53b4a.js} +2 -2
  14. package/dist/arcgis-coding-components/{p-e99ebc55.js → p-773d9ba4.js} +2 -2
  15. package/dist/arcgis-coding-components/{p-bf7e11fd.js → p-80b0534e.js} +2 -2
  16. package/dist/arcgis-coding-components/p-8efb1de5.entry.js +6 -0
  17. package/dist/arcgis-coding-components/p-989e9ba7.js +6 -0
  18. package/dist/arcgis-coding-components/{p-ee8e91c5.js → p-98bc0e2e.js} +2 -2
  19. package/dist/arcgis-coding-components/{p-5f82bda4.js → p-a6baba61.js} +9 -9
  20. package/dist/arcgis-coding-components/p-ba514722.js +6 -0
  21. package/dist/arcgis-coding-components/{p-7518bf06.js → p-d297077d.js} +2 -2
  22. package/dist/arcgis-coding-components/p-d43d29ac.js +6 -0
  23. package/dist/arcgis-coding-components/{p-2aa428af.js → p-df8755a6.js} +1 -1
  24. package/dist/arcgis-coding-components/p-e54e0516.entry.js +6 -0
  25. package/dist/cjs/{app-globals-633389bb.js → app-globals-e6c77e1e.js} +1 -1
  26. package/dist/cjs/{arcade-defaults-e89d821f.js → arcade-defaults-a9946815.js} +4 -4
  27. package/dist/cjs/{arcade-mode-51017641.js → arcade-mode-7b6729b3.js} +16 -3
  28. package/dist/cjs/arcgis-arcade-editor_6.cjs.entry.js +47 -123
  29. package/dist/cjs/arcgis-coding-components.cjs.js +4 -4
  30. package/dist/cjs/arcgis-sql-expression-editor.cjs.entry.js +33 -11
  31. package/dist/cjs/arcgis-sql-expression-fields.cjs.entry.js +4 -4
  32. package/dist/cjs/{css-2a866ead.js → css-0e5b9fb9.js} +1 -1
  33. package/dist/cjs/{cssMode-322bf1ca.js → cssMode-3d5ea09f.js} +2 -2
  34. package/dist/cjs/{html-bf50b9d5.js → html-baccaba5.js} +2 -2
  35. package/dist/cjs/{htmlMode-e064979b.js → htmlMode-54ec4b3d.js} +2 -2
  36. package/dist/cjs/{index-c6ca5d79.js → index-9e74612d.js} +1 -1
  37. package/dist/cjs/index.cjs.js +4 -4
  38. package/dist/cjs/{javascript-59b31aab.js → javascript-ed0c5ba8.js} +3 -3
  39. package/dist/cjs/{jsonMode-62d33ca8.js → jsonMode-e2e8cbc6.js} +2 -2
  40. package/dist/cjs/{language-defaults-base-7f799681.js → language-defaults-base-277ce995.js} +9 -9
  41. package/dist/cjs/loader.cjs.js +4 -4
  42. package/dist/cjs/{sql-expr-defaults-56a073df.js → sql-expr-defaults-a54696c1.js} +57 -34
  43. package/dist/cjs/{sql-expr-mode-b76f2cd7.js → sql-expr-mode-65d156b7.js} +17 -4
  44. package/dist/cjs/{tsMode-343a564e.js → tsMode-5e037421.js} +2 -2
  45. package/dist/cjs/{typescript-aa39a9f1.js → typescript-94a06ac9.js} +2 -2
  46. package/dist/cjs/useT9n-4e453944.js +115 -0
  47. package/dist/components/arcade-defaults.js +1 -1
  48. package/dist/components/arcade-mode.js +16 -3
  49. package/dist/components/arcade-results.js +2 -2
  50. package/dist/components/arcade-suggestions.js +2 -2
  51. package/dist/components/arcade-variables.js +2 -2
  52. package/dist/components/arcgis-arcade-editor.js +17 -10
  53. package/dist/components/arcgis-arcade-results.js +1 -1
  54. package/dist/components/arcgis-arcade-suggestions.js +1 -1
  55. package/dist/components/arcgis-arcade-variables.js +1 -1
  56. package/dist/components/arcgis-assets.d.ts +1 -1
  57. package/dist/components/arcgis-assets.js +1 -1
  58. package/dist/components/arcgis-code-editor.js +1 -1
  59. package/dist/components/arcgis-language-api-panel.js +1 -1
  60. package/dist/components/arcgis-sql-expression-editor.js +33 -11
  61. package/dist/components/arcgis-sql-expression-fields.js +1 -1
  62. package/dist/components/{chunk-BMBYH3VH.js → chunk-W77CUVCX.js} +54 -31
  63. package/dist/components/code-editor.js +4 -3
  64. package/dist/components/fields.js +1 -1
  65. package/dist/components/index.js +1 -1
  66. package/dist/components/index2.js +1 -1
  67. package/dist/components/language-api-panel.js +22 -4
  68. package/dist/components/language-defaults-base.js +1 -1
  69. package/dist/components/markdown.js +1 -1
  70. package/dist/components/sql-expr-defaults.js +1 -1
  71. package/dist/components/sql-expr-mode.js +15 -2
  72. package/dist/components/sql-expression-fields.js +2 -2
  73. package/dist/components/useT9n.js +2 -2
  74. package/dist/components/utilities.js +1 -1
  75. package/dist/esm/{app-globals-7a9ff748.js → app-globals-5e71a2db.js} +1 -1
  76. package/dist/esm/{arcade-defaults-112cabaa.js → arcade-defaults-880f5e12.js} +4 -4
  77. package/dist/esm/{arcade-mode-78a2482d.js → arcade-mode-970a9dae.js} +16 -3
  78. package/dist/esm/arcgis-arcade-editor_6.entry.js +42 -118
  79. package/dist/esm/arcgis-coding-components.js +5 -5
  80. package/dist/esm/arcgis-sql-expression-editor.entry.js +33 -11
  81. package/dist/esm/arcgis-sql-expression-fields.entry.js +4 -4
  82. package/dist/esm/{css-e8c18f98.js → css-f6ef0a8a.js} +1 -1
  83. package/dist/esm/{cssMode-769cabbb.js → cssMode-c9706c47.js} +2 -2
  84. package/dist/esm/{html-91c19065.js → html-adf0ac7b.js} +2 -2
  85. package/dist/esm/{htmlMode-2e105097.js → htmlMode-f5b54f77.js} +2 -2
  86. package/dist/esm/{index-20936dfe.js → index-542987c6.js} +1 -1
  87. package/dist/esm/index.js +4 -4
  88. package/dist/esm/{javascript-68620191.js → javascript-17c964c5.js} +3 -3
  89. package/dist/esm/{jsonMode-e89d6d21.js → jsonMode-f5377551.js} +2 -2
  90. package/dist/esm/{language-defaults-base-9e3f1f44.js → language-defaults-base-cf9491cd.js} +10 -10
  91. package/dist/esm/loader.js +5 -5
  92. package/dist/esm/{sql-expr-defaults-3913a59f.js → sql-expr-defaults-5d4eebcc.js} +58 -35
  93. package/dist/esm/{sql-expr-mode-abd729cf.js → sql-expr-mode-8e292455.js} +17 -4
  94. package/dist/esm/{tsMode-05dfb27e.js → tsMode-64a3b7da.js} +2 -2
  95. package/dist/esm/{typescript-d6646874.js → typescript-80a07ece.js} +2 -2
  96. package/dist/esm/useT9n-917bda01.js +113 -0
  97. package/dist/loader/cdn.js +1 -1
  98. package/dist/loader/index.cjs.js +1 -1
  99. package/dist/loader/index.es2017.js +1 -1
  100. package/dist/loader/index.js +1 -1
  101. package/dist/types/components/arcade-editor/arcade-editor.d.ts +4 -3
  102. package/dist/types/components/language-api-panel/language-api-panel.d.ts +1 -0
  103. package/dist/types/components/sql-expression-editor/sql-expression-editor.d.ts +31 -3
  104. package/dist/types/components.d.ts +27 -0
  105. package/dist/types/data/arcgis-web-compoments/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stencil.config.d.ts +3 -0
  106. package/dist/types/utils/arcade-monaco/arcade-worker-manager.d.ts +6 -0
  107. package/dist/types/utils/sql-expr-monaco/sql-expr-worker-manager.d.ts +6 -0
  108. package/package.json +11 -11
  109. package/dist/arcgis-coding-components/p-0d09a590.js +0 -6
  110. package/dist/arcgis-coding-components/p-710acdb6.entry.js +0 -6
  111. package/dist/arcgis-coding-components/p-83675007.js +0 -6
  112. package/dist/arcgis-coding-components/p-c5f85501.js +0 -6
  113. package/dist/arcgis-coding-components/p-e65a39fc.entry.js +0 -6
  114. package/dist/types/data/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stencil.config.d.ts +0 -3
  115. /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/arcade-editor/arcade-editor.stories.d.ts +0 -0
  116. /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/arcade-editor/editorContext.d.ts +0 -0
  117. /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/code-editor/code-editor.stories.d.ts +0 -0
  118. /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/sql-expression-editor/sql-expression-editor.stories.d.ts +0 -0
  119. /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/reference/stories/arcade-editor.stories.d.ts +0 -0
  120. /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/support/sass-inline-url-importer.d.ts +0 -0
  121. /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/support/sass-json-importer.d.ts +0 -0
  122. /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/support/stencil-monaco-plugins.d.ts +0 -0
@@ -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.54
4
+ * v4.31.0-next.55
5
5
  */
6
6
  import { editor } from 'monaco-editor';
7
7
  import { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
@@ -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.54
4
+ * v4.31.0-next.55
5
5
  */
6
6
  import { f as fieldsToProfileValues, i as isPredefinedProfile, b as isFeatureSetDefinition, L as LanguageDefaultsBase, E as EditorProfile } from './language-defaults-base.js';
7
7
  import { InsertTextMode, InsertTextFormat, CompletionItemKind } from 'vscode-languageserver-types';
@@ -1,12 +1,14 @@
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.54
4
+ * v4.31.0-next.55
5
5
  */
6
6
  import { editor, languages, Emitter } from 'monaco-editor';
7
+ import { D as Deferred, t as debounce } from './index2.js';
7
8
  import { s as sqlExprDefaults } from './sql-expr-defaults.js';
8
- import { t as debounce } from './index2.js';
9
9
 
10
+ // hold onto a promise that resolves when the worker is ready
11
+ let deferredWorker = new Deferred();
10
12
  /**
11
13
  * Manager to create our sql-expression worker and client proxy
12
14
  */
@@ -26,9 +28,17 @@ class SqlExprWorkerManager {
26
28
  if (this._worker) {
27
29
  this._worker.dispose();
28
30
  this._worker = null;
31
+ deferredWorker = new Deferred();
29
32
  }
30
33
  this._client = null;
31
34
  }
35
+ /**
36
+ * Wait for the worker to be ready.
37
+ * @returns A promise that resolves when the worker is ready.
38
+ */
39
+ static async waitForWorker() {
40
+ return await deferredWorker.promise;
41
+ }
32
42
  async _getClientProxy() {
33
43
  // We used createWebWorker to create or run the web worker if it isn’t already created.
34
44
  // Otherwise, we get and return the proxy client.
@@ -42,6 +52,7 @@ class SqlExprWorkerManager {
42
52
  languageOptions,
43
53
  },
44
54
  });
55
+ deferredWorker.resolve(this._worker);
45
56
  this._client = this._worker.getProxy();
46
57
  }
47
58
  return await this._client;
@@ -401,6 +412,8 @@ let sqlExprWorker;
401
412
  * @returns The sql-expression worker.
402
413
  */
403
414
  async function getSqlExprWorker(...uris) {
415
+ // ensures the worker is registered
416
+ await SqlExprWorkerManager.waitForWorker();
404
417
  return await new Promise((resolve, reject) => {
405
418
  if (!sqlExprWorker) {
406
419
  reject(new Error("sql expression worker not registered!"));
@@ -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.54
4
+ * v4.31.0-next.55
5
5
  */
6
6
  import { proxyCustomElement, HTMLElement, createEvent, forceUpdate, h } from '@stencil/core/internal/client';
7
- import { u as useControllerManager } from './chunk-BMBYH3VH.js';
7
+ import { u as useControllerManager } from './chunk-W77CUVCX.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.54
4
+ * v4.31.0-next.55
5
5
  */
6
- import { p as proxyExports, w as watch, C as Controller, s as setAmbientComponent } from './chunk-BMBYH3VH.js';
6
+ import { p as proxyExports, w as watch, C as Controller, s as setAmbientComponent } from './chunk-W77CUVCX.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.54
4
+ * v4.31.0-next.55
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.54
4
+ * v4.31.0-next.55
5
5
  */
6
6
  const globalScripts = () => {};
7
7
 
@@ -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.54
4
+ * v4.31.0-next.55
5
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-9e3f1f44.js';
7
- import { g as getAssetPath } from './index-20936dfe.js';
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-cf9491cd.js';
7
+ import { g as getAssetPath } from './index-542987c6.js';
8
8
 
9
9
  /**
10
10
  * Returns the arcade diagnostic service.
@@ -38,7 +38,7 @@ async function getArcadeWorker(uri) {
38
38
  * @returns arcade mode module
39
39
  */
40
40
  async function getMode() {
41
- return await import('./arcade-mode-78a2482d.js');
41
+ return await import('./arcade-mode-970a9dae.js');
42
42
  }
43
43
 
44
44
  // #region convert editor profile to apiProfile
@@ -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.54
4
+ * v4.31.0-next.55
5
5
  */
6
- import { m as main, g as editor, O as MarkerSeverity, R as Range, z as languages, P as debounce, Q as Emitter } from './language-defaults-base-9e3f1f44.js';
6
+ import { m as main, g as editor, O as MarkerSeverity, R as Range, x as languages, P as debounce, D as Deferred, Q as Emitter } from './language-defaults-base-cf9491cd.js';
7
7
 
8
- 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}));
8
+ 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=["||","&&"],Bt=["|","&",">>","<<",">>>","^","==","!=","<","<=",">",">=","+","-","*","/","%"];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));Bt.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}));
9
9
 
10
10
  const operators = [
11
11
  "<=",
@@ -476,6 +476,8 @@ class FormattingProvider {
476
476
  }
477
477
  //#endregion
478
478
 
479
+ // hold onto a promise that resolves when the worker is ready
480
+ let deferredWorker = new Deferred();
479
481
  /**
480
482
  * Manager to create our arcade worker and client proxy
481
483
  */
@@ -495,9 +497,17 @@ class WorkerManager {
495
497
  if (this._worker) {
496
498
  this._worker.dispose();
497
499
  this._worker = null;
500
+ deferredWorker = new Deferred();
498
501
  }
499
502
  this._client = null;
500
503
  }
504
+ /**
505
+ * Wait for the worker to be ready.
506
+ * @returns A promise that resolves when the worker is ready.
507
+ */
508
+ static async waitForWorker() {
509
+ return await deferredWorker.promise;
510
+ }
501
511
  async _getClientProxy() {
502
512
  // We used createWebWorker to create or run the web worker if it isn’t already created.
503
513
  // Otherwise, we get and return the proxy client.
@@ -511,6 +521,7 @@ class WorkerManager {
511
521
  languageOptions,
512
522
  },
513
523
  });
524
+ deferredWorker.resolve(this._worker);
514
525
  this._client = this._worker.getProxy();
515
526
  }
516
527
  return await this._client;
@@ -529,6 +540,8 @@ let arcadeWorker;
529
540
  * @returns The arcade worker.
530
541
  */
531
542
  async function getArcadeWorker(...uris) {
543
+ // ensures the worker is registered
544
+ await WorkerManager.waitForWorker();
532
545
  return await new Promise((resolve, reject) => {
533
546
  if (!arcadeWorker) {
534
547
  reject(new Error("Arcade not registered!"));
@@ -1,12 +1,13 @@
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.54
4
+ * v4.31.0-next.55
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-20936dfe.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-9e3f1f44.js';
8
- import { p as proxyExports, w as watch, C as Controller, s as setAmbientComponent, u as useControllerManager, g as getSet, a as sqlExprDefaults, b as getMode$1 } from './sql-expr-defaults-3913a59f.js';
9
- import { b as arcadeDefaults, g as getArcadeDiagnosticService, c as getMode } from './arcade-defaults-112cabaa.js';
6
+ import { r as registerInstance, c as createEvent, g as getAssetPath, h, F as Fragment, H as Host, a as getElement } from './index-542987c6.js';
7
+ import { e as importArcade, g as editor, h as isURL, j as hasSameOrigin, k as importRequest, D as Deferred, l as generateGuid, n as getElementTheme, K as KeyCode, o as setValuesInString, q as quoteString, p as supportedFields, r as generateTokensCSSForColorMap, S as StandaloneServices, I as IStandaloneThemeService, t as commonjsGlobal, u as setFocusOnElement, v as filterCollection, w as createFilterExpression, x as languages, R as Range, y as observeAncestorsMutation, U as Uri, z as KeyMod, A as addLTRMark } from './language-defaults-base-cf9491cd.js';
8
+ import { u as useControllerManager, g as getSet, s as sqlExprDefaults, a as getMode$1 } from './sql-expr-defaults-5d4eebcc.js';
9
+ import { b as arcadeDefaults, g as getArcadeDiagnosticService, c as getMode } from './arcade-defaults-880f5e12.js';
10
+ import { u as useT9n } from './useT9n-917bda01.js';
10
11
 
11
12
  const DevelopersWebSitePath = "https://developers.arcgis.com/arcade/";
12
13
  const MaxArrayItems = 100;
@@ -290,107 +291,6 @@ function updateThemeColors(theme, colorRules) {
290
291
  editor.defineTheme(base, { base, inherit: true, rules, colors: {} });
291
292
  }
292
293
 
293
- // src/functional.ts
294
- var makeController = (constructor) => proxy(void 0, constructor);
295
- var FunctionalController = class extends Controller {
296
- constructor(component, constructor) {
297
- super(component);
298
- const originalExports = this.exports;
299
- try {
300
- setAmbientComponent(this.component);
301
- const value = constructor(this.component, this);
302
- const constructorChangedExports = this.exports !== originalExports;
303
- if (value instanceof Promise) {
304
- if (!constructorChangedExports) {
305
- this.setProvisionalExports(value);
306
- }
307
- const resolved = value.then((result) => {
308
- this.exports = result;
309
- super.catchUpLifecycle();
310
- }).catch((error) => {
311
- this._ready.reject(error);
312
- console.error(error);
313
- });
314
- this.onLoad(async () => await resolved);
315
- } else {
316
- if (!constructorChangedExports || value !== void 0) {
317
- this.exports = value;
318
- }
319
- queueMicrotask(() => super.catchUpLifecycle());
320
- }
321
- } catch (error) {
322
- this._ready.reject(error);
323
- console.error(error);
324
- }
325
- }
326
- /** Noop - will be called in the constructor instead */
327
- catchUpLifecycle() {
328
- return;
329
- }
330
- };
331
- var proxy = proxyExports(FunctionalController);
332
- var makeT9nController = (getAssetPath) => (options = {}) => (
333
- // eslint-disable-next-line @typescript-eslint/promise-function-async
334
- makeController((component, controller) => {
335
- const componentWithOverrides = component;
336
- controller.onLifecycle(
337
- () => startLocaleObserver(
338
- component.el,
339
- getAssetPath("./assets"),
340
- ({ t9nLocale, t9nStrings, lang }) => {
341
- const withoutOverrides = {
342
- ...t9nStrings,
343
- _lang: lang,
344
- _t9nLocale: t9nLocale,
345
- _loading: false
346
- };
347
- controller.exports = withoutOverrides;
348
- const label = t9nStrings.componentLabel ?? t9nStrings.widgetLabel;
349
- if (typeof label === "string" && "label" in component && component.label == null) {
350
- component.label ?? (component.label = label);
351
- }
352
- applyOverrides(componentWithOverrides.messageOverrides);
353
- },
354
- options.name
355
- )
356
- );
357
- function applyOverrides(messageOverrides) {
358
- const currentValue = controller.exports;
359
- const rawMessages = currentValue._original ?? currentValue;
360
- const updated = deepMerge(rawMessages, messageOverrides);
361
- updated._original = rawMessages;
362
- controller.exports = updated;
363
- }
364
- if ("messageOverrides" in componentWithOverrides) {
365
- controller.onLifecycle(() => watch(componentWithOverrides, "messageOverrides", applyOverrides));
366
- }
367
- if (options.blocking) {
368
- return controller.ready;
369
- }
370
- const locale = getElementLocales(component.el);
371
- const pending = {
372
- _lang: locale.lang,
373
- _t9nLocale: locale.t9nLocale,
374
- _loading: true
375
- };
376
- return pending;
377
- })
378
- );
379
- function deepMerge(original, overwrites) {
380
- if (!overwrites) {
381
- return original;
382
- }
383
- const merged = { ...original };
384
- Object.entries(overwrites).forEach(([key, value]) => {
385
- if (typeof value === "object") {
386
- merged[key] = deepMerge(original[key], value);
387
- } else {
388
- merged[key] = value ?? original[key];
389
- }
390
- });
391
- return merged;
392
- }
393
-
394
294
  function isMonacoEnvironmentSetup() {
395
295
  return !!window.MonacoEnvironment?.getWorkerUrl;
396
296
  }
@@ -449,8 +349,6 @@ function setupMonacoEnvironment(assetsPath) {
449
349
  };
450
350
  }
451
351
 
452
- const useT9n = makeT9nController(getAssetPath);
453
-
454
352
  const arcadeEditorCss = "arcgis-arcade-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-arcade-editor .flex-adjustable{flex:1 1 auto;overflow:hidden}arcgis-arcade-editor .flex-panel{flex:1 0 auto}arcgis-arcade-editor .position-relative{position:relative}arcgis-arcade-editor .flex-row{display:flex;flex-direction:row;overflow:hidden}arcgis-arcade-editor .flex-column{display:flex;flex-direction:column;overflow:hidden}arcgis-arcade-editor .border-inline-start{border-inline-start:1px solid var(--calcite-color-border-3);box-sizing:border-box}arcgis-arcade-editor .border-inline-end{border-inline-end:1px solid var(--calcite-color-border-3);box-sizing:border-box}arcgis-arcade-editor .sticky{position:sticky;top:0px;z-index:10}arcgis-arcade-editor .notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1);text-align:center}arcgis-arcade-editor .side-action-bar{max-width:25%}arcgis-arcade-editor .side-panel{max-width:45%;width:600px}arcgis-arcade-editor .side-panel calcite-flow{height:100%}arcgis-arcade-editor .main-action-bar{border-bottom:1px solid var(--calcite-color-border-3);flex:0 0 auto}arcgis-arcade-editor .main-action-bar calcite-action-group{padding-inline-end:var(--calcite-spacing-sm)}arcgis-arcade-editor .main-action-bar calcite-action-group calcite-action{padding-inline-end:var(--calcite-spacing-sm)}arcgis-arcade-editor .main-action-bar calcite-action-group calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}arcgis-arcade-editor .main-action-bar calcite-action-group:last-child{border-inline-end-width:0px}arcgis-arcade-editor .main-action-bar calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}arcgis-arcade-editor arcgis-arcade-results{border-top:1px solid var(--calcite-color-border-3);box-sizing:border-box;max-height:50%;min-height:50%;margin-bottom:-1px}arcgis-arcade-editor calcite-flow [slot=footer]{word-break:break-word}";
455
353
  const ArcgisArcadeEditorStyle0 = arcadeEditorCss;
456
354
 
@@ -535,11 +433,13 @@ const ArcgisArcadeEditor = class {
535
433
  set: "ignore",
536
434
  });
537
435
  }
538
- _messagesChanged() {
539
- this._updateArcadeDefaults().catch(console.error);
436
+ async _messagesChanged() {
437
+ await this._updateEditorProfile().catch(console.error);
438
+ await this._updateApiLibrary().catch(console.error);
540
439
  }
541
- _profileChanged() {
542
- this._updateArcadeDefaults().catch(console.error);
440
+ async _profileChanged() {
441
+ await this._updateEditorProfile().catch(console.error);
442
+ await this._updateApiLibrary().catch(console.error);
543
443
  }
544
444
  _testDataChanged() {
545
445
  if (!this._showExecutionPanel) {
@@ -621,12 +521,15 @@ const ArcgisArcadeEditor = class {
621
521
  // However, we need to setup the environment before the code editor is instantiated because
622
522
  // we need to access the arcade language service to get the api library.
623
523
  setupMonacoEnvironment(assetsPath);
624
- await this._updateArcadeDefaults();
524
+ await this._updateEditorProfile();
625
525
  }
626
526
  async componentDidLoad() {
627
527
  // Mark on component as ready.
628
528
  // Some methods are waiting for this state to actually continue.
629
529
  this._componentReadyDefer.resolve();
530
+ // We do updateApiLibrary in componentDidLoad because we need to wait until code editor
531
+ // is rendered for worker to register and allow for fetching the sdk
532
+ await this._updateApiLibrary();
630
533
  // Start listening to the validation diagnostics.
631
534
  // We are doing this as late as possible
632
535
  const diagnosticsService = await getArcadeDiagnosticService();
@@ -655,7 +558,7 @@ const ArcgisArcadeEditor = class {
655
558
  }
656
559
  // #endregion
657
560
  // #region Private methods API
658
- async _updateArcadeDefaults() {
561
+ async _updateEditorProfile() {
659
562
  // The profile definition or the locale has changed.
660
563
  // Ask the arcade defaults to prepare the profile for the model and to download the api library.
661
564
  this._preparingArcade = true;
@@ -665,7 +568,6 @@ const ArcgisArcadeEditor = class {
665
568
  snippets: this.snippets,
666
569
  });
667
570
  this._editorProfile = arcadeDefaults.getEditorProfileForModel(this._modelId);
668
- this._apiLibrary = await arcadeDefaults.getApiLibrary(this._modelId);
669
571
  }
670
572
  catch {
671
573
  this._editorProfile = undefined;
@@ -675,6 +577,9 @@ const ArcgisArcadeEditor = class {
675
577
  this._preparingArcade = false;
676
578
  }
677
579
  }
580
+ async _updateApiLibrary() {
581
+ this._apiLibrary = await arcadeDefaults.getApiLibrary(this._modelId);
582
+ }
678
583
  // #endregion
679
584
  //#region Render Main Action Bar
680
585
  renderMainActionBar() {
@@ -757,7 +662,7 @@ const ArcgisArcadeEditor = class {
757
662
  //#endregion
758
663
  //#region Render
759
664
  render() {
760
- return (h(Host, { key: 'f8a7e9cb7620c72586fc06dba017a44b63330198' }, this.renderMainActionBar(), h("div", { key: '086f52ceaa74266a8bcd28833ae526f73537a165', class: "flex-row flex-adjustable" }, h("div", { key: 'fa33e21b52d41b7c01a504eb85a229714b8c0556', class: "flex-column flex-adjustable" }, this.renderMainPanel(), this.renderResultsPanel()), this.renderSidePanel(), this.renderSideActionBar())));
665
+ return (h(Host, { key: '0d94f0940e22ebdf09ce14dac1f29ff6d0cda848' }, this.renderMainActionBar(), h("div", { key: 'cf41e32ee268570fc70204de9885f351bf2f0f6e', class: "flex-row flex-adjustable" }, h("div", { key: 'd2dd6c0e068baa18aa057b53b31b5ee552de97bc', class: "flex-column flex-adjustable" }, this.renderMainPanel(), this.renderResultsPanel()), this.renderSidePanel(), this.renderSideActionBar())));
761
666
  }
762
667
  static get assetsDirs() { return ["assets"]; }
763
668
  get el() { return getElement(this); }
@@ -4420,6 +4325,7 @@ const ArcgisCodeEditor = class {
4420
4325
  this.addCommonEditorActions();
4421
4326
  }
4422
4327
  disconnectedCallback() {
4328
+ this._editorInstance?.getModel()?.dispose();
4423
4329
  while (this._disposables.length) {
4424
4330
  this._disposables.pop()?.dispose();
4425
4331
  }
@@ -4487,7 +4393,7 @@ const ArcgisCodeEditor = class {
4487
4393
  //#endregion
4488
4394
  // #region Rendering
4489
4395
  render() {
4490
- return h(Host, { key: 'dc46295c6153511a5af31138745f7cb7cc03e1c8' });
4396
+ return h(Host, { key: 'ad62779413690025ea1498106aee049b3c786582' });
4491
4397
  }
4492
4398
  static get assetsDirs() { return ["assets"]; }
4493
4399
  get el() { return getElement(this); }
@@ -4555,6 +4461,21 @@ const ArcgisLanguageApiPanel = class {
4555
4461
  this.loading = false;
4556
4462
  this.apiLibrary = undefined;
4557
4463
  }
4464
+ _apiLibraryChanged(newVal) {
4465
+ // refresh the selected api item if there is one to use the new language
4466
+ if (!this._selectedApiItem) {
4467
+ return;
4468
+ }
4469
+ for (const category of newVal ?? []) {
4470
+ for (const item of category.items) {
4471
+ if (item.name === this._selectedApiItem.name) {
4472
+ this._selectedApiItem = item;
4473
+ return;
4474
+ }
4475
+ }
4476
+ }
4477
+ this._selectedApiItem = undefined;
4478
+ }
4558
4479
  //#endregion
4559
4480
  // #region Component lifecycle events
4560
4481
  async componentWillLoad() {
@@ -4616,10 +4537,13 @@ const ArcgisLanguageApiPanel = class {
4616
4537
  render() {
4617
4538
  const categories = (this.apiLibrary ?? []).map((apiCategory) => this.renderApiCategory(apiCategory));
4618
4539
  const empty = categories.every((g) => !g);
4619
- return (h(Host, { key: '60e169c299bceeb3d2912eea067d69005fb27bf5' }, h("style", { key: '4460f4de437b518f40f5013c6e06dadefc7c90a4' }, this._colorizeStyle), h("calcite-flow", { key: '06a7e13f55efbd24e4eb200ad2c4cbf56b699b50', ref: (ref) => this.flowFocusHandler(ref) }, h("calcite-flow-item", { key: 'db5e4e8817ee85de1c19655496529fb93bb544dd', heading: this.messages.constantsandfunctions, closable: true, onCalciteFlowItemClose: this._emitClose }, h("calcite-input", { key: 'a35a4cedbdec59eed366f719c7d48e662005f6fb', value: this._filterValue, icon: "magnifying-glass", clearable: true, onCalciteInputInput: this._updateFilterValue, class: "sticky", scale: "m" }), this.loading ? (h("calcite-loader", { scale: "s", type: "indeterminate", label: this.messages.loading ?? "Loading" })) : (h("calcite-list", null, empty ? h("div", { class: "notice-container" }, this.messages.noitems) : categories))), this.renderApiItemFlowItem())));
4540
+ return (h(Host, { key: '777e65f0a9891fbdf8fd6177890df475261d198e' }, h("style", { key: 'bacffd5a30dfa72f9cc99db6a7066fd551c06e60' }, this._colorizeStyle), h("calcite-flow", { key: 'b48417bccd1a1a5e400d5b205ff0dc3a21e08a76', ref: (ref) => this.flowFocusHandler(ref) }, h("calcite-flow-item", { key: 'a44cdb484d60daa1a6410ed7d513eb680f20f883', heading: this.messages.constantsandfunctions, closable: true, onCalciteFlowItemClose: this._emitClose }, h("calcite-input", { key: 'ebe4708ce6ccb62b2d5639bb9cbc5ee207e7e2b9', value: this._filterValue, icon: "magnifying-glass", clearable: true, onCalciteInputInput: this._updateFilterValue, class: "sticky", scale: "m" }), this.loading ? (h("calcite-loader", { scale: "s", type: "indeterminate", label: this.messages.loading ?? "Loading" })) : (h("calcite-list", null, empty ? h("div", { class: "notice-container" }, this.messages.noitems) : categories))), this.renderApiItemFlowItem())));
4620
4541
  }
4621
4542
  static get assetsDirs() { return ["assets"]; }
4622
4543
  get el() { return getElement(this); }
4544
+ static get watchers() { return {
4545
+ "apiLibrary": ["_apiLibraryChanged"]
4546
+ }; }
4623
4547
  };
4624
4548
  ArcgisLanguageApiPanel.style = ArcgisLanguageApiPanelStyle0;
4625
4549
 
@@ -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.54
4
+ * v4.31.0-next.55
5
5
  */
6
- import { p as promiseResolve, b as bootstrapLazy } from './index-20936dfe.js';
7
- export { s as setNonce } from './index-20936dfe.js';
8
- import { g as globalScripts } from './app-globals-7a9ff748.js';
6
+ import { p as promiseResolve, b as bootstrapLazy } from './index-542987c6.js';
7
+ export { s as setNonce } from './index-542987c6.js';
8
+ import { g as globalScripts } from './app-globals-5e71a2db.js';
9
9
 
10
10
  /*
11
11
  Stencil Client Patch Browser v4.19.2 | MIT Licensed | https://stenciljs.com
@@ -21,5 +21,5 @@ var patchBrowser = () => {
21
21
 
22
22
  patchBrowser().then(async (options) => {
23
23
  await globalScripts();
24
- return bootstrapLazy([["arcgis-sql-expression-fields",[[1,"arcgis-sql-expression-fields",{"loading":[4],"modelId":[1,"model-id"],"_mutationCounter":[32],"_flowItemRenderers":[32],"_filterValue":[32]},null,{"modelId":["modelIdPropChanged"]}]]],["arcgis-arcade-editor_6",[[0,"arcgis-arcade-editor",{"profile":[16],"script":[1025],"testData":[16],"suggestions":[16],"snippets":[16],"hideDocumentationActions":[4,"hide-documentation-actions"],"hideSideBar":[4,"hide-side-bar"],"sideActionBarExpanded":[1540,"side-action-bar-expanded"],"openedSidePanel":[1537,"opened-side-panel"],"editorOptions":[16],"editorInstance":[16],"_preparingArcade":[32],"_editorProfile":[32],"_apiLibrary":[32],"_showExecutionPanel":[32],"_resultPanel":[32],"_executingScript":[32],"_consoleLogs":[32],"_executionResult":[32],"messages":[32],"getScript":[64],"setFocus":[64],"getEditorInstance":[64],"getTestResult":[64],"updateThemeColors":[64]},null,{"messages":["_messagesChanged"],"profile":["_profileChanged"],"testData":["_testDataChanged"],"snippets":["_snippetChanged"]}],[1,"arcgis-arcade-results",{"loading":[4],"openedResultPanel":[1537,"opened-result-panel"],"result":[16],"consoleLogs":[16]}],[1,"arcgis-arcade-suggestions",{"suggestions":[16],"_selectedSuggestion":[32],"_filterValue":[32],"_colorizeStyle":[32]},null,{"suggestions":["suggestionsPropChanged"]}],[1,"arcgis-arcade-variables",{"loading":[4],"modelId":[1,"model-id"],"_mutationCounter":[32],"_flowItemRenderers":[32],"_filterValue":[32]},null,{"modelId":["modelIdPropChanged"]}],[0,"arcgis-code-editor",{"value":[1],"language":[1],"modelId":[1,"model-id"],"editorOptions":[16],"editorInstance":[16],"getValue":[64],"setValue":[64],"insertText":[64],"insertSnippet":[64],"getEditorInstance":[64],"setFocus":[64]},null,{"language":["languagePropChange"],"modelId":["modelIdPropChange"],"editorOptions":["editorOptionsPropChange"]}],[1,"arcgis-language-api-panel",{"hideDocumentationActions":[4,"hide-documentation-actions"],"loading":[4],"apiLibrary":[16],"_selectedApiItem":[32],"_filterValue":[32],"_colorizeStyle":[32]}]]],["arcgis-sql-expression-editor",[[0,"arcgis-sql-expression-editor",{"profile":[16],"_preparing":[32],"_editorProfile":[32],"_activeAction":[32],"_apiLibrary":[32]},null,{"profile":["_profileChanged"]}]]]], options);
24
+ return bootstrapLazy([["arcgis-sql-expression-fields",[[1,"arcgis-sql-expression-fields",{"loading":[4],"modelId":[1,"model-id"],"_mutationCounter":[32],"_flowItemRenderers":[32],"_filterValue":[32]},null,{"modelId":["modelIdPropChanged"]}]]],["arcgis-arcade-editor_6",[[0,"arcgis-arcade-editor",{"profile":[16],"script":[1025],"testData":[16],"suggestions":[16],"snippets":[16],"hideDocumentationActions":[4,"hide-documentation-actions"],"hideSideBar":[4,"hide-side-bar"],"sideActionBarExpanded":[1540,"side-action-bar-expanded"],"openedSidePanel":[1537,"opened-side-panel"],"editorOptions":[16],"editorInstance":[16],"_preparingArcade":[32],"_editorProfile":[32],"_apiLibrary":[32],"_showExecutionPanel":[32],"_resultPanel":[32],"_executingScript":[32],"_consoleLogs":[32],"_executionResult":[32],"messages":[32],"getScript":[64],"setFocus":[64],"getEditorInstance":[64],"getTestResult":[64],"updateThemeColors":[64]},null,{"messages":["_messagesChanged"],"profile":["_profileChanged"],"testData":["_testDataChanged"],"snippets":["_snippetChanged"]}],[1,"arcgis-arcade-results",{"loading":[4],"openedResultPanel":[1537,"opened-result-panel"],"result":[16],"consoleLogs":[16]}],[1,"arcgis-arcade-suggestions",{"suggestions":[16],"_selectedSuggestion":[32],"_filterValue":[32],"_colorizeStyle":[32]},null,{"suggestions":["suggestionsPropChanged"]}],[1,"arcgis-arcade-variables",{"loading":[4],"modelId":[1,"model-id"],"_mutationCounter":[32],"_flowItemRenderers":[32],"_filterValue":[32]},null,{"modelId":["modelIdPropChanged"]}],[0,"arcgis-code-editor",{"value":[1],"language":[1],"modelId":[1,"model-id"],"editorOptions":[16],"editorInstance":[16],"getValue":[64],"setValue":[64],"insertText":[64],"insertSnippet":[64],"getEditorInstance":[64],"setFocus":[64]},null,{"language":["languagePropChange"],"modelId":["modelIdPropChange"],"editorOptions":["editorOptionsPropChange"]}],[1,"arcgis-language-api-panel",{"hideDocumentationActions":[4,"hide-documentation-actions"],"loading":[4],"apiLibrary":[16],"_selectedApiItem":[32],"_filterValue":[32],"_colorizeStyle":[32]},null,{"apiLibrary":["_apiLibraryChanged"]}]]],["arcgis-sql-expression-editor",[[0,"arcgis-sql-expression-editor",{"profile":[16],"script":[1025],"_preparing":[32],"_editorProfile":[32],"_activeAction":[32],"_apiLibrary":[32],"messages":[32]},null,{"messages":["_messagesChanged"],"profile":["_profileChanged"]}]]]], options);
25
25
  });
@@ -1,11 +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.54
4
+ * v4.31.0-next.55
5
5
  */
6
- import { r as registerInstance, h, H as Host, a as getElement } from './index-20936dfe.js';
7
- import { u as useControllerManager, a as sqlExprDefaults } from './sql-expr-defaults-3913a59f.js';
8
- import { o as generateGuid } from './language-defaults-base-9e3f1f44.js';
6
+ import { r as registerInstance, c as createEvent, h, H as Host, a as getElement } from './index-542987c6.js';
7
+ import { u as useControllerManager, s as sqlExprDefaults } from './sql-expr-defaults-5d4eebcc.js';
8
+ import { l as generateGuid } from './language-defaults-base-cf9491cd.js';
9
+ import { u as useT9n } from './useT9n-917bda01.js';
9
10
 
10
11
  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
12
  const ArcgisSqlExpressionEditorStyle0 = sqlExpressionEditorCss;
@@ -13,27 +14,42 @@ const ArcgisSqlExpressionEditorStyle0 = sqlExpressionEditorCss;
13
14
  const SqlExpressionEditor = class {
14
15
  constructor(hostRef) {
15
16
  registerInstance(this, hostRef);
17
+ this.arcgisScriptChange = createEvent(this, "arcgisScriptChange", 3);
16
18
  this.manager = useControllerManager(this);
17
19
  // #endregion
18
20
  // #region Private properties
19
21
  this._modelId = generateGuid();
20
22
  this._insertAsSnippet = (e) => void this._codeEditorElt?.insertSnippet(e.detail).catch(console.error);
23
+ this._updateApiLibrary = async () => {
24
+ this._apiLibrary = await sqlExprDefaults.getApiLibrary(this._modelId);
25
+ };
26
+ this._onCodeEditorValueChange = (e) => {
27
+ e.stopPropagation();
28
+ this.script = e.detail;
29
+ this.arcgisScriptChange.emit(e.detail);
30
+ };
21
31
  this._preparing = false;
22
32
  this._editorProfile = undefined;
23
33
  this._activeAction = undefined;
24
34
  this._apiLibrary = undefined;
35
+ this.messages = useT9n();
25
36
  this.profile = undefined;
37
+ this.script = "";
38
+ }
39
+ async _messagesChanged() {
40
+ await this._updateEditorProfile().catch(console.error);
41
+ await this._updateApiLibrary().catch(console.error);
26
42
  }
27
- _profileChanged() {
28
- this._updateSqlExprDefaults().catch(console.error);
43
+ async _profileChanged() {
44
+ await this._updateEditorProfile().catch(console.error);
45
+ await this._updateApiLibrary().catch(console.error);
29
46
  }
30
47
  // #endregion
31
48
  // #region Private methods API
32
- async _updateSqlExprDefaults() {
49
+ async _updateEditorProfile() {
33
50
  this._preparing = true;
34
51
  try {
35
52
  await sqlExprDefaults.setProfileForModel(this._modelId, this.profile);
36
- this._apiLibrary = await sqlExprDefaults.getApiLibrary(this._modelId);
37
53
  }
38
54
  catch {
39
55
  this._editorProfile = undefined;
@@ -53,22 +69,28 @@ const SqlExpressionEditor = class {
53
69
  // #endregion
54
70
  // #region Component lifecycle events
55
71
  async componentWillLoad() {
56
- await this._updateSqlExprDefaults().catch(console.error);
72
+ await this._updateEditorProfile().catch(console.error);
57
73
  // The profile has to be refreshed on locale change
58
74
  // this.manager.watch("messages", () => void this._updateEditorProfile().catch(console.error));
59
75
  }
76
+ async componentDidLoad() {
77
+ // We do updateApiLibrary in componentDidLoad because we need to wait until code editor
78
+ // is rendered for worker to register and allow for fetching the sdk
79
+ await this._updateApiLibrary();
80
+ }
60
81
  disconnectedCallback() {
61
82
  sqlExprDefaults.disposeForModel(this._modelId);
62
83
  }
63
84
  // #endregion
64
85
  render() {
65
- return (h(Host, { key: '67f7ebf7a28a8ffc3fe967721389d45c4e2003a1' }, h("div", { key: 'b3bf4ec2a8d04105e97489593ccec95cd33237f0', class: "flex-row flex-adjustable" }, h("div", { key: 'fdac47e22baf64c72f786f9e09b637050f417f94', class: "flex-column flex-adjustable" }, h("arcgis-code-editor", { key: 'f4151dd39ec3523907cd907ebb7558e05bca9cc1', language: "arcgis-sql-expression", modelId: this._modelId, ref: (e) => (this._codeEditorElt = e) })), this._activeAction === "fields" && (h("arcgis-sql-expression-fields", { key: 'aa0e5d88429d4bf865b9adc506028efefec1a73a', class: "side-panel flex-panel border-inline-start", loading: this._preparing, modelId: this._modelId, "data-panel-name": "none", onArcgisFieldSelected: this._insertAsSnippet, onArcgisClose: () => this._setActiveAction(undefined) })), this._activeAction === "functions" && (h("arcgis-language-api-panel", { key: '7826dbb1b08894c6c6385806a3aef6cff77395d0', class: "side-panel flex-panel border-inline-start", onArcgisItemSelected: this._insertAsSnippet, onArcgisClose: () => this._setActiveAction(undefined), loading: this._preparing, apiLibrary: this._apiLibrary, "data-panel-name": "none" })), h("calcite-action-bar", { key: 'ee618d666b70405495627a9d15238e8723c6f961', class: "side-action-bar border-inline-start", expanded: false, position: "end" }, h("calcite-action", { key: '2c828df5dded6347e13e59ba9e313824baa606ff', id: "fields-action", text: "Fields", icon: "profile-variables", active: this._activeAction === "fields", "data-panel-name": "fields",
86
+ return (h(Host, { key: '63348b6e3e5aa7544203c5ec7270db7827c6f3ed' }, h("div", { key: '203ed656208717c877c540ed5c49fc12338d6b15', class: "flex-row flex-adjustable" }, h("div", { key: '4dfe400bbc9ab74ef86c4115ceeabbcb41913427', class: "flex-column flex-adjustable" }, h("arcgis-code-editor", { key: 'dfc9e247b39d2d9901ac911e147d993897809954', language: "arcgis-sql-expression", modelId: this._modelId, ref: (e) => (this._codeEditorElt = e), value: this.script ?? "", onArcgisValueChange: this._onCodeEditorValueChange })), this._activeAction === "fields" && (h("arcgis-sql-expression-fields", { key: 'b5a5516264aae278f3feec00a5e20e2d0855024d', class: "side-panel flex-panel border-inline-start", loading: this._preparing, modelId: this._modelId, "data-panel-name": "none", onArcgisFieldSelected: this._insertAsSnippet, onArcgisClose: () => this._setActiveAction(undefined) })), this._activeAction === "functions" && (h("arcgis-language-api-panel", { key: '6da236e289e8bcdadc27cadece6e1fb34c55b1da', class: "side-panel flex-panel border-inline-start", onArcgisItemSelected: this._insertAsSnippet, onArcgisClose: () => this._setActiveAction(undefined), loading: this._preparing, apiLibrary: this._apiLibrary, "data-panel-name": "none" })), h("calcite-action-bar", { key: '91549ebac7e78165b911e5def1141010032dfa43', class: "side-action-bar border-inline-start", expanded: false, position: "end" }, h("calcite-action", { key: '32211e3b4e8db0530a047ba6c22234d15e504e17', id: "fields-action", text: this.messages.fields ?? "Fields", icon: "profile-variables", active: this._activeAction === "fields", "data-panel-name": "fields",
66
87
  // need to use an arrow function to automatically bind 'this'
67
- onClick: (e) => this._handleActionClick(e) }), h("calcite-action", { key: 'eab785c5b14cadeb5047db1957134f5accfedc76', id: "functions-action", text: "Functions", icon: "function", active: this._activeAction === "functions", "data-panel-name": "functions", onClick: (e) => this._handleActionClick(e) })))));
88
+ onClick: (e) => this._handleActionClick(e) }), h("calcite-action", { key: '3c308d994b45c67df76414580d881a082333d2f8', id: "functions-action", text: this.messages.functions ?? "Functions", icon: "function", active: this._activeAction === "functions", "data-panel-name": "functions", onClick: (e) => this._handleActionClick(e) })))));
68
89
  }
69
90
  static get assetsDirs() { return ["assets"]; }
70
91
  get el() { return getElement(this); }
71
92
  static get watchers() { return {
93
+ "messages": ["_messagesChanged"],
72
94
  "profile": ["_profileChanged"]
73
95
  }; }
74
96
  };
@@ -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.54
4
+ * v4.31.0-next.55
5
5
  */
6
- import { r as registerInstance, c as createEvent, h, a as getElement } from './index-20936dfe.js';
7
- import { u as useControllerManager, a as sqlExprDefaults } from './sql-expr-defaults-3913a59f.js';
8
- import './language-defaults-base-9e3f1f44.js';
6
+ import { r as registerInstance, c as createEvent, h, a as getElement } from './index-542987c6.js';
7
+ import { u as useControllerManager, s as sqlExprDefaults } from './sql-expr-defaults-5d4eebcc.js';
8
+ import './language-defaults-base-cf9491cd.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.54
4
+ * v4.31.0-next.55
5
5
  */
6
6
  /*!-----------------------------------------------------------------------------
7
7
  * Copyright (c) Microsoft Corporation. All rights reserved.