@telperion/elements 6.0.0 → 7.0.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.
- package/.build-manifest.json +22 -1
- package/README.md +37 -0
- package/_chunks/code-cdn-element-ClAO2lep.d.cts +200 -0
- package/_chunks/code-cdn-element-ClAO2lep.d.ts +200 -0
- package/code/bundled-language-loader.cjs +18 -0
- package/code/bundled-language-loader.cjs.map +1 -0
- package/code/bundled-language-loader.js +16 -0
- package/code/bundled-language-loader.js.map +1 -0
- package/code/cdn-language-loader.cjs +41 -0
- package/code/cdn-language-loader.cjs.map +1 -0
- package/code/cdn-language-loader.js +36 -0
- package/code/cdn-language-loader.js.map +1 -0
- package/code/cdn.cjs +21 -0
- package/code/cdn.cjs.map +1 -0
- package/code/cdn.d.cts +3 -0
- package/code/cdn.d.ts +3 -0
- package/code/cdn.js +16 -0
- package/code/cdn.js.map +1 -0
- package/code/code-element-base.cjs +241 -0
- package/code/code-element-base.cjs.map +1 -0
- package/code/code-element-base.js +239 -0
- package/code/code-element-base.js.map +1 -0
- package/code/code-element.cjs +16 -0
- package/code/code-element.cjs.map +1 -0
- package/code/code-element.js +14 -0
- package/code/code-element.js.map +1 -0
- package/code/copy.cjs +41 -0
- package/code/copy.cjs.map +1 -0
- package/code/copy.js +39 -0
- package/code/copy.js.map +1 -0
- package/code/css-variables-theme.cjs +24 -0
- package/code/css-variables-theme.cjs.map +1 -0
- package/code/css-variables-theme.js +21 -0
- package/code/css-variables-theme.js.map +1 -0
- package/code/highlighter.cjs +84 -0
- package/code/highlighter.cjs.map +1 -0
- package/code/highlighter.js +80 -0
- package/code/highlighter.js.map +1 -0
- package/code/index.cjs +19 -0
- package/code/index.cjs.map +1 -0
- package/code/index.d.cts +13 -0
- package/code/index.d.ts +13 -0
- package/code/index.js +6 -0
- package/code/index.js.map +1 -0
- package/code/language-loader.cjs +22 -0
- package/code/language-loader.cjs.map +1 -0
- package/code/language-loader.js +19 -0
- package/code/language-loader.js.map +1 -0
- package/code/line-ranges.cjs +28 -0
- package/code/line-ranges.cjs.map +1 -0
- package/code/line-ranges.js +25 -0
- package/code/line-ranges.js.map +1 -0
- package/code/source.cjs +52 -0
- package/code/source.cjs.map +1 -0
- package/code/source.js +48 -0
- package/code/source.js.map +1 -0
- package/code/styles.cjs +183 -0
- package/code/styles.cjs.map +1 -0
- package/code/styles.js +181 -0
- package/code/styles.js.map +1 -0
- package/code/templates.cjs +66 -0
- package/code/templates.cjs.map +1 -0
- package/code/templates.js +63 -0
- package/code/templates.js.map +1 -0
- package/custom-elements.json +1190 -1
- package/fesm/elements.mjs +19 -1
- package/fesm/elements.mjs.map +1 -1
- package/iife/code/cdn.js +263 -0
- package/iife/code/cdn.js.map +1 -0
- package/iife/elements.js +25 -25
- package/iife/elements.js.map +1 -1
- package/iife/portal/index.js +1 -1
- package/iife/portal/index.js.map +1 -1
- package/index.cjs +2 -0
- package/index.cjs.map +1 -1
- package/index.d.cts +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/package.json +39 -2
- package/portal/index.cjs +2 -0
- package/portal/index.cjs.map +1 -1
- package/portal/index.d.cts +28 -1
- package/portal/index.d.ts +28 -1
- package/portal/index.js +1 -0
- package/portal/index.js.map +1 -1
- package/portal/portal-outlet-fallback-element.cjs +19 -0
- package/portal/portal-outlet-fallback-element.cjs.map +1 -0
- package/portal/portal-outlet-fallback-element.js +17 -0
- package/portal/portal-outlet-fallback-element.js.map +1 -0
- package/portal/styles.cjs +5 -0
- package/portal/styles.cjs.map +1 -1
- package/portal/styles.js +5 -0
- package/portal/styles.js.map +1 -1
package/custom-elements.json
CHANGED
|
@@ -268,6 +268,1150 @@
|
|
|
268
268
|
}
|
|
269
269
|
]
|
|
270
270
|
},
|
|
271
|
+
{
|
|
272
|
+
"kind": "javascript-module",
|
|
273
|
+
"path": "src/code/bundled-language-loader.ts",
|
|
274
|
+
"declarations": [
|
|
275
|
+
{
|
|
276
|
+
"kind": "function",
|
|
277
|
+
"name": "bundledLanguageLoader",
|
|
278
|
+
"parameters": [
|
|
279
|
+
{
|
|
280
|
+
"name": "name"
|
|
281
|
+
}
|
|
282
|
+
],
|
|
283
|
+
"description": "Loads any Shiki-bundled language (ids and aliases) through its own dynamic\n`import()`, so bundlers split every grammar into a separate lazy chunk and\nconsumers only download the languages they actually render."
|
|
284
|
+
}
|
|
285
|
+
],
|
|
286
|
+
"exports": [
|
|
287
|
+
{
|
|
288
|
+
"kind": "js",
|
|
289
|
+
"name": "bundledLanguageLoader",
|
|
290
|
+
"declaration": {
|
|
291
|
+
"name": "bundledLanguageLoader",
|
|
292
|
+
"module": "src/code/bundled-language-loader.ts"
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
]
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"kind": "javascript-module",
|
|
299
|
+
"path": "src/code/cdn-language-loader.ts",
|
|
300
|
+
"declarations": [
|
|
301
|
+
{
|
|
302
|
+
"kind": "variable",
|
|
303
|
+
"name": "SHIKI_LANGS_VERSION",
|
|
304
|
+
"type": {
|
|
305
|
+
"text": "string"
|
|
306
|
+
},
|
|
307
|
+
"default": "\"4.6.0\"",
|
|
308
|
+
"description": "Version of `@shikijs/langs` fetched from the CDN. Must match the installed\n`shiki` version (a spec enforces this)."
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"kind": "function",
|
|
312
|
+
"name": "setLanguageCdnBaseUrl",
|
|
313
|
+
"return": {
|
|
314
|
+
"type": {
|
|
315
|
+
"text": "void"
|
|
316
|
+
}
|
|
317
|
+
},
|
|
318
|
+
"parameters": [
|
|
319
|
+
{
|
|
320
|
+
"name": "url",
|
|
321
|
+
"default": "DEFAULT_BASE_URL",
|
|
322
|
+
"type": {
|
|
323
|
+
"text": "string"
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
],
|
|
327
|
+
"description": "Points the CDN loader at another host serving `@shikijs/langs/dist/*.mjs`\n(e.g. a self-hosted mirror). Pass nothing to restore the jsDelivr default."
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"kind": "function",
|
|
331
|
+
"name": "languageCdnUrl",
|
|
332
|
+
"return": {
|
|
333
|
+
"type": {
|
|
334
|
+
"text": "string"
|
|
335
|
+
}
|
|
336
|
+
},
|
|
337
|
+
"parameters": [
|
|
338
|
+
{
|
|
339
|
+
"name": "name",
|
|
340
|
+
"type": {
|
|
341
|
+
"text": "string"
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
],
|
|
345
|
+
"description": "The URL a language module is fetched from."
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"kind": "function",
|
|
349
|
+
"name": "cdnLanguageLoader",
|
|
350
|
+
"parameters": [
|
|
351
|
+
{
|
|
352
|
+
"name": "name"
|
|
353
|
+
}
|
|
354
|
+
],
|
|
355
|
+
"description": "Imports grammars at runtime from the CDN. Used by the self-contained IIFE\nbuild, which cannot code-split Shiki's bundled grammars. Every id and alias\nhas its own module in `@shikijs/langs`, and embedded languages are imported\nrelatively, so no alias table is needed here."
|
|
356
|
+
}
|
|
357
|
+
],
|
|
358
|
+
"exports": [
|
|
359
|
+
{
|
|
360
|
+
"kind": "js",
|
|
361
|
+
"name": "SHIKI_LANGS_VERSION",
|
|
362
|
+
"declaration": {
|
|
363
|
+
"name": "SHIKI_LANGS_VERSION",
|
|
364
|
+
"module": "src/code/cdn-language-loader.ts"
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
"kind": "js",
|
|
369
|
+
"name": "setLanguageCdnBaseUrl",
|
|
370
|
+
"declaration": {
|
|
371
|
+
"name": "setLanguageCdnBaseUrl",
|
|
372
|
+
"module": "src/code/cdn-language-loader.ts"
|
|
373
|
+
}
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"kind": "js",
|
|
377
|
+
"name": "languageCdnUrl",
|
|
378
|
+
"declaration": {
|
|
379
|
+
"name": "languageCdnUrl",
|
|
380
|
+
"module": "src/code/cdn-language-loader.ts"
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
"kind": "js",
|
|
385
|
+
"name": "cdnLanguageLoader",
|
|
386
|
+
"declaration": {
|
|
387
|
+
"name": "cdnLanguageLoader",
|
|
388
|
+
"module": "src/code/cdn-language-loader.ts"
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
]
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"kind": "javascript-module",
|
|
395
|
+
"path": "src/code/code-cdn-element.ts",
|
|
396
|
+
"declarations": [],
|
|
397
|
+
"exports": [
|
|
398
|
+
{
|
|
399
|
+
"kind": "custom-element-definition",
|
|
400
|
+
"name": "tp-code",
|
|
401
|
+
"declaration": {
|
|
402
|
+
"name": "CodeElement",
|
|
403
|
+
"module": "/src/code/code-element-base"
|
|
404
|
+
}
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
"kind": "js",
|
|
408
|
+
"name": "CodeElement",
|
|
409
|
+
"declaration": {
|
|
410
|
+
"name": "CodeElement",
|
|
411
|
+
"module": "src/code/code-cdn-element.ts"
|
|
412
|
+
}
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
"kind": "js",
|
|
416
|
+
"name": "setLanguageCdnBaseUrl",
|
|
417
|
+
"declaration": {
|
|
418
|
+
"name": "setLanguageCdnBaseUrl",
|
|
419
|
+
"module": "./cdn-language-loader"
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
"kind": "js",
|
|
424
|
+
"name": "languageCdnUrl",
|
|
425
|
+
"declaration": {
|
|
426
|
+
"name": "languageCdnUrl",
|
|
427
|
+
"module": "./cdn-language-loader"
|
|
428
|
+
}
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
"kind": "js",
|
|
432
|
+
"name": "SHIKI_LANGS_VERSION",
|
|
433
|
+
"declaration": {
|
|
434
|
+
"name": "SHIKI_LANGS_VERSION",
|
|
435
|
+
"module": "./cdn-language-loader"
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
"kind": "js",
|
|
440
|
+
"name": "setLanguageLoader",
|
|
441
|
+
"declaration": {
|
|
442
|
+
"name": "setLanguageLoader",
|
|
443
|
+
"module": "./language-loader"
|
|
444
|
+
}
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
"kind": "js",
|
|
448
|
+
"name": "LanguageLoader",
|
|
449
|
+
"declaration": {
|
|
450
|
+
"name": "LanguageLoader",
|
|
451
|
+
"module": "./language-loader"
|
|
452
|
+
}
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
"kind": "js",
|
|
456
|
+
"name": "CodeVariant",
|
|
457
|
+
"declaration": {
|
|
458
|
+
"name": "CodeVariant",
|
|
459
|
+
"module": "./types"
|
|
460
|
+
}
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
"kind": "js",
|
|
464
|
+
"name": "CodeCopyEventDetail",
|
|
465
|
+
"declaration": {
|
|
466
|
+
"name": "CodeCopyEventDetail",
|
|
467
|
+
"module": "./types"
|
|
468
|
+
}
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
"kind": "js",
|
|
472
|
+
"name": "CodeHighlightEventDetail",
|
|
473
|
+
"declaration": {
|
|
474
|
+
"name": "CodeHighlightEventDetail",
|
|
475
|
+
"module": "./types"
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
]
|
|
479
|
+
},
|
|
480
|
+
{
|
|
481
|
+
"kind": "javascript-module",
|
|
482
|
+
"path": "src/code/code-element-base.ts",
|
|
483
|
+
"declarations": [
|
|
484
|
+
{
|
|
485
|
+
"kind": "class",
|
|
486
|
+
"description": "`<tp-code>` — syntax-highlighted code powered by [Shiki](https://shiki.style).\n\n- **Source**: the element's text content, a direct `<template>` child (for\n HTML samples, no escaping needed), or the `code` property. Light-DOM\n changes are observed and re-highlighted.\n- **Languages**: any Shiki language id or alias via `language`, loaded lazily\n once per page. Unknown languages render as plain text.\n- **Rendering**: into shadow DOM, so the light DOM stays the untouched\n source of truth; style through `--tp-code-*` variables and `::part()`.\n- **Async**: plain text renders immediately and is swapped for highlighted\n tokens once the grammar loads — same line layout, no shift.\n\n#### Examples\n\n```html\n<p>Run <tp-code language=\"sh\">pnpm install</tp-code> first.</p>\n\n<tp-code variant=\"block\" language=\"ts\" line-numbers highlight-lines=\"2\" copyable>\n const answer = 42;\n console.log(answer);\n</tp-code>\n```",
|
|
487
|
+
"name": "CodeElement",
|
|
488
|
+
"cssProperties": [
|
|
489
|
+
{
|
|
490
|
+
"description": "Text color. Defaults to `--tp-color-contrast`.",
|
|
491
|
+
"name": "--tp-code-foreground"
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
"description": "Surface color. Defaults to a 6% tint of the foreground.",
|
|
495
|
+
"name": "--tp-code-background"
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
"description": "Monospace font stack.",
|
|
499
|
+
"name": "--tp-code-font-family"
|
|
500
|
+
},
|
|
501
|
+
{
|
|
502
|
+
"description": "Defaults to `0.875em`.",
|
|
503
|
+
"name": "--tp-code-font-size"
|
|
504
|
+
},
|
|
505
|
+
{
|
|
506
|
+
"description": "Block line height. Defaults to `1.6`.",
|
|
507
|
+
"name": "--tp-code-line-height"
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
"description": "Defaults to `2`.",
|
|
511
|
+
"name": "--tp-code-tab-size"
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
"description": "Corner radius (`0.3em` inline, `0.5em` block).",
|
|
515
|
+
"name": "--tp-code-radius"
|
|
516
|
+
},
|
|
517
|
+
{
|
|
518
|
+
"description": "Inline padding. Defaults to `0.1em 0.35em`.",
|
|
519
|
+
"name": "--tp-code-inline-padding"
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
"description": "Block vertical padding. Defaults to `1em`.",
|
|
523
|
+
"name": "--tp-code-padding-block"
|
|
524
|
+
},
|
|
525
|
+
{
|
|
526
|
+
"description": "Block horizontal padding per line. Defaults to `1em`.",
|
|
527
|
+
"name": "--tp-code-padding-inline"
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
"description": "How much of the palette color token defaults keep vs. the foreground. Defaults to `80%`.",
|
|
531
|
+
"name": "--tp-code-accent-strength"
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
"description": "Keywords. Defaults from `--tp-color-secondary`.",
|
|
535
|
+
"name": "--tp-code-token-keyword"
|
|
536
|
+
},
|
|
537
|
+
{
|
|
538
|
+
"description": "Functions. Defaults from `--tp-color-primary`.",
|
|
539
|
+
"name": "--tp-code-token-function"
|
|
540
|
+
},
|
|
541
|
+
{
|
|
542
|
+
"description": "Constants, numbers, variables.",
|
|
543
|
+
"name": "--tp-code-token-constant"
|
|
544
|
+
},
|
|
545
|
+
{
|
|
546
|
+
"description": "Strings. Defaults from `--tp-color-success`.",
|
|
547
|
+
"name": "--tp-code-token-string"
|
|
548
|
+
},
|
|
549
|
+
{
|
|
550
|
+
"description": "Template/string expressions.",
|
|
551
|
+
"name": "--tp-code-token-string-expression"
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
"description": "Parameters. Defaults from `--tp-color-warning`.",
|
|
555
|
+
"name": "--tp-code-token-parameter"
|
|
556
|
+
},
|
|
557
|
+
{
|
|
558
|
+
"description": "Comments.",
|
|
559
|
+
"name": "--tp-code-token-comment"
|
|
560
|
+
},
|
|
561
|
+
{
|
|
562
|
+
"description": "Punctuation.",
|
|
563
|
+
"name": "--tp-code-token-punctuation"
|
|
564
|
+
},
|
|
565
|
+
{
|
|
566
|
+
"description": "Links.",
|
|
567
|
+
"name": "--tp-code-token-link"
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
"description": "Diff insertions.",
|
|
571
|
+
"name": "--tp-code-token-inserted"
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
"description": "Diff deletions. Defaults from `--tp-color-danger`.",
|
|
575
|
+
"name": "--tp-code-token-deleted"
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
"description": "Diff changes.",
|
|
579
|
+
"name": "--tp-code-token-changed"
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
"description": "ANSI colors (also `-red`, `-green`, `-yellow`, `-blue`, `-magenta`, `-cyan`, `-white` and their `-bright-*` variants) for `ansi` code.",
|
|
583
|
+
"name": "--tp-code-ansi-black"
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
"description": "Line number color.",
|
|
587
|
+
"name": "--tp-code-line-number-color"
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
"description": "Space between line numbers and code. Defaults to `1.5em`.",
|
|
591
|
+
"name": "--tp-code-line-number-gap"
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
"description": "Highlighted line background. Defaults from `--tp-color-primary`.",
|
|
595
|
+
"name": "--tp-code-line-highlight-background"
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
"description": "Highlighted line edge marker.",
|
|
599
|
+
"name": "--tp-code-line-highlight-border-color"
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
"description": "Copy button background. Defaults to `Canvas`.",
|
|
603
|
+
"name": "--tp-code-copy-background"
|
|
604
|
+
},
|
|
605
|
+
{
|
|
606
|
+
"description": "Copy button icon color.",
|
|
607
|
+
"name": "--tp-code-copy-color"
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
"description": "Copy button color after a successful copy.",
|
|
611
|
+
"name": "--tp-code-copy-success-color"
|
|
612
|
+
}
|
|
613
|
+
],
|
|
614
|
+
"cssParts": [
|
|
615
|
+
{
|
|
616
|
+
"description": "Block wrapper (`<pre>`).",
|
|
617
|
+
"name": "pre"
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
"description": "The `<code>` element (both variants).",
|
|
621
|
+
"name": "code"
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
"description": "Every line (block).",
|
|
625
|
+
"name": "line"
|
|
626
|
+
},
|
|
627
|
+
{
|
|
628
|
+
"description": "Lines matched by `highlight-lines`.",
|
|
629
|
+
"name": "highlighted-line"
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
"description": "The copy button.",
|
|
633
|
+
"name": "copy-button"
|
|
634
|
+
}
|
|
635
|
+
],
|
|
636
|
+
"members": [
|
|
637
|
+
{
|
|
638
|
+
"kind": "field",
|
|
639
|
+
"name": "variant",
|
|
640
|
+
"type": {
|
|
641
|
+
"text": "CodeVariant"
|
|
642
|
+
},
|
|
643
|
+
"default": "\"inline\"",
|
|
644
|
+
"description": "Layout: `inline` (default) or `block`.",
|
|
645
|
+
"attribute": "variant",
|
|
646
|
+
"reflects": true
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
"kind": "field",
|
|
650
|
+
"name": "language",
|
|
651
|
+
"type": {
|
|
652
|
+
"text": "string"
|
|
653
|
+
},
|
|
654
|
+
"default": "\"\"",
|
|
655
|
+
"description": "Shiki language id or alias. Empty/`text`/unknown renders plain text.",
|
|
656
|
+
"attribute": "language",
|
|
657
|
+
"reflects": true
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
"kind": "field",
|
|
661
|
+
"name": "lineNumbers",
|
|
662
|
+
"type": {
|
|
663
|
+
"text": "boolean"
|
|
664
|
+
},
|
|
665
|
+
"default": "false",
|
|
666
|
+
"description": "Block only. Shows line numbers.",
|
|
667
|
+
"attribute": "line-numbers",
|
|
668
|
+
"reflects": true
|
|
669
|
+
},
|
|
670
|
+
{
|
|
671
|
+
"kind": "field",
|
|
672
|
+
"name": "lineStart",
|
|
673
|
+
"type": {
|
|
674
|
+
"text": "number"
|
|
675
|
+
},
|
|
676
|
+
"default": "1",
|
|
677
|
+
"description": "Block only. Number of the first line.",
|
|
678
|
+
"attribute": "line-start"
|
|
679
|
+
},
|
|
680
|
+
{
|
|
681
|
+
"kind": "field",
|
|
682
|
+
"name": "highlightLines",
|
|
683
|
+
"type": {
|
|
684
|
+
"text": "string"
|
|
685
|
+
},
|
|
686
|
+
"default": "\"\"",
|
|
687
|
+
"description": "Block only. Lines to emphasize, e.g. `\"2, 4-6\"`.",
|
|
688
|
+
"attribute": "highlight-lines"
|
|
689
|
+
},
|
|
690
|
+
{
|
|
691
|
+
"kind": "field",
|
|
692
|
+
"name": "copyable",
|
|
693
|
+
"type": {
|
|
694
|
+
"text": "boolean"
|
|
695
|
+
},
|
|
696
|
+
"default": "false",
|
|
697
|
+
"description": "Block only. Shows a copy-to-clipboard button.",
|
|
698
|
+
"attribute": "copyable",
|
|
699
|
+
"reflects": true
|
|
700
|
+
},
|
|
701
|
+
{
|
|
702
|
+
"kind": "field",
|
|
703
|
+
"name": "code",
|
|
704
|
+
"type": {
|
|
705
|
+
"text": "string | undefined"
|
|
706
|
+
},
|
|
707
|
+
"description": "Source code. When set, it overrides the light-DOM content; set it back to\n`undefined` to fall back to the children again."
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
"kind": "field",
|
|
711
|
+
"name": "rawSource",
|
|
712
|
+
"type": {
|
|
713
|
+
"text": "string"
|
|
714
|
+
},
|
|
715
|
+
"privacy": "private",
|
|
716
|
+
"default": "\"\"",
|
|
717
|
+
"description": "Raw source read from `code` or the light DOM."
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
"kind": "field",
|
|
721
|
+
"name": "tokens",
|
|
722
|
+
"type": {
|
|
723
|
+
"text": "ThemedToken[][] | undefined"
|
|
724
|
+
},
|
|
725
|
+
"privacy": "private"
|
|
726
|
+
},
|
|
727
|
+
{
|
|
728
|
+
"kind": "field",
|
|
729
|
+
"name": "copied",
|
|
730
|
+
"type": {
|
|
731
|
+
"text": "boolean"
|
|
732
|
+
},
|
|
733
|
+
"privacy": "private",
|
|
734
|
+
"default": "false"
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
"kind": "field",
|
|
738
|
+
"name": "#source",
|
|
739
|
+
"privacy": "private",
|
|
740
|
+
"type": {
|
|
741
|
+
"text": "string"
|
|
742
|
+
},
|
|
743
|
+
"default": "\"\""
|
|
744
|
+
},
|
|
745
|
+
{
|
|
746
|
+
"kind": "field",
|
|
747
|
+
"name": "#ranges",
|
|
748
|
+
"privacy": "private",
|
|
749
|
+
"type": {
|
|
750
|
+
"text": "LineRanges"
|
|
751
|
+
},
|
|
752
|
+
"default": "[]"
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
"kind": "field",
|
|
756
|
+
"name": "#observer",
|
|
757
|
+
"privacy": "private",
|
|
758
|
+
"type": {
|
|
759
|
+
"text": "MutationObserver | undefined"
|
|
760
|
+
}
|
|
761
|
+
},
|
|
762
|
+
{
|
|
763
|
+
"kind": "field",
|
|
764
|
+
"name": "#request",
|
|
765
|
+
"privacy": "private",
|
|
766
|
+
"type": {
|
|
767
|
+
"text": "number"
|
|
768
|
+
},
|
|
769
|
+
"default": "0"
|
|
770
|
+
},
|
|
771
|
+
{
|
|
772
|
+
"kind": "field",
|
|
773
|
+
"name": "#highlightDone",
|
|
774
|
+
"privacy": "private",
|
|
775
|
+
"type": {
|
|
776
|
+
"text": "Promise<void>"
|
|
777
|
+
}
|
|
778
|
+
},
|
|
779
|
+
{
|
|
780
|
+
"kind": "field",
|
|
781
|
+
"name": "#copiedTimer",
|
|
782
|
+
"privacy": "private",
|
|
783
|
+
"type": {
|
|
784
|
+
"text": "ReturnType<typeof setTimeout> | undefined"
|
|
785
|
+
}
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
"kind": "field",
|
|
789
|
+
"name": "source",
|
|
790
|
+
"type": {
|
|
791
|
+
"text": "string"
|
|
792
|
+
},
|
|
793
|
+
"description": "The normalized source being displayed (dedented for blocks, trimmed inline).",
|
|
794
|
+
"readonly": true
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
"kind": "field",
|
|
798
|
+
"name": "highlightComplete",
|
|
799
|
+
"type": {
|
|
800
|
+
"text": "Promise<void>"
|
|
801
|
+
},
|
|
802
|
+
"description": "Resolves once the current highlight pass (if any) has rendered.",
|
|
803
|
+
"readonly": true
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
"kind": "method",
|
|
807
|
+
"name": "copy",
|
|
808
|
+
"return": {
|
|
809
|
+
"type": {
|
|
810
|
+
"text": ""
|
|
811
|
+
}
|
|
812
|
+
},
|
|
813
|
+
"description": "Copies the displayed source to the clipboard and fires `tp-code-copy`."
|
|
814
|
+
},
|
|
815
|
+
{
|
|
816
|
+
"kind": "method",
|
|
817
|
+
"name": "#syncSource",
|
|
818
|
+
"privacy": "private",
|
|
819
|
+
"return": {
|
|
820
|
+
"type": {
|
|
821
|
+
"text": "void"
|
|
822
|
+
}
|
|
823
|
+
}
|
|
824
|
+
},
|
|
825
|
+
{
|
|
826
|
+
"kind": "method",
|
|
827
|
+
"name": "#highlight",
|
|
828
|
+
"privacy": "private",
|
|
829
|
+
"return": {
|
|
830
|
+
"type": {
|
|
831
|
+
"text": "void"
|
|
832
|
+
}
|
|
833
|
+
},
|
|
834
|
+
"description": "Starts a highlight pass; results from superseded passes are dropped."
|
|
835
|
+
}
|
|
836
|
+
],
|
|
837
|
+
"events": [
|
|
838
|
+
{
|
|
839
|
+
"name": "tp-code-copy",
|
|
840
|
+
"type": {
|
|
841
|
+
"text": "CustomEvent"
|
|
842
|
+
},
|
|
843
|
+
"description": "After the copy button is used. `detail: { code, success }`."
|
|
844
|
+
},
|
|
845
|
+
{
|
|
846
|
+
"name": "tp-code-highlight",
|
|
847
|
+
"type": {
|
|
848
|
+
"text": "CustomEvent"
|
|
849
|
+
},
|
|
850
|
+
"description": "After each highlight pass. `detail: { language, highlighted }`."
|
|
851
|
+
}
|
|
852
|
+
],
|
|
853
|
+
"attributes": [
|
|
854
|
+
{
|
|
855
|
+
"type": {
|
|
856
|
+
"text": "CodeVariant"
|
|
857
|
+
},
|
|
858
|
+
"description": "Layout: `inline` (default) or `block`.",
|
|
859
|
+
"name": "variant",
|
|
860
|
+
"default": "\"inline\"",
|
|
861
|
+
"fieldName": "variant"
|
|
862
|
+
},
|
|
863
|
+
{
|
|
864
|
+
"type": {
|
|
865
|
+
"text": "string"
|
|
866
|
+
},
|
|
867
|
+
"description": "Shiki language id or alias. Empty/`text`/unknown renders plain text.",
|
|
868
|
+
"name": "language",
|
|
869
|
+
"default": "\"\"",
|
|
870
|
+
"fieldName": "language"
|
|
871
|
+
},
|
|
872
|
+
{
|
|
873
|
+
"type": {
|
|
874
|
+
"text": "boolean"
|
|
875
|
+
},
|
|
876
|
+
"description": "Block only. Shows line numbers.",
|
|
877
|
+
"name": "line-numbers",
|
|
878
|
+
"default": "false",
|
|
879
|
+
"fieldName": "lineNumbers"
|
|
880
|
+
},
|
|
881
|
+
{
|
|
882
|
+
"type": {
|
|
883
|
+
"text": "number"
|
|
884
|
+
},
|
|
885
|
+
"description": "Block only. Number of the first line.",
|
|
886
|
+
"name": "line-start",
|
|
887
|
+
"default": "1",
|
|
888
|
+
"fieldName": "lineStart"
|
|
889
|
+
},
|
|
890
|
+
{
|
|
891
|
+
"type": {
|
|
892
|
+
"text": "string"
|
|
893
|
+
},
|
|
894
|
+
"description": "Block only. Lines to emphasize, e.g. `\"2, 4-6\"`.",
|
|
895
|
+
"name": "highlight-lines",
|
|
896
|
+
"default": "\"\"",
|
|
897
|
+
"fieldName": "highlightLines"
|
|
898
|
+
},
|
|
899
|
+
{
|
|
900
|
+
"type": {
|
|
901
|
+
"text": "boolean"
|
|
902
|
+
},
|
|
903
|
+
"description": "Block only. Shows a copy-to-clipboard button.",
|
|
904
|
+
"name": "copyable",
|
|
905
|
+
"default": "false",
|
|
906
|
+
"fieldName": "copyable"
|
|
907
|
+
}
|
|
908
|
+
],
|
|
909
|
+
"superclass": {
|
|
910
|
+
"name": "LitElement",
|
|
911
|
+
"package": "lit"
|
|
912
|
+
},
|
|
913
|
+
"tagName": "tp-code",
|
|
914
|
+
"customElement": true
|
|
915
|
+
}
|
|
916
|
+
],
|
|
917
|
+
"exports": [
|
|
918
|
+
{
|
|
919
|
+
"kind": "js",
|
|
920
|
+
"name": "CodeElement",
|
|
921
|
+
"declaration": {
|
|
922
|
+
"name": "CodeElement",
|
|
923
|
+
"module": "src/code/code-element-base.ts"
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
]
|
|
927
|
+
},
|
|
928
|
+
{
|
|
929
|
+
"kind": "javascript-module",
|
|
930
|
+
"path": "src/code/code-element.ts",
|
|
931
|
+
"declarations": [],
|
|
932
|
+
"exports": [
|
|
933
|
+
{
|
|
934
|
+
"kind": "custom-element-definition",
|
|
935
|
+
"name": "tp-code",
|
|
936
|
+
"declaration": {
|
|
937
|
+
"name": "CodeElement",
|
|
938
|
+
"module": "/src/code/code-element-base"
|
|
939
|
+
}
|
|
940
|
+
},
|
|
941
|
+
{
|
|
942
|
+
"kind": "js",
|
|
943
|
+
"name": "CodeElement",
|
|
944
|
+
"declaration": {
|
|
945
|
+
"name": "CodeElement",
|
|
946
|
+
"module": "src/code/code-element.ts"
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
]
|
|
950
|
+
},
|
|
951
|
+
{
|
|
952
|
+
"kind": "javascript-module",
|
|
953
|
+
"path": "src/code/copy.ts",
|
|
954
|
+
"declarations": [
|
|
955
|
+
{
|
|
956
|
+
"kind": "function",
|
|
957
|
+
"name": "copyText",
|
|
958
|
+
"return": {
|
|
959
|
+
"type": {
|
|
960
|
+
"text": ""
|
|
961
|
+
}
|
|
962
|
+
},
|
|
963
|
+
"parameters": [
|
|
964
|
+
{
|
|
965
|
+
"name": "text",
|
|
966
|
+
"type": {
|
|
967
|
+
"text": "string"
|
|
968
|
+
}
|
|
969
|
+
}
|
|
970
|
+
],
|
|
971
|
+
"description": "Writes `text` to the clipboard. Prefers the async Clipboard API and falls\nback to `document.execCommand(\"copy\")` (insecure contexts, older browsers)."
|
|
972
|
+
}
|
|
973
|
+
],
|
|
974
|
+
"exports": [
|
|
975
|
+
{
|
|
976
|
+
"kind": "js",
|
|
977
|
+
"name": "copyText",
|
|
978
|
+
"declaration": {
|
|
979
|
+
"name": "copyText",
|
|
980
|
+
"module": "src/code/copy.ts"
|
|
981
|
+
}
|
|
982
|
+
}
|
|
983
|
+
]
|
|
984
|
+
},
|
|
985
|
+
{
|
|
986
|
+
"kind": "javascript-module",
|
|
987
|
+
"path": "src/code/css-variables-theme.ts",
|
|
988
|
+
"declarations": [
|
|
989
|
+
{
|
|
990
|
+
"kind": "variable",
|
|
991
|
+
"name": "CODE_THEME_NAME",
|
|
992
|
+
"type": {
|
|
993
|
+
"text": "string"
|
|
994
|
+
},
|
|
995
|
+
"default": "\"tp-code\"",
|
|
996
|
+
"description": "Name the theme is registered under in the shared highlighter."
|
|
997
|
+
},
|
|
998
|
+
{
|
|
999
|
+
"kind": "variable",
|
|
1000
|
+
"name": "cssVariablesTheme",
|
|
1001
|
+
"description": "Shiki theme whose colors are CSS variables instead of hex values, e.g.\n`var(--_tp-code-token-keyword)`.\n\nThe private `--_tp-code-*` variables are resolved on `:host` from the public\n`--tp-code-*` ones (with palette-based fallbacks, see `styles.ts`). The\nindirection lets consumers set the public variables on **any** ancestor\ninstead of only on `tp-code` itself."
|
|
1002
|
+
}
|
|
1003
|
+
],
|
|
1004
|
+
"exports": [
|
|
1005
|
+
{
|
|
1006
|
+
"kind": "js",
|
|
1007
|
+
"name": "CODE_THEME_NAME",
|
|
1008
|
+
"declaration": {
|
|
1009
|
+
"name": "CODE_THEME_NAME",
|
|
1010
|
+
"module": "src/code/css-variables-theme.ts"
|
|
1011
|
+
}
|
|
1012
|
+
},
|
|
1013
|
+
{
|
|
1014
|
+
"kind": "js",
|
|
1015
|
+
"name": "cssVariablesTheme",
|
|
1016
|
+
"declaration": {
|
|
1017
|
+
"name": "cssVariablesTheme",
|
|
1018
|
+
"module": "src/code/css-variables-theme.ts"
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
]
|
|
1022
|
+
},
|
|
1023
|
+
{
|
|
1024
|
+
"kind": "javascript-module",
|
|
1025
|
+
"path": "src/code/highlighter.ts",
|
|
1026
|
+
"declarations": [
|
|
1027
|
+
{
|
|
1028
|
+
"kind": "function",
|
|
1029
|
+
"name": "normalizeLanguage",
|
|
1030
|
+
"return": {
|
|
1031
|
+
"type": {
|
|
1032
|
+
"text": "string"
|
|
1033
|
+
}
|
|
1034
|
+
},
|
|
1035
|
+
"parameters": [
|
|
1036
|
+
{
|
|
1037
|
+
"name": "language",
|
|
1038
|
+
"type": {
|
|
1039
|
+
"text": "string | null | undefined"
|
|
1040
|
+
}
|
|
1041
|
+
}
|
|
1042
|
+
],
|
|
1043
|
+
"description": "Lower-cases and trims a `language` attribute value."
|
|
1044
|
+
},
|
|
1045
|
+
{
|
|
1046
|
+
"kind": "function",
|
|
1047
|
+
"name": "loadLanguage",
|
|
1048
|
+
"return": {
|
|
1049
|
+
"type": {
|
|
1050
|
+
"text": ""
|
|
1051
|
+
}
|
|
1052
|
+
},
|
|
1053
|
+
"parameters": [
|
|
1054
|
+
{
|
|
1055
|
+
"name": "language",
|
|
1056
|
+
"type": {
|
|
1057
|
+
"text": "string"
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
],
|
|
1061
|
+
"description": "Loads `language` (id or alias) into the shared highlighter once per page."
|
|
1062
|
+
},
|
|
1063
|
+
{
|
|
1064
|
+
"kind": "function",
|
|
1065
|
+
"name": "tokenize",
|
|
1066
|
+
"return": {
|
|
1067
|
+
"type": {
|
|
1068
|
+
"text": ""
|
|
1069
|
+
}
|
|
1070
|
+
},
|
|
1071
|
+
"parameters": [
|
|
1072
|
+
{
|
|
1073
|
+
"name": "code",
|
|
1074
|
+
"type": {
|
|
1075
|
+
"text": "string"
|
|
1076
|
+
}
|
|
1077
|
+
},
|
|
1078
|
+
{
|
|
1079
|
+
"name": "language",
|
|
1080
|
+
"type": {
|
|
1081
|
+
"text": "string"
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
],
|
|
1085
|
+
"description": "Tokenizes `code` as `language`."
|
|
1086
|
+
}
|
|
1087
|
+
],
|
|
1088
|
+
"exports": [
|
|
1089
|
+
{
|
|
1090
|
+
"kind": "js",
|
|
1091
|
+
"name": "normalizeLanguage",
|
|
1092
|
+
"declaration": {
|
|
1093
|
+
"name": "normalizeLanguage",
|
|
1094
|
+
"module": "src/code/highlighter.ts"
|
|
1095
|
+
}
|
|
1096
|
+
},
|
|
1097
|
+
{
|
|
1098
|
+
"kind": "js",
|
|
1099
|
+
"name": "loadLanguage",
|
|
1100
|
+
"declaration": {
|
|
1101
|
+
"name": "loadLanguage",
|
|
1102
|
+
"module": "src/code/highlighter.ts"
|
|
1103
|
+
}
|
|
1104
|
+
},
|
|
1105
|
+
{
|
|
1106
|
+
"kind": "js",
|
|
1107
|
+
"name": "tokenize",
|
|
1108
|
+
"declaration": {
|
|
1109
|
+
"name": "tokenize",
|
|
1110
|
+
"module": "src/code/highlighter.ts"
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
]
|
|
1114
|
+
},
|
|
1115
|
+
{
|
|
1116
|
+
"kind": "javascript-module",
|
|
1117
|
+
"path": "src/code/language-loader.ts",
|
|
1118
|
+
"declarations": [
|
|
1119
|
+
{
|
|
1120
|
+
"kind": "function",
|
|
1121
|
+
"name": "setLanguageLoader",
|
|
1122
|
+
"return": {
|
|
1123
|
+
"type": {
|
|
1124
|
+
"text": "void"
|
|
1125
|
+
}
|
|
1126
|
+
},
|
|
1127
|
+
"parameters": [
|
|
1128
|
+
{
|
|
1129
|
+
"name": "next",
|
|
1130
|
+
"type": {
|
|
1131
|
+
"text": "LanguageLoader"
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
],
|
|
1135
|
+
"description": "Replaces the loader `<tp-code>` uses to fetch grammars.\n\n`@telperion/elements/code` installs a loader backed by Shiki's bundled,\nlazily imported grammars; the CDN build (`code/cdn`) installs one that\nimports grammars from jsDelivr. Call this before the first `<tp-code>`\nhighlights — languages that already loaded are cached."
|
|
1136
|
+
},
|
|
1137
|
+
{
|
|
1138
|
+
"kind": "function",
|
|
1139
|
+
"name": "getLanguageLoader",
|
|
1140
|
+
"return": {
|
|
1141
|
+
"type": {
|
|
1142
|
+
"text": "LanguageLoader"
|
|
1143
|
+
}
|
|
1144
|
+
},
|
|
1145
|
+
"description": "The loader currently in use."
|
|
1146
|
+
}
|
|
1147
|
+
],
|
|
1148
|
+
"exports": [
|
|
1149
|
+
{
|
|
1150
|
+
"kind": "js",
|
|
1151
|
+
"name": "setLanguageLoader",
|
|
1152
|
+
"declaration": {
|
|
1153
|
+
"name": "setLanguageLoader",
|
|
1154
|
+
"module": "src/code/language-loader.ts"
|
|
1155
|
+
}
|
|
1156
|
+
},
|
|
1157
|
+
{
|
|
1158
|
+
"kind": "js",
|
|
1159
|
+
"name": "getLanguageLoader",
|
|
1160
|
+
"declaration": {
|
|
1161
|
+
"name": "getLanguageLoader",
|
|
1162
|
+
"module": "src/code/language-loader.ts"
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
]
|
|
1166
|
+
},
|
|
1167
|
+
{
|
|
1168
|
+
"kind": "javascript-module",
|
|
1169
|
+
"path": "src/code/line-ranges.ts",
|
|
1170
|
+
"declarations": [
|
|
1171
|
+
{
|
|
1172
|
+
"kind": "function",
|
|
1173
|
+
"name": "parseLineRanges",
|
|
1174
|
+
"return": {
|
|
1175
|
+
"type": {
|
|
1176
|
+
"text": "LineRanges"
|
|
1177
|
+
}
|
|
1178
|
+
},
|
|
1179
|
+
"parameters": [
|
|
1180
|
+
{
|
|
1181
|
+
"name": "input",
|
|
1182
|
+
"type": {
|
|
1183
|
+
"text": "string | null | undefined"
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
],
|
|
1187
|
+
"description": "Parses a `highlight-lines` value such as `\"2, 4-6, 10\"` into inclusive\nranges. Reversed ranges (`\"6-4\"`) are normalized; malformed parts are ignored."
|
|
1188
|
+
},
|
|
1189
|
+
{
|
|
1190
|
+
"kind": "function",
|
|
1191
|
+
"name": "isLineInRanges",
|
|
1192
|
+
"return": {
|
|
1193
|
+
"type": {
|
|
1194
|
+
"text": "boolean"
|
|
1195
|
+
}
|
|
1196
|
+
},
|
|
1197
|
+
"parameters": [
|
|
1198
|
+
{
|
|
1199
|
+
"name": "ranges",
|
|
1200
|
+
"type": {
|
|
1201
|
+
"text": "LineRanges"
|
|
1202
|
+
}
|
|
1203
|
+
},
|
|
1204
|
+
{
|
|
1205
|
+
"name": "line",
|
|
1206
|
+
"type": {
|
|
1207
|
+
"text": "number"
|
|
1208
|
+
}
|
|
1209
|
+
}
|
|
1210
|
+
],
|
|
1211
|
+
"description": "Whether `line` falls inside any of `ranges`."
|
|
1212
|
+
}
|
|
1213
|
+
],
|
|
1214
|
+
"exports": [
|
|
1215
|
+
{
|
|
1216
|
+
"kind": "js",
|
|
1217
|
+
"name": "parseLineRanges",
|
|
1218
|
+
"declaration": {
|
|
1219
|
+
"name": "parseLineRanges",
|
|
1220
|
+
"module": "src/code/line-ranges.ts"
|
|
1221
|
+
}
|
|
1222
|
+
},
|
|
1223
|
+
{
|
|
1224
|
+
"kind": "js",
|
|
1225
|
+
"name": "isLineInRanges",
|
|
1226
|
+
"declaration": {
|
|
1227
|
+
"name": "isLineInRanges",
|
|
1228
|
+
"module": "src/code/line-ranges.ts"
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
]
|
|
1232
|
+
},
|
|
1233
|
+
{
|
|
1234
|
+
"kind": "javascript-module",
|
|
1235
|
+
"path": "src/code/source.ts",
|
|
1236
|
+
"declarations": [
|
|
1237
|
+
{
|
|
1238
|
+
"kind": "function",
|
|
1239
|
+
"name": "readSource",
|
|
1240
|
+
"return": {
|
|
1241
|
+
"type": {
|
|
1242
|
+
"text": "string"
|
|
1243
|
+
}
|
|
1244
|
+
},
|
|
1245
|
+
"parameters": [
|
|
1246
|
+
{
|
|
1247
|
+
"name": "host",
|
|
1248
|
+
"type": {
|
|
1249
|
+
"text": "Element"
|
|
1250
|
+
}
|
|
1251
|
+
}
|
|
1252
|
+
],
|
|
1253
|
+
"description": "Reads the raw source of a `<tp-code>` host from its light DOM.\n\n- A direct `<template>` child wins: its serialized `innerHTML` is used, so\n authors can embed HTML samples without escaping `<` / `&`.\n- Otherwise the host's `textContent` is used."
|
|
1254
|
+
},
|
|
1255
|
+
{
|
|
1256
|
+
"kind": "function",
|
|
1257
|
+
"name": "normalizeSource",
|
|
1258
|
+
"return": {
|
|
1259
|
+
"type": {
|
|
1260
|
+
"text": "string"
|
|
1261
|
+
}
|
|
1262
|
+
},
|
|
1263
|
+
"parameters": [
|
|
1264
|
+
{
|
|
1265
|
+
"name": "raw",
|
|
1266
|
+
"type": {
|
|
1267
|
+
"text": "string"
|
|
1268
|
+
}
|
|
1269
|
+
},
|
|
1270
|
+
{
|
|
1271
|
+
"name": "variant",
|
|
1272
|
+
"type": {
|
|
1273
|
+
"text": "CodeVariant"
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
],
|
|
1277
|
+
"description": "Normalizes raw source for display.\n\n- Line endings become `\\n`.\n- `inline`: surrounding whitespace is trimmed.\n- `block`: leading/trailing blank lines are removed and the common\n indentation is stripped (see dedent)."
|
|
1278
|
+
},
|
|
1279
|
+
{
|
|
1280
|
+
"kind": "function",
|
|
1281
|
+
"name": "dedent",
|
|
1282
|
+
"return": {
|
|
1283
|
+
"type": {
|
|
1284
|
+
"text": "string"
|
|
1285
|
+
}
|
|
1286
|
+
},
|
|
1287
|
+
"parameters": [
|
|
1288
|
+
{
|
|
1289
|
+
"name": "source",
|
|
1290
|
+
"type": {
|
|
1291
|
+
"text": "string"
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
],
|
|
1295
|
+
"description": "Removes leading/trailing blank lines and the indentation shared by every\nnon-blank line. Tabs and spaces both count as one indentation character."
|
|
1296
|
+
}
|
|
1297
|
+
],
|
|
1298
|
+
"exports": [
|
|
1299
|
+
{
|
|
1300
|
+
"kind": "js",
|
|
1301
|
+
"name": "readSource",
|
|
1302
|
+
"declaration": {
|
|
1303
|
+
"name": "readSource",
|
|
1304
|
+
"module": "src/code/source.ts"
|
|
1305
|
+
}
|
|
1306
|
+
},
|
|
1307
|
+
{
|
|
1308
|
+
"kind": "js",
|
|
1309
|
+
"name": "normalizeSource",
|
|
1310
|
+
"declaration": {
|
|
1311
|
+
"name": "normalizeSource",
|
|
1312
|
+
"module": "src/code/source.ts"
|
|
1313
|
+
}
|
|
1314
|
+
},
|
|
1315
|
+
{
|
|
1316
|
+
"kind": "js",
|
|
1317
|
+
"name": "dedent",
|
|
1318
|
+
"declaration": {
|
|
1319
|
+
"name": "dedent",
|
|
1320
|
+
"module": "src/code/source.ts"
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
]
|
|
1324
|
+
},
|
|
1325
|
+
{
|
|
1326
|
+
"kind": "javascript-module",
|
|
1327
|
+
"path": "src/code/styles.ts",
|
|
1328
|
+
"declarations": [
|
|
1329
|
+
{
|
|
1330
|
+
"kind": "variable",
|
|
1331
|
+
"name": "codeStyles",
|
|
1332
|
+
"type": {
|
|
1333
|
+
"text": "array"
|
|
1334
|
+
},
|
|
1335
|
+
"default": "[variables, layout, copyButton]"
|
|
1336
|
+
}
|
|
1337
|
+
],
|
|
1338
|
+
"exports": [
|
|
1339
|
+
{
|
|
1340
|
+
"kind": "js",
|
|
1341
|
+
"name": "codeStyles",
|
|
1342
|
+
"declaration": {
|
|
1343
|
+
"name": "codeStyles",
|
|
1344
|
+
"module": "src/code/styles.ts"
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
]
|
|
1348
|
+
},
|
|
1349
|
+
{
|
|
1350
|
+
"kind": "javascript-module",
|
|
1351
|
+
"path": "src/code/templates.ts",
|
|
1352
|
+
"declarations": [
|
|
1353
|
+
{
|
|
1354
|
+
"kind": "function",
|
|
1355
|
+
"name": "renderInline",
|
|
1356
|
+
"return": {
|
|
1357
|
+
"type": {
|
|
1358
|
+
"text": "TemplateResult"
|
|
1359
|
+
}
|
|
1360
|
+
},
|
|
1361
|
+
"parameters": [
|
|
1362
|
+
{
|
|
1363
|
+
"name": "lines",
|
|
1364
|
+
"type": {
|
|
1365
|
+
"text": "readonly CodeLine[]"
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
],
|
|
1369
|
+
"description": "`variant=\"inline\"`: a single `<code>`; lines are re-joined with `\\n`."
|
|
1370
|
+
},
|
|
1371
|
+
{
|
|
1372
|
+
"kind": "function",
|
|
1373
|
+
"name": "renderBlock",
|
|
1374
|
+
"return": {
|
|
1375
|
+
"type": {
|
|
1376
|
+
"text": "TemplateResult"
|
|
1377
|
+
}
|
|
1378
|
+
},
|
|
1379
|
+
"parameters": [
|
|
1380
|
+
{
|
|
1381
|
+
"name": "options",
|
|
1382
|
+
"type": {
|
|
1383
|
+
"text": "BlockOptions"
|
|
1384
|
+
}
|
|
1385
|
+
}
|
|
1386
|
+
],
|
|
1387
|
+
"description": "`variant=\"block\"`: `<pre><code>` with one block-level `.line` per source line."
|
|
1388
|
+
}
|
|
1389
|
+
],
|
|
1390
|
+
"exports": [
|
|
1391
|
+
{
|
|
1392
|
+
"kind": "js",
|
|
1393
|
+
"name": "renderInline",
|
|
1394
|
+
"declaration": {
|
|
1395
|
+
"name": "renderInline",
|
|
1396
|
+
"module": "src/code/templates.ts"
|
|
1397
|
+
}
|
|
1398
|
+
},
|
|
1399
|
+
{
|
|
1400
|
+
"kind": "js",
|
|
1401
|
+
"name": "renderBlock",
|
|
1402
|
+
"declaration": {
|
|
1403
|
+
"name": "renderBlock",
|
|
1404
|
+
"module": "src/code/templates.ts"
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
]
|
|
1408
|
+
},
|
|
1409
|
+
{
|
|
1410
|
+
"kind": "javascript-module",
|
|
1411
|
+
"path": "src/code/types.ts",
|
|
1412
|
+
"declarations": [],
|
|
1413
|
+
"exports": []
|
|
1414
|
+
},
|
|
271
1415
|
{
|
|
272
1416
|
"kind": "javascript-module",
|
|
273
1417
|
"path": "src/details-set/details-set-element.ts",
|
|
@@ -2860,6 +4004,51 @@
|
|
|
2860
4004
|
}
|
|
2861
4005
|
]
|
|
2862
4006
|
},
|
|
4007
|
+
{
|
|
4008
|
+
"kind": "javascript-module",
|
|
4009
|
+
"path": "src/portal/portal-outlet-fallback-element.ts",
|
|
4010
|
+
"declarations": [
|
|
4011
|
+
{
|
|
4012
|
+
"kind": "class",
|
|
4013
|
+
"description": "Default content of a `<tp-portal-outlet>`: shown while no `<tp-portal>`\nprojects into the outlet, hidden as soon as one does.\n\nMust be a **direct child** of the outlet. It is `display: contents` by\ndefault, so its children lay out as children of the outlet's parent.\nVisibility follows the outlet's `active` attribute through CSS, so\nframeworks can keep rendering inside the fallback.\n\n#### Examples\n\n```html\n<tp-portal-outlet name=\"toolbar\">\n <tp-portal-outlet-fallback>Nothing to do here</tp-portal-outlet-fallback>\n</tp-portal-outlet>\n```",
|
|
4014
|
+
"name": "PortalOutletFallbackElement",
|
|
4015
|
+
"members": [
|
|
4016
|
+
{
|
|
4017
|
+
"kind": "field",
|
|
4018
|
+
"name": "shown",
|
|
4019
|
+
"type": {
|
|
4020
|
+
"text": "boolean"
|
|
4021
|
+
},
|
|
4022
|
+
"description": "Whether the fallback is currently shown: it's in an outlet no portal projects into.",
|
|
4023
|
+
"readonly": true
|
|
4024
|
+
}
|
|
4025
|
+
],
|
|
4026
|
+
"superclass": {
|
|
4027
|
+
"name": "HTMLElement"
|
|
4028
|
+
},
|
|
4029
|
+
"tagName": "tp-portal-outlet-fallback",
|
|
4030
|
+
"customElement": true
|
|
4031
|
+
}
|
|
4032
|
+
],
|
|
4033
|
+
"exports": [
|
|
4034
|
+
{
|
|
4035
|
+
"kind": "js",
|
|
4036
|
+
"name": "PortalOutletFallbackElement",
|
|
4037
|
+
"declaration": {
|
|
4038
|
+
"name": "PortalOutletFallbackElement",
|
|
4039
|
+
"module": "src/portal/portal-outlet-fallback-element.ts"
|
|
4040
|
+
}
|
|
4041
|
+
},
|
|
4042
|
+
{
|
|
4043
|
+
"kind": "custom-element-definition",
|
|
4044
|
+
"name": "tp-portal-outlet-fallback",
|
|
4045
|
+
"declaration": {
|
|
4046
|
+
"name": "PortalOutletFallbackElement",
|
|
4047
|
+
"module": "src/portal/portal-outlet-fallback-element.ts"
|
|
4048
|
+
}
|
|
4049
|
+
}
|
|
4050
|
+
]
|
|
4051
|
+
},
|
|
2863
4052
|
{
|
|
2864
4053
|
"kind": "javascript-module",
|
|
2865
4054
|
"path": "src/portal/portal-registry.ts",
|
|
@@ -3149,7 +4338,7 @@
|
|
|
3149
4338
|
"text": "void"
|
|
3150
4339
|
}
|
|
3151
4340
|
},
|
|
3152
|
-
"description": "Document-level defaults, adopted once:\n- `tp-portal` never renders in place; its content only shows in an outlet.\n- `tp-portal-outlet` is layout-transparent so projected content behaves as\n if it were a direct child of the outlet's parent. Override freely."
|
|
4341
|
+
"description": "Document-level defaults, adopted once:\n- `tp-portal` never renders in place; its content only shows in an outlet.\n- `tp-portal-outlet` is layout-transparent so projected content behaves as\n if it were a direct child of the outlet's parent. Override freely.\n- `tp-portal-outlet-fallback` is layout-transparent too, and hidden while\n its outlet is `active`. The hide rule is `!important` on purpose: it\n reflects state, so a consumer's `display` styling must not reveal it."
|
|
3153
4342
|
}
|
|
3154
4343
|
],
|
|
3155
4344
|
"exports": [
|