@lwc/engine-core 6.2.0 → 6.2.1
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/framework/api.d.ts +9 -0
- package/dist/framework/base-lightning-element.d.ts +1 -1
- package/dist/framework/check-version-mismatch.d.ts +2 -0
- package/dist/framework/component.d.ts +2 -0
- package/dist/framework/decorators/api.d.ts +4 -1
- package/dist/framework/decorators/register.d.ts +2 -0
- package/dist/framework/decorators/track.d.ts +4 -1
- package/dist/framework/decorators/wire.d.ts +3 -1
- package/dist/framework/def.d.ts +2 -0
- package/dist/framework/get-component-constructor.d.ts +1 -0
- package/dist/framework/membrane.d.ts +1 -0
- package/dist/framework/modules/static-parts.d.ts +5 -8
- package/dist/framework/readonly.d.ts +1 -0
- package/dist/framework/reporting.d.ts +3 -4
- package/dist/framework/secure-template.d.ts +5 -0
- package/dist/framework/stylesheet.d.ts +5 -2
- package/dist/framework/vm.d.ts +34 -17
- package/dist/index.cjs.js +50 -22
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.js +50 -22
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -23,8 +23,7 @@ let enabled$1 = false;
|
|
|
23
23
|
const reportingControl = {
|
|
24
24
|
/**
|
|
25
25
|
* Attach a new reporting control (aka dispatcher).
|
|
26
|
-
*
|
|
27
|
-
* @param dispatcher - reporting control
|
|
26
|
+
* @param dispatcher reporting control
|
|
28
27
|
*/
|
|
29
28
|
attachDispatcher(dispatcher) {
|
|
30
29
|
enabled$1 = true;
|
|
@@ -67,7 +66,7 @@ function onReportingEnabled(callback) {
|
|
|
67
66
|
/**
|
|
68
67
|
* Report to the current dispatcher, if there is one.
|
|
69
68
|
* @param reportingEventId
|
|
70
|
-
* @param payload
|
|
69
|
+
* @param payload data to report
|
|
71
70
|
*/
|
|
72
71
|
function report(reportingEventId, payload) {
|
|
73
72
|
if (enabled$1) {
|
|
@@ -1430,6 +1429,7 @@ const reactiveMembrane = new ObservableMembrane({
|
|
|
1430
1429
|
* EXPERIMENTAL: This function implements an unwrap mechanism that
|
|
1431
1430
|
* works for observable membrane objects. This API is subject to
|
|
1432
1431
|
* change or being removed.
|
|
1432
|
+
* @param value
|
|
1433
1433
|
*/
|
|
1434
1434
|
function unwrap(value) {
|
|
1435
1435
|
// On the server side, we don't need mutation tracking. Skipping it improves performance.
|
|
@@ -1543,6 +1543,8 @@ function applyShadowMigrateMode(shadowRoot) {
|
|
|
1543
1543
|
* that a Custom Element can support (including AOM properties), which
|
|
1544
1544
|
* determines what kind of capabilities the Base Lightning Element should support. When producing the new descriptors
|
|
1545
1545
|
* for the Base Lightning Element, it also include the reactivity bit, so the standard property is reactive.
|
|
1546
|
+
* @param propName
|
|
1547
|
+
* @param descriptor
|
|
1546
1548
|
*/
|
|
1547
1549
|
function createBridgeToElementDescriptor(propName, descriptor) {
|
|
1548
1550
|
const { get, set, enumerable, configurable } = descriptor;
|
|
@@ -1592,7 +1594,7 @@ const refsCache = new WeakMap();
|
|
|
1592
1594
|
/**
|
|
1593
1595
|
* This class is the base class for any LWC element.
|
|
1594
1596
|
* Some elements directly extends this class, others implement it via inheritance.
|
|
1595
|
-
|
|
1597
|
+
*/
|
|
1596
1598
|
// @ts-ignore
|
|
1597
1599
|
const LightningElement = function () {
|
|
1598
1600
|
// This should be as performant as possible, while any initialization should be done lazily
|
|
@@ -2461,9 +2463,11 @@ function internalTrackDecorator(key) {
|
|
|
2461
2463
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
2462
2464
|
*/
|
|
2463
2465
|
/**
|
|
2464
|
-
* @wire decorator
|
|
2466
|
+
* The @wire decorator wires fields and methods to a wire adapter in
|
|
2465
2467
|
* LWC Components. This function implements the internals of this
|
|
2466
2468
|
* decorator.
|
|
2469
|
+
* @param _adapter
|
|
2470
|
+
* @param _config
|
|
2467
2471
|
*/
|
|
2468
2472
|
function wire(_adapter, _config) {
|
|
2469
2473
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -2574,6 +2578,8 @@ function validateMethodDecoratedWithApi(Ctor, methodName, descriptor) {
|
|
|
2574
2578
|
/**
|
|
2575
2579
|
* INTERNAL: This function can only be invoked by compiled code. The compiler
|
|
2576
2580
|
* will prevent this function from being imported by user-land code.
|
|
2581
|
+
* @param Ctor
|
|
2582
|
+
* @param meta
|
|
2577
2583
|
*/
|
|
2578
2584
|
function registerDecorators(Ctor, meta) {
|
|
2579
2585
|
const proto = Ctor.prototype;
|
|
@@ -2762,6 +2768,7 @@ function isTemplateRegistered(tpl) {
|
|
|
2762
2768
|
/**
|
|
2763
2769
|
* INTERNAL: This function can only be invoked by compiled code. The compiler
|
|
2764
2770
|
* will prevent this function from being imported by userland code.
|
|
2771
|
+
* @param tpl
|
|
2765
2772
|
*/
|
|
2766
2773
|
function registerTemplate(tpl) {
|
|
2767
2774
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -2775,6 +2782,10 @@ function registerTemplate(tpl) {
|
|
|
2775
2782
|
/**
|
|
2776
2783
|
* EXPERIMENTAL: This function acts like a hook for Lightning Locker Service and other similar
|
|
2777
2784
|
* libraries to sanitize vulnerable attributes.
|
|
2785
|
+
* @param tagName
|
|
2786
|
+
* @param namespaceUri
|
|
2787
|
+
* @param attrName
|
|
2788
|
+
* @param attrValue
|
|
2778
2789
|
*/
|
|
2779
2790
|
function sanitizeAttribute(tagName, namespaceUri, attrName, attrValue) {
|
|
2780
2791
|
// locker-service patches this function during runtime to sanitize vulnerable attributes. When
|
|
@@ -3360,6 +3371,7 @@ function createComponentDef(Ctor) {
|
|
|
3360
3371
|
/**
|
|
3361
3372
|
* EXPERIMENTAL: This function allows for the identification of LWC constructors. This API is
|
|
3362
3373
|
* subject to change or being removed.
|
|
3374
|
+
* @param ctor
|
|
3363
3375
|
*/
|
|
3364
3376
|
function isComponentConstructor(ctor) {
|
|
3365
3377
|
if (!isFunction$1(ctor)) {
|
|
@@ -3433,6 +3445,7 @@ const lightingElementDef = {
|
|
|
3433
3445
|
/**
|
|
3434
3446
|
* EXPERIMENTAL: This function allows for the collection of internal component metadata. This API is
|
|
3435
3447
|
* subject to change or being removed.
|
|
3448
|
+
* @param Ctor
|
|
3436
3449
|
*/
|
|
3437
3450
|
function getComponentDef(Ctor) {
|
|
3438
3451
|
const def = getComponentInternalDef(Ctor);
|
|
@@ -3629,6 +3642,8 @@ function getNearestShadowComponent(vm) {
|
|
|
3629
3642
|
* If the component that is currently being rendered uses scoped styles,
|
|
3630
3643
|
* this returns the unique token for that scoped stylesheet. Otherwise
|
|
3631
3644
|
* it returns null.
|
|
3645
|
+
* @param owner
|
|
3646
|
+
* @param legacy
|
|
3632
3647
|
*/
|
|
3633
3648
|
// TODO [#3733]: remove support for legacy scope tokens
|
|
3634
3649
|
function getScopeTokenClass(owner, legacy) {
|
|
@@ -3642,6 +3657,7 @@ function getScopeTokenClass(owner, legacy) {
|
|
|
3642
3657
|
* exists. Otherwise it returns null.
|
|
3643
3658
|
*
|
|
3644
3659
|
* A host style token is applied to the component if scoped styles are used.
|
|
3660
|
+
* @param vnode
|
|
3645
3661
|
*/
|
|
3646
3662
|
function getStylesheetTokenHost(vnode) {
|
|
3647
3663
|
const { template } = getComponentInternalDef(vnode.ctor);
|
|
@@ -4050,11 +4066,9 @@ function traverseAndSetElements(root, parts, renderer) {
|
|
|
4050
4066
|
}
|
|
4051
4067
|
/**
|
|
4052
4068
|
* Given an array of static parts, do all the mounting required for these parts.
|
|
4053
|
-
*
|
|
4054
|
-
* @param
|
|
4055
|
-
* @param
|
|
4056
|
-
* @param renderer - the renderer to use
|
|
4057
|
-
* @param mount - true this is a first (mount) render as opposed to a subsequent (patch) render
|
|
4069
|
+
* @param root the root element
|
|
4070
|
+
* @param vnode the parent VStatic
|
|
4071
|
+
* @param renderer the renderer to use
|
|
4058
4072
|
*/
|
|
4059
4073
|
function mountStaticParts(root, vnode, renderer) {
|
|
4060
4074
|
// On the server, we don't support ref (because it relies on renderedCallback), nor do we
|
|
@@ -4079,9 +4093,8 @@ function mountStaticParts(root, vnode, renderer) {
|
|
|
4079
4093
|
}
|
|
4080
4094
|
/**
|
|
4081
4095
|
* Mounts elements to the newly generated VStatic node
|
|
4082
|
-
*
|
|
4083
|
-
* @param
|
|
4084
|
-
* @param n2 - the current VStatic vnode
|
|
4096
|
+
* @param n1 the previous VStatic vnode
|
|
4097
|
+
* @param n2 the current VStatic vnode
|
|
4085
4098
|
*/
|
|
4086
4099
|
function patchStaticParts(n1, n2) {
|
|
4087
4100
|
// On the server, we don't support ref (because it relies on renderedCallback), nor do we
|
|
@@ -4596,6 +4609,7 @@ function allocateChildren(vnode, vm) {
|
|
|
4596
4609
|
* With the delimiters removed, the contents are marked dynamic so they are diffed correctly.
|
|
4597
4610
|
*
|
|
4598
4611
|
* This function is used for slotted VFragments to avoid the text delimiters interfering with slotting functionality.
|
|
4612
|
+
* @param children
|
|
4599
4613
|
*/
|
|
4600
4614
|
function flattenFragmentsInChildren(children) {
|
|
4601
4615
|
const flattenedChildren = [];
|
|
@@ -5209,6 +5223,7 @@ function i(iterable, factory) {
|
|
|
5209
5223
|
}
|
|
5210
5224
|
/**
|
|
5211
5225
|
* [f]lattening
|
|
5226
|
+
* @param items
|
|
5212
5227
|
*/
|
|
5213
5228
|
function f(items) {
|
|
5214
5229
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -5325,6 +5340,10 @@ function fid(url) {
|
|
|
5325
5340
|
* [ddc] - create a (deprecated) dynamic component via `<x-foo lwc:dynamic={Ctor}>`
|
|
5326
5341
|
*
|
|
5327
5342
|
* TODO [#3331]: remove usage of lwc:dynamic in 246
|
|
5343
|
+
* @param sel
|
|
5344
|
+
* @param Ctor
|
|
5345
|
+
* @param data
|
|
5346
|
+
* @param children
|
|
5328
5347
|
*/
|
|
5329
5348
|
function ddc(sel, Ctor, data, children = EmptyArray) {
|
|
5330
5349
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -5343,6 +5362,9 @@ function ddc(sel, Ctor, data, children = EmptyArray) {
|
|
|
5343
5362
|
}
|
|
5344
5363
|
/**
|
|
5345
5364
|
* [dc] - create a dynamic component via `<lwc:component lwc:is={Ctor}>`
|
|
5365
|
+
* @param Ctor
|
|
5366
|
+
* @param data
|
|
5367
|
+
* @param children
|
|
5346
5368
|
*/
|
|
5347
5369
|
function dc(Ctor, data, children = EmptyArray) {
|
|
5348
5370
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -5370,13 +5392,13 @@ function dc(Ctor, data, children = EmptyArray) {
|
|
|
5370
5392
|
* to the engine that a particular collection of children must be diffed using the slow
|
|
5371
5393
|
* algo based on keys due to the nature of the list. E.g.:
|
|
5372
5394
|
*
|
|
5373
|
-
*
|
|
5374
|
-
*
|
|
5375
|
-
*
|
|
5376
|
-
*
|
|
5377
|
-
*
|
|
5378
|
-
*
|
|
5379
|
-
*
|
|
5395
|
+
* - slot element's children: the content of the slot has to be dynamic when in synthetic
|
|
5396
|
+
* shadow mode because the `vnode.children` might be the slotted
|
|
5397
|
+
* content vs default content, in which case the size and the
|
|
5398
|
+
* keys are not matching.
|
|
5399
|
+
* - children that contain dynamic components
|
|
5400
|
+
* - children that are produced by iteration
|
|
5401
|
+
* @param vnodes
|
|
5380
5402
|
*/
|
|
5381
5403
|
function sc(vnodes) {
|
|
5382
5404
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -5400,6 +5422,7 @@ let sanitizeHtmlContentHook = () => {
|
|
|
5400
5422
|
};
|
|
5401
5423
|
/**
|
|
5402
5424
|
* Sets the sanitizeHtmlContentHook.
|
|
5425
|
+
* @param newHookImpl
|
|
5403
5426
|
*/
|
|
5404
5427
|
function setSanitizeHtmlContentHook(newHookImpl) {
|
|
5405
5428
|
sanitizeHtmlContentHook = newHookImpl;
|
|
@@ -5841,6 +5864,8 @@ const registeredComponentMap = new Map();
|
|
|
5841
5864
|
/**
|
|
5842
5865
|
* INTERNAL: This function can only be invoked by compiled code. The compiler
|
|
5843
5866
|
* will prevent this function from being imported by userland code.
|
|
5867
|
+
* @param Ctor
|
|
5868
|
+
* @param metadata
|
|
5844
5869
|
*/
|
|
5845
5870
|
function registerComponent(
|
|
5846
5871
|
// We typically expect a LightningElementConstructor, but technically you can call this with anything
|
|
@@ -6198,7 +6223,7 @@ function computeShadowMode(def, owner, renderer, hydrated) {
|
|
|
6198
6223
|
return shadowMode;
|
|
6199
6224
|
}
|
|
6200
6225
|
function assertIsVM(obj) {
|
|
6201
|
-
if (
|
|
6226
|
+
if (!isObject(obj) || isNull(obj) || !('renderRoot' in obj)) {
|
|
6202
6227
|
throw new TypeError(`${obj} is not a VM.`);
|
|
6203
6228
|
}
|
|
6204
6229
|
}
|
|
@@ -6391,6 +6416,7 @@ function runLightChildNodesDisconnectedCallback(vm) {
|
|
|
6391
6416
|
* need to continue into its children because by attempting to disconnect the
|
|
6392
6417
|
* custom element itself will trigger the removal of anything slotted or anything
|
|
6393
6418
|
* defined on its shadow.
|
|
6419
|
+
* @param vnodes
|
|
6394
6420
|
*/
|
|
6395
6421
|
function recursivelyDisconnectChildren(vnodes) {
|
|
6396
6422
|
for (let i = 0, len = vnodes.length; i < len; i += 1) {
|
|
@@ -7546,6 +7572,7 @@ function freezeTemplate(tmpl) {
|
|
|
7546
7572
|
/**
|
|
7547
7573
|
* EXPERIMENTAL: This function provides access to the component constructor, given an HTMLElement.
|
|
7548
7574
|
* This API is subject to change or being removed.
|
|
7575
|
+
* @param elm
|
|
7549
7576
|
*/
|
|
7550
7577
|
function getComponentConstructor(elm) {
|
|
7551
7578
|
let ctor = null;
|
|
@@ -7570,6 +7597,7 @@ function getComponentConstructor(elm) {
|
|
|
7570
7597
|
* EXPERIMENTAL: This function allows you to create a reactive readonly
|
|
7571
7598
|
* membrane around any object value. This API is subject to change or
|
|
7572
7599
|
* being removed.
|
|
7600
|
+
* @param obj
|
|
7573
7601
|
*/
|
|
7574
7602
|
function readonly(obj) {
|
|
7575
7603
|
if (process.env.NODE_ENV !== 'production') {
|
|
@@ -7582,5 +7610,5 @@ function readonly(obj) {
|
|
|
7582
7610
|
}
|
|
7583
7611
|
|
|
7584
7612
|
export { LightningElement, profilerControl as __unstable__ProfilerControl, reportingControl as __unstable__ReportingControl, api$1 as api, computeShadowAndRenderMode, connectRootElement, createContextProviderWithRegister, createVM, disconnectRootElement, freezeTemplate, getAssociatedVMIfPresent, getComponentAPIVersion, getComponentConstructor, getComponentDef, getComponentHtmlPrototype, hydrateRoot, isComponentConstructor, parseFragment, parseSVGFragment, readonly, registerComponent, registerDecorators, registerTemplate, runFormAssociatedCallback, runFormDisabledCallback, runFormResetCallback, runFormStateRestoreCallback, sanitizeAttribute, setHooks, swapComponent, swapStyle, swapTemplate, track, unwrap, wire };
|
|
7585
|
-
/** version: 6.2.
|
|
7613
|
+
/** version: 6.2.1 */
|
|
7586
7614
|
//# sourceMappingURL=index.js.map
|