@arcgis/coding-components 4.30.0-next.47 → 4.30.0-next.49
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-833b0216.js → p-00583f5a.js} +2 -2
- package/dist/arcgis-coding-components/{p-4fd5a02d.js → p-384b88cc.js} +3 -3
- package/dist/arcgis-coding-components/{p-a0704d86.js → p-523db1e4.js} +10 -10
- package/dist/arcgis-coding-components/{p-a412be74.js → p-59f2dedc.js} +2 -2
- package/dist/arcgis-coding-components/{p-1a627096.js → p-82321ce1.js} +3 -3
- package/dist/arcgis-coding-components/{p-6fd22ff7.js → p-82c4966b.js} +3 -3
- package/dist/arcgis-coding-components/{p-621187ef.js → p-8d013f83.js} +2 -2
- package/dist/arcgis-coding-components/{p-0fee5174.js → p-9054397c.js} +3 -3
- package/dist/arcgis-coding-components/p-905b1583.js +7 -0
- package/dist/arcgis-coding-components/{p-29207f1e.js → p-9859037c.js} +1 -1
- package/dist/arcgis-coding-components/{p-ab7e89c0.js → p-d32ebf93.js} +2 -2
- package/dist/arcgis-coding-components/p-fe90777a.entry.js +6 -0
- package/dist/cjs/{arcade-defaults-4e0664fb.js → arcade-defaults-c09aa6ca.js} +10 -26
- package/dist/cjs/{arcade-mode-61a07430.js → arcade-mode-f43455a9.js} +3 -3
- package/dist/cjs/arcgis-arcade-api_6.cjs.entry.js +257 -283
- package/dist/cjs/arcgis-coding-components.cjs.js +2 -2
- package/dist/cjs/{css-fac19960.js → css-d565ba31.js} +1 -1
- package/dist/cjs/{cssMode-22d917f0.js → cssMode-0c9ea16a.js} +3 -3
- package/dist/cjs/{html-5bc24648.js → html-bbac75a5.js} +3 -3
- package/dist/cjs/{htmlMode-f09628e1.js → htmlMode-275dad7c.js} +3 -3
- package/dist/cjs/{index-02749111.js → index-97b5c264.js} +2 -9
- package/dist/cjs/index.cjs.js +3 -3
- package/dist/cjs/{javascript-29521fd3.js → javascript-3bc3e94b.js} +4 -4
- package/dist/cjs/{jsonMode-99606370.js → jsonMode-358b250b.js} +3 -3
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{tsMode-e34432d7.js → tsMode-10794c88.js} +3 -3
- package/dist/cjs/{typescript-8ce06335.js → typescript-a3afcaae.js} +3 -3
- package/dist/components/arcade-api.js +6 -5
- package/dist/components/arcade-contribution.js +3 -2
- package/dist/components/arcade-defaults.js +3 -3
- package/dist/components/arcade-mode.js +2 -2
- package/dist/components/arcade-results.js +7 -6
- package/dist/components/arcade-suggestions.js +8 -7
- package/dist/components/arcade-variables.js +6 -5
- package/dist/components/arcgis-arcade-api.js +1 -1
- package/dist/components/arcgis-arcade-editor.js +6 -5
- 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-36QZLGG2.js → chunk-27DTPISK.js} +250 -282
- package/dist/components/code-editor.js +5 -5
- package/dist/components/fields.js +62 -2
- package/dist/components/index.js +1 -1
- package/dist/components/index2.js +2 -76
- package/dist/components/markdown.js +1 -1
- package/dist/components/useT9n.js +11 -0
- package/dist/components/utilities.js +2 -2
- package/dist/esm/{arcade-defaults-fdba0972.js → arcade-defaults-0903c8e4.js} +11 -25
- package/dist/esm/{arcade-mode-0d144d92.js → arcade-mode-6bc35b9a.js} +3 -3
- package/dist/esm/arcgis-arcade-api_6.entry.js +256 -282
- package/dist/esm/arcgis-coding-components.js +3 -3
- package/dist/esm/{css-58b4c966.js → css-549e7ecd.js} +1 -1
- package/dist/esm/{cssMode-f5916932.js → cssMode-63059930.js} +3 -3
- package/dist/esm/{html-7c8fbcc5.js → html-03b9ab7d.js} +3 -3
- package/dist/esm/{htmlMode-d7755346.js → htmlMode-ae2b0579.js} +3 -3
- package/dist/esm/{index-c6b28dae.js → index-88cb51ca.js} +3 -9
- package/dist/esm/index.js +3 -3
- package/dist/esm/{javascript-9ac36865.js → javascript-df9e60b6.js} +4 -4
- package/dist/esm/{jsonMode-ef328849.js → jsonMode-e0f3f4e6.js} +3 -3
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{tsMode-0daf7dc9.js → tsMode-4477deb0.js} +3 -3
- package/dist/esm/{typescript-a34ba038.js → typescript-4ca85521.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/components/arcade-suggestions/arcade-suggestions.d.ts +1 -1
- package/dist/types/controllers/useT9n.d.ts +1 -0
- 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/dist/types/data/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/support/sass-inline-url-importer.d.ts +9 -0
- package/dist/types/data/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/support/sass-json-importer.d.ts +19 -0
- package/dist/types/data/actions-runner-1/_work/arcgis-web-components/arcgis-web-components/packages/coding-packages/coding-components/.stencil/support/stencil-monaco-plugins.d.ts +6 -0
- package/package.json +9 -9
- package/dist/arcgis-coding-components/p-2b6dab4b.entry.js +0 -6
- package/dist/arcgis-coding-components/p-d5df8d73.js +0 -7
|
@@ -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.49
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
import { g as generateTokensCSSForColorMap, e as editor, S as StandaloneServices, I as IStandaloneThemeService, c as createCommonjsModule, b as commonjsGlobal, i as
|
|
6
|
+
import { g as getAssetPath, r as registerInstance, c as createEvent, h, H as Host, a as getElement, F as Fragment } from './index-88cb51ca.js';
|
|
7
|
+
import { g as generateTokensCSSForColorMap, e as editor, S as StandaloneServices, I as IStandaloneThemeService, c as createCommonjsModule, b as commonjsGlobal, i as isURL, h as hasSameOrigin, d as importRequest, l as languages, f as arcadeDefaults, U as Uri, s as setFocusOnElement, j as filterCollection, k as addLTRMark, m as importArcade, D as Deferred$1, n as generateGuid, o as getElementTheme, K as KeyCode, p as setValuesInString, q as quoteString, r as supportedFields, t as createFilterExpression, R as Range, u as observeAncestorsMutation$1, v as KeyMod } from './arcade-defaults-0903c8e4.js';
|
|
8
8
|
|
|
9
9
|
async function colorizeCode(code) {
|
|
10
10
|
return await editor.colorize(code, "arcade", { tabSize: 2 });
|
|
@@ -2935,17 +2935,30 @@ function convertMarkdownString(value) {
|
|
|
2935
2935
|
return marked_umd.marked.parse(typeof value === "string" ? value : value.value);
|
|
2936
2936
|
}
|
|
2937
2937
|
|
|
2938
|
-
// src/
|
|
2939
|
-
function
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2938
|
+
// src/framework.ts
|
|
2939
|
+
function retrieveComponentMembers(component, isLit) {
|
|
2940
|
+
if (isLit) {
|
|
2941
|
+
const elementProperties = getLitProperties(component);
|
|
2942
|
+
component.manager.internals.members = Object.fromEntries(
|
|
2943
|
+
Array.from(elementProperties, ([name, { state, type }]) => [
|
|
2944
|
+
name,
|
|
2945
|
+
[
|
|
2946
|
+
state ? 32 /* State */ : type === Number ? 2 /* Number */ : type === Boolean ? 4 /* Boolean */ : 1 /* String */
|
|
2947
|
+
]
|
|
2948
|
+
])
|
|
2946
2949
|
);
|
|
2947
|
-
|
|
2950
|
+
} else {
|
|
2951
|
+
const constructor = component.constructor;
|
|
2952
|
+
const members = constructor.__registerControllers?.(component) ?? void 0;
|
|
2953
|
+
constructor.__registerControllers = void 0;
|
|
2954
|
+
if (typeof members !== "object")
|
|
2955
|
+
throw new Error(
|
|
2956
|
+
"Failed to retrieve internal component meta. Make sure you have the useComponentsControllers() Rollup Plugin for Stencil Controllers configured in your Stencil config."
|
|
2957
|
+
);
|
|
2958
|
+
component.manager.internals.members = members;
|
|
2959
|
+
}
|
|
2948
2960
|
}
|
|
2961
|
+
var getLitProperties = (component) => component.constructor.elementProperties;
|
|
2949
2962
|
function parsePropertyValue(value, type = 8 /* Any */) {
|
|
2950
2963
|
const isComplex = value == null || typeof value === "object" || typeof value === "function";
|
|
2951
2964
|
if (isComplex)
|
|
@@ -2953,7 +2966,7 @@ function parsePropertyValue(value, type = 8 /* Any */) {
|
|
|
2953
2966
|
if ((type & 4 /* Boolean */) !== 0)
|
|
2954
2967
|
return value === "false" ? false : value === "" || !!value;
|
|
2955
2968
|
else if ((type & 2 /* Number */) !== 0)
|
|
2956
|
-
return Number.parseFloat(value
|
|
2969
|
+
return Number.parseFloat(value);
|
|
2957
2970
|
else if ((type & 1 /* String */) !== 0)
|
|
2958
2971
|
return String(value);
|
|
2959
2972
|
else
|
|
@@ -2975,6 +2988,21 @@ function getPropType(component, name) {
|
|
|
2975
2988
|
return "prop";
|
|
2976
2989
|
}
|
|
2977
2990
|
|
|
2991
|
+
// src/types.ts
|
|
2992
|
+
var controllerSymbol = Symbol("controller");
|
|
2993
|
+
|
|
2994
|
+
// src/utils.ts
|
|
2995
|
+
function extendObject(base, extend) {
|
|
2996
|
+
Object.entries(extend).forEach(([key, value]) => {
|
|
2997
|
+
if (key in base)
|
|
2998
|
+
throw new Error(`Unable to extend object because property "${key}" is already defined`);
|
|
2999
|
+
const thisBase = base;
|
|
3000
|
+
thisBase[key] = value;
|
|
3001
|
+
});
|
|
3002
|
+
return base;
|
|
3003
|
+
}
|
|
3004
|
+
var isController = (value) => typeof value === "object" && value !== null && (controllerSymbol in value || "hostConnected" in value || "hostDisconnected" in value || "hostUpdate" in value || "hostUpdated" in value);
|
|
3005
|
+
|
|
2978
3006
|
// ../components-utils/dist/index.js
|
|
2979
3007
|
var Deferred = class {
|
|
2980
3008
|
/**
|
|
@@ -3079,6 +3107,7 @@ async function safeAsyncCall(callback) {
|
|
|
3079
3107
|
}
|
|
3080
3108
|
return void 0;
|
|
3081
3109
|
}
|
|
3110
|
+
var camelToKebab = (string) => string.replace(upperBeforeLower, (upper, remainder) => `${remainder === 0 ? "" : "-"}${upper.toLowerCase()}`);
|
|
3082
3111
|
var upperBeforeLower = /[A-Z]+(?![a-z])|[A-Z]/gu;
|
|
3083
3112
|
var capitalize = (string) => string.charAt(0).toUpperCase() + string.slice(1);
|
|
3084
3113
|
var camelToHuman = (string) => capitalize(string.replace(upperBeforeLower, (upper, remainder) => `${remainder === 0 ? "" : " "}${upper}`));
|
|
@@ -3178,21 +3207,6 @@ async function updateComponentLocateState(element, assetsPath, assetName = eleme
|
|
|
3178
3207
|
return { lang, t9nLocale, t9nStrings };
|
|
3179
3208
|
}
|
|
3180
3209
|
|
|
3181
|
-
// src/types.ts
|
|
3182
|
-
var controllerSymbol = Symbol("controller");
|
|
3183
|
-
|
|
3184
|
-
// src/utils.ts
|
|
3185
|
-
function extendObject(base, extend) {
|
|
3186
|
-
Object.entries(extend).forEach(([key, value]) => {
|
|
3187
|
-
if (key in base)
|
|
3188
|
-
throw new Error(`Unable to extend object because property "${key}" is already defined`);
|
|
3189
|
-
const thisBase = base;
|
|
3190
|
-
thisBase[key] = value;
|
|
3191
|
-
});
|
|
3192
|
-
return base;
|
|
3193
|
-
}
|
|
3194
|
-
var isController = (value) => typeof value === "object" && value !== null && (controllerSymbol in value || "hostConnected" in value || "hostDisconnected" in value || "hostUpdate" in value || "hostUpdated" in value);
|
|
3195
|
-
|
|
3196
3210
|
// src/ControllerInternals.ts
|
|
3197
3211
|
var ControllerInternals = class {
|
|
3198
3212
|
constructor() {
|
|
@@ -3357,26 +3371,23 @@ var _Controller = class _Controller {
|
|
|
3357
3371
|
value: resolvedComponent
|
|
3358
3372
|
});
|
|
3359
3373
|
this.component.addController(this);
|
|
3360
|
-
const manager = this.component.manager;
|
|
3361
|
-
this.connected = manager?.connected;
|
|
3362
|
-
this.internals = manager?.internals;
|
|
3363
3374
|
_Controller.internals.setParentController(this);
|
|
3364
3375
|
if ("hostDestroy" in this)
|
|
3365
3376
|
this.component.manager.ensureHasDestroy();
|
|
3366
|
-
|
|
3377
|
+
const manager = this.component.manager;
|
|
3378
|
+
const isInControllerManager = manager === void 0;
|
|
3379
|
+
if (!isInControllerManager)
|
|
3367
3380
|
queueMicrotask(() => this.catchUpLifecycle());
|
|
3368
|
-
const controller = this;
|
|
3381
|
+
const controller = isInControllerManager ? {} : this;
|
|
3369
3382
|
this._callbacks = {
|
|
3370
|
-
hostConnected: "hostConnected" in
|
|
3371
|
-
hostDisconnected: "hostDisconnected" in
|
|
3372
|
-
hostLoad: "hostLoad" in
|
|
3373
|
-
hostLoaded: "hostLoaded" in
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
hostDestroy: "hostDestroy" in this ? [() => controller.hostDestroy?.()] : [],
|
|
3379
|
-
hostLifecycle: "hostLifecycle" in this ? [() => controller.hostLifecycle?.()] : []
|
|
3383
|
+
hostConnected: "hostConnected" in controller ? [() => controller.hostConnected?.()] : [],
|
|
3384
|
+
hostDisconnected: "hostDisconnected" in controller ? [() => controller.hostDisconnected?.()] : [],
|
|
3385
|
+
hostLoad: "hostLoad" in controller ? [() => controller.hostLoad?.()] : [],
|
|
3386
|
+
hostLoaded: "hostLoaded" in controller ? [() => controller.hostLoaded?.()] : [],
|
|
3387
|
+
hostUpdate: "hostUpdate" in controller ? [() => controller.hostUpdate?.()] : [],
|
|
3388
|
+
hostUpdated: "hostUpdated" in controller ? [() => controller.hostUpdated?.()] : [],
|
|
3389
|
+
hostDestroy: "hostDestroy" in controller ? [() => controller.hostDestroy?.()] : [],
|
|
3390
|
+
hostLifecycle: "hostLifecycle" in controller ? [() => controller.hostLifecycle?.()] : []
|
|
3380
3391
|
};
|
|
3381
3392
|
}
|
|
3382
3393
|
/**
|
|
@@ -3501,7 +3512,7 @@ var _Controller = class _Controller {
|
|
|
3501
3512
|
}
|
|
3502
3513
|
/**
|
|
3503
3514
|
* Property reads inside of this function will bypass any custom getter you
|
|
3504
|
-
* may have, and read the value directly from what's stored in Stencil.
|
|
3515
|
+
* may have, and read the value directly from what's stored in Stencil/Lit.
|
|
3505
3516
|
*
|
|
3506
3517
|
* This also bypasses reactiveUtils integration - reading a property inside of
|
|
3507
3518
|
* bypassGetter won't make that property tracked.
|
|
@@ -3540,28 +3551,30 @@ var _Controller = class _Controller {
|
|
|
3540
3551
|
genericGetSet(property, getSet) {
|
|
3541
3552
|
var _a2, _b;
|
|
3542
3553
|
const genericGetSet = getSet;
|
|
3554
|
+
const internals = this.component.manager.internals;
|
|
3543
3555
|
if (genericGetSet.get !== void 0) {
|
|
3544
|
-
(_a2 =
|
|
3545
|
-
|
|
3556
|
+
(_a2 = internals.getters)[property] ?? (_a2[property] = []);
|
|
3557
|
+
internals.getters[property].unshift(genericGetSet.get);
|
|
3546
3558
|
}
|
|
3547
3559
|
if (genericGetSet.set !== void 0) {
|
|
3548
|
-
(_b =
|
|
3549
|
-
|
|
3560
|
+
(_b = internals.setters)[property] ?? (_b[property] = []);
|
|
3561
|
+
internals.setters[property].unshift(genericGetSet.set);
|
|
3550
3562
|
}
|
|
3551
3563
|
}
|
|
3552
3564
|
// FEATURE: improve typings
|
|
3553
3565
|
/**
|
|
3554
|
-
* Dynamically set a watcher for any
|
|
3566
|
+
* Dynamically set a watcher for any reactive property
|
|
3555
3567
|
*/
|
|
3556
3568
|
watch(property, callback) {
|
|
3557
3569
|
var _a2;
|
|
3558
3570
|
const type = getMemberType(this.component, property);
|
|
3559
3571
|
if (type === void 0)
|
|
3560
3572
|
throw new Error(
|
|
3561
|
-
`Trying to watch a non-@
|
|
3573
|
+
`Trying to watch a non-@property, non-@state property "${property}". Either convert it into a @state() or use get/set syntax`
|
|
3562
3574
|
);
|
|
3563
|
-
|
|
3564
|
-
|
|
3575
|
+
const internals = this.component.manager.internals;
|
|
3576
|
+
(_a2 = internals.allWatchers)[property] ?? (_a2[property] = []);
|
|
3577
|
+
const watchers = internals.allWatchers[property];
|
|
3565
3578
|
const genericCallback = callback;
|
|
3566
3579
|
const safeCallback = (newValue, oldValue, propertyName) => safeCall(() => genericCallback(newValue, oldValue, propertyName));
|
|
3567
3580
|
watchers.push(safeCallback);
|
|
@@ -3584,12 +3597,6 @@ var _Controller = class _Controller {
|
|
|
3584
3597
|
onLoaded(callback) {
|
|
3585
3598
|
this._callbacks.hostLoaded.push(callback);
|
|
3586
3599
|
}
|
|
3587
|
-
onRender(callback) {
|
|
3588
|
-
this._callbacks.hostRender.push(callback);
|
|
3589
|
-
}
|
|
3590
|
-
onRendered(callback) {
|
|
3591
|
-
this._callbacks.hostRendered.push(callback);
|
|
3592
|
-
}
|
|
3593
3600
|
onUpdate(callback) {
|
|
3594
3601
|
this._callbacks.hostUpdate.push(callback);
|
|
3595
3602
|
}
|
|
@@ -3630,16 +3637,8 @@ var _Controller = class _Controller {
|
|
|
3630
3637
|
this._callbacks.hostLoaded.forEach(safeCall);
|
|
3631
3638
|
this.didLoadCalled = true;
|
|
3632
3639
|
}
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
await Promise.allSettled(this._callbacks.hostRender.map(safeAsyncCall));
|
|
3636
|
-
}
|
|
3637
|
-
triggerRendered() {
|
|
3638
|
-
this._callbacks.hostRendered.forEach(safeCall);
|
|
3639
|
-
}
|
|
3640
|
-
async triggerUpdate() {
|
|
3641
|
-
if (this._callbacks.hostUpdate.length > 0)
|
|
3642
|
-
await Promise.allSettled(this._callbacks.hostUpdate.map(safeAsyncCall));
|
|
3640
|
+
triggerUpdate() {
|
|
3641
|
+
this._callbacks.hostUpdate.forEach(safeCall);
|
|
3643
3642
|
}
|
|
3644
3643
|
triggerUpdated() {
|
|
3645
3644
|
this._callbacks.hostUpdated.forEach(safeCall);
|
|
@@ -3651,6 +3650,7 @@ var _Controller = class _Controller {
|
|
|
3651
3650
|
this._callbacks.hostLifecycle.forEach((callback) => this._callLifecycle(callback));
|
|
3652
3651
|
}
|
|
3653
3652
|
_callLifecycle(callback) {
|
|
3653
|
+
_Controller.internals.setAmbientComponent(this.component);
|
|
3654
3654
|
const cleanupRaw = safeCall(callback);
|
|
3655
3655
|
const cleanup = Array.isArray(cleanupRaw) ? cleanupRaw : [cleanupRaw];
|
|
3656
3656
|
cleanup.forEach((cleanup2) => {
|
|
@@ -3676,12 +3676,6 @@ var GenericController = class extends Controller {
|
|
|
3676
3676
|
callback
|
|
3677
3677
|
);
|
|
3678
3678
|
}
|
|
3679
|
-
/**
|
|
3680
|
-
* Silence "Property 'dynamicGetSet' in type
|
|
3681
|
-
* 'GenericController<Exports, Requires>' is not assignable to the same
|
|
3682
|
-
* property in base type 'Controller<Exports>'", as TypeScript is being overly
|
|
3683
|
-
* conservative here with what it allows
|
|
3684
|
-
*/
|
|
3685
3679
|
dynamicGetSet(property, getSet) {
|
|
3686
3680
|
super.genericGetSet(property, getSet);
|
|
3687
3681
|
}
|
|
@@ -3689,9 +3683,9 @@ var GenericController = class extends Controller {
|
|
|
3689
3683
|
function makeProvisionalValue(base) {
|
|
3690
3684
|
if (typeof base !== "object" && typeof base !== "function" || base === null)
|
|
3691
3685
|
return base;
|
|
3692
|
-
const
|
|
3686
|
+
const proxy2 = new Proxy(base, {
|
|
3693
3687
|
get(target, prop, receiver) {
|
|
3694
|
-
if (cyclical.has(prop) && prop in target && target[prop] ===
|
|
3688
|
+
if (cyclical.has(prop) && prop in target && target[prop] === proxy2)
|
|
3695
3689
|
return void 0;
|
|
3696
3690
|
if (prop in target || prop in Promise.prototype || typeof prop === "symbol")
|
|
3697
3691
|
return typeof target === "function" ? target[prop] : Reflect.get(target, prop, receiver);
|
|
@@ -3703,16 +3697,10 @@ function makeProvisionalValue(base) {
|
|
|
3703
3697
|
return Reflect.set(target, prop, newValue, receiver);
|
|
3704
3698
|
}
|
|
3705
3699
|
});
|
|
3706
|
-
return
|
|
3700
|
+
return proxy2;
|
|
3707
3701
|
}
|
|
3708
3702
|
var cyclical = /* @__PURE__ */ new Set(["exports", "_exports"]);
|
|
3709
|
-
var accessBeforeLoad =
|
|
3710
|
-
"This might be the case if you are trying to access an async controller in ",
|
|
3711
|
-
"connectedCallback(). Or, if you are using it inside of ",
|
|
3712
|
-
"componentWillLoad()/another controller without controller.use. Example correct ",
|
|
3713
|
-
"usage:\n",
|
|
3714
|
-
"makeController(async (component, controller)=>{ await controller.use(someOtherController); });"
|
|
3715
|
-
].join("");
|
|
3703
|
+
var accessBeforeLoad = "" ;
|
|
3716
3704
|
function toControllerHost(component) {
|
|
3717
3705
|
if ("addController" in component)
|
|
3718
3706
|
return component;
|
|
@@ -3722,6 +3710,82 @@ function toControllerHost(component) {
|
|
|
3722
3710
|
);
|
|
3723
3711
|
}
|
|
3724
3712
|
|
|
3713
|
+
// src/proxyExports.ts
|
|
3714
|
+
var proxyExports = (Class) => (...args) => {
|
|
3715
|
+
const ambientControllers = Controller.internals.retrieveParentControllers();
|
|
3716
|
+
const instance = new Class(...args);
|
|
3717
|
+
const initialExports = instance.exports;
|
|
3718
|
+
Controller.internals.setParentController(ambientControllers.at(-1));
|
|
3719
|
+
const internals = instance.component.manager.internals;
|
|
3720
|
+
internals.markExports(instance, initialExports);
|
|
3721
|
+
instance.watchExports((exports) => internals.markExports(instance, exports));
|
|
3722
|
+
Controller.internals.setAmbientChildController(instance);
|
|
3723
|
+
const hostCandidates = [instance.component, ...ambientControllers].reverse();
|
|
3724
|
+
return internals.trackKey(
|
|
3725
|
+
hostCandidates,
|
|
3726
|
+
(resolution) => resolution === void 0 ? void 0 : setProxy(instance, resolution.host, resolution.key, initialExports),
|
|
3727
|
+
initialExports
|
|
3728
|
+
);
|
|
3729
|
+
};
|
|
3730
|
+
function setProxy(controller, host, key, initialExports) {
|
|
3731
|
+
const genericHost = host;
|
|
3732
|
+
const controllerValueChanged = genericHost[key] !== controller.exports;
|
|
3733
|
+
const hostValueChanged = genericHost[key] !== initialExports;
|
|
3734
|
+
const controllerUpdatedExports = initialExports !== controller.exports;
|
|
3735
|
+
if (controllerValueChanged && !hostValueChanged && controllerUpdatedExports)
|
|
3736
|
+
genericHost[key] = controller.exports;
|
|
3737
|
+
controller.watchExports(() => {
|
|
3738
|
+
if (genericHost[key] === controller.exports)
|
|
3739
|
+
return;
|
|
3740
|
+
const manager = controller.component.manager;
|
|
3741
|
+
const isReadOnly = manager.internals.readonlyProps?.has(key) === true;
|
|
3742
|
+
if (isReadOnly)
|
|
3743
|
+
manager.bypassReadonly(() => {
|
|
3744
|
+
genericHost[key] = controller.exports;
|
|
3745
|
+
});
|
|
3746
|
+
else
|
|
3747
|
+
genericHost[key] = controller.exports;
|
|
3748
|
+
});
|
|
3749
|
+
}
|
|
3750
|
+
|
|
3751
|
+
// src/functional.ts
|
|
3752
|
+
var makeController = (constructor) => proxy(void 0, constructor);
|
|
3753
|
+
var FunctionalController = class extends Controller {
|
|
3754
|
+
constructor(component, constructor) {
|
|
3755
|
+
super(component);
|
|
3756
|
+
const originalExports = this.exports;
|
|
3757
|
+
try {
|
|
3758
|
+
Controller.internals.setAmbientComponent(this.component);
|
|
3759
|
+
const value = constructor(this.component, this);
|
|
3760
|
+
const constructorChangedExports = this.exports !== originalExports;
|
|
3761
|
+
if (value instanceof Promise) {
|
|
3762
|
+
if (!constructorChangedExports)
|
|
3763
|
+
this.setProvisionalExports(value);
|
|
3764
|
+
const resolved = value.then((result) => {
|
|
3765
|
+
this.exports = result;
|
|
3766
|
+
super.catchUpLifecycle();
|
|
3767
|
+
}).catch((error) => {
|
|
3768
|
+
this._ready.reject(error);
|
|
3769
|
+
console.error(error);
|
|
3770
|
+
});
|
|
3771
|
+
this.onLoad(async () => await resolved);
|
|
3772
|
+
} else {
|
|
3773
|
+
if (!constructorChangedExports || value !== void 0)
|
|
3774
|
+
this.exports = value;
|
|
3775
|
+
queueMicrotask(() => super.catchUpLifecycle());
|
|
3776
|
+
}
|
|
3777
|
+
} catch (error) {
|
|
3778
|
+
this._ready.reject(error);
|
|
3779
|
+
console.error(error);
|
|
3780
|
+
}
|
|
3781
|
+
}
|
|
3782
|
+
/** Noop - will be called in the constructor instead */
|
|
3783
|
+
catchUpLifecycle() {
|
|
3784
|
+
return;
|
|
3785
|
+
}
|
|
3786
|
+
};
|
|
3787
|
+
var proxy = proxyExports(FunctionalController);
|
|
3788
|
+
|
|
3725
3789
|
// src/trackPropertyKey.ts
|
|
3726
3790
|
function trackPropertyKey(object, onResolved, defaultValue) {
|
|
3727
3791
|
const keys = Object.keys(object);
|
|
@@ -3812,16 +3876,14 @@ var ComponentInternals = class {
|
|
|
3812
3876
|
}, defaultValue);
|
|
3813
3877
|
return defaultValue;
|
|
3814
3878
|
};
|
|
3815
|
-
this.trackPropKey = (onResolved, defaultValue
|
|
3879
|
+
this.trackPropKey = (onResolved, defaultValue) => {
|
|
3816
3880
|
if (this._trackedValue !== nothing && this._trackedValue !== defaultValue)
|
|
3817
3881
|
this._firePropertyTrackers(void 0, void 0, void 0);
|
|
3818
3882
|
if (this._keyTrackers.length === 0)
|
|
3819
3883
|
queueMicrotask(() => this._firePropertyTrackers(void 0, void 0, void 0));
|
|
3820
3884
|
this._trackedValue = defaultValue;
|
|
3821
3885
|
this._keyTrackers.push(
|
|
3822
|
-
(key, value, previousValue) => safeCall(
|
|
3823
|
-
() => onResolved(defaultValue === value || ignoreDefaultValueMismatch ? key : void 0, previousValue)
|
|
3824
|
-
)
|
|
3886
|
+
(key, value, previousValue) => safeCall(() => onResolved(defaultValue === value ? key : void 0, previousValue))
|
|
3825
3887
|
);
|
|
3826
3888
|
return defaultValue;
|
|
3827
3889
|
};
|
|
@@ -3855,9 +3917,12 @@ var ComponentInternals = class {
|
|
|
3855
3917
|
* to apply the changes to the prototype
|
|
3856
3918
|
*/
|
|
3857
3919
|
getSetProxy(property, hasGetter, hasSetter) {
|
|
3858
|
-
const
|
|
3920
|
+
const component = this.component;
|
|
3921
|
+
const classPrototype = component.constructor.prototype;
|
|
3859
3922
|
this._getSetProxy(classPrototype, property, hasGetter, hasSetter, "class");
|
|
3860
|
-
|
|
3923
|
+
if (component.manager.isLit)
|
|
3924
|
+
return;
|
|
3925
|
+
const htmlPrototype = component.el.constructor.prototype;
|
|
3861
3926
|
if (classPrototype !== htmlPrototype)
|
|
3862
3927
|
this._getSetProxy(htmlPrototype, property, hasGetter, hasSetter, "html");
|
|
3863
3928
|
}
|
|
@@ -3869,7 +3934,7 @@ var ComponentInternals = class {
|
|
|
3869
3934
|
if (descriptor?.set === void 0 || descriptor.get === void 0)
|
|
3870
3935
|
if (descriptor !== void 0 && "value" in descriptor)
|
|
3871
3936
|
throw new Error(
|
|
3872
|
-
`getSet() should only be used on
|
|
3937
|
+
`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}`
|
|
3873
3938
|
);
|
|
3874
3939
|
else if (tolerateNotFound)
|
|
3875
3940
|
return;
|
|
@@ -3896,12 +3961,12 @@ var ComponentInternals = class {
|
|
|
3896
3961
|
} : originalGet;
|
|
3897
3962
|
const finalSetter = shouldOverwriteSet ? function setter(rawNewValue) {
|
|
3898
3963
|
const oldValue = originalGet.call(this);
|
|
3899
|
-
let newValue = parsePropertyValue(rawNewValue, propType);
|
|
3900
3964
|
const component2 = Controller.internals.elementToInstance.get(this);
|
|
3901
3965
|
if (component2 === void 0) {
|
|
3902
3966
|
originalSet.call(this, rawNewValue);
|
|
3903
3967
|
return;
|
|
3904
3968
|
}
|
|
3969
|
+
let newValue = component2.manager.isLit ? rawNewValue : parsePropertyValue(rawNewValue, propType);
|
|
3905
3970
|
const internals = component2.manager.internals;
|
|
3906
3971
|
if (newValue === oldValue)
|
|
3907
3972
|
originalSet.call(this, rawNewValue);
|
|
@@ -3945,59 +4010,30 @@ var ComponentInternals = class {
|
|
|
3945
4010
|
var emptyArray = [];
|
|
3946
4011
|
var customAccessor = Symbol("controllersCustomAccessor");
|
|
3947
4012
|
var nothing = Symbol("nothing");
|
|
3948
|
-
var accessorPromise = Promise.all([importCoreAccessor(), importCoreAccessorSupportDecorators()]);
|
|
3949
|
-
function reactiveUtilsIntegration(component) {
|
|
3950
|
-
const members = getPropLikeMembers(component);
|
|
3951
|
-
const internals = component.manager.internals;
|
|
3952
|
-
members.forEach((name) => {
|
|
3953
|
-
internals.accessorGetter[name] = defaultGetterSetter;
|
|
3954
|
-
internals.accessorSetter[name] = defaultGetterSetter;
|
|
3955
|
-
internals.getSetProxy(name, true, true);
|
|
3956
|
-
});
|
|
3957
|
-
return async (enabledMembers = members) => {
|
|
3958
|
-
const [Accessor, { subclass, property }] = await accessorPromise;
|
|
3959
|
-
class AccessorSubclass extends Accessor {
|
|
3960
|
-
}
|
|
3961
|
-
const getter = (_value, propertyName) => accessor[propertyName];
|
|
3962
|
-
function setter(newValue, _oldValue, propertyName) {
|
|
3963
|
-
if (accessor !== void 0)
|
|
3964
|
-
accessor[propertyName] = newValue;
|
|
3965
|
-
return newValue;
|
|
3966
|
-
}
|
|
3967
|
-
component.manager.bypassGetter(
|
|
3968
|
-
() => enabledMembers.forEach((name) => {
|
|
3969
|
-
internals.accessorGetter[name] = getter;
|
|
3970
|
-
internals.accessorSetter[name] = setter;
|
|
3971
|
-
property({
|
|
3972
|
-
value: component[name]
|
|
3973
|
-
})(AccessorSubclass.prototype, name);
|
|
3974
|
-
})
|
|
3975
|
-
);
|
|
3976
|
-
const Subclass = subclass(component.el.tagName)(AccessorSubclass);
|
|
3977
|
-
const accessor = new Subclass();
|
|
3978
|
-
};
|
|
3979
|
-
}
|
|
3980
|
-
var defaultGetterSetter = (value) => value;
|
|
3981
4013
|
|
|
3982
4014
|
// src/ControllerManager.ts
|
|
3983
|
-
var useControllerManager = (component) => new ControllerManager(component);
|
|
4015
|
+
var useControllerManager = (component, forceUpdate) => new ControllerManager(component, forceUpdate);
|
|
3984
4016
|
var ControllerManager = class extends GenericController {
|
|
3985
|
-
constructor(component) {
|
|
4017
|
+
constructor(component, forceUpdate) {
|
|
4018
|
+
const isLit = "addController" in component;
|
|
3986
4019
|
const controllers = /* @__PURE__ */ new Set();
|
|
3987
|
-
|
|
3988
|
-
|
|
3989
|
-
|
|
3990
|
-
|
|
3991
|
-
|
|
3992
|
-
|
|
3993
|
-
|
|
3994
|
-
|
|
3995
|
-
|
|
3996
|
-
|
|
4020
|
+
function addController(controller) {
|
|
4021
|
+
controllers.add(controller);
|
|
4022
|
+
if (isLit && !(controllerSymbol in controller) && component.el.isConnected)
|
|
4023
|
+
controller.hostConnected?.();
|
|
4024
|
+
}
|
|
4025
|
+
const removeController = (controller) => void controllers.delete(controller);
|
|
4026
|
+
if (!isLit) {
|
|
4027
|
+
const update = forceUpdate ?? component.constructor.__forceUpdate;
|
|
4028
|
+
const controllerHost = {
|
|
4029
|
+
addController,
|
|
4030
|
+
removeController,
|
|
4031
|
+
requestUpdate: () => update(component)
|
|
4032
|
+
};
|
|
4033
|
+
extendObject(component, controllerHost);
|
|
4034
|
+
}
|
|
3997
4035
|
super(component);
|
|
3998
|
-
this._connected = new Deferred();
|
|
3999
4036
|
this.internals = new ComponentInternals(this.component);
|
|
4000
|
-
this.connected = this._connected.promise;
|
|
4001
4037
|
this.destroyed = false;
|
|
4002
4038
|
this._updatePromise = new Deferred();
|
|
4003
4039
|
this._originalLifecycles = {};
|
|
@@ -4044,14 +4080,25 @@ var ControllerManager = class extends GenericController {
|
|
|
4044
4080
|
* \@Prop() decorator or not
|
|
4045
4081
|
*/
|
|
4046
4082
|
this.trackKey = this.internals.trackKey;
|
|
4047
|
-
this._readonlySetter = (newValue,
|
|
4083
|
+
this._readonlySetter = (newValue, oldValue, property) => {
|
|
4048
4084
|
if (Controller.internals.shouldBypassReadonly)
|
|
4049
4085
|
return newValue;
|
|
4050
|
-
const
|
|
4051
|
-
|
|
4052
|
-
|
|
4086
|
+
const component = this.component;
|
|
4087
|
+
const isProp = getPropType(component, property) === "prop";
|
|
4088
|
+
if (isProp) {
|
|
4089
|
+
if (this.isLit) {
|
|
4090
|
+
const details = getLitProperties(component).get(property);
|
|
4091
|
+
if (details && details?.attribute !== false)
|
|
4092
|
+
component.el.setAttribute(
|
|
4093
|
+
typeof details.attribute === "string" ? details.attribute : camelToKebab(property),
|
|
4094
|
+
// Not using converter.toAttribute to keep this unlikely case simpler
|
|
4095
|
+
String(oldValue)
|
|
4096
|
+
);
|
|
4097
|
+
} else
|
|
4098
|
+
component.requestUpdate();
|
|
4099
|
+
}
|
|
4053
4100
|
throw new Error(
|
|
4054
|
-
`Cannot assign to read-only property "${property}" of ${
|
|
4101
|
+
`Cannot assign to read-only property "${property}" of ${component.el.tagName.toLowerCase()}. Trying to assign "${String(
|
|
4055
4102
|
newValue
|
|
4056
4103
|
)}"`
|
|
4057
4104
|
);
|
|
@@ -4064,18 +4111,30 @@ var ControllerManager = class extends GenericController {
|
|
|
4064
4111
|
*/
|
|
4065
4112
|
this.devOnlySetPersistentControllerData = void 0 ;
|
|
4066
4113
|
this.devOnlyGetPersistentControllerData = void 0 ;
|
|
4114
|
+
if (isLit) {
|
|
4115
|
+
component.addController = addController;
|
|
4116
|
+
component.removeController = removeController;
|
|
4117
|
+
}
|
|
4118
|
+
this.isLit = isLit;
|
|
4067
4119
|
this.component.manager = this;
|
|
4068
|
-
|
|
4120
|
+
retrieveComponentMembers(component, isLit);
|
|
4069
4121
|
this._controllers = controllers;
|
|
4070
4122
|
this.exports = void 0;
|
|
4071
4123
|
this.hasDestroy = "autoDestroyDisabled" in this.component && typeof this.component.destroy === "function";
|
|
4072
4124
|
if (this.hasDestroy)
|
|
4073
4125
|
this.watch("autoDestroyDisabled", () => this._autoDestroyDisabledWatcher());
|
|
4074
4126
|
this._bindLifecycleMethods();
|
|
4075
|
-
|
|
4076
|
-
|
|
4127
|
+
if (!isLit)
|
|
4128
|
+
Object.defineProperty(component, "updateComplete", {
|
|
4129
|
+
get: async () => await this._updatePromise.promise
|
|
4130
|
+
});
|
|
4131
|
+
const members = getPropLikeMembers(component);
|
|
4132
|
+
const internals = component.manager.internals;
|
|
4133
|
+
members.forEach((name) => {
|
|
4134
|
+
internals.accessorGetter[name] = defaultGetterSetter;
|
|
4135
|
+
internals.accessorSetter[name] = defaultGetterSetter;
|
|
4136
|
+
internals.getSetProxy(name, true, true);
|
|
4077
4137
|
});
|
|
4078
|
-
this.internals.reactiveUtilsIntegration = reactiveUtilsIntegration(this.component);
|
|
4079
4138
|
Controller.internals.setParentController(void 0);
|
|
4080
4139
|
Controller.internals.setAmbientComponent(component);
|
|
4081
4140
|
Controller.internals.elementToInstance.set(component.el, component);
|
|
@@ -4083,25 +4142,25 @@ var ControllerManager = class extends GenericController {
|
|
|
4083
4142
|
}
|
|
4084
4143
|
_bindLifecycleMethods() {
|
|
4085
4144
|
const component = this.component;
|
|
4145
|
+
const isLit = this.isLit;
|
|
4086
4146
|
this._originalLifecycles = {
|
|
4087
|
-
|
|
4088
|
-
|
|
4089
|
-
|
|
4090
|
-
|
|
4091
|
-
|
|
4092
|
-
|
|
4093
|
-
|
|
4094
|
-
componentDidUpdate: component.componentDidUpdate,
|
|
4147
|
+
// These callbacks will be called by Lit, so we don't have to
|
|
4148
|
+
connectedCallback: isLit ? void 0 : component.connectedCallback,
|
|
4149
|
+
disconnectedCallback: isLit ? void 0 : component.disconnectedCallback,
|
|
4150
|
+
componentWillLoad: isLit ? void 0 : component.componentWillLoad,
|
|
4151
|
+
componentDidLoad: isLit ? void 0 : component.componentDidLoad,
|
|
4152
|
+
componentWillUpdate: isLit ? void 0 : component.componentWillUpdate,
|
|
4153
|
+
componentDidUpdate: isLit ? void 0 : component.componentDidUpdate,
|
|
4095
4154
|
destroy: component.destroy
|
|
4096
4155
|
};
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4156
|
+
if (!isLit) {
|
|
4157
|
+
component.connectedCallback = this.hostConnected.bind(this);
|
|
4158
|
+
component.disconnectedCallback = this.hostDisconnected.bind(this);
|
|
4159
|
+
component.componentWillLoad = this.hostLoad.bind(this);
|
|
4160
|
+
component.componentDidLoad = this.hostLoaded.bind(this);
|
|
4161
|
+
component.componentWillUpdate = this.hostUpdate.bind(this);
|
|
4162
|
+
component.componentDidUpdate = this.hostUpdated.bind(this);
|
|
4163
|
+
}
|
|
4105
4164
|
if (this.hasDestroy)
|
|
4106
4165
|
component.destroy = this.destroy.bind(this);
|
|
4107
4166
|
}
|
|
@@ -4118,7 +4177,7 @@ var ControllerManager = class extends GenericController {
|
|
|
4118
4177
|
* Instead, _bindLifecycleMethods will take care of that. Otherwise, you risk
|
|
4119
4178
|
* calling lifecycle methods twice.
|
|
4120
4179
|
*/
|
|
4121
|
-
|
|
4180
|
+
hostConnected() {
|
|
4122
4181
|
if (this.destroyed) {
|
|
4123
4182
|
const tagName = this.component.el.tagName.toLowerCase();
|
|
4124
4183
|
this.component.el.remove();
|
|
@@ -4130,13 +4189,12 @@ var ControllerManager = class extends GenericController {
|
|
|
4130
4189
|
clearTimeout(this._autoDestroyTimeout);
|
|
4131
4190
|
this.internals.enabledWatchers = this.internals.allWatchers;
|
|
4132
4191
|
keyTrackResolve();
|
|
4133
|
-
this._connected.resolve();
|
|
4134
4192
|
this._controllers.forEach(
|
|
4135
4193
|
(controller) => "triggerConnected" in controller ? controller.triggerConnected() : safeCall(() => controller.hostConnected?.())
|
|
4136
4194
|
);
|
|
4137
4195
|
this._originalLifecycles.connectedCallback?.call(this.component);
|
|
4138
4196
|
}
|
|
4139
|
-
|
|
4197
|
+
hostDisconnected() {
|
|
4140
4198
|
if (this.destroyed)
|
|
4141
4199
|
return;
|
|
4142
4200
|
this._controllers.forEach(
|
|
@@ -4146,8 +4204,10 @@ var ControllerManager = class extends GenericController {
|
|
|
4146
4204
|
if (this.hasDestroy)
|
|
4147
4205
|
this._autoDestroyDisabledWatcher();
|
|
4148
4206
|
}
|
|
4149
|
-
async
|
|
4150
|
-
|
|
4207
|
+
// REFACTOR: don't force async if there are no async load controllers?
|
|
4208
|
+
async hostLoad() {
|
|
4209
|
+
if (typeof this.internals.reactiveUtilsIntegration === "function")
|
|
4210
|
+
await this.internals.reactiveUtilsIntegration();
|
|
4151
4211
|
await Promise.allSettled(
|
|
4152
4212
|
Array.from(
|
|
4153
4213
|
this._controllers,
|
|
@@ -4156,44 +4216,28 @@ var ControllerManager = class extends GenericController {
|
|
|
4156
4216
|
);
|
|
4157
4217
|
await this._originalLifecycles.componentWillLoad?.call(this.component);
|
|
4158
4218
|
}
|
|
4159
|
-
|
|
4219
|
+
hostLoaded() {
|
|
4160
4220
|
this._controllers.forEach(
|
|
4161
4221
|
(controller) => "triggerLoaded" in controller ? controller.triggerLoaded() : safeCall(() => controller.hostLoaded?.())
|
|
4162
4222
|
);
|
|
4163
4223
|
this._originalLifecycles.componentDidLoad?.call(this.component);
|
|
4164
4224
|
}
|
|
4165
|
-
|
|
4166
|
-
await Promise.allSettled(
|
|
4167
|
-
Array.from(
|
|
4168
|
-
this._controllers,
|
|
4169
|
-
async (controller) => "triggerRender" in controller ? await controller.triggerRender() : await safeAsyncCall(async () => await controller.hostRender?.())
|
|
4170
|
-
)
|
|
4171
|
-
);
|
|
4172
|
-
await this._originalLifecycles.componentWillRender?.call(this.component);
|
|
4173
|
-
}
|
|
4174
|
-
_componentDidRender() {
|
|
4225
|
+
hostUpdate() {
|
|
4175
4226
|
this._controllers.forEach(
|
|
4176
|
-
(controller) => "
|
|
4227
|
+
(controller) => "triggerUpdate" in controller ? controller.triggerUpdate() : safeCall(() => controller.hostUpdate?.())
|
|
4177
4228
|
);
|
|
4178
|
-
this._originalLifecycles.
|
|
4229
|
+
void this._originalLifecycles.componentWillUpdate?.call(this.component);
|
|
4179
4230
|
}
|
|
4180
|
-
|
|
4181
|
-
await Promise.allSettled(
|
|
4182
|
-
Array.from(
|
|
4183
|
-
this._controllers,
|
|
4184
|
-
async (controller) => "triggerUpdate" in controller ? await controller.triggerUpdate() : await safeAsyncCall(async () => await controller.hostUpdate?.())
|
|
4185
|
-
)
|
|
4186
|
-
);
|
|
4187
|
-
await this._originalLifecycles.componentWillUpdate?.call(this.component);
|
|
4188
|
-
}
|
|
4189
|
-
_componentDidUpdate() {
|
|
4231
|
+
hostUpdated() {
|
|
4190
4232
|
this._controllers.forEach(
|
|
4191
4233
|
(controller) => "triggerUpdated" in controller ? controller.triggerUpdated() : safeCall(() => controller.hostUpdated?.())
|
|
4192
4234
|
);
|
|
4193
4235
|
this._originalLifecycles.componentDidUpdate?.call(this.component);
|
|
4194
|
-
|
|
4195
|
-
|
|
4196
|
-
|
|
4236
|
+
if (!this.isLit) {
|
|
4237
|
+
const updatePromise = this._updatePromise;
|
|
4238
|
+
this._updatePromise = new Deferred();
|
|
4239
|
+
updatePromise.resolve(true);
|
|
4240
|
+
}
|
|
4197
4241
|
}
|
|
4198
4242
|
async destroy() {
|
|
4199
4243
|
this.ensureHasDestroy();
|
|
@@ -4212,6 +4256,7 @@ var ControllerManager = class extends GenericController {
|
|
|
4212
4256
|
this._controllers.forEach(
|
|
4213
4257
|
(controller) => "triggerDestroy" in controller ? controller.triggerDestroy() : safeCall(() => controller.hostDestroy?.())
|
|
4214
4258
|
);
|
|
4259
|
+
this._controllers.clear();
|
|
4215
4260
|
await this._originalLifecycles.destroy?.call(this.component);
|
|
4216
4261
|
}
|
|
4217
4262
|
_autoDestroyDisabledWatcher() {
|
|
@@ -4222,6 +4267,7 @@ var ControllerManager = class extends GenericController {
|
|
|
4222
4267
|
this._autoDestroyTimeout = setTimeout(destroy, autoDestroyOnDisconnectTimeout);
|
|
4223
4268
|
}
|
|
4224
4269
|
}
|
|
4270
|
+
// REFACTOR: replace this with a readonly:true option in @property()
|
|
4225
4271
|
/**
|
|
4226
4272
|
* Make a @Prop() or @State() readonly (prevent overwriting default value).
|
|
4227
4273
|
*
|
|
@@ -4241,6 +4287,7 @@ var ControllerManager = class extends GenericController {
|
|
|
4241
4287
|
readonly(value) {
|
|
4242
4288
|
return this.getSet(value, { set: this._readonlySetter });
|
|
4243
4289
|
}
|
|
4290
|
+
// REFACTOR: remove this in Lit in favor of native get/set
|
|
4244
4291
|
/**
|
|
4245
4292
|
* Listen for any component's @State()/@Prop() change, and mutate it's
|
|
4246
4293
|
* value before it is set.
|
|
@@ -4267,13 +4314,13 @@ var ControllerManager = class extends GenericController {
|
|
|
4267
4314
|
*/
|
|
4268
4315
|
getSet(defaultValue, getSet) {
|
|
4269
4316
|
return this.component.manager.trackPropKey((name) => {
|
|
4270
|
-
var
|
|
4317
|
+
var _a;
|
|
4271
4318
|
if (name === void 0)
|
|
4272
4319
|
throw new Error(
|
|
4273
4320
|
"Unable to resolve get/set's prop name. Make sure you are using it like @Prop() someProp = this.manager.getSet(defaultValue,{get,set})"
|
|
4274
4321
|
);
|
|
4275
4322
|
if (getSet.set === this._readonlySetter) {
|
|
4276
|
-
(
|
|
4323
|
+
(_a = this.internals).readonlyProps ?? (_a.readonlyProps = /* @__PURE__ */ new Set());
|
|
4277
4324
|
this.internals.readonlyProps.add(name);
|
|
4278
4325
|
}
|
|
4279
4326
|
const genericComponent = this.component;
|
|
@@ -4294,87 +4341,12 @@ ${// Don't expose internal code in production, and keep bundle smaller:
|
|
|
4294
4341
|
`autoDestroyDisabled and destroy` }
|
|
4295
4342
|
`.trim();
|
|
4296
4343
|
var autoDestroyOnDisconnectTimeout = 1e3;
|
|
4344
|
+
var defaultGetterSetter = (value) => value;
|
|
4297
4345
|
|
|
4298
|
-
// src/
|
|
4299
|
-
var
|
|
4300
|
-
|
|
4301
|
-
|
|
4302
|
-
const initialExports = instance.exports;
|
|
4303
|
-
Controller.internals.setParentController(ambientControllers.at(-1));
|
|
4304
|
-
const internals = instance.component.manager.internals;
|
|
4305
|
-
internals.markExports(instance, initialExports);
|
|
4306
|
-
instance.watchExports((exports) => internals.markExports(instance, exports));
|
|
4307
|
-
Controller.internals.setAmbientChildController(instance);
|
|
4308
|
-
const hostCandidates = [instance.component, ...ambientControllers].reverse();
|
|
4309
|
-
return internals.trackKey(
|
|
4310
|
-
hostCandidates,
|
|
4311
|
-
(resolution) => resolution === void 0 ? void 0 : setProxy(instance, resolution.host, resolution.key, initialExports),
|
|
4312
|
-
initialExports
|
|
4313
|
-
);
|
|
4314
|
-
};
|
|
4315
|
-
function setProxy(controller, host, key, initialExports) {
|
|
4316
|
-
const genericHost = host;
|
|
4317
|
-
const controllerValueChanged = genericHost[key] !== controller.exports;
|
|
4318
|
-
const hostValueChanged = genericHost[key] !== initialExports;
|
|
4319
|
-
const controllerUpdatedExports = initialExports !== controller.exports;
|
|
4320
|
-
if (controllerValueChanged && !hostValueChanged && controllerUpdatedExports)
|
|
4321
|
-
genericHost[key] = controller.exports;
|
|
4322
|
-
controller.watchExports(() => {
|
|
4323
|
-
if (genericHost[key] === controller.exports)
|
|
4324
|
-
return;
|
|
4325
|
-
const manager = controller.component.manager;
|
|
4326
|
-
const isReadOnly = manager.internals.readonlyProps?.has(key) === true;
|
|
4327
|
-
if (isReadOnly)
|
|
4328
|
-
manager.bypassReadonly(() => {
|
|
4329
|
-
genericHost[key] = controller.exports;
|
|
4330
|
-
});
|
|
4331
|
-
else
|
|
4332
|
-
genericHost[key] = controller.exports;
|
|
4333
|
-
});
|
|
4334
|
-
}
|
|
4335
|
-
|
|
4336
|
-
// src/functional.ts
|
|
4337
|
-
var makeController = (constructor) => proxy(void 0, constructor);
|
|
4338
|
-
var FunctionalController = class extends Controller {
|
|
4339
|
-
constructor(component, constructor) {
|
|
4340
|
-
super(component);
|
|
4341
|
-
const originalExports = this.exports;
|
|
4342
|
-
try {
|
|
4343
|
-
Controller.internals.setAmbientComponent(this.component);
|
|
4344
|
-
const value = constructor(this.component, this);
|
|
4345
|
-
const constructorChangedExports = this.exports !== originalExports;
|
|
4346
|
-
if (value instanceof Promise) {
|
|
4347
|
-
if (!constructorChangedExports)
|
|
4348
|
-
this.setProvisionalExports(value);
|
|
4349
|
-
const resolved = value.then((result) => {
|
|
4350
|
-
this.exports = result;
|
|
4351
|
-
super.catchUpLifecycle();
|
|
4352
|
-
}).catch((error) => {
|
|
4353
|
-
this._ready.reject(error);
|
|
4354
|
-
console.error(error);
|
|
4355
|
-
});
|
|
4356
|
-
this.onLoad(async () => await resolved);
|
|
4357
|
-
} else {
|
|
4358
|
-
if (!constructorChangedExports || value !== void 0)
|
|
4359
|
-
this.exports = value;
|
|
4360
|
-
queueMicrotask(() => super.catchUpLifecycle());
|
|
4361
|
-
}
|
|
4362
|
-
} catch (error) {
|
|
4363
|
-
this._ready.reject(error);
|
|
4364
|
-
console.error(error);
|
|
4365
|
-
}
|
|
4366
|
-
}
|
|
4367
|
-
/** Noop - will be called in the constructor instead */
|
|
4368
|
-
catchUpLifecycle() {
|
|
4369
|
-
return;
|
|
4370
|
-
}
|
|
4371
|
-
};
|
|
4372
|
-
var proxy = proxyExports(FunctionalController);
|
|
4373
|
-
function useT9n({
|
|
4374
|
-
blocking = false,
|
|
4375
|
-
name
|
|
4376
|
-
} = {}) {
|
|
4377
|
-
return makeController((component, controller) => {
|
|
4346
|
+
// src/useT9n.ts
|
|
4347
|
+
var makeT9nController = (getAssetPath) => ({ blocking = false, name } = {}) => (
|
|
4348
|
+
// eslint-disable-next-line @typescript-eslint/promise-function-async
|
|
4349
|
+
makeController((component, controller) => {
|
|
4378
4350
|
controller.onLifecycle(
|
|
4379
4351
|
() => startLocaleObserver(
|
|
4380
4352
|
component.el,
|
|
@@ -4392,8 +4364,8 @@ function useT9n({
|
|
|
4392
4364
|
return controller.ready;
|
|
4393
4365
|
const locale = getElementLocales(component.el);
|
|
4394
4366
|
return { _lang: locale.lang, _t9nLocale: locale.t9nLocale };
|
|
4395
|
-
})
|
|
4396
|
-
|
|
4367
|
+
})
|
|
4368
|
+
);
|
|
4397
4369
|
|
|
4398
4370
|
function isMonacoEnvironmentSetup() {
|
|
4399
4371
|
return !!window.MonacoEnvironment?.getWorkerUrl;
|
|
@@ -4542,7 +4514,7 @@ async function getArcadeWorker(uri) {
|
|
|
4542
4514
|
* @returns arcade mode module
|
|
4543
4515
|
*/
|
|
4544
4516
|
async function getMode() {
|
|
4545
|
-
return await import('./arcade-mode-
|
|
4517
|
+
return await import('./arcade-mode-6bc35b9a.js');
|
|
4546
4518
|
}
|
|
4547
4519
|
// Register the language in Monaco
|
|
4548
4520
|
languages.register({
|
|
@@ -4565,6 +4537,8 @@ languages.onLanguage(arcadeDefaults.languageId, () => {
|
|
|
4565
4537
|
});
|
|
4566
4538
|
});
|
|
4567
4539
|
|
|
4540
|
+
const useT9n = makeT9nController(getAssetPath);
|
|
4541
|
+
|
|
4568
4542
|
const arcadeApiCss = ":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)}";
|
|
4569
4543
|
|
|
4570
4544
|
const ArcgisArcadeApi = class {
|
|
@@ -5547,11 +5521,11 @@ const ArcgisArcadeSuggestions = class {
|
|
|
5547
5521
|
// #region Component lifecycle events
|
|
5548
5522
|
async componentWillLoad() {
|
|
5549
5523
|
this._colorizeStyle = generateColorizeStyles();
|
|
5550
|
-
this.
|
|
5524
|
+
this._themeChangedListener = onColorizeThemeChanged(() => (this._colorizeStyle = generateColorizeStyles()));
|
|
5551
5525
|
}
|
|
5552
5526
|
disconnectedCallback() {
|
|
5553
5527
|
this._flowObserver?.disconnect();
|
|
5554
|
-
this.
|
|
5528
|
+
this._themeChangedListener?.dispose();
|
|
5555
5529
|
}
|
|
5556
5530
|
// #endregion
|
|
5557
5531
|
//#region Private Methods
|