@arcgis/coding-components 4.32.0-next.58 → 4.32.0-next.60
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/arcgis-coding-components/{PIU3GLSN.js → 27XX6TIU.js} +2 -2
- package/dist/arcgis-coding-components/{O362HU2I.js → 3PPWXWTS.js} +2 -2
- package/dist/arcgis-coding-components/{NXQWTU6D.js → 3QE4WEJR.js} +2 -2
- package/dist/arcgis-coding-components/3RYPISGD.js +6 -0
- package/dist/arcgis-coding-components/{EO7FSJ7P.js → 5NCIF6PY.js} +1 -1
- package/dist/arcgis-coding-components/{VOT5BYWL.js → 6KDUW6OF.js} +2 -2
- package/dist/arcgis-coding-components/{YKUWOITF.js → 77IZXYPY.js} +2 -2
- package/dist/arcgis-coding-components/{OYVPJNZK.js → AB3PCHOX.js} +2 -2
- package/dist/arcgis-coding-components/{IHBPXULM.js → AJDJLFAA.js} +2 -2
- package/dist/arcgis-coding-components/{7LNCLERO.js → BDNQ5Z2B.js} +2 -2
- package/dist/arcgis-coding-components/BWMK6GPR.js +6 -0
- package/dist/arcgis-coding-components/{YCNTHIAU.js → CFNLWCXB.js} +2 -2
- package/dist/arcgis-coding-components/{62SSNNAO.js → DBGTZ257.js} +1 -1
- package/dist/arcgis-coding-components/{LQRMBDCH.js → DRB2D4R2.js} +2 -2
- package/dist/arcgis-coding-components/{R75ZJURF.js → E6IQK7SV.js} +2 -2
- package/dist/arcgis-coding-components/FBKAKDLJ.js +14 -0
- package/dist/arcgis-coding-components/FO3FPKTU.js +6 -0
- package/dist/arcgis-coding-components/{MWBB5JJ7.js → GRHVEY5C.js} +2 -2
- package/dist/arcgis-coding-components/{3KI3B3S6.js → KNO4MLJY.js} +2 -2
- package/dist/arcgis-coding-components/{BKAQOBIR.js → LRLYHBR2.js} +2 -2
- package/dist/arcgis-coding-components/{4IJ3XFC2.js → MD4W3HAT.js} +2 -2
- package/dist/arcgis-coding-components/{PWAEEW7S.js → MDEPKIKV.js} +3 -3
- package/dist/arcgis-coding-components/{N6ISXI5Y.js → NEDGH3HO.js} +2 -2
- package/dist/arcgis-coding-components/{2L2TJL2K.js → NVS5EIUQ.js} +2 -2
- package/dist/arcgis-coding-components/{YA6FFFR2.js → RGXWU6RA.js} +2 -2
- package/dist/arcgis-coding-components/{X2X53W36.js → RV5HPJ7R.js} +1 -1
- package/dist/arcgis-coding-components/TBNJJAWE.js +6 -0
- package/dist/arcgis-coding-components/{ZULSO2FF.js → USHAHMFP.js} +2 -2
- package/dist/arcgis-coding-components/{GKFYIM5D.js → UX3FDPMK.js} +2 -2
- package/dist/arcgis-coding-components/{D4O6WEO7.js → W3VHE6OK.js} +2 -2
- package/dist/arcgis-coding-components/{NIC6H3IU.js → WCXILITC.js} +2 -2
- package/dist/arcgis-coding-components/{QUT7CUTS.js → WX4VSC6B.js} +2 -2
- package/dist/arcgis-coding-components/YKBBYHQG.js +6 -0
- package/dist/arcgis-coding-components/{6LSIDM7X.js → ZFXBOHYK.js} +2 -2
- package/dist/arcgis-coding-components/{75US6IWW.js → ZKC5GKT4.js} +2 -2
- package/dist/arcgis-coding-components/arcgis-coding-components.esm.js +2 -2
- package/dist/arcgis-coding-components/assets/code-editor/arcade.worker.js +1 -1
- package/dist/arcgis-coding-components/assets/code-editor/sql-expr.worker.js +45 -45
- package/dist/chunks/arcade-defaults.js +1 -1
- package/dist/chunks/arcade-executor.js +1 -1
- package/dist/chunks/arcade-mode.js +1 -1
- package/dist/chunks/arcade-service-accessors.js +1 -1
- package/dist/chunks/fields.js +1 -1
- package/dist/chunks/language-defaults-base.js +135 -144
- package/dist/chunks/markdown.js +1 -1
- package/dist/chunks/monaco-importer.js +1 -1
- package/dist/chunks/runtime.js +1 -1
- package/dist/chunks/sql-expr-defaults.js +1 -1
- package/dist/chunks/sql-expr-mode.js +1 -1
- package/dist/chunks/useT9n.js +1 -1
- package/dist/components/arcgis-arcade-editor/customElement.js +1 -1
- package/dist/components/arcgis-arcade-results/customElement.js +1 -1
- package/dist/components/arcgis-arcade-suggestions/customElement.js +19 -16
- package/dist/components/arcgis-code-editor/customElement.js +1 -1
- package/dist/components/arcgis-editor-variables/customElement.js +1 -1
- package/dist/components/arcgis-language-api-panel/customElement.js +34 -35
- package/dist/components/arcgis-sql-expression-editor/customElement.js +1 -1
- package/dist/components/arcgis-sql-expression-fields/customElement.js +1 -1
- package/dist/docs/api.json +2 -2
- package/dist/docs/docs.json +2 -2
- package/dist/docs/web-types.json +1 -1
- package/dist/index.js +1 -1
- package/dist/loader.js +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/sql-expr-monaco/sql-expr-validation-diagnostic-adapter.d.ts +1 -3
- package/package.json +7 -7
- package/dist/arcgis-coding-components/3OIXH6J2.js +0 -6
- package/dist/arcgis-coding-components/BMSLGLZN.js +0 -16
- package/dist/arcgis-coding-components/TTS3GMIW.js +0 -6
- package/dist/arcgis-coding-components/XJEM4QTJ.js +0 -6
- package/dist/arcgis-coding-components/XWPD74FP.js +0 -6
- package/dist/arcgis-coding-components/YAR7YCKS.js +0 -6
package/dist/chunks/markdown.js
CHANGED
|
@@ -5,7 +5,7 @@ import { generateTokensCSSForColorMap as te } from "monaco-editor/esm/vs/editor/
|
|
|
5
5
|
/*!
|
|
6
6
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
7
7
|
* See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
8
|
-
* v4.32.0-next.
|
|
8
|
+
* v4.32.0-next.60
|
|
9
9
|
*/
|
|
10
10
|
async function ne(l) {
|
|
11
11
|
return await (await ee()).colorize(l, "arcade", { tabSize: 2 });
|
|
@@ -6,7 +6,7 @@ import "monaco-editor/esm/vs/editor/common/languages/supports/tokenization";
|
|
|
6
6
|
/*!
|
|
7
7
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
8
8
|
* See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
9
|
-
* v4.32.0-next.
|
|
9
|
+
* v4.32.0-next.60
|
|
10
10
|
*/
|
|
11
11
|
function g(r, t, n, m) {
|
|
12
12
|
if (!t)
|
package/dist/chunks/runtime.js
CHANGED
|
@@ -2,7 +2,7 @@ import { makeRuntime as t } from "@arcgis/lumina";
|
|
|
2
2
|
/*!
|
|
3
3
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
4
4
|
* See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
5
|
-
* v4.32.0-next.
|
|
5
|
+
* v4.32.0-next.60
|
|
6
6
|
*/
|
|
7
7
|
const s = t({ defaultAssetPath: "https://jsdev.arcgis.com/coding-components/next/", hydratedAttribute: "hydrated" }), { customElement: a, getAssetPath: o, setAssetPath: m } = s;
|
|
8
8
|
export {
|
|
@@ -5,7 +5,7 @@ import { g as b } from "./runtime.js";
|
|
|
5
5
|
/*!
|
|
6
6
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
7
7
|
* See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
8
|
-
* v4.32.0-next.
|
|
8
|
+
* v4.32.0-next.60
|
|
9
9
|
*/
|
|
10
10
|
const x = (r) => {
|
|
11
11
|
const e = r.variables[0], i = e && e.type === "featureSet" ? A(e) : void 0, { apiVersion: t, bundles: o, hiddenApiItems: s } = r.toEditorProfileDefinition();
|
|
@@ -8,7 +8,7 @@ import { a as d } from "./sql-expr-defaults.js";
|
|
|
8
8
|
/*!
|
|
9
9
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
10
10
|
* See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
11
|
-
* v4.32.0-next.
|
|
11
|
+
* v4.32.0-next.60
|
|
12
12
|
*/
|
|
13
13
|
let h = new _();
|
|
14
14
|
class k {
|
package/dist/chunks/useT9n.js
CHANGED
|
@@ -15,7 +15,7 @@ import { css as w } from "@lit/reactive-element/css-tag.js";
|
|
|
15
15
|
/*!
|
|
16
16
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
17
17
|
* See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
18
|
-
* v4.32.0-next.
|
|
18
|
+
* v4.32.0-next.60
|
|
19
19
|
*/
|
|
20
20
|
const $ = w`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}}}`;
|
|
21
21
|
class y extends _ {
|
|
@@ -9,7 +9,7 @@ import { css as C } from "@lit/reactive-element/css-tag.js";
|
|
|
9
9
|
/*!
|
|
10
10
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
11
11
|
* See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
12
|
-
* v4.32.0-next.
|
|
12
|
+
* v4.32.0-next.60
|
|
13
13
|
*/
|
|
14
14
|
const A = C`:host{display:flex;flex-direction:column;width:100%;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);.flex-adjustable{flex:1 1 auto;overflow:hidden}.flex-row{display:flex;flex-direction:row;overflow:hidden}.flex-column{display:flex;flex-direction:column;overflow:hidden}.y-scrollable-container{overflow-y:auto;block-size:100%;background-color:var(--calcite-color-foreground-1)}header{border-bottom:1px solid var(--calcite-color-border-3);flex:0 0 auto}.ltr-container{direction:ltr}calcite-action-bar{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)}}.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.color-info{color:var(--calcite-color-status-info)}.color-error{color:var(--calcite-color-status-danger)}.color-success{color:var(--calcite-color-status-success)}[class*=result-value-]{font-size:var(--calcite-font-size--2);line-height:1.25rem;background-color:var(--calcite-color-foreground-1);margin:var(--calcite-spacing-md)}.console-logs-container{background-color:var(--calcite-color-foreground-1);padding:0 var(--calcite-spacing-md);font-family:var(--calcite-code-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal)}.result-value-table{table{display:block;max-width:fit-content;overflow-x:auto;border-spacing:0;border-collapse:collapse;text-align:start;white-space:nowrap;thead{background-color:var(--calcite-color-foreground-2)}tr{border-top:1px solid var(--calcite-color-border-3);border-bottom:1px solid var(--calcite-color-border-3)}th,td{border-inline-start:1px solid var(--calcite-color-border-3);border-inline-end:1px solid var(--calcite-color-border-3);text-align:start;padding:var(--calcite-spacing-xxs);.string-value{white-space:pre}}th{font-weight:var(--calcite-font-weight-medium)}}}.tree-item-label,.number-value,.string-value,.boolean-value{font-family:var(--calcite-code-family)}.tree-item-label,.value-type{color:var(--calcite-color-text-2);font-weight:var(--calcite-font-weight-normal)}.dictionary-property{color:var(--arcgis-editor-identifier)}.number-value{color:var(--arcgis-editor-number)}.string-value{color:var(--arcgis-editor-string);white-space:pre-wrap}.constant-value{color:var(--arcgis-editor-constant)}.date-value{color:var(--arcgis-editor-date)}}`, a = {
|
|
15
15
|
lines: !0,
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
import { c as n } from "../../chunks/runtime.js";
|
|
2
2
|
import { ref as l } from "lit-html/directives/ref.js";
|
|
3
3
|
import { html as s, nothing as c } from "lit";
|
|
4
|
-
import { setFocusOnElement as d } from "@arcgis/components-utils";
|
|
5
|
-
import { LitElement as
|
|
6
|
-
import { g as a, o as
|
|
7
|
-
import { f } from "../../chunks/monaco-importer.js";
|
|
8
|
-
import { u as
|
|
9
|
-
import { css as
|
|
4
|
+
import { setFocusOnElement as d, focusElement as g } from "@arcgis/components-utils";
|
|
5
|
+
import { LitElement as u, createEvent as r } from "@arcgis/lumina";
|
|
6
|
+
import { g as a, o as h, c as m, b as f } from "../../chunks/markdown.js";
|
|
7
|
+
import { f as p } from "../../chunks/monaco-importer.js";
|
|
8
|
+
import { u as b } from "../../chunks/useT9n.js";
|
|
9
|
+
import { css as _ } from "@lit/reactive-element/css-tag.js";
|
|
10
10
|
/*!
|
|
11
11
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
12
12
|
* See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
13
|
-
* v4.32.0-next.
|
|
13
|
+
* v4.32.0-next.60
|
|
14
14
|
*/
|
|
15
15
|
function v(o) {
|
|
16
16
|
return !Array.isArray(o) || !o.length ? !1 : Array.isArray(o[0].suggestions);
|
|
17
17
|
}
|
|
18
|
-
const
|
|
19
|
-
class
|
|
18
|
+
const S = _`: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)}}`;
|
|
19
|
+
class $ extends u {
|
|
20
20
|
constructor() {
|
|
21
21
|
super(...arguments), this._beforeBack = async () => {
|
|
22
22
|
this._selectedSuggestion = void 0;
|
|
23
|
-
}, this.messages =
|
|
23
|
+
}, this.messages = b(), this._colorizeStyle = "", this._filterValue = "", this.arcgisClose = r({ bubbles: !1 }), this.arcgisItemSelected = r({ bubbles: !1 });
|
|
24
24
|
}
|
|
25
25
|
static {
|
|
26
26
|
this.properties = { _colorizeStyle: 16, _filterValue: 16, _selectedSuggestion: 16, suggestions: 0 };
|
|
27
27
|
}
|
|
28
28
|
static {
|
|
29
|
-
this.styles =
|
|
29
|
+
this.styles = S;
|
|
30
30
|
}
|
|
31
31
|
// #endregion
|
|
32
32
|
// #region Lifecycle
|
|
33
33
|
load() {
|
|
34
|
-
this._colorizeStyle = a(), this._themeChangedListener =
|
|
34
|
+
this._colorizeStyle = a(), this._themeChangedListener = h(() => this._colorizeStyle = a());
|
|
35
35
|
}
|
|
36
36
|
willUpdate(e) {
|
|
37
37
|
e.has("suggestions") && this.suggestionsPropChanged();
|
|
@@ -72,17 +72,20 @@ class S extends g {
|
|
|
72
72
|
return this.suggestions === void 0 ? null : v(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);
|
|
73
73
|
}
|
|
74
74
|
renderSuggestionListItems(e) {
|
|
75
|
-
return e =
|
|
75
|
+
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>`;
|
|
76
76
|
}
|
|
77
77
|
renderSuggestionFlowItem() {
|
|
78
78
|
const e = this._selectedSuggestion;
|
|
79
|
-
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(
|
|
79
|
+
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=${m(e.documentation) ?? ""}></div><pre><code ${l(this._colorizeCode)}></code></pre></calcite-block></calcite-flow-item>` : null;
|
|
80
|
+
}
|
|
81
|
+
_colorizeCode(e) {
|
|
82
|
+
e !== void 0 && f(e, this._selectedSuggestion.code);
|
|
80
83
|
}
|
|
81
84
|
render() {
|
|
82
85
|
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>`;
|
|
83
86
|
}
|
|
84
87
|
}
|
|
85
|
-
n("arcgis-arcade-suggestions",
|
|
88
|
+
n("arcgis-arcade-suggestions", $);
|
|
86
89
|
export {
|
|
87
|
-
|
|
90
|
+
$ as ArcgisArcadeSuggestions
|
|
88
91
|
};
|
|
@@ -14,7 +14,7 @@ import { load as b } from "@arcgis/components-controllers";
|
|
|
14
14
|
/*!
|
|
15
15
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
16
16
|
* See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
17
|
-
* v4.32.0-next.
|
|
17
|
+
* v4.32.0-next.60
|
|
18
18
|
*/
|
|
19
19
|
c.register({
|
|
20
20
|
id: n.languageId,
|
|
@@ -8,7 +8,7 @@ import { css as m } from "@lit/reactive-element/css-tag.js";
|
|
|
8
8
|
/*!
|
|
9
9
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
10
10
|
* See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
11
|
-
* v4.32.0-next.
|
|
11
|
+
* v4.32.0-next.60
|
|
12
12
|
*/
|
|
13
13
|
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)}}`;
|
|
14
14
|
function g(l) {
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { c as m } from "../../chunks/runtime.js";
|
|
2
2
|
import { ref as c } from "lit-html/directives/ref.js";
|
|
3
3
|
import { html as s } from "lit";
|
|
4
|
-
import { setFocusOnElement as d, addLTRMark as o } from "@arcgis/components-utils";
|
|
5
|
-
import { LitElement as
|
|
6
|
-
import { g as r, o as
|
|
7
|
-
import { f as
|
|
8
|
-
import { u as
|
|
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
9
|
import { css as b } from "@lit/reactive-element/css-tag.js";
|
|
10
10
|
/*!
|
|
11
11
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
12
12
|
* See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
13
|
-
* v4.32.0-next.
|
|
13
|
+
* v4.32.0-next.60
|
|
14
14
|
*/
|
|
15
|
-
const
|
|
16
|
-
class
|
|
15
|
+
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)}}`;
|
|
16
|
+
class y extends u {
|
|
17
17
|
constructor() {
|
|
18
|
-
super(...arguments), this.messages =
|
|
18
|
+
super(...arguments), this.messages = _(), this._unselectItem = async () => {
|
|
19
19
|
this._selectedApiItem = void 0;
|
|
20
20
|
}, this._colorizeStyle = "", this._filterValue = "", this.hideDocumentationActions = !1, this.loading = !1, this.arcgisClose = a({ bubbles: !1 }), this.arcgisItemSelected = a({ bubbles: !1 });
|
|
21
21
|
}
|
|
@@ -23,21 +23,21 @@ class v extends h {
|
|
|
23
23
|
this.properties = { _colorizeStyle: 16, _filterValue: 16, _selectedApiItem: 16, apiLibrary: 0, hideDocumentationActions: 5, loading: 5 };
|
|
24
24
|
}
|
|
25
25
|
static {
|
|
26
|
-
this.styles =
|
|
26
|
+
this.styles = v;
|
|
27
27
|
}
|
|
28
28
|
// #endregion
|
|
29
29
|
// #region Lifecycle
|
|
30
30
|
load() {
|
|
31
|
-
this._colorizeStyle = r(), this._themeChangedListener =
|
|
31
|
+
this._colorizeStyle = r(), this._themeChangedListener = p(() => this._colorizeStyle = r());
|
|
32
32
|
}
|
|
33
33
|
willUpdate(e) {
|
|
34
34
|
if (e.has("apiLibrary")) {
|
|
35
35
|
if (!this._selectedApiItem)
|
|
36
36
|
return;
|
|
37
|
-
for (const
|
|
38
|
-
for (const
|
|
39
|
-
if (
|
|
40
|
-
this._selectedApiItem =
|
|
37
|
+
for (const i of this.apiLibrary ?? [])
|
|
38
|
+
for (const t of i.items)
|
|
39
|
+
if (t.name === this._selectedApiItem.name) {
|
|
40
|
+
this._selectedApiItem = t;
|
|
41
41
|
return;
|
|
42
42
|
}
|
|
43
43
|
this._selectedApiItem = void 0;
|
|
@@ -57,21 +57,21 @@ class v extends h {
|
|
|
57
57
|
d(e.querySelector("calcite-flow-item:last-child"), "calcite-input");
|
|
58
58
|
}), this._flowObserver.observe(e, { attributes: !0, attributeFilter: ["id"], childList: !0 }));
|
|
59
59
|
}
|
|
60
|
-
_emitItemSelected(e,
|
|
61
|
-
if (!
|
|
60
|
+
_emitItemSelected(e, i) {
|
|
61
|
+
if (!i)
|
|
62
62
|
return;
|
|
63
|
-
const
|
|
64
|
-
(!
|
|
63
|
+
const t = e;
|
|
64
|
+
(!t.key || t.key === "Enter") && (e.preventDefault(), this.arcgisItemSelected.emit(i.completion.insertText ?? ""));
|
|
65
65
|
}
|
|
66
66
|
_emitClose() {
|
|
67
67
|
this.arcgisClose.emit();
|
|
68
68
|
}
|
|
69
|
-
_emitItemSelectedAndClose(e,
|
|
70
|
-
const
|
|
71
|
-
(!
|
|
69
|
+
_emitItemSelectedAndClose(e, i) {
|
|
70
|
+
const t = e;
|
|
71
|
+
(!t.key || t.key === "Enter") && (e.preventDefault(), this.arcgisItemSelected.emit(i.completion.insertText ?? ""));
|
|
72
72
|
}
|
|
73
|
-
_selectItem(e,
|
|
74
|
-
e.stopPropagation(), this._selectedApiItem =
|
|
73
|
+
_selectItem(e, i) {
|
|
74
|
+
e.stopPropagation(), this._selectedApiItem = i;
|
|
75
75
|
}
|
|
76
76
|
_updateFilterValue(e) {
|
|
77
77
|
this._filterValue = e.currentTarget.value ?? "";
|
|
@@ -79,23 +79,22 @@ class v extends h {
|
|
|
79
79
|
// #endregion
|
|
80
80
|
// #region Rendering
|
|
81
81
|
renderApiCategory(e) {
|
|
82
|
-
const
|
|
83
|
-
return
|
|
82
|
+
const i = g(e.items, "name", this._filterValue);
|
|
83
|
+
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
84
|
}
|
|
85
85
|
renderApiItemFlowItem() {
|
|
86
86
|
const e = this._selectedApiItem;
|
|
87
|
-
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=${(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
})}></div>` : null}</calcite-block></calcite-flow-item>` : null;
|
|
87
|
+
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;
|
|
88
|
+
}
|
|
89
|
+
_elementToMarkdown(e) {
|
|
90
|
+
e !== void 0 && (e.innerHTML = n(this._selectedApiItem.examples), f(e).catch(console.error));
|
|
92
91
|
}
|
|
93
92
|
render() {
|
|
94
|
-
const e = (this.apiLibrary ?? []).map((
|
|
95
|
-
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">${
|
|
93
|
+
const e = (this.apiLibrary ?? []).map((t) => this.renderApiCategory(t)), i = e.every((t) => !t);
|
|
94
|
+
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>`;
|
|
96
95
|
}
|
|
97
96
|
}
|
|
98
|
-
m("arcgis-language-api-panel",
|
|
97
|
+
m("arcgis-language-api-panel", y);
|
|
99
98
|
export {
|
|
100
|
-
|
|
99
|
+
y as ArcgisLanguageApiPanel
|
|
101
100
|
};
|
|
@@ -9,7 +9,7 @@ import { css as h } from "@lit/reactive-element/css-tag.js";
|
|
|
9
9
|
/*!
|
|
10
10
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
11
11
|
* See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
12
|
-
* v4.32.0-next.
|
|
12
|
+
* v4.32.0-next.60
|
|
13
13
|
*/
|
|
14
14
|
const g = h`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%}}}`;
|
|
15
15
|
class f extends s {
|
|
@@ -8,7 +8,7 @@ import { css as d } from "@lit/reactive-element/css-tag.js";
|
|
|
8
8
|
/*!
|
|
9
9
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
10
10
|
* See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
11
|
-
* v4.32.0-next.
|
|
11
|
+
* v4.32.0-next.60
|
|
12
12
|
*/
|
|
13
13
|
const h = d`:host{calcite-flow{height:100%}calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}}`;
|
|
14
14
|
class f extends r {
|
package/dist/docs/api.json
CHANGED
package/dist/docs/docs.json
CHANGED
package/dist/docs/web-types.json
CHANGED
|
@@ -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.32.0-next.
|
|
4
|
+
"version": "4.32.0-next.60",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { s as p } from "./chunks/sql-expr-defaults.js";
|
|
|
4
4
|
/*!
|
|
5
5
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
6
6
|
* See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
7
|
-
* v4.32.0-next.
|
|
7
|
+
* v4.32.0-next.60
|
|
8
8
|
*/
|
|
9
9
|
const a = s, r = t;
|
|
10
10
|
export {
|
package/dist/loader.js
CHANGED
|
@@ -3,7 +3,7 @@ import { makeDefineCustomElements as i } from "@arcgis/lumina";
|
|
|
3
3
|
/*!
|
|
4
4
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
5
5
|
* See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
6
|
-
* v4.32.0-next.
|
|
6
|
+
* v4.32.0-next.60
|
|
7
7
|
*/
|
|
8
8
|
const o = i(e, {
|
|
9
9
|
"arcgis-arcade-editor": [() => import("./components/arcgis-arcade-editor/customElement.js"), "editorInstance:,editorOptions:,hideDocumentationActions,hideSideBar,openedSidePanel,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getEditorInstance,getScript,getTestResult,setFocus"],
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -29,7 +29,5 @@ export declare enum ValidationDiagnosticCodes {
|
|
|
29
29
|
InvalidIntervalQualifier = "InvalidIntervalQualifier",
|
|
30
30
|
EmptyCaseExpression = "EmptyCaseExpression"
|
|
31
31
|
}
|
|
32
|
-
export declare const DiagnosticMessages:
|
|
33
|
-
[key in ValidationDiagnosticCodes]: string;
|
|
34
|
-
};
|
|
32
|
+
export declare const DiagnosticMessages: Record<ValidationDiagnosticCodes, string>;
|
|
35
33
|
export declare const getDiagnosticMessage: (diagnosticCode: ValidationDiagnosticCodes, replacements?: Record<string, number | string>) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/coding-components",
|
|
3
|
-
"version": "4.32.0-next.
|
|
3
|
+
"version": "4.32.0-next.60",
|
|
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",
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
],
|
|
37
37
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@arcgis/arcade-languageservice": "4.32.0-next.
|
|
40
|
-
"@arcgis/components-controllers": "4.32.0-next.
|
|
41
|
-
"@arcgis/components-utils": "4.32.0-next.
|
|
42
|
-
"@arcgis/core-adapter": "4.32.0-next.
|
|
43
|
-
"@arcgis/languages-api-utils": "4.32.0-next.
|
|
44
|
-
"@arcgis/lumina": "4.32.0-next.
|
|
39
|
+
"@arcgis/arcade-languageservice": "4.32.0-next.60",
|
|
40
|
+
"@arcgis/components-controllers": "4.32.0-next.60",
|
|
41
|
+
"@arcgis/components-utils": "4.32.0-next.60",
|
|
42
|
+
"@arcgis/core-adapter": "4.32.0-next.60",
|
|
43
|
+
"@arcgis/languages-api-utils": "4.32.0-next.60",
|
|
44
|
+
"@arcgis/lumina": "4.32.0-next.60",
|
|
45
45
|
"monaco-editor": "^0.52.0",
|
|
46
46
|
"tslib": "^2.7.0",
|
|
47
47
|
"vscode-languageserver-types": "^3.17.5"
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
-
* See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
|
-
* v4.32.0-next.58
|
|
5
|
-
*/
|
|
6
|
-
import{a as b,c as r,d as _,e as n}from"./MWBB5JJ7.js";import{b as l}from"./NIC6H3IU.js";import{a as g}from"./GKFYIM5D.js";import{a as f}from"./PWAEEW7S.js";import"./QUT7CUTS.js";import{e as h,f as s,r as o,s as p,w as u}from"./6LSIDM7X.js";import{d,p as a}from"./TTS3GMIW.js";import"./YCNTHIAU.js";import"./62SSNNAO.js";var v=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 p{constructor(){super(...arguments),this.messages=g(),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=v}load(){this._colorizeStyle=r(),this._themeChangedListener=_(()=>this._colorizeStyle=r())}willUpdate(e){if(e.has("apiLibrary")){if(!this._selectedApiItem)return;for(let t of this.apiLibrary??[])for(let i of t.items)if(i.name===this._selectedApiItem.name){this._selectedApiItem=i;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(()=>{d(e.querySelector("calcite-flow-item:last-child"),"calcite-input")}),this._flowObserver.observe(e,{attributes:!0,attributeFilter:["id"],childList:!0}))}_emitItemSelected(e,t){if(!t)return;let i=e;(!i.key||i.key==="Enter")&&(e.preventDefault(),this.arcgisItemSelected.emit(t.completion.insertText??""))}_emitClose(){this.arcgisClose.emit()}_emitItemSelectedAndClose(e,t){let i=e;(!i.key||i.key==="Enter")&&(e.preventDefault(),this.arcgisItemSelected.emit(t.completion.insertText??""))}_selectItem(e,t){e.stopPropagation(),this._selectedApiItem=t}_updateFilterValue(e){this._filterValue=e.currentTarget.value??""}renderApiCategory(e){let t=f(e.items,"name",this._filterValue);return t.length?s`<calcite-list-item-group .heading=${e.title}>${t.map(i=>s`<calcite-list-item .label=${a(i.completion.detail)} @calciteListItemSelect=${c=>this._emitItemSelected(c,i)} @keydown=${c=>this._emitItemSelected(c,i)}><calcite-action slot=actions-end .text=${this.messages.expand??""} icon=chevron-right icon-flip-rtl scale=s @click=${c=>this._selectItem(c,i)}></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=${t=>this._emitItemSelectedAndClose(t,e)} ${l(t=>{t?.setFocus&&t.setFocus()})}>${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(t=>{t&&(t.innerHTML=n(e.examples),b(t).catch(console.error))})}></div>`:null}</calcite-block></calcite-flow-item>`:null}render(){let e=(this.apiLibrary??[]).map(i=>this.renderApiCategory(i)),t=e.every(i=>!i);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">${t?s`<div class="notice-container">${this.messages.noitems}</div>`:e}</calcite-list>`}</calcite-flow-item>${this.renderApiItemFlowItem()}</calcite-flow>`}};u("arcgis-language-api-panel",m);export{m as ArcgisLanguageApiPanel};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
-
* See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
|
-
* v4.32.0-next.58
|
|
5
|
-
*/
|
|
6
|
-
import{b as B,c as f,d as m,e as _}from"./X2X53W36.js";import{a as y,b as K,c as O,d as q,f as z,g as Y,h as Z,i as J,j as b}from"./EO7FSJ7P.js";import{b as H,c as X}from"./PWAEEW7S.js";import{x as R}from"./6LSIDM7X.js";import{k as G,o as P,p as U,s as v,t as $}from"./TTS3GMIW.js";import{Gl as A,Pl as V}from"./YCNTHIAU.js";async function ee(t,e){try{let i=await t,r=new Map,n=new Map,o=[],s=be(e);return i.forEach(u=>{let l=[];u.items.forEach(a=>ge(l,n,r,s,a)),l.length&&o.push({...u,items:l})}),{categories:o,functionDefinitions:r,constantDefinitions:n}}catch(i){return console.error(i),{categories:[],functionDefinitions:new Map,constantDefinitions:new Map}}}function be(t){let{profile:{apiVersion:e,bundles:i,hiddenApiItems:r=[]}={}}=t,n=te(e),o=Array.isArray(i)&&i.length>0?new Set(["core",...i]):void 0;return s=>Ce(n,s.sinceVersion)&&(!o||o.has(s.bundle))&&!r.includes(s.name)}function ge(t,e,i,r,n){if(Array.isArray(n)){n.forEach(o=>Q(t,i,r,o));return}n.type==="constant"?we(t,e,r,n):Q(t,i,r,n)}function Q(t,e,i,r){if(!i(r))return;r.disableDocumentation||t.push(r);let{completion:{label:n}}=r,o=n.toLowerCase(),s=e.get(o);s||(s={type:"functionDefinition",key:o,overloads:[]},e.set(o,s)),s.overloads.push(r)}function we(t,e,i,r){if(!i(r))return;t.push(r);let{completion:{label:n}}=r,o=n.toLowerCase();e.set(o,r);let[s,u]=r.completion.label.split(".");if(!u)return;let l=s.toLowerCase(),a=e.get(l);a||(a={type:"namespace",key:l,members:[],completion:{label:s,detail:s,insertText:s,insertTextMode:_.adjustIndentation,insertTextFormat:m.PlainText,kind:f.Enum}},e.set(l,a));let h=structuredClone(r);h.name=u,h.completion.label=u,h.completion.insertText=u,h.completion.kind=f.Constant,a.members.push(h),a.completion.documentation=a.members.reduce((d,N)=>(d.value=`${d.value}${d.value?`
|
|
7
|
-
|
|
8
|
-
`:""}**${N.completion.label}**: ${N.description}`,d),{kind:B.Markdown,value:""})}function te(t){if(!t||typeof t!="string")return null;let e=t.split(".").map(n=>Number.parseInt(n));if(e.some(Number.isNaN))return console.error("Invalid API version string",t),null;let[i,r]=e.slice(0,2);return{major:i,minor:r}}function Ce(t,e){if(!t)return!0;let i=te(e);return i?t.major>i.major?!1:t.minor===void 0||i.minor===void 0?!0:i.minor<=t.minor:!0}function pe(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&typeof t.declaredClass=="string"&&t.declaredClass.startsWith("esri.layers.")&&x(t)&&"queryFeatures"in t&&typeof t.queryFeatures=="function"}function De(t){return!!t&&typeof t=="object"&&"allLayers"in t&&"allTables"in t&&typeof t.allLayers=="object"&&typeof t.allTables=="object"}function ce(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&typeof t.declaredClass=="string"&&(t.declaredClass==="esri.Map"||t.declaredClass==="esri.WebMap"||t.declaredClass==="esri.WebScene")}function Se(t){return!!t&&typeof t=="object"&&"loadAll"in t&&typeof t.loadAll=="function"}function ue(t){return!!t&&typeof t=="object"&&"portalItem"in t&&t.portalItem!=null}function he(t){return!!t&&typeof t=="object"&&"portalItem"in t&&t.portalItem!=null}function x(t){return!!t&&typeof t=="object"&&"fields"in t&&Array.isArray(t.fields)}function I(t){return!!t&&typeof t=="object"&&"url"in t&&typeof t.url=="string"}function ve(t){return I(t)&&/\/(?:featureserver|mapserver)(?:\/|$)/iu.test(t.url)}function ze(t){return I(t)||x(t)||he(t)}function Be(t){return I(t)||x(t)||he(t)}function He(t){return ue(t)||ce(t)||ve(t)}function ie(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.layers.support.Subtype"}function L(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.layers.support.CodedValueDomain"}function Fe(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.layers.support.InheritedDomain"}function Xe(t){return!!t&&typeof t=="object"&&"id"in t&&typeof t.id=="string"&&"definitions"in t&&typeof t.definitions=="object"&&!Array.isArray(t.definitions)}function F(t){return!!t&&typeof t=="object"&&"title"in t&&typeof t.title=="string"}function Me(t){return!!t&&typeof t=="object"&&"url"in t&&typeof t.url=="string"}function de(t){return!!t&&typeof t=="object"&&"layerId"in t&&typeof t.layerId=="number"}function j(t){return!!t&&typeof t=="object"&&"typeIdField"in t&&"types"in t}function re(t){return!!t&&typeof t=="object"&&"getFieldDomain"in t&&typeof t.getFieldDomain=="function"}function g(t){return!!t&&typeof t=="object"&&"subtypeField"in t}function Te(t){return g(t)&&"subtypes"in t}function xe(t){return!!t&&typeof t=="object"&&"portalItem"in t}function Ie(t){return de(t)&&"relationships"in t&&"url"in t&&Array.isArray(t.relationships)&&typeof t.url=="string"}function Pe(t){return!!t&&typeof t=="object"&&"isTable"in t&&typeof t.isTable=="boolean"}function $e(t){return!!t&&typeof t=="object"&&"load"in t&&typeof t.load=="function"}async function fe(t){if(!t)return null;let e=null;return x(t)?e=t:e=await y(t),$e(e)&&await e.load(),e}async function Ae(t){t+="/layers";let e=await(await z())(t,{responseType:"json",query:{f:"json"}}),i=t.endsWith("MapServer/layers")?"data":"query",r=ne(e.data?.layers,i),n=ne(e.data?.tables,i);return{layers:r,tables:n}}function ne(t,e){return t?t.filter(i=>{switch(i.type){case"Feature Layer":case"Oriented Imagery Layer":case"Catalog Layer":case"Table":return(i.capabilities?i.capabilities.toLowerCase().split(",").map(r=>r.trim()):[]).includes(e);default:return!1}}):[]}async function Ve(t,e){let i=await y({url:`${t.url}/${e.relatedTableId}`});return await i.load(),i}function ye(t){return(e,i)=>{if(e.type==="oid")return-1;if(i.type==="oid")return 1;if(g(t)){if(e.name===t.subtypeField)return-1;if(i.name===t.subtypeField)return 1}if(j(t)){if(e.name===t.typeIdField)return-1;if(i.name===t.typeIdField)return 1}return e.name.localeCompare(i.name,"en",{sensitivity:"base"})}}function se(t,e){return t?.every(i=>i.domains?.[e.name]?.type==="inherited")??!1}var Le=/^[a-z_$][a-z0-9_$]*$/giu;function me(t,e=!0){return t.match(Le)?`${e?".":""}${t}`:`["${t}"]`}function _e(t,e){return t?`${t}${me(e)}`:e}function oe(t){return xe(t)?t.portalItem:null}function Ye(t,e,i=!1){let r=e,n=[],o=[];return J(t).forEach(s=>{let u=`**${s.name}**
|
|
9
|
-
${s.type}`;s.description&&(u+=`
|
|
10
|
-
'${s.description}`),r&&(r+=`
|
|
11
|
-
|
|
12
|
-
`),r+=`**${s.name}** (${s.alias})
|
|
13
|
-
${s.type}`,s.description&&(r+=`
|
|
14
|
-
'${s.description}`);let l=Z(s),a=me(s.name,!1),h=b(s);if(n.push({name:s.name,description:h,type:l,completion:{label:s.name,detail:h,insertText:a,insertTextMode:_.asIs,insertTextFormat:m.PlainText,kind:f.Field}}),i){if(!s.alias||s.alias.toLowerCase()===s.name.toLowerCase())return;let d=`**${s.alias}**
|
|
15
|
-
${s.type}`;s.description&&(d+=`
|
|
16
|
-
'${s.description}`),o.push({name:s.alias,description:s.name,type:l,completion:{label:s.alias,detail:s.name,insertText:a,insertTextMode:_.asIs,insertTextFormat:m.PlainText,kind:f.Field,documentation:{kind:"markdown",value:d}}})}}),[[...n,...o],r]}var M=class{constructor(e,i,r){this._profile=e,this._label=i,this.description=r,this.filterDescription=!1}getLabel(){return this._label==null?"":typeof this._label=="string"?U(this._label):P(this._profile?.intlStrings[this._label.code],this._label.formatValues)}getDescription(){return this.description==null?"":typeof this.description=="string"?this.description:P(this._profile?.intlStrings[this.description.code],this.description.formatValues)}passFilter(e){return!e||e.test(this.getLabel())?!0:this.filterDescription&&e.test(this.getDescription())}},w=class extends M{constructor(e){super(e.profile,e.label,e.description??e.declaration?.description),this.declaration=e.declaration??{},this.name=e.declaration?.name??"",this.snippet=e.snippet??"",this.nonInteractive=e.nonInteractive??!1,this.filterDescription=e.filterDescription??!1,this.icon=e.icon}},p=class extends w{constructor(e){super(e),this.type="text",this.isCollection=!1,this.type=e.declaration?.type??"text"}getDescription(){return this.description==null?this._profile?.intlStrings[this.type.toLowerCase()]??"":super.getDescription()}toProfileVariableDefinition(){return{type:this.type,name:"",...this.declaration}}},E=class extends w{constructor(e){super(e),this.type="array",this.isCollection=!1,this.elementType=e.declaration?.elementType??{type:"number",name:"number"}}getDescription(){return this.description==null?this._profile?.intlStrings[this.type.toLowerCase()]??"":super.getDescription()}toProfileVariableDefinition(){return{type:this.type,elementType:this.elementType,name:"",...this.declaration}}},C=class extends w{constructor(e,i){super(i),this.owner=e,this.isCollection=!0,this._loaded=!0,this.variables=[]}get breadcrumb(){if(this.owner){let e=this.owner.breadcrumb;return e?`${e} / ${this.name}`:this.name}return this.name}get loaded(){return this._loaded}get informationUrl(){return null}get informationType(){return""}},c=class extends M{constructor(e,i,r=[],n=!1){super(e,i),this.variables=r,this.isHeader=n,this.type="group",this.isCollection=!0}passFilter(){return!0}},D=class t extends C{constructor(e,i){super(e,i),this.type="dictionary",this.dictionaryVariables=[],this.loadPropertyDeclarations(i.declaration?.properties),this.snippet&&this.dictionaryVariables.length&&(this.variables=[new c(this._profile,this.snippet,this.dictionaryVariables)])}async loadSource(){}loadPropertyDeclarations(e){this.dictionaryVariables=this.createVariableInstances(e),this.variables=this.dictionaryVariables}createVariableInstances(e){if(!Array.isArray(e))return[];let i=[];return e.forEach(r=>{let n=this.createVariableInstance(r);n&&i.push(n)}),i}createVariableInstance(e){let i=_e(this.snippet,e.name);switch(e.type){case"number":case"text":case"boolean":case"date":case"dateOnly":case"time":case"geometry":case"knowledgeGraph":return new p({profile:this._profile,declaration:e,label:i,snippet:i});case"feature":return new k(this,{profile:this._profile,declaration:e,label:i,snippet:i});case"featureSet":return new S(this,{profile:this._profile,declaration:e,label:i,snippet:i},[new p({profile:this._profile,label:i,description:"",snippet:i})]);case"featureSetCollection":return new W(this,{profile:this._profile,declaration:e,label:i,snippet:i});case"dictionary":return new t(this,{profile:this._profile,declaration:e,label:i,snippet:i});case"array":return new E({profile:this._profile,declaration:e,label:i,snippet:i});default:return console.error("Editor profile: Invalid profile variable",e),null}}toProfileVariableDefinition(){return{type:this.type,name:"",...this.declaration,properties:this.dictionaryVariables.map(e=>e.toProfileVariableDefinition())}}},T=class extends C{constructor(e,i,r){super(e,i),this.relationshipsProperties=r,this._source=null,this._loaded=!1,this._definition=i.declaration?.definition}get title(){return F(this._source)?this._source.title:""}get url(){return Me(this._source)?this._source.url:""}get informationUrl(){return!this.loaded||!this.url?null:de(this._source)?`${this.url}/${this._source.layerId}`:this.url}get informationType(){return this._profile?.intlStrings.layer??"layer"}async loadSource(){return v(this._loadPromise)&&$(this._loadPromise)?await this._loadPromise:(this._loadPromise=this._loadSource(),await this._loadPromise)}_getValueSnippet(e){return this.type==="feature"?_e(this.snippet,e.name):e.name}_getSubtypeOrDomainNameSnippet(e){return this.type!=="feature"?null:g(this._source)&&e.name===this._source.subtypeField?`SubtypeName(${this.snippet})`:`DomainName(${this.snippet}, "${e.name}")`}_getFieldProperty(e){let i=this._getDomainDictionary(e);if(i)return i;let r=this._getValueSnippet(e);return new p({profile:this._profile,label:r,description:b(e),snippet:r,icon:Y(e),filterDescription:!0})}_getDomainDictionary(e){return re(this._source)?g(this._source)&&this._source.subtypeField?this._getSubtypeDomainDictionary(e):j(this._source)&&this._source.typeIdField?this._getFeatureTypeDomainDictionary(e):this._getFieldDomainDictionary(e):null}_getSubtypeDomainDictionary(e){if(!g(this._source))return null;if(!Te(this._source))return e.name===this._source.subtypeField?null:this._getFieldDomainDictionary(e);if(e.name===this._source.subtypeField){let n=this._createDomainDictionary(e);return n.icon="subtype",n.variables.push(this._getTypeOrSubtypeDomainGroup(this._source.subtypes,e)),n}if(se(this._source.subtypes,e))return this._getFieldDomainDictionary(e);let i=this._getDomainValuesGroup(this._source.subtypes,e);if(!i)return null;let r=this._createDomainDictionary(e);return r.variables.push(i),r}_getFeatureTypeDomainDictionary(e){if(!j(this._source))return null;if(e.name===this._source.typeIdField){let n=this._createDomainDictionary(e);return n.variables.push(this._getTypeOrSubtypeDomainGroup(this._source.types,e)),n}if(se(this._source.types,e))return this._getFieldDomainDictionary(e);let i=this._getDomainValuesGroup(this._source.types,e);if(!i)return null;let r=this._createDomainDictionary(e);return r.variables.push(i),r}_getFieldDomainDictionary(e){if(!re(this._source))return null;let i=this._source.getFieldDomain(e.name);if(!L(i))return null;let r=this._getCodedValueDomainGroup(i,{code:"domainvalues"}),n=this._createDomainDictionary(e);return n.variables.push(r),n}_getTypeOrSubtypeDomainGroup(e,i){if(L(i.domain))return this._getCodedValueDomainGroup(i.domain,{code:"subtypes"});let r=e?.map(n=>{let o=ie(n)?n.code:n.id;return new p({profile:this._profile,label:`${o}`,description:n.name,snippet:`"${o}"`})})??[];return new c(this._profile,{code:"subtypes"},r)}_getCodedValueDomainGroup(e,i){let r=e.codedValues.map(n=>new p({profile:this._profile,label:`${n.code}`,description:n.name,snippet:`"${n.code}"`,filterDescription:!0}));return new c(this._profile,i,r)}_getDomainValuesGroup(e,i){let r=[];return!e||e.length===0||(e.forEach(n=>{let o=n.domains?.[i.name];if(!o)return;if(Fe(o)){o=i.domain;return}if(!L(o))return;let s=b(i),u=this._getCodedValueDomainGroup(o,{code:"domainvaluesfortypeformat",formatValues:{fieldName:s,typeName:n.name}}),l=ie(n)?n.code:n.id,a=`${l}`,h=`"${l}""`,d=new D(this,{profile:this._profile,label:a,snippet:h,description:n.name,declaration:{name:s}});d.variables=[u],r.push(d)}),!r.length)?null:new c(this._profile,{code:"domainvaluesbysubtypes"},r)}_createDomainDictionary(e){let i=this._getValueSnippet(e),r=b(e),n=new D(this,{profile:this._profile,label:i,description:r,snippet:i,icon:"form-dropdown",declaration:{name:e.name}}),o=new c(this._profile,r,[new p({profile:this._profile,label:i,description:"",snippet:i})]);n.variables=[o];let s=this._getSubtypeOrDomainNameSnippet(e);return s&&o.variables.push(new p({profile:this._profile,label:s,description:"",snippet:s})),n}async _getRelationshipsProperty(){if(!this.relationshipsProperties?.exposeRelationships||!this._profile?.supportFeatureSetFunctions)return null;let e=this._source;if(!Ie(e))return null;let i=new c(this._profile,{code:"relationships"}),r=await Promise.all(e.relationships.map(async n=>{let o=await Ve(e,n);if(!pe(o)||n.relatedTableId===this.relationshipsProperties?.sourceTableId)return null;let s=`FeatureSetByRelationshipName(${this.snippet}, "${n.name}")`;return new S(this,{profile:this._profile,declaration:{definition:o},label:o.title,description:"",nonInteractive:!0},[new p({profile:this._profile,label:s,description:"",snippet:s})],{exposeRelationships:!0,sourceTableId:e.layerId})}));return i.variables=r.filter(v),i.variables.length?i:null}},k=class extends T{constructor(e,i){super(e,i,{exposeRelationships:!0}),this.type="feature"}get title(){return F(this._source)?this._source.title??"":{code:"feature"}}async _loadSource(){if(this.loaded)return this._source;try{if(this._source=await fe(this._definition),!this._source)throw new Error("Invalid definition");let e=F(this._source)?this._source.title??"":"";this.variables.push(new c(this._profile,e,[new p({profile:this._profile,label:this.snippet,description:"",snippet:this.snippet})]));let i=new c(this._profile,{code:"values"});if(this.variables.push(i),Pe(this._source)&&!this._source.isTable){let n=`Geometry(${this.snippet})`,o=new p({profile:this._profile,declaration:{name:n},label:n,description:"Geometry",snippet:n,icon:"shapes",filterDescription:!0});i.variables.push(o)}this._source.fields.sort(ye(this._source)).forEach(n=>{i.variables.push(this._getFieldProperty(n))});let r=await this._getRelationshipsProperty();r&&this.variables.push(r)}catch(e){console.error("Error with definition",e,this._definition),this._source=null}finally{this._loaded=!0}return this._source}toProfileVariableDefinition(){return{type:this.type,name:"",...this.declaration,definition:this._definition}}},S=class extends T{constructor(e,i,r=[],n){super(e,i,n),this.featureSetSnippets=r,this.type="featureSet"}get title(){return F(this._source)?this._source.title??"":{code:"featureset"}}async _loadSource(){if(this.loaded)return this._source;try{if(this._source=await fe(this._definition),!this._source)throw new Error("Invalid definition");this.variables.push(new c(this._profile,this.title,this.featureSetSnippets,!0));let e=new c(this._profile,{code:"fields"});this.variables.push(e),e.variables=this._source.fields.sort(ye(this._source)).map(r=>this._getFieldProperty(r));let i=await this._getRelationshipsProperty();i&&this.variables.push(i)}catch(e){console.error("Error with definition",e,this._definition),this._source=null}finally{this._loaded=!0}return this._source}toProfileVariableDefinition(){return{type:this.type,name:"",...this.declaration,definition:this._definition}}},W=class extends C{constructor(e,i){super(e,i),this.type="featureSetCollection",this._featureSetCollections=null,this._loaded=!1,this._definition=i.declaration?.definition}get informationUrl(){return!this.loaded||!this._featureSetCollections?null:typeof this._featureSetCollections.source!="string"?H(oe(this._featureSetCollections.source)):null}get informationType(){if(!this.loaded||!this._featureSetCollections)return"";if(typeof this._featureSetCollections.source=="string")return this._profile?.intlStrings.featureservice??"featureservice";switch(this._featureSetCollections.source.declaredClass){case"esri.WebMap":return this._profile?.intlStrings.webmap??"webmap";case"esri.WebScene":return this._profile?.intlStrings.webscene??"webscene";default:return this._profile?.intlStrings.map??"map"}}async loadSource(){return v(this._loadPromise)&&$(this._loadPromise)?await this._loadPromise:(this._loadPromise=this._loadSource(),await this._loadPromise)}async _loadSource(){if(this.loaded)return this._featureSetCollections;try{if(this._featureSetCollections=await this._featureSetCollectionsFromDefinition(),!this._featureSetCollections)throw new Error("Invalid definition");let e=typeof this._featureSetCollections.source=="string"?{code:this._featureSetCollections.source.endsWith("FeatureServer")?"featureservice":"mapservice"}:{code:"webmapformat",formatValues:{webMapTitle:oe(this._featureSetCollections.source)?.title||"Untitled map"}},i=new c(this._profile,e,[new p({profile:this._profile,label:this.snippet,description:"",snippet:this.snippet})]),r=new c(this._profile,{code:"layers"},this._featureSetCollections.layers),n=new c(this._profile,{code:"tables"},this._featureSetCollections.tables);this.variables.push(i,r,n)}catch(e){console.error("Error with definition",e,this._definition),this._featureSetCollections=null}finally{this._loaded=!0}return this._featureSetCollections}async _featureSetCollectionsFromDefinition(){return this._definition?ce(this._definition)?await this._featureSetCollectionFromMap(this._definition):I(this._definition)?await this._featureSetCollectionFromUrl(this._definition.url):ue(this._definition)?await this._featureSetCollectionFromPortalItem(this._definition.portalItem):null:null}async _featureSetCollectionFromMap(e){return Se(e)&&await e.loadAll(),await Promise.all(e.tables.map(async i=>await i.load())),{layers:this._convertWebMapLayersToVariables(e.layers),tables:this._convertWebMapLayersToVariables(e.tables,!0),source:e}}async _featureSetCollectionFromPortalItem(e){let i=await K(e);switch(await i.load(),i.type){case"Web Map":{let r=await O({portalItem:i});return await this._featureSetCollectionFromMap(r)}case"Web Scene":{let r=await q({portalItem:i});return await this._featureSetCollectionFromMap(r)}case"Feature Service":return await this._featureSetCollectionFromUrl(i.url);default:return console.error("Unsupported portal item",e),null}}async _featureSetCollectionFromUrl(e){let i=e.replace(/\/featureserver\/[0-9]*/iu,"/FeatureServer");if(i=i.replace(/\/mapserver\/[0-9]*/iu,"/MapServer"),i=i.split("?")[0],!i)return null;let r=await Ae(i),n=Promise.all(r.layers.map(async l=>{let a=await y({url:`${i}/${l.id}`});return await a.load(),this._createFeatureSetVariable(a)})),o=Promise.all(r.tables.map(async l=>{let a=await y({url:`${i}/${l.id}`});return await a.load(),this._createFeatureSetVariable(a)})),[s,u]=await Promise.all([n,o]);return{layers:s,tables:u,source:i}}_convertWebMapLayersToVariables(e,i=!1){let r=[];return e.toArray().reverse().forEach(n=>{if(pe(n)){r.push(this._createFeatureSetVariable(n,!0));return}if(De(n)){let o=i?this._convertWebMapLayersToVariables(n.allTables,!0):this._convertWebMapLayersToVariables(n.allLayers);r.push(...o)}}),r}_createFeatureSetVariable(e,i=!1){return new S(this,{profile:this._profile,declaration:{name:e.title,definition:e},label:i?e.title:e.sourceJSON.name??e.title,description:"",nonInteractive:!0},this._makeFeatureSetSnippets(e,i))}_makeFeatureSetSnippets(e,i=!1){if(!this._profile?.supportFeatureSetFunctions)return[];if(i){let r=`FeatureSetById(${this.snippet}, "${e.id}")`,n=`FeatureSetByName(${this.snippet}, "${e.title}")`;return[new p({profile:this._profile,label:r,description:"",snippet:r}),new p({profile:this._profile,label:n,description:"",snippet:n})]}else{let r=`FeatureSetById(${this.snippet}, "${e.layerId}")`;return[new p({profile:this._profile,label:r,description:"",snippet:r})]}}toProfileVariableDefinition(){return{type:this.type,name:"",...this.declaration,definition:this._definition}}},ae=class extends D{constructor(e,i,r="en"){super(void 0,{profile:null,declaration:{properties:[]}}),this.definition=e,this.intlStrings=i,this.locale=r,this.variables=[],this._profile=this,this.loadPropertyDeclarations(e?.variables)}get supportFeatureSetFunctions(){return this.definition?.bundles?.includes("data-access")??!1}toEditorProfileDefinition(){return{...this.definition,variables:this.dictionaryVariables.map(e=>e.toProfileVariableDefinition())}}},je={locale:"en"},le=class{constructor(e,i){this.languageId=e,this._apiConfig=i,this._onDidChange=new A,this._modelToProfileMap=new Map,this._modelToApiContextMap=new Map,this._localeToApiLibraryPromiseMap=new Map,this._onModelContextDidChange=new A,this._onDidModelContextChangeTimeout=-1,this.workerHost={getApiLibrary:async r=>await this.getApiLibrary(r)},X().then(r=>{r.onWillDisposeModel(n=>{this.disposeForModel(n.uri)})})}_fireModelContextDidChange(e){this._onDidModelContextChangeTimeout===-1&&(this._onDidModelContextChangeTimeout=window.setTimeout(()=>{this._onDidModelContextChangeTimeout=-1,this._onModelContextDidChange.fire(e)},0))}_getApiKey(e){return V.isUri(e)||(e=V.parse(e)),e.toString()}get onDidChange(){return this._onDidChange.event}disposeForModel(e){let i=this._getApiKey(e);this._modelToProfileMap.delete(i),this._modelToApiContextMap.delete(i)&&this._fireModelContextDidChange(i)}getEditorProfileForModel(e){return this._modelToProfileMap.get(this._getApiKey(e))}getApiContextForModel(e){return this._modelToApiContextMap.get(this._getApiKey(e))??je}updateApiContextForModel(e,i){let r=this._getApiKey(e),n=this._modelToApiContextMap.get(r)??{};this._modelToApiContextMap.set(r,{...n,...i}),this._fireModelContextDidChange(r)}get onModelContextDidChange(){return this._onModelContextDidChange.event}async getApiLibraryForModel(e){let i=this.getApiContextForModel(e),r=this.getApiLibrary(i.locale??"en");return(await ee(r,i)).categories}async fetchApiLibrary(e){try{let{apiPath:i,apiPrefix:r}=this._apiConfig,n=R(`${i}/${r}${e}.json`),o=await fetch(n);return o.ok?await o.json():[]}catch{return[]}}async getApiLibrary(e){let i=G(e);return this._localeToApiLibraryPromiseMap.has(i)||this._localeToApiLibraryPromiseMap.set(i,this.fetchApiLibrary(i)),await this._localeToApiLibraryPromiseMap.get(i)??[]}};export{ze as a,Be as b,He as c,Xe as d,Ye as e,ae as f,le as g};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
-
* See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
|
-
* v4.32.0-next.58
|
|
5
|
-
*/
|
|
6
|
-
var I=class{resolve(e){}reject(e){}constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}};function y(e,t){let r=e;for(;r;){if(r===t)return!0;if(!r.parentNode)return!1;r.parentNode instanceof ShadowRoot?r=r.parentNode.host:r=r.parentNode}return!1}function T(e,t,r){let{subscribe:n}=$(t);return n(o=>{o.some(s=>y(e,s.target))&&r()})}var h={};function $(e){let t=e.join(","),r=h[t];if(r!==void 0)return r;let n=new Set,o=new MutationObserver(s=>n.forEach(a=>a(s)));globalThis.document&&o.observe(document.documentElement,{attributes:!0,attributeFilter:e,subtree:!0});let i={subscribe(s){return n.add(s),{remove:()=>{n.delete(s),n.size===0&&(o.disconnect(),h[t]=void 0)}}}};return h[t]=i,i}function E(e,t){let r=e;for(;r;){let n=r.closest?.(t);if(n)return n;let o=r.getRootNode?.();if(o===globalThis.document)return null;r=o.host}return null}function M(e){return E(e,":is(.calcite-mode-light, .calcite-mode-dark)")?.classList.contains("calcite-mode-dark")?"dark":"light"}function j(e,t,r){return E(e,`[${t}]`)?.getAttribute(t)??r}function A(e){return e.nodeType===Node.ELEMENT_NODE}function S(e){return"setFocus"in e&&typeof e.setFocus=="function"}function u(e,t=""){if(!A(e))return!1;if(e.matches(t))return S(e)&&setTimeout(()=>e.setFocus(),0),!0;for(let n of e.children)if(u(n,t))return!0;let r=e.shadowRoot;if(r){for(let n of r.children)if(u(n,t))return!0}return!1}function U(e,t){if(!e?.shadowRoot)return;if(e.hasAttribute("hydrated")||e.hasAttribute("calcite-hydrated")){u(e,t);return}let r=new MutationObserver(()=>{r.disconnect(),u(e,t)});r.observe(e,{attributes:!0,attributeFilter:["hydrated","calcite-hydrated"]})}function V(e,t,...r){try{return e?.call(t,...r)}catch(n){console.error(n,e)}}async function _(e,t,...r){try{let n=e?.call(t,...r);return n instanceof Promise?await n:n}catch(n){console.error(n,e)}}function l(e){let t="";for(let r=0;r<e;r++)t+=((1+Math.random())*65536|0).toString(16).substring(1);return t}function q(){return[l(2),l(1),l(1),l(1),l(3)].join("-")}var C=["ar","bg","bs","ca","cs","da","de","el","en","es","et","fi","fr","he","hr","hu","id","it","ja","ko","lt","lv","nl","nb","no","pl","pt-BR","pt-PT","ro","ru","sk","sl","sr","sv","th","tr","uk","vi","zh-CN","zh-HK","zh-TW"],N=new Set(C),f="en",z={pt:"pt-PT",nb:"no",zh:"zh-CN"};async function g(e,t,r=""){let n=`${t}/${r}`,o=`${n}${e}.json`;return p[o]??(p[o]=w(e,n)),await p[o]}var p={};async function w(e,t){let r=`${t}${e}.json`;try{let n=await fetch(r);if(n.ok)return await n.json()}catch(n){return console.error(n),{}}return e===f?{}:await w(f,t)}function O(e){let t=j(e,"lang",globalThis.navigator?.language||f);return{lang:t,t9nLocale:L(t)}}function L(e){let[t,r]=e.split("-"),n=t.toLowerCase(),o=n;return r&&(o=`${n}-${r.toUpperCase()}`),o=z[o]??o,N.has(o)?o:r?L(n):f}function B(e,t,r,n){let o,i=()=>void R(e,t,n).then(s=>{(o?.lang!==s.lang||o.t9nLocale!==s.t9nLocale||o.t9nStrings!==s.t9nStrings)&&r(s),o=s}).catch(console.error);return i(),T(e,["lang"],i)}async function R(e,t,r=e.tagName.toLowerCase().split("-").slice(1).join("-")){let{lang:n,t9nLocale:o}=O(e),i=`${t}/${r}/t9n`,a=r===null?{}:await g(o,i,"messages.");if(r!==null&&Object.keys(a).length===0){let c=`${r}.t9n.`;a=await g(o,i,c)}return{lang:n,t9nLocale:o,t9nStrings:a}}var v='"',m="'";function b(e,t){return new Array(t+1).join(e)}function D(e){let t=v,r=m;e.includes(t)&&!e.includes(r)&&(r=v,t=m);let o=new RegExp(`(^|[^\\\\])((?:\\\\{2})*)((?:\\\\${r})+)`,"gu");e=e.replace(o,(s,a,c,d)=>a+c+b(r,d.length/2));let i=new RegExp(`(^|[^\\\\])((?:\\\\{2})*)(${t}+)`,"gu");return e=e.replace(i,(s,a,c,d)=>a+c+b(`\\${t}`,d.length)),t+e+t}function H(e){let t=e?e.replaceAll(/[-[\]/{}()*+?.\\^$|]/gu,"\\$&"):"^.*$";return new RegExp(t,"i")}function Q(e,t={}){return(e??"").replace(/\{(?<valueName>.*?)\}/gu,(r,n)=>t[n]??r)}function K(e){return`\u200E${e??""}\u200E`}var W=e=>e.replace(P,(t,r)=>`${r===0?"":"-"}${t.toLowerCase()}`),P=/[A-Z]+(?![a-z])|[A-Z]/gu;function Z(e,t){let r=t>k?x:t/F,n=0,o=setInterval(()=>{n+=r,n>=t&&(clearInterval(o),e())},r);return o}var k=4e3,x=2e3,F=4;function G(e){return e!==null}function J(e){return e!==void 0}function X(e,t=100){let r;return(...n)=>{let o=()=>{clearTimeout(r),e(...n)};clearTimeout(r),r=setTimeout(o,t)}}function Y(e,t,r=!1){if(!e||!t)return!1;let n=new URL(e),o=new URL(t);return!r&&n.protocol!==o.protocol||n.host==null||o.host==null?!1:n.host.toLowerCase()===o.host.toLowerCase()&&n.port===o.port}function ee(e){try{return new URL(e),!0}catch{return!1}}export{I as a,T as b,M as c,U as d,V as e,_ as f,q as g,N as h,g as i,O as j,L as k,B as l,D as m,H as n,Q as o,K as p,W as q,Z as r,G as s,J as t,X as u,Y as v,ee as w};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
-
* See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
|
-
* v4.32.0-next.58
|
|
5
|
-
*/
|
|
6
|
-
import{b as f,c as a,d as b,e as _}from"./MWBB5JJ7.js";import{b as l}from"./NIC6H3IU.js";import{a as p}from"./GKFYIM5D.js";import{a as m}from"./PWAEEW7S.js";import"./QUT7CUTS.js";import{e as d,f as s,h as c,r,s as u,w as h}from"./6LSIDM7X.js";import{d as g}from"./TTS3GMIW.js";import"./YCNTHIAU.js";import"./62SSNNAO.js";function v(o){return!Array.isArray(o)||!o.length?!1:Array.isArray(o[0].suggestions)}var $=d`: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 u{constructor(){super(...arguments),this._beforeBack=async()=>{this._selectedSuggestion=void 0},this.messages=p(),this._colorizeStyle="",this._filterValue="",this.arcgisClose=r({bubbles:!1}),this.arcgisItemSelected=r({bubbles:!1})}static{this.properties={_colorizeStyle:16,_filterValue:16,_selectedSuggestion:16,suggestions:0}}static{this.styles=$}load(){this._colorizeStyle=a(),this._themeChangedListener=b(()=>this._colorizeStyle=a())}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(()=>{g(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()}renderSuggestionGroups(){return this.suggestions===void 0?null:v(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=m(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(t=>void t?.setFocus())}>${this.messages.insert}</calcite-button><calcite-block open .heading=${e.label} .description=${e.description}><div .innerHTML=${_(e.documentation)??""}></div><pre><code ${l(t=>t===void 0?void 0:void f(t,e.code).catch(console.error))}></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>`}};h("arcgis-arcade-suggestions",n);export{n as ArcgisArcadeSuggestions};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
-
* See https://js.arcgis.com/4.32/esri/copyright.txt for details.
|
|
4
|
-
* v4.32.0-next.58
|
|
5
|
-
*/
|
|
6
|
-
import{b as f}from"./NIC6H3IU.js";import{a as u}from"./GKFYIM5D.js";import{e as d,f as i,r as a,s as h,w as m}from"./6LSIDM7X.js";import{d as c,n}from"./TTS3GMIW.js";import"./62SSNNAO.js";var g=d`: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)}}`;function b(l){l.key==="Enter"&&l.stopPropagation()}var o=class extends h{constructor(){super(...arguments),this._beforeBack=async()=>{this.removeLastPanelRenderer(),this._filterValue=""},this.messages=u(),this._filterValue="",this._flowItemRenderers=[],this._mode="profile",this._mutationCounter=1,this.loading=!1,this.arcgisClose=a({bubbles:!1}),this.arcgisItemSelected=a({bubbles:!1})}static{this.properties={_filterValue:16,_flowItemRenderers:16,_mode:16,_mutationCounter:16,loading:5,modelId:1,variable:0}}static{this.styles=g}load(){this._variableChanged()}willUpdate(e){e.has("modelId")&&(this._flowItemRenderers=[]),e.has("variable")&&this._variableChanged()}disconnectedCallback(){super.disconnectedCallback(),this._flowObserver?.disconnect()}_variableChanged(){this._mode=this.variable?.type==="featureSet"?"featureSet":"profile"}addPanelRenderer(e){this._flowItemRenderers=[...this._flowItemRenderers,e]}removeLastPanelRenderer(){this._flowItemRenderers=this._flowItemRenderers.slice(0,-1)}_isMode(e){return this._mode===e}flowFocusHandler(e){if(!e){this._flowObserver?.disconnect(),this._flowObserver=void 0;return}this._flowObserver||(this._flowObserver=new MutationObserver(()=>{c(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}_emitClose(){this.arcgisClose.emit()}_backToTop(){this._flowItemRenderers=[]}_emitItemSelected(e,t){if(t.nonInteractive)return;let s=e;(!s.key||s.key==="Enter")&&(e.preventDefault(),this.arcgisItemSelected.emit(t.snippet))}_showCollectionPanel(e,t){e.stopPropagation(),this.addPanelRenderer(s=>this.renderCollectionBasedVariable(t,!1,s))}_getHeadingForCollection(e){if(!e)return"";switch(this._mode){case"profile":return this.messages.profilevariables??"";case"featureSet":return this.messages.fields??""}}_getDescriptionForCollection(e){if(!e)return"";switch(this._mode){case"profile":return e.breadcrumb;case"featureSet":return e.variables[0]?.getLabel()??""}}renderCollectionBasedVariable(e,t=!1,s=!1){if(!e)return null;let r=this.loading;return!r&&!e.loaded&&(e.loadSource().then(()=>setTimeout(()=>{this._mutationCounter+=1})).catch(()=>{console.error("Error loading collection"),r=!1}),r=!0),i`<calcite-flow-item .heading=${this._getHeadingForCollection(e)} .description=${this._getDescriptionForCollection(e)} .beforeBack=${this._beforeBack} closable @calciteFlowItemClose=${this._emitClose} .selected=${s}><calcite-action slot=header-actions-end .text=${this.messages.backtotop??""} scale=m .hidden=${t||this._isMode("featureSet")} icon=chevrons-left icon-flip-rtl @click=${this._backToTop}></calcite-action><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${this._updateFilterValue} class="sticky" scale=m></calcite-input>${r?i`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading??""}></calcite-loader>`:i`<calcite-list label=variables>${this.renderEditorVariables(e)}</calcite-list>`}</calcite-flow-item>`}renderEditorVariables(e){let t=n(this._filterValue),s=e.variables.filter(r=>r.passFilter(t));return s.length?s.map(r=>this.renderEditorVariable(r)):i`<div class="notice-container">${this.messages.noitems}</div>`}renderEditorVariable(e){switch(e.type){case"group":return this._isMode("featureSet")&&e.isHeader?i`<calcite-list-item-group .heading=${e.getLabel()}></calcite-list-item-group>`:this._isMode("featureSet")&&e._label?.code==="fields"?this.renderEditorVariables(e):i`<calcite-list-item-group .heading=${e.getLabel()}>${this.renderEditorVariables(e)}</calcite-list-item-group>`;default:return i`<calcite-list-item .label=${e.getLabel()} .description=${e.getDescription()} @calciteListItemSelect=${t=>this._emitItemSelected(t,e)} @keydown=${t=>this._emitItemSelected(t,e)}>${e.isCollection?i`<calcite-action slot=actions-end .text=${this.messages.expand??""} scale=s icon=chevron-right icon-flip-rtl @click=${t=>this._showCollectionPanel(t,e)} @keydown=${b}></calcite-action>`:null}${e.icon?i`<calcite-icon .icon=${e.icon} scale=s slot=content-start></calcite-icon>`:null}</calcite-list-item>`}}render(){return!this.loading&&this.variable?.loaded&&!this.variable?.variables.length?i`<calcite-flow><calcite-flow-item .heading=${this.messages.profilevariables} closable @calciteFlowItemClose=${this._emitClose}><div class="notice-container">${this.messages.noprofilevariablesmessage}</div></calcite-flow-item></calcite-flow>`:i`<calcite-flow ${f(this.flowFocusHandler)}>${this.renderCollectionBasedVariable(this.variable,!0,this._flowItemRenderers.length===0)}${this._flowItemRenderers.map((e,t,s)=>e(t===s.length-1))}</calcite-flow>`}};m("arcgis-editor-variables",o);export{o as ArcgisEditorVariables};
|