@lwc/engine-core 3.3.3 → 3.5.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.
@@ -1,6 +1,7 @@
1
+ import { LightningElement } from './base-lightning-element';
1
2
  export interface HTMLElementConstructor {
2
3
  prototype: HTMLElement;
3
4
  new (): HTMLElement;
4
5
  }
5
- export declare function HTMLBridgeElementFactory(SuperClass: HTMLElementConstructor, props: string[], methods: string[]): HTMLElementConstructor;
6
+ export declare function HTMLBridgeElementFactory(SuperClass: HTMLElementConstructor, publicProperties: string[], methods: string[], observedFields: string[], proto: LightningElement | null): HTMLElementConstructor;
6
7
  export declare const BaseBridgeElement: HTMLElementConstructor;
@@ -17,6 +17,7 @@ export interface LightningElementConstructor {
17
17
  readonly CustomElementConstructor: HTMLElementConstructor;
18
18
  delegatesFocus?: boolean;
19
19
  renderMode?: 'light' | 'shadow';
20
+ formAssociated?: boolean;
20
21
  shadowSupportMode?: ShadowSupportMode;
21
22
  stylesheets: TemplateStylesheetFactories;
22
23
  }
@@ -32,6 +33,10 @@ export interface LightningElement extends HTMLElementTheGoodParts, AccessibleEle
32
33
  disconnectedCallback?(): void;
33
34
  renderedCallback?(): void;
34
35
  errorCallback?(error: any, stack: string): void;
36
+ formAssociatedCallback?(): void;
37
+ formResetCallback?(): void;
38
+ formDisabledCallback?(): void;
39
+ formStateRestoreCallback?(): void;
35
40
  }
36
41
  /**
37
42
  * This class is the base class for any LWC element.
@@ -20,12 +20,17 @@ export interface ComponentDef {
20
20
  template: Template;
21
21
  renderMode: RenderMode;
22
22
  shadowSupportMode: ShadowSupportMode;
23
+ formAssociated: boolean | undefined;
23
24
  ctor: LightningElementConstructor;
24
25
  bridge: HTMLElementConstructor;
25
26
  connectedCallback?: LightningElement['connectedCallback'];
26
27
  disconnectedCallback?: LightningElement['disconnectedCallback'];
27
28
  renderedCallback?: LightningElement['renderedCallback'];
28
29
  errorCallback?: LightningElement['errorCallback'];
30
+ formAssociatedCallback?: LightningElement['formAssociatedCallback'];
31
+ formResetCallback?: LightningElement['formResetCallback'];
32
+ formDisabledCallback?: LightningElement['formDisabledCallback'];
33
+ formStateRestoreCallback?: LightningElement['formStateRestoreCallback'];
29
34
  render: LightningElement['render'];
30
35
  }
31
36
  /**
@@ -1,5 +1,5 @@
1
1
  export { getComponentHtmlPrototype } from './def';
2
- export { RenderMode, ShadowMode, connectRootElement, createVM, disconnectRootElement, getAssociatedVMIfPresent, computeShadowAndRenderMode, } from './vm';
2
+ export { RenderMode, ShadowMode, connectRootElement, createVM, disconnectRootElement, getAssociatedVMIfPresent, computeShadowAndRenderMode, runFormAssociatedCallback, runFormDisabledCallback, runFormResetCallback, runFormStateRestoreCallback, } from './vm';
3
3
  export { createContextProviderWithRegister } from './wiring';
4
4
  export { parseFragment, parseSVGFragment } from './template';
5
5
  export { hydrateRoot } from './hydration';
@@ -41,7 +41,7 @@ export interface RendererAPI {
41
41
  isConnected: (node: N) => boolean;
42
42
  insertStylesheet: (content: string, target?: ShadowRoot) => void;
43
43
  assertInstanceOfHTMLElement: (elm: any, msg: string) => void;
44
- createCustomElement: (tagName: string, upgradeCallback: LifecycleCallback, connectedCallback?: LifecycleCallback, disconnectedCallback?: LifecycleCallback) => E;
44
+ createCustomElement: (tagName: string, upgradeCallback: LifecycleCallback, connectedCallback?: LifecycleCallback, disconnectedCallback?: LifecycleCallback, formAssociatedCallback?: LifecycleCallback, formDisabledCallback?: LifecycleCallback, formResetCallback?: LifecycleCallback, formStateRestoreCallback?: LifecycleCallback) => E;
45
45
  ownerDocument(elm: E): Document;
46
46
  registerContextConsumer: (element: E, adapterContextToken: string, subscriptionPayload: WireContextSubscriptionPayload) => void;
47
47
  attachInternals: (elm: E) => ElementInternals;
@@ -12,14 +12,14 @@ export type StylesheetFactory = (stylesheetToken: string | undefined, useActualH
12
12
  * @import CSS declaration).
13
13
  */
14
14
  export type TemplateStylesheetFactories = Array<StylesheetFactory | TemplateStylesheetFactories>;
15
- export declare function updateStylesheetToken(vm: VM, template: Template): void;
15
+ export declare function updateStylesheetToken(vm: VM, template: Template, legacy: boolean): void;
16
16
  export declare function getStylesheetsContent(vm: VM, template: Template): string[];
17
17
  /**
18
18
  * If the component that is currently being rendered uses scoped styles,
19
19
  * this returns the unique token for that scoped stylesheet. Otherwise
20
20
  * it returns null.
21
21
  */
22
- export declare function getScopeTokenClass(owner: VM): string | null;
22
+ export declare function getScopeTokenClass(owner: VM, legacy: boolean): 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.
@@ -10,6 +10,8 @@ export interface Template {
10
10
  stylesheets?: TemplateStylesheetFactories;
11
11
  /** The string used for synthetic shadow style scoping and light DOM style scoping. */
12
12
  stylesheetToken?: string;
13
+ /** Same as the above, but for legacy use cases (pre-LWC v3.0.0) */
14
+ legacyStylesheetToken?: string;
13
15
  /** Render mode for the template. Could be light or undefined (which means it's shadow) */
14
16
  renderMode?: 'light';
15
17
  /** True if this template contains template refs, undefined or false otherwise */
@@ -42,6 +42,12 @@ export interface Context {
42
42
  hasTokenInClass: boolean | undefined;
43
43
  /** True if a stylesheetToken was added to the host attributes */
44
44
  hasTokenInAttribute: boolean | undefined;
45
+ /** The legacy string used for synthetic shadow DOM and light DOM style scoping. */
46
+ legacyStylesheetToken: string | undefined;
47
+ /** True if a legacyStylesheetToken was added to the host class */
48
+ hasLegacyTokenInClass: boolean | undefined;
49
+ /** True if a legacyStylesheetToken was added to the host attributes */
50
+ hasLegacyTokenInAttribute: boolean | undefined;
45
51
  /** Whether or not light DOM scoped styles are present in the stylesheets. */
46
52
  hasScopedStyles: boolean | undefined;
47
53
  /** The VNodes injected in all the shadow trees to apply the associated component stylesheets. */
@@ -160,4 +166,9 @@ export declare function resetComponentRoot(vm: VM): void;
160
166
  export declare function scheduleRehydration(vm: VM): void;
161
167
  export declare function runWithBoundaryProtection(vm: VM, owner: VM | null, pre: () => void, job: () => void, post: () => void): void;
162
168
  export declare function forceRehydration(vm: VM): void;
169
+ export declare function runFormAssociatedCustomElementCallback(vm: VM, faceCb: () => void): void;
170
+ export declare function runFormAssociatedCallback(elm: HTMLElement): void;
171
+ export declare function runFormDisabledCallback(elm: HTMLElement): void;
172
+ export declare function runFormResetCallback(elm: HTMLElement): void;
173
+ export declare function runFormStateRestoreCallback(elm: HTMLElement): void;
163
174
  export {};