themelia-ui 3.0.0 → 3.2.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/.agents/skills/themelia-ui/SKILL.md +60 -33
- package/.agents/skills/themelia-ui/manifest.json +23 -0
- package/.agents/skills/themelia-ui/references/api-compatibility.md +5 -4
- package/.agents/skills/themelia-ui/references/blocks.md +123 -0
- package/.agents/skills/themelia-ui/references/composition-ladder.md +8 -8
- package/.agents/skills/themelia-ui/references/composition.md +100 -19
- package/.agents/skills/themelia-ui/references/forms.md +23 -3
- package/.agents/skills/themelia-ui/references/framework-wiring.md +41 -13
- package/.agents/skills/themelia-ui/references/i18n.md +4 -2
- package/.agents/skills/themelia-ui/references/imports.md +104 -104
- package/.agents/skills/themelia-ui/references/installation.md +60 -31
- package/.agents/skills/themelia-ui/references/migration.md +156 -5
- package/.agents/skills/themelia-ui/references/provider-and-scoping.md +37 -25
- package/.agents/skills/themelia-ui/references/reference-workflows.md +43 -0
- package/.agents/skills/themelia-ui/references/structure-and-spacing.md +147 -0
- package/.agents/skills/themelia-ui/references/theming.md +174 -131
- package/.agents/skills/themelia-ui/references/troubleshooting.md +88 -30
- package/.agents/skills/themelia-ui/references/verification.md +60 -5
- package/CHANGELOG.md +212 -0
- package/README.md +48 -60
- package/dist/accordion-CHuzMmWL.js +143 -0
- package/dist/{action-menu-BNLURfMK.js → action-menu-BwiL_F6I.js} +35 -33
- package/dist/{alert-dialog-BMVo6Z-8.js → alert-dialog-Cg2HhuBe.js} +1 -1
- package/dist/avatar-Dc_BNYfB.js +93 -0
- package/dist/badge-VlJVZjdm.js +45 -0
- package/dist/base/accordion.js +1 -1
- package/dist/base/action-menu.js +1 -1
- package/dist/base/alert-dialog.js +1 -1
- package/dist/base/aspect-ratio.js +3 -1
- package/dist/base/avatar.js +1 -1
- package/dist/base/badge.js +2 -2
- package/dist/base/batch-action-bar.js +1 -1
- package/dist/base/buttons.js +1 -1
- package/dist/base/cards.js +1 -1
- package/dist/base/carousel.js +6 -4
- package/dist/base/chart.js +1 -1
- package/dist/base/choice-inputs.js +1 -1
- package/dist/base/combobox.js +1 -1
- package/dist/base/command.js +1 -1
- package/dist/base/context-menu.js +22 -21
- package/dist/base/copyable.js +1 -1
- package/dist/base/date-pickers.js +1 -1
- package/dist/base/dialog.js +1 -1
- package/dist/base/display.js +1 -1
- package/dist/base/dropdown-menu.js +1 -1
- package/dist/base/feedback.js +1 -1
- package/dist/base/forms-numeric.js +1 -1
- package/dist/base/forms.js +1 -1
- package/dist/base/hover-card.js +26 -23
- package/dist/base/input-group.js +1 -1
- package/dist/base/item.js +1 -1
- package/dist/base/label.js +1 -1
- package/dist/base/menubar.js +20 -14
- package/dist/base/navigation-menu.js +47 -38
- package/dist/base/navigation.js +1 -1
- package/dist/base/otp-input.js +36 -30
- package/dist/base/overlay.js +1 -1
- package/dist/base/popover-menu.js +1 -1
- package/dist/base/popover.js +1 -1
- package/dist/base/qr-code.js +51 -47
- package/dist/base/repeaters.js +1 -1
- package/dist/base/resizable.js +2 -0
- package/dist/base/sheet.js +1 -1
- package/dist/base/sidebar.js +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 +1 -1
- package/dist/base/timeline.js +1 -1
- package/dist/base/toaster.js +1 -1
- package/dist/base/toggle.js +21 -15
- package/dist/base/toolbar.js +1 -1
- package/dist/base/tooltip.js +1 -1
- package/dist/base/typography.js +2 -2
- package/dist/base/upload.js +1 -1
- package/dist/base/value-inputs.js +1 -1
- package/dist/{batch-action-bar-BZYNKXdV.js → batch-action-bar-DZVMVW83.js} +11 -8
- package/dist/{admin/patterns → blocks/admin}/access.js +79 -76
- package/dist/blocks/admin/commerce.js +2493 -0
- package/dist/{patterns → blocks}/analytics.js +312 -303
- package/dist/{patterns → blocks}/onboarding.js +27 -23
- package/dist/{patterns → blocks}/timelines.js +1 -1
- package/dist/buttons-BX2JfL5X.js +173 -0
- package/dist/cards-Ddhz43Bz.js +279 -0
- package/dist/chart-BkK3Xm10.js +201 -0
- package/dist/choice-inputs-NwRxvmZN.js +694 -0
- package/dist/combobox-519ubijc.js +292 -0
- package/dist/command-JjApYFds.js +156 -0
- package/dist/comments-CCQ2QRaU.js +1443 -0
- package/dist/components/base/action-menu/action-menu.d.ts +1 -1
- package/dist/components/base/action-menu/action-menu.types.d.ts +2 -2
- package/dist/components/base/avatar/avatar.d.ts +5 -2
- package/dist/components/base/badge/badge.d.ts +10 -10
- package/dist/components/base/badge/badge.variants.d.ts +1 -2
- package/dist/components/base/badge/index.d.ts +1 -2
- package/dist/components/base/buttons/button.d.ts +9 -8
- package/dist/components/base/buttons/button.types.d.ts +2 -2
- package/dist/components/base/buttons/index.d.ts +1 -1
- package/dist/components/base/buttons/text-button.d.ts +1 -1
- package/dist/components/base/cards/card-actions.d.ts +1 -1
- package/dist/components/base/cards/card.d.ts +3 -1
- package/dist/components/base/cards/partials/card-header.d.ts +2 -1
- package/dist/components/base/choice-inputs/choice.types.d.ts +2 -2
- package/dist/components/base/choice-inputs/partials/choice-parts.d.ts +3 -3
- package/dist/components/base/command/command.d.ts +5 -2
- package/dist/components/base/display/icon-badge.d.ts +5 -3
- package/dist/components/base/display/index.d.ts +1 -1
- package/dist/components/base/display/metadata-list.d.ts +6 -6
- package/dist/components/base/display/metadata-value.d.ts +1 -1
- package/dist/components/base/display/separator.d.ts +2 -2
- package/dist/components/base/feedback/alert.d.ts +3 -2
- package/dist/components/base/feedback/empty.d.ts +5 -4
- package/dist/components/base/feedback/progress-circle.d.ts +2 -2
- package/dist/components/base/feedback/progress.d.ts +3 -1
- package/dist/components/base/forms/form-field.d.ts +2 -2
- package/dist/components/base/input-group/input-group.d.ts +8 -10
- package/dist/components/base/item/item.d.ts +2 -2
- package/dist/components/base/overlay/index.d.ts +1 -1
- package/dist/components/base/overlay/overlay.types.d.ts +7 -5
- package/dist/components/base/qr-code/qr-code.d.ts +4 -4
- package/dist/components/base/sheet/sheet.d.ts +1 -1
- package/dist/components/base/sidebar/sidebar.d.ts +9 -13
- package/dist/components/base/spinner/spinner.d.ts +2 -2
- package/dist/components/base/structure/adaptive-grid.d.ts +3 -3
- package/dist/components/base/structure/bleed.d.ts +4 -2
- package/dist/components/base/structure/grid.d.ts +10 -4
- package/dist/components/base/structure/index.d.ts +1 -1
- package/dist/components/base/structure/split.d.ts +4 -3
- package/dist/components/base/structure/stack.d.ts +5 -5
- package/dist/components/base/structure/structure.maps.d.ts +2 -1
- package/dist/components/base/structure/structure.types.d.ts +10 -4
- package/dist/components/base/toggle/toggle.d.ts +2 -2
- package/dist/components/base/toolbar/toolbar.d.ts +3 -3
- package/dist/components/base/typography/index.d.ts +2 -0
- package/dist/components/base/typography/rich-text/rich-text.variants.d.ts +9 -0
- package/dist/components/base/typography/text/index.d.ts +1 -0
- package/dist/components/base/typography/text/text.d.ts +15 -8
- package/dist/components/base/typography/text/text.variants.d.ts +41 -0
- package/dist/components/base/value-inputs/color-input.d.ts +1 -7
- package/dist/components/base/value-inputs/slider.d.ts +2 -7
- package/dist/components/{admin/patterns → blocks/admin}/commerce/vendor-profile.d.ts +2 -1
- package/dist/components/{patterns → blocks}/analytics/analytics.strings.d.ts +2 -5
- package/dist/components/features/actions/action-adapters.d.ts +3 -3
- package/dist/components/features/actions/actions.types.d.ts +3 -5
- package/dist/components/features/actions/index.d.ts +1 -1
- package/dist/components/features/activities/activities-feed.d.ts +1 -1
- package/dist/components/features/activities/activities.types.d.ts +4 -4
- package/dist/components/features/activities/activity-parts.d.ts +3 -3
- package/dist/components/features/activities/activity-row.d.ts +4 -4
- package/dist/components/features/activities/index.d.ts +1 -1
- package/dist/components/features/ai-chat/ai-chat.types.d.ts +10 -3
- package/dist/components/features/ai-chat/ai-message-surfaces.d.ts +1 -1
- package/dist/components/features/ai-chat/ai-work-surfaces.d.ts +1 -1
- package/dist/components/features/combobox/combobox.strings.d.ts +2 -2
- package/dist/components/features/combobox/fetching-combobox.d.ts +2 -1
- package/dist/components/features/combobox/resource-combobox.d.ts +3 -0
- package/dist/components/features/combobox/use-suggestions.d.ts +7 -0
- package/dist/components/features/event-calendar/event-calendar.types.d.ts +3 -0
- package/dist/components/features/media-library/index.d.ts +1 -1
- package/dist/components/features/media-library/media-library-parts.d.ts +4 -3
- package/dist/components/features/media-library/media-library-views.d.ts +4 -3
- package/dist/components/features/media-library/media-library.d.ts +1 -1
- package/dist/components/features/media-library/media-library.strings.d.ts +12 -13
- package/dist/components/features/media-library/media-library.types.d.ts +11 -9
- package/dist/components/features/media-library/media-resource-gallery.d.ts +1 -1
- package/dist/components/features/media-library/use-media-library.d.ts +1 -4
- package/dist/components/features/overlays/action-overlay-frame.d.ts +1 -1
- package/dist/components/features/overlays/index.d.ts +1 -1
- package/dist/components/features/overlays/overlay-parts.d.ts +3 -3
- package/dist/components/features/overlays/overlays.types.d.ts +8 -7
- package/dist/components/features/rich-text-editor/index.d.ts +0 -1
- package/dist/components/features/table/data-table-body.d.ts +1 -1
- package/dist/components/features/table/data-table-expanded-row.d.ts +27 -0
- package/dist/components/features/table/data-table-header.d.ts +1 -1
- package/dist/components/features/table/data-table-size.d.ts +1 -1
- package/dist/components/features/table/data-table.d.ts +1 -1
- package/dist/components/features/table/index.d.ts +1 -1
- package/dist/components/features/table/table-helpers.d.ts +9 -3
- package/dist/components/features/table/table.strings.d.ts +11 -0
- package/dist/components/features/table/table.types.d.ts +60 -2
- package/dist/components/features/theme-tweaker/index.d.ts +1 -1
- package/dist/components/features/theme-tweaker/theme-tweaker.strings.d.ts +1 -1
- package/dist/components/features/theme-tweaker/theme-tweaker.types.d.ts +6 -10
- package/dist/components/features/theme-tweaker/theme-tweaker.utils.d.ts +22 -6
- package/dist/components/layout/app-shell/topbar-sidebar-layout.d.ts +1 -1
- package/dist/components/layout/auth/auth.d.ts +1 -1
- package/dist/components/layout/auth/auth.types.d.ts +1 -1
- package/dist/components/primitives/value.d.ts +3 -1
- package/dist/containers-B8d8U9GS.js +2 -0
- package/dist/{copyable-H1TUEY-H.js → copyable-D9Okb1w6.js} +12 -11
- package/dist/core.css +2 -2
- package/dist/css/access.css +2 -1
- package/dist/css/accordion.css +2 -1
- package/dist/css/action-menu.css +2 -1
- package/dist/css/activities.css +2 -1
- package/dist/css/ai-chat.css +2 -1
- package/dist/css/analytics.css +2 -1
- package/dist/css/app-shell.css +2 -1
- package/dist/css/aspect-ratio.css +2 -1
- package/dist/css/async-preview.css +2 -1
- package/dist/css/auth.css +2 -1
- package/dist/css/avatar.css +2 -1
- package/dist/css/badge.css +2 -1
- package/dist/css/batch-action-bar.css +2 -1
- package/dist/css/buttons.css +2 -1
- package/dist/css/cards.css +2 -1
- package/dist/css/carousel.css +2 -1
- package/dist/css/chart.css +2 -1
- package/dist/css/choice-inputs.css +2 -1
- package/dist/css/combobox.css +2 -1
- package/dist/css/combobox2.css +2 -1
- package/dist/css/command.css +2 -1
- package/dist/css/comments.css +2 -1
- package/dist/css/commerce.css +2 -1
- package/dist/css/containers.css +2 -1
- package/dist/css/copyable.css +2 -1
- package/dist/css/data-view.css +2 -1
- package/dist/css/date-pickers.css +2 -1
- package/dist/css/display.css +2 -1
- package/dist/css/dropdown-menu.css +2 -1
- package/dist/css/event-calendar.css +2 -1
- package/dist/css/feedback.css +2 -1
- package/dist/css/filters.css +2 -1
- package/dist/css/forms-numeric.css +2 -1
- package/dist/css/forms.css +2 -1
- package/dist/css/global-search.css +2 -1
- package/dist/css/header.css +2 -1
- package/dist/css/hover-card.css +2 -1
- package/dist/css/input-group.css +2 -1
- package/dist/css/item.css +2 -1
- package/dist/css/kanban.css +2 -1
- package/dist/css/label.css +2 -1
- package/dist/css/map.css +2 -1
- package/dist/css/media-library.css +2 -1
- package/dist/css/mentions.css +2 -1
- package/dist/css/menubar.css +2 -1
- package/dist/css/navigation-menu.css +2 -1
- package/dist/css/navigation.css +2 -1
- package/dist/css/navigation2.css +2 -1
- package/dist/css/onboarding.css +2 -1
- package/dist/css/otp-input.css +2 -1
- package/dist/css/overlay.css +2 -1
- package/dist/css/overlays.css +2 -1
- package/dist/css/page.css +2 -1
- package/dist/css/popover-menu.css +2 -1
- package/dist/css/popover.css +2 -1
- package/dist/css/primitives.css +2 -1
- package/dist/css/products.css +2 -1
- package/dist/css/qr-code.css +2 -1
- package/dist/css/repeaters.css +2 -1
- package/dist/css/resizable.css +2 -1
- package/dist/css/resource-assignment.css +2 -1
- package/dist/css/resource.css +2 -1
- package/dist/css/rich-text-editor.css +2 -1
- package/dist/css/schema-form.css +2 -1
- package/dist/css/sidebar.css +2 -1
- package/dist/css/sidebar2.css +2 -1
- package/dist/css/skeleton.css +2 -1
- package/dist/css/spinner.css +2 -1
- package/dist/css/structure.css +2 -1
- package/dist/css/sync.css +2 -1
- package/dist/css/table.css +2 -1
- package/dist/css/table2.css +2 -1
- package/dist/css/text-inputs.css +2 -1
- package/dist/css/theme-tweaker.css +2 -1
- package/dist/css/timeline.css +2 -1
- package/dist/css/timelines.css +2 -1
- package/dist/css/toaster.css +2 -1
- package/dist/css/toggle.css +2 -1
- package/dist/css/toolbar.css +2 -1
- package/dist/css/tooltip.css +2 -1
- package/dist/css/typography.css +2 -1
- package/dist/css/upload.css +2 -1
- package/dist/css/value-inputs.css +2 -1
- package/dist/css/workspace.css +2 -1
- package/dist/css-graph.json +1027 -0
- package/dist/date-pickers-BwCwKIVM.js +685 -0
- package/dist/{dialog-CtFCuTUF.js → dialog-CAnwRNrm.js} +1 -1
- package/dist/display-a7AoX_u7.js +664 -0
- package/dist/dropdown-menu-Br8kvjrF.js +235 -0
- package/dist/empty.js +0 -0
- package/dist/features/actions.js +6 -6
- package/dist/features/activities.js +219 -216
- package/dist/features/ai-chat.js +593 -565
- package/dist/features/async-preview.js +105 -286
- package/dist/features/combobox.js +328 -314
- package/dist/features/comments.js +1 -1
- package/dist/features/data-view.js +56 -55
- package/dist/features/event-calendar.js +189 -185
- package/dist/features/filters.js +1 -1
- package/dist/features/global-search.js +259 -260
- package/dist/features/kanban.js +39 -37
- package/dist/features/map.js +357 -354
- package/dist/features/media-library.js +931 -931
- package/dist/features/mentions.js +1 -1
- package/dist/features/overlays.js +1 -1
- package/dist/features/products.js +950 -942
- package/dist/features/resource-assignment.js +39 -37
- package/dist/features/resource.js +70 -71
- package/dist/features/rich-text-editor.js +2 -2
- package/dist/features/schema-form.js +342 -338
- package/dist/features/sync.js +14 -12
- package/dist/features/table.js +1 -1
- package/dist/features/theme-tweaker.js +1002 -962
- package/dist/feedback-D4qVsKlD.js +430 -0
- package/dist/{filters-DOLKRSmb.js → filters-BhsTkWpZ.js} +386 -383
- package/dist/forms-C0WeNPFF.js +250 -0
- package/dist/forms-numeric-IwQ1ltNf.js +582 -0
- package/dist/hooks/use-native-dialog.d.ts +1 -1
- package/dist/index.js +2 -2
- package/dist/input-group-HS_Z0Ei_.js +119 -0
- package/dist/item-M2pmpWXh.js +150 -0
- package/dist/{label-DumoMDm6.js → label-HOBXAscw.js} +7 -5
- package/dist/layout/app-shell.js +4 -2
- package/dist/layout/auth.js +102 -100
- package/dist/layout/header.js +190 -180
- package/dist/layout/navigation.js +1 -1
- package/dist/layout/page.js +18 -16
- package/dist/layout/settings.js +2 -2
- package/dist/layout/sidebar.js +50 -46
- package/dist/layout/workspace.js +71 -69
- package/dist/lib/action-presentation.d.ts +3 -3
- package/dist/lib/component-vocabulary.d.ts +2 -2
- package/dist/lib/css-length.d.ts +2 -0
- package/dist/lib/responsive.d.ts +1 -1
- package/dist/lib/theming/index.d.ts +1 -0
- package/dist/lib/theming/recipes.d.ts +2 -2
- package/dist/lib/theming/themes/dense.d.ts +3 -0
- package/dist/lib/theming/themes/editorial.d.ts +3 -0
- package/dist/lib/theming/themes/index.d.ts +8 -0
- package/dist/lib/theming/themes/pair.d.ts +7 -0
- package/dist/lib/theming/themes/sharp.d.ts +3 -0
- package/dist/lib/theming/themes/soft.d.ts +3 -0
- package/dist/lib/theming/themes/types.d.ts +12 -0
- package/dist/lib/ui-provider/index.d.ts +1 -1
- package/dist/lib/ui-provider/scope.d.ts +5 -8
- package/dist/lib/ui-provider/tokens.d.ts +11 -3
- package/dist/lib/ui-provider/tokens.generated.d.ts +6 -4
- package/dist/lib/ui-provider/types.d.ts +17 -19
- package/dist/lib/ui-provider/ui-scope.d.ts +1 -1
- package/dist/{mentions-BbsEHlcH.js → mentions-BOxbigwp.js} +113 -111
- package/dist/navigation-Bgu7Vc0M.js +622 -0
- package/dist/navigation-DiYACqpE.js +216 -0
- package/dist/overlay-BuQOl8aP.js +356 -0
- package/dist/{overlays-DvVoS3td.js → overlays-1sULyytH.js} +77 -75
- package/dist/popover-CA7SP_iz.js +127 -0
- package/dist/popover-menu-QXgQeWeG.js +192 -0
- package/dist/{primitives-D0bdDozz.js → primitives-BskKlf35.js} +181 -178
- package/dist/primitives.js +1 -1
- package/dist/profiles/admin.json +6 -36
- package/dist/profiles/general.json +6 -96
- package/dist/repeaters-CeH20dvr.js +445 -0
- package/dist/rich-text-editor-D_Ppm8yh.js +491 -0
- package/dist/{sheet-CKcmRbJ9.js → sheet-CJ1-OAla.js} +3 -3
- package/dist/sidebar-D8uGqxio.js +421 -0
- package/dist/skeleton-BTKNKTdj.js +173 -0
- package/dist/spinner-Tc1QCnxM.js +30 -0
- package/dist/{structure-D0WGQAP3.js → structure-CynEZ-OY.js} +15 -23
- package/dist/style.css +1 -1
- package/dist/styles/TOKENS.md +116 -275
- package/dist/styles/animation.css +114 -0
- package/dist/styles/base.css +7 -6
- package/dist/styles/fields.css +45 -63
- package/dist/styles/focus.css +12 -0
- package/dist/styles/forced-colors.css +11 -10
- package/dist/styles/index.css +23 -30
- package/dist/styles/map.css +45 -34
- package/dist/styles/mentions.css +14 -52
- package/dist/styles/overlays.css +7 -7
- package/dist/styles/tailwind.css +76 -127
- package/dist/styles/targets.css +3 -3
- package/dist/styles/theme/colour.css +86 -0
- package/dist/styles/theme/density.css +31 -0
- package/dist/styles/theme/elevation.css +9 -0
- package/dist/styles/theme/layout.css +18 -0
- package/dist/styles/theme/motion.css +18 -0
- package/dist/styles/theme/shape.css +12 -0
- package/dist/styles/theme/size.css +10 -0
- package/dist/styles/theme/spacing.css +11 -0
- package/dist/styles/theme/typography.css +20 -0
- package/dist/styles/tone.css +61 -0
- package/dist/table-B7dtIFUx.js +1262 -0
- package/dist/table-Ds_eO9av.js +191 -0
- package/dist/tailwind.css +76 -127
- package/dist/text-inputs-BboE77nZ.js +395 -0
- package/dist/theming-C5ygF5uf.js +292 -0
- package/dist/theming.js +2 -2
- package/dist/{timeline-BdaGRyj-.js → timeline-BR_jNgvz.js} +57 -49
- package/dist/{timelines-BB7550mz.js → timelines-DXG1BfIN.js} +69 -67
- package/dist/{toaster-bBMgXm8z.js → toaster-CXL8L7Mm.js} +106 -99
- package/dist/tokens.json +1027 -636
- package/dist/toolbar-DBK-c4yy.js +74 -0
- package/dist/tooltip-BPYP-jUm.js +76 -0
- package/dist/{typography-BkxEiwQ1.js → typography-DmeR05Er.js} +87 -53
- package/dist/{ui-provider-Cmoq6i_D.js → ui-provider-DpzLUD12.js} +117 -69
- package/dist/ui-provider.js +1 -1
- package/dist/upload-CYuoJykZ.js +968 -0
- package/dist/use-async-preview-BFwf9ElY.js +188 -0
- package/dist/value-inputs-ng8aVJJZ.js +728 -0
- package/docs/README.md +13 -3
- package/docs/build/browser-composition-fixture.ts +28 -0
- package/docs/build/recipes.md +11484 -10723
- package/docs/generated/component-index.json +9809 -9169
- package/docs/generated/components/INDEX.md +5 -5
- package/docs/generated/components/base--accordion.md +51 -2
- package/docs/generated/components/base--action-menu.md +14 -15
- package/docs/generated/components/base--alert-dialog.md +3 -4
- package/docs/generated/components/base--aspect-ratio.md +3 -4
- package/docs/generated/components/base--avatar.md +7 -7
- package/docs/generated/components/base--badge.md +159 -27
- package/docs/generated/components/base--batch-action-bar.md +6 -7
- package/docs/generated/components/base--buttons.md +151 -47
- package/docs/generated/components/base--cards.md +107 -14
- package/docs/generated/components/base--carousel.md +1 -2
- package/docs/generated/components/base--chart.md +44 -8
- package/docs/generated/components/base--choice-inputs.md +10 -11
- package/docs/generated/components/base--combobox.md +3 -4
- package/docs/generated/components/base--command.md +6 -6
- package/docs/generated/components/base--context-menu.md +1 -2
- package/docs/generated/components/base--copyable.md +6 -7
- package/docs/generated/components/base--date-pickers.md +6 -7
- package/docs/generated/components/base--dialog.md +6 -7
- package/docs/generated/components/base--direction.md +1 -1
- package/docs/generated/components/base--display.md +234 -54
- package/docs/generated/components/base--dropdown-menu.md +6 -7
- package/docs/generated/components/base--feedback.md +71 -18
- package/docs/generated/components/base--forms-numeric.md +6 -7
- package/docs/generated/components/base--forms.md +84 -14
- package/docs/generated/components/base--hover-card.md +3 -4
- package/docs/generated/components/base--input-group.md +27 -30
- package/docs/generated/components/base--item.md +8 -9
- package/docs/generated/components/base--label.md +2 -3
- package/docs/generated/components/base--menubar.md +2 -4
- package/docs/generated/components/base--navigation-menu.md +2 -3
- package/docs/generated/components/base--navigation.md +2 -3
- package/docs/generated/components/base--otp-input.md +3 -4
- package/docs/generated/components/base--overlay.md +56 -47
- package/docs/generated/components/base--popover-menu.md +7 -8
- package/docs/generated/components/base--popover.md +9 -10
- package/docs/generated/components/base--qr-code.md +7 -8
- package/docs/generated/components/base--repeaters.md +6 -7
- package/docs/generated/components/base--resizable.md +2 -3
- package/docs/generated/components/base--sheet.md +12 -13
- package/docs/generated/components/base--sidebar.md +9 -11
- package/docs/generated/components/base--skeleton.md +6 -7
- package/docs/generated/components/base--slot.md +1 -1
- package/docs/generated/components/base--spinner.md +5 -7
- package/docs/generated/components/base--structure.md +320 -70
- package/docs/generated/components/base--table.md +61 -3
- package/docs/generated/components/base--text-inputs.md +17 -18
- package/docs/generated/components/base--timeline.md +45 -4
- package/docs/generated/components/base--toaster.md +43 -12
- package/docs/generated/components/base--toggle.md +11 -12
- package/docs/generated/components/base--toolbar.md +7 -8
- package/docs/generated/components/base--tooltip.md +5 -6
- package/docs/generated/components/base--typography.md +317 -32
- package/docs/generated/components/base--upload.md +8 -9
- package/docs/generated/components/base--value-inputs.md +9 -38
- package/docs/generated/components/{admin--patterns--access.md → blocks--admin--access.md} +15 -6
- package/docs/generated/components/{admin--patterns--commerce.md → blocks--admin--commerce.md} +40 -41
- package/docs/generated/components/{patterns--analytics.md → blocks--analytics.md} +57 -14
- package/docs/generated/components/{patterns--onboarding.md → blocks--onboarding.md} +6 -7
- package/docs/generated/components/{patterns--timelines.md → blocks--timelines.md} +6 -7
- package/docs/generated/components/features--actions.md +8 -18
- package/docs/generated/components/features--activities.md +31 -32
- package/docs/generated/components/features--ai-chat.md +15 -15
- package/docs/generated/components/features--async-preview.md +5 -6
- package/docs/generated/components/features--combobox.md +71 -5
- package/docs/generated/components/features--comments.md +0 -1
- package/docs/generated/components/features--data-view.md +63 -8
- package/docs/generated/components/features--event-calendar.md +1 -2
- package/docs/generated/components/features--filters.md +11 -2
- package/docs/generated/components/features--global-search.md +1 -2
- package/docs/generated/components/features--kanban.md +1 -2
- package/docs/generated/components/features--map.md +1 -2
- package/docs/generated/components/features--media-library.md +105 -38
- package/docs/generated/components/features--mentions.md +7 -7
- package/docs/generated/components/features--overlays.md +75 -22
- package/docs/generated/components/features--products.md +10 -11
- package/docs/generated/components/features--resource-assignment.md +2 -3
- package/docs/generated/components/features--resource.md +3 -4
- package/docs/generated/components/features--rich-text-editor.md +42 -13
- package/docs/generated/components/features--schema-form.md +1 -2
- package/docs/generated/components/features--sync.md +2 -3
- package/docs/generated/components/features--table.md +162 -12
- package/docs/generated/components/features--theme-tweaker.md +30 -15
- package/docs/generated/components/forms.md +2 -2
- package/docs/generated/components/layout--app-shell.md +41 -11
- package/docs/generated/components/layout--auth.md +8 -9
- package/docs/generated/components/layout--containers.md +40 -1
- package/docs/generated/components/layout--header.md +2 -3
- package/docs/generated/components/layout--navigation.md +0 -1
- package/docs/generated/components/layout--page.md +33 -5
- package/docs/generated/components/layout--settings.md +0 -1
- package/docs/generated/components/layout--sidebar.md +47 -7
- package/docs/generated/components/layout--workspace.md +3 -4
- package/docs/generated/components/primitives.md +128 -17
- package/docs/generated/components/theming.md +147 -4
- package/docs/generated/components/ui-provider.md +96 -78
- package/docs/generated/composition-ladder.md +8 -8
- package/docs/generated/consumer-contract.json +5736 -0
- package/docs/generated/imports.md +104 -104
- package/docs/generated/migration-broad-imports.json +267 -90
- package/docs/generated/migration-broad-imports.md +266 -101
- package/docs/generated/migration-codemod.json +365 -70
- package/docs/generated/migration.md +665 -95
- package/docs/generated/profiles.md +27 -27
- package/docs/generated/public-api.md +104 -102
- package/docs/generated/recipes.json +755 -810
- package/docs/generated/workflows/communications-overview/analytics/communications-reference.tsx +19 -0
- package/docs/generated/workflows/index.json +691 -0
- package/docs/generated/workflows/media-picking/media-library/media-picking-reference.tsx +63 -0
- package/docs/generated/workflows/media-picking/media-library/reference-data.ts +3 -0
- package/docs/generated/workflows/multi-section-form/form-workflow/multi-section-reference.tsx +46 -0
- package/docs/generated/workflows/nested-action-flow/action-overlays/nested-action-reference.tsx +39 -0
- package/docs/generated/workflows/record-detail/page-layout/record-detail-reference.tsx +24 -0
- package/docs/generated/workflows/resource-index/data-view/resource-index-reference.tsx +51 -0
- package/docs/generated/workflows/scoped-resource-selection/combobox/scoped-resource-reference.tsx +50 -0
- package/docs/generated/workflows/website-content-editor/media-library/reference-data.ts +3 -0
- package/docs/generated/workflows/website-content-editor/rich-text-editor/website-content-reference.tsx +33 -0
- package/docs/generated/workflows/workspace-navigation/app-shell/workspace-navigation-reference.tsx +26 -0
- package/docs/learn/api-compatibility.md +5 -4
- package/docs/learn/blocks.md +123 -0
- package/docs/learn/composition.md +100 -19
- package/docs/learn/forms.md +23 -3
- package/docs/learn/framework-wiring.md +41 -13
- package/docs/learn/i18n.md +4 -2
- package/docs/learn/installation.md +60 -31
- package/docs/learn/migration.md +156 -5
- package/docs/learn/provider-and-scoping.md +37 -25
- package/docs/learn/reference-workflows.md +43 -0
- package/docs/learn/structure-and-spacing.md +147 -0
- package/docs/learn/theming.md +174 -131
- package/docs/learn/troubleshooting.md +88 -30
- package/docs/learn/verification.md +60 -5
- package/package.json +42 -473
- package/scripts/consumer/codemod.mjs +50 -32
- package/scripts/consumer/contract-reader.mjs +42 -0
- package/scripts/consumer/css-scan.mjs +51 -0
- package/scripts/consumer/diagnose.mjs +136 -0
- package/scripts/consumer/find-component.mjs +30 -17
- package/scripts/consumer/install-skill.mjs +93 -11
- package/src/styles/TOKENS.md +116 -275
- package/dist/accordion-6YPJ9XRO.js +0 -135
- package/dist/admin/patterns/access.css +0 -15
- package/dist/admin/patterns/commerce.css +0 -29
- package/dist/admin/patterns/commerce.js +0 -2493
- package/dist/avatar-CS7zow2q.js +0 -85
- package/dist/badge-CxOuTfVr.js +0 -63
- package/dist/base/accordion.css +0 -3
- package/dist/base/action-menu.css +0 -6
- package/dist/base/alert-dialog.css +0 -4
- package/dist/base/aspect-ratio.css +0 -2
- package/dist/base/avatar.css +0 -4
- package/dist/base/badge.css +0 -2
- package/dist/base/batch-action-bar.css +0 -5
- package/dist/base/buttons.css +0 -4
- package/dist/base/cards.css +0 -13
- package/dist/base/carousel.css +0 -5
- package/dist/base/chart.css +0 -2
- package/dist/base/choice-inputs.css +0 -10
- package/dist/base/combobox.css +0 -3
- package/dist/base/command.css +0 -9
- package/dist/base/context-menu.css +0 -2
- package/dist/base/copyable.css +0 -6
- package/dist/base/date-pickers.css +0 -11
- package/dist/base/dialog.css +0 -4
- package/dist/base/display.css +0 -8
- package/dist/base/dropdown-menu.css +0 -2
- package/dist/base/feedback.css +0 -5
- package/dist/base/forms-numeric.css +0 -12
- package/dist/base/forms.css +0 -14
- package/dist/base/hover-card.css +0 -2
- package/dist/base/input-group.css +0 -6
- package/dist/base/item.css +0 -9
- package/dist/base/label.css +0 -3
- package/dist/base/menubar.css +0 -2
- package/dist/base/navigation-menu.css +0 -2
- package/dist/base/navigation.css +0 -12
- package/dist/base/otp-input.css +0 -9
- package/dist/base/overlay.css +0 -4
- package/dist/base/popover-menu.css +0 -11
- package/dist/base/popover.css +0 -3
- package/dist/base/qr-code.css +0 -2
- package/dist/base/repeaters.css +0 -18
- package/dist/base/resizable.css +0 -2
- package/dist/base/sheet.css +0 -4
- package/dist/base/sidebar.css +0 -12
- package/dist/base/skeleton.css +0 -9
- package/dist/base/spinner.css +0 -2
- package/dist/base/structure.css +0 -2
- package/dist/base/table.css +0 -3
- package/dist/base/text-inputs.css +0 -2
- package/dist/base/timeline.css +0 -9
- package/dist/base/toaster.css +0 -2
- package/dist/base/toggle.css +0 -2
- package/dist/base/toolbar.css +0 -5
- package/dist/base/tooltip.css +0 -2
- package/dist/base/typography.css +0 -2
- package/dist/base/upload.css +0 -10
- package/dist/base/value-inputs.css +0 -14
- package/dist/buttons-CqXKWty3.js +0 -179
- package/dist/cards-C6Ulbkw7.js +0 -271
- package/dist/chart-nomhJ87z.js +0 -193
- package/dist/choice-inputs-OUDn0kQw.js +0 -680
- package/dist/combobox-C8oP92bT.js +0 -266
- package/dist/command-Bp3B6pUu.js +0 -143
- package/dist/comments-CAnDlyXO.js +0 -1438
- package/dist/components/admin/patterns/index.d.ts +0 -2
- package/dist/components/features/rich-text-editor/exec-command-engine.d.ts +0 -2
- package/dist/components/patterns/index.d.ts +0 -3
- package/dist/css/styles.css +0 -1
- package/dist/date-pickers-DOwIT-Nk.js +0 -661
- package/dist/display-B3Q17h5z.js +0 -645
- package/dist/dropdown-menu-TyNLCLML.js +0 -223
- package/dist/features/actions.css +0 -11
- package/dist/features/activities.css +0 -25
- package/dist/features/ai-chat.css +0 -14
- package/dist/features/async-preview.css +0 -10
- package/dist/features/combobox.css +0 -12
- package/dist/features/comments.css +0 -24
- package/dist/features/data-view.css +0 -31
- package/dist/features/event-calendar.css +0 -17
- package/dist/features/filters.css +0 -24
- package/dist/features/global-search.css +0 -19
- package/dist/features/kanban.css +0 -7
- package/dist/features/map.css +0 -15
- package/dist/features/media-library.css +0 -27
- package/dist/features/mentions.css +0 -17
- package/dist/features/overlays.css +0 -11
- package/dist/features/products.css +0 -29
- package/dist/features/resource-assignment.css +0 -14
- package/dist/features/resource.css +0 -15
- package/dist/features/rich-text-editor.css +0 -8
- package/dist/features/schema-form.css +0 -22
- package/dist/features/sync.css +0 -11
- package/dist/features/table.css +0 -20
- package/dist/features/theme-tweaker.css +0 -27
- package/dist/feedback-DRerHGuV.js +0 -469
- package/dist/forms-CPrGGif_.js +0 -242
- package/dist/forms-numeric-CPVsL7Vf.js +0 -569
- package/dist/index.css +0 -3
- package/dist/input-group-BYe0rhoB.js +0 -126
- package/dist/item-B3yQ26as.js +0 -146
- package/dist/layout/app-shell.css +0 -13
- package/dist/layout/auth.css +0 -14
- package/dist/layout/containers.css +0 -2
- package/dist/layout/header.css +0 -20
- package/dist/layout/navigation.css +0 -11
- package/dist/layout/page.css +0 -15
- package/dist/layout/settings.css +0 -16
- package/dist/layout/sidebar.css +0 -16
- package/dist/layout/workspace.css +0 -15
- package/dist/navigation-CsqTA16F.js +0 -614
- package/dist/navigation-DzxzPuwg.js +0 -202
- package/dist/overlay-WQOsLd69.js +0 -345
- package/dist/patterns/analytics.css +0 -15
- package/dist/patterns/onboarding.css +0 -11
- package/dist/patterns/timelines.css +0 -11
- package/dist/popover-DriLnIFc.js +0 -123
- package/dist/popover-menu-C2UCMAe7.js +0 -189
- package/dist/primitives.css +0 -3
- package/dist/repeaters-DuP1N0nw.js +0 -438
- package/dist/rich-text-editor-BQXFe9oN.js +0 -595
- package/dist/sidebar-D0N6ckJL.js +0 -412
- package/dist/skeleton-DGR9df28.js +0 -172
- package/dist/spinner-CUAVFecI.js +0 -52
- package/dist/styles/FACTORS.md +0 -36
- package/dist/styles/SCOPES.md +0 -86
- package/dist/styles/themes/default.css +0 -164
- package/dist/styles/theming/animation.css +0 -143
- package/dist/styles/theming/colors.css +0 -97
- package/dist/styles/theming/feedback.css +0 -17
- package/dist/styles/theming/field.css +0 -21
- package/dist/styles/theming/focus.css +0 -88
- package/dist/styles/theming/layers.css +0 -13
- package/dist/styles/theming/layout.css +0 -21
- package/dist/styles/theming/motion.css +0 -42
- package/dist/styles/theming/overlay.css +0 -52
- package/dist/styles/theming/sizing.css +0 -118
- package/dist/styles/theming/text.css +0 -30
- package/dist/styles/theming/typography.css +0 -26
- package/dist/styles/tokens/components.css +0 -22
- package/dist/styles/tokens/foundation.css +0 -80
- package/dist/styles/tokens/layout.css +0 -19
- package/dist/styles/tokens/palette.css +0 -88
- package/dist/styles/tokens/primitives.css +0 -18
- package/dist/styles/tokens/states.css +0 -77
- package/dist/table-BC4qqsUb.js +0 -180
- package/dist/table-BHDpjajL.js +0 -982
- package/dist/text-inputs-DF_lD7pA.js +0 -385
- package/dist/theming-D6KRU7hO.js +0 -104
- package/dist/toolbar-DWRywF0R.js +0 -68
- package/dist/tooltip-t1VQQ2tZ.js +0 -73
- package/dist/upload-B38YZeFJ.js +0 -938
- package/dist/value-inputs-Q4ymjXlV.js +0 -716
- package/src/styles/FACTORS.md +0 -36
- package/src/styles/SCOPES.md +0 -86
- /package/dist/components/{admin/patterns → blocks/admin}/access/admin.strings.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/access/credential-list.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/access/index.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/access/role-permissions.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/access/sensitive-action.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/account.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/address-lines.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/booking.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/cart.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/commerce.strings.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/commerce.types.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/format-amount.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/index.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/inventory-section.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/invoice.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/loyalty.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/order-customer.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/order-detail.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/order-line-item.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/order-transactions.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/order.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/seo-listing.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/seo-score.d.ts +0 -0
- /package/dist/components/{admin/patterns → blocks/admin}/commerce/summary-panel.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/activity-heatmap.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/analytics.types.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/chart-card.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/format-metric-value.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/index.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/metric-bar.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/metric-comparison.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/metric-gradient.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/metric-grid.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/metric-micro-grid.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/metric-skeleton.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/metric-trend-chip.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/metric.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/analytics/time-ruler.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/onboarding/checklist.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/onboarding/index.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/onboarding/onboarding.strings.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/timelines/changelog-timeline.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/timelines/index.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/timelines/milestones-timeline.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/timelines/steps.d.ts +0 -0
- /package/dist/components/{patterns → blocks}/timelines/timelines.strings.d.ts +0 -0
- /package/dist/styles/{theming/breakpoints.css → breakpoints.css} +0 -0
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { c as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { C as
|
|
9
|
-
import { t as
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { c as
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import { t as
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
2
|
+
import "#core.css";
|
|
3
|
+
import { a as e, s as t } from "../typography-DmeR05Er.js";
|
|
4
|
+
import { t as n } from "../cx--CBrhWH0.js";
|
|
5
|
+
import { c as r } from "../buttons-BX2JfL5X.js";
|
|
6
|
+
import { o as i } from "../structure-CynEZ-OY.js";
|
|
7
|
+
import { t as a } from "../strings-Co9_qArR.js";
|
|
8
|
+
import { C as o, S as s, f as c, w as l, z as u } from "../primitives-BskKlf35.js";
|
|
9
|
+
import { t as d } from "../badge-VlJVZjdm.js";
|
|
10
|
+
import { t as f } from "../batch-action-bar-DZVMVW83.js";
|
|
11
|
+
import { _ as p, g as m, h, n as g, p as _, s as v, t as y } from "../feedback-D4qVsKlD.js";
|
|
12
|
+
import { l as ee, n as b } from "../display-a7AoX_u7.js";
|
|
13
|
+
import { n as x, s as te, x as S } from "../choice-inputs-NwRxvmZN.js";
|
|
14
|
+
import { c as ne, l as C } from "../text-inputs-BboE77nZ.js";
|
|
15
|
+
import { u as w } from "../forms-C0WeNPFF.js";
|
|
16
|
+
import { d as re, f as T, p as E, u as D } from "../navigation-Bgu7Vc0M.js";
|
|
17
|
+
import { l as O } from "../upload-CYuoJykZ.js";
|
|
18
|
+
import { c as k, i as A, l as ie, n as ae, s as j, t as M } from "../table-Ds_eO9av.js";
|
|
19
|
+
import { s as oe } from "../value-inputs-ng8aVJJZ.js";
|
|
20
|
+
import { r as se } from "../overlays-1sULyytH.js";
|
|
21
|
+
import { t as ce } from "../use-synced-state-DnZ4lW4g.js";
|
|
22
|
+
import { CheckIcon as N, ChevronLeftIcon as le, ChevronRightIcon as ue, FileIcon as de, FilmIcon as fe, ImageIcon as pe, LayoutGridIcon as me, ListIcon as he, MoreHorizontalIcon as ge, PlusIcon as _e, SearchIcon as ve, StarIcon as ye, Table2Icon as be, Trash2Icon as xe, XIcon as Se } from "lucide-react";
|
|
23
|
+
import { useCallback as P, useEffect as F, useMemo as I, useRef as L, useState as R } from "react";
|
|
24
|
+
import { Fragment as Ce, jsx as z, jsxs as B } from "react/jsx-runtime";
|
|
25
|
+
import "#css/media-library.css";
|
|
24
26
|
//#region src/components/features/media-library/media-library.strings.ts
|
|
25
|
-
var
|
|
27
|
+
var V = {
|
|
26
28
|
title: "Media library",
|
|
27
29
|
description: "Browse, upload, and pick assets.",
|
|
28
30
|
tabs: {
|
|
@@ -140,14 +142,14 @@ var L = {
|
|
|
140
142
|
emptyDescription: "Add an asset to show it here.",
|
|
141
143
|
limitReached: (e) => `${e} is the maximum.`
|
|
142
144
|
}
|
|
143
|
-
},
|
|
145
|
+
}, we = {
|
|
144
146
|
collection: void 0,
|
|
145
147
|
tags: [],
|
|
146
148
|
public: !0
|
|
147
|
-
},
|
|
148
|
-
function
|
|
149
|
-
let [r, i] =
|
|
150
|
-
return [a,
|
|
149
|
+
}, Te = [];
|
|
150
|
+
function Ee(e, t, n) {
|
|
151
|
+
let [r, i] = R(t), a = e ?? r;
|
|
152
|
+
return [a, P((t) => {
|
|
151
153
|
let r = typeof t == "function" ? t(a) : t;
|
|
152
154
|
e === void 0 && i(r), n?.(r);
|
|
153
155
|
}, [
|
|
@@ -156,7 +158,7 @@ function Ae(e, t, n) {
|
|
|
156
158
|
a
|
|
157
159
|
])];
|
|
158
160
|
}
|
|
159
|
-
var
|
|
161
|
+
var De = {
|
|
160
162
|
getId: (e) => e.id,
|
|
161
163
|
getName: (e) => e.name,
|
|
162
164
|
getType: (e) => e.type,
|
|
@@ -174,47 +176,47 @@ var je = {
|
|
|
174
176
|
getTint: (e) => e.tint,
|
|
175
177
|
getMimeType: (e) => e.mimeType
|
|
176
178
|
};
|
|
177
|
-
function
|
|
179
|
+
function Oe(e) {
|
|
178
180
|
return {
|
|
179
|
-
...
|
|
181
|
+
...De,
|
|
180
182
|
...e ?? {}
|
|
181
183
|
};
|
|
182
184
|
}
|
|
183
|
-
function
|
|
184
|
-
return e === void 0 ? "" :
|
|
185
|
+
function H(e) {
|
|
186
|
+
return e === void 0 ? "" : o(e);
|
|
185
187
|
}
|
|
186
|
-
function
|
|
188
|
+
function ke(e, t) {
|
|
187
189
|
let n = t.getWidth(e), r = t.getHeight(e);
|
|
188
190
|
return !n || !r ? "" : `${n} × ${r}`;
|
|
189
191
|
}
|
|
190
|
-
function
|
|
192
|
+
function Ae(e, t) {
|
|
191
193
|
let n = t.getUploadedAt(e);
|
|
192
194
|
if (!n) return 0;
|
|
193
195
|
let r = (n instanceof Date ? n : new Date(n)).getTime();
|
|
194
196
|
return Number.isFinite(r) ? r : 0;
|
|
195
197
|
}
|
|
196
|
-
function
|
|
198
|
+
function je(e) {
|
|
197
199
|
return e.type.startsWith("image/") ? "image" : e.type.startsWith("video/") ? "video" : "file";
|
|
198
200
|
}
|
|
199
|
-
function
|
|
201
|
+
function Me(e) {
|
|
200
202
|
if (e.type.startsWith("image/") && !(typeof URL > "u" || typeof URL.createObjectURL != "function")) return URL.createObjectURL(e);
|
|
201
203
|
}
|
|
202
|
-
function
|
|
204
|
+
function Ne(e) {
|
|
203
205
|
!e || typeof URL > "u" || typeof URL.revokeObjectURL != "function" || URL.revokeObjectURL(e);
|
|
204
206
|
}
|
|
205
|
-
function
|
|
207
|
+
function Pe(e) {
|
|
206
208
|
return Array.isArray(e) ? {
|
|
207
209
|
items: e,
|
|
208
210
|
total: e.length
|
|
209
211
|
} : e;
|
|
210
212
|
}
|
|
211
|
-
function
|
|
213
|
+
function Fe(e, t) {
|
|
212
214
|
return t && typeof e == "object" && e ? {
|
|
213
215
|
...e,
|
|
214
216
|
...t
|
|
215
217
|
} : e;
|
|
216
218
|
}
|
|
217
|
-
function
|
|
219
|
+
function Ie(e, t, n, r, i) {
|
|
218
220
|
let a = n.trim().toLowerCase();
|
|
219
221
|
return e.filter((e) => r !== "all" && t.getType(e) !== r || i !== "all" && t.getCollection(e) !== i ? !1 : !a || [
|
|
220
222
|
t.getName(e),
|
|
@@ -223,211 +225,211 @@ function ze(e, t, n, r, i) {
|
|
|
223
225
|
...t.getTags(e)
|
|
224
226
|
].filter(Boolean).join(" ").toLowerCase().includes(a));
|
|
225
227
|
}
|
|
226
|
-
function
|
|
228
|
+
function Le(e, t, n) {
|
|
227
229
|
let r = [...e];
|
|
228
230
|
switch (n) {
|
|
229
231
|
case "name": return r.sort((e, n) => t.getName(e).localeCompare(t.getName(n)));
|
|
230
232
|
case "size": return r.sort((e, n) => (t.getSize(n) ?? 0) - (t.getSize(e) ?? 0));
|
|
231
233
|
case "usage": return r.sort((e, n) => (t.getUsageCount(n) ?? 0) - (t.getUsageCount(e) ?? 0));
|
|
232
|
-
default: return r.sort((e, n) =>
|
|
234
|
+
default: return r.sort((e, n) => Ae(n, t) - Ae(e, t));
|
|
233
235
|
}
|
|
234
236
|
}
|
|
235
|
-
function
|
|
236
|
-
let
|
|
237
|
-
|
|
237
|
+
function Re({ items: e = Te, fetcher: t, accessors: n, selectionMode: r = "multiple", value: i, defaultValue: a, onValueChange: o, onItemUpdate: s, applyItemPatch: c = Fe, onItemDelete: l, onUpload: u, onError: d, tab: f, defaultTab: p = "library", onTabChange: m, view: h, defaultView: g = "grid", onViewChange: _, query: v, defaultQuery: y = "", onQueryChange: ee, type: b, defaultType: x = "all", onTypeChange: te, collection: S, defaultCollection: ne = "all", onCollectionChange: C, sort: w, defaultSort: re = "newest", onSortChange: T, uploadOptions: E, defaultUploadOptions: D, onUploadOptionsChange: O }) {
|
|
238
|
+
let k = I(() => Oe(n), [n]), [A, ie] = Ee(f, p, m), [ae, j] = Ee(h, g, _), [M, oe] = Ee(v, y, ee), [se, ce] = Ee(b, x, te), [N, le] = Ee(S, ne, C), [ue, de] = Ee(w, re, T), [fe, pe] = R(null), [me, he] = R(() => [...a ?? []]), [ge, _e] = R([]), [ve, ye] = R(), [be, xe] = R(!1), [Se, Ce] = R(null), z = P((e, t = "mutation") => {
|
|
239
|
+
Ce(e == null ? null : {
|
|
238
240
|
error: e,
|
|
239
241
|
source: t
|
|
240
242
|
});
|
|
241
|
-
}, []),
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
}, [
|
|
245
|
-
let
|
|
246
|
-
|
|
247
|
-
|
|
243
|
+
}, []), B = Se?.source === "fetch" && !t ? null : Se?.error ?? null, V = Se?.source === "fetch" && t ? Se.error : null, [De, H] = R(0), ke = P(() => H((e) => e + 1), []), Ae = L(k);
|
|
244
|
+
F(() => {
|
|
245
|
+
Ae.current = k;
|
|
246
|
+
}, [k]);
|
|
247
|
+
let Re = L(d);
|
|
248
|
+
F(() => {
|
|
249
|
+
Re.current = d;
|
|
248
250
|
}, [d]);
|
|
249
|
-
let [
|
|
250
|
-
...
|
|
251
|
-
...re,
|
|
252
|
-
tags: re?.tags ?? Oe.tags
|
|
253
|
-
}), [re]), [W, G] = Ae(M(() => D ? {
|
|
254
|
-
...Oe,
|
|
251
|
+
let [U, ze] = R([]), [Be, Ve] = R(() => /* @__PURE__ */ new Set()), [He, Ue] = R({}), [We, W] = R([]), [Ge, Ke] = R(!1), qe = I(() => ({
|
|
252
|
+
...we,
|
|
255
253
|
...D,
|
|
256
|
-
tags: D
|
|
257
|
-
}
|
|
258
|
-
|
|
254
|
+
tags: D?.tags ?? we.tags
|
|
255
|
+
}), [D]), [G, K] = Ee(I(() => E ? {
|
|
256
|
+
...we,
|
|
257
|
+
...E,
|
|
258
|
+
tags: E.tags ?? we.tags
|
|
259
|
+
} : void 0, [E]), qe, O), Je = i !== void 0, q = I(() => {
|
|
260
|
+
let e = [...new Set(Je ? i ?? [] : me)];
|
|
259
261
|
return r === "single" ? e.slice(0, 1) : e;
|
|
260
262
|
}, [
|
|
261
|
-
|
|
262
|
-
|
|
263
|
+
me,
|
|
264
|
+
Je,
|
|
263
265
|
r,
|
|
264
266
|
i
|
|
265
|
-
]),
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
}, [
|
|
269
|
-
let
|
|
270
|
-
|
|
267
|
+
]), Ye = I(() => new Set(q), [q]), Xe = L(/* @__PURE__ */ new Set()), J = L(null), Ze = L(/* @__PURE__ */ new Map()), Y = L(/* @__PURE__ */ new Map()), [Qe, $e] = R(/* @__PURE__ */ new Map()), X = L(q);
|
|
268
|
+
F(() => {
|
|
269
|
+
X.current = q;
|
|
270
|
+
}, [q]);
|
|
271
|
+
let et = L(0);
|
|
272
|
+
F(() => {
|
|
271
273
|
if (!t) return;
|
|
272
274
|
let e = new AbortController();
|
|
273
|
-
return
|
|
274
|
-
query:
|
|
275
|
-
type:
|
|
276
|
-
collection:
|
|
277
|
-
sort:
|
|
275
|
+
return xe(!0), z(null), (async () => t({
|
|
276
|
+
query: M,
|
|
277
|
+
type: se,
|
|
278
|
+
collection: N === "all" ? void 0 : N,
|
|
279
|
+
sort: ue,
|
|
278
280
|
signal: e.signal
|
|
279
281
|
}))().then((t) => {
|
|
280
282
|
if (e.signal.aborted) return;
|
|
281
|
-
let n =
|
|
282
|
-
|
|
283
|
-
let t = new Set(
|
|
284
|
-
return new Map([...e, ...n.items.map((e) => [
|
|
285
|
-
}),
|
|
283
|
+
let n = Pe(t);
|
|
284
|
+
$e((e) => {
|
|
285
|
+
let t = new Set(X.current);
|
|
286
|
+
return new Map([...e, ...n.items.map((e) => [Ae.current.getId(e), e])].filter(([e]) => t.has(e)));
|
|
287
|
+
}), _e(n.items), ye(n.total);
|
|
286
288
|
}).catch((t) => {
|
|
287
|
-
e.signal.aborted || (
|
|
289
|
+
e.signal.aborted || (z(t, "fetch"), Re.current?.(t));
|
|
288
290
|
}).finally(() => {
|
|
289
|
-
e.signal.aborted ||
|
|
291
|
+
e.signal.aborted || xe(!1);
|
|
290
292
|
}), () => e.abort();
|
|
291
293
|
}, [
|
|
292
|
-
|
|
294
|
+
N,
|
|
293
295
|
t,
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
]),
|
|
300
|
-
let e =
|
|
296
|
+
De,
|
|
297
|
+
M,
|
|
298
|
+
z,
|
|
299
|
+
ue,
|
|
300
|
+
se
|
|
301
|
+
]), F(() => {
|
|
302
|
+
let e = Xe.current;
|
|
301
303
|
return () => {
|
|
302
|
-
|
|
303
|
-
for (let t of e)
|
|
304
|
+
J.current?.abort();
|
|
305
|
+
for (let t of e) Ne(t);
|
|
304
306
|
e.clear();
|
|
305
307
|
};
|
|
306
308
|
}, []);
|
|
307
|
-
let
|
|
308
|
-
|
|
309
|
-
|
|
309
|
+
let tt = I(() => t ? ge : [...U, ...e], [
|
|
310
|
+
U,
|
|
311
|
+
ge,
|
|
310
312
|
t,
|
|
311
313
|
e
|
|
312
|
-
]),
|
|
313
|
-
|
|
314
|
+
]), Z = I(() => [...new Map(tt.map((e) => [k.getId(e), e])).values()].filter((e) => !Be.has(k.getId(e))).map((e) => He[k.getId(e)] ? c(e, He[k.getId(e)]) : e), [
|
|
315
|
+
k,
|
|
314
316
|
c,
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
]),
|
|
319
|
-
O,
|
|
320
|
-
A,
|
|
321
|
-
t,
|
|
322
|
-
X,
|
|
317
|
+
He,
|
|
318
|
+
Be,
|
|
319
|
+
tt
|
|
320
|
+
]), nt = I(() => t ? Z : Le(Ie(Z, k, M, se, N), k, ue), [
|
|
323
321
|
k,
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
322
|
+
N,
|
|
323
|
+
t,
|
|
324
|
+
Z,
|
|
325
|
+
M,
|
|
326
|
+
ue,
|
|
327
|
+
se
|
|
328
|
+
]), Q = I(() => new Map(Z.map((e) => [k.getId(e), e])), [k, Z]), rt = q.flatMap((e) => {
|
|
329
|
+
let t = Q.get(e) ?? Qe.get(e);
|
|
328
330
|
return t === void 0 ? [] : [t];
|
|
329
331
|
});
|
|
330
|
-
|
|
331
|
-
for (let e of
|
|
332
|
-
for (let e of
|
|
332
|
+
F(() => {
|
|
333
|
+
for (let e of Y.current.keys()) Ye.has(e) || Y.current.delete(e);
|
|
334
|
+
for (let e of q) {
|
|
333
335
|
let t = Q.get(e);
|
|
334
|
-
t !== void 0 &&
|
|
336
|
+
t !== void 0 && Y.current.set(e, t);
|
|
335
337
|
}
|
|
336
338
|
}, [
|
|
337
339
|
Q,
|
|
338
|
-
|
|
339
|
-
|
|
340
|
+
q,
|
|
341
|
+
Ye
|
|
340
342
|
]);
|
|
341
|
-
let $ =
|
|
343
|
+
let $ = P((e) => {
|
|
342
344
|
let t = [...new Set(e)], n = r === "single" ? t.slice(0, 1) : t;
|
|
343
|
-
|
|
345
|
+
X.current = n, Je || he(n);
|
|
344
346
|
let i = n.flatMap((e) => {
|
|
345
|
-
let t = Q.get(e) ??
|
|
346
|
-
return t === void 0 ? [] : (
|
|
347
|
+
let t = Q.get(e) ?? Y.current.get(e);
|
|
348
|
+
return t === void 0 ? [] : (Y.current.set(e, t), [t]);
|
|
347
349
|
});
|
|
348
|
-
|
|
350
|
+
$e(new Map(i.map((e) => [k.getId(e), e]))), o?.(n, i);
|
|
349
351
|
}, [
|
|
350
|
-
|
|
351
|
-
|
|
352
|
+
k,
|
|
353
|
+
Je,
|
|
352
354
|
o,
|
|
353
355
|
Q,
|
|
354
356
|
r
|
|
355
|
-
]), it =
|
|
356
|
-
if (!Q.has(e) && !
|
|
357
|
+
]), it = P((e) => {
|
|
358
|
+
if (!Q.has(e) && !Y.current.has(e)) return;
|
|
357
359
|
if (r === "single") {
|
|
358
360
|
$([e]);
|
|
359
361
|
return;
|
|
360
362
|
}
|
|
361
|
-
let t = new Set(
|
|
363
|
+
let t = new Set(X.current);
|
|
362
364
|
t.has(e) ? t.delete(e) : t.add(e), $([...t]);
|
|
363
365
|
}, [
|
|
364
366
|
$,
|
|
365
367
|
Q,
|
|
366
368
|
r
|
|
367
|
-
]), at =
|
|
368
|
-
|
|
369
|
+
]), at = P(() => $([]), [$]), ot = P(() => $([...X.current, ...nt.map(k.getId)]), [
|
|
370
|
+
k,
|
|
369
371
|
$,
|
|
370
|
-
|
|
371
|
-
]), st =
|
|
372
|
-
let e = new Set(
|
|
373
|
-
$(
|
|
372
|
+
nt
|
|
373
|
+
]), st = P(() => {
|
|
374
|
+
let e = new Set(nt.map(k.getId));
|
|
375
|
+
$(X.current.filter((t) => !e.has(t)));
|
|
374
376
|
}, [
|
|
375
|
-
|
|
377
|
+
k,
|
|
376
378
|
$,
|
|
377
|
-
|
|
378
|
-
]), ct =
|
|
379
|
-
|
|
379
|
+
nt
|
|
380
|
+
]), ct = P(() => {
|
|
381
|
+
oe(""), ce("all"), le("all");
|
|
380
382
|
}, [
|
|
381
|
-
fe,
|
|
382
383
|
le,
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
384
|
+
oe,
|
|
385
|
+
ce
|
|
386
|
+
]), lt = P((e) => {
|
|
387
|
+
if (J.current) return;
|
|
386
388
|
let t = e.map((e) => {
|
|
387
|
-
let t =
|
|
388
|
-
return t &&
|
|
389
|
-
id: `staged-${++
|
|
389
|
+
let t = Me(e);
|
|
390
|
+
return t && Xe.current.add(t), {
|
|
391
|
+
id: `staged-${++et.current}`,
|
|
390
392
|
file: e,
|
|
391
393
|
name: e.name,
|
|
392
394
|
size: e.size,
|
|
393
|
-
type:
|
|
395
|
+
type: je(e),
|
|
394
396
|
src: t,
|
|
395
397
|
progress: 0,
|
|
396
398
|
status: "staged"
|
|
397
399
|
};
|
|
398
400
|
});
|
|
399
|
-
|
|
400
|
-
}, []), ut =
|
|
401
|
-
|
|
401
|
+
W((e) => [...e, ...t]);
|
|
402
|
+
}, []), ut = P((e) => {
|
|
403
|
+
J.current || W((t) => {
|
|
402
404
|
let n = t.find((t) => t.id === e);
|
|
403
|
-
return n?.src && (
|
|
405
|
+
return n?.src && (Ne(n.src), Xe.current.delete(n.src)), t.filter((t) => t.id !== e);
|
|
404
406
|
});
|
|
405
|
-
}, []), dt =
|
|
406
|
-
|
|
407
|
-
for (let t of e) t.src && (
|
|
407
|
+
}, []), dt = P(() => {
|
|
408
|
+
J.current || W((e) => {
|
|
409
|
+
for (let t of e) t.src && (Ne(t.src), Xe.current.delete(t.src));
|
|
408
410
|
return [];
|
|
409
411
|
});
|
|
410
|
-
}, []), ft =
|
|
411
|
-
|
|
412
|
+
}, []), ft = P((e) => {
|
|
413
|
+
K((t) => ({
|
|
412
414
|
...t,
|
|
413
415
|
...e
|
|
414
416
|
}));
|
|
415
|
-
}, [
|
|
416
|
-
|
|
417
|
+
}, [K]), pt = P((e, t) => {
|
|
418
|
+
W((n) => n.map((n) => n.id === e ? {
|
|
417
419
|
...n,
|
|
418
420
|
...t
|
|
419
421
|
} : n));
|
|
420
|
-
}, []), mt =
|
|
421
|
-
if (!u ||
|
|
422
|
+
}, []), mt = P(async () => {
|
|
423
|
+
if (!u || J.current || We.length === 0) return;
|
|
422
424
|
let e = new AbortController();
|
|
423
|
-
|
|
425
|
+
J.current = e, z(null), Ke(!0), W((e) => e.map((e) => ({
|
|
424
426
|
...e,
|
|
425
427
|
status: "uploading",
|
|
426
428
|
progress: 0,
|
|
427
429
|
error: void 0
|
|
428
430
|
})));
|
|
429
|
-
let n = /* @__PURE__ */ new Set(), i = new Set(
|
|
430
|
-
files:
|
|
431
|
+
let n = /* @__PURE__ */ new Set(), i = new Set(We.map((e) => e.id)), a = () => !e.signal.aborted && J.current === e, o = {
|
|
432
|
+
files: We,
|
|
431
433
|
signal: e.signal,
|
|
432
434
|
setProgress: (e, t) => {
|
|
433
435
|
!a() || !i.has(e) || pt(e, { progress: Number.isFinite(t) ? Math.max(0, Math.min(100, t)) : 0 });
|
|
@@ -440,50 +442,50 @@ function Ve({ items: e = ke, fetcher: t, accessors: n, selectionMode: r = "multi
|
|
|
440
442
|
}
|
|
441
443
|
};
|
|
442
444
|
try {
|
|
443
|
-
let a = await u(
|
|
445
|
+
let a = await u(We.map((e) => e.file), G, o);
|
|
444
446
|
if (e.signal.aborted) return;
|
|
445
447
|
if (a?.length) {
|
|
446
|
-
|
|
447
|
-
for (let e of a)
|
|
448
|
-
let e = a.map((e) =>
|
|
449
|
-
$(r === "single" ? e.slice(0, 1) : [.../* @__PURE__ */ new Set([...e, ...
|
|
448
|
+
ze((e) => [...a, ...e]);
|
|
449
|
+
for (let e of a) Y.current.set(k.getId(e), e);
|
|
450
|
+
let e = a.map((e) => k.getId(e));
|
|
451
|
+
$(r === "single" ? e.slice(0, 1) : [.../* @__PURE__ */ new Set([...e, ...X.current])]);
|
|
450
452
|
}
|
|
451
|
-
for (let e of
|
|
452
|
-
|
|
453
|
+
for (let e of We) !n.has(e.id) && e.src && (Ne(e.src), Xe.current.delete(e.src));
|
|
454
|
+
W((e) => e.filter((e) => !i.has(e.id) || n.has(e.id))), t && ke(), n.size === 0 && ie("library");
|
|
453
455
|
} catch (t) {
|
|
454
456
|
if (e.signal.aborted) return;
|
|
455
|
-
|
|
457
|
+
z(t), W((e) => e.map((e) => e.status === "uploading" ? {
|
|
456
458
|
...e,
|
|
457
459
|
status: "error"
|
|
458
460
|
} : e)), d?.(t);
|
|
459
461
|
} finally {
|
|
460
|
-
|
|
462
|
+
J.current === e && (J.current = null, Ke(!1));
|
|
461
463
|
}
|
|
462
464
|
}, [
|
|
463
|
-
|
|
465
|
+
k,
|
|
464
466
|
$,
|
|
465
467
|
d,
|
|
466
468
|
u,
|
|
467
469
|
pt,
|
|
468
470
|
t,
|
|
469
|
-
|
|
471
|
+
ke,
|
|
470
472
|
r,
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
]), ht =
|
|
476
|
-
|
|
473
|
+
z,
|
|
474
|
+
ie,
|
|
475
|
+
We,
|
|
476
|
+
G
|
|
477
|
+
]), ht = P(() => {
|
|
478
|
+
J.current?.abort(), J.current = null, Ke(!1), W((e) => e.map((e) => e.status === "uploading" ? {
|
|
477
479
|
...e,
|
|
478
480
|
status: "staged",
|
|
479
481
|
progress: 0,
|
|
480
482
|
error: void 0
|
|
481
483
|
} : e));
|
|
482
|
-
}, []), gt =
|
|
483
|
-
let n =
|
|
484
|
-
|
|
485
|
-
let a =
|
|
486
|
-
|
|
484
|
+
}, []), gt = P(async (e, t) => {
|
|
485
|
+
let n = k.getId(e), r = `update:${n}`, i = (Ze.current.get(r) ?? 0) + 1;
|
|
486
|
+
Ze.current.set(r, i);
|
|
487
|
+
let a = He[n];
|
|
488
|
+
z(null), Ue((e) => ({
|
|
487
489
|
...e,
|
|
488
490
|
[n]: {
|
|
489
491
|
...e[n],
|
|
@@ -493,79 +495,79 @@ function Ve({ items: e = ke, fetcher: t, accessors: n, selectionMode: r = "multi
|
|
|
493
495
|
try {
|
|
494
496
|
return await s?.(e, t), !0;
|
|
495
497
|
} catch (e) {
|
|
496
|
-
return
|
|
498
|
+
return Ze.current.get(r) === i && Ue((e) => {
|
|
497
499
|
let t = { ...e };
|
|
498
500
|
return a ? t[n] = a : delete t[n], t;
|
|
499
|
-
}),
|
|
501
|
+
}), z(e), d?.(e), !1;
|
|
500
502
|
}
|
|
501
503
|
}, [
|
|
502
|
-
|
|
503
|
-
|
|
504
|
+
k,
|
|
505
|
+
He,
|
|
504
506
|
d,
|
|
505
507
|
s,
|
|
506
|
-
|
|
507
|
-
]), _t =
|
|
508
|
-
let t =
|
|
509
|
-
|
|
508
|
+
z
|
|
509
|
+
]), _t = P(async (e) => {
|
|
510
|
+
let t = k.getId(e);
|
|
511
|
+
z(null);
|
|
510
512
|
try {
|
|
511
|
-
return await l?.(e),
|
|
513
|
+
return await l?.(e), Ve((e) => new Set(e).add(t)), X.current.includes(t) && $(X.current.filter((e) => e !== t)), !0;
|
|
512
514
|
} catch (e) {
|
|
513
|
-
return
|
|
515
|
+
return z(e), d?.(e), !1;
|
|
514
516
|
}
|
|
515
517
|
}, [
|
|
516
|
-
|
|
518
|
+
k,
|
|
517
519
|
$,
|
|
518
520
|
d,
|
|
519
521
|
l,
|
|
520
|
-
|
|
522
|
+
z
|
|
521
523
|
]);
|
|
522
524
|
return {
|
|
523
|
-
tab:
|
|
524
|
-
setTab:
|
|
525
|
-
view:
|
|
526
|
-
setView:
|
|
527
|
-
query:
|
|
528
|
-
setQuery:
|
|
529
|
-
type:
|
|
530
|
-
setType:
|
|
531
|
-
collection:
|
|
532
|
-
setCollection:
|
|
533
|
-
sort:
|
|
534
|
-
setSort:
|
|
535
|
-
detailId:
|
|
536
|
-
setDetailId:
|
|
537
|
-
items:
|
|
538
|
-
visibleItems:
|
|
539
|
-
selectedIds:
|
|
525
|
+
tab: A,
|
|
526
|
+
setTab: ie,
|
|
527
|
+
view: ae,
|
|
528
|
+
setView: j,
|
|
529
|
+
query: M,
|
|
530
|
+
setQuery: oe,
|
|
531
|
+
type: se,
|
|
532
|
+
setType: ce,
|
|
533
|
+
collection: N,
|
|
534
|
+
setCollection: le,
|
|
535
|
+
sort: ue,
|
|
536
|
+
setSort: de,
|
|
537
|
+
detailId: fe,
|
|
538
|
+
setDetailId: pe,
|
|
539
|
+
items: Z,
|
|
540
|
+
visibleItems: nt,
|
|
541
|
+
selectedIds: q,
|
|
540
542
|
selectedItems: rt,
|
|
541
|
-
selectedSet:
|
|
543
|
+
selectedSet: Ye,
|
|
542
544
|
toggleSelection: it,
|
|
543
545
|
clearSelection: at,
|
|
544
546
|
selectVisible: ot,
|
|
545
547
|
deselectVisible: st,
|
|
546
548
|
clearFilters: ct,
|
|
547
|
-
loading: !!t &&
|
|
548
|
-
error:
|
|
549
|
-
fetchError:
|
|
550
|
-
refetch:
|
|
551
|
-
hasFilters: !!
|
|
552
|
-
totalCount: t ?
|
|
553
|
-
filteredCount:
|
|
554
|
-
stagedFiles:
|
|
549
|
+
loading: !!t && be,
|
|
550
|
+
error: B,
|
|
551
|
+
fetchError: V,
|
|
552
|
+
refetch: ke,
|
|
553
|
+
hasFilters: !!M.trim() || se !== "all" || N !== "all",
|
|
554
|
+
totalCount: t ? ve ?? Z.length : Z.length,
|
|
555
|
+
filteredCount: nt.length,
|
|
556
|
+
stagedFiles: We,
|
|
555
557
|
addFiles: lt,
|
|
556
558
|
removeStagedFile: ut,
|
|
557
559
|
clearStagedFiles: dt,
|
|
558
|
-
uploadOptions:
|
|
560
|
+
uploadOptions: G,
|
|
559
561
|
updateUploadOptions: ft,
|
|
560
|
-
uploading:
|
|
562
|
+
uploading: Ge,
|
|
561
563
|
startUpload: mt,
|
|
562
564
|
cancelUpload: ht,
|
|
563
565
|
updateItem: gt,
|
|
564
566
|
removeItem: _t,
|
|
565
|
-
accessors:
|
|
567
|
+
accessors: k
|
|
566
568
|
};
|
|
567
569
|
}
|
|
568
|
-
var
|
|
570
|
+
var U = {
|
|
569
571
|
root: "media-library__root___dutrH",
|
|
570
572
|
header: "media-library__header___xOECc",
|
|
571
573
|
libraryTabs: "media-library__libraryTabs___7wt0y",
|
|
@@ -629,125 +631,125 @@ var B = {
|
|
|
629
631
|
table: "media-library__table___6E5Zv",
|
|
630
632
|
tableName: "media-library__tableName___Zk76p",
|
|
631
633
|
selectionBar: "media-library__selectionBar___uoA0t"
|
|
632
|
-
},
|
|
633
|
-
image: /* @__PURE__ */
|
|
634
|
-
video: /* @__PURE__ */
|
|
635
|
-
file: /* @__PURE__ */
|
|
634
|
+
}, ze = {
|
|
635
|
+
image: /* @__PURE__ */ z(pe, {}),
|
|
636
|
+
video: /* @__PURE__ */ z(fe, {}),
|
|
637
|
+
file: /* @__PURE__ */ z(de, {})
|
|
636
638
|
};
|
|
637
639
|
//#endregion
|
|
638
640
|
//#region src/components/features/media-library/media-preview.tsx
|
|
639
|
-
function
|
|
640
|
-
let i =
|
|
641
|
-
return i !== l && (u(i), c(!1)), i && a === "image" && !s ? /* @__PURE__ */
|
|
641
|
+
function Be({ item: e, accessors: t, className: r }) {
|
|
642
|
+
let i = t.getSrc(e), a = t.getType(e), o = t.getTint(e), [s, c] = R(!1), [l, u] = ce(i);
|
|
643
|
+
return i !== l && (u(i), c(!1)), i && a === "image" && !s ? /* @__PURE__ */ z("img", {
|
|
642
644
|
src: i,
|
|
643
|
-
alt:
|
|
645
|
+
alt: t.getAlt(e) ?? "",
|
|
644
646
|
loading: "lazy",
|
|
645
|
-
className:
|
|
647
|
+
className: n("media-preview--component", U.preview, r),
|
|
646
648
|
onError: () => c(!0)
|
|
647
|
-
}) : /* @__PURE__ */
|
|
649
|
+
}) : /* @__PURE__ */ z("span", {
|
|
648
650
|
"data-tinted": o ? "" : void 0,
|
|
649
|
-
className:
|
|
650
|
-
style: o ? { "--
|
|
651
|
-
children:
|
|
651
|
+
className: n("media-preview--component", U.preview, U.previewFallback, r),
|
|
652
|
+
style: o ? { "--_media-tint": o } : void 0,
|
|
653
|
+
children: ze[a]
|
|
652
654
|
});
|
|
653
655
|
}
|
|
654
656
|
//#endregion
|
|
655
657
|
//#region src/components/features/media-library/media-library-detail.tsx
|
|
656
|
-
function
|
|
657
|
-
let m =
|
|
658
|
-
alt:
|
|
659
|
-
collection:
|
|
660
|
-
tags:
|
|
661
|
-
public:
|
|
662
|
-
}), _ =
|
|
663
|
-
if (
|
|
658
|
+
function Ve({ item: e, collections: i = [], accessors: o, strings: c, onClose: l, onUpdate: u, onRemove: d, renderDetail: f }) {
|
|
659
|
+
let m = a(V, c), g = () => ({
|
|
660
|
+
alt: e ? o.getAlt(e) ?? "" : "",
|
|
661
|
+
collection: e ? o.getCollection(e) ?? "" : "",
|
|
662
|
+
tags: e ? o.getTags(e) : [],
|
|
663
|
+
public: e ? o.getPublic(e) ?? !1 : !1
|
|
664
|
+
}), _ = e ? o.getId(e) : null, [v, y] = R(g), [ee, S] = R(_), [C, re] = R(null), [T, E] = R(null), D = L(!0), O = L(null), k = L(null);
|
|
665
|
+
if (F(() => {
|
|
664
666
|
let e = document.activeElement;
|
|
665
|
-
return
|
|
667
|
+
return k.current?.focus({ preventScroll: !0 }), k.current?.scrollIntoView?.({
|
|
666
668
|
block: "start",
|
|
667
669
|
behavior: "instant"
|
|
668
670
|
}), () => {
|
|
669
671
|
e instanceof HTMLElement && e.isConnected && e.focus();
|
|
670
672
|
};
|
|
671
|
-
}, [_]),
|
|
672
|
-
|
|
673
|
-
}), [_]), _ !== ee && (
|
|
674
|
-
let
|
|
673
|
+
}, [_]), F(() => (D.current = !0, () => {
|
|
674
|
+
D.current = !1, O.current = null;
|
|
675
|
+
}), [_]), _ !== ee && (S(_), y(g()), re(null), E(null)), !e) return null;
|
|
676
|
+
let A = g(), ie = JSON.stringify(A) !== JSON.stringify(v), ae = (e) => {
|
|
675
677
|
y((t) => ({
|
|
676
678
|
...t,
|
|
677
679
|
...e
|
|
678
|
-
})),
|
|
679
|
-
},
|
|
680
|
-
if (
|
|
680
|
+
})), E(null);
|
|
681
|
+
}, j = async (e) => {
|
|
682
|
+
if (O.current) return;
|
|
681
683
|
let t = Symbol(e);
|
|
682
|
-
|
|
684
|
+
O.current = t, re(e), E(null);
|
|
683
685
|
try {
|
|
684
|
-
let n = e === "save" ? await
|
|
686
|
+
let n = e === "save" ? await u({
|
|
685
687
|
...v,
|
|
686
688
|
collection: v.collection || void 0
|
|
687
689
|
}) : await d();
|
|
688
|
-
if (!
|
|
689
|
-
n ? e === "delete" ?
|
|
690
|
+
if (!D.current || O.current !== t) return;
|
|
691
|
+
n ? e === "delete" ? l() : E("saved") : E(e === "save" ? "saveFailed" : "deleteFailed");
|
|
690
692
|
} catch {
|
|
691
|
-
|
|
693
|
+
D.current && O.current === t && E(e === "save" ? "saveFailed" : "deleteFailed");
|
|
692
694
|
} finally {
|
|
693
|
-
|
|
695
|
+
D.current && O.current === t && (O.current = null, re(null));
|
|
694
696
|
}
|
|
695
|
-
},
|
|
696
|
-
return /* @__PURE__ */
|
|
697
|
-
ref:
|
|
697
|
+
}, M = o.getName(e);
|
|
698
|
+
return /* @__PURE__ */ z("aside", {
|
|
699
|
+
ref: k,
|
|
698
700
|
tabIndex: -1,
|
|
699
701
|
onKeyDown: (e) => {
|
|
700
|
-
e.key === "Escape" && !e.defaultPrevented && (e.stopPropagation(),
|
|
702
|
+
e.key === "Escape" && !e.defaultPrevented && (e.stopPropagation(), l());
|
|
701
703
|
},
|
|
702
|
-
"aria-label":
|
|
704
|
+
"aria-label": M,
|
|
703
705
|
"data-slot": "media-library-detail",
|
|
704
|
-
className:
|
|
705
|
-
children:
|
|
706
|
+
className: n("media-library-detail-panel--component", "media-library-detail--component", U.detail),
|
|
707
|
+
children: f ? f(e, {
|
|
706
708
|
accessors: o,
|
|
707
|
-
update:
|
|
709
|
+
update: u,
|
|
708
710
|
remove: d,
|
|
709
|
-
close:
|
|
710
|
-
}) : /* @__PURE__ */
|
|
711
|
-
/* @__PURE__ */
|
|
712
|
-
className:
|
|
713
|
-
children: [/* @__PURE__ */
|
|
711
|
+
close: l
|
|
712
|
+
}) : /* @__PURE__ */ B(Ce, { children: [
|
|
713
|
+
/* @__PURE__ */ B("div", {
|
|
714
|
+
className: U.detailHeader,
|
|
715
|
+
children: [/* @__PURE__ */ z(t, {
|
|
714
716
|
weight: "semibold",
|
|
715
717
|
truncate: !0,
|
|
716
|
-
title:
|
|
717
|
-
children:
|
|
718
|
-
}), /* @__PURE__ */
|
|
718
|
+
title: M,
|
|
719
|
+
children: M
|
|
720
|
+
}), /* @__PURE__ */ z(r, {
|
|
719
721
|
tone: "neutral",
|
|
720
|
-
|
|
722
|
+
appearance: "ghost",
|
|
721
723
|
iconOnly: !0,
|
|
722
724
|
"aria-label": m.close,
|
|
723
|
-
onClick:
|
|
724
|
-
children: /* @__PURE__ */
|
|
725
|
+
onClick: l,
|
|
726
|
+
children: /* @__PURE__ */ z(Se, {})
|
|
725
727
|
})]
|
|
726
728
|
}),
|
|
727
|
-
/* @__PURE__ */
|
|
728
|
-
className:
|
|
729
|
+
/* @__PURE__ */ B("div", {
|
|
730
|
+
className: U.detailBody,
|
|
729
731
|
children: [
|
|
730
|
-
/* @__PURE__ */
|
|
731
|
-
item:
|
|
732
|
+
/* @__PURE__ */ z(Be, {
|
|
733
|
+
item: e,
|
|
732
734
|
accessors: o,
|
|
733
|
-
className:
|
|
735
|
+
className: U.detailPreview
|
|
734
736
|
}),
|
|
735
|
-
/* @__PURE__ */
|
|
737
|
+
/* @__PURE__ */ z(b, {
|
|
736
738
|
layout: "rows",
|
|
737
739
|
columns: 1,
|
|
738
740
|
items: [
|
|
739
741
|
{
|
|
740
742
|
id: "type",
|
|
741
743
|
label: m.detail.type,
|
|
742
|
-
value: m.types[o.getType(
|
|
744
|
+
value: m.types[o.getType(e)]
|
|
743
745
|
},
|
|
744
746
|
{
|
|
745
747
|
id: "size",
|
|
746
748
|
label: m.detail.size,
|
|
747
|
-
value: o.getSize(
|
|
748
|
-
value: o.getSize(
|
|
749
|
-
display: /* @__PURE__ */
|
|
750
|
-
value: o.getSize(
|
|
749
|
+
value: o.getSize(e) === void 0 ? void 0 : {
|
|
750
|
+
value: o.getSize(e),
|
|
751
|
+
display: /* @__PURE__ */ z(s, {
|
|
752
|
+
value: o.getSize(e),
|
|
751
753
|
size: "inherit",
|
|
752
754
|
type: "inherit"
|
|
753
755
|
})
|
|
@@ -756,38 +758,38 @@ function Ue({ item: t, collections: i = [], accessors: o, strings: s, onClose: c
|
|
|
756
758
|
{
|
|
757
759
|
id: "dimensions",
|
|
758
760
|
label: m.detail.dimensions,
|
|
759
|
-
value:
|
|
761
|
+
value: ke(e, o) || void 0
|
|
760
762
|
},
|
|
761
763
|
{
|
|
762
764
|
id: "uploaded",
|
|
763
765
|
label: m.detail.uploaded,
|
|
764
|
-
value: o.getUploadedAt(
|
|
766
|
+
value: o.getUploadedAt(e) === void 0 ? void 0 : {
|
|
765
767
|
kind: "date",
|
|
766
|
-
value: o.getUploadedAt(
|
|
768
|
+
value: o.getUploadedAt(e)
|
|
767
769
|
}
|
|
768
770
|
},
|
|
769
771
|
{
|
|
770
772
|
id: "usage",
|
|
771
773
|
label: m.table.usage,
|
|
772
|
-
value: o.getUsageCount(
|
|
774
|
+
value: o.getUsageCount(e)
|
|
773
775
|
}
|
|
774
776
|
]
|
|
775
777
|
}),
|
|
776
|
-
o.getType(
|
|
778
|
+
o.getType(e) === "image" && /* @__PURE__ */ z(w, {
|
|
777
779
|
label: m.detail.altLabel,
|
|
778
|
-
children: /* @__PURE__ */
|
|
780
|
+
children: /* @__PURE__ */ z(ne, {
|
|
779
781
|
value: v.alt,
|
|
780
782
|
rows: 2,
|
|
781
|
-
disabled: !!
|
|
783
|
+
disabled: !!C,
|
|
782
784
|
placeholder: m.detail.altPlaceholder,
|
|
783
785
|
onChange: (e) => ae({ alt: e.target.value })
|
|
784
786
|
})
|
|
785
787
|
}),
|
|
786
|
-
i.length > 0 && /* @__PURE__ */
|
|
788
|
+
i.length > 0 && /* @__PURE__ */ z(w, {
|
|
787
789
|
label: m.detail.collectionLabel,
|
|
788
|
-
children: /* @__PURE__ */
|
|
790
|
+
children: /* @__PURE__ */ z(te, {
|
|
789
791
|
value: v.collection,
|
|
790
|
-
disabled: !!
|
|
792
|
+
disabled: !!C,
|
|
791
793
|
options: i.map((e) => ({
|
|
792
794
|
value: e.value,
|
|
793
795
|
label: typeof e.label == "string" ? e.label : e.value
|
|
@@ -795,58 +797,58 @@ function Ue({ item: t, collections: i = [], accessors: o, strings: s, onClose: c
|
|
|
795
797
|
onValueChange: (e) => ae({ collection: e ?? "" })
|
|
796
798
|
})
|
|
797
799
|
}),
|
|
798
|
-
/* @__PURE__ */
|
|
800
|
+
/* @__PURE__ */ z(w, {
|
|
799
801
|
label: m.detail.tagsLabel,
|
|
800
|
-
children: /* @__PURE__ */
|
|
802
|
+
children: /* @__PURE__ */ z(oe, {
|
|
801
803
|
value: v.tags,
|
|
802
|
-
disabled: !!
|
|
804
|
+
disabled: !!C,
|
|
803
805
|
onValueChange: (e) => ae({ tags: e }),
|
|
804
806
|
placeholder: m.detail.tagsPlaceholder
|
|
805
807
|
})
|
|
806
808
|
}),
|
|
807
|
-
/* @__PURE__ */
|
|
809
|
+
/* @__PURE__ */ z(x, {
|
|
808
810
|
label: m.detail.publicLabel,
|
|
809
811
|
description: m.detail.publicDescription,
|
|
810
|
-
disabled: !!
|
|
812
|
+
disabled: !!C,
|
|
811
813
|
value: v.public,
|
|
812
814
|
onValueChange: (e) => ae({ public: e })
|
|
813
815
|
}),
|
|
814
|
-
|
|
816
|
+
T === "saveFailed" || T === "deleteFailed" ? /* @__PURE__ */ z(h, {
|
|
815
817
|
tone: "destructive",
|
|
816
818
|
role: "alert",
|
|
817
|
-
children: /* @__PURE__ */
|
|
818
|
-
}) : /* @__PURE__ */
|
|
819
|
+
children: /* @__PURE__ */ z(p, { children: m.detail[T] })
|
|
820
|
+
}) : /* @__PURE__ */ z(t, {
|
|
819
821
|
size: "xs",
|
|
820
822
|
type: "secondary",
|
|
821
823
|
role: "status",
|
|
822
|
-
children:
|
|
824
|
+
children: C ? C === "save" ? m.detail.saving : m.detail.deleting : T === "saved" ? m.detail.saved : ie ? m.detail.unsaved : null
|
|
823
825
|
})
|
|
824
826
|
]
|
|
825
827
|
}),
|
|
826
|
-
/* @__PURE__ */
|
|
827
|
-
className:
|
|
828
|
+
/* @__PURE__ */ B("div", {
|
|
829
|
+
className: U.detailFooter,
|
|
828
830
|
children: [
|
|
829
|
-
/* @__PURE__ */
|
|
831
|
+
/* @__PURE__ */ B(r, {
|
|
830
832
|
tone: "destructive",
|
|
831
|
-
|
|
832
|
-
loading:
|
|
833
|
-
disabled: !!
|
|
834
|
-
onClick: () => void
|
|
835
|
-
children: [/* @__PURE__ */
|
|
833
|
+
appearance: "ghost",
|
|
834
|
+
loading: C === "delete",
|
|
835
|
+
disabled: !!C,
|
|
836
|
+
onClick: () => void j("delete"),
|
|
837
|
+
children: [/* @__PURE__ */ z(xe, {}), m.detail.delete]
|
|
836
838
|
}),
|
|
837
|
-
|
|
839
|
+
ie && /* @__PURE__ */ z(r, {
|
|
838
840
|
tone: "neutral",
|
|
839
|
-
|
|
840
|
-
disabled: !!
|
|
841
|
+
appearance: "ghost",
|
|
842
|
+
disabled: !!C,
|
|
841
843
|
onClick: () => {
|
|
842
|
-
y(
|
|
844
|
+
y(A), E(null);
|
|
843
845
|
},
|
|
844
846
|
children: m.detail.reset
|
|
845
847
|
}),
|
|
846
|
-
/* @__PURE__ */
|
|
847
|
-
loading:
|
|
848
|
-
disabled: !!
|
|
849
|
-
onClick: () => void
|
|
848
|
+
/* @__PURE__ */ z(r, {
|
|
849
|
+
loading: C === "save",
|
|
850
|
+
disabled: !!C,
|
|
851
|
+
onClick: () => void j("save"),
|
|
850
852
|
children: m.detail.save
|
|
851
853
|
})
|
|
852
854
|
]
|
|
@@ -856,166 +858,165 @@ function Ue({ item: t, collections: i = [], accessors: o, strings: s, onClose: c
|
|
|
856
858
|
}
|
|
857
859
|
//#endregion
|
|
858
860
|
//#region src/components/features/media-library/media-library-parts.tsx
|
|
859
|
-
function
|
|
861
|
+
function He(e, t) {
|
|
860
862
|
return t.types[e];
|
|
861
863
|
}
|
|
862
|
-
function
|
|
863
|
-
return /* @__PURE__ */
|
|
864
|
-
role:
|
|
865
|
-
"aria-label":
|
|
866
|
-
className:
|
|
867
|
-
children:
|
|
868
|
-
let t = e.value ===
|
|
869
|
-
return /* @__PURE__ */
|
|
864
|
+
function Ue({ label: e, options: t, value: i, onValueChange: a, role: o = "group", className: s }) {
|
|
865
|
+
return /* @__PURE__ */ z("div", {
|
|
866
|
+
role: o,
|
|
867
|
+
"aria-label": e,
|
|
868
|
+
className: n(U.segmented, s),
|
|
869
|
+
children: t.map((e) => {
|
|
870
|
+
let t = e.value === i;
|
|
871
|
+
return /* @__PURE__ */ B(r, {
|
|
870
872
|
type: "button",
|
|
871
873
|
tone: "neutral",
|
|
872
|
-
|
|
874
|
+
appearance: "ghost",
|
|
873
875
|
iconOnly: e.iconOnly,
|
|
874
|
-
role:
|
|
875
|
-
"aria-selected":
|
|
876
|
-
"aria-pressed":
|
|
876
|
+
role: o === "tablist" ? "tab" : void 0,
|
|
877
|
+
"aria-selected": o === "tablist" ? t : void 0,
|
|
878
|
+
"aria-pressed": o === "group" ? t : void 0,
|
|
877
879
|
"aria-label": e.iconOnly ? String(e.label) : void 0,
|
|
878
880
|
"data-active": t || void 0,
|
|
879
|
-
className:
|
|
880
|
-
onClick: () =>
|
|
881
|
+
className: U.segment,
|
|
882
|
+
onClick: () => a(e.value),
|
|
881
883
|
children: [e.icon, !e.iconOnly && e.label]
|
|
882
884
|
}, e.value);
|
|
883
885
|
})
|
|
884
886
|
});
|
|
885
887
|
}
|
|
886
|
-
function
|
|
887
|
-
return /* @__PURE__ */
|
|
888
|
-
title:
|
|
889
|
-
description:
|
|
890
|
-
media: r ?? /* @__PURE__ */
|
|
888
|
+
function We({ title: e, description: t, icon: r, action: i, className: a }) {
|
|
889
|
+
return /* @__PURE__ */ z(_, {
|
|
890
|
+
title: e,
|
|
891
|
+
description: t ?? !1,
|
|
892
|
+
media: r ?? /* @__PURE__ */ z(pe, {}),
|
|
891
893
|
mediaVariant: "icon-soft",
|
|
892
|
-
padding: "md",
|
|
893
894
|
border: !0,
|
|
894
895
|
action: i,
|
|
895
|
-
className:
|
|
896
|
+
className: n("media-library-empty-state--component", U.emptyState, a)
|
|
896
897
|
});
|
|
897
898
|
}
|
|
898
|
-
function
|
|
899
|
-
let
|
|
900
|
-
return /* @__PURE__ */
|
|
901
|
-
className:
|
|
902
|
-
children: [/* @__PURE__ */
|
|
903
|
-
className:
|
|
904
|
-
children: [/* @__PURE__ */
|
|
905
|
-
className:
|
|
906
|
-
children: [/* @__PURE__ */
|
|
907
|
-
value:
|
|
908
|
-
onChange: (e) =>
|
|
909
|
-
placeholder:
|
|
910
|
-
"aria-label":
|
|
911
|
-
startIcon:
|
|
899
|
+
function W({ query: e, onQueryChange: i, type: o, onTypeChange: s, typeFilters: c, collection: l, onCollectionChange: u, collections: f, sort: p, onSortChange: m, view: h, onViewChange: g, hasFilters: _, onClearFilters: v, strings: y, end: ee, className: b }) {
|
|
900
|
+
let x = e.trim(), S = a(V, y);
|
|
901
|
+
return /* @__PURE__ */ B("div", {
|
|
902
|
+
className: n("media-library-toolbar--component", U.toolbar, b),
|
|
903
|
+
children: [/* @__PURE__ */ B("div", {
|
|
904
|
+
className: U.toolbarPrimary,
|
|
905
|
+
children: [/* @__PURE__ */ B("div", {
|
|
906
|
+
className: U.toolbarSearch,
|
|
907
|
+
children: [/* @__PURE__ */ z(C, {
|
|
908
|
+
value: e,
|
|
909
|
+
onChange: (e) => i(e.target.value),
|
|
910
|
+
placeholder: y.searchPlaceholder,
|
|
911
|
+
"aria-label": y.searchPlaceholder,
|
|
912
|
+
startIcon: ve,
|
|
912
913
|
clearable: !0,
|
|
913
|
-
onClear: () =>
|
|
914
|
-
strings: { clear:
|
|
915
|
-
"data-active":
|
|
916
|
-
className:
|
|
917
|
-
}), !!
|
|
918
|
-
className:
|
|
919
|
-
children: /* @__PURE__ */
|
|
914
|
+
onClear: () => i(""),
|
|
915
|
+
strings: { clear: y.clearSearch },
|
|
916
|
+
"data-active": x ? !0 : void 0,
|
|
917
|
+
className: U.toolbarField
|
|
918
|
+
}), !!x && /* @__PURE__ */ z("div", {
|
|
919
|
+
className: U.toolbarQuery,
|
|
920
|
+
children: /* @__PURE__ */ B(d, {
|
|
920
921
|
tone: "primary",
|
|
921
922
|
children: [
|
|
922
|
-
/* @__PURE__ */
|
|
923
|
-
|
|
924
|
-
/* @__PURE__ */
|
|
923
|
+
/* @__PURE__ */ z(ve, { "aria-hidden": !0 }),
|
|
924
|
+
y.activeSearchLabel,
|
|
925
|
+
/* @__PURE__ */ z(t, {
|
|
925
926
|
size: "inherit",
|
|
926
927
|
type: "inherit",
|
|
927
928
|
weight: "normal",
|
|
928
|
-
className:
|
|
929
|
-
children:
|
|
929
|
+
className: U.queryTerm,
|
|
930
|
+
children: x
|
|
930
931
|
})
|
|
931
932
|
]
|
|
932
933
|
})
|
|
933
934
|
})]
|
|
934
|
-
}),
|
|
935
|
+
}), c.length > 1 && /* @__PURE__ */ z(Ue, {
|
|
935
936
|
role: "tablist",
|
|
936
|
-
label:
|
|
937
|
-
value:
|
|
938
|
-
onValueChange: (e) =>
|
|
939
|
-
options:
|
|
937
|
+
label: y.typeLabel,
|
|
938
|
+
value: o,
|
|
939
|
+
onValueChange: (e) => s(e),
|
|
940
|
+
options: c.map((e) => ({
|
|
940
941
|
value: e,
|
|
941
|
-
label: e === "all" ?
|
|
942
|
-
icon: e === "all" ? void 0 :
|
|
942
|
+
label: e === "all" ? y.types.all : He(e, y),
|
|
943
|
+
icon: e === "all" ? void 0 : ze[e]
|
|
943
944
|
})),
|
|
944
|
-
className:
|
|
945
|
+
className: U.toolbarTypes
|
|
945
946
|
})]
|
|
946
|
-
}), /* @__PURE__ */
|
|
947
|
-
className:
|
|
948
|
-
children: [/* @__PURE__ */
|
|
949
|
-
className:
|
|
947
|
+
}), /* @__PURE__ */ B("div", {
|
|
948
|
+
className: U.toolbarSecondary,
|
|
949
|
+
children: [/* @__PURE__ */ B("div", {
|
|
950
|
+
className: U.toolbarFilters,
|
|
950
951
|
children: [
|
|
951
|
-
|
|
952
|
-
"aria-label":
|
|
953
|
-
value:
|
|
952
|
+
f.length > 0 && /* @__PURE__ */ z(te, {
|
|
953
|
+
"aria-label": y.collectionLabel,
|
|
954
|
+
value: l,
|
|
954
955
|
options: [{
|
|
955
956
|
value: "all",
|
|
956
|
-
label:
|
|
957
|
-
}, ...
|
|
957
|
+
label: y.collectionAll
|
|
958
|
+
}, ...f.map((e) => ({
|
|
958
959
|
value: e.value,
|
|
959
960
|
label: typeof e.label == "string" ? e.label : e.value
|
|
960
961
|
}))],
|
|
961
|
-
onValueChange: (e) => e &&
|
|
962
|
-
className:
|
|
962
|
+
onValueChange: (e) => e && u(e),
|
|
963
|
+
className: U.toolbarSelect
|
|
963
964
|
}),
|
|
964
|
-
/* @__PURE__ */
|
|
965
|
-
"aria-label":
|
|
966
|
-
value:
|
|
965
|
+
/* @__PURE__ */ z(te, {
|
|
966
|
+
"aria-label": y.sortLabel,
|
|
967
|
+
value: p,
|
|
967
968
|
options: [
|
|
968
969
|
{
|
|
969
970
|
value: "newest",
|
|
970
|
-
label:
|
|
971
|
+
label: y.sorts.newest
|
|
971
972
|
},
|
|
972
973
|
{
|
|
973
974
|
value: "name",
|
|
974
|
-
label:
|
|
975
|
+
label: y.sorts.name
|
|
975
976
|
},
|
|
976
977
|
{
|
|
977
978
|
value: "size",
|
|
978
|
-
label:
|
|
979
|
+
label: y.sorts.size
|
|
979
980
|
},
|
|
980
981
|
{
|
|
981
982
|
value: "usage",
|
|
982
|
-
label:
|
|
983
|
+
label: y.sorts.usage
|
|
983
984
|
}
|
|
984
985
|
],
|
|
985
|
-
onValueChange: (e) => e &&
|
|
986
|
-
className:
|
|
986
|
+
onValueChange: (e) => e && m(e),
|
|
987
|
+
className: U.toolbarSelect
|
|
987
988
|
}),
|
|
988
|
-
|
|
989
|
+
_ && /* @__PURE__ */ z(r, {
|
|
989
990
|
type: "button",
|
|
990
991
|
tone: "neutral",
|
|
991
|
-
|
|
992
|
-
onClick:
|
|
993
|
-
children:
|
|
992
|
+
appearance: "ghost",
|
|
993
|
+
onClick: v,
|
|
994
|
+
children: y.clearFilters
|
|
994
995
|
})
|
|
995
996
|
]
|
|
996
|
-
}), /* @__PURE__ */
|
|
997
|
-
className:
|
|
998
|
-
children: [
|
|
999
|
-
label:
|
|
1000
|
-
value:
|
|
1001
|
-
onValueChange: (e) =>
|
|
997
|
+
}), /* @__PURE__ */ B("div", {
|
|
998
|
+
className: U.toolbarEnd,
|
|
999
|
+
children: [ee, /* @__PURE__ */ z(Ue, {
|
|
1000
|
+
label: y.viewLabel,
|
|
1001
|
+
value: h,
|
|
1002
|
+
onValueChange: (e) => g(e),
|
|
1002
1003
|
options: [
|
|
1003
1004
|
{
|
|
1004
1005
|
value: "grid",
|
|
1005
|
-
label:
|
|
1006
|
-
icon: /* @__PURE__ */
|
|
1006
|
+
label: y.views.grid,
|
|
1007
|
+
icon: /* @__PURE__ */ z(me, {}),
|
|
1007
1008
|
iconOnly: !0
|
|
1008
1009
|
},
|
|
1009
1010
|
{
|
|
1010
1011
|
value: "list",
|
|
1011
|
-
label:
|
|
1012
|
-
icon: /* @__PURE__ */
|
|
1012
|
+
label: S.views.list,
|
|
1013
|
+
icon: /* @__PURE__ */ z(he, {}),
|
|
1013
1014
|
iconOnly: !0
|
|
1014
1015
|
},
|
|
1015
1016
|
{
|
|
1016
1017
|
value: "table",
|
|
1017
|
-
label:
|
|
1018
|
-
icon: /* @__PURE__ */
|
|
1018
|
+
label: y.views.table,
|
|
1019
|
+
icon: /* @__PURE__ */ z(be, {}),
|
|
1019
1020
|
iconOnly: !0
|
|
1020
1021
|
}
|
|
1021
1022
|
]
|
|
@@ -1024,320 +1025,319 @@ function U({ query: t, onQueryChange: r, type: i, onTypeChange: a, typeFilters:
|
|
|
1024
1025
|
})]
|
|
1025
1026
|
});
|
|
1026
1027
|
}
|
|
1027
|
-
function
|
|
1028
|
-
let f =
|
|
1029
|
-
return /* @__PURE__ */
|
|
1030
|
-
"data-selected":
|
|
1031
|
-
"data-
|
|
1032
|
-
className:
|
|
1028
|
+
function Ge({ item: e, selected: i = !1, size: a = "default", showMeta: o = !0, accessors: s, strings: c, onToggle: l, onDetails: u, className: d }) {
|
|
1029
|
+
let f = s.getName(e), p = s.getSize(e), m = ke(e, s);
|
|
1030
|
+
return /* @__PURE__ */ B("div", {
|
|
1031
|
+
"data-selected": i || void 0,
|
|
1032
|
+
"data-size": a,
|
|
1033
|
+
className: n("media-library-card--component", U.card, d),
|
|
1033
1034
|
children: [
|
|
1034
|
-
/* @__PURE__ */
|
|
1035
|
-
className:
|
|
1036
|
-
children: [/* @__PURE__ */
|
|
1035
|
+
/* @__PURE__ */ B("span", {
|
|
1036
|
+
className: U.cardTileWrap,
|
|
1037
|
+
children: [/* @__PURE__ */ z("button", {
|
|
1037
1038
|
type: "button",
|
|
1038
|
-
className:
|
|
1039
|
-
"aria-pressed":
|
|
1040
|
-
"aria-label": (
|
|
1041
|
-
onClick:
|
|
1042
|
-
children: /* @__PURE__ */
|
|
1043
|
-
item:
|
|
1044
|
-
accessors:
|
|
1039
|
+
className: U.cardTile,
|
|
1040
|
+
"aria-pressed": i,
|
|
1041
|
+
"aria-label": (c.assetAction ?? V.assetAction)(i ? c.deselect : c.select, f),
|
|
1042
|
+
onClick: l,
|
|
1043
|
+
children: /* @__PURE__ */ z(Be, {
|
|
1044
|
+
item: e,
|
|
1045
|
+
accessors: s
|
|
1045
1046
|
})
|
|
1046
|
-
}), /* @__PURE__ */
|
|
1047
|
+
}), /* @__PURE__ */ z("span", {
|
|
1047
1048
|
"aria-hidden": !0,
|
|
1048
|
-
"data-selected":
|
|
1049
|
-
className:
|
|
1050
|
-
children:
|
|
1049
|
+
"data-selected": i || void 0,
|
|
1050
|
+
className: U.cardCheck,
|
|
1051
|
+
children: i && /* @__PURE__ */ z(N, {})
|
|
1051
1052
|
})]
|
|
1052
1053
|
}),
|
|
1053
|
-
/* @__PURE__ */
|
|
1054
|
-
className:
|
|
1055
|
-
children: [/* @__PURE__ */
|
|
1054
|
+
/* @__PURE__ */ B("div", {
|
|
1055
|
+
className: U.cardBody,
|
|
1056
|
+
children: [/* @__PURE__ */ z(t, {
|
|
1056
1057
|
tag: "span",
|
|
1057
1058
|
weight: "medium",
|
|
1058
1059
|
truncate: !0,
|
|
1059
1060
|
title: f,
|
|
1060
1061
|
children: f
|
|
1061
|
-
}),
|
|
1062
|
+
}), o && /* @__PURE__ */ z(t, {
|
|
1062
1063
|
tag: "span",
|
|
1063
1064
|
size: "xs",
|
|
1064
1065
|
type: "secondary",
|
|
1065
1066
|
truncate: !0,
|
|
1066
|
-
children: [m, p === void 0 ? "" :
|
|
1067
|
+
children: [m, p === void 0 ? "" : H(p)].filter(Boolean).join(" · ")
|
|
1067
1068
|
})]
|
|
1068
1069
|
}),
|
|
1069
|
-
!!
|
|
1070
|
+
!!u && /* @__PURE__ */ z(r, {
|
|
1070
1071
|
type: "button",
|
|
1071
1072
|
tone: "neutral",
|
|
1072
|
-
|
|
1073
|
+
appearance: "ghost",
|
|
1073
1074
|
iconOnly: !0,
|
|
1074
1075
|
onClick: (e) => {
|
|
1075
|
-
e.currentTarget.focus(),
|
|
1076
|
+
e.currentTarget.focus(), u();
|
|
1076
1077
|
},
|
|
1077
|
-
"aria-label": (
|
|
1078
|
-
className:
|
|
1079
|
-
children: /* @__PURE__ */
|
|
1078
|
+
"aria-label": (c.assetAction ?? V.assetAction)(c.details, f),
|
|
1079
|
+
className: U.cardDetails,
|
|
1080
|
+
children: /* @__PURE__ */ z(ge, {})
|
|
1080
1081
|
})
|
|
1081
1082
|
]
|
|
1082
1083
|
});
|
|
1083
1084
|
}
|
|
1084
|
-
function
|
|
1085
|
-
return /* @__PURE__ */
|
|
1086
|
-
className:
|
|
1087
|
-
children:
|
|
1088
|
-
let
|
|
1089
|
-
return /* @__PURE__ */
|
|
1090
|
-
"data-selected":
|
|
1091
|
-
className:
|
|
1085
|
+
function Ke({ items: e, selectedSet: i, accessors: a, strings: o, onToggle: c, onDetails: l }) {
|
|
1086
|
+
return /* @__PURE__ */ z("ul", {
|
|
1087
|
+
className: n("media-library-list--component", U.list),
|
|
1088
|
+
children: e.map((e) => {
|
|
1089
|
+
let n = a.getId(e), u = a.getName(e), d = i.has(n);
|
|
1090
|
+
return /* @__PURE__ */ z("li", { children: /* @__PURE__ */ B("div", {
|
|
1091
|
+
"data-selected": d || void 0,
|
|
1092
|
+
className: U.row,
|
|
1092
1093
|
children: [
|
|
1093
|
-
/* @__PURE__ */
|
|
1094
|
-
checked:
|
|
1095
|
-
"aria-label": (
|
|
1096
|
-
onChange: () =>
|
|
1094
|
+
/* @__PURE__ */ z(S, {
|
|
1095
|
+
checked: d,
|
|
1096
|
+
"aria-label": (o.assetAction ?? V.assetAction)(d ? o.deselect : o.select, u),
|
|
1097
|
+
onChange: () => c(n)
|
|
1097
1098
|
}),
|
|
1098
|
-
/* @__PURE__ */
|
|
1099
|
+
/* @__PURE__ */ B("button", {
|
|
1099
1100
|
type: "button",
|
|
1100
|
-
className:
|
|
1101
|
-
"aria-label": (
|
|
1101
|
+
className: U.rowMain,
|
|
1102
|
+
"aria-label": (o.assetAction ?? V.assetAction)(o.details, u),
|
|
1102
1103
|
onClick: (e) => {
|
|
1103
|
-
e.currentTarget.focus(),
|
|
1104
|
+
e.currentTarget.focus(), l(n);
|
|
1104
1105
|
},
|
|
1105
|
-
children: [/* @__PURE__ */
|
|
1106
|
+
children: [/* @__PURE__ */ z(Be, {
|
|
1106
1107
|
item: e,
|
|
1107
|
-
accessors:
|
|
1108
|
-
className:
|
|
1109
|
-
}), /* @__PURE__ */
|
|
1110
|
-
className:
|
|
1111
|
-
children: [/* @__PURE__ */
|
|
1108
|
+
accessors: a,
|
|
1109
|
+
className: U.rowPreview
|
|
1110
|
+
}), /* @__PURE__ */ B("span", {
|
|
1111
|
+
className: U.rowBody,
|
|
1112
|
+
children: [/* @__PURE__ */ z(t, {
|
|
1112
1113
|
tag: "span",
|
|
1113
1114
|
weight: "medium",
|
|
1114
1115
|
truncate: !0,
|
|
1115
|
-
children:
|
|
1116
|
-
}), /* @__PURE__ */
|
|
1116
|
+
children: u
|
|
1117
|
+
}), /* @__PURE__ */ z(t, {
|
|
1117
1118
|
tag: "span",
|
|
1118
1119
|
size: "xs",
|
|
1119
1120
|
type: "secondary",
|
|
1120
1121
|
children: [
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1122
|
+
He(a.getType(e), o),
|
|
1123
|
+
ke(e, a),
|
|
1124
|
+
a.getCollection(e)
|
|
1124
1125
|
].filter(Boolean).join(" · ")
|
|
1125
1126
|
})]
|
|
1126
1127
|
})]
|
|
1127
1128
|
}),
|
|
1128
|
-
/* @__PURE__ */
|
|
1129
|
-
className:
|
|
1130
|
-
children: /* @__PURE__ */
|
|
1131
|
-
value:
|
|
1129
|
+
/* @__PURE__ */ z("span", {
|
|
1130
|
+
className: U.rowSize,
|
|
1131
|
+
children: /* @__PURE__ */ z(s, {
|
|
1132
|
+
value: a.getSize(e),
|
|
1132
1133
|
size: "xs",
|
|
1133
1134
|
type: "secondary"
|
|
1134
1135
|
})
|
|
1135
1136
|
}),
|
|
1136
|
-
/* @__PURE__ */
|
|
1137
|
+
/* @__PURE__ */ z(r, {
|
|
1137
1138
|
type: "button",
|
|
1138
1139
|
tone: "neutral",
|
|
1139
|
-
|
|
1140
|
+
appearance: "ghost",
|
|
1140
1141
|
onClick: (e) => {
|
|
1141
|
-
e.currentTarget.focus(),
|
|
1142
|
+
e.currentTarget.focus(), l(n);
|
|
1142
1143
|
},
|
|
1143
|
-
children:
|
|
1144
|
+
children: o.details
|
|
1144
1145
|
})
|
|
1145
1146
|
]
|
|
1146
|
-
}) },
|
|
1147
|
+
}) }, n);
|
|
1147
1148
|
})
|
|
1148
1149
|
});
|
|
1149
1150
|
}
|
|
1150
|
-
function
|
|
1151
|
-
return /* @__PURE__ */
|
|
1152
|
-
className:
|
|
1151
|
+
function qe({ stagedFiles: a, uploading: o, uploadOptions: c, collections: l = [], strings: u, onAddFiles: d, onRemoveFile: f, onClear: p, onOptionsChange: m, onStart: h, onCancel: g, empty: y, showActions: ee = !0 }) {
|
|
1152
|
+
return /* @__PURE__ */ B("div", {
|
|
1153
|
+
className: n("media-library-upload--component", U.upload),
|
|
1153
1154
|
children: [
|
|
1154
|
-
/* @__PURE__ */
|
|
1155
|
+
/* @__PURE__ */ z(O, {
|
|
1155
1156
|
multiple: !0,
|
|
1156
|
-
disabled:
|
|
1157
|
+
disabled: o,
|
|
1157
1158
|
onDrop: d,
|
|
1158
1159
|
strings: {
|
|
1159
|
-
instructionMultiple:
|
|
1160
|
-
helper:
|
|
1160
|
+
instructionMultiple: u.upload.dropTitle,
|
|
1161
|
+
helper: u.upload.dropDescription
|
|
1161
1162
|
}
|
|
1162
1163
|
}),
|
|
1163
|
-
/* @__PURE__ */
|
|
1164
|
-
className:
|
|
1165
|
-
children: [/* @__PURE__ */
|
|
1166
|
-
className:
|
|
1164
|
+
/* @__PURE__ */ B("section", {
|
|
1165
|
+
className: U.uploadOptions,
|
|
1166
|
+
children: [/* @__PURE__ */ z(e, { children: u.upload.optionsTitle }), /* @__PURE__ */ B("div", {
|
|
1167
|
+
className: U.uploadOptionsGrid,
|
|
1167
1168
|
children: [
|
|
1168
|
-
|
|
1169
|
-
label:
|
|
1170
|
-
children: /* @__PURE__ */
|
|
1171
|
-
disabled:
|
|
1172
|
-
value:
|
|
1173
|
-
options:
|
|
1169
|
+
l.length > 0 && /* @__PURE__ */ z(w, {
|
|
1170
|
+
label: u.detail.collectionLabel,
|
|
1171
|
+
children: /* @__PURE__ */ z(te, {
|
|
1172
|
+
disabled: o,
|
|
1173
|
+
value: c.collection ?? "",
|
|
1174
|
+
options: l.map((e) => ({
|
|
1174
1175
|
value: e.value,
|
|
1175
1176
|
label: typeof e.label == "string" ? e.label : e.value
|
|
1176
1177
|
})),
|
|
1177
|
-
onValueChange: (e) =>
|
|
1178
|
+
onValueChange: (e) => m({ collection: e || void 0 })
|
|
1178
1179
|
})
|
|
1179
1180
|
}),
|
|
1180
|
-
/* @__PURE__ */
|
|
1181
|
-
label:
|
|
1182
|
-
children: /* @__PURE__ */
|
|
1183
|
-
disabled:
|
|
1184
|
-
value:
|
|
1185
|
-
onValueChange: (e) =>
|
|
1186
|
-
placeholder:
|
|
1181
|
+
/* @__PURE__ */ z(w, {
|
|
1182
|
+
label: u.detail.tagsLabel,
|
|
1183
|
+
children: /* @__PURE__ */ z(oe, {
|
|
1184
|
+
disabled: o,
|
|
1185
|
+
value: c.tags,
|
|
1186
|
+
onValueChange: (e) => m({ tags: e }),
|
|
1187
|
+
placeholder: u.detail.tagsPlaceholder
|
|
1187
1188
|
})
|
|
1188
1189
|
}),
|
|
1189
|
-
/* @__PURE__ */
|
|
1190
|
-
disabled:
|
|
1191
|
-
label:
|
|
1192
|
-
description:
|
|
1193
|
-
value:
|
|
1194
|
-
onValueChange: (e) =>
|
|
1190
|
+
/* @__PURE__ */ z(x, {
|
|
1191
|
+
disabled: o,
|
|
1192
|
+
label: u.detail.publicLabel,
|
|
1193
|
+
description: u.detail.publicDescription,
|
|
1194
|
+
value: c.public,
|
|
1195
|
+
onValueChange: (e) => m({ public: e })
|
|
1195
1196
|
})
|
|
1196
1197
|
]
|
|
1197
1198
|
})]
|
|
1198
1199
|
}),
|
|
1199
|
-
|
|
1200
|
-
title:
|
|
1201
|
-
description:
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
className: B.staged,
|
|
1200
|
+
a.length === 0 ? y ?? /* @__PURE__ */ z(_, {
|
|
1201
|
+
title: u.upload.emptyTitle,
|
|
1202
|
+
description: u.upload.emptyDescription
|
|
1203
|
+
}) : /* @__PURE__ */ B(Ce, { children: [/* @__PURE__ */ z("ul", {
|
|
1204
|
+
className: U.stagedList,
|
|
1205
|
+
children: a.map((e) => /* @__PURE__ */ B("li", {
|
|
1206
|
+
className: U.staged,
|
|
1207
1207
|
children: [
|
|
1208
|
-
/* @__PURE__ */
|
|
1209
|
-
className:
|
|
1210
|
-
children:
|
|
1208
|
+
/* @__PURE__ */ z("span", {
|
|
1209
|
+
className: U.stagedIcon,
|
|
1210
|
+
children: ze[e.type]
|
|
1211
1211
|
}),
|
|
1212
|
-
/* @__PURE__ */
|
|
1213
|
-
className:
|
|
1214
|
-
children: [/* @__PURE__ */
|
|
1212
|
+
/* @__PURE__ */ B("span", {
|
|
1213
|
+
className: U.stagedBody,
|
|
1214
|
+
children: [/* @__PURE__ */ z(t, {
|
|
1215
1215
|
tag: "span",
|
|
1216
1216
|
weight: "medium",
|
|
1217
1217
|
truncate: !0,
|
|
1218
1218
|
children: e.name
|
|
1219
|
-
}), e.status === "error" ? /* @__PURE__ */
|
|
1219
|
+
}), e.status === "error" ? /* @__PURE__ */ z(t, {
|
|
1220
1220
|
tag: "span",
|
|
1221
1221
|
size: "xs",
|
|
1222
1222
|
type: "error",
|
|
1223
|
-
children: e.error ??
|
|
1224
|
-
}) : e.status === "uploading" ? /* @__PURE__ */
|
|
1223
|
+
children: e.error ?? u.upload.failed
|
|
1224
|
+
}) : e.status === "uploading" ? /* @__PURE__ */ z(v, {
|
|
1225
1225
|
value: e.progress,
|
|
1226
1226
|
"aria-label": e.name
|
|
1227
|
-
}) : /* @__PURE__ */
|
|
1227
|
+
}) : /* @__PURE__ */ z(s, {
|
|
1228
1228
|
value: e.size,
|
|
1229
1229
|
size: "xs",
|
|
1230
1230
|
type: "secondary"
|
|
1231
1231
|
})]
|
|
1232
1232
|
}),
|
|
1233
|
-
/* @__PURE__ */
|
|
1233
|
+
/* @__PURE__ */ z(r, {
|
|
1234
1234
|
type: "button",
|
|
1235
1235
|
tone: "neutral",
|
|
1236
|
-
|
|
1236
|
+
appearance: "ghost",
|
|
1237
1237
|
iconOnly: !0,
|
|
1238
|
-
"aria-label": `${
|
|
1239
|
-
disabled:
|
|
1238
|
+
"aria-label": `${u.upload.remove}: ${e.name}`,
|
|
1239
|
+
disabled: o,
|
|
1240
1240
|
onClick: () => f(e.id),
|
|
1241
|
-
children: /* @__PURE__ */
|
|
1241
|
+
children: /* @__PURE__ */ z(Se, {})
|
|
1242
1242
|
})
|
|
1243
1243
|
]
|
|
1244
1244
|
}, e.id))
|
|
1245
|
-
}),
|
|
1246
|
-
className:
|
|
1247
|
-
children: [/* @__PURE__ */
|
|
1245
|
+
}), ee && /* @__PURE__ */ B("div", {
|
|
1246
|
+
className: U.uploadActions,
|
|
1247
|
+
children: [/* @__PURE__ */ z(t, {
|
|
1248
1248
|
type: "secondary",
|
|
1249
|
-
children:
|
|
1250
|
-
}), /* @__PURE__ */
|
|
1249
|
+
children: u.upload.staged(a.length)
|
|
1250
|
+
}), /* @__PURE__ */ B(i, {
|
|
1251
1251
|
direction: "horizontal",
|
|
1252
|
-
gap: "
|
|
1253
|
-
children: [
|
|
1252
|
+
gap: "sm",
|
|
1253
|
+
children: [o ? /* @__PURE__ */ z(r, {
|
|
1254
1254
|
type: "button",
|
|
1255
1255
|
tone: "neutral",
|
|
1256
|
-
|
|
1257
|
-
onClick:
|
|
1258
|
-
children:
|
|
1259
|
-
}) : /* @__PURE__ */
|
|
1256
|
+
appearance: "outline",
|
|
1257
|
+
onClick: g,
|
|
1258
|
+
children: u.upload.cancel
|
|
1259
|
+
}) : /* @__PURE__ */ z(r, {
|
|
1260
1260
|
type: "button",
|
|
1261
1261
|
tone: "neutral",
|
|
1262
|
-
|
|
1263
|
-
onClick:
|
|
1264
|
-
children:
|
|
1265
|
-
}), /* @__PURE__ */
|
|
1262
|
+
appearance: "ghost",
|
|
1263
|
+
onClick: p,
|
|
1264
|
+
children: u.upload.clear
|
|
1265
|
+
}), /* @__PURE__ */ z(r, {
|
|
1266
1266
|
type: "button",
|
|
1267
|
-
loading:
|
|
1268
|
-
onClick:
|
|
1269
|
-
children:
|
|
1267
|
+
loading: o,
|
|
1268
|
+
onClick: h,
|
|
1269
|
+
children: o ? u.upload.uploading : u.upload.start
|
|
1270
1270
|
})]
|
|
1271
1271
|
})]
|
|
1272
1272
|
})] })
|
|
1273
1273
|
]
|
|
1274
1274
|
});
|
|
1275
1275
|
}
|
|
1276
|
-
function
|
|
1277
|
-
let f =
|
|
1276
|
+
function G({ tab: e, selectedIds: i, selectionMode: a, stagedFiles: o, strings: s, visibleCount: c, totalCount: l, onClearSelection: u, className: d }) {
|
|
1277
|
+
let f = e === "upload" ? /* @__PURE__ */ z(t, {
|
|
1278
1278
|
size: "xs",
|
|
1279
1279
|
type: "secondary",
|
|
1280
|
-
children:
|
|
1281
|
-
}) :
|
|
1280
|
+
children: o.length === 0 ? s.footer.noFiles : s.footer.stagedSummary(o.length, H(o.reduce((e, t) => e + t.size, 0)))
|
|
1281
|
+
}) : i.length > 0 ? /* @__PURE__ */ B(Ce, { children: [/* @__PURE__ */ z(t, { children: s.selectedCount(i.length) }), !!u && /* @__PURE__ */ z(r, {
|
|
1282
1282
|
type: "button",
|
|
1283
1283
|
tone: "neutral",
|
|
1284
|
-
|
|
1285
|
-
onClick:
|
|
1286
|
-
children:
|
|
1287
|
-
})] }) :
|
|
1284
|
+
appearance: "ghost",
|
|
1285
|
+
onClick: u,
|
|
1286
|
+
children: s.clearSelection
|
|
1287
|
+
})] }) : c !== void 0 && l !== void 0 && c !== l ? /* @__PURE__ */ z(t, {
|
|
1288
1288
|
size: "xs",
|
|
1289
1289
|
type: "secondary",
|
|
1290
|
-
children:
|
|
1291
|
-
}) : /* @__PURE__ */
|
|
1290
|
+
children: s.showingCount(c, l)
|
|
1291
|
+
}) : /* @__PURE__ */ z(t, {
|
|
1292
1292
|
size: "xs",
|
|
1293
1293
|
type: "secondary",
|
|
1294
|
-
children:
|
|
1294
|
+
children: a === "single" ? s.footer.pickOne : s.footer.pickMany
|
|
1295
1295
|
});
|
|
1296
|
-
return /* @__PURE__ */
|
|
1296
|
+
return /* @__PURE__ */ z("div", {
|
|
1297
1297
|
"aria-live": "polite",
|
|
1298
|
-
className:
|
|
1298
|
+
className: n("media-library-footer-summary--component", U.footerSummary, d),
|
|
1299
1299
|
children: f
|
|
1300
1300
|
});
|
|
1301
1301
|
}
|
|
1302
|
-
function
|
|
1303
|
-
let h =
|
|
1304
|
-
return
|
|
1302
|
+
function K({ tab: e, selectedIds: t, selectedItems: i, stagedFiles: a, uploading: o = !1, strings: s, confirmLabel: c, cancelLabel: l, onCancel: u, onConfirm: d, onUpload: f, onCancelUpload: p, className: m }) {
|
|
1303
|
+
let h = n("media-library-footer-actions--component", U.footerActions, m);
|
|
1304
|
+
return e === "upload" ? /* @__PURE__ */ B("div", {
|
|
1305
1305
|
className: h,
|
|
1306
|
-
children: [/* @__PURE__ */
|
|
1306
|
+
children: [/* @__PURE__ */ z(r, {
|
|
1307
1307
|
type: "button",
|
|
1308
1308
|
tone: "neutral",
|
|
1309
|
-
|
|
1309
|
+
appearance: "ghost",
|
|
1310
1310
|
onClick: p,
|
|
1311
|
-
children:
|
|
1312
|
-
}), /* @__PURE__ */
|
|
1311
|
+
children: o ? s.upload.cancel : l ?? s.cancel
|
|
1312
|
+
}), /* @__PURE__ */ z(r, {
|
|
1313
1313
|
type: "button",
|
|
1314
|
-
disabled:
|
|
1315
|
-
loading:
|
|
1314
|
+
disabled: a.length === 0 || o,
|
|
1315
|
+
loading: o,
|
|
1316
1316
|
onClick: f,
|
|
1317
|
-
children:
|
|
1317
|
+
children: s.footer.uploadStaged(a.length)
|
|
1318
1318
|
})]
|
|
1319
|
-
}) : /* @__PURE__ */
|
|
1319
|
+
}) : /* @__PURE__ */ B("div", {
|
|
1320
1320
|
className: h,
|
|
1321
|
-
children: [/* @__PURE__ */
|
|
1321
|
+
children: [/* @__PURE__ */ z(r, {
|
|
1322
1322
|
type: "button",
|
|
1323
1323
|
tone: "neutral",
|
|
1324
|
-
|
|
1325
|
-
onClick:
|
|
1326
|
-
children:
|
|
1327
|
-
}), /* @__PURE__ */
|
|
1324
|
+
appearance: "outline",
|
|
1325
|
+
onClick: u,
|
|
1326
|
+
children: o ? s.upload.cancel : l ?? s.cancel
|
|
1327
|
+
}), /* @__PURE__ */ z(r, {
|
|
1328
1328
|
type: "button",
|
|
1329
|
-
disabled:
|
|
1329
|
+
disabled: t.length === 0 || i.length !== t.length,
|
|
1330
1330
|
onClick: d,
|
|
1331
|
-
children:
|
|
1331
|
+
children: c ?? s.confirm
|
|
1332
1332
|
})]
|
|
1333
1333
|
});
|
|
1334
1334
|
}
|
|
1335
|
-
function
|
|
1336
|
-
return /* @__PURE__ */
|
|
1335
|
+
function Je({ tab: e, selectedItems: t, selectedIds: r, selectionMode: i, stagedFiles: a, uploading: o, strings: s, visibleCount: c, totalCount: l, confirmLabel: u, cancelLabel: d, onCancel: f, onConfirm: p, onClearSelection: m, onUpload: h, onCancelUpload: g, chrome: _ = "section", className: v }) {
|
|
1336
|
+
return /* @__PURE__ */ B("footer", {
|
|
1337
1337
|
"data-chrome": _,
|
|
1338
|
-
className:
|
|
1339
|
-
children: [/* @__PURE__ */
|
|
1340
|
-
tab:
|
|
1338
|
+
className: n("media-library-footer--component", U.footer, v),
|
|
1339
|
+
children: [/* @__PURE__ */ z(G, {
|
|
1340
|
+
tab: e,
|
|
1341
1341
|
selectedIds: r,
|
|
1342
1342
|
selectionMode: i,
|
|
1343
1343
|
stagedFiles: a,
|
|
@@ -1345,9 +1345,9 @@ function Ye({ tab: t, selectedItems: n, selectedIds: r, selectionMode: i, staged
|
|
|
1345
1345
|
visibleCount: c,
|
|
1346
1346
|
totalCount: l,
|
|
1347
1347
|
onClearSelection: m
|
|
1348
|
-
}), /* @__PURE__ */
|
|
1349
|
-
tab:
|
|
1350
|
-
selectedItems:
|
|
1348
|
+
}), /* @__PURE__ */ z(K, {
|
|
1349
|
+
tab: e,
|
|
1350
|
+
selectedItems: t,
|
|
1351
1351
|
selectedIds: r,
|
|
1352
1352
|
stagedFiles: a,
|
|
1353
1353
|
uploading: o,
|
|
@@ -1363,542 +1363,542 @@ function Ye({ tab: t, selectedItems: n, selectedIds: r, selectionMode: i, staged
|
|
|
1363
1363
|
}
|
|
1364
1364
|
//#endregion
|
|
1365
1365
|
//#region src/components/features/media-library/media-library-table.tsx
|
|
1366
|
-
function
|
|
1367
|
-
let
|
|
1368
|
-
return /* @__PURE__ */
|
|
1369
|
-
"aria-label":
|
|
1370
|
-
containerClassName:
|
|
1371
|
-
children: [/* @__PURE__ */
|
|
1372
|
-
/* @__PURE__ */
|
|
1366
|
+
function q({ items: e, selectedSet: i, accessors: o, strings: d, onToggle: f, onDetails: p, className: m, collections: h = [] }) {
|
|
1367
|
+
let g = a(V, d);
|
|
1368
|
+
return /* @__PURE__ */ B(M, {
|
|
1369
|
+
"aria-label": g.title,
|
|
1370
|
+
containerClassName: n("media-library-table--component", U.table, m),
|
|
1371
|
+
children: [/* @__PURE__ */ z(k, { children: /* @__PURE__ */ B(ie, { children: [
|
|
1372
|
+
/* @__PURE__ */ z(j, { children: /* @__PURE__ */ z(t, {
|
|
1373
1373
|
tag: "span",
|
|
1374
1374
|
className: "sr-only",
|
|
1375
|
-
children:
|
|
1375
|
+
children: g.select
|
|
1376
1376
|
}) }),
|
|
1377
|
-
/* @__PURE__ */
|
|
1378
|
-
/* @__PURE__ */
|
|
1379
|
-
/* @__PURE__ */
|
|
1380
|
-
/* @__PURE__ */
|
|
1377
|
+
/* @__PURE__ */ z(j, { children: g.table.name }),
|
|
1378
|
+
/* @__PURE__ */ z(j, { children: g.detail.type }),
|
|
1379
|
+
/* @__PURE__ */ z(j, { children: g.table.collection }),
|
|
1380
|
+
/* @__PURE__ */ z(j, {
|
|
1381
1381
|
align: "end",
|
|
1382
|
-
children:
|
|
1382
|
+
children: g.table.size
|
|
1383
1383
|
}),
|
|
1384
|
-
/* @__PURE__ */
|
|
1385
|
-
/* @__PURE__ */
|
|
1384
|
+
/* @__PURE__ */ z(j, { children: g.table.uploaded }),
|
|
1385
|
+
/* @__PURE__ */ z(j, {
|
|
1386
1386
|
align: "end",
|
|
1387
|
-
children:
|
|
1387
|
+
children: g.table.usage
|
|
1388
1388
|
}),
|
|
1389
|
-
/* @__PURE__ */
|
|
1389
|
+
/* @__PURE__ */ z(j, { children: /* @__PURE__ */ z(t, {
|
|
1390
1390
|
tag: "span",
|
|
1391
1391
|
className: "sr-only",
|
|
1392
|
-
children:
|
|
1392
|
+
children: g.table.actions
|
|
1393
1393
|
}) })
|
|
1394
|
-
] }) }), /* @__PURE__ */
|
|
1395
|
-
let
|
|
1396
|
-
return /* @__PURE__ */
|
|
1397
|
-
"data-state":
|
|
1398
|
-
"data-selected":
|
|
1394
|
+
] }) }), /* @__PURE__ */ z(ae, { children: e.map((e) => {
|
|
1395
|
+
let n = o.getId(e), a = o.getName(e), d = i.has(n);
|
|
1396
|
+
return /* @__PURE__ */ B(ie, {
|
|
1397
|
+
"data-state": d ? "selected" : void 0,
|
|
1398
|
+
"data-selected": d || void 0,
|
|
1399
1399
|
children: [
|
|
1400
|
-
/* @__PURE__ */
|
|
1401
|
-
checked:
|
|
1402
|
-
"aria-label":
|
|
1403
|
-
onChange: () =>
|
|
1400
|
+
/* @__PURE__ */ z(A, { children: /* @__PURE__ */ z(S, {
|
|
1401
|
+
checked: d,
|
|
1402
|
+
"aria-label": g.assetAction(d ? g.deselect : g.select, a),
|
|
1403
|
+
onChange: () => f(n)
|
|
1404
1404
|
}) }),
|
|
1405
|
-
/* @__PURE__ */
|
|
1405
|
+
/* @__PURE__ */ z(A, { children: /* @__PURE__ */ B(r, {
|
|
1406
1406
|
tone: "neutral",
|
|
1407
|
-
|
|
1407
|
+
appearance: "ghost",
|
|
1408
1408
|
onClick: (e) => {
|
|
1409
|
-
e.currentTarget.focus(),
|
|
1409
|
+
e.currentTarget.focus(), p(n);
|
|
1410
1410
|
},
|
|
1411
|
-
className:
|
|
1412
|
-
children: [/* @__PURE__ */
|
|
1411
|
+
className: U.tableName,
|
|
1412
|
+
children: [/* @__PURE__ */ z(Be, {
|
|
1413
1413
|
item: e,
|
|
1414
|
-
accessors:
|
|
1415
|
-
className:
|
|
1416
|
-
}), /* @__PURE__ */
|
|
1414
|
+
accessors: o,
|
|
1415
|
+
className: U.rowPreview
|
|
1416
|
+
}), /* @__PURE__ */ z(t, {
|
|
1417
1417
|
tag: "span",
|
|
1418
1418
|
truncate: !0,
|
|
1419
1419
|
title: a,
|
|
1420
1420
|
children: a
|
|
1421
1421
|
})]
|
|
1422
1422
|
}) }),
|
|
1423
|
-
/* @__PURE__ */
|
|
1423
|
+
/* @__PURE__ */ z(A, { children: /* @__PURE__ */ z(t, {
|
|
1424
1424
|
type: "secondary",
|
|
1425
|
-
children:
|
|
1425
|
+
children: g.types[o.getType(e)]
|
|
1426
1426
|
}) }),
|
|
1427
|
-
/* @__PURE__ */
|
|
1428
|
-
/* @__PURE__ */
|
|
1427
|
+
/* @__PURE__ */ z(A, { children: /* @__PURE__ */ z(t, { children: h.find((t) => t.value === o.getCollection(e))?.label ?? (o.getCollection(e) || /* @__PURE__ */ z(u, {})) }) }),
|
|
1428
|
+
/* @__PURE__ */ z(A, {
|
|
1429
1429
|
align: "end",
|
|
1430
|
-
children: /* @__PURE__ */
|
|
1430
|
+
children: /* @__PURE__ */ z(s, { value: o.getSize(e) })
|
|
1431
1431
|
}),
|
|
1432
|
-
/* @__PURE__ */
|
|
1433
|
-
/* @__PURE__ */
|
|
1432
|
+
/* @__PURE__ */ z(A, { children: /* @__PURE__ */ z(c, { value: o.getUploadedAt(e) }) }),
|
|
1433
|
+
/* @__PURE__ */ z(A, {
|
|
1434
1434
|
align: "end",
|
|
1435
|
-
children: /* @__PURE__ */
|
|
1435
|
+
children: /* @__PURE__ */ z(l, { value: o.getUsageCount(e) })
|
|
1436
1436
|
}),
|
|
1437
|
-
/* @__PURE__ */
|
|
1437
|
+
/* @__PURE__ */ z(A, { children: /* @__PURE__ */ z(r, {
|
|
1438
1438
|
tone: "neutral",
|
|
1439
|
-
|
|
1440
|
-
"aria-label":
|
|
1439
|
+
appearance: "ghost",
|
|
1440
|
+
"aria-label": g.assetAction(g.details, a),
|
|
1441
1441
|
onClick: (e) => {
|
|
1442
|
-
e.currentTarget.focus(),
|
|
1442
|
+
e.currentTarget.focus(), p(n);
|
|
1443
1443
|
},
|
|
1444
|
-
children:
|
|
1444
|
+
children: g.details
|
|
1445
1445
|
}) })
|
|
1446
1446
|
]
|
|
1447
|
-
},
|
|
1447
|
+
}, n);
|
|
1448
1448
|
}) })]
|
|
1449
1449
|
});
|
|
1450
1450
|
}
|
|
1451
1451
|
//#endregion
|
|
1452
1452
|
//#region src/components/features/media-library/media-library-views.tsx
|
|
1453
|
-
function
|
|
1454
|
-
return /* @__PURE__ */
|
|
1455
|
-
"data-
|
|
1456
|
-
className:
|
|
1457
|
-
children:
|
|
1458
|
-
let
|
|
1459
|
-
return u ? /* @__PURE__ */
|
|
1460
|
-
id:
|
|
1453
|
+
function Ye({ items: e, selectedSet: t, accessors: r, strings: i, onToggle: a, onDetails: o, size: s = "default", selectionMode: c = "multiple", showMeta: l = !0, renderItem: u, className: d }) {
|
|
1454
|
+
return /* @__PURE__ */ z("div", {
|
|
1455
|
+
"data-size": s,
|
|
1456
|
+
className: n("media-library-grid--component", U.grid, d),
|
|
1457
|
+
children: e.map((e) => {
|
|
1458
|
+
let n = r.getId(e), d = t.has(n), f = () => a(n), p = () => o(n);
|
|
1459
|
+
return u ? /* @__PURE__ */ z("div", { children: u(e, {
|
|
1460
|
+
id: n,
|
|
1461
1461
|
selected: d,
|
|
1462
1462
|
accessors: r,
|
|
1463
1463
|
selectionMode: c,
|
|
1464
1464
|
toggle: f,
|
|
1465
1465
|
openDetails: p
|
|
1466
|
-
}) },
|
|
1466
|
+
}) }, n) : /* @__PURE__ */ z(Ge, {
|
|
1467
1467
|
item: e,
|
|
1468
1468
|
selected: d,
|
|
1469
|
-
|
|
1469
|
+
size: s,
|
|
1470
1470
|
selectionMode: c,
|
|
1471
1471
|
showMeta: l,
|
|
1472
1472
|
accessors: r,
|
|
1473
1473
|
strings: i,
|
|
1474
1474
|
onToggle: f,
|
|
1475
1475
|
onDetails: p
|
|
1476
|
-
},
|
|
1476
|
+
}, n);
|
|
1477
1477
|
})
|
|
1478
1478
|
});
|
|
1479
1479
|
}
|
|
1480
|
-
function
|
|
1481
|
-
let
|
|
1482
|
-
return /* @__PURE__ */
|
|
1483
|
-
className:
|
|
1484
|
-
children: [/* @__PURE__ */
|
|
1480
|
+
function Xe({ visibleCount: e, totalCount: r, selectedVisibleCount: i, onSelectVisible: o, onDeselectVisible: s, status: c, disabled: l, strings: u, className: d }) {
|
|
1481
|
+
let f = a(V, u), p = e > 0 && i === e;
|
|
1482
|
+
return /* @__PURE__ */ B("div", {
|
|
1483
|
+
className: n("media-library-selection-bar--component", U.selectionBar, d),
|
|
1484
|
+
children: [/* @__PURE__ */ z(t, {
|
|
1485
1485
|
size: "xs",
|
|
1486
1486
|
type: "secondary",
|
|
1487
1487
|
role: "status",
|
|
1488
1488
|
"aria-live": "polite",
|
|
1489
1489
|
"aria-atomic": "true",
|
|
1490
|
-
children:
|
|
1491
|
-
}),
|
|
1492
|
-
checked:
|
|
1493
|
-
indeterminate: !
|
|
1494
|
-
disabled:
|
|
1495
|
-
label:
|
|
1496
|
-
onChange: () =>
|
|
1490
|
+
children: c ?? f.showingCount(e, r)
|
|
1491
|
+
}), o && s && /* @__PURE__ */ z(S, {
|
|
1492
|
+
checked: p,
|
|
1493
|
+
indeterminate: !p && i > 0,
|
|
1494
|
+
disabled: l || e === 0,
|
|
1495
|
+
label: p ? f.deselectVisible : f.selectVisible,
|
|
1496
|
+
onChange: () => p ? s() : o()
|
|
1497
1497
|
})]
|
|
1498
1498
|
});
|
|
1499
1499
|
}
|
|
1500
1500
|
//#endregion
|
|
1501
1501
|
//#region src/components/features/media-library/media-library.tsx
|
|
1502
|
-
var
|
|
1502
|
+
var J = [
|
|
1503
1503
|
"all",
|
|
1504
1504
|
"image",
|
|
1505
1505
|
"video",
|
|
1506
1506
|
"file"
|
|
1507
1507
|
];
|
|
1508
|
-
function
|
|
1509
|
-
let
|
|
1510
|
-
items:
|
|
1511
|
-
fetcher:
|
|
1512
|
-
accessors:
|
|
1513
|
-
value:
|
|
1514
|
-
defaultValue:
|
|
1515
|
-
onValueChange:
|
|
1516
|
-
onItemUpdate:
|
|
1517
|
-
applyItemPatch:
|
|
1518
|
-
onItemDelete:
|
|
1519
|
-
onUpload:
|
|
1520
|
-
onError:
|
|
1521
|
-
tab:
|
|
1522
|
-
defaultTab:
|
|
1523
|
-
onTabChange:
|
|
1524
|
-
view:
|
|
1525
|
-
defaultView:
|
|
1526
|
-
onViewChange:
|
|
1527
|
-
query:
|
|
1528
|
-
defaultQuery:
|
|
1529
|
-
onQueryChange:
|
|
1530
|
-
type:
|
|
1531
|
-
defaultType:
|
|
1532
|
-
onTypeChange:
|
|
1533
|
-
collection:
|
|
1534
|
-
defaultCollection:
|
|
1535
|
-
onCollectionChange:
|
|
1536
|
-
sort:
|
|
1537
|
-
defaultSort:
|
|
1538
|
-
onSortChange:
|
|
1539
|
-
uploadOptions:
|
|
1540
|
-
defaultUploadOptions:
|
|
1541
|
-
onUploadOptionsChange:
|
|
1542
|
-
collections:
|
|
1543
|
-
selectionMode:
|
|
1544
|
-
}), { tab:
|
|
1508
|
+
function Ze({ title: e, description: t, confirmLabel: i, cancelLabel: o, size: s = "default", showMeta: c = !0, allowUpload: l = !0, typeFilters: u = J, confirmOnSelect: d = !1, onConfirm: _, onCancel: v, onClose: b, bulkActions: x, strings: te, slots: S, className: ne, collections: C = [], selectionMode: w = "multiple", ...O }) {
|
|
1509
|
+
let k = I(() => a(V, te), [te]), { items: A, fetcher: ie, accessors: ae, value: j, defaultValue: M, onValueChange: oe, onItemUpdate: se, applyItemPatch: ce, onItemDelete: N, onUpload: le, onError: ue, tab: de, defaultTab: fe, onTabChange: pe, view: me, defaultView: he, onViewChange: ge, query: _e, defaultQuery: ve, onQueryChange: ye, type: be, defaultType: xe, onTypeChange: Se, collection: P, defaultCollection: F, onCollectionChange: L, sort: R, defaultSort: Ce, onSortChange: we, uploadOptions: Te, defaultUploadOptions: Ee, onUploadOptionsChange: De, ...Oe } = O, H = Re({
|
|
1510
|
+
items: A,
|
|
1511
|
+
fetcher: ie,
|
|
1512
|
+
accessors: ae,
|
|
1513
|
+
value: j,
|
|
1514
|
+
defaultValue: M,
|
|
1515
|
+
onValueChange: oe,
|
|
1516
|
+
onItemUpdate: se,
|
|
1517
|
+
applyItemPatch: ce,
|
|
1518
|
+
onItemDelete: N,
|
|
1519
|
+
onUpload: le,
|
|
1520
|
+
onError: ue,
|
|
1521
|
+
tab: de,
|
|
1522
|
+
defaultTab: fe,
|
|
1523
|
+
onTabChange: pe,
|
|
1524
|
+
view: me,
|
|
1525
|
+
defaultView: he,
|
|
1526
|
+
onViewChange: ge,
|
|
1527
|
+
query: _e,
|
|
1528
|
+
defaultQuery: ve,
|
|
1529
|
+
onQueryChange: ye,
|
|
1530
|
+
type: be,
|
|
1531
|
+
defaultType: xe,
|
|
1532
|
+
onTypeChange: Se,
|
|
1533
|
+
collection: P,
|
|
1534
|
+
defaultCollection: F,
|
|
1535
|
+
onCollectionChange: L,
|
|
1536
|
+
sort: R,
|
|
1537
|
+
defaultSort: Ce,
|
|
1538
|
+
onSortChange: we,
|
|
1539
|
+
uploadOptions: Te,
|
|
1540
|
+
defaultUploadOptions: Ee,
|
|
1541
|
+
onUploadOptionsChange: De,
|
|
1542
|
+
collections: C,
|
|
1543
|
+
selectionMode: w
|
|
1544
|
+
}), { tab: ke, setTab: Ae, view: je, setView: Me, query: Ne, setQuery: Pe, type: Fe, setType: Ie, collection: Le, setCollection: ze, sort: Be, setSort: He, detailId: Ue, setDetailId: Ge, visibleItems: G, selectedIds: K, selectedItems: Ze, selectedSet: Y, toggleSelection: Qe, clearSelection: $e, clearFilters: X, loading: et, hasFilters: tt, totalCount: Z, filteredCount: nt, accessors: Q, fetchError: rt, refetch: $ } = H, it = I(() => H.items.find((e) => Q.getId(e) === Ue) ?? null, [
|
|
1545
1545
|
Q,
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
]), at = !
|
|
1549
|
-
if (
|
|
1550
|
-
let t =
|
|
1551
|
-
t && _?.([t], [e]),
|
|
1552
|
-
}, st =
|
|
1553
|
-
label:
|
|
1546
|
+
Ue,
|
|
1547
|
+
H.items
|
|
1548
|
+
]), at = !d && !!_, ot = (e) => {
|
|
1549
|
+
if (Qe(e), !d) return;
|
|
1550
|
+
let t = H.items.find((t) => Q.getId(t) === e);
|
|
1551
|
+
t && _?.([t], [e]), b?.();
|
|
1552
|
+
}, st = et && G.length === 0 ? S?.loading ?? /* @__PURE__ */ z(g, {
|
|
1553
|
+
label: k.loading,
|
|
1554
1554
|
"aria-hidden": "true",
|
|
1555
1555
|
"aria-live": "off",
|
|
1556
|
-
className:
|
|
1557
|
-
}) : rt &&
|
|
1558
|
-
title:
|
|
1556
|
+
className: U.emptyState
|
|
1557
|
+
}) : rt && G.length === 0 ? S?.error ?? /* @__PURE__ */ z(y, {
|
|
1558
|
+
title: k.error,
|
|
1559
1559
|
description: !1,
|
|
1560
|
-
className:
|
|
1560
|
+
className: U.emptyState,
|
|
1561
1561
|
onRetry: rt ? $ : void 0,
|
|
1562
|
-
strings: { retry:
|
|
1563
|
-
}) :
|
|
1564
|
-
title:
|
|
1565
|
-
description:
|
|
1566
|
-
action:
|
|
1562
|
+
strings: { retry: k.retry }
|
|
1563
|
+
}) : G.length === 0 ? S?.empty ?? /* @__PURE__ */ z(We, {
|
|
1564
|
+
title: tt ? k.emptyFilteredTitle : k.emptyTitle,
|
|
1565
|
+
description: tt ? k.emptyFilteredDescription : k.emptyDescription,
|
|
1566
|
+
action: tt ? /* @__PURE__ */ z(r, {
|
|
1567
1567
|
type: "button",
|
|
1568
1568
|
tone: "neutral",
|
|
1569
|
-
|
|
1570
|
-
onClick:
|
|
1571
|
-
children:
|
|
1569
|
+
appearance: "outline",
|
|
1570
|
+
onClick: X,
|
|
1571
|
+
children: k.clearFilters
|
|
1572
1572
|
}) : void 0
|
|
1573
|
-
}) :
|
|
1574
|
-
collections:
|
|
1575
|
-
items:
|
|
1576
|
-
selectedSet:
|
|
1577
|
-
selectionMode:
|
|
1573
|
+
}) : je === "table" || je === "list" ? /* @__PURE__ */ z(je === "table" ? q : Ke, {
|
|
1574
|
+
collections: C,
|
|
1575
|
+
items: G,
|
|
1576
|
+
selectedSet: Y,
|
|
1577
|
+
selectionMode: w,
|
|
1578
1578
|
accessors: Q,
|
|
1579
|
-
strings:
|
|
1579
|
+
strings: k,
|
|
1580
1580
|
onToggle: ot,
|
|
1581
|
-
onDetails:
|
|
1582
|
-
}) : /* @__PURE__ */
|
|
1583
|
-
items:
|
|
1584
|
-
selectedSet:
|
|
1585
|
-
selectionMode:
|
|
1581
|
+
onDetails: Ge
|
|
1582
|
+
}) : /* @__PURE__ */ z(Ye, {
|
|
1583
|
+
items: G,
|
|
1584
|
+
selectedSet: Y,
|
|
1585
|
+
selectionMode: w,
|
|
1586
1586
|
accessors: Q,
|
|
1587
|
-
strings:
|
|
1587
|
+
strings: k,
|
|
1588
1588
|
onToggle: ot,
|
|
1589
|
-
onDetails:
|
|
1590
|
-
|
|
1591
|
-
showMeta:
|
|
1592
|
-
renderItem:
|
|
1593
|
-
}), ct = /* @__PURE__ */
|
|
1594
|
-
className:
|
|
1589
|
+
onDetails: Ge,
|
|
1590
|
+
size: s,
|
|
1591
|
+
showMeta: c,
|
|
1592
|
+
renderItem: S?.renderItem
|
|
1593
|
+
}), ct = /* @__PURE__ */ B("div", {
|
|
1594
|
+
className: U.browse,
|
|
1595
1595
|
children: [
|
|
1596
|
-
/* @__PURE__ */
|
|
1597
|
-
query:
|
|
1598
|
-
onQueryChange:
|
|
1599
|
-
type:
|
|
1600
|
-
onTypeChange:
|
|
1601
|
-
typeFilters:
|
|
1602
|
-
collection:
|
|
1603
|
-
onCollectionChange:
|
|
1604
|
-
collections:
|
|
1605
|
-
sort:
|
|
1606
|
-
onSortChange:
|
|
1607
|
-
view:
|
|
1608
|
-
onViewChange:
|
|
1609
|
-
hasFilters:
|
|
1610
|
-
onClearFilters:
|
|
1611
|
-
strings:
|
|
1612
|
-
end:
|
|
1596
|
+
/* @__PURE__ */ z(W, {
|
|
1597
|
+
query: Ne,
|
|
1598
|
+
onQueryChange: Pe,
|
|
1599
|
+
type: Fe,
|
|
1600
|
+
onTypeChange: Ie,
|
|
1601
|
+
typeFilters: u,
|
|
1602
|
+
collection: Le,
|
|
1603
|
+
onCollectionChange: ze,
|
|
1604
|
+
collections: C,
|
|
1605
|
+
sort: Be,
|
|
1606
|
+
onSortChange: He,
|
|
1607
|
+
view: je,
|
|
1608
|
+
onViewChange: Me,
|
|
1609
|
+
hasFilters: tt,
|
|
1610
|
+
onClearFilters: X,
|
|
1611
|
+
strings: k,
|
|
1612
|
+
end: S?.toolbarEnd
|
|
1613
1613
|
}),
|
|
1614
|
-
/* @__PURE__ */
|
|
1615
|
-
visibleCount:
|
|
1616
|
-
totalCount:
|
|
1617
|
-
selectedVisibleCount:
|
|
1618
|
-
onSelectVisible:
|
|
1619
|
-
onDeselectVisible:
|
|
1620
|
-
disabled:
|
|
1621
|
-
status:
|
|
1622
|
-
strings:
|
|
1614
|
+
/* @__PURE__ */ z(Xe, {
|
|
1615
|
+
visibleCount: nt,
|
|
1616
|
+
totalCount: Z,
|
|
1617
|
+
selectedVisibleCount: G.filter((e) => Y.has(Q.getId(e))).length,
|
|
1618
|
+
onSelectVisible: w === "multiple" ? H.selectVisible : void 0,
|
|
1619
|
+
onDeselectVisible: w === "multiple" ? H.deselectVisible : void 0,
|
|
1620
|
+
disabled: et,
|
|
1621
|
+
status: et ? k.loading : void 0,
|
|
1622
|
+
strings: k
|
|
1623
1623
|
}),
|
|
1624
|
-
rt &&
|
|
1624
|
+
rt && G.length > 0 ? /* @__PURE__ */ B(h, {
|
|
1625
1625
|
tone: "warning",
|
|
1626
1626
|
role: "alert",
|
|
1627
|
-
children: [/* @__PURE__ */
|
|
1627
|
+
children: [/* @__PURE__ */ z(p, { children: k.refreshError }), /* @__PURE__ */ z(m, { children: /* @__PURE__ */ z(r, {
|
|
1628
1628
|
tone: "neutral",
|
|
1629
|
-
|
|
1629
|
+
appearance: "outline",
|
|
1630
1630
|
onClick: $,
|
|
1631
|
-
children:
|
|
1631
|
+
children: k.retry
|
|
1632
1632
|
}) })]
|
|
1633
1633
|
}) : null,
|
|
1634
|
-
/* @__PURE__ */
|
|
1635
|
-
className:
|
|
1634
|
+
/* @__PURE__ */ B("div", {
|
|
1635
|
+
className: U.workspace,
|
|
1636
1636
|
"data-detail": it ? "" : void 0,
|
|
1637
|
-
children: [/* @__PURE__ */
|
|
1638
|
-
className:
|
|
1639
|
-
"aria-busy":
|
|
1637
|
+
children: [/* @__PURE__ */ z("div", {
|
|
1638
|
+
className: n("media-library--results", U.results),
|
|
1639
|
+
"aria-busy": et,
|
|
1640
1640
|
children: st
|
|
1641
|
-
}), !!it && /* @__PURE__ */
|
|
1641
|
+
}), !!it && /* @__PURE__ */ z(Ve, {
|
|
1642
1642
|
item: it,
|
|
1643
|
-
collections:
|
|
1643
|
+
collections: C,
|
|
1644
1644
|
accessors: Q,
|
|
1645
|
-
strings:
|
|
1646
|
-
onClose: () =>
|
|
1647
|
-
onUpdate: (e) =>
|
|
1648
|
-
onRemove: () =>
|
|
1649
|
-
renderDetail:
|
|
1650
|
-
},
|
|
1645
|
+
strings: k,
|
|
1646
|
+
onClose: () => Ge(null),
|
|
1647
|
+
onUpdate: (e) => H.updateItem(it, e),
|
|
1648
|
+
onRemove: () => H.removeItem(it),
|
|
1649
|
+
renderDetail: S?.renderDetail
|
|
1650
|
+
}, Ue)]
|
|
1651
1651
|
})
|
|
1652
1652
|
]
|
|
1653
1653
|
});
|
|
1654
|
-
return /* @__PURE__ */
|
|
1655
|
-
...
|
|
1654
|
+
return /* @__PURE__ */ B("section", {
|
|
1655
|
+
...Oe,
|
|
1656
1656
|
"data-slot": "media-library",
|
|
1657
|
-
className:
|
|
1657
|
+
className: n("media-library--component", U.root, ne),
|
|
1658
1658
|
children: [
|
|
1659
|
-
!!(
|
|
1660
|
-
className:
|
|
1661
|
-
children: [
|
|
1659
|
+
!!(e || t || S?.headerStart || S?.headerEnd) && /* @__PURE__ */ B("header", {
|
|
1660
|
+
className: U.header,
|
|
1661
|
+
children: [S?.headerStart, !!(e || t || S?.headerEnd) && /* @__PURE__ */ z(ee, {
|
|
1662
1662
|
surface: "plain",
|
|
1663
|
-
title:
|
|
1664
|
-
description:
|
|
1665
|
-
headerEnd:
|
|
1663
|
+
title: e || void 0,
|
|
1664
|
+
description: t || void 0,
|
|
1665
|
+
headerEnd: S?.headerEnd
|
|
1666
1666
|
})]
|
|
1667
1667
|
}),
|
|
1668
|
-
|
|
1669
|
-
value:
|
|
1670
|
-
onValueChange: (e) =>
|
|
1671
|
-
className:
|
|
1668
|
+
l && le ? /* @__PURE__ */ B(E, {
|
|
1669
|
+
value: ke,
|
|
1670
|
+
onValueChange: (e) => Ae(e),
|
|
1671
|
+
className: U.libraryTabs,
|
|
1672
1672
|
children: [
|
|
1673
|
-
/* @__PURE__ */
|
|
1674
|
-
className:
|
|
1675
|
-
children: [/* @__PURE__ */
|
|
1673
|
+
/* @__PURE__ */ B(re, {
|
|
1674
|
+
className: U.libraryTabList,
|
|
1675
|
+
children: [/* @__PURE__ */ z(D, {
|
|
1676
1676
|
value: "library",
|
|
1677
|
-
children:
|
|
1678
|
-
}), /* @__PURE__ */
|
|
1677
|
+
children: k.tabs.library
|
|
1678
|
+
}), /* @__PURE__ */ z(D, {
|
|
1679
1679
|
value: "upload",
|
|
1680
|
-
children:
|
|
1680
|
+
children: k.tabs.upload
|
|
1681
1681
|
})]
|
|
1682
1682
|
}),
|
|
1683
|
-
/* @__PURE__ */
|
|
1683
|
+
/* @__PURE__ */ z(T, {
|
|
1684
1684
|
value: "library",
|
|
1685
|
-
className:
|
|
1685
|
+
className: U.libraryTabPanel,
|
|
1686
1686
|
children: ct
|
|
1687
1687
|
}),
|
|
1688
|
-
/* @__PURE__ */
|
|
1688
|
+
/* @__PURE__ */ z(T, {
|
|
1689
1689
|
value: "upload",
|
|
1690
|
-
className:
|
|
1691
|
-
children: /* @__PURE__ */
|
|
1692
|
-
stagedFiles:
|
|
1693
|
-
uploading:
|
|
1694
|
-
uploadOptions:
|
|
1695
|
-
collections:
|
|
1696
|
-
strings:
|
|
1697
|
-
onAddFiles:
|
|
1698
|
-
onRemoveFile:
|
|
1699
|
-
onClear:
|
|
1700
|
-
onOptionsChange:
|
|
1701
|
-
onStart: () => void
|
|
1702
|
-
onCancel:
|
|
1703
|
-
empty:
|
|
1690
|
+
className: U.libraryTabPanel,
|
|
1691
|
+
children: /* @__PURE__ */ z(qe, {
|
|
1692
|
+
stagedFiles: H.stagedFiles,
|
|
1693
|
+
uploading: H.uploading,
|
|
1694
|
+
uploadOptions: H.uploadOptions,
|
|
1695
|
+
collections: C,
|
|
1696
|
+
strings: k,
|
|
1697
|
+
onAddFiles: H.addFiles,
|
|
1698
|
+
onRemoveFile: H.removeStagedFile,
|
|
1699
|
+
onClear: H.clearStagedFiles,
|
|
1700
|
+
onOptionsChange: H.updateUploadOptions,
|
|
1701
|
+
onStart: () => void H.startUpload(),
|
|
1702
|
+
onCancel: H.cancelUpload,
|
|
1703
|
+
empty: S?.uploadEmpty,
|
|
1704
1704
|
showActions: !at
|
|
1705
1705
|
})
|
|
1706
1706
|
})
|
|
1707
1707
|
]
|
|
1708
1708
|
}) : ct,
|
|
1709
|
-
|
|
1710
|
-
!!
|
|
1711
|
-
selectedCount:
|
|
1712
|
-
totalCount:
|
|
1713
|
-
onClear:
|
|
1709
|
+
S?.footer,
|
|
1710
|
+
!!x && !at && /* @__PURE__ */ z(f, {
|
|
1711
|
+
selectedCount: K.length,
|
|
1712
|
+
totalCount: Z,
|
|
1713
|
+
onClear: $e,
|
|
1714
1714
|
strings: {
|
|
1715
|
-
summary: (e) =>
|
|
1716
|
-
clear:
|
|
1715
|
+
summary: (e) => k.selectedCount(e),
|
|
1716
|
+
clear: k.clearSelection
|
|
1717
1717
|
},
|
|
1718
|
-
children:
|
|
1719
|
-
selectedItems:
|
|
1720
|
-
selectedIds:
|
|
1721
|
-
selectedCount:
|
|
1722
|
-
visibleCount:
|
|
1723
|
-
totalCount:
|
|
1724
|
-
clearSelection:
|
|
1718
|
+
children: x({
|
|
1719
|
+
selectedItems: Ze,
|
|
1720
|
+
selectedIds: K,
|
|
1721
|
+
selectedCount: K.length,
|
|
1722
|
+
visibleCount: nt,
|
|
1723
|
+
totalCount: Z,
|
|
1724
|
+
clearSelection: $e
|
|
1725
1725
|
})
|
|
1726
1726
|
}),
|
|
1727
|
-
at && /* @__PURE__ */
|
|
1728
|
-
tab:
|
|
1729
|
-
selectedItems:
|
|
1730
|
-
selectedIds:
|
|
1731
|
-
selectionMode:
|
|
1732
|
-
stagedFiles:
|
|
1733
|
-
uploading:
|
|
1734
|
-
strings:
|
|
1735
|
-
visibleCount:
|
|
1736
|
-
totalCount:
|
|
1737
|
-
confirmLabel:
|
|
1738
|
-
cancelLabel:
|
|
1739
|
-
onClearSelection:
|
|
1727
|
+
at && /* @__PURE__ */ z(Je, {
|
|
1728
|
+
tab: ke,
|
|
1729
|
+
selectedItems: Ze,
|
|
1730
|
+
selectedIds: K,
|
|
1731
|
+
selectionMode: w,
|
|
1732
|
+
stagedFiles: H.stagedFiles,
|
|
1733
|
+
uploading: H.uploading,
|
|
1734
|
+
strings: k,
|
|
1735
|
+
visibleCount: nt,
|
|
1736
|
+
totalCount: Z,
|
|
1737
|
+
confirmLabel: i,
|
|
1738
|
+
cancelLabel: o,
|
|
1739
|
+
onClearSelection: K.length > 0 ? $e : void 0,
|
|
1740
1740
|
onCancel: () => {
|
|
1741
|
-
v?.(),
|
|
1741
|
+
v?.(), b?.();
|
|
1742
1742
|
},
|
|
1743
1743
|
onConfirm: () => {
|
|
1744
|
-
_(
|
|
1744
|
+
_(Ze, K), b?.();
|
|
1745
1745
|
},
|
|
1746
|
-
onUpload: () => void
|
|
1746
|
+
onUpload: () => void H.startUpload(),
|
|
1747
1747
|
onCancelUpload: () => {
|
|
1748
|
-
|
|
1748
|
+
H.uploading ? H.cancelUpload() : (v?.(), b?.());
|
|
1749
1749
|
}
|
|
1750
1750
|
})
|
|
1751
1751
|
]
|
|
1752
1752
|
});
|
|
1753
1753
|
}
|
|
1754
|
-
function
|
|
1755
|
-
let
|
|
1756
|
-
return /* @__PURE__ */
|
|
1757
|
-
open:
|
|
1758
|
-
onOpenChange:
|
|
1754
|
+
function Y({ open: e, onOpenChange: t, trigger: r, dialogTitle: i, dialogDescription: o, dialogClassName: s, contentClassName: c, closeOnEscape: l, closeOnBackdropClick: u, onClose: d, strings: f, ...p }) {
|
|
1755
|
+
let m = a(V, f);
|
|
1756
|
+
return /* @__PURE__ */ z(se, {
|
|
1757
|
+
open: e,
|
|
1758
|
+
onOpenChange: t,
|
|
1759
1759
|
trigger: r,
|
|
1760
|
-
title: i ??
|
|
1761
|
-
description:
|
|
1760
|
+
title: i ?? m.title,
|
|
1761
|
+
description: o ?? m.description,
|
|
1762
1762
|
width: "xl",
|
|
1763
|
-
closeOnEscape:
|
|
1764
|
-
closeOnBackdropClick:
|
|
1763
|
+
closeOnEscape: l,
|
|
1764
|
+
closeOnBackdropClick: u,
|
|
1765
1765
|
showCancel: !1,
|
|
1766
1766
|
showConfirm: !1,
|
|
1767
|
-
className:
|
|
1768
|
-
contentClassName:
|
|
1769
|
-
children: /* @__PURE__ */
|
|
1770
|
-
...
|
|
1771
|
-
strings:
|
|
1767
|
+
className: n("media-library-dialog--component", s),
|
|
1768
|
+
contentClassName: c,
|
|
1769
|
+
children: /* @__PURE__ */ z(Ze, {
|
|
1770
|
+
...p,
|
|
1771
|
+
strings: f,
|
|
1772
1772
|
onClose: () => {
|
|
1773
|
-
|
|
1773
|
+
d?.(), t?.(!1);
|
|
1774
1774
|
}
|
|
1775
1775
|
})
|
|
1776
1776
|
});
|
|
1777
1777
|
}
|
|
1778
1778
|
//#endregion
|
|
1779
1779
|
//#region src/components/features/media-library/media-resource-gallery.tsx
|
|
1780
|
-
function
|
|
1781
|
-
let C =
|
|
1782
|
-
if (n < 0 || n >=
|
|
1783
|
-
let r = [...
|
|
1780
|
+
function Qe({ items: e, accessors: i, title: o, description: s, primaryId: c, onPrimaryChange: l, onRemove: u, onReorder: f, onAdd: p, maxItems: m, layout: h = "grid", size: g = "default", readOnly: v = !1, empty: y, action: b, renderItem: x, strings: te, className: S, ...ne }) {
|
|
1781
|
+
let C = a(V, te), w = Oe(i), re = m !== void 0 && e.length >= m, T = !v && !!p && !re, E = (t, n) => {
|
|
1782
|
+
if (n < 0 || n >= e.length) return;
|
|
1783
|
+
let r = [...e], [i] = r.splice(t, 1);
|
|
1784
1784
|
i && (r.splice(n, 0, i), f?.(r.map((e) => w.getId(e)), r));
|
|
1785
1785
|
};
|
|
1786
|
-
return /* @__PURE__ */
|
|
1786
|
+
return /* @__PURE__ */ B("section", {
|
|
1787
1787
|
"data-slot": "media-resource-gallery",
|
|
1788
|
-
className:
|
|
1789
|
-
...
|
|
1790
|
-
children: [!!(
|
|
1791
|
-
title:
|
|
1792
|
-
description:
|
|
1793
|
-
headerEnd: /* @__PURE__ */
|
|
1794
|
-
className:
|
|
1788
|
+
className: n("media-resource-gallery--component", U.gallery, S),
|
|
1789
|
+
...ne,
|
|
1790
|
+
children: [!!(o || s || b || T) && /* @__PURE__ */ z(ee, {
|
|
1791
|
+
title: o || void 0,
|
|
1792
|
+
description: s || void 0,
|
|
1793
|
+
headerEnd: /* @__PURE__ */ B("div", {
|
|
1794
|
+
className: U.galleryActions,
|
|
1795
1795
|
children: [
|
|
1796
|
-
|
|
1797
|
-
|
|
1796
|
+
b,
|
|
1797
|
+
T && /* @__PURE__ */ B(r, {
|
|
1798
1798
|
type: "button",
|
|
1799
1799
|
tone: "neutral",
|
|
1800
|
-
|
|
1800
|
+
appearance: "outline",
|
|
1801
1801
|
onClick: p,
|
|
1802
|
-
children: [/* @__PURE__ */
|
|
1802
|
+
children: [/* @__PURE__ */ z(_e, {}), C.gallery.add]
|
|
1803
1803
|
}),
|
|
1804
|
-
|
|
1804
|
+
re && m !== void 0 && /* @__PURE__ */ z(t, {
|
|
1805
1805
|
size: "xs",
|
|
1806
1806
|
type: "secondary",
|
|
1807
1807
|
children: C.gallery.limitReached(m)
|
|
1808
1808
|
})
|
|
1809
1809
|
]
|
|
1810
1810
|
})
|
|
1811
|
-
}),
|
|
1811
|
+
}), e.length === 0 ? y ?? /* @__PURE__ */ z(_, {
|
|
1812
1812
|
title: C.gallery.emptyTitle,
|
|
1813
1813
|
description: C.gallery.emptyDescription,
|
|
1814
|
-
padding: "md",
|
|
1815
1814
|
border: !0,
|
|
1816
|
-
action:
|
|
1815
|
+
action: T ? /* @__PURE__ */ z(r, {
|
|
1817
1816
|
type: "button",
|
|
1818
1817
|
tone: "neutral",
|
|
1819
|
-
|
|
1818
|
+
appearance: "outline",
|
|
1820
1819
|
onClick: p,
|
|
1821
1820
|
children: C.gallery.add
|
|
1822
1821
|
}) : void 0
|
|
1823
|
-
}) : /* @__PURE__ */
|
|
1822
|
+
}) : /* @__PURE__ */ z("ul", {
|
|
1824
1823
|
"data-layout": h,
|
|
1825
|
-
"data-
|
|
1826
|
-
className:
|
|
1827
|
-
children:
|
|
1828
|
-
let
|
|
1829
|
-
id:
|
|
1824
|
+
"data-size": g,
|
|
1825
|
+
className: U.galleryList,
|
|
1826
|
+
children: e.map((t, n) => {
|
|
1827
|
+
let i = w.getId(t), a = i === c, o = {
|
|
1828
|
+
id: i,
|
|
1830
1829
|
index: n,
|
|
1831
|
-
total:
|
|
1832
|
-
primary:
|
|
1830
|
+
total: e.length,
|
|
1831
|
+
primary: a,
|
|
1833
1832
|
accessors: w,
|
|
1834
1833
|
canMovePrevious: n > 0,
|
|
1835
|
-
canMoveNext: n <
|
|
1836
|
-
setPrimary: () =>
|
|
1837
|
-
remove: () =>
|
|
1838
|
-
movePrevious: () =>
|
|
1839
|
-
moveNext: () =>
|
|
1834
|
+
canMoveNext: n < e.length - 1,
|
|
1835
|
+
setPrimary: () => l?.(i, t),
|
|
1836
|
+
remove: () => u?.(i, t),
|
|
1837
|
+
movePrevious: () => E(n, n - 1),
|
|
1838
|
+
moveNext: () => E(n, n + 1)
|
|
1840
1839
|
};
|
|
1841
|
-
return
|
|
1842
|
-
"data-primary":
|
|
1843
|
-
className:
|
|
1840
|
+
return x ? /* @__PURE__ */ z("li", { children: x(t, o) }, i) : /* @__PURE__ */ B("li", {
|
|
1841
|
+
"data-primary": a || void 0,
|
|
1842
|
+
className: U.galleryItem,
|
|
1844
1843
|
children: [
|
|
1845
|
-
/* @__PURE__ */
|
|
1846
|
-
item:
|
|
1844
|
+
/* @__PURE__ */ z(Be, {
|
|
1845
|
+
item: t,
|
|
1847
1846
|
accessors: w,
|
|
1848
|
-
className:
|
|
1847
|
+
className: U.galleryPreview
|
|
1849
1848
|
}),
|
|
1850
|
-
|
|
1849
|
+
a && /* @__PURE__ */ z(d, {
|
|
1851
1850
|
tone: "primary",
|
|
1852
|
-
|
|
1851
|
+
appearance: "solid",
|
|
1852
|
+
className: U.galleryBadge,
|
|
1853
1853
|
children: C.gallery.primary
|
|
1854
1854
|
}),
|
|
1855
|
-
!
|
|
1856
|
-
className:
|
|
1855
|
+
!v && /* @__PURE__ */ B("div", {
|
|
1856
|
+
className: U.galleryControls,
|
|
1857
1857
|
children: [
|
|
1858
|
-
!!f && /* @__PURE__ */
|
|
1858
|
+
!!f && /* @__PURE__ */ B(Ce, { children: [/* @__PURE__ */ z(r, {
|
|
1859
1859
|
type: "button",
|
|
1860
1860
|
tone: "neutral",
|
|
1861
|
-
|
|
1861
|
+
appearance: "ghost",
|
|
1862
1862
|
iconOnly: !0,
|
|
1863
1863
|
"aria-label": C.gallery.moveEarlier,
|
|
1864
|
-
disabled: !
|
|
1865
|
-
onClick:
|
|
1866
|
-
children: /* @__PURE__ */
|
|
1867
|
-
}), /* @__PURE__ */
|
|
1864
|
+
disabled: !o.canMovePrevious,
|
|
1865
|
+
onClick: o.movePrevious,
|
|
1866
|
+
children: /* @__PURE__ */ z(le, {})
|
|
1867
|
+
}), /* @__PURE__ */ z(r, {
|
|
1868
1868
|
type: "button",
|
|
1869
1869
|
tone: "neutral",
|
|
1870
|
-
|
|
1870
|
+
appearance: "ghost",
|
|
1871
1871
|
iconOnly: !0,
|
|
1872
1872
|
"aria-label": C.gallery.moveLater,
|
|
1873
|
-
disabled: !
|
|
1874
|
-
onClick:
|
|
1875
|
-
children: /* @__PURE__ */
|
|
1873
|
+
disabled: !o.canMoveNext,
|
|
1874
|
+
onClick: o.moveNext,
|
|
1875
|
+
children: /* @__PURE__ */ z(ue, {})
|
|
1876
1876
|
})] }),
|
|
1877
|
-
!!
|
|
1877
|
+
!!l && !a && /* @__PURE__ */ z(r, {
|
|
1878
1878
|
type: "button",
|
|
1879
1879
|
tone: "neutral",
|
|
1880
|
-
|
|
1880
|
+
appearance: "ghost",
|
|
1881
1881
|
iconOnly: !0,
|
|
1882
1882
|
"aria-label": C.gallery.makePrimary,
|
|
1883
|
-
onClick:
|
|
1884
|
-
children: /* @__PURE__ */
|
|
1883
|
+
onClick: o.setPrimary,
|
|
1884
|
+
children: /* @__PURE__ */ z(ye, {})
|
|
1885
1885
|
}),
|
|
1886
|
-
!!
|
|
1886
|
+
!!u && /* @__PURE__ */ z(r, {
|
|
1887
1887
|
type: "button",
|
|
1888
1888
|
tone: "neutral",
|
|
1889
|
-
|
|
1889
|
+
appearance: "ghost",
|
|
1890
1890
|
iconOnly: !0,
|
|
1891
|
-
"aria-label": `${C.gallery.remove}: ${w.getName(
|
|
1892
|
-
onClick:
|
|
1893
|
-
children: /* @__PURE__ */
|
|
1891
|
+
"aria-label": `${C.gallery.remove}: ${w.getName(t)}`,
|
|
1892
|
+
onClick: o.remove,
|
|
1893
|
+
children: /* @__PURE__ */ z(Se, {})
|
|
1894
1894
|
})
|
|
1895
1895
|
]
|
|
1896
1896
|
})
|
|
1897
1897
|
]
|
|
1898
|
-
},
|
|
1898
|
+
}, i);
|
|
1899
1899
|
})
|
|
1900
1900
|
})]
|
|
1901
1901
|
});
|
|
1902
1902
|
}
|
|
1903
1903
|
//#endregion
|
|
1904
|
-
export {
|
|
1904
|
+
export { Ze as MediaLibrary, Ge as MediaLibraryCard, Ve as MediaLibraryDetailPanel, Y as MediaLibraryDialog, We as MediaLibraryEmptyState, Je as MediaLibraryFooter, K as MediaLibraryFooterActions, G as MediaLibraryFooterSummary, Ye as MediaLibraryGrid, Ke as MediaLibraryList, Xe as MediaLibrarySelectionBar, q as MediaLibraryTable, W as MediaLibraryToolbar, qe as MediaLibraryUploadPanel, Be as MediaPreview, Qe as MediaResourceGallery, V as defaultMediaLibraryStrings, H as formatMediaLibrarySize, ke as getMediaLibraryDimensions, Oe as resolveMediaLibraryAccessors, Re as useMediaLibrary };
|