@arcgis/coding-components 5.2.0-next.116 → 5.2.0-next.117
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/22WTKWX3.js +2 -0
- package/dist/cdn/{NNOHKAUR.js → 2OOUSCR2.js} +1 -1
- package/dist/cdn/3MYJY4XF.js +2 -0
- package/dist/cdn/{H4L6N7W4.js → 5E6FR6BZ.js} +1 -1
- package/dist/cdn/{CNEKU4E5.js → 62DBPVRG.js} +1 -1
- package/dist/cdn/{WBN7AYGG.js → 6DFI5ERF.js} +1 -1
- package/dist/cdn/{2SCD7KX4.js → 7557YTH2.js} +1 -1
- package/dist/cdn/{46HXMXDY.js → 7EBMAFES.js} +1 -1
- package/dist/cdn/{V4HDH7ZM.js → 7WYHXRIC.js} +1 -1
- package/dist/cdn/AGHMGL6E.js +12 -0
- package/dist/cdn/AJTKKJJT.js +2 -0
- package/dist/cdn/{E76ZT2V2.js → BDPAZMM4.js} +1 -1
- package/dist/cdn/{NE7AQ3M2.js → BXSWFHYR.js} +1 -1
- package/dist/cdn/{KJ2SRGSL.js → EZLFACAC.js} +1 -1
- package/dist/cdn/{GSCCYBOK.js → FWJIPXSM.js} +1 -1
- package/dist/cdn/{AHV3AN6P.js → GC7FFZEU.js} +1 -1
- package/dist/cdn/{AK3FYTHS.js → GY5IX3XK.js} +1 -1
- package/dist/cdn/HQFOVSNC.js +4 -0
- package/dist/cdn/HY5O2FXT.js +2 -0
- package/dist/cdn/IALRR5VH.js +2 -0
- package/dist/cdn/{LXC277WJ.js → KHS23QIL.js} +3 -3
- package/dist/cdn/{57OI3HYY.js → KLDWM65I.js} +1 -1
- package/dist/cdn/{YKJS4OIT.js → MWWXV5SO.js} +1 -1
- package/dist/cdn/{SGH4ISZJ.js → N37NWQCL.js} +1 -1
- package/dist/cdn/NULEXQA2.js +2 -0
- package/dist/cdn/ODW3NXBR.js +2 -0
- package/dist/cdn/{7CO7POPG.js → OKBXNZWB.js} +1 -1
- package/dist/cdn/{6JE7UXRZ.js → PBAJAXFT.js} +1 -1
- package/dist/cdn/PBU6VJBZ.js +2 -0
- package/dist/cdn/{2D4U4CLP.js → VFTBLPWP.js} +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/functional.js +30 -29
- package/dist/chunks/language-defaults-base.js +30 -29
- package/dist/chunks/utilities.js +13 -12
- package/dist/chunks/utils.js +1 -0
- package/dist/components/arcgis-arcade-coding-assistant/customElement.js +65 -64
- package/dist/components/arcgis-arcade-results/customElement.js +15 -14
- package/dist/components/arcgis-arcade-suggestions/customElement.js +17 -17
- package/dist/components/arcgis-language-api-panel/customElement.js +36 -35
- package/dist/components/arcgis-sql-expression-editor/customElement.js +2 -2
- package/dist/components/arcgis-sql-layer-editor/customElement.js +1 -1
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +6 -6
- package/dist/cdn/5BDVHLU3.js +0 -2
- package/dist/cdn/5KM3AKLY.js +0 -2
- package/dist/cdn/7VS5GHCL.js +0 -4
- package/dist/cdn/BHSILWSL.js +0 -2
- package/dist/cdn/G7BVWE35.js +0 -2
- package/dist/cdn/HYNFJPLU.js +0 -2
- package/dist/cdn/MXOZNCTB.js +0 -12
- package/dist/cdn/PJAIXRX6.js +0 -2
- package/dist/cdn/TQWS6NIV.js +0 -2
- package/dist/cdn/XNIZBSS5.js +0 -2
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
2
|
+
import { c as u } from "../../chunks/runtime.js";
|
|
3
3
|
import { ref as o } from "lit/directives/ref.js";
|
|
4
|
-
import { css as
|
|
5
|
-
import {
|
|
6
|
-
import { addLtrMark as
|
|
7
|
-
import { LitElement as
|
|
8
|
-
import { f as
|
|
9
|
-
import { c as
|
|
10
|
-
import { u as
|
|
11
|
-
const
|
|
12
|
-
class I extends
|
|
4
|
+
import { css as f, html as l, nothing as h } from "lit";
|
|
5
|
+
import { focusElement as a } from "@arcgis/toolkit/dom";
|
|
6
|
+
import { addLtrMark as n } from "@arcgis/toolkit/string";
|
|
7
|
+
import { LitElement as p, createEvent as r } from "@arcgis/lumina";
|
|
8
|
+
import { f as g } from "../../chunks/utilities.js";
|
|
9
|
+
import { c as d } from "../../chunks/markdown.js";
|
|
10
|
+
import { u as b } from "../../chunks/useT9n.js";
|
|
11
|
+
const v = f`: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)}calcite-flow{height:100%}calcite-block{p:first-of-type{margin-top:0}}calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}calcite-flow{[slot=footer]{word-break:break-word}}.container{block-size:100%;display:grid;grid-template-rows:auto 1fr;overflow:hidden}.scrollable{min-block-size:0;overflow:auto}}`;
|
|
12
|
+
class I extends p {
|
|
13
13
|
constructor() {
|
|
14
|
-
super(...arguments), this.messages =
|
|
14
|
+
super(...arguments), this.messages = b(), this._unselectItem = async () => {
|
|
15
15
|
this._selectedApiItem = void 0;
|
|
16
|
-
}, this._filterValue = "", this.languageId = "arcade", this.hideDocumentationActions = !1, this.loading = !1, this.closed = !1, this.arcgisInternalClosePanel =
|
|
16
|
+
}, this._filterValue = "", this.languageId = "arcade", this.hideDocumentationActions = !1, this.loading = !1, this.closed = !1, this.arcgisInternalClosePanel = r({ bubbles: !1, composed: !1 }), this.arcgisInternalItemSelected = r({ bubbles: !1, composed: !1 });
|
|
17
17
|
}
|
|
18
18
|
static {
|
|
19
19
|
this.properties = { _filterValue: 16, _selectedApiItem: 16, languageId: 1, apiLibrary: 0, hideDocumentationActions: 5, loading: 5, closed: 5 };
|
|
20
20
|
}
|
|
21
21
|
static {
|
|
22
|
-
this.styles =
|
|
22
|
+
this.styles = v;
|
|
23
23
|
}
|
|
24
24
|
willUpdate(e) {
|
|
25
25
|
if (e.has("apiLibrary")) {
|
|
26
26
|
if (!this._selectedApiItem)
|
|
27
27
|
return;
|
|
28
|
-
for (const
|
|
29
|
-
for (const
|
|
30
|
-
if (
|
|
31
|
-
this._selectedApiItem =
|
|
28
|
+
for (const t of this.apiLibrary ?? [])
|
|
29
|
+
for (const i of t.items)
|
|
30
|
+
if (i.name === this._selectedApiItem.name) {
|
|
31
|
+
this._selectedApiItem = i;
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
34
|
this._selectedApiItem = void 0;
|
|
@@ -43,50 +43,51 @@ class I extends g {
|
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
45
|
this._flowObserver || (this._flowObserver = new MutationObserver(() => {
|
|
46
|
-
|
|
46
|
+
const t = e.querySelector("calcite-flow-item:last-child")?.querySelector("calcite-input");
|
|
47
|
+
t && a(t);
|
|
47
48
|
}), this._flowObserver.observe(e, { attributes: !0, attributeFilter: ["id"], childList: !0 }));
|
|
48
49
|
}
|
|
49
|
-
_emitItemSelected(e,
|
|
50
|
-
if (!
|
|
50
|
+
_emitItemSelected(e, t) {
|
|
51
|
+
if (!t)
|
|
51
52
|
return;
|
|
52
|
-
const
|
|
53
|
-
(!
|
|
53
|
+
const i = e;
|
|
54
|
+
(!i.key || i.key === "Enter") && (e.preventDefault(), this.arcgisInternalItemSelected.emit(t.completion.insertText ?? ""));
|
|
54
55
|
}
|
|
55
56
|
_emitClose() {
|
|
56
57
|
this.arcgisInternalClosePanel.emit();
|
|
57
58
|
}
|
|
58
|
-
_emitItemSelectedAndClose(e,
|
|
59
|
-
const
|
|
60
|
-
(!
|
|
59
|
+
_emitItemSelectedAndClose(e, t) {
|
|
60
|
+
const i = e;
|
|
61
|
+
(!i.key || i.key === "Enter") && (e.preventDefault(), this.arcgisInternalItemSelected.emit(t.completion.insertText ?? ""));
|
|
61
62
|
}
|
|
62
|
-
_selectItem(e,
|
|
63
|
-
e.stopPropagation(), this._selectedApiItem =
|
|
63
|
+
_selectItem(e, t) {
|
|
64
|
+
e.stopPropagation(), this._selectedApiItem = t;
|
|
64
65
|
}
|
|
65
66
|
_updateFilterValue(e) {
|
|
66
67
|
this._filterValue = e.currentTarget.value ?? "";
|
|
67
68
|
}
|
|
68
69
|
_elementToMarkdown(e) {
|
|
69
|
-
e !== void 0 && (e.innerHTML =
|
|
70
|
+
e !== void 0 && (e.innerHTML = d(this._selectedApiItem.examples));
|
|
70
71
|
}
|
|
71
72
|
renderApiCategory(e) {
|
|
72
|
-
const
|
|
73
|
-
return
|
|
73
|
+
const t = g(e.items, "name", this._filterValue);
|
|
74
|
+
return t.length ? l`<calcite-list-item-group .heading=${e.title}>${t.map((i) => l`<calcite-list-item .label=${n(i.completion.detail)} @calciteListItemSelect=${(s) => this._emitItemSelected(s, i)} @keydown=${(s) => this._emitItemSelected(s, i)}>${m({ apiItem: i })}<calcite-action slot=actions-end .text=${this.messages.expand ?? ""} icon=chevron-right icon-flip-rtl scale=s @click=${(s) => this._selectItem(s, i)}></calcite-action></calcite-list-item>`)}</calcite-list-item-group>` : null;
|
|
74
75
|
}
|
|
75
76
|
renderApiItemFlowItem() {
|
|
76
77
|
const e = this._selectedApiItem;
|
|
77
|
-
return e ? l`<calcite-flow-item heading-level=2 .heading=${this.messages.constantsandfunctions} .beforeBack=${this._unselectItem} closable @calciteFlowItemClose=${this._emitClose} selected>${this.hideDocumentationActions ? null : l`<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=${(
|
|
78
|
+
return e ? l`<calcite-flow-item heading-level=2 .heading=${this.messages.constantsandfunctions} .beforeBack=${this._unselectItem} closable @calciteFlowItemClose=${this._emitClose} selected>${this.hideDocumentationActions ? null : l`<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=${(t) => this._emitItemSelectedAndClose(t, e)} ${o(a)}>${this.messages.insert}</calcite-button><calcite-block expanded .heading=${n(e.completion.detail)}><div .innerHTML=${d(e.completion.documentation) ?? ""}></div>${m({ apiItem: e })}${e.examples ? l`<div ${o(this._elementToMarkdown)}></div>` : null}</calcite-block></calcite-flow-item>` : null;
|
|
78
79
|
}
|
|
79
80
|
render() {
|
|
80
81
|
if (this.closed)
|
|
81
82
|
return null;
|
|
82
|
-
const e = (this.apiLibrary ?? []).map((
|
|
83
|
-
return l`<calcite-flow ${o(this.flowFocusHandler)}><calcite-flow-item heading-level=2 .heading=${this.messages.constantsandfunctions} closable @calciteFlowItemClose=${this._emitClose} .selected=${!this._selectedApiItem}><div class="container"><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${this._updateFilterValue} scale=m></calcite-input><div class="scrollable">${this.loading ? l`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading ?? "Loading"}></calcite-loader>` : l`<calcite-list .label=${this.messages.api ?? "API"}>${
|
|
83
|
+
const e = (this.apiLibrary ?? []).map((i) => this.renderApiCategory(i)), t = e.every((i) => !i);
|
|
84
|
+
return l`<calcite-flow ${o(this.flowFocusHandler)}><calcite-flow-item heading-level=2 .heading=${this.messages.constantsandfunctions} closable @calciteFlowItemClose=${this._emitClose} .selected=${!this._selectedApiItem}><div class="container"><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${this._updateFilterValue} scale=m></calcite-input><div class="scrollable">${this.loading ? l`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading ?? "Loading"}></calcite-loader>` : l`<calcite-list .label=${this.messages.api ?? "API"}>${t ? l`<div class="notice-container">${this.messages.noitems}</div>` : e}</calcite-list>`}</div></div></calcite-flow-item>${this.renderApiItemFlowItem()}</calcite-flow>`;
|
|
84
85
|
}
|
|
85
86
|
}
|
|
86
|
-
function
|
|
87
|
+
function m({ apiItem: c, slot: e = "content-start" }) {
|
|
87
88
|
return c.type === "function" && c.consumesCredits ? l`<calcite-icon icon=credits slot=${e ?? h} scale=s></calcite-icon>` : null;
|
|
88
89
|
}
|
|
89
|
-
|
|
90
|
+
u("arcgis-language-api-panel", I);
|
|
90
91
|
export {
|
|
91
92
|
I as ArcgisLanguageApiPanel
|
|
92
93
|
};
|
|
@@ -57,7 +57,7 @@ class m extends l {
|
|
|
57
57
|
this._activeAction = i;
|
|
58
58
|
}
|
|
59
59
|
_handleActionClick(i) {
|
|
60
|
-
const e = i.
|
|
60
|
+
const e = i.currentTarget;
|
|
61
61
|
this._setActiveAction(e.dataset.panelName);
|
|
62
62
|
}
|
|
63
63
|
_insertAsSnippet(i) {
|
|
@@ -82,7 +82,7 @@ class m extends l {
|
|
|
82
82
|
}
|
|
83
83
|
render() {
|
|
84
84
|
const i = this._getFeatureSetVariable();
|
|
85
|
-
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=${this._handleActionClick}></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=${this._handleActionClick}></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>`;
|
|
85
|
+
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
86
|
}
|
|
87
87
|
}
|
|
88
88
|
n("arcgis-sql-expression-editor", m);
|
|
@@ -93,7 +93,7 @@ class D extends f {
|
|
|
93
93
|
return t.tableVariables.find((a) => a.snippet === e);
|
|
94
94
|
}
|
|
95
95
|
render() {
|
|
96
|
-
const e = this._getTablesVariable(), a =
|
|
96
|
+
const e = this._getTablesVariable(), a = (this.messages.placeholderexample ?? "Example: {sqlQueryExample}").replace("{sqlQueryExample}", "select field1, field2 from db.dataset"), s = `${this.messages.placeholder ?? "Start filtering data using SQL query syntax"}
|
|
97
97
|
${a}`;
|
|
98
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=${() => {
|
|
99
99
|
this.openedSidePanel = "none";
|