@penwin/discord-components-core 4.6.0 → 4.7.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.
@@ -6489,6 +6489,39 @@
6489
6489
  },
6490
6490
  "privacy": "private"
6491
6491
  },
6492
+ {
6493
+ "kind": "field",
6494
+ "name": "dialogRef",
6495
+ "type": {
6496
+ "text": "Ref<HTMLDialogElement>"
6497
+ },
6498
+ "privacy": "private"
6499
+ },
6500
+ {
6501
+ "kind": "method",
6502
+ "name": "handleDialogCancel",
6503
+ "privacy": "private",
6504
+ "parameters": [
6505
+ {
6506
+ "name": "event",
6507
+ "type": {
6508
+ "text": "Event"
6509
+ }
6510
+ }
6511
+ ],
6512
+ "description": "Escape (or the back gesture) asks the dialog to close: run the fade-out instead of closing at once."
6513
+ },
6514
+ {
6515
+ "kind": "method",
6516
+ "name": "handleDialogClose",
6517
+ "privacy": "private",
6518
+ "description": "The dialog can still close natively (a repeated Escape cannot always be prevented): finish closing."
6519
+ },
6520
+ {
6521
+ "kind": "method",
6522
+ "name": "finishClose",
6523
+ "privacy": "private"
6524
+ },
6492
6525
  {
6493
6526
  "kind": "field",
6494
6527
  "name": "isCurrentlyClosing",
@@ -11238,6 +11271,7 @@
11238
11271
  "text": "string"
11239
11272
  },
11240
11273
  "privacy": "public",
11274
+ "description": "The language used to highlight the content. Viewers can change it from the preview.",
11241
11275
  "attribute": "language"
11242
11276
  },
11243
11277
  {
@@ -11247,6 +11281,7 @@
11247
11281
  "text": "string"
11248
11282
  },
11249
11283
  "privacy": "public",
11284
+ "description": "The text content of the file",
11250
11285
  "attribute": "content"
11251
11286
  },
11252
11287
  {
@@ -11276,9 +11311,21 @@
11276
11311
  "text": "string"
11277
11312
  },
11278
11313
  "privacy": "public",
11279
- "description": "The URL to the file, this is passed to `<discord-link>`",
11314
+ "description": "The URL to the file, used by the \"Download\" menu item",
11280
11315
  "attribute": "href"
11281
11316
  },
11317
+ {
11318
+ "kind": "field",
11319
+ "name": "wrapText",
11320
+ "type": {
11321
+ "text": "boolean"
11322
+ },
11323
+ "privacy": "public",
11324
+ "default": "true",
11325
+ "description": "Whether long lines wrap instead of scrolling sideways, as Discord does by default. Viewers can\ntoggle it from the menu. Set `wrap-text=\"false\"` to start with it off.",
11326
+ "attribute": "wrap-text",
11327
+ "reflects": true
11328
+ },
11282
11329
  {
11283
11330
  "kind": "field",
11284
11331
  "name": "lightTheme",
@@ -11290,6 +11337,36 @@
11290
11337
  "attribute": "light-theme",
11291
11338
  "reflects": true
11292
11339
  },
11340
+ {
11341
+ "kind": "field",
11342
+ "name": "expanded",
11343
+ "type": {
11344
+ "text": "boolean"
11345
+ },
11346
+ "privacy": "private",
11347
+ "default": "false",
11348
+ "description": "Whether the inline preview shows more lines."
11349
+ },
11350
+ {
11351
+ "kind": "field",
11352
+ "name": "fullView",
11353
+ "type": {
11354
+ "text": "boolean"
11355
+ },
11356
+ "privacy": "private",
11357
+ "default": "false",
11358
+ "description": "Whether the full view (a modal dialog) is open."
11359
+ },
11360
+ {
11361
+ "kind": "field",
11362
+ "name": "popup",
11363
+ "type": {
11364
+ "text": "{ kind: Popup; place: Place } | null"
11365
+ },
11366
+ "privacy": "private",
11367
+ "default": "null",
11368
+ "description": "The open popup, and the footer (inline or full view) that opened it."
11369
+ },
11293
11370
  {
11294
11371
  "kind": "field",
11295
11372
  "name": "currentSearch",
@@ -11299,22 +11376,200 @@
11299
11376
  "privacy": "private",
11300
11377
  "default": "''"
11301
11378
  },
11379
+ {
11380
+ "kind": "field",
11381
+ "name": "overflowing",
11382
+ "type": {
11383
+ "text": "boolean | undefined"
11384
+ },
11385
+ "privacy": "private",
11386
+ "description": "Whether the collapsed preview hides content, measured once rendered."
11387
+ },
11388
+ {
11389
+ "kind": "field",
11390
+ "name": "lines",
11391
+ "type": {
11392
+ "text": "string[]"
11393
+ },
11394
+ "privacy": "private",
11395
+ "default": "[]"
11396
+ },
11397
+ {
11398
+ "kind": "field",
11399
+ "name": "popper",
11400
+ "type": {
11401
+ "text": "PopperInstance | null"
11402
+ },
11403
+ "privacy": "private",
11404
+ "default": "null"
11405
+ },
11406
+ {
11407
+ "kind": "field",
11408
+ "name": "pressedOpenTrigger",
11409
+ "type": {
11410
+ "text": "string | null"
11411
+ },
11412
+ "privacy": "private",
11413
+ "default": "null",
11414
+ "description": "The trigger pressed while its popup was open. Light dismiss may already have closed the popup by\nthe time its click arrives, so the click must not open it again."
11415
+ },
11416
+ {
11417
+ "kind": "field",
11418
+ "name": "openedFromKeyboard",
11419
+ "type": {
11420
+ "text": "boolean"
11421
+ },
11422
+ "privacy": "private",
11423
+ "default": "false",
11424
+ "description": "Whether the open popup was opened from the keyboard, which moves focus into it."
11425
+ },
11426
+ {
11427
+ "kind": "field",
11428
+ "name": "wrapCloseTimeout",
11429
+ "type": {
11430
+ "text": "number | undefined"
11431
+ },
11432
+ "privacy": "private"
11433
+ },
11434
+ {
11435
+ "kind": "field",
11436
+ "name": "pressedOutsideDialog",
11437
+ "type": {
11438
+ "text": "boolean"
11439
+ },
11440
+ "privacy": "private",
11441
+ "default": "false",
11442
+ "description": "Whether the pointer went down outside the full view, for the light-dismiss fallback."
11443
+ },
11444
+ {
11445
+ "kind": "field",
11446
+ "name": "dialogRef",
11447
+ "privacy": "private",
11448
+ "readonly": true
11449
+ },
11450
+ {
11451
+ "kind": "field",
11452
+ "name": "inlineBodyRef",
11453
+ "privacy": "private",
11454
+ "readonly": true
11455
+ },
11456
+ {
11457
+ "kind": "field",
11458
+ "name": "inputRef",
11459
+ "privacy": "private",
11460
+ "readonly": true
11461
+ },
11302
11462
  {
11303
11463
  "kind": "method",
11304
- "name": "handleSearchInput",
11464
+ "name": "showSelector",
11465
+ "privacy": "public",
11466
+ "description": "Open the language selector of the inline preview. Kept for the 4.x API."
11467
+ },
11468
+ {
11469
+ "kind": "method",
11470
+ "name": "hideSelector",
11471
+ "privacy": "public",
11472
+ "description": "Close any open popup. Kept for the 4.x API."
11473
+ },
11474
+ {
11475
+ "kind": "method",
11476
+ "name": "isPopupOpen",
11477
+ "privacy": "private",
11478
+ "parameters": [
11479
+ {
11480
+ "name": "kind",
11481
+ "type": {
11482
+ "text": "Popup"
11483
+ }
11484
+ },
11485
+ {
11486
+ "name": "place",
11487
+ "type": {
11488
+ "text": "Place"
11489
+ }
11490
+ }
11491
+ ]
11492
+ },
11493
+ {
11494
+ "kind": "method",
11495
+ "name": "openPopup",
11496
+ "privacy": "private",
11497
+ "parameters": [
11498
+ {
11499
+ "name": "kind",
11500
+ "type": {
11501
+ "text": "Popup"
11502
+ }
11503
+ },
11504
+ {
11505
+ "name": "place",
11506
+ "type": {
11507
+ "text": "Place"
11508
+ }
11509
+ },
11510
+ {
11511
+ "name": "fromKeyboard",
11512
+ "default": "false"
11513
+ }
11514
+ ]
11515
+ },
11516
+ {
11517
+ "kind": "method",
11518
+ "name": "closePopup",
11519
+ "privacy": "private",
11520
+ "parameters": [
11521
+ {
11522
+ "name": "focusVisible",
11523
+ "default": "true"
11524
+ }
11525
+ ],
11526
+ "description": "Close the open popup. Focus goes back to its trigger when it was inside the popup, without a\nfocus ring after a pointer action."
11527
+ },
11528
+ {
11529
+ "kind": "method",
11530
+ "name": "popupElements",
11531
+ "privacy": "private"
11532
+ },
11533
+ {
11534
+ "kind": "method",
11535
+ "name": "showPopup",
11536
+ "privacy": "private"
11537
+ },
11538
+ {
11539
+ "kind": "method",
11540
+ "name": "handlePopupToggle",
11305
11541
  "privacy": "private",
11306
11542
  "parameters": [
11307
11543
  {
11308
11544
  "name": "event",
11309
11545
  "type": {
11310
- "text": "Event"
11546
+ "text": "ToggleEvent"
11311
11547
  }
11312
11548
  }
11313
11549
  ]
11314
11550
  },
11315
11551
  {
11316
11552
  "kind": "method",
11317
- "name": "clearSearch",
11553
+ "name": "handleTriggerPointerDown",
11554
+ "privacy": "private",
11555
+ "parameters": [
11556
+ {
11557
+ "name": "kind",
11558
+ "type": {
11559
+ "text": "Popup"
11560
+ }
11561
+ },
11562
+ {
11563
+ "name": "place",
11564
+ "type": {
11565
+ "text": "Place"
11566
+ }
11567
+ }
11568
+ ]
11569
+ },
11570
+ {
11571
+ "kind": "method",
11572
+ "name": "handleTriggerClick",
11318
11573
  "privacy": "private",
11319
11574
  "parameters": [
11320
11575
  {
@@ -11322,88 +11577,160 @@
11322
11577
  "type": {
11323
11578
  "text": "MouseEvent"
11324
11579
  }
11580
+ },
11581
+ {
11582
+ "name": "kind",
11583
+ "type": {
11584
+ "text": "Popup"
11585
+ }
11586
+ },
11587
+ {
11588
+ "name": "place",
11589
+ "type": {
11590
+ "text": "Place"
11591
+ }
11325
11592
  }
11326
11593
  ]
11327
11594
  },
11328
11595
  {
11329
11596
  "kind": "method",
11330
- "name": "selectLanguage",
11597
+ "name": "handleMenuTriggerKeydown",
11331
11598
  "privacy": "private",
11332
11599
  "parameters": [
11333
11600
  {
11334
- "name": "language",
11601
+ "name": "event",
11335
11602
  "type": {
11336
- "text": "string"
11603
+ "text": "KeyboardEvent"
11604
+ }
11605
+ },
11606
+ {
11607
+ "name": "place",
11608
+ "type": {
11609
+ "text": "Place"
11337
11610
  }
11338
11611
  }
11339
11612
  ]
11340
11613
  },
11341
11614
  {
11342
- "kind": "field",
11343
- "name": "inputRef",
11344
- "privacy": "public"
11615
+ "kind": "method",
11616
+ "name": "handleMenuKeydown",
11617
+ "privacy": "private",
11618
+ "parameters": [
11619
+ {
11620
+ "name": "event",
11621
+ "type": {
11622
+ "text": "KeyboardEvent"
11623
+ }
11624
+ }
11625
+ ]
11345
11626
  },
11346
11627
  {
11347
- "kind": "field",
11348
- "name": "languageSelectorContainer",
11349
- "privacy": "public"
11628
+ "kind": "method",
11629
+ "name": "toggleExpanded",
11630
+ "privacy": "private"
11350
11631
  },
11351
11632
  {
11352
- "kind": "field",
11353
- "name": "languageSelectorButton",
11354
- "privacy": "public"
11633
+ "kind": "method",
11634
+ "name": "openFullView",
11635
+ "privacy": "private"
11355
11636
  },
11356
11637
  {
11357
- "kind": "field",
11358
- "name": "isLanguageSelectorVisible",
11359
- "type": {
11360
- "text": "boolean"
11361
- },
11638
+ "kind": "method",
11639
+ "name": "closeFullView",
11640
+ "privacy": "private"
11641
+ },
11642
+ {
11643
+ "kind": "method",
11644
+ "name": "handleDialogClose",
11645
+ "privacy": "private"
11646
+ },
11647
+ {
11648
+ "kind": "method",
11649
+ "name": "isOutsideDialog",
11362
11650
  "privacy": "private",
11363
- "default": "false"
11651
+ "parameters": [
11652
+ {
11653
+ "name": "event",
11654
+ "type": {
11655
+ "text": "PointerEvent"
11656
+ }
11657
+ }
11658
+ ]
11364
11659
  },
11365
11660
  {
11366
11661
  "kind": "method",
11367
- "name": "showSelector",
11368
- "privacy": "public"
11662
+ "name": "handleDialogPointerDown",
11663
+ "privacy": "private",
11664
+ "parameters": [
11665
+ {
11666
+ "name": "event",
11667
+ "type": {
11668
+ "text": "PointerEvent"
11669
+ }
11670
+ }
11671
+ ]
11369
11672
  },
11370
11673
  {
11371
11674
  "kind": "method",
11372
- "name": "hideSelector",
11373
- "privacy": "public"
11675
+ "name": "handleDialogPointerUp",
11676
+ "privacy": "private",
11677
+ "parameters": [
11678
+ {
11679
+ "name": "event",
11680
+ "type": {
11681
+ "text": "PointerEvent"
11682
+ }
11683
+ }
11684
+ ]
11374
11685
  },
11375
11686
  {
11376
- "kind": "field",
11377
- "name": "popper",
11378
- "type": {
11379
- "text": "ReturnType<typeof createPopper> | null"
11380
- },
11687
+ "kind": "method",
11688
+ "name": "toggleWrap",
11381
11689
  "privacy": "private",
11382
- "default": "null"
11690
+ "parameters": [
11691
+ {
11692
+ "name": "event",
11693
+ "type": {
11694
+ "text": "MouseEvent"
11695
+ }
11696
+ }
11697
+ ]
11383
11698
  },
11384
11699
  {
11385
- "kind": "field",
11386
- "name": "isFirstClickDispatch",
11387
- "type": {
11388
- "text": "boolean"
11389
- },
11700
+ "kind": "method",
11701
+ "name": "selectLanguage",
11390
11702
  "privacy": "private",
11391
- "default": "true"
11703
+ "parameters": [
11704
+ {
11705
+ "name": "event",
11706
+ "type": {
11707
+ "text": "MouseEvent"
11708
+ }
11709
+ },
11710
+ {
11711
+ "name": "language",
11712
+ "type": {
11713
+ "text": "string"
11714
+ }
11715
+ }
11716
+ ]
11392
11717
  },
11393
11718
  {
11394
11719
  "kind": "method",
11395
- "name": "removeHandleClickOutside",
11720
+ "name": "handleSearchInput",
11396
11721
  "privacy": "private",
11397
11722
  "parameters": [
11398
11723
  {
11399
- "name": "destroyPopper",
11400
- "default": "false"
11724
+ "name": "event",
11725
+ "type": {
11726
+ "text": "Event"
11727
+ }
11401
11728
  }
11402
11729
  ]
11403
11730
  },
11404
11731
  {
11405
11732
  "kind": "method",
11406
- "name": "handleClickOutside",
11733
+ "name": "clearSearch",
11407
11734
  "privacy": "private",
11408
11735
  "parameters": [
11409
11736
  {
@@ -11413,6 +11740,63 @@
11413
11740
  }
11414
11741
  }
11415
11742
  ]
11743
+ },
11744
+ {
11745
+ "kind": "method",
11746
+ "name": "renderLines",
11747
+ "privacy": "private"
11748
+ },
11749
+ {
11750
+ "kind": "method",
11751
+ "name": "renderHeader",
11752
+ "privacy": "private",
11753
+ "parameters": [
11754
+ {
11755
+ "name": "place",
11756
+ "type": {
11757
+ "text": "Place"
11758
+ }
11759
+ }
11760
+ ]
11761
+ },
11762
+ {
11763
+ "kind": "method",
11764
+ "name": "renderLanguageSelector",
11765
+ "privacy": "private",
11766
+ "parameters": [
11767
+ {
11768
+ "name": "place",
11769
+ "type": {
11770
+ "text": "Place"
11771
+ }
11772
+ }
11773
+ ]
11774
+ },
11775
+ {
11776
+ "kind": "method",
11777
+ "name": "renderMenu",
11778
+ "privacy": "private",
11779
+ "parameters": [
11780
+ {
11781
+ "name": "place",
11782
+ "type": {
11783
+ "text": "Place"
11784
+ }
11785
+ }
11786
+ ]
11787
+ },
11788
+ {
11789
+ "kind": "method",
11790
+ "name": "renderFooter",
11791
+ "privacy": "private",
11792
+ "parameters": [
11793
+ {
11794
+ "name": "place",
11795
+ "type": {
11796
+ "text": "Place"
11797
+ }
11798
+ }
11799
+ ]
11416
11800
  }
11417
11801
  ],
11418
11802
  "attributes": [
@@ -11429,6 +11813,7 @@
11429
11813
  "type": {
11430
11814
  "text": "string"
11431
11815
  },
11816
+ "description": "The language used to highlight the content. Viewers can change it from the preview.",
11432
11817
  "fieldName": "language"
11433
11818
  },
11434
11819
  {
@@ -11436,6 +11821,7 @@
11436
11821
  "type": {
11437
11822
  "text": "string"
11438
11823
  },
11824
+ "description": "The text content of the file",
11439
11825
  "fieldName": "content"
11440
11826
  },
11441
11827
  {
@@ -11459,9 +11845,18 @@
11459
11845
  "type": {
11460
11846
  "text": "string"
11461
11847
  },
11462
- "description": "The URL to the file, this is passed to `<discord-link>`",
11848
+ "description": "The URL to the file, used by the \"Download\" menu item",
11463
11849
  "fieldName": "href"
11464
11850
  },
11851
+ {
11852
+ "name": "wrap-text",
11853
+ "type": {
11854
+ "text": "boolean"
11855
+ },
11856
+ "default": "true",
11857
+ "description": "Whether long lines wrap instead of scrolling sideways, as Discord does by default. Viewers can\ntoggle it from the menu. Set `wrap-text=\"false\"` to start with it off.",
11858
+ "fieldName": "wrapText"
11859
+ },
11465
11860
  {
11466
11861
  "name": "light-theme",
11467
11862
  "type": {
@@ -15045,6 +15440,92 @@
15045
15440
  }
15046
15441
  ]
15047
15442
  },
15443
+ {
15444
+ "kind": "javascript-module",
15445
+ "path": "src/components/svgs/TextFilePreview.ts",
15446
+ "declarations": [
15447
+ {
15448
+ "kind": "function",
15449
+ "name": "TextFileCodeSvg",
15450
+ "description": "A document with a code glyph, shown before the language name."
15451
+ },
15452
+ {
15453
+ "kind": "function",
15454
+ "name": "TextFileExpandSvg",
15455
+ "description": "Chevron for \"show more\" / \"show less\". It points down and is rotated when expanded."
15456
+ },
15457
+ {
15458
+ "kind": "function",
15459
+ "name": "TextFileMaximizeSvg",
15460
+ "description": "Two arrows pointing at opposite corners: open the full view."
15461
+ },
15462
+ {
15463
+ "kind": "function",
15464
+ "name": "TextFileMoreSvg",
15465
+ "description": "Three horizontal dots: the overflow menu."
15466
+ },
15467
+ {
15468
+ "kind": "function",
15469
+ "name": "TextFileCloseSvg",
15470
+ "description": "Close (X), for the full view."
15471
+ },
15472
+ {
15473
+ "kind": "function",
15474
+ "name": "TextFileCheckSvg",
15475
+ "description": "Check mark for a ticked menu checkbox."
15476
+ }
15477
+ ],
15478
+ "exports": [
15479
+ {
15480
+ "kind": "js",
15481
+ "name": "TextFileCodeSvg",
15482
+ "declaration": {
15483
+ "name": "TextFileCodeSvg",
15484
+ "module": "src/components/svgs/TextFilePreview.ts"
15485
+ }
15486
+ },
15487
+ {
15488
+ "kind": "js",
15489
+ "name": "TextFileExpandSvg",
15490
+ "declaration": {
15491
+ "name": "TextFileExpandSvg",
15492
+ "module": "src/components/svgs/TextFilePreview.ts"
15493
+ }
15494
+ },
15495
+ {
15496
+ "kind": "js",
15497
+ "name": "TextFileMaximizeSvg",
15498
+ "declaration": {
15499
+ "name": "TextFileMaximizeSvg",
15500
+ "module": "src/components/svgs/TextFilePreview.ts"
15501
+ }
15502
+ },
15503
+ {
15504
+ "kind": "js",
15505
+ "name": "TextFileMoreSvg",
15506
+ "declaration": {
15507
+ "name": "TextFileMoreSvg",
15508
+ "module": "src/components/svgs/TextFilePreview.ts"
15509
+ }
15510
+ },
15511
+ {
15512
+ "kind": "js",
15513
+ "name": "TextFileCloseSvg",
15514
+ "declaration": {
15515
+ "name": "TextFileCloseSvg",
15516
+ "module": "src/components/svgs/TextFilePreview.ts"
15517
+ }
15518
+ },
15519
+ {
15520
+ "kind": "js",
15521
+ "name": "TextFileCheckSvg",
15522
+ "declaration": {
15523
+ "name": "TextFileCheckSvg",
15524
+ "module": "src/components/svgs/TextFilePreview.ts"
15525
+ }
15526
+ }
15527
+ ]
15528
+ },
15048
15529
  {
15049
15530
  "kind": "javascript-module",
15050
15531
  "path": "src/components/svgs/Thread.ts",