themelia-react-ui 2.0.2 → 2.0.4
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 +67 -7
- package/README.md +70 -37
- package/THIRD_PARTY_NOTICES.md +6 -12
- package/dist/{accordion-Cjb6sx0G.js → accordion-96o0pN62.js} +5 -5
- package/dist/{accordion-Cjb6sx0G.js.map → accordion-96o0pN62.js.map} +1 -1
- package/dist/action-menu-CHgs8vmj.js +281 -0
- package/dist/action-menu-CHgs8vmj.js.map +1 -0
- package/dist/{affordance-geometry.generated-tF36bREk.js → affordance-geometry.generated-B8yGOr8-.js} +7 -1
- package/dist/affordance-geometry.generated-B8yGOr8-.js.map +1 -0
- package/dist/{ai-artifact-DvTwDVyL.js → ai-artifact-BZUGwBq6.js} +277 -276
- package/dist/ai-artifact-BZUGwBq6.js.map +1 -0
- package/dist/{app-shell-C4FhvCqF.js → app-shell-D63ATkIK.js} +84 -83
- package/dist/app-shell-D63ATkIK.js.map +1 -0
- package/dist/{attachment-BxDfL2mw.js → attachment-DkoqHPPl.js} +7 -7
- package/dist/{attachment-BxDfL2mw.js.map → attachment-DkoqHPPl.js.map} +1 -1
- package/dist/{auth-ax2BqjrI.js → auth-D2FVZ1MH.js} +10 -10
- package/dist/{auth-ax2BqjrI.js.map → auth-D2FVZ1MH.js.map} +1 -1
- package/dist/{avatar-DAPlDvhJ.js → avatar-DWO_HHhB.js} +5 -5
- package/dist/{avatar-DAPlDvhJ.js.map → avatar-DWO_HHhB.js.map} +1 -1
- package/dist/{badge-HpFqoqSY.js → badge-DErMA7ul.js} +4 -4
- package/dist/{badge-HpFqoqSY.js.map → badge-DErMA7ul.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/batch-action-bar.js +1 -1
- package/dist/base/buttons.js +1 -1
- package/dist/base/cards.js +2 -2
- package/dist/base/carousel.js +3 -3
- package/dist/base/cascader.js +13 -13
- package/dist/base/chart.js +1 -1
- package/dist/base/choice-inputs.js +2 -2
- package/dist/base/code-block.js +1 -1
- package/dist/base/combobox.js +2 -2
- package/dist/base/command.js +1 -1
- package/dist/base/copyable.js +1 -1
- package/dist/base/date-pickers.js +2 -2
- package/dist/base/display.js +6 -6
- package/dist/base/feedback.js +3 -3
- package/dist/base/forms-numeric.js +1 -1
- package/dist/base/forms.js +3 -3
- package/dist/base/inline-edit.js +10 -10
- package/dist/base/item.js +1 -1
- package/dist/base/media-gallery.js +1 -1
- package/dist/base/metadata-list.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 +9 -9
- package/dist/base/sheet.js +1 -1
- package/dist/base/sidebar.js +1 -1
- package/dist/base/signature-pad.js +6 -6
- package/dist/base/skeleton.js +1 -1
- package/dist/base/spinner.js +4 -4
- 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 +3 -3
- 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/{batch-action-bar-DnUJ21NQ.js → batch-action-bar-CdfIkCsV.js} +4 -4
- package/dist/{batch-action-bar-DnUJ21NQ.js.map → batch-action-bar-CdfIkCsV.js.map} +1 -1
- package/dist/blocks/admin.js +20 -20
- package/dist/blocks/admin.js.map +1 -1
- package/dist/blocks/ai.js +15 -15
- package/dist/blocks/analytics/usage-card.js +1 -1
- package/dist/blocks/analytics.js +17 -17
- package/dist/blocks/analytics.js.map +1 -1
- package/dist/blocks/collaboration.js +1 -1
- package/dist/blocks/commerce/receipt.js +1 -1
- package/dist/blocks/commerce.js +570 -567
- package/dist/blocks/commerce.js.map +1 -1
- package/dist/blocks/data-display.js +2 -2
- package/dist/blocks/onboarding.js +5 -5
- package/dist/blocks/planning.js +11 -11
- package/dist/blocks/timelines.js +1 -1
- package/dist/{breadcrumbs-C-oqs1sQ.js → breadcrumbs-B-WFKecD.js} +4 -4
- package/dist/{breadcrumbs-C-oqs1sQ.js.map → breadcrumbs-B-WFKecD.js.map} +1 -1
- package/dist/{button-DVzspB_G.js → button-DkmK-z8E.js} +2 -2
- package/dist/{button-DVzspB_G.js.map → button-DkmK-z8E.js.map} +1 -1
- package/dist/{buttons-DPZekJFu.js → buttons-BbfzgczK.js} +8 -8
- package/dist/{buttons-DPZekJFu.js.map → buttons-BbfzgczK.js.map} +1 -1
- package/dist/{cards-BaBZR-AU.js → cards-4JTWqvVe.js} +10 -10
- package/dist/cards-4JTWqvVe.js.map +1 -0
- package/dist/{chart-ZOYyK2xG.js → chart-C19flDQb.js} +4 -4
- package/dist/{chart-ZOYyK2xG.js.map → chart-C19flDQb.js.map} +1 -1
- package/dist/{checkbox-AWIhNhmo.js → checkbox-CzYUTPeJ.js} +9 -5
- package/dist/checkbox-CzYUTPeJ.js.map +1 -0
- package/dist/{choice-inputs-CNHvARCJ.js → choice-inputs-JLtij2y4.js} +182 -176
- package/dist/choice-inputs-JLtij2y4.js.map +1 -0
- package/dist/{code-block-DeneBJR_.js → code-block-CGNaUtAE.js} +7 -7
- package/dist/{code-block-DeneBJR_.js.map → code-block-CGNaUtAE.js.map} +1 -1
- package/dist/{collapsible-C-_l4hpy.js → collapsible-Do4G0zcC.js} +3 -3
- package/dist/{collapsible-C-_l4hpy.js.map → collapsible-Do4G0zcC.js.map} +1 -1
- package/dist/{collection-content-By56pLog.js → collection-content-C0e8SsTm.js} +3 -3
- package/dist/{collection-content-By56pLog.js.map → collection-content-C0e8SsTm.js.map} +1 -1
- package/dist/{combobox-C0EQW6dr.js → combobox-CBJDs6w_.js} +349 -347
- package/dist/combobox-CBJDs6w_.js.map +1 -0
- package/dist/{combobox-xCQ2RMNE.js → combobox-hbhSS18O.js} +158 -112
- package/dist/combobox-hbhSS18O.js.map +1 -0
- package/dist/{command-C25VMRII.js → command-D8NrBj-b.js} +7 -7
- package/dist/{command-C25VMRII.js.map → command-D8NrBj-b.js.map} +1 -1
- package/dist/{comments-BYYlTA8E.js → comments-Di4w0H_S.js} +383 -382
- package/dist/comments-Di4w0H_S.js.map +1 -0
- package/dist/components/base/action-menu/action-menu.d.ts +2 -0
- package/dist/components/base/cards/card.recipes.d.ts +12 -5
- package/dist/components/base/cards/smart-card.types.d.ts +12 -7
- package/dist/components/base/choice-inputs/checkbox.d.ts +7 -2
- package/dist/components/base/choice-inputs/switch-card.d.ts +7 -0
- package/dist/components/base/choice-inputs/toggle-field.d.ts +7 -0
- package/dist/components/base/combobox/combobox-field.d.ts +16 -0
- package/dist/components/base/date-pickers/datepicker.types.d.ts +7 -0
- package/dist/components/base/forms/controlled-form-field.d.ts +6 -6
- package/dist/components/base/forms/form-field.d.ts +5 -3
- package/dist/components/base/forms/index.d.ts +1 -0
- package/dist/components/base/forms/server-errors.d.ts +16 -0
- package/dist/components/base/forms/workflow.d.ts +5 -2
- package/dist/components/base/metadata-list/metadata-list.d.ts +3 -1
- package/dist/components/base/navigation/page-header/page-header.d.ts +4 -2
- package/dist/components/base/structure/composition.recipes.d.ts +17 -0
- package/dist/components/base/text-inputs/hooks/use-form-field-state.d.ts +7 -2
- package/dist/components/base/text-inputs/input.d.ts +4 -2
- package/dist/components/base/text-inputs/textarea.d.ts +4 -2
- package/dist/components/base/value-inputs/date-time-input.d.ts +2 -1
- package/dist/components/base/value-inputs/slider.d.ts +5 -1
- package/dist/components/base/value-inputs/tags-input.d.ts +5 -1
- package/dist/components/typography/text.styles.d.ts +26 -1
- package/dist/components/ui/combobox-dismiss.d.ts +16 -0
- package/dist/components/ui/combobox.d.ts +11 -6
- package/dist/components/ui/dialog.d.ts +1 -1
- package/dist/components/ui/popover.d.ts +1 -1
- package/dist/components/ui/sheet.d.ts +1 -1
- package/dist/composition.recipes-COdiFhxB.js +19 -0
- package/dist/composition.recipes-COdiFhxB.js.map +1 -0
- package/dist/containers-CRmHf7GP.js +104 -0
- package/dist/containers-CRmHf7GP.js.map +1 -0
- package/dist/{copyable-ClBuk_UK.js → copyable-CnGCZdX4.js} +4 -4
- package/dist/{copyable-ClBuk_UK.js.map → copyable-CnGCZdX4.js.map} +1 -1
- package/dist/{data-display-DT_khPl_.js → data-display-D4oujtx0.js} +239 -238
- package/dist/data-display-D4oujtx0.js.map +1 -0
- package/dist/{date-DCrsDTZc.js → date-Q7jnXxpk.js} +5 -5
- package/dist/{date-DCrsDTZc.js.map → date-Q7jnXxpk.js.map} +1 -1
- package/dist/{date-picker-ay0Pha_a.js → date-picker-zOt1oNss.js} +102 -90
- package/dist/date-picker-zOt1oNss.js.map +1 -0
- package/dist/date-pickers-cj8IXbDC.js +179 -0
- package/dist/date-pickers-cj8IXbDC.js.map +1 -0
- package/dist/{display-hAc1HjpI.js → display-BB4BL_-K.js} +8 -8
- package/dist/{display-hAc1HjpI.js.map → display-BB4BL_-K.js.map} +1 -1
- package/dist/{dropdown-menu-Cl4X7L5S.js → dropdown-menu-CjY8Vt7W.js} +8 -8
- package/dist/{dropdown-menu-Cl4X7L5S.js.map → dropdown-menu-CjY8Vt7W.js.map} +1 -1
- package/dist/features/activities.js +11 -11
- package/dist/features/ai-chat.js +9 -9
- package/dist/features/appointment-calendar.js +222 -220
- package/dist/features/appointment-calendar.js.map +1 -1
- package/dist/features/async-preview.js +8 -8
- package/dist/features/combobox.js +1 -1
- package/dist/features/comments.js +1 -1
- package/dist/features/data-view.js +10 -10
- package/dist/features/email-composer.js +275 -274
- package/dist/features/email-composer.js.map +1 -1
- package/dist/features/event-calendar.js +199 -198
- package/dist/features/event-calendar.js.map +1 -1
- package/dist/features/filters.js +1 -1
- package/dist/features/global-search.js +12 -12
- package/dist/features/kanban.js +4 -4
- package/dist/features/map.js +7 -7
- package/dist/features/media-library.js +623 -622
- 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 +973 -969
- package/dist/features/products.js.map +1 -1
- package/dist/features/questionnaire.js +12 -12
- package/dist/features/resource-assignment.js +8 -8
- package/dist/features/resource.js +113 -112
- package/dist/features/resource.js.map +1 -1
- package/dist/features/rich-text-editor.js +2 -2
- package/dist/features/schema-form.js +254 -253
- package/dist/features/schema-form.js.map +1 -1
- package/dist/features/suggestions.js +3 -3
- package/dist/features/sync.js +3 -3
- package/dist/features/table.js +1 -1
- package/dist/features/theme-tweaker.js +19 -19
- package/dist/features/theme-tweaker.js.map +1 -1
- package/dist/{feedback-BYIhtitP.js → feedback-DZNL5Lg1.js} +9 -9
- package/dist/{feedback-BYIhtitP.js.map → feedback-DZNL5Lg1.js.map} +1 -1
- package/dist/{field-affordance-recipes-DZhnIL_Y.js → field-affordance-recipes-DjwGx8eM.js} +2 -2
- package/dist/{field-affordance-recipes-DZhnIL_Y.js.map → field-affordance-recipes-DjwGx8eM.js.map} +1 -1
- package/dist/{filters-BGfvjP4d.js → filters-BcT-uoFy.js} +19 -19
- package/dist/{filters-BGfvjP4d.js.map → filters-BcT-uoFy.js.map} +1 -1
- package/dist/{form-field-CwH9y77i.js → form-field-CsgRmdit.js} +14 -8
- package/dist/form-field-CsgRmdit.js.map +1 -0
- package/dist/{form-sizing-BdP_Mf5p.js → form-sizing-NXgjkmBG.js} +3 -3
- package/dist/{form-sizing-BdP_Mf5p.js.map → form-sizing-NXgjkmBG.js.map} +1 -1
- package/dist/{forms-B9G_xwzi.js → forms-BV5m5aQF.js} +83 -65
- package/dist/forms-BV5m5aQF.js.map +1 -0
- package/dist/{forms-numeric-B_jraJaQ.js → forms-numeric-Cd33AKbD.js} +288 -288
- package/dist/forms-numeric-Cd33AKbD.js.map +1 -0
- package/dist/{header-CGXuhcRm.js → header-BA697l4a.js} +14 -14
- package/dist/{header-CGXuhcRm.js.map → header-BA697l4a.js.map} +1 -1
- package/dist/hooks/useFormErrors.d.ts +1 -1
- package/dist/{hooks-Dkz0K2WT.js → hooks-BQ-L7Uu2.js} +2 -2
- package/dist/{hooks-Dkz0K2WT.js.map → hooks-BQ-L7Uu2.js.map} +1 -1
- package/dist/{icon-badge-DYKIwvOV.js → icon-badge-COWbCCWu.js} +3 -3
- package/dist/{icon-badge-DYKIwvOV.js.map → icon-badge-COWbCCWu.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/input-Cdw4k0fb.js +289 -0
- package/dist/input-Cdw4k0fb.js.map +1 -0
- package/dist/{input-CZw8iU99.js → input-DOPL5_QE.js} +3 -3
- package/dist/{input-CZw8iU99.js.map → input-DOPL5_QE.js.map} +1 -1
- package/dist/item-BvZ2DR_x.js +277 -0
- package/dist/item-BvZ2DR_x.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 +6 -0
- package/dist/lib/ui-provider/types.d.ts +1 -1
- package/dist/lib/use-popup-focus-recovery.d.ts +8 -0
- package/dist/lib/utils.js +1 -1
- package/dist/{media-gallery-3zIVLMWH.js → media-gallery-CSl5W1Fy.js} +6 -6
- package/dist/{media-gallery-3zIVLMWH.js.map → media-gallery-CSl5W1Fy.js.map} +1 -1
- package/dist/{mentions-utuUvH1K.js → mentions-RKOQaaIB.js} +8 -8
- package/dist/{mentions-utuUvH1K.js.map → mentions-RKOQaaIB.js.map} +1 -1
- package/dist/{message-DZ_ruyUV.js → message-INU2xsxu.js} +4 -4
- package/dist/{message-DZ_ruyUV.js.map → message-INU2xsxu.js.map} +1 -1
- package/dist/metadata-list-qVV7AVxa.js +443 -0
- package/dist/metadata-list-qVV7AVxa.js.map +1 -0
- package/dist/{navigation-BzhHI3lo.js → navigation-BQNcg1jT.js} +8 -8
- package/dist/{navigation-BzhHI3lo.js.map → navigation-BQNcg1jT.js.map} +1 -1
- package/dist/{navigation-Bnotn4AQ.js → navigation-DLF3E1IC.js} +7 -7
- package/dist/{navigation-Bnotn4AQ.js.map → navigation-DLF3E1IC.js.map} +1 -1
- package/dist/{navigation-row-recipes-BFLCk_Aq.js → navigation-row-recipes-WZEs-hYo.js} +2 -2
- package/dist/{navigation-row-recipes-BFLCk_Aq.js.map → navigation-row-recipes-WZEs-hYo.js.map} +1 -1
- package/dist/{number-DbV1Dija.js → number-E_OiIfJz.js} +5 -5
- package/dist/{number-DbV1Dija.js.map → number-E_OiIfJz.js.map} +1 -1
- package/dist/{overflow-tab-bar-CWY7Nogn.js → overflow-tab-bar-CrbqMteP.js} +107 -105
- package/dist/overflow-tab-bar-CrbqMteP.js.map +1 -0
- package/dist/{overlays-DNWmZrJ4.js → overlays-BlKynmde.js} +322 -319
- package/dist/overlays-BlKynmde.js.map +1 -0
- package/dist/page-CIwNUtGr.js +227 -0
- package/dist/page-CIwNUtGr.js.map +1 -0
- package/dist/page-header-commands-DFMlNYzN.js +128 -0
- package/dist/page-header-commands-DFMlNYzN.js.map +1 -0
- package/dist/{pagination-BL25hu2s.js → pagination-Ch8X_47u.js} +5 -5
- package/dist/{pagination-BL25hu2s.js.map → pagination-Ch8X_47u.js.map} +1 -1
- package/dist/{popover-menu-B9WWygpa.js → popover-menu-BYaCdFhf.js} +6 -6
- package/dist/{popover-menu-B9WWygpa.js.map → popover-menu-BYaCdFhf.js.map} +1 -1
- package/dist/{popover-7_m66eYW.js → popover-uwzX2vo7.js} +65 -63
- package/dist/popover-uwzX2vo7.js.map +1 -0
- package/dist/{primitives-BFK08r9M.js → primitives-Du64iDbb.js} +6 -6
- package/dist/{primitives-BFK08r9M.js.map → primitives-Du64iDbb.js.map} +1 -1
- package/dist/primitives.js +4 -4
- package/dist/{progress-B1VnCT0K.js → progress-BvF2oCdV.js} +5 -5
- package/dist/{progress-B1VnCT0K.js.map → progress-BvF2oCdV.js.map} +1 -1
- package/dist/{receipt-BVSOH3Xo.js → receipt-D789Jwyy.js} +6 -6
- package/dist/{receipt-BVSOH3Xo.js.map → receipt-D789Jwyy.js.map} +1 -1
- package/dist/{rich-text-GOUyKQ-s.js → rich-text-CLJEf76s.js} +4 -4
- package/dist/{rich-text-GOUyKQ-s.js.map → rich-text-CLJEf76s.js.map} +1 -1
- package/dist/{rich-text-editor-cRLC-eBK.js → rich-text-editor-Cm1dpUpQ.js} +10 -10
- package/dist/{rich-text-editor-cRLC-eBK.js.map → rich-text-editor-Cm1dpUpQ.js.map} +1 -1
- package/dist/{rich-text-editor-toolbar-DfXg0-VC.js → rich-text-editor-toolbar-L__e4x47.js} +4 -4
- package/dist/{rich-text-editor-toolbar-DfXg0-VC.js.map → rich-text-editor-toolbar-L__e4x47.js.map} +1 -1
- package/dist/{scroll-area-DcI-M1UT.js → scroll-area-La5RXsEk.js} +2 -2
- package/dist/{scroll-area-DcI-M1UT.js.map → scroll-area-La5RXsEk.js.map} +1 -1
- package/dist/{separator-Bom7NsGO.js → separator-DAEV0w65.js} +2 -2
- package/dist/{separator-Bom7NsGO.js.map → separator-DAEV0w65.js.map} +1 -1
- package/dist/{separator-BDV-Y648.js → separator-GNfPG-90.js} +3 -3
- package/dist/{separator-BDV-Y648.js.map → separator-GNfPG-90.js.map} +1 -1
- package/dist/services/actions.js +1 -1
- package/dist/settings-BA2iboic.js +174 -0
- package/dist/settings-BA2iboic.js.map +1 -0
- package/dist/{sheet-CGpB3omz.js → sheet-DoAxTb2J.js} +75 -73
- package/dist/sheet-DoAxTb2J.js.map +1 -0
- package/dist/{sidebar-A0ElHINE.js → sidebar-ByqKR_W5.js} +13 -13
- package/dist/{sidebar-A0ElHINE.js.map → sidebar-ByqKR_W5.js.map} +1 -1
- package/dist/{sidebar-CPx_7YBa.js → sidebar-D2iSnGJ7.js} +11 -11
- package/dist/{sidebar-CPx_7YBa.js.map → sidebar-D2iSnGJ7.js.map} +1 -1
- package/dist/{skeleton-Byjnt7qr.js → skeleton-CUj8O5Bd.js} +3 -3
- package/dist/{skeleton-Byjnt7qr.js.map → skeleton-CUj8O5Bd.js.map} +1 -1
- package/dist/smart-card-CqkzQsK-.js +614 -0
- package/dist/smart-card-CqkzQsK-.js.map +1 -0
- package/dist/{structure-BmisBK-3.js → structure-C0V0_Fyf.js} +3 -3
- package/dist/{structure-BmisBK-3.js.map → structure-C0V0_Fyf.js.map} +1 -1
- package/dist/{structure.recipes-EPz60cU8.js → structure.recipes-BB4-n58V.js} +2 -2
- package/dist/{structure.recipes-EPz60cU8.js.map → structure.recipes-BB4-n58V.js.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{table-DsfzoUia.js → table-CpvnzJn9.js} +3 -3
- package/dist/{table-DsfzoUia.js.map → table-CpvnzJn9.js.map} +1 -1
- package/dist/{table-BweFy_P9.js → table-DH7rozUv.js} +19 -19
- package/dist/{table-BweFy_P9.js.map → table-DH7rozUv.js.map} +1 -1
- package/dist/{tabs-CDocW5D1.js → tabs-eqVsJZWO.js} +7 -7
- package/dist/{tabs-CDocW5D1.js.map → tabs-eqVsJZWO.js.map} +1 -1
- package/dist/{text-inputs-f9Ia-aCi.js → text-inputs-DXItiR0O.js} +101 -98
- package/dist/text-inputs-DXItiR0O.js.map +1 -0
- package/dist/{text.styles-g4He6UIW.js → text.styles-B64My8RZ.js} +25 -10
- package/dist/text.styles-B64My8RZ.js.map +1 -0
- package/dist/theme.css +152 -112
- package/dist/{timelines-CwM_9IhD.js → timelines-DmtztAY_.js} +10 -10
- package/dist/{timelines-CwM_9IhD.js.map → timelines-DmtztAY_.js.map} +1 -1
- package/dist/{tooltip-yiRJUFjp.js → tooltip-B4hjKtoV.js} +3 -3
- package/dist/{tooltip-yiRJUFjp.js.map → tooltip-B4hjKtoV.js.map} +1 -1
- package/dist/{tree-WnKQzwbq.js → tree-CV11PURP.js} +8 -8
- package/dist/{tree-WnKQzwbq.js.map → tree-CV11PURP.js.map} +1 -1
- package/dist/typography/rich-text.js +1 -1
- package/dist/typography-CSyJrh28.js +117 -0
- package/dist/typography-CSyJrh28.js.map +1 -0
- package/dist/typography.js +1 -1
- package/dist/{ui-provider-C_U0Xma4.js → ui-provider-CQCuCBcy.js} +3 -3
- package/dist/ui-provider-CQCuCBcy.js.map +1 -0
- package/dist/ui-provider.js +1 -1
- package/dist/{upload-CXyxmQBP.js → upload-C9SA0X-8.js} +11 -11
- package/dist/{upload-CXyxmQBP.js.map → upload-C9SA0X-8.js.map} +1 -1
- package/dist/{upload-queue-Boscubn9.js → upload-queue-DhQJiSRc.js} +9 -9
- package/dist/{upload-queue-Boscubn9.js.map → upload-queue-DhQJiSRc.js.map} +1 -1
- package/dist/{usage-card-BhO5eqkX.js → usage-card-DVTRDmGz.js} +134 -133
- package/dist/usage-card-DVTRDmGz.js.map +1 -0
- package/dist/use-popup-focus-recovery-C0QPvgOR.js +36 -0
- package/dist/use-popup-focus-recovery-C0QPvgOR.js.map +1 -0
- package/dist/{utils-BRhFDwuU.js → utils-CF3c95Io.js} +68 -5
- package/dist/utils-CF3c95Io.js.map +1 -0
- package/dist/value-inputs-C0o70p-U.js +980 -0
- package/dist/value-inputs-C0o70p-U.js.map +1 -0
- package/dist/{value-typography-BP8OG6h5.js → value-typography-ClupF0Gz.js} +2 -2
- package/dist/{value-typography-BP8OG6h5.js.map → value-typography-ClupF0Gz.js.map} +1 -1
- package/dist/workspace-9EFVXUyk.js +410 -0
- package/dist/workspace-9EFVXUyk.js.map +1 -0
- package/docs/consumer-skill/SKILL.md +14 -129
- package/docs/consumer-skill/examples/app-layout.tsx +22 -12
- package/docs/consumer-skill/examples/authentication.tsx +77 -0
- package/docs/consumer-skill/examples/edit.tsx +30 -38
- package/docs/consumer-skill/examples/manifest.json +51 -1
- package/docs/consumer-skill/examples/rhf-bindings.tsx +86 -0
- package/docs/consumer-skill/examples/rhf-edit-page.tsx +141 -0
- package/docs/consumer-skill/examples/rhf-overlay-form.tsx +92 -0
- package/docs/consumer-skill/examples/rhf-transport.tsx +28 -0
- package/docs/consumer-skill/references/agents-md.md +17 -7
- package/docs/consumer-skill/references/authentication.md +42 -0
- package/docs/consumer-skill/references/component-contracts.json +319824 -0
- package/docs/consumer-skill/references/composition-mapping.md +92 -0
- package/docs/consumer-skill/references/composition.md +43 -19
- package/docs/consumer-skill/references/design-contract.md +32 -0
- package/docs/consumer-skill/references/discovery.md +84 -7
- package/docs/consumer-skill/references/installation.md +45 -35
- package/docs/consumer-skill/references/integration.md +6 -2
- package/docs/consumer-skill/references/public-api.json +1520 -66
- package/docs/consumer-skill/references/review.md +9 -4
- package/docs/consumer-skill/references/rhf-workflows.md +86 -0
- package/docs/consumer-skill/references/screen-archetypes.md +22 -0
- package/docs/consumer-skill/references/theming.md +8 -9
- package/docs/consumer-skill/references/tokens.json +12 -3
- package/docs/consumer-skill/references/workflows.md +7 -5
- package/docs/consumer-skill/scripts/composition-schema.d.mts +2 -0
- package/docs/consumer-skill/scripts/composition-schema.mjs +32 -0
- package/docs/consumer-skill/scripts/composition.mjs +198 -0
- package/docs/consumer-skill/scripts/discovery.mjs +42 -10
- package/docs/consumer-skill/scripts/inspect-component.mjs +11 -0
- package/docs/consumer-skill/scripts/inspect-tokens.mjs +11 -0
- package/docs/consumer-skill/scripts/inspection.mjs +138 -0
- package/docs/consumer-skill/scripts/map-composition.mjs +12 -0
- package/docs/consumer-skill/scripts/setup-skills.mjs +76 -0
- package/docs/consumer-skills/themelia-components/SKILL.md +30 -0
- package/docs/consumer-skills/themelia-composition/SKILL.md +35 -0
- package/docs/consumer-skills/themelia-forms/SKILL.md +12 -0
- package/docs/consumer-skills/themelia-foundation/SKILL.md +14 -0
- package/docs/consumer-skills/themelia-tokenization/SKILL.md +35 -0
- package/package.json +6 -4
- package/templates/README.md +39 -0
- package/templates/admin-shell-template.tsx +382 -0
- package/templates/analytics-operations-template.tsx +376 -0
- package/templates/customers-template.tsx +509 -0
- package/templates/index.ts +29 -0
- package/templates/orders-template.tsx +1102 -0
- package/templates/products-template.tsx +834 -0
- package/templates/user-permissions-template.tsx +450 -0
- package/dist/action-menu-CllU52Mm.js +0 -280
- package/dist/action-menu-CllU52Mm.js.map +0 -1
- package/dist/affordance-geometry.generated-tF36bREk.js.map +0 -1
- package/dist/ai-artifact-DvTwDVyL.js.map +0 -1
- package/dist/app-shell-C4FhvCqF.js.map +0 -1
- package/dist/cards-BaBZR-AU.js.map +0 -1
- package/dist/checkbox-AWIhNhmo.js.map +0 -1
- package/dist/choice-inputs-CNHvARCJ.js.map +0 -1
- package/dist/combobox-C0EQW6dr.js.map +0 -1
- package/dist/combobox-xCQ2RMNE.js.map +0 -1
- package/dist/comments-BYYlTA8E.js.map +0 -1
- package/dist/containers-Mu1LMGV1.js +0 -103
- package/dist/containers-Mu1LMGV1.js.map +0 -1
- package/dist/data-display-DT_khPl_.js.map +0 -1
- package/dist/date-picker-ay0Pha_a.js.map +0 -1
- package/dist/date-pickers-Ccw8DL2b.js +0 -175
- package/dist/date-pickers-Ccw8DL2b.js.map +0 -1
- package/dist/form-field-CwH9y77i.js.map +0 -1
- package/dist/forms-B9G_xwzi.js.map +0 -1
- package/dist/forms-numeric-B_jraJaQ.js.map +0 -1
- package/dist/input-DQdEd0YD.js +0 -263
- package/dist/input-DQdEd0YD.js.map +0 -1
- package/dist/item-K5_ghvze.js +0 -275
- package/dist/item-K5_ghvze.js.map +0 -1
- package/dist/metadata-list-8N16ZMW_.js +0 -405
- package/dist/metadata-list-8N16ZMW_.js.map +0 -1
- package/dist/overflow-tab-bar-CWY7Nogn.js.map +0 -1
- package/dist/overlays-DNWmZrJ4.js.map +0 -1
- package/dist/page-Bgl1F560.js +0 -224
- package/dist/page-Bgl1F560.js.map +0 -1
- package/dist/page-header-commands-DOb6WsfD.js +0 -126
- package/dist/page-header-commands-DOb6WsfD.js.map +0 -1
- package/dist/popover-7_m66eYW.js.map +0 -1
- package/dist/settings-ybnjVwbd.js +0 -171
- package/dist/settings-ybnjVwbd.js.map +0 -1
- package/dist/sheet-CGpB3omz.js.map +0 -1
- package/dist/smart-card-DiC5aac3.js +0 -604
- package/dist/smart-card-DiC5aac3.js.map +0 -1
- package/dist/text-inputs-f9Ia-aCi.js.map +0 -1
- package/dist/text.styles-g4He6UIW.js.map +0 -1
- package/dist/typography-UTnveOEy.js +0 -117
- package/dist/typography-UTnveOEy.js.map +0 -1
- package/dist/ui-provider-C_U0Xma4.js.map +0 -1
- package/dist/usage-card-BhO5eqkX.js.map +0 -1
- package/dist/utils-BRhFDwuU.js.map +0 -1
- package/dist/value-inputs-DXPDjvBU.js +0 -963
- package/dist/value-inputs-DXPDjvBU.js.map +0 -1
- package/dist/workspace-Cdrg7k9f.js +0 -408
- package/dist/workspace-Cdrg7k9f.js.map +0 -1
|
@@ -1,33 +1,34 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { a as e, o as t } from "./ui-provider-
|
|
2
|
+
import { a as e, o as t } from "./ui-provider-CQCuCBcy.js";
|
|
3
3
|
import { interpolateString as n, useStrings as r } from "./lib/strings.js";
|
|
4
|
-
import { t as i } from "./utils-
|
|
5
|
-
import { n as a, t as o } from "./buttons-
|
|
6
|
-
import { c as s, o as c, t as l } from "./typography-
|
|
7
|
-
import { i as u, n as d, r as f, t as p } from "./tooltip-
|
|
8
|
-
import { t as m } from "./structure-
|
|
4
|
+
import { t as i } from "./utils-CF3c95Io.js";
|
|
5
|
+
import { n as a, t as o } from "./buttons-BbfzgczK.js";
|
|
6
|
+
import { c as s, o as c, t as l } from "./typography-CSyJrh28.js";
|
|
7
|
+
import { i as u, n as d, r as f, t as p } from "./tooltip-B4hjKtoV.js";
|
|
8
|
+
import { t as m } from "./structure-C0V0_Fyf.js";
|
|
9
9
|
import { i as h } from "./tone-recipes-BPsRAvhu.js";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { t as y } from "./
|
|
13
|
-
import { t as b } from "./
|
|
14
|
-
import { t as x } from "./
|
|
15
|
-
import { t as S } from "./
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { i as
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import { Fragment as U,
|
|
28
|
-
import {
|
|
10
|
+
import { n as g } from "./composition.recipes-COdiFhxB.js";
|
|
11
|
+
import { t as _ } from "./row-recipes-DL8n7t_b.js";
|
|
12
|
+
import { i as v, t as y } from "./overlays-BlKynmde.js";
|
|
13
|
+
import { t as b } from "./interaction-recipes-XR9ZpVYL.js";
|
|
14
|
+
import { t as x } from "./sanitize-html-DsQmI48u.js";
|
|
15
|
+
import { t as S } from "./content-typography-CnwgMJ37.js";
|
|
16
|
+
import { t as C } from "./rich-text-CLJEf76s.js";
|
|
17
|
+
import { g as w, i as T } from "./primitives-Du64iDbb.js";
|
|
18
|
+
import { n as E, t as D } from "./number-E_OiIfJz.js";
|
|
19
|
+
import { i as O } from "./date-Q7jnXxpk.js";
|
|
20
|
+
import { i as k, n as A, s as ee } from "./avatar-DWO_HHhB.js";
|
|
21
|
+
import { t as j } from "./badge-DErMA7ul.js";
|
|
22
|
+
import { n as M } from "./field-affordance-recipes-DjwGx8eM.js";
|
|
23
|
+
import { c as te, o as N } from "./popover-uwzX2vo7.js";
|
|
24
|
+
import { s as P } from "./data-display-D4oujtx0.js";
|
|
25
|
+
import { t as F } from "./rich-text-editor-Cm1dpUpQ.js";
|
|
26
|
+
import { l as ne, n as re, o as I, r as ie, t as ae } from "./mentions-RKOQaaIB.js";
|
|
27
|
+
import { Fragment as L, createElement as R, forwardRef as z, memo as B, useCallback as V, useEffect as H, useImperativeHandle as oe, useMemo as U, useRef as W, useState as G } from "react";
|
|
28
|
+
import { Fragment as K, jsx as q, jsxs as J } from "react/jsx-runtime";
|
|
29
|
+
import { AtSign as Y, CornerDownRight as se, File as ce, FileText as X, Image as Z, Loader2 as le, MessageCircle as Q, Paperclip as ue, Pencil as de, Pin as fe, Smile as pe, Trash2 as me, X as he } from "lucide-react";
|
|
29
30
|
//#region src/components/features/comments/comments.strings.ts
|
|
30
|
-
var
|
|
31
|
+
var $ = {
|
|
31
32
|
title: "Comments",
|
|
32
33
|
subtitle: "",
|
|
33
34
|
empty: "No comments yet.",
|
|
@@ -75,12 +76,12 @@ var X = {
|
|
|
75
76
|
};
|
|
76
77
|
//#endregion
|
|
77
78
|
//#region src/components/features/comments/comments-provider.tsx
|
|
78
|
-
function
|
|
79
|
-
return r(
|
|
79
|
+
function ge(e) {
|
|
80
|
+
return r($, e);
|
|
80
81
|
}
|
|
81
|
-
function
|
|
82
|
+
function _e(e) {
|
|
82
83
|
let n = t();
|
|
83
|
-
return
|
|
84
|
+
return U(() => ({
|
|
84
85
|
getMediaUrl: e?.getMediaUrl,
|
|
85
86
|
getMediaName: e?.getMediaName,
|
|
86
87
|
getStatusLabel: e?.getStatusLabel,
|
|
@@ -89,16 +90,16 @@ function ve(e) {
|
|
|
89
90
|
}
|
|
90
91
|
//#endregion
|
|
91
92
|
//#region src/components/features/comments/hooks/use-comments.ts
|
|
92
|
-
function
|
|
93
|
-
let { onSubmit: t, onUpdate: n, onDelete: r, onAfterMutate: i, onError: a } = e, [o, s] =
|
|
93
|
+
function ve(e = {}) {
|
|
94
|
+
let { onSubmit: t, onUpdate: n, onDelete: r, onAfterMutate: i, onError: a } = e, [o, s] = G({ kind: "idle" }), [c, l] = G(!1), u = W(!1), [d, f] = G({}), [p, m] = G(0), h = V((e) => {
|
|
94
95
|
u.current = e, l(e);
|
|
95
|
-
}, []), g =
|
|
96
|
+
}, []), g = V(() => {
|
|
96
97
|
m((e) => e + 1), s({ kind: "idle" }), f({}), h(!1);
|
|
97
|
-
}, [h]), _ =
|
|
98
|
+
}, [h]), _ = U(() => ({
|
|
98
99
|
setErrors: f,
|
|
99
100
|
reset: g,
|
|
100
101
|
setSubmitting: h
|
|
101
|
-
}), [g, h]), v =
|
|
102
|
+
}), [g, h]), v = V((e) => {
|
|
102
103
|
try {
|
|
103
104
|
a?.(e);
|
|
104
105
|
} catch {}
|
|
@@ -108,23 +109,23 @@ function Q(e = {}) {
|
|
|
108
109
|
isSubmitting: c,
|
|
109
110
|
formErrors: d,
|
|
110
111
|
resetKey: p,
|
|
111
|
-
startReply:
|
|
112
|
+
startReply: V((e) => {
|
|
112
113
|
e.id && (f({}), s({
|
|
113
114
|
kind: "replying",
|
|
114
115
|
commentId: e.id,
|
|
115
116
|
authorName: e.user?.name
|
|
116
117
|
}));
|
|
117
118
|
}, []),
|
|
118
|
-
startEdit:
|
|
119
|
+
startEdit: V((e) => {
|
|
119
120
|
e.id && (f({}), s({
|
|
120
121
|
kind: "editing",
|
|
121
122
|
comment: e
|
|
122
123
|
}));
|
|
123
124
|
}, []),
|
|
124
|
-
cancelComposerMode:
|
|
125
|
+
cancelComposerMode: V(() => {
|
|
125
126
|
g();
|
|
126
127
|
}, [g]),
|
|
127
|
-
submit:
|
|
128
|
+
submit: V(async (e) => {
|
|
128
129
|
if (o.kind === "editing" && o.comment.id) {
|
|
129
130
|
if (!n || u.current) return;
|
|
130
131
|
let t = {
|
|
@@ -163,7 +164,7 @@ function Q(e = {}) {
|
|
|
163
164
|
v,
|
|
164
165
|
h
|
|
165
166
|
]),
|
|
166
|
-
deleteComment:
|
|
167
|
+
deleteComment: V(async (e) => {
|
|
167
168
|
if (r && e) try {
|
|
168
169
|
await r(e), i?.("delete", { commentId: e });
|
|
169
170
|
} catch (e) {
|
|
@@ -181,48 +182,48 @@ function Q(e = {}) {
|
|
|
181
182
|
//#endregion
|
|
182
183
|
//#region src/components/features/comments/partials/comment-attachment-chip.tsx
|
|
183
184
|
function ye(e) {
|
|
184
|
-
return e.mimeType?.startsWith("image/") ?
|
|
185
|
+
return e.mimeType?.startsWith("image/") ? Z : e.mimeType === "application/pdf" || e.mimeType?.startsWith("text/") ? X : e.mimeType ? ce : ue;
|
|
185
186
|
}
|
|
186
187
|
var be = ({ attachment: e, editable: t = !1, onRemove: n, onRetry: a, accessors: c, strings: u, compact: d = !1, className: f }) => {
|
|
187
|
-
let p = r(
|
|
188
|
+
let p = r($, u), m = c?.getMediaUrl?.(e) ?? e.url, g = c?.getMediaName?.(e) ?? e.name ?? p.attachmentFallback, v = ye(e), y = e.status === "uploading", x = e.status === "failed", S = y ? /* @__PURE__ */ J(w, {
|
|
188
189
|
size: "xs",
|
|
189
190
|
className: "shrink-0",
|
|
190
|
-
children: [p.attachmentUploadingLabel, typeof e.progress == "number" ? /* @__PURE__ */
|
|
191
|
+
children: [p.attachmentUploadingLabel, typeof e.progress == "number" ? /* @__PURE__ */ J(K, { children: [" ", /* @__PURE__ */ q(E, {
|
|
191
192
|
value: Math.round(e.progress),
|
|
192
193
|
scaled: !0,
|
|
193
194
|
size: "xs",
|
|
194
195
|
align: "left",
|
|
195
196
|
type: "secondary"
|
|
196
197
|
})] }) : null]
|
|
197
|
-
}) : x ? /* @__PURE__ */
|
|
198
|
+
}) : x ? /* @__PURE__ */ q(w, {
|
|
198
199
|
size: "xs",
|
|
199
200
|
className: "shrink-0",
|
|
200
201
|
children: e.error ?? p.attachmentFailedLabel
|
|
201
|
-
}) : typeof e.size == "number" ? /* @__PURE__ */
|
|
202
|
+
}) : typeof e.size == "number" ? /* @__PURE__ */ q(T, {
|
|
202
203
|
value: e.size,
|
|
203
204
|
size: "xs",
|
|
204
205
|
className: "shrink-0"
|
|
205
|
-
}) : null,
|
|
206
|
+
}) : null, C = 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", _.compact, x ? `${h.destructive.tint} ${h.destructive.halo}` : `bg-muted ring-border/60 ${b.rowHover}`, f), D = y ? /* @__PURE__ */ q(le, {
|
|
206
207
|
className: i("shrink-0 animate-spin text-muted-foreground", "size-icon-md"),
|
|
207
208
|
"aria-hidden": !0
|
|
208
|
-
}) : /* @__PURE__ */
|
|
209
|
+
}) : /* @__PURE__ */ q(v, {
|
|
209
210
|
className: i("shrink-0", "size-icon-md", x ? "text-destructive" : "text-muted-foreground"),
|
|
210
211
|
"aria-hidden": !0
|
|
211
|
-
}),
|
|
212
|
+
}), O = /* @__PURE__ */ J("span", {
|
|
212
213
|
className: "inline-flex min-w-0 items-baseline gap-space-sm",
|
|
213
|
-
children: [/* @__PURE__ */
|
|
214
|
+
children: [/* @__PURE__ */ q(s, {
|
|
214
215
|
tag: "span",
|
|
215
216
|
size: "xs",
|
|
216
217
|
weight: "medium",
|
|
217
218
|
className: i("truncate", x && "text-destructive"),
|
|
218
|
-
children:
|
|
219
|
+
children: g
|
|
219
220
|
}), S]
|
|
220
221
|
});
|
|
221
|
-
return /* @__PURE__ */
|
|
222
|
-
className:
|
|
222
|
+
return /* @__PURE__ */ J("div", {
|
|
223
|
+
className: C,
|
|
223
224
|
children: [
|
|
224
|
-
|
|
225
|
-
m && !
|
|
225
|
+
D,
|
|
226
|
+
m && !y && !x ? /* @__PURE__ */ q(l, {
|
|
226
227
|
href: m,
|
|
227
228
|
size: "inherit",
|
|
228
229
|
underline: !1,
|
|
@@ -230,21 +231,21 @@ var be = ({ attachment: e, editable: t = !1, onRemove: n, onRetry: a, accessors:
|
|
|
230
231
|
rel: "noreferrer noopener",
|
|
231
232
|
className: "inline-flex min-w-0 flex-1 items-baseline gap-space-sm hover:underline",
|
|
232
233
|
"aria-label": p.attachmentDownloadLabel,
|
|
233
|
-
children:
|
|
234
|
-
}) :
|
|
235
|
-
|
|
234
|
+
children: O
|
|
235
|
+
}) : O,
|
|
236
|
+
y && typeof e.progress == "number" && /* @__PURE__ */ q("div", {
|
|
236
237
|
className: i(h.primary.line, "absolute bottom-0 left-2 right-2 h-px overflow-hidden rounded-full"),
|
|
237
|
-
children: /* @__PURE__ */
|
|
238
|
+
children: /* @__PURE__ */ q("div", {
|
|
238
239
|
className: "bg-primary h-full transition-[width]",
|
|
239
240
|
style: { width: `${Math.min(100, Math.max(0, e.progress))}%` }
|
|
240
241
|
})
|
|
241
242
|
}),
|
|
242
|
-
x && a && /* @__PURE__ */
|
|
243
|
+
x && a && /* @__PURE__ */ q(o, {
|
|
243
244
|
type: "button",
|
|
244
245
|
size: "sm",
|
|
245
246
|
onClick: () => a(e.id),
|
|
246
247
|
className: "shrink-0 text-destructive decoration-destructive/30 hover:decoration-destructive/60",
|
|
247
|
-
children: /* @__PURE__ */
|
|
248
|
+
children: /* @__PURE__ */ q(s, {
|
|
248
249
|
tag: "span",
|
|
249
250
|
size: "xs",
|
|
250
251
|
weight: "medium",
|
|
@@ -252,38 +253,38 @@ var be = ({ attachment: e, editable: t = !1, onRemove: n, onRetry: a, accessors:
|
|
|
252
253
|
children: p.attachmentRetryLabel
|
|
253
254
|
})
|
|
254
255
|
}),
|
|
255
|
-
t && n && /* @__PURE__ */
|
|
256
|
+
t && n && /* @__PURE__ */ q("button", {
|
|
256
257
|
type: "button",
|
|
257
258
|
onClick: () => n(e.id),
|
|
258
|
-
className: i(
|
|
259
|
+
className: i(M.target, M.focus, M.toggle),
|
|
259
260
|
"aria-label": p.attachmentRemoveLabel,
|
|
260
261
|
title: p.attachmentRemoveLabel,
|
|
261
|
-
children: /* @__PURE__ */
|
|
262
|
-
className:
|
|
262
|
+
children: /* @__PURE__ */ q(he, {
|
|
263
|
+
className: M.icon,
|
|
263
264
|
"aria-hidden": "true"
|
|
264
265
|
})
|
|
265
266
|
})
|
|
266
267
|
]
|
|
267
268
|
});
|
|
268
269
|
}, xe = {
|
|
269
|
-
attachmentTooLargeError:
|
|
270
|
-
attachmentTooManyError:
|
|
271
|
-
attachmentFailedLabel:
|
|
270
|
+
attachmentTooLargeError: $.attachmentTooLargeError,
|
|
271
|
+
attachmentTooManyError: $.attachmentTooManyError,
|
|
272
|
+
attachmentFailedLabel: $.attachmentFailedLabel
|
|
272
273
|
};
|
|
273
274
|
function Se(e = {}) {
|
|
274
|
-
let { onUpload: t, maxSize: n, maxFiles: i, disabled: a, initialAttachments: o, onValueChange: s, onError: c, strings: l } = e, u = r(xe, l), [d, f] =
|
|
275
|
+
let { onUpload: t, maxSize: n, maxFiles: i, disabled: a, initialAttachments: o, onValueChange: s, onError: c, strings: l } = e, u = r(xe, l), [d, f] = G(() => o ? [...o] : []), p = W(/* @__PURE__ */ new Map()), m = W(/* @__PURE__ */ new Map()), h = W(d), g = V((e) => {
|
|
275
276
|
let t = [...e];
|
|
276
277
|
h.current = t, f(t);
|
|
277
|
-
}, []), _ =
|
|
278
|
+
}, []), _ = W(s);
|
|
278
279
|
_.current = s;
|
|
279
|
-
let v =
|
|
280
|
+
let v = V((e, t) => {
|
|
280
281
|
g(h.current.map((n) => n.id === e ? {
|
|
281
282
|
...n,
|
|
282
283
|
...t
|
|
283
284
|
} : n));
|
|
284
|
-
}, [g]), y =
|
|
285
|
+
}, [g]), y = V((e) => {
|
|
285
286
|
g(e);
|
|
286
|
-
}, [g]), b =
|
|
287
|
+
}, [g]), b = V((e, n) => {
|
|
287
288
|
if (!t || !m.current.has(e)) return;
|
|
288
289
|
let r = new AbortController();
|
|
289
290
|
p.current.set(e, { controller: r }), v(e, {
|
|
@@ -317,7 +318,7 @@ function Se(e = {}) {
|
|
|
317
318
|
t,
|
|
318
319
|
u.attachmentFailedLabel,
|
|
319
320
|
v
|
|
320
|
-
]), x =
|
|
321
|
+
]), x = V((e) => {
|
|
321
322
|
if (a || !t) return;
|
|
322
323
|
let r = Array.from(e);
|
|
323
324
|
if (r.length === 0) return;
|
|
@@ -356,19 +357,19 @@ function Se(e = {}) {
|
|
|
356
357
|
t,
|
|
357
358
|
u.attachmentTooLargeError,
|
|
358
359
|
u.attachmentTooManyError
|
|
359
|
-
]), S =
|
|
360
|
+
]), S = V((e) => {
|
|
360
361
|
let t = p.current.get(e);
|
|
361
362
|
t && (t.controller.abort(), p.current.delete(e)), m.current.delete(e), g(h.current.filter((t) => t.id !== e));
|
|
362
|
-
}, [g]), C =
|
|
363
|
+
}, [g]), C = V((e) => {
|
|
363
364
|
let t = m.current.get(e);
|
|
364
365
|
t && b(e, t);
|
|
365
|
-
}, [b]), w =
|
|
366
|
+
}, [b]), w = V(() => {
|
|
366
367
|
for (let e of p.current.values()) e.controller.abort();
|
|
367
368
|
p.current.clear(), m.current.clear(), g([]);
|
|
368
369
|
}, [g]);
|
|
369
|
-
return
|
|
370
|
+
return H(() => {
|
|
370
371
|
_.current?.(d);
|
|
371
|
-
}, [d]),
|
|
372
|
+
}, [d]), H(() => {
|
|
372
373
|
let e = p.current, t = m.current;
|
|
373
374
|
return () => {
|
|
374
375
|
for (let t of e.values()) t.controller.abort();
|
|
@@ -376,8 +377,8 @@ function Se(e = {}) {
|
|
|
376
377
|
};
|
|
377
378
|
}, []), {
|
|
378
379
|
attachments: d,
|
|
379
|
-
uploadedAttachments:
|
|
380
|
-
isUploading:
|
|
380
|
+
uploadedAttachments: U(() => d.filter((e) => e.status === "uploaded" || !e.status), [d]),
|
|
381
|
+
isUploading: U(() => d.some((e) => e.status === "uploading"), [d]),
|
|
381
382
|
addFiles: x,
|
|
382
383
|
removeAttachment: S,
|
|
383
384
|
retryAttachment: C,
|
|
@@ -390,268 +391,268 @@ function Se(e = {}) {
|
|
|
390
391
|
function Ce(e) {
|
|
391
392
|
return !e || typeof e != "string" ? !1 : e.replace(/<[^>]*>/g, "").trim().length > 0;
|
|
392
393
|
}
|
|
393
|
-
var
|
|
394
|
-
let
|
|
394
|
+
var we = z(function({ context: e, canComment: t = !0, submitting: n = !1, errors: r, resetKey: i = 0, onSubmit: o, onCancel: c, editingComment: l, replyingTo: u, strings: d, resources: f, onResourceSearch: p, attachments: h, maxAttachments: _, allowAttachments: v, initialValues: y, autoFocus: b = !1, inlineSubmit: x = !0, placeholder: S }, C) {
|
|
395
|
+
let w = ge(d), T = f, E = p, D = v ?? !0, O = h?.maxFiles ?? _ ?? 5, k = U(() => ({
|
|
395
396
|
...h,
|
|
396
|
-
maxFiles:
|
|
397
|
-
disabled: h?.disabled === !0 || !
|
|
397
|
+
maxFiles: O,
|
|
398
|
+
disabled: h?.disabled === !0 || !D
|
|
398
399
|
}), [
|
|
399
|
-
|
|
400
|
+
D,
|
|
400
401
|
h,
|
|
401
|
-
|
|
402
|
-
]),
|
|
403
|
-
resources:
|
|
404
|
-
onResourceSearch:
|
|
405
|
-
editorRef:
|
|
406
|
-
initialMentions:
|
|
407
|
-
}),
|
|
408
|
-
...
|
|
409
|
-
initialAttachments:
|
|
410
|
-
strings:
|
|
411
|
-
onError:
|
|
412
|
-
}),
|
|
413
|
-
|
|
402
|
+
O
|
|
403
|
+
]), A = W(null), [ee, j] = G(() => y?.content ?? l?.content ?? ""), [M, P] = G(null), [I, L] = G(null), R = ne({
|
|
404
|
+
resources: T,
|
|
405
|
+
onResourceSearch: E,
|
|
406
|
+
editorRef: A,
|
|
407
|
+
initialMentions: y?.references ?? l?.references
|
|
408
|
+
}), z = Se({
|
|
409
|
+
...k,
|
|
410
|
+
initialAttachments: y?.attachments ?? void 0,
|
|
411
|
+
strings: w,
|
|
412
|
+
onError: L
|
|
413
|
+
}), B = () => {
|
|
414
|
+
z.reset(), L(null), c?.();
|
|
414
415
|
};
|
|
415
|
-
|
|
416
|
-
focus: () =>
|
|
416
|
+
oe(C, () => ({
|
|
417
|
+
focus: () => A.current?.focus(),
|
|
417
418
|
clear: () => {
|
|
418
|
-
|
|
419
|
+
A.current?.clear(), R.reset(), z.reset(), P(null), L(null);
|
|
419
420
|
},
|
|
420
421
|
setBody: (e) => {
|
|
421
|
-
|
|
422
|
+
A.current?.setHTML(e);
|
|
422
423
|
}
|
|
423
|
-
}), [
|
|
424
|
-
|
|
424
|
+
}), [z, R]), H(() => {
|
|
425
|
+
A.current?.setHTML(y?.content ?? ""), R.setMentions(y?.references ?? []), z.reset(), z.setAttachments(y?.attachments ?? []), P(null), L(null);
|
|
425
426
|
}, [
|
|
426
427
|
e.id,
|
|
427
428
|
e.type,
|
|
428
429
|
i
|
|
429
|
-
]),
|
|
430
|
+
]), H(() => {
|
|
430
431
|
if (!l) return;
|
|
431
|
-
|
|
432
|
+
A.current?.setHTML(l.content ?? ""), R.setMentions(l.references ?? []);
|
|
432
433
|
let e = (l.attachments ?? []).filter((e) => !!e);
|
|
433
|
-
|
|
434
|
-
}, [l?.id]),
|
|
435
|
-
r?.content &&
|
|
434
|
+
z.reset(), z.setAttachments(e), L(null);
|
|
435
|
+
}, [l?.id]), H(() => {
|
|
436
|
+
r?.content && P(r.content);
|
|
436
437
|
}, [r]);
|
|
437
|
-
let
|
|
438
|
-
if (t?.preventDefault(), n ||
|
|
439
|
-
let r =
|
|
438
|
+
let V = (t) => {
|
|
439
|
+
if (t?.preventDefault(), n || z.isUploading) return;
|
|
440
|
+
let r = A.current?.getHTML() ?? ee;
|
|
440
441
|
if (!Ce(r)) {
|
|
441
|
-
|
|
442
|
+
P(w.invalidContent);
|
|
442
443
|
return;
|
|
443
444
|
}
|
|
444
|
-
|
|
445
|
+
P(null), o({
|
|
445
446
|
content: r,
|
|
446
447
|
commentableId: e.id,
|
|
447
448
|
commentableType: e.type,
|
|
448
449
|
moduleKey: e.moduleKey,
|
|
449
450
|
contentType: "html",
|
|
450
|
-
references:
|
|
451
|
-
attachments:
|
|
452
|
-
replyToId: u?.commentId ??
|
|
451
|
+
references: R.mentions,
|
|
452
|
+
attachments: z.uploadedAttachments,
|
|
453
|
+
replyToId: u?.commentId ?? y?.replyToId,
|
|
453
454
|
editingId: l?.id
|
|
454
455
|
});
|
|
455
|
-
},
|
|
456
|
-
e?.length && (
|
|
457
|
-
},
|
|
458
|
-
label:
|
|
459
|
-
closeLabel:
|
|
460
|
-
onClose: c ?
|
|
461
|
-
}) :
|
|
462
|
-
label:
|
|
463
|
-
closeLabel:
|
|
464
|
-
onClose: c ?
|
|
465
|
-
}) : null,
|
|
456
|
+
}, K = W(null), se = () => K.current?.click(), ce = (e) => {
|
|
457
|
+
e?.length && (L(null), z.addFiles(e));
|
|
458
|
+
}, X = z.attachments.length > 0, Z = !!l, Q = !Z && !!u, de = n ? w.composerSubmitting : Z ? w.composerSave : w.composerSubmit, fe = Z ? /* @__PURE__ */ q(Te, {
|
|
459
|
+
label: w.composerEditingEyebrow,
|
|
460
|
+
closeLabel: w.composerCancel,
|
|
461
|
+
onClose: c ? B : void 0
|
|
462
|
+
}) : Q ? /* @__PURE__ */ q(Te, {
|
|
463
|
+
label: Ee(w.composerReplyingEyebrow, u.authorName),
|
|
464
|
+
closeLabel: w.composerCancel,
|
|
465
|
+
onClose: c ? B : void 0
|
|
466
|
+
}) : null, pe = U(() => {
|
|
466
467
|
let e = [];
|
|
467
|
-
return
|
|
468
|
+
return T && Object.keys(T).length > 0 && e.push({
|
|
468
469
|
id: "reference",
|
|
469
|
-
icon:
|
|
470
|
-
label:
|
|
471
|
-
onClick: () =>
|
|
472
|
-
}),
|
|
470
|
+
icon: Y,
|
|
471
|
+
label: w.composerReferenceLabel,
|
|
472
|
+
onClick: () => R.setPickerOpen(!0)
|
|
473
|
+
}), k?.onUpload && !k.disabled && e.push({
|
|
473
474
|
id: "attachment",
|
|
474
|
-
icon:
|
|
475
|
-
label:
|
|
476
|
-
onClick:
|
|
475
|
+
icon: ue,
|
|
476
|
+
label: w.composerAttachmentLabel,
|
|
477
|
+
onClick: se
|
|
477
478
|
}), e;
|
|
478
479
|
}, [
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
480
|
+
T,
|
|
481
|
+
k?.onUpload,
|
|
482
|
+
k?.disabled,
|
|
483
|
+
w.composerReferenceLabel,
|
|
484
|
+
w.composerAttachmentLabel
|
|
484
485
|
]);
|
|
485
486
|
if (!t) return null;
|
|
486
|
-
let
|
|
487
|
+
let me = /* @__PURE__ */ q(a, {
|
|
487
488
|
tone: "primary",
|
|
488
489
|
type: "button",
|
|
489
|
-
onClick: () =>
|
|
490
|
-
disabled: n ||
|
|
491
|
-
icon: n ?
|
|
492
|
-
children:
|
|
493
|
-
}),
|
|
490
|
+
onClick: () => V(),
|
|
491
|
+
disabled: n || z.isUploading,
|
|
492
|
+
icon: n ? le : void 0,
|
|
493
|
+
children: de
|
|
494
|
+
}), he = Z || Q || c ? /* @__PURE__ */ q(a, {
|
|
494
495
|
type: "button",
|
|
495
496
|
tone: "secondary",
|
|
496
497
|
buttonStyle: "ghost",
|
|
497
|
-
onClick:
|
|
498
|
+
onClick: B,
|
|
498
499
|
disabled: n,
|
|
499
|
-
children:
|
|
500
|
-
}) : null,
|
|
500
|
+
children: w.composerCancel
|
|
501
|
+
}) : null, $ = X ? /* @__PURE__ */ q(m, {
|
|
501
502
|
direction: "horizontal",
|
|
502
503
|
wrap: !0,
|
|
503
504
|
align: "center",
|
|
504
505
|
gap: "sm",
|
|
505
|
-
children:
|
|
506
|
+
children: z.attachments.map((e) => /* @__PURE__ */ q(be, {
|
|
506
507
|
attachment: e,
|
|
507
508
|
editable: !0,
|
|
508
509
|
onRemove: (e) => {
|
|
509
|
-
|
|
510
|
+
L(null), z.removeAttachment(e);
|
|
510
511
|
},
|
|
511
512
|
onRetry: (e) => {
|
|
512
|
-
|
|
513
|
+
L(null), z.retryAttachment(e);
|
|
513
514
|
},
|
|
514
515
|
strings: d
|
|
515
516
|
}, e.id))
|
|
516
|
-
}) : null,
|
|
517
|
-
return /* @__PURE__ */
|
|
518
|
-
render: /* @__PURE__ */
|
|
517
|
+
}) : null, _e = X ? $ : null, ve = x !== !1 && !Z && !Q ? me : null, ye = x === !1 || Z || Q;
|
|
518
|
+
return /* @__PURE__ */ J(m, {
|
|
519
|
+
render: /* @__PURE__ */ q("form", {}),
|
|
519
520
|
gap: "md",
|
|
520
|
-
onSubmit:
|
|
521
|
+
onSubmit: V,
|
|
521
522
|
className: "comment-composer--component",
|
|
522
523
|
children: [
|
|
523
|
-
|
|
524
|
-
/* @__PURE__ */
|
|
525
|
-
ref:
|
|
524
|
+
fe,
|
|
525
|
+
/* @__PURE__ */ q("input", {
|
|
526
|
+
ref: K,
|
|
526
527
|
type: "file",
|
|
527
528
|
multiple: !0,
|
|
528
529
|
hidden: !0,
|
|
529
|
-
accept:
|
|
530
|
+
accept: k?.accept,
|
|
530
531
|
onChange: (e) => {
|
|
531
|
-
|
|
532
|
+
ce(e.target.files), e.target.value = "";
|
|
532
533
|
}
|
|
533
534
|
}),
|
|
534
|
-
!
|
|
535
|
-
open:
|
|
536
|
-
onOpenChange:
|
|
537
|
-
children: [/* @__PURE__ */
|
|
535
|
+
!R.triggerActive && /* @__PURE__ */ J(N, {
|
|
536
|
+
open: R.pickerOpen,
|
|
537
|
+
onOpenChange: R.setPickerOpen,
|
|
538
|
+
children: [/* @__PURE__ */ q(te, { render: /* @__PURE__ */ q(a, {
|
|
538
539
|
type: "button",
|
|
539
540
|
tone: "secondary",
|
|
540
541
|
buttonStyle: "ghost",
|
|
541
542
|
className: "sr-only",
|
|
542
543
|
tabIndex: -1,
|
|
543
|
-
children:
|
|
544
|
-
}) }), /* @__PURE__ */
|
|
545
|
-
open:
|
|
546
|
-
activeKind:
|
|
544
|
+
children: w.composerReferenceLabel
|
|
545
|
+
}) }), /* @__PURE__ */ q(ie, {
|
|
546
|
+
open: R.pickerOpen,
|
|
547
|
+
activeKind: R.activeKind,
|
|
547
548
|
setActiveKind: (e) => {
|
|
548
|
-
|
|
549
|
+
R.setActiveKind(e), R.setManualKindOverride(!0);
|
|
549
550
|
},
|
|
550
|
-
kinds:
|
|
551
|
-
resources:
|
|
552
|
-
query:
|
|
553
|
-
setQuery:
|
|
554
|
-
suggestions:
|
|
555
|
-
loading:
|
|
556
|
-
onSelect:
|
|
551
|
+
kinds: R.kinds,
|
|
552
|
+
resources: T,
|
|
553
|
+
query: R.query,
|
|
554
|
+
setQuery: R.setQuery,
|
|
555
|
+
suggestions: R.suggestions,
|
|
556
|
+
loading: R.isLoading,
|
|
557
|
+
onSelect: R.pickSuggestion,
|
|
557
558
|
strings: {
|
|
558
|
-
title:
|
|
559
|
-
searchPlaceholder:
|
|
560
|
-
empty:
|
|
561
|
-
loading:
|
|
559
|
+
title: w.composerReferenceMenuTitle,
|
|
560
|
+
searchPlaceholder: w.composerReferenceSearchPlaceholder,
|
|
561
|
+
empty: w.composerReferenceEmpty,
|
|
562
|
+
loading: w.composerReferenceLoading
|
|
562
563
|
}
|
|
563
564
|
})]
|
|
564
565
|
}),
|
|
565
|
-
/* @__PURE__ */
|
|
566
|
+
/* @__PURE__ */ J("div", {
|
|
566
567
|
className: "comment-composer--editor relative",
|
|
567
|
-
children: [/* @__PURE__ */
|
|
568
|
-
ref:
|
|
569
|
-
value:
|
|
568
|
+
children: [/* @__PURE__ */ q(F, {
|
|
569
|
+
ref: A,
|
|
570
|
+
value: ee,
|
|
570
571
|
onValueChange: (e) => {
|
|
571
|
-
|
|
572
|
-
let t =
|
|
572
|
+
j(e);
|
|
573
|
+
let t = ae(e), n = R.mentions;
|
|
573
574
|
if (n.map((e) => e.id).join("|") !== t.map((e) => e.id).join("|")) {
|
|
574
575
|
let e = new Map(n.map((e) => [e.id, e])), r = t.map((t) => e.get(t.id) ?? t);
|
|
575
|
-
|
|
576
|
+
R.setMentions(r);
|
|
576
577
|
}
|
|
577
578
|
},
|
|
578
|
-
placeholder:
|
|
579
|
-
strings: { editorLabel:
|
|
579
|
+
placeholder: S ?? w.composerPlaceholder,
|
|
580
|
+
strings: { editorLabel: S ?? w.composerPlaceholder },
|
|
580
581
|
bodyHeight: "field",
|
|
581
|
-
autoFocus:
|
|
582
|
-
extraToolbarItems:
|
|
583
|
-
toolbarTrailing:
|
|
584
|
-
footerSlot:
|
|
585
|
-
onCaretChange:
|
|
586
|
-
}), /* @__PURE__ */
|
|
587
|
-
open:
|
|
588
|
-
activeKind:
|
|
582
|
+
autoFocus: b || Z || Q,
|
|
583
|
+
extraToolbarItems: pe,
|
|
584
|
+
toolbarTrailing: ve,
|
|
585
|
+
footerSlot: _e,
|
|
586
|
+
onCaretChange: R.handleCaretChange
|
|
587
|
+
}), /* @__PURE__ */ q(re, {
|
|
588
|
+
open: R.triggerActive && R.pickerOpen,
|
|
589
|
+
activeKind: R.activeKind,
|
|
589
590
|
setActiveKind: (e) => {
|
|
590
|
-
|
|
591
|
+
R.setActiveKind(e), R.setManualKindOverride(!0);
|
|
591
592
|
},
|
|
592
|
-
kinds:
|
|
593
|
-
resources:
|
|
594
|
-
query:
|
|
595
|
-
suggestions:
|
|
596
|
-
suggestionsByKind:
|
|
597
|
-
loading:
|
|
598
|
-
onSelect:
|
|
593
|
+
kinds: R.kinds,
|
|
594
|
+
resources: T,
|
|
595
|
+
query: R.query,
|
|
596
|
+
suggestions: R.suggestions,
|
|
597
|
+
suggestionsByKind: R.suggestionsByKind,
|
|
598
|
+
loading: R.isLoading,
|
|
599
|
+
onSelect: R.pickSuggestion,
|
|
599
600
|
strings: {
|
|
600
|
-
title:
|
|
601
|
-
empty:
|
|
602
|
-
loading:
|
|
601
|
+
title: w.composerReferenceMenuTitle,
|
|
602
|
+
empty: w.composerReferenceEmpty,
|
|
603
|
+
loading: w.composerReferenceLoading
|
|
603
604
|
}
|
|
604
605
|
})]
|
|
605
606
|
}),
|
|
606
|
-
|
|
607
|
+
I && /* @__PURE__ */ q(s, {
|
|
607
608
|
role: "alert",
|
|
608
609
|
size: "xs",
|
|
609
610
|
type: "error",
|
|
610
611
|
className: "comment-composer--attachment-error",
|
|
611
|
-
children:
|
|
612
|
+
children: I
|
|
612
613
|
}),
|
|
613
|
-
|
|
614
|
+
M && /* @__PURE__ */ q(s, {
|
|
614
615
|
size: "xs",
|
|
615
616
|
type: "error",
|
|
616
|
-
children:
|
|
617
|
+
children: M
|
|
617
618
|
}),
|
|
618
|
-
ye && /* @__PURE__ */
|
|
619
|
+
ye && /* @__PURE__ */ J(m, {
|
|
619
620
|
direction: "horizontal",
|
|
620
621
|
align: "center",
|
|
621
622
|
justify: "end",
|
|
622
|
-
gap:
|
|
623
|
+
gap: g.commands,
|
|
623
624
|
className: "comment-composer--footer-actions",
|
|
624
|
-
children: [
|
|
625
|
+
children: [he, me]
|
|
625
626
|
})
|
|
626
627
|
]
|
|
627
628
|
});
|
|
628
629
|
});
|
|
629
|
-
function
|
|
630
|
-
return /* @__PURE__ */
|
|
631
|
-
className: i("comment-composer--eyebrow bg-muted/30 ring-border/60 flex min-w-0 items-center justify-between gap-space-sm rounded-radius px-row-x ring-1 ring-inset",
|
|
632
|
-
children: [/* @__PURE__ */
|
|
630
|
+
function Te({ label: e, closeLabel: t, onClose: n }) {
|
|
631
|
+
return /* @__PURE__ */ J("div", {
|
|
632
|
+
className: i("comment-composer--eyebrow bg-muted/30 ring-border/60 flex min-w-0 items-center justify-between gap-space-sm rounded-radius px-row-x ring-1 ring-inset", _.compact),
|
|
633
|
+
children: [/* @__PURE__ */ q(c, { children: e }), n ? /* @__PURE__ */ q("button", {
|
|
633
634
|
type: "button",
|
|
634
635
|
onClick: n,
|
|
635
|
-
className: i(
|
|
636
|
+
className: i(M.target, M.focus, M.toggle),
|
|
636
637
|
"aria-label": t,
|
|
637
|
-
children: /* @__PURE__ */
|
|
638
|
-
className:
|
|
638
|
+
children: /* @__PURE__ */ q(he, {
|
|
639
|
+
className: M.icon,
|
|
639
640
|
"aria-hidden": "true"
|
|
640
641
|
})
|
|
641
642
|
}) : null]
|
|
642
643
|
});
|
|
643
644
|
}
|
|
644
|
-
function
|
|
645
|
+
function Ee(e, t) {
|
|
645
646
|
return n(e, { name: t }, { missing: "empty" });
|
|
646
647
|
}
|
|
647
648
|
//#endregion
|
|
648
649
|
//#region src/components/features/comments/partials/comment-empty.tsx
|
|
649
|
-
var
|
|
650
|
-
let r =
|
|
651
|
-
return /* @__PURE__ */
|
|
650
|
+
var De = ({ strings: e, icon: t, className: n }) => {
|
|
651
|
+
let r = ge(e);
|
|
652
|
+
return /* @__PURE__ */ q(P, {
|
|
652
653
|
title: r.empty,
|
|
653
654
|
description: r.emptyHint || !1,
|
|
654
|
-
media: t ?? /* @__PURE__ */
|
|
655
|
+
media: t ?? /* @__PURE__ */ q(Q, {
|
|
655
656
|
className: "size-icon",
|
|
656
657
|
"aria-hidden": "true"
|
|
657
658
|
}),
|
|
@@ -662,18 +663,18 @@ var Ee = ({ strings: e, icon: t, className: n }) => {
|
|
|
662
663
|
};
|
|
663
664
|
//#endregion
|
|
664
665
|
//#region src/components/features/comments/partials/comment-content.tsx
|
|
665
|
-
function
|
|
666
|
+
function Oe(e) {
|
|
666
667
|
let { comment: t, resources: n, renderReference: r, sanitizer: i } = e, a = t.contentType ?? t.content_type ?? "text";
|
|
667
668
|
if (a === "rich") {
|
|
668
|
-
let e =
|
|
669
|
-
return e ? /* @__PURE__ */
|
|
669
|
+
let e = ke(t.content);
|
|
670
|
+
return e ? /* @__PURE__ */ q("div", {
|
|
670
671
|
className: "comment-content--component",
|
|
671
672
|
children: e
|
|
672
673
|
}) : null;
|
|
673
674
|
}
|
|
674
|
-
if (a === "html") return /* @__PURE__ */
|
|
675
|
+
if (a === "html") return /* @__PURE__ */ q("div", {
|
|
675
676
|
className: "comment-content--component",
|
|
676
|
-
children: /* @__PURE__ */
|
|
677
|
+
children: /* @__PURE__ */ q(I, {
|
|
677
678
|
className: "text-inherit",
|
|
678
679
|
html: t.content ?? "",
|
|
679
680
|
mentions: t.references,
|
|
@@ -682,52 +683,52 @@ function De(e) {
|
|
|
682
683
|
sanitizer: i
|
|
683
684
|
})
|
|
684
685
|
});
|
|
685
|
-
let o =
|
|
686
|
-
return /* @__PURE__ */
|
|
686
|
+
let o = Me(t.content ?? "");
|
|
687
|
+
return /* @__PURE__ */ q(s, {
|
|
687
688
|
type: "inherit",
|
|
688
689
|
className: "comment-content--component whitespace-pre-line",
|
|
689
690
|
children: o
|
|
690
691
|
});
|
|
691
692
|
}
|
|
692
|
-
function
|
|
693
|
+
function ke(e) {
|
|
693
694
|
if (!e) return null;
|
|
694
695
|
try {
|
|
695
696
|
let t = JSON.parse(e);
|
|
696
|
-
return !t || !Array.isArray(t.blocks) || t.blocks.length === 0 ? null : /* @__PURE__ */
|
|
697
|
+
return !t || !Array.isArray(t.blocks) || t.blocks.length === 0 ? null : /* @__PURE__ */ q(s, {
|
|
697
698
|
tag: "div",
|
|
698
699
|
type: "inherit",
|
|
699
|
-
className:
|
|
700
|
-
children: t.blocks.map((e, t) => /* @__PURE__ */
|
|
700
|
+
className: S,
|
|
701
|
+
children: t.blocks.map((e, t) => /* @__PURE__ */ q(L, { children: Ae(e) }, e.id ?? `${e.type}-${t}`))
|
|
701
702
|
});
|
|
702
703
|
} catch {
|
|
703
|
-
let t =
|
|
704
|
-
return /* @__PURE__ */
|
|
704
|
+
let t = Me(e);
|
|
705
|
+
return /* @__PURE__ */ q(s, {
|
|
705
706
|
type: "inherit",
|
|
706
707
|
className: "whitespace-pre-line",
|
|
707
708
|
children: t
|
|
708
709
|
});
|
|
709
710
|
}
|
|
710
711
|
}
|
|
711
|
-
function
|
|
712
|
+
function Ae(e) {
|
|
712
713
|
let t = e.data ?? {};
|
|
713
714
|
switch (e.type) {
|
|
714
715
|
case "paragraph": {
|
|
715
716
|
let e = String(t.text ?? "").trim();
|
|
716
717
|
if (!e) return null;
|
|
717
|
-
let n =
|
|
718
|
-
return n ? /* @__PURE__ */
|
|
718
|
+
let n = x(e);
|
|
719
|
+
return n ? /* @__PURE__ */ q("p", { dangerouslySetInnerHTML: { __html: n } }) : null;
|
|
719
720
|
}
|
|
720
721
|
case "header": {
|
|
721
|
-
let e =
|
|
722
|
-
return e ?
|
|
722
|
+
let e = je(String(t.text ?? "")), n = Number(t.level ?? 3);
|
|
723
|
+
return e ? R(`h${Math.min(Math.max(n, 1), 6)}`, null, e) : null;
|
|
723
724
|
}
|
|
724
725
|
case "list": {
|
|
725
|
-
let e = (Array.isArray(t.items) ? t.items : []).map((e) =>
|
|
726
|
-
return e.length === 0 ? null : t.style === "ordered" ? /* @__PURE__ */
|
|
726
|
+
let e = (Array.isArray(t.items) ? t.items : []).map((e) => je(String(e ?? ""))).filter((e) => e.length > 0);
|
|
727
|
+
return e.length === 0 ? null : t.style === "ordered" ? /* @__PURE__ */ q("ol", { children: e.map((e, t) => /* @__PURE__ */ q("li", { children: /* @__PURE__ */ q(s, {
|
|
727
728
|
tag: "span",
|
|
728
729
|
type: "inherit",
|
|
729
730
|
children: e
|
|
730
|
-
}) }, `${e}-${t}`)) }) : /* @__PURE__ */
|
|
731
|
+
}) }, `${e}-${t}`)) }) : /* @__PURE__ */ q("ul", { children: e.map((e) => /* @__PURE__ */ q("li", { children: /* @__PURE__ */ q(s, {
|
|
731
732
|
tag: "span",
|
|
732
733
|
type: "inherit",
|
|
733
734
|
children: e
|
|
@@ -736,16 +737,16 @@ function ke(e) {
|
|
|
736
737
|
case "quote": {
|
|
737
738
|
let e = String(t.text ?? "").trim();
|
|
738
739
|
if (!e) return null;
|
|
739
|
-
let n =
|
|
740
|
-
return /* @__PURE__ */
|
|
740
|
+
let n = je(String(t.caption ?? ""));
|
|
741
|
+
return /* @__PURE__ */ J("blockquote", {
|
|
741
742
|
className: "italic",
|
|
742
|
-
children: [/* @__PURE__ */
|
|
743
|
+
children: [/* @__PURE__ */ q(C, {
|
|
743
744
|
tag: "div",
|
|
744
745
|
html: e,
|
|
745
746
|
type: "secondary"
|
|
746
|
-
}), n.length > 0 && /* @__PURE__ */
|
|
747
|
+
}), n.length > 0 && /* @__PURE__ */ q("cite", {
|
|
747
748
|
className: "mt-1 block not-italic",
|
|
748
|
-
children: /* @__PURE__ */
|
|
749
|
+
children: /* @__PURE__ */ J(s, {
|
|
749
750
|
tag: "span",
|
|
750
751
|
size: "xs",
|
|
751
752
|
type: "secondary",
|
|
@@ -754,23 +755,23 @@ function ke(e) {
|
|
|
754
755
|
})]
|
|
755
756
|
});
|
|
756
757
|
}
|
|
757
|
-
case "delimiter": return /* @__PURE__ */
|
|
758
|
+
case "delimiter": return /* @__PURE__ */ q("hr", {
|
|
758
759
|
className: "border-dashed",
|
|
759
760
|
"aria-hidden": "true"
|
|
760
761
|
});
|
|
761
762
|
default: {
|
|
762
|
-
let e =
|
|
763
|
-
return e ? /* @__PURE__ */
|
|
763
|
+
let e = je(String(t.text ?? ""));
|
|
764
|
+
return e ? /* @__PURE__ */ q("p", {
|
|
764
765
|
className: "whitespace-pre-line",
|
|
765
766
|
children: e
|
|
766
767
|
}) : null;
|
|
767
768
|
}
|
|
768
769
|
}
|
|
769
770
|
}
|
|
770
|
-
function
|
|
771
|
+
function je(e) {
|
|
771
772
|
return e.replace(/<[^>]*>/g, "").trim();
|
|
772
773
|
}
|
|
773
|
-
function
|
|
774
|
+
function Me(e) {
|
|
774
775
|
if (typeof e != "string") return "";
|
|
775
776
|
let t = e.trim();
|
|
776
777
|
if (t === "") return "";
|
|
@@ -783,152 +784,152 @@ function je(e) {
|
|
|
783
784
|
}
|
|
784
785
|
//#endregion
|
|
785
786
|
//#region src/components/features/comments/partials/comment-item.tsx
|
|
786
|
-
var
|
|
787
|
-
let
|
|
787
|
+
var Ne = "?", Pe = (e) => e?.url, Fe = (e) => e?.name, Ie = (e) => e.charAt(0).toUpperCase() + e.slice(1).replace(/_/g, " "), Le = B(function({ comment: e, canModerate: t, onDelete: r, onAttachmentRemove: o, onEdit: c, onPinToggle: l, onReact: h, onReply: g, allowReactions: _, allowReplies: b, sanitizer: x, strings: S, getMediaUrl: C, getMediaName: w, getStatusLabel: T, formatRelativeTime: E, resources: te, renderAttachment: N, renderReference: P }) {
|
|
788
|
+
let F = ge(S), ne = _ ?? !0, re = b ?? !0, I = _e({
|
|
788
789
|
getMediaUrl: C,
|
|
789
790
|
getMediaName: w,
|
|
790
|
-
getStatusLabel:
|
|
791
|
-
formatRelativeTime:
|
|
792
|
-
}),
|
|
793
|
-
if (!
|
|
794
|
-
let e =
|
|
795
|
-
return e === "" ?
|
|
796
|
-
}, [
|
|
797
|
-
Te(e),
|
|
798
|
-
}, [
|
|
799
|
-
return /* @__PURE__ */
|
|
800
|
-
className: i("comment-item--component group relative overflow-hidden rounded-radius border transition-colors", "border-border/60 bg-card text-card-foreground px-surface pt-surface",
|
|
791
|
+
getStatusLabel: T,
|
|
792
|
+
formatRelativeTime: E
|
|
793
|
+
}), ie = I.getMediaUrl ?? Pe, ae = I.getMediaName ?? Fe, L = I.getStatusLabel ?? Ie, R = I.formatRelativeTime, z = e.user?.name ?? F.fallbackAuthor, B = e.user?.avatar ?? void 0, H = U(() => {
|
|
794
|
+
if (!z) return Ne;
|
|
795
|
+
let e = z.trim();
|
|
796
|
+
return e === "" ? Ne : e.charAt(0).toUpperCase();
|
|
797
|
+
}, [z]), oe = U(() => 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]), W = U(() => (e.attachments ?? []).filter((e) => !!e && typeof e == "object"), [e.attachments]), K = ne ? e.reactions ?? [] : [], Y = e.isPinned === !0, ce = e.isEdited === !0, X = e.status && e.status !== "active", Z = X && e.status ? L(e.status) : null, le = e.canDelete === !0 || t === !0, Q = e.canEdit === !0 || t === !0, ue = !!re && !!g && !!e.id, he = !!ne && !!h && !!e.id, ve = !!l && !!t, ye = !!Q && !!c && !!e.id, xe = !!le && !!r && !!e.id, Se = ue || he || ve || ye || xe, Ce = v(), [we, Te] = G(null), Ee = V((e) => {
|
|
798
|
+
Te(e), Ce.show();
|
|
799
|
+
}, [Ce]), De = W.length > 0;
|
|
800
|
+
return /* @__PURE__ */ J("article", {
|
|
801
|
+
className: i("comment-item--component group relative overflow-hidden rounded-radius border transition-colors", "border-border/60 bg-card text-card-foreground px-surface pt-surface", Se ? "pb-surface-xs" : "pb-surface"),
|
|
801
802
|
"data-comment-id": e.id,
|
|
802
|
-
children: [/* @__PURE__ */
|
|
803
|
+
children: [/* @__PURE__ */ J(m, {
|
|
803
804
|
direction: "horizontal",
|
|
804
805
|
align: "start",
|
|
805
806
|
gap: "lg",
|
|
806
807
|
className: "min-w-0",
|
|
807
|
-
children: [/* @__PURE__ */
|
|
808
|
+
children: [/* @__PURE__ */ J(A, {
|
|
808
809
|
className: "size-avatar shrink-0",
|
|
809
|
-
children: [!!
|
|
810
|
-
src:
|
|
811
|
-
alt:
|
|
812
|
-
}), /* @__PURE__ */
|
|
810
|
+
children: [!!B && /* @__PURE__ */ q(ee, {
|
|
811
|
+
src: B,
|
|
812
|
+
alt: z
|
|
813
|
+
}), /* @__PURE__ */ q(k, {
|
|
813
814
|
className: "bg-muted text-muted-foreground text-xs font-medium",
|
|
814
|
-
children:
|
|
815
|
+
children: H
|
|
815
816
|
})]
|
|
816
|
-
}), /* @__PURE__ */
|
|
817
|
+
}), /* @__PURE__ */ J("div", {
|
|
817
818
|
className: "comment-item--body min-w-0 flex-1",
|
|
818
819
|
children: [
|
|
819
|
-
/* @__PURE__ */
|
|
820
|
+
/* @__PURE__ */ J(m, {
|
|
820
821
|
gap: "xs",
|
|
821
822
|
className: "comment-item--message min-w-0",
|
|
822
|
-
children: [/* @__PURE__ */
|
|
823
|
+
children: [/* @__PURE__ */ J(m, {
|
|
823
824
|
direction: "horizontal",
|
|
824
825
|
align: "baseline",
|
|
825
826
|
gap: "md",
|
|
826
827
|
className: "min-w-0",
|
|
827
828
|
children: [
|
|
828
|
-
/* @__PURE__ */
|
|
829
|
+
/* @__PURE__ */ q(s, {
|
|
829
830
|
tag: "span",
|
|
830
831
|
type: "inherit",
|
|
831
832
|
weight: "semibold",
|
|
832
833
|
className: "truncate",
|
|
833
|
-
children:
|
|
834
|
+
children: z
|
|
834
835
|
}),
|
|
835
|
-
!!
|
|
836
|
+
!!Y && /* @__PURE__ */ q(f, {
|
|
836
837
|
delayDuration: 0,
|
|
837
|
-
children: /* @__PURE__ */
|
|
838
|
-
render: /* @__PURE__ */
|
|
839
|
-
children: /* @__PURE__ */
|
|
838
|
+
children: /* @__PURE__ */ J(p, { children: [/* @__PURE__ */ q(u, {
|
|
839
|
+
render: /* @__PURE__ */ q("span", { className: "inline-flex shrink-0 self-center" }),
|
|
840
|
+
children: /* @__PURE__ */ q(fe, {
|
|
840
841
|
className: "text-muted-foreground size-icon-sm",
|
|
841
842
|
"aria-hidden": !0
|
|
842
843
|
})
|
|
843
|
-
}), /* @__PURE__ */
|
|
844
|
+
}), /* @__PURE__ */ q(d, {
|
|
844
845
|
side: "top",
|
|
845
846
|
className: "text-xs",
|
|
846
|
-
children:
|
|
847
|
+
children: F.pinned
|
|
847
848
|
})] })
|
|
848
849
|
}),
|
|
849
|
-
/* @__PURE__ */
|
|
850
|
+
/* @__PURE__ */ q(O, {
|
|
850
851
|
value: e.createdAt,
|
|
851
|
-
formatRelativeTime:
|
|
852
|
+
formatRelativeTime: R,
|
|
852
853
|
size: "xs",
|
|
853
854
|
className: "shrink-0 tabular-nums"
|
|
854
855
|
}),
|
|
855
|
-
!!
|
|
856
|
+
!!ce && /* @__PURE__ */ q(s, {
|
|
856
857
|
tag: "span",
|
|
857
858
|
size: "xs",
|
|
858
859
|
type: "secondary",
|
|
859
860
|
className: "shrink-0",
|
|
860
|
-
children:
|
|
861
|
+
children: F.edited
|
|
861
862
|
}),
|
|
862
|
-
!!
|
|
863
|
+
!!X && !!Z && /* @__PURE__ */ q(j, {
|
|
863
864
|
size: "sm",
|
|
864
865
|
tone: "secondary",
|
|
865
866
|
className: "self-center",
|
|
866
|
-
children:
|
|
867
|
+
children: Z
|
|
867
868
|
})
|
|
868
869
|
]
|
|
869
|
-
}), /* @__PURE__ */
|
|
870
|
+
}), /* @__PURE__ */ q("div", {
|
|
870
871
|
className: "leading-relaxed",
|
|
871
|
-
children: /* @__PURE__ */
|
|
872
|
+
children: /* @__PURE__ */ q(Oe, {
|
|
872
873
|
comment: e,
|
|
873
|
-
resources:
|
|
874
|
-
renderReference:
|
|
874
|
+
resources: te,
|
|
875
|
+
renderReference: P,
|
|
875
876
|
sanitizer: x
|
|
876
877
|
})
|
|
877
878
|
})]
|
|
878
879
|
}),
|
|
879
|
-
|
|
880
|
+
oe.length > 0 && /* @__PURE__ */ q("div", {
|
|
880
881
|
className: "mt-space-md flex flex-wrap gap-space-sm",
|
|
881
|
-
children:
|
|
882
|
+
children: oe.map((e) => /* @__PURE__ */ q(j, {
|
|
882
883
|
size: "sm",
|
|
883
884
|
tone: "secondary",
|
|
884
885
|
children: e
|
|
885
886
|
}, e))
|
|
886
887
|
}),
|
|
887
|
-
|
|
888
|
+
De && /* @__PURE__ */ q("div", {
|
|
888
889
|
className: "mt-space-md flex flex-wrap gap-space-sm",
|
|
889
|
-
children:
|
|
890
|
-
if (
|
|
891
|
-
let t = !!o && !!e.id &&
|
|
892
|
-
return /* @__PURE__ */
|
|
890
|
+
children: W.map((e) => {
|
|
891
|
+
if (N) return /* @__PURE__ */ q("div", { children: N(e) }, e.id ?? e.name);
|
|
892
|
+
let t = !!o && !!e.id && le;
|
|
893
|
+
return /* @__PURE__ */ q(be, {
|
|
893
894
|
attachment: e,
|
|
894
895
|
editable: t,
|
|
895
896
|
onRemove: t ? () => Ee(e.id) : void 0,
|
|
896
897
|
accessors: {
|
|
897
|
-
getMediaUrl:
|
|
898
|
-
getMediaName:
|
|
898
|
+
getMediaUrl: ie,
|
|
899
|
+
getMediaName: ae
|
|
899
900
|
},
|
|
900
901
|
strings: S
|
|
901
902
|
}, e.id ?? e.name);
|
|
902
903
|
})
|
|
903
904
|
}),
|
|
904
|
-
|
|
905
|
+
K.length > 0 && /* @__PURE__ */ q(m, {
|
|
905
906
|
direction: "horizontal",
|
|
906
907
|
wrap: !0,
|
|
907
908
|
align: "center",
|
|
908
909
|
gap: "xs",
|
|
909
910
|
className: "mt-space-md",
|
|
910
|
-
children:
|
|
911
|
+
children: K.map((t) => /* @__PURE__ */ q("button", {
|
|
911
912
|
type: "button",
|
|
912
|
-
"aria-label": n(
|
|
913
|
+
"aria-label": n(F.reactionLabel ?? $.reactionLabel, {
|
|
913
914
|
emoji: t.emoji,
|
|
914
915
|
count: t.count
|
|
915
916
|
}),
|
|
916
917
|
"aria-pressed": t.mine ?? !1,
|
|
917
918
|
onClick: () => h && e.id ? h(e.id, t.emoji) : void 0,
|
|
918
919
|
title: t.users?.join(", "),
|
|
919
|
-
className: i(
|
|
920
|
-
children: /* @__PURE__ */
|
|
920
|
+
className: i(M.inline, M.focus),
|
|
921
|
+
children: /* @__PURE__ */ J(j, {
|
|
921
922
|
size: "sm",
|
|
922
923
|
tone: t.mine ? "info" : "secondary",
|
|
923
924
|
className: "cursor-pointer transition-colors",
|
|
924
|
-
children: [/* @__PURE__ */
|
|
925
|
+
children: [/* @__PURE__ */ q(s, {
|
|
925
926
|
tag: "span",
|
|
926
927
|
size: "inherit",
|
|
927
928
|
lineHeight: "none",
|
|
928
929
|
className: "text-inherit",
|
|
929
930
|
"aria-hidden": !0,
|
|
930
931
|
children: t.emoji
|
|
931
|
-
}), /* @__PURE__ */
|
|
932
|
+
}), /* @__PURE__ */ q(D, {
|
|
932
933
|
value: t.count,
|
|
933
934
|
size: "inherit",
|
|
934
935
|
align: "left",
|
|
@@ -937,54 +938,54 @@ var Me = "?", Ne = (e) => e?.url, Pe = (e) => e?.name, Fe = (e) => e.charAt(0).t
|
|
|
937
938
|
})
|
|
938
939
|
}, t.emoji))
|
|
939
940
|
}),
|
|
940
|
-
|
|
941
|
+
Se && /* @__PURE__ */ J("div", {
|
|
941
942
|
className: i("comment-item--actions relative mt-space-xs 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"),
|
|
942
943
|
children: [
|
|
943
|
-
|
|
944
|
+
ue && /* @__PURE__ */ q(a, {
|
|
944
945
|
type: "button",
|
|
945
946
|
size: "sm",
|
|
946
947
|
iconOnly: !0,
|
|
947
948
|
tone: "secondary",
|
|
948
949
|
buttonStyle: "ghost",
|
|
949
950
|
onClick: () => e.id && g(e.id),
|
|
950
|
-
title:
|
|
951
|
-
"aria-label":
|
|
952
|
-
children: /* @__PURE__ */
|
|
951
|
+
title: F.replyLabel,
|
|
952
|
+
"aria-label": F.replyLabel,
|
|
953
|
+
children: /* @__PURE__ */ q(se, { className: "size-icon-md" })
|
|
953
954
|
}),
|
|
954
|
-
|
|
955
|
+
he && /* @__PURE__ */ q(a, {
|
|
955
956
|
type: "button",
|
|
956
957
|
size: "sm",
|
|
957
958
|
iconOnly: !0,
|
|
958
959
|
tone: "secondary",
|
|
959
960
|
buttonStyle: "ghost",
|
|
960
961
|
onClick: () => e.id && h(e.id, "👍"),
|
|
961
|
-
title:
|
|
962
|
-
"aria-label":
|
|
963
|
-
children: /* @__PURE__ */
|
|
962
|
+
title: F.addReactionLabel,
|
|
963
|
+
"aria-label": F.addReactionLabel,
|
|
964
|
+
children: /* @__PURE__ */ q(pe, { className: "size-icon-md" })
|
|
964
965
|
}),
|
|
965
|
-
|
|
966
|
+
ve && /* @__PURE__ */ q(a, {
|
|
966
967
|
type: "button",
|
|
967
968
|
size: "sm",
|
|
968
969
|
iconOnly: !0,
|
|
969
970
|
tone: "secondary",
|
|
970
971
|
buttonStyle: "ghost",
|
|
971
972
|
onClick: () => l(e),
|
|
972
|
-
title:
|
|
973
|
-
"aria-label":
|
|
974
|
-
children: /* @__PURE__ */
|
|
973
|
+
title: Y ? F.unpinLabel : F.pinLabel,
|
|
974
|
+
"aria-label": Y ? F.unpinLabel : F.pinLabel,
|
|
975
|
+
children: /* @__PURE__ */ q(fe, { className: i("size-icon-md", Y && "text-foreground") })
|
|
975
976
|
}),
|
|
976
|
-
|
|
977
|
+
ye && /* @__PURE__ */ q(a, {
|
|
977
978
|
type: "button",
|
|
978
979
|
size: "sm",
|
|
979
980
|
iconOnly: !0,
|
|
980
981
|
tone: "secondary",
|
|
981
982
|
buttonStyle: "ghost",
|
|
982
|
-
title:
|
|
983
|
-
"aria-label":
|
|
983
|
+
title: F.editLabel,
|
|
984
|
+
"aria-label": F.editLabel,
|
|
984
985
|
onClick: () => c(e),
|
|
985
|
-
children: /* @__PURE__ */
|
|
986
|
+
children: /* @__PURE__ */ q(de, { className: "size-icon-md" })
|
|
986
987
|
}),
|
|
987
|
-
|
|
988
|
+
xe && /* @__PURE__ */ q(a, {
|
|
988
989
|
type: "button",
|
|
989
990
|
size: "sm",
|
|
990
991
|
iconOnly: !0,
|
|
@@ -992,31 +993,31 @@ var Me = "?", Ne = (e) => e?.url, Pe = (e) => e?.name, Fe = (e) => e.charAt(0).t
|
|
|
992
993
|
buttonStyle: "ghost",
|
|
993
994
|
className: "hover:text-destructive",
|
|
994
995
|
onClick: () => r(e.id),
|
|
995
|
-
title:
|
|
996
|
-
"aria-label":
|
|
997
|
-
children: /* @__PURE__ */
|
|
996
|
+
title: F.deleteLabel,
|
|
997
|
+
"aria-label": F.deleteLabel,
|
|
998
|
+
children: /* @__PURE__ */ q(me, { className: "size-icon-md" })
|
|
998
999
|
})
|
|
999
1000
|
]
|
|
1000
1001
|
})
|
|
1001
1002
|
]
|
|
1002
1003
|
})]
|
|
1003
|
-
}), !!o && /* @__PURE__ */
|
|
1004
|
-
|
|
1004
|
+
}), !!o && /* @__PURE__ */ q(y, {
|
|
1005
|
+
...Ce.overlayProps,
|
|
1005
1006
|
destructive: !0,
|
|
1006
|
-
title:
|
|
1007
|
-
description:
|
|
1008
|
-
strings: { confirm:
|
|
1007
|
+
title: F.confirmRemoveAttachmentTitle,
|
|
1008
|
+
description: F.confirmRemoveAttachmentDescription,
|
|
1009
|
+
strings: { confirm: F.attachmentRemoveLabel },
|
|
1009
1010
|
onConfirm: () => {
|
|
1010
1011
|
we && e.id && o(e.id, we);
|
|
1011
1012
|
}
|
|
1012
1013
|
})]
|
|
1013
1014
|
});
|
|
1014
|
-
}),
|
|
1015
|
-
return e.length ? /* @__PURE__ */
|
|
1015
|
+
}), Re = 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 }) {
|
|
1016
|
+
return e.length ? /* @__PURE__ */ q(m, {
|
|
1016
1017
|
gap: "sm",
|
|
1017
1018
|
className: "comment-timeline--component",
|
|
1018
1019
|
children: e.map((e, m) => {
|
|
1019
|
-
let x = /* @__PURE__ */
|
|
1020
|
+
let x = /* @__PURE__ */ q(Le, {
|
|
1020
1021
|
comment: e,
|
|
1021
1022
|
canModerate: t,
|
|
1022
1023
|
onDelete: n,
|
|
@@ -1037,27 +1038,27 @@ var Me = "?", Ne = (e) => e?.url, Pe = (e) => e?.name, Fe = (e) => e.charAt(0).t
|
|
|
1037
1038
|
renderAttachment: y,
|
|
1038
1039
|
renderReference: b
|
|
1039
1040
|
});
|
|
1040
|
-
return v ? /* @__PURE__ */
|
|
1041
|
+
return v ? /* @__PURE__ */ q("div", { children: v({
|
|
1041
1042
|
comment: e,
|
|
1042
1043
|
canModerate: t ?? !1,
|
|
1043
1044
|
onDelete: n,
|
|
1044
1045
|
onAttachmentRemove: r,
|
|
1045
1046
|
onEdit: i,
|
|
1046
1047
|
defaultItem: x
|
|
1047
|
-
}) }, e.id ?? `comment-${m}`) : /* @__PURE__ */
|
|
1048
|
+
}) }, e.id ?? `comment-${m}`) : /* @__PURE__ */ q("div", { children: x }, e.id ?? `comment-${m}`);
|
|
1048
1049
|
})
|
|
1049
|
-
}) : /* @__PURE__ */
|
|
1050
|
+
}) : /* @__PURE__ */ q(K, { children: x ?? /* @__PURE__ */ q(De, { strings: d }) });
|
|
1050
1051
|
};
|
|
1051
1052
|
//#endregion
|
|
1052
1053
|
//#region src/components/features/comments/comments.tsx
|
|
1053
|
-
function
|
|
1054
|
-
let n = e(), r = t.composerPosition ?? n.composerPosition ?? "top", a = t.maxAttachments ?? 5, o = 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, g =
|
|
1054
|
+
function ze(t) {
|
|
1055
|
+
let n = e(), r = t.composerPosition ?? n.composerPosition ?? "top", a = t.maxAttachments ?? 5, o = 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, g = ge(t.strings), _ = t.title === void 0 ? g.title : t.title, b = t.confirmDelete ?? !0, x = v(), [S, C] = G(null), w = ve({
|
|
1055
1056
|
onSubmit: t.onSubmit,
|
|
1056
1057
|
onUpdate: t.onUpdate,
|
|
1057
1058
|
onDelete: t.onDelete,
|
|
1058
1059
|
onAfterMutate: t.onAfterMutate,
|
|
1059
1060
|
onError: t.onError
|
|
1060
|
-
}),
|
|
1061
|
+
}), T = V((e) => {
|
|
1061
1062
|
if (!b) {
|
|
1062
1063
|
w.deleteComment(e);
|
|
1063
1064
|
return;
|
|
@@ -1067,24 +1068,24 @@ function Re(t) {
|
|
|
1067
1068
|
b,
|
|
1068
1069
|
w,
|
|
1069
1070
|
x
|
|
1070
|
-
]),
|
|
1071
|
-
let t =
|
|
1072
|
-
t &&
|
|
1071
|
+
]), E = w.startReply, D = t.comments, O = t.onReply, k = V((e) => {
|
|
1072
|
+
let t = D.find((t) => t.id === e);
|
|
1073
|
+
t && E(t), O?.(e);
|
|
1073
1074
|
}, [
|
|
1074
|
-
E,
|
|
1075
1075
|
D,
|
|
1076
|
-
|
|
1077
|
-
|
|
1076
|
+
O,
|
|
1077
|
+
E
|
|
1078
|
+
]), A = w.composerMode.kind === "editing" ? w.composerMode.comment : void 0, ee = w.composerMode.kind === "replying" ? {
|
|
1078
1079
|
commentId: w.composerMode.commentId,
|
|
1079
1080
|
authorName: w.composerMode.authorName
|
|
1080
|
-
} : void 0,
|
|
1081
|
+
} : void 0, j = t.composerSlot ?? (u ? /* @__PURE__ */ q(we, {
|
|
1081
1082
|
context: t.context,
|
|
1082
1083
|
canComment: u,
|
|
1083
1084
|
submitting: w.isSubmitting,
|
|
1084
1085
|
errors: w.formErrors,
|
|
1085
1086
|
resetKey: w.resetKey,
|
|
1086
|
-
editingComment:
|
|
1087
|
-
replyingTo:
|
|
1087
|
+
editingComment: A,
|
|
1088
|
+
replyingTo: ee,
|
|
1088
1089
|
onCancel: w.composerMode.kind === "idle" ? void 0 : w.cancelComposerMode,
|
|
1089
1090
|
onSubmit: w.submit,
|
|
1090
1091
|
strings: t.strings,
|
|
@@ -1093,15 +1094,15 @@ function Re(t) {
|
|
|
1093
1094
|
attachments: h,
|
|
1094
1095
|
maxAttachments: a,
|
|
1095
1096
|
allowAttachments: o
|
|
1096
|
-
}) : null),
|
|
1097
|
+
}) : null), M = /* @__PURE__ */ q(Re, {
|
|
1097
1098
|
comments: t.comments,
|
|
1098
1099
|
canModerate: d,
|
|
1099
|
-
onDelete: t.onDelete ?
|
|
1100
|
+
onDelete: t.onDelete ? T : void 0,
|
|
1100
1101
|
onAttachmentRemove: t.onAttachmentRemove,
|
|
1101
1102
|
onEdit: u && t.onUpdate ? w.startEdit : void 0,
|
|
1102
1103
|
onPinToggle: f,
|
|
1103
1104
|
onReact: t.onReact,
|
|
1104
|
-
onReply: u && l ?
|
|
1105
|
+
onReply: u && l ? k : void 0,
|
|
1105
1106
|
allowReactions: c,
|
|
1106
1107
|
allowReplies: l,
|
|
1107
1108
|
sanitizer: t.sanitizer,
|
|
@@ -1114,41 +1115,41 @@ function Re(t) {
|
|
|
1114
1115
|
renderItem: t.renderItem,
|
|
1115
1116
|
renderAttachment: t.renderAttachment,
|
|
1116
1117
|
renderReference: t.renderReference,
|
|
1117
|
-
emptySlot: t.emptySlot ?? /* @__PURE__ */
|
|
1118
|
-
}),
|
|
1118
|
+
emptySlot: t.emptySlot ?? /* @__PURE__ */ q(De, { strings: t.strings })
|
|
1119
|
+
}), te = j ? /* @__PURE__ */ q("div", { children: j }) : null, N = /* @__PURE__ */ J(m, {
|
|
1119
1120
|
gap: "xl",
|
|
1120
1121
|
className: "comments--body",
|
|
1121
1122
|
children: [
|
|
1122
1123
|
t.headerSlot,
|
|
1123
|
-
r === "top" &&
|
|
1124
|
-
|
|
1125
|
-
r === "bottom" &&
|
|
1124
|
+
r === "top" && te,
|
|
1125
|
+
M,
|
|
1126
|
+
r === "bottom" && te,
|
|
1126
1127
|
t.footerSlot
|
|
1127
1128
|
]
|
|
1128
1129
|
});
|
|
1129
|
-
if (t.bare) return
|
|
1130
|
-
let
|
|
1131
|
-
return /* @__PURE__ */
|
|
1132
|
-
render: /* @__PURE__ */
|
|
1130
|
+
if (t.bare) return N;
|
|
1131
|
+
let P = typeof _ == "string" ? _ : void 0;
|
|
1132
|
+
return /* @__PURE__ */ J(m, {
|
|
1133
|
+
render: /* @__PURE__ */ q("section", {}),
|
|
1133
1134
|
gap: "lg",
|
|
1134
1135
|
"data-component": "comments",
|
|
1135
1136
|
"data-slot": "comments",
|
|
1136
1137
|
className: i("comments--component", t.className),
|
|
1137
|
-
"aria-label":
|
|
1138
|
+
"aria-label": P,
|
|
1138
1139
|
children: [
|
|
1139
|
-
!(
|
|
1140
|
+
!(_ === !1 || !_ && !g.subtitle) && /* @__PURE__ */ J(m, {
|
|
1140
1141
|
gap: "normal",
|
|
1141
1142
|
className: "comments--header",
|
|
1142
|
-
children: [!!
|
|
1143
|
+
children: [!!_ && /* @__PURE__ */ q(s, {
|
|
1143
1144
|
weight: "semibold",
|
|
1144
|
-
children:
|
|
1145
|
-
}), !!g.subtitle && /* @__PURE__ */
|
|
1145
|
+
children: _
|
|
1146
|
+
}), !!g.subtitle && /* @__PURE__ */ q(s, {
|
|
1146
1147
|
type: "secondary",
|
|
1147
1148
|
children: g.subtitle
|
|
1148
1149
|
})]
|
|
1149
1150
|
}),
|
|
1150
|
-
|
|
1151
|
-
!!(b && t.onDelete) && /* @__PURE__ */
|
|
1151
|
+
N,
|
|
1152
|
+
!!(b && t.onDelete) && /* @__PURE__ */ q(y, {
|
|
1152
1153
|
...x.overlayProps,
|
|
1153
1154
|
destructive: !0,
|
|
1154
1155
|
title: g.confirmDeleteTitle,
|
|
@@ -1163,6 +1164,6 @@ function Re(t) {
|
|
|
1163
1164
|
});
|
|
1164
1165
|
}
|
|
1165
1166
|
//#endregion
|
|
1166
|
-
export {
|
|
1167
|
+
export { De as a, Se as c, _e as d, ge as f, Oe as i, be as l, Re as n, we as o, $ as p, Le as r, Ee as s, ze as t, ve as u };
|
|
1167
1168
|
|
|
1168
|
-
//# sourceMappingURL=comments-
|
|
1169
|
+
//# sourceMappingURL=comments-Di4w0H_S.js.map
|