@arcgis/coding-components 4.33.0-next.98 → 4.33.0-next.99

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 (135) hide show
  1. package/dist/arcgis-coding-components/4CWG53YG.js +4 -0
  2. package/dist/arcgis-coding-components/{5ZOYDLAC.js.LEGAL.txt → 4CWG53YG.js.LEGAL.txt} +1 -1
  3. package/dist/arcgis-coding-components/{SZL27LHR.js → 4KGS45F6.js} +4 -4
  4. package/dist/arcgis-coding-components/{23FE3AUR.js.LEGAL.txt → 4KGS45F6.js.LEGAL.txt} +1 -1
  5. package/dist/arcgis-coding-components/6X6SKMSK.js +4 -0
  6. package/dist/arcgis-coding-components/{7TXRTUKS.js.LEGAL.txt → 6X6SKMSK.js.LEGAL.txt} +1 -1
  7. package/dist/arcgis-coding-components/{MAE2RWZW.js → AIQ3ZZ4N.js} +2 -2
  8. package/dist/arcgis-coding-components/{3K25AEDV.js → B6RBYOZB.js} +1 -1
  9. package/dist/arcgis-coding-components/BHPZXDRW.js +4 -0
  10. package/dist/arcgis-coding-components/{AXWCZF4E.js.LEGAL.txt → BHPZXDRW.js.LEGAL.txt} +1 -1
  11. package/dist/arcgis-coding-components/{AIE7L3C5.js → BXIVTWDT.js} +2 -2
  12. package/dist/arcgis-coding-components/{AXWCZF4E.js → CCHHSGLF.js} +2 -2
  13. package/dist/arcgis-coding-components/CCHHSGLF.js.LEGAL.txt +3 -0
  14. package/dist/arcgis-coding-components/{EKSDDOFX.js → CLUD6ZAM.js} +2 -2
  15. package/dist/arcgis-coding-components/CPPMJWU4.js +4 -0
  16. package/dist/arcgis-coding-components/CPPMJWU4.js.LEGAL.txt +3 -0
  17. package/dist/arcgis-coding-components/{5QXK2YE3.js → DAIV4YM2.js} +2 -2
  18. package/dist/arcgis-coding-components/{INZZAXQC.js → DETRUXO4.js} +2 -2
  19. package/dist/arcgis-coding-components/DETRUXO4.js.LEGAL.txt +3 -0
  20. package/dist/arcgis-coding-components/{MY3HJHIM.js → DPLHQRHL.js} +2 -2
  21. package/dist/arcgis-coding-components/{MY3HJHIM.js.LEGAL.txt → DPLHQRHL.js.LEGAL.txt} +1 -1
  22. package/dist/arcgis-coding-components/{CVRMEEFT.js → EZ46MHBE.js} +1 -1
  23. package/dist/arcgis-coding-components/FBZDECME.js +4 -0
  24. package/dist/arcgis-coding-components/FBZDECME.js.LEGAL.txt +3 -0
  25. package/dist/arcgis-coding-components/{XLTP4ML3.js → GLZTVDY3.js} +1 -1
  26. package/dist/arcgis-coding-components/GQYPMHDN.js +8 -0
  27. package/dist/arcgis-coding-components/GQYPMHDN.js.LEGAL.txt +3 -0
  28. package/dist/arcgis-coding-components/GTJMQUCR.js +4 -0
  29. package/dist/arcgis-coding-components/GTJMQUCR.js.LEGAL.txt +3 -0
  30. package/dist/arcgis-coding-components/{CTM4IBKM.js → H5IXRF6P.js} +2 -2
  31. package/dist/arcgis-coding-components/{COJNNA7B.js → HK3NR5FJ.js} +2 -2
  32. package/dist/arcgis-coding-components/{FTB35RPN.js → I6FG6PHA.js} +2 -2
  33. package/dist/arcgis-coding-components/{UIOT2EYW.js → IERFPICF.js} +3 -3
  34. package/dist/arcgis-coding-components/IERFPICF.js.LEGAL.txt +3 -0
  35. package/dist/arcgis-coding-components/{7IONFETN.js → IGD5JVMO.js} +2 -2
  36. package/dist/arcgis-coding-components/{Y5XLP6LG.js → KE4BOMMR.js} +2 -2
  37. package/dist/arcgis-coding-components/{ORAMMLLX.js → LVP37CVZ.js} +2 -2
  38. package/dist/arcgis-coding-components/{LLMDOQPE.js → MQ6QSJ3D.js} +1 -1
  39. package/dist/arcgis-coding-components/MQ6QSJ3D.js.LEGAL.txt +3 -0
  40. package/dist/arcgis-coding-components/{XT46NGHA.js → NNQQRWM4.js} +2 -2
  41. package/dist/arcgis-coding-components/{6HBVN473.js → OHE2XVBA.js} +2 -2
  42. package/dist/arcgis-coding-components/OQ3VLBIA.js +4 -0
  43. package/dist/arcgis-coding-components/OQ3VLBIA.js.LEGAL.txt +3 -0
  44. package/dist/arcgis-coding-components/PYOJIGHL.js +4 -0
  45. package/dist/arcgis-coding-components/{5ZOYDLAC.js → QCGTZIV7.js} +2 -2
  46. package/dist/arcgis-coding-components/QCGTZIV7.js.LEGAL.txt +3 -0
  47. package/dist/arcgis-coding-components/{PIPVA5X7.js → S5J3QOAN.js} +2 -2
  48. package/dist/arcgis-coding-components/S5J3QOAN.js.LEGAL.txt +3 -0
  49. package/dist/arcgis-coding-components/{DCS7WAW6.js → TSHYFCHO.js} +2 -2
  50. package/dist/arcgis-coding-components/TSHYFCHO.js.LEGAL.txt +3 -0
  51. package/dist/arcgis-coding-components/{GVRWIXX3.js → UBQV4SE4.js} +9 -9
  52. package/dist/arcgis-coding-components/UBQV4SE4.js.LEGAL.txt +3 -0
  53. package/dist/arcgis-coding-components/{DKV6ZEWK.js → WR6DJLNQ.js} +2 -2
  54. package/dist/arcgis-coding-components/{NJGL7PC5.js → XJBT377I.js} +3 -3
  55. package/dist/arcgis-coding-components/{NJGL7PC5.js.LEGAL.txt → XJBT377I.js.LEGAL.txt} +1 -1
  56. package/dist/arcgis-coding-components/{PJBWHPS7.js → XPHHHGZH.js} +2 -2
  57. package/dist/arcgis-coding-components/{PJBWHPS7.js.LEGAL.txt → XPHHHGZH.js.LEGAL.txt} +1 -1
  58. package/dist/arcgis-coding-components/{CBMPRUW4.js → Z5YGU3UZ.js} +2 -2
  59. package/dist/arcgis-coding-components/Z5YGU3UZ.js.LEGAL.txt +3 -0
  60. package/dist/arcgis-coding-components/{VLLF6AK6.js → Z65637GR.js} +2 -2
  61. package/dist/arcgis-coding-components/Z65637GR.js.LEGAL.txt +3 -0
  62. package/dist/arcgis-coding-components/arcgis-coding-components.esm.js +2 -2
  63. package/dist/arcgis-coding-components/arcgis-coding-components.esm.js.LEGAL.txt +1 -1
  64. package/dist/arcgis-coding-components/assets/arcade-coding-assistant/t9n/messages.en.json +1 -0
  65. package/dist/chunks/arcade-defaults.js +1 -1
  66. package/dist/chunks/arcade-executor.js +1 -1
  67. package/dist/chunks/arcade-mode.js +1 -1
  68. package/dist/chunks/arcade-service-accessors.js +6 -53
  69. package/dist/chunks/fields.js +1 -1
  70. package/dist/chunks/language-defaults-base.js +1 -1
  71. package/dist/chunks/markdown.js +25 -24
  72. package/dist/chunks/monaco-importer.js +1 -1
  73. package/dist/chunks/runtime.js +1 -1
  74. package/dist/chunks/setup-monaco.js +52 -0
  75. package/dist/chunks/sql-expr-contribution.js +107 -0
  76. package/dist/chunks/sql-expr-defaults.js +1 -1
  77. package/dist/chunks/sql-expr-mode.js +1 -1
  78. package/dist/chunks/useT9n.js +1 -1
  79. package/dist/components/arcgis-arcade-coding-assistant/customElement.d.ts +10 -0
  80. package/dist/components/arcgis-arcade-coding-assistant/customElement.js +26 -0
  81. package/dist/components/arcgis-arcade-coding-assistant/index.d.ts +1 -0
  82. package/dist/components/arcgis-arcade-coding-assistant/index.js +1 -0
  83. package/dist/components/arcgis-arcade-editor/customElement.js +3 -2
  84. package/dist/components/arcgis-arcade-results/customElement.js +1 -1
  85. package/dist/components/arcgis-arcade-suggestions/customElement.js +2 -2
  86. package/dist/components/arcgis-code-editor/customElement.js +33 -113
  87. package/dist/components/arcgis-editor-variables/customElement.js +1 -1
  88. package/dist/components/arcgis-language-api-panel/customElement.d.ts +2 -0
  89. package/dist/components/arcgis-language-api-panel/customElement.js +26 -25
  90. package/dist/components/arcgis-sql-expression-editor/customElement.js +5 -5
  91. package/dist/components/arcgis-sql-expression-fields/customElement.js +1 -1
  92. package/dist/docs/api.json +2 -2
  93. package/dist/docs/docs.json +2 -2
  94. package/dist/docs/web-types.json +1 -1
  95. package/dist/index.js +1 -1
  96. package/dist/loader.js +3 -2
  97. package/dist/utils/colorize.d.ts +2 -2
  98. package/dist/utils/monaco-languages.d.ts +13 -0
  99. package/dist/utils/profile/types.d.ts +72 -3
  100. package/package.json +6 -6
  101. package/dist/arcgis-coding-components/23FE3AUR.js +0 -4
  102. package/dist/arcgis-coding-components/7TXRTUKS.js +0 -4
  103. package/dist/arcgis-coding-components/CBMPRUW4.js.LEGAL.txt +0 -3
  104. package/dist/arcgis-coding-components/CWBKG7AM.js +0 -4
  105. package/dist/arcgis-coding-components/CWBKG7AM.js.LEGAL.txt +0 -3
  106. package/dist/arcgis-coding-components/DCS7WAW6.js.LEGAL.txt +0 -3
  107. package/dist/arcgis-coding-components/GVRWIXX3.js.LEGAL.txt +0 -3
  108. package/dist/arcgis-coding-components/IMB6UYER.js +0 -4
  109. package/dist/arcgis-coding-components/IMB6UYER.js.LEGAL.txt +0 -3
  110. package/dist/arcgis-coding-components/INZZAXQC.js.LEGAL.txt +0 -3
  111. package/dist/arcgis-coding-components/LLMDOQPE.js.LEGAL.txt +0 -3
  112. package/dist/arcgis-coding-components/MLGUO3SZ.js +0 -8
  113. package/dist/arcgis-coding-components/MLGUO3SZ.js.LEGAL.txt +0 -3
  114. package/dist/arcgis-coding-components/PIPVA5X7.js.LEGAL.txt +0 -3
  115. package/dist/arcgis-coding-components/SZL27LHR.js.LEGAL.txt +0 -3
  116. package/dist/arcgis-coding-components/TNSXZ2FB.js +0 -4
  117. package/dist/arcgis-coding-components/UIOT2EYW.js.LEGAL.txt +0 -3
  118. package/dist/arcgis-coding-components/VLLF6AK6.js.LEGAL.txt +0 -3
  119. /package/dist/arcgis-coding-components/{MAE2RWZW.js.LEGAL.txt → AIQ3ZZ4N.js.LEGAL.txt} +0 -0
  120. /package/dist/arcgis-coding-components/{3K25AEDV.js.LEGAL.txt → B6RBYOZB.js.LEGAL.txt} +0 -0
  121. /package/dist/arcgis-coding-components/{AIE7L3C5.js.LEGAL.txt → BXIVTWDT.js.LEGAL.txt} +0 -0
  122. /package/dist/arcgis-coding-components/{EKSDDOFX.js.LEGAL.txt → CLUD6ZAM.js.LEGAL.txt} +0 -0
  123. /package/dist/arcgis-coding-components/{5QXK2YE3.js.LEGAL.txt → DAIV4YM2.js.LEGAL.txt} +0 -0
  124. /package/dist/arcgis-coding-components/{COJNNA7B.js.LEGAL.txt → EZ46MHBE.js.LEGAL.txt} +0 -0
  125. /package/dist/arcgis-coding-components/{CVRMEEFT.js.LEGAL.txt → GLZTVDY3.js.LEGAL.txt} +0 -0
  126. /package/dist/arcgis-coding-components/{CTM4IBKM.js.LEGAL.txt → H5IXRF6P.js.LEGAL.txt} +0 -0
  127. /package/dist/arcgis-coding-components/{TNSXZ2FB.js.LEGAL.txt → HK3NR5FJ.js.LEGAL.txt} +0 -0
  128. /package/dist/arcgis-coding-components/{FTB35RPN.js.LEGAL.txt → I6FG6PHA.js.LEGAL.txt} +0 -0
  129. /package/dist/arcgis-coding-components/{7IONFETN.js.LEGAL.txt → IGD5JVMO.js.LEGAL.txt} +0 -0
  130. /package/dist/arcgis-coding-components/{XLTP4ML3.js.LEGAL.txt → KE4BOMMR.js.LEGAL.txt} +0 -0
  131. /package/dist/arcgis-coding-components/{ORAMMLLX.js.LEGAL.txt → LVP37CVZ.js.LEGAL.txt} +0 -0
  132. /package/dist/arcgis-coding-components/{XT46NGHA.js.LEGAL.txt → NNQQRWM4.js.LEGAL.txt} +0 -0
  133. /package/dist/arcgis-coding-components/{6HBVN473.js.LEGAL.txt → OHE2XVBA.js.LEGAL.txt} +0 -0
  134. /package/dist/arcgis-coding-components/{Y5XLP6LG.js.LEGAL.txt → PYOJIGHL.js.LEGAL.txt} +0 -0
  135. /package/dist/arcgis-coding-components/{DKV6ZEWK.js.LEGAL.txt → WR6DJLNQ.js.LEGAL.txt} +0 -0
@@ -7,7 +7,7 @@ import { u as f } from "../../chunks/useT9n.js";
7
7
  import { css as m } from "@lit/reactive-element/css-tag.js";
8
8
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
9
9
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
10
- v4.33.0-next.98 */
10
+ v4.33.0-next.99 */
11
11
  const u = m`:host{background-color:var(--calcite-color-foreground-1);.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.sticky{position:sticky;top:0;z-index:10}calcite-flow{height:100%}calcite-list-item-group{background-color:var(--calcite-color-foreground-2);word-break:break-word}}`;
12
12
  function g(l) {
13
13
  l.key === "Enter" && l.stopPropagation();
@@ -5,6 +5,8 @@ import { ApiCategory, ApiItem } from '@arcgis/languages-api-utils';
5
5
 
6
6
  /** @private */
7
7
  export declare class ArcgisLanguageApiPanel extends LitElement {
8
+ /** The language the panel is rendering */
9
+ languageId: string;
8
10
  /** The api library to display */
9
11
  apiLibrary: ApiCategory[] | undefined;
10
12
  /** Should the documentation action be hidden */
@@ -1,35 +1,36 @@
1
1
  import { c as m } from "../../chunks/runtime.js";
2
- import { ref as c } from "lit-html/directives/ref.js";
2
+ import { ref as o } from "lit-html/directives/ref.js";
3
3
  import { html as s } from "lit";
4
- import { setFocusOnElement as d, addLTRMark as o, focusElement as h } from "@arcgis/components-utils";
5
- import { LitElement as u, createEvent as a } from "@arcgis/lumina";
6
- import { g as r, o as p, c as n, a as f } from "../../chunks/markdown.js";
7
- import { f as g } from "../../chunks/monaco-importer.js";
8
- import { u as _ } from "../../chunks/useT9n.js";
9
- import { css as b } from "@lit/reactive-element/css-tag.js";
4
+ import { setFocusOnElement as h, addLTRMark as a, focusElement as u } from "@arcgis/components-utils";
5
+ import { LitElement as p, createEvent as c } from "@arcgis/lumina";
6
+ import { g as r, o as f, c as n, a as g } from "../../chunks/markdown.js";
7
+ import { f as _ } from "../../chunks/monaco-importer.js";
8
+ import { u as b } from "../../chunks/useT9n.js";
9
+ import { css as v } from "@lit/reactive-element/css-tag.js";
10
+ import { s as d } from "../../chunks/sql-expr-contribution.js";
10
11
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
11
12
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
12
- v4.33.0-next.98 */
13
- const v = b`:host{background-color:var(--calcite-color-foreground-1);.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.sticky{position:sticky;top:0;z-index:10}calcite-flow{height:100%}calcite-block{p:first-of-type{margin-top:0}code{font-family:var(--calcite-code-family)}pre{direction:ltr;overflow-x:auto;background-color:var(--calcite-color-foreground-2);padding:var(--calcite-spacing-sm);code{font-size:var(--calcite-font-size--2)}}}calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}}`;
14
- class y extends u {
13
+ v4.33.0-next.99 */
14
+ const y = v`:host{background-color:var(--calcite-color-foreground-1);.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.sticky{position:sticky;top:0;z-index:10}calcite-flow{height:100%}calcite-block{p:first-of-type{margin-top:0}code{font-family:var(--calcite-code-family)}pre{direction:ltr;overflow-x:auto;background-color:var(--calcite-color-foreground-2);padding:var(--calcite-spacing-sm);code{font-size:var(--calcite-font-size--2)}}}calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}}`;
15
+ class I extends p {
15
16
  constructor() {
16
- super(...arguments), this.messages = _(), this._unselectItem = async () => {
17
+ super(...arguments), this.messages = b(), this._unselectItem = async () => {
17
18
  this._selectedApiItem = void 0;
18
- }, this._colorizeStyle = "", this._filterValue = "", this.hideDocumentationActions = !1, this.loading = !1, this.arcgisClose = a({ bubbles: !1 }), this.arcgisItemSelected = a({ bubbles: !1 });
19
+ }, this._colorizeStyle = "", this._filterValue = "", this.languageId = "arcade", this.hideDocumentationActions = !1, this.loading = !1, this.arcgisClose = c({ bubbles: !1 }), this.arcgisItemSelected = c({ bubbles: !1 });
19
20
  }
20
21
  static {
21
- this.properties = { _colorizeStyle: 16, _filterValue: 16, _selectedApiItem: 16, apiLibrary: 0, hideDocumentationActions: 5, loading: 5 };
22
+ this.properties = { _colorizeStyle: 16, _filterValue: 16, _selectedApiItem: 16, languageId: 1, apiLibrary: 0, hideDocumentationActions: 5, loading: 5 };
22
23
  }
23
24
  static {
24
- this.styles = v;
25
+ this.styles = y;
25
26
  }
26
27
  //#endregion
27
28
  //#region Lifecycle
28
- load() {
29
- this._colorizeStyle = r(), this._themeChangedListener = p(() => this._colorizeStyle = r());
29
+ async load() {
30
+ await d(this.languageId), this._colorizeStyle = r(), this._themeChangedListener = f(() => this._colorizeStyle = r());
30
31
  }
31
32
  willUpdate(e) {
32
- if (e.has("apiLibrary")) {
33
+ if (e.has("languageId") && d(this.languageId), e.has("apiLibrary")) {
33
34
  if (!this._selectedApiItem)
34
35
  return;
35
36
  for (const i of this.apiLibrary ?? [])
@@ -52,7 +53,7 @@ class y extends u {
52
53
  return;
53
54
  }
54
55
  this._flowObserver || (this._flowObserver = new MutationObserver(() => {
55
- d(e.querySelector("calcite-flow-item:last-child"), "calcite-input");
56
+ h(e.querySelector("calcite-flow-item:last-child"), "calcite-input");
56
57
  }), this._flowObserver.observe(e, { attributes: !0, attributeFilter: ["id"], childList: !0 }));
57
58
  }
58
59
  _emitItemSelected(e, i) {
@@ -75,24 +76,24 @@ class y extends u {
75
76
  this._filterValue = e.currentTarget.value ?? "";
76
77
  }
77
78
  _elementToMarkdown(e) {
78
- e !== void 0 && (e.innerHTML = n(this._selectedApiItem.examples), f(e).catch(console.error));
79
+ e !== void 0 && (e.innerHTML = n(this._selectedApiItem.examples), g(e, this.languageId).catch(console.error));
79
80
  }
80
81
  //#endregion
81
82
  //#region Rendering
82
83
  renderApiCategory(e) {
83
- const i = g(e.items, "name", this._filterValue);
84
- return i.length ? s`<calcite-list-item-group .heading=${e.title}>${i.map((t) => s`<calcite-list-item .label=${o(t.completion.detail)} @calciteListItemSelect=${(l) => this._emitItemSelected(l, t)} @keydown=${(l) => this._emitItemSelected(l, t)}><calcite-action slot=actions-end .text=${this.messages.expand ?? ""} icon=chevron-right icon-flip-rtl scale=s @click=${(l) => this._selectItem(l, t)}></calcite-action></calcite-list-item>`)}</calcite-list-item-group>` : null;
84
+ const i = _(e.items, "name", this._filterValue);
85
+ return i.length ? s`<calcite-list-item-group .heading=${e.title}>${i.map((t) => s`<calcite-list-item .label=${a(t.completion.detail)} @calciteListItemSelect=${(l) => this._emitItemSelected(l, t)} @keydown=${(l) => this._emitItemSelected(l, t)}><calcite-action slot=actions-end .text=${this.messages.expand ?? ""} icon=chevron-right icon-flip-rtl scale=s @click=${(l) => this._selectItem(l, t)}></calcite-action></calcite-list-item>`)}</calcite-list-item-group>` : null;
85
86
  }
86
87
  renderApiItemFlowItem() {
87
88
  const e = this._selectedApiItem;
88
- return e ? s`<calcite-flow-item .heading=${this.messages.constantsandfunctions} .beforeBack=${this._unselectItem} closable @calciteFlowItemClose=${this._emitClose} selected>${this.hideDocumentationActions ? null : s`<calcite-button width=half slot=footer appearance=outline kind=brand scale=s .href=${e.link} target=Help icon-start=information>${this.messages.moreinformation}</calcite-button>`}<calcite-button .width=${this.hideDocumentationActions ? "full" : "half"} slot=footer appearance=outline kind=brand icon-start=code scale=s @click=${(i) => this._emitItemSelectedAndClose(i, e)} ${c(h)}>${this.messages.insert}</calcite-button><calcite-block open .heading=${o(e.completion.detail)}><div .innerHTML=${n(e.completion.documentation) ?? ""}></div>${e.examples ? s`<div ${c(this._elementToMarkdown)}></div>` : null}</calcite-block></calcite-flow-item>` : null;
89
+ return e ? s`<calcite-flow-item .heading=${this.messages.constantsandfunctions} .beforeBack=${this._unselectItem} closable @calciteFlowItemClose=${this._emitClose} selected>${this.hideDocumentationActions ? null : s`<calcite-button width=half slot=footer appearance=outline kind=brand scale=s .href=${e.link} target=Help icon-start=information>${this.messages.moreinformation}</calcite-button>`}<calcite-button .width=${this.hideDocumentationActions ? "full" : "half"} slot=footer appearance=outline kind=brand icon-start=code scale=s @click=${(i) => this._emitItemSelectedAndClose(i, e)} ${o(u)}>${this.messages.insert}</calcite-button><calcite-block open .heading=${a(e.completion.detail)}><div .innerHTML=${n(e.completion.documentation) ?? ""}></div>${e.examples ? s`<div ${o(this._elementToMarkdown)}></div>` : null}</calcite-block></calcite-flow-item>` : null;
89
90
  }
90
91
  render() {
91
92
  const e = (this.apiLibrary ?? []).map((t) => this.renderApiCategory(t)), i = e.every((t) => !t);
92
- return s`<style>${this._colorizeStyle}</style><calcite-flow ${c(this.flowFocusHandler)}><calcite-flow-item .heading=${this.messages.constantsandfunctions} closable @calciteFlowItemClose=${this._emitClose} .selected=${!this._selectedApiItem}><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${this._updateFilterValue} class="sticky" scale=m></calcite-input>${this.loading ? s`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading ?? "Loading"}></calcite-loader>` : s`<calcite-list label="arcade api">${i ? s`<div class="notice-container">${this.messages.noitems}</div>` : e}</calcite-list>`}</calcite-flow-item>${this.renderApiItemFlowItem()}</calcite-flow>`;
93
+ return s`<style>${this._colorizeStyle}</style><calcite-flow ${o(this.flowFocusHandler)}><calcite-flow-item .heading=${this.messages.constantsandfunctions} closable @calciteFlowItemClose=${this._emitClose} .selected=${!this._selectedApiItem}><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${this._updateFilterValue} class="sticky" scale=m></calcite-input>${this.loading ? s`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading ?? "Loading"}></calcite-loader>` : s`<calcite-list label="arcade api">${i ? s`<div class="notice-container">${this.messages.noitems}</div>` : e}</calcite-list>`}</calcite-flow-item>${this.renderApiItemFlowItem()}</calcite-flow>`;
93
94
  }
94
95
  }
95
- m("arcgis-language-api-panel", y);
96
+ m("arcgis-language-api-panel", I);
96
97
  export {
97
- y as ArcgisLanguageApiPanel
98
+ I as ArcgisLanguageApiPanel
98
99
  };
@@ -3,16 +3,16 @@ import { html as i } from "lit";
3
3
  import { LitElement as s, createEvent as r, noShadowRoot as n } from "@arcgis/lumina";
4
4
  import { generateGuid as l } from "@arcgis/components-utils";
5
5
  import { a } from "../../chunks/sql-expr-defaults.js";
6
- import { u as c } from "../../chunks/useT9n.js";
7
- import { createRef as d, ref as p } from "lit-html/directives/ref.js";
6
+ import { u as d } from "../../chunks/useT9n.js";
7
+ import { createRef as c, ref as p } from "lit-html/directives/ref.js";
8
8
  import { css as h } from "@lit/reactive-element/css-tag.js";
9
9
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
10
10
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
11
- v4.33.0-next.98 */
11
+ v4.33.0-next.99 */
12
12
  const g = h`@layer{arcgis-sql-expression-editor{display:flex;flex-direction:column;position:relative;overflow:hidden;border:var(--arcgis-coding-components-border);box-sizing:border-box;background-color:var(--arcgis-coding-components-background-color);height:100%;.flex-adjustable{flex:1 1 auto;overflow:hidden}.flex-panel{flex:1 0 auto}.position-relative{position:relative}.flex-row{display:flex;flex-direction:row;overflow:hidden}.flex-column{display:flex;flex-direction:column;overflow:hidden}.border-inline-start{border-inline-start:var(--arcgis-coding-components-border);box-sizing:border-box}.border-inline-end{border-inline-end:var(--arcgis-coding-components-border);box-sizing:border-box}.side-action-bar{max-width:var(--arcgis-coding-components-side-action-bar-max-w)}.side-panel{max-width:var(--arcgis-coding-components-side-panel-max-w);width:var(--arcgis-coding-components-side-panel-w);calcite-flow{height:100%}}}}`;
13
13
  class f extends s {
14
14
  constructor() {
15
- super(...arguments), this._codeEditorElt = d(), this.messages = c(), this._modelId = l(), this._preparing = !1, this.sideActionBarExpanded = !1, this.script = "", this.hideSideBar = !1, this.arcgisScriptChange = r({ bubbles: !1 });
15
+ super(...arguments), this._codeEditorElt = c(), this.messages = d(), this._modelId = l(), this._preparing = !1, this.sideActionBarExpanded = !1, this.script = "", this.hideSideBar = !1, this.arcgisScriptChange = r({ bubbles: !1 });
16
16
  }
17
17
  static {
18
18
  this.properties = { _activeAction: 16, _apiLibrary: 16, _editorProfile: 16, _preparing: 16, sideActionBarExpanded: 16, profile: 0, script: 1, hideSideBar: 5 };
@@ -85,7 +85,7 @@ class f extends s {
85
85
  //#region Rendering
86
86
  render() {
87
87
  const e = this._getFeatureSetVariable();
88
- return i`<div class="flex-row flex-adjustable"><div class="flex-column flex-adjustable"><arcgis-code-editor language=arcgis-sql-expression .modelId=${this._modelId} .value=${this.script ?? ""} @arcgisValueChange=${this._onCodeEditorValueChange} ${p(this._codeEditorElt)}></arcgis-code-editor></div>${this._activeAction === "fields" && !this.hideSideBar && i`<arcgis-editor-variables .variable=${e} class="side-panel flex-panel border-inline-start" .loading=${this._preparing} .modelId=${this._modelId} @arcgisItemSelected=${this._insertAsText} @arcgisClose=${() => this._setActiveAction(void 0)} data-panel-name=none></arcgis-editor-variables>` || ""}${this._activeAction === "functions" && !this.hideSideBar && i`<arcgis-language-api-panel class="side-panel flex-panel border-inline-start" @arcgisItemSelected=${this._insertAsSnippet} @arcgisClose=${() => this._setActiveAction(void 0)} .loading=${this._preparing} .apiLibrary=${this._apiLibrary} data-panel-name=none hide-documentation-actions></arcgis-language-api-panel>` || ""}${!this.hideSideBar && i`<calcite-action-bar class="side-action-bar border-inline-start" .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}><calcite-action id=fields-action .text=${this.messages.fields ?? "Fields"} icon=profile-variables .active=${this._activeAction === "fields"} data-panel-name=fields @click=${this._handleActionClick}></calcite-action>${!this.sideActionBarExpanded && i`<calcite-tooltip reference-element=fields-action><span>${this.messages.fields ?? "Fields"}</span></calcite-tooltip>` || ""}<calcite-action id=functions-action .text=${this.messages.functions ?? "Functions"} icon=function .active=${this._activeAction === "functions"} data-panel-name=functions @click=${this._handleActionClick}></calcite-action>${!this.sideActionBarExpanded && i`<calcite-tooltip reference-element=functions-action><span>${this.messages.functions ?? "Functions"}</span></calcite-tooltip>` || ""}</calcite-action-bar>` || ""}</div>`;
88
+ return i`<div class="flex-row flex-adjustable"><div class="flex-column flex-adjustable"><arcgis-code-editor language=arcgis-sql-expression .modelId=${this._modelId} .value=${this.script ?? ""} @arcgisValueChange=${this._onCodeEditorValueChange} ${p(this._codeEditorElt)}></arcgis-code-editor></div>${this._activeAction === "fields" && !this.hideSideBar && i`<arcgis-editor-variables .variable=${e} class="side-panel flex-panel border-inline-start" .loading=${this._preparing} .modelId=${this._modelId} @arcgisItemSelected=${this._insertAsText} @arcgisClose=${() => this._setActiveAction(void 0)} data-panel-name=none></arcgis-editor-variables>` || ""}${this._activeAction === "functions" && !this.hideSideBar && i`<arcgis-language-api-panel class="side-panel flex-panel border-inline-start" @arcgisItemSelected=${this._insertAsSnippet} @arcgisClose=${() => this._setActiveAction(void 0)} .loading=${this._preparing} .apiLibrary=${this._apiLibrary} data-panel-name=none hide-documentation-actions .languageId=${a.languageId}></arcgis-language-api-panel>` || ""}${!this.hideSideBar && i`<calcite-action-bar class="side-action-bar border-inline-start" .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}><calcite-action id=fields-action .text=${this.messages.fields ?? "Fields"} icon=profile-variables .active=${this._activeAction === "fields"} data-panel-name=fields @click=${this._handleActionClick}></calcite-action>${!this.sideActionBarExpanded && i`<calcite-tooltip reference-element=fields-action><span>${this.messages.fields ?? "Fields"}</span></calcite-tooltip>` || ""}<calcite-action id=functions-action .text=${this.messages.functions ?? "Functions"} icon=function .active=${this._activeAction === "functions"} data-panel-name=functions @click=${this._handleActionClick}></calcite-action>${!this.sideActionBarExpanded && i`<calcite-tooltip reference-element=functions-action><span>${this.messages.functions ?? "Functions"}</span></calcite-tooltip>` || ""}</calcite-action-bar>` || ""}</div>`;
89
89
  }
90
90
  }
91
91
  o("arcgis-sql-expression-editor", f);
@@ -7,7 +7,7 @@ import { u as m } from "../../chunks/useT9n.js";
7
7
  import { css as d } from "@lit/reactive-element/css-tag.js";
8
8
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
9
9
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
10
- v4.33.0-next.98 */
10
+ v4.33.0-next.99 */
11
11
  const h = d`:host{calcite-flow{height:100%}calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}}`;
12
12
  class f extends r {
13
13
  constructor() {
@@ -1,8 +1,8 @@
1
1
  {
2
- "timestamp": "2025-04-25T05:07:02",
2
+ "timestamp": "2025-04-26T05:00:00",
3
3
  "compiler": {
4
4
  "name": "@arcgis/lumina-compiler",
5
- "version": "4.33.0-next.98",
5
+ "version": "4.33.0-next.99",
6
6
  "typescriptVersion": "5.6.3"
7
7
  },
8
8
  "schemaVersion": "1.0.0",
@@ -1,8 +1,8 @@
1
1
  {
2
- "timestamp": "2025-04-25T05:07:02",
2
+ "timestamp": "2025-04-26T05:00:00",
3
3
  "compiler": {
4
4
  "name": "@arcgis/lumina-compiler",
5
- "version": "4.33.0-next.98",
5
+ "version": "4.33.0-next.99",
6
6
  "typescriptVersion": "5.6.3"
7
7
  },
8
8
  "components": [
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "name": "@arcgis/coding-components",
4
- "version": "4.33.0-next.98",
4
+ "version": "4.33.0-next.99",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import { a as c } from "./chunks/arcade-defaults.js";
3
3
  import { s as p } from "./chunks/sql-expr-defaults.js";
4
4
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
5
5
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
6
- v4.33.0-next.98 */
6
+ v4.33.0-next.99 */
7
7
  const a = s, r = t;
8
8
  export {
9
9
  c as arcade,
package/dist/loader.js CHANGED
@@ -2,14 +2,15 @@ import { r as e } from "./chunks/runtime.js";
2
2
  import { makeDefineCustomElements as i } from "@arcgis/lumina";
3
3
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
4
4
  See https://js.arcgis.com/4.33/esri/copyright.txt for details.
5
- v4.33.0-next.98 */
5
+ v4.33.0-next.99 */
6
6
  const o = i(e, {
7
+ "arcgis-arcade-coding-assistant": [() => import("./components/arcgis-arcade-coding-assistant/customElement.js")],
7
8
  "arcgis-arcade-editor": [() => import("./components/arcgis-arcade-editor/customElement.js"), "customPanels:,editorInstance:,editorOptions:,hideDocumentationActions,hideSideBar,openedSidePanel:,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getEditorInstance,getScript,getTestResult,setFocus"],
8
9
  "arcgis-arcade-results": [() => import("./components/arcgis-arcade-results/customElement.js"), "consoleLogs:,loading,openedResultPanel,result:"],
9
10
  "arcgis-arcade-suggestions": [() => import("./components/arcgis-arcade-suggestions/customElement.js"), "suggestions:"],
10
11
  "arcgis-code-editor": [() => import("./components/arcgis-code-editor/customElement.js"), "editorInstance:,editorOptions:,language,modelId,value;getEditorInstance,getValue,insertSnippet,insertText,setFocus,setValue"],
11
12
  "arcgis-editor-variables": [() => import("./components/arcgis-editor-variables/customElement.js"), "loading,modelId,variable:"],
12
- "arcgis-language-api-panel": [() => import("./components/arcgis-language-api-panel/customElement.js"), "apiLibrary:,hideDocumentationActions,loading"],
13
+ "arcgis-language-api-panel": [() => import("./components/arcgis-language-api-panel/customElement.js"), "apiLibrary:,hideDocumentationActions,languageId,loading"],
13
14
  "arcgis-sql-expression-editor": [() => import("./components/arcgis-sql-expression-editor/customElement.js"), "hideSideBar,profile:,script"],
14
15
  "arcgis-sql-expression-fields": [() => import("./components/arcgis-sql-expression-fields/customElement.js"), "loading,modelId"]
15
16
  });
@@ -1,5 +1,5 @@
1
1
  import { IDisposable } from 'monaco-editor';
2
- export declare function colorizedAllCodeElements(e: HTMLElement): Promise<void>;
3
- export declare function colorizeCodeElement(e: Element | null | undefined, text: string | null | undefined): Promise<void>;
2
+ export declare function colorizedAllCodeElements(e: HTMLElement, languageId: string): Promise<void>;
3
+ export declare function colorizeCodeElement(e: Element | null | undefined, text: string | null | undefined, languageId: string): Promise<void>;
4
4
  export declare function generateColorizeStyles(): string;
5
5
  export declare function onColorizeThemeChanged(func: () => void): IDisposable;
@@ -0,0 +1,13 @@
1
+ /**
2
+ * helper to track the languages that have been encountered in monaco-editor.
3
+ * Useful for wrapping callbacks passed to monaco's languages.onLanguage function.
4
+ * See arcade-contribution for usage.
5
+ */
6
+ export declare function withLanguageTracking(languageId: string, registerCallback: () => void): () => void;
7
+ /**
8
+ * Sets up the language in the editor outside of the editor.
9
+ * This is useful for when the editor is not present, but we still want to use the language features, like theming.
10
+ * We do this by creating a model with the languageId and then disposing of it.
11
+ * See usage in {@link ArcgisLanguageApiPanel}.
12
+ */
13
+ export declare function setupLanguageOutsideEditor(languageId: string): Promise<void>;
@@ -1,10 +1,78 @@
1
1
  /// <reference types="@arcgis/core/interfaces.d.ts" />
2
2
  import { BundleType, ApiItem, ApiVariableType, ProfileId } from '@arcgis/languages-api-utils';
3
- import { default as ProfileStringsType } from './assets/t9n/messages.en.json';
3
+ declare const profileStrings: (value: {
4
+ layer: string;
5
+ featureservice: string;
6
+ mapservice: string;
7
+ map: string;
8
+ webmap: string;
9
+ webscene: string;
10
+ webmapformat: string;
11
+ item: string;
12
+ invoking: string;
13
+ fields: string;
14
+ values: string;
15
+ relationships: string;
16
+ layers: string;
17
+ tables: string;
18
+ geometry: string;
19
+ dictionary: string;
20
+ feature: string;
21
+ featureset: string;
22
+ featuresetcollection: string;
23
+ oid: string;
24
+ number: string;
25
+ string: string;
26
+ date: string;
27
+ blob: string;
28
+ raster: string;
29
+ guid: string;
30
+ "global-id": string;
31
+ xml: string;
32
+ function: string;
33
+ domainvalues: string;
34
+ subtypes: string;
35
+ domainvaluesfortypeformat: string;
36
+ domainvaluesbysubtypes: string;
37
+ }) => {
38
+ layer: string;
39
+ featureservice: string;
40
+ mapservice: string;
41
+ map: string;
42
+ webmap: string;
43
+ webscene: string;
44
+ webmapformat: string;
45
+ item: string;
46
+ invoking: string;
47
+ fields: string;
48
+ values: string;
49
+ relationships: string;
50
+ layers: string;
51
+ tables: string;
52
+ geometry: string;
53
+ dictionary: string;
54
+ feature: string;
55
+ featureset: string;
56
+ featuresetcollection: string;
57
+ oid: string;
58
+ number: string;
59
+ string: string;
60
+ date: string;
61
+ blob: string;
62
+ raster: string;
63
+ guid: string;
64
+ "global-id": string;
65
+ xml: string;
66
+ function: string;
67
+ domainvalues: string;
68
+ subtypes: string;
69
+ domainvaluesfortypeformat: string;
70
+ domainvaluesbysubtypes: string;
71
+ };
4
72
  /**
5
73
  * The editor profile strings.
6
74
  */
7
- export type ProfileStrings = typeof ProfileStringsType;
75
+ export type ProfileStrings = ReturnType<typeof profileStrings>;
8
76
  /**
9
77
  * Editor Profile definition used for configuring the editor:
10
78
  * - presenting to the user the Arcade API
@@ -226,7 +294,7 @@ export interface IPredefinedProfile {
226
294
  */
227
295
  hiddenApiItems?: string[];
228
296
  }
229
- export type IndexedProfileStrings = Record<string, string | undefined> & typeof ProfileStringsType;
297
+ export type IndexedProfileStrings = ProfileStrings & Record<string, string | undefined>;
230
298
  /**
231
299
  * Describe the support source for some of the editor variables.
232
300
  */
@@ -340,3 +408,4 @@ export interface LayerInfo {
340
408
  export interface IExtendedPredefinedProfile extends IPredefinedProfile {
341
409
  additionalVariables?: IProfileVariable[];
342
410
  }
411
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/coding-components",
3
- "version": "4.33.0-next.98",
3
+ "version": "4.33.0-next.99",
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",
@@ -37,11 +37,11 @@
37
37
  ],
38
38
  "license": "SEE LICENSE IN LICENSE.md",
39
39
  "dependencies": {
40
- "@arcgis/arcade-languageservice": "4.33.0-next.98",
41
- "@arcgis/components-utils": "4.33.0-next.98",
42
- "@arcgis/core-adapter": "4.33.0-next.98",
43
- "@arcgis/languages-api-utils": "4.33.0-next.98",
44
- "@arcgis/lumina": "4.33.0-next.98",
40
+ "@arcgis/arcade-languageservice": "4.33.0-next.99",
41
+ "@arcgis/components-utils": "4.33.0-next.99",
42
+ "@arcgis/core-adapter": "4.33.0-next.99",
43
+ "@arcgis/languages-api-utils": "4.33.0-next.99",
44
+ "@arcgis/lumina": "4.33.0-next.99",
45
45
  "monaco-editor": "^0.52.0",
46
46
  "tslib": "^2.7.0",
47
47
  "vscode-languageserver-types": "^3.17.5"
@@ -1,4 +0,0 @@
1
- /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
- See https://js.arcgis.com/4.33/esri/copyright.txt for details.
3
- v4.33.0-next.98 */
4
- import{a as f,h as c}from"./DCS7WAW6.js";import{a as E,b as S}from"./MAE2RWZW.js";import{a as w}from"./INZZAXQC.js";import{a as v,b as P,d as s}from"./MLGUO3SZ.js";import"./Y5XLP6LG.js";import"./SZL27LHR.js";import"./3K25AEDV.js";import"./LLMDOQPE.js";import"./NJGL7PC5.js";import"./EKSDDOFX.js";import{C as m,D as x,a as g,b as t,d as n,l as r,o as u,y as _}from"./PJBWHPS7.js";import{a as h,h as p}from"./CVRMEEFT.js";import{Hl as b,kk as D}from"./6HBVN473.js";import"./XLTP4ML3.js";D();var C=d=>{if(!d.toString().includes("calcite-flow-item"))throw new Error("Renderer must return a JSX node that starts with <calcite-flow-item>");return!0},R=g`@layer{arcgis-arcade-editor{display:flex;flex-direction:column;position:relative;overflow:hidden;border:var(--arcgis-coding-components-border);box-sizing:border-box;background-color:var(--arcgis-coding-components-background-color);height:100%;.flex-adjustable{flex:1 1 auto;overflow:hidden}.flex-panel{flex:1 0 auto}.position-relative{position:relative}.flex-row{display:flex;flex-direction:row;overflow:hidden}.flex-column{display:flex;flex-direction:column;overflow:hidden}.border-inline-start{border-inline-start:var(--arcgis-coding-components-border);box-sizing:border-box}.border-inline-end{border-inline-end:var(--arcgis-coding-components-border);box-sizing:border-box}.sticky{position:sticky;top:0;z-index:10}.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1);text-align:center}.side-action-bar{max-width:var(--arcgis-coding-components-side-action-bar-max-w)}.side-panel{max-width:var(--arcgis-coding-components-side-panel-max-w);width:var(--arcgis-coding-components-side-panel-w);calcite-flow{height:100%}}.main-action-bar{border-bottom:var(--arcgis-coding-components-border);flex:0 0 auto;calcite-action-group{padding-inline-end:var(--calcite-spacing-sm);calcite-action{padding-inline-end:var(--calcite-spacing-sm)}calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}calcite-action-group:last-child{border-inline-end-width:0px}calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}arcgis-arcade-results{border-top:var(--arcgis-coding-components-border);box-sizing:border-box;max-height:50%;min-height:50%;margin-bottom:-1px}calcite-flow{[slot=footer]{word-break:break-word}}}}`,l=class extends _{constructor(){super(...arguments),this._codeEditorElt=E(),this._componentReadyDefer=new h,this._disposables=[],this._editorProfilePromise=Promise.resolve(void 0),this.messages=w(),this._modelId=p(),this._openArcadeHelp=()=>void window.open(f,"Arcade Help"),this._toggleSidePanel=e=>{if(!e.target)return;let i=e.target?.dataset.panelName??"none";this.openedSidePanel=i===this.openedSidePanel?"none":i,this.openedSidePanel==="none"&&this._codeEditorElt.value?.setFocus().catch(console.error)},this._consoleLogs=[],this._executingScript=!1,this._preparingArcade=!1,this._resultPanel="output",this._showExecutionPanel=!1,this.hideDocumentationActions=!1,this.hideSideBar=!1,this.openedSidePanel="none",this.script="",this.sideActionBarExpanded=!1,this.arcgisDiagnosticsChange=r({bubbles:!1}),this.arcgisScriptChange=r({bubbles:!1})}static{this.properties={_apiLibrary:16,_consoleLogs:16,_editorProfile:16,_executingScript:16,_executionResult:16,_preparingArcade:16,_resultPanel:16,_showExecutionPanel:16,editorInstance:32,editorOptions:0,hideDocumentationActions:5,hideSideBar:5,openedSidePanel:2,profile:0,script:1,sideActionBarExpanded:7,snippets:0,suggestions:0,testData:0,customPanels:0}}static{this.shadowRootOptions=u}static{this.styles=R}get editorInstance(){return this._codeEditorElt.value?.editorInstance}async getEditorInstance(){return await this._componentReadyDefer.promise,this._codeEditorElt.value?.editorInstance}async getScript(){return await this._componentReadyDefer.promise,this._codeEditorElt.value?.value}async getTestResult(){if(!this.testData)return{type:"error",value:"Missing test data",error:null};let e=await this._editorProfilePromise;if(!e)return{type:"error",value:"Missing editor profile",error:null};await this._componentReadyDefer.promise;let i=this._codeEditorElt.value?.value;return await c(e.definition,i,this.testData)}async setFocus(){await this._componentReadyDefer.promise,await this._codeEditorElt.value?.setFocus()}async load(){let e=x("./assets");v(e),await this._updateEditorProfile()}willUpdate(e){(e.has("messages")||e.has("profile"))&&this._updateDataModelDeps(),e.has("testData")&&this._testDataChanged(),e.has("snippets")&&s.updateApiContextForModel(this._modelId,{snippets:this.snippets})}async loaded(){this._componentReadyDefer.resolve(),await this._updateApiLibrary();let e=await P();this._disposables.push(e.onDiagnosticsChange(i=>!this._preparingArcade&&this.arcgisDiagnosticsChange.emit(i.diagnostics))),this.testData&&this._addExecuteScriptAction(),await this._codeEditorElt.value?.setFocus()}disconnectedCallback(){for(super.disconnectedCallback();this._disposables.length;)this._disposables.pop()?.dispose()}async _updateDataModelDeps(){await this._updateEditorProfile(),await this._updateApiLibrary()}_testDataChanged(){!this.testData&&this._executeScriptAction&&(this._disposeSafely(this._executeScriptAction),this._executeScriptAction=void 0),this.testData&&!this._executeScriptAction&&this._addExecuteScriptAction(),this._showExecutionPanel&&this._executeScript().catch(console.error)}async _updateEditorProfile(){this._preparingArcade=!0;try{await s.setProfileForModel(this._modelId,this.profile,{locale:this.messages._t9nLocale,snippets:this.snippets}),this._editorProfile=s.getEditorProfileForModel(this._modelId)}catch{this._editorProfile=void 0}finally{this._editorProfilePromise=Promise.resolve(this._editorProfile),this._preparingArcade=!1}}async _updateApiLibrary(){this._apiLibrary=await s.getApiLibraryForModel(this._modelId)}async _executeScript(){let e=this.testData;if(!this._codeEditorElt.value||!e)return;let i=await this._editorProfilePromise;if(!i){this._executionResult={type:"error",value:"Missing editor profile",error:null};return}this._showExecutionPanel=!0,this._executingScript=!0,this._consoleLogs=[],setTimeout(()=>void(async()=>{let a=this._codeEditorElt.value?.value;this._executionResult=await c(i.definition,a,e,o=>setTimeout(()=>this._consoleLogs=[...this._consoleLogs,o],0)),this._executingScript=!1})(),0)}_toggleShowExecutionPanel(){this._showExecutionPanel=!this._showExecutionPanel}_toggleSideActionBarExpanded(){this.sideActionBarExpanded=!this.sideActionBarExpanded}_onCodeEditorValueChange(e){e.stopPropagation(),this.script=e.detail,this.arcgisScriptChange.emit(e.detail)}_insertAsSnippet(e){this._codeEditorElt.value?.insertSnippet(e.detail).catch(console.error)}_insertAsText(e){this._insertText(e.detail)}_insertText(e){this._codeEditorElt.value?.insertText(e).catch(console.error)}_onResultPanelChange(e){this._resultPanel=e.detail}_onExecutionPanelClose(){this._showExecutionPanel=!1}_addExecuteScriptAction(){let e=this.editorInstance?.addAction({id:"run-script",label:"Run Arcade Expression",keybindings:[b.F5],contextMenuGroupId:"code",contextMenuOrder:1,run:()=>{this.testData&&this._executeScript().catch(console.error)}});e&&(this._executeScriptAction=e,this._disposables.push(e))}_disposeSafely(e){let i=this._disposables.indexOf(e);i!==-1&&this._disposables.splice(i,1),e.dispose()}renderMainActionBar(){return this.testData?t`<calcite-action-bar class="main-action-bar" layout=horizontal scale=s expanded expand-disabled><calcite-action-group scale=s><calcite-action .text=${this.messages.run??""} text-enabled icon=play scale=s .loading=${this._preparingArcade} @click=${()=>void this._executeScript().catch(console.error)}></calcite-action>${this._executionResult?t`<calcite-action .text=${this.messages.lastresults??""} .active=${this._showExecutionPanel} text-enabled icon=access-string-results icon-flip-rtl scale=s @click=${this._toggleShowExecutionPanel}></calcite-action>`:null}</calcite-action-group></calcite-action-bar>`:null}renderMainPanel(){return t`<arcgis-code-editor class="flex-adjustable" .editorOptions=${this.editorOptions} .language=${s.languageId} .value=${this.script??""} .modelId=${this._modelId} @arcgisValueChange=${this._onCodeEditorValueChange} ${S(this._codeEditorElt)}></arcgis-code-editor>`}renderAction({id:e,label:i,icon:a,active:o,panelName:$,iconFlipRtl:A=!1,onClick:y=this._toggleSidePanel}){return t`<calcite-action id=${e??n} .text=${i} .textEnabled=${this.sideActionBarExpanded} .icon=${a} .active=${o} @click=${y} data-panel-name=${$??n} .iconFlipRtl=${A}></calcite-action>${!this.sideActionBarExpanded&&t`<calcite-tooltip .referenceElement=${e}><span>${i}</span></calcite-tooltip>`||""}`}renderSideActionBar(){return this.hideSideBar?null:t`<calcite-action-bar class="side-action-bar border-inline-start" .expanded=${!!this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}><calcite-action-group>${this.renderAction({id:"profile-variables-action",label:this.messages.profilevariables??"",icon:"profile-variables",active:this.openedSidePanel==="variables",panelName:"variables"})}${this.renderAction({id:"function-action",label:this.messages.constantsandfunctions??"",icon:"function",active:this.openedSidePanel==="api",panelName:"api"})}${this.suggestions?.length?this.renderAction({id:"suggestions-action",label:this.messages.suggestions??"",icon:"lightbulb",active:this.openedSidePanel==="suggestions",panelName:"suggestions"}):null}${this.customPanels?.map(e=>this.renderAction({id:e.id,label:e.name,icon:e.icon,active:this.openedSidePanel===e.id,panelName:e.id}))}${this.hideDocumentationActions?null:this.renderAction({id:"developer-website-action",label:this.messages.help??"",icon:"question",active:!1,panelName:"none",iconFlipRtl:this.messages._lang==="ar",onClick:this._openArcadeHelp})}</calcite-action-group></calcite-action-bar>`}renderSidePanel(){if(this.hideSideBar)return null;switch(this.openedSidePanel){case"api":return t`<arcgis-language-api-panel class="side-panel flex-panel border-inline-start" .loading=${this._preparingArcade} .apiLibrary=${this._apiLibrary} .hideDocumentationActions=${this.hideDocumentationActions} @arcgisItemSelected=${this._insertAsSnippet} @arcgisClose=${this._toggleSidePanel} data-panel-name=none></arcgis-language-api-panel>`;case"variables":return t`<arcgis-editor-variables class="side-panel flex-panel border-inline-start" .loading=${this._preparingArcade} .modelId=${this._modelId} @arcgisItemSelected=${this._insertAsText} @arcgisClose=${this._toggleSidePanel} data-panel-name=none .variable=${this._editorProfile}></arcgis-editor-variables>`;case"suggestions":return t`<arcgis-arcade-suggestions class="side-panel flex-panel border-inline-start" .suggestions=${this.suggestions} @arcgisItemSelected=${this._insertAsText} @arcgisClose=${this._toggleSidePanel} data-panel-name=none></arcgis-arcade-suggestions>`;case"none":return null}let e=this.customPanels?.find(i=>i.id===this.openedSidePanel);if(e){let i=!!e?.useFlows;return t`<calcite-flow class="side-panel flex-panel border-inline-start">${i&&C(e.renderer)?e.renderer({closePanel:this._toggleSidePanel,insertText:this._insertText.bind(this)}):t`<calcite-flow-item .heading=${e.name} closable @calciteFlowItemClose=${this._toggleSidePanel} .description=${e.description}>${e.renderer({closePanel:this._toggleSidePanel,insertText:this._insertText.bind(this)})}</calcite-flow-item>`}</calcite-flow>`}return null}renderResultsPanel(){return this._showExecutionPanel?t`<arcgis-arcade-results class="flex-adjustable" .openedResultPanel=${this._resultPanel} .loading=${this._executingScript} .result=${this._executionResult} .consoleLogs=${this._consoleLogs} @arcgisOpenedResultPanelChange=${this._onResultPanelChange} @arcgisClose=${this._onExecutionPanelClose}></arcgis-arcade-results>`:null}render(){return t`${this.renderMainActionBar()}<div class="flex-row flex-adjustable"><div class="flex-column flex-adjustable">${this.renderMainPanel()}${this.renderResultsPanel()}</div>${this.renderSidePanel()}${this.renderSideActionBar()}</div>`}};m("arcgis-arcade-editor",l);export{l as ArcgisArcadeEditor};
@@ -1,4 +0,0 @@
1
- /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
- See https://js.arcgis.com/4.33/esri/copyright.txt for details.
3
- v4.33.0-next.98 */
4
- import{b,c as r,d as _,e as v}from"./GVRWIXX3.js";import{b as l}from"./MAE2RWZW.js";import{a as f}from"./INZZAXQC.js";import"./Y5XLP6LG.js";import{a as p}from"./NJGL7PC5.js";import"./EKSDDOFX.js";import{C as m,a as u,b as s,d as c,l as a,y as h}from"./PJBWHPS7.js";import{d as g,e as d}from"./CVRMEEFT.js";import"./6HBVN473.js";import"./XLTP4ML3.js";function S(o){return!Array.isArray(o)||!o.length?!1:Array.isArray(o[0].suggestions)}var $=u`:host{background-color:var(--calcite-color-foreground-1);.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.sticky{position:sticky;top:0;z-index:10}calcite-flow{height:100%}calcite-block{p:first-of-type{margin-top:0}code{font-family:var(--calcite-code-family)}pre{direction:ltr;overflow-x:auto;background-color:var(--calcite-color-foreground-2);padding:var(--calcite-spacing-sm);code{font-size:var(--calcite-font-size--2)}}}calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}}`,n=class extends h{constructor(){super(...arguments),this._beforeBack=async()=>{this._selectedSuggestion=void 0},this.messages=f(),this._colorizeStyle="",this._filterValue="",this.arcgisClose=a({bubbles:!1}),this.arcgisItemSelected=a({bubbles:!1})}static{this.properties={_colorizeStyle:16,_filterValue:16,_selectedSuggestion:16,suggestions:0}}static{this.styles=$}load(){this._colorizeStyle=r(),this._themeChangedListener=_(()=>this._colorizeStyle=r())}willUpdate(e){e.has("suggestions")&&this.suggestionsPropChanged()}disconnectedCallback(){super.disconnectedCallback(),this._flowObserver?.disconnect(),this._themeChangedListener?.dispose()}suggestionsPropChanged(){this._selectedSuggestion=void 0}flowFocusHandler(e){if(!e){this._flowObserver?.disconnect(),this._flowObserver=void 0;return}this._flowObserver||(this._flowObserver=new MutationObserver(()=>{d(e.querySelector("calcite-flow-item:last-child"),"calcite-input")}),this._flowObserver.observe(e,{attributes:!0,attributeFilter:["id"],childList:!0}))}_updateFilterValue(e){this._filterValue=e.currentTarget?.value??""}_emitItemSelected(e,t){let i=e;(!i.key||i.key==="Enter")&&(e.preventDefault(),this.arcgisItemSelected.emit(t.code))}_showSuggestionDetail(e,t){e.stopPropagation(),this._selectedSuggestion=t}_emitClose(){this.arcgisClose.emit()}_colorizeCode(e){e!==void 0&&b(e,this._selectedSuggestion.code)}renderSuggestionGroups(){return this.suggestions===void 0?null:S(this.suggestions)?this.suggestions.map(e=>s`<calcite-list-item-group .heading=${e.label}>${this.renderSuggestionListItems(e.suggestions)}</calcite-list-item-group>`):this.renderSuggestionListItems(this.suggestions)}renderSuggestionListItems(e){return e=p(e,"label",this._filterValue),e.length?e.map(t=>s`<calcite-list-item .label=${t.label} .description=${t.description} @calciteListItemSelect=${i=>this._emitItemSelected(i,t)} @keydown=${i=>this._emitItemSelected(i,t)} data-item=${t??c}><calcite-action slot=actions-end .text=${this.messages.expand??""} scale=s icon=chevron-right icon-flip-rtl @click=${i=>this._showSuggestionDetail(i,t)} data-item=${t??c}></calcite-action></calcite-list-item>`):s`<div class="notice-container">${this.messages.noitems}</div>`}renderSuggestionFlowItem(){let e=this._selectedSuggestion;return e?s`<calcite-flow-item .heading=${this.messages.suggestions} closable @calciteFlowItemClose=${this._emitClose} .beforeBack=${this._beforeBack} selected><calcite-button width=half slot=footer appearance=outline kind=brand icon-start=code scale=s @click=${t=>this._emitItemSelected(t,e)} data-item=${e??c} ${l(g)}>${this.messages.insert}</calcite-button><calcite-block open .heading=${e.label} .description=${e.description}><div .innerHTML=${v(e.documentation)??""}></div><pre><code ${l(this._colorizeCode)}></code></pre></calcite-block></calcite-flow-item>`:null}render(){return s`<style>${this._colorizeStyle}</style><calcite-flow ${l(this.flowFocusHandler)}><calcite-flow-item .heading=${this.messages.suggestions} closable @calciteFlowItemClose=${this._emitClose} .selected=${!this._selectedSuggestion}><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${this._updateFilterValue} class="sticky" scale=m></calcite-input><calcite-list label=suggestions>${this.renderSuggestionGroups()}</calcite-list></calcite-flow-item>${this.renderSuggestionFlowItem()}</calcite-flow>`}};m("arcgis-arcade-suggestions",n);export{n as ArcgisArcadeSuggestions};
@@ -1,3 +0,0 @@
1
- /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
- See https://js.arcgis.com/4.33/esri/copyright.txt for details.
3
- v4.33.0-next.98 */
@@ -1,4 +0,0 @@
1
- /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
- See https://js.arcgis.com/4.33/esri/copyright.txt for details.
3
- v4.33.0-next.98 */
4
- import{a as h,b as g}from"./MAE2RWZW.js";import{a as p}from"./INZZAXQC.js";import"./Y5XLP6LG.js";import{a}from"./PIPVA5X7.js";import"./SZL27LHR.js";import"./3K25AEDV.js";import"./LLMDOQPE.js";import"./NJGL7PC5.js";import"./EKSDDOFX.js";import{C as l,a as r,b as e,l as n,o as c,y as d}from"./PJBWHPS7.js";import{h as s}from"./CVRMEEFT.js";import"./6HBVN473.js";import"./XLTP4ML3.js";var f=r`@layer{arcgis-sql-expression-editor{display:flex;flex-direction:column;position:relative;overflow:hidden;border:var(--arcgis-coding-components-border);box-sizing:border-box;background-color:var(--arcgis-coding-components-background-color);height:100%;.flex-adjustable{flex:1 1 auto;overflow:hidden}.flex-panel{flex:1 0 auto}.position-relative{position:relative}.flex-row{display:flex;flex-direction:row;overflow:hidden}.flex-column{display:flex;flex-direction:column;overflow:hidden}.border-inline-start{border-inline-start:var(--arcgis-coding-components-border);box-sizing:border-box}.border-inline-end{border-inline-end:var(--arcgis-coding-components-border);box-sizing:border-box}.side-action-bar{max-width:var(--arcgis-coding-components-side-action-bar-max-w)}.side-panel{max-width:var(--arcgis-coding-components-side-panel-max-w);width:var(--arcgis-coding-components-side-panel-w);calcite-flow{height:100%}}}}`,o=class extends d{constructor(){super(...arguments),this._codeEditorElt=h(),this.messages=p(),this._modelId=s(),this._preparing=!1,this.sideActionBarExpanded=!1,this.script="",this.hideSideBar=!1,this.arcgisScriptChange=n({bubbles:!1})}static{this.properties={_activeAction:16,_apiLibrary:16,_editorProfile:16,_preparing:16,sideActionBarExpanded:16,profile:0,script:1,hideSideBar:5}}static{this.shadowRootOptions=c}static{this.styles=f}async load(){await this._updateEditorProfile().catch(console.error)}willUpdate(i){(i.has("messages")||i.has("profile"))&&this._updateDataModelDeps()}async _updateDataModelDeps(){await this._updateEditorProfile(),await this._updateApiLibrary()}async _updateEditorProfile(){this._preparing=!0;try{await a.setProfileForModel(this._modelId,this.profile,{locale:this.messages._t9nLocale}),this._editorProfile=a.getEditorProfileForModel(this._modelId)}catch{this._editorProfile=void 0}finally{this._preparing=!1}}_setActiveAction(i){if(this._activeAction===i){this._activeAction=void 0;return}this._activeAction=i}_handleActionClick(i){let t=i.target;this._setActiveAction(t.dataset.panelName)}_insertAsSnippet(i){this._codeEditorElt.value?.insertSnippet(i.detail).catch(console.error)}_insertAsText(i){this._codeEditorElt.value?.insertText(i.detail.replaceAll('"',"'")).catch(console.error)}async _updateApiLibrary(){this._apiLibrary=await a.getApiLibraryForModel(this._modelId)}_onCodeEditorValueChange(i){i.stopPropagation(),this.script=i.detail,this.arcgisScriptChange.emit(i.detail)}_getFeatureSetVariable(){let i,t=a.getEditorProfileForModel(this._modelId);return t?.variables?.length&&t?.variables?.[0]?.type!=="featureSet"?console.error("encountered unexpected editor profile"):i=t?.variables?.[0],i}_toggleSideActionBarExpanded(){this.sideActionBarExpanded=!this.sideActionBarExpanded}render(){let i=this._getFeatureSetVariable();return e`<div class="flex-row flex-adjustable"><div class="flex-column flex-adjustable"><arcgis-code-editor language=arcgis-sql-expression .modelId=${this._modelId} .value=${this.script??""} @arcgisValueChange=${this._onCodeEditorValueChange} ${g(this._codeEditorElt)}></arcgis-code-editor></div>${this._activeAction==="fields"&&!this.hideSideBar&&e`<arcgis-editor-variables .variable=${i} class="side-panel flex-panel border-inline-start" .loading=${this._preparing} .modelId=${this._modelId} @arcgisItemSelected=${this._insertAsText} @arcgisClose=${()=>this._setActiveAction(void 0)} data-panel-name=none></arcgis-editor-variables>`||""}${this._activeAction==="functions"&&!this.hideSideBar&&e`<arcgis-language-api-panel class="side-panel flex-panel border-inline-start" @arcgisItemSelected=${this._insertAsSnippet} @arcgisClose=${()=>this._setActiveAction(void 0)} .loading=${this._preparing} .apiLibrary=${this._apiLibrary} data-panel-name=none hide-documentation-actions></arcgis-language-api-panel>`||""}${!this.hideSideBar&&e`<calcite-action-bar class="side-action-bar border-inline-start" .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}><calcite-action id=fields-action .text=${this.messages.fields??"Fields"} icon=profile-variables .active=${this._activeAction==="fields"} data-panel-name=fields @click=${this._handleActionClick}></calcite-action>${!this.sideActionBarExpanded&&e`<calcite-tooltip reference-element=fields-action><span>${this.messages.fields??"Fields"}</span></calcite-tooltip>`||""}<calcite-action id=functions-action .text=${this.messages.functions??"Functions"} icon=function .active=${this._activeAction==="functions"} data-panel-name=functions @click=${this._handleActionClick}></calcite-action>${!this.sideActionBarExpanded&&e`<calcite-tooltip reference-element=functions-action><span>${this.messages.functions??"Functions"}</span></calcite-tooltip>`||""}</calcite-action-bar>`||""}</div>`}};l("arcgis-sql-expression-editor",o);export{o as ArcgisSqlExpressionEditor};
@@ -1,3 +0,0 @@
1
- /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
- See https://js.arcgis.com/4.33/esri/copyright.txt for details.
3
- v4.33.0-next.98 */
@@ -1,3 +0,0 @@
1
- /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
- See https://js.arcgis.com/4.33/esri/copyright.txt for details.
3
- v4.33.0-next.98 */
@@ -1,3 +0,0 @@
1
- /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
- See https://js.arcgis.com/4.33/esri/copyright.txt for details.
3
- v4.33.0-next.98 */
@@ -1,4 +0,0 @@
1
- /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
- See https://js.arcgis.com/4.33/esri/copyright.txt for details.
3
- v4.33.0-next.98 */
4
- import{a as b,c as r,d as v,e as n}from"./GVRWIXX3.js";import{b as l}from"./MAE2RWZW.js";import{a as _}from"./INZZAXQC.js";import"./Y5XLP6LG.js";import{a as g}from"./NJGL7PC5.js";import"./EKSDDOFX.js";import{C as f,a as p,b as s,l as o,y as u}from"./PJBWHPS7.js";import{d,e as h,q as a}from"./CVRMEEFT.js";import"./6HBVN473.js";import"./XLTP4ML3.js";var $=p`:host{background-color:var(--calcite-color-foreground-1);.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.sticky{position:sticky;top:0;z-index:10}calcite-flow{height:100%}calcite-block{p:first-of-type{margin-top:0}code{font-family:var(--calcite-code-family)}pre{direction:ltr;overflow-x:auto;background-color:var(--calcite-color-foreground-2);padding:var(--calcite-spacing-sm);code{font-size:var(--calcite-font-size--2)}}}calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}}`,m=class extends u{constructor(){super(...arguments),this.messages=_(),this._unselectItem=async()=>{this._selectedApiItem=void 0},this._colorizeStyle="",this._filterValue="",this.hideDocumentationActions=!1,this.loading=!1,this.arcgisClose=o({bubbles:!1}),this.arcgisItemSelected=o({bubbles:!1})}static{this.properties={_colorizeStyle:16,_filterValue:16,_selectedApiItem:16,apiLibrary:0,hideDocumentationActions:5,loading:5}}static{this.styles=$}load(){this._colorizeStyle=r(),this._themeChangedListener=v(()=>this._colorizeStyle=r())}willUpdate(e){if(e.has("apiLibrary")){if(!this._selectedApiItem)return;for(let i of this.apiLibrary??[])for(let t of i.items)if(t.name===this._selectedApiItem.name){this._selectedApiItem=t;return}this._selectedApiItem=void 0}}disconnectedCallback(){super.disconnectedCallback(),this._flowObserver?.disconnect(),this._themeChangedListener?.dispose()}flowFocusHandler(e){if(!e){this._flowObserver?.disconnect(),this._flowObserver=void 0;return}this._flowObserver||(this._flowObserver=new MutationObserver(()=>{h(e.querySelector("calcite-flow-item:last-child"),"calcite-input")}),this._flowObserver.observe(e,{attributes:!0,attributeFilter:["id"],childList:!0}))}_emitItemSelected(e,i){if(!i)return;let t=e;(!t.key||t.key==="Enter")&&(e.preventDefault(),this.arcgisItemSelected.emit(i.completion.insertText??""))}_emitClose(){this.arcgisClose.emit()}_emitItemSelectedAndClose(e,i){let t=e;(!t.key||t.key==="Enter")&&(e.preventDefault(),this.arcgisItemSelected.emit(i.completion.insertText??""))}_selectItem(e,i){e.stopPropagation(),this._selectedApiItem=i}_updateFilterValue(e){this._filterValue=e.currentTarget.value??""}_elementToMarkdown(e){e!==void 0&&(e.innerHTML=n(this._selectedApiItem.examples),b(e).catch(console.error))}renderApiCategory(e){let i=g(e.items,"name",this._filterValue);return i.length?s`<calcite-list-item-group .heading=${e.title}>${i.map(t=>s`<calcite-list-item .label=${a(t.completion.detail)} @calciteListItemSelect=${c=>this._emitItemSelected(c,t)} @keydown=${c=>this._emitItemSelected(c,t)}><calcite-action slot=actions-end .text=${this.messages.expand??""} icon=chevron-right icon-flip-rtl scale=s @click=${c=>this._selectItem(c,t)}></calcite-action></calcite-list-item>`)}</calcite-list-item-group>`:null}renderApiItemFlowItem(){let e=this._selectedApiItem;return e?s`<calcite-flow-item .heading=${this.messages.constantsandfunctions} .beforeBack=${this._unselectItem} closable @calciteFlowItemClose=${this._emitClose} selected>${this.hideDocumentationActions?null:s`<calcite-button width=half slot=footer appearance=outline kind=brand scale=s .href=${e.link} target=Help icon-start=information>${this.messages.moreinformation}</calcite-button>`}<calcite-button .width=${this.hideDocumentationActions?"full":"half"} slot=footer appearance=outline kind=brand icon-start=code scale=s @click=${i=>this._emitItemSelectedAndClose(i,e)} ${l(d)}>${this.messages.insert}</calcite-button><calcite-block open .heading=${a(e.completion.detail)}><div .innerHTML=${n(e.completion.documentation)??""}></div>${e.examples?s`<div ${l(this._elementToMarkdown)}></div>`:null}</calcite-block></calcite-flow-item>`:null}render(){let e=(this.apiLibrary??[]).map(t=>this.renderApiCategory(t)),i=e.every(t=>!t);return s`<style>${this._colorizeStyle}</style><calcite-flow ${l(this.flowFocusHandler)}><calcite-flow-item .heading=${this.messages.constantsandfunctions} closable @calciteFlowItemClose=${this._emitClose} .selected=${!this._selectedApiItem}><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${this._updateFilterValue} class="sticky" scale=m></calcite-input>${this.loading?s`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading??"Loading"}></calcite-loader>`:s`<calcite-list label="arcade api">${i?s`<div class="notice-container">${this.messages.noitems}</div>`:e}</calcite-list>`}</calcite-flow-item>${this.renderApiItemFlowItem()}</calcite-flow>`}};f("arcgis-language-api-panel",m);export{m as ArcgisLanguageApiPanel};
@@ -1,3 +0,0 @@
1
- /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
- See https://js.arcgis.com/4.33/esri/copyright.txt for details.
3
- v4.33.0-next.98 */
@@ -1,3 +0,0 @@
1
- /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
- See https://js.arcgis.com/4.33/esri/copyright.txt for details.
3
- v4.33.0-next.98 */
@@ -1,3 +0,0 @@
1
- /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
- See https://js.arcgis.com/4.33/esri/copyright.txt for details.
3
- v4.33.0-next.98 */
@@ -1,8 +0,0 @@
1
- /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
- See https://js.arcgis.com/4.33/esri/copyright.txt for details.
3
- v4.33.0-next.98 */
4
- import{a as T,b as M,c as j,d as m,e as A,f as F,g as $}from"./SZL27LHR.js";import{b as f,c as d,d as l}from"./3K25AEDV.js";import{f as v}from"./LLMDOQPE.js";import{D as u}from"./PJBWHPS7.js";import{i as h,j as g,w as k,x}from"./CVRMEEFT.js";function L(){return!!window.MonacoEnvironment?.getWorkerUrl}var V=new Map;function G(e){L()||(window.MonacoEnvironment={getWorker:async(n,t)=>{let a=V.get(t)??`${e}/code-editor/editor.worker.js`;switch(t){case"json":a=`${e}/code-editor/json.worker.js`;break;case"css":a=`${e}/code-editor/css.worker.js`;break;case"html":a=`${e}/code-editor/html.worker.js`;break;case"typescript":case"javascript":a=`${e}/code-editor/ts.worker.js`;break;case"arcade":a=`${e}/code-editor/arcade.worker.js`;break;case"arcgis-sql-expression":a=`${e}/code-editor/sql-expr.worker.js`;break}if(!x(a)||k(a,globalThis.location.href,!0))return new Worker(a,{name:t});let r=await(await v())(a,{responseType:"text"});return new Worker(URL.createObjectURL(new Blob([r.data],{type:"text/javascript"})))}})}async function z(){return(await E()).getArcadeDiagnosticService()}async function E(){return await import("./VLLF6AK6.js")}async function D(e){let{apiVersion:n,bundles:t,hiddenApiItems:a}=e.toEditorProfileDefinition(),r=await P(e.dictionaryVariables);return{apiVersion:n,bundles:t,variables:r,hiddenApiItems:a?.map(i=>i.toLowerCase())}}async function P(e,n=f.Variable){return await Promise.all(e.map(async t=>{switch(t.type){case"dictionary":return await R(t,n);case"feature":return await C(t,n);default:return S(t,n)}}))}function S(e,n){let{name:t,type:a}=e,r=e.getDescription();return{name:t,description:r,type:a,completion:{label:t,detail:t,insertText:t,insertTextMode:l.asIs,insertTextFormat:d.PlainText,kind:n,documentation:{kind:"markdown",value:r}}}}async function C(e,n){let t=await e.loadSource(),{name:a}=e,r=e.getDescription(),i={label:a,detail:a,insertText:a,insertTextMode:l.asIs,insertTextFormat:d.PlainText,kind:n},s={name:a,description:r,type:"dictionary",properties:[],completion:i};if(!t)return s;let[o,c]=A(t.fields,r,!0);return s.properties=o,i.documentation={kind:"markdown",value:c},s}async function R(e,n){let{name:t,dictionaryVariables:a}=e,r=e.getDescription(),i=a.reduce((s,o)=>{s!==""&&(s+=`
5
-
6
- `),s+=`**${o.name}**
7
- ${o.type}`;let c=o.getDescription();return c&&(s+=`
8
- ${c}`),s},r);return{name:t,description:r,type:"dictionary",properties:await P(a,f.Field),completion:{label:t,detail:t,insertText:t,insertTextMode:l.asIs,insertTextFormat:d.PlainText,kind:n,documentation:{kind:"markdown",value:i}}}}async function y(e="en"){let n=I.get(e);if(n)return n;if(!h.has(e))return await y("en");try{let t=await fetch(u(`./assets/arcade-language/profiles/arcade-profiles.t9n.${e}.json`));return t.ok?U(e,await t.json()):e==="en"?null:await y("en")}catch{return null}}var I=new Map;function U(e,n){let t=new Map;return n.forEach(a=>{t.set(a.id,a)}),I.set(e,t),t}async function W(e,n="en"){return(await y(n))?.get(e)??null}function q(e){return!!e&&typeof e=="object"&&"additionalVariables"in e&&Array.isArray(e.additionalVariables)}function K(e){return e?.map(w)}function w(e){switch(e.type){case"dictionary":return{...e,type:e.type,properties:K(e.properties)};case"array":return{...e,type:e.type,elementType:{type:"number",name:"number"}};default:return{...e,type:e.type}}}async function O(e,n="en"){if(!m(e))return;let t=await W(e.id,n);if(!t)return;let a={bundles:[...t.bundles],variables:[],hiddenApiItems:e.hiddenApiItems?.map(r=>r.toLowerCase())};return t.variables.forEach(r=>{if(e.disabledVariables?.includes(r.name))return;let i=e.definitions[r.name];switch(r.type){case"dictionary":return a.variables.push(w({...r,type:r.type,properties:Array.isArray(i)?[...i]:r.properties}));case"feature":case"voxel":return T(i)?a.variables.push({...r,type:"feature",definition:i}):void 0;case"featureSet":return M(i)?a.variables.push({...r,type:r.type,definition:i}):void 0;case"featureSetCollection":return j(i)?a.variables.push({...r,type:r.type,definition:i}):void 0;default:return a.variables.push(w(r))}}),q(e)&&a.variables.push(...e.additionalVariables??[]),a}var b=class extends ${constructor(){super("arcade",{apiPath:"./assets/arcade-language/api",apiPrefix:"arcade-api.t9n."})}async setProfileForModel(n,t,a={locale:"en"}){m(t)&&(t=await O(t,a.locale));let r=await g(a.locale,u("./assets/editor-profile/t9n"),"messages.");if(!r)throw new Error(`Failed to load the language bundle for ${a.locale}`);this.disposeForModel(n);let i=this._getApiKey(n),s=new F(t,r);this._modelToProfileMap.set(i,s);let o=await D(s);this.updateApiContextForModel(n,{locale:a.locale,profile:o,snippets:a.snippets})}},p=new b,Y={setProfileForModel:p.setProfileForModel.bind(p),getApiLibraryForModel:p.getApiLibraryForModel.bind(p)};export{G as a,z as b,E as c,p as d};
@@ -1,3 +0,0 @@
1
- /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
- See https://js.arcgis.com/4.33/esri/copyright.txt for details.
3
- v4.33.0-next.98 */
@@ -1,3 +0,0 @@
1
- /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
- See https://js.arcgis.com/4.33/esri/copyright.txt for details.
3
- v4.33.0-next.98 */
@@ -1,3 +0,0 @@
1
- /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
- See https://js.arcgis.com/4.33/esri/copyright.txt for details.
3
- v4.33.0-next.98 */
@@ -1,4 +0,0 @@
1
- /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
- See https://js.arcgis.com/4.33/esri/copyright.txt for details.
3
- v4.33.0-next.98 */
4
- import{a,b}from"./FTB35RPN.js";import"./6HBVN473.js";import"./XLTP4ML3.js";export{a as conf,b as language};
@@ -1,3 +0,0 @@
1
- /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
- See https://js.arcgis.com/4.33/esri/copyright.txt for details.
3
- v4.33.0-next.98 */
@@ -1,3 +0,0 @@
1
- /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
- See https://js.arcgis.com/4.33/esri/copyright.txt for details.
3
- v4.33.0-next.98 */