themelia-react-ui 1.0.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +281 -1
- package/README.md +10 -5
- package/dist/{accordion-BRTcsp8J.js → accordion-CQXVcd7Q.js} +13 -13
- package/dist/accordion-CQXVcd7Q.js.map +1 -0
- package/dist/action-menu-BTpyPWJ2.js +264 -0
- package/dist/action-menu-BTpyPWJ2.js.map +1 -0
- package/dist/{affordance-geometry.generated-CL84ZN9A.js → affordance-geometry.generated-CCIXb2A1.js} +7 -2
- package/dist/affordance-geometry.generated-CCIXb2A1.js.map +1 -0
- package/dist/{ai-artifact-DLVdK0Py.js → ai-artifact-2PQ2fItc.js} +171 -176
- package/dist/ai-artifact-2PQ2fItc.js.map +1 -0
- package/dist/{app-shell-C_fKpljx.js → app-shell-BE_j8-AT.js} +4 -4
- package/dist/{app-shell-C_fKpljx.js.map → app-shell-BE_j8-AT.js.map} +1 -1
- package/dist/{attachment-DbjUWsP0.js → attachment-q69dlt5Y.js} +9 -9
- package/dist/{attachment-DbjUWsP0.js.map → attachment-q69dlt5Y.js.map} +1 -1
- package/dist/{auth-CAQcasMV.js → auth-M3vGMgDR.js} +42 -42
- package/dist/{auth-CAQcasMV.js.map → auth-M3vGMgDR.js.map} +1 -1
- package/dist/{avatar-Bu2HhitA.js → avatar-djdaaQ_s.js} +14 -12
- package/dist/avatar-djdaaQ_s.js.map +1 -0
- package/dist/{badge-CzId1Wlm.js → badge-0tATj-tW.js} +9 -9
- package/dist/badge-0tATj-tW.js.map +1 -0
- package/dist/base/accordion.js +1 -1
- package/dist/base/action-menu.js +1 -1
- package/dist/base/attachment.js +1 -1
- package/dist/base/avatar.js +1 -1
- package/dist/base/badge.js +1 -1
- package/dist/base/buttons.js +2 -2
- package/dist/base/cards.js +2 -2
- package/dist/base/carousel.js +11 -11
- package/dist/base/carousel.js.map +1 -1
- package/dist/base/cascader.js +244 -222
- package/dist/base/cascader.js.map +1 -1
- package/dist/base/chart.js +1 -1
- package/dist/base/choice-inputs.js +2 -2
- package/dist/base/code-block.js +1 -1
- package/dist/base/combobox.js +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 +3 -3
- package/dist/base/forms-numeric.js +1 -1
- package/dist/base/forms.js +2 -2
- package/dist/base/inline-edit.js +81 -76
- package/dist/base/inline-edit.js.map +1 -1
- package/dist/base/item.js +1 -1
- package/dist/base/media-gallery.js +1 -1
- package/dist/base/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 +7 -4
- package/dist/base/qr-code.js.map +1 -1
- package/dist/base/repeaters.js +42 -42
- package/dist/base/repeaters.js.map +1 -1
- package/dist/base/sheet.js +1 -1
- package/dist/base/sidebar.js +1 -1
- package/dist/base/signature-pad.js +9 -9
- package/dist/base/signature-pad.js.map +1 -1
- package/dist/base/skeleton.js +1 -1
- package/dist/base/spinner.js +1 -1
- package/dist/base/structure.js +1 -1
- package/dist/base/table.js +1 -1
- package/dist/base/text-inputs.js +2 -2
- package/dist/base/toaster.js +4 -4
- package/dist/base/toaster.js.map +1 -1
- package/dist/base/tree.js +1 -1
- package/dist/base/upload-queue.js +1 -1
- package/dist/base/upload.js +3 -3
- package/dist/base/value-inputs.js +1 -1
- package/dist/blocks/admin.js +229 -220
- package/dist/blocks/admin.js.map +1 -1
- package/dist/blocks/ai.js +147 -180
- package/dist/blocks/ai.js.map +1 -1
- package/dist/blocks/analytics/usage-card.js +1 -1
- package/dist/blocks/analytics.js +530 -523
- 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 +1390 -1516
- package/dist/blocks/commerce.js.map +1 -1
- package/dist/blocks/data-display.js +1 -1
- package/dist/blocks/onboarding.js +5 -5
- package/dist/blocks/planning.js +82 -91
- package/dist/blocks/planning.js.map +1 -1
- package/dist/blocks/timelines.js +1 -1
- package/dist/{breadcrumbs-BuYz5SDU.js → breadcrumbs-BG_FfMK4.js} +5 -5
- package/dist/{breadcrumbs-BuYz5SDU.js.map → breadcrumbs-BG_FfMK4.js.map} +1 -1
- package/dist/{button-BZDasD04.js → button-BS3KDg00.js} +185 -162
- package/dist/button-BS3KDg00.js.map +1 -0
- package/dist/{button-BZyfTvwm.js → button-R9CCoH7A.js} +2 -2
- package/dist/{button-BZyfTvwm.js.map → button-R9CCoH7A.js.map} +1 -1
- package/dist/{buttons-D_6KJvEE.js → buttons-DS0ZIwJ_.js} +11 -11
- package/dist/buttons-DS0ZIwJ_.js.map +1 -0
- package/dist/{cards-qGSErLw_.js → cards-QoJ4syG9.js} +7 -7
- package/dist/{cards-qGSErLw_.js.map → cards-QoJ4syG9.js.map} +1 -1
- package/dist/{chart-Bsc5BICK.js → chart-DwYRKKc-.js} +17 -15
- package/dist/chart-DwYRKKc-.js.map +1 -0
- package/dist/checkbox-B7ygNTYp.js +35 -0
- package/dist/checkbox-B7ygNTYp.js.map +1 -0
- package/dist/choice-inputs-DrJ17tpL.js +752 -0
- package/dist/choice-inputs-DrJ17tpL.js.map +1 -0
- package/dist/{code-block-DzHKRybS.js → code-block-CD0B7M93.js} +19 -19
- package/dist/{code-block-DzHKRybS.js.map → code-block-CD0B7M93.js.map} +1 -1
- package/dist/{collapsible-ClvC7Bj3.js → collapsible-oMUGM4tr.js} +3 -3
- package/dist/{collapsible-ClvC7Bj3.js.map → collapsible-oMUGM4tr.js.map} +1 -1
- package/dist/{collection-content-D6S8cv_n.js → collection-content-Ys-OZOkY.js} +3 -3
- package/dist/{collection-content-D6S8cv_n.js.map → collection-content-Ys-OZOkY.js.map} +1 -1
- package/dist/{combobox-BFnbJJp3.js → combobox-6dvVny2q.js} +96 -97
- package/dist/combobox-6dvVny2q.js.map +1 -0
- package/dist/{combobox-hozNwUcc.js → combobox-CB7039j7.js} +326 -308
- package/dist/combobox-CB7039j7.js.map +1 -0
- package/dist/{command-BnmSchli.js → command-kPMPjIxJ.js} +34 -30
- package/dist/command-kPMPjIxJ.js.map +1 -0
- package/dist/{comments-u5L0OGip.js → comments-You0Bzbr.js} +349 -348
- package/dist/comments-You0Bzbr.js.map +1 -0
- package/dist/components/base/accordion/accordion-variants.d.ts +3 -3
- package/dist/components/base/action-menu/action-menu.d.ts +7 -2
- package/dist/components/base/avatar/stacked-avatars.d.ts +5 -4
- package/dist/components/base/badge/badge.d.ts +1 -1
- package/dist/components/base/badge/badge.recipes.d.ts +4 -4
- package/dist/components/base/buttons/base-button.d.ts +7 -0
- package/dist/components/base/buttons/button-group.recipes.d.ts +2 -2
- package/dist/components/base/buttons/button.variants.d.ts +1 -0
- package/dist/components/base/buttons/loader-button.d.ts +3 -1
- package/dist/components/base/buttons/text-button.d.ts +2 -2
- package/dist/components/base/carousel/carousel.d.ts +3 -1
- package/dist/components/base/chart/chart.d.ts +7 -7
- package/dist/components/base/choice-inputs/checkbox.d.ts +6 -7
- package/dist/components/base/choice-inputs/choice-types.d.ts +10 -1
- package/dist/components/base/choice-inputs/pill-radio-group.d.ts +9 -0
- package/dist/components/base/choice-inputs/select-popup.d.ts +9 -1
- package/dist/components/base/choice-inputs/switch-card.d.ts +1 -1
- package/dist/components/base/date-pickers/date-picker-field.d.ts +23 -0
- package/dist/components/base/date-pickers/datepicker.types.d.ts +13 -3
- package/dist/components/base/display/alert-dialog.d.ts +8 -2
- package/dist/components/base/display/content-block.d.ts +4 -2
- package/dist/components/base/display/date-block.d.ts +1 -1
- package/dist/components/base/display/dialog.d.ts +12 -5
- package/dist/components/base/display/surface-title.d.ts +6 -1
- package/dist/components/base/feedback/alert.d.ts +1 -1
- package/dist/components/base/feedback/state-display.d.ts +5 -4
- package/dist/components/base/forms/form-sizing.d.ts +32 -0
- package/dist/components/base/forms/workflow.d.ts +2 -0
- package/dist/components/base/forms-numeric/coordinates-input.d.ts +3 -0
- package/dist/components/base/forms-numeric/rounding-mode-select.d.ts +4 -1
- package/dist/components/base/navigation/dropdown-menu.d.ts +2 -2
- package/dist/components/base/navigation/language-switcher.d.ts +4 -1
- package/dist/components/base/navigation/overflow-tab-bar.d.ts +7 -0
- package/dist/components/base/navigation/page-header/page-header.d.ts +4 -1
- package/dist/components/base/qr-code/qr-code.d.ts +2 -0
- package/dist/components/base/sheet/index.d.ts +29 -1
- package/dist/components/base/sheet/sheet.d.ts +14 -5
- package/dist/components/base/spinner/spinner.d.ts +3 -2
- package/dist/components/base/structure/structure.types.d.ts +1 -1
- package/dist/components/base/text-inputs/input-group.d.ts +2 -2
- package/dist/components/base/upload/upload.recipes.d.ts +11 -0
- package/dist/components/base/value-inputs/date-time-input.d.ts +4 -2
- package/dist/components/base/value-inputs/tags-input.d.ts +2 -0
- package/dist/components/blocks/admin/api-key-list/api-key-list.types.d.ts +1 -1
- package/dist/components/blocks/analytics/format-metric-value.d.ts +11 -1
- package/dist/components/blocks/analytics/index.d.ts +1 -1
- package/dist/components/blocks/analytics/use-metric-format-options.d.ts +3 -0
- package/dist/components/blocks/commerce/address-card/address-card.d.ts +1 -1
- package/dist/components/blocks/commerce/address-card/types.d.ts +3 -1
- package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.d.ts +4 -0
- package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.types.d.ts +2 -2
- package/dist/components/blocks/commerce/discount-stack/types.d.ts +1 -1
- package/dist/components/blocks/commerce/inventory-section/types.d.ts +4 -1
- package/dist/components/blocks/commerce/loyalty-points/types.d.ts +1 -1
- package/dist/components/blocks/commerce/order-status/types.d.ts +4 -0
- package/dist/components/blocks/commerce/payment-method/payment-method.d.ts +1 -1
- package/dist/components/blocks/commerce/payment-method/types.d.ts +3 -1
- package/dist/components/blocks/commerce/seo-listing/seo-listing-card.d.ts +1 -1
- package/dist/components/blocks/commerce/seo-listing/types.d.ts +3 -1
- package/dist/components/blocks/commerce/vendor-profile/types.d.ts +4 -1
- package/dist/components/blocks/data-display/dense-info-card/dense-info.strings.d.ts +4 -1
- package/dist/components/blocks/data-display/inline-stat/inline-stat.d.ts +4 -1
- package/dist/components/features/global-search/partials/global-search-idle-state.d.ts +1 -1
- package/dist/components/features/overlays/alert-dialog.d.ts +1 -1
- package/dist/components/features/overlays/drawer.d.ts +1 -1
- package/dist/components/features/overlays/hooks/use-overlay-actions.d.ts +2 -2
- package/dist/components/features/overlays/hooks/use-overlay-visibility.d.ts +11 -4
- package/dist/components/features/overlays/overlay-tone-icon.d.ts +37 -0
- package/dist/components/features/overlays/overlays.types.d.ts +42 -19
- package/dist/components/features/products/components/product-variants-manager.d.ts +1 -1
- package/dist/components/features/products/partials/index.d.ts +1 -1
- package/dist/components/features/products/partials/product-metric-tile.d.ts +6 -0
- package/dist/components/features/products/partials/product-tone.d.ts +11 -1
- package/dist/components/features/products/products.types.d.ts +2 -1
- package/dist/components/features/table/partials/cell-renderers.d.ts +1 -1
- package/dist/components/layout/page/index.d.ts +1 -1
- package/dist/components/layout/page/page.types.d.ts +53 -3
- package/dist/components/layout/page/partials/page-header-commands.d.ts +13 -0
- package/dist/components/layout/page/partials/page-header.d.ts +1 -1
- package/dist/components/primitives/date.d.ts +16 -3
- package/dist/components/primitives/dimensions.d.ts +6 -0
- package/dist/components/primitives/duration.d.ts +6 -0
- package/dist/components/primitives/file-size.d.ts +6 -0
- package/dist/components/primitives/index.d.ts +1 -1
- package/dist/components/primitives/initials.d.ts +11 -2
- package/dist/components/primitives/link.d.ts +7 -0
- package/dist/components/primitives/money.d.ts +29 -7
- package/dist/components/primitives/number.d.ts +17 -0
- package/dist/components/primitives/value-typography.d.ts +54 -0
- package/dist/components/primitives/value.d.ts +31 -6
- package/dist/components/typography/heading.d.ts +9 -1
- package/dist/components/typography/label.d.ts +3 -0
- package/dist/components/typography/running-text.d.ts +12 -0
- package/dist/components/typography/text-link.d.ts +23 -1
- package/dist/components/typography/text.d.ts +12 -0
- package/dist/components/typography/text.styles.d.ts +35 -13
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/checkbox.d.ts +5 -0
- package/dist/components/ui/overlay.recipes.d.ts +15 -2
- package/dist/components/ui/select.d.ts +3 -1
- package/dist/components/ui/switch.d.ts +5 -0
- package/dist/{containers-DqB-bSYE.js → containers-D_L4mTVb.js} +3 -3
- package/dist/{containers-DqB-bSYE.js.map → containers-D_L4mTVb.js.map} +1 -1
- package/dist/{copyable-BTSByfmq.js → copyable-DDjTeW_j.js} +4 -4
- package/dist/{copyable-BTSByfmq.js.map → copyable-DDjTeW_j.js.map} +1 -1
- package/dist/{data-display-Bihs9Ven.js → data-display-3xWQUnMA.js} +471 -478
- package/dist/data-display-3xWQUnMA.js.map +1 -0
- package/dist/date-picker-DrDFj8Lo.js +1527 -0
- package/dist/date-picker-DrDFj8Lo.js.map +1 -0
- package/dist/date-pickers-CnFCb0n2.js +174 -0
- package/dist/date-pickers-CnFCb0n2.js.map +1 -0
- package/dist/date-uf3z37Nm.js +144 -0
- package/dist/date-uf3z37Nm.js.map +1 -0
- package/dist/{display-CS6Hbk18.js → display-DrdvPwF0.js} +25 -25
- package/dist/display-DrdvPwF0.js.map +1 -0
- package/dist/{dropdown-menu-D-boNgGO.js → dropdown-menu-CURh59jb.js} +22 -15
- package/dist/dropdown-menu-CURh59jb.js.map +1 -0
- package/dist/features/activities.js +38 -35
- package/dist/features/activities.js.map +1 -1
- package/dist/features/ai-chat.js +36 -35
- package/dist/features/ai-chat.js.map +1 -1
- package/dist/features/async-preview.js +8 -8
- package/dist/features/combobox.js +1 -1
- package/dist/features/comments.js +1 -1
- package/dist/features/data-view.js +10 -10
- package/dist/features/email-composer.js +325 -326
- package/dist/features/email-composer.js.map +1 -1
- package/dist/features/event-calendar.js +190 -200
- package/dist/features/event-calendar.js.map +1 -1
- package/dist/features/filters.js +1 -1
- package/dist/features/global-search.js +77 -77
- package/dist/features/global-search.js.map +1 -1
- package/dist/features/kanban.js +4 -4
- package/dist/features/map.js +8 -8
- package/dist/features/media-library.js +499 -502
- package/dist/features/media-library.js.map +1 -1
- package/dist/features/mentions.js +1 -1
- package/dist/features/overlays.js +1 -1
- package/dist/features/products.js +1216 -1248
- package/dist/features/products.js.map +1 -1
- package/dist/features/questionnaire.js +46 -44
- package/dist/features/questionnaire.js.map +1 -1
- package/dist/features/resource-assignment.js +96 -88
- package/dist/features/resource-assignment.js.map +1 -1
- package/dist/features/resource.js +11 -11
- package/dist/features/rich-text-editor.js +2 -2
- package/dist/features/schema-form.js +188 -184
- package/dist/features/schema-form.js.map +1 -1
- package/dist/features/suggestions.js +3 -3
- package/dist/features/sync.js +7 -7
- package/dist/features/sync.js.map +1 -1
- package/dist/features/table.js +1 -1
- package/dist/features/theme-tweaker.js +469 -470
- package/dist/features/theme-tweaker.js.map +1 -1
- package/dist/{feedback-CJkUAapr.js → feedback-C7nR0UtT.js} +9 -10
- package/dist/feedback-C7nR0UtT.js.map +1 -0
- package/dist/field-affordance-recipes-CkOCdE2y.js +46 -0
- package/dist/field-affordance-recipes-CkOCdE2y.js.map +1 -0
- package/dist/{field-state-recipes-DQQpiLWC.js → field-state-recipes-C-MFBX_8.js} +3 -3
- package/dist/field-state-recipes-C-MFBX_8.js.map +1 -0
- package/dist/{filters-D6FF8L6s.js → filters-Da-gNPsE.js} +467 -467
- package/dist/filters-Da-gNPsE.js.map +1 -0
- package/dist/{form-field-CZwrkP7m.js → form-field-VZRULhUK.js} +7 -7
- package/dist/{form-field-CZwrkP7m.js.map → form-field-VZRULhUK.js.map} +1 -1
- package/dist/form-sizing-uWP4lzVh.js +126 -0
- package/dist/form-sizing-uWP4lzVh.js.map +1 -0
- package/dist/{forms-B5NCbkSC.js → forms-DDeEnXSY.js} +11 -11
- package/dist/forms-DDeEnXSY.js.map +1 -0
- package/dist/forms-numeric-D3CO60IF.js +905 -0
- package/dist/forms-numeric-D3CO60IF.js.map +1 -0
- package/dist/{header-kxruN3RM.js → header-2ycNqGOR.js} +43 -42
- package/dist/header-2ycNqGOR.js.map +1 -0
- package/dist/{hooks-BrlnCwQd.js → hooks-DQ5SPwZw.js} +2 -2
- package/dist/{hooks-BrlnCwQd.js.map → hooks-DQ5SPwZw.js.map} +1 -1
- package/dist/{icon-badge-Btc6pQrp.js → icon-badge-DKlaKXoo.js} +3 -3
- package/dist/{icon-badge-Btc6pQrp.js.map → icon-badge-DKlaKXoo.js.map} +1 -1
- package/dist/index.js +2 -2
- package/dist/{input-vxcaNCYC.js → input-BoLm9Hks.js} +3 -3
- package/dist/{input-vxcaNCYC.js.map → input-BoLm9Hks.js.map} +1 -1
- package/dist/input-DhQdBnV3.js +255 -0
- package/dist/{input-SX9V0AL3.js.map → input-DhQdBnV3.js.map} +1 -1
- package/dist/item-xzh8Df65.js +264 -0
- package/dist/item-xzh8Df65.js.map +1 -0
- package/dist/layout/app-shell.js +1 -1
- package/dist/layout/auth.js +1 -1
- package/dist/layout/containers.js +1 -1
- package/dist/layout/header.js +1 -1
- package/dist/layout/hooks.js +1 -1
- package/dist/layout/navigation.js +1 -1
- package/dist/layout/page.js +1 -1
- package/dist/layout/settings.js +1 -1
- package/dist/layout/sidebar.js +2 -2
- package/dist/layout/workspace.js +1 -1
- package/dist/layout.js +10 -10
- package/dist/lib/affordance-geometry.generated.d.ts +6 -1
- package/dist/lib/field-affordance-recipes.d.ts +35 -0
- package/dist/lib/field-state-recipes.d.ts +4 -2
- package/dist/lib/format.d.ts +9 -0
- package/dist/lib/money-format.d.ts +30 -0
- package/dist/lib/overlay-anatomy-recipes.d.ts +1 -1
- package/dist/lib/surface-recipes.d.ts +8 -6
- package/dist/lib/token-merge.generated.d.ts +11 -11
- package/dist/lib/track-recipes.d.ts +1 -1
- package/dist/lib/ui-provider/provider.d.ts +7 -2
- package/dist/lib/ui-provider/store.d.ts +6 -2
- package/dist/lib/ui-provider/types.d.ts +5 -2
- package/dist/lib/utils.js +1 -1
- package/dist/{media-gallery-DLp3HAz0.js → media-gallery-DQUQ0m3O.js} +8 -8
- package/dist/media-gallery-DQUQ0m3O.js.map +1 -0
- package/dist/{mentions-Cl0Kt_Pd.js → mentions-DwnO1hh4.js} +34 -35
- package/dist/{mentions-Cl0Kt_Pd.js.map → mentions-DwnO1hh4.js.map} +1 -1
- package/dist/{message-SZUNB1eX.js → message-YfFmbXNP.js} +5 -5
- package/dist/{message-SZUNB1eX.js.map → message-YfFmbXNP.js.map} +1 -1
- package/dist/{navigation-DyytsLRB.js → navigation-Cbp5V8gG.js} +33 -34
- package/dist/navigation-Cbp5V8gG.js.map +1 -0
- package/dist/{navigation-DnQSNMT0.js → navigation-Cs1npsPm.js} +111 -87
- package/dist/navigation-Cs1npsPm.js.map +1 -0
- package/dist/{navigation-row-recipes-DQEXQcqY.js → navigation-row-recipes-DlU-4QYO.js} +2 -2
- package/dist/{navigation-row-recipes-DQEXQcqY.js.map → navigation-row-recipes-DlU-4QYO.js.map} +1 -1
- package/dist/number-CKRBYmZK.js +352 -0
- package/dist/number-CKRBYmZK.js.map +1 -0
- package/dist/overlay.recipes-CNO2S9V6.js +34 -0
- package/dist/overlay.recipes-CNO2S9V6.js.map +1 -0
- package/dist/overlays-DhZO7N-I.js +994 -0
- package/dist/overlays-DhZO7N-I.js.map +1 -0
- package/dist/page-C6R_8jFt.js +325 -0
- package/dist/page-C6R_8jFt.js.map +1 -0
- package/dist/{page-header-D8nERkn5.js → page-header-hUTzcRZX.js} +9 -9
- package/dist/page-header-hUTzcRZX.js.map +1 -0
- package/dist/{pagination-NLGqRirf.js → pagination-Cm0jqa3I.js} +8 -8
- package/dist/{pagination-NLGqRirf.js.map → pagination-Cm0jqa3I.js.map} +1 -1
- package/dist/{popover-CghIYdQf.js → popover-Dcv_9jxr.js} +6 -6
- package/dist/{popover-CghIYdQf.js.map → popover-Dcv_9jxr.js.map} +1 -1
- package/dist/{popover-menu-B4PoWhRl.js → popover-menu-DnRFKnHP.js} +6 -6
- package/dist/{popover-menu-B4PoWhRl.js.map → popover-menu-DnRFKnHP.js.map} +1 -1
- package/dist/{popover.recipes-QlD4JenO.js → popover.recipes-wmbvL8Ah.js} +2 -2
- package/dist/{popover.recipes-QlD4JenO.js.map → popover.recipes-wmbvL8Ah.js.map} +1 -1
- package/dist/primitives-BHrwQXFC.js +379 -0
- package/dist/primitives-BHrwQXFC.js.map +1 -0
- package/dist/primitives.js +5 -5
- package/dist/{progress-BroqrAyV.js → progress-Br9WTFya.js} +7 -7
- package/dist/progress-Br9WTFya.js.map +1 -0
- package/dist/{receipt-BuJynLgf.js → receipt-CV89q1fs.js} +6 -6
- package/dist/{receipt-BuJynLgf.js.map → receipt-CV89q1fs.js.map} +1 -1
- package/dist/{rich-text-editor-BKyG7rWz.js → rich-text-editor-CF8QYt5p.js} +6 -6
- package/dist/{rich-text-editor-BKyG7rWz.js.map → rich-text-editor-CF8QYt5p.js.map} +1 -1
- package/dist/{rich-text-editor.recipes-B72Nfuze.js → rich-text-editor.recipes-CnrbmTS1.js} +4 -4
- package/dist/{rich-text-editor.recipes-B72Nfuze.js.map → rich-text-editor.recipes-CnrbmTS1.js.map} +1 -1
- package/dist/{rich-text-DlxDOtf4.js → rich-text-j-FGAeZW.js} +4 -4
- package/dist/{rich-text-DlxDOtf4.js.map → rich-text-j-FGAeZW.js.map} +1 -1
- package/dist/{scroll-area-D-pIhEKl.js → scroll-area-DRdr16Pt.js} +3 -3
- package/dist/scroll-area-DRdr16Pt.js.map +1 -0
- package/dist/{separator-BhtFyo4x.js → separator-BMEvwnSX.js} +2 -2
- package/dist/{separator-BhtFyo4x.js.map → separator-BMEvwnSX.js.map} +1 -1
- package/dist/{separator-BNIgG3au.js → separator-Do5GWDYi.js} +4 -4
- package/dist/separator-Do5GWDYi.js.map +1 -0
- package/dist/services/actions/action-adapters.d.ts +4 -0
- package/dist/services/actions.js +8 -3
- package/dist/services/actions.js.map +1 -1
- package/dist/{settings-DOTOzeZ2.js → settings-DHk0L2MF.js} +17 -17
- package/dist/settings-DHk0L2MF.js.map +1 -0
- package/dist/sheet-DRFNY1_D.js +207 -0
- package/dist/sheet-DRFNY1_D.js.map +1 -0
- package/dist/sidebar-Cb8WzOvE.js +511 -0
- package/dist/sidebar-Cb8WzOvE.js.map +1 -0
- package/dist/{sidebar-CyR4XKwR.js → sidebar-Crc9M9JV.js} +18 -18
- package/dist/sidebar-Crc9M9JV.js.map +1 -0
- package/dist/{skeleton-3F0uhYn3.js → skeleton-DVMXr15h.js} +4 -4
- package/dist/{skeleton-3F0uhYn3.js.map → skeleton-DVMXr15h.js.map} +1 -1
- package/dist/{smart-card-DjGVV2xr.js → smart-card-Bek-TwUp.js} +222 -207
- package/dist/smart-card-Bek-TwUp.js.map +1 -0
- package/dist/{spinner-Cpf7oRkF.js → spinner-CmTAbEp0.js} +8 -6
- package/dist/spinner-CmTAbEp0.js.map +1 -0
- package/dist/{structure-CRdqVawd.js → structure-hzCW-XsV.js} +3 -3
- package/dist/{structure-CRdqVawd.js.map → structure-hzCW-XsV.js.map} +1 -1
- package/dist/{structure.recipes-Bqhf9oIh.js → structure.recipes-EPz60cU8.js} +37 -19
- package/dist/structure.recipes-EPz60cU8.js.map +1 -0
- package/dist/style.css +1 -1
- package/dist/surface-recipes-DOdoBXGm.js +28 -0
- package/dist/surface-recipes-DOdoBXGm.js.map +1 -0
- package/dist/table-D6zKeYQX.js +162 -0
- package/dist/table-D6zKeYQX.js.map +1 -0
- package/dist/{table-CcRDZiLP.js → table-Dn4XSrSB.js} +348 -348
- package/dist/table-Dn4XSrSB.js.map +1 -0
- package/dist/{tabs-BNgu7g0u.js → tabs-Dk8E_knt.js} +14 -13
- package/dist/tabs-Dk8E_knt.js.map +1 -0
- package/dist/{text-inputs-DsR56TR-.js → text-inputs-BFpku0Qd.js} +150 -149
- package/dist/text-inputs-BFpku0Qd.js.map +1 -0
- package/dist/{text.styles-Q4sGAIgA.js → text.styles-g4He6UIW.js} +17 -14
- package/dist/text.styles-g4He6UIW.js.map +1 -0
- package/dist/theme.css +16 -12
- package/dist/themes/green.css +24 -0
- package/dist/{timelines-D1pkt3se.js → timelines-CxuAFIc2.js} +25 -38
- package/dist/timelines-CxuAFIc2.js.map +1 -0
- package/dist/track-recipes-CDcKmndW.js +10 -0
- package/dist/track-recipes-CDcKmndW.js.map +1 -0
- package/dist/{tree-BtmYyMZV.js → tree-BotPlyiD.js} +13 -13
- package/dist/{tree-BtmYyMZV.js.map → tree-BotPlyiD.js.map} +1 -1
- package/dist/typography/rich-text.js +1 -1
- package/dist/typography-CAr3dQhX.js +116 -0
- package/dist/typography-CAr3dQhX.js.map +1 -0
- package/dist/typography.js +2 -2
- package/dist/{ui-provider-DRPn3qNl.js → ui-provider-D2_TeLqw.js} +20 -21
- package/dist/ui-provider-D2_TeLqw.js.map +1 -0
- package/dist/ui-provider.js +1 -1
- package/dist/{upload-CDbYw1WN.js → upload-B0WHW7ak.js} +221 -220
- package/dist/upload-B0WHW7ak.js.map +1 -0
- package/dist/{upload-queue-CNd_hH_a.js → upload-queue-BHZ_wBfd.js} +59 -62
- package/dist/upload-queue-BHZ_wBfd.js.map +1 -0
- package/dist/{usage-card-VyJLUwRr.js → usage-card-U0YBLTNT.js} +42 -43
- package/dist/{usage-card-VyJLUwRr.js.map → usage-card-U0YBLTNT.js.map} +1 -1
- package/dist/{utils-BvH9PSmq.js → utils-Cospvlj1.js} +221 -51
- package/dist/utils-Cospvlj1.js.map +1 -0
- package/dist/value-inputs-CjfzGMsN.js +854 -0
- package/dist/value-inputs-CjfzGMsN.js.map +1 -0
- package/dist/value-typography-Deb3yQZg.js +116 -0
- package/dist/value-typography-Deb3yQZg.js.map +1 -0
- package/dist/{workspace-CcR8r-Nt.js → workspace-YoFjXi6i.js} +44 -45
- package/dist/workspace-YoFjXi6i.js.map +1 -0
- package/docs/consumer-skill/SKILL.md +51 -38
- package/docs/consumer-skill/examples/app-layout.tsx +2 -4
- package/docs/consumer-skill/examples/detail.tsx +3 -4
- package/docs/consumer-skill/examples/edit.tsx +1 -1
- package/docs/consumer-skill/examples/layout-blocks.tsx +20 -0
- package/docs/consumer-skill/examples/manifest.json +28 -6
- package/docs/consumer-skill/examples/scoped-directory.tsx +2 -2
- package/docs/consumer-skill/references/composition.md +89 -17
- package/docs/consumer-skill/references/discovery.md +4 -0
- package/docs/consumer-skill/references/installation.md +22 -0
- package/docs/consumer-skill/references/integration.md +32 -1
- package/docs/consumer-skill/references/public-api.json +111 -70
- package/docs/consumer-skill/references/review.md +20 -4
- package/docs/consumer-skill/references/theming.md +7 -1
- package/docs/consumer-skill/references/tokens.json +5 -2
- package/docs/consumer-skill/references/workflows.md +4 -2
- package/docs/consumer-skill/scripts/composition-policy.mjs +93 -2
- package/docs/consumer-skill/scripts/discovery.mjs +11 -3
- package/docs/consumer-skill/scripts/pin-button-defaults.mjs +95 -0
- package/package.json +5 -3
- package/dist/accordion-BRTcsp8J.js.map +0 -1
- package/dist/action-menu-Drxw_vJk.js +0 -265
- package/dist/action-menu-Drxw_vJk.js.map +0 -1
- package/dist/affordance-geometry.generated-CL84ZN9A.js.map +0 -1
- package/dist/ai-artifact-DLVdK0Py.js.map +0 -1
- package/dist/avatar-Bu2HhitA.js.map +0 -1
- package/dist/badge-CzId1Wlm.js.map +0 -1
- package/dist/button-BZDasD04.js.map +0 -1
- package/dist/buttons-D_6KJvEE.js.map +0 -1
- package/dist/chart-Bsc5BICK.js.map +0 -1
- package/dist/checkbox-BQNDjUCh.js +0 -34
- package/dist/checkbox-BQNDjUCh.js.map +0 -1
- package/dist/choice-inputs-Mk3iWbhr.js +0 -725
- package/dist/choice-inputs-Mk3iWbhr.js.map +0 -1
- package/dist/combobox-BFnbJJp3.js.map +0 -1
- package/dist/combobox-hozNwUcc.js.map +0 -1
- package/dist/command-BnmSchli.js.map +0 -1
- package/dist/comments-u5L0OGip.js.map +0 -1
- package/dist/data-display-Bihs9Ven.js.map +0 -1
- package/dist/date-DOKhJPu7.js +0 -140
- package/dist/date-DOKhJPu7.js.map +0 -1
- package/dist/date-picker-DzP5HQq7.js +0 -1541
- package/dist/date-picker-DzP5HQq7.js.map +0 -1
- package/dist/date-pickers-BpgGz7S-.js +0 -196
- package/dist/date-pickers-BpgGz7S-.js.map +0 -1
- package/dist/display-CS6Hbk18.js.map +0 -1
- package/dist/dropdown-menu-D-boNgGO.js.map +0 -1
- package/dist/feedback-CJkUAapr.js.map +0 -1
- package/dist/field-affordance-recipes-uKY4MsZ_.js +0 -25
- package/dist/field-affordance-recipes-uKY4MsZ_.js.map +0 -1
- package/dist/field-state-recipes-DQQpiLWC.js.map +0 -1
- package/dist/filters-D6FF8L6s.js.map +0 -1
- package/dist/form-sizing-QP8aIRaW.js +0 -103
- package/dist/form-sizing-QP8aIRaW.js.map +0 -1
- package/dist/format-iamDSqs2.js +0 -110
- package/dist/format-iamDSqs2.js.map +0 -1
- package/dist/forms-B5NCbkSC.js.map +0 -1
- package/dist/forms-numeric-Crrm80Lm.js +0 -867
- package/dist/forms-numeric-Crrm80Lm.js.map +0 -1
- package/dist/header-kxruN3RM.js.map +0 -1
- package/dist/input-SX9V0AL3.js +0 -255
- package/dist/item-DE4YnuJx.js +0 -258
- package/dist/item-DE4YnuJx.js.map +0 -1
- package/dist/media-gallery-DLp3HAz0.js.map +0 -1
- package/dist/navigation-DnQSNMT0.js.map +0 -1
- package/dist/navigation-DyytsLRB.js.map +0 -1
- package/dist/number-DasMFWEG.js +0 -269
- package/dist/number-DasMFWEG.js.map +0 -1
- package/dist/overlay.recipes-BxW5FIfK.js +0 -6
- package/dist/overlay.recipes-BxW5FIfK.js.map +0 -1
- package/dist/overlays-DUbs1KEi.js +0 -1011
- package/dist/overlays-DUbs1KEi.js.map +0 -1
- package/dist/page-hGmT4nWK.js +0 -213
- package/dist/page-hGmT4nWK.js.map +0 -1
- package/dist/page-header-D8nERkn5.js.map +0 -1
- package/dist/primitives-C7ff0QaI.js +0 -337
- package/dist/primitives-C7ff0QaI.js.map +0 -1
- package/dist/progress-BroqrAyV.js.map +0 -1
- package/dist/scroll-area-D-pIhEKl.js.map +0 -1
- package/dist/separator-BNIgG3au.js.map +0 -1
- package/dist/settings-DOTOzeZ2.js.map +0 -1
- package/dist/sheet-BFhrNehm.js +0 -205
- package/dist/sheet-BFhrNehm.js.map +0 -1
- package/dist/sidebar-CyR4XKwR.js.map +0 -1
- package/dist/sidebar-SvGJ0Zwi.js +0 -506
- package/dist/sidebar-SvGJ0Zwi.js.map +0 -1
- package/dist/smart-card-DjGVV2xr.js.map +0 -1
- package/dist/spinner-Cpf7oRkF.js.map +0 -1
- package/dist/structure.recipes-Bqhf9oIh.js.map +0 -1
- package/dist/surface-recipes-Dd__PD-w.js +0 -28
- package/dist/surface-recipes-Dd__PD-w.js.map +0 -1
- package/dist/table-CLtJTxoR.js +0 -147
- package/dist/table-CLtJTxoR.js.map +0 -1
- package/dist/table-CcRDZiLP.js.map +0 -1
- package/dist/tabs-BNgu7g0u.js.map +0 -1
- package/dist/text-inputs-DsR56TR-.js.map +0 -1
- package/dist/text.styles-Q4sGAIgA.js.map +0 -1
- package/dist/timelines-D1pkt3se.js.map +0 -1
- package/dist/track-recipes-LLPNVwFg.js +0 -10
- package/dist/track-recipes-LLPNVwFg.js.map +0 -1
- package/dist/typography-BxQgiZyw.js +0 -96
- package/dist/typography-BxQgiZyw.js.map +0 -1
- package/dist/ui-provider-DRPn3qNl.js.map +0 -1
- package/dist/upload-CDbYw1WN.js.map +0 -1
- package/dist/upload-queue-CNd_hH_a.js.map +0 -1
- package/dist/utils-BvH9PSmq.js.map +0 -1
- package/dist/value-inputs-D0KCrfVC.js +0 -840
- package/dist/value-inputs-D0KCrfVC.js.map +0 -1
- package/dist/workspace-CcR8r-Nt.js.map +0 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { _ as e, s as t } from "../ui-provider-
|
|
2
|
+
import { _ as e, s as t } from "../ui-provider-D2_TeLqw.js";
|
|
3
3
|
import { useStrings as n } from "../lib/strings.js";
|
|
4
|
-
import { t as r } from "../utils-
|
|
5
|
-
import { a as i,
|
|
6
|
-
import { t as o } from "../button-
|
|
7
|
-
import { r as s, t as c } from "../structure-
|
|
8
|
-
import { i as l } from "../smart-card-
|
|
9
|
-
import { n as u, t as d } from "../feedback-
|
|
10
|
-
import { r as f } from "../overlays-
|
|
11
|
-
import { a as p, i as m, t as h } from "../primitives-
|
|
12
|
-
import { n as g, t as _ } from "../number-
|
|
13
|
-
import { t as v } from "../badge-
|
|
14
|
-
import { t as y } from "../input-
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import { createContext as
|
|
21
|
-
import { Fragment as
|
|
22
|
-
import { ArrowLeft as
|
|
4
|
+
import { t as r } from "../utils-Cospvlj1.js";
|
|
5
|
+
import { a as i, s as a } from "../typography-CAr3dQhX.js";
|
|
6
|
+
import { t as o } from "../button-BS3KDg00.js";
|
|
7
|
+
import { r as s, t as c } from "../structure-hzCW-XsV.js";
|
|
8
|
+
import { i as l } from "../smart-card-Bek-TwUp.js";
|
|
9
|
+
import { n as u, t as d } from "../feedback-C7nR0UtT.js";
|
|
10
|
+
import { r as f } from "../overlays-DhZO7N-I.js";
|
|
11
|
+
import { a as p, i as m, t as h } from "../primitives-BHrwQXFC.js";
|
|
12
|
+
import { n as g, t as _ } from "../number-CKRBYmZK.js";
|
|
13
|
+
import { t as v } from "../badge-0tATj-tW.js";
|
|
14
|
+
import { t as y } from "../input-DhQdBnV3.js";
|
|
15
|
+
import { t as b } from "../form-field-VZRULhUK.js";
|
|
16
|
+
import { c as x, s as S } from "../choice-inputs-DrJ17tpL.js";
|
|
17
|
+
import { r as C, t as w } from "../control-group-recipes-DBXmfh2E.js";
|
|
18
|
+
import { a as ee } from "../upload-queue-BHZ_wBfd.js";
|
|
19
|
+
import { l as T } from "../data-display-3xWQUnMA.js";
|
|
20
|
+
import { createContext as E, useCallback as D, useContext as te, useEffect as O, useMemo as k, useRef as A, useState as j } from "react";
|
|
21
|
+
import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
|
|
22
|
+
import { ArrowLeft as F, ArrowRight as ne, Check as re, File as ie, Grid2X2 as ae, ImageIcon as I, ImagePlus as oe, Info as L, Layers3 as se, LayoutList as R, Lock as z, Play as B, Plus as ce, Search as le, Star as ue, Trash2 as de, UploadCloud as fe, Video as pe, X as me } from "lucide-react";
|
|
23
23
|
import { createPortal as he } from "react-dom";
|
|
24
24
|
//#region src/components/features/media-library/media-library.strings.ts
|
|
25
25
|
var ge = {
|
|
@@ -153,8 +153,8 @@ var _e = {
|
|
|
153
153
|
public: !0
|
|
154
154
|
}, ve = [];
|
|
155
155
|
function H(e, t, n) {
|
|
156
|
-
let [r, i] =
|
|
157
|
-
return [a,
|
|
156
|
+
let [r, i] = j(t), a = e ?? r;
|
|
157
|
+
return [a, D((t) => {
|
|
158
158
|
let r = typeof t == "function" ? t(a) : t;
|
|
159
159
|
e === void 0 && i(r), n?.(r);
|
|
160
160
|
}, [
|
|
@@ -234,27 +234,27 @@ function ke(e, t, n) {
|
|
|
234
234
|
let r = e.slice();
|
|
235
235
|
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) => Se(n, t) - Se(e, t)), r;
|
|
236
236
|
}
|
|
237
|
-
function Ae({ items: e = ve, fetcher: t, accessors: n, selectionMode: r = "multiple", value: i, defaultValue: a = [], onValueChange: o, onItemUpdate: s, onItemDelete: c, onUpload: l, onError: u, tab: d, defaultTab: f = "library", onTabChange: p, view: m, defaultView: h = "grid", onViewChange: g, query: _, defaultQuery: v = "", onQueryChange: y, type: b, defaultType: x = "all", onTypeChange: S, collection: C, defaultCollection: w = "all", onCollectionChange:
|
|
238
|
-
let
|
|
239
|
-
..._e,
|
|
240
|
-
...P,
|
|
241
|
-
tags: P?.tags ?? _e.tags
|
|
242
|
-
}), [P]), [Ie, Le] = H(A(() => N ? {
|
|
237
|
+
function Ae({ items: e = ve, fetcher: t, accessors: n, selectionMode: r = "multiple", value: i, defaultValue: a = [], onValueChange: o, onItemUpdate: s, onItemDelete: c, onUpload: l, onError: u, tab: d, defaultTab: f = "library", onTabChange: p, view: m, defaultView: h = "grid", onViewChange: g, query: _, defaultQuery: v = "", onQueryChange: y, type: b, defaultType: x = "all", onTypeChange: S, collection: C, defaultCollection: w = "all", onCollectionChange: ee, sort: T, defaultSort: E = "newest", onSortChange: te, uploadOptions: M, defaultUploadOptions: N, onUploadOptionsChange: P } = {}) {
|
|
238
|
+
let F = k(() => be(n), [n]), [ne, re] = H(d, f, p), [ie, ae] = H(m, h, g), [I, oe] = H(_, v, y), [L, se] = H(b, x, S), [R, z] = H(C, w, ee), [B, ce] = H(T, E, te), [le, ue] = j(null), [de, fe] = j(() => [...a]), [pe, me] = j([]), [he, ge] = j(), [V, ye] = j(!1), [xe, U] = j(null), [Se, Ae] = j([]), [je, W] = j(() => /* @__PURE__ */ new Set()), [G, Me] = j({}), [K, q] = j([]), [Ne, Pe] = j(!1), Fe = k(() => ({
|
|
243
239
|
..._e,
|
|
244
240
|
...N,
|
|
245
|
-
tags: N
|
|
246
|
-
}
|
|
241
|
+
tags: N?.tags ?? _e.tags
|
|
242
|
+
}), [N]), [Ie, Le] = H(k(() => M ? {
|
|
243
|
+
..._e,
|
|
244
|
+
...M,
|
|
245
|
+
tags: M.tags ?? _e.tags
|
|
246
|
+
} : void 0, [M]), Fe, P), Re = i !== void 0, J = k(() => Re ? [...i ?? []] : de, [
|
|
247
247
|
de,
|
|
248
248
|
Re,
|
|
249
249
|
i
|
|
250
|
-
]), Y =
|
|
251
|
-
|
|
250
|
+
]), Y = k(() => new Set(J), [J]), ze = A(/* @__PURE__ */ new Set()), X = A(null), Be = A(/* @__PURE__ */ new Map());
|
|
251
|
+
O(() => {
|
|
252
252
|
if (!t) return;
|
|
253
253
|
let e = new AbortController();
|
|
254
254
|
return ye(!0), U(null), t({
|
|
255
|
-
query:
|
|
256
|
-
type:
|
|
257
|
-
collection:
|
|
255
|
+
query: I,
|
|
256
|
+
type: L,
|
|
257
|
+
collection: R === "all" ? void 0 : R,
|
|
258
258
|
sort: B,
|
|
259
259
|
signal: e.signal
|
|
260
260
|
}).then((t) => {
|
|
@@ -267,13 +267,13 @@ function Ae({ items: e = ve, fetcher: t, accessors: n, selectionMode: r = "multi
|
|
|
267
267
|
e.signal.aborted || ye(!1);
|
|
268
268
|
}), () => e.abort();
|
|
269
269
|
}, [
|
|
270
|
-
|
|
270
|
+
R,
|
|
271
271
|
t,
|
|
272
272
|
u,
|
|
273
|
-
|
|
273
|
+
I,
|
|
274
274
|
B,
|
|
275
|
-
|
|
276
|
-
]),
|
|
275
|
+
L
|
|
276
|
+
]), O(() => {
|
|
277
277
|
let e = ze.current;
|
|
278
278
|
return () => {
|
|
279
279
|
X.current?.abort();
|
|
@@ -281,54 +281,54 @@ function Ae({ items: e = ve, fetcher: t, accessors: n, selectionMode: r = "multi
|
|
|
281
281
|
e.clear();
|
|
282
282
|
};
|
|
283
283
|
}, []);
|
|
284
|
-
let Z =
|
|
284
|
+
let Z = k(() => t ? pe : [...Se, ...e], [
|
|
285
285
|
Se,
|
|
286
286
|
pe,
|
|
287
287
|
t,
|
|
288
288
|
e
|
|
289
|
-
]), Q =
|
|
290
|
-
|
|
289
|
+
]), Q = k(() => Z.filter((e) => !je.has(F.getId(e))).map((e) => De(e, G[F.getId(e)])), [
|
|
290
|
+
F,
|
|
291
291
|
G,
|
|
292
292
|
je,
|
|
293
293
|
Z
|
|
294
|
-
]), Ve =
|
|
295
|
-
let e = t ? Q : Oe(Q, I, L, R
|
|
296
|
-
return t ? e : ke(e,
|
|
294
|
+
]), Ve = k(() => {
|
|
295
|
+
let e = t ? Q : Oe(Q, F, I, L, R);
|
|
296
|
+
return t ? e : ke(e, F, B);
|
|
297
297
|
}, [
|
|
298
|
-
|
|
299
|
-
|
|
298
|
+
F,
|
|
299
|
+
R,
|
|
300
300
|
t,
|
|
301
301
|
Q,
|
|
302
|
-
L,
|
|
303
|
-
B,
|
|
304
|
-
R
|
|
305
|
-
]), He = he ?? Q.length, Ue = Ve.length, We = A(() => Q.filter((e) => Y.has(I.getId(e))), [
|
|
306
302
|
I,
|
|
303
|
+
B,
|
|
304
|
+
L
|
|
305
|
+
]), He = he ?? Q.length, Ue = Ve.length, We = k(() => Q.filter((e) => Y.has(F.getId(e))), [
|
|
306
|
+
F,
|
|
307
307
|
Q,
|
|
308
308
|
Y
|
|
309
|
-
]), Ge = !!
|
|
309
|
+
]), Ge = !!I.trim() || L !== "all" || R !== "all", $ = D((e) => {
|
|
310
310
|
Re || fe(e);
|
|
311
|
-
let t = new Set(e), n = Q.filter((e) => t.has(
|
|
311
|
+
let t = new Set(e), n = Q.filter((e) => t.has(F.getId(e)));
|
|
312
312
|
o?.(e, n);
|
|
313
313
|
}, [
|
|
314
|
-
|
|
314
|
+
F,
|
|
315
315
|
Re,
|
|
316
316
|
o,
|
|
317
317
|
Q
|
|
318
|
-
]), Ke =
|
|
318
|
+
]), Ke = D((e) => {
|
|
319
319
|
let t = new Set(r === "single" ? [] : Y);
|
|
320
320
|
Y.has(e) && r !== "single" ? t.delete(e) : t.add(e), $(Array.from(t));
|
|
321
321
|
}, [
|
|
322
322
|
$,
|
|
323
323
|
Y,
|
|
324
324
|
r
|
|
325
|
-
]), qe =
|
|
326
|
-
|
|
325
|
+
]), qe = D(() => $([]), [$]), Je = D(() => {
|
|
326
|
+
oe(""), se("all"), z("all");
|
|
327
327
|
}, [
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
]), Ye =
|
|
328
|
+
z,
|
|
329
|
+
oe,
|
|
330
|
+
se
|
|
331
|
+
]), Ye = D((e) => {
|
|
332
332
|
q((t) => [...t, ...e.map((e, t) => {
|
|
333
333
|
let n = we(e);
|
|
334
334
|
return n && ze.current.add(n), {
|
|
@@ -342,38 +342,38 @@ function Ae({ items: e = ve, fetcher: t, accessors: n, selectionMode: r = "multi
|
|
|
342
342
|
status: "staged"
|
|
343
343
|
};
|
|
344
344
|
})]);
|
|
345
|
-
}, []), Xe =
|
|
345
|
+
}, []), Xe = D((e) => {
|
|
346
346
|
q((t) => {
|
|
347
347
|
let n = t.find((t) => t.id === e);
|
|
348
348
|
return n?.src && (Te(n.src), ze.current.delete(n.src)), t.filter((t) => t.id !== e);
|
|
349
349
|
});
|
|
350
|
-
}, []), Ze =
|
|
350
|
+
}, []), Ze = D(() => {
|
|
351
351
|
q((e) => {
|
|
352
352
|
for (let t of e) t.src && (Te(t.src), ze.current.delete(t.src));
|
|
353
353
|
return [];
|
|
354
354
|
});
|
|
355
|
-
}, []), Qe =
|
|
355
|
+
}, []), Qe = D((e) => {
|
|
356
356
|
Le((t) => ({
|
|
357
357
|
...t,
|
|
358
358
|
...e
|
|
359
359
|
}));
|
|
360
|
-
}, [Le]), $e =
|
|
360
|
+
}, [Le]), $e = D((e, t) => {
|
|
361
361
|
q((n) => n.map((n) => n.id === e ? {
|
|
362
362
|
...n,
|
|
363
363
|
...t
|
|
364
364
|
} : n));
|
|
365
365
|
}, []);
|
|
366
366
|
return {
|
|
367
|
-
tab:
|
|
368
|
-
setTab:
|
|
369
|
-
view:
|
|
370
|
-
setView:
|
|
371
|
-
query:
|
|
372
|
-
setQuery:
|
|
373
|
-
type:
|
|
374
|
-
setType:
|
|
375
|
-
collection:
|
|
376
|
-
setCollection:
|
|
367
|
+
tab: ne,
|
|
368
|
+
setTab: re,
|
|
369
|
+
view: ie,
|
|
370
|
+
setView: ae,
|
|
371
|
+
query: I,
|
|
372
|
+
setQuery: oe,
|
|
373
|
+
type: L,
|
|
374
|
+
setType: se,
|
|
375
|
+
collection: R,
|
|
376
|
+
setCollection: z,
|
|
377
377
|
sort: B,
|
|
378
378
|
setSort: ce,
|
|
379
379
|
detailId: le,
|
|
@@ -398,7 +398,7 @@ function Ae({ items: e = ve, fetcher: t, accessors: n, selectionMode: r = "multi
|
|
|
398
398
|
updateUploadOptions: Qe,
|
|
399
399
|
uploadOptions: Ie,
|
|
400
400
|
uploading: Ne,
|
|
401
|
-
startUpload:
|
|
401
|
+
startUpload: D(async () => {
|
|
402
402
|
if (Ne || K.length === 0) return;
|
|
403
403
|
let e = new AbortController();
|
|
404
404
|
X.current?.abort(), X.current = e, U(null), Pe(!0), q((e) => e.map((e) => ({
|
|
@@ -427,10 +427,10 @@ function Ae({ items: e = ve, fetcher: t, accessors: n, selectionMode: r = "multi
|
|
|
427
427
|
progress: 100
|
|
428
428
|
}))), i?.length) {
|
|
429
429
|
Ae((e) => [...i, ...e]);
|
|
430
|
-
let e = i.map((e) =>
|
|
430
|
+
let e = i.map((e) => F.getId(e));
|
|
431
431
|
$(r === "single" ? e.slice(0, 1) : Array.from(/* @__PURE__ */ new Set([...e, ...J])));
|
|
432
432
|
}
|
|
433
|
-
Ze(),
|
|
433
|
+
Ze(), re("library");
|
|
434
434
|
} catch (t) {
|
|
435
435
|
if (e.signal.aborted) return;
|
|
436
436
|
U(t), q((e) => e.map((e) => e.status === "uploading" ? {
|
|
@@ -442,20 +442,20 @@ function Ae({ items: e = ve, fetcher: t, accessors: n, selectionMode: r = "multi
|
|
|
442
442
|
X.current === e && (X.current = null, Pe(!1));
|
|
443
443
|
}
|
|
444
444
|
}, [
|
|
445
|
-
|
|
445
|
+
F,
|
|
446
446
|
$,
|
|
447
447
|
Ze,
|
|
448
448
|
u,
|
|
449
449
|
l,
|
|
450
450
|
J,
|
|
451
451
|
r,
|
|
452
|
-
|
|
452
|
+
re,
|
|
453
453
|
$e,
|
|
454
454
|
K,
|
|
455
455
|
Ie,
|
|
456
456
|
Ne
|
|
457
457
|
]),
|
|
458
|
-
cancelUpload:
|
|
458
|
+
cancelUpload: D(() => {
|
|
459
459
|
X.current?.abort(), X.current = null, Pe(!1), q((e) => e.map((e) => e.status === "uploading" ? {
|
|
460
460
|
...e,
|
|
461
461
|
status: "staged",
|
|
@@ -463,8 +463,8 @@ function Ae({ items: e = ve, fetcher: t, accessors: n, selectionMode: r = "multi
|
|
|
463
463
|
error: void 0
|
|
464
464
|
} : e));
|
|
465
465
|
}, []),
|
|
466
|
-
updateItem:
|
|
467
|
-
let n =
|
|
466
|
+
updateItem: D(async (e, t) => {
|
|
467
|
+
let n = F.getId(e), r = `update:${n}`, i = (Be.current.get(r) ?? 0) + 1;
|
|
468
468
|
Be.current.set(r, i);
|
|
469
469
|
let a = G[n];
|
|
470
470
|
U(null), Me((e) => ({
|
|
@@ -483,13 +483,13 @@ function Ae({ items: e = ve, fetcher: t, accessors: n, selectionMode: r = "multi
|
|
|
483
483
|
}), U(e), u?.(e), !1;
|
|
484
484
|
}
|
|
485
485
|
}, [
|
|
486
|
-
|
|
486
|
+
F,
|
|
487
487
|
G,
|
|
488
488
|
u,
|
|
489
489
|
s
|
|
490
490
|
]),
|
|
491
|
-
removeItem:
|
|
492
|
-
let t =
|
|
491
|
+
removeItem: D(async (e) => {
|
|
492
|
+
let t = F.getId(e), n = `delete:${t}`, r = (Be.current.get(n) ?? 0) + 1;
|
|
493
493
|
Be.current.set(n, r);
|
|
494
494
|
let i = je.has(t);
|
|
495
495
|
U(null), W((e) => new Set(e).add(t));
|
|
@@ -502,7 +502,7 @@ function Ae({ items: e = ve, fetcher: t, accessors: n, selectionMode: r = "multi
|
|
|
502
502
|
}), U(e), u?.(e), !1;
|
|
503
503
|
}
|
|
504
504
|
}, [
|
|
505
|
-
|
|
505
|
+
F,
|
|
506
506
|
$,
|
|
507
507
|
u,
|
|
508
508
|
c,
|
|
@@ -510,14 +510,14 @@ function Ae({ items: e = ve, fetcher: t, accessors: n, selectionMode: r = "multi
|
|
|
510
510
|
J,
|
|
511
511
|
Y
|
|
512
512
|
]),
|
|
513
|
-
accessors:
|
|
513
|
+
accessors: F
|
|
514
514
|
};
|
|
515
515
|
}
|
|
516
516
|
//#endregion
|
|
517
517
|
//#region src/components/features/media-library/partials/media-library-partials.tsx
|
|
518
518
|
var je = "absolute inset-0 z-10 box-border block h-full w-full cursor-pointer border-0 bg-transparent p-0 font-sans outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset";
|
|
519
519
|
function W(e, t) {
|
|
520
|
-
return
|
|
520
|
+
return N(e === "image" ? I : e === "video" ? pe : ie, { className: t ?? "size-icon" });
|
|
521
521
|
}
|
|
522
522
|
function G(e, t) {
|
|
523
523
|
return e === "image" ? t.typeImage : e === "video" ? t.typeVideo : t.typeFile;
|
|
@@ -526,20 +526,20 @@ function Me(e, t) {
|
|
|
526
526
|
return e ? V(t.usedIn, { count: e }) : t.notUsed;
|
|
527
527
|
}
|
|
528
528
|
function K({ children: e, tint: t, className: n }) {
|
|
529
|
-
return /* @__PURE__ */
|
|
529
|
+
return /* @__PURE__ */ N("div", {
|
|
530
530
|
className: r("media-library-preview relative overflow-hidden bg-muted", n),
|
|
531
531
|
style: t ? { background: t } : void 0,
|
|
532
532
|
children: e
|
|
533
533
|
});
|
|
534
534
|
}
|
|
535
535
|
function q({ src: e, alt: t, type: n, className: r, loading: i = "lazy" }) {
|
|
536
|
-
let [a, o] =
|
|
537
|
-
return
|
|
536
|
+
let [a, o] = j(!1);
|
|
537
|
+
return O(() => {
|
|
538
538
|
o(!1);
|
|
539
|
-
}, [e]), !e || a ? /* @__PURE__ */
|
|
539
|
+
}, [e]), !e || a ? /* @__PURE__ */ N("div", {
|
|
540
540
|
className: "media-library-preview--fallback flex size-full items-center justify-center text-muted-foreground",
|
|
541
541
|
children: W(n, "size-6")
|
|
542
|
-
}) : /* @__PURE__ */
|
|
542
|
+
}) : /* @__PURE__ */ N("img", {
|
|
543
543
|
src: e,
|
|
544
544
|
alt: t,
|
|
545
545
|
loading: i,
|
|
@@ -548,11 +548,11 @@ function q({ src: e, alt: t, type: n, className: r, loading: i = "lazy" }) {
|
|
|
548
548
|
});
|
|
549
549
|
}
|
|
550
550
|
function Ne({ icon: e, title: t, description: n, action: i, className: a }) {
|
|
551
|
-
return /* @__PURE__ */
|
|
551
|
+
return /* @__PURE__ */ N(T, {
|
|
552
552
|
title: t,
|
|
553
553
|
description: n ?? !1,
|
|
554
554
|
actions: i,
|
|
555
|
-
media: e ?? /* @__PURE__ */
|
|
555
|
+
media: e ?? /* @__PURE__ */ N(I, {
|
|
556
556
|
className: "size-icon",
|
|
557
557
|
"aria-hidden": "true"
|
|
558
558
|
}),
|
|
@@ -562,8 +562,8 @@ function Ne({ icon: e, title: t, description: n, action: i, className: a }) {
|
|
|
562
562
|
className: r("media-library-empty-state--component min-h-64 bg-muted/20", a)
|
|
563
563
|
});
|
|
564
564
|
}
|
|
565
|
-
function Pe({ query: n, type:
|
|
566
|
-
let { defaultScale:
|
|
565
|
+
function Pe({ query: n, type: i, typeFilters: s, collection: l, sort: u, view: d, collections: f = [], strings: p, onQueryChange: m, onTypeChange: h, onCollectionChange: g, onSortChange: _, onViewChange: b, onClearFilters: S, toolbarEnd: ee }) {
|
|
566
|
+
let { defaultScale: T } = t(), E = e(void 0, T), D = [
|
|
567
567
|
{
|
|
568
568
|
value: "all",
|
|
569
569
|
label: p.allTypes,
|
|
@@ -572,7 +572,7 @@ function Pe({ query: n, type: a, typeFilters: s, collection: l, sort: u, view: d
|
|
|
572
572
|
{
|
|
573
573
|
value: "image",
|
|
574
574
|
label: p.images,
|
|
575
|
-
icon:
|
|
575
|
+
icon: I
|
|
576
576
|
},
|
|
577
577
|
{
|
|
578
578
|
value: "video",
|
|
@@ -582,19 +582,19 @@ function Pe({ query: n, type: a, typeFilters: s, collection: l, sort: u, view: d
|
|
|
582
582
|
{
|
|
583
583
|
value: "file",
|
|
584
584
|
label: p.files,
|
|
585
|
-
icon:
|
|
585
|
+
icon: ie
|
|
586
586
|
}
|
|
587
587
|
].filter((e) => (s ?? [
|
|
588
588
|
"all",
|
|
589
589
|
"image",
|
|
590
590
|
"video"
|
|
591
|
-
]).includes(e.value)),
|
|
591
|
+
]).includes(e.value)), te = [{
|
|
592
592
|
value: "all",
|
|
593
593
|
label: p.allCollections
|
|
594
594
|
}, ...f.map((e) => ({
|
|
595
595
|
value: e.value,
|
|
596
596
|
label: String(e.label)
|
|
597
|
-
}))],
|
|
597
|
+
}))], O = [
|
|
598
598
|
{
|
|
599
599
|
value: "newest",
|
|
600
600
|
label: p.sortNewest
|
|
@@ -611,18 +611,18 @@ function Pe({ query: n, type: a, typeFilters: s, collection: l, sort: u, view: d
|
|
|
611
611
|
value: "usage",
|
|
612
612
|
label: p.sortUsage
|
|
613
613
|
}
|
|
614
|
-
],
|
|
615
|
-
return /* @__PURE__ */
|
|
614
|
+
], k = n.trim(), A = k.length > 0, j = A || i !== "all" || l !== "all";
|
|
615
|
+
return /* @__PURE__ */ P(c, {
|
|
616
616
|
direction: "horizontal",
|
|
617
617
|
wrap: !0,
|
|
618
618
|
align: "start",
|
|
619
619
|
gap: "md",
|
|
620
620
|
className: "media-library-toolbar--component",
|
|
621
621
|
children: [
|
|
622
|
-
/* @__PURE__ */
|
|
622
|
+
/* @__PURE__ */ P(c, {
|
|
623
623
|
gap: "xs",
|
|
624
624
|
className: "media-library-toolbar--search min-w-52 flex-1",
|
|
625
|
-
children: [/* @__PURE__ */
|
|
625
|
+
children: [/* @__PURE__ */ N(y, {
|
|
626
626
|
value: n,
|
|
627
627
|
onChange: (e) => m(e.target.value),
|
|
628
628
|
placeholder: p.searchPlaceholder,
|
|
@@ -630,53 +630,46 @@ function Pe({ query: n, type: a, typeFilters: s, collection: l, sort: u, view: d
|
|
|
630
630
|
clearable: !0,
|
|
631
631
|
onClear: () => m(""),
|
|
632
632
|
strings: { clear: p.clearSearch },
|
|
633
|
-
className:
|
|
634
|
-
}), !!
|
|
633
|
+
className: "bg-background"
|
|
634
|
+
}), !!A && /* @__PURE__ */ N(c, {
|
|
635
635
|
direction: "horizontal",
|
|
636
636
|
gap: "xs",
|
|
637
637
|
wrap: !1,
|
|
638
638
|
className: "media-library-toolbar--search-value px-space-xs",
|
|
639
|
-
children: /* @__PURE__ */
|
|
640
|
-
tone: "
|
|
639
|
+
children: /* @__PURE__ */ P(v, {
|
|
640
|
+
tone: "secondary",
|
|
641
641
|
className: "max-w-full",
|
|
642
|
-
children: [
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
tag: "span",
|
|
655
|
-
size: "inherit",
|
|
656
|
-
weight: "normal",
|
|
657
|
-
className: "min-w-0 truncate text-current",
|
|
658
|
-
children: A
|
|
659
|
-
})
|
|
660
|
-
]
|
|
642
|
+
children: [/* @__PURE__ */ N(a, {
|
|
643
|
+
tag: "span",
|
|
644
|
+
size: "inherit",
|
|
645
|
+
className: "text-current",
|
|
646
|
+
children: p.activeSearchLabel
|
|
647
|
+
}), /* @__PURE__ */ N(a, {
|
|
648
|
+
tag: "span",
|
|
649
|
+
size: "inherit",
|
|
650
|
+
weight: "normal",
|
|
651
|
+
className: "min-w-0 truncate text-current",
|
|
652
|
+
children: k
|
|
653
|
+
})]
|
|
661
654
|
})
|
|
662
655
|
})]
|
|
663
656
|
}),
|
|
664
|
-
/* @__PURE__ */
|
|
665
|
-
className: r("media-library-toolbar--type-toggle",
|
|
657
|
+
/* @__PURE__ */ N("div", {
|
|
658
|
+
className: r("media-library-toolbar--type-toggle", C.frame, w[E]),
|
|
666
659
|
role: "tablist",
|
|
667
660
|
"aria-label": p.typeFilterLabel,
|
|
668
|
-
children:
|
|
669
|
-
let t = e.icon, n =
|
|
670
|
-
return /* @__PURE__ */
|
|
661
|
+
children: D.map((e) => {
|
|
662
|
+
let t = e.icon, n = i === e.value;
|
|
663
|
+
return /* @__PURE__ */ P(o, {
|
|
671
664
|
type: "button",
|
|
672
665
|
role: "tab",
|
|
673
666
|
"aria-selected": n,
|
|
674
667
|
tone: "secondary",
|
|
675
668
|
buttonStyle: "ghost",
|
|
676
669
|
size: "sm",
|
|
677
|
-
className: r(
|
|
670
|
+
className: r(C.item, "shadow-none", n ? "bg-background text-foreground shadow-xs hover:bg-background" : "text-muted-foreground hover:bg-transparent hover:text-foreground"),
|
|
678
671
|
onClick: () => h(e.value),
|
|
679
|
-
children: [t && /* @__PURE__ */
|
|
672
|
+
children: [t && /* @__PURE__ */ N(t, { className: "size-icon-md" }), /* @__PURE__ */ N(a, {
|
|
680
673
|
tag: "span",
|
|
681
674
|
size: "xs",
|
|
682
675
|
weight: "medium",
|
|
@@ -686,72 +679,72 @@ function Pe({ query: n, type: a, typeFilters: s, collection: l, sort: u, view: d
|
|
|
686
679
|
}, e.value);
|
|
687
680
|
})
|
|
688
681
|
}),
|
|
689
|
-
/* @__PURE__ */
|
|
682
|
+
/* @__PURE__ */ N("div", {
|
|
690
683
|
className: "min-w-40",
|
|
691
|
-
children: /* @__PURE__ */
|
|
684
|
+
children: /* @__PURE__ */ N(x, {
|
|
692
685
|
value: l,
|
|
693
|
-
options:
|
|
686
|
+
options: te,
|
|
694
687
|
onValueChange: (e) => g(e ?? "all"),
|
|
695
688
|
placeholder: p.collectionFilterLabel,
|
|
696
689
|
"aria-label": p.collectionFilterLabel,
|
|
697
690
|
className: "bg-background"
|
|
698
691
|
})
|
|
699
692
|
}),
|
|
700
|
-
/* @__PURE__ */
|
|
693
|
+
/* @__PURE__ */ N("div", {
|
|
701
694
|
className: "min-w-32",
|
|
702
|
-
children: /* @__PURE__ */
|
|
695
|
+
children: /* @__PURE__ */ N(x, {
|
|
703
696
|
value: u,
|
|
704
|
-
options:
|
|
697
|
+
options: O,
|
|
705
698
|
onValueChange: (e) => _(e ?? "newest"),
|
|
706
699
|
placeholder: p.sortLabel,
|
|
707
700
|
"aria-label": p.sortLabel,
|
|
708
701
|
className: "bg-background"
|
|
709
702
|
})
|
|
710
703
|
}),
|
|
711
|
-
/* @__PURE__ */
|
|
712
|
-
className: r("media-library-toolbar--view-toggle ml-auto",
|
|
713
|
-
children: [/* @__PURE__ */
|
|
704
|
+
/* @__PURE__ */ P("div", {
|
|
705
|
+
className: r("media-library-toolbar--view-toggle ml-auto", C.frame, w[E]),
|
|
706
|
+
children: [/* @__PURE__ */ N(o, {
|
|
714
707
|
type: "button",
|
|
715
708
|
tone: d === "grid" ? "neutral" : "secondary",
|
|
716
709
|
buttonStyle: d === "grid" ? "solid" : "ghost",
|
|
717
710
|
size: "sm",
|
|
718
711
|
iconOnly: !0,
|
|
719
|
-
className: r(
|
|
712
|
+
className: r(C.item, d === "grid" && "bg-background text-foreground shadow-xs hover:bg-background"),
|
|
720
713
|
"aria-label": p.gridView,
|
|
721
|
-
onClick: () =>
|
|
722
|
-
children: /* @__PURE__ */
|
|
723
|
-
}), /* @__PURE__ */
|
|
714
|
+
onClick: () => b("grid"),
|
|
715
|
+
children: /* @__PURE__ */ N(ae, { className: "size-icon-md" })
|
|
716
|
+
}), /* @__PURE__ */ N(o, {
|
|
724
717
|
type: "button",
|
|
725
718
|
tone: d === "table" ? "neutral" : "secondary",
|
|
726
719
|
buttonStyle: d === "table" ? "solid" : "ghost",
|
|
727
720
|
size: "sm",
|
|
728
721
|
iconOnly: !0,
|
|
729
|
-
className: r(
|
|
722
|
+
className: r(C.item, d === "table" && "bg-background text-foreground shadow-xs hover:bg-background"),
|
|
730
723
|
"aria-label": p.tableView,
|
|
731
|
-
onClick: () =>
|
|
732
|
-
children: /* @__PURE__ */
|
|
724
|
+
onClick: () => b("table"),
|
|
725
|
+
children: /* @__PURE__ */ N(R, { className: "size-icon-md" })
|
|
733
726
|
})]
|
|
734
727
|
}),
|
|
735
|
-
!!
|
|
728
|
+
!!j && /* @__PURE__ */ N(o, {
|
|
736
729
|
type: "button",
|
|
737
730
|
tone: "secondary",
|
|
738
731
|
buttonStyle: "ghost",
|
|
739
732
|
onClick: S,
|
|
740
733
|
children: p.clearFilters
|
|
741
734
|
}),
|
|
742
|
-
|
|
735
|
+
ee
|
|
743
736
|
]
|
|
744
737
|
});
|
|
745
738
|
}
|
|
746
|
-
function Fe({ item: e, selected: t = !1, density: n = "comfortable", showMeta:
|
|
739
|
+
function Fe({ item: e, selected: t = !1, density: n = "comfortable", showMeta: i = !0, accessors: l, strings: u, onToggle: d, onDetails: f, className: p }) {
|
|
747
740
|
let h = l.getType(e), g = l.getName(e), _ = l.getSrc(e), y = l.getAlt(e) || g, b = l.getSize(e), x = l.getUsageCount(e), S = l.getPublic(e) === !1, C = l.getDuration(e);
|
|
748
|
-
return /* @__PURE__ */
|
|
741
|
+
return /* @__PURE__ */ P("div", {
|
|
749
742
|
"data-selected": t || void 0,
|
|
750
743
|
"data-gallery-density": n,
|
|
751
744
|
className: r("media-library-card--component relative group/card overflow-hidden rounded-radius border border-border/70 bg-card text-left shadow-xs transition-all", "hover:border-primary/30 hover:shadow-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2", t && "media-library-card--selected border-primary ring-1 ring-primary", p),
|
|
752
745
|
onClick: d,
|
|
753
746
|
children: [
|
|
754
|
-
!!d && /* @__PURE__ */
|
|
747
|
+
!!d && /* @__PURE__ */ N("button", {
|
|
755
748
|
type: "button",
|
|
756
749
|
"aria-label": g,
|
|
757
750
|
"aria-pressed": t,
|
|
@@ -760,22 +753,22 @@ function Fe({ item: e, selected: t = !1, density: n = "comfortable", showMeta: a
|
|
|
760
753
|
e.stopPropagation(), d();
|
|
761
754
|
}
|
|
762
755
|
}),
|
|
763
|
-
/* @__PURE__ */
|
|
756
|
+
/* @__PURE__ */ P(K, {
|
|
764
757
|
tint: l.getTint(e),
|
|
765
758
|
className: r(n === "compact" ? "aspect-square" : "aspect-[4/3]"),
|
|
766
759
|
children: [
|
|
767
|
-
/* @__PURE__ */
|
|
760
|
+
/* @__PURE__ */ N(q, {
|
|
768
761
|
src: _,
|
|
769
762
|
alt: y,
|
|
770
763
|
type: h,
|
|
771
764
|
className: "size-full object-cover"
|
|
772
765
|
}),
|
|
773
|
-
/* @__PURE__ */
|
|
774
|
-
className: r("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
|
|
766
|
+
/* @__PURE__ */ N("span", {
|
|
767
|
+
className: r("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 text-transparent opacity-0 shadow-xs transition-opacity group-hover/card:opacity-100 group-focus-within/card:opacity-100", t && "bg-primary text-primary-foreground opacity-100"),
|
|
775
768
|
"aria-hidden": "true",
|
|
776
|
-
children: /* @__PURE__ */
|
|
769
|
+
children: /* @__PURE__ */ N(re, { className: "size-icon-sm" })
|
|
777
770
|
}),
|
|
778
|
-
!!f && /* @__PURE__ */
|
|
771
|
+
!!f && /* @__PURE__ */ N(o, {
|
|
779
772
|
type: "button",
|
|
780
773
|
tone: "secondary",
|
|
781
774
|
buttonStyle: "solid",
|
|
@@ -786,47 +779,47 @@ function Fe({ item: e, selected: t = !1, density: n = "comfortable", showMeta: a
|
|
|
786
779
|
onClick: (e) => {
|
|
787
780
|
e.stopPropagation(), f();
|
|
788
781
|
},
|
|
789
|
-
children: /* @__PURE__ */
|
|
782
|
+
children: /* @__PURE__ */ N(L, { className: "size-icon-md" })
|
|
790
783
|
}),
|
|
791
|
-
h === "video" && !!C && /* @__PURE__ */
|
|
784
|
+
h === "video" && !!C && /* @__PURE__ */ P(v, {
|
|
792
785
|
tone: "secondary",
|
|
793
786
|
className: "media-library-card--duration absolute bottom-2 left-2 bg-inverse-background text-inverse-foreground",
|
|
794
|
-
children: [/* @__PURE__ */
|
|
787
|
+
children: [/* @__PURE__ */ N(B, { className: "size-icon-sm fill-current" }), C]
|
|
795
788
|
}),
|
|
796
|
-
S && /* @__PURE__ */
|
|
789
|
+
S && /* @__PURE__ */ N(v, {
|
|
797
790
|
tone: "secondary",
|
|
798
791
|
className: "media-library-card--private absolute bottom-2 right-2 bg-card text-card-foreground",
|
|
799
|
-
children: /* @__PURE__ */
|
|
792
|
+
children: /* @__PURE__ */ N(z, { className: "size-icon-sm" })
|
|
800
793
|
})
|
|
801
794
|
]
|
|
802
795
|
}),
|
|
803
|
-
/* @__PURE__ */
|
|
796
|
+
/* @__PURE__ */ N("div", {
|
|
804
797
|
className: r("media-library-card--body", n === "compact" ? "p-surface-xs" : "p-surface"),
|
|
805
|
-
children: /* @__PURE__ */
|
|
798
|
+
children: /* @__PURE__ */ P(s, {
|
|
806
799
|
columns: 1,
|
|
807
800
|
gap: "xs",
|
|
808
|
-
children: [/* @__PURE__ */
|
|
801
|
+
children: [/* @__PURE__ */ N(a, {
|
|
809
802
|
tag: "div",
|
|
810
803
|
weight: "semibold",
|
|
811
804
|
className: "truncate",
|
|
812
805
|
children: g
|
|
813
|
-
}),
|
|
806
|
+
}), i && /* @__PURE__ */ P(c, {
|
|
814
807
|
direction: "horizontal",
|
|
815
808
|
align: "center",
|
|
816
809
|
justify: "between",
|
|
817
810
|
gap: "md",
|
|
818
811
|
className: "min-w-0",
|
|
819
|
-
children: [/* @__PURE__ */
|
|
812
|
+
children: [/* @__PURE__ */ N(m, {
|
|
820
813
|
value: b,
|
|
821
814
|
size: "xs",
|
|
822
815
|
className: "truncate",
|
|
823
816
|
emptyLabel: u.unknownSize
|
|
824
|
-
}), !!x && /* @__PURE__ */
|
|
817
|
+
}), !!x && /* @__PURE__ */ P(a, {
|
|
825
818
|
tag: "span",
|
|
826
819
|
size: "xs",
|
|
827
820
|
type: "secondary",
|
|
828
821
|
className: "inline-flex items-center gap-space-xs",
|
|
829
|
-
children: [/* @__PURE__ */
|
|
822
|
+
children: [/* @__PURE__ */ N(se, { className: "size-icon-sm" }), x]
|
|
830
823
|
})]
|
|
831
824
|
})]
|
|
832
825
|
})
|
|
@@ -835,81 +828,81 @@ function Fe({ item: e, selected: t = !1, density: n = "comfortable", showMeta: a
|
|
|
835
828
|
});
|
|
836
829
|
}
|
|
837
830
|
function Ie({ items: e, selectedSet: t, accessors: n, strings: s, onToggle: c, onDetails: l }) {
|
|
838
|
-
return /* @__PURE__ */
|
|
831
|
+
return /* @__PURE__ */ P("div", {
|
|
839
832
|
className: "media-library-list--component min-w-180",
|
|
840
|
-
children: [/* @__PURE__ */
|
|
833
|
+
children: [/* @__PURE__ */ P("div", {
|
|
841
834
|
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",
|
|
842
835
|
children: [
|
|
843
|
-
/* @__PURE__ */
|
|
844
|
-
/* @__PURE__ */
|
|
845
|
-
/* @__PURE__ */
|
|
846
|
-
/* @__PURE__ */
|
|
847
|
-
/* @__PURE__ */
|
|
848
|
-
/* @__PURE__ */
|
|
849
|
-
/* @__PURE__ */
|
|
850
|
-
/* @__PURE__ */
|
|
836
|
+
/* @__PURE__ */ N("span", {}),
|
|
837
|
+
/* @__PURE__ */ N("span", {}),
|
|
838
|
+
/* @__PURE__ */ N(i, { children: s.table.name }),
|
|
839
|
+
/* @__PURE__ */ N(i, { children: s.table.type }),
|
|
840
|
+
/* @__PURE__ */ N(i, { children: s.table.size }),
|
|
841
|
+
/* @__PURE__ */ N(i, { children: s.table.collection }),
|
|
842
|
+
/* @__PURE__ */ N(i, { children: s.table.used }),
|
|
843
|
+
/* @__PURE__ */ N("span", {})
|
|
851
844
|
]
|
|
852
845
|
}), e.map((e) => {
|
|
853
|
-
let
|
|
854
|
-
return /* @__PURE__ */
|
|
846
|
+
let i = n.getId(e), u = t.has(i), d = n.getType(e), f = n.getName(e), p = n.getSrc(e), h = n.getPublic(e) === !1;
|
|
847
|
+
return /* @__PURE__ */ P("div", {
|
|
855
848
|
"data-selected": u || void 0,
|
|
856
849
|
className: r("media-library-list--row relative grid grid-cols-[32px_42px_minmax(0,1fr)_86px_88px_120px_72px_34px] items-center gap-space-lg border-b border-border/60 px-row-x py-row-y last:border-b-0", "cursor-pointer rounded-inner transition-colors hover:bg-muted/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset", u && "bg-primary/10"),
|
|
857
|
-
onClick: () => c(
|
|
850
|
+
onClick: () => c(i),
|
|
858
851
|
children: [
|
|
859
|
-
/* @__PURE__ */
|
|
852
|
+
/* @__PURE__ */ N("button", {
|
|
860
853
|
type: "button",
|
|
861
854
|
"aria-label": f,
|
|
862
855
|
"aria-pressed": u,
|
|
863
856
|
className: r("media-library-list--select rounded-inner", je),
|
|
864
857
|
onClick: (e) => {
|
|
865
|
-
e.stopPropagation(), c(
|
|
858
|
+
e.stopPropagation(), c(i);
|
|
866
859
|
}
|
|
867
860
|
}),
|
|
868
|
-
/* @__PURE__ */
|
|
861
|
+
/* @__PURE__ */ N("span", {
|
|
869
862
|
className: r("inline-flex size-icon-lg items-center justify-center rounded-radius border border-border text-transparent", u && "border-primary bg-primary text-primary-foreground"),
|
|
870
863
|
"aria-hidden": "true",
|
|
871
|
-
children: /* @__PURE__ */
|
|
864
|
+
children: /* @__PURE__ */ N(re, { className: "size-icon-sm" })
|
|
872
865
|
}),
|
|
873
|
-
/* @__PURE__ */
|
|
866
|
+
/* @__PURE__ */ N(K, {
|
|
874
867
|
tint: n.getTint(e),
|
|
875
868
|
className: "size-9 rounded-inner",
|
|
876
|
-
children: p ? /* @__PURE__ */
|
|
869
|
+
children: p ? /* @__PURE__ */ N("img", {
|
|
877
870
|
src: p,
|
|
878
871
|
alt: "",
|
|
879
872
|
loading: "lazy",
|
|
880
873
|
className: "size-full object-cover"
|
|
881
|
-
}) : /* @__PURE__ */
|
|
874
|
+
}) : /* @__PURE__ */ N("div", {
|
|
882
875
|
className: "flex size-full items-center justify-center text-muted-foreground",
|
|
883
876
|
children: W(d, "size-icon")
|
|
884
877
|
})
|
|
885
878
|
}),
|
|
886
|
-
/* @__PURE__ */
|
|
879
|
+
/* @__PURE__ */ P(a, {
|
|
887
880
|
tag: "div",
|
|
888
881
|
weight: "semibold",
|
|
889
882
|
className: "flex min-w-0 items-center gap-space-xs truncate",
|
|
890
|
-
children: [f, h && /* @__PURE__ */
|
|
883
|
+
children: [f, h && /* @__PURE__ */ N(z, { className: "size-icon-sm shrink-0 text-muted-foreground" })]
|
|
891
884
|
}),
|
|
892
|
-
/* @__PURE__ */
|
|
885
|
+
/* @__PURE__ */ N(v, {
|
|
893
886
|
tone: "secondary",
|
|
894
887
|
children: G(d, s)
|
|
895
888
|
}),
|
|
896
|
-
/* @__PURE__ */
|
|
889
|
+
/* @__PURE__ */ N(m, {
|
|
897
890
|
value: n.getSize(e),
|
|
898
891
|
size: "xs",
|
|
899
892
|
emptyLabel: s.unknownSize
|
|
900
893
|
}),
|
|
901
|
-
/* @__PURE__ */
|
|
894
|
+
/* @__PURE__ */ N(a, {
|
|
902
895
|
size: "xs",
|
|
903
896
|
type: "secondary",
|
|
904
897
|
className: "truncate",
|
|
905
|
-
children: n.getCollection(e) || "
|
|
898
|
+
children: n.getCollection(e) || "—"
|
|
906
899
|
}),
|
|
907
|
-
/* @__PURE__ */
|
|
900
|
+
/* @__PURE__ */ N(a, {
|
|
908
901
|
size: "xs",
|
|
909
902
|
type: "secondary",
|
|
910
|
-
children: n.getUsageCount(e) ? n.getUsageCount(e) : "
|
|
903
|
+
children: n.getUsageCount(e) ? n.getUsageCount(e) : "—"
|
|
911
904
|
}),
|
|
912
|
-
/* @__PURE__ */
|
|
905
|
+
/* @__PURE__ */ N(o, {
|
|
913
906
|
type: "button",
|
|
914
907
|
tone: "secondary",
|
|
915
908
|
buttonStyle: "ghost",
|
|
@@ -918,100 +911,100 @@ function Ie({ items: e, selectedSet: t, accessors: n, strings: s, onToggle: c, o
|
|
|
918
911
|
className: "relative z-20",
|
|
919
912
|
"aria-label": V(s.cardDetails, { name: f }),
|
|
920
913
|
onClick: (e) => {
|
|
921
|
-
e.stopPropagation(), l(
|
|
914
|
+
e.stopPropagation(), l(i);
|
|
922
915
|
},
|
|
923
|
-
children: /* @__PURE__ */
|
|
916
|
+
children: /* @__PURE__ */ N(L, { className: "size-icon-md" })
|
|
924
917
|
})
|
|
925
918
|
]
|
|
926
|
-
},
|
|
919
|
+
}, i);
|
|
927
920
|
})]
|
|
928
921
|
});
|
|
929
922
|
}
|
|
930
|
-
function Le({ item: e, collections: t = [], accessors: n, strings: r, onClose:
|
|
923
|
+
function Le({ item: e, collections: t = [], accessors: n, strings: r, onClose: i, onUpdate: l, onRemove: u, onReplace: d, renderDetail: f }) {
|
|
931
924
|
if (!e) return null;
|
|
932
|
-
let p = n.getName(e), g = n.getType(e), _ = n.getSrc(e), C = n.getCollection(e) ?? t[0]?.value ?? "", w = n.getTags(e),
|
|
925
|
+
let p = n.getName(e), g = n.getType(e), _ = n.getSrc(e), C = n.getCollection(e) ?? t[0]?.value ?? "", w = n.getTags(e), ee = n.getPublic(e) ?? !0, T = f?.(e, {
|
|
933
926
|
accessors: n,
|
|
934
927
|
update: l,
|
|
935
928
|
remove: u,
|
|
936
929
|
replace: d,
|
|
937
|
-
close:
|
|
930
|
+
close: i
|
|
938
931
|
});
|
|
939
|
-
return
|
|
932
|
+
return T ? /* @__PURE__ */ N(M, { children: T }) : /* @__PURE__ */ P("aside", {
|
|
940
933
|
className: "media-library-detail-panel--component flex min-h-0 w-full flex-col border-l border-border bg-background @2xl/media-library:w-72",
|
|
941
|
-
children: [/* @__PURE__ */
|
|
934
|
+
children: [/* @__PURE__ */ N("div", {
|
|
942
935
|
className: "media-library-detail-panel--header border-b border-border p-surface",
|
|
943
|
-
children: /* @__PURE__ */
|
|
936
|
+
children: /* @__PURE__ */ P(c, {
|
|
944
937
|
direction: "horizontal",
|
|
945
938
|
align: "center",
|
|
946
939
|
gap: "md",
|
|
947
|
-
children: [/* @__PURE__ */
|
|
940
|
+
children: [/* @__PURE__ */ N(o, {
|
|
948
941
|
type: "button",
|
|
949
942
|
tone: "secondary",
|
|
950
943
|
buttonStyle: "ghost",
|
|
951
944
|
size: "sm",
|
|
952
945
|
iconOnly: !0,
|
|
953
946
|
"aria-label": r.detail.close,
|
|
954
|
-
onClick:
|
|
955
|
-
children: /* @__PURE__ */
|
|
956
|
-
}), /* @__PURE__ */
|
|
947
|
+
onClick: i,
|
|
948
|
+
children: /* @__PURE__ */ N(F, { className: "size-icon-md" })
|
|
949
|
+
}), /* @__PURE__ */ N(a, {
|
|
957
950
|
weight: "semibold",
|
|
958
951
|
children: r.detail.title
|
|
959
952
|
})]
|
|
960
953
|
})
|
|
961
|
-
}), /* @__PURE__ */
|
|
954
|
+
}), /* @__PURE__ */ P("div", {
|
|
962
955
|
className: "media-library-detail-panel--body grid min-h-0 gap-space-xl overflow-y-auto p-surface",
|
|
963
956
|
children: [
|
|
964
|
-
/* @__PURE__ */
|
|
957
|
+
/* @__PURE__ */ P(K, {
|
|
965
958
|
tint: n.getTint(e),
|
|
966
959
|
className: "aspect-[4/3] rounded-radius border border-border",
|
|
967
|
-
children: [/* @__PURE__ */
|
|
960
|
+
children: [/* @__PURE__ */ N(q, {
|
|
968
961
|
src: _,
|
|
969
962
|
alt: n.getAlt(e) || p,
|
|
970
963
|
type: g,
|
|
971
964
|
className: "size-full object-cover"
|
|
972
|
-
}), g === "video" && !!n.getDuration(e) && /* @__PURE__ */
|
|
965
|
+
}), g === "video" && !!n.getDuration(e) && /* @__PURE__ */ P(v, {
|
|
973
966
|
className: "absolute bottom-2 right-2 bg-inverse-background text-inverse-foreground",
|
|
974
|
-
children: [/* @__PURE__ */
|
|
967
|
+
children: [/* @__PURE__ */ N(B, { className: "size-icon-sm fill-current" }), n.getDuration(e)]
|
|
975
968
|
})]
|
|
976
969
|
}),
|
|
977
|
-
/* @__PURE__ */
|
|
970
|
+
/* @__PURE__ */ N(a, {
|
|
978
971
|
tag: "div",
|
|
979
972
|
weight: "semibold",
|
|
980
973
|
className: "break-words",
|
|
981
974
|
children: p
|
|
982
975
|
}),
|
|
983
|
-
/* @__PURE__ */
|
|
984
|
-
render: /* @__PURE__ */
|
|
976
|
+
/* @__PURE__ */ N(s, {
|
|
977
|
+
render: /* @__PURE__ */ N("dl", {}),
|
|
985
978
|
columns: 1,
|
|
986
979
|
gap: "md",
|
|
987
980
|
className: "media-library-detail-panel--facts",
|
|
988
981
|
children: [
|
|
989
982
|
[r.detail.type, G(g, r)],
|
|
990
|
-
[r.detail.size, /* @__PURE__ */
|
|
983
|
+
[r.detail.size, /* @__PURE__ */ N(m, {
|
|
991
984
|
value: n.getSize(e),
|
|
992
985
|
weight: "medium",
|
|
993
986
|
emptyLabel: r.unknownSize
|
|
994
987
|
})],
|
|
995
|
-
[r.detail.dimensions, /* @__PURE__ */
|
|
988
|
+
[r.detail.dimensions, /* @__PURE__ */ N(h, {
|
|
996
989
|
width: n.getWidth(e),
|
|
997
990
|
height: n.getHeight(e),
|
|
998
991
|
weight: "medium",
|
|
999
992
|
emptyLabel: r.unknownSize
|
|
1000
993
|
})],
|
|
1001
|
-
[r.detail.uploaded, String(n.getUploadedAt(e) ?? "
|
|
994
|
+
[r.detail.uploaded, String(n.getUploadedAt(e) ?? "—")],
|
|
1002
995
|
[r.detail.usedIn, Me(n.getUsageCount(e), r)]
|
|
1003
|
-
].map(([e, t]) => /* @__PURE__ */
|
|
996
|
+
].map(([e, t]) => /* @__PURE__ */ P(c, {
|
|
1004
997
|
direction: "horizontal",
|
|
1005
998
|
justify: "between",
|
|
1006
999
|
gap: "xl",
|
|
1007
|
-
children: [/* @__PURE__ */
|
|
1000
|
+
children: [/* @__PURE__ */ N("dt", { children: /* @__PURE__ */ N(a, {
|
|
1008
1001
|
tag: "span",
|
|
1009
1002
|
size: "xs",
|
|
1010
1003
|
type: "secondary",
|
|
1011
1004
|
children: e
|
|
1012
|
-
}) }), /* @__PURE__ */
|
|
1005
|
+
}) }), /* @__PURE__ */ N("dd", {
|
|
1013
1006
|
className: "m-0 text-right",
|
|
1014
|
-
children: typeof t == "string" ? /* @__PURE__ */
|
|
1007
|
+
children: typeof t == "string" ? /* @__PURE__ */ N(a, {
|
|
1015
1008
|
tag: "span",
|
|
1016
1009
|
weight: "medium",
|
|
1017
1010
|
children: t
|
|
@@ -1019,17 +1012,17 @@ function Le({ item: e, collections: t = [], accessors: n, strings: r, onClose: a
|
|
|
1019
1012
|
})]
|
|
1020
1013
|
}, e))
|
|
1021
1014
|
}),
|
|
1022
|
-
/* @__PURE__ */
|
|
1015
|
+
/* @__PURE__ */ N(b, {
|
|
1023
1016
|
label: r.detail.altText,
|
|
1024
|
-
children: /* @__PURE__ */
|
|
1017
|
+
children: /* @__PURE__ */ N(y, {
|
|
1025
1018
|
value: n.getAlt(e) ?? "",
|
|
1026
1019
|
placeholder: r.detail.altPlaceholder,
|
|
1027
1020
|
onChange: (e) => l({ alt: e.target.value })
|
|
1028
1021
|
})
|
|
1029
1022
|
}),
|
|
1030
|
-
/* @__PURE__ */
|
|
1023
|
+
/* @__PURE__ */ N(b, {
|
|
1031
1024
|
label: r.detail.collection,
|
|
1032
|
-
children: /* @__PURE__ */
|
|
1025
|
+
children: /* @__PURE__ */ N(x, {
|
|
1033
1026
|
value: C,
|
|
1034
1027
|
options: t.map((e) => ({
|
|
1035
1028
|
value: e.value,
|
|
@@ -1039,177 +1032,177 @@ function Le({ item: e, collections: t = [], accessors: n, strings: r, onClose: a
|
|
|
1039
1032
|
onValueChange: (e) => l({ collection: e })
|
|
1040
1033
|
})
|
|
1041
1034
|
}),
|
|
1042
|
-
/* @__PURE__ */
|
|
1035
|
+
/* @__PURE__ */ N(b, {
|
|
1043
1036
|
label: r.detail.tags,
|
|
1044
|
-
children: /* @__PURE__ */
|
|
1037
|
+
children: /* @__PURE__ */ N(y, {
|
|
1045
1038
|
value: w.join(", "),
|
|
1046
1039
|
placeholder: r.detail.tagsPlaceholder,
|
|
1047
1040
|
onChange: (e) => l({ tags: e.target.value.split(",").map((e) => e.trim()).filter(Boolean) })
|
|
1048
1041
|
})
|
|
1049
1042
|
}),
|
|
1050
|
-
/* @__PURE__ */
|
|
1051
|
-
className: "media-library-detail-panel--public
|
|
1052
|
-
children: /* @__PURE__ */
|
|
1043
|
+
/* @__PURE__ */ N("div", {
|
|
1044
|
+
className: "media-library-detail-panel--public",
|
|
1045
|
+
children: /* @__PURE__ */ P(c, {
|
|
1053
1046
|
direction: "horizontal",
|
|
1054
1047
|
align: "center",
|
|
1055
1048
|
justify: "between",
|
|
1056
1049
|
gap: "xl",
|
|
1057
|
-
children: [/* @__PURE__ */
|
|
1050
|
+
children: [/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(a, {
|
|
1058
1051
|
weight: "semibold",
|
|
1059
1052
|
children: r.detail.public
|
|
1060
|
-
}), /* @__PURE__ */
|
|
1053
|
+
}), /* @__PURE__ */ N(a, {
|
|
1061
1054
|
size: "xs",
|
|
1062
1055
|
type: "secondary",
|
|
1063
|
-
children:
|
|
1064
|
-
})] }), /* @__PURE__ */
|
|
1056
|
+
children: ee ? r.detail.publicHint : r.detail.privateHint
|
|
1057
|
+
})] }), /* @__PURE__ */ N(S, {
|
|
1065
1058
|
"aria-label": r.detail.public,
|
|
1066
|
-
checked:
|
|
1059
|
+
checked: ee,
|
|
1067
1060
|
onValueChange: (e) => l({ public: e })
|
|
1068
1061
|
})]
|
|
1069
1062
|
})
|
|
1070
1063
|
}),
|
|
1071
|
-
/* @__PURE__ */
|
|
1064
|
+
/* @__PURE__ */ P("div", {
|
|
1072
1065
|
className: "media-library-detail-panel--actions flex flex-wrap gap-space-md",
|
|
1073
|
-
children: [d && /* @__PURE__ */
|
|
1066
|
+
children: [d && /* @__PURE__ */ N(o, {
|
|
1074
1067
|
type: "button",
|
|
1075
1068
|
tone: "secondary",
|
|
1076
1069
|
buttonStyle: "outline",
|
|
1077
1070
|
onClick: d,
|
|
1078
|
-
children:
|
|
1079
|
-
}), /* @__PURE__ */
|
|
1071
|
+
children: r.detail.replace
|
|
1072
|
+
}), /* @__PURE__ */ N(o, {
|
|
1080
1073
|
type: "button",
|
|
1081
1074
|
tone: "destructive",
|
|
1082
1075
|
buttonStyle: "ghost",
|
|
1083
1076
|
onClick: u,
|
|
1084
|
-
children:
|
|
1077
|
+
children: r.detail.delete
|
|
1085
1078
|
})]
|
|
1086
1079
|
})
|
|
1087
1080
|
]
|
|
1088
1081
|
})]
|
|
1089
1082
|
});
|
|
1090
1083
|
}
|
|
1091
|
-
function Re({ stagedFiles: e, uploadOptions: t, collections: n = [], uploading: r = !1, strings:
|
|
1092
|
-
return /* @__PURE__ */
|
|
1084
|
+
function Re({ stagedFiles: e, uploadOptions: t, collections: n = [], uploading: r = !1, strings: i, onFiles: s, onRemoveFile: l, onOptionsChange: u, empty: d }) {
|
|
1085
|
+
return /* @__PURE__ */ N("div", {
|
|
1093
1086
|
className: "media-library-upload-panel--component p-surface",
|
|
1094
|
-
children: /* @__PURE__ */
|
|
1087
|
+
children: /* @__PURE__ */ P(c, {
|
|
1095
1088
|
gap: "xl",
|
|
1096
1089
|
children: [
|
|
1097
|
-
/* @__PURE__ */
|
|
1090
|
+
/* @__PURE__ */ N(ee, {
|
|
1098
1091
|
onDrop: s,
|
|
1099
1092
|
accept: "image/*,video/*",
|
|
1100
1093
|
multiple: !0,
|
|
1101
1094
|
size: "md",
|
|
1102
1095
|
strings: {
|
|
1103
|
-
instruction:
|
|
1104
|
-
helper:
|
|
1105
|
-
dragOver:
|
|
1096
|
+
instruction: i.upload.dropTitle,
|
|
1097
|
+
helper: i.upload.dropHint,
|
|
1098
|
+
dragOver: i.upload.dragOver
|
|
1106
1099
|
}
|
|
1107
1100
|
}),
|
|
1108
|
-
e.length > 0 ? /* @__PURE__ */
|
|
1101
|
+
e.length > 0 ? /* @__PURE__ */ N(c, {
|
|
1109
1102
|
gap: "md",
|
|
1110
1103
|
className: "media-library-upload-panel--staged",
|
|
1111
|
-
children: e.map((e) => /* @__PURE__ */
|
|
1104
|
+
children: e.map((e) => /* @__PURE__ */ P("div", {
|
|
1112
1105
|
className: "media-library-upload-panel--staged-file flex items-center gap-space-lg rounded-radius border border-border bg-card px-row-x py-row-y",
|
|
1113
1106
|
children: [
|
|
1114
|
-
/* @__PURE__ */
|
|
1107
|
+
/* @__PURE__ */ N(K, {
|
|
1115
1108
|
className: "size-10 rounded-inner",
|
|
1116
|
-
children: e.src ? /* @__PURE__ */
|
|
1109
|
+
children: e.src ? /* @__PURE__ */ N("img", {
|
|
1117
1110
|
src: e.src,
|
|
1118
1111
|
alt: e.name,
|
|
1119
1112
|
className: "size-full object-cover"
|
|
1120
|
-
}) : /* @__PURE__ */
|
|
1113
|
+
}) : /* @__PURE__ */ N("div", {
|
|
1121
1114
|
className: "flex size-full items-center justify-center text-muted-foreground",
|
|
1122
1115
|
children: W(e.type, "size-icon")
|
|
1123
1116
|
})
|
|
1124
1117
|
}),
|
|
1125
|
-
/* @__PURE__ */
|
|
1118
|
+
/* @__PURE__ */ P("div", {
|
|
1126
1119
|
className: "min-w-0 flex-1",
|
|
1127
1120
|
children: [
|
|
1128
|
-
/* @__PURE__ */
|
|
1121
|
+
/* @__PURE__ */ P("div", {
|
|
1129
1122
|
className: "flex items-baseline gap-space-lg",
|
|
1130
|
-
children: [/* @__PURE__ */
|
|
1123
|
+
children: [/* @__PURE__ */ N(a, {
|
|
1131
1124
|
weight: "semibold",
|
|
1132
1125
|
className: "truncate",
|
|
1133
1126
|
children: e.name
|
|
1134
|
-
}), /* @__PURE__ */
|
|
1127
|
+
}), /* @__PURE__ */ N(m, {
|
|
1135
1128
|
value: e.size,
|
|
1136
1129
|
size: "xs",
|
|
1137
1130
|
className: "ml-auto shrink-0"
|
|
1138
1131
|
})]
|
|
1139
1132
|
}),
|
|
1140
|
-
(e.status === "uploading" || e.status === "done") && /* @__PURE__ */
|
|
1133
|
+
(e.status === "uploading" || e.status === "done") && /* @__PURE__ */ N("div", {
|
|
1141
1134
|
className: "mt-space-md h-1 overflow-hidden rounded-full bg-muted",
|
|
1142
|
-
children: /* @__PURE__ */
|
|
1135
|
+
children: /* @__PURE__ */ N("div", {
|
|
1143
1136
|
className: "h-full rounded-full bg-primary transition-[width]",
|
|
1144
1137
|
style: { width: `${e.progress}%` }
|
|
1145
1138
|
})
|
|
1146
1139
|
}),
|
|
1147
|
-
e.status === "error" && /* @__PURE__ */
|
|
1140
|
+
e.status === "error" && /* @__PURE__ */ N(a, {
|
|
1148
1141
|
type: "error",
|
|
1149
1142
|
children: e.error
|
|
1150
1143
|
})
|
|
1151
1144
|
]
|
|
1152
1145
|
}),
|
|
1153
|
-
e.status === "done" ? /* @__PURE__ */
|
|
1146
|
+
e.status === "done" ? /* @__PURE__ */ N(v, {
|
|
1154
1147
|
tone: "success",
|
|
1155
|
-
children:
|
|
1156
|
-
}) : e.status === "uploading" ? /* @__PURE__ */
|
|
1148
|
+
children: i.upload.done
|
|
1149
|
+
}) : e.status === "uploading" ? /* @__PURE__ */ N(g, {
|
|
1157
1150
|
value: Math.round(e.progress),
|
|
1158
1151
|
scaled: !0,
|
|
1159
1152
|
size: "xs",
|
|
1160
1153
|
type: "secondary"
|
|
1161
|
-
}) : /* @__PURE__ */
|
|
1154
|
+
}) : /* @__PURE__ */ N(o, {
|
|
1162
1155
|
type: "button",
|
|
1163
1156
|
tone: "secondary",
|
|
1164
1157
|
buttonStyle: "ghost",
|
|
1165
1158
|
size: "sm",
|
|
1166
1159
|
iconOnly: !0,
|
|
1167
1160
|
disabled: r,
|
|
1168
|
-
"aria-label": V(
|
|
1161
|
+
"aria-label": V(i.upload.removeFile, { name: e.name }),
|
|
1169
1162
|
onClick: () => l(e.id),
|
|
1170
|
-
children: /* @__PURE__ */
|
|
1163
|
+
children: /* @__PURE__ */ N(me, { className: "size-icon-md" })
|
|
1171
1164
|
})
|
|
1172
1165
|
]
|
|
1173
1166
|
}, e.id))
|
|
1174
1167
|
}) : d,
|
|
1175
|
-
/* @__PURE__ */
|
|
1176
|
-
className: "media-library-upload-panel--options grid gap-space-lg
|
|
1168
|
+
/* @__PURE__ */ P("div", {
|
|
1169
|
+
className: "media-library-upload-panel--options grid gap-space-lg @2xl/media-library:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto]",
|
|
1177
1170
|
children: [
|
|
1178
|
-
/* @__PURE__ */
|
|
1179
|
-
label:
|
|
1180
|
-
children: /* @__PURE__ */
|
|
1171
|
+
/* @__PURE__ */ N(b, {
|
|
1172
|
+
label: i.upload.collection,
|
|
1173
|
+
children: /* @__PURE__ */ N(x, {
|
|
1181
1174
|
value: t.collection ?? n[0]?.value,
|
|
1182
1175
|
options: n.map((e) => ({
|
|
1183
1176
|
value: e.value,
|
|
1184
1177
|
label: String(e.label)
|
|
1185
1178
|
})),
|
|
1186
|
-
"aria-label":
|
|
1179
|
+
"aria-label": i.upload.collection,
|
|
1187
1180
|
onValueChange: (e) => u({ collection: e })
|
|
1188
1181
|
})
|
|
1189
1182
|
}),
|
|
1190
|
-
/* @__PURE__ */
|
|
1191
|
-
label:
|
|
1192
|
-
children: /* @__PURE__ */
|
|
1183
|
+
/* @__PURE__ */ N(b, {
|
|
1184
|
+
label: i.upload.tags,
|
|
1185
|
+
children: /* @__PURE__ */ N(y, {
|
|
1193
1186
|
value: t.tags.join(", "),
|
|
1194
|
-
placeholder:
|
|
1187
|
+
placeholder: i.upload.tagsPlaceholder,
|
|
1195
1188
|
onChange: (e) => u({ tags: e.target.value.split(",").map((e) => e.trim()).filter(Boolean) })
|
|
1196
1189
|
})
|
|
1197
1190
|
}),
|
|
1198
|
-
/* @__PURE__ */
|
|
1191
|
+
/* @__PURE__ */ P(c, {
|
|
1199
1192
|
direction: "horizontal",
|
|
1200
1193
|
align: "center",
|
|
1201
1194
|
justify: "between",
|
|
1202
1195
|
gap: "xl",
|
|
1203
1196
|
className: "@2xl/media-library:self-end",
|
|
1204
|
-
children: [/* @__PURE__ */
|
|
1197
|
+
children: [/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N(a, {
|
|
1205
1198
|
weight: "semibold",
|
|
1206
|
-
children:
|
|
1207
|
-
}), /* @__PURE__ */
|
|
1199
|
+
children: i.upload.public
|
|
1200
|
+
}), /* @__PURE__ */ N(a, {
|
|
1208
1201
|
size: "xs",
|
|
1209
1202
|
type: "secondary",
|
|
1210
|
-
children:
|
|
1211
|
-
})] }), /* @__PURE__ */
|
|
1212
|
-
"aria-label":
|
|
1203
|
+
children: i.upload.publicHint
|
|
1204
|
+
})] }), /* @__PURE__ */ N(S, {
|
|
1205
|
+
"aria-label": i.upload.public,
|
|
1213
1206
|
checked: t.public,
|
|
1214
1207
|
onValueChange: (e) => u({ public: e })
|
|
1215
1208
|
})]
|
|
@@ -1220,12 +1213,12 @@ function Re({ stagedFiles: e, uploadOptions: t, collections: n = [], uploading:
|
|
|
1220
1213
|
})
|
|
1221
1214
|
});
|
|
1222
1215
|
}
|
|
1223
|
-
function J({ tab: e, selectedIds: t, selectionMode: n, stagedFiles:
|
|
1224
|
-
let u = t.length, d =
|
|
1225
|
-
return e === "upload" ? /* @__PURE__ */
|
|
1216
|
+
function J({ tab: e, selectedIds: t, selectionMode: n, stagedFiles: i, strings: s, onClearSelection: c, className: l }) {
|
|
1217
|
+
let u = t.length, d = i.reduce((e, t) => e + t.size, 0), f = i.length, m = r("media-library-footer-summary--component flex min-w-0 items-center gap-space-lg", l);
|
|
1218
|
+
return e === "upload" ? /* @__PURE__ */ N("div", {
|
|
1226
1219
|
className: m,
|
|
1227
1220
|
"aria-live": "polite",
|
|
1228
|
-
children: /* @__PURE__ */
|
|
1221
|
+
children: /* @__PURE__ */ N(a, {
|
|
1229
1222
|
size: "xs",
|
|
1230
1223
|
type: "secondary",
|
|
1231
1224
|
className: "truncate",
|
|
@@ -1234,21 +1227,21 @@ function J({ tab: e, selectedIds: t, selectionMode: n, stagedFiles: a, strings:
|
|
|
1234
1227
|
size: p(d) ?? s.unknownSize
|
|
1235
1228
|
})
|
|
1236
1229
|
})
|
|
1237
|
-
}) : /* @__PURE__ */
|
|
1230
|
+
}) : /* @__PURE__ */ N("div", {
|
|
1238
1231
|
className: m,
|
|
1239
1232
|
"aria-live": "polite",
|
|
1240
|
-
children: u > 0 ? /* @__PURE__ */
|
|
1233
|
+
children: u > 0 ? /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(a, {
|
|
1241
1234
|
weight: "semibold",
|
|
1242
1235
|
className: "whitespace-nowrap",
|
|
1243
1236
|
children: V(s.footer.selectedCount, { count: u })
|
|
1244
|
-
}), /* @__PURE__ */
|
|
1237
|
+
}), /* @__PURE__ */ N(o, {
|
|
1245
1238
|
type: "button",
|
|
1246
1239
|
tone: "secondary",
|
|
1247
1240
|
buttonStyle: "ghost",
|
|
1248
1241
|
size: "sm",
|
|
1249
1242
|
onClick: c,
|
|
1250
1243
|
children: s.footer.clear
|
|
1251
|
-
})] }) : /* @__PURE__ */
|
|
1244
|
+
})] }) : /* @__PURE__ */ N(a, {
|
|
1252
1245
|
size: "xs",
|
|
1253
1246
|
type: "secondary",
|
|
1254
1247
|
className: "truncate",
|
|
@@ -1258,16 +1251,17 @@ function J({ tab: e, selectedIds: t, selectionMode: n, stagedFiles: a, strings:
|
|
|
1258
1251
|
}
|
|
1259
1252
|
function Y({ tab: e, selectedItems: t, selectedIds: n, stagedFiles: i, uploading: a = !1, strings: s, confirmLabel: c, cancelLabel: l, onCancel: u, onConfirm: d, onUpload: f, onCancelUpload: p, className: m }) {
|
|
1260
1253
|
let h = n.length, g = i.length;
|
|
1261
|
-
return e === "upload" ? /* @__PURE__ */
|
|
1254
|
+
return e === "upload" ? /* @__PURE__ */ P("div", {
|
|
1262
1255
|
className: r("media-library-footer-actions--component flex min-w-0 flex-col-reverse gap-space-md @md/media-library:flex-row @md/media-library:justify-end", m),
|
|
1263
|
-
children: [/* @__PURE__ */
|
|
1256
|
+
children: [/* @__PURE__ */ N(o, {
|
|
1264
1257
|
type: "button",
|
|
1265
1258
|
tone: "secondary",
|
|
1266
1259
|
buttonStyle: "ghost",
|
|
1267
1260
|
disabled: a,
|
|
1268
1261
|
onClick: p,
|
|
1269
1262
|
children: l ?? s.footer.cancel
|
|
1270
|
-
}), /* @__PURE__ */
|
|
1263
|
+
}), /* @__PURE__ */ N(o, {
|
|
1264
|
+
tone: "primary",
|
|
1271
1265
|
type: "button",
|
|
1272
1266
|
disabled: g === 0 || a,
|
|
1273
1267
|
onClick: f,
|
|
@@ -1275,15 +1269,16 @@ function Y({ tab: e, selectedItems: t, selectedIds: n, stagedFiles: i, uploading
|
|
|
1275
1269
|
strings: { loading: s.footer.uploading },
|
|
1276
1270
|
children: g <= 1 ? s.footer.upload : V(s.footer.uploadMany, { count: g })
|
|
1277
1271
|
})]
|
|
1278
|
-
}) : /* @__PURE__ */
|
|
1272
|
+
}) : /* @__PURE__ */ P("div", {
|
|
1279
1273
|
className: r("media-library-footer-actions--component flex min-w-0 flex-col-reverse gap-space-md @md/media-library:flex-row @md/media-library:justify-end", m),
|
|
1280
|
-
children: [/* @__PURE__ */
|
|
1274
|
+
children: [/* @__PURE__ */ N(o, {
|
|
1281
1275
|
type: "button",
|
|
1282
1276
|
tone: "secondary",
|
|
1283
1277
|
buttonStyle: "ghost",
|
|
1284
1278
|
onClick: u,
|
|
1285
1279
|
children: l ?? s.footer.cancel
|
|
1286
|
-
}), /* @__PURE__ */
|
|
1280
|
+
}), /* @__PURE__ */ N(o, {
|
|
1281
|
+
tone: "primary",
|
|
1287
1282
|
type: "button",
|
|
1288
1283
|
disabled: h === 0,
|
|
1289
1284
|
onClick: d,
|
|
@@ -1292,18 +1287,18 @@ function Y({ tab: e, selectedItems: t, selectedIds: n, stagedFiles: i, uploading
|
|
|
1292
1287
|
});
|
|
1293
1288
|
}
|
|
1294
1289
|
function ze({ 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 }) {
|
|
1295
|
-
return /* @__PURE__ */
|
|
1290
|
+
return /* @__PURE__ */ N("footer", {
|
|
1296
1291
|
className: r("media-library-footer--component", h === "section" && "border-t border-border bg-background p-surface", g),
|
|
1297
|
-
children: /* @__PURE__ */
|
|
1292
|
+
children: /* @__PURE__ */ P("div", {
|
|
1298
1293
|
className: "flex min-w-0 flex-col gap-space-lg @md/media-library:flex-row @md/media-library:justify-between",
|
|
1299
|
-
children: [/* @__PURE__ */
|
|
1294
|
+
children: [/* @__PURE__ */ N(J, {
|
|
1300
1295
|
tab: e,
|
|
1301
1296
|
selectedIds: n,
|
|
1302
1297
|
selectionMode: i,
|
|
1303
1298
|
stagedFiles: a,
|
|
1304
1299
|
strings: s,
|
|
1305
1300
|
onClearSelection: f
|
|
1306
|
-
}), /* @__PURE__ */
|
|
1301
|
+
}), /* @__PURE__ */ N(Y, {
|
|
1307
1302
|
tab: e,
|
|
1308
1303
|
selectedItems: t,
|
|
1309
1304
|
selectedIds: n,
|
|
@@ -1322,9 +1317,9 @@ function ze({ tab: e, selectedItems: t, selectedIds: n, selectionMode: i, staged
|
|
|
1322
1317
|
}
|
|
1323
1318
|
//#endregion
|
|
1324
1319
|
//#region src/components/features/media-library/media-library.tsx
|
|
1325
|
-
var X =
|
|
1320
|
+
var X = E(null);
|
|
1326
1321
|
function Be(e, t, n) {
|
|
1327
|
-
return
|
|
1322
|
+
return k(() => {
|
|
1328
1323
|
if (e) return e;
|
|
1329
1324
|
let r = /* @__PURE__ */ new Set();
|
|
1330
1325
|
for (let e of t) {
|
|
@@ -1341,21 +1336,21 @@ function Be(e, t, n) {
|
|
|
1341
1336
|
t
|
|
1342
1337
|
]);
|
|
1343
1338
|
}
|
|
1344
|
-
function Z({ title:
|
|
1345
|
-
let { defaultScale: ke } = t(), je = e(void 0, ke), W = n(ge,
|
|
1346
|
-
items:
|
|
1347
|
-
fetcher:
|
|
1348
|
-
accessors:
|
|
1349
|
-
collections:
|
|
1339
|
+
function Z({ title: i, titleSuffix: s, description: f, confirmLabel: p, cancelLabel: m, selectionMode: h = "multiple", density: g = "comfortable", showMeta: v = !0, allowUpload: y = !0, typeFilters: b, confirmOnSelect: x = !1, onConfirm: S, onCancel: ee, onClose: T, strings: E, slots: D, heightClassName: O, className: k, items: A, fetcher: j, accessors: M, collections: F, value: ne, defaultValue: re, onValueChange: ie, onItemUpdate: ae, onItemDelete: oe, onItemReplace: L, onUpload: se, onError: R, tab: z, defaultTab: B, onTabChange: ce, view: le, defaultView: ue, onViewChange: de, query: pe, defaultQuery: me, onQueryChange: _e, type: ve, defaultType: H, onTypeChange: ye, collection: be, defaultCollection: xe, onCollectionChange: U, sort: Se, defaultSort: Ce, onSortChange: we, uploadOptions: Te, defaultUploadOptions: Ee, onUploadOptionsChange: De, ...Oe }) {
|
|
1340
|
+
let { defaultScale: ke } = t(), je = e(void 0, ke), W = n(ge, E), G = Ae({
|
|
1341
|
+
items: A,
|
|
1342
|
+
fetcher: j,
|
|
1343
|
+
accessors: M,
|
|
1344
|
+
collections: F,
|
|
1350
1345
|
selectionMode: h,
|
|
1351
|
-
value:
|
|
1352
|
-
defaultValue:
|
|
1353
|
-
onValueChange:
|
|
1354
|
-
onItemUpdate:
|
|
1355
|
-
onItemDelete:
|
|
1356
|
-
onUpload:
|
|
1357
|
-
onError:
|
|
1358
|
-
tab:
|
|
1346
|
+
value: ne,
|
|
1347
|
+
defaultValue: re,
|
|
1348
|
+
onValueChange: ie,
|
|
1349
|
+
onItemUpdate: ae,
|
|
1350
|
+
onItemDelete: oe,
|
|
1351
|
+
onUpload: se,
|
|
1352
|
+
onError: R,
|
|
1353
|
+
tab: z,
|
|
1359
1354
|
defaultTab: B,
|
|
1360
1355
|
onTabChange: ce,
|
|
1361
1356
|
view: le,
|
|
@@ -1376,7 +1371,7 @@ function Z({ title: a, titleSuffix: s, description: f, confirmLabel: p, cancelLa
|
|
|
1376
1371
|
uploadOptions: Te,
|
|
1377
1372
|
defaultUploadOptions: Ee,
|
|
1378
1373
|
onUploadOptionsChange: De
|
|
1379
|
-
}), Me = Be(
|
|
1374
|
+
}), Me = Be(F, G.items, G.accessors.getCollection), K = y ? G.tab : "library", q = G.detailId ? G.items.find((e) => G.accessors.getId(e) === G.detailId) ?? null : null, Z = te(X), Q = !D?.footer, Ve = Z && Q ? /* @__PURE__ */ N(J, {
|
|
1380
1375
|
tab: K,
|
|
1381
1376
|
selectedIds: G.selectedIds,
|
|
1382
1377
|
selectionMode: h,
|
|
@@ -1384,13 +1379,13 @@ function Z({ title: a, titleSuffix: s, description: f, confirmLabel: p, cancelLa
|
|
|
1384
1379
|
strings: W,
|
|
1385
1380
|
onClearSelection: G.clearSelection,
|
|
1386
1381
|
className: "media-library-dialog--selection-summary shrink-0 justify-end"
|
|
1387
|
-
}) : null, He = !!(
|
|
1388
|
-
S?.(G.selectedItems, G.selectedIds),
|
|
1382
|
+
}) : null, He = !!(i || s || f || D?.headerStart), Ue = !!(y || D?.headerEnd || Ve), We = He || Ue, Ge = () => {
|
|
1383
|
+
S?.(G.selectedItems, G.selectedIds), T?.();
|
|
1389
1384
|
}, $ = () => {
|
|
1390
|
-
|
|
1385
|
+
ee?.(), T?.();
|
|
1391
1386
|
}, Ke = (e) => {
|
|
1392
1387
|
let t = G.accessors.getId(e);
|
|
1393
|
-
G.toggleSelection(t), x && (S?.([e], [t]),
|
|
1388
|
+
G.toggleSelection(t), x && (S?.([e], [t]), T?.());
|
|
1394
1389
|
}, qe = G.query.trim(), Je = qe.length > 0 ? V(W.countSearch, {
|
|
1395
1390
|
count: G.filteredCount,
|
|
1396
1391
|
total: G.totalCount,
|
|
@@ -1398,7 +1393,7 @@ function Z({ title: a, titleSuffix: s, description: f, confirmLabel: p, cancelLa
|
|
|
1398
1393
|
}) : G.filteredCount === G.totalCount ? V(W.countAll, { count: G.totalCount }) : V(W.countFiltered, {
|
|
1399
1394
|
count: G.filteredCount,
|
|
1400
1395
|
total: G.totalCount
|
|
1401
|
-
}), Ye =
|
|
1396
|
+
}), Ye = D?.footer ?? (Z ? /* @__PURE__ */ N(Y, {
|
|
1402
1397
|
tab: K,
|
|
1403
1398
|
selectedItems: G.selectedItems,
|
|
1404
1399
|
selectedIds: G.selectedIds,
|
|
@@ -1414,7 +1409,7 @@ function Z({ title: a, titleSuffix: s, description: f, confirmLabel: p, cancelLa
|
|
|
1414
1409
|
G.cancelUpload(), G.clearStagedFiles(), G.setTab("library");
|
|
1415
1410
|
},
|
|
1416
1411
|
className: "ml-auto"
|
|
1417
|
-
}) : /* @__PURE__ */
|
|
1412
|
+
}) : /* @__PURE__ */ N(ze, {
|
|
1418
1413
|
tab: K,
|
|
1419
1414
|
selectedItems: G.selectedItems,
|
|
1420
1415
|
selectedIds: G.selectedIds,
|
|
@@ -1432,63 +1427,63 @@ function Z({ title: a, titleSuffix: s, description: f, confirmLabel: p, cancelLa
|
|
|
1432
1427
|
G.cancelUpload(), G.clearStagedFiles(), G.setTab("library");
|
|
1433
1428
|
}
|
|
1434
1429
|
}));
|
|
1435
|
-
return /* @__PURE__ */
|
|
1436
|
-
className: r("media-library--component @container/media-library flex min-h-0 flex-col overflow-hidden rounded-radius border border-border bg-background",
|
|
1430
|
+
return /* @__PURE__ */ P("section", {
|
|
1431
|
+
className: r("media-library--component @container/media-library flex min-h-0 flex-col overflow-hidden rounded-radius border border-border bg-background", O ?? "h-190 max-h-[calc(100vh-7rem)]", k),
|
|
1437
1432
|
...Oe,
|
|
1438
1433
|
children: [
|
|
1439
|
-
We && /* @__PURE__ */
|
|
1434
|
+
We && /* @__PURE__ */ P("header", {
|
|
1440
1435
|
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",
|
|
1441
|
-
children: [He && /* @__PURE__ */
|
|
1436
|
+
children: [He && /* @__PURE__ */ P(c, {
|
|
1442
1437
|
direction: "horizontal",
|
|
1443
1438
|
align: "start",
|
|
1444
1439
|
gap: "lg",
|
|
1445
1440
|
className: "min-w-0",
|
|
1446
|
-
children: [
|
|
1441
|
+
children: [D?.headerStart, (i || s || f) && /* @__PURE__ */ P(c, {
|
|
1447
1442
|
gap: "normal",
|
|
1448
1443
|
className: "min-w-0",
|
|
1449
|
-
children: [!!(
|
|
1450
|
-
title:
|
|
1444
|
+
children: [!!(i || s) && /* @__PURE__ */ N(l, {
|
|
1445
|
+
title: i,
|
|
1451
1446
|
suffix: s,
|
|
1452
1447
|
className: "media-library--title"
|
|
1453
|
-
}), !!f && /* @__PURE__ */
|
|
1448
|
+
}), !!f && /* @__PURE__ */ N(a, {
|
|
1454
1449
|
type: "secondary",
|
|
1455
1450
|
children: f
|
|
1456
1451
|
})]
|
|
1457
1452
|
})]
|
|
1458
|
-
}), Ue && /* @__PURE__ */
|
|
1453
|
+
}), Ue && /* @__PURE__ */ P("div", {
|
|
1459
1454
|
className: r("media-library--header-controls flex min-w-0 flex-wrap items-center gap-space-md", Ve ? "flex-1 justify-between" : "@2xl/media-library:justify-end"),
|
|
1460
|
-
children: [/* @__PURE__ */
|
|
1455
|
+
children: [/* @__PURE__ */ P(c, {
|
|
1461
1456
|
direction: "horizontal",
|
|
1462
1457
|
wrap: !0,
|
|
1463
1458
|
align: "center",
|
|
1464
1459
|
gap: "md",
|
|
1465
1460
|
className: "min-w-0",
|
|
1466
|
-
children: [y && /* @__PURE__ */
|
|
1467
|
-
className: r("media-library--tabs",
|
|
1461
|
+
children: [y && /* @__PURE__ */ P("div", {
|
|
1462
|
+
className: r("media-library--tabs", C.frame, w[je]),
|
|
1468
1463
|
role: "tablist",
|
|
1469
|
-
children: [/* @__PURE__ */
|
|
1464
|
+
children: [/* @__PURE__ */ P(o, {
|
|
1470
1465
|
type: "button",
|
|
1471
1466
|
role: "tab",
|
|
1472
1467
|
"aria-selected": K === "library",
|
|
1473
1468
|
tone: "secondary",
|
|
1474
1469
|
buttonStyle: "ghost",
|
|
1475
1470
|
size: "sm",
|
|
1476
|
-
className: r(
|
|
1471
|
+
className: r(C.item, "shadow-none", K === "library" ? "bg-background text-foreground shadow-xs hover:bg-background" : "text-muted-foreground hover:bg-transparent hover:text-foreground"),
|
|
1477
1472
|
onClick: () => G.setTab("library"),
|
|
1478
|
-
children: [/* @__PURE__ */
|
|
1479
|
-
}), /* @__PURE__ */
|
|
1473
|
+
children: [/* @__PURE__ */ N(I, { className: "size-icon-md" }), W.tabs.library]
|
|
1474
|
+
}), /* @__PURE__ */ P(o, {
|
|
1480
1475
|
type: "button",
|
|
1481
1476
|
role: "tab",
|
|
1482
1477
|
"aria-selected": K === "upload",
|
|
1483
1478
|
tone: "secondary",
|
|
1484
1479
|
buttonStyle: "ghost",
|
|
1485
1480
|
size: "sm",
|
|
1486
|
-
className: r(
|
|
1481
|
+
className: r(C.item, "shadow-none", K === "upload" ? "bg-background text-foreground shadow-xs hover:bg-background" : "text-muted-foreground hover:bg-transparent hover:text-foreground"),
|
|
1487
1482
|
onClick: () => G.setTab("upload"),
|
|
1488
1483
|
children: [
|
|
1489
|
-
/* @__PURE__ */
|
|
1484
|
+
/* @__PURE__ */ N(fe, { className: "size-icon-md" }),
|
|
1490
1485
|
W.tabs.upload,
|
|
1491
|
-
G.stagedFiles.length > 0 && /* @__PURE__ */
|
|
1486
|
+
G.stagedFiles.length > 0 && /* @__PURE__ */ N(_, {
|
|
1492
1487
|
value: G.stagedFiles.length,
|
|
1493
1488
|
size: "xs",
|
|
1494
1489
|
align: "center",
|
|
@@ -1496,15 +1491,15 @@ function Z({ title: a, titleSuffix: s, description: f, confirmLabel: p, cancelLa
|
|
|
1496
1491
|
})
|
|
1497
1492
|
]
|
|
1498
1493
|
})]
|
|
1499
|
-
}),
|
|
1494
|
+
}), D?.headerEnd]
|
|
1500
1495
|
}), Ve]
|
|
1501
1496
|
})]
|
|
1502
1497
|
}),
|
|
1503
|
-
/* @__PURE__ */
|
|
1498
|
+
/* @__PURE__ */ P("div", {
|
|
1504
1499
|
className: "media-library--body flex min-h-0 flex-1",
|
|
1505
|
-
children: [K === "upload" ? /* @__PURE__ */
|
|
1500
|
+
children: [K === "upload" ? /* @__PURE__ */ N("div", {
|
|
1506
1501
|
className: "min-w-0 flex-1 overflow-y-auto",
|
|
1507
|
-
children: /* @__PURE__ */
|
|
1502
|
+
children: /* @__PURE__ */ N(Re, {
|
|
1508
1503
|
stagedFiles: G.stagedFiles,
|
|
1509
1504
|
uploadOptions: G.uploadOptions,
|
|
1510
1505
|
collections: Me,
|
|
@@ -1513,14 +1508,14 @@ function Z({ title: a, titleSuffix: s, description: f, confirmLabel: p, cancelLa
|
|
|
1513
1508
|
onFiles: G.addFiles,
|
|
1514
1509
|
onRemoveFile: G.removeStagedFile,
|
|
1515
1510
|
onOptionsChange: G.updateUploadOptions,
|
|
1516
|
-
empty:
|
|
1511
|
+
empty: D?.uploadEmpty
|
|
1517
1512
|
})
|
|
1518
|
-
}) : /* @__PURE__ */
|
|
1513
|
+
}) : /* @__PURE__ */ P("div", {
|
|
1519
1514
|
className: r("media-library--library min-w-0 flex-1 flex-col", q ? "hidden @2xl/media-library:flex" : "flex"),
|
|
1520
|
-
children: [/* @__PURE__ */
|
|
1515
|
+
children: [/* @__PURE__ */ P(c, {
|
|
1521
1516
|
gap: "md",
|
|
1522
1517
|
className: "media-library--toolbar border-b border-border/70 p-surface",
|
|
1523
|
-
children: [/* @__PURE__ */
|
|
1518
|
+
children: [/* @__PURE__ */ N(Pe, {
|
|
1524
1519
|
query: G.query,
|
|
1525
1520
|
type: G.type,
|
|
1526
1521
|
typeFilters: b,
|
|
@@ -1535,41 +1530,42 @@ function Z({ title: a, titleSuffix: s, description: f, confirmLabel: p, cancelLa
|
|
|
1535
1530
|
onSortChange: G.setSort,
|
|
1536
1531
|
onViewChange: G.setView,
|
|
1537
1532
|
onClearFilters: G.clearFilters,
|
|
1538
|
-
toolbarEnd:
|
|
1539
|
-
}), /* @__PURE__ */
|
|
1533
|
+
toolbarEnd: D?.toolbarEnd
|
|
1534
|
+
}), /* @__PURE__ */ N(a, {
|
|
1540
1535
|
size: "xs",
|
|
1541
1536
|
type: "secondary",
|
|
1542
1537
|
"aria-live": "polite",
|
|
1543
1538
|
children: Je
|
|
1544
1539
|
})]
|
|
1545
|
-
}), /* @__PURE__ */
|
|
1540
|
+
}), /* @__PURE__ */ N("div", {
|
|
1546
1541
|
role: "region",
|
|
1547
1542
|
"aria-label": W.resultsLabel,
|
|
1548
1543
|
tabIndex: 0,
|
|
1549
1544
|
className: "media-library--results min-h-0 flex-1 overflow-y-auto p-surface focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset",
|
|
1550
|
-
children: G.loading ?
|
|
1545
|
+
children: G.loading ? D?.loading ?? /* @__PURE__ */ N(u, {
|
|
1551
1546
|
className: "min-h-64",
|
|
1552
1547
|
label: W.loading
|
|
1553
|
-
}) : G.error ?
|
|
1548
|
+
}) : G.error ? D?.error ?? /* @__PURE__ */ N(d, {
|
|
1554
1549
|
title: W.errorTitle,
|
|
1555
1550
|
description: W.errorDescription
|
|
1556
|
-
}) : G.visibleItems.length === 0 ?
|
|
1551
|
+
}) : G.visibleItems.length === 0 ? D?.empty ?? /* @__PURE__ */ N(Ne, {
|
|
1557
1552
|
title: G.hasFilters ? W.emptyFilteredTitle : W.emptyLibraryTitle,
|
|
1558
1553
|
description: G.hasFilters ? W.emptyFilteredDescription : W.emptyLibraryDescription,
|
|
1559
|
-
action: G.hasFilters ? /* @__PURE__ */
|
|
1554
|
+
action: G.hasFilters ? /* @__PURE__ */ N(o, {
|
|
1560
1555
|
type: "button",
|
|
1561
1556
|
tone: "secondary",
|
|
1562
1557
|
buttonStyle: "outline",
|
|
1563
1558
|
onClick: G.clearFilters,
|
|
1564
1559
|
children: W.clearFilters
|
|
1565
|
-
}) : y ? /* @__PURE__ */
|
|
1560
|
+
}) : y ? /* @__PURE__ */ N(o, {
|
|
1561
|
+
tone: "primary",
|
|
1566
1562
|
type: "button",
|
|
1567
1563
|
onClick: () => G.setTab("upload"),
|
|
1568
|
-
children:
|
|
1564
|
+
children: W.uploadMedia
|
|
1569
1565
|
}) : void 0
|
|
1570
|
-
}) : G.view === "table" ? /* @__PURE__ */
|
|
1566
|
+
}) : G.view === "table" ? /* @__PURE__ */ N("div", {
|
|
1571
1567
|
className: "overflow-x-auto",
|
|
1572
|
-
children: /* @__PURE__ */
|
|
1568
|
+
children: /* @__PURE__ */ N(Ie, {
|
|
1573
1569
|
items: G.visibleItems,
|
|
1574
1570
|
selectedSet: G.selectedSet,
|
|
1575
1571
|
selectionMode: h,
|
|
@@ -1581,7 +1577,7 @@ function Z({ title: a, titleSuffix: s, description: f, confirmLabel: p, cancelLa
|
|
|
1581
1577
|
},
|
|
1582
1578
|
onDetails: G.setDetailId
|
|
1583
1579
|
})
|
|
1584
|
-
}) : /* @__PURE__ */
|
|
1580
|
+
}) : /* @__PURE__ */ N("div", {
|
|
1585
1581
|
className: r("media-library--grid grid min-w-0 gap-space-lg", g === "compact" ? "grid-cols-[repeat(auto-fill,minmax(136px,1fr))]" : "grid-cols-[repeat(auto-fill,minmax(168px,1fr))]"),
|
|
1586
1582
|
children: G.visibleItems.map((e) => {
|
|
1587
1583
|
let t = G.accessors.getId(e), n = {
|
|
@@ -1591,8 +1587,8 @@ function Z({ title: a, titleSuffix: s, description: f, confirmLabel: p, cancelLa
|
|
|
1591
1587
|
accessors: G.accessors,
|
|
1592
1588
|
toggle: () => Ke(e),
|
|
1593
1589
|
openDetails: () => G.setDetailId(t)
|
|
1594
|
-
}, r =
|
|
1595
|
-
return r ? /* @__PURE__ */
|
|
1590
|
+
}, r = D?.renderItem?.(e, n);
|
|
1591
|
+
return r ? /* @__PURE__ */ N("div", { children: r }, t) : /* @__PURE__ */ N(Fe, {
|
|
1596
1592
|
item: e,
|
|
1597
1593
|
selected: n.selected,
|
|
1598
1594
|
density: g,
|
|
@@ -1606,20 +1602,20 @@ function Z({ title: a, titleSuffix: s, description: f, confirmLabel: p, cancelLa
|
|
|
1606
1602
|
})
|
|
1607
1603
|
})
|
|
1608
1604
|
})]
|
|
1609
|
-
}), K === "library" && /* @__PURE__ */
|
|
1605
|
+
}), K === "library" && /* @__PURE__ */ N(Le, {
|
|
1610
1606
|
item: q,
|
|
1611
1607
|
collections: Me,
|
|
1612
1608
|
accessors: G.accessors,
|
|
1613
1609
|
strings: W,
|
|
1614
1610
|
onClose: () => G.setDetailId(null),
|
|
1615
1611
|
onUpdate: (e) => q ? G.updateItem(q, e) : Promise.resolve(!1),
|
|
1616
|
-
onReplace:
|
|
1612
|
+
onReplace: L && q ? () => L(q) : void 0,
|
|
1617
1613
|
onRemove: async () => {
|
|
1618
1614
|
if (!q) return !1;
|
|
1619
1615
|
let e = await G.removeItem(q);
|
|
1620
1616
|
return e && G.setDetailId(null), e;
|
|
1621
1617
|
},
|
|
1622
|
-
renderDetail:
|
|
1618
|
+
renderDetail: D?.renderDetail
|
|
1623
1619
|
})]
|
|
1624
1620
|
}),
|
|
1625
1621
|
Z ? Z.element ? he(Ye, Z.element) : null : Ye
|
|
@@ -1627,14 +1623,14 @@ function Z({ title: a, titleSuffix: s, description: f, confirmLabel: p, cancelLa
|
|
|
1627
1623
|
});
|
|
1628
1624
|
}
|
|
1629
1625
|
function Q({ open: e, onOpenChange: t, trigger: i, dialogTitle: a, dialogDescription: o, onClose: s, className: c, dialogClassName: l, contentClassName: u, closeOnEscape: d = !0, closeOnBackdropClick: p = !0, ...m }) {
|
|
1630
|
-
let h = n(ge, m.strings), [g, _] =
|
|
1626
|
+
let h = n(ge, m.strings), [g, _] = j(!1), [v, y] = j(null), b = e !== void 0, x = b ? e : g, S = (e) => {
|
|
1631
1627
|
b || _(e), t?.(e);
|
|
1632
1628
|
}, C = () => {
|
|
1633
1629
|
S(!1), s?.();
|
|
1634
1630
|
};
|
|
1635
|
-
return /* @__PURE__ */
|
|
1631
|
+
return /* @__PURE__ */ N(X.Provider, {
|
|
1636
1632
|
value: { element: v },
|
|
1637
|
-
children: /* @__PURE__ */
|
|
1633
|
+
children: /* @__PURE__ */ N(f, {
|
|
1638
1634
|
open: x,
|
|
1639
1635
|
onOpenChange: S,
|
|
1640
1636
|
onClose: s,
|
|
@@ -1644,7 +1640,7 @@ function Q({ open: e, onOpenChange: t, trigger: i, dialogTitle: a, dialogDescrip
|
|
|
1644
1640
|
size: "full",
|
|
1645
1641
|
showCancel: !1,
|
|
1646
1642
|
showConfirm: !1,
|
|
1647
|
-
footer: /* @__PURE__ */
|
|
1643
|
+
footer: /* @__PURE__ */ N("div", {
|
|
1648
1644
|
ref: y,
|
|
1649
1645
|
className: "media-library-dialog--footer @container/media-library w-full"
|
|
1650
1646
|
}),
|
|
@@ -1652,7 +1648,7 @@ function Q({ open: e, onOpenChange: t, trigger: i, dialogTitle: a, dialogDescrip
|
|
|
1652
1648
|
contentClassName: r("media-library-dialog--body flex min-h-0 flex-col overflow-hidden p-0", u),
|
|
1653
1649
|
closeOnBackdropClick: p,
|
|
1654
1650
|
closeOnEscape: d,
|
|
1655
|
-
children: /* @__PURE__ */
|
|
1651
|
+
children: /* @__PURE__ */ N(Z, {
|
|
1656
1652
|
...m,
|
|
1657
1653
|
onClose: C,
|
|
1658
1654
|
className: r("media-library-dialog--library rounded-none border-0", c),
|
|
@@ -1668,41 +1664,41 @@ function Ve(e, t, n) {
|
|
|
1668
1664
|
let r = e.slice(), [i] = r.splice(t, 1);
|
|
1669
1665
|
return i === void 0 || r.splice(n, 0, i), r;
|
|
1670
1666
|
}
|
|
1671
|
-
function He({ items: e, accessors: t, title:
|
|
1672
|
-
let
|
|
1667
|
+
function He({ items: e, accessors: t, title: i, description: s, primaryId: l, onPrimaryChange: u, onRemove: d, onReorder: f, onAdd: p, maxItems: h, layout: g = "field", density: _ = "comfortable", readOnly: y = !1, empty: b, action: x, renderItem: S, strings: C, className: w, ...ee }) {
|
|
1668
|
+
let T = n(ge, C), E = be(t), D = e.length, te = l ?? (D > 0 ? E.getId(e[0]) : void 0), O = !y && !!p && (h === void 0 || D < h), k = O && (g === "field" || D > 0) ? /* @__PURE__ */ N(o, {
|
|
1673
1669
|
type: "button",
|
|
1674
1670
|
tone: "secondary",
|
|
1675
1671
|
buttonStyle: "outline",
|
|
1676
1672
|
icon: ce,
|
|
1677
1673
|
onClick: p,
|
|
1678
|
-
children:
|
|
1679
|
-
}) : h !== void 0 &&
|
|
1674
|
+
children: T.gallery.add
|
|
1675
|
+
}) : h !== void 0 && D >= h ? /* @__PURE__ */ N(v, {
|
|
1680
1676
|
tone: "secondary",
|
|
1681
|
-
children:
|
|
1682
|
-
}) : null,
|
|
1683
|
-
if (n < 0 || n >=
|
|
1677
|
+
children: T.gallery.maxReached
|
|
1678
|
+
}) : null, A = (t, n) => {
|
|
1679
|
+
if (n < 0 || n >= D || t === n) return;
|
|
1684
1680
|
let r = Ve(e, t, n);
|
|
1685
|
-
f?.(r.map((e) =>
|
|
1686
|
-
},
|
|
1681
|
+
f?.(r.map((e) => E.getId(e)), r);
|
|
1682
|
+
}, j = !!(i || s || x || k), M = D === 0 && g !== "field", re = () => !O || g !== "field" ? null : /* @__PURE__ */ P("button", {
|
|
1687
1683
|
type: "button",
|
|
1688
1684
|
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 hover:border-primary-accent/50 hover:bg-primary/5 hover:text-primary-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"),
|
|
1689
|
-
"aria-label":
|
|
1685
|
+
"aria-label": T.gallery.addTile,
|
|
1690
1686
|
onClick: p,
|
|
1691
|
-
children: [/* @__PURE__ */
|
|
1687
|
+
children: [/* @__PURE__ */ N(ce, { className: "size-icon" }), /* @__PURE__ */ N(a, {
|
|
1692
1688
|
tag: "span",
|
|
1693
1689
|
size: "inherit",
|
|
1694
1690
|
className: "sr-only",
|
|
1695
|
-
children:
|
|
1691
|
+
children: T.gallery.addTile
|
|
1696
1692
|
})]
|
|
1697
1693
|
});
|
|
1698
|
-
return /* @__PURE__ */
|
|
1694
|
+
return /* @__PURE__ */ P("section", {
|
|
1699
1695
|
className: r("media-resource-gallery--component @container/media-resource-gallery rounded-radius border border-border bg-card shadow-xs", w),
|
|
1700
1696
|
"data-layout": g,
|
|
1701
1697
|
"data-gallery-density": _,
|
|
1702
|
-
...
|
|
1703
|
-
children: [
|
|
1698
|
+
...ee,
|
|
1699
|
+
children: [j && /* @__PURE__ */ N("header", {
|
|
1704
1700
|
className: "media-resource-gallery--header p-surface",
|
|
1705
|
-
children: /* @__PURE__ */
|
|
1701
|
+
children: /* @__PURE__ */ P(c, {
|
|
1706
1702
|
direction: {
|
|
1707
1703
|
base: "vertical",
|
|
1708
1704
|
md: "horizontal"
|
|
@@ -1710,94 +1706,95 @@ function He({ items: e, accessors: t, title: a, description: s, primaryId: l, on
|
|
|
1710
1706
|
gap: "lg",
|
|
1711
1707
|
align: { md: "start" },
|
|
1712
1708
|
justify: { md: "between" },
|
|
1713
|
-
children: [/* @__PURE__ */
|
|
1709
|
+
children: [/* @__PURE__ */ P(c, {
|
|
1714
1710
|
gap: "normal",
|
|
1715
1711
|
className: "min-w-0",
|
|
1716
|
-
children: [!!
|
|
1712
|
+
children: [!!i && /* @__PURE__ */ N(a, {
|
|
1717
1713
|
tag: "div",
|
|
1718
1714
|
weight: "semibold",
|
|
1719
|
-
children:
|
|
1720
|
-
}), !!s && /* @__PURE__ */
|
|
1715
|
+
children: i
|
|
1716
|
+
}), !!s && /* @__PURE__ */ N(a, {
|
|
1721
1717
|
type: "secondary",
|
|
1722
1718
|
children: s
|
|
1723
1719
|
})]
|
|
1724
|
-
}), /* @__PURE__ */
|
|
1720
|
+
}), /* @__PURE__ */ N(c, {
|
|
1725
1721
|
direction: "horizontal",
|
|
1726
1722
|
wrap: !0,
|
|
1727
1723
|
align: "center",
|
|
1728
1724
|
gap: "md",
|
|
1729
1725
|
className: "media-resource-gallery--actions",
|
|
1730
|
-
children: x ??
|
|
1726
|
+
children: x ?? k
|
|
1731
1727
|
})]
|
|
1732
1728
|
})
|
|
1733
|
-
}),
|
|
1729
|
+
}), M ? /* @__PURE__ */ N("div", {
|
|
1734
1730
|
className: "media-resource-gallery--empty px-surface pb-surface",
|
|
1735
|
-
children: b ?? /* @__PURE__ */
|
|
1736
|
-
title:
|
|
1737
|
-
description:
|
|
1738
|
-
action:
|
|
1731
|
+
children: b ?? /* @__PURE__ */ N(Ne, {
|
|
1732
|
+
title: T.gallery.emptyTitle,
|
|
1733
|
+
description: T.gallery.emptyDescription,
|
|
1734
|
+
action: O ? /* @__PURE__ */ N(o, {
|
|
1735
|
+
tone: "primary",
|
|
1739
1736
|
type: "button",
|
|
1740
|
-
icon:
|
|
1737
|
+
icon: oe,
|
|
1741
1738
|
onClick: p,
|
|
1742
|
-
children:
|
|
1739
|
+
children: T.gallery.add
|
|
1743
1740
|
}) : void 0
|
|
1744
1741
|
})
|
|
1745
|
-
}) : /* @__PURE__ */
|
|
1746
|
-
className: r("grid min-w-0 grid-cols-1", g === "list" ? "gap-space-md" : "gap-space-lg", "media-resource-gallery--items p-surface",
|
|
1742
|
+
}) : /* @__PURE__ */ P("div", {
|
|
1743
|
+
className: r("grid min-w-0 grid-cols-1", g === "list" ? "gap-space-md" : "gap-space-lg", "media-resource-gallery--items p-surface", j && "pt-0", g === "list" ? void 0 : g === "field" ? "grid-cols-[repeat(auto-fill,minmax(96px,1fr))] @md/media-resource-gallery:grid-cols-[repeat(auto-fill,minmax(108px,1fr))]" : _ === "compact" ? "grid-cols-[repeat(auto-fill,minmax(132px,1fr))]" : "grid-cols-[repeat(auto-fill,minmax(164px,1fr))]"),
|
|
1747
1744
|
children: [e.map((e, t) => {
|
|
1748
|
-
let n =
|
|
1745
|
+
let n = E.getId(e), i = E.getName(e), s = E.getType(e), l = E.getSrc(e), f = E.getAlt(e) || i, p = n === te, h = E.getPublic(e) === !1, b = E.getDuration(e), x = t > 0, C = t < D - 1, w = S?.(e, {
|
|
1749
1746
|
id: n,
|
|
1750
1747
|
index: t,
|
|
1751
|
-
total:
|
|
1748
|
+
total: D,
|
|
1752
1749
|
primary: p,
|
|
1753
|
-
accessors:
|
|
1750
|
+
accessors: E,
|
|
1754
1751
|
canMovePrevious: x,
|
|
1755
1752
|
canMoveNext: C,
|
|
1756
1753
|
setPrimary: () => u?.(n, e),
|
|
1757
1754
|
remove: () => d?.(n, e),
|
|
1758
|
-
movePrevious: () =>
|
|
1759
|
-
moveNext: () =>
|
|
1755
|
+
movePrevious: () => A(t, t - 1),
|
|
1756
|
+
moveNext: () => A(t, t + 1)
|
|
1760
1757
|
});
|
|
1761
|
-
return w ? /* @__PURE__ */
|
|
1758
|
+
return w ? /* @__PURE__ */ N("div", { children: w }, n) : g === "field" ? /* @__PURE__ */ P("div", {
|
|
1762
1759
|
className: r("media-resource-gallery--item group/gallery relative aspect-square overflow-hidden rounded-radius border border-border bg-background shadow-xs", "transition-colors hover:border-primary/40 focus-within:border-primary/50", p && "col-span-2 row-span-2 min-h-52"),
|
|
1763
1760
|
"data-primary": p || void 0,
|
|
1764
1761
|
children: [
|
|
1765
|
-
l ? /* @__PURE__ */
|
|
1762
|
+
l ? /* @__PURE__ */ N("img", {
|
|
1766
1763
|
src: l,
|
|
1767
1764
|
alt: f,
|
|
1768
1765
|
loading: "lazy",
|
|
1769
1766
|
className: "size-full object-cover"
|
|
1770
|
-
}) : /* @__PURE__ */
|
|
1767
|
+
}) : /* @__PURE__ */ N("div", {
|
|
1771
1768
|
className: "flex size-full items-center justify-center bg-muted text-muted-foreground",
|
|
1772
|
-
children: /* @__PURE__ */
|
|
1769
|
+
children: /* @__PURE__ */ N(ie, { className: p ? "size-7" : "size-icon-lg" })
|
|
1773
1770
|
}),
|
|
1774
|
-
p && /* @__PURE__ */
|
|
1771
|
+
p && /* @__PURE__ */ N(v, {
|
|
1775
1772
|
tone: "secondary",
|
|
1776
1773
|
className: "absolute left-2 top-2 bg-background/90 shadow-xs",
|
|
1777
|
-
children:
|
|
1774
|
+
children: T.gallery.cover
|
|
1778
1775
|
}),
|
|
1779
|
-
s === "video" && !!b && /* @__PURE__ */
|
|
1776
|
+
s === "video" && !!b && /* @__PURE__ */ P(v, {
|
|
1780
1777
|
tone: "secondary",
|
|
1781
1778
|
className: "absolute bottom-2 left-2 bg-foreground text-background",
|
|
1782
|
-
children: [/* @__PURE__ */
|
|
1779
|
+
children: [/* @__PURE__ */ N(B, { className: "size-icon-sm fill-current" }), b]
|
|
1783
1780
|
}),
|
|
1784
|
-
h && /* @__PURE__ */
|
|
1781
|
+
h && /* @__PURE__ */ N("span", {
|
|
1785
1782
|
className: "absolute bottom-2 right-2 inline-flex size-6 items-center justify-center rounded-full border border-border bg-background/90 text-muted-foreground shadow-xs",
|
|
1786
|
-
children: /* @__PURE__ */
|
|
1783
|
+
children: /* @__PURE__ */ N(z, { className: "size-icon-sm" })
|
|
1787
1784
|
}),
|
|
1788
|
-
!y && /* @__PURE__ */
|
|
1785
|
+
!y && /* @__PURE__ */ N(o, {
|
|
1789
1786
|
type: "button",
|
|
1790
1787
|
tone: "secondary",
|
|
1791
1788
|
buttonStyle: "solid",
|
|
1792
1789
|
size: "sm",
|
|
1793
1790
|
iconOnly: !0,
|
|
1794
1791
|
className: "absolute right-2 top-2 opacity-0 shadow-sm transition-opacity group-hover/gallery:opacity-100 group-focus-within/gallery:opacity-100",
|
|
1795
|
-
"aria-label":
|
|
1792
|
+
"aria-label": T.gallery.remove,
|
|
1796
1793
|
onClick: () => d?.(n, e),
|
|
1797
|
-
children: /* @__PURE__ */
|
|
1794
|
+
children: /* @__PURE__ */ N(me, { className: "size-icon-md" })
|
|
1798
1795
|
})
|
|
1799
1796
|
]
|
|
1800
|
-
}, n) : g === "list" ? /* @__PURE__ */
|
|
1797
|
+
}, n) : g === "list" ? /* @__PURE__ */ P(c, {
|
|
1801
1798
|
direction: "horizontal",
|
|
1802
1799
|
wrap: !0,
|
|
1803
1800
|
align: "center",
|
|
@@ -1805,200 +1802,200 @@ function He({ items: e, accessors: t, title: a, description: s, primaryId: l, on
|
|
|
1805
1802
|
className: r("media-resource-gallery--item min-w-0 rounded-radius border border-border bg-background px-row-x", _ === "compact" ? "py-row-y-sm" : "py-row-y"),
|
|
1806
1803
|
"data-primary": p || void 0,
|
|
1807
1804
|
children: [
|
|
1808
|
-
/* @__PURE__ */
|
|
1805
|
+
/* @__PURE__ */ N("div", {
|
|
1809
1806
|
className: "relative size-12 shrink-0 overflow-hidden rounded-inner bg-muted",
|
|
1810
|
-
children: l ? /* @__PURE__ */
|
|
1807
|
+
children: l ? /* @__PURE__ */ N("img", {
|
|
1811
1808
|
src: l,
|
|
1812
1809
|
alt: f,
|
|
1813
1810
|
loading: "lazy",
|
|
1814
1811
|
className: "size-full object-cover"
|
|
1815
|
-
}) : /* @__PURE__ */
|
|
1812
|
+
}) : /* @__PURE__ */ N("div", {
|
|
1816
1813
|
className: "flex size-full items-center justify-center text-muted-foreground",
|
|
1817
|
-
children: /* @__PURE__ */
|
|
1814
|
+
children: /* @__PURE__ */ N(ie, { className: "size-icon" })
|
|
1818
1815
|
})
|
|
1819
1816
|
}),
|
|
1820
|
-
/* @__PURE__ */
|
|
1817
|
+
/* @__PURE__ */ P("div", {
|
|
1821
1818
|
className: "min-w-0 flex-1",
|
|
1822
|
-
children: [/* @__PURE__ */
|
|
1819
|
+
children: [/* @__PURE__ */ P(c, {
|
|
1823
1820
|
direction: "horizontal",
|
|
1824
1821
|
wrap: !0,
|
|
1825
1822
|
align: "center",
|
|
1826
1823
|
gap: "md",
|
|
1827
1824
|
className: "min-w-0",
|
|
1828
|
-
children: [/* @__PURE__ */
|
|
1825
|
+
children: [/* @__PURE__ */ N(a, {
|
|
1829
1826
|
tag: "div",
|
|
1830
1827
|
weight: "semibold",
|
|
1831
1828
|
className: "min-w-0 break-all",
|
|
1832
|
-
children:
|
|
1833
|
-
}), p && /* @__PURE__ */
|
|
1834
|
-
tone: "
|
|
1835
|
-
children:
|
|
1829
|
+
children: i
|
|
1830
|
+
}), p && /* @__PURE__ */ N(v, {
|
|
1831
|
+
tone: "secondary",
|
|
1832
|
+
children: T.gallery.primary
|
|
1836
1833
|
})]
|
|
1837
|
-
}), /* @__PURE__ */
|
|
1834
|
+
}), /* @__PURE__ */ P(a, {
|
|
1838
1835
|
size: "xs",
|
|
1839
1836
|
type: "secondary",
|
|
1840
1837
|
children: [
|
|
1841
|
-
V(
|
|
1838
|
+
V(T.gallery.itemPosition, {
|
|
1842
1839
|
index: t + 1,
|
|
1843
|
-
total:
|
|
1840
|
+
total: D
|
|
1844
1841
|
}),
|
|
1845
1842
|
" · ",
|
|
1846
|
-
/* @__PURE__ */
|
|
1847
|
-
value:
|
|
1843
|
+
/* @__PURE__ */ N(m, {
|
|
1844
|
+
value: E.getSize(e),
|
|
1848
1845
|
size: "xs",
|
|
1849
1846
|
align: "left",
|
|
1850
|
-
emptyLabel:
|
|
1847
|
+
emptyLabel: T.unknownSize
|
|
1851
1848
|
})
|
|
1852
1849
|
]
|
|
1853
1850
|
})]
|
|
1854
1851
|
}),
|
|
1855
|
-
!y && /* @__PURE__ */
|
|
1852
|
+
!y && /* @__PURE__ */ P("div", {
|
|
1856
1853
|
className: "media-resource-gallery--item-actions flex basis-full flex-wrap items-center justify-end gap-space-xs @sm/media-resource-gallery:basis-auto",
|
|
1857
1854
|
children: [
|
|
1858
|
-
/* @__PURE__ */
|
|
1855
|
+
/* @__PURE__ */ N(o, {
|
|
1859
1856
|
type: "button",
|
|
1860
1857
|
tone: "secondary",
|
|
1861
1858
|
buttonStyle: "ghost",
|
|
1862
1859
|
size: "sm",
|
|
1863
1860
|
iconOnly: !0,
|
|
1864
1861
|
disabled: p,
|
|
1865
|
-
"aria-label":
|
|
1862
|
+
"aria-label": T.gallery.setPrimary,
|
|
1866
1863
|
onClick: () => u?.(n, e),
|
|
1867
|
-
children: /* @__PURE__ */
|
|
1864
|
+
children: /* @__PURE__ */ N(ue, { className: "size-icon-md" })
|
|
1868
1865
|
}),
|
|
1869
|
-
/* @__PURE__ */
|
|
1866
|
+
/* @__PURE__ */ N(o, {
|
|
1870
1867
|
type: "button",
|
|
1871
1868
|
tone: "secondary",
|
|
1872
1869
|
buttonStyle: "ghost",
|
|
1873
1870
|
size: "sm",
|
|
1874
1871
|
iconOnly: !0,
|
|
1875
1872
|
disabled: !x,
|
|
1876
|
-
"aria-label":
|
|
1877
|
-
onClick: () =>
|
|
1878
|
-
children: /* @__PURE__ */
|
|
1873
|
+
"aria-label": T.gallery.movePrevious,
|
|
1874
|
+
onClick: () => A(t, t - 1),
|
|
1875
|
+
children: /* @__PURE__ */ N(F, { className: "size-icon-md" })
|
|
1879
1876
|
}),
|
|
1880
|
-
/* @__PURE__ */
|
|
1877
|
+
/* @__PURE__ */ N(o, {
|
|
1881
1878
|
type: "button",
|
|
1882
1879
|
tone: "secondary",
|
|
1883
1880
|
buttonStyle: "ghost",
|
|
1884
1881
|
size: "sm",
|
|
1885
1882
|
iconOnly: !0,
|
|
1886
1883
|
disabled: !C,
|
|
1887
|
-
"aria-label":
|
|
1888
|
-
onClick: () =>
|
|
1889
|
-
children: /* @__PURE__ */
|
|
1884
|
+
"aria-label": T.gallery.moveNext,
|
|
1885
|
+
onClick: () => A(t, t + 1),
|
|
1886
|
+
children: /* @__PURE__ */ N(ne, { className: "size-icon-md" })
|
|
1890
1887
|
}),
|
|
1891
|
-
/* @__PURE__ */
|
|
1888
|
+
/* @__PURE__ */ N(o, {
|
|
1892
1889
|
type: "button",
|
|
1893
1890
|
tone: "destructive",
|
|
1894
1891
|
buttonStyle: "ghost",
|
|
1895
1892
|
size: "sm",
|
|
1896
1893
|
iconOnly: !0,
|
|
1897
|
-
"aria-label":
|
|
1894
|
+
"aria-label": T.gallery.remove,
|
|
1898
1895
|
onClick: () => d?.(n, e),
|
|
1899
|
-
children: /* @__PURE__ */
|
|
1896
|
+
children: /* @__PURE__ */ N(de, { className: "size-icon-md" })
|
|
1900
1897
|
})
|
|
1901
1898
|
]
|
|
1902
1899
|
})
|
|
1903
1900
|
]
|
|
1904
|
-
}, n) : /* @__PURE__ */
|
|
1901
|
+
}, n) : /* @__PURE__ */ P("div", {
|
|
1905
1902
|
className: "media-resource-gallery--item group/gallery overflow-hidden rounded-radius border border-border bg-background shadow-xs transition-colors hover:border-primary/40",
|
|
1906
1903
|
"data-primary": p || void 0,
|
|
1907
|
-
children: [/* @__PURE__ */
|
|
1904
|
+
children: [/* @__PURE__ */ P("div", {
|
|
1908
1905
|
className: "relative aspect-[4/3] bg-muted",
|
|
1909
|
-
children: [l ? /* @__PURE__ */
|
|
1906
|
+
children: [l ? /* @__PURE__ */ N("img", {
|
|
1910
1907
|
src: l,
|
|
1911
1908
|
alt: f,
|
|
1912
1909
|
loading: "lazy",
|
|
1913
1910
|
className: "size-full object-cover"
|
|
1914
|
-
}) : /* @__PURE__ */
|
|
1911
|
+
}) : /* @__PURE__ */ N("div", {
|
|
1915
1912
|
className: "flex size-full items-center justify-center text-muted-foreground",
|
|
1916
|
-
children: /* @__PURE__ */
|
|
1917
|
-
}), /* @__PURE__ */
|
|
1913
|
+
children: /* @__PURE__ */ N(ie, { className: "size-6" })
|
|
1914
|
+
}), /* @__PURE__ */ P("div", {
|
|
1918
1915
|
className: "absolute left-2 top-2 flex flex-wrap gap-space-xs",
|
|
1919
|
-
children: [p && /* @__PURE__ */
|
|
1920
|
-
tone: "
|
|
1921
|
-
className: "bg-card",
|
|
1922
|
-
children:
|
|
1923
|
-
}), /* @__PURE__ */
|
|
1916
|
+
children: [p && /* @__PURE__ */ N(v, {
|
|
1917
|
+
tone: "secondary",
|
|
1918
|
+
className: "bg-card text-card-foreground",
|
|
1919
|
+
children: T.gallery.primary
|
|
1920
|
+
}), /* @__PURE__ */ N(v, {
|
|
1924
1921
|
tone: "secondary",
|
|
1925
1922
|
className: "bg-card text-card-foreground",
|
|
1926
|
-
children: V(
|
|
1923
|
+
children: V(T.gallery.itemPosition, {
|
|
1927
1924
|
index: t + 1,
|
|
1928
|
-
total:
|
|
1925
|
+
total: D
|
|
1929
1926
|
})
|
|
1930
1927
|
})]
|
|
1931
1928
|
})]
|
|
1932
|
-
}), /* @__PURE__ */
|
|
1929
|
+
}), /* @__PURE__ */ N("div", {
|
|
1933
1930
|
className: r("media-resource-gallery--item-body", _ === "compact" ? "p-surface-xs" : "p-surface"),
|
|
1934
|
-
children: /* @__PURE__ */
|
|
1931
|
+
children: /* @__PURE__ */ P(c, {
|
|
1935
1932
|
gap: "md",
|
|
1936
|
-
children: [/* @__PURE__ */
|
|
1933
|
+
children: [/* @__PURE__ */ P("div", {
|
|
1937
1934
|
className: "min-w-0",
|
|
1938
|
-
children: [/* @__PURE__ */
|
|
1935
|
+
children: [/* @__PURE__ */ N(a, {
|
|
1939
1936
|
tag: "div",
|
|
1940
1937
|
weight: "semibold",
|
|
1941
1938
|
className: "truncate",
|
|
1942
|
-
children:
|
|
1943
|
-
}), /* @__PURE__ */
|
|
1944
|
-
value:
|
|
1939
|
+
children: i
|
|
1940
|
+
}), /* @__PURE__ */ N(m, {
|
|
1941
|
+
value: E.getSize(e),
|
|
1945
1942
|
size: "xs",
|
|
1946
1943
|
align: "left",
|
|
1947
|
-
emptyLabel:
|
|
1944
|
+
emptyLabel: T.unknownSize
|
|
1948
1945
|
})]
|
|
1949
|
-
}), !y && /* @__PURE__ */
|
|
1946
|
+
}), !y && /* @__PURE__ */ P("div", {
|
|
1950
1947
|
className: "flex items-center gap-space-xs",
|
|
1951
1948
|
children: [
|
|
1952
|
-
/* @__PURE__ */
|
|
1949
|
+
/* @__PURE__ */ N(o, {
|
|
1953
1950
|
type: "button",
|
|
1954
1951
|
tone: "secondary",
|
|
1955
1952
|
buttonStyle: "ghost",
|
|
1956
1953
|
size: "sm",
|
|
1957
1954
|
iconOnly: !0,
|
|
1958
1955
|
disabled: p,
|
|
1959
|
-
"aria-label":
|
|
1956
|
+
"aria-label": T.gallery.setPrimary,
|
|
1960
1957
|
onClick: () => u?.(n, e),
|
|
1961
|
-
children: /* @__PURE__ */
|
|
1958
|
+
children: /* @__PURE__ */ N(ue, { className: "size-icon-md" })
|
|
1962
1959
|
}),
|
|
1963
|
-
/* @__PURE__ */
|
|
1960
|
+
/* @__PURE__ */ N(o, {
|
|
1964
1961
|
type: "button",
|
|
1965
1962
|
tone: "secondary",
|
|
1966
1963
|
buttonStyle: "ghost",
|
|
1967
1964
|
size: "sm",
|
|
1968
1965
|
iconOnly: !0,
|
|
1969
1966
|
disabled: !x,
|
|
1970
|
-
"aria-label":
|
|
1971
|
-
onClick: () =>
|
|
1972
|
-
children: /* @__PURE__ */
|
|
1967
|
+
"aria-label": T.gallery.movePrevious,
|
|
1968
|
+
onClick: () => A(t, t - 1),
|
|
1969
|
+
children: /* @__PURE__ */ N(F, { className: "size-icon-md" })
|
|
1973
1970
|
}),
|
|
1974
|
-
/* @__PURE__ */
|
|
1971
|
+
/* @__PURE__ */ N(o, {
|
|
1975
1972
|
type: "button",
|
|
1976
1973
|
tone: "secondary",
|
|
1977
1974
|
buttonStyle: "ghost",
|
|
1978
1975
|
size: "sm",
|
|
1979
1976
|
iconOnly: !0,
|
|
1980
1977
|
disabled: !C,
|
|
1981
|
-
"aria-label":
|
|
1982
|
-
onClick: () =>
|
|
1983
|
-
children: /* @__PURE__ */
|
|
1978
|
+
"aria-label": T.gallery.moveNext,
|
|
1979
|
+
onClick: () => A(t, t + 1),
|
|
1980
|
+
children: /* @__PURE__ */ N(ne, { className: "size-icon-md" })
|
|
1984
1981
|
}),
|
|
1985
|
-
/* @__PURE__ */
|
|
1982
|
+
/* @__PURE__ */ N(o, {
|
|
1986
1983
|
type: "button",
|
|
1987
1984
|
tone: "destructive",
|
|
1988
1985
|
buttonStyle: "ghost",
|
|
1989
1986
|
size: "sm",
|
|
1990
1987
|
iconOnly: !0,
|
|
1991
1988
|
className: "ml-auto",
|
|
1992
|
-
"aria-label":
|
|
1989
|
+
"aria-label": T.gallery.remove,
|
|
1993
1990
|
onClick: () => d?.(n, e),
|
|
1994
|
-
children: /* @__PURE__ */
|
|
1991
|
+
children: /* @__PURE__ */ N(de, { className: "size-icon-md" })
|
|
1995
1992
|
})
|
|
1996
1993
|
]
|
|
1997
1994
|
})]
|
|
1998
1995
|
})
|
|
1999
1996
|
})]
|
|
2000
1997
|
}, n);
|
|
2001
|
-
}),
|
|
1998
|
+
}), re()]
|
|
2002
1999
|
})]
|
|
2003
2000
|
});
|
|
2004
2001
|
}
|