@jfrader/ui 0.5.1 → 0.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.
- package/README.md +28 -7
- package/dist/{accordion-DLul6vIl.js → accordion-D6myONB9.js} +36 -35
- package/dist/accordion.js +1 -1
- package/dist/activity-rings-Uszvwqdl.js +528 -0
- package/dist/activity-rings.js +2 -0
- package/dist/{alert-DS_einpy.js → alert-Bhj-qSMs.js} +15 -14
- package/dist/alert.js +1 -1
- package/dist/{announcement-bar-Dlbq5-9D.js → announcement-bar-B5J33QUh.js} +132 -131
- package/dist/announcement-bar.js +1 -1
- package/dist/{avatar-group-M1opAQEG.js → avatar-group-BlMLNw4J.js} +10 -9
- package/dist/avatar-group.js +1 -1
- package/dist/avatar-sPxDqFiZ.js +133 -0
- package/dist/avatar.js +1 -1
- package/dist/{badge-CjM5Agqk.js → badge-CfhTcA-Z.js} +10 -9
- package/dist/badge.js +1 -1
- package/dist/billing-toggle-CgC7yxxo.js +349 -0
- package/dist/billing-toggle.js +2 -0
- package/dist/{bottom-sheet-DjZOPq4k.js → bottom-sheet-BFQKO0Wo.js} +282 -264
- package/dist/bottom-sheet.js +1 -1
- package/dist/{breadcrumbs-BDK_LiwH.js → breadcrumbs-CG3akw-b.js} +19 -18
- package/dist/breadcrumbs.js +1 -1
- package/dist/{button-NLY0h6EJ.js → button-C6OV0C7J.js} +14 -13
- package/dist/button-group-B9wP2ddS.js +611 -0
- package/dist/button-group.js +2 -0
- package/dist/button.js +1 -1
- package/dist/calendar-Bg6D2sul.js +377 -0
- package/dist/calendar.js +1 -1
- package/dist/calendar.utils-azmB4Ej7.js +79 -0
- package/dist/card-C008OQCp.js +164 -0
- package/dist/card.js +1 -1
- package/dist/{carousel-B7OrvD6J.js → carousel-lTH4Foke.js} +13 -12
- package/dist/carousel.js +1 -1
- package/dist/chat-thread-DkB-WMWJ.js +864 -0
- package/dist/chat-thread.js +2 -0
- package/dist/{checkbox-DKSzExj2.js → checkbox-CClE61GV.js} +9 -8
- package/dist/checkbox.js +1 -1
- package/dist/{chip-group-DjQ0_6Y9.js → chip-group-BZUX9KPF.js} +17 -16
- package/dist/chip-group.js +1 -1
- package/dist/{choice-control-5kJkLXgv.js → choice-control-BsWOZPc9.js} +1 -1
- package/dist/{code-block-B5we2lZa.js → code-block-CYP89_6h.js} +35 -34
- package/dist/code-block.js +1 -1
- package/dist/{combobox-DFFqOBCi.js → combobox-D2Oc-co7.js} +21 -20
- package/dist/combobox.js +1 -1
- package/dist/command-palette-BrT1n9bb.js +394 -0
- package/dist/command-palette.js +1 -1
- package/dist/comment-thread-DXfqgRNI.js +772 -0
- package/dist/comment-thread.js +1 -1
- package/dist/{container-BOaSptJa.js → container-BxtwJSSD.js} +3 -2
- package/dist/container.js +1 -1
- package/dist/{context-menu-__1c2Dk9.js → context-menu-I4i0LRpm.js} +52 -51
- package/dist/context-menu.js +1 -1
- package/dist/{copy-button-DCSLcYS-.js → copy-button-C0p_qrgf.js} +4 -4
- package/dist/copy-button.js +1 -1
- package/dist/{countdown-Dp_TD1VP.js → countdown-EcpV6rXy.js} +18 -17
- package/dist/countdown.js +1 -1
- package/dist/css-BYJhdGh-.js +2 -0
- package/dist/{date-picker-BiPN7yeK.js → date-picker-D-bn-iHs.js} +14 -13
- package/dist/date-picker.js +1 -1
- package/dist/date-range-picker-rXcZsI1Y.js +589 -0
- package/dist/date-range-picker.js +1 -1
- package/dist/dialog-CR1xdkrC.js +222 -0
- package/dist/dialog.js +1 -1
- package/dist/{divider-Cp7aNbhM.js → divider-zOJzkcHh.js} +7 -6
- package/dist/divider.js +1 -1
- package/dist/drawer-CceaEhCr.js +590 -0
- package/dist/drawer.js +1 -1
- package/dist/emblem-DnXmpZCh.js +166 -0
- package/dist/emblem.js +2 -0
- package/dist/{empty-state-CDgrjPPf.js → empty-state-DO0ApylK.js} +2 -1
- package/dist/empty-state.js +1 -1
- package/dist/{expandable-card-rUATve0o.js → expandable-card-W97vjix9.js} +52 -51
- package/dist/expandable-card.js +1 -1
- package/dist/{expanding-search-BxOwtdwt.js → expanding-search-Bb2_YfNx.js} +16 -15
- package/dist/expanding-search.js +1 -1
- package/dist/{field-anatomy-COVdNpf5.js → field-anatomy-BDIP42MI.js} +2 -1
- package/dist/{file-dropzone-BuXm3Tea.js → file-dropzone-Bi5ikRIz.js} +14 -13
- package/dist/file-dropzone.js +1 -1
- package/dist/{filter-toolbar-Cy5Hqur-.js → filter-toolbar-QRnC4S_H.js} +33 -32
- package/dist/filter-toolbar.js +1 -1
- package/dist/{flex-Dh-_J5-U.js → flex-CS7eMRcK.js} +2 -2
- package/dist/flex.js +1 -1
- package/dist/game-card-Oeu74giK.js +194 -0
- package/dist/game-card.js +2 -0
- package/dist/{hold-to-confirm-DjB2EVjM.js → hold-to-confirm-CVBA0wNT.js} +18 -17
- package/dist/hold-to-confirm.js +1 -1
- package/dist/{hover-card-CoMJKg1g.js → hover-card-Dgu2CwMD.js} +20 -19
- package/dist/hover-card.js +1 -1
- package/dist/{icon-wrapper-stN8sD7R.js → icon-wrapper-C-zMD0uL.js} +1 -1
- package/dist/{image-compare-BxY8Ykzt.js → image-compare-Ln2UUqTU.js} +20 -19
- package/dist/image-compare.js +1 -1
- package/dist/in-view-title-BUZCMqge.js +225 -0
- package/dist/in-view-title.js +2 -0
- package/dist/index.js +102 -83
- package/dist/initials-DEdwNe9_.js +18 -0
- package/dist/{inline-edit-C0eeml65.js → inline-edit-D-pR2RPC.js} +22 -21
- package/dist/inline-edit.js +1 -1
- package/dist/{input-control-DmMuAuPS.js → input-control-B6HVBgwl.js} +1 -1
- package/dist/{json-viewer-DgWqyU75.js → json-viewer-Dro3WrjS.js} +31 -30
- package/dist/json-viewer.js +1 -1
- package/dist/{kbd-C3ACoMoE.js → kbd-BI_9qzYr.js} +2 -1
- package/dist/kbd.js +1 -1
- package/dist/keycap-keyboard-Cdx-OAS1.js +311 -0
- package/dist/keycap-keyboard.js +2 -0
- package/dist/{layout-style-Cbd1Vilw.js → layout-style-BE0gSqrH.js} +1 -1
- package/dist/lightbox-gallery-D0YaSTut.js +777 -0
- package/dist/lightbox-gallery.js +2 -0
- package/dist/link-unfurl-CReyIjyy.js +695 -0
- package/dist/link-unfurl.js +2 -0
- package/dist/{listbox-style-WX-RASp1.js → listbox-style-DNOxAulu.js} +1 -1
- package/dist/{loading-ring-B8-30Dl1.js → loading-ring-D0lGrK8z.js} +1 -1
- package/dist/locale-switcher-DTkySKsM.js +375 -0
- package/dist/locale-switcher.js +2 -0
- package/dist/{mention-input-sq61si9L.js → mention-input-BjjAbJCf.js} +6 -6
- package/dist/mention-input.js +1 -1
- package/dist/{menu-DDKgmK2F.js → menu-CVzpsyXn.js} +113 -96
- package/dist/menu.js +1 -1
- package/dist/{metric-card--lVTz5Wn.js → metric-card-BnFssTXj.js} +12 -11
- package/dist/metric-card.js +1 -1
- package/dist/{multi-select-DG1BCFX7.js → multi-select-B3puEVo0.js} +67 -66
- package/dist/multi-select.js +1 -1
- package/dist/{navigation-CC26JDr-.js → navigation-C_JD43gA.js} +41 -40
- package/dist/navigation.js +1 -1
- package/dist/next.js +65 -0
- package/dist/now-playing-DjVm1Phm.js +439 -0
- package/dist/now-playing.js +2 -0
- package/dist/overlay-motion-Cr77ihn2.js +90 -0
- package/dist/{overlay-portal-C4JZFq2M.js → overlay-portal-C9igMHnC.js} +1 -1
- package/dist/{pagination-BfkeWbmP.js → pagination-Dkh4bJQh.js} +10 -9
- package/dist/pagination.js +1 -1
- package/dist/{password-field-03pWRkuY.js → password-field-Da58GP1g.js} +4 -4
- package/dist/password-field.js +1 -1
- package/dist/photo-grid-Dtl17D74.js +830 -0
- package/dist/photo-grid.js +2 -0
- package/dist/{pill-BaS-uIbn.js → pill-Dd7pog19.js} +10 -9
- package/dist/pill.js +1 -1
- package/dist/{popover-CErIw2q3.js → popover-CUMOcMtj.js} +5 -4
- package/dist/popover.js +1 -1
- package/dist/presence-spring-4zwtUDQN.js +12 -0
- package/dist/{progress-DAQkfhPd.js → progress-Bcuz3Ob4.js} +11 -10
- package/dist/progress.js +1 -1
- package/dist/{radio-cards-Cu9cBssN.js → radio-cards-FkAhESb5.js} +35 -34
- package/dist/radio-cards.js +1 -1
- package/dist/{radio-group-TIK0-iPX.js → radio-group-DItMf2YM.js} +18 -17
- package/dist/radio-group.js +1 -1
- package/dist/{resizable-panels-DUpQEpwG.js → resizable-panels-61h9hA3B.js} +13 -12
- package/dist/resizable-panels.js +1 -1
- package/dist/{scroll-area-CcZyiSOQ.js → scroll-area-B8KkCPOM.js} +16 -15
- package/dist/scroll-area.js +1 -1
- package/dist/{search-field-DMvho0KQ.js → search-field-CbsajaZb.js} +93 -92
- package/dist/search-field.js +1 -1
- package/dist/{segmented-control-8ZUGnsZm.js → segmented-control-DCh-4ca-.js} +26 -25
- package/dist/segmented-control.js +1 -1
- package/dist/{select-D5rhJ8gi.js → select-SrcQqZjo.js} +27 -26
- package/dist/select.js +1 -1
- package/dist/sheet-stack-DYX1SGSB.js +820 -0
- package/dist/sheet-stack.js +2 -0
- package/dist/shortcut-recorder-VgTQdjjn.js +688 -0
- package/dist/shortcut-recorder.js +2 -0
- package/dist/{signature-pad-_bTeguN9.js → signature-pad-khL2yhQI.js} +15 -14
- package/dist/signature-pad.js +1 -1
- package/dist/{skeleton-XQQDkCHd.js → skeleton-LJsQsveI.js} +9 -8
- package/dist/skeleton.js +1 -1
- package/dist/slider-DjAnGmlC.js +535 -0
- package/dist/slider.js +1 -1
- package/dist/{sortable-data-table-CYKT_Ng7.js → sortable-data-table-Bpitup_d.js} +29 -28
- package/dist/sortable-data-table.js +1 -1
- package/dist/{spinner-DtxvDPdM.js → spinner-CvzajSg9.js} +11 -10
- package/dist/spinner.js +1 -1
- package/dist/{split-button-BCw4zZom.js → split-button-Bu41f2AY.js} +20 -19
- package/dist/split-button.js +1 -1
- package/dist/{stack-DC3IbtWk.js → stack-Bac4sJeI.js} +2 -2
- package/dist/stack.js +1 -1
- package/dist/{stepper-CruHbXxX.js → stepper-C8Ncavbr.js} +22 -21
- package/dist/stepper.js +1 -1
- package/dist/stretch-refresh-OrnTEj7P.js +349 -0
- package/dist/stretch-refresh.js +2 -0
- package/dist/{surface-DZ4d-2aL.js → surface-C69kwSuk.js} +13 -3
- package/dist/{swipe-actions-CBuJREU1.js → swipe-actions-1H5UOZKE.js} +26 -25
- package/dist/swipe-actions.js +1 -1
- package/dist/{switch-C1WrKrf-.js → switch-79-hkQqg.js} +15 -14
- package/dist/switch.js +1 -1
- package/dist/sx-BJXJ2xJK.js +23 -0
- package/dist/{tabs-XluwRjgg.js → tabs-Bb5-noYE.js} +43 -42
- package/dist/tabs.js +1 -1
- package/dist/{tag-input-DSRCyrX2.js → tag-input-BQaueKEb.js} +5 -5
- package/dist/tag-input.js +1 -1
- package/dist/{text-field-hU72iSVS.js → text-field-D0VP7b4P.js} +3 -3
- package/dist/text-field.js +1 -1
- package/dist/{textarea-3k4Y0QQ3.js → textarea-D1YwEPmn.js} +3 -3
- package/dist/textarea.js +1 -1
- package/dist/theme-provider-BvcY-iJu.js +20 -0
- package/dist/theme-root-BrYVcTzt.js +163 -0
- package/dist/theme-root.js +1 -1
- package/dist/theme-scope-DGWy4H0C.js +62 -0
- package/dist/{theme-switch-C505TtU8.js → theme-switch-CP42mVDb.js} +12 -11
- package/dist/theme-switch.js +1 -1
- package/dist/thread-parts-Cpktor6D.js +683 -0
- package/dist/{time-picker-CPlhW0tr.js → time-picker-Tnd-JBLC.js} +16 -15
- package/dist/time-picker.js +1 -1
- package/dist/{timeline-B0uAAVfT.js → timeline-BcF46lG9.js} +22 -21
- package/dist/timeline.js +1 -1
- package/dist/{toast-B7wo3sX1.js → toast-CSAbl5yK.js} +12 -11
- package/dist/{toast-stack-B40VpS4M.js → toast-stack-BCR4Cu7V.js} +10 -9
- package/dist/toast-stack.js +1 -1
- package/dist/toast.js +1 -1
- package/dist/{toggle-group-B2fpFZwV.js → toggle-group-C7ye1v4s.js} +23 -22
- package/dist/toggle-group.js +1 -1
- package/dist/{tooltip-BvgVTCTN.js → tooltip-IajLwdUb.js} +48 -39
- package/dist/tooltip.js +1 -1
- package/dist/{tree-view-j8qLqkb_.js → tree-view-CoW4oJIZ.js} +15 -14
- package/dist/tree-view.js +1 -1
- package/dist/{trigger-style-B1KVC8O1.js → trigger-style-CtOrdPk4.js} +1 -1
- package/dist/types/components/activity-rings/activity-rings.d.ts +113 -0
- package/dist/types/components/activity-rings/index.d.ts +2 -0
- package/dist/types/components/avatar-group/avatar-group.d.ts +3 -3
- package/dist/types/components/billing-toggle/billing-toggle.d.ts +57 -0
- package/dist/types/components/billing-toggle/index.d.ts +2 -0
- package/dist/types/components/button/button.d.ts +7 -7
- package/dist/types/components/button-group/button-group.d.ts +72 -0
- package/dist/types/components/button-group/index.d.ts +2 -0
- package/dist/types/components/card/card.d.ts +7 -1
- package/dist/types/components/chat-thread/chat-thread.d.ts +130 -0
- package/dist/types/components/chat-thread/index.d.ts +2 -0
- package/dist/types/components/chip-group/chip-group.d.ts +2 -2
- package/dist/types/components/combobox/combobox.d.ts +2 -2
- package/dist/types/components/command-palette/command-palette.d.ts +1 -1
- package/dist/types/components/comment-thread/comment-thread.d.ts +7 -7
- package/dist/types/components/copy-button/copy-button.d.ts +6 -6
- package/dist/types/components/countdown/countdown.d.ts +2 -2
- package/dist/types/components/dialog/dialog.d.ts +18 -20
- package/dist/types/components/drawer/drawer.d.ts +7 -1
- package/dist/types/components/emblem/emblem.d.ts +59 -0
- package/dist/types/components/emblem/index.d.ts +2 -0
- package/dist/types/components/empty-state/empty-state.d.ts +2 -2
- package/dist/types/components/file-dropzone/file-dropzone.d.ts +3 -4
- package/dist/types/components/filter-toolbar/filter-toolbar.d.ts +2 -2
- package/dist/types/components/game-card/card-frame.d.ts +16 -0
- package/dist/types/components/game-card/decks.d.ts +27 -0
- package/dist/types/components/game-card/game-card.d.ts +37 -0
- package/dist/types/components/game-card/index.d.ts +4 -0
- package/dist/types/components/hold-to-confirm/hold-to-confirm.d.ts +1 -1
- package/dist/types/components/hover-card/hover-card.d.ts +5 -5
- package/dist/types/components/in-view-title/in-view-title.d.ts +23 -0
- package/dist/types/components/in-view-title/index.d.ts +1 -0
- package/dist/types/components/inline-edit/inline-edit.d.ts +6 -6
- package/dist/types/components/json-viewer/json-viewer.d.ts +7 -9
- package/dist/types/components/keycap-keyboard/index.d.ts +2 -0
- package/dist/types/components/keycap-keyboard/keycap-keyboard.d.ts +32 -0
- package/dist/types/components/lightbox-gallery/index.d.ts +2 -0
- package/dist/types/components/lightbox-gallery/lightbox-gallery.d.ts +74 -0
- package/dist/types/components/link-unfurl/index.d.ts +2 -0
- package/dist/types/components/link-unfurl/link-unfurl.d.ts +104 -0
- package/dist/types/components/locale-switcher/index.d.ts +2 -0
- package/dist/types/components/locale-switcher/locale-switcher.d.ts +64 -0
- package/dist/types/components/mention-input/mention-input.d.ts +7 -7
- package/dist/types/components/menu/menu.d.ts +29 -5
- package/dist/types/components/metric-card/metric-card.d.ts +2 -2
- package/dist/types/components/navigation/navigation.d.ts +1 -1
- package/dist/types/components/next/emotion-registry.d.ts +14 -0
- package/dist/types/components/next/index.d.ts +2 -0
- package/dist/types/components/next/registry.d.ts +21 -0
- package/dist/types/components/now-playing/index.d.ts +1 -0
- package/dist/types/components/now-playing/now-playing.d.ts +88 -0
- package/dist/types/components/password-field/password-field.d.ts +1 -1
- package/dist/types/components/photo-grid/index.d.ts +2 -0
- package/dist/types/components/photo-grid/photo-grid.d.ts +82 -0
- package/dist/types/components/progress/progress.d.ts +1 -1
- package/dist/types/components/select/select.d.ts +1 -1
- package/dist/types/components/sheet-stack/index.d.ts +2 -0
- package/dist/types/components/sheet-stack/sheet-stack.d.ts +81 -0
- package/dist/types/components/shortcut-recorder/index.d.ts +2 -0
- package/dist/types/components/shortcut-recorder/shortcut-recorder.d.ts +117 -0
- package/dist/types/components/signature-pad/signature-pad.d.ts +2 -2
- package/dist/types/components/split-button/split-button.d.ts +3 -4
- package/dist/types/components/stretch-refresh/index.d.ts +1 -0
- package/dist/types/components/stretch-refresh/stretch-refresh.d.ts +49 -0
- package/dist/types/components/swipe-actions/swipe-actions.d.ts +1 -2
- package/dist/types/components/tag-input/tag-input.d.ts +2 -3
- package/dist/types/components/theme-root/index.d.ts +1 -0
- package/dist/types/components/theme-root/theme-root.d.ts +10 -3
- package/dist/types/components/theme-switch/theme-switch.d.ts +3 -3
- package/dist/types/components/{comment-thread → thread}/thread-parts.d.ts +7 -2
- package/dist/types/components/time-picker/time-picker.d.ts +2 -2
- package/dist/types/components/timeline/timeline.d.ts +4 -4
- package/dist/types/components/toast/toast.d.ts +3 -3
- package/dist/types/components/tooltip/tooltip.d.ts +8 -1
- package/dist/types/components/tree-view/tree-view.d.ts +4 -3
- package/dist/types/components/typewriter-terminal/index.d.ts +2 -0
- package/dist/types/components/typewriter-terminal/typewriter-terminal.d.ts +87 -0
- package/dist/types/components/usage-meter/usage-meter.d.ts +6 -16
- package/dist/types/components/usage-meter/usage-model.d.ts +30 -0
- package/dist/types/components/user-menu/index.d.ts +2 -0
- package/dist/types/components/user-menu/user-menu.d.ts +118 -0
- package/dist/types/index.d.ts +18 -1
- package/dist/types/overlay/exit-motion.d.ts +24 -0
- package/dist/types/overlay/presence-spring.d.ts +12 -0
- package/dist/types/overlay/use-native-dialog.d.ts +10 -1
- package/dist/types/styling/create-theme.d.ts +24 -0
- package/dist/types/styling/css.d.ts +1 -1
- package/dist/types/styling/motion-timings.d.ts +5 -0
- package/dist/types/styling/overlay-motion.d.ts +95 -0
- package/dist/types/styling/surface.d.ts +7 -0
- package/dist/types/styling/sx.d.ts +1 -1
- package/dist/types/styling/theme-scope.d.ts +29 -3
- package/dist/types/styling/theme.d.ts +15 -0
- package/dist/types/utils/initials.d.ts +2 -0
- package/dist/typewriter-terminal-BUEsMzo3.js +588 -0
- package/dist/typewriter-terminal.js +2 -0
- package/dist/{usage-meter-qyQ3rYVv.js → usage-meter-CYvlB6l3.js} +165 -175
- package/dist/usage-meter.js +1 -1
- package/dist/usage-model-C0fS47w4.js +32 -0
- package/dist/use-native-dialog-FB0p7lkg.js +93 -0
- package/dist/use-scroll-lock-40gXwwAy.js +23 -0
- package/dist/user-menu-MctRu_Lh.js +757 -0
- package/dist/user-menu.js +2 -0
- package/dist/{visually-hidden-BJdvqqvn.js → visually-hidden-DgVO3NaB.js} +1 -1
- package/package.json +87 -5
- package/dist/avatar-CaGJHy1N.js +0 -145
- package/dist/calendar-BzJdv_SZ.js +0 -449
- package/dist/card-Ca4KQKYQ.js +0 -154
- package/dist/command-palette-BmQu2w4H.js +0 -391
- package/dist/comment-thread-ASaXDcGo.js +0 -1410
- package/dist/date-range-picker-DQpUeKqV.js +0 -570
- package/dist/dialog-BX1zYMs-.js +0 -219
- package/dist/drawer-DsASTiP-.js +0 -553
- package/dist/elastic-slider-BG6K019r.js +0 -395
- package/dist/elastic-slider.js +0 -2
- package/dist/slider-DVG6-Awh.js +0 -308
- package/dist/sx-Dx9JUKp5.js +0 -23
- package/dist/theme-root-Bs1U3uPA.js +0 -46
- package/dist/theme-scope-t7nAKc2c.js +0 -27
- package/dist/types/components/elastic-slider/elastic-slider.d.ts +0 -53
- package/dist/types/components/elastic-slider/index.d.ts +0 -1
- package/dist/use-native-dialog-DWpIUVO1.js +0 -84
- package/dist/use-slider-interaction-ChL-208h.js +0 -234
- /package/dist/types/components/{comment-thread → thread}/thread-core.d.ts +0 -0
|
@@ -1,1410 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { i as e, r as t, t as n } from "./sx-Dx9JUKp5.js";
|
|
3
|
-
import { n as r, r as i } from "./media-8yrN85VT.js";
|
|
4
|
-
import { n as a } from "./roving-focus-CYlo_Kf8.js";
|
|
5
|
-
import { t as o } from "./use-controlled-state-DpeVQZNR.js";
|
|
6
|
-
import { t as s } from "./visually-hidden-BJdvqqvn.js";
|
|
7
|
-
import { t as c } from "./renderable-DzcIj1Lo.js";
|
|
8
|
-
import { t as l } from "./button-NLY0h6EJ.js";
|
|
9
|
-
import { t as u } from "./avatar-CaGJHy1N.js";
|
|
10
|
-
import { t as d } from "./card-Ca4KQKYQ.js";
|
|
11
|
-
import { n as f, o as p, s as m, t as h } from "./listbox-style-WX-RASp1.js";
|
|
12
|
-
import { t as g } from "./part-id-D0zksy32.js";
|
|
13
|
-
import { t as _ } from "./overlay-portal-C4JZFq2M.js";
|
|
14
|
-
import { t as ee } from "./textarea-3k4Y0QQ3.js";
|
|
15
|
-
import { useEffect as te, useId as ne, useLayoutEffect as v, useMemo as y, useRef as b, useState as x } from "react";
|
|
16
|
-
import { vars as S } from "@jfrader/tokens/vars";
|
|
17
|
-
import { Fragment as re, jsx as C, jsxs as w } from "@emotion/react/jsx-runtime";
|
|
18
|
-
import { autoUpdate as ie, flip as ae, offset as oe, shift as se, useFloating as ce, useMergeRefs as le } from "@floating-ui/react";
|
|
19
|
-
var T = [], ue = 864e13, de = 1e3, fe = 60 * de, E = 60 * fe, D = 24 * E, O = 365.2425 * D, pe = [
|
|
20
|
-
["year", O],
|
|
21
|
-
["month", O / 12],
|
|
22
|
-
["week", 7 * D],
|
|
23
|
-
["day", D],
|
|
24
|
-
["hour", E],
|
|
25
|
-
["minute", fe]
|
|
26
|
-
], k = /^(\d{4})-(\d{2})-(\d{2})T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:\d{2})$/, me = "en-US", A = (e) => Number.isFinite(e) && Math.abs(e) <= ue;
|
|
27
|
-
function he(e) {
|
|
28
|
-
if (typeof e == "number") return A(e) ? e : null;
|
|
29
|
-
if (e instanceof Date) return A(e.getTime()) ? e.getTime() : null;
|
|
30
|
-
if (typeof e != "string") return null;
|
|
31
|
-
let t = k.exec(e);
|
|
32
|
-
if (!t) return null;
|
|
33
|
-
let [n, r, i] = t.slice(1, 4).map(Number), a = new Date(Date.UTC(n, r - 1, i));
|
|
34
|
-
if (a.getUTCMonth() !== r - 1 || a.getUTCDate() !== i) return null;
|
|
35
|
-
let o = Date.parse(e);
|
|
36
|
-
return A(o) ? o : null;
|
|
37
|
-
}
|
|
38
|
-
function j(e, t, n) {
|
|
39
|
-
let r = e - t;
|
|
40
|
-
for (let [e, t] of pe) if (Math.abs(r) >= t) return n.format(Math.trunc(r / t), e);
|
|
41
|
-
return n.format(Math.trunc(r / de), "second");
|
|
42
|
-
}
|
|
43
|
-
function ge(e, t) {
|
|
44
|
-
return {
|
|
45
|
-
relative: new Intl.RelativeTimeFormat(e, { numeric: "auto" }),
|
|
46
|
-
full: new Intl.DateTimeFormat(e, {
|
|
47
|
-
timeZone: t,
|
|
48
|
-
dateStyle: "full",
|
|
49
|
-
timeStyle: "short"
|
|
50
|
-
}),
|
|
51
|
-
number: new Intl.NumberFormat(e),
|
|
52
|
-
plural: new Intl.PluralRules(e),
|
|
53
|
-
people: new Intl.ListFormat(e, { type: "conjunction" }),
|
|
54
|
-
facts: new Intl.ListFormat(e, {
|
|
55
|
-
type: "unit",
|
|
56
|
-
style: "short"
|
|
57
|
-
})
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
function _e(e, t, n) {
|
|
61
|
-
let r = [], i = t;
|
|
62
|
-
try {
|
|
63
|
-
Intl.getCanonicalLocales(t);
|
|
64
|
-
} catch {
|
|
65
|
-
r.push(`${e}: locale ${JSON.stringify(String(t))} is not a valid language tag; using the default locale.`), i = void 0;
|
|
66
|
-
}
|
|
67
|
-
let a = n;
|
|
68
|
-
try {
|
|
69
|
-
new Intl.DateTimeFormat(me, { timeZone: n });
|
|
70
|
-
} catch {
|
|
71
|
-
r.push(`${e}: timeZone ${JSON.stringify(n)} is not a valid IANA time zone; using UTC.`), a = "UTC";
|
|
72
|
-
}
|
|
73
|
-
return {
|
|
74
|
-
formatters: ge(i, a),
|
|
75
|
-
problems: r
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
var ve = (e, t, n, r) => `${e.number.format(t)} ${e.plural.select(t) === "one" ? n : r}`;
|
|
79
|
-
function ye(e) {
|
|
80
|
-
let t = /* @__PURE__ */ new Map(), n = [], r = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = !1, o = (e, s, c) => {
|
|
81
|
-
for (let l of e) i.has(l) ? a = !0 : (t.has(l.id) ? r.add(l.id) : (t.set(l.id, {
|
|
82
|
-
comment: l,
|
|
83
|
-
parentId: s,
|
|
84
|
-
depth: c
|
|
85
|
-
}), n.push(l.id)), i.add(l), o(l.replies ?? T, l.id, c + 1), i.delete(l));
|
|
86
|
-
};
|
|
87
|
-
return o(e, null, 0), {
|
|
88
|
-
entries: t,
|
|
89
|
-
order: n,
|
|
90
|
-
duplicates: [...r],
|
|
91
|
-
cyclic: a
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
function M(e, t, n, r = /* @__PURE__ */ new Set()) {
|
|
95
|
-
for (let [i, a] of e.entries()) {
|
|
96
|
-
if (r.has(a)) continue;
|
|
97
|
-
if (a.id === t) {
|
|
98
|
-
let t = n(a);
|
|
99
|
-
if (t === a) return e;
|
|
100
|
-
let r = [...e];
|
|
101
|
-
return t === null ? r.splice(i, 1) : r[i] = t, r;
|
|
102
|
-
}
|
|
103
|
-
let o = a.replies;
|
|
104
|
-
if (!o?.length) continue;
|
|
105
|
-
let s = M(o, t, n, new Set(r).add(a));
|
|
106
|
-
if (s !== o) return e.with(i, {
|
|
107
|
-
...a,
|
|
108
|
-
replies: s
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
return e;
|
|
112
|
-
}
|
|
113
|
-
function be(e, t, n) {
|
|
114
|
-
if (t === null) return null;
|
|
115
|
-
let r = e.entries.get(t);
|
|
116
|
-
if (r) {
|
|
117
|
-
if (n <= 0) return null;
|
|
118
|
-
for (; r.depth + 1 > n && r.parentId !== null;) r = e.entries.get(r.parentId);
|
|
119
|
-
return r.comment.id;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
function N(e, t, n) {
|
|
123
|
-
return t === null ? [...e, n] : M(e, t, (e) => ({
|
|
124
|
-
...e,
|
|
125
|
-
replies: [...e.replies ?? T, n]
|
|
126
|
-
}));
|
|
127
|
-
}
|
|
128
|
-
function P(e, t, n) {
|
|
129
|
-
return M(e, t, (e) => e.deleted || e.body === n ? e : {
|
|
130
|
-
...e,
|
|
131
|
-
body: n,
|
|
132
|
-
edited: !0
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
function F(e, t) {
|
|
136
|
-
return M(e, t, (e) => e.deleted ? e : e.replies?.length ? {
|
|
137
|
-
...e,
|
|
138
|
-
deleted: !0,
|
|
139
|
-
body: "",
|
|
140
|
-
reactions: []
|
|
141
|
-
} : null);
|
|
142
|
-
}
|
|
143
|
-
function I(e, t, n) {
|
|
144
|
-
let r = e.find((e) => e.emoji === t);
|
|
145
|
-
if (!r) return {
|
|
146
|
-
reactions: [...e, {
|
|
147
|
-
emoji: t,
|
|
148
|
-
users: [n]
|
|
149
|
-
}],
|
|
150
|
-
added: !0
|
|
151
|
-
};
|
|
152
|
-
let i = !r.users.includes(n), a = i ? [...r.users, n] : r.users.filter((e) => e !== n);
|
|
153
|
-
return {
|
|
154
|
-
reactions: a.length === 0 ? e.filter((e) => e !== r) : e.map((e) => e === r ? {
|
|
155
|
-
emoji: t,
|
|
156
|
-
users: a
|
|
157
|
-
} : e),
|
|
158
|
-
added: i
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
function xe(e, t, n, r) {
|
|
162
|
-
let i = !1;
|
|
163
|
-
return {
|
|
164
|
-
comments: M(e, t, (e) => {
|
|
165
|
-
if (e.deleted) return e;
|
|
166
|
-
let t = I(e.reactions ?? [], n, r);
|
|
167
|
-
return i = t.added, {
|
|
168
|
-
...e,
|
|
169
|
-
reactions: t.reactions
|
|
170
|
-
};
|
|
171
|
-
}),
|
|
172
|
-
added: i
|
|
173
|
-
};
|
|
174
|
-
}
|
|
175
|
-
function Se(e, t) {
|
|
176
|
-
let n = /* @__PURE__ */ new Set();
|
|
177
|
-
return e.filter((e) => {
|
|
178
|
-
let r = t(e);
|
|
179
|
-
return !n.has(r) && (n.add(r), !0);
|
|
180
|
-
});
|
|
181
|
-
}
|
|
182
|
-
//#endregion
|
|
183
|
-
//#region src/components/comment-thread/thread-parts.tsx
|
|
184
|
-
var Ce = "@", we = 8, L = 4, R = 8, Te = /\s/u, z = (e, t) => `${e}-${t}`, Ee = (e) => e.nativeEvent.isComposing || e.nativeEvent.keyCode === 229, B = {
|
|
185
|
-
sm: "sm",
|
|
186
|
-
md: "md"
|
|
187
|
-
}, De = t({
|
|
188
|
-
fontSize: S.textSize.xs,
|
|
189
|
-
color: S.color.textMuted,
|
|
190
|
-
fontVariantNumeric: "tabular-nums",
|
|
191
|
-
whiteSpace: "nowrap"
|
|
192
|
-
});
|
|
193
|
-
function Oe({ epoch: e, now: t, formatters: n, invalidLabel: r, id: i, fullId: a, ui: o, part: c }) {
|
|
194
|
-
return e === null ? /* @__PURE__ */ C("span", {
|
|
195
|
-
id: i,
|
|
196
|
-
"data-ui": z(o, "time"),
|
|
197
|
-
className: c?.className,
|
|
198
|
-
css: [De, c?.css],
|
|
199
|
-
children: r
|
|
200
|
-
}) : /* @__PURE__ */ w(re, { children: [/* @__PURE__ */ C("time", {
|
|
201
|
-
id: i,
|
|
202
|
-
dateTime: new Date(e).toISOString(),
|
|
203
|
-
"data-ui": z(o, "time"),
|
|
204
|
-
className: c?.className,
|
|
205
|
-
css: [De, c?.css],
|
|
206
|
-
children: t === null ? n.full.format(e) : j(e, t, n.relative)
|
|
207
|
-
}), /* @__PURE__ */ C("span", {
|
|
208
|
-
id: a,
|
|
209
|
-
css: s,
|
|
210
|
-
children: n.full.format(e)
|
|
211
|
-
})] });
|
|
212
|
-
}
|
|
213
|
-
var ke = t({
|
|
214
|
-
display: "grid",
|
|
215
|
-
gridTemplateColumns: "auto minmax(0, 1fr)",
|
|
216
|
-
columnGap: "var(--thread-column-gap)",
|
|
217
|
-
alignItems: "start"
|
|
218
|
-
}), Ae = t({ display: "inline-flex" }), je = t({
|
|
219
|
-
display: "grid",
|
|
220
|
-
rowGap: S.space[1],
|
|
221
|
-
minInlineSize: 0
|
|
222
|
-
}), V = t({
|
|
223
|
-
display: "flex",
|
|
224
|
-
flexWrap: "wrap",
|
|
225
|
-
alignItems: "baseline",
|
|
226
|
-
columnGap: S.space[2],
|
|
227
|
-
rowGap: S.space[1],
|
|
228
|
-
minInlineSize: 0
|
|
229
|
-
}), Me = t({
|
|
230
|
-
fontWeight: S.fontWeight.semibold,
|
|
231
|
-
color: S.color.text,
|
|
232
|
-
overflowWrap: "anywhere"
|
|
233
|
-
}), H = t({
|
|
234
|
-
fontSize: S.textSize.xs,
|
|
235
|
-
color: S.color.textMuted
|
|
236
|
-
});
|
|
237
|
-
function Ne({ ui: e, author: t, label: n, epoch: r, now: i, formatters: a, invalidTimeLabel: o, meta: s, size: c, baseId: l, messageId: d, children: f, slots: p }) {
|
|
238
|
-
let m = g(l, "author", d), h = g(l, "time", d), _ = g(l, "when", d);
|
|
239
|
-
return /* @__PURE__ */ w("article", {
|
|
240
|
-
"aria-label": n,
|
|
241
|
-
"aria-labelledby": n === void 0 ? `${m} ${h}` : void 0,
|
|
242
|
-
"aria-describedby": r === null ? void 0 : _,
|
|
243
|
-
"data-ui": z(e, "article"),
|
|
244
|
-
className: p?.article?.className,
|
|
245
|
-
css: [ke, p?.article?.css],
|
|
246
|
-
children: [/* @__PURE__ */ C("span", {
|
|
247
|
-
"aria-hidden": "true",
|
|
248
|
-
css: Ae,
|
|
249
|
-
children: /* @__PURE__ */ C(u, {
|
|
250
|
-
name: t.name,
|
|
251
|
-
src: t.avatar,
|
|
252
|
-
size: B[c]
|
|
253
|
-
})
|
|
254
|
-
}), /* @__PURE__ */ w("div", {
|
|
255
|
-
css: je,
|
|
256
|
-
children: [/* @__PURE__ */ w("div", {
|
|
257
|
-
css: V,
|
|
258
|
-
children: [
|
|
259
|
-
/* @__PURE__ */ C("span", {
|
|
260
|
-
id: m,
|
|
261
|
-
"data-ui": z(e, "author"),
|
|
262
|
-
css: Me,
|
|
263
|
-
children: t.name
|
|
264
|
-
}),
|
|
265
|
-
/* @__PURE__ */ C(Oe, {
|
|
266
|
-
epoch: r,
|
|
267
|
-
now: i,
|
|
268
|
-
formatters: a,
|
|
269
|
-
invalidLabel: o,
|
|
270
|
-
id: h,
|
|
271
|
-
fullId: _,
|
|
272
|
-
ui: e,
|
|
273
|
-
part: p?.time
|
|
274
|
-
}),
|
|
275
|
-
s ? /* @__PURE__ */ C("span", {
|
|
276
|
-
css: H,
|
|
277
|
-
children: s
|
|
278
|
-
}) : null
|
|
279
|
-
]
|
|
280
|
-
}), f]
|
|
281
|
-
})]
|
|
282
|
-
});
|
|
283
|
-
}
|
|
284
|
-
var U = t({
|
|
285
|
-
display: "flex",
|
|
286
|
-
flexWrap: "wrap",
|
|
287
|
-
alignItems: "center",
|
|
288
|
-
gap: S.space[1]
|
|
289
|
-
}), W = t({
|
|
290
|
-
gap: S.space[1],
|
|
291
|
-
paddingInline: S.space[2],
|
|
292
|
-
fontVariantNumeric: "tabular-nums",
|
|
293
|
-
"&[aria-pressed=\"true\"]": {
|
|
294
|
-
borderWidth: "2px",
|
|
295
|
-
borderColor: S.color.accentBorder,
|
|
296
|
-
backgroundColor: S.color.accentSoft,
|
|
297
|
-
color: S.color.accentText,
|
|
298
|
-
fontWeight: S.fontWeight.semibold
|
|
299
|
-
},
|
|
300
|
-
[r]: { "&[aria-pressed=\"true\"]": { borderColor: "Highlight" } }
|
|
301
|
-
}), Pe = t({
|
|
302
|
-
display: "inline-flex",
|
|
303
|
-
alignItems: "center",
|
|
304
|
-
gap: S.space[1],
|
|
305
|
-
minBlockSize: S.space[6],
|
|
306
|
-
paddingInline: S.space[2],
|
|
307
|
-
border: `1px solid ${S.color.border}`,
|
|
308
|
-
borderRadius: S.radius.full,
|
|
309
|
-
fontSize: S.textSize.sm,
|
|
310
|
-
fontVariantNumeric: "tabular-nums"
|
|
311
|
-
}), Fe = t({ paddingInline: S.space[2] }), Ie = t({
|
|
312
|
-
display: "flex",
|
|
313
|
-
flexWrap: "wrap",
|
|
314
|
-
alignItems: "center",
|
|
315
|
-
gap: S.space[1],
|
|
316
|
-
padding: S.space[1],
|
|
317
|
-
border: `1px solid ${S.color.border}`,
|
|
318
|
-
borderRadius: S.radius.md,
|
|
319
|
-
backgroundColor: S.color.surface,
|
|
320
|
-
[r]: { borderColor: "CanvasText" }
|
|
321
|
-
}), G = t({
|
|
322
|
-
display: "block",
|
|
323
|
-
inlineSize: "1em",
|
|
324
|
-
blockSize: "1em"
|
|
325
|
-
}), Le = /* @__PURE__ */ w("svg", {
|
|
326
|
-
viewBox: "0 0 16 16",
|
|
327
|
-
fill: "none",
|
|
328
|
-
stroke: "currentColor",
|
|
329
|
-
strokeWidth: "1.5",
|
|
330
|
-
css: G,
|
|
331
|
-
"aria-hidden": "true",
|
|
332
|
-
children: [/* @__PURE__ */ C("circle", {
|
|
333
|
-
cx: "8",
|
|
334
|
-
cy: "8",
|
|
335
|
-
r: "6.25"
|
|
336
|
-
}), /* @__PURE__ */ C("path", {
|
|
337
|
-
d: "M5.5 9.5c.6.9 1.4 1.3 2.5 1.3s1.9-.4 2.5-1.3M6 6.25h.01M10 6.25h.01",
|
|
338
|
-
strokeLinecap: "round"
|
|
339
|
-
})]
|
|
340
|
-
}), Re = /* @__PURE__ */ C("svg", {
|
|
341
|
-
viewBox: "0 0 16 16",
|
|
342
|
-
fill: "none",
|
|
343
|
-
stroke: "currentColor",
|
|
344
|
-
strokeWidth: "1.5",
|
|
345
|
-
css: G,
|
|
346
|
-
"aria-hidden": "true",
|
|
347
|
-
children: /* @__PURE__ */ C("path", {
|
|
348
|
-
d: "M4 4l8 8M12 4l-8 8",
|
|
349
|
-
strokeLinecap: "round"
|
|
350
|
-
})
|
|
351
|
-
});
|
|
352
|
-
function ze({ ui: e, reactions: t, offered: n, currentUserId: r, formatters: i, labels: o, readOnly: c, disabled: u, pickerOpen: d, onPickerOpenChange: f, onToggle: p, pickerId: m, part: h }) {
|
|
353
|
-
let g = b(null), _ = b(!1), [ee, te] = x(0), ne = {
|
|
354
|
-
itemSelector: "[data-part=\"emoji\"]",
|
|
355
|
-
ownerSelector: `[data-ui="${z(e, "picker")}"]`
|
|
356
|
-
}, y = !c && n.length > 0, S = y && d;
|
|
357
|
-
v(() => {
|
|
358
|
-
!d && _.current && (_.current = !1, g.current?.focus());
|
|
359
|
-
}, [d]);
|
|
360
|
-
let ie = () => {
|
|
361
|
-
_.current = !0, f(!1);
|
|
362
|
-
};
|
|
363
|
-
return t.length === 0 && !y ? null : /* @__PURE__ */ w("div", {
|
|
364
|
-
"data-ui": z(e, "reactions"),
|
|
365
|
-
className: h?.className,
|
|
366
|
-
css: [U, h?.css],
|
|
367
|
-
children: [
|
|
368
|
-
t.map(({ emoji: e, users: t }) => {
|
|
369
|
-
let n = t.includes(r), a = o.reactionCount(e, t.length, n), d = /* @__PURE__ */ w(re, { children: [/* @__PURE__ */ C("span", {
|
|
370
|
-
"aria-hidden": "true",
|
|
371
|
-
children: e
|
|
372
|
-
}), /* @__PURE__ */ C("span", {
|
|
373
|
-
"aria-hidden": "true",
|
|
374
|
-
children: i.number.format(t.length)
|
|
375
|
-
})] });
|
|
376
|
-
return c ? /* @__PURE__ */ w("span", {
|
|
377
|
-
"data-part": "reaction",
|
|
378
|
-
css: Pe,
|
|
379
|
-
children: [d, /* @__PURE__ */ C("span", {
|
|
380
|
-
css: s,
|
|
381
|
-
children: a
|
|
382
|
-
})]
|
|
383
|
-
}, e) : /* @__PURE__ */ C(l, {
|
|
384
|
-
variant: "outline",
|
|
385
|
-
size: "sm",
|
|
386
|
-
"data-part": "reaction",
|
|
387
|
-
"aria-label": a,
|
|
388
|
-
"aria-pressed": n,
|
|
389
|
-
disabled: u,
|
|
390
|
-
onClick: () => p(e),
|
|
391
|
-
css: W,
|
|
392
|
-
children: d
|
|
393
|
-
}, e);
|
|
394
|
-
}),
|
|
395
|
-
y ? /* @__PURE__ */ C(l, {
|
|
396
|
-
ref: g,
|
|
397
|
-
variant: "ghost",
|
|
398
|
-
size: "sm",
|
|
399
|
-
"aria-label": o.addReaction,
|
|
400
|
-
"aria-expanded": S,
|
|
401
|
-
"aria-controls": S ? m : void 0,
|
|
402
|
-
disabled: u,
|
|
403
|
-
"data-action": "react",
|
|
404
|
-
onClick: () => f(!d),
|
|
405
|
-
css: Fe,
|
|
406
|
-
children: Le
|
|
407
|
-
}) : null,
|
|
408
|
-
S ? /* @__PURE__ */ w("div", {
|
|
409
|
-
id: m,
|
|
410
|
-
role: "group",
|
|
411
|
-
"aria-label": o.reactions,
|
|
412
|
-
"data-ui": z(e, "picker"),
|
|
413
|
-
onKeyDown: (e) => {
|
|
414
|
-
e.key === "Escape" ? (e.preventDefault(), e.stopPropagation(), ie()) : a(e, e.currentTarget, "horizontal", ne);
|
|
415
|
-
},
|
|
416
|
-
css: Ie,
|
|
417
|
-
children: [n.map((e, t) => /* @__PURE__ */ C(l, {
|
|
418
|
-
variant: "ghost",
|
|
419
|
-
size: "sm",
|
|
420
|
-
"data-part": "emoji",
|
|
421
|
-
"aria-label": o.reactWith(e),
|
|
422
|
-
tabIndex: t === Math.min(ee, n.length - 1) ? 0 : -1,
|
|
423
|
-
autoFocus: t === 0,
|
|
424
|
-
disabled: u,
|
|
425
|
-
onFocus: () => te(t),
|
|
426
|
-
onClick: () => {
|
|
427
|
-
p(e), ie();
|
|
428
|
-
},
|
|
429
|
-
css: Fe,
|
|
430
|
-
children: /* @__PURE__ */ C("span", {
|
|
431
|
-
"aria-hidden": "true",
|
|
432
|
-
children: e
|
|
433
|
-
})
|
|
434
|
-
}, e)), /* @__PURE__ */ C(l, {
|
|
435
|
-
variant: "ghost",
|
|
436
|
-
size: "sm",
|
|
437
|
-
"aria-label": o.closeReactions,
|
|
438
|
-
onClick: ie,
|
|
439
|
-
css: Fe,
|
|
440
|
-
children: Re
|
|
441
|
-
})]
|
|
442
|
-
}) : null
|
|
443
|
-
]
|
|
444
|
-
});
|
|
445
|
-
}
|
|
446
|
-
function Be(e, t) {
|
|
447
|
-
let n = e.slice(0, t), r = n.lastIndexOf(Ce);
|
|
448
|
-
if (r === -1 || r > 0 && !Te.test(n[r - 1])) return null;
|
|
449
|
-
let i = n.slice(r + 1);
|
|
450
|
-
return Te.test(i) ? null : {
|
|
451
|
-
start: r,
|
|
452
|
-
query: i
|
|
453
|
-
};
|
|
454
|
-
}
|
|
455
|
-
function Ve(e, t, n) {
|
|
456
|
-
let r = t.toLocaleLowerCase(n);
|
|
457
|
-
return e.filter((e) => e.name.toLocaleLowerCase(n).split(Te).some((e) => e.startsWith(r))).slice(0, we);
|
|
458
|
-
}
|
|
459
|
-
var He = {
|
|
460
|
-
ArrowDown: (e, t) => (e + 1) % t,
|
|
461
|
-
ArrowUp: (e, t) => (e - 1 + t) % t,
|
|
462
|
-
Home: () => 0,
|
|
463
|
-
End: (e, t) => t - 1
|
|
464
|
-
}, Ue = t({
|
|
465
|
-
display: "grid",
|
|
466
|
-
gridTemplateColumns: "auto minmax(0, 1fr)",
|
|
467
|
-
columnGap: "var(--thread-column-gap)",
|
|
468
|
-
alignItems: "start",
|
|
469
|
-
inlineSize: "100%",
|
|
470
|
-
"&[data-avatar=\"false\"]": { gridTemplateColumns: "minmax(0, 1fr)" }
|
|
471
|
-
}), K = t({
|
|
472
|
-
display: "inline-flex",
|
|
473
|
-
"@container (max-width: 28rem)": { display: "none" }
|
|
474
|
-
}), q = t({
|
|
475
|
-
display: "grid",
|
|
476
|
-
rowGap: S.space[2],
|
|
477
|
-
minInlineSize: 0,
|
|
478
|
-
"@container (max-width: 28rem)": { gridColumn: "1 / -1" }
|
|
479
|
-
}), We = t({
|
|
480
|
-
display: "flex",
|
|
481
|
-
flexWrap: "wrap",
|
|
482
|
-
justifyContent: "flex-end",
|
|
483
|
-
gap: S.space[2]
|
|
484
|
-
}), J = t({ gap: S.space[2] }), Y = {
|
|
485
|
-
sm: "sm",
|
|
486
|
-
md: "md"
|
|
487
|
-
}, Ge = {
|
|
488
|
-
sm: 2,
|
|
489
|
-
md: 3
|
|
490
|
-
}, Ke = {
|
|
491
|
-
sm: t({
|
|
492
|
-
"--thread-column-gap": S.space[2],
|
|
493
|
-
"--thread-avatar": S.space[6]
|
|
494
|
-
}),
|
|
495
|
-
md: t({
|
|
496
|
-
"--thread-column-gap": S.space[3],
|
|
497
|
-
"--thread-avatar": S.space[8]
|
|
498
|
-
})
|
|
499
|
-
};
|
|
500
|
-
function qe({ ui: e, draft: t, onDraftChange: n, onSubmit: r, onCancel: i, cancelOnEscape: a = !0, cancelable: o, label: s, placeholder: c, submitLabel: d, cancelLabel: te, mentionsLabel: y, people: S, locale: re, disabled: T, pending: ue, autoFocus: de, size: fe, author: E, textareaProps: D, submitProps: O, part: pe, kind: k }) {
|
|
501
|
-
let me = ne(), A = b(null), he = b(null), j = b(null), [ge, _e] = x(null), [ve, ye] = x(null), [M, be] = x({
|
|
502
|
-
query: "",
|
|
503
|
-
index: 0
|
|
504
|
-
}), N = ge === null ? null : Be(t, ge), P = N ? Ve(S, N.query, re) : [], F = N !== null && !T && P.length > 0 && ve !== N.start, I = N && M.query === N.query ? Math.min(M.index, P.length - 1) : 0, xe = `${me}-mentions`, Se = (e) => g(me, "person", e.id), { refs: we, floatingStyles: Te } = ce({
|
|
505
|
-
open: F,
|
|
506
|
-
placement: "bottom-start",
|
|
507
|
-
middleware: [
|
|
508
|
-
oe(L),
|
|
509
|
-
ae({ padding: R }),
|
|
510
|
-
se({ padding: R })
|
|
511
|
-
],
|
|
512
|
-
whileElementsMounted: ie
|
|
513
|
-
}), De = le([
|
|
514
|
-
he,
|
|
515
|
-
we.setReference,
|
|
516
|
-
D?.ref
|
|
517
|
-
]);
|
|
518
|
-
v(() => {
|
|
519
|
-
j.current !== null && he.current && (he.current.setSelectionRange(j.current, j.current), j.current = null);
|
|
520
|
-
});
|
|
521
|
-
let Oe = (e) => _e(e.selectionStart === e.selectionEnd ? e.selectionStart : null), ke = (e) => {
|
|
522
|
-
if (!N) return;
|
|
523
|
-
let r = `${Ce}${e.name} `, i = N.start + 1 + N.query.length, a = t.slice(0, N.start) + r + t.slice(i), o = N.start + r.length;
|
|
524
|
-
j.current = o, _e(o), n(a);
|
|
525
|
-
}, je = () => {
|
|
526
|
-
let e = t.trim();
|
|
527
|
-
T || ue || e === "" || !A.current || r(e, A.current);
|
|
528
|
-
}, V = (e) => {
|
|
529
|
-
D?.onChange?.(e), n(e.currentTarget.value), Oe(e.currentTarget);
|
|
530
|
-
}, Me = (e) => {
|
|
531
|
-
D?.onSelect?.(e), Oe(e.currentTarget);
|
|
532
|
-
}, H = (e) => {
|
|
533
|
-
D?.onBlur?.(e), N && ye(N.start);
|
|
534
|
-
}, Ne = (e) => {
|
|
535
|
-
if (D?.onKeyDown?.(e), e.defaultPrevented || Ee(e)) return;
|
|
536
|
-
let t = !e.altKey && !e.ctrlKey && !e.metaKey && !e.shiftKey;
|
|
537
|
-
if (F && N) {
|
|
538
|
-
let n = t ? He[e.key] : void 0;
|
|
539
|
-
if (n) {
|
|
540
|
-
e.preventDefault(), be({
|
|
541
|
-
query: N.query,
|
|
542
|
-
index: n(I, P.length)
|
|
543
|
-
});
|
|
544
|
-
return;
|
|
545
|
-
}
|
|
546
|
-
if (t && (e.key === "Enter" || e.key === "Tab")) {
|
|
547
|
-
e.preventDefault(), ke(P[I]);
|
|
548
|
-
return;
|
|
549
|
-
}
|
|
550
|
-
if (e.key === "Escape") {
|
|
551
|
-
e.preventDefault(), e.stopPropagation(), ye(N.start);
|
|
552
|
-
return;
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
e.key === "Enter" && (e.ctrlKey || e.metaKey) && !e.altKey && !e.shiftKey ? (e.preventDefault(), je()) : e.key === "Escape" && a && i && A.current && (e.preventDefault(), e.stopPropagation(), i(A.current));
|
|
556
|
-
}, U = t.trim() === "", W = E !== void 0;
|
|
557
|
-
return /* @__PURE__ */ w("div", {
|
|
558
|
-
ref: A,
|
|
559
|
-
"data-ui": z(e, "composer"),
|
|
560
|
-
"data-composer": k,
|
|
561
|
-
"data-avatar": W,
|
|
562
|
-
className: pe?.className,
|
|
563
|
-
css: [Ue, pe?.css],
|
|
564
|
-
children: [
|
|
565
|
-
W ? /* @__PURE__ */ C("span", {
|
|
566
|
-
"aria-hidden": "true",
|
|
567
|
-
css: K,
|
|
568
|
-
children: /* @__PURE__ */ C(u, {
|
|
569
|
-
name: E.name,
|
|
570
|
-
src: E.avatar,
|
|
571
|
-
size: B[fe]
|
|
572
|
-
})
|
|
573
|
-
}) : null,
|
|
574
|
-
/* @__PURE__ */ w("div", {
|
|
575
|
-
css: q,
|
|
576
|
-
children: [/* @__PURE__ */ C(ee, {
|
|
577
|
-
"aria-label": s,
|
|
578
|
-
placeholder: c,
|
|
579
|
-
size: Y[fe],
|
|
580
|
-
rows: Ge[fe],
|
|
581
|
-
autoResize: !0,
|
|
582
|
-
autoFocus: de,
|
|
583
|
-
...D,
|
|
584
|
-
ref: De,
|
|
585
|
-
value: t,
|
|
586
|
-
disabled: T || D?.disabled,
|
|
587
|
-
"aria-autocomplete": "list",
|
|
588
|
-
"aria-controls": F ? xe : D?.["aria-controls"],
|
|
589
|
-
"aria-activedescendant": F ? Se(P[I]) : void 0,
|
|
590
|
-
onChange: V,
|
|
591
|
-
onSelect: Me,
|
|
592
|
-
onBlur: H,
|
|
593
|
-
onKeyDown: Ne
|
|
594
|
-
}), /* @__PURE__ */ w("div", {
|
|
595
|
-
css: We,
|
|
596
|
-
children: [o ? /* @__PURE__ */ C(l, {
|
|
597
|
-
variant: "ghost",
|
|
598
|
-
size: "sm",
|
|
599
|
-
disabled: T,
|
|
600
|
-
onClick: () => A.current && i?.(A.current),
|
|
601
|
-
children: te
|
|
602
|
-
}) : null, /* @__PURE__ */ C(l, {
|
|
603
|
-
variant: "solid",
|
|
604
|
-
tone: "accent",
|
|
605
|
-
size: "sm",
|
|
606
|
-
...O,
|
|
607
|
-
disabled: T || O?.disabled,
|
|
608
|
-
"aria-disabled": U ? !0 : O?.["aria-disabled"],
|
|
609
|
-
loading: ue,
|
|
610
|
-
"data-action": "submit",
|
|
611
|
-
onClick: (e) => {
|
|
612
|
-
O?.onClick?.(e), e.defaultPrevented || je();
|
|
613
|
-
},
|
|
614
|
-
children: d
|
|
615
|
-
})]
|
|
616
|
-
})]
|
|
617
|
-
}),
|
|
618
|
-
F ? /* @__PURE__ */ C(_, { children: /* @__PURE__ */ C("div", {
|
|
619
|
-
ref: we.setFloating,
|
|
620
|
-
id: xe,
|
|
621
|
-
role: "listbox",
|
|
622
|
-
"aria-label": y,
|
|
623
|
-
"data-ui": z(e, "mentions"),
|
|
624
|
-
style: Te,
|
|
625
|
-
css: [m, p],
|
|
626
|
-
children: P.map((t, n) => /* @__PURE__ */ w("div", {
|
|
627
|
-
id: Se(t),
|
|
628
|
-
role: "option",
|
|
629
|
-
"aria-selected": n === I,
|
|
630
|
-
"data-active": n === I ? "" : void 0,
|
|
631
|
-
"data-ui": z(e, "mention"),
|
|
632
|
-
onMouseDown: (e) => e.preventDefault(),
|
|
633
|
-
onClick: () => ke(t),
|
|
634
|
-
css: [
|
|
635
|
-
f,
|
|
636
|
-
h,
|
|
637
|
-
J
|
|
638
|
-
],
|
|
639
|
-
children: [/* @__PURE__ */ C("span", {
|
|
640
|
-
"aria-hidden": "true",
|
|
641
|
-
css: Ae,
|
|
642
|
-
children: /* @__PURE__ */ C(u, {
|
|
643
|
-
name: t.name,
|
|
644
|
-
src: t.avatar,
|
|
645
|
-
size: "sm"
|
|
646
|
-
})
|
|
647
|
-
}), t.name]
|
|
648
|
-
}, t.id))
|
|
649
|
-
}) }) : null
|
|
650
|
-
]
|
|
651
|
-
});
|
|
652
|
-
}
|
|
653
|
-
//#endregion
|
|
654
|
-
//#region src/components/comment-thread/comment-thread.tsx
|
|
655
|
-
var X = "comment-thread", Z = "root", Je = [
|
|
656
|
-
"👍",
|
|
657
|
-
"❤️",
|
|
658
|
-
"🎉",
|
|
659
|
-
"👀",
|
|
660
|
-
"🚀",
|
|
661
|
-
"✅"
|
|
662
|
-
], Ye = 2, Xe = 3, Ze = [], Qe = [], $e = {
|
|
663
|
-
replyTo: null,
|
|
664
|
-
editing: null,
|
|
665
|
-
confirming: null,
|
|
666
|
-
picker: null,
|
|
667
|
-
drafts: {},
|
|
668
|
-
pending: {}
|
|
669
|
-
}, et = "@container (max-width: 28rem)", Q = (e) => `reply:${e}`, $ = (e) => `edit:${e}`, tt = () => crypto.randomUUID(), nt = (e) => JSON.stringify([...new Set(e)].sort());
|
|
670
|
-
function rt(e, t) {
|
|
671
|
-
if (!(t in e)) return e;
|
|
672
|
-
let { [t]: n, ...r } = e;
|
|
673
|
-
return r;
|
|
674
|
-
}
|
|
675
|
-
function it(e, t) {
|
|
676
|
-
return {
|
|
677
|
-
...e,
|
|
678
|
-
drafts: rt(e.drafts, t),
|
|
679
|
-
pending: rt(e.pending, t),
|
|
680
|
-
replyTo: e.replyTo !== null && t === Q(e.replyTo) ? null : e.replyTo,
|
|
681
|
-
editing: e.editing !== null && t === $(e.editing) ? null : e.editing
|
|
682
|
-
};
|
|
683
|
-
}
|
|
684
|
-
function at(e, t) {
|
|
685
|
-
let n = e;
|
|
686
|
-
for (let [r, i] of Object.entries(e.pending)) {
|
|
687
|
-
let e = t.entries.get(i.id);
|
|
688
|
-
(i.kind === "add" ? e !== void 0 : !e || e.comment.deleted || e.comment.body === i.body) && (n = it(n, r));
|
|
689
|
-
}
|
|
690
|
-
let r = (e) => e === null || ot(t, e);
|
|
691
|
-
return r(n.replyTo) || (n = it(n, Q(n.replyTo))), r(n.editing) || (n = it(n, $(n.editing))), r(n.confirming) || (n = {
|
|
692
|
-
...n,
|
|
693
|
-
confirming: null
|
|
694
|
-
}), r(n.picker) || (n = {
|
|
695
|
-
...n,
|
|
696
|
-
picker: null
|
|
697
|
-
}), n;
|
|
698
|
-
}
|
|
699
|
-
function ot(e, t) {
|
|
700
|
-
let n = e.entries.get(t);
|
|
701
|
-
return n !== void 0 && !n.comment.deleted;
|
|
702
|
-
}
|
|
703
|
-
function st(e) {
|
|
704
|
-
return e.order.filter((t) => (e.entries.get(t).comment.replies?.length ?? 0) > 0);
|
|
705
|
-
}
|
|
706
|
-
function ct(e) {
|
|
707
|
-
let t = (t, n, r) => ve(e, t, n, r);
|
|
708
|
-
return {
|
|
709
|
-
thread: "Comments",
|
|
710
|
-
composer: "Add a comment",
|
|
711
|
-
placeholder: "Write a comment",
|
|
712
|
-
resolve: "Resolve",
|
|
713
|
-
resolved: "Resolved",
|
|
714
|
-
reopen: "Reopen",
|
|
715
|
-
empty: "No comments yet",
|
|
716
|
-
reply: "Reply",
|
|
717
|
-
edit: "Edit",
|
|
718
|
-
delete: "Delete",
|
|
719
|
-
cancel: "Cancel",
|
|
720
|
-
send: "Send",
|
|
721
|
-
save: "Save",
|
|
722
|
-
edited: "Edited",
|
|
723
|
-
editComment: "Edit comment",
|
|
724
|
-
deleteConfirm: "Delete this comment?",
|
|
725
|
-
deletedText: "This comment was deleted.",
|
|
726
|
-
deletedComment: "Deleted comment",
|
|
727
|
-
hideReplies: "Hide replies",
|
|
728
|
-
cancelReply: "Cancel",
|
|
729
|
-
addReaction: "Add reaction",
|
|
730
|
-
closeReactions: "Close reactions",
|
|
731
|
-
reactions: "Reactions",
|
|
732
|
-
mentions: "People",
|
|
733
|
-
invalidTime: "Unknown time",
|
|
734
|
-
replyingTo: (e) => `Reply to ${e}`,
|
|
735
|
-
showReplies: (e) => `Show ${t(e, "reply", "replies")}`,
|
|
736
|
-
commentCount: (e) => t(e, "comment", "comments"),
|
|
737
|
-
peopleCount: (e) => t(e, "person", "people"),
|
|
738
|
-
newComments: (e) => t(e, "new comment", "new comments"),
|
|
739
|
-
reactWith: (e) => `React with ${e}`,
|
|
740
|
-
reactionCount: (e, n, r) => r ? `${e} ${t(n, "reaction", "reactions")}, including you` : `${e} ${t(n, "reaction", "reactions")}`
|
|
741
|
-
};
|
|
742
|
-
}
|
|
743
|
-
var lt = e({
|
|
744
|
-
from: { opacity: 0 },
|
|
745
|
-
to: { opacity: 1 }
|
|
746
|
-
}), ut = t({
|
|
747
|
-
minInlineSize: 0,
|
|
748
|
-
containerType: "inline-size",
|
|
749
|
-
fontFamily: S.font.sans,
|
|
750
|
-
fontSize: S.textSize.sm,
|
|
751
|
-
lineHeight: S.lineHeight.base,
|
|
752
|
-
color: S.color.text
|
|
753
|
-
}), dt = {
|
|
754
|
-
sm: t({
|
|
755
|
-
"--comment-thread-gap": S.space[3],
|
|
756
|
-
"--comment-thread-indent": S.space[4]
|
|
757
|
-
}),
|
|
758
|
-
md: t({
|
|
759
|
-
"--comment-thread-gap": S.space[4],
|
|
760
|
-
"--comment-thread-indent": S.space[6]
|
|
761
|
-
})
|
|
762
|
-
}, ft = t({
|
|
763
|
-
display: "flex",
|
|
764
|
-
flexWrap: "wrap",
|
|
765
|
-
alignItems: "center",
|
|
766
|
-
justifyContent: "space-between",
|
|
767
|
-
gap: S.space[2]
|
|
768
|
-
}), pt = t({
|
|
769
|
-
display: "grid",
|
|
770
|
-
gap: S.space[1],
|
|
771
|
-
minInlineSize: 0
|
|
772
|
-
}), mt = t({ overflowWrap: "anywhere" }), ht = t({
|
|
773
|
-
margin: 0,
|
|
774
|
-
fontSize: S.textSize.xs,
|
|
775
|
-
color: S.color.textMuted
|
|
776
|
-
}), gt = t({ "&[hidden]": { display: "none" } }), _t = t({
|
|
777
|
-
display: "grid",
|
|
778
|
-
rowGap: "var(--comment-thread-gap)",
|
|
779
|
-
listStyle: "none",
|
|
780
|
-
margin: 0,
|
|
781
|
-
padding: 0
|
|
782
|
-
}), vt = t({
|
|
783
|
-
display: "grid",
|
|
784
|
-
rowGap: S.space[2],
|
|
785
|
-
minInlineSize: 0,
|
|
786
|
-
"&[data-new]": {
|
|
787
|
-
animationName: lt,
|
|
788
|
-
animationDuration: S.motion.duration.base,
|
|
789
|
-
animationTimingFunction: S.motion.easeStandard
|
|
790
|
-
},
|
|
791
|
-
[i]: { "&[data-new]": { animation: "none" } }
|
|
792
|
-
}), yt = t({
|
|
793
|
-
margin: 0,
|
|
794
|
-
whiteSpace: "pre-wrap",
|
|
795
|
-
overflowWrap: "anywhere",
|
|
796
|
-
lineHeight: S.lineHeight.relaxed,
|
|
797
|
-
color: S.color.text,
|
|
798
|
-
"&[data-deleted]": {
|
|
799
|
-
color: S.color.textMuted,
|
|
800
|
-
fontStyle: "italic"
|
|
801
|
-
}
|
|
802
|
-
}), bt = t({
|
|
803
|
-
display: "flex",
|
|
804
|
-
flexWrap: "wrap",
|
|
805
|
-
alignItems: "center",
|
|
806
|
-
gap: S.space[1]
|
|
807
|
-
}), xt = t({
|
|
808
|
-
display: "flex",
|
|
809
|
-
flexWrap: "wrap",
|
|
810
|
-
alignItems: "center",
|
|
811
|
-
gap: S.space[2],
|
|
812
|
-
paddingBlock: S.space[2],
|
|
813
|
-
paddingInline: S.space[3],
|
|
814
|
-
border: `1px solid ${S.color.dangerBorder}`,
|
|
815
|
-
borderRadius: S.radius.md,
|
|
816
|
-
[r]: { borderColor: "CanvasText" }
|
|
817
|
-
}), St = t({
|
|
818
|
-
flex: "1 1 auto",
|
|
819
|
-
fontWeight: S.fontWeight.medium
|
|
820
|
-
}), Ct = t({
|
|
821
|
-
marginInlineStart: "calc(var(--thread-avatar) + var(--thread-column-gap))",
|
|
822
|
-
[et]: { marginInlineStart: 0 }
|
|
823
|
-
}), wt = t({ justifySelf: "start" }), Tt = t({
|
|
824
|
-
display: "grid",
|
|
825
|
-
rowGap: "var(--comment-thread-gap)",
|
|
826
|
-
listStyle: "none",
|
|
827
|
-
margin: 0,
|
|
828
|
-
marginInlineStart: "calc(var(--thread-avatar) / 2 - 1px)",
|
|
829
|
-
padding: 0,
|
|
830
|
-
paddingInlineStart: "var(--comment-thread-indent)",
|
|
831
|
-
borderInlineStart: `2px solid ${S.color.border}`,
|
|
832
|
-
"&[hidden]": { display: "none" },
|
|
833
|
-
"&[data-capped]": {
|
|
834
|
-
marginInlineStart: 0,
|
|
835
|
-
paddingInlineStart: 0,
|
|
836
|
-
borderInlineStart: 0
|
|
837
|
-
},
|
|
838
|
-
[et]: { paddingInlineStart: S.space[3] },
|
|
839
|
-
[r]: { borderInlineStartColor: "GrayText" }
|
|
840
|
-
}), Et = t({
|
|
841
|
-
margin: 0,
|
|
842
|
-
paddingBlock: S.space[4],
|
|
843
|
-
color: S.color.textMuted
|
|
844
|
-
}), Dt = t({
|
|
845
|
-
display: "flex",
|
|
846
|
-
flexWrap: "wrap",
|
|
847
|
-
alignItems: "center",
|
|
848
|
-
gap: S.space[3]
|
|
849
|
-
}), Ot = t({
|
|
850
|
-
flex: "1 1 12rem",
|
|
851
|
-
display: "flex",
|
|
852
|
-
flexWrap: "wrap",
|
|
853
|
-
alignItems: "center",
|
|
854
|
-
gap: S.space[2],
|
|
855
|
-
margin: 0,
|
|
856
|
-
color: S.color.textMuted,
|
|
857
|
-
overflowWrap: "anywhere"
|
|
858
|
-
}), kt = t({
|
|
859
|
-
display: "inline-flex",
|
|
860
|
-
alignItems: "center",
|
|
861
|
-
gap: S.space[1],
|
|
862
|
-
minBlockSize: S.space[6],
|
|
863
|
-
paddingInline: S.space[2],
|
|
864
|
-
border: `1px solid ${S.color.borderStrong}`,
|
|
865
|
-
borderRadius: S.radius.full,
|
|
866
|
-
fontWeight: S.fontWeight.medium,
|
|
867
|
-
color: S.color.text,
|
|
868
|
-
[r]: { borderColor: "CanvasText" }
|
|
869
|
-
}), At = t({
|
|
870
|
-
display: "block",
|
|
871
|
-
inlineSize: "1em",
|
|
872
|
-
blockSize: "1em"
|
|
873
|
-
}), jt = /* @__PURE__ */ C("svg", {
|
|
874
|
-
viewBox: "0 0 16 16",
|
|
875
|
-
fill: "none",
|
|
876
|
-
stroke: "currentColor",
|
|
877
|
-
strokeWidth: "2",
|
|
878
|
-
css: At,
|
|
879
|
-
"aria-hidden": "true",
|
|
880
|
-
children: /* @__PURE__ */ C("path", {
|
|
881
|
-
d: "M3 8.5l3 3 7-7",
|
|
882
|
-
strokeLinecap: "round"
|
|
883
|
-
})
|
|
884
|
-
});
|
|
885
|
-
function Mt({ ref: e, value: t, defaultValue: r, onValueChange: i, currentUser: a, people: u, resolvedValue: f, defaultResolvedValue: p, onResolvedValueChange: m, expandedValue: h, defaultExpandedValue: _, onExpandedValueChange: ee, title: S, headingLevel: ie = 3, reactions: ae = Je, maxDepth: oe = Ye, now: se, locale: ce, timeZone: T = "UTC", getNewId: ue = tt, placeholder: de, composerLabel: fe, disabled: E = !1, readOnly: D = !1, size: O = "md", labels: pe, slotProps: k, className: me, sx: j, onFocus: ge, onBlur: ve, "aria-label": M, "aria-labelledby": I, "aria-describedby": Ce, ...we }) {
|
|
886
|
-
let L = ne(), R = b(null), Te = le([e, R]), { formatters: z, problems: Ee } = y(() => _e("CommentThread", ce, T), [ce, T]), B = {
|
|
887
|
-
...ct(z),
|
|
888
|
-
...pe
|
|
889
|
-
}, De = A(se) ? se : null, Oe = Number.isInteger(oe) && oe >= 0, ke = Oe ? oe : Ye, Ae = y(() => Se(ae, (e) => e), [ae]), je = b(null), [V = Ze, Me] = o(t, r ?? Ze, (e) => i?.([...e], je.current)), H = y(() => ye(V), [V]), U = (e, t) => {
|
|
890
|
-
e !== V && (je.current = t, Me(e));
|
|
891
|
-
}, [W = !1, Pe] = o(f, p ?? !1, m), Fe = b(null);
|
|
892
|
-
v(() => {
|
|
893
|
-
Fe.current = null;
|
|
894
|
-
}, [W]);
|
|
895
|
-
let [Ie] = x(() => _ ?? st(H)), [G = Qe, Le] = o(h, Ie, (e) => ee?.([...e])), Re = new Set(G), Be = nt(G), Ve = b(null);
|
|
896
|
-
v(() => {
|
|
897
|
-
Ve.current = null;
|
|
898
|
-
}, [Be]);
|
|
899
|
-
let He = (e) => {
|
|
900
|
-
let t = nt(e);
|
|
901
|
-
t !== Be && t !== Ve.current && (Ve.current = t, Le(e));
|
|
902
|
-
}, [Ue, K] = x($e), q = at(Ue, H);
|
|
903
|
-
q !== Ue && K(q);
|
|
904
|
-
let We = y(() => Se(u ?? [...H.order.map((e) => H.entries.get(e).comment.author), a], (e) => e.id), [
|
|
905
|
-
u,
|
|
906
|
-
H,
|
|
907
|
-
a
|
|
908
|
-
]), J = b(null), Y = b(null), Ge = b(H.order), et = b(null), lt = b(/* @__PURE__ */ new Set()), [At, Mt] = x({
|
|
909
|
-
text: "",
|
|
910
|
-
key: 0
|
|
911
|
-
}), Nt = y(() => {
|
|
912
|
-
let e = et.current;
|
|
913
|
-
return new Set(e ? H.order.filter((t) => !e.has(t)) : []);
|
|
914
|
-
}, [H]), Pt = (e) => R.current?.querySelector(`[data-ui="${X}-item"][data-comment-id="${CSS.escape(e)}"]`), Ft = (e, t) => Pt(e)?.querySelector(`:scope > article [data-action="${t}"]`), It = (e) => {
|
|
915
|
-
let t = Pt(e);
|
|
916
|
-
return [
|
|
917
|
-
":scope > article [data-action=\"reply\"]:not(:disabled)",
|
|
918
|
-
":scope > article [data-action]:not(:disabled)",
|
|
919
|
-
":scope > [data-part=\"toggle\"]"
|
|
920
|
-
].map((e) => t?.querySelector(e)).find(Boolean);
|
|
921
|
-
}, Lt = () => R.current?.querySelector(`[data-composer="${Z}"] textarea:not(:disabled)`), Rt = (e) => {
|
|
922
|
-
let t = Ge.current, n = e === null ? -1 : t.indexOf(e), r = e === null ? null : It(e);
|
|
923
|
-
if (r) r.focus();
|
|
924
|
-
else {
|
|
925
|
-
for (let e = 1; n !== -1 && e < t.length; e++) {
|
|
926
|
-
let r = [t[n + e], t[n - e]].filter((e) => e !== void 0).map(It).find(Boolean);
|
|
927
|
-
if (r) {
|
|
928
|
-
r.focus();
|
|
929
|
-
return;
|
|
930
|
-
}
|
|
931
|
-
}
|
|
932
|
-
Lt()?.focus();
|
|
933
|
-
}
|
|
934
|
-
};
|
|
935
|
-
v(() => {
|
|
936
|
-
let e = R.current;
|
|
937
|
-
if (!e) return;
|
|
938
|
-
let t = e.ownerDocument, n = t.activeElement, r = !n || n === t.body, i = J.current;
|
|
939
|
-
if (i && !i.invoker.isConnected) {
|
|
940
|
-
if (J.current = null, r) {
|
|
941
|
-
let e = i.target();
|
|
942
|
-
e ? e.focus() : Rt(i.commentId);
|
|
943
|
-
}
|
|
944
|
-
} else if (r && Y.current && !Y.current.element.isConnected) {
|
|
945
|
-
let { commentId: e } = Y.current;
|
|
946
|
-
Y.current = null, Rt(e);
|
|
947
|
-
}
|
|
948
|
-
let a = Y.current?.element;
|
|
949
|
-
if (a?.isConnected && (r || n === a)) {
|
|
950
|
-
let t = `[data-ui="${X}-replies"][hidden]`, n = null;
|
|
951
|
-
for (let e = a.closest(t); e; e = e.parentElement.closest(t)) n = e;
|
|
952
|
-
let r = n ? e.querySelector(`[aria-controls="${CSS.escape(n.id)}"]`) : null, i = a.closest(`[data-ui="${X}-content"][hidden]`) ? e.querySelector("[data-action=\"reopen\"]") : null;
|
|
953
|
-
(r ?? i)?.focus();
|
|
954
|
-
}
|
|
955
|
-
Ge.current = H.order;
|
|
956
|
-
}), v(() => {
|
|
957
|
-
let e = et.current;
|
|
958
|
-
if (et.current = new Set(H.order), !e) return;
|
|
959
|
-
let t = H.order.filter((t) => !e.has(t) && !lt.current.has(t));
|
|
960
|
-
t.length > 0 && Mt((e) => ({
|
|
961
|
-
text: B.newComments(t.length),
|
|
962
|
-
key: e.key + 1
|
|
963
|
-
}));
|
|
964
|
-
}, [H]);
|
|
965
|
-
let zt = [
|
|
966
|
-
...Ee,
|
|
967
|
-
...De === null ? [`CommentThread: now ${String(se)} is not a finite epoch-ms value; showing full dates.`] : [],
|
|
968
|
-
...Oe ? [] : [`CommentThread: maxDepth ${String(oe)} is not a nonnegative integer; using ${Ye}.`],
|
|
969
|
-
...H.duplicates.length > 0 ? [`CommentThread: duplicate comment ids ${JSON.stringify(H.duplicates)}; showing the first of each.`] : [],
|
|
970
|
-
...H.cyclic ? ["CommentThread: a comment appears among its own replies; the repeat is not shown."] : []
|
|
971
|
-
].join("\n");
|
|
972
|
-
te(() => {
|
|
973
|
-
process.env.NODE_ENV !== "production" && zt !== "" && console.error(zt);
|
|
974
|
-
}, [zt]);
|
|
975
|
-
let Bt = (e) => {
|
|
976
|
-
ge?.(e);
|
|
977
|
-
let t = e.target.closest(`[data-ui="${X}-item"]`);
|
|
978
|
-
Y.current = {
|
|
979
|
-
element: e.target,
|
|
980
|
-
commentId: t?.dataset.commentId ?? null
|
|
981
|
-
}, J.current && !J.current.invoker.contains(e.target) && (J.current = null);
|
|
982
|
-
}, Vt = (e) => {
|
|
983
|
-
ve?.(e);
|
|
984
|
-
let { target: t } = e;
|
|
985
|
-
queueMicrotask(() => {
|
|
986
|
-
t.isConnected && Y.current?.element === t && (Y.current = null, J.current = null);
|
|
987
|
-
});
|
|
988
|
-
}, Ht = (e, t) => K((n) => ({
|
|
989
|
-
...n,
|
|
990
|
-
drafts: {
|
|
991
|
-
...n.drafts,
|
|
992
|
-
[e]: t
|
|
993
|
-
},
|
|
994
|
-
pending: rt(n.pending, e)
|
|
995
|
-
})), Ut = (e, t, n, r) => {
|
|
996
|
-
if (E || D || q.pending[e] || t !== null && !ot(H, t)) return;
|
|
997
|
-
let i = be(H, t, ke);
|
|
998
|
-
if (i === void 0) return;
|
|
999
|
-
let o = {
|
|
1000
|
-
id: ue(),
|
|
1001
|
-
author: a,
|
|
1002
|
-
body: n,
|
|
1003
|
-
createdAt: De ?? Date.now(),
|
|
1004
|
-
reactions: []
|
|
1005
|
-
};
|
|
1006
|
-
lt.current.add(o.id), K((t) => ({
|
|
1007
|
-
...t,
|
|
1008
|
-
pending: {
|
|
1009
|
-
...t.pending,
|
|
1010
|
-
[e]: {
|
|
1011
|
-
kind: "add",
|
|
1012
|
-
id: o.id
|
|
1013
|
-
}
|
|
1014
|
-
}
|
|
1015
|
-
})), t !== null && (J.current = {
|
|
1016
|
-
invoker: r,
|
|
1017
|
-
target: () => Ft(t, "reply"),
|
|
1018
|
-
commentId: t
|
|
1019
|
-
}), U(N(V, i, o), {
|
|
1020
|
-
type: "reply",
|
|
1021
|
-
comment: o,
|
|
1022
|
-
parentId: i
|
|
1023
|
-
}), i !== null && !Re.has(i) && He([...G, i]);
|
|
1024
|
-
}, Wt = () => K((e) => e.pending[Z] ? {
|
|
1025
|
-
...e,
|
|
1026
|
-
pending: rt(e.pending, Z)
|
|
1027
|
-
} : it(e, Z)), Gt = (e) => K((t) => ({
|
|
1028
|
-
...t,
|
|
1029
|
-
replyTo: e,
|
|
1030
|
-
confirming: null,
|
|
1031
|
-
picker: null
|
|
1032
|
-
})), Kt = (e, t) => {
|
|
1033
|
-
J.current = {
|
|
1034
|
-
invoker: t,
|
|
1035
|
-
target: () => Ft(e, "reply"),
|
|
1036
|
-
commentId: e
|
|
1037
|
-
}, K((t) => it(t, Q(e)));
|
|
1038
|
-
}, qt = (e) => K((t) => ({
|
|
1039
|
-
...t,
|
|
1040
|
-
editing: e.id,
|
|
1041
|
-
confirming: null,
|
|
1042
|
-
picker: null,
|
|
1043
|
-
drafts: {
|
|
1044
|
-
...t.drafts,
|
|
1045
|
-
[$(e.id)]: e.body
|
|
1046
|
-
}
|
|
1047
|
-
})), Jt = (e, t) => {
|
|
1048
|
-
J.current = {
|
|
1049
|
-
invoker: t,
|
|
1050
|
-
target: () => Ft(e, "edit"),
|
|
1051
|
-
commentId: e
|
|
1052
|
-
}, K((t) => it(t, $(e)));
|
|
1053
|
-
}, Yt = (e, t, n) => {
|
|
1054
|
-
let r = $(e.id);
|
|
1055
|
-
E || D || q.pending[r] || !ot(H, e.id) || (t === e.body ? Jt(e.id, n) : (J.current = {
|
|
1056
|
-
invoker: n,
|
|
1057
|
-
target: () => Ft(e.id, "edit"),
|
|
1058
|
-
commentId: e.id
|
|
1059
|
-
}, K((n) => ({
|
|
1060
|
-
...n,
|
|
1061
|
-
pending: {
|
|
1062
|
-
...n.pending,
|
|
1063
|
-
[r]: {
|
|
1064
|
-
kind: "edit",
|
|
1065
|
-
id: e.id,
|
|
1066
|
-
body: t
|
|
1067
|
-
}
|
|
1068
|
-
}
|
|
1069
|
-
})), U(P(V, e.id, t), {
|
|
1070
|
-
type: "edit",
|
|
1071
|
-
id: e.id,
|
|
1072
|
-
body: t
|
|
1073
|
-
})));
|
|
1074
|
-
}, Xt = (e, t) => {
|
|
1075
|
-
J.current = {
|
|
1076
|
-
invoker: t,
|
|
1077
|
-
target: () => Ft(e, "delete"),
|
|
1078
|
-
commentId: e
|
|
1079
|
-
}, K((e) => ({
|
|
1080
|
-
...e,
|
|
1081
|
-
confirming: null
|
|
1082
|
-
}));
|
|
1083
|
-
}, Zt = (e, t) => {
|
|
1084
|
-
Xt(e, t), !(E || D) && U(F(V, e), {
|
|
1085
|
-
type: "delete",
|
|
1086
|
-
id: e
|
|
1087
|
-
});
|
|
1088
|
-
}, Qt = (e, t) => {
|
|
1089
|
-
if (E || D) return;
|
|
1090
|
-
let { comments: n, added: r } = xe(V, e, t, a.id);
|
|
1091
|
-
U(n, {
|
|
1092
|
-
type: "react",
|
|
1093
|
-
id: e,
|
|
1094
|
-
emoji: t,
|
|
1095
|
-
added: r
|
|
1096
|
-
});
|
|
1097
|
-
}, $t = (e, t) => {
|
|
1098
|
-
if (E || D || e === Fe.current) return;
|
|
1099
|
-
Fe.current = e;
|
|
1100
|
-
let n = e ? "reopen" : "resolve";
|
|
1101
|
-
J.current = {
|
|
1102
|
-
invoker: t.currentTarget,
|
|
1103
|
-
target: () => R.current?.querySelector(`[data-action="${n}"]`),
|
|
1104
|
-
commentId: null
|
|
1105
|
-
}, Pe(e);
|
|
1106
|
-
}, en = (e) => He(Re.has(e) ? G.filter((t) => t !== e) : [...G, e]), tn = H.order.filter((e) => ot(H, e)), nn = Se(tn.map((e) => H.entries.get(e).comment.author), (e) => e.id), rn = B.commentCount(tn.length), an = tn.length > 0 ? z.facts.format([rn, B.peopleCount(nn.length)]) : rn, on = H.order.length === 0, sn = `${L}-empty`, cn = `${L}-title`, ln = c(S) && S !== "", un = [I, ln ? cn : void 0].filter(Boolean).join(" ") || void 0, dn = [Ce, on ? sn : void 0].filter(Boolean).join(" ") || void 0, fn = {
|
|
1107
|
-
ui: X,
|
|
1108
|
-
mentionsLabel: B.mentions,
|
|
1109
|
-
people: We,
|
|
1110
|
-
locale: ce,
|
|
1111
|
-
disabled: E,
|
|
1112
|
-
size: O,
|
|
1113
|
-
textareaProps: k?.textarea,
|
|
1114
|
-
submitProps: k?.send
|
|
1115
|
-
}, pn = (e, t, n) => {
|
|
1116
|
-
if (n.has(e) || H.entries.get(e.id)?.comment !== e) return null;
|
|
1117
|
-
let { id: r } = e, i = e.deleted === !0, o = e.author.id === a.id, s = q.editing === r && !i, c = q.confirming === r && !i, u = e.replies ?? Ze, d = g(L, "replies", r), f = Re.has(r), p = new Set(n).add(e), m = g(L, "confirm", r), h = (e) => {
|
|
1118
|
-
e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), Xt(r, e.currentTarget));
|
|
1119
|
-
};
|
|
1120
|
-
return /* @__PURE__ */ w("li", {
|
|
1121
|
-
"data-ui": `${X}-item`,
|
|
1122
|
-
"data-comment-id": r,
|
|
1123
|
-
"data-depth": t,
|
|
1124
|
-
"data-deleted": i ? "" : void 0,
|
|
1125
|
-
"data-new": Nt.has(r) ? "" : void 0,
|
|
1126
|
-
className: k?.item?.className,
|
|
1127
|
-
css: [vt, k?.item?.css],
|
|
1128
|
-
children: [
|
|
1129
|
-
/* @__PURE__ */ w(Ne, {
|
|
1130
|
-
ui: X,
|
|
1131
|
-
author: e.author,
|
|
1132
|
-
label: i ? B.deletedComment : void 0,
|
|
1133
|
-
epoch: he(e.createdAt),
|
|
1134
|
-
now: De,
|
|
1135
|
-
formatters: z,
|
|
1136
|
-
invalidTimeLabel: B.invalidTime,
|
|
1137
|
-
meta: e.edited && !i ? B.edited : null,
|
|
1138
|
-
size: O,
|
|
1139
|
-
baseId: L,
|
|
1140
|
-
messageId: r,
|
|
1141
|
-
slots: {
|
|
1142
|
-
article: k?.article,
|
|
1143
|
-
time: k?.time
|
|
1144
|
-
},
|
|
1145
|
-
children: [
|
|
1146
|
-
s ? /* @__PURE__ */ C(qe, {
|
|
1147
|
-
...fn,
|
|
1148
|
-
kind: "edit",
|
|
1149
|
-
draft: q.drafts[$(r)] ?? e.body,
|
|
1150
|
-
onDraftChange: (e) => Ht($(r), e),
|
|
1151
|
-
onSubmit: (t, n) => Yt(e, t, n),
|
|
1152
|
-
onCancel: (e) => Jt(r, e),
|
|
1153
|
-
cancelable: !0,
|
|
1154
|
-
label: B.editComment,
|
|
1155
|
-
submitLabel: B.save,
|
|
1156
|
-
cancelLabel: B.cancel,
|
|
1157
|
-
pending: q.pending[$(r)] !== void 0,
|
|
1158
|
-
autoFocus: !0,
|
|
1159
|
-
part: k?.composer
|
|
1160
|
-
}) : /* @__PURE__ */ C("p", {
|
|
1161
|
-
"data-ui": `${X}-body`,
|
|
1162
|
-
"data-deleted": i ? "" : void 0,
|
|
1163
|
-
className: k?.body?.className,
|
|
1164
|
-
css: [yt, k?.body?.css],
|
|
1165
|
-
children: i ? B.deletedText : e.body
|
|
1166
|
-
}),
|
|
1167
|
-
i || s ? null : /* @__PURE__ */ C(ze, {
|
|
1168
|
-
ui: X,
|
|
1169
|
-
reactions: e.reactions ?? [],
|
|
1170
|
-
offered: Ae,
|
|
1171
|
-
currentUserId: a.id,
|
|
1172
|
-
formatters: z,
|
|
1173
|
-
labels: B,
|
|
1174
|
-
readOnly: D,
|
|
1175
|
-
disabled: E,
|
|
1176
|
-
pickerOpen: q.picker === r,
|
|
1177
|
-
onPickerOpenChange: (e) => K((t) => ({
|
|
1178
|
-
...t,
|
|
1179
|
-
picker: e ? r : null,
|
|
1180
|
-
confirming: null
|
|
1181
|
-
})),
|
|
1182
|
-
onToggle: (e) => Qt(r, e),
|
|
1183
|
-
pickerId: g(L, "picker", r),
|
|
1184
|
-
part: k?.reaction
|
|
1185
|
-
}),
|
|
1186
|
-
i || s || D ? null : c ? /* @__PURE__ */ w("div", {
|
|
1187
|
-
role: "group",
|
|
1188
|
-
"aria-labelledby": m,
|
|
1189
|
-
"data-ui": `${X}-confirm`,
|
|
1190
|
-
onKeyDown: h,
|
|
1191
|
-
css: xt,
|
|
1192
|
-
children: [
|
|
1193
|
-
/* @__PURE__ */ C("span", {
|
|
1194
|
-
id: m,
|
|
1195
|
-
css: St,
|
|
1196
|
-
children: B.deleteConfirm
|
|
1197
|
-
}),
|
|
1198
|
-
/* @__PURE__ */ C(l, {
|
|
1199
|
-
variant: "ghost",
|
|
1200
|
-
size: "sm",
|
|
1201
|
-
autoFocus: !0,
|
|
1202
|
-
onClick: (e) => Xt(r, e.currentTarget.parentElement),
|
|
1203
|
-
children: B.cancel
|
|
1204
|
-
}),
|
|
1205
|
-
/* @__PURE__ */ C(l, {
|
|
1206
|
-
variant: "solid",
|
|
1207
|
-
tone: "danger",
|
|
1208
|
-
size: "sm",
|
|
1209
|
-
disabled: E,
|
|
1210
|
-
onClick: (e) => Zt(r, e.currentTarget.parentElement),
|
|
1211
|
-
children: B.delete
|
|
1212
|
-
})
|
|
1213
|
-
]
|
|
1214
|
-
}, "confirm") : /* @__PURE__ */ w("div", {
|
|
1215
|
-
"data-ui": `${X}-actions`,
|
|
1216
|
-
className: k?.actions?.className,
|
|
1217
|
-
css: [bt, k?.actions?.css],
|
|
1218
|
-
children: [/* @__PURE__ */ C(l, {
|
|
1219
|
-
variant: "ghost",
|
|
1220
|
-
size: "sm",
|
|
1221
|
-
"data-action": "reply",
|
|
1222
|
-
"aria-expanded": q.replyTo === r,
|
|
1223
|
-
disabled: E,
|
|
1224
|
-
onClick: () => Gt(r),
|
|
1225
|
-
children: B.reply
|
|
1226
|
-
}), o ? /* @__PURE__ */ w(re, { children: [/* @__PURE__ */ C(l, {
|
|
1227
|
-
variant: "ghost",
|
|
1228
|
-
size: "sm",
|
|
1229
|
-
"data-action": "edit",
|
|
1230
|
-
disabled: E,
|
|
1231
|
-
onClick: () => qt(e),
|
|
1232
|
-
children: B.edit
|
|
1233
|
-
}), /* @__PURE__ */ C(l, {
|
|
1234
|
-
variant: "ghost",
|
|
1235
|
-
size: "sm",
|
|
1236
|
-
tone: "danger",
|
|
1237
|
-
"data-action": "delete",
|
|
1238
|
-
disabled: E,
|
|
1239
|
-
onClick: () => K((e) => ({
|
|
1240
|
-
...e,
|
|
1241
|
-
confirming: r,
|
|
1242
|
-
picker: null
|
|
1243
|
-
})),
|
|
1244
|
-
children: B.delete
|
|
1245
|
-
})] }) : null]
|
|
1246
|
-
}, "actions")
|
|
1247
|
-
]
|
|
1248
|
-
}),
|
|
1249
|
-
q.replyTo === r && !i && !D ? /* @__PURE__ */ C("div", {
|
|
1250
|
-
css: Ct,
|
|
1251
|
-
children: /* @__PURE__ */ C(qe, {
|
|
1252
|
-
...fn,
|
|
1253
|
-
kind: "reply",
|
|
1254
|
-
draft: q.drafts[Q(r)] ?? "",
|
|
1255
|
-
onDraftChange: (e) => Ht(Q(r), e),
|
|
1256
|
-
onSubmit: (e, t) => Ut(Q(r), r, e, t),
|
|
1257
|
-
onCancel: (e) => Kt(r, e),
|
|
1258
|
-
cancelable: !0,
|
|
1259
|
-
label: B.replyingTo(e.author.name),
|
|
1260
|
-
placeholder: de ?? B.placeholder,
|
|
1261
|
-
submitLabel: B.send,
|
|
1262
|
-
cancelLabel: B.cancelReply,
|
|
1263
|
-
pending: q.pending[Q(r)] !== void 0,
|
|
1264
|
-
autoFocus: !0,
|
|
1265
|
-
part: k?.composer
|
|
1266
|
-
})
|
|
1267
|
-
}) : null,
|
|
1268
|
-
u.length > 0 ? /* @__PURE__ */ w(re, { children: [/* @__PURE__ */ C(l, {
|
|
1269
|
-
variant: "ghost",
|
|
1270
|
-
size: "sm",
|
|
1271
|
-
"data-part": "toggle",
|
|
1272
|
-
"aria-expanded": f,
|
|
1273
|
-
"aria-controls": d,
|
|
1274
|
-
onClick: () => en(r),
|
|
1275
|
-
css: [wt, Ct],
|
|
1276
|
-
children: f ? B.hideReplies : B.showReplies(u.length)
|
|
1277
|
-
}), /* @__PURE__ */ C("ul", {
|
|
1278
|
-
role: "list",
|
|
1279
|
-
id: d,
|
|
1280
|
-
hidden: !f,
|
|
1281
|
-
"data-ui": `${X}-replies`,
|
|
1282
|
-
"data-capped": t + 1 > Xe ? "" : void 0,
|
|
1283
|
-
className: k?.replies?.className,
|
|
1284
|
-
css: [Tt, k?.replies?.css],
|
|
1285
|
-
children: u.map((e) => pn(e, t + 1, p))
|
|
1286
|
-
})] }) : null
|
|
1287
|
-
]
|
|
1288
|
-
}, r);
|
|
1289
|
-
};
|
|
1290
|
-
return /* @__PURE__ */ C(n, {
|
|
1291
|
-
className: me,
|
|
1292
|
-
styles: [
|
|
1293
|
-
ut,
|
|
1294
|
-
Ke[O],
|
|
1295
|
-
dt[O]
|
|
1296
|
-
],
|
|
1297
|
-
sx: j,
|
|
1298
|
-
children: (e) => /* @__PURE__ */ w("section", {
|
|
1299
|
-
...we,
|
|
1300
|
-
ref: Te,
|
|
1301
|
-
"aria-label": M ?? (un ? void 0 : B.thread),
|
|
1302
|
-
"aria-labelledby": un,
|
|
1303
|
-
"aria-describedby": dn,
|
|
1304
|
-
"data-ui": X,
|
|
1305
|
-
"data-size": O,
|
|
1306
|
-
"data-state": W ? "resolved" : "open",
|
|
1307
|
-
onFocus: Bt,
|
|
1308
|
-
onBlur: Vt,
|
|
1309
|
-
className: e,
|
|
1310
|
-
children: [/* @__PURE__ */ w(d, { children: [
|
|
1311
|
-
/* @__PURE__ */ w(d.Header, {
|
|
1312
|
-
className: k?.header?.className,
|
|
1313
|
-
css: [ft, k?.header?.css],
|
|
1314
|
-
children: [/* @__PURE__ */ w("div", {
|
|
1315
|
-
css: pt,
|
|
1316
|
-
children: [ln ? /* @__PURE__ */ C(d.Title, {
|
|
1317
|
-
id: cn,
|
|
1318
|
-
level: ie,
|
|
1319
|
-
className: k?.title?.className,
|
|
1320
|
-
css: [mt, k?.title?.css],
|
|
1321
|
-
children: S
|
|
1322
|
-
}) : null, /* @__PURE__ */ C("p", {
|
|
1323
|
-
"data-ui": `${X}-count`,
|
|
1324
|
-
css: ht,
|
|
1325
|
-
children: an
|
|
1326
|
-
})]
|
|
1327
|
-
}), !W && !D ? /* @__PURE__ */ C(l, {
|
|
1328
|
-
variant: "outline",
|
|
1329
|
-
size: "sm",
|
|
1330
|
-
"data-action": "resolve",
|
|
1331
|
-
disabled: E,
|
|
1332
|
-
startIcon: jt,
|
|
1333
|
-
onClick: (e) => $t(!0, e),
|
|
1334
|
-
children: B.resolve
|
|
1335
|
-
}) : null]
|
|
1336
|
-
}),
|
|
1337
|
-
/* @__PURE__ */ w(d.Content, { children: [/* @__PURE__ */ C("div", {
|
|
1338
|
-
"data-ui": `${X}-content`,
|
|
1339
|
-
hidden: W,
|
|
1340
|
-
css: gt,
|
|
1341
|
-
children: on ? /* @__PURE__ */ C("p", {
|
|
1342
|
-
id: sn,
|
|
1343
|
-
"data-ui": `${X}-empty`,
|
|
1344
|
-
css: Et,
|
|
1345
|
-
children: B.empty
|
|
1346
|
-
}) : /* @__PURE__ */ C("ul", {
|
|
1347
|
-
role: "list",
|
|
1348
|
-
"data-ui": `${X}-list`,
|
|
1349
|
-
className: k?.list?.className,
|
|
1350
|
-
css: [_t, k?.list?.css],
|
|
1351
|
-
children: V.map((e) => pn(e, 0, /* @__PURE__ */ new Set()))
|
|
1352
|
-
})
|
|
1353
|
-
}), W ? /* @__PURE__ */ w("div", {
|
|
1354
|
-
"data-ui": `${X}-resolved`,
|
|
1355
|
-
className: k?.resolved?.className,
|
|
1356
|
-
css: [Dt, k?.resolved?.css],
|
|
1357
|
-
children: [/* @__PURE__ */ w("p", {
|
|
1358
|
-
css: Ot,
|
|
1359
|
-
children: [
|
|
1360
|
-
/* @__PURE__ */ w("span", {
|
|
1361
|
-
css: kt,
|
|
1362
|
-
children: [jt, B.resolved]
|
|
1363
|
-
}),
|
|
1364
|
-
/* @__PURE__ */ C("span", { children: rn }),
|
|
1365
|
-
nn.length > 0 ? /* @__PURE__ */ C("span", { children: z.people.format(nn.map((e) => e.name)) }) : null
|
|
1366
|
-
]
|
|
1367
|
-
}), D ? null : /* @__PURE__ */ C(l, {
|
|
1368
|
-
variant: "outline",
|
|
1369
|
-
size: "sm",
|
|
1370
|
-
"data-action": "reopen",
|
|
1371
|
-
disabled: E,
|
|
1372
|
-
onClick: (e) => $t(!1, e),
|
|
1373
|
-
children: B.reopen
|
|
1374
|
-
})]
|
|
1375
|
-
}) : null] }),
|
|
1376
|
-
D ? null : /* @__PURE__ */ C(d.Footer, {
|
|
1377
|
-
hidden: W,
|
|
1378
|
-
css: gt,
|
|
1379
|
-
children: /* @__PURE__ */ C(qe, {
|
|
1380
|
-
...fn,
|
|
1381
|
-
kind: Z,
|
|
1382
|
-
draft: q.drafts[Z] ?? "",
|
|
1383
|
-
onDraftChange: (e) => Ht(Z, e),
|
|
1384
|
-
onSubmit: (e, t) => Ut(Z, null, e, t),
|
|
1385
|
-
onCancel: Wt,
|
|
1386
|
-
cancelOnEscape: !1,
|
|
1387
|
-
cancelable: (q.drafts[Z] ?? "") !== "" || q.pending[Z] !== void 0,
|
|
1388
|
-
label: fe ?? B.composer,
|
|
1389
|
-
placeholder: de ?? B.placeholder,
|
|
1390
|
-
submitLabel: B.send,
|
|
1391
|
-
cancelLabel: B.cancel,
|
|
1392
|
-
pending: q.pending[Z] !== void 0,
|
|
1393
|
-
author: a,
|
|
1394
|
-
part: k?.composer
|
|
1395
|
-
})
|
|
1396
|
-
})
|
|
1397
|
-
] }), /* @__PURE__ */ C("div", {
|
|
1398
|
-
role: "status",
|
|
1399
|
-
"aria-atomic": "true",
|
|
1400
|
-
"data-ui": `${X}-status`,
|
|
1401
|
-
className: k?.status?.className,
|
|
1402
|
-
css: [s, k?.status?.css],
|
|
1403
|
-
children: At.text ? /* @__PURE__ */ C("span", { children: At.text }, At.key) : null
|
|
1404
|
-
})]
|
|
1405
|
-
})
|
|
1406
|
-
});
|
|
1407
|
-
}
|
|
1408
|
-
Mt.displayName = "CommentThread";
|
|
1409
|
-
//#endregion
|
|
1410
|
-
export { Mt as t };
|