@arcgis/coding-components 5.2.0-next.3 → 5.2.0-next.30
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/{IETP57KJ.js → 35PM76LN.js} +1 -1
- package/dist/cdn/46DUY6LF.js +6 -0
- package/dist/cdn/5RWI53UM.js +2 -0
- package/dist/cdn/6R2FXATY.js +2 -0
- package/dist/cdn/76VHPECE.js +2 -0
- package/dist/cdn/{Q2EZ6DGG.js → 7RQSIZ7E.js} +1 -1
- package/dist/cdn/7UTCJERR.js +2 -0
- package/dist/cdn/7Z6G332Z.js +2 -0
- package/dist/cdn/{CC4XBW6V.js → B73HLERI.js} +1 -1
- package/dist/cdn/BCXSPP2P.js +2 -0
- package/dist/cdn/{3PBQ47BB.js → BGTP5CFY.js} +1 -1
- package/dist/cdn/{OLNYBWUC.js → BZWB7A55.js} +1 -1
- package/dist/cdn/{PUY5G6AF.js → CKBZZB5E.js} +1 -1
- package/dist/cdn/DD277QPZ.js +2 -0
- package/dist/cdn/{O5XRLNCX.js → DTRK3XAL.js} +1 -1
- package/dist/cdn/{HRM2JUGO.js → EYE5UNR2.js} +1 -1
- package/dist/cdn/GTE3KXNK.js +2 -0
- package/dist/cdn/{QUR4WECO.js → H46YVJ4O.js} +1 -1
- package/dist/cdn/JF5ISPMG.js +2 -0
- package/dist/cdn/{LZ2JU5WD.js → JLYAOSQM.js} +1 -1
- package/dist/cdn/{QW7OA32G.js → L7T34NYP.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/P22DALGG.js +2 -0
- package/dist/cdn/{XU7YAUUX.js → PJBI5XFD.js} +1 -1
- package/dist/cdn/S4UOB65K.js +2 -0
- package/dist/cdn/{O3PQD5N5.js → TUQ7FMSM.js} +2 -2
- package/dist/cdn/{2DNHMHBF.js → VEOKKZ5A.js} +1 -1
- package/dist/cdn/{WWVPYM5B.js → XSXVHUIH.js} +1 -1
- package/dist/cdn/{CPITVSFM.js → YTISJUMJ.js} +1 -1
- package/dist/cdn/YYX73IRV.js +4 -0
- package/dist/cdn/ZJADYRM6.js +12 -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/arcade.worker.js +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 +66 -63
- 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-coding-assistant/customElement.js +5 -6
- 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 +226 -205
- package/dist/components/arcgis-arcade-results/customElement.js +19 -18
- package/dist/components/arcgis-code-editor-shell/customElement.js +70 -65
- package/dist/components/arcgis-editor-variables/customElement.js +16 -10
- package/dist/components/arcgis-language-api-panel/customElement.js +9 -9
- 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/components/types.d.ts +139 -22
- 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/BXEZA6TW.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/QGBZYXBS.js +0 -4
- 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,38 +1,38 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.2/LICENSE.txt */
|
|
2
2
|
import { g as Z, c as ee } from "../../chunks/runtime.js";
|
|
3
|
-
import { css as te, html as d, nothing as
|
|
3
|
+
import { css as te, html as d, nothing as z } from "lit";
|
|
4
4
|
import { i as se } from "../../chunks/monaco-importer.js";
|
|
5
|
-
import { LitElement as ie, createEvent as N, safeClassMap as
|
|
5
|
+
import { LitElement as ie, createEvent as N, safeClassMap as v } from "@arcgis/lumina";
|
|
6
6
|
import { generateGuid as ae } from "@arcgis/toolkit/string";
|
|
7
|
-
import { i as
|
|
8
|
-
import { s as
|
|
9
|
-
import { b as
|
|
10
|
-
import { setArcadeAskAiBinding as
|
|
7
|
+
import { i as y, D as ne, e as K } from "../../chunks/arcade-executor.js";
|
|
8
|
+
import { s as oe, a as re } from "../../chunks/arcade-service-accessors.js";
|
|
9
|
+
import { b as $ } from "../../chunks/arcade-defaults.js";
|
|
10
|
+
import { setArcadeAskAiBinding as B, arcadeAskAiCommandId as ce, arcadeQuickFixKind as le } from "../../chunks/arcade-mode.js";
|
|
11
11
|
import { u as de } from "../../chunks/useT9n.js";
|
|
12
|
-
import { createRef as
|
|
12
|
+
import { createRef as H, ref as j } from "lit/directives/ref.js";
|
|
13
13
|
import { load as ue } from "@arcgis/lumina/controllers";
|
|
14
14
|
import he from "@arcgis/core/config.js";
|
|
15
|
-
import
|
|
15
|
+
import Q from "@arcgis/core/identity/IdentityManager.js";
|
|
16
16
|
import { log as ge, rethrowError as u } from "@arcgis/toolkit/log";
|
|
17
|
-
import { watch as
|
|
18
|
-
import
|
|
19
|
-
import { property as
|
|
20
|
-
import { A as
|
|
17
|
+
import { watch as L } from "@arcgis/core/core/reactiveUtils.js";
|
|
18
|
+
import f from "@arcgis/core/core/Accessor.js";
|
|
19
|
+
import { property as c, subclass as x } from "@arcgis/core/core/accessorSupport/decorators.js";
|
|
20
|
+
import { A as W } from "../../chunks/ArcadeDebuggerPreviewTabsState.js";
|
|
21
21
|
import { r as pe } from "../../chunks/utilities.js";
|
|
22
22
|
import { Range as V, KeyCode as be, Uri as _e } from "monaco-editor";
|
|
23
|
-
const me = te`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}.main-action-bar{calcite-action-group{padding-inline-end:var(--calcite-spacing-sm)}calcite-action-group calcite-action{padding-inline-end:var(--calcite-spacing-sm)}calcite-action-group 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)}}.bottom-action-bar.is-collapsed{border-bottom:0}`, G = "https://services6.arcgis.com/HXHga6CfMLMBOlBX/ArcGIS/rest/services/survey123_6e349a50b4504ca6b6107216d568db5f_form/FeatureServer/0", h = (t, e) => {
|
|
23
|
+
const me = te`:host{height:100%}calcite-tooltip:not([calcite-hydrated])>*{display:none}.main-action-bar{calcite-action-group{padding-inline-end:var(--calcite-spacing-sm)}calcite-action-group calcite-action{padding-inline-end:var(--calcite-spacing-sm)}calcite-action-group 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)}}.bottom-action-bar.is-collapsed{border-bottom:0}.bottom-action-bar{display:flex;.bottom-action-bar__actions{flex:1 1 auto;min-inline-size:0}}`, G = "https://services6.arcgis.com/HXHga6CfMLMBOlBX/ArcGIS/rest/services/survey123_6e349a50b4504ca6b6107216d568db5f_form/FeatureServer/0", h = (t, e) => {
|
|
24
24
|
ge(t, "Arcade Assistant", e);
|
|
25
|
-
},
|
|
25
|
+
}, X = [
|
|
26
26
|
"orgAiAssistantsEnabled",
|
|
27
27
|
"betaAppsAllowed",
|
|
28
28
|
"serviceUrlAvailable",
|
|
29
29
|
"userHasUseAiAssistantsPrivilege"
|
|
30
|
-
], fe =
|
|
30
|
+
], fe = X, q = (t, e) => e.every((s) => t[s] === !0), xe = (t) => {
|
|
31
31
|
const { aiAssistantsEnabled: e } = t;
|
|
32
32
|
return e === void 0 ? (h("warn", "`areAiAssistantsEnabled` is not defined in the organizations settings."), !1) : e;
|
|
33
|
-
}, Se = async (t) => (await
|
|
33
|
+
}, Se = async (t) => (await Q.getCredential(t, { oAuthPopupConfirmation: !1 })).token, Ae = async (t) => {
|
|
34
34
|
try {
|
|
35
|
-
return !!await
|
|
35
|
+
return !!await Q.checkSignInStatus(t);
|
|
36
36
|
} catch {
|
|
37
37
|
return h("warn", "User is not signed in."), !1;
|
|
38
38
|
}
|
|
@@ -48,86 +48,86 @@ async function Pe({
|
|
|
48
48
|
if (!e)
|
|
49
49
|
return h("warn", "Arcade Assistant initialization failed. Reason: missing portal url."), { shouldRender: !1 };
|
|
50
50
|
const s = e.replace(/\/sharing\/rest(\/.*)?$/iu, "").replace(/\/$/u, "");
|
|
51
|
-
if (!await
|
|
51
|
+
if (!await Ae(s))
|
|
52
52
|
return { shouldRender: !1 };
|
|
53
|
-
const a = await Se(e), r = `${s}/sharing/rest/portals/self?f=json&token=${a}`, n = `${s}/sharing/rest/portals/self/settings?f=json&token=${a}`,
|
|
54
|
-
fetch(r, { credentials: "include" }).then((
|
|
55
|
-
fetch(n, { credentials: "include" }).then((
|
|
56
|
-
fetch(
|
|
57
|
-
]), [
|
|
53
|
+
const a = await Se(e), r = `${s}/sharing/rest/portals/self?f=json&token=${a}`, n = `${s}/sharing/rest/portals/self/settings?f=json&token=${a}`, o = `${s}/sharing/rest/portals/self/signinSettings?f=json&token=${a}`, b = await Promise.allSettled([
|
|
54
|
+
fetch(r, { credentials: "include" }).then((P) => P.json()),
|
|
55
|
+
fetch(n, { credentials: "include" }).then((P) => P.json()),
|
|
56
|
+
fetch(o, { credentials: "include" }).then((P) => P.json())
|
|
57
|
+
]), [S, R, I] = b, A = S.status === "fulfilled" ? S.value : (h("warn", `Failed to fetch selfUrl. Reason: ${S.reason}.`), {}), T = R.status === "fulfilled" ? R.value : (h("warn", `Failed to fetch settingsUrl. Reason: ${R.reason}.`), {}), J = I.status === "fulfilled" ? I.value : (h("warn", `Failed to fetch signinSettingsUrl. Reason: ${I.reason}.`), {});
|
|
58
58
|
if (A.isPortal)
|
|
59
59
|
return { shouldRender: !1 };
|
|
60
|
-
const
|
|
61
|
-
if (!
|
|
60
|
+
const M = A.helpBase || "";
|
|
61
|
+
if (!T)
|
|
62
62
|
return h("warn", "Settings response is not available."), { shouldRender: !1 };
|
|
63
|
-
const
|
|
64
|
-
orgAiAssistantsEnabled:
|
|
63
|
+
const k = {
|
|
64
|
+
orgAiAssistantsEnabled: xe(T),
|
|
65
65
|
betaAppsAllowed: J.blockBetaApps !== !0,
|
|
66
66
|
serviceUrlAvailable: !!A?.helperServices?.aiAssistantServices?.url,
|
|
67
67
|
userHasUseAiAssistantsPrivilege: A?.user?.privileges?.includes("portal:user:useAIAssistants") === !0
|
|
68
68
|
};
|
|
69
|
-
|
|
69
|
+
k.betaAppsAllowed || h(
|
|
70
70
|
"warn",
|
|
71
71
|
"Arcade Assistant is blocked by the organization settings. To enable it, do not block beta apps in the organization settings."
|
|
72
|
-
),
|
|
73
|
-
const
|
|
74
|
-
return
|
|
72
|
+
), k.userHasUseAiAssistantsPrivilege || h("warn", "User does not have the required privileges to use AI Assistants.");
|
|
73
|
+
const F = q(k, fe), U = q(k, X), O = A?.helperServices?.aiAssistantServices?.url;
|
|
74
|
+
return O ? {
|
|
75
75
|
shouldRender: !0,
|
|
76
76
|
portalUrl: e,
|
|
77
77
|
availableFeatures: {
|
|
78
|
-
codeActions:
|
|
79
|
-
prompting:
|
|
78
|
+
codeActions: F,
|
|
79
|
+
prompting: U
|
|
80
80
|
},
|
|
81
|
-
serviceUrl:
|
|
82
|
-
helpBase:
|
|
81
|
+
serviceUrl: O,
|
|
82
|
+
helpBase: M,
|
|
83
83
|
feedbackServiceUrl: G
|
|
84
84
|
} : {
|
|
85
85
|
shouldRender: !0,
|
|
86
86
|
portalUrl: e,
|
|
87
87
|
availableFeatures: {
|
|
88
|
-
codeActions:
|
|
89
|
-
prompting:
|
|
88
|
+
codeActions: F,
|
|
89
|
+
prompting: U
|
|
90
90
|
},
|
|
91
|
-
helpBase:
|
|
91
|
+
helpBase: M,
|
|
92
92
|
feedbackServiceUrl: G
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
|
-
var ve = Object.defineProperty,
|
|
96
|
-
for (var a = i > 1 ? void 0 : i ?
|
|
95
|
+
var ve = Object.defineProperty, $e = Object.getOwnPropertyDescriptor, m = (t, e, s, i) => {
|
|
96
|
+
for (var a = i > 1 ? void 0 : i ? $e(e, s) : e, r = t.length - 1, n; r >= 0; r--)
|
|
97
97
|
(n = t[r]) && (a = (i ? n(e, s, a) : n(a)) || a);
|
|
98
98
|
return i && a && ve(e, s, a), a;
|
|
99
99
|
};
|
|
100
|
-
const
|
|
101
|
-
let g = class extends
|
|
100
|
+
const Y = 100;
|
|
101
|
+
let g = class extends f {
|
|
102
102
|
constructor(t) {
|
|
103
|
-
super(t), this.collectionItems = [], this.errorMessage = "", this.expanded = !1, this.requestId = 0, this.status = "idle", this.visibleChildCount =
|
|
103
|
+
super(t), this.collectionItems = [], this.errorMessage = "", this.expanded = !1, this.requestId = 0, this.status = "idle", this.visibleChildCount = Y;
|
|
104
104
|
}
|
|
105
105
|
};
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
m([
|
|
107
|
+
c()
|
|
108
108
|
], g.prototype, "collectionItems", 2);
|
|
109
|
-
|
|
110
|
-
|
|
109
|
+
m([
|
|
110
|
+
c()
|
|
111
111
|
], g.prototype, "errorMessage", 2);
|
|
112
|
-
|
|
113
|
-
|
|
112
|
+
m([
|
|
113
|
+
c()
|
|
114
114
|
], g.prototype, "expanded", 2);
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
m([
|
|
116
|
+
c()
|
|
117
117
|
], g.prototype, "requestId", 2);
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
m([
|
|
119
|
+
c()
|
|
120
120
|
], g.prototype, "schemaValue", 2);
|
|
121
|
-
|
|
122
|
-
|
|
121
|
+
m([
|
|
122
|
+
c()
|
|
123
123
|
], g.prototype, "status", 2);
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
m([
|
|
125
|
+
c()
|
|
126
126
|
], g.prototype, "visibleChildCount", 2);
|
|
127
|
-
g =
|
|
128
|
-
|
|
127
|
+
g = m([
|
|
128
|
+
x("ArcadeDebuggerLazyTreeNodeState")
|
|
129
129
|
], g);
|
|
130
|
-
let
|
|
130
|
+
let C = class extends f {
|
|
131
131
|
constructor(t) {
|
|
132
132
|
super(t), this.generation = 0, this.nodes = /* @__PURE__ */ new Map();
|
|
133
133
|
}
|
|
@@ -151,7 +151,7 @@ let w = class extends m {
|
|
|
151
151
|
}
|
|
152
152
|
showMore(t, e) {
|
|
153
153
|
const s = this.ensureNode(t);
|
|
154
|
-
s.visibleChildCount >= e || (s.visibleChildCount = Math.min(e, s.visibleChildCount +
|
|
154
|
+
s.visibleChildCount >= e || (s.visibleChildCount = Math.min(e, s.visibleChildCount + Y));
|
|
155
155
|
}
|
|
156
156
|
loadNode(t, e) {
|
|
157
157
|
switch (e.kind) {
|
|
@@ -173,8 +173,8 @@ let w = class extends m {
|
|
|
173
173
|
return;
|
|
174
174
|
const a = this.generation, r = i.requestId + 1;
|
|
175
175
|
i.requestId = r, i.status = "loading", i.errorMessage = "", i.schemaValue = void 0, i.collectionItems = [], e().then((n) => {
|
|
176
|
-
const
|
|
177
|
-
!
|
|
176
|
+
const o = this.nodes.get(t);
|
|
177
|
+
!o || this.generation !== a || o.requestId !== r || (s(o, n), o.status = "loaded");
|
|
178
178
|
}).catch(() => {
|
|
179
179
|
const n = this.nodes.get(t);
|
|
180
180
|
!n || this.generation !== a || n.requestId !== r || (n.status = "error");
|
|
@@ -186,15 +186,15 @@ let w = class extends m {
|
|
|
186
186
|
this.nodes.clear();
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
],
|
|
192
|
-
var
|
|
189
|
+
C = m([
|
|
190
|
+
x("ArcadeDebuggerLazyTreeState")
|
|
191
|
+
], C);
|
|
192
|
+
var ye = Object.defineProperty, Ee = Object.getOwnPropertyDescriptor, l = (t, e, s, i) => {
|
|
193
193
|
for (var a = i > 1 ? void 0 : i ? Ee(e, s) : e, r = t.length - 1, n; r >= 0; r--)
|
|
194
194
|
(n = t[r]) && (a = (i ? n(e, s, a) : n(a)) || a);
|
|
195
|
-
return i && a &&
|
|
195
|
+
return i && a && ye(e, s, a), a;
|
|
196
196
|
};
|
|
197
|
-
let
|
|
197
|
+
let _ = class extends f {
|
|
198
198
|
constructor(t) {
|
|
199
199
|
super(t), this.phase = "idle", this.sessionId = 0, this.consoleLogs = [], this.hasExecuted = !1;
|
|
200
200
|
}
|
|
@@ -218,62 +218,68 @@ let b = class extends m {
|
|
|
218
218
|
}
|
|
219
219
|
};
|
|
220
220
|
l([
|
|
221
|
-
|
|
222
|
-
],
|
|
221
|
+
c()
|
|
222
|
+
], _.prototype, "phase", 2);
|
|
223
223
|
l([
|
|
224
|
-
|
|
225
|
-
],
|
|
224
|
+
c()
|
|
225
|
+
], _.prototype, "mode", 2);
|
|
226
226
|
l([
|
|
227
|
-
|
|
228
|
-
],
|
|
227
|
+
c()
|
|
228
|
+
], _.prototype, "sessionId", 2);
|
|
229
229
|
l([
|
|
230
|
-
|
|
231
|
-
],
|
|
230
|
+
c()
|
|
231
|
+
], _.prototype, "result", 2);
|
|
232
232
|
l([
|
|
233
|
-
|
|
234
|
-
],
|
|
233
|
+
c()
|
|
234
|
+
], _.prototype, "consoleLogs", 2);
|
|
235
235
|
l([
|
|
236
|
-
|
|
237
|
-
],
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
],
|
|
241
|
-
let
|
|
236
|
+
c()
|
|
237
|
+
], _.prototype, "hasExecuted", 2);
|
|
238
|
+
_ = l([
|
|
239
|
+
x("ArcadeDebuggerExecutionModel")
|
|
240
|
+
], _);
|
|
241
|
+
let E = class extends f {
|
|
242
242
|
constructor(t) {
|
|
243
|
-
super(t), this.
|
|
243
|
+
super(t), this.editorBreakpoints = [], this.executionBreakpoints = [];
|
|
244
244
|
}
|
|
245
|
-
setBreakpoints(t) {
|
|
246
|
-
this.
|
|
245
|
+
setBreakpoints(t, e) {
|
|
246
|
+
t === "editor" ? this.editorBreakpoints = Array.from(new Set(e)).sort((s, i) => s - i) : this.executionBreakpoints = Array.from(new Set(e)).sort((s, i) => s - i);
|
|
247
247
|
}
|
|
248
|
-
toggleBreakpoint(t) {
|
|
249
|
-
const
|
|
250
|
-
|
|
248
|
+
toggleBreakpoint(t, e) {
|
|
249
|
+
const s = new Set(t === "editor" ? this.editorBreakpoints : this.executionBreakpoints);
|
|
250
|
+
s.has(e) ? s.delete(e) : s.add(e), this.setBreakpoints(t, s);
|
|
251
251
|
}
|
|
252
|
-
clearBreakpoints() {
|
|
253
|
-
this.
|
|
252
|
+
clearBreakpoints(t) {
|
|
253
|
+
t === "editor" ? this.editorBreakpoints = [] : this.executionBreakpoints = [];
|
|
254
|
+
}
|
|
255
|
+
syncExecutionBreakpointsFromEditor() {
|
|
256
|
+
this.executionBreakpoints = this.editorBreakpoints;
|
|
254
257
|
}
|
|
255
258
|
};
|
|
256
259
|
l([
|
|
257
|
-
|
|
258
|
-
],
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
],
|
|
262
|
-
|
|
260
|
+
c()
|
|
261
|
+
], E.prototype, "editorBreakpoints", 2);
|
|
262
|
+
l([
|
|
263
|
+
c()
|
|
264
|
+
], E.prototype, "executionBreakpoints", 2);
|
|
265
|
+
E = l([
|
|
266
|
+
x("ArcadeDebuggerSessionModel")
|
|
267
|
+
], E);
|
|
268
|
+
let D = class extends f {
|
|
263
269
|
constructor(t) {
|
|
264
270
|
super(t), this.openedPanel = "output", this.showPanel = !1;
|
|
265
271
|
}
|
|
266
272
|
};
|
|
267
273
|
l([
|
|
268
|
-
|
|
269
|
-
],
|
|
274
|
+
c()
|
|
275
|
+
], D.prototype, "openedPanel", 2);
|
|
270
276
|
l([
|
|
271
|
-
|
|
272
|
-
],
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
],
|
|
276
|
-
let
|
|
277
|
+
c()
|
|
278
|
+
], D.prototype, "showPanel", 2);
|
|
279
|
+
D = l([
|
|
280
|
+
x("ArcadeDebuggerUiModel")
|
|
281
|
+
], D);
|
|
282
|
+
let w = class extends f {
|
|
277
283
|
constructor(t) {
|
|
278
284
|
super(t);
|
|
279
285
|
}
|
|
@@ -291,23 +297,27 @@ let $ = class extends m {
|
|
|
291
297
|
}
|
|
292
298
|
};
|
|
293
299
|
l([
|
|
294
|
-
|
|
295
|
-
],
|
|
300
|
+
c()
|
|
301
|
+
], w.prototype, "pausedState", 2);
|
|
296
302
|
l([
|
|
297
|
-
|
|
298
|
-
],
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
],
|
|
302
|
-
let p = class extends
|
|
303
|
+
c()
|
|
304
|
+
], w.prototype, "lastPausedState", 2);
|
|
305
|
+
w = l([
|
|
306
|
+
x("ArcadeDebuggerPausedFrameModel")
|
|
307
|
+
], w);
|
|
308
|
+
let p = class extends f {
|
|
303
309
|
constructor(t) {
|
|
304
|
-
super(t), this.execution = new
|
|
310
|
+
super(t), this.execution = new _(), this.lazyTreeState = new C(), this.pausedFrame = new w(), this.previewTabsState = new W(), this.session = new E(), this.ui = new D();
|
|
305
311
|
}
|
|
306
|
-
get
|
|
307
|
-
return this.session.
|
|
312
|
+
get editorBreakpoints() {
|
|
313
|
+
return this.session.editorBreakpoints;
|
|
308
314
|
}
|
|
315
|
+
/** The "displayed" breakpoints within the console. depends on if the debugger is paused or not */
|
|
309
316
|
get debuggerBreakpoints() {
|
|
310
|
-
return this.session.
|
|
317
|
+
return this.isPaused ? this.session.executionBreakpoints.map((t) => ({ line: t })) : this.session.editorBreakpoints.map((t) => ({ line: t }));
|
|
318
|
+
}
|
|
319
|
+
get executionBreakpoints() {
|
|
320
|
+
return this.session.executionBreakpoints;
|
|
311
321
|
}
|
|
312
322
|
get consoleLogs() {
|
|
313
323
|
return this.execution.consoleLogs;
|
|
@@ -368,8 +378,8 @@ let p = class extends m {
|
|
|
368
378
|
addConsoleLog(t) {
|
|
369
379
|
this.execution.addConsoleLog(t);
|
|
370
380
|
}
|
|
371
|
-
clearBreakpoints() {
|
|
372
|
-
this.session.clearBreakpoints();
|
|
381
|
+
clearBreakpoints(t) {
|
|
382
|
+
this.session.clearBreakpoints(t);
|
|
373
383
|
}
|
|
374
384
|
clearForMissingTestData() {
|
|
375
385
|
this.stopDebug({ hidePanel: !0 }), this.execution.hasExecuted = !1, this.execution.result = void 0;
|
|
@@ -381,14 +391,14 @@ let p = class extends m {
|
|
|
381
391
|
this.execution.mode = "debug", this.execution.result = { resultType: "debug", result: t }, this.execution.phase = "completed", this.ui.openedPanel = "output", this.pausedFrame.reset(), this.resetTransientDebuggerState();
|
|
382
392
|
}
|
|
383
393
|
completeRun(t, e = {}) {
|
|
384
|
-
this.execution.mode = "run", !e.useDebugRenderer &&
|
|
394
|
+
this.execution.mode = "run", !e.useDebugRenderer && y(t) ? this.execution.result = { resultType: "run", result: t } : e.useDebugRenderer && !y(t) && (this.execution.result = { resultType: "debug", result: t }), this.execution.phase = "completed", this.pausedFrame.reset(), this.ui.openedPanel = "output", this.resetTransientDebuggerState();
|
|
385
395
|
}
|
|
386
396
|
continueDebug() {
|
|
387
397
|
const t = this.pausedFrame.pausedState?.continue;
|
|
388
398
|
t && (this.execution.phase = "debug-running", this.pausedFrame.clearPausedState(), t.resolve());
|
|
389
399
|
}
|
|
390
400
|
disableDebugger() {
|
|
391
|
-
this.stopDebug({ hidePanel: !0 }), this.clearBreakpoints();
|
|
401
|
+
this.stopDebug({ hidePanel: !0 }), this.clearBreakpoints("execution"), this.clearBreakpoints("editor");
|
|
392
402
|
}
|
|
393
403
|
fail(t) {
|
|
394
404
|
this.completeRun(t);
|
|
@@ -398,7 +408,7 @@ let p = class extends m {
|
|
|
398
408
|
this.syncPausedState(e, t), this.pausedFrame.setPausedState(t), this.execution.phase = "debug-paused";
|
|
399
409
|
}
|
|
400
410
|
reset() {
|
|
401
|
-
this.execution.phase = "idle", this.execution.mode = void 0, this.execution.result = void 0, this.execution.consoleLogs = [], this.execution.hasExecuted = !1, this.execution.sessionId = 0, this.ui.openedPanel = "output", this.ui.showPanel = !1, this.pausedFrame.reset(), this.
|
|
411
|
+
this.execution.phase = "idle", this.execution.mode = void 0, this.execution.result = void 0, this.execution.consoleLogs = [], this.execution.hasExecuted = !1, this.execution.sessionId = 0, this.ui.openedPanel = "output", this.ui.showPanel = !1, this.pausedFrame.reset(), this.clearBreakpoints("execution"), this.clearBreakpoints("editor"), this.replaceTransientDebuggerState();
|
|
402
412
|
}
|
|
403
413
|
resetDebug() {
|
|
404
414
|
this.stopDebug({ hidePanel: !1 }), this.execution.result = void 0, this.execution.consoleLogs = [], this.ui.openedPanel = "debug-console";
|
|
@@ -407,13 +417,13 @@ let p = class extends m {
|
|
|
407
417
|
this.stopDebug({ hidePanel: !0 });
|
|
408
418
|
}
|
|
409
419
|
setBreakpoints(t) {
|
|
410
|
-
this.session.setBreakpoints(t);
|
|
420
|
+
this.session.setBreakpoints("editor", t);
|
|
411
421
|
}
|
|
412
422
|
setPanel(t) {
|
|
413
423
|
this.execution.hasExecuted && (this.ui.openedPanel = t, this.ui.showPanel = !0);
|
|
414
424
|
}
|
|
415
425
|
startDebug() {
|
|
416
|
-
return this.execution.mode = "debug", this.execution.phase = "debug-running", this.execution.hasExecuted = !0, this.execution.result = void 0, this.execution.consoleLogs = [], this.ui.openedPanel = "debug-console", this.ui.showPanel = !0, this.execution.sessionId += 1, this.pausedFrame.reset(), this.replaceTransientDebuggerState(), this.execution.sessionId;
|
|
426
|
+
return this.execution.mode = "debug", this.execution.phase = "debug-running", this.execution.hasExecuted = !0, this.execution.result = void 0, this.session.syncExecutionBreakpointsFromEditor(), this.execution.consoleLogs = [], this.ui.openedPanel = "debug-console", this.ui.showPanel = !0, this.execution.sessionId += 1, this.pausedFrame.reset(), this.replaceTransientDebuggerState(), this.execution.sessionId;
|
|
417
427
|
}
|
|
418
428
|
startRun() {
|
|
419
429
|
return this.execution.mode = "run", this.execution.phase = "running", this.execution.hasExecuted = !0, this.execution.result = void 0, this.execution.consoleLogs = [], this.ui.openedPanel = "output", this.ui.showPanel = !0, this.execution.sessionId += 1, this.pausedFrame.reset(), this.replaceTransientDebuggerState(), this.execution.sessionId;
|
|
@@ -430,7 +440,7 @@ let p = class extends m {
|
|
|
430
440
|
this.lazyTreeState.reset(), t && e && t !== e && this.previewTabsState.invalidateAll(), this.pausedLine = e?.line;
|
|
431
441
|
}
|
|
432
442
|
toggleBreakpoint(t) {
|
|
433
|
-
this.session.toggleBreakpoint(t);
|
|
443
|
+
this.session.toggleBreakpoint("editor", t);
|
|
434
444
|
}
|
|
435
445
|
togglePanel(t) {
|
|
436
446
|
if (this.execution.hasExecuted) {
|
|
@@ -449,32 +459,32 @@ let p = class extends m {
|
|
|
449
459
|
this.pausedLine = void 0, this.lazyTreeState.reset(), this.previewTabsState.clear();
|
|
450
460
|
}
|
|
451
461
|
replaceTransientDebuggerState() {
|
|
452
|
-
this.pausedLine = void 0, this.lazyTreeState = new
|
|
462
|
+
this.pausedLine = void 0, this.lazyTreeState = new C(), this.previewTabsState = new W();
|
|
453
463
|
}
|
|
454
464
|
};
|
|
455
465
|
l([
|
|
456
|
-
|
|
466
|
+
c()
|
|
457
467
|
], p.prototype, "execution", 2);
|
|
458
468
|
l([
|
|
459
|
-
|
|
469
|
+
c()
|
|
460
470
|
], p.prototype, "lazyTreeState", 2);
|
|
461
471
|
l([
|
|
462
|
-
|
|
472
|
+
c()
|
|
463
473
|
], p.prototype, "pausedLine", 2);
|
|
464
474
|
l([
|
|
465
|
-
|
|
475
|
+
c()
|
|
466
476
|
], p.prototype, "pausedFrame", 2);
|
|
467
477
|
l([
|
|
468
|
-
|
|
478
|
+
c()
|
|
469
479
|
], p.prototype, "previewTabsState", 2);
|
|
470
480
|
l([
|
|
471
|
-
|
|
481
|
+
c()
|
|
472
482
|
], p.prototype, "session", 2);
|
|
473
483
|
l([
|
|
474
|
-
|
|
484
|
+
c()
|
|
475
485
|
], p.prototype, "ui", 2);
|
|
476
486
|
p = l([
|
|
477
|
-
|
|
487
|
+
x("ArcadeDebuggerStore")
|
|
478
488
|
], p);
|
|
479
489
|
const De = {
|
|
480
490
|
glyphMargin: !0,
|
|
@@ -482,7 +492,7 @@ const De = {
|
|
|
482
492
|
};
|
|
483
493
|
class we extends ie {
|
|
484
494
|
constructor() {
|
|
485
|
-
super(...arguments), this._codeEditorElt =
|
|
495
|
+
super(...arguments), this._codeEditorElt = H(), this._arcadeAssistantElt = H(), this._componentReadyDefer = Promise.withResolvers(), this._disposables = [], this._editorProfilePromise = Promise.resolve(void 0), this._debuggerState = new p(), this.messages = de(), this._modelId = ae(), this._openArcadeHelp = () => {
|
|
486
496
|
window.open(ne, "Arcade Help");
|
|
487
497
|
}, this._decorations = void 0, this._monacoEditor = ue(se), this._editorOptions = {}, this._toggleSidePanel = (e) => {
|
|
488
498
|
e.currentTarget instanceof HTMLElement && this._setOpenedSidePanel(e.currentTarget.dataset.panelName ?? "none");
|
|
@@ -492,11 +502,13 @@ class we extends ie {
|
|
|
492
502
|
const e = this.editorInstance;
|
|
493
503
|
if (!e)
|
|
494
504
|
return;
|
|
495
|
-
const s = this._debuggerState.
|
|
505
|
+
const s = this._debuggerState.editorBreakpoints.map((i) => ({
|
|
496
506
|
range: new V(i, 1, i, 1),
|
|
497
507
|
options: {
|
|
498
508
|
isWholeLine: !0,
|
|
499
|
-
glyphMarginClassName: "arcgis-code-editor__breakpoint-glyph"
|
|
509
|
+
glyphMarginClassName: "arcgis-code-editor__breakpoint-glyph",
|
|
510
|
+
// keeps decoration at the same line when typing at the edges of the line or the range gets collapsed. essentially keeps breakpoint decoration as a single-line
|
|
511
|
+
stickiness: this._monacoEditor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges
|
|
500
512
|
}
|
|
501
513
|
}));
|
|
502
514
|
this._decorations?.clear(), this._decorations = e.createDecorationsCollection(s);
|
|
@@ -510,8 +522,11 @@ class we extends ie {
|
|
|
510
522
|
static {
|
|
511
523
|
this.styles = [me];
|
|
512
524
|
}
|
|
525
|
+
get _canExecute() {
|
|
526
|
+
return !!(this.testData || this.externalExecutor);
|
|
527
|
+
}
|
|
513
528
|
get _usesBottomExecutionDrawer() {
|
|
514
|
-
return this.
|
|
529
|
+
return this._canExecute && (this.enableDebugger || !!this.externalExecutor);
|
|
515
530
|
}
|
|
516
531
|
get editorInstance() {
|
|
517
532
|
return this._codeEditorElt.value?.editorInstance;
|
|
@@ -532,8 +547,8 @@ class we extends ie {
|
|
|
532
547
|
if (!e)
|
|
533
548
|
return { type: "error", value: "Missing editor profile", error: null };
|
|
534
549
|
await this._componentReadyDefer.promise;
|
|
535
|
-
const s = this._codeEditorElt.value?.value, i = await
|
|
536
|
-
return
|
|
550
|
+
const s = this._codeEditorElt.value?.value, i = await K(e.definition, s, this.testData, { mode: "run" });
|
|
551
|
+
return y(i) ? i : { type: "error", value: "Unexpected debug result", error: null };
|
|
537
552
|
}
|
|
538
553
|
async setFocus() {
|
|
539
554
|
await this._componentReadyDefer.promise, await this._codeEditorElt.value?.setFocus();
|
|
@@ -548,19 +563,19 @@ class we extends ie {
|
|
|
548
563
|
}
|
|
549
564
|
async load() {
|
|
550
565
|
const e = Z("./assets");
|
|
551
|
-
|
|
552
|
-
for (this._askAiBindingKey && (
|
|
566
|
+
oe(e), await this._updateDataModelDeps(), this.manager.onLifecycle(() => (this.hasUpdated && this._connectMonacoCustomizations().catch(u(this)), () => {
|
|
567
|
+
for (this._askAiBindingKey && (B(this._askAiBindingKey, void 0), this._askAiBindingKey = void 0); this._disposables.length; )
|
|
553
568
|
this._disposables.pop()?.dispose();
|
|
554
569
|
this._abortExternalExecution(), this._connectMonacoCustomizationsPromise = void 0, this._executeScriptAction = void 0, this._clearDebuggerDecorations(), this._debuggerState.disconnect();
|
|
555
570
|
}));
|
|
556
571
|
}
|
|
557
572
|
willUpdate(e) {
|
|
558
|
-
(e.has("messages") || e.has("profile")) && this._updateDataModelDeps(), e.has("testData") && this.
|
|
573
|
+
(e.has("messages") || e.has("profile")) && this._updateDataModelDeps(), (e.has("testData") || e.has("externalExecutor")) && this._executionContextChanged(), e.has("enableDebugger") && !this.enableDebugger && this._debuggerState.disableDebugger(), e.has("snippets") && $.updateApiContextForModel(this._modelId, {
|
|
559
574
|
snippets: this.snippets
|
|
560
575
|
}), (e.has("arcadeAssistant") || e.has("disableAssistant")) && this._updateArcadeAssistantRemoteState();
|
|
561
576
|
}
|
|
562
577
|
async loaded() {
|
|
563
|
-
await this._connectMonacoCustomizations(), this._componentReadyDefer.resolve()
|
|
578
|
+
await this._connectMonacoCustomizations(), this._componentReadyDefer.resolve();
|
|
564
579
|
}
|
|
565
580
|
_setOpenedSidePanel(e) {
|
|
566
581
|
this.openedSidePanel = e === this.openedSidePanel ? "none" : e;
|
|
@@ -571,15 +586,15 @@ class we extends ie {
|
|
|
571
586
|
this._connectMonacoCustomizationsPromise = (async () => {
|
|
572
587
|
if (!this.isConnected)
|
|
573
588
|
return;
|
|
574
|
-
const e = await
|
|
575
|
-
this._disposables.push(e.onDiagnosticsChange((
|
|
576
|
-
this._preparingArcade || (this._diagnostics =
|
|
577
|
-
})), this.
|
|
578
|
-
const s =
|
|
589
|
+
const e = await re();
|
|
590
|
+
this._disposables.push(e.onDiagnosticsChange((o) => {
|
|
591
|
+
this._preparingArcade || (this._diagnostics = o.diagnostics, this.arcgisDiagnosticsChange.emit(o.diagnostics));
|
|
592
|
+
})), this._canExecute && !this._executeScriptAction && this._addExecuteScriptAction(), this._syncAskAiAction();
|
|
593
|
+
const s = L(() => this._debuggerState.editorBreakpoints, () => this._updateBreakpointsDecorations(), { sync: !0 }), i = L(() => this._debuggerState.debuggerLine, () => this._updateDebuggerPausedLineDecoration(), { sync: !0 }), a = L(() => this._debuggerState.consoleLogs.length, () => this.requestUpdate(), { sync: !0 });
|
|
579
594
|
this._disposables.push({ dispose: () => s.remove() }, { dispose: () => i.remove() }, { dispose: () => a.remove() });
|
|
580
|
-
const r = this.editorInstance?.onMouseDown((
|
|
595
|
+
const r = this.editorInstance?.onMouseDown((o) => this._onEditorMouseDown(o));
|
|
581
596
|
r && this._disposables.push(r);
|
|
582
|
-
const n = this.editorInstance?.onDidChangeModelContent((
|
|
597
|
+
const n = this.editorInstance?.onDidChangeModelContent((o) => this._onEditorModelContentChange(o));
|
|
583
598
|
n && this._disposables.push(n), this._updateBreakpointsDecorations(), this._updateDebuggerPausedLineDecoration();
|
|
584
599
|
})();
|
|
585
600
|
try {
|
|
@@ -589,20 +604,16 @@ class we extends ie {
|
|
|
589
604
|
}
|
|
590
605
|
}
|
|
591
606
|
_onEditorMouseDown(e) {
|
|
592
|
-
if (!this.enableDebugger || ![
|
|
593
|
-
this._monacoEditor.MouseTargetType.GUTTER_GLYPH_MARGIN,
|
|
594
|
-
this._monacoEditor.MouseTargetType.GUTTER_LINE_NUMBERS,
|
|
595
|
-
this._monacoEditor.MouseTargetType.GUTTER_LINE_DECORATIONS
|
|
596
|
-
].includes(e.target.type))
|
|
607
|
+
if (!this.enableDebugger || ![this._monacoEditor.MouseTargetType.GUTTER_GLYPH_MARGIN].includes(e.target.type) || e.target.element?.classList.contains("codicon-gutter-lightbulb"))
|
|
597
608
|
return;
|
|
598
609
|
const s = e.target.position?.lineNumber;
|
|
599
610
|
s && this._debuggerState.toggleBreakpoint(s);
|
|
600
611
|
}
|
|
601
612
|
_onEditorModelContentChange(e) {
|
|
602
|
-
if (!this.enableDebugger || !this._debuggerState.
|
|
613
|
+
if (!this.enableDebugger || !this._debuggerState.editorBreakpoints.length || e.isFlush)
|
|
603
614
|
return;
|
|
604
|
-
const s = pe(this._debuggerState.
|
|
605
|
-
s.length === this._debuggerState.
|
|
615
|
+
const s = pe(this._debuggerState.editorBreakpoints, e.changes);
|
|
616
|
+
s.length === this._debuggerState.editorBreakpoints.length && s.every((i, a) => i === this._debuggerState.editorBreakpoints[a]) || this._debuggerState.setBreakpoints(s);
|
|
606
617
|
}
|
|
607
618
|
_updateDebuggerPausedLineDecoration() {
|
|
608
619
|
const e = this.editorInstance;
|
|
@@ -617,7 +628,10 @@ class we extends ie {
|
|
|
617
628
|
isWholeLine: !0,
|
|
618
629
|
className: "arcgis-code-editor__debugger-paused-line",
|
|
619
630
|
glyphMarginClassName: "arcgis-code-editor__debugger-paused-glyph",
|
|
620
|
-
marginClassName: "arcgis-code-editor__debugger-paused-line arcgis-code-editor__debugger-paused-margin"
|
|
631
|
+
marginClassName: "arcgis-code-editor__debugger-paused-line arcgis-code-editor__debugger-paused-margin",
|
|
632
|
+
// keeps decoration at the same line when typing at the edges of the line or the range gets collapsed.
|
|
633
|
+
// essentially keeps paused decoration as a single-line no matter what
|
|
634
|
+
stickiness: this._monacoEditor.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges
|
|
621
635
|
}
|
|
622
636
|
}
|
|
623
637
|
]) : this._debuggerPausedLineDecoration = void 0;
|
|
@@ -628,8 +642,8 @@ class we extends ie {
|
|
|
628
642
|
_abortExternalExecution() {
|
|
629
643
|
this._externalExecutionAbortController?.abort(), this._externalExecutionAbortController = void 0;
|
|
630
644
|
}
|
|
631
|
-
_stopDebugSession(
|
|
632
|
-
this._abortExternalExecution(), this._debuggerState.stopDebug({ hidePanel:
|
|
645
|
+
_stopDebugSession() {
|
|
646
|
+
this._abortExternalExecution(), this._debuggerState.stopDebug({ hidePanel: !1 });
|
|
633
647
|
}
|
|
634
648
|
_resetDebugSession() {
|
|
635
649
|
this._abortExternalExecution(), this._debuggerState.resetDebug(), this._executeScript("debug").catch(u(this));
|
|
@@ -656,8 +670,8 @@ class we extends ie {
|
|
|
656
670
|
});
|
|
657
671
|
try {
|
|
658
672
|
if (e === "debug") {
|
|
659
|
-
const { breakpoints: n, onDebugPause:
|
|
660
|
-
if (!n || !
|
|
673
|
+
const { breakpoints: n, onDebugPause: o } = i;
|
|
674
|
+
if (!n || !o)
|
|
661
675
|
throw new Error("Missing debug execution options");
|
|
662
676
|
return await this.externalExecutor.execute({
|
|
663
677
|
mode: "debug",
|
|
@@ -665,7 +679,7 @@ class we extends ie {
|
|
|
665
679
|
console: r,
|
|
666
680
|
signal: a.signal,
|
|
667
681
|
breakpoints: n,
|
|
668
|
-
onDebugPause:
|
|
682
|
+
onDebugPause: o
|
|
669
683
|
});
|
|
670
684
|
}
|
|
671
685
|
return await this.externalExecutor.execute({
|
|
@@ -684,16 +698,16 @@ class we extends ie {
|
|
|
684
698
|
this._externalExecutionAbortController === a && (this._externalExecutionAbortController = void 0);
|
|
685
699
|
}
|
|
686
700
|
}
|
|
687
|
-
|
|
688
|
-
!this.
|
|
701
|
+
_executionContextChanged() {
|
|
702
|
+
!this._canExecute && this._executeScriptAction && (this._disposeSafely(this._executeScriptAction), this._executeScriptAction = void 0), this._canExecute && !this._executeScriptAction && this._addExecuteScriptAction(), !this.testData && this.enableDebugger && this._debuggerState.clearForMissingTestData(), this._debuggerState.openedPanel === "debug-console" && !this.enableDebugger && this._debuggerState.closePanel(), this._debuggerState.showPanel && this._executeScript("run").catch(u(this));
|
|
689
703
|
}
|
|
690
704
|
async _updateEditorProfile() {
|
|
691
705
|
this._preparingArcade = !0;
|
|
692
706
|
try {
|
|
693
|
-
await
|
|
707
|
+
await $.setProfileForModel(this._modelId, this.profile, {
|
|
694
708
|
locale: this.messages._t9nLocale,
|
|
695
709
|
snippets: this.snippets
|
|
696
|
-
}), this._editorProfile =
|
|
710
|
+
}), this._editorProfile = $.getEditorProfileForModel(this._modelId);
|
|
697
711
|
} catch {
|
|
698
712
|
this._editorProfile = void 0;
|
|
699
713
|
} finally {
|
|
@@ -701,45 +715,46 @@ class we extends ie {
|
|
|
701
715
|
}
|
|
702
716
|
}
|
|
703
717
|
async _updateApiLibrary() {
|
|
704
|
-
this._apiLibrary = await
|
|
718
|
+
this._apiLibrary = await $.getApiLibraryForModel(this._modelId);
|
|
705
719
|
}
|
|
706
720
|
_setExecutionPanel(e) {
|
|
707
|
-
this._debuggerState.
|
|
721
|
+
this._debuggerState.setPanel(e);
|
|
708
722
|
}
|
|
709
723
|
async _executeScript(e) {
|
|
710
|
-
const s = this.testData;
|
|
711
|
-
if (!this._codeEditorElt.value || !s)
|
|
724
|
+
const s = this.testData, i = this.externalExecutor;
|
|
725
|
+
if (!this._codeEditorElt.value || !s && !i)
|
|
712
726
|
return;
|
|
713
|
-
const
|
|
727
|
+
const a = e === "debug" ? this._debuggerState.startDebug() : this._debuggerState.startRun();
|
|
714
728
|
setTimeout(() => {
|
|
715
729
|
(async () => {
|
|
716
|
-
const
|
|
730
|
+
const r = this._codeEditorElt.value?.value ?? this.script, n = {
|
|
717
731
|
mode: e,
|
|
718
|
-
console: (
|
|
732
|
+
console: (b) => this._debuggerState.addConsoleLog(b),
|
|
719
733
|
breakpoints: e === "debug" ? this._debuggerState.debuggerBreakpoints : void 0
|
|
720
734
|
};
|
|
721
|
-
e === "debug" && (
|
|
722
|
-
let
|
|
723
|
-
if (
|
|
724
|
-
|
|
725
|
-
else {
|
|
726
|
-
const
|
|
727
|
-
if (!
|
|
735
|
+
e === "debug" && (n.onDebugPause = this._handleDebugPause.bind(this, a));
|
|
736
|
+
let o;
|
|
737
|
+
if (i)
|
|
738
|
+
o = await this._executeWithExternalExecutor(e, r, n);
|
|
739
|
+
else if (s) {
|
|
740
|
+
const b = await this._editorProfilePromise;
|
|
741
|
+
if (!b) {
|
|
728
742
|
this._debuggerState.fail({ type: "error", value: "Missing editor profile", error: null });
|
|
729
743
|
return;
|
|
730
744
|
}
|
|
731
|
-
|
|
732
|
-
}
|
|
733
|
-
|
|
745
|
+
o = await K(b.definition, r, s, n);
|
|
746
|
+
} else
|
|
747
|
+
return;
|
|
748
|
+
if (a === this._debuggerState.sessionId) {
|
|
734
749
|
if (e === "debug") {
|
|
735
|
-
if (
|
|
736
|
-
this._debuggerState.fail(
|
|
750
|
+
if (y(o)) {
|
|
751
|
+
this._debuggerState.fail(o);
|
|
737
752
|
return;
|
|
738
753
|
}
|
|
739
|
-
this._debuggerState.completeDebug(
|
|
754
|
+
this._debuggerState.completeDebug(o);
|
|
740
755
|
return;
|
|
741
756
|
}
|
|
742
|
-
|
|
757
|
+
y(o) ? this._debuggerState.completeRun(o) : i ? this._debuggerState.completeRun(o, { useDebugRenderer: !0 }) : this._debuggerState.fail({ type: "error", value: "Unexpected debug result", error: null });
|
|
743
758
|
}
|
|
744
759
|
})();
|
|
745
760
|
}, 0);
|
|
@@ -778,7 +793,7 @@ class we extends ie {
|
|
|
778
793
|
contextMenuGroupId: "code",
|
|
779
794
|
contextMenuOrder: 1,
|
|
780
795
|
run: () => {
|
|
781
|
-
this.
|
|
796
|
+
this._canExecute && this._executeScript("run").catch(u(this));
|
|
782
797
|
}
|
|
783
798
|
});
|
|
784
799
|
e && (this._executeScriptAction = e, this._disposables.push(e));
|
|
@@ -823,10 +838,10 @@ class we extends ie {
|
|
|
823
838
|
return;
|
|
824
839
|
const s = this._getAskAiBindingKey();
|
|
825
840
|
if (!this._arcadeAssistantRemoteState.shouldRender) {
|
|
826
|
-
this._askAiBindingKey && (
|
|
841
|
+
this._askAiBindingKey && (B(this._askAiBindingKey, void 0), this._askAiBindingKey = void 0);
|
|
827
842
|
return;
|
|
828
843
|
}
|
|
829
|
-
this._askAiBindingKey && this._askAiBindingKey !== s &&
|
|
844
|
+
this._askAiBindingKey && this._askAiBindingKey !== s && B(this._askAiBindingKey, void 0), B(s, {
|
|
830
845
|
provideCodeActions: ({ context: i }) => this._getAskAiCodeActions(i),
|
|
831
846
|
run: (i) => {
|
|
832
847
|
this.openArcadeAssistant({
|
|
@@ -844,15 +859,15 @@ class we extends ie {
|
|
|
844
859
|
this.disableAssistant ? this._arcadeAssistantRemoteState = { shouldRender: !1 } : this._arcadeAssistantRemoteState = await Pe(e ?? {}), this._syncAskAiAction();
|
|
845
860
|
}
|
|
846
861
|
renderMainActionBar() {
|
|
847
|
-
return this.
|
|
862
|
+
return this._usesBottomExecutionDrawer || !this._canExecute ? null : d`<calcite-action-bar class="main-action-bar" layout=horizontal scale=s expanded expand-disabled slot=top-action-bar><calcite-action-group scale=s><calcite-action .text=${this.messages.run ?? ""} text-enabled icon=play scale=s .loading=${this._preparingArcade} @click=${() => {
|
|
848
863
|
this._executeScript("run").catch(u(this));
|
|
849
864
|
}}></calcite-action>${this._debuggerState.result ? d`<calcite-action .text=${this.messages.lastresults ?? ""} .active=${this._debuggerState.showPanel} text-enabled icon=access-string-results icon-flip-rtl scale=s @click=${this._toggleShowExecutionPanel}></calcite-action>` : null}</calcite-action-group></calcite-action-bar>`;
|
|
850
865
|
}
|
|
851
866
|
renderMainPanel() {
|
|
852
|
-
return d`<arcgis-code-editor slot=editor .editorOptions=${this.editorOptions} .language=${
|
|
867
|
+
return d`<arcgis-code-editor slot=editor .editorOptions=${this.editorOptions} .language=${$.languageId} .value=${this.script ?? ""} .modelId=${this._modelId} @arcgisValueChange=${this._onCodeEditorValueChange} ${j(this._codeEditorElt)}></arcgis-code-editor>`;
|
|
853
868
|
}
|
|
854
|
-
renderAction({ id: e, label: s, icon: i, active: a, panelName: r, iconFlipRtl: n = !1, onClick:
|
|
855
|
-
return d`<calcite-action id=${e ??
|
|
869
|
+
renderAction({ id: e, label: s, icon: i, active: a, panelName: r, iconFlipRtl: n = !1, onClick: o = this._toggleSidePanel }) {
|
|
870
|
+
return d`<calcite-action id=${e ?? z} .text=${s} .textEnabled=${this.sideActionBarExpanded} .icon=${i} .active=${a} @click=${o} data-panel-name=${r ?? z} .iconFlipRtl=${n}></calcite-action>${!this.sideActionBarExpanded && d`<calcite-tooltip .referenceElement=${e}><span>${s}</span></calcite-tooltip>` || ""}`;
|
|
856
871
|
}
|
|
857
872
|
renderSideActionBar() {
|
|
858
873
|
return this.hideSideBar ? null : d`<calcite-action-bar slot=side-action-bar class="side-action-bar" .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}><calcite-action-group>${this.renderAction({
|
|
@@ -899,7 +914,10 @@ class we extends ie {
|
|
|
899
914
|
if (this.hideSideBar)
|
|
900
915
|
return null;
|
|
901
916
|
const { openedSidePanel: e, _arcadeAssistantRemoteState: s } = this;
|
|
902
|
-
return d`<arcgis-language-api-panel slot=side-panel class=${
|
|
917
|
+
return d`<arcgis-language-api-panel slot=side-panel class=${v(e === "api" ? "" : "hidden")} .loading=${this._preparingArcade} .apiLibrary=${this._apiLibrary} .hideDocumentationActions=${this.hideDocumentationActions} @arcgisInternalItemSelected=${this._insertAsSnippet} @arcgisInternalClosePanel=${this._closeSidePanel} data-panel-name=none .closed=${e !== "api"}></arcgis-language-api-panel><arcgis-editor-variables slot=side-panel class=${v(e === "variables" ? "" : "hidden")} .loading=${this._preparingArcade} .modelId=${this._modelId} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${this._closeSidePanel} data-panel-name=none .variable=${this._editorProfile} .closed=${e !== "variables"} .messageOverrides=${{
|
|
918
|
+
profileempty: this.messages.profileempty,
|
|
919
|
+
profilevariables: this.messages.profilevariables
|
|
920
|
+
}}></arcgis-editor-variables>${this.suggestions?.length && d`<arcgis-arcade-suggestions slot=side-panel class=${v(e === "suggestions" ? "" : "hidden")} .closed=${e !== "suggestions"} .suggestions=${this.suggestions} @arcgisInternalItemSelected=${this._insertAsText} @arcgisInternalClosePanel=${this._closeSidePanel} data-panel-name=none></arcgis-arcade-suggestions>` || ""}${s?.shouldRender && d`<arcgis-arcade-coding-assistant slot=side-panel class=${v(e === "arcade-assistant" ? "" : "hidden")} .closed=${e !== "arcade-assistant"} .insertText=${this._insertText.bind(this)} .closePanel=${this._closeSidePanel} .portalUrl=${s.portalUrl} .serviceUrl=${"serviceUrl" in s ? s.serviceUrl : void 0} .helpBase=${s.helpBase} .promptingEnabled=${this._canPromptWithArcadeAssistant()} .feedbackServiceUrl=${s.feedbackServiceUrl} .editorRef=${this.el} .appVersion=${this.arcadeAssistant?.appVersion} .disableQuestionAnswerLogging=${this.arcadeAssistant?.disableQuestionAnswerLogging} .diagnostics=${this._diagnostics} ${j(this._arcadeAssistantElt)}></arcgis-arcade-coding-assistant>` || ""}${this.customPanels?.map((i) => d`<calcite-flow slot=side-panel class=${v(e === i.id ? "" : "hidden")}>${i?.useFlows ? i.renderer?.({
|
|
903
921
|
closePanel: this._toggleSidePanel,
|
|
904
922
|
insertText: this._insertText.bind(this),
|
|
905
923
|
closed: e !== i.id,
|
|
@@ -923,17 +941,20 @@ class we extends ie {
|
|
|
923
941
|
}
|
|
924
942
|
renderBottomExecutionBody() {
|
|
925
943
|
const { showPanel: e, openedPanel: s, debugResult: i, isExecuting: a, mode: r } = this._debuggerState;
|
|
926
|
-
|
|
944
|
+
if (!e)
|
|
945
|
+
return null;
|
|
946
|
+
const n = s === "debug-console" ? "output" : s;
|
|
947
|
+
return this.enableDebugger && s === "debug-console" ? d`<arcgis-arcade-debugger-console slot=results-panel .modelId=${this._modelId} .debuggerStore=${this._debuggerState}></arcgis-arcade-debugger-console>` : s === "output" && (r === "debug" || i) ? d`<arcgis-arcade-debugger-output .outputTitle=${this.messages.output} slot=results-panel .debuggerStore=${this._debuggerState} .result=${i}></arcgis-arcade-debugger-output>` : d`<arcgis-arcade-results slot=results-panel class="bottom-results" .openedResultPanel=${n} .loading=${s === "console" && this._debuggerState.isPaused ? !1 : a} .result=${this._debuggerState.runResult} .consoleLogs=${this._debuggerState.consoleLogs} hide-header @arcgisInternalOpenedResultPanelChange=${this._onResultPanelChange}></arcgis-arcade-results>`;
|
|
927
948
|
}
|
|
928
949
|
renderBottomActionBar() {
|
|
929
950
|
if (!this._usesBottomExecutionDrawer)
|
|
930
951
|
return null;
|
|
931
|
-
const { showPanel: e, hasExecuted: s, openedPanel: i, isDebugging: a, isPaused: r, isExecuting: n } = this._debuggerState;
|
|
932
|
-
return d`<
|
|
952
|
+
const { showPanel: e, hasExecuted: s, openedPanel: i, isDebugging: a, isPaused: r, isExecuting: n } = this._debuggerState, o = this.messages.continue ?? "Continue", b = this.messages.reset ?? "Reset", S = this.messages.stop ?? "Stop";
|
|
953
|
+
return d`<div slot=bottom-action-bar class=${`main-action-bar bottom-action-bar ${e ? "" : "is-collapsed"}`}><calcite-action-bar class="bottom-action-bar__actions" layout=horizontal scale=s expand-disabled expanded><calcite-action-group scale=s>${this.enableDebugger && a ? d`<calcite-action id=debugger-continue-action .text=${o} icon=forward scale=s .disabled=${!r} @click=${this._continueDebugSession}></calcite-action><calcite-tooltip reference-element=debugger-continue-action placement=top><span>${o}</span></calcite-tooltip><calcite-action id=debugger-reset-action .text=${b} icon=reset scale=s @click=${this._resetDebugSession}></calcite-action><calcite-tooltip reference-element=debugger-reset-action placement=top><span>${b}</span></calcite-tooltip><calcite-action id=debugger-stop-action .text=${S} icon=circle-stop scale=s @click=${this._stopDebugSession}></calcite-action><calcite-tooltip reference-element=debugger-stop-action placement=top><span>${S}</span></calcite-tooltip>` : d`<calcite-action .text=${this.messages.run ?? ""} text-enabled icon=play scale=s .loading=${this._preparingArcade || n} @click=${() => {
|
|
933
954
|
this._executeScript("run").catch(u(this));
|
|
934
|
-
}}></calcite-action
|
|
955
|
+
}}></calcite-action>${this.enableDebugger && d`<calcite-action .disabled=${this._debuggerState.editorBreakpoints.length === 0} .text=${this.messages.runanddebug ?? "Run and Debug"} text-enabled icon=debug-script scale=s .loading=${this._preparingArcade || n} @click=${() => {
|
|
935
956
|
this._executeScript("debug").catch(u(this));
|
|
936
|
-
}}></calcite-action>`}</calcite-action-group>${s ? d`<calcite-action-group scale=s><calcite-action .active=${i === "output" && e} .text=${this.messages.output ?? "Output"} text-enabled scale=s icon=list-show-all icon-flip-rtl @click=${() => this._setExecutionPanel("output")}></calcite-action><calcite-action .active=${i === "console" && e} .text=${this.messages.console ?? "Console"} text-enabled scale=s icon=console icon-flip-rtl @click=${() => this._setExecutionPanel("console")}></calcite-action><calcite-action .active=${i === "log" && e} .text=${this.messages.log ?? "Log"} text-enabled scale=s icon=list icon-flip-rtl @click=${() => this._setExecutionPanel("log")}></calcite-action
|
|
957
|
+
}}></calcite-action>` || ""}`}</calcite-action-group>${s ? d`<calcite-action-group scale=s><calcite-action .active=${i === "output" && e} .text=${this.messages.output ?? "Output"} text-enabled scale=s icon=list-show-all icon-flip-rtl @click=${() => this._setExecutionPanel("output")}></calcite-action><calcite-action .active=${i === "console" && e} .text=${this.messages.console ?? "Console"} text-enabled scale=s icon=console icon-flip-rtl @click=${() => this._setExecutionPanel("console")}></calcite-action><calcite-action .active=${i === "log" && e} .text=${this.messages.log ?? "Log"} text-enabled scale=s icon=list icon-flip-rtl @click=${() => this._setExecutionPanel("log")} .disabled=${this.enableDebugger && this._debuggerState.mode === "debug"}></calcite-action>${this.enableDebugger && d`<calcite-action .active=${i === "debug-console" && e} .text=${this.messages.debugconsole ?? "Debug Console"} text-enabled scale=s icon=debug-script .disabled=${this._debuggerState.mode !== "debug"} @click=${() => this._setExecutionPanel("debug-console")}></calcite-action>` || ""}</calcite-action-group>` : null}</calcite-action-bar>${e ? d`<calcite-action .text=${this.messages.close ?? "Close"} scale=s icon=x icon-flip-rtl @click=${this._onExecutionPanelClose} slot=actions-end></calcite-action>` : null}</div>`;
|
|
937
958
|
}
|
|
938
959
|
render() {
|
|
939
960
|
return d`<arcgis-code-editor-shell>${this.renderMainActionBar()}${this.renderMainPanel()}${this.renderBottomActionBar()}${this.renderResultsPanel()}${this.renderSidePanel()}${this.renderSideActionBar()}</arcgis-code-editor-shell>`;
|