themelia-react-ui 2.0.1 → 2.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 +307 -131
- package/README.md +28 -8
- package/THIRD_PARTY_NOTICES.md +13 -0
- package/dist/{accordion-B6a3vVgA.js → accordion-Cjb6sx0G.js} +14 -13
- package/dist/accordion-Cjb6sx0G.js.map +1 -0
- package/dist/action-menu-CllU52Mm.js +280 -0
- package/dist/action-menu-CllU52Mm.js.map +1 -0
- package/dist/affordance-geometry.generated-tF36bREk.js +140 -0
- package/dist/affordance-geometry.generated-tF36bREk.js.map +1 -0
- package/dist/ai-artifact-DvTwDVyL.js +1148 -0
- package/dist/ai-artifact-DvTwDVyL.js.map +1 -0
- package/dist/{app-shell-ZK5RWdo6.js → app-shell-C4FhvCqF.js} +5 -5
- package/dist/{app-shell-ZK5RWdo6.js.map → app-shell-C4FhvCqF.js.map} +1 -1
- package/dist/attachment-BxDfL2mw.js +246 -0
- package/dist/attachment-BxDfL2mw.js.map +1 -0
- package/dist/{auth-CYxKfo69.js → auth-ax2BqjrI.js} +58 -54
- package/dist/auth-ax2BqjrI.js.map +1 -0
- package/dist/{avatar-BBnEJIx8.js → avatar-DAPlDvhJ.js} +7 -7
- package/dist/avatar-DAPlDvhJ.js.map +1 -0
- package/dist/{badge-MrKVNzW9.js → badge-HpFqoqSY.js} +40 -40
- package/dist/badge-HpFqoqSY.js.map +1 -0
- 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 +40 -36
- package/dist/base/carousel.js.map +1 -1
- package/dist/base/cascader.js +92 -92
- package/dist/base/cascader.js.map +1 -1
- 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 +2 -2
- package/dist/base/inline-edit.js +14 -14
- package/dist/base/inline-edit.js.map +1 -1
- 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 +171 -176
- 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 +6 -6
- package/dist/base/skeleton.js +1 -1
- package/dist/base/spinner.js +79 -2
- package/dist/base/spinner.js.map +1 -0
- 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 +46 -45
- 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/{batch-action-bar-BZGDG-Si.js → batch-action-bar-DnUJ21NQ.js} +6 -5
- package/dist/batch-action-bar-DnUJ21NQ.js.map +1 -0
- package/dist/blocks/admin.js +42 -42
- package/dist/blocks/admin.js.map +1 -1
- package/dist/blocks/ai.js +260 -240
- package/dist/blocks/ai.js.map +1 -1
- package/dist/blocks/analytics/usage-card.js +1 -1
- package/dist/blocks/analytics.js +620 -585
- 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 +1152 -1109
- package/dist/blocks/commerce.js.map +1 -1
- package/dist/blocks/data-display.js +2 -2
- package/dist/blocks/onboarding.js +48 -39
- package/dist/blocks/onboarding.js.map +1 -1
- package/dist/blocks/planning.js +13 -12
- package/dist/blocks/planning.js.map +1 -1
- package/dist/blocks/timelines.js +1 -1
- package/dist/{breadcrumbs-D5t7I023.js → breadcrumbs-C-oqs1sQ.js} +5 -5
- package/dist/breadcrumbs-C-oqs1sQ.js.map +1 -0
- package/dist/{button-QYwiyhD2.js → button-DVzspB_G.js} +2 -2
- package/dist/{button-QYwiyhD2.js.map → button-DVzspB_G.js.map} +1 -1
- package/dist/{buttons-SbIcm1HJ.js → buttons-DPZekJFu.js} +20 -15
- package/dist/buttons-DPZekJFu.js.map +1 -0
- package/dist/cards-BaBZR-AU.js +68 -0
- package/dist/cards-BaBZR-AU.js.map +1 -0
- package/dist/{chart-QfrARkXl.js → chart-ZOYyK2xG.js} +58 -55
- package/dist/chart-ZOYyK2xG.js.map +1 -0
- package/dist/{checkbox-DhB6K0bK.js → checkbox-AWIhNhmo.js} +2 -2
- package/dist/{checkbox-DhB6K0bK.js.map → checkbox-AWIhNhmo.js.map} +1 -1
- package/dist/{choice-inputs-t6w3ATNz.js → choice-inputs-CNHvARCJ.js} +49 -45
- package/dist/choice-inputs-CNHvARCJ.js.map +1 -0
- package/dist/{code-block-Dgbu-CU3.js → code-block-DeneBJR_.js} +8 -8
- package/dist/code-block-DeneBJR_.js.map +1 -0
- package/dist/{collapsible-D8AEGU1-.js → collapsible-C-_l4hpy.js} +3 -3
- package/dist/{collapsible-D8AEGU1-.js.map → collapsible-C-_l4hpy.js.map} +1 -1
- package/dist/{collection-content-uK16Grv0.js → collection-content-By56pLog.js} +3 -3
- package/dist/{collection-content-uK16Grv0.js.map → collection-content-By56pLog.js.map} +1 -1
- package/dist/combobox-C0EQW6dr.js +875 -0
- package/dist/combobox-C0EQW6dr.js.map +1 -0
- package/dist/combobox-xCQ2RMNE.js +309 -0
- package/dist/combobox-xCQ2RMNE.js.map +1 -0
- package/dist/{command-kNR20o7x.js → command-C25VMRII.js} +7 -7
- package/dist/{command-kNR20o7x.js.map → command-C25VMRII.js.map} +1 -1
- package/dist/{comments-BpDuCUUu.js → comments-BYYlTA8E.js} +114 -105
- package/dist/comments-BYYlTA8E.js.map +1 -0
- package/dist/components/base/badge/badge.recipes.d.ts +1 -1
- package/dist/components/base/buttons/loader-button.d.ts +2 -1
- package/dist/components/base/cards/card.recipes.d.ts +2 -3
- package/dist/components/base/cards/partials/smart-card-skeleton.d.ts +3 -13
- package/dist/components/base/cards/smart-card.types.d.ts +11 -4
- package/dist/components/base/chart/chart.d.ts +2 -5
- package/dist/components/base/combobox/combobox.strings.d.ts +7 -0
- package/dist/components/base/combobox/index.d.ts +30 -4
- package/dist/components/base/forms/form-sizing.d.ts +11 -3
- package/dist/components/base/navigation/pagination.d.ts +5 -2
- package/dist/components/base/popover/popover.recipes.d.ts +15 -1
- package/dist/components/base/table/index.d.ts +9 -2
- package/dist/components/base/text-inputs/input-group.d.ts +2 -2
- package/dist/components/blocks/ai/ai-shimmer/ai-shimmer.d.ts +1 -1
- package/dist/components/blocks/ai/ai-shimmer/types.d.ts +3 -0
- package/dist/components/blocks/commerce/fulfillment-group/types.d.ts +3 -1
- package/dist/components/blocks/data-display/inline-stat/inline-stat.d.ts +16 -8
- package/dist/components/features/activities/partials/activity-marker.d.ts +6 -3
- package/dist/components/features/appointment-calendar/appointment-calendar.d.ts +5 -0
- package/dist/components/features/appointment-calendar/appointment-calendar.types.d.ts +220 -0
- package/dist/components/features/appointment-calendar/appointment-calendar.utils.d.ts +41 -0
- package/dist/components/features/appointment-calendar/index.d.ts +3 -0
- package/dist/components/features/appointment-calendar/partials/appointment-agenda.d.ts +32 -0
- package/dist/components/features/appointment-calendar/partials/appointment-month.d.ts +13 -0
- package/dist/components/features/combobox/combobox.strings.d.ts +15 -1
- package/dist/components/features/combobox/types.d.ts +4 -0
- package/dist/components/features/media-library/media-library.strings.d.ts +2 -0
- package/dist/components/features/rich-text-editor/index.d.ts +1 -1
- package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +6 -0
- package/dist/components/features/rich-text-editor/rich-text-editor.types.d.ts +9 -1
- package/dist/components/features/table/table-header.d.ts +1 -1
- package/dist/components/features/table/table.strings.d.ts +55 -1
- package/dist/components/features/table/table.types.d.ts +17 -4
- package/dist/components/features/theme-tweaker/theme-tweaker.types.d.ts +5 -0
- package/dist/components/primitives/number.d.ts +4 -2
- package/dist/components/primitives/value.d.ts +3 -1
- package/dist/components/typography/text-link.d.ts +4 -0
- package/dist/components/ui/combobox.d.ts +6 -2
- package/dist/components/ui/item.d.ts +8 -8
- package/dist/components/ui/tabs.d.ts +1 -1
- package/dist/{containers-DmWiJa2I.js → containers-Mu1LMGV1.js} +2 -2
- package/dist/{containers-DmWiJa2I.js.map → containers-Mu1LMGV1.js.map} +1 -1
- package/dist/{copyable-B3Gwgdqc.js → copyable-ClBuk_UK.js} +4 -4
- package/dist/{copyable-B3Gwgdqc.js.map → copyable-ClBuk_UK.js.map} +1 -1
- package/dist/{data-display-DafIvCl5.js → data-display-DT_khPl_.js} +98 -87
- package/dist/data-display-DT_khPl_.js.map +1 -0
- package/dist/{date-BgK3bTdo.js → date-DCrsDTZc.js} +5 -5
- package/dist/{date-BgK3bTdo.js.map → date-DCrsDTZc.js.map} +1 -1
- package/dist/{date-picker-CF-DtUpF.js → date-picker-ay0Pha_a.js} +594 -593
- package/dist/date-picker-ay0Pha_a.js.map +1 -0
- package/dist/date-pickers-Ccw8DL2b.js +175 -0
- package/dist/date-pickers-Ccw8DL2b.js.map +1 -0
- package/dist/{display-DsQTVzMz.js → display-hAc1HjpI.js} +49 -49
- package/dist/display-hAc1HjpI.js.map +1 -0
- package/dist/dropdown-menu-Cl4X7L5S.js +193 -0
- package/dist/dropdown-menu-Cl4X7L5S.js.map +1 -0
- package/dist/editable-text-recipe-Cn61kEcv.js +10 -0
- package/dist/editable-text-recipe-Cn61kEcv.js.map +1 -0
- package/dist/features/activities.js +398 -375
- package/dist/features/activities.js.map +1 -1
- package/dist/features/ai-chat.js +188 -179
- package/dist/features/ai-chat.js.map +1 -1
- package/dist/features/appointment-calendar.js +683 -0
- package/dist/features/appointment-calendar.js.map +1 -0
- package/dist/features/async-preview.js +109 -107
- 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 +137 -137
- package/dist/features/data-view.js.map +1 -1
- package/dist/features/email-composer.js +255 -255
- package/dist/features/email-composer.js.map +1 -1
- package/dist/features/event-calendar.js +254 -248
- package/dist/features/event-calendar.js.map +1 -1
- package/dist/features/filters.js +1 -1
- package/dist/features/global-search.js +35 -32
- package/dist/features/global-search.js.map +1 -1
- package/dist/features/kanban.js +118 -117
- package/dist/features/kanban.js.map +1 -1
- package/dist/features/map.js +233 -231
- package/dist/features/map.js.map +1 -1
- package/dist/features/media-library.js +789 -775
- 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 +922 -902
- package/dist/features/products.js.map +1 -1
- package/dist/features/questionnaire.js +28 -24
- package/dist/features/questionnaire.js.map +1 -1
- package/dist/features/resource-assignment.js +18 -15
- package/dist/features/resource-assignment.js.map +1 -1
- package/dist/features/resource.js +12 -12
- package/dist/features/resource.js.map +1 -1
- package/dist/features/rich-text-editor.js +2 -2
- package/dist/features/schema-form.js +15 -13
- package/dist/features/schema-form.js.map +1 -1
- package/dist/features/suggestions.js +3 -3
- package/dist/features/sync.js +11 -5
- package/dist/features/sync.js.map +1 -1
- package/dist/features/table.js +1 -1
- package/dist/features/theme-tweaker.js +493 -489
- package/dist/features/theme-tweaker.js.map +1 -1
- package/dist/feedback-BYIhtitP.js +239 -0
- package/dist/feedback-BYIhtitP.js.map +1 -0
- package/dist/{field-affordance-recipes-qQeIf4lG.js → field-affordance-recipes-DZhnIL_Y.js} +11 -18
- package/dist/field-affordance-recipes-DZhnIL_Y.js.map +1 -0
- package/dist/{filters-BkHH53uv.js → filters-BGfvjP4d.js} +589 -580
- package/dist/filters-BGfvjP4d.js.map +1 -0
- package/dist/{form-field-DUt4UxSV.js → form-field-CwH9y77i.js} +6 -5
- package/dist/form-field-CwH9y77i.js.map +1 -0
- package/dist/{form-sizing-By94KzXE.js → form-sizing-BdP_Mf5p.js} +39 -44
- package/dist/form-sizing-BdP_Mf5p.js.map +1 -0
- package/dist/{forms-Bzha-Y3B.js → forms-B9G_xwzi.js} +8 -8
- package/dist/{forms-Bzha-Y3B.js.map → forms-B9G_xwzi.js.map} +1 -1
- package/dist/{forms-numeric-C0bvjRPZ.js → forms-numeric-B_jraJaQ.js} +309 -309
- package/dist/forms-numeric-B_jraJaQ.js.map +1 -0
- package/dist/{header-BOefOKd1.js → header-CGXuhcRm.js} +160 -153
- package/dist/header-CGXuhcRm.js.map +1 -0
- package/dist/{hooks-9k_TtmKh.js → hooks-Dkz0K2WT.js} +2 -2
- package/dist/{hooks-9k_TtmKh.js.map → hooks-Dkz0K2WT.js.map} +1 -1
- package/dist/{icon-badge-CAuKupo9.js → icon-badge-DYKIwvOV.js} +4 -4
- package/dist/{icon-badge-CAuKupo9.js.map → icon-badge-DYKIwvOV.js.map} +1 -1
- package/dist/index.js +3 -3
- package/dist/input-CZw8iU99.js +21 -0
- package/dist/input-CZw8iU99.js.map +1 -0
- package/dist/input-DQdEd0YD.js +263 -0
- package/dist/input-DQdEd0YD.js.map +1 -0
- package/dist/{interaction-recipes-CHr0dJUs.js → interaction-recipes-XR9ZpVYL.js} +2 -1
- package/dist/interaction-recipes-XR9ZpVYL.js.map +1 -0
- package/dist/item-K5_ghvze.js +275 -0
- package/dist/item-K5_ghvze.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 +71 -0
- package/dist/lib/editable-text-recipe.d.ts +4 -4
- package/dist/lib/field-affordance-recipes.d.ts +2 -2
- package/dist/lib/interaction-recipes.d.ts +5 -0
- package/dist/lib/theme-mode-css.d.ts +7 -0
- package/dist/lib/tone-recipes.d.ts +8 -0
- package/dist/lib/ui-provider/types.d.ts +2 -2
- package/dist/lib/utils.js +1 -1
- package/dist/{media-gallery-DcTtAaeC.js → media-gallery-3zIVLMWH.js} +8 -8
- package/dist/media-gallery-3zIVLMWH.js.map +1 -0
- package/dist/{mentions-D-uyCh01.js → mentions-utuUvH1K.js} +144 -142
- package/dist/mentions-utuUvH1K.js.map +1 -0
- package/dist/{message-CdHgIWKf.js → message-DZ_ruyUV.js} +6 -5
- package/dist/message-DZ_ruyUV.js.map +1 -0
- package/dist/{metadata-list-X5rYAKSB.js → metadata-list-8N16ZMW_.js} +130 -119
- package/dist/metadata-list-8N16ZMW_.js.map +1 -0
- package/dist/{navigation-D3KwXmaq.js → navigation-Bnotn4AQ.js} +19 -19
- package/dist/navigation-Bnotn4AQ.js.map +1 -0
- package/dist/{navigation-HJf5zxlH.js → navigation-BzhHI3lo.js} +36 -35
- package/dist/navigation-BzhHI3lo.js.map +1 -0
- package/dist/{navigation-row-recipes-BVowojQw.js → navigation-row-recipes-BFLCk_Aq.js} +2 -2
- package/dist/{navigation-row-recipes-BVowojQw.js.map → navigation-row-recipes-BFLCk_Aq.js.map} +1 -1
- package/dist/{number-DMhe-Vsk.js → number-DbV1Dija.js} +36 -34
- package/dist/{number-DMhe-Vsk.js.map → number-DbV1Dija.js.map} +1 -1
- package/dist/{overflow-tab-bar-sQHXLlwQ.js → overflow-tab-bar-CWY7Nogn.js} +105 -103
- package/dist/overflow-tab-bar-CWY7Nogn.js.map +1 -0
- package/dist/{overlays-I0axtYA6.js → overlays-DNWmZrJ4.js} +14 -12
- package/dist/overlays-DNWmZrJ4.js.map +1 -0
- package/dist/{page-B5dTH9gE.js → page-Bgl1F560.js} +8 -8
- package/dist/{page-B5dTH9gE.js.map → page-Bgl1F560.js.map} +1 -1
- package/dist/{page-header-commands-DjzFEq3E.js → page-header-commands-DOb6WsfD.js} +5 -5
- package/dist/{page-header-commands-DjzFEq3E.js.map → page-header-commands-DOb6WsfD.js.map} +1 -1
- package/dist/pagination-BL25hu2s.js +158 -0
- package/dist/pagination-BL25hu2s.js.map +1 -0
- package/dist/{popover-Di55PyAI.js → popover-7_m66eYW.js} +8 -7
- package/dist/{popover-Di55PyAI.js.map → popover-7_m66eYW.js.map} +1 -1
- package/dist/popover-menu-B9WWygpa.js +100 -0
- package/dist/popover-menu-B9WWygpa.js.map +1 -0
- package/dist/{popover.recipes-Bdyhj2db.js → popover.recipes-D3j8R8Yp.js} +17 -10
- package/dist/popover.recipes-D3j8R8Yp.js.map +1 -0
- package/dist/{primitives-B-CkiEMU.js → primitives-BFK08r9M.js} +45 -44
- package/dist/primitives-BFK08r9M.js.map +1 -0
- package/dist/primitives.js +4 -4
- package/dist/{progress-rnS8-uAW.js → progress-B1VnCT0K.js} +5 -5
- package/dist/{progress-rnS8-uAW.js.map → progress-B1VnCT0K.js.map} +1 -1
- package/dist/{receipt-D0oswZ0p.js → receipt-BVSOH3Xo.js} +9 -6
- package/dist/{receipt-D0oswZ0p.js.map → receipt-BVSOH3Xo.js.map} +1 -1
- package/dist/{rich-text-DvGulsNJ.js → rich-text-GOUyKQ-s.js} +3 -3
- package/dist/{rich-text-DvGulsNJ.js.map → rich-text-GOUyKQ-s.js.map} +1 -1
- package/dist/{rich-text-editor-sMU_Scqm.js → rich-text-editor-cRLC-eBK.js} +418 -426
- package/dist/rich-text-editor-cRLC-eBK.js.map +1 -0
- package/dist/rich-text-editor-toolbar-DfXg0-VC.js +94 -0
- package/dist/rich-text-editor-toolbar-DfXg0-VC.js.map +1 -0
- package/dist/{scroll-area-Bt_vXY2b.js → scroll-area-DcI-M1UT.js} +2 -2
- package/dist/{scroll-area-Bt_vXY2b.js.map → scroll-area-DcI-M1UT.js.map} +1 -1
- package/dist/{separator-C8DlRGwF.js → separator-BDV-Y648.js} +3 -3
- package/dist/{separator-C8DlRGwF.js.map → separator-BDV-Y648.js.map} +1 -1
- package/dist/{separator-CYHnjsAb.js → separator-Bom7NsGO.js} +2 -2
- package/dist/{separator-CYHnjsAb.js.map → separator-Bom7NsGO.js.map} +1 -1
- package/dist/services/actions.js +1 -1
- package/dist/{settings-CQW3b-Cu.js → settings-ybnjVwbd.js} +20 -19
- package/dist/settings-ybnjVwbd.js.map +1 -0
- package/dist/{sheet-4SEvVYzA.js → sheet-CGpB3omz.js} +8 -7
- package/dist/{sheet-4SEvVYzA.js.map → sheet-CGpB3omz.js.map} +1 -1
- package/dist/{sidebar-d7Dg80ln.js → sidebar-A0ElHINE.js} +14 -13
- package/dist/{sidebar-d7Dg80ln.js.map → sidebar-A0ElHINE.js.map} +1 -1
- package/dist/{sidebar-C7WWR29L.js → sidebar-CPx_7YBa.js} +183 -182
- package/dist/sidebar-CPx_7YBa.js.map +1 -0
- package/dist/{skeleton-Cz890JZF.js → skeleton-Byjnt7qr.js} +3 -3
- package/dist/{skeleton-Cz890JZF.js.map → skeleton-Byjnt7qr.js.map} +1 -1
- package/dist/smart-card-DiC5aac3.js +604 -0
- package/dist/smart-card-DiC5aac3.js.map +1 -0
- package/dist/{structure-DC2dygdA.js → structure-BmisBK-3.js} +2 -2
- package/dist/{structure-DC2dygdA.js.map → structure-BmisBK-3.js.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/table-BweFy_P9.js +1530 -0
- package/dist/table-BweFy_P9.js.map +1 -0
- package/dist/{table-CIKyLUsy.js → table-DsfzoUia.js} +75 -63
- package/dist/table-DsfzoUia.js.map +1 -0
- package/dist/{tabs-DwBJfjxX.js → tabs-CDocW5D1.js} +14 -13
- package/dist/tabs-CDocW5D1.js.map +1 -0
- package/dist/text-inputs-f9Ia-aCi.js +353 -0
- package/dist/text-inputs-f9Ia-aCi.js.map +1 -0
- package/dist/theme-mode-css-BB-_RYab.js +14 -0
- package/dist/theme-mode-css-BB-_RYab.js.map +1 -0
- package/dist/theme-scope-BJ6eE2xt.js +50 -0
- package/dist/theme-scope-BJ6eE2xt.js.map +1 -0
- package/dist/theme.css +285 -228
- package/dist/themes/green.css +16 -12
- package/dist/timelines-CwM_9IhD.js +457 -0
- package/dist/timelines-CwM_9IhD.js.map +1 -0
- package/dist/{tone-recipes-CPoExcTE.js → tone-recipes-BPsRAvhu.js} +5 -2
- package/dist/tone-recipes-BPsRAvhu.js.map +1 -0
- package/dist/{tooltip-CsfgrfS7.js → tooltip-yiRJUFjp.js} +4 -4
- package/dist/{tooltip-CsfgrfS7.js.map → tooltip-yiRJUFjp.js.map} +1 -1
- package/dist/{tree-BiKhg8AY.js → tree-WnKQzwbq.js} +9 -9
- package/dist/{tree-BiKhg8AY.js.map → tree-WnKQzwbq.js.map} +1 -1
- package/dist/typography/rich-text.js +1 -1
- package/dist/{typography-DTRkE9zL.js → typography-UTnveOEy.js} +6 -6
- package/dist/typography-UTnveOEy.js.map +1 -0
- package/dist/typography.js +2 -2
- package/dist/{ui-provider-1D_NSYzO.js → ui-provider-C_U0Xma4.js} +3 -3
- package/dist/ui-provider-C_U0Xma4.js.map +1 -0
- package/dist/ui-provider.js +2 -2
- package/dist/{upload-BO8-CLN6.js → upload-CXyxmQBP.js} +13 -12
- package/dist/upload-CXyxmQBP.js.map +1 -0
- package/dist/{upload-queue-EOC8g1gf.js → upload-queue-Boscubn9.js} +11 -9
- package/dist/upload-queue-Boscubn9.js.map +1 -0
- package/dist/{usage-card-obRaBskq.js → usage-card-BhO5eqkX.js} +53 -37
- package/dist/usage-card-BhO5eqkX.js.map +1 -0
- package/dist/{utils-l5LpDw2z.js → utils-BRhFDwuU.js} +59 -44
- package/dist/utils-BRhFDwuU.js.map +1 -0
- package/dist/{value-inputs-TAYMX111.js → value-inputs-DXPDjvBU.js} +268 -252
- package/dist/value-inputs-DXPDjvBU.js.map +1 -0
- package/dist/{value-typography-b8wpz1eX.js → value-typography-BP8OG6h5.js} +2 -2
- package/dist/{value-typography-b8wpz1eX.js.map → value-typography-BP8OG6h5.js.map} +1 -1
- package/dist/{workspace-DH0v0KcB.js → workspace-Cdrg7k9f.js} +34 -33
- package/dist/workspace-Cdrg7k9f.js.map +1 -0
- package/docs/consumer-skill/SKILL.md +2 -2
- package/docs/consumer-skill/references/agents-md.md +1 -1
- package/docs/consumer-skill/references/composition.md +8 -6
- package/docs/consumer-skill/references/integration.md +4 -3
- package/docs/consumer-skill/references/public-api.json +105 -2
- package/docs/consumer-skill/references/review.md +7 -0
- package/docs/consumer-skill/references/theming.md +71 -6
- package/docs/consumer-skill/references/tokens.json +1 -1
- package/docs/consumer-skill/references/workflows.md +25 -0
- package/docs/consumer-skill/scripts/composition-policy.mjs +3 -2
- package/docs/consumer-skill/scripts/surface-policy.mjs +11 -0
- package/package.json +8 -4
- package/dist/accordion-B6a3vVgA.js.map +0 -1
- package/dist/action-menu-TzCoSlwL.js +0 -280
- package/dist/action-menu-TzCoSlwL.js.map +0 -1
- package/dist/affordance-geometry.generated-B5iu-Mkr.js +0 -69
- package/dist/affordance-geometry.generated-B5iu-Mkr.js.map +0 -1
- package/dist/ai-artifact-BMJdv-6q.js +0 -1115
- package/dist/ai-artifact-BMJdv-6q.js.map +0 -1
- package/dist/attachment-BtfhGm8i.js +0 -245
- package/dist/attachment-BtfhGm8i.js.map +0 -1
- package/dist/auth-CYxKfo69.js.map +0 -1
- package/dist/avatar-BBnEJIx8.js.map +0 -1
- package/dist/badge-MrKVNzW9.js.map +0 -1
- package/dist/batch-action-bar-BZGDG-Si.js.map +0 -1
- package/dist/breadcrumbs-D5t7I023.js.map +0 -1
- package/dist/buttons-SbIcm1HJ.js.map +0 -1
- package/dist/cards-CiiHpKYd.js +0 -66
- package/dist/cards-CiiHpKYd.js.map +0 -1
- package/dist/chart-QfrARkXl.js.map +0 -1
- package/dist/choice-inputs-t6w3ATNz.js.map +0 -1
- package/dist/code-block-Dgbu-CU3.js.map +0 -1
- package/dist/combobox-2Ic8N9bL.js +0 -278
- package/dist/combobox-2Ic8N9bL.js.map +0 -1
- package/dist/combobox-DLl0bfiq.js +0 -867
- package/dist/combobox-DLl0bfiq.js.map +0 -1
- package/dist/comments-BpDuCUUu.js.map +0 -1
- package/dist/data-display-DafIvCl5.js.map +0 -1
- package/dist/date-picker-CF-DtUpF.js.map +0 -1
- package/dist/date-pickers-BmzxJl5l.js +0 -174
- package/dist/date-pickers-BmzxJl5l.js.map +0 -1
- package/dist/display-DsQTVzMz.js.map +0 -1
- package/dist/dropdown-menu-E2qmdC7o.js +0 -193
- package/dist/dropdown-menu-E2qmdC7o.js.map +0 -1
- package/dist/editable-text-recipe-Bkm6wKHp.js +0 -10
- package/dist/editable-text-recipe-Bkm6wKHp.js.map +0 -1
- package/dist/feedback-qNuMBtRH.js +0 -233
- package/dist/feedback-qNuMBtRH.js.map +0 -1
- package/dist/field-affordance-recipes-qQeIf4lG.js.map +0 -1
- package/dist/filters-BkHH53uv.js.map +0 -1
- package/dist/form-field-DUt4UxSV.js.map +0 -1
- package/dist/form-sizing-By94KzXE.js.map +0 -1
- package/dist/forms-numeric-C0bvjRPZ.js.map +0 -1
- package/dist/header-BOefOKd1.js.map +0 -1
- package/dist/input-DWhBBBww.js +0 -262
- package/dist/input-DWhBBBww.js.map +0 -1
- package/dist/input-Ddi_LSYv.js +0 -20
- package/dist/input-Ddi_LSYv.js.map +0 -1
- package/dist/interaction-recipes-CHr0dJUs.js.map +0 -1
- package/dist/item-DEmDiTlD.js +0 -265
- package/dist/item-DEmDiTlD.js.map +0 -1
- package/dist/media-gallery-DcTtAaeC.js.map +0 -1
- package/dist/mentions-D-uyCh01.js.map +0 -1
- package/dist/message-CdHgIWKf.js.map +0 -1
- package/dist/metadata-list-X5rYAKSB.js.map +0 -1
- package/dist/navigation-D3KwXmaq.js.map +0 -1
- package/dist/navigation-HJf5zxlH.js.map +0 -1
- package/dist/overflow-tab-bar-sQHXLlwQ.js.map +0 -1
- package/dist/overlays-I0axtYA6.js.map +0 -1
- package/dist/pagination-3bPA_a6K.js +0 -149
- package/dist/pagination-3bPA_a6K.js.map +0 -1
- package/dist/popover-menu-B71Tn2Qz.js +0 -99
- package/dist/popover-menu-B71Tn2Qz.js.map +0 -1
- package/dist/popover.recipes-Bdyhj2db.js.map +0 -1
- package/dist/primitives-B-CkiEMU.js.map +0 -1
- package/dist/rich-text-editor-sMU_Scqm.js.map +0 -1
- package/dist/rich-text-editor.recipes-CadiF_Uu.js +0 -88
- package/dist/rich-text-editor.recipes-CadiF_Uu.js.map +0 -1
- package/dist/settings-CQW3b-Cu.js.map +0 -1
- package/dist/sidebar-C7WWR29L.js.map +0 -1
- package/dist/smart-card-lFKxn5Hu.js +0 -595
- package/dist/smart-card-lFKxn5Hu.js.map +0 -1
- package/dist/spinner-fa3h1Aif.js +0 -80
- package/dist/spinner-fa3h1Aif.js.map +0 -1
- package/dist/table-CIKyLUsy.js.map +0 -1
- package/dist/table-CrcLN9Io.js +0 -1458
- package/dist/table-CrcLN9Io.js.map +0 -1
- package/dist/tabs-DwBJfjxX.js.map +0 -1
- package/dist/text-inputs-aaK9wcDT.js +0 -326
- package/dist/text-inputs-aaK9wcDT.js.map +0 -1
- package/dist/theme-scope-kStaAer0.js +0 -39
- package/dist/theme-scope-kStaAer0.js.map +0 -1
- package/dist/timelines-C_SBwHNP.js +0 -442
- package/dist/timelines-C_SBwHNP.js.map +0 -1
- package/dist/tone-recipes-CPoExcTE.js.map +0 -1
- package/dist/typography-DTRkE9zL.js.map +0 -1
- package/dist/ui-provider-1D_NSYzO.js.map +0 -1
- package/dist/upload-BO8-CLN6.js.map +0 -1
- package/dist/upload-queue-EOC8g1gf.js.map +0 -1
- package/dist/usage-card-obRaBskq.js.map +0 -1
- package/dist/utils-l5LpDw2z.js.map +0 -1
- package/dist/value-inputs-TAYMX111.js.map +0 -1
- package/dist/workspace-DH0v0KcB.js.map +0 -1
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { s as e, v as t } from "../ui-provider-
|
|
2
|
+
import { s as e, v as t } from "../ui-provider-C_U0Xma4.js";
|
|
3
3
|
import { useStrings as n } from "../lib/strings.js";
|
|
4
|
-
import { t as r } from "../utils-
|
|
5
|
-
import { n as i } from "../buttons-
|
|
6
|
-
import { a,
|
|
4
|
+
import { t as r } from "../utils-BRhFDwuU.js";
|
|
5
|
+
import { n as i } from "../buttons-DPZekJFu.js";
|
|
6
|
+
import { c as a, o } from "../typography-UTnveOEy.js";
|
|
7
7
|
import { t as s } from "../focus-recipes-B653VaLq.js";
|
|
8
|
-
import { r as c, t as l } from "../structure-
|
|
9
|
-
import { i as u } from "../smart-card-
|
|
10
|
-
import { n as d, t as f } from "../feedback-
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import { t as b } from "../
|
|
16
|
-
import { t as x } from "../
|
|
17
|
-
import { t as S } from "../
|
|
18
|
-
import { t as C } from "../
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { t as
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
8
|
+
import { r as c, t as l } from "../structure-BmisBK-3.js";
|
|
9
|
+
import { i as u } from "../smart-card-DiC5aac3.js";
|
|
10
|
+
import { n as d, t as f } from "../feedback-BYIhtitP.js";
|
|
11
|
+
import { t as p } from "../progress-B1VnCT0K.js";
|
|
12
|
+
import { r as m } from "../overlays-DNWmZrJ4.js";
|
|
13
|
+
import { t as h } from "../interaction-recipes-XR9ZpVYL.js";
|
|
14
|
+
import { a as g, i as _, t as v } from "../primitives-BFK08r9M.js";
|
|
15
|
+
import { n as y, t as b } from "../number-DbV1Dija.js";
|
|
16
|
+
import { t as x } from "../badge-HpFqoqSY.js";
|
|
17
|
+
import { t as S } from "../batch-action-bar-DnUJ21NQ.js";
|
|
18
|
+
import { t as C } from "../input-DQdEd0YD.js";
|
|
19
|
+
import { t as w } from "../form-field-CwH9y77i.js";
|
|
20
|
+
import { c as T, l as E } from "../choice-inputs-CNHvARCJ.js";
|
|
21
|
+
import { r as D, t as O } from "../control-group-recipes-DBXmfh2E.js";
|
|
22
|
+
import { t as k } from "../upload.recipes-BbxTqrCT.js";
|
|
23
|
+
import { t as A } from "../metadata-list-8N16ZMW_.js";
|
|
24
|
+
import { a as ee } from "../upload-queue-Boscubn9.js";
|
|
25
|
+
import { s as te } from "../data-display-DT_khPl_.js";
|
|
26
|
+
import { createContext as j, useCallback as M, useContext as ne, useEffect as re, useMemo as N, useRef as ie, useState as P } from "react";
|
|
27
|
+
import { Fragment as F, jsx as I, jsxs as L } from "react/jsx-runtime";
|
|
28
|
+
import { ArrowLeft as ae, ArrowRight as oe, Check as R, File as z, Grid2X2 as se, ImageIcon as ce, ImagePlus as B, Info as le, Layers3 as V, LayoutList as ue, Lock as de, Play as fe, Plus as pe, Search as me, Star as he, Trash2 as ge, UploadCloud as _e, Video as ve, X as ye } from "lucide-react";
|
|
27
29
|
import { createPortal as be } from "react-dom";
|
|
28
30
|
//#region src/components/features/media-library/media-library.strings.ts
|
|
29
31
|
var xe = {
|
|
@@ -68,6 +70,7 @@ var xe = {
|
|
|
68
70
|
cardDetails: "Details for {name}",
|
|
69
71
|
selectMode: "Select",
|
|
70
72
|
selectItem: "Select {name}",
|
|
73
|
+
batchActionsLabel: "Batch actions",
|
|
71
74
|
privateLabel: "Private",
|
|
72
75
|
publicLabel: "Public",
|
|
73
76
|
typeImage: "Image",
|
|
@@ -148,7 +151,7 @@ var xe = {
|
|
|
148
151
|
maxReached: "Maximum reached"
|
|
149
152
|
}
|
|
150
153
|
};
|
|
151
|
-
function
|
|
154
|
+
function H(e, t) {
|
|
152
155
|
return e.replace(/\{(\w+), plural, one \{([^}]*)\} other \{([^}]*)\}\}/g, (e, n, r, i) => Number(t[n]) === 1 ? r : i).replace(/\{(\w+)\}/g, (e, n) => String(t[n] ?? ""));
|
|
153
156
|
}
|
|
154
157
|
//#endregion
|
|
@@ -158,9 +161,9 @@ var Se = {
|
|
|
158
161
|
tags: [],
|
|
159
162
|
public: !0
|
|
160
163
|
}, Ce = [];
|
|
161
|
-
function
|
|
164
|
+
function U(e, t, n) {
|
|
162
165
|
let [r, i] = P(t), a = e ?? r;
|
|
163
|
-
return [a,
|
|
166
|
+
return [a, M((t) => {
|
|
164
167
|
let r = typeof t == "function" ? t(a) : t;
|
|
165
168
|
e === void 0 && i(r), n?.(r);
|
|
166
169
|
}, [
|
|
@@ -193,41 +196,41 @@ function Te(e) {
|
|
|
193
196
|
...e
|
|
194
197
|
};
|
|
195
198
|
}
|
|
196
|
-
function
|
|
197
|
-
return
|
|
199
|
+
function Ee(e) {
|
|
200
|
+
return g(e) ?? "";
|
|
198
201
|
}
|
|
199
|
-
function
|
|
202
|
+
function De(e, t) {
|
|
200
203
|
let n = t.getWidth(e), r = t.getHeight(e);
|
|
201
204
|
return !n || !r ? "" : `${n} x ${r}`;
|
|
202
205
|
}
|
|
203
|
-
function
|
|
206
|
+
function Oe(e, t) {
|
|
204
207
|
let n = t.getUploadedAt(e);
|
|
205
208
|
if (!n) return 0;
|
|
206
209
|
let r = (n instanceof Date ? n : new Date(n)).getTime();
|
|
207
210
|
return Number.isFinite(r) ? r : 0;
|
|
208
211
|
}
|
|
209
|
-
function
|
|
212
|
+
function ke(e) {
|
|
210
213
|
return e.type.startsWith("image/") ? "image" : e.type.startsWith("video/") ? "video" : "file";
|
|
211
214
|
}
|
|
212
|
-
function
|
|
215
|
+
function Ae(e) {
|
|
213
216
|
if (e.type.startsWith("image/") && typeof URL < "u" && typeof URL.createObjectURL == "function") return URL.createObjectURL(e);
|
|
214
217
|
}
|
|
215
|
-
function
|
|
218
|
+
function je(e) {
|
|
216
219
|
e && typeof URL < "u" && typeof URL.revokeObjectURL == "function" && URL.revokeObjectURL(e);
|
|
217
220
|
}
|
|
218
|
-
function
|
|
221
|
+
function Me(e) {
|
|
219
222
|
return Array.isArray(e) ? {
|
|
220
223
|
items: e,
|
|
221
224
|
total: e.length
|
|
222
225
|
} : e;
|
|
223
226
|
}
|
|
224
|
-
function
|
|
227
|
+
function Ne(e, t) {
|
|
225
228
|
return t && typeof e == "object" && e ? {
|
|
226
229
|
...e,
|
|
227
230
|
...t
|
|
228
231
|
} : e;
|
|
229
232
|
}
|
|
230
|
-
function
|
|
233
|
+
function Pe(e, t, n, r, i) {
|
|
231
234
|
let a = n.trim().toLowerCase();
|
|
232
235
|
return e.filter((e) => r !== "all" && t.getType(e) !== r || i !== "all" && t.getCollection(e) !== i ? !1 : !a || [
|
|
233
236
|
t.getName(e),
|
|
@@ -236,186 +239,186 @@ function Ne(e, t, n, r, i) {
|
|
|
236
239
|
...t.getTags(e)
|
|
237
240
|
].filter(Boolean).join(" ").toLowerCase().includes(a));
|
|
238
241
|
}
|
|
239
|
-
function
|
|
242
|
+
function Fe(e, t, n) {
|
|
240
243
|
let r = e.slice();
|
|
241
|
-
return n === "name" ? r.sort((e, n) => t.getName(e).localeCompare(t.getName(n))) : n === "size" ? r.sort((e, n) => (t.getSize(n) ?? 0) - (t.getSize(e) ?? 0)) : n === "usage" ? r.sort((e, n) => (t.getUsageCount(n) ?? 0) - (t.getUsageCount(e) ?? 0)) : r.sort((e, n) =>
|
|
244
|
+
return n === "name" ? r.sort((e, n) => t.getName(e).localeCompare(t.getName(n))) : n === "size" ? r.sort((e, n) => (t.getSize(n) ?? 0) - (t.getSize(e) ?? 0)) : n === "usage" ? r.sort((e, n) => (t.getUsageCount(n) ?? 0) - (t.getUsageCount(e) ?? 0)) : r.sort((e, n) => Oe(n, t) - Oe(e, t)), r;
|
|
242
245
|
}
|
|
243
|
-
function
|
|
244
|
-
let
|
|
246
|
+
function Ie({ items: e = Ce, fetcher: t, accessors: n, selectionMode: r = "multiple", value: i, defaultValue: a = [], onValueChange: o, onItemUpdate: s, onItemDelete: c, onUpload: l, onError: u, tab: d, defaultTab: f = "library", onTabChange: p, view: m, defaultView: h = "grid", onViewChange: g, query: _, defaultQuery: v = "", onQueryChange: y, type: b, defaultType: x = "all", onTypeChange: S, collection: C, defaultCollection: w = "all", onCollectionChange: T, sort: E, defaultSort: D = "newest", onSortChange: O, uploadOptions: k, defaultUploadOptions: A, onUploadOptionsChange: ee, selecting: te, defaultSelecting: j = !1, onSelectingChange: ne } = {}) {
|
|
247
|
+
let F = N(() => Te(n), [n]), [I, L] = U(d, f, p), [ae, oe] = U(m, h, g), [R, z] = U(_, v, y), [se, ce] = U(b, x, S), [B, le] = U(C, w, T), [V, ue] = U(E, D, O), [de, fe] = P(null), [pe, me] = P(() => [...a]), [he, ge] = P([]), [_e, ve] = P(), [ye, be] = P(!1), [xe, H] = P(null), [we, Ee] = P([]), [De, Oe] = P(() => /* @__PURE__ */ new Set()), [Ie, Le] = P({}), [Re, W] = P([]), [ze, Be] = P(!1), Ve = N(() => ({
|
|
245
248
|
...Se,
|
|
246
|
-
...
|
|
247
|
-
tags:
|
|
248
|
-
}), [
|
|
249
|
+
...A,
|
|
250
|
+
tags: A?.tags ?? Se.tags
|
|
251
|
+
}), [A]), [G, K] = U(N(() => k ? {
|
|
249
252
|
...Se,
|
|
250
|
-
...
|
|
251
|
-
tags:
|
|
252
|
-
} : void 0, [
|
|
253
|
-
|
|
254
|
-
|
|
253
|
+
...k,
|
|
254
|
+
tags: k.tags ?? Se.tags
|
|
255
|
+
} : void 0, [k]), Ve, ee), He = i !== void 0, q = N(() => He ? [...i ?? []] : pe, [
|
|
256
|
+
pe,
|
|
257
|
+
He,
|
|
255
258
|
i
|
|
256
|
-
]),
|
|
257
|
-
|
|
259
|
+
]), J = N(() => new Set(q), [q]), Ue = ie(/* @__PURE__ */ new Set()), Y = ie(null), X = ie(/* @__PURE__ */ new Map());
|
|
260
|
+
re(() => {
|
|
258
261
|
if (!t) return;
|
|
259
262
|
let e = new AbortController();
|
|
260
|
-
return
|
|
261
|
-
query:
|
|
262
|
-
type:
|
|
263
|
-
collection:
|
|
264
|
-
sort:
|
|
263
|
+
return be(!0), H(null), t({
|
|
264
|
+
query: R,
|
|
265
|
+
type: se,
|
|
266
|
+
collection: B === "all" ? void 0 : B,
|
|
267
|
+
sort: V,
|
|
265
268
|
signal: e.signal
|
|
266
269
|
}).then((t) => {
|
|
267
270
|
if (e.signal.aborted) return;
|
|
268
|
-
let n =
|
|
269
|
-
|
|
271
|
+
let n = Me(t);
|
|
272
|
+
ge(n.items), ve(n.total);
|
|
270
273
|
}).catch((t) => {
|
|
271
274
|
e.signal.aborted || (H(t), u?.(t));
|
|
272
275
|
}).finally(() => {
|
|
273
|
-
e.signal.aborted ||
|
|
276
|
+
e.signal.aborted || be(!1);
|
|
274
277
|
}), () => e.abort();
|
|
275
278
|
}, [
|
|
276
|
-
|
|
279
|
+
B,
|
|
277
280
|
t,
|
|
278
281
|
u,
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
]),
|
|
283
|
-
let e =
|
|
282
|
+
R,
|
|
283
|
+
V,
|
|
284
|
+
se
|
|
285
|
+
]), re(() => {
|
|
286
|
+
let e = Ue.current;
|
|
284
287
|
return () => {
|
|
285
|
-
|
|
286
|
-
for (let t of e)
|
|
288
|
+
Y.current?.abort();
|
|
289
|
+
for (let t of e) je(t);
|
|
287
290
|
e.clear();
|
|
288
291
|
};
|
|
289
292
|
}, []);
|
|
290
|
-
let
|
|
291
|
-
|
|
292
|
-
|
|
293
|
+
let We = N(() => t ? he : [...we, ...e], [
|
|
294
|
+
we,
|
|
295
|
+
he,
|
|
293
296
|
t,
|
|
294
297
|
e
|
|
295
|
-
]),
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
]),
|
|
301
|
-
let e = t ?
|
|
302
|
-
return t ? e :
|
|
298
|
+
]), Z = N(() => We.filter((e) => !De.has(F.getId(e))).map((e) => Ne(e, Ie[F.getId(e)])), [
|
|
299
|
+
F,
|
|
300
|
+
Ie,
|
|
301
|
+
De,
|
|
302
|
+
We
|
|
303
|
+
]), Ge = N(() => {
|
|
304
|
+
let e = t ? Z : Pe(Z, F, R, se, B);
|
|
305
|
+
return t ? e : Fe(e, F, V);
|
|
303
306
|
}, [
|
|
304
|
-
|
|
305
|
-
|
|
307
|
+
F,
|
|
308
|
+
B,
|
|
306
309
|
t,
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
]),
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
]), Q = !!
|
|
316
|
-
|
|
317
|
-
let t = new Set(e), n =
|
|
310
|
+
Z,
|
|
311
|
+
R,
|
|
312
|
+
V,
|
|
313
|
+
se
|
|
314
|
+
]), Ke = _e ?? Z.length, qe = Ge.length, Je = N(() => Z.filter((e) => J.has(F.getId(e))), [
|
|
315
|
+
F,
|
|
316
|
+
Z,
|
|
317
|
+
J
|
|
318
|
+
]), Q = !!R.trim() || se !== "all" || B !== "all", $ = M((e) => {
|
|
319
|
+
He || me(e);
|
|
320
|
+
let t = new Set(e), n = Z.filter((e) => t.has(F.getId(e)));
|
|
318
321
|
o?.(e, n);
|
|
319
322
|
}, [
|
|
320
|
-
|
|
321
|
-
|
|
323
|
+
F,
|
|
324
|
+
He,
|
|
322
325
|
o,
|
|
323
|
-
|
|
324
|
-
]), Ye =
|
|
325
|
-
let t = new Set(r === "single" ? [] :
|
|
326
|
-
|
|
326
|
+
Z
|
|
327
|
+
]), Ye = M((e) => {
|
|
328
|
+
let t = new Set(r === "single" ? [] : J);
|
|
329
|
+
J.has(e) && r !== "single" ? t.delete(e) : t.add(e), $(Array.from(t));
|
|
327
330
|
}, [
|
|
328
331
|
$,
|
|
329
|
-
|
|
332
|
+
J,
|
|
330
333
|
r
|
|
331
|
-
]), Xe =
|
|
332
|
-
Qe(e), !e &&
|
|
334
|
+
]), Xe = M(() => $([]), [$]), [Ze, Qe] = U(te, j, ne), $e = Ze || q.length > 0, et = M((e) => {
|
|
335
|
+
Qe(e), !e && q.length > 0 && $([]);
|
|
333
336
|
}, [
|
|
334
337
|
$,
|
|
335
|
-
|
|
338
|
+
q.length,
|
|
336
339
|
Qe
|
|
337
|
-
]), tt =
|
|
338
|
-
|
|
340
|
+
]), tt = M(() => {
|
|
341
|
+
z(""), ce("all"), le("all");
|
|
339
342
|
}, [
|
|
340
|
-
de,
|
|
341
343
|
le,
|
|
342
|
-
|
|
343
|
-
|
|
344
|
+
z,
|
|
345
|
+
ce
|
|
346
|
+
]), nt = M((e) => {
|
|
344
347
|
W((t) => [...t, ...e.map((e, t) => {
|
|
345
|
-
let n =
|
|
346
|
-
return n &&
|
|
348
|
+
let n = Ae(e);
|
|
349
|
+
return n && Ue.current.add(n), {
|
|
347
350
|
id: `staged-${Date.now()}-${t}`,
|
|
348
351
|
file: e,
|
|
349
352
|
name: e.name,
|
|
350
353
|
size: e.size,
|
|
351
|
-
type:
|
|
354
|
+
type: ke(e),
|
|
352
355
|
src: n,
|
|
353
356
|
progress: 0,
|
|
354
357
|
status: "staged"
|
|
355
358
|
};
|
|
356
359
|
})]);
|
|
357
|
-
}, []), rt =
|
|
360
|
+
}, []), rt = M((e) => {
|
|
358
361
|
W((t) => {
|
|
359
362
|
let n = t.find((t) => t.id === e);
|
|
360
|
-
return n?.src && (
|
|
363
|
+
return n?.src && (je(n.src), Ue.current.delete(n.src)), t.filter((t) => t.id !== e);
|
|
361
364
|
});
|
|
362
|
-
}, []), it =
|
|
365
|
+
}, []), it = M(() => {
|
|
363
366
|
W((e) => {
|
|
364
|
-
for (let t of e) t.src && (
|
|
367
|
+
for (let t of e) t.src && (je(t.src), Ue.current.delete(t.src));
|
|
365
368
|
return [];
|
|
366
369
|
});
|
|
367
|
-
}, []), at =
|
|
368
|
-
|
|
370
|
+
}, []), at = M((e) => {
|
|
371
|
+
K((t) => ({
|
|
369
372
|
...t,
|
|
370
373
|
...e
|
|
371
374
|
}));
|
|
372
|
-
}, [
|
|
375
|
+
}, [K]), ot = M((e, t) => {
|
|
373
376
|
W((n) => n.map((n) => n.id === e ? {
|
|
374
377
|
...n,
|
|
375
378
|
...t
|
|
376
379
|
} : n));
|
|
377
380
|
}, []);
|
|
378
381
|
return {
|
|
379
|
-
tab:
|
|
380
|
-
setTab:
|
|
381
|
-
view:
|
|
382
|
-
setView:
|
|
383
|
-
query:
|
|
384
|
-
setQuery:
|
|
385
|
-
type:
|
|
386
|
-
setType:
|
|
387
|
-
collection:
|
|
388
|
-
setCollection:
|
|
389
|
-
sort:
|
|
390
|
-
setSort:
|
|
391
|
-
detailId:
|
|
392
|
-
setDetailId:
|
|
393
|
-
items:
|
|
394
|
-
visibleItems:
|
|
395
|
-
selectedIds:
|
|
396
|
-
selectedItems:
|
|
397
|
-
selectedSet:
|
|
382
|
+
tab: I,
|
|
383
|
+
setTab: L,
|
|
384
|
+
view: ae,
|
|
385
|
+
setView: oe,
|
|
386
|
+
query: R,
|
|
387
|
+
setQuery: z,
|
|
388
|
+
type: se,
|
|
389
|
+
setType: ce,
|
|
390
|
+
collection: B,
|
|
391
|
+
setCollection: le,
|
|
392
|
+
sort: V,
|
|
393
|
+
setSort: ue,
|
|
394
|
+
detailId: de,
|
|
395
|
+
setDetailId: fe,
|
|
396
|
+
items: Z,
|
|
397
|
+
visibleItems: Ge,
|
|
398
|
+
selectedIds: q,
|
|
399
|
+
selectedItems: Je,
|
|
400
|
+
selectedSet: J,
|
|
398
401
|
toggleSelection: Ye,
|
|
399
402
|
clearSelection: Xe,
|
|
400
403
|
selecting: $e,
|
|
401
404
|
setSelecting: et,
|
|
402
405
|
clearFilters: tt,
|
|
403
|
-
loading:
|
|
404
|
-
error:
|
|
406
|
+
loading: ye,
|
|
407
|
+
error: xe,
|
|
405
408
|
hasFilters: Q,
|
|
406
|
-
totalCount:
|
|
407
|
-
filteredCount:
|
|
408
|
-
stagedFiles:
|
|
409
|
+
totalCount: Ke,
|
|
410
|
+
filteredCount: qe,
|
|
411
|
+
stagedFiles: Re,
|
|
409
412
|
addFiles: nt,
|
|
410
413
|
removeStagedFile: rt,
|
|
411
414
|
clearStagedFiles: it,
|
|
412
415
|
updateUploadOptions: at,
|
|
413
|
-
uploadOptions:
|
|
416
|
+
uploadOptions: G,
|
|
414
417
|
uploading: ze,
|
|
415
|
-
startUpload:
|
|
416
|
-
if (ze ||
|
|
418
|
+
startUpload: M(async () => {
|
|
419
|
+
if (ze || Re.length === 0) return;
|
|
417
420
|
let e = new AbortController();
|
|
418
|
-
|
|
421
|
+
Y.current?.abort(), Y.current = e, H(null), Be(!0), W((e) => e.map((e) => ({
|
|
419
422
|
...e,
|
|
420
423
|
status: "uploading",
|
|
421
424
|
progress: 0
|
|
@@ -433,18 +436,18 @@ function Fe({ items: e = Ce, fetcher: t, accessors: n, selectionMode: r = "multi
|
|
|
433
436
|
}
|
|
434
437
|
};
|
|
435
438
|
try {
|
|
436
|
-
let n =
|
|
439
|
+
let n = Re.map((e) => e.file), i = await l?.(n, G, t);
|
|
437
440
|
if (e.signal.aborted) return;
|
|
438
441
|
if (W((e) => e.map((e) => ({
|
|
439
442
|
...e,
|
|
440
443
|
status: "done",
|
|
441
444
|
progress: 100
|
|
442
445
|
}))), i?.length) {
|
|
443
|
-
|
|
444
|
-
let e = i.map((e) =>
|
|
445
|
-
$(r === "single" ? e.slice(0, 1) : Array.from(/* @__PURE__ */ new Set([...e, ...
|
|
446
|
+
Ee((e) => [...i, ...e]);
|
|
447
|
+
let e = i.map((e) => F.getId(e));
|
|
448
|
+
$(r === "single" ? e.slice(0, 1) : Array.from(/* @__PURE__ */ new Set([...e, ...q])));
|
|
446
449
|
}
|
|
447
|
-
it(),
|
|
450
|
+
it(), L("library");
|
|
448
451
|
} catch (t) {
|
|
449
452
|
if (e.signal.aborted) return;
|
|
450
453
|
H(t), W((e) => e.map((e) => e.status === "uploading" ? {
|
|
@@ -453,35 +456,35 @@ function Fe({ items: e = Ce, fetcher: t, accessors: n, selectionMode: r = "multi
|
|
|
453
456
|
error: "Upload failed"
|
|
454
457
|
} : e)), u?.(t);
|
|
455
458
|
} finally {
|
|
456
|
-
|
|
459
|
+
Y.current === e && (Y.current = null, Be(!1));
|
|
457
460
|
}
|
|
458
461
|
}, [
|
|
459
|
-
|
|
462
|
+
F,
|
|
460
463
|
$,
|
|
461
464
|
it,
|
|
462
465
|
u,
|
|
463
466
|
l,
|
|
464
|
-
|
|
467
|
+
q,
|
|
465
468
|
r,
|
|
466
|
-
|
|
469
|
+
L,
|
|
467
470
|
ot,
|
|
468
|
-
|
|
469
|
-
|
|
471
|
+
Re,
|
|
472
|
+
G,
|
|
470
473
|
ze
|
|
471
474
|
]),
|
|
472
|
-
cancelUpload:
|
|
473
|
-
|
|
475
|
+
cancelUpload: M(() => {
|
|
476
|
+
Y.current?.abort(), Y.current = null, Be(!1), W((e) => e.map((e) => e.status === "uploading" ? {
|
|
474
477
|
...e,
|
|
475
478
|
status: "staged",
|
|
476
479
|
progress: 0,
|
|
477
480
|
error: void 0
|
|
478
481
|
} : e));
|
|
479
482
|
}, []),
|
|
480
|
-
updateItem:
|
|
481
|
-
let n =
|
|
482
|
-
|
|
483
|
-
let a =
|
|
484
|
-
H(null),
|
|
483
|
+
updateItem: M(async (e, t) => {
|
|
484
|
+
let n = F.getId(e), r = `update:${n}`, i = (X.current.get(r) ?? 0) + 1;
|
|
485
|
+
X.current.set(r, i);
|
|
486
|
+
let a = Ie[n];
|
|
487
|
+
H(null), Le((e) => ({
|
|
485
488
|
...e,
|
|
486
489
|
[n]: {
|
|
487
490
|
...e[n],
|
|
@@ -491,69 +494,69 @@ function Fe({ items: e = Ce, fetcher: t, accessors: n, selectionMode: r = "multi
|
|
|
491
494
|
try {
|
|
492
495
|
return await s?.(e, t), !0;
|
|
493
496
|
} catch (e) {
|
|
494
|
-
return
|
|
497
|
+
return X.current.get(r) === i && Le((e) => {
|
|
495
498
|
let t = { ...e };
|
|
496
499
|
return a ? t[n] = a : delete t[n], t;
|
|
497
500
|
}), H(e), u?.(e), !1;
|
|
498
501
|
}
|
|
499
502
|
}, [
|
|
500
|
-
|
|
501
|
-
|
|
503
|
+
F,
|
|
504
|
+
Ie,
|
|
502
505
|
u,
|
|
503
506
|
s
|
|
504
507
|
]),
|
|
505
|
-
removeItem:
|
|
506
|
-
let t =
|
|
507
|
-
|
|
508
|
-
let i =
|
|
509
|
-
H(null),
|
|
508
|
+
removeItem: M(async (e) => {
|
|
509
|
+
let t = F.getId(e), n = `delete:${t}`, r = (X.current.get(n) ?? 0) + 1;
|
|
510
|
+
X.current.set(n, r);
|
|
511
|
+
let i = De.has(t);
|
|
512
|
+
H(null), Oe((e) => new Set(e).add(t));
|
|
510
513
|
try {
|
|
511
|
-
return await c?.(e),
|
|
514
|
+
return await c?.(e), J.has(t) && $(q.filter((e) => e !== t)), !0;
|
|
512
515
|
} catch (e) {
|
|
513
|
-
return !i &&
|
|
516
|
+
return !i && X.current.get(n) === r && Oe((e) => {
|
|
514
517
|
let n = new Set(e);
|
|
515
518
|
return n.delete(t), n;
|
|
516
519
|
}), H(e), u?.(e), !1;
|
|
517
520
|
}
|
|
518
521
|
}, [
|
|
519
|
-
|
|
522
|
+
F,
|
|
520
523
|
$,
|
|
521
524
|
u,
|
|
522
525
|
c,
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
+
De,
|
|
527
|
+
q,
|
|
528
|
+
J
|
|
526
529
|
]),
|
|
527
|
-
accessors:
|
|
530
|
+
accessors: F
|
|
528
531
|
};
|
|
529
532
|
}
|
|
530
533
|
//#endregion
|
|
531
534
|
//#region src/components/features/media-library/partials/media-library-partials.tsx
|
|
532
|
-
var
|
|
533
|
-
function
|
|
534
|
-
return
|
|
535
|
+
var Le = `${h.nativeButtonReset} absolute inset-0 z-10 block h-full w-full cursor-pointer outline-none ${s.inset}`, Re = "media-library-card--check absolute left-2 top-2 inline-flex size-icon-lg items-center justify-center rounded-radius border border-border bg-background p-0 text-transparent shadow-xs", W = "border-primary bg-primary text-primary-foreground opacity-100";
|
|
536
|
+
function ze(e, t) {
|
|
537
|
+
return I(e === "image" ? ce : e === "video" ? ve : z, { className: t ?? "size-icon" });
|
|
535
538
|
}
|
|
536
|
-
function
|
|
539
|
+
function Be(e, t) {
|
|
537
540
|
return e === "image" ? t.typeImage : e === "video" ? t.typeVideo : t.typeFile;
|
|
538
541
|
}
|
|
539
|
-
function
|
|
540
|
-
return e ?
|
|
542
|
+
function Ve(e, t) {
|
|
543
|
+
return e ? H(t.usedIn, { count: e }) : t.notUsed;
|
|
541
544
|
}
|
|
542
|
-
function
|
|
543
|
-
return /* @__PURE__ */
|
|
545
|
+
function G({ children: e, tint: t, className: n }) {
|
|
546
|
+
return /* @__PURE__ */ I("div", {
|
|
544
547
|
className: r("media-library-preview relative overflow-hidden bg-muted", n),
|
|
545
548
|
style: t ? { background: t } : void 0,
|
|
546
549
|
children: e
|
|
547
550
|
});
|
|
548
551
|
}
|
|
549
|
-
function
|
|
552
|
+
function K({ src: e, alt: t, type: n, className: r, loading: i = "lazy" }) {
|
|
550
553
|
let [a, o] = P(!1);
|
|
551
|
-
return
|
|
554
|
+
return re(() => {
|
|
552
555
|
o(!1);
|
|
553
|
-
}, [e]), !e || a ? /* @__PURE__ */
|
|
556
|
+
}, [e]), !e || a ? /* @__PURE__ */ I("div", {
|
|
554
557
|
className: "media-library-preview--fallback flex size-full items-center justify-center text-muted-foreground",
|
|
555
|
-
children:
|
|
556
|
-
}) : /* @__PURE__ */
|
|
558
|
+
children: ze(n, "size-6")
|
|
559
|
+
}) : /* @__PURE__ */ I("img", {
|
|
557
560
|
src: e,
|
|
558
561
|
alt: t,
|
|
559
562
|
loading: i,
|
|
@@ -561,12 +564,12 @@ function G({ src: e, alt: t, type: n, className: r, loading: i = "lazy" }) {
|
|
|
561
564
|
onError: () => o(!0)
|
|
562
565
|
});
|
|
563
566
|
}
|
|
564
|
-
function
|
|
565
|
-
return /* @__PURE__ */
|
|
567
|
+
function He({ icon: e, title: t, description: n, action: i, className: a }) {
|
|
568
|
+
return /* @__PURE__ */ I(te, {
|
|
566
569
|
title: t,
|
|
567
570
|
description: n ?? !1,
|
|
568
571
|
actions: i,
|
|
569
|
-
media: e ?? /* @__PURE__ */
|
|
572
|
+
media: e ?? /* @__PURE__ */ I(ce, {
|
|
570
573
|
className: "size-icon",
|
|
571
574
|
"aria-hidden": "true"
|
|
572
575
|
}),
|
|
@@ -576,8 +579,8 @@ function Ve({ icon: e, title: t, description: n, action: i, className: a }) {
|
|
|
576
579
|
className: r("media-library-empty-state--component min-h-64 bg-muted/30", a)
|
|
577
580
|
});
|
|
578
581
|
}
|
|
579
|
-
function
|
|
580
|
-
let { defaultScale:
|
|
582
|
+
function q({ query: n, type: o, typeFilters: s, collection: c, sort: u, view: d, collections: f = [], strings: p, onQueryChange: m, onTypeChange: g, onCollectionChange: _, onSortChange: v, onViewChange: y, onClearFilters: b, toolbarEnd: S, selecting: w = !1, onSelectingChange: T }) {
|
|
583
|
+
let { defaultScale: k } = e(), A = t(void 0, k), ee = [
|
|
581
584
|
{
|
|
582
585
|
value: "all",
|
|
583
586
|
label: p.allTypes,
|
|
@@ -586,7 +589,7 @@ function He({ query: n, type: a, typeFilters: s, collection: c, sort: u, view: d
|
|
|
586
589
|
{
|
|
587
590
|
value: "image",
|
|
588
591
|
label: p.images,
|
|
589
|
-
icon:
|
|
592
|
+
icon: ce
|
|
590
593
|
},
|
|
591
594
|
{
|
|
592
595
|
value: "video",
|
|
@@ -596,19 +599,19 @@ function He({ query: n, type: a, typeFilters: s, collection: c, sort: u, view: d
|
|
|
596
599
|
{
|
|
597
600
|
value: "file",
|
|
598
601
|
label: p.files,
|
|
599
|
-
icon:
|
|
602
|
+
icon: z
|
|
600
603
|
}
|
|
601
604
|
].filter((e) => (s ?? [
|
|
602
605
|
"all",
|
|
603
606
|
"image",
|
|
604
607
|
"video"
|
|
605
|
-
]).includes(e.value)),
|
|
608
|
+
]).includes(e.value)), te = [{
|
|
606
609
|
value: "all",
|
|
607
610
|
label: p.allCollections
|
|
608
611
|
}, ...f.map((e) => ({
|
|
609
612
|
value: e.value,
|
|
610
613
|
label: String(e.label)
|
|
611
|
-
}))],
|
|
614
|
+
}))], j = [
|
|
612
615
|
{
|
|
613
616
|
value: "newest",
|
|
614
617
|
label: p.sortNewest
|
|
@@ -625,65 +628,65 @@ function He({ query: n, type: a, typeFilters: s, collection: c, sort: u, view: d
|
|
|
625
628
|
value: "usage",
|
|
626
629
|
label: p.sortUsage
|
|
627
630
|
}
|
|
628
|
-
],
|
|
629
|
-
return /* @__PURE__ */
|
|
631
|
+
], M = n.trim(), ne = M.length > 0, re = ne || o !== "all" || c !== "all";
|
|
632
|
+
return /* @__PURE__ */ L(l, {
|
|
630
633
|
direction: "horizontal",
|
|
631
634
|
wrap: !0,
|
|
632
635
|
align: "start",
|
|
633
636
|
gap: "md",
|
|
634
637
|
className: "media-library-toolbar--component",
|
|
635
638
|
children: [
|
|
636
|
-
/* @__PURE__ */
|
|
639
|
+
/* @__PURE__ */ L(l, {
|
|
637
640
|
gap: "xs",
|
|
638
641
|
className: "media-library-toolbar--search min-w-52 flex-1",
|
|
639
|
-
children: [/* @__PURE__ */
|
|
642
|
+
children: [/* @__PURE__ */ I(C, {
|
|
640
643
|
value: n,
|
|
641
|
-
onChange: (e) =>
|
|
644
|
+
onChange: (e) => m(e.target.value),
|
|
642
645
|
placeholder: p.searchPlaceholder,
|
|
643
646
|
startIcon: me,
|
|
644
647
|
clearable: !0,
|
|
645
|
-
onClear: () =>
|
|
648
|
+
onClear: () => m(""),
|
|
646
649
|
strings: { clear: p.clearSearch },
|
|
647
650
|
className: "bg-background"
|
|
648
|
-
}), !!
|
|
651
|
+
}), !!ne && /* @__PURE__ */ I(l, {
|
|
649
652
|
direction: "horizontal",
|
|
650
653
|
gap: "xs",
|
|
651
654
|
wrap: !1,
|
|
652
655
|
className: "media-library-toolbar--search-value px-space-xs",
|
|
653
|
-
children: /* @__PURE__ */
|
|
656
|
+
children: /* @__PURE__ */ L(x, {
|
|
654
657
|
tone: "secondary",
|
|
655
658
|
className: "max-w-full",
|
|
656
|
-
children: [/* @__PURE__ */
|
|
659
|
+
children: [/* @__PURE__ */ I(a, {
|
|
657
660
|
tag: "span",
|
|
658
661
|
size: "inherit",
|
|
659
662
|
className: "text-current",
|
|
660
663
|
children: p.activeSearchLabel
|
|
661
|
-
}), /* @__PURE__ */
|
|
664
|
+
}), /* @__PURE__ */ I(a, {
|
|
662
665
|
tag: "span",
|
|
663
666
|
size: "inherit",
|
|
664
667
|
weight: "normal",
|
|
665
668
|
className: "min-w-0 truncate text-current",
|
|
666
|
-
children:
|
|
669
|
+
children: M
|
|
667
670
|
})]
|
|
668
671
|
})
|
|
669
672
|
})]
|
|
670
673
|
}),
|
|
671
|
-
/* @__PURE__ */
|
|
672
|
-
className: r("media-library-toolbar--type-toggle",
|
|
674
|
+
/* @__PURE__ */ I("div", {
|
|
675
|
+
className: r("media-library-toolbar--type-toggle", D.frame, O[A]),
|
|
673
676
|
role: "tablist",
|
|
674
677
|
"aria-label": p.typeFilterLabel,
|
|
675
|
-
children:
|
|
676
|
-
let t = e.icon, n =
|
|
677
|
-
return /* @__PURE__ */
|
|
678
|
+
children: ee.map((e) => {
|
|
679
|
+
let t = e.icon, n = o === e.value;
|
|
680
|
+
return /* @__PURE__ */ L(i, {
|
|
678
681
|
type: "button",
|
|
679
682
|
role: "tab",
|
|
680
683
|
"aria-selected": n,
|
|
681
684
|
tone: "secondary",
|
|
682
685
|
buttonStyle: "ghost",
|
|
683
686
|
size: "sm",
|
|
684
|
-
className: r(
|
|
687
|
+
className: r(D.item, "shadow-none", n ? `${h.segmentActive} hover:bg-card` : "text-muted-foreground hover:bg-transparent hover:text-foreground"),
|
|
685
688
|
onClick: () => g(e.value),
|
|
686
|
-
children: [t && /* @__PURE__ */
|
|
689
|
+
children: [t && /* @__PURE__ */ I(t, { className: "size-icon-md" }), /* @__PURE__ */ I(a, {
|
|
687
690
|
tag: "span",
|
|
688
691
|
size: "xs",
|
|
689
692
|
weight: "medium",
|
|
@@ -693,166 +696,167 @@ function He({ query: n, type: a, typeFilters: s, collection: c, sort: u, view: d
|
|
|
693
696
|
}, e.value);
|
|
694
697
|
})
|
|
695
698
|
}),
|
|
696
|
-
/* @__PURE__ */
|
|
699
|
+
/* @__PURE__ */ I("div", {
|
|
697
700
|
className: "min-w-40",
|
|
698
|
-
children: /* @__PURE__ */
|
|
701
|
+
children: /* @__PURE__ */ I(E, {
|
|
699
702
|
value: c,
|
|
700
|
-
options:
|
|
703
|
+
options: te,
|
|
701
704
|
onValueChange: (e) => _(e ?? "all"),
|
|
702
705
|
placeholder: p.collectionFilterLabel,
|
|
703
706
|
"aria-label": p.collectionFilterLabel,
|
|
704
707
|
className: "bg-background"
|
|
705
708
|
})
|
|
706
709
|
}),
|
|
707
|
-
/* @__PURE__ */
|
|
710
|
+
/* @__PURE__ */ I("div", {
|
|
708
711
|
className: "min-w-32",
|
|
709
|
-
children: /* @__PURE__ */
|
|
712
|
+
children: /* @__PURE__ */ I(E, {
|
|
710
713
|
value: u,
|
|
711
|
-
options:
|
|
714
|
+
options: j,
|
|
712
715
|
onValueChange: (e) => v(e ?? "newest"),
|
|
713
716
|
placeholder: p.sortLabel,
|
|
714
717
|
"aria-label": p.sortLabel,
|
|
715
718
|
className: "bg-background"
|
|
716
719
|
})
|
|
717
720
|
}),
|
|
718
|
-
/* @__PURE__ */
|
|
719
|
-
className: r("media-library-toolbar--view-toggle ml-auto",
|
|
720
|
-
children: [/* @__PURE__ */
|
|
721
|
+
/* @__PURE__ */ L("div", {
|
|
722
|
+
className: r("media-library-toolbar--view-toggle ml-auto", D.frame, O[A]),
|
|
723
|
+
children: [/* @__PURE__ */ I(i, {
|
|
721
724
|
type: "button",
|
|
722
725
|
tone: d === "grid" ? "neutral" : "secondary",
|
|
723
726
|
buttonStyle: d === "grid" ? "solid" : "ghost",
|
|
724
727
|
size: "sm",
|
|
725
728
|
iconOnly: !0,
|
|
726
|
-
className: r(
|
|
729
|
+
className: r(D.item, d === "grid" && `${h.segmentActive} hover:bg-card`),
|
|
727
730
|
"aria-label": p.gridView,
|
|
728
731
|
onClick: () => y("grid"),
|
|
729
|
-
children: /* @__PURE__ */
|
|
730
|
-
}), /* @__PURE__ */
|
|
732
|
+
children: /* @__PURE__ */ I(se, { className: "size-icon-md" })
|
|
733
|
+
}), /* @__PURE__ */ I(i, {
|
|
731
734
|
type: "button",
|
|
732
735
|
tone: d === "table" ? "neutral" : "secondary",
|
|
733
736
|
buttonStyle: d === "table" ? "solid" : "ghost",
|
|
734
737
|
size: "sm",
|
|
735
738
|
iconOnly: !0,
|
|
736
|
-
className: r(
|
|
739
|
+
className: r(D.item, d === "table" && `${h.segmentActive} hover:bg-card`),
|
|
737
740
|
"aria-label": p.tableView,
|
|
738
741
|
onClick: () => y("table"),
|
|
739
|
-
children: /* @__PURE__ */
|
|
742
|
+
children: /* @__PURE__ */ I(ue, { className: "size-icon-md" })
|
|
740
743
|
})]
|
|
741
744
|
}),
|
|
742
|
-
!!
|
|
745
|
+
!!re && /* @__PURE__ */ I(i, {
|
|
743
746
|
type: "button",
|
|
744
747
|
tone: "secondary",
|
|
745
748
|
buttonStyle: "ghost",
|
|
746
|
-
onClick:
|
|
749
|
+
onClick: b,
|
|
747
750
|
children: p.clearFilters
|
|
748
751
|
}),
|
|
749
|
-
!!
|
|
752
|
+
!!T && /* @__PURE__ */ I(i, {
|
|
750
753
|
type: "button",
|
|
751
754
|
"aria-pressed": w,
|
|
752
755
|
tone: "secondary",
|
|
753
756
|
buttonStyle: "outline",
|
|
754
|
-
className: r("media-library-toolbar--select", w &&
|
|
755
|
-
onClick: () =>
|
|
757
|
+
className: r("media-library-toolbar--select", w && h.togglePressed),
|
|
758
|
+
onClick: () => T(!w),
|
|
756
759
|
children: p.selectMode
|
|
757
760
|
}),
|
|
758
|
-
|
|
761
|
+
S
|
|
759
762
|
]
|
|
760
763
|
});
|
|
761
764
|
}
|
|
762
|
-
function
|
|
763
|
-
let y = u.getType(e),
|
|
764
|
-
return /* @__PURE__ */
|
|
765
|
+
function J({ item: e, selected: t = !1, density: n = "comfortable", showMeta: o = !0, accessors: u, strings: d, onToggle: f, onDetails: p, onOpen: m, selecting: g = !1, className: v }) {
|
|
766
|
+
let y = u.getType(e), b = u.getName(e), S = u.getSrc(e), C = u.getAlt(e) || b, w = u.getSize(e), T = u.getUsageCount(e), E = u.getPublic(e) === !1, D = u.getDuration(e), O = !!m && !g, k = O ? m : f;
|
|
767
|
+
return /* @__PURE__ */ L("div", {
|
|
765
768
|
"data-selected": t || void 0,
|
|
766
|
-
"data-selecting":
|
|
769
|
+
"data-selecting": g || void 0,
|
|
767
770
|
"data-gallery-density": n,
|
|
768
|
-
className: r("media-library-card--component relative group/card overflow-hidden rounded-radius border border-border bg-card text-left shadow-xs transition-all", `${
|
|
769
|
-
onClick:
|
|
771
|
+
className: r("media-library-card--component relative group/card overflow-hidden rounded-radius border border-border bg-card text-card-foreground text-left shadow-xs transition-all", `${h.tileHover} hover:shadow-sm`, t && "media-library-card--selected border-primary ring-1 ring-primary", v),
|
|
772
|
+
onClick: k,
|
|
770
773
|
children: [
|
|
771
|
-
!!
|
|
774
|
+
!!k && /* @__PURE__ */ I("button", {
|
|
772
775
|
type: "button",
|
|
773
|
-
"aria-label":
|
|
774
|
-
"aria-pressed":
|
|
775
|
-
className: r("media-library-card--select rounded-radius",
|
|
776
|
+
"aria-label": b,
|
|
777
|
+
"aria-pressed": O ? void 0 : t,
|
|
778
|
+
className: r("media-library-card--select rounded-radius", Le),
|
|
776
779
|
onClick: (e) => {
|
|
777
|
-
e.stopPropagation(),
|
|
780
|
+
e.stopPropagation(), k();
|
|
778
781
|
}
|
|
779
782
|
}),
|
|
780
|
-
/* @__PURE__ */
|
|
783
|
+
/* @__PURE__ */ L(G, {
|
|
781
784
|
tint: u.getTint(e),
|
|
782
785
|
className: r(n === "compact" ? "aspect-square" : "aspect-[4/3]"),
|
|
783
786
|
children: [
|
|
784
|
-
/* @__PURE__ */
|
|
787
|
+
/* @__PURE__ */ I(K, {
|
|
785
788
|
src: S,
|
|
786
789
|
alt: C,
|
|
787
790
|
type: y,
|
|
788
791
|
className: "size-full object-cover"
|
|
789
792
|
}),
|
|
790
|
-
|
|
793
|
+
O && f ? /* @__PURE__ */ I("button", {
|
|
791
794
|
type: "button",
|
|
792
|
-
"aria-label":
|
|
795
|
+
"aria-label": H(d.selectItem, { name: b }),
|
|
793
796
|
"aria-pressed": t,
|
|
794
|
-
className: r(
|
|
797
|
+
className: r(Re, `z-10 cursor-pointer opacity-0 transition-opacity group-hover/card:opacity-100 group-focus-within/card:opacity-100 pointer-coarse:opacity-100 ${s.frame}`, t && W),
|
|
795
798
|
onClick: (e) => {
|
|
796
799
|
e.stopPropagation(), f();
|
|
797
800
|
},
|
|
798
|
-
children: /* @__PURE__ */
|
|
799
|
-
}) : /* @__PURE__ */
|
|
800
|
-
className: r(
|
|
801
|
+
children: /* @__PURE__ */ I(R, { className: "size-icon-sm" })
|
|
802
|
+
}) : /* @__PURE__ */ I("span", {
|
|
803
|
+
className: r(Re, "transition-opacity", g ? "opacity-100" : "opacity-0 group-hover/card:opacity-100 group-focus-within/card:opacity-100", t && W),
|
|
801
804
|
"aria-hidden": "true",
|
|
802
|
-
children: /* @__PURE__ */
|
|
805
|
+
children: /* @__PURE__ */ I(R, { className: "size-icon-sm" })
|
|
803
806
|
}),
|
|
804
|
-
!!p && /* @__PURE__ */
|
|
807
|
+
!!p && /* @__PURE__ */ I(i, {
|
|
805
808
|
type: "button",
|
|
806
809
|
tone: "secondary",
|
|
807
810
|
buttonStyle: "solid",
|
|
808
811
|
size: "sm",
|
|
809
812
|
iconOnly: !0,
|
|
810
813
|
className: "media-library-card--details absolute z-10 right-2 top-2 opacity-0 shadow-sm transition-opacity group-hover/card:opacity-100 group-focus-within/card:opacity-100 pointer-coarse:opacity-100",
|
|
811
|
-
"aria-label":
|
|
814
|
+
"aria-label": H(d.cardDetails, { name: b }),
|
|
812
815
|
onClick: (e) => {
|
|
813
816
|
e.stopPropagation(), p();
|
|
814
817
|
},
|
|
815
|
-
children: /* @__PURE__ */
|
|
818
|
+
children: /* @__PURE__ */ I(le, { className: "size-icon-md" })
|
|
816
819
|
}),
|
|
817
|
-
y === "video" && !!D && /* @__PURE__ */
|
|
820
|
+
y === "video" && !!D && /* @__PURE__ */ L(x, {
|
|
818
821
|
tone: "secondary",
|
|
819
822
|
className: "media-library-card--duration absolute bottom-2 left-2 bg-inverse-background text-inverse-foreground",
|
|
820
|
-
children: [/* @__PURE__ */
|
|
823
|
+
children: [/* @__PURE__ */ I(fe, { className: "size-icon-sm fill-current" }), D]
|
|
821
824
|
}),
|
|
822
|
-
E && /* @__PURE__ */
|
|
825
|
+
E && /* @__PURE__ */ I(x, {
|
|
823
826
|
tone: "secondary",
|
|
824
827
|
className: "media-library-card--private absolute bottom-2 right-2 bg-card text-card-foreground",
|
|
825
|
-
children: /* @__PURE__ */
|
|
828
|
+
children: /* @__PURE__ */ I(de, { className: "size-icon-sm" })
|
|
826
829
|
})
|
|
827
830
|
]
|
|
828
831
|
}),
|
|
829
|
-
/* @__PURE__ */
|
|
832
|
+
/* @__PURE__ */ I("div", {
|
|
830
833
|
className: r("media-library-card--body", n === "compact" ? "p-surface-xs" : "p-surface"),
|
|
831
|
-
children: /* @__PURE__ */
|
|
834
|
+
children: /* @__PURE__ */ L(c, {
|
|
832
835
|
columns: 1,
|
|
833
836
|
gap: "xs",
|
|
834
|
-
children: [/* @__PURE__ */
|
|
837
|
+
children: [/* @__PURE__ */ I(a, {
|
|
835
838
|
tag: "div",
|
|
839
|
+
type: "inherit",
|
|
836
840
|
weight: "semibold",
|
|
837
841
|
className: "truncate",
|
|
838
|
-
children:
|
|
839
|
-
}),
|
|
842
|
+
children: b
|
|
843
|
+
}), o && /* @__PURE__ */ L(l, {
|
|
840
844
|
direction: "horizontal",
|
|
841
845
|
align: "center",
|
|
842
846
|
justify: "between",
|
|
843
847
|
gap: "md",
|
|
844
848
|
className: "min-w-0",
|
|
845
|
-
children: [/* @__PURE__ */
|
|
849
|
+
children: [/* @__PURE__ */ I(_, {
|
|
846
850
|
value: w,
|
|
847
851
|
size: "xs",
|
|
848
852
|
className: "truncate",
|
|
849
853
|
emptyLabel: d.unknownSize
|
|
850
|
-
}), !!T && /* @__PURE__ */
|
|
854
|
+
}), !!T && /* @__PURE__ */ L(a, {
|
|
851
855
|
tag: "span",
|
|
852
856
|
size: "xs",
|
|
853
857
|
type: "secondary",
|
|
854
858
|
className: "inline-flex items-center gap-space-xs",
|
|
855
|
-
children: [/* @__PURE__ */
|
|
859
|
+
children: [/* @__PURE__ */ I(V, { className: "size-icon-sm" }), T]
|
|
856
860
|
})]
|
|
857
861
|
})]
|
|
858
862
|
})
|
|
@@ -860,127 +864,128 @@ function Ue({ item: e, selected: t = !1, density: n = "comfortable", showMeta: a
|
|
|
860
864
|
]
|
|
861
865
|
});
|
|
862
866
|
}
|
|
863
|
-
function
|
|
867
|
+
function Ue({ items: e, selectedSet: t, accessors: n, strings: c, onToggle: l, onDetails: u, onOpen: d, selecting: f = !1 }) {
|
|
864
868
|
let p = !!d && !f;
|
|
865
|
-
return /* @__PURE__ */
|
|
869
|
+
return /* @__PURE__ */ L("div", {
|
|
866
870
|
className: "media-library-list--component min-w-180",
|
|
867
|
-
children: [/* @__PURE__ */
|
|
871
|
+
children: [/* @__PURE__ */ L("div", {
|
|
868
872
|
className: "sticky top-0 z-10 grid grid-cols-[32px_42px_minmax(0,1fr)_86px_88px_120px_72px_34px] items-center gap-space-lg border-b border-border bg-background px-row-x py-row-y",
|
|
869
873
|
children: [
|
|
870
|
-
/* @__PURE__ */
|
|
871
|
-
/* @__PURE__ */
|
|
872
|
-
/* @__PURE__ */
|
|
873
|
-
/* @__PURE__ */
|
|
874
|
-
/* @__PURE__ */
|
|
875
|
-
/* @__PURE__ */
|
|
876
|
-
/* @__PURE__ */
|
|
877
|
-
/* @__PURE__ */
|
|
874
|
+
/* @__PURE__ */ I("span", {}),
|
|
875
|
+
/* @__PURE__ */ I("span", {}),
|
|
876
|
+
/* @__PURE__ */ I(o, { children: c.table.name }),
|
|
877
|
+
/* @__PURE__ */ I(o, { children: c.table.type }),
|
|
878
|
+
/* @__PURE__ */ I(o, { children: c.table.size }),
|
|
879
|
+
/* @__PURE__ */ I(o, { children: c.table.collection }),
|
|
880
|
+
/* @__PURE__ */ I(o, { children: c.table.used }),
|
|
881
|
+
/* @__PURE__ */ I("span", {})
|
|
878
882
|
]
|
|
879
883
|
}), e.map((e) => {
|
|
880
|
-
let
|
|
881
|
-
return /* @__PURE__ */
|
|
884
|
+
let o = n.getId(e), f = t.has(o), m = n.getType(e), g = n.getName(e), v = n.getSrc(e), y = n.getPublic(e) === !1;
|
|
885
|
+
return /* @__PURE__ */ L("div", {
|
|
882
886
|
"data-selected": f || void 0,
|
|
883
|
-
className: r("media-library-list--row relative grid grid-cols-[32px_42px_minmax(0,1fr)_86px_88px_120px_72px_34px] items-center gap-space-lg border-b border-border/60 px-row-x py-row-y last:border-b-0", `cursor-pointer rounded-inner transition-colors ${
|
|
884
|
-
onClick: () => p && d ? d(
|
|
887
|
+
className: r("media-library-list--row relative grid grid-cols-[32px_42px_minmax(0,1fr)_86px_88px_120px_72px_34px] items-center gap-space-lg border-b border-border/60 px-row-x py-row-y last:border-b-0", `cursor-pointer rounded-inner transition-colors ${h.rowHover}`, f && h.rowSelected),
|
|
888
|
+
onClick: () => p && d ? d(o) : l(o),
|
|
885
889
|
children: [
|
|
886
|
-
/* @__PURE__ */
|
|
890
|
+
/* @__PURE__ */ I("button", {
|
|
887
891
|
type: "button",
|
|
888
|
-
"aria-label":
|
|
892
|
+
"aria-label": g,
|
|
889
893
|
"aria-pressed": p ? void 0 : f,
|
|
890
|
-
className: r("media-library-list--select rounded-inner",
|
|
894
|
+
className: r("media-library-list--select rounded-inner", Le),
|
|
891
895
|
onClick: (e) => {
|
|
892
|
-
e.stopPropagation(), p && d ? d(
|
|
896
|
+
e.stopPropagation(), p && d ? d(o) : l(o);
|
|
893
897
|
}
|
|
894
898
|
}),
|
|
895
|
-
p ? /* @__PURE__ */
|
|
899
|
+
p ? /* @__PURE__ */ I("button", {
|
|
896
900
|
type: "button",
|
|
897
|
-
"aria-label":
|
|
901
|
+
"aria-label": H(c.selectItem, { name: g }),
|
|
898
902
|
"aria-pressed": f,
|
|
899
903
|
className: r(`relative z-10 inline-flex size-icon-lg cursor-pointer items-center justify-center rounded-radius border border-input bg-background p-0 text-transparent ${s.frame}`, f && "border-primary bg-primary text-primary-foreground"),
|
|
900
904
|
onClick: (e) => {
|
|
901
|
-
e.stopPropagation(), l(
|
|
905
|
+
e.stopPropagation(), l(o);
|
|
902
906
|
},
|
|
903
|
-
children: /* @__PURE__ */
|
|
904
|
-
}) : /* @__PURE__ */
|
|
907
|
+
children: /* @__PURE__ */ I(R, { className: "size-icon-sm" })
|
|
908
|
+
}) : /* @__PURE__ */ I("span", {
|
|
905
909
|
className: r("inline-flex size-icon-lg items-center justify-center rounded-radius border border-border text-transparent", f && "border-primary bg-primary text-primary-foreground"),
|
|
906
910
|
"aria-hidden": "true",
|
|
907
|
-
children: /* @__PURE__ */
|
|
911
|
+
children: /* @__PURE__ */ I(R, { className: "size-icon-sm" })
|
|
908
912
|
}),
|
|
909
|
-
/* @__PURE__ */
|
|
913
|
+
/* @__PURE__ */ I(G, {
|
|
910
914
|
tint: n.getTint(e),
|
|
911
915
|
className: "size-9 rounded-inner",
|
|
912
|
-
children: v ? /* @__PURE__ */
|
|
916
|
+
children: v ? /* @__PURE__ */ I("img", {
|
|
913
917
|
src: v,
|
|
914
918
|
alt: "",
|
|
915
919
|
loading: "lazy",
|
|
916
920
|
className: "size-full object-cover"
|
|
917
|
-
}) : /* @__PURE__ */
|
|
921
|
+
}) : /* @__PURE__ */ I("div", {
|
|
918
922
|
className: "flex size-full items-center justify-center text-muted-foreground",
|
|
919
|
-
children:
|
|
923
|
+
children: ze(m, "size-icon")
|
|
920
924
|
})
|
|
921
925
|
}),
|
|
922
|
-
/* @__PURE__ */
|
|
926
|
+
/* @__PURE__ */ L(a, {
|
|
923
927
|
tag: "div",
|
|
928
|
+
type: "inherit",
|
|
924
929
|
weight: "semibold",
|
|
925
930
|
className: "flex min-w-0 items-center gap-space-xs truncate",
|
|
926
|
-
children: [
|
|
931
|
+
children: [g, y && /* @__PURE__ */ I(de, { className: "size-icon-sm shrink-0 text-muted-foreground" })]
|
|
927
932
|
}),
|
|
928
|
-
/* @__PURE__ */
|
|
933
|
+
/* @__PURE__ */ I(x, {
|
|
929
934
|
tone: "secondary",
|
|
930
|
-
children:
|
|
935
|
+
children: Be(m, c)
|
|
931
936
|
}),
|
|
932
|
-
/* @__PURE__ */
|
|
937
|
+
/* @__PURE__ */ I(_, {
|
|
933
938
|
value: n.getSize(e),
|
|
934
939
|
size: "xs",
|
|
935
940
|
emptyLabel: c.unknownSize
|
|
936
941
|
}),
|
|
937
|
-
/* @__PURE__ */
|
|
942
|
+
/* @__PURE__ */ I(a, {
|
|
938
943
|
size: "xs",
|
|
939
944
|
type: "secondary",
|
|
940
945
|
className: "truncate",
|
|
941
946
|
children: n.getCollection(e) || "—"
|
|
942
947
|
}),
|
|
943
|
-
/* @__PURE__ */
|
|
948
|
+
/* @__PURE__ */ I(a, {
|
|
944
949
|
size: "xs",
|
|
945
950
|
type: "secondary",
|
|
946
951
|
children: n.getUsageCount(e) ? n.getUsageCount(e) : "—"
|
|
947
952
|
}),
|
|
948
|
-
/* @__PURE__ */
|
|
953
|
+
/* @__PURE__ */ I(i, {
|
|
949
954
|
type: "button",
|
|
950
955
|
tone: "secondary",
|
|
951
956
|
buttonStyle: "ghost",
|
|
952
957
|
size: "sm",
|
|
953
958
|
iconOnly: !0,
|
|
954
959
|
className: "relative z-10",
|
|
955
|
-
"aria-label":
|
|
960
|
+
"aria-label": H(c.cardDetails, { name: g }),
|
|
956
961
|
onClick: (e) => {
|
|
957
|
-
e.stopPropagation(), u(
|
|
962
|
+
e.stopPropagation(), u(o);
|
|
958
963
|
},
|
|
959
|
-
children: /* @__PURE__ */
|
|
964
|
+
children: /* @__PURE__ */ I(le, { className: "size-icon-md" })
|
|
960
965
|
})
|
|
961
966
|
]
|
|
962
|
-
},
|
|
967
|
+
}, o);
|
|
963
968
|
})]
|
|
964
969
|
});
|
|
965
970
|
}
|
|
966
|
-
function
|
|
971
|
+
function Y({ item: e, collections: t = [], accessors: n, strings: r, onClose: o, onUpdate: s, onRemove: c, onReplace: u, renderDetail: d }) {
|
|
967
972
|
if (!e) return null;
|
|
968
|
-
let
|
|
973
|
+
let f = n.getName(e), p = n.getType(e), m = n.getSrc(e), h = n.getCollection(e) ?? t[0]?.value ?? "", g = n.getTags(e), y = n.getPublic(e) ?? !0, b = d?.(e, {
|
|
969
974
|
accessors: n,
|
|
970
975
|
update: s,
|
|
971
|
-
remove:
|
|
972
|
-
replace:
|
|
973
|
-
close:
|
|
976
|
+
remove: c,
|
|
977
|
+
replace: u,
|
|
978
|
+
close: o
|
|
974
979
|
});
|
|
975
|
-
return
|
|
976
|
-
className: "media-library-detail-panel--component flex min-h-0 w-full flex-col border-l border-border bg-background @2xl/media-library:w-72",
|
|
977
|
-
children: [/* @__PURE__ */
|
|
980
|
+
return b ? /* @__PURE__ */ I(F, { children: b }) : /* @__PURE__ */ L("aside", {
|
|
981
|
+
className: "media-library-detail-panel--component flex min-h-0 w-full flex-col border-l border-border bg-background text-foreground @2xl/media-library:w-72",
|
|
982
|
+
children: [/* @__PURE__ */ I("div", {
|
|
978
983
|
className: "media-library-detail-panel--header border-b border-border p-surface",
|
|
979
|
-
children: /* @__PURE__ */
|
|
984
|
+
children: /* @__PURE__ */ L(l, {
|
|
980
985
|
direction: "horizontal",
|
|
981
986
|
align: "center",
|
|
982
987
|
gap: "md",
|
|
983
|
-
children: [/* @__PURE__ */
|
|
988
|
+
children: [/* @__PURE__ */ I(i, {
|
|
984
989
|
type: "button",
|
|
985
990
|
tone: "secondary",
|
|
986
991
|
buttonStyle: "ghost",
|
|
@@ -988,86 +993,87 @@ function q({ item: e, collections: t = [], accessors: n, strings: r, onClose: a,
|
|
|
988
993
|
iconOnly: !0,
|
|
989
994
|
"aria-label": r.detail.close,
|
|
990
995
|
"data-media-detail-close": "",
|
|
991
|
-
onClick:
|
|
992
|
-
children: /* @__PURE__ */
|
|
993
|
-
}), /* @__PURE__ */
|
|
996
|
+
onClick: o,
|
|
997
|
+
children: /* @__PURE__ */ I(ae, { className: "size-icon-md" })
|
|
998
|
+
}), /* @__PURE__ */ I(a, {
|
|
994
999
|
weight: "semibold",
|
|
995
1000
|
children: r.detail.title
|
|
996
1001
|
})]
|
|
997
1002
|
})
|
|
998
|
-
}), /* @__PURE__ */
|
|
999
|
-
className: "media-library-detail-panel--body grid min-h-0 gap-space-xl overflow-y-auto p-surface",
|
|
1003
|
+
}), /* @__PURE__ */ L("div", {
|
|
1004
|
+
className: "media-library-detail-panel--body grid min-h-0 auto-rows-max gap-space-xl overflow-y-auto p-surface",
|
|
1000
1005
|
children: [
|
|
1001
|
-
/* @__PURE__ */
|
|
1006
|
+
/* @__PURE__ */ L(G, {
|
|
1002
1007
|
tint: n.getTint(e),
|
|
1003
1008
|
className: "aspect-[4/3] rounded-radius border border-border",
|
|
1004
|
-
children: [/* @__PURE__ */
|
|
1005
|
-
src:
|
|
1006
|
-
alt: n.getAlt(e) ||
|
|
1007
|
-
type:
|
|
1009
|
+
children: [/* @__PURE__ */ I(K, {
|
|
1010
|
+
src: m,
|
|
1011
|
+
alt: n.getAlt(e) || f,
|
|
1012
|
+
type: p,
|
|
1008
1013
|
className: "size-full object-cover"
|
|
1009
|
-
}),
|
|
1014
|
+
}), p === "video" && !!n.getDuration(e) && /* @__PURE__ */ L(x, {
|
|
1010
1015
|
className: "absolute bottom-2 right-2 bg-inverse-background text-inverse-foreground",
|
|
1011
|
-
children: [/* @__PURE__ */
|
|
1016
|
+
children: [/* @__PURE__ */ I(fe, { className: "size-icon-sm fill-current" }), n.getDuration(e)]
|
|
1012
1017
|
})]
|
|
1013
1018
|
}),
|
|
1014
|
-
/* @__PURE__ */
|
|
1019
|
+
/* @__PURE__ */ I(a, {
|
|
1015
1020
|
tag: "div",
|
|
1016
1021
|
weight: "semibold",
|
|
1017
1022
|
className: "break-words",
|
|
1018
|
-
children:
|
|
1023
|
+
children: f
|
|
1019
1024
|
}),
|
|
1020
|
-
/* @__PURE__ */
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1025
|
+
/* @__PURE__ */ I(A, {
|
|
1026
|
+
layout: "rows",
|
|
1027
|
+
valueAlign: "end",
|
|
1028
|
+
density: "compact",
|
|
1024
1029
|
className: "media-library-detail-panel--facts",
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1030
|
+
items: [
|
|
1031
|
+
{
|
|
1032
|
+
id: "type",
|
|
1033
|
+
label: r.detail.type,
|
|
1034
|
+
value: Be(p, r)
|
|
1035
|
+
},
|
|
1036
|
+
{
|
|
1037
|
+
id: "size",
|
|
1038
|
+
label: r.detail.size,
|
|
1039
|
+
value: /* @__PURE__ */ I(_, {
|
|
1040
|
+
value: n.getSize(e),
|
|
1041
|
+
emptyLabel: r.unknownSize
|
|
1042
|
+
})
|
|
1043
|
+
},
|
|
1044
|
+
{
|
|
1045
|
+
id: "dimensions",
|
|
1046
|
+
label: r.detail.dimensions,
|
|
1047
|
+
value: /* @__PURE__ */ I(v, {
|
|
1048
|
+
width: n.getWidth(e),
|
|
1049
|
+
height: n.getHeight(e),
|
|
1050
|
+
emptyLabel: r.unknownSize
|
|
1051
|
+
})
|
|
1052
|
+
},
|
|
1053
|
+
{
|
|
1054
|
+
id: "uploaded",
|
|
1055
|
+
label: r.detail.uploaded,
|
|
1056
|
+
value: String(n.getUploadedAt(e) ?? "—")
|
|
1057
|
+
},
|
|
1058
|
+
{
|
|
1059
|
+
id: "used-in",
|
|
1060
|
+
label: r.detail.usedIn,
|
|
1061
|
+
value: Ve(n.getUsageCount(e), r)
|
|
1062
|
+
}
|
|
1063
|
+
]
|
|
1058
1064
|
}),
|
|
1059
|
-
/* @__PURE__ */
|
|
1065
|
+
/* @__PURE__ */ I(w, {
|
|
1060
1066
|
label: r.detail.altText,
|
|
1061
|
-
children: /* @__PURE__ */
|
|
1067
|
+
children: /* @__PURE__ */ I(C, {
|
|
1062
1068
|
value: n.getAlt(e) ?? "",
|
|
1063
1069
|
placeholder: r.detail.altPlaceholder,
|
|
1064
1070
|
onChange: (e) => s({ alt: e.target.value })
|
|
1065
1071
|
})
|
|
1066
1072
|
}),
|
|
1067
|
-
/* @__PURE__ */
|
|
1073
|
+
/* @__PURE__ */ I(w, {
|
|
1068
1074
|
label: r.detail.collection,
|
|
1069
|
-
children: /* @__PURE__ */
|
|
1070
|
-
value:
|
|
1075
|
+
children: /* @__PURE__ */ I(E, {
|
|
1076
|
+
value: h,
|
|
1071
1077
|
options: t.map((e) => ({
|
|
1072
1078
|
value: e.value,
|
|
1073
1079
|
label: String(e.label)
|
|
@@ -1076,48 +1082,48 @@ function q({ item: e, collections: t = [], accessors: n, strings: r, onClose: a,
|
|
|
1076
1082
|
onValueChange: (e) => s({ collection: e })
|
|
1077
1083
|
})
|
|
1078
1084
|
}),
|
|
1079
|
-
/* @__PURE__ */
|
|
1085
|
+
/* @__PURE__ */ I(w, {
|
|
1080
1086
|
label: r.detail.tags,
|
|
1081
|
-
children: /* @__PURE__ */
|
|
1082
|
-
value:
|
|
1087
|
+
children: /* @__PURE__ */ I(C, {
|
|
1088
|
+
value: g.join(", "),
|
|
1083
1089
|
placeholder: r.detail.tagsPlaceholder,
|
|
1084
1090
|
onChange: (e) => s({ tags: e.target.value.split(",").map((e) => e.trim()).filter(Boolean) })
|
|
1085
1091
|
})
|
|
1086
1092
|
}),
|
|
1087
|
-
/* @__PURE__ */
|
|
1093
|
+
/* @__PURE__ */ I("div", {
|
|
1088
1094
|
className: "media-library-detail-panel--public",
|
|
1089
|
-
children: /* @__PURE__ */
|
|
1095
|
+
children: /* @__PURE__ */ L(l, {
|
|
1090
1096
|
direction: "horizontal",
|
|
1091
1097
|
align: "center",
|
|
1092
1098
|
justify: "between",
|
|
1093
1099
|
gap: "xl",
|
|
1094
|
-
children: [/* @__PURE__ */
|
|
1100
|
+
children: [/* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I(a, {
|
|
1095
1101
|
weight: "semibold",
|
|
1096
1102
|
children: r.detail.public
|
|
1097
|
-
}), /* @__PURE__ */
|
|
1103
|
+
}), /* @__PURE__ */ I(a, {
|
|
1098
1104
|
size: "xs",
|
|
1099
1105
|
type: "secondary",
|
|
1100
|
-
children:
|
|
1101
|
-
})] }), /* @__PURE__ */
|
|
1106
|
+
children: y ? r.detail.publicHint : r.detail.privateHint
|
|
1107
|
+
})] }), /* @__PURE__ */ I(T, {
|
|
1102
1108
|
"aria-label": r.detail.public,
|
|
1103
|
-
checked:
|
|
1109
|
+
checked: y,
|
|
1104
1110
|
onValueChange: (e) => s({ public: e })
|
|
1105
1111
|
})]
|
|
1106
1112
|
})
|
|
1107
1113
|
}),
|
|
1108
|
-
/* @__PURE__ */
|
|
1114
|
+
/* @__PURE__ */ L("div", {
|
|
1109
1115
|
className: "media-library-detail-panel--actions flex flex-wrap gap-space-md",
|
|
1110
|
-
children: [
|
|
1116
|
+
children: [u && /* @__PURE__ */ I(i, {
|
|
1111
1117
|
type: "button",
|
|
1112
1118
|
tone: "secondary",
|
|
1113
1119
|
buttonStyle: "outline",
|
|
1114
|
-
onClick:
|
|
1120
|
+
onClick: u,
|
|
1115
1121
|
children: r.detail.replace
|
|
1116
|
-
}), /* @__PURE__ */
|
|
1122
|
+
}), /* @__PURE__ */ I(i, {
|
|
1117
1123
|
type: "button",
|
|
1118
1124
|
tone: "destructive",
|
|
1119
1125
|
buttonStyle: "ghost",
|
|
1120
|
-
onClick:
|
|
1126
|
+
onClick: c,
|
|
1121
1127
|
children: r.detail.delete
|
|
1122
1128
|
})]
|
|
1123
1129
|
})
|
|
@@ -1125,128 +1131,128 @@ function q({ item: e, collections: t = [], accessors: n, strings: r, onClose: a,
|
|
|
1125
1131
|
})]
|
|
1126
1132
|
});
|
|
1127
1133
|
}
|
|
1128
|
-
function
|
|
1129
|
-
return /* @__PURE__ */
|
|
1134
|
+
function X({ stagedFiles: e, uploadOptions: t, collections: n = [], uploading: r = !1, strings: o, onFiles: s, onRemoveFile: c, onOptionsChange: u, empty: d }) {
|
|
1135
|
+
return /* @__PURE__ */ I("div", {
|
|
1130
1136
|
className: "media-library-upload-panel--component p-surface",
|
|
1131
|
-
children: /* @__PURE__ */
|
|
1137
|
+
children: /* @__PURE__ */ L(l, {
|
|
1132
1138
|
gap: "xl",
|
|
1133
1139
|
children: [
|
|
1134
|
-
/* @__PURE__ */
|
|
1140
|
+
/* @__PURE__ */ I(ee, {
|
|
1135
1141
|
onDrop: s,
|
|
1136
1142
|
accept: "image/*,video/*",
|
|
1137
1143
|
multiple: !0,
|
|
1138
1144
|
size: "md",
|
|
1139
1145
|
strings: {
|
|
1140
|
-
instruction:
|
|
1141
|
-
helper:
|
|
1142
|
-
dragOver:
|
|
1146
|
+
instruction: o.upload.dropTitle,
|
|
1147
|
+
helper: o.upload.dropHint,
|
|
1148
|
+
dragOver: o.upload.dragOver
|
|
1143
1149
|
}
|
|
1144
1150
|
}),
|
|
1145
|
-
e.length > 0 ? /* @__PURE__ */
|
|
1151
|
+
e.length > 0 ? /* @__PURE__ */ I(l, {
|
|
1146
1152
|
gap: "md",
|
|
1147
1153
|
className: "media-library-upload-panel--staged",
|
|
1148
|
-
children: e.map((e) => /* @__PURE__ */
|
|
1149
|
-
className: "media-library-upload-panel--staged-file flex items-center gap-space-lg rounded-radius border border-border bg-card px-row-x py-row-y",
|
|
1154
|
+
children: e.map((e) => /* @__PURE__ */ L("div", {
|
|
1155
|
+
className: "media-library-upload-panel--staged-file flex items-center gap-space-lg rounded-radius border border-border bg-card text-card-foreground px-row-x py-row-y",
|
|
1150
1156
|
children: [
|
|
1151
|
-
/* @__PURE__ */
|
|
1157
|
+
/* @__PURE__ */ I(G, {
|
|
1152
1158
|
className: "size-10 rounded-inner",
|
|
1153
|
-
children: e.src ? /* @__PURE__ */
|
|
1159
|
+
children: e.src ? /* @__PURE__ */ I("img", {
|
|
1154
1160
|
src: e.src,
|
|
1155
1161
|
alt: e.name,
|
|
1156
1162
|
className: "size-full object-cover"
|
|
1157
|
-
}) : /* @__PURE__ */
|
|
1163
|
+
}) : /* @__PURE__ */ I("div", {
|
|
1158
1164
|
className: "flex size-full items-center justify-center text-muted-foreground",
|
|
1159
|
-
children:
|
|
1165
|
+
children: ze(e.type, "size-icon")
|
|
1160
1166
|
})
|
|
1161
1167
|
}),
|
|
1162
|
-
/* @__PURE__ */
|
|
1168
|
+
/* @__PURE__ */ L(l, {
|
|
1169
|
+
gap: "md",
|
|
1163
1170
|
className: "min-w-0 flex-1",
|
|
1164
1171
|
children: [
|
|
1165
|
-
/* @__PURE__ */
|
|
1172
|
+
/* @__PURE__ */ L("div", {
|
|
1166
1173
|
className: "flex items-baseline gap-space-lg",
|
|
1167
|
-
children: [/* @__PURE__ */
|
|
1174
|
+
children: [/* @__PURE__ */ I(a, {
|
|
1175
|
+
type: "inherit",
|
|
1168
1176
|
weight: "semibold",
|
|
1169
1177
|
className: "truncate",
|
|
1170
1178
|
children: e.name
|
|
1171
|
-
}), /* @__PURE__ */
|
|
1179
|
+
}), /* @__PURE__ */ I(_, {
|
|
1172
1180
|
value: e.size,
|
|
1173
1181
|
size: "xs",
|
|
1174
1182
|
className: "ml-auto shrink-0"
|
|
1175
1183
|
})]
|
|
1176
1184
|
}),
|
|
1177
|
-
(e.status === "uploading" || e.status === "done") && /* @__PURE__ */
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
style: { width: `${e.progress}%` }
|
|
1182
|
-
})
|
|
1185
|
+
(e.status === "uploading" || e.status === "done") && /* @__PURE__ */ I(p, {
|
|
1186
|
+
value: e.progress,
|
|
1187
|
+
size: "sm",
|
|
1188
|
+
"aria-label": e.name
|
|
1183
1189
|
}),
|
|
1184
|
-
e.status === "error" && /* @__PURE__ */
|
|
1190
|
+
e.status === "error" && /* @__PURE__ */ I(a, {
|
|
1185
1191
|
type: "error",
|
|
1186
1192
|
children: e.error
|
|
1187
1193
|
})
|
|
1188
1194
|
]
|
|
1189
1195
|
}),
|
|
1190
|
-
e.status === "done" ? /* @__PURE__ */
|
|
1196
|
+
e.status === "done" ? /* @__PURE__ */ I(x, {
|
|
1191
1197
|
tone: "success",
|
|
1192
|
-
children:
|
|
1193
|
-
}) : e.status === "uploading" ? /* @__PURE__ */
|
|
1198
|
+
children: o.upload.done
|
|
1199
|
+
}) : e.status === "uploading" ? /* @__PURE__ */ I(y, {
|
|
1194
1200
|
value: Math.round(e.progress),
|
|
1195
1201
|
scaled: !0,
|
|
1196
1202
|
size: "xs",
|
|
1197
1203
|
type: "secondary"
|
|
1198
|
-
}) : /* @__PURE__ */
|
|
1204
|
+
}) : /* @__PURE__ */ I(i, {
|
|
1199
1205
|
type: "button",
|
|
1200
1206
|
tone: "secondary",
|
|
1201
1207
|
buttonStyle: "ghost",
|
|
1202
1208
|
size: "sm",
|
|
1203
1209
|
iconOnly: !0,
|
|
1204
1210
|
disabled: r,
|
|
1205
|
-
"aria-label":
|
|
1211
|
+
"aria-label": H(o.upload.removeFile, { name: e.name }),
|
|
1206
1212
|
onClick: () => c(e.id),
|
|
1207
|
-
children: /* @__PURE__ */
|
|
1213
|
+
children: /* @__PURE__ */ I(ye, { className: "size-icon-md" })
|
|
1208
1214
|
})
|
|
1209
1215
|
]
|
|
1210
1216
|
}, e.id))
|
|
1211
1217
|
}) : d,
|
|
1212
|
-
/* @__PURE__ */
|
|
1218
|
+
/* @__PURE__ */ L("div", {
|
|
1213
1219
|
className: "media-library-upload-panel--options grid gap-space-lg @2xl/media-library:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto]",
|
|
1214
1220
|
children: [
|
|
1215
|
-
/* @__PURE__ */
|
|
1216
|
-
label:
|
|
1217
|
-
children: /* @__PURE__ */
|
|
1221
|
+
/* @__PURE__ */ I(w, {
|
|
1222
|
+
label: o.upload.collection,
|
|
1223
|
+
children: /* @__PURE__ */ I(E, {
|
|
1218
1224
|
value: t.collection ?? n[0]?.value,
|
|
1219
1225
|
options: n.map((e) => ({
|
|
1220
1226
|
value: e.value,
|
|
1221
1227
|
label: String(e.label)
|
|
1222
1228
|
})),
|
|
1223
|
-
"aria-label":
|
|
1229
|
+
"aria-label": o.upload.collection,
|
|
1224
1230
|
onValueChange: (e) => u({ collection: e })
|
|
1225
1231
|
})
|
|
1226
1232
|
}),
|
|
1227
|
-
/* @__PURE__ */
|
|
1228
|
-
label:
|
|
1229
|
-
children: /* @__PURE__ */
|
|
1233
|
+
/* @__PURE__ */ I(w, {
|
|
1234
|
+
label: o.upload.tags,
|
|
1235
|
+
children: /* @__PURE__ */ I(C, {
|
|
1230
1236
|
value: t.tags.join(", "),
|
|
1231
|
-
placeholder:
|
|
1237
|
+
placeholder: o.upload.tagsPlaceholder,
|
|
1232
1238
|
onChange: (e) => u({ tags: e.target.value.split(",").map((e) => e.trim()).filter(Boolean) })
|
|
1233
1239
|
})
|
|
1234
1240
|
}),
|
|
1235
|
-
/* @__PURE__ */
|
|
1241
|
+
/* @__PURE__ */ L(l, {
|
|
1236
1242
|
direction: "horizontal",
|
|
1237
1243
|
align: "center",
|
|
1238
1244
|
justify: "between",
|
|
1239
1245
|
gap: "xl",
|
|
1240
1246
|
className: "@2xl/media-library:self-end",
|
|
1241
|
-
children: [/* @__PURE__ */
|
|
1247
|
+
children: [/* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I(a, {
|
|
1242
1248
|
weight: "semibold",
|
|
1243
|
-
children:
|
|
1244
|
-
}), /* @__PURE__ */
|
|
1249
|
+
children: o.upload.public
|
|
1250
|
+
}), /* @__PURE__ */ I(a, {
|
|
1245
1251
|
size: "xs",
|
|
1246
1252
|
type: "secondary",
|
|
1247
|
-
children:
|
|
1248
|
-
})] }), /* @__PURE__ */
|
|
1249
|
-
"aria-label":
|
|
1253
|
+
children: o.upload.publicHint
|
|
1254
|
+
})] }), /* @__PURE__ */ I(T, {
|
|
1255
|
+
"aria-label": o.upload.public,
|
|
1250
1256
|
checked: t.public,
|
|
1251
1257
|
onValueChange: (e) => u({ public: e })
|
|
1252
1258
|
})]
|
|
@@ -1257,35 +1263,35 @@ function We({ stagedFiles: e, uploadOptions: t, collections: n = [], uploading:
|
|
|
1257
1263
|
})
|
|
1258
1264
|
});
|
|
1259
1265
|
}
|
|
1260
|
-
function
|
|
1261
|
-
let u = t.length, d =
|
|
1262
|
-
return e === "upload" ? /* @__PURE__ */
|
|
1266
|
+
function We({ tab: e, selectedIds: t, selectionMode: n, stagedFiles: o, strings: s, onClearSelection: c, className: l }) {
|
|
1267
|
+
let u = t.length, d = o.reduce((e, t) => e + t.size, 0), f = o.length, p = r("media-library-footer-summary--component flex min-w-0 items-center gap-space-lg", l);
|
|
1268
|
+
return e === "upload" ? /* @__PURE__ */ I("div", {
|
|
1263
1269
|
className: p,
|
|
1264
1270
|
"aria-live": "polite",
|
|
1265
|
-
children: /* @__PURE__ */
|
|
1271
|
+
children: /* @__PURE__ */ I(a, {
|
|
1266
1272
|
size: "xs",
|
|
1267
1273
|
type: "secondary",
|
|
1268
1274
|
className: "truncate",
|
|
1269
|
-
children: f === 0 ? s.footer.noFiles :
|
|
1275
|
+
children: f === 0 ? s.footer.noFiles : H(s.footer.stagedSummary, {
|
|
1270
1276
|
count: f,
|
|
1271
|
-
size:
|
|
1277
|
+
size: g(d) ?? s.unknownSize
|
|
1272
1278
|
})
|
|
1273
1279
|
})
|
|
1274
|
-
}) : /* @__PURE__ */
|
|
1280
|
+
}) : /* @__PURE__ */ I("div", {
|
|
1275
1281
|
className: p,
|
|
1276
1282
|
"aria-live": "polite",
|
|
1277
|
-
children: u > 0 ? /* @__PURE__ */
|
|
1283
|
+
children: u > 0 ? /* @__PURE__ */ L(F, { children: [/* @__PURE__ */ I(a, {
|
|
1278
1284
|
weight: "semibold",
|
|
1279
1285
|
className: "whitespace-nowrap",
|
|
1280
|
-
children:
|
|
1281
|
-
}), /* @__PURE__ */
|
|
1286
|
+
children: H(s.footer.selectedCount, { count: u })
|
|
1287
|
+
}), /* @__PURE__ */ I(i, {
|
|
1282
1288
|
type: "button",
|
|
1283
1289
|
tone: "secondary",
|
|
1284
1290
|
buttonStyle: "ghost",
|
|
1285
1291
|
size: "sm",
|
|
1286
1292
|
onClick: c,
|
|
1287
1293
|
children: s.footer.clear
|
|
1288
|
-
})] }) : /* @__PURE__ */
|
|
1294
|
+
})] }) : /* @__PURE__ */ I(a, {
|
|
1289
1295
|
size: "xs",
|
|
1290
1296
|
type: "secondary",
|
|
1291
1297
|
className: "truncate",
|
|
@@ -1293,56 +1299,56 @@ function J({ tab: e, selectedIds: t, selectionMode: n, stagedFiles: a, strings:
|
|
|
1293
1299
|
})
|
|
1294
1300
|
});
|
|
1295
1301
|
}
|
|
1296
|
-
function
|
|
1302
|
+
function Z({ tab: e, selectedItems: t, selectedIds: n, stagedFiles: a, uploading: o = !1, strings: s, confirmLabel: c, cancelLabel: l, onCancel: u, onConfirm: d, onUpload: f, onCancelUpload: p, className: m }) {
|
|
1297
1303
|
let h = n.length, g = a.length;
|
|
1298
|
-
return e === "upload" ? /* @__PURE__ */
|
|
1304
|
+
return e === "upload" ? /* @__PURE__ */ L("div", {
|
|
1299
1305
|
className: r("media-library-footer-actions--component flex min-w-0 flex-col-reverse gap-space-md @md/media-library:flex-row @md/media-library:justify-end", m),
|
|
1300
|
-
children: [/* @__PURE__ */
|
|
1306
|
+
children: [/* @__PURE__ */ I(i, {
|
|
1301
1307
|
type: "button",
|
|
1302
1308
|
tone: "secondary",
|
|
1303
1309
|
buttonStyle: "ghost",
|
|
1304
1310
|
disabled: o,
|
|
1305
1311
|
onClick: p,
|
|
1306
1312
|
children: l ?? s.footer.cancel
|
|
1307
|
-
}), /* @__PURE__ */
|
|
1313
|
+
}), /* @__PURE__ */ I(i, {
|
|
1308
1314
|
tone: "primary",
|
|
1309
1315
|
type: "button",
|
|
1310
1316
|
disabled: g === 0 || o,
|
|
1311
1317
|
onClick: f,
|
|
1312
1318
|
loading: o,
|
|
1313
1319
|
strings: { loading: s.footer.uploading },
|
|
1314
|
-
children: g <= 1 ? s.footer.upload :
|
|
1320
|
+
children: g <= 1 ? s.footer.upload : H(s.footer.uploadMany, { count: g })
|
|
1315
1321
|
})]
|
|
1316
|
-
}) : /* @__PURE__ */
|
|
1322
|
+
}) : /* @__PURE__ */ L("div", {
|
|
1317
1323
|
className: r("media-library-footer-actions--component flex min-w-0 flex-col-reverse gap-space-md @md/media-library:flex-row @md/media-library:justify-end", m),
|
|
1318
|
-
children: [/* @__PURE__ */
|
|
1324
|
+
children: [/* @__PURE__ */ I(i, {
|
|
1319
1325
|
type: "button",
|
|
1320
1326
|
tone: "secondary",
|
|
1321
1327
|
buttonStyle: "ghost",
|
|
1322
1328
|
onClick: u,
|
|
1323
1329
|
children: l ?? s.footer.cancel
|
|
1324
|
-
}), /* @__PURE__ */
|
|
1330
|
+
}), /* @__PURE__ */ I(i, {
|
|
1325
1331
|
tone: "primary",
|
|
1326
1332
|
type: "button",
|
|
1327
1333
|
disabled: h === 0,
|
|
1328
1334
|
onClick: d,
|
|
1329
|
-
children: c ?? (h === 0 ? s.footer.confirmEmpty : t.length === 1 ? s.footer.confirmOne :
|
|
1335
|
+
children: c ?? (h === 0 ? s.footer.confirmEmpty : t.length === 1 ? s.footer.confirmOne : H(s.footer.confirmMany, { count: h }))
|
|
1330
1336
|
})]
|
|
1331
1337
|
});
|
|
1332
1338
|
}
|
|
1333
|
-
function
|
|
1334
|
-
return /* @__PURE__ */
|
|
1335
|
-
className: r("media-library-footer--component", h === "section" && "border-t border-border bg-background p-surface", g),
|
|
1336
|
-
children: /* @__PURE__ */
|
|
1339
|
+
function Ge({ tab: e, selectedItems: t, selectedIds: n, selectionMode: i, stagedFiles: a, uploading: o = !1, strings: s, confirmLabel: c, cancelLabel: l, onCancel: u, onConfirm: d, onClearSelection: f, onUpload: p, onCancelUpload: m, chrome: h = "section", className: g }) {
|
|
1340
|
+
return /* @__PURE__ */ I("footer", {
|
|
1341
|
+
className: r("media-library-footer--component", h === "section" && "border-t border-border bg-background text-foreground p-surface", g),
|
|
1342
|
+
children: /* @__PURE__ */ L("div", {
|
|
1337
1343
|
className: "flex min-w-0 flex-col gap-space-lg @md/media-library:flex-row @md/media-library:justify-between",
|
|
1338
|
-
children: [/* @__PURE__ */
|
|
1344
|
+
children: [/* @__PURE__ */ I(We, {
|
|
1339
1345
|
tab: e,
|
|
1340
1346
|
selectedIds: n,
|
|
1341
1347
|
selectionMode: i,
|
|
1342
1348
|
stagedFiles: a,
|
|
1343
1349
|
strings: s,
|
|
1344
1350
|
onClearSelection: f
|
|
1345
|
-
}), /* @__PURE__ */
|
|
1351
|
+
}), /* @__PURE__ */ I(Z, {
|
|
1346
1352
|
tab: e,
|
|
1347
1353
|
selectedItems: t,
|
|
1348
1354
|
selectedIds: n,
|
|
@@ -1361,9 +1367,9 @@ function Ke({ tab: e, selectedItems: t, selectedIds: n, selectionMode: i, staged
|
|
|
1361
1367
|
}
|
|
1362
1368
|
//#endregion
|
|
1363
1369
|
//#region src/components/features/media-library/media-library.tsx
|
|
1364
|
-
var
|
|
1370
|
+
var Ke = j(null);
|
|
1365
1371
|
function qe(e, t, n) {
|
|
1366
|
-
return
|
|
1372
|
+
return N(() => {
|
|
1367
1373
|
if (e) return e;
|
|
1368
1374
|
let r = /* @__PURE__ */ new Set();
|
|
1369
1375
|
for (let e of t) {
|
|
@@ -1380,28 +1386,28 @@ function qe(e, t, n) {
|
|
|
1380
1386
|
t
|
|
1381
1387
|
]);
|
|
1382
1388
|
}
|
|
1383
|
-
function
|
|
1384
|
-
let { defaultScale:
|
|
1385
|
-
items:
|
|
1386
|
-
fetcher:
|
|
1389
|
+
function Je({ title: o, titleSuffix: c, description: p, confirmLabel: m, cancelLabel: g, selectionMode: _ = "multiple", density: v = "comfortable", showMeta: y = !0, allowUpload: C = !0, typeFilters: w, confirmOnSelect: T = !1, onConfirm: E, onCancel: k, onClose: A, bulkActions: ee, strings: te, slots: j, heightClassName: M, className: N, items: P, fetcher: F, accessors: ae, collections: oe, value: R, defaultValue: z, onValueChange: se, onItemUpdate: B, onItemDelete: le, onItemReplace: V, onItemOpen: ue, onUpload: de, onError: fe, selecting: pe, defaultSelecting: me, onSelectingChange: he, tab: ge, defaultTab: ve, onTabChange: ye, view: Se, defaultView: Ce, onViewChange: U, query: we, defaultQuery: Te, onQueryChange: Ee, type: De, defaultType: Oe, onTypeChange: ke, collection: Ae, defaultCollection: je, onCollectionChange: Me, sort: Ne, defaultSort: Pe, onSortChange: Fe, uploadOptions: Le, defaultUploadOptions: Re, onUploadOptionsChange: W, ...ze }) {
|
|
1390
|
+
let { defaultScale: Be } = e(), Ve = t(void 0, Be), G = n(xe, te), K = Ie({
|
|
1391
|
+
items: P,
|
|
1392
|
+
fetcher: F,
|
|
1387
1393
|
accessors: ae,
|
|
1388
1394
|
collections: oe,
|
|
1389
1395
|
selectionMode: _,
|
|
1390
|
-
value:
|
|
1391
|
-
defaultValue:
|
|
1392
|
-
onValueChange:
|
|
1393
|
-
onItemUpdate:
|
|
1394
|
-
onItemDelete:
|
|
1395
|
-
onUpload:
|
|
1396
|
-
onError:
|
|
1397
|
-
tab:
|
|
1398
|
-
defaultTab:
|
|
1399
|
-
onTabChange:
|
|
1400
|
-
view:
|
|
1401
|
-
defaultView:
|
|
1402
|
-
onViewChange:
|
|
1403
|
-
query:
|
|
1404
|
-
defaultQuery:
|
|
1396
|
+
value: R,
|
|
1397
|
+
defaultValue: z,
|
|
1398
|
+
onValueChange: se,
|
|
1399
|
+
onItemUpdate: B,
|
|
1400
|
+
onItemDelete: le,
|
|
1401
|
+
onUpload: de,
|
|
1402
|
+
onError: fe,
|
|
1403
|
+
tab: ge,
|
|
1404
|
+
defaultTab: ve,
|
|
1405
|
+
onTabChange: ye,
|
|
1406
|
+
view: Se,
|
|
1407
|
+
defaultView: Ce,
|
|
1408
|
+
onViewChange: U,
|
|
1409
|
+
query: we,
|
|
1410
|
+
defaultQuery: Te,
|
|
1405
1411
|
onQueryChange: Ee,
|
|
1406
1412
|
type: De,
|
|
1407
1413
|
defaultType: Oe,
|
|
@@ -1411,261 +1417,267 @@ function X({ title: a, titleSuffix: c, description: p, confirmLabel: h, cancelLa
|
|
|
1411
1417
|
onCollectionChange: Me,
|
|
1412
1418
|
sort: Ne,
|
|
1413
1419
|
defaultSort: Pe,
|
|
1414
|
-
onSortChange:
|
|
1420
|
+
onSortChange: Fe,
|
|
1415
1421
|
uploadOptions: Le,
|
|
1416
1422
|
defaultUploadOptions: Re,
|
|
1417
|
-
onUploadOptionsChange:
|
|
1418
|
-
selecting:
|
|
1419
|
-
defaultSelecting:
|
|
1420
|
-
onSelectingChange:
|
|
1421
|
-
}), Je = qe(oe,
|
|
1422
|
-
tab:
|
|
1423
|
-
selectedIds:
|
|
1423
|
+
onUploadOptionsChange: W,
|
|
1424
|
+
selecting: pe,
|
|
1425
|
+
defaultSelecting: me ?? T,
|
|
1426
|
+
onSelectingChange: he
|
|
1427
|
+
}), Je = qe(oe, K.items, K.accessors.getCollection), Q = C ? K.tab : "library", $ = K.detailId ? K.items.find((e) => K.accessors.getId(e) === K.detailId) ?? null : null, Ye = ne(Ke), Xe = !j?.footer, Ze = Ye && Xe ? /* @__PURE__ */ I(We, {
|
|
1428
|
+
tab: Q,
|
|
1429
|
+
selectedIds: K.selectedIds,
|
|
1424
1430
|
selectionMode: _,
|
|
1425
|
-
stagedFiles:
|
|
1431
|
+
stagedFiles: K.stagedFiles,
|
|
1426
1432
|
strings: G,
|
|
1427
|
-
onClearSelection:
|
|
1433
|
+
onClearSelection: K.clearSelection,
|
|
1428
1434
|
className: "media-library-dialog--selection-summary shrink-0 justify-end"
|
|
1429
|
-
}) : null,
|
|
1430
|
-
|
|
1431
|
-
},
|
|
1432
|
-
|
|
1433
|
-
},
|
|
1434
|
-
let t =
|
|
1435
|
-
|
|
1436
|
-
},
|
|
1437
|
-
|
|
1438
|
-
},
|
|
1439
|
-
|
|
1435
|
+
}) : null, Qe = !!(o || c || p || j?.headerStart), $e = !!(C || j?.headerEnd || Ze), et = Qe || $e, tt = () => {
|
|
1436
|
+
E?.(K.selectedItems, K.selectedIds), A?.();
|
|
1437
|
+
}, nt = () => {
|
|
1438
|
+
k?.(), A?.();
|
|
1439
|
+
}, rt = (e) => {
|
|
1440
|
+
let t = K.accessors.getId(e);
|
|
1441
|
+
K.toggleSelection(t), T && (E?.([e], [t]), A?.());
|
|
1442
|
+
}, it = ie(null), at = ie(null), ot = (e) => {
|
|
1443
|
+
at.current = document.activeElement instanceof HTMLElement ? document.activeElement : null, K.setDetailId(e);
|
|
1444
|
+
}, st = (e) => {
|
|
1445
|
+
ue ? ue(e) : ot(K.accessors.getId(e));
|
|
1440
1446
|
};
|
|
1441
|
-
|
|
1442
|
-
if (
|
|
1443
|
-
|
|
1447
|
+
re(() => {
|
|
1448
|
+
if (K.detailId !== null) {
|
|
1449
|
+
at.current && it.current?.querySelector("[data-media-detail-close]")?.focus();
|
|
1444
1450
|
return;
|
|
1445
1451
|
}
|
|
1446
|
-
let e =
|
|
1447
|
-
|
|
1448
|
-
}, [
|
|
1449
|
-
let
|
|
1450
|
-
count:
|
|
1451
|
-
total:
|
|
1452
|
-
query:
|
|
1453
|
-
}) :
|
|
1454
|
-
count:
|
|
1455
|
-
total:
|
|
1456
|
-
}),
|
|
1457
|
-
tab:
|
|
1458
|
-
selectedItems:
|
|
1459
|
-
selectedIds:
|
|
1460
|
-
stagedFiles:
|
|
1461
|
-
uploading:
|
|
1452
|
+
let e = at.current;
|
|
1453
|
+
at.current = null, e?.isConnected && e.focus();
|
|
1454
|
+
}, [K.detailId]);
|
|
1455
|
+
let ct = K.query.trim(), lt = ct.length > 0 ? H(G.countSearch, {
|
|
1456
|
+
count: K.filteredCount,
|
|
1457
|
+
total: K.totalCount,
|
|
1458
|
+
query: ct
|
|
1459
|
+
}) : K.filteredCount === K.totalCount ? H(G.countAll, { count: K.totalCount }) : H(G.countFiltered, {
|
|
1460
|
+
count: K.filteredCount,
|
|
1461
|
+
total: K.totalCount
|
|
1462
|
+
}), ut = !!ee && !(Ye || E && !T), dt = ie(null), ft = Q === "library" ? K.selectedIds.length : 0, pt = j?.footer ?? (ut && Q === "library" ? null : Ye ? /* @__PURE__ */ I(Z, {
|
|
1463
|
+
tab: Q,
|
|
1464
|
+
selectedItems: K.selectedItems,
|
|
1465
|
+
selectedIds: K.selectedIds,
|
|
1466
|
+
stagedFiles: K.stagedFiles,
|
|
1467
|
+
uploading: K.uploading,
|
|
1462
1468
|
strings: G,
|
|
1463
|
-
confirmLabel:
|
|
1469
|
+
confirmLabel: m,
|
|
1464
1470
|
cancelLabel: g,
|
|
1465
|
-
onCancel:
|
|
1466
|
-
onConfirm:
|
|
1467
|
-
onUpload:
|
|
1471
|
+
onCancel: nt,
|
|
1472
|
+
onConfirm: tt,
|
|
1473
|
+
onUpload: K.startUpload,
|
|
1468
1474
|
onCancelUpload: () => {
|
|
1469
|
-
|
|
1475
|
+
K.cancelUpload(), K.clearStagedFiles(), K.setTab("library");
|
|
1470
1476
|
},
|
|
1471
1477
|
className: "ml-auto"
|
|
1472
|
-
}) : /* @__PURE__ */
|
|
1473
|
-
tab:
|
|
1474
|
-
selectedItems:
|
|
1475
|
-
selectedIds:
|
|
1478
|
+
}) : /* @__PURE__ */ I(Ge, {
|
|
1479
|
+
tab: Q,
|
|
1480
|
+
selectedItems: K.selectedItems,
|
|
1481
|
+
selectedIds: K.selectedIds,
|
|
1476
1482
|
selectionMode: _,
|
|
1477
|
-
stagedFiles:
|
|
1478
|
-
uploading:
|
|
1483
|
+
stagedFiles: K.stagedFiles,
|
|
1484
|
+
uploading: K.uploading,
|
|
1479
1485
|
strings: G,
|
|
1480
|
-
confirmLabel:
|
|
1486
|
+
confirmLabel: m,
|
|
1481
1487
|
cancelLabel: g,
|
|
1482
|
-
onCancel:
|
|
1483
|
-
onConfirm:
|
|
1484
|
-
onClearSelection:
|
|
1485
|
-
onUpload:
|
|
1488
|
+
onCancel: nt,
|
|
1489
|
+
onConfirm: tt,
|
|
1490
|
+
onClearSelection: K.clearSelection,
|
|
1491
|
+
onUpload: K.startUpload,
|
|
1486
1492
|
onCancelUpload: () => {
|
|
1487
|
-
|
|
1493
|
+
K.cancelUpload(), K.clearStagedFiles(), K.setTab("library");
|
|
1488
1494
|
}
|
|
1489
1495
|
}));
|
|
1490
|
-
return /* @__PURE__ */
|
|
1491
|
-
ref:
|
|
1492
|
-
className: r("media-library--component @container/media-library flex min-h-0 flex-col overflow-hidden rounded-radius border border-border bg-background", M ?? "h-190 max-h-[calc(100vh-7rem)]",
|
|
1493
|
-
...
|
|
1496
|
+
return /* @__PURE__ */ L("section", {
|
|
1497
|
+
ref: it,
|
|
1498
|
+
className: r("media-library--component @container/media-library box-border flex min-h-0 flex-col overflow-hidden rounded-radius border border-border bg-background text-foreground", M ?? "h-190 max-h-[calc(100vh-7rem)]", N),
|
|
1499
|
+
...ze,
|
|
1494
1500
|
children: [
|
|
1495
|
-
|
|
1501
|
+
et && /* @__PURE__ */ L("header", {
|
|
1496
1502
|
className: "media-library--header flex flex-col gap-space-lg border-b border-border p-surface @2xl/media-library:flex-row @2xl/media-library:items-center @2xl/media-library:justify-between",
|
|
1497
|
-
children: [
|
|
1503
|
+
children: [Qe && /* @__PURE__ */ L(l, {
|
|
1498
1504
|
direction: "horizontal",
|
|
1499
1505
|
align: "start",
|
|
1500
1506
|
gap: "lg",
|
|
1501
1507
|
className: "min-w-0",
|
|
1502
|
-
children: [
|
|
1508
|
+
children: [j?.headerStart, (o || c || p) && /* @__PURE__ */ L(l, {
|
|
1503
1509
|
gap: "normal",
|
|
1504
1510
|
className: "min-w-0",
|
|
1505
|
-
children: [!!(
|
|
1506
|
-
title:
|
|
1511
|
+
children: [!!(o || c) && /* @__PURE__ */ I(u, {
|
|
1512
|
+
title: o,
|
|
1507
1513
|
suffix: c,
|
|
1508
1514
|
className: "media-library--title"
|
|
1509
|
-
}), !!p && /* @__PURE__ */
|
|
1515
|
+
}), !!p && /* @__PURE__ */ I(a, {
|
|
1510
1516
|
type: "secondary",
|
|
1511
1517
|
children: p
|
|
1512
1518
|
})]
|
|
1513
1519
|
})]
|
|
1514
|
-
}),
|
|
1515
|
-
className: r("media-library--header-controls flex min-w-0 flex-wrap items-center gap-space-md",
|
|
1516
|
-
children: [/* @__PURE__ */
|
|
1520
|
+
}), $e && /* @__PURE__ */ L("div", {
|
|
1521
|
+
className: r("media-library--header-controls flex min-w-0 flex-wrap items-center gap-space-md", Ze ? "flex-1 justify-between" : "@2xl/media-library:justify-end"),
|
|
1522
|
+
children: [/* @__PURE__ */ L(l, {
|
|
1517
1523
|
direction: "horizontal",
|
|
1518
1524
|
wrap: !0,
|
|
1519
1525
|
align: "center",
|
|
1520
1526
|
gap: "md",
|
|
1521
1527
|
className: "min-w-0",
|
|
1522
|
-
children: [
|
|
1523
|
-
className: r("media-library--tabs",
|
|
1528
|
+
children: [C && /* @__PURE__ */ L("div", {
|
|
1529
|
+
className: r("media-library--tabs", D.frame, O[Ve]),
|
|
1524
1530
|
role: "tablist",
|
|
1525
|
-
children: [/* @__PURE__ */
|
|
1531
|
+
children: [/* @__PURE__ */ L(i, {
|
|
1526
1532
|
type: "button",
|
|
1527
1533
|
role: "tab",
|
|
1528
|
-
"aria-selected":
|
|
1534
|
+
"aria-selected": Q === "library",
|
|
1529
1535
|
tone: "secondary",
|
|
1530
1536
|
buttonStyle: "ghost",
|
|
1531
1537
|
size: "sm",
|
|
1532
|
-
className: r(
|
|
1533
|
-
onClick: () =>
|
|
1534
|
-
children: [/* @__PURE__ */
|
|
1535
|
-
}), /* @__PURE__ */
|
|
1538
|
+
className: r(D.item, "shadow-none", Q === "library" ? `${h.segmentActive} hover:bg-card` : "text-muted-foreground hover:bg-transparent hover:text-foreground"),
|
|
1539
|
+
onClick: () => K.setTab("library"),
|
|
1540
|
+
children: [/* @__PURE__ */ I(ce, { className: "size-icon-md" }), G.tabs.library]
|
|
1541
|
+
}), /* @__PURE__ */ L(i, {
|
|
1536
1542
|
type: "button",
|
|
1537
1543
|
role: "tab",
|
|
1538
|
-
"aria-selected":
|
|
1544
|
+
"aria-selected": Q === "upload",
|
|
1539
1545
|
tone: "secondary",
|
|
1540
1546
|
buttonStyle: "ghost",
|
|
1541
1547
|
size: "sm",
|
|
1542
|
-
className: r(
|
|
1543
|
-
onClick: () =>
|
|
1548
|
+
className: r(D.item, "shadow-none", Q === "upload" ? `${h.segmentActive} hover:bg-card` : "text-muted-foreground hover:bg-transparent hover:text-foreground"),
|
|
1549
|
+
onClick: () => K.setTab("upload"),
|
|
1544
1550
|
children: [
|
|
1545
|
-
/* @__PURE__ */
|
|
1551
|
+
/* @__PURE__ */ I(_e, { className: "size-icon-md" }),
|
|
1546
1552
|
G.tabs.upload,
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1553
|
+
K.stagedFiles.length > 0 && /* @__PURE__ */ I(x, {
|
|
1554
|
+
size: "sm",
|
|
1555
|
+
tone: "secondary",
|
|
1556
|
+
className: "media-library--staged-count",
|
|
1557
|
+
children: /* @__PURE__ */ I(b, {
|
|
1558
|
+
value: K.stagedFiles.length,
|
|
1559
|
+
size: "inherit",
|
|
1560
|
+
weight: "inherit",
|
|
1561
|
+
type: "inherit",
|
|
1562
|
+
align: "center"
|
|
1563
|
+
})
|
|
1552
1564
|
})
|
|
1553
1565
|
]
|
|
1554
1566
|
})]
|
|
1555
|
-
}),
|
|
1556
|
-
}),
|
|
1567
|
+
}), j?.headerEnd]
|
|
1568
|
+
}), Ze]
|
|
1557
1569
|
})]
|
|
1558
1570
|
}),
|
|
1559
|
-
/* @__PURE__ */
|
|
1571
|
+
/* @__PURE__ */ L("div", {
|
|
1560
1572
|
className: "media-library--body flex min-h-0 flex-1",
|
|
1561
|
-
children: [
|
|
1573
|
+
children: [Q === "upload" ? /* @__PURE__ */ I("div", {
|
|
1562
1574
|
className: "min-w-0 flex-1 overflow-y-auto",
|
|
1563
|
-
children: /* @__PURE__ */
|
|
1564
|
-
stagedFiles:
|
|
1565
|
-
uploadOptions:
|
|
1575
|
+
children: /* @__PURE__ */ I(X, {
|
|
1576
|
+
stagedFiles: K.stagedFiles,
|
|
1577
|
+
uploadOptions: K.uploadOptions,
|
|
1566
1578
|
collections: Je,
|
|
1567
|
-
uploading:
|
|
1579
|
+
uploading: K.uploading,
|
|
1568
1580
|
strings: G,
|
|
1569
|
-
onFiles:
|
|
1570
|
-
onRemoveFile:
|
|
1571
|
-
onOptionsChange:
|
|
1572
|
-
empty:
|
|
1581
|
+
onFiles: K.addFiles,
|
|
1582
|
+
onRemoveFile: K.removeStagedFile,
|
|
1583
|
+
onOptionsChange: K.updateUploadOptions,
|
|
1584
|
+
empty: j?.uploadEmpty
|
|
1573
1585
|
})
|
|
1574
|
-
}) : /* @__PURE__ */
|
|
1575
|
-
className: r("media-library--library min-w-0 flex-1 flex-col",
|
|
1576
|
-
children: [/* @__PURE__ */
|
|
1586
|
+
}) : /* @__PURE__ */ L("div", {
|
|
1587
|
+
className: r("media-library--library min-w-0 flex-1 flex-col", $ ? "hidden @2xl/media-library:flex" : "flex"),
|
|
1588
|
+
children: [/* @__PURE__ */ L(l, {
|
|
1577
1589
|
gap: "md",
|
|
1578
1590
|
className: "media-library--toolbar border-b border-border/60 p-surface",
|
|
1579
|
-
children: [/* @__PURE__ */
|
|
1580
|
-
query:
|
|
1581
|
-
type:
|
|
1582
|
-
typeFilters:
|
|
1583
|
-
collection:
|
|
1584
|
-
sort:
|
|
1585
|
-
view:
|
|
1591
|
+
children: [/* @__PURE__ */ I(q, {
|
|
1592
|
+
query: K.query,
|
|
1593
|
+
type: K.type,
|
|
1594
|
+
typeFilters: w,
|
|
1595
|
+
collection: K.collection,
|
|
1596
|
+
sort: K.sort,
|
|
1597
|
+
view: K.view,
|
|
1586
1598
|
collections: Je,
|
|
1587
1599
|
strings: G,
|
|
1588
|
-
onQueryChange:
|
|
1589
|
-
onTypeChange:
|
|
1590
|
-
onCollectionChange:
|
|
1591
|
-
onSortChange:
|
|
1592
|
-
onViewChange:
|
|
1593
|
-
onClearFilters:
|
|
1594
|
-
toolbarEnd:
|
|
1595
|
-
selecting:
|
|
1596
|
-
onSelectingChange:
|
|
1597
|
-
}), /* @__PURE__ */
|
|
1600
|
+
onQueryChange: K.setQuery,
|
|
1601
|
+
onTypeChange: K.setType,
|
|
1602
|
+
onCollectionChange: K.setCollection,
|
|
1603
|
+
onSortChange: K.setSort,
|
|
1604
|
+
onViewChange: K.setView,
|
|
1605
|
+
onClearFilters: K.clearFilters,
|
|
1606
|
+
toolbarEnd: j?.toolbarEnd,
|
|
1607
|
+
selecting: K.selecting,
|
|
1608
|
+
onSelectingChange: K.setSelecting
|
|
1609
|
+
}), /* @__PURE__ */ I(a, {
|
|
1598
1610
|
size: "xs",
|
|
1599
1611
|
type: "secondary",
|
|
1600
1612
|
"aria-live": "polite",
|
|
1601
|
-
children:
|
|
1613
|
+
children: lt
|
|
1602
1614
|
})]
|
|
1603
|
-
}), /* @__PURE__ */
|
|
1604
|
-
ref:
|
|
1615
|
+
}), /* @__PURE__ */ I("div", {
|
|
1616
|
+
ref: dt,
|
|
1605
1617
|
role: "region",
|
|
1606
1618
|
"aria-label": G.resultsLabel,
|
|
1607
1619
|
tabIndex: 0,
|
|
1608
1620
|
className: `media-library--results min-h-0 flex-1 overflow-y-auto p-surface focus-visible:outline-none ${s.inset}`,
|
|
1609
|
-
children:
|
|
1621
|
+
children: K.loading ? j?.loading ?? /* @__PURE__ */ I(d, {
|
|
1610
1622
|
className: "min-h-64",
|
|
1611
1623
|
label: G.loading
|
|
1612
|
-
}) :
|
|
1624
|
+
}) : K.error ? j?.error ?? /* @__PURE__ */ I(f, {
|
|
1613
1625
|
title: G.errorTitle,
|
|
1614
1626
|
description: G.errorDescription
|
|
1615
|
-
}) :
|
|
1616
|
-
title:
|
|
1617
|
-
description:
|
|
1618
|
-
action:
|
|
1627
|
+
}) : K.visibleItems.length === 0 ? j?.empty ?? /* @__PURE__ */ I(He, {
|
|
1628
|
+
title: K.hasFilters ? G.emptyFilteredTitle : G.emptyLibraryTitle,
|
|
1629
|
+
description: K.hasFilters ? G.emptyFilteredDescription : G.emptyLibraryDescription,
|
|
1630
|
+
action: K.hasFilters ? /* @__PURE__ */ I(i, {
|
|
1619
1631
|
type: "button",
|
|
1620
1632
|
tone: "secondary",
|
|
1621
1633
|
buttonStyle: "outline",
|
|
1622
|
-
onClick:
|
|
1634
|
+
onClick: K.clearFilters,
|
|
1623
1635
|
children: G.clearFilters
|
|
1624
|
-
}) :
|
|
1636
|
+
}) : C ? /* @__PURE__ */ I(i, {
|
|
1625
1637
|
tone: "primary",
|
|
1626
1638
|
type: "button",
|
|
1627
|
-
onClick: () =>
|
|
1639
|
+
onClick: () => K.setTab("upload"),
|
|
1628
1640
|
children: G.uploadMedia
|
|
1629
1641
|
}) : void 0
|
|
1630
|
-
}) :
|
|
1642
|
+
}) : K.view === "table" ? /* @__PURE__ */ I("div", {
|
|
1631
1643
|
className: "overflow-x-auto",
|
|
1632
|
-
children: /* @__PURE__ */
|
|
1633
|
-
items:
|
|
1634
|
-
selectedSet:
|
|
1644
|
+
children: /* @__PURE__ */ I(Ue, {
|
|
1645
|
+
items: K.visibleItems,
|
|
1646
|
+
selectedSet: K.selectedSet,
|
|
1635
1647
|
selectionMode: _,
|
|
1636
|
-
accessors:
|
|
1648
|
+
accessors: K.accessors,
|
|
1637
1649
|
strings: G,
|
|
1638
1650
|
onToggle: (e) => {
|
|
1639
|
-
let t =
|
|
1640
|
-
t &&
|
|
1651
|
+
let t = K.items.find((t) => K.accessors.getId(t) === e);
|
|
1652
|
+
t && rt(t);
|
|
1641
1653
|
},
|
|
1642
|
-
onDetails:
|
|
1643
|
-
selecting:
|
|
1654
|
+
onDetails: ot,
|
|
1655
|
+
selecting: K.selecting,
|
|
1644
1656
|
onOpen: (e) => {
|
|
1645
|
-
let t =
|
|
1646
|
-
t &&
|
|
1657
|
+
let t = K.items.find((t) => K.accessors.getId(t) === e);
|
|
1658
|
+
t && st(t);
|
|
1647
1659
|
}
|
|
1648
1660
|
})
|
|
1649
|
-
}) : /* @__PURE__ */
|
|
1661
|
+
}) : /* @__PURE__ */ I("div", {
|
|
1650
1662
|
className: r("media-library--grid grid min-w-0 gap-space-lg", v === "compact" ? "grid-cols-[repeat(auto-fill,minmax(136px,1fr))]" : "grid-cols-[repeat(auto-fill,minmax(168px,1fr))]"),
|
|
1651
|
-
children:
|
|
1652
|
-
let t =
|
|
1663
|
+
children: K.visibleItems.map((e) => {
|
|
1664
|
+
let t = K.accessors.getId(e), n = {
|
|
1653
1665
|
id: t,
|
|
1654
|
-
selected:
|
|
1666
|
+
selected: K.selectedSet.has(t),
|
|
1655
1667
|
selectionMode: _,
|
|
1656
|
-
selecting:
|
|
1657
|
-
accessors:
|
|
1658
|
-
toggle: () =>
|
|
1659
|
-
openDetails: () =>
|
|
1660
|
-
open: () =>
|
|
1661
|
-
}, r =
|
|
1662
|
-
return r ? /* @__PURE__ */
|
|
1668
|
+
selecting: K.selecting,
|
|
1669
|
+
accessors: K.accessors,
|
|
1670
|
+
toggle: () => rt(e),
|
|
1671
|
+
openDetails: () => ot(t),
|
|
1672
|
+
open: () => st(e)
|
|
1673
|
+
}, r = j?.renderItem?.(e, n);
|
|
1674
|
+
return r ? /* @__PURE__ */ I("div", { children: r }, t) : /* @__PURE__ */ I(J, {
|
|
1663
1675
|
item: e,
|
|
1664
1676
|
selected: n.selected,
|
|
1665
1677
|
density: v,
|
|
1666
|
-
showMeta:
|
|
1678
|
+
showMeta: y,
|
|
1667
1679
|
selectionMode: _,
|
|
1668
|
-
accessors:
|
|
1680
|
+
accessors: K.accessors,
|
|
1669
1681
|
strings: G,
|
|
1670
1682
|
onToggle: n.toggle,
|
|
1671
1683
|
onDetails: n.openDetails,
|
|
@@ -1675,54 +1687,55 @@ function X({ title: a, titleSuffix: c, description: p, confirmLabel: h, cancelLa
|
|
|
1675
1687
|
})
|
|
1676
1688
|
})
|
|
1677
1689
|
})]
|
|
1678
|
-
}),
|
|
1679
|
-
item:
|
|
1690
|
+
}), Q === "library" && /* @__PURE__ */ I(Y, {
|
|
1691
|
+
item: $,
|
|
1680
1692
|
collections: Je,
|
|
1681
|
-
accessors:
|
|
1693
|
+
accessors: K.accessors,
|
|
1682
1694
|
strings: G,
|
|
1683
|
-
onClose: () =>
|
|
1684
|
-
onUpdate: (e) =>
|
|
1685
|
-
onReplace:
|
|
1695
|
+
onClose: () => K.setDetailId(null),
|
|
1696
|
+
onUpdate: (e) => $ ? K.updateItem($, e) : Promise.resolve(!1),
|
|
1697
|
+
onReplace: V && $ ? () => V($) : void 0,
|
|
1686
1698
|
onRemove: async () => {
|
|
1687
|
-
if (
|
|
1688
|
-
let e = await
|
|
1689
|
-
return e &&
|
|
1699
|
+
if (!$) return !1;
|
|
1700
|
+
let e = await K.removeItem($);
|
|
1701
|
+
return e && K.setDetailId(null), e;
|
|
1690
1702
|
},
|
|
1691
|
-
renderDetail:
|
|
1703
|
+
renderDetail: j?.renderDetail
|
|
1692
1704
|
})]
|
|
1693
1705
|
}),
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
selectedCount:
|
|
1697
|
-
totalCount:
|
|
1698
|
-
onClear:
|
|
1699
|
-
returnFocusRef:
|
|
1706
|
+
Ye ? Ye.element ? be(pt, Ye.element) : null : pt,
|
|
1707
|
+
ut && /* @__PURE__ */ I(S, {
|
|
1708
|
+
selectedCount: ft,
|
|
1709
|
+
totalCount: K.totalCount,
|
|
1710
|
+
onClear: K.clearSelection,
|
|
1711
|
+
returnFocusRef: dt,
|
|
1700
1712
|
className: "media-library--bulk-actions",
|
|
1701
1713
|
strings: {
|
|
1702
|
-
|
|
1714
|
+
label: G.batchActionsLabel,
|
|
1715
|
+
summary: (e) => H(G.footer.selectedCount, { count: e }),
|
|
1703
1716
|
clear: G.footer.clear
|
|
1704
1717
|
},
|
|
1705
|
-
children:
|
|
1706
|
-
selectedItems:
|
|
1707
|
-
selectedIds:
|
|
1708
|
-
selectedCount:
|
|
1709
|
-
visibleCount:
|
|
1710
|
-
totalCount:
|
|
1711
|
-
clearSelection:
|
|
1718
|
+
children: ft > 0 && ee?.({
|
|
1719
|
+
selectedItems: K.selectedItems,
|
|
1720
|
+
selectedIds: K.selectedIds,
|
|
1721
|
+
selectedCount: K.selectedIds.length,
|
|
1722
|
+
visibleCount: K.filteredCount,
|
|
1723
|
+
totalCount: K.totalCount,
|
|
1724
|
+
clearSelection: K.clearSelection
|
|
1712
1725
|
})
|
|
1713
1726
|
})
|
|
1714
1727
|
]
|
|
1715
1728
|
});
|
|
1716
1729
|
}
|
|
1717
|
-
function
|
|
1718
|
-
let h = n(xe,
|
|
1730
|
+
function Q({ open: e, onOpenChange: t, trigger: i, dialogTitle: a, dialogDescription: o, onClose: s, className: c, dialogClassName: l, contentClassName: u, closeOnEscape: d = !0, closeOnBackdropClick: f = !0, ...p }) {
|
|
1731
|
+
let h = n(xe, p.strings), [g, _] = P(!1), [v, y] = P(null), b = e !== void 0, x = b ? e : g, S = (e) => {
|
|
1719
1732
|
b || _(e), t?.(e);
|
|
1720
1733
|
}, C = () => {
|
|
1721
1734
|
S(!1), s?.();
|
|
1722
1735
|
};
|
|
1723
|
-
return /* @__PURE__ */
|
|
1736
|
+
return /* @__PURE__ */ I(Ke.Provider, {
|
|
1724
1737
|
value: { element: v },
|
|
1725
|
-
children: /* @__PURE__ */
|
|
1738
|
+
children: /* @__PURE__ */ I(m, {
|
|
1726
1739
|
open: x,
|
|
1727
1740
|
onOpenChange: S,
|
|
1728
1741
|
onClose: s,
|
|
@@ -1732,7 +1745,7 @@ function Je({ open: e, onOpenChange: t, trigger: i, dialogTitle: a, dialogDescri
|
|
|
1732
1745
|
size: "full",
|
|
1733
1746
|
showCancel: !1,
|
|
1734
1747
|
showConfirm: !1,
|
|
1735
|
-
footer: /* @__PURE__ */
|
|
1748
|
+
footer: /* @__PURE__ */ I("div", {
|
|
1736
1749
|
ref: y,
|
|
1737
1750
|
className: "media-library-dialog--footer @container/media-library w-full"
|
|
1738
1751
|
}),
|
|
@@ -1740,58 +1753,58 @@ function Je({ open: e, onOpenChange: t, trigger: i, dialogTitle: a, dialogDescri
|
|
|
1740
1753
|
contentClassName: r("media-library-dialog--body flex min-h-0 flex-col overflow-hidden p-0", u),
|
|
1741
1754
|
closeOnBackdropClick: f,
|
|
1742
1755
|
closeOnEscape: d,
|
|
1743
|
-
children: /* @__PURE__ */
|
|
1744
|
-
...
|
|
1745
|
-
defaultSelecting:
|
|
1756
|
+
children: /* @__PURE__ */ I(Je, {
|
|
1757
|
+
...p,
|
|
1758
|
+
defaultSelecting: p.defaultSelecting ?? !0,
|
|
1746
1759
|
onClose: C,
|
|
1747
1760
|
className: r("media-library-dialog--library rounded-none border-0", c),
|
|
1748
|
-
heightClassName:
|
|
1749
|
-
strings:
|
|
1761
|
+
heightClassName: p.heightClassName ?? "min-h-0 flex-1",
|
|
1762
|
+
strings: p.strings
|
|
1750
1763
|
})
|
|
1751
1764
|
})
|
|
1752
1765
|
});
|
|
1753
1766
|
}
|
|
1754
1767
|
//#endregion
|
|
1755
1768
|
//#region src/components/features/media-library/media-resource-gallery.tsx
|
|
1756
|
-
function
|
|
1769
|
+
function $(e, t, n) {
|
|
1757
1770
|
let r = e.slice(), [i] = r.splice(t, 1);
|
|
1758
1771
|
return i === void 0 || r.splice(n, 0, i), r;
|
|
1759
1772
|
}
|
|
1760
|
-
function
|
|
1761
|
-
let D = n(xe, w), O = Te(t),
|
|
1773
|
+
function Ye({ items: e, accessors: t, title: o, description: s, primaryId: c, onPrimaryChange: u, onRemove: d, onReorder: f, onAdd: p, maxItems: m, layout: g = "field", density: v = "comfortable", readOnly: y = !1, empty: b, action: S, renderItem: C, strings: w, className: T, ...E }) {
|
|
1774
|
+
let D = n(xe, w), O = Te(t), A = e.length, ee = c ?? (A > 0 ? O.getId(e[0]) : void 0), te = !y && !!p && (m === void 0 || A < m), j = te && (g === "field" || A > 0) ? /* @__PURE__ */ I(i, {
|
|
1762
1775
|
type: "button",
|
|
1763
1776
|
tone: "secondary",
|
|
1764
1777
|
buttonStyle: "outline",
|
|
1765
1778
|
icon: pe,
|
|
1766
1779
|
onClick: p,
|
|
1767
1780
|
children: D.gallery.add
|
|
1768
|
-
}) :
|
|
1781
|
+
}) : m !== void 0 && A >= m ? /* @__PURE__ */ I(x, {
|
|
1769
1782
|
tone: "secondary",
|
|
1770
1783
|
children: D.gallery.maxReached
|
|
1771
|
-
}) : null,
|
|
1772
|
-
if (n < 0 || n >=
|
|
1773
|
-
let r =
|
|
1784
|
+
}) : null, M = (t, n) => {
|
|
1785
|
+
if (n < 0 || n >= A || t === n) return;
|
|
1786
|
+
let r = $(e, t, n);
|
|
1774
1787
|
f?.(r.map((e) => O.getId(e)), r);
|
|
1775
|
-
},
|
|
1788
|
+
}, ne = !!(o || s || S || j), re = A === 0 && g !== "field", N = () => !te || g !== "field" ? null : /* @__PURE__ */ L("button", {
|
|
1776
1789
|
type: "button",
|
|
1777
|
-
className: r("media-resource-gallery--add-tile box-border m-0 inline-flex w-full cursor-pointer items-center justify-center p-space-md font-sans rounded-radius border border-dashed border-border bg-background text-muted-foreground shadow-none", `aspect-square ${
|
|
1790
|
+
className: r("media-resource-gallery--add-tile box-border m-0 inline-flex w-full cursor-pointer items-center justify-center p-space-md font-sans rounded-radius border border-dashed border-border bg-background text-muted-foreground shadow-none", `aspect-square ${k.hover}`),
|
|
1778
1791
|
"aria-label": D.gallery.addTile,
|
|
1779
1792
|
onClick: p,
|
|
1780
|
-
children: [/* @__PURE__ */
|
|
1793
|
+
children: [/* @__PURE__ */ I(pe, { className: "size-icon" }), /* @__PURE__ */ I(a, {
|
|
1781
1794
|
tag: "span",
|
|
1782
1795
|
size: "inherit",
|
|
1783
1796
|
className: "sr-only",
|
|
1784
1797
|
children: D.gallery.addTile
|
|
1785
1798
|
})]
|
|
1786
1799
|
});
|
|
1787
|
-
return /* @__PURE__ */
|
|
1788
|
-
className: r("media-resource-gallery--component @container/media-resource-gallery rounded-radius border border-border bg-card shadow-xs", T),
|
|
1789
|
-
"data-layout":
|
|
1800
|
+
return /* @__PURE__ */ L("section", {
|
|
1801
|
+
className: r("media-resource-gallery--component @container/media-resource-gallery rounded-radius border border-border bg-card text-card-foreground shadow-xs", T),
|
|
1802
|
+
"data-layout": g,
|
|
1790
1803
|
"data-gallery-density": v,
|
|
1791
1804
|
...E,
|
|
1792
|
-
children: [
|
|
1805
|
+
children: [ne && /* @__PURE__ */ I("header", {
|
|
1793
1806
|
className: "media-resource-gallery--header p-surface",
|
|
1794
|
-
children: /* @__PURE__ */
|
|
1807
|
+
children: /* @__PURE__ */ L(l, {
|
|
1795
1808
|
direction: {
|
|
1796
1809
|
base: "vertical",
|
|
1797
1810
|
md: "horizontal"
|
|
@@ -1799,83 +1812,84 @@ function Q({ items: e, accessors: t, title: a, description: s, primaryId: c, onP
|
|
|
1799
1812
|
gap: "lg",
|
|
1800
1813
|
align: { md: "start" },
|
|
1801
1814
|
justify: { md: "between" },
|
|
1802
|
-
children: [/* @__PURE__ */
|
|
1815
|
+
children: [/* @__PURE__ */ L(l, {
|
|
1803
1816
|
gap: "normal",
|
|
1804
1817
|
className: "min-w-0",
|
|
1805
|
-
children: [!!
|
|
1818
|
+
children: [!!o && /* @__PURE__ */ I(a, {
|
|
1806
1819
|
tag: "div",
|
|
1820
|
+
type: "inherit",
|
|
1807
1821
|
weight: "semibold",
|
|
1808
|
-
children:
|
|
1809
|
-
}), !!s && /* @__PURE__ */
|
|
1822
|
+
children: o
|
|
1823
|
+
}), !!s && /* @__PURE__ */ I(a, {
|
|
1810
1824
|
type: "secondary",
|
|
1811
1825
|
children: s
|
|
1812
1826
|
})]
|
|
1813
|
-
}), /* @__PURE__ */
|
|
1827
|
+
}), /* @__PURE__ */ I(l, {
|
|
1814
1828
|
direction: "horizontal",
|
|
1815
1829
|
wrap: !0,
|
|
1816
1830
|
align: "center",
|
|
1817
1831
|
gap: "md",
|
|
1818
1832
|
className: "media-resource-gallery--actions",
|
|
1819
|
-
children: S ??
|
|
1833
|
+
children: S ?? j
|
|
1820
1834
|
})]
|
|
1821
1835
|
})
|
|
1822
|
-
}),
|
|
1836
|
+
}), re ? /* @__PURE__ */ I("div", {
|
|
1823
1837
|
className: "media-resource-gallery--empty px-surface pb-surface",
|
|
1824
|
-
children:
|
|
1838
|
+
children: b ?? /* @__PURE__ */ I(He, {
|
|
1825
1839
|
title: D.gallery.emptyTitle,
|
|
1826
1840
|
description: D.gallery.emptyDescription,
|
|
1827
|
-
action:
|
|
1841
|
+
action: te ? /* @__PURE__ */ I(i, {
|
|
1828
1842
|
tone: "primary",
|
|
1829
1843
|
type: "button",
|
|
1830
|
-
icon:
|
|
1844
|
+
icon: B,
|
|
1831
1845
|
onClick: p,
|
|
1832
1846
|
children: D.gallery.add
|
|
1833
1847
|
}) : void 0
|
|
1834
1848
|
})
|
|
1835
|
-
}) : /* @__PURE__ */
|
|
1836
|
-
className: r("grid min-w-0 grid-cols-1",
|
|
1849
|
+
}) : /* @__PURE__ */ L("div", {
|
|
1850
|
+
className: r("grid min-w-0 grid-cols-1", g === "list" ? "gap-space-md" : "gap-space-lg", "media-resource-gallery--items p-surface", ne && "pt-0", g === "list" ? void 0 : g === "field" ? "grid-cols-[repeat(auto-fill,minmax(96px,1fr))] @md/media-resource-gallery:grid-cols-[repeat(auto-fill,minmax(108px,1fr))]" : v === "compact" ? "grid-cols-[repeat(auto-fill,minmax(132px,1fr))]" : "grid-cols-[repeat(auto-fill,minmax(164px,1fr))]"),
|
|
1837
1851
|
children: [e.map((e, t) => {
|
|
1838
|
-
let n = O.getId(e),
|
|
1852
|
+
let n = O.getId(e), o = O.getName(e), s = O.getType(e), c = O.getSrc(e), f = O.getAlt(e) || o, p = n === ee, m = O.getPublic(e) === !1, b = O.getDuration(e), S = t > 0, w = t < A - 1, T = C?.(e, {
|
|
1839
1853
|
id: n,
|
|
1840
1854
|
index: t,
|
|
1841
|
-
total:
|
|
1855
|
+
total: A,
|
|
1842
1856
|
primary: p,
|
|
1843
1857
|
accessors: O,
|
|
1844
1858
|
canMovePrevious: S,
|
|
1845
1859
|
canMoveNext: w,
|
|
1846
1860
|
setPrimary: () => u?.(n, e),
|
|
1847
1861
|
remove: () => d?.(n, e),
|
|
1848
|
-
movePrevious: () =>
|
|
1849
|
-
moveNext: () =>
|
|
1862
|
+
movePrevious: () => M(t, t - 1),
|
|
1863
|
+
moveNext: () => M(t, t + 1)
|
|
1850
1864
|
});
|
|
1851
|
-
return T ? /* @__PURE__ */
|
|
1852
|
-
className: r("media-resource-gallery--item group/gallery relative aspect-square overflow-hidden rounded-radius border border-border bg-background shadow-xs", `transition-colors ${
|
|
1865
|
+
return T ? /* @__PURE__ */ I("div", { children: T }, n) : g === "field" ? /* @__PURE__ */ L("div", {
|
|
1866
|
+
className: r("media-resource-gallery--item group/gallery relative aspect-square overflow-hidden rounded-radius border border-border bg-background text-foreground shadow-xs", `transition-colors ${h.tileHover}`, p && "col-span-2 row-span-2 min-h-52"),
|
|
1853
1867
|
"data-primary": p || void 0,
|
|
1854
1868
|
children: [
|
|
1855
|
-
c ? /* @__PURE__ */
|
|
1869
|
+
c ? /* @__PURE__ */ I("img", {
|
|
1856
1870
|
src: c,
|
|
1857
1871
|
alt: f,
|
|
1858
1872
|
loading: "lazy",
|
|
1859
1873
|
className: "size-full object-cover"
|
|
1860
|
-
}) : /* @__PURE__ */
|
|
1874
|
+
}) : /* @__PURE__ */ I("div", {
|
|
1861
1875
|
className: "flex size-full items-center justify-center bg-muted text-muted-foreground",
|
|
1862
|
-
children: /* @__PURE__ */
|
|
1876
|
+
children: /* @__PURE__ */ I(z, { className: p ? "size-7" : "size-icon-lg" })
|
|
1863
1877
|
}),
|
|
1864
|
-
p && /* @__PURE__ */
|
|
1878
|
+
p && /* @__PURE__ */ I(x, {
|
|
1865
1879
|
tone: "secondary",
|
|
1866
1880
|
className: "absolute left-2 top-2 bg-background shadow-xs",
|
|
1867
1881
|
children: D.gallery.cover
|
|
1868
1882
|
}),
|
|
1869
|
-
s === "video" && !!
|
|
1883
|
+
s === "video" && !!b && /* @__PURE__ */ L(x, {
|
|
1870
1884
|
tone: "secondary",
|
|
1871
1885
|
className: "absolute bottom-2 left-2 bg-foreground text-background",
|
|
1872
|
-
children: [/* @__PURE__ */
|
|
1886
|
+
children: [/* @__PURE__ */ I(fe, { className: "size-icon-sm fill-current" }), b]
|
|
1873
1887
|
}),
|
|
1874
|
-
|
|
1888
|
+
m && /* @__PURE__ */ I("span", {
|
|
1875
1889
|
className: "absolute bottom-2 right-2 inline-flex size-6 items-center justify-center rounded-full border border-border bg-background text-muted-foreground shadow-xs",
|
|
1876
|
-
children: /* @__PURE__ */
|
|
1890
|
+
children: /* @__PURE__ */ I(de, { className: "size-icon-sm" })
|
|
1877
1891
|
}),
|
|
1878
|
-
!y && /* @__PURE__ */
|
|
1892
|
+
!y && /* @__PURE__ */ I(i, {
|
|
1879
1893
|
type: "button",
|
|
1880
1894
|
tone: "secondary",
|
|
1881
1895
|
buttonStyle: "solid",
|
|
@@ -1884,56 +1898,56 @@ function Q({ items: e, accessors: t, title: a, description: s, primaryId: c, onP
|
|
|
1884
1898
|
className: "absolute right-2 top-2 opacity-0 shadow-sm transition-opacity group-hover/gallery:opacity-100 group-focus-within/gallery:opacity-100",
|
|
1885
1899
|
"aria-label": D.gallery.remove,
|
|
1886
1900
|
onClick: () => d?.(n, e),
|
|
1887
|
-
children: /* @__PURE__ */
|
|
1901
|
+
children: /* @__PURE__ */ I(ye, { className: "size-icon-md" })
|
|
1888
1902
|
})
|
|
1889
1903
|
]
|
|
1890
|
-
}, n) :
|
|
1904
|
+
}, n) : g === "list" ? /* @__PURE__ */ L(l, {
|
|
1891
1905
|
direction: "horizontal",
|
|
1892
1906
|
wrap: !0,
|
|
1893
1907
|
align: "center",
|
|
1894
1908
|
gap: "lg",
|
|
1895
|
-
className: r("media-resource-gallery--item min-w-0 rounded-radius border border-border bg-background px-row-x", v === "compact" ? "py-row-y-sm" : "py-row-y"),
|
|
1909
|
+
className: r("media-resource-gallery--item min-w-0 rounded-radius border border-border bg-background text-foreground px-row-x", v === "compact" ? "py-row-y-sm" : "py-row-y"),
|
|
1896
1910
|
"data-primary": p || void 0,
|
|
1897
1911
|
children: [
|
|
1898
|
-
/* @__PURE__ */
|
|
1912
|
+
/* @__PURE__ */ I("div", {
|
|
1899
1913
|
className: "relative size-12 shrink-0 overflow-hidden rounded-inner bg-muted",
|
|
1900
|
-
children: c ? /* @__PURE__ */
|
|
1914
|
+
children: c ? /* @__PURE__ */ I("img", {
|
|
1901
1915
|
src: c,
|
|
1902
1916
|
alt: f,
|
|
1903
1917
|
loading: "lazy",
|
|
1904
1918
|
className: "size-full object-cover"
|
|
1905
|
-
}) : /* @__PURE__ */
|
|
1919
|
+
}) : /* @__PURE__ */ I("div", {
|
|
1906
1920
|
className: "flex size-full items-center justify-center text-muted-foreground",
|
|
1907
|
-
children: /* @__PURE__ */
|
|
1921
|
+
children: /* @__PURE__ */ I(z, { className: "size-icon" })
|
|
1908
1922
|
})
|
|
1909
1923
|
}),
|
|
1910
|
-
/* @__PURE__ */
|
|
1924
|
+
/* @__PURE__ */ L("div", {
|
|
1911
1925
|
className: "min-w-0 flex-1",
|
|
1912
|
-
children: [/* @__PURE__ */
|
|
1926
|
+
children: [/* @__PURE__ */ L(l, {
|
|
1913
1927
|
direction: "horizontal",
|
|
1914
1928
|
wrap: !0,
|
|
1915
1929
|
align: "center",
|
|
1916
1930
|
gap: "md",
|
|
1917
1931
|
className: "min-w-0",
|
|
1918
|
-
children: [/* @__PURE__ */
|
|
1932
|
+
children: [/* @__PURE__ */ I(a, {
|
|
1919
1933
|
tag: "div",
|
|
1920
1934
|
weight: "semibold",
|
|
1921
1935
|
className: "min-w-0 break-all",
|
|
1922
|
-
children:
|
|
1923
|
-
}), p && /* @__PURE__ */
|
|
1936
|
+
children: o
|
|
1937
|
+
}), p && /* @__PURE__ */ I(x, {
|
|
1924
1938
|
tone: "secondary",
|
|
1925
1939
|
children: D.gallery.primary
|
|
1926
1940
|
})]
|
|
1927
|
-
}), /* @__PURE__ */
|
|
1941
|
+
}), /* @__PURE__ */ L(a, {
|
|
1928
1942
|
size: "xs",
|
|
1929
1943
|
type: "secondary",
|
|
1930
1944
|
children: [
|
|
1931
|
-
|
|
1945
|
+
H(D.gallery.itemPosition, {
|
|
1932
1946
|
index: t + 1,
|
|
1933
|
-
total:
|
|
1947
|
+
total: A
|
|
1934
1948
|
}),
|
|
1935
1949
|
" · ",
|
|
1936
|
-
/* @__PURE__ */
|
|
1950
|
+
/* @__PURE__ */ I(_, {
|
|
1937
1951
|
value: O.getSize(e),
|
|
1938
1952
|
size: "xs",
|
|
1939
1953
|
align: "left",
|
|
@@ -1942,10 +1956,10 @@ function Q({ items: e, accessors: t, title: a, description: s, primaryId: c, onP
|
|
|
1942
1956
|
]
|
|
1943
1957
|
})]
|
|
1944
1958
|
}),
|
|
1945
|
-
!y && /* @__PURE__ */
|
|
1959
|
+
!y && /* @__PURE__ */ L("div", {
|
|
1946
1960
|
className: "media-resource-gallery--item-actions flex basis-full flex-wrap items-center justify-end gap-space-xs @sm/media-resource-gallery:basis-auto",
|
|
1947
1961
|
children: [
|
|
1948
|
-
/* @__PURE__ */
|
|
1962
|
+
/* @__PURE__ */ I(i, {
|
|
1949
1963
|
type: "button",
|
|
1950
1964
|
tone: "secondary",
|
|
1951
1965
|
buttonStyle: "ghost",
|
|
@@ -1954,9 +1968,9 @@ function Q({ items: e, accessors: t, title: a, description: s, primaryId: c, onP
|
|
|
1954
1968
|
disabled: p,
|
|
1955
1969
|
"aria-label": D.gallery.setPrimary,
|
|
1956
1970
|
onClick: () => u?.(n, e),
|
|
1957
|
-
children: /* @__PURE__ */
|
|
1971
|
+
children: /* @__PURE__ */ I(he, { className: "size-icon-md" })
|
|
1958
1972
|
}),
|
|
1959
|
-
/* @__PURE__ */
|
|
1973
|
+
/* @__PURE__ */ I(i, {
|
|
1960
1974
|
type: "button",
|
|
1961
1975
|
tone: "secondary",
|
|
1962
1976
|
buttonStyle: "ghost",
|
|
@@ -1964,10 +1978,10 @@ function Q({ items: e, accessors: t, title: a, description: s, primaryId: c, onP
|
|
|
1964
1978
|
iconOnly: !0,
|
|
1965
1979
|
disabled: !S,
|
|
1966
1980
|
"aria-label": D.gallery.movePrevious,
|
|
1967
|
-
onClick: () =>
|
|
1968
|
-
children: /* @__PURE__ */
|
|
1981
|
+
onClick: () => M(t, t - 1),
|
|
1982
|
+
children: /* @__PURE__ */ I(ae, { className: "size-icon-md" })
|
|
1969
1983
|
}),
|
|
1970
|
-
/* @__PURE__ */
|
|
1984
|
+
/* @__PURE__ */ I(i, {
|
|
1971
1985
|
type: "button",
|
|
1972
1986
|
tone: "secondary",
|
|
1973
1987
|
buttonStyle: "ghost",
|
|
@@ -1975,10 +1989,10 @@ function Q({ items: e, accessors: t, title: a, description: s, primaryId: c, onP
|
|
|
1975
1989
|
iconOnly: !0,
|
|
1976
1990
|
disabled: !w,
|
|
1977
1991
|
"aria-label": D.gallery.moveNext,
|
|
1978
|
-
onClick: () =>
|
|
1979
|
-
children: /* @__PURE__ */
|
|
1992
|
+
onClick: () => M(t, t + 1),
|
|
1993
|
+
children: /* @__PURE__ */ I(oe, { className: "size-icon-md" })
|
|
1980
1994
|
}),
|
|
1981
|
-
/* @__PURE__ */
|
|
1995
|
+
/* @__PURE__ */ I(i, {
|
|
1982
1996
|
type: "button",
|
|
1983
1997
|
tone: "destructive",
|
|
1984
1998
|
buttonStyle: "ghost",
|
|
@@ -1986,60 +2000,60 @@ function Q({ items: e, accessors: t, title: a, description: s, primaryId: c, onP
|
|
|
1986
2000
|
iconOnly: !0,
|
|
1987
2001
|
"aria-label": D.gallery.remove,
|
|
1988
2002
|
onClick: () => d?.(n, e),
|
|
1989
|
-
children: /* @__PURE__ */
|
|
2003
|
+
children: /* @__PURE__ */ I(ge, { className: "size-icon-md" })
|
|
1990
2004
|
})
|
|
1991
2005
|
]
|
|
1992
2006
|
})
|
|
1993
2007
|
]
|
|
1994
|
-
}, n) : /* @__PURE__ */
|
|
1995
|
-
className: `media-resource-gallery--item group/gallery overflow-hidden rounded-radius border border-border bg-background shadow-xs transition-colors ${
|
|
2008
|
+
}, n) : /* @__PURE__ */ L("div", {
|
|
2009
|
+
className: `media-resource-gallery--item group/gallery overflow-hidden rounded-radius border border-border bg-background text-foreground shadow-xs transition-colors ${h.tileHover}`,
|
|
1996
2010
|
"data-primary": p || void 0,
|
|
1997
|
-
children: [/* @__PURE__ */
|
|
2011
|
+
children: [/* @__PURE__ */ L("div", {
|
|
1998
2012
|
className: "relative aspect-[4/3] bg-muted",
|
|
1999
|
-
children: [c ? /* @__PURE__ */
|
|
2013
|
+
children: [c ? /* @__PURE__ */ I("img", {
|
|
2000
2014
|
src: c,
|
|
2001
2015
|
alt: f,
|
|
2002
2016
|
loading: "lazy",
|
|
2003
2017
|
className: "size-full object-cover"
|
|
2004
|
-
}) : /* @__PURE__ */
|
|
2018
|
+
}) : /* @__PURE__ */ I("div", {
|
|
2005
2019
|
className: "flex size-full items-center justify-center text-muted-foreground",
|
|
2006
|
-
children: /* @__PURE__ */
|
|
2007
|
-
}), /* @__PURE__ */
|
|
2020
|
+
children: /* @__PURE__ */ I(z, { className: "size-6" })
|
|
2021
|
+
}), /* @__PURE__ */ L("div", {
|
|
2008
2022
|
className: "absolute left-2 top-2 flex flex-wrap gap-space-xs",
|
|
2009
|
-
children: [p && /* @__PURE__ */
|
|
2023
|
+
children: [p && /* @__PURE__ */ I(x, {
|
|
2010
2024
|
tone: "secondary",
|
|
2011
2025
|
className: "bg-card text-card-foreground",
|
|
2012
2026
|
children: D.gallery.primary
|
|
2013
|
-
}), /* @__PURE__ */
|
|
2027
|
+
}), /* @__PURE__ */ I(x, {
|
|
2014
2028
|
tone: "secondary",
|
|
2015
2029
|
className: "bg-card text-card-foreground",
|
|
2016
|
-
children:
|
|
2030
|
+
children: H(D.gallery.itemPosition, {
|
|
2017
2031
|
index: t + 1,
|
|
2018
|
-
total:
|
|
2032
|
+
total: A
|
|
2019
2033
|
})
|
|
2020
2034
|
})]
|
|
2021
2035
|
})]
|
|
2022
|
-
}), /* @__PURE__ */
|
|
2036
|
+
}), /* @__PURE__ */ I("div", {
|
|
2023
2037
|
className: r("media-resource-gallery--item-body", v === "compact" ? "p-surface-xs" : "p-surface"),
|
|
2024
|
-
children: /* @__PURE__ */
|
|
2038
|
+
children: /* @__PURE__ */ L(l, {
|
|
2025
2039
|
gap: "md",
|
|
2026
|
-
children: [/* @__PURE__ */
|
|
2040
|
+
children: [/* @__PURE__ */ L("div", {
|
|
2027
2041
|
className: "min-w-0",
|
|
2028
|
-
children: [/* @__PURE__ */
|
|
2042
|
+
children: [/* @__PURE__ */ I(a, {
|
|
2029
2043
|
tag: "div",
|
|
2030
2044
|
weight: "semibold",
|
|
2031
2045
|
className: "truncate",
|
|
2032
|
-
children:
|
|
2033
|
-
}), /* @__PURE__ */
|
|
2046
|
+
children: o
|
|
2047
|
+
}), /* @__PURE__ */ I(_, {
|
|
2034
2048
|
value: O.getSize(e),
|
|
2035
2049
|
size: "xs",
|
|
2036
2050
|
align: "left",
|
|
2037
2051
|
emptyLabel: D.unknownSize
|
|
2038
2052
|
})]
|
|
2039
|
-
}), !y && /* @__PURE__ */
|
|
2053
|
+
}), !y && /* @__PURE__ */ L("div", {
|
|
2040
2054
|
className: "flex items-center gap-space-xs",
|
|
2041
2055
|
children: [
|
|
2042
|
-
/* @__PURE__ */
|
|
2056
|
+
/* @__PURE__ */ I(i, {
|
|
2043
2057
|
type: "button",
|
|
2044
2058
|
tone: "secondary",
|
|
2045
2059
|
buttonStyle: "ghost",
|
|
@@ -2048,9 +2062,9 @@ function Q({ items: e, accessors: t, title: a, description: s, primaryId: c, onP
|
|
|
2048
2062
|
disabled: p,
|
|
2049
2063
|
"aria-label": D.gallery.setPrimary,
|
|
2050
2064
|
onClick: () => u?.(n, e),
|
|
2051
|
-
children: /* @__PURE__ */
|
|
2065
|
+
children: /* @__PURE__ */ I(he, { className: "size-icon-md" })
|
|
2052
2066
|
}),
|
|
2053
|
-
/* @__PURE__ */
|
|
2067
|
+
/* @__PURE__ */ I(i, {
|
|
2054
2068
|
type: "button",
|
|
2055
2069
|
tone: "secondary",
|
|
2056
2070
|
buttonStyle: "ghost",
|
|
@@ -2058,10 +2072,10 @@ function Q({ items: e, accessors: t, title: a, description: s, primaryId: c, onP
|
|
|
2058
2072
|
iconOnly: !0,
|
|
2059
2073
|
disabled: !S,
|
|
2060
2074
|
"aria-label": D.gallery.movePrevious,
|
|
2061
|
-
onClick: () =>
|
|
2062
|
-
children: /* @__PURE__ */
|
|
2075
|
+
onClick: () => M(t, t - 1),
|
|
2076
|
+
children: /* @__PURE__ */ I(ae, { className: "size-icon-md" })
|
|
2063
2077
|
}),
|
|
2064
|
-
/* @__PURE__ */
|
|
2078
|
+
/* @__PURE__ */ I(i, {
|
|
2065
2079
|
type: "button",
|
|
2066
2080
|
tone: "secondary",
|
|
2067
2081
|
buttonStyle: "ghost",
|
|
@@ -2069,10 +2083,10 @@ function Q({ items: e, accessors: t, title: a, description: s, primaryId: c, onP
|
|
|
2069
2083
|
iconOnly: !0,
|
|
2070
2084
|
disabled: !w,
|
|
2071
2085
|
"aria-label": D.gallery.moveNext,
|
|
2072
|
-
onClick: () =>
|
|
2073
|
-
children: /* @__PURE__ */
|
|
2086
|
+
onClick: () => M(t, t + 1),
|
|
2087
|
+
children: /* @__PURE__ */ I(oe, { className: "size-icon-md" })
|
|
2074
2088
|
}),
|
|
2075
|
-
/* @__PURE__ */
|
|
2089
|
+
/* @__PURE__ */ I(i, {
|
|
2076
2090
|
type: "button",
|
|
2077
2091
|
tone: "destructive",
|
|
2078
2092
|
buttonStyle: "ghost",
|
|
@@ -2081,18 +2095,18 @@ function Q({ items: e, accessors: t, title: a, description: s, primaryId: c, onP
|
|
|
2081
2095
|
className: "ml-auto",
|
|
2082
2096
|
"aria-label": D.gallery.remove,
|
|
2083
2097
|
onClick: () => d?.(n, e),
|
|
2084
|
-
children: /* @__PURE__ */
|
|
2098
|
+
children: /* @__PURE__ */ I(ge, { className: "size-icon-md" })
|
|
2085
2099
|
})
|
|
2086
2100
|
]
|
|
2087
2101
|
})]
|
|
2088
2102
|
})
|
|
2089
2103
|
})]
|
|
2090
2104
|
}, n);
|
|
2091
|
-
}),
|
|
2105
|
+
}), N()]
|
|
2092
2106
|
})]
|
|
2093
2107
|
});
|
|
2094
2108
|
}
|
|
2095
2109
|
//#endregion
|
|
2096
|
-
export {
|
|
2110
|
+
export { Je as MediaLibrary, J as MediaLibraryCard, Y as MediaLibraryDetailPanel, Q as MediaLibraryDialog, He as MediaLibraryEmptyState, Ge as MediaLibraryFooter, Ue as MediaLibraryList, q as MediaLibraryToolbar, X as MediaLibraryUploadPanel, Ye as MediaResourceGallery, xe as defaultMediaLibraryStrings, Ee as formatMediaLibrarySize, H as formatMediaLibraryString, De as getMediaLibraryDimensions, Te as resolveMediaLibraryAccessors, Ie as useMediaLibrary };
|
|
2097
2111
|
|
|
2098
2112
|
//# sourceMappingURL=media-library.js.map
|