lwc 6.6.3 → 7.0.0-alpha.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.
Files changed (3) hide show
  1. package/LICENSE.md +21 -1
  2. package/index.d.ts +2 -301
  3. package/package.json +17 -17
package/LICENSE.md CHANGED
@@ -15,7 +15,27 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
15
15
 
16
16
  ## @parse5/tools
17
17
 
18
- MIT license defined in package.json in v0.4.0.
18
+ The MIT License (MIT)
19
+
20
+ Copyright © 2024 James Garbutt
21
+
22
+ Permission is hereby granted, free of charge, to any person obtaining a copy
23
+ of this software and associated documentation files (the “Software”), to deal
24
+ in the Software without restriction, including without limitation the rights
25
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
26
+ copies of the Software, and to permit persons to whom the Software is
27
+ furnished to do so, subject to the following conditions:
28
+
29
+ The above copyright notice and this permission notice shall be included in
30
+ all copies or substantial portions of the Software.
31
+
32
+ THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
33
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
34
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
35
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
36
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
37
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
38
+ THE SOFTWARE.
19
39
 
20
40
  ## entities
21
41
 
package/index.d.ts CHANGED
@@ -1,306 +1,7 @@
1
1
  /*
2
- * Copyright (c) 2023, salesforce.com, inc.
2
+ * Copyright (c) 2024, Salesforce, Inc.
3
3
  * All rights reserved.
4
4
  * SPDX-License-Identifier: MIT
5
5
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
6
6
  */
7
-
8
- import type { FormRestoreReason, FormRestoreState } from '@lwc/engine-core';
9
-
10
- /**
11
- * Lightning Web Components core module
12
- */
13
-
14
- declare module 'lwc' {
15
- // backwards compatible type used for the old days when TS didn't support `event.composed`
16
- interface ComposableEvent extends Event {
17
- composed: boolean;
18
- }
19
-
20
- class HTMLElementTheGoodPart {
21
- dispatchEvent(evt: Event): boolean;
22
- addEventListener(
23
- type: string,
24
- listener: EventListenerOrEventListenerObject,
25
- options?: boolean | AddEventListenerOptions
26
- ): void;
27
- removeEventListener(
28
- type: string,
29
- listener: EventListenerOrEventListenerObject,
30
- options?: boolean | EventListenerOptions
31
- ): void;
32
- setAttributeNS(ns: string, attrName: string, value: any): void;
33
- removeAttributeNS(ns: string, attrName: string): void;
34
- removeAttribute(attrName: string): void;
35
- setAttribute(attrName: string, value: any): void;
36
- getAttribute(attrName: string): string | null;
37
- getAttributeNS(ns: string, attrName: string): string | null;
38
- getBoundingClientRect(): ClientRect;
39
- querySelector<E extends Element = Element>(selectors: string): E | null;
40
- querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
41
- getElementsByTagName(tagNameOrWildCard: string): HTMLCollectionOf<Element>;
42
- getElementsByClassName(names: string): HTMLCollectionOf<Element>;
43
- attachInternals(): ElementInternals;
44
- readonly tagName: string;
45
- readonly classList: DOMTokenList;
46
-
47
- // Default HTML Properties
48
- dir: string;
49
- id: string;
50
- accessKey: string;
51
- title: string;
52
- lang: string;
53
- hidden: boolean;
54
- draggable: boolean;
55
- tabIndex: number;
56
-
57
- // Aria Properties
58
- ariaAutoComplete: string | null;
59
- ariaChecked: string | null;
60
- ariaCurrent: string | null;
61
- ariaDisabled: string | null;
62
- ariaExpanded: string | null;
63
- ariaHasPopup: string | null;
64
- ariaHidden: string | null;
65
- ariaInvalid: string | null;
66
- ariaLabel: string | null;
67
- ariaLevel: string | null;
68
- ariaMultiLine: string | null;
69
- ariaMultiSelectable: string | null;
70
- ariaOrientation: string | null;
71
- ariaPressed: string | null;
72
- ariaReadOnly: string | null;
73
- ariaRequired: string | null;
74
- ariaSelected: string | null;
75
- ariaSort: string | null;
76
- ariaValueMax: string | null;
77
- ariaValueMin: string | null;
78
- ariaValueNow: string | null;
79
- ariaValueText: string | null;
80
- ariaLive: string | null;
81
- ariaRelevant: string | null;
82
- ariaAtomic: string | null;
83
- ariaBusy: string | null;
84
- ariaActiveDescendant: string | null;
85
- ariaControls: string | null;
86
- ariaDescribedBy: string | null;
87
- ariaFlowTo: string | null;
88
- ariaLabelledBy: string | null;
89
- ariaOwns: string | null;
90
- ariaPosInSet: string | null;
91
- ariaSetSize: string | null;
92
- ariaColCount: string | null;
93
- ariaColIndex: string | null;
94
- ariaColIndexText: string | null;
95
- ariaDescription: string | null;
96
- ariaDetails: string | null;
97
- ariaErrorMessage: string | null;
98
- ariaKeyShortcuts: string | null;
99
- ariaModal: string | null;
100
- ariaPlaceholder: string | null;
101
- ariaRoleDescription: string | null;
102
- ariaRowCount: string | null;
103
- ariaRowIndex: string | null;
104
- ariaRowIndexText: string | null;
105
- ariaRowSpan: string | null;
106
- ariaColSpan: string | null;
107
- ariaBrailleLabel: string | null;
108
- ariaBrailleRoleDescription: string | null;
109
- role: string | null;
110
- }
111
-
112
- // @ts-expect-error type-mismatch
113
- interface ShadowRootTheGoodPart extends NodeSelector {
114
- mode: string;
115
- readonly activeElement: Element | null;
116
- readonly host: HTMLElement;
117
- readonly firstChild: Node | null;
118
- readonly lastChild: Node | null;
119
- readonly innerHTML: string;
120
- readonly textContent: string;
121
- readonly childNodes: Node[];
122
- readonly delegatesFocus: boolean;
123
- addEventListener(
124
- type: string,
125
- listener: EventListenerOrEventListenerObject,
126
- options?: boolean | AddEventListenerOptions
127
- ): void;
128
- removeEventListener(
129
- type: string,
130
- listener: EventListenerOrEventListenerObject,
131
- options?: boolean | EventListenerOptions
132
- ): void;
133
- hasChildNodes(): boolean;
134
- compareDocumentPosition(otherNode: Node): number;
135
- contains(otherNode: Node): boolean;
136
- elementFromPoint(x: number, y: number): Element | null;
137
- querySelector<K extends keyof HTMLElementTagNameMap>(
138
- selectors: K
139
- ): HTMLElementTagNameMap[K] | null;
140
- querySelector<K extends keyof SVGElementTagNameMap>(
141
- selectors: K
142
- ): SVGElementTagNameMap[K] | null;
143
- querySelector<E extends Element = Element>(selectors: string): E | null;
144
- querySelectorAll<K extends keyof HTMLElementTagNameMap>(
145
- selectors: K
146
- ): NodeListOf<HTMLElementTagNameMap[K]>;
147
- querySelectorAll<K extends keyof SVGElementTagNameMap>(
148
- selectors: K
149
- ): NodeListOf<SVGElementTagNameMap[K]>;
150
- querySelectorAll<E extends Element = Element>(selectors: string): NodeListOf<E>;
151
- }
152
-
153
- /**
154
- * Base class for the Lightning Web Component JavaScript class
155
- */
156
- export class LightningElement extends HTMLElementTheGoodPart {
157
- /**
158
- * This static getter builds a Web Component class from a LWC constructor so it can be registered
159
- * as a new element via customElements.define() at any given time. For example:
160
- *
161
- * ```
162
- * import XComponent from 'namespace/element';
163
- * customElements.define('x-component', XComponent.CustomElementConstructor);
164
- * const elm = document.createElement('x-component');
165
- * ```
166
- */
167
- static get CustomElementConstructor(): typeof HTMLElement;
168
-
169
- /**
170
- * Set to true to designate this component as a Form-Associated Custom Element (FACE).
171
- * @see https://web.dev/articles/more-capable-form-controls#form-associated_custom_elements
172
- */
173
- static formAssociated?: boolean;
174
- /**
175
- * Called when the element is inserted in a document
176
- */
177
- connectedCallback(): void;
178
- /**
179
- * Called when the element is removed from a document
180
- */
181
- disconnectedCallback(): void;
182
- /**
183
- * Called after every render of the component
184
- */
185
- renderedCallback(): void;
186
- /**
187
- * Called when a descendant component throws an error in one of its lifecycle hooks
188
- */
189
- errorCallback(error: Error, stack: string): void;
190
- /**
191
- * Called when a Form-Associated Custom Element (FACE) is associated with an HTMLFormElement.
192
- * @param form HTMLFormElement - the associated form element
193
- * @see https://web.dev/articles/more-capable-form-controls#void_formassociatedcallbackform
194
- */
195
- formAssociatedCallback(form: HTMLFormElement | null): void;
196
- /**
197
- * Called when a Form-Associated Custom Element (FACE) has a disabled state that has changed.
198
- * @param disabled boolean - the new disabled state
199
- * @see https://web.dev/articles/more-capable-form-controls#void_formdisabledcallbackdisabled
200
- */
201
- formDisabledCallback(disabled: boolean): void;
202
- /**
203
- * Called when a Form-Associated Custom Element (FACE) has an associated form that is reset.
204
- * @see https://web.dev/articles/more-capable-form-controls#void_formresetcallback
205
- */
206
- formResetCallback(): void;
207
- /**
208
- * Called when a Form-Associated Custom Element (FACE) has an associated form that is restored.
209
- * @param state FormRestoreState - the state of the form during restoration
210
- * @param reason FormRestoreReason - the reason the form was restored
211
- * @see https://web.dev/articles/more-capable-form-controls#void_formstaterestorecallbackstate_mode
212
- */
213
- formStateRestoreCallback(state: FormRestoreState | null, reason: FormRestoreReason): void;
214
-
215
- readonly template: ShadowRootTheGoodPart;
216
- readonly shadowRoot: null;
217
- readonly refs: { [key: string]: Element | LightningElement };
218
- }
219
-
220
- /**
221
- * Decorator to mark public reactive properties
222
- */
223
- export const api: PropertyDecorator;
224
-
225
- /**
226
- * Decorator to mark private reactive properties
227
- */
228
- export const track: PropertyDecorator;
229
-
230
- type StringKeyedRecord = Record<string, any>;
231
- /**
232
- * Decorator factory to wire a property or method to a wire adapter data source
233
- * Use generic types to allow type checking for wire adapters
234
- * Default all the generic types to any to maintain backward compatibility
235
- *
236
- * For example, a wire adapter 'getRecord' can have the following type definition
237
- *
238
- * export const getRecord: WireAdapterConstructor<GetRecordConfig, RecordRepresentation>;
239
- *
240
- * in which 'GetRecordConfig' is the adapter config object type and 'RecordRepresentation'
241
- * is the returned value.
242
- * @param adapter the adapter used to provision data
243
- * @param config configuration object for the adapter
244
- * @returns A decorator function
245
- * @example
246
- * export default class WireExample extends LightningElement {
247
- * \@api bookId;
248
- * \@wire(getBook, { id: '$bookId'}) book;
249
- * }
250
- */
251
- export function wire<
252
- Config extends StringKeyedRecord,
253
- Value,
254
- Context extends StringKeyedRecord = StringKeyedRecord
255
- >(
256
- adapter:
257
- | WireAdapterConstructor<Config, Value, Context>
258
- | LegacyWireAdapterConstructor<Config, Value>,
259
- config?: WireConfigValue<Config>
260
- ): PropertyDecorator;
261
-
262
- type LegacyWireAdapterConstructor<Config, Value> = (config?: Config) => Value;
263
- type WireConfigValue<Config extends StringKeyedRecord = StringKeyedRecord> = {
264
- // wire reactive variables are strings prefixed with '$' so the config value can just be string
265
- [K in keyof Config]: Config[K] | string;
266
- };
267
- type ContextValue<Context extends StringKeyedRecord = StringKeyedRecord> = Context;
268
-
269
- interface WireAdapter<Config extends StringKeyedRecord, Context extends StringKeyedRecord> {
270
- update(config: WireConfigValue<Config>, context?: ContextValue<Context>): void;
271
- connect(): void;
272
- disconnect(): void;
273
- }
274
-
275
- type WireDataCallback<Value> = (value: Value) => void;
276
- type WireAdapterSchemaValue = 'optional' | 'required';
277
-
278
- interface ContextConsumer<Context extends StringKeyedRecord> {
279
- provide(newContext: ContextValue<Context>): void;
280
- }
281
-
282
- interface ContextProviderOptions<Context extends StringKeyedRecord> {
283
- consumerConnectedCallback: (consumer: ContextConsumer<Context>) => void;
284
- consumerDisconnectedCallback?: (consumer: ContextConsumer<Context>) => void;
285
- }
286
-
287
- interface WireAdapterConstructor<
288
- Config extends StringKeyedRecord,
289
- Value,
290
- Context extends StringKeyedRecord
291
- > {
292
- new (callback: WireDataCallback<Value>): WireAdapter<Config, Context>;
293
- configSchema?: Record<keyof Config, WireAdapterSchemaValue>;
294
- contextSchema?: Record<keyof Context, WireAdapterSchemaValue>;
295
- }
296
-
297
- type Contextualizer<Context extends StringKeyedRecord> = (
298
- elm: EventTarget,
299
- options: ContextProviderOptions<Context>
300
- ) => void;
301
- export function createContextProvider<
302
- Config extends StringKeyedRecord,
303
- Value,
304
- Context extends StringKeyedRecord = StringKeyedRecord
305
- >(config: WireAdapterConstructor<Config, Value, Context>): Contextualizer<Context>;
306
- }
7
+ export * from '@lwc/engine-dom';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lwc",
3
- "version": "6.6.3",
3
+ "version": "7.0.0-alpha.0",
4
4
  "description": "Lightning Web Components (LWC)",
5
5
  "homepage": "https://lwc.dev/",
6
6
  "repository": {
@@ -20,21 +20,21 @@
20
20
  "*.d.ts"
21
21
  ],
22
22
  "dependencies": {
23
- "@lwc/aria-reflection": "6.6.3",
24
- "@lwc/babel-plugin-component": "6.6.3",
25
- "@lwc/compiler": "6.6.3",
26
- "@lwc/engine-core": "6.6.3",
27
- "@lwc/engine-dom": "6.6.3",
28
- "@lwc/engine-server": "6.6.3",
29
- "@lwc/errors": "6.6.3",
30
- "@lwc/features": "6.6.3",
31
- "@lwc/module-resolver": "6.6.3",
32
- "@lwc/rollup-plugin": "6.6.3",
33
- "@lwc/shared": "6.6.3",
34
- "@lwc/style-compiler": "6.6.3",
35
- "@lwc/synthetic-shadow": "6.6.3",
36
- "@lwc/template-compiler": "6.6.3",
37
- "@lwc/wire-service": "6.6.3"
23
+ "@lwc/aria-reflection": "7.0.0-alpha.0",
24
+ "@lwc/babel-plugin-component": "7.0.0-alpha.0",
25
+ "@lwc/compiler": "7.0.0-alpha.0",
26
+ "@lwc/engine-core": "7.0.0-alpha.0",
27
+ "@lwc/engine-dom": "7.0.0-alpha.0",
28
+ "@lwc/engine-server": "7.0.0-alpha.0",
29
+ "@lwc/errors": "7.0.0-alpha.0",
30
+ "@lwc/features": "7.0.0-alpha.0",
31
+ "@lwc/module-resolver": "7.0.0-alpha.0",
32
+ "@lwc/rollup-plugin": "7.0.0-alpha.0",
33
+ "@lwc/shared": "7.0.0-alpha.0",
34
+ "@lwc/style-compiler": "7.0.0-alpha.0",
35
+ "@lwc/synthetic-shadow": "7.0.0-alpha.0",
36
+ "@lwc/template-compiler": "7.0.0-alpha.0",
37
+ "@lwc/wire-service": "7.0.0-alpha.0"
38
38
  },
39
39
  "lwc": {
40
40
  "modules": [
@@ -70,4 +70,4 @@
70
70
  "./template-compiler": "./template-compiler.js",
71
71
  "./wire-service": "./wire-service.js"
72
72
  }
73
- }
73
+ }