@arcgis/coding-components 4.29.0-beta.92 → 4.29.0-beta.94
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/arcgis-coding-components/arcgis-coding-components.esm.js +6 -1
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.ar.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.bg.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.bs.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.ca.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.cs.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.da.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.de.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.el.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.en.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.es.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.et.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.fi.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.fr.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.he.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.hr.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.hu.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.id.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.it.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.ja.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.ko.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.lt.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.lv.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.nb.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.nl.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.pl.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.pt-BR.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.pt-PT.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.ro.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.ru.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.sk.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.sl.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.sr.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.sv.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.th.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.tr.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.uk.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.vi.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.zh-CN.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.zh-HK.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/api/arcade-api.t9n.zh-TW.json +466 -26
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.ar.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.bg.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.bs.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.ca.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.cs.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.da.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.de.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.el.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.en.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.es.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.et.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.fi.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.fr.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.he.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.hr.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.hu.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.id.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.it.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.ja.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.ko.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.lt.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.lv.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.nb.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.nl.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.pl.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.pt-BR.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.pt-PT.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.ro.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.ru.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.sk.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.sl.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.sr.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.sv.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.th.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.tr.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.uk.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.vi.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.zh-CN.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.zh-HK.json +9 -2
- package/dist/arcgis-coding-components/assets/arcade-language/profiles/arcade-profiles.t9n.zh-TW.json +9 -2
- package/dist/arcgis-coding-components/assets/code-editor/arcade.worker.js +1 -1
- package/dist/arcgis-coding-components/index.esm.js +6 -1
- package/dist/arcgis-coding-components/{p-a1a4f5fc.js → p-06b7a85d.js} +6 -1
- package/dist/arcgis-coding-components/{p-4c959bce.js → p-22837217.js} +15 -10
- package/dist/arcgis-coding-components/{p-ccafed7f.js → p-2b1aca7c.js} +5 -0
- package/dist/arcgis-coding-components/{p-75ae922a.js → p-4c4149bc.js} +6 -1
- package/dist/arcgis-coding-components/{p-79707082.js → p-5fb23065.js} +6 -1
- package/dist/arcgis-coding-components/{p-009eaccf.js → p-8f020f20.js} +5 -0
- package/dist/arcgis-coding-components/p-a051ec0a.entry.js +6 -0
- package/dist/arcgis-coding-components/{p-cdfe57a1.js → p-a17571b6.js} +6 -1
- package/dist/arcgis-coding-components/{p-1d062d47.js → p-a6429039.js} +6 -1
- package/dist/arcgis-coding-components/{p-590b795b.js → p-c2344fd6.js} +6 -1
- package/dist/arcgis-coding-components/{p-ca7059d4.js → p-d37fa51c.js} +6 -1
- package/dist/arcgis-coding-components/p-db60fe10.js +6 -0
- package/dist/cjs/{arcade-defaults-7faf4d5f.js → arcade-defaults-042fbece.js} +487 -362
- package/dist/cjs/{arcade-mode-26b8bc7a.js → arcade-mode-b495cb6f.js} +24 -20
- package/dist/cjs/arcgis-arcade-api_6.cjs.entry.js +176 -112
- package/dist/cjs/arcgis-coding-components.cjs.js +6 -1
- package/dist/cjs/{css-eb1c8e5c.js → css-19093b80.js} +5 -0
- package/dist/cjs/{cssMode-90f06d02.js → cssMode-ce70c012.js} +7 -2
- package/dist/cjs/{html-1aa8e458.js → html-04cbd899.js} +7 -2
- package/dist/cjs/{htmlMode-d3283acc.js → htmlMode-5e973c6f.js} +7 -2
- package/dist/cjs/{index-aaf14a3e.js → index-30445be8.js} +5 -0
- package/dist/cjs/index.cjs.js +7 -2
- package/dist/cjs/{javascript-7a4d9023.js → javascript-8717f18b.js} +8 -3
- package/dist/cjs/{jsonMode-73be73dc.js → jsonMode-b93b2667.js} +7 -2
- package/dist/cjs/loader.cjs.js +6 -1
- package/dist/cjs/{tsMode-95a699e0.js → tsMode-73e2fe2f.js} +7 -2
- package/dist/cjs/{typescript-588df930.js → typescript-a75c0ef4.js} +7 -2
- package/dist/components/arcade-api.js +11 -6
- package/dist/components/arcade-contribution.js +16 -6
- package/dist/components/arcade-defaults.js +243 -118
- package/dist/components/arcade-mode.js +22 -18
- package/dist/components/arcade-results.js +137 -85
- package/dist/components/arcade-suggestions.js +9 -4
- package/dist/components/arcade-variables.js +10 -5
- package/dist/components/arcgis-arcade-api.js +5 -0
- package/dist/components/arcgis-arcade-editor.js +20 -8
- package/dist/components/arcgis-arcade-results.js +5 -0
- package/dist/components/arcgis-arcade-suggestions.js +5 -0
- package/dist/components/arcgis-arcade-variables.js +5 -0
- package/dist/components/arcgis-code-editor.js +5 -0
- package/dist/components/code-editor.js +9 -4
- package/dist/components/fields.js +5 -0
- package/dist/components/functional-components.js +5 -0
- package/dist/components/index.js +5 -0
- package/dist/components/index2.js +7 -2
- package/dist/components/markdown.js +5 -0
- package/dist/components/utilities.js +7 -2
- package/dist/esm/{arcade-defaults-0bc49d1c.js → arcade-defaults-106e7abf.js} +479 -354
- package/dist/esm/{arcade-mode-01365fb8.js → arcade-mode-a890a073.js} +24 -20
- package/dist/esm/arcgis-arcade-api_6.entry.js +176 -112
- package/dist/esm/arcgis-coding-components.js +7 -2
- package/dist/esm/{css-aade9167.js → css-5029659c.js} +5 -0
- package/dist/esm/{cssMode-edce5a89.js → cssMode-c3ebc40a.js} +7 -2
- package/dist/esm/{html-00b724af.js → html-13c9342a.js} +7 -2
- package/dist/esm/{htmlMode-ad3459b7.js → htmlMode-053279f0.js} +7 -2
- package/dist/esm/{index-3732acb8.js → index-c845e955.js} +5 -0
- package/dist/esm/index.js +7 -2
- package/dist/esm/{javascript-bdd52d83.js → javascript-c580af02.js} +8 -3
- package/dist/esm/{jsonMode-7b4c07fb.js → jsonMode-cd51566e.js} +7 -2
- package/dist/esm/loader.js +7 -2
- package/dist/esm/{tsMode-0bd06180.js → tsMode-c0164816.js} +7 -2
- package/dist/esm/{typescript-dfdad07a.js → typescript-7e6d57f4.js} +7 -2
- package/dist/loader/cdn.js +5 -1
- package/dist/loader/index.cjs.js +5 -1
- package/dist/loader/index.es2017.js +5 -1
- package/dist/loader/index.js +5 -1
- package/dist/types/components/arcade-editor/arcade-editor.d.ts +1 -1
- package/dist/types/components/arcade-results/arcade-results.d.ts +0 -5
- package/dist/types/components.d.ts +3 -3
- package/dist/types/utils/arcade-executor.d.ts +12 -4
- package/dist/types/utils/arcade-monaco/arcade.worker.d.ts +6 -4
- package/dist/types/utils/profile/editor-profile.d.ts +10 -5
- package/dist/types/utils/profile/types.d.ts +3 -3
- package/dist/types/utils/profile/utils.d.ts +4 -0
- package/package.json +10 -10
- package/dist/arcgis-coding-components/p-86772125.js +0 -1
- package/dist/arcgis-coding-components/p-ac769046.entry.js +0 -1
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
3
|
+
* See https://js.arcgis.com/4.29/esri/copyright.txt for details.
|
|
4
|
+
* v4.29.0-beta.94
|
|
5
|
+
*/
|
|
1
6
|
import { Emitter, Uri } from 'monaco-editor';
|
|
2
|
-
import {
|
|
7
|
+
import { InsertTextMode, InsertTextFormat, CompletionItemKind } from 'vscode-languageserver-types';
|
|
3
8
|
import { i as importPortalPortalItem, a as importLayersFeatureLayer, b as importWebMap, s as supportedFields, n as newWebScene, c as importRequest, f as fieldTypeToIconName, d as fieldTypeToArcadeType } from './fields.js';
|
|
4
9
|
import { p as portalItemPageUrl } from './utilities.js';
|
|
5
|
-
import {
|
|
10
|
+
import { Z, e as ee, J, I, E, N } from './index2.js';
|
|
6
11
|
import { getAssetPath } from '@stencil/core/internal/client';
|
|
7
12
|
|
|
8
13
|
async function newPortalItem(definition) {
|
|
@@ -42,6 +47,13 @@ function isQueryableLayerInstance(item) {
|
|
|
42
47
|
"queryFeatures" in item &&
|
|
43
48
|
typeof item.queryFeatures === "function");
|
|
44
49
|
}
|
|
50
|
+
function isSubtypeSublayerInstance(item) {
|
|
51
|
+
return (!!item &&
|
|
52
|
+
typeof item === "object" &&
|
|
53
|
+
"declaredClass" in item &&
|
|
54
|
+
typeof item.declaredClass === "string" &&
|
|
55
|
+
item.declaredClass === "esri.layers.support.SubtypeSublayer");
|
|
56
|
+
}
|
|
45
57
|
function isGroupLayerInstance(item) {
|
|
46
58
|
return (!!item &&
|
|
47
59
|
typeof item === "object" &&
|
|
@@ -68,6 +80,24 @@ function isFieldsDefinition(item) {
|
|
|
68
80
|
function isUrlDefinition(item) {
|
|
69
81
|
return (!!item && typeof item === "object" && "url" in item && typeof item.url === "string" && !("declaredClass" in item));
|
|
70
82
|
}
|
|
83
|
+
function isSubtypeInstance(item) {
|
|
84
|
+
return (!!item &&
|
|
85
|
+
typeof item === "object" &&
|
|
86
|
+
"declaredClass" in item &&
|
|
87
|
+
item.declaredClass === "esri.layers.support.Subtype");
|
|
88
|
+
}
|
|
89
|
+
function isCodedValueDomainInstance(item) {
|
|
90
|
+
return (!!item &&
|
|
91
|
+
typeof item === "object" &&
|
|
92
|
+
"declaredClass" in item &&
|
|
93
|
+
item.declaredClass === "esri.layers.support.CodedValueDomain");
|
|
94
|
+
}
|
|
95
|
+
function isInheritedDomainInstance(item) {
|
|
96
|
+
return (!!item &&
|
|
97
|
+
typeof item === "object" &&
|
|
98
|
+
"declaredClass" in item &&
|
|
99
|
+
item.declaredClass === "esri.layers.support.InheritedDomain");
|
|
100
|
+
}
|
|
71
101
|
function isPredefinedProfile(item) {
|
|
72
102
|
return (!!item &&
|
|
73
103
|
typeof item === "object" &&
|
|
@@ -78,29 +108,29 @@ function isPredefinedProfile(item) {
|
|
|
78
108
|
!Array.isArray(item.definitions));
|
|
79
109
|
}
|
|
80
110
|
|
|
81
|
-
function
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
// @ts-expect-error
|
|
90
|
-
entry = entry[pathSegment];
|
|
91
|
-
pathSegment = pathSegments.shift();
|
|
92
|
-
}
|
|
93
|
-
return typeof entry === "string" ? entry : path;
|
|
111
|
+
function isTitleCapableSource(item) {
|
|
112
|
+
return !!item && typeof item === "object" && "title" in item && typeof item.title === "string";
|
|
113
|
+
}
|
|
114
|
+
function isUrlCapableSource(item) {
|
|
115
|
+
return !!item && typeof item === "object" && "url" in item && typeof item.url === "string";
|
|
116
|
+
}
|
|
117
|
+
function isLayerIdCapableSource(item) {
|
|
118
|
+
return !!item && typeof item === "object" && "layerId" in item && typeof item.layerId === "number";
|
|
94
119
|
}
|
|
95
|
-
function
|
|
96
|
-
return !!item && typeof item === "object" && "typeIdField" in item;
|
|
120
|
+
function isFeatureTypesCapableLayer(item) {
|
|
121
|
+
return !!item && typeof item === "object" && "typeIdField" in item && "types" in item;
|
|
97
122
|
}
|
|
98
123
|
function isDomainsCapableLayer(item) {
|
|
99
124
|
return !!item && typeof item === "object" && "getFieldDomain" in item && typeof item.getFieldDomain === "function";
|
|
100
125
|
}
|
|
126
|
+
function isSubtypeFieldCapableLayer(item) {
|
|
127
|
+
return !!item && typeof item === "object" && "subtypeField" in item;
|
|
128
|
+
}
|
|
129
|
+
function isSubtypesCapableLayer(item) {
|
|
130
|
+
return isSubtypeFieldCapableLayer(item) && "subtypes" in item;
|
|
131
|
+
}
|
|
101
132
|
function isRelationshipsCapableLayer(item) {
|
|
102
|
-
return (
|
|
103
|
-
typeof item === "object" &&
|
|
133
|
+
return (isLayerIdCapableSource(item) &&
|
|
104
134
|
"relationships" in item &&
|
|
105
135
|
"url" in item &&
|
|
106
136
|
Array.isArray(item.relationships) &&
|
|
@@ -127,7 +157,23 @@ function sortFields(layer) {
|
|
|
127
157
|
if (secondField.type === "oid") {
|
|
128
158
|
return 1;
|
|
129
159
|
}
|
|
130
|
-
if (
|
|
160
|
+
if (isSubtypeSublayerInstance(layer)) {
|
|
161
|
+
if (firstField.name === layer.parent.subtypeField) {
|
|
162
|
+
return -1;
|
|
163
|
+
}
|
|
164
|
+
if (secondField.name === layer.parent.subtypeField) {
|
|
165
|
+
return 1;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (isSubtypeFieldCapableLayer(layer)) {
|
|
169
|
+
if (firstField.name === layer.subtypeField) {
|
|
170
|
+
return -1;
|
|
171
|
+
}
|
|
172
|
+
if (secondField.name === layer.subtypeField) {
|
|
173
|
+
return 1;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (isFeatureTypesCapableLayer(layer)) {
|
|
131
177
|
if (firstField.name === layer.typeIdField) {
|
|
132
178
|
return -1;
|
|
133
179
|
}
|
|
@@ -138,20 +184,19 @@ function sortFields(layer) {
|
|
|
138
184
|
return firstField.name.localeCompare(secondField.name, "en", { sensitivity: "base" });
|
|
139
185
|
};
|
|
140
186
|
}
|
|
141
|
-
function
|
|
187
|
+
function getTypeOrSubtypeDomainGroup(profile, types, field) {
|
|
142
188
|
// Try the coded domain first
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
189
|
+
if (isCodedValueDomainInstance(field.domain)) {
|
|
190
|
+
return getCodedValueDomainGroup(profile, field.domain, { code: "subtypes" });
|
|
191
|
+
}
|
|
192
|
+
// No coded domain, we will manufacture it
|
|
193
|
+
const values = types?.map((t) => {
|
|
194
|
+
const label = isSubtypeInstance(t) ? t.code : t.id;
|
|
195
|
+
return new ValueVariable({ profile, label: `${label}`, description: t.name, snippet: `"${label}"` });
|
|
196
|
+
}) ?? [];
|
|
149
197
|
return new GroupOfVariables(profile, { code: "subtypes" }, values);
|
|
150
198
|
}
|
|
151
|
-
function
|
|
152
|
-
if (!domain || domain.type !== "coded-value") {
|
|
153
|
-
return null;
|
|
154
|
-
}
|
|
199
|
+
function getCodedValueDomainGroup(profile, domain, label) {
|
|
155
200
|
const values = domain.codedValues.map((v) => new ValueVariable({
|
|
156
201
|
profile,
|
|
157
202
|
label: `${v.code}`,
|
|
@@ -161,29 +206,33 @@ function getDomainValuesProperties(profile, domain, label) {
|
|
|
161
206
|
}));
|
|
162
207
|
return new GroupOfVariables(profile, label, values);
|
|
163
208
|
}
|
|
164
|
-
function
|
|
209
|
+
function getDomainValuesGroup(profile, types, field) {
|
|
165
210
|
const variables = [];
|
|
166
|
-
types.
|
|
167
|
-
|
|
211
|
+
if (!types || types.length === 0) {
|
|
212
|
+
return null;
|
|
213
|
+
}
|
|
214
|
+
types.forEach((type) => {
|
|
215
|
+
let domain = type.domains[field.name];
|
|
168
216
|
if (!domain) {
|
|
169
217
|
return;
|
|
170
218
|
}
|
|
171
|
-
if (domain
|
|
219
|
+
if (isInheritedDomainInstance(domain)) {
|
|
172
220
|
domain = field.domain;
|
|
173
221
|
return;
|
|
174
222
|
}
|
|
175
|
-
|
|
223
|
+
if (!isCodedValueDomainInstance(domain)) {
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
const domainValuesGroup = getCodedValueDomainGroup(profile, domain, {
|
|
176
227
|
code: "domainvaluesfortypeformat",
|
|
177
228
|
formatValues: {
|
|
178
229
|
fieldName: field.alias ?? field.name,
|
|
179
|
-
typeName:
|
|
230
|
+
typeName: type.name
|
|
180
231
|
}
|
|
181
232
|
});
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}
|
|
185
|
-
const label = `${t.id}`;
|
|
186
|
-
const snippet = `"${t.id}""`;
|
|
233
|
+
const id = isSubtypeInstance(type) ? type.code : type.id;
|
|
234
|
+
const label = `${id}`;
|
|
235
|
+
const snippet = `"${id}""`;
|
|
187
236
|
const subtypeDictionary = new DictionaryVariable({ profile, label, snippet });
|
|
188
237
|
subtypeDictionary.variables = [domainValuesGroup];
|
|
189
238
|
variables.push(subtypeDictionary);
|
|
@@ -193,6 +242,9 @@ function getDomainValuesBySubtypeGroup(profile, types, field) {
|
|
|
193
242
|
}
|
|
194
243
|
return new GroupOfVariables(profile, { code: "domainvaluesbysubtypes" }, variables);
|
|
195
244
|
}
|
|
245
|
+
function areAllDomainsInherited(types, field) {
|
|
246
|
+
return types?.every((type) => type.domains[field.name]?.type === "inherited") ?? false;
|
|
247
|
+
}
|
|
196
248
|
// const validIdentifierExpr = new RegExp(/^[a-z_$][\w$]*$/gi);
|
|
197
249
|
const validIdentifierExpr = /^[a-z_$][a-z0-9_$]*$/giu;
|
|
198
250
|
function getMemberExpressionProperty(prop, includeDot = true) {
|
|
@@ -255,10 +307,7 @@ function filterFeatureLayerInfos(layers, queryCapability) {
|
|
|
255
307
|
//#endregion
|
|
256
308
|
//#region Functions to Editor Variables to a language service variables
|
|
257
309
|
async function variablesToLSVariable(editorVariables, kind = CompletionItemKind.Variable) {
|
|
258
|
-
|
|
259
|
-
return [];
|
|
260
|
-
}
|
|
261
|
-
const properties = await Promise.all(editorVariables.map(async (editorVariable) => {
|
|
310
|
+
return await Promise.all(editorVariables.map(async (editorVariable) => {
|
|
262
311
|
switch (editorVariable.type) {
|
|
263
312
|
case "dictionary":
|
|
264
313
|
return await dictionaryToLSDictionary(editorVariable, kind);
|
|
@@ -268,7 +317,6 @@ async function variablesToLSVariable(editorVariables, kind = CompletionItemKind.
|
|
|
268
317
|
return variableToLSVariable(editorVariable, kind);
|
|
269
318
|
}
|
|
270
319
|
}));
|
|
271
|
-
return properties.filter((p) => p);
|
|
272
320
|
}
|
|
273
321
|
function variableToLSVariable(editorVariable, kind) {
|
|
274
322
|
const { name, type } = editorVariable;
|
|
@@ -386,7 +434,7 @@ async function dictionaryToLSDictionary(editorDictionary, kind) {
|
|
|
386
434
|
previous += ` \n${description}`;
|
|
387
435
|
}
|
|
388
436
|
return previous;
|
|
389
|
-
}, description
|
|
437
|
+
}, description);
|
|
390
438
|
return {
|
|
391
439
|
name,
|
|
392
440
|
description,
|
|
@@ -427,9 +475,9 @@ class ProfileItemBase {
|
|
|
427
475
|
// If the component is under RTL, the string is messed up.
|
|
428
476
|
// It is converted from $feature to feature$, This is not acceptable since the label
|
|
429
477
|
// represents a variable name. We are adding in front of the $ sign a right to left mark.
|
|
430
|
-
return
|
|
478
|
+
return J(this._label);
|
|
431
479
|
}
|
|
432
|
-
return
|
|
480
|
+
return I(this._profile?.intlStrings[this._label.code], this._label.formatValues);
|
|
433
481
|
}
|
|
434
482
|
/**
|
|
435
483
|
* Returns the description string.
|
|
@@ -441,7 +489,7 @@ class ProfileItemBase {
|
|
|
441
489
|
if (typeof this.description === "string") {
|
|
442
490
|
return this.description;
|
|
443
491
|
}
|
|
444
|
-
return
|
|
492
|
+
return I(this._profile?.intlStrings[this.description.code], this.description.formatValues);
|
|
445
493
|
}
|
|
446
494
|
/**
|
|
447
495
|
* Returns true if the item pass the filter test
|
|
@@ -464,7 +512,7 @@ class VariableBase extends ProfileItemBase {
|
|
|
464
512
|
super(props.profile, props.label, props.description ?? props.declaration?.description);
|
|
465
513
|
this.declaration = props.declaration ?? {};
|
|
466
514
|
this.name = props.declaration?.name ?? "";
|
|
467
|
-
this.snippet = props.snippet
|
|
515
|
+
this.snippet = props.snippet ?? "";
|
|
468
516
|
this.nonInteractive = props.nonInteractive ?? false;
|
|
469
517
|
this.filterDescription = props.filterDescription ?? false;
|
|
470
518
|
this.icon = props.icon;
|
|
@@ -482,7 +530,7 @@ class ValueVariable extends VariableBase {
|
|
|
482
530
|
}
|
|
483
531
|
getDescription() {
|
|
484
532
|
if (this.description == null) {
|
|
485
|
-
return
|
|
533
|
+
return this._profile?.intlStrings[this.type.toLowerCase()] ?? "";
|
|
486
534
|
}
|
|
487
535
|
return super.getDescription();
|
|
488
536
|
}
|
|
@@ -503,7 +551,7 @@ class ArrayVariable extends VariableBase {
|
|
|
503
551
|
}
|
|
504
552
|
getDescription() {
|
|
505
553
|
if (this.description == null) {
|
|
506
|
-
return
|
|
554
|
+
return this._profile?.intlStrings[this.type.toLowerCase()] ?? "";
|
|
507
555
|
}
|
|
508
556
|
return super.getDescription();
|
|
509
557
|
}
|
|
@@ -518,8 +566,8 @@ class ArrayVariable extends VariableBase {
|
|
|
518
566
|
* collection is ready or not.
|
|
519
567
|
*/
|
|
520
568
|
class CollectionBasedVariable extends VariableBase {
|
|
521
|
-
constructor(
|
|
522
|
-
super(
|
|
569
|
+
constructor() {
|
|
570
|
+
super(...arguments);
|
|
523
571
|
this.isCollection = true;
|
|
524
572
|
this._loaded = true;
|
|
525
573
|
/**
|
|
@@ -655,42 +703,53 @@ class SourceBasedVariable extends CollectionBasedVariable {
|
|
|
655
703
|
this._definition = props.declaration?.definition;
|
|
656
704
|
}
|
|
657
705
|
get title() {
|
|
658
|
-
return this._source
|
|
706
|
+
return isTitleCapableSource(this._source) ? this._source.title : "";
|
|
659
707
|
}
|
|
660
708
|
get url() {
|
|
661
|
-
return this.
|
|
709
|
+
return isUrlCapableSource(this._source) ? this._source.url : "";
|
|
662
710
|
}
|
|
663
711
|
get informationUrl() {
|
|
664
712
|
if (!this.loaded) {
|
|
665
713
|
return null;
|
|
666
714
|
}
|
|
667
|
-
|
|
668
|
-
if (!url) {
|
|
715
|
+
if (!this.url) {
|
|
669
716
|
return null;
|
|
670
717
|
}
|
|
671
|
-
|
|
672
|
-
return `${url}/${layerId}`;
|
|
718
|
+
return isLayerIdCapableSource(this._source) ? `${this.url}/${this._source.layerId}` : this.url;
|
|
673
719
|
}
|
|
674
720
|
get informationType() {
|
|
675
721
|
return this._profile?.intlStrings.layer ?? "layer";
|
|
676
722
|
}
|
|
677
723
|
async loadSource() {
|
|
678
|
-
if (
|
|
724
|
+
if (Z(this._loadPromise) && ee(this._loadPromise)) {
|
|
679
725
|
return await this._loadPromise;
|
|
680
726
|
}
|
|
681
727
|
this._loadPromise = this._loadSource();
|
|
682
728
|
return await this._loadPromise;
|
|
683
729
|
}
|
|
730
|
+
_getValueSnippet(field) {
|
|
731
|
+
// If the source is a feature, then we want to assemble the snippet ($feature) with the field name as a member expression
|
|
732
|
+
return this.type === "feature" ? assembleMemberExpression(this.snippet, field.name) : field.name;
|
|
733
|
+
}
|
|
734
|
+
_getSubtypeOrDomainNameSnippet(field) {
|
|
735
|
+
if (this.type !== "feature") {
|
|
736
|
+
return null;
|
|
737
|
+
}
|
|
738
|
+
if (isSubtypeFieldCapableLayer(this._source) && field.name === this._source.subtypeField) {
|
|
739
|
+
return `SubtypeName(${this.snippet})`;
|
|
740
|
+
}
|
|
741
|
+
return `DomainName(${this.snippet}, "${field.name}")`;
|
|
742
|
+
}
|
|
684
743
|
_getFieldProperty(field) {
|
|
685
744
|
// Check if the field is the type id field or of the field has a coded domain.
|
|
686
745
|
// If it has then the property will be an exanpdable property (dictionary).
|
|
687
746
|
// Otherwise just return a simple value property.
|
|
688
|
-
const subtypesOrDomainValuesDictionary = this.
|
|
747
|
+
const subtypesOrDomainValuesDictionary = this._getDomainDictionary(field);
|
|
689
748
|
if (subtypesOrDomainValuesDictionary) {
|
|
690
749
|
return subtypesOrDomainValuesDictionary;
|
|
691
750
|
}
|
|
692
751
|
// Create the value property
|
|
693
|
-
const valueSnippet = this.
|
|
752
|
+
const valueSnippet = this._getValueSnippet(field);
|
|
694
753
|
return new ValueVariable({
|
|
695
754
|
profile: this._profile,
|
|
696
755
|
label: valueSnippet,
|
|
@@ -700,12 +759,107 @@ class SourceBasedVariable extends CollectionBasedVariable {
|
|
|
700
759
|
filterDescription: true
|
|
701
760
|
});
|
|
702
761
|
}
|
|
703
|
-
|
|
762
|
+
_getDomainDictionary(field) {
|
|
704
763
|
if (!isDomainsCapableLayer(this._source)) {
|
|
705
764
|
return null;
|
|
706
765
|
}
|
|
707
|
-
//
|
|
708
|
-
|
|
766
|
+
// Note we have multiple scenarios:
|
|
767
|
+
// - Layers without subtypes or feature types: We will check if the field has a domain
|
|
768
|
+
// - Layers with only subtypes: We will parse the subtypes metadata and create a dictionary
|
|
769
|
+
// - Layers with only feature types: We will parse the feature types metadata
|
|
770
|
+
// - Layers with both subtypes and feature types: we will actually use the subtypes metadata
|
|
771
|
+
// Summary, we will always use the subtypes metadata if available.
|
|
772
|
+
if (isSubtypeFieldCapableLayer(this._source) && !!this._source.subtypeField) {
|
|
773
|
+
return this._getSubtypeDomainDictionary(field);
|
|
774
|
+
}
|
|
775
|
+
if (isFeatureTypesCapableLayer(this._source) && !!this._source.typeIdField) {
|
|
776
|
+
return this._getFeatureTypeDomainDictionary(field);
|
|
777
|
+
}
|
|
778
|
+
return this._getFieldDomainDictionary(field);
|
|
779
|
+
}
|
|
780
|
+
_getSubtypeDomainDictionary(field) {
|
|
781
|
+
// Should be tested before calling this function
|
|
782
|
+
if (!isSubtypeFieldCapableLayer(this._source)) {
|
|
783
|
+
return null;
|
|
784
|
+
}
|
|
785
|
+
// If the source has a subtype field but doesn't have subtypes, it is certainly a subtype sublayer
|
|
786
|
+
if (!isSubtypesCapableLayer(this._source)) {
|
|
787
|
+
// For the subtype field there is no domain
|
|
788
|
+
if (field.name === this._source.subtypeField) {
|
|
789
|
+
return null;
|
|
790
|
+
}
|
|
791
|
+
// For the other fields, we will use the getFieldDomain function
|
|
792
|
+
return this._getFieldDomainDictionary(field);
|
|
793
|
+
}
|
|
794
|
+
// The code here shoud be executed for layers that have subtypes
|
|
795
|
+
// Sepcial case for the subtype field
|
|
796
|
+
if (field.name === this._source.subtypeField) {
|
|
797
|
+
const domainDictionary = this._createDomainDictionary(field);
|
|
798
|
+
domainDictionary.variables.push(getTypeOrSubtypeDomainGroup(this._profile, this._source.subtypes, field));
|
|
799
|
+
return domainDictionary;
|
|
800
|
+
}
|
|
801
|
+
// Check if all the domains for the field in the types are inherited.
|
|
802
|
+
// If it is we can simplify the structure by avoiding splitting in subtypes
|
|
803
|
+
if (areAllDomainsInherited(this._source.subtypes, field)) {
|
|
804
|
+
return this._getFieldDomainDictionary(field);
|
|
805
|
+
}
|
|
806
|
+
// We have domains per subtype
|
|
807
|
+
// We need to go thru each types and create a dictionary.
|
|
808
|
+
const domainValuesBySubtypeGroup = getDomainValuesGroup(this._profile, this._source.subtypes, field);
|
|
809
|
+
if (!domainValuesBySubtypeGroup) {
|
|
810
|
+
return null;
|
|
811
|
+
}
|
|
812
|
+
const domainDictionary = this._createDomainDictionary(field);
|
|
813
|
+
domainDictionary.variables.push(domainValuesBySubtypeGroup);
|
|
814
|
+
return domainDictionary;
|
|
815
|
+
}
|
|
816
|
+
_getFeatureTypeDomainDictionary(field) {
|
|
817
|
+
// SHould be tested before calling this function
|
|
818
|
+
if (!isFeatureTypesCapableLayer(this._source)) {
|
|
819
|
+
return null;
|
|
820
|
+
}
|
|
821
|
+
// Special case for the type id field
|
|
822
|
+
if (field.name === this._source.typeIdField) {
|
|
823
|
+
const domainDictionary = this._createDomainDictionary(field);
|
|
824
|
+
domainDictionary.variables.push(getTypeOrSubtypeDomainGroup(this._profile, this._source.types, field));
|
|
825
|
+
return domainDictionary;
|
|
826
|
+
}
|
|
827
|
+
// Check if all the domains for the field in the types are inherited.
|
|
828
|
+
// If it is we can simplify the structure by avoiding splitting in subtypes
|
|
829
|
+
if (areAllDomainsInherited(this._source.types, field)) {
|
|
830
|
+
return this._getFieldDomainDictionary(field);
|
|
831
|
+
}
|
|
832
|
+
// We have domains per feature type
|
|
833
|
+
// We need to go thru each types and create a dictionary.
|
|
834
|
+
const domainValuesByFeatureTypeGroup = getDomainValuesGroup(this._profile, this._source.types, field);
|
|
835
|
+
if (!domainValuesByFeatureTypeGroup) {
|
|
836
|
+
return null;
|
|
837
|
+
}
|
|
838
|
+
const domainDictionary = this._createDomainDictionary(field);
|
|
839
|
+
domainDictionary.variables.push(domainValuesByFeatureTypeGroup);
|
|
840
|
+
return domainDictionary;
|
|
841
|
+
}
|
|
842
|
+
_getFieldDomainDictionary(field) {
|
|
843
|
+
// SHould be tested before calling this function
|
|
844
|
+
if (!isDomainsCapableLayer(this._source)) {
|
|
845
|
+
return null;
|
|
846
|
+
}
|
|
847
|
+
const fieldDomain = this._source.getFieldDomain(field.name);
|
|
848
|
+
if (!isCodedValueDomainInstance(fieldDomain)) {
|
|
849
|
+
return null;
|
|
850
|
+
}
|
|
851
|
+
const domainValuesGroup = getCodedValueDomainGroup(this._profile, fieldDomain, {
|
|
852
|
+
code: "domainvalues"
|
|
853
|
+
});
|
|
854
|
+
const domainDictionary = this._createDomainDictionary(field);
|
|
855
|
+
domainDictionary.variables.push(domainValuesGroup);
|
|
856
|
+
return domainDictionary;
|
|
857
|
+
}
|
|
858
|
+
_createDomainDictionary(field) {
|
|
859
|
+
// Create the domain dictionary.
|
|
860
|
+
// The dictionary will have a header group and a value group.
|
|
861
|
+
// At this point we are only creating the header group in the dictionary.
|
|
862
|
+
const valueSnippet = this._getValueSnippet(field);
|
|
709
863
|
const domainDictionary = new DictionaryVariable({
|
|
710
864
|
profile: this._profile,
|
|
711
865
|
label: valueSnippet,
|
|
@@ -723,45 +877,16 @@ class SourceBasedVariable extends CollectionBasedVariable {
|
|
|
723
877
|
})
|
|
724
878
|
]);
|
|
725
879
|
domainDictionary.variables = [headerGroup];
|
|
726
|
-
//
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
domainDictionary.variables.push(subtypesGroup);
|
|
730
|
-
return domainDictionary;
|
|
731
|
-
}
|
|
732
|
-
// Since its' not the subtype field then add the snippet for the domain name
|
|
733
|
-
if (this.type === "feature") {
|
|
734
|
-
const domainNameSnippet = `DomainName(${this.snippet}, "${field.name}")`;
|
|
880
|
+
// Add the SubtypeName or DomainName snippet if available
|
|
881
|
+
const subtypeOrDomainNameSnippet = this._getSubtypeOrDomainNameSnippet(field);
|
|
882
|
+
if (subtypeOrDomainNameSnippet) {
|
|
735
883
|
headerGroup.variables.push(new ValueVariable({
|
|
736
884
|
profile: this._profile,
|
|
737
|
-
label:
|
|
885
|
+
label: subtypeOrDomainNameSnippet,
|
|
738
886
|
description: "",
|
|
739
|
-
snippet:
|
|
887
|
+
snippet: subtypeOrDomainNameSnippet
|
|
740
888
|
}));
|
|
741
889
|
}
|
|
742
|
-
if (isTypesCapabaleLayer(this._source)) {
|
|
743
|
-
// Check if all the domains for the field in the types are inherited.
|
|
744
|
-
// If it is we can simplify the structure by avoiding splitting in subtypes
|
|
745
|
-
const allInherited = this._source.types.every((t) => t.domains[field.name].type === "inherited");
|
|
746
|
-
if (!allInherited) {
|
|
747
|
-
// We have domains per subtype
|
|
748
|
-
// We need to go thru each types and create a dictionary.
|
|
749
|
-
const domainValuesBySubtypeGroup = getDomainValuesBySubtypeGroup(this._profile, this._source.types, field);
|
|
750
|
-
if (!domainValuesBySubtypeGroup) {
|
|
751
|
-
return null;
|
|
752
|
-
}
|
|
753
|
-
domainDictionary.variables.push(domainValuesBySubtypeGroup);
|
|
754
|
-
return domainDictionary;
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
// Either we have types but all the domains are inherited or we don't have types
|
|
758
|
-
const domainValuesGroup = getDomainValuesProperties(this._profile, this._source.getFieldDomain(field.name), {
|
|
759
|
-
code: "domainvalues"
|
|
760
|
-
});
|
|
761
|
-
if (!domainValuesGroup) {
|
|
762
|
-
return null;
|
|
763
|
-
}
|
|
764
|
-
domainDictionary.variables.push(domainValuesGroup);
|
|
765
890
|
return domainDictionary;
|
|
766
891
|
}
|
|
767
892
|
async _getRelationshipsProperty() {
|
|
@@ -792,7 +917,7 @@ class SourceBasedVariable extends CollectionBasedVariable {
|
|
|
792
917
|
nonInteractive: true
|
|
793
918
|
}, [new ValueVariable({ profile: this._profile, label: snippet, description: "", snippet })], { exposeRelationships: true, sourceTableId: source.layerId });
|
|
794
919
|
}));
|
|
795
|
-
relationshipsGroup.variables = relationshipItems.filter(
|
|
920
|
+
relationshipsGroup.variables = relationshipItems.filter(Z);
|
|
796
921
|
if (!relationshipsGroup.variables.length) {
|
|
797
922
|
return null;
|
|
798
923
|
}
|
|
@@ -950,7 +1075,7 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
|
|
|
950
1075
|
return this._profile?.intlStrings.featureservice ?? "featureservice";
|
|
951
1076
|
}
|
|
952
1077
|
async loadSource() {
|
|
953
|
-
if (
|
|
1078
|
+
if (Z(this._loadPromise) && ee(this._loadPromise)) {
|
|
954
1079
|
return await this._loadPromise;
|
|
955
1080
|
}
|
|
956
1081
|
this._loadPromise = this._loadSource();
|
|
@@ -971,7 +1096,7 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
|
|
|
971
1096
|
: {
|
|
972
1097
|
code: "webmapformat",
|
|
973
1098
|
formatValues: {
|
|
974
|
-
webMapTitle: this._featureSetCollections.source.portalItem.title
|
|
1099
|
+
webMapTitle: this._featureSetCollections.source.portalItem.title || "Untitled map"
|
|
975
1100
|
}
|
|
976
1101
|
};
|
|
977
1102
|
const headerGroup = new GroupOfVariables(this._profile, groupLabel, [
|
|
@@ -1048,22 +1173,25 @@ class FeatureSetCollectionVariable extends CollectionBasedVariable {
|
|
|
1048
1173
|
}
|
|
1049
1174
|
}
|
|
1050
1175
|
async _featureSetCollectionFromUrl(url) {
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1176
|
+
let processedUrl = url.replace(/\/featureserver\/[0-9]*/iu, "/FeatureServer");
|
|
1177
|
+
processedUrl = processedUrl.replace(/\/mapserver\/[0-9]*/iu, "/MapServer");
|
|
1178
|
+
processedUrl = processedUrl.split("?")[0];
|
|
1179
|
+
if (!processedUrl) {
|
|
1180
|
+
return null;
|
|
1181
|
+
}
|
|
1182
|
+
const metadata = await serviceMetaData(processedUrl);
|
|
1055
1183
|
const layersPromise = Promise.all(metadata.layers.map(async (layerInfo) => {
|
|
1056
|
-
const featureLayer = await newFeatureLayer({ url: `${
|
|
1184
|
+
const featureLayer = await newFeatureLayer({ url: `${processedUrl}/${layerInfo.id}` });
|
|
1057
1185
|
await featureLayer.load();
|
|
1058
1186
|
return this._createFeatureSetVariable(featureLayer);
|
|
1059
1187
|
}));
|
|
1060
1188
|
const tablesPromise = Promise.all(metadata.tables.map(async (layerInfo) => {
|
|
1061
|
-
const table = await newFeatureLayer({ url: `${
|
|
1189
|
+
const table = await newFeatureLayer({ url: `${processedUrl}/${layerInfo.id}` });
|
|
1062
1190
|
await table.load();
|
|
1063
1191
|
return this._createFeatureSetVariable(table);
|
|
1064
1192
|
}));
|
|
1065
1193
|
const [layers, tables] = await Promise.all([layersPromise, tablesPromise]);
|
|
1066
|
-
return { layers, tables, source:
|
|
1194
|
+
return { layers, tables, source: processedUrl };
|
|
1067
1195
|
}
|
|
1068
1196
|
_convertWebMapLayersToVariables(layers, filteringTables = false) {
|
|
1069
1197
|
const layerVariables = [];
|
|
@@ -1198,7 +1326,7 @@ async function getSdkPredefinedProfiles(locale = "en") {
|
|
|
1198
1326
|
try {
|
|
1199
1327
|
const response = await fetch(getAssetPath(`./assets/arcade-language/profiles/arcade-profiles.t9n.${locale}.json`));
|
|
1200
1328
|
if (response.ok) {
|
|
1201
|
-
return cacheSdkPredefinedProfiles(locale, await response.json());
|
|
1329
|
+
return cacheSdkPredefinedProfiles(locale, (await response.json()));
|
|
1202
1330
|
}
|
|
1203
1331
|
if (locale === "en") {
|
|
1204
1332
|
return null;
|
|
@@ -1226,13 +1354,10 @@ async function getSdkPredefinedProfile(id, locale = "en") {
|
|
|
1226
1354
|
const profiles = await getSdkPredefinedProfiles(locale);
|
|
1227
1355
|
return profiles?.get(id) ?? null;
|
|
1228
1356
|
}
|
|
1229
|
-
function isExtendedPredefinedProfileDefinition(
|
|
1230
|
-
return Array.isArray(
|
|
1357
|
+
function isExtendedPredefinedProfileDefinition(item) {
|
|
1358
|
+
return !!item && typeof item === "object" && "additionalVariables" in item && Array.isArray(item.additionalVariables);
|
|
1231
1359
|
}
|
|
1232
1360
|
function convertApiVariables(variables) {
|
|
1233
|
-
if (!variables) {
|
|
1234
|
-
return [];
|
|
1235
|
-
}
|
|
1236
1361
|
return variables.map(convertApiVariable);
|
|
1237
1362
|
}
|
|
1238
1363
|
function convertApiVariable(variable) {
|