@arcgis/coding-components 4.31.0-next.2 → 4.31.0-next.21
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/css.worker.js +1 -1
- package/dist/arcgis-coding-components/assets/code-editor/html.worker.js +1 -1
- package/dist/arcgis-coding-components/assets/code-editor/json.worker.js +1 -1
- package/dist/arcgis-coding-components/assets/code-editor/sql-expr.worker.js +33 -0
- package/dist/arcgis-coding-components/assets/code-editor/ts.worker.js +1 -1
- 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 +735 -0
- package/dist/arcgis-coding-components/index.esm.js +2 -2
- package/dist/arcgis-coding-components/{p-7984ea8e.js → p-1b799777.js} +2 -2
- package/dist/arcgis-coding-components/p-4d5cf512.entry.js +6 -0
- package/dist/arcgis-coding-components/{p-60c2a820.js → p-56266a64.js} +2 -2
- package/dist/arcgis-coding-components/{p-e8211ffe.js → p-57b8bcd7.js} +1 -1
- package/dist/arcgis-coding-components/{p-9eced6fc.js → p-5b67b62b.js} +2 -2
- package/dist/arcgis-coding-components/{p-93a97573.js → p-64137fec.js} +3 -3
- package/dist/arcgis-coding-components/{p-e7ee4d64.js → p-6621a80f.js} +3 -3
- package/dist/arcgis-coding-components/p-77dd5521.js +6 -0
- package/dist/arcgis-coding-components/p-8eb7e694.js +6 -0
- package/dist/arcgis-coding-components/p-a2341e0c.js +6 -0
- package/dist/arcgis-coding-components/{p-bb7e832e.js → p-b715834b.js} +3 -3
- package/dist/arcgis-coding-components/p-cbee273f.js +6 -0
- package/dist/arcgis-coding-components/{p-5ef7cce5.js → p-cdc52d2f.js} +1 -1
- package/dist/arcgis-coding-components/{p-36fedc23.js → p-d7d1f130.js} +12 -12
- package/dist/arcgis-coding-components/p-e1f9b463.entry.js +6 -0
- package/dist/arcgis-coding-components/{p-62ee6251.js → p-e5a924a1.js} +1 -1
- package/dist/arcgis-coding-components/p-f2d64a9d.js +6 -0
- package/dist/arcgis-coding-components/{p-03ea6cd7.js → p-ff62d134.js} +3 -3
- package/dist/arcgis-coding-components/p-ffce0588.entry.js +6 -0
- package/dist/cjs/{app-globals-aee5f4b5.js → app-globals-a9ef3ca8.js} +1 -1
- package/dist/cjs/arcade-defaults-f5241680.js +349 -0
- package/dist/cjs/arcade-language-features-0b9f3947.js +274 -0
- package/dist/cjs/arcade-mode-cc08d9cd.js +335 -0
- package/dist/cjs/arcgis-arcade-editor_6.cjs.entry.js +181 -1501
- package/dist/cjs/arcgis-coding-components.cjs.js +4 -4
- package/dist/cjs/arcgis-sql-expression-editor.cjs.entry.js +81 -0
- package/dist/cjs/arcgis-sql-expression-fields.cjs.entry.js +80 -0
- package/dist/cjs/{css-7cc05f76.js → css-bb6a49ec.js} +1 -1
- package/dist/cjs/{cssMode-2b0daeae.js → cssMode-e7fac7d7.js} +3 -4
- package/dist/cjs/{html-f56911e1.js → html-7ff4071d.js} +3 -4
- package/dist/cjs/{htmlMode-43eed674.js → htmlMode-c89193ec.js} +3 -4
- package/dist/cjs/{index-b34238a6.js → index-4b7880ab.js} +9 -1
- package/dist/cjs/index.cjs.js +4 -3
- package/dist/cjs/{javascript-5115cb76.js → javascript-864c0220.js} +3 -4
- package/dist/cjs/{jsonMode-550dda36.js → jsonMode-ac4a7be7.js} +3 -4
- package/dist/cjs/{arcade-defaults-a8d8f8e2.js → language-defaults-base-57b37f9f.js} +842 -1183
- package/dist/cjs/loader.cjs.js +4 -4
- package/dist/cjs/sql-expr-defaults-245b036d.js +1347 -0
- package/dist/cjs/sql-expr-mode-304f5ce2.js +20844 -0
- package/dist/cjs/{tsMode-336306a9.js → tsMode-d30d4ab1.js} +4 -5
- package/dist/cjs/{typescript-b395242f.js → typescript-6c87ddb3.js} +3 -4
- package/dist/components/arcade-defaults.js +54 -1369
- package/dist/components/arcade-language-features.js +271 -0
- package/dist/components/arcade-mode.js +4 -264
- package/dist/components/arcade-results.js +7 -5
- package/dist/components/arcade-suggestions.js +7 -5
- package/dist/components/arcade-variables.js +8 -6
- package/dist/components/arcgis-arcade-editor.js +37 -35
- 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 +1 -1
- package/dist/components/arcgis-assets.js +1 -1
- 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.d.ts +11 -0
- package/dist/components/arcgis-sql-expression-editor.js +120 -0
- package/dist/components/arcgis-sql-expression-fields.d.ts +11 -0
- package/dist/components/arcgis-sql-expression-fields.js +11 -0
- package/dist/components/chunk-2JTWBRMN.js +1154 -0
- package/dist/components/code-editor.js +40 -13
- package/dist/components/fields.js +5 -5
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +30 -22
- package/dist/components/language-api-panel.js +13 -40
- package/dist/components/language-defaults-base.js +1309 -0
- package/dist/components/markdown.js +1 -1
- package/dist/components/sql-expr-defaults.js +196 -0
- package/dist/components/sql-expr-mode.js +20842 -0
- package/dist/components/sql-expression-fields.js +102 -0
- package/dist/components/useT9n.js +45 -8
- package/dist/components/utilities.js +1 -1
- package/dist/esm/{app-globals-59faaf33.js → app-globals-6d0ca11d.js} +1 -1
- package/dist/esm/arcade-defaults-066445c4.js +344 -0
- package/dist/esm/arcade-language-features-0e00c199.js +269 -0
- package/dist/esm/{arcade-mode-5d46035e.js → arcade-mode-abf1e1cf.js} +3 -263
- package/dist/esm/arcgis-arcade-editor_6.entry.js +127 -1447
- package/dist/esm/arcgis-coding-components.js +5 -5
- package/dist/esm/arcgis-sql-expression-editor.entry.js +77 -0
- package/dist/esm/arcgis-sql-expression-fields.entry.js +76 -0
- package/dist/esm/{css-e257dc49.js → css-c6dae12d.js} +1 -1
- package/dist/esm/{cssMode-c11f7f40.js → cssMode-052bb603.js} +2 -3
- package/dist/esm/{html-a6c37a99.js → html-572696a1.js} +2 -3
- package/dist/esm/{htmlMode-1270bc7d.js → htmlMode-fc184f2d.js} +2 -3
- package/dist/esm/{index-a970952c.js → index-0edd9846.js} +9 -1
- package/dist/esm/index.js +4 -3
- package/dist/esm/{javascript-ee179624.js → javascript-8bfc0096.js} +3 -4
- package/dist/esm/{jsonMode-07502ccb.js → jsonMode-7adf94ff.js} +2 -3
- package/dist/esm/{arcade-defaults-9eb28407.js → language-defaults-base-85a7f476.js} +833 -1179
- package/dist/esm/loader.js +5 -5
- package/dist/esm/sql-expr-defaults-be84ec7f.js +1339 -0
- package/dist/esm/sql-expr-mode-a4413e5c.js +20840 -0
- package/dist/esm/{tsMode-96749a12.js → tsMode-d10773c8.js} +2 -3
- package/dist/esm/{typescript-a3cf9881.js → typescript-9491f23e.js} +2 -3
- package/dist/loader/cdn.js +1 -1
- package/dist/loader/index.cjs.js +1 -1
- package/dist/loader/index.es2017.js +1 -1
- package/dist/loader/index.js +1 -1
- package/dist/types/components/arcade-editor/arcade-editor.d.ts +45 -10
- package/dist/types/components/arcade-results/arcade-results.d.ts +43 -1
- package/dist/types/components/arcade-suggestions/arcade-suggestions.d.ts +22 -1
- package/dist/types/components/arcade-variables/arcade-variables.d.ts +28 -1
- package/dist/types/components/code-editor/code-editor.d.ts +16 -5
- package/dist/types/components/language-api-panel/language-api-panel.d.ts +34 -8
- package/dist/types/components/sql-expression-editor/sql-expression-editor.d.ts +24 -0
- package/dist/types/components/sql-expression-fields/sql-expression-fields.d.ts +32 -0
- package/dist/types/components.d.ts +98 -24
- package/dist/types/data/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/_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/data/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 +13 -0
- package/dist/types/dependencies.d.ts +6 -10
- 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/fields.d.ts +2 -2
- package/dist/types/utils/language-defaults-base.d.ts +2 -9
- package/dist/types/utils/profile/editor-profile.d.ts +7 -6
- package/dist/types/utils/profile/types.d.ts +53 -65
- package/dist/types/utils/profile/utils.d.ts +9 -8
- package/dist/types/utils/sql-expr-monaco/DependentFiles/DateOnly.d.ts +41 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/SqlInterval.d.ts +16 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/SqlTimestampOffset.d.ts +26 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/TimeOnly.d.ts +37 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/UnknownTimeZone.d.ts +11 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/WhereGrammar.d.ts +122 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/sqlCompareUtils.d.ts +5 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/sqlDateParsingUtils.d.ts +18 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/sqlUtils.d.ts +6 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/standardizedFunctions.d.ts +156 -0
- package/dist/types/utils/sql-expr-monaco/DependentFiles/support.d.ts +150 -0
- package/dist/types/utils/sql-expr-monaco/PeggyGrammar/sql92grammar.d.ts +1397 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-completion.d.ts +6 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-constants.d.ts +45 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-contribution.d.ts +1 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-defaults.d.ts +21 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-language-features.d.ts +39 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-language-syntax.d.ts +8 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-mode.d.ts +43 -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 +34 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-validation-utils.d.ts +100 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-validation.d.ts +41 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr-worker-manager.d.ts +17 -0
- package/dist/types/utils/sql-expr-monaco/sql-expr.worker.d.ts +24 -0
- 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 +89 -0
- package/package.json +27 -21
- package/dist/arcgis-coding-components/p-0c6de9b3.js +0 -6
- package/dist/arcgis-coding-components/p-81c37dab.entry.js +0 -6
- package/dist/cjs/arcade-mode-b85ae7d4.js +0 -595
- package/dist/components/chunk-IHYYRFLQ.js +0 -1363
- package/dist/types/components/arcade-editor/t9n-types.d.ts +0 -8
- package/dist/types/components/arcade-results/t9n-types.d.ts +0 -13
- package/dist/types/components/arcade-suggestions/t9n-types.d.ts +0 -6
- package/dist/types/components/arcade-variables/t9n-types.d.ts +0 -8
- package/dist/types/components/language-api-panel/t9n-types.d.ts +0 -8
- package/dist/types/utils/profile/predefined-profile.d.ts +0 -2
|
@@ -1,10 +1,10 @@
|
|
|
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.21
|
|
5
5
|
*/
|
|
6
6
|
// src/index.ts
|
|
7
|
-
var isAMD = typeof window !== "undefined" && "$arcgis" in window && typeof window.$arcgis === "object" && "import" in window.$arcgis;
|
|
7
|
+
var isAMD = typeof window !== "undefined" && "$arcgis" in window && typeof window.$arcgis === "object" && "import" in window.$arcgis && !("forceESM" in window.$arcgis);
|
|
8
8
|
function isDefaultModule(module) {
|
|
9
9
|
return module.default !== void 0;
|
|
10
10
|
}
|
|
@@ -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.21
|
|
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.21
|
|
5
5
|
*/
|
|
6
6
|
// src/array-utils.ts
|
|
7
7
|
|
|
@@ -189,13 +189,9 @@ function gen(count) {
|
|
|
189
189
|
function generateGuid() {
|
|
190
190
|
return [gen(2), gen(1), gen(1), gen(1), gen(3)].join("-");
|
|
191
191
|
}
|
|
192
|
-
var camelToKebab = (string) => string.replace(upperBeforeLower, (upper, remainder) => `${remainder === 0 ? "" : "-"}${upper.toLowerCase()}`);
|
|
193
|
-
var upperBeforeLower = /[A-Z]+(?![a-z])|[A-Z]/gu;
|
|
194
|
-
var capitalize = (string) => string.charAt(0).toUpperCase() + string.slice(1);
|
|
195
|
-
var camelToHuman = (string) => capitalize(string.replace(upperBeforeLower, (upper, remainder) => `${remainder === 0 ? "" : " "}${upper}`));
|
|
196
192
|
|
|
197
193
|
// src/intl.ts
|
|
198
|
-
var
|
|
194
|
+
var supportedLocalesArray = [
|
|
199
195
|
"ar",
|
|
200
196
|
"bg",
|
|
201
197
|
"bs",
|
|
@@ -236,9 +232,18 @@ var supportedLocales = /* @__PURE__ */ new Set([
|
|
|
236
232
|
"zh-CN",
|
|
237
233
|
"zh-HK",
|
|
238
234
|
"zh-TW"
|
|
239
|
-
]
|
|
235
|
+
];
|
|
236
|
+
var supportedLocales = new Set(supportedLocalesArray);
|
|
240
237
|
var defaultLocale = "en";
|
|
241
|
-
|
|
238
|
+
var localeEquivalencies = {
|
|
239
|
+
// We use `pt-BR` as it will have the same translations as `pt`, which has no corresponding bundle
|
|
240
|
+
pt: "pt-PT",
|
|
241
|
+
// We support both 'nb' and 'no' (BCP 47) for Norwegian but only `nb` has corresponding bundle
|
|
242
|
+
no: "nb",
|
|
243
|
+
// We can `zh-CN` as base translation for chinese locales which has no corresponding bundle.
|
|
244
|
+
zh: "zh-CN"
|
|
245
|
+
};
|
|
246
|
+
async function fetchT9nStringsBundle(locale, assetsPath, prefix = "") {
|
|
242
247
|
const path = `${assetsPath}/${prefix}`;
|
|
243
248
|
const filePath = `${path}${locale}.json`;
|
|
244
249
|
t9nStringsCache[filePath] ?? (t9nStringsCache[filePath] = fetchBundle(locale, path));
|
|
@@ -254,26 +259,29 @@ async function fetchBundle(locale, path) {
|
|
|
254
259
|
}
|
|
255
260
|
} catch (error) {
|
|
256
261
|
console.error(error);
|
|
257
|
-
return
|
|
262
|
+
return {};
|
|
258
263
|
}
|
|
259
264
|
if (locale === defaultLocale) {
|
|
260
|
-
return
|
|
265
|
+
return {};
|
|
261
266
|
}
|
|
262
267
|
return await fetchBundle(defaultLocale, path);
|
|
263
268
|
}
|
|
264
|
-
var fallbackBundle = new Proxy(
|
|
265
|
-
{},
|
|
266
|
-
{
|
|
267
|
-
get: (_target, property) => camelToHuman(property.toString())
|
|
268
|
-
}
|
|
269
|
-
);
|
|
270
269
|
function getElementLocales(element) {
|
|
271
270
|
const lang = getElementAttribute(element, "lang", navigator.language || defaultLocale);
|
|
272
|
-
|
|
273
|
-
|
|
271
|
+
return { lang, t9nLocale: langToLocale(lang) };
|
|
272
|
+
}
|
|
273
|
+
function langToLocale(lang) {
|
|
274
|
+
const parts = lang.split("-");
|
|
275
|
+
const normalized = `${parts[0].toLowerCase()}${parts.slice(1).join("-").toUpperCase()}`;
|
|
276
|
+
if (supportedLocales.has(normalized)) {
|
|
277
|
+
return normalized;
|
|
278
|
+
}
|
|
279
|
+
const languageCode = normalized.slice(0, 2).toLowerCase();
|
|
280
|
+
const locale = localeEquivalencies[languageCode] ?? languageCode;
|
|
281
|
+
if (supportedLocales.has(locale)) {
|
|
282
|
+
return locale;
|
|
274
283
|
}
|
|
275
|
-
|
|
276
|
-
return { lang, t9nLocale: supportedLocales.has(rootCode) ? rootCode : defaultLocale };
|
|
284
|
+
return defaultLocale;
|
|
277
285
|
}
|
|
278
286
|
function startLocaleObserver(element, assetsPath, onUpdated, assetName) {
|
|
279
287
|
let result = void 0;
|
|
@@ -290,7 +298,7 @@ async function updateComponentLocateState(element, assetsPath, assetName = eleme
|
|
|
290
298
|
const { lang, t9nLocale } = getElementLocales(element);
|
|
291
299
|
const t9nAssetsPath = `${assetsPath}/${assetName}/t9n`;
|
|
292
300
|
const prefix = `${assetName}.t9n.`;
|
|
293
|
-
const t9nStrings = await
|
|
301
|
+
const t9nStrings = await fetchT9nStringsBundle(t9nLocale, t9nAssetsPath, prefix);
|
|
294
302
|
return { lang, t9nLocale, t9nStrings };
|
|
295
303
|
}
|
|
296
304
|
|
|
@@ -396,4 +404,4 @@ function isURL(url) {
|
|
|
396
404
|
}
|
|
397
405
|
}
|
|
398
406
|
|
|
399
|
-
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,14 +1,13 @@
|
|
|
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.21
|
|
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 {
|
|
10
|
-
import {
|
|
11
|
-
import { t as setFocusOnElement, b as addLTRMark } from './index2.js';
|
|
9
|
+
import { u as useControllerManager } from './chunk-2JTWBRMN.js';
|
|
10
|
+
import { r as setFocusOnElement, b as addLTRMark } from './index2.js';
|
|
12
11
|
import { u as useT9n } from './useT9n.js';
|
|
13
12
|
import "@esri/calcite-components/dist/components/calcite-list-item-group.js";
|
|
14
13
|
import "@esri/calcite-components/dist/components/calcite-list-item.js";
|
|
@@ -24,8 +23,9 @@ import "@esri/calcite-components/dist/components/calcite-list.js";
|
|
|
24
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)}";
|
|
25
24
|
const ArcgisLanguageApiPanelStyle0 = languageApiPanelCss;
|
|
26
25
|
|
|
27
|
-
const __cmpMeta = [1,"arcgis-language-api-panel",{"hideDocumentationActions":[1028,"hide-documentation-actions"],"
|
|
26
|
+
const __cmpMeta = [1,"arcgis-language-api-panel",{"hideDocumentationActions":[1028,"hide-documentation-actions"],"loading":[1028],"apiLibrary":[1040],"_selectedApiItem":[32],"_filterValue":[32],"_colorizeStyle":[32]}];
|
|
28
27
|
const ArcgisLanguageApiPanel = /*@__PURE__*/ proxyCustomElement(class ArcgisLanguageApiPanel extends HTMLElement {
|
|
28
|
+
connectedCallback() { this.manager._connectedCallback(); }
|
|
29
29
|
constructor() {
|
|
30
30
|
super();
|
|
31
31
|
this.__registerHost();
|
|
@@ -77,50 +77,23 @@ this.constructor.__registerControllers = ()=>__cmpMeta[2]??{};
|
|
|
77
77
|
this._selectedApiItem = undefined;
|
|
78
78
|
this._filterValue = "";
|
|
79
79
|
this._colorizeStyle = "";
|
|
80
|
-
this._preparingApi = false;
|
|
81
|
-
this._apiLibrary = undefined;
|
|
82
80
|
this.hideDocumentationActions = false;
|
|
83
|
-
this.
|
|
84
|
-
this.
|
|
81
|
+
this.loading = false;
|
|
82
|
+
this.apiLibrary = undefined;
|
|
85
83
|
}
|
|
86
84
|
//#endregion
|
|
87
85
|
// #region Component lifecycle events
|
|
88
86
|
async componentWillLoad() {
|
|
89
87
|
this._colorizeStyle = generateColorizeStyles();
|
|
90
88
|
this._themeChangedListener = onColorizeThemeChanged(() => (this._colorizeStyle = generateColorizeStyles()));
|
|
91
|
-
this.languageDefaults.onModelContextDidChange((key) => {
|
|
92
|
-
if (!this.modelId || key !== Uri.parse(this.modelId).toString()) {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
this._updateApiLibrary().catch(console.error);
|
|
96
|
-
});
|
|
97
|
-
await this._updateApiLibrary();
|
|
98
89
|
}
|
|
99
90
|
disconnectedCallback() {
|
|
91
|
+
this.manager._disconnectedCallback();
|
|
100
92
|
this._flowObserver?.disconnect();
|
|
101
93
|
this._themeChangedListener?.dispose();
|
|
102
94
|
}
|
|
103
95
|
// #endregion
|
|
104
96
|
//#region Private Methods
|
|
105
|
-
async _updateApiLibrary() {
|
|
106
|
-
if (!this.modelId) {
|
|
107
|
-
return;
|
|
108
|
-
}
|
|
109
|
-
this._preparingApi = true;
|
|
110
|
-
try {
|
|
111
|
-
this._apiLibrary = await this.languageDefaults.getApiLibrary(this.modelId);
|
|
112
|
-
}
|
|
113
|
-
catch (e) {
|
|
114
|
-
console.error("Could not load api library", e);
|
|
115
|
-
if (e instanceof Error) {
|
|
116
|
-
console.error(e.stack);
|
|
117
|
-
}
|
|
118
|
-
this._apiLibrary = undefined;
|
|
119
|
-
}
|
|
120
|
-
finally {
|
|
121
|
-
this._preparingApi = false;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
97
|
flowFocusHandler(ref) {
|
|
125
98
|
// When a flow is removed from the document then a null ref will be passed in
|
|
126
99
|
if (!ref) {
|
|
@@ -146,20 +119,20 @@ this.constructor.__registerControllers = ()=>__cmpMeta[2]??{};
|
|
|
146
119
|
if (!filteredApiItems.length) {
|
|
147
120
|
return null;
|
|
148
121
|
}
|
|
149
|
-
return (h("calcite-list-item-group", { heading: category.title }, filteredApiItems.map((apiItem) => (h("calcite-list-item", { label: addLTRMark(apiItem.completion.detail), onCalciteListItemSelect: this._emitItemSelected, onKeyPress: this._emitItemSelected, "data-item": apiItem }, h("calcite-action", { slot: "actions-end", text: this.messages.expand ?? "
|
|
122
|
+
return (h("calcite-list-item-group", { heading: category.title }, filteredApiItems.map((apiItem) => (h("calcite-list-item", { label: addLTRMark(apiItem.completion.detail), onCalciteListItemSelect: this._emitItemSelected, onKeyPress: this._emitItemSelected, "data-item": apiItem }, h("calcite-action", { slot: "actions-end", text: this.messages.expand ?? "", icon: "chevron-right", iconFlipRtl: true, scale: "s", onClick: this._selectItem, "data-item": apiItem }))))));
|
|
150
123
|
}
|
|
151
124
|
renderApiItemFlowItem() {
|
|
152
125
|
const apiItem = this._selectedApiItem;
|
|
153
126
|
if (!apiItem) {
|
|
154
127
|
return null;
|
|
155
128
|
}
|
|
156
|
-
return (h("calcite-flow-item", { heading: this.messages.constantsandfunctions, beforeBack: this._unselectItem, closable: true, onCalciteFlowItemClose: this._emitClose }, this.hideDocumentationActions ? null : (h("calcite-button", { width: "half", slot: "footer", appearance: "outline", kind: "brand", scale: "s", href: apiItem.link, target:
|
|
129
|
+
return (h("calcite-flow-item", { heading: this.messages.constantsandfunctions, beforeBack: this._unselectItem, closable: true, onCalciteFlowItemClose: this._emitClose }, this.hideDocumentationActions ? null : (h("calcite-button", { width: "half", slot: "footer", appearance: "outline", kind: "brand", scale: "s", href: apiItem.link, target: "Help", iconStart: "information" }, this.messages.moreinformation)), h("calcite-button", { width: "half", slot: "footer", appearance: "outline", kind: "brand", "icon-start": "code", scale: "s", onClick: this._emitItemSelectedAndClose, "data-item": apiItem, ref: (e) => {
|
|
157
130
|
// stencil test throws error if we don't explicitly check for e.setFocus,
|
|
158
131
|
// optional chaining is not working here
|
|
159
132
|
if (e?.setFocus) {
|
|
160
133
|
void e.setFocus();
|
|
161
134
|
}
|
|
162
|
-
} }, this.messages.insert
|
|
135
|
+
} }, this.messages.insert), h("calcite-block", { open: true, heading: addLTRMark(apiItem.completion.detail) }, h("div", { innerHTML: convertMarkdownString(apiItem.completion.documentation) }), apiItem.examples ? (h("div", { ref: (e) => {
|
|
163
136
|
if (!e) {
|
|
164
137
|
return;
|
|
165
138
|
}
|
|
@@ -168,9 +141,9 @@ this.constructor.__registerControllers = ()=>__cmpMeta[2]??{};
|
|
|
168
141
|
} })) : null)));
|
|
169
142
|
}
|
|
170
143
|
render() {
|
|
171
|
-
const categories = (this.
|
|
144
|
+
const categories = (this.apiLibrary ?? []).map((apiCategory) => this.renderApiCategory(apiCategory));
|
|
172
145
|
const empty = categories.every((g) => !g);
|
|
173
|
-
return (h(Host, { key: '
|
|
146
|
+
return (h(Host, { key: '60e169c299bceeb3d2912eea067d69005fb27bf5' }, h("style", { key: '4460f4de437b518f40f5013c6e06dadefc7c90a4' }, this._colorizeStyle), h("calcite-flow", { key: '06a7e13f55efbd24e4eb200ad2c4cbf56b699b50', ref: (ref) => this.flowFocusHandler(ref) }, h("calcite-flow-item", { key: 'db5e4e8817ee85de1c19655496529fb93bb544dd', heading: this.messages.constantsandfunctions, closable: true, onCalciteFlowItemClose: this._emitClose }, h("calcite-input", { key: 'a35a4cedbdec59eed366f719c7d48e662005f6fb', 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())));
|
|
174
147
|
}
|
|
175
148
|
static get assetsDirs() { return ["assets"]; }
|
|
176
149
|
get el() { return this; }
|