@microsoft/fast-html 1.0.0-alpha.4 → 1.0.0-alpha.40

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 (68) hide show
  1. package/README.md +242 -18
  2. package/dist/dts/components/element.d.ts +10 -0
  3. package/dist/dts/components/index.d.ts +3 -1
  4. package/dist/dts/components/observer-map.d.ts +27 -0
  5. package/dist/dts/components/schema.d.ts +144 -0
  6. package/dist/dts/components/template.d.ts +83 -7
  7. package/dist/dts/components/utilities.d.ts +126 -37
  8. package/dist/dts/index.d.ts +1 -1
  9. package/dist/dts/tsdoc-metadata.json +1 -1
  10. package/dist/esm/components/element.js +73 -0
  11. package/dist/esm/components/index.js +3 -1
  12. package/dist/esm/components/observer-map.js +68 -0
  13. package/dist/esm/components/observer-map.spec.js +39 -0
  14. package/dist/esm/components/schema.js +250 -0
  15. package/dist/esm/components/schema.spec.js +484 -0
  16. package/dist/esm/components/template.js +235 -213
  17. package/dist/esm/components/utilities.js +990 -64
  18. package/dist/esm/components/utilities.spec.js +522 -93
  19. package/dist/esm/index.js +1 -1
  20. package/dist/fast-html.api.json +350 -1
  21. package/dist/fast-html.d.ts +283 -6
  22. package/dist/fast-html.untrimmed.d.ts +283 -6
  23. package/package.json +27 -38
  24. package/rules/attribute-directives.yml +38 -0
  25. package/rules/call-expression-with-event-argument.yml +41 -0
  26. package/rules/member-expression.yml +33 -0
  27. package/rules/tag-function-to-template-literal.yml +16 -0
  28. package/dist/dts/fixtures/binding/binding.spec.d.ts +0 -1
  29. package/dist/dts/fixtures/binding/main.d.ts +0 -1
  30. package/dist/dts/fixtures/children/children.spec.d.ts +0 -1
  31. package/dist/dts/fixtures/children/main.d.ts +0 -1
  32. package/dist/dts/fixtures/dot-syntax/dot-syntax.spec.d.ts +0 -1
  33. package/dist/dts/fixtures/dot-syntax/main.d.ts +0 -1
  34. package/dist/dts/fixtures/event/event.spec.d.ts +0 -1
  35. package/dist/dts/fixtures/event/main.d.ts +0 -1
  36. package/dist/dts/fixtures/partial/main.d.ts +0 -1
  37. package/dist/dts/fixtures/partial/partial.spec.d.ts +0 -1
  38. package/dist/dts/fixtures/ref/main.d.ts +0 -1
  39. package/dist/dts/fixtures/ref/ref.spec.d.ts +0 -1
  40. package/dist/dts/fixtures/repeat/main.d.ts +0 -1
  41. package/dist/dts/fixtures/repeat/repeat.spec.d.ts +0 -1
  42. package/dist/dts/fixtures/slotted/main.d.ts +0 -1
  43. package/dist/dts/fixtures/slotted/slotted.spec.d.ts +0 -1
  44. package/dist/dts/fixtures/when/main.d.ts +0 -1
  45. package/dist/dts/fixtures/when/when.spec.d.ts +0 -1
  46. package/dist/esm/fixtures/attribute/attribute.spec.js +0 -23
  47. package/dist/esm/fixtures/attribute/main.js +0 -19
  48. package/dist/esm/fixtures/binding/binding.spec.js +0 -17
  49. package/dist/esm/fixtures/binding/main.js +0 -19
  50. package/dist/esm/fixtures/children/children.spec.js +0 -33
  51. package/dist/esm/fixtures/children/main.js +0 -24
  52. package/dist/esm/fixtures/dot-syntax/dot-syntax.spec.js +0 -9
  53. package/dist/esm/fixtures/dot-syntax/main.js +0 -16
  54. package/dist/esm/fixtures/event/event.spec.js +0 -12
  55. package/dist/esm/fixtures/event/main.js +0 -16
  56. package/dist/esm/fixtures/partial/main.js +0 -31
  57. package/dist/esm/fixtures/partial/partial.spec.js +0 -14
  58. package/dist/esm/fixtures/ref/main.js +0 -14
  59. package/dist/esm/fixtures/ref/ref.spec.js +0 -13
  60. package/dist/esm/fixtures/repeat/main.js +0 -19
  61. package/dist/esm/fixtures/repeat/repeat.spec.js +0 -26
  62. package/dist/esm/fixtures/slotted/main.js +0 -22
  63. package/dist/esm/fixtures/slotted/slotted.spec.js +0 -25
  64. package/dist/esm/fixtures/when/main.js +0 -146
  65. package/dist/esm/fixtures/when/when.spec.js +0 -82
  66. package/dist/esm/tsconfig.tsbuildinfo +0 -1
  67. /package/dist/dts/{fixtures/attribute/attribute.spec.d.ts → components/observer-map.spec.d.ts} +0 -0
  68. /package/dist/dts/{fixtures/attribute/main.d.ts → components/schema.spec.d.ts} +0 -0
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
1
  import { FAST } from "@microsoft/fast-element";
2
2
  import { debugMessages } from "./debug.js";
3
3
  FAST.addMessages(debugMessages);
4
- export { TemplateElement } from "./components/index.js";
4
+ export { RenderableFASTElement, TemplateElement, ObserverMap, } from "./components/index.js";
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "metadata": {
3
3
  "toolPackage": "@microsoft/api-extractor",
4
- "toolVersion": "7.47.0",
4
+ "toolVersion": "7.57.7",
5
5
  "schemaVersion": 1011,
6
6
  "oldestForwardsCompatibleVersion": 1001,
7
7
  "tsdocConfig": {
@@ -114,6 +114,22 @@
114
114
  "tagName": "@virtual",
115
115
  "syntaxKind": "modifier"
116
116
  },
117
+ {
118
+ "tagName": "@jsx",
119
+ "syntaxKind": "block"
120
+ },
121
+ {
122
+ "tagName": "@jsxRuntime",
123
+ "syntaxKind": "block"
124
+ },
125
+ {
126
+ "tagName": "@jsxFrag",
127
+ "syntaxKind": "block"
128
+ },
129
+ {
130
+ "tagName": "@jsxImportSource",
131
+ "syntaxKind": "block"
132
+ },
117
133
  {
118
134
  "tagName": "@betaDocumentation",
119
135
  "syntaxKind": "modifier"
@@ -172,6 +188,185 @@
172
188
  "name": "",
173
189
  "preserveMemberOrder": false,
174
190
  "members": [
191
+ {
192
+ "kind": "Class",
193
+ "canonicalReference": "@microsoft/fast-html!ObserverMap:class",
194
+ "docComment": "/**\n * ObserverMap provides functionality for caching binding paths, extracting root properties, and defining observable properties on class prototypes\n */\n",
195
+ "excerptTokens": [
196
+ {
197
+ "kind": "Content",
198
+ "text": "export declare class ObserverMap "
199
+ }
200
+ ],
201
+ "fileUrlPath": "dist/dts/components/observer-map.d.ts",
202
+ "releaseTag": "Public",
203
+ "isAbstract": false,
204
+ "name": "ObserverMap",
205
+ "preserveMemberOrder": false,
206
+ "members": [
207
+ {
208
+ "kind": "Constructor",
209
+ "canonicalReference": "@microsoft/fast-html!ObserverMap:constructor(1)",
210
+ "docComment": "/**\n * Constructs a new instance of the `ObserverMap` class\n */\n",
211
+ "excerptTokens": [
212
+ {
213
+ "kind": "Content",
214
+ "text": "constructor(classPrototype: "
215
+ },
216
+ {
217
+ "kind": "Content",
218
+ "text": "any"
219
+ },
220
+ {
221
+ "kind": "Content",
222
+ "text": ", schema: "
223
+ },
224
+ {
225
+ "kind": "Reference",
226
+ "text": "Schema",
227
+ "canonicalReference": "@microsoft/fast-html!~Schema:class"
228
+ },
229
+ {
230
+ "kind": "Content",
231
+ "text": ");"
232
+ }
233
+ ],
234
+ "releaseTag": "Public",
235
+ "isProtected": false,
236
+ "overloadIndex": 1,
237
+ "parameters": [
238
+ {
239
+ "parameterName": "classPrototype",
240
+ "parameterTypeTokenRange": {
241
+ "startIndex": 1,
242
+ "endIndex": 2
243
+ },
244
+ "isOptional": false
245
+ },
246
+ {
247
+ "parameterName": "schema",
248
+ "parameterTypeTokenRange": {
249
+ "startIndex": 3,
250
+ "endIndex": 4
251
+ },
252
+ "isOptional": false
253
+ }
254
+ ]
255
+ },
256
+ {
257
+ "kind": "Method",
258
+ "canonicalReference": "@microsoft/fast-html!ObserverMap#defineProperties:member(1)",
259
+ "docComment": "",
260
+ "excerptTokens": [
261
+ {
262
+ "kind": "Content",
263
+ "text": "defineProperties(): "
264
+ },
265
+ {
266
+ "kind": "Content",
267
+ "text": "void"
268
+ },
269
+ {
270
+ "kind": "Content",
271
+ "text": ";"
272
+ }
273
+ ],
274
+ "isStatic": false,
275
+ "returnTypeTokenRange": {
276
+ "startIndex": 1,
277
+ "endIndex": 2
278
+ },
279
+ "releaseTag": "Public",
280
+ "isProtected": false,
281
+ "overloadIndex": 1,
282
+ "parameters": [],
283
+ "isOptional": false,
284
+ "isAbstract": false,
285
+ "name": "defineProperties"
286
+ }
287
+ ],
288
+ "implementsTokenRanges": []
289
+ },
290
+ {
291
+ "kind": "Function",
292
+ "canonicalReference": "@microsoft/fast-html!RenderableFASTElement:function(1)",
293
+ "docComment": "/**\n * A mixin function that extends a base class with additional functionality for rendering and hydration.\n *\n * @param BaseCtor - The base class to extend.\n *\n * @returns A new class that extends the provided base class with additional functionality for rendering and hydration.\n *\n * @public\n */\n",
294
+ "excerptTokens": [
295
+ {
296
+ "kind": "Content",
297
+ "text": "export declare function RenderableFASTElement<T extends "
298
+ },
299
+ {
300
+ "kind": "Reference",
301
+ "text": "Constructable",
302
+ "canonicalReference": "@microsoft/fast-element!Constructable:type"
303
+ },
304
+ {
305
+ "kind": "Content",
306
+ "text": "<"
307
+ },
308
+ {
309
+ "kind": "Reference",
310
+ "text": "FASTElement",
311
+ "canonicalReference": "@microsoft/fast-element!FASTElement:interface"
312
+ },
313
+ {
314
+ "kind": "Content",
315
+ "text": ">"
316
+ },
317
+ {
318
+ "kind": "Content",
319
+ "text": ">(BaseCtor: "
320
+ },
321
+ {
322
+ "kind": "Content",
323
+ "text": "T"
324
+ },
325
+ {
326
+ "kind": "Content",
327
+ "text": "): "
328
+ },
329
+ {
330
+ "kind": "Content",
331
+ "text": "T"
332
+ },
333
+ {
334
+ "kind": "Content",
335
+ "text": ";"
336
+ }
337
+ ],
338
+ "fileUrlPath": "dist/dts/components/element.d.ts",
339
+ "returnTypeTokenRange": {
340
+ "startIndex": 8,
341
+ "endIndex": 9
342
+ },
343
+ "releaseTag": "Public",
344
+ "overloadIndex": 1,
345
+ "parameters": [
346
+ {
347
+ "parameterName": "BaseCtor",
348
+ "parameterTypeTokenRange": {
349
+ "startIndex": 6,
350
+ "endIndex": 7
351
+ },
352
+ "isOptional": false
353
+ }
354
+ ],
355
+ "typeParameters": [
356
+ {
357
+ "typeParameterName": "T",
358
+ "constraintTokenRange": {
359
+ "startIndex": 1,
360
+ "endIndex": 5
361
+ },
362
+ "defaultTypeTokenRange": {
363
+ "startIndex": 0,
364
+ "endIndex": 0
365
+ }
366
+ }
367
+ ],
368
+ "name": "RenderableFASTElement"
369
+ },
175
370
  {
176
371
  "kind": "Class",
177
372
  "canonicalReference": "@microsoft/fast-html!TemplateElement:class",
@@ -197,6 +392,75 @@
197
392
  "name": "TemplateElement",
198
393
  "preserveMemberOrder": false,
199
394
  "members": [
395
+ {
396
+ "kind": "Constructor",
397
+ "canonicalReference": "@microsoft/fast-html!TemplateElement:constructor(1)",
398
+ "docComment": "/**\n * Constructs a new instance of the `TemplateElement` class\n */\n",
399
+ "excerptTokens": [
400
+ {
401
+ "kind": "Content",
402
+ "text": "constructor();"
403
+ }
404
+ ],
405
+ "releaseTag": "Public",
406
+ "isProtected": false,
407
+ "overloadIndex": 1,
408
+ "parameters": []
409
+ },
410
+ {
411
+ "kind": "Method",
412
+ "canonicalReference": "@microsoft/fast-html!TemplateElement.config:member(1)",
413
+ "docComment": "/**\n * Configure lifecycle callbacks for hydration events.\n *\n * @param callbacks - Lifecycle callbacks to configure.\n *\n * @returns The {@link TemplateElement} class.\n */\n",
414
+ "excerptTokens": [
415
+ {
416
+ "kind": "Content",
417
+ "text": "static config(callbacks: "
418
+ },
419
+ {
420
+ "kind": "Reference",
421
+ "text": "HydrationLifecycleCallbacks",
422
+ "canonicalReference": "@microsoft/fast-html!~HydrationLifecycleCallbacks:interface"
423
+ },
424
+ {
425
+ "kind": "Content",
426
+ "text": "): "
427
+ },
428
+ {
429
+ "kind": "Content",
430
+ "text": "typeof "
431
+ },
432
+ {
433
+ "kind": "Reference",
434
+ "text": "TemplateElement",
435
+ "canonicalReference": "@microsoft/fast-html!TemplateElement:class"
436
+ },
437
+ {
438
+ "kind": "Content",
439
+ "text": ";"
440
+ }
441
+ ],
442
+ "isStatic": true,
443
+ "returnTypeTokenRange": {
444
+ "startIndex": 3,
445
+ "endIndex": 5
446
+ },
447
+ "releaseTag": "Public",
448
+ "isProtected": false,
449
+ "overloadIndex": 1,
450
+ "parameters": [
451
+ {
452
+ "parameterName": "callbacks",
453
+ "parameterTypeTokenRange": {
454
+ "startIndex": 1,
455
+ "endIndex": 2
456
+ },
457
+ "isOptional": false
458
+ }
459
+ ],
460
+ "isOptional": false,
461
+ "isAbstract": false,
462
+ "name": "config"
463
+ },
200
464
  {
201
465
  "kind": "Method",
202
466
  "canonicalReference": "@microsoft/fast-html!TemplateElement#connectedCallback:member(1)",
@@ -228,6 +492,37 @@
228
492
  "isAbstract": false,
229
493
  "name": "connectedCallback"
230
494
  },
495
+ {
496
+ "kind": "Property",
497
+ "canonicalReference": "@microsoft/fast-html!TemplateElement.elementOptions:member",
498
+ "docComment": "/**\n * A dictionary of custom element options\n */\n",
499
+ "excerptTokens": [
500
+ {
501
+ "kind": "Content",
502
+ "text": "static elementOptions: "
503
+ },
504
+ {
505
+ "kind": "Reference",
506
+ "text": "ElementOptionsDictionary",
507
+ "canonicalReference": "@microsoft/fast-html!~ElementOptionsDictionary:interface"
508
+ },
509
+ {
510
+ "kind": "Content",
511
+ "text": ";"
512
+ }
513
+ ],
514
+ "isReadonly": false,
515
+ "isOptional": false,
516
+ "releaseTag": "Public",
517
+ "name": "elementOptions",
518
+ "propertyTypeTokenRange": {
519
+ "startIndex": 1,
520
+ "endIndex": 2
521
+ },
522
+ "isStatic": true,
523
+ "isProtected": false,
524
+ "isAbstract": false
525
+ },
231
526
  {
232
527
  "kind": "Property",
233
528
  "canonicalReference": "@microsoft/fast-html!TemplateElement#name:member",
@@ -257,6 +552,60 @@
257
552
  "isStatic": false,
258
553
  "isProtected": false,
259
554
  "isAbstract": false
555
+ },
556
+ {
557
+ "kind": "Method",
558
+ "canonicalReference": "@microsoft/fast-html!TemplateElement.options:member(1)",
559
+ "docComment": "/**\n * Set options for custom elements.\n *\n * @param elementOptions - A dictionary of custom element options\n *\n * @returns The TemplateElement class.\n */\n",
560
+ "excerptTokens": [
561
+ {
562
+ "kind": "Content",
563
+ "text": "static options(elementOptions?: "
564
+ },
565
+ {
566
+ "kind": "Reference",
567
+ "text": "ElementOptionsDictionary",
568
+ "canonicalReference": "@microsoft/fast-html!~ElementOptionsDictionary:interface"
569
+ },
570
+ {
571
+ "kind": "Content",
572
+ "text": "): "
573
+ },
574
+ {
575
+ "kind": "Content",
576
+ "text": "typeof "
577
+ },
578
+ {
579
+ "kind": "Reference",
580
+ "text": "TemplateElement",
581
+ "canonicalReference": "@microsoft/fast-html!TemplateElement:class"
582
+ },
583
+ {
584
+ "kind": "Content",
585
+ "text": ";"
586
+ }
587
+ ],
588
+ "isStatic": true,
589
+ "returnTypeTokenRange": {
590
+ "startIndex": 3,
591
+ "endIndex": 5
592
+ },
593
+ "releaseTag": "Public",
594
+ "isProtected": false,
595
+ "overloadIndex": 1,
596
+ "parameters": [
597
+ {
598
+ "parameterName": "elementOptions",
599
+ "parameterTypeTokenRange": {
600
+ "startIndex": 1,
601
+ "endIndex": 2
602
+ },
603
+ "isOptional": true
604
+ }
605
+ ],
606
+ "isOptional": false,
607
+ "isAbstract": false,
608
+ "name": "options"
260
609
  }
261
610
  ],
262
611
  "extendsTokenRange": {