@arcgis/coding-components 5.2.0-next.86 → 5.2.0-next.88

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.
package/dist/cdn/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
- import{K as s,w as e}from"./A77A54OM.js";import"./BFPEJYVB.js";import"./H6RQVSYM.js";var i=e(s,{"arcgis-arcade-coding-assistant":[()=>import("./W77Z4EY4.js"),"appVersion,closed,closePanel:,diagnostics:,disableQuestionAnswerLogging,editorRef:,feedbackServiceUrl,helpBase,insertText:,portalUrl,promptingEnabled,serviceUrl;destroy,openPrompt"],"arcgis-arcade-debugger-console":[()=>import("./VQB7J2LU.js"),"debuggerStore:,modelId"],"arcgis-arcade-debugger-output":[()=>import("./RG7XCMPX.js"),"debuggerStore:,outputTitle,result:"],"arcgis-arcade-editor":[()=>import("./DUB4GMXG.js"),"arcadeAssistant:,customPanels:,disableAssistant,editorInstance:,editorOptions:,enableDebugger,externalExecutor:,hideDocumentationActions,hideSideBar,messageOverrides:,messages:,openedSidePanel,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getTestResult,openArcadeAssistant,setFocus"],"arcgis-arcade-results":[()=>import("./MIIHORYJ.js"),"consoleLogs:,executionTiming:,hideHeader,loading,openedResultPanel,result:"],"arcgis-arcade-suggestions":[()=>import("./4OW3EH74.js"),"closed,suggestions:"],"arcgis-code-editor":[()=>import("./RBDGSMHN.js"),"editorInstance:,editorOptions:,language,modelId,value;insertSnippet,insertText,setFocus"],"arcgis-code-editor-shell":[()=>import("./BPPFZDPH.js")],"arcgis-code-viewer":[()=>import("./NLVKEWNR.js"),"language,lineNumbers,round"],"arcgis-editor-variables":[()=>import("./6YLBGWGQ.js"),"closed,heading,hideDescriptions,loading,messageOverrides:,modelId,variable:"],"arcgis-language-api-panel":[()=>import("./JSZLCNQX.js"),"apiLibrary:,closed,hideDocumentationActions,languageId,loading"],"arcgis-sql-expression-editor":[()=>import("./OY7QVXY5.js"),"hideDescriptionsInFieldsPanel,hideSideBar,messageOverrides:,messages:,profile:,script;setFocus"],"arcgis-sql-layer-editor":[()=>import("./W2NC7KQQ.js"),"editorInstance:,editorOptions:,hideSideBar,messageOverrides:,messages:,openedSidePanel,profile:,script;setFocus"]});i({resourcesUrl:import.meta.url});var r=new CSSStyleSheet;r.replaceSync("@layer{:not([hydrated]):is(arcgis-arcade-editor,arcgis-code-editor,arcgis-code-editor-shell,arcgis-code-viewer,arcgis-sql-expression-editor,arcgis-sql-layer-editor){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,r];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,s)
2
+ import{K as s,w as e}from"./A77A54OM.js";import"./BFPEJYVB.js";import"./H6RQVSYM.js";var i=e(s,{"arcgis-arcade-coding-assistant":[()=>import("./P46WA3YD.js"),"appVersion,closed,closePanel:,diagnostics:,disableQuestionAnswerLogging,editorRef:,feedbackServiceUrl,helpBase,insertText:,portalUrl,promptingEnabled,serviceUrl;destroy,openPrompt"],"arcgis-arcade-debugger-console":[()=>import("./VQB7J2LU.js"),"debuggerStore:,modelId"],"arcgis-arcade-debugger-output":[()=>import("./RG7XCMPX.js"),"debuggerStore:,outputTitle,result:"],"arcgis-arcade-editor":[()=>import("./MDSRERH4.js"),"arcadeAssistant:,customPanels:,disableAssistant,editorInstance:,editorOptions:,enableDebugger,externalExecutor:,hideDocumentationActions,hideSideBar,messageOverrides:,messages:,openedSidePanel,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getTestResult,openArcadeAssistant,setFocus"],"arcgis-arcade-results":[()=>import("./MIIHORYJ.js"),"consoleLogs:,executionTiming:,hideHeader,loading,openedResultPanel,result:"],"arcgis-arcade-suggestions":[()=>import("./4OW3EH74.js"),"closed,suggestions:"],"arcgis-code-editor":[()=>import("./NIQPQNFL.js"),"editorInstance:,editorOptions:,language,modelId,value;insertSnippet,insertText,setFocus"],"arcgis-code-editor-shell":[()=>import("./BPPFZDPH.js")],"arcgis-code-viewer":[()=>import("./222K52F2.js"),"language,lineNumbers,round"],"arcgis-editor-variables":[()=>import("./6YLBGWGQ.js"),"closed,heading,hideDescriptions,loading,messageOverrides:,modelId,variable:"],"arcgis-language-api-panel":[()=>import("./JSZLCNQX.js"),"apiLibrary:,closed,hideDocumentationActions,languageId,loading"],"arcgis-sql-expression-editor":[()=>import("./PEPAASB7.js"),"hideDescriptionsInFieldsPanel,hideSideBar,messageOverrides:,messages:,profile:,script;setFocus"],"arcgis-sql-layer-editor":[()=>import("./HRNMXKFZ.js"),"editorInstance:,editorOptions:,hideSideBar,messageOverrides:,messages:,openedSidePanel,profile:,script;setFocus"]});i({resourcesUrl:import.meta.url});var r=new CSSStyleSheet;r.replaceSync("@layer{:not([hydrated]):is(arcgis-arcade-editor,arcgis-code-editor,arcgis-code-editor-shell,arcgis-code-viewer,arcgis-sql-expression-editor,arcgis-sql-layer-editor){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,r];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,s)
@@ -1,29 +1,20 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
2
2
  import { c as m } from "../../chunks/runtime.js";
3
- import { css as u, html as l } from "lit";
3
+ import { css as u, html as r } from "lit";
4
4
  import { LitElement as f, createEvent as n, safeClassMap as b } from "@arcgis/lumina";
5
5
  import { generateGuid as _ } from "@arcgis/toolkit/string";
6
6
  import { u as E } from "../../chunks/useT9n.js";
7
7
  import { createRef as S, ref as v } from "lit/directives/ref.js";
8
- import { c } from "../../chunks/utils.js";
9
- import { e as y } from "../../chunks/utilities.js";
10
- import "@arcgis/core/portal/PortalItem.js";
11
- import "@arcgis/core/WebMap.js";
12
- import "@arcgis/core/WebScene.js";
13
- import "@arcgis/core/layers/FeatureLayer.js";
14
- import "@arcgis/core/applications/Components/arcadeEditorUtils.js";
15
- import "@arcgis/toolkit/predicate";
16
- import "vscode-languageserver-types";
17
8
  import { rethrowError as d } from "@arcgis/toolkit/log";
18
- import "@arcgis/core/core/Error.js";
19
- import { d as p } from "../../chunks/language-defaults-base.js";
20
- import "@arcgis/core/portal/Portal.js";
21
- import { g as $, a as L, b as x, c as I } from "../../chunks/sql-layer-defaults.js";
22
- import { getSqlLayerDiagnosticService as P } from "../../chunks/sql-layer-mode.js";
9
+ import { g as y, a as $, b as L, c as x } from "../../chunks/sql-layer-defaults.js";
10
+ import { getSqlLayerDiagnosticService as I } from "../../chunks/sql-layer-mode.js";
11
+ import { d as c } from "../../chunks/language-defaults-base.js";
12
+ import { c as p } from "../../chunks/utils.js";
13
+ import { e as P } from "../../chunks/utilities.js";
23
14
  const C = u`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}`;
24
15
  class D extends f {
25
16
  constructor() {
26
- super(...arguments), this._codeEditorElt = S(), this._disposables = [], this._modelId = _(), this.messages = E(), this._preparing = !1, this._resolvedLanguage = p, this.sideActionBarExpanded = !1, this.script = "", this.hideSideBar = !1, this.openedSidePanel = "none", this.arcgisDiagnosticsChange = n({ bubbles: !1 }), this.arcgisScriptChange = n({ bubbles: !1 });
17
+ super(...arguments), this._codeEditorElt = S(), this._disposables = [], this._modelId = _(), this.messages = E(), this._preparing = !1, this._resolvedLanguage = c, this.sideActionBarExpanded = !1, this.script = "", this.hideSideBar = !1, this.openedSidePanel = "none", this.arcgisDiagnosticsChange = n({ bubbles: !1 }), this.arcgisScriptChange = n({ bubbles: !1 });
27
18
  }
28
19
  static {
29
20
  this.properties = { _editorProfile: 16, _preparing: 16, _resolvedLanguage: 16, sideActionBarExpanded: 16, profile: 0, script: 1, hideSideBar: 5, messageOverrides: 0, openedSidePanel: 3, editorOptions: 0, editorInstance: 32 };
@@ -44,7 +35,7 @@ class D extends f {
44
35
  e.has("profile") && this._updateDataModelDeps().catch(d(this));
45
36
  }
46
37
  async loaded() {
47
- const e = P();
38
+ const e = I();
48
39
  this._disposables.push(e.onDiagnosticsChange((t) => {
49
40
  t.uri.toString() === this._modelId && !this._preparing && this.arcgisDiagnosticsChange.emit(t.diagnostics);
50
41
  }));
@@ -52,17 +43,17 @@ class D extends f {
52
43
  disconnectedCallback() {
53
44
  for (super.disconnectedCallback(); this._disposables.length; )
54
45
  this._disposables.pop()?.dispose();
55
- $().forEach((e) => e.disposeForModel(this._modelId));
46
+ y().forEach((e) => e.disposeForModel(this._modelId));
56
47
  }
57
48
  async _updateDataModelDeps() {
58
49
  this._preparing = !0;
59
50
  try {
60
- const e = await L(this.profile);
61
- e !== this._resolvedLanguage && (x(this._resolvedLanguage)?.disposeForModel(this._modelId), this._resolvedLanguage = e);
62
- const t = I(this._resolvedLanguage);
51
+ const e = await $(this.profile);
52
+ e !== this._resolvedLanguage && (L(this._resolvedLanguage)?.disposeForModel(this._modelId), this._resolvedLanguage = e);
53
+ const t = x(this._resolvedLanguage);
63
54
  await t.setProfileForModel(this._modelId, this.profile, { locale: this.messages._t9nLocale }), this._editorProfile = t.getEditorProfileForModel(this._modelId);
64
55
  } catch {
65
- this._editorProfile = void 0, this._resolvedLanguage = p;
56
+ this._editorProfile = void 0, this._resolvedLanguage = c;
66
57
  } finally {
67
58
  this._preparing = !1;
68
59
  }
@@ -86,27 +77,27 @@ class D extends f {
86
77
  await t.loadSource();
87
78
  let a;
88
79
  const s = t.fieldInfos.filter((i) => i.type === "geometry" && !a ? (a = i.name, !0) : i.type !== "geometry").map((i) => i.name).filter(Boolean), h = `select ${s.length ? s.join(", ") : "*"} from ${t.snippet}`, o = this._codeEditorElt.value?.editorInstance;
89
- y(o, h, "replace", ""), o?.getAction("editor.action.formatDocument")?.run();
90
- const r = o?.getModel();
91
- if (r) {
92
- const i = r.getLineCount(), g = r.getLineMaxColumn(i);
80
+ P(o, h, "replace", ""), o?.getAction("editor.action.formatDocument")?.run();
81
+ const l = o?.getModel();
82
+ if (l) {
83
+ const i = l.getLineCount(), g = l.getLineMaxColumn(i);
93
84
  o?.setPosition({ lineNumber: i, column: g });
94
85
  }
95
86
  }
96
87
  _getTablesVariable() {
97
- return this._editorProfile?.variables.find(c);
88
+ return this._editorProfile?.variables.find(p);
98
89
  }
99
90
  _getSelectedTableVariable(e) {
100
91
  const t = this._getTablesVariable();
101
- if (c(t))
92
+ if (p(t))
102
93
  return t.tableVariables.find((a) => a.snippet === e);
103
94
  }
104
95
  render() {
105
96
  const e = this._getTablesVariable(), a = String(this.messages.placeholderexample ?? "Example: {sqlQueryExample}").replace("{sqlQueryExample}", "select field1, field2 from db.dataset"), s = `${this.messages.placeholder ?? "Start filtering data using SQL query syntax"}
106
97
  ${a}`;
107
- return l`<arcgis-code-editor-shell><arcgis-code-editor slot=editor .language=${this._resolvedLanguage} .modelId=${this._modelId} .value=${this.script ?? ""} @arcgisValueChange=${this._onCodeEditorValueChange} .editorOptions=${{ placeholder: s, ...this.editorOptions }} ${v(this._codeEditorElt)}></arcgis-code-editor>${!this.hideSideBar && l`<arcgis-editor-variables slot=side-panel .variable=${e} .heading=${this.messages.tables ?? "Tables"} .messageOverrides=${{ profileempty: this.messages.profileempty }} .closed=${this.openedSidePanel !== "variables"} class=${b(this.openedSidePanel === "variables" ? "" : "hidden")} .loading=${this._preparing} .modelId=${this._modelId} @arcgisInternalItemSelected=${this._onItemSelected} @arcgisInternalClosePanel=${() => {
98
+ return r`<arcgis-code-editor-shell><arcgis-code-editor slot=editor .language=${this._resolvedLanguage} .modelId=${this._modelId} .value=${this.script ?? ""} @arcgisValueChange=${this._onCodeEditorValueChange} .editorOptions=${{ placeholder: s, ...this.editorOptions }} ${v(this._codeEditorElt)}></arcgis-code-editor>${!this.hideSideBar && r`<arcgis-editor-variables slot=side-panel .variable=${e} .heading=${this.messages.tables ?? "Tables"} .messageOverrides=${{ profileempty: this.messages.profileempty }} .closed=${this.openedSidePanel !== "variables"} class=${b(this.openedSidePanel === "variables" ? "" : "hidden")} .loading=${this._preparing} .modelId=${this._modelId} @arcgisInternalItemSelected=${this._onItemSelected} @arcgisInternalClosePanel=${() => {
108
99
  this.openedSidePanel = "none";
109
- }} data-panel-name=none></arcgis-editor-variables><calcite-action-bar slot=side-action-bar .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}><calcite-action id=tables-action .text=${this.messages.tables ?? "Tables"} icon=table .active=${this.openedSidePanel === "variables"} data-panel-name=variables @click=${() => this._toggleSidePanel("variables")}></calcite-action>${!this.sideActionBarExpanded && l`<calcite-tooltip reference-element=tables-action><span>${this.messages.tables ?? "Tables"}</span></calcite-tooltip>` || ""}</calcite-action-bar>` || ""}</arcgis-code-editor-shell>`;
100
+ }} data-panel-name=none></arcgis-editor-variables><calcite-action-bar slot=side-action-bar .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}><calcite-action id=tables-action .text=${this.messages.tables ?? "Tables"} icon=table .active=${this.openedSidePanel === "variables"} data-panel-name=variables @click=${() => this._toggleSidePanel("variables")}></calcite-action>${!this.sideActionBarExpanded && r`<calcite-tooltip reference-element=tables-action><span>${this.messages.tables ?? "Tables"}</span></calcite-tooltip>` || ""}</calcite-action-bar>` || ""}</arcgis-code-editor-shell>`;
110
101
  }
111
102
  }
112
103
  m("arcgis-sql-layer-editor", D);