@arcgis/coding-components 5.0.0-next.93 → 5.0.0-next.95
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/addons/arcade-coding-assistant/chat-helper.d.ts +3 -3
- package/dist/addons.js +26 -25
- package/dist/cdn/{ETMVFEBE.js → 26R4B4SR.js} +2 -2
- package/dist/cdn/{XOQ3RM5Y.js → 54FZPXUP.js} +2 -2
- package/dist/cdn/{ZBXNENKW.js → 5DAT5ZFW.js} +2 -2
- package/dist/cdn/{ITSWV2D2.js → BAKKWJI7.js} +2 -2
- package/dist/cdn/{BYEBULNN.js → CJ6SJGTO.js} +2 -2
- package/dist/cdn/{QONUPJDY.js → CLUG3LC4.js} +1 -1
- package/dist/cdn/{5XCYAKJJ.js → D5OWDVIG.js} +2 -2
- package/dist/cdn/{4P5HZOXS.js → DFLUHXMI.js} +2 -2
- package/dist/cdn/{LBTNX3UD.js → DIFXXFOE.js} +2 -2
- package/dist/cdn/{A323TEFP.js → DNW5A5G6.js} +2 -2
- package/dist/cdn/DPEHWNF4.js +14 -0
- package/dist/cdn/{QDDMGH2B.js → EMLWH6JD.js} +2 -2
- package/dist/cdn/{VAELJETA.js → FDTYASER.js} +2 -2
- package/dist/cdn/{UGVEW6ZQ.js → H44HKSEL.js} +1 -1
- package/dist/cdn/{5CEEVUCZ.js → HQO32HVD.js} +2 -2
- package/dist/cdn/{7FSEYOGD.js → HR7CEM5J.js} +2 -2
- package/dist/cdn/J5JG7YJY.js +4 -0
- package/dist/cdn/KFNUX4NF.js +4 -0
- package/dist/cdn/{I4JO32WF.js → KU2RSLW6.js} +2 -2
- package/dist/cdn/{PGSOHB37.js → KUOOSF2Y.js} +2 -2
- package/dist/cdn/MMTP5K7U.js +6 -0
- package/dist/cdn/{5EBSP7DM.js → NA3DW5WP.js} +2 -2
- package/dist/cdn/{V5FQNTXG.js → P3ADDEIL.js} +2 -2
- package/dist/cdn/{Z4L7OJKT.js → PJE2D7RB.js} +2 -2
- package/dist/cdn/{ZCT5XGMI.js → Q6M3EIWR.js} +1 -1
- package/dist/cdn/QGWBJM2F.js +4 -0
- package/dist/cdn/{GYL2QCR7.js → QNHGH7LN.js} +2 -2
- package/dist/cdn/{CT7TBHUK.js → QSZ5Q2P3.js} +2 -2
- package/dist/cdn/{CY2NIZSQ.js → QXAPL2AZ.js} +1 -1
- package/dist/cdn/{LC7PNNVV.js → R3ZFQ3NB.js} +3 -3
- package/dist/cdn/{N7HNKUKK.js → RTU52FLE.js} +2 -2
- package/dist/cdn/SE7546PF.js +4 -0
- package/dist/cdn/T5QY5OT3.js +4 -0
- package/dist/cdn/TBTRAJ2W.js +4 -0
- package/dist/cdn/{URZFEWH3.js → UEGR62F7.js} +2 -2
- package/dist/cdn/{PO35LCAS.js → UHWI5CWO.js} +2 -2
- package/dist/cdn/UQDJQX5N.js +4 -0
- package/dist/cdn/{K3L3TIEP.js → V5OOACSR.js} +2 -2
- package/dist/cdn/VLKLFWDG.js +4 -0
- package/dist/cdn/{2X52Y4DY.js → VYAAHXIM.js} +1 -1
- package/dist/cdn/W3HRDCHH.js +6 -0
- package/dist/cdn/{P6IUHZNJ.js → W5PCHPTR.js} +2 -2
- package/dist/cdn/{53OPBGH3.js → W6PBVDLA.js} +1 -1
- package/dist/cdn/WDT3UXU3.js +4 -0
- package/dist/cdn/WJOUYKK2.js +4 -0
- package/dist/cdn/{TRILF5XK.js → XLMLAWJH.js} +2 -2
- package/dist/cdn/{UTNSHEMF.js → XQXLHCC5.js} +1 -1
- package/dist/cdn/{2GQYFHB5.js → ZV42HAPL.js} +2 -2
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.ar.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.bg.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.bs.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.ca.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.cs.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.da.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.de.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.el.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.en.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.es.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.et.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.fi.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.fr.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.he.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.hr.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.hu.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.id.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.it.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.ja.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.ko.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.lt.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.lv.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.nl.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.no.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.pl.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.pt-BR.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.pt-PT.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.ro.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.ru.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.sk.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.sl.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.sr.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.sv.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.th.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.tr.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.uk.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.vi.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.zh-CN.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.zh-HK.json +1 -1
- package/dist/cdn/assets/arcade-coding-assistant/t9n/messages.zh-TW.json +1 -1
- package/dist/cdn/assets/code-editor/sql-expr.worker.js +759 -757
- package/dist/cdn/index.js +2 -2
- package/dist/chunks/arcade-contribution.js +1 -1
- package/dist/chunks/arcade-defaults.js +1 -1
- package/dist/chunks/arcade-executor.js +1 -1
- package/dist/chunks/arcade-mode.js +55 -54
- package/dist/chunks/arcade-service-accessors.js +1 -1
- package/dist/chunks/colorize.js +1 -1
- package/dist/chunks/editor.js +1 -1
- package/dist/chunks/fields.js +1 -1
- package/dist/chunks/language-defaults-base.js +203 -202
- package/dist/chunks/markdown.js +1 -1
- package/dist/chunks/monaco-importer.js +1 -1
- package/dist/chunks/monaco-theme.js +1 -1
- package/dist/chunks/runtime.js +1 -1
- package/dist/chunks/sql-expr-defaults.js +1 -1
- package/dist/chunks/sql-expr-mode.js +67 -66
- package/dist/chunks/sql-expr-service-accessors.js +1 -1
- package/dist/chunks/useT9n.js +1 -1
- package/dist/chunks/utilities.js +1 -1
- package/dist/components/arcgis-arcade-coding-assistant/customElement.js +221 -110
- package/dist/components/arcgis-arcade-coding-assistant/types.d.ts +4 -4
- package/dist/components/arcgis-arcade-editor/customElement.js +67 -65
- package/dist/components/arcgis-arcade-results/customElement.js +1 -1
- package/dist/components/arcgis-arcade-suggestions/customElement.js +1 -1
- package/dist/components/arcgis-code-editor/customElement.js +1 -1
- package/dist/components/arcgis-code-viewer/customElement.js +15 -14
- package/dist/components/arcgis-editor-variables/customElement.js +10 -9
- package/dist/components/arcgis-language-api-panel/customElement.js +1 -1
- package/dist/components/arcgis-sql-expression-editor/customElement.js +22 -21
- package/dist/components/arcgis-sql-expression-fields/customElement.js +1 -1
- package/dist/docs/api.json +2 -2
- package/dist/docs/docs.json +2 -2
- package/dist/docs/web-types.json +1 -1
- package/dist/index.js +1 -1
- package/dist/loader.js +1 -1
- package/dist/monacoStyles.js +1 -1
- package/dist/utils/arcade-assistant/aiContext.d.ts +6 -0
- package/dist/utils/arcade-assistant/types.d.ts +39 -0
- package/package.json +5 -5
- package/dist/cdn/3AOVYJDA.js +0 -4
- package/dist/cdn/DGSXN3MJ.js +0 -6
- package/dist/cdn/HNHID2GQ.js +0 -4
- package/dist/cdn/IBBEGZKT.js +0 -4
- package/dist/cdn/MIV62SB5.js +0 -4
- package/dist/cdn/MNSM3SGU.js +0 -4
- package/dist/cdn/PQAIRRA6.js +0 -4
- package/dist/cdn/SYFORY5P.js +0 -4
- package/dist/cdn/UPIRR7NI.js +0 -14
- package/dist/cdn/UVW7RTZM.js +0 -4
- package/dist/cdn/VFIPWTCQ.js +0 -4
- package/dist/cdn/WSQRFXIA.js +0 -4
- package/dist/cdn/YNQH23OP.js +0 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ArcadeAiProfileContext } from '../../utils/arcade-assistant/types';
|
|
2
2
|
export type Feedback = {
|
|
3
3
|
user_evaluation?: "bad" | "good";
|
|
4
4
|
your_comments?: string;
|
|
@@ -40,9 +40,9 @@ export type HistoryItem = {
|
|
|
40
40
|
};
|
|
41
41
|
export type IconName = HTMLCalciteIconElement["icon"];
|
|
42
42
|
export type Context = {
|
|
43
|
-
/**
|
|
44
|
-
|
|
45
|
-
metadata:
|
|
43
|
+
/** profileId and metadata are passed to backend */
|
|
44
|
+
profileId: string;
|
|
45
|
+
metadata: ArcadeAiProfileContext;
|
|
46
46
|
/** used for the context display buttons / chips */
|
|
47
47
|
layerName?: nullish | string;
|
|
48
48
|
};
|
|
@@ -1,71 +1,73 @@
|
|
|
1
|
-
import { g as
|
|
2
|
-
import { css as
|
|
3
|
-
import { KeyCode as
|
|
1
|
+
import { g as w, c as R } from "../../chunks/runtime.js";
|
|
2
|
+
import { css as y, html as i, nothing as $ } from "lit";
|
|
3
|
+
import { KeyCode as D } from "monaco-editor";
|
|
4
4
|
import "monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js";
|
|
5
5
|
import "monaco-editor/esm/vs/editor/standalone/common/standaloneTheme.js";
|
|
6
6
|
import "monaco-editor/esm/vs/platform/hover/browser/hover.js";
|
|
7
7
|
import "monaco-editor/esm/vs/editor/common/languages/supports/tokenization.js";
|
|
8
|
-
import { LitElement as
|
|
9
|
-
import { generateGuid as
|
|
10
|
-
import { Deferred as
|
|
11
|
-
import { D as
|
|
12
|
-
import { s as
|
|
13
|
-
import { b as
|
|
14
|
-
import { u as
|
|
15
|
-
import { createRef as
|
|
16
|
-
import { s as
|
|
17
|
-
import
|
|
8
|
+
import { LitElement as C, createEvent as S, noShadowRoot as k, safeClassMap as l } from "@arcgis/lumina";
|
|
9
|
+
import { generateGuid as B } from "@arcgis/toolkit/string";
|
|
10
|
+
import { Deferred as I } from "@arcgis/toolkit/promise";
|
|
11
|
+
import { D as M, e as v } from "../../chunks/arcade-executor.js";
|
|
12
|
+
import { s as L, a as T } from "../../chunks/arcade-service-accessors.js";
|
|
13
|
+
import { b as d } from "../../chunks/arcade-defaults.js";
|
|
14
|
+
import { u as F } from "../../chunks/useT9n.js";
|
|
15
|
+
import { createRef as U, ref as j } from "lit/directives/ref.js";
|
|
16
|
+
import { s as z } from "../../chunks/editor.js";
|
|
17
|
+
import N from "@arcgis/core/identity/IdentityManager.js";
|
|
18
|
+
import { log as O, rethrowError as o } from "@arcgis/toolkit/log";
|
|
18
19
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
19
20
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
20
|
-
v5.0.0-next.
|
|
21
|
-
const
|
|
21
|
+
v5.0.0-next.95 */
|
|
22
|
+
const H = y`@layer{arcgis-arcade-editor{display:flex;flex-direction:column;position:relative;overflow:hidden;border:var(--arcgis-coding-components-border)!important;box-sizing:border-box;background-color:var(--arcgis-coding-components-background-color);height:100%;.sticky{position:sticky;top:0;z-index:10}.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1);text-align:center}.main-action-bar{border-bottom:var(--arcgis-coding-components-border)!important;flex:0 0 auto;calcite-action-group{padding-inline-end:var(--calcite-spacing-sm);calcite-action{padding-inline-end:var(--calcite-spacing-sm)}calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}calcite-action-group:last-child{border-inline-end-width:0px}calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}arcgis-arcade-results{border-top:var(--arcgis-coding-components-border)!important;box-sizing:border-box;max-height:50%;min-height:50%;margin-bottom:-1px}calcite-flow{[slot=footer]{word-break:break-word}}.hidden{display:none}}}`, V = "https://services6.arcgis.com/HXHga6CfMLMBOlBX/ArcGIS/rest/services/survey123_6e349a50b4504ca6b6107216d568db5f_form/FeatureServer/0", a = (s, e) => O(s, "Arcade Assistant", e), G = (s) => {
|
|
22
23
|
const { aiAssistantsEnabled: e } = s;
|
|
23
|
-
return e === void 0 ? (
|
|
24
|
-
},
|
|
25
|
-
async function
|
|
24
|
+
return e === void 0 ? (a("warn", "`areAiAssistantsEnabled` is not defined in the organizations settings."), !1) : e;
|
|
25
|
+
}, X = (s) => !(!s || !("id" in s)), q = async (s) => (await N.getCredential(s)).token;
|
|
26
|
+
async function K({
|
|
26
27
|
portalUrl: s,
|
|
27
28
|
profile: e
|
|
28
29
|
}) {
|
|
29
|
-
if (!
|
|
30
|
-
return
|
|
31
|
-
const t = s.replace(/\/sharing\/rest(\/.*)?$/iu, "").replace(/\/$/u, ""),
|
|
32
|
-
fetch(
|
|
33
|
-
fetch(
|
|
34
|
-
fetch(
|
|
35
|
-
]), [
|
|
36
|
-
if (!
|
|
37
|
-
return
|
|
38
|
-
const
|
|
39
|
-
if (!
|
|
40
|
-
return
|
|
41
|
-
let
|
|
42
|
-
return
|
|
30
|
+
if (!X(e))
|
|
31
|
+
return a("warn", "Addon initialization failed. Reason: unsupported profile."), { shouldRender: !1 };
|
|
32
|
+
const t = s.replace(/\/sharing\/rest(\/.*)?$/iu, "").replace(/\/$/u, ""), n = await q(s), r = `${t}/sharing/rest/portals/self?f=json&token=${n}`, h = `${t}/sharing/rest/portals/self/settings?f=json&token=${n}`, p = `${t}/sharing/rest/portals/self/signinSettings?f=json&token=${n}`, u = await Promise.allSettled([
|
|
33
|
+
fetch(r, { credentials: "include" }).then((c) => c.json()),
|
|
34
|
+
fetch(h, { credentials: "include" }).then((c) => c.json()),
|
|
35
|
+
fetch(p, { credentials: "include" }).then((c) => c.json())
|
|
36
|
+
]), [g, f, _] = u, m = g.status === "fulfilled" ? g.value : (a("warn", `Failed to fetch selfUrl. Reason: ${g.reason}.`), {}), b = f.status === "fulfilled" ? f.value : (a("warn", `Failed to fetch settingsUrl. Reason: ${f.reason}.`), {}), P = _.status === "fulfilled" ? _.value : (a("warn", `Failed to fetch signinSettingsUrl. Reason: ${_.reason}.`), {}), x = m?.helperServices?.aiAssistantServices?.url;
|
|
37
|
+
if (!x)
|
|
38
|
+
return a("warn", "Service URL is not available in the portal self response."), { shouldRender: !1 };
|
|
39
|
+
const E = m.helpBase || "";
|
|
40
|
+
if (!b)
|
|
41
|
+
return a("warn", "Settings response is not available."), { shouldRender: !1 };
|
|
42
|
+
let A = G(b);
|
|
43
|
+
return P.blockBetaApps === !0 && (a(
|
|
44
|
+
"warn",
|
|
43
45
|
"Arcade Assistant is blocked by the organization settings. To enable it, do not block beta apps in the organization settings."
|
|
44
|
-
),
|
|
46
|
+
), A = !1), {
|
|
45
47
|
shouldRender: !0,
|
|
46
|
-
serviceUrl:
|
|
47
|
-
helpBase:
|
|
48
|
-
assistantsEnabled:
|
|
49
|
-
feedbackServiceUrl:
|
|
48
|
+
serviceUrl: x,
|
|
49
|
+
helpBase: E,
|
|
50
|
+
assistantsEnabled: A,
|
|
51
|
+
feedbackServiceUrl: V
|
|
50
52
|
};
|
|
51
53
|
}
|
|
52
|
-
class
|
|
54
|
+
class W extends C {
|
|
53
55
|
constructor() {
|
|
54
|
-
super(...arguments), this._codeEditorElt =
|
|
56
|
+
super(...arguments), this._codeEditorElt = U(), this._componentReadyDefer = new I(), this._disposables = [], this._editorProfilePromise = Promise.resolve(void 0), this.messages = F(), this._modelId = B(), this._openArcadeHelp = () => void window.open(M, "Arcade Help"), this._toggleSidePanel = (e) => {
|
|
55
57
|
if (!e.target)
|
|
56
58
|
return;
|
|
57
59
|
const t = e.target?.dataset.panelName ?? "none";
|
|
58
|
-
this.openedSidePanel = t === this.openedSidePanel ? "none" : t, this.openedSidePanel === "none" && this._codeEditorElt.value?.setFocus().catch(
|
|
59
|
-
}, this._consoleLogs = [], this._executingScript = !1, this._preparingArcade = !1, this._resultPanel = "output", this._showExecutionPanel = !1, this._arcadeAssistantRemoteState = { shouldRender: !1 }, this.hideDocumentationActions = !1, this.hideSideBar = !1, this.openedSidePanel = "none", this.script = "", this.sideActionBarExpanded = !1, this.arcgisDiagnosticsChange =
|
|
60
|
+
this.openedSidePanel = t === this.openedSidePanel ? "none" : t, this.openedSidePanel === "none" && this._codeEditorElt.value?.setFocus().catch(o(this));
|
|
61
|
+
}, this._consoleLogs = [], this._executingScript = !1, this._preparingArcade = !1, this._resultPanel = "output", this._showExecutionPanel = !1, this._arcadeAssistantRemoteState = { shouldRender: !1 }, this.hideDocumentationActions = !1, this.hideSideBar = !1, this.openedSidePanel = "none", this.script = "", this.sideActionBarExpanded = !1, this.arcgisDiagnosticsChange = S({ bubbles: !1 }), this.arcgisScriptChange = S({ bubbles: !1 });
|
|
60
62
|
}
|
|
61
63
|
static {
|
|
62
64
|
this.properties = { _apiLibrary: 16, _consoleLogs: 16, _editorProfile: 16, _executingScript: 16, _executionResult: 16, _preparingArcade: 16, _resultPanel: 16, _showExecutionPanel: 16, _arcadeAssistantRemoteState: 16, editorInstance: 32, editorOptions: 0, hideDocumentationActions: 5, hideSideBar: 5, openedSidePanel: 2, profile: 0, script: 1, sideActionBarExpanded: 7, snippets: 0, suggestions: 0, testData: 0, customPanels: 0, arcadeAssistant: 0 };
|
|
63
65
|
}
|
|
64
66
|
static {
|
|
65
|
-
this.shadowRootOptions =
|
|
67
|
+
this.shadowRootOptions = k;
|
|
66
68
|
}
|
|
67
69
|
static {
|
|
68
|
-
this.styles = [
|
|
70
|
+
this.styles = [H, z];
|
|
69
71
|
}
|
|
70
72
|
get editorInstance() {
|
|
71
73
|
return this._codeEditorElt.value?.editorInstance;
|
|
@@ -90,17 +92,17 @@ class X extends y {
|
|
|
90
92
|
await this._componentReadyDefer.promise, await this._codeEditorElt.value?.setFocus();
|
|
91
93
|
}
|
|
92
94
|
async load() {
|
|
93
|
-
const e =
|
|
94
|
-
|
|
95
|
+
const e = w("./assets");
|
|
96
|
+
L(e), await this._updateDataModelDeps(), await this._updateArcadeAssistantRemoteState();
|
|
95
97
|
}
|
|
96
98
|
willUpdate(e) {
|
|
97
|
-
(e.has("messages") || e.has("profile")) && this.hasUpdated && this._updateDataModelDeps(), e.has("testData") && this._testDataChanged(), e.has("snippets") &&
|
|
99
|
+
(e.has("messages") || e.has("profile")) && this.hasUpdated && this._updateDataModelDeps(), e.has("testData") && this._testDataChanged(), e.has("snippets") && d.updateApiContextForModel(this._modelId, {
|
|
98
100
|
snippets: this.snippets
|
|
99
101
|
}), e.has("arcadeAssistant") && this._updateArcadeAssistantRemoteState();
|
|
100
102
|
}
|
|
101
103
|
async loaded() {
|
|
102
104
|
this._componentReadyDefer.resolve(), await this._updateApiLibrary();
|
|
103
|
-
const e = await
|
|
105
|
+
const e = await T();
|
|
104
106
|
this._disposables.push(e.onDiagnosticsChange((t) => !this._preparingArcade && this.arcgisDiagnosticsChange.emit(t.diagnostics))), this.testData && this._addExecuteScriptAction();
|
|
105
107
|
}
|
|
106
108
|
disconnectedCallback() {
|
|
@@ -111,15 +113,15 @@ class X extends y {
|
|
|
111
113
|
await this._updateEditorProfile(), await this._updateApiLibrary();
|
|
112
114
|
}
|
|
113
115
|
_testDataChanged() {
|
|
114
|
-
!this.testData && this._executeScriptAction && (this._disposeSafely(this._executeScriptAction), this._executeScriptAction = void 0), this.testData && !this._executeScriptAction && this._addExecuteScriptAction(), this._showExecutionPanel && this._executeScript().catch(
|
|
116
|
+
!this.testData && this._executeScriptAction && (this._disposeSafely(this._executeScriptAction), this._executeScriptAction = void 0), this.testData && !this._executeScriptAction && this._addExecuteScriptAction(), this._showExecutionPanel && this._executeScript().catch(o(this));
|
|
115
117
|
}
|
|
116
118
|
async _updateEditorProfile() {
|
|
117
119
|
this._preparingArcade = !0;
|
|
118
120
|
try {
|
|
119
|
-
await
|
|
121
|
+
await d.setProfileForModel(this._modelId, this.profile, {
|
|
120
122
|
locale: this.messages._t9nLocale,
|
|
121
123
|
snippets: this.snippets
|
|
122
|
-
}), this._editorProfile =
|
|
124
|
+
}), this._editorProfile = d.getEditorProfileForModel(this._modelId);
|
|
123
125
|
} catch {
|
|
124
126
|
this._editorProfile = void 0;
|
|
125
127
|
} finally {
|
|
@@ -127,7 +129,7 @@ class X extends y {
|
|
|
127
129
|
}
|
|
128
130
|
}
|
|
129
131
|
async _updateApiLibrary() {
|
|
130
|
-
this._apiLibrary = await
|
|
132
|
+
this._apiLibrary = await d.getApiLibraryForModel(this._modelId);
|
|
131
133
|
}
|
|
132
134
|
async _executeScript() {
|
|
133
135
|
const e = this.testData;
|
|
@@ -139,8 +141,8 @@ class X extends y {
|
|
|
139
141
|
return;
|
|
140
142
|
}
|
|
141
143
|
this._showExecutionPanel = !0, this._executingScript = !0, this._consoleLogs = [], setTimeout(() => void (async () => {
|
|
142
|
-
const
|
|
143
|
-
this._executionResult = await v(t.definition,
|
|
144
|
+
const n = this._codeEditorElt.value?.value;
|
|
145
|
+
this._executionResult = await v(t.definition, n, e, (r) => setTimeout(() => this._consoleLogs = [...this._consoleLogs, r], 0)), this._executingScript = !1;
|
|
144
146
|
})(), 0);
|
|
145
147
|
}
|
|
146
148
|
_toggleShowExecutionPanel() {
|
|
@@ -153,13 +155,13 @@ class X extends y {
|
|
|
153
155
|
e.stopPropagation(), this.script = e.detail, this.arcgisScriptChange.emit(e.detail);
|
|
154
156
|
}
|
|
155
157
|
_insertAsSnippet(e) {
|
|
156
|
-
this._codeEditorElt.value?.insertSnippet(e.detail).catch(
|
|
158
|
+
this._codeEditorElt.value?.insertSnippet(e.detail).catch(o(this));
|
|
157
159
|
}
|
|
158
160
|
_insertAsText(e) {
|
|
159
161
|
this._insertText(e.detail);
|
|
160
162
|
}
|
|
161
163
|
_insertText(e) {
|
|
162
|
-
this._codeEditorElt.value?.insertText(e).catch(
|
|
164
|
+
this._codeEditorElt.value?.insertText(e).catch(o(this));
|
|
163
165
|
}
|
|
164
166
|
_onResultPanelChange(e) {
|
|
165
167
|
this._resultPanel = e.detail;
|
|
@@ -172,11 +174,11 @@ class X extends y {
|
|
|
172
174
|
// An unique identifier for the action.
|
|
173
175
|
id: "run-script",
|
|
174
176
|
label: "Run Arcade Expression",
|
|
175
|
-
keybindings: [
|
|
177
|
+
keybindings: [D.F5],
|
|
176
178
|
contextMenuGroupId: "code",
|
|
177
179
|
contextMenuOrder: 1,
|
|
178
180
|
run: () => {
|
|
179
|
-
this.testData && this._executeScript().catch(
|
|
181
|
+
this.testData && this._executeScript().catch(o(this));
|
|
180
182
|
}
|
|
181
183
|
});
|
|
182
184
|
e && (this._executeScriptAction = e, this._disposables.push(e));
|
|
@@ -186,19 +188,19 @@ class X extends y {
|
|
|
186
188
|
t !== -1 && this._disposables.splice(t, 1), e.dispose();
|
|
187
189
|
}
|
|
188
190
|
async _updateArcadeAssistantRemoteState() {
|
|
189
|
-
this.arcadeAssistant && (this._arcadeAssistantRemoteState = await
|
|
191
|
+
this.arcadeAssistant && (this._arcadeAssistantRemoteState = await K({
|
|
190
192
|
...this.arcadeAssistant,
|
|
191
193
|
profile: this.profile
|
|
192
194
|
}));
|
|
193
195
|
}
|
|
194
196
|
renderMainActionBar() {
|
|
195
|
-
return this.testData ? i`<calcite-action-bar class="main-action-bar" layout=horizontal scale=s expanded expand-disabled><calcite-action-group scale=s><calcite-action .text=${this.messages.run ?? ""} text-enabled icon=play scale=s .loading=${this._preparingArcade} @click=${() => void this._executeScript().catch(
|
|
197
|
+
return this.testData ? i`<calcite-action-bar class="main-action-bar" layout=horizontal scale=s expanded expand-disabled><calcite-action-group scale=s><calcite-action .text=${this.messages.run ?? ""} text-enabled icon=play scale=s .loading=${this._preparingArcade} @click=${() => void this._executeScript().catch(o(this))}></calcite-action>${this._executionResult ? i`<calcite-action .text=${this.messages.lastresults ?? ""} .active=${this._showExecutionPanel} text-enabled icon=access-string-results icon-flip-rtl scale=s @click=${this._toggleShowExecutionPanel}></calcite-action>` : null}</calcite-action-group></calcite-action-bar>` : null;
|
|
196
198
|
}
|
|
197
199
|
renderMainPanel() {
|
|
198
|
-
return i`<arcgis-code-editor class="flex-adjustable" .editorOptions=${this.editorOptions} .language=${
|
|
200
|
+
return i`<arcgis-code-editor class="flex-adjustable" .editorOptions=${this.editorOptions} .language=${d.languageId} .value=${this.script ?? ""} .modelId=${this._modelId} @arcgisValueChange=${this._onCodeEditorValueChange} ${j(this._codeEditorElt)}></arcgis-code-editor>`;
|
|
199
201
|
}
|
|
200
|
-
renderAction({ id: e, label: t, icon:
|
|
201
|
-
return i`<calcite-action id=${e ??
|
|
202
|
+
renderAction({ id: e, label: t, icon: n, active: r, panelName: h, iconFlipRtl: p = !1, onClick: u = this._toggleSidePanel }) {
|
|
203
|
+
return i`<calcite-action id=${e ?? $} .text=${t} .textEnabled=${this.sideActionBarExpanded} .icon=${n} .active=${r} @click=${u} data-panel-name=${h ?? $} .iconFlipRtl=${p}></calcite-action>${!this.sideActionBarExpanded && i`<calcite-tooltip .referenceElement=${e}><span>${t}</span></calcite-tooltip>` || ""}`;
|
|
202
204
|
}
|
|
203
205
|
renderSideActionBar() {
|
|
204
206
|
return this.hideSideBar ? null : i`<calcite-action-bar class="side-action-bar border-inline-start" .expanded=${!!this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}><calcite-action-group>${this.renderAction({
|
|
@@ -245,7 +247,7 @@ class X extends y {
|
|
|
245
247
|
if (this.hideSideBar)
|
|
246
248
|
return null;
|
|
247
249
|
const { openedSidePanel: e } = this;
|
|
248
|
-
return i`<arcgis-language-api-panel class=${
|
|
250
|
+
return i`<arcgis-language-api-panel class=${l(e === "api" && "code-editor-side-panel flex-panel border-inline-start")} .loading=${this._preparingArcade} .apiLibrary=${this._apiLibrary} .hideDocumentationActions=${this.hideDocumentationActions} @arcgisItemSelected=${this._insertAsSnippet} @arcgisClose=${this._toggleSidePanel} data-panel-name=none .closed=${e !== "api"}></arcgis-language-api-panel><arcgis-editor-variables class=${l(e === "variables" && "code-editor-side-panel flex-panel border-inline-start")} .loading=${this._preparingArcade} .modelId=${this._modelId} @arcgisItemSelected=${this._insertAsText} @arcgisClose=${this._toggleSidePanel} data-panel-name=none .variable=${this._editorProfile} .closed=${e !== "variables"}></arcgis-editor-variables>${this.suggestions?.length && i`<arcgis-arcade-suggestions class=${l(e === "suggestions" && "code-editor-side-panel flex-panel border-inline-start")} .closed=${e !== "suggestions"} .suggestions=${this.suggestions} @arcgisItemSelected=${this._insertAsText} @arcgisClose=${this._toggleSidePanel} data-panel-name=none></arcgis-arcade-suggestions>` || ""}${this.arcadeAssistant && this._arcadeAssistantRemoteState.shouldRender && i`<arcgis-arcade-coding-assistant class=${l(e === "arcade-assistant" && "code-editor-side-panel flex-panel border-inline-start")} .closed=${e !== "arcade-assistant"} .insertText=${this._insertText.bind(this)} .closePanel=${this._toggleSidePanel} .portalUrl=${this.arcadeAssistant.portalUrl} .serviceUrl=${this._arcadeAssistantRemoteState.serviceUrl} .helpBase=${this._arcadeAssistantRemoteState.helpBase} .assistantsEnabled=${this._arcadeAssistantRemoteState.assistantsEnabled} .feedbackServiceUrl=${this._arcadeAssistantRemoteState.feedbackServiceUrl} .editorRef=${this.el} .appVersion=${this.arcadeAssistant.appVersion}></arcgis-arcade-coding-assistant>` || ""}${this.customPanels?.map((t) => i`<calcite-flow class=${l(e === t.id ? "code-editor-side-panel flex-panel border-inline-start" : "hidden")}>${t?.useFlows ? t.renderer?.({
|
|
249
251
|
closePanel: this._toggleSidePanel,
|
|
250
252
|
insertText: this._insertText.bind(this),
|
|
251
253
|
closed: e !== t.id,
|
|
@@ -266,7 +268,7 @@ class X extends y {
|
|
|
266
268
|
return i`${this.renderMainActionBar()}<div class="flex-row flex-adjustable"><div class="flex-column flex-adjustable">${this.renderMainPanel()}${this.renderResultsPanel()}</div>${this.renderSidePanel()}${this.renderSideActionBar()}</div>`;
|
|
267
269
|
}
|
|
268
270
|
}
|
|
269
|
-
|
|
271
|
+
R("arcgis-arcade-editor", W);
|
|
270
272
|
export {
|
|
271
|
-
|
|
273
|
+
W as ArcgisArcadeEditor
|
|
272
274
|
};
|
|
@@ -11,7 +11,7 @@ import { t as k } from "../../chunks/monaco-theme.js";
|
|
|
11
11
|
import { observeAncestorsMutation as z, unsafeGetCalciteModeName as N } from "@arcgis/toolkit/dom";
|
|
12
12
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
13
13
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
14
|
-
v5.0.0-next.
|
|
14
|
+
v5.0.0-next.95 */
|
|
15
15
|
const E = w`:host{display:flex;flex-direction:column;width:100%;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);.flex-adjustable{flex:1 1 auto;overflow:hidden}.flex-row{display:flex;flex-direction:row;overflow:hidden}.flex-column{display:flex;flex-direction:column;overflow:hidden}.y-scrollable-container{overflow-y:auto;block-size:100%;background-color:var(--calcite-color-foreground-1)}header{border-bottom:1px solid var(--calcite-color-border-3);flex:0 0 auto}.ltr-container{direction:ltr}calcite-action-bar{calcite-action-group{padding-inline-end:var(--calcite-spacing-sm);calcite-action{padding-inline-end:var(--calcite-spacing-sm)}calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}calcite-action-group:last-child{border-inline-end-width:0px}calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.color-info{color:var(--calcite-color-status-info)}.color-error{color:var(--calcite-color-status-danger)}.color-success{color:var(--calcite-color-status-success)}[class*=result-value-]{font-size:var(--calcite-font-size--2);line-height:1.25rem;background-color:var(--calcite-color-foreground-1);margin:var(--calcite-spacing-md)}.console-logs-container{background-color:var(--calcite-color-foreground-1);padding:0 var(--calcite-spacing-md);font-family:var(--calcite-code-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal)}.result-value-table{table{display:block;max-width:fit-content;overflow-x:auto;border-spacing:0;border-collapse:collapse;text-align:start;white-space:nowrap;thead{background-color:var(--calcite-color-foreground-2)}tr{border-top:1px solid var(--calcite-color-border-3);border-bottom:1px solid var(--calcite-color-border-3)}th,td{border-inline-start:1px solid var(--calcite-color-border-3);border-inline-end:1px solid var(--calcite-color-border-3);text-align:start;padding:var(--calcite-spacing-xxs);.string-value{white-space:pre}}th{font-weight:var(--calcite-font-weight-medium)}}}.tree-item-label,.number-value,.string-value,.boolean-value{font-family:var(--calcite-code-family)}.tree-item-label,.value-type{color:var(--calcite-color-text-2);font-weight:var(--calcite-font-weight-normal)}.dictionary-property{color:var(--arcgis-editor-identifier)}.number-value{color:var(--arcgis-editor-number)}.string-value{color:var(--arcgis-editor-string);white-space:pre-wrap}.constant-value{color:var(--arcgis-editor-constant)}.date-value{color:var(--arcgis-editor-date)}}`, l = {
|
|
16
16
|
lines: !0,
|
|
17
17
|
selectionMode: "none",
|
|
@@ -9,7 +9,7 @@ import { c as b } from "../../chunks/markdown.js";
|
|
|
9
9
|
import { u as _ } from "../../chunks/useT9n.js";
|
|
10
10
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
11
11
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
12
|
-
v5.0.0-next.
|
|
12
|
+
v5.0.0-next.95 */
|
|
13
13
|
function v(o) {
|
|
14
14
|
return !Array.isArray(o) || !o.length ? !1 : Array.isArray(o[0].suggestions);
|
|
15
15
|
}
|
|
@@ -10,7 +10,7 @@ import { load as I } from "@arcgis/lumina/controllers";
|
|
|
10
10
|
import { Range as v, Uri as s, KeyMod as n, KeyCode as r } from "monaco-editor";
|
|
11
11
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
12
12
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
13
|
-
v5.0.0-next.
|
|
13
|
+
v5.0.0-next.95 */
|
|
14
14
|
const M = f`@layer{arcgis-code-editor{display:flex;width:100%;height:100%;flex-direction:column;direction:ltr;.monaco-editor{flex:1 1 auto;.monaco-hover,.editor-widget,.suggest-details-container{z-index:9999}div[widgetid="editor.contrib.resizableContentHoverWidget"],div[widgetid="editor.widget.suggestWidget"],div[widgetid="suggest.details"]{z-index:calc(var(--calcite-z-index-header) + 1)!important}}}}`, y = {
|
|
15
15
|
autoIndent: "advanced",
|
|
16
16
|
automaticLayout: !0,
|
|
@@ -4,16 +4,17 @@ import { slotChangeHasContent as g, observeAncestorsMutation as f, unsafeGetCalc
|
|
|
4
4
|
import { load as S } from "@arcgis/lumina/controllers";
|
|
5
5
|
import { i as v } from "../../chunks/monaco-importer.js";
|
|
6
6
|
import { css as E, html as a } from "lit";
|
|
7
|
-
import { w as l, s as
|
|
8
|
-
import { c as T, g as
|
|
7
|
+
import { w as l, s as h } from "../../chunks/arcade-contribution.js";
|
|
8
|
+
import { c as T, g as c, o as b } from "../../chunks/colorize.js";
|
|
9
9
|
import { s as C } from "../../chunks/arcade-service-accessors.js";
|
|
10
10
|
import { debounce as y } from "@arcgis/toolkit/function";
|
|
11
11
|
import { Task as N } from "@lit/task";
|
|
12
|
+
import { rethrowError as O, log as w } from "@arcgis/toolkit/log";
|
|
12
13
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
13
14
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
14
|
-
v5.0.0-next.
|
|
15
|
-
const
|
|
16
|
-
class
|
|
15
|
+
v5.0.0-next.95 */
|
|
16
|
+
const z = E`pre{direction:ltr;overflow-x:auto;background-color:var(--calcite-color-foreground-2);padding:var(--calcite-spacing-sm);white-space:pre-line;code{font-size:var(--calcite-font-size--2);font-family:var(--calcite-font-family-code)}}:host([round]){pre{border-radius:var(--calcite-corner-radius-round)}}`;
|
|
17
|
+
class L extends p {
|
|
17
18
|
constructor() {
|
|
18
19
|
super(...arguments), this._monacoEditor = S(v), this.#t = Promise.withResolvers(), this.#e = "", this._slotContentObservers = [], this._onDefaultSlotChange = async (e) => {
|
|
19
20
|
g(e) || (this._codeFromSlot = "");
|
|
@@ -35,13 +36,13 @@ class w extends p {
|
|
|
35
36
|
this.properties = { _codeFromSlot: 16, language: 1, round: 7 };
|
|
36
37
|
}
|
|
37
38
|
static {
|
|
38
|
-
this.styles =
|
|
39
|
+
this.styles = z;
|
|
39
40
|
}
|
|
40
41
|
#t;
|
|
41
42
|
#e;
|
|
42
43
|
async load() {
|
|
43
|
-
C(m("./assets")), await
|
|
44
|
-
this._applyColorizeStyles(
|
|
44
|
+
C(m("./assets")), await h(this.language), await l(this.language), this._applyColorizeStyles(c()), this.manager.onLifecycle(() => (this._themeObserver = f(this.el, ["class"], () => this.updateTheme()), this._themeChangedListener = b(() => {
|
|
45
|
+
this._applyColorizeStyles(c());
|
|
45
46
|
}), this.updateTheme(), () => {
|
|
46
47
|
this._themeObserver?.(), this._themeObserver = void 0, this._themeChangedListener?.dispose(), this._themeChangedListener = void 0;
|
|
47
48
|
}));
|
|
@@ -50,7 +51,7 @@ class w extends p {
|
|
|
50
51
|
this.el.hasChildNodes() || this.#t.resolve();
|
|
51
52
|
}
|
|
52
53
|
willUpdate(e) {
|
|
53
|
-
e.has("language") &&
|
|
54
|
+
e.has("language") && h(this.language).then(() => l(this.language)).catch(O(this));
|
|
54
55
|
}
|
|
55
56
|
disconnectedCallback() {
|
|
56
57
|
super.disconnectedCallback(), this._disposeSlotObservers();
|
|
@@ -69,7 +70,7 @@ class w extends p {
|
|
|
69
70
|
const i = { characterData: !0, childList: !0, subtree: !0 }, r = y(() => {
|
|
70
71
|
const s = this._computeSlotText(e);
|
|
71
72
|
s !== this._codeFromSlot && (this._codeFromSlot = s);
|
|
72
|
-
}, 100),
|
|
73
|
+
}, 100), d = (s) => {
|
|
73
74
|
if (s.some((n) => n.type === "childList")) {
|
|
74
75
|
const n = this._computeSlotText(e);
|
|
75
76
|
n !== this._codeFromSlot && (this._codeFromSlot = n);
|
|
@@ -78,7 +79,7 @@ class w extends p {
|
|
|
78
79
|
r();
|
|
79
80
|
};
|
|
80
81
|
o.forEach((s) => {
|
|
81
|
-
const n = new MutationObserver(
|
|
82
|
+
const n = new MutationObserver(d);
|
|
82
83
|
n.observe(s, i), this._slotContentObservers.push(n);
|
|
83
84
|
});
|
|
84
85
|
}
|
|
@@ -89,7 +90,7 @@ class w extends p {
|
|
|
89
90
|
if (o)
|
|
90
91
|
return (o.innerHTML ?? "").trim();
|
|
91
92
|
const i = t.map((r) => r.nodeType === Node.ELEMENT_NODE ? r.outerHTML : r.nodeType === Node.TEXT_NODE ? r.textContent ?? "" : "").join("").trim();
|
|
92
|
-
return i && process.env.NODE_ENV !== "production" &&
|
|
93
|
+
return i && process.env.NODE_ENV !== "production" && w("warn", this, "Consider wrapping your snippet in a <template> for fully inert, intention-revealing markup."), i;
|
|
93
94
|
}
|
|
94
95
|
return t.map((o) => o.textContent ?? "").join("").trim();
|
|
95
96
|
}
|
|
@@ -113,7 +114,7 @@ class w extends p {
|
|
|
113
114
|
})}</pre></div>`;
|
|
114
115
|
}
|
|
115
116
|
}
|
|
116
|
-
u("arcgis-code-viewer",
|
|
117
|
+
u("arcgis-code-viewer", L);
|
|
117
118
|
export {
|
|
118
|
-
|
|
119
|
+
L as ArcgisCodeViewer
|
|
119
120
|
};
|
|
@@ -5,14 +5,15 @@ import { LitElement as d, createEvent as a } from "@arcgis/lumina";
|
|
|
5
5
|
import { setFocusOnElement as h } from "@arcgis/toolkit/dom";
|
|
6
6
|
import { createFilterExpression as f } from "@arcgis/toolkit/string";
|
|
7
7
|
import { u as m } from "../../chunks/useT9n.js";
|
|
8
|
+
import { log as u } from "@arcgis/toolkit/log";
|
|
8
9
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
9
10
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
10
|
-
v5.0.0-next.
|
|
11
|
-
const
|
|
12
|
-
function
|
|
11
|
+
v5.0.0-next.95 */
|
|
12
|
+
const g = n`:host{background-color:var(--calcite-color-foreground-1);.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.sticky{position:sticky;top:0;z-index:10}calcite-flow{height:100%}calcite-list-item-group{background-color:var(--calcite-color-foreground-2);word-break:break-word}}`;
|
|
13
|
+
function p(l) {
|
|
13
14
|
l.key === "Enter" && l.stopPropagation();
|
|
14
15
|
}
|
|
15
|
-
class
|
|
16
|
+
class b extends d {
|
|
16
17
|
constructor() {
|
|
17
18
|
super(...arguments), this._beforeBack = async () => {
|
|
18
19
|
this.removeLastPanelRenderer(), this._filterValue = "";
|
|
@@ -22,7 +23,7 @@ class p extends d {
|
|
|
22
23
|
this.properties = { _filterValue: 16, _flowItemRenderers: 16, _mode: 16, _mutationCounter: 16, loading: 5, modelId: 1, closed: 5, variable: 0 };
|
|
23
24
|
}
|
|
24
25
|
static {
|
|
25
|
-
this.styles =
|
|
26
|
+
this.styles = g;
|
|
26
27
|
}
|
|
27
28
|
load() {
|
|
28
29
|
this._variableChanged();
|
|
@@ -102,7 +103,7 @@ class p extends d {
|
|
|
102
103
|
return !r && !e.loaded && (e.loadSource().then(() => setTimeout(() => {
|
|
103
104
|
this._mutationCounter += 1;
|
|
104
105
|
})).catch(() => {
|
|
105
|
-
|
|
106
|
+
u("error", this, "Error loading collection"), r = !1;
|
|
106
107
|
}), r = !0), s`<calcite-flow-item heading-level=2 .heading=${this._getHeadingForCollection(e)} .description=${this._getDescriptionForCollection(e)} .beforeBack=${this._beforeBack} closable @calciteFlowItemClose=${this._emitClose} .selected=${i}><calcite-action slot=header-actions-end .text=${this.messages.backtotop ?? ""} scale=m .hidden=${t || this._isMode("featureSet")} icon=chevrons-left icon-flip-rtl @click=${this._backToTop}></calcite-action><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${this._updateFilterValue} class="sticky" scale=m .label=${this.messages.filterthevariablesbyname ?? ""} name=variable-filter></calcite-input>${r ? s`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading ?? ""}></calcite-loader>` : s`<calcite-list label=variables>${this.renderEditorVariables(e)}</calcite-list>`}</calcite-flow-item>`;
|
|
107
108
|
}
|
|
108
109
|
renderEditorVariables(e) {
|
|
@@ -114,7 +115,7 @@ class p extends d {
|
|
|
114
115
|
case "group":
|
|
115
116
|
return this._isMode("featureSet") && e.isHeader ? s`<calcite-list-item-group .heading=${e.getLabel()}></calcite-list-item-group>` : this._isMode("featureSet") && e._label?.code === "fields" ? this.renderEditorVariables(e) : s`<calcite-list-item-group .heading=${e.getLabel()}>${this.renderEditorVariables(e)}</calcite-list-item-group>`;
|
|
116
117
|
default:
|
|
117
|
-
return s`<calcite-list-item .label=${e.getLabel()} .description=${e.getDescription()} @calciteListItemSelect=${(t) => this._emitItemSelected(t, e)} @keydown=${(t) => this._emitItemSelected(t, e)}>${e.isCollection ? s`<calcite-action slot=actions-end .text=${this.messages.expand ?? ""} scale=s icon=chevron-right icon-flip-rtl @click=${(t) => this._showCollectionPanel(t, e)} @keydown=${
|
|
118
|
+
return s`<calcite-list-item .label=${e.getLabel()} .description=${e.getDescription()} @calciteListItemSelect=${(t) => this._emitItemSelected(t, e)} @keydown=${(t) => this._emitItemSelected(t, e)}>${e.isCollection ? s`<calcite-action slot=actions-end .text=${this.messages.expand ?? ""} scale=s icon=chevron-right icon-flip-rtl @click=${(t) => this._showCollectionPanel(t, e)} @keydown=${p}></calcite-action>` : null}${e.icon ? s`<calcite-icon .icon=${e.icon} scale=s slot=content-start></calcite-icon>` : null}</calcite-list-item>`;
|
|
118
119
|
}
|
|
119
120
|
}
|
|
120
121
|
render() {
|
|
@@ -124,7 +125,7 @@ class p extends d {
|
|
|
124
125
|
))}</calcite-flow>`;
|
|
125
126
|
}
|
|
126
127
|
}
|
|
127
|
-
o("arcgis-editor-variables",
|
|
128
|
+
o("arcgis-editor-variables", b);
|
|
128
129
|
export {
|
|
129
|
-
|
|
130
|
+
b as ArcgisEditorVariables
|
|
130
131
|
};
|
|
@@ -9,7 +9,7 @@ import { c as n } from "../../chunks/markdown.js";
|
|
|
9
9
|
import { u as f } from "../../chunks/useT9n.js";
|
|
10
10
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
11
11
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
12
|
-
v5.0.0-next.
|
|
12
|
+
v5.0.0-next.95 */
|
|
13
13
|
const g = m`:host{background-color:var(--calcite-color-foreground-1);.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.sticky{position:sticky;top:0;z-index:10}calcite-flow{height:100%}calcite-block{p:first-of-type{margin-top:0}}calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}}`;
|
|
14
14
|
class b extends h {
|
|
15
15
|
constructor() {
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { c as
|
|
2
|
-
import { css as
|
|
3
|
-
import { LitElement as
|
|
4
|
-
import { generateGuid as
|
|
1
|
+
import { c as n } from "../../chunks/runtime.js";
|
|
2
|
+
import { css as c, html as t } from "lit";
|
|
3
|
+
import { LitElement as d, createEvent as o, noShadowRoot as l, safeClassMap as r } from "@arcgis/lumina";
|
|
4
|
+
import { generateGuid as p } from "@arcgis/toolkit/string";
|
|
5
5
|
import { a as s } from "../../chunks/sql-expr-defaults.js";
|
|
6
|
-
import { u as
|
|
7
|
-
import { createRef as
|
|
8
|
-
import { s as
|
|
9
|
-
import { getSqlExprDiagnosticService as
|
|
6
|
+
import { u as h } from "../../chunks/useT9n.js";
|
|
7
|
+
import { createRef as g, ref as f } from "lit/directives/ref.js";
|
|
8
|
+
import { s as _ } from "../../chunks/editor.js";
|
|
9
|
+
import { getSqlExprDiagnosticService as u } from "../../chunks/sql-expr-mode.js";
|
|
10
|
+
import { rethrowError as a } from "@arcgis/toolkit/log";
|
|
10
11
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
11
12
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
12
|
-
v5.0.0-next.
|
|
13
|
-
const
|
|
14
|
-
class
|
|
13
|
+
v5.0.0-next.95 */
|
|
14
|
+
const m = c`@layer{arcgis-sql-expression-editor{display:flex;flex-direction:column;position:relative;overflow:hidden;border:var(--arcgis-coding-components-border)!important;box-sizing:border-box;background-color:var(--arcgis-coding-components-background-color);height:100%}}`;
|
|
15
|
+
class v extends d {
|
|
15
16
|
constructor() {
|
|
16
|
-
super(...arguments), this._codeEditorElt =
|
|
17
|
+
super(...arguments), this._codeEditorElt = g(), this._disposables = [], this.messages = h(), this._modelId = p(), this._preparing = !1, this.sideActionBarExpanded = !1, this.script = "", this.hideSideBar = !1, this.arcgisDiagnosticsChange = o({ bubbles: !1 }), this.arcgisScriptChange = o({ bubbles: !1 });
|
|
17
18
|
}
|
|
18
19
|
static {
|
|
19
20
|
this.properties = { _activeAction: 16, _apiLibrary: 16, _editorProfile: 16, _preparing: 16, sideActionBarExpanded: 16, profile: 0, script: 1, hideSideBar: 5 };
|
|
@@ -22,19 +23,19 @@ class m extends c {
|
|
|
22
23
|
this.shadowRootOptions = l;
|
|
23
24
|
}
|
|
24
25
|
static {
|
|
25
|
-
this.styles = [
|
|
26
|
+
this.styles = [m, _];
|
|
26
27
|
}
|
|
27
28
|
async setFocus() {
|
|
28
29
|
await this._codeEditorElt.value?.setFocus();
|
|
29
30
|
}
|
|
30
31
|
async load() {
|
|
31
|
-
await this._updateEditorProfile().catch(
|
|
32
|
+
await this._updateEditorProfile().catch(a(this));
|
|
32
33
|
}
|
|
33
34
|
willUpdate(i) {
|
|
34
35
|
(i.has("messages") || i.has("profile")) && this._updateDataModelDeps();
|
|
35
36
|
}
|
|
36
37
|
async loaded() {
|
|
37
|
-
const i = await
|
|
38
|
+
const i = await u();
|
|
38
39
|
this._disposables.push(i.onDiagnosticsChange((e) => !this._preparing && this.arcgisDiagnosticsChange.emit(e.diagnostics)));
|
|
39
40
|
}
|
|
40
41
|
disconnectedCallback() {
|
|
@@ -66,10 +67,10 @@ class m extends c {
|
|
|
66
67
|
this._setActiveAction(e.dataset.panelName);
|
|
67
68
|
}
|
|
68
69
|
_insertAsSnippet(i) {
|
|
69
|
-
this._codeEditorElt.value?.insertSnippet(i.detail).catch(
|
|
70
|
+
this._codeEditorElt.value?.insertSnippet(i.detail).catch(a(this));
|
|
70
71
|
}
|
|
71
72
|
_insertAsText(i) {
|
|
72
|
-
this._codeEditorElt.value?.insertText(i.detail.replaceAll('"', "'")).catch(
|
|
73
|
+
this._codeEditorElt.value?.insertText(i.detail.replaceAll('"', "'")).catch(a(this));
|
|
73
74
|
}
|
|
74
75
|
async _updateApiLibrary() {
|
|
75
76
|
this._apiLibrary = await s.getApiLibraryForModel(this._modelId);
|
|
@@ -80,17 +81,17 @@ class m extends c {
|
|
|
80
81
|
_getFeatureSetVariable() {
|
|
81
82
|
let i;
|
|
82
83
|
const e = s.getEditorProfileForModel(this._modelId);
|
|
83
|
-
return e?.variables?.length && e?.variables?.[0]?.type !== "featureSet" ?
|
|
84
|
+
return e?.variables?.length && e?.variables?.[0]?.type !== "featureSet" ? a(this)("Encountered unexpected editor profile") : i = e?.variables?.[0], i;
|
|
84
85
|
}
|
|
85
86
|
_toggleSideActionBarExpanded() {
|
|
86
87
|
this.sideActionBarExpanded = !this.sideActionBarExpanded;
|
|
87
88
|
}
|
|
88
89
|
render() {
|
|
89
90
|
const i = this._getFeatureSetVariable();
|
|
90
|
-
return t`<div class="flex-row flex-adjustable"><div class="flex-column flex-adjustable"><arcgis-code-editor language=arcgis-sql-expression .modelId=${this._modelId} .value=${this.script ?? ""} @arcgisValueChange=${this._onCodeEditorValueChange} ${
|
|
91
|
+
return t`<div class="flex-row flex-adjustable"><div class="flex-column flex-adjustable"><arcgis-code-editor language=arcgis-sql-expression .modelId=${this._modelId} .value=${this.script ?? ""} @arcgisValueChange=${this._onCodeEditorValueChange} ${f(this._codeEditorElt)}></arcgis-code-editor></div>${!this.hideSideBar && t`<arcgis-editor-variables .variable=${i} .closed=${this._activeAction !== "fields"} class=${r(this._activeAction === "fields" && "code-editor-side-panel flex-panel border-inline-start")} .loading=${this._preparing} .modelId=${this._modelId} @arcgisItemSelected=${this._insertAsText} @arcgisClose=${() => this._setActiveAction(void 0)} data-panel-name=none></arcgis-editor-variables>` || ""}${!this.hideSideBar && t`<arcgis-language-api-panel class=${r(this._activeAction === "functions" && "code-editor-side-panel flex-panel border-inline-start")} .closed=${this._activeAction !== "functions"} @arcgisItemSelected=${this._insertAsSnippet} @arcgisClose=${() => this._setActiveAction(void 0)} .loading=${this._preparing} .apiLibrary=${this._apiLibrary} data-panel-name=none hide-documentation-actions .languageId=${s.languageId}></arcgis-language-api-panel>` || ""}${!this.hideSideBar && t`<calcite-action-bar class="side-action-bar border-inline-start" .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}><calcite-action id=fields-action .text=${this.messages.fields ?? "Fields"} icon=profile-variables .active=${this._activeAction === "fields"} data-panel-name=fields @click=${this._handleActionClick}></calcite-action>${!this.sideActionBarExpanded && t`<calcite-tooltip reference-element=fields-action><span>${this.messages.fields ?? "Fields"}</span></calcite-tooltip>` || ""}<calcite-action id=functions-action .text=${this.messages.functions ?? "Functions"} icon=function .active=${this._activeAction === "functions"} data-panel-name=functions @click=${this._handleActionClick}></calcite-action>${!this.sideActionBarExpanded && t`<calcite-tooltip reference-element=functions-action><span>${this.messages.functions ?? "Functions"}</span></calcite-tooltip>` || ""}</calcite-action-bar>` || ""}</div>`;
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
|
-
|
|
94
|
+
n("arcgis-sql-expression-editor", v);
|
|
94
95
|
export {
|
|
95
|
-
|
|
96
|
+
v as ArcgisSqlExpressionEditor
|
|
96
97
|
};
|
|
@@ -6,7 +6,7 @@ import { a as m } from "../../chunks/sql-expr-defaults.js";
|
|
|
6
6
|
import { u as d } from "../../chunks/useT9n.js";
|
|
7
7
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
8
8
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
9
|
-
v5.0.0-next.
|
|
9
|
+
v5.0.0-next.95 */
|
|
10
10
|
const h = r`:host{calcite-flow{height:100%}calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}}`;
|
|
11
11
|
class g extends n {
|
|
12
12
|
constructor() {
|
package/dist/docs/api.json
CHANGED
package/dist/docs/docs.json
CHANGED