@arcgis/components-utils 4.34.0-next.8 → 4.34.0-next.81
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/index.cjs +58 -396
- package/dist/index.d.cts +173 -15
- package/dist/index.d.ts +173 -15
- package/dist/index.js +50 -394
- package/dist/index.legacy.js +89 -0
- package/package.json +4 -3
- package/dist/array-utils.d.cts +0 -5
- package/dist/array-utils.d.ts +0 -5
- package/dist/css-utils.d.cts +0 -15
- package/dist/css-utils.d.ts +0 -15
- package/dist/deferred.d.cts +0 -35
- package/dist/deferred.d.ts +0 -35
- package/dist/dom.d.cts +0 -65
- package/dist/dom.d.ts +0 -65
- package/dist/errors.d.cts +0 -30
- package/dist/errors.d.ts +0 -30
- package/dist/guid.d.cts +0 -5
- package/dist/guid.d.ts +0 -5
- package/dist/intl.d.cts +0 -91
- package/dist/intl.d.ts +0 -91
- package/dist/preamble.d.cts +0 -17
- package/dist/preamble.d.ts +0 -17
- package/dist/strings.d.cts +0 -29
- package/dist/strings.d.ts +0 -29
- package/dist/tests/utils.d.cts +0 -1
- package/dist/tests/utils.d.ts +0 -1
- package/dist/text.d.cts +0 -7
- package/dist/text.d.ts +0 -7
- package/dist/timeouts.d.cts +0 -7
- package/dist/timeouts.d.ts +0 -7
- package/dist/type-guards.d.cts +0 -12
- package/dist/type-guards.d.ts +0 -12
- package/dist/types.d.cts +0 -30
- package/dist/types.d.ts +0 -30
- package/dist/ui.d.cts +0 -8
- package/dist/ui.d.ts +0 -8
- package/dist/url.d.cts +0 -14
- package/dist/url.d.ts +0 -14
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { mappedFind as mappedFind$1 } from "@arcgis/toolkit/dist/array";
|
|
2
|
+
import { classes as classes$1, observeAncestorsMutation as observeAncestorsMutation$1, getClosestElement, unsafeGetCalciteModeName, unsafeGetElementDirection, getElementAttribute as getElementAttribute$1, focusElement as focusElement$1 } from "@arcgis/toolkit/dist/dom";
|
|
3
|
+
import { setFocusOnElement } from "@arcgis/toolkit/dist/dom";
|
|
4
|
+
import { devToolsAwareTimeout as devToolsAwareTimeout$1 } from "@arcgis/toolkit/dist/promise";
|
|
5
|
+
import { Deferred } from "@arcgis/toolkit/dist/promise";
|
|
6
|
+
import { isEsriInternalEnv as isEsriInternalEnv$1, safeCall as safeCall$1, safeAsyncCall as safeAsyncCall$1 } from "@arcgis/toolkit/dist/error";
|
|
7
|
+
import { generateGuid as generateGuid$1, getMinorVersion, getPreamble as getPreamble$1, quoteString as quoteString$1, createFilterExpression as createFilterExpression$1, addLtrMark, kebabToPascal as kebabToPascal$1, camelToKebab as camelToKebab$1, camelToHuman as camelToHuman$1, capitalize as capitalize$1, uncapitalize as uncapitalize$1 } from "@arcgis/toolkit/dist/string";
|
|
8
|
+
import { setValuesInString } from "@arcgis/toolkit/dist/string";
|
|
9
|
+
import { supportedLocales as supportedLocales$1, defaultLocale as defaultLocale$1, fetchT9nStringsBundle as fetchT9nStringsBundle$1, getElementLocale, normalizeLocale as normalizeLocale$1, startLocaleObserver as startLocaleObserver$1 } from "@arcgis/toolkit/dist/intl";
|
|
10
|
+
import { isNotNull as isNotNull$1, isNotUndefined as isNotUndefined$1 } from "@arcgis/toolkit/dist/predicate";
|
|
11
|
+
import { debounce as debounce$1, identity as identity$1 } from "@arcgis/toolkit/dist/function";
|
|
12
|
+
import { hasSameOrigin as hasSameOrigin$1, isURL as isURL$1 } from "@arcgis/toolkit/dist/url";
|
|
13
|
+
const mappedFind = mappedFind$1;
|
|
14
|
+
const classes = classes$1;
|
|
15
|
+
const devToolsAwareTimeout = devToolsAwareTimeout$1;
|
|
16
|
+
const observeAncestorsMutation = observeAncestorsMutation$1;
|
|
17
|
+
const closestElement = getClosestElement;
|
|
18
|
+
const getElementTheme = unsafeGetCalciteModeName;
|
|
19
|
+
const getElementDir = unsafeGetElementDirection;
|
|
20
|
+
const getElementAttribute = getElementAttribute$1;
|
|
21
|
+
const focusElement = focusElement$1;
|
|
22
|
+
const unsafeGetModeName = unsafeGetCalciteModeName;
|
|
23
|
+
const isEsriInternalEnv = isEsriInternalEnv$1;
|
|
24
|
+
const safeCall = safeCall$1;
|
|
25
|
+
const safeAsyncCall = safeAsyncCall$1;
|
|
26
|
+
const generateGuid = generateGuid$1;
|
|
27
|
+
const extractMinorVersion = getMinorVersion;
|
|
28
|
+
const getPreamble = getPreamble$1;
|
|
29
|
+
const quoteString = quoteString$1;
|
|
30
|
+
const createFilterExpression = createFilterExpression$1;
|
|
31
|
+
const addLTRMark = addLtrMark;
|
|
32
|
+
const kebabToPascal = kebabToPascal$1;
|
|
33
|
+
const camelToKebab = camelToKebab$1;
|
|
34
|
+
const camelToHuman = camelToHuman$1;
|
|
35
|
+
const capitalize = capitalize$1;
|
|
36
|
+
const uncapitalize = uncapitalize$1;
|
|
37
|
+
const supportedLocales = supportedLocales$1;
|
|
38
|
+
const defaultLocale = defaultLocale$1;
|
|
39
|
+
const fetchT9nStringsBundle = fetchT9nStringsBundle$1;
|
|
40
|
+
const getElementLocales = getElementLocale;
|
|
41
|
+
const normalizeLocale = normalizeLocale$1;
|
|
42
|
+
const startLocaleObserver = startLocaleObserver$1;
|
|
43
|
+
const isNotNull = isNotNull$1;
|
|
44
|
+
const isNotUndefined = isNotUndefined$1;
|
|
45
|
+
const debounce = debounce$1;
|
|
46
|
+
const identity = identity$1;
|
|
47
|
+
const hasSameOrigin = hasSameOrigin$1;
|
|
48
|
+
const isURL = isURL$1;
|
|
49
|
+
export {
|
|
50
|
+
Deferred,
|
|
51
|
+
addLTRMark,
|
|
52
|
+
camelToHuman,
|
|
53
|
+
camelToKebab,
|
|
54
|
+
capitalize,
|
|
55
|
+
classes,
|
|
56
|
+
closestElement,
|
|
57
|
+
createFilterExpression,
|
|
58
|
+
debounce,
|
|
59
|
+
defaultLocale,
|
|
60
|
+
devToolsAwareTimeout,
|
|
61
|
+
extractMinorVersion,
|
|
62
|
+
fetchT9nStringsBundle,
|
|
63
|
+
focusElement,
|
|
64
|
+
generateGuid,
|
|
65
|
+
getElementAttribute,
|
|
66
|
+
getElementDir,
|
|
67
|
+
getElementLocales,
|
|
68
|
+
getElementTheme,
|
|
69
|
+
getPreamble,
|
|
70
|
+
hasSameOrigin,
|
|
71
|
+
identity,
|
|
72
|
+
isEsriInternalEnv,
|
|
73
|
+
isNotNull,
|
|
74
|
+
isNotUndefined,
|
|
75
|
+
isURL,
|
|
76
|
+
kebabToPascal,
|
|
77
|
+
mappedFind,
|
|
78
|
+
normalizeLocale,
|
|
79
|
+
observeAncestorsMutation,
|
|
80
|
+
quoteString,
|
|
81
|
+
safeAsyncCall,
|
|
82
|
+
safeCall,
|
|
83
|
+
setFocusOnElement,
|
|
84
|
+
setValuesInString,
|
|
85
|
+
startLocaleObserver,
|
|
86
|
+
supportedLocales,
|
|
87
|
+
uncapitalize,
|
|
88
|
+
unsafeGetModeName
|
|
89
|
+
};
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcgis/components-utils",
|
|
3
|
-
"version": "4.34.0-next.
|
|
3
|
+
"version": "4.34.0-next.81",
|
|
4
4
|
"description": "Collection of common internal patterns and utilities for ArcGIS Maps SDK for JavaScript components.",
|
|
5
5
|
"homepage": "https://developers.arcgis.com/javascript/latest/",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/index.cjs",
|
|
9
|
-
"module": "dist/index.js",
|
|
10
|
-
"types": "dist/index.d.
|
|
9
|
+
"module": "dist/index.legacy.js",
|
|
10
|
+
"types": "dist/index.d.cts",
|
|
11
11
|
"exports": {
|
|
12
12
|
".": {
|
|
13
13
|
"types": "./dist/index.d.ts",
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
],
|
|
21
21
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
22
22
|
"dependencies": {
|
|
23
|
+
"@arcgis/toolkit": "4.34.0-next.81",
|
|
23
24
|
"tslib": "^2.8.1"
|
|
24
25
|
}
|
|
25
26
|
}
|
package/dist/array-utils.d.cts
DELETED
package/dist/array-utils.d.ts
DELETED
package/dist/css-utils.d.cts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Nil } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* This code contains imperative syntax (like for loops and mutation) as it is
|
|
4
|
-
* in the hot path - performance optimizations are critical here.
|
|
5
|
-
* See https://devtopia.esri.com/WebGIS/arcgis-js-api/commit/2565cedd87b
|
|
6
|
-
*
|
|
7
|
-
* Stencil has native support for passing-in class prop as an object or string,
|
|
8
|
-
* but it does not support arrays or booleans, thus this utility is used
|
|
9
|
-
* instead.
|
|
10
|
-
*
|
|
11
|
-
* @remarks
|
|
12
|
-
* This function is not necessary in a Lit package as Lit's `classMap` directive
|
|
13
|
-
* accepts an object
|
|
14
|
-
*/
|
|
15
|
-
export declare const classes: (...classes: (Nil | Record<string, boolean> | string[] | string | false)[]) => string;
|
package/dist/css-utils.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Nil } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* This code contains imperative syntax (like for loops and mutation) as it is
|
|
4
|
-
* in the hot path - performance optimizations are critical here.
|
|
5
|
-
* See https://devtopia.esri.com/WebGIS/arcgis-js-api/commit/2565cedd87b
|
|
6
|
-
*
|
|
7
|
-
* Stencil has native support for passing-in class prop as an object or string,
|
|
8
|
-
* but it does not support arrays or booleans, thus this utility is used
|
|
9
|
-
* instead.
|
|
10
|
-
*
|
|
11
|
-
* @remarks
|
|
12
|
-
* This function is not necessary in a Lit package as Lit's `classMap` directive
|
|
13
|
-
* accepts an object
|
|
14
|
-
*/
|
|
15
|
-
export declare const classes: (...classes: (Nil | Record<string, boolean> | string[] | string | false)[]) => string;
|
package/dist/deferred.d.cts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A deferred promise.
|
|
3
|
-
* Useful for when you want to return a promise but don't have the value yet.
|
|
4
|
-
* Example:
|
|
5
|
-
* ```
|
|
6
|
-
* const deferred = new Deferred<string>();
|
|
7
|
-
* setTimeout(() => deferred.resolve("Hello World"), 1000);
|
|
8
|
-
* return deferred.promise;
|
|
9
|
-
* ```
|
|
10
|
-
* @template T The type of the promise.
|
|
11
|
-
*/
|
|
12
|
-
export declare class Deferred<T> {
|
|
13
|
-
/**
|
|
14
|
-
* The promise that can be awaited.
|
|
15
|
-
*/
|
|
16
|
-
promise: Promise<T>;
|
|
17
|
-
/**
|
|
18
|
-
* Creates a new deferred promise.
|
|
19
|
-
*/
|
|
20
|
-
constructor();
|
|
21
|
-
}
|
|
22
|
-
export interface Deferred<T> {
|
|
23
|
-
/**
|
|
24
|
-
* Resolves the promise.
|
|
25
|
-
* @param value The value to resolve the promise with.
|
|
26
|
-
*
|
|
27
|
-
* @privateRemarks
|
|
28
|
-
* Defined as a method to disable covariance checks. Overridden in constructor.
|
|
29
|
-
*/
|
|
30
|
-
resolve(_value: PromiseLike<T> | T): void;
|
|
31
|
-
/**
|
|
32
|
-
* Rejects the promise.
|
|
33
|
-
*/
|
|
34
|
-
reject(_error: unknown): void;
|
|
35
|
-
}
|
package/dist/deferred.d.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A deferred promise.
|
|
3
|
-
* Useful for when you want to return a promise but don't have the value yet.
|
|
4
|
-
* Example:
|
|
5
|
-
* ```
|
|
6
|
-
* const deferred = new Deferred<string>();
|
|
7
|
-
* setTimeout(() => deferred.resolve("Hello World"), 1000);
|
|
8
|
-
* return deferred.promise;
|
|
9
|
-
* ```
|
|
10
|
-
* @template T The type of the promise.
|
|
11
|
-
*/
|
|
12
|
-
export declare class Deferred<T> {
|
|
13
|
-
/**
|
|
14
|
-
* The promise that can be awaited.
|
|
15
|
-
*/
|
|
16
|
-
promise: Promise<T>;
|
|
17
|
-
/**
|
|
18
|
-
* Creates a new deferred promise.
|
|
19
|
-
*/
|
|
20
|
-
constructor();
|
|
21
|
-
}
|
|
22
|
-
export interface Deferred<T> {
|
|
23
|
-
/**
|
|
24
|
-
* Resolves the promise.
|
|
25
|
-
* @param value The value to resolve the promise with.
|
|
26
|
-
*
|
|
27
|
-
* @privateRemarks
|
|
28
|
-
* Defined as a method to disable covariance checks. Overridden in constructor.
|
|
29
|
-
*/
|
|
30
|
-
resolve(_value: PromiseLike<T> | T): void;
|
|
31
|
-
/**
|
|
32
|
-
* Rejects the promise.
|
|
33
|
-
*/
|
|
34
|
-
reject(_error: unknown): void;
|
|
35
|
-
}
|
package/dist/dom.d.cts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Observe the element and its ancestors for attribute mutations.
|
|
3
|
-
* If the attributes have been changed in the ancestor tree then the callback will be invoked.
|
|
4
|
-
* Example: `observeAncestorsMutation(element, ["dir", "lang"], () => console.log("dir or lang changed"));`
|
|
5
|
-
* @param element The element on which to observe the attribute mutations.
|
|
6
|
-
* @param attributeFilter The list of attributes to observe.
|
|
7
|
-
* @param callback The callback to invoke when the attributes have been changed.
|
|
8
|
-
* @returns The mutation observer
|
|
9
|
-
*/
|
|
10
|
-
export declare const observeAncestorsMutation: (element: Node, attributeFilter: string[], callback: () => void) => (() => void);
|
|
11
|
-
/**
|
|
12
|
-
* Find the closest element that matches the selector.
|
|
13
|
-
* It will traverse the element's ancestors to find the target element.
|
|
14
|
-
* Shadow DOM boundaries are also taken into account.
|
|
15
|
-
* @param base The element to start the search from.
|
|
16
|
-
* @param selector The selector to match.
|
|
17
|
-
* @returns The closest element that matches the selector or null if not found.
|
|
18
|
-
*/
|
|
19
|
-
export declare const closestElement: (base: Element, selector: string) => Element | null;
|
|
20
|
-
/**
|
|
21
|
-
* Use the Calcite mode to determine the theme of the element.
|
|
22
|
-
* It will traverse the element's ancestors to find the theme.
|
|
23
|
-
* Shadow DOM boundaries are also taken into account.
|
|
24
|
-
* @param base The element to start the search from.
|
|
25
|
-
* @returns The theme of the element, either "light" or "dark", "light" is the default.
|
|
26
|
-
*/
|
|
27
|
-
export declare const getElementTheme: (base: Element) => "dark" | "light";
|
|
28
|
-
/**
|
|
29
|
-
* Get direction property of closest element.
|
|
30
|
-
* @param el The element to start the search from.
|
|
31
|
-
* @returns The direction of the element, either "ltr" | "rtl", "ltr" is the default.
|
|
32
|
-
*/
|
|
33
|
-
export declare const getElementDir: (el: HTMLElement) => "ltr" | "rtl";
|
|
34
|
-
/**
|
|
35
|
-
* Get the attribute value from the element.
|
|
36
|
-
* It will traverse the element's ancestors to find the attribute.
|
|
37
|
-
* Shadow DOM boundaries are also taken into account.
|
|
38
|
-
* If the attribute is not found then the fallback value is returned.
|
|
39
|
-
* Example: `getElementAttribute(element, "dir", "ltr");`
|
|
40
|
-
* @param base The element to start the search from.
|
|
41
|
-
* @param prop The attribute name.
|
|
42
|
-
* @param fallbackValue The fallback value if the attribute is not found.
|
|
43
|
-
* @returns The attribute value or the fallback value if the attribute is not found.
|
|
44
|
-
*/
|
|
45
|
-
export declare const getElementAttribute: (el: Element, prop: string, fallbackValue: string) => string;
|
|
46
|
-
export interface FocusableElement extends HTMLElement {
|
|
47
|
-
setFocus?: () => Promise<void>;
|
|
48
|
-
}
|
|
49
|
-
export declare const focusElement: (el: FocusableElement | undefined) => Promise<void>;
|
|
50
|
-
/**
|
|
51
|
-
* Set the focus on the element that matches the selector.
|
|
52
|
-
* It will traverse the element's ancestors to find the target element.
|
|
53
|
-
* Shadow DOM boundaries are also taken into account.
|
|
54
|
-
* If the element is not found then the focus is not set.
|
|
55
|
-
* Example: `setFocusOnElement(element, "[role='menuitem']");`
|
|
56
|
-
* @param ref The element to start the search from.
|
|
57
|
-
* @param selector The selector to match.
|
|
58
|
-
* @returns Returns true if the focus is set on the element.
|
|
59
|
-
*
|
|
60
|
-
* REFACTOR: this is doing too much. break it into separate find element and focus
|
|
61
|
-
* element utilities
|
|
62
|
-
*/
|
|
63
|
-
export declare const setFocusOnElement: (ref: (Element & {
|
|
64
|
-
componentOnReady?: () => Promise<void>;
|
|
65
|
-
}) | null | undefined, selector: string) => void;
|
package/dist/dom.d.ts
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Observe the element and its ancestors for attribute mutations.
|
|
3
|
-
* If the attributes have been changed in the ancestor tree then the callback will be invoked.
|
|
4
|
-
* Example: `observeAncestorsMutation(element, ["dir", "lang"], () => console.log("dir or lang changed"));`
|
|
5
|
-
* @param element The element on which to observe the attribute mutations.
|
|
6
|
-
* @param attributeFilter The list of attributes to observe.
|
|
7
|
-
* @param callback The callback to invoke when the attributes have been changed.
|
|
8
|
-
* @returns The mutation observer
|
|
9
|
-
*/
|
|
10
|
-
export declare const observeAncestorsMutation: (element: Node, attributeFilter: string[], callback: () => void) => (() => void);
|
|
11
|
-
/**
|
|
12
|
-
* Find the closest element that matches the selector.
|
|
13
|
-
* It will traverse the element's ancestors to find the target element.
|
|
14
|
-
* Shadow DOM boundaries are also taken into account.
|
|
15
|
-
* @param base The element to start the search from.
|
|
16
|
-
* @param selector The selector to match.
|
|
17
|
-
* @returns The closest element that matches the selector or null if not found.
|
|
18
|
-
*/
|
|
19
|
-
export declare const closestElement: (base: Element, selector: string) => Element | null;
|
|
20
|
-
/**
|
|
21
|
-
* Use the Calcite mode to determine the theme of the element.
|
|
22
|
-
* It will traverse the element's ancestors to find the theme.
|
|
23
|
-
* Shadow DOM boundaries are also taken into account.
|
|
24
|
-
* @param base The element to start the search from.
|
|
25
|
-
* @returns The theme of the element, either "light" or "dark", "light" is the default.
|
|
26
|
-
*/
|
|
27
|
-
export declare const getElementTheme: (base: Element) => "dark" | "light";
|
|
28
|
-
/**
|
|
29
|
-
* Get direction property of closest element.
|
|
30
|
-
* @param el The element to start the search from.
|
|
31
|
-
* @returns The direction of the element, either "ltr" | "rtl", "ltr" is the default.
|
|
32
|
-
*/
|
|
33
|
-
export declare const getElementDir: (el: HTMLElement) => "ltr" | "rtl";
|
|
34
|
-
/**
|
|
35
|
-
* Get the attribute value from the element.
|
|
36
|
-
* It will traverse the element's ancestors to find the attribute.
|
|
37
|
-
* Shadow DOM boundaries are also taken into account.
|
|
38
|
-
* If the attribute is not found then the fallback value is returned.
|
|
39
|
-
* Example: `getElementAttribute(element, "dir", "ltr");`
|
|
40
|
-
* @param base The element to start the search from.
|
|
41
|
-
* @param prop The attribute name.
|
|
42
|
-
* @param fallbackValue The fallback value if the attribute is not found.
|
|
43
|
-
* @returns The attribute value or the fallback value if the attribute is not found.
|
|
44
|
-
*/
|
|
45
|
-
export declare const getElementAttribute: (el: Element, prop: string, fallbackValue: string) => string;
|
|
46
|
-
export interface FocusableElement extends HTMLElement {
|
|
47
|
-
setFocus?: () => Promise<void>;
|
|
48
|
-
}
|
|
49
|
-
export declare const focusElement: (el: FocusableElement | undefined) => Promise<void>;
|
|
50
|
-
/**
|
|
51
|
-
* Set the focus on the element that matches the selector.
|
|
52
|
-
* It will traverse the element's ancestors to find the target element.
|
|
53
|
-
* Shadow DOM boundaries are also taken into account.
|
|
54
|
-
* If the element is not found then the focus is not set.
|
|
55
|
-
* Example: `setFocusOnElement(element, "[role='menuitem']");`
|
|
56
|
-
* @param ref The element to start the search from.
|
|
57
|
-
* @param selector The selector to match.
|
|
58
|
-
* @returns Returns true if the focus is set on the element.
|
|
59
|
-
*
|
|
60
|
-
* REFACTOR: this is doing too much. break it into separate find element and focus
|
|
61
|
-
* element utilities
|
|
62
|
-
*/
|
|
63
|
-
export declare const setFocusOnElement: (ref: (Element & {
|
|
64
|
-
componentOnReady?: () => Promise<void>;
|
|
65
|
-
}) | null | undefined, selector: string) => void;
|
package/dist/errors.d.cts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Check whether the code is executing in an Esri internal environment (for
|
|
3
|
-
* example, Lumina dev server). When true, your code can enable extra validation
|
|
4
|
-
* to detect incorrect usages or do runtime bug detection.
|
|
5
|
-
*
|
|
6
|
-
* The call to isEsriInternalEnv() MUST always appear behind one of the
|
|
7
|
-
* following guards to ensure it is correctly eliminated in production bundles:
|
|
8
|
-
*
|
|
9
|
-
* - `process.env.NODE_ENV !== "production"`
|
|
10
|
-
* - `process.env.NODE_ENV === "development"`
|
|
11
|
-
* - `process.env.NODE_ENV === "test"`
|
|
12
|
-
*
|
|
13
|
-
* @remarks
|
|
14
|
-
* This function is primary for usage in support packages. In Lumina component
|
|
15
|
-
* packages, simpler alternatives are provided:
|
|
16
|
-
* https://qawebgis.esri.com/components/lumina/publishing#bundling-code-conditionally
|
|
17
|
-
*/
|
|
18
|
-
export declare const isEsriInternalEnv: () => boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Calls a sync method and catch any errors. Returns undefined if error occurred.
|
|
21
|
-
*
|
|
22
|
-
* Can also provide a thisContext and rest arguments
|
|
23
|
-
*/
|
|
24
|
-
export declare const safeCall: <Callback extends (...args: never[]) => unknown>(callback?: Callback, thisContext?: ThisParameterType<Callback>, ...rest: Parameters<Callback>) => ReturnType<Callback> | void;
|
|
25
|
-
/**
|
|
26
|
-
* Calls an async method and catch any errors. Returns undefined if error occurred.
|
|
27
|
-
*
|
|
28
|
-
* Can also provide a thisContext and rest arguments
|
|
29
|
-
*/
|
|
30
|
-
export declare const safeAsyncCall: <Callback extends (...args: never[]) => unknown>(callback?: Callback, thisContext?: ThisParameterType<Callback>, ...rest: Parameters<Callback>) => Promise<Awaited<ReturnType<Callback>> | void>;
|
package/dist/errors.d.ts
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Check whether the code is executing in an Esri internal environment (for
|
|
3
|
-
* example, Lumina dev server). When true, your code can enable extra validation
|
|
4
|
-
* to detect incorrect usages or do runtime bug detection.
|
|
5
|
-
*
|
|
6
|
-
* The call to isEsriInternalEnv() MUST always appear behind one of the
|
|
7
|
-
* following guards to ensure it is correctly eliminated in production bundles:
|
|
8
|
-
*
|
|
9
|
-
* - `process.env.NODE_ENV !== "production"`
|
|
10
|
-
* - `process.env.NODE_ENV === "development"`
|
|
11
|
-
* - `process.env.NODE_ENV === "test"`
|
|
12
|
-
*
|
|
13
|
-
* @remarks
|
|
14
|
-
* This function is primary for usage in support packages. In Lumina component
|
|
15
|
-
* packages, simpler alternatives are provided:
|
|
16
|
-
* https://qawebgis.esri.com/components/lumina/publishing#bundling-code-conditionally
|
|
17
|
-
*/
|
|
18
|
-
export declare const isEsriInternalEnv: () => boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Calls a sync method and catch any errors. Returns undefined if error occurred.
|
|
21
|
-
*
|
|
22
|
-
* Can also provide a thisContext and rest arguments
|
|
23
|
-
*/
|
|
24
|
-
export declare const safeCall: <Callback extends (...args: never[]) => unknown>(callback?: Callback, thisContext?: ThisParameterType<Callback>, ...rest: Parameters<Callback>) => ReturnType<Callback> | void;
|
|
25
|
-
/**
|
|
26
|
-
* Calls an async method and catch any errors. Returns undefined if error occurred.
|
|
27
|
-
*
|
|
28
|
-
* Can also provide a thisContext and rest arguments
|
|
29
|
-
*/
|
|
30
|
-
export declare const safeAsyncCall: <Callback extends (...args: never[]) => unknown>(callback?: Callback, thisContext?: ThisParameterType<Callback>, ...rest: Parameters<Callback>) => Promise<Awaited<ReturnType<Callback>> | void>;
|
package/dist/guid.d.cts
DELETED
package/dist/guid.d.ts
DELETED
package/dist/intl.d.cts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The interface for translated strings.
|
|
3
|
-
*/
|
|
4
|
-
export interface GenericT9nStrings {
|
|
5
|
-
[key: string]: GenericT9nStrings | string;
|
|
6
|
-
}
|
|
7
|
-
declare const supportedLocalesArray: ["ar", "bg", "bs", "ca", "cs", "da", "de", "el", "en", "es", "et", "fi", "fr", "he", "hr", "hu", "id", "it", "ja", "ko", "lt", "lv", "nl", "nb", "no", "pl", "pt-BR", "pt-PT", "ro", "ru", "sk", "sl", "sr", "sv", "th", "tr", "uk", "vi", "zh-CN", "zh-HK", "zh-TW"];
|
|
8
|
-
/**
|
|
9
|
-
* The list of supported locales for ArcGIS Maps SDK for JavaScript components.
|
|
10
|
-
*/
|
|
11
|
-
export declare const supportedLocales: Set<"hr" | "th" | "tr" | "ar" | "bg" | "bs" | "ca" | "cs" | "da" | "de" | "el" | "en" | "es" | "et" | "fi" | "fr" | "he" | "hu" | "id" | "it" | "ja" | "ko" | "lt" | "lv" | "nl" | "nb" | "no" | "pl" | "pt-BR" | "pt-PT" | "ro" | "ru" | "sk" | "sl" | "sr" | "sv" | "uk" | "vi" | "zh-CN" | "zh-HK" | "zh-TW">;
|
|
12
|
-
export type SupportedLocale = (typeof supportedLocalesArray)[number];
|
|
13
|
-
export declare const defaultLocale = "en";
|
|
14
|
-
/**
|
|
15
|
-
* Fetch the T9N strings bundle for the given locale, assets path and prefix.
|
|
16
|
-
* The locale must be one of the supported locales.
|
|
17
|
-
* If the locale is not supported, it will default to 'en'.
|
|
18
|
-
* If the T9N strings bundle cannot be found, it will default to 'en'.
|
|
19
|
-
*
|
|
20
|
-
* @remarks
|
|
21
|
-
* Rather than using this function directly, prefer the `useT9n()` controller.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```ts
|
|
25
|
-
* const t9nStrings = await fetchT9nStringsBundle("en", getAssetPath("./assets/coding-editor/t9n"), "messages.");
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export declare const fetchT9nStringsBundle: <Strings extends GenericT9nStrings>(
|
|
29
|
-
/** The locale for which to fetch the T9N strings */
|
|
30
|
-
locale: string,
|
|
31
|
-
/** The path to the assets folder where the T9N strings are located */
|
|
32
|
-
assetsPath: string,
|
|
33
|
-
/** The prefix to use for the T9N strings file name. */
|
|
34
|
-
prefix?: string) => Promise<Strings>;
|
|
35
|
-
/**
|
|
36
|
-
* Get the locale of the given element.
|
|
37
|
-
* It will look for the lang attribute on the element and its ancestors.
|
|
38
|
-
* If not lang is found, it will default to 'en'.
|
|
39
|
-
*/
|
|
40
|
-
export declare const getElementLocales: (element: HTMLElement) => {
|
|
41
|
-
readonly lang: string;
|
|
42
|
-
readonly t9nLocale: SupportedLocale;
|
|
43
|
-
};
|
|
44
|
-
export declare const normalizeLocale: (locale: string) => SupportedLocale;
|
|
45
|
-
export type LocaleObserver<Strings extends GenericT9nStrings = GenericT9nStrings> = {
|
|
46
|
-
/** The T9N strings of the component */
|
|
47
|
-
t9nStrings: Strings;
|
|
48
|
-
/**
|
|
49
|
-
* The locale of the component set by the `lang` attribute on the component host element or one of its ancestors.
|
|
50
|
-
*/
|
|
51
|
-
lang: string;
|
|
52
|
-
/**
|
|
53
|
-
* The locale used by the component to load the T9N strings.
|
|
54
|
-
* It may be different than the locale of the component host element that was set by the `lang` attribute.
|
|
55
|
-
*/
|
|
56
|
-
t9nLocale: SupportedLocale;
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* Start the locale observer for the given component.
|
|
60
|
-
* The callback will be called when the locale changes for the component.
|
|
61
|
-
* It will observe the lang attribute on the component and its ancestors.
|
|
62
|
-
* The callback is called once at the beginning.
|
|
63
|
-
*
|
|
64
|
-
* @remarks
|
|
65
|
-
* Rather than using this function directly, prefer the `useT9n()` controller.
|
|
66
|
-
*/
|
|
67
|
-
export declare const startLocaleObserver: <Strings extends GenericT9nStrings = GenericT9nStrings>(
|
|
68
|
-
/** The Web component HTML element that is doing the fetching */
|
|
69
|
-
element: HTMLElement,
|
|
70
|
-
/**
|
|
71
|
-
* The callback to get path to the assets folder where the T9N strings are
|
|
72
|
-
* located.
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* ```ts
|
|
76
|
-
* () => getAssetPath("./assets")
|
|
77
|
-
* ```
|
|
78
|
-
*/
|
|
79
|
-
getAssetsPath: () => string,
|
|
80
|
-
/** The callback to call when the locale changes */
|
|
81
|
-
onUpdated: (payload: LocaleObserver<Strings>) => void,
|
|
82
|
-
/**
|
|
83
|
-
* Optionally override the asset file name.
|
|
84
|
-
* Default file name is the component tag name without the part before the
|
|
85
|
-
* first dash (e.g. `arcgis-map` becomes `map`).
|
|
86
|
-
*
|
|
87
|
-
* Set to null if the component has no localization strings, but you still
|
|
88
|
-
* wish to use `startLocaleObserver` to get the locale information.
|
|
89
|
-
*/
|
|
90
|
-
assetName?: string | null) => (() => void);
|
|
91
|
-
export {};
|
package/dist/intl.d.ts
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The interface for translated strings.
|
|
3
|
-
*/
|
|
4
|
-
export interface GenericT9nStrings {
|
|
5
|
-
[key: string]: GenericT9nStrings | string;
|
|
6
|
-
}
|
|
7
|
-
declare const supportedLocalesArray: ["ar", "bg", "bs", "ca", "cs", "da", "de", "el", "en", "es", "et", "fi", "fr", "he", "hr", "hu", "id", "it", "ja", "ko", "lt", "lv", "nl", "nb", "no", "pl", "pt-BR", "pt-PT", "ro", "ru", "sk", "sl", "sr", "sv", "th", "tr", "uk", "vi", "zh-CN", "zh-HK", "zh-TW"];
|
|
8
|
-
/**
|
|
9
|
-
* The list of supported locales for ArcGIS Maps SDK for JavaScript components.
|
|
10
|
-
*/
|
|
11
|
-
export declare const supportedLocales: Set<"hr" | "th" | "tr" | "ar" | "bg" | "bs" | "ca" | "cs" | "da" | "de" | "el" | "en" | "es" | "et" | "fi" | "fr" | "he" | "hu" | "id" | "it" | "ja" | "ko" | "lt" | "lv" | "nl" | "nb" | "no" | "pl" | "pt-BR" | "pt-PT" | "ro" | "ru" | "sk" | "sl" | "sr" | "sv" | "uk" | "vi" | "zh-CN" | "zh-HK" | "zh-TW">;
|
|
12
|
-
export type SupportedLocale = (typeof supportedLocalesArray)[number];
|
|
13
|
-
export declare const defaultLocale = "en";
|
|
14
|
-
/**
|
|
15
|
-
* Fetch the T9N strings bundle for the given locale, assets path and prefix.
|
|
16
|
-
* The locale must be one of the supported locales.
|
|
17
|
-
* If the locale is not supported, it will default to 'en'.
|
|
18
|
-
* If the T9N strings bundle cannot be found, it will default to 'en'.
|
|
19
|
-
*
|
|
20
|
-
* @remarks
|
|
21
|
-
* Rather than using this function directly, prefer the `useT9n()` controller.
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```ts
|
|
25
|
-
* const t9nStrings = await fetchT9nStringsBundle("en", getAssetPath("./assets/coding-editor/t9n"), "messages.");
|
|
26
|
-
* ```
|
|
27
|
-
*/
|
|
28
|
-
export declare const fetchT9nStringsBundle: <Strings extends GenericT9nStrings>(
|
|
29
|
-
/** The locale for which to fetch the T9N strings */
|
|
30
|
-
locale: string,
|
|
31
|
-
/** The path to the assets folder where the T9N strings are located */
|
|
32
|
-
assetsPath: string,
|
|
33
|
-
/** The prefix to use for the T9N strings file name. */
|
|
34
|
-
prefix?: string) => Promise<Strings>;
|
|
35
|
-
/**
|
|
36
|
-
* Get the locale of the given element.
|
|
37
|
-
* It will look for the lang attribute on the element and its ancestors.
|
|
38
|
-
* If not lang is found, it will default to 'en'.
|
|
39
|
-
*/
|
|
40
|
-
export declare const getElementLocales: (element: HTMLElement) => {
|
|
41
|
-
readonly lang: string;
|
|
42
|
-
readonly t9nLocale: SupportedLocale;
|
|
43
|
-
};
|
|
44
|
-
export declare const normalizeLocale: (locale: string) => SupportedLocale;
|
|
45
|
-
export type LocaleObserver<Strings extends GenericT9nStrings = GenericT9nStrings> = {
|
|
46
|
-
/** The T9N strings of the component */
|
|
47
|
-
t9nStrings: Strings;
|
|
48
|
-
/**
|
|
49
|
-
* The locale of the component set by the `lang` attribute on the component host element or one of its ancestors.
|
|
50
|
-
*/
|
|
51
|
-
lang: string;
|
|
52
|
-
/**
|
|
53
|
-
* The locale used by the component to load the T9N strings.
|
|
54
|
-
* It may be different than the locale of the component host element that was set by the `lang` attribute.
|
|
55
|
-
*/
|
|
56
|
-
t9nLocale: SupportedLocale;
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* Start the locale observer for the given component.
|
|
60
|
-
* The callback will be called when the locale changes for the component.
|
|
61
|
-
* It will observe the lang attribute on the component and its ancestors.
|
|
62
|
-
* The callback is called once at the beginning.
|
|
63
|
-
*
|
|
64
|
-
* @remarks
|
|
65
|
-
* Rather than using this function directly, prefer the `useT9n()` controller.
|
|
66
|
-
*/
|
|
67
|
-
export declare const startLocaleObserver: <Strings extends GenericT9nStrings = GenericT9nStrings>(
|
|
68
|
-
/** The Web component HTML element that is doing the fetching */
|
|
69
|
-
element: HTMLElement,
|
|
70
|
-
/**
|
|
71
|
-
* The callback to get path to the assets folder where the T9N strings are
|
|
72
|
-
* located.
|
|
73
|
-
*
|
|
74
|
-
* @example
|
|
75
|
-
* ```ts
|
|
76
|
-
* () => getAssetPath("./assets")
|
|
77
|
-
* ```
|
|
78
|
-
*/
|
|
79
|
-
getAssetsPath: () => string,
|
|
80
|
-
/** The callback to call when the locale changes */
|
|
81
|
-
onUpdated: (payload: LocaleObserver<Strings>) => void,
|
|
82
|
-
/**
|
|
83
|
-
* Optionally override the asset file name.
|
|
84
|
-
* Default file name is the component tag name without the part before the
|
|
85
|
-
* first dash (e.g. `arcgis-map` becomes `map`).
|
|
86
|
-
*
|
|
87
|
-
* Set to null if the component has no localization strings, but you still
|
|
88
|
-
* wish to use `startLocaleObserver` to get the locale information.
|
|
89
|
-
*/
|
|
90
|
-
assetName?: string | null) => (() => void);
|
|
91
|
-
export {};
|
package/dist/preamble.d.cts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare const extractMinorVersion: (version: string) => string;
|
|
2
|
-
/**
|
|
3
|
-
* Creates preamble text from a version number. The preamble text is used in stencil.config.ts and inserts a comment at the top of the generated bundles.
|
|
4
|
-
* The preamble text contains the version number and a link to the license.
|
|
5
|
-
* The version number is typically extracted from the package.json file.
|
|
6
|
-
* @example
|
|
7
|
-
* ```ts
|
|
8
|
-
* const preamble = getPreamble("4.18.2-beta.1");
|
|
9
|
-
* console.log(preamble);
|
|
10
|
-
* // All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
11
|
-
* // See https://js.arcgis.com/4.18/esri/copyright.txt for details.
|
|
12
|
-
* // v4.18.2-beta.1
|
|
13
|
-
* ```
|
|
14
|
-
* @param version the version number, typically coming from package.json.
|
|
15
|
-
* @returns a string containing the preamble text.
|
|
16
|
-
*/
|
|
17
|
-
export declare const getPreamble: (version: string) => string;
|
package/dist/preamble.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare const extractMinorVersion: (version: string) => string;
|
|
2
|
-
/**
|
|
3
|
-
* Creates preamble text from a version number. The preamble text is used in stencil.config.ts and inserts a comment at the top of the generated bundles.
|
|
4
|
-
* The preamble text contains the version number and a link to the license.
|
|
5
|
-
* The version number is typically extracted from the package.json file.
|
|
6
|
-
* @example
|
|
7
|
-
* ```ts
|
|
8
|
-
* const preamble = getPreamble("4.18.2-beta.1");
|
|
9
|
-
* console.log(preamble);
|
|
10
|
-
* // All material copyright Esri, All Rights Reserved, unless otherwise specified.
|
|
11
|
-
* // See https://js.arcgis.com/4.18/esri/copyright.txt for details.
|
|
12
|
-
* // v4.18.2-beta.1
|
|
13
|
-
* ```
|
|
14
|
-
* @param version the version number, typically coming from package.json.
|
|
15
|
-
* @returns a string containing the preamble text.
|
|
16
|
-
*/
|
|
17
|
-
export declare const getPreamble: (version: string) => string;
|