@arcgis/coding-components 5.2.0-next.1 → 5.2.0-next.11
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/3QN6NREQ.js +2 -0
- package/dist/cdn/76VHPECE.js +2 -0
- package/dist/cdn/{QGBZYXBS.js → 7BIFZ5DU.js} +1 -1
- package/dist/cdn/7UTCJERR.js +2 -0
- package/dist/cdn/7Z6G332Z.js +2 -0
- package/dist/cdn/{O3PQD5N5.js → A6IGYBAZ.js} +2 -2
- package/dist/cdn/{QW7OA32G.js → B3RGPCZC.js} +1 -1
- package/dist/cdn/{CC4XBW6V.js → B73HLERI.js} +1 -1
- package/dist/cdn/BXC4G3AT.js +6 -0
- package/dist/cdn/{PUY5G6AF.js → CKBZZB5E.js} +1 -1
- package/dist/cdn/GTE3KXNK.js +2 -0
- package/dist/cdn/H2YYYWPE.js +2 -0
- package/dist/cdn/{3PBQ47BB.js → HXJFZ2Y5.js} +1 -1
- package/dist/cdn/{LZ2JU5WD.js → JLYAOSQM.js} +1 -1
- package/dist/cdn/{2DNHMHBF.js → LEFFI3FB.js} +1 -1
- package/dist/cdn/{IETP57KJ.js → MCVII2KK.js} +1 -1
- package/dist/cdn/{2WVAYBDV.js → MFDNJU3K.js} +1 -1
- package/dist/cdn/MZMKV7FA.js +2 -0
- package/dist/cdn/{LUJKYDO7.js → NCMXRX7O.js} +1 -1
- package/dist/cdn/NP37C536.js +2 -0
- package/dist/cdn/NVWQE3SF.js +2 -0
- package/dist/cdn/O6L3YJ7J.js +68 -0
- package/dist/cdn/{XU7YAUUX.js → PJBI5XFD.js} +1 -1
- package/dist/cdn/{QUR4WECO.js → PXKBNRBR.js} +1 -1
- package/dist/cdn/Q5RDW24Y.js +2 -0
- package/dist/cdn/{HRM2JUGO.js → RFQXYDLI.js} +1 -1
- package/dist/cdn/{WWVPYM5B.js → TIZLT4V3.js} +1 -1
- package/dist/cdn/UTTEHEMP.js +12 -0
- package/dist/cdn/VPVLZ5QO.js +2 -0
- package/dist/cdn/{BXEZA6TW.js → WRVJHPML.js} +1 -1
- package/dist/cdn/XJRNIBLO.js +2 -0
- package/dist/cdn/ZXEQOR2Y.js +2 -0
- package/dist/cdn/assets/arcade-language/api/arcade-api.t9n.en.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.ar.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.bg.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.bs.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.ca.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.cs.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.da.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.de.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.el.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.es.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.et.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.fi.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.fr.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.he.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.hr.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.hu.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.id.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.it.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.ja.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.ko.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.lt.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.lv.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.nl.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.no.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.pl.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.pt-BR.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.pt-PT.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.ro.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.ru.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.sk.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.sl.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.sr.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.sv.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.th.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.tr.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.uk.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.vi.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.zh-CN.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.zh-HK.json +1 -1
- package/dist/cdn/assets/arcade-language/profiles/arcade-profiles.t9n.zh-TW.json +1 -1
- package/dist/cdn/assets/code-editor/sql-expr.worker.js +2613 -2588
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/ArcadeDebuggerPreviewTabsState.js +1 -1
- package/dist/chunks/arcade-defaults.js +56 -54
- package/dist/chunks/debugger-value-components.js +51 -47
- package/dist/chunks/debugger-value-styles.js +8 -8
- package/dist/chunks/fields.js +18 -14
- package/dist/chunks/functional.js +34 -34
- package/dist/chunks/language-defaults-base.js +230 -221
- package/dist/chunks/sql-expr-defaults.js +63 -59
- package/dist/components/arcgis-arcade-debugger-console/customElement.js +7 -7
- package/dist/components/arcgis-arcade-debugger-output/customElement.js +21 -18
- package/dist/components/arcgis-arcade-editor/customElement.d.ts +38 -3
- package/dist/components/arcgis-arcade-editor/customElement.js +185 -179
- package/dist/components/arcgis-arcade-results/customElement.js +18 -18
- package/dist/components/arcgis-code-editor-shell/customElement.js +70 -65
- package/dist/components/arcgis-editor-variables/customElement.js +12 -6
- package/dist/components/arcgis-sql-expression-editor/customElement.d.ts +11 -0
- package/dist/components/arcgis-sql-expression-editor/customElement.js +5 -5
- package/dist/components/arcgis-sql-layer-editor/customElement.js +10 -10
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/vscode.html-custom-data.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/loader.js +3 -3
- package/dist/types/lumina.d.ts +1 -1
- package/dist/types/preact.d.ts +1 -1
- package/dist/types/react.d.ts +1 -1
- package/dist/types/stencil.d.ts +1 -1
- package/package.json +8 -8
- package/dist/cdn/3CHKFCKR.js +0 -2
- package/dist/cdn/3UD4JSPW.js +0 -2
- package/dist/cdn/4G3EYLJY.js +0 -2
- package/dist/cdn/4N67XYKO.js +0 -2
- package/dist/cdn/6QMGBWXM.js +0 -2
- package/dist/cdn/72E5GBWN.js +0 -68
- package/dist/cdn/B5A6XU2C.js +0 -2
- package/dist/cdn/CA3GVMWI.js +0 -2
- package/dist/cdn/CQTJWVFM.js +0 -6
- package/dist/cdn/G5IXPOCO.js +0 -2
- package/dist/cdn/P3LG4UGD.js +0 -2
- package/dist/cdn/RMVHO2AH.js +0 -12
- package/dist/cdn/RO6RHW6I.js +0 -2
- package/dist/cdn/TQDN6SR5.js +0 -2
- package/dist/cdn/TWEJITWD.js +0 -2
- package/dist/cdn/ZTCCL565.js +0 -2
|
@@ -1,50 +1,54 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { i as c, b as
|
|
3
|
-
import { CompletionItemKind as
|
|
4
|
-
import { f as
|
|
5
|
-
import { fetchT9nStringsBundle as
|
|
6
|
-
import { g as
|
|
7
|
-
const
|
|
2
|
+
import { i as c, b as P } from "./utils.js";
|
|
3
|
+
import { CompletionItemKind as h, InsertTextFormat as g, InsertTextMode as F } from "vscode-languageserver-types";
|
|
4
|
+
import { f as b, L as w, E as x } from "./language-defaults-base.js";
|
|
5
|
+
import { fetchT9nStringsBundle as E } from "@arcgis/toolkit/intl";
|
|
6
|
+
import { g as M } from "./runtime.js";
|
|
7
|
+
const A = {
|
|
8
8
|
allowAllRootBinaryOperators: !1,
|
|
9
9
|
requiresPredicateRootNode: !1
|
|
10
10
|
}, d = {
|
|
11
|
-
"field-calculation":
|
|
11
|
+
"field-calculation": A,
|
|
12
12
|
"where-clause": {
|
|
13
13
|
allowAllRootBinaryOperators: !0,
|
|
14
|
-
requiresPredicateRootNode: !0
|
|
14
|
+
requiresPredicateRootNode: !0,
|
|
15
|
+
allowGeometryFields: !0
|
|
15
16
|
}
|
|
16
17
|
};
|
|
17
|
-
function
|
|
18
|
+
function v(o) {
|
|
18
19
|
return o && o in d ? d[o] : void 0;
|
|
19
20
|
}
|
|
20
21
|
const q = (o) => {
|
|
21
|
-
const
|
|
22
|
+
const r = o.variables[0], t = r?.type === "featureSet" ? T(r) : void 0, { apiVersion: e, bundles: i, hiddenApiItems: s } = o.toEditorProfileDefinition();
|
|
22
23
|
return {
|
|
23
|
-
apiVersion:
|
|
24
|
-
bundles:
|
|
25
|
-
variables:
|
|
24
|
+
apiVersion: e,
|
|
25
|
+
bundles: i,
|
|
26
|
+
variables: t ? [t] : [],
|
|
26
27
|
hiddenApiItems: s?.map((a) => a.toLowerCase())
|
|
27
28
|
};
|
|
28
29
|
};
|
|
29
30
|
function T(o) {
|
|
30
|
-
const { name:
|
|
31
|
-
label:
|
|
32
|
-
detail:
|
|
33
|
-
insertText:
|
|
34
|
-
insertTextMode:
|
|
31
|
+
const { name: r } = o, t = o.getDescription(), { definition: e } = o.toProfileVariableDefinition(), i = {
|
|
32
|
+
label: r,
|
|
33
|
+
detail: r,
|
|
34
|
+
insertText: r,
|
|
35
|
+
insertTextMode: F.asIs,
|
|
35
36
|
insertTextFormat: g.PlainText,
|
|
36
|
-
kind:
|
|
37
|
+
kind: h.Field
|
|
37
38
|
}, s = {
|
|
38
|
-
name:
|
|
39
|
-
description:
|
|
39
|
+
name: r,
|
|
40
|
+
description: t,
|
|
40
41
|
type: "dictionary",
|
|
41
42
|
properties: [],
|
|
42
|
-
completion:
|
|
43
|
+
completion: i
|
|
43
44
|
};
|
|
44
|
-
if (!
|
|
45
|
+
if (!e || !("fields" in e))
|
|
45
46
|
return s;
|
|
46
|
-
const [a, l] =
|
|
47
|
-
|
|
47
|
+
const [a, l] = b(e.fields, t, {
|
|
48
|
+
includeAliases: !1,
|
|
49
|
+
supportGeometryFields: !0
|
|
50
|
+
});
|
|
51
|
+
return s.properties = a, i.documentation = { kind: "markdown", value: l }, s;
|
|
48
52
|
}
|
|
49
53
|
const u = [
|
|
50
54
|
{
|
|
@@ -68,27 +72,27 @@ function L(o) {
|
|
|
68
72
|
function S(o) {
|
|
69
73
|
if (!c(o))
|
|
70
74
|
return;
|
|
71
|
-
const
|
|
75
|
+
const r = L(
|
|
72
76
|
o.id
|
|
73
77
|
/*locale*/
|
|
74
78
|
);
|
|
75
|
-
if (!
|
|
79
|
+
if (!r)
|
|
76
80
|
return;
|
|
77
|
-
const
|
|
81
|
+
const t = {
|
|
78
82
|
variables: [],
|
|
79
|
-
hiddenApiItems: o.hiddenApiItems?.map((
|
|
83
|
+
hiddenApiItems: o.hiddenApiItems?.map((e) => e.toLowerCase())
|
|
80
84
|
};
|
|
81
|
-
return
|
|
82
|
-
if (o.disabledVariables?.includes(
|
|
85
|
+
return r.variables.forEach((e) => {
|
|
86
|
+
if (o.disabledVariables?.includes(e.name))
|
|
83
87
|
return;
|
|
84
|
-
const
|
|
85
|
-
if (
|
|
86
|
-
return
|
|
87
|
-
throw Error(`sdkVariable type not supported (yet) type: ${
|
|
88
|
-
}),
|
|
88
|
+
const i = o.definitions[e.name];
|
|
89
|
+
if (e.type === "featureSet")
|
|
90
|
+
return P(i) ? t.variables.push({ ...e, type: e.type, definition: i }) : void 0;
|
|
91
|
+
throw Error(`sdkVariable type not supported (yet) type: ${e.type}`);
|
|
92
|
+
}), t;
|
|
89
93
|
}
|
|
90
94
|
const f = "arcgis-sql-expression";
|
|
91
|
-
class _ extends
|
|
95
|
+
class _ extends w {
|
|
92
96
|
constructor() {
|
|
93
97
|
super(f, {
|
|
94
98
|
apiPath: "./assets/sql-language/api",
|
|
@@ -96,42 +100,42 @@ class _ extends F {
|
|
|
96
100
|
}), this._languageId = f, this._layerMap = /* @__PURE__ */ new Map();
|
|
97
101
|
}
|
|
98
102
|
// TODO: try to rely on editor profile instance instead of storing a feature layer
|
|
99
|
-
updateFeatureLayerForModel(
|
|
100
|
-
const
|
|
101
|
-
this._layerMap.set(
|
|
103
|
+
updateFeatureLayerForModel(r, t) {
|
|
104
|
+
const e = this._getApiKey(r);
|
|
105
|
+
this._layerMap.set(e, t);
|
|
102
106
|
}
|
|
103
|
-
getFeatureLayerForModel(
|
|
104
|
-
const
|
|
105
|
-
return this._layerMap.get(
|
|
107
|
+
getFeatureLayerForModel(r) {
|
|
108
|
+
const t = this._getApiKey(r);
|
|
109
|
+
return this._layerMap.get(t);
|
|
106
110
|
}
|
|
107
|
-
async setProfileForModel(
|
|
108
|
-
const
|
|
109
|
-
c(
|
|
110
|
-
const s = await
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
async setProfileForModel(r, t, e = { locale: "en" }) {
|
|
112
|
+
const i = c(t) ? v(t.id) : void 0;
|
|
113
|
+
c(t) && (t = S(t));
|
|
114
|
+
const s = await E(
|
|
115
|
+
e.locale,
|
|
116
|
+
M("./assets/editor-profile/t9n"),
|
|
113
117
|
"messages."
|
|
114
118
|
);
|
|
115
119
|
if (!s)
|
|
116
|
-
throw new Error(`Failed to load the language bundle for ${
|
|
117
|
-
this.disposeForModel(
|
|
118
|
-
const a = this._getApiKey(
|
|
120
|
+
throw new Error(`Failed to load the language bundle for ${e.locale}`);
|
|
121
|
+
this.disposeForModel(r);
|
|
122
|
+
const a = this._getApiKey(r), l = new x(t, s, e.locale, i);
|
|
119
123
|
this._modelToProfileMap.set(a, l);
|
|
120
124
|
const y = q(l);
|
|
121
|
-
this.updateApiContextForModel(
|
|
122
|
-
locale:
|
|
125
|
+
this.updateApiContextForModel(r, {
|
|
126
|
+
locale: e.locale,
|
|
123
127
|
profile: y,
|
|
124
|
-
...
|
|
128
|
+
...i ? { profilePolicy: i } : {}
|
|
125
129
|
});
|
|
126
|
-
const p =
|
|
127
|
-
p && this.updateFeatureLayerForModel(
|
|
130
|
+
const p = t?.variables?.find((m) => m.name === "$layer");
|
|
131
|
+
p && this.updateFeatureLayerForModel(r, p.definition);
|
|
128
132
|
}
|
|
129
133
|
}
|
|
130
|
-
const n = new _(),
|
|
134
|
+
const n = new _(), $ = {
|
|
131
135
|
setProfileForModel: n.setProfileForModel.bind(n),
|
|
132
136
|
getApiLibraryForModel: n.getApiLibraryForModel.bind(n)
|
|
133
137
|
};
|
|
134
138
|
export {
|
|
135
139
|
n as a,
|
|
136
|
-
|
|
140
|
+
$ as s
|
|
137
141
|
};
|
|
@@ -7,8 +7,8 @@ import { u as x } from "../../chunks/useT9n.js";
|
|
|
7
7
|
import { load as S } from "@arcgis/lumina/controllers";
|
|
8
8
|
import { i as $ } from "../../chunks/monaco-importer.js";
|
|
9
9
|
import { t as l } from "../../chunks/functional.js";
|
|
10
|
-
import { d as k, g as y, c as
|
|
11
|
-
import { i as
|
|
10
|
+
import { d as k, g as y, c as h } from "../../chunks/debugger-value-styles.js";
|
|
11
|
+
import { i as m, a as P, p as T, b as E, c as L, d as C, S as M, D as B, e as V } from "../../chunks/debugger-value-components.js";
|
|
12
12
|
import { observeAncestorsMutation as z, unsafeGetCalciteModeName as I } from "@arcgis/toolkit/dom";
|
|
13
13
|
import { generateGuid as A } from "@arcgis/toolkit/string";
|
|
14
14
|
import { d as p } from "../../chunks/ArcadeDebuggerPreviewTabsState.js";
|
|
@@ -49,7 +49,7 @@ class N extends f {
|
|
|
49
49
|
return t ? t.getLineContent(e) : "";
|
|
50
50
|
}
|
|
51
51
|
updateTheme() {
|
|
52
|
-
I(this.el) === "dark" ? this.elementInternals.states.add(
|
|
52
|
+
I(this.el) === "dark" ? this.elementInternals.states.add(h) : this.elementInternals.states.delete(h);
|
|
53
53
|
}
|
|
54
54
|
getBreakpointCode(e) {
|
|
55
55
|
return e == null ? this.messages.nocontent ?? "No content" : this.getContentAtLine(e) || (this.messages.nocontent ?? "No content");
|
|
@@ -71,7 +71,7 @@ class N extends f {
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
getExpandedDebuggerMap(e) {
|
|
74
|
-
if (e == null || !
|
|
74
|
+
if (e == null || !m(e))
|
|
75
75
|
return null;
|
|
76
76
|
const t = e.expand();
|
|
77
77
|
return Array.isArray(t) ? null : t;
|
|
@@ -83,7 +83,7 @@ class N extends f {
|
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
85
|
getExpandedDebuggerChild(e, t) {
|
|
86
|
-
if (!e || !
|
|
86
|
+
if (!e || !m(e))
|
|
87
87
|
return;
|
|
88
88
|
const a = e.expand();
|
|
89
89
|
if (Array.isArray(a)) {
|
|
@@ -207,8 +207,8 @@ class N extends f {
|
|
|
207
207
|
return r`<calcite-tabs><calcite-tab-nav slot=title-group><calcite-tab-title .tab=${p} .selected=${e === p} @calciteTabsActivate=${(t) => this.activateTab(t.target.tab)}>${this.messages.scope ?? "Scope"}</calcite-tab-title>${g(this.previewTabsState.tabs, (t) => `title-${t.id}`, (t) => r`<calcite-tab-title .tab=${t.id} title=${t.label ?? b} closable .selected=${e === t.id} @calciteTabsActivate=${(a) => this.activateTab(a.target.tab)} @calciteTabsClose=${(a) => this.closePreviewTab(a.target)}><bdi>${t.title}</bdi></calcite-tab-title>`)}</calcite-tab-nav><calcite-tab .tab=${p} .selected=${e === p}><div class="tab-panel">${this.renderScopePanel()}</div></calcite-tab>${g(this.previewTabsState.tabs, (t) => `panel-${t.id}`, (t) => r`<calcite-tab .tab=${t.id} .selected=${e === t.id}><div class="tab-panel preview-panel">${this.renderPreviewPanel(t)}</div></calcite-tab>`)}</calcite-tabs>`;
|
|
208
208
|
}
|
|
209
209
|
render() {
|
|
210
|
-
const { line: e } = this.debuggerStore?.executionState ?? {}, t = this.breakpoints.find((i) => i.line === e), a = this.breakpoints.findIndex((i) => i.line === e);
|
|
211
|
-
return r`<div class="console-shell"
|
|
210
|
+
const { line: e } = this.debuggerStore?.executionState ?? {}, t = e ? this.breakpoints.find((i) => i.line === e) : this.breakpoints[0], a = e ? this.breakpoints.findIndex((i) => i.line === e) : 0;
|
|
211
|
+
return r`<div class="console-shell">${this.breakpoints.length && r`<div class="breakpoint-header"><arcgis-code-viewer language=arcade class="breakpoint-code-viewer" .lineNumbers=${(i) => String(i + (t?.line ?? e ?? 1) - 1)}>${this.getBreakpointCode(t?.line ?? this.breakpoints[0]?.line ?? e ?? 1)}</arcgis-code-viewer>${this.breakpoints.length ? r`<calcite-action id=${this._breakpointPopoverId ?? b} scale=s .text=${this.getBreakpointPositionText(a >= 0 ? a + 1 : 1)} text-enabled icon=chevron-down></calcite-action>` : null}${this.renderBreakpointPopover(t?.line ?? e)}</div>` || ""}<div class="tabs-container">${this.renderTabs()}</div></div>`;
|
|
212
212
|
}
|
|
213
213
|
}
|
|
214
214
|
v("arcgis-arcade-debugger-console", N);
|
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
3
|
-
import { css as l, html as
|
|
4
|
-
import { LitElement as
|
|
5
|
-
import { u as
|
|
6
|
-
import { d as
|
|
7
|
-
import { observeAncestorsMutation as
|
|
8
|
-
import { D as m } from "../../chunks/debugger-value-components.js";
|
|
9
|
-
const
|
|
10
|
-
|
|
2
|
+
import { c as i } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as l, html as a } from "lit";
|
|
4
|
+
import { LitElement as o } from "@arcgis/lumina";
|
|
5
|
+
import { u as c } from "../../chunks/useT9n.js";
|
|
6
|
+
import { d as u, g as n, c as r, t as s } from "../../chunks/debugger-value-styles.js";
|
|
7
|
+
import { observeAncestorsMutation as d, unsafeGetCalciteModeName as g } from "@arcgis/toolkit/dom";
|
|
8
|
+
import { D as m, i as p, f as h, a as b, b as f } from "../../chunks/debugger-value-components.js";
|
|
9
|
+
const T = l`:host{display:flex;flex-direction:column;width:100%;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);--calcite-block-padding: var(--calcite-spacing-sm);overflow:auto;calcite-flow{height:100%}.disabled-state-text{font-size:var(--calcite-font-size-sm);color:var(--calcite-color-text-3);font-style:italic;display:block;margin:var(--calcite-spacing-md)}[class*=result-value-]{line-height:1.25rem}}`;
|
|
10
|
+
function v(t, e) {
|
|
11
|
+
return p(t) || h(t) || b(t) || f(t) ? e ?? "Output" : t.arcadeType;
|
|
12
|
+
}
|
|
13
|
+
class y extends o {
|
|
11
14
|
constructor() {
|
|
12
|
-
super(...arguments), this.messages =
|
|
15
|
+
super(...arguments), this.messages = c();
|
|
13
16
|
}
|
|
14
17
|
static {
|
|
15
|
-
this.properties = { debuggerStore: 0, result: 0 };
|
|
18
|
+
this.properties = { debuggerStore: 0, result: 0, outputTitle: 1 };
|
|
16
19
|
}
|
|
17
20
|
static {
|
|
18
|
-
this.styles = [
|
|
21
|
+
this.styles = [T, u, n()];
|
|
19
22
|
}
|
|
20
23
|
load() {
|
|
21
24
|
this.manager.onLifecycle(() => {
|
|
22
|
-
const e =
|
|
25
|
+
const e = d(this.el, ["class"], this.updateTheme.bind(this));
|
|
23
26
|
return this.updateTheme(), () => e();
|
|
24
27
|
});
|
|
25
28
|
}
|
|
@@ -27,16 +30,16 @@ class h extends i {
|
|
|
27
30
|
e.has("result") && this.result && this.debuggerStore?.lazyTreeState.reset();
|
|
28
31
|
}
|
|
29
32
|
updateTheme() {
|
|
30
|
-
|
|
33
|
+
g(this.el) === "dark" ? this.elementInternals.states.add(r) : this.elementInternals.states.delete(r);
|
|
31
34
|
}
|
|
32
35
|
render() {
|
|
33
36
|
if (!this.result)
|
|
34
|
-
return
|
|
37
|
+
return a`<span class="disabled-state-text">${this.messages.nooutput ?? "No output available."}</span>`;
|
|
35
38
|
const e = this.debuggerStore?.lazyTreeState;
|
|
36
|
-
return e ?
|
|
39
|
+
return e ? a`<calcite-tree .scale=${s.scale} @calciteTreeSelect=${s.oncalciteTreeSelect} .lines=${s.lines} .selectionMode=${s.selectionMode}>${m({ expanded: !0, name: v(this.result, this.outputTitle), value: this.result, messages: this.messages, path: this.result.arcadeType, lazyTreeState: e })}</calcite-tree>` : a`<span class="disabled-state-text">${this.messages.nooutput ?? "No output available."}</span>`;
|
|
37
40
|
}
|
|
38
41
|
}
|
|
39
|
-
|
|
42
|
+
i("arcgis-arcade-debugger-output", y);
|
|
40
43
|
export {
|
|
41
|
-
|
|
44
|
+
y as ArcgisArcadeDebuggerOutput
|
|
42
45
|
};
|
|
@@ -26,8 +26,19 @@ import type { T9nMeta } from "@arcgis/lumina/controllers";
|
|
|
26
26
|
* - [Suggestions and code completion](https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/discover-the-arcade-editors-powerful-new-features/#suggestions-and-code-completion)
|
|
27
27
|
* - [WCAG 2.0 compliant code colorization / syntax highlighting](https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/accessibility-and-arcade-working-in-color/)
|
|
28
28
|
* - Built-in [keyboard shortcuts](https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/discover-the-arcade-editors-powerful-new-features/#keyboard-shortcuts)
|
|
29
|
-
* - In-editor help for finding information about profile variables relevant to your profile, documentation for constants and functions, a link to the official Arcade documentation, and, in some case, suggestions
|
|
29
|
+
* - In-editor help for finding information about profile variables relevant to your profile, documentation for constants and functions, a link to the official Arcade documentation, and, in some case, suggestions
|
|
30
30
|
* - Support for many [languages and directionality](https://developers.arcgis.com/javascript/latest/localization/)
|
|
31
|
+
* - A debugger with support for breakpoints, stepping, and an interactive console
|
|
32
|
+
* - An [AI Assistant](https://doc.arcgis.com/en/arcgis-online/create-maps/understand-arcade-assistant.htm) that uses natural language
|
|
33
|
+
* processing to generate Arcade expressions from scratch or find and fix errors in your code
|
|
34
|
+
*
|
|
35
|
+
* The Arcade editor and some of the underlying core Arcade language functions depend on esriConfig properties. To ensure the best experience for your users,
|
|
36
|
+
* make sure to set the following:
|
|
37
|
+
* - [esriConfig.applicationName](https://developers.arcgis.com/javascript/latest/references/core/config/#Config-applicationName)
|
|
38
|
+
* - Used by the [GetEnvironment()](https://developers.arcgis.com/arcade/function-reference/debugging_functions/#getenvironment) Arcade function
|
|
39
|
+
* - Associates feedback to the Arcade assistant with a specific application
|
|
40
|
+
* - [esriConfig.portalUrl](https://developers.arcgis.com/javascript/latest/references/core/config/#Config-portalUrl)
|
|
41
|
+
* - Required for the Arcade assistant to function, as the assistant relies on ArcGIS Online services
|
|
31
42
|
*/
|
|
32
43
|
export abstract class ArcgisArcadeEditor extends LitElement {
|
|
33
44
|
/**
|
|
@@ -45,9 +56,30 @@ export abstract class ArcgisArcadeEditor extends LitElement {
|
|
|
45
56
|
*/
|
|
46
57
|
accessor customPanels: ICustomPanel[] | undefined;
|
|
47
58
|
/**
|
|
48
|
-
*
|
|
59
|
+
* When set to `true`, hides the Arcade assistant (beta) panel and disables all related features.
|
|
60
|
+
* The Arcade assistant (beta) panel includes a question/answer UX that allows
|
|
61
|
+
* users to ask the assistant to generate Arcade expressions from natural language prompts, or to find and fix errors in their code.
|
|
62
|
+
*
|
|
63
|
+
* The Arcade assistant (beta) will only be available if the following conditions are met:
|
|
64
|
+
* - The `disableAssistant` property is `false`
|
|
65
|
+
* - The [esriConfig.portalUrl](https://developers.arcgis.com/javascript/latest/references/core/config/#Config-portalUrl) is set to an ArcGIS Online portal (either the default or a custom one)
|
|
66
|
+
* - The user is signed in to the portal. The application exposing the editor must handle user authentication.
|
|
67
|
+
* - The signed in user has permissions to use AI features in ArcGIS Online, including the following conditions:
|
|
68
|
+
* - The user's organization allows use of AI assistants,
|
|
69
|
+
* - The user's role has the "Use AI assistants" privilege enabled, and
|
|
70
|
+
* - Beta features are enabled for the user's organization
|
|
71
|
+
*
|
|
72
|
+
* The assistant also provides the ability for users to submit feedback on generated responses, which may be used to improve the assistant's performance over time.
|
|
73
|
+
* When feedback is logged, it is associated with the application exposing the Arcade editor. It is best practice to set
|
|
74
|
+
* [esriConfig.applicationName](https://developers.arcgis.com/javascript/latest/references/core/config/#Config-applicationName) so the feedback can be associated with a specific application.
|
|
75
|
+
*
|
|
76
|
+
* More information about the Arcade assistant, including best practices, the context provided to the underlying model, limitations,
|
|
77
|
+
* and transparency cards can be found in the links below.
|
|
49
78
|
*
|
|
50
79
|
* @default false
|
|
80
|
+
* @since 5.1
|
|
81
|
+
* @see [Arcade assistant user documentation](https://doc.arcgis.com/en/arcgis-online/create-maps/understand-arcade-assistant.htm)
|
|
82
|
+
* @see [Arcade assistant best practices and limitations](https://doc.arcgis.com/en/arcgis-online/create-maps/use-arcade-assistant.htm)
|
|
51
83
|
*/
|
|
52
84
|
accessor disableAssistant: boolean;
|
|
53
85
|
/**
|
|
@@ -63,9 +95,12 @@ export abstract class ArcgisArcadeEditor extends LitElement {
|
|
|
63
95
|
*/
|
|
64
96
|
accessor editorOptions: (Editor.IEditorOptions & Editor.IGlobalEditorOptions) | undefined;
|
|
65
97
|
/**
|
|
66
|
-
*
|
|
98
|
+
* If `true`, the editor will enable a debug drawer at the bottom of the editor. This drawer
|
|
99
|
+
* includes debugging features such as the ability to set breakpoints, step through code,
|
|
100
|
+
* and view variable values during execution.
|
|
67
101
|
*
|
|
68
102
|
* @default false
|
|
103
|
+
* @since 5.1
|
|
69
104
|
*/
|
|
70
105
|
accessor enableDebugger: boolean;
|
|
71
106
|
/**
|