@rxdi/lit-html 0.7.157 → 0.7.158

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 (95) hide show
  1. package/dist/async.d.ts +3 -3
  2. package/dist/async.js +4 -4
  3. package/dist/decorators/component.decorator.d.ts +1 -2
  4. package/dist/decorators/component.decorator.js +3 -3
  5. package/dist/index.d.ts +28 -17
  6. package/dist/index.js +28 -17
  7. package/package.json +4 -2
  8. package/dist/lit-element/decorators.d.ts +0 -14
  9. package/dist/lit-element/decorators.js +0 -32
  10. package/dist/lit-element/experimental-hydrate-support.d.ts +0 -6
  11. package/dist/lit-element/experimental-hydrate-support.js +0 -65
  12. package/dist/lit-element/index.d.ts +0 -7
  13. package/dist/lit-element/index.js +0 -25
  14. package/dist/lit-element/lit-element.d.ts +0 -157
  15. package/dist/lit-element/lit-element.js +0 -258
  16. package/dist/lit-element/polyfill-support.d.ts +0 -24
  17. package/dist/lit-element/polyfill-support.js +0 -58
  18. package/dist/lit-element/private-ssr-support.d.ts +0 -21
  19. package/dist/lit-element/private-ssr-support.js +0 -25
  20. package/dist/lit-html/async-directive.d.ts +0 -170
  21. package/dist/lit-html/async-directive.js +0 -250
  22. package/dist/lit-html/directive-helpers.d.ts +0 -105
  23. package/dist/lit-html/directive-helpers.js +0 -192
  24. package/dist/lit-html/directive.d.ts +0 -65
  25. package/dist/lit-html/directive.js +0 -52
  26. package/dist/lit-html/directives/async-append.d.ts +0 -38
  27. package/dist/lit-html/directives/async-append.js +0 -55
  28. package/dist/lit-html/directives/async-replace.d.ts +0 -39
  29. package/dist/lit-html/directives/async-replace.js +0 -112
  30. package/dist/lit-html/directives/cache.d.ts +0 -34
  31. package/dist/lit-html/directives/cache.js +0 -80
  32. package/dist/lit-html/directives/class-map.d.ts +0 -44
  33. package/dist/lit-html/directives/class-map.js +0 -92
  34. package/dist/lit-html/directives/guard.d.ts +0 -59
  35. package/dist/lit-html/directives/guard.js +0 -82
  36. package/dist/lit-html/directives/if-defined.d.ts +0 -13
  37. package/dist/lit-html/directives/if-defined.js +0 -17
  38. package/dist/lit-html/directives/live.d.ts +0 -42
  39. package/dist/lit-html/directives/live.js +0 -79
  40. package/dist/lit-html/directives/private-async-helpers.d.ts +0 -57
  41. package/dist/lit-html/directives/private-async-helpers.js +0 -117
  42. package/dist/lit-html/directives/ref.d.ts +0 -65
  43. package/dist/lit-html/directives/ref.js +0 -113
  44. package/dist/lit-html/directives/repeat.d.ts +0 -63
  45. package/dist/lit-html/directives/repeat.js +0 -416
  46. package/dist/lit-html/directives/style-map.d.ts +0 -46
  47. package/dist/lit-html/directives/style-map.js +0 -102
  48. package/dist/lit-html/directives/template-content.d.ts +0 -25
  49. package/dist/lit-html/directives/template-content.js +0 -33
  50. package/dist/lit-html/directives/unsafe-html.d.ts +0 -26
  51. package/dist/lit-html/directives/unsafe-html.js +0 -64
  52. package/dist/lit-html/directives/unsafe-svg.d.ts +0 -26
  53. package/dist/lit-html/directives/unsafe-svg.js +0 -26
  54. package/dist/lit-html/directives/until.d.ts +0 -43
  55. package/dist/lit-html/directives/until.js +0 -137
  56. package/dist/lit-html/experimental-hydrate.d.ts +0 -50
  57. package/dist/lit-html/experimental-hydrate.js +0 -322
  58. package/dist/lit-html/lit-html.d.ts +0 -335
  59. package/dist/lit-html/lit-html.js +0 -1259
  60. package/dist/lit-html/polyfill-support.d.ts +0 -67
  61. package/dist/lit-html/polyfill-support.js +0 -185
  62. package/dist/lit-html/private-ssr-support.d.ts +0 -52
  63. package/dist/lit-html/private-ssr-support.js +0 -54
  64. package/dist/lit-html/static.d.ts +0 -58
  65. package/dist/lit-html/static.js +0 -114
  66. package/dist/reactive-element/css-tag.d.ts +0 -64
  67. package/dist/reactive-element/css-tag.js +0 -125
  68. package/dist/reactive-element/decorators/base.d.ts +0 -47
  69. package/dist/reactive-element/decorators/base.js +0 -70
  70. package/dist/reactive-element/decorators/custom-element.d.ts +0 -26
  71. package/dist/reactive-element/decorators/custom-element.js +0 -47
  72. package/dist/reactive-element/decorators/event-options.d.ts +0 -37
  73. package/dist/reactive-element/decorators/event-options.js +0 -47
  74. package/dist/reactive-element/decorators/index.d.ts +0 -14
  75. package/dist/reactive-element/decorators/index.js +0 -32
  76. package/dist/reactive-element/decorators/property.d.ts +0 -40
  77. package/dist/reactive-element/decorators/property.js +0 -92
  78. package/dist/reactive-element/decorators/query-all.d.ts +0 -31
  79. package/dist/reactive-element/decorators/query-all.js +0 -46
  80. package/dist/reactive-element/decorators/query-assigned-nodes.d.ts +0 -33
  81. package/dist/reactive-element/decorators/query-assigned-nodes.js +0 -55
  82. package/dist/reactive-element/decorators/query-async.d.ts +0 -39
  83. package/dist/reactive-element/decorators/query-async.js +0 -71
  84. package/dist/reactive-element/decorators/query.d.ts +0 -32
  85. package/dist/reactive-element/decorators/query.js +0 -60
  86. package/dist/reactive-element/decorators/state.d.ts +0 -24
  87. package/dist/reactive-element/decorators/state.js +0 -29
  88. package/dist/reactive-element/index.d.ts +0 -5
  89. package/dist/reactive-element/index.js +0 -17
  90. package/dist/reactive-element/polyfill-support.d.ts +0 -40
  91. package/dist/reactive-element/polyfill-support.js +0 -89
  92. package/dist/reactive-element/reactive-controller.d.ts +0 -76
  93. package/dist/reactive-element/reactive-controller.js +0 -7
  94. package/dist/reactive-element/reactive-element.d.ts +0 -653
  95. package/dist/reactive-element/reactive-element.js +0 -979
@@ -1,335 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2017 Google LLC
4
- * SPDX-License-Identifier: BSD-3-Clause
5
- */
6
- import type { Directive } from './directive';
7
- /**
8
- * Used to sanitize any value before it is written into the DOM. This can be
9
- * used to implement a security policy of allowed and disallowed values in
10
- * order to prevent XSS attacks.
11
- *
12
- * One way of using this callback would be to check attributes and properties
13
- * against a list of high risk fields, and require that values written to such
14
- * fields be instances of a class which is safe by construction. Closure's Safe
15
- * HTML Types is one implementation of this technique (
16
- * https://github.com/google/safe-html-types/blob/master/doc/safehtml-types.md).
17
- * The TrustedTypes polyfill in API-only mode could also be used as a basis
18
- * for this technique (https://github.com/WICG/trusted-types).
19
- *
20
- * @param node The HTML node (usually either a #text node or an Element) that
21
- * is being written to. Note that this is just an exemplar node, the write
22
- * may take place against another instance of the same class of node.
23
- * @param name The name of an attribute or property (for example, 'href').
24
- * @param type Indicates whether the write that's about to be performed will
25
- * be to a property or a node.
26
- * @return A function that will sanitize this class of writes.
27
- */
28
- export declare type SanitizerFactory = (node: Node, name: string, type: 'property' | 'attribute') => ValueSanitizer;
29
- /**
30
- * A function which can sanitize values that will be written to a specific kind
31
- * of DOM sink.
32
- *
33
- * See SanitizerFactory.
34
- *
35
- * @param value The value to sanitize. Will be the actual value passed into
36
- * the lit-html template literal, so this could be of any type.
37
- * @return The value to write to the DOM. Usually the same as the input value,
38
- * unless sanitization is needed.
39
- */
40
- export declare type ValueSanitizer = (value: unknown) => unknown;
41
- /** TemplateResult types */
42
- declare const HTML_RESULT = 1;
43
- declare const SVG_RESULT = 2;
44
- declare type ResultType = typeof HTML_RESULT | typeof SVG_RESULT;
45
- /**
46
- * The return type of the template tag functions.
47
- */
48
- export declare type TemplateResult<T extends ResultType = ResultType> = {
49
- ['_$litType$']: T;
50
- strings: TemplateStringsArray;
51
- values: unknown[];
52
- };
53
- export declare type HTMLTemplateResult = TemplateResult<typeof HTML_RESULT>;
54
- export declare type SVGTemplateResult = TemplateResult<typeof SVG_RESULT>;
55
- export interface CompiledTemplateResult {
56
- ['_$litType$']: CompiledTemplate;
57
- values: unknown[];
58
- }
59
- export interface CompiledTemplate extends Omit<Template, 'el'> {
60
- el?: HTMLTemplateElement;
61
- h: any;
62
- }
63
- /**
64
- * Interprets a template literal as an HTML template that can efficiently
65
- * render to and update a container.
66
- *
67
- * ```ts
68
- * const header = (title: string) => html`<h1>${title}</h1>`;
69
- * ```
70
- *
71
- * The `html` tag returns a description of the DOM to render as a value. It is
72
- * lazy, meaning no work is done until the template is rendered. When rendering,
73
- * if a template comes from the same expression as a previously rendered result,
74
- * it's efficiently updated instead of replaced.
75
- */
76
- export declare const html: (strings: TemplateStringsArray, ...values: unknown[]) => TemplateResult<1>;
77
- /**
78
- * Interprets a template literal as an SVG template that can efficiently
79
- * render to and update a container.
80
- */
81
- export declare const svg: (strings: TemplateStringsArray, ...values: unknown[]) => TemplateResult<2>;
82
- /**
83
- * A sentinel value that signals that a value was handled by a directive and
84
- * should not be written to the DOM.
85
- */
86
- export declare const noChange: unique symbol;
87
- /**
88
- * A sentinel value that signals a ChildPart to fully clear its content.
89
- *
90
- * ```ts
91
- * const button = html`${
92
- * user.isAdmin
93
- * ? html`<button>DELETE</button>`
94
- * : nothing
95
- * }`;
96
- * ```
97
- *
98
- * Prefer using `nothing` over other falsy values as it provides a consistent
99
- * behavior between various expression binding contexts.
100
- *
101
- * In child expressions, `undefined`, `null`, `''`, and `nothing` all behave the
102
- * same and render no nodes. In attribute expressions, `nothing` _removes_ the
103
- * attribute, while `undefined` and `null` will render an empty string. In
104
- * property expressions `nothing` becomes `undefined`.
105
- */
106
- export declare const nothing: unique symbol;
107
- /**
108
- * Object specifying options for controlling lit-html rendering. Note that
109
- * while `render` may be called multiple times on the same `container` (and
110
- * `renderBefore` reference node) to efficiently update the rendered content,
111
- * only the options passed in during the first render are respected during
112
- * the lifetime of renders to that unique `container` + `renderBefore`
113
- * combination.
114
- */
115
- export interface RenderOptions {
116
- /**
117
- * An object to use as the `this` value for event listeners. It's often
118
- * useful to set this to the host component rendering a template.
119
- */
120
- host?: object;
121
- /**
122
- * A DOM node before which to render content in the container.
123
- */
124
- renderBefore?: ChildNode | null;
125
- /**
126
- * Node used for cloning the template (`importNode` will be called on this
127
- * node). This controls the `ownerDocument` of the rendered DOM, along with
128
- * any inherited context. Defaults to the global `document`.
129
- */
130
- creationScope?: {
131
- importNode(node: Node, deep?: boolean): Node;
132
- };
133
- /**
134
- * The initial connected state for the top-level part being rendered. If no
135
- * `isConnected` option is set, `AsyncDirective`s will be connected by
136
- * default. Set to `false` if the initial render occurs in a disconnected tree
137
- * and `AsyncDirective`s should see `isConnected === false` for their initial
138
- * render. The `part.setConnected()` method must be used subsequent to initial
139
- * render to change the connected state of the part.
140
- */
141
- isConnected?: boolean;
142
- }
143
- /**
144
- * Renders a value, usually a lit-html TemplateResult, to the container.
145
- * @param value
146
- * @param container
147
- * @param options
148
- */
149
- export declare const render: {
150
- (value: unknown, container: HTMLElement | DocumentFragment, options?: RenderOptions): RootPart;
151
- setSanitizer: (newSanitizer: SanitizerFactory) => void;
152
- createSanitizer: SanitizerFactory;
153
- _testOnlyClearSanitizerFactoryDoNotCallOrElse: () => void;
154
- };
155
- export interface DirectiveParent {
156
- _$parent?: DirectiveParent;
157
- _$isConnected: boolean;
158
- __directive?: Directive;
159
- __directives?: Array<Directive | undefined>;
160
- }
161
- declare class Template {
162
- constructor({ strings, ['_$litType$']: type }: TemplateResult, options?: RenderOptions);
163
- /** @nocollapse */
164
- static createElement(html: any, _options?: RenderOptions): HTMLTemplateElement;
165
- }
166
- export interface Disconnectable {
167
- _$parent?: Disconnectable;
168
- _$disconnectableChildren?: Set<Disconnectable>;
169
- _$isConnected: boolean;
170
- }
171
- declare function resolveDirective(part: ChildPart | AttributePart | ElementPart, value: unknown, parent?: DirectiveParent, attributeIndex?: number): unknown;
172
- /**
173
- * An updateable instance of a Template. Holds references to the Parts used to
174
- * update the template instance.
175
- */
176
- declare class TemplateInstance implements Disconnectable {
177
- constructor(template: Template, parent: ChildPart);
178
- get parentNode(): Node;
179
- get _$isConnected(): boolean;
180
- _clone(options: RenderOptions | undefined): Node;
181
- _update(values: Array<unknown>): void;
182
- }
183
- export declare type Part = ChildPart | AttributePart | PropertyPart | BooleanAttributePart | ElementPart | EventPart;
184
- export type { ChildPart };
185
- declare class ChildPart implements Disconnectable {
186
- readonly type = 2;
187
- readonly options: RenderOptions | undefined;
188
- _$committedValue: unknown;
189
- private _textSanitizer;
190
- get _$isConnected(): boolean;
191
- constructor(startNode: ChildNode, endNode: ChildNode | null, parent: TemplateInstance | ChildPart | undefined, options: RenderOptions | undefined);
192
- /**
193
- * The parent node into which the part renders its content.
194
- *
195
- * A ChildPart's content consists of a range of adjacent child nodes of
196
- * `.parentNode`, possibly bordered by 'marker nodes' (`.startNode` and
197
- * `.endNode`).
198
- *
199
- * - If both `.startNode` and `.endNode` are non-null, then the part's content
200
- * consists of all siblings between `.startNode` and `.endNode`, exclusively.
201
- *
202
- * - If `.startNode` is non-null but `.endNode` is null, then the part's
203
- * content consists of all siblings following `.startNode`, up to and
204
- * including the last child of `.parentNode`. If `.endNode` is non-null, then
205
- * `.startNode` will always be non-null.
206
- *
207
- * - If both `.endNode` and `.startNode` are null, then the part's content
208
- * consists of all child nodes of `.parentNode`.
209
- */
210
- get parentNode(): Node;
211
- /**
212
- * The part's leading marker node, if any. See `.parentNode` for more
213
- * information.
214
- */
215
- get startNode(): Node | null;
216
- /**
217
- * The part's trailing marker node, if any. See `.parentNode` for more
218
- * information.
219
- */
220
- get endNode(): Node | null;
221
- _$setValue(value: unknown, directiveParent?: DirectiveParent): void;
222
- private _insert;
223
- private _commitNode;
224
- private _commitText;
225
- private _commitTemplateResult;
226
- private _commitIterable;
227
- }
228
- /**
229
- * A top-level `ChildPart` returned from `render` that manages the connected
230
- * state of `AsyncDirective`s created throughout the tree below it.
231
- */
232
- export interface RootPart extends ChildPart {
233
- /**
234
- * Sets the connection state for `AsyncDirective`s contained within this root
235
- * ChildPart.
236
- *
237
- * lit-html does not automatically monitor the connectedness of DOM rendered;
238
- * as such, it is the responsibility of the caller to `render` to ensure that
239
- * `part.setConnected(false)` is called before the part object is potentially
240
- * discarded, to ensure that `AsyncDirective`s have a chance to dispose of
241
- * any resources being held. If a `RootPart` that was prevously
242
- * disconnected is subsequently re-connected (and its `AsyncDirective`s should
243
- * re-connect), `setConnected(true)` should be called.
244
- *
245
- * @param isConnected Whether directives within this tree should be connected
246
- * or not
247
- */
248
- setConnected(isConnected: boolean): void;
249
- }
250
- export type { AttributePart };
251
- declare class AttributePart implements Disconnectable {
252
- readonly type: 1 | 3 | 4 | 5;
253
- readonly element: HTMLElement;
254
- readonly name: string;
255
- readonly options: RenderOptions | undefined;
256
- /**
257
- * If this attribute part represents an interpolation, this contains the
258
- * static strings of the interpolation. For single-value, complete bindings,
259
- * this is undefined.
260
- */
261
- readonly strings?: ReadonlyArray<string>;
262
- protected _sanitizer: ValueSanitizer | undefined;
263
- get tagName(): string;
264
- get _$isConnected(): boolean;
265
- constructor(element: HTMLElement, name: string, strings: ReadonlyArray<string>, parent: Disconnectable, options: RenderOptions | undefined);
266
- }
267
- export type { PropertyPart };
268
- declare class PropertyPart extends AttributePart {
269
- readonly type = 3;
270
- }
271
- export type { BooleanAttributePart };
272
- declare class BooleanAttributePart extends AttributePart {
273
- readonly type = 4;
274
- }
275
- /**
276
- * An AttributePart that manages an event listener via add/removeEventListener.
277
- *
278
- * This part works by adding itself as the event listener on an element, then
279
- * delegating to the value passed to it. This reduces the number of calls to
280
- * add/removeEventListener if the listener changes frequently, such as when an
281
- * inline function is used as a listener.
282
- *
283
- * Because event options are passed when adding listeners, we must take case
284
- * to add and remove the part as a listener when the event options change.
285
- */
286
- export type { EventPart };
287
- declare class EventPart extends AttributePart {
288
- readonly type = 5;
289
- constructor(element: HTMLElement, name: string, strings: ReadonlyArray<string>, parent: Disconnectable, options: RenderOptions | undefined);
290
- handleEvent(event: Event): void;
291
- }
292
- export type { ElementPart };
293
- declare class ElementPart implements Disconnectable {
294
- element: Element;
295
- readonly type = 6;
296
- _$committedValue: undefined;
297
- options: RenderOptions | undefined;
298
- constructor(element: Element, parent: Disconnectable, options: RenderOptions | undefined);
299
- get _$isConnected(): boolean;
300
- _$setValue(value: unknown): void;
301
- }
302
- /**
303
- * END USERS SHOULD NOT RELY ON THIS OBJECT.
304
- *
305
- * Private exports for use by other Lit packages, not intended for use by
306
- * external users.
307
- *
308
- * We currently do not make a mangled rollup build of the lit-ssr code. In order
309
- * to keep a number of (otherwise private) top-level exports mangled in the
310
- * client side code, we export a _$LH object containing those members (or
311
- * helper methods for accessing private fields of those members), and then
312
- * re-export them for use in lit-ssr. This keeps lit-ssr agnostic to whether the
313
- * client-side code is being used in `dev` mode or `prod` mode.
314
- *
315
- * This has a unique name, to disambiguate it from private exports in
316
- * lit-element, which re-exports all of lit-html.
317
- *
318
- * @private
319
- */
320
- export declare const _$LH: {
321
- _boundAttributeSuffix: string;
322
- _marker: string;
323
- _markerMatch: string;
324
- _HTML_RESULT: number;
325
- _getTemplateHtml: (strings: TemplateStringsArray, type: ResultType) => [any, Array<string | undefined>];
326
- _TemplateInstance: typeof TemplateInstance;
327
- _isIterable: (value: unknown) => value is Iterable<unknown>;
328
- _resolveDirective: typeof resolveDirective;
329
- _ChildPart: typeof ChildPart;
330
- _AttributePart: typeof AttributePart;
331
- _BooleanAttributePart: typeof BooleanAttributePart;
332
- _EventPart: typeof EventPart;
333
- _PropertyPart: typeof PropertyPart;
334
- _ElementPart: typeof ElementPart;
335
- };