@lwc/engine-core 2.33.0 → 2.35.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lwc/engine-core",
3
- "version": "2.33.0",
3
+ "version": "2.35.0",
4
4
  "description": "Core LWC engine APIs.",
5
5
  "homepage": "https://lwc.dev/",
6
6
  "repository": {
@@ -24,9 +24,9 @@
24
24
  "types/"
25
25
  ],
26
26
  "dependencies": {
27
- "@lwc/aria-reflection": "2.33.0",
28
- "@lwc/features": "2.33.0",
29
- "@lwc/shared": "2.33.0"
27
+ "@lwc/aria-reflection": "2.35.0",
28
+ "@lwc/features": "2.35.0",
29
+ "@lwc/shared": "2.35.0"
30
30
  },
31
31
  "devDependencies": {
32
32
  "observable-membrane": "2.0.0"
@@ -10,6 +10,7 @@ import { AccessibleElementProperties } from '@lwc/shared';
10
10
  import { ShadowSupportMode } from './vm';
11
11
  import { Template } from './template';
12
12
  import { HTMLElementConstructor } from './base-bridge-element';
13
+ import { TemplateStylesheetFactories } from './stylesheet';
13
14
  export interface LightningElementConstructor {
14
15
  new (): LightningElement;
15
16
  readonly prototype: LightningElement;
@@ -17,6 +18,7 @@ export interface LightningElementConstructor {
17
18
  delegatesFocus?: boolean;
18
19
  renderMode?: 'light' | 'shadow';
19
20
  shadowSupportMode?: ShadowSupportMode;
21
+ stylesheets: TemplateStylesheetFactories;
20
22
  }
21
23
  type HTMLElementTheGoodParts = Pick<Object, 'toString'> & Pick<HTMLElement, 'accessKey' | 'addEventListener' | 'children' | 'childNodes' | 'classList' | 'dir' | 'dispatchEvent' | 'draggable' | 'firstChild' | 'firstElementChild' | 'getAttribute' | 'getAttributeNS' | 'getBoundingClientRect' | 'getElementsByClassName' | 'getElementsByTagName' | 'hasAttribute' | 'hasAttributeNS' | 'hidden' | 'id' | 'isConnected' | 'lang' | 'lastChild' | 'lastElementChild' | 'querySelector' | 'querySelectorAll' | 'removeAttribute' | 'removeAttributeNS' | 'removeEventListener' | 'setAttribute' | 'setAttributeNS' | 'spellcheck' | 'tabIndex' | 'title'>;
22
24
  type RefNodes = {
@@ -17,6 +17,7 @@ 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 { reportingControl as __unstable__ReportingControl } from './reporting';
20
21
  export { swapTemplate, swapComponent, swapStyle } from './hot-swaps';
21
22
  export { setHooks } from './overridable-hooks';
22
23
  export { freezeTemplate } from './freeze-template';
@@ -0,0 +1,31 @@
1
+ import { VM } from './vm';
2
+ export declare const enum ReportingEventId {
3
+ CrossRootAriaInSyntheticShadow = 0
4
+ }
5
+ type ReportingDispatcher = (reportingEventId: ReportingEventId, tagName: string, vmIndex: number) => void;
6
+ type OnReportingEnabledCallback = () => void;
7
+ export declare const reportingControl: {
8
+ /**
9
+ * Attach a new reporting control (aka dispatcher).
10
+ *
11
+ * @param dispatcher - reporting control
12
+ */
13
+ attachDispatcher(dispatcher: ReportingDispatcher): void;
14
+ /**
15
+ * Detach the current reporting control (aka dispatcher).
16
+ */
17
+ detachDispatcher(): void;
18
+ };
19
+ /**
20
+ * Call a callback when reporting is enabled, or immediately if reporting is already enabled.
21
+ * Will only ever be called once.
22
+ * @param callback
23
+ */
24
+ export declare function onReportingEnabled(callback: OnReportingEnabledCallback): void;
25
+ /**
26
+ * Report to the current dispatcher, if there is one.
27
+ * @param reportingEventId
28
+ * @param vm
29
+ */
30
+ export declare function report(reportingEventId: ReportingEventId, vm: VM): void;
31
+ export {};
@@ -21,4 +21,5 @@ 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;
24
+ export declare function computeHasScopedStyles(template: Template, vm: VM | undefined): boolean;
25
+ export declare function hasStyles(stylesheets: TemplateStylesheetFactories | undefined | null): stylesheets is TemplateStylesheetFactories;
@@ -4,6 +4,7 @@ import { ComponentDef } from './def';
4
4
  import { LightningElement, LightningElementConstructor } from './base-lightning-element';
5
5
  import { ReactiveObserver } from './mutation-tracker';
6
6
  import { VNodes, VCustomElement, VNode, VBaseElement } from './vnodes';
7
+ import { TemplateStylesheetFactories } from './stylesheet';
7
8
  type ShadowRootMode = 'open' | 'closed';
8
9
  export interface TemplateCache {
9
10
  [key: string]: any;
@@ -132,6 +133,9 @@ export interface VM<N = HostNode, E = HostElement> {
132
133
  /**
133
134
  * Debug info bag. Stores useful debug information about the component. */
134
135
  debugInfo?: Record<string, any>;
136
+ /**
137
+ * Any stylesheets associated with the component */
138
+ stylesheets: TemplateStylesheetFactories | null;
135
139
  }
136
140
  type VMAssociable = HostNode | LightningElement;
137
141
  export declare function rerenderVM(vm: VM): void;
package/types/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  import './testFeatureFlag';
2
+ import './patches/detect-synthetic-cross-root-aria';
2
3
  export * from './framework/main';
@@ -1,3 +1,4 @@
1
1
  import { VM } from '../framework/vm';
2
2
  export declare function logError(message: string, vm?: VM): void;
3
3
  export declare function logWarn(message: string, vm?: VM): void;
4
+ export declare function logWarnOnce(message: string, vm?: VM): void;