@arcgis/coding-components 5.0.0-next.111 → 5.0.0-next.113
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.js +1 -1
- package/dist/cdn/2TGM6O6M.js +4 -0
- package/dist/cdn/3BF4AAOZ.js +4 -0
- package/dist/cdn/{ZOG23UWP.js → 4FK5MJVN.js} +3 -3
- package/dist/cdn/{ZXVOWJDH.js → 4RKAOXIC.js} +2 -2
- package/dist/cdn/{QOY5OOS2.js → 4RVQN4K2.js} +1 -1
- package/dist/cdn/5BZAVZGG.js +4 -0
- package/dist/cdn/5OXNIXWV.js +4 -0
- package/dist/cdn/{ZWQANQOA.js → 6ZMQQC4M.js} +2 -2
- package/dist/cdn/{DUWJBGKW.js → 72Z6FQGG.js} +1 -1
- package/dist/cdn/{GTARB3UU.js → A36QZPA7.js} +1 -1
- package/dist/cdn/{EF6CV6SD.js → AAMXKKPY.js} +18 -18
- package/dist/cdn/{AK7M5DI4.js → AKCQSXOB.js} +2 -2
- package/dist/cdn/{ROHD4IVB.js → CV7LLPSJ.js} +2 -2
- package/dist/cdn/{ZUCKRKBB.js → DCVO6DTY.js} +1 -1
- package/dist/cdn/DFGJTGMF.js +4 -0
- package/dist/cdn/{RFSIT5G7.js → DQHULSZX.js} +2 -2
- package/dist/cdn/{EBBULJKI.js → DXYPSO76.js} +2 -2
- package/dist/cdn/{5A2ON35E.js → ECK5GFJX.js} +2 -2
- package/dist/cdn/{M3DWRUJ6.js → EZ4AJRIK.js} +1 -1
- package/dist/cdn/EZS7BVNR.js +4 -0
- package/dist/cdn/{QPBWNYYG.js → F7ONGO3V.js} +2 -2
- package/dist/cdn/{6F4NHD6J.js → F7V7O6MY.js} +2 -2
- package/dist/cdn/{ACDQXQFL.js → FEEGJMFK.js} +2 -2
- package/dist/cdn/{PZVOBAUY.js → FLSVYK7Y.js} +1 -1
- package/dist/cdn/{R22GWF4X.js → HBKPWQSN.js} +2 -2
- package/dist/cdn/{7BA5NKPL.js → HS6C5ZDM.js} +2 -2
- package/dist/{monacoStyles.js → cdn/J3CPCHWB.js} +3 -6
- package/dist/cdn/{OPDRDV2X.js → JAJOHW6F.js} +2 -2
- package/dist/cdn/JDWBXSEO.js +4 -0
- package/dist/cdn/{IJRKXHZX.js → K5FO4RN2.js} +1 -1
- package/dist/cdn/KZMUR4FQ.js +4 -0
- package/dist/cdn/{MHV2YN2W.js → LICBKKPH.js} +2 -2
- package/dist/cdn/{H7B5SRMR.js → LUYRQPN7.js} +2 -2
- package/dist/cdn/M43BVL4E.js +4 -0
- package/dist/cdn/{BKB4DV46.js → MEKYJZMF.js} +1 -1
- package/dist/cdn/{UMGYY4A6.js → NTDWZYQ3.js} +2 -2
- package/dist/cdn/{FKEB773L.js → ORVBCR27.js} +123 -123
- package/dist/cdn/{IEGYFEG6.js → QIGWBAUW.js} +2 -2
- package/dist/cdn/{77EDUK6A.js → QVVVBQRO.js} +2 -2
- package/dist/cdn/{EUE6CTFC.js → R22JAJHD.js} +2 -2
- package/dist/cdn/{K2ZXUXJJ.js → UPZZXWTI.js} +2 -2
- package/dist/cdn/WBORX7BK.js +4 -0
- package/dist/cdn/{XHEFV6KG.js → WJDNBDRE.js} +2 -2
- package/dist/cdn/{3K6DRDWG.js → WMJL6LYZ.js} +2 -2
- package/dist/cdn/YL76P6RL.js +4 -0
- package/dist/cdn/YOUBREZM.js +6 -0
- package/dist/cdn/{E3ULU3UA.js → Z3XQAT4Z.js} +2 -2
- package/dist/cdn/{2QH3V2HU.js → ZKKGRZ6D.js} +2 -2
- package/dist/cdn/assets/code-editor/sql-expr.worker.js +2 -2
- package/dist/cdn/index.js +2 -7
- package/dist/cdn/main.css +1 -1
- package/dist/chunks/arcade-contribution.js +8 -5
- package/dist/chunks/arcade-defaults.js +1 -1
- package/dist/chunks/arcade-executor.js +1 -1
- package/dist/chunks/arcade-mode.js +21 -18
- package/dist/chunks/arcade-service-accessors.js +16 -13
- package/dist/chunks/colorize.js +1 -1
- package/dist/chunks/fields.js +1 -1
- package/dist/chunks/language-defaults-base.js +1 -1
- package/dist/chunks/markdown.js +1 -1
- package/dist/chunks/monaco-importer.js +6 -3
- 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 +35 -32
- 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 +13 -13
- package/dist/components/arcgis-arcade-editor/customElement.js +41 -42
- package/dist/components/arcgis-arcade-editor/index.d.ts +1 -0
- package/dist/components/arcgis-arcade-editor/index.js +1 -0
- package/dist/components/arcgis-arcade-results/customElement.js +1 -1
- package/dist/components/arcgis-arcade-suggestions/customElement.js +5 -5
- package/dist/components/arcgis-code-editor/customElement.d.ts +1 -1
- package/dist/components/arcgis-code-editor/customElement.js +269 -60
- package/dist/components/arcgis-code-editor-shell/customElement.d.ts +17 -0
- package/dist/components/arcgis-code-editor-shell/customElement.js +19 -0
- package/dist/components/arcgis-code-editor-shell/index.d.ts +1 -0
- package/dist/components/arcgis-code-editor-shell/index.js +1 -0
- package/dist/components/arcgis-code-viewer/customElement.js +1 -1
- package/dist/components/arcgis-editor-variables/customElement.js +1 -1
- package/dist/components/arcgis-language-api-panel/customElement.js +11 -11
- package/dist/components/arcgis-sql-expression-editor/customElement.js +15 -19
- package/dist/components/arcgis-sql-expression-editor/index.d.ts +1 -0
- package/dist/components/arcgis-sql-expression-editor/index.js +1 -0
- package/dist/components/arcgis-sql-expression-fields/customElement.js +1 -1
- package/dist/docs/api.json +126 -5
- package/dist/docs/docs.json +123 -5
- package/dist/docs/vscode.css-custom-data.json +30 -1
- package/dist/docs/vscode.html-custom-data.json +11 -0
- package/dist/docs/web-types.json +64 -2
- package/dist/index.d.ts +5 -0
- package/dist/index.js +1 -1
- package/dist/loader.js +5 -4
- package/dist/types/lumina.d.ts +5 -0
- package/dist/types/preact.d.ts +6 -0
- package/dist/types/react.d.ts +7 -0
- package/dist/types/stencil.d.ts +5 -0
- package/dist/utils/internal-monaco-apis.d.ts +67 -0
- package/dist/utils/monaco-importer.d.ts +3 -0
- package/dist/utils/monaco-typings.d.ts +3 -0
- package/dist/utils/patch-monaco.d.ts +16 -0
- package/package.json +5 -5
- package/dist/cdn/2YZ46D2D.js +0 -4
- package/dist/cdn/3YR5HT6L.js +0 -6
- package/dist/cdn/6ZY6ERMO.js +0 -4
- package/dist/cdn/EGSHWWSC.js +0 -4
- package/dist/cdn/FLUNOJKB.js +0 -4
- package/dist/cdn/HOEQZCFF.js +0 -4
- package/dist/cdn/NSVEJ77V.js +0 -4
- package/dist/cdn/Q23LB4V2.js +0 -4
- package/dist/cdn/QWC22EZF.js +0 -4
- package/dist/cdn/REMZZQAN.js +0 -4
- package/dist/cdn/TAAXRQC4.js +0 -4
- package/dist/cdn/UDPOBQDF.js +0 -4
- package/dist/cdn/UOU34CQZ.js +0 -4
- package/dist/chunks/editor.js +0 -8
- package/dist/utils/import-monaco-styles.d.ts +0 -7
package/dist/docs/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
3
3
|
"name": "@arcgis/coding-components",
|
|
4
|
-
"version": "5.0.0-next.
|
|
4
|
+
"version": "5.0.0-next.113",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -208,6 +208,39 @@
|
|
|
208
208
|
]
|
|
209
209
|
}
|
|
210
210
|
},
|
|
211
|
+
{
|
|
212
|
+
"name": "arcgis-code-editor-shell",
|
|
213
|
+
"description": "A layout component for code editors that provides slots for an editor, results panel, side panel, and action bars.\n--\n\n### Methods\n- `componentOnReady(): Promise<void>` - Create a promise that resolves once component is fully loaded.\n\n### Slots\n- **top-action-bar** - A slot for placing a top action bar above the editor area.\n- **editor** - A slot for placing the main code editor component.\n- **results-panel** - A slot for placing a results panel below the code editor.\n- **side-panel** - A slot for placing a side panel next to the code editor area.\n- **side-action-bar** - A slot for placing a side action bar next to the side panel.\n\n### CSS Properties\n- **--arcgis-coding-components-border** - The border style for the editor shell * \n- **--arcgis-coding-components-background-color** - The background color for the editor shell * \n- **--arcgis-coding-components-side-action-bar-max-w** - The max width for the side action bar * \n- **--arcgis-coding-components-code-editor-side-panel-w** - The width for the code editor side panel * \n- **--arcgis-coding-components-code-editor-side-panel-max-w** - The max width for the code editor side panel * \n- **--arcgis-coding-components-code-editor-results-panel-max-h** - The max height for the code editor results panel * \n- **--arcgis-coding-components-code-editor-results-panel-h** - The default height for the code editor results panel (preferred over min-h). * ",
|
|
214
|
+
"doc-url": "https://developers.arcgis.com/javascript/latest/references/coding-components/arcgis-code-editor-shell/",
|
|
215
|
+
"attributes": [],
|
|
216
|
+
"slots": [
|
|
217
|
+
{
|
|
218
|
+
"name": "top-action-bar",
|
|
219
|
+
"description": "A slot for placing a top action bar above the editor area."
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
"name": "editor",
|
|
223
|
+
"description": "A slot for placing the main code editor component."
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"name": "results-panel",
|
|
227
|
+
"description": "A slot for placing a results panel below the code editor."
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
"name": "side-panel",
|
|
231
|
+
"description": "A slot for placing a side panel next to the code editor area."
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"name": "side-action-bar",
|
|
235
|
+
"description": "A slot for placing a side action bar next to the side panel."
|
|
236
|
+
}
|
|
237
|
+
],
|
|
238
|
+
"events": [],
|
|
239
|
+
"js": {
|
|
240
|
+
"properties": [],
|
|
241
|
+
"events": []
|
|
242
|
+
}
|
|
243
|
+
},
|
|
211
244
|
{
|
|
212
245
|
"name": "arcgis-code-viewer",
|
|
213
246
|
"description": "A code viewer component for displaying code snippets.\nSupports syntax highlighting for various programming languages, include arcade and arcgis-sql-expression.\n--\n\n### Methods\n- `componentOnReady(): Promise<void>` - Create a promise that resolves once component is fully loaded.",
|
|
@@ -316,7 +349,36 @@
|
|
|
316
349
|
]
|
|
317
350
|
},
|
|
318
351
|
"css": {
|
|
319
|
-
"properties": [
|
|
352
|
+
"properties": [
|
|
353
|
+
{
|
|
354
|
+
"name": "--arcgis-coding-components-border",
|
|
355
|
+
"description": "The border style for the editor shell *"
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"name": "--arcgis-coding-components-background-color",
|
|
359
|
+
"description": "The background color for the editor shell *"
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"name": "--arcgis-coding-components-side-action-bar-max-w",
|
|
363
|
+
"description": "The max width for the side action bar *"
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
"name": "--arcgis-coding-components-code-editor-side-panel-w",
|
|
367
|
+
"description": "The width for the code editor side panel *"
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"name": "--arcgis-coding-components-code-editor-side-panel-max-w",
|
|
371
|
+
"description": "The max width for the code editor side panel *"
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
"name": "--arcgis-coding-components-code-editor-results-panel-max-h",
|
|
375
|
+
"description": "The max height for the code editor results panel *"
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"name": "--arcgis-coding-components-code-editor-results-panel-h",
|
|
379
|
+
"description": "The default height for the code editor results panel (preferred over min-h). *"
|
|
380
|
+
}
|
|
381
|
+
],
|
|
320
382
|
"pseudo-elements": []
|
|
321
383
|
}
|
|
322
384
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ArcgisArcadeEditor } from "./components/arcgis-arcade-editor/index.js";
|
|
2
2
|
import type { ArcgisCodeEditor } from "./components/arcgis-code-editor/index.js";
|
|
3
|
+
import type { CodeEditorShell } from "./components/arcgis-code-editor-shell/index.js";
|
|
3
4
|
import type { ArcgisCodeViewer } from "./components/arcgis-code-viewer/index.js";
|
|
4
5
|
import type { ArcgisSqlExpressionEditor } from "./components/arcgis-sql-expression-editor/index.js";
|
|
5
6
|
|
|
@@ -41,6 +42,7 @@ declare global {
|
|
|
41
42
|
interface HTMLElementTagNameMap {
|
|
42
43
|
"arcgis-arcade-editor": ArcgisArcadeEditor;
|
|
43
44
|
"arcgis-code-editor": ArcgisCodeEditor;
|
|
45
|
+
"arcgis-code-editor-shell": CodeEditorShell;
|
|
44
46
|
"arcgis-code-viewer": ArcgisCodeViewer;
|
|
45
47
|
"arcgis-sql-expression-editor": ArcgisSqlExpressionEditor;
|
|
46
48
|
}
|
|
@@ -53,6 +55,9 @@ declare global {
|
|
|
53
55
|
type HTMLArcgisCodeEditorElement = ArcgisCodeEditor;
|
|
54
56
|
|
|
55
57
|
|
|
58
|
+
type HTMLArcgisCodeEditorShellElement = CodeEditorShell;
|
|
59
|
+
|
|
60
|
+
|
|
56
61
|
type HTMLArcgisCodeViewerElement = ArcgisCodeViewer;
|
|
57
62
|
|
|
58
63
|
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { a as c } from "./chunks/arcade-defaults.js";
|
|
|
3
3
|
import { s as p } from "./chunks/sql-expr-defaults.js";
|
|
4
4
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
5
5
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
6
|
-
v5.0.0-next.
|
|
6
|
+
v5.0.0-next.113 */
|
|
7
7
|
const a = s, r = t;
|
|
8
8
|
export {
|
|
9
9
|
c as arcade,
|
package/dist/loader.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { r as e } from "./chunks/runtime.js";
|
|
2
|
-
import { makeDefineCustomElements as
|
|
2
|
+
import { makeDefineCustomElements as i } from "@arcgis/lumina";
|
|
3
3
|
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
4
4
|
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
5
|
-
v5.0.0-next.
|
|
6
|
-
const
|
|
5
|
+
v5.0.0-next.113 */
|
|
6
|
+
const o = i(e, {
|
|
7
7
|
"arcgis-arcade-coding-assistant": [() => import("./components/arcgis-arcade-coding-assistant/customElement.js"), "appVersion,assistantsEnabled,closed,closePanel:,editorRef:,feedbackServiceUrl,helpBase,insertText:,layer,portalUrl,serviceUrl;destroy"],
|
|
8
8
|
"arcgis-arcade-editor": [() => import("./components/arcgis-arcade-editor/customElement.js"), "arcadeAssistant:,customPanels:,editorInstance:,editorOptions:,hideDocumentationActions,hideSideBar,openedSidePanel:,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getEditorInstance,getScript,getTestResult,setFocus"],
|
|
9
9
|
"arcgis-arcade-results": [() => import("./components/arcgis-arcade-results/customElement.js"), "calciteModeDark,consoleLogs:,loading,openedResultPanel,result:"],
|
|
10
10
|
"arcgis-arcade-suggestions": [() => import("./components/arcgis-arcade-suggestions/customElement.js"), "closed,suggestions:"],
|
|
11
11
|
"arcgis-code-editor": [() => import("./components/arcgis-code-editor/customElement.js"), "editorInstance:,editorOptions:,language,modelId:,value;getEditorInstance,getValue,insertSnippet,insertText,setFocus,setValue"],
|
|
12
|
+
"arcgis-code-editor-shell": [() => import("./components/arcgis-code-editor-shell/customElement.js")],
|
|
12
13
|
"arcgis-code-viewer": [() => import("./components/arcgis-code-viewer/customElement.js"), "language,round"],
|
|
13
14
|
"arcgis-editor-variables": [() => import("./components/arcgis-editor-variables/customElement.js"), "closed,loading,modelId,variable:"],
|
|
14
15
|
"arcgis-language-api-panel": [() => import("./components/arcgis-language-api-panel/customElement.js"), "apiLibrary:,closed,hideDocumentationActions,languageId,loading"],
|
|
@@ -16,5 +17,5 @@ const a = s(e, {
|
|
|
16
17
|
"arcgis-sql-expression-fields": [() => import("./components/arcgis-sql-expression-fields/customElement.js"), "loading,modelId"]
|
|
17
18
|
});
|
|
18
19
|
export {
|
|
19
|
-
|
|
20
|
+
o as defineCustomElements
|
|
20
21
|
};
|
package/dist/types/lumina.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="../index.d.ts" />
|
|
2
2
|
import type { ArcgisArcadeEditor } from "../components/arcgis-arcade-editor/index.js";
|
|
3
3
|
import type { ArcgisCodeEditor } from "../components/arcgis-code-editor/index.js";
|
|
4
|
+
import type { CodeEditorShell } from "../components/arcgis-code-editor-shell/index.js";
|
|
4
5
|
import type { ArcgisCodeViewer } from "../components/arcgis-code-viewer/index.js";
|
|
5
6
|
import type { ArcgisSqlExpressionEditor } from "../components/arcgis-sql-expression-editor/index.js";
|
|
6
7
|
import type { h, EventHandler } from "@arcgis/lumina";
|
|
@@ -15,6 +16,9 @@ interface LuminaArcgisCodeEditor extends Partial<Pick<ArcgisCodeEditor, 'editorO
|
|
|
15
16
|
onarcgisValueChange?: EventHandler<HTMLArcgisCodeEditorElement["arcgisValueChange"]>;
|
|
16
17
|
}
|
|
17
18
|
|
|
19
|
+
interface LuminaArcgisCodeEditorShell extends h.JSX.HTMLAttributes<HTMLArcgisCodeEditorShellElement> {
|
|
20
|
+
}
|
|
21
|
+
|
|
18
22
|
interface LuminaArcgisCodeViewer extends Partial<Pick<ArcgisCodeViewer, 'language' | 'round'>>, h.JSX.HTMLAttributes<HTMLArcgisCodeViewerElement> {
|
|
19
23
|
}
|
|
20
24
|
|
|
@@ -28,6 +32,7 @@ declare module "@arcgis/lumina" {
|
|
|
28
32
|
interface IntrinsicElements {
|
|
29
33
|
"arcgis-arcade-editor": LuminaArcgisArcadeEditor;
|
|
30
34
|
"arcgis-code-editor": LuminaArcgisCodeEditor;
|
|
35
|
+
"arcgis-code-editor-shell": LuminaArcgisCodeEditorShell;
|
|
31
36
|
"arcgis-code-viewer": LuminaArcgisCodeViewer;
|
|
32
37
|
"arcgis-sql-expression-editor": LuminaArcgisSqlExpressionEditor;
|
|
33
38
|
}
|
package/dist/types/preact.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="../index.d.ts" />
|
|
2
2
|
import type { ArcgisArcadeEditor } from "../components/arcgis-arcade-editor/index.js";
|
|
3
3
|
import type { ArcgisCodeEditor } from "../components/arcgis-code-editor/index.js";
|
|
4
|
+
import type { CodeEditorShell } from "../components/arcgis-code-editor-shell/index.js";
|
|
4
5
|
import type { ArcgisCodeViewer } from "../components/arcgis-code-viewer/index.js";
|
|
5
6
|
import type { ArcgisSqlExpressionEditor } from "../components/arcgis-sql-expression-editor/index.js";
|
|
6
7
|
import { HTMLAttributes } from "preact";
|
|
@@ -16,6 +17,9 @@ interface PreactArcgisCodeEditor extends Partial<Pick<ArcgisCodeEditor, 'editorO
|
|
|
16
17
|
onarcgisValueChange?: EventHandler<HTMLArcgisCodeEditorElement["arcgisValueChange"]>;
|
|
17
18
|
}
|
|
18
19
|
|
|
20
|
+
interface PreactArcgisCodeEditorShell extends HTMLAttributes<HTMLArcgisCodeEditorShellElement> {
|
|
21
|
+
}
|
|
22
|
+
|
|
19
23
|
interface PreactArcgisCodeViewer extends Partial<Pick<ArcgisCodeViewer, 'language' | 'round'>>, HTMLAttributes<HTMLArcgisCodeViewerElement> {
|
|
20
24
|
}
|
|
21
25
|
|
|
@@ -29,6 +33,7 @@ declare module 'preact' {
|
|
|
29
33
|
interface IntrinsicElements {
|
|
30
34
|
"arcgis-arcade-editor": PreactArcgisArcadeEditor;
|
|
31
35
|
"arcgis-code-editor": PreactArcgisCodeEditor;
|
|
36
|
+
"arcgis-code-editor-shell": PreactArcgisCodeEditorShell;
|
|
32
37
|
"arcgis-code-viewer": PreactArcgisCodeViewer;
|
|
33
38
|
"arcgis-sql-expression-editor": PreactArcgisSqlExpressionEditor;
|
|
34
39
|
}
|
|
@@ -37,6 +42,7 @@ declare module 'preact' {
|
|
|
37
42
|
interface IntrinsicElements {
|
|
38
43
|
"arcgis-arcade-editor": PreactArcgisArcadeEditor;
|
|
39
44
|
"arcgis-code-editor": PreactArcgisCodeEditor;
|
|
45
|
+
"arcgis-code-editor-shell": PreactArcgisCodeEditorShell;
|
|
40
46
|
"arcgis-code-viewer": PreactArcgisCodeViewer;
|
|
41
47
|
"arcgis-sql-expression-editor": PreactArcgisSqlExpressionEditor;
|
|
42
48
|
}
|
package/dist/types/react.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="../index.d.ts" />
|
|
2
2
|
import type { ArcgisArcadeEditor } from "../components/arcgis-arcade-editor/index.js";
|
|
3
3
|
import type { ArcgisCodeEditor } from "../components/arcgis-code-editor/index.js";
|
|
4
|
+
import type { CodeEditorShell } from "../components/arcgis-code-editor-shell/index.js";
|
|
4
5
|
import type { ArcgisCodeViewer } from "../components/arcgis-code-viewer/index.js";
|
|
5
6
|
import type { ArcgisSqlExpressionEditor } from "../components/arcgis-sql-expression-editor/index.js";
|
|
6
7
|
import type { HTMLProps } from 'react';
|
|
@@ -16,6 +17,9 @@ interface ReactArcgisCodeEditor extends Partial<Pick<ArcgisCodeEditor, 'editorOp
|
|
|
16
17
|
onarcgisValueChange?: EventHandler<HTMLArcgisCodeEditorElement["arcgisValueChange"]>;
|
|
17
18
|
}
|
|
18
19
|
|
|
20
|
+
interface ReactArcgisCodeEditorShell extends HTMLProps<HTMLArcgisCodeEditorShellElement> {
|
|
21
|
+
}
|
|
22
|
+
|
|
19
23
|
interface ReactArcgisCodeViewer extends Partial<Pick<ArcgisCodeViewer, 'language' | 'round'>>, HTMLProps<HTMLArcgisCodeViewerElement> {
|
|
20
24
|
}
|
|
21
25
|
|
|
@@ -29,6 +33,7 @@ declare module "react" {
|
|
|
29
33
|
interface IntrinsicElements {
|
|
30
34
|
"arcgis-arcade-editor": ReactArcgisArcadeEditor;
|
|
31
35
|
"arcgis-code-editor": ReactArcgisCodeEditor;
|
|
36
|
+
"arcgis-code-editor-shell": ReactArcgisCodeEditorShell;
|
|
32
37
|
"arcgis-code-viewer": ReactArcgisCodeViewer;
|
|
33
38
|
"arcgis-sql-expression-editor": ReactArcgisSqlExpressionEditor;
|
|
34
39
|
}
|
|
@@ -39,6 +44,7 @@ declare module "react/jsx-runtime" {
|
|
|
39
44
|
interface IntrinsicElements {
|
|
40
45
|
"arcgis-arcade-editor": ReactArcgisArcadeEditor;
|
|
41
46
|
"arcgis-code-editor": ReactArcgisCodeEditor;
|
|
47
|
+
"arcgis-code-editor-shell": ReactArcgisCodeEditorShell;
|
|
42
48
|
"arcgis-code-viewer": ReactArcgisCodeViewer;
|
|
43
49
|
"arcgis-sql-expression-editor": ReactArcgisSqlExpressionEditor;
|
|
44
50
|
}
|
|
@@ -49,6 +55,7 @@ declare module "react/jsx-dev-runtime" {
|
|
|
49
55
|
interface IntrinsicElements {
|
|
50
56
|
"arcgis-arcade-editor": ReactArcgisArcadeEditor;
|
|
51
57
|
"arcgis-code-editor": ReactArcgisCodeEditor;
|
|
58
|
+
"arcgis-code-editor-shell": ReactArcgisCodeEditorShell;
|
|
52
59
|
"arcgis-code-viewer": ReactArcgisCodeViewer;
|
|
53
60
|
"arcgis-sql-expression-editor": ReactArcgisSqlExpressionEditor;
|
|
54
61
|
}
|
package/dist/types/stencil.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/// <reference types="../index.d.ts" />
|
|
2
2
|
import type { ArcgisArcadeEditor } from "../components/arcgis-arcade-editor/index.js";
|
|
3
3
|
import type { ArcgisCodeEditor } from "../components/arcgis-code-editor/index.js";
|
|
4
|
+
import type { CodeEditorShell } from "../components/arcgis-code-editor-shell/index.js";
|
|
4
5
|
import type { ArcgisCodeViewer } from "../components/arcgis-code-viewer/index.js";
|
|
5
6
|
import type { ArcgisSqlExpressionEditor } from "../components/arcgis-sql-expression-editor/index.js";
|
|
6
7
|
import { JSXBase as StencilJsx } from "@stencil/core/internal";
|
|
@@ -16,6 +17,9 @@ interface StencilArcgisCodeEditor extends Partial<Pick<ArcgisCodeEditor, 'editor
|
|
|
16
17
|
onArcgisValueChange?: EventHandler<HTMLArcgisCodeEditorElement["arcgisValueChange"]>;
|
|
17
18
|
}
|
|
18
19
|
|
|
20
|
+
interface StencilArcgisCodeEditorShell extends StencilJsx.HTMLAttributes<HTMLArcgisCodeEditorShellElement> {
|
|
21
|
+
}
|
|
22
|
+
|
|
19
23
|
interface StencilArcgisCodeViewer extends Partial<Pick<ArcgisCodeViewer, 'language' | 'round'>>, StencilJsx.HTMLAttributes<HTMLArcgisCodeViewerElement> {
|
|
20
24
|
}
|
|
21
25
|
|
|
@@ -27,6 +31,7 @@ interface StencilArcgisSqlExpressionEditor extends Partial<Pick<ArcgisSqlExpress
|
|
|
27
31
|
interface ExposedElements {
|
|
28
32
|
"arcgis-arcade-editor": StencilArcgisArcadeEditor;
|
|
29
33
|
"arcgis-code-editor": StencilArcgisCodeEditor;
|
|
34
|
+
"arcgis-code-editor-shell": StencilArcgisCodeEditorShell;
|
|
30
35
|
"arcgis-code-viewer": StencilArcgisCodeViewer;
|
|
31
36
|
"arcgis-sql-expression-editor": StencilArcgisSqlExpressionEditor;
|
|
32
37
|
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { IDisposable } from 'monaco-editor';
|
|
2
|
+
/**
|
|
3
|
+
* Undocumented Monaco APIs
|
|
4
|
+
*
|
|
5
|
+
* We use an internal undocumented monaco-editor APIs to patch some shadow DOM issues in monaco-editor / vscode.
|
|
6
|
+
*
|
|
7
|
+
* Using these APIs introduces risk of breakages with future updates to monaco-editor, as they are not part of the public API.
|
|
8
|
+
*
|
|
9
|
+
* This file contains type definitions and helper functions to work with these internal APIs safely.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
type PointerHandlerDisposable = {
|
|
13
|
+
_type?: string;
|
|
14
|
+
dispose?: () => void;
|
|
15
|
+
};
|
|
16
|
+
export type EditorMouseEventInstance = {
|
|
17
|
+
readonly event?: Event;
|
|
18
|
+
readonly target?: EventTarget | null;
|
|
19
|
+
};
|
|
20
|
+
export type MouseEventFactoryInstance = {
|
|
21
|
+
onMouseMove: (domNode: HTMLElement, callback: (e: Event) => void) => IDisposable;
|
|
22
|
+
};
|
|
23
|
+
type PointerHandler = {
|
|
24
|
+
_store: {
|
|
25
|
+
_toDispose: Set<PointerHandlerDisposable>;
|
|
26
|
+
};
|
|
27
|
+
viewHelper: {
|
|
28
|
+
viewDomNode: HTMLElement;
|
|
29
|
+
};
|
|
30
|
+
_onMouseMove: (e: unknown) => void;
|
|
31
|
+
_onMouseLeave: (e: unknown) => void;
|
|
32
|
+
_mouseLeaveMonitor: IDisposable | null;
|
|
33
|
+
_register: (disposable: IDisposable) => IDisposable;
|
|
34
|
+
};
|
|
35
|
+
export type UndocumentedMonacoEditorInstanceApi = {
|
|
36
|
+
_modelData?: {
|
|
37
|
+
view?: {
|
|
38
|
+
_pointerHandler?: {
|
|
39
|
+
handler?: PointerHandler;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
type AddDisposableListener = (element: Document | HTMLElement | Window, type: string, listener: (event: Event) => void) => IDisposable;
|
|
45
|
+
type GetShadowRoot = (element: HTMLElement) => ShadowRoot | null;
|
|
46
|
+
export type MonacoDomApi = {
|
|
47
|
+
addDisposableListener: AddDisposableListener;
|
|
48
|
+
getShadowRoot: GetShadowRoot;
|
|
49
|
+
};
|
|
50
|
+
export type MonacoStaticMemberContainer = Record<string, unknown> | ((...args: unknown[]) => unknown);
|
|
51
|
+
export declare function getPointerHandler(editor: unknown): PointerHandler | null;
|
|
52
|
+
declare function getMonacoDomApi(): MonacoDomApi | null;
|
|
53
|
+
declare function createMouseEventFactory(domNode: HTMLElement): MouseEventFactoryInstance | null;
|
|
54
|
+
declare function createEditorMouseEvent(e: Event, isFromTouch: boolean, target: HTMLElement): EditorMouseEventInstance | null;
|
|
55
|
+
export declare function assertHasPointerHandler(editor: unknown): editor is UndocumentedMonacoEditorInstanceApi;
|
|
56
|
+
export { getMonacoDomApi, createMouseEventFactory, createEditorMouseEvent };
|
|
57
|
+
export type ActualDoHitTestFn = (ctx: unknown, coords: {
|
|
58
|
+
clientX: number;
|
|
59
|
+
clientY: number;
|
|
60
|
+
}) => unknown;
|
|
61
|
+
export declare function isShadowDomSelectionRangeNodeError(message: string): boolean;
|
|
62
|
+
export declare function getMouseTargetFactoryContainer(): MonacoStaticMemberContainer | null;
|
|
63
|
+
export declare function getActualDoHitTestWithCaretRangeFromPoint(factory: MonacoStaticMemberContainer): ActualDoHitTestFn | null;
|
|
64
|
+
export type HitTestResultUnknownLike = {
|
|
65
|
+
type: 0;
|
|
66
|
+
hitTarget: unknown;
|
|
67
|
+
};
|
|
@@ -22,4 +22,7 @@ export { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/brows
|
|
|
22
22
|
export { IStandaloneThemeService } from 'monaco-editor/esm/vs/editor/standalone/common/standaloneTheme.js';
|
|
23
23
|
export { IHoverService } from 'monaco-editor/esm/vs/platform/hover/browser/hover.js';
|
|
24
24
|
export { generateTokensCSSForColorMap } from 'monaco-editor/esm/vs/editor/common/languages/supports/tokenization.js';
|
|
25
|
+
export * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
|
|
26
|
+
export { EditorMouseEvent, EditorMouseEventFactory } from 'monaco-editor/esm/vs/editor/browser/editorDom.js';
|
|
27
|
+
export { MouseTargetFactory } from 'monaco-editor/esm/vs/editor/browser/controller/mouseTarget.js';
|
|
25
28
|
export declare function importMonacoEditor(): Promise<typeof editor>;
|
|
@@ -3,3 +3,6 @@ declare module "monaco-editor/esm/vs/editor/common/languages/supports/tokenizati
|
|
|
3
3
|
declare module "monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js";
|
|
4
4
|
declare module "monaco-editor/esm/vs/editor/standalone/common/standaloneTheme.js";
|
|
5
5
|
declare module "monaco-editor/esm/vs/platform/hover/browser/hover.js";
|
|
6
|
+
declare module "monaco-editor/esm/vs/base/browser/dom.js";
|
|
7
|
+
declare module "monaco-editor/esm/vs/editor/browser/editorDom.js";
|
|
8
|
+
declare module "monaco-editor/esm/vs/editor/browser/controller/mouseTarget.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { IDisposable, editor as Editor } from 'monaco-editor';
|
|
2
|
+
import { LogContext } from '@arcgis/toolkit/log';
|
|
3
|
+
/**
|
|
4
|
+
* Installs global Monaco monkey patches that are not tied to a specific editor instance.
|
|
5
|
+
*
|
|
6
|
+
* Currently includes a workaround for https://github.com/microsoft/monaco-editor/issues/4548
|
|
7
|
+
* (Shadow DOM selection can throw during caret-range hit testing).
|
|
8
|
+
*/
|
|
9
|
+
export declare function installMonacoGlobalPatches(logContext: LogContext): IDisposable | null;
|
|
10
|
+
/**
|
|
11
|
+
* Installs per-editor-instance Monaco patches.
|
|
12
|
+
*
|
|
13
|
+
* - Patches Monaco pointer handler behavior for Shadow DOM mouseleave tracking.
|
|
14
|
+
* - Reapplies the patch on model changes because Monaco recreates internal View/MouseHandler.
|
|
15
|
+
*/
|
|
16
|
+
export declare function installMonacoEditorInstancePatches(editorInstance: Editor.IStandaloneCodeEditor, logContext: LogContext): IDisposable | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/coding-components",
|
|
3
|
-
"version": "5.0.0-next.
|
|
3
|
+
"version": "5.0.0-next.113",
|
|
4
4
|
"description": "Contains components for editing code in different languages. The currently supported languages are html, css, json, TypeScript, JavaScript, and Arcade.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ArcGIS",
|
|
@@ -42,10 +42,10 @@
|
|
|
42
42
|
],
|
|
43
43
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@arcgis/arcade-languageservice": "5.0.0-next.
|
|
46
|
-
"@arcgis/languages-api-utils": "5.0.0-next.
|
|
47
|
-
"@arcgis/lumina": "5.0.0-next.
|
|
48
|
-
"@arcgis/toolkit": "5.0.0-next.
|
|
45
|
+
"@arcgis/arcade-languageservice": "5.0.0-next.113",
|
|
46
|
+
"@arcgis/languages-api-utils": "5.0.0-next.113",
|
|
47
|
+
"@arcgis/lumina": "5.0.0-next.113",
|
|
48
|
+
"@arcgis/toolkit": "5.0.0-next.113",
|
|
49
49
|
"@lit/task": "^1.0.3",
|
|
50
50
|
"lit": "^3.3.0",
|
|
51
51
|
"monaco-editor": "^0.52.0",
|
package/dist/cdn/2YZ46D2D.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
|
-
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.111 */
|
|
4
|
-
import k from"./EGSHWWSC.js";import j from"./UDPOBQDF.js";import e from"./R22GWF4X.js";import"./M3DWRUJ6.js";import{a as _}from"./2QH3V2HU.js";import"./ACDQXQFL.js";import b from"./3K6DRDWG.js";import a from"./OPDRDV2X.js";import"./DUWJBGKW.js";import"./EUE6CTFC.js";import{a as f}from"./EF6CV6SD.js";import"./PZVOBAUY.js";import"./77EDUK6A.js";import{b as g,c as p}from"./AK7M5DI4.js";import{G as l,K as u,L as m,h as d,n as i,s as c,u as h}from"./ZOG23UWP.js";import"./GTARB3UU.js";import{Hl as s,Il as o,Kl as I,Pl as n}from"./FKEB773L.js";import"./QOY5OOS2.js";export default $arcgis.t(([,,,{a:v}])=>{var y=d`@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}}}}`,b={autoIndent:"advanced",automaticLayout:!0,bracketPairColorization:{enabled:!0},minimap:{enabled:!1},renderLineHighlight:"none",scrollBeyondLastLine:!1,suggest:{snippetsPreventQuickSuggestions:!1,showWords:!1},tabSize:2,useShadowDOM:!0},a=class extends l{constructor(){super(...arguments),this._componentReadyDefer=Promise.withResolvers(),this._disposables=[],this._monacoEditor=_(f),this.modelId=c(),this.value="",this.arcgisSelectionChange=i({bubbles:!1}),this.arcgisValueChange=i({bubbles:!1})}static{this.properties={editorInstance:32,editorOptions:0,language:1,modelId:0,value:1}}static{this.shadowRootOptions=h}static{this.styles=[y]}get editorInstance(){return this._editorInstance}async getEditorInstance(){return await this._componentReadyDefer.promise,this._editorInstance}async getValue(){return await this._componentReadyDefer.promise,this.value}async insertSnippet(e){await this._componentReadyDefer.promise,this._editorInstance&&(this._editorInstance.getContribution("snippetController2")?.insert(e??""),this._editorInstance.focus())}async insertText(e){if(await this._componentReadyDefer.promise,!this._editorInstance||!this._editorInstance.getModel())return;let t=this._editorInstance.getSelection()??new I(1,1,1,1);this._editorInstance.executeEdits("",[{range:t,text:e??"",forceMoveMarkers:!0}])}async setFocus(){await this._componentReadyDefer.promise,this._editorInstance?.focus()}async setValue(e){await this._componentReadyDefer.promise,this.value=e??""}load(){v(m("./assets")),this.manager.onLifecycle(()=>{this._monacoEditor.getModel(this.getUri())?.dispose();let e=this._monacoEditor.createModel(this.value,this.language,this.getUri());this._editorInstance=this._monacoEditor.create(this.el,{...b,...this.editorOptions??{},model:e,fixedOverflowWidgets:!0}),this._disposables.push(this._editorInstance),this._componentReadyDefer.resolve(),this._editorInstance.onDidChangeModelContent(()=>{this.value=this._editorInstance?.getValue()??"",this.arcgisValueChange.emit(this.value)}),this._editorInstance.onDidChangeCursorSelection(M=>{this.arcgisSelectionChange.emit({selection:M.selection,model:this._editorInstance?.getModel()})});let t=g(this.el,["class"],()=>this.updateTheme());this.updateTheme();let r=new ResizeObserver(()=>this._editorInstance?.layout());return r.observe(this.el),this.addCommonEditorActions(),()=>{for(this._editorInstance?.getModel()?.dispose();this._disposables.length;)this._disposables.pop()?.dispose();t?.(),r.disconnect()}})}willUpdate(e){e.has("value")&&this._updateModelValue(),(e.has("language")||e.has("modelId"))&&this.hasUpdated&&this._updateModel(),e.has("editorOptions")&&this._editorInstance?.updateOptions(this.editorOptions??{})}_updateModelValue(){if(!this._editorInstance)return;let e=this._editorInstance.getModel();if(!e||e.getValue()===this.value)return;let t=e.getFullModelRange();this._editorInstance.executeEdits("",[{range:t,text:this.value,forceMoveMarkers:!0}]),this._editorInstance.pushUndoStop()}_updateModel(){if(!this._editorInstance)return;let e=this._editorInstance;e.getModel()?.dispose(),e.setModel(this._monacoEditor.createModel(this.value,this.language,this.getUri()))}getUri(){return this.modelId?n.parse(this.modelId):n.parse("")}updateTheme(){let e=p(this.el)==="light"?"vs":"vs-dark";e!==this._currentTheme&&(this._currentTheme=e,this._monacoEditor.setTheme(e))}addCommonEditorActions(){if(!this._editorInstance)return;let e=this._editorInstance.getAction("editor.action.fontZoomIn"),t=this._editorInstance.getAction("editor.action.fontZoomOut");this._disposables.push(this._editorInstance.addAction({id:"editor.action.fontZoomIn",label:"Editor Font Zoom In",keybindings:[o.CtrlCmd|s.Equal],contextMenuGroupId:"zooming",contextMenuOrder:1,run:async()=>await e?.run()}),this._editorInstance.addAction({id:"editor.action.fontZoomOut",label:"Editor Font Zoom Out",keybindings:[o.CtrlCmd|s.Minus],contextMenuGroupId:"zooming",contextMenuOrder:2,run:async()=>await t?.run()}))}};u("arcgis-code-editor",a);return a},a,b,e,j,k)
|
package/dist/cdn/3YR5HT6L.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
|
-
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.111 */
|
|
4
|
-
import{a as I}from"./UOU34CQZ.js";import d from"./R22GWF4X.js";import{a as B}from"./XHEFV6KG.js";import"./2QH3V2HU.js";import a from"./OPDRDV2X.js";import"./IJRKXHZX.js";import{d as G}from"./DUWJBGKW.js";import{c as j,d as Q}from"./EUE6CTFC.js";import"./EF6CV6SD.js";import"./PZVOBAUY.js";import"./77EDUK6A.js";import"./AK7M5DI4.js";import{E as V,F as D,G as H,I as C,K as L,h as N,j as c,k as q,l as A,s as _,w as F,x as O,y as z}from"./ZOG23UWP.js";import{c as b}from"./GTARB3UU.js";import"./FKEB773L.js";import"./QOY5OOS2.js";export default $arcgis.t(([pe,W,ue,me,he,{getDeclaredVoxelMembers:ge,getDeclaredPixelMembers:be},{a:J},S])=>{var $=class extends z{constructor(e){if(super(e),this.it=A,e.type!==F.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===A||e==null)return this._t=void 0,this.it=e;if(e===q)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};$.directiveName="unsafeHTML",$.resultType=1;var k=O($);var fe=N`:host(:not([closed])){container-type:size;--calcite-block-border-color: var(--calcite-color-transparent);flex:1 0 auto;border-inline-start:var(--arcgis-coding-components-border);box-sizing:border-box;max-width:var(--arcgis-coding-components-code-editor-side-panel-max-w);width:var(--arcgis-coding-components-code-editor-side-panel-w);.submission-actions-wrapper{display:flex;flex-direction:column;width:100%;gap:.75rem}.submission-actions{display:flex;flex-direction:row;gap:.5rem;justify-content:space-between}@container (max-width: 380px){.hidden-below-380{display:none}}@container (min-width: 380px){.hidden-above-380{display:none}}.gaps{display:flex;gap:.25rem}.align-inline-end{margin-inline-start:auto}.action .error-display{display:flex;flex-direction:row;gap:.5rem;justify-content:space-between}.context-popover p{padding:0 .5rem;font-size:var(--calcite-font-size-sm)}.feedback-content{padding:1rem;display:flex;flex-direction:column;gap:.75rem;max-height:30vh;overflow-y:auto}.feedback-sheet{--calcite-sheet-height: auto;--calcite-sheet-max-height: 100%;--calcite-sheet-min-height: auto}calcite-chip[slot=header-actions-end]{align-self:center;margin-inline-end:.5rem}calcite-flow-item calcite-shell{background:transparent}calcite-block{width:100%;max-width:100%;align-self:flex-end;background-color:transparent;margin-block:0}calcite-sheet{--calcite-sheet-scrim-background: rgba(200, 200, 200, .5)}.type-suggestion{--calcite-color-foreground-1: var(--calcite-color-foreground-current);--calcite-color-text-3: var(--calcite-color-text-2);--calcite-icon-color: var(--calcite-color-brand)}.type-history{--calcite-icon-color: var(--calcite-color-text-2)}.type-response{--calcite-icon-color: var(--calcite-color-brand);--calcite-font-family: monospace}.block-response{align-self:flex-start;margin-block-end:4rem;border-block-end:0;--calcite-block-text-color: var(--calcite-color-brand)}calcite-list-item calcite-button{margin-inline-end:.25rem}.type-docs{--calcite-color-foreground-1: var(--calcite-color-foreground-3);--calcite-icon-color: var(--calcite-color-text-1)}.type-error{--calcite-icon-color: var(--calcite-color-status-danger);--calcite-font-family: monospace;border:1px solid var(--calcite-color-status-danger)}#thumbs-up{margin-inline-start:auto;--calcite-icon-color: var(--calcite-color-border-input)}#thumbs-down{--calcite-icon-color: var(--calcite-color-border-input)}calcite-flow-item calcite-shell calcite-notice{margin-block:1rem}.no-space-block,.no-space-block[open]{margin:0}calcite-block[open]:last-of-type{border-block-end:0}.text-area-wrapper{display:flex;border-radius:var(--calcite-corner-radius-round);margin:.75rem;overflow:hidden;--calcite-color-border-input: transparent;position:sticky;box-shadow:var(--calcite-shadow-sm);flex:none}calcite-text-area{height:auto;min-height:5.75rem;overflow:hidden;border-radius:var(--calcite-corner-radius-round) var(--calcite-corner-radius-round) 0 0;--calcite-font-weight-normal: 500;font-weight:500;line-height:1.2}.standalone-list{margin:1rem;width:calc(100% - 2rem)}.result-disclaimer{display:block;width:24rem;max-width:90%;margin:1rem auto;text-align:center;line-height:1.125rem;font-size:.875rem;font-style:italic}calcite-flow{height:100%}calcite-popover calcite-list{--calcite-list-background-color: transparent;--calcite-input-border-color: transparent}calcite-popover calcite-list calcite-filter{--calcite-spacing-sm: 0}.contained-popover-or-tooltip{--calcite-popover-max-size-x: 100%;--calcite-tooltip-max-size-x: 100%}.break-spaces{white-space:break-spaces}.feedback-button-container{margin-inline-start:auto;gap:0}.info-heading{font-size:var(--calcite-font-size-1);color:var(--calcite-color-text-1)}.unstyled-h3{margin:unset;font-size:var(--calcite-font-size-md)}.unstyled-shell{position:unset;inset:unset;display:unset;block-size:unset;inline-size:unset}.suggestion-button{font-weight:var(--calcite-font-weight-medium)}.info-block{max-width:450px}#result-block{calcite-card-group{--calcite-card-group-gap: 1.25rem}calcite-card{--calcite-card-corner-radius: var(--calcite-corner-radius-round);--calcite-card-border-color: transparent;width:100%}.positioned-code-content{display:flex;flex-direction:row;gap:.5rem;padding:.5rem}calcite-card [slot=heading] calcite-chip{margin-block-start:.25rem}.code-response-wrapper{position:relative;background:var(--calcite-color-foreground-2);border-radius:var(--calcite-corner-radius-round);margin-top:-1.5rem}.prior-prompt{display:flex;flex-direction:row;padding:0;overflow-y:hidden;overflow-x:auto;margin:.25rem 0 .75rem;align-items:center;max-width:100%;span{overflow-x:auto;overflow-y:hidden}}.copy-feedback{display:none}.copy-prompt-button{align-self:flex-start;margin-inline-start:auto}.response-secondary-action-button[data-copied]+.copy-feedback,.copy-prompt-button[data-copied]+.copy-feedback{display:block;span{padding:.75rem 1rem;font-size:var(--calcite-font-size--2);line-height:1.375;color:var(--calcite-color-text--2);font-weight:var(--calcite-font-weight-medium)}}.copy-prompt-button[data-copied]~.copy-tooltip,.response-secondary-action-button[data-copied]~.copy-tooltip{display:none}code{white-space:pre;font-size:12px;margin:0;overflow-x:auto;font-family:Fira Mono,Consolas,Menlo,monospace;display:block;max-height:12rem;position:relative;padding:.5rem}.code-collapse{margin-inline-start:auto}.response-secondary-action-button{margin-left:.5rem}.add-to-editor-button{--calcite-internal-button-border-color: unset}}.collapsible-code{padding:.5rem}.collapsible-code summary{cursor:pointer;font-weight:500;color:var(--calcite-color-brand);outline:none;padding:.25rem 0}.collapsible-code[open] summary{color:var(--calcite-color-text-2)}.collapsible-error{padding:.5rem}.collapsible-error summary{cursor:pointer;font-weight:500;color:var(--calcite-color-status-danger);outline:none;padding:.25rem 0}.collapsible-error[open] summary{color:var(--calcite-color-text-2)}.response-error-container{padding:.5rem;background:color-mix(in srgb,var(--calcite-color-status-warning) 10%,transparent);border-radius:var(--calcite-corner-radius-round);margin:1rem 0;font-size:var(--calcite-font-size--2);--calcite-input-message-icon-color: var(--calcite-color-status-warning)}.response-error-chip{--calcite-internal-chip-background-color: var(--calcite-color-status-warning);--calcite-chip-icon-color: var(--calcite-color-foreground-1);--calcite-chip-border-color: var(--calcite-color-transparent)}.feedback-actions{gap:unset}.contained{max-width:100%;max-height:100%;max-width:100cqi;max-height:75cqb;overflow-y:auto}}:host([closed]){display:none}`,f=class extends Error{constructor({message:e,code:t,subCode:a,details:o,source:r}){super(e),this.name="ArcadeAssistantError",this.code=t,this.subCode=a,this.details=o,this.source=r}};function Y(i){if(!i)return;let e=i.indexOf('{"error":');if(e!==-1)try{let t=i.slice(e),a=JSON.parse(t);if(a&&typeof a=="object"&&a.error)return a.error}catch{return}}async function ve(i){let{baseUrl:e,skillId:t,message:a,authToken:o,previousConversationId:r,context:l}=i,u=t?`${e}/skills/${t}/chat`:`${e}/chat`,n=[],s={message:a,context:l};r&&(s.conversation_id=r);let d;try{d=await W(u,{method:"post",headers:{"Content-Type":"application/json",token:o},body:JSON.stringify(s),responseType:"json"})}catch(h){let g=h,w=g.details?.rawResponse||g.message||String(h),v=Y(w);throw v?new f(v):h}let p=d.data;n.push(p);let x=p.conversationId,re=p.inquiryId,M=p.sequenceNumber;async function ne(){let h=0,g=25;for(;h<g;){await new Promise(y=>setTimeout(y,1e3));let w=ye(x,M,re),v;try{v=await W(u,{method:"post",headers:{"Content-Type":"application/json",token:o},body:JSON.stringify(w),responseType:"json"})}catch(y){let P=y,de=P.details?.rawResponse||P.message||String(y),U=Y(de);throw U?new f(U):y}let m=v.data;if(m.context?.kind==="ArcgisErrorAsContext"&&m.context.error)throw new f({message:m.context.error.message||"ArcGIS Assistant error",code:m.context.error.code,subCode:m.context.error.subCode,details:m.context.error.details,source:"polling-response"});if(n.push(m),M=m.sequenceNumber,h++,!m.hasMore)break}if(h===g)throw new f({message:"Request timed out",code:"TIMEOUT",source:"polling"})}let le=120*1e3;return await Promise.race([ne(),new Promise((h,g)=>setTimeout(()=>g(new f({message:"Request timed out",code:"TIMEOUT",source:"hard-timeout"})),le))]),n}function ye(i,e,t){return{conversationId:i,inquiryId:t,ackSequenceNumber:e}}function $e(i){return i.message.match(/Error in prompt shield/u)?"I'm having trouble with this request. Try again by rephrasing the question.":i.code==="TIMEOUT"?"I'm having trouble with this request. Try again by re-asking the same question or rephrasing it.":i.message}var ke=i=>{let e=i.value.length,t=72,a=180,o=i.offsetWidth,r=Math.max(1,Math.floor(o/8)),l=Math.ceil(e/r),u=t+(l-2)*24;i.style.setProperty("--calcite-text-area-min-height",`${Math.min(u,a)}px`)};function xe({messages:i}){return c`<calcite-chip slot=header-actions-end scale=s appearance=outline-fill .label=${i.beta??"Beta"}>${i.beta??"Beta"}</calcite-chip>`}function we({popoverContent:i}){return c`<calcite-action icon=information slot=header-actions-end id=legal-disclaimer text></calcite-action><calcite-popover reference-element=legal-disclaimer label=legal-disclaimer placement=bottom auto-close focus-trap-disabled><div class="contained">${i}</div></calcite-popover>`}function oe({errorMessage:i,slot:e}){return c`<div class="error-display"><calcite-input-message id=error-message status=invalid icon=exclamation-mark-triangle scale=m slot=${e??C}>${i}</calcite-input-message></div>`}function Ae({active:i,setActive:e,messages:t}){return c`<calcite-alert slot=alerts .open=${i} placement=bottom kind=success icon=check-circle-f auto-close @calciteAlertClose=${()=>e(!1)} .label=${t.expressionapplied??"Expression applied"}><div slot=message>${t.expressionapplied??"Expression applied to editor."}</div></calcite-alert>`}function Ce({context:i,messages:e}){return i?c`<div class="gaps">${i.profileId&&c`<calcite-popover auto-close placement=top .label=${(e.profilecontextlabel??"Profile context: {profileId}").replace("{profileId}",i.profileId)} reference-element=profile-context-button class="context-popover contained-popover-or-tooltip"><p>${(e.profilecontextlabel??"Profile context: {profileId}").replace("{profileId}",i.profileId)}</p></calcite-popover><calcite-button round kind=neutral icon-start=map-information id=profile-context-button></calcite-button>`||""}${i.layerName&&c`<calcite-popover auto-close placement=top .label=${(e.layercontextlabel??"Layer context: {layerName}").replace("{layerName}",i.layerName)} reference-element=layer-context-button class="context-popover contained-popover-or-tooltip"><p>${(e.layercontextlabel??"Layer context: {layerName}").replace("{layerName}",i.layerName)}</p></calcite-popover><calcite-button round kind=neutral icon-start=layers id=layer-context-button></calcite-button>`||""}</div>`:null}function Se({isDisabled:i,isReadOnly:e,setQuestion:t,setIsViewingResult:a,textAreaRef:o,question:r,errorMessage:l,setErrorMessage:u,submitQuestion:n,messages:s,mode:d,context:p}){return c`<div class="text-area-wrapper"><calcite-text-area resize=vertical .readOnly=${i||e} class="styled-text-area" .placeholder=${s.askaquestion??`Specify the calculation or logic you need in an Arcade expression. (e.g., 'Return "Yes" if value > 10')`} .value=${r} @calciteTextAreaInput=${x=>{ke(x.target),t(x.target.value)}} ${D(o)}><div class="submission-actions-wrapper" slot=footer-start>${l&&oe({errorMessage:l,slot:"footer-start"})||""}<div class="submission-actions">${Ce({context:p,messages:s})}<div class="align-inline-end gaps"><calcite-button round kind=neutral .hidden=${d!=="refine"} icon-start=arrow-left icon-flip-rtl=both appearance=solid .disabled=${i} @click=${async()=>{a(!1),t("")}} .label=${s.startover??"Start Over"} class="hidden-above-380" id=small-start-over-button></calcite-button><calcite-tooltip reference-element=small-start-over-button placement=top-start class="hidden-above-380">${s.startover??"Start Over"}</calcite-tooltip><calcite-button round kind=neutral .hidden=${d!=="refine"} icon-start=arrow-left icon-flip-rtl=both appearance=solid .disabled=${i} @click=${async()=>{a(!1),t("")}} class="hidden-below-380">${s.startover??"Start Over"}</calcite-button><calcite-button round icon-end=effects appearance=solid .loading=${i} .disabled=${i} @click=${async()=>{u(r?"":s.enteraprompt??"Please enter a prompt"),await n()}}>${d==="prompt"?s.ask??"Generate":s.refine??"Refine"}</calcite-button></div></div></div></calcite-text-area></div>`}var Ie="https://www.esri.com/en-us/privacy/privacy-statements/privacy-statement",Te="https://www.esri.com/en-us/privacy/privacy-statements/privacy-supplement";function Ee({setOpen:i,messages:e,feedback:t,setFeedback:a,onSubmit:o}){return t.active?c`<calcite-sheet class="feedback-sheet" .label=${e.feedback??"Feedback"} slot=sheets display-mode=float position=block-end .open=${t.active} @calciteSheetClose=${()=>i(!1)}><calcite-panel .heading=${e.providefeedback??"Provide feedback"} .description=${e.experiencehelps??"Your experience helps guide future improvements"}><div class="feedback-content"><calcite-label>${e.experiencehelpful??"Was the assistant helpful?"}<calcite-segmented-control scale=l .disabled=${t.submitting}><calcite-segmented-control-item icon-start=thumbs-up .checked=${t.value==="good"} @click=${()=>a({...t,value:"good"})}></calcite-segmented-control-item><calcite-segmented-control-item icon-start=thumbs-down .checked=${t.value==="bad"} @click=${()=>a({...t,value:"bad"})}></calcite-segmented-control-item></calcite-segmented-control></calcite-label><calcite-label>${e.describeexperience??"Describe your experience"}<calcite-text-area resize=vertical .value=${t.text} @calciteTextAreaInput=${r=>a({...t,text:r.target.value})} .disabled=${t.submitting}></calcite-text-area></calcite-label><calcite-label layout=inline scale=s><calcite-checkbox scale=l .checked=${t.termsAccepted} @calciteCheckboxChange=${r=>{a({...t,termsAccepted:r.target.checked})}} .disabled=${t.submitting}></calcite-checkbox><span>${k((e.agreement??"I agree to the {EsriPrivacyStatement} (and {Supplement}).").replace("{EsriPrivacyStatement}",`<calcite-link href=${Ie} target="_blank">${e.esriprivacystatement??"Esri Privacy Statement"}</calcite-link>`).replace("{Supplement}",`<calcite-link href=${Te} target="_blank">${e.supplement??"Supplement"}</calcite-link>`))}</span></calcite-label></div><calcite-button slot=footer width=full @click=${o} .disabled=${!t.termsAccepted||t.submitting} .loading=${t.submitting}>${e.submitfeedback??"Submit Feedback"}</calcite-button></calcite-panel></calcite-sheet>`:null}function K({assistantsEnabled:i,messages:e,slot:t,assistantHelpUrl:a,helpTopicUrl:o}){return c`<calcite-block .label=${e.assistantinformation??"Assistant information"} slot=${t??C} expanded class="info-block"><calcite-chip .label=${e.new??"New"} kind=brand>${e.new??"New"}</calcite-chip><h1 class="info-heading">${e.introducing??"Introducing Arcade Assistant (beta)"}</h1><p>${e.capabilities??"The assistant uses artificial intelligence to generate Arcade expressions."}</p>${i?c`<p>${e.keepinmind??"Keep in mind the following:"}<ul><li>${e.beconsise??"Be concise, but also clear in your request"}</li><li>${e.avoidambiguity??"Avoid ambiguity and vagueness"}</li><li>${e.moredetails??"you do not need to use exact field names in your instructions, but more detail is generally better"}</li></ul>${k((e.seedocumentation??"Please see the {documentation} for more information, including limitations and additional resources.").replace("{documentation}",`<calcite-link href=${o} target="_blank">${e.documentation??"documentation"}</calcite-link>`))}</p>`:c`<p>${k(e.useofassistant?.replace("{aiassistants}",`<strong>${e.aiassistants??"Ai Assistants"}</strong>`))}<calcite-link .href=${a} target=_blank icon-end=launch2>${e.configureassistants??"Configure Assistants"}</calcite-link></p>`}</calcite-block>`}function Re({messages:i,onProceed:e,onExit:t,helpTopicUrl:a}){return c`<calcite-dialog close-disabled placement=top .heading=${i.welcome??"Welcome to the new assistant experience"} slot=dialogs open width-scale=m id=welcome-dialog><h3 class="unstyled-h3">${i.beforeyougetstarted??"Before you get started be aware:"}</h3><ul><li>${i.maybeincorrect??"AI generated code may occasionally be incorrect or biased. Review carefully."}</li><li>${k((i.pleasereadhelp??"Read the Arcade Assistant (beta) {helpTopic} to get started and learn details on security, privacy and limitations.").replace("{helpTopic}",`<calcite-link href=${a} target="_blank">${i.helptopic??"help topic"}</calcite-link>`))}</li></ul><calcite-button id=welcome-proceed slot=footer-end @click=${e}>${i.proceed??"Proceed"}</calcite-button><calcite-button id=welcome-decline slot=footer-start @click=${t} kind=neutral>${i.exit??"Exit"}</calcite-button></calcite-dialog>`}function Me({messages:i,suggestions:e,onSuggestionClick:t}){return c`<calcite-block .heading=${i.promptsuggestions} expanded collapsible id=suggestion-block><calcite-chip-group class="suggestions" .label=${i.promptsuggestions??"Prompt Suggestions"}>${I(e,a=>a,a=>c`<calcite-button round appearance=outline-fill kind=neutral .label=${i.promptsuggestion} class="suggestion-button" @click=${()=>t?.(a)}>${a}</calcite-button>`)}</calcite-chip-group></calcite-block>`}var X=200;function Z({hidden:i=!1,expanded:e=!1,messages:t,cards:a,heading:o,collapsible:r=!1,showEffectsIcon:l=!1,onCopyCode:u,standalone:n}){return c`<calcite-block .hidden=${i} id=result-block .heading=${o??t.besteffort??"Here is the assistant's best effort"} .expanded=${e} .collapsible=${r}>${l&&c`<calcite-chip .label=${t.assistantresponses??"Assistant responses"} slot=content-start icon=effects scale=m class="suggestion-chips"></calcite-chip>`||""}<calcite-card-group .label=${t.assistantresponses??"Assistant responses"}>${I(a,s=>s.conversationId,s=>c`<calcite-card><div slot=heading><div class="prior-prompt"><span>${s.priorPrompt.length>X?`${s.priorPrompt.slice(0,X)}...`:s.priorPrompt}</span><calcite-action icon=duplicate scale=s slot=actions-end class="copy-prompt-button" text .id=${`copy-prompt-${s.conversationId}-${n?"standalone":"list"}`} @click=${d=>{let p=d.currentTarget;navigator.clipboard.writeText(s.priorPrompt).then(()=>{p.setAttribute("data-copied","true"),setTimeout(()=>p.removeAttribute("data-copied"),1500)})}}></calcite-action><calcite-popover .referenceElement=${`copy-prompt-${s.conversationId}-${n?"standalone":"list"}`} placement=top-start class="copy-feedback" .label=${t.copiedsuccessfully??"copied successfully"} open trigger-disabled><span>${t.copiedsuccessfully??"copied successfully"}</span></calcite-popover><calcite-tooltip .referenceElement=${`copy-prompt-${s.conversationId}-${n?"standalone":"list"}`} placement=top-start class="copy-tooltip">${t.copyprompttoclipboard??"Copy prompt to clipboard"}</calcite-tooltip></div>${s.message&&n&&c`<div class="response-error-container">${oe({errorMessage:s.message})}</div>`||""}</div><div><div class="code-response-wrapper"><div class="positioned-code-content"><calcite-chip-group .label=${t.responsecontext??"Response Context"} scale=s>${s.message&&!n&&c`<calcite-tooltip .referenceElement=${`response-chip-${s.conversationId}-error`} placement=top-start>${s.message}</calcite-tooltip><calcite-chip .id=${`response-chip-${s.conversationId}-error`} .label=${t.error??"Error"} scale=s appearance=outline icon=exclamation-mark-triangle-f class="response-error-chip"></calcite-chip>`||""}${s.chips?.map(d=>{let p=_();return c`${d.tooltip&&c`<calcite-tooltip .referenceElement=${`response-chip-${d.conversationId}-${p}`} placement=top-start class="contained-popover-or-tooltip">${d.tooltip}</calcite-tooltip>`||""}<calcite-chip .label=${d.label} .scale=${d.scale??"s"} .appearance=${d.appearance??"outline"} .icon=${d.icon} .id=${`response-chip-${d.conversationId}-${p}`}>${d.label}</calcite-chip>`})}</calcite-chip-group></div><details class="collapsible-code" open><summary>Code response</summary><arcgis-code-viewer language=arcade round>${s.code}</arcgis-code-viewer></details></div></div><div slot=footer-start class="feedback-actions"><calcite-button class="add-to-editor-button hidden-above-380" @click=${()=>s.onAddToEditor("add")} scale=s icon-start=plus round .label=${t.addtoeditor??"Add to editor"} .id=${`add-to-editor-button-${s.conversationId}-${n?"standalone":"list"}`}></calcite-button><calcite-tooltip class="hidden-above-380" .referenceElement=${`add-to-editor-button-${s.conversationId}-${n?"standalone":"list"}`} placement=top-start>${t.addtoeditor??"Add to editor"}</calcite-tooltip><calcite-button class="add-to-editor-button hidden-below-380" @click=${()=>s.onAddToEditor("add")} scale=s icon-start=plus round>${t.addtoeditor??"Add to editor"}</calcite-button><calcite-button round icon-start=file-code kind=neutral scale=s @click=${()=>s.onAddToEditor("replace")} class="response-secondary-action-button" .id=${`replace-${s.conversationId}-${n?"standalone":"list"}`}></calcite-button><calcite-tooltip .referenceElement=${`replace-${s.conversationId}-${n?"standalone":"list"}`} placement=top-start><span>${t.replaceineditor??"Replace all code in editor"}</span></calcite-tooltip><calcite-button round icon-start=copy-to-clipboard kind=neutral scale=s @click=${d=>{let p=d.currentTarget;u(s.code).then(()=>{p.setAttribute("data-copied","true"),setTimeout(()=>p.removeAttribute("data-copied"),1500)})}} class="response-secondary-action-button" .id=${`copy-response-${s.conversationId}-${n?"standalone":"list"}`}></calcite-button><calcite-popover .referenceElement=${`copy-response-${s.conversationId}-${n?"standalone":"list"}`} placement=top-start class="copy-feedback" .label=${t.copiedsuccessfully??"copied successfully"} open trigger-disabled><span>${t.copiedsuccessfully??"copied successfully"}</span></calcite-popover><calcite-tooltip .referenceElement=${`copy-response-${s.conversationId}-${n?"standalone":"list"}`} placement=top-start class="copy-tooltip">${t.copytoclipboard??"Copy code to clipboard"}</calcite-tooltip></div><div slot=footer-end class="feedback-actions"><calcite-action .text=${t.thumbsup??"Thumbs up"} scale=s icon=thumbs-up @click=${s.onThumbsUp} .id=${`thumbs-up-${s.conversationId}-${n?"standalone":"list"}`}></calcite-action><calcite-tooltip .referenceElement=${`thumbs-up-${s.conversationId}-${n?"standalone":"list"}`} placement=top-start><span>${t.helpful??"Helpful"}</span></calcite-tooltip><calcite-action .text=${t.thumbsdown??"Thumbs down"} scale=s icon=thumbs-down @click=${s.onThumbsDown} .id=${`thumbs-down-${s.conversationId}-${n?"standalone":"list"}`}></calcite-action><calcite-tooltip .referenceElement=${`thumbs-down-${s.conversationId}-${n?"standalone":"list"}`} placement=top-start><span>${t.unhelpful??"Unhelpful"}</span></calcite-tooltip></div></calcite-card>`)}</calcite-card-group></calcite-block>`}var ee=i=>i.type==="featureSet",Pe=i=>G(i).map(e=>({alias:e.alias,name:e.name,type:e.type,...e.domain?{domain:e.domain}:{}})),E=i=>i?{fields:Pe(i)}:{};async function te(i){let e=await i.loadSource();return{name:i.name,type:"featureSet",...E(e?.fields)}}async function ce(i){switch(i.type){case"feature":{let e=await i.loadSource();return{name:i.name,type:i.type,...E(e?.fields)}}case"featureSet":{let e=await i.loadSource();return{name:i.name,type:"featureSet",...E(e?.fields)}}case"featureSetCollection":{let e=await i.loadSource(),t=e?.layers.filter(ee)??[],a=e?.tables.filter(ee)??[],o=await Promise.all(t.map(te)),r=await Promise.all(a.map(te));return{name:i.name,type:"featureSetCollection",layers:o,tables:r}}case"dictionary":{let e=await Promise.all(i.dictionaryVariables.map(ce));return{name:i.name,type:"dictionary",attributes:e}}case"pixel":{let e=await i.loadSource();if(!e)return{name:i.name,type:"pixel"};let t=await be(e);return{name:i.name,type:"pixel",members:t.map(ie)}}case"voxel":{let e=await i.loadSource();if(!e)return{name:i.name,type:"voxel"};let t=await ge(e);return{name:i.name,type:"voxel",members:t.map(ie)}}case"array":return{name:i.name,type:"array",elementType:i.elementType.type};case"number":case"text":case"boolean":case"date":case"knowledgeGraph":case"dateOnly":case"geometry":case"time":return{name:i.name,type:i.type}}}function ie(i){return i.type==="array"?{name:i.name,type:"array",elementType:i.elementType.type}:{name:i.name,type:i.type}}async function Ue(i){return{variables:await Promise.all(i.variables.map(ce))}}var Ne="arcade_generation",qe="ArcadeCodeRequest",T="visualization",_e="ArcadeAssistant",Fe=["your_comments","user_evaluation","question","answer","useragent","_source","version","context","extras"],ae=[],se=!0,R=class extends H{constructor(){super(...arguments),this.textAreaRef=V(),this.messages=B(),this._feedbackService=void 0,this.handleFeedbackButton=(e,t)=>{this.feedback={active:!0,value:e,item:t,termsAccepted:!1,text:"",submitting:!1}},this.handleFeedbackSheetClose=()=>{this.feedback={active:!1}},this.handleFeedbackSubmit=async()=>{if(!this.feedback.active)return;this.feedback={...this.feedback,submitting:!0};let e=await this.ensureFeedbackService();if(!e){this.handleFeedbackSheetClose();return}let t=this.getModel(),a=t?await this.getProfileAndMetadata(t.uri):void 0,o=me.applicationName;!o&&!this.appVersion&&b("warn",this,"esriConfig.applicationName is not set. Consider setting it to help identify the application version in feedback.");let r={user_evaluation:this.feedback.value,your_comments:this.feedback.text||void 0,question:this.feedback.item?.question??"",answer:encodeURIComponent(this.feedback.item?.formattedScript??""),useragent:navigator.userAgent,_source:_e,version:this.appVersion||o||"NOT_SET",context:a?JSON.stringify(a):"",extras:a?.profileId??"",conversation_id:this.feedback.item?.conversationId??"",privacy_statement:this.feedback.termsAccepted?"I_agree":""};try{await e.applyEdits({addFeatures:[new he({attributes:r})]})}catch(l){b("error",this,"Error submitting feedback.",{detail:{error:l}})}this.handleFeedbackSheetClose()},this.handleClose=e=>{this.closed=!0,this.closePanel?.(e)},this.setQuestion=e=>{this.question=e},this.onSuggestionClick=e=>{this.textAreaRef.value&&(this.textAreaRef.value.value=e,this.textAreaRef.value.setFocus(),this.setQuestion(e))},this.isViewingResult=!1,this.confirmationActive=!1,this.isSubmitting=!1,this.errorMessage=void 0,this.question="",this.history=[],this.feedback={active:!1},this.splashActive=!0,this.context=void 0,this.historyCards=[],this.helpBase="",this.assistantsEnabled=!1,this.closed=!1}static{this.properties={isViewingResult:16,confirmationActive:16,isSubmitting:16,errorMessage:16,question:16,history:16,feedback:16,splashActive:16,context:16,historyCards:16,closePanel:0,insertText:0,helpBase:1,assistantsEnabled:5,layer:[1,{type:Object}],portalUrl:1,serviceUrl:1,closed:7,editorRef:0,feedbackServiceUrl:1,appVersion:1}}static{this.styles=fe}get disclaimerComment(){return`// ${this.messages.disclaimercomment}
|
|
5
|
-
// ${this.messages.disclaimerpt2??"AI-generated content may be inaccurate. Review before using."}`}get assistantHelpUrl(){return`${this.helpBase??"https://doc.arcgis.com/en/arcgis-online/"}administer/configure-assistants.htm`}get assistantOverviewDocUrl(){return`${this.helpBase??"https://doc.arcgis.com/en/arcgis-online/"}create-maps/understand-arcade-assistant.htm`}get usingTheAssitantDocUrl(){return`${this.helpBase??"https://doc.arcgis.com/en/arcgis-online/"}create-maps/use-arcade-assistant.htm`}async destroy(){}load(){let e=async()=>{let t=this.getModel();if(!t){this.context=void 0;return}let a=await this.getProfileAndMetadata(t.uri);this.context=a};e().catch(t=>{b("error",this,"Error setting initial context.",{detail:{error:t}})}),this.manager.onLifecycle(()=>({remove:S.onModelContextDidChange(async()=>{e().catch(t=>{b("error",this,"Error setting context.",{detail:{error:t}})})}).dispose}))}willUpdate(e){(e.has("history")||e.has("messages"))&&(this.historyCards=this.getHistoryCards())}connectedCallback(){super.connectedCallback(),this.history=ae,this.splashActive=se}disconnectedCallback(){super.disconnectedCallback(),ae=this.history,se=this.splashActive,this.copySuccessTimer&&(clearTimeout(this.copySuccessTimer),this.copySuccessTimer=void 0)}getHistoryCards(){return this.history.reduce((e,t)=>(!t.script||(e.push({priorPrompt:t.question,code:t.formattedScript||t.error||"",chips:[{label:t.profile??T,icon:"map-information",appearance:"outline",scale:"s",conversationId:t.conversationId??"",tooltip:(this.messages.profilecontextlabel??"Profile context: {profileName}").replace("{profileName}",t.profile??T)},...t.layerName?[{label:(this.messages.numlayers??"{numLayers} {layerOrLayers}").replace("{numLayers}","1").replace("{layerOrLayers}",this.messages.numlayerssingular??"layer"),icon:"layer",appearance:"outline",scale:"s",conversationId:t.conversationId??"",tooltip:(this.messages.layercontextlabel??"Layer context: {layerName}").replace("{layerName}",t.layerName??"No layer")}]:[]],onAddToEditor:a=>{j(this.editorRef.editorInstance,t.formattedScript??"",a,this.disclaimerComment)},onThumbsUp:()=>this.handleFeedbackButton("good",t),onThumbsDown:()=>this.handleFeedbackButton("bad",t),conversationId:t.conversationId??"",message:t.message}),this.isViewingResult),e),[])}setFeedbackState(e){this.feedback=e}async ensureFeedbackService(){if(this._feedbackService)return this._feedbackService;if(!this.feedbackServiceUrl)return;let e=new ue({url:this.feedbackServiceUrl});await e.load();let t=Fe.filter(a=>!e.fields.some(o=>o.name===a));if(t.length>0){b("error",this,`Missing the following fields in feedback service: ${t.join(", ")}. Feedback will not be logged.`);return}return this._feedbackService=e,e}getModel(){return this.editorRef.editorInstance?.getModel()}async submitQuestion(){if(this.question){this.isSubmitting=!0;try{let e=await this.getToken(),t=this.getModel();if(!t)return;let{profileId:a,metadata:o,layerName:r}=await this.getProfileAndMetadata(t.uri),l=(await ve({baseUrl:this.serviceUrl,skillId:Ne,message:this.question,authToken:e,context:{kind:qe,context:{profile_id:a,metadata:[o]}}})).find(u=>u.context?.kind==="ArcadeCodeResponse");if(!l)return;l.context?.kind==="ArcadeCodeResponse"&&(this.history=[{script:l?.context?.arcadeCode?.code,formattedScript:Q(l?.context?.arcadeCode?.code??""),error:void 0,question:this.question,profile:a,conversationId:l.conversationId,layerName:r??void 0,...l.message?{message:l.message}:{}},...this.history],this.isViewingResult=!0,this.errorMessage=void 0)}catch(e){e instanceof Error&&e.name==="ArcadeAssistantError"?this.errorMessage=$e(e)||this.messages.erroroccurred||"An error occurred.":this.errorMessage=this.messages.erroroccurred||"An error occurred.",b("error",this,"Error submitting question",{detail:{error:e}})}finally{this.isSubmitting=!1}}}async getToken(){let{token:e}=await pe.getCredential(this.portalUrl);return e}async getProfileAndMetadata(e){let t=T,a=S.getEditorProfileForModel(e);a?.loaded||await a?.loadSource();let o=this.editorRef.profile;o&&"id"in o&&(t=o.id);let r=a?.definition?.variables?.find(n=>n.type==="feature"),l=a?await Ue(a):{variables:[]},u;return J(r?.definition)&&(u=r.definition.title),{profileId:t,metadata:l,layerName:u}}onCopyCode(e){let t=e?`${this.disclaimerComment}
|
|
6
|
-
${e}`:"";return navigator.clipboard.writeText(t)}render(){return this.closed?null:this.assistantsEnabled?c`<calcite-flow><calcite-flow-item closable heading-level=2 .heading=${this.messages.arcadeassistant??"Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${this.splashActive&&c`<calcite-scrim></calcite-scrim>`||""}${xe({messages:this.messages})}${we({popoverContent:K({assistantsEnabled:this.assistantsEnabled,messages:this.messages,assistantHelpUrl:this.assistantHelpUrl,helpTopicUrl:this.usingTheAssitantDocUrl})})}<calcite-shell class="unstyled-shell">${this.splashActive&&Re({messages:this.messages,onProceed:()=>{this.splashActive=!1},helpTopicUrl:this.assistantOverviewDocUrl,onExit:e=>this.closePanel?.(e)})||""}${Ae({active:this.confirmationActive,setActive:e=>this.confirmationActive=e,messages:this.messages})}${Se({isDisabled:this.isSubmitting,isReadOnly:!1,setQuestion:this.setQuestion,setIsViewingResult:e=>this.isViewingResult=e,mode:this.isViewingResult?"refine":"prompt",textAreaRef:this.textAreaRef,question:this.question,errorMessage:this.errorMessage,setErrorMessage:e=>this.errorMessage=e,submitQuestion:this.submitQuestion.bind(this),messages:this.messages,context:this.context})}<calcite-block-group label="interactive blocks">${!this.isViewingResult&&!this.isSubmitting&&Me({messages:this.messages,suggestions:[this.messages.prompsuggestion1??"",this.messages.prompsuggestion2??""],onSuggestionClick:this.onSuggestionClick})||""}<calcite-block .hidden=${!this.isSubmitting} .heading=${this.messages.generatingresponse??"Generating response..."}></calcite-block>${Z({expanded:this.isViewingResult,messages:this.messages,collapsible:!0,showEffectsIcon:!0,cards:this.historyCards.length?[this.historyCards[0]]:[],heading:this.messages.besteffort??"Here's the assistant's best effort",hidden:this.isSubmitting||!this.isViewingResult,onCopyCode:this.onCopyCode.bind(this),standalone:!0})}${Z({expanded:!this.isViewingResult,messages:this.messages,collapsible:!0,cards:this.isViewingResult?this.historyCards.slice(1):this.historyCards,heading:this.messages.recentprompts??"Recent prompts",hidden:this.isSubmitting||this.history.length===0,onCopyCode:this.onCopyCode.bind(this)})}</calcite-block-group>${this.feedback.active?Ee({setOpen:this.handleFeedbackSheetClose,messages:this.messages,onSubmit:this.handleFeedbackSubmit,feedback:this.feedback,setFeedback:this.setFeedbackState.bind(this)}):null}</calcite-shell></calcite-flow-item></calcite-flow>`:c`<calcite-flow><calcite-flow-item .selected=${!this.isViewingResult} closable heading-level=2 .heading=${this.messages.arcadeassistant??"Arcade assistant"} @calciteFlowItemClose=${this.handleClose}>${K({slot:"content-top",messages:this.messages,assistantsEnabled:this.assistantsEnabled,assistantHelpUrl:this.assistantHelpUrl,helpTopicUrl:this.usingTheAssitantDocUrl})}</calcite-flow-item></calcite-flow>`}};L("arcgis-arcade-coding-assistant",R);return R},"identity/IdentityManager","request","layers/FeatureLayer","config","Graphic","applications/Components/arcadeEditorUtils",a,d)
|
package/dist/cdn/6ZY6ERMO.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
|
-
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.111 */
|
|
4
|
-
import{a as N}from"./ACDQXQFL.js";import a from"./3K6DRDWG.js";import{a as f}from"./IJRKXHZX.js";import{a as h}from"./EF6CV6SD.js";import{a as m,d as l}from"./GTARB3UU.js";import{Gl as w,Sl as u,kk as M}from"./FKEB773L.js";export default $arcgis.t(([g])=>{M();var _=new m,p=class{constructor(e){this._defaults=e,this._worker=null,this._client=null,this._configChangeListener=this._defaults.onDidChange(()=>this.stopWorker())}dispose(){this._configChangeListener.dispose(),this.stopWorker()}stopWorker(){this._worker&&(this._worker.dispose(),this._worker=null,_=new m),this._client=null}static async waitForWorker(){return await _.promise}async _getClientProxy(){let e=await h();if(!this._client){let{languageId:t}=this._defaults;this._worker=e.createWebWorker({moduleId:"SqlExprWorker",label:t,createData:{languageId:t},host:this._defaults.workerHost}),_.resolve(this._worker),this._client=this._worker.getProxy()}return await this._client}async getLanguageServiceWorker(...e){let t=await this._getClientProxy();return await this._worker?.withSyncedResources(e),t}},b=["AND","AS","BOTH","CASE","CAST","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","DATE","DAY","DOY","DOW","ELSE","END","ESCAPE","FALSE","FLOAT","FOR","FROM","HOUR","IN","INT","INTEGER","INTERVAL","LEADING","LIKE","MINUTE","MONTH","POSITION","REAL","SECOND","SMALLINT","THEN","TIME","TIMESTAMP","TIMEZONE_HOUR","TIMEZONE_MINUTE","TO","TRAILING","TRIM","TRUE","VARCHAR","WEEK","WHEN","WITH","YEAR","ZONE"],D=["AND","BETWEEN","LIKE","NOT","OR","IS","NULL"],O=["CAST","EXTRACT","CURRENT_DATE","CURRENT_TIME","CURRENT_TIMESTAMP","CURRENT_USER","ABS","ACOS","ASIN","ATAN","CEILING","COS","FLOOR","LOG","LOG10","MOD","NULLIF","POWER","ROUND","SIGN","SIN","TAN","TRUNCATE","CHAR_LENGTH","COALESCE","CONCAT","LOWER","POSITION","SUBSTRING","TRIM","UPPER"],x={comments:{lineComment:"--",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}]},y={defaultToken:"",tokenPostfix:".arcgis",ignoreCase:!0,brackets:[{open:"[",close:"]",token:"delimiter.square"},{open:"(",close:")",token:"delimiter.parenthesis"}],keywords:b,operators:D,builtinFunctions:O,builtinVariables:[],tokenizer:{root:[{include:"@comments"},{include:"@whitespace"},{include:"@numbers"},{include:"@strings"},{include:"@complexIdentifiers"},{include:"@scopes"},[/[;,.]/,"delimiter"],[/[()]/,"@brackets"],[/[\w@#$]+/,{cases:{"@operators":"operator","@builtinVariables":"predefined","@builtinFunctions":"predefined","@keywords":"keyword","@default":"identifier"}}],[/[<>=!%&+\-*/|~^]/,"operator"]],whitespace:[[/\s+/,"white"]],comments:[[/--+.*/,"comment"],[/\/\*/,{token:"comment.quote",next:"@comment"}]],comment:[[/[^*/]+/,"comment"],[/\*\//,{token:"comment.quote",next:"@pop"}],[/./,"comment"]],numbers:[[/0[xX][0-9a-fA-F]*/,"number"],[/[$][+-]*\d*(\.\d*)?/,"number"],[/((\d+(\.\d*)?)|(\.\d+))([eE][\-+]?\d+)?/,"number"]],strings:[[/N'/,{token:"string",next:"@string"}],[/'/,{token:"string",next:"@string"}]],string:[[/[^']+/,"string"],[/''/,"string"],[/'/,{token:"string",next:"@pop"}]],complexIdentifiers:[[/"/,{token:"identifier.quote",next:"@quotedIdentifier"}]],quotedIdentifier:[[/[^"]+/,"identifier"],[/""/,"identifier"],[/"/,{token:"identifier.quote",next:"@pop"}]],scopes:[[/(BEGIN|CASE)\b/i,{token:"keyword.block"}],[/END\b/i,{token:"keyword.block"}],[/WHEN\b/i,{token:"keyword.choice"}],[/THEN\b/i,{token:"keyword.choice"}]]}},I=class{constructor(e,t){this._worker=e,this._defaults=t}async provideCompletionItems(e,t){try{let o=await this._worker(e.uri),r=e.getWordUntilPosition(t),n={startLineNumber:t.lineNumber,endLineNumber:t.lineNumber,startColumn:r.startColumn,endColumn:r.endColumn},c=this._defaults.getApiContextForModel(e.uri);return await o.doComplete(e.uri.toString(),n,t,c)}catch(o){return l("SqlExprCompletionProvider")(o),{suggestions:[]}}}},k=class{constructor(e,t,{defaults:o,diagnosticService:r}){this._languageId=e,this._worker=t,this._disposables=[],this._modelListeners=new Map,this._diagnosticsService=r,this._defaults=o,h().then(n=>{let c=i=>{let s=i.getLanguageId();if(s!==this._languageId)return;let d=f(()=>{this._doValidate(i,s).catch(L=>{throw L})}),A=i.onDidChangeContent(d),R=i.onDidChangeAttached(d);this._modelListeners.set(i.uri.toString(),[A,R]),this._doValidate(i,s).catch(l("SqlExprDiagnosticsAdapter"))},E=i=>{let s=i.uri.toString();n.setModelMarkers(i,this._languageId,[]);let d=this._modelListeners.get(s);if(d){for(;d.length;)d.pop()?.dispose();this._modelListeners.delete(s)}};this._disposables.push(n.onDidCreateModel(c)),this._disposables.push(n.onWillDisposeModel(i=>E(i))),this._disposables.push(n.onDidChangeModelLanguage(i=>{E(i.model),c(i.model)})),this._disposables.push(o.onDidChange(()=>{n.getModels().forEach(i=>{i.getLanguageId()===this._languageId&&(E(i),c(i))})})),this._disposables.push(o.onModelContextDidChange(i=>{n.getModels().forEach(s=>{s.getLanguageId()===this._languageId&&s.uri.toString()===i&&this._doValidate(s,this._languageId).catch(l("SqlExprDiagnosticsAdapter"))})})),this._disposables.push({dispose:()=>{this._modelListeners.forEach(i=>i.forEach(s=>s.dispose())),this._modelListeners.clear()}}),n.getModels().forEach(c)})}async _doValidate(e,t){let o=await h();if(e.isAttachedToEditor())try{let r=await this._worker(e.uri),n=this._defaults.getApiContextForModel(e.uri),c=await r.doValidation(e.uri.toString(),n);this._diagnosticsService.fireDiagnosticsChange(e.uri,c),o.setModelMarkers(e,t,c)}catch(r){l("SqlExprDiagnosticsAdapter")(r)}}},C;async function Y(...a){return await p.waitForWorker(),await new Promise((e,t)=>{if(!C){t(new Error("sql expression worker not registered!"));return}e(C(...a))})}var T=class{constructor(){this._onDiagnosticsChange=new w}get onDiagnosticsChange(){return this._onDiagnosticsChange.event}fireDiagnosticsChange(e,t){this._onDiagnosticsChange.fire({uri:e,diagnostics:t})}},S=new T;async function Z(){return await N(),S}function X(a){let e=new p(a),t=async(...r)=>await e.getLanguageServiceWorker(...r);C=t,u.setMonarchTokensProvider(g.languageId,y),u.setLanguageConfiguration(g.languageId,x);let o=new I(t,g);u.registerCompletionItemProvider(g.languageId,o),new k(a.languageId,t,{defaults:a,diagnosticService:S})}return{a:Y,b:Z,c:X}},a)
|
package/dist/cdn/EGSHWWSC.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
|
-
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.111 */
|
|
4
|
-
import c from"./UDPOBQDF.js";import b from"./R22GWF4X.js";import{a as u}from"./M3DWRUJ6.js";import{a as m}from"./ACDQXQFL.js";import a from"./3K6DRDWG.js";import{a as t}from"./EF6CV6SD.js";import{Pl as d,Sl as s,kk as k}from"./FKEB773L.js";export default $arcgis.t(([a,n,{c:c}])=>{k();var w=["arcade","arcgis-sql-expression"],i=new Set,p=new Map;function f(e){let r=p.get(e);return r||(r=Promise.withResolvers(),p.set(e,r)),r}function l(e){f(e).resolve()}function A(e){return w.includes(e)?f(e).promise:Promise.resolve()}function h(e,r){return()=>{i.has(e)||i.add(e),r()}}async function R(e){i.has(e)||(await t()).createModel("",e,d.parse("")).dispose()}x();function x(){t().then(e=>{["light","dark"].forEach(r=>{let g=r==="light"?"vs":"vs-dark",o=u[`${r}-theme`];e.defineTheme(g,{base:g,inherit:!0,rules:[{token:"comment.arcgis",foreground:o.comment},{token:"constant.arcgis",foreground:o.constant},{token:"keyword.arcgis",foreground:o.keyword},{token:"identifier.arcgis",foreground:o.identifier},{token:"number.arcgis",foreground:o.number},{token:"string.arcgis",foreground:o.string},{token:"operator.arcgis",foreground:o.operator},{token:"predefined.arcgis",foreground:o.predefined},{token:"date.arcgis",foreground:o.date}],colors:{}})})})}s.register({id:a.languageId,aliases:["EsiSqlExpression","sql-expression"],extensions:[".sql-expression"],mimetypes:["application/sql-expression"]});s.onLanguage(a.languageId,h(a.languageId,()=>{m().then(e=>{e.setupMode(a),l(a.languageId)}).catch(e=>{throw e})}));s.register({id:n.languageId,aliases:["Arcade","arcade"],extensions:[".arc"],mimetypes:["application/arcade"]});s.onLanguage(n.languageId,h(n.languageId,()=>{c().then(e=>{e.setupMode(n),l(n.languageId)}).catch(e=>{throw e})}));return{a:A,b:R}},a,b,c)
|
package/dist/cdn/FLUNOJKB.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
|
-
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.111 */
|
|
4
|
-
import e from"./UDPOBQDF.js";import{a as z}from"./HOEQZCFF.js";import d from"./R22GWF4X.js";import c from"./ZUCKRKBB.js";import{a as M}from"./XHEFV6KG.js";import"./2QH3V2HU.js";import a from"./OPDRDV2X.js";import"./DUWJBGKW.js";import"./EUE6CTFC.js";import"./EF6CV6SD.js";import"./PZVOBAUY.js";import"./77EDUK6A.js";import"./AK7M5DI4.js";import{E as C,F as k,G as B,H as r,K as I,L,h as E,j as i,l as f,n as b,s as y,u as D}from"./ZOG23UWP.js";import{a as w,c as R,d as o}from"./GTARB3UU.js";import{Hl as F,kk as H}from"./FKEB773L.js";import"./QOY5OOS2.js";export default $arcgis.t(([V,,{a:T,h:x},l,{a:U,b:j}])=>{H();var G=E`@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}}}`,X="https://services6.arcgis.com/HXHga6CfMLMBOlBX/ArcGIS/rest/services/survey123_6e349a50b4504ca6b6107216d568db5f_form/FeatureServer/0",a=(s,e)=>R(s,"Arcade Assistant",e),q=s=>{let{aiAssistantsEnabled:e}=s;return e===void 0?(a("warn","`areAiAssistantsEnabled` is not defined in the organizations settings."),!1):e},K=s=>!(!s||!("id"in s)),J=async s=>(await V.getCredential(s)).token;async function Q({portalUrl:s,profile:e}){if(!K(e))return a("warn","Addon initialization failed. Reason: unsupported profile."),{shouldRender:!1};let t=s.replace(/\/sharing\/rest(\/.*)?$/iu,"").replace(/\/$/u,""),n=await J(s),c=`${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}`,g=await Promise.allSettled([fetch(c,{credentials:"include"}).then(d=>d.json()),fetch(h,{credentials:"include"}).then(d=>d.json()),fetch(p,{credentials:"include"}).then(d=>d.json())]),[u,_,m]=g,A=u.status==="fulfilled"?u.value:(a("warn",`Failed to fetch selfUrl. Reason: ${u.reason}.`),{}),S=_.status==="fulfilled"?_.value:(a("warn",`Failed to fetch settingsUrl. Reason: ${_.reason}.`),{}),N=m.status==="fulfilled"?m.value:(a("warn",`Failed to fetch signinSettingsUrl. Reason: ${m.reason}.`),{}),v=A?.helperServices?.aiAssistantServices?.url;if(!v)return a("warn","Service URL is not available in the portal self response."),{shouldRender:!1};let O=A.helpBase||"";if(!S)return a("warn","Settings response is not available."),{shouldRender:!1};let P=q(S);return N.blockBetaApps===!0&&(a("warn","Arcade Assistant is blocked by the organization settings. To enable it, do not block beta apps in the organization settings."),P=!1),{shouldRender:!0,serviceUrl:v,helpBase:O,assistantsEnabled:P,feedbackServiceUrl:X}}var $=class extends B{constructor(){super(...arguments),this._codeEditorElt=C(),this._componentReadyDefer=new w,this._disposables=[],this._editorProfilePromise=Promise.resolve(void 0),this.messages=M(),this._modelId=y(),this._openArcadeHelp=()=>void window.open(T,"Arcade Help"),this._toggleSidePanel=e=>{if(!e.target)return;let t=e.target?.dataset.panelName??"none";this.openedSidePanel=t===this.openedSidePanel?"none":t,this.openedSidePanel==="none"&&this._codeEditorElt.value?.setFocus().catch(o(this))},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=b({bubbles:!1}),this.arcgisScriptChange=b({bubbles:!1})}static{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}}static{this.shadowRootOptions=D}static{this.styles=[G,z]}get editorInstance(){return this._codeEditorElt.value?.editorInstance}async getEditorInstance(){return await this._componentReadyDefer.promise,this._codeEditorElt.value?.editorInstance}async getScript(){return await this._componentReadyDefer.promise,this._codeEditorElt.value?.value}async getTestResult(){if(!this.testData)return{type:"error",value:"Missing test data",error:null};let e=await this._editorProfilePromise;if(!e)return{type:"error",value:"Missing editor profile",error:null};await this._componentReadyDefer.promise;let t=this._codeEditorElt.value?.value;return await x(e.definition,t,this.testData)}async setFocus(){await this._componentReadyDefer.promise,await this._codeEditorElt.value?.setFocus()}async load(){let e=L("./assets");U(e),await this._updateDataModelDeps(),await this._updateArcadeAssistantRemoteState()}willUpdate(e){(e.has("messages")||e.has("profile"))&&this.hasUpdated&&this._updateDataModelDeps(),e.has("testData")&&this._testDataChanged(),e.has("snippets")&&l.updateApiContextForModel(this._modelId,{snippets:this.snippets}),e.has("arcadeAssistant")&&this._updateArcadeAssistantRemoteState()}async loaded(){this._componentReadyDefer.resolve(),await this._updateApiLibrary();let e=await j();this._disposables.push(e.onDiagnosticsChange(t=>!this._preparingArcade&&this.arcgisDiagnosticsChange.emit(t.diagnostics))),this.testData&&this._addExecuteScriptAction()}disconnectedCallback(){for(super.disconnectedCallback();this._disposables.length;)this._disposables.pop()?.dispose()}async _updateDataModelDeps(){await this._updateEditorProfile(),await this._updateApiLibrary()}_testDataChanged(){!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))}async _updateEditorProfile(){this._preparingArcade=!0;try{await l.setProfileForModel(this._modelId,this.profile,{locale:this.messages._t9nLocale,snippets:this.snippets}),this._editorProfile=l.getEditorProfileForModel(this._modelId)}catch{this._editorProfile=void 0}finally{this._editorProfilePromise=Promise.resolve(this._editorProfile),this._preparingArcade=!1}}async _updateApiLibrary(){this._apiLibrary=await l.getApiLibraryForModel(this._modelId)}async _executeScript(){let e=this.testData;if(!this._codeEditorElt.value||!e)return;let t=await this._editorProfilePromise;if(!t){this._executionResult={type:"error",value:"Missing editor profile",error:null};return}this._showExecutionPanel=!0,this._executingScript=!0,this._consoleLogs=[],setTimeout(()=>void(async()=>{let n=this._codeEditorElt.value?.value;this._executionResult=await x(t.definition,n,e,c=>setTimeout(()=>this._consoleLogs=[...this._consoleLogs,c],0)),this._executingScript=!1})(),0)}_toggleShowExecutionPanel(){this._showExecutionPanel=!this._showExecutionPanel}_toggleSideActionBarExpanded(){this.sideActionBarExpanded=!this.sideActionBarExpanded}_onCodeEditorValueChange(e){e.stopPropagation(),this.script=e.detail,this.arcgisScriptChange.emit(e.detail)}_insertAsSnippet(e){this._codeEditorElt.value?.insertSnippet(e.detail).catch(o(this))}_insertAsText(e){this._insertText(e.detail)}_insertText(e){this._codeEditorElt.value?.insertText(e).catch(o(this))}_onResultPanelChange(e){this._resultPanel=e.detail}_onExecutionPanelClose(){this._showExecutionPanel=!1}_addExecuteScriptAction(){let e=this.editorInstance?.addAction({id:"run-script",label:"Run Arcade Expression",keybindings:[F.F5],contextMenuGroupId:"code",contextMenuOrder:1,run:()=>{this.testData&&this._executeScript().catch(o(this))}});e&&(this._executeScriptAction=e,this._disposables.push(e))}_disposeSafely(e){let t=this._disposables.indexOf(e);t!==-1&&this._disposables.splice(t,1),e.dispose()}async _updateArcadeAssistantRemoteState(){this.arcadeAssistant&&(this._arcadeAssistantRemoteState=await Q({...this.arcadeAssistant,profile:this.profile}))}renderMainActionBar(){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}renderMainPanel(){return i`<arcgis-code-editor class="flex-adjustable" .editorOptions=${this.editorOptions} .language=${l.languageId} .value=${this.script??""} .modelId=${this._modelId} @arcgisValueChange=${this._onCodeEditorValueChange} ${k(this._codeEditorElt)}></arcgis-code-editor>`}renderAction({id:e,label:t,icon:n,active:c,panelName:h,iconFlipRtl:p=!1,onClick:g=this._toggleSidePanel}){return i`<calcite-action id=${e??f} .text=${t} .textEnabled=${this.sideActionBarExpanded} .icon=${n} .active=${c} @click=${g} data-panel-name=${h??f} .iconFlipRtl=${p}></calcite-action>${!this.sideActionBarExpanded&&i`<calcite-tooltip .referenceElement=${e}><span>${t}</span></calcite-tooltip>`||""}`}renderSideActionBar(){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({id:"profile-variables-action",label:this.messages.profilevariables??"",icon:"profile-variables",active:this.openedSidePanel==="variables",panelName:"variables"})}${this.renderAction({id:"function-action",label:this.messages.constantsandfunctions??"",icon:"function",active:this.openedSidePanel==="api",panelName:"api"})}${this.suggestions?.length?this.renderAction({id:"suggestions-action",label:this.messages.suggestions??"",icon:"lightbulb",active:this.openedSidePanel==="suggestions",panelName:"suggestions"}):null}${this._arcadeAssistantRemoteState.shouldRender&&this.renderAction({id:"arcade-assistant-action",label:this.messages.arcadeassistant??"Arcade assistant",icon:"effects",active:this.openedSidePanel==="arcade-assistant",panelName:"arcade-assistant"})||""}${this.customPanels?.map(e=>e.enabled===!1?null:this.renderAction({id:e.id,label:e.name,icon:e.icon,active:this.openedSidePanel===e.id,panelName:e.id}))}${this.hideDocumentationActions?null:this.renderAction({id:"developer-website-action",label:this.messages.help??"",icon:"question",active:!1,panelName:"none",iconFlipRtl:this.messages._lang==="ar",onClick:this._openArcadeHelp})}</calcite-action-group></calcite-action-bar>`}renderSidePanel(){if(this.hideSideBar)return null;let{openedSidePanel:e}=this;return i`<arcgis-language-api-panel class=${r(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=${r(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=${r(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=${r(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=${r(e===t.id?"code-editor-side-panel flex-panel border-inline-start":"hidden")}>${t?.useFlows?t.renderer?.({closePanel:this._toggleSidePanel,insertText:this._insertText.bind(this),closed:e!==t.id,editorRef:this.el}):i`<calcite-flow-item .heading=${t.name} heading-level=2 closable .closed=${e!==t.id} @calciteFlowItemClose=${this._toggleSidePanel} .description=${t.description}>${t.renderer?.({closePanel:this._toggleSidePanel,insertText:this._insertText.bind(this),closed:e!==t.id,editorRef:this.el})}</calcite-flow-item>`}</calcite-flow>`)}`}renderResultsPanel(){return this._showExecutionPanel?i`<arcgis-arcade-results class="flex-adjustable" .openedResultPanel=${this._resultPanel} .loading=${this._executingScript} .result=${this._executionResult} .consoleLogs=${this._consoleLogs} @arcgisOpenedResultPanelChange=${this._onResultPanelChange} @arcgisClose=${this._onExecutionPanelClose}></arcgis-arcade-results>`:null}render(){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>`}};I("arcgis-arcade-editor",$);return $},"identity/IdentityManager",a,c,d,e)
|
package/dist/cdn/HOEQZCFF.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
2
|
-
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
|
|
3
|
-
v5.0.0-next.111 */
|
|
4
|
-
import{h as o}from"./ZOG23UWP.js";var i=o`@layer{arcgis-arcade-editor,arcgis-sql-expression-editor{--arcgis-coding-components-border: 1px solid var(--calcite-color-border-3);--arcgis-coding-components-background-color: var(--calcite-color-foreground-1);--arcgis-coding-components-side-action-bar-max-w: 25%;--arcgis-coding-components-code-editor-side-panel-w: 600px;--arcgis-coding-components-code-editor-side-panel-max-w: 45%;.flex-adjustable{flex:1 1 auto;overflow:hidden}.flex-panel{flex:1 0 auto}.position-relative{position:relative}.flex-row{display:flex;flex-direction:row;overflow:hidden}.flex-column{display:flex;flex-direction:column;overflow:hidden}.border-inline-start{border-inline-start:var(--arcgis-coding-components-border)!important;box-sizing:border-box}.border-inline-end{border-inline-end:var(--arcgis-coding-components-border)!important;box-sizing:border-box}.side-action-bar{max-width:var(--arcgis-coding-components-side-action-bar-max-w)}.code-editor-side-panel{max-width:var(--arcgis-coding-components-code-editor-side-panel-max-w);width:var(--arcgis-coding-components-code-editor-side-panel-w)}.code-editor-side-panel calcite-flow{height:100%}}}`;export{i as a};
|