@arcgis/coding-components 4.32.0-next.83 → 4.32.0-next.85

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 (79) hide show
  1. package/dist/arcgis-coding-components/{EOMSLJPL.js → 22HCDU3J.js} +1 -1
  2. package/dist/arcgis-coding-components/{ORNMMSBL.js → 2JCVLTGE.js} +2 -2
  3. package/dist/arcgis-coding-components/{LZXHELU4.js → 2WF7EDB6.js} +2 -2
  4. package/dist/arcgis-coding-components/{4VB23NUX.js → 3P3LPZXG.js} +2 -2
  5. package/dist/arcgis-coding-components/{Z6AJHTW4.js → 47OYLO7S.js} +2 -2
  6. package/dist/arcgis-coding-components/{FBVEF5NR.js → 5H27BQS4.js} +2 -2
  7. package/dist/arcgis-coding-components/{PRR5KOS4.js → 5U52XBHT.js} +2 -2
  8. package/dist/arcgis-coding-components/{WRMFW3PU.js → 6T2C3ZJS.js} +2 -2
  9. package/dist/arcgis-coding-components/{ESXQSD7A.js → BFGXKNTD.js} +3 -3
  10. package/dist/arcgis-coding-components/{V6XSS2WT.js → C4EIUFD4.js} +1 -1
  11. package/dist/arcgis-coding-components/{7NSF3PXP.js → CIC2MBYO.js} +2 -2
  12. package/dist/arcgis-coding-components/{WG4LIQ47.js → CPRH4MPV.js} +2 -2
  13. package/dist/arcgis-coding-components/{7252MA7S.js → EC76AJSP.js} +2 -2
  14. package/dist/arcgis-coding-components/{DC4CHF7W.js → EHBDOUTY.js} +2 -2
  15. package/dist/arcgis-coding-components/{VB6ORQZM.js → HBRPFDQK.js} +2 -2
  16. package/dist/arcgis-coding-components/{7ACPV5V2.js → IDVUO4XM.js} +2 -2
  17. package/dist/arcgis-coding-components/{SVC6J2DE.js → K6YNBPJU.js} +2 -2
  18. package/dist/arcgis-coding-components/{LWVJU2TB.js → L2MTURYK.js} +2 -2
  19. package/dist/arcgis-coding-components/{UDC3ATPR.js → LAMJDK53.js} +2 -2
  20. package/dist/arcgis-coding-components/LHZBG4RV.js +12 -0
  21. package/dist/arcgis-coding-components/{P6HD6APH.js → LKT7BADP.js} +1 -1
  22. package/dist/arcgis-coding-components/{77MY6AMZ.js → N7QVVK5X.js} +2 -2
  23. package/dist/arcgis-coding-components/{WGWENSFB.js → OSZTQ4K2.js} +2 -2
  24. package/dist/arcgis-coding-components/{C6XW2MT3.js → PDBJIWAH.js} +2 -2
  25. package/dist/arcgis-coding-components/PTRPND27.js +4 -0
  26. package/dist/arcgis-coding-components/{W3GFC524.js → R7TFWFWR.js} +2 -2
  27. package/dist/arcgis-coding-components/{KRSQQ5UL.js → RJQTOKGP.js} +2 -2
  28. package/dist/arcgis-coding-components/{V3N4TSTX.js → RWK4UVJJ.js} +2 -2
  29. package/dist/arcgis-coding-components/{TNFDDZLL.js → TSPXGECV.js} +2 -2
  30. package/dist/arcgis-coding-components/{26D2TEEA.js → UM4BQLXE.js} +1 -1
  31. package/dist/arcgis-coding-components/{BUX5A6M5.js → UUNHT6KS.js} +2 -2
  32. package/dist/arcgis-coding-components/{5QRWOYYV.js → WUK44TUN.js} +2 -2
  33. package/dist/arcgis-coding-components/XGQTZBOU.js +4 -0
  34. package/dist/arcgis-coding-components/{QR6WVNQI.js → Y3CXHFPS.js} +2 -2
  35. package/dist/arcgis-coding-components/{JTRK76CP.js → ZHVG5D5W.js} +2 -2
  36. package/dist/arcgis-coding-components/arcgis-coding-components.esm.js +2 -2
  37. package/dist/arcgis-coding-components/assets/code-editor/sql-expr.worker.js +29 -29
  38. package/dist/chunks/arcade-defaults.js +1 -1
  39. package/dist/chunks/arcade-executor.js +1 -1
  40. package/dist/chunks/arcade-mode.js +1 -1
  41. package/dist/chunks/arcade-service-accessors.js +1 -1
  42. package/dist/chunks/fields.js +1 -1
  43. package/dist/chunks/language-defaults-base.js +9 -9
  44. package/dist/chunks/markdown.js +1 -1
  45. package/dist/chunks/monaco-importer.js +1 -1
  46. package/dist/chunks/runtime.js +1 -1
  47. package/dist/chunks/sql-expr-defaults.js +1 -1
  48. package/dist/chunks/sql-expr-mode.js +1 -1
  49. package/dist/chunks/useT9n.js +1 -1
  50. package/dist/components/arcgis-arcade-editor/customElement.d.ts +14 -3
  51. package/dist/components/arcgis-arcade-editor/customElement.js +49 -30
  52. package/dist/components/arcgis-arcade-editor/index.d.ts +2 -0
  53. package/dist/components/arcgis-arcade-editor/index.js +2 -0
  54. package/dist/components/arcgis-arcade-results/customElement.d.ts +1 -1
  55. package/dist/components/arcgis-arcade-results/customElement.js +2 -2
  56. package/dist/components/arcgis-arcade-suggestions/customElement.js +1 -1
  57. package/dist/components/arcgis-code-editor/customElement.js +1 -1
  58. package/dist/components/arcgis-editor-variables/customElement.js +1 -1
  59. package/dist/components/arcgis-language-api-panel/customElement.js +1 -1
  60. package/dist/components/arcgis-sql-expression-editor/customElement.js +1 -1
  61. package/dist/components/arcgis-sql-expression-fields/customElement.js +3 -3
  62. package/dist/docs/api.json +30 -46
  63. package/dist/docs/docs.json +39 -25
  64. package/dist/docs/vscode.html-custom-data.json +0 -18
  65. package/dist/docs/web-types.json +7 -15
  66. package/dist/index.js +1 -1
  67. package/dist/loader.js +2 -2
  68. package/dist/types/lumina.d.ts +1 -1
  69. package/dist/types/preact.d.ts +1 -1
  70. package/dist/types/react.d.ts +8 -7
  71. package/dist/types/stencil.d.ts +1 -1
  72. package/dist/utils/arcade-executor.d.ts +1 -1
  73. package/dist/utils/custom-panel.d.ts +23 -0
  74. package/dist/utils/profile/editor-profile.d.ts +3 -3
  75. package/dist/utils/profile/types.d.ts +2 -2
  76. package/package.json +7 -7
  77. package/dist/arcgis-coding-components/4HUHKO2F.js +0 -12
  78. package/dist/arcgis-coding-components/5KLMJERZ.js +0 -4
  79. package/dist/arcgis-coding-components/DITB2IHG.js +0 -4
@@ -1,8 +1,8 @@
1
1
  {
2
- "timestamp": "2025-01-15T04:57:21",
2
+ "timestamp": "2025-01-17T13:56:05",
3
3
  "compiler": {
4
4
  "name": "@arcgis/lumina-compiler",
5
- "version": "4.32.0-next.83",
5
+ "version": "4.32.0-next.85",
6
6
  "typescriptVersion": "5.6.3"
7
7
  },
8
8
  "schemaVersion": "1.0.0",
@@ -55,6 +55,28 @@
55
55
  }
56
56
  ]
57
57
  },
58
+ {
59
+ "kind": "field",
60
+ "name": "customPanels",
61
+ "description": "Custom panels to be displayed in the side panel.\nWill be placed below the default panels but above the help panel.",
62
+ "type": {
63
+ "text": "(Array<{\n id: string;\n name: string;\n icon: string;\n description?: string | undefined;\n useFlows?: boolean | undefined;\n renderer: ({ closePanel, insertText, }: {\n closePanel: (e: Event) => void;\n insertText: (text: string) => void;\n }) => JsxNode;\n}>)",
64
+ "references": [
65
+ {
66
+ "name": "Array",
67
+ "package": "typescript",
68
+ "module": "lib/lib.es5.d.ts",
69
+ "start": 1,
70
+ "end": 6
71
+ }
72
+ ]
73
+ },
74
+ "docsTags": [
75
+ {
76
+ "name": "internal"
77
+ }
78
+ ]
79
+ },
58
80
  {
59
81
  "kind": "field",
60
82
  "name": "editorOptions",
@@ -258,28 +280,17 @@
258
280
  "name": "openedSidePanel",
259
281
  "description": "The name of the opened side panel. 'none' means 'no panel opened'.",
260
282
  "type": {
261
- "text": "\"api\" | \"none\" | \"suggestions\" | \"variables\"",
262
- "values": [
263
- {
264
- "value": "api",
265
- "type": "string"
266
- },
267
- {
268
- "value": "none",
269
- "type": "string"
270
- },
271
- {
272
- "value": "suggestions",
273
- "type": "string"
274
- },
283
+ "text": "T extends {\n customPanels: Array<ICustomPanel>;\n} ? \"none\" | \"variables\" | \"suggestions\" | \"api\" : string",
284
+ "references": [
275
285
  {
276
- "value": "variables",
277
- "type": "string"
286
+ "name": "T",
287
+ "module": "dist/components/arcgis-arcade-editor/customElement.d.ts",
288
+ "start": 0,
289
+ "end": 1
278
290
  }
279
291
  ]
280
292
  },
281
293
  "default": "\"none\"",
282
- "attribute": "opened-side-panel",
283
294
  "reflects": true
284
295
  },
285
296
  {
@@ -478,33 +489,6 @@
478
489
  "default": "false",
479
490
  "fieldName": "hideSideBar"
480
491
  },
481
- {
482
- "name": "opened-side-panel",
483
- "description": "The name of the opened side panel. 'none' means 'no panel opened'.",
484
- "type": {
485
- "text": "\"api\" | \"none\" | \"suggestions\" | \"variables\"",
486
- "values": [
487
- {
488
- "value": "api",
489
- "type": "string"
490
- },
491
- {
492
- "value": "none",
493
- "type": "string"
494
- },
495
- {
496
- "value": "suggestions",
497
- "type": "string"
498
- },
499
- {
500
- "value": "variables",
501
- "type": "string"
502
- }
503
- ]
504
- },
505
- "default": "\"none\"",
506
- "fieldName": "openedSidePanel"
507
- },
508
492
  {
509
493
  "name": "script",
510
494
  "description": "The arcade script. Use this property to define or update the script.",
@@ -1,8 +1,8 @@
1
1
  {
2
- "timestamp": "2025-01-15T04:57:21",
2
+ "timestamp": "2025-01-17T13:56:05",
3
3
  "compiler": {
4
4
  "name": "@arcgis/lumina-compiler",
5
- "version": "4.32.0-next.83",
5
+ "version": "4.32.0-next.85",
6
6
  "typescriptVersion": "5.6.3"
7
7
  },
8
8
  "components": [
@@ -24,6 +24,32 @@
24
24
  "dependencies": [],
25
25
  "dependencyGraph": {},
26
26
  "props": [
27
+ {
28
+ "name": "customPanels",
29
+ "type": "(Array<{\n id: string;\n name: string;\n icon: string;\n description?: string | undefined;\n useFlows?: boolean | undefined;\n renderer: ({ closePanel, insertText, }: {\n closePanel: (e: Event) => void;\n insertText: (text: string) => void;\n }) => JsxNode;\n}>)",
30
+ "complexType": {
31
+ "original": "(Array<{\n id: string;\n name: string;\n icon: string;\n description?: string | undefined;\n useFlows?: boolean | undefined;\n renderer: ({ closePanel, insertText, }: {\n closePanel: (e: Event) => void;\n insertText: (text: string) => void;\n }) => JsxNode;\n}>)",
32
+ "resolved": "(Array<{\n id: string;\n name: string;\n icon: string;\n description?: string | undefined;\n useFlows?: boolean | undefined;\n renderer: ({ closePanel, insertText, }: {\n closePanel: (e: Event) => void;\n insertText: (text: string) => void;\n }) => JsxNode;\n}>)",
33
+ "references": {
34
+ "Array": {
35
+ "location": "import",
36
+ "path": "typescript/lib/lib.es5.d.ts",
37
+ "id": "notImplemented"
38
+ }
39
+ }
40
+ },
41
+ "mutable": true,
42
+ "reflectToAttr": false,
43
+ "docs": "Custom panels to be displayed in the side panel.\nWill be placed below the default panels but above the help panel.",
44
+ "docsTags": [
45
+ {
46
+ "name": "internal"
47
+ }
48
+ ],
49
+ "values": [],
50
+ "optional": true,
51
+ "required": false
52
+ },
27
53
  {
28
54
  "name": "editorOptions",
29
55
  "type": "(IEditorOptions & IGlobalEditorOptions)",
@@ -97,36 +123,24 @@
97
123
  },
98
124
  {
99
125
  "name": "openedSidePanel",
100
- "type": "\"api\" | \"none\" | \"suggestions\" | \"variables\"",
126
+ "type": "T extends {\n customPanels: Array<ICustomPanel>;\n} ? \"none\" | \"variables\" | \"suggestions\" | \"api\" : string",
101
127
  "complexType": {
102
- "original": "\"api\" | \"none\" | \"suggestions\" | \"variables\"",
103
- "resolved": "\"api\" | \"none\" | \"suggestions\" | \"variables\"",
104
- "references": {}
128
+ "original": "T extends {\n customPanels: Array<ICustomPanel>;\n} ? \"none\" | \"variables\" | \"suggestions\" | \"api\" : string",
129
+ "resolved": "T extends {\n customPanels: Array<ICustomPanel>;\n} ? \"none\" | \"variables\" | \"suggestions\" | \"api\" : string",
130
+ "references": {
131
+ "T": {
132
+ "location": "local",
133
+ "path": "dist/components/arcgis-arcade-editor/customElement.d.ts",
134
+ "id": "notImplemented"
135
+ }
136
+ }
105
137
  },
106
138
  "mutable": true,
107
- "attr": "opened-side-panel",
108
139
  "reflectToAttr": true,
109
140
  "docs": "The name of the opened side panel. 'none' means 'no panel opened'.",
110
141
  "docsTags": [],
111
142
  "default": "\"none\"",
112
- "values": [
113
- {
114
- "value": "api",
115
- "type": "string"
116
- },
117
- {
118
- "value": "none",
119
- "type": "string"
120
- },
121
- {
122
- "value": "suggestions",
123
- "type": "string"
124
- },
125
- {
126
- "value": "variables",
127
- "type": "string"
128
- }
129
- ],
143
+ "values": [],
130
144
  "optional": true,
131
145
  "required": false
132
146
  },
@@ -16,24 +16,6 @@
16
16
  "description": "If true, it will hide the side actions bar. The editor will be in a minimalistic UX.",
17
17
  "values": []
18
18
  },
19
- {
20
- "name": "opened-side-panel",
21
- "description": "The name of the opened side panel. 'none' means 'no panel opened'.",
22
- "values": [
23
- {
24
- "name": "api"
25
- },
26
- {
27
- "name": "none"
28
- },
29
- {
30
- "name": "suggestions"
31
- },
32
- {
33
- "name": "variables"
34
- }
35
- ]
36
- },
37
19
  {
38
20
  "name": "script",
39
21
  "description": "The arcade script. Use this property to define or update the script.",
@@ -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": "4.32.0-next.83",
4
+ "version": "4.32.0-next.85",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -26,19 +26,6 @@
26
26
  "type": "boolean"
27
27
  }
28
28
  },
29
- {
30
- "name": "opened-side-panel",
31
- "description": "The name of the opened side panel. 'none' means 'no panel opened'.",
32
- "default": "\"none\"",
33
- "value": {
34
- "type": [
35
- "\"api\"",
36
- "\"none\"",
37
- "\"suggestions\"",
38
- "\"variables\""
39
- ]
40
- }
41
- },
42
29
  {
43
30
  "name": "script",
44
31
  "description": "The arcade script. Use this property to define or update the script.",
@@ -70,6 +57,11 @@
70
57
  ],
71
58
  "js": {
72
59
  "properties": [
60
+ {
61
+ "name": "customPanels",
62
+ "description": "Custom panels to be displayed in the side panel.\nWill be placed below the default panels but above the help panel.",
63
+ "type": "(Array<{\n id: string;\n name: string;\n icon: string;\n description?: string | undefined;\n useFlows?: boolean | undefined;\n renderer: ({ closePanel, insertText, }: {\n closePanel: (e: Event) => void;\n insertText: (text: string) => void;\n }) => JsxNode;\n}>)"
64
+ },
73
65
  {
74
66
  "name": "editorOptions",
75
67
  "description": "Options to update on the editor.\nFor example:\n```json\n{\n \"fontSize\": 18\n}\n```\n\nTo get the full list of available options, see the Monaco Editor options documentation for more details.",
@@ -88,7 +80,7 @@
88
80
  {
89
81
  "name": "openedSidePanel",
90
82
  "description": "The name of the opened side panel. 'none' means 'no panel opened'.",
91
- "type": "\"api\" | \"none\" | \"suggestions\" | \"variables\""
83
+ "type": "T extends {\n customPanels: Array<ICustomPanel>;\n} ? \"none\" | \"variables\" | \"suggestions\" | \"api\" : string"
92
84
  },
93
85
  {
94
86
  "name": "profile",
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/4.32/esri/copyright.txt for details.
6
- v4.32.0-next.83 */
6
+ v4.32.0-next.85 */
7
7
  const a = s, r = t;
8
8
  export {
9
9
  c as arcade,
package/dist/loader.js CHANGED
@@ -2,9 +2,9 @@ import { r as e } from "./chunks/runtime.js";
2
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/4.32/esri/copyright.txt for details.
5
- v4.32.0-next.83 */
5
+ v4.32.0-next.85 */
6
6
  const o = i(e, {
7
- "arcgis-arcade-editor": [() => import("./components/arcgis-arcade-editor/customElement.js"), "editorInstance:,editorOptions:,hideDocumentationActions,hideSideBar,openedSidePanel,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getEditorInstance,getScript,getTestResult,setFocus"],
7
+ "arcgis-arcade-editor": [() => import("./components/arcgis-arcade-editor/customElement.js"), "customPanels:,editorInstance:,editorOptions:,hideDocumentationActions,hideSideBar,openedSidePanel:,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getEditorInstance,getScript,getTestResult,setFocus"],
8
8
  "arcgis-arcade-results": [() => import("./components/arcgis-arcade-results/customElement.js"), "consoleLogs:,loading,openedResultPanel,result:"],
9
9
  "arcgis-arcade-suggestions": [() => import("./components/arcgis-arcade-suggestions/customElement.js"), "suggestions:"],
10
10
  "arcgis-code-editor": [() => import("./components/arcgis-code-editor/customElement.js"), "editorInstance:,editorOptions:,language,modelId,value;getEditorInstance,getValue,insertSnippet,insertText,setFocus,setValue"],
@@ -4,7 +4,7 @@ import type { ArcgisCodeEditor } from "../components/arcgis-code-editor";
4
4
  import type { ArcgisSqlExpressionEditor } from "../components/arcgis-sql-expression-editor";
5
5
  import type { h, EventHandler } from "@arcgis/lumina";
6
6
 
7
- interface LuminaArcgisArcadeEditor extends Partial<Pick<ArcgisArcadeEditor, 'editorOptions' | 'hideDocumentationActions' | 'hideSideBar' | 'openedSidePanel' | 'profile' | 'script' | 'sideActionBarExpanded' | 'snippets' | 'suggestions' | 'testData'>>, h.JSX.HTMLAttributes<HTMLArcgisArcadeEditorElement> {
7
+ interface LuminaArcgisArcadeEditor extends Partial<Pick<ArcgisArcadeEditor, 'customPanels' | 'editorOptions' | 'hideDocumentationActions' | 'hideSideBar' | 'openedSidePanel' | 'profile' | 'script' | 'sideActionBarExpanded' | 'snippets' | 'suggestions' | 'testData'>>, h.JSX.HTMLAttributes<HTMLArcgisArcadeEditorElement> {
8
8
  onarcgisDiagnosticsChange?: EventHandler<HTMLArcgisArcadeEditorElement["arcgisDiagnosticsChange"]>;
9
9
  onarcgisScriptChange?: EventHandler<HTMLArcgisArcadeEditorElement["arcgisScriptChange"]>;
10
10
  }
@@ -5,7 +5,7 @@ import type { ArcgisSqlExpressionEditor } from "../components/arcgis-sql-express
5
5
  import { JSX as PreactJsx } from "preact";
6
6
  import type { EventHandler } from "@arcgis/lumina";
7
7
 
8
- interface PreactArcgisArcadeEditor extends Partial<Pick<ArcgisArcadeEditor, 'editorOptions' | 'hideDocumentationActions' | 'hideSideBar' | 'openedSidePanel' | 'profile' | 'script' | 'sideActionBarExpanded' | 'snippets' | 'suggestions' | 'testData'>>, PreactJsx.HTMLAttributes<HTMLArcgisArcadeEditorElement> {
8
+ interface PreactArcgisArcadeEditor extends Partial<Pick<ArcgisArcadeEditor, 'customPanels' | 'editorOptions' | 'hideDocumentationActions' | 'hideSideBar' | 'openedSidePanel' | 'profile' | 'script' | 'sideActionBarExpanded' | 'snippets' | 'suggestions' | 'testData'>>, PreactJsx.HTMLAttributes<HTMLArcgisArcadeEditorElement> {
9
9
  onarcgisDiagnosticsChange?: EventHandler<HTMLArcgisArcadeEditorElement["arcgisDiagnosticsChange"]>;
10
10
  onarcgisScriptChange?: EventHandler<HTMLArcgisArcadeEditorElement["arcgisScriptChange"]>;
11
11
  }
@@ -2,20 +2,21 @@
2
2
  import type { ArcgisArcadeEditor } from "../components/arcgis-arcade-editor";
3
3
  import type { ArcgisCodeEditor } from "../components/arcgis-code-editor";
4
4
  import type { ArcgisSqlExpressionEditor } from "../components/arcgis-sql-expression-editor";
5
- import type { Ref, HTMLProps, EventHandler, SyntheticEvent } from 'react';
5
+ import type { HTMLProps } from 'react';
6
+ import type { EventHandler } from "@arcgis/lumina";
6
7
 
7
- interface ReactArcgisArcadeEditor extends Partial<Pick<ArcgisArcadeEditor, 'editorOptions' | 'hideDocumentationActions' | 'hideSideBar' | 'openedSidePanel' | 'profile' | 'script' | 'sideActionBarExpanded' | 'snippets' | 'suggestions' | 'testData'>>, HTMLProps<HTMLArcgisArcadeEditorElement> {
8
- onarcgisDiagnosticsChange?: EventHandler<SyntheticEvent<HTMLArcgisArcadeEditorElement, HTMLArcgisArcadeEditorElement["arcgisDiagnosticsChange"]>>;
9
- onarcgisScriptChange?: EventHandler<SyntheticEvent<HTMLArcgisArcadeEditorElement, HTMLArcgisArcadeEditorElement["arcgisScriptChange"]>>;
8
+ interface ReactArcgisArcadeEditor extends Partial<Pick<ArcgisArcadeEditor, 'customPanels' | 'editorOptions' | 'hideDocumentationActions' | 'hideSideBar' | 'openedSidePanel' | 'profile' | 'script' | 'sideActionBarExpanded' | 'snippets' | 'suggestions' | 'testData'>>, HTMLProps<HTMLArcgisArcadeEditorElement> {
9
+ onarcgisDiagnosticsChange?: EventHandler<HTMLArcgisArcadeEditorElement["arcgisDiagnosticsChange"]>;
10
+ onarcgisScriptChange?: EventHandler<HTMLArcgisArcadeEditorElement["arcgisScriptChange"]>;
10
11
  }
11
12
 
12
13
  interface ReactArcgisCodeEditor extends Partial<Pick<ArcgisCodeEditor, 'editorOptions' | 'language' | 'modelId' | 'value'>>, HTMLProps<HTMLArcgisCodeEditorElement> {
13
- onarcgisSelectionChange?: EventHandler<SyntheticEvent<HTMLArcgisCodeEditorElement, HTMLArcgisCodeEditorElement["arcgisSelectionChange"]>>;
14
- onarcgisValueChange?: EventHandler<SyntheticEvent<HTMLArcgisCodeEditorElement, HTMLArcgisCodeEditorElement["arcgisValueChange"]>>;
14
+ onarcgisSelectionChange?: EventHandler<HTMLArcgisCodeEditorElement["arcgisSelectionChange"]>;
15
+ onarcgisValueChange?: EventHandler<HTMLArcgisCodeEditorElement["arcgisValueChange"]>;
15
16
  }
16
17
 
17
18
  interface ReactArcgisSqlExpressionEditor extends Partial<Pick<ArcgisSqlExpressionEditor, 'hideSideBar' | 'profile' | 'script'>>, HTMLProps<HTMLArcgisSqlExpressionEditorElement> {
18
- onarcgisScriptChange?: EventHandler<SyntheticEvent<HTMLArcgisSqlExpressionEditorElement, HTMLArcgisSqlExpressionEditorElement["arcgisScriptChange"]>>;
19
+ onarcgisScriptChange?: EventHandler<HTMLArcgisSqlExpressionEditorElement["arcgisScriptChange"]>;
19
20
  }
20
21
 
21
22
  declare module "react" {
@@ -5,7 +5,7 @@ import type { ArcgisSqlExpressionEditor } from "../components/arcgis-sql-express
5
5
  import { JSXBase as StencilJsx } from "@stencil/core/internal";
6
6
  import type { EventHandler } from "@arcgis/lumina";
7
7
 
8
- interface StencilArcgisArcadeEditor extends Partial<Pick<ArcgisArcadeEditor, 'editorOptions' | 'hideDocumentationActions' | 'hideSideBar' | 'openedSidePanel' | 'profile' | 'script' | 'sideActionBarExpanded' | 'snippets' | 'suggestions' | 'testData'>>, StencilJsx.HTMLAttributes<HTMLArcgisArcadeEditorElement> {
8
+ interface StencilArcgisArcadeEditor extends Partial<Pick<ArcgisArcadeEditor, 'customPanels' | 'editorOptions' | 'hideDocumentationActions' | 'hideSideBar' | 'openedSidePanel' | 'profile' | 'script' | 'sideActionBarExpanded' | 'snippets' | 'suggestions' | 'testData'>>, StencilJsx.HTMLAttributes<HTMLArcgisArcadeEditorElement> {
9
9
  onArcgisDiagnosticsChange?: EventHandler<HTMLArcgisArcadeEditorElement["arcgisDiagnosticsChange"]>;
10
10
  onArcgisScriptChange?: EventHandler<HTMLArcgisArcadeEditorElement["arcgisScriptChange"]>;
11
11
  }
@@ -12,7 +12,7 @@ interface IContextReferences {
12
12
  */
13
13
  spatialReference?: __esri.SpatialReference | {
14
14
  wkid: number;
15
- };
15
+ } | null;
16
16
  /**
17
17
  * Defines the default time zone in which to create and display Arcade date types.
18
18
  * By default, the time zone is set to "system".
@@ -0,0 +1,23 @@
1
+ import { JsxNode } from '@arcgis/lumina';
2
+ export type ICustomPanel = {
3
+ /** Unique ID */
4
+ id: string;
5
+ /** Panel name - will be used in tooltip for side action bar and heading */
6
+ name: string;
7
+ /** Calcite icon */
8
+ icon: string;
9
+ /** Optional description */
10
+ description?: string;
11
+ /** Optional flag to indicate that the user is providing custom flow items */
12
+ useFlows?: boolean;
13
+ /** Renderer function that returns a JSX node */
14
+ renderer: ({ closePanel, insertText, }: {
15
+ closePanel: (e: Event) => void;
16
+ insertText: (text: string) => void;
17
+ }) => JsxNode;
18
+ };
19
+ /**
20
+ * validates that the renderer function returns a a jsx node that includes a calcite-flow-item.
21
+ * TODO: this should be improved to check that actual render result, and perform sanitation.
22
+ */
23
+ export declare const validateUseFlowsRenderer: (renderer: ICustomPanel["renderer"]) => boolean;
@@ -31,7 +31,7 @@ export type EditorVariable = ArrayVariable | DictionaryVariable | FeatureSetColl
31
31
  interface ConstructorProperties<T> {
32
32
  profile?: EditorProfile | null;
33
33
  declaration?: Partial<T>;
34
- label?: types.IIntlString | string;
34
+ label?: types.IIntlString | string | null;
35
35
  description?: types.IIntlString | string;
36
36
  snippet?: string;
37
37
  nonInteractive?: boolean;
@@ -53,7 +53,7 @@ declare abstract class ProfileItemBase {
53
53
  * True if the item represents a collection of items.
54
54
  */
55
55
  abstract readonly isCollection: boolean;
56
- constructor(_profile: EditorProfile | null | undefined, _label: types.IIntlString | string | undefined, description?: (types.IIntlString | string) | undefined);
56
+ constructor(_profile: EditorProfile | null | undefined, _label: types.IIntlString | string | null | undefined, description?: (types.IIntlString | string) | undefined);
57
57
  /**
58
58
  * Returns the label string.
59
59
  */
@@ -165,7 +165,7 @@ export declare class DictionaryVariable extends CollectionBasedVariable {
165
165
  }
166
166
  interface IRelationshipsProperties {
167
167
  exposeRelationships: boolean;
168
- sourceTableId?: number;
168
+ sourceTableId?: number | null;
169
169
  }
170
170
  declare abstract class SourceBasedVariable extends CollectionBasedVariable {
171
171
  private relationshipsProperties?;
@@ -162,7 +162,7 @@ export interface IUrlDefinition {
162
162
  /**
163
163
  * The url of the resource.
164
164
  */
165
- url: string;
165
+ url: nullish | string;
166
166
  }
167
167
  /**
168
168
  * The most basic way to define a feature or feature set is by passing a collection of fields
@@ -239,7 +239,7 @@ export interface IFeatureLayerLikeInstance extends IFieldsDefinition, ITitleCapa
239
239
  /**
240
240
  * The layer ID, or layer index, of a Feature Service layer.
241
241
  */
242
- layerId: number;
242
+ layerId: nullish | number;
243
243
  /**
244
244
  * Executes a Query against the feature service and returns a Promise to a FeatureSet.
245
245
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/coding-components",
3
- "version": "4.32.0-next.83",
3
+ "version": "4.32.0-next.85",
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",
@@ -36,12 +36,12 @@
36
36
  ],
37
37
  "license": "SEE LICENSE IN LICENSE.md",
38
38
  "dependencies": {
39
- "@arcgis/arcade-languageservice": "4.32.0-next.83",
40
- "@arcgis/components-controllers": "4.32.0-next.83",
41
- "@arcgis/components-utils": "4.32.0-next.83",
42
- "@arcgis/core-adapter": "4.32.0-next.83",
43
- "@arcgis/languages-api-utils": "4.32.0-next.83",
44
- "@arcgis/lumina": "4.32.0-next.83",
39
+ "@arcgis/arcade-languageservice": "4.32.0-next.85",
40
+ "@arcgis/components-controllers": "4.32.0-next.85",
41
+ "@arcgis/components-utils": "4.32.0-next.85",
42
+ "@arcgis/core-adapter": "4.32.0-next.85",
43
+ "@arcgis/languages-api-utils": "4.32.0-next.85",
44
+ "@arcgis/lumina": "4.32.0-next.85",
45
45
  "monaco-editor": "^0.52.0",
46
46
  "tslib": "^2.7.0",
47
47
  "vscode-languageserver-types": "^3.17.5"
@@ -1,12 +0,0 @@
1
- /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
- See https://js.arcgis.com/4.32/esri/copyright.txt for details.
3
- v4.32.0-next.83 */
4
- import{b as B,c as f,d as m,e as _}from"./26D2TEEA.js";import{a as y,b as K,c as O,d as q,f as z,g as X,h as Y,i as Z,j as b}from"./EOMSLJPL.js";import{b as H,c as Q}from"./ESXQSD7A.js";import{x as R}from"./JTRK76CP.js";import{l as G,p as P,q as U,t as v,u as A}from"./P6HD6APH.js";import{Gl as $,Pl as V}from"./V3N4TSTX.js";async function ee(t,e){try{let i=await t,r=new Map,s=new Map,o=[],n=be(e);return i.forEach(u=>{let l=[];u.items.forEach(a=>ge(l,s,r,n,a)),l.length&&o.push({...u,items:l})}),{categories:o,functionDefinitions:r,constantDefinitions:s}}catch(i){return console.error(i),{categories:[],functionDefinitions:new Map,constantDefinitions:new Map}}}function be(t){let{profile:{apiVersion:e,bundles:i,hiddenApiItems:r=[]}={}}=t,s=te(e),o=Array.isArray(i)&&i.length>0?new Set(["core",...i]):void 0;return n=>Ce(s,n.sinceVersion)&&(!o||o.has(n.bundle))&&!r.includes(n.name)}function ge(t,e,i,r,s){if(Array.isArray(s)){s.forEach(o=>J(t,i,r,o));return}s.type==="constant"?we(t,e,r,s):J(t,i,r,s)}function J(t,e,i,r){if(!i(r))return;r.disableDocumentation||t.push(r);let{completion:{label:s}}=r,o=s.toLowerCase(),n=e.get(o);n||(n={type:"functionDefinition",key:o,overloads:[]},e.set(o,n)),n.overloads.push(r)}function we(t,e,i,r){if(!i(r))return;t.push(r);let{completion:{label:s}}=r,o=s.toLowerCase();e.set(o,r);let[n,u]=r.completion.label.split(".");if(!u)return;let l=n.toLowerCase(),a=e.get(l);a||(a={type:"namespace",key:l,members:[],completion:{label:n,detail:n,insertText:n,insertTextMode:_.adjustIndentation,insertTextFormat:m.PlainText,kind:f.Enum}},e.set(l,a));let h=structuredClone(r);h.name=u,h.completion.label=u,h.completion.insertText=u,h.completion.kind=f.Constant,a.members.push(h),a.completion.documentation=a.members.reduce((d,W)=>(d.value=`${d.value}${d.value?`
5
-
6
- `:""}**${W.completion.label}**: ${W.description}`,d),{kind:B.Markdown,value:""})}function te(t){if(!t||typeof t!="string")return null;let e=t.split(".").map(s=>Number.parseInt(s));if(e.some(Number.isNaN))return console.error("Invalid API version string",t),null;let[i,r]=e.slice(0,2);return{major:i,minor:r}}function Ce(t,e){if(!t)return!0;let i=te(e);return i?t.major>i.major?!1:t.minor===void 0||i.minor===void 0?!0:i.minor<=t.minor:!0}function pe(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&typeof t.declaredClass=="string"&&t.declaredClass.startsWith("esri.layers.")&&x(t)&&"queryFeatures"in t&&typeof t.queryFeatures=="function"}function De(t){return!!t&&typeof t=="object"&&"allLayers"in t&&"allTables"in t&&typeof t.allLayers=="object"&&typeof t.allTables=="object"}function ce(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&typeof t.declaredClass=="string"&&(t.declaredClass==="esri.Map"||t.declaredClass==="esri.WebMap"||t.declaredClass==="esri.WebScene")}function Se(t){return!!t&&typeof t=="object"&&"loadAll"in t&&typeof t.loadAll=="function"}function ue(t){return!!t&&typeof t=="object"&&"portalItem"in t&&t.portalItem!=null}function he(t){return!!t&&typeof t=="object"&&"portalItem"in t&&t.portalItem!=null}function x(t){return!!t&&typeof t=="object"&&"fields"in t&&Array.isArray(t.fields)}function I(t){return!!t&&typeof t=="object"&&"url"in t&&typeof t.url=="string"}function ve(t){return I(t)&&/\/(?:featureserver|mapserver)(?:\/|$)/iu.test(t.url)}function ze(t){return I(t)||x(t)||he(t)}function Be(t){return I(t)||x(t)||he(t)}function He(t){return ue(t)||ce(t)||ve(t)}function ie(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.layers.support.Subtype"}function L(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.layers.support.CodedValueDomain"}function Fe(t){return!!t&&typeof t=="object"&&"declaredClass"in t&&t.declaredClass==="esri.layers.support.InheritedDomain"}function Qe(t){return!!t&&typeof t=="object"&&"id"in t&&typeof t.id=="string"&&"definitions"in t&&typeof t.definitions=="object"&&!Array.isArray(t.definitions)}function F(t){return!!t&&typeof t=="object"&&"title"in t&&typeof t.title=="string"}function Me(t){return!!t&&typeof t=="object"&&"url"in t&&typeof t.url=="string"}function de(t){return!!t&&typeof t=="object"&&"layerId"in t&&typeof t.layerId=="number"}function j(t){return!!t&&typeof t=="object"&&"typeIdField"in t&&"types"in t}function re(t){return!!t&&typeof t=="object"&&"getFieldDomain"in t&&typeof t.getFieldDomain=="function"}function g(t){return!!t&&typeof t=="object"&&"subtypeField"in t}function Te(t){return g(t)&&"subtypes"in t}function xe(t){return!!t&&typeof t=="object"&&"portalItem"in t}function Ie(t){return de(t)&&"relationships"in t&&"url"in t&&Array.isArray(t.relationships)&&typeof t.url=="string"}function Pe(t){return!!t&&typeof t=="object"&&"isTable"in t&&typeof t.isTable=="boolean"}function Ae(t){return!!t&&typeof t=="object"&&"load"in t&&typeof t.load=="function"}async function fe(t){if(!t)return null;let e;return x(t)?e=t:e=await y(t),Ae(e)&&await e.load(),e}async function $e(t){t+="/layers";let e=await(await z())(t,{responseType:"json",query:{f:"json"}}),i=t.endsWith("MapServer/layers")?"data":"query",r=se(e.data?.layers,i),s=se(e.data?.tables,i);return{layers:r,tables:s}}function se(t,e){return t?t.filter(i=>{switch(i.type){case"Feature Layer":case"Oriented Imagery Layer":case"Catalog Layer":case"Table":return(i.capabilities?i.capabilities.toLowerCase().split(",").map(r=>r.trim()):[]).includes(e);default:return!1}}):[]}async function Ve(t,e){let i=await y({url:`${t.url}/${e.relatedTableId}`});return await i.load(),i}function ye(t){return(e,i)=>{if(e.type==="oid")return-1;if(i.type==="oid")return 1;if(g(t)){if(e.name===t.subtypeField)return-1;if(i.name===t.subtypeField)return 1}if(j(t)){if(e.name===t.typeIdField)return-1;if(i.name===t.typeIdField)return 1}return e.name.localeCompare(i.name,"en",{sensitivity:"base"})}}function ne(t,e){return t?.every(i=>i.domains?.[e.name]?.type==="inherited")??!1}var Le=/^[a-z_$][a-z0-9_$]*$/giu;function me(t,e=!0){return t.match(Le)?`${e?".":""}${t}`:`["${t}"]`}function _e(t,e){return t?`${t}${me(e)}`:e}function oe(t){return xe(t)?t.portalItem:null}function Xe(t,e,i=!1){let r=e,s=[],o=[];return Z(t).forEach(n=>{r&&(r+=`
7
-
8
- `),r+=`**${n.name}** (${n.alias})
9
- ${n.type}`,n.description&&(r+=`
10
- '${n.description}`);let u=Y(n),l=me(n.name,!1),a=b(n);if(s.push({name:n.name,description:a,type:u,completion:{label:n.name,detail:a,insertText:l,insertTextMode:_.asIs,insertTextFormat:m.PlainText,kind:f.Field}}),i){if(!n.alias||n.alias.toLowerCase()===n.name.toLowerCase())return;let h=`**${n.alias}**
11
- ${n.type}`;n.description&&(h+=`
12
- '${n.description}`),o.push({name:n.alias,description:n.name,type:u,completion:{label:n.alias,detail:n.name,insertText:l,insertTextMode:_.asIs,insertTextFormat:m.PlainText,kind:f.Field,documentation:{kind:"markdown",value:h}}})}}),[[...s,...o],r]}var M=class{constructor(e,i,r){this._profile=e,this._label=i,this.description=r,this.filterDescription=!1}getLabel(){return this._label==null?"":typeof this._label=="string"?U(this._label):P(this._profile?.intlStrings[this._label.code],this._label.formatValues)}getDescription(){return this.description==null?"":typeof this.description=="string"?this.description:P(this._profile?.intlStrings[this.description.code],this.description.formatValues)}passFilter(e){return!e||e.test(this.getLabel())?!0:this.filterDescription&&e.test(this.getDescription())}},w=class extends M{constructor(e){super(e.profile,e.label,e.description??e.declaration?.description),this.declaration=e.declaration??{},this.name=e.declaration?.name??"",this.snippet=e.snippet??"",this.nonInteractive=e.nonInteractive??!1,this.filterDescription=e.filterDescription??!1,this.icon=e.icon}},p=class extends w{constructor(e){super(e),this.type="text",this.isCollection=!1,this.type=e.declaration?.type??"text"}getDescription(){return this.description==null?this._profile?.intlStrings[this.type.toLowerCase()]??"":super.getDescription()}toProfileVariableDefinition(){return{type:this.type,name:"",...this.declaration}}},E=class extends w{constructor(e){super(e),this.type="array",this.isCollection=!1,this.elementType=e.declaration?.elementType??{type:"number",name:"number"}}getDescription(){return this.description==null?this._profile?.intlStrings[this.type.toLowerCase()]??"":super.getDescription()}toProfileVariableDefinition(){return{type:this.type,elementType:this.elementType,name:"",...this.declaration}}},C=class extends w{constructor(e,i){super(i),this.owner=e,this.isCollection=!0,this._loaded=!0,this.variables=[]}get breadcrumb(){if(this.owner){let e=this.owner.breadcrumb;return e?`${e} / ${this.name}`:this.name}return this.name}get loaded(){return this._loaded}get informationUrl(){return null}get informationType(){return""}},c=class extends M{constructor(e,i,r=[],s=!1){super(e,i),this.variables=r,this.isHeader=s,this.type="group",this.isCollection=!0}passFilter(){return!0}},D=class t extends C{constructor(e,i){super(e,i),this.type="dictionary",this.dictionaryVariables=[],this.loadPropertyDeclarations(i.declaration?.properties),this.snippet&&this.dictionaryVariables.length&&(this.variables=[new c(this._profile,this.snippet,this.dictionaryVariables)])}async loadSource(){}loadPropertyDeclarations(e){this.dictionaryVariables=this.createVariableInstances(e),this.variables=this.dictionaryVariables}createVariableInstances(e){if(!Array.isArray(e))return[];let i=[];return e.forEach(r=>{let s=this.createVariableInstance(r);s&&i.push(s)}),i}createVariableInstance(e){let i=_e(this.snippet,e.name);switch(e.type){case"number":case"text":case"boolean":case"date":case"dateOnly":case"time":case"geometry":case"knowledgeGraph":return new p({profile:this._profile,declaration:e,label:i,snippet:i});case"feature":return new k(this,{profile:this._profile,declaration:e,label:i,snippet:i});case"featureSet":return new S(this,{profile:this._profile,declaration:e,label:i,snippet:i},[new p({profile:this._profile,label:i,description:"",snippet:i})]);case"featureSetCollection":return new N(this,{profile:this._profile,declaration:e,label:i,snippet:i});case"dictionary":return new t(this,{profile:this._profile,declaration:e,label:i,snippet:i});case"array":return new E({profile:this._profile,declaration:e,label:i,snippet:i});default:return console.error("Editor profile: Invalid profile variable",e),null}}toProfileVariableDefinition(){return{type:this.type,name:"",...this.declaration,properties:this.dictionaryVariables.map(e=>e.toProfileVariableDefinition())}}},T=class extends C{constructor(e,i,r){super(e,i),this.relationshipsProperties=r,this._source=null,this._loaded=!1,this._definition=i.declaration?.definition}get title(){return F(this._source)?this._source.title:""}get url(){return Me(this._source)?this._source.url:""}get informationUrl(){return!this.loaded||!this.url?null:de(this._source)?`${this.url}/${this._source.layerId}`:this.url}get informationType(){return this._profile?.intlStrings.layer??"layer"}async loadSource(){return v(this._loadPromise)&&A(this._loadPromise)?await this._loadPromise:(this._loadPromise=this._loadSource(),await this._loadPromise)}_getValueSnippet(e){return this.type==="feature"?_e(this.snippet,e.name):e.name}_getSubtypeOrDomainNameSnippet(e){return this.type!=="feature"?null:g(this._source)&&e.name===this._source.subtypeField?`SubtypeName(${this.snippet})`:`DomainName(${this.snippet}, "${e.name}")`}_getFieldProperty(e){let i=this._getDomainDictionary(e);if(i)return i;let r=this._getValueSnippet(e);return new p({profile:this._profile,label:r,description:b(e),snippet:r,icon:X(e),filterDescription:!0})}_getDomainDictionary(e){return re(this._source)?g(this._source)&&this._source.subtypeField?this._getSubtypeDomainDictionary(e):j(this._source)&&this._source.typeIdField?this._getFeatureTypeDomainDictionary(e):this._getFieldDomainDictionary(e):null}_getSubtypeDomainDictionary(e){if(!g(this._source))return null;if(!Te(this._source))return e.name===this._source.subtypeField?null:this._getFieldDomainDictionary(e);if(e.name===this._source.subtypeField){let s=this._createDomainDictionary(e);return s.icon="subtype",s.variables.push(this._getTypeOrSubtypeDomainGroup(this._source.subtypes,e)),s}if(ne(this._source.subtypes,e))return this._getFieldDomainDictionary(e);let i=this._getDomainValuesGroup(this._source.subtypes,e);if(!i)return null;let r=this._createDomainDictionary(e);return r.variables.push(i),r}_getFeatureTypeDomainDictionary(e){if(!j(this._source))return null;if(e.name===this._source.typeIdField){let s=this._createDomainDictionary(e);return s.variables.push(this._getTypeOrSubtypeDomainGroup(this._source.types,e)),s}if(ne(this._source.types,e))return this._getFieldDomainDictionary(e);let i=this._getDomainValuesGroup(this._source.types,e);if(!i)return null;let r=this._createDomainDictionary(e);return r.variables.push(i),r}_getFieldDomainDictionary(e){if(!re(this._source))return null;let i=this._source.getFieldDomain(e.name);if(!L(i))return null;let r=this._getCodedValueDomainGroup(i,{code:"domainvalues"}),s=this._createDomainDictionary(e);return s.variables.push(r),s}_getTypeOrSubtypeDomainGroup(e,i){if(L(i.domain))return this._getCodedValueDomainGroup(i.domain,{code:"subtypes"});let r=e?.map(s=>{let o=ie(s)?s.code:s.id;return new p({profile:this._profile,label:`${o}`,description:s.name,snippet:`"${o}"`})})??[];return new c(this._profile,{code:"subtypes"},r)}_getCodedValueDomainGroup(e,i){let r=e.codedValues.map(s=>new p({profile:this._profile,label:`${s.code}`,description:s.name,snippet:`"${s.code}"`,filterDescription:!0}));return new c(this._profile,i,r)}_getDomainValuesGroup(e,i){let r=[];return!e||e.length===0||(e.forEach(s=>{let o=s.domains?.[i.name];if(!o||Fe(o)||!L(o))return;let n=b(i),u=this._getCodedValueDomainGroup(o,{code:"domainvaluesfortypeformat",formatValues:{fieldName:n,typeName:s.name}}),l=ie(s)?s.code:s.id,a=`${l}`,h=`"${l}""`,d=new D(this,{profile:this._profile,label:a,snippet:h,description:s.name,declaration:{name:n}});d.variables=[u],r.push(d)}),!r.length)?null:new c(this._profile,{code:"domainvaluesbysubtypes"},r)}_createDomainDictionary(e){let i=this._getValueSnippet(e),r=b(e),s=new D(this,{profile:this._profile,label:i,description:r,snippet:i,icon:"form-dropdown",declaration:{name:e.name}}),o=new c(this._profile,r,[new p({profile:this._profile,label:i,description:"",snippet:i})]);s.variables=[o];let n=this._getSubtypeOrDomainNameSnippet(e);return n&&o.variables.push(new p({profile:this._profile,label:n,description:"",snippet:n})),s}async _getRelationshipsProperty(){if(!this.relationshipsProperties?.exposeRelationships||!this._profile?.supportFeatureSetFunctions)return null;let e=this._source;if(!Ie(e))return null;let i=new c(this._profile,{code:"relationships"}),r=await Promise.all(e.relationships.map(async s=>{let o=await Ve(e,s);if(!pe(o)||s.relatedTableId===this.relationshipsProperties?.sourceTableId)return null;let n=`FeatureSetByRelationshipName(${this.snippet}, "${s.name}")`;return new S(this,{profile:this._profile,declaration:{definition:o},label:o.title,description:"",nonInteractive:!0},[new p({profile:this._profile,label:n,description:"",snippet:n})],{exposeRelationships:!0,sourceTableId:e.layerId})}));return i.variables=r.filter(v),i.variables.length?i:null}},k=class extends T{constructor(e,i){super(e,i,{exposeRelationships:!0}),this.type="feature"}get title(){return F(this._source)?this._source.title??"":{code:"feature"}}async _loadSource(){if(this.loaded)return this._source;try{if(this._source=await fe(this._definition),!this._source)throw new Error("Invalid definition");let e=F(this._source)?this._source.title??"":"";this.variables.push(new c(this._profile,e,[new p({profile:this._profile,label:this.snippet,description:"",snippet:this.snippet})]));let i=new c(this._profile,{code:"values"});if(this.variables.push(i),Pe(this._source)&&!this._source.isTable){let s=`Geometry(${this.snippet})`,o=new p({profile:this._profile,declaration:{name:s},label:s,description:"Geometry",snippet:s,icon:"shapes",filterDescription:!0});i.variables.push(o)}this._source.fields.sort(ye(this._source)).forEach(s=>{i.variables.push(this._getFieldProperty(s))});let r=await this._getRelationshipsProperty();r&&this.variables.push(r)}catch(e){console.error("Error with definition",e,this._definition),this._source=null}finally{this._loaded=!0}return this._source}toProfileVariableDefinition(){return{type:this.type,name:"",...this.declaration,definition:this._definition}}},S=class extends T{constructor(e,i,r=[],s){super(e,i,s),this.featureSetSnippets=r,this.type="featureSet"}get title(){return F(this._source)?this._source.title??"":{code:"featureset"}}async _loadSource(){if(this.loaded)return this._source;try{if(this._source=await fe(this._definition),!this._source)throw new Error("Invalid definition");this.variables.push(new c(this._profile,this.title,this.featureSetSnippets,!0));let e=new c(this._profile,{code:"fields"});this.variables.push(e),e.variables=this._source.fields.sort(ye(this._source)).map(r=>this._getFieldProperty(r));let i=await this._getRelationshipsProperty();i&&this.variables.push(i)}catch(e){console.error("Error with definition",e,this._definition),this._source=null}finally{this._loaded=!0}return this._source}toProfileVariableDefinition(){return{type:this.type,name:"",...this.declaration,definition:this._definition}}},N=class extends C{constructor(e,i){super(e,i),this.type="featureSetCollection",this._featureSetCollections=null,this._loaded=!1,this._definition=i.declaration?.definition}get informationUrl(){return!this.loaded||!this._featureSetCollections?null:typeof this._featureSetCollections.source!="string"?H(oe(this._featureSetCollections.source)):null}get informationType(){if(!this.loaded||!this._featureSetCollections)return"";if(typeof this._featureSetCollections.source=="string")return this._profile?.intlStrings.featureservice??"featureservice";switch(this._featureSetCollections.source.declaredClass){case"esri.WebMap":return this._profile?.intlStrings.webmap??"webmap";case"esri.WebScene":return this._profile?.intlStrings.webscene??"webscene";default:return this._profile?.intlStrings.map??"map"}}async loadSource(){return v(this._loadPromise)&&A(this._loadPromise)?await this._loadPromise:(this._loadPromise=this._loadSource(),await this._loadPromise)}async _loadSource(){if(this.loaded)return this._featureSetCollections;try{if(this._featureSetCollections=await this._featureSetCollectionsFromDefinition(),!this._featureSetCollections)throw new Error("Invalid definition");let e=typeof this._featureSetCollections.source=="string"?{code:this._featureSetCollections.source.endsWith("FeatureServer")?"featureservice":"mapservice"}:{code:"webmapformat",formatValues:{webMapTitle:oe(this._featureSetCollections.source)?.title||"Untitled map"}},i=new c(this._profile,e,[new p({profile:this._profile,label:this.snippet,description:"",snippet:this.snippet})]),r=new c(this._profile,{code:"layers"},this._featureSetCollections.layers),s=new c(this._profile,{code:"tables"},this._featureSetCollections.tables);this.variables.push(i,r,s)}catch(e){console.error("Error with definition",e,this._definition),this._featureSetCollections=null}finally{this._loaded=!0}return this._featureSetCollections}async _featureSetCollectionsFromDefinition(){return this._definition?ce(this._definition)?await this._featureSetCollectionFromMap(this._definition):I(this._definition)?await this._featureSetCollectionFromUrl(this._definition.url):ue(this._definition)?await this._featureSetCollectionFromPortalItem(this._definition.portalItem):null:null}async _featureSetCollectionFromMap(e){return Se(e)&&await e.loadAll(),await Promise.all(e.tables.map(async i=>await i.load())),{layers:this._convertWebMapLayersToVariables(e.layers),tables:this._convertWebMapLayersToVariables(e.tables,!0),source:e}}async _featureSetCollectionFromPortalItem(e){let i=await K(e);switch(await i.load(),i.type){case"Web Map":{let r=await O({portalItem:i});return await this._featureSetCollectionFromMap(r)}case"Web Scene":{let r=await q({portalItem:i});return await this._featureSetCollectionFromMap(r)}case"Feature Service":return await this._featureSetCollectionFromUrl(i.url);default:return console.error("Unsupported portal item",e),null}}async _featureSetCollectionFromUrl(e){let i=e.replace(/\/featureserver\/[0-9]*/iu,"/FeatureServer");if(i=i.replace(/\/mapserver\/[0-9]*/iu,"/MapServer"),i=i.split("?")[0],!i)return null;let r=await $e(i),s=Promise.all(r.layers.map(async l=>{let a=await y({url:`${i}/${l.id}`});return await a.load(),this._createFeatureSetVariable(a)})),o=Promise.all(r.tables.map(async l=>{let a=await y({url:`${i}/${l.id}`});return await a.load(),this._createFeatureSetVariable(a)})),[n,u]=await Promise.all([s,o]);return{layers:n,tables:u,source:i}}_convertWebMapLayersToVariables(e,i=!1){let r=[];return e.toArray().reverse().forEach(s=>{if(pe(s)){r.push(this._createFeatureSetVariable(s,!0));return}if(De(s)){let o=i?this._convertWebMapLayersToVariables(s.allTables,!0):this._convertWebMapLayersToVariables(s.allLayers);r.push(...o)}}),r}_createFeatureSetVariable(e,i=!1){return new S(this,{profile:this._profile,declaration:{name:e.title,definition:e},label:i?e.title:e.sourceJSON.name??e.title,description:"",nonInteractive:!0},this._makeFeatureSetSnippets(e,i))}_makeFeatureSetSnippets(e,i=!1){if(!this._profile?.supportFeatureSetFunctions)return[];if(i){let r=`FeatureSetById(${this.snippet}, "${e.id}")`,s=`FeatureSetByName(${this.snippet}, "${e.title}")`;return[new p({profile:this._profile,label:r,description:"",snippet:r}),new p({profile:this._profile,label:s,description:"",snippet:s})]}else{let r=`FeatureSetById(${this.snippet}, "${e.layerId}")`;return[new p({profile:this._profile,label:r,description:"",snippet:r})]}}toProfileVariableDefinition(){return{type:this.type,name:"",...this.declaration,definition:this._definition}}},ae=class extends D{constructor(e,i,r="en"){super(void 0,{profile:null,declaration:{properties:[]}}),this.definition=e,this.intlStrings=i,this.locale=r,this.variables=[],this._profile=this,this.loadPropertyDeclarations(e?.variables)}get supportFeatureSetFunctions(){return this.definition?.bundles?.includes("data-access")??!1}toEditorProfileDefinition(){return{...this.definition,variables:this.dictionaryVariables.map(e=>e.toProfileVariableDefinition())}}},je={locale:"en"},le=class{constructor(e,i){this.languageId=e,this._apiConfig=i,this._onDidChange=new $,this._modelToProfileMap=new Map,this._modelToApiContextMap=new Map,this._localeToApiLibraryPromiseMap=new Map,this._onModelContextDidChange=new $,this._onDidModelContextChangeTimeout=-1,this.workerHost={getApiLibrary:async r=>await this.getApiLibrary(r)},Q().then(r=>{r.onWillDisposeModel(s=>{this.disposeForModel(s.uri)})})}_fireModelContextDidChange(e){this._onDidModelContextChangeTimeout===-1&&(this._onDidModelContextChangeTimeout=window.setTimeout(()=>{this._onDidModelContextChangeTimeout=-1,this._onModelContextDidChange.fire(e)},0))}_getApiKey(e){return V.isUri(e)||(e=V.parse(e)),e.toString()}get onDidChange(){return this._onDidChange.event}disposeForModel(e){let i=this._getApiKey(e);this._modelToProfileMap.delete(i),this._modelToApiContextMap.delete(i)&&this._fireModelContextDidChange(i)}getEditorProfileForModel(e){return this._modelToProfileMap.get(this._getApiKey(e))}getApiContextForModel(e){return this._modelToApiContextMap.get(this._getApiKey(e))??je}updateApiContextForModel(e,i){let r=this._getApiKey(e),s=this._modelToApiContextMap.get(r)??{};this._modelToApiContextMap.set(r,{...s,...i}),this._fireModelContextDidChange(r)}get onModelContextDidChange(){return this._onModelContextDidChange.event}async getApiLibraryForModel(e){let i=this.getApiContextForModel(e),r=this.getApiLibrary(i.locale??"en");return(await ee(r,i)).categories}async fetchApiLibrary(e){try{let{apiPath:i,apiPrefix:r}=this._apiConfig,s=R(`${i}/${r}${e}.json`),o=await fetch(s);return o.ok?await o.json():[]}catch{return[]}}async getApiLibrary(e){let i=G(e);return this._localeToApiLibraryPromiseMap.has(i)||this._localeToApiLibraryPromiseMap.set(i,this.fetchApiLibrary(i)),await this._localeToApiLibraryPromiseMap.get(i)??[]}};export{ze as a,Be as b,He as c,Qe as d,Xe as e,ae as f,le as g};
@@ -1,4 +0,0 @@
1
- /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
- See https://js.arcgis.com/4.32/esri/copyright.txt for details.
3
- v4.32.0-next.83 */
4
- import{b as u,c as f,d as v,e as k,f as S,g as T}from"./UDC3ATPR.js";import{a as M}from"./LWVJU2TB.js";import{i as P}from"./EOMSLJPL.js";import{e as y,f as e,r as $,s as x,t as p,u as d,w}from"./JTRK76CP.js";import{n as m,p as n}from"./P6HD6APH.js";import"./V6XSS2WT.js";var L=y`:host{display:flex;flex-direction:column;width:100%;background-color:var(--calcite-color-foreground-1);color:var(--calcite-color-text-2);.flex-adjustable{flex:1 1 auto;overflow:hidden}.flex-row{display:flex;flex-direction:row;overflow:hidden}.flex-column{display:flex;flex-direction:column;overflow:hidden}.y-scrollable-container{overflow-y:auto;block-size:100%;background-color:var(--calcite-color-foreground-1)}header{border-bottom:1px solid var(--calcite-color-border-3);flex:0 0 auto}.ltr-container{direction:ltr}calcite-action-bar{calcite-action-group{padding-inline-end:var(--calcite-spacing-sm);calcite-action{padding-inline-end:var(--calcite-spacing-sm)}calcite-action:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}calcite-action-group:last-child{border-inline-end-width:0px}calcite-action-group:not(:first-child){padding-inline-start:var(--calcite-spacing-sm)}}.notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}.color-info{color:var(--calcite-color-status-info)}.color-error{color:var(--calcite-color-status-danger)}.color-success{color:var(--calcite-color-status-success)}[class*=result-value-]{font-size:var(--calcite-font-size--2);line-height:1.25rem;background-color:var(--calcite-color-foreground-1);margin:var(--calcite-spacing-md)}.console-logs-container{background-color:var(--calcite-color-foreground-1);padding:0 var(--calcite-spacing-md);font-family:var(--calcite-code-family);font-size:var(--calcite-font-size--2);font-weight:var(--calcite-font-weight-normal)}.result-value-table{table{display:block;max-width:fit-content;overflow-x:auto;border-spacing:0;border-collapse:collapse;text-align:start;white-space:nowrap;thead{background-color:var(--calcite-color-foreground-2)}tr{border-top:1px solid var(--calcite-color-border-3);border-bottom:1px solid var(--calcite-color-border-3)}th,td{border-inline-start:1px solid var(--calcite-color-border-3);border-inline-end:1px solid var(--calcite-color-border-3);text-align:start;padding:var(--calcite-spacing-xxs);.string-value{white-space:pre}}th{font-weight:var(--calcite-font-weight-medium)}}}.tree-item-label,.number-value,.string-value,.boolean-value{font-family:var(--calcite-code-family)}.tree-item-label,.value-type{color:var(--calcite-color-text-2);font-weight:var(--calcite-font-weight-normal)}.dictionary-property{color:var(--arcgis-editor-identifier)}.number-value{color:var(--arcgis-editor-number)}.string-value{color:var(--arcgis-editor-string);white-space:pre-wrap}.constant-value{color:var(--arcgis-editor-constant)}.date-value{color:var(--arcgis-editor-date)}}`,a={lines:!0,selectionMode:"none",scale:"s",oncalciteTreeSelect:l=>l.currentTarget.selectedItems.forEach(t=>t.selected=!1)},r={onClick:l=>{let t=l.currentTarget;t.expanded=!t.expanded}};function o(l){return e`<span class="dictionary-property">${l}</span><span>:&nbsp;</span>`}function C(l,t=!1){return e`<calcite-tree slot=${(t?"children":void 0)??d} .lines=${a.lines} .selectionMode=${a.selectionMode} .scale=${a.scale} @calciteTreeSelect=${a.oncalciteTreeSelect}><calcite-tree-item class="string-value">${JSON.stringify(l.castAsJson(),void 0,2)}</calcite-tree-item></calcite-tree>`}function R(l,t=!1){return e`<calcite-tree slot=${(t?"children":void 0)??d} .lines=${a.lines} .selectionMode=${a.selectionMode} .scale=${a.scale} @calciteTreeSelect=${a.oncalciteTreeSelect}><calcite-tree-item><div class="tree-item-label">${o("type")}${l.type}</div></calcite-tree-item><calcite-tree-item><div class="tree-item-label">${o("value")}<span class="string-value">${JSON.stringify(l,void 0,2)}</span></div></calcite-tree-item></calcite-tree>`}function h(l){switch(l.type){case"unknown":case"null":return e`<span class="constant-value">${l.type}</span>`;case"text":return e`<span class="string-value">${m(l.value)}</span>`;case"number":return e`<span class="number-value">${l.value.toString()}</span>`;case"boolean":return e`<span class="constant-value">${l.value.toString()}</span>`;case"date":return e`<span class="date-value">${k(l)}</span>`;case"dateOnly":return e`<span class="string-value">${m(S(l))}</span>`;case"time":return e`<span class="string-value">${m(T(l))}</span>`;default:return null}}function A(l){let t=P(l.value.fields);return e`<table><thead><tr>${t.map(i=>e`<th>${i.name}</th>`)}</tr></thead><tbody>${l.features.map(i=>e`<tr>${t.map(c=>{try{let s=v(i.field(c.name));return e`<td>${h(s)}</td>`}catch{return e`<td></td>`}})}</tr>`)}</tbody></table>`}var b=class extends x{constructor(){super(...arguments),this.messages=M(),this.loading=!0,this.openedResultPanel="output",this.arcgisClose=$({bubbles:!1}),this.arcgisOpenedResultPanelChange=$({bubbles:!1})}static{this.properties={consoleLogs:0,loading:5,openedResultPanel:3,result:0}}static{this.styles=L}updateResultPanel(t){this.openedResultPanel=t,this.arcgisOpenedResultPanelChange.emit(t)}_switchResultPanel(t){if(!t.target)return;let i=t.target?.dataset.panelName;i&&this.updateResultPanel(i)}_emitClose(){this.arcgisClose.emit()}renderConsolePanel(){return this.openedResultPanel!=="console"?null:this.loading&&!this.consoleLogs?.length?e`<calcite-loader scale=s type=indeterminate label></calcite-loader>`:e`<div class="console-logs-container ltr-container">${this.consoleLogs?.length?this.consoleLogs.map(t=>e`<p>${t}</p>`):e`<p>${this.messages.consolemessage}</p>`}</div>`}renderLogPanel(){if(this.openedResultPanel!=="log")return null;if(this.loading)return e`<calcite-loader scale=s type=indeterminate label></calcite-loader>`;let t=this.result?.type==="error"?"color-error":"color-success";return e`<calcite-list label=results>${this.result?e`<calcite-list-item .label=${n(this.messages.lastexecutionformat,{timeStamp:new Intl.DateTimeFormat(this.messages._t9nLocale,{dateStyle:"medium",timeStyle:"medium"}).format(this.result.timeStamp)})}><calcite-icon slot=content-start icon=information scale=s class=${p(t)}></calcite-icon></calcite-list-item><calcite-list-item .label=${n(this.messages.compilationtimeformat,{time:new Intl.NumberFormat(this.messages._t9nLocale,{style:"unit",unit:"millisecond",maximumFractionDigits:2}).format(this.result.compilationTime??0)})}><calcite-icon slot=content-start icon=information scale=s class=${p(t)}></calcite-icon></calcite-list-item><calcite-list-item .label=${n(this.messages.executiontimeformat,{time:new Intl.NumberFormat(this.messages._t9nLocale,{style:"unit",unit:"millisecond",maximumFractionDigits:2}).format(this.result.executionTime??0)})}><calcite-icon slot=content-start icon=information scale=s class=${p(t)}></calcite-icon></calcite-list-item>`:e`<calcite-list-item .label=${this.messages.runscriptmessage}><calcite-icon slot=content-start icon=information scale=s class="color-info"></calcite-icon></calcite-list-item>`}</calcite-list>`}renderOutputPanel(){if(this.openedResultPanel!=="output")return null;if(this.loading)return e`<calcite-loader scale=s type=indeterminate label></calcite-loader>`;switch(this.result?.type){case"error":return e`<div class="result-value-simple flex-adjustable">${n(this.messages.executionerrorformat,{message:this.result.value})}</div>`;case"null":case"unknown":return e`<div class="result-value-simple ltr-container">${h(this.result)}</div>`;case"text":case"number":case"date":case"dateOnly":case"time":case"boolean":return e`<div class="result-value-simple ltr-container"><span class="value-type">${this.result.type}:&nbsp;</span>${h(this.result)}</div>`;case"array":{let t=(this.result.value??[]).slice(0,u);return e`<div class="result-value-simple ltr-container"><calcite-tree .lines=${a.lines} .selectionMode=${a.selectionMode} .scale=${a.scale} @calciteTreeSelect=${a.oncalciteTreeSelect}><calcite-tree-item expanded @click=${r.onClick}><div class="tree-item-label">${this.renderArrayHeader(this.result)}</div>${this.renderArrayTree(t,!0)}</calcite-tree-item></calcite-tree></div>`}case"geometry":return e`<div class="result-value-simple ltr-container"><calcite-tree .lines=${a.lines} .selectionMode=${a.selectionMode} .scale=${a.scale} @calciteTreeSelect=${a.oncalciteTreeSelect}><calcite-tree-item expanded @click=${r.onClick}><div class="tree-item-label">${this.result.type}</div>${R(this.result.value,!0)}</calcite-tree-item></calcite-tree></div>`;case"attachment":return e`<div class="result-value-simple ltr-container"><calcite-tree .lines=${a.lines} .selectionMode=${a.selectionMode} .scale=${a.scale} @calciteTreeSelect=${a.oncalciteTreeSelect}><calcite-tree-item expanded @click=${r.onClick}><div class="tree-item-label">${this.result.type}</div>${C(this.result.value,!0)}</calcite-tree-item></calcite-tree></div>`;case"feature":case"dictionary":case"portal":return e`<div class="result-value-simple ltr-container"><calcite-tree .lines=${a.lines} .selectionMode=${a.selectionMode} .scale=${a.scale} @calciteTreeSelect=${a.oncalciteTreeSelect}><calcite-tree-item expanded @click=${r.onClick}><div class="tree-item-label">${this.result.type}</div>${this.renderDictionaryTree(this.result.value,!0)}</calcite-tree-item></calcite-tree></div>`;case"featureSet":return e`<div class="result-value-table ltr-container">${this.renderFeatureSetLabel(this.result)}${A(this.result)}</div>`;case"knowledgeGraph":return e`<div class="result-value-simple ltr-container"><span class="value-type">${this.result.type}:&nbsp;</span><span class="string-value">${this.result.value.url}</span></div>`;default:return e`<div class="result-value-simple flex-adjustable ltr-container">${this.messages.runscriptmessage}</div>`}}renderArrayHeader(t){let i=t.value??[],c=Math.max(i.length-u,0);return e`<span>${`${t.type}(${i.length??0})`}</span>${c>0?e`<span>&nbsp;${n(this.messages.showingfirstitemsformat,{count:u.toString()})}</span>`:null}`}renderArrayTree(t,i=!1){return e`<calcite-tree slot=${(i?"children":void 0)??d} .lines=${a.lines} .selectionMode=${a.selectionMode} .scale=${a.scale} @calciteTreeSelect=${a.oncalciteTreeSelect}>${t.map((c,s)=>{let g=v(c);return this.renderTreeItem(g,s,!i)})}</calcite-tree>`}renderDictionaryTree(t,i=!1){let c=t.geometry?.();return e`<calcite-tree slot=${(i?"children":void 0)??d} .lines=${a.lines} .selectionMode=${a.selectionMode} .scale=${a.scale} @calciteTreeSelect=${a.oncalciteTreeSelect}>${t.keys().map(s=>{let g=v(t.field(s));return this.renderTreeItem(g,s)})}${c?this.renderTreeItem({type:"geometry",value:c},"geometry"):null}</calcite-tree>`}renderTreeItem(t,i,c=!1){switch(t.type){case"null":case"unknown":case"text":case"number":case"date":case"dateOnly":case"time":case"boolean":return e`<calcite-tree-item><div class="tree-item-label">${o(i)}${h(t)}</div></calcite-tree-item>`;case"array":{let s=(t.value??[]).slice(0,u);return e`<calcite-tree-item .expanded=${c} @click=${r.onClick}><div class="tree-item-label">${o(i)}${this.renderArrayHeader(t)}</div>${this.renderArrayTree(s,!0)}</calcite-tree-item>`}case"geometry":return e`<calcite-tree-item .expanded=${c} @click=${r.onClick}><div class="tree-item-label">${o(i)}<span>${t.type}</span></div>${R(t.value,!0)}</calcite-tree-item>`;case"attachment":return e`<calcite-tree-item .expanded=${c} @click=${r.onClick}><div class="tree-item-label">${o(i)}<span>${t.type}</span></div>${C(t.value,!0)}</calcite-tree-item>`;case"feature":case"dictionary":case"portal":return e`<calcite-tree-item .expanded=${c} @click=${r.onClick}><div class="tree-item-label">${o(i)}<span>${t.type}</span></div>${this.renderDictionaryTree(t.value,!0)}</calcite-tree-item>`;default:return null}}renderFeatureSetLabel(t){return e`<div class="value-type"><span>${t.type}:</span>${t.features.length>=f?e`<span>&nbsp;${n(this.messages.showingfirstitemsformat,{count:f.toString()})}</span>`:null}</div>`}render(){return e`<header class="flex-row"><calcite-action-bar class="flex-adjustable" layout=horizontal scale=s expanded expand-disabled><calcite-action-group scale=s><calcite-action .active=${this.openedResultPanel==="output"} .text=${this.messages.output??""} text-enabled scale=s icon=list-show-all icon-flip-rtl @click=${this._switchResultPanel} data-panel-name=output></calcite-action><calcite-action .active=${this.openedResultPanel==="console"} .text=${this.messages.console??""} text-enabled scale=s icon=console icon-flip-rtl @click=${this._switchResultPanel} data-panel-name=console></calcite-action><calcite-action .active=${this.openedResultPanel==="log"} .text=${this.messages.log??""} text-enabled scale=s icon=list icon-flip-rtl @click=${this._switchResultPanel} data-panel-name=log></calcite-action></calcite-action-group></calcite-action-bar><calcite-action scale=s icon=x .text=${this.messages.close??""} @click=${this._emitClose}></calcite-action></header><article class="flex-adjustable">${this.loading?e`<calcite-loader scale=s type=indeterminate label></calcite-loader>`:e`<div class="flex-column y-scrollable-container">${this.renderOutputPanel()}${this.renderConsolePanel()}${this.renderLogPanel()}</div>`}</article>`}};w("arcgis-arcade-results",b);export{b as ArcgisArcadeResults};
@@ -1,4 +0,0 @@
1
- /*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
2
- See https://js.arcgis.com/4.32/esri/copyright.txt for details.
3
- v4.32.0-next.83 */
4
- import{a as b,h as c}from"./UDC3ATPR.js";import{a as P,b as A}from"./QR6WVNQI.js";import{a as E}from"./LWVJU2TB.js";import{a as f,b as v,d as s}from"./KRSQQ5UL.js";import"./4HUHKO2F.js";import"./26D2TEEA.js";import"./EOMSLJPL.js";import"./ESXQSD7A.js";import"./5QRWOYYV.js";import{b as h,e as g,f as t,h as n,r,s as u,w as _,x as m}from"./JTRK76CP.js";import{a as d,h as p}from"./P6HD6APH.js";import{Hl as x,kk as y}from"./V3N4TSTX.js";import"./V6XSS2WT.js";y();var D=g`arcgis-arcade-editor{display:flex;flex-direction:column;position:relative;overflow:hidden;border:var(--arcgis-coding-components-border);box-sizing:border-box;background-color:var(--arcgis-coding-components-background-color);height:100%;.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);box-sizing:border-box}.border-inline-end{border-inline-end:var(--arcgis-coding-components-border);box-sizing:border-box}.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}.side-action-bar{max-width:var(--arcgis-coding-components-side-action-bar-max-w)}.side-panel{max-width:var(--arcgis-coding-components-side-panel-max-w);width:var(--arcgis-coding-components-side-panel-w);calcite-flow{height:100%}}.main-action-bar{border-bottom:var(--arcgis-coding-components-border);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);box-sizing:border-box;max-height:50%;min-height:50%;margin-bottom:-1px}calcite-flow{[slot=footer]{word-break:break-word}}}`,l=class extends u{constructor(){super(...arguments),this._codeEditorElt=P(),this._componentReadyDefer=new d,this._disposables=[],this._editorProfilePromise=Promise.resolve(void 0),this.messages=E(),this._modelId=p(),this._openArcadeHelp=()=>void window.open(b,"Arcade Help"),this._toggleSidePanel=e=>{if(!e.target)return;let i=e.target?.dataset.panelName??"none";this.openedSidePanel=i===this.openedSidePanel?"none":i,this.openedSidePanel==="none"&&this._codeEditorElt.value?.setFocus().catch(console.error)},this._consoleLogs=[],this._executingScript=!1,this._preparingArcade=!1,this._resultPanel="output",this._showExecutionPanel=!1,this.hideDocumentationActions=!1,this.hideSideBar=!1,this.openedSidePanel="none",this.script="",this.sideActionBarExpanded=!1,this.arcgisDiagnosticsChange=r({bubbles:!1}),this.arcgisScriptChange=r({bubbles:!1})}static{this.properties={_apiLibrary:16,_consoleLogs:16,_editorProfile:16,_executingScript:16,_executionResult:16,_preparingArcade:16,_resultPanel:16,_showExecutionPanel:16,editorInstance:32,editorOptions:0,hideDocumentationActions:5,hideSideBar:5,openedSidePanel:3,profile:0,script:1,sideActionBarExpanded:7,snippets:0,suggestions:0,testData:0}}static{this.shadowRootOptions=h}static{this.styles=D}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 i=this._codeEditorElt.value?.value;return await c(e.definition,i,this.testData)}async setFocus(){await this._componentReadyDefer.promise,await this._codeEditorElt.value?.setFocus()}async load(){let e=m("./assets");f(e),await this._updateEditorProfile()}willUpdate(e){(e.has("messages")||e.has("profile"))&&this._updateDataModelDeps(),e.has("testData")&&this._testDataChanged(),e.has("snippets")&&s.updateApiContextForModel(this._modelId,{snippets:this.snippets})}async loaded(){this._componentReadyDefer.resolve(),await this._updateApiLibrary();let e=await v();this._disposables.push(e.onDiagnosticsChange(i=>!this._preparingArcade&&this.arcgisDiagnosticsChange.emit(i.diagnostics))),this.testData&&this._addExecuteScriptAction(),await this._codeEditorElt.value?.setFocus()}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(console.error)}async _updateEditorProfile(){this._preparingArcade=!0;try{await s.setProfileForModel(this._modelId,this.profile,{locale:this.messages._t9nLocale,snippets:this.snippets}),this._editorProfile=s.getEditorProfileForModel(this._modelId)}catch{this._editorProfile=void 0}finally{this._editorProfilePromise=Promise.resolve(this._editorProfile),this._preparingArcade=!1}}async _updateApiLibrary(){this._apiLibrary=await s.getApiLibraryForModel(this._modelId)}async _executeScript(){let e=this.testData;if(!this._codeEditorElt.value||!e)return;let i=await this._editorProfilePromise;if(!i){this._executionResult={type:"error",value:"Missing editor profile",error:null};return}this._showExecutionPanel=!0,this._executingScript=!0,this._consoleLogs=[],setTimeout(()=>void(async()=>{let a=this._codeEditorElt.value?.value;this._executionResult=await c(i.definition,a,e,o=>setTimeout(()=>this._consoleLogs=[...this._consoleLogs,o],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(console.error)}_insertAsText(e){this._codeEditorElt.value?.insertText(e.detail).catch(console.error)}_onResultPanelChange(e){this._resultPanel=e.detail}_onExecutionPanelClose(){this._showExecutionPanel=!1}_addExecuteScriptAction(){let e=this.editorInstance?.addAction({id:"run-script",label:"Run Arcade Expression",keybindings:[x.F5],contextMenuGroupId:"code",contextMenuOrder:1,run:()=>{this.testData&&this._executeScript().catch(console.error)}});e&&(this._executeScriptAction=e,this._disposables.push(e))}_disposeSafely(e){let i=this._disposables.indexOf(e);i!==-1&&this._disposables.splice(i,1),e.dispose()}renderMainActionBar(){return this.testData?t`<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(console.error)}></calcite-action>${this._executionResult?t`<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 t`<arcgis-code-editor class="flex-adjustable" .editorOptions=${this.editorOptions} .language=${s.languageId} .value=${this.script??""} .modelId=${this._modelId} @arcgisValueChange=${this._onCodeEditorValueChange} ${A(this._codeEditorElt)}></arcgis-code-editor>`}renderAction({id:e,label:i,icon:a,active:o,panelName:S,iconFlipRtl:w=!1,onClick:$=this._toggleSidePanel}){return t`<calcite-action id=${e??n} .text=${i} .icon=${a} .active=${o} @click=${$} data-panel-name=${S??n} .iconFlipRtl=${w}></calcite-action>${!this.sideActionBarExpanded&&t`<calcite-tooltip .referenceElement=${e}><span>${i}</span></calcite-tooltip>`||""}`}renderSideActionBar(){return this.hideSideBar?null:t`<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.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;switch(this.openedSidePanel){case"api":return t`<arcgis-language-api-panel class="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></arcgis-language-api-panel>`;case"variables":return t`<arcgis-editor-variables class="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}></arcgis-editor-variables>`;case"suggestions":return t`<arcgis-arcade-suggestions class="side-panel flex-panel border-inline-start" .suggestions=${this.suggestions} @arcgisItemSelected=${this._insertAsText} @arcgisClose=${this._toggleSidePanel} data-panel-name=none></arcgis-arcade-suggestions>`;default:return null}}renderResultsPanel(){return this._showExecutionPanel?t`<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 t`${this.renderMainActionBar()}<div class="flex-row flex-adjustable"><div class="flex-column flex-adjustable">${this.renderMainPanel()}${this.renderResultsPanel()}</div>${this.renderSidePanel()}${this.renderSideActionBar()}</div>`}};_("arcgis-arcade-editor",l);export{l as ArcgisArcadeEditor};