themelia-react-ui 2.0.5 → 2.0.6
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 +76 -0
- package/MIGRATION.md +119 -0
- package/README.md +13 -6
- package/dist/{accordion-B9MHG0cT.js → accordion-0tQUZ20r.js} +7 -7
- package/dist/accordion-0tQUZ20r.js.map +1 -0
- package/dist/{action-menu-Dr8K-ghE.js → action-menu-C0gjzLyE.js} +7 -7
- package/dist/{action-menu-Dr8K-ghE.js.map → action-menu-C0gjzLyE.js.map} +1 -1
- package/dist/{ai-artifact-C58tQcBy.js → ai-artifact-CGGpQryR.js} +172 -157
- package/dist/ai-artifact-CGGpQryR.js.map +1 -0
- package/dist/{app-shell-B_IuNWOo.js → app-shell-EHuuRDGy.js} +5 -5
- package/dist/{app-shell-B_IuNWOo.js.map → app-shell-EHuuRDGy.js.map} +1 -1
- package/dist/{attachment-Dg_69lPS.js → attachment-BCpA4e7i.js} +8 -8
- package/dist/{attachment-Dg_69lPS.js.map → attachment-BCpA4e7i.js.map} +1 -1
- package/dist/{auth-DTkkshS8.js → auth-B0girIk_.js} +15 -15
- package/dist/auth-B0girIk_.js.map +1 -0
- package/dist/{avatar-CeZaFmNH.js → avatar-B9Jnp-T-.js} +3 -3
- package/dist/{avatar-CeZaFmNH.js.map → avatar-B9Jnp-T-.js.map} +1 -1
- package/dist/{badge-xIiV_E7f.js → badge-wWauMgAt.js} +3 -3
- package/dist/{badge-xIiV_E7f.js.map → badge-wWauMgAt.js.map} +1 -1
- package/dist/base/accordion.js +1 -1
- package/dist/base/action-menu.js +1 -1
- package/dist/base/attachment.js +1 -1
- package/dist/base/avatar.js +1 -1
- package/dist/base/badge.js +1 -1
- package/dist/base/batch-action-bar.js +1 -1
- package/dist/base/buttons.js +1 -1
- package/dist/base/cards.js +2 -2
- package/dist/base/carousel.js +3 -3
- package/dist/base/cascader.js +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 +6 -6
- package/dist/base/feedback.js +4 -4
- package/dist/base/forms-numeric.js +1 -1
- package/dist/base/forms.js +2 -2
- package/dist/base/inline-edit.js +8 -8
- package/dist/base/item.js +1 -1
- package/dist/base/media-gallery.js +1 -1
- package/dist/base/metadata-list.js +1 -1
- package/dist/base/navigation.js +6 -6
- package/dist/base/popover-menu.js +1 -1
- package/dist/base/popover.js +1 -1
- package/dist/base/qr-code.js +1 -1
- package/dist/base/repeaters.js +195 -188
- package/dist/base/repeaters.js.map +1 -1
- package/dist/base/sheet.js +1 -1
- package/dist/base/sidebar.js +2 -2
- package/dist/base/signature-pad.js +7 -7
- package/dist/base/skeleton.js +1 -1
- package/dist/base/spinner.js +5 -5
- 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 +2 -2
- package/dist/base/toaster.js +1 -1
- package/dist/base/tree.js +1 -1
- package/dist/base/upload-queue.js +1 -1
- package/dist/base/upload.js +3 -3
- package/dist/base/value-inputs.js +1 -1
- package/dist/{batch-action-bar-Cb8cuvyy.js → batch-action-bar-BoqWIIpV.js} +5 -5
- package/dist/{batch-action-bar-Cb8cuvyy.js.map → batch-action-bar-BoqWIIpV.js.map} +1 -1
- package/dist/blocks/admin.js +17 -17
- package/dist/blocks/ai.js +227 -221
- package/dist/blocks/ai.js.map +1 -1
- package/dist/blocks/analytics/usage-card.js +1 -1
- package/dist/blocks/analytics.js +424 -449
- 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 +225 -220
- package/dist/blocks/commerce.js.map +1 -1
- package/dist/blocks/data-display.js +2 -2
- package/dist/blocks/onboarding.js +5 -5
- package/dist/blocks/planning.js +11 -11
- package/dist/blocks/timelines.js +1 -1
- package/dist/{breadcrumbs-J-K2kl4c.js → breadcrumbs-Bp9Ke7kd.js} +4 -4
- package/dist/breadcrumbs-Bp9Ke7kd.js.map +1 -0
- package/dist/{button-S2Cubiiz.js → button-ChBovTx0.js} +2 -2
- package/dist/{button-S2Cubiiz.js.map → button-ChBovTx0.js.map} +1 -1
- package/dist/{buttons-BedGfygC.js → buttons-DeW0bQeK.js} +6 -6
- package/dist/{buttons-BedGfygC.js.map → buttons-DeW0bQeK.js.map} +1 -1
- package/dist/{cards-rNX1M4Xn.js → cards-CNXnmvV5.js} +8 -8
- package/dist/{cards-rNX1M4Xn.js.map → cards-CNXnmvV5.js.map} +1 -1
- package/dist/{cascader-B1MiqkBq.js → cascader-CrAl9zD5.js} +15 -15
- package/dist/{cascader-B1MiqkBq.js.map → cascader-CrAl9zD5.js.map} +1 -1
- package/dist/{chart-Darg_0Kv.js → chart-I7ROnsl8.js} +5 -5
- package/dist/{chart-Darg_0Kv.js.map → chart-I7ROnsl8.js.map} +1 -1
- package/dist/{checkbox-fflqmODR.js → checkbox-MoyHIAPs.js} +3 -3
- package/dist/{checkbox-fflqmODR.js.map → checkbox-MoyHIAPs.js.map} +1 -1
- package/dist/{choice-inputs-zUgBZfE4.js → choice-inputs-DHGtx0QV.js} +122 -110
- package/dist/choice-inputs-DHGtx0QV.js.map +1 -0
- package/dist/{code-block-BzmM9Eig.js → code-block-BSJyq9e-.js} +7 -7
- package/dist/{code-block-BzmM9Eig.js.map → code-block-BSJyq9e-.js.map} +1 -1
- package/dist/{collapsible-BkAI_XD4.js → collapsible-BzJ91LUG.js} +3 -3
- package/dist/{collapsible-BkAI_XD4.js.map → collapsible-BzJ91LUG.js.map} +1 -1
- package/dist/{collection-content-gDh1v6O4.js → collection-content-CSnwtOTH.js} +3 -3
- package/dist/{collection-content-gDh1v6O4.js.map → collection-content-CSnwtOTH.js.map} +1 -1
- package/dist/{combobox-BEx0vJgF.js → combobox-Bcvu5J8O.js} +11 -10
- package/dist/{combobox-BEx0vJgF.js.map → combobox-Bcvu5J8O.js.map} +1 -1
- package/dist/combobox-C2JiSQPc.js +915 -0
- package/dist/combobox-C2JiSQPc.js.map +1 -0
- package/dist/{command-CrlPIL6m.js → command-9e52NPgK.js} +6 -6
- package/dist/{command-CrlPIL6m.js.map → command-9e52NPgK.js.map} +1 -1
- package/dist/{comments-Dmpp0YIc.js → comments-BsgErEqd.js} +33 -28
- package/dist/comments-BsgErEqd.js.map +1 -0
- 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/combobox/combobox-field.d.ts +2 -2
- package/dist/components/base/date-pickers/date-picker-internals.d.ts +3 -1
- package/dist/components/base/date-pickers/datepicker.types.d.ts +10 -4
- package/dist/components/base/date-pickers/time-picker.d.ts +17 -3
- 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-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 +4 -1
- 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/navigation/language-switcher.d.ts +12 -4
- package/dist/components/base/repeaters/key-value-editor.d.ts +2 -1
- package/dist/components/base/sidebar/sidebar.d.ts +2 -0
- package/dist/components/base/upload/avatar-upload.d.ts +2 -1
- package/dist/components/base/upload/image-upload.d.ts +2 -1
- package/dist/components/blocks/ai/ai-citation/types.d.ts +2 -0
- package/dist/components/blocks/ai/ai-reasoning/types.d.ts +2 -0
- package/dist/components/blocks/ai/ai-sources/types.d.ts +2 -0
- package/dist/components/blocks/ai/ai-tool-call/types.d.ts +2 -0
- package/dist/components/blocks/analytics/metric/metric.d.ts +4 -0
- 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 +2 -2
- package/dist/components/blocks/commerce/order-status/types.d.ts +4 -0
- package/dist/components/blocks/data-display/empty-state/empty-state.types.d.ts +4 -3
- package/dist/components/features/activities/activities.types.d.ts +18 -11
- package/dist/components/features/activities/hooks/use-activity-resources.d.ts +2 -1
- package/dist/components/features/ai-chat/hooks/use-ai-chat-scroll.d.ts +1 -1
- package/dist/components/features/appointment-calendar/appointment-calendar.d.ts +1 -1
- package/dist/components/features/appointment-calendar/appointment-calendar.types.d.ts +4 -2
- package/dist/components/features/combobox/async-resource-combobox.d.ts +2 -2
- package/dist/components/features/combobox/combobox.d.ts +2 -2
- package/dist/components/features/combobox/hooks/use-combobox-core.d.ts +2 -1
- 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/types.d.ts +37 -8
- package/dist/components/features/email-composer/types.d.ts +3 -1
- package/dist/components/features/filters/facets/date-facet.d.ts +4 -2
- package/dist/components/features/filters/facets/range-facet.d.ts +12 -0
- package/dist/components/features/filters/filters.types.d.ts +3 -3
- package/dist/components/features/filters/partials/date-filter-content.d.ts +3 -2
- package/dist/components/features/filters/partials/filter-popover-content.d.ts +4 -2
- package/dist/components/features/filters/partials/range-filter-content.d.ts +12 -0
- package/dist/components/features/filters/utils/filter-utils.d.ts +5 -1
- package/dist/components/features/media-library/hooks/use-media-library.d.ts +1 -1
- package/dist/components/features/media-library/media-library.d.ts +1 -1
- package/dist/components/features/media-library/media-library.strings.d.ts +6 -0
- package/dist/components/features/media-library/media-library.types.d.ts +36 -8
- package/dist/components/features/media-library/partials/media-library-partials.d.ts +3 -3
- package/dist/components/features/mentions/hooks/use-mentions.d.ts +16 -1
- package/dist/components/features/mentions/partials/mention-inline-suggestions.d.ts +5 -1
- package/dist/components/features/mentions/utils/split-html-by-mentions.d.ts +1 -7
- package/dist/components/features/overlays/hooks/use-overlay-visibility.d.ts +2 -2
- package/dist/components/features/products/products.types.d.ts +2 -2
- package/dist/components/features/questionnaire/questionnaire.types.d.ts +3 -0
- package/dist/components/features/resource/resource.d.ts +1 -1
- package/dist/components/features/resource/resource.types.d.ts +2 -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 +1 -1
- package/dist/components/features/rich-text-editor/partials/editor-field-aria.d.ts +14 -0
- package/dist/components/features/rich-text-editor/partials/rich-text-editor-toolbar.d.ts +3 -1
- 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 +17 -3
- package/dist/components/features/schema-form/hooks/use-schema-form.d.ts +5 -1
- package/dist/components/features/schema-form/partials/schema-form-field.d.ts +3 -1
- package/dist/components/features/schema-form/schema-form.utils.d.ts +1 -1
- package/dist/components/features/suggestions/suggestions.types.d.ts +1 -1
- package/dist/components/features/table/data-table.d.ts +1 -1
- package/dist/components/features/table/index.d.ts +1 -0
- package/dist/components/features/table/table-body.d.ts +1 -1
- package/dist/components/features/table/table-helpers.d.ts +6 -3
- package/dist/components/features/table/table.strings.d.ts +3 -0
- package/dist/components/features/table/table.types.d.ts +17 -1
- package/dist/components/layout/header/header.types.d.ts +3 -2
- package/dist/components/layout/layout.types.d.ts +5 -3
- 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/settings/settings.d.ts +1 -1
- package/dist/components/layout/sidebar/app-sidebar.d.ts +1 -1
- package/dist/components/layout/sidebar/sidebar-navigation-rail.d.ts +3 -1
- package/dist/components/layout/sidebar/sidebar.context.d.ts +1 -0
- package/dist/components/layout/sidebar/sidebar.types.d.ts +2 -0
- package/dist/components/primitives/link.d.ts +3 -2
- package/dist/components/primitives/money.d.ts +1 -1
- package/dist/components/primitives/number.d.ts +1 -1
- package/dist/components/typography/rich-text/rich-text-tree.d.ts +7 -5
- package/dist/{containers-CIxwbZt5.js → containers-CSdc32h9.js} +2 -2
- package/dist/{containers-CIxwbZt5.js.map → containers-CSdc32h9.js.map} +1 -1
- package/dist/{copyable-DIznBqiT.js → copyable-3fdHfMR3.js} +4 -4
- package/dist/{copyable-DIznBqiT.js.map → copyable-3fdHfMR3.js.map} +1 -1
- package/dist/{data-display-BdgCAw8T.js → data-display-Cmj-xZYl.js} +16 -15
- package/dist/data-display-Cmj-xZYl.js.map +1 -0
- package/dist/{date-Cq8ioE4o.js → date-Br0FicVv.js} +4 -4
- package/dist/{date-Cq8ioE4o.js.map → date-Br0FicVv.js.map} +1 -1
- package/dist/date-picker-CyQlFYsP.js +1617 -0
- package/dist/date-picker-CyQlFYsP.js.map +1 -0
- package/dist/date-pickers-tj2MXmXd.js +185 -0
- package/dist/date-pickers-tj2MXmXd.js.map +1 -0
- package/dist/{display-KsZLw9Ov.js → display-CT_N2a3w.js} +7 -7
- package/dist/{display-KsZLw9Ov.js.map → display-CT_N2a3w.js.map} +1 -1
- package/dist/{dropdown-menu-CLs8Lihj.js → dropdown-menu-C08iIugv.js} +6 -6
- package/dist/{dropdown-menu-CLs8Lihj.js.map → dropdown-menu-C08iIugv.js.map} +1 -1
- package/dist/features/activities.js +283 -270
- package/dist/features/activities.js.map +1 -1
- package/dist/features/ai-chat.js +40 -27
- package/dist/features/ai-chat.js.map +1 -1
- package/dist/features/appointment-calendar.js +126 -126
- package/dist/features/appointment-calendar.js.map +1 -1
- package/dist/features/async-preview.js +9 -9
- package/dist/features/combobox.js +1 -1
- package/dist/features/comments.js +1 -1
- package/dist/features/data-view.js +10 -10
- package/dist/features/email-composer.js +24 -19
- package/dist/features/email-composer.js.map +1 -1
- package/dist/features/event-calendar.js +129 -125
- package/dist/features/event-calendar.js.map +1 -1
- package/dist/features/filters.js +2 -2
- package/dist/features/global-search.js +16 -20
- package/dist/features/global-search.js.map +1 -1
- package/dist/features/kanban.js +18 -28
- package/dist/features/kanban.js.map +1 -1
- package/dist/features/map/style.css +15 -0
- package/dist/features/map.js +331 -314
- package/dist/features/map.js.map +1 -1
- package/dist/features/media-library.js +1044 -866
- package/dist/features/media-library.js.map +1 -1
- package/dist/features/mentions.js +2 -2
- package/dist/features/overlays.js +1 -1
- package/dist/features/products.js +978 -964
- package/dist/features/products.js.map +1 -1
- package/dist/features/questionnaire.js +159 -152
- package/dist/features/questionnaire.js.map +1 -1
- package/dist/features/resource-assignment.js +8 -8
- package/dist/features/resource.js +74 -71
- 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 +297 -256
- package/dist/features/schema-form.js.map +1 -1
- package/dist/features/suggestions.js +57 -50
- package/dist/features/suggestions.js.map +1 -1
- package/dist/features/sync.js +3 -3
- package/dist/features/table.js +1 -1
- package/dist/features/theme-tweaker.js +400 -399
- package/dist/features/theme-tweaker.js.map +1 -1
- package/dist/feedback-Dzo1xtAU.js +246 -0
- package/dist/feedback-Dzo1xtAU.js.map +1 -0
- package/dist/{field-affordance-recipes-DWcNcOjh.js → field-affordance-recipes-D6H7tVJi.js} +2 -2
- package/dist/{field-affordance-recipes-DWcNcOjh.js.map → field-affordance-recipes-D6H7tVJi.js.map} +1 -1
- package/dist/field-control-attributes-B6i335wr.js +18 -0
- package/dist/field-control-attributes-B6i335wr.js.map +1 -0
- package/dist/{field-state-recipes-BVA2CWHo.js → field-state-recipes-7sza8QbC.js} +4 -2
- package/dist/{field-state-recipes-BVA2CWHo.js.map → field-state-recipes-7sza8QbC.js.map} +1 -1
- package/dist/{filters-DzgSJpMK.js → filters-Dl80yYtN.js} +763 -605
- package/dist/filters-Dl80yYtN.js.map +1 -0
- package/dist/form-field-CAPdwdnZ.js +74 -0
- package/dist/form-field-CAPdwdnZ.js.map +1 -0
- package/dist/{form-sizing-Bs2qFUeE.js → form-sizing-CgcrUbLU.js} +2 -2
- package/dist/{form-sizing-Bs2qFUeE.js.map → form-sizing-CgcrUbLU.js.map} +1 -1
- package/dist/{forms-C0RGnJTe.js → forms-B3W8CH7-.js} +8 -8
- package/dist/{forms-C0RGnJTe.js.map → forms-B3W8CH7-.js.map} +1 -1
- package/dist/forms-numeric-CwjQJe-O.js +991 -0
- package/dist/forms-numeric-CwjQJe-O.js.map +1 -0
- package/dist/{header-DMMxG__r.js → header-ZIIsRKxP.js} +113 -113
- package/dist/header-ZIIsRKxP.js.map +1 -0
- package/dist/hooks/use-files.d.ts +2 -0
- package/dist/{hooks-DB6CJ4MR.js → hooks-BitHSh-Y.js} +3 -3
- package/dist/{hooks-DB6CJ4MR.js.map → hooks-BitHSh-Y.js.map} +1 -1
- package/dist/{icon-badge-DZF-YjQp.js → icon-badge-npxF1SLX.js} +2 -2
- package/dist/{icon-badge-DZF-YjQp.js.map → icon-badge-npxF1SLX.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/{input-CvyDQlY7.js → input-7KAc7XQL.js} +6 -6
- package/dist/{input-CvyDQlY7.js.map → input-7KAc7XQL.js.map} +1 -1
- package/dist/{input-DMBwAZmr.js → input-DIREVYHs.js} +3 -3
- package/dist/{input-DMBwAZmr.js.map → input-DIREVYHs.js.map} +1 -1
- package/dist/{interaction-recipes-XR9ZpVYL.js → interaction-recipes-4wZ2tvfb.js} +2 -2
- package/dist/{interaction-recipes-XR9ZpVYL.js.map → interaction-recipes-4wZ2tvfb.js.map} +1 -1
- package/dist/{item-DjCcM18E.js → item-FfWnaYST.js} +99 -98
- package/dist/item-FfWnaYST.js.map +1 -0
- package/dist/layout/app-shell.js +1 -1
- package/dist/layout/auth.js +1 -1
- package/dist/layout/containers.js +1 -1
- package/dist/layout/header.js +1 -1
- package/dist/layout/hooks.js +1 -1
- package/dist/layout/navigation.js +1 -1
- package/dist/layout/page.js +1 -1
- package/dist/layout/settings.js +1 -1
- package/dist/layout/sidebar.js +2 -2
- package/dist/layout/workspace.js +1 -1
- package/dist/layout.js +11 -11
- package/dist/layout.types-E_GAApzO.js +30 -0
- package/dist/layout.types-E_GAApzO.js.map +1 -0
- package/dist/lib/field-control-attributes.d.ts +11 -0
- package/dist/lib/field-state-recipes.d.ts +2 -0
- package/dist/lib/format.d.ts +1 -0
- package/dist/lib/surface-recipes.d.ts +1 -1
- package/dist/lib/token-merge.generated.d.ts +6 -6
- package/dist/lib/utils.js +1 -1
- package/dist/{media-gallery-C-vChPmE.js → media-gallery-C81DAnKI.js} +6 -6
- package/dist/{media-gallery-C-vChPmE.js.map → media-gallery-C81DAnKI.js.map} +1 -1
- package/dist/{mentions-0_4nWuI-.js → mentions-qOnedSt4.js} +236 -167
- package/dist/mentions-qOnedSt4.js.map +1 -0
- package/dist/message-BJHnn43M.js +135 -0
- package/dist/message-BJHnn43M.js.map +1 -0
- package/dist/{metadata-list-C3MkU-Om.js → metadata-list-XkqZ_UXH.js} +11 -11
- package/dist/{metadata-list-C3MkU-Om.js.map → metadata-list-XkqZ_UXH.js.map} +1 -1
- package/dist/{navigation-DaRjthVk.js → navigation-BgtPJAhi.js} +119 -119
- package/dist/navigation-BgtPJAhi.js.map +1 -0
- package/dist/{navigation-C90-oQFq.js → navigation-Bt-v7rWP.js} +52 -46
- package/dist/navigation-Bt-v7rWP.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-CRU3kGuk.js → number-CYqBcrSj.js} +78 -86
- package/dist/number-CYqBcrSj.js.map +1 -0
- package/dist/{overflow-tab-bar-IVFVQFV6.js → overflow-tab-bar-BQCA2Zn2.js} +7 -7
- package/dist/{overflow-tab-bar-IVFVQFV6.js.map → overflow-tab-bar-BQCA2Zn2.js.map} +1 -1
- package/dist/{overlays-BSgCtM2v.js → overlays-CC8zI3Du.js} +264 -260
- package/dist/overlays-CC8zI3Du.js.map +1 -0
- package/dist/{page-DUUKDAjo.js → page-BoQ1VaFJ.js} +13 -13
- package/dist/{page-DUUKDAjo.js.map → page-BoQ1VaFJ.js.map} +1 -1
- package/dist/{page-header-commands-7P3sfE9u.js → page-header-commands-DIKspJfx.js} +4 -4
- package/dist/{page-header-commands-7P3sfE9u.js.map → page-header-commands-DIKspJfx.js.map} +1 -1
- package/dist/{pagination-CgCjElfu.js → pagination-Br8TdV9A.js} +4 -4
- package/dist/{pagination-CgCjElfu.js.map → pagination-Br8TdV9A.js.map} +1 -1
- package/dist/{popover-B85RenIl.js → popover-k8TdUcAt.js} +10 -10
- package/dist/popover-k8TdUcAt.js.map +1 -0
- package/dist/{popover-menu-DlnQ2zlR.js → popover-menu-yn-o0kyA.js} +7 -7
- package/dist/{popover-menu-DlnQ2zlR.js.map → popover-menu-yn-o0kyA.js.map} +1 -1
- package/dist/{popover.recipes-DdiEp0rd.js → popover.recipes-DJ0AkUan.js} +2 -2
- package/dist/{popover.recipes-DdiEp0rd.js.map → popover.recipes-DJ0AkUan.js.map} +1 -1
- package/dist/{portal-recipes-BpsV_iRw.js → portal-recipes-DyUXqUtD.js} +2 -2
- package/dist/{portal-recipes-BpsV_iRw.js.map → portal-recipes-DyUXqUtD.js.map} +1 -1
- package/dist/{primitives-ByWgGUgt.js → primitives-BkkQjYl7.js} +22 -17
- package/dist/primitives-BkkQjYl7.js.map +1 -0
- package/dist/primitives.js +4 -4
- package/dist/{progress-BJhQP9WX.js → progress-DZFXXzPs.js} +4 -4
- package/dist/{progress-BJhQP9WX.js.map → progress-DZFXXzPs.js.map} +1 -1
- package/dist/{receipt-tOc7B3hw.js → receipt-C7LhOg7Q.js} +6 -6
- package/dist/{receipt-tOc7B3hw.js.map → receipt-C7LhOg7Q.js.map} +1 -1
- package/dist/rich-text-BnTzZjIo.js +45 -0
- package/dist/rich-text-BnTzZjIo.js.map +1 -0
- package/dist/rich-text-editor-CAurDwT5.js +1273 -0
- package/dist/rich-text-editor-CAurDwT5.js.map +1 -0
- package/dist/{rich-text-editor-toolbar-laT3tpBT.js → rich-text-editor-toolbar-DbXig7Jk.js} +36 -35
- package/dist/rich-text-editor-toolbar-DbXig7Jk.js.map +1 -0
- package/dist/rich-text-tree-BqyQ_7-R.js +66 -0
- package/dist/rich-text-tree-BqyQ_7-R.js.map +1 -0
- package/dist/{sanitize-html-DsQmI48u.js → sanitize-html-BWkH4dLM.js} +29 -16
- package/dist/sanitize-html-BWkH4dLM.js.map +1 -0
- package/dist/{scroll-area-B0dB2cBi.js → scroll-area-Bj6CRUif.js} +2 -2
- package/dist/{scroll-area-B0dB2cBi.js.map → scroll-area-Bj6CRUif.js.map} +1 -1
- package/dist/{separator-Bb17I4pu.js → separator-B9ewiCGO.js} +2 -2
- package/dist/{separator-Bb17I4pu.js.map → separator-B9ewiCGO.js.map} +1 -1
- package/dist/{separator-Ct_WSWTJ.js → separator-DM6gs2vu.js} +3 -3
- package/dist/{separator-Ct_WSWTJ.js.map → separator-DM6gs2vu.js.map} +1 -1
- package/dist/services/actions.js +1 -1
- package/dist/settings-DZPHgpx4.js +155 -0
- package/dist/settings-DZPHgpx4.js.map +1 -0
- package/dist/{sheet-BGPERY55.js → sheet-C4DHsgLk.js} +6 -6
- package/dist/{sheet-BGPERY55.js.map → sheet-C4DHsgLk.js.map} +1 -1
- package/dist/sidebar-C8BnDwTH.js +709 -0
- package/dist/sidebar-C8BnDwTH.js.map +1 -0
- package/dist/{sidebar-f9gRWXIR.js → sidebar-CmD6a-HK.js} +16 -13
- package/dist/sidebar-CmD6a-HK.js.map +1 -0
- package/dist/{skeleton-BapcJd9C.js → skeleton-DDgdhmu9.js} +5 -5
- package/dist/{skeleton-BapcJd9C.js.map → skeleton-DDgdhmu9.js.map} +1 -1
- package/dist/{smart-card-CW0hjetE.js → smart-card-B6vLxqa_.js} +8 -8
- package/dist/{smart-card-CW0hjetE.js.map → smart-card-B6vLxqa_.js.map} +1 -1
- package/dist/{structure-DuxKl954.js → structure-DZJ2wbAU.js} +2 -2
- package/dist/{structure-DuxKl954.js.map → structure-DZJ2wbAU.js.map} +1 -1
- package/dist/style.css +1 -1
- package/dist/{surface-recipes-BKRVW8Os.js → surface-recipes-C8mNycaY.js} +2 -2
- package/dist/{surface-recipes-BKRVW8Os.js.map → surface-recipes-C8mNycaY.js.map} +1 -1
- package/dist/{table-CFOWY9pQ.js → table-CBonSdTp.js} +534 -486
- package/dist/table-CBonSdTp.js.map +1 -0
- package/dist/{table-B4TE7iOV.js → table-CXSPHH25.js} +75 -71
- package/dist/table-CXSPHH25.js.map +1 -0
- package/dist/{tabs-e7ko9S2o.js → tabs-C4Kr_hCr.js} +50 -49
- package/dist/tabs-C4Kr_hCr.js.map +1 -0
- package/dist/{text-inputs-B1culiSK.js → text-inputs-jdkS3ReG.js} +9 -9
- package/dist/{text-inputs-B1culiSK.js.map → text-inputs-jdkS3ReG.js.map} +1 -1
- package/dist/{timelines-D3Sl9ueq.js → timelines-CoPwdJP0.js} +10 -10
- package/dist/{timelines-D3Sl9ueq.js.map → timelines-CoPwdJP0.js.map} +1 -1
- package/dist/{tooltip-8wz5S_Zr.js → tooltip-31NwIpTo.js} +4 -4
- package/dist/{tooltip-8wz5S_Zr.js.map → tooltip-31NwIpTo.js.map} +1 -1
- package/dist/{tree-CzUJHnFs.js → tree-CeYVzdFE.js} +6 -6
- package/dist/{tree-CzUJHnFs.js.map → tree-CeYVzdFE.js.map} +1 -1
- package/dist/typography/rich-text.js +1 -1
- package/dist/{typography-BQnine1k.js → typography-C7-YMW1S.js} +2 -2
- package/dist/{typography-BQnine1k.js.map → typography-C7-YMW1S.js.map} +1 -1
- package/dist/typography.js +1 -1
- package/dist/{upload-BOW6U2tI.js → upload-Hdm5gObf.js} +303 -291
- package/dist/upload-Hdm5gObf.js.map +1 -0
- package/dist/{upload-queue-qUXn1ykN.js → upload-queue-D0sYPuqo.js} +8 -8
- package/dist/{upload-queue-qUXn1ykN.js.map → upload-queue-D0sYPuqo.js.map} +1 -1
- package/dist/{usage-card-BeSLY0i0.js → usage-card-9s8hLDfn.js} +9 -9
- package/dist/{usage-card-BeSLY0i0.js.map → usage-card-9s8hLDfn.js.map} +1 -1
- package/dist/{utils-B6kKb8jB.js → utils-DhuoqFy4.js} +31 -37
- package/dist/utils-DhuoqFy4.js.map +1 -0
- package/dist/{value-inputs-skdVB2zh.js → value-inputs-D3aPgq9H.js} +15 -15
- package/dist/{value-inputs-skdVB2zh.js.map → value-inputs-D3aPgq9H.js.map} +1 -1
- package/dist/{value-typography-uAmWUAL1.js → value-typography-uSzzG9Gf.js} +32 -26
- package/dist/value-typography-uSzzG9Gf.js.map +1 -0
- package/dist/{workspace-DHeHv0qw.js → workspace-CC8Vchiu.js} +12 -12
- package/dist/{workspace-DHeHv0qw.js.map → workspace-CC8Vchiu.js.map} +1 -1
- package/docs/consumer-skill/examples/edit.tsx +3 -3
- package/docs/consumer-skill/references/agents-md.md +19 -19
- package/docs/consumer-skill/references/analytics.md +15 -0
- package/docs/consumer-skill/references/component-contracts.json +14724 -13057
- package/docs/consumer-skill/references/composition.md +21 -4
- package/docs/consumer-skill/references/design-contract.md +1 -0
- package/docs/consumer-skill/references/installation.md +51 -8
- package/docs/consumer-skill/references/integration.md +24 -1
- package/docs/consumer-skill/references/public-api.json +172 -34
- package/docs/consumer-skill/references/review.md +51 -11
- package/docs/consumer-skill/references/rhf-workflows.md +72 -0
- package/docs/consumer-skill/references/theming.md +7 -2
- package/docs/consumer-skill/references/tokens.json +1 -1
- package/docs/consumer-skill/scripts/composition-policy.mjs +144 -30
- package/docs/consumer-skill/scripts/setup-skills.mjs +46 -9
- package/package.json +4 -2
- package/templates/admin-shell-template.tsx +1 -2
- package/templates/customers-template.tsx +18 -16
- package/dist/accordion-B9MHG0cT.js.map +0 -1
- package/dist/ai-artifact-C58tQcBy.js.map +0 -1
- package/dist/auth-DTkkshS8.js.map +0 -1
- package/dist/breadcrumbs-J-K2kl4c.js.map +0 -1
- package/dist/choice-inputs-zUgBZfE4.js.map +0 -1
- package/dist/combobox-BwzoXFSG.js +0 -884
- package/dist/combobox-BwzoXFSG.js.map +0 -1
- package/dist/comments-Dmpp0YIc.js.map +0 -1
- package/dist/data-display-BdgCAw8T.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/feedback-Dm4izqFn.js +0 -240
- package/dist/feedback-Dm4izqFn.js.map +0 -1
- package/dist/filters-DzgSJpMK.js.map +0 -1
- package/dist/form-field-BriWAXyg.js +0 -63
- package/dist/form-field-BriWAXyg.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/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/mentions-0_4nWuI-.js.map +0 -1
- package/dist/message-g8p7eVtN.js +0 -128
- package/dist/message-g8p7eVtN.js.map +0 -1
- package/dist/navigation-C90-oQFq.js.map +0 -1
- package/dist/navigation-DaRjthVk.js.map +0 -1
- package/dist/number-CRU3kGuk.js.map +0 -1
- package/dist/overlays-BSgCtM2v.js.map +0 -1
- package/dist/popover-B85RenIl.js.map +0 -1
- package/dist/primitives-ByWgGUgt.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.map +0 -1
- package/dist/safe-image-src-C6kQSMBZ.js +0 -17
- package/dist/safe-image-src-C6kQSMBZ.js.map +0 -1
- package/dist/sanitize-html-DsQmI48u.js.map +0 -1
- package/dist/settings-Bar5wiSo.js +0 -167
- package/dist/settings-Bar5wiSo.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/table-B4TE7iOV.js.map +0 -1
- package/dist/table-CFOWY9pQ.js.map +0 -1
- package/dist/tabs-e7ko9S2o.js.map +0 -1
- package/dist/upload-BOW6U2tI.js.map +0 -1
- package/dist/utils-B6kKb8jB.js.map +0 -1
- package/dist/value-typography-uAmWUAL1.js.map +0 -1
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { S as e, d as t } from "../ui-provider-C-74NVLc.js";
|
|
3
3
|
import { useStrings as n } from "../lib/strings.js";
|
|
4
|
-
import { t as r } from "../utils-
|
|
5
|
-
import { n as i } from "../buttons-
|
|
6
|
-
import { c as a, o } from "../typography-
|
|
4
|
+
import { t as r } from "../utils-DhuoqFy4.js";
|
|
5
|
+
import { n as i } from "../buttons-DeW0bQeK.js";
|
|
6
|
+
import { c as a, o } from "../typography-C7-YMW1S.js";
|
|
7
7
|
import { t as s } from "../focus-recipes-B653VaLq.js";
|
|
8
|
-
import { r as c, t as l } from "../structure-
|
|
9
|
-
import {
|
|
10
|
-
import { n as
|
|
11
|
-
import { t as
|
|
12
|
-
import { n as
|
|
13
|
-
import { r as
|
|
14
|
-
import { t as
|
|
15
|
-
import { a as
|
|
16
|
-
import { n as
|
|
17
|
-
import { t as
|
|
18
|
-
import { t as
|
|
19
|
-
import { t as
|
|
20
|
-
import { t as
|
|
21
|
-
import { c as
|
|
22
|
-
import { r as
|
|
23
|
-
import { t as
|
|
24
|
-
import { t as
|
|
25
|
-
import { a as
|
|
26
|
-
import { s as
|
|
27
|
-
import { createContext as
|
|
28
|
-
import { Fragment as
|
|
29
|
-
import { ArrowLeft as
|
|
30
|
-
import { createPortal as
|
|
8
|
+
import { r as c, t as l } from "../structure-DZJ2wbAU.js";
|
|
9
|
+
import { h as u, i as d, p as f } from "../smart-card-B6vLxqa_.js";
|
|
10
|
+
import { n as p, t as m } from "../feedback-Dzo1xtAU.js";
|
|
11
|
+
import { t as h } from "../progress-DZFXXzPs.js";
|
|
12
|
+
import { n as g, t as _ } from "../composition.recipes-COdiFhxB.js";
|
|
13
|
+
import { r as v, t as y } from "../overlays-CC8zI3Du.js";
|
|
14
|
+
import { t as b } from "../interaction-recipes-4wZ2tvfb.js";
|
|
15
|
+
import { a as x, i as S, t as C } from "../primitives-BkkQjYl7.js";
|
|
16
|
+
import { n as ee, t as w } from "../number-CYqBcrSj.js";
|
|
17
|
+
import { t as T } from "../badge-wWauMgAt.js";
|
|
18
|
+
import { t as te } from "../batch-action-bar-BoqWIIpV.js";
|
|
19
|
+
import { t as E } from "../input-7KAc7XQL.js";
|
|
20
|
+
import { t as D } from "../form-field-CAPdwdnZ.js";
|
|
21
|
+
import { c as O, l as ne } from "../choice-inputs-DHGtx0QV.js";
|
|
22
|
+
import { r as k, t as re } from "../control-group-recipes-fMuFo0H7.js";
|
|
23
|
+
import { t as A } from "../upload.recipes-BbxTqrCT.js";
|
|
24
|
+
import { t as ie } from "../metadata-list-XkqZ_UXH.js";
|
|
25
|
+
import { a as j } from "../upload-queue-D0sYPuqo.js";
|
|
26
|
+
import { s as M } from "../data-display-Cmj-xZYl.js";
|
|
27
|
+
import { createContext as ae, useCallback as N, useContext as oe, useEffect as se, useMemo as P, useRef as F, useState as I } from "react";
|
|
28
|
+
import { Fragment as ce, jsx as L, jsxs as R } from "react/jsx-runtime";
|
|
29
|
+
import { ArrowLeft as le, ArrowRight as z, Check as ue, File as B, Grid2X2 as de, ImageIcon as fe, ImagePlus as pe, Info as me, Layers3 as he, LayoutList as ge, Lock as _e, Play as V, Plus as ve, Search as ye, Star as be, Trash2 as xe, UploadCloud as Se, Video as Ce, X as we } from "lucide-react";
|
|
30
|
+
import { createPortal as Te } from "react-dom";
|
|
31
31
|
//#region src/components/features/media-library/media-library.strings.ts
|
|
32
|
-
var
|
|
32
|
+
var H = {
|
|
33
33
|
title: "Add media",
|
|
34
34
|
description: "Pick from the library, or upload new files.",
|
|
35
35
|
close: "Close media library",
|
|
@@ -105,7 +105,12 @@ var Ce = {
|
|
|
105
105
|
usedIn: "Used in",
|
|
106
106
|
replace: "Replace file",
|
|
107
107
|
delete: "Delete",
|
|
108
|
-
close: "Close details"
|
|
108
|
+
close: "Close details",
|
|
109
|
+
mutationError: "Could not change this asset. Try again.",
|
|
110
|
+
confirmDeleteTitle: "Delete media?",
|
|
111
|
+
confirmDeleteDescription: "{name} will be removed from this library.",
|
|
112
|
+
confirmDeleteLabel: "Delete asset",
|
|
113
|
+
confirmDeleteError: "Could not delete this asset. Try again."
|
|
109
114
|
},
|
|
110
115
|
upload: {
|
|
111
116
|
dropTitle: "Drag files here or click to browse",
|
|
@@ -120,7 +125,8 @@ var Ce = {
|
|
|
120
125
|
stagedCount: "{count} {count, plural, one {file} other {files}}",
|
|
121
126
|
removeFile: "Remove {name}",
|
|
122
127
|
uploading: "Uploading",
|
|
123
|
-
done: "Done"
|
|
128
|
+
done: "Done",
|
|
129
|
+
error: "Could not upload these files. Try again."
|
|
124
130
|
},
|
|
125
131
|
footer: {
|
|
126
132
|
pickOne: "Pick one item",
|
|
@@ -153,19 +159,19 @@ var Ce = {
|
|
|
153
159
|
maxReached: "Maximum reached"
|
|
154
160
|
}
|
|
155
161
|
};
|
|
156
|
-
function
|
|
162
|
+
function U(e, t) {
|
|
157
163
|
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
164
|
}
|
|
159
165
|
//#endregion
|
|
160
166
|
//#region src/components/features/media-library/hooks/use-media-library.ts
|
|
161
|
-
var
|
|
167
|
+
var Ee = {
|
|
162
168
|
collection: void 0,
|
|
163
169
|
tags: [],
|
|
164
170
|
public: !0
|
|
165
|
-
},
|
|
166
|
-
function
|
|
167
|
-
let [r, i] =
|
|
168
|
-
return [a,
|
|
171
|
+
}, De = [];
|
|
172
|
+
function Oe(e, t, n) {
|
|
173
|
+
let [r, i] = I(t), a = e ?? r;
|
|
174
|
+
return [a, N((t) => {
|
|
169
175
|
let r = typeof t == "function" ? t(a) : t;
|
|
170
176
|
e === void 0 && i(r), n?.(r);
|
|
171
177
|
}, [
|
|
@@ -174,7 +180,7 @@ function U(e, t, n) {
|
|
|
174
180
|
a
|
|
175
181
|
])];
|
|
176
182
|
}
|
|
177
|
-
var
|
|
183
|
+
var ke = {
|
|
178
184
|
getId: (e) => e.id,
|
|
179
185
|
getName: (e) => e.name,
|
|
180
186
|
getType: (e) => e.type,
|
|
@@ -192,47 +198,47 @@ var Ee = {
|
|
|
192
198
|
getTint: (e) => e.tint,
|
|
193
199
|
getMimeType: (e) => e.mimeType
|
|
194
200
|
};
|
|
195
|
-
function
|
|
201
|
+
function Ae(e) {
|
|
196
202
|
return {
|
|
197
|
-
...
|
|
203
|
+
...ke,
|
|
198
204
|
...e
|
|
199
205
|
};
|
|
200
206
|
}
|
|
201
|
-
function
|
|
202
|
-
return
|
|
207
|
+
function je(e) {
|
|
208
|
+
return x(e) ?? "";
|
|
203
209
|
}
|
|
204
|
-
function
|
|
210
|
+
function Me(e, t) {
|
|
205
211
|
let n = t.getWidth(e), r = t.getHeight(e);
|
|
206
212
|
return !n || !r ? "" : `${n} x ${r}`;
|
|
207
213
|
}
|
|
208
|
-
function
|
|
214
|
+
function Ne(e, t) {
|
|
209
215
|
let n = t.getUploadedAt(e);
|
|
210
216
|
if (!n) return 0;
|
|
211
217
|
let r = (n instanceof Date ? n : new Date(n)).getTime();
|
|
212
218
|
return Number.isFinite(r) ? r : 0;
|
|
213
219
|
}
|
|
214
|
-
function
|
|
220
|
+
function Pe(e) {
|
|
215
221
|
return e.type.startsWith("image/") ? "image" : e.type.startsWith("video/") ? "video" : "file";
|
|
216
222
|
}
|
|
217
|
-
function
|
|
223
|
+
function Fe(e) {
|
|
218
224
|
if (e.type.startsWith("image/") && typeof URL < "u" && typeof URL.createObjectURL == "function") return URL.createObjectURL(e);
|
|
219
225
|
}
|
|
220
|
-
function
|
|
226
|
+
function Ie(e) {
|
|
221
227
|
e && typeof URL < "u" && typeof URL.revokeObjectURL == "function" && URL.revokeObjectURL(e);
|
|
222
228
|
}
|
|
223
|
-
function
|
|
229
|
+
function Le(e) {
|
|
224
230
|
return Array.isArray(e) ? {
|
|
225
231
|
items: e,
|
|
226
232
|
total: e.length
|
|
227
233
|
} : e;
|
|
228
234
|
}
|
|
229
|
-
function
|
|
235
|
+
function Re(e, t) {
|
|
230
236
|
return t && typeof e == "object" && e ? {
|
|
231
237
|
...e,
|
|
232
238
|
...t
|
|
233
239
|
} : e;
|
|
234
240
|
}
|
|
235
|
-
function
|
|
241
|
+
function ze(e, t, n, r, i) {
|
|
236
242
|
let a = n.trim().toLowerCase();
|
|
237
243
|
return e.filter((e) => r !== "all" && t.getType(e) !== r || i !== "all" && t.getCollection(e) !== i ? !1 : !a || [
|
|
238
244
|
t.getName(e),
|
|
@@ -241,326 +247,425 @@ function Ie(e, t, n, r, i) {
|
|
|
241
247
|
...t.getTags(e)
|
|
242
248
|
].filter(Boolean).join(" ").toLowerCase().includes(a));
|
|
243
249
|
}
|
|
244
|
-
function
|
|
250
|
+
function Be(e, t, n) {
|
|
245
251
|
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) =>
|
|
252
|
+
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) => Ne(n, t) - Ne(e, t)), r;
|
|
247
253
|
}
|
|
248
|
-
function
|
|
249
|
-
let j =
|
|
250
|
-
...
|
|
251
|
-
...
|
|
252
|
-
tags:
|
|
253
|
-
}), [
|
|
254
|
-
...
|
|
254
|
+
function Ve({ items: e = De, fetcher: t, refreshKey: n, accessors: r, selectionMode: i = "multiple", value: a, defaultValue: o = [], onValueChange: s, onItemUpdate: c, onItemDelete: l, onUpload: u, onError: d, tab: f, defaultTab: p = "library", onTabChange: m, view: h, defaultView: g = "grid", onViewChange: _, query: v, defaultQuery: y = "", onQueryChange: b, type: x, defaultType: S = "all", onTypeChange: C, collection: ee, defaultCollection: w = "all", onCollectionChange: T, sort: te, defaultSort: E = "newest", onSortChange: D, uploadOptions: O, defaultUploadOptions: ne, onUploadOptionsChange: k, selecting: re, defaultSelecting: A = !1, onSelectingChange: ie } = {}) {
|
|
255
|
+
let j = !!t, M = P(() => Ae(r), [r]), [ae, oe] = Oe(f, p, m), [ce, L] = Oe(h, g, _), [R, le] = Oe(v, y, b), [z, ue] = Oe(x, S, C), [B, de] = Oe(ee, w, T), [fe, pe] = Oe(te, E, D), [me, he] = I(null), [ge, _e] = I(() => [...o]), [V, ve] = I(null), [ye, be] = I(j), [xe, Se] = I(null), [Ce, we] = I(null), [Te, H] = I(null), [U, ke] = I(null), [je, Me] = I([]), [Ne, Ve] = I([]), [He, Ue] = I(() => /* @__PURE__ */ new Map()), [W, We] = I(() => /* @__PURE__ */ new Set()), [G, K] = I({}), [Ge, q] = I([]), Ke = F(Ge), qe = F(0), [Je, Ye] = I(!1), J = P(() => ({
|
|
256
|
+
...Ee,
|
|
257
|
+
...ne,
|
|
258
|
+
tags: ne?.tags ?? Ee.tags
|
|
259
|
+
}), [ne]), [Xe, Ze] = Oe(P(() => O ? {
|
|
260
|
+
...Ee,
|
|
255
261
|
...O,
|
|
256
|
-
tags: O.tags ??
|
|
257
|
-
} : void 0, [O]),
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
]),
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
262
|
+
tags: O.tags ?? Ee.tags
|
|
263
|
+
} : void 0, [O]), J, k), Qe = a !== void 0, Y = P(() => Qe ? [...a ?? []] : ge, [
|
|
264
|
+
ge,
|
|
265
|
+
Qe,
|
|
266
|
+
a
|
|
267
|
+
]), $e = P(() => new Set(Y), [Y]), et = F(/* @__PURE__ */ new Set()), tt = F(null), nt = F(/* @__PURE__ */ new Map()), [rt, it] = I(0), X = N(() => it((e) => e + 1), []), at = F({
|
|
268
|
+
fetcher: t,
|
|
269
|
+
onError: d
|
|
270
|
+
});
|
|
271
|
+
se(() => {
|
|
272
|
+
at.current = {
|
|
273
|
+
fetcher: t,
|
|
274
|
+
onError: d
|
|
275
|
+
};
|
|
276
|
+
}, [t, d]), se(() => {
|
|
277
|
+
let e = at.current.fetcher;
|
|
278
|
+
if (!j || !e) {
|
|
279
|
+
be(!1), we(null), ve(null), Ve((e) => e.length ? [] : e);
|
|
280
|
+
return;
|
|
281
|
+
}
|
|
282
|
+
let t = new AbortController();
|
|
283
|
+
return be(!0), Se(null), we(null), (async () => {
|
|
284
|
+
try {
|
|
285
|
+
let n = await e({
|
|
286
|
+
query: R,
|
|
287
|
+
type: z,
|
|
288
|
+
collection: B === "all" ? void 0 : B,
|
|
289
|
+
sort: fe,
|
|
290
|
+
signal: t.signal
|
|
291
|
+
});
|
|
292
|
+
t.signal.aborted || ve(Le(n));
|
|
293
|
+
} catch (e) {
|
|
294
|
+
if (t.signal.aborted) return;
|
|
295
|
+
Se(() => e), we(() => e ?? /* @__PURE__ */ Error("Media load failed")), at.current.onError?.(e);
|
|
296
|
+
} finally {
|
|
297
|
+
t.signal.aborted || be(!1);
|
|
298
|
+
}
|
|
299
|
+
})(), () => t.abort();
|
|
280
300
|
}, [
|
|
281
301
|
B,
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
]),
|
|
289
|
-
|
|
302
|
+
rt,
|
|
303
|
+
j,
|
|
304
|
+
R,
|
|
305
|
+
n,
|
|
306
|
+
fe,
|
|
307
|
+
z
|
|
308
|
+
]), se(() => {
|
|
309
|
+
if (!j || !V) return;
|
|
310
|
+
let e = new Set(V.items.map((e) => M.getId(e)));
|
|
311
|
+
Ve((t) => {
|
|
312
|
+
let n = t.filter((t) => !e.has(M.getId(t)));
|
|
313
|
+
return n.length === t.length ? t : n;
|
|
314
|
+
});
|
|
315
|
+
}, [
|
|
316
|
+
M,
|
|
317
|
+
V,
|
|
318
|
+
j
|
|
319
|
+
]), se(() => {
|
|
320
|
+
let e = et.current;
|
|
290
321
|
return () => {
|
|
291
|
-
|
|
292
|
-
for (let t of e)
|
|
322
|
+
tt.current?.abort();
|
|
323
|
+
for (let t of e) Ie(t);
|
|
293
324
|
e.clear();
|
|
294
325
|
};
|
|
295
326
|
}, []);
|
|
296
|
-
let
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
j,
|
|
303
|
-
ke,
|
|
304
|
-
Ee,
|
|
305
|
-
qe
|
|
306
|
-
]), Je = N(() => {
|
|
307
|
-
let e = t ? Z : Ie(Z, j, L, R, B);
|
|
308
|
-
return t ? e : Le(e, j, ue);
|
|
327
|
+
let Z = V?.items ?? De, ot = P(() => {
|
|
328
|
+
let e = new Set(Z.map((e) => M.getId(e)));
|
|
329
|
+
return ze(Ne.filter((t) => {
|
|
330
|
+
let n = M.getId(t);
|
|
331
|
+
return !e.has(n) && !W.has(n);
|
|
332
|
+
}), M, R, z, B);
|
|
309
333
|
}, [
|
|
310
|
-
|
|
334
|
+
M,
|
|
311
335
|
B,
|
|
312
|
-
|
|
336
|
+
R,
|
|
337
|
+
W,
|
|
313
338
|
Z,
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
339
|
+
Ne,
|
|
340
|
+
z
|
|
341
|
+
]), st = P(() => j ? [...ot, ...Z] : [...je, ...e], [
|
|
342
|
+
je,
|
|
343
|
+
j,
|
|
344
|
+
e,
|
|
345
|
+
ot,
|
|
346
|
+
Z
|
|
347
|
+
]), ct = P(() => st.filter((e) => !W.has(M.getId(e))).map((e) => Re(e, G[M.getId(e)])), [
|
|
348
|
+
M,
|
|
349
|
+
G,
|
|
350
|
+
W,
|
|
351
|
+
st
|
|
352
|
+
]), lt = P(() => j ? ct : Be(ze(ct, M, R, z, B), M, fe), [
|
|
353
|
+
M,
|
|
354
|
+
B,
|
|
318
355
|
j,
|
|
356
|
+
ct,
|
|
357
|
+
R,
|
|
358
|
+
fe,
|
|
359
|
+
z
|
|
360
|
+
]), ut = j && V?.total !== void 0 ? V.total + ot.length : ct.length, dt = lt.length, ft = P(() => new Map([...Ne, ...Z].map((e) => [M.getId(e), e])), [
|
|
361
|
+
M,
|
|
319
362
|
Z,
|
|
363
|
+
Ne
|
|
364
|
+
]);
|
|
365
|
+
se(() => {
|
|
366
|
+
Ue((e) => {
|
|
367
|
+
let t = /* @__PURE__ */ new Map();
|
|
368
|
+
if (j) for (let n of Y) {
|
|
369
|
+
let r = ft.get(n) ?? e.get(n);
|
|
370
|
+
r !== void 0 && t.set(n, r);
|
|
371
|
+
}
|
|
372
|
+
return t.size === e.size && [...t].every(([t, n]) => e.get(t) === n) ? e : t;
|
|
373
|
+
});
|
|
374
|
+
}, [
|
|
375
|
+
j,
|
|
376
|
+
ft,
|
|
320
377
|
Y
|
|
321
|
-
])
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
378
|
+
]);
|
|
379
|
+
let pt = N((e, t = []) => {
|
|
380
|
+
if (!j) {
|
|
381
|
+
let n = new Set(e);
|
|
382
|
+
return [...t, ...ct].filter((e) => n.delete(M.getId(e)));
|
|
383
|
+
}
|
|
384
|
+
let n = new Map(t.map((e) => [M.getId(e), e]));
|
|
385
|
+
return e.flatMap((e) => {
|
|
386
|
+
if (W.has(e)) return [];
|
|
387
|
+
let t = n.get(e) ?? ft.get(e) ?? He.get(e);
|
|
388
|
+
return t === void 0 ? [] : [Re(t, G[e])];
|
|
389
|
+
});
|
|
325
390
|
}, [
|
|
391
|
+
M,
|
|
326
392
|
j,
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
393
|
+
G,
|
|
394
|
+
ft,
|
|
395
|
+
ct,
|
|
396
|
+
W,
|
|
397
|
+
He
|
|
398
|
+
]), mt = P(() => pt(Y), [pt, Y]), ht = !!R.trim() || z !== "all" || B !== "all", Q = N((e, t) => {
|
|
399
|
+
Qe || _e(e), s?.(e, pt(e, t));
|
|
333
400
|
}, [
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
]),
|
|
338
|
-
|
|
401
|
+
Qe,
|
|
402
|
+
s,
|
|
403
|
+
pt
|
|
404
|
+
]), gt = F({
|
|
405
|
+
applySelection: Q,
|
|
406
|
+
selectedIds: Y
|
|
407
|
+
});
|
|
408
|
+
se(() => {
|
|
409
|
+
gt.current = {
|
|
410
|
+
applySelection: Q,
|
|
411
|
+
selectedIds: Y
|
|
412
|
+
};
|
|
413
|
+
}, [Q, Y]);
|
|
414
|
+
let _t = N((e) => {
|
|
415
|
+
let t = new Set(i === "single" ? [] : $e);
|
|
416
|
+
$e.has(e) && i !== "single" ? t.delete(e) : t.add(e), Q(Array.from(t));
|
|
339
417
|
}, [
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
]),
|
|
344
|
-
|
|
418
|
+
Q,
|
|
419
|
+
$e,
|
|
420
|
+
i
|
|
421
|
+
]), vt = N(() => Q([]), [Q]), [yt, bt] = Oe(re, A, ie), xt = yt || Y.length > 0, St = N((e) => {
|
|
422
|
+
bt(e), !e && Y.length > 0 && Q([]);
|
|
345
423
|
}, [
|
|
424
|
+
Q,
|
|
425
|
+
Y.length,
|
|
426
|
+
bt
|
|
427
|
+
]), Ct = N(() => {
|
|
428
|
+
le(""), ue("all"), de("all");
|
|
429
|
+
}, [
|
|
430
|
+
de,
|
|
346
431
|
le,
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
432
|
+
ue
|
|
433
|
+
]), $ = N((e) => {
|
|
434
|
+
let t = e(Ke.current);
|
|
435
|
+
Ke.current = t, q(t);
|
|
436
|
+
}, []), wt = N((e) => {
|
|
437
|
+
e && (Ie(e), et.current.delete(e));
|
|
438
|
+
}, []), Tt = N((e) => {
|
|
439
|
+
if (e.length === 0) return;
|
|
440
|
+
ke(null);
|
|
441
|
+
let t = e.map((e) => {
|
|
442
|
+
let t = Fe(e);
|
|
443
|
+
return t && et.current.add(t), {
|
|
444
|
+
id: `staged-${qe.current++}`,
|
|
354
445
|
file: e,
|
|
355
446
|
name: e.name,
|
|
356
447
|
size: e.size,
|
|
357
|
-
type:
|
|
358
|
-
src:
|
|
448
|
+
type: Pe(e),
|
|
449
|
+
src: t,
|
|
359
450
|
progress: 0,
|
|
360
451
|
status: "staged"
|
|
361
452
|
};
|
|
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
453
|
});
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
454
|
+
$((e) => [...e, ...t]);
|
|
455
|
+
}, [$]), Et = N((e) => {
|
|
456
|
+
$((t) => (wt(t.find((t) => t.id === e)?.src), t.filter((t) => t.id !== e)));
|
|
457
|
+
}, [wt, $]), Dt = N(() => {
|
|
458
|
+
ke(null), $((e) => {
|
|
459
|
+
for (let t of e) wt(t.src);
|
|
371
460
|
return [];
|
|
372
461
|
});
|
|
373
|
-
}, []),
|
|
374
|
-
|
|
462
|
+
}, [wt, $]), Ot = N((e) => {
|
|
463
|
+
Ze((t) => ({
|
|
375
464
|
...t,
|
|
376
465
|
...e
|
|
377
466
|
}));
|
|
378
|
-
}, [
|
|
379
|
-
|
|
467
|
+
}, [Ze]), kt = N((e, t) => {
|
|
468
|
+
$((n) => n.map((n) => n.id === e ? {
|
|
380
469
|
...n,
|
|
381
470
|
...t
|
|
382
471
|
} : 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));
|
|
472
|
+
}, [$]), At = N(async () => {
|
|
473
|
+
let e = Ke.current;
|
|
474
|
+
if (tt.current || e.length === 0) return;
|
|
475
|
+
let t = e.map((e) => e.id), n = new Set(t), r = new AbortController();
|
|
476
|
+
tt.current = r, Se(null), ke(null), Ye(!0), $((e) => e.map((e) => n.has(e.id) ? {
|
|
477
|
+
...e,
|
|
478
|
+
status: "uploading",
|
|
479
|
+
progress: 0,
|
|
480
|
+
error: void 0
|
|
481
|
+
} : e));
|
|
482
|
+
let a = (e) => !r.signal.aborted && tt.current === r && n.has(e), o = {
|
|
483
|
+
signal: r.signal,
|
|
484
|
+
fileIds: t,
|
|
485
|
+
setProgress: (e, t) => {
|
|
486
|
+
a(e) && kt(e, { progress: Math.max(0, Math.min(100, t)) });
|
|
487
|
+
},
|
|
488
|
+
setFileStatus: (e, t, n) => {
|
|
489
|
+
a(e) && kt(e, {
|
|
490
|
+
status: t,
|
|
491
|
+
error: n
|
|
492
|
+
});
|
|
464
493
|
}
|
|
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;
|
|
494
|
+
};
|
|
495
|
+
try {
|
|
496
|
+
let t = e.map((e) => e.file), a = await u?.(t, Xe, o);
|
|
497
|
+
if (r.signal.aborted) return;
|
|
498
|
+
if ($((e) => e.filter((e) => !n.has(e.id) || e.status === "error" || (wt(e.src), !1))), a?.length) {
|
|
499
|
+
let e = a.map((e) => M.getId(e));
|
|
500
|
+
if (j) {
|
|
501
|
+
let t = new Set(e);
|
|
502
|
+
Ve((e) => [...a, ...e.filter((e) => !t.has(M.getId(e)))]);
|
|
503
|
+
} else Me((e) => [...a, ...e]);
|
|
504
|
+
let t = gt.current;
|
|
505
|
+
t.applySelection(i === "single" ? e.slice(0, 1) : Array.from(/* @__PURE__ */ new Set([...e, ...t.selectedIds])), a);
|
|
505
506
|
}
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
507
|
+
j && u && X(), Ke.current.length === 0 && oe("library");
|
|
508
|
+
} catch (e) {
|
|
509
|
+
if (r.signal.aborted) return;
|
|
510
|
+
Se(() => e), ke(() => e ?? /* @__PURE__ */ Error("Media upload failed")), $((e) => e.map((e) => n.has(e.id) && e.status === "uploading" ? {
|
|
511
|
+
...e,
|
|
512
|
+
status: "error",
|
|
513
|
+
error: "Upload failed"
|
|
514
|
+
} : e)), d?.(e);
|
|
515
|
+
} finally {
|
|
516
|
+
tt.current === r && (tt.current = null, Ye(!1));
|
|
517
|
+
}
|
|
518
|
+
}, [
|
|
519
|
+
M,
|
|
520
|
+
j,
|
|
521
|
+
d,
|
|
522
|
+
u,
|
|
523
|
+
wt,
|
|
524
|
+
X,
|
|
525
|
+
i,
|
|
526
|
+
oe,
|
|
527
|
+
kt,
|
|
528
|
+
$,
|
|
529
|
+
Xe
|
|
530
|
+
]), jt = N(() => {
|
|
531
|
+
tt.current?.abort(), tt.current = null, Ye(!1), $((e) => e.map((e) => e.status === "uploading" ? {
|
|
532
|
+
...e,
|
|
533
|
+
status: "staged",
|
|
534
|
+
progress: 0,
|
|
535
|
+
error: void 0
|
|
536
|
+
} : e));
|
|
537
|
+
}, [$]), Mt = N(async (e, t) => {
|
|
538
|
+
if (!c) return !1;
|
|
539
|
+
let n = M.getId(e), r = `update:${n}`, i = (nt.current.get(r) ?? 0) + 1;
|
|
540
|
+
nt.current.set(r, i);
|
|
541
|
+
let a = G[n];
|
|
542
|
+
Se(null), H((e) => e?.itemId === n ? null : e), K((e) => ({
|
|
543
|
+
...e,
|
|
544
|
+
[n]: {
|
|
545
|
+
...e[n],
|
|
546
|
+
...t
|
|
524
547
|
}
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
548
|
+
}));
|
|
549
|
+
try {
|
|
550
|
+
return await c(e, t), !0;
|
|
551
|
+
} catch (e) {
|
|
552
|
+
return nt.current.get(r) === i && (H({
|
|
553
|
+
itemId: n,
|
|
554
|
+
operation: "update",
|
|
555
|
+
cause: e
|
|
556
|
+
}), K((e) => {
|
|
557
|
+
let t = { ...e };
|
|
558
|
+
return a ? t[n] = a : delete t[n], t;
|
|
559
|
+
})), Se(() => e), d?.(e), !1;
|
|
560
|
+
}
|
|
561
|
+
}, [
|
|
562
|
+
M,
|
|
563
|
+
G,
|
|
564
|
+
d,
|
|
565
|
+
c
|
|
566
|
+
]), Nt = N(async (e) => {
|
|
567
|
+
if (!l) return !1;
|
|
568
|
+
let t = M.getId(e), n = `delete:${t}`, r = (nt.current.get(n) ?? 0) + 1;
|
|
569
|
+
nt.current.set(n, r);
|
|
570
|
+
let i = W.has(t);
|
|
571
|
+
Se(null), H((e) => e?.itemId === t ? null : e), We((e) => new Set(e).add(t));
|
|
572
|
+
try {
|
|
573
|
+
return await l(e), $e.has(t) && Q(Y.filter((e) => e !== t)), !0;
|
|
574
|
+
} catch (e) {
|
|
575
|
+
return nt.current.get(n) === r && (H({
|
|
576
|
+
itemId: t,
|
|
577
|
+
operation: "delete",
|
|
578
|
+
cause: e
|
|
579
|
+
}), i || We((e) => {
|
|
580
|
+
let n = new Set(e);
|
|
581
|
+
return n.delete(t), n;
|
|
582
|
+
})), Se(() => e), d?.(e), !1;
|
|
583
|
+
}
|
|
584
|
+
}, [
|
|
585
|
+
M,
|
|
586
|
+
Q,
|
|
587
|
+
d,
|
|
588
|
+
l,
|
|
589
|
+
W,
|
|
590
|
+
Y,
|
|
591
|
+
$e
|
|
592
|
+
]);
|
|
593
|
+
return {
|
|
594
|
+
tab: ae,
|
|
595
|
+
setTab: oe,
|
|
596
|
+
view: ce,
|
|
597
|
+
setView: L,
|
|
598
|
+
query: R,
|
|
599
|
+
setQuery: le,
|
|
600
|
+
type: z,
|
|
601
|
+
setType: ue,
|
|
602
|
+
collection: B,
|
|
603
|
+
setCollection: de,
|
|
604
|
+
sort: fe,
|
|
605
|
+
setSort: pe,
|
|
606
|
+
detailId: me,
|
|
607
|
+
setDetailId: he,
|
|
608
|
+
items: ct,
|
|
609
|
+
visibleItems: lt,
|
|
610
|
+
selectedIds: Y,
|
|
611
|
+
selectedItems: mt,
|
|
612
|
+
selectedSet: $e,
|
|
613
|
+
toggleSelection: _t,
|
|
614
|
+
clearSelection: vt,
|
|
615
|
+
selecting: xt,
|
|
616
|
+
setSelecting: St,
|
|
617
|
+
clearFilters: Ct,
|
|
618
|
+
loading: ye,
|
|
619
|
+
hasLoadedResults: j && (V !== null || ot.length > 0),
|
|
620
|
+
error: xe,
|
|
621
|
+
loadError: Ce,
|
|
622
|
+
mutationError: Te,
|
|
623
|
+
uploadError: U,
|
|
624
|
+
retry: X,
|
|
625
|
+
hasFilters: ht,
|
|
626
|
+
totalCount: ut,
|
|
627
|
+
filteredCount: dt,
|
|
628
|
+
stagedFiles: Ge,
|
|
629
|
+
addFiles: Tt,
|
|
630
|
+
removeStagedFile: Et,
|
|
631
|
+
clearStagedFiles: Dt,
|
|
632
|
+
updateUploadOptions: Ot,
|
|
633
|
+
uploadOptions: Xe,
|
|
634
|
+
uploading: Je,
|
|
635
|
+
startUpload: At,
|
|
636
|
+
cancelUpload: jt,
|
|
637
|
+
updateItem: Mt,
|
|
638
|
+
removeItem: Nt,
|
|
639
|
+
accessors: M
|
|
535
640
|
};
|
|
536
641
|
}
|
|
537
642
|
//#endregion
|
|
538
643
|
//#region src/components/features/media-library/partials/media-library-partials.tsx
|
|
539
|
-
var
|
|
540
|
-
function
|
|
541
|
-
return
|
|
644
|
+
var He = `${b.nativeButtonReset} absolute inset-0 z-10 block h-full w-full cursor-pointer outline-none ${s.inset}`, Ue = "media-library-card--check absolute left-2 top-2 inline-flex size-icon-lg items-center justify-center rounded-radius border border-border bg-background p-0 text-transparent shadow-xs", W = "border-primary bg-primary text-primary-foreground opacity-100";
|
|
645
|
+
function We(e, t) {
|
|
646
|
+
return L(e === "image" ? fe : e === "video" ? Ce : B, { className: t ?? "size-icon" });
|
|
542
647
|
}
|
|
543
648
|
function G(e, t) {
|
|
544
649
|
return e === "image" ? t.typeImage : e === "video" ? t.typeVideo : t.typeFile;
|
|
545
650
|
}
|
|
546
651
|
function K(e, t) {
|
|
547
|
-
return e ?
|
|
652
|
+
return e ? U(t.usedIn, { count: e }) : t.notUsed;
|
|
548
653
|
}
|
|
549
|
-
function
|
|
550
|
-
return /* @__PURE__ */
|
|
654
|
+
function Ge({ children: e, tint: t, className: n }) {
|
|
655
|
+
return /* @__PURE__ */ L("div", {
|
|
551
656
|
className: r("media-library-preview relative overflow-hidden bg-muted", n),
|
|
552
657
|
style: t ? { background: t } : void 0,
|
|
553
658
|
children: e
|
|
554
659
|
});
|
|
555
660
|
}
|
|
556
|
-
function
|
|
557
|
-
let [a, o] =
|
|
558
|
-
return
|
|
661
|
+
function q({ src: e, alt: t, type: n, className: r, loading: i = "lazy" }) {
|
|
662
|
+
let [a, o] = I(!1);
|
|
663
|
+
return se(() => {
|
|
559
664
|
o(!1);
|
|
560
|
-
}, [e]), !e || a ? /* @__PURE__ */
|
|
665
|
+
}, [e]), !e || a ? /* @__PURE__ */ L("div", {
|
|
561
666
|
className: "media-library-preview--fallback flex size-full items-center justify-center text-muted-foreground",
|
|
562
|
-
children:
|
|
563
|
-
}) : /* @__PURE__ */
|
|
667
|
+
children: We(n, "size-6")
|
|
668
|
+
}) : /* @__PURE__ */ L("img", {
|
|
564
669
|
src: e,
|
|
565
670
|
alt: t,
|
|
566
671
|
loading: i,
|
|
@@ -568,12 +673,12 @@ function J({ src: e, alt: t, type: n, className: r, loading: i = "lazy" }) {
|
|
|
568
673
|
onError: () => o(!0)
|
|
569
674
|
});
|
|
570
675
|
}
|
|
571
|
-
function
|
|
572
|
-
return /* @__PURE__ */
|
|
676
|
+
function Ke({ icon: e, title: t, description: n, action: i, className: a }) {
|
|
677
|
+
return /* @__PURE__ */ L(M, {
|
|
573
678
|
title: t,
|
|
574
679
|
description: n ?? !1,
|
|
575
680
|
actions: i,
|
|
576
|
-
media: e ?? /* @__PURE__ */
|
|
681
|
+
media: e ?? /* @__PURE__ */ L(fe, {
|
|
577
682
|
className: "size-icon",
|
|
578
683
|
"aria-hidden": "true"
|
|
579
684
|
}),
|
|
@@ -583,8 +688,8 @@ function Y({ icon: e, title: t, description: n, action: i, className: a }) {
|
|
|
583
688
|
className: r("media-library-empty-state--component min-h-64 bg-muted/30", a)
|
|
584
689
|
});
|
|
585
690
|
}
|
|
586
|
-
function
|
|
587
|
-
let { defaultScale: te } = t(),
|
|
691
|
+
function qe({ query: n, type: o, typeFilters: s, collection: c, sort: u, view: d, collections: f = [], strings: p, onQueryChange: m, onTypeChange: h, onCollectionChange: g, onSortChange: _, onViewChange: v, onClearFilters: y, toolbarEnd: x, selecting: S = !1, onSelectingChange: C, summary: ee, disabled: w = !1 }) {
|
|
692
|
+
let { defaultScale: te } = t(), D = e(void 0, te), O = [
|
|
588
693
|
{
|
|
589
694
|
value: "all",
|
|
590
695
|
label: p.allTypes,
|
|
@@ -593,29 +698,29 @@ function He({ query: n, type: o, typeFilters: s, collection: c, sort: u, view: d
|
|
|
593
698
|
{
|
|
594
699
|
value: "image",
|
|
595
700
|
label: p.images,
|
|
596
|
-
icon:
|
|
701
|
+
icon: fe
|
|
597
702
|
},
|
|
598
703
|
{
|
|
599
704
|
value: "video",
|
|
600
705
|
label: p.videos,
|
|
601
|
-
icon:
|
|
706
|
+
icon: Ce
|
|
602
707
|
},
|
|
603
708
|
{
|
|
604
709
|
value: "file",
|
|
605
710
|
label: p.files,
|
|
606
|
-
icon:
|
|
711
|
+
icon: B
|
|
607
712
|
}
|
|
608
713
|
].filter((e) => (s ?? [
|
|
609
714
|
"all",
|
|
610
715
|
"image",
|
|
611
716
|
"video"
|
|
612
|
-
]).includes(e.value)),
|
|
717
|
+
]).includes(e.value)), A = [{
|
|
613
718
|
value: "all",
|
|
614
719
|
label: p.allCollections
|
|
615
720
|
}, ...f.map((e) => ({
|
|
616
721
|
value: e.value,
|
|
617
722
|
label: String(e.label)
|
|
618
|
-
}))],
|
|
723
|
+
}))], ie = [
|
|
619
724
|
{
|
|
620
725
|
value: "newest",
|
|
621
726
|
label: p.sortNewest
|
|
@@ -632,73 +737,73 @@ function He({ query: n, type: o, typeFilters: s, collection: c, sort: u, view: d
|
|
|
632
737
|
value: "usage",
|
|
633
738
|
label: p.sortUsage
|
|
634
739
|
}
|
|
635
|
-
],
|
|
636
|
-
return /* @__PURE__ */
|
|
740
|
+
], j = n.trim(), M = j.length > 0, ae = M || o !== "all" || c !== "all";
|
|
741
|
+
return /* @__PURE__ */ R(l, {
|
|
637
742
|
direction: "horizontal",
|
|
638
743
|
wrap: !0,
|
|
639
744
|
align: "start",
|
|
640
745
|
gap: "md",
|
|
641
746
|
className: "media-library-toolbar--component",
|
|
642
|
-
children: [/* @__PURE__ */
|
|
747
|
+
children: [/* @__PURE__ */ R(l, {
|
|
643
748
|
direction: "horizontal",
|
|
644
749
|
wrap: !0,
|
|
645
750
|
align: "start",
|
|
646
751
|
gap: "md",
|
|
647
752
|
className: "media-library-toolbar--filters min-w-0 grow basis-80",
|
|
648
753
|
children: [
|
|
649
|
-
/* @__PURE__ */
|
|
754
|
+
/* @__PURE__ */ R(l, {
|
|
650
755
|
gap: "xs",
|
|
651
756
|
className: "media-library-toolbar--search min-w-52 flex-1",
|
|
652
|
-
children: [/* @__PURE__ */
|
|
757
|
+
children: [/* @__PURE__ */ L(E, {
|
|
653
758
|
value: n,
|
|
654
759
|
onChange: (e) => m(e.target.value),
|
|
655
760
|
placeholder: p.searchPlaceholder,
|
|
656
|
-
startIcon:
|
|
761
|
+
startIcon: ye,
|
|
657
762
|
clearable: !0,
|
|
658
763
|
onClear: () => m(""),
|
|
659
764
|
strings: { clear: p.clearSearch },
|
|
660
|
-
disabled:
|
|
765
|
+
disabled: w,
|
|
661
766
|
className: "bg-background"
|
|
662
|
-
}), !!
|
|
767
|
+
}), !!M && /* @__PURE__ */ L(l, {
|
|
663
768
|
direction: "horizontal",
|
|
664
769
|
gap: "xs",
|
|
665
770
|
wrap: !1,
|
|
666
771
|
className: "media-library-toolbar--search-value px-space-xs",
|
|
667
|
-
children: /* @__PURE__ */
|
|
772
|
+
children: /* @__PURE__ */ R(T, {
|
|
668
773
|
tone: "secondary",
|
|
669
774
|
className: "max-w-full",
|
|
670
|
-
children: [/* @__PURE__ */
|
|
775
|
+
children: [/* @__PURE__ */ L(a, {
|
|
671
776
|
tag: "span",
|
|
672
777
|
size: "inherit",
|
|
673
778
|
className: "text-current",
|
|
674
779
|
children: p.activeSearchLabel
|
|
675
|
-
}), /* @__PURE__ */
|
|
780
|
+
}), /* @__PURE__ */ L(a, {
|
|
676
781
|
tag: "span",
|
|
677
782
|
size: "inherit",
|
|
678
783
|
weight: "normal",
|
|
679
784
|
className: "min-w-0 truncate text-current",
|
|
680
|
-
children:
|
|
785
|
+
children: j
|
|
681
786
|
})]
|
|
682
787
|
})
|
|
683
788
|
})]
|
|
684
789
|
}),
|
|
685
|
-
/* @__PURE__ */
|
|
686
|
-
className: r("media-library-toolbar--type-toggle shrink-0",
|
|
790
|
+
/* @__PURE__ */ L("div", {
|
|
791
|
+
className: r("media-library-toolbar--type-toggle shrink-0", k.frame, re[D]),
|
|
687
792
|
role: "tablist",
|
|
688
793
|
"aria-label": p.typeFilterLabel,
|
|
689
|
-
children:
|
|
794
|
+
children: O.map((e) => {
|
|
690
795
|
let t = e.icon, n = o === e.value;
|
|
691
|
-
return /* @__PURE__ */
|
|
796
|
+
return /* @__PURE__ */ R(i, {
|
|
692
797
|
type: "button",
|
|
693
798
|
role: "tab",
|
|
694
799
|
"aria-selected": n,
|
|
695
800
|
tone: "secondary",
|
|
696
801
|
buttonStyle: "ghost",
|
|
697
802
|
size: "sm",
|
|
698
|
-
disabled:
|
|
699
|
-
className: r(
|
|
803
|
+
disabled: w,
|
|
804
|
+
className: r(k.item, "shadow-none", n ? `${b.segmentActive} hover:bg-card` : "text-muted-foreground hover:bg-transparent hover:text-foreground"),
|
|
700
805
|
onClick: () => h(e.value),
|
|
701
|
-
children: [t && /* @__PURE__ */
|
|
806
|
+
children: [t && /* @__PURE__ */ L(t, { className: "size-icon-md" }), /* @__PURE__ */ L(a, {
|
|
702
807
|
tag: "span",
|
|
703
808
|
size: "xs",
|
|
704
809
|
weight: "medium",
|
|
@@ -708,86 +813,86 @@ function He({ query: n, type: o, typeFilters: s, collection: c, sort: u, view: d
|
|
|
708
813
|
}, e.value);
|
|
709
814
|
})
|
|
710
815
|
}),
|
|
711
|
-
/* @__PURE__ */
|
|
816
|
+
/* @__PURE__ */ R(l, {
|
|
712
817
|
direction: "horizontal",
|
|
713
818
|
gap: "md",
|
|
714
819
|
wrap: !0,
|
|
715
820
|
className: "media-library-toolbar--selects min-w-0",
|
|
716
|
-
children: [/* @__PURE__ */
|
|
821
|
+
children: [/* @__PURE__ */ L("div", {
|
|
717
822
|
className: "min-w-40 grow",
|
|
718
|
-
children: /* @__PURE__ */
|
|
823
|
+
children: /* @__PURE__ */ L(ne, {
|
|
719
824
|
value: c,
|
|
720
|
-
options:
|
|
825
|
+
options: A,
|
|
721
826
|
onValueChange: (e) => g(e ?? "all"),
|
|
722
827
|
placeholder: p.collectionFilterLabel,
|
|
723
828
|
"aria-label": p.collectionFilterLabel,
|
|
724
|
-
disabled:
|
|
829
|
+
disabled: w,
|
|
725
830
|
className: "bg-background"
|
|
726
831
|
})
|
|
727
|
-
}), /* @__PURE__ */
|
|
832
|
+
}), /* @__PURE__ */ L("div", {
|
|
728
833
|
className: "min-w-32 grow",
|
|
729
|
-
children: /* @__PURE__ */
|
|
834
|
+
children: /* @__PURE__ */ L(ne, {
|
|
730
835
|
value: u,
|
|
731
|
-
options:
|
|
732
|
-
onValueChange: (e) =>
|
|
836
|
+
options: ie,
|
|
837
|
+
onValueChange: (e) => _(e ?? "newest"),
|
|
733
838
|
placeholder: p.sortLabel,
|
|
734
839
|
"aria-label": p.sortLabel,
|
|
735
|
-
disabled:
|
|
840
|
+
disabled: w,
|
|
736
841
|
className: "bg-background"
|
|
737
842
|
})
|
|
738
843
|
})]
|
|
739
844
|
}),
|
|
740
|
-
!!ae && /* @__PURE__ */
|
|
845
|
+
!!ae && /* @__PURE__ */ L(i, {
|
|
741
846
|
type: "button",
|
|
742
847
|
tone: "secondary",
|
|
743
848
|
buttonStyle: "ghost",
|
|
744
|
-
disabled:
|
|
745
|
-
onClick:
|
|
849
|
+
disabled: w,
|
|
850
|
+
onClick: y,
|
|
746
851
|
children: p.clearFilters
|
|
747
852
|
})
|
|
748
853
|
]
|
|
749
|
-
}), /* @__PURE__ */
|
|
854
|
+
}), /* @__PURE__ */ R(l, {
|
|
750
855
|
direction: "horizontal",
|
|
751
856
|
align: "center",
|
|
752
857
|
gap: "md",
|
|
753
858
|
wrap: !1,
|
|
754
859
|
className: "media-library-toolbar--view ms-auto min-w-0 max-w-full",
|
|
755
860
|
children: [
|
|
756
|
-
|
|
757
|
-
/* @__PURE__ */
|
|
758
|
-
className: r("media-library-toolbar--view-toggle shrink-0",
|
|
759
|
-
children: [/* @__PURE__ */
|
|
861
|
+
ee,
|
|
862
|
+
/* @__PURE__ */ R("div", {
|
|
863
|
+
className: r("media-library-toolbar--view-toggle shrink-0", k.frame, re[D]),
|
|
864
|
+
children: [/* @__PURE__ */ L(i, {
|
|
760
865
|
type: "button",
|
|
761
866
|
tone: d === "grid" ? "neutral" : "secondary",
|
|
762
867
|
buttonStyle: d === "grid" ? "solid" : "ghost",
|
|
763
868
|
size: "sm",
|
|
764
869
|
iconOnly: !0,
|
|
765
|
-
disabled:
|
|
766
|
-
className: r(
|
|
870
|
+
disabled: w,
|
|
871
|
+
className: r(k.item, d === "grid" && `${b.segmentActive} hover:bg-card`),
|
|
767
872
|
"aria-label": p.gridView,
|
|
768
|
-
onClick: () =>
|
|
769
|
-
children: /* @__PURE__ */
|
|
770
|
-
}), /* @__PURE__ */
|
|
873
|
+
onClick: () => v("grid"),
|
|
874
|
+
children: /* @__PURE__ */ L(de, { className: "size-icon-md" })
|
|
875
|
+
}), /* @__PURE__ */ L(i, {
|
|
771
876
|
type: "button",
|
|
772
877
|
tone: d === "table" ? "neutral" : "secondary",
|
|
773
878
|
buttonStyle: d === "table" ? "solid" : "ghost",
|
|
774
879
|
size: "sm",
|
|
775
880
|
iconOnly: !0,
|
|
776
|
-
disabled:
|
|
777
|
-
className: r(
|
|
881
|
+
disabled: w,
|
|
882
|
+
className: r(k.item, d === "table" && `${b.segmentActive} hover:bg-card`),
|
|
778
883
|
"aria-label": p.tableView,
|
|
779
|
-
onClick: () =>
|
|
780
|
-
children: /* @__PURE__ */
|
|
884
|
+
onClick: () => v("table"),
|
|
885
|
+
children: /* @__PURE__ */ L(ge, { className: "size-icon-md" })
|
|
781
886
|
})]
|
|
782
887
|
}),
|
|
783
|
-
!!
|
|
888
|
+
!!C && /* @__PURE__ */ L(i, {
|
|
784
889
|
type: "button",
|
|
785
890
|
"aria-pressed": S,
|
|
786
891
|
tone: "secondary",
|
|
787
892
|
buttonStyle: "outline",
|
|
788
|
-
disabled:
|
|
789
|
-
className: r("media-library-toolbar--select shrink-0", S &&
|
|
790
|
-
onClick: () =>
|
|
893
|
+
disabled: w,
|
|
894
|
+
className: r("media-library-toolbar--select shrink-0", S && b.togglePressed),
|
|
895
|
+
onClick: () => C(!S),
|
|
791
896
|
children: p.selectMode
|
|
792
897
|
}),
|
|
793
898
|
x
|
|
@@ -795,101 +900,101 @@ function He({ query: n, type: o, typeFilters: s, collection: c, sort: u, view: d
|
|
|
795
900
|
})]
|
|
796
901
|
});
|
|
797
902
|
}
|
|
798
|
-
function
|
|
799
|
-
let
|
|
800
|
-
return /* @__PURE__ */
|
|
903
|
+
function Je({ item: e, selected: t = !1, density: n = "comfortable", showMeta: o = !0, accessors: u, strings: d, onToggle: f, onDetails: p, onOpen: m, selecting: h = !1, className: g }) {
|
|
904
|
+
let _ = u.getType(e), v = u.getName(e), y = u.getSrc(e), x = u.getAlt(e) || v, C = u.getSize(e), ee = u.getUsageCount(e), w = u.getPublic(e) === !1, te = u.getDuration(e), E = !!m && !h, D = E ? m : f;
|
|
905
|
+
return /* @__PURE__ */ R("div", {
|
|
801
906
|
"data-selected": t || void 0,
|
|
802
907
|
"data-selecting": h || void 0,
|
|
803
908
|
"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:
|
|
909
|
+
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", `${b.tileHover} hover:shadow-sm`, t && "media-library-card--selected border-primary ring-1 ring-primary", g),
|
|
910
|
+
onClick: D,
|
|
806
911
|
children: [
|
|
807
|
-
!!
|
|
912
|
+
!!D && /* @__PURE__ */ L("button", {
|
|
808
913
|
type: "button",
|
|
809
|
-
"aria-label":
|
|
810
|
-
"aria-pressed":
|
|
811
|
-
className: r("media-library-card--select rounded-radius",
|
|
914
|
+
"aria-label": v,
|
|
915
|
+
"aria-pressed": E ? void 0 : t,
|
|
916
|
+
className: r("media-library-card--select rounded-radius", He),
|
|
812
917
|
onClick: (e) => {
|
|
813
|
-
e.stopPropagation(),
|
|
918
|
+
e.stopPropagation(), D();
|
|
814
919
|
}
|
|
815
920
|
}),
|
|
816
|
-
/* @__PURE__ */
|
|
921
|
+
/* @__PURE__ */ R(Ge, {
|
|
817
922
|
tint: u.getTint(e),
|
|
818
923
|
className: r(n === "compact" ? "aspect-square" : "aspect-[4/3]"),
|
|
819
924
|
children: [
|
|
820
|
-
/* @__PURE__ */
|
|
821
|
-
src:
|
|
822
|
-
alt:
|
|
823
|
-
type:
|
|
925
|
+
/* @__PURE__ */ L(q, {
|
|
926
|
+
src: y,
|
|
927
|
+
alt: x,
|
|
928
|
+
type: _,
|
|
824
929
|
className: "size-full object-cover"
|
|
825
930
|
}),
|
|
826
|
-
|
|
931
|
+
E && f ? /* @__PURE__ */ L("button", {
|
|
827
932
|
type: "button",
|
|
828
|
-
"aria-label":
|
|
933
|
+
"aria-label": U(d.selectItem, { name: v }),
|
|
829
934
|
"aria-pressed": t,
|
|
830
|
-
className: r(
|
|
935
|
+
className: r(Ue, `z-10 cursor-pointer opacity-0 transition-opacity group-hover/card:opacity-100 group-focus-within/card:opacity-100 pointer-coarse:opacity-100 ${s.frame}`, t && W),
|
|
831
936
|
onClick: (e) => {
|
|
832
937
|
e.stopPropagation(), f();
|
|
833
938
|
},
|
|
834
|
-
children: /* @__PURE__ */
|
|
835
|
-
}) : /* @__PURE__ */
|
|
836
|
-
className: r(
|
|
939
|
+
children: /* @__PURE__ */ L(ue, { className: "size-icon-sm" })
|
|
940
|
+
}) : /* @__PURE__ */ L("span", {
|
|
941
|
+
className: r(Ue, "transition-opacity", h ? "opacity-100" : "opacity-0 group-hover/card:opacity-100 group-focus-within/card:opacity-100", t && W),
|
|
837
942
|
"aria-hidden": "true",
|
|
838
|
-
children: /* @__PURE__ */
|
|
943
|
+
children: /* @__PURE__ */ L(ue, { className: "size-icon-sm" })
|
|
839
944
|
}),
|
|
840
|
-
!!p && /* @__PURE__ */
|
|
945
|
+
!!p && /* @__PURE__ */ L(i, {
|
|
841
946
|
type: "button",
|
|
842
947
|
tone: "secondary",
|
|
843
948
|
buttonStyle: "solid",
|
|
844
949
|
size: "sm",
|
|
845
950
|
iconOnly: !0,
|
|
846
951
|
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":
|
|
952
|
+
"aria-label": U(d.cardDetails, { name: v }),
|
|
848
953
|
onClick: (e) => {
|
|
849
954
|
e.stopPropagation(), p();
|
|
850
955
|
},
|
|
851
|
-
children: /* @__PURE__ */
|
|
956
|
+
children: /* @__PURE__ */ L(me, { className: "size-icon-md" })
|
|
852
957
|
}),
|
|
853
|
-
|
|
958
|
+
_ === "video" && !!te && /* @__PURE__ */ R(T, {
|
|
854
959
|
tone: "secondary",
|
|
855
960
|
className: "media-library-card--duration absolute bottom-2 left-2 bg-inverse-background text-inverse-foreground",
|
|
856
|
-
children: [/* @__PURE__ */
|
|
961
|
+
children: [/* @__PURE__ */ L(V, { className: "size-icon-sm fill-current" }), te]
|
|
857
962
|
}),
|
|
858
|
-
|
|
963
|
+
w && /* @__PURE__ */ L(T, {
|
|
859
964
|
tone: "secondary",
|
|
860
965
|
className: "media-library-card--private absolute bottom-2 right-2 bg-card text-card-foreground",
|
|
861
|
-
children: /* @__PURE__ */
|
|
966
|
+
children: /* @__PURE__ */ L(_e, { className: "size-icon-sm" })
|
|
862
967
|
})
|
|
863
968
|
]
|
|
864
969
|
}),
|
|
865
|
-
/* @__PURE__ */
|
|
970
|
+
/* @__PURE__ */ L("div", {
|
|
866
971
|
className: r("media-library-card--body", n === "compact" ? "p-surface-xs" : "p-surface"),
|
|
867
|
-
children: /* @__PURE__ */
|
|
972
|
+
children: /* @__PURE__ */ R(c, {
|
|
868
973
|
columns: 1,
|
|
869
974
|
gap: "xs",
|
|
870
|
-
children: [/* @__PURE__ */
|
|
975
|
+
children: [/* @__PURE__ */ L(a, {
|
|
871
976
|
tag: "div",
|
|
872
977
|
type: "inherit",
|
|
873
978
|
weight: "semibold",
|
|
874
979
|
className: "truncate",
|
|
875
|
-
children:
|
|
876
|
-
}), o && /* @__PURE__ */
|
|
980
|
+
children: v
|
|
981
|
+
}), o && /* @__PURE__ */ R(l, {
|
|
877
982
|
direction: "horizontal",
|
|
878
983
|
align: "center",
|
|
879
984
|
justify: "between",
|
|
880
985
|
gap: "md",
|
|
881
986
|
className: "min-w-0",
|
|
882
|
-
children: [/* @__PURE__ */
|
|
883
|
-
value:
|
|
987
|
+
children: [/* @__PURE__ */ L(S, {
|
|
988
|
+
value: C,
|
|
884
989
|
size: "xs",
|
|
885
990
|
className: "truncate",
|
|
886
991
|
emptyLabel: d.unknownSize
|
|
887
|
-
}), !!
|
|
992
|
+
}), !!ee && /* @__PURE__ */ R(a, {
|
|
888
993
|
tag: "span",
|
|
889
994
|
size: "xs",
|
|
890
995
|
type: "secondary",
|
|
891
996
|
className: "inline-flex items-center gap-space-xs",
|
|
892
|
-
children: [/* @__PURE__ */
|
|
997
|
+
children: [/* @__PURE__ */ L(he, { className: "size-icon-sm" }), ee]
|
|
893
998
|
})]
|
|
894
999
|
})]
|
|
895
1000
|
})
|
|
@@ -897,128 +1002,163 @@ function X({ item: e, selected: t = !1, density: n = "comfortable", showMeta: o
|
|
|
897
1002
|
]
|
|
898
1003
|
});
|
|
899
1004
|
}
|
|
900
|
-
function
|
|
1005
|
+
function Ye({ items: e, selectedSet: t, accessors: n, strings: c, onToggle: l, onDetails: u, onOpen: d, selecting: f = !1 }) {
|
|
901
1006
|
let p = !!d && !f;
|
|
902
|
-
return /* @__PURE__ */
|
|
1007
|
+
return /* @__PURE__ */ R("div", {
|
|
903
1008
|
className: "media-library-list--component min-w-180",
|
|
904
|
-
children: [/* @__PURE__ */
|
|
1009
|
+
children: [/* @__PURE__ */ R("div", {
|
|
905
1010
|
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",
|
|
906
1011
|
children: [
|
|
907
|
-
/* @__PURE__ */
|
|
908
|
-
/* @__PURE__ */
|
|
909
|
-
/* @__PURE__ */
|
|
910
|
-
/* @__PURE__ */
|
|
911
|
-
/* @__PURE__ */
|
|
912
|
-
/* @__PURE__ */
|
|
913
|
-
/* @__PURE__ */
|
|
914
|
-
/* @__PURE__ */
|
|
1012
|
+
/* @__PURE__ */ L("span", {}),
|
|
1013
|
+
/* @__PURE__ */ L("span", {}),
|
|
1014
|
+
/* @__PURE__ */ L(o, { children: c.table.name }),
|
|
1015
|
+
/* @__PURE__ */ L(o, { children: c.table.type }),
|
|
1016
|
+
/* @__PURE__ */ L(o, { children: c.table.size }),
|
|
1017
|
+
/* @__PURE__ */ L(o, { children: c.table.collection }),
|
|
1018
|
+
/* @__PURE__ */ L(o, { children: c.table.used }),
|
|
1019
|
+
/* @__PURE__ */ L("span", {})
|
|
915
1020
|
]
|
|
916
1021
|
}), 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),
|
|
918
|
-
return /* @__PURE__ */
|
|
1022
|
+
let o = n.getId(e), f = t.has(o), m = n.getType(e), h = n.getName(e), g = n.getSrc(e), _ = n.getPublic(e) === !1;
|
|
1023
|
+
return /* @__PURE__ */ R("div", {
|
|
919
1024
|
"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 ${
|
|
1025
|
+
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 ${b.rowHover}`, f && b.rowSelected),
|
|
921
1026
|
onClick: () => p && d ? d(o) : l(o),
|
|
922
1027
|
children: [
|
|
923
|
-
/* @__PURE__ */
|
|
1028
|
+
/* @__PURE__ */ L("button", {
|
|
924
1029
|
type: "button",
|
|
925
1030
|
"aria-label": h,
|
|
926
1031
|
"aria-pressed": p ? void 0 : f,
|
|
927
|
-
className: r("media-library-list--select rounded-radius",
|
|
1032
|
+
className: r("media-library-list--select rounded-radius", He),
|
|
928
1033
|
onClick: (e) => {
|
|
929
1034
|
e.stopPropagation(), p && d ? d(o) : l(o);
|
|
930
1035
|
}
|
|
931
1036
|
}),
|
|
932
|
-
p ? /* @__PURE__ */
|
|
1037
|
+
p ? /* @__PURE__ */ L("button", {
|
|
933
1038
|
type: "button",
|
|
934
|
-
"aria-label":
|
|
1039
|
+
"aria-label": U(c.selectItem, { name: h }),
|
|
935
1040
|
"aria-pressed": f,
|
|
936
1041
|
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
1042
|
onClick: (e) => {
|
|
938
1043
|
e.stopPropagation(), l(o);
|
|
939
1044
|
},
|
|
940
|
-
children: /* @__PURE__ */
|
|
941
|
-
}) : /* @__PURE__ */
|
|
1045
|
+
children: /* @__PURE__ */ L(ue, { className: "size-icon-sm" })
|
|
1046
|
+
}) : /* @__PURE__ */ L("span", {
|
|
942
1047
|
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
1048
|
"aria-hidden": "true",
|
|
944
|
-
children: /* @__PURE__ */
|
|
1049
|
+
children: /* @__PURE__ */ L(ue, { className: "size-icon-sm" })
|
|
945
1050
|
}),
|
|
946
|
-
/* @__PURE__ */
|
|
1051
|
+
/* @__PURE__ */ L(Ge, {
|
|
947
1052
|
tint: n.getTint(e),
|
|
948
1053
|
className: "size-9 rounded-radius",
|
|
949
|
-
children: g ? /* @__PURE__ */
|
|
1054
|
+
children: g ? /* @__PURE__ */ L("img", {
|
|
950
1055
|
src: g,
|
|
951
1056
|
alt: "",
|
|
952
1057
|
loading: "lazy",
|
|
953
1058
|
className: "size-full object-cover"
|
|
954
|
-
}) : /* @__PURE__ */
|
|
1059
|
+
}) : /* @__PURE__ */ L("div", {
|
|
955
1060
|
className: "flex size-full items-center justify-center text-muted-foreground",
|
|
956
|
-
children:
|
|
1061
|
+
children: We(m, "size-icon")
|
|
957
1062
|
})
|
|
958
1063
|
}),
|
|
959
|
-
/* @__PURE__ */
|
|
1064
|
+
/* @__PURE__ */ R(a, {
|
|
960
1065
|
tag: "div",
|
|
961
1066
|
type: "inherit",
|
|
962
1067
|
weight: "semibold",
|
|
963
1068
|
className: "flex min-w-0 items-center gap-space-xs truncate",
|
|
964
|
-
children: [h,
|
|
1069
|
+
children: [h, _ && /* @__PURE__ */ L(_e, { className: "size-icon-sm shrink-0 text-muted-foreground" })]
|
|
965
1070
|
}),
|
|
966
|
-
/* @__PURE__ */
|
|
1071
|
+
/* @__PURE__ */ L(T, {
|
|
967
1072
|
tone: "secondary",
|
|
968
1073
|
children: G(m, c)
|
|
969
1074
|
}),
|
|
970
|
-
/* @__PURE__ */
|
|
1075
|
+
/* @__PURE__ */ L(S, {
|
|
971
1076
|
value: n.getSize(e),
|
|
972
1077
|
size: "xs",
|
|
973
1078
|
emptyLabel: c.unknownSize
|
|
974
1079
|
}),
|
|
975
|
-
/* @__PURE__ */
|
|
1080
|
+
/* @__PURE__ */ L(a, {
|
|
976
1081
|
size: "xs",
|
|
977
1082
|
type: "secondary",
|
|
978
1083
|
className: "truncate",
|
|
979
1084
|
children: n.getCollection(e) || "—"
|
|
980
1085
|
}),
|
|
981
|
-
/* @__PURE__ */
|
|
1086
|
+
/* @__PURE__ */ L(a, {
|
|
982
1087
|
size: "xs",
|
|
983
1088
|
type: "secondary",
|
|
984
1089
|
children: n.getUsageCount(e) ? n.getUsageCount(e) : "—"
|
|
985
1090
|
}),
|
|
986
|
-
/* @__PURE__ */
|
|
1091
|
+
/* @__PURE__ */ L(i, {
|
|
987
1092
|
type: "button",
|
|
988
1093
|
tone: "secondary",
|
|
989
1094
|
buttonStyle: "ghost",
|
|
990
1095
|
size: "sm",
|
|
991
1096
|
iconOnly: !0,
|
|
992
1097
|
className: "relative z-10",
|
|
993
|
-
"aria-label":
|
|
1098
|
+
"aria-label": U(c.cardDetails, { name: h }),
|
|
994
1099
|
onClick: (e) => {
|
|
995
1100
|
e.stopPropagation(), u(o);
|
|
996
1101
|
},
|
|
997
|
-
children: /* @__PURE__ */
|
|
1102
|
+
children: /* @__PURE__ */ L(me, { className: "size-icon-md" })
|
|
998
1103
|
})
|
|
999
1104
|
]
|
|
1000
1105
|
}, o);
|
|
1001
1106
|
})]
|
|
1002
1107
|
});
|
|
1003
1108
|
}
|
|
1004
|
-
function
|
|
1109
|
+
function J({ label: e, tags: t, placeholder: n, readOnly: r = !1, onValueChange: i }) {
|
|
1110
|
+
let a = t.join(", "), [o, s] = I({
|
|
1111
|
+
source: a,
|
|
1112
|
+
value: a
|
|
1113
|
+
});
|
|
1114
|
+
o.source !== a && s({
|
|
1115
|
+
source: a,
|
|
1116
|
+
value: a
|
|
1117
|
+
});
|
|
1118
|
+
let c = () => {
|
|
1119
|
+
if (r || o.value === a) return;
|
|
1120
|
+
let e = o.value.split(",").map((e) => e.trim()).filter(Boolean);
|
|
1121
|
+
s({
|
|
1122
|
+
source: a,
|
|
1123
|
+
value: a
|
|
1124
|
+
}), (e.length !== t.length || e.some((e, n) => e !== t[n])) && i(e);
|
|
1125
|
+
};
|
|
1126
|
+
return /* @__PURE__ */ L(D, {
|
|
1127
|
+
label: e,
|
|
1128
|
+
children: /* @__PURE__ */ L(E, {
|
|
1129
|
+
value: o.value,
|
|
1130
|
+
placeholder: n,
|
|
1131
|
+
readOnly: r,
|
|
1132
|
+
onChange: (e) => s({
|
|
1133
|
+
source: a,
|
|
1134
|
+
value: e.target.value
|
|
1135
|
+
}),
|
|
1136
|
+
onBlur: c,
|
|
1137
|
+
onKeyDown: (e) => {
|
|
1138
|
+
r || e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(), c());
|
|
1139
|
+
}
|
|
1140
|
+
})
|
|
1141
|
+
});
|
|
1142
|
+
}
|
|
1143
|
+
function Xe({ item: e, collections: t = [], accessors: n, strings: o, onClose: s, onUpdate: c, readOnly: d = !1, mutationError: p, onRemove: m, allowDelete: h = !0, onReplace: g, renderDetail: v }) {
|
|
1005
1144
|
if (!e) return null;
|
|
1006
|
-
let
|
|
1145
|
+
let y = n.getName(e), b = n.getType(e), x = n.getSrc(e), ee = n.getCollection(e) ?? t[0]?.value ?? "", w = n.getTags(e), te = n.getPublic(e) ?? !0, k = d ? () => Promise.resolve(!1) : c, re = v?.(e, {
|
|
1007
1146
|
accessors: n,
|
|
1008
|
-
update:
|
|
1009
|
-
|
|
1010
|
-
|
|
1147
|
+
update: k,
|
|
1148
|
+
mutationError: p,
|
|
1149
|
+
remove: h ? m : () => Promise.resolve(!1),
|
|
1150
|
+
replace: g,
|
|
1011
1151
|
close: s
|
|
1012
1152
|
});
|
|
1013
|
-
return
|
|
1153
|
+
return re ? /* @__PURE__ */ L(ce, { children: re }) : /* @__PURE__ */ R("aside", {
|
|
1014
1154
|
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__ */
|
|
1155
|
+
children: [/* @__PURE__ */ L("div", {
|
|
1016
1156
|
className: "media-library-detail-panel--header border-b border-border p-surface",
|
|
1017
|
-
children: /* @__PURE__ */
|
|
1157
|
+
children: /* @__PURE__ */ R(l, {
|
|
1018
1158
|
direction: "horizontal",
|
|
1019
1159
|
align: "center",
|
|
1020
1160
|
gap: "md",
|
|
1021
|
-
children: [/* @__PURE__ */
|
|
1161
|
+
children: [/* @__PURE__ */ L(i, {
|
|
1022
1162
|
type: "button",
|
|
1023
1163
|
tone: "secondary",
|
|
1024
1164
|
buttonStyle: "ghost",
|
|
@@ -1027,35 +1167,35 @@ function We({ item: e, collections: t = [], accessors: n, strings: o, onClose: s
|
|
|
1027
1167
|
"aria-label": o.detail.close,
|
|
1028
1168
|
"data-media-detail-close": "",
|
|
1029
1169
|
onClick: s,
|
|
1030
|
-
children: /* @__PURE__ */
|
|
1031
|
-
}), /* @__PURE__ */
|
|
1170
|
+
children: /* @__PURE__ */ L(le, { className: "size-icon-md" })
|
|
1171
|
+
}), /* @__PURE__ */ L(a, {
|
|
1032
1172
|
weight: "semibold",
|
|
1033
1173
|
children: o.detail.title
|
|
1034
1174
|
})]
|
|
1035
1175
|
})
|
|
1036
|
-
}), /* @__PURE__ */
|
|
1176
|
+
}), /* @__PURE__ */ R("div", {
|
|
1037
1177
|
className: "media-library-detail-panel--body grid min-h-0 auto-rows-max gap-space-xl overflow-y-auto p-surface",
|
|
1038
1178
|
children: [
|
|
1039
|
-
/* @__PURE__ */
|
|
1179
|
+
/* @__PURE__ */ R(Ge, {
|
|
1040
1180
|
tint: n.getTint(e),
|
|
1041
1181
|
className: "aspect-[4/3] rounded-radius border border-border",
|
|
1042
|
-
children: [/* @__PURE__ */
|
|
1043
|
-
src:
|
|
1044
|
-
alt: n.getAlt(e) ||
|
|
1045
|
-
type:
|
|
1182
|
+
children: [/* @__PURE__ */ L(q, {
|
|
1183
|
+
src: x,
|
|
1184
|
+
alt: n.getAlt(e) || y,
|
|
1185
|
+
type: b,
|
|
1046
1186
|
className: "size-full object-cover"
|
|
1047
|
-
}),
|
|
1187
|
+
}), b === "video" && !!n.getDuration(e) && /* @__PURE__ */ R(T, {
|
|
1048
1188
|
className: "absolute bottom-2 right-2 bg-inverse-background text-inverse-foreground",
|
|
1049
|
-
children: [/* @__PURE__ */
|
|
1189
|
+
children: [/* @__PURE__ */ L(V, { className: "size-icon-sm fill-current" }), n.getDuration(e)]
|
|
1050
1190
|
})]
|
|
1051
1191
|
}),
|
|
1052
|
-
/* @__PURE__ */
|
|
1192
|
+
/* @__PURE__ */ L(a, {
|
|
1053
1193
|
tag: "div",
|
|
1054
1194
|
weight: "semibold",
|
|
1055
1195
|
className: "break-words",
|
|
1056
|
-
children:
|
|
1196
|
+
children: y
|
|
1057
1197
|
}),
|
|
1058
|
-
/* @__PURE__ */
|
|
1198
|
+
/* @__PURE__ */ L(ie, {
|
|
1059
1199
|
layout: "rows",
|
|
1060
1200
|
valueAlign: "end",
|
|
1061
1201
|
density: "compact",
|
|
@@ -1064,12 +1204,12 @@ function We({ item: e, collections: t = [], accessors: n, strings: o, onClose: s
|
|
|
1064
1204
|
{
|
|
1065
1205
|
id: "type",
|
|
1066
1206
|
label: o.detail.type,
|
|
1067
|
-
value: G(
|
|
1207
|
+
value: G(b, o)
|
|
1068
1208
|
},
|
|
1069
1209
|
{
|
|
1070
1210
|
id: "size",
|
|
1071
1211
|
label: o.detail.size,
|
|
1072
|
-
value: /* @__PURE__ */
|
|
1212
|
+
value: /* @__PURE__ */ L(S, {
|
|
1073
1213
|
value: n.getSize(e),
|
|
1074
1214
|
emptyLabel: o.unknownSize
|
|
1075
1215
|
})
|
|
@@ -1077,7 +1217,7 @@ function We({ item: e, collections: t = [], accessors: n, strings: o, onClose: s
|
|
|
1077
1217
|
{
|
|
1078
1218
|
id: "dimensions",
|
|
1079
1219
|
label: o.detail.dimensions,
|
|
1080
|
-
value: /* @__PURE__ */
|
|
1220
|
+
value: /* @__PURE__ */ L(C, {
|
|
1081
1221
|
width: n.getWidth(e),
|
|
1082
1222
|
height: n.getHeight(e),
|
|
1083
1223
|
emptyLabel: o.unknownSize
|
|
@@ -1095,68 +1235,74 @@ function We({ item: e, collections: t = [], accessors: n, strings: o, onClose: s
|
|
|
1095
1235
|
}
|
|
1096
1236
|
]
|
|
1097
1237
|
}),
|
|
1098
|
-
/* @__PURE__ */
|
|
1238
|
+
p && /* @__PURE__ */ L(f, {
|
|
1239
|
+
tone: "destructive",
|
|
1240
|
+
children: /* @__PURE__ */ L(u, { children: o.detail.mutationError ?? H.detail.mutationError })
|
|
1241
|
+
}),
|
|
1242
|
+
/* @__PURE__ */ L(D, {
|
|
1099
1243
|
label: o.detail.altText,
|
|
1100
|
-
children: /* @__PURE__ */
|
|
1244
|
+
children: /* @__PURE__ */ L(E, {
|
|
1101
1245
|
value: n.getAlt(e) ?? "",
|
|
1102
1246
|
placeholder: o.detail.altPlaceholder,
|
|
1103
|
-
|
|
1247
|
+
readOnly: d,
|
|
1248
|
+
onChange: (e) => k({ alt: e.target.value })
|
|
1104
1249
|
})
|
|
1105
1250
|
}),
|
|
1106
|
-
/* @__PURE__ */
|
|
1251
|
+
/* @__PURE__ */ L(D, {
|
|
1107
1252
|
label: o.detail.collection,
|
|
1108
|
-
children: /* @__PURE__ */
|
|
1109
|
-
value:
|
|
1253
|
+
children: /* @__PURE__ */ L(ne, {
|
|
1254
|
+
value: ee,
|
|
1110
1255
|
options: t.map((e) => ({
|
|
1111
1256
|
value: e.value,
|
|
1112
1257
|
label: String(e.label)
|
|
1113
1258
|
})),
|
|
1114
1259
|
"aria-label": o.detail.collection,
|
|
1115
|
-
|
|
1260
|
+
readOnly: d,
|
|
1261
|
+
onValueChange: (e) => k({ collection: e })
|
|
1116
1262
|
})
|
|
1117
1263
|
}),
|
|
1118
|
-
/* @__PURE__ */
|
|
1264
|
+
/* @__PURE__ */ L(J, {
|
|
1119
1265
|
label: o.detail.tags,
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
/* @__PURE__ */ F("div", {
|
|
1266
|
+
tags: w,
|
|
1267
|
+
placeholder: o.detail.tagsPlaceholder,
|
|
1268
|
+
readOnly: d,
|
|
1269
|
+
onValueChange: (e) => k({ tags: e })
|
|
1270
|
+
}, n.getId(e)),
|
|
1271
|
+
/* @__PURE__ */ L("div", {
|
|
1127
1272
|
className: "media-library-detail-panel--public",
|
|
1128
|
-
children: /* @__PURE__ */
|
|
1273
|
+
children: /* @__PURE__ */ R(l, {
|
|
1129
1274
|
direction: "horizontal",
|
|
1130
1275
|
align: "center",
|
|
1131
1276
|
justify: "between",
|
|
1132
1277
|
gap: "xl",
|
|
1133
|
-
children: [/* @__PURE__ */
|
|
1278
|
+
children: [/* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L(a, {
|
|
1134
1279
|
weight: "semibold",
|
|
1135
1280
|
children: o.detail.public
|
|
1136
|
-
}), /* @__PURE__ */
|
|
1281
|
+
}), /* @__PURE__ */ L(a, {
|
|
1137
1282
|
size: "xs",
|
|
1138
1283
|
type: "secondary",
|
|
1139
|
-
children:
|
|
1140
|
-
})] }), /* @__PURE__ */
|
|
1284
|
+
children: te ? o.detail.publicHint : o.detail.privateHint
|
|
1285
|
+
})] }), /* @__PURE__ */ L(O, {
|
|
1141
1286
|
"aria-label": o.detail.public,
|
|
1142
|
-
checked:
|
|
1143
|
-
|
|
1287
|
+
checked: te,
|
|
1288
|
+
readOnly: d,
|
|
1289
|
+
onValueChange: (e) => k({ public: e })
|
|
1144
1290
|
})]
|
|
1145
1291
|
})
|
|
1146
1292
|
}),
|
|
1147
|
-
/* @__PURE__ */
|
|
1148
|
-
className: r("media-library-detail-panel--actions flex flex-wrap",
|
|
1149
|
-
children: [
|
|
1293
|
+
(g || h) && /* @__PURE__ */ R("div", {
|
|
1294
|
+
className: r("media-library-detail-panel--actions flex flex-wrap", _.commands),
|
|
1295
|
+
children: [g && /* @__PURE__ */ L(i, {
|
|
1150
1296
|
type: "button",
|
|
1151
1297
|
tone: "secondary",
|
|
1152
1298
|
buttonStyle: "outline",
|
|
1153
|
-
onClick:
|
|
1299
|
+
onClick: g,
|
|
1154
1300
|
children: o.detail.replace
|
|
1155
|
-
}), /* @__PURE__ */
|
|
1301
|
+
}), h && /* @__PURE__ */ L(i, {
|
|
1156
1302
|
type: "button",
|
|
1157
1303
|
tone: "destructive",
|
|
1158
1304
|
buttonStyle: "ghost",
|
|
1159
|
-
onClick:
|
|
1305
|
+
onClick: m,
|
|
1160
1306
|
children: o.detail.delete
|
|
1161
1307
|
})]
|
|
1162
1308
|
})
|
|
@@ -1164,130 +1310,132 @@ function We({ item: e, collections: t = [], accessors: n, strings: o, onClose: s
|
|
|
1164
1310
|
})]
|
|
1165
1311
|
});
|
|
1166
1312
|
}
|
|
1167
|
-
function
|
|
1168
|
-
return /* @__PURE__ */
|
|
1313
|
+
function Ze({ stagedFiles: e, uploadOptions: t, collections: n = [], uploading: r = !1, hasUploadError: o = !1, strings: s, onFiles: c, onRemoveFile: d, onOptionsChange: p, empty: m }) {
|
|
1314
|
+
return /* @__PURE__ */ L("div", {
|
|
1169
1315
|
className: "media-library-upload-panel--component p-surface",
|
|
1170
|
-
children: /* @__PURE__ */
|
|
1316
|
+
children: /* @__PURE__ */ R(l, {
|
|
1171
1317
|
gap: "xl",
|
|
1172
1318
|
children: [
|
|
1173
|
-
/* @__PURE__ */
|
|
1174
|
-
onDrop:
|
|
1319
|
+
/* @__PURE__ */ L(j, {
|
|
1320
|
+
onDrop: c,
|
|
1175
1321
|
accept: "image/*,video/*",
|
|
1176
1322
|
multiple: !0,
|
|
1177
1323
|
size: "md",
|
|
1178
1324
|
strings: {
|
|
1179
|
-
instruction:
|
|
1180
|
-
helper:
|
|
1181
|
-
dragOver:
|
|
1325
|
+
instruction: s.upload.dropTitle,
|
|
1326
|
+
helper: s.upload.dropHint,
|
|
1327
|
+
dragOver: s.upload.dragOver
|
|
1182
1328
|
}
|
|
1183
1329
|
}),
|
|
1184
|
-
|
|
1330
|
+
o && /* @__PURE__ */ L(f, {
|
|
1331
|
+
tone: "destructive",
|
|
1332
|
+
children: /* @__PURE__ */ L(u, { children: s.upload.error ?? H.upload.error })
|
|
1333
|
+
}),
|
|
1334
|
+
e.length > 0 ? /* @__PURE__ */ L(l, {
|
|
1185
1335
|
gap: "md",
|
|
1186
1336
|
className: "media-library-upload-panel--staged",
|
|
1187
|
-
children: e.map((e) => /* @__PURE__ */
|
|
1337
|
+
children: e.map((e) => /* @__PURE__ */ R("div", {
|
|
1188
1338
|
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
1339
|
children: [
|
|
1190
|
-
/* @__PURE__ */
|
|
1340
|
+
/* @__PURE__ */ L(Ge, {
|
|
1191
1341
|
className: "size-10 rounded-radius",
|
|
1192
|
-
children: e.src ? /* @__PURE__ */
|
|
1342
|
+
children: e.src ? /* @__PURE__ */ L("img", {
|
|
1193
1343
|
src: e.src,
|
|
1194
1344
|
alt: e.name,
|
|
1195
1345
|
className: "size-full object-cover"
|
|
1196
|
-
}) : /* @__PURE__ */
|
|
1346
|
+
}) : /* @__PURE__ */ L("div", {
|
|
1197
1347
|
className: "flex size-full items-center justify-center text-muted-foreground",
|
|
1198
|
-
children:
|
|
1348
|
+
children: We(e.type, "size-icon")
|
|
1199
1349
|
})
|
|
1200
1350
|
}),
|
|
1201
|
-
/* @__PURE__ */
|
|
1351
|
+
/* @__PURE__ */ R(l, {
|
|
1202
1352
|
gap: "md",
|
|
1203
1353
|
className: "min-w-0 flex-1",
|
|
1204
1354
|
children: [
|
|
1205
|
-
/* @__PURE__ */
|
|
1355
|
+
/* @__PURE__ */ R("div", {
|
|
1206
1356
|
className: "flex items-baseline gap-space-lg",
|
|
1207
|
-
children: [/* @__PURE__ */
|
|
1357
|
+
children: [/* @__PURE__ */ L(a, {
|
|
1208
1358
|
type: "inherit",
|
|
1209
1359
|
weight: "semibold",
|
|
1210
1360
|
className: "truncate",
|
|
1211
1361
|
children: e.name
|
|
1212
|
-
}), /* @__PURE__ */
|
|
1362
|
+
}), /* @__PURE__ */ L(S, {
|
|
1213
1363
|
value: e.size,
|
|
1214
1364
|
size: "xs",
|
|
1215
1365
|
className: "ml-auto shrink-0"
|
|
1216
1366
|
})]
|
|
1217
1367
|
}),
|
|
1218
|
-
(e.status === "uploading" || e.status === "done") && /* @__PURE__ */
|
|
1368
|
+
(e.status === "uploading" || e.status === "done") && /* @__PURE__ */ L(h, {
|
|
1219
1369
|
value: e.progress,
|
|
1220
1370
|
size: "sm",
|
|
1221
1371
|
"aria-label": e.name
|
|
1222
1372
|
}),
|
|
1223
|
-
e.status === "error" && /* @__PURE__ */
|
|
1373
|
+
e.status === "error" && /* @__PURE__ */ L(a, {
|
|
1224
1374
|
type: "error",
|
|
1225
1375
|
children: e.error
|
|
1226
1376
|
})
|
|
1227
1377
|
]
|
|
1228
1378
|
}),
|
|
1229
|
-
e.status === "done" ? /* @__PURE__ */
|
|
1379
|
+
e.status === "done" ? /* @__PURE__ */ L(T, {
|
|
1230
1380
|
tone: "success",
|
|
1231
|
-
children:
|
|
1232
|
-
}) : e.status === "uploading" ? /* @__PURE__ */
|
|
1381
|
+
children: s.upload.done
|
|
1382
|
+
}) : e.status === "uploading" ? /* @__PURE__ */ L(ee, {
|
|
1233
1383
|
value: Math.round(e.progress),
|
|
1234
1384
|
scaled: !0,
|
|
1235
1385
|
size: "xs",
|
|
1236
1386
|
type: "secondary"
|
|
1237
|
-
}) : /* @__PURE__ */
|
|
1387
|
+
}) : /* @__PURE__ */ L(i, {
|
|
1238
1388
|
type: "button",
|
|
1239
1389
|
tone: "secondary",
|
|
1240
1390
|
buttonStyle: "ghost",
|
|
1241
1391
|
size: "sm",
|
|
1242
1392
|
iconOnly: !0,
|
|
1243
1393
|
disabled: r,
|
|
1244
|
-
"aria-label":
|
|
1245
|
-
onClick: () =>
|
|
1246
|
-
children: /* @__PURE__ */
|
|
1394
|
+
"aria-label": U(s.upload.removeFile, { name: e.name }),
|
|
1395
|
+
onClick: () => d(e.id),
|
|
1396
|
+
children: /* @__PURE__ */ L(we, { className: "size-icon-md" })
|
|
1247
1397
|
})
|
|
1248
1398
|
]
|
|
1249
1399
|
}, e.id))
|
|
1250
|
-
}) :
|
|
1251
|
-
/* @__PURE__ */
|
|
1400
|
+
}) : m,
|
|
1401
|
+
/* @__PURE__ */ R("div", {
|
|
1252
1402
|
className: "media-library-upload-panel--options grid gap-space-lg @2xl/media-library:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto]",
|
|
1253
1403
|
children: [
|
|
1254
|
-
/* @__PURE__ */
|
|
1255
|
-
label:
|
|
1256
|
-
children: /* @__PURE__ */
|
|
1404
|
+
/* @__PURE__ */ L(D, {
|
|
1405
|
+
label: s.upload.collection,
|
|
1406
|
+
children: /* @__PURE__ */ L(ne, {
|
|
1257
1407
|
value: t.collection ?? n[0]?.value,
|
|
1258
1408
|
options: n.map((e) => ({
|
|
1259
1409
|
value: e.value,
|
|
1260
1410
|
label: String(e.label)
|
|
1261
1411
|
})),
|
|
1262
|
-
"aria-label":
|
|
1263
|
-
onValueChange: (e) =>
|
|
1412
|
+
"aria-label": s.upload.collection,
|
|
1413
|
+
onValueChange: (e) => p({ collection: e })
|
|
1264
1414
|
})
|
|
1265
1415
|
}),
|
|
1266
|
-
/* @__PURE__ */
|
|
1267
|
-
label:
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
onChange: (e) => u({ tags: e.target.value.split(",").map((e) => e.trim()).filter(Boolean) })
|
|
1272
|
-
})
|
|
1416
|
+
/* @__PURE__ */ L(J, {
|
|
1417
|
+
label: s.upload.tags,
|
|
1418
|
+
tags: t.tags,
|
|
1419
|
+
placeholder: s.upload.tagsPlaceholder,
|
|
1420
|
+
onValueChange: (e) => p({ tags: e })
|
|
1273
1421
|
}),
|
|
1274
|
-
/* @__PURE__ */
|
|
1422
|
+
/* @__PURE__ */ R(l, {
|
|
1275
1423
|
direction: "horizontal",
|
|
1276
1424
|
align: "center",
|
|
1277
1425
|
justify: "between",
|
|
1278
1426
|
gap: "xl",
|
|
1279
1427
|
className: "@2xl/media-library:self-end",
|
|
1280
|
-
children: [/* @__PURE__ */
|
|
1428
|
+
children: [/* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L(a, {
|
|
1281
1429
|
weight: "semibold",
|
|
1282
|
-
children:
|
|
1283
|
-
}), /* @__PURE__ */
|
|
1430
|
+
children: s.upload.public
|
|
1431
|
+
}), /* @__PURE__ */ L(a, {
|
|
1284
1432
|
size: "xs",
|
|
1285
1433
|
type: "secondary",
|
|
1286
|
-
children:
|
|
1287
|
-
})] }), /* @__PURE__ */
|
|
1288
|
-
"aria-label":
|
|
1434
|
+
children: s.upload.publicHint
|
|
1435
|
+
})] }), /* @__PURE__ */ L(O, {
|
|
1436
|
+
"aria-label": s.upload.public,
|
|
1289
1437
|
checked: t.public,
|
|
1290
|
-
onValueChange: (e) =>
|
|
1438
|
+
onValueChange: (e) => p({ public: e })
|
|
1291
1439
|
})]
|
|
1292
1440
|
})
|
|
1293
1441
|
]
|
|
@@ -1296,35 +1444,35 @@ function Ge({ stagedFiles: e, uploadOptions: t, collections: n = [], uploading:
|
|
|
1296
1444
|
})
|
|
1297
1445
|
});
|
|
1298
1446
|
}
|
|
1299
|
-
function
|
|
1447
|
+
function Qe({ tab: e, selectedIds: t, selectionMode: n, stagedFiles: o, strings: s, onClearSelection: c, className: l }) {
|
|
1300
1448
|
let u = t.length, d = o.reduce((e, t) => e + t.size, 0), f = o.length, p = r("media-library-footer-summary--component flex min-w-0 items-center gap-space-lg", l);
|
|
1301
|
-
return e === "upload" ? /* @__PURE__ */
|
|
1449
|
+
return e === "upload" ? /* @__PURE__ */ L("div", {
|
|
1302
1450
|
className: p,
|
|
1303
1451
|
"aria-live": "polite",
|
|
1304
|
-
children: /* @__PURE__ */
|
|
1452
|
+
children: /* @__PURE__ */ L(a, {
|
|
1305
1453
|
size: "xs",
|
|
1306
1454
|
type: "secondary",
|
|
1307
1455
|
className: "truncate",
|
|
1308
|
-
children: f === 0 ? s.footer.noFiles :
|
|
1456
|
+
children: f === 0 ? s.footer.noFiles : U(s.footer.stagedSummary, {
|
|
1309
1457
|
count: f,
|
|
1310
|
-
size:
|
|
1458
|
+
size: x(d) ?? s.unknownSize
|
|
1311
1459
|
})
|
|
1312
1460
|
})
|
|
1313
|
-
}) : /* @__PURE__ */
|
|
1461
|
+
}) : /* @__PURE__ */ L("div", {
|
|
1314
1462
|
className: p,
|
|
1315
1463
|
"aria-live": "polite",
|
|
1316
|
-
children: u > 0 ? /* @__PURE__ */
|
|
1464
|
+
children: u > 0 ? /* @__PURE__ */ R(ce, { children: [/* @__PURE__ */ L(a, {
|
|
1317
1465
|
weight: "semibold",
|
|
1318
1466
|
className: "whitespace-nowrap",
|
|
1319
|
-
children:
|
|
1320
|
-
}), /* @__PURE__ */
|
|
1467
|
+
children: U(s.footer.selectedCount, { count: u })
|
|
1468
|
+
}), /* @__PURE__ */ L(i, {
|
|
1321
1469
|
type: "button",
|
|
1322
1470
|
tone: "secondary",
|
|
1323
1471
|
buttonStyle: "ghost",
|
|
1324
1472
|
size: "sm",
|
|
1325
1473
|
onClick: c,
|
|
1326
1474
|
children: s.footer.clear
|
|
1327
|
-
})] }) : /* @__PURE__ */
|
|
1475
|
+
})] }) : /* @__PURE__ */ L(a, {
|
|
1328
1476
|
size: "xs",
|
|
1329
1477
|
type: "secondary",
|
|
1330
1478
|
className: "truncate",
|
|
@@ -1332,56 +1480,56 @@ function Ke({ tab: e, selectedIds: t, selectionMode: n, stagedFiles: o, strings:
|
|
|
1332
1480
|
})
|
|
1333
1481
|
});
|
|
1334
1482
|
}
|
|
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__ */
|
|
1483
|
+
function Y({ tab: e, selectedIds: t, stagedFiles: n, uploading: a = !1, strings: o, confirmLabel: s, cancelLabel: c, onCancel: l, onConfirm: u, onUpload: d, onCancelUpload: f, className: p }) {
|
|
1484
|
+
let m = t.length, h = n.length;
|
|
1485
|
+
return e === "upload" ? /* @__PURE__ */ R("div", {
|
|
1486
|
+
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),
|
|
1487
|
+
children: [/* @__PURE__ */ L(i, {
|
|
1340
1488
|
type: "button",
|
|
1341
1489
|
tone: "secondary",
|
|
1342
1490
|
buttonStyle: "ghost",
|
|
1343
|
-
disabled:
|
|
1344
|
-
onClick:
|
|
1345
|
-
children:
|
|
1346
|
-
}), /* @__PURE__ */
|
|
1491
|
+
disabled: a,
|
|
1492
|
+
onClick: f,
|
|
1493
|
+
children: c ?? o.footer.cancel
|
|
1494
|
+
}), /* @__PURE__ */ L(i, {
|
|
1347
1495
|
tone: "primary",
|
|
1348
1496
|
type: "button",
|
|
1349
|
-
disabled:
|
|
1350
|
-
onClick:
|
|
1351
|
-
loading:
|
|
1352
|
-
strings: { loading:
|
|
1353
|
-
children:
|
|
1497
|
+
disabled: h === 0 || a,
|
|
1498
|
+
onClick: d,
|
|
1499
|
+
loading: a,
|
|
1500
|
+
strings: { loading: o.footer.uploading },
|
|
1501
|
+
children: h <= 1 ? o.footer.upload : U(o.footer.uploadMany, { count: h })
|
|
1354
1502
|
})]
|
|
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__ */
|
|
1503
|
+
}) : /* @__PURE__ */ R("div", {
|
|
1504
|
+
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),
|
|
1505
|
+
children: [/* @__PURE__ */ L(i, {
|
|
1358
1506
|
type: "button",
|
|
1359
1507
|
tone: "secondary",
|
|
1360
1508
|
buttonStyle: "ghost",
|
|
1361
|
-
onClick:
|
|
1362
|
-
children:
|
|
1363
|
-
}), /* @__PURE__ */
|
|
1509
|
+
onClick: l,
|
|
1510
|
+
children: c ?? o.footer.cancel
|
|
1511
|
+
}), /* @__PURE__ */ L(i, {
|
|
1364
1512
|
tone: "primary",
|
|
1365
1513
|
type: "button",
|
|
1366
|
-
disabled:
|
|
1367
|
-
onClick:
|
|
1368
|
-
children:
|
|
1514
|
+
disabled: m === 0,
|
|
1515
|
+
onClick: u,
|
|
1516
|
+
children: s ?? (m === 0 ? o.footer.confirmEmpty : m === 1 ? o.footer.confirmOne : U(o.footer.confirmMany, { count: m }))
|
|
1369
1517
|
})]
|
|
1370
1518
|
});
|
|
1371
1519
|
}
|
|
1372
|
-
function
|
|
1373
|
-
return /* @__PURE__ */
|
|
1520
|
+
function $e({ tab: e, selectedItems: t, selectedIds: n, selectionMode: i, stagedFiles: a, uploading: o = !1, strings: s, confirmLabel: c, cancelLabel: l, onCancel: u, onConfirm: d, onClearSelection: f, onUpload: p, onCancelUpload: m, chrome: h = "section", className: g }) {
|
|
1521
|
+
return /* @__PURE__ */ L("footer", {
|
|
1374
1522
|
className: r("media-library-footer--component", h === "section" && "border-t border-border bg-background text-foreground p-surface", g),
|
|
1375
|
-
children: /* @__PURE__ */
|
|
1523
|
+
children: /* @__PURE__ */ R("div", {
|
|
1376
1524
|
className: "flex min-w-0 flex-col gap-space-lg @md/media-library:flex-row @md/media-library:justify-between",
|
|
1377
|
-
children: [/* @__PURE__ */
|
|
1525
|
+
children: [/* @__PURE__ */ L(Qe, {
|
|
1378
1526
|
tab: e,
|
|
1379
1527
|
selectedIds: n,
|
|
1380
1528
|
selectionMode: i,
|
|
1381
1529
|
stagedFiles: a,
|
|
1382
1530
|
strings: s,
|
|
1383
1531
|
onClearSelection: f
|
|
1384
|
-
}), /* @__PURE__ */
|
|
1532
|
+
}), /* @__PURE__ */ L(Y, {
|
|
1385
1533
|
tab: e,
|
|
1386
1534
|
selectedItems: t,
|
|
1387
1535
|
selectedIds: n,
|
|
@@ -1400,9 +1548,9 @@ function Z({ tab: e, selectedItems: t, selectedIds: n, selectionMode: i, stagedF
|
|
|
1400
1548
|
}
|
|
1401
1549
|
//#endregion
|
|
1402
1550
|
//#region src/components/features/media-library/media-library.tsx
|
|
1403
|
-
var
|
|
1404
|
-
function
|
|
1405
|
-
return
|
|
1551
|
+
var et = ae(null);
|
|
1552
|
+
function tt(e, t, n) {
|
|
1553
|
+
return P(() => {
|
|
1406
1554
|
if (e) return e;
|
|
1407
1555
|
let r = /* @__PURE__ */ new Set();
|
|
1408
1556
|
for (let e of t) {
|
|
@@ -1419,175 +1567,189 @@ function Ye(e, t, n) {
|
|
|
1419
1567
|
t
|
|
1420
1568
|
]);
|
|
1421
1569
|
}
|
|
1422
|
-
function
|
|
1423
|
-
let { defaultScale:
|
|
1570
|
+
function nt({ title: o, titleSuffix: c, description: u, confirmLabel: f, cancelLabel: h, selectionMode: g = "multiple", density: _ = "comfortable", showMeta: v = !0, allowUpload: x = !0, typeFilters: S, confirmOnSelect: C = !1, onConfirm: ee, onCancel: E, onClose: D, bulkActions: O, strings: ne, slots: A, heightClassName: ie, className: j, items: M, fetcher: ae, refreshKey: N, accessors: P, collections: ce, value: le, defaultValue: z, onValueChange: ue, onItemUpdate: B, onItemDelete: de, onItemReplace: pe, onItemOpen: me, onUpload: he, onError: ge, selecting: _e, defaultSelecting: V, onSelectingChange: ve, tab: ye, defaultTab: be, onTabChange: xe, view: Ce, defaultView: we, onViewChange: Ee, query: De, defaultQuery: Oe, onQueryChange: ke, type: Ae, defaultType: je, onTypeChange: Me, collection: Ne, defaultCollection: Pe, onCollectionChange: Fe, sort: Ie, defaultSort: Le, onSortChange: Re, uploadOptions: ze, defaultUploadOptions: Be, onUploadOptionsChange: He, ...Ue }) {
|
|
1571
|
+
let { defaultScale: W } = t(), We = e(void 0, W), G = n(H, ne), K = Ve({
|
|
1424
1572
|
items: M,
|
|
1425
|
-
fetcher:
|
|
1573
|
+
fetcher: ae,
|
|
1574
|
+
refreshKey: N,
|
|
1426
1575
|
accessors: P,
|
|
1427
|
-
collections:
|
|
1576
|
+
collections: ce,
|
|
1428
1577
|
selectionMode: g,
|
|
1429
|
-
value:
|
|
1430
|
-
defaultValue:
|
|
1431
|
-
onValueChange:
|
|
1432
|
-
onItemUpdate:
|
|
1433
|
-
onItemDelete:
|
|
1434
|
-
onUpload:
|
|
1435
|
-
onError:
|
|
1436
|
-
tab:
|
|
1437
|
-
defaultTab:
|
|
1438
|
-
onTabChange:
|
|
1439
|
-
view:
|
|
1440
|
-
defaultView:
|
|
1441
|
-
onViewChange:
|
|
1442
|
-
query:
|
|
1443
|
-
defaultQuery:
|
|
1444
|
-
onQueryChange:
|
|
1445
|
-
type:
|
|
1446
|
-
defaultType:
|
|
1447
|
-
onTypeChange:
|
|
1448
|
-
collection:
|
|
1449
|
-
defaultCollection:
|
|
1450
|
-
onCollectionChange:
|
|
1451
|
-
sort:
|
|
1452
|
-
defaultSort:
|
|
1453
|
-
onSortChange:
|
|
1454
|
-
uploadOptions:
|
|
1455
|
-
defaultUploadOptions:
|
|
1456
|
-
onUploadOptionsChange:
|
|
1457
|
-
selecting:
|
|
1458
|
-
defaultSelecting:
|
|
1459
|
-
onSelectingChange:
|
|
1460
|
-
}),
|
|
1461
|
-
tab:
|
|
1578
|
+
value: le,
|
|
1579
|
+
defaultValue: z,
|
|
1580
|
+
onValueChange: ue,
|
|
1581
|
+
onItemUpdate: B,
|
|
1582
|
+
onItemDelete: de,
|
|
1583
|
+
onUpload: he,
|
|
1584
|
+
onError: ge,
|
|
1585
|
+
tab: ye,
|
|
1586
|
+
defaultTab: be,
|
|
1587
|
+
onTabChange: xe,
|
|
1588
|
+
view: Ce,
|
|
1589
|
+
defaultView: we,
|
|
1590
|
+
onViewChange: Ee,
|
|
1591
|
+
query: De,
|
|
1592
|
+
defaultQuery: Oe,
|
|
1593
|
+
onQueryChange: ke,
|
|
1594
|
+
type: Ae,
|
|
1595
|
+
defaultType: je,
|
|
1596
|
+
onTypeChange: Me,
|
|
1597
|
+
collection: Ne,
|
|
1598
|
+
defaultCollection: Pe,
|
|
1599
|
+
onCollectionChange: Fe,
|
|
1600
|
+
sort: Ie,
|
|
1601
|
+
defaultSort: Le,
|
|
1602
|
+
onSortChange: Re,
|
|
1603
|
+
uploadOptions: ze,
|
|
1604
|
+
defaultUploadOptions: Be,
|
|
1605
|
+
onUploadOptionsChange: He,
|
|
1606
|
+
selecting: _e,
|
|
1607
|
+
defaultSelecting: V ?? C,
|
|
1608
|
+
onSelectingChange: ve
|
|
1609
|
+
}), Ge = tt(ce, K.items, K.accessors.getCollection), q = x ? K.tab : "library", [J, nt] = I(null), rt = F(null), it = J ? K.accessors.getId(J.item) : null, X = K.detailId ? K.items.find((e) => K.accessors.getId(e) === K.detailId) ?? (it === K.detailId ? J?.item ?? null : null) : null, at = K.mutationError?.operation === "delete" && K.mutationError.itemId === it, Z = oe(et), ot = !A?.footer, st = Z && ot ? /* @__PURE__ */ L(Qe, {
|
|
1610
|
+
tab: q,
|
|
1462
1611
|
selectedIds: K.selectedIds,
|
|
1463
1612
|
selectionMode: g,
|
|
1464
1613
|
stagedFiles: K.stagedFiles,
|
|
1465
1614
|
strings: G,
|
|
1466
1615
|
onClearSelection: K.clearSelection,
|
|
1467
1616
|
className: "media-library-dialog--selection-summary shrink-0 justify-end"
|
|
1468
|
-
}) : null,
|
|
1469
|
-
|
|
1470
|
-
},
|
|
1617
|
+
}) : null, ct = !!(o || c || u || A?.headerStart), lt = !!(x || A?.headerEnd || st), ut = ct || lt, dt = () => {
|
|
1618
|
+
ee?.(K.selectedItems, K.selectedIds), D?.();
|
|
1619
|
+
}, ft = () => {
|
|
1471
1620
|
E?.(), D?.();
|
|
1472
|
-
},
|
|
1621
|
+
}, pt = (e) => {
|
|
1473
1622
|
let t = K.accessors.getId(e);
|
|
1474
|
-
K.toggleSelection(t),
|
|
1475
|
-
},
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1623
|
+
K.toggleSelection(t), C && (ee?.([e], [t]), D?.());
|
|
1624
|
+
}, mt = F(null), ht = F(null), Q = F(null), gt = F(!1), _t = (e) => !de || rt.current ? Promise.resolve(!1) : new Promise((t) => {
|
|
1625
|
+
let n = {
|
|
1626
|
+
item: e,
|
|
1627
|
+
resolve: t
|
|
1628
|
+
};
|
|
1629
|
+
rt.current = n, nt(n);
|
|
1630
|
+
}), vt = (e) => {
|
|
1631
|
+
let t = rt.current;
|
|
1632
|
+
rt.current = null, nt(null), t?.resolve(e);
|
|
1633
|
+
};
|
|
1634
|
+
se(() => () => {
|
|
1635
|
+
rt.current?.resolve(!1), rt.current = null;
|
|
1636
|
+
}, []);
|
|
1637
|
+
let yt = (e) => {
|
|
1638
|
+
Q.current = document.activeElement instanceof HTMLElement ? document.activeElement : null, K.setDetailId(e);
|
|
1639
|
+
}, bt = (e) => {
|
|
1640
|
+
me ? me(e) : yt(K.accessors.getId(e));
|
|
1479
1641
|
};
|
|
1480
|
-
|
|
1642
|
+
se(() => {
|
|
1481
1643
|
if (K.detailId !== null) {
|
|
1482
|
-
|
|
1644
|
+
Q.current && mt.current?.querySelector("[data-media-detail-close]")?.focus();
|
|
1483
1645
|
return;
|
|
1484
1646
|
}
|
|
1485
|
-
let e =
|
|
1486
|
-
|
|
1647
|
+
let e = Q.current;
|
|
1648
|
+
Q.current = null, gt.current ? (gt.current = !1, ht.current?.focus()) : e?.isConnected && e.focus();
|
|
1487
1649
|
}, [K.detailId]);
|
|
1488
|
-
let
|
|
1650
|
+
let xt = !!ae && !K.loading && K.loadError != null, St = K.query.trim(), Ct = St.length > 0 ? U(G.countSearch, {
|
|
1489
1651
|
count: K.filteredCount,
|
|
1490
1652
|
total: K.totalCount,
|
|
1491
|
-
query:
|
|
1492
|
-
}) : K.filteredCount === K.totalCount ?
|
|
1653
|
+
query: St
|
|
1654
|
+
}) : K.filteredCount === K.totalCount ? U(G.countAll, { count: K.totalCount }) : U(G.countFiltered, {
|
|
1493
1655
|
count: K.filteredCount,
|
|
1494
1656
|
total: K.totalCount
|
|
1495
|
-
}),
|
|
1496
|
-
tab:
|
|
1657
|
+
}), $ = !!O && !(Z || ee && !C), wt = q === "library" ? K.selectedIds.length : 0, Tt = A?.footer ?? ($ && q === "library" ? null : Z ? /* @__PURE__ */ L(Y, {
|
|
1658
|
+
tab: q,
|
|
1497
1659
|
selectedItems: K.selectedItems,
|
|
1498
1660
|
selectedIds: K.selectedIds,
|
|
1499
1661
|
stagedFiles: K.stagedFiles,
|
|
1500
1662
|
uploading: K.uploading,
|
|
1501
1663
|
strings: G,
|
|
1502
|
-
confirmLabel:
|
|
1664
|
+
confirmLabel: f,
|
|
1503
1665
|
cancelLabel: h,
|
|
1504
|
-
onCancel:
|
|
1505
|
-
onConfirm:
|
|
1666
|
+
onCancel: ft,
|
|
1667
|
+
onConfirm: dt,
|
|
1506
1668
|
onUpload: K.startUpload,
|
|
1507
1669
|
onCancelUpload: () => {
|
|
1508
1670
|
K.cancelUpload(), K.clearStagedFiles(), K.setTab("library");
|
|
1509
1671
|
},
|
|
1510
1672
|
className: "ml-auto"
|
|
1511
|
-
}) : /* @__PURE__ */
|
|
1512
|
-
tab:
|
|
1673
|
+
}) : /* @__PURE__ */ L($e, {
|
|
1674
|
+
tab: q,
|
|
1513
1675
|
selectedItems: K.selectedItems,
|
|
1514
1676
|
selectedIds: K.selectedIds,
|
|
1515
1677
|
selectionMode: g,
|
|
1516
1678
|
stagedFiles: K.stagedFiles,
|
|
1517
1679
|
uploading: K.uploading,
|
|
1518
1680
|
strings: G,
|
|
1519
|
-
confirmLabel:
|
|
1681
|
+
confirmLabel: f,
|
|
1520
1682
|
cancelLabel: h,
|
|
1521
|
-
onCancel:
|
|
1522
|
-
onConfirm:
|
|
1683
|
+
onCancel: ft,
|
|
1684
|
+
onConfirm: dt,
|
|
1523
1685
|
onClearSelection: K.clearSelection,
|
|
1524
1686
|
onUpload: K.startUpload,
|
|
1525
1687
|
onCancelUpload: () => {
|
|
1526
1688
|
K.cancelUpload(), K.clearStagedFiles(), K.setTab("library");
|
|
1527
1689
|
}
|
|
1528
1690
|
}));
|
|
1529
|
-
return /* @__PURE__ */
|
|
1530
|
-
ref:
|
|
1531
|
-
className: 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",
|
|
1532
|
-
...
|
|
1691
|
+
return /* @__PURE__ */ R("section", {
|
|
1692
|
+
ref: mt,
|
|
1693
|
+
className: 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", ie ?? "h-190 max-h-[calc(100vh-7rem)]", j),
|
|
1694
|
+
...Ue,
|
|
1533
1695
|
children: [
|
|
1534
|
-
|
|
1696
|
+
ut && /* @__PURE__ */ R("header", {
|
|
1535
1697
|
className: "media-library--header flex flex-col gap-space-lg border-b border-border p-surface @2xl/media-library:flex-row @2xl/media-library:items-center @2xl/media-library:justify-between",
|
|
1536
|
-
children: [
|
|
1698
|
+
children: [ct && /* @__PURE__ */ R(l, {
|
|
1537
1699
|
direction: "horizontal",
|
|
1538
1700
|
align: "start",
|
|
1539
1701
|
gap: "lg",
|
|
1540
1702
|
className: "min-w-0",
|
|
1541
|
-
children: [A?.headerStart, (o || c ||
|
|
1703
|
+
children: [A?.headerStart, (o || c || u) && /* @__PURE__ */ R(l, {
|
|
1542
1704
|
gap: "normal",
|
|
1543
1705
|
className: "min-w-0",
|
|
1544
|
-
children: [!!(o || c) && /* @__PURE__ */
|
|
1706
|
+
children: [!!(o || c) && /* @__PURE__ */ L(d, {
|
|
1545
1707
|
title: o,
|
|
1546
1708
|
suffix: c,
|
|
1547
1709
|
className: "media-library--title"
|
|
1548
|
-
}), !!
|
|
1710
|
+
}), !!u && /* @__PURE__ */ L(a, {
|
|
1549
1711
|
type: "secondary",
|
|
1550
|
-
children:
|
|
1712
|
+
children: u
|
|
1551
1713
|
})]
|
|
1552
1714
|
})]
|
|
1553
|
-
}),
|
|
1554
|
-
className: r("media-library--header-controls flex min-w-0 flex-wrap items-center gap-space-md",
|
|
1555
|
-
children: [/* @__PURE__ */
|
|
1715
|
+
}), lt && /* @__PURE__ */ R("div", {
|
|
1716
|
+
className: r("media-library--header-controls flex min-w-0 flex-wrap items-center gap-space-md", st ? "flex-1 justify-between" : "@2xl/media-library:justify-end"),
|
|
1717
|
+
children: [/* @__PURE__ */ R(l, {
|
|
1556
1718
|
direction: "horizontal",
|
|
1557
1719
|
wrap: !0,
|
|
1558
1720
|
align: "center",
|
|
1559
1721
|
gap: "md",
|
|
1560
1722
|
className: "min-w-0",
|
|
1561
|
-
children: [
|
|
1562
|
-
className: r("media-library--tabs",
|
|
1723
|
+
children: [x && /* @__PURE__ */ R("div", {
|
|
1724
|
+
className: r("media-library--tabs", k.frame, re[We]),
|
|
1563
1725
|
role: "tablist",
|
|
1564
|
-
children: [/* @__PURE__ */
|
|
1726
|
+
children: [/* @__PURE__ */ R(i, {
|
|
1565
1727
|
type: "button",
|
|
1566
1728
|
role: "tab",
|
|
1567
|
-
"aria-selected":
|
|
1729
|
+
"aria-selected": q === "library",
|
|
1568
1730
|
tone: "secondary",
|
|
1569
1731
|
buttonStyle: "ghost",
|
|
1570
1732
|
size: "sm",
|
|
1571
|
-
className: r(
|
|
1733
|
+
className: r(k.item, "shadow-none", q === "library" ? `${b.segmentActive} hover:bg-card` : "text-muted-foreground hover:bg-transparent hover:text-foreground"),
|
|
1572
1734
|
onClick: () => K.setTab("library"),
|
|
1573
|
-
children: [/* @__PURE__ */
|
|
1574
|
-
}), /* @__PURE__ */
|
|
1735
|
+
children: [/* @__PURE__ */ L(fe, { className: "size-icon-md" }), G.tabs.library]
|
|
1736
|
+
}), /* @__PURE__ */ R(i, {
|
|
1575
1737
|
type: "button",
|
|
1576
1738
|
role: "tab",
|
|
1577
|
-
"aria-selected":
|
|
1739
|
+
"aria-selected": q === "upload",
|
|
1578
1740
|
tone: "secondary",
|
|
1579
1741
|
buttonStyle: "ghost",
|
|
1580
1742
|
size: "sm",
|
|
1581
|
-
className: r(
|
|
1743
|
+
className: r(k.item, "shadow-none", q === "upload" ? `${b.segmentActive} hover:bg-card` : "text-muted-foreground hover:bg-transparent hover:text-foreground"),
|
|
1582
1744
|
onClick: () => K.setTab("upload"),
|
|
1583
1745
|
children: [
|
|
1584
|
-
/* @__PURE__ */
|
|
1746
|
+
/* @__PURE__ */ L(Se, { className: "size-icon-md" }),
|
|
1585
1747
|
G.tabs.upload,
|
|
1586
|
-
K.stagedFiles.length > 0 && /* @__PURE__ */
|
|
1748
|
+
K.stagedFiles.length > 0 && /* @__PURE__ */ L(T, {
|
|
1587
1749
|
size: "sm",
|
|
1588
1750
|
tone: "secondary",
|
|
1589
1751
|
className: "media-library--staged-count",
|
|
1590
|
-
children: /* @__PURE__ */
|
|
1752
|
+
children: /* @__PURE__ */ L(w, {
|
|
1591
1753
|
value: K.stagedFiles.length,
|
|
1592
1754
|
size: "inherit",
|
|
1593
1755
|
weight: "inherit",
|
|
@@ -1598,37 +1760,38 @@ function Q({ title: o, titleSuffix: c, description: p, confirmLabel: m, cancelLa
|
|
|
1598
1760
|
]
|
|
1599
1761
|
})]
|
|
1600
1762
|
}), A?.headerEnd]
|
|
1601
|
-
}),
|
|
1763
|
+
}), st]
|
|
1602
1764
|
})]
|
|
1603
1765
|
}),
|
|
1604
|
-
/* @__PURE__ */
|
|
1766
|
+
/* @__PURE__ */ R("div", {
|
|
1605
1767
|
className: "media-library--body flex min-h-0 flex-1",
|
|
1606
|
-
children: [
|
|
1768
|
+
children: [q === "upload" ? /* @__PURE__ */ L("div", {
|
|
1607
1769
|
className: "min-w-0 flex-1 overflow-y-auto",
|
|
1608
|
-
children: /* @__PURE__ */
|
|
1770
|
+
children: /* @__PURE__ */ L(Ze, {
|
|
1609
1771
|
stagedFiles: K.stagedFiles,
|
|
1610
1772
|
uploadOptions: K.uploadOptions,
|
|
1611
|
-
collections:
|
|
1773
|
+
collections: Ge,
|
|
1612
1774
|
uploading: K.uploading,
|
|
1775
|
+
hasUploadError: K.uploadError != null && K.stagedFiles.length > 0,
|
|
1613
1776
|
strings: G,
|
|
1614
1777
|
onFiles: K.addFiles,
|
|
1615
1778
|
onRemoveFile: K.removeStagedFile,
|
|
1616
1779
|
onOptionsChange: K.updateUploadOptions,
|
|
1617
1780
|
empty: A?.uploadEmpty
|
|
1618
1781
|
})
|
|
1619
|
-
}) : /* @__PURE__ */
|
|
1620
|
-
className: r("media-library--library min-w-0 flex-1 flex-col",
|
|
1621
|
-
children: [/* @__PURE__ */
|
|
1782
|
+
}) : /* @__PURE__ */ R("div", {
|
|
1783
|
+
className: r("media-library--library min-w-0 flex-1 flex-col", X ? "hidden @2xl/media-library:flex" : "flex"),
|
|
1784
|
+
children: [/* @__PURE__ */ L(l, {
|
|
1622
1785
|
gap: "md",
|
|
1623
1786
|
className: "media-library--toolbar border-b border-border/60 p-surface",
|
|
1624
|
-
children: /* @__PURE__ */
|
|
1787
|
+
children: /* @__PURE__ */ L(qe, {
|
|
1625
1788
|
query: K.query,
|
|
1626
1789
|
type: K.type,
|
|
1627
|
-
typeFilters:
|
|
1790
|
+
typeFilters: S,
|
|
1628
1791
|
collection: K.collection,
|
|
1629
1792
|
sort: K.sort,
|
|
1630
1793
|
view: K.view,
|
|
1631
|
-
collections:
|
|
1794
|
+
collections: Ge,
|
|
1632
1795
|
strings: G,
|
|
1633
1796
|
onQueryChange: K.setQuery,
|
|
1634
1797
|
onTypeChange: K.setType,
|
|
@@ -1639,59 +1802,60 @@ function Q({ title: o, titleSuffix: c, description: p, confirmLabel: m, cancelLa
|
|
|
1639
1802
|
toolbarEnd: A?.toolbarEnd,
|
|
1640
1803
|
selecting: K.selecting,
|
|
1641
1804
|
onSelectingChange: K.setSelecting,
|
|
1642
|
-
disabled:
|
|
1643
|
-
summary: /* @__PURE__ */
|
|
1805
|
+
disabled: xt,
|
|
1806
|
+
summary: /* @__PURE__ */ L("span", {
|
|
1644
1807
|
"aria-live": "polite",
|
|
1645
1808
|
className: "media-library--count min-w-0 truncate",
|
|
1646
|
-
children:
|
|
1809
|
+
children: xt || K.loading ? null : /* @__PURE__ */ L(a, {
|
|
1647
1810
|
tag: "span",
|
|
1648
1811
|
size: "xs",
|
|
1649
1812
|
type: "secondary",
|
|
1650
|
-
children:
|
|
1813
|
+
children: Ct
|
|
1651
1814
|
})
|
|
1652
1815
|
})
|
|
1653
1816
|
})
|
|
1654
|
-
}), /* @__PURE__ */
|
|
1655
|
-
ref:
|
|
1817
|
+
}), /* @__PURE__ */ L("div", {
|
|
1818
|
+
ref: ht,
|
|
1656
1819
|
role: "region",
|
|
1657
1820
|
"aria-label": G.resultsLabel,
|
|
1821
|
+
"aria-busy": K.loading || void 0,
|
|
1658
1822
|
tabIndex: 0,
|
|
1659
1823
|
className: `media-library--results flex min-h-0 flex-1 flex-col overflow-y-auto p-surface focus-visible:outline-none ${s.inset}`,
|
|
1660
|
-
children: K.loading ? /* @__PURE__ */
|
|
1824
|
+
children: K.loading && !K.hasLoadedResults ? /* @__PURE__ */ L("div", {
|
|
1661
1825
|
className: "media-library--state my-auto",
|
|
1662
|
-
children: A?.loading ?? /* @__PURE__ */
|
|
1826
|
+
children: A?.loading ?? /* @__PURE__ */ L(p, {
|
|
1663
1827
|
className: "min-h-64",
|
|
1664
1828
|
label: G.loading
|
|
1665
1829
|
})
|
|
1666
|
-
}) :
|
|
1830
|
+
}) : xt ? /* @__PURE__ */ L("div", {
|
|
1667
1831
|
className: "media-library--state my-auto",
|
|
1668
|
-
children: A?.error ?? /* @__PURE__ */
|
|
1832
|
+
children: A?.error ?? /* @__PURE__ */ L(m, {
|
|
1669
1833
|
title: G.errorTitle,
|
|
1670
1834
|
description: G.errorDescription,
|
|
1671
|
-
onRetry:
|
|
1672
|
-
retryLabel: G.retry ??
|
|
1835
|
+
onRetry: ae ? K.retry : void 0,
|
|
1836
|
+
retryLabel: G.retry ?? H.retry
|
|
1673
1837
|
})
|
|
1674
|
-
}) : K.visibleItems.length === 0 ? /* @__PURE__ */
|
|
1838
|
+
}) : K.visibleItems.length === 0 ? /* @__PURE__ */ L("div", {
|
|
1675
1839
|
className: "media-library--state my-auto",
|
|
1676
|
-
children: A?.empty ?? /* @__PURE__ */
|
|
1840
|
+
children: A?.empty ?? /* @__PURE__ */ L(Ke, {
|
|
1677
1841
|
title: K.hasFilters ? G.emptyFilteredTitle : G.emptyLibraryTitle,
|
|
1678
1842
|
description: K.hasFilters ? G.emptyFilteredDescription : G.emptyLibraryDescription,
|
|
1679
|
-
action: K.hasFilters ? /* @__PURE__ */
|
|
1843
|
+
action: K.hasFilters ? /* @__PURE__ */ L(i, {
|
|
1680
1844
|
type: "button",
|
|
1681
1845
|
tone: "secondary",
|
|
1682
1846
|
buttonStyle: "outline",
|
|
1683
1847
|
onClick: K.clearFilters,
|
|
1684
1848
|
children: G.clearFilters
|
|
1685
|
-
}) :
|
|
1849
|
+
}) : x ? /* @__PURE__ */ L(i, {
|
|
1686
1850
|
tone: "primary",
|
|
1687
1851
|
type: "button",
|
|
1688
1852
|
onClick: () => K.setTab("upload"),
|
|
1689
1853
|
children: G.uploadMedia
|
|
1690
1854
|
}) : void 0
|
|
1691
1855
|
})
|
|
1692
|
-
}) : K.view === "table" ? /* @__PURE__ */
|
|
1856
|
+
}) : K.view === "table" ? /* @__PURE__ */ L("div", {
|
|
1693
1857
|
className: "overflow-x-auto",
|
|
1694
|
-
children: /* @__PURE__ */
|
|
1858
|
+
children: /* @__PURE__ */ L(Ye, {
|
|
1695
1859
|
items: K.visibleItems,
|
|
1696
1860
|
selectedSet: K.selectedSet,
|
|
1697
1861
|
selectionMode: g,
|
|
@@ -1699,17 +1863,17 @@ function Q({ title: o, titleSuffix: c, description: p, confirmLabel: m, cancelLa
|
|
|
1699
1863
|
strings: G,
|
|
1700
1864
|
onToggle: (e) => {
|
|
1701
1865
|
let t = K.items.find((t) => K.accessors.getId(t) === e);
|
|
1702
|
-
t &&
|
|
1866
|
+
t && pt(t);
|
|
1703
1867
|
},
|
|
1704
|
-
onDetails:
|
|
1868
|
+
onDetails: yt,
|
|
1705
1869
|
selecting: K.selecting,
|
|
1706
1870
|
onOpen: (e) => {
|
|
1707
1871
|
let t = K.items.find((t) => K.accessors.getId(t) === e);
|
|
1708
|
-
t &&
|
|
1872
|
+
t && bt(t);
|
|
1709
1873
|
}
|
|
1710
1874
|
})
|
|
1711
|
-
}) : /* @__PURE__ */
|
|
1712
|
-
className: r("media-library--grid grid min-w-0 gap-space-lg",
|
|
1875
|
+
}) : /* @__PURE__ */ L("div", {
|
|
1876
|
+
className: r("media-library--grid grid min-w-0 gap-space-lg", _ === "compact" ? "grid-cols-[repeat(auto-fill,minmax(136px,1fr))]" : "grid-cols-[repeat(auto-fill,minmax(168px,1fr))]"),
|
|
1713
1877
|
children: K.visibleItems.map((e) => {
|
|
1714
1878
|
let t = K.accessors.getId(e), n = {
|
|
1715
1879
|
id: t,
|
|
@@ -1717,15 +1881,15 @@ function Q({ title: o, titleSuffix: c, description: p, confirmLabel: m, cancelLa
|
|
|
1717
1881
|
selectionMode: g,
|
|
1718
1882
|
selecting: K.selecting,
|
|
1719
1883
|
accessors: K.accessors,
|
|
1720
|
-
toggle: () =>
|
|
1721
|
-
openDetails: () =>
|
|
1722
|
-
open: () =>
|
|
1884
|
+
toggle: () => pt(e),
|
|
1885
|
+
openDetails: () => yt(t),
|
|
1886
|
+
open: () => bt(e)
|
|
1723
1887
|
}, r = A?.renderItem?.(e, n);
|
|
1724
|
-
return r ? /* @__PURE__ */
|
|
1888
|
+
return r ? /* @__PURE__ */ L("div", { children: r }, t) : /* @__PURE__ */ L(Je, {
|
|
1725
1889
|
item: e,
|
|
1726
1890
|
selected: n.selected,
|
|
1727
|
-
density:
|
|
1728
|
-
showMeta:
|
|
1891
|
+
density: _,
|
|
1892
|
+
showMeta: v,
|
|
1729
1893
|
selectionMode: g,
|
|
1730
1894
|
accessors: K.accessors,
|
|
1731
1895
|
strings: G,
|
|
@@ -1737,36 +1901,50 @@ function Q({ title: o, titleSuffix: c, description: p, confirmLabel: m, cancelLa
|
|
|
1737
1901
|
})
|
|
1738
1902
|
})
|
|
1739
1903
|
})]
|
|
1740
|
-
}),
|
|
1741
|
-
item:
|
|
1742
|
-
collections:
|
|
1904
|
+
}), q === "library" && /* @__PURE__ */ L(Xe, {
|
|
1905
|
+
item: X,
|
|
1906
|
+
collections: Ge,
|
|
1743
1907
|
accessors: K.accessors,
|
|
1744
1908
|
strings: G,
|
|
1745
1909
|
onClose: () => K.setDetailId(null),
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
},
|
|
1910
|
+
readOnly: !B,
|
|
1911
|
+
onUpdate: (e) => X ? K.updateItem(X, e) : Promise.resolve(!1),
|
|
1912
|
+
mutationError: K.mutationError?.itemId === K.detailId ? K.mutationError : null,
|
|
1913
|
+
onReplace: pe && X ? () => pe(X) : void 0,
|
|
1914
|
+
allowDelete: !!de,
|
|
1915
|
+
onRemove: () => X ? _t(X) : Promise.resolve(!1),
|
|
1753
1916
|
renderDetail: A?.renderDetail
|
|
1754
1917
|
})]
|
|
1755
1918
|
}),
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1919
|
+
Z ? Z.element ? Te(Tt, Z.element) : null : Tt,
|
|
1920
|
+
(de || J) && /* @__PURE__ */ L(y, {
|
|
1921
|
+
open: J !== null,
|
|
1922
|
+
onOpenChange: (e) => {
|
|
1923
|
+
e || vt(!1);
|
|
1924
|
+
},
|
|
1925
|
+
destructive: !0,
|
|
1926
|
+
title: G.detail.confirmDeleteTitle ?? H.detail.confirmDeleteTitle,
|
|
1927
|
+
description: J ? U(G.detail.confirmDeleteDescription ?? H.detail.confirmDeleteDescription ?? "", { name: K.accessors.getName(J.item) }) : void 0,
|
|
1928
|
+
strings: { confirm: G.detail.confirmDeleteLabel ?? H.detail.confirmDeleteLabel },
|
|
1929
|
+
alertMessage: at ? G.detail.confirmDeleteError ?? H.detail.confirmDeleteError : void 0,
|
|
1930
|
+
closeOnAsyncComplete: !1,
|
|
1931
|
+
onAsyncConfirm: async () => {
|
|
1932
|
+
J && await K.removeItem(J.item) && rt.current === J && (gt.current = !0, K.setDetailId(null), vt(!0));
|
|
1933
|
+
}
|
|
1934
|
+
}),
|
|
1935
|
+
$ && /* @__PURE__ */ L(te, {
|
|
1936
|
+
selectedCount: wt,
|
|
1759
1937
|
totalCount: K.totalCount,
|
|
1760
1938
|
onClear: K.clearSelection,
|
|
1761
|
-
returnFocusRef:
|
|
1939
|
+
returnFocusRef: ht,
|
|
1762
1940
|
className: "media-library--bulk-actions",
|
|
1763
1941
|
strings: {
|
|
1764
1942
|
label: G.batchActionsLabel,
|
|
1765
|
-
summary: (e) =>
|
|
1943
|
+
summary: (e) => U(G.footer.selectedCount, { count: e }),
|
|
1766
1944
|
clear: G.footer.clear
|
|
1767
1945
|
},
|
|
1768
|
-
children:
|
|
1769
|
-
selectedItems: K.
|
|
1946
|
+
children: wt > 0 && O?.({
|
|
1947
|
+
selectedItems: K.items.filter((e) => K.selectedSet.has(K.accessors.getId(e))),
|
|
1770
1948
|
selectedIds: K.selectedIds,
|
|
1771
1949
|
selectedCount: K.selectedIds.length,
|
|
1772
1950
|
visibleCount: K.filteredCount,
|
|
@@ -1777,15 +1955,15 @@ function Q({ title: o, titleSuffix: c, description: p, confirmLabel: m, cancelLa
|
|
|
1777
1955
|
]
|
|
1778
1956
|
});
|
|
1779
1957
|
}
|
|
1780
|
-
function
|
|
1781
|
-
let m = n(
|
|
1782
|
-
b ||
|
|
1958
|
+
function rt({ 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 }) {
|
|
1959
|
+
let m = n(H, p.strings), [h, g] = I(!1), [_, y] = I(null), b = e !== void 0, x = b ? e : h, S = (e) => {
|
|
1960
|
+
b || g(e), t?.(e);
|
|
1783
1961
|
}, C = () => {
|
|
1784
1962
|
S(!1), s?.();
|
|
1785
1963
|
};
|
|
1786
|
-
return /* @__PURE__ */
|
|
1787
|
-
value: { element:
|
|
1788
|
-
children: /* @__PURE__ */
|
|
1964
|
+
return /* @__PURE__ */ L(et.Provider, {
|
|
1965
|
+
value: { element: _ },
|
|
1966
|
+
children: /* @__PURE__ */ L(v, {
|
|
1789
1967
|
open: x,
|
|
1790
1968
|
onOpenChange: S,
|
|
1791
1969
|
onClose: s,
|
|
@@ -1795,7 +1973,7 @@ function Xe({ open: e, onOpenChange: t, trigger: i, dialogTitle: a, dialogDescri
|
|
|
1795
1973
|
size: "full",
|
|
1796
1974
|
showCancel: !1,
|
|
1797
1975
|
showConfirm: !1,
|
|
1798
|
-
footer: /* @__PURE__ */
|
|
1976
|
+
footer: /* @__PURE__ */ L("div", {
|
|
1799
1977
|
ref: y,
|
|
1800
1978
|
className: "media-library-dialog--footer @container/media-library w-full"
|
|
1801
1979
|
}),
|
|
@@ -1803,7 +1981,7 @@ function Xe({ open: e, onOpenChange: t, trigger: i, dialogTitle: a, dialogDescri
|
|
|
1803
1981
|
contentClassName: r("media-library-dialog--body flex min-h-0 flex-col overflow-hidden p-0", u),
|
|
1804
1982
|
closeOnBackdropClick: f,
|
|
1805
1983
|
closeOnEscape: d,
|
|
1806
|
-
children: /* @__PURE__ */
|
|
1984
|
+
children: /* @__PURE__ */ L(nt, {
|
|
1807
1985
|
...p,
|
|
1808
1986
|
defaultSelecting: p.defaultSelecting ?? !0,
|
|
1809
1987
|
onClose: C,
|
|
@@ -1816,45 +1994,45 @@ function Xe({ open: e, onOpenChange: t, trigger: i, dialogTitle: a, dialogDescri
|
|
|
1816
1994
|
}
|
|
1817
1995
|
//#endregion
|
|
1818
1996
|
//#region src/components/features/media-library/media-resource-gallery.tsx
|
|
1819
|
-
function
|
|
1997
|
+
function it(e, t, n) {
|
|
1820
1998
|
let r = e.slice(), [i] = r.splice(t, 1);
|
|
1821
1999
|
return i === void 0 || r.splice(n, 0, i), r;
|
|
1822
2000
|
}
|
|
1823
|
-
function
|
|
1824
|
-
let
|
|
2001
|
+
function X({ items: e, accessors: t, title: o, description: s, primaryId: c, onPrimaryChange: u, onRemove: d, onReorder: f, onAdd: p, maxItems: m, layout: h = "field", density: _ = "comfortable", readOnly: v = !1, empty: y, action: x, renderItem: C, strings: ee, className: w, ...te }) {
|
|
2002
|
+
let E = n(H, ee), D = Ae(t), O = e.length, ne = c ?? (O > 0 ? D.getId(e[0]) : void 0), k = !v && !!p && (m === void 0 || O < m), re = !v && !!u, ie = !v && !!d, j = !v && !!f, M = re || ie || j, ae = k && (h === "field" || O > 0) ? /* @__PURE__ */ L(i, {
|
|
1825
2003
|
type: "button",
|
|
1826
2004
|
tone: "secondary",
|
|
1827
2005
|
buttonStyle: "outline",
|
|
1828
|
-
icon:
|
|
2006
|
+
icon: ve,
|
|
1829
2007
|
onClick: p,
|
|
1830
|
-
children:
|
|
1831
|
-
}) :
|
|
2008
|
+
children: E.gallery.add
|
|
2009
|
+
}) : m !== void 0 && O >= m ? /* @__PURE__ */ L(T, {
|
|
1832
2010
|
tone: "secondary",
|
|
1833
|
-
children:
|
|
2011
|
+
children: E.gallery.maxReached
|
|
1834
2012
|
}) : null, N = (t, n) => {
|
|
1835
|
-
if (!
|
|
1836
|
-
let r =
|
|
1837
|
-
f?.(r.map((e) =>
|
|
1838
|
-
}, oe = !!(o || s ||
|
|
2013
|
+
if (!j || n < 0 || n >= O || t === n) return;
|
|
2014
|
+
let r = it(e, t, n);
|
|
2015
|
+
f?.(r.map((e) => D.getId(e)), r);
|
|
2016
|
+
}, oe = !!(o || s || x || ae), se = O === 0 && h !== "field", P = () => !k || h !== "field" ? null : /* @__PURE__ */ R("button", {
|
|
1839
2017
|
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":
|
|
2018
|
+
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 ${A.hover}`),
|
|
2019
|
+
"aria-label": E.gallery.addTile,
|
|
1842
2020
|
onClick: p,
|
|
1843
|
-
children: [/* @__PURE__ */
|
|
2021
|
+
children: [/* @__PURE__ */ L(ve, { className: "size-icon" }), /* @__PURE__ */ L(a, {
|
|
1844
2022
|
tag: "span",
|
|
1845
2023
|
size: "inherit",
|
|
1846
2024
|
className: "sr-only",
|
|
1847
|
-
children:
|
|
2025
|
+
children: E.gallery.addTile
|
|
1848
2026
|
})]
|
|
1849
2027
|
});
|
|
1850
|
-
return /* @__PURE__ */
|
|
1851
|
-
className: r("media-resource-gallery--component @container/media-resource-gallery rounded-surface border border-border bg-card text-card-foreground shadow-xs",
|
|
1852
|
-
"data-layout":
|
|
1853
|
-
"data-gallery-density":
|
|
1854
|
-
...
|
|
1855
|
-
children: [oe && /* @__PURE__ */
|
|
2028
|
+
return /* @__PURE__ */ R("section", {
|
|
2029
|
+
className: r("media-resource-gallery--component @container/media-resource-gallery rounded-surface border border-border bg-card text-card-foreground shadow-xs", w),
|
|
2030
|
+
"data-layout": h,
|
|
2031
|
+
"data-gallery-density": _,
|
|
2032
|
+
...te,
|
|
2033
|
+
children: [oe && /* @__PURE__ */ L("header", {
|
|
1856
2034
|
className: "media-resource-gallery--header p-surface",
|
|
1857
|
-
children: /* @__PURE__ */
|
|
2035
|
+
children: /* @__PURE__ */ R(l, {
|
|
1858
2036
|
direction: {
|
|
1859
2037
|
base: "vertical",
|
|
1860
2038
|
md: "horizontal"
|
|
@@ -1862,301 +2040,301 @@ function $({ items: e, accessors: t, title: o, description: s, primaryId: c, onP
|
|
|
1862
2040
|
gap: "lg",
|
|
1863
2041
|
align: { md: "start" },
|
|
1864
2042
|
justify: { md: "between" },
|
|
1865
|
-
children: [/* @__PURE__ */
|
|
2043
|
+
children: [/* @__PURE__ */ R(l, {
|
|
1866
2044
|
gap: "normal",
|
|
1867
2045
|
className: "min-w-0",
|
|
1868
|
-
children: [!!o && /* @__PURE__ */
|
|
2046
|
+
children: [!!o && /* @__PURE__ */ L(a, {
|
|
1869
2047
|
tag: "div",
|
|
1870
2048
|
type: "inherit",
|
|
1871
2049
|
weight: "semibold",
|
|
1872
2050
|
children: o
|
|
1873
|
-
}), !!s && /* @__PURE__ */
|
|
2051
|
+
}), !!s && /* @__PURE__ */ L(a, {
|
|
1874
2052
|
type: "secondary",
|
|
1875
2053
|
children: s
|
|
1876
2054
|
})]
|
|
1877
|
-
}), /* @__PURE__ */
|
|
2055
|
+
}), /* @__PURE__ */ L(l, {
|
|
1878
2056
|
direction: "horizontal",
|
|
1879
2057
|
wrap: !0,
|
|
1880
2058
|
align: "center",
|
|
1881
|
-
gap:
|
|
2059
|
+
gap: g.commands,
|
|
1882
2060
|
className: "media-resource-gallery--actions",
|
|
1883
|
-
children:
|
|
2061
|
+
children: x ?? ae
|
|
1884
2062
|
})]
|
|
1885
2063
|
})
|
|
1886
|
-
}),
|
|
2064
|
+
}), se ? /* @__PURE__ */ L("div", {
|
|
1887
2065
|
className: "media-resource-gallery--empty px-surface pb-surface",
|
|
1888
|
-
children:
|
|
1889
|
-
title:
|
|
1890
|
-
description:
|
|
1891
|
-
action:
|
|
2066
|
+
children: y ?? /* @__PURE__ */ L(Ke, {
|
|
2067
|
+
title: E.gallery.emptyTitle,
|
|
2068
|
+
description: E.gallery.emptyDescription,
|
|
2069
|
+
action: k ? /* @__PURE__ */ L(i, {
|
|
1892
2070
|
tone: "primary",
|
|
1893
2071
|
type: "button",
|
|
1894
|
-
icon:
|
|
2072
|
+
icon: pe,
|
|
1895
2073
|
onClick: p,
|
|
1896
|
-
children:
|
|
2074
|
+
children: E.gallery.add
|
|
1897
2075
|
}) : void 0
|
|
1898
2076
|
})
|
|
1899
|
-
}) : /* @__PURE__ */
|
|
1900
|
-
className: r("grid min-w-0 grid-cols-1",
|
|
2077
|
+
}) : /* @__PURE__ */ R("div", {
|
|
2078
|
+
className: r("grid min-w-0 grid-cols-1", h === "list" ? "gap-space-md" : "gap-space-lg", "media-resource-gallery--items p-surface", oe && "pt-0", h === "list" ? void 0 : h === "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
2079
|
children: [e.map((e, t) => {
|
|
1902
|
-
let n =
|
|
2080
|
+
let n = D.getId(e), o = D.getName(e), s = D.getType(e), c = D.getSrc(e), f = D.getAlt(e) || o, p = n === ne, m = D.getPublic(e) === !1, g = D.getDuration(e), v = j && t > 0, y = j && t < O - 1, x = C?.(e, {
|
|
1903
2081
|
id: n,
|
|
1904
2082
|
index: t,
|
|
1905
|
-
total:
|
|
2083
|
+
total: O,
|
|
1906
2084
|
primary: p,
|
|
1907
|
-
accessors:
|
|
1908
|
-
canMovePrevious:
|
|
1909
|
-
canMoveNext:
|
|
2085
|
+
accessors: D,
|
|
2086
|
+
canMovePrevious: v,
|
|
2087
|
+
canMoveNext: y,
|
|
1910
2088
|
setPrimary: () => {
|
|
1911
2089
|
re && u?.(n, e);
|
|
1912
2090
|
},
|
|
1913
2091
|
remove: () => {
|
|
1914
|
-
|
|
2092
|
+
ie && d?.(n, e);
|
|
1915
2093
|
},
|
|
1916
2094
|
movePrevious: () => N(t, t - 1),
|
|
1917
2095
|
moveNext: () => N(t, t + 1)
|
|
1918
2096
|
});
|
|
1919
|
-
return
|
|
1920
|
-
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 ${
|
|
2097
|
+
return x ? /* @__PURE__ */ L("div", { children: x }, n) : h === "field" ? /* @__PURE__ */ R("div", {
|
|
2098
|
+
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 ${b.tileHover}`, p && "col-span-2 row-span-2 min-h-52"),
|
|
1921
2099
|
"data-primary": p || void 0,
|
|
1922
2100
|
children: [
|
|
1923
|
-
c ? /* @__PURE__ */
|
|
2101
|
+
c ? /* @__PURE__ */ L("img", {
|
|
1924
2102
|
src: c,
|
|
1925
2103
|
alt: f,
|
|
1926
2104
|
loading: "lazy",
|
|
1927
2105
|
className: "size-full object-cover"
|
|
1928
|
-
}) : /* @__PURE__ */
|
|
2106
|
+
}) : /* @__PURE__ */ L("div", {
|
|
1929
2107
|
className: "flex size-full items-center justify-center bg-muted text-muted-foreground",
|
|
1930
|
-
children: /* @__PURE__ */
|
|
2108
|
+
children: /* @__PURE__ */ L(B, { className: p ? "size-7" : "size-icon-lg" })
|
|
1931
2109
|
}),
|
|
1932
|
-
p && /* @__PURE__ */
|
|
2110
|
+
p && /* @__PURE__ */ L(T, {
|
|
1933
2111
|
tone: "secondary",
|
|
1934
2112
|
className: "absolute left-2 top-2 bg-background shadow-xs",
|
|
1935
|
-
children:
|
|
2113
|
+
children: E.gallery.cover
|
|
1936
2114
|
}),
|
|
1937
|
-
s === "video" && !!
|
|
2115
|
+
s === "video" && !!g && /* @__PURE__ */ R(T, {
|
|
1938
2116
|
tone: "secondary",
|
|
1939
2117
|
className: "absolute bottom-2 left-2 bg-foreground text-background",
|
|
1940
|
-
children: [/* @__PURE__ */
|
|
2118
|
+
children: [/* @__PURE__ */ L(V, { className: "size-icon-sm fill-current" }), g]
|
|
1941
2119
|
}),
|
|
1942
|
-
m && /* @__PURE__ */
|
|
2120
|
+
m && /* @__PURE__ */ L("span", {
|
|
1943
2121
|
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",
|
|
1944
|
-
children: /* @__PURE__ */
|
|
2122
|
+
children: /* @__PURE__ */ L(_e, { className: "size-icon-sm" })
|
|
1945
2123
|
}),
|
|
1946
|
-
|
|
2124
|
+
ie && /* @__PURE__ */ L(i, {
|
|
1947
2125
|
type: "button",
|
|
1948
2126
|
tone: "secondary",
|
|
1949
2127
|
buttonStyle: "solid",
|
|
1950
2128
|
size: "sm",
|
|
1951
2129
|
iconOnly: !0,
|
|
1952
2130
|
className: "absolute right-2 top-2 opacity-0 shadow-sm transition-opacity group-hover/gallery:opacity-100 group-focus-within/gallery:opacity-100",
|
|
1953
|
-
"aria-label":
|
|
2131
|
+
"aria-label": E.gallery.remove,
|
|
1954
2132
|
onClick: () => d?.(n, e),
|
|
1955
|
-
children: /* @__PURE__ */
|
|
2133
|
+
children: /* @__PURE__ */ L(we, { className: "size-icon-md" })
|
|
1956
2134
|
})
|
|
1957
2135
|
]
|
|
1958
|
-
}, n) :
|
|
2136
|
+
}, n) : h === "list" ? /* @__PURE__ */ R(l, {
|
|
1959
2137
|
direction: "horizontal",
|
|
1960
2138
|
wrap: !0,
|
|
1961
2139
|
align: "center",
|
|
1962
2140
|
gap: "lg",
|
|
1963
|
-
className: r("media-resource-gallery--item min-w-0 rounded-radius border border-border bg-background text-foreground px-row-x",
|
|
2141
|
+
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
2142
|
"data-primary": p || void 0,
|
|
1965
2143
|
children: [
|
|
1966
|
-
/* @__PURE__ */
|
|
2144
|
+
/* @__PURE__ */ L("div", {
|
|
1967
2145
|
className: "relative size-12 shrink-0 overflow-hidden rounded-radius bg-muted",
|
|
1968
|
-
children: c ? /* @__PURE__ */
|
|
2146
|
+
children: c ? /* @__PURE__ */ L("img", {
|
|
1969
2147
|
src: c,
|
|
1970
2148
|
alt: f,
|
|
1971
2149
|
loading: "lazy",
|
|
1972
2150
|
className: "size-full object-cover"
|
|
1973
|
-
}) : /* @__PURE__ */
|
|
2151
|
+
}) : /* @__PURE__ */ L("div", {
|
|
1974
2152
|
className: "flex size-full items-center justify-center text-muted-foreground",
|
|
1975
|
-
children: /* @__PURE__ */
|
|
2153
|
+
children: /* @__PURE__ */ L(B, { className: "size-icon" })
|
|
1976
2154
|
})
|
|
1977
2155
|
}),
|
|
1978
|
-
/* @__PURE__ */
|
|
2156
|
+
/* @__PURE__ */ R("div", {
|
|
1979
2157
|
className: "min-w-0 flex-1",
|
|
1980
|
-
children: [/* @__PURE__ */
|
|
2158
|
+
children: [/* @__PURE__ */ R(l, {
|
|
1981
2159
|
direction: "horizontal",
|
|
1982
2160
|
wrap: !0,
|
|
1983
2161
|
align: "center",
|
|
1984
2162
|
gap: "md",
|
|
1985
2163
|
className: "min-w-0",
|
|
1986
|
-
children: [/* @__PURE__ */
|
|
2164
|
+
children: [/* @__PURE__ */ L(a, {
|
|
1987
2165
|
tag: "div",
|
|
1988
2166
|
weight: "semibold",
|
|
1989
2167
|
className: "min-w-0 break-all",
|
|
1990
2168
|
children: o
|
|
1991
|
-
}), p && /* @__PURE__ */
|
|
2169
|
+
}), p && /* @__PURE__ */ L(T, {
|
|
1992
2170
|
tone: "secondary",
|
|
1993
|
-
children:
|
|
2171
|
+
children: E.gallery.primary
|
|
1994
2172
|
})]
|
|
1995
|
-
}), /* @__PURE__ */
|
|
2173
|
+
}), /* @__PURE__ */ R(a, {
|
|
1996
2174
|
size: "xs",
|
|
1997
2175
|
type: "secondary",
|
|
1998
|
-
children: [
|
|
2176
|
+
children: [U(E.gallery.itemPosition, {
|
|
1999
2177
|
index: t + 1,
|
|
2000
|
-
total:
|
|
2001
|
-
}),
|
|
2002
|
-
value:
|
|
2178
|
+
total: O
|
|
2179
|
+
}), D.getSize(e) !== void 0 && /* @__PURE__ */ R(ce, { children: [" · ", /* @__PURE__ */ L(S, {
|
|
2180
|
+
value: D.getSize(e),
|
|
2003
2181
|
size: "xs",
|
|
2004
2182
|
align: "left",
|
|
2005
|
-
emptyLabel:
|
|
2183
|
+
emptyLabel: E.unknownSize
|
|
2006
2184
|
})] })]
|
|
2007
2185
|
})]
|
|
2008
2186
|
}),
|
|
2009
|
-
|
|
2187
|
+
M && /* @__PURE__ */ R("div", {
|
|
2010
2188
|
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
2189
|
children: [
|
|
2012
|
-
re && /* @__PURE__ */
|
|
2190
|
+
re && /* @__PURE__ */ L(i, {
|
|
2013
2191
|
type: "button",
|
|
2014
2192
|
tone: "secondary",
|
|
2015
2193
|
buttonStyle: "ghost",
|
|
2016
2194
|
size: "sm",
|
|
2017
2195
|
iconOnly: !0,
|
|
2018
2196
|
disabled: p,
|
|
2019
|
-
"aria-label":
|
|
2197
|
+
"aria-label": E.gallery.setPrimary,
|
|
2020
2198
|
onClick: () => u?.(n, e),
|
|
2021
|
-
children: /* @__PURE__ */
|
|
2199
|
+
children: /* @__PURE__ */ L(be, { className: "size-icon-md" })
|
|
2022
2200
|
}),
|
|
2023
|
-
|
|
2201
|
+
j && /* @__PURE__ */ L(i, {
|
|
2024
2202
|
type: "button",
|
|
2025
2203
|
tone: "secondary",
|
|
2026
2204
|
buttonStyle: "ghost",
|
|
2027
2205
|
size: "sm",
|
|
2028
2206
|
iconOnly: !0,
|
|
2029
|
-
disabled: !
|
|
2030
|
-
"aria-label":
|
|
2207
|
+
disabled: !v,
|
|
2208
|
+
"aria-label": E.gallery.movePrevious,
|
|
2031
2209
|
onClick: () => N(t, t - 1),
|
|
2032
|
-
children: /* @__PURE__ */
|
|
2210
|
+
children: /* @__PURE__ */ L(le, { className: "size-icon-md" })
|
|
2033
2211
|
}),
|
|
2034
|
-
|
|
2212
|
+
j && /* @__PURE__ */ L(i, {
|
|
2035
2213
|
type: "button",
|
|
2036
2214
|
tone: "secondary",
|
|
2037
2215
|
buttonStyle: "ghost",
|
|
2038
2216
|
size: "sm",
|
|
2039
2217
|
iconOnly: !0,
|
|
2040
|
-
disabled: !
|
|
2041
|
-
"aria-label":
|
|
2218
|
+
disabled: !y,
|
|
2219
|
+
"aria-label": E.gallery.moveNext,
|
|
2042
2220
|
onClick: () => N(t, t + 1),
|
|
2043
|
-
children: /* @__PURE__ */
|
|
2221
|
+
children: /* @__PURE__ */ L(z, { className: "size-icon-md" })
|
|
2044
2222
|
}),
|
|
2045
|
-
|
|
2223
|
+
ie && /* @__PURE__ */ L(i, {
|
|
2046
2224
|
type: "button",
|
|
2047
2225
|
tone: "destructive",
|
|
2048
2226
|
buttonStyle: "ghost",
|
|
2049
2227
|
size: "sm",
|
|
2050
2228
|
iconOnly: !0,
|
|
2051
|
-
"aria-label":
|
|
2229
|
+
"aria-label": E.gallery.remove,
|
|
2052
2230
|
onClick: () => d?.(n, e),
|
|
2053
|
-
children: /* @__PURE__ */
|
|
2231
|
+
children: /* @__PURE__ */ L(xe, { className: "size-icon-md" })
|
|
2054
2232
|
})
|
|
2055
2233
|
]
|
|
2056
2234
|
})
|
|
2057
2235
|
]
|
|
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 ${
|
|
2236
|
+
}, n) : /* @__PURE__ */ R("div", {
|
|
2237
|
+
className: `media-resource-gallery--item group/gallery overflow-hidden rounded-radius border border-border bg-background text-foreground shadow-xs transition-colors ${b.tileHover}`,
|
|
2060
2238
|
"data-primary": p || void 0,
|
|
2061
|
-
children: [/* @__PURE__ */
|
|
2239
|
+
children: [/* @__PURE__ */ R("div", {
|
|
2062
2240
|
className: "relative aspect-[4/3] bg-muted",
|
|
2063
|
-
children: [c ? /* @__PURE__ */
|
|
2241
|
+
children: [c ? /* @__PURE__ */ L("img", {
|
|
2064
2242
|
src: c,
|
|
2065
2243
|
alt: f,
|
|
2066
2244
|
loading: "lazy",
|
|
2067
2245
|
className: "size-full object-contain"
|
|
2068
|
-
}) : /* @__PURE__ */
|
|
2246
|
+
}) : /* @__PURE__ */ L("div", {
|
|
2069
2247
|
className: "flex size-full items-center justify-center text-muted-foreground",
|
|
2070
|
-
children: /* @__PURE__ */
|
|
2071
|
-
}), /* @__PURE__ */
|
|
2248
|
+
children: /* @__PURE__ */ L(B, { className: "size-6" })
|
|
2249
|
+
}), /* @__PURE__ */ R("div", {
|
|
2072
2250
|
className: "absolute left-2 top-2 flex flex-wrap gap-space-xs",
|
|
2073
|
-
children: [p && /* @__PURE__ */
|
|
2251
|
+
children: [p && /* @__PURE__ */ L(T, {
|
|
2074
2252
|
tone: "secondary",
|
|
2075
2253
|
className: "bg-card text-card-foreground",
|
|
2076
|
-
children:
|
|
2077
|
-
}), /* @__PURE__ */
|
|
2254
|
+
children: E.gallery.primary
|
|
2255
|
+
}), /* @__PURE__ */ L(T, {
|
|
2078
2256
|
tone: "secondary",
|
|
2079
2257
|
className: "bg-card text-card-foreground",
|
|
2080
|
-
children:
|
|
2258
|
+
children: U(E.gallery.itemPosition, {
|
|
2081
2259
|
index: t + 1,
|
|
2082
|
-
total:
|
|
2260
|
+
total: O
|
|
2083
2261
|
})
|
|
2084
2262
|
})]
|
|
2085
2263
|
})]
|
|
2086
|
-
}), /* @__PURE__ */
|
|
2087
|
-
className: r("media-resource-gallery--item-body",
|
|
2088
|
-
children: /* @__PURE__ */
|
|
2264
|
+
}), /* @__PURE__ */ L("div", {
|
|
2265
|
+
className: r("media-resource-gallery--item-body", _ === "compact" ? "p-surface-xs" : "p-surface"),
|
|
2266
|
+
children: /* @__PURE__ */ R(l, {
|
|
2089
2267
|
gap: "md",
|
|
2090
|
-
children: [/* @__PURE__ */
|
|
2268
|
+
children: [/* @__PURE__ */ R("div", {
|
|
2091
2269
|
className: "min-w-0",
|
|
2092
|
-
children: [/* @__PURE__ */
|
|
2270
|
+
children: [/* @__PURE__ */ L(a, {
|
|
2093
2271
|
tag: "div",
|
|
2094
2272
|
weight: "semibold",
|
|
2095
2273
|
className: "truncate",
|
|
2096
2274
|
children: o
|
|
2097
|
-
}),
|
|
2098
|
-
value:
|
|
2275
|
+
}), D.getSize(e) !== void 0 && /* @__PURE__ */ L(S, {
|
|
2276
|
+
value: D.getSize(e),
|
|
2099
2277
|
size: "xs",
|
|
2100
2278
|
align: "left",
|
|
2101
|
-
emptyLabel:
|
|
2279
|
+
emptyLabel: E.unknownSize
|
|
2102
2280
|
})]
|
|
2103
|
-
}),
|
|
2281
|
+
}), M && /* @__PURE__ */ R("div", {
|
|
2104
2282
|
className: "flex items-center gap-space-xs",
|
|
2105
2283
|
children: [
|
|
2106
|
-
re && /* @__PURE__ */
|
|
2284
|
+
re && /* @__PURE__ */ L(i, {
|
|
2107
2285
|
type: "button",
|
|
2108
2286
|
tone: "secondary",
|
|
2109
2287
|
buttonStyle: "ghost",
|
|
2110
2288
|
size: "sm",
|
|
2111
2289
|
iconOnly: !0,
|
|
2112
2290
|
disabled: p,
|
|
2113
|
-
"aria-label":
|
|
2291
|
+
"aria-label": E.gallery.setPrimary,
|
|
2114
2292
|
onClick: () => u?.(n, e),
|
|
2115
|
-
children: /* @__PURE__ */
|
|
2293
|
+
children: /* @__PURE__ */ L(be, { className: "size-icon-md" })
|
|
2116
2294
|
}),
|
|
2117
|
-
|
|
2295
|
+
j && /* @__PURE__ */ L(i, {
|
|
2118
2296
|
type: "button",
|
|
2119
2297
|
tone: "secondary",
|
|
2120
2298
|
buttonStyle: "ghost",
|
|
2121
2299
|
size: "sm",
|
|
2122
2300
|
iconOnly: !0,
|
|
2123
|
-
disabled: !
|
|
2124
|
-
"aria-label":
|
|
2301
|
+
disabled: !v,
|
|
2302
|
+
"aria-label": E.gallery.movePrevious,
|
|
2125
2303
|
onClick: () => N(t, t - 1),
|
|
2126
|
-
children: /* @__PURE__ */
|
|
2304
|
+
children: /* @__PURE__ */ L(le, { className: "size-icon-md" })
|
|
2127
2305
|
}),
|
|
2128
|
-
|
|
2306
|
+
j && /* @__PURE__ */ L(i, {
|
|
2129
2307
|
type: "button",
|
|
2130
2308
|
tone: "secondary",
|
|
2131
2309
|
buttonStyle: "ghost",
|
|
2132
2310
|
size: "sm",
|
|
2133
2311
|
iconOnly: !0,
|
|
2134
|
-
disabled: !
|
|
2135
|
-
"aria-label":
|
|
2312
|
+
disabled: !y,
|
|
2313
|
+
"aria-label": E.gallery.moveNext,
|
|
2136
2314
|
onClick: () => N(t, t + 1),
|
|
2137
|
-
children: /* @__PURE__ */
|
|
2315
|
+
children: /* @__PURE__ */ L(z, { className: "size-icon-md" })
|
|
2138
2316
|
}),
|
|
2139
|
-
|
|
2317
|
+
ie && /* @__PURE__ */ L(i, {
|
|
2140
2318
|
type: "button",
|
|
2141
2319
|
tone: "destructive",
|
|
2142
2320
|
buttonStyle: "ghost",
|
|
2143
2321
|
size: "sm",
|
|
2144
2322
|
iconOnly: !0,
|
|
2145
2323
|
className: "ml-auto",
|
|
2146
|
-
"aria-label":
|
|
2324
|
+
"aria-label": E.gallery.remove,
|
|
2147
2325
|
onClick: () => d?.(n, e),
|
|
2148
|
-
children: /* @__PURE__ */
|
|
2326
|
+
children: /* @__PURE__ */ L(xe, { className: "size-icon-md" })
|
|
2149
2327
|
})
|
|
2150
2328
|
]
|
|
2151
2329
|
})]
|
|
2152
2330
|
})
|
|
2153
2331
|
})]
|
|
2154
2332
|
}, n);
|
|
2155
|
-
}),
|
|
2333
|
+
}), P()]
|
|
2156
2334
|
})]
|
|
2157
2335
|
});
|
|
2158
2336
|
}
|
|
2159
2337
|
//#endregion
|
|
2160
|
-
export {
|
|
2338
|
+
export { nt as MediaLibrary, Je as MediaLibraryCard, Xe as MediaLibraryDetailPanel, rt as MediaLibraryDialog, Ke as MediaLibraryEmptyState, $e as MediaLibraryFooter, Ye as MediaLibraryList, qe as MediaLibraryToolbar, Ze as MediaLibraryUploadPanel, X as MediaResourceGallery, H as defaultMediaLibraryStrings, je as formatMediaLibrarySize, U as formatMediaLibraryString, Me as getMediaLibraryDimensions, Ae as resolveMediaLibraryAccessors, Ve as useMediaLibrary };
|
|
2161
2339
|
|
|
2162
2340
|
//# sourceMappingURL=media-library.js.map
|