@arcgis/coding-components 5.0.0-next.136 → 5.0.0-next.138

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 (176) hide show
  1. package/dist/addons/arcade-coding-assistant/useArcadeAssistant.d.ts +7 -17
  2. package/dist/addons/index.d.ts +2 -2
  3. package/dist/addons.js +1 -1
  4. package/dist/cdn/{UCG4NPRP.js → 2263YYN4.js} +2 -2
  5. package/dist/cdn/{FV6JUYSW.js → 2BB3QRVG.js} +2 -2
  6. package/dist/cdn/{Q4UHUY3T.js → 2E4AQ7LP.js} +2 -2
  7. package/dist/cdn/{EZGAUSIF.js → 46IOYPYQ.js} +2 -2
  8. package/dist/cdn/{DSHANUYF.js → 4FUSZCAD.js} +2 -2
  9. package/dist/cdn/{22DCBJ5F.js → 7EGGU2CS.js} +2 -2
  10. package/dist/cdn/{J2DLUEJO.js → 7F5ICS2R.js} +2 -2
  11. package/dist/cdn/{UI5EVXFU.js → 7YIS622N.js} +2 -2
  12. package/dist/cdn/{36Y75YKB.js → AU6VAVFX.js} +2 -2
  13. package/dist/cdn/{TZYBHRPS.js → B6MSWJY2.js} +2 -2
  14. package/dist/cdn/{U77BQSD4.js → BMKVGGGT.js} +2 -2
  15. package/dist/cdn/{MEXDPC7D.js → BTLRRKDQ.js} +1 -1
  16. package/dist/cdn/{HSBLYEZV.js → CP4WW3L6.js} +2 -2
  17. package/dist/cdn/{RIEACZTY.js → DQ2MOHDK.js} +2 -2
  18. package/dist/cdn/{UMHPBSPW.js → EFNX7T2R.js} +1 -1
  19. package/dist/cdn/{TV544T2R.js → EQV3M2CA.js} +2 -2
  20. package/dist/cdn/{PP7BAX5L.js → EZ5XJTDZ.js} +2 -2
  21. package/dist/cdn/{TGBYUAUR.js → GAJRGYGF.js} +2 -2
  22. package/dist/cdn/{XLQLW2QL.js → HHKNAKMH.js} +2 -2
  23. package/dist/cdn/{H3N4UPAY.js → IAOEXBRW.js} +3 -3
  24. package/dist/cdn/{UZMYMIUN.js → ICT2QXVB.js} +2 -2
  25. package/dist/cdn/{PWTWO4LQ.js → IL3ODH4Q.js} +2 -2
  26. package/dist/cdn/{RFPCEKOB.js → J5BB2DTX.js} +2 -2
  27. package/dist/cdn/{ZWJAHBIF.js → JGRG3RTL.js} +2 -2
  28. package/dist/cdn/{YTFTM7FZ.js → KCG4J2TQ.js} +1 -1
  29. package/dist/cdn/{5N7BLQUC.js → KY2A6GJX.js} +1 -1
  30. package/dist/cdn/{CUWBQ6DE.js → LZEK7RTW.js} +2 -2
  31. package/dist/cdn/M2XE3C7T.js +6 -0
  32. package/dist/cdn/{VDMEGRHB.js → MBTVAM7I.js} +2 -2
  33. package/dist/cdn/N3P4PLZT.js +4 -0
  34. package/dist/cdn/{JYHLAFWX.js → NB4EJVRJ.js} +2 -2
  35. package/dist/cdn/{ZBKMCGR7.js → NGXPOKHF.js} +2 -2
  36. package/dist/cdn/{PR666JT5.js → NM7YCIBL.js} +2 -2
  37. package/dist/cdn/{A7BGWNLB.js → OAY75OXY.js} +2 -2
  38. package/dist/cdn/{MMSAWKPK.js → OHULNXEE.js} +2 -2
  39. package/dist/cdn/{OZZYHIPM.js → QN4HJ3GS.js} +1 -1
  40. package/dist/cdn/{ZB3AQDM2.js → RVGC5EOD.js} +2 -2
  41. package/dist/cdn/{Q6ERATMA.js → TBZNDJPR.js} +2 -2
  42. package/dist/cdn/{OCXFKC66.js → TFP62745.js} +1 -1
  43. package/dist/cdn/{ZLUCSP73.js → TXSPPN6R.js} +2 -2
  44. package/dist/cdn/{4RJPAWSA.js → UV5OY4GJ.js} +2 -2
  45. package/dist/cdn/W5PHIIDU.js +4 -0
  46. package/dist/cdn/{Q54H2UGW.js → X6STFO7U.js} +2 -2
  47. package/dist/cdn/{MGX5UEEJ.js → Y3CNVWXF.js} +3 -3
  48. package/dist/cdn/{HEOVDTIB.js → YOZZJZW5.js} +2 -2
  49. package/dist/cdn/{OAJKP3TF.js → Z2EROYP7.js} +1 -1
  50. package/dist/cdn/{224QUA5Z.js → Z45QIMDD.js} +2 -2
  51. package/dist/cdn/{OCZIBXWV.js → ZEXTPWCM.js} +1 -1
  52. package/dist/cdn/index.js +2 -2
  53. package/dist/chunks/arcade-defaults.js +2 -2
  54. package/dist/chunks/arcade-executor.js +1 -1
  55. package/dist/chunks/arcade-mode.js +1 -1
  56. package/dist/chunks/arcade-service-accessors.js +1 -1
  57. package/dist/chunks/colorize.js +1 -1
  58. package/dist/chunks/fields.js +1 -1
  59. package/dist/chunks/language-defaults-base.js +3 -3
  60. package/dist/chunks/markdown.js +1 -1
  61. package/dist/chunks/monaco-importer.js +1 -1
  62. package/dist/chunks/monaco-theme.js +1 -1
  63. package/dist/chunks/runtime.js +1 -1
  64. package/dist/chunks/{arcade-contribution.js → setup-monaco-theme.js} +40 -40
  65. package/dist/chunks/sql-expr-defaults.js +2 -2
  66. package/dist/chunks/sql-expr-mode.js +1 -1
  67. package/dist/chunks/sql-expr-service-accessors.js +1 -1
  68. package/dist/chunks/useT9n.js +1 -1
  69. package/dist/chunks/utilities.js +1 -1
  70. package/dist/components/arcgis-arcade-coding-assistant/customElement.js +1 -1
  71. package/dist/components/arcgis-arcade-coding-assistant/types.d.ts +3 -48
  72. package/dist/components/arcgis-arcade-editor/customElement.d.ts +123 -112
  73. package/dist/components/arcgis-arcade-editor/customElement.js +2 -2
  74. package/dist/components/arcgis-arcade-editor/index.d.ts +0 -13
  75. package/dist/components/arcgis-arcade-results/customElement.js +7 -7
  76. package/dist/components/arcgis-arcade-suggestions/customElement.js +1 -1
  77. package/dist/components/arcgis-code-editor/customElement.d.ts +74 -81
  78. package/dist/components/arcgis-code-editor/customElement.js +3 -3
  79. package/dist/components/arcgis-code-editor-shell/customElement.d.ts +9 -5
  80. package/dist/components/arcgis-code-editor-shell/customElement.js +1 -1
  81. package/dist/components/arcgis-code-viewer/customElement.d.ts +23 -37
  82. package/dist/components/arcgis-code-viewer/customElement.js +2 -2
  83. package/dist/components/arcgis-editor-variables/customElement.js +1 -1
  84. package/dist/components/arcgis-language-api-panel/customElement.js +1 -1
  85. package/dist/components/arcgis-sql-expression-editor/customElement.d.ts +53 -49
  86. package/dist/components/arcgis-sql-expression-editor/customElement.js +1 -1
  87. package/dist/components/arcgis-sql-expression-editor/index.d.ts +0 -7
  88. package/dist/components/arcgis-sql-expression-fields/customElement.js +1 -1
  89. package/dist/docs/api.json +1 -1470
  90. package/dist/docs/docs.json +1 -1381
  91. package/dist/docs/vscode.css-custom-data.json +1 -35
  92. package/dist/docs/vscode.html-custom-data.json +1 -119
  93. package/dist/docs/web-types.json +1 -385
  94. package/dist/index.d.ts +34 -21
  95. package/dist/index.js +1 -1
  96. package/dist/loader.js +7 -7
  97. package/dist/types/lumina.d.ts +11 -11
  98. package/dist/types/preact.d.ts +11 -11
  99. package/dist/types/react.d.ts +11 -11
  100. package/dist/types/stencil.d.ts +11 -11
  101. package/dist/utils/arcade-assistant/types.d.ts +8 -72
  102. package/dist/utils/arcade-executor.d.ts +158 -126
  103. package/dist/utils/arcade-monaco/arcade-defaults.d.ts +9 -49
  104. package/dist/utils/custom-panel.d.ts +35 -30
  105. package/dist/utils/editor-suggestions.d.ts +17 -28
  106. package/dist/utils/index.d.ts +4 -6
  107. package/dist/utils/profile/types.d.ts +273 -345
  108. package/dist/utils/sql-expr-monaco/sql-expr-defaults.d.ts +8 -22
  109. package/package.json +6 -6
  110. package/dist/addons/arcade-coding-assistant/chat-helper.d.ts +0 -78
  111. package/dist/addons/arcade-coding-assistant/index.d.ts +0 -2
  112. package/dist/addons/arcade-coding-assistant/temporary-strings.d.ts +0 -47
  113. package/dist/cdn/2WNWZ6AD.js +0 -4
  114. package/dist/cdn/EGURZWSY.js +0 -4
  115. package/dist/cdn/TIR4RXVC.js +0 -6
  116. package/dist/components/arcgis-arcade-coding-assistant/customElement.d.ts +0 -45
  117. package/dist/components/arcgis-arcade-coding-assistant/functional.d.ts +0 -235
  118. package/dist/components/arcgis-arcade-coding-assistant/index.d.ts +0 -27
  119. package/dist/components/arcgis-arcade-results/customElement.d.ts +0 -32
  120. package/dist/components/arcgis-arcade-results/functional.d.ts +0 -73
  121. package/dist/components/arcgis-arcade-results/index.d.ts +0 -10
  122. package/dist/components/arcgis-arcade-suggestions/customElement.d.ts +0 -24
  123. package/dist/components/arcgis-arcade-suggestions/index.d.ts +0 -10
  124. package/dist/components/arcgis-editor-variables/customElement.d.ts +0 -40
  125. package/dist/components/arcgis-editor-variables/index.d.ts +0 -10
  126. package/dist/components/arcgis-language-api-panel/customElement.d.ts +0 -42
  127. package/dist/components/arcgis-language-api-panel/index.d.ts +0 -11
  128. package/dist/components/arcgis-sql-expression-fields/customElement.d.ts +0 -23
  129. package/dist/components/arcgis-sql-expression-fields/index.d.ts +0 -7
  130. package/dist/controllers/useT9n.d.ts +0 -1
  131. package/dist/runtime.d.ts +0 -6
  132. package/dist/utils/arcade-assistant/aiContext.d.ts +0 -6
  133. package/dist/utils/arcade-assistant/constants.d.ts +0 -2
  134. package/dist/utils/arcade-assistant/utils.d.ts +0 -9
  135. package/dist/utils/arcade-monaco/arcade-contribution.d.ts +0 -1
  136. package/dist/utils/arcade-monaco/arcade-language-features.d.ts +0 -35
  137. package/dist/utils/arcade-monaco/arcade-language-syntax.d.ts +0 -3
  138. package/dist/utils/arcade-monaco/arcade-mode.d.ts +0 -29
  139. package/dist/utils/arcade-monaco/arcade-profile-strategy.d.ts +0 -12
  140. package/dist/utils/arcade-monaco/arcade-service-accessors.d.ts +0 -31
  141. package/dist/utils/arcade-monaco/arcade-worker-manager.d.ts +0 -22
  142. package/dist/utils/arcade-monaco/arcade.worker.d.ts +0 -23
  143. package/dist/utils/arcade-monaco/types.d.ts +0 -9
  144. package/dist/utils/colorize.d.ts +0 -5
  145. package/dist/utils/constants.d.ts +0 -3
  146. package/dist/utils/css-vars.d.ts +0 -7
  147. package/dist/utils/fields.d.ts +0 -20
  148. package/dist/utils/internal-monaco-apis.d.ts +0 -67
  149. package/dist/utils/language-defaults-base.d.ts +0 -76
  150. package/dist/utils/markdown.d.ts +0 -6
  151. package/dist/utils/monaco-importer.d.ts +0 -28
  152. package/dist/utils/monaco-languages.d.ts +0 -17
  153. package/dist/utils/monaco-theme.json.d.ts +0 -27
  154. package/dist/utils/monaco-typings.d.ts +0 -8
  155. package/dist/utils/patch-monaco.d.ts +0 -16
  156. package/dist/utils/profile/editor-profile.d.ts +0 -278
  157. package/dist/utils/profile/utils.d.ts +0 -49
  158. package/dist/utils/setup-monaco-theme.d.ts +0 -1
  159. package/dist/utils/setup-monaco.d.ts +0 -31
  160. package/dist/utils/sql-expr-monaco/sql-expr-completion.d.ts +0 -74
  161. package/dist/utils/sql-expr-monaco/sql-expr-constants.d.ts +0 -67
  162. package/dist/utils/sql-expr-monaco/sql-expr-contribution.d.ts +0 -1
  163. package/dist/utils/sql-expr-monaco/sql-expr-language-features.d.ts +0 -23
  164. package/dist/utils/sql-expr-monaco/sql-expr-language-syntax.d.ts +0 -3
  165. package/dist/utils/sql-expr-monaco/sql-expr-mode.d.ts +0 -43
  166. package/dist/utils/sql-expr-monaco/sql-expr-parser-utils.d.ts +0 -36
  167. package/dist/utils/sql-expr-monaco/sql-expr-profile-utils.d.ts +0 -5
  168. package/dist/utils/sql-expr-monaco/sql-expr-service-accessors.d.ts +0 -19
  169. package/dist/utils/sql-expr-monaco/sql-expr-validation-diagnostic-adapter.d.ts +0 -33
  170. package/dist/utils/sql-expr-monaco/sql-expr-validation-utils.d.ts +0 -82
  171. package/dist/utils/sql-expr-monaco/sql-expr-validation.d.ts +0 -41
  172. package/dist/utils/sql-expr-monaco/sql-expr-worker-manager.d.ts +0 -22
  173. package/dist/utils/sql-expr-monaco/sql-expr.worker.d.ts +0 -22
  174. package/dist/utils/sql-expr-monaco/sql-expression-profile-strategy.d.ts +0 -13
  175. package/dist/utils/sql-expr-monaco/types.d.ts +0 -96
  176. package/dist/utils/utilities.d.ts +0 -16
@@ -1,76 +0,0 @@
1
- import { Emitter, Uri } from '../utils/monaco-importer';
2
- import { IEvent } from 'monaco-editor';
3
- import { EditorProfile } from './profile/editor-profile';
4
- import { ApiCategory, ApiContext, ApiSnippet } from '@arcgis/languages-api-utils';
5
- import { IEditorProfileDefinition, IPredefinedProfile } from './profile/types';
6
- export interface WorkerHost {
7
- getApiLibrary: (locale: string) => Promise<ApiCategory[]>;
8
- }
9
- export interface ApiConfig {
10
- apiPath: string;
11
- apiPrefix: string;
12
- }
13
- export declare abstract class LanguageDefaultsBase<TApiContext extends ApiContext = ApiContext> {
14
- readonly languageId: string;
15
- private _apiConfig;
16
- protected _onDidChange: Emitter<this>;
17
- protected _modelToProfileMap: Map<string, EditorProfile>;
18
- protected _modelToApiContextMap: Map<string, TApiContext>;
19
- protected _localeToApiLibraryPromiseMap: Map<"id" | "es" | "de" | "da" | "sl" | "fi" | "ca" | "ar" | "it" | "el" | "th" | "et" | "sk" | "en" | "sv" | "fr" | "he" | "cs" | "lt" | "no" | "pl" | "ro" | "ru" | "tr" | "vi" | "bs" | "hr" | "bg" | "hu" | "ja" | "ko" | "lv" | "nl" | "nb" | "pt-BR" | "pt-PT" | "sr" | "uk" | "zh-CN" | "zh-HK" | "zh-TW", Promise<ApiCategory[]>>;
20
- protected _onModelContextDidChange: Emitter<string>;
21
- protected _onDidModelContextChangeTimeout: number;
22
- constructor(languageId: string, _apiConfig: ApiConfig);
23
- protected _fireModelContextDidChange(key: string): void;
24
- protected _getApiKey(modelId: Uri | string): string;
25
- get onDidChange(): IEvent<this>;
26
- /**
27
- * Dispose any cached resources for the model
28
- */
29
- disposeForModel(modelId: Uri | string): void;
30
- /**
31
- * Returns the editor profile for the given model id.
32
- * @param modelId The model id for which to get the editor profile.
33
- * @returns The editor profile for the model.
34
- */
35
- getEditorProfileForModel(modelId: Uri | string): EditorProfile | undefined;
36
- /**
37
- * Returns the API context for the given model id.
38
- * Returns the default context if the model has no context.
39
- * @param modelId The model id for which to get the API context.
40
- * @returns The API context for the model.
41
- */
42
- getApiContextForModel(contextId: Uri | string): TApiContext;
43
- /**
44
- * Set or update api context for the given model id.
45
- * @param modelId The model id for which to set the context.
46
- * @param apiContext The api context to set.
47
- */
48
- updateApiContextForModel(modelId: Uri | string, apiContext: TApiContext): void;
49
- get onModelContextDidChange(): IEvent<string>;
50
- /**
51
- * Gets the API library for the given model id.
52
- * @param modelId The model id for which to get the API library.
53
- * @returns The API library for the model.
54
- */
55
- getApiLibraryForModel(modelId: string): Promise<ApiCategory[]>;
56
- /**
57
- * The worker host is used by the worker to invoke methods on the main thread.
58
- */
59
- workerHost: WorkerHost;
60
- private fetchApiLibrary;
61
- private getApiLibrary;
62
- /**
63
- * Create an EditorProfile for the given model id using the given definition and locale.
64
- * The EditorProfile is used by the the Language service as well by the components.
65
- * The definition can be a pre-defined profile or an editor profile definition.
66
- * If the locale is not provided then the 'en' locale is used.
67
- * @param modelId The model id for which to create the context.
68
- * @param definition The definition to use for the model context.
69
- * @param locale The locale to use for the model context.
70
- * @returns The EditorProfile for the model.
71
- */
72
- abstract setProfileForModel(modelId: Uri | string, definition: IEditorProfileDefinition | IPredefinedProfile | undefined, apiContext: {
73
- locale: string;
74
- snippets?: ApiSnippet[];
75
- }): Promise<void>;
76
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * Converts a markdown string to HTML using the marked library.
3
- */
4
- export declare function convertMarkdownString(value: string | {
5
- value: string;
6
- } | null | undefined): string;
@@ -1,28 +0,0 @@
1
- import { editor } from 'monaco-editor';
2
- /**
3
- * This file is used to consolidate monaco-editor imports into one place.
4
- * It was created to fix an issue in the esbuild bundle splitting, where the
5
- * Monaco editor was being included in multiple chunks, causing the editor to
6
- * load certain modules before some standalone services were registered.
7
- *
8
- * @remarks
9
- * At first we tried doing the editor export via a top level await
10
- * ```
11
- * const { editor } = await import("monaco-editor/esm/vs/editor/editor.api");
12
- * export { editor };
13
- * ```
14
- * It worked for us, but downstream consumers were not configured for top level await
15
- * and encountered errors thus we export `importMonacoEditor`.
16
- */
17
- export { KeyCode, KeyMod, Range, Uri, Emitter, languages, MarkerSeverity } from 'monaco-editor';
18
- /**
19
- * Importing .js files here to avoid issues that arise from tree shaking issues
20
- */
21
- export { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
22
- export { IStandaloneThemeService } from 'monaco-editor/esm/vs/editor/standalone/common/standaloneTheme.js';
23
- export { IHoverService } from 'monaco-editor/esm/vs/platform/hover/browser/hover.js';
24
- export { generateTokensCSSForColorMap } from 'monaco-editor/esm/vs/editor/common/languages/supports/tokenization.js';
25
- export * as dom from 'monaco-editor/esm/vs/base/browser/dom.js';
26
- export { EditorMouseEvent, EditorMouseEventFactory } from 'monaco-editor/esm/vs/editor/browser/editorDom.js';
27
- export { MouseTargetFactory } from 'monaco-editor/esm/vs/editor/browser/controller/mouseTarget.js';
28
- export declare function importMonacoEditor(): Promise<typeof editor>;
@@ -1,17 +0,0 @@
1
- /** Mark a language as fully initialized (should be called after mode.setupMode). */
2
- export declare function markLanguageReady(languageId: string): void;
3
- /** Await the full initialization of the language (tokens/providers registered). */
4
- export declare function whenLanguageReady(languageId: string): Promise<void>;
5
- /**
6
- * helper to track the languages that have been encountered in monaco-editor.
7
- * Useful for wrapping callbacks passed to monaco's languages.onLanguage function.
8
- * See arcade-contribution for usage.
9
- */
10
- export declare function withLanguageTracking(languageId: string, registerCallback: () => void): () => void;
11
- /**
12
- * Sets up the language in the editor outside of the editor.
13
- * This is useful for when the editor is not present, but we still want to use the language features, like theming.
14
- * We do this by creating a model with the languageId and then disposing of it.
15
- * See usage in {@link ArcgisLanguageApiPanel}.
16
- */
17
- export declare function setupLanguageOutsideEditor(languageId: string): Promise<void>;
@@ -1,27 +0,0 @@
1
- declare const _default: {
2
- "light-theme": {
3
- "comment": "#606060",
4
- "constant": "#9809C8",
5
- "date": "#296389",
6
- "identifier": "#0000B3",
7
- "keyword": "#BF4900",
8
- "number": "#136D3D",
9
- "string": "#A31515",
10
- "operator": "#9809C8",
11
- "predefined": "#0000B3"
12
- },
13
- "dark-theme": {
14
- "comment": "#BFBFBF",
15
- "constant": "#CDBAEA",
16
- "date": "#97A6CE",
17
- "identifier": "#9FD4F3",
18
- "keyword": "#EEAA5A",
19
- "number": "#AAD04B",
20
- "string": "#F2877B",
21
- "operator": "#CDBAEA",
22
- "predefined": "#9FD4F3"
23
- }
24
- }
25
- ;
26
-
27
- export default _default;
@@ -1,8 +0,0 @@
1
- /** Declare monaco-editor modules that are not included in their public typings */
2
- declare module "monaco-editor/esm/vs/editor/common/languages/supports/tokenization.js";
3
- declare module "monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js";
4
- declare module "monaco-editor/esm/vs/editor/standalone/common/standaloneTheme.js";
5
- declare module "monaco-editor/esm/vs/platform/hover/browser/hover.js";
6
- declare module "monaco-editor/esm/vs/base/browser/dom.js";
7
- declare module "monaco-editor/esm/vs/editor/browser/editorDom.js";
8
- declare module "monaco-editor/esm/vs/editor/browser/controller/mouseTarget.js";
@@ -1,16 +0,0 @@
1
- import { IDisposable, editor as Editor } from 'monaco-editor';
2
- import { LogContext } from '@arcgis/toolkit/log';
3
- /**
4
- * Installs global Monaco monkey patches that are not tied to a specific editor instance.
5
- *
6
- * Currently includes a workaround for https://github.com/microsoft/monaco-editor/issues/4548
7
- * (Shadow DOM selection can throw during caret-range hit testing).
8
- */
9
- export declare function installMonacoGlobalPatches(logContext: LogContext): IDisposable | null;
10
- /**
11
- * Installs per-editor-instance Monaco patches.
12
- *
13
- * - Patches Monaco pointer handler behavior for Shadow DOM mouseleave tracking.
14
- * - Reapplies the patch on model changes because Monaco recreates internal View/MouseHandler.
15
- */
16
- export declare function installMonacoEditorInstancePatches(editorInstance: Editor.IStandaloneCodeEditor, logContext: LogContext): IDisposable | null;
@@ -1,278 +0,0 @@
1
- import { ApiVariableType, ApiValueVariable } from '@arcgis/languages-api-utils';
2
- import { default as WebMap } from '@arcgis/core/WebMap.js';
3
- import { default as WebScene } from '@arcgis/core/WebScene.js';
4
- import { IconName } from '../../components/arcgis-arcade-coding-assistant/types';
5
- import { default as Field } from '@arcgis/core/layers/support/Field';
6
- import { default as Map } from '@arcgis/core/Map';
7
- import { Variable } from '@arcgis/core/arcade';
8
- import type * as types from "./types";
9
- /**
10
- * FeatureSetCollection interface. Used in Arcade expressions to represent Web Maps
11
- * or Feature Services.
12
- */
13
- interface IFeatureSetCollections {
14
- /**
15
- * The collection of layers in the featureSetCollection. Layers contain features
16
- * with geometry.
17
- */
18
- layers: (FeatureSetVariable | GroupOfVariables)[];
19
- /**
20
- * The collection of tables in the featureSetCollection. Tables contain features
21
- * that don't have a geometry.
22
- */
23
- tables: (FeatureSetVariable | GroupOfVariables)[];
24
- /**
25
- * If the feature set collection represents a Web Map or a Web Scene then it will contain the instance.
26
- * If the feature set collection represents a service then it will be its URL.
27
- */
28
- source: Map | WebMap | WebScene | string;
29
- }
30
- /**
31
- * converts fields to profile values and calculates the feature completion description all in one iteration
32
- */
33
- export declare function fieldsToProfileValues(fields: Field[], initialFeatureCompletionDescription: string, includeAliases?: boolean): [ApiValueVariable[], string];
34
- export declare function membersToProfileValues(members: Variable[], initialCompletionDescription: string): [ApiValueVariable[], string];
35
- type ProfileItemType = ApiVariableType | "group";
36
- export type EditorVariable = ArrayVariable | DictionaryVariable | FeatureSetCollectionVariable | FeatureSetVariable | FeatureVariable | PixelVariable | ValueVariable | VoxelVariable;
37
- interface ConstructorProperties<T> {
38
- profile?: EditorProfile | null;
39
- declaration?: Partial<T>;
40
- label?: types.IIntlString | string | null;
41
- description?: types.IIntlString | string;
42
- snippet?: string;
43
- nonInteractive?: boolean;
44
- filterDescription?: boolean;
45
- icon?: IconName;
46
- }
47
- /**
48
- * Represents a item in the EditorProfile. The profile is converted into an optimized way for
49
- * rendering in the editor. In addition to the representation of profile variables, other
50
- * structures are created such as groups.
51
- */
52
- declare abstract class ProfileItemBase {
53
- protected _profile: EditorProfile | null | undefined;
54
- private readonly _label;
55
- protected readonly description?: (types.IIntlString | string) | undefined;
56
- abstract readonly type: ProfileItemType;
57
- protected filterDescription: boolean;
58
- /**
59
- * True if the item represents a collection of items.
60
- */
61
- abstract readonly isCollection: boolean;
62
- constructor(_profile: EditorProfile | null | undefined, _label: types.IIntlString | string | null | undefined, description?: (types.IIntlString | string) | undefined);
63
- /**
64
- * Returns the label string.
65
- */
66
- getLabel(): string;
67
- /**
68
- * Returns the description string.
69
- */
70
- getDescription(): string;
71
- /**
72
- * Returns true if the item pass the filter test
73
- */
74
- passFilter(filterExpression?: RegExp): boolean;
75
- }
76
- /**
77
- * The base class for profile variables representation in the EditorProfile.
78
- */
79
- declare abstract class VariableBase extends ProfileItemBase {
80
- abstract readonly type: ApiVariableType;
81
- readonly name: string;
82
- readonly snippet: string;
83
- /**
84
- * True if the variable doesn't can be used as snippet by the editor.
85
- */
86
- readonly nonInteractive: boolean;
87
- protected declaration: Partial<types.IProfileVariableBase>;
88
- icon: IconName | undefined;
89
- constructor(props: ConstructorProperties<types.IProfileVariableBase>);
90
- /**
91
- * Returns the IProfileVariable json representation.
92
- */
93
- abstract toProfileVariableDefinition(): types.IProfileVariable;
94
- }
95
- /**
96
- * Represents the IProfileValue.
97
- */
98
- export declare class ValueVariable extends VariableBase {
99
- type: types.ProfileVariableValueType;
100
- isCollection: false;
101
- constructor(props: ConstructorProperties<types.IProfileValue>);
102
- getDescription(): string;
103
- toProfileVariableDefinition(): types.IProfileVariable;
104
- }
105
- /**
106
- * Represents the IProfileArray. The main difference is that the IProfileValue type
107
- * is used as valueType.
108
- */
109
- export declare class ArrayVariable extends VariableBase {
110
- type: "array";
111
- isCollection: false;
112
- elementType: types.IProfileVariable;
113
- constructor(props: ConstructorProperties<types.IProfileArray>);
114
- getDescription(): string;
115
- toProfileVariableDefinition(): types.IProfileArray;
116
- }
117
- /**
118
- * Represents a collection of items. The collection of items can be synchronous or
119
- * asynchronous. If the collection is asynchronous then the collection should be
120
- * loaded by using the function 'load'. The property 'loaded' indicates if the
121
- * collection is ready or not.
122
- */
123
- export declare abstract class CollectionBasedVariable extends VariableBase {
124
- private owner;
125
- isCollection: true;
126
- protected _loaded: boolean;
127
- /**
128
- * The collection of items used to display the profile.
129
- * If the collection is asynchronous, the 'load' function should
130
- * be called first before using the items.
131
- */
132
- variables: (EditorVariable | GroupOfVariables)[];
133
- constructor(owner: CollectionBasedVariable | undefined, props: ConstructorProperties<types.IProfileVariableBase>);
134
- get breadcrumb(): string;
135
- /**
136
- * Returns true if the collection has been loaded
137
- */
138
- get loaded(): boolean;
139
- /**
140
- * Loads the items if the collection is asynchronous.
141
- * If the collection is synchronous then the function is a no-op.
142
- */
143
- abstract loadSource(): Promise<unknown>;
144
- /**
145
- * Returns an url to the associated information
146
- */
147
- get informationUrl(): string | null;
148
- get informationType(): string;
149
- }
150
- export declare class GroupOfVariables extends ProfileItemBase {
151
- variables: (EditorVariable | GroupOfVariables)[];
152
- isHeader: boolean;
153
- type: "group";
154
- isCollection: true;
155
- constructor(profile: EditorProfile | null | undefined, label: types.IIntlString | string, variables?: (EditorVariable | GroupOfVariables)[], isHeader?: boolean);
156
- passFilter(): boolean;
157
- }
158
- export declare class DictionaryVariable extends CollectionBasedVariable {
159
- type: "dictionary";
160
- /**
161
- * The variables that the dictionary holds. It is different than the variables.
162
- * The variables may contain grouping.
163
- */
164
- dictionaryVariables: EditorVariable[];
165
- constructor(owner: CollectionBasedVariable | undefined, props: ConstructorProperties<types.IProfileDictionary>);
166
- loadSource(): Promise<void>;
167
- protected loadPropertyDeclarations(declarations: types.IProfileVariable[] | undefined): void;
168
- private createVariableInstances;
169
- private createVariableInstance;
170
- toProfileVariableDefinition(): types.IProfileVariable;
171
- }
172
- interface IRelationshipsProperties {
173
- exposeRelationships: boolean;
174
- sourceTableId?: number | null;
175
- }
176
- declare abstract class SourceBasedVariable<SupportedSource = types.SupportedSource> extends CollectionBasedVariable {
177
- private relationshipsProperties?;
178
- protected _definition?: types.FeatureDefinition | types.FeatureSetDefinition;
179
- protected _source: SupportedSource | null;
180
- protected _loadPromise?: Promise<SupportedSource | null>;
181
- constructor(owner: CollectionBasedVariable | undefined, props: ConstructorProperties<types.IProfileFeature | types.IProfileFeatureSet | types.IProfilePixel | types.IProfileVoxel>, relationshipsProperties?: IRelationshipsProperties | undefined);
182
- get title(): types.IIntlString | string;
183
- get url(): string;
184
- get informationUrl(): string | null;
185
- get informationType(): string;
186
- loadSource(): Promise<SupportedSource | null>;
187
- protected abstract _loadSource(): Promise<SupportedSource | null>;
188
- private _getValueSnippet;
189
- private _getSubtypeOrDomainNameSnippet;
190
- protected _getFieldProperty(field: Field, members?: Variable[]): EditorVariable;
191
- protected _getMemberProperty(member: Variable): EditorVariable;
192
- private _getDomainDictionary;
193
- private _getSubtypeDomainDictionary;
194
- private _getFeatureTypeDomainDictionary;
195
- private _getFieldDomainDictionary;
196
- private _getTypeOrSubtypeDomainGroup;
197
- private _getCodedValueDomainGroup;
198
- private _getDomainValuesGroup;
199
- protected _createDomainDictionary(field: Field): DictionaryVariable;
200
- protected _getRelationshipsProperty(): Promise<GroupOfVariables | null>;
201
- }
202
- declare abstract class FeatureLikeVariable<T = types.SupportedSource> extends SourceBasedVariable<T> {
203
- type: types.IFeatureLikeProfile["type"];
204
- constructor(owner: CollectionBasedVariable | undefined, props: ConstructorProperties<types.IFeatureLikeProfile>, type: types.IFeatureLikeProfile["type"], relationshipOptions?: IRelationshipsProperties);
205
- get title(): types.IIntlString | string;
206
- toProfileVariableDefinition(): types.IProfileVariable;
207
- }
208
- export declare class FeatureVariable extends FeatureLikeVariable {
209
- type: "feature";
210
- constructor(owner: CollectionBasedVariable | undefined, props: ConstructorProperties<types.IFeatureLikeProfile>);
211
- protected _loadSource(): Promise<types.SupportedSource | null>;
212
- }
213
- export declare class VoxelVariable extends FeatureLikeVariable<types.SupportedVoxelSource> {
214
- type: "voxel";
215
- _source: types.SupportedVoxelSource | null;
216
- constructor(owner: CollectionBasedVariable | undefined, props: ConstructorProperties<types.IProfileVoxel>);
217
- protected _loadSource(): Promise<types.SupportedVoxelSource | null>;
218
- }
219
- export declare class PixelVariable extends FeatureLikeVariable<types.SupportedPixelSource> {
220
- type: "pixel";
221
- _source: types.SupportedPixelSource | null;
222
- constructor(owner: CollectionBasedVariable | undefined, props: ConstructorProperties<types.IProfilePixel>);
223
- protected _loadSource(): Promise<types.SupportedPixelSource | null>;
224
- }
225
- export declare class FeatureSetVariable extends SourceBasedVariable {
226
- private featureSetSnippets;
227
- type: "featureSet";
228
- protected _definition?: types.FeatureSetDefinition;
229
- constructor(owner: CollectionBasedVariable | undefined, props: ConstructorProperties<types.IProfileFeatureSet>, featureSetSnippets?: ValueVariable[], relationshipProps?: IRelationshipsProperties);
230
- get title(): types.IIntlString | string;
231
- protected _loadSource(): Promise<types.SupportedSource | null>;
232
- toProfileVariableDefinition(): types.IProfileFeatureSet;
233
- }
234
- export declare class FeatureSetCollectionVariable extends CollectionBasedVariable {
235
- type: "featureSetCollection";
236
- private _definition?;
237
- private _loadPromise?;
238
- private _featureSetCollections;
239
- constructor(owner: CollectionBasedVariable | undefined, props: ConstructorProperties<types.IProfileFeatureSetCollection>);
240
- get informationUrl(): string | null;
241
- get informationType(): string;
242
- loadSource(): Promise<IFeatureSetCollections | null>;
243
- private _loadSource;
244
- private _featureSetCollectionsFromDefinition;
245
- private _featureSetCollectionFromMap;
246
- private _featureSetCollectionFromPortalItem;
247
- private _featureSetCollectionFromUrl;
248
- private _convertWebMapLayersToVariables;
249
- private _createFeatureSetVariable;
250
- private _makeFeatureSetSnippets;
251
- toProfileVariableDefinition(): types.IProfileVariable;
252
- }
253
- /**
254
- * The EditorProfile is an object that represents an Arcade Profile.
255
- * It is used to display the profile in the editor.
256
- * It takes an IEditorProfile as a definition and a locale.
257
- * A EditorProfile instance
258
- * Some of the variables in the profile are based on layers, web maps, or feature services.
259
- * They need to be loaded asynchronously to get the metadata necessary for validation and completion.
260
- */
261
- export declare class EditorProfile extends DictionaryVariable {
262
- readonly definition: types.IEditorProfileDefinition | undefined;
263
- readonly intlStrings: types.IndexedProfileStrings;
264
- readonly locale: string;
265
- readonly policy: types.IProfilePolicy;
266
- variables: EditorVariable[];
267
- constructor(definition: types.IEditorProfileDefinition | undefined, intlStrings: types.IndexedProfileStrings, locale?: string, policy?: types.IProfilePolicy);
268
- /**
269
- * Returns true if the profile supports feature set functions for snippets.
270
- */
271
- get supportFeatureSetFunctions(): boolean;
272
- /**
273
- * Returns the EditorProfile as a json. The EditorProfile may have been updated. This function allows to
274
- * get the new json representing mutations.
275
- */
276
- toEditorProfileDefinition(): types.IEditorProfileDefinition;
277
- }
278
- export {};
@@ -1,49 +0,0 @@
1
- import { FeatureDefinition, FeatureSetCollectionDefinition, FeatureSetDefinition, VoxelDefinition, PixelDefinition } from './types';
2
- import { default as Map } from '@arcgis/core/Map';
3
- import { default as ImageryLayer } from '@arcgis/core/layers/ImageryLayer';
4
- import { default as ImageryTileLayer } from '@arcgis/core/layers/ImageryTileLayer';
5
- import { default as CodedValueDomain } from '@arcgis/core/layers/support/CodedValueDomain';
6
- import { default as InheritedDomain } from '@arcgis/core/layers/support/InheritedDomain';
7
- import { default as Subtype } from '@arcgis/core/layers/support/Subtype';
8
- import { default as VoxelLayer } from '@arcgis/core/layers/VoxelLayer';
9
- import type * as types from "./types";
10
- export declare function isFeatureLayerLikeInstance(item: unknown): item is types.IFeatureLayerLikeInstance;
11
- export declare function isGroupLayerCapable(item: unknown): item is types.IGroupLayerCapable;
12
- export declare function isMapInstance(item: unknown): item is Map;
13
- export declare function isLoadAllCapable(item: unknown): item is types.ILoadAllCapable;
14
- export declare function isPortalItemDefinition(item: unknown): item is types.IPortalItemDefinition;
15
- export declare function isFeatureLayerItemDefinition(item: unknown): item is types.IFeatureLayerItemDefinition;
16
- export declare function isFieldsDefinition(item: unknown): item is types.IFieldsDefinition;
17
- export declare function isUrlDefinition(item: unknown): item is types.IUrlDefinition;
18
- export declare function isSupportedServiceUrlDefinition(item: unknown): item is types.IUrlDefinition;
19
- export declare function isFeatureDefinition(item: unknown): item is FeatureDefinition;
20
- export declare function isVoxelDefinition(item: unknown): item is VoxelDefinition;
21
- export declare function isPixelDefinition(item: unknown): item is PixelDefinition;
22
- export declare function isFeatureSetDefinition(item: unknown): item is FeatureSetDefinition;
23
- export declare function isFeatureSetCollectionDefinition(item: unknown): item is FeatureSetCollectionDefinition;
24
- export declare function isSubtypeInstance(item: unknown): item is Subtype;
25
- export declare function isCodedValueDomainInstance(item: unknown): item is CodedValueDomain;
26
- export declare function isInheritedDomainInstance(item: unknown): item is InheritedDomain;
27
- export declare function isPredefinedProfile(item: unknown): item is types.IPredefinedProfile;
28
- export declare function isTitleCapableSource(item: unknown): item is types.ITitleCapableSource;
29
- export declare function isUrlCapableSource(item: unknown): item is types.IUrlCapableSource;
30
- export declare function isLayerIdCapableSource(item: unknown): item is types.ILayerIdCapableSource;
31
- export declare function isFeatureTypesCapableLayer(item: unknown): item is types.IFeatureTypesCapableSource;
32
- export declare function isDomainsCapableLayer(item: unknown): item is types.IDomainsCapableSource;
33
- export declare function isSubtypeFieldCapableLayer(item: unknown): item is types.ISubtypeFieldCapableSource;
34
- export declare function isSubtypesCapableLayer(item: unknown): item is types.ISubtypesCapableSource;
35
- export declare function isPortalItemCapable(item: unknown): item is types.IPortalItemCapable;
36
- export declare function isRelationshipsCapableLayer(item: unknown): item is types.IRelationshipsCapableSource;
37
- export declare function isTableCapableLayer(item: unknown): item is types.ITableCapableSource;
38
- /**
39
- * Checks if the item is a supported geometry capable layer.
40
- */
41
- export declare function isGeometryLikeLayer(item: unknown): item is types.IGeometryCapableSource;
42
- export declare function isLoadableSource(item: unknown): item is types.ILoadableSource;
43
- export declare function isVoxelLayer(item: unknown): item is VoxelLayer;
44
- export declare function isImageryLayer(item: unknown): item is ImageryLayer | ImageryTileLayer;
45
- export declare function supportedSourceFromDefinition(definition: types.FeatureDefinition | types.FeatureSetDefinition | null | undefined): Promise<types.SupportedSource | null>;
46
- export declare function serviceMetaData(url: string): Promise<{
47
- layers: types.LayerInfo[];
48
- tables: types.LayerInfo[];
49
- }>;
@@ -1 +0,0 @@
1
- export declare function setupTheme(): void;
@@ -1,31 +0,0 @@
1
- /**
2
- * The import.meta.env.DEV checks are used to include certain code only in development builds.
3
- * Vite (and other modern bundlers) statically replace import.meta.env.DEV with true (development) or false (production).
4
- * This allows bundlers to remove development-only code (such as localWorker functions) from production bundles via tree-shaking,
5
- * resulting in smaller and more efficient production builds.
6
- *
7
- * See: https://vitejs.dev/guide/env-and-mode.html#env-variables
8
- *
9
- * Note: Even if code using these imports is removed by tree-shaking, Vite still processes and builds all statically imported modules
10
- * because the module dependency graph is constructed at build time before tree-shaking occurs. This means worker files and other
11
- * statically imported assets are built and emitted, even if they are not ultimately referenced in the final bundle.
12
- *
13
- */
14
- export declare function isMonacoEnvironmentSetup(): boolean;
15
- export declare function getAssetsPath(): string | undefined;
16
- export declare const additionalLanguageWorkersMap: Map<string, string>;
17
- export declare const isViteDevMode: boolean;
18
- /**
19
- * Helper to create a web worker, handling cross-origin and bundler scenarios.
20
- *
21
- * The `localWorker` is used in environments (like Vite dev) where the worker can be instantiated as a class
22
- * (e.g., `new ArcadeWorker()`). In production or consuming apps, the worker is loaded from a URL.
23
- * This dual approach ensures compatibility across local development and deployed environments.
24
- */
25
- declare function createWorker(url: string, localWorker?: () => Worker, isViteDev?: boolean): Promise<Worker>;
26
- export declare function setupMonacoEnvironment(assetsPath: string): void;
27
- export declare function ensureHoverServiceInitialized(): void;
28
- export declare const exportsForTests: {
29
- createWorker: typeof createWorker;
30
- };
31
- export {};
@@ -1,74 +0,0 @@
1
- import { IRange, Position, languages } from 'monaco-editor';
2
- import { ApiDatabase, ApiVariable } from '@arcgis/languages-api-utils';
3
- import { ICompletionContext } from './types';
4
- import { SQLNode } from '@arcgis/core/core/sql/types';
5
- interface SqlExpressionGetCompletionsOptions {
6
- /** The parameters for the completion. */
7
- range: IRange;
8
- /** The content of the model. */
9
- modelContent: string;
10
- /** The current position of the cursor in the model. */
11
- position: Position;
12
- /** The completion context. */
13
- completionContext?: ICompletionContext;
14
- /** Whether to terminate the completion when it fails to parse. */
15
- terminateOnError?: boolean;
16
- }
17
- /**
18
- * Class used for sql expression completion
19
- */
20
- export declare class SqlExpressionCompletion {
21
- private _sdkFunctions;
22
- private _fields;
23
- constructor(sdkLibrary: ApiDatabase, fields: ApiVariable[]);
24
- /**
25
- * gets completions for the sql expression.
26
- */
27
- getCompletions({ range, modelContent, position, completionContext, terminateOnError, }: SqlExpressionGetCompletionsOptions): Promise<languages.CompletionItem[]>;
28
- /**
29
- * traverses the tree to find the node that contains the current position
30
- * @param node The current node to traverse
31
- * @param position The current position
32
- */
33
- traverse(node: SQLNode, completionContext: ICompletionContext): void;
34
- /**
35
- * gets completions by finding the context of the current node and suggesting completions based on that context
36
- */
37
- private _getCompletions;
38
- /**
39
- * utilizes peggy's error handling to provide suggestions for the user.
40
- */
41
- private handleParserFailure;
42
- /**
43
- * gets completions based on the function node
44
- * @param context the context root of the current node, see {@link identifyContextRoot}
45
- * @param slotPosition the position of the current node in the context root, see {@link getSlotPosition}
46
- * @param completionContext the completion context
47
- */
48
- private _getCompletionsFromFunction;
49
- /**
50
- * checks if the position is within the current node
51
- * @param node The current node to check
52
- * @param position The current position
53
- * @returns boolean
54
- */
55
- private _isPositionWithinNode;
56
- private _isPositionWithinSQLSourcePosition;
57
- private _suggestFields;
58
- private _suggestFunctions;
59
- private _suggestDataTypes;
60
- private _suggestDatePeriods;
61
- private _suggestTrimParts;
62
- private _suggestDateLiterals;
63
- private _suggestDateFunctions;
64
- private _suggestExpressions;
65
- private _suggestNull;
66
- private _suggestCurrentUser;
67
- /**
68
- * looks at the node and finds any children attached to it. If there are children, it will traverse them.
69
- * @param node The current node to traverse
70
- */
71
- private _traverseChildren;
72
- private _sliceToPosition;
73
- }
74
- export {};