@lwc/engine-core 2.25.1 → 2.27.0
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/engine-core.cjs.js +269 -328
- package/dist/engine-core.js +271 -329
- package/package.json +3 -3
- package/types/framework/api.d.ts +3 -1
- package/types/framework/main.d.ts +1 -2
- package/types/framework/renderer.d.ts +2 -3
- package/types/framework/stylesheet.d.ts +2 -0
- package/types/framework/template.d.ts +1 -0
- package/types/framework/vm.d.ts +6 -2
- package/types/framework/vnodes.d.ts +10 -2
- package/types/framework/upgradable-element.d.ts +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lwc/engine-core",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.27.0",
|
|
4
4
|
"description": "Core LWC engine APIs.",
|
|
5
5
|
"homepage": "https://lwc.dev/",
|
|
6
6
|
"repository": {
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"types/"
|
|
25
25
|
],
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@lwc/features": "2.
|
|
28
|
-
"@lwc/shared": "2.
|
|
27
|
+
"@lwc/features": "2.27.0",
|
|
28
|
+
"@lwc/shared": "2.27.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"observable-membrane": "2.0.0"
|
package/types/framework/api.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SlotSet } from './vm';
|
|
2
2
|
import { LightningElementConstructor } from './base-lightning-element';
|
|
3
|
-
import { VNode, VNodes, VElement, VText, VCustomElement, VComment, VElementData, VStatic, Key, VFragment } from './vnodes';
|
|
3
|
+
import { VNode, VNodes, VElement, VText, VCustomElement, VComment, VElementData, VStatic, Key, VFragment, VScopedSlotFragment } from './vnodes';
|
|
4
|
+
declare function ssf(slotName: string, factory: (value: any) => VNodes): VScopedSlotFragment;
|
|
4
5
|
declare function st(fragment: Element, key: Key): VStatic;
|
|
5
6
|
declare function fr(key: Key, children: VNodes, stable: 0 | 1): VFragment;
|
|
6
7
|
declare function h(sel: string, data: VElementData, children?: VNodes): VElement;
|
|
@@ -47,6 +48,7 @@ declare const api: Readonly<{
|
|
|
47
48
|
gid: typeof gid;
|
|
48
49
|
fid: typeof fid;
|
|
49
50
|
shc: typeof shc;
|
|
51
|
+
ssf: typeof ssf;
|
|
50
52
|
}>;
|
|
51
53
|
export default api;
|
|
52
54
|
export declare type RenderAPI = typeof api;
|
|
@@ -17,10 +17,9 @@ export { unwrap } from './membrane';
|
|
|
17
17
|
export { sanitizeAttribute } from './secure-template';
|
|
18
18
|
export { getComponentDef, isComponentConstructor } from './def';
|
|
19
19
|
export { profilerControl as __unstable__ProfilerControl } from './profiler';
|
|
20
|
-
export { getUpgradableConstructor } from './upgradable-element';
|
|
21
20
|
export { swapTemplate, swapComponent, swapStyle } from './hot-swaps';
|
|
22
21
|
export { setHooks } from './overridable-hooks';
|
|
23
22
|
export { freezeTemplate } from './freeze-template';
|
|
24
23
|
export { getComponentConstructor } from './get-component-constructor';
|
|
25
|
-
export type { RendererAPI } from './renderer';
|
|
24
|
+
export type { RendererAPI, LifecycleCallback } from './renderer';
|
|
26
25
|
export type { ConfigValue as WireConfigValue, ContextValue as WireContextValue, DataCallback, WireAdapter, WireAdapterConstructor, WireAdapterSchemaValue, } from './wiring';
|
|
@@ -2,10 +2,10 @@ export declare type HostNode = any;
|
|
|
2
2
|
export declare type HostElement = any;
|
|
3
3
|
declare type N = HostNode;
|
|
4
4
|
declare type E = HostElement;
|
|
5
|
+
export declare type LifecycleCallback = (elm: E) => void;
|
|
5
6
|
export interface RendererAPI {
|
|
6
7
|
isNativeShadowDefined: boolean;
|
|
7
8
|
isSyntheticShadowDefined: boolean;
|
|
8
|
-
HTMLElementExported: typeof HTMLElement;
|
|
9
9
|
insert: (node: N, parent: E, anchor: N | null) => void;
|
|
10
10
|
remove: (node: N, parent: E) => void;
|
|
11
11
|
cloneNode: (node: N, deep: boolean) => N;
|
|
@@ -40,7 +40,6 @@ export interface RendererAPI {
|
|
|
40
40
|
isConnected: (node: N) => boolean;
|
|
41
41
|
insertStylesheet: (content: string, target?: ShadowRoot) => void;
|
|
42
42
|
assertInstanceOfHTMLElement: (elm: any, msg: string) => void;
|
|
43
|
-
|
|
44
|
-
getCustomElement: (name: string) => CustomElementConstructor | undefined;
|
|
43
|
+
createCustomElement: (tagName: string, upgradeCallback: LifecycleCallback, connectedCallback: LifecycleCallback, disconnectedCallback: LifecycleCallback) => E;
|
|
45
44
|
}
|
|
46
45
|
export {};
|
|
@@ -23,6 +23,8 @@ export declare function getScopeTokenClass(owner: VM): string | null;
|
|
|
23
23
|
/**
|
|
24
24
|
* This function returns the host style token for a custom element if it
|
|
25
25
|
* exists. Otherwise it returns null.
|
|
26
|
+
*
|
|
27
|
+
* A host style token is applied to the component if scoped styles are used.
|
|
26
28
|
*/
|
|
27
29
|
export declare function getStylesheetTokenHost(vnode: VCustomElement): string | null;
|
|
28
30
|
export declare function createStylesheet(vm: VM, stylesheets: string[]): VNode[] | null;
|
|
@@ -21,3 +21,4 @@ export declare function setVMBeingRendered(vm: VM | null): void;
|
|
|
21
21
|
export declare const parseFragment: (strings: string[], ...keys: number[]) => () => Element;
|
|
22
22
|
export declare const parseSVGFragment: (strings: string[], ...keys: number[]) => () => Element;
|
|
23
23
|
export declare function evaluateTemplate(vm: VM, html: Template): VNodes;
|
|
24
|
+
export declare function computeHasScopedStyles(template: Template): boolean;
|
package/types/framework/vm.d.ts
CHANGED
|
@@ -10,7 +10,10 @@ export interface TemplateCache {
|
|
|
10
10
|
[key: string]: any;
|
|
11
11
|
}
|
|
12
12
|
export interface SlotSet {
|
|
13
|
-
|
|
13
|
+
slotAssignments: {
|
|
14
|
+
[key: string]: VNodes;
|
|
15
|
+
};
|
|
16
|
+
owner?: VM;
|
|
14
17
|
}
|
|
15
18
|
export declare const enum VMState {
|
|
16
19
|
created = 0,
|
|
@@ -91,7 +94,8 @@ export interface VM<N = HostNode, E = HostElement> {
|
|
|
91
94
|
cmpProps: {
|
|
92
95
|
[name: string]: any;
|
|
93
96
|
};
|
|
94
|
-
/**
|
|
97
|
+
/** Contains information about the mapping between the slot names and the slotted VNodes, and
|
|
98
|
+
* the owner of the slot content. */
|
|
95
99
|
cmpSlots: SlotSet;
|
|
96
100
|
/** The component internal reactive properties. */
|
|
97
101
|
cmpFields: {
|
|
@@ -7,9 +7,10 @@ export declare const enum VNodeType {
|
|
|
7
7
|
Element = 2,
|
|
8
8
|
CustomElement = 3,
|
|
9
9
|
Static = 4,
|
|
10
|
-
Fragment = 5
|
|
10
|
+
Fragment = 5,
|
|
11
|
+
ScopedSlotFragment = 6
|
|
11
12
|
}
|
|
12
|
-
export declare type VNode = VText | VComment | VElement | VCustomElement | VStatic | VFragment;
|
|
13
|
+
export declare type VNode = VText | VComment | VElement | VCustomElement | VStatic | VFragment | VScopedSlotFragment;
|
|
13
14
|
export declare type VParentElement = VElement | VCustomElement | VFragment;
|
|
14
15
|
export declare type VNodes = Readonly<Array<VNode | null>>;
|
|
15
16
|
export interface BaseVParent {
|
|
@@ -22,6 +23,11 @@ export interface BaseVNode {
|
|
|
22
23
|
key: Key | undefined;
|
|
23
24
|
owner: VM;
|
|
24
25
|
}
|
|
26
|
+
export interface VScopedSlotFragment extends BaseVNode {
|
|
27
|
+
factory: (value: any) => VNodes;
|
|
28
|
+
type: VNodeType.ScopedSlotFragment;
|
|
29
|
+
slotName: string;
|
|
30
|
+
}
|
|
25
31
|
export interface VStatic extends BaseVNode {
|
|
26
32
|
type: VNodeType.Static;
|
|
27
33
|
sel: undefined;
|
|
@@ -77,7 +83,9 @@ export interface VNodeData {
|
|
|
77
83
|
export interface VElementData extends VNodeData {
|
|
78
84
|
readonly key: Key;
|
|
79
85
|
readonly ref?: string;
|
|
86
|
+
readonly slotData?: any;
|
|
80
87
|
}
|
|
81
88
|
export declare function isVBaseElement(vnode: VNode): vnode is VElement | VCustomElement;
|
|
82
89
|
export declare function isSameVnode(vnode1: VNode, vnode2: VNode): boolean;
|
|
83
90
|
export declare function isVCustomElement(vnode: VBaseElement): vnode is VCustomElement;
|
|
91
|
+
export declare function isVScopedSlotFragment(vnode: VNode): vnode is VScopedSlotFragment;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { RendererAPI } from './renderer';
|
|
2
|
-
declare type UpgradeCallback = (elm: HTMLElement) => void;
|
|
3
|
-
interface UpgradableCustomElementConstructor extends CustomElementConstructor {
|
|
4
|
-
new (upgradeCallback?: UpgradeCallback): HTMLElement;
|
|
5
|
-
}
|
|
6
|
-
export declare function getUpgradableConstructor(tagName: string, renderer: RendererAPI): CustomElementConstructor | UpgradableCustomElementConstructor;
|
|
7
|
-
export {};
|