@arcgis/coding-components 5.1.0-next.87 → 5.1.0-next.89
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/3VRELPEF.js +2 -0
- package/dist/cdn/4B64NBIM.js +2 -0
- package/dist/cdn/5DAIGIIS.js +2 -0
- package/dist/cdn/6EKA3H3N.js +2 -0
- package/dist/cdn/6G5URSC7.js +2 -0
- package/dist/cdn/{BVNLUX5A.js → 6HL5GBWZ.js} +1 -1
- package/dist/cdn/7B33SKQD.js +2 -0
- package/dist/cdn/{GJMI6M3I.js → BA546EMZ.js} +1 -1
- package/dist/cdn/{2PRSVBDA.js → BKBBI4SA.js} +1 -1
- package/dist/cdn/BQISDYES.js +2 -0
- package/dist/cdn/E3TJIEWT.js +2 -0
- package/dist/cdn/FEYQMPLI.js +2 -0
- package/dist/cdn/GLJQQLP2.js +2 -0
- package/dist/cdn/{4I7VT4LW.js → I22MLDO4.js} +1 -1
- package/dist/cdn/ID3QICBM.js +4 -0
- package/dist/cdn/IIER7Z56.js +2 -0
- package/dist/cdn/{LWXQURWG.js → ILQJDTTW.js} +1 -1
- package/dist/cdn/JIBWBXDI.js +3 -0
- package/dist/cdn/{KEROXLGY.js → JT3FBAVQ.js} +1 -1
- package/dist/cdn/KA5TX72B.js +64 -0
- package/dist/cdn/MC6EICRD.js +2 -0
- package/dist/cdn/MJ7MJPGA.js +2 -0
- package/dist/cdn/MTIHPCIF.js +2 -0
- package/dist/cdn/N75AXIUZ.js +2 -0
- package/dist/cdn/NEIT2PGG.js +2 -0
- package/dist/cdn/{N7KYUPBV.js → NK5J27LM.js} +1 -1
- package/dist/cdn/NKJUJKFG.js +2 -0
- package/dist/cdn/NZDJGAT2.js +2 -0
- package/dist/cdn/{JHVMGSI2.js → OI3DH7N2.js} +1 -1
- package/dist/cdn/QMNQFBIA.js +4 -0
- package/dist/cdn/{INPMAY4D.js → SM3MA3KP.js} +1 -1
- package/dist/cdn/SMAQD57G.js +2 -0
- package/dist/cdn/{6XDEGPYR.js → UOQZCTHQ.js} +1 -1
- package/dist/cdn/{QOX2FNYP.js → VA6SZILK.js} +1 -1
- package/dist/cdn/VKNLGQFU.js +2 -0
- package/dist/cdn/{YLJUOSJJ.js → XBM4ZDJT.js} +1 -1
- package/dist/cdn/YVF4PPDB.js +2 -0
- package/dist/cdn/assets/arcade-debugger-console/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/arcade-debugger-output/t9n/messages.en.json +1 -0
- package/dist/cdn/assets/arcade-editor/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/code-editor/sql-expr.worker.js +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/chunks/ArcadeDebuggerPreviewTabsState.js +178 -0
- package/dist/chunks/arcade-executor.js +76 -67
- package/dist/chunks/arcade-service-accessors.js +2 -2
- package/dist/chunks/colorize.js +9 -9
- package/dist/chunks/debugger-value-components.js +275 -0
- package/dist/chunks/debugger-value-styles.js +171 -0
- package/dist/chunks/functional.js +83 -0
- package/dist/chunks/setup-monaco-theme.js +1 -1
- package/dist/chunks/utilities.js +44 -34
- package/dist/components/arcgis-arcade-debugger-console/customElement.js +201 -0
- package/dist/components/arcgis-arcade-debugger-console/index.js +11 -0
- package/dist/components/arcgis-arcade-debugger-output/customElement.js +42 -0
- package/dist/components/arcgis-arcade-debugger-output/index.js +5 -0
- package/dist/components/arcgis-arcade-editor/customElement.d.ts +34 -1
- package/dist/components/arcgis-arcade-editor/customElement.js +639 -111
- package/dist/components/arcgis-arcade-editor/index.js +2 -0
- package/dist/components/arcgis-arcade-results/customElement.js +52 -155
- package/dist/components/arcgis-code-editor/customElement.js +1 -1
- package/dist/components/arcgis-code-editor-shell/customElement.d.ts +2 -1
- package/dist/components/arcgis-code-editor-shell/customElement.js +17 -8
- package/dist/components/arcgis-code-viewer/customElement.d.ts +28 -1
- package/dist/components/arcgis-code-viewer/customElement.js +65 -52
- 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/loader.js +5 -3
- package/dist/types/lumina.d.ts +2 -2
- package/dist/types/preact.d.ts +2 -2
- package/dist/types/react.d.ts +2 -2
- package/dist/types/stencil.d.ts +2 -2
- package/dist/utils/arcade-executor.d.ts +2 -1
- package/package.json +5 -5
- package/dist/cdn/3GNGWLOI.js +0 -2
- package/dist/cdn/3UZ3JCYW.js +0 -4
- package/dist/cdn/43A7UCSS.js +0 -2
- package/dist/cdn/4Y64BGY2.js +0 -2
- package/dist/cdn/BGQRJR32.js +0 -2
- package/dist/cdn/CPJ4MNMY.js +0 -2
- package/dist/cdn/G2Z2DNVW.js +0 -2
- package/dist/cdn/ISAWP6I3.js +0 -2
- package/dist/cdn/IVNVT7UT.js +0 -2
- package/dist/cdn/KD7MZWFX.js +0 -2
- package/dist/cdn/MSV4QVR2.js +0 -2
- package/dist/cdn/PX32GRG7.js +0 -2
- package/dist/cdn/QRXX4WHP.js +0 -3
- package/dist/cdn/T4G2IY4F.js +0 -2
- package/dist/cdn/TTOHS2DV.js +0 -11
- package/dist/cdn/VUYXKN7I.js +0 -2
- package/dist/cdn/YMEY2NOQ.js +0 -4
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import { c as h } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as u, html as r } from "lit";
|
|
4
|
+
import { repeat as p } from "lit/directives/repeat.js";
|
|
5
|
+
import { LitElement as f, safeClassMap as w, nothing as g } from "@arcgis/lumina";
|
|
6
|
+
import { u as x } from "../../chunks/useT9n.js";
|
|
7
|
+
import { load as k } from "@arcgis/lumina/controllers";
|
|
8
|
+
import { i as S } from "../../chunks/monaco-importer.js";
|
|
9
|
+
import { t as l } from "../../chunks/functional.js";
|
|
10
|
+
import { d as $, g as y, c as b } from "../../chunks/debugger-value-styles.js";
|
|
11
|
+
import { i as v, a as T, p as P, b as L, c as E, d as C, S as B, D as z, e as M } from "../../chunks/debugger-value-components.js";
|
|
12
|
+
import { observeAncestorsMutation as I, unsafeGetCalciteModeName as V } from "@arcgis/toolkit/dom";
|
|
13
|
+
import { generateGuid as D } from "@arcgis/toolkit/string";
|
|
14
|
+
import { d as c } from "../../chunks/ArcadeDebuggerPreviewTabsState.js";
|
|
15
|
+
import { Uri as A } from "monaco-editor";
|
|
16
|
+
const N = 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 F extends f {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(...arguments), this.messages = x(), this._monacoEditor = k(S), this._breakpointPopoverId = `arcade-debugger-console-breakpoints-${D()}`, this.modelId = "";
|
|
20
|
+
}
|
|
21
|
+
static {
|
|
22
|
+
this.properties = { debuggerStore: 0, modelId: 1 };
|
|
23
|
+
}
|
|
24
|
+
static {
|
|
25
|
+
this.styles = [N, $, y()];
|
|
26
|
+
}
|
|
27
|
+
get breakpoints() {
|
|
28
|
+
return this.debuggerStore?.debuggerBreakpoints ?? [];
|
|
29
|
+
}
|
|
30
|
+
get previewTabsState() {
|
|
31
|
+
return this.debuggerStore.previewTabsState;
|
|
32
|
+
}
|
|
33
|
+
get lazyTreeState() {
|
|
34
|
+
return this.debuggerStore?.lazyTreeState;
|
|
35
|
+
}
|
|
36
|
+
load() {
|
|
37
|
+
this.manager.onLifecycle(() => {
|
|
38
|
+
const e = I(this.el, ["class"], this.updateTheme.bind(this));
|
|
39
|
+
return this.updateTheme(), () => e();
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
getContentAtLine(e) {
|
|
43
|
+
if (!this.modelId)
|
|
44
|
+
return "";
|
|
45
|
+
const t = this._monacoEditor.getModel(A.parse(this.modelId));
|
|
46
|
+
return t ? t.getLineContent(e) : "";
|
|
47
|
+
}
|
|
48
|
+
updateTheme() {
|
|
49
|
+
V(this.el) === "dark" ? this.elementInternals.states.add(b) : this.elementInternals.states.delete(b);
|
|
50
|
+
}
|
|
51
|
+
getBreakpointCode(e) {
|
|
52
|
+
return e == null ? this.messages.nocontent ?? "No content" : this.getContentAtLine(e) || (this.messages.nocontent ?? "No content");
|
|
53
|
+
}
|
|
54
|
+
getPreviewLoadErrorMessage() {
|
|
55
|
+
return this.messages.previewloaderror ?? "Unable to load preview.";
|
|
56
|
+
}
|
|
57
|
+
getBreakpointPositionText(e) {
|
|
58
|
+
return (this.messages.breakpointposition ?? "{position} of {count}" ?? "{position} of {count}").replace("{position}", String(e)).replace("{count}", String(this.breakpoints.length));
|
|
59
|
+
}
|
|
60
|
+
findCollectionItemByPreviewSegment(e, t) {
|
|
61
|
+
if (t.startsWith("name:")) {
|
|
62
|
+
const i = t.slice(5);
|
|
63
|
+
return e.find((a) => a.name === i)?.featureSet;
|
|
64
|
+
}
|
|
65
|
+
if (t.startsWith("id:")) {
|
|
66
|
+
const i = t.slice(3);
|
|
67
|
+
return e.find((a) => String(a.id) === i)?.featureSet;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
getExpandedDebuggerMap(e) {
|
|
71
|
+
if (e == null || !v(e))
|
|
72
|
+
return null;
|
|
73
|
+
const t = e.expand();
|
|
74
|
+
return Array.isArray(t) ? null : t;
|
|
75
|
+
}
|
|
76
|
+
getPreviewRows(e) {
|
|
77
|
+
return e.map((t) => {
|
|
78
|
+
const i = this.getExpandedDebuggerMap(t);
|
|
79
|
+
return i || /* @__PURE__ */ new Map();
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
getExpandedDebuggerChild(e, t) {
|
|
83
|
+
if (!e || !v(e))
|
|
84
|
+
return;
|
|
85
|
+
const i = e.expand();
|
|
86
|
+
if (Array.isArray(i)) {
|
|
87
|
+
const a = Number(t);
|
|
88
|
+
return !Number.isInteger(a) || String(a) !== t ? void 0 : i[a];
|
|
89
|
+
}
|
|
90
|
+
return i.get(t);
|
|
91
|
+
}
|
|
92
|
+
async resolvePreviewValueFromSegments(e, t) {
|
|
93
|
+
if (!t.length)
|
|
94
|
+
return e;
|
|
95
|
+
if (!e)
|
|
96
|
+
return;
|
|
97
|
+
const [i, ...a] = t;
|
|
98
|
+
let s;
|
|
99
|
+
if (T(e)) {
|
|
100
|
+
const o = await e.load();
|
|
101
|
+
s = this.findCollectionItemByPreviewSegment(o, i);
|
|
102
|
+
} else
|
|
103
|
+
s = this.getExpandedDebuggerChild(e, i);
|
|
104
|
+
return await this.resolvePreviewValueFromSegments(s, a);
|
|
105
|
+
}
|
|
106
|
+
async resolvePreviewValue(e) {
|
|
107
|
+
const t = this.debuggerStore?.executionState?.result;
|
|
108
|
+
if (!t)
|
|
109
|
+
return;
|
|
110
|
+
const i = P(e);
|
|
111
|
+
if (!i)
|
|
112
|
+
return;
|
|
113
|
+
const { scopeName: a, rootName: s, pathSegments: o } = i, n = a === "globals" ? t.globals : a === "locals" ? t.locals : null;
|
|
114
|
+
if (n)
|
|
115
|
+
return await this.resolvePreviewValueFromSegments(n.get(s), o);
|
|
116
|
+
}
|
|
117
|
+
async loadPreview({ label: e, sourcePath: t, value: i }) {
|
|
118
|
+
const a = this.previewTabsState, { snapshot: s } = a.startLoad(e, t);
|
|
119
|
+
let o = i;
|
|
120
|
+
if (o == null)
|
|
121
|
+
try {
|
|
122
|
+
o = await this.resolvePreviewValue(t);
|
|
123
|
+
} catch {
|
|
124
|
+
a.setError(s, this.getPreviewLoadErrorMessage());
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
if (o == null || !L(o) || typeof o.querySample != "function" || typeof o.schema != "function") {
|
|
128
|
+
a.setUnavailable(s, this.messages.previewunavailable ?? "This preview is no longer available in the current paused state.");
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
try {
|
|
132
|
+
const { fields: n, features: d } = await o.querySample(), m = this.getPreviewRows(d);
|
|
133
|
+
a.setLoaded(s, n, m);
|
|
134
|
+
} catch {
|
|
135
|
+
a.setError(s, this.getPreviewLoadErrorMessage());
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
activateTab(e) {
|
|
139
|
+
if (e === c) {
|
|
140
|
+
this.previewTabsState.selectScope();
|
|
141
|
+
return;
|
|
142
|
+
}
|
|
143
|
+
this.previewTabsState.selectTab(e);
|
|
144
|
+
const t = this.previewTabsState.getTab(e);
|
|
145
|
+
t?.invalidated && this.loadPreview({ label: t.label, sourcePath: t.sourcePath });
|
|
146
|
+
}
|
|
147
|
+
closePreviewTab(e) {
|
|
148
|
+
e.closed = !1, this.previewTabsState.closeTab(e.tab);
|
|
149
|
+
}
|
|
150
|
+
scrollToSelectedBreakpoint(e) {
|
|
151
|
+
const t = e.currentTarget;
|
|
152
|
+
requestAnimationFrame(() => {
|
|
153
|
+
t?.querySelector(".breakpoint-list-item--current")?.scrollIntoView({ block: "center" });
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
renderPreviewLabel(e) {
|
|
157
|
+
return r`<bdi>${e}</bdi>`;
|
|
158
|
+
}
|
|
159
|
+
renderPreviewCell(e) {
|
|
160
|
+
return e ? E(e) || C(e) ? B({ value: e }) : r`<span class="xs"></span>` : r`<span class="xs"></span>`;
|
|
161
|
+
}
|
|
162
|
+
renderScopeEntryForScope(e, t, i) {
|
|
163
|
+
const [a, s] = i, o = `${t}.${a}`, n = this.lazyTreeState;
|
|
164
|
+
return n ? z({ name: a, value: s, messages: this.messages, path: `${e}.${a}`, lazyTreeState: n, previewLabel: o, previewSourcePath: M(e, a), previewLoading: this.previewTabsState.isTabLoading(o), onLoadPreview: (d) => {
|
|
165
|
+
this.loadPreview(d);
|
|
166
|
+
} }) : null;
|
|
167
|
+
}
|
|
168
|
+
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, i) => 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(i + 1)}</bdi></div><arcgis-code-viewer language=arcade class="breakpoint-code-viewer" .lineNumbers=${(a) => String(a + t.line - 1)}>${this.getBreakpointCode(t.line)}</arcgis-code-viewer></div>`)}</div></div></calcite-popover>` : null;
|
|
170
|
+
}
|
|
171
|
+
renderScopePanel() {
|
|
172
|
+
const e = this.debuggerStore?.executionState?.result, t = !!(e?.locals && e.locals.size > 0), i = Array.from(e?.globals ?? []), a = Array.from(e?.locals ?? []);
|
|
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}>${i.map((s) => this.renderScopeEntryForScope("globals", this.messages.global ?? "Global", s))}</calcite-tree></calcite-tree-item><calcite-tree-item expanded .disabled=${!t}>${this.messages.local ?? "Local"}<calcite-tree slot=children .lines=${l.lines} .selectionMode=${l.selectionMode} .scale=${l.scale} @calciteTreeSelect=${l.oncalciteTreeSelect}>${t ? a.map((s) => this.renderScopeEntryForScope("locals", this.messages.local ?? "Local", s)) : r`<span><i>${this.messages.nolocalscope ?? "No local scope"}</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
|
+
}
|
|
175
|
+
renderPreviewPanel(e) {
|
|
176
|
+
switch (e.status) {
|
|
177
|
+
case "loading":
|
|
178
|
+
return r`<div class="preview-empty-state"><calcite-loader scale=s type=indeterminate .label=${this.messages.loadingpreview ?? "Loading preview"} .text=${this.messages.loadingpreview ?? "Loading preview"}></calcite-loader></div>`;
|
|
179
|
+
case "unavailable":
|
|
180
|
+
case "error":
|
|
181
|
+
return r`<span class="disabled-state-text">${e.message}</span>`;
|
|
182
|
+
case "loaded":
|
|
183
|
+
const { fields: t, label: i, rows: a } = e;
|
|
184
|
+
return !a.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(i)}</div><div class="table-scroll"><table><thead><tr>${t.map((s) => r`<th><bdi>${s}</bdi></th>`)}</tr></thead><tbody>${a.map((s) => r`<tr>${t.map((o) => r`<td>${this.renderPreviewCell(s.get(o))}</td>`)}</tr>`)}</tbody></table></div></div>`;
|
|
185
|
+
default:
|
|
186
|
+
return r`<span class="disabled-state-text">${this.messages.nopreviewloaded ?? "Select a FeatureSet variable and load a preview."}</span>`;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
renderTabs() {
|
|
190
|
+
const e = this.previewTabsState.activeTabId;
|
|
191
|
+
return r`<calcite-tabs><calcite-tab-nav slot=title-group><calcite-tab-title .tab=${c} .selected=${e === c} @calciteTabsActivate=${(t) => this.activateTab(t.target.tab)}>${this.messages.scope ?? "Scope"}</calcite-tab-title>${p(this.previewTabsState.tabs, (t) => `title-${t.id}`, (t) => r`<calcite-tab-title .tab=${t.id} title=${t.label ?? g} closable .selected=${e === t.id} @calciteTabsActivate=${(i) => this.activateTab(i.target.tab)} @calciteTabsClose=${(i) => this.closePreviewTab(i.target)}><bdi>${t.title}</bdi></calcite-tab-title>`)}</calcite-tab-nav><calcite-tab .tab=${c} .selected=${e === c}><div class="tab-panel">${this.renderScopePanel()}</div></calcite-tab>${p(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
|
+
}
|
|
193
|
+
render() {
|
|
194
|
+
const { line: e } = this.debuggerStore?.executionState ?? {}, t = this.breakpoints.find((a) => a.line === e), i = this.breakpoints.findIndex((a) => a.line === e);
|
|
195
|
+
return r`<div class="console-shell"><div class="breakpoint-header"><arcgis-code-viewer language=arcade class="breakpoint-code-viewer" .lineNumbers=${(a) => String(a + (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 ?? g} scale=s .text=${this.getBreakpointPositionText(i >= 0 ? i + 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
|
+
}
|
|
197
|
+
}
|
|
198
|
+
h("arcgis-arcade-debugger-console", F);
|
|
199
|
+
export {
|
|
200
|
+
F as ArcgisArcadeDebuggerConsole
|
|
201
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "@esri/calcite-components/components/calcite-tree";
|
|
2
|
+
import "@esri/calcite-components/components/calcite-tree-item";
|
|
3
|
+
import "@esri/calcite-components/components/calcite-loader";
|
|
4
|
+
import "@esri/calcite-components/components/calcite-action";
|
|
5
|
+
import "@esri/calcite-components/components/calcite-popover";
|
|
6
|
+
import "../arcgis-code-viewer/index.js";
|
|
7
|
+
import "@esri/calcite-components/components/calcite-tabs";
|
|
8
|
+
import "@esri/calcite-components/components/calcite-tab-nav";
|
|
9
|
+
import "@esri/calcite-components/components/calcite-tab-title";
|
|
10
|
+
import "@esri/calcite-components/components/calcite-tab";
|
|
11
|
+
export * from "./customElement.js";
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
|
|
2
|
+
import { c as r } from "../../chunks/runtime.js";
|
|
3
|
+
import { css as l, html as s } from "lit";
|
|
4
|
+
import { LitElement as i } from "@arcgis/lumina";
|
|
5
|
+
import { u as o } from "../../chunks/useT9n.js";
|
|
6
|
+
import { d as c, g as n, c as a, t } from "../../chunks/debugger-value-styles.js";
|
|
7
|
+
import { observeAncestorsMutation as u, unsafeGetCalciteModeName as d } from "@arcgis/toolkit/dom";
|
|
8
|
+
import { D as m } from "../../chunks/debugger-value-components.js";
|
|
9
|
+
const p = 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)}.ltr-container{direction:ltr}[class*=result-value-]{line-height:1.25rem}}`;
|
|
10
|
+
class h extends i {
|
|
11
|
+
constructor() {
|
|
12
|
+
super(...arguments), this.messages = o();
|
|
13
|
+
}
|
|
14
|
+
static {
|
|
15
|
+
this.properties = { debuggerStore: 0, result: 0 };
|
|
16
|
+
}
|
|
17
|
+
static {
|
|
18
|
+
this.styles = [p, c, n()];
|
|
19
|
+
}
|
|
20
|
+
load() {
|
|
21
|
+
this.manager.onLifecycle(() => {
|
|
22
|
+
const e = u(this.el, ["class"], this.updateTheme.bind(this));
|
|
23
|
+
return this.updateTheme(), () => e();
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
willUpdate(e) {
|
|
27
|
+
e.has("result") && this.result && this.debuggerStore?.lazyTreeState.reset();
|
|
28
|
+
}
|
|
29
|
+
updateTheme() {
|
|
30
|
+
d(this.el) === "dark" ? this.elementInternals.states.add(a) : this.elementInternals.states.delete(a);
|
|
31
|
+
}
|
|
32
|
+
render() {
|
|
33
|
+
if (!this.result)
|
|
34
|
+
return s`<span class="disabled-state-text">${this.messages.nooutput ?? "No output available."}</span>`;
|
|
35
|
+
const e = this.debuggerStore?.lazyTreeState;
|
|
36
|
+
return e ? s`<calcite-tree .scale=${t.scale} @calciteTreeSelect=${t.oncalciteTreeSelect} .lines=${t.lines} .selectionMode=${t.selectionMode}>${m({ expanded: !0, name: this.result.arcadeType, value: this.result, messages: this.messages, path: this.result.arcadeType, lazyTreeState: e })}</calcite-tree>` : s`<span class="disabled-state-text">${this.messages.nooutput ?? "No output available."}</span>`;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
r("arcgis-arcade-debugger-output", h);
|
|
40
|
+
export {
|
|
41
|
+
h as ArcgisArcadeDebuggerOutput
|
|
42
|
+
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import "@esri/calcite-components/components/calcite-tree";
|
|
2
|
+
import "@esri/calcite-components/components/calcite-tree-item";
|
|
3
|
+
import "@esri/calcite-components/components/calcite-loader";
|
|
4
|
+
import "@esri/calcite-components/components/calcite-action";
|
|
5
|
+
export * from "./customElement.js";
|
|
@@ -54,7 +54,13 @@ export abstract class ArcgisArcadeEditor extends LitElement {
|
|
|
54
54
|
*
|
|
55
55
|
* To get the full list of available options, see the Monaco Editor options [documentation](https://microsoft.github.io/monaco-editor/docs.html#interfaces/editor_editor_api.editor.IEditorOptions.html) for more details.
|
|
56
56
|
*/
|
|
57
|
-
accessor editorOptions: Editor.IEditorOptions & Editor.IGlobalEditorOptions | undefined;
|
|
57
|
+
accessor editorOptions: (Editor.IEditorOptions & Editor.IGlobalEditorOptions) | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Enables the bottom run and debug drawer UX.
|
|
60
|
+
*
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
accessor enableDebugger: boolean;
|
|
58
64
|
/**
|
|
59
65
|
* If true, it will hide the documentation action in the side panel
|
|
60
66
|
*
|
|
@@ -78,7 +84,16 @@ export abstract class ArcgisArcadeEditor extends LitElement {
|
|
|
78
84
|
constantsandfunctions?: string | undefined;
|
|
79
85
|
suggestions?: string | undefined;
|
|
80
86
|
run?: string | undefined;
|
|
87
|
+
runanddebug?: string | undefined;
|
|
88
|
+
continue?: string | undefined;
|
|
89
|
+
reset?: string | undefined;
|
|
90
|
+
stop?: string | undefined;
|
|
81
91
|
lastresults?: string | undefined;
|
|
92
|
+
close?: string | undefined;
|
|
93
|
+
output?: string | undefined;
|
|
94
|
+
console?: string | undefined;
|
|
95
|
+
log?: string | undefined;
|
|
96
|
+
debugconsole?: string | undefined;
|
|
82
97
|
arcadeassistant?: string | undefined;
|
|
83
98
|
profileempty?: string | undefined;
|
|
84
99
|
};
|
|
@@ -89,7 +104,16 @@ export abstract class ArcgisArcadeEditor extends LitElement {
|
|
|
89
104
|
constantsandfunctions: string;
|
|
90
105
|
suggestions: string;
|
|
91
106
|
run: string;
|
|
107
|
+
runanddebug: string;
|
|
108
|
+
continue: string;
|
|
109
|
+
reset: string;
|
|
110
|
+
stop: string;
|
|
92
111
|
lastresults: string;
|
|
112
|
+
close: string;
|
|
113
|
+
output: string;
|
|
114
|
+
console: string;
|
|
115
|
+
log: string;
|
|
116
|
+
debugconsole: string;
|
|
93
117
|
arcadeassistant: string;
|
|
94
118
|
profileempty: string;
|
|
95
119
|
}> & T9nMeta<{
|
|
@@ -98,7 +122,16 @@ export abstract class ArcgisArcadeEditor extends LitElement {
|
|
|
98
122
|
constantsandfunctions: string;
|
|
99
123
|
suggestions: string;
|
|
100
124
|
run: string;
|
|
125
|
+
runanddebug: string;
|
|
126
|
+
continue: string;
|
|
127
|
+
reset: string;
|
|
128
|
+
stop: string;
|
|
101
129
|
lastresults: string;
|
|
130
|
+
close: string;
|
|
131
|
+
output: string;
|
|
132
|
+
console: string;
|
|
133
|
+
log: string;
|
|
134
|
+
debugconsole: string;
|
|
102
135
|
arcadeassistant: string;
|
|
103
136
|
profileempty: string;
|
|
104
137
|
}>;
|