themelia-ui 2.0.0 → 2.0.1
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/.agents/skills/themelia-ui/references/components/INDEX.json +1 -2
- package/.agents/skills/themelia-ui/references/components/base--qr-code.md +2 -2
- package/.agents/skills/themelia-ui/references/components/base--typography.md +1 -1
- package/.agents/skills/themelia-ui/references/components/features--schema-form.md +1 -1
- package/.agents/skills/themelia-ui/references/components/features--theme-tweaker.md +3 -2
- package/.agents/skills/themelia-ui/references/components/theming.md +3 -2
- package/.agents/skills/themelia-ui/references/components/ui-provider.md +1 -0
- package/.agents/skills/themelia-ui/references/migration.md +16 -1
- package/.agents/skills/themelia-ui/references/theming.md +1 -1
- package/CHANGELOG.md +52 -0
- package/README.md +1 -1
- package/dist/{accordion-DLW9FGTP.js → accordion-B4zNzH7s.js} +3 -4
- package/dist/accordion-VazE3cHZ.cjs +1 -0
- package/dist/{action-menu-DqQX1_H8.js → action-menu-BrMchcyt.js} +4 -4
- package/dist/{action-menu-BFDQbOMx.cjs → action-menu-CO6DZ2xa.cjs} +1 -1
- package/dist/admin/patterns/access.cjs +1 -1
- package/dist/admin/patterns/access.js +9 -9
- package/dist/admin/patterns/commerce.cjs +1 -1
- package/dist/admin/patterns/commerce.js +20 -19
- package/dist/{alert-dialog-BPePUOHx.cjs → alert-dialog-ByJw3YGj.cjs} +1 -1
- package/dist/{alert-dialog-DzqaOiE5.js → alert-dialog-ZHkE0QEz.js} +1 -1
- package/dist/{avatar-2v-o_zEv.js → avatar-C30TNJoy.js} +1 -1
- package/dist/{avatar-Cdw0zuGn.cjs → avatar-b2IaEzda.cjs} +1 -1
- package/dist/base/accordion.cjs +1 -1
- package/dist/base/accordion.js +1 -1
- package/dist/base/action-menu.cjs +1 -1
- package/dist/base/action-menu.js +1 -1
- package/dist/base/alert-dialog.cjs +1 -1
- package/dist/base/alert-dialog.js +1 -1
- package/dist/base/avatar.cjs +1 -1
- package/dist/base/avatar.js +1 -1
- package/dist/base/batch-action-bar.cjs +1 -1
- package/dist/base/batch-action-bar.js +1 -1
- package/dist/base/buttons.cjs +1 -1
- package/dist/base/buttons.js +1 -1
- package/dist/base/cards.cjs +1 -1
- package/dist/base/cards.js +1 -1
- package/dist/base/carousel.cjs +1 -1
- package/dist/base/carousel.js +1 -1
- package/dist/base/choice-inputs.cjs +1 -1
- package/dist/base/choice-inputs.js +1 -1
- package/dist/base/combobox.cjs +1 -1
- package/dist/base/combobox.js +1 -1
- package/dist/base/command.cjs +1 -1
- package/dist/base/command.js +1 -1
- package/dist/base/context-menu.cjs +1 -1
- package/dist/base/context-menu.js +2 -2
- package/dist/base/copyable.cjs +1 -1
- package/dist/base/copyable.js +1 -1
- package/dist/base/date-pickers.cjs +1 -1
- package/dist/base/date-pickers.js +1 -1
- package/dist/base/dialog.cjs +1 -1
- package/dist/base/dialog.js +1 -1
- package/dist/base/display.cjs +1 -1
- package/dist/base/display.js +1 -1
- package/dist/base/dropdown-menu.cjs +1 -1
- package/dist/base/dropdown-menu.js +1 -1
- package/dist/base/feedback.cjs +1 -1
- package/dist/base/feedback.js +1 -1
- package/dist/base/forms-numeric.cjs +1 -1
- package/dist/base/forms-numeric.js +1 -1
- package/dist/base/forms.cjs +1 -1
- package/dist/base/forms.js +1 -1
- package/dist/base/hover-card.cjs +1 -1
- package/dist/base/hover-card.js +1 -1
- package/dist/base/input-group.cjs +1 -1
- package/dist/base/input-group.js +1 -1
- package/dist/base/item.cjs +1 -1
- package/dist/base/item.js +1 -1
- package/dist/base/label.cjs +1 -1
- package/dist/base/label.js +1 -1
- package/dist/base/navigation-menu.cjs +1 -1
- package/dist/base/navigation-menu.js +1 -1
- package/dist/base/navigation.cjs +1 -1
- package/dist/base/navigation.js +1 -1
- package/dist/base/otp-input.cjs +1 -1
- package/dist/base/otp-input.js +1 -1
- package/dist/base/overlay.cjs +1 -1
- package/dist/base/overlay.js +1 -1
- package/dist/base/popover-menu.cjs +1 -1
- package/dist/base/popover-menu.js +1 -1
- package/dist/base/popover.cjs +1 -1
- package/dist/base/popover.js +1 -1
- package/dist/base/qr-code.cjs +1 -1
- package/dist/base/qr-code.js +47 -43
- package/dist/base/repeaters.cjs +1 -1
- package/dist/base/repeaters.js +1 -1
- package/dist/base/sheet.cjs +1 -1
- package/dist/base/sheet.js +1 -1
- package/dist/base/sidebar.cjs +1 -1
- package/dist/base/sidebar.js +1 -1
- package/dist/base/skeleton.cjs +1 -1
- package/dist/base/skeleton.js +1 -1
- package/dist/base/table.cjs +1 -1
- package/dist/base/table.js +1 -1
- package/dist/base/timeline.cjs +1 -1
- package/dist/base/timeline.js +1 -1
- package/dist/base/toaster.cjs +1 -1
- package/dist/base/toaster.js +1 -1
- package/dist/base/toolbar.cjs +1 -1
- package/dist/base/toolbar.js +1 -1
- package/dist/base/tooltip.cjs +1 -1
- package/dist/base/tooltip.js +1 -1
- package/dist/base/typography.cjs +1 -1
- package/dist/base/typography.js +1 -1
- package/dist/base/upload.cjs +1 -1
- package/dist/base/upload.js +1 -1
- package/dist/base/value-inputs.cjs +1 -1
- package/dist/base/value-inputs.js +1 -1
- package/dist/{batch-action-bar-Cvnz248b.cjs → batch-action-bar-BMIiHBU8.cjs} +1 -1
- package/dist/{batch-action-bar-BRCopWlT.js → batch-action-bar-CAIjntVw.js} +2 -2
- package/dist/{buttons-CMsvnL6-.cjs → buttons-Dwl42fIr.cjs} +1 -1
- package/dist/{buttons-Corm-KHK.js → buttons-riLAPVQV.js} +4 -3
- package/dist/{cards-CEtNjl6A.js → cards-CcwLsQQS.js} +8 -9
- package/dist/cards-DQPevRTY.cjs +1 -0
- package/dist/{choice-inputs-Ca9PoQwa.js → choice-inputs-BjZYCdzk.js} +7 -7
- package/dist/{choice-inputs-CySnLjfA.cjs → choice-inputs-C8LMAkh8.cjs} +1 -1
- package/dist/combobox-bDQg27j0.cjs +1 -0
- package/dist/{combobox-Dl1xWnR7.js → combobox-exdUS4qj.js} +8 -9
- package/dist/{command-DWZf3CPI.js → command-Dv84KSRv.js} +3 -3
- package/dist/{command-BSvB58XI.cjs → command-Geb5eIzu.cjs} +1 -1
- package/dist/{comments-CVD4jB9V.cjs → comments-CV9tvSAi.cjs} +1 -1
- package/dist/{comments-CIZ1L-DR.js → comments-CqdhAH1O.js} +485 -491
- package/dist/components/base/buttons/button.d.cts +1 -1
- package/dist/components/base/buttons/button.d.ts +1 -1
- package/dist/components/base/qr-code/qr-code.d.cts +2 -2
- package/dist/components/base/qr-code/qr-code.d.ts +2 -2
- package/dist/components/base/typography/rich-text/rich-text.d.cts +1 -0
- package/dist/components/base/typography/rich-text/rich-text.d.ts +1 -0
- package/dist/{copyable-Bbd_Tsxc.cjs → copyable-CMhsv_91.cjs} +1 -1
- package/dist/{copyable-CRdTLtmK.js → copyable-uzkCHMzl.js} +3 -3
- package/dist/core.css +1 -1
- package/dist/css/access.css +1 -1
- package/dist/css/accordion.css +1 -1
- package/dist/css/action-menu.css +1 -1
- package/dist/css/activities.css +1 -1
- package/dist/css/ai-chat.css +1 -1
- package/dist/css/analytics.css +1 -1
- package/dist/css/app-shell.css +1 -1
- package/dist/css/async-preview.css +1 -1
- package/dist/css/auth.css +1 -1
- package/dist/css/avatar.css +1 -1
- package/dist/css/badge.css +1 -1
- package/dist/css/batch-action-bar.css +1 -1
- package/dist/css/buttons.css +1 -1
- package/dist/css/cards.css +1 -1
- package/dist/css/carousel.css +1 -1
- package/dist/css/chart.css +1 -1
- package/dist/css/choice-inputs.css +1 -1
- package/dist/css/combobox.css +1 -1
- package/dist/css/combobox2.css +1 -1
- package/dist/css/command.css +1 -1
- package/dist/css/comments.css +1 -1
- package/dist/css/commerce.css +1 -1
- package/dist/css/copyable.css +1 -1
- package/dist/css/data-view.css +1 -1
- package/dist/css/date-pickers.css +1 -1
- package/dist/css/display.css +1 -1
- package/dist/css/dropdown-menu.css +1 -1
- package/dist/css/event-calendar.css +1 -1
- package/dist/css/feedback.css +1 -1
- package/dist/css/filters.css +1 -1
- package/dist/css/forms.css +1 -1
- package/dist/css/global-search.css +1 -1
- package/dist/css/header.css +1 -1
- package/dist/css/hover-card.css +1 -1
- package/dist/css/input-group.css +1 -1
- package/dist/css/item.css +1 -1
- package/dist/css/kanban.css +1 -1
- package/dist/css/label.css +1 -1
- package/dist/css/map.css +1 -1
- package/dist/css/media-library.css +1 -1
- package/dist/css/mentions.css +1 -1
- package/dist/css/navigation-menu.css +1 -1
- package/dist/css/navigation.css +1 -1
- package/dist/css/navigation2.css +1 -1
- package/dist/css/overlay.css +1 -1
- package/dist/css/popover-menu.css +1 -1
- package/dist/css/popover.css +1 -1
- package/dist/css/products.css +1 -1
- package/dist/css/qr-code.css +1 -1
- package/dist/css/repeaters.css +1 -1
- package/dist/css/resource-assignment.css +1 -1
- package/dist/css/resource.css +1 -1
- package/dist/css/rich-text-editor.css +1 -1
- package/dist/css/schema-form.css +1 -1
- package/dist/css/sidebar2.css +1 -1
- package/dist/css/skeleton.css +1 -1
- package/dist/css/styles.css +1 -1
- package/dist/css/sync.css +1 -1
- package/dist/css/table.css +1 -1
- package/dist/css/table2.css +1 -1
- package/dist/css/text-inputs.css +1 -1
- package/dist/css/theme-tweaker.css +1 -1
- package/dist/css/timeline.css +1 -1
- package/dist/css/toaster.css +1 -1
- package/dist/css/toggle.css +1 -1
- package/dist/css/toolbar.css +1 -1
- package/dist/css/tooltip.css +1 -1
- package/dist/css/typography.css +1 -1
- package/dist/css/upload.css +1 -1
- package/dist/css/value-inputs.css +1 -1
- package/dist/css/workspace.css +1 -1
- package/dist/{date-pickers-Dy9BVNnb.js → date-pickers-1_Ah7qWO.js} +5 -5
- package/dist/{date-pickers-C6rE7fLo.cjs → date-pickers-DejXe5oe.cjs} +1 -1
- package/dist/{dialog-CLwUz8Gb.js → dialog-CXugTX8t.js} +1 -1
- package/dist/{dialog-Bf7tBRkZ.cjs → dialog-DZ9_m_qc.cjs} +1 -1
- package/dist/display-CFj87iEn.cjs +1 -0
- package/dist/{display-DVhYS75K.js → display-Dehpw83R.js} +6 -5
- package/dist/{dropdown-menu-CIXxWTpw.js → dropdown-menu-BdgB__AC.js} +1 -1
- package/dist/{dropdown-menu-0OW7zJto.cjs → dropdown-menu-DCf_EqVG.cjs} +1 -1
- package/dist/features/actions.cjs +1 -1
- package/dist/features/actions.js +1 -1
- package/dist/features/activities.cjs +1 -1
- package/dist/features/activities.js +361 -363
- package/dist/features/ai-chat.cjs +2 -2
- package/dist/features/ai-chat.js +11 -10
- package/dist/features/async-preview.cjs +1 -1
- package/dist/features/async-preview.js +4 -4
- package/dist/features/combobox.cjs +1 -1
- package/dist/features/combobox.js +5 -5
- package/dist/features/comments.cjs +1 -1
- package/dist/features/comments.js +1 -1
- package/dist/features/data-view.cjs +1 -1
- package/dist/features/data-view.js +6 -6
- package/dist/features/event-calendar.cjs +1 -1
- package/dist/features/event-calendar.js +10 -10
- package/dist/features/filters.cjs +1 -1
- package/dist/features/filters.js +1 -1
- package/dist/features/global-search.cjs +1 -1
- package/dist/features/global-search.js +8 -8
- package/dist/features/kanban.cjs +1 -1
- package/dist/features/kanban.js +4 -5
- package/dist/features/map.cjs +1 -1
- package/dist/features/map.js +318 -317
- package/dist/features/media-library.cjs +1 -1
- package/dist/features/media-library.js +751 -771
- package/dist/features/mentions.cjs +1 -1
- package/dist/features/mentions.js +1 -1
- package/dist/features/overlays.cjs +1 -1
- package/dist/features/overlays.js +1 -1
- package/dist/features/products.cjs +1 -1
- package/dist/features/products.js +15 -15
- package/dist/features/resource-assignment.cjs +1 -1
- package/dist/features/resource-assignment.js +6 -6
- package/dist/features/resource.cjs +1 -1
- package/dist/features/resource.js +6 -6
- package/dist/features/rich-text-editor.cjs +1 -1
- package/dist/features/rich-text-editor.js +1 -1
- package/dist/features/schema-form.cjs +1 -1
- package/dist/features/schema-form.css +1 -1
- package/dist/features/schema-form.js +207 -223
- package/dist/features/sync.cjs +1 -1
- package/dist/features/sync.js +3 -3
- package/dist/features/table.cjs +1 -1
- package/dist/features/table.js +1 -1
- package/dist/features/theme-tweaker.cjs +2 -2
- package/dist/features/theme-tweaker.js +105 -124
- package/dist/{feedback-BmquisO3.js → feedback-C8QtkdHc.js} +3 -3
- package/dist/feedback-IpUFKqgv.cjs +1 -0
- package/dist/{filters-BD0zRwCE.js → filters-BMKZHnBA.js} +22 -17
- package/dist/filters-Ct07D74Q.cjs +1 -0
- package/dist/{forms-zF9SP3Ai.js → forms-C-d0-GML.js} +5 -7
- package/dist/forms-mJ0fjWEl.cjs +1 -0
- package/dist/{forms-numeric-B1cqc9Vn.cjs → forms-numeric-B7TRpwvH.cjs} +1 -1
- package/dist/{forms-numeric-DzxBaEg1.js → forms-numeric-MKOgf5BF.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +2 -2
- package/dist/{input-group-Bnc24cRI.cjs → input-group-HplgNyti.cjs} +1 -1
- package/dist/{input-group-CTSiVEGd.js → input-group-xFaO6qrB.js} +2 -2
- package/dist/{item-Cye3hJmr.cjs → item-BxPJsxh2.cjs} +1 -1
- package/dist/{item-OVu-oGxQ.js → item-C7Wfarcx.js} +2 -2
- package/dist/{label-Cr4NpRvn.cjs → label-B8WTGCTZ.cjs} +1 -1
- package/dist/{label-DYJT1uER.js → label-DumoMDm6.js} +1 -1
- package/dist/layout/app-shell.cjs +1 -1
- package/dist/layout/app-shell.js +1 -1
- package/dist/layout/auth.cjs +1 -1
- package/dist/layout/auth.js +4 -2
- package/dist/layout/header.cjs +1 -1
- package/dist/layout/header.js +10 -10
- package/dist/layout/navigation.cjs +1 -1
- package/dist/layout/navigation.js +1 -1
- package/dist/layout/page.cjs +1 -1
- package/dist/layout/page.js +4 -4
- package/dist/layout/settings.cjs +1 -1
- package/dist/layout/settings.js +2 -2
- package/dist/layout/sidebar.cjs +1 -1
- package/dist/layout/sidebar.js +7 -7
- package/dist/layout/workspace.cjs +1 -1
- package/dist/layout/workspace.js +6 -7
- package/dist/lib/theming/recipes.d.cts +5 -2
- package/dist/lib/theming/recipes.d.ts +5 -2
- package/dist/lib/ui-provider/types.d.cts +4 -1
- package/dist/lib/ui-provider/types.d.ts +4 -1
- package/dist/{mentions-DbQAE-Ug.cjs → mentions-Ckm9Ct-r.cjs} +1 -1
- package/dist/{mentions-BU1sDupC.js → mentions-D_b-yVXN.js} +5 -5
- package/dist/{navigation-D00jGH59.js → navigation-COnv0B1H.js} +6 -5
- package/dist/navigation-D_hEWZYv.cjs +1 -0
- package/dist/{navigation-BRv9Xerv.js → navigation-DwNUlszz.js} +17 -15
- package/dist/navigation-UfUJU2LC.cjs +1 -0
- package/dist/{overlay-Bdri8Z7E.js → overlay-A5bE-8n5.js} +2 -2
- package/dist/{overlay-D1wEvshK.cjs → overlay-BtQz_AN3.cjs} +1 -1
- package/dist/{overlays-CaBkEKRc.js → overlays-DX9ux-XL.js} +7 -7
- package/dist/{overlays-BnWOasE6.cjs → overlays-MmLNLV9f.cjs} +1 -1
- package/dist/patterns/analytics.cjs +1 -1
- package/dist/patterns/analytics.js +41 -44
- package/dist/patterns/onboarding.cjs +1 -1
- package/dist/patterns/onboarding.js +4 -4
- package/dist/patterns/timelines.cjs +1 -1
- package/dist/patterns/timelines.js +1 -1
- package/dist/{popover-Dt8IXXKy.js → popover-CM1nxkAM.js} +2 -2
- package/dist/{popover-menu-BeNyDDo1.js → popover-menu-BCs5CLkw.js} +4 -4
- package/dist/{popover-menu-Cm10om_m.cjs → popover-menu-DcDdf9H2.cjs} +1 -1
- package/dist/{popover-BUebuMJK.cjs → popover-rLMSEj5V.cjs} +1 -1
- package/dist/{primitives-B2aeaudR.js → primitives-BnXNg-Kr.js} +2 -2
- package/dist/{primitives-BP7kGVYZ.cjs → primitives-kywiHMJE.cjs} +1 -1
- package/dist/primitives.cjs +1 -1
- package/dist/primitives.js +1 -1
- package/dist/{repeaters-BIvKI1CQ.cjs → repeaters-B4dnWxUE.cjs} +1 -1
- package/dist/{repeaters-C43GWEE_.js → repeaters-B4oohPvd.js} +4 -4
- package/dist/{rich-text-editor-CqqHeJDp.cjs → rich-text-editor-7GYD-4Qq.cjs} +1 -1
- package/dist/{rich-text-editor-CVo4FB26.js → rich-text-editor-CgsfAGMo.js} +3 -3
- package/dist/{sheet-BP2BmI-Z.js → sheet-3sbsGFus.js} +2 -2
- package/dist/{sheet-FA8TfP1E.cjs → sheet-B4_LNS7m.cjs} +1 -1
- package/dist/{sidebar-C-TSBDj5.cjs → sidebar--uZUOGHE.cjs} +1 -1
- package/dist/{sidebar-DOmsOhCp.js → sidebar-BMgoyRxy.js} +10 -9
- package/dist/{skeleton-vN_fsg7X.js → skeleton-Bxqw8kwa.js} +1 -1
- package/dist/{skeleton-3RdcmQ7K.cjs → skeleton-DeuQS4AK.cjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/styles/SCOPES.md +28 -9
- package/dist/styles/TOKENS.md +165 -9
- package/dist/styles/index.css +0 -1
- package/dist/styles/map.css +14 -8
- package/dist/styles/mentions.css +37 -44
- package/dist/styles/tailwind.css +2 -1
- package/dist/styles/themes/default.css +16 -14
- package/dist/styles/theming/colors.css +28 -22
- package/dist/styles/theming/feedback.css +0 -1
- package/dist/styles/theming/focus.css +15 -8
- package/dist/styles/theming/motion.css +8 -5
- package/dist/styles/theming/overlay.css +7 -0
- package/dist/styles/theming/sizing.css +8 -4
- package/dist/styles/theming/text.css +3 -1
- package/dist/styles/theming/typography.css +3 -0
- package/dist/styles/tokens/components.css +1 -1
- package/dist/styles/tokens/states.css +4 -4
- package/dist/{table-B9zwmrtt.cjs → table-3abrkeib.cjs} +1 -1
- package/dist/{table-CzsDKBR2.js → table-BXL7IP5P.js} +1 -1
- package/dist/{table-CaFQyjTz.cjs → table-CXRnlkV5.cjs} +1 -1
- package/dist/{table-CtUahid0.js → table-DszexXEh.js} +14 -14
- package/dist/tailwind.css +2 -1
- package/dist/{theming-B52zPV1p.cjs → theming-8U04chn7.cjs} +1 -1
- package/dist/{theming-y5FKH_La.js → theming-D6KRU7hO.js} +9 -9
- package/dist/theming.cjs +1 -1
- package/dist/theming.js +1 -1
- package/dist/{timeline-B3f7rEXh.cjs → timeline-CzAIDLzd.cjs} +1 -1
- package/dist/{timeline-DskNs3lw.js → timeline-ptWoY2GY.js} +2 -2
- package/dist/{timelines-wlcL01Rf.js → timelines-BquC31uF.js} +4 -4
- package/dist/{timelines-DJdBmWPj.cjs → timelines-DLsQhK72.cjs} +1 -1
- package/dist/{toaster-D3Fsaf3I.cjs → toaster-BVTOrAb5.cjs} +1 -1
- package/dist/{toaster-CaTwpule.js → toaster-DOBJDiXt.js} +1 -1
- package/dist/tokens.json +8 -7
- package/dist/{toolbar-CvUhAFhi.js → toolbar-3GLSD7Fi.js} +1 -1
- package/dist/{toolbar-Bap7y244.cjs → toolbar-aZKjtFDt.cjs} +1 -1
- package/dist/{tooltip-Dewu4Ynm.cjs → tooltip-CEcUVmor.cjs} +1 -1
- package/dist/{tooltip-B82dN7Oy.js → tooltip-DksScngC.js} +1 -1
- package/dist/{typography-B8Iurhy1.js → typography-BkxEiwQ1.js} +1 -1
- package/dist/{typography-LMez-POJ.cjs → typography-Cf5zEv4y.cjs} +1 -1
- package/dist/ui-provider-DI1VxMDT.cjs +1 -0
- package/dist/{ui-provider-BzyJxcKH.js → ui-provider-gNDv-ZRY.js} +4 -1
- package/dist/ui-provider.cjs +1 -1
- package/dist/ui-provider.js +1 -1
- package/dist/{upload-5tzkI0NC.cjs → upload-Bg8tyH5a.cjs} +1 -1
- package/dist/{upload-BL8HIPbS.js → upload-wTBh4QQx.js} +4 -4
- package/dist/{value-inputs-DzErolfh.cjs → value-inputs-B6ZURTUl.cjs} +1 -1
- package/dist/{value-inputs-DQGHd7k8.js → value-inputs-DnQKmVqW.js} +4 -4
- package/docs/generated/component-index.json +1 -2
- package/docs/generated/components/base--qr-code.md +2 -2
- package/docs/generated/components/base--typography.md +1 -1
- package/docs/generated/components/features--schema-form.md +1 -1
- package/docs/generated/components/features--theme-tweaker.md +3 -2
- package/docs/generated/components/theming.md +3 -2
- package/docs/generated/components/ui-provider.md +1 -0
- package/docs/generated/migration-codemod.json +28 -3
- package/docs/generated/migration.md +72 -3
- package/docs/generated/profiles.md +1 -1
- package/docs/learn/migration.md +16 -1
- package/docs/learn/theming.md +1 -1
- package/package.json +1 -1
- package/src/styles/SCOPES.md +28 -9
- package/src/styles/TOKENS.md +165 -9
- package/dist/accordion-BH9vNfdb.cjs +0 -1
- package/dist/cards-CO5LHALb.cjs +0 -1
- package/dist/combobox-CTUFSblt.cjs +0 -1
- package/dist/display-BUiiuPS9.cjs +0 -1
- package/dist/feedback-Da53xAUT.cjs +0 -1
- package/dist/filters-B8dkhzan.cjs +0 -1
- package/dist/forms-BEQN1X5A.cjs +0 -1
- package/dist/navigation-BaIANCwE.cjs +0 -1
- package/dist/navigation-BmZabEfZ.cjs +0 -1
- package/dist/styles/theming/mentions.css +0 -33
- package/dist/ui-provider-B3v22pQY.cjs +0 -1
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import "./css/comments.css";
|
|
2
2
|
import { t as e } from "./cx--CBrhWH0.js";
|
|
3
|
-
import { a as t, o as n, r, t as i } from "./typography-
|
|
4
|
-
import { p as a } from "./feedback-
|
|
5
|
-
import { t as o } from "./ui-provider-
|
|
6
|
-
import { c as s } from "./buttons-
|
|
7
|
-
import { i as c, n as l, t as u } from "./tooltip-
|
|
8
|
-
import { i as d, n as f } from "./action-menu-
|
|
9
|
-
import { d as p } from "./display-
|
|
10
|
-
import { o as
|
|
11
|
-
import { H as
|
|
12
|
-
import { t as
|
|
13
|
-
import { a as
|
|
14
|
-
import { c as
|
|
15
|
-
import { t as
|
|
16
|
-
import { i as
|
|
17
|
-
import { f as A, i as j, o as
|
|
18
|
-
import { n as
|
|
19
|
-
import { AtSignIcon as
|
|
20
|
-
import { Fragment as
|
|
21
|
-
import { Fragment as
|
|
22
|
-
import { format as
|
|
3
|
+
import { a as t, o as n, r, t as i } from "./typography-BkxEiwQ1.js";
|
|
4
|
+
import { p as a } from "./feedback-C8QtkdHc.js";
|
|
5
|
+
import { t as o } from "./ui-provider-gNDv-ZRY.js";
|
|
6
|
+
import { c as s } from "./buttons-riLAPVQV.js";
|
|
7
|
+
import { i as c, n as l, t as u } from "./tooltip-DksScngC.js";
|
|
8
|
+
import { i as d, n as f } from "./action-menu-BrMchcyt.js";
|
|
9
|
+
import { d as p, l as m } from "./display-Dehpw83R.js";
|
|
10
|
+
import { o as h } from "./structure-D0WGQAP3.js";
|
|
11
|
+
import { H as g, I as _, S as v, T as y, h as b, s as x, v as S, w as C } from "./primitives-BnXNg-Kr.js";
|
|
12
|
+
import { t as w } from "./badge-D34FkKLD.js";
|
|
13
|
+
import { a as ee, c as T, r as E } from "./avatar-C30TNJoy.js";
|
|
14
|
+
import { c as D, r as O, t as k } from "./popover-CM1nxkAM.js";
|
|
15
|
+
import { t as te } from "./spinner-Bv-2R-7S.js";
|
|
16
|
+
import { i as ne, t as re } from "./overlays-DX9ux-XL.js";
|
|
17
|
+
import { f as A, i as j, o as ie, s as M, t as ae } from "./mentions-D_b-yVXN.js";
|
|
18
|
+
import { n as oe } from "./rich-text-editor-CgsfAGMo.js";
|
|
19
|
+
import { AtSignIcon as se, FileIcon as N, FileTextIcon as P, ImageIcon as F, MessageCircleIcon as I, MoreHorizontalIcon as L, PaperclipIcon as ce, PencilIcon as le, PinIcon as ue, SendIcon as de, SmilePlusIcon as R, Trash2Icon as fe, XIcon as pe } from "lucide-react";
|
|
20
|
+
import { Fragment as me, cloneElement as he, createContext as z, useCallback as B, useContext as ge, useEffect as V, useId as _e, useImperativeHandle as ve, useLayoutEffect as ye, useMemo as H, useRef as U, useState as W } from "react";
|
|
21
|
+
import { Fragment as be, jsx as G, jsxs as K } from "react/jsx-runtime";
|
|
22
|
+
import { format as xe } from "date-fns";
|
|
23
23
|
//#region src/components/features/comments/comments.strings.ts
|
|
24
|
-
function
|
|
24
|
+
function Se(e) {
|
|
25
25
|
if (e < 1024) return `${e} B`;
|
|
26
26
|
let t = [
|
|
27
27
|
"KB",
|
|
@@ -31,7 +31,7 @@ function ve(e) {
|
|
|
31
31
|
for (; n >= 1024 && r < t.length - 1;) n /= 1024, r += 1;
|
|
32
32
|
return `${n >= 10 ? Math.round(n) : n.toFixed(1)} ${t[r]}`;
|
|
33
33
|
}
|
|
34
|
-
var
|
|
34
|
+
var q = {
|
|
35
35
|
formatQuoteAttribution: (e) => `\u2014 ${e}`,
|
|
36
36
|
title: "Comments",
|
|
37
37
|
subtitle: "",
|
|
@@ -78,11 +78,11 @@ var ye = {
|
|
|
78
78
|
attachmentDownloadLabel: "Download",
|
|
79
79
|
formatShowMoreAttachments: (e) => `Show ${e} more`,
|
|
80
80
|
showFewerAttachmentsLabel: "Show fewer",
|
|
81
|
-
formatTooLarge: (e) => `Files must be under ${
|
|
81
|
+
formatTooLarge: (e) => `Files must be under ${Se(e)}.`,
|
|
82
82
|
formatTooMany: (e) => `You can attach at most ${e}.`,
|
|
83
83
|
addReactionLabel: "Add reaction",
|
|
84
84
|
reactionPickerLabel: "Choose a reaction"
|
|
85
|
-
},
|
|
85
|
+
}, J = {
|
|
86
86
|
root: "comments__root___nS80E",
|
|
87
87
|
header: "comments__header___yeqdu",
|
|
88
88
|
body: "comments__body___KBLx1",
|
|
@@ -122,8 +122,8 @@ var ye = {
|
|
|
122
122
|
composerEditor: "comments__composerEditor___pLdab",
|
|
123
123
|
eyebrow: "comments__eyebrow___4YXC8",
|
|
124
124
|
chip: "comments__chip___Y_2YZ",
|
|
125
|
-
chipIcon: "comments__chipIcon___6BLpd",
|
|
126
125
|
chipLink: "comments__chipLink___XVe41",
|
|
126
|
+
chipIcon: "comments__chipIcon___6BLpd",
|
|
127
127
|
chipLabel: "comments__chipLabel___jKkyE",
|
|
128
128
|
chipMeta: "comments__chipMeta___vASR1",
|
|
129
129
|
chipProgress: "comments__chipProgress___c7f2Z",
|
|
@@ -137,85 +137,85 @@ var ye = {
|
|
|
137
137
|
richQuote: "comments__richQuote___1JvHv",
|
|
138
138
|
richCite: "comments__richCite___z_LI2",
|
|
139
139
|
richDelimiter: "comments__richDelimiter___QOyH7"
|
|
140
|
-
},
|
|
140
|
+
}, Y = {
|
|
141
141
|
image: F,
|
|
142
142
|
document: P,
|
|
143
|
-
file:
|
|
144
|
-
unknown:
|
|
143
|
+
file: N,
|
|
144
|
+
unknown: ce
|
|
145
145
|
};
|
|
146
|
-
function
|
|
146
|
+
function Ce(e) {
|
|
147
147
|
return e ? e.startsWith("image/") ? "image" : e === "application/pdf" || e.startsWith("text/") ? "document" : "file" : "unknown";
|
|
148
148
|
}
|
|
149
|
-
function
|
|
150
|
-
let n =
|
|
151
|
-
return /* @__PURE__ */
|
|
149
|
+
function we({ mimeType: e, className: t }) {
|
|
150
|
+
let n = Y[Ce(e)];
|
|
151
|
+
return /* @__PURE__ */ G(n, { className: t });
|
|
152
152
|
}
|
|
153
|
-
function
|
|
153
|
+
function Te({ attachment: t, editable: r = !1, onRemove: i, onRetry: a, accessors: o, strings: c, className: l }) {
|
|
154
154
|
let u = {
|
|
155
|
-
...
|
|
155
|
+
...q,
|
|
156
156
|
...c
|
|
157
|
-
}, d = o?.getMediaUrl?.(t) ?? t.url, f = o?.getMediaName?.(t) ?? t.name ?? u.attachmentFallback, p = t.status === "uploading", m = t.status === "failed",
|
|
157
|
+
}, d = o?.getMediaUrl?.(t) ?? t.url, f = o?.getMediaName?.(t) ?? t.name ?? u.attachmentFallback, p = t.status === "uploading", m = t.status === "failed", h = p ? /* @__PURE__ */ K(g, {
|
|
158
158
|
size: "xs",
|
|
159
|
-
className:
|
|
160
|
-
children: [u.attachmentUploadingLabel, typeof t.progress == "number" && /* @__PURE__ */
|
|
159
|
+
className: J.chipMeta,
|
|
160
|
+
children: [u.attachmentUploadingLabel, typeof t.progress == "number" && /* @__PURE__ */ K(be, { children: [" ", /* @__PURE__ */ G(y, {
|
|
161
161
|
value: Math.round(t.progress),
|
|
162
162
|
scaled: !0,
|
|
163
163
|
size: "xs",
|
|
164
164
|
type: "secondary"
|
|
165
165
|
})] })]
|
|
166
|
-
}) : m ? /* @__PURE__ */
|
|
166
|
+
}) : m ? /* @__PURE__ */ G(g, {
|
|
167
167
|
size: "xs",
|
|
168
|
-
className:
|
|
168
|
+
className: J.chipMeta,
|
|
169
169
|
children: t.error ?? u.attachmentFailedLabel
|
|
170
|
-
}) : typeof t.size == "number" ? /* @__PURE__ */
|
|
170
|
+
}) : typeof t.size == "number" ? /* @__PURE__ */ G(v, {
|
|
171
171
|
value: t.size,
|
|
172
172
|
size: "xs",
|
|
173
173
|
type: "secondary",
|
|
174
|
-
className:
|
|
175
|
-
}) : null,
|
|
176
|
-
className:
|
|
177
|
-
children: [/* @__PURE__ */
|
|
174
|
+
className: J.chipMeta
|
|
175
|
+
}) : null, _ = /* @__PURE__ */ K("span", {
|
|
176
|
+
className: J.chipLabel,
|
|
177
|
+
children: [/* @__PURE__ */ G(n, {
|
|
178
178
|
tag: "span",
|
|
179
179
|
size: "xs",
|
|
180
180
|
weight: "medium",
|
|
181
181
|
type: m ? "error" : "main",
|
|
182
182
|
truncate: !0,
|
|
183
183
|
children: f
|
|
184
|
-
}),
|
|
184
|
+
}), h]
|
|
185
185
|
}), b = !!d && !p && !m;
|
|
186
|
-
return /* @__PURE__ */
|
|
186
|
+
return /* @__PURE__ */ K("div", {
|
|
187
187
|
"data-slot": "comment-attachment",
|
|
188
188
|
"data-status": t.status,
|
|
189
|
-
className: e("comment-attachment-chip--component",
|
|
189
|
+
className: e("comment-attachment-chip--component", J.chip, l),
|
|
190
190
|
children: [
|
|
191
|
-
p ? /* @__PURE__ */
|
|
191
|
+
p ? /* @__PURE__ */ G(te, {}) : /* @__PURE__ */ G(we, {
|
|
192
192
|
mimeType: t.mimeType,
|
|
193
|
-
className:
|
|
193
|
+
className: J.chipIcon
|
|
194
194
|
}),
|
|
195
|
-
b ? /* @__PURE__ */
|
|
195
|
+
b ? /* @__PURE__ */ G("a", {
|
|
196
196
|
href: d,
|
|
197
197
|
target: "_blank",
|
|
198
198
|
rel: "noreferrer noopener",
|
|
199
199
|
"aria-label": u.attachmentDownloadLabel,
|
|
200
|
-
className:
|
|
201
|
-
children:
|
|
202
|
-
}) :
|
|
203
|
-
p && typeof t.progress == "number" && /* @__PURE__ */
|
|
204
|
-
className:
|
|
205
|
-
children: /* @__PURE__ */
|
|
206
|
-
className:
|
|
200
|
+
className: J.chipLink,
|
|
201
|
+
children: _
|
|
202
|
+
}) : _,
|
|
203
|
+
p && typeof t.progress == "number" && /* @__PURE__ */ G("div", {
|
|
204
|
+
className: J.chipProgress,
|
|
205
|
+
children: /* @__PURE__ */ G("div", {
|
|
206
|
+
className: J.chipProgressFill,
|
|
207
207
|
style: { width: `${Math.min(100, Math.max(0, t.progress))}%` }
|
|
208
208
|
})
|
|
209
209
|
}),
|
|
210
|
-
m && !!a && /* @__PURE__ */
|
|
210
|
+
m && !!a && /* @__PURE__ */ G(s, {
|
|
211
211
|
type: "button",
|
|
212
212
|
tone: "destructive",
|
|
213
213
|
buttonStyle: "ghost",
|
|
214
214
|
onClick: () => a(t.id),
|
|
215
|
-
className:
|
|
215
|
+
className: J.chipRetry,
|
|
216
216
|
children: u.attachmentRetryLabel
|
|
217
217
|
}),
|
|
218
|
-
r && !!i && /* @__PURE__ */
|
|
218
|
+
r && !!i && /* @__PURE__ */ G(s, {
|
|
219
219
|
type: "button",
|
|
220
220
|
tone: "neutral",
|
|
221
221
|
buttonStyle: "ghost",
|
|
@@ -223,30 +223,30 @@ function Ce({ attachment: t, editable: r = !1, onRemove: i, onRetry: a, accessor
|
|
|
223
223
|
onClick: () => i(t.id),
|
|
224
224
|
"aria-label": u.attachmentRemoveLabel,
|
|
225
225
|
title: u.attachmentRemoveLabel,
|
|
226
|
-
className:
|
|
227
|
-
children: /* @__PURE__ */
|
|
226
|
+
className: J.chipRemove,
|
|
227
|
+
children: /* @__PURE__ */ G(pe, {})
|
|
228
228
|
})
|
|
229
229
|
]
|
|
230
230
|
});
|
|
231
231
|
}
|
|
232
232
|
//#endregion
|
|
233
233
|
//#region src/components/features/comments/use-attachment-upload.ts
|
|
234
|
-
function
|
|
234
|
+
function Ee() {
|
|
235
235
|
return typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : `attachment-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
236
236
|
}
|
|
237
|
-
function
|
|
238
|
-
let { onUpload: t, maxSize: n, maxFiles: r, disabled: i, initialAttachments: a, onValueChange: o, onReject: s } = e, [c, l] =
|
|
239
|
-
|
|
237
|
+
function De(e = {}) {
|
|
238
|
+
let { onUpload: t, maxSize: n, maxFiles: r, disabled: i, initialAttachments: a, onValueChange: o, onReject: s } = e, [c, l] = W(() => a ? [...a] : []), u = U(c), d = U(/* @__PURE__ */ new Map()), f = U(/* @__PURE__ */ new Map()), p = U(o), m = U(s);
|
|
239
|
+
V(() => {
|
|
240
240
|
p.current = o, m.current = s;
|
|
241
241
|
});
|
|
242
|
-
let h =
|
|
242
|
+
let h = B((e) => {
|
|
243
243
|
u.current = e, l(e);
|
|
244
|
-
}, []), g =
|
|
244
|
+
}, []), g = B((e, t) => {
|
|
245
245
|
h(u.current.map((n) => n.id === e ? {
|
|
246
246
|
...n,
|
|
247
247
|
...t
|
|
248
248
|
} : n));
|
|
249
|
-
}, [h]), _ =
|
|
249
|
+
}, [h]), _ = B((e) => h([...e]), [h]), v = B((e, n) => {
|
|
250
250
|
if (!t || d.current.has(e)) return;
|
|
251
251
|
let r = new AbortController();
|
|
252
252
|
d.current.set(e, r), g(e, {
|
|
@@ -271,7 +271,7 @@ function Te(e = {}) {
|
|
|
271
271
|
error: t instanceof Error ? t.message : void 0
|
|
272
272
|
});
|
|
273
273
|
});
|
|
274
|
-
}, [t, g]), y =
|
|
274
|
+
}, [t, g]), y = B((e) => {
|
|
275
275
|
if (i || !t) return;
|
|
276
276
|
let a = Array.from(e);
|
|
277
277
|
if (a.length === 0) return;
|
|
@@ -293,7 +293,7 @@ function Te(e = {}) {
|
|
|
293
293
|
});
|
|
294
294
|
continue;
|
|
295
295
|
}
|
|
296
|
-
let t =
|
|
296
|
+
let t = Ee();
|
|
297
297
|
f.current.set(t, e), o.push({
|
|
298
298
|
id: t,
|
|
299
299
|
name: e.name,
|
|
@@ -311,33 +311,33 @@ function Te(e = {}) {
|
|
|
311
311
|
t,
|
|
312
312
|
h
|
|
313
313
|
]);
|
|
314
|
-
|
|
314
|
+
V(() => {
|
|
315
315
|
for (let e of c) {
|
|
316
316
|
if (e.status !== "uploading" || d.current.has(e.id)) continue;
|
|
317
317
|
let t = f.current.get(e.id);
|
|
318
318
|
t && v(e.id, t);
|
|
319
319
|
}
|
|
320
320
|
}, [c, v]);
|
|
321
|
-
let b =
|
|
321
|
+
let b = B((e) => {
|
|
322
322
|
d.current.get(e)?.abort(), d.current.delete(e), f.current.delete(e), h(u.current.filter((t) => t.id !== e));
|
|
323
|
-
}, [h]), x =
|
|
323
|
+
}, [h]), x = B((e) => {
|
|
324
324
|
let t = f.current.get(e);
|
|
325
325
|
t && v(e, t);
|
|
326
|
-
}, [v]), S =
|
|
326
|
+
}, [v]), S = B(() => {
|
|
327
327
|
for (let e of d.current.values()) e.abort();
|
|
328
328
|
d.current.clear(), f.current.clear(), h([]);
|
|
329
329
|
}, [h]);
|
|
330
|
-
return
|
|
330
|
+
return V(() => {
|
|
331
331
|
p.current?.(c);
|
|
332
|
-
}, [c]),
|
|
332
|
+
}, [c]), V(() => {
|
|
333
333
|
let e = d.current;
|
|
334
334
|
return () => {
|
|
335
335
|
for (let t of e.values()) t.abort();
|
|
336
336
|
};
|
|
337
337
|
}, []), {
|
|
338
338
|
attachments: c,
|
|
339
|
-
uploadedAttachments:
|
|
340
|
-
isUploading:
|
|
339
|
+
uploadedAttachments: H(() => c.filter((e) => e.status === "uploaded" || !e.status), [c]),
|
|
340
|
+
isUploading: H(() => c.some((e) => e.status === "uploading"), [c]),
|
|
341
341
|
addFiles: y,
|
|
342
342
|
removeAttachment: b,
|
|
343
343
|
retryAttachment: x,
|
|
@@ -347,13 +347,13 @@ function Te(e = {}) {
|
|
|
347
347
|
}
|
|
348
348
|
//#endregion
|
|
349
349
|
//#region src/components/features/comments/comment-composer.tsx
|
|
350
|
-
function
|
|
350
|
+
function Oe(e) {
|
|
351
351
|
return typeof e == "string" && e.replace(/<[^>]*>/g, "").trim().length > 0;
|
|
352
352
|
}
|
|
353
|
-
function
|
|
354
|
-
return /* @__PURE__ */
|
|
355
|
-
className:
|
|
356
|
-
children: /* @__PURE__ */
|
|
353
|
+
function X({ label: e }) {
|
|
354
|
+
return /* @__PURE__ */ G("div", {
|
|
355
|
+
className: J.eyebrow,
|
|
356
|
+
children: /* @__PURE__ */ G(n, {
|
|
357
357
|
tag: "span",
|
|
358
358
|
size: "xs",
|
|
359
359
|
weight: "medium",
|
|
@@ -362,64 +362,64 @@ function De({ label: e }) {
|
|
|
362
362
|
})
|
|
363
363
|
});
|
|
364
364
|
}
|
|
365
|
-
function Z({ context: t, canComment: r = !0, submitting: i = !1, errors: a, resetKey: o = 0, onSubmit: c, onCancel: l, editingComment: u, replyingTo: d, strings: f, resources:
|
|
365
|
+
function Z({ context: t, canComment: r = !0, submitting: i = !1, errors: a, resetKey: o = 0, onSubmit: c, onCancel: l, editingComment: u, replyingTo: d, strings: f, resources: m, onResourceSearch: g, attachments: _, maxAttachments: v, allowAttachments: y = !0, initialValues: b, autoFocus: x = !1, inlineSubmit: S = !1, placeholder: C, className: w, ref: ee }) {
|
|
366
366
|
let T = {
|
|
367
|
-
...
|
|
367
|
+
...q,
|
|
368
368
|
...f
|
|
369
|
-
},
|
|
370
|
-
resources:
|
|
369
|
+
}, E = U(null), O = U(null), [ne, re] = W(b?.content ?? ""), [A, N] = W(null), P = ae({
|
|
370
|
+
resources: m,
|
|
371
371
|
onResourceSearch: g,
|
|
372
|
-
editorRef:
|
|
373
|
-
}), [
|
|
372
|
+
editorRef: E
|
|
373
|
+
}), [F, I] = W(null), L = De({
|
|
374
374
|
..._,
|
|
375
375
|
maxFiles: v ?? _?.maxFiles,
|
|
376
376
|
initialAttachments: b?.attachments,
|
|
377
377
|
onReject: (e) => {
|
|
378
|
-
|
|
378
|
+
I(e), _?.onReject?.(e);
|
|
379
379
|
}
|
|
380
|
-
}),
|
|
381
|
-
|
|
380
|
+
}), le = !!u, ue = !le && !!d, R = B(() => {
|
|
381
|
+
E.current?.clear(), re(""), P.reset(), L.reset(), N(null), I(null);
|
|
382
382
|
}, []);
|
|
383
|
-
|
|
384
|
-
|
|
383
|
+
V(() => {
|
|
384
|
+
R();
|
|
385
385
|
}, [
|
|
386
386
|
t.id,
|
|
387
387
|
t.type,
|
|
388
388
|
o
|
|
389
|
-
]),
|
|
390
|
-
u && (
|
|
391
|
-
}, [u?.id]),
|
|
392
|
-
a?.content &&
|
|
393
|
-
}, [a]),
|
|
394
|
-
focus: () =>
|
|
395
|
-
clear:
|
|
389
|
+
]), V(() => {
|
|
390
|
+
u && (E.current?.setHTML(u.content ?? ""), re(u.content ?? ""), P.setMentions(u.references ?? []), L.setAttachments((u.attachments ?? []).filter((e) => !!e)));
|
|
391
|
+
}, [u?.id]), V(() => {
|
|
392
|
+
a?.content && N(a.content);
|
|
393
|
+
}, [a]), ve(ee, () => ({
|
|
394
|
+
focus: () => E.current?.focus(),
|
|
395
|
+
clear: R,
|
|
396
396
|
setBody: (e) => {
|
|
397
|
-
|
|
397
|
+
E.current?.setHTML(e), re(e);
|
|
398
398
|
}
|
|
399
|
-
}), [
|
|
400
|
-
let
|
|
401
|
-
|
|
399
|
+
}), [R]);
|
|
400
|
+
let fe = B((e) => {
|
|
401
|
+
re(e);
|
|
402
402
|
let t = j(e), n = t.map((e) => e.id).join("|");
|
|
403
|
-
|
|
403
|
+
P.setMentions((e) => {
|
|
404
404
|
if (e.map((e) => e.id).join("|") === n) return e;
|
|
405
405
|
let r = new Map(e.map((e) => [e.id, e]));
|
|
406
406
|
return t.map((e) => r.get(e.id) ?? e);
|
|
407
407
|
});
|
|
408
|
-
}, [
|
|
409
|
-
if (e?.preventDefault(), i ||
|
|
410
|
-
let n =
|
|
411
|
-
if (!
|
|
412
|
-
|
|
408
|
+
}, [P]), pe = B((e) => {
|
|
409
|
+
if (e?.preventDefault(), i || L.isUploading) return;
|
|
410
|
+
let n = E.current?.getHTML() ?? ne;
|
|
411
|
+
if (!Oe(n)) {
|
|
412
|
+
N(T.invalidContent);
|
|
413
413
|
return;
|
|
414
414
|
}
|
|
415
|
-
|
|
415
|
+
N(null), c({
|
|
416
416
|
content: n,
|
|
417
417
|
commentableId: t.id,
|
|
418
418
|
commentableType: t.type,
|
|
419
419
|
moduleKey: t.moduleKey,
|
|
420
420
|
contentType: "html",
|
|
421
|
-
references:
|
|
422
|
-
attachments:
|
|
421
|
+
references: P.mentions,
|
|
422
|
+
attachments: L.uploadedAttachments,
|
|
423
423
|
replyToId: d?.commentId ?? b?.replyToId,
|
|
424
424
|
editingId: u?.id
|
|
425
425
|
});
|
|
@@ -429,24 +429,24 @@ function Z({ context: t, canComment: r = !0, submitting: i = !1, errors: a, rese
|
|
|
429
429
|
T.invalidContent,
|
|
430
430
|
u?.id,
|
|
431
431
|
b?.replyToId,
|
|
432
|
-
|
|
432
|
+
P.mentions,
|
|
433
433
|
c,
|
|
434
434
|
d?.commentId,
|
|
435
435
|
i,
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
]),
|
|
436
|
+
L.isUploading,
|
|
437
|
+
L.uploadedAttachments
|
|
438
|
+
]), me = H(() => {
|
|
439
439
|
let e = [];
|
|
440
|
-
return
|
|
440
|
+
return m && Object.keys(m).length > 0 && e.push({
|
|
441
441
|
id: "reference",
|
|
442
|
-
icon:
|
|
442
|
+
icon: se,
|
|
443
443
|
label: T.composerReferenceLabel,
|
|
444
|
-
onClick: () =>
|
|
444
|
+
onClick: () => P.setPickerOpen(!0)
|
|
445
445
|
}), y && _?.onUpload && !_.disabled && e.push({
|
|
446
446
|
id: "attachment",
|
|
447
|
-
icon:
|
|
447
|
+
icon: ce,
|
|
448
448
|
label: T.composerAttachmentLabel,
|
|
449
|
-
onClick: () =>
|
|
449
|
+
onClick: () => O.current?.click()
|
|
450
450
|
}), e;
|
|
451
451
|
}, [
|
|
452
452
|
y,
|
|
@@ -454,128 +454,128 @@ function Z({ context: t, canComment: r = !0, submitting: i = !1, errors: a, rese
|
|
|
454
454
|
_?.onUpload,
|
|
455
455
|
T.composerAttachmentLabel,
|
|
456
456
|
T.composerReferenceLabel,
|
|
457
|
-
|
|
458
|
-
|
|
457
|
+
P,
|
|
458
|
+
m
|
|
459
459
|
]);
|
|
460
460
|
if (!r) return null;
|
|
461
|
-
let
|
|
461
|
+
let he = i ? T.composerSubmitting : le ? T.composerSave : ue ? T.composerReply : T.composerSubmit, z = /* @__PURE__ */ K(s, {
|
|
462
462
|
type: "button",
|
|
463
|
-
onClick: () =>
|
|
464
|
-
disabled: i ||
|
|
465
|
-
children: [
|
|
466
|
-
}),
|
|
467
|
-
return /* @__PURE__ */
|
|
468
|
-
onSubmit:
|
|
469
|
-
className: e("comment-composer--component",
|
|
463
|
+
onClick: () => pe(),
|
|
464
|
+
disabled: i || L.isUploading,
|
|
465
|
+
children: [G(i ? te : de, {}), he]
|
|
466
|
+
}), ge = S === !1 || le || ue, _e = F ? F.code === "too-large" ? T.formatTooLarge(F.limit) : T.formatTooMany(F.limit) : null, ye = le ? /* @__PURE__ */ G(X, { label: T.composerEditingEyebrow }) : ue ? /* @__PURE__ */ G(X, { label: T.formatReplyingEyebrow(d.authorName ?? T.fallbackAuthor) }) : null;
|
|
467
|
+
return /* @__PURE__ */ K("form", {
|
|
468
|
+
onSubmit: pe,
|
|
469
|
+
className: e("comment-composer--component", J.composer, w),
|
|
470
470
|
children: [
|
|
471
|
-
|
|
472
|
-
/* @__PURE__ */
|
|
473
|
-
ref:
|
|
471
|
+
ye,
|
|
472
|
+
/* @__PURE__ */ G("input", {
|
|
473
|
+
ref: O,
|
|
474
474
|
type: "file",
|
|
475
475
|
multiple: !0,
|
|
476
476
|
hidden: !0,
|
|
477
477
|
accept: _?.accept,
|
|
478
478
|
onChange: (e) => {
|
|
479
|
-
e.target.files &&
|
|
479
|
+
e.target.files && L.addFiles(e.target.files), e.target.value = "";
|
|
480
480
|
}
|
|
481
481
|
}),
|
|
482
|
-
!
|
|
483
|
-
open:
|
|
484
|
-
onOpenChange:
|
|
485
|
-
children: [/* @__PURE__ */
|
|
482
|
+
!P.triggerActive && /* @__PURE__ */ K(k, {
|
|
483
|
+
open: P.pickerOpen,
|
|
484
|
+
onOpenChange: P.setPickerOpen,
|
|
485
|
+
children: [/* @__PURE__ */ G(D, { render: /* @__PURE__ */ G(p, { render: /* @__PURE__ */ G("button", {
|
|
486
486
|
type: "button",
|
|
487
487
|
tabIndex: -1,
|
|
488
488
|
"aria-hidden": !0
|
|
489
|
-
}) }) }), /* @__PURE__ */
|
|
490
|
-
open:
|
|
491
|
-
activeKind:
|
|
492
|
-
setActiveKind:
|
|
493
|
-
kinds:
|
|
494
|
-
resources:
|
|
495
|
-
suggestionsByKind:
|
|
496
|
-
query:
|
|
497
|
-
setQuery:
|
|
498
|
-
suggestions:
|
|
499
|
-
loading:
|
|
500
|
-
onSelect:
|
|
489
|
+
}) }) }), /* @__PURE__ */ G(M, {
|
|
490
|
+
open: P.pickerOpen,
|
|
491
|
+
activeKind: P.activeKind,
|
|
492
|
+
setActiveKind: P.setActiveKind,
|
|
493
|
+
kinds: P.kinds,
|
|
494
|
+
resources: m,
|
|
495
|
+
suggestionsByKind: P.suggestionsByKind,
|
|
496
|
+
query: P.query,
|
|
497
|
+
setQuery: P.setQuery,
|
|
498
|
+
suggestions: P.suggestions,
|
|
499
|
+
loading: P.isLoading,
|
|
500
|
+
onSelect: P.pickSuggestion
|
|
501
501
|
})]
|
|
502
502
|
}),
|
|
503
|
-
/* @__PURE__ */
|
|
504
|
-
className:
|
|
505
|
-
children: [/* @__PURE__ */
|
|
506
|
-
ref:
|
|
503
|
+
/* @__PURE__ */ K("div", {
|
|
504
|
+
className: J.composerEditor,
|
|
505
|
+
children: [/* @__PURE__ */ G(oe, {
|
|
506
|
+
ref: E,
|
|
507
507
|
compact: !0,
|
|
508
508
|
value: ne,
|
|
509
|
-
onValueChange:
|
|
509
|
+
onValueChange: fe,
|
|
510
510
|
placeholder: C ?? T.composerPlaceholder,
|
|
511
511
|
strings: { editorLabel: C ?? T.composerPlaceholder },
|
|
512
|
-
autoFocus: x ||
|
|
512
|
+
autoFocus: x || le || ue,
|
|
513
513
|
hideSourceToggle: !0,
|
|
514
|
-
extraToolbarItems:
|
|
515
|
-
toolbarTrailing:
|
|
516
|
-
footerSlot:
|
|
514
|
+
extraToolbarItems: me,
|
|
515
|
+
toolbarTrailing: ge ? void 0 : z,
|
|
516
|
+
footerSlot: L.attachments.length > 0 ? /* @__PURE__ */ G(h, {
|
|
517
517
|
direction: "horizontal",
|
|
518
518
|
wrap: !0,
|
|
519
519
|
align: "center",
|
|
520
520
|
gap: "sm",
|
|
521
|
-
children:
|
|
521
|
+
children: L.attachments.map((e) => /* @__PURE__ */ G(Te, {
|
|
522
522
|
attachment: e,
|
|
523
523
|
editable: !0,
|
|
524
|
-
onRemove:
|
|
525
|
-
onRetry:
|
|
524
|
+
onRemove: L.removeAttachment,
|
|
525
|
+
onRetry: L.retryAttachment,
|
|
526
526
|
strings: f
|
|
527
527
|
}, e.id))
|
|
528
528
|
}) : void 0,
|
|
529
|
-
onCaretChange:
|
|
530
|
-
}), /* @__PURE__ */
|
|
531
|
-
onDismiss: () =>
|
|
532
|
-
open:
|
|
533
|
-
activeKind:
|
|
534
|
-
setActiveKind:
|
|
535
|
-
onManualKindChange: () =>
|
|
536
|
-
kinds:
|
|
537
|
-
resources:
|
|
538
|
-
query:
|
|
539
|
-
suggestions:
|
|
540
|
-
suggestionsByKind:
|
|
541
|
-
loading:
|
|
542
|
-
onSelect:
|
|
529
|
+
onCaretChange: P.handleCaretChange
|
|
530
|
+
}), /* @__PURE__ */ G(ie, {
|
|
531
|
+
onDismiss: () => P.setPickerOpen(!1),
|
|
532
|
+
open: P.triggerActive && P.pickerOpen,
|
|
533
|
+
activeKind: P.activeKind,
|
|
534
|
+
setActiveKind: P.setActiveKind,
|
|
535
|
+
onManualKindChange: () => P.setManualKindOverride(!0),
|
|
536
|
+
kinds: P.kinds,
|
|
537
|
+
resources: m,
|
|
538
|
+
query: P.query,
|
|
539
|
+
suggestions: P.suggestions,
|
|
540
|
+
suggestionsByKind: P.suggestionsByKind,
|
|
541
|
+
loading: P.isLoading,
|
|
542
|
+
onSelect: P.pickSuggestion
|
|
543
543
|
})]
|
|
544
544
|
}),
|
|
545
|
-
!!
|
|
545
|
+
!!A && /* @__PURE__ */ G(n, {
|
|
546
546
|
size: "xs",
|
|
547
547
|
type: "error",
|
|
548
548
|
role: "alert",
|
|
549
549
|
"aria-live": "polite",
|
|
550
|
-
children:
|
|
550
|
+
children: A
|
|
551
551
|
}),
|
|
552
|
-
!!
|
|
552
|
+
!!_e && /* @__PURE__ */ G(n, {
|
|
553
553
|
size: "xs",
|
|
554
554
|
type: "error",
|
|
555
555
|
role: "alert",
|
|
556
556
|
"aria-live": "polite",
|
|
557
|
-
children:
|
|
557
|
+
children: _e
|
|
558
558
|
}),
|
|
559
|
-
|
|
559
|
+
ge && /* @__PURE__ */ K(h, {
|
|
560
560
|
direction: "horizontal",
|
|
561
561
|
align: "center",
|
|
562
562
|
justify: "end",
|
|
563
563
|
gap: "md",
|
|
564
|
-
children: [!!l && /* @__PURE__ */
|
|
564
|
+
children: [!!l && /* @__PURE__ */ G(s, {
|
|
565
565
|
type: "button",
|
|
566
566
|
tone: "neutral",
|
|
567
567
|
buttonStyle: "ghost",
|
|
568
568
|
onClick: l,
|
|
569
569
|
disabled: i,
|
|
570
570
|
children: T.composerCancel
|
|
571
|
-
}),
|
|
571
|
+
}), z]
|
|
572
572
|
})
|
|
573
573
|
]
|
|
574
574
|
});
|
|
575
575
|
}
|
|
576
576
|
//#endregion
|
|
577
577
|
//#region src/components/features/comments/comment-thread-context.ts
|
|
578
|
-
var
|
|
578
|
+
var ke = z(/* @__PURE__ */ new Map()), Ae = z(0), je = z({});
|
|
579
579
|
//#endregion
|
|
580
580
|
//#region src/components/features/comments/comment-content.tsx
|
|
581
581
|
function Q(e) {
|
|
@@ -591,18 +591,18 @@ function $(e) {
|
|
|
591
591
|
} catch {}
|
|
592
592
|
return t.startsWith("\"") && t.endsWith("\"") ? t.slice(1, -1) : t;
|
|
593
593
|
}
|
|
594
|
-
function
|
|
594
|
+
function Me({ block: r, copy: a }) {
|
|
595
595
|
let o = r.data ?? {};
|
|
596
596
|
switch (r.type) {
|
|
597
597
|
case "paragraph": {
|
|
598
598
|
let e = String(o.text ?? "").trim();
|
|
599
|
-
return e ? /* @__PURE__ */
|
|
599
|
+
return e ? /* @__PURE__ */ G(i, { html: e }) : null;
|
|
600
600
|
}
|
|
601
601
|
case "header": {
|
|
602
602
|
let e = Q(String(o.text ?? ""));
|
|
603
603
|
if (!e) return null;
|
|
604
604
|
let n = Math.min(Math.max(Number(o.level ?? 3), 1), 6);
|
|
605
|
-
return /* @__PURE__ */
|
|
605
|
+
return /* @__PURE__ */ G(t, {
|
|
606
606
|
level: n,
|
|
607
607
|
children: e
|
|
608
608
|
});
|
|
@@ -611,9 +611,9 @@ function je({ block: r, copy: a }) {
|
|
|
611
611
|
let t = (Array.isArray(o.items) ? o.items : []).map((e) => Q(String(e ?? ""))).filter((e) => e.length > 0);
|
|
612
612
|
if (t.length === 0) return null;
|
|
613
613
|
let r = o.style === "ordered";
|
|
614
|
-
return /* @__PURE__ */
|
|
615
|
-
className: e(
|
|
616
|
-
children: t.map((e, t) => /* @__PURE__ */
|
|
614
|
+
return /* @__PURE__ */ G(r ? "ol" : "ul", {
|
|
615
|
+
className: e(J.richList, r && J.richListOrdered),
|
|
616
|
+
children: t.map((e, t) => /* @__PURE__ */ G("li", { children: /* @__PURE__ */ G(n, {
|
|
617
617
|
tag: "span",
|
|
618
618
|
children: e
|
|
619
619
|
}) }, `${e}-${t}`))
|
|
@@ -623,14 +623,14 @@ function je({ block: r, copy: a }) {
|
|
|
623
623
|
let e = String(o.text ?? "").trim();
|
|
624
624
|
if (!e) return null;
|
|
625
625
|
let t = Q(String(o.caption ?? ""));
|
|
626
|
-
return /* @__PURE__ */
|
|
627
|
-
className:
|
|
628
|
-
children: [/* @__PURE__ */
|
|
626
|
+
return /* @__PURE__ */ K("blockquote", {
|
|
627
|
+
className: J.richQuote,
|
|
628
|
+
children: [/* @__PURE__ */ G(i, {
|
|
629
629
|
html: e,
|
|
630
630
|
type: "secondary"
|
|
631
|
-
}), t.length > 0 && /* @__PURE__ */
|
|
632
|
-
className:
|
|
633
|
-
children: /* @__PURE__ */
|
|
631
|
+
}), t.length > 0 && /* @__PURE__ */ G("cite", {
|
|
632
|
+
className: J.richCite,
|
|
633
|
+
children: /* @__PURE__ */ G(n, {
|
|
634
634
|
tag: "span",
|
|
635
635
|
size: "xs",
|
|
636
636
|
type: "secondary",
|
|
@@ -639,89 +639,89 @@ function je({ block: r, copy: a }) {
|
|
|
639
639
|
})]
|
|
640
640
|
});
|
|
641
641
|
}
|
|
642
|
-
case "delimiter": return /* @__PURE__ */
|
|
642
|
+
case "delimiter": return /* @__PURE__ */ G("div", {
|
|
643
643
|
"aria-hidden": !0,
|
|
644
|
-
className:
|
|
644
|
+
className: J.richDelimiter
|
|
645
645
|
});
|
|
646
646
|
default: {
|
|
647
647
|
let e = Q(String(o.text ?? ""));
|
|
648
|
-
return e ? /* @__PURE__ */
|
|
649
|
-
className:
|
|
648
|
+
return e ? /* @__PURE__ */ G(n, {
|
|
649
|
+
className: J.plain,
|
|
650
650
|
children: e
|
|
651
651
|
}) : null;
|
|
652
652
|
}
|
|
653
653
|
}
|
|
654
654
|
}
|
|
655
|
-
function
|
|
655
|
+
function Ne({ raw: e, copy: t }) {
|
|
656
656
|
if (!e) return null;
|
|
657
657
|
let r;
|
|
658
658
|
try {
|
|
659
659
|
let t = JSON.parse(e);
|
|
660
660
|
r = Array.isArray(t?.blocks) ? t.blocks : [];
|
|
661
661
|
} catch {
|
|
662
|
-
return /* @__PURE__ */
|
|
663
|
-
className:
|
|
662
|
+
return /* @__PURE__ */ G(n, {
|
|
663
|
+
className: J.plain,
|
|
664
664
|
children: $(e)
|
|
665
665
|
});
|
|
666
666
|
}
|
|
667
|
-
return r.length === 0 ? null : /* @__PURE__ */
|
|
668
|
-
className:
|
|
669
|
-
children: r.map((e, n) => /* @__PURE__ */
|
|
667
|
+
return r.length === 0 ? null : /* @__PURE__ */ G("div", {
|
|
668
|
+
className: J.richBlocks,
|
|
669
|
+
children: r.map((e, n) => /* @__PURE__ */ G(me, { children: /* @__PURE__ */ G(Me, {
|
|
670
670
|
block: e,
|
|
671
671
|
copy: t
|
|
672
672
|
}) }, e.id ?? `${e.type}-${n}`))
|
|
673
673
|
});
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function Pe({ comment: t, resources: r, renderReference: i, sanitizer: a, strings: o, className: s }) {
|
|
676
676
|
let c = {
|
|
677
|
-
...
|
|
677
|
+
...q,
|
|
678
678
|
...o
|
|
679
679
|
}, l = e("comment-content--component", s), u = t.contentType ?? "text";
|
|
680
|
-
return u === "rich" ? /* @__PURE__ */
|
|
680
|
+
return u === "rich" ? /* @__PURE__ */ G("div", {
|
|
681
681
|
className: l,
|
|
682
|
-
children: /* @__PURE__ */
|
|
682
|
+
children: /* @__PURE__ */ G(Ne, {
|
|
683
683
|
raw: t.content,
|
|
684
684
|
copy: c
|
|
685
685
|
})
|
|
686
|
-
}) : u === "html" ? /* @__PURE__ */
|
|
686
|
+
}) : u === "html" ? /* @__PURE__ */ G("div", {
|
|
687
687
|
className: l,
|
|
688
|
-
children: /* @__PURE__ */
|
|
688
|
+
children: /* @__PURE__ */ G(A, {
|
|
689
689
|
html: t.content ?? "",
|
|
690
690
|
mentions: t.references,
|
|
691
691
|
resources: r,
|
|
692
692
|
renderMention: i,
|
|
693
693
|
sanitizer: a
|
|
694
694
|
})
|
|
695
|
-
}) : /* @__PURE__ */
|
|
696
|
-
className: e(l,
|
|
695
|
+
}) : /* @__PURE__ */ G(n, {
|
|
696
|
+
className: e(l, J.plain),
|
|
697
697
|
children: $(t.content)
|
|
698
698
|
});
|
|
699
699
|
}
|
|
700
700
|
//#endregion
|
|
701
701
|
//#region src/components/features/comments/comment-item.tsx
|
|
702
|
-
var
|
|
703
|
-
function
|
|
702
|
+
var Fe = "active", Ie = 2, Le = ["👍"];
|
|
703
|
+
function Re(e) {
|
|
704
704
|
let t = e.replace(/_/g, " ");
|
|
705
705
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
706
706
|
}
|
|
707
|
-
function
|
|
708
|
-
let { format: t, locale: n } = o(), r =
|
|
707
|
+
function ze(e) {
|
|
708
|
+
let { format: t, locale: n } = o(), r = S(e);
|
|
709
709
|
return r ? {
|
|
710
710
|
iso: r.toISOString(),
|
|
711
|
-
label:
|
|
711
|
+
label: xe(r, `${t} HH:mm`, { locale: n })
|
|
712
712
|
} : null;
|
|
713
713
|
}
|
|
714
|
-
function
|
|
715
|
-
return /* @__PURE__ */
|
|
716
|
-
render: /* @__PURE__ */
|
|
714
|
+
function Be({ children: t, className: i, buttonRef: a, ...o }) {
|
|
715
|
+
return /* @__PURE__ */ G(r, {
|
|
716
|
+
render: /* @__PURE__ */ G("button", {
|
|
717
717
|
type: "button",
|
|
718
718
|
ref: a
|
|
719
719
|
}),
|
|
720
720
|
variant: "subtle",
|
|
721
721
|
"data-hit-area": !0,
|
|
722
|
-
className: e(
|
|
722
|
+
className: e(J.quietAction, i),
|
|
723
723
|
...o,
|
|
724
|
-
children: /* @__PURE__ */
|
|
724
|
+
children: /* @__PURE__ */ G(n, {
|
|
725
725
|
tag: "span",
|
|
726
726
|
size: "xs",
|
|
727
727
|
weight: "medium",
|
|
@@ -730,66 +730,66 @@ function ze({ children: t, className: i, buttonRef: a, ...o }) {
|
|
|
730
730
|
})
|
|
731
731
|
});
|
|
732
732
|
}
|
|
733
|
-
function
|
|
734
|
-
let [i, a] =
|
|
733
|
+
function Ve({ choices: e, reactions: t, onPick: n, copy: r }) {
|
|
734
|
+
let [i, a] = W(!1);
|
|
735
735
|
if (e.length <= 1) {
|
|
736
|
-
let [t =
|
|
737
|
-
return /* @__PURE__ */
|
|
736
|
+
let [t = Le[0]] = e;
|
|
737
|
+
return /* @__PURE__ */ G("button", {
|
|
738
738
|
type: "button",
|
|
739
739
|
"aria-label": r.addReactionLabel,
|
|
740
740
|
title: r.addReactionLabel,
|
|
741
741
|
onClick: () => n(t),
|
|
742
|
-
className:
|
|
743
|
-
children: /* @__PURE__ */
|
|
742
|
+
className: J.reactionAdd,
|
|
743
|
+
children: /* @__PURE__ */ G(R, { "aria-hidden": !0 })
|
|
744
744
|
});
|
|
745
745
|
}
|
|
746
|
-
return /* @__PURE__ */
|
|
746
|
+
return /* @__PURE__ */ K(k, {
|
|
747
747
|
open: i,
|
|
748
748
|
onOpenChange: a,
|
|
749
|
-
children: [/* @__PURE__ */
|
|
750
|
-
render: /* @__PURE__ */
|
|
749
|
+
children: [/* @__PURE__ */ G(D, {
|
|
750
|
+
render: /* @__PURE__ */ G("button", {
|
|
751
751
|
type: "button",
|
|
752
752
|
"aria-label": r.addReactionLabel,
|
|
753
753
|
title: r.addReactionLabel,
|
|
754
|
-
className:
|
|
754
|
+
className: J.reactionAdd
|
|
755
755
|
}),
|
|
756
|
-
children: /* @__PURE__ */
|
|
757
|
-
}), /* @__PURE__ */
|
|
756
|
+
children: /* @__PURE__ */ G(R, { "aria-hidden": !0 })
|
|
757
|
+
}), /* @__PURE__ */ G(O, {
|
|
758
758
|
width: "auto",
|
|
759
759
|
side: "top",
|
|
760
760
|
align: "start",
|
|
761
761
|
inset: "flush",
|
|
762
762
|
"aria-label": r.reactionPickerLabel,
|
|
763
|
-
className:
|
|
763
|
+
className: J.reactionPicker,
|
|
764
764
|
children: e.map((e) => {
|
|
765
765
|
let r = t.some((t) => t.emoji === e && t.mine);
|
|
766
|
-
return /* @__PURE__ */
|
|
766
|
+
return /* @__PURE__ */ G("button", {
|
|
767
767
|
type: "button",
|
|
768
768
|
"aria-pressed": r,
|
|
769
769
|
"data-mine": r || void 0,
|
|
770
770
|
onClick: () => {
|
|
771
771
|
n(e), a(!1);
|
|
772
772
|
},
|
|
773
|
-
className:
|
|
773
|
+
className: J.reactionChoice,
|
|
774
774
|
children: e
|
|
775
775
|
}, e);
|
|
776
776
|
})
|
|
777
777
|
})]
|
|
778
778
|
});
|
|
779
779
|
}
|
|
780
|
-
function
|
|
781
|
-
let
|
|
782
|
-
...
|
|
783
|
-
...
|
|
784
|
-
},
|
|
780
|
+
function He({ comment: t, replies: r, canModerate: i, onDelete: a, onAttachmentRemove: o, onEdit: s, onPinToggle: p, onReact: m, onReply: h, allowReactions: g = !0, allowReplies: v = !0, commentActions: y, maxVisibleReplies: S = 3, clampLines: D = 6, maxVisibleAttachments: O = 3, reactionChoices: k = Le, sanitizer: te, strings: A, getMediaUrl: j, getMediaName: ie, getStatusLabel: M, resources: ae, renderAttachment: oe, renderReference: se, className: N }) {
|
|
781
|
+
let P = {
|
|
782
|
+
...q,
|
|
783
|
+
...A
|
|
784
|
+
}, F = ge(Ae), I = ge(je), ce = ge(ke), de = v ? r ?? ce.get(t.id ?? "") ?? [] : [], R = t.user?.name ?? P.fallbackAuthor, pe = t.status && t.status !== Fe ? M?.(t.status) ?? Re(t.status) : null, me = ze(t.createdAt), z = ze(t.updatedAt), ve = t.canDelete ?? i === !0, xe = t.canEdit ?? i === !0, Se = H(() => {
|
|
785
785
|
let e = t.tagsArray;
|
|
786
786
|
return Array.isArray(e) ? e.filter((e) => typeof e == "string") : e && typeof e == "object" ? Object.values(e).filter((e) => typeof e == "string") : [];
|
|
787
|
-
}, [t.tagsArray]),
|
|
788
|
-
|
|
789
|
-
}, [we]),
|
|
790
|
-
We !==
|
|
791
|
-
let Ke =
|
|
792
|
-
|
|
787
|
+
}, [t.tagsArray]), Y = H(() => (t.attachments ?? []).filter((e) => !!e && typeof e == "object"), [t.attachments]), Ce = g ? t.reactions ?? [] : [], we = ne(), [Ee, De] = W(null), Oe = B((e) => {
|
|
788
|
+
De(e), we.show();
|
|
789
|
+
}, [we]), X = !!t.id && !!I.composer && I.replyingToId === t.id, Z = !!t.id && !!I.composer && I.editingId === t.id, Q = de.length, [$, Me] = W(!1), [Ne, Ue] = W(!1), [We, Ge] = W(X);
|
|
790
|
+
We !== X && (Ge(X), X && Q > 0 && Me(!0));
|
|
791
|
+
let Ke = $ ? Math.max(0, Q - (S > 0 && !Ne ? S : Q)) : 0, qe = $ ? de.slice(Ke) : [], Je = _e(), Ye = X ? I.composer : null, Xe = Ye ? "composer" : qe.length > 0 ? "reply" : Ke > 0 ? "earlier" : "toggle", Ze = Q > 0 || !!Ye, Qe = U(null), $e = _e(), [et, tt] = W(!1), [nt, rt] = W(!1), it = D > 0, at = it && nt && !et;
|
|
792
|
+
ye(() => {
|
|
793
793
|
let e = Qe.current;
|
|
794
794
|
if (!e || !it) {
|
|
795
795
|
rt(!1);
|
|
@@ -797,7 +797,7 @@ function Ve({ comment: t, replies: r, canModerate: i, onDelete: a, onAttachmentR
|
|
|
797
797
|
}
|
|
798
798
|
let t = () => {
|
|
799
799
|
let t = getComputedStyle(e), n = parseFloat(t.lineHeight) || parseFloat(t.fontSize) * 1.5;
|
|
800
|
-
n && rt(e.scrollHeight > (D +
|
|
800
|
+
n && rt(e.scrollHeight > (D + Ie) * n + 1);
|
|
801
801
|
};
|
|
802
802
|
if (t(), typeof ResizeObserver > "u") return;
|
|
803
803
|
let n = new ResizeObserver(t);
|
|
@@ -806,38 +806,38 @@ function Ve({ comment: t, replies: r, canModerate: i, onDelete: a, onAttachmentR
|
|
|
806
806
|
it,
|
|
807
807
|
D,
|
|
808
808
|
t.content,
|
|
809
|
-
|
|
809
|
+
Z
|
|
810
810
|
]);
|
|
811
|
-
let [ot, st] =
|
|
812
|
-
|
|
811
|
+
let [ot, st] = W(!1), ct = O > 0 && Y.length > O + 1, lt = ct && !ot ? Y.slice(0, O) : Y, ut = Y.length - lt.length, dt = U(null), ft = U(null), pt = U(!1), mt = U(!1);
|
|
812
|
+
V(() => {
|
|
813
813
|
let e = !document.activeElement || document.activeElement === document.body;
|
|
814
|
-
pt.current && !
|
|
815
|
-
}, [
|
|
814
|
+
pt.current && !X && e && dt.current?.focus(), mt.current && !Z && e && ft.current?.querySelector("button")?.focus(), pt.current = X, mt.current = Z;
|
|
815
|
+
}, [Z, X]);
|
|
816
816
|
let ht = [
|
|
817
817
|
{
|
|
818
818
|
id: "pin",
|
|
819
|
-
label: t.isPinned ?
|
|
820
|
-
icon:
|
|
819
|
+
label: t.isPinned ? P.unpinLabel : P.pinLabel,
|
|
820
|
+
icon: ue,
|
|
821
821
|
visible: !!p && i === !0,
|
|
822
822
|
onClick: () => p?.(t)
|
|
823
823
|
},
|
|
824
824
|
{
|
|
825
825
|
id: "edit",
|
|
826
|
-
label:
|
|
827
|
-
icon:
|
|
828
|
-
visible:
|
|
826
|
+
label: P.editLabel,
|
|
827
|
+
icon: le,
|
|
828
|
+
visible: xe && !!s && !!t.id,
|
|
829
829
|
onClick: () => s?.(t)
|
|
830
830
|
},
|
|
831
|
-
...d(
|
|
831
|
+
...d(y, t),
|
|
832
832
|
{
|
|
833
833
|
id: "delete",
|
|
834
|
-
label:
|
|
835
|
-
icon:
|
|
834
|
+
label: P.deleteLabel,
|
|
835
|
+
icon: fe,
|
|
836
836
|
tone: "destructive",
|
|
837
|
-
visible:
|
|
837
|
+
visible: ve && !!a && !!t.id,
|
|
838
838
|
onClick: () => a?.(t.id)
|
|
839
839
|
}
|
|
840
|
-
], gt =
|
|
840
|
+
], gt = g && !!m && !!t.id, _t = v && !!h && !!t.id, vt = Ce.length > 0 || gt || _t, yt = {
|
|
841
841
|
canModerate: i,
|
|
842
842
|
onDelete: a,
|
|
843
843
|
onAttachmentRemove: o,
|
|
@@ -845,281 +845,281 @@ function Ve({ comment: t, replies: r, canModerate: i, onDelete: a, onAttachmentR
|
|
|
845
845
|
onPinToggle: p,
|
|
846
846
|
onReact: m,
|
|
847
847
|
onReply: h,
|
|
848
|
-
allowReactions:
|
|
848
|
+
allowReactions: g,
|
|
849
849
|
allowReplies: v,
|
|
850
|
-
commentActions:
|
|
851
|
-
maxVisibleReplies:
|
|
850
|
+
commentActions: y,
|
|
851
|
+
maxVisibleReplies: S,
|
|
852
852
|
clampLines: D,
|
|
853
853
|
maxVisibleAttachments: O,
|
|
854
854
|
reactionChoices: k,
|
|
855
|
-
sanitizer:
|
|
856
|
-
strings:
|
|
857
|
-
getMediaUrl:
|
|
858
|
-
getMediaName:
|
|
859
|
-
getStatusLabel:
|
|
860
|
-
resources:
|
|
861
|
-
renderAttachment:
|
|
862
|
-
renderReference:
|
|
855
|
+
sanitizer: te,
|
|
856
|
+
strings: A,
|
|
857
|
+
getMediaUrl: j,
|
|
858
|
+
getMediaName: ie,
|
|
859
|
+
getStatusLabel: M,
|
|
860
|
+
resources: ae,
|
|
861
|
+
renderAttachment: oe,
|
|
862
|
+
renderReference: se
|
|
863
863
|
}, bt = `${$e}-author`;
|
|
864
|
-
return /* @__PURE__ */
|
|
864
|
+
return /* @__PURE__ */ K("article", {
|
|
865
865
|
"data-slot": "comment",
|
|
866
866
|
"data-comment-id": t.id,
|
|
867
|
-
"data-depth":
|
|
867
|
+
"data-depth": F,
|
|
868
868
|
"data-pinned": t.isPinned || void 0,
|
|
869
|
-
"data-status":
|
|
869
|
+
"data-status": pe ? t.status : void 0,
|
|
870
870
|
"data-thread": Ze || void 0,
|
|
871
|
-
"data-editing":
|
|
871
|
+
"data-editing": Z || void 0,
|
|
872
872
|
"aria-labelledby": bt,
|
|
873
|
-
className: e("comment-item--component",
|
|
873
|
+
className: e("comment-item--component", J.item, N),
|
|
874
874
|
children: [
|
|
875
|
-
t.isPinned && /* @__PURE__ */
|
|
876
|
-
className:
|
|
877
|
-
children: [/* @__PURE__ */
|
|
875
|
+
t.isPinned && /* @__PURE__ */ K("div", {
|
|
876
|
+
className: J.itemContext,
|
|
877
|
+
children: [/* @__PURE__ */ G(ue, {
|
|
878
878
|
"aria-hidden": !0,
|
|
879
|
-
className:
|
|
880
|
-
}), /* @__PURE__ */
|
|
879
|
+
className: J.itemContextIcon
|
|
880
|
+
}), /* @__PURE__ */ G(n, {
|
|
881
881
|
tag: "span",
|
|
882
882
|
size: "xs",
|
|
883
883
|
weight: "medium",
|
|
884
884
|
type: "secondary",
|
|
885
|
-
children:
|
|
885
|
+
children: P.pinned
|
|
886
886
|
})]
|
|
887
887
|
}),
|
|
888
|
-
/* @__PURE__ */
|
|
889
|
-
className:
|
|
890
|
-
children: /* @__PURE__ */
|
|
888
|
+
/* @__PURE__ */ G("div", {
|
|
889
|
+
className: J.itemGutter,
|
|
890
|
+
children: /* @__PURE__ */ K(E, {
|
|
891
891
|
"aria-hidden": !0,
|
|
892
|
-
size:
|
|
893
|
-
children: [!!t.user?.avatar && /* @__PURE__ */
|
|
892
|
+
size: F > 0 ? "sm" : "default",
|
|
893
|
+
children: [!!t.user?.avatar && /* @__PURE__ */ G(T, {
|
|
894
894
|
src: t.user.avatar,
|
|
895
|
-
alt:
|
|
896
|
-
}), /* @__PURE__ */
|
|
895
|
+
alt: R
|
|
896
|
+
}), /* @__PURE__ */ G(ee, { children: _(R) })]
|
|
897
897
|
})
|
|
898
898
|
}),
|
|
899
|
-
/* @__PURE__ */
|
|
900
|
-
className:
|
|
901
|
-
children:
|
|
899
|
+
/* @__PURE__ */ G("div", {
|
|
900
|
+
className: J.itemMain,
|
|
901
|
+
children: Z ? /* @__PURE__ */ K(be, { children: [/* @__PURE__ */ G(n, {
|
|
902
902
|
tag: "span",
|
|
903
903
|
id: bt,
|
|
904
904
|
weight: "semibold",
|
|
905
|
-
className:
|
|
906
|
-
children:
|
|
907
|
-
}),
|
|
908
|
-
/* @__PURE__ */
|
|
909
|
-
className:
|
|
910
|
-
children: [/* @__PURE__ */
|
|
911
|
-
className:
|
|
905
|
+
className: J.itemEditingAuthor,
|
|
906
|
+
children: R
|
|
907
|
+
}), I.composer] }) : /* @__PURE__ */ K(be, { children: [
|
|
908
|
+
/* @__PURE__ */ K("div", {
|
|
909
|
+
className: J.itemBubbleRow,
|
|
910
|
+
children: [/* @__PURE__ */ K("div", {
|
|
911
|
+
className: J.itemBubble,
|
|
912
912
|
children: [
|
|
913
|
-
/* @__PURE__ */
|
|
914
|
-
className:
|
|
913
|
+
/* @__PURE__ */ K("div", {
|
|
914
|
+
className: J.itemHeader,
|
|
915
915
|
children: [
|
|
916
|
-
/* @__PURE__ */
|
|
916
|
+
/* @__PURE__ */ G(n, {
|
|
917
917
|
tag: "span",
|
|
918
918
|
id: bt,
|
|
919
919
|
weight: "semibold",
|
|
920
|
-
className:
|
|
921
|
-
children:
|
|
920
|
+
className: J.itemAuthor,
|
|
921
|
+
children: R
|
|
922
922
|
}),
|
|
923
|
-
!!
|
|
923
|
+
!!pe && /* @__PURE__ */ G(w, {
|
|
924
924
|
tone: "neutral",
|
|
925
925
|
variant: "outline",
|
|
926
|
-
children:
|
|
926
|
+
children: pe
|
|
927
927
|
}),
|
|
928
|
-
(
|
|
929
|
-
className:
|
|
930
|
-
children: [
|
|
931
|
-
dateTime:
|
|
932
|
-
className:
|
|
933
|
-
children: /* @__PURE__ */
|
|
928
|
+
(me || t.isEdited) && /* @__PURE__ */ K("span", {
|
|
929
|
+
className: J.itemMeta,
|
|
930
|
+
children: [me && /* @__PURE__ */ G("time", {
|
|
931
|
+
dateTime: me.iso,
|
|
932
|
+
className: J.itemTime,
|
|
933
|
+
children: /* @__PURE__ */ G(b, {
|
|
934
934
|
value: t.createdAt,
|
|
935
935
|
size: "xs",
|
|
936
936
|
type: "secondary",
|
|
937
|
-
title:
|
|
937
|
+
title: me.label
|
|
938
938
|
})
|
|
939
|
-
}), t.isEdited && /* @__PURE__ */
|
|
939
|
+
}), t.isEdited && /* @__PURE__ */ G(n, {
|
|
940
940
|
tag: "span",
|
|
941
941
|
size: "xs",
|
|
942
942
|
type: "secondary",
|
|
943
|
-
title:
|
|
944
|
-
className:
|
|
945
|
-
children:
|
|
943
|
+
title: z?.label,
|
|
944
|
+
className: J.itemEdited,
|
|
945
|
+
children: P.edited
|
|
946
946
|
})]
|
|
947
947
|
})
|
|
948
948
|
]
|
|
949
949
|
}),
|
|
950
|
-
/* @__PURE__ */
|
|
950
|
+
/* @__PURE__ */ G("div", {
|
|
951
951
|
ref: Qe,
|
|
952
952
|
id: $e,
|
|
953
953
|
"data-clamped": at || void 0,
|
|
954
954
|
style: at ? { maxHeight: `${D}lh` } : void 0,
|
|
955
|
-
className:
|
|
956
|
-
children: /* @__PURE__ */
|
|
955
|
+
className: J.itemContent,
|
|
956
|
+
children: /* @__PURE__ */ G(Pe, {
|
|
957
957
|
comment: t,
|
|
958
|
-
resources:
|
|
959
|
-
renderReference:
|
|
960
|
-
sanitizer:
|
|
961
|
-
strings:
|
|
958
|
+
resources: ae,
|
|
959
|
+
renderReference: se,
|
|
960
|
+
sanitizer: te,
|
|
961
|
+
strings: A
|
|
962
962
|
})
|
|
963
963
|
}),
|
|
964
|
-
it && nt && /* @__PURE__ */
|
|
964
|
+
it && nt && /* @__PURE__ */ G(Be, {
|
|
965
965
|
"aria-expanded": et,
|
|
966
966
|
"aria-controls": $e,
|
|
967
967
|
onClick: () => tt((e) => !e),
|
|
968
|
-
className:
|
|
969
|
-
children: et ?
|
|
968
|
+
className: J.itemMore,
|
|
969
|
+
children: et ? P.seeLessLabel : P.seeMoreLabel
|
|
970
970
|
})
|
|
971
971
|
]
|
|
972
|
-
}), /* @__PURE__ */
|
|
972
|
+
}), /* @__PURE__ */ G("div", {
|
|
973
973
|
ref: ft,
|
|
974
|
-
className:
|
|
975
|
-
children: /* @__PURE__ */
|
|
976
|
-
icon:
|
|
977
|
-
strings: { trigger:
|
|
974
|
+
className: J.itemMenu,
|
|
975
|
+
children: /* @__PURE__ */ G(f, {
|
|
976
|
+
icon: L,
|
|
977
|
+
strings: { trigger: P.actionsLabel },
|
|
978
978
|
actions: ht
|
|
979
979
|
})
|
|
980
980
|
})]
|
|
981
981
|
}),
|
|
982
|
-
(
|
|
983
|
-
className:
|
|
982
|
+
(Y.length > 0 || Se.length > 0) && /* @__PURE__ */ K("div", {
|
|
983
|
+
className: J.itemChips,
|
|
984
984
|
children: [
|
|
985
985
|
lt.map((e) => {
|
|
986
|
-
if (
|
|
987
|
-
let t = !!o && !!e.id &&
|
|
988
|
-
return /* @__PURE__ */
|
|
986
|
+
if (oe) return /* @__PURE__ */ G("div", { children: oe(e) }, e.id ?? e.name);
|
|
987
|
+
let t = !!o && !!e.id && ve;
|
|
988
|
+
return /* @__PURE__ */ G(Te, {
|
|
989
989
|
attachment: e,
|
|
990
990
|
editable: t,
|
|
991
|
-
onRemove: t ? () =>
|
|
991
|
+
onRemove: t ? () => Oe(e.id) : void 0,
|
|
992
992
|
accessors: {
|
|
993
|
-
getMediaUrl:
|
|
994
|
-
getMediaName:
|
|
993
|
+
getMediaUrl: j,
|
|
994
|
+
getMediaName: ie
|
|
995
995
|
},
|
|
996
|
-
strings:
|
|
996
|
+
strings: A
|
|
997
997
|
}, e.id ?? e.name);
|
|
998
998
|
}),
|
|
999
|
-
|
|
999
|
+
Se.map((e) => /* @__PURE__ */ G(w, {
|
|
1000
1000
|
tone: "neutral",
|
|
1001
1001
|
variant: "outline",
|
|
1002
1002
|
children: e
|
|
1003
1003
|
}, e)),
|
|
1004
|
-
ct && /* @__PURE__ */
|
|
1004
|
+
ct && /* @__PURE__ */ G(Be, {
|
|
1005
1005
|
"aria-expanded": ot,
|
|
1006
1006
|
onClick: () => st((e) => !e),
|
|
1007
|
-
children: ot ?
|
|
1007
|
+
children: ot ? P.showFewerAttachmentsLabel : P.formatShowMoreAttachments(ut)
|
|
1008
1008
|
})
|
|
1009
1009
|
]
|
|
1010
1010
|
}),
|
|
1011
|
-
vt && /* @__PURE__ */
|
|
1012
|
-
className:
|
|
1011
|
+
vt && /* @__PURE__ */ K("div", {
|
|
1012
|
+
className: J.itemActions,
|
|
1013
1013
|
children: [
|
|
1014
|
-
|
|
1015
|
-
let n = /* @__PURE__ */
|
|
1014
|
+
Ce.map((e) => {
|
|
1015
|
+
let n = /* @__PURE__ */ G("button", {
|
|
1016
1016
|
type: "button",
|
|
1017
1017
|
"data-mine": e.mine || void 0,
|
|
1018
1018
|
disabled: !gt,
|
|
1019
1019
|
"aria-pressed": e.mine === !0,
|
|
1020
1020
|
onClick: () => t.id && m?.(t.id, e.emoji),
|
|
1021
1021
|
title: gt ? void 0 : e.users?.join(", "),
|
|
1022
|
-
className:
|
|
1023
|
-
}), r = /* @__PURE__ */
|
|
1024
|
-
/* @__PURE__ */
|
|
1025
|
-
className:
|
|
1022
|
+
className: J.reaction
|
|
1023
|
+
}), r = /* @__PURE__ */ K(be, { children: [
|
|
1024
|
+
/* @__PURE__ */ G("span", {
|
|
1025
|
+
className: J.reactionEmoji,
|
|
1026
1026
|
children: e.emoji
|
|
1027
1027
|
}),
|
|
1028
1028
|
" ",
|
|
1029
|
-
/* @__PURE__ */
|
|
1029
|
+
/* @__PURE__ */ G(C, {
|
|
1030
1030
|
value: e.count,
|
|
1031
1031
|
size: "xs",
|
|
1032
1032
|
type: "inherit"
|
|
1033
1033
|
})
|
|
1034
1034
|
] });
|
|
1035
|
-
return gt && e.users?.length ? /* @__PURE__ */
|
|
1035
|
+
return gt && e.users?.length ? /* @__PURE__ */ K(u, { children: [/* @__PURE__ */ G(c, {
|
|
1036
1036
|
render: n,
|
|
1037
1037
|
children: r
|
|
1038
|
-
}), /* @__PURE__ */
|
|
1038
|
+
}), /* @__PURE__ */ G(l, { children: /* @__PURE__ */ G(x, {
|
|
1039
1039
|
items: e.users,
|
|
1040
1040
|
max: 10,
|
|
1041
1041
|
size: "xs",
|
|
1042
1042
|
type: "inherit"
|
|
1043
|
-
}) })] }, e.emoji) :
|
|
1043
|
+
}) })] }, e.emoji) : he(n, { key: e.emoji }, r);
|
|
1044
1044
|
}),
|
|
1045
|
-
gt && /* @__PURE__ */
|
|
1045
|
+
gt && /* @__PURE__ */ G(Ve, {
|
|
1046
1046
|
choices: k,
|
|
1047
|
-
reactions:
|
|
1047
|
+
reactions: Ce,
|
|
1048
1048
|
onPick: (e) => m(t.id, e),
|
|
1049
|
-
copy:
|
|
1049
|
+
copy: P
|
|
1050
1050
|
}),
|
|
1051
|
-
_t && /* @__PURE__ */
|
|
1051
|
+
_t && /* @__PURE__ */ G(Be, {
|
|
1052
1052
|
buttonRef: dt,
|
|
1053
1053
|
onClick: () => h(t.id),
|
|
1054
|
-
className:
|
|
1055
|
-
children:
|
|
1054
|
+
className: J.itemReply,
|
|
1055
|
+
children: P.replyLabel
|
|
1056
1056
|
})
|
|
1057
1057
|
]
|
|
1058
1058
|
})
|
|
1059
1059
|
] })
|
|
1060
1060
|
}),
|
|
1061
|
-
Ze && /* @__PURE__ */
|
|
1062
|
-
className:
|
|
1061
|
+
Ze && /* @__PURE__ */ K("div", {
|
|
1062
|
+
className: J.itemThread,
|
|
1063
1063
|
children: [
|
|
1064
|
-
|
|
1065
|
-
className:
|
|
1064
|
+
Q > 0 && /* @__PURE__ */ G("div", {
|
|
1065
|
+
className: J.threadEntry,
|
|
1066
1066
|
"data-entry": "toggle",
|
|
1067
1067
|
"data-last": Xe === "toggle" || void 0,
|
|
1068
|
-
children: /* @__PURE__ */
|
|
1069
|
-
"aria-expanded":
|
|
1070
|
-
"aria-controls":
|
|
1068
|
+
children: /* @__PURE__ */ G(Be, {
|
|
1069
|
+
"aria-expanded": $,
|
|
1070
|
+
"aria-controls": $ ? Je : void 0,
|
|
1071
1071
|
onClick: () => {
|
|
1072
1072
|
Me((e) => !e), Ue(!1);
|
|
1073
1073
|
},
|
|
1074
|
-
className:
|
|
1075
|
-
children:
|
|
1074
|
+
className: J.repliesToggle,
|
|
1075
|
+
children: $ ? P.hideRepliesLabel : P.formatShowReplies(Q)
|
|
1076
1076
|
})
|
|
1077
1077
|
}),
|
|
1078
|
-
Ke > 0 && /* @__PURE__ */
|
|
1079
|
-
className:
|
|
1078
|
+
Ke > 0 && /* @__PURE__ */ G("div", {
|
|
1079
|
+
className: J.threadEntry,
|
|
1080
1080
|
"data-entry": "toggle",
|
|
1081
1081
|
"data-last": Xe === "earlier" || void 0,
|
|
1082
|
-
children: /* @__PURE__ */
|
|
1082
|
+
children: /* @__PURE__ */ G(Be, {
|
|
1083
1083
|
"aria-controls": Je,
|
|
1084
1084
|
onClick: () => Ue(!0),
|
|
1085
|
-
className:
|
|
1086
|
-
children:
|
|
1085
|
+
className: J.repliesToggle,
|
|
1086
|
+
children: P.formatShowEarlierReplies(Ke)
|
|
1087
1087
|
})
|
|
1088
1088
|
}),
|
|
1089
|
-
qe.length > 0 && /* @__PURE__ */
|
|
1089
|
+
qe.length > 0 && /* @__PURE__ */ G("ul", {
|
|
1090
1090
|
id: Je,
|
|
1091
1091
|
role: "list",
|
|
1092
|
-
"aria-label":
|
|
1093
|
-
className:
|
|
1094
|
-
children: /* @__PURE__ */
|
|
1095
|
-
value:
|
|
1096
|
-
children: qe.map((e, t) => /* @__PURE__ */
|
|
1097
|
-
className:
|
|
1092
|
+
"aria-label": P.formatRepliesLabel(R),
|
|
1093
|
+
className: J.replies,
|
|
1094
|
+
children: /* @__PURE__ */ G(Ae.Provider, {
|
|
1095
|
+
value: F + 1,
|
|
1096
|
+
children: qe.map((e, t) => /* @__PURE__ */ G("li", {
|
|
1097
|
+
className: J.threadEntry,
|
|
1098
1098
|
"data-entry": "reply",
|
|
1099
1099
|
"data-last": Xe === "reply" && t === qe.length - 1 || void 0,
|
|
1100
|
-
children: /* @__PURE__ */
|
|
1100
|
+
children: /* @__PURE__ */ G(He, {
|
|
1101
1101
|
comment: e,
|
|
1102
1102
|
...yt
|
|
1103
1103
|
})
|
|
1104
1104
|
}, e.id ?? `reply-${t}`))
|
|
1105
1105
|
})
|
|
1106
1106
|
}),
|
|
1107
|
-
Ye && /* @__PURE__ */
|
|
1108
|
-
className:
|
|
1107
|
+
Ye && /* @__PURE__ */ G("div", {
|
|
1108
|
+
className: J.threadEntry,
|
|
1109
1109
|
"data-entry": "composer",
|
|
1110
1110
|
"data-last": !0,
|
|
1111
1111
|
children: Ye
|
|
1112
1112
|
})
|
|
1113
1113
|
]
|
|
1114
1114
|
}),
|
|
1115
|
-
!!o && /* @__PURE__ */
|
|
1115
|
+
!!o && /* @__PURE__ */ G(re, {
|
|
1116
1116
|
...we.overlayProps,
|
|
1117
1117
|
destructive: !0,
|
|
1118
|
-
title:
|
|
1119
|
-
description:
|
|
1120
|
-
strings: { confirm:
|
|
1118
|
+
title: P.confirmRemoveAttachmentTitle,
|
|
1119
|
+
description: P.confirmRemoveAttachmentDescription,
|
|
1120
|
+
strings: { confirm: P.attachmentRemoveLabel },
|
|
1121
1121
|
onConfirm: () => {
|
|
1122
|
-
|
|
1122
|
+
Ee && t.id && o(t.id, Ee);
|
|
1123
1123
|
}
|
|
1124
1124
|
})
|
|
1125
1125
|
]
|
|
@@ -1127,11 +1127,11 @@ function Ve({ comment: t, replies: r, canModerate: i, onDelete: a, onAttachmentR
|
|
|
1127
1127
|
}
|
|
1128
1128
|
//#endregion
|
|
1129
1129
|
//#region src/components/features/comments/comment-timeline.tsx
|
|
1130
|
-
function
|
|
1130
|
+
function Ue({ comments: t, canModerate: n, onDelete: r, onAttachmentRemove: i, onEdit: o, onPinToggle: s, onReact: c, onReply: l, allowReactions: u, allowReplies: d, commentActions: f, maxVisibleReplies: p, clampLines: m, maxVisibleAttachments: h, reactionChoices: g, sanitizer: _, strings: v, getMediaUrl: y, getMediaName: b, getStatusLabel: x, resources: S, renderItem: C, renderAttachment: w, renderReference: ee, emptySlot: T, className: E }) {
|
|
1131
1131
|
let D = {
|
|
1132
|
-
...
|
|
1132
|
+
...q,
|
|
1133
1133
|
...v
|
|
1134
|
-
}, { roots: O, repliesByParent: k } =
|
|
1134
|
+
}, { roots: O, repliesByParent: k } = H(() => {
|
|
1135
1135
|
let e = new Set(t.map((e) => e.id).filter(Boolean)), n = /* @__PURE__ */ new Map(), r = [];
|
|
1136
1136
|
for (let i of t) if (i.replyToId && e.has(i.replyToId)) {
|
|
1137
1137
|
let e = n.get(i.replyToId) ?? [];
|
|
@@ -1142,20 +1142,20 @@ function He({ comments: t, canModerate: n, onDelete: r, onAttachmentRemove: i, o
|
|
|
1142
1142
|
repliesByParent: n
|
|
1143
1143
|
};
|
|
1144
1144
|
}, [t]);
|
|
1145
|
-
return t.length === 0 ? /* @__PURE__ */
|
|
1145
|
+
return t.length === 0 ? /* @__PURE__ */ G(be, { children: T ?? /* @__PURE__ */ G(a, {
|
|
1146
1146
|
padding: "sm",
|
|
1147
|
-
media: /* @__PURE__ */
|
|
1147
|
+
media: /* @__PURE__ */ G(I, {}),
|
|
1148
1148
|
mediaVariant: "icon",
|
|
1149
1149
|
title: D.empty,
|
|
1150
1150
|
description: D.emptyHint
|
|
1151
|
-
}) }) : /* @__PURE__ */
|
|
1151
|
+
}) }) : /* @__PURE__ */ G(ke.Provider, {
|
|
1152
1152
|
value: k,
|
|
1153
|
-
children: /* @__PURE__ */
|
|
1153
|
+
children: /* @__PURE__ */ G("ul", {
|
|
1154
1154
|
role: "list",
|
|
1155
1155
|
"data-slot": "comment-timeline",
|
|
1156
|
-
className: e("comment-timeline--component",
|
|
1156
|
+
className: e("comment-timeline--component", J.timeline, E),
|
|
1157
1157
|
children: O.map((e, t) => {
|
|
1158
|
-
let a = /* @__PURE__ */
|
|
1158
|
+
let a = /* @__PURE__ */ G(He, {
|
|
1159
1159
|
comment: e,
|
|
1160
1160
|
replies: d === !1 ? void 0 : k.get(e.id ?? ""),
|
|
1161
1161
|
canModerate: n,
|
|
@@ -1181,8 +1181,8 @@ function He({ comments: t, canModerate: n, onDelete: r, onAttachmentRemove: i, o
|
|
|
1181
1181
|
renderAttachment: w,
|
|
1182
1182
|
renderReference: ee
|
|
1183
1183
|
});
|
|
1184
|
-
return /* @__PURE__ */
|
|
1185
|
-
className:
|
|
1184
|
+
return /* @__PURE__ */ G("li", {
|
|
1185
|
+
className: J.timelineEntry,
|
|
1186
1186
|
children: C ? C({
|
|
1187
1187
|
comment: e,
|
|
1188
1188
|
canModerate: n ?? !1,
|
|
@@ -1198,20 +1198,20 @@ function He({ comments: t, canModerate: n, onDelete: r, onAttachmentRemove: i, o
|
|
|
1198
1198
|
}
|
|
1199
1199
|
//#endregion
|
|
1200
1200
|
//#region src/components/features/comments/use-comments.ts
|
|
1201
|
-
function
|
|
1202
|
-
let { onSubmit: t, onUpdate: n, onDelete: r, onAfterMutate: i, onError: a, scopeKey: o } = e, [s, c] =
|
|
1201
|
+
function We(e = {}) {
|
|
1202
|
+
let { onSubmit: t, onUpdate: n, onDelete: r, onAfterMutate: i, onError: a, scopeKey: o } = e, [s, c] = W({ kind: "idle" }), [l, u] = W(!1), [d, f] = W({}), [p, m] = W(0), h = U(!1), g = U(o), _ = U(0), v = U(0), y = B((e) => {
|
|
1203
1203
|
h.current = e, u(e);
|
|
1204
|
-
}, []), b =
|
|
1204
|
+
}, []), b = B(() => {
|
|
1205
1205
|
m((e) => e + 1), c({ kind: "idle" }), f({});
|
|
1206
|
-
}, []), x =
|
|
1206
|
+
}, []), x = H(() => ({
|
|
1207
1207
|
setErrors: f,
|
|
1208
1208
|
reset: b,
|
|
1209
1209
|
setSubmitting: y
|
|
1210
1210
|
}), [b, y]);
|
|
1211
|
-
|
|
1211
|
+
V(() => {
|
|
1212
1212
|
g.current !== o && (g.current = o, _.current += 1, v.current += 1, h.current = !1, u(!1), b());
|
|
1213
1213
|
}, [b, o]);
|
|
1214
|
-
let S =
|
|
1214
|
+
let S = B((e) => {
|
|
1215
1215
|
try {
|
|
1216
1216
|
a?.(e);
|
|
1217
1217
|
} catch {}
|
|
@@ -1221,21 +1221,21 @@ function Ue(e = {}) {
|
|
|
1221
1221
|
isSubmitting: l,
|
|
1222
1222
|
formErrors: d,
|
|
1223
1223
|
resetKey: p,
|
|
1224
|
-
startReply:
|
|
1224
|
+
startReply: B((e) => {
|
|
1225
1225
|
e.id && (f({}), c({
|
|
1226
1226
|
kind: "replying",
|
|
1227
1227
|
commentId: e.id,
|
|
1228
1228
|
authorName: e.user?.name
|
|
1229
1229
|
}));
|
|
1230
1230
|
}, []),
|
|
1231
|
-
startEdit:
|
|
1231
|
+
startEdit: B((e) => {
|
|
1232
1232
|
e.id && (f({}), c({
|
|
1233
1233
|
kind: "editing",
|
|
1234
1234
|
comment: e
|
|
1235
1235
|
}));
|
|
1236
1236
|
}, []),
|
|
1237
|
-
cancelComposerMode:
|
|
1238
|
-
submit:
|
|
1237
|
+
cancelComposerMode: B(() => b(), [b]),
|
|
1238
|
+
submit: B(async (e) => {
|
|
1239
1239
|
if (h.current) return;
|
|
1240
1240
|
let r = _.current, a = v.current + 1;
|
|
1241
1241
|
v.current = a;
|
|
@@ -1275,7 +1275,7 @@ function Ue(e = {}) {
|
|
|
1275
1275
|
b,
|
|
1276
1276
|
y
|
|
1277
1277
|
]),
|
|
1278
|
-
deleteComment:
|
|
1278
|
+
deleteComment: B(async (e) => {
|
|
1279
1279
|
if (!(!r || !e)) try {
|
|
1280
1280
|
await r(e), i?.("delete", { commentId: e });
|
|
1281
1281
|
} catch (e) {
|
|
@@ -1292,52 +1292,52 @@ function Ue(e = {}) {
|
|
|
1292
1292
|
}
|
|
1293
1293
|
//#endregion
|
|
1294
1294
|
//#region src/components/features/comments/comments.tsx
|
|
1295
|
-
function
|
|
1296
|
-
let { context:
|
|
1297
|
-
...
|
|
1295
|
+
function Ge(t) {
|
|
1296
|
+
let { context: n, comments: r, canComment: i = !0, canModerate: a = !1, composerPosition: o = "top", maxAttachments: s, allowAttachments: c = !0, allowReactions: l = !0, allowReplies: u = !0, bare: d = !1, confirmDelete: f = !0, className: p, strings: g } = t, _ = {
|
|
1297
|
+
...q,
|
|
1298
1298
|
...g
|
|
1299
|
-
}, v = t.title ?? _.title, y = `${
|
|
1299
|
+
}, v = t.title ?? _.title, y = `${n.type}\u0000${n.id}\u0000${n.moduleKey ?? ""}`, b = U(y), x = {
|
|
1300
1300
|
onSubmit: t.onSubmit,
|
|
1301
1301
|
onUpdate: t.onUpdate,
|
|
1302
1302
|
onDelete: t.onDelete,
|
|
1303
1303
|
onAfterMutate: t.onAfterMutate,
|
|
1304
1304
|
onError: t.onError,
|
|
1305
1305
|
scopeKey: y
|
|
1306
|
-
}, S =
|
|
1307
|
-
|
|
1306
|
+
}, S = We(x), C = We(x), w = ne(), [ee, T] = W(null);
|
|
1307
|
+
V(() => {
|
|
1308
1308
|
b.current !== y && (b.current = y, T(null), w.hide());
|
|
1309
1309
|
}, [y, w]);
|
|
1310
|
-
let E =
|
|
1311
|
-
if (!
|
|
1310
|
+
let E = B((e) => {
|
|
1311
|
+
if (!f) {
|
|
1312
1312
|
S.deleteComment(e);
|
|
1313
1313
|
return;
|
|
1314
1314
|
}
|
|
1315
1315
|
T(e), w.show();
|
|
1316
1316
|
}, [
|
|
1317
|
-
|
|
1317
|
+
f,
|
|
1318
1318
|
w,
|
|
1319
1319
|
S
|
|
1320
|
-
]), { startReply: D, cancelComposerMode: O } = C, { onReply: k } = t,
|
|
1321
|
-
let t =
|
|
1320
|
+
]), { startReply: D, cancelComposerMode: O } = C, { onReply: k } = t, te = B((e) => {
|
|
1321
|
+
let t = r.find((t) => t.id === e);
|
|
1322
1322
|
t && D(t), k?.(e);
|
|
1323
1323
|
}, [
|
|
1324
|
-
|
|
1324
|
+
r,
|
|
1325
1325
|
k,
|
|
1326
1326
|
D
|
|
1327
|
-
]),
|
|
1328
|
-
commentId:
|
|
1329
|
-
authorName:
|
|
1330
|
-
} : void 0,
|
|
1331
|
-
|
|
1332
|
-
|
|
1327
|
+
]), A = C.composerMode, j = A.kind === "editing" ? A.comment : void 0, ie = A.kind === "replying" ? {
|
|
1328
|
+
commentId: A.commentId,
|
|
1329
|
+
authorName: A.authorName
|
|
1330
|
+
} : void 0, M = j?.id ?? ie?.commentId;
|
|
1331
|
+
V(() => {
|
|
1332
|
+
M && !r.some((e) => e.id === M) && O();
|
|
1333
1333
|
}, [
|
|
1334
1334
|
O,
|
|
1335
|
-
|
|
1336
|
-
|
|
1335
|
+
r,
|
|
1336
|
+
M
|
|
1337
1337
|
]);
|
|
1338
|
-
let
|
|
1339
|
-
context:
|
|
1340
|
-
canComment:
|
|
1338
|
+
let ae = t.composerSlot ?? (i ? /* @__PURE__ */ G(Z, {
|
|
1339
|
+
context: n,
|
|
1340
|
+
canComment: i,
|
|
1341
1341
|
submitting: S.isSubmitting,
|
|
1342
1342
|
errors: S.formErrors,
|
|
1343
1343
|
resetKey: S.resetKey,
|
|
@@ -1346,41 +1346,41 @@ function We(t) {
|
|
|
1346
1346
|
resources: t.resources,
|
|
1347
1347
|
onResourceSearch: t.onResourceSearch,
|
|
1348
1348
|
attachments: t.attachments,
|
|
1349
|
-
maxAttachments:
|
|
1350
|
-
allowAttachments:
|
|
1351
|
-
}) : null),
|
|
1352
|
-
composer:
|
|
1353
|
-
context:
|
|
1354
|
-
canComment:
|
|
1349
|
+
maxAttachments: s,
|
|
1350
|
+
allowAttachments: c
|
|
1351
|
+
}) : null), oe = {
|
|
1352
|
+
composer: i && M ? /* @__PURE__ */ G(Z, {
|
|
1353
|
+
context: n,
|
|
1354
|
+
canComment: i,
|
|
1355
1355
|
submitting: C.isSubmitting,
|
|
1356
1356
|
errors: C.formErrors,
|
|
1357
1357
|
resetKey: C.resetKey,
|
|
1358
|
-
editingComment:
|
|
1359
|
-
replyingTo:
|
|
1358
|
+
editingComment: j,
|
|
1359
|
+
replyingTo: ie,
|
|
1360
1360
|
onCancel: C.cancelComposerMode,
|
|
1361
1361
|
onSubmit: C.submit,
|
|
1362
|
-
placeholder:
|
|
1362
|
+
placeholder: j ? _.editPlaceholder : _.replyPlaceholder,
|
|
1363
1363
|
strings: g,
|
|
1364
1364
|
resources: t.resources,
|
|
1365
1365
|
onResourceSearch: t.onResourceSearch,
|
|
1366
1366
|
attachments: t.attachments,
|
|
1367
|
-
maxAttachments:
|
|
1368
|
-
allowAttachments:
|
|
1369
|
-
className:
|
|
1370
|
-
}, `${
|
|
1371
|
-
editingId:
|
|
1372
|
-
replyingToId:
|
|
1373
|
-
},
|
|
1374
|
-
comments:
|
|
1375
|
-
canModerate:
|
|
1367
|
+
maxAttachments: s,
|
|
1368
|
+
allowAttachments: c,
|
|
1369
|
+
className: J.inlineComposer
|
|
1370
|
+
}, `${A.kind}:${M}`) : void 0,
|
|
1371
|
+
editingId: j?.id,
|
|
1372
|
+
replyingToId: ie?.commentId
|
|
1373
|
+
}, se = /* @__PURE__ */ G(Ue, {
|
|
1374
|
+
comments: r,
|
|
1375
|
+
canModerate: a,
|
|
1376
1376
|
onDelete: t.onDelete ? E : void 0,
|
|
1377
1377
|
onAttachmentRemove: t.onAttachmentRemove,
|
|
1378
|
-
onEdit:
|
|
1378
|
+
onEdit: i && t.onUpdate ? C.startEdit : void 0,
|
|
1379
1379
|
onPinToggle: t.onPinToggle,
|
|
1380
1380
|
onReact: t.onReact,
|
|
1381
|
-
onReply:
|
|
1382
|
-
allowReactions:
|
|
1383
|
-
allowReplies:
|
|
1381
|
+
onReply: i && u ? te : void 0,
|
|
1382
|
+
allowReactions: l,
|
|
1383
|
+
allowReplies: u,
|
|
1384
1384
|
commentActions: t.commentActions,
|
|
1385
1385
|
maxVisibleReplies: t.maxVisibleReplies,
|
|
1386
1386
|
clampLines: t.clampLines,
|
|
@@ -1396,20 +1396,20 @@ function We(t) {
|
|
|
1396
1396
|
renderAttachment: t.renderAttachment,
|
|
1397
1397
|
renderReference: t.renderReference,
|
|
1398
1398
|
emptySlot: t.emptySlot
|
|
1399
|
-
}),
|
|
1399
|
+
}), N = /* @__PURE__ */ K(h, {
|
|
1400
1400
|
gap: "xl",
|
|
1401
|
-
className:
|
|
1401
|
+
className: J.body,
|
|
1402
1402
|
children: [
|
|
1403
1403
|
t.headerSlot,
|
|
1404
|
-
|
|
1405
|
-
/* @__PURE__ */
|
|
1406
|
-
value:
|
|
1407
|
-
children:
|
|
1404
|
+
o === "top" && ae,
|
|
1405
|
+
/* @__PURE__ */ G(je.Provider, {
|
|
1406
|
+
value: oe,
|
|
1407
|
+
children: se
|
|
1408
1408
|
}),
|
|
1409
|
-
|
|
1409
|
+
o === "bottom" && ae,
|
|
1410
1410
|
t.footerSlot
|
|
1411
1411
|
]
|
|
1412
|
-
}),
|
|
1412
|
+
}), P = !!(f && t.onDelete) && /* @__PURE__ */ G(re, {
|
|
1413
1413
|
...w.overlayProps,
|
|
1414
1414
|
destructive: !0,
|
|
1415
1415
|
title: _.confirmDeleteTitle,
|
|
@@ -1420,26 +1420,20 @@ function We(t) {
|
|
|
1420
1420
|
},
|
|
1421
1421
|
onError: t.onError
|
|
1422
1422
|
});
|
|
1423
|
-
return
|
|
1423
|
+
return d ? /* @__PURE__ */ K(be, { children: [N, P] }) : /* @__PURE__ */ K("section", {
|
|
1424
1424
|
"data-slot": "comments",
|
|
1425
1425
|
"aria-label": typeof v == "string" ? v : void 0,
|
|
1426
|
-
className: e("comments--component",
|
|
1426
|
+
className: e("comments--component", J.root, p),
|
|
1427
1427
|
children: [
|
|
1428
|
-
v !== !1 && !!(v || _.subtitle) && /* @__PURE__ */
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
weight: "semibold",
|
|
1433
|
-
children: v
|
|
1434
|
-
}), !!_.subtitle && /* @__PURE__ */ J(n, {
|
|
1435
|
-
type: "secondary",
|
|
1436
|
-
children: _.subtitle
|
|
1437
|
-
})]
|
|
1428
|
+
v !== !1 && !!(v || _.subtitle) && /* @__PURE__ */ G(m, {
|
|
1429
|
+
title: v || void 0,
|
|
1430
|
+
description: _.subtitle || void 0,
|
|
1431
|
+
className: J.header
|
|
1438
1432
|
}),
|
|
1439
|
-
|
|
1440
|
-
|
|
1433
|
+
N,
|
|
1434
|
+
P
|
|
1441
1435
|
]
|
|
1442
1436
|
});
|
|
1443
1437
|
}
|
|
1444
1438
|
//#endregion
|
|
1445
|
-
export {
|
|
1439
|
+
export { Pe as a, Te as c, He as i, q as l, We as n, Z as o, Ue as r, De as s, Ge as t };
|