-
Notifications
You must be signed in to change notification settings - Fork 8
/
index.html
851 lines (733 loc) · 48.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<title>X-Tag - Web Components Library</title>
<link rel="icon" type="image/png" href="site/images/favicon.png?r2" />
<link href='https://fonts.googleapis.com/css?family=Karla|Overpass' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="site/css/global.css" />
<link rel="stylesheet" href="site/css/prism.css" />
</head>
<body>
<script src="site/js/routing.js"></script>
<svg id="svg_source">
<defs>
<symbol id="twitter" width="100%" height="1em" viewBox="0 0 32 32">
<path d="M32 7.075c-1.175 0.525-2.444 0.875-3.769 1.031 1.356-0.813 2.394-2.1 2.887-3.631-1.269 0.75-2.675 1.3-4.169 1.594-1.2-1.275-2.906-2.069-4.794-2.069-3.625 0-6.563 2.938-6.563 6.563 0 0.512 0.056 1.012 0.169 1.494-5.456-0.275-10.294-2.888-13.531-6.862-0.563 0.969-0.887 2.1-0.887 3.3 0 2.275 1.156 4.287 2.919 5.463-1.075-0.031-2.087-0.331-2.975-0.819 0 0.025 0 0.056 0 0.081 0 3.181 2.263 5.838 5.269 6.437-0.55 0.15-1.131 0.231-1.731 0.231-0.425 0-0.831-0.044-1.237-0.119 0.838 2.606 3.263 4.506 6.131 4.563-2.25 1.762-5.075 2.813-8.156 2.813-0.531 0-1.050-0.031-1.569-0.094 2.913 1.869 6.362 2.95 10.069 2.95 12.075 0 18.681-10.006 18.681-18.681 0-0.287-0.006-0.569-0.019-0.85 1.281-0.919 2.394-2.075 3.275-3.394z"></path>
</symbol>
<symbol id="people" width="100%" height="1em" viewBox="0 0 28 32">
<path fill="inherit" d="M24 12h-20c-2.208 0-4 1.792-4 4v2c0 1.477 0.808 2.752 2 3.445v6.555h8v4h8v-4h8v-6.555c1.191-0.693 2-1.967 2-3.445v-2c0-2.208-1.793-4-4-4zM8 26h-4v-8h-2v-2c0-1.104 0.897-2 2-2h2.554c-0.344 0.59-0.554 1.268-0.554 2v4c0 1.477 0.808 2.752 2 3.445v2.555zM18 22v-4h-2v12h-4v-12h-2v4c-1.104 0-2-0.895-2-2v-4c0-1.104 0.896-2 2-2h8c1.105 0 2 0.896 2 2v4c0 1.105-0.895 2-2 2zM26 18h-2v8h-4v-2.555c1.191-0.693 2-1.967 2-3.445v-4c0-0.732-0.211-1.41-0.555-2h2.555c1.105 0 2 0.896 2 2v2zM9.49 9.918c1.1 1.266 2.702 2.082 4.51 2.082s3.41-0.816 4.51-2.082c0.682 1.236 1.98 2.082 3.49 2.082 2.207 0 4-1.792 4-4s-1.793-4-4-4c-0.801 0-1.543 0.24-2.168 0.646-0.617-2.66-2.986-4.646-5.832-4.646s-5.216 1.986-5.832 4.646c-0.626-0.406-1.368-0.647-2.168-0.647-2.208 0-4 1.792-4 4s1.792 4 4 4c1.51 0 2.808-0.846 3.49-2.082zM22 6c1.105 0 2 0.894 2 2s-0.895 2-2 2c-1.104 0-2-0.894-2-2s0.896-2 2-2zM14 2c2.207 0 4 1.792 4 4s-1.793 4-4 4c-2.208 0-4-1.792-4-4s1.792-4 4-4zM6 10c-1.104 0-2-0.894-2-2s0.896-2 2-2c1.106 0 2 0.894 2 2s-0.894 2-2 2z"></path>
</symbol>
<symbol id="package" width="100%" height="1em" viewBox="0 0 32 32">
<path fill="inherit" d="M15 2l-15 4v18l15 4 15-4v-18l-15-4zM1.996 22.529l-0.012-13.529 12.016 3.204 0 13.526-12.004-3.201zM1.984 7l5.008-1.335 13.008 3.473-5 1.333-13.016-3.471zM28.004 22.529l-12.004 3.201 0-13.526 4-1.067v4.875l4-1.067v-4.875l4.016-1.071-0.012 13.529zM24 8.071v-0.004l-13.008-3.469 4.008-1.069 13.016 3.471-4.016 1.071z"></path>
</symbol>
<symbol id="docs" width="100%" height="1em" viewBox="0 0 24 32">
<path fill="inherit" d="M9 12l-5 5 5 5 2-2-3-3 3-3-2-2zM13 14l3 3-3 3 2 2 5-5-5-5-2 2zM18 2h-18v28h24v-22l-6-6zM22 28h-20v-24h14l6 6v18z"></path>
</symbol>
<symbol id="fork" width="100%" height="1em" viewBox="-80 -60 950 1250">
<path fill="inherit" d="M768 128c0-71-57-128-128-128s-128 57-128 128c0 47 26 89 64 111v106l-192 212-192-212v-106c38-22 64-63 64-111 0-71-57-128-128-128s-128 57-128 128c0 47 26 89 64 111v156l256 282v109c-38 22-64 63-64 111 0 71 57 128 128 128s128-57 128-128c0-47-26-89-64-111v-109l256-282v-156c38-22 64-63 64-111zM128 65c34 0 62 28 62 62s-28 62-62 62-62-28-62-62 28-62 62-62zM384 956c-34 0-62-28-62-62s28-62 62-62 62 28 62 62-28 62-62 62zM640 65c34 0 62 28 62 62s-28 62-62 62-62-28-62-62 28-62 62-62z"></path>
</symbol>
<symbol id="tools" width="100%" height="1em" viewBox="0 0 1024 1024">
<path fill="inherit" d="M160.512 352.768c47.77-37.12 87.398-11.52 140.288 49.715 5.939 6.912 13.926-1.178 18.483-5.12 4.506-3.994 74.291-66.816 77.722-69.683 3.379-3.021 7.475-8.653 2.099-14.95-5.478-6.298-25.293-32-38.042-48.691-92.57-121.088 253.235-203.213 200.141-204.493-27.034-0.717-135.475-1.997-151.706-0.205-65.69 6.912-148.173 68.301-189.696 96.922-54.323 37.171-74.598 58.982-77.926 62.003-15.36 13.414-2.458 44.39-30.31 68.813-29.44 25.754-47.821 6.246-64.87 21.197-8.448 7.475-32.102 25.19-38.861 31.078-6.81 5.99-8.038 16.077-1.075 24.115 0 0 64.717 71.475 70.144 77.824 5.376 6.246 20.019 11.674 29.030 3.635 9.062-7.987 32.358-28.314 36.25-31.898 3.994-3.379-2.56-44.083 18.33-60.262zM452.762 379.238c-6.144-7.117-13.773-7.322-20.326-1.485l-73.421 64.102c-5.786 5.12-6.605 14.49-1.382 20.48l424.653 483.277c9.933 11.418 27.136 12.595 38.451 2.714l49.664-41.626c11.366-9.984 12.544-27.29 2.662-38.81l-420.301-488.653zM1018.982 173.568c-3.789-25.293-16.896-20.019-23.706-9.318-6.81 10.803-36.915 56.422-49.306 77.107-12.288 20.48-42.598 60.979-99.021 20.992-58.778-41.523-38.349-70.502-28.109-90.010 10.291-19.61 41.882-74.598 46.438-81.408 4.557-6.912-0.768-26.982-18.995-18.586-18.278 8.397-129.178 52.48-144.538 115.712-15.718 64.307 13.158 121.805-43.52 178.893l-68.762 71.68 69.069 80.179 84.685-80.384c20.173-20.275 63.283-39.987 102.298-31.078 83.61 18.893 129.229-12.493 156.723-64.41 24.678-46.387 20.582-144.077 16.742-169.37zM140.237 873.114c-10.65 10.701-10.65 28.109 0 38.81l48.691 47.616c10.65 10.701 27.546 6.195 38.195-4.506l251.238-246.989-76.954-87.757-261.171 252.826z"></path>
</symbol>
<symbol id="network" width="100%" height="1em" viewBox="0 0 20 20">
<path fill="inherit" d="M5.274 6.915c0.2 0 0.394 0.029 0.576 0.086 0.69-0.773 1.455-1.477 2.283-2.1-0.035-0.146-0.054-0.299-0.054-0.455 0-0.217 0.036-0.426 0.102-0.621-0.929-0.664-1.937-1.223-3.011-1.654-1.005 0.621-1.882 1.431-2.582 2.381 0.519 0.92 1.136 1.777 1.838 2.557 0.256-0.124 0.543-0.194 0.848-0.194zM3.316 8.872c0-0.275 0.058-0.537 0.159-0.773-0.628-0.692-1.197-1.436-1.695-2.229-0.625 1.242-0.98 2.645-0.98 4.131 0 1.719 0.474 3.328 1.295 4.705 0.294-1.654 0.851-3.219 1.62-4.652-0.25-0.328-0.399-0.739-0.399-1.182zM10.036 2.489c0.517 0 0.985 0.201 1.336 0.529 1.021-0.439 2.096-0.777 3.215-0.992-1.351-0.779-2.917-1.226-4.587-1.226-1.139 0-2.229 0.209-3.236 0.588 0.799 0.395 1.561 0.855 2.277 1.375 0.292-0.174 0.631-0.274 0.995-0.274zM12.962 11.708c0.122-0.254 0.295-0.479 0.509-0.656-0.578-1.777-1.493-3.404-2.672-4.803-0.234 0.1-0.492 0.154-0.764 0.154-0.425 0-0.816-0.137-1.137-0.365-0.71 0.539-1.367 1.143-1.964 1.803 0.188 0.299 0.297 0.652 0.297 1.031 0 0.203-0.031 0.4-0.090 0.586 1.717 1.146 3.694 1.934 5.821 2.25zM15.501 14.351c0.026 0.371 0.041 0.744 0.041 1.121 0 0.664-0.042 1.318-0.122 1.961 1.56-1.139 2.748-2.758 3.347-4.639-0.71 0.172-1.438 0.295-2.181 0.365-0.173 0.537-0.572 0.969-1.085 1.192zM12.504 13.024c-2.272-0.377-4.377-1.244-6.21-2.484-0.298 0.182-0.647 0.289-1.021 0.289-0.139 0-0.272-0.014-0.402-0.041-0.877 1.662-1.438 3.517-1.599 5.484 0.876 0.94 1.944 1.697 3.145 2.205 1.492-2.293 3.576-4.189 6.087-5.453zM16.176 3.181c-1.475 0.143-2.883 0.514-4.193 1.068 0.006 0.066 0.010 0.131 0.010 0.197 0 0.309-0.074 0.6-0.201 0.859 1.311 1.539 2.327 3.33 2.969 5.291 0.797 0.016 1.477 0.502 1.77 1.195 0.886-0.090 1.748-0.26 2.578-0.504 0.060-0.42 0.092-0.85 0.092-1.287-0.001-2.704-1.167-5.136-3.025-6.819zM13.489 14.069c-2.344 1.098-4.304 2.789-5.723 4.856 0.715 0.179 1.463 0.275 2.234 0.275 1.387 0 2.702-0.309 3.882-0.859 0.19-0.928 0.29-1.887 0.29-2.869 0-0.355-0.016-0.707-0.043-1.055-0.236-0.076-0.453-0.193-0.64-0.348z"></path>
</symbol>
<symbol id="flow" width="100%" height="1em" viewBox="0 0 32 32">
<path fill="inherit" d="M30.5 24h-0.5v-6.5c0-1.93-1.57-3.5-3.5-3.5h-8.5v-4h0.5c0.825 0 1.5-0.675 1.5-1.5v-5c0-0.825-0.675-1.5-1.5-1.5h-5c-0.825 0-1.5 0.675-1.5 1.5v5c0 0.825 0.675 1.5 1.5 1.5h0.5v4h-8.5c-1.93 0-3.5 1.57-3.5 3.5v6.5h-0.5c-0.825 0-1.5 0.675-1.5 1.5v5c0 0.825 0.675 1.5 1.5 1.5h5c0.825 0 1.5-0.675 1.5-1.5v-5c0-0.825-0.675-1.5-1.5-1.5h-0.5v-6h8v6h-0.5c-0.825 0-1.5 0.675-1.5 1.5v5c0 0.825 0.675 1.5 1.5 1.5h5c0.825 0 1.5-0.675 1.5-1.5v-5c0-0.825-0.675-1.5-1.5-1.5h-0.5v-6h8v6h-0.5c-0.825 0-1.5 0.675-1.5 1.5v5c0 0.825 0.675 1.5 1.5 1.5h5c0.825 0 1.5-0.675 1.5-1.5v-5c0-0.825-0.675-1.5-1.5-1.5zM6 30h-4v-4h4v4zM18 30h-4v-4h4v4zM14 8v-4h4v4h-4zM30 30h-4v-4h4v4z"></path>
</symbol>
<symbol id="dl" width="100%" height="1em" viewBox="0 0 32 32">
<path fill="inherit" d="M14 18.937c0 1.141-0.75 2.063-1.672 2.063h-6.656c-0.922 0-1.672-0.922-1.672-2.063 0-2.063 0.5-4.438 2.562-4.438 0.625 0.625 1.484 1 2.438 1s1.813-0.375 2.438-1c2.063 0 2.562 2.375 2.562 4.438zM12 12c0 1.656-1.344 3-3 3s-3-1.344-3-3 1.344-3 3-3 3 1.344 3 3zM28 18.5v1c0 0.281-0.219 0.5-0.5 0.5h-11c-0.281 0-0.5-0.219-0.5-0.5v-1c0-0.281 0.219-0.5 0.5-0.5h11c0.281 0 0.5 0.219 0.5 0.5zM22 14.5v1c0 0.281-0.219 0.5-0.5 0.5h-5c-0.281 0-0.5-0.219-0.5-0.5v-1c0-0.281 0.219-0.5 0.5-0.5h5c0.281 0 0.5 0.219 0.5 0.5zM28 14.5v1c0 0.281-0.219 0.5-0.5 0.5h-3c-0.281 0-0.5-0.219-0.5-0.5v-1c0-0.281 0.219-0.5 0.5-0.5h3c0.281 0 0.5 0.219 0.5 0.5zM28 10.5v1c0 0.281-0.219 0.5-0.5 0.5h-11c-0.281 0-0.5-0.219-0.5-0.5v-1c0-0.281 0.219-0.5 0.5-0.5h11c0.281 0 0.5 0.219 0.5 0.5zM30 23.5v-17.5h-28v17.5c0 0.266 0.234 0.5 0.5 0.5h27c0.266 0 0.5-0.234 0.5-0.5zM32 4.5v19c0 1.375-1.125 2.5-2.5 2.5h-27c-1.375 0-2.5-1.125-2.5-2.5v-19c0-1.375 1.125-2.5 2.5-2.5h27c1.375 0 2.5 1.125 2.5 2.5z"></path>
</symbol>
<symbol id="server" width="100%" height="1em" viewBox="0 0 32 32">
<path fill="inherit" d="M2 22h16v-2h-16v2zM2 14h16v-2h-16v2zM26.5 21c0-0.828-0.672-1.5-1.5-1.5s-1.5 0.672-1.5 1.5 0.672 1.5 1.5 1.5 1.5-0.672 1.5-1.5zM2 6h16v-2h-16v2zM26.5 13c0-0.828-0.672-1.5-1.5-1.5s-1.5 0.672-1.5 1.5 0.672 1.5 1.5 1.5 1.5-0.672 1.5-1.5zM26.5 5c0-0.828-0.672-1.5-1.5-1.5s-1.5 0.672-1.5 1.5 0.672 1.5 1.5 1.5 1.5-0.672 1.5-1.5zM28 18v6h-28v-6h28zM28 10v6h-28v-6h28zM28 2v6h-28v-6h28z"></path>
</symbol>
<symbol id="nodes" width="100%" height="1em" viewBox="0 0 1000 1000">
<path fill="inherit" d="M376.3,342.3L316.7,286c6.9-12.6,11.2-26.9,11.2-42.3c0-48.8-39.6-88.4-88.4-88.4c-48.8,0-88.5,39.5-88.5,88.4s39.6,88.4,88.5,88.4c17.2,0,33.2-5.1,46.8-13.6l59.5,56.3C354.8,362.8,364.9,351.9,376.3,342.3z"></path><path fill="inherit" d="M628.4,335.3L707.7,202c7.8,2.2,15.9,3.8,24.4,3.8c48.9,0,88.5-39.6,88.5-88.4C820.5,68.6,781,29,732,29c-48.8,0-88.4,39.5-88.4,88.4c0,24.3,9.8,46.2,25.6,62.2l-79,132.9C603.8,318.6,616.6,326.3,628.4,335.3z"></path><path fill="inherit" d="M901.6,446.9c-38,0-70.3,24.2-82.7,57.9l-110.1-10.9c0,0.8,0.1,1.6,0.1,2.4c0,14.3-1.6,28.3-4.4,41.9l110,10.9c6.7,42.2,43,74.6,87.1,74.6c48.8,0,88.4-39.5,88.4-88.4C990,486.4,950.5,446.9,901.6,446.9z"></path><path fill="inherit" d="M597.9,794.5L573.3,687c-13.9,4.8-28.3,8.3-43.4,10l24.6,107.5c-28.3,14.8-47.8,44-47.8,78.1c0,48.8,39.5,88.3,88.5,88.3c48.8,0,88.4-39.5,88.4-88.3C683.7,834.7,645.5,795.9,597.9,794.5z"></path><path fill="inherit" d="M309.4,539l-137,45.9c-15.8-24.2-43-40.2-74-40.2c-48.8,0-88.4,39.5-88.4,88.4c0,48.9,39.5,88.5,88.4,88.5c48.8,0,88.5-39.5,88.5-88.5c0-2-0.4-3.9-0.6-5.9l137.4-46C317.5,567.8,312.5,553.7,309.4,539z"></path><path fill="inherit" d="M506.9,344.7c83.7,0,151.6,67.9,151.6,151.6c0,83.7-67.9,151.6-151.6,151.6c-83.7,0-151.6-67.9-151.6-151.6C355.3,412.6,423.2,344.7,506.9,344.7z"></path>
</symbol>
<symbol id="cert" width="100%" height="1em" viewBox="0 0 252.643 252.643">
<path fill="inherit" d="M235.143,17.081H17.5c-9.649,0-17.5,7.851-17.5,17.5v147.658c0,9.649,7.851,17.5,17.5,17.5h126.911 l-3.832,23.37c-0.721,4.399,0.734,8.384,3.893,10.658c3.158,2.274,7.396,2.396,11.341,0.317l27.381-14.412 c0.764-0.392,2.869-0.392,3.633,0l27.381,14.412c1.873,0.986,3.813,1.477,5.672,1.477c2.056,0,4.012-0.601,5.67-1.795 c3.158-2.274,4.613-6.26,3.893-10.659l-3.831-23.369h9.532c9.649,0,17.5-7.851,17.5-17.5V34.581 C252.643,24.931,244.792,17.081,235.143,17.081z M185.011,169.743c-16.817,0-30.5-13.683-30.5-30.5c0-16.817,13.683-30.5,30.5-30.5 s30.5,13.683,30.5,30.5C215.511,156.06,201.828,169.743,185.011,169.743z M193.814,206.399c-5.101-2.686-12.506-2.686-17.606,0 l-19.358,10.189l6.154-37.539c6.527,3.623,14.029,5.693,22.008,5.693s15.48-2.071,22.008-5.693l2.398,14.635 c0.006,0.024,0.008,0.05,0.013,0.074l3.743,22.831L193.814,206.399z M237.643,182.239c0,1.355-1.145,2.5-2.5,2.5h-11.991 l-2.739-16.709c-0.011-0.066-0.029-0.129-0.042-0.195c6.335-7.818,10.141-17.768,10.141-28.592c0-25.089-20.411-45.5-45.5-45.5 c-25.089,0-45.5,20.411-45.5,45.5c0,10.824,3.806,20.772,10.141,28.592c-0.013,0.065-0.031,0.129-0.042,0.194l-2.741,16.723 c-0.084-0.003-0.165-0.013-0.249-0.013H17.5c-1.355,0-2.5-1.145-2.5-2.5V34.581c0-1.355,1.145-2.5,2.5-2.5h217.643 c1.355,0,2.5,1.145,2.5,2.5V182.239z"/>
<path fill="inherit" d="M208.619,60.243h-170c-4.143,0-7.5,3.357-7.5,7.5c0,4.143,3.357,7.5,7.5,7.5h170 c4.143,0,7.5-3.357,7.5-7.5C216.119,63.6,212.762,60.243,208.619,60.243z"/>
<path fill="inherit" d="M110.619,100.911h-72c-4.143,0-7.5,3.357-7.5,7.5c0,4.143,3.357,7.5,7.5,7.5h72 c4.143,0,7.5-3.357,7.5-7.5C118.119,104.268,114.762,100.911,110.619,100.911z"/>
</symbol>
<symbol id="checklist" width="100%" height="1em" viewBox="0 0 100 100">
<path fill="inherit" d="M29.837,40.026c0.854,1.277,2.155,2.046,3.562,2.106c0.064,0.005,0.127,0.005,0.192,0.005c1.349,0,2.645-0.655,3.559-1.796 l6.707-8.384c0.847-1.059,0.674-2.609-0.385-3.46c-1.026-0.817-2.643-0.633-3.457,0.387l-6.379,7.97l-1.992-2.989 c-0.727-1.09-2.315-1.413-3.412-0.685c-1.128,0.752-1.435,2.282-0.683,3.411L29.837,40.026z"/><path fill="inherit" d="M67.346,33.833h-18.15c-1.355,0-2.46,1.104-2.46,2.46c0,1.355,1.105,2.46,2.46,2.46h18.15c1.356,0,2.461-1.104,2.461-2.46 S68.702,33.833,67.346,33.833z"/><path fill="inherit" d="M29.837,58.458c0.854,1.28,2.156,2.05,3.562,2.108c0.064,0.004,0.129,0.006,0.192,0.006c1.349,0,2.646-0.654,3.559-1.797 l6.707-8.383c0.847-1.059,0.673-2.611-0.385-3.459c-1.026-0.816-2.641-0.634-3.457,0.385l-6.378,7.971L31.643,52.3 c-0.726-1.09-2.314-1.413-3.411-0.685c-1.128,0.753-1.435,2.283-0.683,3.412L29.837,58.458z"/><path fill="inherit" d="M67.346,52.268h-18.15c-1.355,0-2.46,1.104-2.46,2.459c0,1.356,1.105,2.461,2.46,2.461h18.15 c1.356,0,2.461-1.104,2.461-2.461C69.807,53.372,68.702,52.268,67.346,52.268z"/><path fill="inherit" d="M43.473,65.368c-1.023-0.819-2.642-0.64-3.458,0.382l-6.378,7.971l-1.994-2.99c-0.457-0.687-1.223-1.096-2.048-1.096 c-0.486,0-0.958,0.145-1.362,0.413c-0.547,0.363-0.919,0.918-1.049,1.562c-0.129,0.646,0,1.303,0.365,1.851l2.288,3.431 c0.854,1.282,2.157,2.051,3.581,2.109l0.173,0.005c1.349,0,2.646-0.655,3.559-1.796l6.706-8.384c0.411-0.513,0.598-1.155,0.524-1.81 C44.309,66.361,43.984,65.777,43.473,65.368z"/><path fill="inherit" d="M67.346,70.7h-18.15c-1.355,0-2.46,1.104-2.46,2.461s1.105,2.46,2.46,2.46h18.15c1.356,0,2.461-1.104,2.461-2.46 S68.702,70.7,67.346,70.7z"/><path fill="inherit" d="M73.633,12.09h-2.34C70.775,8.107,67.33,5,63.234,5H36.766c-4.096,0-7.541,3.107-8.059,7.09h-2.34 c-6.569,0-11.914,5.345-11.914,11.914v59.082C14.453,89.654,19.798,95,26.367,95h47.266c6.569,0,11.914-5.346,11.914-11.914V24.004 C85.547,17.435,80.202,12.09,73.633,12.09z M33.554,13.133c0-1.771,1.44-3.213,3.212-3.213h26.468c1.771,0,3.213,1.441,3.213,3.213 v2.835c0,1.771-1.44,3.213-3.213,3.213H36.766c-1.771,0-3.212-1.441-3.212-3.213V13.133z M80.627,83.086 c0,3.857-3.137,6.994-6.993,6.994H26.367c-3.856,0-6.993-3.137-6.993-6.994V24.004c0-3.856,3.137-6.994,6.993-6.994h2.34 c0.518,3.982,3.963,7.091,8.059,7.091h26.468c4.097,0,7.541-3.108,8.06-7.091h2.34c3.856,0,6.993,3.138,6.993,6.994V83.086z"/>
</symbol>
</defs>
</svg>
<header id="site_header">
<h1 class="text-logo"><span><</span><b>X</b><span>></span></h1>
<nav id="global_nav" font="mono">
<input id="global_nav_checkbox" type="checkbox" />
<div>Menu</div>
<a href="/"><svg><use xlink:href="#network"></use></svg>Home</a>
<a href="/docs"><svg><use xlink:href="#docs"></use></svg>Docs</a>
<a href="/builds"><svg><use xlink:href="#package"></use></svg>Builds</a>
<a href="https://github.com/x-tag/core-2"><svg><use xlink:href="#fork"></use></svg>Fork</a>
</nav>
</header>
<main>
<section id="home_section">
<h2 id="home_logo" data-version="2.0 beta"><div class="text-logo"><span><</span><b>X</b><span>></span></div></h2>
<h2>X-Tag is a
<span font="blue">lightweight, power-packed </span>
<span font="green">Web Components library</span>
that gets you there fast, and stays in its own lane.</h2>
<hr />
<ul class="feature-row">
<li>
<svg viewBox="25 15 465 465">
<rect fill="#fff" x="27.5%" y="21%" width="55%" height="65%"></rect>
<path d="M71.197,46l33.604,377.479L255.474,466l151.725-42.521L440.803,46H71.197z M367.82,169.11H190.905l3.929,47.519h169.058 l-13.137,142.792l-94.236,25.99v0.268h-1.045l-95.029-26.258l-5.775-72.975h45.939l3.41,36.754l51.455,13.914l51.707-13.914 l5.782-59.846H152.312l-12.335-140.176h232.047L367.82,169.11z"></path>
</svg>
<h2 text-shadow>Standard</h2>
<div>Built on Web Components APIs</div>
</li><li>
<svg viewBox="0 0 1024 1024">
<path d="M217.805 1001.83c15.718-50.278 39.424-121.037 71.219-223.334 138.598-21.965 195.942 17.459 283.955-139.725-71.424 21.862-157.542-40.55-152.934-67.635 4.659-27.034 200.346 19.507 328.499-162.458-161.536 35.635-213.197-42.803-192.358-54.63 48.077-27.341 190.771-11.366 266.854-85.453 39.219-38.144 57.6-130.867 41.626-163.942-19.149-39.987-135.987-99.635-200.397-94.003-64.41 5.581-165.427 245.248-195.43 243.405-29.901-1.894-35.994-107.418 16.333-205.466-55.142 24.422-156.211 100.301-187.904 165.171-59.034 120.678 5.53 397.619-15.155 407.45-20.736 9.882-90.419-127.027-111.206-189.133-28.416 95.181-29.082 190.515 53.914 317.133-31.283 83.098-48.384 178.739-50.995 227.379-1.229 38.861 37.069 47.206 43.981 25.242z"></path>
</svg>
<h2 text-shadow>Efficient</h2>
<div>Powerful features, just <i style="color: #eee;">2k</i> minified and gzipped</div>
</li><li>
<svg viewBox="0 0 1024 1024">
<path d="M657.322 15.318l-187.968 187.734-81.302-81.066c-20.458-20.48-53.546-20.48-74.026 0s-20.48 53.546 0 74.026l11.52 11.52-90.88 91.094c-117.334 117.334-141.44 290.368-56.746 427.542l-153.174 153.174c-33.088 33.046-33.088 86.826 0 119.872 33.066 33.088 86.826 33.088 119.658 0l153.194-153.366c137.6 85.334 310.208 60.992 427.734-56.534l90.88-91.094 11.754 11.754c20.458 20.458 53.504 20.458 74.006 0 20.502-20.502 20.502-53.59 0-74.048l-91.968-91.968 198.634-198.614c20.502-20.48 20.502-53.546 0-74.026s-53.546-20.48-74.006 0l-198.634 198.4-192.662-192.426 187.968-187.946c20.502-20.48 20.502-53.546 0-74.026s-53.522-20.482-73.982-0.002z"></path>
</svg>
<h2 text-shadow>Pluggable</h2>
<div>Plays nice with other libraries</div>
</li>
</ul>
<hr/>
<h2>What is X-Tag?</h2>
<p>X-Tag is a Microsoft supported, open source JavaScript library that wraps the W3C standard <a href="http://jonrimmer.github.io/are-we-componentized-yet/">Web Components</a> family of APIs
to provide a compact, feature-rich interface for component development. While X-Tag offers feature hooks for all Web Component APIs
(Custom Elements, Shadow DOM, Templates, and HTML Imports), it only relies on Custom Element support to operate.
In the absence of native Custom Element support, X-Tag uses a <a target="_blank" href="https://github.com/webcomponents/webcomponentsjs">polyfill</a>
shared with Google's Polymer framework. You can view our package options in the <a href="/builds">Builds</a> section</p>
<hr/>
<x-clock></x-clock>
<pre class="language-javascript"><code>
xtag.create('x-clock', class extends XTagElement {
connectedCallback () {
this.start();
}
start (){
this.update();
this._data.interval = setInterval(() => this.update(), 1000);
}
stop (){
this._data.interval = clearInterval(this._data.interval);
}
update (){
this.textContent = new Date().toLocaleTimeString();
}
'tap::event' (){
if (this._data.interval) this.stop();
else this.start();
}
});
</code></pre>
<hr/>
<h2 text-shadow>Browser Support</h2>
<div id="browser_support" class="feature-row">
<div>
<svg id="browser_edge" width="100%" height="1em" viewBox="0 0 399 432">
<path fill="#ffffff" d="M80.9746094,114.404297 C29.7135331,146.31357 0.416015625,191.658203 0.416015625,191.658203 C0.416015625,191.658203 8.00793654,96.5783329 80.9746094,40.9433594 C109.99433,18.8166636 149.669408,0.278808594 203.032715,0.278808594 C223.079627,0.278808594 265.118164,3.76660156 302.984375,27.1123047 C340.850586,50.4580078 356.149414,70.0136719 373.208984,98.6445312 C380.570259,110.998865 386.565681,126.870142 390.305664,142.179688 C397.312935,170.863811 398.165039,205.168945 398.165039,205.168945 L398.165039,250.359375 L127.542969,250.359375 C127.542969,250.359375 120.933594,341.28125 245.390625,341.28125 C288.675172,341.28125 303.832031,334.481445 318.068359,330.265625 C340.35498,323.665862 361.875,308.955078 361.875,308.955078 L361.916016,399.796875 C361.916016,399.796875 310.980469,431.170898 234.030273,431.170898 C212.360573,431.170898 189.523812,429.353496 167.5,422.208008 C148.255049,415.964103 107.950758,399.1222 80.9746094,359.650391 C71.4321522,345.687758 61.0920706,327.107886 55.9707031,308.955078 C50.4340389,289.330241 50.5019531,270.265226 50.5019531,259.761719 C50.5019531,220.477429 63.9233273,182.970681 87.2128906,155.856445 C117.379883,120.735352 155.509766,105.273438 155.509766,105.273438 C155.509766,105.273438 143.089844,119.75293 135.450195,137.780273 C127.810547,155.807617 125.720703,173.945312 125.720703,173.945312 L278.529468,173.945312 C278.529468,173.945312 287.466797,82.6347656 192.064453,82.6347656 C156.11735,82.6347656 111.967456,95.111701 80.9746094,114.404297 Z"/>
</svg>
Edge
</div><div>
<svg id="browser_chrome" width="100%" height="1em" viewBox="0 0 1024 1024">
<path fill="#ffffff" d="M258.278 446.542l-146.532-253.802c93.818-117.464 238.234-192.74 400.254-192.74 187.432 0 351.31 100.736 440.532 251h-417.77c-7.504-0.65-15.092-1-22.762-1-121.874 0-224.578 83.644-253.722 196.542zM695.306 325h293.46c22.74 57.93 35.234 121.004 35.234 187 0 280.826-226.1 508.804-506.186 511.926l209.394-362.678c29.48-42.378 46.792-93.826 46.792-149.248 0-73.17-30.164-139.42-78.694-187zM326 512c0-102.56 83.44-186 186-186s186 83.44 186 186c0 102.56-83.44 186-186 186s-186-83.44-186-186zM582.182 764.442l-146.578 253.878c-246.532-36.884-435.604-249.516-435.604-506.32 0-91.218 23.884-176.846 65.696-251.024l209.030 362.054c41.868 89.112 132.476 150.97 237.274 150.97 24.3 0 47.836-3.34 70.182-9.558z"></path>
</svg>
Chrome <i>(desktop and mobile)</i>
</div><div>
<svg id="browser_firefox" width="100%" height="1em" viewBox="0 0 1024 1024">
<path fill="#ffffff" d="M1022.526 334.14l-11.86 76.080c0 0-16.954-140.856-37.732-193.514-31.846-80.688-46.014-80.040-46.108-79.922 21.33 54.204 17.462 83.324 17.462 83.324s-37.792-102.998-137.712-135.768c-110.686-36.282-170.57-26.364-177.488-24.486-1.050-0.008-2.064-0.010-3.030-0.010 0.818 0.062 1.612 0.146 2.426 0.212-0.034 0.020-0.090 0.042-0.082 0.052 0.45 0.548 122.306 21.302 143.916 50.996 0 0-51.76 0-103.272 14.842-2.328 0.666 189.524 23.964 228.746 215.674 0 0-21.030-43.876-47.040-51.328 17.106 52.036 12.714 150.776-3.576 199.85-2.096 6.312-4.24-27.282-36.328-41.75 10.28 73.646-0.616 190.456-51.708 222.632-3.982 2.504 32.030-115.31 7.242-69.762-142.708 218.802-311.404 100.972-387.248 49.11 38.866 8.462 112.654-1.318 145.314-25.612 0.042-0.030 0.078-0.056 0.118-0.086 35.468-24.252 56.472-41.964 75.334-37.772 18.874 4.214 31.438-14.726 16.78-31.53-14.676-16.838-50.314-39.978-98.524-27.366-34 8.904-76.134 46.522-140.448 8.432-49.364-29.25-54.012-53.546-54.45-70.376 1.218-5.966 2.754-11.536 4.576-16.624 5.682-15.87 22.912-20.658 32.494-24.438 16.256 2.792 30.262 7.862 44.968 15.406 0.19-4.894 0.252-11.39-0.018-18.76 1.41-2.802 0.538-11.252-1.722-21.58-1.302-10.308-3.42-20.974-6.752-30.692 0.012-0.002 0.020-0.010 0.030-0.014 0.056-0.018 0.108-0.040 0.156-0.070 0.078-0.044 0.146-0.112 0.208-0.19 0.012-0.020 0.030-0.034 0.044-0.052 0.082-0.124 0.154-0.272 0.198-0.466 1.020-4.618 12.022-13.524 25.718-23.1 12.272-8.58 26.702-17.696 38.068-24.752 10.060-6.248 17.72-10.882 19.346-12.098 0.618-0.466 1.358-1.012 2.164-1.636 0.15-0.116 0.3-0.232 0.454-0.354 0.094-0.074 0.19-0.148 0.286-0.226 5.41-4.308 13.484-12.448 15.178-29.578 0.004-0.042 0.010-0.080 0.012-0.122 0.050-0.504 0.092-1.014 0.13-1.534 0.028-0.362 0.050-0.726 0.072-1.096 0.014-0.284 0.032-0.566 0.044-0.856 0.030-0.674 0.050-1.364 0.060-2.064 0-0.040 0.002-0.076 0.004-0.116 0.022-1.658-0.006-3.386-0.104-5.202-0.054-1.014-0.126-1.93-0.298-2.762-0.008-0.044-0.018-0.092-0.028-0.136-0.018-0.082-0.036-0.164-0.058-0.244-0.036-0.146-0.076-0.292-0.122-0.43-0.006-0.018-0.010-0.032-0.016-0.046-0.052-0.16-0.112-0.314-0.174-0.464-0.004-0.006-0.004-0.010-0.006-0.016-1.754-4.108-8.32-5.658-35.442-6.118-0.026-0.002-0.050-0.002-0.076-0.002v0c-11.066-0.188-25.538-0.194-44.502-0.118-33.25 0.134-51.628-32.504-57.494-45.132 8.040-44.46 31.276-76.142 69.45-97.626 0.722-0.406 0.58-0.742-0.274-0.978 7.464-4.514-90.246-0.124-135.186 57.036-39.888-9.914-74.654-9.246-104.616-2.214-5.754-0.162-12.924-0.88-21.434-2.652-19.924-18.056-48.448-51.402-49.976-91.208 0 0-0.092 0.072-0.252 0.204-0.020-0.382-0.056-0.76-0.072-1.142 0 0-60.716 46.664-51.628 173.882-0.022 2.036-0.064 3.986-0.12 5.874-16.432 22.288-24.586 41.020-25.192 45.156-14.56 29.644-29.334 74.254-41.356 141.98 0 0 8.408-26.666 25.284-56.866-12.412 38.022-22.164 97.156-16.436 185.856 0 0 1.514-19.666 6.874-47.994 4.186 55.010 22.518 122.924 68.858 202.788 88.948 153.32 225.67 230.74 376.792 242.616 26.836 2.212 54.050 2.264 81.424 0.186 2.516-0.178 5.032-0.364 7.55-0.574 30.964-2.174 62.134-6.852 93.238-14.366 425.172-102.798 378.942-616.198 378.942-616.198z"></path>
</svg>
Firefox <i>(desktop and mobile)</i>
</div><div>
<svg id="browser_safari" width="100%" height="1em" viewBox="0 0 1024 1024">
<path fill="#ffffff" d="M512 64c-24.064 0-47.708 1.792-70.824 5.212-0.3-0.782-0.624-1.548-0.982-2.296 12.826-10.002 19.55-23.83 16.634-37.552-3.734-17.564-22.394-29.364-46.434-29.364-5.18 0-10.458 0.562-15.68 1.672-30.168 6.414-50.146 28.622-45.482 50.562 2.834 13.338 14.292 23.338 30.164 27.384-0.032 0.972-0.016 1.95 0.042 2.934-200.622 57.53-347.438 242.338-347.438 461.448 0 265.098 214.904 480 480 480 265.098 0 480-214.902 480-480 0-265.096-214.902-480-480-480zM364.882 48.908c-2.706-12.726 12.48-27.19 33.158-31.584 4.132-0.878 8.29-1.324 12.354-1.324 16.036 0 28.694 6.864 30.784 16.69 1.596 7.51-3.070 15.61-11.386 21.904-7.034-4.966-16.016-7.126-25.1-5.196-9.044 1.922-16.348 7.508-20.758 14.856-10.184-2.45-17.508-8.084-19.052-15.346zM769.386 801.386c-43.968 43.968-97.21 75.278-155.31 92.154l-42.396-68.768-10.746 79.958c-16.090 2.152-32.426 3.27-48.934 3.27-97.228 0-188.636-37.864-257.386-106.614-43.968-43.966-75.278-97.21-92.154-155.308l68.768-42.398-79.96-10.746c-2.15-16.090-3.268-32.426-3.268-48.934 0-97.228 37.862-188.636 106.614-257.386 43.968-43.968 97.212-75.278 155.31-92.156l42.396 68.77 10.748-79.96c16.088-2.15 32.424-3.268 48.932-3.268 97.228 0 188.636 37.862 257.386 106.614 43.968 43.968 75.278 97.212 92.154 155.31l-68.77 42.398 79.96 10.746c2.152 16.088 3.27 32.424 3.27 48.932 0 97.228-37.864 188.636-106.614 257.386zM760.902 295.098l-196.978 149.704c-14.644-7.658-30.876-12.062-47.416-12.726l-51.080-107.18-3.068 118.664c-13.284 6.536-25.104 15.664-34.876 26.95l-63.088-22.364 46.092 48.538c-6.334 13.518-9.866 28.030-10.434 42.824l-107.158 51.066 118.738 3.068c0.38 0.768 0.774 1.526 1.17 2.282l-149.704 196.98 196.978-149.704c14.644 7.656 30.874 12.060 47.416 12.724l51.080 107.182 3.066-118.664c13.286-6.538 25.106-15.664 34.878-26.952l63.090 22.368-46.094-48.54c6.336-13.52 9.868-28.030 10.436-42.824l107.156-51.066-118.736-3.070c-0.378-0.766-0.774-1.524-1.17-2.28l149.702-196.98zM512.102 444.534v0zM492.042 450.098c6.726-1.43 13.444-2.118 20.056-2.118 4.144 0 8.25 0.27 12.294 0.796l0.092 0.032-0.010-0.022c8.732 1.144 17.176 3.5 25.132 6.896l-71.546 54.376-54.38 71.552c-2.376-5.594-4.27-11.484-5.58-17.652-11.026-51.86 22.080-102.836 73.942-113.86zM562.12 625.884v0 0c-9.056 5.544-19.182 9.684-30.16 12.018-6.726 1.43-13.444 2.118-20.054 2.118-4.15 0-8.258-0.272-12.308-0.798l-0.068-0.010c-8.734-1.142-17.174-3.5-25.132-6.894l71.544-54.376 54.38-71.554c2.376 5.594 4.27 11.486 5.58 17.654 8.69 40.882-10.056 81.2-43.782 101.842z"></path>
</svg>
Safari <i>(Mac and iOS)</i>
</div><div>
<svg id="browser_opera" width="100%" height="1em" viewBox="0 0 1024 1024">
<path fill="#ffffff" d="M510.046 0c-279.724 0-480.748 202.896-480.748 507.224 0 270.818 195.502 516.776 480.784 516.776 288.078 0 484.62-245.886 484.62-516.776 0-306.76-207.446-507.224-484.656-507.224zM688.358 498.542c-0.068 169.352-9.098 410.482-178.276 410.482v0.034c-166.784 0-173.432-241.266-173.432-410.308 0-198.38 18.56-388.568 173.432-388.568 154.874 0 178.276 192.584 178.276 388.36z"></path>
</svg>
Opera <i>(desktop and mobile)</i>
</div><div>
<svg id="browser_android" width="100%" height="1em" viewBox="0 0 24 24">
<path fill="#ffffff" d="M15 5.016v-1.031h-0.984v1.031h0.984zM9.984 5.016v-1.031h-0.984v1.031h0.984zM15.516 2.156c1.5 1.078 2.484 2.859 2.484 4.828h-12c0-1.969 0.938-3.75 2.438-4.828l-1.313-1.313c-0.188-0.188-0.188-0.516 0-0.703s0.516-0.188 0.703 0l1.5 1.5c0.797-0.422 1.734-0.656 2.672-0.656s1.828 0.234 2.625 0.656l1.5-1.5c0.188-0.188 0.516-0.188 0.703 0s0.188 0.516 0 0.703zM20.484 8.016c0.844 0 1.5 0.656 1.5 1.5v6.984c0 0.844-0.656 1.5-1.5 1.5s-1.5-0.656-1.5-1.5v-6.984c0-0.844 0.656-1.5 1.5-1.5zM3.516 8.016c0.844 0 1.5 0.656 1.5 1.5v6.984c0 0.844-0.656 1.5-1.5 1.5s-1.5-0.656-1.5-1.5v-6.984c0-0.844 0.656-1.5 1.5-1.5zM6 18v-9.984h12v9.984c0 0.563-0.422 0.984-0.984 0.984h-1.031v3.516c0 0.844-0.656 1.5-1.5 1.5s-1.5-0.656-1.5-1.5v-3.516h-1.969v3.516c0 0.844-0.656 1.5-1.5 1.5s-1.5-0.656-1.5-1.5v-3.516h-1.031c-0.563 0-0.984-0.422-0.984-0.984z"></path>
</svg>
Android Browser <i>(OS version 5+)</i>
</div>
</div>
</section>
<section id="docs_section">
<h2 id="getting_started">Getting Started</h2>
<h3>Registration - Where it All Begins</h3>
<p>
The most important method in the X-Tag library is <code>xtag.register()</code>. The register function on the X-Tag object is what you'll use
to create new custom element definitions, which can include things like lifecycle callbacks, attibute-linked getters/setters (accessors),
and event listeners. Here's what defining a simple custom element looks like with X-Tag:
</p>
<pre class="language-javascript"><code>
xtag.register('x-frankenstein', {
lifecycle:{
created: function(){
alert("Look! It's moving. It's alive!");
}
}
});
</code></pre>
<hr/>
<h3>Content is King</h3>
<p>
For many of the components you create, you'll want to insert various elements into them for structure and presentation purposes. X-Tag provides some awesome features to help you with this.
The primary method for adding content to your component with X-Tag is the <code>content</code> property of your component registration defintion.
The <code>content</code> property accepts both a simple HTML string, or a comment string within a function to enable multiline HTML snippets. Below are examples
of what each variant looks like in practice.
</p>
<h4>Simple string:</h4>
<pre class="language-javascript"><code>
xtag.register('x-frankenstein', {
content: '‹h2›My name is Frank‹/h2›' +
'‹span›I work for a mad scientist‹/span›'
});
</code></pre>
<h4>Multi-line string:</h4>
<pre class="language-javascript"><code>
xtag.register('x-frankenstein', {
content: function(){/*
‹h2›My name is Frank‹/h2›
‹span›I work for a mad scientist‹/span›
*/}
});
</code></pre>
<hr/>
<h3>Meet the Lifecycle Callbacks</h3>
<p>
There are four lifecycle callbacks you will rely on to develop your components.
Here's an example of what each looks like when specified in an element definition:
</p>
<pre class="language-javascript"><code>
xtag.register('x-foo', {
lifecycle:{
created: function(){
alert('I fire when an ‹x-foo› is CREATED');
},
inserted: function(){
alert('I fire when an ‹x-foo› is INSERTED to the DOM');
},
removed: function(){
alert('I fire when an ‹x-foo› is REMOVED from the DOM');
},
attributeChanged: function(attrName, oldValue, newValue){
alert('I fire when an ATTRIBUTE is CHANGED on an ‹x-foo›');
}
}
});
</code></pre>
<hr/>
<h3>Adding Methods to the Mix</h3>
<p>
Your custom elements will likely need some of their own, unique methods to provide the functionality you desire.
X-Tag makes method addition a snap, just add a <code>methods</code> object to your top-level <code>xtag.register()</code> definition object
and include your methods within it - here's what it looks like:
</p>
<pre class="language-javascript"><code>
xtag.register('x-shouter', {
lifecycle:{
created: function(){
this.shout('WHY AM I YELLING?');
}
},
methods: {
shout: function(message){
alert(message);
}
}
});
</code></pre>
<hr/>
<h3>Say Hello to Accessors</h3>
<p>
X-Tag has built-in features to deal with attributes, setters, getters, and link them all together to provide a common interface.
To use these features, you first add an <code>accessors</code> object to the top level of your <code>xtag.register()</code> definition object.
Within this object you can add keys names that will be made available as getters/setters, as seen below. By adding the key <code>attribute</code>,
to an accessor, it tells X-Tag to link the setter/getter with the corresponding HTML attribute of the same name. When attributes are linked to
a getter/setter, their gets, sets, and state will remain in sync without having to write any additional code.
</p>
<p>
The `attribute` property of an accessor has a few options you can use to change behavior and perform advanced syncing to other parts of your component.
Some of these advanced options include `boolean`, `property`, and `validate`, which are detailed in the examples below.
</p>
<pre class="language-javascript"><code>
xtag.register('x-foo', {
content: '‹input /›',
lifecycle:{
created: function(){
this.xtag.input = this.querySelector('input');
}
},
accessors: {
disabled: {
// The `attribute` property links node.bar gets/sets to the bar="" attribute
attribute: {
// Including the boolean property turns this into a boolean attribute/setter
boolean: true,
// The property field allows you reflect changes down to a cached node.
// Notice the input element is cached to the `input` property in `created`
property: 'input'
},
get: function(){
// do something when the getter is accessed
},
set: function(value){
// act on the value being passed to the setter
}
}
}
});
xtag.register('x-bar', {
accessors: {
// X-Tag utomatically maps camelcased accessor setter names to their
// dashed attribute equivalents. In this example, `limitedCount` maps
// to the `limited-count` attribute.
limitedCount: {
attribute: {
// Allows you to validate values passed to your accessor
validate: function(val){
return val < 10 ? val : 10;
}
},
get: function(val){
// do something when the getter is accessed
},
set: function(value){
// act on the value being passed to the setter
}
}
}
});
</code></pre>
<hr/>
<h3>The DL on Events</h3>
<p>
X-Tag provides an insanely powerful event system you'll use often in developing your components.
We'll cover the basics here, and leave the more advanced features for a special tutorial dedicated to the topic.
</p>
<p>
The first thing you'll need to do to attach events to your component is add an <code>events</code> object to the top level
of your <code>xtag.register()</code> definition object. The keys of this object are the names of the events you wish to attach to your custom element.
In the example below you'll see a familiar, native event name, <code>focus</code>, and a couple that X-Tag provides to make life easier:
<code>tap</code> and <code>move</code>. These are just two of the custom events X-Tag provides that unify, optimize, and simplify common event interactions
across platforms and devices. In the case of <code>tap</code> and <code>move</code>, X-Tag is unifying the mouse and touch equivalents of these events - have a look:
</p>
<pre class="language-javascript"><code>
xtag.register('x-foo', {
events: {
focus: function(){
// perform an action when the user focuses something
// within your custom element.
},
tap: function(){
// perform an action when the user taps your custom
// element via a mouse click or touch input.
},
move: function(){
// perform an action when the user moves their
// mouse click or finger (touch) over your element
}
}
});
</code></pre>
<hr/>
<h3>Gettin' Jedi with Pseudos</h3>
<p>
One advanced feature of X-Tag you should be aware of right off the bat is the <code>delegate</code> pseudo.
X-Tag features a function modifier system called <code>pseudos</code> which allows you to seamlessly wrap
functions anywhere in your custom element defintion object (lifecycle callbacks, methods, accessors, and events)
to extend their functionality. The <code>delegate</code> pseudo enables you to quickly add event delegation
(filtering of event targets based on CSS expressions) to any event function you add to your component. Here's an example:</p>
<pre class="language-javascript"><code>
xtag.register('x-foo', {
content: '‹input/›',
events: {
'tap:delegate(input)': function(){
// Perform an action only when the user taps on an
// ‹input/› element within your component.
}
}
});
</code></pre>
<h4>Create your own Pseudo:</h4>
<p>
Once you create a pseudo and add it to the main xtag.pseudos object, as show below,
you can then use it on any key of your custom element defintion objects that has a
function as its value.
</p>
<pre class="language-javascript"><code>
xtag.pseudos.example = {
onAdd: function(){
/*
This function is fired once when the base function is added to
the target object. For instance:
If you added an event with xtag.addEvent(someNode, 'tap:example', fn),
the onAdd function of the 'example' pseudo would be fired once when
the event is first attached to the element 'someNode'.
*/
},
onRemove: function(){
/*
This is basically the opposite of the onAdd function above.
With onRemove, you can clean up whatever you may have done
in your onAdd or action function invocations.
*/
},
action: function(pseudo, event) {
/*
This function is fired each time the pseudo chain is fired.
Pseudo actions are fired in the order they are chained, meaning
the in the pseudo 'toggle:log:example', the action function
for the 'log' pseudo would fire first, then the 'example' action
and finally the base function 'toggle' they are chained to.
*/
}
};
</code></pre>
<hr/>
<h3>Inheritance</h3>
<p>X-Tag uses the standard Custom Elements API for inheritance.
Custom elements can inherit from standard DOM elements by using
the <code>extends</code> property.
</p>
<pre class="language-javascript"><code>
xtag.register('x-checkbox', {
extends: 'input',
lifecycle: {
created : function(){
this.type = "checkbox";
}
}
});
</code></pre>
<p>To use the extended standard DOM element the <code>is</code> syntax is need.</p>
<pre class="language-javascript"><code>
<input is="x-checkbox"> </input>
</code></pre>
<h4>Extending custom elements:</h4>
<p>
To extend custom elements, you need to use the
the <code>prototype</code> property. Keep in mind that when any of the properties of the custom element is
overwritten, it gets added to an execution queue. When accessed, the base property will be executed first
and then the rest of the queue will be accessed. For this cases the <code>is</code> syntax is
not needed.
</p>
<pre class="language-javascript"><code>
var xSpan = xtag.register('x-span', {
content: '<span></span>',
methods: {
render() {
// some render logic
},
},
});
xtag.register('x-money-span', {
prototype: xSpan.prototype,
methods: {
render: function() {
// xSpan render logic gets executed first
// x-money-span render logic is executed next
},
}
});
</code></pre>
<hr/>
<h1>API Reference</h1>
<h2 id="api_xtag_register">xtag.register(NAME, DEFINITION)</h2>
<p>
Define and register a new custom element. The example below shows test values for each of
the top-level definition objects.
</p>
<table>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>NAME</td>
<td>String</td>
<td>The custom element's tag name <i>(must contain a dash)</i></td>
</tr>
<tr>
<td>DEFINITION</td>
<td>Object</td>
<td>An object containing the various features your custom element will utilize</td>
</tr>
</table>
<pre class="language-javascript"><code>
xtag.register('x-foo', {
content: '‹input/›',
lifecycle:{
created: function(){},
inserted: function(){},
removed: function(){},
attributeChanged: function(){}
},
methods: {
someMethod: function(){}
},
accessors: {
someAccessor: {
// links to the 'some-accessor' attribute
attribute: {},
set: function(){},
get: function(){}
}
},
events: {
tap: function(){},
focus: function(){}
}
});
</code></pre>
<hr/>
<h2 id="api_xtag_query">xtag.query(ELEMENT, SELECTOR)</h2>
<p>
Wrapper for querySelectorAll that always returns a true JavaScript Array. This is handly
for ensuring selections are easily iterable with standard JS Array functions, like
<code>forEach</code> and <code>map</code>.
</p>
<table>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>ELEMENT</td>
<td>DOM element refrence</td>
<td>
A reference to the DOM element you wish to query
</td>
</tr>
<tr>
<td>SELECTOR</td>
<td>String</td>
<td>
The CSS selector you would like to query the element with
</td>
</tr>
</table>
<pre class="language-javascript"><code>
var itemArray = xtag.query(document.body, 'ul li');
</code></pre>
<hr />
<h2 id="api_xtag_querychildren">xtag.queryChildren(ELEMENT, SELECTOR)</h2>
<p>
Query only the direct children of an element with a provided selector.
</p>
<table>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>ELEMENT</td>
<td>DOM element refrence</td>
<td>
A reference to the DOM element you wish to query.
</td>
</tr>
<tr>
<td>SELECTOR</td>
<td>String</td>
<td>
The CSS selector string you would like to test for matches against the element's direct children.
</td>
</tr>
</table>
<pre class="language-javascript"><code>
var onlyChildButtons = xtag.queryChildren(myToolbar, 'button');
</code></pre>
<hr />
<h2 id="api_xtag_createfragment">xtag.createFragment(CONTENT)</h2>
<p>
Generates a document fragment from a string, list of nodes, or a multi-line comment string.
</p>
<table>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>CONTENT</td>
<td>
<ul bulleted>
<li>String</li>
<li>Multi-line function comment</li>
</ul>
</td>
<td>
Pass in a string or function with a multi-line comment string of HTML, and a Document Fragment will be created from the contents.
</td>
</tr>
</table>
<pre class="language-javascript"><code>
var fragFromString = xtag.createFragment('‹div›Hello World!‹/div›');
var fragFromFunction = xtag.createFragment(function(){/*
‹header›Hello‹/header›
‹section›I'm a multi-line HTML fragment‹/section›
‹footer›Goodbye‹/footer›
*/});
</code></pre>
<hr />
<h2 id="api_xtag_addevent">xtag.addEvent(ELEMENT, TYPE, HANDLER)</h2>
<p>
Add a native, custom, or X-Tag library event listener to an element. The TYPE field also
accepts pseudo chains for even more powerful event handling.
</p>
<table>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>ELEMENT</td>
<td>DOM element reference</td>
<td>
The element you would like to attach an event listener to.
</td>
</tr>
<tr>
<td>TYPE</td>
<td>String</td>
<td>
The event name, with any event pseudos you may want to chain.
</td>
</tr>
<tr>
<td>HANDLER</td>
<td>Function</td>
<td>
The event handler you want called when the event occurs.
</td>
</tr>
</table>
<pre class="language-javascript"><code>
xtag.addEvent(myElement, 'tap:delegate(img)', function(event){
alert('An image element within myElement was just tapped');
});
</code></pre>
<hr />
<h2 id="api_xtag_addevents">xtag.addEvents(ELEMENT, OBJECT)</h2>
<p>
Add multiple native, custom, or X-Tag library event listeners to an element using one function.
Pseudo chains are avaliable for use in your event object keys.
</p>
<table>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>ELEMENT</td>
<td>DOM element reference</td>
<td>
The element you would like to attach the event listeners to.
</td>
</tr>
<tr>
<td>OBJECT</td>
<td>Object</td>
<td>
An object composed of multiple events - keys are event names, and values are the event handlers.
</td>
</tr>
</table>
<pre class="language-javascript"><code>
xtag.addEvents(myElement, {
'tap': function(event){
alert('myElement was just tapped');
},
'keypress:keypass(13)': function(event){
alert('The enter key was pressed, all other keys are blocked');
}
});
</code></pre>
<h2 id="api_xtag_fireevent">xtag.fireEvent(ELEMENT, NAME, OPTIONS)</h2>
<p>
Add a native, custom, or X-Tag library event listener to an element. The TYPE field also
accepts pseudo chains for even more powerful event handling.
</p>
<table>
<tr>
<th>Argument</th>
<th>Type</th>
<th>Description</th>
</tr>
<tr>
<td>ELEMENT</td>
<td>DOM element reference</td>
<td>
The element you would like to attach an event listener to.
</td>
</tr>
<tr>
<td>NAME</td>
<td>String</td>
<td>
The event name you wish to fire on the target element.
</td>
</tr>
<tr>
<td>OPTIONS</td>
<td>Object</td>
<td>
The event options you want to use in firing your event. These include:
<ul bulleted>
<li><code>detail</code>: allows passage of custom data via the detail property of the event</li>
<li><code>bubbles</code>: specify whether the event bubbles - defaults to true</li>
<li><code>cancelable</code>: specify whether the event is cancelable - defaults to true</li>
</ul>
</td>
</tr>
</table>
<pre class="language-javascript"><code>
xtag.fireEvent(myElement, 'show', {
detail: {
x: 123,
y: 456
}
});
</code></pre>
</section>
<!--<section id="code_section" shadow-box></section>
<section id="membership_section" shadow-box></section>-->
</main>
<script src="/lib/custom-elements.min.js"></script>
<script src="/lib/pep.min.js"></script>
<script src="/src/core.js"></script>
<script src="/src/pointer-events.js"></script>
<script src="/site/js/prism.js"></script>
<script src="/site/js/global.js"></script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-100027201-1', 'auto');
ga('send', 'pageview');
</script>
<!--
Credits:
Font Awesome by Dave Gandy - http://fontawesome.io
-->
</body>
</html>