@arcgis/coding-components 4.31.0-next.6 → 4.31.0-next.60
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/README.md +22 -3
- package/dist/arcgis-coding-components/arcgis-coding-components.esm.js +2 -2
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ar.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.bg.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.bs.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ca.json +6 -6
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.cs.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.da.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.de.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.el.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.es.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.et.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.fi.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.fr.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.he.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.hr.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.id.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.it.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ko.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.nb.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.nl.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.pl.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.pt-BR.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.pt-PT.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.ru.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sk.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sl.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sr.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.sv.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.th.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.tr.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.uk.json +5 -5
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.vi.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.zh-CN.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.zh-HK.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-language/t9n/profile.t9n.zh-TW.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-results/t9n/arcade-results.t9n.ca.json +2 -2
- package/dist/arcgis-coding-components/assets/arcade-results/t9n/arcade-results.t9n.de.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-results/t9n/arcade-results.t9n.he.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-variables/t9n/arcade-variables.t9n.ca.json +1 -1
- package/dist/arcgis-coding-components/assets/arcade-variables/t9n/arcade-variables.t9n.it.json +1 -1
- package/dist/arcgis-coding-components/assets/code-editor/arcade.worker.js +3 -3
- package/dist/arcgis-coding-components/assets/code-editor/sql-expr.worker.js +460 -7
- package/dist/arcgis-coding-components/assets/language-api-panel/t9n/language-api-panel.t9n.ca.json +1 -1
- package/dist/arcgis-coding-components/assets/sql-expression-editor/api/sql-expression-api.t9n.en.json +30 -30
- package/dist/arcgis-coding-components/assets/sql-expression-editor/t9n/sql-expression-editor.t9n.en.json +4 -0
- package/dist/arcgis-coding-components/assets/sql-expression-fields/t9n/sql-expression-fields.t9n.en.json +4 -0
- package/dist/arcgis-coding-components/index.esm.js +2 -2
- package/dist/arcgis-coding-components/p-0dfb0b51.js +6 -0
- package/dist/arcgis-coding-components/p-15ab1669.entry.js +6 -0
- package/dist/arcgis-coding-components/{p-41c932b5.js → p-2ce01944.js} +3 -3
- package/dist/arcgis-coding-components/p-324d3441.js +6 -0
- package/dist/arcgis-coding-components/{p-022df536.js → p-32f69143.js} +1 -1
- package/dist/arcgis-coding-components/p-48a82879.js +7 -0
- package/dist/arcgis-coding-components/p-49d247b3.js +68 -0
- package/dist/arcgis-coding-components/p-4aacb744.js +6 -0
- package/dist/arcgis-coding-components/p-65666d7d.entry.js +6 -0
- package/dist/arcgis-coding-components/{p-19b4f0e9.js → p-b67f1c54.js} +2 -2
- package/dist/arcgis-coding-components/{p-14ab3ed5.js → p-bd510fac.js} +1 -1
- package/dist/arcgis-coding-components/{p-10cab8d9.js → p-c02b5cb7.js} +2 -2
- package/dist/arcgis-coding-components/{p-e11999af.js → p-c79a1a66.js} +2 -2
- package/dist/arcgis-coding-components/{p-38534c31.js → p-d339d7c5.js} +3 -3
- package/dist/arcgis-coding-components/p-d39b4fa7.entry.js +6 -0
- package/dist/arcgis-coding-components/{p-8c6a6176.js → p-d3e821fe.js} +3 -3
- package/dist/arcgis-coding-components/p-ee4ad3e1.js +6 -0
- package/dist/arcgis-coding-components/{p-2a7ef2fd.js → p-f8728f4d.js} +2 -2
- package/dist/cjs/{app-globals-8991f48d.js → app-globals-2c78c6b1.js} +1 -1
- package/dist/cjs/arcade-defaults-8f210819.js +350 -0
- package/dist/cjs/{arcade-mode-ee5f5a57.js → arcade-mode-ba7da99f.js} +18 -5
- package/dist/cjs/arcgis-arcade-editor_6.cjs.entry.js +59 -103
- package/dist/cjs/arcgis-coding-components.cjs.js +5 -5
- package/dist/cjs/arcgis-sql-expression-editor.cjs.entry.js +32 -11
- package/dist/cjs/arcgis-sql-expression-fields.cjs.entry.js +16 -10
- package/dist/cjs/{css-c0ad88d7.js → css-7588aae5.js} +1 -1
- package/dist/cjs/{cssMode-deeb6f90.js → cssMode-0be00954.js} +2 -3
- package/dist/cjs/{html-be08d94a.js → html-310c2662.js} +2 -3
- package/dist/cjs/{htmlMode-f5b8239a.js → htmlMode-30d8e99b.js} +2 -3
- package/dist/cjs/{index-358de60d.js → index-cba76501.js} +203 -156
- package/dist/cjs/index.cjs.js +4 -4
- package/dist/cjs/{javascript-37d3d13f.js → javascript-2094999f.js} +3 -4
- package/dist/cjs/{jsonMode-12a2a091.js → jsonMode-389bdf05.js} +2 -3
- package/dist/cjs/{language-defaults-base-1f082ad7.js → language-defaults-base-7cb3bee2.js} +812 -1036
- package/dist/cjs/loader.cjs.js +4 -4
- package/dist/cjs/{sql-expr-defaults-dca57c68.js → sql-expr-defaults-50a75e9d.js} +226 -75
- package/dist/cjs/sql-expr-mode-0b3d7972.js +480 -0
- package/dist/cjs/{tsMode-d33a7021.js → tsMode-1ef47d68.js} +2 -3
- package/dist/cjs/{typescript-f3be2ce7.js → typescript-e19c8c21.js} +2 -3
- package/dist/components/arcade-defaults.js +239 -4
- package/dist/components/arcade-mode.js +18 -4
- package/dist/components/arcade-results.js +3 -3
- package/dist/components/arcade-suggestions.js +2 -2
- package/dist/components/arcade-variables.js +2 -2
- package/dist/components/arcgis-arcade-editor.js +21 -13
- package/dist/components/arcgis-arcade-results.js +1 -1
- package/dist/components/arcgis-arcade-suggestions.js +1 -1
- package/dist/components/arcgis-arcade-variables.js +1 -1
- package/dist/components/arcgis-assets.d.ts +26 -26
- package/dist/components/arcgis-assets.js +2 -2
- package/dist/components/arcgis-code-editor.js +1 -1
- package/dist/components/arcgis-language-api-panel.js +1 -1
- package/dist/components/arcgis-sql-expression-editor.js +33 -11
- package/dist/components/arcgis-sql-expression-fields.js +1 -1
- package/dist/components/{chunk-3IUJHIAA.js → chunk-WEX2VUZV.js} +87 -92
- package/dist/components/code-editor.js +17 -23
- package/dist/components/fields.js +4 -4
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +4 -4
- package/dist/components/language-api-panel.js +22 -4
- package/dist/components/language-defaults-base.js +61 -287
- package/dist/components/markdown.js +1 -1
- package/dist/components/sql-expr-defaults.js +77 -24
- package/dist/components/sql-expr-mode.js +294 -24950
- package/dist/components/sql-expression-fields.js +15 -8
- package/dist/components/useT9n.js +41 -2
- package/dist/components/utilities.js +1 -1
- package/dist/esm/{app-globals-3e4e0353.js → app-globals-ad05b915.js} +1 -1
- package/dist/esm/arcade-defaults-84c53fa5.js +345 -0
- package/dist/esm/{arcade-mode-4a83348d.js → arcade-mode-6fbd4168.js} +18 -5
- package/dist/esm/arcgis-arcade-editor_6.entry.js +55 -99
- package/dist/esm/arcgis-coding-components.js +6 -6
- package/dist/esm/arcgis-sql-expression-editor.entry.js +32 -11
- package/dist/esm/arcgis-sql-expression-fields.entry.js +16 -10
- package/dist/esm/{css-bad8d1c3.js → css-9731ed75.js} +1 -1
- package/dist/esm/{cssMode-68a5f601.js → cssMode-6a20bb2b.js} +2 -3
- package/dist/esm/{html-9b27df1a.js → html-b32a642f.js} +2 -3
- package/dist/esm/{htmlMode-361ad282.js → htmlMode-e39916d3.js} +2 -3
- package/dist/esm/{index-8a552796.js → index-3c00d77e.js} +203 -156
- package/dist/esm/index.js +4 -4
- package/dist/esm/{javascript-8004e14f.js → javascript-e3306e60.js} +3 -4
- package/dist/esm/{jsonMode-91a0be74.js → jsonMode-2ba190f8.js} +2 -3
- package/dist/esm/{language-defaults-base-df906b3d.js → language-defaults-base-9d97d855.js} +809 -1036
- package/dist/esm/loader.js +5 -5
- package/dist/esm/{sql-expr-defaults-ae0be602.js → sql-expr-defaults-49ca931c.js} +225 -74
- package/dist/esm/sql-expr-mode-b1ab06a1.js +476 -0
- package/dist/esm/{tsMode-2756c213.js → tsMode-6fe69b0a.js} +2 -3
- package/dist/esm/{typescript-1aaf3ddd.js → typescript-d757eb0b.js} +2 -3
- package/dist/loader/cdn.js +2 -3
- package/dist/loader/index.cjs.js +2 -3
- package/dist/loader/index.d.ts +3 -0
- package/dist/loader/index.es2017.js +2 -3
- package/dist/loader/index.js +2 -3
- package/dist/types/components/arcade-editor/arcade-editor.d.ts +16 -5
- package/dist/types/components/code-editor/code-editor.d.ts +14 -4
- package/dist/types/components/language-api-panel/language-api-panel.d.ts +1 -0
- package/dist/types/components/sql-expression-editor/sql-expression-editor.d.ts +31 -3
- package/dist/types/components/sql-expression-fields/sql-expression-fields.d.ts +17 -0
- package/dist/types/components.d.ts +40 -13
- package/dist/types/data/arcgis-web-compoments/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stencil.config.d.ts +3 -0
- package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/arcade-editor/arcade-editor.stories.d.ts +8 -1
- package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/arcade-editor/editorContext.d.ts +5 -1
- package/dist/types/stencil-public-runtime.d.ts +3 -10
- package/dist/types/utils/arcade-monaco/arcade-defaults.d.ts +1 -0
- package/dist/types/utils/arcade-monaco/arcade-language-features.d.ts +1 -0
- package/dist/types/utils/arcade-monaco/arcade-profile-strategy.d.ts +9 -0
- package/dist/types/utils/arcade-monaco/arcade-worker-manager.d.ts +6 -0
- package/dist/types/utils/fields.d.ts +2 -2
- package/dist/types/utils/profile/editor-profile.d.ts +7 -6
- package/dist/types/utils/profile/types.d.ts +28 -0
- package/dist/types/utils/profile/utils.d.ts +5 -1
- package/dist/types/utils/sql-expr-monaco/sql-expr-completion.d.ts +56 -5
- package/dist/types/utils/sql-expr-monaco/sql-expr-constants.d.ts +61 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-contribution.d.ts +1 -11
- package/dist/types/utils/sql-expr-monaco/sql-expr-defaults.d.ts +0 -1
- package/dist/types/utils/sql-expr-monaco/sql-expr-language-features.d.ts +18 -534
- package/dist/types/utils/sql-expr-monaco/sql-expr-mode.d.ts +34 -1
- package/dist/types/utils/sql-expr-monaco/sql-expr-parser-utils.d.ts +30 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-service-accessors.d.ts +19 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-validation-diagnostic-adapter.d.ts +0 -7
- package/dist/types/utils/sql-expr-monaco/sql-expr-validation-utils.d.ts +73 -77
- package/dist/types/utils/sql-expr-monaco/sql-expr-validation.d.ts +5 -6
- package/dist/types/utils/sql-expr-monaco/sql-expr-worker-manager.d.ts +8 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr.worker.d.ts +11 -8
- package/dist/types/utils/sql-expr-monaco/sql-expression-profile-strategy.d.ts +13 -0
- package/dist/types/utils/sql-expr-monaco/types.d.ts +30 -28
- package/package.json +19 -19
- package/dist/arcgis-coding-components/p-1baf3624.entry.js +0 -6
- package/dist/arcgis-coding-components/p-8e61744c.js +0 -68
- package/dist/arcgis-coding-components/p-933de2b5.entry.js +0 -6
- package/dist/arcgis-coding-components/p-9dfc06ea.js +0 -6
- package/dist/arcgis-coding-components/p-a536144e.js +0 -6
- package/dist/arcgis-coding-components/p-cd67026d.js +0 -6
- package/dist/arcgis-coding-components/p-d7e83ea1.entry.js +0 -6
- package/dist/arcgis-coding-components/p-e055c041.js +0 -6
- package/dist/arcgis-coding-components/p-f1fab45e.js +0 -7
- package/dist/cjs/arcade-defaults-2d36c400.js +0 -116
- package/dist/cjs/sql-expr-mode-c644220d.js +0 -25135
- package/dist/esm/arcade-defaults-1adb5004.js +0 -111
- package/dist/esm/polyfills/core-js.js +0 -11
- package/dist/esm/polyfills/dom.js +0 -79
- package/dist/esm/polyfills/es5-html-element.js +0 -1
- package/dist/esm/polyfills/index.js +0 -34
- package/dist/esm/polyfills/system.js +0 -6
- package/dist/esm/sql-expr-mode-1821b2b9.js +0 -25132
- package/dist/types/data/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stencil.config.d.ts +0 -3
- package/dist/types/utils/profile/predefined-profile.d.ts +0 -4
- package/dist/types/utils/sql-expr-monaco/DependentFiles/DateOnly.d.ts +0 -41
- package/dist/types/utils/sql-expr-monaco/DependentFiles/SqlInterval.d.ts +0 -16
- package/dist/types/utils/sql-expr-monaco/DependentFiles/SqlTimestampOffset.d.ts +0 -26
- package/dist/types/utils/sql-expr-monaco/DependentFiles/TimeOnly.d.ts +0 -37
- package/dist/types/utils/sql-expr-monaco/DependentFiles/UnknownTimeZone.d.ts +0 -11
- package/dist/types/utils/sql-expr-monaco/DependentFiles/WhereGrammar.d.ts +0 -122
- package/dist/types/utils/sql-expr-monaco/DependentFiles/sqlCompareUtils.d.ts +0 -5
- package/dist/types/utils/sql-expr-monaco/DependentFiles/sqlDateParsingUtils.d.ts +0 -18
- package/dist/types/utils/sql-expr-monaco/DependentFiles/sqlUtils.d.ts +0 -6
- package/dist/types/utils/sql-expr-monaco/DependentFiles/standardizedFunctions.d.ts +0 -156
- package/dist/types/utils/sql-expr-monaco/DependentFiles/support.d.ts +0 -150
- package/dist/types/utils/sql-expr-monaco/PeggyGrammar/sql92grammar.d.ts +0 -1397
- package/dist/types/utils/sql-expr-monaco/libraries/date/properties/index.d.ts +0 -59
- package/dist/types/utils/sql-expr-monaco/libraries/numeric/properties/index.d.ts +0 -295
- package/dist/types/utils/sql-expr-monaco/libraries/string/properties/index.d.ts +0 -135
- package/dist/types/utils/sql-expr-monaco/sql-expr-validation-adapter.d.ts +0 -3
- package/dist/types/utils/sql-expr-profile/predefined-profile.d.ts +0 -2
- /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/code-editor/code-editor.stories.d.ts +0 -0
- /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/sql-expression-editor/sql-expression-editor.stories.d.ts +0 -0
- /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/reference/stories/arcade-editor.stories.d.ts +0 -0
- /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/support/sass-inline-url-importer.d.ts +0 -0
- /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/support/sass-json-importer.d.ts +0 -0
- /package/dist/types/data/{actions-runner-1 → arcgis-web-compoments/actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/support/stencil-monaco-plugins.d.ts +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.60
|
|
5
5
|
*/
|
|
6
6
|
// src/index.ts
|
|
7
7
|
var isAMD = typeof window !== "undefined" && "$arcgis" in window && typeof window.$arcgis === "object" && "import" in window.$arcgis && !("forceESM" in window.$arcgis);
|
|
@@ -99,9 +99,9 @@ function fieldTypeToIconName(field) {
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
/**
|
|
102
|
-
* Returns the
|
|
102
|
+
* Returns the ApiValueVariable type for the given field.
|
|
103
103
|
*/
|
|
104
|
-
function
|
|
104
|
+
function fieldTypeToApiValueVarType(field) {
|
|
105
105
|
switch (field.type) {
|
|
106
106
|
case "small-integer":
|
|
107
107
|
case "integer":
|
|
@@ -152,4 +152,4 @@ function fieldAlias(field) {
|
|
|
152
152
|
return field.alias || field.name;
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
export { newPortalPortalItem as a, newWebScene as b, newWebMap as c, fieldTypeToIconName as d,
|
|
155
|
+
export { newPortalPortalItem as a, newWebScene as b, newWebMap as c, fieldTypeToIconName as d, fieldTypeToApiValueVarType as e, fieldAlias as f, importArcade as g, importRequest as i, newLayersFeatureLayer as n, supportedFields as s };
|
package/dist/components/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.60
|
|
5
5
|
*/
|
|
6
6
|
export { setNonce, setPlatformOptions } from '@stencil/core/internal/client';
|
|
7
7
|
export { a as arcade } from './arcade-defaults.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.60
|
|
5
5
|
*/
|
|
6
6
|
// src/array-utils.ts
|
|
7
7
|
|
|
@@ -285,7 +285,7 @@ function langToLocale(lang) {
|
|
|
285
285
|
}
|
|
286
286
|
function startLocaleObserver(element, assetsPath, onUpdated, assetName) {
|
|
287
287
|
let result = void 0;
|
|
288
|
-
const callback = () => void
|
|
288
|
+
const callback = () => void updateComponentLocaleState(element, assetsPath, assetName).then((newResult) => {
|
|
289
289
|
if (result?.lang !== newResult.lang || result.t9nLocale !== newResult.t9nLocale || result.t9nStrings !== newResult.t9nStrings) {
|
|
290
290
|
onUpdated(newResult);
|
|
291
291
|
}
|
|
@@ -294,7 +294,7 @@ function startLocaleObserver(element, assetsPath, onUpdated, assetName) {
|
|
|
294
294
|
callback();
|
|
295
295
|
return observeAncestorsMutation(element, ["lang"], callback);
|
|
296
296
|
}
|
|
297
|
-
async function
|
|
297
|
+
async function updateComponentLocaleState(element, assetsPath, assetName = element.tagName.toLowerCase().split("-").slice(1).join("-")) {
|
|
298
298
|
const { lang, t9nLocale } = getElementLocales(element);
|
|
299
299
|
const t9nAssetsPath = `${assetsPath}/${assetName}/t9n`;
|
|
300
300
|
const prefix = `${assetName}.t9n.`;
|
|
@@ -404,4 +404,4 @@ function isURL(url) {
|
|
|
404
404
|
}
|
|
405
405
|
}
|
|
406
406
|
|
|
407
|
-
export { Deferred as D, isNotUndefined as a, addLTRMark as b,
|
|
407
|
+
export { Deferred as D, isNotUndefined as a, addLTRMark as b, setValuesInString as c, createFilterExpression as d, getElementTheme as e, fetchT9nStringsBundle as f, generateGuid as g, isURL as h, isNotNull as i, hasSameOrigin as j, safeAsyncCall as k, devToolsAwareTimeout as l, safeCall as m, startLocaleObserver as n, observeAncestorsMutation as o, getElementLocales as p, quoteString as q, setFocusOnElement as r, supportedLocales as s, debounce as t };
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.60
|
|
5
5
|
*/
|
|
6
6
|
import { proxyCustomElement, HTMLElement, createEvent, forceUpdate, h, Host } from '@stencil/core/internal/client';
|
|
7
7
|
import { g as generateColorizeStyles, o as onColorizeThemeChanged, c as convertMarkdownString, b as colorizedAllCodeElements } from './markdown.js';
|
|
8
8
|
import { f as filterCollection } from './utilities.js';
|
|
9
|
-
import { u as useControllerManager } from './chunk-
|
|
9
|
+
import { u as useControllerManager } from './chunk-WEX2VUZV.js';
|
|
10
10
|
import { r as setFocusOnElement, b as addLTRMark } from './index2.js';
|
|
11
11
|
import { u as useT9n } from './useT9n.js';
|
|
12
12
|
import "@esri/calcite-components/dist/components/calcite-list-item-group.js";
|
|
@@ -23,7 +23,7 @@ import "@esri/calcite-components/dist/components/calcite-list.js";
|
|
|
23
23
|
const languageApiPanelCss = ":host{background-color:var(--calcite-color-foreground-1)}:host .notice-container{margin:var(--calcite-spacing-xxs);padding:var(--calcite-spacing-sm);background-color:var(--calcite-color-foreground-1)}:host .sticky{position:sticky;top:0px;z-index:10}:host calcite-flow{height:100%}:host calcite-block p:first-of-type{margin-top:0}:host calcite-block code{font-family:var(--calcite-code-family)}:host calcite-block pre{direction:ltr;overflow-x:auto;background-color:var(--calcite-color-foreground-2);padding:var(--calcite-spacing-sm)}:host calcite-block pre code{font-size:var(--calcite-font-size--2)}:host calcite-list-item-group{background-color:var(--calcite-color-foreground-2)}";
|
|
24
24
|
const ArcgisLanguageApiPanelStyle0 = languageApiPanelCss;
|
|
25
25
|
|
|
26
|
-
const __cmpMeta = [1,"arcgis-language-api-panel",{"hideDocumentationActions":[1028,"hide-documentation-actions"],"loading":[1028],"apiLibrary":[1040],"_selectedApiItem":[32],"_filterValue":[32],"_colorizeStyle":[32]}];
|
|
26
|
+
const __cmpMeta = [1,"arcgis-language-api-panel",{"hideDocumentationActions":[1028,"hide-documentation-actions"],"loading":[1028],"apiLibrary":[1040],"_selectedApiItem":[32],"_filterValue":[32],"_colorizeStyle":[32]},undefined,{"apiLibrary":["_apiLibraryChanged"]}];
|
|
27
27
|
const ArcgisLanguageApiPanel = /*@__PURE__*/ proxyCustomElement(class ArcgisLanguageApiPanel extends HTMLElement {
|
|
28
28
|
connectedCallback() { this.manager._connectedCallback(); }
|
|
29
29
|
constructor() {
|
|
@@ -81,6 +81,21 @@ this.constructor.__registerControllers = ()=>__cmpMeta[2]??{};
|
|
|
81
81
|
this.loading = false;
|
|
82
82
|
this.apiLibrary = undefined;
|
|
83
83
|
}
|
|
84
|
+
_apiLibraryChanged(newVal) {
|
|
85
|
+
// refresh the selected api item if there is one to use the new language
|
|
86
|
+
if (!this._selectedApiItem) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
for (const category of newVal ?? []) {
|
|
90
|
+
for (const item of category.items) {
|
|
91
|
+
if (item.name === this._selectedApiItem.name) {
|
|
92
|
+
this._selectedApiItem = item;
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
this._selectedApiItem = undefined;
|
|
98
|
+
}
|
|
84
99
|
//#endregion
|
|
85
100
|
// #region Component lifecycle events
|
|
86
101
|
async componentWillLoad() {
|
|
@@ -143,10 +158,13 @@ this.constructor.__registerControllers = ()=>__cmpMeta[2]??{};
|
|
|
143
158
|
render() {
|
|
144
159
|
const categories = (this.apiLibrary ?? []).map((apiCategory) => this.renderApiCategory(apiCategory));
|
|
145
160
|
const empty = categories.every((g) => !g);
|
|
146
|
-
return (h(Host, { key: '
|
|
161
|
+
return (h(Host, { key: '777e65f0a9891fbdf8fd6177890df475261d198e' }, h("style", { key: 'bacffd5a30dfa72f9cc99db6a7066fd551c06e60' }, this._colorizeStyle), h("calcite-flow", { key: 'b48417bccd1a1a5e400d5b205ff0dc3a21e08a76', ref: (ref) => this.flowFocusHandler(ref) }, h("calcite-flow-item", { key: 'a44cdb484d60daa1a6410ed7d513eb680f20f883', heading: this.messages.constantsandfunctions, closable: true, onCalciteFlowItemClose: this._emitClose }, h("calcite-input", { key: 'ebe4708ce6ccb62b2d5639bb9cbc5ee207e7e2b9', value: this._filterValue, icon: "magnifying-glass", clearable: true, onCalciteInputInput: this._updateFilterValue, class: "sticky", scale: "m" }), this.loading ? (h("calcite-loader", { scale: "s", type: "indeterminate", label: this.messages.loading ?? "Loading" })) : (h("calcite-list", null, empty ? h("div", { class: "notice-container" }, this.messages.noitems) : categories))), this.renderApiItemFlowItem())));
|
|
147
162
|
}
|
|
148
163
|
static get assetsDirs() { return ["assets"]; }
|
|
149
164
|
get el() { return this; }
|
|
165
|
+
static get watchers() { return {
|
|
166
|
+
"apiLibrary": ["_apiLibraryChanged"]
|
|
167
|
+
}; }
|
|
150
168
|
static get style() { return ArcgisLanguageApiPanelStyle0; }
|
|
151
169
|
}, __cmpMeta);
|
|
152
170
|
function defineCustomElement() {
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.60
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { n as newLayersFeatureLayer, i as importRequest, s as supportedFields, a as newPortalPortalItem, b as newWebScene, c as newWebMap, f as fieldAlias, d as fieldTypeToIconName, e as fieldTypeToApiValueVarType } from './fields.js';
|
|
7
7
|
import { p as portalItemPageUrl } from './utilities.js';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { i as isNotNull, a as isNotUndefined, b as addLTRMark, c as setValuesInString } from './index2.js';
|
|
9
|
+
import { InsertTextMode, InsertTextFormat, CompletionItemKind } from 'vscode-languageserver-types';
|
|
10
10
|
import { Emitter, Uri } from 'monaco-editor';
|
|
11
|
-
import { getArcgisAssetPath as getAssetPath } from "./arcgis-assets.js";
|
|
12
11
|
|
|
13
12
|
//#region Type Guards
|
|
14
|
-
function
|
|
13
|
+
function isFeatureLayerLikeInstance(item) {
|
|
15
14
|
return (!!item &&
|
|
16
15
|
typeof item === "object" &&
|
|
17
16
|
"declaredClass" in item &&
|
|
18
17
|
typeof item.declaredClass === "string" &&
|
|
19
18
|
item.declaredClass.startsWith("esri.layers.") &&
|
|
20
|
-
|
|
19
|
+
isFieldsDefinition(item) &&
|
|
21
20
|
"queryFeatures" in item &&
|
|
22
21
|
typeof item.queryFeatures === "function");
|
|
23
22
|
}
|
|
@@ -56,6 +55,15 @@ function isUrlDefinition(item) {
|
|
|
56
55
|
function isSupportedServiceUrlDefinition(item) {
|
|
57
56
|
return isUrlDefinition(item) && /\/(?:featureserver|mapserver)(?:\/|$)/iu.test(item.url);
|
|
58
57
|
}
|
|
58
|
+
function isFeatureDefinition(item) {
|
|
59
|
+
return isUrlDefinition(item) || isFieldsDefinition(item) || isFeatureLayerItemDefinition(item);
|
|
60
|
+
}
|
|
61
|
+
function isFeatureSetDefinition(item) {
|
|
62
|
+
return isUrlDefinition(item) || isFieldsDefinition(item) || isFeatureLayerItemDefinition(item);
|
|
63
|
+
}
|
|
64
|
+
function isFeatureSetCollectionDefinition(item) {
|
|
65
|
+
return isPortalItemDefinition(item) || isMapInstance(item) || isSupportedServiceUrlDefinition(item);
|
|
66
|
+
}
|
|
59
67
|
function isSubtypeInstance(item) {
|
|
60
68
|
return (!!item &&
|
|
61
69
|
typeof item === "object" &&
|
|
@@ -229,81 +237,23 @@ function getMapPortalItem(map) {
|
|
|
229
237
|
}
|
|
230
238
|
return null;
|
|
231
239
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
case "dictionary":
|
|
238
|
-
return await dictionaryToLSDictionary(editorVariable, kind);
|
|
239
|
-
case "feature":
|
|
240
|
-
return await featureToLSFeature(editorVariable, kind);
|
|
241
|
-
default:
|
|
242
|
-
return variableToLSVariable(editorVariable, kind);
|
|
243
|
-
}
|
|
244
|
-
}));
|
|
245
|
-
}
|
|
246
|
-
function variableToLSVariable(editorVariable, kind) {
|
|
247
|
-
const { name, type } = editorVariable;
|
|
248
|
-
const description = editorVariable.getDescription();
|
|
249
|
-
return {
|
|
250
|
-
name,
|
|
251
|
-
description,
|
|
252
|
-
type,
|
|
253
|
-
completion: {
|
|
254
|
-
label: name,
|
|
255
|
-
detail: name,
|
|
256
|
-
insertText: name,
|
|
257
|
-
insertTextMode: InsertTextMode.asIs,
|
|
258
|
-
insertTextFormat: InsertTextFormat.PlainText,
|
|
259
|
-
kind,
|
|
260
|
-
documentation: { kind: "markdown", value: description },
|
|
261
|
-
},
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
async function featureToLSFeature(editorFeature, kind) {
|
|
265
|
-
// Get the source for the definition
|
|
266
|
-
const source = await editorFeature.loadSource();
|
|
267
|
-
const { name } = editorFeature;
|
|
268
|
-
const description = editorFeature.getDescription();
|
|
269
|
-
const resultCompletion = {
|
|
270
|
-
label: name,
|
|
271
|
-
detail: name,
|
|
272
|
-
insertText: name,
|
|
273
|
-
insertTextMode: InsertTextMode.asIs,
|
|
274
|
-
insertTextFormat: InsertTextFormat.PlainText,
|
|
275
|
-
kind,
|
|
276
|
-
};
|
|
277
|
-
const result = {
|
|
278
|
-
name,
|
|
279
|
-
description,
|
|
280
|
-
type: "dictionary",
|
|
281
|
-
properties: [],
|
|
282
|
-
completion: resultCompletion,
|
|
283
|
-
};
|
|
284
|
-
// No source definition, then it will be a feature without any known fields
|
|
285
|
-
if (!source) {
|
|
286
|
-
return result;
|
|
287
|
-
}
|
|
288
|
-
// Create properties for the fields and the aliases
|
|
289
|
-
// Also improve the feature completion documentation
|
|
290
|
-
let featureCompletionDescription = description;
|
|
240
|
+
/**
|
|
241
|
+
* converts fields to profile values and calculates the feature completion description all in one iteration
|
|
242
|
+
*/
|
|
243
|
+
function fieldsToProfileValues(fields, initialFeatureCompletionDescription, includeAliases = false) {
|
|
244
|
+
let featureCompletionDescription = initialFeatureCompletionDescription;
|
|
291
245
|
const fieldProfileValues = [];
|
|
292
246
|
const aliasProfileValues = [];
|
|
293
|
-
supportedFields(
|
|
294
|
-
let fieldCompletionDescription = `**${field.name}** \n${field.type}`;
|
|
295
|
-
if (field.description) {
|
|
296
|
-
fieldCompletionDescription += ` \n'${field.description}`;
|
|
297
|
-
}
|
|
247
|
+
supportedFields(fields).forEach((field) => {
|
|
298
248
|
if (featureCompletionDescription) {
|
|
299
249
|
featureCompletionDescription += " \n \n";
|
|
300
250
|
}
|
|
301
|
-
featureCompletionDescription += `**${field.name}** (${
|
|
251
|
+
featureCompletionDescription += `**${field.name}** (${field.alias}) \n${field.type}`;
|
|
302
252
|
if (field.description) {
|
|
303
253
|
featureCompletionDescription += ` \n'${field.description}`;
|
|
304
254
|
}
|
|
305
255
|
// The property for the field
|
|
306
|
-
const type =
|
|
256
|
+
const type = fieldTypeToApiValueVarType(field);
|
|
307
257
|
const insertText = getMemberExpressionProperty(field.name, false);
|
|
308
258
|
const description = fieldAlias(field);
|
|
309
259
|
fieldProfileValues.push({
|
|
@@ -317,65 +267,35 @@ async function featureToLSFeature(editorFeature, kind) {
|
|
|
317
267
|
insertTextMode: InsertTextMode.asIs,
|
|
318
268
|
insertTextFormat: InsertTextFormat.PlainText,
|
|
319
269
|
kind: CompletionItemKind.Field,
|
|
320
|
-
documentation: { kind: "markdown", value: fieldCompletionDescription },
|
|
321
270
|
},
|
|
322
271
|
});
|
|
323
|
-
if (
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
272
|
+
if (includeAliases) {
|
|
273
|
+
if (!field.alias || field.alias.toLowerCase() === field.name.toLowerCase()) {
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
// The property for the alias if different than the field name
|
|
277
|
+
let aliasCompletionDescription = `**${field.alias}** \n${field.type}`;
|
|
278
|
+
if (field.description) {
|
|
279
|
+
aliasCompletionDescription += ` \n'${field.description}`;
|
|
280
|
+
}
|
|
281
|
+
aliasProfileValues.push({
|
|
282
|
+
name: field.alias,
|
|
283
|
+
description: field.name,
|
|
284
|
+
type,
|
|
285
|
+
completion: {
|
|
286
|
+
label: field.alias,
|
|
287
|
+
detail: field.name,
|
|
288
|
+
insertText,
|
|
289
|
+
insertTextMode: InsertTextMode.asIs,
|
|
290
|
+
insertTextFormat: InsertTextFormat.PlainText,
|
|
291
|
+
kind: CompletionItemKind.Field,
|
|
292
|
+
documentation: { kind: "markdown", value: aliasCompletionDescription },
|
|
293
|
+
},
|
|
294
|
+
});
|
|
330
295
|
}
|
|
331
|
-
aliasProfileValues.push({
|
|
332
|
-
name: field.alias,
|
|
333
|
-
description: field.name,
|
|
334
|
-
type,
|
|
335
|
-
completion: {
|
|
336
|
-
label: field.alias,
|
|
337
|
-
detail: field.name,
|
|
338
|
-
insertText,
|
|
339
|
-
insertTextMode: InsertTextMode.asIs,
|
|
340
|
-
insertTextFormat: InsertTextFormat.PlainText,
|
|
341
|
-
kind: CompletionItemKind.Field,
|
|
342
|
-
documentation: { kind: "markdown", value: aliasCompletionDescription },
|
|
343
|
-
},
|
|
344
|
-
});
|
|
345
296
|
});
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
return result;
|
|
349
|
-
}
|
|
350
|
-
async function dictionaryToLSDictionary(editorDictionary, kind) {
|
|
351
|
-
const { name, dictionaryVariables: variables } = editorDictionary;
|
|
352
|
-
const description = editorDictionary.getDescription();
|
|
353
|
-
const completionDescription = variables.reduce((previous, p) => {
|
|
354
|
-
if (previous !== "") {
|
|
355
|
-
previous += " \n \n";
|
|
356
|
-
}
|
|
357
|
-
previous += `**${p.name}** \n${p.type}`;
|
|
358
|
-
const description = p.getDescription();
|
|
359
|
-
if (description) {
|
|
360
|
-
previous += ` \n${description}`;
|
|
361
|
-
}
|
|
362
|
-
return previous;
|
|
363
|
-
}, description);
|
|
364
|
-
return {
|
|
365
|
-
name,
|
|
366
|
-
description,
|
|
367
|
-
type: "dictionary",
|
|
368
|
-
properties: await variablesToLSVariable(variables, CompletionItemKind.Field),
|
|
369
|
-
completion: {
|
|
370
|
-
label: name,
|
|
371
|
-
detail: name,
|
|
372
|
-
insertText: name,
|
|
373
|
-
insertTextMode: InsertTextMode.asIs,
|
|
374
|
-
insertTextFormat: InsertTextFormat.PlainText,
|
|
375
|
-
kind,
|
|
376
|
-
documentation: { kind: "markdown", value: completionDescription },
|
|
377
|
-
},
|
|
378
|
-
};
|
|
297
|
+
const properties = [...fieldProfileValues, ...aliasProfileValues];
|
|
298
|
+
return [properties, featureCompletionDescription];
|
|
379
299
|
}
|
|
380
300
|
/**
|
|
381
301
|
* Represents a item in the EditorProfile. The profile is converted into an optimized way for
|
|
@@ -909,7 +829,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
|
|
|
909
829
|
const relationshipsGroup = new GroupOfVariables(this._profile, { code: "relationships" });
|
|
910
830
|
const relationshipItems = await Promise.all(source.relationships.map(async (relationship) => {
|
|
911
831
|
const relatedLayer = await getRelatedFeatureLayer(source, relationship);
|
|
912
|
-
if (!
|
|
832
|
+
if (!isFeatureLayerLikeInstance(relatedLayer)) {
|
|
913
833
|
return null;
|
|
914
834
|
}
|
|
915
835
|
if (relationship.relatedTableId === this.relationshipsProperties?.sourceTableId) {
|
|
@@ -953,7 +873,7 @@ class FeatureVariable extends SourceBasedVariable {
|
|
|
953
873
|
throw new Error("Invalid definition");
|
|
954
874
|
}
|
|
955
875
|
// The title group and snippet
|
|
956
|
-
const title = isTitleCapableSource(this._source) ? this._source.title ?? "" : "";
|
|
876
|
+
const title = isTitleCapableSource(this._source) ? (this._source.title ?? "") : "";
|
|
957
877
|
this.variables.push(new GroupOfVariables(this._profile, title, [
|
|
958
878
|
new ValueVariable({
|
|
959
879
|
profile: this._profile,
|
|
@@ -1212,7 +1132,7 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
|
|
|
1212
1132
|
.toArray()
|
|
1213
1133
|
.reverse()
|
|
1214
1134
|
.forEach((layer) => {
|
|
1215
|
-
if (
|
|
1135
|
+
if (isFeatureLayerLikeInstance(layer)) {
|
|
1216
1136
|
layerVariables.push(this._createFeatureSetVariable(layer, true));
|
|
1217
1137
|
return;
|
|
1218
1138
|
}
|
|
@@ -1225,31 +1145,31 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
|
|
|
1225
1145
|
});
|
|
1226
1146
|
return layerVariables;
|
|
1227
1147
|
}
|
|
1228
|
-
_createFeatureSetVariable(
|
|
1148
|
+
_createFeatureSetVariable(featureLayerLike, isFromWebMap = false) {
|
|
1229
1149
|
return new FeatureSetVariable(this, {
|
|
1230
1150
|
profile: this._profile,
|
|
1231
|
-
declaration: { name:
|
|
1151
|
+
declaration: { name: featureLayerLike.title, definition: featureLayerLike },
|
|
1232
1152
|
label: isFromWebMap
|
|
1233
|
-
?
|
|
1234
|
-
:
|
|
1153
|
+
? featureLayerLike.title
|
|
1154
|
+
: (featureLayerLike.sourceJSON.name ?? featureLayerLike.title),
|
|
1235
1155
|
description: "",
|
|
1236
1156
|
nonInteractive: true,
|
|
1237
|
-
}, this._makeFeatureSetSnippets(
|
|
1157
|
+
}, this._makeFeatureSetSnippets(featureLayerLike, isFromWebMap));
|
|
1238
1158
|
}
|
|
1239
|
-
_makeFeatureSetSnippets(
|
|
1159
|
+
_makeFeatureSetSnippets(featureLayerLike, isFromWebMap = false) {
|
|
1240
1160
|
if (!this._profile?.supportFeatureSetFunctions) {
|
|
1241
1161
|
return [];
|
|
1242
1162
|
}
|
|
1243
1163
|
if (isFromWebMap) {
|
|
1244
|
-
const snippetById = `FeatureSetById(${this.snippet}, "${
|
|
1245
|
-
const snippetByName = `FeatureSetByName(${this.snippet}, "${
|
|
1164
|
+
const snippetById = `FeatureSetById(${this.snippet}, "${featureLayerLike.id}")`;
|
|
1165
|
+
const snippetByName = `FeatureSetByName(${this.snippet}, "${featureLayerLike.title}")`;
|
|
1246
1166
|
return [
|
|
1247
1167
|
new ValueVariable({ profile: this._profile, label: snippetById, description: "", snippet: snippetById }),
|
|
1248
1168
|
new ValueVariable({ profile: this._profile, label: snippetByName, description: "", snippet: snippetByName }),
|
|
1249
1169
|
];
|
|
1250
1170
|
}
|
|
1251
1171
|
else {
|
|
1252
|
-
const snippetById = `FeatureSetById(${this.snippet}, "${
|
|
1172
|
+
const snippetById = `FeatureSetById(${this.snippet}, "${featureLayerLike.layerId}")`;
|
|
1253
1173
|
return [new ValueVariable({ profile: this._profile, label: snippetById, description: "", snippet: snippetById })];
|
|
1254
1174
|
}
|
|
1255
1175
|
}
|
|
@@ -1287,14 +1207,6 @@ class EditorProfile extends DictionaryVariable {
|
|
|
1287
1207
|
get supportFeatureSetFunctions() {
|
|
1288
1208
|
return this.definition?.bundles?.includes("data-access") ?? false;
|
|
1289
1209
|
}
|
|
1290
|
-
/**
|
|
1291
|
-
* Returns the language service profile. It is different than the editor profile as it is optimized for Monaco.
|
|
1292
|
-
*/
|
|
1293
|
-
async toLSProfile() {
|
|
1294
|
-
const { apiVersion, bundles, hiddenApiItems } = this.definition ?? {};
|
|
1295
|
-
const variables = await variablesToLSVariable(this.dictionaryVariables);
|
|
1296
|
-
return { apiVersion, bundles, variables, hiddenApiItems: hiddenApiItems?.map((s) => s.toLowerCase()) };
|
|
1297
|
-
}
|
|
1298
1210
|
/**
|
|
1299
1211
|
* Returns the EditorProfile as a json. The EditorProfile may have been updated. This function allows to
|
|
1300
1212
|
* get the new json representing mutations.
|
|
@@ -1308,144 +1220,6 @@ class EditorProfile extends DictionaryVariable {
|
|
|
1308
1220
|
}
|
|
1309
1221
|
//#endregion
|
|
1310
1222
|
|
|
1311
|
-
function isFeatureDefinition(item) {
|
|
1312
|
-
return isUrlDefinition(item) || isFieldsDefinition(item) || isFeatureLayerItemDefinition(item);
|
|
1313
|
-
}
|
|
1314
|
-
function isFeatureSetDefinition(item) {
|
|
1315
|
-
return isUrlDefinition(item) || isFieldsDefinition(item) || isFeatureLayerItemDefinition(item);
|
|
1316
|
-
}
|
|
1317
|
-
function isFeatureSetCollectionDefinition(item) {
|
|
1318
|
-
return isPortalItemDefinition(item) || isMapInstance(item) || isSupportedServiceUrlDefinition(item);
|
|
1319
|
-
}
|
|
1320
|
-
/**
|
|
1321
|
-
* Get a PredefinedProfile for a locale. If not already loaded then fetch it.
|
|
1322
|
-
* If the locale doesn't exist or the locale profile file doesn't exist then returns
|
|
1323
|
-
* the english version of the profile.
|
|
1324
|
-
*/
|
|
1325
|
-
async function getSdkPredefinedProfiles(locale = "en") {
|
|
1326
|
-
const profiles = sdkPredefinedProfilesMap.get(locale);
|
|
1327
|
-
if (profiles) {
|
|
1328
|
-
return profiles;
|
|
1329
|
-
}
|
|
1330
|
-
if (!supportedLocales.has(locale)) {
|
|
1331
|
-
return await getSdkPredefinedProfiles("en");
|
|
1332
|
-
}
|
|
1333
|
-
try {
|
|
1334
|
-
const response = await fetch(getAssetPath(`./assets/arcade-language/profiles/arcade-profiles.t9n.${locale}.json`));
|
|
1335
|
-
if (response.ok) {
|
|
1336
|
-
return cacheSdkPredefinedProfiles(locale, (await response.json()));
|
|
1337
|
-
}
|
|
1338
|
-
if (locale === "en") {
|
|
1339
|
-
return null;
|
|
1340
|
-
}
|
|
1341
|
-
return await getSdkPredefinedProfiles("en");
|
|
1342
|
-
}
|
|
1343
|
-
catch {
|
|
1344
|
-
return null;
|
|
1345
|
-
}
|
|
1346
|
-
}
|
|
1347
|
-
const sdkPredefinedProfilesMap = new Map();
|
|
1348
|
-
/**
|
|
1349
|
-
* Convert a stored profile into a PredefinedProfile and add it to the in-memory
|
|
1350
|
-
* Map of profiles per locale.
|
|
1351
|
-
*/
|
|
1352
|
-
function cacheSdkPredefinedProfiles(locale, profiles) {
|
|
1353
|
-
const map = new Map();
|
|
1354
|
-
profiles.forEach((profile) => {
|
|
1355
|
-
map.set(profile.id, profile);
|
|
1356
|
-
});
|
|
1357
|
-
sdkPredefinedProfilesMap.set(locale, map);
|
|
1358
|
-
return map;
|
|
1359
|
-
}
|
|
1360
|
-
async function getSdkPredefinedProfile(id, locale = "en") {
|
|
1361
|
-
const profiles = await getSdkPredefinedProfiles(locale);
|
|
1362
|
-
return profiles?.get(id) ?? null;
|
|
1363
|
-
}
|
|
1364
|
-
function isExtendedPredefinedProfileDefinition(item) {
|
|
1365
|
-
return !!item && typeof item === "object" && "additionalVariables" in item && Array.isArray(item.additionalVariables);
|
|
1366
|
-
}
|
|
1367
|
-
function convertApiVariables(variables) {
|
|
1368
|
-
return variables?.map(convertApiVariable);
|
|
1369
|
-
}
|
|
1370
|
-
function convertApiVariable(variable) {
|
|
1371
|
-
switch (variable.type) {
|
|
1372
|
-
case "dictionary":
|
|
1373
|
-
return {
|
|
1374
|
-
...variable,
|
|
1375
|
-
type: variable.type,
|
|
1376
|
-
properties: convertApiVariables(variable.properties),
|
|
1377
|
-
};
|
|
1378
|
-
case "array": {
|
|
1379
|
-
return {
|
|
1380
|
-
...variable,
|
|
1381
|
-
type: variable.type,
|
|
1382
|
-
elementType: { type: "number", name: "number" },
|
|
1383
|
-
};
|
|
1384
|
-
}
|
|
1385
|
-
default:
|
|
1386
|
-
return { ...variable, type: variable.type };
|
|
1387
|
-
}
|
|
1388
|
-
}
|
|
1389
|
-
async function convertToEditorProfileDefinition(predefinedProfile, locale = "en") {
|
|
1390
|
-
if (!isPredefinedProfile(predefinedProfile)) {
|
|
1391
|
-
return undefined;
|
|
1392
|
-
}
|
|
1393
|
-
const sdkPredefinedProfile = await getSdkPredefinedProfile(predefinedProfile.id, locale);
|
|
1394
|
-
if (!sdkPredefinedProfile) {
|
|
1395
|
-
return undefined;
|
|
1396
|
-
}
|
|
1397
|
-
const editorProfile = {
|
|
1398
|
-
bundles: [...sdkPredefinedProfile.bundles],
|
|
1399
|
-
variables: [],
|
|
1400
|
-
hiddenApiItems: predefinedProfile.hiddenApiItems?.map((s) => s.toLowerCase()),
|
|
1401
|
-
};
|
|
1402
|
-
// Merge the SDK variables' definitions/properties with the predefined profile definitions.
|
|
1403
|
-
sdkPredefinedProfile.variables.forEach((predefinedVariable) => {
|
|
1404
|
-
// Don't include disabled variables
|
|
1405
|
-
if (predefinedProfile.disabledVariables?.includes(predefinedVariable.name)) {
|
|
1406
|
-
return;
|
|
1407
|
-
}
|
|
1408
|
-
// Try to get a definition from the predefined profile, for the variable that needs one.
|
|
1409
|
-
const definition = predefinedProfile.definitions[predefinedVariable.name];
|
|
1410
|
-
// Note: Something is weird with TS. The sdkVariables are being casted to the wrong type
|
|
1411
|
-
// despite the type checking from the switch statement.
|
|
1412
|
-
switch (predefinedVariable.type) {
|
|
1413
|
-
case "dictionary": {
|
|
1414
|
-
// For dictionary, we support properties overrride
|
|
1415
|
-
return editorProfile.variables.push(convertApiVariable({
|
|
1416
|
-
...predefinedVariable,
|
|
1417
|
-
type: predefinedVariable.type,
|
|
1418
|
-
properties: Array.isArray(definition) ? [...definition] : predefinedVariable.properties,
|
|
1419
|
-
}));
|
|
1420
|
-
}
|
|
1421
|
-
case "feature":
|
|
1422
|
-
// If the definition is not valid, then we don't include it.
|
|
1423
|
-
if (!isFeatureDefinition(definition)) {
|
|
1424
|
-
return;
|
|
1425
|
-
}
|
|
1426
|
-
return editorProfile.variables.push({ ...predefinedVariable, type: predefinedVariable.type, definition });
|
|
1427
|
-
case "featureSet":
|
|
1428
|
-
// If the definition is not valid, then we don't include it.
|
|
1429
|
-
if (!isFeatureSetDefinition(definition)) {
|
|
1430
|
-
return;
|
|
1431
|
-
}
|
|
1432
|
-
return editorProfile.variables.push({ ...predefinedVariable, type: predefinedVariable.type, definition });
|
|
1433
|
-
case "featureSetCollection":
|
|
1434
|
-
// If the definition is not valid, then we don't include it.
|
|
1435
|
-
if (!isFeatureSetCollectionDefinition(definition)) {
|
|
1436
|
-
return;
|
|
1437
|
-
}
|
|
1438
|
-
return editorProfile.variables.push({ ...predefinedVariable, type: predefinedVariable.type, definition });
|
|
1439
|
-
default:
|
|
1440
|
-
return editorProfile.variables.push(convertApiVariable(predefinedVariable));
|
|
1441
|
-
}
|
|
1442
|
-
});
|
|
1443
|
-
if (isExtendedPredefinedProfileDefinition(predefinedProfile)) {
|
|
1444
|
-
editorProfile.variables.push(...(predefinedProfile.additionalVariables ?? []));
|
|
1445
|
-
}
|
|
1446
|
-
return editorProfile;
|
|
1447
|
-
}
|
|
1448
|
-
|
|
1449
1223
|
// this file contains the building blocks for a language default provider
|
|
1450
1224
|
const defaultContext = {
|
|
1451
1225
|
locale: "en",
|
|
@@ -1532,4 +1306,4 @@ class LanguageDefaultsBase {
|
|
|
1532
1306
|
}
|
|
1533
1307
|
}
|
|
1534
1308
|
|
|
1535
|
-
export { EditorProfile as E, LanguageDefaultsBase as L,
|
|
1309
|
+
export { EditorProfile as E, LanguageDefaultsBase as L, isFeatureSetCollectionDefinition as a, isFeatureSetDefinition as b, isFeatureDefinition as c, fieldsToProfileValues as f, isPredefinedProfile as i };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
3
|
* See https://js.arcgis.com/4.31/esri/copyright.txt for details.
|
|
4
|
-
* v4.31.0-next.
|
|
4
|
+
* v4.31.0-next.60
|
|
5
5
|
*/
|
|
6
6
|
import { editor } from 'monaco-editor';
|
|
7
7
|
import { StandaloneServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices.js';
|