themelia-react-ui 1.0.0 → 1.0.2
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/CHANGELOG.md +190 -1
- package/README.md +92 -13
- package/dist/{accordion-BRWh3BM1.js → accordion-BRTcsp8J.js} +8 -8
- package/dist/accordion-BRTcsp8J.js.map +1 -0
- package/dist/{action-menu-Cx3SdfbN.js → action-menu-Drxw_vJk.js} +36 -36
- package/dist/action-menu-Drxw_vJk.js.map +1 -0
- package/dist/affordance-geometry.generated-CL84ZN9A.js +63 -0
- package/dist/affordance-geometry.generated-CL84ZN9A.js.map +1 -0
- package/dist/{ai-artifact-DkOArd3-.js → ai-artifact-DLVdK0Py.js} +151 -155
- package/dist/ai-artifact-DLVdK0Py.js.map +1 -0
- package/dist/{app-shell-BH_bGcE2.js → app-shell-C_fKpljx.js} +11 -10
- package/dist/app-shell-C_fKpljx.js.map +1 -0
- package/dist/{attachment-DsLgNHXt.js → attachment-DbjUWsP0.js} +12 -12
- package/dist/{attachment-DsLgNHXt.js.map → attachment-DbjUWsP0.js.map} +1 -1
- package/dist/auth-CAQcasMV.js +723 -0
- package/dist/auth-CAQcasMV.js.map +1 -0
- package/dist/{avatar-CsnWaYmt.js → avatar-Bu2HhitA.js} +76 -71
- package/dist/avatar-Bu2HhitA.js.map +1 -0
- package/dist/{badge-BZXZT9wd.js → badge-CzId1Wlm.js} +4 -4
- package/dist/{badge-BZXZT9wd.js.map → badge-CzId1Wlm.js.map} +1 -1
- package/dist/base/accordion.js +1 -1
- package/dist/base/action-menu.js +1 -1
- package/dist/base/attachment.js +1 -1
- package/dist/base/avatar.js +1 -1
- package/dist/base/badge.js +1 -1
- package/dist/base/buttons.js +3 -2
- package/dist/base/cards.js +3 -3
- package/dist/base/carousel.js +25 -27
- package/dist/base/carousel.js.map +1 -1
- package/dist/base/cascader.js +150 -148
- package/dist/base/cascader.js.map +1 -1
- package/dist/base/chart.js +1 -1
- package/dist/base/choice-inputs.js +3 -2
- package/dist/base/code-block.js +1 -1
- package/dist/base/combobox.js +1 -1
- package/dist/base/command.js +1 -1
- package/dist/base/copyable.js +1 -1
- package/dist/base/date-pickers.js +3 -3
- package/dist/base/display.js +7 -7
- package/dist/base/feedback.js +4 -3
- package/dist/base/forms-numeric.js +1 -1
- package/dist/base/forms.js +2 -2
- package/dist/base/inline-edit.js +233 -0
- package/dist/base/inline-edit.js.map +1 -0
- package/dist/base/item.js +1 -1
- package/dist/base/media-gallery.js +1 -1
- package/dist/base/navigation.js +6 -6
- package/dist/base/popover-menu.js +1 -1
- package/dist/base/popover.js +1 -1
- package/dist/base/qr-code.js +1 -1
- package/dist/base/repeaters.js +33 -33
- package/dist/base/repeaters.js.map +1 -1
- package/dist/base/sheet.js +1 -1
- package/dist/base/sidebar.js +1 -1
- package/dist/base/signature-pad.js +83 -81
- package/dist/base/signature-pad.js.map +1 -1
- package/dist/base/skeleton.js +1 -1
- package/dist/base/spinner.js +1 -1
- package/dist/base/structure.js +1 -1
- package/dist/base/table.js +1 -1
- package/dist/base/text-inputs.js +2 -2
- package/dist/base/toaster.js +6 -6
- package/dist/base/toaster.js.map +1 -1
- package/dist/base/tree.js +1 -1
- package/dist/base/upload-queue.js +1 -1
- package/dist/base/upload.js +3 -3
- package/dist/base/value-inputs.js +1 -1
- package/dist/blocks/admin.js +134 -134
- package/dist/blocks/admin.js.map +1 -1
- package/dist/blocks/ai.js +120 -117
- package/dist/blocks/ai.js.map +1 -1
- package/dist/blocks/analytics/usage-card.js +3 -0
- package/dist/blocks/analytics.js +530 -491
- package/dist/blocks/analytics.js.map +1 -1
- package/dist/blocks/collaboration.js +2 -2
- package/dist/blocks/commerce/receipt.js +1 -1
- package/dist/blocks/commerce.js +395 -383
- package/dist/blocks/commerce.js.map +1 -1
- package/dist/blocks/data-display.js +1 -1
- package/dist/blocks/onboarding.js +6 -6
- package/dist/blocks/onboarding.js.map +1 -1
- package/dist/blocks/planning.js +311 -0
- package/dist/blocks/planning.js.map +1 -0
- package/dist/blocks/timelines.js +1 -1
- package/dist/{breadcrumbs-DdQ_I5ra.js → breadcrumbs-BuYz5SDU.js} +9 -8
- package/dist/breadcrumbs-BuYz5SDU.js.map +1 -0
- package/dist/button-BZDasD04.js +651 -0
- package/dist/button-BZDasD04.js.map +1 -0
- package/dist/{button-BS6l5JUw.js → button-BZyfTvwm.js} +3 -3
- package/dist/button-BZyfTvwm.js.map +1 -0
- package/dist/buttons-D_6KJvEE.js +99 -0
- package/dist/buttons-D_6KJvEE.js.map +1 -0
- package/dist/{cards-BMB0laLG.js → cards-qGSErLw_.js} +12 -12
- package/dist/{cards-BMB0laLG.js.map → cards-qGSErLw_.js.map} +1 -1
- package/dist/chart-Bsc5BICK.js +150 -0
- package/dist/chart-Bsc5BICK.js.map +1 -0
- package/dist/checkbox-BQNDjUCh.js +34 -0
- package/dist/checkbox-BQNDjUCh.js.map +1 -0
- package/dist/choice-inputs-Mk3iWbhr.js +725 -0
- package/dist/choice-inputs-Mk3iWbhr.js.map +1 -0
- package/dist/{code-block-DIlqzoiD.js → code-block-DzHKRybS.js} +23 -23
- package/dist/code-block-DzHKRybS.js.map +1 -0
- package/dist/{collapsible-DsnktFNv.js → collapsible-ClvC7Bj3.js} +3 -3
- package/dist/{collapsible-DsnktFNv.js.map → collapsible-ClvC7Bj3.js.map} +1 -1
- package/dist/{collection-content-C4fthJV_.js → collection-content-D6S8cv_n.js} +3 -3
- package/dist/{collection-content-C4fthJV_.js.map → collection-content-D6S8cv_n.js.map} +1 -1
- package/dist/{combobox-HDftpzxt.js → combobox-BFnbJJp3.js} +18 -18
- package/dist/combobox-BFnbJJp3.js.map +1 -0
- package/dist/{combobox-CHD750do.js → combobox-hozNwUcc.js} +313 -316
- package/dist/combobox-hozNwUcc.js.map +1 -0
- package/dist/{command-D0kWBZfd.js → command-BnmSchli.js} +9 -9
- package/dist/command-BnmSchli.js.map +1 -0
- package/dist/comments-u5L0OGip.js +1156 -0
- package/dist/comments-u5L0OGip.js.map +1 -0
- package/dist/components/base/buttons/button-group.recipes.d.ts +1 -1
- package/dist/components/base/buttons/button.recipes.d.ts +10 -19
- package/dist/components/base/buttons/use-pending-button-focus.d.ts +3 -0
- package/dist/components/base/cards/card.recipes.d.ts +13 -5
- package/dist/components/base/cards/partials/card-primitives.d.ts +9 -4
- package/dist/components/base/cards/smart-card.types.d.ts +3 -1
- package/dist/components/base/date-pickers/date-picker.recipes.d.ts +5 -18
- package/dist/components/base/date-pickers/datepicker.types.d.ts +3 -0
- package/dist/components/base/forms/form-field.d.ts +1 -0
- package/dist/components/base/forms/form-sizing.d.ts +3 -3
- package/dist/components/base/inline-edit/index.d.ts +2 -0
- package/dist/components/base/inline-edit/inline-edit.d.ts +81 -0
- package/dist/components/base/inline-edit/inline-edit.recipes.d.ts +6 -0
- package/dist/components/base/navigation/tabs.d.ts +3 -5
- package/dist/components/base/popover/popover.recipes.d.ts +3 -3
- package/dist/components/base/structure/structure.recipes.d.ts +6 -0
- package/dist/components/base/table/index.d.ts +1 -1
- package/dist/components/base/text-inputs/clear-native-field.d.ts +2 -0
- package/dist/components/base/text-inputs/input-trailing-action.d.ts +3 -0
- package/dist/components/blocks/analytics/index.d.ts +1 -0
- package/dist/components/blocks/analytics/types.d.ts +1 -1
- package/dist/components/blocks/analytics/usage-card/index.d.ts +3 -0
- package/dist/components/blocks/analytics/usage-card/types.d.ts +52 -0
- package/dist/components/blocks/analytics/usage-card/usage-card.d.ts +6 -0
- package/dist/components/blocks/analytics/usage-card/usage-card.data.d.ts +19 -0
- package/dist/components/blocks/analytics/usage-card/usage-card.strings.d.ts +22 -0
- package/dist/components/blocks/collaboration/message/message.recipes.d.ts +12 -0
- package/dist/components/blocks/data-display/empty-state/partials/illustrations/document-stack.d.ts +1 -4
- package/dist/components/blocks/data-display/empty-state/partials/illustrations/inbox-clean.d.ts +1 -4
- package/dist/components/blocks/data-display/empty-state/partials/illustrations/index.d.ts +3 -3
- package/dist/components/blocks/data-display/empty-state/partials/illustrations/stacked-cards.d.ts +1 -6
- package/dist/components/blocks/planning/index.d.ts +3 -0
- package/dist/components/blocks/planning/task-card.d.ts +3 -0
- package/dist/components/blocks/planning/task-card.strings.d.ts +15 -0
- package/dist/components/blocks/planning/task-card.types.d.ts +66 -0
- package/dist/components/features/combobox/components/error-message.d.ts +1 -1
- package/dist/components/features/comments/hooks/use-attachment-upload.d.ts +5 -0
- package/dist/components/features/filters/facets/search-facet.d.ts +0 -12
- package/dist/components/features/filters/facets/tags-facet.d.ts +1 -1
- package/dist/components/features/media-library/media-library.d.ts +1 -1
- package/dist/components/features/media-library/media-library.types.d.ts +9 -1
- package/dist/components/features/media-library/partials/media-library-partials.d.ts +1 -1
- package/dist/components/features/overlays/hooks/use-pending-overlay-focus.d.ts +2 -0
- package/dist/components/features/overlays/overlays.types.d.ts +5 -4
- package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +2 -1
- package/dist/components/features/table/data-table.d.ts +1 -1
- package/dist/components/features/table/table.types.d.ts +1 -1
- package/dist/components/features/theme-tweaker/theme-provider-settings.d.ts +3 -1
- package/dist/components/layout/auth/auth.types.d.ts +1 -0
- package/dist/components/layout/page/page.d.ts +0 -1
- package/dist/components/layout/page/page.types.d.ts +9 -3
- package/dist/components/layout/sidebar/sidebar.context.d.ts +1 -1
- package/dist/components/layout/sidebar/sidebar.types.d.ts +4 -0
- package/dist/components/layout/workspace/workspace.types.d.ts +3 -0
- package/dist/components/typography/heading.d.ts +5 -2
- package/dist/components/typography/index.d.ts +1 -1
- package/dist/components/typography/text.styles.d.ts +10 -0
- package/dist/components/ui/popover.d.ts +1 -1
- package/dist/components/ui/sidebar.d.ts +1 -1
- package/dist/components/ui/table.d.ts +2 -1
- package/dist/container.recipes-D9t8MHR3.js +27 -0
- package/dist/container.recipes-D9t8MHR3.js.map +1 -0
- package/dist/{containers-CPNyNo1_.js → containers-DqB-bSYE.js} +34 -56
- package/dist/containers-DqB-bSYE.js.map +1 -0
- package/dist/control-group-recipes-DBXmfh2E.js +21 -0
- package/dist/control-group-recipes-DBXmfh2E.js.map +1 -0
- package/dist/{copyable-B7SBXJMr.js → copyable-BTSByfmq.js} +6 -6
- package/dist/{copyable-B7SBXJMr.js.map → copyable-BTSByfmq.js.map} +1 -1
- package/dist/{data-display-b3d1TfL4.js → data-display-Bihs9Ven.js} +542 -329
- package/dist/data-display-Bihs9Ven.js.map +1 -0
- package/dist/{date-BFNMnrS5.js → date-DOKhJPu7.js} +4 -4
- package/dist/{date-BFNMnrS5.js.map → date-DOKhJPu7.js.map} +1 -1
- package/dist/{date-picker-DI6kPNof.js → date-picker-DzP5HQq7.js} +492 -472
- package/dist/date-picker-DzP5HQq7.js.map +1 -0
- package/dist/date-pickers-BpgGz7S-.js +196 -0
- package/dist/date-pickers-BpgGz7S-.js.map +1 -0
- package/dist/{display-ByI5tkqy.js → display-CS6Hbk18.js} +8 -8
- package/dist/{display-ByI5tkqy.js.map → display-CS6Hbk18.js.map} +1 -1
- package/dist/{dropdown-menu-BlnyHr-9.js → dropdown-menu-D-boNgGO.js} +7 -7
- package/dist/{dropdown-menu-BlnyHr-9.js.map → dropdown-menu-D-boNgGO.js.map} +1 -1
- package/dist/features/activities.js +152 -141
- package/dist/features/activities.js.map +1 -1
- package/dist/features/ai-chat.js +182 -179
- package/dist/features/ai-chat.js.map +1 -1
- package/dist/features/async-preview.js +9 -9
- package/dist/features/async-preview.js.map +1 -1
- package/dist/features/combobox.js +1 -1
- package/dist/features/comments.js +1 -1
- package/dist/features/data-view.js +25 -23
- package/dist/features/data-view.js.map +1 -1
- package/dist/features/email-composer/engine.js +1 -1
- package/dist/features/email-composer.js +103 -104
- package/dist/features/email-composer.js.map +1 -1
- package/dist/features/event-calendar.js +375 -373
- package/dist/features/event-calendar.js.map +1 -1
- package/dist/features/filters.js +1 -1
- package/dist/features/global-search.js +222 -224
- package/dist/features/global-search.js.map +1 -1
- package/dist/features/kanban.js +29 -29
- package/dist/features/kanban.js.map +1 -1
- package/dist/features/map.js +59 -58
- package/dist/features/map.js.map +1 -1
- package/dist/features/media-library.js +856 -855
- package/dist/features/media-library.js.map +1 -1
- package/dist/features/mentions.js +1 -1
- package/dist/features/overlays.js +1 -1
- package/dist/features/products.js +1210 -1209
- package/dist/features/products.js.map +1 -1
- package/dist/features/questionnaire.js +133 -132
- package/dist/features/questionnaire.js.map +1 -1
- package/dist/features/resource-assignment.js +29 -31
- package/dist/features/resource-assignment.js.map +1 -1
- package/dist/features/resource.js +13 -13
- package/dist/features/resource.js.map +1 -1
- package/dist/features/rich-text-editor.js +2 -2
- package/dist/features/schema-form.js +82 -82
- package/dist/features/schema-form.js.map +1 -1
- package/dist/features/suggestions.js +3 -3
- package/dist/features/sync.js +4 -4
- package/dist/features/sync.js.map +1 -1
- package/dist/features/table.js +1 -1
- package/dist/features/theme-tweaker.js +456 -450
- package/dist/features/theme-tweaker.js.map +1 -1
- package/dist/feedback-CJkUAapr.js +233 -0
- package/dist/feedback-CJkUAapr.js.map +1 -0
- package/dist/field-affordance-recipes-uKY4MsZ_.js +25 -0
- package/dist/field-affordance-recipes-uKY4MsZ_.js.map +1 -0
- package/dist/{field-state-recipes-CBTRt9Bt.js → field-state-recipes-DQQpiLWC.js} +3 -3
- package/dist/field-state-recipes-DQQpiLWC.js.map +1 -0
- package/dist/{filters-qtrcv1hf.js → filters-D6FF8L6s.js} +715 -720
- package/dist/filters-D6FF8L6s.js.map +1 -0
- package/dist/{form-field-C6W-y2hR.js → form-field-CZwrkP7m.js} +17 -9
- package/dist/form-field-CZwrkP7m.js.map +1 -0
- package/dist/{form-sizing-39NohSqn.js → form-sizing-QP8aIRaW.js} +10 -6
- package/dist/form-sizing-QP8aIRaW.js.map +1 -0
- package/dist/{forms-BF-HSbff.js → forms-B5NCbkSC.js} +35 -35
- package/dist/{forms-BF-HSbff.js.map → forms-B5NCbkSC.js.map} +1 -1
- package/dist/forms-numeric-Crrm80Lm.js +867 -0
- package/dist/forms-numeric-Crrm80Lm.js.map +1 -0
- package/dist/{header-B8ex54cY.js → header-kxruN3RM.js} +53 -49
- package/dist/header-kxruN3RM.js.map +1 -0
- package/dist/{hooks-D6UBVzf2.js → hooks-BrlnCwQd.js} +2 -2
- package/dist/{hooks-D6UBVzf2.js.map → hooks-BrlnCwQd.js.map} +1 -1
- package/dist/{http-CLTVJc5I.js → http-CdEIHyQf.js} +2 -2
- package/dist/http-CdEIHyQf.js.map +1 -0
- package/dist/{icon-badge-Dv0RYQwj.js → icon-badge-Btc6pQrp.js} +4 -4
- package/dist/{icon-badge-Dv0RYQwj.js.map → icon-badge-Btc6pQrp.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/input-SX9V0AL3.js +255 -0
- package/dist/input-SX9V0AL3.js.map +1 -0
- package/dist/input-vxcaNCYC.js +20 -0
- package/dist/input-vxcaNCYC.js.map +1 -0
- package/dist/{item-pJ0GsOiJ.js → item-DE4YnuJx.js} +18 -17
- package/dist/item-DE4YnuJx.js.map +1 -0
- package/dist/layout/app-shell.js +1 -1
- package/dist/layout/auth.js +1 -1
- package/dist/layout/containers.js +1 -1
- package/dist/layout/header.js +1 -1
- package/dist/layout/hooks.js +1 -1
- package/dist/layout/navigation.js +1 -1
- package/dist/layout/page.js +1 -1
- package/dist/layout/settings.js +1 -1
- package/dist/layout/sidebar.js +2 -2
- package/dist/layout/workspace.js +1 -1
- package/dist/layout.js +10 -10
- package/dist/lib/affordance-geometry.generated.d.ts +44 -4
- package/dist/lib/control-group-recipes.d.ts +22 -0
- package/dist/lib/field-affordance-recipes.d.ts +35 -2
- package/dist/lib/field-state-recipes.d.ts +2 -2
- package/dist/lib/navigation-row-recipes.d.ts +3 -2
- package/dist/lib/overlay-anatomy-recipes.d.ts +1 -1
- package/dist/lib/surface-recipes.d.ts +5 -2
- package/dist/lib/token-merge.generated.d.ts +144 -2
- package/dist/lib/ui-provider/types.d.ts +4 -2
- package/dist/lib/use-prefers-reduced-motion.d.ts +2 -0
- package/dist/lib/utils.js +1 -1
- package/dist/{media-gallery-Ca4YmvBi.js → media-gallery-DLp3HAz0.js} +75 -74
- package/dist/media-gallery-DLp3HAz0.js.map +1 -0
- package/dist/{mentions-CRio8mTm.js → mentions-Cl0Kt_Pd.js} +52 -50
- package/dist/{mentions-CRio8mTm.js.map → mentions-Cl0Kt_Pd.js.map} +1 -1
- package/dist/message-SZUNB1eX.js +127 -0
- package/dist/message-SZUNB1eX.js.map +1 -0
- package/dist/{navigation-BTrEb5u4.js → navigation-DnQSNMT0.js} +64 -55
- package/dist/navigation-DnQSNMT0.js.map +1 -0
- package/dist/{navigation-DqEITuD2.js → navigation-DyytsLRB.js} +37 -37
- package/dist/navigation-DyytsLRB.js.map +1 -0
- package/dist/{navigation-row-recipes-BFpvGPGE.js → navigation-row-recipes-DQEXQcqY.js} +3 -3
- package/dist/navigation-row-recipes-DQEXQcqY.js.map +1 -0
- package/dist/{number-BNT_BIzJ.js → number-DasMFWEG.js} +4 -4
- package/dist/{number-BNT_BIzJ.js.map → number-DasMFWEG.js.map} +1 -1
- package/dist/overlays-DUbs1KEi.js +1011 -0
- package/dist/overlays-DUbs1KEi.js.map +1 -0
- package/dist/{page-BMBGjJY8.js → page-hGmT4nWK.js} +75 -64
- package/dist/page-hGmT4nWK.js.map +1 -0
- package/dist/{page-header-BH41wCyY.js → page-header-D8nERkn5.js} +9 -9
- package/dist/page-header-D8nERkn5.js.map +1 -0
- package/dist/{pagination-C29vvt3I.js → pagination-NLGqRirf.js} +20 -20
- package/dist/pagination-NLGqRirf.js.map +1 -0
- package/dist/{popover-TInGXsjg.js → popover-CghIYdQf.js} +23 -22
- package/dist/popover-CghIYdQf.js.map +1 -0
- package/dist/{popover-menu-BzqXqE72.js → popover-menu-B4PoWhRl.js} +6 -6
- package/dist/{popover-menu-BzqXqE72.js.map → popover-menu-B4PoWhRl.js.map} +1 -1
- package/dist/{popover.recipes-zgBhMlUu.js → popover.recipes-QlD4JenO.js} +5 -5
- package/dist/popover.recipes-QlD4JenO.js.map +1 -0
- package/dist/{primitives-DKPOGVpj.js → primitives-C7ff0QaI.js} +120 -113
- package/dist/primitives-C7ff0QaI.js.map +1 -0
- package/dist/primitives.js +3 -3
- package/dist/progress-BroqrAyV.js +169 -0
- package/dist/progress-BroqrAyV.js.map +1 -0
- package/dist/{receipt-DYWTQGEc.js → receipt-BuJynLgf.js} +8 -8
- package/dist/{receipt-DYWTQGEc.js.map → receipt-BuJynLgf.js.map} +1 -1
- package/dist/{rich-text-B7sBAdDG.js → rich-text-DlxDOtf4.js} +4 -4
- package/dist/{rich-text-B7sBAdDG.js.map → rich-text-DlxDOtf4.js.map} +1 -1
- package/dist/rich-text-editor-BKyG7rWz.js +574 -0
- package/dist/rich-text-editor-BKyG7rWz.js.map +1 -0
- package/dist/{rich-text-editor.recipes-DxvOE0Lp.js → rich-text-editor.recipes-B72Nfuze.js} +35 -26
- package/dist/rich-text-editor.recipes-B72Nfuze.js.map +1 -0
- package/dist/{scroll-area-BheMQ270.js → scroll-area-D-pIhEKl.js} +3 -3
- package/dist/scroll-area-D-pIhEKl.js.map +1 -0
- package/dist/{separator-Gk_WXH-l.js → separator-BNIgG3au.js} +3 -3
- package/dist/{separator-Gk_WXH-l.js.map → separator-BNIgG3au.js.map} +1 -1
- package/dist/{separator-DO0EbCEm.js → separator-BhtFyo4x.js} +2 -2
- package/dist/{separator-DO0EbCEm.js.map → separator-BhtFyo4x.js.map} +1 -1
- package/dist/services/actions.js +1 -1
- package/dist/{settings-D9f_wdIC.js → settings-DOTOzeZ2.js} +10 -9
- package/dist/{settings-D9f_wdIC.js.map → settings-DOTOzeZ2.js.map} +1 -1
- package/dist/{sheet-vOUloJ4O.js → sheet-BFhrNehm.js} +11 -11
- package/dist/sheet-BFhrNehm.js.map +1 -0
- package/dist/{sidebar-CNBKFDRW.js → sidebar-CyR4XKwR.js} +219 -200
- package/dist/sidebar-CyR4XKwR.js.map +1 -0
- package/dist/{sidebar-C3UKkbC5.js → sidebar-SvGJ0Zwi.js} +63 -58
- package/dist/sidebar-SvGJ0Zwi.js.map +1 -0
- package/dist/{skeleton-BvRhK8y-.js → skeleton-3F0uhYn3.js} +4 -4
- package/dist/{skeleton-BvRhK8y-.js.map → skeleton-3F0uhYn3.js.map} +1 -1
- package/dist/{smart-card-B5FcKODh.js → smart-card-DjGVV2xr.js} +206 -199
- package/dist/smart-card-DjGVV2xr.js.map +1 -0
- package/dist/{spinner-JtlFJ7Nc.js → spinner-Cpf7oRkF.js} +5 -5
- package/dist/{spinner-JtlFJ7Nc.js.map → spinner-Cpf7oRkF.js.map} +1 -1
- package/dist/{structure-BvW4vG4H.js → structure-CRdqVawd.js} +14 -14
- package/dist/{structure-BvW4vG4H.js.map → structure-CRdqVawd.js.map} +1 -1
- package/dist/{structure.recipes-DjqnBpwz.js → structure.recipes-Bqhf9oIh.js} +2 -2
- package/dist/structure.recipes-Bqhf9oIh.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/{surface-recipes-CQfRr-VL.js → surface-recipes-Dd__PD-w.js} +4 -3
- package/dist/surface-recipes-Dd__PD-w.js.map +1 -0
- package/dist/{table-DnlAJ-xR.js → table-CLtJTxoR.js} +17 -16
- package/dist/table-CLtJTxoR.js.map +1 -0
- package/dist/table-CcRDZiLP.js +1444 -0
- package/dist/table-CcRDZiLP.js.map +1 -0
- package/dist/tabs-BNgu7g0u.js +188 -0
- package/dist/tabs-BNgu7g0u.js.map +1 -0
- package/dist/text-inputs-DsR56TR-.js +330 -0
- package/dist/text-inputs-DsR56TR-.js.map +1 -0
- package/dist/{text.styles-BwB7vAF2.js → text.styles-Q4sGAIgA.js} +18 -10
- package/dist/text.styles-Q4sGAIgA.js.map +1 -0
- package/dist/theme.css +77 -115
- package/dist/{timelines-CnZ2S_Gr.js → timelines-D1pkt3se.js} +84 -78
- package/dist/timelines-D1pkt3se.js.map +1 -0
- package/dist/{tree-COD9BGdU.js → tree-BtmYyMZV.js} +8 -8
- package/dist/{tree-COD9BGdU.js.map → tree-BtmYyMZV.js.map} +1 -1
- package/dist/typography/rich-text.js +1 -1
- package/dist/typography-BxQgiZyw.js +96 -0
- package/dist/typography-BxQgiZyw.js.map +1 -0
- package/dist/typography.js +1 -1
- package/dist/{ui-provider-CftIB6TY.js → ui-provider-DRPn3qNl.js} +3 -2
- package/dist/ui-provider-DRPn3qNl.js.map +1 -0
- package/dist/ui-provider.js +1 -1
- package/dist/{upload-DIzw1dx1.js → upload-CDbYw1WN.js} +326 -323
- package/dist/upload-CDbYw1WN.js.map +1 -0
- package/dist/{upload-queue-xRJ3qDmd.js → upload-queue-CNd_hH_a.js} +25 -25
- package/dist/upload-queue-CNd_hH_a.js.map +1 -0
- package/dist/usage-card-VyJLUwRr.js +457 -0
- package/dist/usage-card-VyJLUwRr.js.map +1 -0
- package/dist/utils-BvH9PSmq.js +4275 -0
- package/dist/utils-BvH9PSmq.js.map +1 -0
- package/dist/value-inputs-D0KCrfVC.js +840 -0
- package/dist/value-inputs-D0KCrfVC.js.map +1 -0
- package/dist/{workspace-Cbqz4FzN.js → workspace-CcR8r-Nt.js} +115 -122
- package/dist/workspace-CcR8r-Nt.js.map +1 -0
- package/docs/consumer-skill/SKILL.md +112 -18
- package/docs/consumer-skill/examples/analytics.tsx +34 -0
- package/docs/consumer-skill/examples/app-layout.tsx +42 -12
- package/docs/consumer-skill/examples/detail.tsx +24 -9
- package/docs/consumer-skill/examples/manifest.json +27 -1
- package/docs/consumer-skill/examples/planning-usage-edit.tsx +29 -0
- package/docs/consumer-skill/examples/scoped-directory.tsx +77 -0
- package/docs/consumer-skill/examples/website.tsx +56 -0
- package/docs/consumer-skill/references/analytics.md +70 -0
- package/docs/consumer-skill/references/composition.md +219 -2
- package/docs/consumer-skill/references/design-contract.md +37 -10
- package/docs/consumer-skill/references/discovery.md +93 -5
- package/docs/consumer-skill/references/installation.md +20 -3
- package/docs/consumer-skill/references/integration.md +26 -0
- package/docs/consumer-skill/references/public-api.json +2416 -388
- package/docs/consumer-skill/references/review.md +126 -0
- package/docs/consumer-skill/references/theming.md +52 -7
- package/docs/consumer-skill/references/tokens.json +177 -9
- package/docs/consumer-skill/references/workflows.md +129 -1
- package/docs/consumer-skill/scripts/check-composition.mjs +31 -0
- package/docs/consumer-skill/scripts/composition-policy.mjs +317 -0
- package/docs/consumer-skill/scripts/discovery.mjs +65 -8
- package/docs/consumer-skill/scripts/surface-policy.mjs +66 -0
- package/package.json +30 -6
- package/dist/accordion-BRWh3BM1.js.map +0 -1
- package/dist/action-menu-Cx3SdfbN.js.map +0 -1
- package/dist/affordance-geometry.generated-DXl-Zb3Z.js +0 -23
- package/dist/affordance-geometry.generated-DXl-Zb3Z.js.map +0 -1
- package/dist/ai-artifact-DkOArd3-.js.map +0 -1
- package/dist/app-shell-BH_bGcE2.js.map +0 -1
- package/dist/auth-BDB1V_2q.js +0 -704
- package/dist/auth-BDB1V_2q.js.map +0 -1
- package/dist/avatar-CsnWaYmt.js.map +0 -1
- package/dist/breadcrumbs-DdQ_I5ra.js.map +0 -1
- package/dist/button-BS6l5JUw.js.map +0 -1
- package/dist/buttons-Co6GavvM.js +0 -674
- package/dist/buttons-Co6GavvM.js.map +0 -1
- package/dist/chart-DVfcwQu6.js +0 -149
- package/dist/chart-DVfcwQu6.js.map +0 -1
- package/dist/choice-inputs-CavA-SGV.js +0 -644
- package/dist/choice-inputs-CavA-SGV.js.map +0 -1
- package/dist/code-block-DIlqzoiD.js.map +0 -1
- package/dist/combobox-CHD750do.js.map +0 -1
- package/dist/combobox-HDftpzxt.js.map +0 -1
- package/dist/command-D0kWBZfd.js.map +0 -1
- package/dist/comments-CvYeglMS.js +0 -1132
- package/dist/comments-CvYeglMS.js.map +0 -1
- package/dist/containers-CPNyNo1_.js.map +0 -1
- package/dist/data-display-b3d1TfL4.js.map +0 -1
- package/dist/date-picker-DI6kPNof.js.map +0 -1
- package/dist/date-pickers-ByP6Cv2z.js +0 -224
- package/dist/date-pickers-ByP6Cv2z.js.map +0 -1
- package/dist/feedback-a9j9J-9A.js +0 -391
- package/dist/feedback-a9j9J-9A.js.map +0 -1
- package/dist/field-affordance-recipes-CHdUtn2Z.js +0 -17
- package/dist/field-affordance-recipes-CHdUtn2Z.js.map +0 -1
- package/dist/field-state-recipes-CBTRt9Bt.js.map +0 -1
- package/dist/filters-qtrcv1hf.js.map +0 -1
- package/dist/form-field-C6W-y2hR.js.map +0 -1
- package/dist/form-sizing-39NohSqn.js.map +0 -1
- package/dist/forms-numeric-Y15Bg5Nr.js +0 -867
- package/dist/forms-numeric-Y15Bg5Nr.js.map +0 -1
- package/dist/header-B8ex54cY.js.map +0 -1
- package/dist/http-CLTVJc5I.js.map +0 -1
- package/dist/input-DMorJiTI.js +0 -202
- package/dist/input-DMorJiTI.js.map +0 -1
- package/dist/input-ci9fIgFH.js +0 -20
- package/dist/input-ci9fIgFH.js.map +0 -1
- package/dist/item-pJ0GsOiJ.js.map +0 -1
- package/dist/media-gallery-Ca4YmvBi.js.map +0 -1
- package/dist/message-B5-6LeYl.js +0 -108
- package/dist/message-B5-6LeYl.js.map +0 -1
- package/dist/navigation-BTrEb5u4.js.map +0 -1
- package/dist/navigation-DqEITuD2.js.map +0 -1
- package/dist/navigation-row-recipes-BFpvGPGE.js.map +0 -1
- package/dist/overlays-DBqV0J_V.js +0 -982
- package/dist/overlays-DBqV0J_V.js.map +0 -1
- package/dist/page-BMBGjJY8.js.map +0 -1
- package/dist/page-header-BH41wCyY.js.map +0 -1
- package/dist/pagination-C29vvt3I.js.map +0 -1
- package/dist/popover-TInGXsjg.js.map +0 -1
- package/dist/popover.recipes-zgBhMlUu.js.map +0 -1
- package/dist/primitives-DKPOGVpj.js.map +0 -1
- package/dist/rich-text-editor-BZSJchAF.js +0 -575
- package/dist/rich-text-editor-BZSJchAF.js.map +0 -1
- package/dist/rich-text-editor.recipes-DxvOE0Lp.js.map +0 -1
- package/dist/scroll-area-BheMQ270.js.map +0 -1
- package/dist/select-B2mb-qN2.js +0 -108
- package/dist/select-B2mb-qN2.js.map +0 -1
- package/dist/sheet-vOUloJ4O.js.map +0 -1
- package/dist/sidebar-C3UKkbC5.js.map +0 -1
- package/dist/sidebar-CNBKFDRW.js.map +0 -1
- package/dist/smart-card-B5FcKODh.js.map +0 -1
- package/dist/structure.recipes-DjqnBpwz.js.map +0 -1
- package/dist/surface-recipes-CQfRr-VL.js.map +0 -1
- package/dist/table-DnlAJ-xR.js.map +0 -1
- package/dist/table-ghtAQ-JJ.js +0 -1424
- package/dist/table-ghtAQ-JJ.js.map +0 -1
- package/dist/tabs-DY09eoZg.js +0 -187
- package/dist/tabs-DY09eoZg.js.map +0 -1
- package/dist/text-inputs-BhOcedTo.js +0 -331
- package/dist/text-inputs-BhOcedTo.js.map +0 -1
- package/dist/text.styles-BwB7vAF2.js.map +0 -1
- package/dist/timelines-CnZ2S_Gr.js.map +0 -1
- package/dist/typography-Cv8MT-82.js +0 -96
- package/dist/typography-Cv8MT-82.js.map +0 -1
- package/dist/ui-provider-CftIB6TY.js.map +0 -1
- package/dist/upload-DIzw1dx1.js.map +0 -1
- package/dist/upload-queue-xRJ3qDmd.js.map +0 -1
- package/dist/utils-C2EKeIw3.js +0 -72
- package/dist/utils-C2EKeIw3.js.map +0 -1
- package/dist/value-inputs-Co1fu-xv.js +0 -824
- package/dist/value-inputs-Co1fu-xv.js.map +0 -1
- package/dist/workspace-Cbqz4FzN.js.map +0 -1
|
@@ -0,0 +1,1156 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { a as e, o as t } from "./ui-provider-DRPn3qNl.js";
|
|
3
|
+
import { interpolateString as n, useStrings as r } from "./lib/strings.js";
|
|
4
|
+
import { t as i } from "./utils-BvH9PSmq.js";
|
|
5
|
+
import { t as a } from "./buttons-D_6KJvEE.js";
|
|
6
|
+
import { a as o, r as s, t as c } from "./typography-BxQgiZyw.js";
|
|
7
|
+
import { a as l, c as u, o as d, s as f, t as p } from "./button-BZDasD04.js";
|
|
8
|
+
import { t as m } from "./structure-CRdqVawd.js";
|
|
9
|
+
import { t as h } from "./row-recipes-DL8n7t_b.js";
|
|
10
|
+
import { i as g, t as _ } from "./overlays-DUbs1KEi.js";
|
|
11
|
+
import { t as v } from "./sanitize-html-BG9FGe-j.js";
|
|
12
|
+
import { t as y } from "./content-typography-CnwgMJ37.js";
|
|
13
|
+
import { t as b } from "./rich-text-DlxDOtf4.js";
|
|
14
|
+
import { g as x, i as S } from "./primitives-C7ff0QaI.js";
|
|
15
|
+
import { n as C, t as w } from "./number-DasMFWEG.js";
|
|
16
|
+
import { i as T } from "./date-DOKhJPu7.js";
|
|
17
|
+
import { i as E, n as D, s as O } from "./avatar-Bu2HhitA.js";
|
|
18
|
+
import { t as k } from "./badge-CzId1Wlm.js";
|
|
19
|
+
import { t as A } from "./field-affordance-recipes-uKY4MsZ_.js";
|
|
20
|
+
import { c as ee, o as te } from "./popover-CghIYdQf.js";
|
|
21
|
+
import { l as ne } from "./data-display-Bihs9Ven.js";
|
|
22
|
+
import { t as re } from "./rich-text-editor-BKyG7rWz.js";
|
|
23
|
+
import { l as j, n as ie, o as M, r as ae, t as oe } from "./mentions-Cl0Kt_Pd.js";
|
|
24
|
+
import { Fragment as N, createElement as se, forwardRef as P, memo as F, useCallback as I, useEffect as L, useImperativeHandle as R, useMemo as z, useRef as B, useState as V } from "react";
|
|
25
|
+
import { Fragment as H, jsx as U, jsxs as W } from "react/jsx-runtime";
|
|
26
|
+
import { AtSign as ce, CornerDownRight as le, File as G, FileText as ue, Image as K, Loader2 as de, MessageCircle as q, Paperclip as fe, Pencil as J, Pin as Y, Send as pe, Smile as me, Trash2 as he, X as ge } from "lucide-react";
|
|
27
|
+
//#region src/components/features/comments/comments.strings.ts
|
|
28
|
+
var X = {
|
|
29
|
+
title: "Comments",
|
|
30
|
+
subtitle: "",
|
|
31
|
+
empty: "No comments yet.",
|
|
32
|
+
emptyHint: "Start the conversation — your team will see it instantly.",
|
|
33
|
+
composerPlaceholder: "Write a comment…",
|
|
34
|
+
composerSubmit: "Post comment",
|
|
35
|
+
composerSubmitting: "Posting…",
|
|
36
|
+
composerSave: "Save changes",
|
|
37
|
+
invalidContent: "Comment cannot be empty.",
|
|
38
|
+
composerCancel: "Cancel",
|
|
39
|
+
composerEditingEyebrow: "Editing comment",
|
|
40
|
+
composerReplyingEyebrow: "Replying to {{name}}",
|
|
41
|
+
composerAttachmentLabel: "Attach file",
|
|
42
|
+
composerReferenceLabel: "Mention or link",
|
|
43
|
+
composerReferenceMenuTitle: "Insert reference",
|
|
44
|
+
composerReferenceSearchPlaceholder: "Search…",
|
|
45
|
+
composerReferenceEmpty: "No matches.",
|
|
46
|
+
composerReferenceLoading: "Searching…",
|
|
47
|
+
fallbackAuthor: "Anonymous",
|
|
48
|
+
pinned: "Pinned",
|
|
49
|
+
edited: "edited",
|
|
50
|
+
deleteLabel: "Delete",
|
|
51
|
+
editLabel: "Edit",
|
|
52
|
+
replyLabel: "Reply",
|
|
53
|
+
pinLabel: "Pin",
|
|
54
|
+
unpinLabel: "Unpin",
|
|
55
|
+
moreActionsLabel: "More actions",
|
|
56
|
+
confirmDeleteLabel: "Delete comment",
|
|
57
|
+
confirmDeleteTitle: "Delete this comment?",
|
|
58
|
+
confirmRemoveAttachmentTitle: "Remove this attachment?",
|
|
59
|
+
confirmRemoveAttachmentDescription: "The file is detached from the comment for everyone. This cannot be undone.",
|
|
60
|
+
confirmDeleteDescription: "The comment and its replies are removed for everyone. This cannot be undone.",
|
|
61
|
+
attachmentFallback: "Attachment",
|
|
62
|
+
attachmentRemoveLabel: "Remove attachment",
|
|
63
|
+
attachmentUploadingLabel: "Uploading…",
|
|
64
|
+
attachmentFailedLabel: "Upload failed",
|
|
65
|
+
attachmentTooLargeError: "File is too large.",
|
|
66
|
+
attachmentTooManyError: "Too many attachments.",
|
|
67
|
+
attachmentRetryLabel: "Retry",
|
|
68
|
+
attachmentDownloadLabel: "Download",
|
|
69
|
+
addReactionLabel: "Add reaction",
|
|
70
|
+
reactionLabel: "Reaction {{emoji}}: {{count}}",
|
|
71
|
+
showRepliesLabel: "Show replies",
|
|
72
|
+
hideRepliesLabel: "Hide replies"
|
|
73
|
+
};
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/components/features/comments/comments-provider.tsx
|
|
76
|
+
function Z(e) {
|
|
77
|
+
return r(X, e);
|
|
78
|
+
}
|
|
79
|
+
function _e(e) {
|
|
80
|
+
let n = t();
|
|
81
|
+
return z(() => ({
|
|
82
|
+
getMediaUrl: e?.getMediaUrl,
|
|
83
|
+
getMediaName: e?.getMediaName,
|
|
84
|
+
getStatusLabel: e?.getStatusLabel,
|
|
85
|
+
formatRelativeTime: e?.formatRelativeTime ?? n.formatRelativeTime
|
|
86
|
+
}), [e, n.formatRelativeTime]);
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/components/features/comments/hooks/use-comments.ts
|
|
90
|
+
function Q(e = {}) {
|
|
91
|
+
let { onSubmit: t, onUpdate: n, onDelete: r, onAfterMutate: i, onError: a } = e, [o, s] = V({ kind: "idle" }), [c, l] = V(!1), u = B(!1), [d, f] = V({}), [p, m] = V(0), h = I((e) => {
|
|
92
|
+
u.current = e, l(e);
|
|
93
|
+
}, []), g = I(() => {
|
|
94
|
+
m((e) => e + 1), s({ kind: "idle" }), f({}), h(!1);
|
|
95
|
+
}, [h]), _ = z(() => ({
|
|
96
|
+
setErrors: f,
|
|
97
|
+
reset: g,
|
|
98
|
+
setSubmitting: h
|
|
99
|
+
}), [g, h]), v = I((e) => {
|
|
100
|
+
try {
|
|
101
|
+
a?.(e);
|
|
102
|
+
} catch {}
|
|
103
|
+
}, [a]);
|
|
104
|
+
return {
|
|
105
|
+
composerMode: o,
|
|
106
|
+
isSubmitting: c,
|
|
107
|
+
formErrors: d,
|
|
108
|
+
resetKey: p,
|
|
109
|
+
startReply: I((e) => {
|
|
110
|
+
e.id && (f({}), s({
|
|
111
|
+
kind: "replying",
|
|
112
|
+
commentId: e.id,
|
|
113
|
+
authorName: e.user?.name
|
|
114
|
+
}));
|
|
115
|
+
}, []),
|
|
116
|
+
startEdit: I((e) => {
|
|
117
|
+
e.id && (f({}), s({
|
|
118
|
+
kind: "editing",
|
|
119
|
+
comment: e
|
|
120
|
+
}));
|
|
121
|
+
}, []),
|
|
122
|
+
cancelComposerMode: I(() => {
|
|
123
|
+
g();
|
|
124
|
+
}, [g]),
|
|
125
|
+
submit: I(async (e) => {
|
|
126
|
+
if (o.kind === "editing" && o.comment.id) {
|
|
127
|
+
if (!n || u.current) return;
|
|
128
|
+
let t = {
|
|
129
|
+
...e,
|
|
130
|
+
editingId: o.comment.id
|
|
131
|
+
};
|
|
132
|
+
h(!0), f({});
|
|
133
|
+
try {
|
|
134
|
+
await n(o.comment.id, t, _), i?.("update", t);
|
|
135
|
+
} catch (e) {
|
|
136
|
+
v(e);
|
|
137
|
+
} finally {
|
|
138
|
+
h(!1);
|
|
139
|
+
}
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
if (!t || u.current) return;
|
|
143
|
+
let r = o.kind === "replying" ? {
|
|
144
|
+
...e,
|
|
145
|
+
replyToId: o.commentId
|
|
146
|
+
} : e;
|
|
147
|
+
h(!0), f({});
|
|
148
|
+
try {
|
|
149
|
+
await t(r, _), i?.("create", r);
|
|
150
|
+
} catch (e) {
|
|
151
|
+
v(e);
|
|
152
|
+
} finally {
|
|
153
|
+
h(!1);
|
|
154
|
+
}
|
|
155
|
+
}, [
|
|
156
|
+
o,
|
|
157
|
+
_,
|
|
158
|
+
i,
|
|
159
|
+
t,
|
|
160
|
+
n,
|
|
161
|
+
v,
|
|
162
|
+
h
|
|
163
|
+
]),
|
|
164
|
+
deleteComment: I(async (e) => {
|
|
165
|
+
if (r && e) try {
|
|
166
|
+
await r(e), i?.("delete", { commentId: e });
|
|
167
|
+
} catch (e) {
|
|
168
|
+
v(e);
|
|
169
|
+
}
|
|
170
|
+
}, [
|
|
171
|
+
i,
|
|
172
|
+
r,
|
|
173
|
+
v
|
|
174
|
+
]),
|
|
175
|
+
resetComposer: g,
|
|
176
|
+
helpers: _
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
//#endregion
|
|
180
|
+
//#region src/components/features/comments/partials/comment-attachment-chip.tsx
|
|
181
|
+
function ve(e) {
|
|
182
|
+
return e.mimeType?.startsWith("image/") ? K : e.mimeType === "application/pdf" || e.mimeType?.startsWith("text/") ? ue : e.mimeType ? G : fe;
|
|
183
|
+
}
|
|
184
|
+
var ye = ({ attachment: e, editable: t = !1, onRemove: n, onRetry: s, accessors: l, strings: u, compact: d = !1, className: f }) => {
|
|
185
|
+
let p = r(X, u), m = l?.getMediaUrl?.(e) ?? e.url, g = l?.getMediaName?.(e) ?? e.name ?? p.attachmentFallback, _ = ve(e), v = e.status === "uploading", y = e.status === "failed", b = v ? /* @__PURE__ */ W(x, {
|
|
186
|
+
size: "xs",
|
|
187
|
+
className: "shrink-0",
|
|
188
|
+
children: [p.attachmentUploadingLabel, typeof e.progress == "number" ? /* @__PURE__ */ W(H, { children: [" ", /* @__PURE__ */ U(C, {
|
|
189
|
+
value: Math.round(e.progress),
|
|
190
|
+
scaled: !0,
|
|
191
|
+
size: "xs",
|
|
192
|
+
align: "left",
|
|
193
|
+
type: "secondary"
|
|
194
|
+
})] }) : null]
|
|
195
|
+
}) : y ? /* @__PURE__ */ U(x, {
|
|
196
|
+
size: "xs",
|
|
197
|
+
className: "shrink-0",
|
|
198
|
+
children: e.error ?? p.attachmentFailedLabel
|
|
199
|
+
}) : typeof e.size == "number" ? /* @__PURE__ */ U(S, {
|
|
200
|
+
value: e.size,
|
|
201
|
+
size: "xs",
|
|
202
|
+
className: "shrink-0"
|
|
203
|
+
}) : null, w = i("comment-attachment-chip--component", "relative inline-flex min-w-0 max-w-[20rem] items-center gap-space-sm rounded-radius", "ring-1 ring-inset transition-colors", d ? "px-control-xs" : "px-control-sm", h.compact, y ? "bg-destructive/[0.04] ring-destructive/30 hover:bg-destructive/[0.08]" : "bg-foreground/[0.03] ring-border/60 hover:bg-foreground/[0.06]", f), T = v ? /* @__PURE__ */ U(de, {
|
|
204
|
+
className: i("shrink-0 animate-spin text-muted-foreground", "size-icon-md"),
|
|
205
|
+
"aria-hidden": !0
|
|
206
|
+
}) : /* @__PURE__ */ U(_, {
|
|
207
|
+
className: i("shrink-0", "size-icon-md", y ? "text-destructive" : "text-muted-foreground"),
|
|
208
|
+
"aria-hidden": !0
|
|
209
|
+
}), E = /* @__PURE__ */ W("span", {
|
|
210
|
+
className: "inline-flex min-w-0 items-baseline gap-space-sm",
|
|
211
|
+
children: [/* @__PURE__ */ U(o, {
|
|
212
|
+
tag: "span",
|
|
213
|
+
size: "xs",
|
|
214
|
+
weight: "medium",
|
|
215
|
+
className: i("truncate", y && "text-destructive"),
|
|
216
|
+
children: g
|
|
217
|
+
}), b]
|
|
218
|
+
});
|
|
219
|
+
return /* @__PURE__ */ W("div", {
|
|
220
|
+
className: w,
|
|
221
|
+
children: [
|
|
222
|
+
T,
|
|
223
|
+
m && !v && !y ? /* @__PURE__ */ U(c, {
|
|
224
|
+
href: m,
|
|
225
|
+
size: "inherit",
|
|
226
|
+
underline: !1,
|
|
227
|
+
target: "_blank",
|
|
228
|
+
rel: "noreferrer noopener",
|
|
229
|
+
className: "inline-flex min-w-0 flex-1 items-baseline gap-space-sm hover:underline",
|
|
230
|
+
"aria-label": p.attachmentDownloadLabel,
|
|
231
|
+
children: E
|
|
232
|
+
}) : E,
|
|
233
|
+
v && typeof e.progress == "number" && /* @__PURE__ */ U("div", {
|
|
234
|
+
className: "bg-primary/15 absolute bottom-0 left-2 right-2 h-px overflow-hidden rounded-full",
|
|
235
|
+
children: /* @__PURE__ */ U("div", {
|
|
236
|
+
className: "bg-primary h-full transition-[width]",
|
|
237
|
+
style: { width: `${Math.min(100, Math.max(0, e.progress))}%` }
|
|
238
|
+
})
|
|
239
|
+
}),
|
|
240
|
+
y && s && /* @__PURE__ */ U(a, {
|
|
241
|
+
type: "button",
|
|
242
|
+
size: "sm",
|
|
243
|
+
onClick: () => s(e.id),
|
|
244
|
+
className: "shrink-0 text-destructive decoration-destructive/30 hover:decoration-destructive/60",
|
|
245
|
+
children: /* @__PURE__ */ U(o, {
|
|
246
|
+
tag: "span",
|
|
247
|
+
size: "xs",
|
|
248
|
+
weight: "medium",
|
|
249
|
+
className: "text-inherit",
|
|
250
|
+
children: p.attachmentRetryLabel
|
|
251
|
+
})
|
|
252
|
+
}),
|
|
253
|
+
t && n && /* @__PURE__ */ U("button", {
|
|
254
|
+
type: "button",
|
|
255
|
+
onClick: () => n(e.id),
|
|
256
|
+
className: i(A.target, A.focus, A.toggle),
|
|
257
|
+
"aria-label": p.attachmentRemoveLabel,
|
|
258
|
+
title: p.attachmentRemoveLabel,
|
|
259
|
+
children: /* @__PURE__ */ U(ge, {
|
|
260
|
+
className: A.icon,
|
|
261
|
+
"aria-hidden": "true"
|
|
262
|
+
})
|
|
263
|
+
})
|
|
264
|
+
]
|
|
265
|
+
});
|
|
266
|
+
}, be = {
|
|
267
|
+
attachmentTooLargeError: X.attachmentTooLargeError,
|
|
268
|
+
attachmentTooManyError: X.attachmentTooManyError,
|
|
269
|
+
attachmentFailedLabel: X.attachmentFailedLabel
|
|
270
|
+
};
|
|
271
|
+
function xe(e = {}) {
|
|
272
|
+
let { onUpload: t, maxSize: n, maxFiles: i, disabled: a, initialAttachments: o, onValueChange: s, onError: c, strings: l } = e, u = r(be, l), [d, f] = V(() => o ? [...o] : []), p = B(/* @__PURE__ */ new Map()), m = B(/* @__PURE__ */ new Map()), h = B(d), g = I((e) => {
|
|
273
|
+
let t = [...e];
|
|
274
|
+
h.current = t, f(t);
|
|
275
|
+
}, []), _ = B(s);
|
|
276
|
+
_.current = s;
|
|
277
|
+
let v = I((e, t) => {
|
|
278
|
+
g(h.current.map((n) => n.id === e ? {
|
|
279
|
+
...n,
|
|
280
|
+
...t
|
|
281
|
+
} : n));
|
|
282
|
+
}, [g]), y = I((e) => {
|
|
283
|
+
g(e);
|
|
284
|
+
}, [g]), b = I((e, n) => {
|
|
285
|
+
if (!t || !m.current.has(e)) return;
|
|
286
|
+
let r = new AbortController();
|
|
287
|
+
p.current.set(e, { controller: r }), v(e, {
|
|
288
|
+
status: "uploading",
|
|
289
|
+
progress: 0,
|
|
290
|
+
error: void 0
|
|
291
|
+
}), t({
|
|
292
|
+
file: n,
|
|
293
|
+
onProgress: (t) => {
|
|
294
|
+
r.signal.aborted || v(e, { progress: t });
|
|
295
|
+
},
|
|
296
|
+
signal: r.signal
|
|
297
|
+
}).then((t) => {
|
|
298
|
+
r.signal.aborted || (p.current.delete(e), v(e, {
|
|
299
|
+
...t,
|
|
300
|
+
id: e,
|
|
301
|
+
status: "uploaded",
|
|
302
|
+
progress: 100,
|
|
303
|
+
error: void 0
|
|
304
|
+
}));
|
|
305
|
+
}).catch((t) => {
|
|
306
|
+
if (p.current.delete(e), r.signal.aborted) return;
|
|
307
|
+
let n = t instanceof Error ? t.message : u.attachmentFailedLabel;
|
|
308
|
+
v(e, {
|
|
309
|
+
status: "failed",
|
|
310
|
+
error: n
|
|
311
|
+
}), c?.(n);
|
|
312
|
+
});
|
|
313
|
+
}, [
|
|
314
|
+
c,
|
|
315
|
+
t,
|
|
316
|
+
u.attachmentFailedLabel,
|
|
317
|
+
v
|
|
318
|
+
]), x = I((e) => {
|
|
319
|
+
if (a || !t) return;
|
|
320
|
+
let r = Array.from(e);
|
|
321
|
+
if (r.length === 0) return;
|
|
322
|
+
let o = [...h.current], s = [];
|
|
323
|
+
for (let e of r) {
|
|
324
|
+
if (typeof i == "number" && o.length >= i) {
|
|
325
|
+
c?.(u.attachmentTooManyError);
|
|
326
|
+
break;
|
|
327
|
+
}
|
|
328
|
+
if (typeof n == "number" && e.size > n) {
|
|
329
|
+
c?.(u.attachmentTooLargeError);
|
|
330
|
+
continue;
|
|
331
|
+
}
|
|
332
|
+
let t = typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : `att-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
|
333
|
+
m.current.set(t, e), o.push({
|
|
334
|
+
id: t,
|
|
335
|
+
name: e.name,
|
|
336
|
+
size: e.size,
|
|
337
|
+
mimeType: e.type,
|
|
338
|
+
status: "uploading",
|
|
339
|
+
progress: 0
|
|
340
|
+
}), s.push({
|
|
341
|
+
id: t,
|
|
342
|
+
file: e
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
g(o);
|
|
346
|
+
for (let { id: e, file: t } of s) queueMicrotask(() => b(e, t));
|
|
347
|
+
}, [
|
|
348
|
+
b,
|
|
349
|
+
g,
|
|
350
|
+
a,
|
|
351
|
+
i,
|
|
352
|
+
n,
|
|
353
|
+
c,
|
|
354
|
+
t,
|
|
355
|
+
u.attachmentTooLargeError,
|
|
356
|
+
u.attachmentTooManyError
|
|
357
|
+
]), S = I((e) => {
|
|
358
|
+
let t = p.current.get(e);
|
|
359
|
+
t && (t.controller.abort(), p.current.delete(e)), m.current.delete(e), g(h.current.filter((t) => t.id !== e));
|
|
360
|
+
}, [g]), C = I((e) => {
|
|
361
|
+
let t = m.current.get(e);
|
|
362
|
+
t && b(e, t);
|
|
363
|
+
}, [b]), w = I(() => {
|
|
364
|
+
for (let e of p.current.values()) e.controller.abort();
|
|
365
|
+
p.current.clear(), m.current.clear(), g([]);
|
|
366
|
+
}, [g]);
|
|
367
|
+
return L(() => {
|
|
368
|
+
_.current?.(d);
|
|
369
|
+
}, [d]), L(() => {
|
|
370
|
+
let e = p.current, t = m.current;
|
|
371
|
+
return () => {
|
|
372
|
+
for (let t of e.values()) t.controller.abort();
|
|
373
|
+
t.clear();
|
|
374
|
+
};
|
|
375
|
+
}, []), {
|
|
376
|
+
attachments: d,
|
|
377
|
+
uploadedAttachments: z(() => d.filter((e) => e.status === "uploaded" || !e.status), [d]),
|
|
378
|
+
isUploading: z(() => d.some((e) => e.status === "uploading"), [d]),
|
|
379
|
+
addFiles: x,
|
|
380
|
+
removeAttachment: S,
|
|
381
|
+
retryAttachment: C,
|
|
382
|
+
setAttachments: y,
|
|
383
|
+
reset: w
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
//#endregion
|
|
387
|
+
//#region src/components/features/comments/partials/comment-composer.tsx
|
|
388
|
+
function Se(e) {
|
|
389
|
+
return !e || typeof e != "string" ? !1 : e.replace(/<[^>]*>/g, "").trim().length > 0;
|
|
390
|
+
}
|
|
391
|
+
var Ce = P(function({ context: e, canComment: t = !0, submitting: n = !1, errors: r, resetKey: i = 0, onSubmit: a, onCancel: s, editingComment: c, replyingTo: l, strings: u, resources: d, onResourceSearch: f, attachments: h, maxAttachments: g, allowAttachments: _, initialValues: v, autoFocus: y = !1, inlineSubmit: b = !0, placeholder: x }, S) {
|
|
392
|
+
let C = Z(u), w = d, T = f, E = _ ?? !0, D = h?.maxFiles ?? g ?? 5, O = z(() => ({
|
|
393
|
+
...h,
|
|
394
|
+
maxFiles: D,
|
|
395
|
+
disabled: h?.disabled === !0 || !E
|
|
396
|
+
}), [
|
|
397
|
+
E,
|
|
398
|
+
h,
|
|
399
|
+
D
|
|
400
|
+
]), k = B(null), [A, ne] = V(() => v?.content ?? c?.content ?? ""), [M, N] = V(null), [se, P] = V(null), F = j({
|
|
401
|
+
resources: w,
|
|
402
|
+
onResourceSearch: T,
|
|
403
|
+
editorRef: k,
|
|
404
|
+
initialMentions: v?.references ?? c?.references
|
|
405
|
+
}), I = xe({
|
|
406
|
+
...O,
|
|
407
|
+
initialAttachments: v?.attachments ?? void 0,
|
|
408
|
+
strings: C,
|
|
409
|
+
onError: P
|
|
410
|
+
}), H = () => {
|
|
411
|
+
I.reset(), P(null), s?.();
|
|
412
|
+
};
|
|
413
|
+
R(S, () => ({
|
|
414
|
+
focus: () => k.current?.focus(),
|
|
415
|
+
clear: () => {
|
|
416
|
+
k.current?.clear(), F.reset(), I.reset(), N(null), P(null);
|
|
417
|
+
},
|
|
418
|
+
setBody: (e) => {
|
|
419
|
+
k.current?.setHTML(e);
|
|
420
|
+
}
|
|
421
|
+
}), [I, F]), L(() => {
|
|
422
|
+
k.current?.setHTML(v?.content ?? ""), F.setMentions(v?.references ?? []), I.reset(), I.setAttachments(v?.attachments ?? []), N(null), P(null);
|
|
423
|
+
}, [
|
|
424
|
+
e.id,
|
|
425
|
+
e.type,
|
|
426
|
+
i
|
|
427
|
+
]), L(() => {
|
|
428
|
+
if (!c) return;
|
|
429
|
+
k.current?.setHTML(c.content ?? ""), F.setMentions(c.references ?? []);
|
|
430
|
+
let e = (c.attachments ?? []).filter((e) => !!e);
|
|
431
|
+
I.reset(), I.setAttachments(e), P(null);
|
|
432
|
+
}, [c?.id]), L(() => {
|
|
433
|
+
r?.content && N(r.content);
|
|
434
|
+
}, [r]);
|
|
435
|
+
let le = (t) => {
|
|
436
|
+
if (t?.preventDefault(), n || I.isUploading) return;
|
|
437
|
+
let r = k.current?.getHTML() ?? A;
|
|
438
|
+
if (!Se(r)) {
|
|
439
|
+
N(C.invalidContent);
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
N(null), a({
|
|
443
|
+
content: r,
|
|
444
|
+
commentableId: e.id,
|
|
445
|
+
commentableType: e.type,
|
|
446
|
+
moduleKey: e.moduleKey,
|
|
447
|
+
contentType: "html",
|
|
448
|
+
references: F.mentions,
|
|
449
|
+
attachments: I.uploadedAttachments,
|
|
450
|
+
replyToId: l?.commentId ?? v?.replyToId,
|
|
451
|
+
editingId: c?.id
|
|
452
|
+
});
|
|
453
|
+
}, G = B(null), ue = () => G.current?.click(), K = (e) => {
|
|
454
|
+
e?.length && (P(null), I.addFiles(e));
|
|
455
|
+
}, q = I.attachments.length > 0, J = !!c, Y = !J && !!l, me = n ? C.composerSubmitting : J ? C.composerSave : C.composerSubmit, he = J ? /* @__PURE__ */ U($, {
|
|
456
|
+
label: C.composerEditingEyebrow,
|
|
457
|
+
closeLabel: C.composerCancel,
|
|
458
|
+
onClose: s ? H : void 0
|
|
459
|
+
}) : Y ? /* @__PURE__ */ U($, {
|
|
460
|
+
label: we(C.composerReplyingEyebrow, l.authorName),
|
|
461
|
+
closeLabel: C.composerCancel,
|
|
462
|
+
onClose: s ? H : void 0
|
|
463
|
+
}) : null, ge = z(() => {
|
|
464
|
+
let e = [];
|
|
465
|
+
return w && Object.keys(w).length > 0 && e.push({
|
|
466
|
+
id: "reference",
|
|
467
|
+
icon: ce,
|
|
468
|
+
label: C.composerReferenceLabel,
|
|
469
|
+
onClick: () => F.setPickerOpen(!0)
|
|
470
|
+
}), O?.onUpload && !O.disabled && e.push({
|
|
471
|
+
id: "attachment",
|
|
472
|
+
icon: fe,
|
|
473
|
+
label: C.composerAttachmentLabel,
|
|
474
|
+
onClick: ue
|
|
475
|
+
}), e;
|
|
476
|
+
}, [
|
|
477
|
+
w,
|
|
478
|
+
O?.onUpload,
|
|
479
|
+
O?.disabled,
|
|
480
|
+
C.composerReferenceLabel,
|
|
481
|
+
C.composerAttachmentLabel
|
|
482
|
+
]);
|
|
483
|
+
if (!t) return null;
|
|
484
|
+
let X = /* @__PURE__ */ U(p, {
|
|
485
|
+
type: "button",
|
|
486
|
+
onClick: () => le(),
|
|
487
|
+
disabled: n || I.isUploading,
|
|
488
|
+
icon: n ? de : pe,
|
|
489
|
+
children: me
|
|
490
|
+
}), _e = J || Y || s ? /* @__PURE__ */ U(p, {
|
|
491
|
+
type: "button",
|
|
492
|
+
tone: "secondary",
|
|
493
|
+
buttonStyle: "ghost",
|
|
494
|
+
onClick: H,
|
|
495
|
+
disabled: n,
|
|
496
|
+
children: C.composerCancel
|
|
497
|
+
}) : null, Q = q ? /* @__PURE__ */ U(m, {
|
|
498
|
+
direction: "horizontal",
|
|
499
|
+
wrap: !0,
|
|
500
|
+
align: "center",
|
|
501
|
+
gap: "sm",
|
|
502
|
+
children: I.attachments.map((e) => /* @__PURE__ */ U(ye, {
|
|
503
|
+
attachment: e,
|
|
504
|
+
editable: !0,
|
|
505
|
+
onRemove: (e) => {
|
|
506
|
+
P(null), I.removeAttachment(e);
|
|
507
|
+
},
|
|
508
|
+
onRetry: (e) => {
|
|
509
|
+
P(null), I.retryAttachment(e);
|
|
510
|
+
},
|
|
511
|
+
strings: u
|
|
512
|
+
}, e.id))
|
|
513
|
+
}) : null, ve = q ? Q : null, be = b !== !1 && !J && !Y ? X : null, Ce = b === !1 || J || Y;
|
|
514
|
+
return /* @__PURE__ */ W(m, {
|
|
515
|
+
render: /* @__PURE__ */ U("form", {}),
|
|
516
|
+
gap: "md",
|
|
517
|
+
onSubmit: le,
|
|
518
|
+
className: "comment-composer--component",
|
|
519
|
+
children: [
|
|
520
|
+
he,
|
|
521
|
+
/* @__PURE__ */ U("input", {
|
|
522
|
+
ref: G,
|
|
523
|
+
type: "file",
|
|
524
|
+
multiple: !0,
|
|
525
|
+
hidden: !0,
|
|
526
|
+
accept: O?.accept,
|
|
527
|
+
onChange: (e) => {
|
|
528
|
+
K(e.target.files), e.target.value = "";
|
|
529
|
+
}
|
|
530
|
+
}),
|
|
531
|
+
!F.triggerActive && /* @__PURE__ */ W(te, {
|
|
532
|
+
open: F.pickerOpen,
|
|
533
|
+
onOpenChange: F.setPickerOpen,
|
|
534
|
+
children: [/* @__PURE__ */ U(ee, { render: /* @__PURE__ */ U(p, {
|
|
535
|
+
type: "button",
|
|
536
|
+
tone: "secondary",
|
|
537
|
+
buttonStyle: "ghost",
|
|
538
|
+
className: "sr-only",
|
|
539
|
+
tabIndex: -1,
|
|
540
|
+
children: C.composerReferenceLabel
|
|
541
|
+
}) }), /* @__PURE__ */ U(ae, {
|
|
542
|
+
open: F.pickerOpen,
|
|
543
|
+
activeKind: F.activeKind,
|
|
544
|
+
setActiveKind: (e) => {
|
|
545
|
+
F.setActiveKind(e), F.setManualKindOverride(!0);
|
|
546
|
+
},
|
|
547
|
+
kinds: F.kinds,
|
|
548
|
+
resources: w,
|
|
549
|
+
query: F.query,
|
|
550
|
+
setQuery: F.setQuery,
|
|
551
|
+
suggestions: F.suggestions,
|
|
552
|
+
loading: F.isLoading,
|
|
553
|
+
onSelect: F.pickSuggestion,
|
|
554
|
+
strings: {
|
|
555
|
+
title: C.composerReferenceMenuTitle,
|
|
556
|
+
searchPlaceholder: C.composerReferenceSearchPlaceholder,
|
|
557
|
+
empty: C.composerReferenceEmpty,
|
|
558
|
+
loading: C.composerReferenceLoading
|
|
559
|
+
}
|
|
560
|
+
})]
|
|
561
|
+
}),
|
|
562
|
+
/* @__PURE__ */ W("div", {
|
|
563
|
+
className: "comment-composer--editor relative",
|
|
564
|
+
children: [/* @__PURE__ */ U(re, {
|
|
565
|
+
ref: k,
|
|
566
|
+
value: A,
|
|
567
|
+
onValueChange: (e) => {
|
|
568
|
+
ne(e);
|
|
569
|
+
let t = oe(e), n = F.mentions;
|
|
570
|
+
if (n.map((e) => e.id).join("|") !== t.map((e) => e.id).join("|")) {
|
|
571
|
+
let e = new Map(n.map((e) => [e.id, e])), r = t.map((t) => e.get(t.id) ?? t);
|
|
572
|
+
F.setMentions(r);
|
|
573
|
+
}
|
|
574
|
+
},
|
|
575
|
+
placeholder: x ?? C.composerPlaceholder,
|
|
576
|
+
strings: { editorLabel: x ?? C.composerPlaceholder },
|
|
577
|
+
minHeight: "3rem",
|
|
578
|
+
autoFocus: y || J || Y,
|
|
579
|
+
extraToolbarItems: ge,
|
|
580
|
+
toolbarTrailing: be,
|
|
581
|
+
footerSlot: ve,
|
|
582
|
+
onCaretChange: F.handleCaretChange
|
|
583
|
+
}), /* @__PURE__ */ U(ie, {
|
|
584
|
+
open: F.triggerActive && F.pickerOpen,
|
|
585
|
+
activeKind: F.activeKind,
|
|
586
|
+
setActiveKind: (e) => {
|
|
587
|
+
F.setActiveKind(e), F.setManualKindOverride(!0);
|
|
588
|
+
},
|
|
589
|
+
kinds: F.kinds,
|
|
590
|
+
resources: w,
|
|
591
|
+
query: F.query,
|
|
592
|
+
suggestions: F.suggestions,
|
|
593
|
+
suggestionsByKind: F.suggestionsByKind,
|
|
594
|
+
loading: F.isLoading,
|
|
595
|
+
onSelect: F.pickSuggestion,
|
|
596
|
+
strings: {
|
|
597
|
+
title: C.composerReferenceMenuTitle,
|
|
598
|
+
empty: C.composerReferenceEmpty,
|
|
599
|
+
loading: C.composerReferenceLoading
|
|
600
|
+
}
|
|
601
|
+
})]
|
|
602
|
+
}),
|
|
603
|
+
se && /* @__PURE__ */ U(o, {
|
|
604
|
+
role: "alert",
|
|
605
|
+
size: "xs",
|
|
606
|
+
type: "error",
|
|
607
|
+
className: "comment-composer--attachment-error",
|
|
608
|
+
children: se
|
|
609
|
+
}),
|
|
610
|
+
M && /* @__PURE__ */ U(o, {
|
|
611
|
+
size: "xs",
|
|
612
|
+
type: "error",
|
|
613
|
+
children: M
|
|
614
|
+
}),
|
|
615
|
+
Ce && /* @__PURE__ */ W(m, {
|
|
616
|
+
direction: "horizontal",
|
|
617
|
+
align: "center",
|
|
618
|
+
justify: "end",
|
|
619
|
+
gap: "md",
|
|
620
|
+
className: "comment-composer--footer-actions",
|
|
621
|
+
children: [_e, X]
|
|
622
|
+
})
|
|
623
|
+
]
|
|
624
|
+
});
|
|
625
|
+
});
|
|
626
|
+
function $({ label: e, closeLabel: t, onClose: n }) {
|
|
627
|
+
return /* @__PURE__ */ W("div", {
|
|
628
|
+
className: i("comment-composer--eyebrow bg-muted/40 ring-border/60 flex min-w-0 items-center justify-between gap-space-sm rounded-radius px-row-x ring-1 ring-inset", h.compact),
|
|
629
|
+
children: [/* @__PURE__ */ U(s, { children: e }), n ? /* @__PURE__ */ U("button", {
|
|
630
|
+
type: "button",
|
|
631
|
+
onClick: n,
|
|
632
|
+
className: i(A.target, A.focus, A.toggle),
|
|
633
|
+
"aria-label": t,
|
|
634
|
+
children: /* @__PURE__ */ U(ge, {
|
|
635
|
+
className: A.icon,
|
|
636
|
+
"aria-hidden": "true"
|
|
637
|
+
})
|
|
638
|
+
}) : null]
|
|
639
|
+
});
|
|
640
|
+
}
|
|
641
|
+
function we(e, t) {
|
|
642
|
+
return n(e, { name: t }, { missing: "empty" });
|
|
643
|
+
}
|
|
644
|
+
//#endregion
|
|
645
|
+
//#region src/components/features/comments/partials/comment-empty.tsx
|
|
646
|
+
var Te = ({ strings: e, icon: t, className: n }) => {
|
|
647
|
+
let r = Z(e);
|
|
648
|
+
return /* @__PURE__ */ U(ne, {
|
|
649
|
+
title: r.empty,
|
|
650
|
+
description: r.emptyHint || !1,
|
|
651
|
+
media: t ?? /* @__PURE__ */ U(q, {
|
|
652
|
+
className: "size-icon",
|
|
653
|
+
"aria-hidden": "true"
|
|
654
|
+
}),
|
|
655
|
+
mediaVariant: "icon-soft",
|
|
656
|
+
padding: "md",
|
|
657
|
+
className: i("comment-empty--component", n)
|
|
658
|
+
});
|
|
659
|
+
};
|
|
660
|
+
//#endregion
|
|
661
|
+
//#region src/components/features/comments/partials/comment-content.tsx
|
|
662
|
+
function Ee(e) {
|
|
663
|
+
let { comment: t, resources: n, renderReference: r, sanitizer: i } = e, a = t.contentType ?? t.content_type ?? "text";
|
|
664
|
+
if (a === "rich") {
|
|
665
|
+
let e = De(t.content);
|
|
666
|
+
return e ? /* @__PURE__ */ U("div", {
|
|
667
|
+
className: "comment-content--component",
|
|
668
|
+
children: e
|
|
669
|
+
}) : null;
|
|
670
|
+
}
|
|
671
|
+
if (a === "html") return /* @__PURE__ */ U("div", {
|
|
672
|
+
className: "comment-content--component",
|
|
673
|
+
children: /* @__PURE__ */ U(M, {
|
|
674
|
+
html: t.content ?? "",
|
|
675
|
+
mentions: t.references,
|
|
676
|
+
resources: n,
|
|
677
|
+
renderMention: r,
|
|
678
|
+
sanitizer: i
|
|
679
|
+
})
|
|
680
|
+
});
|
|
681
|
+
let s = Ae(t.content ?? "");
|
|
682
|
+
return /* @__PURE__ */ U(o, {
|
|
683
|
+
className: "comment-content--component whitespace-pre-line",
|
|
684
|
+
children: s
|
|
685
|
+
});
|
|
686
|
+
}
|
|
687
|
+
function De(e) {
|
|
688
|
+
if (!e) return null;
|
|
689
|
+
try {
|
|
690
|
+
let t = JSON.parse(e);
|
|
691
|
+
return !t || !Array.isArray(t.blocks) || t.blocks.length === 0 ? null : /* @__PURE__ */ U(o, {
|
|
692
|
+
tag: "div",
|
|
693
|
+
className: y,
|
|
694
|
+
children: t.blocks.map((e, t) => /* @__PURE__ */ U(N, { children: Oe(e) }, e.id ?? `${e.type}-${t}`))
|
|
695
|
+
});
|
|
696
|
+
} catch {
|
|
697
|
+
let t = Ae(e);
|
|
698
|
+
return /* @__PURE__ */ U(o, {
|
|
699
|
+
className: "whitespace-pre-line",
|
|
700
|
+
children: t
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
function Oe(e) {
|
|
705
|
+
let t = e.data ?? {};
|
|
706
|
+
switch (e.type) {
|
|
707
|
+
case "paragraph": {
|
|
708
|
+
let e = String(t.text ?? "").trim();
|
|
709
|
+
if (!e) return null;
|
|
710
|
+
let n = v(e);
|
|
711
|
+
return n ? /* @__PURE__ */ U("p", { dangerouslySetInnerHTML: { __html: n } }) : null;
|
|
712
|
+
}
|
|
713
|
+
case "header": {
|
|
714
|
+
let e = ke(String(t.text ?? "")), n = Number(t.level ?? 3);
|
|
715
|
+
return e ? se(`h${Math.min(Math.max(n, 1), 6)}`, null, e) : null;
|
|
716
|
+
}
|
|
717
|
+
case "list": {
|
|
718
|
+
let e = (Array.isArray(t.items) ? t.items : []).map((e) => ke(String(e ?? ""))).filter((e) => e.length > 0);
|
|
719
|
+
return e.length === 0 ? null : t.style === "ordered" ? /* @__PURE__ */ U("ol", { children: e.map((e, t) => /* @__PURE__ */ U("li", { children: /* @__PURE__ */ U(o, {
|
|
720
|
+
tag: "span",
|
|
721
|
+
children: e
|
|
722
|
+
}) }, `${e}-${t}`)) }) : /* @__PURE__ */ U("ul", { children: e.map((e) => /* @__PURE__ */ U("li", { children: /* @__PURE__ */ U(o, {
|
|
723
|
+
tag: "span",
|
|
724
|
+
children: e
|
|
725
|
+
}) }, e)) });
|
|
726
|
+
}
|
|
727
|
+
case "quote": {
|
|
728
|
+
let e = String(t.text ?? "").trim();
|
|
729
|
+
if (!e) return null;
|
|
730
|
+
let n = ke(String(t.caption ?? ""));
|
|
731
|
+
return /* @__PURE__ */ W("blockquote", {
|
|
732
|
+
className: "italic",
|
|
733
|
+
children: [/* @__PURE__ */ U(b, {
|
|
734
|
+
tag: "div",
|
|
735
|
+
html: e,
|
|
736
|
+
type: "secondary"
|
|
737
|
+
}), n.length > 0 && /* @__PURE__ */ U("cite", {
|
|
738
|
+
className: "mt-1 block not-italic",
|
|
739
|
+
children: /* @__PURE__ */ W(o, {
|
|
740
|
+
tag: "span",
|
|
741
|
+
size: "xs",
|
|
742
|
+
type: "secondary",
|
|
743
|
+
className: "opacity-80",
|
|
744
|
+
children: ["— ", n]
|
|
745
|
+
})
|
|
746
|
+
})]
|
|
747
|
+
});
|
|
748
|
+
}
|
|
749
|
+
case "delimiter": return /* @__PURE__ */ U("hr", {
|
|
750
|
+
className: "border-dashed",
|
|
751
|
+
"aria-hidden": "true"
|
|
752
|
+
});
|
|
753
|
+
default: {
|
|
754
|
+
let e = ke(String(t.text ?? ""));
|
|
755
|
+
return e ? /* @__PURE__ */ U("p", {
|
|
756
|
+
className: "whitespace-pre-line",
|
|
757
|
+
children: e
|
|
758
|
+
}) : null;
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
function ke(e) {
|
|
763
|
+
return e.replace(/<[^>]*>/g, "").trim();
|
|
764
|
+
}
|
|
765
|
+
function Ae(e) {
|
|
766
|
+
if (typeof e != "string") return "";
|
|
767
|
+
let t = e.trim();
|
|
768
|
+
if (t === "") return "";
|
|
769
|
+
if (t.startsWith("{") || t.startsWith("[")) return t;
|
|
770
|
+
try {
|
|
771
|
+
let e = JSON.parse(t);
|
|
772
|
+
if (typeof e == "string") return e;
|
|
773
|
+
} catch {}
|
|
774
|
+
return t.startsWith("\"") && t.endsWith("\"") ? t.slice(1, -1) : t;
|
|
775
|
+
}
|
|
776
|
+
//#endregion
|
|
777
|
+
//#region src/components/features/comments/partials/comment-item.tsx
|
|
778
|
+
var je = "?", Me = (e) => e?.url, Ne = (e) => e?.name, Pe = (e) => e.charAt(0).toUpperCase() + e.slice(1).replace(/_/g, " "), Fe = F(function({ comment: e, canModerate: t, onDelete: r, onAttachmentRemove: a, onEdit: s, onPinToggle: c, onReact: h, onReply: v, allowReactions: y, allowReplies: b, sanitizer: x, strings: S, getMediaUrl: C, getMediaName: ee, getStatusLabel: te, formatRelativeTime: ne, resources: re, renderAttachment: j, renderReference: ie }) {
|
|
779
|
+
let M = Z(S), ae = y ?? !0, oe = b ?? !0, N = _e({
|
|
780
|
+
getMediaUrl: C,
|
|
781
|
+
getMediaName: ee,
|
|
782
|
+
getStatusLabel: te,
|
|
783
|
+
formatRelativeTime: ne
|
|
784
|
+
}), se = N.getMediaUrl ?? Me, P = N.getMediaName ?? Ne, F = N.getStatusLabel ?? Pe, L = N.formatRelativeTime, R = e.user?.name ?? M.fallbackAuthor, B = e.user?.avatar ?? void 0, H = z(() => {
|
|
785
|
+
if (!R) return je;
|
|
786
|
+
let e = R.trim();
|
|
787
|
+
return e === "" ? je : e.charAt(0).toUpperCase();
|
|
788
|
+
}, [R]), ce = z(() => Array.isArray(e.tagsArray) ? e.tagsArray.filter((e) => typeof e == "string") : e.tagsArray && typeof e.tagsArray == "object" ? Object.values(e.tagsArray).filter((e) => typeof e == "string") : [], [e.tagsArray]), G = z(() => (e.attachments ?? []).filter((e) => !!e && typeof e == "object"), [e.attachments]), ue = ae ? e.reactions ?? [] : [], K = e.isPinned === !0, de = e.isEdited === !0, q = e.status && e.status !== "active", fe = q && e.status ? F(e.status) : null, pe = e.canDelete === !0 || t === !0, ge = e.canEdit === !0 || t === !0, Q = !!oe && !!v && !!e.id, ve = !!ae && !!h && !!e.id, be = !!c && !!t, xe = !!ge && !!s && !!e.id, Se = !!pe && !!r && !!e.id, Ce = Q || ve || be || xe || Se, $ = g(), [we, Te] = V(null), De = I((e) => {
|
|
789
|
+
Te(e), $.show();
|
|
790
|
+
}, [$]), Oe = G.length > 0;
|
|
791
|
+
return /* @__PURE__ */ W("article", {
|
|
792
|
+
className: i("comment-item--component group relative overflow-hidden rounded-radius border transition-colors", "border-border/60 bg-card hover:bg-muted/30 p-surface"),
|
|
793
|
+
"data-comment-id": e.id,
|
|
794
|
+
children: [/* @__PURE__ */ W(m, {
|
|
795
|
+
direction: "horizontal",
|
|
796
|
+
align: "start",
|
|
797
|
+
gap: "lg",
|
|
798
|
+
className: "min-w-0",
|
|
799
|
+
children: [/* @__PURE__ */ W(D, {
|
|
800
|
+
className: "mt-0.5 size-avatar shrink-0",
|
|
801
|
+
children: [!!B && /* @__PURE__ */ U(O, {
|
|
802
|
+
src: B,
|
|
803
|
+
alt: R
|
|
804
|
+
}), /* @__PURE__ */ U(E, {
|
|
805
|
+
className: "bg-muted text-muted-foreground text-xs font-medium",
|
|
806
|
+
children: H
|
|
807
|
+
})]
|
|
808
|
+
}), /* @__PURE__ */ W("div", {
|
|
809
|
+
className: "comment-item--body min-w-0 flex-1",
|
|
810
|
+
children: [
|
|
811
|
+
/* @__PURE__ */ W(m, {
|
|
812
|
+
direction: "horizontal",
|
|
813
|
+
align: "baseline",
|
|
814
|
+
gap: "md",
|
|
815
|
+
className: "min-w-0",
|
|
816
|
+
children: [
|
|
817
|
+
/* @__PURE__ */ U(o, {
|
|
818
|
+
tag: "span",
|
|
819
|
+
weight: "semibold",
|
|
820
|
+
className: "truncate",
|
|
821
|
+
children: R
|
|
822
|
+
}),
|
|
823
|
+
!!K && /* @__PURE__ */ U(f, {
|
|
824
|
+
delayDuration: 0,
|
|
825
|
+
children: /* @__PURE__ */ W(l, { children: [/* @__PURE__ */ U(u, {
|
|
826
|
+
render: /* @__PURE__ */ U("span", { className: "inline-flex shrink-0 self-center" }),
|
|
827
|
+
children: /* @__PURE__ */ U(Y, {
|
|
828
|
+
className: "text-warning-accent size-icon-sm",
|
|
829
|
+
"aria-hidden": !0
|
|
830
|
+
})
|
|
831
|
+
}), /* @__PURE__ */ U(d, {
|
|
832
|
+
side: "top",
|
|
833
|
+
className: "text-xs",
|
|
834
|
+
children: M.pinned
|
|
835
|
+
})] })
|
|
836
|
+
}),
|
|
837
|
+
/* @__PURE__ */ U(T, {
|
|
838
|
+
value: e.createdAt,
|
|
839
|
+
formatRelativeTime: L,
|
|
840
|
+
size: "xs",
|
|
841
|
+
className: "shrink-0 tabular-nums"
|
|
842
|
+
}),
|
|
843
|
+
!!de && /* @__PURE__ */ U(o, {
|
|
844
|
+
tag: "span",
|
|
845
|
+
size: "xs",
|
|
846
|
+
type: "secondary",
|
|
847
|
+
className: "shrink-0",
|
|
848
|
+
children: M.edited
|
|
849
|
+
}),
|
|
850
|
+
!!q && !!fe && /* @__PURE__ */ U(k, {
|
|
851
|
+
size: "sm",
|
|
852
|
+
tone: "secondary",
|
|
853
|
+
className: "self-center",
|
|
854
|
+
children: fe
|
|
855
|
+
})
|
|
856
|
+
]
|
|
857
|
+
}),
|
|
858
|
+
/* @__PURE__ */ U("div", {
|
|
859
|
+
className: "mt-1 leading-relaxed",
|
|
860
|
+
children: /* @__PURE__ */ U(Ee, {
|
|
861
|
+
comment: e,
|
|
862
|
+
resources: re,
|
|
863
|
+
renderReference: ie,
|
|
864
|
+
sanitizer: x
|
|
865
|
+
})
|
|
866
|
+
}),
|
|
867
|
+
ce.length > 0 && /* @__PURE__ */ U("div", {
|
|
868
|
+
className: "mt-space-md flex flex-wrap gap-space-sm",
|
|
869
|
+
children: ce.map((e) => /* @__PURE__ */ U(k, {
|
|
870
|
+
size: "sm",
|
|
871
|
+
tone: "secondary",
|
|
872
|
+
children: e
|
|
873
|
+
}, e))
|
|
874
|
+
}),
|
|
875
|
+
Oe && /* @__PURE__ */ U("div", {
|
|
876
|
+
className: "mt-space-md flex flex-wrap gap-space-sm",
|
|
877
|
+
children: G.map((e) => {
|
|
878
|
+
if (j) return /* @__PURE__ */ U("div", { children: j(e) }, e.id ?? e.name);
|
|
879
|
+
let t = !!a && !!e.id && pe;
|
|
880
|
+
return /* @__PURE__ */ U(ye, {
|
|
881
|
+
attachment: e,
|
|
882
|
+
editable: t,
|
|
883
|
+
onRemove: t ? () => De(e.id) : void 0,
|
|
884
|
+
accessors: {
|
|
885
|
+
getMediaUrl: se,
|
|
886
|
+
getMediaName: P
|
|
887
|
+
},
|
|
888
|
+
strings: S
|
|
889
|
+
}, e.id ?? e.name);
|
|
890
|
+
})
|
|
891
|
+
}),
|
|
892
|
+
ue.length > 0 && /* @__PURE__ */ U(m, {
|
|
893
|
+
direction: "horizontal",
|
|
894
|
+
wrap: !0,
|
|
895
|
+
align: "center",
|
|
896
|
+
gap: "xs",
|
|
897
|
+
className: "mt-space-md",
|
|
898
|
+
children: ue.map((t) => /* @__PURE__ */ U("button", {
|
|
899
|
+
type: "button",
|
|
900
|
+
"aria-label": n(M.reactionLabel ?? X.reactionLabel, {
|
|
901
|
+
emoji: t.emoji,
|
|
902
|
+
count: t.count
|
|
903
|
+
}),
|
|
904
|
+
"aria-pressed": t.mine ?? !1,
|
|
905
|
+
onClick: () => h && e.id ? h(e.id, t.emoji) : void 0,
|
|
906
|
+
title: t.users?.join(", "),
|
|
907
|
+
className: i(A.inline, A.focus),
|
|
908
|
+
children: /* @__PURE__ */ W(k, {
|
|
909
|
+
size: "sm",
|
|
910
|
+
tone: t.mine ? "primary" : "secondary",
|
|
911
|
+
className: "cursor-pointer transition-colors hover:opacity-90",
|
|
912
|
+
children: [/* @__PURE__ */ U(o, {
|
|
913
|
+
tag: "span",
|
|
914
|
+
size: "inherit",
|
|
915
|
+
lineHeight: "none",
|
|
916
|
+
className: "text-inherit",
|
|
917
|
+
"aria-hidden": !0,
|
|
918
|
+
children: t.emoji
|
|
919
|
+
}), /* @__PURE__ */ U(w, {
|
|
920
|
+
value: t.count,
|
|
921
|
+
size: "inherit",
|
|
922
|
+
align: "left",
|
|
923
|
+
className: "tabular-nums text-current"
|
|
924
|
+
})]
|
|
925
|
+
})
|
|
926
|
+
}, t.emoji))
|
|
927
|
+
}),
|
|
928
|
+
Ce && /* @__PURE__ */ W("div", {
|
|
929
|
+
className: i("comment-item--actions relative mt-space-md ms-auto w-fit max-w-full flex-wrap opacity-100 transition-opacity", "group-hover:opacity-100 focus-within:opacity-100", "inline-flex items-center gap-space-2xs rounded-radius bg-card/95 shadow-sm ring-1 ring-border/70"),
|
|
930
|
+
children: [
|
|
931
|
+
Q && /* @__PURE__ */ U(p, {
|
|
932
|
+
type: "button",
|
|
933
|
+
size: "sm",
|
|
934
|
+
iconOnly: !0,
|
|
935
|
+
tone: "secondary",
|
|
936
|
+
buttonStyle: "ghost",
|
|
937
|
+
onClick: () => e.id && v(e.id),
|
|
938
|
+
title: M.replyLabel,
|
|
939
|
+
"aria-label": M.replyLabel,
|
|
940
|
+
children: /* @__PURE__ */ U(le, { className: "size-icon-md" })
|
|
941
|
+
}),
|
|
942
|
+
ve && /* @__PURE__ */ U(p, {
|
|
943
|
+
type: "button",
|
|
944
|
+
size: "sm",
|
|
945
|
+
iconOnly: !0,
|
|
946
|
+
tone: "secondary",
|
|
947
|
+
buttonStyle: "ghost",
|
|
948
|
+
onClick: () => e.id && h(e.id, "👍"),
|
|
949
|
+
title: M.addReactionLabel,
|
|
950
|
+
"aria-label": M.addReactionLabel,
|
|
951
|
+
children: /* @__PURE__ */ U(me, { className: "size-icon-md" })
|
|
952
|
+
}),
|
|
953
|
+
be && /* @__PURE__ */ U(p, {
|
|
954
|
+
type: "button",
|
|
955
|
+
size: "sm",
|
|
956
|
+
iconOnly: !0,
|
|
957
|
+
tone: "secondary",
|
|
958
|
+
buttonStyle: "ghost",
|
|
959
|
+
onClick: () => c(e),
|
|
960
|
+
title: K ? M.unpinLabel : M.pinLabel,
|
|
961
|
+
"aria-label": K ? M.unpinLabel : M.pinLabel,
|
|
962
|
+
children: /* @__PURE__ */ U(Y, { className: i("size-icon-md", K && "text-warning-accent") })
|
|
963
|
+
}),
|
|
964
|
+
xe && /* @__PURE__ */ U(p, {
|
|
965
|
+
type: "button",
|
|
966
|
+
size: "sm",
|
|
967
|
+
iconOnly: !0,
|
|
968
|
+
tone: "secondary",
|
|
969
|
+
buttonStyle: "ghost",
|
|
970
|
+
title: M.editLabel,
|
|
971
|
+
"aria-label": M.editLabel,
|
|
972
|
+
onClick: () => s(e),
|
|
973
|
+
children: /* @__PURE__ */ U(J, { className: "size-icon-md" })
|
|
974
|
+
}),
|
|
975
|
+
Se && /* @__PURE__ */ U(p, {
|
|
976
|
+
type: "button",
|
|
977
|
+
size: "sm",
|
|
978
|
+
iconOnly: !0,
|
|
979
|
+
tone: "secondary",
|
|
980
|
+
buttonStyle: "ghost",
|
|
981
|
+
className: "hover:bg-destructive/10 hover:text-destructive",
|
|
982
|
+
onClick: () => r(e.id),
|
|
983
|
+
title: M.deleteLabel,
|
|
984
|
+
"aria-label": M.deleteLabel,
|
|
985
|
+
children: /* @__PURE__ */ U(he, { className: "size-icon-md" })
|
|
986
|
+
})
|
|
987
|
+
]
|
|
988
|
+
})
|
|
989
|
+
]
|
|
990
|
+
})]
|
|
991
|
+
}), !!a && /* @__PURE__ */ U(_, {
|
|
992
|
+
...$.overlayProps,
|
|
993
|
+
destructive: !0,
|
|
994
|
+
title: M.confirmRemoveAttachmentTitle,
|
|
995
|
+
description: M.confirmRemoveAttachmentDescription,
|
|
996
|
+
strings: { confirm: M.attachmentRemoveLabel },
|
|
997
|
+
onConfirm: () => {
|
|
998
|
+
we && e.id && a(e.id, we);
|
|
999
|
+
}
|
|
1000
|
+
})]
|
|
1001
|
+
});
|
|
1002
|
+
}), Ie = function({ comments: e, canModerate: t, onDelete: n, onAttachmentRemove: r, onEdit: i, onPinToggle: a, onReact: o, onReply: s, allowReactions: c, allowReplies: l, sanitizer: u, strings: d, getMediaUrl: f, getMediaName: p, getStatusLabel: h, formatRelativeTime: g, resources: _, renderItem: v, renderAttachment: y, renderReference: b, emptySlot: x }) {
|
|
1003
|
+
return e.length ? /* @__PURE__ */ U(m, {
|
|
1004
|
+
gap: "sm",
|
|
1005
|
+
className: "comment-timeline--component",
|
|
1006
|
+
children: e.map((e, m) => {
|
|
1007
|
+
let x = /* @__PURE__ */ U(Fe, {
|
|
1008
|
+
comment: e,
|
|
1009
|
+
canModerate: t,
|
|
1010
|
+
onDelete: n,
|
|
1011
|
+
onAttachmentRemove: r,
|
|
1012
|
+
onEdit: i,
|
|
1013
|
+
onPinToggle: a,
|
|
1014
|
+
onReact: o,
|
|
1015
|
+
onReply: s,
|
|
1016
|
+
allowReactions: c,
|
|
1017
|
+
allowReplies: l,
|
|
1018
|
+
sanitizer: u,
|
|
1019
|
+
strings: d,
|
|
1020
|
+
getMediaUrl: f,
|
|
1021
|
+
getMediaName: p,
|
|
1022
|
+
getStatusLabel: h,
|
|
1023
|
+
formatRelativeTime: g,
|
|
1024
|
+
resources: _,
|
|
1025
|
+
renderAttachment: y,
|
|
1026
|
+
renderReference: b
|
|
1027
|
+
});
|
|
1028
|
+
return v ? /* @__PURE__ */ U("div", { children: v({
|
|
1029
|
+
comment: e,
|
|
1030
|
+
canModerate: t ?? !1,
|
|
1031
|
+
onDelete: n,
|
|
1032
|
+
onAttachmentRemove: r,
|
|
1033
|
+
onEdit: i,
|
|
1034
|
+
defaultItem: x
|
|
1035
|
+
}) }, e.id ?? `comment-${m}`) : /* @__PURE__ */ U("div", { children: x }, e.id ?? `comment-${m}`);
|
|
1036
|
+
})
|
|
1037
|
+
}) : /* @__PURE__ */ U(H, { children: x ?? /* @__PURE__ */ U(Te, { strings: d }) });
|
|
1038
|
+
};
|
|
1039
|
+
//#endregion
|
|
1040
|
+
//#region src/components/features/comments/comments.tsx
|
|
1041
|
+
function Le(t) {
|
|
1042
|
+
let n = e(), r = t.composerPosition ?? n.composerPosition ?? "top", a = t.maxAttachments ?? 5, s = t.allowAttachments ?? !0, c = t.allowReactions ?? !0, l = t.allowReplies ?? !0, u = t.canComment ?? !1, d = t.canModerate ?? !1, f = t.onPinToggle, p = t.resources, h = t.attachments, v = Z(t.strings), y = t.title === void 0 ? v.title : t.title, b = t.confirmDelete ?? !0, x = g(), [S, C] = V(null), w = Q({
|
|
1043
|
+
onSubmit: t.onSubmit,
|
|
1044
|
+
onUpdate: t.onUpdate,
|
|
1045
|
+
onDelete: t.onDelete,
|
|
1046
|
+
onAfterMutate: t.onAfterMutate,
|
|
1047
|
+
onError: t.onError
|
|
1048
|
+
}), T = I((e) => {
|
|
1049
|
+
if (!b) {
|
|
1050
|
+
w.deleteComment(e);
|
|
1051
|
+
return;
|
|
1052
|
+
}
|
|
1053
|
+
C(e), x.show();
|
|
1054
|
+
}, [
|
|
1055
|
+
b,
|
|
1056
|
+
w,
|
|
1057
|
+
x
|
|
1058
|
+
]), E = w.startReply, D = t.comments, O = t.onReply, k = I((e) => {
|
|
1059
|
+
let t = D.find((t) => t.id === e);
|
|
1060
|
+
t && E(t), O?.(e);
|
|
1061
|
+
}, [
|
|
1062
|
+
D,
|
|
1063
|
+
O,
|
|
1064
|
+
E
|
|
1065
|
+
]), A = w.composerMode.kind === "editing" ? w.composerMode.comment : void 0, ee = w.composerMode.kind === "replying" ? {
|
|
1066
|
+
commentId: w.composerMode.commentId,
|
|
1067
|
+
authorName: w.composerMode.authorName
|
|
1068
|
+
} : void 0, te = t.composerSlot ?? (u ? /* @__PURE__ */ U(Ce, {
|
|
1069
|
+
context: t.context,
|
|
1070
|
+
canComment: u,
|
|
1071
|
+
submitting: w.isSubmitting,
|
|
1072
|
+
errors: w.formErrors,
|
|
1073
|
+
resetKey: w.resetKey,
|
|
1074
|
+
editingComment: A,
|
|
1075
|
+
replyingTo: ee,
|
|
1076
|
+
onCancel: w.composerMode.kind === "idle" ? void 0 : w.cancelComposerMode,
|
|
1077
|
+
onSubmit: w.submit,
|
|
1078
|
+
strings: t.strings,
|
|
1079
|
+
resources: p,
|
|
1080
|
+
onResourceSearch: t.onResourceSearch,
|
|
1081
|
+
attachments: h,
|
|
1082
|
+
maxAttachments: a,
|
|
1083
|
+
allowAttachments: s
|
|
1084
|
+
}) : null), ne = /* @__PURE__ */ U(Ie, {
|
|
1085
|
+
comments: t.comments,
|
|
1086
|
+
canModerate: d,
|
|
1087
|
+
onDelete: t.onDelete ? T : void 0,
|
|
1088
|
+
onAttachmentRemove: t.onAttachmentRemove,
|
|
1089
|
+
onEdit: u && t.onUpdate ? w.startEdit : void 0,
|
|
1090
|
+
onPinToggle: f,
|
|
1091
|
+
onReact: t.onReact,
|
|
1092
|
+
onReply: u && l ? k : void 0,
|
|
1093
|
+
allowReactions: c,
|
|
1094
|
+
allowReplies: l,
|
|
1095
|
+
sanitizer: t.sanitizer,
|
|
1096
|
+
strings: t.strings,
|
|
1097
|
+
getMediaUrl: t.getMediaUrl,
|
|
1098
|
+
getMediaName: t.getMediaName,
|
|
1099
|
+
getStatusLabel: t.getStatusLabel,
|
|
1100
|
+
formatRelativeTime: t.formatRelativeTime,
|
|
1101
|
+
resources: p,
|
|
1102
|
+
renderItem: t.renderItem,
|
|
1103
|
+
renderAttachment: t.renderAttachment,
|
|
1104
|
+
renderReference: t.renderReference,
|
|
1105
|
+
emptySlot: t.emptySlot ?? /* @__PURE__ */ U(Te, { strings: t.strings })
|
|
1106
|
+
}), re = te ? /* @__PURE__ */ U("div", { children: te }) : null, j = /* @__PURE__ */ W(m, {
|
|
1107
|
+
gap: "xl",
|
|
1108
|
+
className: "comments--body",
|
|
1109
|
+
children: [
|
|
1110
|
+
t.headerSlot,
|
|
1111
|
+
r === "top" && re,
|
|
1112
|
+
ne,
|
|
1113
|
+
r === "bottom" && re,
|
|
1114
|
+
t.footerSlot
|
|
1115
|
+
]
|
|
1116
|
+
});
|
|
1117
|
+
if (t.bare) return j;
|
|
1118
|
+
let ie = typeof y == "string" ? y : void 0;
|
|
1119
|
+
return /* @__PURE__ */ W(m, {
|
|
1120
|
+
render: /* @__PURE__ */ U("section", {}),
|
|
1121
|
+
gap: "lg",
|
|
1122
|
+
"data-component": "comments",
|
|
1123
|
+
"data-slot": "comments",
|
|
1124
|
+
className: i("comments--component", t.className),
|
|
1125
|
+
"aria-label": ie,
|
|
1126
|
+
children: [
|
|
1127
|
+
!(y === !1 || !y && !v.subtitle) && /* @__PURE__ */ W(m, {
|
|
1128
|
+
gap: "normal",
|
|
1129
|
+
className: "comments--header",
|
|
1130
|
+
children: [!!y && /* @__PURE__ */ U(o, {
|
|
1131
|
+
weight: "semibold",
|
|
1132
|
+
children: y
|
|
1133
|
+
}), !!v.subtitle && /* @__PURE__ */ U(o, {
|
|
1134
|
+
type: "secondary",
|
|
1135
|
+
children: v.subtitle
|
|
1136
|
+
})]
|
|
1137
|
+
}),
|
|
1138
|
+
j,
|
|
1139
|
+
!!(b && t.onDelete) && /* @__PURE__ */ U(_, {
|
|
1140
|
+
...x.overlayProps,
|
|
1141
|
+
destructive: !0,
|
|
1142
|
+
title: v.confirmDeleteTitle,
|
|
1143
|
+
description: v.confirmDeleteDescription,
|
|
1144
|
+
strings: { confirm: v.confirmDeleteLabel },
|
|
1145
|
+
onAsyncConfirm: async () => {
|
|
1146
|
+
S && await w.deleteComment(S);
|
|
1147
|
+
},
|
|
1148
|
+
onError: t.onError
|
|
1149
|
+
})
|
|
1150
|
+
]
|
|
1151
|
+
});
|
|
1152
|
+
}
|
|
1153
|
+
//#endregion
|
|
1154
|
+
export { Te as a, xe as c, _e as d, Z as f, Ee as i, ye as l, Ie as n, Ce as o, X as p, Fe as r, we as s, Le as t, Q as u };
|
|
1155
|
+
|
|
1156
|
+
//# sourceMappingURL=comments-u5L0OGip.js.map
|