themelia-react-ui 2.0.5 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +326 -0
- package/MIGRATION.md +858 -0
- package/README.md +35 -24
- package/dist/{accordion-B9MHG0cT.js → accordion-DNVqwEIC.js} +37 -37
- package/dist/accordion-DNVqwEIC.js.map +1 -0
- package/dist/action-menu-D5343RwT.js +286 -0
- package/dist/action-menu-D5343RwT.js.map +1 -0
- package/dist/ai-artifact-otrz9ZwS.js +1214 -0
- package/dist/ai-artifact-otrz9ZwS.js.map +1 -0
- package/dist/anchored-positioning-1U_eBFNx.js +9 -0
- package/dist/anchored-positioning-1U_eBFNx.js.map +1 -0
- package/dist/app-shell-CPN30Nb1.js +372 -0
- package/dist/app-shell-CPN30Nb1.js.map +1 -0
- package/dist/{attachment-Dg_69lPS.js → attachment-D2-fpfmv.js} +15 -15
- package/dist/{attachment-Dg_69lPS.js.map → attachment-D2-fpfmv.js.map} +1 -1
- package/dist/{auth-DTkkshS8.js → auth-g_oUTDDC.js} +236 -243
- package/dist/auth-g_oUTDDC.js.map +1 -0
- package/dist/{avatar-CeZaFmNH.js → avatar-Ca3Ihrq4.js} +4 -4
- package/dist/{avatar-CeZaFmNH.js.map → avatar-Ca3Ihrq4.js.map} +1 -1
- package/dist/{badge-xIiV_E7f.js → badge-oGiXblW7.js} +8 -9
- package/dist/badge-oGiXblW7.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 +2 -2
- package/dist/base/cards.js +3 -3
- package/dist/base/carousel.js +11 -11
- package/dist/base/carousel.js.map +1 -1
- package/dist/base/cascader.js +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 +1 -1
- 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 +7 -7
- package/dist/base/feedback.js +4 -4
- package/dist/base/forms-numeric.js +2 -2
- package/dist/base/forms.js +2 -2
- package/dist/base/inline-edit.js +13 -13
- package/dist/base/inline-edit.js.map +1 -1
- package/dist/base/item.js +1 -1
- package/dist/base/media-gallery.js +203 -2
- package/dist/base/media-gallery.js.map +1 -0
- package/dist/base/metadata-list.js +1 -1
- package/dist/base/navigation.js +7 -7
- package/dist/base/popover-menu.js +1 -1
- package/dist/base/popover.js +1 -1
- package/dist/base/qr-code.js +32 -22
- package/dist/base/qr-code.js.map +1 -1
- package/dist/base/repeaters.js +208 -198
- package/dist/base/repeaters.js.map +1 -1
- package/dist/base/sidebar.js +2 -2
- package/dist/base/signature-pad.js +14 -14
- package/dist/base/signature-pad.js.map +1 -1
- package/dist/base/skeleton.js +1 -1
- package/dist/base/spinner.js +8 -14
- package/dist/base/spinner.js.map +1 -1
- package/dist/base/structure.js +1 -1
- package/dist/base/table.js +1 -1
- package/dist/base/text-inputs.js +3 -3
- package/dist/base/toaster.js +2 -2
- package/dist/base/tree.js +2 -2
- package/dist/base/upload-queue.js +303 -2
- package/dist/base/upload-queue.js.map +1 -0
- package/dist/base/upload.js +3 -4
- package/dist/base/value-inputs.js +1 -1
- package/dist/{batch-action-bar-Cb8cuvyy.js → batch-action-bar-D6MZQNnC.js} +10 -10
- package/dist/{batch-action-bar-Cb8cuvyy.js.map → batch-action-bar-D6MZQNnC.js.map} +1 -1
- package/dist/blocks/admin.js +242 -228
- package/dist/blocks/admin.js.map +1 -1
- package/dist/blocks/ai.js +398 -354
- package/dist/blocks/ai.js.map +1 -1
- package/dist/blocks/analytics/charts.js +1022 -0
- package/dist/blocks/analytics/charts.js.map +1 -0
- package/dist/blocks/analytics/usage-card.js +1 -1
- package/dist/blocks/analytics.js +173 -1392
- 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 +1533 -1399
- package/dist/blocks/commerce.js.map +1 -1
- package/dist/blocks/data-display.js +2 -3
- package/dist/blocks/onboarding.js +91 -82
- package/dist/blocks/onboarding.js.map +1 -1
- package/dist/blocks/planning.js +25 -25
- package/dist/blocks/planning.js.map +1 -1
- package/dist/blocks/timelines.js +2 -2
- package/dist/breadcrumbs-CQ9JSlez.js +136 -0
- package/dist/breadcrumbs-CQ9JSlez.js.map +1 -0
- package/dist/{button-S2Cubiiz.js → button-rd6FiHfQ.js} +12 -8
- package/dist/button-rd6FiHfQ.js.map +1 -0
- package/dist/{buttons-BedGfygC.js → buttons-pZVgPTZn.js} +230 -246
- package/dist/buttons-pZVgPTZn.js.map +1 -0
- package/dist/{cards-rNX1M4Xn.js → cards-CgWyqvgZ.js} +25 -22
- package/dist/{cards-rNX1M4Xn.js.map → cards-CgWyqvgZ.js.map} +1 -1
- package/dist/cascader-Cf05pwaq.js +444 -0
- package/dist/cascader-Cf05pwaq.js.map +1 -0
- package/dist/{chart-Darg_0Kv.js → chart-CygRCyIZ.js} +5 -5
- package/dist/{chart-Darg_0Kv.js.map → chart-CygRCyIZ.js.map} +1 -1
- package/dist/{checkbox-fflqmODR.js → checkbox-Dy5_XBMZ.js} +4 -4
- package/dist/{checkbox-fflqmODR.js.map → checkbox-Dy5_XBMZ.js.map} +1 -1
- package/dist/{choice-inputs-zUgBZfE4.js → choice-inputs-oJEsrb5Y.js} +195 -184
- package/dist/choice-inputs-oJEsrb5Y.js.map +1 -0
- package/dist/{code-block-BzmM9Eig.js → code-block-BrLD7mCi.js} +44 -60
- package/dist/code-block-BrLD7mCi.js.map +1 -0
- package/dist/collapsible-CRCCg_bO.js +80 -0
- package/dist/collapsible-CRCCg_bO.js.map +1 -0
- package/dist/{collection-content-gDh1v6O4.js → collection-content-D7SoDlYd.js} +3 -3
- package/dist/{collection-content-gDh1v6O4.js.map → collection-content-D7SoDlYd.js.map} +1 -1
- package/dist/combobox-Dl6f6kHz.js +362 -0
- package/dist/combobox-Dl6f6kHz.js.map +1 -0
- package/dist/combobox-DrDXtSSt.js +929 -0
- package/dist/combobox-DrDXtSSt.js.map +1 -0
- package/dist/command-CjZ2VzKC.js +432 -0
- package/dist/command-CjZ2VzKC.js.map +1 -0
- package/dist/comments-C2MZyRmh.js +1214 -0
- package/dist/comments-C2MZyRmh.js.map +1 -0
- package/dist/components/base/accordion/accordion.d.ts +11 -3
- package/dist/components/base/action-menu/action-menu.d.ts +11 -3
- package/dist/components/base/buttons/button.d.ts +2 -2
- package/dist/components/base/buttons/index.d.ts +1 -1
- package/dist/components/base/buttons/loader-button.d.ts +6 -15
- package/dist/components/base/cards/index.d.ts +1 -1
- package/dist/components/base/cards/partials/card-body-context.d.ts +6 -0
- package/dist/components/base/cards/smart-card.d.ts +0 -2
- package/dist/components/base/cards/smart-card.types.d.ts +12 -10
- package/dist/components/base/cascader/cascader.d.ts +8 -2
- package/dist/components/base/cascader/cascader.types.d.ts +24 -2
- package/dist/components/base/cascader/index.d.ts +1 -1
- package/dist/components/base/choice-inputs/choice-types.d.ts +4 -0
- package/dist/components/base/choice-inputs/pill-radio-group.d.ts +7 -6
- package/dist/components/base/choice-inputs/switch.d.ts +1 -1
- package/dist/components/base/code-block/use-code-copy.d.ts +2 -6
- package/dist/components/base/combobox/combobox-field.d.ts +2 -2
- package/dist/components/base/command/command.d.ts +1 -1
- package/dist/components/base/date-pickers/date-picker-internals.d.ts +3 -1
- package/dist/components/base/date-pickers/datepicker.types.d.ts +11 -7
- package/dist/components/base/date-pickers/time-picker.d.ts +17 -3
- package/dist/components/base/display/dialog.d.ts +3 -9
- package/dist/components/base/display/index.d.ts +2 -3
- package/dist/components/base/display/separator.d.ts +1 -1
- package/dist/components/base/feedback/alert.d.ts +2 -1
- package/dist/components/base/feedback/empty.d.ts +10 -2
- package/dist/components/base/feedback/state-display.d.ts +5 -1
- package/dist/components/base/feedback/state-display.strings.d.ts +9 -0
- package/dist/components/base/forms/form-field.d.ts +7 -2
- package/dist/components/base/forms/workflow.d.ts +2 -2
- package/dist/components/base/forms-numeric/coordinates-input.d.ts +4 -1
- package/dist/components/base/forms-numeric/decimal-input.d.ts +2 -2
- package/dist/components/base/forms-numeric/dimensions-input.d.ts +13 -18
- package/dist/components/base/forms-numeric/index.d.ts +3 -3
- package/dist/components/base/forms-numeric/numeric-composite-field.d.ts +12 -0
- package/dist/components/base/forms-numeric/weight-input.d.ts +6 -1
- package/dist/components/base/item/item.types.d.ts +6 -2
- package/dist/components/base/metadata-list/index.d.ts +1 -3
- package/dist/components/base/metadata-list/metadata-list.d.ts +4 -1
- package/dist/components/base/navigation/index.d.ts +2 -2
- package/dist/components/base/navigation/language-switcher.d.ts +17 -8
- package/dist/components/base/navigation/navigation-tabs.d.ts +8 -1
- package/dist/components/base/navigation/page-header/index.d.ts +1 -1
- package/dist/components/base/navigation/page-header/page-header.d.ts +13 -17
- package/dist/components/base/navigation/pagination.d.ts +5 -5
- package/dist/components/base/popover/popover.recipes.d.ts +0 -1
- package/dist/components/base/qr-code/qr-code.d.ts +4 -0
- package/dist/components/base/repeaters/index.d.ts +1 -1
- package/dist/components/base/repeaters/key-value-editor.d.ts +6 -1
- package/dist/components/base/sheet/sheet.d.ts +6 -15
- package/dist/components/base/sidebar/index.d.ts +1 -6
- package/dist/components/base/sidebar/sidebar.d.ts +40 -10
- package/dist/components/base/skeleton/skeleton.d.ts +1 -1
- package/dist/components/base/structure/structure.types.d.ts +11 -2
- package/dist/components/base/text-inputs/index.d.ts +1 -1
- package/dist/components/base/tree/index.d.ts +1 -0
- package/dist/components/base/tree/tree.d.ts +2 -2
- package/dist/components/base/tree/tree.types.d.ts +7 -1
- package/dist/components/base/upload/avatar-upload.d.ts +2 -1
- package/dist/components/base/upload/file-upload.validation.d.ts +37 -1
- package/dist/components/base/upload/image-upload.d.ts +4 -1
- package/dist/components/base/upload/index.d.ts +3 -9
- package/dist/components/base/value-inputs/date-time-input.d.ts +4 -0
- package/dist/components/base/value-inputs/slider.d.ts +5 -2
- package/dist/components/blocks/admin/action-surfaces/index.d.ts +17 -4
- package/dist/components/blocks/admin/api-key-list/api-key-list.types.d.ts +9 -3
- package/dist/components/blocks/admin/index.d.ts +1 -1
- package/dist/components/blocks/ai/ai-artifact/ai-artifact.d.ts +1 -1
- package/dist/components/blocks/ai/ai-artifact/types.d.ts +9 -4
- package/dist/components/blocks/ai/ai-chain-of-thought/ai-chain-of-thought.d.ts +1 -1
- package/dist/components/blocks/ai/ai-chain-of-thought/types.d.ts +11 -1
- package/dist/components/blocks/ai/ai-citation/ai-citation.d.ts +1 -1
- package/dist/components/blocks/ai/ai-citation/types.d.ts +8 -0
- package/dist/components/blocks/ai/ai-confirmation/ai-confirmation.d.ts +1 -1
- package/dist/components/blocks/ai/ai-confirmation/types.d.ts +21 -5
- package/dist/components/blocks/ai/ai-feedback/types.d.ts +7 -2
- package/dist/components/blocks/ai/ai-inline-citation/types.d.ts +9 -3
- package/dist/components/blocks/ai/ai-package-info/ai-package-info.d.ts +1 -1
- package/dist/components/blocks/ai/ai-package-info/types.d.ts +6 -0
- package/dist/components/blocks/ai/ai-reasoning/types.d.ts +2 -0
- package/dist/components/blocks/ai/ai-sources/ai-sources.d.ts +1 -1
- package/dist/components/blocks/ai/ai-sources/types.d.ts +10 -2
- package/dist/components/blocks/ai/ai-task/ai-task.d.ts +1 -1
- package/dist/components/blocks/ai/ai-task/types.d.ts +10 -1
- package/dist/components/blocks/ai/ai-tool-call/ai-tool-call.d.ts +1 -1
- package/dist/components/blocks/ai/ai-tool-call/types.d.ts +8 -0
- package/dist/components/blocks/ai/ai.strings.d.ts +2 -0
- package/dist/components/blocks/analytics/activity-heatmap/types.d.ts +1 -1
- package/dist/components/blocks/analytics/analytics.strings.d.ts +2 -0
- package/dist/components/blocks/analytics/atoms/metric-trend-chip.d.ts +11 -1
- package/dist/components/blocks/analytics/chart-card/chart-card.d.ts +7 -5
- package/dist/components/blocks/analytics/charts/index.d.ts +27 -0
- package/dist/components/blocks/analytics/index.d.ts +17 -24
- package/dist/components/blocks/analytics/metric/metric.d.ts +7 -3
- package/dist/components/blocks/analytics/metric-comparison/metric-comparison.d.ts +2 -0
- package/dist/components/blocks/analytics/metric-grid/metric-grid.d.ts +4 -5
- package/dist/components/blocks/analytics/types.d.ts +13 -4
- package/dist/components/blocks/analytics/usage-card/usage-card.strings.d.ts +2 -0
- package/dist/components/blocks/commerce/address-card/address-card.d.ts +1 -1
- package/dist/components/blocks/commerce/address-card/types.d.ts +5 -16
- package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.d.ts +2 -2
- package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.types.d.ts +6 -4
- package/dist/components/blocks/commerce/cart-summary/cart-summary.d.ts +0 -2
- package/dist/components/blocks/commerce/cart-summary/index.d.ts +2 -2
- package/dist/components/blocks/commerce/cart-summary/types.d.ts +9 -11
- package/dist/components/blocks/commerce/coupon-input/coupon-input.d.ts +1 -1
- package/dist/components/blocks/commerce/coupon-input/types.d.ts +7 -3
- package/dist/components/blocks/commerce/discount-stack/discount-stack.d.ts +0 -2
- package/dist/components/blocks/commerce/discount-stack/index.d.ts +2 -2
- package/dist/components/blocks/commerce/discount-stack/types.d.ts +4 -6
- package/dist/components/blocks/commerce/fulfillment-group/fulfillment-group.d.ts +1 -1
- package/dist/components/blocks/commerce/fulfillment-group/types.d.ts +2 -0
- package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-balance.d.ts +18 -0
- package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-compact.d.ts +1 -1
- package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-copy-button.d.ts +0 -1
- package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-dark.d.ts +1 -1
- package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-full.d.ts +1 -1
- package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-illustrated.d.ts +1 -1
- package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-minimal.d.ts +1 -1
- package/dist/components/blocks/commerce/giftcard-card/types.d.ts +16 -5
- package/dist/components/blocks/commerce/index.d.ts +8 -8
- package/dist/components/blocks/commerce/inventory-level/inventory-level.strings.d.ts +2 -0
- package/dist/components/blocks/commerce/inventory-level/types.d.ts +1 -1
- package/dist/components/blocks/commerce/inventory-section/types.d.ts +0 -5
- package/dist/components/blocks/commerce/invoice-line-items/types.d.ts +6 -3
- package/dist/components/blocks/commerce/loyalty-points/loyalty-points.d.ts +1 -1
- package/dist/components/blocks/commerce/loyalty-points/types.d.ts +11 -5
- package/dist/components/blocks/commerce/order-status/order-status.d.ts +1 -1
- package/dist/components/blocks/commerce/order-status/types.d.ts +12 -8
- package/dist/components/blocks/commerce/order-timeline/order-timeline.d.ts +1 -1
- package/dist/components/blocks/commerce/order-timeline/types.d.ts +3 -1
- package/dist/components/blocks/commerce/payment-method/index.d.ts +2 -2
- package/dist/components/blocks/commerce/payment-method/payment-method.d.ts +0 -8
- package/dist/components/blocks/commerce/payment-method/types.d.ts +0 -2
- package/dist/components/blocks/commerce/receipt/index.d.ts +1 -1
- package/dist/components/blocks/commerce/receipt/receipt-items.d.ts +1 -1
- package/dist/components/blocks/commerce/receipt/types.d.ts +10 -0
- package/dist/components/blocks/commerce/refund-status/index.d.ts +2 -2
- package/dist/components/blocks/commerce/refund-status/refund-status.d.ts +0 -2
- package/dist/components/blocks/commerce/refund-status/types.d.ts +0 -2
- package/dist/components/blocks/commerce/seo-listing/types.d.ts +7 -0
- package/dist/components/blocks/commerce/shared/code-entry.d.ts +39 -0
- package/dist/components/blocks/commerce/shared/order-status.d.ts +1 -1
- package/dist/components/blocks/commerce/subscription-summary/subscription-summary.d.ts +1 -1
- package/dist/components/blocks/commerce/subscription-summary/types.d.ts +10 -1
- package/dist/components/blocks/commerce/upcoming-booking/index.d.ts +2 -1
- package/dist/components/blocks/commerce/upcoming-booking/types.d.ts +8 -0
- package/dist/components/blocks/commerce/upcoming-booking/upcoming-booking.d.ts +2 -2
- package/dist/components/blocks/commerce/vendor-profile/types.d.ts +4 -5
- package/dist/components/blocks/commerce/voucher-entry/types.d.ts +6 -3
- package/dist/components/blocks/commerce/voucher-entry/voucher-entry.d.ts +1 -1
- package/dist/components/blocks/content-block-hooks.d.ts +22 -0
- package/dist/components/blocks/data-display/dense-info-card/dense-info.strings.d.ts +5 -1
- package/dist/components/blocks/data-display/dense-info-card/helpers.d.ts +3 -1
- package/dist/components/blocks/data-display/dense-info-card/index.d.ts +1 -1
- package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-classification.d.ts +1 -1
- package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-dashboard.d.ts +1 -1
- package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-financial.d.ts +1 -1
- package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-project.d.ts +1 -1
- package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-score.d.ts +1 -1
- package/dist/components/blocks/data-display/dense-info-card/types.d.ts +12 -5
- package/dist/components/blocks/data-display/empty-state/empty-state.types.d.ts +10 -3
- package/dist/components/blocks/data-display/index.d.ts +0 -1
- package/dist/components/blocks/data-display/relationship-card-frame.d.ts +1 -1
- package/dist/components/blocks/onboarding/checklist/checklist.types.d.ts +5 -3
- package/dist/components/blocks/planning/task-card.types.d.ts +7 -3
- package/dist/components/blocks/timelines/changelog/types.d.ts +2 -2
- package/dist/components/blocks/timelines/index.d.ts +2 -2
- package/dist/components/blocks/timelines/milestones/types.d.ts +2 -2
- package/dist/components/blocks/timelines/shared/timeline.d.ts +6 -0
- package/dist/components/blocks/timelines/steps-card/index.d.ts +2 -1
- package/dist/components/blocks/timelines/steps-card/steps-card.d.ts +2 -2
- package/dist/components/blocks/timelines/steps-card/types.d.ts +13 -1
- package/dist/components/features/activities/activities.strings.d.ts +5 -3
- package/dist/components/features/activities/activities.types.d.ts +46 -22
- package/dist/components/features/activities/hooks/use-activity-feed.d.ts +6 -0
- package/dist/components/features/activities/hooks/use-activity-resources.d.ts +2 -1
- package/dist/components/features/activities/index.d.ts +1 -1
- package/dist/components/features/activities/partials/activity-headline.d.ts +5 -0
- package/dist/components/features/activities/partials/activity-row.d.ts +12 -13
- package/dist/components/features/activities/partials/row-layers.d.ts +7 -0
- package/dist/components/features/activities/relative-time.d.ts +18 -0
- package/dist/components/features/ai-chat/ai-chat.d.ts +6 -2
- package/dist/components/features/ai-chat/ai-chat.strings.d.ts +41 -2
- package/dist/components/features/ai-chat/ai-chat.types.d.ts +6 -0
- package/dist/components/features/ai-chat/hooks/use-ai-chat-scroll.d.ts +1 -1
- package/dist/components/features/ai-chat/partials/ai-chat-attachments-strip.d.ts +5 -1
- package/dist/components/features/ai-chat/partials/ai-chat-prompt-input.d.ts +2 -2
- package/dist/components/features/ai-chat/partials/ai-chat-queue.d.ts +3 -1
- package/dist/components/features/ai-chat/partials/ai-chat-suggestions-row.d.ts +6 -1
- package/dist/components/features/appointment-calendar/appointment-calendar.d.ts +1 -1
- package/dist/components/features/appointment-calendar/appointment-calendar.types.d.ts +20 -4
- package/dist/components/features/appointment-calendar/index.d.ts +1 -1
- package/dist/components/features/appointment-calendar/partials/appointment-agenda.d.ts +18 -10
- package/dist/components/features/async-preview/async-preview.d.ts +2 -2
- package/dist/components/features/async-preview/async-preview.types.d.ts +30 -1
- package/dist/components/features/async-preview/preview-trigger-cell.d.ts +7 -2
- package/dist/components/features/combobox/async-resource-combobox.d.ts +2 -2
- package/dist/components/features/combobox/combobox.d.ts +12 -3
- package/dist/components/features/combobox/components/error-message.d.ts +3 -1
- package/dist/components/features/combobox/hooks/use-combobox-core.d.ts +4 -3
- package/dist/components/features/combobox/hooks/use-combobox-state.d.ts +1 -0
- package/dist/components/features/combobox/hooks/use-load-more.d.ts +1 -0
- package/dist/components/features/combobox/index.d.ts +1 -1
- package/dist/components/features/combobox/types.d.ts +68 -37
- package/dist/components/features/comments/comments.strings.d.ts +6 -5
- package/dist/components/features/comments/comments.types.d.ts +40 -26
- package/dist/components/features/comments/hooks/use-attachment-upload.d.ts +5 -1
- package/dist/components/features/comments/hooks/use-comments.d.ts +8 -1
- package/dist/components/features/data-view/data-view.strings.d.ts +9 -2
- package/dist/components/features/data-view/data-view.types.d.ts +15 -2
- package/dist/components/features/email-composer/email-html.d.ts +5 -0
- package/dist/components/features/email-composer/http.d.ts +2 -0
- package/dist/components/features/email-composer/strings.d.ts +17 -2
- package/dist/components/features/email-composer/types.d.ts +19 -2
- package/dist/components/features/email-composer/use-composer.d.ts +2 -78
- package/dist/components/features/event-calendar/event-calendar-day-cell.d.ts +1 -1
- package/dist/components/features/event-calendar/event-calendar-event-badge.d.ts +1 -1
- package/dist/components/features/event-calendar/event-calendar-header.d.ts +1 -1
- package/dist/components/features/event-calendar/event-calendar-legend.d.ts +2 -2
- package/dist/components/features/event-calendar/event-calendar.d.ts +1 -1
- package/dist/components/features/event-calendar/event-calendar.types.d.ts +126 -21
- package/dist/components/features/filters/facets/date-facet.d.ts +4 -2
- package/dist/components/features/filters/facets/range-facet.d.ts +24 -7
- package/dist/components/features/filters/filter-context.d.ts +9 -0
- package/dist/components/features/filters/filters.strings.d.ts +36 -3
- package/dist/components/features/filters/filters.types.d.ts +75 -8
- package/dist/components/features/filters/hooks/use-filter-draft.d.ts +1 -0
- package/dist/components/features/filters/index.d.ts +2 -2
- package/dist/components/features/filters/operator-options.d.ts +25 -2
- package/dist/components/features/filters/partials/active-filter-item.d.ts +0 -13
- package/dist/components/features/filters/partials/async-options-status.d.ts +32 -0
- package/dist/components/features/filters/partials/date-filter-content.d.ts +3 -2
- package/dist/components/features/filters/partials/filter-draft-footer.d.ts +11 -0
- package/dist/components/features/filters/partials/filter-operator-select.d.ts +4 -2
- package/dist/components/features/filters/partials/filter-pill.d.ts +5 -1
- package/dist/components/features/filters/partials/filter-popover-content.d.ts +4 -2
- package/dist/components/features/filters/partials/filter-tabs.d.ts +2 -1
- package/dist/components/features/filters/partials/range-filter-content.d.ts +12 -0
- package/dist/components/features/filters/partials/regular-filter-content.d.ts +1 -1
- package/dist/components/features/filters/utils/filter-utils.d.ts +34 -5
- package/dist/components/features/global-search/global-search-dialog.d.ts +7 -1
- package/dist/components/features/global-search/global-search.d.ts +7 -1
- package/dist/components/features/global-search/global-search.strings.d.ts +19 -3
- package/dist/components/features/global-search/global-search.types.d.ts +30 -6
- package/dist/components/features/global-search/index.d.ts +1 -1
- package/dist/components/features/global-search/partials/global-search-idle-state.d.ts +6 -1
- package/dist/components/features/global-search/partials/global-search-input.d.ts +2 -0
- package/dist/components/features/kanban/index.d.ts +2 -2
- package/dist/components/features/kanban/kanban-context.d.ts +4 -0
- package/dist/components/features/kanban/kanban-keyboard.d.ts +7 -2
- package/dist/components/features/kanban/kanban.d.ts +10 -1
- package/dist/components/features/kanban/kanban.strings.d.ts +11 -2
- package/dist/components/features/kanban/kanban.types.d.ts +26 -0
- package/dist/components/features/map/map.d.ts +4 -0
- package/dist/components/features/map/place-autocomplete.d.ts +10 -1
- package/dist/components/features/media-library/hooks/use-media-library.d.ts +3 -1
- package/dist/components/features/media-library/media-library.d.ts +1 -1
- package/dist/components/features/media-library/media-library.strings.d.ts +39 -3
- package/dist/components/features/media-library/media-library.types.d.ts +82 -9
- package/dist/components/features/media-library/partials/media-library-partials.d.ts +3 -3
- package/dist/components/features/mentions/hooks/use-mentions-search.d.ts +7 -0
- package/dist/components/features/mentions/hooks/use-mentions.d.ts +16 -1
- package/dist/components/features/mentions/index.d.ts +1 -1
- package/dist/components/features/mentions/mentions.strings.d.ts +10 -2
- package/dist/components/features/mentions/partials/mention-chip.d.ts +1 -0
- package/dist/components/features/mentions/partials/mention-inline-suggestions.d.ts +12 -1
- package/dist/components/features/mentions/partials/mention-picker.d.ts +8 -1
- package/dist/components/features/mentions/partials/mention-search-error.d.ts +6 -0
- package/dist/components/features/mentions/utils/index.d.ts +0 -1
- package/dist/components/features/overlays/alert-dialog.d.ts +1 -1
- package/dist/components/features/overlays/dialog.d.ts +1 -1
- package/dist/components/features/overlays/drawer.d.ts +1 -1
- package/dist/components/features/overlays/hooks/use-overlay-visibility.d.ts +2 -2
- package/dist/components/features/overlays/index.d.ts +2 -2
- package/dist/components/features/overlays/overlays.strings.d.ts +2 -1
- package/dist/components/features/overlays/overlays.types.d.ts +27 -10
- package/dist/components/features/products/components/index.d.ts +0 -10
- package/dist/components/features/products/components/product-contract-overview.d.ts +1 -1
- package/dist/components/features/products/components/product-details-card.d.ts +1 -1
- package/dist/components/features/products/components/product-operations-card.d.ts +1 -1
- package/dist/components/features/products/components/product-option-action-menu.d.ts +1 -1
- package/dist/components/features/products/components/product-options-summary.d.ts +1 -1
- package/dist/components/features/products/components/product-policies-card.d.ts +1 -1
- package/dist/components/features/products/components/product-quote-preview-card.d.ts +1 -1
- package/dist/components/features/products/components/product-readiness-card.d.ts +1 -1
- package/dist/components/features/products/components/product-structure-card.d.ts +1 -1
- package/dist/components/features/products/components/product-variant-action-menu.d.ts +1 -1
- package/dist/components/features/products/components/product-variants-manager.d.ts +1 -1
- package/dist/components/features/products/components/product-variants-table.d.ts +1 -1
- package/dist/components/features/products/partials/product-surface.d.ts +15 -0
- package/dist/components/features/products/products.strings.d.ts +8 -0
- package/dist/components/features/products/products.types.d.ts +26 -8
- package/dist/components/features/questionnaire/questionnaire.types.d.ts +7 -2
- package/dist/components/features/resource/index.d.ts +2 -3
- package/dist/components/features/resource/resource.d.ts +2 -10
- package/dist/components/features/resource/resource.types.d.ts +7 -147
- package/dist/components/features/resource-assignment/partials/assignment-surface.d.ts +15 -0
- package/dist/components/features/resource-assignment/resource-assignment.strings.d.ts +6 -1
- package/dist/components/features/resource-assignment/resource-assignment.types.d.ts +6 -0
- package/dist/components/features/rich-text-editor/form-rich-text-editor.d.ts +1 -1
- package/dist/components/features/rich-text-editor/partials/caret-helpers.d.ts +5 -7
- package/dist/components/features/rich-text-editor/partials/editor-field-aria.d.ts +14 -0
- package/dist/components/features/rich-text-editor/partials/html-helpers.d.ts +2 -3
- package/dist/components/features/rich-text-editor/partials/image-uploads.d.ts +6 -2
- package/dist/components/features/rich-text-editor/partials/index.d.ts +2 -3
- package/dist/components/features/rich-text-editor/partials/rich-text-editor-tiptap.d.ts +0 -1
- package/dist/components/features/rich-text-editor/partials/rich-text-editor-toolbar.d.ts +5 -4
- package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +1 -1
- package/dist/components/features/rich-text-editor/rich-text-editor.types.d.ts +30 -4
- package/dist/components/features/schema-form/hooks/use-schema-form.d.ts +10 -1
- package/dist/components/features/schema-form/partials/schema-form-field.d.ts +3 -1
- package/dist/components/features/schema-form/schema-form.d.ts +1 -1
- package/dist/components/features/schema-form/schema-form.types.d.ts +13 -5
- package/dist/components/features/schema-form/schema-form.utils.d.ts +1 -1
- package/dist/components/features/suggestions/suggestions.strings.d.ts +14 -0
- package/dist/components/features/suggestions/suggestions.types.d.ts +13 -5
- package/dist/components/features/table/data-table.d.ts +1 -1
- package/dist/components/features/table/filter-bar.d.ts +1 -1
- package/dist/components/features/table/index.d.ts +1 -0
- package/dist/components/features/table/pagination.d.ts +1 -1
- package/dist/components/features/table/partials/cell-value.d.ts +1 -1
- package/dist/components/features/table/table-body.d.ts +1 -1
- package/dist/components/features/table/table-header.d.ts +1 -1
- package/dist/components/features/table/table-helpers.d.ts +37 -12
- package/dist/components/features/table/table-region.recipes.d.ts +11 -0
- package/dist/components/features/table/table-toolbar.d.ts +1 -1
- package/dist/components/features/table/table.strings.d.ts +4 -0
- package/dist/components/features/table/table.types.d.ts +91 -49
- package/dist/components/features/theme-tweaker/theme-provider-settings.d.ts +4 -0
- package/dist/components/features/theme-tweaker/theme-tweaker.strings.d.ts +10 -7
- package/dist/components/features/theme-tweaker/theme-tweaker.utils.d.ts +17 -0
- package/dist/components/layout/app-shell/app-shell.types.d.ts +46 -49
- package/dist/components/layout/app-shell/index.d.ts +2 -2
- package/dist/components/layout/app-shell/shell-regions.d.ts +9 -0
- package/dist/components/layout/app-shell/shell-skip-link.d.ts +9 -0
- package/dist/components/layout/app-shell/sidebar-inset-layout.d.ts +1 -1
- package/dist/components/layout/app-shell/stacked-layout.d.ts +1 -1
- package/dist/components/layout/app-shell/topbar-sidebar-layout.d.ts +1 -1
- package/dist/components/layout/auth/auth-shell.d.ts +1 -1
- package/dist/components/layout/auth/auth.types.d.ts +0 -5
- package/dist/components/layout/containers/inline-gutter-context.d.ts +7 -0
- package/dist/components/layout/containers/main-landmark-context.d.ts +6 -0
- package/dist/components/layout/header/header.types.d.ts +19 -8
- package/dist/components/layout/header/partials/header-global-search-trigger.d.ts +1 -1
- package/dist/components/layout/header/partials/header-notifications.d.ts +1 -1
- package/dist/components/layout/header/partials/header-search.d.ts +1 -1
- package/dist/components/layout/hooks/use-command-shortcut.d.ts +10 -1
- package/dist/components/layout/layout.types.d.ts +6 -4
- package/dist/components/layout/navigation/breadcrumb-progress/breadcrumb-progress.d.ts +1 -1
- package/dist/components/layout/navigation/breadcrumb-progress/types.d.ts +9 -0
- package/dist/components/layout/navigation/section-nav/section-nav.d.ts +8 -1
- package/dist/components/layout/navigation/side-nav.d.ts +3 -2
- package/dist/components/layout/normalize-layout-path.d.ts +1 -0
- package/dist/components/layout/page/index.d.ts +2 -3
- package/dist/components/layout/page/page.strings.d.ts +12 -0
- package/dist/components/layout/page/page.types.d.ts +7 -110
- package/dist/components/layout/page/partials/page-header.d.ts +1 -1
- package/dist/components/layout/settings/index.d.ts +1 -1
- package/dist/components/layout/settings/settings.d.ts +4 -6
- package/dist/components/layout/sidebar/app-sidebar.d.ts +1 -1
- package/dist/components/layout/sidebar/components/sidebar-grouped-navigation.d.ts +1 -1
- package/dist/components/layout/sidebar/components/sidebar-navigation-footer.d.ts +1 -1
- package/dist/components/layout/sidebar/components/sidebar-navigation.d.ts +1 -1
- package/dist/components/layout/sidebar/index.d.ts +1 -1
- package/dist/components/layout/sidebar/sidebar-navigation-rail.d.ts +17 -7
- package/dist/components/layout/sidebar/sidebar.context.d.ts +1 -0
- package/dist/components/layout/sidebar/sidebar.types.d.ts +12 -12
- package/dist/components/layout/sidebar/sidebar.utils.d.ts +4 -0
- package/dist/components/layout/workspace/workspace.strings.d.ts +2 -2
- package/dist/components/layout/workspace/workspace.types.d.ts +13 -7
- package/dist/components/primitives/date.d.ts +22 -3
- package/dist/components/primitives/file-size.d.ts +8 -2
- package/dist/components/primitives/index.d.ts +1 -1
- package/dist/components/primitives/initials.d.ts +3 -1
- package/dist/components/primitives/link.d.ts +11 -3
- package/dist/components/primitives/money.d.ts +2 -2
- package/dist/components/primitives/number.d.ts +3 -2
- package/dist/components/typography/heading.d.ts +9 -3
- package/dist/components/typography/index.d.ts +1 -1
- package/dist/components/typography/rich-text/rich-text-tree.d.ts +7 -5
- package/dist/components/typography/text-link.d.ts +10 -3
- package/dist/components/ui/badge.d.ts +2 -4
- package/dist/components/ui/breadcrumb.d.ts +2 -3
- package/dist/components/ui/button.d.ts +8 -2
- package/dist/components/ui/collapsible.d.ts +1 -4
- package/dist/components/ui/command.d.ts +20 -18
- package/dist/components/ui/dialog.d.ts +3 -9
- package/dist/components/ui/empty.d.ts +2 -2
- package/dist/components/ui/input-group.d.ts +3 -3
- package/dist/components/ui/item.d.ts +3 -3
- package/dist/components/ui/popover.d.ts +3 -7
- package/dist/components/ui/sheet.d.ts +4 -12
- package/dist/components/ui/sidebar-state.d.ts +6 -1
- package/dist/components/ui/sidebar.d.ts +7 -4
- package/dist/components/ui/tabs.d.ts +2 -2
- package/dist/components/ui/toggle-group.d.ts +3 -3
- package/dist/components/ui/toggle.d.ts +2 -2
- package/dist/components/ui/tooltip.d.ts +1 -3
- package/dist/{containers-CIxwbZt5.js → containers-BdfLTP4w.js} +37 -32
- package/dist/containers-BdfLTP4w.js.map +1 -0
- package/dist/content-block-hooks-Z3iKjqd1.js +17 -0
- package/dist/content-block-hooks-Z3iKjqd1.js.map +1 -0
- package/dist/{copyable-DIznBqiT.js → copyable-Bmr14W0d.js} +6 -6
- package/dist/{copyable-DIznBqiT.js.map → copyable-Bmr14W0d.js.map} +1 -1
- package/dist/{data-display-BdgCAw8T.js → data-display-CWe9SOYh.js} +264 -250
- package/dist/data-display-CWe9SOYh.js.map +1 -0
- package/dist/date-3qsCE1ID.js +209 -0
- package/dist/date-3qsCE1ID.js.map +1 -0
- package/dist/date-picker-D1keJQIG.js +1617 -0
- package/dist/date-picker-D1keJQIG.js.map +1 -0
- package/dist/date-pickers-D8aJoeHc.js +185 -0
- package/dist/date-pickers-D8aJoeHc.js.map +1 -0
- package/dist/disclosure-panel-B0HFNZ9x.js.map +1 -1
- package/dist/{display-KsZLw9Ov.js → display-VlmP1I0i.js} +23 -46
- package/dist/display-VlmP1I0i.js.map +1 -0
- package/dist/{dropdown-menu-CLs8Lihj.js → dropdown-menu-B8hjvbkS.js} +9 -9
- package/dist/{dropdown-menu-CLs8Lihj.js.map → dropdown-menu-B8hjvbkS.js.map} +1 -1
- package/dist/dropzone-CHBNK3de.js +116 -0
- package/dist/dropzone-CHBNK3de.js.map +1 -0
- package/dist/features/activities.js +767 -700
- package/dist/features/activities.js.map +1 -1
- package/dist/features/ai-chat.js +280 -235
- package/dist/features/ai-chat.js.map +1 -1
- package/dist/features/appointment-calendar.js +430 -334
- package/dist/features/appointment-calendar.js.map +1 -1
- package/dist/features/async-preview.js +351 -265
- package/dist/features/async-preview.js.map +1 -1
- package/dist/features/combobox.js +2 -2
- package/dist/features/comments.js +1 -1
- package/dist/features/data-view.js +212 -151
- package/dist/features/data-view.js.map +1 -1
- package/dist/features/email-composer/engine.js +1 -1
- package/dist/features/email-composer.js +347 -313
- package/dist/features/email-composer.js.map +1 -1
- package/dist/features/event-calendar.js +501 -348
- package/dist/features/event-calendar.js.map +1 -1
- package/dist/features/filters.js +2 -2
- package/dist/features/global-search.js +250 -210
- package/dist/features/global-search.js.map +1 -1
- package/dist/features/kanban.js +280 -210
- package/dist/features/kanban.js.map +1 -1
- package/dist/features/map/style.css +15 -0
- package/dist/features/map.js +435 -404
- package/dist/features/map.js.map +1 -1
- package/dist/features/media-library.js +1745 -1195
- package/dist/features/media-library.js.map +1 -1
- package/dist/features/mentions.js +2 -2
- package/dist/features/overlays.js +2 -2
- package/dist/features/products.js +1862 -1759
- package/dist/features/products.js.map +1 -1
- package/dist/features/questionnaire.js +188 -168
- package/dist/features/questionnaire.js.map +1 -1
- package/dist/features/resource-assignment.js +223 -191
- package/dist/features/resource-assignment.js.map +1 -1
- package/dist/features/resource.js +55 -217
- package/dist/features/resource.js.map +1 -1
- package/dist/features/rich-text-editor.js +28 -19
- package/dist/features/rich-text-editor.js.map +1 -1
- package/dist/features/schema-form.js +380 -287
- package/dist/features/schema-form.js.map +1 -1
- package/dist/features/suggestions.js +90 -74
- package/dist/features/suggestions.js.map +1 -1
- package/dist/features/table.js +2 -2
- package/dist/features/theme-tweaker.js +718 -627
- package/dist/features/theme-tweaker.js.map +1 -1
- package/dist/feedback-DmqmXKLn.js +254 -0
- package/dist/feedback-DmqmXKLn.js.map +1 -0
- package/dist/{field-affordance-recipes-DWcNcOjh.js → field-affordance-recipes-DfbMadot.js} +13 -9
- package/dist/field-affordance-recipes-DfbMadot.js.map +1 -0
- package/dist/field-control-attributes-B6i335wr.js +18 -0
- package/dist/field-control-attributes-B6i335wr.js.map +1 -0
- package/dist/field-state-recipes-EtCxpEy3.js +18 -0
- package/dist/field-state-recipes-EtCxpEy3.js.map +1 -0
- package/dist/filters-BviMRMLS.js +2692 -0
- package/dist/filters-BviMRMLS.js.map +1 -0
- package/dist/{focus-recipes-B653VaLq.js → focus-recipes-DSkiUvUp.js} +3 -3
- package/dist/focus-recipes-DSkiUvUp.js.map +1 -0
- package/dist/form-field-BdfCwSoQ.js +74 -0
- package/dist/form-field-BdfCwSoQ.js.map +1 -0
- package/dist/{form-sizing-Bs2qFUeE.js → form-sizing-DE_dZw32.js} +3 -3
- package/dist/{form-sizing-Bs2qFUeE.js.map → form-sizing-DE_dZw32.js.map} +1 -1
- package/dist/{forms-C0RGnJTe.js → forms-B8DzJnBN.js} +35 -35
- package/dist/forms-B8DzJnBN.js.map +1 -0
- package/dist/forms-numeric-DOBswjKj.js +992 -0
- package/dist/forms-numeric-DOBswjKj.js.map +1 -0
- package/dist/{header-DMMxG__r.js → header-Cq3G0ZRP.js} +163 -158
- package/dist/header-Cq3G0ZRP.js.map +1 -0
- package/dist/hooks/use-files.d.ts +2 -0
- package/dist/{hooks-DB6CJ4MR.js → hooks-DHfeSMAO.js} +34 -14
- package/dist/hooks-DHfeSMAO.js.map +1 -0
- package/dist/{http-D_6rOnzU.js → http-Cu-GPpss.js} +61 -35
- package/dist/http-Cu-GPpss.js.map +1 -0
- package/dist/{icon-badge-DZF-YjQp.js → icon-badge-B0Kq7wom.js} +3 -3
- package/dist/{icon-badge-DZF-YjQp.js.map → icon-badge-B0Kq7wom.js.map} +1 -1
- package/dist/index.js +6 -6
- package/dist/inline-gutter-context-CSqmrMFZ.js +11 -0
- package/dist/inline-gutter-context-CSqmrMFZ.js.map +1 -0
- package/dist/{input-DMBwAZmr.js → input-2YrgTUrz.js} +3 -3
- package/dist/{input-DMBwAZmr.js.map → input-2YrgTUrz.js.map} +1 -1
- package/dist/{input-CvyDQlY7.js → input-DfJyrjoR.js} +7 -7
- package/dist/{input-CvyDQlY7.js.map → input-DfJyrjoR.js.map} +1 -1
- package/dist/{interaction-recipes-XR9ZpVYL.js → interaction-recipes-DmuS1ase.js} +2 -2
- package/dist/{interaction-recipes-XR9ZpVYL.js.map → interaction-recipes-DmuS1ase.js.map} +1 -1
- package/dist/item-GJ9mvCcg.js +279 -0
- package/dist/item-GJ9mvCcg.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 +2 -2
- package/dist/layout/settings.js +2 -2
- package/dist/layout/sidebar.js +3 -3
- package/dist/layout/workspace.js +1 -1
- package/dist/layout.js +12 -12
- package/dist/layout.types-DbtnyAtd.js +33 -0
- package/dist/layout.types-DbtnyAtd.js.map +1 -0
- package/dist/lib/anchored-positioning.d.ts +11 -0
- package/dist/lib/field-affordance-recipes.d.ts +10 -0
- package/dist/lib/field-control-attributes.d.ts +11 -0
- package/dist/lib/field-state-recipes.d.ts +8 -0
- package/dist/lib/focus-recipes.d.ts +7 -0
- package/dist/lib/format.d.ts +26 -0
- package/dist/lib/money-format.d.ts +6 -0
- package/dist/lib/motion-recipes.d.ts +6 -0
- package/dist/lib/surface-recipes.d.ts +33 -3
- package/dist/lib/theme-scope.d.ts +17 -1
- package/dist/lib/token-merge.generated.d.ts +19 -25
- package/dist/lib/ui-provider/index.d.ts +1 -1
- package/dist/lib/ui-provider/types.d.ts +5 -0
- package/dist/lib/use-controllable-state.d.ts +16 -0
- package/dist/lib/use-copy-feedback.d.ts +15 -0
- package/dist/lib/utils.js +1 -1
- package/dist/lib/variant-props.d.ts +9 -0
- package/dist/main-landmark-context-BAsyqp2I.js +11 -0
- package/dist/main-landmark-context-BAsyqp2I.js.map +1 -0
- package/dist/mentions-zz0ewNIq.js +670 -0
- package/dist/mentions-zz0ewNIq.js.map +1 -0
- package/dist/message-BiiVrRrm.js +138 -0
- package/dist/message-BiiVrRrm.js.map +1 -0
- package/dist/{metadata-list-C3MkU-Om.js → metadata-list-G85roWjS.js} +13 -12
- package/dist/metadata-list-G85roWjS.js.map +1 -0
- package/dist/{motion-recipes-DitYv6P2.js → motion-recipes-CUc_aHuG.js} +7 -4
- package/dist/motion-recipes-CUc_aHuG.js.map +1 -0
- package/dist/navigation-C0Be5C3i.js +304 -0
- package/dist/navigation-C0Be5C3i.js.map +1 -0
- package/dist/navigation-CmqaQR_G.js +257 -0
- package/dist/navigation-CmqaQR_G.js.map +1 -0
- package/dist/normalize-layout-path-BmEgg6fu.js +14 -0
- package/dist/normalize-layout-path-BmEgg6fu.js.map +1 -0
- package/dist/number-NFWKIoiK.js +340 -0
- package/dist/number-NFWKIoiK.js.map +1 -0
- package/dist/{overflow-tab-bar-IVFVQFV6.js → overflow-tab-bar-DV7HE_3t.js} +8 -8
- package/dist/{overflow-tab-bar-IVFVQFV6.js.map → overflow-tab-bar-DV7HE_3t.js.map} +1 -1
- package/dist/{overlays-BSgCtM2v.js → overlays-D-gAIfPF.js} +369 -364
- package/dist/overlays-D-gAIfPF.js.map +1 -0
- package/dist/page-D4pQhgSq.js +216 -0
- package/dist/page-D4pQhgSq.js.map +1 -0
- package/dist/{page-header-commands-7P3sfE9u.js → page-header-commands-elelNOfd.js} +29 -29
- package/dist/{page-header-commands-7P3sfE9u.js.map → page-header-commands-elelNOfd.js.map} +1 -1
- package/dist/{pagination-CgCjElfu.js → pagination-BuSWw1US.js} +22 -23
- package/dist/pagination-BuSWw1US.js.map +1 -0
- package/dist/popover-BpMxbqEK.js +205 -0
- package/dist/popover-BpMxbqEK.js.map +1 -0
- package/dist/{popover-menu-DlnQ2zlR.js → popover-menu-CO-_iiuz.js} +7 -7
- package/dist/{popover-menu-DlnQ2zlR.js.map → popover-menu-CO-_iiuz.js.map} +1 -1
- package/dist/{popover.recipes-DdiEp0rd.js → popover.recipes-BqkdvlZn.js} +3 -4
- package/dist/{popover.recipes-DdiEp0rd.js.map → popover.recipes-BqkdvlZn.js.map} +1 -1
- package/dist/{portal-recipes-BpsV_iRw.js → portal-recipes-BPeS4rGB.js} +2 -2
- package/dist/{portal-recipes-BpsV_iRw.js.map → portal-recipes-BPeS4rGB.js.map} +1 -1
- package/dist/primitives-BlC1lXBr.js +447 -0
- package/dist/primitives-BlC1lXBr.js.map +1 -0
- package/dist/primitives.js +4 -4
- package/dist/{progress-BJhQP9WX.js → progress-RARK8AjB.js} +5 -5
- package/dist/{progress-BJhQP9WX.js.map → progress-RARK8AjB.js.map} +1 -1
- package/dist/receipt-CUf2Vegp.js +114 -0
- package/dist/receipt-CUf2Vegp.js.map +1 -0
- package/dist/rich-text-Cypm9__d.js +44 -0
- package/dist/rich-text-Cypm9__d.js.map +1 -0
- package/dist/rich-text-editor-Z6cQepsA.js +919 -0
- package/dist/rich-text-editor-Z6cQepsA.js.map +1 -0
- package/dist/rich-text-editor-toolbar-DYbRJARB.js +100 -0
- package/dist/rich-text-editor-toolbar-DYbRJARB.js.map +1 -0
- package/dist/rich-text-tree-DdKHIJx4.js +154 -0
- package/dist/rich-text-tree-DdKHIJx4.js.map +1 -0
- package/dist/{scroll-area-B0dB2cBi.js → scroll-area-B9HKbji0.js} +3 -3
- package/dist/{scroll-area-B0dB2cBi.js.map → scroll-area-B9HKbji0.js.map} +1 -1
- package/dist/{separator-Ct_WSWTJ.js → separator-DaDe26sf.js} +3 -3
- package/dist/separator-DaDe26sf.js.map +1 -0
- package/dist/{separator-Bb17I4pu.js → separator-KGsNXt2J.js} +2 -2
- package/dist/{separator-Bb17I4pu.js.map → separator-KGsNXt2J.js.map} +1 -1
- package/dist/services/actions/action-adapters.d.ts +5 -2
- package/dist/services/actions/index.d.ts +1 -1
- package/dist/services/actions.js +2 -2
- package/dist/services/actions.js.map +1 -1
- package/dist/settings-D5j_RJvT.js +160 -0
- package/dist/settings-D5j_RJvT.js.map +1 -0
- package/dist/sheet-B6j_BE9O.js +241 -0
- package/dist/sheet-B6j_BE9O.js.map +1 -0
- package/dist/{sidebar-f9gRWXIR.js → sidebar-C-iQ_TJP.js} +379 -350
- package/dist/sidebar-C-iQ_TJP.js.map +1 -0
- package/dist/sidebar-D5VO2W8S.js +715 -0
- package/dist/sidebar-D5VO2W8S.js.map +1 -0
- package/dist/{skeleton-BapcJd9C.js → skeleton-Cab_KgVo.js} +13 -13
- package/dist/skeleton-Cab_KgVo.js.map +1 -0
- package/dist/{smart-card-CW0hjetE.js → smart-card-C59z6KFO.js} +217 -210
- package/dist/smart-card-C59z6KFO.js.map +1 -0
- package/dist/{structure-DuxKl954.js → structure-DElaQwwN.js} +2 -2
- package/dist/{structure-DuxKl954.js.map → structure-DElaQwwN.js.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{surface-recipes-BKRVW8Os.js → surface-recipes-DV6rrOFq.js} +11 -3
- package/dist/surface-recipes-DV6rrOFq.js.map +1 -0
- package/dist/table-CSRUgpdK.js +180 -0
- package/dist/table-CSRUgpdK.js.map +1 -0
- package/dist/table-DdXDBsR_.js +1657 -0
- package/dist/table-DdXDBsR_.js.map +1 -0
- package/dist/tabs-WnHfV2pM.js +192 -0
- package/dist/tabs-WnHfV2pM.js.map +1 -0
- package/dist/{text-inputs-B1culiSK.js → text-inputs-ljyBYaCd.js} +112 -112
- package/dist/text-inputs-ljyBYaCd.js.map +1 -0
- package/dist/theme.css +21 -5
- package/dist/timelines-mOmS9Eh3.js +479 -0
- package/dist/timelines-mOmS9Eh3.js.map +1 -0
- package/dist/tooltip-yjX-Uv-p.js +112 -0
- package/dist/tooltip-yjX-Uv-p.js.map +1 -0
- package/dist/{tree-CzUJHnFs.js → tree-YpkxUG2Z.js} +80 -72
- package/dist/tree-YpkxUG2Z.js.map +1 -0
- package/dist/typography/rich-text.js +1 -1
- package/dist/{typography-BQnine1k.js → typography-C0dELqYV.js} +46 -40
- package/dist/typography-C0dELqYV.js.map +1 -0
- package/dist/typography.js +1 -1
- package/dist/{ui-provider-C-74NVLc.js → ui-provider-Bu1S-o96.js} +4 -3
- package/dist/ui-provider-Bu1S-o96.js.map +1 -0
- package/dist/ui-provider.js +2 -2
- package/dist/upload-DMuMYJFT.js +875 -0
- package/dist/upload-DMuMYJFT.js.map +1 -0
- package/dist/{usage-card-BeSLY0i0.js → usage-card-DDPki5P1.js} +57 -54
- package/dist/usage-card-DDPki5P1.js.map +1 -0
- package/dist/use-controllable-state-BlP8SyBI.js +13 -0
- package/dist/use-controllable-state-BlP8SyBI.js.map +1 -0
- package/dist/use-copy-feedback-CzcaqlLf.js +28 -0
- package/dist/use-copy-feedback-CzcaqlLf.js.map +1 -0
- package/dist/use-metric-format-options-Dk4rC1NO.js +251 -0
- package/dist/use-metric-format-options-Dk4rC1NO.js.map +1 -0
- package/dist/{utils-B6kKb8jB.js → utils-BVbAG2J6.js} +128 -112
- package/dist/utils-BVbAG2J6.js.map +1 -0
- package/dist/value-inputs-h5MwjGCo.js +982 -0
- package/dist/value-inputs-h5MwjGCo.js.map +1 -0
- package/dist/value-typography-D15uwfj-.js +154 -0
- package/dist/value-typography-D15uwfj-.js.map +1 -0
- package/dist/workspace-DIryPqBt.js +400 -0
- package/dist/workspace-DIryPqBt.js.map +1 -0
- package/docs/consumer-skill/SKILL.md +7 -0
- package/docs/consumer-skill/agents/themelia-ui-designer.md +11 -2
- package/docs/consumer-skill/examples/analytics.tsx +1 -1
- package/docs/consumer-skill/examples/app-layout.tsx +3 -3
- package/docs/consumer-skill/examples/commerce-lines.tsx +7 -5
- package/docs/consumer-skill/examples/detail.tsx +3 -2
- package/docs/consumer-skill/examples/edit.tsx +3 -3
- package/docs/consumer-skill/examples/email-composer.tsx +1 -1
- package/docs/consumer-skill/examples/index-table.tsx +2 -2
- package/docs/consumer-skill/examples/scoped-directory.tsx +7 -6
- package/docs/consumer-skill/references/agents-md.md +27 -23
- package/docs/consumer-skill/references/analytics.md +33 -4
- package/docs/consumer-skill/references/building-views.md +213 -0
- package/docs/consumer-skill/references/catalogue.md +617 -0
- package/docs/consumer-skill/references/component-contracts.json +25852 -32067
- package/docs/consumer-skill/references/composition.md +42 -21
- package/docs/consumer-skill/references/design-contract.md +1 -0
- package/docs/consumer-skill/references/discovery.md +8 -5
- package/docs/consumer-skill/references/installation.md +59 -10
- package/docs/consumer-skill/references/integration.md +28 -5
- package/docs/consumer-skill/references/product-composition.md +2 -2
- package/docs/consumer-skill/references/public-api.json +726 -641
- package/docs/consumer-skill/references/review.md +57 -15
- package/docs/consumer-skill/references/rhf-workflows.md +72 -0
- package/docs/consumer-skill/references/screen-archetypes.md +2 -2
- package/docs/consumer-skill/references/theming.md +8 -3
- package/docs/consumer-skill/references/tokens.json +4 -4
- package/docs/consumer-skill/references/workflows.md +7 -7
- package/docs/consumer-skill/scripts/composition-policy.mjs +178 -44
- package/docs/consumer-skill/scripts/composition.mjs +4 -1
- package/docs/consumer-skill/scripts/discovery.mjs +3 -1
- package/docs/consumer-skill/scripts/setup-skills.mjs +74 -10
- package/docs/consumer-skills/themelia-components/SKILL.md +8 -4
- package/docs/consumer-skills/themelia-composition/SKILL.md +7 -3
- package/docs/consumer-skills/themelia-design/SKILL.md +7 -1
- package/docs/consumer-skills/themelia-tokenization/SKILL.md +1 -1
- package/package.json +12 -13
- package/templates/README.md +3 -2
- package/templates/admin-shell-template.tsx +50 -11
- package/templates/analytics-operations-template.tsx +20 -24
- package/templates/customers-template.tsx +30 -25
- package/templates/index.ts +2 -8
- package/templates/orders-template.tsx +28 -24
- package/templates/products-template.tsx +14 -4
- package/templates/user-permissions-template.tsx +11 -14
- package/dist/accordion-B9MHG0cT.js.map +0 -1
- package/dist/action-menu-Dr8K-ghE.js +0 -284
- package/dist/action-menu-Dr8K-ghE.js.map +0 -1
- package/dist/ai-artifact-C58tQcBy.js +0 -1185
- package/dist/ai-artifact-C58tQcBy.js.map +0 -1
- package/dist/anchored-positioning-DPnKTvNs.js +0 -6
- package/dist/anchored-positioning-DPnKTvNs.js.map +0 -1
- package/dist/app-shell-B_IuNWOo.js +0 -321
- package/dist/app-shell-B_IuNWOo.js.map +0 -1
- package/dist/auth-DTkkshS8.js.map +0 -1
- package/dist/badge-xIiV_E7f.js.map +0 -1
- package/dist/base/sheet.js +0 -3
- package/dist/breadcrumbs-J-K2kl4c.js +0 -129
- package/dist/breadcrumbs-J-K2kl4c.js.map +0 -1
- package/dist/button-S2Cubiiz.js.map +0 -1
- package/dist/buttons-BedGfygC.js.map +0 -1
- package/dist/cascader-B1MiqkBq.js +0 -439
- package/dist/cascader-B1MiqkBq.js.map +0 -1
- package/dist/choice-inputs-zUgBZfE4.js.map +0 -1
- package/dist/code-block-BzmM9Eig.js.map +0 -1
- package/dist/collapsible-BkAI_XD4.js +0 -81
- package/dist/collapsible-BkAI_XD4.js.map +0 -1
- package/dist/combobox-BEx0vJgF.js +0 -362
- package/dist/combobox-BEx0vJgF.js.map +0 -1
- package/dist/combobox-BwzoXFSG.js +0 -884
- package/dist/combobox-BwzoXFSG.js.map +0 -1
- package/dist/command-CrlPIL6m.js +0 -425
- package/dist/command-CrlPIL6m.js.map +0 -1
- package/dist/comments-Dmpp0YIc.js +0 -1169
- package/dist/comments-Dmpp0YIc.js.map +0 -1
- package/dist/components/base/buttons/tooltip-button.d.ts +0 -7
- package/dist/components/base/display/content-block.d.ts +0 -75
- package/dist/components/base/display/content-block.strings.d.ts +0 -5
- package/dist/components/base/sheet/index.d.ts +0 -29
- package/dist/components/blocks/ai/use-copy-feedback.d.ts +0 -6
- package/dist/components/blocks/data-display/metadata/index.d.ts +0 -30
- package/dist/components/features/mentions/utils/split-html-by-mentions.d.ts +0 -16
- package/dist/components/features/resource/resource.strings.d.ts +0 -12
- package/dist/components/features/rich-text-editor/partials/rich-text-editor-fallback.d.ts +0 -8
- package/dist/components/features/sync/index.d.ts +0 -26
- package/dist/components/features/sync/sync-range-dialog-form.d.ts +0 -5
- package/dist/components/features/sync/sync.strings.d.ts +0 -18
- package/dist/components/features/sync/sync.types.d.ts +0 -44
- package/dist/components/layout/page/partials/page-actions.d.ts +0 -3
- package/dist/components/ui/slot.d.ts +0 -6
- package/dist/containers-CIxwbZt5.js.map +0 -1
- package/dist/data-display-BdgCAw8T.js.map +0 -1
- package/dist/date-Cq8ioE4o.js +0 -144
- package/dist/date-Cq8ioE4o.js.map +0 -1
- package/dist/date-picker-RlIzKom_.js +0 -1551
- package/dist/date-picker-RlIzKom_.js.map +0 -1
- package/dist/date-pickers-DY-CpXS1.js +0 -179
- package/dist/date-pickers-DY-CpXS1.js.map +0 -1
- package/dist/display-KsZLw9Ov.js.map +0 -1
- package/dist/features/sync.js +0 -142
- package/dist/features/sync.js.map +0 -1
- package/dist/feedback-Dm4izqFn.js +0 -240
- package/dist/feedback-Dm4izqFn.js.map +0 -1
- package/dist/field-affordance-recipes-DWcNcOjh.js.map +0 -1
- package/dist/field-state-recipes-BVA2CWHo.js +0 -12
- package/dist/field-state-recipes-BVA2CWHo.js.map +0 -1
- package/dist/filters-DzgSJpMK.js +0 -2257
- package/dist/filters-DzgSJpMK.js.map +0 -1
- package/dist/focus-recipes-B653VaLq.js.map +0 -1
- package/dist/form-field-BriWAXyg.js +0 -63
- package/dist/form-field-BriWAXyg.js.map +0 -1
- package/dist/forms-C0RGnJTe.js.map +0 -1
- package/dist/forms-numeric-DIhghX1Q.js +0 -910
- package/dist/forms-numeric-DIhghX1Q.js.map +0 -1
- package/dist/header-DMMxG__r.js.map +0 -1
- package/dist/hooks-DB6CJ4MR.js.map +0 -1
- package/dist/http-D_6rOnzU.js.map +0 -1
- package/dist/item-DjCcM18E.js +0 -277
- package/dist/item-DjCcM18E.js.map +0 -1
- package/dist/layout.types-Cn7aUzJp.js +0 -20
- package/dist/layout.types-Cn7aUzJp.js.map +0 -1
- package/dist/media-gallery-C-vChPmE.js +0 -203
- package/dist/media-gallery-C-vChPmE.js.map +0 -1
- package/dist/mentions-0_4nWuI-.js +0 -570
- package/dist/mentions-0_4nWuI-.js.map +0 -1
- package/dist/message-g8p7eVtN.js +0 -128
- package/dist/message-g8p7eVtN.js.map +0 -1
- package/dist/metadata-list-C3MkU-Om.js.map +0 -1
- package/dist/motion-recipes-DitYv6P2.js.map +0 -1
- package/dist/navigation-C90-oQFq.js +0 -255
- package/dist/navigation-C90-oQFq.js.map +0 -1
- package/dist/navigation-DaRjthVk.js +0 -288
- package/dist/navigation-DaRjthVk.js.map +0 -1
- package/dist/number-CRU3kGuk.js +0 -354
- package/dist/number-CRU3kGuk.js.map +0 -1
- package/dist/overlays-BSgCtM2v.js.map +0 -1
- package/dist/page-DUUKDAjo.js +0 -331
- package/dist/page-DUUKDAjo.js.map +0 -1
- package/dist/pagination-CgCjElfu.js.map +0 -1
- package/dist/popover-B85RenIl.js +0 -201
- package/dist/popover-B85RenIl.js.map +0 -1
- package/dist/primitives-ByWgGUgt.js +0 -380
- package/dist/primitives-ByWgGUgt.js.map +0 -1
- package/dist/receipt-tOc7B3hw.js +0 -116
- package/dist/receipt-tOc7B3hw.js.map +0 -1
- package/dist/rich-text-Dth5E882.js +0 -78
- package/dist/rich-text-Dth5E882.js.map +0 -1
- package/dist/rich-text-editor-C1fOjBTd.js +0 -1195
- package/dist/rich-text-editor-C1fOjBTd.js.map +0 -1
- package/dist/rich-text-editor-toolbar-laT3tpBT.js +0 -98
- package/dist/rich-text-editor-toolbar-laT3tpBT.js.map +0 -1
- package/dist/sanitize-html-DsQmI48u.js +0 -92
- package/dist/sanitize-html-DsQmI48u.js.map +0 -1
- package/dist/separator-Ct_WSWTJ.js.map +0 -1
- package/dist/settings-Bar5wiSo.js +0 -167
- package/dist/settings-Bar5wiSo.js.map +0 -1
- package/dist/sheet-BGPERY55.js +0 -250
- package/dist/sheet-BGPERY55.js.map +0 -1
- package/dist/sidebar-D-JYMMbY.js +0 -686
- package/dist/sidebar-D-JYMMbY.js.map +0 -1
- package/dist/sidebar-f9gRWXIR.js.map +0 -1
- package/dist/skeleton-BapcJd9C.js.map +0 -1
- package/dist/slot-CLF9kLrS.js +0 -16
- package/dist/slot-CLF9kLrS.js.map +0 -1
- package/dist/smart-card-CW0hjetE.js.map +0 -1
- package/dist/surface-recipes-BKRVW8Os.js.map +0 -1
- package/dist/table-B4TE7iOV.js +0 -175
- package/dist/table-B4TE7iOV.js.map +0 -1
- package/dist/table-CFOWY9pQ.js +0 -1536
- package/dist/table-CFOWY9pQ.js.map +0 -1
- package/dist/tabs-e7ko9S2o.js +0 -191
- package/dist/tabs-e7ko9S2o.js.map +0 -1
- package/dist/text-inputs-B1culiSK.js.map +0 -1
- package/dist/timelines-D3Sl9ueq.js +0 -458
- package/dist/timelines-D3Sl9ueq.js.map +0 -1
- package/dist/tooltip-8wz5S_Zr.js +0 -113
- package/dist/tooltip-8wz5S_Zr.js.map +0 -1
- package/dist/tree-CzUJHnFs.js.map +0 -1
- package/dist/typography-BQnine1k.js.map +0 -1
- package/dist/ui-provider-C-74NVLc.js.map +0 -1
- package/dist/upload-BOW6U2tI.js +0 -855
- package/dist/upload-BOW6U2tI.js.map +0 -1
- package/dist/upload-queue-qUXn1ykN.js +0 -409
- package/dist/upload-queue-qUXn1ykN.js.map +0 -1
- package/dist/usage-card-BeSLY0i0.js.map +0 -1
- package/dist/utils-B6kKb8jB.js.map +0 -1
- package/dist/value-inputs-skdVB2zh.js +0 -980
- package/dist/value-inputs-skdVB2zh.js.map +0 -1
- package/dist/value-typography-uAmWUAL1.js +0 -116
- package/dist/value-typography-uAmWUAL1.js.map +0 -1
- package/dist/workspace-DHeHv0qw.js +0 -411
- package/dist/workspace-DHeHv0qw.js.map +0 -1
|
@@ -1,35 +1,40 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { C as e, f as t } from "../ui-provider-Bu1S-o96.js";
|
|
3
3
|
import { useStrings as n } from "../lib/strings.js";
|
|
4
|
-
import { t as r } from "../utils-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { r as c, t as l } from "../structure-
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { t as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import { t as
|
|
18
|
-
import { t as
|
|
19
|
-
import { t as
|
|
20
|
-
import { t as
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import { t as
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
4
|
+
import { t as r } from "../utils-BVbAG2J6.js";
|
|
5
|
+
import { c as i, o as a } from "../typography-C0dELqYV.js";
|
|
6
|
+
import { t as o } from "../focus-recipes-DSkiUvUp.js";
|
|
7
|
+
import { n as s } from "../buttons-pZVgPTZn.js";
|
|
8
|
+
import { r as c, t as l } from "../structure-DElaQwwN.js";
|
|
9
|
+
import { c as u, o as d } from "../surface-recipes-DV6rrOFq.js";
|
|
10
|
+
import { f, m as p, r as m } from "../smart-card-C59z6KFO.js";
|
|
11
|
+
import { n as h, t as g } from "../feedback-DmqmXKLn.js";
|
|
12
|
+
import { t as _ } from "../progress-RARK8AjB.js";
|
|
13
|
+
import { n as v, t as y } from "../composition.recipes-COdiFhxB.js";
|
|
14
|
+
import { n as b } from "../action-menu-D5343RwT.js";
|
|
15
|
+
import { r as x, t as S } from "../overlays-D-gAIfPF.js";
|
|
16
|
+
import { t as C } from "../interaction-recipes-DmuS1ase.js";
|
|
17
|
+
import { a as ee, i as w, t as te } from "../primitives-BlC1lXBr.js";
|
|
18
|
+
import { n as T, t as ne } from "../number-NFWKIoiK.js";
|
|
19
|
+
import { r as E, s as D, t as O } from "../date-3qsCE1ID.js";
|
|
20
|
+
import { t as k } from "../badge-oGiXblW7.js";
|
|
21
|
+
import { t as re } from "../batch-action-bar-D6MZQNnC.js";
|
|
22
|
+
import { t as ie } from "../input-DfJyrjoR.js";
|
|
23
|
+
import { t as A } from "../form-field-BdfCwSoQ.js";
|
|
24
|
+
import { c as j, l as M } from "../choice-inputs-oJEsrb5Y.js";
|
|
25
|
+
import { r as ae, t as oe } from "../control-group-recipes-fMuFo0H7.js";
|
|
26
|
+
import { t as se } from "../upload.recipes-BbxTqrCT.js";
|
|
27
|
+
import { t as N } from "../metadata-list-G85roWjS.js";
|
|
28
|
+
import { i as P, n as ce, r as le, t as ue } from "../tabs-WnHfV2pM.js";
|
|
29
|
+
import { t as de } from "../dropzone-CHBNK3de.js";
|
|
30
|
+
import { s as fe } from "../upload-DMuMYJFT.js";
|
|
31
|
+
import { s as F } from "../data-display-CWe9SOYh.js";
|
|
32
|
+
import { createContext as pe, useCallback as I, useContext as me, useEffect as L, useMemo as R, useRef as z, useState as B } from "react";
|
|
33
|
+
import { Fragment as he, jsx as V, jsxs as H } from "react/jsx-runtime";
|
|
34
|
+
import { ArrowLeft as ge, ArrowRight as _e, Check as ve, File as ye, Grid2X2 as be, ImageIcon as xe, ImagePlus as Se, Info as Ce, Layers3 as we, LayoutList as Te, Lock as Ee, Play as De, Plus as Oe, Search as ke, Star as Ae, Trash2 as je, UploadCloud as Me, Video as Ne, X as Pe } from "lucide-react";
|
|
35
|
+
import { createPortal as Fe } from "react-dom";
|
|
31
36
|
//#region src/components/features/media-library/media-library.strings.ts
|
|
32
|
-
var
|
|
37
|
+
var U = {
|
|
33
38
|
title: "Add media",
|
|
34
39
|
description: "Pick from the library, or upload new files.",
|
|
35
40
|
close: "Close media library",
|
|
@@ -55,8 +60,8 @@ var Ce = {
|
|
|
55
60
|
gridView: "Grid view",
|
|
56
61
|
tableView: "Table view",
|
|
57
62
|
countAll: "{count} {count, plural, one {item} other {items}}",
|
|
58
|
-
countFiltered: "{count} of {total} items",
|
|
59
|
-
countSearch: "{count} of {total} items for \"{query}\"",
|
|
63
|
+
countFiltered: "{count} of {total} {total, plural, one {item} other {items}}",
|
|
64
|
+
countSearch: "{count} of {total} {total, plural, one {item} other {items}} for \"{query}\"",
|
|
60
65
|
activeSearchLabel: "Search",
|
|
61
66
|
resultsLabel: "Media results",
|
|
62
67
|
emptyLibraryTitle: "Library is empty",
|
|
@@ -69,12 +74,13 @@ var Ce = {
|
|
|
69
74
|
errorTitle: "Media could not load",
|
|
70
75
|
errorDescription: "Check your connection, then try again.",
|
|
71
76
|
retry: "Try again",
|
|
77
|
+
loadMore: "Load more",
|
|
78
|
+
loadingMore: "Loading more...",
|
|
79
|
+
loadMoreError: "Could not load more media.",
|
|
72
80
|
cardDetails: "Details for {name}",
|
|
73
81
|
selectMode: "Select",
|
|
74
82
|
selectItem: "Select {name}",
|
|
75
83
|
batchActionsLabel: "Batch actions",
|
|
76
|
-
privateLabel: "Private",
|
|
77
|
-
publicLabel: "Public",
|
|
78
84
|
typeImage: "Image",
|
|
79
85
|
typeVideo: "Video",
|
|
80
86
|
typeFile: "File",
|
|
@@ -105,11 +111,17 @@ var Ce = {
|
|
|
105
111
|
usedIn: "Used in",
|
|
106
112
|
replace: "Replace file",
|
|
107
113
|
delete: "Delete",
|
|
108
|
-
close: "Close details"
|
|
114
|
+
close: "Close details",
|
|
115
|
+
mutationError: "Could not change this asset. Try again.",
|
|
116
|
+
confirmDeleteTitle: "Delete media?",
|
|
117
|
+
confirmDeleteDescription: "{name} will be removed from this library.",
|
|
118
|
+
confirmDeleteLabel: "Delete asset",
|
|
119
|
+
confirmDeleteError: "Could not delete this asset. Try again.",
|
|
120
|
+
noCollection: "No collection"
|
|
109
121
|
},
|
|
110
122
|
upload: {
|
|
111
123
|
dropTitle: "Drag files here or click to browse",
|
|
112
|
-
dropHint: "JPG, PNG, WebP, SVG and MP4
|
|
124
|
+
dropHint: "JPG, PNG, WebP, SVG and MP4",
|
|
113
125
|
dragOver: "Release to stage files",
|
|
114
126
|
collection: "Collection",
|
|
115
127
|
tags: "Tags",
|
|
@@ -120,7 +132,14 @@ var Ce = {
|
|
|
120
132
|
stagedCount: "{count} {count, plural, one {file} other {files}}",
|
|
121
133
|
removeFile: "Remove {name}",
|
|
122
134
|
uploading: "Uploading",
|
|
123
|
-
done: "Done"
|
|
135
|
+
done: "Done",
|
|
136
|
+
error: "Could not upload these files. Try again.",
|
|
137
|
+
noCollection: "No collection",
|
|
138
|
+
fileFailed: "Upload failed",
|
|
139
|
+
unsupportedType: "{name} is not an accepted file type.",
|
|
140
|
+
tooLarge: "{name} is larger than {size}.",
|
|
141
|
+
tooMany: "Only {count} {count, plural, one {file} other {files}} can be staged at once.",
|
|
142
|
+
sizeLimitHint: "Up to {size} per file"
|
|
124
143
|
},
|
|
125
144
|
footer: {
|
|
126
145
|
pickOne: "Pick one item",
|
|
@@ -128,7 +147,7 @@ var Ce = {
|
|
|
128
147
|
selectedCount: "{count} selected",
|
|
129
148
|
clear: "Clear",
|
|
130
149
|
cancel: "Cancel",
|
|
131
|
-
confirmEmpty: "Add
|
|
150
|
+
confirmEmpty: "Add items",
|
|
132
151
|
confirmOne: "Add 1 item",
|
|
133
152
|
confirmMany: "Add {count} items",
|
|
134
153
|
noFiles: "No files staged",
|
|
@@ -145,27 +164,46 @@ var Ce = {
|
|
|
145
164
|
addTile: "Add another media item",
|
|
146
165
|
cover: "Cover",
|
|
147
166
|
primary: "Primary",
|
|
148
|
-
setPrimary: "Set primary",
|
|
149
|
-
remove: "Remove",
|
|
150
|
-
movePrevious: "Move
|
|
151
|
-
moveNext: "Move
|
|
167
|
+
setPrimary: "Set {name} as primary",
|
|
168
|
+
remove: "Remove {name}",
|
|
169
|
+
movePrevious: "Move {name} earlier",
|
|
170
|
+
moveNext: "Move {name} later",
|
|
152
171
|
itemPosition: "{index} of {total}",
|
|
153
|
-
maxReached: "Maximum reached"
|
|
172
|
+
maxReached: "Maximum reached",
|
|
173
|
+
itemActions: "Actions for {name}",
|
|
174
|
+
setCoverAction: "Set as cover",
|
|
175
|
+
movePreviousAction: "Move earlier",
|
|
176
|
+
moveNextAction: "Move later"
|
|
154
177
|
}
|
|
155
178
|
};
|
|
156
|
-
function
|
|
179
|
+
function W(e, t) {
|
|
157
180
|
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] ?? ""));
|
|
158
181
|
}
|
|
159
182
|
//#endregion
|
|
160
183
|
//#region src/components/features/media-library/hooks/use-media-library.ts
|
|
161
|
-
var
|
|
184
|
+
var Ie = {
|
|
162
185
|
collection: void 0,
|
|
163
186
|
tags: [],
|
|
164
187
|
public: !0
|
|
165
|
-
},
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
188
|
+
}, Le = [], Re = "image/*,video/*", ze = "Upload failed", Be = 48, Ve = {
|
|
189
|
+
page: 1,
|
|
190
|
+
hasMore: !1
|
|
191
|
+
};
|
|
192
|
+
function He(e, t) {
|
|
193
|
+
return {
|
|
194
|
+
page: e,
|
|
195
|
+
cursor: t.nextCursor,
|
|
196
|
+
hasMore: t.hasMore ?? t.nextCursor != null
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
var Ue = {
|
|
200
|
+
"invalid-type": "type",
|
|
201
|
+
"too-large": "size",
|
|
202
|
+
"too-many": "count"
|
|
203
|
+
};
|
|
204
|
+
function We(e, t, n) {
|
|
205
|
+
let [r, i] = B(t), a = e ?? r;
|
|
206
|
+
return [a, I((t) => {
|
|
169
207
|
let r = typeof t == "function" ? t(a) : t;
|
|
170
208
|
e === void 0 && i(r), n?.(r);
|
|
171
209
|
}, [
|
|
@@ -174,7 +212,7 @@ function U(e, t, n) {
|
|
|
174
212
|
a
|
|
175
213
|
])];
|
|
176
214
|
}
|
|
177
|
-
var
|
|
215
|
+
var Ge = {
|
|
178
216
|
getId: (e) => e.id,
|
|
179
217
|
getName: (e) => e.name,
|
|
180
218
|
getType: (e) => e.type,
|
|
@@ -192,47 +230,91 @@ var Ee = {
|
|
|
192
230
|
getTint: (e) => e.tint,
|
|
193
231
|
getMimeType: (e) => e.mimeType
|
|
194
232
|
};
|
|
195
|
-
function
|
|
233
|
+
function Ke(e) {
|
|
196
234
|
return {
|
|
197
|
-
...
|
|
235
|
+
...Ge,
|
|
198
236
|
...e
|
|
199
237
|
};
|
|
200
238
|
}
|
|
201
|
-
function
|
|
202
|
-
return
|
|
239
|
+
function qe(e) {
|
|
240
|
+
return ee(e) ?? "";
|
|
203
241
|
}
|
|
204
|
-
function
|
|
242
|
+
function Je(e, t) {
|
|
205
243
|
let n = t.getWidth(e), r = t.getHeight(e);
|
|
206
244
|
return !n || !r ? "" : `${n} x ${r}`;
|
|
207
245
|
}
|
|
208
|
-
function
|
|
246
|
+
function G(e, t) {
|
|
209
247
|
let n = t.getUploadedAt(e);
|
|
210
248
|
if (!n) return 0;
|
|
211
249
|
let r = (n instanceof Date ? n : new Date(n)).getTime();
|
|
212
250
|
return Number.isFinite(r) ? r : 0;
|
|
213
251
|
}
|
|
214
|
-
function
|
|
252
|
+
function K(e) {
|
|
215
253
|
return e.type.startsWith("image/") ? "image" : e.type.startsWith("video/") ? "video" : "file";
|
|
216
254
|
}
|
|
217
|
-
function
|
|
255
|
+
function Ye(e) {
|
|
218
256
|
if (e.type.startsWith("image/") && typeof URL < "u" && typeof URL.createObjectURL == "function") return URL.createObjectURL(e);
|
|
219
257
|
}
|
|
220
|
-
function
|
|
258
|
+
function Xe(e) {
|
|
221
259
|
e && typeof URL < "u" && typeof URL.revokeObjectURL == "function" && URL.revokeObjectURL(e);
|
|
222
260
|
}
|
|
223
|
-
function
|
|
261
|
+
function q(e) {
|
|
224
262
|
return Array.isArray(e) ? {
|
|
225
263
|
items: e,
|
|
226
264
|
total: e.length
|
|
227
265
|
} : e;
|
|
228
266
|
}
|
|
229
|
-
function
|
|
267
|
+
function Ze(e, t) {
|
|
230
268
|
return t && typeof e == "object" && e ? {
|
|
231
269
|
...e,
|
|
232
270
|
...t
|
|
233
271
|
} : e;
|
|
234
272
|
}
|
|
235
|
-
|
|
273
|
+
var Qe = [
|
|
274
|
+
"alt",
|
|
275
|
+
"collection",
|
|
276
|
+
"tags",
|
|
277
|
+
"public"
|
|
278
|
+
];
|
|
279
|
+
function $e(e, t, n) {
|
|
280
|
+
let r = {};
|
|
281
|
+
for (let i of n) i === "alt" ? r.alt = t.getAlt(e) : i === "collection" ? r.collection = t.getCollection(e) : i === "tags" ? r.tags = t.getTags(e) : r.public = t.getPublic(e);
|
|
282
|
+
return r;
|
|
283
|
+
}
|
|
284
|
+
function et(e, t) {
|
|
285
|
+
if (Array.isArray(e) || Array.isArray(t)) {
|
|
286
|
+
let n = Array.isArray(e) ? e : [], r = Array.isArray(t) ? t : [];
|
|
287
|
+
return n.length === r.length && n.every((e, t) => e === r[t]);
|
|
288
|
+
}
|
|
289
|
+
return e === t;
|
|
290
|
+
}
|
|
291
|
+
function tt(e, t) {
|
|
292
|
+
return e === t || e.length === t.length && e.every((e, n) => e === t[n]);
|
|
293
|
+
}
|
|
294
|
+
function nt(e, t) {
|
|
295
|
+
if (Object.keys(t).length === 0) return e;
|
|
296
|
+
let n = (n) => t[e.getId(n)];
|
|
297
|
+
return {
|
|
298
|
+
...e,
|
|
299
|
+
getAlt: (t) => {
|
|
300
|
+
let r = n(t);
|
|
301
|
+
return r && "alt" in r ? r.alt : e.getAlt(t);
|
|
302
|
+
},
|
|
303
|
+
getCollection: (t) => {
|
|
304
|
+
let r = n(t);
|
|
305
|
+
return r && "collection" in r ? r.collection : e.getCollection(t);
|
|
306
|
+
},
|
|
307
|
+
getTags: (t) => {
|
|
308
|
+
let r = n(t);
|
|
309
|
+
return r && "tags" in r ? r.tags ?? [] : e.getTags(t);
|
|
310
|
+
},
|
|
311
|
+
getPublic: (t) => {
|
|
312
|
+
let r = n(t);
|
|
313
|
+
return r && "public" in r ? r.public : e.getPublic(t);
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
function rt(e, t, n, r, i) {
|
|
236
318
|
let a = n.trim().toLowerCase();
|
|
237
319
|
return e.filter((e) => r !== "all" && t.getType(e) !== r || i !== "all" && t.getCollection(e) !== i ? !1 : !a || [
|
|
238
320
|
t.getName(e),
|
|
@@ -241,326 +323,558 @@ function Ie(e, t, n, r, i) {
|
|
|
241
323
|
...t.getTags(e)
|
|
242
324
|
].filter(Boolean).join(" ").toLowerCase().includes(a));
|
|
243
325
|
}
|
|
244
|
-
function
|
|
326
|
+
function it(e, t, n) {
|
|
245
327
|
let r = e.slice();
|
|
246
|
-
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) =>
|
|
328
|
+
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) => G(n, t) - G(e, t)), r;
|
|
247
329
|
}
|
|
248
|
-
function
|
|
249
|
-
let
|
|
250
|
-
...
|
|
251
|
-
...
|
|
252
|
-
tags:
|
|
253
|
-
}), [
|
|
254
|
-
...
|
|
255
|
-
...
|
|
256
|
-
tags:
|
|
257
|
-
} : void 0, [
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
]),
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
330
|
+
function at({ items: e = Le, fetcher: t, refreshKey: n, pageSize: r = Be, accessors: i, selectionMode: a = "multiple", value: o, defaultValue: s = [], onValueChange: c, onItemUpdate: l, onItemDelete: u, onUpload: d, uploadAccept: f = Re, maxFileSize: p, maxFiles: m, uploadFailedMessage: h = ze, onError: g, tab: _, defaultTab: v = "library", onTabChange: y, view: b, defaultView: x = "grid", onViewChange: S, query: C, defaultQuery: ee = "", onQueryChange: w, type: te, defaultType: T = "all", onTypeChange: ne, collection: E, defaultCollection: D = "all", onCollectionChange: O, sort: k, defaultSort: re = "newest", onSortChange: ie, uploadOptions: A, defaultUploadOptions: j, onUploadOptionsChange: M, selecting: ae, defaultSelecting: oe = !1, onSelectingChange: se } = {}) {
|
|
331
|
+
let N = !!t, P = R(() => Ke(i), [i]), [ce, le] = We(_, v, y), [ue, de] = We(b, x, S), [F, pe] = We(C, ee, w), [me, he] = We(te, T, ne), [V, H] = We(E, D, O), [ge, _e] = We(k, re, ie), [ve, ye] = B(null), [be, xe] = B(() => [...s]), [Se, Ce] = B(null), [we, Te] = B(N), [Ee, De] = B(null), [Oe, ke] = B(Ve), [Ae, je] = B(!1), [Me, Ne] = B(null), Pe = z(null), [Fe, U] = B(null), [W, Ge] = B(null), [qe, Je] = B([]), [G, at] = B([]), [ot, st] = B(() => /* @__PURE__ */ new Map()), [J, ct] = B(() => /* @__PURE__ */ new Set()), [Y, lt] = B({}), X = R(() => nt(P, Y), [P, Y]), ut = z(/* @__PURE__ */ new Map()), Z = z(/* @__PURE__ */ new Map()), dt = z(/* @__PURE__ */ new Map()), ft = z(/* @__PURE__ */ new Map()), [pt, mt] = B(0), [ht, gt] = B([]), _t = z(ht), [vt, yt] = B([]), bt = z(0), [xt, St] = B(!1), Ct = R(() => ({
|
|
332
|
+
...Ie,
|
|
333
|
+
...j,
|
|
334
|
+
tags: j?.tags ?? Ie.tags
|
|
335
|
+
}), [j]), [wt, Tt] = We(R(() => A ? {
|
|
336
|
+
...Ie,
|
|
337
|
+
...A,
|
|
338
|
+
tags: A.tags ?? Ie.tags
|
|
339
|
+
} : void 0, [A]), Ct, M), Et = o !== void 0, Q = R(() => Et ? [...o ?? []] : be, [
|
|
340
|
+
be,
|
|
341
|
+
Et,
|
|
342
|
+
o
|
|
343
|
+
]), Dt = R(() => new Set(Q), [Q]), Ot = z(/* @__PURE__ */ new Set()), kt = z(null), At = z(/* @__PURE__ */ new Map()), [jt, Mt] = B(0), Nt = I(() => Mt((e) => e + 1), []), Pt = z({
|
|
344
|
+
fetcher: t,
|
|
345
|
+
onError: g
|
|
346
|
+
});
|
|
347
|
+
L(() => {
|
|
348
|
+
Pt.current = {
|
|
349
|
+
fetcher: t,
|
|
350
|
+
onError: g
|
|
351
|
+
};
|
|
352
|
+
}, [t, g]), L(() => {
|
|
353
|
+
let e = Pt.current.fetcher;
|
|
354
|
+
if (!N || !e) {
|
|
355
|
+
Te(!1), De(null), Ce(null), ke(Ve), at((e) => e.length ? [] : e);
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
let t = new AbortController();
|
|
359
|
+
return Pe.current?.abort(), Pe.current = null, je(!1), Ne(null), Te(!0), De(null), (async () => {
|
|
360
|
+
try {
|
|
361
|
+
let n = await e({
|
|
362
|
+
query: F,
|
|
363
|
+
type: me,
|
|
364
|
+
collection: V === "all" ? void 0 : V,
|
|
365
|
+
sort: ge,
|
|
366
|
+
limit: r,
|
|
367
|
+
page: 1,
|
|
368
|
+
signal: t.signal
|
|
369
|
+
});
|
|
370
|
+
if (t.signal.aborted) return;
|
|
371
|
+
let i = q(n);
|
|
372
|
+
Ce(i), ke(He(1, i));
|
|
373
|
+
} catch (e) {
|
|
374
|
+
if (t.signal.aborted) return;
|
|
375
|
+
De(() => e ?? /* @__PURE__ */ Error("Media load failed")), Pt.current.onError?.(e);
|
|
376
|
+
} finally {
|
|
377
|
+
t.signal.aborted || Te(!1);
|
|
378
|
+
}
|
|
379
|
+
})(), () => t.abort();
|
|
280
380
|
}, [
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
381
|
+
V,
|
|
382
|
+
jt,
|
|
383
|
+
N,
|
|
384
|
+
r,
|
|
385
|
+
F,
|
|
386
|
+
n,
|
|
387
|
+
ge,
|
|
388
|
+
me
|
|
389
|
+
]);
|
|
390
|
+
let Ft = I(async () => {
|
|
391
|
+
let e = Pt.current.fetcher;
|
|
392
|
+
if (!e || !Oe.hasMore || we || Pe.current) return;
|
|
393
|
+
let t = new AbortController();
|
|
394
|
+
Pe.current = t;
|
|
395
|
+
let n = Oe.page + 1;
|
|
396
|
+
je(!0), Ne(null);
|
|
397
|
+
try {
|
|
398
|
+
let i = await e({
|
|
399
|
+
query: F,
|
|
400
|
+
type: me,
|
|
401
|
+
collection: V === "all" ? void 0 : V,
|
|
402
|
+
sort: ge,
|
|
403
|
+
limit: r,
|
|
404
|
+
page: n,
|
|
405
|
+
cursor: Oe.cursor,
|
|
406
|
+
signal: t.signal
|
|
407
|
+
});
|
|
408
|
+
if (t.signal.aborted) return;
|
|
409
|
+
let a = q(i);
|
|
410
|
+
Ce((e) => {
|
|
411
|
+
let t = e?.items ?? [], n = new Set(t.map((e) => P.getId(e))), r = [...t, ...a.items.filter((e) => !n.has(P.getId(e)))];
|
|
412
|
+
return {
|
|
413
|
+
items: r,
|
|
414
|
+
total: Array.isArray(i) ? r.length : a.total ?? e?.total
|
|
415
|
+
};
|
|
416
|
+
}), ke(He(n, a));
|
|
417
|
+
} catch (e) {
|
|
418
|
+
if (t.signal.aborted) return;
|
|
419
|
+
Ne(() => e ?? /* @__PURE__ */ Error("Media load failed")), Pt.current.onError?.(e);
|
|
420
|
+
} finally {
|
|
421
|
+
Pe.current === t && (Pe.current = null, je(!1));
|
|
422
|
+
}
|
|
423
|
+
}, [
|
|
424
|
+
P,
|
|
425
|
+
V,
|
|
426
|
+
we,
|
|
427
|
+
r,
|
|
428
|
+
Oe,
|
|
429
|
+
F,
|
|
430
|
+
ge,
|
|
431
|
+
me
|
|
432
|
+
]);
|
|
433
|
+
L(() => {
|
|
434
|
+
if (!N || !Se) return;
|
|
435
|
+
let e = new Set(Se.items.map((e) => X.getId(e)));
|
|
436
|
+
at((t) => {
|
|
437
|
+
let n = t.filter((t) => !e.has(X.getId(t)));
|
|
438
|
+
return n.length === t.length ? t : n;
|
|
439
|
+
});
|
|
440
|
+
}, [
|
|
441
|
+
X,
|
|
442
|
+
Se,
|
|
443
|
+
N
|
|
444
|
+
]), L(() => {
|
|
445
|
+
let e = Ot.current;
|
|
290
446
|
return () => {
|
|
291
|
-
|
|
292
|
-
for (let t of e)
|
|
447
|
+
kt.current?.abort(), Pe.current?.abort();
|
|
448
|
+
for (let t of e) Xe(t);
|
|
293
449
|
e.clear();
|
|
294
450
|
};
|
|
295
451
|
}, []);
|
|
296
|
-
let
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
452
|
+
let It = Se?.items ?? Le, Lt = R(() => {
|
|
453
|
+
let e = new Set(It.map((e) => X.getId(e)));
|
|
454
|
+
return rt(G.filter((t) => {
|
|
455
|
+
let n = X.getId(t);
|
|
456
|
+
return !e.has(n) && !J.has(n);
|
|
457
|
+
}), X, F, me, V);
|
|
458
|
+
}, [
|
|
459
|
+
X,
|
|
460
|
+
V,
|
|
461
|
+
F,
|
|
462
|
+
J,
|
|
463
|
+
It,
|
|
464
|
+
G,
|
|
465
|
+
me
|
|
466
|
+
]), Rt = R(() => {
|
|
467
|
+
if (N) return [...Lt, ...It];
|
|
468
|
+
if (qe.length === 0) return [...e];
|
|
469
|
+
let t = new Set(e.map((e) => X.getId(e)));
|
|
470
|
+
return [...qe.filter((e) => !t.has(X.getId(e))), ...e];
|
|
471
|
+
}, [
|
|
472
|
+
X,
|
|
473
|
+
qe,
|
|
474
|
+
N,
|
|
475
|
+
e,
|
|
476
|
+
Lt,
|
|
477
|
+
It
|
|
478
|
+
]), zt = N ? It : e, Bt = z({
|
|
479
|
+
sourceItems: Rt,
|
|
480
|
+
suppliedItems: zt
|
|
481
|
+
});
|
|
482
|
+
L(() => {
|
|
483
|
+
Bt.current = {
|
|
484
|
+
sourceItems: Rt,
|
|
485
|
+
suppliedItems: zt
|
|
486
|
+
};
|
|
487
|
+
}, [Rt, zt]), L(() => {
|
|
488
|
+
let e = Y;
|
|
489
|
+
for (let [t, n] of Object.entries(Y)) {
|
|
490
|
+
if (Z.current.has(t)) continue;
|
|
491
|
+
let r = Rt.find((e) => P.getId(e) === t);
|
|
492
|
+
if (r === void 0) continue;
|
|
493
|
+
let i = ut.current.get(t) ?? {}, a = $e(r, P, Qe), o = { ...n }, s = { ...i };
|
|
494
|
+
for (let e of Qe) e in n && (e in i && !et(a[e], i[e]) || et(a[e], n[e])) && (delete o[e], delete s[e]);
|
|
495
|
+
Object.keys(o).length !== Object.keys(n).length && (e === Y && (e = { ...Y }), Object.keys(o).length > 0 ? (e[t] = o, ut.current.set(t, s)) : (delete e[t], ut.current.delete(t)));
|
|
496
|
+
}
|
|
497
|
+
e !== Y && lt(e);
|
|
498
|
+
let t = [];
|
|
499
|
+
for (let [e, n] of ft.current) dt.current.has(e) || J.has(e) && tt(n, zt) || (ft.current.delete(e), J.has(e) && t.push(e));
|
|
500
|
+
t.length > 0 && ct((e) => {
|
|
501
|
+
let n = new Set(e);
|
|
502
|
+
for (let e of t) n.delete(e);
|
|
503
|
+
return n;
|
|
504
|
+
});
|
|
309
505
|
}, [
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
506
|
+
P,
|
|
507
|
+
Y,
|
|
508
|
+
J,
|
|
509
|
+
pt,
|
|
510
|
+
Rt,
|
|
511
|
+
zt
|
|
512
|
+
]);
|
|
513
|
+
let Vt = R(() => Rt.filter((e) => !J.has(X.getId(e))).map((e) => Ze(e, Y[X.getId(e)])), [
|
|
514
|
+
X,
|
|
515
|
+
Y,
|
|
516
|
+
J,
|
|
517
|
+
Rt
|
|
518
|
+
]), Ht = R(() => N ? Vt : it(rt(Vt, X, F, me, V), X, ge), [
|
|
519
|
+
X,
|
|
520
|
+
V,
|
|
521
|
+
N,
|
|
522
|
+
Vt,
|
|
523
|
+
F,
|
|
524
|
+
ge,
|
|
525
|
+
me
|
|
526
|
+
]), Ut = N && Se?.total !== void 0 ? Se.total + Lt.length : Vt.length, Wt = Ht.length, Gt = R(() => new Map([...G, ...It].map((e) => [X.getId(e), e])), [
|
|
527
|
+
X,
|
|
528
|
+
It,
|
|
529
|
+
G
|
|
530
|
+
]);
|
|
531
|
+
L(() => {
|
|
532
|
+
st((e) => {
|
|
533
|
+
let t = /* @__PURE__ */ new Map();
|
|
534
|
+
if (N) for (let n of Q) {
|
|
535
|
+
let r = Gt.get(n) ?? e.get(n);
|
|
536
|
+
r !== void 0 && t.set(n, r);
|
|
537
|
+
}
|
|
538
|
+
return t.size === e.size && [...t].every(([t, n]) => e.get(t) === n) ? e : t;
|
|
539
|
+
});
|
|
325
540
|
}, [
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
541
|
+
N,
|
|
542
|
+
Gt,
|
|
543
|
+
Q
|
|
544
|
+
]);
|
|
545
|
+
let Kt = I((e, t = []) => {
|
|
546
|
+
if (!N) {
|
|
547
|
+
let n = new Set(e);
|
|
548
|
+
return [...t, ...Vt].filter((e) => n.delete(X.getId(e)));
|
|
549
|
+
}
|
|
550
|
+
let n = new Map(t.map((e) => [X.getId(e), e]));
|
|
551
|
+
return e.flatMap((e) => {
|
|
552
|
+
if (J.has(e)) return [];
|
|
553
|
+
let t = n.get(e) ?? Gt.get(e) ?? ot.get(e);
|
|
554
|
+
return t === void 0 ? [] : [Ze(t, Y[e])];
|
|
555
|
+
});
|
|
333
556
|
}, [
|
|
334
|
-
|
|
557
|
+
X,
|
|
558
|
+
N,
|
|
335
559
|
Y,
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
560
|
+
Gt,
|
|
561
|
+
Vt,
|
|
562
|
+
J,
|
|
563
|
+
ot
|
|
564
|
+
]), qt = R(() => Kt(Q), [Kt, Q]), Jt = !!F.trim() || me !== "all" || V !== "all", Yt = I((e, t) => {
|
|
565
|
+
Et || xe(e), c?.(e, Kt(e, t));
|
|
339
566
|
}, [
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
]),
|
|
344
|
-
|
|
567
|
+
Et,
|
|
568
|
+
c,
|
|
569
|
+
Kt
|
|
570
|
+
]), Xt = z({
|
|
571
|
+
applySelection: Yt,
|
|
572
|
+
selectedIds: Q
|
|
573
|
+
});
|
|
574
|
+
L(() => {
|
|
575
|
+
Xt.current = {
|
|
576
|
+
applySelection: Yt,
|
|
577
|
+
selectedIds: Q
|
|
578
|
+
};
|
|
579
|
+
}, [Yt, Q]);
|
|
580
|
+
let Zt = I((e) => {
|
|
581
|
+
let t = new Set(a === "single" ? [] : Dt);
|
|
582
|
+
Dt.has(e) && a !== "single" ? t.delete(e) : t.add(e), Yt(Array.from(t));
|
|
345
583
|
}, [
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
]),
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
584
|
+
Yt,
|
|
585
|
+
Dt,
|
|
586
|
+
a
|
|
587
|
+
]), Qt = I(() => Yt([]), [Yt]), [$t, en] = We(ae, oe, se), tn = $t || Q.length > 0, nn = I((e) => {
|
|
588
|
+
en(e), !e && Q.length > 0 && Yt([]);
|
|
589
|
+
}, [
|
|
590
|
+
Yt,
|
|
591
|
+
Q.length,
|
|
592
|
+
en
|
|
593
|
+
]), rn = I(() => {
|
|
594
|
+
pe(""), he("all"), H("all");
|
|
595
|
+
}, [
|
|
596
|
+
H,
|
|
597
|
+
pe,
|
|
598
|
+
he
|
|
599
|
+
]), $ = I((e) => {
|
|
600
|
+
let t = e(_t.current);
|
|
601
|
+
_t.current = t, gt(t);
|
|
602
|
+
}, []), an = I((e) => {
|
|
603
|
+
e && (Xe(e), Ot.current.delete(e));
|
|
604
|
+
}, []), on = I((e) => {
|
|
605
|
+
if (e.length === 0) return;
|
|
606
|
+
Ge(null);
|
|
607
|
+
let t = fe(e, {
|
|
608
|
+
accept: f.split(",").some((e) => e.trim() === "*/*") ? void 0 : f,
|
|
609
|
+
maxSizeBytes: p,
|
|
610
|
+
maxFiles: m === void 0 ? void 0 : Math.max(0, m - _t.current.length)
|
|
611
|
+
}), n = t.accepted, r = t.rejections.flatMap((e) => {
|
|
612
|
+
let t = Ue[e.code];
|
|
613
|
+
return t ? [{
|
|
614
|
+
name: e.file.name,
|
|
615
|
+
reason: t
|
|
616
|
+
}] : [];
|
|
617
|
+
});
|
|
618
|
+
if (yt(r), n.length === 0) return;
|
|
619
|
+
let i = n.map((e) => {
|
|
620
|
+
let t = Ye(e);
|
|
621
|
+
return t && Ot.current.add(t), {
|
|
622
|
+
id: `staged-${bt.current++}`,
|
|
354
623
|
file: e,
|
|
355
624
|
name: e.name,
|
|
356
625
|
size: e.size,
|
|
357
|
-
type:
|
|
358
|
-
src:
|
|
626
|
+
type: K(e),
|
|
627
|
+
src: t,
|
|
359
628
|
progress: 0,
|
|
360
629
|
status: "staged"
|
|
361
630
|
};
|
|
362
|
-
})]);
|
|
363
|
-
}, []), ot = M((e) => {
|
|
364
|
-
W((t) => {
|
|
365
|
-
let n = t.find((t) => t.id === e);
|
|
366
|
-
return n?.src && (Ne(n.src), He.current.delete(n.src)), t.filter((t) => t.id !== e);
|
|
367
631
|
});
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
632
|
+
$((e) => [...e, ...i]);
|
|
633
|
+
}, [
|
|
634
|
+
p,
|
|
635
|
+
m,
|
|
636
|
+
$,
|
|
637
|
+
f
|
|
638
|
+
]), sn = I((e) => {
|
|
639
|
+
$((t) => (an(t.find((t) => t.id === e)?.src), t.filter((t) => t.id !== e)));
|
|
640
|
+
}, [an, $]), cn = I(() => {
|
|
641
|
+
Ge(null), yt([]), $((e) => {
|
|
642
|
+
for (let t of e) an(t.src);
|
|
371
643
|
return [];
|
|
372
644
|
});
|
|
373
|
-
}, []),
|
|
374
|
-
|
|
645
|
+
}, [an, $]), ln = I((e) => {
|
|
646
|
+
Tt((t) => ({
|
|
375
647
|
...t,
|
|
376
648
|
...e
|
|
377
649
|
}));
|
|
378
|
-
}, [
|
|
379
|
-
|
|
650
|
+
}, [Tt]), un = I((e, t) => {
|
|
651
|
+
$((n) => n.map((n) => n.id === e ? {
|
|
380
652
|
...n,
|
|
381
653
|
...t
|
|
382
654
|
} : n));
|
|
383
|
-
}, [])
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
toggleSelection: Qe,
|
|
405
|
-
clearSelection: $e,
|
|
406
|
-
selecting: nt,
|
|
407
|
-
setSelecting: rt,
|
|
408
|
-
clearFilters: it,
|
|
409
|
-
loading: be,
|
|
410
|
-
error: Se,
|
|
411
|
-
retry: Ke,
|
|
412
|
-
hasFilters: Ze,
|
|
413
|
-
totalCount: Ye,
|
|
414
|
-
filteredCount: Q,
|
|
415
|
-
stagedFiles: Re,
|
|
416
|
-
addFiles: at,
|
|
417
|
-
removeStagedFile: ot,
|
|
418
|
-
clearStagedFiles: st,
|
|
419
|
-
updateUploadOptions: ct,
|
|
420
|
-
uploadOptions: G,
|
|
421
|
-
uploading: ze,
|
|
422
|
-
startUpload: M(async () => {
|
|
423
|
-
if (ze || Re.length === 0) return;
|
|
424
|
-
let e = new AbortController();
|
|
425
|
-
X.current?.abort(), X.current = e, V(null), Be(!0), W((e) => e.map((e) => ({
|
|
426
|
-
...e,
|
|
427
|
-
status: "uploading",
|
|
428
|
-
progress: 0
|
|
429
|
-
})));
|
|
430
|
-
let t = {
|
|
431
|
-
signal: e.signal,
|
|
432
|
-
setProgress: (t, n) => {
|
|
433
|
-
e.signal.aborted || lt(t, { progress: Math.max(0, Math.min(100, n)) });
|
|
434
|
-
},
|
|
435
|
-
setFileStatus: (t, n, r) => {
|
|
436
|
-
e.signal.aborted || lt(t, {
|
|
437
|
-
status: n,
|
|
438
|
-
error: r
|
|
439
|
-
});
|
|
440
|
-
}
|
|
441
|
-
};
|
|
442
|
-
try {
|
|
443
|
-
let n = Re.map((e) => e.file), i = await l?.(n, G, t);
|
|
444
|
-
if (e.signal.aborted) return;
|
|
445
|
-
if (W((e) => e.map((e) => ({
|
|
446
|
-
...e,
|
|
447
|
-
status: "done",
|
|
448
|
-
progress: 100
|
|
449
|
-
}))), i?.length) {
|
|
450
|
-
H((e) => [...i, ...e]);
|
|
451
|
-
let e = i.map((e) => j.getId(e));
|
|
452
|
-
$(r === "single" ? e.slice(0, 1) : Array.from(/* @__PURE__ */ new Set([...e, ...J])));
|
|
453
|
-
}
|
|
454
|
-
st(), se("library");
|
|
455
|
-
} catch (t) {
|
|
456
|
-
if (e.signal.aborted) return;
|
|
457
|
-
V(t), W((e) => e.map((e) => e.status === "uploading" ? {
|
|
458
|
-
...e,
|
|
459
|
-
status: "error",
|
|
460
|
-
error: "Upload failed"
|
|
461
|
-
} : e)), u?.(t);
|
|
462
|
-
} finally {
|
|
463
|
-
X.current === e && (X.current = null, Be(!1));
|
|
655
|
+
}, [$]), dn = I(async () => {
|
|
656
|
+
let e = _t.current;
|
|
657
|
+
if (kt.current || e.length === 0) return;
|
|
658
|
+
let t = e.map((e) => e.id), n = new Set(t), r = new AbortController();
|
|
659
|
+
kt.current = r, Ge(null), St(!0), $((e) => e.map((e) => n.has(e.id) ? {
|
|
660
|
+
...e,
|
|
661
|
+
status: "uploading",
|
|
662
|
+
progress: 0,
|
|
663
|
+
error: void 0
|
|
664
|
+
} : e));
|
|
665
|
+
let i = (e) => !r.signal.aborted && kt.current === r && n.has(e), o = {
|
|
666
|
+
signal: r.signal,
|
|
667
|
+
fileIds: t,
|
|
668
|
+
setProgress: (e, t) => {
|
|
669
|
+
i(e) && un(e, { progress: Math.max(0, Math.min(100, t)) });
|
|
670
|
+
},
|
|
671
|
+
setFileStatus: (e, t, n) => {
|
|
672
|
+
i(e) && un(e, {
|
|
673
|
+
status: t,
|
|
674
|
+
error: n
|
|
675
|
+
});
|
|
464
676
|
}
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
ze
|
|
478
|
-
]),
|
|
479
|
-
cancelUpload: M(() => {
|
|
480
|
-
X.current?.abort(), X.current = null, Be(!1), W((e) => e.map((e) => e.status === "uploading" ? {
|
|
481
|
-
...e,
|
|
482
|
-
status: "staged",
|
|
483
|
-
progress: 0,
|
|
484
|
-
error: void 0
|
|
485
|
-
} : e));
|
|
486
|
-
}, []),
|
|
487
|
-
updateItem: M(async (e, t) => {
|
|
488
|
-
let n = j.getId(e), r = `update:${n}`, i = (Ue.current.get(r) ?? 0) + 1;
|
|
489
|
-
Ue.current.set(r, i);
|
|
490
|
-
let a = ke[n];
|
|
491
|
-
V(null), Ae((e) => ({
|
|
492
|
-
...e,
|
|
493
|
-
[n]: {
|
|
494
|
-
...e[n],
|
|
495
|
-
...t
|
|
496
|
-
}
|
|
497
|
-
}));
|
|
498
|
-
try {
|
|
499
|
-
return await s?.(e, t), !0;
|
|
500
|
-
} catch (e) {
|
|
501
|
-
return Ue.current.get(r) === i && Ae((e) => {
|
|
502
|
-
let t = { ...e };
|
|
503
|
-
return a ? t[n] = a : delete t[n], t;
|
|
504
|
-
}), V(e), u?.(e), !1;
|
|
677
|
+
};
|
|
678
|
+
try {
|
|
679
|
+
let t = e.map((e) => e.file), i = await d?.(t, wt, o);
|
|
680
|
+
if (r.signal.aborted) return;
|
|
681
|
+
if ($((e) => e.filter((e) => !n.has(e.id) || e.status === "error" || (an(e.src), !1))), i?.length) {
|
|
682
|
+
let e = i.map((e) => X.getId(e));
|
|
683
|
+
if (N) {
|
|
684
|
+
let t = new Set(e);
|
|
685
|
+
at((e) => [...i, ...e.filter((e) => !t.has(X.getId(e)))]);
|
|
686
|
+
} else Je((e) => [...i, ...e]);
|
|
687
|
+
let t = Xt.current;
|
|
688
|
+
t.applySelection(a === "single" ? e.slice(0, 1) : Array.from(/* @__PURE__ */ new Set([...e, ...t.selectedIds])), i);
|
|
505
689
|
}
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
690
|
+
N && d && Nt(), _t.current.length === 0 && le("library");
|
|
691
|
+
} catch (e) {
|
|
692
|
+
if (r.signal.aborted) return;
|
|
693
|
+
Ge(() => e ?? /* @__PURE__ */ Error("Media upload failed")), $((e) => e.map((e) => n.has(e.id) && e.status === "uploading" ? {
|
|
694
|
+
...e,
|
|
695
|
+
status: "error",
|
|
696
|
+
error: h
|
|
697
|
+
} : e)), g?.(e);
|
|
698
|
+
} finally {
|
|
699
|
+
kt.current === r && (kt.current = null, St(!1));
|
|
700
|
+
}
|
|
701
|
+
}, [
|
|
702
|
+
X,
|
|
703
|
+
N,
|
|
704
|
+
g,
|
|
705
|
+
d,
|
|
706
|
+
an,
|
|
707
|
+
Nt,
|
|
708
|
+
a,
|
|
709
|
+
le,
|
|
710
|
+
un,
|
|
711
|
+
$,
|
|
712
|
+
h,
|
|
713
|
+
wt
|
|
714
|
+
]), fn = I(() => {
|
|
715
|
+
kt.current?.abort(), kt.current = null, St(!1), $((e) => e.map((e) => e.status === "uploading" ? {
|
|
716
|
+
...e,
|
|
717
|
+
status: "staged",
|
|
718
|
+
progress: 0,
|
|
719
|
+
error: void 0
|
|
720
|
+
} : e));
|
|
721
|
+
}, [$]), pn = I(async (e, t) => {
|
|
722
|
+
if (!l) return !1;
|
|
723
|
+
let n = X.getId(e), r = `update:${n}`, i = (At.current.get(r) ?? 0) + 1;
|
|
724
|
+
At.current.set(r, i);
|
|
725
|
+
let a = Y[n], o = ut.current.get(n), s = Bt.current.sourceItems.find((e) => P.getId(e) === n) ?? e, c = Qe.filter((e) => e in t && !(o && e in o));
|
|
726
|
+
ut.current.set(n, {
|
|
727
|
+
...$e(s, P, c),
|
|
728
|
+
...o
|
|
729
|
+
}), Z.current.set(n, (Z.current.get(n) ?? 0) + 1), U((e) => e?.itemId === n ? null : e), lt((e) => ({
|
|
730
|
+
...e,
|
|
731
|
+
[n]: {
|
|
732
|
+
...e[n],
|
|
733
|
+
...t
|
|
524
734
|
}
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
735
|
+
}));
|
|
736
|
+
try {
|
|
737
|
+
return await l(e, t), !0;
|
|
738
|
+
} catch (e) {
|
|
739
|
+
return At.current.get(r) === i && (U({
|
|
740
|
+
itemId: n,
|
|
741
|
+
operation: "update",
|
|
742
|
+
cause: e
|
|
743
|
+
}), a && o ? ut.current.set(n, o) : ut.current.delete(n), lt((e) => {
|
|
744
|
+
let t = { ...e };
|
|
745
|
+
return a ? t[n] = a : delete t[n], t;
|
|
746
|
+
})), g?.(e), !1;
|
|
747
|
+
} finally {
|
|
748
|
+
let e = (Z.current.get(n) ?? 1) - 1;
|
|
749
|
+
e > 0 ? Z.current.set(n, e) : Z.current.delete(n), mt((e) => e + 1);
|
|
750
|
+
}
|
|
751
|
+
}, [
|
|
752
|
+
X,
|
|
753
|
+
P,
|
|
754
|
+
Y,
|
|
755
|
+
g,
|
|
756
|
+
l
|
|
757
|
+
]), mn = I(async (e) => {
|
|
758
|
+
if (!u) return !1;
|
|
759
|
+
let t = X.getId(e), n = `delete:${t}`, r = (At.current.get(n) ?? 0) + 1;
|
|
760
|
+
At.current.set(n, r);
|
|
761
|
+
let i = J.has(t);
|
|
762
|
+
dt.current.set(t, (dt.current.get(t) ?? 0) + 1), U((e) => e?.itemId === t ? null : e), ct((e) => new Set(e).add(t));
|
|
763
|
+
try {
|
|
764
|
+
await u(e), ft.current.set(t, Bt.current.suppliedItems);
|
|
765
|
+
let n = (e) => X.getId(e) !== t;
|
|
766
|
+
return Je((e) => e.every(n) ? e : e.filter(n)), at((e) => e.every(n) ? e : e.filter(n)), Dt.has(t) && Yt(Q.filter((e) => e !== t)), !0;
|
|
767
|
+
} catch (e) {
|
|
768
|
+
return At.current.get(n) === r && (U({
|
|
769
|
+
itemId: t,
|
|
770
|
+
operation: "delete",
|
|
771
|
+
cause: e
|
|
772
|
+
}), i || ct((e) => {
|
|
773
|
+
let n = new Set(e);
|
|
774
|
+
return n.delete(t), n;
|
|
775
|
+
})), g?.(e), !1;
|
|
776
|
+
} finally {
|
|
777
|
+
let e = (dt.current.get(t) ?? 1) - 1;
|
|
778
|
+
e > 0 ? dt.current.set(t, e) : dt.current.delete(t), mt((e) => e + 1);
|
|
779
|
+
}
|
|
780
|
+
}, [
|
|
781
|
+
X,
|
|
782
|
+
Yt,
|
|
783
|
+
g,
|
|
784
|
+
u,
|
|
785
|
+
J,
|
|
786
|
+
Q,
|
|
787
|
+
Dt
|
|
788
|
+
]);
|
|
789
|
+
return {
|
|
790
|
+
tab: ce,
|
|
791
|
+
setTab: le,
|
|
792
|
+
view: ue,
|
|
793
|
+
setView: de,
|
|
794
|
+
query: F,
|
|
795
|
+
setQuery: pe,
|
|
796
|
+
type: me,
|
|
797
|
+
setType: he,
|
|
798
|
+
collection: V,
|
|
799
|
+
setCollection: H,
|
|
800
|
+
sort: ge,
|
|
801
|
+
setSort: _e,
|
|
802
|
+
detailId: ve,
|
|
803
|
+
setDetailId: ye,
|
|
804
|
+
items: Vt,
|
|
805
|
+
visibleItems: Ht,
|
|
806
|
+
selectedIds: Q,
|
|
807
|
+
selectedItems: qt,
|
|
808
|
+
selectedSet: Dt,
|
|
809
|
+
toggleSelection: Zt,
|
|
810
|
+
clearSelection: Qt,
|
|
811
|
+
selecting: tn,
|
|
812
|
+
setSelecting: nn,
|
|
813
|
+
clearFilters: rn,
|
|
814
|
+
loading: we,
|
|
815
|
+
hasLoadedResults: N && (Se !== null || Lt.length > 0),
|
|
816
|
+
loadError: Ee,
|
|
817
|
+
mutationError: Fe,
|
|
818
|
+
uploadError: W,
|
|
819
|
+
retry: Nt,
|
|
820
|
+
hasMore: N && Oe.hasMore,
|
|
821
|
+
loadMore: Ft,
|
|
822
|
+
loadingMore: Ae,
|
|
823
|
+
loadMoreError: Me,
|
|
824
|
+
hasFilters: Jt,
|
|
825
|
+
totalCount: Ut,
|
|
826
|
+
filteredCount: Wt,
|
|
827
|
+
stagedFiles: ht,
|
|
828
|
+
uploadRejections: vt,
|
|
829
|
+
addFiles: on,
|
|
830
|
+
removeStagedFile: sn,
|
|
831
|
+
clearStagedFiles: cn,
|
|
832
|
+
updateUploadOptions: ln,
|
|
833
|
+
uploadOptions: wt,
|
|
834
|
+
uploading: xt,
|
|
835
|
+
startUpload: dn,
|
|
836
|
+
cancelUpload: fn,
|
|
837
|
+
updateItem: pn,
|
|
838
|
+
removeItem: mn,
|
|
839
|
+
accessors: X
|
|
535
840
|
};
|
|
536
841
|
}
|
|
537
842
|
//#endregion
|
|
538
843
|
//#region src/components/features/media-library/partials/media-library-partials.tsx
|
|
539
|
-
var
|
|
540
|
-
function
|
|
541
|
-
return
|
|
844
|
+
var ot = `${C.nativeButtonReset} absolute inset-0 z-10 block h-full w-full cursor-pointer outline-none ${o.inset}`, st = "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", J = "border-primary bg-primary text-primary-foreground opacity-100";
|
|
845
|
+
function ct(e, t) {
|
|
846
|
+
return V(e === "image" ? xe : e === "video" ? Ne : ye, { className: t ?? "size-icon" });
|
|
542
847
|
}
|
|
543
|
-
function
|
|
848
|
+
function Y(e, t) {
|
|
544
849
|
return e === "image" ? t.typeImage : e === "video" ? t.typeVideo : t.typeFile;
|
|
545
850
|
}
|
|
546
|
-
function
|
|
547
|
-
return e ?
|
|
851
|
+
function lt(e, t) {
|
|
852
|
+
return e ? W(t.usedIn, { count: e }) : t.notUsed;
|
|
548
853
|
}
|
|
549
|
-
|
|
550
|
-
|
|
854
|
+
var X = /^\d{4}-\d{2}-\d{2}$/;
|
|
855
|
+
function ut({ value: e }) {
|
|
856
|
+
if (typeof e == "string" && e.trim() !== "") {
|
|
857
|
+
if (X.test(e.trim())) return /* @__PURE__ */ V(O, { value: e.trim() });
|
|
858
|
+
if (D(e) === null) return /* @__PURE__ */ V(he, { children: e });
|
|
859
|
+
}
|
|
860
|
+
return /* @__PURE__ */ V(E, { value: e });
|
|
861
|
+
}
|
|
862
|
+
function Z({ children: e, tint: t, className: n, role: i }) {
|
|
863
|
+
return /* @__PURE__ */ V("div", {
|
|
864
|
+
role: i,
|
|
551
865
|
className: r("media-library-preview relative overflow-hidden bg-muted", n),
|
|
552
866
|
style: t ? { background: t } : void 0,
|
|
553
867
|
children: e
|
|
554
868
|
});
|
|
555
869
|
}
|
|
556
|
-
function
|
|
557
|
-
let [a, o] =
|
|
558
|
-
return
|
|
870
|
+
function dt({ src: e, alt: t, type: n, className: r, loading: i = "lazy" }) {
|
|
871
|
+
let [a, o] = B(!1);
|
|
872
|
+
return L(() => {
|
|
559
873
|
o(!1);
|
|
560
|
-
}, [e]), !e || a ? /* @__PURE__ */
|
|
874
|
+
}, [e]), !e || a ? /* @__PURE__ */ V("div", {
|
|
561
875
|
className: "media-library-preview--fallback flex size-full items-center justify-center text-muted-foreground",
|
|
562
|
-
children:
|
|
563
|
-
}) : /* @__PURE__ */
|
|
876
|
+
children: ct(n, "size-6")
|
|
877
|
+
}) : /* @__PURE__ */ V("img", {
|
|
564
878
|
src: e,
|
|
565
879
|
alt: t,
|
|
566
880
|
loading: i,
|
|
@@ -568,23 +882,23 @@ function J({ src: e, alt: t, type: n, className: r, loading: i = "lazy" }) {
|
|
|
568
882
|
onError: () => o(!0)
|
|
569
883
|
});
|
|
570
884
|
}
|
|
571
|
-
function
|
|
572
|
-
return /* @__PURE__ */ F
|
|
885
|
+
function ft({ icon: e, title: t, description: n, action: i, className: a }) {
|
|
886
|
+
return /* @__PURE__ */ V(F, {
|
|
573
887
|
title: t,
|
|
574
888
|
description: n ?? !1,
|
|
575
889
|
actions: i,
|
|
576
|
-
media: e ?? /* @__PURE__ */
|
|
890
|
+
media: e ?? /* @__PURE__ */ V(xe, {
|
|
577
891
|
className: "size-icon",
|
|
578
892
|
"aria-hidden": "true"
|
|
579
893
|
}),
|
|
580
894
|
mediaVariant: "icon-soft",
|
|
581
895
|
padding: "md",
|
|
582
|
-
|
|
583
|
-
className: r("media-library-empty-state--component min-h-64
|
|
896
|
+
surface: "wash",
|
|
897
|
+
className: r("media-library-empty-state--component min-h-64", a)
|
|
584
898
|
});
|
|
585
899
|
}
|
|
586
|
-
function
|
|
587
|
-
let { defaultScale: te } = t(),
|
|
900
|
+
function pt({ query: n, type: a, typeFilters: o, collection: c, sort: u, view: d, collections: f = [], strings: p, onQueryChange: m, onTypeChange: h, onCollectionChange: g, onSortChange: _, onViewChange: v, onClearFilters: y, toolbarEnd: b, selecting: x = !1, onSelectingChange: S, summary: ee, disabled: w = !1 }) {
|
|
901
|
+
let { defaultScale: te } = t(), T = e(void 0, te), ne = [
|
|
588
902
|
{
|
|
589
903
|
value: "all",
|
|
590
904
|
label: p.allTypes,
|
|
@@ -593,29 +907,29 @@ function He({ query: n, type: o, typeFilters: s, collection: c, sort: u, view: d
|
|
|
593
907
|
{
|
|
594
908
|
value: "image",
|
|
595
909
|
label: p.images,
|
|
596
|
-
icon:
|
|
910
|
+
icon: xe
|
|
597
911
|
},
|
|
598
912
|
{
|
|
599
913
|
value: "video",
|
|
600
914
|
label: p.videos,
|
|
601
|
-
icon:
|
|
915
|
+
icon: Ne
|
|
602
916
|
},
|
|
603
917
|
{
|
|
604
918
|
value: "file",
|
|
605
919
|
label: p.files,
|
|
606
|
-
icon:
|
|
920
|
+
icon: ye
|
|
607
921
|
}
|
|
608
|
-
].filter((e) => (
|
|
922
|
+
].filter((e) => (o ?? [
|
|
609
923
|
"all",
|
|
610
924
|
"image",
|
|
611
925
|
"video"
|
|
612
|
-
]).includes(e.value)),
|
|
926
|
+
]).includes(e.value)), E = [{
|
|
613
927
|
value: "all",
|
|
614
928
|
label: p.allCollections
|
|
615
929
|
}, ...f.map((e) => ({
|
|
616
930
|
value: e.value,
|
|
617
931
|
label: String(e.label)
|
|
618
|
-
}))],
|
|
932
|
+
}))], D = [
|
|
619
933
|
{
|
|
620
934
|
value: "newest",
|
|
621
935
|
label: p.sortNewest
|
|
@@ -632,73 +946,72 @@ function He({ query: n, type: o, typeFilters: s, collection: c, sort: u, view: d
|
|
|
632
946
|
value: "usage",
|
|
633
947
|
label: p.sortUsage
|
|
634
948
|
}
|
|
635
|
-
],
|
|
636
|
-
return /* @__PURE__ */
|
|
949
|
+
], O = n.trim(), re = O.length > 0, A = re || a !== "all" || c !== "all";
|
|
950
|
+
return /* @__PURE__ */ H(l, {
|
|
637
951
|
direction: "horizontal",
|
|
638
952
|
wrap: !0,
|
|
639
953
|
align: "start",
|
|
640
954
|
gap: "md",
|
|
641
955
|
className: "media-library-toolbar--component",
|
|
642
|
-
children: [/* @__PURE__ */
|
|
956
|
+
children: [/* @__PURE__ */ H(l, {
|
|
643
957
|
direction: "horizontal",
|
|
644
958
|
wrap: !0,
|
|
645
959
|
align: "start",
|
|
646
960
|
gap: "md",
|
|
647
961
|
className: "media-library-toolbar--filters min-w-0 grow basis-80",
|
|
648
962
|
children: [
|
|
649
|
-
/* @__PURE__ */
|
|
963
|
+
/* @__PURE__ */ H(l, {
|
|
650
964
|
gap: "xs",
|
|
651
965
|
className: "media-library-toolbar--search min-w-52 flex-1",
|
|
652
|
-
children: [/* @__PURE__ */
|
|
966
|
+
children: [/* @__PURE__ */ V(ie, {
|
|
653
967
|
value: n,
|
|
654
968
|
onChange: (e) => m(e.target.value),
|
|
655
969
|
placeholder: p.searchPlaceholder,
|
|
656
|
-
startIcon:
|
|
970
|
+
startIcon: ke,
|
|
657
971
|
clearable: !0,
|
|
658
972
|
onClear: () => m(""),
|
|
659
973
|
strings: { clear: p.clearSearch },
|
|
660
|
-
disabled:
|
|
974
|
+
disabled: w,
|
|
661
975
|
className: "bg-background"
|
|
662
|
-
}), !!
|
|
976
|
+
}), !!re && /* @__PURE__ */ V(l, {
|
|
663
977
|
direction: "horizontal",
|
|
664
978
|
gap: "xs",
|
|
665
979
|
wrap: !1,
|
|
666
980
|
className: "media-library-toolbar--search-value px-space-xs",
|
|
667
|
-
children: /* @__PURE__ */
|
|
981
|
+
children: /* @__PURE__ */ H(k, {
|
|
668
982
|
tone: "secondary",
|
|
669
983
|
className: "max-w-full",
|
|
670
|
-
children: [/* @__PURE__ */
|
|
984
|
+
children: [/* @__PURE__ */ V(i, {
|
|
671
985
|
tag: "span",
|
|
672
986
|
size: "inherit",
|
|
673
987
|
className: "text-current",
|
|
674
988
|
children: p.activeSearchLabel
|
|
675
|
-
}), /* @__PURE__ */
|
|
989
|
+
}), /* @__PURE__ */ V(i, {
|
|
676
990
|
tag: "span",
|
|
677
991
|
size: "inherit",
|
|
678
992
|
weight: "normal",
|
|
679
993
|
className: "min-w-0 truncate text-current",
|
|
680
|
-
children:
|
|
994
|
+
children: O
|
|
681
995
|
})]
|
|
682
996
|
})
|
|
683
997
|
})]
|
|
684
998
|
}),
|
|
685
|
-
/* @__PURE__ */
|
|
686
|
-
className: r("media-library-toolbar--type-toggle shrink-0",
|
|
687
|
-
role: "
|
|
999
|
+
/* @__PURE__ */ V("div", {
|
|
1000
|
+
className: r("media-library-toolbar--type-toggle shrink-0", ae.frame, oe[T]),
|
|
1001
|
+
role: "group",
|
|
688
1002
|
"aria-label": p.typeFilterLabel,
|
|
689
|
-
children:
|
|
690
|
-
let t = e.icon, n =
|
|
691
|
-
return /* @__PURE__ */
|
|
1003
|
+
children: ne.map((e) => {
|
|
1004
|
+
let t = e.icon, n = a === e.value;
|
|
1005
|
+
return /* @__PURE__ */ H(s, {
|
|
692
1006
|
type: "button",
|
|
693
|
-
|
|
694
|
-
"aria-selected": n,
|
|
1007
|
+
"aria-pressed": n,
|
|
695
1008
|
tone: "secondary",
|
|
696
1009
|
buttonStyle: "ghost",
|
|
697
1010
|
size: "sm",
|
|
698
|
-
disabled:
|
|
699
|
-
className: r(
|
|
1011
|
+
disabled: w,
|
|
1012
|
+
className: r(ae.item, "shadow-none", n ? `${C.segmentActive} hover:bg-card` : "text-muted-foreground hover:bg-transparent hover:text-foreground"),
|
|
700
1013
|
onClick: () => h(e.value),
|
|
701
|
-
children: [t && /* @__PURE__ */
|
|
1014
|
+
children: [t && /* @__PURE__ */ V(t, { className: "size-icon-md" }), /* @__PURE__ */ V(i, {
|
|
702
1015
|
tag: "span",
|
|
703
1016
|
size: "xs",
|
|
704
1017
|
weight: "medium",
|
|
@@ -708,188 +1021,192 @@ function He({ query: n, type: o, typeFilters: s, collection: c, sort: u, view: d
|
|
|
708
1021
|
}, e.value);
|
|
709
1022
|
})
|
|
710
1023
|
}),
|
|
711
|
-
/* @__PURE__ */
|
|
1024
|
+
/* @__PURE__ */ H(l, {
|
|
712
1025
|
direction: "horizontal",
|
|
713
1026
|
gap: "md",
|
|
714
1027
|
wrap: !0,
|
|
715
1028
|
className: "media-library-toolbar--selects min-w-0",
|
|
716
|
-
children: [/* @__PURE__ */
|
|
1029
|
+
children: [/* @__PURE__ */ V("div", {
|
|
717
1030
|
className: "min-w-40 grow",
|
|
718
|
-
children: /* @__PURE__ */
|
|
1031
|
+
children: /* @__PURE__ */ V(M, {
|
|
719
1032
|
value: c,
|
|
720
|
-
options:
|
|
1033
|
+
options: E,
|
|
721
1034
|
onValueChange: (e) => g(e ?? "all"),
|
|
722
1035
|
placeholder: p.collectionFilterLabel,
|
|
723
1036
|
"aria-label": p.collectionFilterLabel,
|
|
724
|
-
disabled:
|
|
1037
|
+
disabled: w,
|
|
725
1038
|
className: "bg-background"
|
|
726
1039
|
})
|
|
727
|
-
}), /* @__PURE__ */
|
|
1040
|
+
}), /* @__PURE__ */ V("div", {
|
|
728
1041
|
className: "min-w-32 grow",
|
|
729
|
-
children: /* @__PURE__ */
|
|
1042
|
+
children: /* @__PURE__ */ V(M, {
|
|
730
1043
|
value: u,
|
|
731
|
-
options:
|
|
732
|
-
onValueChange: (e) =>
|
|
1044
|
+
options: D,
|
|
1045
|
+
onValueChange: (e) => _(e ?? "newest"),
|
|
733
1046
|
placeholder: p.sortLabel,
|
|
734
1047
|
"aria-label": p.sortLabel,
|
|
735
|
-
disabled:
|
|
1048
|
+
disabled: w,
|
|
736
1049
|
className: "bg-background"
|
|
737
1050
|
})
|
|
738
1051
|
})]
|
|
739
1052
|
}),
|
|
740
|
-
!!
|
|
1053
|
+
!!A && /* @__PURE__ */ V(s, {
|
|
741
1054
|
type: "button",
|
|
742
1055
|
tone: "secondary",
|
|
743
1056
|
buttonStyle: "ghost",
|
|
744
|
-
disabled:
|
|
745
|
-
onClick:
|
|
1057
|
+
disabled: w,
|
|
1058
|
+
onClick: y,
|
|
746
1059
|
children: p.clearFilters
|
|
747
1060
|
})
|
|
748
1061
|
]
|
|
749
|
-
}), /* @__PURE__ */
|
|
1062
|
+
}), /* @__PURE__ */ H(l, {
|
|
750
1063
|
direction: "horizontal",
|
|
751
1064
|
align: "center",
|
|
752
1065
|
gap: "md",
|
|
753
1066
|
wrap: !1,
|
|
754
1067
|
className: "media-library-toolbar--view ms-auto min-w-0 max-w-full",
|
|
755
1068
|
children: [
|
|
756
|
-
|
|
757
|
-
/* @__PURE__ */
|
|
758
|
-
className: r("media-library-toolbar--view-toggle shrink-0",
|
|
759
|
-
|
|
1069
|
+
ee,
|
|
1070
|
+
/* @__PURE__ */ H("div", {
|
|
1071
|
+
className: r("media-library-toolbar--view-toggle shrink-0", ae.frame, oe[T]),
|
|
1072
|
+
role: "group",
|
|
1073
|
+
"aria-label": p.viewLabel,
|
|
1074
|
+
children: [/* @__PURE__ */ V(s, {
|
|
760
1075
|
type: "button",
|
|
761
1076
|
tone: d === "grid" ? "neutral" : "secondary",
|
|
762
1077
|
buttonStyle: d === "grid" ? "solid" : "ghost",
|
|
763
1078
|
size: "sm",
|
|
764
1079
|
iconOnly: !0,
|
|
765
|
-
disabled:
|
|
766
|
-
className: r(
|
|
1080
|
+
disabled: w,
|
|
1081
|
+
className: r(ae.item, d === "grid" && `${C.segmentActive} hover:bg-card`),
|
|
767
1082
|
"aria-label": p.gridView,
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
1083
|
+
"aria-pressed": d === "grid",
|
|
1084
|
+
onClick: () => v("grid"),
|
|
1085
|
+
children: /* @__PURE__ */ V(be, { className: "size-icon-md" })
|
|
1086
|
+
}), /* @__PURE__ */ V(s, {
|
|
771
1087
|
type: "button",
|
|
772
1088
|
tone: d === "table" ? "neutral" : "secondary",
|
|
773
1089
|
buttonStyle: d === "table" ? "solid" : "ghost",
|
|
774
1090
|
size: "sm",
|
|
775
1091
|
iconOnly: !0,
|
|
776
|
-
disabled:
|
|
777
|
-
className: r(
|
|
1092
|
+
disabled: w,
|
|
1093
|
+
className: r(ae.item, d === "table" && `${C.segmentActive} hover:bg-card`),
|
|
778
1094
|
"aria-label": p.tableView,
|
|
779
|
-
|
|
780
|
-
|
|
1095
|
+
"aria-pressed": d === "table",
|
|
1096
|
+
onClick: () => v("table"),
|
|
1097
|
+
children: /* @__PURE__ */ V(Te, { className: "size-icon-md" })
|
|
781
1098
|
})]
|
|
782
1099
|
}),
|
|
783
|
-
!!
|
|
1100
|
+
!!S && /* @__PURE__ */ V(s, {
|
|
784
1101
|
type: "button",
|
|
785
|
-
"aria-pressed":
|
|
1102
|
+
"aria-pressed": x,
|
|
786
1103
|
tone: "secondary",
|
|
787
1104
|
buttonStyle: "outline",
|
|
788
|
-
disabled:
|
|
789
|
-
className: r("media-library-toolbar--select shrink-0",
|
|
790
|
-
onClick: () =>
|
|
1105
|
+
disabled: w,
|
|
1106
|
+
className: r("media-library-toolbar--select shrink-0", x && C.togglePressed),
|
|
1107
|
+
onClick: () => S(!x),
|
|
791
1108
|
children: p.selectMode
|
|
792
1109
|
}),
|
|
793
|
-
|
|
1110
|
+
b
|
|
794
1111
|
]
|
|
795
1112
|
})]
|
|
796
1113
|
});
|
|
797
1114
|
}
|
|
798
|
-
function
|
|
799
|
-
let
|
|
800
|
-
return /* @__PURE__ */
|
|
1115
|
+
function mt({ item: e, selected: t = !1, density: n = "comfortable", showMeta: a = !0, accessors: u, strings: d, onToggle: f, onDetails: p, onOpen: m, selecting: h = !1, className: g }) {
|
|
1116
|
+
let _ = u.getType(e), v = u.getName(e), y = u.getSrc(e), b = u.getAlt(e) || v, x = u.getSize(e), S = u.getUsageCount(e), ee = u.getPublic(e) === !1, te = u.getDuration(e), T = !!m && !h, ne = T ? m : f;
|
|
1117
|
+
return /* @__PURE__ */ H("div", {
|
|
801
1118
|
"data-selected": t || void 0,
|
|
802
1119
|
"data-selecting": h || void 0,
|
|
803
1120
|
"data-gallery-density": n,
|
|
804
|
-
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", `${
|
|
805
|
-
onClick:
|
|
1121
|
+
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", `${C.tileHover} hover:shadow-sm`, t && "media-library-card--selected border-primary ring-1 ring-primary", g),
|
|
1122
|
+
onClick: ne,
|
|
806
1123
|
children: [
|
|
807
|
-
!!
|
|
1124
|
+
!!ne && /* @__PURE__ */ V("button", {
|
|
808
1125
|
type: "button",
|
|
809
|
-
"aria-label":
|
|
810
|
-
"aria-pressed":
|
|
811
|
-
className: r("media-library-card--select rounded-radius",
|
|
1126
|
+
"aria-label": v,
|
|
1127
|
+
"aria-pressed": T ? void 0 : t,
|
|
1128
|
+
className: r("media-library-card--select rounded-radius", ot),
|
|
812
1129
|
onClick: (e) => {
|
|
813
|
-
e.stopPropagation(),
|
|
1130
|
+
e.stopPropagation(), ne();
|
|
814
1131
|
}
|
|
815
1132
|
}),
|
|
816
|
-
/* @__PURE__ */
|
|
1133
|
+
/* @__PURE__ */ H(Z, {
|
|
817
1134
|
tint: u.getTint(e),
|
|
818
1135
|
className: r(n === "compact" ? "aspect-square" : "aspect-[4/3]"),
|
|
819
1136
|
children: [
|
|
820
|
-
/* @__PURE__ */
|
|
821
|
-
src:
|
|
822
|
-
alt:
|
|
823
|
-
type:
|
|
1137
|
+
/* @__PURE__ */ V(dt, {
|
|
1138
|
+
src: y,
|
|
1139
|
+
alt: b,
|
|
1140
|
+
type: _,
|
|
824
1141
|
className: "size-full object-cover"
|
|
825
1142
|
}),
|
|
826
|
-
|
|
1143
|
+
T && f ? /* @__PURE__ */ V("button", {
|
|
827
1144
|
type: "button",
|
|
828
|
-
"aria-label":
|
|
1145
|
+
"aria-label": W(d.selectItem, { name: v }),
|
|
829
1146
|
"aria-pressed": t,
|
|
830
|
-
className: r(
|
|
1147
|
+
className: r(st, `z-10 cursor-pointer opacity-0 transition-opacity group-hover/card:opacity-100 group-focus-within/card:opacity-100 pointer-coarse:opacity-100 ${o.frame}`, t && J),
|
|
831
1148
|
onClick: (e) => {
|
|
832
1149
|
e.stopPropagation(), f();
|
|
833
1150
|
},
|
|
834
|
-
children: /* @__PURE__ */
|
|
835
|
-
}) : /* @__PURE__ */
|
|
836
|
-
className: r(
|
|
1151
|
+
children: /* @__PURE__ */ V(ve, { className: "size-icon-sm" })
|
|
1152
|
+
}) : /* @__PURE__ */ V("span", {
|
|
1153
|
+
className: r(st, "transition-opacity", h ? "opacity-100" : "opacity-0 group-hover/card:opacity-100 group-focus-within/card:opacity-100", t && J),
|
|
837
1154
|
"aria-hidden": "true",
|
|
838
|
-
children: /* @__PURE__ */
|
|
1155
|
+
children: /* @__PURE__ */ V(ve, { className: "size-icon-sm" })
|
|
839
1156
|
}),
|
|
840
|
-
!!p && /* @__PURE__ */
|
|
1157
|
+
!!p && /* @__PURE__ */ V(s, {
|
|
841
1158
|
type: "button",
|
|
842
1159
|
tone: "secondary",
|
|
843
1160
|
buttonStyle: "solid",
|
|
844
1161
|
size: "sm",
|
|
845
1162
|
iconOnly: !0,
|
|
846
1163
|
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",
|
|
847
|
-
"aria-label":
|
|
1164
|
+
"aria-label": W(d.cardDetails, { name: v }),
|
|
848
1165
|
onClick: (e) => {
|
|
849
1166
|
e.stopPropagation(), p();
|
|
850
1167
|
},
|
|
851
|
-
children: /* @__PURE__ */
|
|
1168
|
+
children: /* @__PURE__ */ V(Ce, { className: "size-icon-md" })
|
|
852
1169
|
}),
|
|
853
|
-
|
|
1170
|
+
_ === "video" && !!te && /* @__PURE__ */ H(k, {
|
|
854
1171
|
tone: "secondary",
|
|
855
1172
|
className: "media-library-card--duration absolute bottom-2 left-2 bg-inverse-background text-inverse-foreground",
|
|
856
|
-
children: [/* @__PURE__ */
|
|
1173
|
+
children: [/* @__PURE__ */ V(De, { className: "size-icon-sm fill-current" }), te]
|
|
857
1174
|
}),
|
|
858
|
-
|
|
1175
|
+
ee && /* @__PURE__ */ V(k, {
|
|
859
1176
|
tone: "secondary",
|
|
860
1177
|
className: "media-library-card--private absolute bottom-2 right-2 bg-card text-card-foreground",
|
|
861
|
-
children: /* @__PURE__ */
|
|
1178
|
+
children: /* @__PURE__ */ V(Ee, { className: "size-icon-sm" })
|
|
862
1179
|
})
|
|
863
1180
|
]
|
|
864
1181
|
}),
|
|
865
|
-
/* @__PURE__ */
|
|
1182
|
+
/* @__PURE__ */ V("div", {
|
|
866
1183
|
className: r("media-library-card--body", n === "compact" ? "p-surface-xs" : "p-surface"),
|
|
867
|
-
children: /* @__PURE__ */
|
|
1184
|
+
children: /* @__PURE__ */ H(c, {
|
|
868
1185
|
columns: 1,
|
|
869
1186
|
gap: "xs",
|
|
870
|
-
children: [/* @__PURE__ */
|
|
1187
|
+
children: [/* @__PURE__ */ V(i, {
|
|
871
1188
|
tag: "div",
|
|
872
1189
|
type: "inherit",
|
|
873
1190
|
weight: "semibold",
|
|
874
1191
|
className: "truncate",
|
|
875
|
-
children:
|
|
876
|
-
}),
|
|
1192
|
+
children: v
|
|
1193
|
+
}), a && /* @__PURE__ */ H(l, {
|
|
877
1194
|
direction: "horizontal",
|
|
878
1195
|
align: "center",
|
|
879
1196
|
justify: "between",
|
|
880
1197
|
gap: "md",
|
|
881
1198
|
className: "min-w-0",
|
|
882
|
-
children: [/* @__PURE__ */
|
|
883
|
-
value:
|
|
1199
|
+
children: [/* @__PURE__ */ V(w, {
|
|
1200
|
+
value: x,
|
|
884
1201
|
size: "xs",
|
|
885
1202
|
className: "truncate",
|
|
886
1203
|
emptyLabel: d.unknownSize
|
|
887
|
-
}), !!
|
|
1204
|
+
}), !!S && /* @__PURE__ */ H(i, {
|
|
888
1205
|
tag: "span",
|
|
889
1206
|
size: "xs",
|
|
890
1207
|
type: "secondary",
|
|
891
1208
|
className: "inline-flex items-center gap-space-xs",
|
|
892
|
-
children: [/* @__PURE__ */
|
|
1209
|
+
children: [/* @__PURE__ */ V(we, { className: "size-icon-sm" }), S]
|
|
893
1210
|
})]
|
|
894
1211
|
})]
|
|
895
1212
|
})
|
|
@@ -897,165 +1214,268 @@ function X({ item: e, selected: t = !1, density: n = "comfortable", showMeta: o
|
|
|
897
1214
|
]
|
|
898
1215
|
});
|
|
899
1216
|
}
|
|
900
|
-
function
|
|
1217
|
+
function ht({ items: e, selectedSet: t, accessors: n, strings: c, onToggle: l, onDetails: u, onOpen: d, selecting: f = !1 }) {
|
|
901
1218
|
let p = !!d && !f;
|
|
902
|
-
return /* @__PURE__ */
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
/* @__PURE__ */ F(o, { children: c.table.collection }),
|
|
913
|
-
/* @__PURE__ */ F(o, { children: c.table.used }),
|
|
914
|
-
/* @__PURE__ */ F("span", {})
|
|
915
|
-
]
|
|
916
|
-
}), e.map((e) => {
|
|
917
|
-
let o = n.getId(e), f = t.has(o), m = n.getType(e), h = n.getName(e), g = n.getSrc(e), v = n.getPublic(e) === !1;
|
|
918
|
-
return /* @__PURE__ */ I("div", {
|
|
919
|
-
"data-selected": f || void 0,
|
|
920
|
-
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-radius transition-colors ${_.rowHover}`, f && _.rowSelected),
|
|
921
|
-
onClick: () => p && d ? d(o) : l(o),
|
|
1219
|
+
return /* @__PURE__ */ H("div", {
|
|
1220
|
+
role: "table",
|
|
1221
|
+
"aria-label": c.resultsLabel,
|
|
1222
|
+
className: "media-library-list--component -mx-row-x min-w-180",
|
|
1223
|
+
children: [/* @__PURE__ */ V("div", {
|
|
1224
|
+
role: "rowgroup",
|
|
1225
|
+
className: "contents",
|
|
1226
|
+
children: /* @__PURE__ */ H("div", {
|
|
1227
|
+
role: "row",
|
|
1228
|
+
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",
|
|
922
1229
|
children: [
|
|
923
|
-
/* @__PURE__ */
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
}
|
|
931
|
-
}),
|
|
932
|
-
p ? /* @__PURE__ */ F("button", {
|
|
933
|
-
type: "button",
|
|
934
|
-
"aria-label": H(c.selectItem, { name: h }),
|
|
935
|
-
"aria-pressed": f,
|
|
936
|
-
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"),
|
|
937
|
-
onClick: (e) => {
|
|
938
|
-
e.stopPropagation(), l(o);
|
|
939
|
-
},
|
|
940
|
-
children: /* @__PURE__ */ F(R, { className: "size-icon-sm" })
|
|
941
|
-
}) : /* @__PURE__ */ F("span", {
|
|
942
|
-
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"),
|
|
943
|
-
"aria-hidden": "true",
|
|
944
|
-
children: /* @__PURE__ */ F(R, { className: "size-icon-sm" })
|
|
945
|
-
}),
|
|
946
|
-
/* @__PURE__ */ F(q, {
|
|
947
|
-
tint: n.getTint(e),
|
|
948
|
-
className: "size-9 rounded-radius",
|
|
949
|
-
children: g ? /* @__PURE__ */ F("img", {
|
|
950
|
-
src: g,
|
|
951
|
-
alt: "",
|
|
952
|
-
loading: "lazy",
|
|
953
|
-
className: "size-full object-cover"
|
|
954
|
-
}) : /* @__PURE__ */ F("div", {
|
|
955
|
-
className: "flex size-full items-center justify-center text-muted-foreground",
|
|
956
|
-
children: Ve(m, "size-icon")
|
|
1230
|
+
/* @__PURE__ */ V("span", {
|
|
1231
|
+
role: "columnheader",
|
|
1232
|
+
children: /* @__PURE__ */ V(i, {
|
|
1233
|
+
tag: "span",
|
|
1234
|
+
size: "inherit",
|
|
1235
|
+
className: "sr-only",
|
|
1236
|
+
children: c.selectMode
|
|
957
1237
|
})
|
|
958
1238
|
}),
|
|
959
|
-
/* @__PURE__ */
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
className: "flex min-w-0 items-center gap-space-xs truncate",
|
|
964
|
-
children: [h, v && /* @__PURE__ */ F(me, { className: "size-icon-sm shrink-0 text-muted-foreground" })]
|
|
1239
|
+
/* @__PURE__ */ V("span", { role: "cell" }),
|
|
1240
|
+
/* @__PURE__ */ V(a, {
|
|
1241
|
+
role: "columnheader",
|
|
1242
|
+
children: c.table.name
|
|
965
1243
|
}),
|
|
966
|
-
/* @__PURE__ */
|
|
967
|
-
|
|
968
|
-
children:
|
|
1244
|
+
/* @__PURE__ */ V(a, {
|
|
1245
|
+
role: "columnheader",
|
|
1246
|
+
children: c.table.type
|
|
969
1247
|
}),
|
|
970
|
-
/* @__PURE__ */
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
emptyLabel: c.unknownSize
|
|
1248
|
+
/* @__PURE__ */ V(a, {
|
|
1249
|
+
role: "columnheader",
|
|
1250
|
+
children: c.table.size
|
|
974
1251
|
}),
|
|
975
|
-
/* @__PURE__ */
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
className: "truncate",
|
|
979
|
-
children: n.getCollection(e) || "—"
|
|
1252
|
+
/* @__PURE__ */ V(a, {
|
|
1253
|
+
role: "columnheader",
|
|
1254
|
+
children: c.table.collection
|
|
980
1255
|
}),
|
|
981
|
-
/* @__PURE__ */
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
children: n.getUsageCount(e) ? n.getUsageCount(e) : "—"
|
|
1256
|
+
/* @__PURE__ */ V(a, {
|
|
1257
|
+
role: "columnheader",
|
|
1258
|
+
children: c.table.used
|
|
985
1259
|
}),
|
|
986
|
-
/* @__PURE__ */
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
onClick: (e) => {
|
|
995
|
-
e.stopPropagation(), u(o);
|
|
996
|
-
},
|
|
997
|
-
children: /* @__PURE__ */ F(de, { className: "size-icon-md" })
|
|
1260
|
+
/* @__PURE__ */ V("span", {
|
|
1261
|
+
role: "columnheader",
|
|
1262
|
+
children: /* @__PURE__ */ V(i, {
|
|
1263
|
+
tag: "span",
|
|
1264
|
+
size: "inherit",
|
|
1265
|
+
className: "sr-only",
|
|
1266
|
+
children: c.detail.title
|
|
1267
|
+
})
|
|
998
1268
|
})
|
|
999
1269
|
]
|
|
1000
|
-
}
|
|
1270
|
+
})
|
|
1271
|
+
}), /* @__PURE__ */ V("div", {
|
|
1272
|
+
role: "rowgroup",
|
|
1273
|
+
className: "contents",
|
|
1274
|
+
children: e.map((e) => {
|
|
1275
|
+
let a = n.getId(e), f = t.has(a), m = n.getType(e), h = n.getName(e), g = n.getSrc(e), _ = n.getPublic(e) === !1;
|
|
1276
|
+
return /* @__PURE__ */ H("div", {
|
|
1277
|
+
role: "row",
|
|
1278
|
+
"data-selected": f || void 0,
|
|
1279
|
+
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-radius transition-colors ${C.rowHover}`, f && C.rowSelected),
|
|
1280
|
+
onClick: () => p && d ? d(a) : l(a),
|
|
1281
|
+
children: [
|
|
1282
|
+
/* @__PURE__ */ H("div", {
|
|
1283
|
+
role: "cell",
|
|
1284
|
+
className: "contents",
|
|
1285
|
+
children: [/* @__PURE__ */ V("button", {
|
|
1286
|
+
type: "button",
|
|
1287
|
+
"aria-label": h,
|
|
1288
|
+
"aria-pressed": p ? void 0 : f,
|
|
1289
|
+
className: r("media-library-list--select rounded-radius", ot),
|
|
1290
|
+
onClick: (e) => {
|
|
1291
|
+
e.stopPropagation(), p && d ? d(a) : l(a);
|
|
1292
|
+
}
|
|
1293
|
+
}), p ? /* @__PURE__ */ V("button", {
|
|
1294
|
+
type: "button",
|
|
1295
|
+
"aria-label": W(c.selectItem, { name: h }),
|
|
1296
|
+
"aria-pressed": f,
|
|
1297
|
+
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 ${o.frame}`, f && "border-primary bg-primary text-primary-foreground"),
|
|
1298
|
+
onClick: (e) => {
|
|
1299
|
+
e.stopPropagation(), l(a);
|
|
1300
|
+
},
|
|
1301
|
+
children: /* @__PURE__ */ V(ve, { className: "size-icon-sm" })
|
|
1302
|
+
}) : /* @__PURE__ */ V("span", {
|
|
1303
|
+
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"),
|
|
1304
|
+
"aria-hidden": "true",
|
|
1305
|
+
children: /* @__PURE__ */ V(ve, { className: "size-icon-sm" })
|
|
1306
|
+
})]
|
|
1307
|
+
}),
|
|
1308
|
+
/* @__PURE__ */ V(Z, {
|
|
1309
|
+
role: "cell",
|
|
1310
|
+
tint: n.getTint(e),
|
|
1311
|
+
className: "size-9 rounded-radius",
|
|
1312
|
+
children: g ? /* @__PURE__ */ V("img", {
|
|
1313
|
+
src: g,
|
|
1314
|
+
alt: "",
|
|
1315
|
+
loading: "lazy",
|
|
1316
|
+
className: "size-full object-cover"
|
|
1317
|
+
}) : /* @__PURE__ */ V("div", {
|
|
1318
|
+
className: "flex size-full items-center justify-center text-muted-foreground",
|
|
1319
|
+
children: ct(m, "size-icon")
|
|
1320
|
+
})
|
|
1321
|
+
}),
|
|
1322
|
+
/* @__PURE__ */ H(i, {
|
|
1323
|
+
tag: "div",
|
|
1324
|
+
role: "rowheader",
|
|
1325
|
+
type: "inherit",
|
|
1326
|
+
weight: "semibold",
|
|
1327
|
+
className: "flex min-w-0 items-center gap-space-xs truncate",
|
|
1328
|
+
children: [h, _ && /* @__PURE__ */ V(Ee, { className: "size-icon-sm shrink-0 text-muted-foreground" })]
|
|
1329
|
+
}),
|
|
1330
|
+
/* @__PURE__ */ V(k, {
|
|
1331
|
+
role: "cell",
|
|
1332
|
+
tone: "secondary",
|
|
1333
|
+
children: Y(m, c)
|
|
1334
|
+
}),
|
|
1335
|
+
/* @__PURE__ */ V(w, {
|
|
1336
|
+
role: "cell",
|
|
1337
|
+
value: n.getSize(e),
|
|
1338
|
+
size: "xs",
|
|
1339
|
+
emptyLabel: c.unknownSize
|
|
1340
|
+
}),
|
|
1341
|
+
/* @__PURE__ */ V(i, {
|
|
1342
|
+
role: "cell",
|
|
1343
|
+
size: "xs",
|
|
1344
|
+
type: "secondary",
|
|
1345
|
+
className: "truncate",
|
|
1346
|
+
children: n.getCollection(e) || "—"
|
|
1347
|
+
}),
|
|
1348
|
+
/* @__PURE__ */ V(i, {
|
|
1349
|
+
role: "cell",
|
|
1350
|
+
size: "xs",
|
|
1351
|
+
type: "secondary",
|
|
1352
|
+
children: n.getUsageCount(e) ? n.getUsageCount(e) : "—"
|
|
1353
|
+
}),
|
|
1354
|
+
/* @__PURE__ */ V("div", {
|
|
1355
|
+
role: "cell",
|
|
1356
|
+
className: "contents",
|
|
1357
|
+
children: /* @__PURE__ */ V(s, {
|
|
1358
|
+
type: "button",
|
|
1359
|
+
tone: "secondary",
|
|
1360
|
+
buttonStyle: "ghost",
|
|
1361
|
+
size: "sm",
|
|
1362
|
+
iconOnly: !0,
|
|
1363
|
+
className: "relative z-10",
|
|
1364
|
+
"aria-label": W(c.cardDetails, { name: h }),
|
|
1365
|
+
onClick: (e) => {
|
|
1366
|
+
e.stopPropagation(), u(a);
|
|
1367
|
+
},
|
|
1368
|
+
children: /* @__PURE__ */ V(Ce, { className: "size-icon-md" })
|
|
1369
|
+
})
|
|
1370
|
+
})
|
|
1371
|
+
]
|
|
1372
|
+
}, a);
|
|
1373
|
+
})
|
|
1001
1374
|
})]
|
|
1002
1375
|
});
|
|
1003
1376
|
}
|
|
1004
|
-
function
|
|
1377
|
+
function gt({ label: e, value: t, placeholder: n, readOnly: r = !1, onCommit: i }) {
|
|
1378
|
+
let [a, o] = B({
|
|
1379
|
+
source: t,
|
|
1380
|
+
value: t
|
|
1381
|
+
});
|
|
1382
|
+
a.source !== t && o({
|
|
1383
|
+
source: t,
|
|
1384
|
+
value: t
|
|
1385
|
+
});
|
|
1386
|
+
let s = !r && a.value !== t, c = () => o({
|
|
1387
|
+
source: t,
|
|
1388
|
+
value: t
|
|
1389
|
+
}), l = () => {
|
|
1390
|
+
s && (c(), i(a.value));
|
|
1391
|
+
}, u = z(null);
|
|
1392
|
+
return L(() => {
|
|
1393
|
+
u.current = s ? () => i(a.value) : null;
|
|
1394
|
+
}), L(() => () => u.current?.(), []), /* @__PURE__ */ V(A, {
|
|
1395
|
+
label: e,
|
|
1396
|
+
children: /* @__PURE__ */ V(ie, {
|
|
1397
|
+
value: a.value,
|
|
1398
|
+
placeholder: n,
|
|
1399
|
+
readOnly: r,
|
|
1400
|
+
onChange: (e) => o({
|
|
1401
|
+
source: t,
|
|
1402
|
+
value: e.target.value
|
|
1403
|
+
}),
|
|
1404
|
+
onBlur: l,
|
|
1405
|
+
onKeyDown: (e) => {
|
|
1406
|
+
r || e.nativeEvent.isComposing || (e.key === "Enter" ? (e.preventDefault(), l()) : e.key === "Escape" && s && (e.stopPropagation(), c()));
|
|
1407
|
+
}
|
|
1408
|
+
})
|
|
1409
|
+
});
|
|
1410
|
+
}
|
|
1411
|
+
function _t({ label: e, tags: t, placeholder: n, readOnly: r = !1, onValueChange: i }) {
|
|
1412
|
+
return /* @__PURE__ */ V(gt, {
|
|
1413
|
+
label: e,
|
|
1414
|
+
value: t.join(", "),
|
|
1415
|
+
placeholder: n,
|
|
1416
|
+
readOnly: r,
|
|
1417
|
+
onCommit: (e) => {
|
|
1418
|
+
let n = e.split(",").map((e) => e.trim()).filter(Boolean);
|
|
1419
|
+
(n.length !== t.length || n.some((e, n) => e !== t[n])) && i(n);
|
|
1420
|
+
}
|
|
1421
|
+
});
|
|
1422
|
+
}
|
|
1423
|
+
function vt({ item: e, collections: t = [], accessors: n, strings: a, onClose: o, onUpdate: c, readOnly: u = !1, mutationError: m, onRemove: h, allowDelete: g = !0, onReplace: _, renderDetail: v }) {
|
|
1005
1424
|
if (!e) return null;
|
|
1006
|
-
let
|
|
1425
|
+
let b = n.getName(e), x = n.getType(e), S = n.getSrc(e), C = n.getCollection(e), ee = n.getTags(e), T = n.getPublic(e) ?? !0, ne = u ? () => Promise.resolve(!1) : c, E = v?.(e, {
|
|
1007
1426
|
accessors: n,
|
|
1008
|
-
update:
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1427
|
+
update: ne,
|
|
1428
|
+
mutationError: m,
|
|
1429
|
+
remove: g ? h : () => Promise.resolve(!1),
|
|
1430
|
+
replace: _,
|
|
1431
|
+
close: o
|
|
1012
1432
|
});
|
|
1013
|
-
return
|
|
1433
|
+
return E ? /* @__PURE__ */ V(he, { children: E }) : /* @__PURE__ */ H("aside", {
|
|
1014
1434
|
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",
|
|
1015
|
-
children: [/* @__PURE__ */
|
|
1016
|
-
className: "media-library-detail-panel--header
|
|
1017
|
-
children: /* @__PURE__ */
|
|
1435
|
+
children: [/* @__PURE__ */ V("div", {
|
|
1436
|
+
className: r("media-library-detail-panel--header p-surface", d.header),
|
|
1437
|
+
children: /* @__PURE__ */ H(l, {
|
|
1018
1438
|
direction: "horizontal",
|
|
1019
1439
|
align: "center",
|
|
1020
1440
|
gap: "md",
|
|
1021
|
-
children: [/* @__PURE__ */
|
|
1441
|
+
children: [/* @__PURE__ */ V(s, {
|
|
1022
1442
|
type: "button",
|
|
1023
1443
|
tone: "secondary",
|
|
1024
1444
|
buttonStyle: "ghost",
|
|
1025
1445
|
size: "sm",
|
|
1026
1446
|
iconOnly: !0,
|
|
1027
|
-
"aria-label":
|
|
1447
|
+
"aria-label": a.detail.close,
|
|
1028
1448
|
"data-media-detail-close": "",
|
|
1029
|
-
onClick:
|
|
1030
|
-
children: /* @__PURE__ */
|
|
1031
|
-
}), /* @__PURE__ */
|
|
1449
|
+
onClick: o,
|
|
1450
|
+
children: /* @__PURE__ */ V(ge, { className: "size-icon-md" })
|
|
1451
|
+
}), /* @__PURE__ */ V(i, {
|
|
1032
1452
|
weight: "semibold",
|
|
1033
|
-
children:
|
|
1453
|
+
children: a.detail.title
|
|
1034
1454
|
})]
|
|
1035
1455
|
})
|
|
1036
|
-
}), /* @__PURE__ */
|
|
1456
|
+
}), /* @__PURE__ */ H("div", {
|
|
1037
1457
|
className: "media-library-detail-panel--body grid min-h-0 auto-rows-max gap-space-xl overflow-y-auto p-surface",
|
|
1038
1458
|
children: [
|
|
1039
|
-
/* @__PURE__ */
|
|
1459
|
+
/* @__PURE__ */ H(Z, {
|
|
1040
1460
|
tint: n.getTint(e),
|
|
1041
1461
|
className: "aspect-[4/3] rounded-radius border border-border",
|
|
1042
|
-
children: [/* @__PURE__ */
|
|
1043
|
-
src:
|
|
1044
|
-
alt: n.getAlt(e) ||
|
|
1045
|
-
type:
|
|
1462
|
+
children: [/* @__PURE__ */ V(dt, {
|
|
1463
|
+
src: S,
|
|
1464
|
+
alt: n.getAlt(e) || b,
|
|
1465
|
+
type: x,
|
|
1046
1466
|
className: "size-full object-cover"
|
|
1047
|
-
}),
|
|
1467
|
+
}), x === "video" && !!n.getDuration(e) && /* @__PURE__ */ H(k, {
|
|
1048
1468
|
className: "absolute bottom-2 right-2 bg-inverse-background text-inverse-foreground",
|
|
1049
|
-
children: [/* @__PURE__ */
|
|
1469
|
+
children: [/* @__PURE__ */ V(De, { className: "size-icon-sm fill-current" }), n.getDuration(e)]
|
|
1050
1470
|
})]
|
|
1051
1471
|
}),
|
|
1052
|
-
/* @__PURE__ */
|
|
1472
|
+
/* @__PURE__ */ V(i, {
|
|
1053
1473
|
tag: "div",
|
|
1054
1474
|
weight: "semibold",
|
|
1055
1475
|
className: "break-words",
|
|
1056
|
-
children:
|
|
1476
|
+
children: b
|
|
1057
1477
|
}),
|
|
1058
|
-
/* @__PURE__ */
|
|
1478
|
+
/* @__PURE__ */ V(N, {
|
|
1059
1479
|
layout: "rows",
|
|
1060
1480
|
valueAlign: "end",
|
|
1061
1481
|
density: "compact",
|
|
@@ -1063,231 +1483,257 @@ function We({ item: e, collections: t = [], accessors: n, strings: o, onClose: s
|
|
|
1063
1483
|
items: [
|
|
1064
1484
|
{
|
|
1065
1485
|
id: "type",
|
|
1066
|
-
label:
|
|
1067
|
-
value:
|
|
1486
|
+
label: a.detail.type,
|
|
1487
|
+
value: Y(x, a)
|
|
1068
1488
|
},
|
|
1069
1489
|
{
|
|
1070
1490
|
id: "size",
|
|
1071
|
-
label:
|
|
1072
|
-
value: /* @__PURE__ */
|
|
1491
|
+
label: a.detail.size,
|
|
1492
|
+
value: /* @__PURE__ */ V(w, {
|
|
1073
1493
|
value: n.getSize(e),
|
|
1074
|
-
emptyLabel:
|
|
1494
|
+
emptyLabel: a.unknownSize
|
|
1075
1495
|
})
|
|
1076
1496
|
},
|
|
1077
1497
|
{
|
|
1078
1498
|
id: "dimensions",
|
|
1079
|
-
label:
|
|
1080
|
-
value: /* @__PURE__ */
|
|
1499
|
+
label: a.detail.dimensions,
|
|
1500
|
+
value: /* @__PURE__ */ V(te, {
|
|
1081
1501
|
width: n.getWidth(e),
|
|
1082
1502
|
height: n.getHeight(e),
|
|
1083
|
-
emptyLabel:
|
|
1503
|
+
emptyLabel: a.unknownSize
|
|
1084
1504
|
})
|
|
1085
1505
|
},
|
|
1086
1506
|
{
|
|
1087
1507
|
id: "uploaded",
|
|
1088
|
-
label:
|
|
1089
|
-
value:
|
|
1508
|
+
label: a.detail.uploaded,
|
|
1509
|
+
value: /* @__PURE__ */ V(ut, { value: n.getUploadedAt(e) })
|
|
1090
1510
|
},
|
|
1091
1511
|
{
|
|
1092
1512
|
id: "used-in",
|
|
1093
|
-
label:
|
|
1094
|
-
value:
|
|
1513
|
+
label: a.detail.usedIn,
|
|
1514
|
+
value: lt(n.getUsageCount(e), a)
|
|
1095
1515
|
}
|
|
1096
1516
|
]
|
|
1097
1517
|
}),
|
|
1098
|
-
/* @__PURE__ */
|
|
1099
|
-
|
|
1100
|
-
children: /* @__PURE__ */
|
|
1101
|
-
value: n.getAlt(e) ?? "",
|
|
1102
|
-
placeholder: o.detail.altPlaceholder,
|
|
1103
|
-
onChange: (e) => c({ alt: e.target.value })
|
|
1104
|
-
})
|
|
1518
|
+
m && /* @__PURE__ */ V(f, {
|
|
1519
|
+
tone: "destructive",
|
|
1520
|
+
children: /* @__PURE__ */ V(p, { children: a.detail.mutationError ?? U.detail.mutationError })
|
|
1105
1521
|
}),
|
|
1106
|
-
/* @__PURE__ */
|
|
1107
|
-
label:
|
|
1108
|
-
|
|
1109
|
-
|
|
1522
|
+
/* @__PURE__ */ V(gt, {
|
|
1523
|
+
label: a.detail.altText,
|
|
1524
|
+
value: n.getAlt(e) ?? "",
|
|
1525
|
+
placeholder: a.detail.altPlaceholder,
|
|
1526
|
+
readOnly: u,
|
|
1527
|
+
onCommit: (e) => ne({ alt: e })
|
|
1528
|
+
}, `alt:${n.getId(e)}`),
|
|
1529
|
+
/* @__PURE__ */ V(A, {
|
|
1530
|
+
label: a.detail.collection,
|
|
1531
|
+
children: /* @__PURE__ */ V(M, {
|
|
1532
|
+
value: C,
|
|
1110
1533
|
options: t.map((e) => ({
|
|
1111
1534
|
value: e.value,
|
|
1112
1535
|
label: String(e.label)
|
|
1113
1536
|
})),
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
/* @__PURE__ */ F(T, {
|
|
1119
|
-
label: o.detail.tags,
|
|
1120
|
-
children: /* @__PURE__ */ F(w, {
|
|
1121
|
-
value: v.join(", "),
|
|
1122
|
-
placeholder: o.detail.tagsPlaceholder,
|
|
1123
|
-
onChange: (e) => c({ tags: e.target.value.split(",").map((e) => e.trim()).filter(Boolean) })
|
|
1537
|
+
placeholder: a.detail.noCollection ?? U.detail.noCollection,
|
|
1538
|
+
"aria-label": a.detail.collection,
|
|
1539
|
+
readOnly: u,
|
|
1540
|
+
onValueChange: (e) => ne({ collection: e })
|
|
1124
1541
|
})
|
|
1125
1542
|
}),
|
|
1126
|
-
/* @__PURE__ */
|
|
1543
|
+
/* @__PURE__ */ V(_t, {
|
|
1544
|
+
label: a.detail.tags,
|
|
1545
|
+
tags: ee,
|
|
1546
|
+
placeholder: a.detail.tagsPlaceholder,
|
|
1547
|
+
readOnly: u,
|
|
1548
|
+
onValueChange: (e) => ne({ tags: e })
|
|
1549
|
+
}, n.getId(e)),
|
|
1550
|
+
/* @__PURE__ */ V("div", {
|
|
1127
1551
|
className: "media-library-detail-panel--public",
|
|
1128
|
-
children: /* @__PURE__ */
|
|
1552
|
+
children: /* @__PURE__ */ H(l, {
|
|
1129
1553
|
direction: "horizontal",
|
|
1130
1554
|
align: "center",
|
|
1131
1555
|
justify: "between",
|
|
1132
1556
|
gap: "xl",
|
|
1133
|
-
children: [/* @__PURE__ */
|
|
1557
|
+
children: [/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V(i, {
|
|
1134
1558
|
weight: "semibold",
|
|
1135
|
-
children:
|
|
1136
|
-
}), /* @__PURE__ */
|
|
1559
|
+
children: a.detail.public
|
|
1560
|
+
}), /* @__PURE__ */ V(i, {
|
|
1137
1561
|
size: "xs",
|
|
1138
1562
|
type: "secondary",
|
|
1139
|
-
children:
|
|
1140
|
-
})] }), /* @__PURE__ */
|
|
1141
|
-
"aria-label":
|
|
1142
|
-
checked:
|
|
1143
|
-
|
|
1563
|
+
children: T ? a.detail.publicHint : a.detail.privateHint
|
|
1564
|
+
})] }), /* @__PURE__ */ V(j, {
|
|
1565
|
+
"aria-label": a.detail.public,
|
|
1566
|
+
checked: T,
|
|
1567
|
+
readOnly: u,
|
|
1568
|
+
onValueChange: (e) => ne({ public: e })
|
|
1144
1569
|
})]
|
|
1145
1570
|
})
|
|
1146
1571
|
}),
|
|
1147
|
-
/* @__PURE__ */
|
|
1148
|
-
className: r("media-library-detail-panel--actions flex flex-wrap",
|
|
1149
|
-
children: [
|
|
1572
|
+
(_ || g) && /* @__PURE__ */ H("div", {
|
|
1573
|
+
className: r("media-library-detail-panel--actions flex flex-wrap", y.commands),
|
|
1574
|
+
children: [_ && /* @__PURE__ */ V(s, {
|
|
1150
1575
|
type: "button",
|
|
1151
1576
|
tone: "secondary",
|
|
1152
1577
|
buttonStyle: "outline",
|
|
1153
|
-
onClick:
|
|
1154
|
-
children:
|
|
1155
|
-
}), /* @__PURE__ */
|
|
1578
|
+
onClick: _,
|
|
1579
|
+
children: a.detail.replace
|
|
1580
|
+
}), g && /* @__PURE__ */ V(s, {
|
|
1156
1581
|
type: "button",
|
|
1157
1582
|
tone: "destructive",
|
|
1158
1583
|
buttonStyle: "ghost",
|
|
1159
|
-
onClick:
|
|
1160
|
-
children:
|
|
1584
|
+
onClick: h,
|
|
1585
|
+
children: a.detail.delete
|
|
1161
1586
|
})]
|
|
1162
1587
|
})
|
|
1163
1588
|
]
|
|
1164
1589
|
})]
|
|
1165
1590
|
});
|
|
1166
1591
|
}
|
|
1167
|
-
function
|
|
1168
|
-
|
|
1592
|
+
function yt({ stagedFiles: e, uploadOptions: t, collections: n = [], uploading: r = !1, hasUploadError: a = !1, accept: o = Re, maxFileSize: c, maxFiles: u, rejections: d = [], strings: m, onFiles: h, onRemoveFile: g, onOptionsChange: v, empty: y }) {
|
|
1593
|
+
let b = c === void 0 ? void 0 : ee(c) ?? void 0, x = (e) => m.upload[e] ?? U.upload[e] ?? "", S = b ? `${m.upload.dropHint} · ${W(x("sizeLimitHint"), { size: b })}` : m.upload.dropHint, C = [...d.filter((e) => e.reason !== "count").map((e) => W(x(e.reason === "type" ? "unsupportedType" : "tooLarge"), {
|
|
1594
|
+
name: e.name,
|
|
1595
|
+
size: b ?? ""
|
|
1596
|
+
})), ...d.some((e) => e.reason === "count") ? [W(x("tooMany"), { count: u ?? 0 })] : []];
|
|
1597
|
+
return /* @__PURE__ */ V("div", {
|
|
1169
1598
|
className: "media-library-upload-panel--component p-surface",
|
|
1170
|
-
children: /* @__PURE__ */
|
|
1599
|
+
children: /* @__PURE__ */ H(l, {
|
|
1171
1600
|
gap: "xl",
|
|
1172
1601
|
children: [
|
|
1173
|
-
/* @__PURE__ */
|
|
1174
|
-
onDrop:
|
|
1175
|
-
accept:
|
|
1602
|
+
/* @__PURE__ */ V(de, {
|
|
1603
|
+
onDrop: h,
|
|
1604
|
+
accept: o,
|
|
1176
1605
|
multiple: !0,
|
|
1177
1606
|
size: "md",
|
|
1178
1607
|
strings: {
|
|
1179
|
-
instruction:
|
|
1180
|
-
helper:
|
|
1181
|
-
dragOver:
|
|
1608
|
+
instruction: m.upload.dropTitle,
|
|
1609
|
+
helper: S,
|
|
1610
|
+
dragOver: m.upload.dragOver
|
|
1182
1611
|
}
|
|
1183
1612
|
}),
|
|
1184
|
-
|
|
1613
|
+
C.length > 0 && /* @__PURE__ */ V(f, {
|
|
1614
|
+
tone: "destructive",
|
|
1615
|
+
className: "media-library-upload-panel--rejections",
|
|
1616
|
+
children: /* @__PURE__ */ V(p, { children: /* @__PURE__ */ V(l, {
|
|
1617
|
+
gap: "xs",
|
|
1618
|
+
children: C.map((e) => /* @__PURE__ */ V(i, {
|
|
1619
|
+
tag: "span",
|
|
1620
|
+
size: "inherit",
|
|
1621
|
+
type: "inherit",
|
|
1622
|
+
children: e
|
|
1623
|
+
}, e))
|
|
1624
|
+
}) })
|
|
1625
|
+
}),
|
|
1626
|
+
a && /* @__PURE__ */ V(f, {
|
|
1627
|
+
tone: "destructive",
|
|
1628
|
+
children: /* @__PURE__ */ V(p, { children: m.upload.error ?? U.upload.error })
|
|
1629
|
+
}),
|
|
1630
|
+
e.length > 0 ? /* @__PURE__ */ V(l, {
|
|
1185
1631
|
gap: "md",
|
|
1186
1632
|
className: "media-library-upload-panel--staged",
|
|
1187
|
-
children: e.map((e) => /* @__PURE__ */
|
|
1633
|
+
children: e.map((e) => /* @__PURE__ */ H("div", {
|
|
1188
1634
|
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",
|
|
1189
1635
|
children: [
|
|
1190
|
-
/* @__PURE__ */
|
|
1636
|
+
/* @__PURE__ */ V(Z, {
|
|
1191
1637
|
className: "size-10 rounded-radius",
|
|
1192
|
-
children: e.src ? /* @__PURE__ */
|
|
1638
|
+
children: e.src ? /* @__PURE__ */ V("img", {
|
|
1193
1639
|
src: e.src,
|
|
1194
1640
|
alt: e.name,
|
|
1195
1641
|
className: "size-full object-cover"
|
|
1196
|
-
}) : /* @__PURE__ */
|
|
1642
|
+
}) : /* @__PURE__ */ V("div", {
|
|
1197
1643
|
className: "flex size-full items-center justify-center text-muted-foreground",
|
|
1198
|
-
children:
|
|
1644
|
+
children: ct(e.type, "size-icon")
|
|
1199
1645
|
})
|
|
1200
1646
|
}),
|
|
1201
|
-
/* @__PURE__ */
|
|
1647
|
+
/* @__PURE__ */ H(l, {
|
|
1202
1648
|
gap: "md",
|
|
1203
1649
|
className: "min-w-0 flex-1",
|
|
1204
1650
|
children: [
|
|
1205
|
-
/* @__PURE__ */
|
|
1651
|
+
/* @__PURE__ */ H("div", {
|
|
1206
1652
|
className: "flex items-baseline gap-space-lg",
|
|
1207
|
-
children: [/* @__PURE__ */
|
|
1653
|
+
children: [/* @__PURE__ */ V(i, {
|
|
1208
1654
|
type: "inherit",
|
|
1209
1655
|
weight: "semibold",
|
|
1210
1656
|
className: "truncate",
|
|
1211
1657
|
children: e.name
|
|
1212
|
-
}), /* @__PURE__ */
|
|
1658
|
+
}), /* @__PURE__ */ V(w, {
|
|
1213
1659
|
value: e.size,
|
|
1214
1660
|
size: "xs",
|
|
1215
1661
|
className: "ml-auto shrink-0"
|
|
1216
1662
|
})]
|
|
1217
1663
|
}),
|
|
1218
|
-
(e.status === "uploading" || e.status === "done") && /* @__PURE__ */
|
|
1664
|
+
(e.status === "uploading" || e.status === "done") && /* @__PURE__ */ V(_, {
|
|
1219
1665
|
value: e.progress,
|
|
1220
1666
|
size: "sm",
|
|
1221
1667
|
"aria-label": e.name
|
|
1222
1668
|
}),
|
|
1223
|
-
e.status === "error" && /* @__PURE__ */
|
|
1669
|
+
e.status === "error" && /* @__PURE__ */ V(i, {
|
|
1224
1670
|
type: "error",
|
|
1225
1671
|
children: e.error
|
|
1226
1672
|
})
|
|
1227
1673
|
]
|
|
1228
1674
|
}),
|
|
1229
|
-
e.status === "done" ? /* @__PURE__ */
|
|
1675
|
+
e.status === "done" ? /* @__PURE__ */ V(k, {
|
|
1230
1676
|
tone: "success",
|
|
1231
|
-
children:
|
|
1232
|
-
}) : e.status === "uploading" ? /* @__PURE__ */
|
|
1677
|
+
children: m.upload.done
|
|
1678
|
+
}) : e.status === "uploading" ? /* @__PURE__ */ V(T, {
|
|
1233
1679
|
value: Math.round(e.progress),
|
|
1234
1680
|
scaled: !0,
|
|
1235
1681
|
size: "xs",
|
|
1236
1682
|
type: "secondary"
|
|
1237
|
-
}) : /* @__PURE__ */
|
|
1683
|
+
}) : /* @__PURE__ */ V(s, {
|
|
1238
1684
|
type: "button",
|
|
1239
1685
|
tone: "secondary",
|
|
1240
1686
|
buttonStyle: "ghost",
|
|
1241
1687
|
size: "sm",
|
|
1242
1688
|
iconOnly: !0,
|
|
1243
1689
|
disabled: r,
|
|
1244
|
-
"aria-label":
|
|
1245
|
-
onClick: () =>
|
|
1246
|
-
children: /* @__PURE__ */
|
|
1690
|
+
"aria-label": W(m.upload.removeFile, { name: e.name }),
|
|
1691
|
+
onClick: () => g(e.id),
|
|
1692
|
+
children: /* @__PURE__ */ V(Pe, { className: "size-icon-md" })
|
|
1247
1693
|
})
|
|
1248
1694
|
]
|
|
1249
1695
|
}, e.id))
|
|
1250
|
-
}) :
|
|
1251
|
-
/* @__PURE__ */
|
|
1696
|
+
}) : y,
|
|
1697
|
+
/* @__PURE__ */ H("div", {
|
|
1252
1698
|
className: "media-library-upload-panel--options grid gap-space-lg @2xl/media-library:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto]",
|
|
1253
1699
|
children: [
|
|
1254
|
-
/* @__PURE__ */
|
|
1255
|
-
label:
|
|
1256
|
-
children: /* @__PURE__ */
|
|
1257
|
-
value: t.collection
|
|
1700
|
+
/* @__PURE__ */ V(A, {
|
|
1701
|
+
label: m.upload.collection,
|
|
1702
|
+
children: /* @__PURE__ */ V(M, {
|
|
1703
|
+
value: t.collection,
|
|
1704
|
+
placeholder: m.upload.noCollection ?? U.upload.noCollection,
|
|
1705
|
+
allowClear: !0,
|
|
1258
1706
|
options: n.map((e) => ({
|
|
1259
1707
|
value: e.value,
|
|
1260
1708
|
label: String(e.label)
|
|
1261
1709
|
})),
|
|
1262
|
-
"aria-label":
|
|
1263
|
-
onValueChange: (e) =>
|
|
1710
|
+
"aria-label": m.upload.collection,
|
|
1711
|
+
onValueChange: (e) => v({ collection: e })
|
|
1264
1712
|
})
|
|
1265
1713
|
}),
|
|
1266
|
-
/* @__PURE__ */
|
|
1267
|
-
label:
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
onChange: (e) => u({ tags: e.target.value.split(",").map((e) => e.trim()).filter(Boolean) })
|
|
1272
|
-
})
|
|
1714
|
+
/* @__PURE__ */ V(_t, {
|
|
1715
|
+
label: m.upload.tags,
|
|
1716
|
+
tags: t.tags,
|
|
1717
|
+
placeholder: m.upload.tagsPlaceholder,
|
|
1718
|
+
onValueChange: (e) => v({ tags: e })
|
|
1273
1719
|
}),
|
|
1274
|
-
/* @__PURE__ */
|
|
1720
|
+
/* @__PURE__ */ H(l, {
|
|
1275
1721
|
direction: "horizontal",
|
|
1276
1722
|
align: "center",
|
|
1277
1723
|
justify: "between",
|
|
1278
1724
|
gap: "xl",
|
|
1279
1725
|
className: "@2xl/media-library:self-end",
|
|
1280
|
-
children: [/* @__PURE__ */
|
|
1726
|
+
children: [/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V(i, {
|
|
1281
1727
|
weight: "semibold",
|
|
1282
|
-
children:
|
|
1283
|
-
}), /* @__PURE__ */
|
|
1728
|
+
children: m.upload.public
|
|
1729
|
+
}), /* @__PURE__ */ V(i, {
|
|
1284
1730
|
size: "xs",
|
|
1285
1731
|
type: "secondary",
|
|
1286
|
-
children:
|
|
1287
|
-
})] }), /* @__PURE__ */
|
|
1288
|
-
"aria-label":
|
|
1732
|
+
children: m.upload.publicHint
|
|
1733
|
+
})] }), /* @__PURE__ */ V(j, {
|
|
1734
|
+
"aria-label": m.upload.public,
|
|
1289
1735
|
checked: t.public,
|
|
1290
|
-
onValueChange: (e) =>
|
|
1736
|
+
onValueChange: (e) => v({ public: e })
|
|
1291
1737
|
})]
|
|
1292
1738
|
})
|
|
1293
1739
|
]
|
|
@@ -1296,92 +1742,91 @@ function Ge({ stagedFiles: e, uploadOptions: t, collections: n = [], uploading:
|
|
|
1296
1742
|
})
|
|
1297
1743
|
});
|
|
1298
1744
|
}
|
|
1299
|
-
function
|
|
1300
|
-
let u = t.length, d =
|
|
1301
|
-
return e === "upload" ? /* @__PURE__ */
|
|
1745
|
+
function bt({ tab: e, selectedIds: t, selectionMode: n, stagedFiles: a, strings: o, onClearSelection: c, className: l }) {
|
|
1746
|
+
let u = t.length, d = a.reduce((e, t) => e + t.size, 0), f = a.length, p = r("media-library-footer-summary--component flex min-w-0 items-center gap-space-lg", l);
|
|
1747
|
+
return e === "upload" ? /* @__PURE__ */ V("div", {
|
|
1302
1748
|
className: p,
|
|
1303
1749
|
"aria-live": "polite",
|
|
1304
|
-
children: /* @__PURE__ */
|
|
1750
|
+
children: /* @__PURE__ */ V(i, {
|
|
1305
1751
|
size: "xs",
|
|
1306
1752
|
type: "secondary",
|
|
1307
1753
|
className: "truncate",
|
|
1308
|
-
children: f === 0 ?
|
|
1754
|
+
children: f === 0 ? o.footer.noFiles : W(o.footer.stagedSummary, {
|
|
1309
1755
|
count: f,
|
|
1310
|
-
size:
|
|
1756
|
+
size: ee(d) ?? o.unknownSize
|
|
1311
1757
|
})
|
|
1312
1758
|
})
|
|
1313
|
-
}) : /* @__PURE__ */
|
|
1759
|
+
}) : /* @__PURE__ */ V("div", {
|
|
1314
1760
|
className: p,
|
|
1315
1761
|
"aria-live": "polite",
|
|
1316
|
-
children: u > 0 ? /* @__PURE__ */
|
|
1762
|
+
children: u > 0 ? /* @__PURE__ */ H(he, { children: [/* @__PURE__ */ V(i, {
|
|
1317
1763
|
weight: "semibold",
|
|
1318
1764
|
className: "whitespace-nowrap",
|
|
1319
|
-
children:
|
|
1320
|
-
}), /* @__PURE__ */
|
|
1765
|
+
children: W(o.footer.selectedCount, { count: u })
|
|
1766
|
+
}), /* @__PURE__ */ V(s, {
|
|
1321
1767
|
type: "button",
|
|
1322
1768
|
tone: "secondary",
|
|
1323
1769
|
buttonStyle: "ghost",
|
|
1324
1770
|
size: "sm",
|
|
1325
1771
|
onClick: c,
|
|
1326
|
-
children:
|
|
1327
|
-
})] }) : /* @__PURE__ */
|
|
1772
|
+
children: o.footer.clear
|
|
1773
|
+
})] }) : /* @__PURE__ */ V(i, {
|
|
1328
1774
|
size: "xs",
|
|
1329
1775
|
type: "secondary",
|
|
1330
1776
|
className: "truncate",
|
|
1331
|
-
children: n === "single" ?
|
|
1777
|
+
children: n === "single" ? o.footer.pickOne : o.footer.pickMany
|
|
1332
1778
|
})
|
|
1333
1779
|
});
|
|
1334
1780
|
}
|
|
1335
|
-
function
|
|
1336
|
-
let
|
|
1337
|
-
return e === "upload" ? /* @__PURE__ */
|
|
1338
|
-
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",
|
|
1339
|
-
children: [/* @__PURE__ */
|
|
1781
|
+
function xt({ tab: e, selectedIds: t, stagedFiles: n, uploading: i = !1, strings: a, confirmLabel: o, cancelLabel: c, onCancel: l, onConfirm: u, onUpload: d, onCancelUpload: f, className: p }) {
|
|
1782
|
+
let m = t.length, h = n.length;
|
|
1783
|
+
return e === "upload" ? /* @__PURE__ */ H("div", {
|
|
1784
|
+
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", p),
|
|
1785
|
+
children: [/* @__PURE__ */ V(s, {
|
|
1340
1786
|
type: "button",
|
|
1341
1787
|
tone: "secondary",
|
|
1342
1788
|
buttonStyle: "ghost",
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
}), /* @__PURE__ */ F(i, {
|
|
1789
|
+
onClick: f,
|
|
1790
|
+
children: c ?? a.footer.cancel
|
|
1791
|
+
}), /* @__PURE__ */ V(s, {
|
|
1347
1792
|
tone: "primary",
|
|
1348
1793
|
type: "button",
|
|
1349
|
-
disabled:
|
|
1350
|
-
onClick:
|
|
1351
|
-
loading:
|
|
1352
|
-
strings: { loading:
|
|
1353
|
-
children:
|
|
1354
|
-
})]
|
|
1355
|
-
}) : /* @__PURE__ */
|
|
1356
|
-
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",
|
|
1357
|
-
children: [/* @__PURE__ */
|
|
1794
|
+
disabled: h === 0 || i,
|
|
1795
|
+
onClick: d,
|
|
1796
|
+
loading: i,
|
|
1797
|
+
strings: { loading: a.footer.uploading },
|
|
1798
|
+
children: h <= 1 ? a.footer.upload : W(a.footer.uploadMany, { count: h })
|
|
1799
|
+
}, "upload")]
|
|
1800
|
+
}) : /* @__PURE__ */ H("div", {
|
|
1801
|
+
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", p),
|
|
1802
|
+
children: [/* @__PURE__ */ V(s, {
|
|
1358
1803
|
type: "button",
|
|
1359
1804
|
tone: "secondary",
|
|
1360
1805
|
buttonStyle: "ghost",
|
|
1361
|
-
onClick:
|
|
1362
|
-
children:
|
|
1363
|
-
}), /* @__PURE__ */
|
|
1806
|
+
onClick: l,
|
|
1807
|
+
children: c ?? a.footer.cancel
|
|
1808
|
+
}), /* @__PURE__ */ V(s, {
|
|
1364
1809
|
tone: "primary",
|
|
1365
1810
|
type: "button",
|
|
1366
|
-
disabled:
|
|
1367
|
-
onClick:
|
|
1368
|
-
children:
|
|
1369
|
-
})]
|
|
1811
|
+
disabled: m === 0,
|
|
1812
|
+
onClick: u,
|
|
1813
|
+
children: o ?? (m === 0 ? a.footer.confirmEmpty : m === 1 ? a.footer.confirmOne : W(a.footer.confirmMany, { count: m }))
|
|
1814
|
+
}, "confirm")]
|
|
1370
1815
|
});
|
|
1371
1816
|
}
|
|
1372
|
-
function
|
|
1373
|
-
return /* @__PURE__ */
|
|
1374
|
-
className: r("media-library-footer--component",
|
|
1375
|
-
children: /* @__PURE__ */
|
|
1817
|
+
function St({ tab: e, selectedItems: t, selectedIds: n, selectionMode: i, stagedFiles: a, uploading: o = !1, strings: s, confirmLabel: c, cancelLabel: l, onCancel: u, onConfirm: f, onClearSelection: p, onUpload: m, onCancelUpload: h, chrome: g = "section", className: _ }) {
|
|
1818
|
+
return /* @__PURE__ */ V("footer", {
|
|
1819
|
+
className: r("media-library-footer--component", g === "section" && r("bg-background text-foreground p-surface", d.footer), _),
|
|
1820
|
+
children: /* @__PURE__ */ H("div", {
|
|
1376
1821
|
className: "flex min-w-0 flex-col gap-space-lg @md/media-library:flex-row @md/media-library:justify-between",
|
|
1377
|
-
children: [/* @__PURE__ */
|
|
1822
|
+
children: [/* @__PURE__ */ V(bt, {
|
|
1378
1823
|
tab: e,
|
|
1379
1824
|
selectedIds: n,
|
|
1380
1825
|
selectionMode: i,
|
|
1381
1826
|
stagedFiles: a,
|
|
1382
1827
|
strings: s,
|
|
1383
|
-
onClearSelection:
|
|
1384
|
-
}), /* @__PURE__ */
|
|
1828
|
+
onClearSelection: p
|
|
1829
|
+
}), /* @__PURE__ */ V(xt, {
|
|
1385
1830
|
tab: e,
|
|
1386
1831
|
selectedItems: t,
|
|
1387
1832
|
selectedIds: n,
|
|
@@ -1391,18 +1836,30 @@ function Z({ tab: e, selectedItems: t, selectedIds: n, selectionMode: i, stagedF
|
|
|
1391
1836
|
confirmLabel: c,
|
|
1392
1837
|
cancelLabel: l,
|
|
1393
1838
|
onCancel: u,
|
|
1394
|
-
onConfirm:
|
|
1395
|
-
onUpload:
|
|
1396
|
-
onCancelUpload:
|
|
1839
|
+
onConfirm: f,
|
|
1840
|
+
onUpload: m,
|
|
1841
|
+
onCancelUpload: h
|
|
1397
1842
|
})]
|
|
1398
1843
|
})
|
|
1399
1844
|
});
|
|
1400
1845
|
}
|
|
1401
1846
|
//#endregion
|
|
1402
1847
|
//#region src/components/features/media-library/media-library.tsx
|
|
1403
|
-
var
|
|
1404
|
-
function
|
|
1405
|
-
|
|
1848
|
+
var Ct = pe(null);
|
|
1849
|
+
function wt({ tab: e, children: t }) {
|
|
1850
|
+
let n = "media-library--body flex min-h-0 flex-1";
|
|
1851
|
+
return e ? /* @__PURE__ */ V(ce, {
|
|
1852
|
+
value: e,
|
|
1853
|
+
tabIndex: -1,
|
|
1854
|
+
className: n,
|
|
1855
|
+
children: t
|
|
1856
|
+
}) : /* @__PURE__ */ V("div", {
|
|
1857
|
+
className: n,
|
|
1858
|
+
children: t
|
|
1859
|
+
});
|
|
1860
|
+
}
|
|
1861
|
+
function Tt(e, t, n) {
|
|
1862
|
+
return R(() => {
|
|
1406
1863
|
if (e) return e;
|
|
1407
1864
|
let r = /* @__PURE__ */ new Set();
|
|
1408
1865
|
for (let e of t) {
|
|
@@ -1419,374 +1876,432 @@ function Ye(e, t, n) {
|
|
|
1419
1876
|
t
|
|
1420
1877
|
]);
|
|
1421
1878
|
}
|
|
1422
|
-
function
|
|
1423
|
-
let
|
|
1424
|
-
items:
|
|
1425
|
-
fetcher:
|
|
1426
|
-
|
|
1879
|
+
function Et({ title: e, titleSuffix: t, description: a, confirmLabel: c, cancelLabel: u, selectionMode: _ = "multiple", density: v = "comfortable", showMeta: y = !0, allowUpload: b = !0, typeFilters: x, confirmOnSelect: C = !1, onConfirm: ee, onCancel: w, onClose: te, bulkActions: T, strings: E, slots: D, heightClassName: O, className: ie, items: A, fetcher: j, refreshKey: M, pageSize: ae, accessors: oe, collections: se, value: N, defaultValue: ce, onValueChange: de, onItemUpdate: fe, onItemDelete: F, onItemReplace: pe, onItemOpen: I, onUpload: R, uploadAccept: ge, maxFileSize: _e, maxFiles: ve, uploadFailedMessage: ye, onError: be, selecting: Se, defaultSelecting: Ce, onSelectingChange: we, tab: Te, defaultTab: Ee, onTabChange: De, view: Oe, defaultView: ke, onViewChange: Ae, query: je, defaultQuery: Ne, onQueryChange: Pe, type: Ie, defaultType: Le, onTypeChange: Re, collection: ze, defaultCollection: Be, onCollectionChange: Ve, sort: He, defaultSort: Ue, onSortChange: We, uploadOptions: Ge, defaultUploadOptions: Ke, onUploadOptionsChange: qe, ...Je }) {
|
|
1880
|
+
let G = n(U, E), K = at({
|
|
1881
|
+
items: A,
|
|
1882
|
+
fetcher: j,
|
|
1883
|
+
refreshKey: M,
|
|
1884
|
+
pageSize: ae,
|
|
1885
|
+
accessors: oe,
|
|
1427
1886
|
collections: se,
|
|
1428
|
-
selectionMode:
|
|
1429
|
-
value:
|
|
1887
|
+
selectionMode: _,
|
|
1888
|
+
value: N,
|
|
1430
1889
|
defaultValue: ce,
|
|
1431
|
-
onValueChange:
|
|
1432
|
-
onItemUpdate:
|
|
1433
|
-
onItemDelete:
|
|
1434
|
-
onUpload:
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1890
|
+
onValueChange: de,
|
|
1891
|
+
onItemUpdate: fe,
|
|
1892
|
+
onItemDelete: F,
|
|
1893
|
+
onUpload: R,
|
|
1894
|
+
uploadAccept: ge,
|
|
1895
|
+
maxFileSize: _e,
|
|
1896
|
+
maxFiles: ve,
|
|
1897
|
+
uploadFailedMessage: ye ?? G.upload.fileFailed ?? U.upload.fileFailed,
|
|
1898
|
+
onError: be,
|
|
1899
|
+
tab: Te,
|
|
1900
|
+
defaultTab: Ee,
|
|
1901
|
+
onTabChange: De,
|
|
1902
|
+
view: Oe,
|
|
1903
|
+
defaultView: ke,
|
|
1904
|
+
onViewChange: Ae,
|
|
1905
|
+
query: je,
|
|
1906
|
+
defaultQuery: Ne,
|
|
1907
|
+
onQueryChange: Pe,
|
|
1908
|
+
type: Ie,
|
|
1909
|
+
defaultType: Le,
|
|
1910
|
+
onTypeChange: Re,
|
|
1911
|
+
collection: ze,
|
|
1912
|
+
defaultCollection: Be,
|
|
1913
|
+
onCollectionChange: Ve,
|
|
1914
|
+
sort: He,
|
|
1915
|
+
defaultSort: Ue,
|
|
1916
|
+
onSortChange: We,
|
|
1917
|
+
uploadOptions: Ge,
|
|
1918
|
+
defaultUploadOptions: Ke,
|
|
1919
|
+
onUploadOptionsChange: qe,
|
|
1920
|
+
selecting: Se,
|
|
1921
|
+
defaultSelecting: Ce ?? C,
|
|
1922
|
+
onSelectingChange: we
|
|
1923
|
+
}), Ye = Tt(se, K.items, K.accessors.getCollection), Xe = b ? K.tab : "library", [q, Ze] = B(null), Qe = z(null), $e = q ? K.accessors.getId(q.item) : null, et = K.detailId ? K.items.find((e) => K.accessors.getId(e) === K.detailId) ?? ($e === K.detailId ? q?.item ?? null : null) : null, tt = K.mutationError?.operation === "delete" && K.mutationError.itemId === $e, nt = me(Ct), rt = !D?.footer, it = nt && rt ? /* @__PURE__ */ V(bt, {
|
|
1924
|
+
tab: Xe,
|
|
1462
1925
|
selectedIds: K.selectedIds,
|
|
1463
|
-
selectionMode:
|
|
1926
|
+
selectionMode: _,
|
|
1464
1927
|
stagedFiles: K.stagedFiles,
|
|
1465
1928
|
strings: G,
|
|
1466
1929
|
onClearSelection: K.clearSelection,
|
|
1467
1930
|
className: "media-library-dialog--selection-summary shrink-0 justify-end"
|
|
1468
|
-
}) : null,
|
|
1469
|
-
|
|
1470
|
-
},
|
|
1471
|
-
|
|
1472
|
-
},
|
|
1931
|
+
}) : null, ot = !!(e || t || a || D?.headerStart), st = !!(b || D?.headerEnd || it), J = ot || st, ct = () => {
|
|
1932
|
+
ee?.(K.selectedItems, K.selectedIds), te?.();
|
|
1933
|
+
}, Y = () => {
|
|
1934
|
+
w?.(), te?.();
|
|
1935
|
+
}, lt = () => {
|
|
1936
|
+
if (K.uploading) {
|
|
1937
|
+
K.cancelUpload();
|
|
1938
|
+
return;
|
|
1939
|
+
}
|
|
1940
|
+
K.clearStagedFiles(), K.setTab("library");
|
|
1941
|
+
}, X = (e) => {
|
|
1473
1942
|
let t = K.accessors.getId(e);
|
|
1474
|
-
K.toggleSelection(t),
|
|
1475
|
-
},
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1943
|
+
K.toggleSelection(t), C && (ee?.([e], [t]), te?.());
|
|
1944
|
+
}, ut = z(null), Z = z(null), dt = z(null), gt = z(!1), _t = (e) => !F || Qe.current ? Promise.resolve(!1) : new Promise((t) => {
|
|
1945
|
+
let n = {
|
|
1946
|
+
item: e,
|
|
1947
|
+
resolve: t
|
|
1948
|
+
};
|
|
1949
|
+
Qe.current = n, Ze(n);
|
|
1950
|
+
}), Et = (e) => {
|
|
1951
|
+
let t = Qe.current;
|
|
1952
|
+
Qe.current = null, Ze(null), t?.resolve(e);
|
|
1479
1953
|
};
|
|
1480
|
-
|
|
1954
|
+
L(() => () => {
|
|
1955
|
+
Qe.current?.resolve(!1), Qe.current = null;
|
|
1956
|
+
}, []);
|
|
1957
|
+
let Q = (e) => {
|
|
1958
|
+
dt.current = document.activeElement instanceof HTMLElement ? document.activeElement : null, K.setDetailId(e);
|
|
1959
|
+
}, Dt = (e) => {
|
|
1960
|
+
I ? I(e) : Q(K.accessors.getId(e));
|
|
1961
|
+
};
|
|
1962
|
+
L(() => {
|
|
1481
1963
|
if (K.detailId !== null) {
|
|
1482
|
-
|
|
1964
|
+
dt.current && ut.current?.querySelector("[data-media-detail-close]")?.focus();
|
|
1483
1965
|
return;
|
|
1484
1966
|
}
|
|
1485
|
-
let e =
|
|
1486
|
-
|
|
1967
|
+
let e = dt.current;
|
|
1968
|
+
dt.current = null, gt.current ? (gt.current = !1, Z.current?.focus()) : e?.isConnected && e.focus();
|
|
1487
1969
|
}, [K.detailId]);
|
|
1488
|
-
let
|
|
1970
|
+
let Ot = !!j && !K.loading && K.loadError != null, kt = z(!1), At = () => {
|
|
1971
|
+
kt.current = !0, K.loadMore();
|
|
1972
|
+
};
|
|
1973
|
+
L(() => {
|
|
1974
|
+
!K.loadingMore && kt.current && (kt.current = !1, !K.hasMore && document.activeElement === document.body && Z.current?.focus());
|
|
1975
|
+
}, [K.hasMore, K.loadingMore]);
|
|
1976
|
+
let jt = !!K.hasMore && !Ot && !(K.loading && !K.hasLoadedResults), Mt = K.query.trim(), Nt = Mt.length > 0 ? W(G.countSearch, {
|
|
1489
1977
|
count: K.filteredCount,
|
|
1490
1978
|
total: K.totalCount,
|
|
1491
|
-
query:
|
|
1492
|
-
}) : K.filteredCount === K.totalCount ?
|
|
1979
|
+
query: Mt
|
|
1980
|
+
}) : K.filteredCount === K.totalCount ? W(G.countAll, { count: K.totalCount }) : W(G.countFiltered, {
|
|
1493
1981
|
count: K.filteredCount,
|
|
1494
1982
|
total: K.totalCount
|
|
1495
|
-
}),
|
|
1496
|
-
tab:
|
|
1983
|
+
}), Pt = !!T && !(nt || ee && !C), Ft = Xe === "library" ? K.selectedIds.length : 0, It = D?.footer ?? (Pt && Xe === "library" ? null : nt ? /* @__PURE__ */ V(xt, {
|
|
1984
|
+
tab: Xe,
|
|
1497
1985
|
selectedItems: K.selectedItems,
|
|
1498
1986
|
selectedIds: K.selectedIds,
|
|
1499
1987
|
stagedFiles: K.stagedFiles,
|
|
1500
1988
|
uploading: K.uploading,
|
|
1501
1989
|
strings: G,
|
|
1502
|
-
confirmLabel:
|
|
1503
|
-
cancelLabel:
|
|
1504
|
-
onCancel:
|
|
1505
|
-
onConfirm:
|
|
1990
|
+
confirmLabel: c,
|
|
1991
|
+
cancelLabel: u,
|
|
1992
|
+
onCancel: Y,
|
|
1993
|
+
onConfirm: ct,
|
|
1506
1994
|
onUpload: K.startUpload,
|
|
1507
|
-
onCancelUpload:
|
|
1508
|
-
K.cancelUpload(), K.clearStagedFiles(), K.setTab("library");
|
|
1509
|
-
},
|
|
1995
|
+
onCancelUpload: lt,
|
|
1510
1996
|
className: "ml-auto"
|
|
1511
|
-
}) : /* @__PURE__ */
|
|
1512
|
-
tab:
|
|
1997
|
+
}) : /* @__PURE__ */ V(St, {
|
|
1998
|
+
tab: Xe,
|
|
1513
1999
|
selectedItems: K.selectedItems,
|
|
1514
2000
|
selectedIds: K.selectedIds,
|
|
1515
|
-
selectionMode:
|
|
2001
|
+
selectionMode: _,
|
|
1516
2002
|
stagedFiles: K.stagedFiles,
|
|
1517
2003
|
uploading: K.uploading,
|
|
1518
2004
|
strings: G,
|
|
1519
|
-
confirmLabel:
|
|
1520
|
-
cancelLabel:
|
|
1521
|
-
onCancel:
|
|
1522
|
-
onConfirm:
|
|
2005
|
+
confirmLabel: c,
|
|
2006
|
+
cancelLabel: u,
|
|
2007
|
+
onCancel: Y,
|
|
2008
|
+
onConfirm: ct,
|
|
1523
2009
|
onClearSelection: K.clearSelection,
|
|
1524
2010
|
onUpload: K.startUpload,
|
|
1525
|
-
onCancelUpload:
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
2011
|
+
onCancelUpload: lt
|
|
2012
|
+
})), Lt = r("media-library--component @container/media-library box-border flex min-h-0 flex-col overflow-hidden rounded-surface border border-border bg-background text-foreground", O ?? "h-190 max-h-[calc(100vh-7rem)]", ie), Rt = /* @__PURE__ */ H(he, { children: [
|
|
2013
|
+
J && /* @__PURE__ */ H("header", {
|
|
2014
|
+
className: r("media-library--header flex flex-col gap-space-lg p-surface", d.header, "@2xl/media-library:flex-row @2xl/media-library:items-center @2xl/media-library:justify-between"),
|
|
2015
|
+
children: [ot && /* @__PURE__ */ H(l, {
|
|
2016
|
+
direction: "horizontal",
|
|
2017
|
+
align: "start",
|
|
2018
|
+
gap: "lg",
|
|
2019
|
+
className: "min-w-0",
|
|
2020
|
+
children: [D?.headerStart, (e || t || a) && /* @__PURE__ */ H(l, {
|
|
2021
|
+
gap: "normal",
|
|
2022
|
+
className: "min-w-0",
|
|
2023
|
+
children: [!!(e || t) && /* @__PURE__ */ V(m, {
|
|
2024
|
+
title: e,
|
|
2025
|
+
suffix: t,
|
|
2026
|
+
className: "media-library--title"
|
|
2027
|
+
}), !!a && /* @__PURE__ */ V(i, {
|
|
2028
|
+
type: "secondary",
|
|
2029
|
+
children: a
|
|
2030
|
+
})]
|
|
2031
|
+
})]
|
|
2032
|
+
}), st && /* @__PURE__ */ H("div", {
|
|
2033
|
+
className: r("media-library--header-controls flex min-w-0 flex-wrap items-center gap-space-md", it ? "flex-1 justify-between" : "@2xl/media-library:justify-end"),
|
|
2034
|
+
children: [/* @__PURE__ */ H(l, {
|
|
1537
2035
|
direction: "horizontal",
|
|
1538
|
-
|
|
1539
|
-
|
|
2036
|
+
wrap: !0,
|
|
2037
|
+
align: "center",
|
|
2038
|
+
gap: "md",
|
|
1540
2039
|
className: "min-w-0",
|
|
1541
|
-
children: [
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
2040
|
+
children: [b && /* @__PURE__ */ H(le, {
|
|
2041
|
+
className: "media-library--tabs",
|
|
2042
|
+
children: [/* @__PURE__ */ H(P, {
|
|
2043
|
+
value: "library",
|
|
2044
|
+
children: [/* @__PURE__ */ V(xe, { className: "size-icon-md" }), G.tabs.library]
|
|
2045
|
+
}), /* @__PURE__ */ H(P, {
|
|
2046
|
+
value: "upload",
|
|
2047
|
+
children: [
|
|
2048
|
+
/* @__PURE__ */ V(Me, { className: "size-icon-md" }),
|
|
2049
|
+
G.tabs.upload,
|
|
2050
|
+
K.stagedFiles.length > 0 && /* @__PURE__ */ V(k, {
|
|
2051
|
+
size: "sm",
|
|
2052
|
+
tone: "secondary",
|
|
2053
|
+
className: "media-library--staged-count",
|
|
2054
|
+
children: /* @__PURE__ */ V(ne, {
|
|
2055
|
+
value: K.stagedFiles.length,
|
|
2056
|
+
size: "inherit",
|
|
2057
|
+
weight: "inherit",
|
|
2058
|
+
type: "inherit",
|
|
2059
|
+
align: "center"
|
|
2060
|
+
})
|
|
2061
|
+
})
|
|
2062
|
+
]
|
|
1551
2063
|
})]
|
|
1552
|
-
})]
|
|
1553
|
-
}),
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
2064
|
+
}), D?.headerEnd]
|
|
2065
|
+
}), it]
|
|
2066
|
+
})]
|
|
2067
|
+
}),
|
|
2068
|
+
/* @__PURE__ */ H(wt, {
|
|
2069
|
+
tab: b ? Xe : null,
|
|
2070
|
+
children: [Xe === "upload" ? /* @__PURE__ */ V("div", {
|
|
2071
|
+
className: "min-w-0 flex-1 overflow-y-auto",
|
|
2072
|
+
children: /* @__PURE__ */ V(yt, {
|
|
2073
|
+
stagedFiles: K.stagedFiles,
|
|
2074
|
+
uploadOptions: K.uploadOptions,
|
|
2075
|
+
collections: Ye,
|
|
2076
|
+
uploading: K.uploading,
|
|
2077
|
+
hasUploadError: K.uploadError != null && K.stagedFiles.length > 0,
|
|
2078
|
+
accept: ge,
|
|
2079
|
+
maxFileSize: _e,
|
|
2080
|
+
maxFiles: ve,
|
|
2081
|
+
rejections: K.uploadRejections,
|
|
2082
|
+
strings: G,
|
|
2083
|
+
onFiles: K.addFiles,
|
|
2084
|
+
onRemoveFile: K.removeStagedFile,
|
|
2085
|
+
onOptionsChange: K.updateUploadOptions,
|
|
2086
|
+
empty: D?.uploadEmpty
|
|
2087
|
+
})
|
|
2088
|
+
}) : /* @__PURE__ */ H("div", {
|
|
2089
|
+
className: r("media-library--library min-w-0 flex-1 flex-col", et ? "hidden @2xl/media-library:flex" : "flex"),
|
|
2090
|
+
children: [/* @__PURE__ */ V(l, {
|
|
2091
|
+
gap: "md",
|
|
2092
|
+
className: r("media-library--toolbar p-surface", d.header),
|
|
2093
|
+
children: /* @__PURE__ */ V(pt, {
|
|
2094
|
+
query: K.query,
|
|
2095
|
+
type: K.type,
|
|
2096
|
+
typeFilters: x,
|
|
2097
|
+
collection: K.collection,
|
|
2098
|
+
sort: K.sort,
|
|
2099
|
+
view: K.view,
|
|
2100
|
+
collections: Ye,
|
|
2101
|
+
strings: G,
|
|
2102
|
+
onQueryChange: K.setQuery,
|
|
2103
|
+
onTypeChange: K.setType,
|
|
2104
|
+
onCollectionChange: K.setCollection,
|
|
2105
|
+
onSortChange: K.setSort,
|
|
2106
|
+
onViewChange: K.setView,
|
|
2107
|
+
onClearFilters: K.clearFilters,
|
|
2108
|
+
toolbarEnd: D?.toolbarEnd,
|
|
2109
|
+
selecting: K.selecting,
|
|
2110
|
+
onSelectingChange: K.setSelecting,
|
|
2111
|
+
disabled: Ot,
|
|
2112
|
+
summary: /* @__PURE__ */ V("span", {
|
|
2113
|
+
"aria-live": "polite",
|
|
2114
|
+
className: "media-library--count min-w-0 truncate",
|
|
2115
|
+
children: Ot || K.loading ? null : /* @__PURE__ */ V(i, {
|
|
2116
|
+
tag: "span",
|
|
2117
|
+
size: "xs",
|
|
2118
|
+
type: "secondary",
|
|
2119
|
+
children: Nt
|
|
2120
|
+
})
|
|
2121
|
+
})
|
|
2122
|
+
})
|
|
2123
|
+
}), /* @__PURE__ */ H("div", {
|
|
2124
|
+
ref: Z,
|
|
2125
|
+
role: "region",
|
|
2126
|
+
"aria-label": G.resultsLabel,
|
|
2127
|
+
"aria-busy": K.loading || void 0,
|
|
2128
|
+
tabIndex: 0,
|
|
2129
|
+
className: `media-library--results flex min-h-0 flex-1 flex-col gap-space-lg overflow-y-auto p-surface focus-visible:outline-none ${o.inset}`,
|
|
2130
|
+
children: [K.loading && !K.hasLoadedResults ? /* @__PURE__ */ V("div", {
|
|
2131
|
+
className: "media-library--state my-auto",
|
|
2132
|
+
children: D?.loading ?? /* @__PURE__ */ V(h, {
|
|
2133
|
+
className: "min-h-64",
|
|
2134
|
+
label: G.loading
|
|
2135
|
+
})
|
|
2136
|
+
}) : Ot ? /* @__PURE__ */ V("div", {
|
|
2137
|
+
className: "media-library--state my-auto",
|
|
2138
|
+
children: D?.error ?? /* @__PURE__ */ V(g, {
|
|
2139
|
+
title: G.errorTitle,
|
|
2140
|
+
description: G.errorDescription,
|
|
2141
|
+
onRetry: j ? K.retry : void 0,
|
|
2142
|
+
retryLabel: G.retry ?? U.retry
|
|
2143
|
+
})
|
|
2144
|
+
}) : K.visibleItems.length === 0 ? /* @__PURE__ */ V("div", {
|
|
2145
|
+
className: "media-library--state my-auto",
|
|
2146
|
+
children: D?.empty ?? /* @__PURE__ */ V(ft, {
|
|
2147
|
+
title: K.hasFilters ? G.emptyFilteredTitle : G.emptyLibraryTitle,
|
|
2148
|
+
description: K.hasFilters ? G.emptyFilteredDescription : G.emptyLibraryDescription,
|
|
2149
|
+
action: K.hasFilters ? /* @__PURE__ */ V(s, {
|
|
1565
2150
|
type: "button",
|
|
1566
|
-
role: "tab",
|
|
1567
|
-
"aria-selected": J === "library",
|
|
1568
2151
|
tone: "secondary",
|
|
1569
|
-
buttonStyle: "
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
}), /* @__PURE__ */ I(i, {
|
|
2152
|
+
buttonStyle: "outline",
|
|
2153
|
+
onClick: K.clearFilters,
|
|
2154
|
+
children: G.clearFilters
|
|
2155
|
+
}) : b ? /* @__PURE__ */ V(s, {
|
|
2156
|
+
tone: "primary",
|
|
1575
2157
|
type: "button",
|
|
1576
|
-
role: "tab",
|
|
1577
|
-
"aria-selected": J === "upload",
|
|
1578
|
-
tone: "secondary",
|
|
1579
|
-
buttonStyle: "ghost",
|
|
1580
|
-
size: "sm",
|
|
1581
|
-
className: r(O.item, "shadow-none", J === "upload" ? `${_.segmentActive} hover:bg-card` : "text-muted-foreground hover:bg-transparent hover:text-foreground"),
|
|
1582
2158
|
onClick: () => K.setTab("upload"),
|
|
1583
|
-
children:
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
weight: "inherit",
|
|
1594
|
-
type: "inherit",
|
|
1595
|
-
align: "center"
|
|
1596
|
-
})
|
|
1597
|
-
})
|
|
1598
|
-
]
|
|
1599
|
-
})]
|
|
1600
|
-
}), A?.headerEnd]
|
|
1601
|
-
}), $]
|
|
1602
|
-
})]
|
|
1603
|
-
}),
|
|
1604
|
-
/* @__PURE__ */ I("div", {
|
|
1605
|
-
className: "media-library--body flex min-h-0 flex-1",
|
|
1606
|
-
children: [J === "upload" ? /* @__PURE__ */ F("div", {
|
|
1607
|
-
className: "min-w-0 flex-1 overflow-y-auto",
|
|
1608
|
-
children: /* @__PURE__ */ F(Ge, {
|
|
1609
|
-
stagedFiles: K.stagedFiles,
|
|
1610
|
-
uploadOptions: K.uploadOptions,
|
|
1611
|
-
collections: q,
|
|
1612
|
-
uploading: K.uploading,
|
|
1613
|
-
strings: G,
|
|
1614
|
-
onFiles: K.addFiles,
|
|
1615
|
-
onRemoveFile: K.removeStagedFile,
|
|
1616
|
-
onOptionsChange: K.updateUploadOptions,
|
|
1617
|
-
empty: A?.uploadEmpty
|
|
1618
|
-
})
|
|
1619
|
-
}) : /* @__PURE__ */ I("div", {
|
|
1620
|
-
className: r("media-library--library min-w-0 flex-1 flex-col", Q ? "hidden @2xl/media-library:flex" : "flex"),
|
|
1621
|
-
children: [/* @__PURE__ */ F(l, {
|
|
1622
|
-
gap: "md",
|
|
1623
|
-
className: "media-library--toolbar border-b border-border/60 p-surface",
|
|
1624
|
-
children: /* @__PURE__ */ F(He, {
|
|
1625
|
-
query: K.query,
|
|
1626
|
-
type: K.type,
|
|
1627
|
-
typeFilters: x,
|
|
1628
|
-
collection: K.collection,
|
|
1629
|
-
sort: K.sort,
|
|
1630
|
-
view: K.view,
|
|
1631
|
-
collections: q,
|
|
2159
|
+
children: G.uploadMedia
|
|
2160
|
+
}) : void 0
|
|
2161
|
+
})
|
|
2162
|
+
}) : K.view === "table" ? /* @__PURE__ */ V("div", {
|
|
2163
|
+
className: "overflow-x-auto",
|
|
2164
|
+
children: /* @__PURE__ */ V(ht, {
|
|
2165
|
+
items: K.visibleItems,
|
|
2166
|
+
selectedSet: K.selectedSet,
|
|
2167
|
+
selectionMode: _,
|
|
2168
|
+
accessors: K.accessors,
|
|
1632
2169
|
strings: G,
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
onClearFilters: K.clearFilters,
|
|
1639
|
-
toolbarEnd: A?.toolbarEnd,
|
|
2170
|
+
onToggle: (e) => {
|
|
2171
|
+
let t = K.items.find((t) => K.accessors.getId(t) === e);
|
|
2172
|
+
t && X(t);
|
|
2173
|
+
},
|
|
2174
|
+
onDetails: Q,
|
|
1640
2175
|
selecting: K.selecting,
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
className: "media-library--count min-w-0 truncate",
|
|
1646
|
-
children: ct || K.loading ? null : /* @__PURE__ */ F(a, {
|
|
1647
|
-
tag: "span",
|
|
1648
|
-
size: "xs",
|
|
1649
|
-
type: "secondary",
|
|
1650
|
-
children: ut
|
|
1651
|
-
})
|
|
1652
|
-
})
|
|
2176
|
+
onOpen: (e) => {
|
|
2177
|
+
let t = K.items.find((t) => K.accessors.getId(t) === e);
|
|
2178
|
+
t && Dt(t);
|
|
2179
|
+
}
|
|
1653
2180
|
})
|
|
1654
|
-
})
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
})
|
|
1674
|
-
}) : K.visibleItems.length === 0 ? /* @__PURE__ */ F("div", {
|
|
1675
|
-
className: "media-library--state my-auto",
|
|
1676
|
-
children: A?.empty ?? /* @__PURE__ */ F(Y, {
|
|
1677
|
-
title: K.hasFilters ? G.emptyFilteredTitle : G.emptyLibraryTitle,
|
|
1678
|
-
description: K.hasFilters ? G.emptyFilteredDescription : G.emptyLibraryDescription,
|
|
1679
|
-
action: K.hasFilters ? /* @__PURE__ */ F(i, {
|
|
1680
|
-
type: "button",
|
|
1681
|
-
tone: "secondary",
|
|
1682
|
-
buttonStyle: "outline",
|
|
1683
|
-
onClick: K.clearFilters,
|
|
1684
|
-
children: G.clearFilters
|
|
1685
|
-
}) : b ? /* @__PURE__ */ F(i, {
|
|
1686
|
-
tone: "primary",
|
|
1687
|
-
type: "button",
|
|
1688
|
-
onClick: () => K.setTab("upload"),
|
|
1689
|
-
children: G.uploadMedia
|
|
1690
|
-
}) : void 0
|
|
1691
|
-
})
|
|
1692
|
-
}) : K.view === "table" ? /* @__PURE__ */ F("div", {
|
|
1693
|
-
className: "overflow-x-auto",
|
|
1694
|
-
children: /* @__PURE__ */ F(Ue, {
|
|
1695
|
-
items: K.visibleItems,
|
|
1696
|
-
selectedSet: K.selectedSet,
|
|
1697
|
-
selectionMode: g,
|
|
2181
|
+
}) : /* @__PURE__ */ V("div", {
|
|
2182
|
+
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))]"),
|
|
2183
|
+
children: K.visibleItems.map((e) => {
|
|
2184
|
+
let t = K.accessors.getId(e), n = {
|
|
2185
|
+
id: t,
|
|
2186
|
+
selected: K.selectedSet.has(t),
|
|
2187
|
+
selectionMode: _,
|
|
2188
|
+
selecting: K.selecting,
|
|
2189
|
+
accessors: K.accessors,
|
|
2190
|
+
toggle: () => X(e),
|
|
2191
|
+
openDetails: () => Q(t),
|
|
2192
|
+
open: () => Dt(e)
|
|
2193
|
+
}, r = D?.renderItem?.(e, n);
|
|
2194
|
+
return r ? /* @__PURE__ */ V("div", { children: r }, t) : /* @__PURE__ */ V(mt, {
|
|
2195
|
+
item: e,
|
|
2196
|
+
selected: n.selected,
|
|
2197
|
+
density: v,
|
|
2198
|
+
showMeta: y,
|
|
2199
|
+
selectionMode: _,
|
|
1698
2200
|
accessors: K.accessors,
|
|
1699
2201
|
strings: G,
|
|
1700
|
-
onToggle:
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
selecting: K.selecting,
|
|
1706
|
-
onOpen: (e) => {
|
|
1707
|
-
let t = K.items.find((t) => K.accessors.getId(t) === e);
|
|
1708
|
-
t && st(t);
|
|
1709
|
-
}
|
|
1710
|
-
})
|
|
1711
|
-
}) : /* @__PURE__ */ F("div", {
|
|
1712
|
-
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))]"),
|
|
1713
|
-
children: K.visibleItems.map((e) => {
|
|
1714
|
-
let t = K.accessors.getId(e), n = {
|
|
1715
|
-
id: t,
|
|
1716
|
-
selected: K.selectedSet.has(t),
|
|
1717
|
-
selectionMode: g,
|
|
1718
|
-
selecting: K.selecting,
|
|
1719
|
-
accessors: K.accessors,
|
|
1720
|
-
toggle: () => rt(e),
|
|
1721
|
-
openDetails: () => ot(t),
|
|
1722
|
-
open: () => st(e)
|
|
1723
|
-
}, r = A?.renderItem?.(e, n);
|
|
1724
|
-
return r ? /* @__PURE__ */ F("div", { children: r }, t) : /* @__PURE__ */ F(X, {
|
|
1725
|
-
item: e,
|
|
1726
|
-
selected: n.selected,
|
|
1727
|
-
density: v,
|
|
1728
|
-
showMeta: y,
|
|
1729
|
-
selectionMode: g,
|
|
1730
|
-
accessors: K.accessors,
|
|
1731
|
-
strings: G,
|
|
1732
|
-
onToggle: n.toggle,
|
|
1733
|
-
onDetails: n.openDetails,
|
|
1734
|
-
onOpen: n.open,
|
|
1735
|
-
selecting: n.selecting
|
|
1736
|
-
}, t);
|
|
1737
|
-
})
|
|
2202
|
+
onToggle: n.toggle,
|
|
2203
|
+
onDetails: n.openDetails,
|
|
2204
|
+
onOpen: n.open,
|
|
2205
|
+
selecting: n.selecting
|
|
2206
|
+
}, t);
|
|
1738
2207
|
})
|
|
2208
|
+
}), jt && /* @__PURE__ */ H(l, {
|
|
2209
|
+
align: "center",
|
|
2210
|
+
gap: "md",
|
|
2211
|
+
className: "media-library--load-more",
|
|
2212
|
+
children: [K.loadMoreError != null && /* @__PURE__ */ V(f, {
|
|
2213
|
+
tone: "destructive",
|
|
2214
|
+
children: /* @__PURE__ */ V(p, { children: G.loadMoreError ?? U.loadMoreError })
|
|
2215
|
+
}), /* @__PURE__ */ V(s, {
|
|
2216
|
+
type: "button",
|
|
2217
|
+
tone: "secondary",
|
|
2218
|
+
buttonStyle: "outline",
|
|
2219
|
+
disabled: K.loading,
|
|
2220
|
+
loading: K.loadingMore,
|
|
2221
|
+
strings: { loading: G.loadingMore ?? U.loadingMore },
|
|
2222
|
+
onClick: At,
|
|
2223
|
+
children: K.loadMoreError == null ? G.loadMore ?? U.loadMore : G.retry ?? U.retry
|
|
2224
|
+
})]
|
|
1739
2225
|
})]
|
|
1740
|
-
}), J === "library" && /* @__PURE__ */ F(We, {
|
|
1741
|
-
item: Q,
|
|
1742
|
-
collections: q,
|
|
1743
|
-
accessors: K.accessors,
|
|
1744
|
-
strings: G,
|
|
1745
|
-
onClose: () => K.setDetailId(null),
|
|
1746
|
-
onUpdate: (e) => Q ? K.updateItem(Q, e) : Promise.resolve(!1),
|
|
1747
|
-
onReplace: ue && Q ? () => ue(Q) : void 0,
|
|
1748
|
-
onRemove: async () => {
|
|
1749
|
-
if (!Q) return !1;
|
|
1750
|
-
let e = await K.removeItem(Q);
|
|
1751
|
-
return e && K.setDetailId(null), e;
|
|
1752
|
-
},
|
|
1753
|
-
renderDetail: A?.renderDetail
|
|
1754
2226
|
})]
|
|
1755
|
-
}),
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
2227
|
+
}), Xe === "library" && /* @__PURE__ */ V(vt, {
|
|
2228
|
+
item: et,
|
|
2229
|
+
collections: Ye,
|
|
2230
|
+
accessors: K.accessors,
|
|
2231
|
+
strings: G,
|
|
2232
|
+
onClose: () => K.setDetailId(null),
|
|
2233
|
+
readOnly: !fe,
|
|
2234
|
+
onUpdate: (e) => et ? K.updateItem(et, e) : Promise.resolve(!1),
|
|
2235
|
+
mutationError: K.mutationError?.itemId === K.detailId ? K.mutationError : null,
|
|
2236
|
+
onReplace: pe && et ? () => pe(et) : void 0,
|
|
2237
|
+
allowDelete: !!F,
|
|
2238
|
+
onRemove: () => et ? _t(et) : Promise.resolve(!1),
|
|
2239
|
+
renderDetail: D?.renderDetail
|
|
2240
|
+
})]
|
|
2241
|
+
}),
|
|
2242
|
+
nt ? nt.element ? Fe(It, nt.element) : null : It,
|
|
2243
|
+
(F || q) && /* @__PURE__ */ V(S, {
|
|
2244
|
+
open: q !== null,
|
|
2245
|
+
onOpenChange: (e) => {
|
|
2246
|
+
e || Et(!1);
|
|
2247
|
+
},
|
|
2248
|
+
destructive: !0,
|
|
2249
|
+
title: G.detail.confirmDeleteTitle ?? U.detail.confirmDeleteTitle,
|
|
2250
|
+
description: q ? W(G.detail.confirmDeleteDescription ?? U.detail.confirmDeleteDescription ?? "", { name: K.accessors.getName(q.item) }) : void 0,
|
|
2251
|
+
strings: { confirm: G.detail.confirmDeleteLabel ?? U.detail.confirmDeleteLabel },
|
|
2252
|
+
alertMessage: tt ? G.detail.confirmDeleteError ?? U.detail.confirmDeleteError : void 0,
|
|
2253
|
+
closeOnAsyncComplete: !1,
|
|
2254
|
+
onAsyncConfirm: async () => {
|
|
2255
|
+
q && await K.removeItem(q.item) && Qe.current === q && (gt.current = !0, K.setDetailId(null), Et(!0));
|
|
2256
|
+
}
|
|
2257
|
+
}),
|
|
2258
|
+
Pt && /* @__PURE__ */ V(re, {
|
|
2259
|
+
selectedCount: Ft,
|
|
2260
|
+
totalCount: K.totalCount,
|
|
2261
|
+
onClear: K.clearSelection,
|
|
2262
|
+
returnFocusRef: Z,
|
|
2263
|
+
className: "media-library--bulk-actions",
|
|
2264
|
+
strings: {
|
|
2265
|
+
label: G.batchActionsLabel,
|
|
2266
|
+
summary: (e) => W(G.footer.selectedCount, { count: e }),
|
|
2267
|
+
clear: G.footer.clear
|
|
2268
|
+
},
|
|
2269
|
+
children: Ft > 0 && T?.({
|
|
2270
|
+
selectedItems: K.items.filter((e) => K.selectedSet.has(K.accessors.getId(e))),
|
|
2271
|
+
selectedIds: K.selectedIds,
|
|
2272
|
+
selectedCount: K.selectedIds.length,
|
|
2273
|
+
visibleCount: K.filteredCount,
|
|
1759
2274
|
totalCount: K.totalCount,
|
|
1760
|
-
|
|
1761
|
-
returnFocusRef: ft,
|
|
1762
|
-
className: "media-library--bulk-actions",
|
|
1763
|
-
strings: {
|
|
1764
|
-
label: G.batchActionsLabel,
|
|
1765
|
-
summary: (e) => H(G.footer.selectedCount, { count: e }),
|
|
1766
|
-
clear: G.footer.clear
|
|
1767
|
-
},
|
|
1768
|
-
children: pt > 0 && te?.({
|
|
1769
|
-
selectedItems: K.selectedItems,
|
|
1770
|
-
selectedIds: K.selectedIds,
|
|
1771
|
-
selectedCount: K.selectedIds.length,
|
|
1772
|
-
visibleCount: K.filteredCount,
|
|
1773
|
-
totalCount: K.totalCount,
|
|
1774
|
-
clearSelection: K.clearSelection
|
|
1775
|
-
})
|
|
2275
|
+
clearSelection: K.clearSelection
|
|
1776
2276
|
})
|
|
1777
|
-
|
|
2277
|
+
})
|
|
2278
|
+
] });
|
|
2279
|
+
return b ? /* @__PURE__ */ V(ue, {
|
|
2280
|
+
value: Xe,
|
|
2281
|
+
onValueChange: (e) => K.setTab(e),
|
|
2282
|
+
render: /* @__PURE__ */ V("section", {
|
|
2283
|
+
ref: ut,
|
|
2284
|
+
...Je
|
|
2285
|
+
}),
|
|
2286
|
+
className: r("gap-0", Lt),
|
|
2287
|
+
children: Rt
|
|
2288
|
+
}) : /* @__PURE__ */ V("section", {
|
|
2289
|
+
ref: ut,
|
|
2290
|
+
className: Lt,
|
|
2291
|
+
...Je,
|
|
2292
|
+
children: Rt
|
|
1778
2293
|
});
|
|
1779
2294
|
}
|
|
1780
|
-
function
|
|
1781
|
-
let m = n(
|
|
1782
|
-
|
|
2295
|
+
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 }) {
|
|
2296
|
+
let m = n(U, p.strings), [h, g] = B(!1), [_, v] = B(null), y = e !== void 0, b = y ? e : h, S = (e) => {
|
|
2297
|
+
y || g(e), t?.(e);
|
|
1783
2298
|
}, C = () => {
|
|
1784
2299
|
S(!1), s?.();
|
|
1785
2300
|
};
|
|
1786
|
-
return /* @__PURE__ */
|
|
1787
|
-
value: { element:
|
|
1788
|
-
children: /* @__PURE__ */
|
|
1789
|
-
open:
|
|
2301
|
+
return /* @__PURE__ */ V(Ct.Provider, {
|
|
2302
|
+
value: { element: _ },
|
|
2303
|
+
children: /* @__PURE__ */ V(x, {
|
|
2304
|
+
open: b,
|
|
1790
2305
|
onOpenChange: S,
|
|
1791
2306
|
onClose: s,
|
|
1792
2307
|
trigger: i,
|
|
@@ -1795,15 +2310,15 @@ function Xe({ open: e, onOpenChange: t, trigger: i, dialogTitle: a, dialogDescri
|
|
|
1795
2310
|
size: "full",
|
|
1796
2311
|
showCancel: !1,
|
|
1797
2312
|
showConfirm: !1,
|
|
1798
|
-
footer: /* @__PURE__ */
|
|
1799
|
-
ref:
|
|
2313
|
+
footer: /* @__PURE__ */ V("div", {
|
|
2314
|
+
ref: v,
|
|
1800
2315
|
className: "media-library-dialog--footer @container/media-library w-full"
|
|
1801
2316
|
}),
|
|
1802
2317
|
className: r("media-library-dialog--component max-h-[calc(100vh-2rem)] max-w-[min(1060px,calc(100vw-2rem))] sm:max-w-[min(1060px,calc(100vw-2rem))]", l),
|
|
1803
2318
|
contentClassName: r("media-library-dialog--body flex min-h-0 flex-col overflow-hidden p-0", u),
|
|
1804
2319
|
closeOnBackdropClick: f,
|
|
1805
2320
|
closeOnEscape: d,
|
|
1806
|
-
children: /* @__PURE__ */
|
|
2321
|
+
children: /* @__PURE__ */ V(Et, {
|
|
1807
2322
|
...p,
|
|
1808
2323
|
defaultSelecting: p.defaultSelecting ?? !0,
|
|
1809
2324
|
onClose: C,
|
|
@@ -1816,45 +2331,45 @@ function Xe({ open: e, onOpenChange: t, trigger: i, dialogTitle: a, dialogDescri
|
|
|
1816
2331
|
}
|
|
1817
2332
|
//#endregion
|
|
1818
2333
|
//#region src/components/features/media-library/media-resource-gallery.tsx
|
|
1819
|
-
function
|
|
2334
|
+
function Dt(e, t, n) {
|
|
1820
2335
|
let r = e.slice(), [i] = r.splice(t, 1);
|
|
1821
2336
|
return i === void 0 || r.splice(n, 0, i), r;
|
|
1822
2337
|
}
|
|
1823
|
-
function
|
|
1824
|
-
let
|
|
2338
|
+
function Ot({ items: e, accessors: t, title: a, description: o, primaryId: c, onPrimaryChange: d, onRemove: f, onReorder: p, onAdd: m, maxItems: h, layout: g = "field", density: _ = "comfortable", readOnly: y = !1, empty: x, action: S, renderItem: ee, strings: te, className: T, ...ne }) {
|
|
2339
|
+
let E = n(U, te), D = Ke(t), O = e.length, re = c ?? (O > 0 ? D.getId(e[0]) : void 0), ie = !y && !!m && (h === void 0 || O < h), A = !y && !!d, j = !y && !!f, M = !y && !!p, ae = A || j || M, oe = ie && (g === "field" || O > 0) ? /* @__PURE__ */ V(s, {
|
|
1825
2340
|
type: "button",
|
|
1826
2341
|
tone: "secondary",
|
|
1827
2342
|
buttonStyle: "outline",
|
|
1828
|
-
icon:
|
|
1829
|
-
onClick:
|
|
1830
|
-
children:
|
|
1831
|
-
}) : h !== void 0 &&
|
|
2343
|
+
icon: Oe,
|
|
2344
|
+
onClick: m,
|
|
2345
|
+
children: E.gallery.add
|
|
2346
|
+
}) : h !== void 0 && O >= h ? /* @__PURE__ */ V(k, {
|
|
1832
2347
|
tone: "secondary",
|
|
1833
|
-
children:
|
|
2348
|
+
children: E.gallery.maxReached
|
|
1834
2349
|
}) : null, N = (t, n) => {
|
|
1835
|
-
if (!M || n < 0 || n >=
|
|
1836
|
-
let r =
|
|
1837
|
-
|
|
1838
|
-
},
|
|
2350
|
+
if (!M || n < 0 || n >= O || t === n) return;
|
|
2351
|
+
let r = Dt(e, t, n);
|
|
2352
|
+
p?.(r.map((e) => D.getId(e)), r);
|
|
2353
|
+
}, P = !!(a || o || S || oe), ce = O === 0 && g !== "field", le = () => !ie || g !== "field" ? null : /* @__PURE__ */ H("button", {
|
|
1839
2354
|
type: "button",
|
|
1840
|
-
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 ${
|
|
1841
|
-
"aria-label":
|
|
1842
|
-
onClick:
|
|
1843
|
-
children: [/* @__PURE__ */
|
|
2355
|
+
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 ${se.hover}`),
|
|
2356
|
+
"aria-label": E.gallery.addTile,
|
|
2357
|
+
onClick: m,
|
|
2358
|
+
children: [/* @__PURE__ */ V(Oe, { className: "size-icon" }), /* @__PURE__ */ V(i, {
|
|
1844
2359
|
tag: "span",
|
|
1845
2360
|
size: "inherit",
|
|
1846
2361
|
className: "sr-only",
|
|
1847
|
-
children:
|
|
2362
|
+
children: E.gallery.addTile
|
|
1848
2363
|
})]
|
|
1849
2364
|
});
|
|
1850
|
-
return /* @__PURE__ */
|
|
1851
|
-
className: r("media-resource-gallery--component @container/media-resource-gallery
|
|
2365
|
+
return /* @__PURE__ */ H("section", {
|
|
2366
|
+
className: r("media-resource-gallery--component @container/media-resource-gallery", u.frame, T),
|
|
1852
2367
|
"data-layout": g,
|
|
1853
|
-
"data-gallery-density":
|
|
1854
|
-
...
|
|
1855
|
-
children: [
|
|
2368
|
+
"data-gallery-density": _,
|
|
2369
|
+
...ne,
|
|
2370
|
+
children: [P && /* @__PURE__ */ V("header", {
|
|
1856
2371
|
className: "media-resource-gallery--header p-surface",
|
|
1857
|
-
children: /* @__PURE__ */
|
|
2372
|
+
children: /* @__PURE__ */ H(l, {
|
|
1858
2373
|
direction: {
|
|
1859
2374
|
base: "vertical",
|
|
1860
2375
|
md: "horizontal"
|
|
@@ -1862,301 +2377,336 @@ function $({ items: e, accessors: t, title: o, description: s, primaryId: c, onP
|
|
|
1862
2377
|
gap: "lg",
|
|
1863
2378
|
align: { md: "start" },
|
|
1864
2379
|
justify: { md: "between" },
|
|
1865
|
-
children: [/* @__PURE__ */
|
|
2380
|
+
children: [/* @__PURE__ */ H(l, {
|
|
1866
2381
|
gap: "normal",
|
|
1867
2382
|
className: "min-w-0",
|
|
1868
|
-
children: [!!
|
|
2383
|
+
children: [!!a && /* @__PURE__ */ V(i, {
|
|
1869
2384
|
tag: "div",
|
|
1870
2385
|
type: "inherit",
|
|
1871
2386
|
weight: "semibold",
|
|
1872
|
-
children:
|
|
1873
|
-
}), !!
|
|
2387
|
+
children: a
|
|
2388
|
+
}), !!o && /* @__PURE__ */ V(i, {
|
|
1874
2389
|
type: "secondary",
|
|
1875
|
-
children:
|
|
2390
|
+
children: o
|
|
1876
2391
|
})]
|
|
1877
|
-
}), /* @__PURE__ */
|
|
2392
|
+
}), /* @__PURE__ */ V(l, {
|
|
1878
2393
|
direction: "horizontal",
|
|
1879
2394
|
wrap: !0,
|
|
1880
2395
|
align: "center",
|
|
1881
|
-
gap:
|
|
2396
|
+
gap: v.commands,
|
|
1882
2397
|
className: "media-resource-gallery--actions",
|
|
1883
|
-
children: S ??
|
|
2398
|
+
children: S ?? oe
|
|
1884
2399
|
})]
|
|
1885
2400
|
})
|
|
1886
|
-
}),
|
|
2401
|
+
}), ce ? /* @__PURE__ */ V("div", {
|
|
1887
2402
|
className: "media-resource-gallery--empty px-surface pb-surface",
|
|
1888
|
-
children: x ?? /* @__PURE__ */
|
|
1889
|
-
title:
|
|
1890
|
-
description:
|
|
1891
|
-
action:
|
|
2403
|
+
children: x ?? /* @__PURE__ */ V(ft, {
|
|
2404
|
+
title: E.gallery.emptyTitle,
|
|
2405
|
+
description: E.gallery.emptyDescription,
|
|
2406
|
+
action: ie ? /* @__PURE__ */ V(s, {
|
|
1892
2407
|
tone: "primary",
|
|
1893
2408
|
type: "button",
|
|
1894
|
-
icon:
|
|
1895
|
-
onClick:
|
|
1896
|
-
children:
|
|
2409
|
+
icon: Se,
|
|
2410
|
+
onClick: m,
|
|
2411
|
+
children: E.gallery.add
|
|
1897
2412
|
}) : void 0
|
|
1898
2413
|
})
|
|
1899
|
-
}) : /* @__PURE__ */
|
|
1900
|
-
className: r("grid min-w-0 grid-cols-1", g === "list" ? "gap-space-md" : "gap-space-lg", "media-resource-gallery--items p-surface",
|
|
2414
|
+
}) : /* @__PURE__ */ H("div", {
|
|
2415
|
+
className: r("grid min-w-0 grid-cols-1", g === "list" ? "gap-space-md" : "gap-space-lg", "media-resource-gallery--items p-surface", P && "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))]" : _ === "compact" ? "grid-cols-[repeat(auto-fill,minmax(132px,1fr))]" : "grid-cols-[repeat(auto-fill,minmax(164px,1fr))]"),
|
|
1901
2416
|
children: [e.map((e, t) => {
|
|
1902
|
-
let n =
|
|
2417
|
+
let n = D.getId(e), a = D.getName(e), o = D.getType(e), c = D.getSrc(e), u = D.getAlt(e) || a, p = n === re, m = D.getPublic(e) === !1, h = D.getDuration(e), v = M && t > 0, y = M && t < O - 1, x = (e) => W(e, { name: a }), S = {
|
|
1903
2418
|
id: n,
|
|
1904
2419
|
index: t,
|
|
1905
|
-
total:
|
|
2420
|
+
total: O,
|
|
1906
2421
|
primary: p,
|
|
1907
|
-
accessors:
|
|
1908
|
-
canMovePrevious:
|
|
1909
|
-
canMoveNext:
|
|
2422
|
+
accessors: D,
|
|
2423
|
+
canMovePrevious: v,
|
|
2424
|
+
canMoveNext: y,
|
|
1910
2425
|
setPrimary: () => {
|
|
1911
|
-
|
|
2426
|
+
A && d?.(n, e);
|
|
1912
2427
|
},
|
|
1913
2428
|
remove: () => {
|
|
1914
|
-
j &&
|
|
2429
|
+
j && f?.(n, e);
|
|
1915
2430
|
},
|
|
1916
2431
|
movePrevious: () => N(t, t - 1),
|
|
1917
2432
|
moveNext: () => N(t, t + 1)
|
|
1918
|
-
});
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
}
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
}),
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
"
|
|
1954
|
-
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
2433
|
+
}, te = ee?.(e, S);
|
|
2434
|
+
if (te) return /* @__PURE__ */ V("div", { children: te }, n);
|
|
2435
|
+
if (g === "field") {
|
|
2436
|
+
let t = [
|
|
2437
|
+
{
|
|
2438
|
+
id: "cover",
|
|
2439
|
+
label: E.gallery.setCoverAction ?? U.gallery.setCoverAction,
|
|
2440
|
+
visible: A,
|
|
2441
|
+
disabled: p,
|
|
2442
|
+
onClick: S.setPrimary
|
|
2443
|
+
},
|
|
2444
|
+
{
|
|
2445
|
+
id: "previous",
|
|
2446
|
+
label: E.gallery.movePreviousAction ?? U.gallery.movePreviousAction,
|
|
2447
|
+
visible: M,
|
|
2448
|
+
disabled: !v,
|
|
2449
|
+
onClick: S.movePrevious
|
|
2450
|
+
},
|
|
2451
|
+
{
|
|
2452
|
+
id: "next",
|
|
2453
|
+
label: E.gallery.moveNextAction ?? U.gallery.moveNextAction,
|
|
2454
|
+
visible: M,
|
|
2455
|
+
disabled: !y,
|
|
2456
|
+
onClick: S.moveNext
|
|
2457
|
+
}
|
|
2458
|
+
];
|
|
2459
|
+
return /* @__PURE__ */ H("div", {
|
|
2460
|
+
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 ${C.tileHover}`, p && "col-span-2 row-span-2 min-h-52"),
|
|
2461
|
+
"data-primary": p || void 0,
|
|
2462
|
+
children: [
|
|
2463
|
+
c ? /* @__PURE__ */ V("img", {
|
|
2464
|
+
src: c,
|
|
2465
|
+
alt: u,
|
|
2466
|
+
loading: "lazy",
|
|
2467
|
+
className: "size-full object-cover"
|
|
2468
|
+
}) : /* @__PURE__ */ V("div", {
|
|
2469
|
+
className: "flex size-full items-center justify-center bg-muted text-muted-foreground",
|
|
2470
|
+
children: /* @__PURE__ */ V(ye, { className: p ? "size-7" : "size-icon-lg" })
|
|
2471
|
+
}),
|
|
2472
|
+
p && /* @__PURE__ */ V(k, {
|
|
2473
|
+
tone: "secondary",
|
|
2474
|
+
className: "absolute left-2 top-2 bg-background shadow-xs",
|
|
2475
|
+
children: E.gallery.cover
|
|
2476
|
+
}),
|
|
2477
|
+
o === "video" && !!h && /* @__PURE__ */ H(k, {
|
|
2478
|
+
tone: "secondary",
|
|
2479
|
+
className: "absolute bottom-2 left-2 bg-foreground text-background",
|
|
2480
|
+
children: [/* @__PURE__ */ V(De, { className: "size-icon-sm fill-current" }), h]
|
|
2481
|
+
}),
|
|
2482
|
+
m && /* @__PURE__ */ V("span", {
|
|
2483
|
+
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",
|
|
2484
|
+
children: /* @__PURE__ */ V(Ee, { className: "size-icon-sm" })
|
|
2485
|
+
}),
|
|
2486
|
+
ae && /* @__PURE__ */ H("div", {
|
|
2487
|
+
className: "media-resource-gallery--tile-actions absolute right-2 top-2 flex items-center gap-space-xs opacity-0 transition-opacity group-hover/gallery:opacity-100 group-focus-within/gallery:opacity-100 has-[[aria-expanded=true]]:opacity-100 pointer-coarse:opacity-100",
|
|
2488
|
+
children: [(A || M) && /* @__PURE__ */ V(b, {
|
|
2489
|
+
srText: x(E.gallery.itemActions ?? U.gallery.itemActions ?? ""),
|
|
2490
|
+
actions: t,
|
|
2491
|
+
context: "commands",
|
|
2492
|
+
buttonProps: { size: "sm" }
|
|
2493
|
+
}), j && /* @__PURE__ */ V(s, {
|
|
2494
|
+
type: "button",
|
|
2495
|
+
tone: "secondary",
|
|
2496
|
+
buttonStyle: "solid",
|
|
2497
|
+
size: "sm",
|
|
2498
|
+
iconOnly: !0,
|
|
2499
|
+
className: "shadow-sm",
|
|
2500
|
+
"aria-label": x(E.gallery.remove),
|
|
2501
|
+
onClick: () => f?.(n, e),
|
|
2502
|
+
children: /* @__PURE__ */ V(Pe, { className: "size-icon-md" })
|
|
2503
|
+
})]
|
|
2504
|
+
})
|
|
2505
|
+
]
|
|
2506
|
+
}, n);
|
|
2507
|
+
}
|
|
2508
|
+
return g === "list" ? /* @__PURE__ */ H(l, {
|
|
1959
2509
|
direction: "horizontal",
|
|
1960
2510
|
wrap: !0,
|
|
1961
2511
|
align: "center",
|
|
1962
2512
|
gap: "lg",
|
|
1963
|
-
className: r("media-resource-gallery--item min-w-0 rounded-radius border border-border bg-background text-foreground px-row-x",
|
|
2513
|
+
className: r("media-resource-gallery--item min-w-0 rounded-radius border border-border bg-background text-foreground px-row-x", _ === "compact" ? "py-row-y-sm" : "py-row-y"),
|
|
1964
2514
|
"data-primary": p || void 0,
|
|
1965
2515
|
children: [
|
|
1966
|
-
/* @__PURE__ */
|
|
2516
|
+
/* @__PURE__ */ V("div", {
|
|
1967
2517
|
className: "relative size-12 shrink-0 overflow-hidden rounded-radius bg-muted",
|
|
1968
|
-
children: c ? /* @__PURE__ */
|
|
2518
|
+
children: c ? /* @__PURE__ */ V("img", {
|
|
1969
2519
|
src: c,
|
|
1970
|
-
alt:
|
|
2520
|
+
alt: u,
|
|
1971
2521
|
loading: "lazy",
|
|
1972
2522
|
className: "size-full object-cover"
|
|
1973
|
-
}) : /* @__PURE__ */
|
|
2523
|
+
}) : /* @__PURE__ */ V("div", {
|
|
1974
2524
|
className: "flex size-full items-center justify-center text-muted-foreground",
|
|
1975
|
-
children: /* @__PURE__ */
|
|
2525
|
+
children: /* @__PURE__ */ V(ye, { className: "size-icon" })
|
|
1976
2526
|
})
|
|
1977
2527
|
}),
|
|
1978
|
-
/* @__PURE__ */
|
|
2528
|
+
/* @__PURE__ */ H("div", {
|
|
1979
2529
|
className: "min-w-0 flex-1",
|
|
1980
|
-
children: [/* @__PURE__ */
|
|
2530
|
+
children: [/* @__PURE__ */ H(l, {
|
|
1981
2531
|
direction: "horizontal",
|
|
1982
2532
|
wrap: !0,
|
|
1983
2533
|
align: "center",
|
|
1984
2534
|
gap: "md",
|
|
1985
2535
|
className: "min-w-0",
|
|
1986
|
-
children: [/* @__PURE__ */
|
|
2536
|
+
children: [/* @__PURE__ */ V(i, {
|
|
1987
2537
|
tag: "div",
|
|
1988
2538
|
weight: "semibold",
|
|
1989
2539
|
className: "min-w-0 break-all",
|
|
1990
|
-
children:
|
|
1991
|
-
}), p && /* @__PURE__ */
|
|
2540
|
+
children: a
|
|
2541
|
+
}), p && /* @__PURE__ */ V(k, {
|
|
1992
2542
|
tone: "secondary",
|
|
1993
|
-
children:
|
|
2543
|
+
children: E.gallery.primary
|
|
1994
2544
|
})]
|
|
1995
|
-
}), /* @__PURE__ */
|
|
2545
|
+
}), /* @__PURE__ */ H(i, {
|
|
1996
2546
|
size: "xs",
|
|
1997
2547
|
type: "secondary",
|
|
1998
|
-
children: [
|
|
2548
|
+
children: [W(E.gallery.itemPosition, {
|
|
1999
2549
|
index: t + 1,
|
|
2000
|
-
total:
|
|
2001
|
-
}),
|
|
2002
|
-
value:
|
|
2550
|
+
total: O
|
|
2551
|
+
}), D.getSize(e) !== void 0 && /* @__PURE__ */ H(he, { children: [" · ", /* @__PURE__ */ V(w, {
|
|
2552
|
+
value: D.getSize(e),
|
|
2003
2553
|
size: "xs",
|
|
2004
2554
|
align: "left",
|
|
2005
|
-
emptyLabel:
|
|
2555
|
+
emptyLabel: E.unknownSize
|
|
2006
2556
|
})] })]
|
|
2007
2557
|
})]
|
|
2008
2558
|
}),
|
|
2009
|
-
|
|
2559
|
+
ae && /* @__PURE__ */ H("div", {
|
|
2010
2560
|
className: "media-resource-gallery--item-actions flex basis-full flex-wrap items-center justify-end gap-space-xs @sm/media-resource-gallery:basis-auto",
|
|
2011
2561
|
children: [
|
|
2012
|
-
|
|
2562
|
+
A && /* @__PURE__ */ V(s, {
|
|
2013
2563
|
type: "button",
|
|
2014
2564
|
tone: "secondary",
|
|
2015
2565
|
buttonStyle: "ghost",
|
|
2016
2566
|
size: "sm",
|
|
2017
2567
|
iconOnly: !0,
|
|
2018
2568
|
disabled: p,
|
|
2019
|
-
"aria-label":
|
|
2020
|
-
onClick: () =>
|
|
2021
|
-
children: /* @__PURE__ */
|
|
2569
|
+
"aria-label": x(E.gallery.setPrimary),
|
|
2570
|
+
onClick: () => d?.(n, e),
|
|
2571
|
+
children: /* @__PURE__ */ V(Ae, { className: "size-icon-md" })
|
|
2022
2572
|
}),
|
|
2023
|
-
M && /* @__PURE__ */
|
|
2573
|
+
M && /* @__PURE__ */ V(s, {
|
|
2024
2574
|
type: "button",
|
|
2025
2575
|
tone: "secondary",
|
|
2026
2576
|
buttonStyle: "ghost",
|
|
2027
2577
|
size: "sm",
|
|
2028
2578
|
iconOnly: !0,
|
|
2029
|
-
disabled: !
|
|
2030
|
-
"aria-label":
|
|
2579
|
+
disabled: !v,
|
|
2580
|
+
"aria-label": x(E.gallery.movePrevious),
|
|
2031
2581
|
onClick: () => N(t, t - 1),
|
|
2032
|
-
children: /* @__PURE__ */
|
|
2582
|
+
children: /* @__PURE__ */ V(ge, { className: "size-icon-md" })
|
|
2033
2583
|
}),
|
|
2034
|
-
M && /* @__PURE__ */
|
|
2584
|
+
M && /* @__PURE__ */ V(s, {
|
|
2035
2585
|
type: "button",
|
|
2036
2586
|
tone: "secondary",
|
|
2037
2587
|
buttonStyle: "ghost",
|
|
2038
2588
|
size: "sm",
|
|
2039
2589
|
iconOnly: !0,
|
|
2040
|
-
disabled: !
|
|
2041
|
-
"aria-label":
|
|
2590
|
+
disabled: !y,
|
|
2591
|
+
"aria-label": x(E.gallery.moveNext),
|
|
2042
2592
|
onClick: () => N(t, t + 1),
|
|
2043
|
-
children: /* @__PURE__ */
|
|
2593
|
+
children: /* @__PURE__ */ V(_e, { className: "size-icon-md" })
|
|
2044
2594
|
}),
|
|
2045
|
-
j && /* @__PURE__ */
|
|
2595
|
+
j && /* @__PURE__ */ V(s, {
|
|
2046
2596
|
type: "button",
|
|
2047
2597
|
tone: "destructive",
|
|
2048
2598
|
buttonStyle: "ghost",
|
|
2049
2599
|
size: "sm",
|
|
2050
2600
|
iconOnly: !0,
|
|
2051
|
-
"aria-label":
|
|
2052
|
-
onClick: () =>
|
|
2053
|
-
children: /* @__PURE__ */
|
|
2601
|
+
"aria-label": x(E.gallery.remove),
|
|
2602
|
+
onClick: () => f?.(n, e),
|
|
2603
|
+
children: /* @__PURE__ */ V(je, { className: "size-icon-md" })
|
|
2054
2604
|
})
|
|
2055
2605
|
]
|
|
2056
2606
|
})
|
|
2057
2607
|
]
|
|
2058
|
-
}, n) : /* @__PURE__ */
|
|
2059
|
-
className: `media-resource-gallery--item group/gallery overflow-hidden rounded-radius border border-border bg-background text-foreground shadow-xs transition-colors ${
|
|
2608
|
+
}, n) : /* @__PURE__ */ H("div", {
|
|
2609
|
+
className: `media-resource-gallery--item group/gallery overflow-hidden rounded-radius border border-border bg-background text-foreground shadow-xs transition-colors ${C.tileHover}`,
|
|
2060
2610
|
"data-primary": p || void 0,
|
|
2061
|
-
children: [/* @__PURE__ */
|
|
2611
|
+
children: [/* @__PURE__ */ H("div", {
|
|
2062
2612
|
className: "relative aspect-[4/3] bg-muted",
|
|
2063
|
-
children: [c ? /* @__PURE__ */
|
|
2613
|
+
children: [c ? /* @__PURE__ */ V("img", {
|
|
2064
2614
|
src: c,
|
|
2065
|
-
alt:
|
|
2615
|
+
alt: u,
|
|
2066
2616
|
loading: "lazy",
|
|
2067
2617
|
className: "size-full object-contain"
|
|
2068
|
-
}) : /* @__PURE__ */
|
|
2618
|
+
}) : /* @__PURE__ */ V("div", {
|
|
2069
2619
|
className: "flex size-full items-center justify-center text-muted-foreground",
|
|
2070
|
-
children: /* @__PURE__ */
|
|
2071
|
-
}), /* @__PURE__ */
|
|
2620
|
+
children: /* @__PURE__ */ V(ye, { className: "size-6" })
|
|
2621
|
+
}), /* @__PURE__ */ H("div", {
|
|
2072
2622
|
className: "absolute left-2 top-2 flex flex-wrap gap-space-xs",
|
|
2073
|
-
children: [p && /* @__PURE__ */
|
|
2623
|
+
children: [p && /* @__PURE__ */ V(k, {
|
|
2074
2624
|
tone: "secondary",
|
|
2075
2625
|
className: "bg-card text-card-foreground",
|
|
2076
|
-
children:
|
|
2077
|
-
}), /* @__PURE__ */
|
|
2626
|
+
children: E.gallery.primary
|
|
2627
|
+
}), /* @__PURE__ */ V(k, {
|
|
2078
2628
|
tone: "secondary",
|
|
2079
2629
|
className: "bg-card text-card-foreground",
|
|
2080
|
-
children:
|
|
2630
|
+
children: W(E.gallery.itemPosition, {
|
|
2081
2631
|
index: t + 1,
|
|
2082
|
-
total:
|
|
2632
|
+
total: O
|
|
2083
2633
|
})
|
|
2084
2634
|
})]
|
|
2085
2635
|
})]
|
|
2086
|
-
}), /* @__PURE__ */
|
|
2087
|
-
className: r("media-resource-gallery--item-body",
|
|
2088
|
-
children: /* @__PURE__ */
|
|
2636
|
+
}), /* @__PURE__ */ V("div", {
|
|
2637
|
+
className: r("media-resource-gallery--item-body", _ === "compact" ? "p-surface-xs" : "p-surface"),
|
|
2638
|
+
children: /* @__PURE__ */ H(l, {
|
|
2089
2639
|
gap: "md",
|
|
2090
|
-
children: [/* @__PURE__ */
|
|
2640
|
+
children: [/* @__PURE__ */ H("div", {
|
|
2091
2641
|
className: "min-w-0",
|
|
2092
|
-
children: [/* @__PURE__ */
|
|
2642
|
+
children: [/* @__PURE__ */ V(i, {
|
|
2093
2643
|
tag: "div",
|
|
2094
2644
|
weight: "semibold",
|
|
2095
2645
|
className: "truncate",
|
|
2096
|
-
children:
|
|
2097
|
-
}),
|
|
2098
|
-
value:
|
|
2646
|
+
children: a
|
|
2647
|
+
}), D.getSize(e) !== void 0 && /* @__PURE__ */ V(w, {
|
|
2648
|
+
value: D.getSize(e),
|
|
2099
2649
|
size: "xs",
|
|
2100
2650
|
align: "left",
|
|
2101
|
-
emptyLabel:
|
|
2651
|
+
emptyLabel: E.unknownSize
|
|
2102
2652
|
})]
|
|
2103
|
-
}),
|
|
2653
|
+
}), ae && /* @__PURE__ */ H("div", {
|
|
2104
2654
|
className: "flex items-center gap-space-xs",
|
|
2105
2655
|
children: [
|
|
2106
|
-
|
|
2656
|
+
A && /* @__PURE__ */ V(s, {
|
|
2107
2657
|
type: "button",
|
|
2108
2658
|
tone: "secondary",
|
|
2109
2659
|
buttonStyle: "ghost",
|
|
2110
2660
|
size: "sm",
|
|
2111
2661
|
iconOnly: !0,
|
|
2112
2662
|
disabled: p,
|
|
2113
|
-
"aria-label":
|
|
2114
|
-
onClick: () =>
|
|
2115
|
-
children: /* @__PURE__ */
|
|
2663
|
+
"aria-label": x(E.gallery.setPrimary),
|
|
2664
|
+
onClick: () => d?.(n, e),
|
|
2665
|
+
children: /* @__PURE__ */ V(Ae, { className: "size-icon-md" })
|
|
2116
2666
|
}),
|
|
2117
|
-
M && /* @__PURE__ */
|
|
2667
|
+
M && /* @__PURE__ */ V(s, {
|
|
2118
2668
|
type: "button",
|
|
2119
2669
|
tone: "secondary",
|
|
2120
2670
|
buttonStyle: "ghost",
|
|
2121
2671
|
size: "sm",
|
|
2122
2672
|
iconOnly: !0,
|
|
2123
|
-
disabled: !
|
|
2124
|
-
"aria-label":
|
|
2673
|
+
disabled: !v,
|
|
2674
|
+
"aria-label": x(E.gallery.movePrevious),
|
|
2125
2675
|
onClick: () => N(t, t - 1),
|
|
2126
|
-
children: /* @__PURE__ */
|
|
2676
|
+
children: /* @__PURE__ */ V(ge, { className: "size-icon-md" })
|
|
2127
2677
|
}),
|
|
2128
|
-
M && /* @__PURE__ */
|
|
2678
|
+
M && /* @__PURE__ */ V(s, {
|
|
2129
2679
|
type: "button",
|
|
2130
2680
|
tone: "secondary",
|
|
2131
2681
|
buttonStyle: "ghost",
|
|
2132
2682
|
size: "sm",
|
|
2133
2683
|
iconOnly: !0,
|
|
2134
|
-
disabled: !
|
|
2135
|
-
"aria-label":
|
|
2684
|
+
disabled: !y,
|
|
2685
|
+
"aria-label": x(E.gallery.moveNext),
|
|
2136
2686
|
onClick: () => N(t, t + 1),
|
|
2137
|
-
children: /* @__PURE__ */
|
|
2687
|
+
children: /* @__PURE__ */ V(_e, { className: "size-icon-md" })
|
|
2138
2688
|
}),
|
|
2139
|
-
j && /* @__PURE__ */
|
|
2689
|
+
j && /* @__PURE__ */ V(s, {
|
|
2140
2690
|
type: "button",
|
|
2141
2691
|
tone: "destructive",
|
|
2142
2692
|
buttonStyle: "ghost",
|
|
2143
2693
|
size: "sm",
|
|
2144
2694
|
iconOnly: !0,
|
|
2145
2695
|
className: "ml-auto",
|
|
2146
|
-
"aria-label":
|
|
2147
|
-
onClick: () =>
|
|
2148
|
-
children: /* @__PURE__ */
|
|
2696
|
+
"aria-label": x(E.gallery.remove),
|
|
2697
|
+
onClick: () => f?.(n, e),
|
|
2698
|
+
children: /* @__PURE__ */ V(je, { className: "size-icon-md" })
|
|
2149
2699
|
})
|
|
2150
2700
|
]
|
|
2151
2701
|
})]
|
|
2152
2702
|
})
|
|
2153
2703
|
})]
|
|
2154
2704
|
}, n);
|
|
2155
|
-
}),
|
|
2705
|
+
}), le()]
|
|
2156
2706
|
})]
|
|
2157
2707
|
});
|
|
2158
2708
|
}
|
|
2159
2709
|
//#endregion
|
|
2160
|
-
export {
|
|
2710
|
+
export { Et as MediaLibrary, mt as MediaLibraryCard, vt as MediaLibraryDetailPanel, Q as MediaLibraryDialog, ft as MediaLibraryEmptyState, St as MediaLibraryFooter, ht as MediaLibraryList, pt as MediaLibraryToolbar, yt as MediaLibraryUploadPanel, Ot as MediaResourceGallery, U as defaultMediaLibraryStrings, qe as formatMediaLibrarySize, W as formatMediaLibraryString, Je as getMediaLibraryDimensions, Ke as resolveMediaLibraryAccessors, at as useMediaLibrary };
|
|
2161
2711
|
|
|
2162
2712
|
//# sourceMappingURL=media-library.js.map
|