@arcgis/coding-components 5.0.0-next.112 → 5.0.0-next.114

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.
Files changed (120) hide show
  1. package/dist/addons.js +1 -1
  2. package/dist/cdn/{VQ2JSD3J.js → 2GCQFUMI.js} +2 -2
  3. package/dist/cdn/{W2UGPDJ4.js → 4LHBHN5J.js} +2 -2
  4. package/dist/cdn/{TRANGKBJ.js → 4Y5YSMOE.js} +2 -2
  5. package/dist/cdn/{KU67M6PI.js → 5CZRMWEI.js} +2 -2
  6. package/dist/cdn/{ZYK7M7LM.js → 5D7BZ4AJ.js} +123 -123
  7. package/dist/cdn/{5ZGX5XTK.js → 5XRXNGIJ.js} +2 -2
  8. package/dist/cdn/{77JGK5GN.js → 67ARLOL3.js} +2 -2
  9. package/dist/cdn/{GBTWZ3XD.js → 67ZTNYDR.js} +2 -2
  10. package/dist/cdn/{GI6HWCLC.js → 6HZN5K7C.js} +1 -1
  11. package/dist/cdn/{RKOC5IRE.js → AW57CO3G.js} +2 -2
  12. package/dist/cdn/BLWQ7QOL.js +4 -0
  13. package/dist/cdn/{TDGS2O6Y.js → C62MXLP6.js} +1 -1
  14. package/dist/{monacoStyles.js → cdn/DR2NYKLD.js} +3 -6
  15. package/dist/cdn/{QEFMGE4W.js → EAJJ7BYC.js} +2 -2
  16. package/dist/cdn/{Z2TSI7BE.js → ELX57OKG.js} +1 -1
  17. package/dist/cdn/FBPV75KB.js +4 -0
  18. package/dist/cdn/FXBIE4TU.js +4 -0
  19. package/dist/cdn/GELX4TL4.js +4 -0
  20. package/dist/cdn/{2ICHDIM4.js → GZAZQWHH.js} +2 -2
  21. package/dist/cdn/{PCKTIN6B.js → HZPKRD5Y.js} +2 -2
  22. package/dist/cdn/{FXYQAPUS.js → IGN4DYX6.js} +1 -1
  23. package/dist/cdn/{AER7L4K2.js → JX5Z5PZM.js} +2 -2
  24. package/dist/cdn/{PCPWZFIQ.js → JYZFOYLT.js} +1 -1
  25. package/dist/cdn/{WJDBXY4M.js → KRZYNZ3L.js} +1 -1
  26. package/dist/cdn/{BJ7H7ILG.js → LVRGJKTO.js} +2 -2
  27. package/dist/cdn/{GAFEHBI4.js → N4HK6QPY.js} +1 -1
  28. package/dist/cdn/{MACRVGYV.js → NGMWEFSR.js} +2 -2
  29. package/dist/cdn/{PGHGI33U.js → NNVZSNRG.js} +2 -2
  30. package/dist/cdn/{Z464KXFF.js → NOJYWNV6.js} +2 -2
  31. package/dist/cdn/{TDNUUDEQ.js → NR6Y3SMQ.js} +2 -2
  32. package/dist/cdn/{QSDHTP2O.js → O2RLIM4Z.js} +2 -2
  33. package/dist/cdn/OCXQUJHW.js +6 -0
  34. package/dist/cdn/{73A4C5J2.js → OTELJGV3.js} +18 -18
  35. package/dist/cdn/{WOHUDG7Y.js → OTTHE5A7.js} +2 -2
  36. package/dist/cdn/P6PEG6MN.js +4 -0
  37. package/dist/cdn/{GSD5MJRA.js → Q7T6IG6A.js} +3 -3
  38. package/dist/cdn/QGA5LYZF.js +4 -0
  39. package/dist/cdn/R7M5X6VK.js +4 -0
  40. package/dist/cdn/{TUHLHREY.js → RVD7TQR3.js} +2 -2
  41. package/dist/cdn/SZPTSVKI.js +4 -0
  42. package/dist/cdn/{KGCVH6T7.js → TDWKY5BJ.js} +1 -1
  43. package/dist/cdn/TINATS7X.js +4 -0
  44. package/dist/cdn/TOESJKP6.js +4 -0
  45. package/dist/cdn/UYKE4EFV.js +4 -0
  46. package/dist/cdn/{VII3DH4T.js → VCLSKCOF.js} +2 -2
  47. package/dist/cdn/{KPOAYJOJ.js → VJTAK7CX.js} +2 -2
  48. package/dist/cdn/{7GYPGUXR.js → VWGDPBT6.js} +2 -2
  49. package/dist/cdn/{KQZKX2SL.js → YEA4EWQC.js} +2 -2
  50. package/dist/cdn/assets/code-editor/sql-expr.worker.js +2 -2
  51. package/dist/cdn/index.js +2 -7
  52. package/dist/cdn/main.css +1 -1
  53. package/dist/chunks/arcade-contribution.js +8 -5
  54. package/dist/chunks/arcade-defaults.js +1 -1
  55. package/dist/chunks/arcade-executor.js +1 -1
  56. package/dist/chunks/arcade-mode.js +21 -18
  57. package/dist/chunks/arcade-service-accessors.js +16 -13
  58. package/dist/chunks/colorize.js +1 -1
  59. package/dist/chunks/fields.js +1 -1
  60. package/dist/chunks/language-defaults-base.js +1 -1
  61. package/dist/chunks/markdown.js +1 -1
  62. package/dist/chunks/monaco-importer.js +6 -3
  63. package/dist/chunks/monaco-theme.js +1 -1
  64. package/dist/chunks/runtime.js +1 -1
  65. package/dist/chunks/sql-expr-defaults.js +1 -1
  66. package/dist/chunks/sql-expr-mode.js +35 -32
  67. package/dist/chunks/sql-expr-service-accessors.js +1 -1
  68. package/dist/chunks/useT9n.js +1 -1
  69. package/dist/chunks/utilities.js +1 -1
  70. package/dist/components/arcgis-arcade-coding-assistant/customElement.js +13 -13
  71. package/dist/components/arcgis-arcade-editor/customElement.js +41 -42
  72. package/dist/components/arcgis-arcade-editor/index.d.ts +1 -0
  73. package/dist/components/arcgis-arcade-editor/index.js +1 -0
  74. package/dist/components/arcgis-arcade-results/customElement.js +1 -1
  75. package/dist/components/arcgis-arcade-suggestions/customElement.js +5 -5
  76. package/dist/components/arcgis-code-editor/customElement.d.ts +1 -1
  77. package/dist/components/arcgis-code-editor/customElement.js +269 -60
  78. package/dist/components/arcgis-code-editor-shell/customElement.d.ts +17 -0
  79. package/dist/components/arcgis-code-editor-shell/customElement.js +19 -0
  80. package/dist/components/arcgis-code-editor-shell/index.d.ts +1 -0
  81. package/dist/components/arcgis-code-editor-shell/index.js +1 -0
  82. package/dist/components/arcgis-code-viewer/customElement.js +1 -1
  83. package/dist/components/arcgis-editor-variables/customElement.js +1 -1
  84. package/dist/components/arcgis-language-api-panel/customElement.js +11 -11
  85. package/dist/components/arcgis-sql-expression-editor/customElement.js +15 -19
  86. package/dist/components/arcgis-sql-expression-editor/index.d.ts +1 -0
  87. package/dist/components/arcgis-sql-expression-editor/index.js +1 -0
  88. package/dist/components/arcgis-sql-expression-fields/customElement.js +1 -1
  89. package/dist/docs/api.json +126 -5
  90. package/dist/docs/docs.json +123 -5
  91. package/dist/docs/vscode.css-custom-data.json +30 -1
  92. package/dist/docs/vscode.html-custom-data.json +11 -0
  93. package/dist/docs/web-types.json +64 -2
  94. package/dist/index.d.ts +5 -0
  95. package/dist/index.js +1 -1
  96. package/dist/loader.js +5 -4
  97. package/dist/types/lumina.d.ts +5 -0
  98. package/dist/types/preact.d.ts +6 -0
  99. package/dist/types/react.d.ts +7 -0
  100. package/dist/types/stencil.d.ts +5 -0
  101. package/dist/utils/internal-monaco-apis.d.ts +67 -0
  102. package/dist/utils/monaco-importer.d.ts +3 -0
  103. package/dist/utils/monaco-typings.d.ts +3 -0
  104. package/dist/utils/patch-monaco.d.ts +16 -0
  105. package/package.json +5 -5
  106. package/dist/cdn/22SZEPF4.js +0 -4
  107. package/dist/cdn/AT42Z3HP.js +0 -4
  108. package/dist/cdn/AW76B7FW.js +0 -4
  109. package/dist/cdn/BEFETNPF.js +0 -4
  110. package/dist/cdn/CX2SSXG4.js +0 -4
  111. package/dist/cdn/EVYUD4NL.js +0 -4
  112. package/dist/cdn/HZ67L7NJ.js +0 -4
  113. package/dist/cdn/K6MDPJED.js +0 -4
  114. package/dist/cdn/KQP2PJVU.js +0 -4
  115. package/dist/cdn/MRZLSJ6G.js +0 -6
  116. package/dist/cdn/QS3R73AT.js +0 -4
  117. package/dist/cdn/WZYVKC6H.js +0 -4
  118. package/dist/cdn/YTXEQJJ6.js +0 -4
  119. package/dist/chunks/editor.js +0 -8
  120. package/dist/utils/import-monaco-styles.d.ts +0 -7
@@ -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.112",
4
+ "version": "5.0.0-next.114",
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.112 */
6
+ v5.0.0-next.114 */
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 s } from "@arcgis/lumina";
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.112 */
6
- const a = s(e, {
5
+ v5.0.0-next.114 */
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
- a as defineCustomElements
20
+ o as defineCustomElements
20
21
  };
@@ -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
  }
@@ -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
  }
@@ -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
  }
@@ -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.112",
3
+ "version": "5.0.0-next.114",
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.112",
46
- "@arcgis/languages-api-utils": "5.0.0-next.112",
47
- "@arcgis/lumina": "5.0.0-next.112",
48
- "@arcgis/toolkit": "5.0.0-next.112",
45
+ "@arcgis/arcade-languageservice": "5.0.0-next.114",
46
+ "@arcgis/languages-api-utils": "5.0.0-next.114",
47
+ "@arcgis/lumina": "5.0.0-next.114",
48
+ "@arcgis/toolkit": "5.0.0-next.114",
49
49
  "@lit/task": "^1.0.3",
50
50
  "lit": "^3.3.0",
51
51
  "monaco-editor": "^0.52.0",
@@ -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.112 */
4
- import{a as n}from"./WJDBXY4M.js";import{a as f}from"./VII3DH4T.js";import"./TUHLHREY.js";import{a as g}from"./TRANGKBJ.js";import"./PCPWZFIQ.js";import{d as p,e as u}from"./AER7L4K2.js";import{F as c,G as d,K as h,h as m,j as s,n as a,r as o}from"./GSD5MJRA.js";import"./GI6HWCLC.js";import"./GAFEHBI4.js";var b=m`:host{background-color:var(--calcite-color-foreground-1);.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.sticky{position:sticky;top:0;z-index:10}calcite-flow{height:100%}calcite-block{p:first-of-type{margin-top:0}}calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}}`,r=class extends d{constructor(){super(...arguments),this.messages=f(),this._unselectItem=async()=>{this._selectedApiItem=void 0},this._filterValue="",this.languageId="arcade",this.hideDocumentationActions=!1,this.loading=!1,this.closed=!1,this.arcgisClose=a({bubbles:!1}),this.arcgisItemSelected=a({bubbles:!1})}static{this.properties={_filterValue:16,_selectedApiItem:16,languageId:1,apiLibrary:0,hideDocumentationActions:5,loading:5,closed:5}}static{this.styles=b}willUpdate(e){if(e.has("apiLibrary")){if(!this._selectedApiItem)return;for(let i of this.apiLibrary??[])for(let t of i.items)if(t.name===this._selectedApiItem.name){this._selectedApiItem=t;return}this._selectedApiItem=void 0}}disconnectedCallback(){super.disconnectedCallback(),this._flowObserver?.disconnect()}flowFocusHandler(e){if(!e){this._flowObserver?.disconnect(),this._flowObserver=void 0;return}this._flowObserver||(this._flowObserver=new MutationObserver(()=>{u(e.querySelector("calcite-flow-item:last-child"),"calcite-input")}),this._flowObserver.observe(e,{attributes:!0,attributeFilter:["id"],childList:!0}))}_emitItemSelected(e,i){if(!i)return;let t=e;(!t.key||t.key==="Enter")&&(e.preventDefault(),this.arcgisItemSelected.emit(i.completion.insertText??""))}_emitClose(){this.arcgisClose.emit()}_emitItemSelectedAndClose(e,i){let t=e;(!t.key||t.key==="Enter")&&(e.preventDefault(),this.arcgisItemSelected.emit(i.completion.insertText??""))}_selectItem(e,i){e.stopPropagation(),this._selectedApiItem=i}_updateFilterValue(e){this._filterValue=e.currentTarget.value??""}_elementToMarkdown(e){e!==void 0&&(e.innerHTML=n(this._selectedApiItem.examples))}renderApiCategory(e){let i=g(e.items,"name",this._filterValue);return i.length?s`<calcite-list-item-group .heading=${e.title}>${i.map(t=>s`<calcite-list-item .label=${o(t.completion.detail)} @calciteListItemSelect=${l=>this._emitItemSelected(l,t)} @keydown=${l=>this._emitItemSelected(l,t)}><calcite-action slot=actions-end .text=${this.messages.expand??""} icon=chevron-right icon-flip-rtl scale=s @click=${l=>this._selectItem(l,t)}></calcite-action></calcite-list-item>`)}</calcite-list-item-group>`:null}renderApiItemFlowItem(){let e=this._selectedApiItem;return e?s`<calcite-flow-item heading-level=2 .heading=${this.messages.constantsandfunctions} .beforeBack=${this._unselectItem} closable @calciteFlowItemClose=${this._emitClose} selected>${this.hideDocumentationActions?null:s`<calcite-button width=half slot=footer appearance=outline kind=brand scale=s .href=${e.link} target=Help icon-start=information>${this.messages.moreinformation}</calcite-button>`}<calcite-button .width=${this.hideDocumentationActions?"full":"half"} slot=footer appearance=outline kind=brand icon-start=code scale=s @click=${i=>this._emitItemSelectedAndClose(i,e)} ${c(p)}>${this.messages.insert}</calcite-button><calcite-block expanded .heading=${o(e.completion.detail)}><div .innerHTML=${n(e.completion.documentation)??""}></div>${e.examples?s`<div ${c(this._elementToMarkdown)}></div>`:null}</calcite-block></calcite-flow-item>`:null}render(){if(this.closed)return null;let e=(this.apiLibrary??[]).map(t=>this.renderApiCategory(t)),i=e.every(t=>!t);return s`<calcite-flow ${c(this.flowFocusHandler)}><calcite-flow-item heading-level=2 .heading=${this.messages.constantsandfunctions} closable @calciteFlowItemClose=${this._emitClose} .selected=${!this._selectedApiItem}><calcite-input .value=${this._filterValue} icon=magnifying-glass clearable @calciteInputInput=${this._updateFilterValue} class="sticky" scale=m></calcite-input>${this.loading?s`<calcite-loader scale=s type=indeterminate .label=${this.messages.loading??"Loading"}></calcite-loader>`:s`<calcite-list label="arcade api">${i?s`<div class="notice-container">${this.messages.noitems}</div>`:e}</calcite-list>`}</calcite-flow-item>${this.renderApiItemFlowItem()}</calcite-flow>`}};h("arcgis-language-api-panel",r);export{r as ArcgisLanguageApiPanel};
@@ -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.112 */
4
- import{a as m}from"./HZ67L7NJ.js";import{a as f}from"./VII3DH4T.js";import"./TUHLHREY.js";import e from"./WZYVKC6H.js";import"./Z464KXFF.js";import b from"./PCKTIN6B.js";import a from"./PGHGI33U.js";import"./Z2TSI7BE.js";import"./TDGS2O6Y.js";import"./TRANGKBJ.js";import"./73A4C5J2.js";import"./PCPWZFIQ.js";import"./KU67M6PI.js";import"./AER7L4K2.js";import{E as p,F as h,G as g,H as r,K as _,h as c,j as t,n as o,s as d,u as l}from"./GSD5MJRA.js";import{d as s}from"./GI6HWCLC.js";import"./ZYK7M7LM.js";import"./GAFEHBI4.js";export default $arcgis.t(([,a,{b:u}])=>{var b=c`@layer{arcgis-sql-expression-editor{display:flex;flex-direction:column;position:relative;overflow:hidden;border:var(--arcgis-coding-components-border)!important;box-sizing:border-box;background-color:var(--arcgis-coding-components-background-color);height:100%}}`,n=class extends g{constructor(){super(...arguments),this._codeEditorElt=p(),this._disposables=[],this.messages=f(),this._modelId=d(),this._preparing=!1,this.sideActionBarExpanded=!1,this.script="",this.hideSideBar=!1,this.arcgisDiagnosticsChange=o({bubbles:!1}),this.arcgisScriptChange=o({bubbles:!1})}static{this.properties={_activeAction:16,_apiLibrary:16,_editorProfile:16,_preparing:16,sideActionBarExpanded:16,profile:0,script:1,hideSideBar:5}}static{this.shadowRootOptions=l}static{this.styles=[b,m]}async setFocus(){await this._codeEditorElt.value?.setFocus()}async load(){await this._updateEditorProfile().catch(s(this))}willUpdate(i){(i.has("messages")||i.has("profile"))&&this._updateDataModelDeps()}async loaded(){let i=await u();this._disposables.push(i.onDiagnosticsChange(e=>!this._preparing&&this.arcgisDiagnosticsChange.emit(e.diagnostics)))}disconnectedCallback(){for(super.disconnectedCallback();this._disposables.length;)this._disposables.pop()?.dispose()}async _updateDataModelDeps(){await this._updateEditorProfile(),await this._updateApiLibrary()}async _updateEditorProfile(){this._preparing=!0;try{await a.setProfileForModel(this._modelId,this.profile,{locale:this.messages._t9nLocale}),this._editorProfile=a.getEditorProfileForModel(this._modelId)}catch{this._editorProfile=void 0}finally{this._preparing=!1}}_setActiveAction(i){if(this._activeAction===i){this._activeAction=void 0;return}this._activeAction=i}_handleActionClick(i){let e=i.target;this._setActiveAction(e.dataset.panelName)}_insertAsSnippet(i){this._codeEditorElt.value?.insertSnippet(i.detail).catch(s(this))}_insertAsText(i){this._codeEditorElt.value?.insertText(i.detail.replaceAll('"',"'")).catch(s(this))}async _updateApiLibrary(){this._apiLibrary=await a.getApiLibraryForModel(this._modelId)}_onCodeEditorValueChange(i){i.stopPropagation(),this.script=i.detail,this.arcgisScriptChange.emit(i.detail)}_getFeatureSetVariable(){let i,e=a.getEditorProfileForModel(this._modelId);return e?.variables?.length&&e?.variables?.[0]?.type!=="featureSet"?s(this)("Encountered unexpected editor profile"):i=e?.variables?.[0],i}_toggleSideActionBarExpanded(){this.sideActionBarExpanded=!this.sideActionBarExpanded}render(){let i=this._getFeatureSetVariable();return t`<div class="flex-row flex-adjustable"><div class="flex-column flex-adjustable"><arcgis-code-editor language=arcgis-sql-expression .modelId=${this._modelId} .value=${this.script??""} @arcgisValueChange=${this._onCodeEditorValueChange} ${h(this._codeEditorElt)}></arcgis-code-editor></div>${!this.hideSideBar&&t`<arcgis-editor-variables .variable=${i} .closed=${this._activeAction!=="fields"} class=${r(this._activeAction==="fields"&&"code-editor-side-panel flex-panel border-inline-start")} .loading=${this._preparing} .modelId=${this._modelId} @arcgisItemSelected=${this._insertAsText} @arcgisClose=${()=>this._setActiveAction(void 0)} data-panel-name=none></arcgis-editor-variables>`||""}${!this.hideSideBar&&t`<arcgis-language-api-panel class=${r(this._activeAction==="functions"&&"code-editor-side-panel flex-panel border-inline-start")} .closed=${this._activeAction!=="functions"} @arcgisItemSelected=${this._insertAsSnippet} @arcgisClose=${()=>this._setActiveAction(void 0)} .loading=${this._preparing} .apiLibrary=${this._apiLibrary} data-panel-name=none hide-documentation-actions .languageId=${a.languageId}></arcgis-language-api-panel>`||""}${!this.hideSideBar&&t`<calcite-action-bar class="side-action-bar border-inline-start" .expanded=${this.sideActionBarExpanded} position=end @calciteActionBarToggle=${this._toggleSideActionBarExpanded}><calcite-action id=fields-action .text=${this.messages.fields??"Fields"} icon=profile-variables .active=${this._activeAction==="fields"} data-panel-name=fields @click=${this._handleActionClick}></calcite-action>${!this.sideActionBarExpanded&&t`<calcite-tooltip reference-element=fields-action><span>${this.messages.fields??"Fields"}</span></calcite-tooltip>`||""}<calcite-action id=functions-action .text=${this.messages.functions??"Functions"} icon=function .active=${this._activeAction==="functions"} data-panel-name=functions @click=${this._handleActionClick}></calcite-action>${!this.sideActionBarExpanded&&t`<calcite-tooltip reference-element=functions-action><span>${this.messages.functions??"Functions"}</span></calcite-tooltip>`||""}</calcite-action-bar>`||""}</div>`}};_("arcgis-sql-expression-editor",n);return n},a,b,e)
@@ -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.112 */
4
- import c from"./WZYVKC6H.js";import"./Z464KXFF.js";import b from"./PCKTIN6B.js";import a from"./PGHGI33U.js";import"./Z2TSI7BE.js";import"./TDGS2O6Y.js";import"./TRANGKBJ.js";import"./73A4C5J2.js";import"./PCPWZFIQ.js";import"./KU67M6PI.js";import"./AER7L4K2.js";import"./GSD5MJRA.js";import"./GI6HWCLC.js";import"./ZYK7M7LM.js";import"./GAFEHBI4.js";export default $arcgis.t(([,,{a:a,b:b,c:c}])=>{return{getSqlExprDiagnosticService:b,getSqlExprWorker:a,setupMode:c}},a,b,c)
@@ -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.112 */
4
- import e from"./QS3R73AT.js";import{a as z}from"./HZ67L7NJ.js";import d from"./MACRVGYV.js";import c from"./FXYQAPUS.js";import{a as M}from"./VII3DH4T.js";import"./TUHLHREY.js";import a from"./PGHGI33U.js";import"./TDGS2O6Y.js";import"./TRANGKBJ.js";import"./73A4C5J2.js";import"./PCPWZFIQ.js";import"./KU67M6PI.js";import"./AER7L4K2.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"./GSD5MJRA.js";import{a as w,c as R,d as o}from"./GI6HWCLC.js";import{Hl as F,kk as H}from"./ZYK7M7LM.js";import"./GAFEHBI4.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)
@@ -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.112 */
4
- import{a as M}from"./Z2TSI7BE.js";import{a as k}from"./73A4C5J2.js";import{a as m,b as i,c as F,g as L}from"./PCPWZFIQ.js";import"./KU67M6PI.js";import{a as x,d as f}from"./GI6HWCLC.js";import{Gl as T,Kl as _,Nl as p,Sl as g,kk as P}from"./ZYK7M7LM.js";import"./GAFEHBI4.js";P();var W=["<=",">=","==","!=","+","-","*","/","%","++","--","<<",">>",">>>","&","|","^","!","~","&&","||","=","+=","-=","*=","**=","/=","%="],V={wordPattern:/(-?\d*\.\d\w*)|([^`~!#%\^&\*\(\)\-=\+\[\{\]\}\\\|;:'",\.<>\/\?\s]+)/gu,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"',notIn:["string"]},{open:"'",close:"'",notIn:["string","comment"]},{open:"`",close:"`",notIn:["string","comment"]}],autoCloseBefore:";:.,=}])` \n ",folding:{markers:{start:/^\s*\/\/\s*#?region\b/u,end:/^\s*\/\/\s*#?endregion\b/u}},indentationRules:{decreaseIndentPattern:/^((?!.*?\/\*).*\*\/)?\s*[\}\]\)].*$/u,increaseIndentPattern:/^((?!\/\/).)*(\{[^}"'`]*|\([^)"'`]*|\[[^\]"'`]*)$/u}},N={defaultToken:"invalid",tokenPostfix:".arcgis",ignoreCase:!0,keywords:L,operators:W,constants:["true","false","null"],symbols:/[=><!~?:&|+\-*\/\^%]+/u,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/u,digits:/\d+(_+\d+)*/u,octaldigits:/[0-7]+(_+[0-7]+)*/u,binarydigits:/[0-1]+(_+[0-1]+)*/u,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/u,regexpctl:/[(){}\[\]\$\^|\-*+?\.]/u,regexpesc:/\\(?:[bBdDfnrstvwWn0\\\/]|@regexpctl|c[A-Z]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4})/u,tokenizer:{root:[[/[{}]/u,"delimiter.bracket"],{include:"common"}],common:[[/import(?=\s)/u,{token:"keyword",next:"@import"}],[/for(?=\s)/u,{token:"keyword",next:"@forLoopInit"}],[/[a-z_$][\w$]*/u,{cases:{"@constants":"constant","@keywords":"keyword","@default":"identifier"}}],{include:"@whitespace"},[/\/(?=([^\\\/]|\\.)+\/([gimsuy]*)(\s*)(\.|;|\/|,|\)|\]|\}|$))/u,{token:"regexp",bracket:"@open",next:"@regexp"}],[/[()\[\]]/u,"@brackets"],[/[<>](?!@symbols)/u,"@brackets"],[/@symbols/u,{cases:{"@operators":"delimiter","@default":""}}],[/(@digits)[eE]([\-+]?(@digits))?/u,"number"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?/u,"number"],[/0[xX](@hexdigits)/u,"number"],[/0[oO]?(@octaldigits)/u,"number"],[/0[bB](@binarydigits)/u,"number"],[/(@digits)/u,"number"],[/[;,.]/u,"delimiter"],[/"([^"\\]|\\.)*$/u,"string.invalid"],[/'([^'\\]|\\.)*$/u,"string.invalid"],[/"/u,"string","@string_double"],[/'/u,"string","@string_single"],[/`/u,"string","@string_backtick"]],import:[[/import(?=\s)/u,{token:"keyword"}],{include:"@whitespace"},[/[a-z_$][\w$]*/u,"identifier"],{include:"@whitespace"},[/from/u,{token:"keyword",next:"@popall"}]],forLoopInit:[{include:"@whitespace"},[/\(/u,{token:"@brackets",next:"@forLoopVar"}],[/.*/u,"","@pop"]],forLoopVar:[{include:"@whitespace"},[/var(?=\s)/u,"keyword","@forLoopVarName"],[/[a-z_$][\w$]*/u,"identifier","@forLoopCheckInOf"],[/\)/u,{token:"@brackets",next:"@popall"}]],forLoopVarName:[{include:"@whitespace"},[/[a-z_$][\w$]*/u,"identifier","@forLoopCheckInOf"],[/\)/u,{token:"@brackets",next:"@popall"}]],forLoopCheckInOf:[{include:"@whitespace"},[/in(?=\s)/u,"keyword","@popall"],[/of(?=\s)/u,"keyword","@popall"],[/[a-z_$][\w$]*/u,"identifier"],[/\)/u,{token:"@brackets",next:"@popall"}]],whitespace:[[/[ \t\r\n]+/u,""],[/\/\*/u,"comment","@comment"],[/\/\/.*$/u,"comment"]],comment:[[/[^\/*]+/u,"comment"],[/\*\//u,"comment","@pop"],[/[\/*]/u,"comment"]],regexp:[[/(\{)(\d+(?:,\d*)?)(\})/u,["regexp.escape.control","regexp.escape.control","regexp.escape.control"]],[/(\[)(\^?)(?=(?:[^\]\\\/]|\\.)+)/u,["regexp.escape.control",{token:"regexp.escape.control",next:"@regexrange"}]],[/(\()(\?:|\?=|\?!)/u,["regexp.escape.control","regexp.escape.control"]],[/[()]/u,"regexp.escape.control"],[/@regexpctl/u,"regexp.escape.control"],[/[^\\\/]/u,"regexp"],[/@regexpesc/u,"regexp.escape"],[/\\\./u,"regexp.invalid"],[/(\/)([gimsuy]*)/u,[{token:"regexp",bracket:"@close",next:"@pop"},"keyword.other"]]],regexrange:[[/-/u,"regexp.escape.control"],[/\^/u,"regexp.invalid"],[/@regexpesc/u,"regexp.escape"],[/[^\]]/u,"regexp"],[/\]/u,{token:"regexp.escape.control",next:"@pop",bracket:"@close"}]],string_double:[[/[^\\"]+/u,"string"],[/@escapes/u,"string.escape"],[/\\./u,"string.escape.invalid"],[/"/u,"string","@pop"]],string_single:[[/[^\\']+/u,"string"],[/@escapes/u,"string.escape"],[/\\./u,"string.escape.invalid"],[/'/u,"string","@pop"]],string_backtick:[[/\$\{/u,{token:"delimiter.bracket",next:"@bracketCounting"}],[/[^\\`$]+/u,"string"],[/@escapes/u,"string.escape"],[/\\./u,"string.escape.invalid"],[/`/u,"string","@pop"]],bracketCounting:[[/\{/u,"delimiter.bracket","@bracketCounting"],[/\}/u,"delimiter.bracket","@pop"],{include:"common"}]}},C=class{constructor(e,n,{defaults:a,diagnosticsService:d}){this._languageId=e,this._worker=n,this._disposables=[],this._modelListeners=new Map,this._diagnosticsService=d,this._defaults=a,k().then(c=>{let u=s=>{let r=s.getLanguageId();if(r!==this._languageId)return;let o=M(()=>{this._doValidate(s,r).catch($=>{throw $})}),A=s.onDidChangeContent(o),D=s.onDidChangeAttached(o);this._modelListeners.set(s.uri.toString(),[A,D]),this._doValidate(s,r).catch(f("DiagnosticsAdapter"))},l=s=>{let r=s.uri.toString();c.setModelMarkers(s,this._languageId,[]);let o=this._modelListeners.get(r);if(o){for(;o.length;)o.pop()?.dispose();this._modelListeners.delete(r)}};this._disposables.push(c.onDidCreateModel(u)),this._disposables.push(c.onWillDisposeModel(s=>{l(s)})),this._disposables.push(c.onDidChangeModelLanguage(s=>{l(s.model),u(s.model)})),this._disposables.push(a.onDidChange(()=>{c.getModels().forEach(s=>{s.getLanguageId()===this._languageId&&(l(s),u(s))})})),this._disposables.push(a.onModelContextDidChange(s=>{c.getModels().forEach(r=>{r.getLanguageId()===this._languageId&&r.uri.toString()===s&&this._doValidate(r,this._languageId).catch(f("DiagnosticsAdapter"))})})),this._disposables.push({dispose:()=>{this._modelListeners.forEach(s=>s.forEach(r=>r.dispose())),this._modelListeners.clear()}}),c.getModels().forEach(u)})}dispose(){this._disposables.forEach(e=>e.dispose()),this._disposables=[]}async _doValidate(e,n){if(e.isAttachedToEditor())try{let a=await k(),d=await this._worker(e.uri),c=this._defaults.getApiContextForModel(e.uri),u=await d.doValidation(e.uri.toString(),c),l=u.map(s=>K(e.uri,s));this._diagnosticsService.fireDiagnosticsChange(e.uri,u),a.setModelMarkers(e,n,l)}catch(a){f("DiagnosticsAdapter")(a)}}};function R(t){switch(t){case m.Error:return p.Error;case m.Warning:return p.Warning;case m.Information:return p.Info;case m.Hint:return p.Hint;default:return p.Info}}function K(t,e){return{severity:R(e.severity),startLineNumber:e.range.start.line+1,startColumn:e.range.start.character+1,endLineNumber:e.range.end.line+1,endColumn:e.range.end.character+1,message:e.message}}function z(t){return{character:t.column-1,line:t.lineNumber-1}}function h(t){return new _(t.start.line+1,t.start.character+1,t.end.line+1,t.end.character+1)}function O(t){return{range:h(t.range),text:t.newText}}function U(t){return typeof t.insert<"u"&&typeof t.replace<"u"}function B(t){let e=g.CompletionItemKind;switch(t){case i.Text:return e.Text;case i.Method:return e.Method;case i.Function:return e.Function;case i.Constructor:return e.Constructor;case i.Field:return e.Field;case i.Variable:return e.Variable;case i.Class:return e.Class;case i.Interface:return e.Interface;case i.Module:return e.Module;case i.Property:return e.Property;case i.Unit:return e.Unit;case i.Value:return e.Value;case i.Enum:return e.Enum;case i.Keyword:return e.Keyword;case i.Snippet:return e.Snippet;case i.Color:return e.Color;case i.File:return e.File;case i.Reference:return e.Reference;case i.Folder:return e.Folder;case i.EnumMember:return e.EnumMember;case i.Constant:return e.Constant;case i.Struct:return e.Struct;case i.Event:return e.Event;case i.Operator:return e.Operator;case i.TypeParameter:return e.TypeParameter;default:return e.Property}}var y=class{constructor(e,n){this._worker=e,this._defaults=n,this.triggerCharacters=[".","("]}async provideCompletionItems(e,n){let a=await this._worker(e.uri),d=this._defaults.getApiContextForModel(e.uri),c=await a.doComplete(e.uri.toString(),z(n),d),u=e.getWordUntilPosition(n),l=new _(n.lineNumber,u.startColumn,n.lineNumber,u.endColumn),s=c.items.map(r=>{let o={label:r.label,insertText:r.insertText||r.label,sortText:r.sortText,filterText:r.filterText,detail:r.detail,range:l,kind:B(r.kind)};return r.textEdit&&(U(r.textEdit)?o.range={insert:h(r.textEdit.insert),replace:h(r.textEdit.replace)}:o.range=h(r.textEdit.range),o.insertText=r.textEdit.newText),r.additionalTextEdits&&(o.additionalTextEdits=r.additionalTextEdits.map(O)),r.insertTextFormat===F.Snippet&&(o.insertTextRules=g.CompletionItemInsertTextRule.InsertAsSnippet),r.documentation&&(typeof r.documentation=="string"?o.documentation=r.documentation:o.documentation={supportThemeIcons:!1,value:r.documentation.value,supportHtml:!0}),o});return{incomplete:c.isIncomplete,suggestions:s}}},I=class{constructor(e,n){this._worker=e,this._defaults=n}async provideDocumentFormattingEdits(e){let n=await this._worker(e.uri),a=this._defaults.getApiContextForModel(e.uri.toString());return(await n.doFormat(e.uri.toString(),a)).map(d=>({range:h(d.range),text:d.newText}))}},b=new x,w=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,b=new x),this._client=null}static async waitForWorker(){return await b.promise}async _getClientProxy(){let e=await k();if(!this._client){let{languageId:n}=this._defaults;this._worker=e.createWebWorker({moduleId:"ArcadeWorker",label:n,createData:{languageId:n},host:this._defaults.workerHost}),b.resolve(this._worker),this._client=this._worker.getProxy()}return await this._client}async getLanguageServiceWorker(...e){let n=await this._getClientProxy();return await this._worker?.withSyncedResources(e),n}},v;async function re(...t){return await w.waitForWorker(),await new Promise((e,n)=>{if(!v){n(new Error("Arcade not registered!"));return}e(v(...t))})}var E=class{constructor(){this._onDiagnosticsChange=new T}get onDiagnosticsChange(){return this._onDiagnosticsChange.event}fireDiagnosticsChange(e,n){this._onDiagnosticsChange.fire({uri:e,diagnostics:n})}},S=new E;function ne(){return S}function se(t){let e=new w(t),n=async(...a)=>await e.getLanguageServiceWorker(...a);v=n,g.setMonarchTokensProvider(t.languageId,N),g.setLanguageConfiguration(t.languageId,V),g.registerCompletionItemProvider(t.languageId,new y(n,t)),g.registerDocumentFormattingEditProvider(t.languageId,new I(n,t)),new C(t.languageId,n,{defaults:t,diagnosticsService:S})}export{ne as getArcadeDiagnosticService,re as getArcadeWorker,se as setupMode};
@@ -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.112 */
4
- import{A as h,B as A,C as D,D as y,k as P,w as k,x as w,y as V,z as m}from"./GSD5MJRA.js";var b=(s,f,c)=>{let p=new Map;for(let e=f;e<=c;e++)p.set(s[e],e);return p},I=w(class extends V{constructor(s){if(super(s),s.type!==k.CHILD)throw Error("repeat() can only be used in text expressions")}dt(s,f,c){let p;c===void 0?c=f:f!==void 0&&(p=f);let e=[],n=[],o=0;for(let a of s)e[o]=p?p(a,o):o,n[o]=c(a,o),o++;return{values:n,keys:e}}render(s,f,c){return this.dt(s,f,c).values}update(s,[f,c,p]){let e=D(s),{values:n,keys:o}=this.dt(f,c,p);if(!Array.isArray(e))return this.ut=o,n;let a=this.ut??=[],u=[],v,g,t=0,l=e.length-1,r=0,i=n.length-1;for(;t<=l&&r<=i;)if(e[t]===null)t++;else if(e[l]===null)l--;else if(a[t]===o[r])u[r]=h(e[t],n[r]),t++,r++;else if(a[l]===o[i])u[i]=h(e[l],n[i]),l--,i--;else if(a[t]===o[i])u[i]=h(e[t],n[i]),m(s,u[i+1],e[t]),t++,i--;else if(a[l]===o[r])u[r]=h(e[l],n[r]),m(s,e[t],e[l]),l--,r++;else if(v===void 0&&(v=b(o,r,i),g=b(a,t,l)),v.has(a[t]))if(v.has(a[l])){let d=g.get(o[r]),x=d!==void 0?e[d]:null;if(x===null){let C=m(s,e[t]);h(C,n[r]),u[r]=C}else u[r]=h(x,n[r]),m(s,e[t],x),e[d]=null;r++}else y(e[l]),l--;else y(e[t]),t++;for(;r<=i;){let d=m(s,u[i+1]);h(d,n[r]),u[r++]=d}for(;t<=l;){let d=e[t++];d!==null&&y(d)}return this.ut=o,A(s,u),P}});export{I as a};
@@ -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.112 */
4
- import{h as o}from"./GSD5MJRA.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};
@@ -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.112 */
4
- import k from"./KQP2PJVU.js";import j from"./QS3R73AT.js";import e from"./MACRVGYV.js";import"./KGCVH6T7.js";import{a as _}from"./TUHLHREY.js";import"./Z464KXFF.js";import b from"./PCKTIN6B.js";import a from"./PGHGI33U.js";import"./TDGS2O6Y.js";import"./TRANGKBJ.js";import{a as f}from"./73A4C5J2.js";import"./PCPWZFIQ.js";import"./KU67M6PI.js";import{b as g,c as p}from"./AER7L4K2.js";import{G as l,K as u,L as m,h as d,n as i,s as c,u as h}from"./GSD5MJRA.js";import"./GI6HWCLC.js";import{Hl as s,Il as o,Kl as I,Pl as n}from"./ZYK7M7LM.js";import"./GAFEHBI4.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)
@@ -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.112 */
4
- import c from"./QS3R73AT.js";import b from"./MACRVGYV.js";import{a as u}from"./KGCVH6T7.js";import{a as m}from"./Z464KXFF.js";import a from"./PCKTIN6B.js";import{a as t}from"./73A4C5J2.js";import{Pl as d,Sl as s,kk as k}from"./ZYK7M7LM.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)