@arcgis/coding-components 5.2.0-next.136 → 5.2.0-next.137

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 (45) hide show
  1. package/dist/cdn/7GVCXLAE.js +2 -0
  2. package/dist/cdn/{WHOYO2EQ.js → BPCBI4SE.js} +3 -3
  3. package/dist/cdn/EQDKZIAP.js +2 -0
  4. package/dist/cdn/GDTEFKCP.js +2 -0
  5. package/dist/cdn/GJ4W3JPG.js +2 -0
  6. package/dist/cdn/J7TSCCXO.js +6 -0
  7. package/dist/cdn/JFO2HVZ6.js +2 -0
  8. package/dist/cdn/JGRWZYW5.js +3 -0
  9. package/dist/cdn/N56B3UDM.js +2 -0
  10. package/dist/cdn/{FFLWFFHU.js → OMJLVFHT.js} +1 -1
  11. package/dist/cdn/{YJ4WRZOI.js → ZJCPZ5ZN.js} +1 -1
  12. package/dist/cdn/assets/arcade-debugger-output/t9n/messages.en.json +1 -1
  13. package/dist/cdn/assets/code-editor/sql-expr.worker.js +4585 -4421
  14. package/dist/cdn/index.js +1 -1
  15. package/dist/chunks/arcade-defaults.js +95 -102
  16. package/dist/chunks/setup-monaco-theme.js +34 -67
  17. package/dist/chunks/sql-expr-mode.js +73 -61
  18. package/dist/chunks/sql-expr-service-accessors.js +35 -2
  19. package/dist/components/arcgis-arcade-coding-assistant/customElement.js +22 -23
  20. package/dist/components/arcgis-arcade-debugger-output/customElement.js +8 -8
  21. package/dist/components/arcgis-arcade-editor/customElement.d.ts +12 -1
  22. package/dist/components/arcgis-arcade-editor/customElement.js +104 -104
  23. package/dist/components/arcgis-code-editor/customElement.js +12 -11
  24. package/dist/components/arcgis-code-viewer/customElement.js +2 -1
  25. package/dist/components/arcgis-sql-expression-editor/customElement.d.ts +2 -0
  26. package/dist/components/arcgis-sql-expression-editor/customElement.js +13 -7
  27. package/dist/components/types.d.ts +11 -0
  28. package/dist/docs/api.json +1 -1
  29. package/dist/docs/docs.json +1 -1
  30. package/dist/docs/vscode.html-custom-data.json +1 -1
  31. package/dist/docs/web-types.json +1 -1
  32. package/dist/loader.js +6 -6
  33. package/dist/types/lumina.d.ts +1 -1
  34. package/dist/types/preact.d.ts +1 -1
  35. package/dist/types/react.d.ts +1 -1
  36. package/dist/types/stencil.d.ts +1 -1
  37. package/package.json +7 -7
  38. package/dist/cdn/DBAL7LSK.js +0 -2
  39. package/dist/cdn/EDJMOEXG.js +0 -2
  40. package/dist/cdn/FQWGIGBG.js +0 -2
  41. package/dist/cdn/M4ASZPOM.js +0 -2
  42. package/dist/cdn/SQQXRZAR.js +0 -2
  43. package/dist/cdn/XMKMX4RT.js +0 -2
  44. package/dist/cdn/XUI74PBQ.js +0 -2
  45. package/dist/cdn/YCA4A2EF.js +0 -6
@@ -6,9 +6,10 @@ import { slotChangeHasContent as _ } from "@arcgis/toolkit/dom/slots";
6
6
  import { load as v } from "@arcgis/lumina/controllers";
7
7
  import { i as b } from "../../chunks/monaco-importer.js";
8
8
  import { css as y, html as a } from "lit";
9
- import { w as l, s as c } from "../../chunks/setup-monaco-theme.js";
9
+ import { w as l, s as c } from "../../chunks/sql-expr-service-accessors.js";
10
10
  import { c as S, g as d, o as N } from "../../chunks/colorize.js";
11
11
  import { s as E } from "../../chunks/arcade-service-accessors.js";
12
+ import "../../chunks/setup-monaco-theme.js";
12
13
  import { debounce as T } from "@arcgis/toolkit/function";
13
14
  import { Task as w } from "@lit/task";
14
15
  import { rethrowError as C, log as L } from "@arcgis/toolkit/log";
@@ -72,6 +72,8 @@ export abstract class ArcgisSqlExpressionEditor extends LitElement {
72
72
  * ```
73
73
  */
74
74
  accessor script: string;
75
+ /** Formats the current expression */
76
+ formatExpression(): Promise<void>;
75
77
  /** Set the focus on the element. */
76
78
  setFocus(): Promise<void>;
77
79
  /** Emitted when the diagnostics collection has changed. */
@@ -6,10 +6,11 @@ import { generateGuid as d } from "@arcgis/toolkit/string";
6
6
  import { a as s } from "../../chunks/sql-expr-defaults.js";
7
7
  import { u as h } from "../../chunks/useT9n.js";
8
8
  import { createRef as p, ref as g } from "lit/directives/ref.js";
9
- import { getSqlExprDiagnosticService as _ } from "../../chunks/sql-expr-mode.js";
9
+ import { getSqlExprDiagnosticService as f } from "../../chunks/sql-expr-mode.js";
10
10
  import { rethrowError as a } from "@arcgis/toolkit/log";
11
- const f = c`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}`;
12
- class m extends l {
11
+ import { w as _ } from "../../chunks/sql-expr-service-accessors.js";
12
+ const m = c`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}`;
13
+ class u extends l {
13
14
  constructor() {
14
15
  super(...arguments), this._codeEditorElt = p(), this._disposables = [], this.messages = h(), this._modelId = d(), this._preparing = !1, this.sideActionBarExpanded = !1, this.script = "", this.hideSideBar = !1, this.hideDescriptionsInFieldsPanel = !1, this.arcgisDiagnosticsChange = o({ bubbles: !1 }), this.arcgisScriptChange = o({ bubbles: !1 });
15
16
  }
@@ -17,11 +18,16 @@ class m extends l {
17
18
  this.properties = { _activeAction: 16, _apiLibrary: 16, _editorProfile: 16, _preparing: 16, sideActionBarExpanded: 16, profile: 0, script: 1, hideSideBar: 5, messageOverrides: 0, hideDescriptionsInFieldsPanel: 5 };
18
19
  }
19
20
  static {
20
- this.styles = [f];
21
+ this.styles = [m];
21
22
  }
22
23
  async setFocus() {
23
24
  await this._codeEditorElt.value?.setFocus();
24
25
  }
26
+ async formatExpression() {
27
+ await _(s.languageId);
28
+ const i = this._codeEditorElt.value?.editorInstance?.getAction("editor.action.formatDocument");
29
+ i && await i.run();
30
+ }
25
31
  async load() {
26
32
  await this._updateEditorProfile().catch(a(this));
27
33
  }
@@ -29,7 +35,7 @@ class m extends l {
29
35
  (i.has("messages") || i.has("profile")) && this._updateDataModelDeps();
30
36
  }
31
37
  async loaded() {
32
- const i = await _();
38
+ const i = await f();
33
39
  this._disposables.push(i.onDiagnosticsChange((e) => !this._preparing && this.arcgisDiagnosticsChange.emit(e.diagnostics)));
34
40
  }
35
41
  disconnectedCallback() {
@@ -85,7 +91,7 @@ class m extends l {
85
91
  return t`<arcgis-code-editor-shell><arcgis-code-editor slot=editor language=arcgis-sql-expression .modelId=${this._modelId} .value=${this.script ?? ""} @arcgisValueChange=${this._onCodeEditorValueChange} ${g(this._codeEditorElt)}></arcgis-code-editor>${!this.hideSideBar && i && t`<arcgis-editor-variables slot=side-panel .variable=${i} .hideDescriptions=${this.hideDescriptionsInFieldsPanel} .closed=${this._activeAction !== "fields"} class=${r(this._activeAction === "fields" ? "" : "hidden")} .loading=${this._preparing} .modelId=${this._modelId} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${() => this._setActiveAction(void 0)} data-panel-name=none .messageOverrides=${{ profileempty: this.messages.profileempty }}></arcgis-editor-variables>` || ""}${!this.hideSideBar && t`<arcgis-language-api-panel slot=side-panel class=${r(this._activeAction === "functions" ? "" : "hidden")} .closed=${this._activeAction !== "functions"} @arcgisInternalItemSelected=${this._insertAsSnippet} @arcgisInternalClosePanel=${() => 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 slot=side-action-bar .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}>${i && t`<calcite-action id=fields-action .text=${this.messages.fields ?? "Fields"} icon=profile-variables .active=${this._activeAction === "fields"} data-panel-name=fields @click=${(e) => this._handleActionClick(e)}></calcite-action>` || ""}${i && !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=${(e) => this._handleActionClick(e)}></calcite-action>${!this.sideActionBarExpanded && t`<calcite-tooltip reference-element=functions-action><span>${this.messages.functions ?? "Functions"}</span></calcite-tooltip>` || ""}</calcite-action-bar>` || ""}</arcgis-code-editor-shell>`;
86
92
  }
87
93
  }
88
- n("arcgis-sql-expression-editor", m);
94
+ n("arcgis-sql-expression-editor", u);
89
95
  export {
90
- m as ArcgisSqlExpressionEditor
96
+ u as ArcgisSqlExpressionEditor
91
97
  };
@@ -528,4 +528,15 @@ export interface IEditorTestContext extends IContextReferences {
528
528
  * The key's value must be of type ArcGIS core ProfileVariableInstance.
529
529
  */
530
530
  profileVariableInstances: ProfileVariableInstances;
531
+ }
532
+
533
+ /** An object containing overrides of documentation links within the arcade editor. */
534
+ export type ArcadeEditorLinkOverrides = {
535
+ /** URL for the Arcade Assistant help topic. */
536
+ "arcade-assistant-reference-doc"?: string;
537
+ };
538
+
539
+ /** Customizable configuration of documentation links used by the Arcade editor. */
540
+ export interface DocsConfig {
541
+ links: ArcadeEditorLinkOverrides;
531
542
  }