@arcgis/coding-components 5.1.0-next.11 → 5.1.0-next.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cdn/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  /* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
2
- import{I as s,u as e}from"./EMMNZESW.js";import"./BCUUVBXH.js";import"./3TTFCHAA.js";var i=e(s,{"arcgis-arcade-coding-assistant":[()=>import("./2ORJ3A7K.js"),"appVersion,assistantsEnabled,closed,closePanel:,editorRef:,feedbackServiceUrl,helpBase,insertText:,portalUrl,serviceUrl;destroy"],"arcgis-arcade-editor":[()=>import("./2TB2LHRA.js"),"arcadeAssistant:,customPanels:,editorInstance:,editorOptions:,hideDocumentationActions,hideSideBar,messages:,openedSidePanel,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getTestResult,setFocus"],"arcgis-arcade-results":[()=>import("./ZGBZ6BXY.js"),"calciteModeDark,consoleLogs:,loading,openedResultPanel,result:"],"arcgis-arcade-suggestions":[()=>import("./44MLHT3A.js"),"closed,suggestions:"],"arcgis-code-editor":[()=>import("./RYBVZEI5.js"),"editorInstance:,editorOptions:,language,modelId,value;insertSnippet,insertText,setFocus"],"arcgis-code-editor-shell":[()=>import("./3C7TCPV5.js")],"arcgis-code-viewer":[()=>import("./M4URDN2E.js"),"language,round"],"arcgis-editor-variables":[()=>import("./DTZPALJA.js"),"closed,loading,modelId,variable:"],"arcgis-language-api-panel":[()=>import("./H75CMJQP.js"),"apiLibrary:,closed,hideDocumentationActions,languageId,loading"],"arcgis-sql-expression-editor":[()=>import("./TDEKR2LM.js"),"hideSideBar,messages:,profile:,script;setFocus"]});i({resourcesUrl:import.meta.url});var t=new CSSStyleSheet;t.replaceSync("@layer{:not([hydrated]):is(arcgis-arcade-editor,arcgis-code-editor,arcgis-code-editor-shell,arcgis-code-viewer,arcgis-sql-expression-editor){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,t];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,s)
2
+ import{I as s,u as e}from"./EMMNZESW.js";import"./BCUUVBXH.js";import"./3TTFCHAA.js";var i=e(s,{"arcgis-arcade-coding-assistant":[()=>import("./2ORJ3A7K.js"),"appVersion,assistantsEnabled,closed,closePanel:,editorRef:,feedbackServiceUrl,helpBase,insertText:,portalUrl,serviceUrl;destroy"],"arcgis-arcade-editor":[()=>import("./2TB2LHRA.js"),"arcadeAssistant:,customPanels:,editorInstance:,editorOptions:,hideDocumentationActions,hideSideBar,messages:,openedSidePanel,profile:,script,sideActionBarExpanded,snippets:,suggestions:,testData:;getTestResult,setFocus"],"arcgis-arcade-results":[()=>import("./ZGBZ6BXY.js"),"calciteModeDark,consoleLogs:,loading,openedResultPanel,result:"],"arcgis-arcade-suggestions":[()=>import("./44MLHT3A.js"),"closed,suggestions:"],"arcgis-code-editor":[()=>import("./V2SLLOQ5.js"),"editorInstance:,editorOptions:,language,modelId,value;insertSnippet,insertText,setFocus"],"arcgis-code-editor-shell":[()=>import("./3C7TCPV5.js")],"arcgis-code-viewer":[()=>import("./JGASZMML.js"),"language,round"],"arcgis-editor-variables":[()=>import("./DTZPALJA.js"),"closed,loading,modelId,variable:"],"arcgis-language-api-panel":[()=>import("./H75CMJQP.js"),"apiLibrary:,closed,hideDocumentationActions,languageId,loading"],"arcgis-sql-expression-editor":[()=>import("./5XIHWLQI.js"),"hideSideBar,messages:,profile:,script;setFocus"]});i({resourcesUrl:import.meta.url});var t=new CSSStyleSheet;t.replaceSync("@layer{:not([hydrated]):is(arcgis-arcade-editor,arcgis-code-editor,arcgis-code-editor-shell,arcgis-code-viewer,arcgis-sql-expression-editor){visibility:hidden}}");document.adoptedStyleSheets=[...document.adoptedStyleSheets,t];window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{}}),((a,r)=>{a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c);r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")})($arcgis,s)
@@ -4,32 +4,32 @@ import { CompletionItemKind as h, InsertTextFormat as P, InsertTextMode as F } f
4
4
  import { fetchT9nStringsBundle as M } from "@arcgis/toolkit/intl";
5
5
  import { g as b } from "./runtime.js";
6
6
  const x = (r) => {
7
- const e = r.variables[0], i = e && e.type === "featureSet" ? A(e) : void 0, { apiVersion: t, bundles: o, hiddenApiItems: s } = r.toEditorProfileDefinition();
7
+ const t = r.variables[0], i = t?.type === "featureSet" ? A(t) : void 0, { apiVersion: e, bundles: o, hiddenApiItems: s } = r.toEditorProfileDefinition();
8
8
  return {
9
- apiVersion: t,
9
+ apiVersion: e,
10
10
  bundles: o,
11
11
  variables: i ? [i] : [],
12
12
  hiddenApiItems: s?.map((a) => a.toLowerCase())
13
13
  };
14
14
  };
15
15
  function A(r) {
16
- const { name: e } = r, i = r.getDescription(), { definition: t } = r.toProfileVariableDefinition(), o = {
17
- label: e,
18
- detail: e,
19
- insertText: e,
16
+ const { name: t } = r, i = r.getDescription(), { definition: e } = r.toProfileVariableDefinition(), o = {
17
+ label: t,
18
+ detail: t,
19
+ insertText: t,
20
20
  insertTextMode: F.asIs,
21
21
  insertTextFormat: P.PlainText,
22
22
  kind: h.Field
23
23
  }, s = {
24
- name: e,
24
+ name: t,
25
25
  description: i,
26
26
  type: "dictionary",
27
27
  properties: [],
28
28
  completion: o
29
29
  };
30
- if (!t || !("fields" in t))
30
+ if (!e || !("fields" in e))
31
31
  return s;
32
- const [a, l] = y(t.fields, i);
32
+ const [a, l] = y(e.fields, i);
33
33
  return s.properties = a, o.documentation = { kind: "markdown", value: l }, s;
34
34
  }
35
35
  const T = {
@@ -48,24 +48,24 @@ function v() {
48
48
  function E(r) {
49
49
  if (!c(r))
50
50
  return;
51
- const e = v(
51
+ const t = v(
52
52
  /*locale*/
53
53
  );
54
- if (!e)
54
+ if (!t)
55
55
  return;
56
56
  const i = {
57
57
  variables: [],
58
- hiddenApiItems: r.hiddenApiItems?.map((t) => t.toLowerCase())
58
+ hiddenApiItems: r.hiddenApiItems?.map((e) => e.toLowerCase())
59
59
  };
60
- return e.variables.forEach((t) => {
61
- if (r.disabledVariables?.includes(t.name))
60
+ return t.variables.forEach((e) => {
61
+ if (r.disabledVariables?.includes(e.name))
62
62
  return;
63
- const o = r.definitions[t.name];
64
- switch (t.type) {
63
+ const o = r.definitions[e.name];
64
+ switch (e.type) {
65
65
  case "featureSet":
66
- return u(o) ? i.variables.push({ ...t, type: t.type, definition: o }) : void 0;
66
+ return u(o) ? i.variables.push({ ...e, type: e.type, definition: o }) : void 0;
67
67
  default:
68
- throw Error(`sdkVariable type not supported (yet) type: ${t.type}`);
68
+ throw Error(`sdkVariable type not supported (yet) type: ${e.type}`);
69
69
  }
70
70
  }), i;
71
71
  }
@@ -78,33 +78,33 @@ class w extends m {
78
78
  }), this._languageId = d, this._layerMap = /* @__PURE__ */ new Map();
79
79
  }
80
80
  // TODO: try to rely on editor profile instance instead of storing a feature layer
81
- updateFeatureLayerForModel(e, i) {
82
- const t = this._getApiKey(e);
83
- this._layerMap.set(t, i);
81
+ updateFeatureLayerForModel(t, i) {
82
+ const e = this._getApiKey(t);
83
+ this._layerMap.set(e, i);
84
84
  }
85
- getFeatureLayerForModel(e) {
86
- const i = this._getApiKey(e);
85
+ getFeatureLayerForModel(t) {
86
+ const i = this._getApiKey(t);
87
87
  return this._layerMap.get(i);
88
88
  }
89
- async setProfileForModel(e, i, t = { locale: "en" }) {
89
+ async setProfileForModel(t, i, e = { locale: "en" }) {
90
90
  c(i) && (i = E(i));
91
91
  const o = await M(
92
- t.locale,
92
+ e.locale,
93
93
  b("./assets/editor-profile/t9n"),
94
94
  "messages."
95
95
  );
96
96
  if (!o)
97
- throw new Error(`Failed to load the language bundle for ${t.locale}`);
98
- this.disposeForModel(e);
99
- const s = this._getApiKey(e), a = new g(i, o);
97
+ throw new Error(`Failed to load the language bundle for ${e.locale}`);
98
+ this.disposeForModel(t);
99
+ const s = this._getApiKey(t), a = new g(i, o);
100
100
  this._modelToProfileMap.set(s, a);
101
101
  const l = x(a);
102
- this.updateApiContextForModel(e, {
103
- locale: t.locale,
102
+ this.updateApiContextForModel(t, {
103
+ locale: e.locale,
104
104
  profile: l
105
105
  });
106
106
  const p = i?.variables?.find((f) => f.name === "$layer");
107
- p && this.updateFeatureLayerForModel(e, p.definition);
107
+ p && this.updateFeatureLayerForModel(t, p.definition);
108
108
  }
109
109
  }
110
110
  const n = new w(), q = {
@@ -3,9 +3,8 @@ import type { editor as Editor } from "monaco-editor";
3
3
  import type { Diagnostic } from "@arcgis/arcade-languageservice";
4
4
  import type { ApiSnippet } from "@arcgis/languages-api-utils";
5
5
  import type { PublicLitElement as LitElement } from "@arcgis/lumina";
6
- import type { IEditorCodeSuggestion, IEditorCodeSuggestionGroup } from "../../utils/editor-suggestions.js";
7
- import type { IEditorProfileDefinition, IPredefinedProfile } from "../../utils/profile/types.js";
8
- import type { ArcadeResult, IEditorTestContext } from "../../utils/arcade-executor.js";
6
+ import type { IEditorCodeSuggestion, IEditorCodeSuggestionGroup, IEditorProfileDefinition, IPredefinedProfile, IEditorTestContext } from "../types.js";
7
+ import type { ArcadeResult } from "../../utils/arcade-executor.js";
9
8
  import type { ICustomPanel } from "../../utils/custom-panel.js";
10
9
  import type { ArcadeAssistantConfig } from "../../utils/arcade-assistant/types.js";
11
10
  import type { T9nMeta } from "@arcgis/lumina/controllers";
@@ -30,7 +29,7 @@ import type { T9nMeta } from "@arcgis/lumina/controllers";
30
29
  * - In-editor help for finding information about profile variables relevant to your profile, documentation for constants and functions, a link to the official Arcade documentation, and, in some case, suggestions.
31
30
  * - Support for many [languages and directionality](https://developers.arcgis.com/javascript/latest/localization/)
32
31
  */
33
- export abstract class ArcgisArcadeEditor<T extends WithCustomPanels = object> extends LitElement {
32
+ export abstract class ArcgisArcadeEditor extends LitElement {
34
33
  /**
35
34
  * enables and configures the arcade assistant
36
35
  *
@@ -53,7 +52,7 @@ export abstract class ArcgisArcadeEditor<T extends WithCustomPanels = object> ex
53
52
  * }
54
53
  * ```
55
54
  *
56
- * To get the full list of available options, see the Monaco Editor options [documentation](https://microsoft.github.io/monaco-editor/typedoc/variables/editor.EditorOptions.html) for more details.
55
+ * To get the full list of available options, see the Monaco Editor options [documentation](https://microsoft.github.io/monaco-editor/docs.html#interfaces/editor_editor_api.editor.IEditorOptions.html) for more details.
57
56
  */
58
57
  accessor editorOptions: Editor.IEditorOptions & Editor.IGlobalEditorOptions | undefined;
59
58
  /**
@@ -91,7 +90,7 @@ export abstract class ArcgisArcadeEditor<T extends WithCustomPanels = object> ex
91
90
  *
92
91
  * @default "none"
93
92
  */
94
- accessor openedSidePanel: T extends Required<WithCustomPanels> ? SidePanelName : string;
93
+ accessor openedSidePanel: string;
95
94
  /**
96
95
  * The profile contains metadata used by the editor for editing context and help.
97
96
  * Example:
@@ -127,7 +126,11 @@ export abstract class ArcgisArcadeEditor<T extends WithCustomPanels = object> ex
127
126
  accessor suggestions: IEditorCodeSuggestion[] | IEditorCodeSuggestionGroup[] | undefined;
128
127
  /** Test data used to execute the script in the editor. If undefined the execute script UX will be hidden. */
129
128
  accessor testData: IEditorTestContext | undefined;
130
- /** Returns the Arcade result for the script for the provided test data. */
129
+ /**
130
+ * Returns the Arcade result for the script for the provided test data.
131
+ *
132
+ * @internal
133
+ */
131
134
  getTestResult(): Promise<ArcadeResult>;
132
135
  /** Set the focus on the element. */
133
136
  setFocus(): Promise<void>;
@@ -136,13 +139,7 @@ export abstract class ArcgisArcadeEditor<T extends WithCustomPanels = object> ex
136
139
  /** Emitted when the script string has changed. */
137
140
  readonly arcgisScriptChange: import("@arcgis/lumina").TargetedEvent<this, string>;
138
141
  readonly "@eventTypes": {
139
- arcgisDiagnosticsChange: ArcgisArcadeEditor<T>["arcgisDiagnosticsChange"]["detail"];
140
- arcgisScriptChange: ArcgisArcadeEditor<T>["arcgisScriptChange"]["detail"];
142
+ arcgisDiagnosticsChange: ArcgisArcadeEditor["arcgisDiagnosticsChange"]["detail"];
143
+ arcgisScriptChange: ArcgisArcadeEditor["arcgisScriptChange"]["detail"];
141
144
  };
142
- }
143
-
144
- export type SidePanelName = "api" | "none" | "suggestions" | "variables";
145
-
146
- export type WithCustomPanels = {
147
- customPanels?: ICustomPanel[];
148
- };
145
+ }
@@ -1,6 +1,6 @@
1
1
  /// <reference path="../../index.d.ts" />
2
2
  import type { PublicLitElement as LitElement } from "@arcgis/lumina";
3
- import type { IPredefinedProfile } from "../../utils/profile/types.js";
3
+ import type { IPredefinedProfile } from "../types.js";
4
4
  import type { editor } from "monaco-editor";
5
5
  import type { T9nMeta } from "@arcgis/lumina/controllers";
6
6
 
@@ -1,17 +1,16 @@
1
- import type VoxelLayer from "@arcgis/core/layers/VoxelLayer";
2
- import type ImageryLayer from "@arcgis/core/layers/ImageryLayer";
3
- import type ImageryTileLayer from "@arcgis/core/layers/ImageryTileLayer";
1
+ import type VoxelLayer from "@arcgis/core/layers/VoxelLayer.js";
2
+ import type ImageryLayer from "@arcgis/core/layers/ImageryLayer.js";
3
+ import type ImageryTileLayer from "@arcgis/core/layers/ImageryTileLayer.js";
4
4
  import type FeatureLayer from "@arcgis/core/layers/FeatureLayer.js";
5
- import type Layer from "@arcgis/core/layers/Layer";
6
- import type PortalItemResource from "@arcgis/core/portal/PortalItemResource";
7
- import type WebMap from "@arcgis/core/WebMap";
8
- import type WebScene from "@arcgis/core/WebScene";
9
- import type Map from "@arcgis/core/Map";
10
- import type Domain from "@arcgis/core/layers/support/Domain.js";
11
- import type { BundleType, ApiItem, ApiVariableType, ProfileId } from "@arcgis/languages-api-utils";
5
+ import type WebMap from "@arcgis/core/WebMap.js";
6
+ import type WebScene from "@arcgis/core/WebScene.js";
7
+ import type Map from "@arcgis/core/Map.js";
8
+ import type SpatialReference from "@arcgis/core/geometry/SpatialReference.js";
9
+ import type { Diagnostic as ArcadeLanguageServiceDiagnostic } from "@arcgis/arcade-languageservice";
10
+ import type { ApiItem, BundleType, ProfileId } from "@arcgis/languages-api-utils";
11
+ import type { ProfileVariableInstances, ArcadeServices } from "@arcgis/core/arcade.js";
12
12
 
13
- /** The editor profile strings. */
14
- export type ProfileStrings = ReturnType<typeof profileStrings>;
13
+ export type Diagnostic = ArcadeLanguageServiceDiagnostic;
15
14
 
16
15
  /**
17
16
  * Editor Profile definition used for configuring the editor:
@@ -38,15 +37,24 @@ export interface IEditorProfileDefinition {
38
37
  hiddenApiItems?: string[];
39
38
  }
40
39
 
41
- /** The type of variables supported. */
42
- export type ProfileVariableType = ApiVariableType;
40
+ export interface IPredefinedProfile {
41
+ /** The well known profile ID. */
42
+ id: ProfileId;
43
+ /** The variables that should be disabled for the profile. */
44
+ disabledVariables?: string[];
45
+ /** Provides the definitions for the definition based variables (feature, featureSet, featureSetCollection). */
46
+ definitions: VariableDefinitions;
47
+ /** A collection of api item names to hide. */
48
+ hiddenApiItems?: string[];
49
+ }
43
50
 
44
51
  /** The type of value variables supported. */
45
52
  export type ProfileVariableValueType = "boolean" | "date" | "dateOnly" | "geometry" | "knowledgeGraph" | "number" | "text" | "time";
46
53
 
47
54
  /**
48
55
  * The supported profile variable types.
49
- * TODO: hopefully align with \@arcgis/core's Variable type in the future.
56
+ *
57
+ * @internalremarks TODO: hopefully align with \@arcgis/core's Variable type in the future
50
58
  */
51
59
  export type IProfileVariable = IProfileArray | IProfileDictionary | IProfileFeature | IProfileFeatureSet | IProfileFeatureSetCollection | IProfilePixel | IProfileValue | IProfileVoxel;
52
60
 
@@ -60,7 +68,7 @@ export interface IProfileVariableBase {
60
68
 
61
69
  /** Single value profile variable declaration. */
62
70
  export interface IProfileValue extends IProfileVariableBase {
63
- readonly type: "boolean" | "date" | "dateOnly" | "geometry" | "knowledgeGraph" | "number" | "text" | "time";
71
+ readonly type: ProfileVariableValueType;
64
72
  }
65
73
 
66
74
  /** Dictionary profile variable declaration. Properties of a dictionary are profile variables. */
@@ -110,23 +118,17 @@ export interface IProfileFeatureSetCollection extends IProfileVariableBase {
110
118
  definition?: FeatureSetCollectionDefinition;
111
119
  }
112
120
 
113
- /**
114
- * Voxel profile variable declaration.
115
- * Voxel contains values that can be accessed by a name (aka field name or attribute name).
116
- */
121
+ /** Voxel profile variable declaration. */
117
122
  export interface IProfileVoxel extends IProfileVariableBase {
118
123
  readonly type: "voxel";
119
- /** Describes how the editor will find the definition for the feature. */
124
+ /** Describes how the editor will find the definition for the voxel. */
120
125
  definition?: VoxelDefinition;
121
126
  }
122
127
 
123
- /**
124
- * Pixel profile variable declaration.
125
- * Pixel contains values that can be accessed by a name (aka field name or attribute name).
126
- */
128
+ /** Pixel profile variable declaration. */
127
129
  export interface IProfilePixel extends IProfileVariableBase {
128
130
  readonly type: "pixel";
129
- /** Describes how the editor will find the definition for the feature. */
131
+ /** Describes how the editor will find the definition for the pixel. */
130
132
  definition?: PixelDefinition;
131
133
  }
132
134
 
@@ -172,7 +174,10 @@ export type IFieldsDefinition = Pick<FeatureLayer, "fields">;
172
174
  */
173
175
  export type FeatureDefinition = IFeatureLayerItemDefinition | IFieldsDefinition | IUrlDefinition;
174
176
 
175
- /** VoxelDefinition represents various ways a Voxel variable could be defined. */
177
+ /**
178
+ * VoxelDefinition represents various ways a Voxel variable could be defined.
179
+ * Layer instance is the most common way to define a voxel.
180
+ */
176
181
  export type VoxelDefinition = IFeatureLayerItemDefinition | IUrlDefinition | VoxelLayer;
177
182
 
178
183
  /** PixelDefinition represents various ways a Pixel variable could be defined. */
@@ -190,205 +195,57 @@ export type FeatureSetDefinition = IFeatureLayerItemDefinition | IFieldsDefiniti
190
195
  */
191
196
  export type FeatureSetCollectionDefinition = IPortalItemDefinition | IUrlDefinition | Map | WebMap | WebScene;
192
197
 
198
+ /** A collection of variables that make up a profile definition. */
193
199
  export type VariableDefinitions = Record<string, FeatureDefinition | FeatureSetCollectionDefinition | FeatureSetDefinition | IProfileVariable[] | undefined>;
194
200
 
195
- export interface IPredefinedProfile {
196
- /** The well known profile ID. */
197
- id: ProfileId;
198
- /** The variables that should be disabled for the profile. */
199
- disabledVariables?: string[];
200
- /** Provides the definitions for the definition based variables (feature, featureSet, featureSetCollection). */
201
- definitions: VariableDefinitions;
202
- /** A collection of api item names to hide. */
203
- hiddenApiItems?: string[];
201
+ export interface IExtendedPredefinedProfile extends IPredefinedProfile {
202
+ additionalVariables?: IProfileVariable[];
204
203
  }
205
204
 
206
- export type IndexedProfileStrings = ProfileStrings
207
- & Record<string, string | undefined>;
208
-
209
- /** Describe the support source for some of the editor variables. */
210
- export type SupportedSource = IFieldsDefinition;
211
-
212
- /** Describe the supported source for pixel variables */
213
- export type SupportedPixelSource = ImageryLayer | ImageryTileLayer;
214
-
215
- /** Describe the supported source for voxel variables */
216
- export type SupportedVoxelSource = VoxelLayer;
217
-
218
- /** Layer that supports title. */
219
- export type ITitleCapableSource = Pick<Layer, "title">;
220
-
221
- /** Layer that supports url. */
222
- export type IUrlCapableSource = Pick<FeatureLayer, "url">;
223
-
224
- /** Layer that supports layer id. */
225
- export type ILayerIdCapableSource = Pick<FeatureLayer, "layerId">;
226
-
227
- /** Layer that supports queryFeatures */
228
- export interface IFeatureLayerLikeInstance extends IFieldsDefinition, ITitleCapableSource {
229
- /** The declared class of the layer. */
230
- declaredClass: string;
231
- /** The unique ID assigned to the layer. */
232
- id: string;
233
- /** The layer ID, or layer index, of a Feature Service layer. */
234
- layerId?: number | null;
235
- /** Executes a Query against the feature service and returns a Promise to a FeatureSet. */
236
- queryFeatures: FeatureLayer["queryFeatures"];
237
- /** The service's metadata JSON exposed by the ArcGIS REST API. */
238
- sourceJSON?: unknown;
205
+ export interface IEditorCodeSuggestionGroup {
206
+ /** Label for the suggestion group */
207
+ label: string;
208
+ /** List of suggestions for the group */
209
+ suggestions: IEditorCodeSuggestion[];
239
210
  }
240
211
 
241
- /** Layer that supports field domains. */
242
- export interface IDomainsCapableSource {
243
- /** Returns the Domain associated with the given field name. */
244
- getFieldDomain: (fieldName: string) => Domain | null;
212
+ export interface IEditorCodeSuggestion {
213
+ /** A short label for the suggestion. Can be thought as a title */
214
+ label: string;
215
+ /** A short description that will be showed below the label in the list of suggestions panel */
216
+ description?: string;
217
+ /** Markdown string that will be rendered along with the code in the detail panel */
218
+ documentation?: string;
219
+ /** The code for the suggestion. Will be injected in the editor is selected */
220
+ code: string;
245
221
  }
246
222
 
247
- /** Layer that implements types */
248
- export type IFeatureTypesCapableSource = IDomainsCapableSource
249
- & Pick<FeatureLayer, "typeIdField" | "types">;
250
-
251
- /** Layer that has a subtype field */
252
- export type ISubtypeFieldCapableSource = IDomainsCapableSource
253
- & Pick<FeatureLayer, "subtypeField">;
254
-
255
- /** Layer that exposes subtypes. */
256
- export type ISubtypesCapableSource = ISubtypeFieldCapableSource
257
- & Pick<FeatureLayer, "subtypes">;
258
-
259
- /** Layer that supports relationships. */
260
- export type IRelationshipsCapableSource = ILayerIdCapableSource
261
- & IUrlCapableSource
262
- & Pick<FeatureLayer, "relationships">;
263
-
264
- /** Layer that is capable of being non-spatial. */
265
- export type ITableCapableSource = Pick<FeatureLayer, "isTable">;
266
-
267
- /** Layer that is capable of having geometry */
268
- export type IGeometryCapableSource = Pick<FeatureLayer, "geometryType">
269
- & {
270
- isTable?: false;
271
- };
272
-
273
- /** An instance that requires a load operation to be performed. */
274
- export type ILoadableSource = Pick<Layer, "load">;
223
+ export type SidePanelName = "api" | "none" | "suggestions" | "variables";
275
224
 
276
- /** An instance that requires a loadAll operation to be performed. */
277
- export type ILoadAllCapable = Pick<WebMap | WebScene, "loadAll">;
278
-
279
- /** An instance that is based on a portal item. */
280
- export type IPortalItemCapable = Pick<PortalItemResource, "portalItem">;
281
-
282
- /** An instance that exposes all layers and tables collections. */
283
- export type IGroupLayerCapable = Pick<Map, "allLayers" | "allTables">;
284
-
285
- /** Represents a string that will have to be manufactured from a Intl strings resource. */
286
- export interface IIntlString {
287
- /** The intl code in the Intl strings resource. */
288
- code: string;
225
+ export interface IContextReferences {
289
226
  /**
290
- * The properties that the Intl string may leverage during the composition of the string.
291
- * Example:
292
- * - the intl string is defined as: "webmaptitle": "Web Map - {title}"
293
- * - the formatValues should be an object `{title: "California Fires"}`
227
+ * Spatial reference object used to define the spatial reference for the arcade runtime.
228
+ * By defaults, the spatial reference is set to Web Mercator (wkid: 3857).
294
229
  */
295
- formatValues?: Record<string, string>;
296
- }
297
-
298
- /** The bare minimum interface for layer information coming from the rest API. */
299
- export interface LayerInfo {
300
- id: number;
301
- type: string;
302
- capabilities?: string;
303
- }
304
-
305
- export interface IExtendedPredefinedProfile extends IPredefinedProfile {
306
- additionalVariables?: IProfileVariable[];
230
+ spatialReference?: SpatialReference | { wkid: number; } | null;
231
+ /**
232
+ * Defines the default time zone in which to create and display Arcade date types.
233
+ * By default, the time zone is set to "system".
234
+ */
235
+ timeZone?: string;
236
+ /** Defines the "services" passed to the arcade executor. */
237
+ services?: ArcadeServices;
307
238
  }
308
239
 
309
240
  /**
310
- * Represents the policy for an editor profile. The policy can influence specific configuration and loading behavior of the editor profile.
311
- *
312
- * @privateremarks Currently we use this to ignore specific layers in feature set variables for arcade profiles, but the concept is extensible to other configuration and loading behavior in the future.
241
+ * If a profile doesn't contain a map, the spatial reference of geometries will be defaulted to
242
+ * wkid: 3857.
243
+ * The test context objects allows to set the execution spatial reference for such scenario.
313
244
  */
314
- export interface IProfilePolicy {
245
+ export interface IEditorTestContext extends IContextReferences {
315
246
  /**
316
- * A hook to filter layers to be included in a feature set collection
317
- * that source from a map
318
- *
319
- * @privateremarks
320
- * see https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/10715 for a use case.
321
- * In arcade we don't want to include certain layer types in the $map variable.
247
+ * An object of key/value pairs where the key is the name of a profile variable.
248
+ * The key's value must be of type ArcGIS core ProfileVariableInstance.
322
249
  */
323
- filterFsCollectionLayersFromMap?: (layer: Layer) => boolean;
324
- }
325
-
326
- export const profileStrings: (value: {
327
- layer: string;
328
- featureservice: string;
329
- mapservice: string;
330
- map: string;
331
- webmap: string;
332
- webscene: string;
333
- webmapformat: string;
334
- item: string;
335
- invoking: string;
336
- fields: string;
337
- values: string;
338
- relationships: string;
339
- layers: string;
340
- tables: string;
341
- geometry: string;
342
- dictionary: string;
343
- feature: string;
344
- featureset: string;
345
- featuresetcollection: string;
346
- oid: string;
347
- number: string;
348
- string: string;
349
- date: string;
350
- blob: string;
351
- raster: string;
352
- guid: string;
353
- "global-id": string;
354
- xml: string;
355
- function: string;
356
- domainvalues: string;
357
- subtypes: string;
358
- domainvaluesfortypeformat: string;
359
- domainvaluesbysubtypes: string;
360
- }) => {
361
- layer: string;
362
- featureservice: string;
363
- mapservice: string;
364
- map: string;
365
- webmap: string;
366
- webscene: string;
367
- webmapformat: string;
368
- item: string;
369
- invoking: string;
370
- fields: string;
371
- values: string;
372
- relationships: string;
373
- layers: string;
374
- tables: string;
375
- geometry: string;
376
- dictionary: string;
377
- feature: string;
378
- featureset: string;
379
- featuresetcollection: string;
380
- oid: string;
381
- number: string;
382
- string: string;
383
- date: string;
384
- blob: string;
385
- raster: string;
386
- guid: string;
387
- "global-id": string;
388
- xml: string;
389
- function: string;
390
- domainvalues: string;
391
- subtypes: string;
392
- domainvaluesfortypeformat: string;
393
- domainvaluesbysubtypes: string;
394
- };
250
+ profileVariableInstances: ProfileVariableInstances;
251
+ }