@arcgis/coding-components 4.30.0-next.86 → 4.30.0-next.88
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 +2 -2
- package/dist/arcgis-coding-components/index.esm.js +2 -2
- package/dist/arcgis-coding-components/{p-0db53640.js → p-053e6e93.js} +3 -3
- package/dist/arcgis-coding-components/{p-1ba511a8.js → p-05f0fbe3.js} +2 -2
- package/dist/arcgis-coding-components/{p-d8d1153e.js → p-1bde3872.js} +2 -2
- package/dist/arcgis-coding-components/{p-5b38655a.js → p-1ea550b5.js} +2 -2
- package/dist/arcgis-coding-components/{p-f2c8421c.js → p-23a50e40.js} +10 -10
- package/dist/arcgis-coding-components/{p-f59c7154.entry.js → p-57bf8e0d.entry.js} +2 -2
- package/dist/arcgis-coding-components/{p-68046b91.js → p-6191a108.js} +1 -1
- package/dist/arcgis-coding-components/{p-ad9d6a5a.js → p-6ff6c6c0.js} +2 -2
- package/dist/arcgis-coding-components/{p-7e1478a2.js → p-75d64e6f.js} +2 -2
- package/dist/arcgis-coding-components/{p-47d25fa3.js → p-83bf0e32.js} +1 -1
- package/dist/arcgis-coding-components/{p-3c5d8cd3.js → p-888440d0.js} +2 -2
- package/dist/arcgis-coding-components/{p-fc702ab7.js → p-b95fad89.js} +2 -2
- package/dist/cjs/{arcade-defaults-4357da16.js → arcade-defaults-4c87490b.js} +20 -15
- package/dist/cjs/{arcade-mode-b295bb2e.js → arcade-mode-0473fc46.js} +3 -3
- package/dist/cjs/arcgis-arcade-api_6.cjs.entry.js +204 -113
- package/dist/cjs/arcgis-coding-components.cjs.js +2 -2
- package/dist/cjs/{css-828ddedd.js → css-51805364.js} +1 -1
- package/dist/cjs/{cssMode-65f8f225.js → cssMode-4db3375d.js} +3 -3
- package/dist/cjs/{html-28008895.js → html-98fcc6e0.js} +3 -3
- package/dist/cjs/{htmlMode-69e0582f.js → htmlMode-08e8d082.js} +3 -3
- package/dist/cjs/{index-e7fa55cc.js → index-a0f77388.js} +1 -1
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/{javascript-379650c7.js → javascript-caafa8ac.js} +4 -4
- package/dist/cjs/{jsonMode-9fa9d9ff.js → jsonMode-9eb31d7e.js} +3 -3
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{tsMode-00270b0b.js → tsMode-fbfa0c20.js} +3 -3
- package/dist/cjs/{typescript-39ee883b.js → typescript-fb309e4d.js} +3 -3
- package/dist/components/arcade-api.js +4 -3
- package/dist/components/arcade-contribution.js +1 -1
- package/dist/components/arcade-defaults.js +1 -1
- package/dist/components/arcade-mode.js +1 -1
- package/dist/components/arcade-results.js +2 -2
- package/dist/components/arcade-suggestions.js +2 -2
- package/dist/components/arcade-variables.js +2 -2
- package/dist/components/arcgis-arcade-api.js +1 -1
- package/dist/components/arcgis-arcade-editor.js +2 -2
- 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/{chunk-63RMNUHL.js → chunk-IHYYRFLQ.js} +195 -107
- package/dist/components/code-editor.js +2 -2
- package/dist/components/fields.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +11 -6
- package/dist/components/markdown.js +1 -1
- package/dist/components/useT9n.js +6 -4
- package/dist/components/utilities.js +1 -1
- package/dist/esm/{arcade-defaults-38301b95.js → arcade-defaults-72b210ad.js} +20 -15
- package/dist/esm/{arcade-mode-033894f1.js → arcade-mode-2c605ffa.js} +3 -3
- package/dist/esm/arcgis-arcade-api_6.entry.js +204 -113
- package/dist/esm/arcgis-coding-components.js +3 -3
- package/dist/esm/{css-40412441.js → css-db024e9d.js} +1 -1
- package/dist/esm/{cssMode-43027199.js → cssMode-d5d91343.js} +3 -3
- package/dist/esm/{html-7b9cf209.js → html-d6a9fdc6.js} +3 -3
- package/dist/esm/{htmlMode-4ebaceee.js → htmlMode-e55abc8e.js} +3 -3
- package/dist/esm/{index-3a25748f.js → index-5d6d5640.js} +1 -1
- package/dist/esm/index.js +3 -3
- package/dist/esm/{javascript-46a169f9.js → javascript-07e29cbd.js} +4 -4
- package/dist/esm/{jsonMode-a84e7059.js → jsonMode-d9eb7871.js} +3 -3
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{tsMode-eead2094.js → tsMode-a8ddfcae.js} +3 -3
- package/dist/esm/{typescript-953aa066.js → typescript-4bd853ce.js} +3 -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/data/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stencil.config.d.ts +3 -0
- package/package.json +9 -9
- package/dist/types/data/arcgis-web-compoments/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stencil.config.d.ts +0 -3
- /package/dist/types/data/{arcgis-web-compoments/actions-runner-1 → 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 +0 -0
- /package/dist/types/data/{arcgis-web-compoments/actions-runner-1 → actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/arcade-editor/editorContext.d.ts +0 -0
- /package/dist/types/data/{arcgis-web-compoments/actions-runner-1 → actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/internal/code-editor/code-editor.stories.d.ts +0 -0
- /package/dist/types/data/{arcgis-web-compoments/actions-runner-1 → actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/stories/reference/stories/arcade-editor.stories.d.ts +0 -0
- /package/dist/types/data/{arcgis-web-compoments/actions-runner-1 → actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/support/sass-inline-url-importer.d.ts +0 -0
- /package/dist/types/data/{arcgis-web-compoments/actions-runner-1 → actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/support/sass-json-importer.d.ts +0 -0
- /package/dist/types/data/{arcgis-web-compoments/actions-runner-1 → actions-runner-1}/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/support/stencil-monaco-plugins.d.ts +0 -0
|
@@ -1,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.30/esri/copyright.txt for details.
|
|
4
|
-
* v4.30.0-next.
|
|
4
|
+
* v4.30.0-next.88
|
|
5
5
|
*/
|
|
6
|
-
import { g as getAssetPath, r as registerInstance, c as createEvent, h, H as Host, a as getElement, F as Fragment } from './index-
|
|
7
|
-
import { g as generateTokensCSSForColorMap, e as editor, S as StandaloneServices, I as IStandaloneThemeService, c as createCommonjsModule, b as commonjsGlobal, D as Deferred, d as camelToKebab, s as safeCall, f as safeAsyncCall, h as devToolsAwareTimeout, i as startLocaleObserver, j as getElementLocales, k as isURL, l as hasSameOrigin, m as importRequest, n as languages, o as arcadeDefaults, U as Uri, p as setFocusOnElement, q as filterCollection, r as addLTRMark, t as importArcade, u as generateGuid, v as getElementTheme, K as KeyCode, w as setValuesInString, x as quoteString, y as supportedFields, z as createFilterExpression, R as Range, A as observeAncestorsMutation, B as KeyMod } from './arcade-defaults-
|
|
6
|
+
import { g as getAssetPath, r as registerInstance, c as createEvent, h, H as Host, a as getElement, F as Fragment } from './index-5d6d5640.js';
|
|
7
|
+
import { g as generateTokensCSSForColorMap, e as editor, S as StandaloneServices, I as IStandaloneThemeService, c as createCommonjsModule, b as commonjsGlobal, D as Deferred, d as camelToKebab, s as safeCall, f as safeAsyncCall, h as devToolsAwareTimeout, i as startLocaleObserver, j as getElementLocales, k as isURL, l as hasSameOrigin, m as importRequest, n as languages, o as arcadeDefaults, U as Uri, p as setFocusOnElement, q as filterCollection, r as addLTRMark, t as importArcade, u as generateGuid, v as getElementTheme, K as KeyCode, w as setValuesInString, x as quoteString, y as supportedFields, z as createFilterExpression, R as Range, A as observeAncestorsMutation, B as KeyMod } from './arcade-defaults-72b210ad.js';
|
|
8
8
|
|
|
9
9
|
async function colorizeCode(code) {
|
|
10
10
|
return await editor.colorize(code, "arcade", { tabSize: 2 });
|
|
@@ -2951,26 +2951,29 @@ function retrieveComponentMembers(component, isLit) {
|
|
|
2951
2951
|
const constructor = component.constructor;
|
|
2952
2952
|
const members = constructor.__registerControllers?.(component) ?? void 0;
|
|
2953
2953
|
constructor.__registerControllers = void 0;
|
|
2954
|
-
if (typeof members !== "object")
|
|
2954
|
+
if (typeof members !== "object") {
|
|
2955
2955
|
throw new Error(
|
|
2956
2956
|
"Failed to retrieve internal component meta. Make sure you have the useComponentsControllers() Rollup Plugin for Stencil Controllers configured in your Stencil config."
|
|
2957
2957
|
);
|
|
2958
|
+
}
|
|
2958
2959
|
component.manager.internals.members = members;
|
|
2959
2960
|
}
|
|
2960
2961
|
}
|
|
2961
2962
|
var getLitProperties = (component) => component.constructor.elementProperties;
|
|
2962
2963
|
function parsePropertyValue(value, type = 8 /* Any */) {
|
|
2963
2964
|
const isComplex = value == null || typeof value === "object" || typeof value === "function";
|
|
2964
|
-
if (isComplex)
|
|
2965
|
+
if (isComplex) {
|
|
2965
2966
|
return value;
|
|
2966
|
-
|
|
2967
|
+
}
|
|
2968
|
+
if ((type & 4 /* Boolean */) !== 0) {
|
|
2967
2969
|
return value === "false" ? false : value === "" || !!value;
|
|
2968
|
-
else if ((type & 2 /* Number */) !== 0)
|
|
2970
|
+
} else if ((type & 2 /* Number */) !== 0) {
|
|
2969
2971
|
return Number.parseFloat(value);
|
|
2970
|
-
else if ((type & 1 /* String */) !== 0)
|
|
2972
|
+
} else if ((type & 1 /* String */) !== 0) {
|
|
2971
2973
|
return String(value);
|
|
2972
|
-
else
|
|
2974
|
+
} else {
|
|
2973
2975
|
return value;
|
|
2976
|
+
}
|
|
2974
2977
|
}
|
|
2975
2978
|
var makeMemberFilter = (filter) => (component) => {
|
|
2976
2979
|
const members = component.manager.internals.members;
|
|
@@ -2980,12 +2983,13 @@ var getPropLikeMembers = makeMemberFilter(63 /* PropLike */);
|
|
|
2980
2983
|
var getMemberType = (component, name) => component.manager.internals.members?.[name]?.[0];
|
|
2981
2984
|
function getPropType(component, name) {
|
|
2982
2985
|
const type = getMemberType(component, name);
|
|
2983
|
-
if (type === void 0)
|
|
2986
|
+
if (type === void 0) {
|
|
2984
2987
|
return void 0;
|
|
2985
|
-
else if (type & 32 /* State */)
|
|
2988
|
+
} else if (type & 32 /* State */) {
|
|
2986
2989
|
return "state";
|
|
2987
|
-
else
|
|
2990
|
+
} else {
|
|
2988
2991
|
return "prop";
|
|
2992
|
+
}
|
|
2989
2993
|
}
|
|
2990
2994
|
|
|
2991
2995
|
// src/types.ts
|
|
@@ -3010,14 +3014,17 @@ var ControllerInternals = class {
|
|
|
3010
3014
|
const error = new Error(
|
|
3011
3015
|
`Unable to resolve a controller from the provided value, so can't watch it's exports. ${unresolvableExports}`
|
|
3012
3016
|
);
|
|
3013
|
-
|
|
3017
|
+
{
|
|
3018
|
+
console.error(error);
|
|
3019
|
+
}
|
|
3014
3020
|
}
|
|
3015
3021
|
return value;
|
|
3016
3022
|
}
|
|
3017
3023
|
await controller.ready;
|
|
3018
3024
|
if (typeof watchExports === "function") {
|
|
3019
|
-
if (controller.watchExports === void 0)
|
|
3025
|
+
if (controller.watchExports === void 0) {
|
|
3020
3026
|
throw new Error(`The controller must implement watchExports method to support watching exports`);
|
|
3027
|
+
}
|
|
3021
3028
|
const unsubscribe = controller.watchExports(
|
|
3022
3029
|
(exports) => watchExports(exports, unsubscribe)
|
|
3023
3030
|
);
|
|
@@ -3026,21 +3033,25 @@ var ControllerInternals = class {
|
|
|
3026
3033
|
};
|
|
3027
3034
|
this.useRef = async (value) => {
|
|
3028
3035
|
const controller = this.useRefSync(value);
|
|
3029
|
-
if (controller === void 0)
|
|
3036
|
+
if (controller === void 0) {
|
|
3030
3037
|
throw new Error(`Unable to resolve a controller from the provided value. ${unresolvableExports}`);
|
|
3038
|
+
}
|
|
3031
3039
|
await controller.ready;
|
|
3032
3040
|
return controller;
|
|
3033
3041
|
};
|
|
3034
3042
|
this.useRefSync = (value) => {
|
|
3035
3043
|
const ambientChildController = this.retrieveAmbientChildController();
|
|
3036
|
-
if (ambientChildController !== void 0)
|
|
3044
|
+
if (ambientChildController !== void 0) {
|
|
3037
3045
|
return ambientChildController;
|
|
3046
|
+
}
|
|
3038
3047
|
const component = Controller.internals.retrieveComponent();
|
|
3039
3048
|
const controller = component.manager.internals.resolveExports(value);
|
|
3040
|
-
if (controller !== void 0)
|
|
3049
|
+
if (controller !== void 0) {
|
|
3041
3050
|
return controller;
|
|
3042
|
-
|
|
3051
|
+
}
|
|
3052
|
+
if (isController(value)) {
|
|
3043
3053
|
return value;
|
|
3054
|
+
}
|
|
3044
3055
|
return void 0;
|
|
3045
3056
|
};
|
|
3046
3057
|
this.shouldBypassSetter = false;
|
|
@@ -3058,16 +3069,18 @@ var ControllerInternals = class {
|
|
|
3058
3069
|
* improve DX (avoids the need to pass "this" explicitly for each controller)
|
|
3059
3070
|
*/
|
|
3060
3071
|
setAmbientComponent(component) {
|
|
3061
|
-
if (this._ambientComponent === component)
|
|
3072
|
+
if (this._ambientComponent === component) {
|
|
3062
3073
|
return;
|
|
3074
|
+
}
|
|
3063
3075
|
this._ambientComponent = component;
|
|
3064
3076
|
queueMicrotask(() => {
|
|
3065
|
-
if (this._ambientComponent === component)
|
|
3077
|
+
if (this._ambientComponent === component) {
|
|
3066
3078
|
this._ambientComponent = void 0;
|
|
3079
|
+
}
|
|
3067
3080
|
});
|
|
3068
3081
|
}
|
|
3069
3082
|
retrieveComponent(name) {
|
|
3070
|
-
if (this._ambientComponent === void 0)
|
|
3083
|
+
if (this._ambientComponent === void 0) {
|
|
3071
3084
|
throw new Error(
|
|
3072
3085
|
[
|
|
3073
3086
|
`Unable to find out which component ${name || "this"} controller `,
|
|
@@ -3083,6 +3096,7 @@ var ControllerInternals = class {
|
|
|
3083
3096
|
"You might also have multiple instances of Controllers loaded"
|
|
3084
3097
|
].join("\n")
|
|
3085
3098
|
);
|
|
3099
|
+
}
|
|
3086
3100
|
return this._ambientComponent;
|
|
3087
3101
|
}
|
|
3088
3102
|
/*
|
|
@@ -3107,12 +3121,14 @@ var ControllerInternals = class {
|
|
|
3107
3121
|
* controller exports, rather than the controller itself
|
|
3108
3122
|
*/
|
|
3109
3123
|
setAmbientChildController(controller) {
|
|
3110
|
-
if (this._ambientChildController === controller)
|
|
3124
|
+
if (this._ambientChildController === controller) {
|
|
3111
3125
|
return;
|
|
3126
|
+
}
|
|
3112
3127
|
this._ambientChildController = controller;
|
|
3113
3128
|
queueMicrotask(() => {
|
|
3114
|
-
if (this._ambientChildController === controller)
|
|
3129
|
+
if (this._ambientChildController === controller) {
|
|
3115
3130
|
this._ambientChildController = void 0;
|
|
3131
|
+
}
|
|
3116
3132
|
});
|
|
3117
3133
|
}
|
|
3118
3134
|
retrieveAmbientChildController() {
|
|
@@ -3166,12 +3182,14 @@ var _Controller = class _Controller {
|
|
|
3166
3182
|
});
|
|
3167
3183
|
this.component.addController(this);
|
|
3168
3184
|
_Controller.internals.setParentController(this);
|
|
3169
|
-
if ("hostDestroy" in this)
|
|
3185
|
+
if ("hostDestroy" in this) {
|
|
3170
3186
|
this.component.manager.ensureHasDestroy();
|
|
3187
|
+
}
|
|
3171
3188
|
const manager = this.component.manager;
|
|
3172
3189
|
const isInControllerManager = manager === void 0;
|
|
3173
|
-
if (!isInControllerManager)
|
|
3190
|
+
if (!isInControllerManager) {
|
|
3174
3191
|
queueMicrotask(() => this.catchUpLifecycle());
|
|
3192
|
+
}
|
|
3175
3193
|
}
|
|
3176
3194
|
/**
|
|
3177
3195
|
* If controller is being added dynamically, after the component
|
|
@@ -3180,15 +3198,18 @@ var _Controller = class _Controller {
|
|
|
3180
3198
|
catchUpLifecycle() {
|
|
3181
3199
|
const { manager } = this.component;
|
|
3182
3200
|
const connectedWillStillHappen = !manager.connectedCalled;
|
|
3183
|
-
if (!connectedWillStillHappen && !this.connectedCalled)
|
|
3201
|
+
if (!connectedWillStillHappen && !this.connectedCalled) {
|
|
3184
3202
|
this.triggerConnected();
|
|
3203
|
+
}
|
|
3185
3204
|
const loadWillStillHappen = !manager.willLoadCalled;
|
|
3186
|
-
if (loadWillStillHappen)
|
|
3205
|
+
if (loadWillStillHappen) {
|
|
3187
3206
|
return;
|
|
3207
|
+
}
|
|
3188
3208
|
this.triggerLoad().then(() => {
|
|
3189
3209
|
const loadedWillStillHappen = !manager.didLoadCalled;
|
|
3190
|
-
if (loadedWillStillHappen)
|
|
3210
|
+
if (loadedWillStillHappen) {
|
|
3191
3211
|
return;
|
|
3212
|
+
}
|
|
3192
3213
|
this.triggerLoaded();
|
|
3193
3214
|
}).catch(console.error);
|
|
3194
3215
|
}
|
|
@@ -3203,8 +3224,9 @@ var _Controller = class _Controller {
|
|
|
3203
3224
|
set exports(exports) {
|
|
3204
3225
|
if (this._exports !== exports) {
|
|
3205
3226
|
this._exports = exports;
|
|
3206
|
-
if (this.connectedCalled)
|
|
3227
|
+
if (this.connectedCalled) {
|
|
3207
3228
|
this.component.requestUpdate();
|
|
3229
|
+
}
|
|
3208
3230
|
this._exportWatchers.forEach(safeCall);
|
|
3209
3231
|
}
|
|
3210
3232
|
this._ready.resolve(exports);
|
|
@@ -3360,10 +3382,11 @@ var _Controller = class _Controller {
|
|
|
3360
3382
|
watch(property, callback) {
|
|
3361
3383
|
var _a2;
|
|
3362
3384
|
const type = getMemberType(this.component, property);
|
|
3363
|
-
if (type === void 0)
|
|
3385
|
+
if (type === void 0) {
|
|
3364
3386
|
throw new Error(
|
|
3365
3387
|
`Trying to watch a non-@property, non-@state property "${property}". Either convert it into a @state() or use get/set syntax`
|
|
3366
3388
|
);
|
|
3389
|
+
}
|
|
3367
3390
|
const internals = this.component.manager.internals;
|
|
3368
3391
|
(_a2 = internals.allWatchers)[property] ?? (_a2[property] = []);
|
|
3369
3392
|
const watchers = internals.allWatchers[property];
|
|
@@ -3372,13 +3395,15 @@ var _Controller = class _Controller {
|
|
|
3372
3395
|
watchers.push(safeCallback);
|
|
3373
3396
|
return () => {
|
|
3374
3397
|
const index = watchers.indexOf(safeCallback);
|
|
3375
|
-
if (index !== -1)
|
|
3398
|
+
if (index !== -1) {
|
|
3376
3399
|
watchers.splice(index, 1);
|
|
3400
|
+
}
|
|
3377
3401
|
};
|
|
3378
3402
|
}
|
|
3379
3403
|
controllerRemoved() {
|
|
3380
|
-
if (this.component.el.isConnected)
|
|
3404
|
+
if (this.component.el.isConnected) {
|
|
3381
3405
|
this.triggerDisconnected();
|
|
3406
|
+
}
|
|
3382
3407
|
this.triggerDestroy();
|
|
3383
3408
|
}
|
|
3384
3409
|
// Register a lifecycle callback
|
|
@@ -3406,68 +3431,80 @@ var _Controller = class _Controller {
|
|
|
3406
3431
|
}
|
|
3407
3432
|
onLifecycle(callback) {
|
|
3408
3433
|
this._callbacks.hostLifecycle.push(callback);
|
|
3409
|
-
if (this.connectedCalled && this.component.el.isConnected)
|
|
3434
|
+
if (this.connectedCalled && this.component.el.isConnected) {
|
|
3410
3435
|
this._callLifecycle(callback);
|
|
3436
|
+
}
|
|
3411
3437
|
}
|
|
3412
3438
|
// Call each lifecycle hook
|
|
3413
3439
|
triggerConnected() {
|
|
3414
3440
|
const genericController = this;
|
|
3415
|
-
if (genericController.hostConnected)
|
|
3441
|
+
if (genericController.hostConnected) {
|
|
3416
3442
|
safeCall(genericController.hostConnected, genericController);
|
|
3443
|
+
}
|
|
3417
3444
|
this._callbacks.hostConnected.forEach(safeCall);
|
|
3418
3445
|
this.triggerLifecycle();
|
|
3419
3446
|
this.connectedCalled = true;
|
|
3420
3447
|
}
|
|
3421
3448
|
triggerDisconnected() {
|
|
3422
3449
|
const genericController = this;
|
|
3423
|
-
if (genericController.hostDisconnected)
|
|
3450
|
+
if (genericController.hostDisconnected) {
|
|
3424
3451
|
safeCall(genericController.hostDisconnected, genericController);
|
|
3452
|
+
}
|
|
3425
3453
|
this._callbacks.hostDisconnected.forEach(safeCall);
|
|
3426
3454
|
this._lifecycleDisconnected.forEach(safeCall);
|
|
3427
3455
|
this._lifecycleDisconnected = [];
|
|
3428
3456
|
}
|
|
3429
3457
|
async triggerLoad() {
|
|
3430
|
-
if (this.willLoadCalled)
|
|
3458
|
+
if (this.willLoadCalled) {
|
|
3431
3459
|
return;
|
|
3460
|
+
}
|
|
3432
3461
|
this.willLoadCalled = true;
|
|
3433
3462
|
const genericController = this;
|
|
3434
|
-
if (genericController.hostLoad)
|
|
3463
|
+
if (genericController.hostLoad) {
|
|
3435
3464
|
await safeAsyncCall(genericController.hostLoad, genericController);
|
|
3436
|
-
|
|
3465
|
+
}
|
|
3466
|
+
if (this._callbacks.hostLoad.length > 0) {
|
|
3437
3467
|
await Promise.allSettled(this._callbacks.hostLoad.map(safeAsyncCall));
|
|
3468
|
+
}
|
|
3438
3469
|
this._ready.resolve(this._exports);
|
|
3439
3470
|
}
|
|
3440
3471
|
triggerLoaded() {
|
|
3441
|
-
if (this.didLoadCalled)
|
|
3472
|
+
if (this.didLoadCalled) {
|
|
3442
3473
|
return;
|
|
3474
|
+
}
|
|
3443
3475
|
const genericController = this;
|
|
3444
|
-
if (genericController.hostLoaded)
|
|
3476
|
+
if (genericController.hostLoaded) {
|
|
3445
3477
|
safeCall(genericController.hostLoaded, genericController);
|
|
3478
|
+
}
|
|
3446
3479
|
this._callbacks.hostLoaded.forEach(safeCall);
|
|
3447
3480
|
this.didLoadCalled = true;
|
|
3448
3481
|
}
|
|
3449
3482
|
triggerUpdate() {
|
|
3450
3483
|
const genericController = this;
|
|
3451
|
-
if (genericController.hostUpdate)
|
|
3484
|
+
if (genericController.hostUpdate) {
|
|
3452
3485
|
safeCall(genericController.hostUpdate, genericController);
|
|
3486
|
+
}
|
|
3453
3487
|
this._callbacks.hostUpdate.forEach(safeCall);
|
|
3454
3488
|
}
|
|
3455
3489
|
triggerUpdated() {
|
|
3456
3490
|
const genericController = this;
|
|
3457
|
-
if (genericController.hostUpdated)
|
|
3491
|
+
if (genericController.hostUpdated) {
|
|
3458
3492
|
safeCall(genericController.hostUpdated, genericController);
|
|
3493
|
+
}
|
|
3459
3494
|
this._callbacks.hostUpdated.forEach(safeCall);
|
|
3460
3495
|
}
|
|
3461
3496
|
triggerDestroy() {
|
|
3462
3497
|
const genericController = this;
|
|
3463
|
-
if (genericController.hostDestroy)
|
|
3498
|
+
if (genericController.hostDestroy) {
|
|
3464
3499
|
safeCall(genericController.hostDestroy, genericController);
|
|
3500
|
+
}
|
|
3465
3501
|
this._callbacks.hostDestroy.forEach(safeCall);
|
|
3466
3502
|
}
|
|
3467
3503
|
triggerLifecycle() {
|
|
3468
3504
|
const genericController = this;
|
|
3469
|
-
if (genericController.hostLifecycle)
|
|
3505
|
+
if (genericController.hostLifecycle) {
|
|
3470
3506
|
this._callLifecycle(() => genericController.hostLifecycle());
|
|
3507
|
+
}
|
|
3471
3508
|
this._callbacks.hostLifecycle.forEach((callback) => this._callLifecycle(callback));
|
|
3472
3509
|
}
|
|
3473
3510
|
_callLifecycle(callback) {
|
|
@@ -3475,10 +3512,11 @@ var _Controller = class _Controller {
|
|
|
3475
3512
|
const cleanupRaw = safeCall(callback);
|
|
3476
3513
|
const cleanup = Array.isArray(cleanupRaw) ? cleanupRaw : [cleanupRaw];
|
|
3477
3514
|
cleanup.forEach((cleanup2) => {
|
|
3478
|
-
if (typeof cleanup2 === "function")
|
|
3515
|
+
if (typeof cleanup2 === "function") {
|
|
3479
3516
|
this._lifecycleDisconnected.push(cleanup2);
|
|
3480
|
-
else if (typeof cleanup2 === "object" && typeof cleanup2.remove === "function")
|
|
3517
|
+
} else if (typeof cleanup2 === "object" && typeof cleanup2.remove === "function") {
|
|
3481
3518
|
this._lifecycleDisconnected.push(cleanup2.remove);
|
|
3519
|
+
}
|
|
3482
3520
|
});
|
|
3483
3521
|
}
|
|
3484
3522
|
};
|
|
@@ -3502,14 +3540,17 @@ var GenericController = class extends Controller {
|
|
|
3502
3540
|
}
|
|
3503
3541
|
};
|
|
3504
3542
|
function makeProvisionalValue(base) {
|
|
3505
|
-
if (typeof base !== "object" && typeof base !== "function" || base === null)
|
|
3543
|
+
if (typeof base !== "object" && typeof base !== "function" || base === null) {
|
|
3506
3544
|
return base;
|
|
3545
|
+
}
|
|
3507
3546
|
const proxy2 = new Proxy(base, {
|
|
3508
3547
|
get(target, prop, receiver) {
|
|
3509
|
-
if (cyclical.has(prop) && prop in target && target[prop] === proxy2)
|
|
3548
|
+
if (cyclical.has(prop) && prop in target && target[prop] === proxy2) {
|
|
3510
3549
|
return void 0;
|
|
3511
|
-
|
|
3550
|
+
}
|
|
3551
|
+
if (prop in target || prop in Promise.prototype || typeof prop === "symbol") {
|
|
3512
3552
|
return typeof target === "function" ? target[prop] : Reflect.get(target, prop, receiver);
|
|
3553
|
+
}
|
|
3513
3554
|
console.error(`Trying to access "${prop.toString()}" on the controller before it's loaded. ${accessBeforeLoad}`);
|
|
3514
3555
|
return void 0;
|
|
3515
3556
|
},
|
|
@@ -3523,19 +3564,21 @@ function makeProvisionalValue(base) {
|
|
|
3523
3564
|
var cyclical = /* @__PURE__ */ new Set(["exports", "_exports"]);
|
|
3524
3565
|
var accessBeforeLoad = "" ;
|
|
3525
3566
|
function toControllerHost(component) {
|
|
3526
|
-
if ("addController" in component)
|
|
3567
|
+
if ("addController" in component) {
|
|
3527
3568
|
return component;
|
|
3528
|
-
else
|
|
3569
|
+
} else {
|
|
3529
3570
|
throw new Error(
|
|
3530
3571
|
"Component does not implement ControllerHost. This might be because you forgot to add 'manager: Controller<this> = useControllerManager(this);' in your component, or you tried to use some controller before that line"
|
|
3531
3572
|
);
|
|
3573
|
+
}
|
|
3532
3574
|
}
|
|
3533
3575
|
var ignoreSet = (_, value) => value;
|
|
3534
3576
|
function trackPropertyKey(object, onResolved, defaultValue) {
|
|
3535
3577
|
const keys = Object.keys(object);
|
|
3536
3578
|
const keyCount = keys.length;
|
|
3537
|
-
if (keyTrackMap === void 0)
|
|
3579
|
+
if (keyTrackMap === void 0) {
|
|
3538
3580
|
queueMicrotask(keyTrackResolve);
|
|
3581
|
+
}
|
|
3539
3582
|
keyTrackMap ?? (keyTrackMap = /* @__PURE__ */ new Map());
|
|
3540
3583
|
let pendingTrackers = keyTrackMap.get(object);
|
|
3541
3584
|
if (pendingTrackers === void 0) {
|
|
@@ -3550,12 +3593,13 @@ function trackPropertyKey(object, onResolved, defaultValue) {
|
|
|
3550
3593
|
pendingTrackers.callbacks.push((keys2) => {
|
|
3551
3594
|
const callback = (key2) => safeCall(onResolved, null, key2);
|
|
3552
3595
|
const key = keys2[keyCount];
|
|
3553
|
-
if (key === void 0)
|
|
3596
|
+
if (key === void 0) {
|
|
3554
3597
|
callback(void 0);
|
|
3555
|
-
else if (object[key] === defaultValue)
|
|
3598
|
+
} else if (object[key] === defaultValue) {
|
|
3556
3599
|
callback(key);
|
|
3557
|
-
else
|
|
3600
|
+
} else {
|
|
3558
3601
|
callback(void 0);
|
|
3602
|
+
}
|
|
3559
3603
|
});
|
|
3560
3604
|
return defaultValue;
|
|
3561
3605
|
}
|
|
@@ -3586,10 +3630,12 @@ var ComponentInternals = class {
|
|
|
3586
3630
|
let leftToResolve = candidateHosts.length + 1;
|
|
3587
3631
|
const resolved = (resolution) => {
|
|
3588
3632
|
leftToResolve -= 1;
|
|
3589
|
-
if (resolution !== void 0)
|
|
3633
|
+
if (resolution !== void 0) {
|
|
3590
3634
|
leftToResolve = 0;
|
|
3591
|
-
|
|
3635
|
+
}
|
|
3636
|
+
if (leftToResolve === 0) {
|
|
3592
3637
|
onResolved(resolution);
|
|
3638
|
+
}
|
|
3593
3639
|
};
|
|
3594
3640
|
candidateHosts.forEach(
|
|
3595
3641
|
(host) => this.component.manager.trackPropertyKey(
|
|
@@ -3619,10 +3665,12 @@ var ComponentInternals = class {
|
|
|
3619
3665
|
return defaultValue;
|
|
3620
3666
|
};
|
|
3621
3667
|
this.trackPropKey = (onResolved, defaultValue) => {
|
|
3622
|
-
if (this._trackedValue !== nothing && this._trackedValue !== defaultValue)
|
|
3668
|
+
if (this._trackedValue !== nothing && this._trackedValue !== defaultValue) {
|
|
3623
3669
|
this._firePropertyTrackers(void 0, void 0, void 0);
|
|
3624
|
-
|
|
3670
|
+
}
|
|
3671
|
+
if (this._keyTrackers.length === 0) {
|
|
3625
3672
|
queueMicrotask(() => this._firePropertyTrackers(void 0, void 0, void 0));
|
|
3673
|
+
}
|
|
3626
3674
|
this._trackedValue = defaultValue;
|
|
3627
3675
|
this._keyTrackers.push(
|
|
3628
3676
|
(key, value, previousValue) => safeCall(onResolved, void 0, defaultValue === value ? key : void 0, previousValue)
|
|
@@ -3663,43 +3711,50 @@ var ComponentInternals = class {
|
|
|
3663
3711
|
const component = this.component;
|
|
3664
3712
|
const classPrototype = component.constructor.prototype;
|
|
3665
3713
|
this._getSetProxy(classPrototype, property, hasGetter, hasSetter, "class");
|
|
3666
|
-
if (component.manager.isLit)
|
|
3714
|
+
if (component.manager.isLit) {
|
|
3667
3715
|
return;
|
|
3716
|
+
}
|
|
3668
3717
|
const htmlPrototype = component.el.constructor.prototype;
|
|
3669
|
-
if (classPrototype !== htmlPrototype)
|
|
3718
|
+
if (classPrototype !== htmlPrototype) {
|
|
3670
3719
|
this._getSetProxy(htmlPrototype, property, hasGetter, hasSetter, "html");
|
|
3720
|
+
}
|
|
3671
3721
|
}
|
|
3672
3722
|
_getSetProxy(prototype, name, hasGetter, hasSetter, type) {
|
|
3673
3723
|
const component = this.component;
|
|
3674
3724
|
const propType = getMemberType(component, name);
|
|
3675
3725
|
const descriptor = Object.getOwnPropertyDescriptor(prototype, name);
|
|
3676
3726
|
const tolerateNotFound = type === "html";
|
|
3677
|
-
if (descriptor?.set === void 0 || descriptor.get === void 0)
|
|
3678
|
-
if (descriptor !== void 0 && "value" in descriptor)
|
|
3727
|
+
if (descriptor?.set === void 0 || descriptor.get === void 0) {
|
|
3728
|
+
if (descriptor !== void 0 && "value" in descriptor) {
|
|
3679
3729
|
throw new Error(
|
|
3680
3730
|
`getSet() should only be used on @Prop/@property/@State/@state properties. For internal component properties, use regular get/set syntax. Tried to use it on "${name}" in ${component.el.tagName}`
|
|
3681
3731
|
);
|
|
3682
|
-
else if (tolerateNotFound)
|
|
3732
|
+
} else if (tolerateNotFound) {
|
|
3683
3733
|
return;
|
|
3684
|
-
else
|
|
3734
|
+
} else {
|
|
3685
3735
|
throw new Error(`Unable to find "${name}" property on the ${component.el.tagName} component`);
|
|
3736
|
+
}
|
|
3737
|
+
}
|
|
3686
3738
|
const { get: originalGet, set: originalSet } = descriptor;
|
|
3687
3739
|
const isGetterAlreadyOverwritten = customAccessor in originalGet;
|
|
3688
3740
|
const isSetterAlreadyOverwritten = customAccessor in originalSet;
|
|
3689
3741
|
const shouldOverwriteGet = !isGetterAlreadyOverwritten && hasGetter;
|
|
3690
3742
|
const shouldOverwriteSet = !isSetterAlreadyOverwritten && hasSetter;
|
|
3691
|
-
if (!shouldOverwriteGet && !shouldOverwriteSet)
|
|
3743
|
+
if (!shouldOverwriteGet && !shouldOverwriteSet) {
|
|
3692
3744
|
return;
|
|
3745
|
+
}
|
|
3693
3746
|
const finalGetter = shouldOverwriteGet ? function getter() {
|
|
3694
3747
|
let value = originalGet.call(this);
|
|
3695
3748
|
const component2 = Controller.internals.elementToInstance.get(this);
|
|
3696
|
-
if (Controller.internals.shouldBypassGetter || component2 === void 0)
|
|
3749
|
+
if (Controller.internals.shouldBypassGetter || component2 === void 0) {
|
|
3697
3750
|
return value;
|
|
3751
|
+
}
|
|
3698
3752
|
const internals = component2.manager.internals;
|
|
3699
3753
|
value = internals.accessorGetter[name](value, name);
|
|
3700
3754
|
const getters = internals.getters[name] ?? emptyArray;
|
|
3701
|
-
for (let i = 0; i < getters.length; i++)
|
|
3755
|
+
for (let i = 0; i < getters.length; i++) {
|
|
3702
3756
|
value = getters[i](value, name);
|
|
3757
|
+
}
|
|
3703
3758
|
return value;
|
|
3704
3759
|
} : originalGet;
|
|
3705
3760
|
const finalSetter = shouldOverwriteSet ? function setter(rawNewValue) {
|
|
@@ -3711,27 +3766,32 @@ var ComponentInternals = class {
|
|
|
3711
3766
|
}
|
|
3712
3767
|
let newValue = component2.manager.isLit ? rawNewValue : parsePropertyValue(rawNewValue, propType);
|
|
3713
3768
|
const internals = component2.manager.internals;
|
|
3714
|
-
if (newValue === oldValue)
|
|
3769
|
+
if (newValue === oldValue) {
|
|
3715
3770
|
originalSet.call(this, rawNewValue);
|
|
3716
|
-
else {
|
|
3771
|
+
} else {
|
|
3717
3772
|
const setters = Controller.internals.shouldBypassSetter ? emptyArray : internals.setters[name] ?? emptyArray;
|
|
3718
3773
|
for (let i = 0; i < setters.length; i++) {
|
|
3719
3774
|
newValue = setters[i](newValue, oldValue, name);
|
|
3720
|
-
if (newValue === oldValue)
|
|
3775
|
+
if (newValue === oldValue) {
|
|
3721
3776
|
break;
|
|
3777
|
+
}
|
|
3722
3778
|
}
|
|
3723
3779
|
newValue = internals.accessorSetter[name](newValue, oldValue, name);
|
|
3724
3780
|
originalSet.call(this, newValue);
|
|
3725
|
-
if (newValue !== oldValue)
|
|
3781
|
+
if (newValue !== oldValue) {
|
|
3726
3782
|
internals.enabledWatchers[name]?.forEach((watcher) => watcher(newValue, oldValue, name));
|
|
3783
|
+
}
|
|
3727
3784
|
}
|
|
3728
|
-
if (internals._keyTrackers.length > 0)
|
|
3785
|
+
if (internals._keyTrackers.length > 0) {
|
|
3729
3786
|
internals?._firePropertyTrackers(name, rawNewValue, oldValue);
|
|
3787
|
+
}
|
|
3730
3788
|
} : originalSet;
|
|
3731
|
-
if (shouldOverwriteGet)
|
|
3789
|
+
if (shouldOverwriteGet) {
|
|
3732
3790
|
Object.defineProperty(finalGetter, customAccessor, { value: true });
|
|
3733
|
-
|
|
3791
|
+
}
|
|
3792
|
+
if (shouldOverwriteSet) {
|
|
3734
3793
|
Object.defineProperty(finalSetter, customAccessor, { value: true });
|
|
3794
|
+
}
|
|
3735
3795
|
Object.defineProperty(prototype, name, {
|
|
3736
3796
|
...descriptor,
|
|
3737
3797
|
get: finalGetter,
|
|
@@ -3743,14 +3803,16 @@ var ComponentInternals = class {
|
|
|
3743
3803
|
* controller.use
|
|
3744
3804
|
*/
|
|
3745
3805
|
markExports(controller, exports) {
|
|
3746
|
-
if (typeof exports === "object" && exports !== null || typeof exports === "function")
|
|
3806
|
+
if (typeof exports === "object" && exports !== null || typeof exports === "function") {
|
|
3747
3807
|
this._exports.set(exports, controller);
|
|
3808
|
+
}
|
|
3748
3809
|
}
|
|
3749
3810
|
resolveExports(exports) {
|
|
3750
|
-
if (typeof exports === "object" && exports !== null || typeof exports === "function")
|
|
3811
|
+
if (typeof exports === "object" && exports !== null || typeof exports === "function") {
|
|
3751
3812
|
return this._exports.get(exports);
|
|
3752
|
-
else
|
|
3813
|
+
} else {
|
|
3753
3814
|
return void 0;
|
|
3815
|
+
}
|
|
3754
3816
|
}
|
|
3755
3817
|
};
|
|
3756
3818
|
var emptyArray = [];
|
|
@@ -3763,8 +3825,9 @@ var ControllerManager = class extends GenericController {
|
|
|
3763
3825
|
const controllers = /* @__PURE__ */ new Set();
|
|
3764
3826
|
function addController(controller) {
|
|
3765
3827
|
controllers.add(controller);
|
|
3766
|
-
if (isLit && !(controllerSymbol in controller) && component.el.isConnected)
|
|
3828
|
+
if (isLit && !(controllerSymbol in controller) && component.el.isConnected) {
|
|
3767
3829
|
controller.hostConnected?.();
|
|
3830
|
+
}
|
|
3768
3831
|
}
|
|
3769
3832
|
function removeController(controller) {
|
|
3770
3833
|
void controllers.delete(controller);
|
|
@@ -3826,21 +3889,24 @@ var ControllerManager = class extends GenericController {
|
|
|
3826
3889
|
*/
|
|
3827
3890
|
this.trackKey = this.internals.trackKey;
|
|
3828
3891
|
this._readonlySetter = (newValue, oldValue, property) => {
|
|
3829
|
-
if (Controller.internals.shouldBypassReadonly)
|
|
3892
|
+
if (Controller.internals.shouldBypassReadonly) {
|
|
3830
3893
|
return newValue;
|
|
3894
|
+
}
|
|
3831
3895
|
const component = this.component;
|
|
3832
3896
|
const isProp = getPropType(component, property) === "prop";
|
|
3833
3897
|
if (isProp) {
|
|
3834
3898
|
if (this.isLit) {
|
|
3835
3899
|
const details = getLitProperties(component).get(property);
|
|
3836
|
-
if (details && details?.attribute !== false)
|
|
3900
|
+
if (details && details?.attribute !== false) {
|
|
3837
3901
|
component.el.setAttribute(
|
|
3838
3902
|
typeof details.attribute === "string" ? details.attribute : camelToKebab(property),
|
|
3839
3903
|
// Not using converter.toAttribute to keep this unlikely case simpler
|
|
3840
3904
|
String(oldValue)
|
|
3841
3905
|
);
|
|
3842
|
-
|
|
3906
|
+
}
|
|
3907
|
+
} else {
|
|
3843
3908
|
component.requestUpdate();
|
|
3909
|
+
}
|
|
3844
3910
|
}
|
|
3845
3911
|
throw new Error(
|
|
3846
3912
|
`Cannot assign to read-only property "${property}" of ${component.el.tagName.toLowerCase()}. Trying to assign "${String(
|
|
@@ -3862,13 +3928,15 @@ var ControllerManager = class extends GenericController {
|
|
|
3862
3928
|
this._controllers = controllers;
|
|
3863
3929
|
this.exports = void 0;
|
|
3864
3930
|
this.hasDestroy = "autoDestroyDisabled" in this.component && typeof this.component.destroy === "function";
|
|
3865
|
-
if (this.hasDestroy)
|
|
3931
|
+
if (this.hasDestroy) {
|
|
3866
3932
|
this.watch("autoDestroyDisabled", () => this._autoDestroyDisabledWatcher());
|
|
3933
|
+
}
|
|
3867
3934
|
this._bindLifecycleMethods();
|
|
3868
|
-
if (!isLit)
|
|
3935
|
+
if (!isLit) {
|
|
3869
3936
|
Object.defineProperty(component, "updateComplete", {
|
|
3870
3937
|
get: async () => await this._updatePromise.promise
|
|
3871
3938
|
});
|
|
3939
|
+
}
|
|
3872
3940
|
const members = getPropLikeMembers(component);
|
|
3873
3941
|
const internals = component.manager.internals;
|
|
3874
3942
|
members.forEach((name) => {
|
|
@@ -3898,7 +3966,7 @@ var ControllerManager = class extends GenericController {
|
|
|
3898
3966
|
const hostDisconnected = this._disconnectedCallback.bind(this);
|
|
3899
3967
|
const hostUpdate = this._update.bind(this);
|
|
3900
3968
|
const hostUpdated = this._updated.bind(this);
|
|
3901
|
-
if (isLit)
|
|
3969
|
+
if (isLit) {
|
|
3902
3970
|
component.constructor.prototype.addController.call(component, {
|
|
3903
3971
|
// Lit will call these callbacks
|
|
3904
3972
|
hostConnected,
|
|
@@ -3906,7 +3974,7 @@ var ControllerManager = class extends GenericController {
|
|
|
3906
3974
|
hostUpdate,
|
|
3907
3975
|
hostUpdated
|
|
3908
3976
|
});
|
|
3909
|
-
else {
|
|
3977
|
+
} else {
|
|
3910
3978
|
component.connectedCallback = hostConnected;
|
|
3911
3979
|
component.disconnectedCallback = hostDisconnected;
|
|
3912
3980
|
component.componentWillLoad = this._load.bind(this);
|
|
@@ -3914,16 +3982,18 @@ var ControllerManager = class extends GenericController {
|
|
|
3914
3982
|
component.componentWillUpdate = hostUpdate;
|
|
3915
3983
|
component.componentDidUpdate = hostUpdated;
|
|
3916
3984
|
}
|
|
3917
|
-
if (this.hasDestroy)
|
|
3985
|
+
if (this.hasDestroy) {
|
|
3918
3986
|
component.destroy = this.destroy.bind(this);
|
|
3987
|
+
}
|
|
3919
3988
|
}
|
|
3920
3989
|
/**
|
|
3921
3990
|
* Throws an error if component does not implement destroy() lifecycle, but
|
|
3922
3991
|
* tries to use it.
|
|
3923
3992
|
*/
|
|
3924
3993
|
ensureHasDestroy() {
|
|
3925
|
-
if (!this.hasDestroy)
|
|
3994
|
+
if (!this.hasDestroy) {
|
|
3926
3995
|
throw new Error(destroyErrorMessage);
|
|
3996
|
+
}
|
|
3927
3997
|
}
|
|
3928
3998
|
/**
|
|
3929
3999
|
* Private because this is not supposed to be called by Component directly.
|
|
@@ -3938,8 +4008,9 @@ var ControllerManager = class extends GenericController {
|
|
|
3938
4008
|
`The ${tagName} component has already been destroyed. It can not be used again. If you meant to disconnect and reconnect a component without automatic destroy, set the autoDestroyDisabled prop.`
|
|
3939
4009
|
);
|
|
3940
4010
|
}
|
|
3941
|
-
if (this._autoDestroyTimeout !== void 0)
|
|
4011
|
+
if (this._autoDestroyTimeout !== void 0) {
|
|
3942
4012
|
clearTimeout(this._autoDestroyTimeout);
|
|
4013
|
+
}
|
|
3943
4014
|
this.internals.enabledWatchers = this.internals.allWatchers;
|
|
3944
4015
|
keyTrackResolve();
|
|
3945
4016
|
this._controllers.forEach(
|
|
@@ -3948,23 +4019,26 @@ var ControllerManager = class extends GenericController {
|
|
|
3948
4019
|
this._originalLifecycles.connectedCallback?.call(this.component);
|
|
3949
4020
|
}
|
|
3950
4021
|
_disconnectedCallback() {
|
|
3951
|
-
if (this.destroyed)
|
|
4022
|
+
if (this.destroyed) {
|
|
3952
4023
|
return;
|
|
4024
|
+
}
|
|
3953
4025
|
this._controllers.forEach(
|
|
3954
4026
|
(controller) => "triggerDisconnected" in controller ? controller.triggerDisconnected() : safeCall(controller.hostDisconnected, controller)
|
|
3955
4027
|
);
|
|
3956
4028
|
this._originalLifecycles.disconnectedCallback?.call(this.component);
|
|
3957
|
-
if (this.hasDestroy)
|
|
4029
|
+
if (this.hasDestroy) {
|
|
3958
4030
|
this._autoDestroyDisabledWatcher();
|
|
4031
|
+
}
|
|
3959
4032
|
}
|
|
3960
4033
|
async _load() {
|
|
3961
4034
|
const integrations = this.internals.reactiveUtilsIntegrations;
|
|
3962
4035
|
if (integrations.size > 0) {
|
|
3963
4036
|
for (const controller of integrations) {
|
|
3964
|
-
if ("triggerLoad" in controller)
|
|
4037
|
+
if ("triggerLoad" in controller) {
|
|
3965
4038
|
await controller.triggerLoad();
|
|
3966
|
-
else
|
|
4039
|
+
} else {
|
|
3967
4040
|
await safeAsyncCall(controller.hostLoad, controller);
|
|
4041
|
+
}
|
|
3968
4042
|
}
|
|
3969
4043
|
}
|
|
3970
4044
|
await Promise.allSettled(
|
|
@@ -4000,8 +4074,9 @@ var ControllerManager = class extends GenericController {
|
|
|
4000
4074
|
}
|
|
4001
4075
|
async destroy() {
|
|
4002
4076
|
this.ensureHasDestroy();
|
|
4003
|
-
if (this.destroyed)
|
|
4077
|
+
if (this.destroyed) {
|
|
4004
4078
|
return;
|
|
4079
|
+
}
|
|
4005
4080
|
if (this.component.el.isConnected) {
|
|
4006
4081
|
this.hasDestroy = false;
|
|
4007
4082
|
try {
|
|
@@ -4020,10 +4095,13 @@ var ControllerManager = class extends GenericController {
|
|
|
4020
4095
|
}
|
|
4021
4096
|
_autoDestroyDisabledWatcher() {
|
|
4022
4097
|
if (!this.component.el.isConnected && !this.component.autoDestroyDisabled) {
|
|
4023
|
-
if (this._autoDestroyTimeout !== void 0)
|
|
4098
|
+
if (this._autoDestroyTimeout !== void 0) {
|
|
4024
4099
|
clearTimeout(this._autoDestroyTimeout);
|
|
4100
|
+
}
|
|
4025
4101
|
const destroy = () => void this.destroy().catch(console.error);
|
|
4026
|
-
|
|
4102
|
+
{
|
|
4103
|
+
this._autoDestroyTimeout = devToolsAwareTimeout(destroy, autoDestroyOnDisconnectTimeout);
|
|
4104
|
+
}
|
|
4027
4105
|
}
|
|
4028
4106
|
}
|
|
4029
4107
|
// REFACTOR: replace this with a readonly:true option in @property()
|
|
@@ -4074,10 +4152,11 @@ var ControllerManager = class extends GenericController {
|
|
|
4074
4152
|
getSet(defaultValue, getSet) {
|
|
4075
4153
|
return this.component.manager.trackPropKey((name) => {
|
|
4076
4154
|
var _a2;
|
|
4077
|
-
if (name === void 0)
|
|
4155
|
+
if (name === void 0) {
|
|
4078
4156
|
throw new Error(
|
|
4079
4157
|
"Unable to resolve get/set's prop name. Make sure you are using it like @Prop() someProp = this.manager.getSet(defaultValue,{get,set})"
|
|
4080
4158
|
);
|
|
4159
|
+
}
|
|
4081
4160
|
if (getSet.set === this._readonlySetter) {
|
|
4082
4161
|
(_a2 = this.internals).readonlyProps ?? (_a2.readonlyProps = /* @__PURE__ */ new Set());
|
|
4083
4162
|
this.internals.readonlyProps.add(name);
|
|
@@ -4088,20 +4167,22 @@ var ControllerManager = class extends GenericController {
|
|
|
4088
4167
|
const initialSet = getSet.initialSet ?? true;
|
|
4089
4168
|
if (value != null && value !== defaultValue && typeof getSet.set === "function" && initialSet && !isStencilHotReload) {
|
|
4090
4169
|
const newValue = getSet.set(value, defaultValue, name);
|
|
4091
|
-
if (newValue !== value)
|
|
4092
|
-
if (this.isLit)
|
|
4170
|
+
if (newValue !== value) {
|
|
4171
|
+
if (this.isLit) {
|
|
4093
4172
|
genericComponent[name] = newValue;
|
|
4094
|
-
else {
|
|
4173
|
+
} else {
|
|
4095
4174
|
let firstConnected = true;
|
|
4096
4175
|
this.onConnected(() => {
|
|
4097
|
-
if (!firstConnected)
|
|
4176
|
+
if (!firstConnected) {
|
|
4098
4177
|
return;
|
|
4178
|
+
}
|
|
4099
4179
|
firstConnected = true;
|
|
4100
4180
|
this.bypassSetter(() => {
|
|
4101
4181
|
genericComponent[name] = newValue;
|
|
4102
4182
|
});
|
|
4103
4183
|
});
|
|
4104
4184
|
}
|
|
4185
|
+
}
|
|
4105
4186
|
}
|
|
4106
4187
|
this.genericGetSet(name, getSet);
|
|
4107
4188
|
}, defaultValue);
|
|
@@ -4138,29 +4219,34 @@ function setProxy(controller, { host, key, type }, initialExports) {
|
|
|
4138
4219
|
const controllerValueChanged = genericHost[key] !== controller.exports;
|
|
4139
4220
|
const hostValueChanged = genericHost[key] !== initialExports;
|
|
4140
4221
|
const controllerUpdatedExports = initialExports !== controller.exports;
|
|
4141
|
-
if (controllerValueChanged && !hostValueChanged && controllerUpdatedExports)
|
|
4222
|
+
if (controllerValueChanged && !hostValueChanged && controllerUpdatedExports) {
|
|
4142
4223
|
genericHost[key] = controller.exports;
|
|
4224
|
+
}
|
|
4143
4225
|
const isProxyExportsOnComponent = host === controller.component;
|
|
4144
4226
|
if (isProxyExportsOnComponent && type === "prop") {
|
|
4145
4227
|
const internals = controller.component.manager.internals;
|
|
4146
|
-
if (hostValueChanged)
|
|
4228
|
+
if (hostValueChanged) {
|
|
4147
4229
|
internals.markExports(controller, genericHost[key]);
|
|
4230
|
+
}
|
|
4148
4231
|
controller.component.manager.watch(key, (value) => {
|
|
4149
|
-
if (value !== controller.exports)
|
|
4232
|
+
if (value !== controller.exports) {
|
|
4150
4233
|
internals.markExports(controller, value);
|
|
4234
|
+
}
|
|
4151
4235
|
});
|
|
4152
4236
|
}
|
|
4153
4237
|
controller.watchExports(() => {
|
|
4154
|
-
if (genericHost[key] === controller.exports)
|
|
4238
|
+
if (genericHost[key] === controller.exports) {
|
|
4155
4239
|
return;
|
|
4240
|
+
}
|
|
4156
4241
|
const manager = controller.component.manager;
|
|
4157
4242
|
const isReadOnly = manager.internals.readonlyProps?.has(key) === true;
|
|
4158
|
-
if (isReadOnly)
|
|
4243
|
+
if (isReadOnly) {
|
|
4159
4244
|
manager.bypassReadonly(() => {
|
|
4160
4245
|
genericHost[key] = controller.exports;
|
|
4161
4246
|
});
|
|
4162
|
-
else
|
|
4247
|
+
} else {
|
|
4163
4248
|
genericHost[key] = controller.exports;
|
|
4249
|
+
}
|
|
4164
4250
|
});
|
|
4165
4251
|
}
|
|
4166
4252
|
|
|
@@ -4175,8 +4261,9 @@ var FunctionalController = class extends Controller {
|
|
|
4175
4261
|
const value = constructor(this.component, this);
|
|
4176
4262
|
const constructorChangedExports = this.exports !== originalExports;
|
|
4177
4263
|
if (value instanceof Promise) {
|
|
4178
|
-
if (!constructorChangedExports)
|
|
4264
|
+
if (!constructorChangedExports) {
|
|
4179
4265
|
this.setProvisionalExports(value);
|
|
4266
|
+
}
|
|
4180
4267
|
const resolved = value.then((result) => {
|
|
4181
4268
|
this.exports = result;
|
|
4182
4269
|
super.catchUpLifecycle();
|
|
@@ -4186,8 +4273,9 @@ var FunctionalController = class extends Controller {
|
|
|
4186
4273
|
});
|
|
4187
4274
|
this.onLoad(async () => await resolved);
|
|
4188
4275
|
} else {
|
|
4189
|
-
if (!constructorChangedExports || value !== void 0)
|
|
4276
|
+
if (!constructorChangedExports || value !== void 0) {
|
|
4190
4277
|
this.exports = value;
|
|
4278
|
+
}
|
|
4191
4279
|
queueMicrotask(() => super.catchUpLifecycle());
|
|
4192
4280
|
}
|
|
4193
4281
|
} catch (error) {
|
|
@@ -4212,14 +4300,16 @@ var makeT9nController = (getAssetPath) => ({ blocking = false, name } = {}) => (
|
|
|
4212
4300
|
({ t9nLocale, t9nStrings, lang }) => {
|
|
4213
4301
|
controller.exports = { ...t9nStrings, _lang: lang, _t9nLocale: t9nLocale };
|
|
4214
4302
|
const label = t9nStrings.componentLabel ?? t9nStrings.widgetLabel;
|
|
4215
|
-
if (typeof label === "string" && "label" in component && component.label == null)
|
|
4303
|
+
if (typeof label === "string" && "label" in component && component.label == null) {
|
|
4216
4304
|
component.label ?? (component.label = label);
|
|
4305
|
+
}
|
|
4217
4306
|
},
|
|
4218
4307
|
name
|
|
4219
4308
|
)
|
|
4220
4309
|
);
|
|
4221
|
-
if (blocking)
|
|
4310
|
+
if (blocking) {
|
|
4222
4311
|
return controller.ready;
|
|
4312
|
+
}
|
|
4223
4313
|
const locale = getElementLocales(component.el);
|
|
4224
4314
|
return { _lang: locale.lang, _t9nLocale: locale.t9nLocale };
|
|
4225
4315
|
})
|
|
@@ -4372,7 +4462,7 @@ async function getArcadeWorker(uri) {
|
|
|
4372
4462
|
* @returns arcade mode module
|
|
4373
4463
|
*/
|
|
4374
4464
|
async function getMode() {
|
|
4375
|
-
return await import('./arcade-mode-
|
|
4465
|
+
return await import('./arcade-mode-2c605ffa.js');
|
|
4376
4466
|
}
|
|
4377
4467
|
// Register the language in Monaco
|
|
4378
4468
|
languages.register({
|
|
@@ -4489,8 +4579,9 @@ const ArcgisArcadeApi = class {
|
|
|
4489
4579
|
}
|
|
4490
4580
|
catch (e) {
|
|
4491
4581
|
console.error("Could not load api library", e);
|
|
4492
|
-
if (e instanceof Error)
|
|
4582
|
+
if (e instanceof Error) {
|
|
4493
4583
|
console.error(e.stack);
|
|
4584
|
+
}
|
|
4494
4585
|
this._apiLibrary = undefined;
|
|
4495
4586
|
}
|
|
4496
4587
|
finally {
|