@arcgis/coding-components 5.1.0-next.95 → 5.1.0-next.97
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/GHTOL7NB.js +2 -0
- package/dist/cdn/{55EKVOZS.js → GVMVHGSK.js} +1 -1
- package/dist/cdn/PPV6RAZ3.js +2 -0
- package/dist/cdn/WP6BSOSW.js +2 -0
- package/dist/cdn/assets/arcade-debugger-console/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/code-editor/sql-expr.worker.js +1 -1
- package/dist/cdn/assets/code-editor/sql-layer.worker.js +619 -602
- package/dist/cdn/index.js +1 -1
- package/dist/components/arcgis-arcade-debugger-console/customElement.js +85 -69
- package/dist/components/arcgis-arcade-editor/customElement.js +15 -17
- package/dist/components/arcgis-code-editor/customElement.js +88 -97
- package/dist/components/arcgis-sql-layer-editor/customElement.js +2 -2
- package/dist/docs/api.json +1 -1
- package/dist/docs/docs.json +1 -1
- package/dist/docs/web-types.json +1 -1
- package/package.json +5 -5
- package/dist/cdn/AEHKSYEZ.js +0 -2
- package/dist/cdn/E3VATROF.js +0 -2
- package/dist/cdn/XN56YGFQ.js +0 -2
package/dist/cdn/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import{J as s,v as e}from"./REL6OK2I.js";import"./Y3KOWWO5.js";import"./3TTFCHAA.js";var r=e(s,{"arcgis-arcade-coding-assistant":[()=>import("./YTQ4K7PQ.js"),"appVersion,assistantsEnabled,closed,closePanel:,disableQuestionAnswerLogging,editorRef:,feedbackServiceUrl,helpBase,insertText:,portalUrl,serviceUrl;destroy"],"arcgis-arcade-debugger-console":[()=>import("./
|
|
2
|
+
import{J as s,v as e}from"./REL6OK2I.js";import"./Y3KOWWO5.js";import"./3TTFCHAA.js";var r=e(s,{"arcgis-arcade-coding-assistant":[()=>import("./YTQ4K7PQ.js"),"appVersion,assistantsEnabled,closed,closePanel:,disableQuestionAnswerLogging,editorRef:,feedbackServiceUrl,helpBase,insertText:,portalUrl,serviceUrl;destroy"],"arcgis-arcade-debugger-console":[()=>import("./PPV6RAZ3.js"),"debuggerStore:,modelId"],"arcgis-arcade-debugger-output":[()=>import("./7NI24N24.js"),"debuggerStore:,result:"],"arcgis-arcade-editor":[()=>import("./WP6BSOSW.js"),"arcadeAssistant:,customPanels:,editorInstance:,editorOptions:,enableDebugger,hideDocumentationActions,hideSideBar,messageOverrides:,messages:,openedSidePanel,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getTestResult,setFocus"],"arcgis-arcade-results":[()=>import("./363GMMQ6.js"),"consoleLogs:,hideHeader,loading,openedResultPanel,result:"],"arcgis-arcade-suggestions":[()=>import("./WL2QW4SI.js"),"closed,suggestions:"],"arcgis-code-editor":[()=>import("./GHTOL7NB.js"),"editorInstance:,editorOptions:,language,modelId,value;insertSnippet,insertText,setFocus"],"arcgis-code-editor-shell":[()=>import("./WN4UL6U4.js")],"arcgis-code-viewer":[()=>import("./TSZHSRGH.js"),"language,lineNumbers,round"],"arcgis-editor-variables":[()=>import("./UCX6WHKQ.js"),"closed,heading,loading,messageOverrides:,modelId,variable:"],"arcgis-language-api-panel":[()=>import("./NWLOXWV6.js"),"apiLibrary:,closed,hideDocumentationActions,languageId,loading"],"arcgis-sql-expression-editor":[()=>import("./SATQDL5P.js"),"hideSideBar,messageOverrides:,messages:,profile:,script;setFocus"],"arcgis-sql-layer-editor":[()=>import("./GVMVHGSK.js"),"editorInstance:,editorOptions:,hideSideBar,messageOverrides:,messages:,openedSidePanel,profile:,script;setFocus"]});r({resourcesUrl:import.meta.url});var i=new CSSStyleSheet;i.replaceSync("@layer{:not([hydrated]):is(arcgis-arcade-editor,arcgis-code-editor,arcgis-code-editor-shell,arcgis-code-viewer,arcgis-sql-expression-editor,arcgis-sql-layer-editor){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,i];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,s)
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
-
import { c as
|
|
2
|
+
import { c as v } from "../../chunks/runtime.js";
|
|
3
3
|
import { css as u, html as r } from "lit";
|
|
4
|
-
import { repeat as
|
|
5
|
-
import { LitElement as f, safeClassMap as w, nothing as
|
|
4
|
+
import { repeat as g } from "lit/directives/repeat.js";
|
|
5
|
+
import { LitElement as f, safeClassMap as w, nothing as b } from "@arcgis/lumina";
|
|
6
6
|
import { u as x } from "../../chunks/useT9n.js";
|
|
7
|
-
import { load as
|
|
8
|
-
import { i as
|
|
7
|
+
import { load as S } from "@arcgis/lumina/controllers";
|
|
8
|
+
import { i as $ } from "../../chunks/monaco-importer.js";
|
|
9
9
|
import { t as l } from "../../chunks/functional.js";
|
|
10
|
-
import { d as
|
|
11
|
-
import { i as
|
|
12
|
-
import { observeAncestorsMutation as
|
|
13
|
-
import { generateGuid as
|
|
14
|
-
import { d as
|
|
15
|
-
import { Uri as
|
|
16
|
-
const
|
|
17
|
-
class
|
|
10
|
+
import { d as k, g as y, c as m } from "../../chunks/debugger-value-styles.js";
|
|
11
|
+
import { i as h, 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
|
+
import { observeAncestorsMutation as z, unsafeGetCalciteModeName as I } from "@arcgis/toolkit/dom";
|
|
13
|
+
import { generateGuid as A } from "@arcgis/toolkit/string";
|
|
14
|
+
import { d as p } from "../../chunks/ArcadeDebuggerPreviewTabsState.js";
|
|
15
|
+
import { Uri as D } from "monaco-editor";
|
|
16
|
+
const F = u`:host{--calcite-block-padding: var(--calcite-spacing-sm);--breakpoints-popover-max-height: min(14rem, 20vh);display:block;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);overflow:hidden;height:100%;.console-shell,.tabs-container,calcite-tabs{height:100%}.tabs-container{flex:1 1 auto;min-height:0;overflow:hidden}.console-shell,calcite-tabs{display:flex;flex-direction:column;min-height:0}.console-shell{container-type:size;container-name:debugger-console}calcite-tab-nav{--calcite-size-2xl: var(--calcite-space-md);justify-content:flex-start;padding-inline:var(--calcite-spacing-sm)}calcite-tab-title{font-size:var(--calcite-font-size-sm)}calcite-tab{--calcite-tab-content-block-padding: 0;--calcite-tab-content-space-y: 0;display:flex;flex-direction:column;min-height:0}calcite-tab:not([selected]){display:none}.disabled-state-text{font-size:var(--calcite-font-size-sm);color:var(--calcite-color-text-3);font-style:italic;text-align:center;display:block;padding:var(--calcite-spacing-md)}.breakpoint-header{display:flex;align-items:flex-start;gap:var(--calcite-spacing-sm);padding:var(--calcite-spacing-sm);border-bottom:1px solid var(--calcite-color-border-3);background-color:var(--calcite-color-foreground-1)}.load-action{--calcite-action-background-color: var(--calcite-color-foreground-2);--calcite-internal-action-height: 1.25rem;--calcite-internal-action-padding-block: 0;--calcite-internal-action-padding-inline: var(--calcite-spacing-xs);margin-block:var(--calcite-spacing-xxs)}.breakpoint-code-viewer{margin-block:0;width:100%}.tab-panel{display:flex;flex:1 1 auto;min-height:0;overflow:hidden}.tab-panel>*{flex:1 1 auto;min-height:0}.tab-panel>calcite-tree{margin-inline-end:var(--calcite-space-sm)}.preview-panel{display:flex;flex:1 1 auto;min-height:0}.preview-empty-state{display:flex;align-items:center;justify-content:center;width:100%;height:100%;padding:var(--calcite-spacing-md)}.preview-table-shell{display:flex;flex-direction:column;flex:1 1 auto;width:100%;min-height:0;overflow:hidden}.preview-table-summary{padding:var(--calcite-spacing-sm);border-bottom:1px solid var(--calcite-color-border-3);color:var(--calcite-color-text-2);font-family:var(--calcite-code-family);background-color:var(--calcite-color-foreground-1)}.table-scroll{overflow:auto;flex:1 1 auto;min-height:0;max-width:100%;background-color:var(--calcite-color-foreground-1);margin:var(--calcite-spacing-sm)}table{min-width:max-content;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)}}.breakpoints-popover{--calcite-popover-max-size-x: min(22rem, 68vw)}.breakpoints-popover-content{max-block-size:var(--breakpoints-popover-max-height);overflow:hidden}.breakpoints-list{display:flex;flex-direction:column;gap:var(--calcite-spacing-xs);padding:var(--calcite-spacing-xs);min-width:min(18rem,58vw);max-block-size:var(--breakpoints-popover-max-height);overflow:auto}.breakpoints-popover .breakpoint-code-viewer{--calcite-font-size--2: var(--calcite-font-size--3);--calcite-spacing-md: var(--calcite-spacing-sm);--calcite-spacing-sm: var(--calcite-spacing-xs);--calcite-spacing-xs: var(--calcite-spacing-xxs)}.breakpoint-list-item{border:1px solid var(--calcite-color-border-3);border-radius:var(--calcite-corner-radius-sharp);background-color:var(--calcite-color-foreground-1);padding:var(--calcite-spacing-xxs)}.breakpoint-list-item--current{border-color:var(--calcite-color-brand)}.breakpoint-list-item-meta{color:var(--calcite-color-text-2);font-size:var(--calcite-font-size-xs);margin-bottom:var(--calcite-spacing-xxs)}}`;
|
|
17
|
+
class N extends f {
|
|
18
18
|
constructor() {
|
|
19
|
-
super(...arguments), this.messages = x(), this._monacoEditor =
|
|
19
|
+
super(...arguments), this.messages = x(), this._monacoEditor = S($), this._breakpointPopoverId = `arcade-debugger-console-breakpoints-${A()}`, this.modelId = "";
|
|
20
20
|
}
|
|
21
21
|
static {
|
|
22
22
|
this.properties = { debuggerStore: 0, modelId: 1 };
|
|
23
23
|
}
|
|
24
24
|
static {
|
|
25
|
-
this.styles = [
|
|
25
|
+
this.styles = [F, k, y()];
|
|
26
26
|
}
|
|
27
27
|
get breakpoints() {
|
|
28
28
|
return this.debuggerStore?.debuggerBreakpoints ?? [];
|
|
@@ -33,20 +33,23 @@ class F extends f {
|
|
|
33
33
|
get lazyTreeState() {
|
|
34
34
|
return this.debuggerStore?.lazyTreeState;
|
|
35
35
|
}
|
|
36
|
+
get executionProgramState() {
|
|
37
|
+
return this.debuggerStore?.executionState?.result;
|
|
38
|
+
}
|
|
36
39
|
load() {
|
|
37
40
|
this.manager.onLifecycle(() => {
|
|
38
|
-
const e =
|
|
41
|
+
const e = z(this.el, ["class"], this.updateTheme.bind(this));
|
|
39
42
|
return this.updateTheme(), () => e();
|
|
40
43
|
});
|
|
41
44
|
}
|
|
42
45
|
getContentAtLine(e) {
|
|
43
46
|
if (!this.modelId)
|
|
44
47
|
return "";
|
|
45
|
-
const t = this._monacoEditor.getModel(
|
|
48
|
+
const t = this._monacoEditor.getModel(D.parse(this.modelId));
|
|
46
49
|
return t ? t.getLineContent(e) : "";
|
|
47
50
|
}
|
|
48
51
|
updateTheme() {
|
|
49
|
-
|
|
52
|
+
I(this.el) === "dark" ? this.elementInternals.states.add(m) : this.elementInternals.states.delete(m);
|
|
50
53
|
}
|
|
51
54
|
getBreakpointCode(e) {
|
|
52
55
|
return e == null ? this.messages.nocontent ?? "No content" : this.getContentAtLine(e) || (this.messages.nocontent ?? "No content");
|
|
@@ -59,84 +62,94 @@ class F extends f {
|
|
|
59
62
|
}
|
|
60
63
|
findCollectionItemByPreviewSegment(e, t) {
|
|
61
64
|
if (t.startsWith("name:")) {
|
|
62
|
-
const
|
|
63
|
-
return e.find((
|
|
65
|
+
const a = t.slice(5);
|
|
66
|
+
return e.find((i) => i.name === a)?.featureSet;
|
|
64
67
|
}
|
|
65
68
|
if (t.startsWith("id:")) {
|
|
66
|
-
const
|
|
67
|
-
return e.find((
|
|
69
|
+
const a = t.slice(3);
|
|
70
|
+
return e.find((i) => String(i.id) === a)?.featureSet;
|
|
68
71
|
}
|
|
69
72
|
}
|
|
70
73
|
getExpandedDebuggerMap(e) {
|
|
71
|
-
if (e == null || !
|
|
74
|
+
if (e == null || !h(e))
|
|
72
75
|
return null;
|
|
73
76
|
const t = e.expand();
|
|
74
77
|
return Array.isArray(t) ? null : t;
|
|
75
78
|
}
|
|
76
79
|
getPreviewRows(e) {
|
|
77
80
|
return e.map((t) => {
|
|
78
|
-
const
|
|
79
|
-
return
|
|
81
|
+
const a = this.getExpandedDebuggerMap(t);
|
|
82
|
+
return a || /* @__PURE__ */ new Map();
|
|
80
83
|
});
|
|
81
84
|
}
|
|
82
85
|
getExpandedDebuggerChild(e, t) {
|
|
83
|
-
if (!e || !
|
|
86
|
+
if (!e || !h(e))
|
|
84
87
|
return;
|
|
85
|
-
const
|
|
86
|
-
if (Array.isArray(
|
|
87
|
-
const
|
|
88
|
-
return !Number.isInteger(
|
|
88
|
+
const a = e.expand();
|
|
89
|
+
if (Array.isArray(a)) {
|
|
90
|
+
const i = Number(t);
|
|
91
|
+
return !Number.isInteger(i) || String(i) !== t ? void 0 : a[i];
|
|
89
92
|
}
|
|
90
|
-
return
|
|
93
|
+
return a.get(t);
|
|
91
94
|
}
|
|
92
95
|
async resolvePreviewValueFromSegments(e, t) {
|
|
93
96
|
if (!t.length)
|
|
94
97
|
return e;
|
|
95
98
|
if (!e)
|
|
96
99
|
return;
|
|
97
|
-
const [
|
|
98
|
-
let
|
|
99
|
-
if (
|
|
100
|
-
const
|
|
101
|
-
|
|
100
|
+
const [a, ...i] = t;
|
|
101
|
+
let o;
|
|
102
|
+
if (P(e)) {
|
|
103
|
+
const s = await e.load();
|
|
104
|
+
o = this.findCollectionItemByPreviewSegment(s, a);
|
|
102
105
|
} else
|
|
103
|
-
|
|
104
|
-
return await this.resolvePreviewValueFromSegments(
|
|
106
|
+
o = this.getExpandedDebuggerChild(e, a);
|
|
107
|
+
return await this.resolvePreviewValueFromSegments(o, i);
|
|
108
|
+
}
|
|
109
|
+
getScope(e, t) {
|
|
110
|
+
switch (t) {
|
|
111
|
+
case "profile":
|
|
112
|
+
return e.profile;
|
|
113
|
+
case "globals":
|
|
114
|
+
return e.globals;
|
|
115
|
+
case "locals":
|
|
116
|
+
return e.locals;
|
|
117
|
+
}
|
|
105
118
|
}
|
|
106
119
|
async resolvePreviewValue(e) {
|
|
107
|
-
const t = this.
|
|
120
|
+
const t = this.executionProgramState;
|
|
108
121
|
if (!t)
|
|
109
122
|
return;
|
|
110
|
-
const
|
|
111
|
-
if (!
|
|
123
|
+
const a = T(e);
|
|
124
|
+
if (!a)
|
|
112
125
|
return;
|
|
113
|
-
const { scopeName:
|
|
126
|
+
const { scopeName: i, rootName: o, pathSegments: s } = a, n = this.getScope(t, i);
|
|
114
127
|
if (n)
|
|
115
|
-
return await this.resolvePreviewValueFromSegments(n.get(
|
|
128
|
+
return await this.resolvePreviewValueFromSegments(n.get(o), s);
|
|
116
129
|
}
|
|
117
|
-
async loadPreview({ label: e, sourcePath: t, value:
|
|
118
|
-
const
|
|
119
|
-
let
|
|
120
|
-
if (
|
|
130
|
+
async loadPreview({ label: e, sourcePath: t, value: a }) {
|
|
131
|
+
const i = this.previewTabsState, { snapshot: o } = i.startLoad(e, t);
|
|
132
|
+
let s = a;
|
|
133
|
+
if (s == null)
|
|
121
134
|
try {
|
|
122
|
-
|
|
135
|
+
s = await this.resolvePreviewValue(t);
|
|
123
136
|
} catch {
|
|
124
|
-
|
|
137
|
+
i.setError(o, this.getPreviewLoadErrorMessage());
|
|
125
138
|
return;
|
|
126
139
|
}
|
|
127
|
-
if (
|
|
128
|
-
|
|
140
|
+
if (s == null || !E(s) || typeof s.querySample != "function" || typeof s.schema != "function") {
|
|
141
|
+
i.setUnavailable(o, this.messages.previewunavailable ?? "This preview is no longer available in the current paused state.");
|
|
129
142
|
return;
|
|
130
143
|
}
|
|
131
144
|
try {
|
|
132
|
-
const { fields: n, features: d } = await
|
|
133
|
-
|
|
145
|
+
const { fields: n, features: d } = await s.querySample(), c = this.getPreviewRows(d);
|
|
146
|
+
i.setLoaded(o, n, c);
|
|
134
147
|
} catch {
|
|
135
|
-
|
|
148
|
+
i.setError(o, this.getPreviewLoadErrorMessage());
|
|
136
149
|
}
|
|
137
150
|
}
|
|
138
151
|
activateTab(e) {
|
|
139
|
-
if (e ===
|
|
152
|
+
if (e === p) {
|
|
140
153
|
this.previewTabsState.selectScope();
|
|
141
154
|
return;
|
|
142
155
|
}
|
|
@@ -153,24 +166,27 @@ class F extends f {
|
|
|
153
166
|
t?.querySelector(".breakpoint-list-item--current")?.scrollIntoView({ block: "center" });
|
|
154
167
|
});
|
|
155
168
|
}
|
|
169
|
+
sortScopeEntries(e) {
|
|
170
|
+
return e.sort(([t], [a]) => t.localeCompare(a));
|
|
171
|
+
}
|
|
156
172
|
renderPreviewLabel(e) {
|
|
157
173
|
return r`<bdi>${e}</bdi>`;
|
|
158
174
|
}
|
|
159
175
|
renderPreviewCell(e) {
|
|
160
|
-
return e ?
|
|
176
|
+
return e ? L(e) || C(e) ? M({ value: e }) : r`<span class="xs"></span>` : r`<span class="xs"></span>`;
|
|
161
177
|
}
|
|
162
|
-
renderScopeEntryForScope(e, t,
|
|
163
|
-
const [
|
|
164
|
-
return n ?
|
|
178
|
+
renderScopeEntryForScope(e, t, a) {
|
|
179
|
+
const [i, o] = a, s = `${t}.${i}`, n = this.lazyTreeState;
|
|
180
|
+
return n ? B({ name: i, value: o, messages: this.messages, path: `${e}.${i}`, lazyTreeState: n, previewLabel: s, previewSourcePath: V(e, i), previewLoading: this.previewTabsState.isTabLoading(s), onLoadPreview: (d) => {
|
|
165
181
|
this.loadPreview(d);
|
|
166
182
|
} }) : null;
|
|
167
183
|
}
|
|
168
184
|
renderBreakpointPopover(e) {
|
|
169
|
-
return this.breakpoints.length ? r`<calcite-popover .referenceElement=${this._breakpointPopoverId} placement=bottom-end scale=s auto-close focus-trap-disabled @calcitePopoverOpen=${(t) => this.scrollToSelectedBreakpoint(t)} .label=${this.messages.breakpoints ?? "Breakpoints"} class="breakpoints-popover" .heading=${this.messages.breakpoints ?? "Breakpoints"} heading-level=2><div class="breakpoints-popover-content"><div class="breakpoints-list">${this.breakpoints.map((t,
|
|
185
|
+
return this.breakpoints.length ? r`<calcite-popover .referenceElement=${this._breakpointPopoverId} placement=bottom-end scale=s auto-close focus-trap-disabled @calcitePopoverOpen=${(t) => this.scrollToSelectedBreakpoint(t)} .label=${this.messages.breakpoints ?? "Breakpoints"} class="breakpoints-popover" .heading=${this.messages.breakpoints ?? "Breakpoints"} heading-level=2><div class="breakpoints-popover-content"><div class="breakpoints-list">${this.breakpoints.map((t, a) => r`<div class=${w(t.line === e ? "breakpoint-list-item breakpoint-list-item--current" : "breakpoint-list-item")}><div class="breakpoint-list-item-meta"><bdi>${this.getBreakpointPositionText(a + 1)}</bdi></div><arcgis-code-viewer language=arcade class="breakpoint-code-viewer" .lineNumbers=${(i) => String(i + t.line - 1)}>${this.getBreakpointCode(t.line)}</arcgis-code-viewer></div>`)}</div></div></calcite-popover>` : null;
|
|
170
186
|
}
|
|
171
187
|
renderScopePanel() {
|
|
172
|
-
const e = this.
|
|
173
|
-
return e ? r`<calcite-tree .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect} .lines=${l.lines} .selectionMode=${l.selectionMode}><calcite-tree-item expanded>${this.messages.global ?? "Global"}<calcite-tree slot=children .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}>${
|
|
188
|
+
const e = this.executionProgramState, t = this.sortScopeEntries(Array.from(e?.profile ?? [])), a = this.sortScopeEntries(Array.from(e?.globals ?? [])), i = e?.locals ? this.sortScopeEntries(Array.from(e?.locals ?? [])) : void 0, o = !!e?.locals, s = i && i.length > 0, n = t.length > 0, d = a.length > 0;
|
|
189
|
+
return e ? r`<calcite-tree .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect} .lines=${l.lines} .selectionMode=${l.selectionMode}><calcite-tree-item expanded .disabled=${!s}>${this.messages.local ?? "Local"}<calcite-tree slot=children .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}>${o ? s ? i.map((c) => this.renderScopeEntryForScope("locals", this.messages.local ?? "Local", c)) : r`<span><i>${this.messages.empty ?? "Empty"}</i></span>` : r`<span><i>${this.messages.nolocalscope ?? "No local scope"}</i></span>`}</calcite-tree></calcite-tree-item><calcite-tree-item expanded .disabled=${!d}>${this.messages.global ?? "Global"}<calcite-tree slot=children .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}>${d ? a.map((c) => this.renderScopeEntryForScope("globals", this.messages.global ?? "Global", c)) : r`<span><i>${this.messages.empty ?? "Empty"}</i></span>`}</calcite-tree></calcite-tree-item><calcite-tree-item expanded .disabled=${!n}>${this.messages.profile ?? "Profile"}<calcite-tree slot=children .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}>${n ? t.map((c) => this.renderScopeEntryForScope("profile", this.messages.profile ?? "Profile", c)) : r`<span><i>${this.messages.empty ?? "Empty"}</i></span>`}</calcite-tree></calcite-tree-item></calcite-tree>` : this.debuggerStore?.isExecuting ? r`<div class="preview-empty-state"><calcite-loader scale=s type=indeterminate .label=${this.messages.loading ?? "Loading"} .text=${this.messages.loading ?? "Loading"}></calcite-loader></div>` : r`<span class="disabled-state-text">${this.messages.notpaused ?? "Not paused"}</span>`;
|
|
174
190
|
}
|
|
175
191
|
renderPreviewPanel(e) {
|
|
176
192
|
switch (e.status) {
|
|
@@ -180,22 +196,22 @@ class F extends f {
|
|
|
180
196
|
case "error":
|
|
181
197
|
return r`<span class="disabled-state-text">${e.message}</span>`;
|
|
182
198
|
case "loaded":
|
|
183
|
-
const { fields: t, label:
|
|
184
|
-
return !
|
|
199
|
+
const { fields: t, label: a, rows: i } = e;
|
|
200
|
+
return !i.length || !t.length ? r`<span class="disabled-state-text">${this.messages.nopreviewrows ?? "No preview rows available."}</span>` : r`<div class="preview-table-shell"><div class="preview-table-summary">${this.renderPreviewLabel(a)}</div><div class="table-scroll"><table><thead><tr>${t.map((o) => r`<th><bdi>${o}</bdi></th>`)}</tr></thead><tbody>${i.map((o) => r`<tr>${t.map((s) => r`<td>${this.renderPreviewCell(o.get(s))}</td>`)}</tr>`)}</tbody></table></div></div>`;
|
|
185
201
|
default:
|
|
186
202
|
return r`<span class="disabled-state-text">${this.messages.nopreviewloaded ?? "Select a FeatureSet variable and load a preview."}</span>`;
|
|
187
203
|
}
|
|
188
204
|
}
|
|
189
205
|
renderTabs() {
|
|
190
206
|
const e = this.previewTabsState.activeTabId;
|
|
191
|
-
return r`<calcite-tabs><calcite-tab-nav slot=title-group><calcite-tab-title .tab=${
|
|
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>`;
|
|
192
208
|
}
|
|
193
209
|
render() {
|
|
194
|
-
const { line: e } = this.debuggerStore?.executionState ?? {}, t = this.breakpoints.find((
|
|
195
|
-
return r`<div class="console-shell"><div class="breakpoint-header"><arcgis-code-viewer language=arcade class="breakpoint-code-viewer" .lineNumbers=${(
|
|
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"><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>`;
|
|
196
212
|
}
|
|
197
213
|
}
|
|
198
|
-
|
|
214
|
+
v("arcgis-arcade-debugger-console", N);
|
|
199
215
|
export {
|
|
200
|
-
|
|
216
|
+
N as ArcgisArcadeDebuggerConsole
|
|
201
217
|
};
|
|
@@ -37,22 +37,22 @@ async function ge({
|
|
|
37
37
|
const s = t.replace(/\/sharing\/rest(\/.*)?$/iu, "").replace(/\/$/u, "");
|
|
38
38
|
if (!await he(s))
|
|
39
39
|
return { shouldRender: !1 };
|
|
40
|
-
const a = await ue(t), r = `${s}/sharing/rest/portals/self?f=json&token=${a}`, n = `${s}/sharing/rest/portals/self/settings?f=json&token=${a}`, d = `${s}/sharing/rest/portals/self/signinSettings?f=json&token=${a}`,
|
|
40
|
+
const a = await ue(t), r = `${s}/sharing/rest/portals/self?f=json&token=${a}`, n = `${s}/sharing/rest/portals/self/settings?f=json&token=${a}`, d = `${s}/sharing/rest/portals/self/signinSettings?f=json&token=${a}`, E = await Promise.allSettled([
|
|
41
41
|
fetch(r, { credentials: "include" }).then((S) => S.json()),
|
|
42
42
|
fetch(n, { credentials: "include" }).then((S) => S.json()),
|
|
43
43
|
fetch(d, { credentials: "include" }).then((S) => S.json())
|
|
44
|
-
]), [
|
|
45
|
-
if (
|
|
44
|
+
]), [w, R, C] = E, D = w.status === "fulfilled" ? w.value : (p("warn", `Failed to fetch selfUrl. Reason: ${w.reason}.`), {}), M = R.status === "fulfilled" ? R.value : (p("warn", `Failed to fetch settingsUrl. Reason: ${R.reason}.`), {}), G = C.status === "fulfilled" ? C.value : (p("warn", `Failed to fetch signinSettingsUrl. Reason: ${C.reason}.`), {});
|
|
45
|
+
if (D.isPortal)
|
|
46
46
|
return { shouldRender: !1 };
|
|
47
|
-
const k =
|
|
47
|
+
const k = D.helpBase || "";
|
|
48
48
|
if (!M)
|
|
49
49
|
return p("warn", "Settings response is not available."), { shouldRender: !1 };
|
|
50
50
|
let I = le(M);
|
|
51
51
|
G.blockBetaApps === !0 && (p(
|
|
52
52
|
"warn",
|
|
53
53
|
"Arcade Assistant is blocked by the organization settings. To enable it, do not block beta apps in the organization settings."
|
|
54
|
-
), I = !1),
|
|
55
|
-
const B =
|
|
54
|
+
), I = !1), D?.user?.privileges?.includes("portal:user:useAIAssistants") || (p("warn", "User does not have the required privileges to use AI Assistants."), I = !1);
|
|
55
|
+
const B = D?.helperServices?.aiAssistantServices?.url;
|
|
56
56
|
return B ? {
|
|
57
57
|
shouldRender: !0,
|
|
58
58
|
serviceUrl: B,
|
|
@@ -101,7 +101,7 @@ _([
|
|
|
101
101
|
u = _([
|
|
102
102
|
m("ArcadeDebuggerLazyTreeNodeState")
|
|
103
103
|
], u);
|
|
104
|
-
let
|
|
104
|
+
let A = class extends f {
|
|
105
105
|
constructor(t) {
|
|
106
106
|
super(t), this.generation = 0, this.nodes = /* @__PURE__ */ new Map();
|
|
107
107
|
}
|
|
@@ -160,9 +160,9 @@ let D = class extends f {
|
|
|
160
160
|
this.nodes.clear();
|
|
161
161
|
}
|
|
162
162
|
};
|
|
163
|
-
|
|
163
|
+
A = _([
|
|
164
164
|
m("ArcadeDebuggerLazyTreeState")
|
|
165
|
-
],
|
|
165
|
+
], A);
|
|
166
166
|
var _e = Object.defineProperty, fe = Object.getOwnPropertyDescriptor, c = (t, e, s, i) => {
|
|
167
167
|
for (var a = i > 1 ? void 0 : i ? fe(e, s) : e, r = t.length - 1, n; r >= 0; r--)
|
|
168
168
|
(n = t[r]) && (a = (i ? n(e, s, a) : n(a)) || a);
|
|
@@ -275,7 +275,7 @@ $ = c([
|
|
|
275
275
|
], $);
|
|
276
276
|
let h = class extends f {
|
|
277
277
|
constructor(t) {
|
|
278
|
-
super(t), this.execution = new b(), this.lazyTreeState = new
|
|
278
|
+
super(t), this.execution = new b(), this.lazyTreeState = new A(), this.pausedFrame = new $(), this.previewTabsState = new N(), this.session = new y(), this.ui = new v();
|
|
279
279
|
}
|
|
280
280
|
get breakpoints() {
|
|
281
281
|
return this.session.breakpoints;
|
|
@@ -423,7 +423,7 @@ let h = class extends f {
|
|
|
423
423
|
this.pausedLine = void 0, this.lazyTreeState.reset(), this.previewTabsState.clear();
|
|
424
424
|
}
|
|
425
425
|
replaceTransientDebuggerState() {
|
|
426
|
-
this.pausedLine = void 0, this.lazyTreeState = new
|
|
426
|
+
this.pausedLine = void 0, this.lazyTreeState = new A(), this.previewTabsState = new N();
|
|
427
427
|
}
|
|
428
428
|
};
|
|
429
429
|
c([
|
|
@@ -526,20 +526,18 @@ class Se extends K {
|
|
|
526
526
|
}), e.has("arcadeAssistant") && this._updateArcadeAssistantRemoteState();
|
|
527
527
|
}
|
|
528
528
|
async loaded() {
|
|
529
|
-
|
|
529
|
+
await this._connectMonacoCustomizations(), this._componentReadyDefer.resolve(), await this._codeEditorElt.value?.setFocus();
|
|
530
530
|
}
|
|
531
531
|
_setOpenedSidePanel(e) {
|
|
532
532
|
this.openedSidePanel = e === this.openedSidePanel ? "none" : e;
|
|
533
533
|
}
|
|
534
534
|
async _connectMonacoCustomizations() {
|
|
535
|
-
if (this.
|
|
535
|
+
if (this._connectMonacoCustomizationsPromise)
|
|
536
536
|
return await this._connectMonacoCustomizationsPromise;
|
|
537
537
|
this._connectMonacoCustomizationsPromise = (async () => {
|
|
538
|
-
if (
|
|
538
|
+
if (!this.isConnected)
|
|
539
539
|
return;
|
|
540
540
|
const e = await ee();
|
|
541
|
-
if (!this.isConnected || this._disposables.length)
|
|
542
|
-
return;
|
|
543
541
|
this._disposables.push(e.onDiagnosticsChange((d) => !this._preparingArcade && this.arcgisDiagnosticsChange.emit(d.diagnostics))), this.testData && !this._executeScriptAction && this._addExecuteScriptAction();
|
|
544
542
|
const s = T(() => this._debuggerState.breakpoints, () => this._updateBreakpointsDecorations(), { sync: !0 }), i = T(() => this._debuggerState.debuggerLine, () => this._updateDebuggerPausedLineDecoration(), { sync: !0 }), a = T(() => this._debuggerState.consoleLogs.length, () => this.requestUpdate(), { sync: !0 });
|
|
545
543
|
this._disposables.push({ dispose: () => s.remove() }, { dispose: () => i.remove() }, { dispose: () => a.remove() });
|
|
@@ -645,7 +643,7 @@ class Se extends K {
|
|
|
645
643
|
(async () => {
|
|
646
644
|
const r = this._codeEditorElt.value?.value, n = {
|
|
647
645
|
mode: e,
|
|
648
|
-
console: (
|
|
646
|
+
console: (E) => this._debuggerState.addConsoleLog(E),
|
|
649
647
|
breakpoints: e === "debug" ? this._debuggerState.debuggerBreakpoints : void 0
|
|
650
648
|
};
|
|
651
649
|
e === "debug" && (n.onDebugPause = this._handleDebugPause.bind(this, i));
|