@arcgis/coding-components 4.34.0-next.110 → 4.34.0-next.112

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 (90) hide show
  1. package/dist/addons.js +1 -1
  2. package/dist/cdn/{GNTTI5IF.js → 2DPY5VHZ.js} +2 -2
  3. package/dist/cdn/{KPXT5QRA.js → 2ID66WOF.js} +2 -2
  4. package/dist/cdn/{QL2AIKLZ.js → 2MKDUPHG.js} +2 -2
  5. package/dist/cdn/{2PPEEKXH.js → 2NB4JAWS.js} +2 -2
  6. package/dist/cdn/33MTSZV6.js +4 -0
  7. package/dist/cdn/{C73QFQTS.js → 3WREMJF2.js} +2 -2
  8. package/dist/cdn/4ILR5RHT.js +4 -0
  9. package/dist/cdn/{QYIUA7A4.js → 4Y5KVYRQ.js} +2 -2
  10. package/dist/cdn/{2FUY5QYE.js → 5FLDXIP5.js} +2 -2
  11. package/dist/cdn/{U7OT64HH.js → 5UVPHIHF.js} +1 -1
  12. package/dist/cdn/{ACJLUZBT.js → 6JB5VL45.js} +2 -2
  13. package/dist/cdn/{PT5SJDYV.js → 7D2SHOMW.js} +2 -2
  14. package/dist/cdn/{VHODH5VX.js → 7QXI27VX.js} +1 -1
  15. package/dist/cdn/{5DTQCCWG.js → 7ZWMGCWA.js} +2 -2
  16. package/dist/cdn/{I4CFTX6V.js → A6DPPPPA.js} +1 -1
  17. package/dist/cdn/{SUZ3RSNJ.js → AQZYGFK7.js} +2 -2
  18. package/dist/cdn/{CQNFC3H5.js → B3XQTLRX.js} +2 -2
  19. package/dist/cdn/{22GCWZ6Y.js → CBAEJINQ.js} +2 -2
  20. package/dist/cdn/{QUBGXAWD.js → E5M2SRNK.js} +1 -1
  21. package/dist/cdn/{TH3VWWRD.js → EAHHCPQB.js} +1 -1
  22. package/dist/cdn/{7PNHA2YU.js → EPEVZJBD.js} +2 -2
  23. package/dist/cdn/{Y5TKJDDX.js → EVEOLU7G.js} +2 -2
  24. package/dist/cdn/{5J4F35FQ.js → FGC4UTQI.js} +2 -2
  25. package/dist/cdn/GTREYYVO.js +4 -0
  26. package/dist/cdn/{2JJVQXYV.js → H277CN4W.js} +2 -2
  27. package/dist/cdn/{Q6QMFUJ5.js → HVMUVUWZ.js} +2 -2
  28. package/dist/cdn/{KDEBTOEF.js → IPDORRAY.js} +2 -2
  29. package/dist/cdn/{E2B52CGC.js → JDN2D5XL.js} +2 -2
  30. package/dist/cdn/{6MJIFPFP.js → JRPTSR5M.js} +2 -2
  31. package/dist/cdn/{2UQDLIQM.js → NFZWQFPJ.js} +2 -2
  32. package/dist/cdn/{VJWZENKZ.js → NLTUTEF6.js} +2 -2
  33. package/dist/cdn/P4ZSDAOT.js +4 -0
  34. package/dist/cdn/{X65JDDI7.js → Q274TBRL.js} +2 -2
  35. package/dist/cdn/{DASHMZUR.js → Q5QESZ7J.js} +3 -3
  36. package/dist/cdn/{ARAEAFF7.js → SDATYCLG.js} +4 -4
  37. package/dist/cdn/{IWWU3QWW.js → UD5THEID.js} +2 -2
  38. package/dist/cdn/{FVFARCGA.js → VCKIIEZ7.js} +1 -1
  39. package/dist/cdn/{WCQG4L4Q.js → WMW6SEZA.js} +1 -1
  40. package/dist/cdn/{IS7RLDYO.js → X7A47MMY.js} +2 -2
  41. package/dist/cdn/{OOUKOHPI.js → XIQB6F7S.js} +2 -2
  42. package/dist/cdn/XTB5XE4Q.js +4 -0
  43. package/dist/cdn/Y2HCAJNR.js +4 -0
  44. package/dist/cdn/{WJCZ573J.js → YA52YDIB.js} +3 -3
  45. package/dist/cdn/{NIMMHDVC.js → ZWVQHC74.js} +2 -2
  46. package/dist/cdn/assets/code-editor/sql-expr.worker.js +18328 -18315
  47. package/dist/cdn/index.js +2 -2
  48. package/dist/chunks/arcade-defaults.js +1 -1
  49. package/dist/chunks/arcade-executor.js +1 -1
  50. package/dist/chunks/arcade-mode.js +1 -1
  51. package/dist/chunks/arcade-service-accessors.js +1 -1
  52. package/dist/chunks/editor.js +1 -1
  53. package/dist/chunks/fields.js +1 -1
  54. package/dist/chunks/language-defaults-base.js +4 -4
  55. package/dist/chunks/markdown.js +1 -1
  56. package/dist/chunks/monaco-importer.js +1 -1
  57. package/dist/chunks/runtime.js +1 -1
  58. package/dist/chunks/setup-monaco.js +1 -1
  59. package/dist/chunks/sql-expr-contribution.js +7 -9
  60. package/dist/chunks/sql-expr-defaults.js +1 -1
  61. package/dist/chunks/sql-expr-mode.js +41 -40
  62. package/dist/chunks/sql-expr-service-accessors.js +9 -0
  63. package/dist/chunks/useT9n.js +1 -1
  64. package/dist/components/arcgis-arcade-coding-assistant/customElement.js +1 -1
  65. package/dist/components/arcgis-arcade-editor/customElement.js +2 -2
  66. package/dist/components/arcgis-arcade-results/customElement.js +1 -1
  67. package/dist/components/arcgis-arcade-suggestions/customElement.js +1 -1
  68. package/dist/components/arcgis-code-editor/customElement.js +1 -1
  69. package/dist/components/arcgis-editor-variables/customElement.js +1 -1
  70. package/dist/components/arcgis-language-api-panel/customElement.js +1 -1
  71. package/dist/components/arcgis-sql-expression-editor/customElement.d.ts +3 -0
  72. package/dist/components/arcgis-sql-expression-editor/customElement.js +42 -33
  73. package/dist/components/arcgis-sql-expression-fields/customElement.js +1 -1
  74. package/dist/docs/api.json +26 -2
  75. package/dist/docs/docs.json +27 -2
  76. package/dist/docs/vscode.html-custom-data.json +1 -1
  77. package/dist/docs/web-types.json +12 -2
  78. package/dist/index.d.ts +1 -0
  79. package/dist/index.js +1 -1
  80. package/dist/loader.js +1 -1
  81. package/dist/types/lumina.d.ts +1 -0
  82. package/dist/types/preact.d.ts +1 -0
  83. package/dist/types/react.d.ts +1 -0
  84. package/dist/types/stencil.d.ts +1 -0
  85. package/dist/utils/sql-expr-monaco/sql-expr-mode.d.ts +1 -1
  86. package/package.json +5 -5
  87. package/dist/cdn/3PP6KYWG.js +0 -4
  88. package/dist/cdn/QE3QG6UH.js +0 -4
  89. package/dist/cdn/VUND5DZI.js +0 -4
  90. package/dist/cdn/WGDHKLHA.js +0 -4
@@ -1,18 +1,19 @@
1
- import { c as o } from "../../chunks/runtime.js";
2
- import { css as r, html as i } from "lit";
3
- import { LitElement as n, createEvent as c, noShadowRoot as l, safeClassMap as s } from "@arcgis/lumina";
1
+ import { c as r } from "../../chunks/runtime.js";
2
+ import { css as n, html as t } from "lit";
3
+ import { LitElement as c, createEvent as a, noShadowRoot as l, safeClassMap as o } from "@arcgis/lumina";
4
4
  import { generateGuid as d } from "@arcgis/toolkit/string";
5
- import { a } from "../../chunks/sql-expr-defaults.js";
5
+ import { a as s } from "../../chunks/sql-expr-defaults.js";
6
6
  import { u as p } from "../../chunks/useT9n.js";
7
- import { createRef as h, ref as g } from "lit-html/directives/ref.js";
7
+ import { createRef as h, ref as g } from "lit/directives/ref.js";
8
8
  import { s as f } from "../../chunks/editor.js";
9
+ import { getSqlExprDiagnosticService as _ } from "../../chunks/sql-expr-mode.js";
9
10
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
10
11
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
11
- v4.34.0-next.110 */
12
- const _ = r`@layer{arcgis-sql-expression-editor{display:flex;flex-direction:column;position:relative;overflow:hidden;border:var(--arcgis-coding-components-border)!important;box-sizing:border-box;background-color:var(--arcgis-coding-components-background-color);height:100%}}`;
13
- class u extends n {
12
+ v4.34.0-next.112 */
13
+ const u = n`@layer{arcgis-sql-expression-editor{display:flex;flex-direction:column;position:relative;overflow:hidden;border:var(--arcgis-coding-components-border)!important;box-sizing:border-box;background-color:var(--arcgis-coding-components-background-color);height:100%}}`;
14
+ class m extends c {
14
15
  constructor() {
15
- super(...arguments), this._codeEditorElt = h(), this.messages = p(), this._modelId = d(), this._preparing = !1, this.sideActionBarExpanded = !1, this.script = "", this.hideSideBar = !1, this.arcgisScriptChange = c({ bubbles: !1 });
16
+ super(...arguments), this._codeEditorElt = h(), this._disposables = [], this.messages = p(), this._modelId = d(), this._preparing = !1, this.sideActionBarExpanded = !1, this.script = "", this.hideSideBar = !1, this.arcgisDiagnosticsChange = a({ bubbles: !1 }), this.arcgisScriptChange = a({ bubbles: !1 });
16
17
  }
17
18
  static {
18
19
  this.properties = { _activeAction: 16, _apiLibrary: 16, _editorProfile: 16, _preparing: 16, sideActionBarExpanded: 16, profile: 0, script: 1, hideSideBar: 5 };
@@ -21,13 +22,21 @@ class u extends n {
21
22
  this.shadowRootOptions = l;
22
23
  }
23
24
  static {
24
- this.styles = [_, f];
25
+ this.styles = [u, f];
25
26
  }
26
27
  async load() {
27
28
  await this._updateEditorProfile().catch(console.error);
28
29
  }
29
- willUpdate(e) {
30
- (e.has("messages") || e.has("profile")) && this._updateDataModelDeps();
30
+ willUpdate(i) {
31
+ (i.has("messages") || i.has("profile")) && this._updateDataModelDeps();
32
+ }
33
+ async loaded() {
34
+ const i = await _();
35
+ this._disposables.push(i.onDiagnosticsChange((e) => !this._preparing && this.arcgisDiagnosticsChange.emit(e.diagnostics)));
36
+ }
37
+ disconnectedCallback() {
38
+ for (super.disconnectedCallback(); this._disposables.length; )
39
+ this._disposables.pop()?.dispose();
31
40
  }
32
41
  async _updateDataModelDeps() {
33
42
  await this._updateEditorProfile(), await this._updateApiLibrary();
@@ -35,50 +44,50 @@ class u extends n {
35
44
  async _updateEditorProfile() {
36
45
  this._preparing = !0;
37
46
  try {
38
- await a.setProfileForModel(this._modelId, this.profile, { locale: this.messages._t9nLocale }), this._editorProfile = a.getEditorProfileForModel(this._modelId);
47
+ await s.setProfileForModel(this._modelId, this.profile, { locale: this.messages._t9nLocale }), this._editorProfile = s.getEditorProfileForModel(this._modelId);
39
48
  } catch {
40
49
  this._editorProfile = void 0;
41
50
  } finally {
42
51
  this._preparing = !1;
43
52
  }
44
53
  }
45
- _setActiveAction(e) {
46
- if (this._activeAction === e) {
54
+ _setActiveAction(i) {
55
+ if (this._activeAction === i) {
47
56
  this._activeAction = void 0;
48
57
  return;
49
58
  }
50
- this._activeAction = e;
59
+ this._activeAction = i;
51
60
  }
52
- _handleActionClick(e) {
53
- const t = e.target;
54
- this._setActiveAction(t.dataset.panelName);
61
+ _handleActionClick(i) {
62
+ const e = i.target;
63
+ this._setActiveAction(e.dataset.panelName);
55
64
  }
56
- _insertAsSnippet(e) {
57
- this._codeEditorElt.value?.insertSnippet(e.detail).catch(console.error);
65
+ _insertAsSnippet(i) {
66
+ this._codeEditorElt.value?.insertSnippet(i.detail).catch(console.error);
58
67
  }
59
- _insertAsText(e) {
60
- this._codeEditorElt.value?.insertText(e.detail.replaceAll('"', "'")).catch(console.error);
68
+ _insertAsText(i) {
69
+ this._codeEditorElt.value?.insertText(i.detail.replaceAll('"', "'")).catch(console.error);
61
70
  }
62
71
  async _updateApiLibrary() {
63
- this._apiLibrary = await a.getApiLibraryForModel(this._modelId);
72
+ this._apiLibrary = await s.getApiLibraryForModel(this._modelId);
64
73
  }
65
- _onCodeEditorValueChange(e) {
66
- e.stopPropagation(), this.script = e.detail, this.arcgisScriptChange.emit(e.detail);
74
+ _onCodeEditorValueChange(i) {
75
+ i.stopPropagation(), this.script = i.detail, this.arcgisScriptChange.emit(i.detail);
67
76
  }
68
77
  _getFeatureSetVariable() {
69
- let e;
70
- const t = a.getEditorProfileForModel(this._modelId);
71
- return t?.variables?.length && t?.variables?.[0]?.type !== "featureSet" ? console.error("encountered unexpected editor profile") : e = t?.variables?.[0], e;
78
+ let i;
79
+ const e = s.getEditorProfileForModel(this._modelId);
80
+ return e?.variables?.length && e?.variables?.[0]?.type !== "featureSet" ? console.error("encountered unexpected editor profile") : i = e?.variables?.[0], i;
72
81
  }
73
82
  _toggleSideActionBarExpanded() {
74
83
  this.sideActionBarExpanded = !this.sideActionBarExpanded;
75
84
  }
76
85
  render() {
77
- const e = this._getFeatureSetVariable();
78
- 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} ${g(this._codeEditorElt)}></arcgis-code-editor></div>${!this.hideSideBar && i`<arcgis-editor-variables .variable=${e} .closed=${this._activeAction !== "fields"} class=${s(this._activeAction === "fields" && "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.hideSideBar && i`<arcgis-language-api-panel class=${s(this._activeAction === "functions" && "side-panel flex-panel border-inline-start")} .closed=${this._activeAction !== "functions"} @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>`;
86
+ const i = this._getFeatureSetVariable();
87
+ return t`<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.hideSideBar && t`<arcgis-editor-variables .variable=${i} .closed=${this._activeAction !== "fields"} class=${o(this._activeAction === "fields" && "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.hideSideBar && t`<arcgis-language-api-panel class=${o(this._activeAction === "functions" && "side-panel flex-panel border-inline-start")} .closed=${this._activeAction !== "functions"} @arcgisItemSelected=${this._insertAsSnippet} @arcgisClose=${() => this._setActiveAction(void 0)} .loading=${this._preparing} .apiLibrary=${this._apiLibrary} data-panel-name=none hide-documentation-actions .languageId=${s.languageId}></arcgis-language-api-panel>` || ""}${!this.hideSideBar && t`<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 && t`<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 && t`<calcite-tooltip reference-element=functions-action><span>${this.messages.functions ?? "Functions"}</span></calcite-tooltip>` || ""}</calcite-action-bar>` || ""}</div>`;
79
88
  }
80
89
  }
81
- o("arcgis-sql-expression-editor", u);
90
+ r("arcgis-sql-expression-editor", m);
82
91
  export {
83
- u as ArcgisSqlExpressionEditor
92
+ m as ArcgisSqlExpressionEditor
84
93
  };
@@ -6,7 +6,7 @@ import { a as m } from "../../chunks/sql-expr-defaults.js";
6
6
  import { u as d } from "../../chunks/useT9n.js";
7
7
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
8
8
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
9
- v4.34.0-next.110 */
9
+ v4.34.0-next.112 */
10
10
  const h = r`:host{calcite-flow{height:100%}calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}}`;
11
11
  class f extends n {
12
12
  constructor() {
@@ -1,8 +1,8 @@
1
1
  {
2
- "timestamp": "2025-08-25T04:36:15",
2
+ "timestamp": "2025-08-26T06:40:31",
3
3
  "compiler": {
4
4
  "name": "@arcgis/lumina-compiler",
5
- "version": "4.34.0-next.110",
5
+ "version": "4.34.0-next.112",
6
6
  "typescriptVersion": "5.8.3"
7
7
  },
8
8
  "schemaVersion": "1.0.0",
@@ -1139,6 +1139,30 @@
1139
1139
  }
1140
1140
  ],
1141
1141
  "events": [
1142
+ {
1143
+ "name": "arcgisDiagnosticsChange",
1144
+ "description": "Emitted when the diagnostics collection has changed.",
1145
+ "type": {
1146
+ "text": "Array<IMarkerData>",
1147
+ "references": [
1148
+ {
1149
+ "name": "Array",
1150
+ "package": "typescript",
1151
+ "module": "lib/lib.es5.d.ts",
1152
+ "start": 0,
1153
+ "end": 5
1154
+ },
1155
+ {
1156
+ "name": "IMarkerData",
1157
+ "package": "monaco-editor",
1158
+ "module": "esm/vs/editor/editor.api.d.ts",
1159
+ "start": 6,
1160
+ "end": 17
1161
+ }
1162
+ ]
1163
+ },
1164
+ "bubbles": false
1165
+ },
1142
1166
  {
1143
1167
  "name": "arcgisScriptChange",
1144
1168
  "description": "Emitted when the script string has changed.",
@@ -1,8 +1,8 @@
1
1
  {
2
- "timestamp": "2025-08-25T04:36:15",
2
+ "timestamp": "2025-08-26T06:40:31",
3
3
  "compiler": {
4
4
  "name": "@arcgis/lumina-compiler",
5
- "version": "4.34.0-next.110",
5
+ "version": "4.34.0-next.112",
6
6
  "typescriptVersion": "5.8.3"
7
7
  },
8
8
  "components": [
@@ -1081,6 +1081,31 @@
1081
1081
  }
1082
1082
  ],
1083
1083
  "events": [
1084
+ {
1085
+ "event": "arcgisDiagnosticsChange",
1086
+ "detail": "Array<IMarkerData>",
1087
+ "bubbles": false,
1088
+ "complexType": {
1089
+ "original": "Array<IMarkerData>",
1090
+ "resolved": "Array<IMarkerData>",
1091
+ "references": {
1092
+ "Array": {
1093
+ "location": "import",
1094
+ "path": "typescript/lib/lib.es5.d.ts",
1095
+ "id": "notImplemented"
1096
+ },
1097
+ "IMarkerData": {
1098
+ "location": "import",
1099
+ "path": "monaco-editor/esm/vs/editor/editor.api.d.ts",
1100
+ "id": "notImplemented"
1101
+ }
1102
+ }
1103
+ },
1104
+ "cancelable": true,
1105
+ "composed": true,
1106
+ "docs": "Emitted when the diagnostics collection has changed.",
1107
+ "docsTags": []
1108
+ },
1084
1109
  {
1085
1110
  "event": "arcgisScriptChange",
1086
1111
  "detail": "string",
@@ -62,7 +62,7 @@
62
62
  },
63
63
  {
64
64
  "name": "arcgis-sql-expression-editor",
65
- "description": "The SQL Expression Editor provides a familiar code editor experience for writing your own SQL expressions.\nIt supports syntax highlighting, code completion, and validation, allowing users to write SQL expressions using the\n[standardized SQL functions](https://doc.arcgis.com/en/arcgis-online/reference/sql-agol.htm) supported by ArcGIS.\n--\n\n### Events\n- **arcgisScriptChange** - Emitted when the script string has changed.\n\n### Methods\n- `componentOnReady(): Promise<void>` - Create a promise that resolves once component is fully loaded.",
65
+ "description": "The SQL Expression Editor provides a familiar code editor experience for writing your own SQL expressions.\nIt supports syntax highlighting, code completion, and validation, allowing users to write SQL expressions using the\n[standardized SQL functions](https://doc.arcgis.com/en/arcgis-online/reference/sql-agol.htm) supported by ArcGIS.\n--\n\n### Events\n- **arcgisDiagnosticsChange** - Emitted when the diagnostics collection has changed.\n- **arcgisScriptChange** - Emitted when the script string has changed.\n\n### Methods\n- `componentOnReady(): Promise<void>` - Create a promise that resolves once component is fully loaded.",
66
66
  "attributes": [
67
67
  {
68
68
  "name": "hide-side-bar",
@@ -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.34.0-next.110",
4
+ "version": "4.34.0-next.112",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -210,7 +210,7 @@
210
210
  },
211
211
  {
212
212
  "name": "arcgis-sql-expression-editor",
213
- "description": "The SQL Expression Editor provides a familiar code editor experience for writing your own SQL expressions.\nIt supports syntax highlighting, code completion, and validation, allowing users to write SQL expressions using the\n[standardized SQL functions](https://doc.arcgis.com/en/arcgis-online/reference/sql-agol.htm) supported by ArcGIS.\n--\n\n### Events\n- **arcgisScriptChange** - Emitted when the script string has changed.\n\n### Methods\n- `componentOnReady(): Promise<void>` - Create a promise that resolves once component is fully loaded.",
213
+ "description": "The SQL Expression Editor provides a familiar code editor experience for writing your own SQL expressions.\nIt supports syntax highlighting, code completion, and validation, allowing users to write SQL expressions using the\n[standardized SQL functions](https://doc.arcgis.com/en/arcgis-online/reference/sql-agol.htm) supported by ArcGIS.\n--\n\n### Events\n- **arcgisDiagnosticsChange** - Emitted when the diagnostics collection has changed.\n- **arcgisScriptChange** - Emitted when the script string has changed.\n\n### Methods\n- `componentOnReady(): Promise<void>` - Create a promise that resolves once component is fully loaded.",
214
214
  "doc-url": "https://developers.arcgis.com/javascript/latest/references/coding-components/arcgis-sql-expression-editor/",
215
215
  "attributes": [
216
216
  {
@@ -231,6 +231,11 @@
231
231
  }
232
232
  ],
233
233
  "events": [
234
+ {
235
+ "name": "arcgisDiagnosticsChange",
236
+ "type": "Array<IMarkerData>",
237
+ "description": "Emitted when the diagnostics collection has changed."
238
+ },
234
239
  {
235
240
  "name": "arcgisScriptChange",
236
241
  "type": "string",
@@ -256,6 +261,11 @@
256
261
  }
257
262
  ],
258
263
  "events": [
264
+ {
265
+ "name": "arcgisDiagnosticsChange",
266
+ "type": "Array<IMarkerData>",
267
+ "description": "Emitted when the diagnostics collection has changed."
268
+ },
259
269
  {
260
270
  "name": "arcgisScriptChange",
261
271
  "type": "string",
package/dist/index.d.ts CHANGED
@@ -70,6 +70,7 @@ declare global {
70
70
  removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
71
71
  }
72
72
  interface HTMLArcgisSqlExpressionEditorElementEventMap {
73
+ "arcgisDiagnosticsChange": ArcgisSqlExpressionEditor["arcgisDiagnosticsChange"]["detail"];
73
74
  "arcgisScriptChange": ArcgisSqlExpressionEditor["arcgisScriptChange"]["detail"];
74
75
  }
75
76
 
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.34/esri/copyright.txt for details.
6
- v4.34.0-next.110 */
6
+ v4.34.0-next.112 */
7
7
  const a = s, r = t;
8
8
  export {
9
9
  c as arcade,
package/dist/loader.js CHANGED
@@ -2,7 +2,7 @@ import { r as e } from "./chunks/runtime.js";
2
2
  import { makeDefineCustomElements as s } from "@arcgis/lumina";
3
3
  /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
4
4
  See https://js.arcgis.com/4.34/esri/copyright.txt for details.
5
- v4.34.0-next.110 */
5
+ v4.34.0-next.112 */
6
6
  const a = s(e, {
7
7
  "arcgis-arcade-coding-assistant": [() => import("./components/arcgis-arcade-coding-assistant/customElement.js"), "appVersion,assistantsEnabled,closed,closePanel:,editorRef:,feedbackServiceUrl,helpBase,insertText:,layer,portalUrl,serviceUrl;destroy"],
8
8
  "arcgis-arcade-editor": [() => import("./components/arcgis-arcade-editor/customElement.js"), "arcadeAssistant:,customPanels:,editorInstance:,editorOptions:,hideDocumentationActions,hideSideBar,openedSidePanel:,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getEditorInstance,getScript,getTestResult,setFocus"],
@@ -15,6 +15,7 @@ interface LuminaArcgisCodeEditor extends Partial<Pick<ArcgisCodeEditor, 'editorO
15
15
  }
16
16
 
17
17
  interface LuminaArcgisSqlExpressionEditor extends Partial<Pick<ArcgisSqlExpressionEditor, 'hideSideBar' | 'profile' | 'script'>>, h.JSX.HTMLAttributes<HTMLArcgisSqlExpressionEditorElement> {
18
+ onarcgisDiagnosticsChange?: EventHandler<HTMLArcgisSqlExpressionEditorElement["arcgisDiagnosticsChange"]>;
18
19
  onarcgisScriptChange?: EventHandler<HTMLArcgisSqlExpressionEditorElement["arcgisScriptChange"]>;
19
20
  }
20
21
 
@@ -16,6 +16,7 @@ interface PreactArcgisCodeEditor extends Partial<Pick<ArcgisCodeEditor, 'editorO
16
16
  }
17
17
 
18
18
  interface PreactArcgisSqlExpressionEditor extends Partial<Pick<ArcgisSqlExpressionEditor, 'hideSideBar' | 'profile' | 'script'>>, PreactJsx.HTMLAttributes<HTMLArcgisSqlExpressionEditorElement> {
19
+ onarcgisDiagnosticsChange?: EventHandler<HTMLArcgisSqlExpressionEditorElement["arcgisDiagnosticsChange"]>;
19
20
  onarcgisScriptChange?: EventHandler<HTMLArcgisSqlExpressionEditorElement["arcgisScriptChange"]>;
20
21
  }
21
22
 
@@ -16,6 +16,7 @@ interface ReactArcgisCodeEditor extends Partial<Pick<ArcgisCodeEditor, 'editorOp
16
16
  }
17
17
 
18
18
  interface ReactArcgisSqlExpressionEditor extends Partial<Pick<ArcgisSqlExpressionEditor, 'hideSideBar' | 'profile' | 'script'>>, HTMLProps<HTMLArcgisSqlExpressionEditorElement> {
19
+ onarcgisDiagnosticsChange?: EventHandler<HTMLArcgisSqlExpressionEditorElement["arcgisDiagnosticsChange"]>;
19
20
  onarcgisScriptChange?: EventHandler<HTMLArcgisSqlExpressionEditorElement["arcgisScriptChange"]>;
20
21
  }
21
22
 
@@ -16,6 +16,7 @@ interface StencilArcgisCodeEditor extends Partial<Pick<ArcgisCodeEditor, 'editor
16
16
  }
17
17
 
18
18
  interface StencilArcgisSqlExpressionEditor extends Partial<Pick<ArcgisSqlExpressionEditor, 'hideSideBar' | 'profile' | 'script'>>, StencilJsx.HTMLAttributes<HTMLArcgisSqlExpressionEditorElement> {
19
+ onArcgisDiagnosticsChange?: EventHandler<HTMLArcgisSqlExpressionEditorElement["arcgisDiagnosticsChange"]>;
19
20
  onArcgisScriptChange?: EventHandler<HTMLArcgisSqlExpressionEditorElement["arcgisScriptChange"]>;
20
21
  }
21
22
 
@@ -39,5 +39,5 @@ export type { SqlExprDiagnosticService };
39
39
  *
40
40
  * @returns The Sql Expression Diagnostic Service.
41
41
  */
42
- export declare function getSqlExprDiagnosticService(): ISqlExprDiagnosticService;
42
+ export declare function getSqlExprDiagnosticService(): Promise<ISqlExprDiagnosticService>;
43
43
  export declare function setupMode(defaults: SqlExprDefaults): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/coding-components",
3
- "version": "4.34.0-next.110",
3
+ "version": "4.34.0-next.112",
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",
@@ -42,10 +42,10 @@
42
42
  ],
43
43
  "license": "SEE LICENSE IN LICENSE.md",
44
44
  "dependencies": {
45
- "@arcgis/arcade-languageservice": "4.34.0-next.110",
46
- "@arcgis/languages-api-utils": "4.34.0-next.110",
47
- "@arcgis/lumina": "4.34.0-next.110",
48
- "@arcgis/toolkit": "4.34.0-next.110",
45
+ "@arcgis/arcade-languageservice": "4.34.0-next.112",
46
+ "@arcgis/languages-api-utils": "4.34.0-next.112",
47
+ "@arcgis/lumina": "4.34.0-next.112",
48
+ "@arcgis/toolkit": "4.34.0-next.112",
49
49
  "lit": "^3.3.0",
50
50
  "monaco-editor": "^0.52.0",
51
51
  "tslib": "^2.8.1",
@@ -1,4 +0,0 @@
1
- /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
- See https://js.arcgis.com/4.34/esri/copyright.txt for details.
3
- v4.34.0-next.110 */
4
- import b from"./5DTQCCWG.js";import a from"./DASHMZUR.js";import{a as w}from"./WCQG4L4Q.js";import"./FVFARCGA.js";import{k as u}from"./ARAEAFF7.js";import"./X65JDDI7.js";import"./U7OT64HH.js";import"./WJCZ573J.js";import{a as E}from"./I4CFTX6V.js";import{Gl as k,Sl as g,kk as R}from"./IS7RLDYO.js";import"./TH3VWWRD.js";export default $arcgis.t(([,d])=>{R();var m=new E,h=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this.stopWorker())}dispose(){this._configChangeListener.dispose(),this.stopWorker()}stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null,m=new E),this._client=null}static async waitForWorker(){return await m.promise}async _getClientProxy(){let e=await u();if(!this._client){let{languageId:t}=this._defaults;this._worker=e.createWebWorker({moduleId:"SqlExprWorker",label:t,createData:{languageId:t},host:this._defaults.workerHost}),m.resolve(this._worker),this._client=this._worker.getProxy()}return await this._client}async getLanguageServiceWorker(...e){let t=await this._getClientProxy();return await this._worker?.withSyncedResources(e),t}},L=["AND","AS","BOTH","CASE","CAST","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","DATE","DAY","DOY","DOW","ELSE","END","ESCAPE","FALSE","FLOAT","FOR","FROM","HOUR","IN","INT","INTEGER","INTERVAL","LEADING","LIKE","MINUTE","MONTH","POSITION","REAL","SECOND","SMALLINT","THEN","TIME","TIMESTAMP","TIMEZONE_HOUR","TIMEZONE_MINUTE","TO","TRAILING","TRIM","TRUE","VARCHAR","WEEK","WHEN","WITH","YEAR","ZONE"],b=["AND","BETWEEN","LIKE","NOT","OR","IS","NULL"],M=["CAST","EXTRACT","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_USER","ABS","ACOS","ASIN","ATAN","CEILING","COS","FLOOR","LOG","LOG10","MOD","NULLIF","POWER","ROUND","SIGN","SIN","TAN","TRUNCATE","CHAR_LENGTH","COALESCE","CONCAT","LOWER","POSITION","SUBSTRING","TRIM","UPPER"],O={comments:{lineComment:"--",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},D={defaultToken:"",tokenPostfix:".arcgis",ignoreCase:!0,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:L,operators:b,builtinFunctions:M,builtinVariables:[],tokenizer:{root:[{include:"@comments"},{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},{include:"@complexIdentifiers"},{include:"@scopes"},[/[;,.]/,"delimiter"],[/[()]/,"@brackets"],[/[\w@#$]+/,{cases:{"@operators":"operator","@builtinVariables":"predefined","@builtinFunctions":"predefined","@keywords":"keyword","@default":"identifier"}}],[/[<>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],comments:[[/--+.*/,"comment"],[/\/\*/,{token:"comment.quote",next:"@comment"}]],comment:[[/[^*/]+/,"comment"],[/\*\//,{token:"comment.quote",next:"@pop"}],[/./,"comment"]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/N'/,{token:"string",next:"@string"}],[/'/,{token:"string",next:"@string"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],complexIdentifiers:[[/"/,{token:"identifier.quote",next:"@quotedIdentifier"}]],quotedIdentifier:[[/[^"]+/,"identifier"],[/""/,"identifier"],[/"/,{token:"identifier.quote",next:"@pop"}]],scopes:[[/(BEGIN|CASE)\b/i,{token:"keyword.block"}],[/END\b/i,{token:"keyword.block"}],[/WHEN\b/i,{token:"keyword.choice"}],[/THEN\b/i,{token:"keyword.choice"}]]}},_=class{constructor(e,t){this._worker=e,this._defaults=t}async provideCompletionItems(e,t){try{let o=await this._worker(e.uri),r=e.getWordUntilPosition(t),n={startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:r.startColumn,endColumn:r.endColumn},c=this._defaults.getApiContextForModel(e.uri);return await o.doComplete(e.uri.toString(),n,t,c)}catch(o){return console.error(o),{suggestions:[]}}}},C=class{constructor(e,t,{defaults:o,diagnosticService:r}){this._languageId=e,this._worker=t,this._disposables=[],this._modelListeners=new Map,this._diagnosticsService=r,this._defaults=o,u().then(n=>{let c=i=>{let s=i.getLanguageId();if(s!==this._languageId)return;let l=w(()=>{this._doValidate(i,s).catch(A=>{throw A})}),f=i.onDidChangeContent(l),S=i.onDidChangeAttached(l);this._modelListeners.set(i.uri.toString(),[f,S]),this._doValidate(i,s).catch(console.error)},p=i=>{let s=i.uri.toString();n.setModelMarkers(i,this._languageId,[]);let l=this._modelListeners.get(s);if(l){for(;l.length;)l.pop()?.dispose();this._modelListeners.delete(s)}};this._disposables.push(n.onDidCreateModel(c)),this._disposables.push(n.onWillDisposeModel(i=>p(i))),this._disposables.push(n.onDidChangeModelLanguage(i=>{p(i.model),c(i.model)})),this._disposables.push(o.onDidChange(()=>{n.getModels().forEach(i=>{i.getLanguageId()===this._languageId&&(p(i),c(i))})})),this._disposables.push(o.onModelContextDidChange(i=>{n.getModels().forEach(s=>{s.getLanguageId()===this._languageId&&s.uri.toString()===i&&this._doValidate(s,this._languageId).catch(console.error)})})),this._disposables.push({dispose:()=>{this._modelListeners.forEach(i=>i.forEach(s=>s.dispose())),this._modelListeners.clear()}}),n.getModels().forEach(c)})}async _doValidate(e,t){let o=await u();if(e.isAttachedToEditor())try{let r=await this._worker(e.uri),n=this._defaults.getApiContextForModel(e.uri),c=await r.doValidation(e.uri.toString(),n);this._diagnosticsService.fireDiagnosticsChange(e.uri,c),o.setModelMarkers(e,t,c)}catch(r){console.error(r)}}},I;async function q(...a){return await h.waitForWorker(),await new Promise((e,t)=>{if(!I){t(new Error("sql expression worker not registered!"));return}e(I(...a))})}var T=class{constructor(){this._onDiagnosticsChange=new k}get onDiagnosticsChange(){return this._onDiagnosticsChange.event}fireDiagnosticsChange(e,t){this._onDiagnosticsChange.fire({uri:e,diagnostics:t})}},N=new T;function G(){return N}function V(a){let e=new h(a),t=async(...r)=>await e.getLanguageServiceWorker(...r);I=t,g.setMonarchTokensProvider(d.languageId,D),g.setLanguageConfiguration(d.languageId,O);let o=new _(t,d);g.registerCompletionItemProvider(d.languageId,o),new C(a.languageId,t,{defaults:a,diagnosticService:N})}return{getSqlExprDiagnosticService:G,getSqlExprWorker:q,setupMode:V}},a,b)
@@ -1,4 +0,0 @@
1
- /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
- See https://js.arcgis.com/4.34/esri/copyright.txt for details.
3
- v4.34.0-next.110 */
4
- import j from"./WGDHKLHA.js";import"./NIMMHDVC.js";import i from"./VJWZENKZ.js";import{a as v,c as r,d as I,e as n}from"./7PNHA2YU.js";import{a as _}from"./CQNFC3H5.js";import"./IWWU3QWW.js";import e from"./5DTQCCWG.js";import d from"./DASHMZUR.js";import"./FVFARCGA.js";import{g as b}from"./ARAEAFF7.js";import"./X65JDDI7.js";import{c as g,d as f}from"./U7OT64HH.js";import{D as p,g as h,h as s,l as c,y as a,z as u}from"./WJCZ573J.js";import{f as o}from"./I4CFTX6V.js";import"./IS7RLDYO.js";import"./TH3VWWRD.js";export default $arcgis.t(([,,,d])=>{var $=h`: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.languageId="arcade",this.hideDocumentationActions=!1,this.loading=!1,this.closed=!1,this.arcgisClose=c({bubbles:!1}),this.arcgisItemSelected=c({bubbles:!1})}static{this.properties={_colorizeStyle:16,_filterValue:16,_selectedApiItem:16,languageId:1,apiLibrary:0,hideDocumentationActions:5,loading:5,closed:5}}static{this.styles=$}async load(){await d(this.languageId),this._colorizeStyle=r(),this._themeChangedListener=I(()=>this._colorizeStyle=r())}willUpdate(e){if(e.has("languageId")&&d(this.languageId),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(()=>{f(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),v(e,this.languageId).catch(console.error))}renderApiCategory(e){let i=b(e.items,"name",this._filterValue);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}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)} ${a(g)}>${this.messages.insert}</calcite-button><calcite-block open .heading=${o(e.completion.detail)}><div .innerHTML=${n(e.completion.documentation)??""}></div>${e.examples?s`<div ${a(this._elementToMarkdown)}></div>`:null}</calcite-block></calcite-flow-item>`:null}render(){if(this.closed)return null;let e=(this.apiLibrary??[]).map(t=>this.renderApiCategory(t)),i=e.every(t=>!t);return s`<style>${this._colorizeStyle}</style><calcite-flow ${a(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>`}};p("arcgis-language-api-panel",m);return m},d,e,i,j)
@@ -1,4 +0,0 @@
1
- /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
- See https://js.arcgis.com/4.34/esri/copyright.txt for details.
3
- v4.34.0-next.110 */
4
- import{a as f}from"./22GCWZ6Y.js";import{a as _}from"./CQNFC3H5.js";import"./IWWU3QWW.js";import b from"./5DTQCCWG.js";import a from"./DASHMZUR.js";import"./FVFARCGA.js";import"./ARAEAFF7.js";import"./X65JDDI7.js";import"./U7OT64HH.js";import{A as s,D as g,g as r,h as e,l as n,n as d,x as l,y as p,z as h}from"./WJCZ573J.js";import{g as c}from"./I4CFTX6V.js";import"./IS7RLDYO.js";import"./TH3VWWRD.js";export default $arcgis.t(([,t])=>{var m=r`@layer{arcgis-sql-expression-editor{display:flex;flex-direction:column;position:relative;overflow:hidden;border:var(--arcgis-coding-components-border)!important;box-sizing:border-box;background-color:var(--arcgis-coding-components-background-color);height:100%}}`,o=class extends h{constructor(){super(...arguments),this._codeEditorElt=l(),this.messages=_(),this._modelId=c(),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=d}static{this.styles=[m,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 t.setProfileForModel(this._modelId,this.profile,{locale:this.messages._t9nLocale}),this._editorProfile=t.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 a=i.target;this._setActiveAction(a.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 t.getApiLibraryForModel(this._modelId)}_onCodeEditorValueChange(i){i.stopPropagation(),this.script=i.detail,this.arcgisScriptChange.emit(i.detail)}_getFeatureSetVariable(){let i,a=t.getEditorProfileForModel(this._modelId);return a?.variables?.length&&a?.variables?.[0]?.type!=="featureSet"?console.error("encountered unexpected editor profile"):i=a?.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} ${p(this._codeEditorElt)}></arcgis-code-editor></div>${!this.hideSideBar&&e`<arcgis-editor-variables .variable=${i} .closed=${this._activeAction!=="fields"} class=${s(this._activeAction==="fields"&&"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.hideSideBar&&e`<arcgis-language-api-panel class=${s(this._activeAction==="functions"&&"side-panel flex-panel border-inline-start")} .closed=${this._activeAction!=="functions"} @arcgisItemSelected=${this._insertAsSnippet} @arcgisClose=${()=>this._setActiveAction(void 0)} .loading=${this._preparing} .apiLibrary=${this._apiLibrary} data-panel-name=none hide-documentation-actions .languageId=${t.languageId}></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>`}};g("arcgis-sql-expression-editor",o);return o},a,b)
@@ -1,4 +0,0 @@
1
- /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
- See https://js.arcgis.com/4.34/esri/copyright.txt for details.
3
- v4.34.0-next.110 */
4
- import{b as g}from"./NIMMHDVC.js";import b from"./VJWZENKZ.js";import a from"./5DTQCCWG.js";import{k as i}from"./ARAEAFF7.js";import{Sl as n,kk as m}from"./IS7RLDYO.js";export default $arcgis.t(([t,o])=>{m();var s=new Set;function c(e,a){return()=>{s.has(e)||s.add(e),a()}}async function D(e){s.has(e)||(await i()).createModel("",e).dispose()}var p={"light-theme":{comment:"#606060",constant:"#9809C8",date:"#296389",identifier:"#0000B3",keyword:"#BF4900",number:"#136D3D",string:"#A31515",operator:"#9809C8",predefined:"#0000B3"},"dark-theme":{comment:"#BFBFBF",constant:"#CDBAEA",date:"#97A6CE",identifier:"#9FD4F3",keyword:"#EEAA5A",number:"#AAD04B",string:"#F2877B",operator:"#CDBAEA",predefined:"#9FD4F3"}};u();function u(){i().then(e=>{["light","dark"].forEach(a=>{let d=a==="light"?"vs":"vs-dark",r=p[`${a}-theme`];e.defineTheme(d,{base:d,inherit:!0,rules:[{token:"comment.arcgis",foreground:r.comment},{token:"constant.arcgis",foreground:r.constant},{token:"keyword.arcgis",foreground:r.keyword},{token:"identifier.arcgis",foreground:r.identifier},{token:"number.arcgis",foreground:r.number},{token:"string.arcgis",foreground:r.string},{token:"operator.arcgis",foreground:r.operator},{token:"predefined.arcgis",foreground:r.predefined}],colors:{}})})})}n.register({id:o.languageId,aliases:["Arcade","arcade"],extensions:[".arc"],mimetypes:["application/arcade"]});n.onLanguage(o.languageId,c(o.languageId,()=>{g().then(e=>{e.setupMode(o)}).catch(e=>{throw e})}));async function f(){return await import("./3PP6KYWG.js").then(m=>m.default)}n.register({id:t.languageId,aliases:["EsiSqlExpression","sql-expression"],extensions:[".sql-expression"],mimetypes:["application/sql-expression"]});n.onLanguage(t.languageId,c(t.languageId,()=>{f().then(e=>{e.setupMode(t)}).catch(e=>{throw e})}));return D},a,b)