@leavepulse/ui 0.43.3 → 0.44.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/README.md +75 -7
- package/dist/assets/{LpCommandPalette-DH7sPcKP.css → LpCommandPalette-DCP5g2ik.css} +21 -21
- package/dist/assets/{LpDropzone-BBoWvi-J.css → LpDropzone-i4BdMi1H.css} +12 -12
- package/dist/assets/{LpImageEditor-Ct7Y3aNu.css → LpImageEditor-CbMA82g8.css} +6 -6
- package/dist/assets/{LpShortcutsDialog-C6YoQ8_M.css → LpShortcutsDialog-ChUyU7oV.css} +7 -7
- package/dist/assets/{LpSkeleton-D7xU8IPV.css → LpSkeleton-H3Z5dEIk.css} +4 -1
- package/dist/assets/{LpTable-BgPLJOXa.css → LpTable-DDQNdf86.css} +9 -9
- package/dist/chunks/ContextMenuItems-CrfeNPWT.js +123 -0
- package/dist/chunks/{LayoutCanvas-Dd20boUG.js → LayoutCanvas-D-jPOAvg.js} +26 -9
- package/dist/chunks/{LayoutNode-DGpZA9LX.js → LayoutNode-D8Xy9N-o.js} +20 -8
- package/dist/chunks/{LpActionBar-BlvtGB2P.js → LpActionBar-BbwCF6l5.js} +24 -10
- package/dist/chunks/{LpAddressInput-B-Zvxsn7.js → LpAddressInput-BrOqkZqg.js} +53 -48
- package/dist/chunks/{LpAlert-BAYHDSS1.js → LpAlert-DkOIjsbq.js} +15 -8
- package/dist/chunks/{LpAppShell-BGQVIY-3.js → LpAppShell-BUKPcHco.js} +51 -24
- package/dist/chunks/{LpAutocomplete-DExlIZe_.js → LpAutocomplete-DxV3Y9h4.js} +50 -23
- package/dist/chunks/{LpAvatar-B3-xAOH3.js → LpAvatar-ClBbEYZN.js} +17 -8
- package/dist/chunks/LpBreadcrumbs-B8IJgFIc.js +95 -0
- package/dist/chunks/{LpButton-5VXXCjwF.js → LpButton-kqJBHIIb.js} +44 -14
- package/dist/chunks/{LpCard-BhI1N_vL.js → LpCard-CpRByR0q.js} +1 -1
- package/dist/chunks/{LpCheckbox-CVccKYaH.js → LpCheckbox-DpqchzH4.js} +7 -3
- package/dist/chunks/{LpCodeBlock-Bo0B4TFR.js → LpCodeBlock-DeHJPq7p.js} +48 -16
- package/dist/chunks/{LpColorPicker-BlXea7LM.js → LpColorPicker-Bhf1qxhB.js} +32 -9
- package/dist/chunks/{LpConfirmDialog-Q-bxff8z.js → LpConfirmDialog-CIUOSnWo.js} +58 -16
- package/dist/chunks/LpConfirmHost-CDm0Wtpv.js +49 -0
- package/dist/chunks/LpContextMenu-DQw5dGfG.js +68 -0
- package/dist/chunks/LpDatePicker-Drirx1AK.js +191 -0
- package/dist/chunks/{LpDrawer-BZ6k3hvo.js → LpDrawer-bScx-KMO.js} +63 -26
- package/dist/chunks/{LpFileTree-_5vFBgaK.js → LpFileTree-CSI_5SK2.js} +23 -8
- package/dist/chunks/{LpFileTreeNode-BdcIYKIE.js → LpFileTreeNode-B4MiSQX2.js} +2 -2
- package/dist/chunks/LpFormField-CIk5qosh.js +87 -0
- package/dist/chunks/{LpInput-9EXWUM9B.js → LpInput-C0e8y8_d.js} +26 -11
- package/dist/chunks/{LpLightbox-2sYVMY-S.js → LpLightbox-Mr0W_6HK.js} +147 -60
- package/dist/chunks/{LpLink-DCND-zyu.js → LpLink-Krkjhe_y.js} +15 -6
- package/dist/chunks/{LpLogViewer-CaRy5MeS.js → LpLogViewer-YBOaFnc_.js} +68 -34
- package/dist/chunks/{LpMapPicker-ul4oYno6.js → LpMapPicker-NUzS9e37.js} +38 -13
- package/dist/chunks/{LpMediaGallery-FF-NquIo.js → LpMediaGallery-DfJmMW0I.js} +6 -3
- package/dist/chunks/{LpModal-Bt0pQCI_.js → LpModal-DPwGKBPv.js} +49 -26
- package/dist/chunks/{LpModalNav-YaifHrXC.js → LpModalNav-DPg5H9f3.js} +9 -6
- package/dist/chunks/{LpNotificationBell-DyGGsMAM.js → LpNotificationBell-t5yn-siX.js} +58 -24
- package/dist/chunks/{LpNumberField-CWuX08iX.js → LpNumberField-DWnQKktS.js} +20 -7
- package/dist/chunks/{LpNumberFlow-amWYaeuA.js → LpNumberFlow-z4WPZcZu.js} +22 -12
- package/dist/chunks/{LpOtpInput-y2v-pmiN.js → LpOtpInput-CziPF3Oq.js} +37 -8
- package/dist/chunks/{LpPagination-5FxjmmB5.js → LpPagination-DFngX7Xo.js} +30 -19
- package/dist/chunks/{LpPasswordInput--sjYCkLS.js → LpPasswordInput-CWVDuBJ5.js} +10 -7
- package/dist/chunks/{LpPhoneInput-BDSKVl_z.js → LpPhoneInput-CD-ZTeSd.js} +57 -33
- package/dist/chunks/{LpPie-D6OnzwlJ.js → LpPie-BLco31Nx.js} +78 -21
- package/dist/chunks/{LpPopover-8268UmlC.js → LpPopover-p_e_shN3.js} +4 -2
- package/dist/chunks/{LpProgress-Btq5W4Ut.js → LpProgress-CBU1iI69.js} +5 -4
- package/dist/chunks/{LpRadioGroup-xPIuVDO_.js → LpRadioGroup-DmEW0l78.js} +9 -2
- package/dist/chunks/{LpSegmented-fV0Sk92p.js → LpSegmented-Dejd7cIx.js} +7 -3
- package/dist/chunks/{LpSelect-ANIVtrpM.js → LpSelect-DrRD9I7L.js} +40 -18
- package/dist/chunks/{LpSidebar-ClBUwoEz.js → LpSidebar-BgwUNWpJ.js} +30 -22
- package/dist/chunks/{LpSidebarNav-llOcs_Fn.js → LpSidebarNav-Bqxz8aWT.js} +14 -9
- package/dist/chunks/{LpSkeleton-CTI-vBgW.js → LpSkeleton-BB6XIV-w.js} +1 -1
- package/dist/chunks/{LpSlider-BwNIBkAK.js → LpSlider-Cuzmrd7p.js} +7 -2
- package/dist/chunks/{LpSparkline-C6xQ2dwv.js → LpSparkline-CB80N8SJ.js} +11 -4
- package/dist/chunks/{LpStat-CQaW8R--.js → LpStat-dXtyrdX9.js} +1 -1
- package/dist/chunks/{LpSwitch-Blizvqyt.js → LpSwitch-B1aLKulj.js} +40 -26
- package/dist/chunks/{LpTableOfContents-CjvxPMpU.js → LpTableOfContents-BUcAfGPQ.js} +36 -41
- package/dist/chunks/{LpTabs-Cefe_lys.js → LpTabs-_qMVaZJ6.js} +19 -5
- package/dist/chunks/LpTextarea-yP8hGedR.js +77 -0
- package/dist/chunks/LpThemeProvider-Wjm7Tuit.js +35 -0
- package/dist/chunks/LpThemeSwitcher-CKLc10KZ.js +169 -0
- package/dist/chunks/{LpTilt-DuyKbpkA.js → LpTilt-B7KHX1zH.js} +2 -2
- package/dist/chunks/{LpTimeField-K6nAGboX.js → LpTimeField-C5HRgS5H.js} +13 -7
- package/dist/chunks/{LpToaster-gDB1EaU3.js → LpToaster--oT6lfhL.js} +57 -28
- package/dist/chunks/{LpTooltip-hCLPAqMG.js → LpTooltip-CBdzeKNf.js} +13 -6
- package/dist/chunks/LpTooltipProvider-CftjV7Xc.js +25 -0
- package/dist/chunks/{LpTopologyCanvas-Cm1L39uL.js → LpTopologyCanvas-DocsLal3.js} +6 -1
- package/dist/chunks/{LpUptimeBar-DvAMno0S.js → LpUptimeBar-DLtxOMRy.js} +43 -14
- package/dist/chunks/{LpThemeSwitcher-Cue-myST.js → useTheme-C8JHUlPM.js} +173 -215
- package/dist/component-names.d.ts +1 -1
- package/dist/components/ContextMenuItems.vue.d.ts +8 -0
- package/dist/components/ContextMenuItems.vue.js +4 -0
- package/dist/components/LayoutCanvas.vue.js +1 -1
- package/dist/components/LayoutNode.vue.d.ts +4 -0
- package/dist/components/LayoutNode.vue.js +1 -1
- package/dist/components/LpActionBar.vue.d.ts +3 -0
- package/dist/components/LpActionBar.vue.js +1 -1
- package/dist/components/LpAddressInput.vue.d.ts +1 -1
- package/dist/components/LpAddressInput.vue.js +1 -1
- package/dist/components/LpAlert.vue.d.ts +9 -0
- package/dist/components/LpAlert.vue.js +1 -1
- package/dist/components/LpAppShell.vue.d.ts +10 -0
- package/dist/components/LpAppShell.vue.js +1 -1
- package/dist/components/LpAutocomplete.vue.d.ts +31 -6
- package/dist/components/LpAutocomplete.vue.js +1 -1
- package/dist/components/LpAvatar.vue.d.ts +3 -3
- package/dist/components/LpAvatar.vue.js +1 -1
- package/dist/components/LpBadge.vue.d.ts +2 -2
- package/dist/components/LpBreadcrumbs.vue.d.ts +13 -9
- package/dist/components/LpBreadcrumbs.vue.js +1 -1
- package/dist/components/LpButton.vue.d.ts +35 -98
- package/dist/components/LpButton.vue.js +1 -1
- package/dist/components/LpCard.vue.js +1 -1
- package/dist/components/LpChart.vue.d.ts +31 -2
- package/dist/components/LpChart.vue.js +317 -95
- package/dist/components/LpCheckbox.vue.js +1 -1
- package/dist/components/LpCodeBlock.vue.d.ts +2 -0
- package/dist/components/LpCodeBlock.vue.js +1 -1
- package/dist/components/LpColorPicker.vue.js +1 -1
- package/dist/components/LpCommandPalette.vue.d.ts +8 -10
- package/dist/components/LpCommandPalette.vue.js +88 -78
- package/dist/components/LpConfirmDialog.vue.d.ts +15 -3
- package/dist/components/LpConfirmDialog.vue.js +1 -1
- package/dist/components/LpConfirmHost.vue.d.ts +9 -0
- package/dist/components/LpConfirmHost.vue.js +4 -0
- package/dist/components/LpContextMenu.vue.d.ts +3 -5
- package/dist/components/LpContextMenu.vue.js +1 -1
- package/dist/components/LpDatePicker.vue.d.ts +24 -6
- package/dist/components/LpDatePicker.vue.js +1 -1
- package/dist/components/LpDrawer.vue.d.ts +10 -0
- package/dist/components/LpDrawer.vue.js +1 -1
- package/dist/components/LpDropzone.vue.js +22 -6
- package/dist/components/LpFileTree.vue.d.ts +11 -2
- package/dist/components/LpFileTree.vue.js +1 -1
- package/dist/components/LpFileTreeNode.vue.js +1 -1
- package/dist/components/LpFormField.vue.d.ts +9 -0
- package/dist/components/LpFormField.vue.js +1 -1
- package/dist/components/LpImageEditor.vue.js +92 -57
- package/dist/components/LpInput.vue.d.ts +3 -3
- package/dist/components/LpInput.vue.js +1 -1
- package/dist/components/LpLightbox.vue.d.ts +17 -0
- package/dist/components/LpLightbox.vue.js +1 -1
- package/dist/components/LpLink.vue.d.ts +11 -11
- package/dist/components/LpLink.vue.js +1 -1
- package/dist/components/LpLogViewer.vue.d.ts +20 -2
- package/dist/components/LpLogViewer.vue.js +1 -1
- package/dist/components/LpMapPicker.vue.d.ts +4 -4
- package/dist/components/LpMapPicker.vue.js +1 -1
- package/dist/components/LpMediaGallery.vue.js +1 -1
- package/dist/components/LpModal.vue.d.ts +16 -6
- package/dist/components/LpModal.vue.js +1 -1
- package/dist/components/LpModalNav.vue.d.ts +0 -1
- package/dist/components/LpModalNav.vue.js +1 -1
- package/dist/components/LpNotificationBell.vue.d.ts +11 -2
- package/dist/components/LpNotificationBell.vue.js +1 -1
- package/dist/components/LpNumberField.vue.d.ts +2 -0
- package/dist/components/LpNumberField.vue.js +1 -1
- package/dist/components/LpNumberFlow.vue.js +1 -1
- package/dist/components/LpOtpInput.vue.js +1 -1
- package/dist/components/LpPagination.vue.d.ts +2 -0
- package/dist/components/LpPagination.vue.js +1 -1
- package/dist/components/LpPasswordInput.vue.js +1 -1
- package/dist/components/LpPhoneInput.vue.js +1 -1
- package/dist/components/LpPie.vue.d.ts +21 -2
- package/dist/components/LpPie.vue.js +1 -1
- package/dist/components/LpPopover.vue.d.ts +2 -0
- package/dist/components/LpPopover.vue.js +1 -1
- package/dist/components/LpProgress.vue.js +1 -1
- package/dist/components/LpRadioGroup.vue.js +1 -1
- package/dist/components/LpSection.vue.d.ts +1 -1
- package/dist/components/LpSegmented.vue.d.ts +5 -0
- package/dist/components/LpSegmented.vue.js +1 -1
- package/dist/components/LpSelect.vue.d.ts +1 -0
- package/dist/components/LpSelect.vue.js +1 -1
- package/dist/components/LpShortcutsDialog.vue.d.ts +1 -1
- package/dist/components/LpShortcutsDialog.vue.js +11 -8
- package/dist/components/LpSidebar.vue.d.ts +6 -2
- package/dist/components/LpSidebar.vue.js +1 -1
- package/dist/components/LpSidebarNav.vue.js +1 -1
- package/dist/components/LpSkeleton.vue.js +1 -1
- package/dist/components/LpSlider.vue.js +1 -1
- package/dist/components/LpSparkline.vue.d.ts +1 -0
- package/dist/components/LpSparkline.vue.js +1 -1
- package/dist/components/LpStat.vue.js +1 -1
- package/dist/components/LpSwitch.vue.js +1 -1
- package/dist/components/LpTable.vue.d.ts +23 -1
- package/dist/components/LpTable.vue.js +74 -36
- package/dist/components/LpTableOfContents.vue.d.ts +4 -2
- package/dist/components/LpTableOfContents.vue.js +1 -1
- package/dist/components/LpTabs.vue.d.ts +2 -0
- package/dist/components/LpTabs.vue.js +1 -1
- package/dist/components/LpTextarea.vue.d.ts +19 -6
- package/dist/components/LpTextarea.vue.js +1 -1
- package/dist/components/LpThemeProvider.vue.d.ts +22 -0
- package/dist/components/LpThemeProvider.vue.js +4 -0
- package/dist/components/LpThemeSwitcher.vue.d.ts +13 -0
- package/dist/components/LpThemeSwitcher.vue.js +1 -1
- package/dist/components/LpTilt.vue.js +1 -1
- package/dist/components/LpTimeField.vue.js +1 -1
- package/dist/components/LpToaster.vue.d.ts +6 -1
- package/dist/components/LpToaster.vue.js +1 -1
- package/dist/components/LpTooltip.vue.d.ts +1 -2
- package/dist/components/LpTooltip.vue.js +1 -1
- package/dist/components/LpTooltipProvider.vue.d.ts +22 -0
- package/dist/components/LpTooltipProvider.vue.js +4 -0
- package/dist/components/LpTopologyCanvas.vue.js +1 -1
- package/dist/components/LpUptimeBar.vue.d.ts +4 -0
- package/dist/components/LpUptimeBar.vue.js +1 -1
- package/dist/components/chart.d.ts +32 -1
- package/dist/components/chart.js +39 -4
- package/dist/components/codeHighlight.d.ts +6 -0
- package/dist/components/codeHighlight.js +92 -20
- package/dist/components/color.d.ts +1 -1
- package/dist/components/color.js +20 -9
- package/dist/components/commandSearch.d.ts +0 -1
- package/dist/components/commandSearch.js +1 -17
- package/dist/components/confirm.d.ts +25 -0
- package/dist/components/confirm.js +26 -0
- package/dist/components/countries.d.ts +6 -0
- package/dist/components/countries.js +7 -0
- package/dist/components/fileTree.js +16 -7
- package/dist/components/imageCrop.d.ts +42 -0
- package/dist/components/imageCrop.js +47 -0
- package/dist/components/link.d.ts +12 -0
- package/dist/components/link.js +19 -0
- package/dist/components/modalDepth.d.ts +18 -2
- package/dist/components/modalDepth.js +17 -5
- package/dist/components/otp.d.ts +5 -0
- package/dist/components/otp.js +10 -0
- package/dist/components/sidebar.d.ts +7 -1
- package/dist/components/tableSort.d.ts +8 -0
- package/dist/components/tableSort.js +31 -0
- package/dist/composables/useField.d.ts +34 -0
- package/dist/composables/useField.js +45 -0
- package/dist/composables/useFormDraft.d.ts +10 -3
- package/dist/composables/useFormDraft.js +9 -14
- package/dist/composables/useHotkeys.d.ts +17 -1
- package/dist/composables/useHotkeys.js +55 -18
- package/dist/composables/useInputFilter.d.ts +17 -0
- package/dist/composables/useInputFilter.js +47 -10
- package/dist/composables/useLpConfig.d.ts +24 -0
- package/dist/composables/useLpConfig.js +44 -0
- package/dist/composables/useRovingFocus.js +7 -0
- package/dist/composables/useTilt.d.ts +2 -2
- package/dist/composables/useTilt.js +5 -6
- package/dist/composables/useToast.d.ts +20 -0
- package/dist/composables/useToast.js +28 -4
- package/dist/composables/useZoomPan.d.ts +3 -3
- package/dist/composables/useZoomPan.js +4 -4
- package/dist/index.d.ts +33 -3
- package/dist/index.js +185 -139
- package/dist/layout/tree.d.ts +2 -0
- package/dist/layout/tree.js +16 -1
- package/dist/layout/useLayout.d.ts +15 -0
- package/dist/layout/useLayout.js +41 -14
- package/dist/theme/useTheme.d.ts +32 -9
- package/package.json +8 -7
- package/src/component-names.ts +5 -7
- package/src/components/ContextMenuItems.vue +88 -0
- package/src/components/LayoutCanvas.vue +26 -6
- package/src/components/LayoutNode.vue +19 -2
- package/src/components/LpActionBar.vue +30 -7
- package/src/components/LpAddressInput.vue +57 -41
- package/src/components/LpAlert.vue +16 -3
- package/src/components/LpAppShell.vue +45 -12
- package/src/components/LpAutocomplete.vue +46 -10
- package/src/components/LpAvatar.vue +19 -5
- package/src/components/LpBreadcrumbs.vue +65 -41
- package/src/components/LpButton.vue +59 -13
- package/src/components/LpChart.vue +272 -28
- package/src/components/LpCheckbox.vue +7 -3
- package/src/components/LpCodeBlock.vue +50 -14
- package/src/components/LpColorPicker.vue +39 -9
- package/src/components/LpCommandPalette.vue +36 -25
- package/src/components/LpConfirmDialog.vue +68 -17
- package/src/components/LpConfirmHost.vue +59 -0
- package/src/components/LpContextMenu.vue +14 -115
- package/src/components/LpDatePicker.vue +99 -68
- package/src/components/LpDrawer.vue +56 -19
- package/src/components/LpDropzone.vue +21 -4
- package/src/components/LpFileTree.vue +33 -7
- package/src/components/LpFormField.vue +30 -7
- package/src/components/LpImageEditor.vue +96 -57
- package/src/components/LpInput.vue +18 -7
- package/src/components/LpLightbox.vue +140 -29
- package/src/components/LpLink.vue +24 -13
- package/src/components/LpLogViewer.vue +86 -17
- package/src/components/LpMapPicker.vue +36 -13
- package/src/components/LpMediaGallery.vue +8 -2
- package/src/components/LpModal.vue +53 -27
- package/src/components/LpModalNav.vue +5 -2
- package/src/components/LpNotificationBell.vue +63 -17
- package/src/components/LpNumberField.vue +21 -6
- package/src/components/LpNumberFlow.vue +26 -10
- package/src/components/LpOtpInput.vue +43 -8
- package/src/components/LpPagination.vue +23 -7
- package/src/components/LpPasswordInput.vue +4 -1
- package/src/components/LpPhoneInput.vue +53 -27
- package/src/components/LpPie.vue +94 -15
- package/src/components/LpPopover.vue +3 -0
- package/src/components/LpProgress.vue +5 -3
- package/src/components/LpRadioGroup.vue +9 -2
- package/src/components/LpSegmented.vue +12 -2
- package/src/components/LpSelect.vue +0 -0
- package/src/components/LpShortcutsDialog.vue +8 -3
- package/src/components/LpSidebar.vue +14 -9
- package/src/components/LpSidebarNav.vue +17 -5
- package/src/components/LpSkeleton.vue +4 -1
- package/src/components/LpSlider.vue +7 -1
- package/src/components/LpSparkline.vue +11 -3
- package/src/components/LpSwitch.vue +30 -7
- package/src/components/LpTable.vue +91 -32
- package/src/components/LpTableOfContents.vue +50 -32
- package/src/components/LpTabs.vue +23 -6
- package/src/components/LpTextarea.vue +44 -6
- package/src/components/LpThemeProvider.vue +41 -0
- package/src/components/LpThemeSwitcher.vue +64 -17
- package/src/components/LpTilt.vue +2 -2
- package/src/components/LpTimeField.vue +14 -3
- package/src/components/LpToaster.vue +66 -26
- package/src/components/LpTooltip.vue +22 -5
- package/src/components/LpTooltipProvider.vue +24 -0
- package/src/components/LpTopologyCanvas.vue +12 -1
- package/src/components/LpUptimeBar.vue +46 -8
- package/src/components/chart.ts +77 -5
- package/src/components/codeHighlight.ts +111 -15
- package/src/components/color.ts +30 -9
- package/src/components/commandSearch.ts +0 -17
- package/src/components/confirm.ts +58 -0
- package/src/components/countries.ts +12 -0
- package/src/components/fileTree.ts +19 -7
- package/src/components/imageCrop.ts +107 -0
- package/src/components/link.ts +34 -0
- package/src/components/modalDepth.ts +48 -6
- package/src/components/otp.ts +16 -0
- package/src/components/sidebar.ts +7 -1
- package/src/components/tableSort.ts +37 -0
- package/src/composables/useField.ts +79 -0
- package/src/composables/useFormDraft.ts +25 -20
- package/src/composables/useHotkeys.ts +89 -18
- package/src/composables/useInputFilter.ts +77 -14
- package/src/composables/useLpConfig.ts +87 -0
- package/src/composables/useRovingFocus.ts +11 -0
- package/src/composables/useTilt.ts +5 -6
- package/src/composables/useToast.ts +56 -4
- package/src/composables/useZoomPan.ts +6 -6
- package/src/index.ts +38 -3
- package/src/layout/tree.ts +30 -0
- package/src/layout/useLayout.ts +68 -18
- package/src/nuxt.ts +59 -17
- package/src/runtime/config.plugin.ts +14 -0
- package/src/runtime/theme.plugin.ts +42 -22
- package/src/theme/useTheme.ts +206 -100
- package/dist/chunks/LpBreadcrumbs-p4jHe_V-.js +0 -62
- package/dist/chunks/LpContextMenu-CwW1QXe_.js +0 -217
- package/dist/chunks/LpDatePicker-CwOToxGq.js +0 -164
- package/dist/chunks/LpFormField-CazBc2-a.js +0 -62
- package/dist/chunks/LpTextarea-t7F6gv8E.js +0 -47
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { defineComponent, watch, onBeforeUnmount, computed,
|
|
1
|
+
import { defineComponent, ref, watch, onBeforeUnmount, computed, nextTick, openBlock, createBlock, unref, withCtx, createVNode, normalizeStyle, normalizeClass, createTextVNode, toDisplayString, createElementVNode, createElementBlock, createCommentVNode, renderSlot, withModifiers, Fragment, renderList } from "vue";
|
|
2
2
|
import { DialogRoot, DialogPortal, DialogOverlay, DialogContent, DialogTitle, DialogDescription } from "reka-ui";
|
|
3
|
+
import { useLabels } from "../composables/useLpConfig.js";
|
|
3
4
|
import { useZoomPan } from "../composables/useZoomPan.js";
|
|
4
5
|
import { fileNameOf } from "../components/lightbox.js";
|
|
5
6
|
import { _ as _sfc_main$1 } from "./LpIcon-CCnX5_2j.js";
|
|
@@ -14,28 +15,40 @@ const _hoisted_3 = {
|
|
|
14
15
|
class: "px-2 tabular-nums"
|
|
15
16
|
};
|
|
16
17
|
const _hoisted_4 = { class: "ml-auto flex items-center gap-1" };
|
|
17
|
-
const _hoisted_5 = ["
|
|
18
|
-
const _hoisted_6 =
|
|
18
|
+
const _hoisted_5 = ["title"];
|
|
19
|
+
const _hoisted_6 = ["title"];
|
|
20
|
+
const _hoisted_7 = ["title"];
|
|
21
|
+
const _hoisted_8 = ["title"];
|
|
22
|
+
const _hoisted_9 = ["title"];
|
|
23
|
+
const _hoisted_10 = ["title"];
|
|
24
|
+
const _hoisted_11 = ["disabled", "aria-label"];
|
|
25
|
+
const _hoisted_12 = {
|
|
19
26
|
key: 0,
|
|
20
27
|
class: "flex flex-col items-center gap-3 text-white/60"
|
|
21
28
|
};
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
const _hoisted_13 = { class: "text-sm" };
|
|
30
|
+
const _hoisted_14 = {
|
|
31
|
+
key: 1,
|
|
32
|
+
class: "flex flex-col items-center gap-3 text-white/70"
|
|
33
|
+
};
|
|
34
|
+
const _hoisted_15 = { class: "text-sm font-medium" };
|
|
35
|
+
const _hoisted_16 = ["src", "alt"];
|
|
36
|
+
const _hoisted_17 = ["disabled", "aria-label"];
|
|
37
|
+
const _hoisted_18 = { class: "shrink-0 p-3 pt-2 animate-[lightbox-chrome-in_var(--duration-medium)_var(--ease-emphasized)_60ms_both] motion-reduce:animate-none" };
|
|
38
|
+
const _hoisted_19 = {
|
|
26
39
|
key: 0,
|
|
27
40
|
class: "mb-2 text-center"
|
|
28
41
|
};
|
|
29
|
-
const
|
|
42
|
+
const _hoisted_20 = {
|
|
30
43
|
key: 0,
|
|
31
44
|
class: "truncate text-sm font-medium text-white"
|
|
32
45
|
};
|
|
33
|
-
const
|
|
46
|
+
const _hoisted_21 = {
|
|
34
47
|
key: 1,
|
|
35
48
|
class: "truncate text-xs text-white/55"
|
|
36
49
|
};
|
|
37
|
-
const
|
|
38
|
-
const
|
|
50
|
+
const _hoisted_22 = ["data-index", "aria-label", "onClick"];
|
|
51
|
+
const _hoisted_23 = ["src", "alt"];
|
|
39
52
|
const WHEEL_STEP = 60;
|
|
40
53
|
const BTN = "flex size-9 items-center justify-center rounded-control text-white/80 outline-none transition-colors duration-[var(--duration-fast)] hover:bg-white/15 hover:text-white focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-40";
|
|
41
54
|
const ARROW = "absolute top-1/2 z-10 flex size-11 -translate-y-1/2 items-center justify-center rounded-pill bg-black/45 text-white/75 ring-1 ring-white/0 outline-none backdrop-blur-sm transition-[background-color,scale,color,box-shadow] duration-[var(--duration-fast)] ease-[var(--ease-emphasized)] hover:bg-white/20 hover:text-white hover:ring-white/30 hover:scale-110 active:scale-95 focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-0 motion-reduce:transition-none motion-reduce:hover:scale-100 motion-reduce:active:scale-100";
|
|
@@ -50,20 +63,44 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
50
63
|
downloadable: { type: Boolean, default: true },
|
|
51
64
|
copyable: { type: Boolean, default: false },
|
|
52
65
|
loop: { type: Boolean, default: true },
|
|
53
|
-
maxZoom: { default: 8 }
|
|
66
|
+
maxZoom: { default: 8 },
|
|
67
|
+
labels: {}
|
|
54
68
|
},
|
|
55
69
|
emits: ["update:open", "update:index", "change", "download", "copy"],
|
|
56
70
|
setup(__props, { emit: __emit }) {
|
|
57
71
|
const props = __props;
|
|
58
72
|
const emit = __emit;
|
|
59
|
-
const
|
|
73
|
+
const text = useLabels(
|
|
74
|
+
"lightbox",
|
|
75
|
+
{
|
|
76
|
+
viewer: "Image viewer",
|
|
77
|
+
position: "Image {index} of {total}",
|
|
78
|
+
previous: "Previous image",
|
|
79
|
+
next: "Next image",
|
|
80
|
+
zoomIn: "Zoom in (+)",
|
|
81
|
+
zoomOut: "Zoom out (−)",
|
|
82
|
+
rotate: "Rotate (R)",
|
|
83
|
+
copy: "Copy image",
|
|
84
|
+
download: "Download",
|
|
85
|
+
close: "Close (Esc)",
|
|
86
|
+
failed: "This image couldn't be loaded.",
|
|
87
|
+
spoiler: "Spoiler",
|
|
88
|
+
reveal: "Show image"
|
|
89
|
+
},
|
|
90
|
+
() => props.labels
|
|
91
|
+
);
|
|
92
|
+
const position = (i) => text.value.position.replace("{index}", String(i + 1)).replace("{total}", String(props.items.length));
|
|
93
|
+
const contentRef = ref(null);
|
|
94
|
+
const { claim, release, layer } = useModalLayer({ element: () => contentRef.value?.$el });
|
|
60
95
|
watch(() => props.open, (open) => open ? claim() : release(), { immediate: true });
|
|
61
96
|
onBeforeUnmount(release);
|
|
62
|
-
const zoom = useZoomPan({ max: props.maxZoom });
|
|
97
|
+
const zoom = useZoomPan({ max: () => props.maxZoom });
|
|
63
98
|
const scale = computed(() => zoom.scale.value);
|
|
64
99
|
const isZoomed = computed(() => zoom.zoomed.value);
|
|
65
100
|
const isPanning = computed(() => zoom.panning.value);
|
|
66
|
-
const
|
|
101
|
+
const shown = ref(props.index);
|
|
102
|
+
watch(() => props.index, (i) => shown.value = i);
|
|
103
|
+
const current = computed(() => Math.min(Math.max(shown.value, 0), Math.max(props.items.length - 1, 0)));
|
|
67
104
|
const item = computed(() => props.items[current.value]);
|
|
68
105
|
const total = computed(() => props.items.length);
|
|
69
106
|
const showStrip = computed(() => props.filmstrip ?? total.value > 1);
|
|
@@ -79,6 +116,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
79
116
|
const wrapped = props.loop ? (next + total.value) % total.value : Math.min(Math.max(next, 0), total.value - 1);
|
|
80
117
|
if (wrapped === current.value) return;
|
|
81
118
|
direction.value = next > current.value ? 1 : -1;
|
|
119
|
+
shown.value = wrapped;
|
|
82
120
|
emit("update:index", wrapped);
|
|
83
121
|
emit("change", wrapped, props.items[wrapped]);
|
|
84
122
|
}
|
|
@@ -124,6 +162,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
124
162
|
function close() {
|
|
125
163
|
emit("update:open", false);
|
|
126
164
|
}
|
|
165
|
+
const revealed = ref(/* @__PURE__ */ new Set());
|
|
166
|
+
const covered = (i) => !!props.items[i]?.spoiler && !revealed.value.has(i);
|
|
167
|
+
function reveal(i) {
|
|
168
|
+
revealed.value = new Set(revealed.value).add(i);
|
|
169
|
+
}
|
|
170
|
+
watch(
|
|
171
|
+
() => props.open,
|
|
172
|
+
(open) => {
|
|
173
|
+
if (!open) revealed.value = /* @__PURE__ */ new Set();
|
|
174
|
+
}
|
|
175
|
+
);
|
|
127
176
|
function onKeydown(e) {
|
|
128
177
|
switch (e.key) {
|
|
129
178
|
case "ArrowRight":
|
|
@@ -190,18 +239,43 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
190
239
|
if (e.target.closest("[data-lightbox-image]")) return;
|
|
191
240
|
close();
|
|
192
241
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
242
|
+
function sameOrigin(src) {
|
|
243
|
+
try {
|
|
244
|
+
const url = new URL(src, window.location.href);
|
|
245
|
+
return url.protocol === "blob:" || url.protocol === "data:" || url.origin === window.location.origin;
|
|
246
|
+
} catch {
|
|
247
|
+
return false;
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
function save(href, name, newTab = false) {
|
|
197
251
|
const a = document.createElement("a");
|
|
198
|
-
a.href =
|
|
199
|
-
|
|
200
|
-
|
|
252
|
+
a.href = href;
|
|
253
|
+
if (newTab) {
|
|
254
|
+
a.target = "_blank";
|
|
255
|
+
a.rel = "noopener";
|
|
256
|
+
} else {
|
|
257
|
+
a.download = name;
|
|
258
|
+
}
|
|
201
259
|
document.body.appendChild(a);
|
|
202
260
|
a.click();
|
|
203
261
|
a.remove();
|
|
204
262
|
}
|
|
263
|
+
async function download() {
|
|
264
|
+
const target = item.value;
|
|
265
|
+
if (!target) return;
|
|
266
|
+
emit("download", target);
|
|
267
|
+
const name = fileNameOf(target);
|
|
268
|
+
if (sameOrigin(target.src)) return save(target.src, name);
|
|
269
|
+
try {
|
|
270
|
+
const response = await fetch(target.src, { mode: "cors" });
|
|
271
|
+
if (!response.ok) throw new Error(String(response.status));
|
|
272
|
+
const url = URL.createObjectURL(await response.blob());
|
|
273
|
+
save(url, name);
|
|
274
|
+
window.setTimeout(() => URL.revokeObjectURL(url), 0);
|
|
275
|
+
} catch {
|
|
276
|
+
save(target.src, name, true);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
205
279
|
async function copy() {
|
|
206
280
|
const target = item.value;
|
|
207
281
|
if (!target) return;
|
|
@@ -233,7 +307,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
233
307
|
return (_ctx, _cache) => {
|
|
234
308
|
return openBlock(), createBlock(unref(DialogRoot), {
|
|
235
309
|
open: __props.open,
|
|
236
|
-
"onUpdate:open": _cache[
|
|
310
|
+
"onUpdate:open": _cache[9] || (_cache[9] = (v) => emit("update:open", v))
|
|
237
311
|
}, {
|
|
238
312
|
default: withCtx(() => [
|
|
239
313
|
createVNode(unref(DialogPortal), null, {
|
|
@@ -243,6 +317,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
243
317
|
style: normalizeStyle({ zIndex: unref(layer).scrim })
|
|
244
318
|
}, null, 8, ["class", "style"]),
|
|
245
319
|
createVNode(unref(DialogContent), {
|
|
320
|
+
ref_key: "contentRef",
|
|
321
|
+
ref: contentRef,
|
|
246
322
|
class: "fixed inset-0 flex flex-col outline-none data-[state=open]:animate-[lightbox-in_var(--duration-medium)_var(--ease-emphasized)] data-[state=closed]:animate-[lightbox-out_140ms_cubic-bezier(0.4,0,1,1)] motion-reduce:animate-none",
|
|
247
323
|
style: normalizeStyle({ zIndex: unref(layer).panel }),
|
|
248
324
|
onKeydown
|
|
@@ -250,13 +326,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
250
326
|
default: withCtx(() => [
|
|
251
327
|
createVNode(unref(DialogTitle), { class: "sr-only" }, {
|
|
252
328
|
default: withCtx(() => [
|
|
253
|
-
createTextVNode(toDisplayString(item.value?.title ??
|
|
329
|
+
createTextVNode(toDisplayString(item.value?.title ?? unref(text).viewer), 1)
|
|
254
330
|
]),
|
|
255
331
|
_: 1
|
|
256
332
|
}),
|
|
257
333
|
createVNode(unref(DialogDescription), { class: "sr-only" }, {
|
|
258
334
|
default: withCtx(() => [
|
|
259
|
-
createTextVNode(toDisplayString(item.value?.description ??
|
|
335
|
+
createTextVNode(toDisplayString(item.value?.description ?? position(current.value)), 1)
|
|
260
336
|
]),
|
|
261
337
|
_: 1
|
|
262
338
|
}),
|
|
@@ -271,72 +347,72 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
271
347
|
createElementVNode("button", {
|
|
272
348
|
class: normalizeClass(BTN),
|
|
273
349
|
type: "button",
|
|
274
|
-
title:
|
|
350
|
+
title: unref(text).zoomOut,
|
|
275
351
|
onClick: _cache[0] || (_cache[0] = ($event) => unref(zoom).zoomBy(1 / 1.3))
|
|
276
352
|
}, [
|
|
277
353
|
createVNode(_sfc_main$1, {
|
|
278
354
|
name: "lucide:zoom-out",
|
|
279
355
|
size: 18
|
|
280
356
|
})
|
|
281
|
-
]),
|
|
357
|
+
], 8, _hoisted_5),
|
|
282
358
|
createElementVNode("button", {
|
|
283
359
|
class: normalizeClass(BTN),
|
|
284
360
|
type: "button",
|
|
285
|
-
title:
|
|
361
|
+
title: unref(text).zoomIn,
|
|
286
362
|
onClick: _cache[1] || (_cache[1] = ($event) => unref(zoom).zoomBy(1.3))
|
|
287
363
|
}, [
|
|
288
364
|
createVNode(_sfc_main$1, {
|
|
289
365
|
name: "lucide:zoom-in",
|
|
290
366
|
size: 18
|
|
291
367
|
})
|
|
292
|
-
]),
|
|
368
|
+
], 8, _hoisted_6),
|
|
293
369
|
__props.rotatable ? (openBlock(), createElementBlock("button", {
|
|
294
370
|
key: 0,
|
|
295
371
|
class: normalizeClass(BTN),
|
|
296
372
|
type: "button",
|
|
297
|
-
title:
|
|
373
|
+
title: unref(text).rotate,
|
|
298
374
|
onClick: rotate
|
|
299
375
|
}, [
|
|
300
376
|
createVNode(_sfc_main$1, {
|
|
301
377
|
name: "lucide:rotate-cw",
|
|
302
378
|
size: 18
|
|
303
379
|
})
|
|
304
|
-
])) : createCommentVNode("", true),
|
|
380
|
+
], 8, _hoisted_7)) : createCommentVNode("", true),
|
|
305
381
|
__props.copyable ? (openBlock(), createElementBlock("button", {
|
|
306
382
|
key: 1,
|
|
307
383
|
class: normalizeClass(BTN),
|
|
308
384
|
type: "button",
|
|
309
|
-
title:
|
|
385
|
+
title: unref(text).copy,
|
|
310
386
|
onClick: copy
|
|
311
387
|
}, [
|
|
312
388
|
createVNode(_sfc_main$1, {
|
|
313
389
|
name: "lucide:copy",
|
|
314
390
|
size: 18
|
|
315
391
|
})
|
|
316
|
-
])) : createCommentVNode("", true),
|
|
392
|
+
], 8, _hoisted_8)) : createCommentVNode("", true),
|
|
317
393
|
__props.downloadable ? (openBlock(), createElementBlock("button", {
|
|
318
394
|
key: 2,
|
|
319
395
|
class: normalizeClass(BTN),
|
|
320
396
|
type: "button",
|
|
321
|
-
title:
|
|
397
|
+
title: unref(text).download,
|
|
322
398
|
onClick: download
|
|
323
399
|
}, [
|
|
324
400
|
createVNode(_sfc_main$1, {
|
|
325
401
|
name: "lucide:download",
|
|
326
402
|
size: 18
|
|
327
403
|
})
|
|
328
|
-
])) : createCommentVNode("", true),
|
|
404
|
+
], 8, _hoisted_9)) : createCommentVNode("", true),
|
|
329
405
|
createElementVNode("button", {
|
|
330
406
|
class: normalizeClass(BTN),
|
|
331
407
|
type: "button",
|
|
332
|
-
title:
|
|
408
|
+
title: unref(text).close,
|
|
333
409
|
onClick: close
|
|
334
410
|
}, [
|
|
335
411
|
createVNode(_sfc_main$1, {
|
|
336
412
|
name: "lucide:x",
|
|
337
413
|
size: 20
|
|
338
414
|
})
|
|
339
|
-
])
|
|
415
|
+
], 8, _hoisted_10)
|
|
340
416
|
])
|
|
341
417
|
]),
|
|
342
418
|
createElementVNode("div", {
|
|
@@ -345,10 +421,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
345
421
|
class: normalizeClass(["relative flex min-h-0 flex-1 items-center justify-center overflow-hidden", isPanning.value ? "cursor-grabbing" : isZoomed.value ? "cursor-grab" : ""]),
|
|
346
422
|
onWheel: onStageWheel,
|
|
347
423
|
onPointerdown: onPointerDown,
|
|
348
|
-
onPointermove: _cache[
|
|
424
|
+
onPointermove: _cache[7] || (_cache[7] = //@ts-ignore
|
|
349
425
|
(...args) => unref(zoom).onPointerMove && unref(zoom).onPointerMove(...args)),
|
|
350
426
|
onPointerup: onPointerUp,
|
|
351
|
-
onPointercancel: _cache[
|
|
427
|
+
onPointercancel: _cache[8] || (_cache[8] = //@ts-ignore
|
|
352
428
|
(...args) => unref(zoom).onPointerUp && unref(zoom).onPointerUp(...args)),
|
|
353
429
|
onDblclick: onDoubleClick,
|
|
354
430
|
onClick: onViewportClick
|
|
@@ -357,33 +433,44 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
357
433
|
class: normalizeClass([ARROW, "left-4"]),
|
|
358
434
|
type: "button",
|
|
359
435
|
disabled: !canPrev.value,
|
|
360
|
-
"aria-label":
|
|
436
|
+
"aria-label": unref(text).previous,
|
|
361
437
|
onClick: _cache[2] || (_cache[2] = withModifiers(($event) => go(current.value - 1), ["stop"]))
|
|
362
438
|
}, [
|
|
363
439
|
createVNode(_sfc_main$1, {
|
|
364
440
|
name: "lucide:chevron-left",
|
|
365
441
|
size: 24
|
|
366
442
|
})
|
|
367
|
-
], 10,
|
|
368
|
-
failed.value ? (openBlock(), createElementBlock("div",
|
|
443
|
+
], 10, _hoisted_11),
|
|
444
|
+
failed.value ? (openBlock(), createElementBlock("div", _hoisted_12, [
|
|
369
445
|
createVNode(_sfc_main$1, {
|
|
370
446
|
name: "lucide:image-off",
|
|
371
447
|
size: 40
|
|
372
448
|
}),
|
|
373
|
-
|
|
449
|
+
createElementVNode("p", _hoisted_13, toDisplayString(unref(text).failed), 1)
|
|
450
|
+
])) : item.value && covered(current.value) ? (openBlock(), createElementBlock("div", _hoisted_14, [
|
|
451
|
+
createVNode(_sfc_main$1, {
|
|
452
|
+
name: "lucide:eye-off",
|
|
453
|
+
size: 36
|
|
454
|
+
}),
|
|
455
|
+
createElementVNode("p", _hoisted_15, toDisplayString(unref(text).spoiler), 1),
|
|
456
|
+
createElementVNode("button", {
|
|
457
|
+
type: "button",
|
|
458
|
+
class: "rounded-control bg-white/15 px-3 py-1.5 text-sm text-white outline-none transition-colors hover:bg-white/25 focus-visible:ring-2 focus-visible:ring-ring",
|
|
459
|
+
onClick: _cache[3] || (_cache[3] = withModifiers(($event) => reveal(current.value), ["stop"]))
|
|
460
|
+
}, toDisplayString(unref(text).reveal), 1)
|
|
374
461
|
])) : item.value ? (openBlock(), createElementBlock("img", {
|
|
375
|
-
key: item.value.src
|
|
462
|
+
key: `${current.value}:${item.value.src}`,
|
|
376
463
|
"data-lightbox-image": "",
|
|
377
464
|
src: item.value.src,
|
|
378
465
|
alt: item.value.title ?? "",
|
|
379
466
|
class: "max-h-full max-w-full select-none object-contain transition-transform duration-[var(--duration-medium)] ease-[var(--ease-emphasized)] animate-[lightbox-frame-in_var(--duration-medium)_var(--ease-emphasized)] motion-reduce:animate-none motion-reduce:transition-none",
|
|
380
467
|
style: normalizeStyle(imageStyle.value),
|
|
381
468
|
draggable: "false",
|
|
382
|
-
onLoad: _cache[
|
|
383
|
-
onError: _cache[
|
|
384
|
-
}, null, 44,
|
|
385
|
-
loading.value && !failed.value ? (openBlock(), createBlock(_sfc_main$1, {
|
|
386
|
-
key:
|
|
469
|
+
onLoad: _cache[4] || (_cache[4] = ($event) => loading.value = false),
|
|
470
|
+
onError: _cache[5] || (_cache[5] = ($event) => (failed.value = true, loading.value = false))
|
|
471
|
+
}, null, 44, _hoisted_16)) : createCommentVNode("", true),
|
|
472
|
+
loading.value && !failed.value && !covered(current.value) ? (openBlock(), createBlock(_sfc_main$1, {
|
|
473
|
+
key: 3,
|
|
387
474
|
name: "lucide:loader-circle",
|
|
388
475
|
size: 28,
|
|
389
476
|
class: "absolute animate-spin text-white/50"
|
|
@@ -392,24 +479,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
392
479
|
class: normalizeClass([ARROW, "right-4"]),
|
|
393
480
|
type: "button",
|
|
394
481
|
disabled: !canNext.value,
|
|
395
|
-
"aria-label":
|
|
396
|
-
onClick: _cache[
|
|
482
|
+
"aria-label": unref(text).next,
|
|
483
|
+
onClick: _cache[6] || (_cache[6] = withModifiers(($event) => go(current.value + 1), ["stop"]))
|
|
397
484
|
}, [
|
|
398
485
|
createVNode(_sfc_main$1, {
|
|
399
486
|
name: "lucide:chevron-right",
|
|
400
487
|
size: 24
|
|
401
488
|
})
|
|
402
|
-
], 10,
|
|
489
|
+
], 10, _hoisted_17)
|
|
403
490
|
], 34),
|
|
404
|
-
createElementVNode("div",
|
|
491
|
+
createElementVNode("div", _hoisted_18, [
|
|
405
492
|
renderSlot(_ctx.$slots, "caption", {
|
|
406
493
|
item: item.value,
|
|
407
494
|
index: current.value,
|
|
408
495
|
total: total.value
|
|
409
496
|
}, () => [
|
|
410
|
-
item.value?.title || item.value?.description ? (openBlock(), createElementBlock("div",
|
|
411
|
-
item.value.title ? (openBlock(), createElementBlock("p",
|
|
412
|
-
item.value.description ? (openBlock(), createElementBlock("p",
|
|
497
|
+
item.value?.title || item.value?.description ? (openBlock(), createElementBlock("div", _hoisted_19, [
|
|
498
|
+
item.value.title ? (openBlock(), createElementBlock("p", _hoisted_20, toDisplayString(item.value.title), 1)) : createCommentVNode("", true),
|
|
499
|
+
item.value.description ? (openBlock(), createElementBlock("p", _hoisted_21, toDisplayString(item.value.description), 1)) : createCommentVNode("", true)
|
|
413
500
|
])) : createCommentVNode("", true)
|
|
414
501
|
]),
|
|
415
502
|
showStrip.value && total.value > 1 ? (openBlock(), createElementBlock("div", {
|
|
@@ -425,16 +512,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
425
512
|
type: "button",
|
|
426
513
|
style: normalizeStyle({ "--thumb-delay": `${Math.min(i * 30, 240)}ms` }),
|
|
427
514
|
class: normalizeClass(["size-14 shrink-0 overflow-hidden rounded-control outline-none ring-2 transition-[opacity,box-shadow,scale] duration-[var(--duration-fast)] hover:scale-105 focus-visible:ring-ring animate-[lightbox-chrome-in_var(--duration-medium)_var(--ease-emphasized)_both] [animation-delay:var(--thumb-delay)] motion-reduce:animate-none", i === current.value ? "opacity-100 ring-brand" : "opacity-45 ring-transparent hover:opacity-80"]),
|
|
428
|
-
"aria-label": entry.title ??
|
|
515
|
+
"aria-label": entry.title ?? position(i),
|
|
429
516
|
onClick: ($event) => go(i)
|
|
430
517
|
}, [
|
|
431
518
|
createElementVNode("img", {
|
|
432
519
|
src: entry.thumb ?? entry.src,
|
|
433
520
|
alt: entry.title ?? "",
|
|
434
|
-
class: "size-full object-cover",
|
|
521
|
+
class: normalizeClass(["size-full object-cover", covered(i) ? "scale-110 blur-md" : ""]),
|
|
435
522
|
draggable: "false"
|
|
436
|
-
}, null,
|
|
437
|
-
], 14,
|
|
523
|
+
}, null, 10, _hoisted_23)
|
|
524
|
+
], 14, _hoisted_22);
|
|
438
525
|
}), 128))
|
|
439
526
|
], 512)) : createCommentVNode("", true)
|
|
440
527
|
])
|
|
@@ -1,21 +1,31 @@
|
|
|
1
1
|
import { defineComponent, computed, openBlock, createBlock, resolveDynamicComponent, mergeProps, unref, withCtx, renderSlot } from "vue";
|
|
2
|
+
import { useLinkComponent } from "../composables/useLpConfig.js";
|
|
2
3
|
import { useMergedAttrs } from "../composables/useMergedClass.js";
|
|
4
|
+
import { resolveLink } from "../components/link.js";
|
|
3
5
|
const __default__ = { inheritAttrs: false };
|
|
4
6
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
7
|
...__default__,
|
|
6
8
|
__name: "LpLink",
|
|
7
9
|
props: {
|
|
8
10
|
href: {},
|
|
11
|
+
to: {},
|
|
9
12
|
external: { type: Boolean },
|
|
10
13
|
muted: { type: Boolean },
|
|
11
14
|
tone: {},
|
|
12
|
-
as: {
|
|
15
|
+
as: {},
|
|
13
16
|
variant: { default: "default" },
|
|
14
17
|
revealOn: { default: "self" }
|
|
15
18
|
},
|
|
16
19
|
setup(__props) {
|
|
17
20
|
const props = __props;
|
|
18
|
-
const
|
|
21
|
+
const linkComponent = useLinkComponent();
|
|
22
|
+
const resolved = computed(() => {
|
|
23
|
+
if (props.as) {
|
|
24
|
+
return props.as === "a" ? { is: "a", props: { href: props.href } } : { is: props.as, props: props.to != null ? { to: props.to } : { href: props.href } };
|
|
25
|
+
}
|
|
26
|
+
const component = props.external ? "a" : linkComponent.value;
|
|
27
|
+
return resolveLink(component, { to: props.to, href: props.href }) ?? { is: "a", props: {} };
|
|
28
|
+
});
|
|
19
29
|
const rel = computed(() => props.external ? "noopener noreferrer" : void 0);
|
|
20
30
|
const target = computed(() => props.external ? "_blank" : void 0);
|
|
21
31
|
const colorClass = computed(() => {
|
|
@@ -47,17 +57,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
47
57
|
].join(" ")
|
|
48
58
|
);
|
|
49
59
|
return (_ctx, _cache) => {
|
|
50
|
-
return openBlock(), createBlock(resolveDynamicComponent(
|
|
51
|
-
href: isAnchor.value ? __props.href : void 0,
|
|
60
|
+
return openBlock(), createBlock(resolveDynamicComponent(resolved.value.is), mergeProps({ ...resolved.value.props, ...unref(rest) }, {
|
|
52
61
|
target: target.value,
|
|
53
62
|
rel: rel.value,
|
|
54
63
|
class: unref(rootClass)
|
|
55
|
-
}
|
|
64
|
+
}), {
|
|
56
65
|
default: withCtx(() => [
|
|
57
66
|
renderSlot(_ctx.$slots, "default")
|
|
58
67
|
]),
|
|
59
68
|
_: 3
|
|
60
|
-
}, 16, ["
|
|
69
|
+
}, 16, ["target", "rel", "class"]);
|
|
61
70
|
};
|
|
62
71
|
}
|
|
63
72
|
});
|