@nextcloud/vue 9.0.0-rc.4 → 9.0.0-rc.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +138 -24
- package/README.md +1 -1
- package/dist/assets/{NcActionButtonGroup-BND4GQdv.css → NcActionButtonGroup-BLIEEeG3.css} +1 -1
- package/dist/assets/NcActionInput-BrCsR1ZO.css +221 -0
- package/dist/assets/{NcActionTextEditable-BbOijUsB.css → NcActionTextEditable-vhpb77-W.css} +4 -9
- package/dist/assets/{NcActions-DfCOtp0b.css → NcActions-CG3xO48Y.css} +13 -13
- package/dist/assets/{NcAppContent-RmHDNYBp.css → NcAppContent-vj2DL4Yr.css} +4 -4
- package/dist/assets/{NcAppNavigation-C6-8ErA_.css → NcAppNavigation-Dx5I2eEV.css} +38 -12
- package/dist/assets/{NcAppNavigationItem-B-slGJHZ.css → NcAppNavigationItem-D0G4tdGd.css} +37 -37
- package/dist/assets/{NcAppNavigationNewItem-CYsA6ZGQ.css → NcAppNavigationNewItem-CCu1yQxq.css} +2 -2
- package/dist/assets/{NcAppNavigationSearch-BAzhDRd7.css → NcAppNavigationSearch-C1BuilVS.css} +5 -8
- package/dist/assets/{NcAppSettingsDialog-DfBJYMdm.css → NcAppSettingsDialog-705Crvh8.css} +11 -11
- package/dist/assets/{NcAppSidebar-BeRME1Bx.css → NcAppSidebar-CZ-bJUxG.css} +61 -77
- package/dist/assets/NcAvatar-DETOZR8d.css +134 -0
- package/dist/assets/{NcBreadcrumb-CV3DgRKn.css → NcBreadcrumb-Dll7O4N9.css} +15 -15
- package/dist/assets/{NcButton-Cpw_vPKw.css → NcButton-BWD8LdCm.css} +74 -70
- package/dist/assets/{NcCheckboxRadioSwitch-DKVMIvxJ.css → NcCheckboxRadioSwitch-Cbnc4p0H.css} +35 -35
- package/dist/assets/{NcChip-rGBYOr-Q.css → NcChip-1ZmWY_6e.css} +9 -9
- package/dist/assets/{NcCollectionList-DVlSPO13.css → NcCollectionList-C7_FPg95.css} +42 -42
- package/dist/assets/{NcColorPicker-DgByWqzp.css → NcColorPicker-RX6YpqSU.css} +31 -31
- package/dist/assets/{NcContent-1ivDf2e_.css → NcContent-voMuob0w.css} +13 -10
- package/dist/assets/{NcCounterBubble-DpKQwKTI.css → NcCounterBubble-C0CtLaMW.css} +8 -8
- package/dist/assets/{NcDashboardWidget-BEYk4O95.css → NcDashboardWidget-CTP_ajin.css} +13 -13
- package/dist/assets/{NcDashboardWidgetItem-V_jSEH-7.css → NcDashboardWidgetItem-DYwI3Qof.css} +13 -13
- package/dist/assets/{NcDateTimePicker-_rRYVngX.css → NcDateTimePicker-D76SV5EC.css} +236 -233
- package/dist/assets/NcDateTimePickerNative-B7hWPWho.css +60 -0
- package/dist/assets/{NcDialog-Ch6FuMQo.css → NcDialog-DVe1SvHJ.css} +16 -16
- package/dist/assets/{NcEmojiPicker-vTc7_EDA.css → NcEmojiPicker-CeVpBSVx.css} +5 -5
- package/dist/assets/{NcGuestContent-BZ26iXQi.css → NcGuestContent-j8ai4O1K.css} +3 -3
- package/dist/assets/{NcHeaderButton-Ct8k0yDh.css → NcHeaderButton-BZeIVAHI.css} +11 -7
- package/dist/assets/{NcHeaderMenu-BAKwNTFx.css → NcHeaderMenu-U_duiDuh.css} +16 -13
- package/dist/assets/{NcInputConfirmCancel-9YyvRYjw.css → NcInputConfirmCancel-DNNS3DDJ.css} +5 -5
- package/dist/assets/{NcInputField-CvP4PFAO.css → NcInputField-Xm6zpzck.css} +47 -42
- package/dist/assets/{NcListItem-BBaZDZQK.css → NcListItem-CAWaHeb2.css} +41 -50
- package/dist/assets/{NcLoadingIcon-DlDKflKI.css → NcLoadingIcon-B-JbyXuV.css} +5 -2
- package/dist/assets/{NcModal-BMVfhs7c.css → NcModal-x_u5Tqtc.css} +62 -62
- package/dist/assets/{NcNoteCard-DlW6RBOO.css → NcNoteCard-DGpRZQtS.css} +18 -18
- package/dist/assets/{NcPasswordField-D7XrnwDs.css → NcPasswordField-Ck5YCufb.css} +2 -2
- package/dist/assets/{NcPopover-zFjgXDlM.css → NcPopover-BzkXE_af.css} +2 -2
- package/dist/assets/{NcProgressBar--z-WqmX4.css → NcProgressBar-BZzxurHX.css} +16 -15
- package/dist/assets/{NcRelatedResourcesPanel-BQkQvMMD.css → NcRelatedResourcesPanel-9I4RRIks.css} +26 -26
- package/dist/assets/{NcRichContenteditable-1zTxLjsG.css → NcRichContenteditable-DLvvIjC_.css} +33 -33
- package/dist/assets/{NcRichText-cO2UCM_o.css → NcRichText-Fp8zf8zq.css} +87 -87
- package/dist/assets/{NcSelect-BCBpQnFL.css → NcSelect-DjCC5X0A.css} +2 -2
- package/dist/assets/NcSelectUsers-Cyr5NLrJ.css +4 -0
- package/dist/assets/{NcSettingsInputText-B-V6Y4MD.css → NcSettingsInputText-B2b1M_wK.css} +5 -5
- package/dist/assets/{NcSettingsSection-DLjgl3j1.css → NcSettingsSection-CxQtVrUq.css} +7 -7
- package/dist/assets/{NcSettingsSelectGroup-DZcNr_Dq.css → NcSettingsSelectGroup-BH0B-4BJ.css} +4 -4
- package/dist/assets/{NcTextArea-DoBYU3IE.css → NcTextArea-IV7f8C-Q.css} +24 -24
- package/dist/assets/{NcUserStatusIcon-CtJLt6AU.css → NcUserStatusIcon-Du6m_1El.css} +7 -7
- package/dist/assets/{referencePickerModal-DIHQ6_wW.css → referencePickerModal-D80hwmre.css} +48 -48
- package/dist/chunks/ArrowRight-DRKHUZMH.mjs.map +1 -1
- package/dist/chunks/ChevronDown-FiGpp0KT.mjs.map +1 -1
- package/dist/chunks/ChevronUp-DPXFp1ss.mjs.map +1 -1
- package/dist/chunks/Close-D6ngJ4t9.mjs.map +1 -1
- package/dist/chunks/{NcActionButton-Bd35_0n4.mjs → NcActionButton-k1JvZ5eE.mjs} +2 -2
- package/dist/chunks/{NcActionButton-Bd35_0n4.mjs.map → NcActionButton-k1JvZ5eE.mjs.map} +1 -1
- package/dist/chunks/{NcActionButtonGroup-BVbWDFaC.mjs → NcActionButtonGroup-WjVxibM-.mjs} +3 -3
- package/dist/chunks/{NcActionButtonGroup-BVbWDFaC.mjs.map → NcActionButtonGroup-WjVxibM-.mjs.map} +1 -1
- package/dist/chunks/NcActionCaption-Fumfjzxj.mjs.map +1 -1
- package/dist/chunks/NcActionCheckbox-DLPDTACR.mjs.map +1 -1
- package/dist/chunks/{NcActionInput-B_f8z2fo.mjs → NcActionInput-Cu77Jgzr.mjs} +13 -15
- package/dist/chunks/NcActionInput-Cu77Jgzr.mjs.map +1 -0
- package/dist/chunks/NcActionLink-BEo7zmXX.mjs.map +1 -1
- package/dist/chunks/NcActionRadio-CPoWB58D.mjs.map +1 -1
- package/dist/chunks/NcActionRouter-ERoQjJKv.mjs.map +1 -1
- package/dist/chunks/NcActionText-16Mj4-P1.mjs.map +1 -1
- package/dist/chunks/{NcActionTextEditable-B4nTAiHu.mjs → NcActionTextEditable-BLkdbR1d.mjs} +3 -3
- package/dist/chunks/{NcActionTextEditable-B4nTAiHu.mjs.map → NcActionTextEditable-BLkdbR1d.mjs.map} +1 -1
- package/dist/chunks/{NcActions-BM3DmGLW.mjs → NcActions-CDD8eIxC.mjs} +53 -10
- package/dist/chunks/NcActions-CDD8eIxC.mjs.map +1 -0
- package/dist/chunks/{NcAppContent-BZZyPqOo.mjs → NcAppContent-BuPSAcBt.mjs} +6 -6
- package/dist/chunks/{NcAppContent-BZZyPqOo.mjs.map → NcAppContent-BuPSAcBt.mjs.map} +1 -1
- package/dist/chunks/NcAppContentDetails.vue_vue_type_script_setup_true_lang-Dnf4r_Ng.mjs.map +1 -1
- package/dist/chunks/NcAppContentList-DnLY_sWw.mjs.map +1 -1
- package/dist/chunks/NcAppNavigation-ByAPTGke.mjs +163 -0
- package/dist/chunks/NcAppNavigation-ByAPTGke.mjs.map +1 -0
- package/dist/chunks/{NcAppNavigationCaption-BrCiN8XK.mjs → NcAppNavigationCaption-SJPzGdtT.mjs} +2 -2
- package/dist/chunks/{NcAppNavigationCaption-BrCiN8XK.mjs.map → NcAppNavigationCaption-SJPzGdtT.mjs.map} +1 -1
- package/dist/chunks/NcAppNavigationIconBullet-B1kc4u65.mjs.map +1 -1
- package/dist/chunks/{NcAppNavigationItem-ClySLuSM.mjs → NcAppNavigationItem-0xVXJPEm.mjs} +14 -11
- package/dist/chunks/NcAppNavigationItem-0xVXJPEm.mjs.map +1 -0
- package/dist/chunks/{NcAppNavigationNew-CMjaAY5A.mjs → NcAppNavigationNew-CjJgIwfl.mjs} +2 -2
- package/dist/chunks/{NcAppNavigationNew-CMjaAY5A.mjs.map → NcAppNavigationNew-CjJgIwfl.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationNewItem-BUgPntuN.mjs → NcAppNavigationNewItem-BCFq6zq8.mjs} +4 -4
- package/dist/chunks/{NcAppNavigationNewItem-BUgPntuN.mjs.map → NcAppNavigationNewItem-BCFq6zq8.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationSearch-DpjlWi9j.mjs → NcAppNavigationSearch-Bnr0rygy.mjs} +7 -8
- package/dist/chunks/NcAppNavigationSearch-Bnr0rygy.mjs.map +1 -0
- package/dist/chunks/{NcAppNavigationSettings-DGATbBqy.mjs → NcAppNavigationSettings-CM0_QsTH.mjs} +6 -6
- package/dist/chunks/NcAppNavigationSettings-CM0_QsTH.mjs.map +1 -0
- package/dist/chunks/NcAppNavigationSpacer-BvkBfuVw.mjs.map +1 -1
- package/dist/chunks/{NcAppSettingsDialog-Dgh5jydA.mjs → NcAppSettingsDialog-DBI8-FZa.mjs} +10 -6
- package/dist/chunks/{NcAppSettingsDialog-Dgh5jydA.mjs.map → NcAppSettingsDialog-DBI8-FZa.mjs.map} +1 -1
- package/dist/chunks/NcAppSettingsSection-CssmXyZ0.mjs.map +1 -1
- package/dist/chunks/{NcAppSidebar-DWRmX_-Y.mjs → NcAppSidebar-CyyFi0n6.mjs} +10 -9
- package/dist/chunks/NcAppSidebar-CyyFi0n6.mjs.map +1 -0
- package/dist/chunks/NcAppSidebarHeader.vue_vue_type_script_setup_true_lang-0j0aFDeK.mjs.map +1 -1
- package/dist/chunks/NcAppSidebarTab-D1RmFRTu.mjs.map +1 -1
- package/dist/chunks/{NcAvatar-PCbT0J_-.mjs → NcAvatar-CnRCSalb.mjs} +27 -38
- package/dist/chunks/NcAvatar-CnRCSalb.mjs.map +1 -0
- package/dist/chunks/NcBlurHash-BiFktE2N.mjs.map +1 -1
- package/dist/chunks/{NcBreadcrumb-D9gRzaYP.mjs → NcBreadcrumb-B97vQkN2.mjs} +20 -21
- package/dist/chunks/NcBreadcrumb-B97vQkN2.mjs.map +1 -0
- package/dist/chunks/{NcBreadcrumbs-DjqDBMn-.mjs → NcBreadcrumbs-CvUgliJa.mjs} +4 -4
- package/dist/chunks/{NcBreadcrumbs-DjqDBMn-.mjs.map → NcBreadcrumbs-CvUgliJa.mjs.map} +1 -1
- package/dist/chunks/{NcButton-yN4vYgXb.mjs → NcButton-BMnvzy1A.mjs} +47 -31
- package/dist/chunks/NcButton-BMnvzy1A.mjs.map +1 -0
- package/dist/chunks/{NcCheckboxRadioSwitch-D9N_BDHh.mjs → NcCheckboxRadioSwitch-Da0F7y0G.mjs} +7 -7
- package/dist/chunks/{NcCheckboxRadioSwitch-D9N_BDHh.mjs.map → NcCheckboxRadioSwitch-Da0F7y0G.mjs.map} +1 -1
- package/dist/chunks/{NcChip-BPresRp1.mjs → NcChip-DuaqxToL.mjs} +7 -7
- package/dist/chunks/{NcChip-BPresRp1.mjs.map → NcChip-DuaqxToL.mjs.map} +1 -1
- package/dist/chunks/{NcCollectionList-BPDCogsB.mjs → NcCollectionList-Cr0T14g-.mjs} +10 -10
- package/dist/chunks/{NcCollectionList-BPDCogsB.mjs.map → NcCollectionList-Cr0T14g-.mjs.map} +1 -1
- package/dist/chunks/{NcColorPicker-BNpZzN-p.mjs → NcColorPicker-D6g3v7Qc.mjs} +36 -24
- package/dist/chunks/NcColorPicker-D6g3v7Qc.mjs.map +1 -0
- package/dist/chunks/{NcContent-CZKDyVcI.mjs → NcContent-DV3z9w_V.mjs} +5 -5
- package/dist/chunks/{NcContent-CZKDyVcI.mjs.map → NcContent-DV3z9w_V.mjs.map} +1 -1
- package/dist/chunks/{NcCounterBubble-PBdqn9Nf.mjs → NcCounterBubble-Bop3e-Tr.mjs} +3 -3
- package/dist/chunks/{NcCounterBubble-PBdqn9Nf.mjs.map → NcCounterBubble-Bop3e-Tr.mjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidget-DhZ5c4oF.mjs → NcDashboardWidget-Wkx_9xKh.mjs} +50 -8
- package/dist/chunks/NcDashboardWidget-Wkx_9xKh.mjs.map +1 -0
- package/dist/chunks/{NcDashboardWidgetItem-pJ-PctjL.mjs → NcDashboardWidgetItem-CMrxp0Lc.mjs} +6 -6
- package/dist/chunks/{NcDashboardWidgetItem-pJ-PctjL.mjs.map → NcDashboardWidgetItem-CMrxp0Lc.mjs.map} +1 -1
- package/dist/chunks/NcDateTime.vue_vue_type_script_setup_true_lang-B0Lci6v0.mjs.map +1 -1
- package/dist/chunks/{NcDateTimePicker-CKOTExmB.mjs → NcDateTimePicker-BarX7J-6.mjs} +33 -25
- package/dist/chunks/NcDateTimePicker-BarX7J-6.mjs.map +1 -0
- package/dist/chunks/{NcDateTimePickerNative-NVYPDSmf.mjs → NcDateTimePickerNative-BOoA1aEf.mjs} +4 -4
- package/dist/chunks/{NcDateTimePickerNative-NVYPDSmf.mjs.map → NcDateTimePickerNative-BOoA1aEf.mjs.map} +1 -1
- package/dist/chunks/{NcDialog-DTbCOARa.mjs → NcDialog-IKWAQK-K.mjs} +10 -15
- package/dist/chunks/NcDialog-IKWAQK-K.mjs.map +1 -0
- package/dist/chunks/{NcDialogButton.vue_vue_type_script_setup_true_lang-DaU1luyJ.mjs → NcDialogButton.vue_vue_type_script_setup_true_lang-BT66zCa4.mjs} +4 -4
- package/dist/chunks/{NcDialogButton.vue_vue_type_script_setup_true_lang-DaU1luyJ.mjs.map → NcDialogButton.vue_vue_type_script_setup_true_lang-BT66zCa4.mjs.map} +1 -1
- package/dist/chunks/NcEllipsisedOption-C8uNDC-j.mjs.map +1 -1
- package/dist/chunks/{NcEmojiPicker-DHXabPDE.mjs → NcEmojiPicker-DL9u7r5m.mjs} +10 -10
- package/dist/chunks/{NcEmojiPicker-DHXabPDE.mjs.map → NcEmojiPicker-DL9u7r5m.mjs.map} +1 -1
- package/dist/chunks/NcEmptyContent-BdOezubv.mjs.map +1 -1
- package/dist/chunks/{NcGuestContent-B_S2nyJ4.mjs → NcGuestContent-CfCh49o0.mjs} +3 -3
- package/dist/chunks/NcGuestContent-CfCh49o0.mjs.map +1 -0
- package/dist/chunks/{NcHeaderButton-BTZ1WNux.mjs → NcHeaderButton-DAxGG1vc.mjs} +4 -4
- package/dist/chunks/{NcHeaderButton-BTZ1WNux.mjs.map → NcHeaderButton-DAxGG1vc.mjs.map} +1 -1
- package/dist/chunks/{NcHeaderMenu-Bf_rW093.mjs → NcHeaderMenu-DcBWHaZv.mjs} +15 -17
- package/dist/chunks/NcHeaderMenu-DcBWHaZv.mjs.map +1 -0
- package/dist/chunks/NcHighlight.vue_vue_type_script_lang-DnWQDM_2.mjs.map +1 -1
- package/dist/chunks/NcIconSvgWrapper-CprKb_SE.mjs.map +1 -1
- package/dist/chunks/{NcInputConfirmCancel-DCUXeKPz.mjs → NcInputConfirmCancel-BG4KRrhr.mjs} +5 -5
- package/dist/chunks/{NcInputConfirmCancel-DCUXeKPz.mjs.map → NcInputConfirmCancel-BG4KRrhr.mjs.map} +1 -1
- package/dist/chunks/{NcInputField-BZWRHkmQ.mjs → NcInputField-Cz1RwzSy.mjs} +10 -11
- package/dist/chunks/NcInputField-Cz1RwzSy.mjs.map +1 -0
- package/dist/chunks/{NcListItem-7BHAmqB0.mjs → NcListItem-CwAOX69Q.mjs} +5 -13
- package/dist/chunks/NcListItem-CwAOX69Q.mjs.map +1 -0
- package/dist/chunks/{NcListItemIcon-gkuv5FT8.mjs → NcListItemIcon-26IdztJ2.mjs} +2 -2
- package/dist/chunks/{NcListItemIcon-gkuv5FT8.mjs.map → NcListItemIcon-26IdztJ2.mjs.map} +1 -1
- package/dist/chunks/{NcLoadingIcon-Dm3kRPrf.mjs → NcLoadingIcon-CiMp51wb.mjs} +3 -3
- package/dist/chunks/{NcLoadingIcon-Dm3kRPrf.mjs.map → NcLoadingIcon-CiMp51wb.mjs.map} +1 -1
- package/dist/chunks/NcMentionBubble.vue_vue_type_style_index_0_scoped_25f4d6e1_lang-aMwzB20D.mjs.map +1 -1
- package/dist/chunks/{NcModal-CX28vCtF.mjs → NcModal-CdXZncEM.mjs} +8 -12
- package/dist/chunks/NcModal-CdXZncEM.mjs.map +1 -0
- package/dist/chunks/{NcNoteCard-oGt6biyJ.mjs → NcNoteCard-C8JB31rn.mjs} +4 -4
- package/dist/chunks/{NcNoteCard-oGt6biyJ.mjs.map → NcNoteCard-C8JB31rn.mjs.map} +1 -1
- package/dist/chunks/{NcPasswordField-w13_Lpyn.mjs → NcPasswordField-BlbWNpfS.mjs} +8 -9
- package/dist/chunks/NcPasswordField-BlbWNpfS.mjs.map +1 -0
- package/dist/chunks/{NcPopover-BUlWWIxc.mjs → NcPopover-Zs7qt_Zd.mjs} +3 -3
- package/dist/chunks/{NcPopover-BUlWWIxc.mjs.map → NcPopover-Zs7qt_Zd.mjs.map} +1 -1
- package/dist/chunks/NcProgressBar-Ds0zTPYX.mjs +94 -0
- package/dist/chunks/NcProgressBar-Ds0zTPYX.mjs.map +1 -0
- package/dist/chunks/{NcRelatedResourcesPanel-CpOgjo9h.mjs → NcRelatedResourcesPanel-DBOgpeIK.mjs} +8 -8
- package/dist/chunks/NcRelatedResourcesPanel-DBOgpeIK.mjs.map +1 -0
- package/dist/chunks/{NcRichContenteditable-J9ILu0dF.mjs → NcRichContenteditable-BmrCeWNL.mjs} +27 -27
- package/dist/chunks/{NcRichContenteditable-J9ILu0dF.mjs.map → NcRichContenteditable-BmrCeWNL.mjs.map} +1 -1
- package/dist/chunks/{NcRichText-DvbC3aUR.mjs → NcRichText-G8kzsdwx.mjs} +301 -267
- package/dist/chunks/NcRichText-G8kzsdwx.mjs.map +1 -0
- package/dist/chunks/{NcSavingIndicatorIcon.vue_vue_type_script_setup_true_lang-DlRBo3QU.mjs → NcSavingIndicatorIcon.vue_vue_type_script_setup_true_lang-jUf1K561.mjs} +2 -2
- package/dist/chunks/{NcSavingIndicatorIcon.vue_vue_type_script_setup_true_lang-DlRBo3QU.mjs.map → NcSavingIndicatorIcon.vue_vue_type_script_setup_true_lang-jUf1K561.mjs.map} +1 -1
- package/dist/chunks/{NcSelect-D6XzjG4n.mjs → NcSelect-C6qHqfAO.mjs} +4 -4
- package/dist/chunks/{NcSelect-D6XzjG4n.mjs.map → NcSelect-C6qHqfAO.mjs.map} +1 -1
- package/dist/chunks/{NcSelectTags-SNTGRj-n.mjs → NcSelectTags-Capp69AW.mjs} +3 -3
- package/dist/chunks/{NcSelectTags-SNTGRj-n.mjs.map → NcSelectTags-Capp69AW.mjs.map} +1 -1
- package/dist/chunks/{NcSelectUsers-D_eu9Uqb.mjs → NcSelectUsers-BVn8co_d.mjs} +5 -5
- package/dist/chunks/{NcSelectUsers-D_eu9Uqb.mjs.map → NcSelectUsers-BVn8co_d.mjs.map} +1 -1
- package/dist/chunks/{NcSettingsInputText-D5N9XxkW.mjs → NcSettingsInputText-C8Gtj3Ht.mjs} +4 -4
- package/dist/chunks/{NcSettingsInputText-D5N9XxkW.mjs.map → NcSettingsInputText-C8Gtj3Ht.mjs.map} +1 -1
- package/dist/chunks/{NcSettingsSection-93UQoiwe.mjs → NcSettingsSection-CtSg7lH8.mjs} +4 -4
- package/dist/chunks/{NcSettingsSection-93UQoiwe.mjs.map → NcSettingsSection-CtSg7lH8.mjs.map} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-Dr4IRbi_.mjs → NcSettingsSelectGroup-C1DEcBNJ.mjs} +5 -5
- package/dist/chunks/{NcSettingsSelectGroup-Dr4IRbi_.mjs.map → NcSettingsSelectGroup-C1DEcBNJ.mjs.map} +1 -1
- package/dist/chunks/{NcTextArea-CWqnvMl2.mjs → NcTextArea-BAl6EP4Z.mjs} +5 -5
- package/dist/chunks/NcTextArea-BAl6EP4Z.mjs.map +1 -0
- package/dist/chunks/{NcTextField.vue_vue_type_script_setup_true_lang-B65hrkLW.mjs → NcTextField.vue_vue_type_script_setup_true_lang-DzcUUWHO.mjs} +6 -7
- package/dist/chunks/NcTextField.vue_vue_type_script_setup_true_lang-DzcUUWHO.mjs.map +1 -0
- package/dist/chunks/NcThemeProvider.vue_vue_type_script_setup_true_lang-nUDJsDGI.mjs.map +1 -1
- package/dist/chunks/{NcTimezonePicker.vue_vue_type_script_setup_true_lang-BoH1Njbp.mjs → NcTimezonePicker.vue_vue_type_script_setup_true_lang-Dsco6qEJ.mjs} +3 -3
- package/dist/chunks/{NcTimezonePicker.vue_vue_type_script_setup_true_lang-BoH1Njbp.mjs.map → NcTimezonePicker.vue_vue_type_script_setup_true_lang-Dsco6qEJ.mjs.map} +1 -1
- package/dist/chunks/{NcUserBubble-BW0qu6mW.mjs → NcUserBubble-CqKN_gM4.mjs} +3 -3
- package/dist/chunks/{NcUserBubble-BW0qu6mW.mjs.map → NcUserBubble-CqKN_gM4.mjs.map} +1 -1
- package/dist/chunks/{NcUserStatusIcon-DqQYA-EE.mjs → NcUserStatusIcon-CDEUKK60.mjs} +10 -9
- package/dist/chunks/NcUserStatusIcon-CDEUKK60.mjs.map +1 -0
- package/dist/chunks/NcVNodes.vue_vue_type_script_lang-BqUHinRZ.mjs.map +1 -1
- package/dist/chunks/_l10n-ZllQPIu_.mjs +113 -0
- package/dist/chunks/_l10n-ZllQPIu_.mjs.map +1 -0
- package/dist/chunks/actionGlobal-BZFdtdJL.mjs.map +1 -1
- package/dist/chunks/actionText-DdSwf9le.mjs.map +1 -1
- package/dist/chunks/{autolink-CKPk5rzg.mjs → autolink-Y0rlJ_CI.mjs} +5 -1
- package/dist/chunks/autolink-Y0rlJ_CI.mjs.map +1 -0
- package/dist/chunks/{colors-BaTbJhvg.mjs → colors-B71CwSnx.mjs} +2 -2
- package/dist/chunks/{colors-BaTbJhvg.mjs.map → colors-B71CwSnx.mjs.map} +1 -1
- package/dist/chunks/constants-Bls5liKo.mjs.map +1 -1
- package/dist/chunks/createElementId-DhjFt1I9.mjs.map +1 -1
- package/dist/chunks/{customPickerElements-CH9vlHLd.mjs → customPickerElements-BmkXSNdO.mjs} +2 -2
- package/dist/chunks/{customPickerElements-CH9vlHLd.mjs.map → customPickerElements-BmkXSNdO.mjs.map} +1 -1
- package/dist/chunks/emoji-BY_D0V5K.mjs.map +1 -1
- package/dist/chunks/{focusTrap-DmkaYJTC.mjs → focusTrap-HJQ4pqHV.mjs} +6 -3
- package/dist/chunks/focusTrap-HJQ4pqHV.mjs.map +1 -0
- package/dist/chunks/logger-D3RVzcfQ.mjs.map +1 -1
- package/dist/chunks/{mdi-D6fu5i4r.mjs → mdi-B9TPxVka.mjs} +14 -6
- package/dist/chunks/{mdi-D6fu5i4r.mjs.map → mdi-B9TPxVka.mjs.map} +1 -1
- package/dist/chunks/{referencePickerModal-DREcDQKg.mjs → referencePickerModal-BtI-8rNN.mjs} +147 -109
- package/dist/chunks/referencePickerModal-BtI-8rNN.mjs.map +1 -0
- package/dist/chunks/rtl-v0UOPAM7.mjs.map +1 -1
- package/dist/chunks/useNcActions-CiGWxAJE.mjs.map +1 -1
- package/dist/chunks/{useTrapStackControl-b3A_383w.mjs → useTrapStackControl-yqM2SDEs.mjs} +2 -2
- package/dist/chunks/{useTrapStackControl-b3A_383w.mjs.map → useTrapStackControl-yqM2SDEs.mjs.map} +1 -1
- package/dist/components/NcActionButton/index.mjs +1 -1
- package/dist/components/NcActionButtonGroup/index.mjs +1 -1
- package/dist/components/NcActionInput/NcActionInput.vue.d.ts +1934 -0
- package/dist/components/NcActionInput/index.mjs +1 -1
- package/dist/components/NcActionTextEditable/index.mjs +1 -1
- package/dist/components/NcActions/NcActions.vue.d.ts +502 -0
- package/dist/components/NcActions/index.mjs +1 -1
- package/dist/components/NcAppContent/index.mjs +1 -1
- package/dist/components/NcAppNavigation/NcAppNavigation.vue.d.ts +59 -57
- package/dist/components/NcAppNavigation/index.d.ts +4 -0
- package/dist/components/NcAppNavigation/index.mjs +1 -1
- package/dist/components/NcAppNavigationCaption/NcAppNavigationCaption.vue.d.ts +347 -0
- package/dist/components/NcAppNavigationCaption/index.mjs +1 -1
- package/dist/components/NcAppNavigationItem/NcAppNavigationIconCollapsible.vue.d.ts +137 -0
- package/dist/components/NcAppNavigationItem/NcAppNavigationItem.vue.d.ts +1227 -0
- package/dist/components/NcAppNavigationItem/NcInputConfirmCancel.vue.d.ts +171 -0
- package/dist/components/NcAppNavigationItem/index.mjs +1 -1
- package/dist/components/NcAppNavigationNew/NcAppNavigationNew.vue.d.ts +171 -0
- package/dist/components/NcAppNavigationNew/index.mjs +1 -1
- package/dist/components/NcAppNavigationNewItem/NcAppNavigationNewItem.vue.d.ts +270 -0
- package/dist/components/NcAppNavigationNewItem/index.mjs +1 -1
- package/dist/components/NcAppNavigationSearch/NcAppNavigationSearch.vue.d.ts +26 -26
- package/dist/components/NcAppNavigationSearch/index.mjs +1 -1
- package/dist/components/NcAppNavigationSettings/index.mjs +1 -1
- package/dist/components/NcAppSettingsDialog/NcAppSettingsDialog.vue.d.ts +348 -0
- package/dist/components/NcAppSettingsDialog/index.mjs +1 -1
- package/dist/components/NcAppSidebar/NcAppSidebar.vue.d.ts +988 -0
- package/dist/components/NcAppSidebar/index.mjs +1 -1
- package/dist/components/NcAvatar/NcAvatar.vue.d.ts +980 -0
- package/dist/components/NcAvatar/index.mjs +1 -1
- package/dist/components/NcBreadcrumb/NcBreadcrumb.vue.d.ts +658 -0
- package/dist/components/NcBreadcrumb/index.mjs +1 -1
- package/dist/components/NcBreadcrumbs/NcBreadcrumbs.vue.d.ts +1255 -0
- package/dist/components/NcBreadcrumbs/index.mjs +1 -1
- package/dist/components/NcButton/NcButton.vue.d.ts +7 -7
- package/dist/components/NcButton/index.mjs +1 -1
- package/dist/components/NcCheckboxRadioSwitch/index.mjs +1 -1
- package/dist/components/NcChip/index.mjs +1 -1
- package/dist/components/NcCollectionList/NcCollectionList.vue.d.ts +2424 -0
- package/dist/components/NcCollectionList/NcCollectionListItem.vue.d.ts +1366 -0
- package/dist/components/NcCollectionList/index.mjs +1 -1
- package/dist/components/NcColorPicker/NcColorPicker.vue.d.ts +5 -2
- package/dist/components/NcColorPicker/index.mjs +1 -1
- package/dist/components/NcContent/index.mjs +1 -1
- package/dist/components/NcCounterBubble/index.mjs +1 -1
- package/dist/components/NcDashboardWidget/NcDashboardWidget.vue.d.ts +2446 -0
- package/dist/components/NcDashboardWidget/index.mjs +1 -1
- package/dist/components/NcDashboardWidgetItem/NcDashboardWidgetItem.vue.d.ts +1486 -0
- package/dist/components/NcDashboardWidgetItem/index.mjs +1 -1
- package/dist/components/NcDateTimePicker/NcDateTimePicker.vue.d.ts +4 -4
- package/dist/components/NcDateTimePicker/index.mjs +1 -1
- package/dist/components/NcDateTimePickerNative/index.mjs +1 -1
- package/dist/components/NcDialog/NcDialog.vue.d.ts +4 -4
- package/dist/components/NcDialog/index.mjs +1 -1
- package/dist/components/NcDialogButton/index.mjs +1 -1
- package/dist/components/NcEllipsisedOption/NcEllipsisedOption.vue.d.ts +95 -0
- package/dist/components/NcEmojiPicker/NcEmojiPicker.vue.d.ts +556 -0
- package/dist/components/NcEmojiPicker/index.mjs +1 -1
- package/dist/components/NcGuestContent/index.mjs +1 -1
- package/dist/components/NcHeaderButton/index.mjs +1 -1
- package/dist/components/NcHeaderMenu/NcHeaderMenu.vue.d.ts +319 -0
- package/dist/components/NcHeaderMenu/index.mjs +1 -1
- package/dist/components/NcHighlight/NcHighlight.vue.d.ts +1 -1
- package/dist/components/NcInputField/NcInputField.vue.d.ts +5 -9
- package/dist/components/NcInputField/index.mjs +1 -1
- package/dist/components/NcListItem/NcListItem.vue.d.ts +646 -0
- package/dist/components/NcListItem/index.mjs +1 -1
- package/dist/components/NcListItemIcon/NcListItemIcon.vue.d.ts +1097 -0
- package/dist/components/NcListItemIcon/index.mjs +1 -1
- package/dist/components/NcLoadingIcon/index.mjs +1 -1
- package/dist/components/NcModal/index.mjs +1 -1
- package/dist/components/NcNoteCard/index.mjs +1 -1
- package/dist/components/NcPasswordField/NcPasswordField.vue.d.ts +14 -14
- package/dist/components/NcPasswordField/index.mjs +1 -1
- package/dist/components/NcPopover/index.mjs +1 -1
- package/dist/components/NcProgressBar/NcProgressBar.vue.d.ts +42 -1
- package/dist/components/NcProgressBar/index.d.ts +4 -0
- package/dist/components/NcProgressBar/index.mjs +1 -1
- package/dist/components/NcRelatedResourcesPanel/NcRelatedResourcesPanel.vue.d.ts +463 -0
- package/dist/components/NcRelatedResourcesPanel/NcResource.vue.d.ts +149 -0
- package/dist/components/NcRelatedResourcesPanel/NcTeamResources.vue.d.ts +175 -0
- package/dist/components/NcRelatedResourcesPanel/index.mjs +1 -1
- package/dist/components/NcRichContenteditable/index.mjs +1 -1
- package/dist/components/NcRichText/NcReferenceList.vue.d.ts +268 -0
- package/dist/components/NcRichText/NcReferencePicker/NcProviderList.vue.d.ts +197 -0
- package/dist/components/NcRichText/NcReferencePicker/NcRawLinkInput.vue.d.ts +447 -0
- package/dist/components/NcRichText/NcReferencePicker/NcReferencePicker.vue.d.ts +1002 -0
- package/dist/components/NcRichText/NcReferencePicker/NcReferencePickerModal.vue.d.ts +1167 -0
- package/dist/components/NcRichText/NcReferencePicker/NcSearch.vue.d.ts +269 -0
- package/dist/components/NcRichText/NcReferencePicker/NcSearchResult.vue.d.ts +69 -0
- package/dist/components/NcRichText/NcReferencePicker/utils.d.ts +6 -7
- package/dist/components/NcRichText/NcReferenceWidget.vue.d.ts +187 -0
- package/dist/components/NcRichText/NcRichText.vue.d.ts +393 -0
- package/dist/components/NcRichText/helpers.d.ts +7 -8
- package/dist/components/NcRichText/index.d.ts +4 -4
- package/dist/components/NcRichText/index.mjs +4 -4
- package/dist/components/NcRichText/remarkPlaceholder.d.ts +2 -0
- package/dist/components/NcRichText/remarkUnescape.d.ts +2 -1
- package/dist/components/NcSavingIndicatorIcon/index.mjs +1 -1
- package/dist/components/NcSelect/NcSelect.vue.d.ts +99 -0
- package/dist/components/NcSelect/index.mjs +1 -1
- package/dist/components/NcSelectTags/NcSelectTags.vue.d.ts +183 -0
- package/dist/components/NcSelectTags/index.mjs +1 -1
- package/dist/components/NcSelectUsers/index.mjs +1 -1
- package/dist/components/NcSettingsInputText/index.mjs +1 -1
- package/dist/components/NcSettingsSection/index.mjs +1 -1
- package/dist/components/NcSettingsSelectGroup/NcSettingsSelectGroup.vue.d.ts +243 -0
- package/dist/components/NcSettingsSelectGroup/index.mjs +1 -1
- package/dist/components/NcTextArea/NcTextArea.vue.d.ts +1 -5
- package/dist/components/NcTextArea/index.mjs +1 -1
- package/dist/components/NcTextField/NcTextField.vue.d.ts +14 -14
- package/dist/components/NcTextField/index.mjs +1 -1
- package/dist/components/NcTimezonePicker/index.mjs +1 -1
- package/dist/components/NcUserBubble/index.mjs +1 -1
- package/dist/components/NcUserStatusIcon/index.mjs +1 -1
- package/dist/components/index.d.ts +2 -2
- package/dist/composables/useFormatDateTime/index.mjs +1 -1
- package/dist/composables/useFormatDateTime/index.mjs.map +1 -1
- package/dist/composables/useHotKey/index.mjs.map +1 -1
- package/dist/composables/useIsDarkTheme/constants.d.ts +1 -1
- package/dist/composables/useIsDarkTheme/index.mjs +1 -1
- package/dist/composables/useIsDarkTheme/index.mjs.map +1 -1
- package/dist/composables/useIsFullscreen/index.mjs.map +1 -1
- package/dist/composables/useIsMobile/index.mjs.map +1 -1
- package/dist/directives/Focus/index.mjs.map +1 -1
- package/dist/directives/Linkify/index.mjs +1 -2
- package/dist/directives/Linkify/index.mjs.map +1 -1
- package/dist/functions/a11y/index.mjs.map +1 -1
- package/dist/functions/contactsMenu/index.mjs.map +1 -1
- package/dist/functions/dialog/index.mjs.map +1 -1
- package/dist/functions/index.d.ts +2 -2
- package/dist/functions/isDarkTheme/index.mjs.map +1 -1
- package/dist/functions/preloadImage/index.mjs.map +1 -1
- package/dist/functions/reference/index.mjs +2 -2
- package/dist/functions/registerReference/index.mjs +1 -1
- package/dist/functions/usernameToColor/index.d.ts +6 -3
- package/dist/functions/usernameToColor/index.mjs +19 -2
- package/dist/functions/usernameToColor/index.mjs.map +1 -1
- package/dist/index.mjs +65 -64
- package/dist/index.mjs.map +1 -1
- package/dist/l10n.d.ts +7 -2
- package/dist/utils/focusTrap.d.ts +6 -0
- package/dist/utils/legacy.d.ts +5 -0
- package/package.json +57 -52
- package/dist/assets/NcActionInput-BA67jS1l.css +0 -226
- package/dist/assets/NcAppNavigationToggle-M0oDbwAS.css +0 -27
- package/dist/assets/NcAvatar-g7MoHyFd.css +0 -132
- package/dist/assets/NcDateTimePickerNative-BizATZfE.css +0 -60
- package/dist/assets/NcSelectUsers-2-PyuY9Z.css +0 -4
- package/dist/chunks/ArrowLeft-BiZLJltw.mjs +0 -49
- package/dist/chunks/ArrowLeft-BiZLJltw.mjs.map +0 -1
- package/dist/chunks/Check-5i4xKnkl.mjs +0 -49
- package/dist/chunks/Check-5i4xKnkl.mjs.map +0 -1
- package/dist/chunks/DotsHorizontal-BJ_GCGpi.mjs +0 -49
- package/dist/chunks/DotsHorizontal-BJ_GCGpi.mjs.map +0 -1
- package/dist/chunks/NcActionInput-B_f8z2fo.mjs.map +0 -1
- package/dist/chunks/NcActions-BM3DmGLW.mjs.map +0 -1
- package/dist/chunks/NcAppNavigation-BmACVQVW.mjs +0 -167
- package/dist/chunks/NcAppNavigation-BmACVQVW.mjs.map +0 -1
- package/dist/chunks/NcAppNavigationItem-ClySLuSM.mjs.map +0 -1
- package/dist/chunks/NcAppNavigationSearch-DpjlWi9j.mjs.map +0 -1
- package/dist/chunks/NcAppNavigationSettings-DGATbBqy.mjs.map +0 -1
- package/dist/chunks/NcAppNavigationToggle-D9pouVyS.mjs +0 -137
- package/dist/chunks/NcAppNavigationToggle-D9pouVyS.mjs.map +0 -1
- package/dist/chunks/NcAppSidebar-DWRmX_-Y.mjs.map +0 -1
- package/dist/chunks/NcAvatar-PCbT0J_-.mjs.map +0 -1
- package/dist/chunks/NcBreadcrumb-D9gRzaYP.mjs.map +0 -1
- package/dist/chunks/NcButton-yN4vYgXb.mjs.map +0 -1
- package/dist/chunks/NcColorPicker-BNpZzN-p.mjs.map +0 -1
- package/dist/chunks/NcDashboardWidget-DhZ5c4oF.mjs.map +0 -1
- package/dist/chunks/NcDateTimePicker-CKOTExmB.mjs.map +0 -1
- package/dist/chunks/NcDialog-DTbCOARa.mjs.map +0 -1
- package/dist/chunks/NcGuestContent-B_S2nyJ4.mjs.map +0 -1
- package/dist/chunks/NcHeaderMenu-Bf_rW093.mjs.map +0 -1
- package/dist/chunks/NcInputField-BZWRHkmQ.mjs.map +0 -1
- package/dist/chunks/NcListItem-7BHAmqB0.mjs.map +0 -1
- package/dist/chunks/NcModal-CX28vCtF.mjs.map +0 -1
- package/dist/chunks/NcPasswordField-w13_Lpyn.mjs.map +0 -1
- package/dist/chunks/NcProgressBar-Bx8bMkd4.mjs +0 -148
- package/dist/chunks/NcProgressBar-Bx8bMkd4.mjs.map +0 -1
- package/dist/chunks/NcRelatedResourcesPanel-CpOgjo9h.mjs.map +0 -1
- package/dist/chunks/NcRichText-DvbC3aUR.mjs.map +0 -1
- package/dist/chunks/NcTextArea-CWqnvMl2.mjs.map +0 -1
- package/dist/chunks/NcTextField.vue_vue_type_script_setup_true_lang-B65hrkLW.mjs.map +0 -1
- package/dist/chunks/NcUserStatusIcon-DqQYA-EE.mjs.map +0 -1
- package/dist/chunks/_l10n-tXci8WM1.mjs +0 -108
- package/dist/chunks/_l10n-tXci8WM1.mjs.map +0 -1
- package/dist/chunks/autolink-CKPk5rzg.mjs.map +0 -1
- package/dist/chunks/focusTrap-DmkaYJTC.mjs.map +0 -1
- package/dist/chunks/referencePickerModal-DREcDQKg.mjs.map +0 -1
- package/dist/chunks/usernameToColor-2yV_Zdvb.mjs +0 -22
- package/dist/chunks/usernameToColor-2yV_Zdvb.mjs.map +0 -1
- package/dist/components/NcAppNavigationToggle/index.d.ts +0 -5
- package/dist/components/NcAppNavigationToggle/index.mjs +0 -5
- package/dist/components/NcAppNavigationToggle/index.mjs.map +0 -1
- package/dist/components/NcRichText/placeholder.d.ts +0 -5
- package/dist/components/NcRichText/remarkDisableBlocks.d.ts +0 -11
- package/dist/functions/usernameToColor/usernameToColor.d.ts +0 -8
- package/dist/vendor.LICENSE.txt +0 -137
- /package/dist/components/{NcAppNavigationToggle → NcAppNavigation}/NcAppNavigationToggle.vue.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/composables/useFormatDateTime/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { FormatDateOptions } from '@nextcloud/l10n'\nimport type { MaybeRefOrGetter, Ref } from 'vue'\n\nimport { formatRelativeTime, getCanonicalLocale } from '@nextcloud/l10n'\nimport { computed, onUnmounted, readonly, ref, toValue, watchEffect } from 'vue'\nimport { t } from '../../l10n.
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/composables/useFormatDateTime/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { FormatDateOptions } from '@nextcloud/l10n'\nimport type { MaybeRefOrGetter, Ref } from 'vue'\n\nimport { formatRelativeTime, getCanonicalLocale } from '@nextcloud/l10n'\nimport { computed, onUnmounted, readonly, ref, toValue, watchEffect } from 'vue'\nimport { t } from '../../l10n.ts'\n\ninterface FormatRelativeTimeOptions extends Partial<Omit<FormatDateOptions, 'ignoreSeconds'>> {\n\tignoreSeconds?: boolean\n\n\t/**\n\t * If set to false the relative time will not be updated anymore.\n\t * @default true - Meaning the relative time will be updated if needed\n\t */\n\tupdate?: boolean\n}\n\ninterface FormatTimeOptions {\n\t/**\n\t * Locale to use for formatting.\n\t * @default current locale\n\t */\n\tlocale?: string\n\n\t/**\n\t * The format used for displaying.\n\t *\n\t * @default { timeStyle: 'medium', dateStyle: 'short' }\n\t */\n\tformat?: Intl.DateTimeFormatOptions\n}\n\nconst FEW_SECONDS_AGO = {\n\tlong: t('a few seconds ago'),\n\tshort: t('seconds ago'), // FOR TRANSLATORS: Shorter version of 'a few seconds ago'\n\tnarrow: t('sec. ago'), // FOR TRANSLATORS: If possible in your language an even shorter version of 'a few seconds ago'\n}\n\n/**\n * Format a timestamp or date object as relative time.\n *\n * This is a composable wrapper around `formatRelativeTime` from `@nextcloud/l10n`.\n *\n * @param timestamp - The timestamp to format\n * @param opts - Formatting options\n */\nexport function useFormatRelativeTime(\n\ttimestamp: MaybeRefOrGetter<Date | number> = Date.now(),\n\topts: MaybeRefOrGetter<FormatRelativeTimeOptions> = {},\n): Readonly<Ref<string>> {\n\tlet timeoutId: number\n\n\t/**\n\t * ECMA Date object of the timestamp\n\t */\n\tconst date = computed(() => new Date(toValue(timestamp)))\n\n\t/**\n\t * Reactive options for `formatRelativeTime` method\n\t */\n\tconst options = computed<FormatDateOptions>(() => {\n\t\tconst { language, relativeTime, ignoreSeconds } = toValue(opts)\n\t\treturn {\n\t\t\t...language && { language },\n\t\t\t...relativeTime && { relativeTime },\n\t\t\tignoreSeconds: ignoreSeconds\n\t\t\t\t? FEW_SECONDS_AGO[relativeTime || 'long']\n\t\t\t\t: false,\n\t\t}\n\t})\n\n\t/**\n\t * The formatted relative time\n\t */\n\tconst relativeTime = ref('')\n\twatchEffect(() => updateRelativeTime())\n\n\t/**\n\t * Update the relative time string.\n\t * This is the callback for the interval.\n\t */\n\tfunction updateRelativeTime() {\n\t\trelativeTime.value = formatRelativeTime(date.value, options.value)\n\n\t\tif (toValue(opts).update !== false) {\n\t\t\tconst diff = Math.abs(Date.now() - new Date(toValue(timestamp)).getTime())\n\t\t\tconst interval = diff > 120000 || options.value.ignoreSeconds\n\t\t\t\t? Math.min(diff / 60, 1800000)\n\t\t\t\t: 1000\n\t\t\ttimeoutId = window.setTimeout(updateRelativeTime, interval)\n\t\t}\n\t}\n\n\t// when the component is unmounted we also clear the timeout\n\tonUnmounted(() => timeoutId && window.clearTimeout(timeoutId))\n\n\treturn readonly(relativeTime)\n}\n\n/**\n * Format a given timestamp or date object as a human readable string.\n *\n * @param timestamp - Timestamp or date object to format\n * @param opts - Formatting options\n */\nexport function useFormatTime(\n\ttimestamp: MaybeRefOrGetter<number | Date>,\n\topts: MaybeRefOrGetter<FormatTimeOptions>,\n): Readonly<Ref<string>> {\n\tconst options = computed<Required<FormatTimeOptions>>(() => ({\n\t\tlocale: getCanonicalLocale(),\n\t\tformat: { dateStyle: 'short', timeStyle: 'medium' },\n\t\t...toValue(opts),\n\t}))\n\n\tconst formatter = computed(() => new Intl.DateTimeFormat(options.value.locale, options.value.format))\n\n\treturn computed(() => formatter.value.format(toValue(timestamp)))\n}\n"],"names":["relativeTime"],"mappings":";;;;AAqCA,MAAM,kBAAkB;AAAA,EACvB,MAAM,EAAE,mBAAmB;AAAA,EAC3B,OAAO,EAAE,aAAa;AAAA;AAAA,EACtB,QAAQ,EAAE,UAAU;AAAA;AACrB;AAUO,SAAS,sBACf,YAA6C,KAAK,OAClD,OAAoD,CAAA,GAC5B;AACxB,MAAI;AAKJ,QAAM,OAAO,SAAS,MAAM,IAAI,KAAK,QAAQ,SAAS,CAAC,CAAC;AAKxD,QAAM,UAAU,SAA4B,MAAM;AACjD,UAAM,EAAE,UAAU,cAAAA,eAAc,cAAA,IAAkB,QAAQ,IAAI;AAC9D,WAAO;AAAA,MACN,GAAG,YAAY,EAAE,SAAA;AAAA,MACjB,GAAGA,iBAAgB,EAAE,cAAAA,cAAAA;AAAAA,MACrB,eAAe,gBACZ,gBAAgBA,iBAAgB,MAAM,IACtC;AAAA,IAAA;AAAA,EAEL,CAAC;AAKD,QAAM,eAAe,IAAI,EAAE;AAC3B,cAAY,MAAM,oBAAoB;AAMtC,WAAS,qBAAqB;AAC7B,iBAAa,QAAQ,mBAAmB,KAAK,OAAO,QAAQ,KAAK;AAEjE,QAAI,QAAQ,IAAI,EAAE,WAAW,OAAO;AACnC,YAAM,OAAO,KAAK,IAAI,KAAK,IAAA,IAAQ,IAAI,KAAK,QAAQ,SAAS,CAAC,EAAE,SAAS;AACzE,YAAM,WAAW,OAAO,QAAU,QAAQ,MAAM,gBAC7C,KAAK,IAAI,OAAO,IAAI,IAAO,IAC3B;AACH,kBAAY,OAAO,WAAW,oBAAoB,QAAQ;AAAA,IAC3D;AAAA,EACD;AAGA,cAAY,MAAM,aAAa,OAAO,aAAa,SAAS,CAAC;AAE7D,SAAO,SAAS,YAAY;AAC7B;AAQO,SAAS,cACf,WACA,MACwB;AACxB,QAAM,UAAU,SAAsC,OAAO;AAAA,IAC5D,QAAQ,mBAAA;AAAA,IACR,QAAQ,EAAE,WAAW,SAAS,WAAW,SAAA;AAAA,IACzC,GAAG,QAAQ,IAAI;AAAA,EAAA,EACd;AAEF,QAAM,YAAY,SAAS,MAAM,IAAI,KAAK,eAAe,QAAQ,MAAM,QAAQ,QAAQ,MAAM,MAAM,CAAC;AAEpG,SAAO,SAAS,MAAM,UAAU,MAAM,OAAO,QAAQ,SAAS,CAAC,CAAC;AACjE;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/composables/useHotKey/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { onKeyStroke } from '@vueuse/core'\n\nconst disableKeyboardShortcuts = window.OCP?.Accessibility?.disableKeyboardShortcuts?.()\nconst isMac = /mac|ipad|iphone|darwin/i.test(navigator.userAgent)\nconst derivedKeysRegex = /^[a-zA-Z0-9]$/\nconst nonAsciiPrintableRegex = /^[^\\x20-\\x7F]$/\n\nexport interface UseHotKeyOptions {\n\t/** Make key filter case sensitive */\n\tcaseSensitive?: boolean\n\n\t/** Prevent default behavior of key stroke */\n\tprevent?: boolean\n\n\t/** Stop the event bubbling */\n\tstop?: boolean\n\n\t/** Also listen for keyup event */\n\tpush?: boolean\n\n\t/**\n\t * If set then the callback is only called when the shift key is (not) pressed.\n\t * When left `undefined` a pressed shift key is ignored (callback is run with and without shift pressed).\n\t */\n\tshift?: boolean\n\n\t/**\n\t * Only run the callback if the control key is (not-)pressed.\n\t * Undefined will be handled the same as `false` and will only run the callback if the 'ctrl' key is NOT pressed.\n\t */\n\tctrl?: boolean\n\n\t/**\n\t * If set the callback is only executed if the alt key is (not-)pressed\n\t * Undefined will be handled the same as `false` and will only run the callback if the 'alt' key is NOT pressed.\n\t */\n\talt?: boolean\n}\n\n/**\n * Check if event target (active element) is editable (allows input from keyboard) or NcModal is open\n * If true, a hot key should not trigger the callback\n *\n * @todo Discuss if we should abort on another interactive elements (button, a, e.t.c)\n *\n * @param event keyboard event\n * @return Whether it should prevent callback\n */\nfunction shouldIgnoreEvent(event: KeyboardEvent): boolean {\n\tif (!(event.target instanceof HTMLElement)\n\t\t|| event.target instanceof HTMLInputElement\n\t\t|| event.target instanceof HTMLTextAreaElement\n\t\t|| event.target instanceof HTMLSelectElement\n\t\t|| event.target.isContentEditable) {\n\t\treturn true\n\t}\n\t/** Abort if any modal/dialog opened */\n\treturn document.getElementsByClassName('modal-mask').length !== 0\n}\n\ntype KeyboardEventHandler = (event: KeyboardEvent) => void\n\n/**\n * Implementation of the event handler.\n *\n * @param callback The callback to run\n * @param options hot key options\n */\nfunction eventHandler(callback: KeyboardEventHandler, options: UseHotKeyOptions): KeyboardEventHandler {\n\treturn (event: KeyboardEvent) => {\n\t\tconst ctrlKeyPressed = isMac ? event.metaKey : event.ctrlKey\n\t\tif (ctrlKeyPressed !== Boolean(options.ctrl)) {\n\t\t\t/**\n\t\t\t * Ctrl is required and not pressed, or the opposite\n\t\t\t * As on macOS 'cmd' key is used instead of 'ctrl' key for most key combinations,\n\t\t\t * 'event.metaKey' should be checked\n\t\t\t */\n\t\t\treturn\n\t\t} else if (event.altKey !== Boolean(options.alt)) {\n\t\t\t// Alt is required and not pressed, or the opposite\n\t\t\treturn\n\t\t} else if (options.shift !== undefined && event.shiftKey !== Boolean(options.shift)) {\n\t\t\t/**\n\t\t\t * Shift is required and not pressed, or the opposite\n\t\t\t * As shift key is used to type capital letters and alternate characters,\n\t\t\t * option should be explicitly defined\n\t\t\t */\n\t\t\treturn\n\t\t} else if (shouldIgnoreEvent(event)) {\n\t\t\t// Keyboard shortcuts are disabled, because active element assumes input\n\t\t\treturn\n\t\t}\n\n\t\tif (options.prevent) {\n\t\t\tevent.preventDefault()\n\t\t}\n\t\tif (options.stop) {\n\t\t\tevent.stopPropagation()\n\t\t}\n\t\tcallback(event)\n\t}\n}\n\n/**\n * Composable to use keyboard shortcuts in the application.\n * It respects the users accessibility configuration (opt-out shortcuts).\n *\n * @param keysOrFilter - keyboard key(s) to listen to, or filter function or pass `true` for listening to all keys\n * @param callback - callback function\n * @param options - composable options\n * @see docs/composables/usekeystroke.md\n */\nexport function useHotKey(\n\tkeysOrFilter: true | string | string[] | ((e: KeyboardEvent) => boolean),\n\tcallback = () => {},\n\toptions: UseHotKeyOptions = {},\n) {\n\tif (disableKeyboardShortcuts) {\n\t\t// Keyboard shortcuts are disabled\n\t\treturn () => {}\n\t}\n\n\t/**\n\t * Validates event key to expected key\n\t *\n\t * @param event keyboard event\n\t * @param key expected key\n\t * @return whether it satisfies expected value or not\n\t */\n\tconst validateKeyEvent = (event: KeyboardEvent, key: string): boolean => {\n\t\t// If key exactly matches event.key, valid with any caseSensitive option. Do not perform further checks\n\t\tif (event.key === key) {\n\t\t\treturn true\n\t\t}\n\n\t\t// If key and event.key are in different cases, invalid with caseSensitive = true. Do not perform further checks\n\t\tif (options.caseSensitive) {\n\t\t\tconst isKeyInLowerCase = key === key.toLowerCase()\n\t\t\tconst isEventKeyInLowerCase = event.key === event.key.toLowerCase()\n\t\t\tif (isKeyInLowerCase !== isEventKeyInLowerCase) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\t// If received event.key is not a printable ASCII character code (character code 32-127),\n\t\t// try to derive it from event.code and match with expected key\n\t\tif (derivedKeysRegex.test(key) && nonAsciiPrintableRegex.test(event.key)) {\n\t\t\treturn event.code.replace(/^(?:Key|Digit|Numpad)/, '') === key.toUpperCase()\n\t\t}\n\n\t\treturn event.key.toLowerCase() === key.toLowerCase()\n\t}\n\n\t/**\n\t * Filter function for the listener\n\t * see https://github.com/vueuse/vueuse/blob/v11.3.0/packages/core/onKeyStroke/index.ts#L21-L32\n\t *\n\t * @param event keyboard event\n\t * @return Whether it satisfies expected value or not\n\t */\n\tconst keyFilter = (event: KeyboardEvent): boolean => {\n\t\tif (typeof keysOrFilter === 'function') {\n\t\t\treturn keysOrFilter(event)\n\t\t} else if (typeof keysOrFilter === 'string') {\n\t\t\treturn validateKeyEvent(event, keysOrFilter)\n\t\t} else if (Array.isArray(keysOrFilter)) {\n\t\t\treturn keysOrFilter.some(key => validateKeyEvent(event, key))\n\t\t} else {\n\t\t\treturn true\n\t\t}\n\t}\n\n\tconst stopKeyDown = onKeyStroke(keyFilter, eventHandler(callback, options), {\n\t\teventName: 'keydown',\n\t\tdedupe: true,\n\t\tpassive: !options.prevent,\n\t})\n\n\tconst stopKeyUp = options.push\n\t\t? onKeyStroke(keyFilter, eventHandler(callback, options), {\n\t\t\teventName: 'keyup',\n\t\t\tpassive: !options.prevent,\n\t\t})\n\t\t: () => {}\n\n\treturn () => {\n\t\tstopKeyDown()\n\t\tstopKeyUp()\n\t}\n}\n"],"names":[],"mappings":";AAMA,MAAM,2BAA2B,OAAO,KAAK,eAAe,
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/composables/useHotKey/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport { onKeyStroke } from '@vueuse/core'\n\nconst disableKeyboardShortcuts = window.OCP?.Accessibility?.disableKeyboardShortcuts?.()\nconst isMac = /mac|ipad|iphone|darwin/i.test(navigator.userAgent)\nconst derivedKeysRegex = /^[a-zA-Z0-9]$/\nconst nonAsciiPrintableRegex = /^[^\\x20-\\x7F]$/\n\nexport interface UseHotKeyOptions {\n\t/** Make key filter case sensitive */\n\tcaseSensitive?: boolean\n\n\t/** Prevent default behavior of key stroke */\n\tprevent?: boolean\n\n\t/** Stop the event bubbling */\n\tstop?: boolean\n\n\t/** Also listen for keyup event */\n\tpush?: boolean\n\n\t/**\n\t * If set then the callback is only called when the shift key is (not) pressed.\n\t * When left `undefined` a pressed shift key is ignored (callback is run with and without shift pressed).\n\t */\n\tshift?: boolean\n\n\t/**\n\t * Only run the callback if the control key is (not-)pressed.\n\t * Undefined will be handled the same as `false` and will only run the callback if the 'ctrl' key is NOT pressed.\n\t */\n\tctrl?: boolean\n\n\t/**\n\t * If set the callback is only executed if the alt key is (not-)pressed\n\t * Undefined will be handled the same as `false` and will only run the callback if the 'alt' key is NOT pressed.\n\t */\n\talt?: boolean\n}\n\n/**\n * Check if event target (active element) is editable (allows input from keyboard) or NcModal is open\n * If true, a hot key should not trigger the callback\n *\n * @todo Discuss if we should abort on another interactive elements (button, a, e.t.c)\n *\n * @param event keyboard event\n * @return Whether it should prevent callback\n */\nfunction shouldIgnoreEvent(event: KeyboardEvent): boolean {\n\tif (!(event.target instanceof HTMLElement)\n\t\t|| event.target instanceof HTMLInputElement\n\t\t|| event.target instanceof HTMLTextAreaElement\n\t\t|| event.target instanceof HTMLSelectElement\n\t\t|| event.target.isContentEditable) {\n\t\treturn true\n\t}\n\t/** Abort if any modal/dialog opened */\n\treturn document.getElementsByClassName('modal-mask').length !== 0\n}\n\ntype KeyboardEventHandler = (event: KeyboardEvent) => void\n\n/**\n * Implementation of the event handler.\n *\n * @param callback The callback to run\n * @param options hot key options\n */\nfunction eventHandler(callback: KeyboardEventHandler, options: UseHotKeyOptions): KeyboardEventHandler {\n\treturn (event: KeyboardEvent) => {\n\t\tconst ctrlKeyPressed = isMac ? event.metaKey : event.ctrlKey\n\t\tif (ctrlKeyPressed !== Boolean(options.ctrl)) {\n\t\t\t/**\n\t\t\t * Ctrl is required and not pressed, or the opposite\n\t\t\t * As on macOS 'cmd' key is used instead of 'ctrl' key for most key combinations,\n\t\t\t * 'event.metaKey' should be checked\n\t\t\t */\n\t\t\treturn\n\t\t} else if (event.altKey !== Boolean(options.alt)) {\n\t\t\t// Alt is required and not pressed, or the opposite\n\t\t\treturn\n\t\t} else if (options.shift !== undefined && event.shiftKey !== Boolean(options.shift)) {\n\t\t\t/**\n\t\t\t * Shift is required and not pressed, or the opposite\n\t\t\t * As shift key is used to type capital letters and alternate characters,\n\t\t\t * option should be explicitly defined\n\t\t\t */\n\t\t\treturn\n\t\t} else if (shouldIgnoreEvent(event)) {\n\t\t\t// Keyboard shortcuts are disabled, because active element assumes input\n\t\t\treturn\n\t\t}\n\n\t\tif (options.prevent) {\n\t\t\tevent.preventDefault()\n\t\t}\n\t\tif (options.stop) {\n\t\t\tevent.stopPropagation()\n\t\t}\n\t\tcallback(event)\n\t}\n}\n\n/**\n * Composable to use keyboard shortcuts in the application.\n * It respects the users accessibility configuration (opt-out shortcuts).\n *\n * @param keysOrFilter - keyboard key(s) to listen to, or filter function or pass `true` for listening to all keys\n * @param callback - callback function\n * @param options - composable options\n * @see docs/composables/usekeystroke.md\n */\nexport function useHotKey(\n\tkeysOrFilter: true | string | string[] | ((e: KeyboardEvent) => boolean),\n\tcallback = () => {},\n\toptions: UseHotKeyOptions = {},\n) {\n\tif (disableKeyboardShortcuts) {\n\t\t// Keyboard shortcuts are disabled\n\t\treturn () => {}\n\t}\n\n\t/**\n\t * Validates event key to expected key\n\t *\n\t * @param event keyboard event\n\t * @param key expected key\n\t * @return whether it satisfies expected value or not\n\t */\n\tconst validateKeyEvent = (event: KeyboardEvent, key: string): boolean => {\n\t\t// If key exactly matches event.key, valid with any caseSensitive option. Do not perform further checks\n\t\tif (event.key === key) {\n\t\t\treturn true\n\t\t}\n\n\t\t// If key and event.key are in different cases, invalid with caseSensitive = true. Do not perform further checks\n\t\tif (options.caseSensitive) {\n\t\t\tconst isKeyInLowerCase = key === key.toLowerCase()\n\t\t\tconst isEventKeyInLowerCase = event.key === event.key.toLowerCase()\n\t\t\tif (isKeyInLowerCase !== isEventKeyInLowerCase) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t}\n\n\t\t// If received event.key is not a printable ASCII character code (character code 32-127),\n\t\t// try to derive it from event.code and match with expected key\n\t\tif (derivedKeysRegex.test(key) && nonAsciiPrintableRegex.test(event.key)) {\n\t\t\treturn event.code.replace(/^(?:Key|Digit|Numpad)/, '') === key.toUpperCase()\n\t\t}\n\n\t\treturn event.key.toLowerCase() === key.toLowerCase()\n\t}\n\n\t/**\n\t * Filter function for the listener\n\t * see https://github.com/vueuse/vueuse/blob/v11.3.0/packages/core/onKeyStroke/index.ts#L21-L32\n\t *\n\t * @param event keyboard event\n\t * @return Whether it satisfies expected value or not\n\t */\n\tconst keyFilter = (event: KeyboardEvent): boolean => {\n\t\tif (typeof keysOrFilter === 'function') {\n\t\t\treturn keysOrFilter(event)\n\t\t} else if (typeof keysOrFilter === 'string') {\n\t\t\treturn validateKeyEvent(event, keysOrFilter)\n\t\t} else if (Array.isArray(keysOrFilter)) {\n\t\t\treturn keysOrFilter.some(key => validateKeyEvent(event, key))\n\t\t} else {\n\t\t\treturn true\n\t\t}\n\t}\n\n\tconst stopKeyDown = onKeyStroke(keyFilter, eventHandler(callback, options), {\n\t\teventName: 'keydown',\n\t\tdedupe: true,\n\t\tpassive: !options.prevent,\n\t})\n\n\tconst stopKeyUp = options.push\n\t\t? onKeyStroke(keyFilter, eventHandler(callback, options), {\n\t\t\teventName: 'keyup',\n\t\t\tpassive: !options.prevent,\n\t\t})\n\t\t: () => {}\n\n\treturn () => {\n\t\tstopKeyDown()\n\t\tstopKeyUp()\n\t}\n}\n"],"names":[],"mappings":";AAMA,MAAM,2BAA2B,OAAO,KAAK,eAAe,2BAAA;AAC5D,MAAM,QAAQ,0BAA0B,KAAK,UAAU,SAAS;AAChE,MAAM,mBAAmB;AACzB,MAAM,yBAAyB;AA2C/B,SAAS,kBAAkB,OAA+B;AACzD,MAAI,EAAE,MAAM,kBAAkB,gBAC1B,MAAM,kBAAkB,oBACxB,MAAM,kBAAkB,uBACxB,MAAM,kBAAkB,qBACxB,MAAM,OAAO,mBAAmB;AACnC,WAAO;AAAA,EACR;AAEA,SAAO,SAAS,uBAAuB,YAAY,EAAE,WAAW;AACjE;AAUA,SAAS,aAAa,UAAgC,SAAiD;AACtG,SAAO,CAAC,UAAyB;AAChC,UAAM,iBAAiB,QAAQ,MAAM,UAAU,MAAM;AACrD,QAAI,mBAAmB,QAAQ,QAAQ,IAAI,GAAG;AAM7C;AAAA,IACD,WAAW,MAAM,WAAW,QAAQ,QAAQ,GAAG,GAAG;AAEjD;AAAA,IACD,WAAW,QAAQ,UAAU,UAAa,MAAM,aAAa,QAAQ,QAAQ,KAAK,GAAG;AAMpF;AAAA,IACD,WAAW,kBAAkB,KAAK,GAAG;AAEpC;AAAA,IACD;AAEA,QAAI,QAAQ,SAAS;AACpB,YAAM,eAAA;AAAA,IACP;AACA,QAAI,QAAQ,MAAM;AACjB,YAAM,gBAAA;AAAA,IACP;AACA,aAAS,KAAK;AAAA,EACf;AACD;AAWO,SAAS,UACf,cACA,WAAW,MAAM;AAAC,GAClB,UAA4B,CAAA,GAC3B;AACD,MAAI,0BAA0B;AAE7B,WAAO,MAAM;AAAA,IAAC;AAAA,EACf;AASA,QAAM,mBAAmB,CAAC,OAAsB,QAAyB;AAExE,QAAI,MAAM,QAAQ,KAAK;AACtB,aAAO;AAAA,IACR;AAGA,QAAI,QAAQ,eAAe;AAC1B,YAAM,mBAAmB,QAAQ,IAAI,YAAA;AACrC,YAAM,wBAAwB,MAAM,QAAQ,MAAM,IAAI,YAAA;AACtD,UAAI,qBAAqB,uBAAuB;AAC/C,eAAO;AAAA,MACR;AAAA,IACD;AAIA,QAAI,iBAAiB,KAAK,GAAG,KAAK,uBAAuB,KAAK,MAAM,GAAG,GAAG;AACzE,aAAO,MAAM,KAAK,QAAQ,yBAAyB,EAAE,MAAM,IAAI,YAAA;AAAA,IAChE;AAEA,WAAO,MAAM,IAAI,YAAA,MAAkB,IAAI,YAAA;AAAA,EACxC;AASA,QAAM,YAAY,CAAC,UAAkC;AACpD,QAAI,OAAO,iBAAiB,YAAY;AACvC,aAAO,aAAa,KAAK;AAAA,IAC1B,WAAW,OAAO,iBAAiB,UAAU;AAC5C,aAAO,iBAAiB,OAAO,YAAY;AAAA,IAC5C,WAAW,MAAM,QAAQ,YAAY,GAAG;AACvC,aAAO,aAAa,KAAK,CAAA,QAAO,iBAAiB,OAAO,GAAG,CAAC;AAAA,IAC7D,OAAO;AACN,aAAO;AAAA,IACR;AAAA,EACD;AAEA,QAAM,cAAc,YAAY,WAAW,aAAa,UAAU,OAAO,GAAG;AAAA,IAC3E,WAAW;AAAA,IACX,QAAQ;AAAA,IACR,SAAS,CAAC,QAAQ;AAAA,EAAA,CAClB;AAED,QAAM,YAAY,QAAQ,OACvB,YAAY,WAAW,aAAa,UAAU,OAAO,GAAG;AAAA,IACzD,WAAW;AAAA,IACX,SAAS,CAAC,QAAQ;AAAA,EAAA,CAClB,IACC,MAAM;AAAA,EAAC;AAEV,SAAO,MAAM;AACZ,gBAAA;AACA,cAAA;AAAA,EACD;AACD;"}
|
|
@@ -21,7 +21,7 @@ function useIsDarkThemeElement(el) {
|
|
|
21
21
|
const useInternalIsDarkTheme = createSharedComposable(() => useIsDarkThemeElement());
|
|
22
22
|
function useIsDarkTheme() {
|
|
23
23
|
const isDarkTheme = useInternalIsDarkTheme();
|
|
24
|
-
const enforcedTheme = inject(INJECTION_KEY_THEME);
|
|
24
|
+
const enforcedTheme = inject(INJECTION_KEY_THEME, void 0);
|
|
25
25
|
return computed(() => {
|
|
26
26
|
if (enforcedTheme?.value) {
|
|
27
27
|
return enforcedTheme.value === "dark";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/composables/useIsDarkTheme/index.ts"],"sourcesContent":["/*!\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { DeepReadonly, MaybeRefOrGetter, Ref } from 'vue'\n\nimport { createSharedComposable, usePreferredDark, useMutationObserver } from '@vueuse/core'\nimport { computed, inject, ref, readonly, toValue, watch } from 'vue'\nimport { checkIfDarkTheme } from '../../functions/isDarkTheme/index.ts'\nimport { INJECTION_KEY_THEME } from './constants.ts'\n\n/**\n * Check whether the dark theme is enabled on a specific element.\n * If you need to check an entire page, use `useIsDarkTheme` instead for better performance.\n * Reacts on element attributes change and system theme change.\n * @param el - The element to check for the dark theme enabled on (default is `document.body`)\n * @return {DeepReadonly<Ref<boolean>>} - computed boolean whether the dark theme is enabled\n */\nexport function useIsDarkThemeElement(el?: MaybeRefOrGetter<HTMLElement>): DeepReadonly<Ref<boolean>> {\n\tconst element = computed(() => toValue(el) ?? document.body)\n\n\tconst isDarkTheme = ref(checkIfDarkTheme(element.value))\n\tconst isDarkSystemTheme = usePreferredDark()\n\n\t/** Update the isDarkTheme */\n\tfunction updateIsDarkTheme() {\n\t\tisDarkTheme.value = checkIfDarkTheme(element.value)\n\t}\n\n\t// Watch for element change to handle data-theme* attributes change\n\tuseMutationObserver(element, updateIsDarkTheme, { attributes: true })\n\t// Watch for ref changes\n\twatch(element, updateIsDarkTheme)\n\t// Watch for system theme change for the default theme\n\twatch(isDarkSystemTheme, updateIsDarkTheme, { immediate: true })\n\n\treturn readonly(isDarkTheme)\n}\n\n/**\n * The real shared composable of the dark theme state.\n * We need to wrap this to allow to react to injected theme changes.\n */\nconst useInternalIsDarkTheme = createSharedComposable(() => useIsDarkThemeElement())\n\n/**\n * Shared composable to check whether the dark theme is enabled on the page.\n *\n * Reacts on body data-theme-* attributes change and system theme change.\n * As well as any enforced theme by the `NcThemeProvider`.\n *\n * @return Computed boolean whether the dark theme is enabled\n */\nexport function useIsDarkTheme(): DeepReadonly<Ref<boolean>> {\n\tconst isDarkTheme = useInternalIsDarkTheme()\n\tconst enforcedTheme = inject(INJECTION_KEY_THEME)\n\n\treturn computed(() => {\n\t\tif (enforcedTheme?.value) {\n\t\t\treturn enforcedTheme.value === 'dark'\n\t\t}\n\t\treturn isDarkTheme.value\n\t})\n}\n"],"names":[],"mappings":";;;;AAAA;AAAA;AAAA;AAAA;AAmBO,SAAS,sBAAsB,IAAgE;AACrG,QAAM,UAAU,SAAS,MAAM,QAAQ,EAAE,KAAK,SAAS,IAAI;AAE3D,QAAM,cAAc,IAAI,iBAAiB,QAAQ,KAAK,CAAC;AACvD,QAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/composables/useIsDarkTheme/index.ts"],"sourcesContent":["/*!\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { DeepReadonly, MaybeRefOrGetter, Ref } from 'vue'\n\nimport { createSharedComposable, usePreferredDark, useMutationObserver } from '@vueuse/core'\nimport { computed, inject, ref, readonly, toValue, watch } from 'vue'\nimport { checkIfDarkTheme } from '../../functions/isDarkTheme/index.ts'\nimport { INJECTION_KEY_THEME } from './constants.ts'\n\n/**\n * Check whether the dark theme is enabled on a specific element.\n * If you need to check an entire page, use `useIsDarkTheme` instead for better performance.\n * Reacts on element attributes change and system theme change.\n * @param el - The element to check for the dark theme enabled on (default is `document.body`)\n * @return {DeepReadonly<Ref<boolean>>} - computed boolean whether the dark theme is enabled\n */\nexport function useIsDarkThemeElement(el?: MaybeRefOrGetter<HTMLElement>): DeepReadonly<Ref<boolean>> {\n\tconst element = computed(() => toValue(el) ?? document.body)\n\n\tconst isDarkTheme = ref(checkIfDarkTheme(element.value))\n\tconst isDarkSystemTheme = usePreferredDark()\n\n\t/** Update the isDarkTheme */\n\tfunction updateIsDarkTheme() {\n\t\tisDarkTheme.value = checkIfDarkTheme(element.value)\n\t}\n\n\t// Watch for element change to handle data-theme* attributes change\n\tuseMutationObserver(element, updateIsDarkTheme, { attributes: true })\n\t// Watch for ref changes\n\twatch(element, updateIsDarkTheme)\n\t// Watch for system theme change for the default theme\n\twatch(isDarkSystemTheme, updateIsDarkTheme, { immediate: true })\n\n\treturn readonly(isDarkTheme)\n}\n\n/**\n * The real shared composable of the dark theme state.\n * We need to wrap this to allow to react to injected theme changes.\n */\nconst useInternalIsDarkTheme = createSharedComposable(() => useIsDarkThemeElement())\n\n/**\n * Shared composable to check whether the dark theme is enabled on the page.\n *\n * Reacts on body data-theme-* attributes change and system theme change.\n * As well as any enforced theme by the `NcThemeProvider`.\n *\n * @return Computed boolean whether the dark theme is enabled\n */\nexport function useIsDarkTheme(): DeepReadonly<Ref<boolean>> {\n\tconst isDarkTheme = useInternalIsDarkTheme()\n\tconst enforcedTheme = inject(INJECTION_KEY_THEME, undefined)\n\n\treturn computed(() => {\n\t\tif (enforcedTheme?.value) {\n\t\t\treturn enforcedTheme.value === 'dark'\n\t\t}\n\t\treturn isDarkTheme.value\n\t})\n}\n"],"names":[],"mappings":";;;;AAAA;AAAA;AAAA;AAAA;AAmBO,SAAS,sBAAsB,IAAgE;AACrG,QAAM,UAAU,SAAS,MAAM,QAAQ,EAAE,KAAK,SAAS,IAAI;AAE3D,QAAM,cAAc,IAAI,iBAAiB,QAAQ,KAAK,CAAC;AACvD,QAAM,oBAAoB,iBAAA;AAG1B,WAAS,oBAAoB;AAC5B,gBAAY,QAAQ,iBAAiB,QAAQ,KAAK;AAAA,EACnD;AAGA,sBAAoB,SAAS,mBAAmB,EAAE,YAAY,MAAM;AAEpE,QAAM,SAAS,iBAAiB;AAEhC,QAAM,mBAAmB,mBAAmB,EAAE,WAAW,MAAM;AAE/D,SAAO,SAAS,WAAW;AAC5B;AAMA,MAAM,yBAAyB,uBAAuB,MAAM,uBAAuB;AAU5E,SAAS,iBAA6C;AAC5D,QAAM,cAAc,uBAAA;AACpB,QAAM,gBAAgB,OAAO,qBAAqB,MAAS;AAE3D,SAAO,SAAS,MAAM;AACrB,QAAI,eAAe,OAAO;AACzB,aAAO,cAAc,UAAU;AAAA,IAChC;AACA,WAAO,YAAY;AAAA,EACpB,CAAC;AACF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/composables/useIsFullscreen/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport type { Ref } from 'vue'\nimport { readonly, ref } from 'vue'\n\nconst isFullscreen = ref(checkIfIsFullscreen())\n\nwindow.addEventListener('resize', () => {\n\tisFullscreen.value = checkIfIsFullscreen()\n})\n\n/**\n * If the window height is equal to the screen height,\n * we are in full screen mode.\n */\nfunction checkIfIsFullscreen(): boolean {\n\treturn window.outerHeight === window.screen.height\n}\n\n/**\n * Use global `isFullscreen` state, based on the screen height check.\n */\nexport function useIsFullscreen(): Readonly<Ref<boolean>> {\n\treturn readonly(isFullscreen)\n}\n"],"names":[],"mappings":";AAOA,MAAM,eAAe,IAAI,qBAAqB;AAE9C,OAAO,iBAAiB,UAAU,MAAM;AACvC,eAAa,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/composables/useIsFullscreen/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport type { Ref } from 'vue'\nimport { readonly, ref } from 'vue'\n\nconst isFullscreen = ref(checkIfIsFullscreen())\n\nwindow.addEventListener('resize', () => {\n\tisFullscreen.value = checkIfIsFullscreen()\n})\n\n/**\n * If the window height is equal to the screen height,\n * we are in full screen mode.\n */\nfunction checkIfIsFullscreen(): boolean {\n\treturn window.outerHeight === window.screen.height\n}\n\n/**\n * Use global `isFullscreen` state, based on the screen height check.\n */\nexport function useIsFullscreen(): Readonly<Ref<boolean>> {\n\treturn readonly(isFullscreen)\n}\n"],"names":[],"mappings":";AAOA,MAAM,eAAe,IAAI,qBAAqB;AAE9C,OAAO,iBAAiB,UAAU,MAAM;AACvC,eAAa,QAAQ,oBAAA;AACtB,CAAC;AAMD,SAAS,sBAA+B;AACvC,SAAO,OAAO,gBAAgB,OAAO,OAAO;AAC7C;AAKO,SAAS,kBAA0C;AACzD,SAAO,SAAS,YAAY;AAC7B;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/composables/useIsMobile/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { Ref } from 'vue'\nimport { readonly, ref } from 'vue'\n\n/** The minimal width of the viewport for a desktop screen */\nexport const MOBILE_BREAKPOINT = 1024\n\n/** The minimal width of the viewport for a small mobile screen, a half of the minimal desktop */\nexport const MOBILE_SMALL_BREAKPOINT = MOBILE_BREAKPOINT / 2\n\nconst isLessThanBreakpoint = (breakpoint) => document.documentElement.clientWidth < breakpoint\n\n// Store the state of the viewport size in a module-scope to reuse between module's users\nconst isMobile = ref(isLessThanBreakpoint(MOBILE_BREAKPOINT))\nconst isSmallMobile = ref(isLessThanBreakpoint(MOBILE_SMALL_BREAKPOINT))\n\nwindow.addEventListener('resize', () => {\n\tisMobile.value = isLessThanBreakpoint(MOBILE_BREAKPOINT)\n\tisSmallMobile.value = isLessThanBreakpoint(MOBILE_SMALL_BREAKPOINT)\n}, { passive: true })\n\n/**\n * Use global isMobile state\n *\n * @return Reactive flag for MOBILE_BREAKPOINT\n */\nexport function useIsMobile(): Readonly<Ref<boolean>> {\n\treturn readonly(isMobile)\n}\n\n/**\n * Use global isSmallMobile state\n *\n * @return Reactive flag for MOBILE_SMALL_BREAKPOINT\n */\nexport function useIsSmallMobile(): Readonly<Ref<boolean>> {\n\treturn readonly(isSmallMobile)\n}\n"],"names":[],"mappings":";AASO,MAAM,oBAAoB;AAG1B,MAAM,0BAA0B,oBAAoB;AAE3D,MAAM,uBAAuB,CAAC,eAAe,SAAS,gBAAgB,cAAc;AAGpF,MAAM,WAAW,IAAI,qBAAqB,iBAAiB,CAAC;AAC5D,MAAM,gBAAgB,IAAI,qBAAqB,uBAAuB,CAAC;AAEvE,OAAO,iBAAiB,UAAU,MAAM;
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/composables/useIsMobile/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { Ref } from 'vue'\nimport { readonly, ref } from 'vue'\n\n/** The minimal width of the viewport for a desktop screen */\nexport const MOBILE_BREAKPOINT = 1024\n\n/** The minimal width of the viewport for a small mobile screen, a half of the minimal desktop */\nexport const MOBILE_SMALL_BREAKPOINT = MOBILE_BREAKPOINT / 2\n\nconst isLessThanBreakpoint = (breakpoint) => document.documentElement.clientWidth < breakpoint\n\n// Store the state of the viewport size in a module-scope to reuse between module's users\nconst isMobile = ref(isLessThanBreakpoint(MOBILE_BREAKPOINT))\nconst isSmallMobile = ref(isLessThanBreakpoint(MOBILE_SMALL_BREAKPOINT))\n\nwindow.addEventListener('resize', () => {\n\tisMobile.value = isLessThanBreakpoint(MOBILE_BREAKPOINT)\n\tisSmallMobile.value = isLessThanBreakpoint(MOBILE_SMALL_BREAKPOINT)\n}, { passive: true })\n\n/**\n * Use global isMobile state\n *\n * @return Reactive flag for MOBILE_BREAKPOINT\n */\nexport function useIsMobile(): Readonly<Ref<boolean>> {\n\treturn readonly(isMobile)\n}\n\n/**\n * Use global isSmallMobile state\n *\n * @return Reactive flag for MOBILE_SMALL_BREAKPOINT\n */\nexport function useIsSmallMobile(): Readonly<Ref<boolean>> {\n\treturn readonly(isSmallMobile)\n}\n"],"names":[],"mappings":";AASO,MAAM,oBAAoB;AAG1B,MAAM,0BAA0B,oBAAoB;AAE3D,MAAM,uBAAuB,CAAC,eAAe,SAAS,gBAAgB,cAAc;AAGpF,MAAM,WAAW,IAAI,qBAAqB,iBAAiB,CAAC;AAC5D,MAAM,gBAAgB,IAAI,qBAAqB,uBAAuB,CAAC;AAEvE,OAAO,iBAAiB,UAAU,MAAM;AACvC,WAAS,QAAQ,qBAAqB,iBAAiB;AACvD,gBAAc,QAAQ,qBAAqB,uBAAuB;AACnE,GAAG,EAAE,SAAS,MAAM;AAOb,SAAS,cAAsC;AACrD,SAAO,SAAS,QAAQ;AACzB;AAOO,SAAS,mBAA2C;AAC1D,SAAO,SAAS,aAAa;AAC9B;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/directives/Focus/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { ObjectDirective } from 'vue'\n\nconst directive: ObjectDirective<HTMLElement> = {\n\tmounted(el: HTMLElement) {\n\t\tel.focus()\n\t},\n}\n\nexport default directive\n"],"names":[],"mappings":"AAOA,MAAM,YAA0C;AAAA,EAC/C,QAAQ,IAAiB;AACxB,OAAG,
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/directives/Focus/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { ObjectDirective } from 'vue'\n\nconst directive: ObjectDirective<HTMLElement> = {\n\tmounted(el: HTMLElement) {\n\t\tel.focus()\n\t},\n}\n\nexport default directive\n"],"names":[],"mappings":"AAOA,MAAM,YAA0C;AAAA,EAC/C,QAAQ,IAAiB;AACxB,OAAG,MAAA;AAAA,EACJ;AACD;"}
|
|
@@ -11,8 +11,7 @@ function linkifyString(str) {
|
|
|
11
11
|
}, defaultRender);
|
|
12
12
|
const tokens = tokenize(str);
|
|
13
13
|
const result = [];
|
|
14
|
-
for (
|
|
15
|
-
const token = tokens[i];
|
|
14
|
+
for (const token of tokens) {
|
|
16
15
|
if (token.t === "nl" && options.get("nl2br")) {
|
|
17
16
|
result.push("<br>\n");
|
|
18
17
|
} else if (!token.isLink || !options.check(token)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/utils/linkify.ts","../../../src/directives/Linkify/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Nick Frasser <https://nfrasser.com>\n * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport type { IntermediateRepresentation } from 'linkifyjs'\n\nimport escapeHTML from 'escape-html'\nimport { tokenize, Options } from 'linkifyjs'\n\n/**\n * Convert a plan text string to an HTML string with links. Expects that the\n * given strings does not contain any HTML entities. Use the linkify-html\n * interface if you need to parse HTML entities.\n *\n * @param str - String to linkify\n */\nexport function linkifyString(str: string): string {\n\tconst options = new Options({\n\t\tdefaultProtocol: 'https',\n\t\ttarget: '_blank',\n\t\tclassName: 'external linkified',\n\t\tattributes: {\n\t\t\trel: 'nofollow noopener noreferrer',\n\t\t},\n\t}, defaultRender)\n\n\tconst tokens = tokenize(str)\n\tconst result: string[] = []\n\n\tfor (
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/utils/linkify.ts","../../../src/directives/Linkify/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Nick Frasser <https://nfrasser.com>\n * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport type { IntermediateRepresentation } from 'linkifyjs'\n\nimport escapeHTML from 'escape-html'\nimport { tokenize, Options } from 'linkifyjs'\n\n/**\n * Convert a plan text string to an HTML string with links. Expects that the\n * given strings does not contain any HTML entities. Use the linkify-html\n * interface if you need to parse HTML entities.\n *\n * @param str - String to linkify\n */\nexport function linkifyString(str: string): string {\n\tconst options = new Options({\n\t\tdefaultProtocol: 'https',\n\t\ttarget: '_blank',\n\t\tclassName: 'external linkified',\n\t\tattributes: {\n\t\t\trel: 'nofollow noopener noreferrer',\n\t\t},\n\t}, defaultRender)\n\n\tconst tokens = tokenize(str)\n\tconst result: string[] = []\n\n\tfor (const token of tokens) {\n\t\tif (token.t === 'nl' && options.get('nl2br')) {\n\t\t\tresult.push('<br>\\n')\n\t\t} else if (!token.isLink || !options.check(token)) {\n\t\t\tresult.push(escapeHTML(token.toString()))\n\t\t} else {\n\t\t\tresult.push(options.render(token))\n\t\t}\n\t}\n\n\treturn result.join('')\n}\n\n/**\n * Escape quotation marks in links for href attribute\n * @param href The link to escape\n */\nfunction escapeAttr(href: string): string {\n\treturn href.replace(/\"/g, '"')\n}\n\n/**\n * Map attributes to a string.\n * @param attributes - The attribute mapping\n */\nfunction attributesToString(attributes: Record<string, string>): string {\n\tconst result: string[] = []\n\tfor (const attr in attributes) {\n\t\tconst val = attributes[attr] + ''\n\t\tresult.push(`${attr}=\"${escapeAttr(val)}\"`)\n\t}\n\treturn result.join(' ')\n}\n\n/**\n * Render the link.\n *\n * @param options - Options\n * @param options.tagName - The tag name\n * @param options.attributes - The attributes\n * @param options.content - The text content\n */\nfunction defaultRender({ tagName, attributes, content }: IntermediateRepresentation): string {\n\treturn `<${tagName} ${attributesToString(attributes)}>${escapeHTML(content)}</${tagName}>`\n}\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { Directive } from 'vue'\nimport { linkifyString } from '../../utils/linkify.ts'\n\nconst directive: Directive = function(el: HTMLElement, { value }) {\n\tif (value?.linkify === true) {\n\t\tel.innerHTML = linkifyString(value.text)\n\t}\n}\n\nexport default directive\n"],"names":[],"mappings":";;AAiBO,SAAS,cAAc,KAAqB;AAClD,QAAM,UAAU,IAAI,QAAQ;AAAA,IAC3B,iBAAiB;AAAA,IACjB,QAAQ;AAAA,IACR,WAAW;AAAA,IACX,YAAY;AAAA,MACX,KAAK;AAAA,IAAA;AAAA,EACN,GACE,aAAa;AAEhB,QAAM,SAAS,SAAS,GAAG;AAC3B,QAAM,SAAmB,CAAA;AAEzB,aAAW,SAAS,QAAQ;AAC3B,QAAI,MAAM,MAAM,QAAQ,QAAQ,IAAI,OAAO,GAAG;AAC7C,aAAO,KAAK,QAAQ;AAAA,IACrB,WAAW,CAAC,MAAM,UAAU,CAAC,QAAQ,MAAM,KAAK,GAAG;AAClD,aAAO,KAAK,WAAW,MAAM,SAAA,CAAU,CAAC;AAAA,IACzC,OAAO;AACN,aAAO,KAAK,QAAQ,OAAO,KAAK,CAAC;AAAA,IAClC;AAAA,EACD;AAEA,SAAO,OAAO,KAAK,EAAE;AACtB;AAMA,SAAS,WAAW,MAAsB;AACzC,SAAO,KAAK,QAAQ,MAAM,QAAQ;AACnC;AAMA,SAAS,mBAAmB,YAA4C;AACvE,QAAM,SAAmB,CAAA;AACzB,aAAW,QAAQ,YAAY;AAC9B,UAAM,MAAM,WAAW,IAAI,IAAI;AAC/B,WAAO,KAAK,GAAG,IAAI,KAAK,WAAW,GAAG,CAAC,GAAG;AAAA,EAC3C;AACA,SAAO,OAAO,KAAK,GAAG;AACvB;AAUA,SAAS,cAAc,EAAE,SAAS,YAAY,WAA+C;AAC5F,SAAO,IAAI,OAAO,IAAI,mBAAmB,UAAU,CAAC,IAAI,WAAW,OAAO,CAAC,KAAK,OAAO;AACxF;AClEA,MAAM,YAAuB,SAAS,IAAiB,EAAE,SAAS;AACjE,MAAI,OAAO,YAAY,MAAM;AAC5B,OAAG,YAAY,cAAc,MAAM,IAAI;AAAA,EACxC;AACD;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/functions/a11y/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\n/**\n * Return true if the DOM event is an accessible mouse or keyboard element activation, false otherwise\n *\n * @param {Event} event DOM event\n *\n * @return {boolean}\n */\nexport const isA11yActivation = (event: Event) => {\n\tif (event.type === 'click') {\n\t\treturn true\n\t}\n\tif (event.type === 'keydown' && (event as KeyboardEvent).key === 'Enter') {\n\t\treturn true\n\t}\n\treturn false\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/functions/a11y/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\n/**\n * Return true if the DOM event is an accessible mouse or keyboard element activation, false otherwise\n *\n * @param {Event} event DOM event\n *\n * @return {boolean}\n */\nexport const isA11yActivation = (event: Event) => {\n\tif (event.type === 'click') {\n\t\treturn true\n\t}\n\tif (event.type === 'keydown' && (event as KeyboardEvent).key === 'Enter') {\n\t\treturn true\n\t}\n\treturn false\n}\n"],"names":[],"mappings":"AAYO,MAAM,mBAAmB,CAAC,UAAiB;AACjD,MAAI,MAAM,SAAS,SAAS;AAC3B,WAAO;AAAA,EACR;AACA,MAAI,MAAM,SAAS,aAAc,MAAwB,QAAQ,SAAS;AACzE,WAAO;AAAA,EACR;AACA,SAAO;AACR;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/functions/contactsMenu/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport logger from '../../utils/logger.ts'\n\n// Taken from \\OC\\Contacts\\ContactsMenu\\Entry::jsonSerialize\nexport interface ContactsMenuEntry {\n\tid: number | string | null\n\tfullName: string\n\tavatar: string | null\n\ttopAction: object | null\n\tactions: object[]\n\tlastMessage: string\n\temailAddresses: string[]\n\tprofileTitle: string | null\n\tprofileUrl: string | null\n\tstatus: string | null\n\tstatusMessage: string | null\n\tstatusMessageTimestamp: number | null\n\tstatusIcon: string | null\n\tisUser: boolean\n\tuid: string | null\n}\n\nexport interface ContactsMenuAction {\n\tid: string\n\tdisplayName: (entry: ContactsMenuEntry) => string\n\tenabled: (entry: ContactsMenuEntry) => boolean\n\ticonSvg: (entry: ContactsMenuEntry) => string\n\tcallback: (entry: ContactsMenuEntry) => void\n}\n\n/**\n * Register a contacts and avatar menu action that will invoke the given callback on click.\n *\n * @param action - The action to register\n */\nexport function registerContactsMenuAction(action: ContactsMenuAction): void {\n\twindow._nc_contacts_menu_hooks ??= {}\n\n\tif (window._nc_contacts_menu_hooks[action.id]) {\n\t\tlogger.error(`ContactsMenu action for id ${action.id} has already been registered`, {\n\t\t\taction,\n\t\t})\n\t\treturn\n\t}\n\n\twindow._nc_contacts_menu_hooks[action.id] = action\n}\n\n/**\n * Get all registered and enabled contacts menu actions for the given menu entry.\n *\n * @param entry - The contacts menu entry object as returned by the backend\n */\nexport function getEnabledContactsMenuActions(entry: ContactsMenuEntry): ContactsMenuAction[] {\n\tif (!window._nc_contacts_menu_hooks) {\n\t\treturn []\n\t}\n\n\treturn Object.values(window._nc_contacts_menu_hooks).filter((action) => action.enabled(entry))\n}\n"],"names":[],"mappings":";AAuCO,SAAS,2BAA2B,QAAkC;AAC5E,SAAO,4BAA4B,
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/functions/contactsMenu/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport logger from '../../utils/logger.ts'\n\n// Taken from \\OC\\Contacts\\ContactsMenu\\Entry::jsonSerialize\nexport interface ContactsMenuEntry {\n\tid: number | string | null\n\tfullName: string\n\tavatar: string | null\n\ttopAction: object | null\n\tactions: object[]\n\tlastMessage: string\n\temailAddresses: string[]\n\tprofileTitle: string | null\n\tprofileUrl: string | null\n\tstatus: string | null\n\tstatusMessage: string | null\n\tstatusMessageTimestamp: number | null\n\tstatusIcon: string | null\n\tisUser: boolean\n\tuid: string | null\n}\n\nexport interface ContactsMenuAction {\n\tid: string\n\tdisplayName: (entry: ContactsMenuEntry) => string\n\tenabled: (entry: ContactsMenuEntry) => boolean\n\ticonSvg: (entry: ContactsMenuEntry) => string\n\tcallback: (entry: ContactsMenuEntry) => void\n}\n\n/**\n * Register a contacts and avatar menu action that will invoke the given callback on click.\n *\n * @param action - The action to register\n */\nexport function registerContactsMenuAction(action: ContactsMenuAction): void {\n\twindow._nc_contacts_menu_hooks ??= {}\n\n\tif (window._nc_contacts_menu_hooks[action.id]) {\n\t\tlogger.error(`ContactsMenu action for id ${action.id} has already been registered`, {\n\t\t\taction,\n\t\t})\n\t\treturn\n\t}\n\n\twindow._nc_contacts_menu_hooks[action.id] = action\n}\n\n/**\n * Get all registered and enabled contacts menu actions for the given menu entry.\n *\n * @param entry - The contacts menu entry object as returned by the backend\n */\nexport function getEnabledContactsMenuActions(entry: ContactsMenuEntry): ContactsMenuAction[] {\n\tif (!window._nc_contacts_menu_hooks) {\n\t\treturn []\n\t}\n\n\treturn Object.values(window._nc_contacts_menu_hooks).filter((action) => action.enabled(entry))\n}\n"],"names":[],"mappings":";AAuCO,SAAS,2BAA2B,QAAkC;AAC5E,SAAO,4BAA4B,CAAA;AAEnC,MAAI,OAAO,wBAAwB,OAAO,EAAE,GAAG;AAC9C,WAAO,MAAM,8BAA8B,OAAO,EAAE,gCAAgC;AAAA,MACnF;AAAA,IAAA,CACA;AACD;AAAA,EACD;AAEA,SAAO,wBAAwB,OAAO,EAAE,IAAI;AAC7C;AAOO,SAAS,8BAA8B,OAAgD;AAC7F,MAAI,CAAC,OAAO,yBAAyB;AACpC,WAAO,CAAA;AAAA,EACR;AAEA,SAAO,OAAO,OAAO,OAAO,uBAAuB,EAAE,OAAO,CAAC,WAAW,OAAO,QAAQ,KAAK,CAAC;AAC9F;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/functions/dialog/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Component } from 'vue'\nimport { createApp } from 'vue'\n\ntype ComponentProps<T extends Component> = T extends new (...args: any) => { $props: infer P }\n\t? P\n\t: never\n\ntype DialogComponent<T extends Component> = 'onClose' extends keyof ComponentProps<T>\n\t? T\n\t: 'Please provide a Dialog Component that supports `@close` event'\n\n/**\n * Event payload array normalized to a single value when payload has only one argument,\n * including one optional argument\n */\ntype NormalizedPayload<T> = T extends []\n\t? void\n\t: T extends [infer F]\n\t\t? F\n\t\t: T extends { length: 0 | 1, 0?: infer F }\n\t\t\t? F | undefined\n\t\t\t: T\n\ntype ClosePayload<T> = T extends { onClose?: (...args: infer P) => any }\n\t? P\n\t: never\n\ntype SpawnDialogOptions = {\n\t/**\n\t * Container to mount the dialog to\n\t * @default document.body\n\t */\n\tcontainer?: Element | string\n}\n\n/**\n * Spawn a single-use Vue dialog instance to get the result when it is closed\n *\n * @param dialog - Dialog component to spawn\n * @param props - Props to pass to the dialog instance\n * @param options - Spawning options\n * @return Promise resolved with the `close` event payload\n */\nexport function spawnDialog<\n\tC extends Component,\n\tE extends ClosePayload<ComponentProps<C>>,\n>(dialog: DialogComponent<C>, props: Partial<ComponentProps<C>> = {}, options: SpawnDialogOptions = {}): Promise<NormalizedPayload<E>> {\n\tlet { container } = options\n\n\t// For backwards compatibility try to use container from props\n\tif ('container' in props && typeof props.container === 'string') {\n\t\tcontainer ??= props.container\n\t}\n\n\t// Resolve container to an Element or fallback to document.body\n\tconst resolvedContainer = (typeof container === 'string' && document.querySelector(container)) || document.body\n\n\t// Create root container element for the dialog\n\tconst element = resolvedContainer.appendChild(document.createElement('div'))\n\n\treturn new Promise((resolve, reject) => {\n\t\tconst app = createApp(dialog as Component, {\n\t\t\t...props,\n\t\t\t// If dialog has no `container` prop passing a falsy value does nothing\n\t\t\t// Otherwise it is expected that `null` disables teleport and mounts dialog in place like NcDialog/NcModal\n\t\t\tcontainer: null,\n\t\t\tonClose(...rest: E) {\n\t\t\t\tconst payload = (rest.length > 1 ? rest : rest[0]) as NormalizedPayload<E>\n\n\t\t\t\tapp.unmount()\n\t\t\t\telement.remove()\n\t\t\t\tresolve(payload)\n\t\t\t},\n\t\t\t'onVue:unmounted'() {\n\t\t\t\tapp.unmount()\n\t\t\t\telement.remove()\n\t\t\t\treject(new Error('Dialog was unmounted without close event'))\n\t\t\t},\n\t\t})\n\n\t\tapp.mount(element)\n\t})\n}\n"],"names":[],"mappings":";AAiDO,SAAS,YAGd,QAA4B,QAAoC,CAAA,GAAI,UAA8B,CAAA,GAAmC;
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/functions/dialog/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type { Component } from 'vue'\nimport { createApp } from 'vue'\n\ntype ComponentProps<T extends Component> = T extends new (...args: any) => { $props: infer P }\n\t? P\n\t: never\n\ntype DialogComponent<T extends Component> = 'onClose' extends keyof ComponentProps<T>\n\t? T\n\t: 'Please provide a Dialog Component that supports `@close` event'\n\n/**\n * Event payload array normalized to a single value when payload has only one argument,\n * including one optional argument\n */\ntype NormalizedPayload<T> = T extends []\n\t? void\n\t: T extends [infer F]\n\t\t? F\n\t\t: T extends { length: 0 | 1, 0?: infer F }\n\t\t\t? F | undefined\n\t\t\t: T\n\ntype ClosePayload<T> = T extends { onClose?: (...args: infer P) => any }\n\t? P\n\t: never\n\ntype SpawnDialogOptions = {\n\t/**\n\t * Container to mount the dialog to\n\t * @default document.body\n\t */\n\tcontainer?: Element | string\n}\n\n/**\n * Spawn a single-use Vue dialog instance to get the result when it is closed\n *\n * @param dialog - Dialog component to spawn\n * @param props - Props to pass to the dialog instance\n * @param options - Spawning options\n * @return Promise resolved with the `close` event payload\n */\nexport function spawnDialog<\n\tC extends Component,\n\tE extends ClosePayload<ComponentProps<C>>,\n>(dialog: DialogComponent<C>, props: Partial<ComponentProps<C>> = {}, options: SpawnDialogOptions = {}): Promise<NormalizedPayload<E>> {\n\tlet { container } = options\n\n\t// For backwards compatibility try to use container from props\n\tif ('container' in props && typeof props.container === 'string') {\n\t\tcontainer ??= props.container\n\t}\n\n\t// Resolve container to an Element or fallback to document.body\n\tconst resolvedContainer = (typeof container === 'string' && document.querySelector(container)) || document.body\n\n\t// Create root container element for the dialog\n\tconst element = resolvedContainer.appendChild(document.createElement('div'))\n\n\treturn new Promise((resolve, reject) => {\n\t\tconst app = createApp(dialog as Component, {\n\t\t\t...props,\n\t\t\t// If dialog has no `container` prop passing a falsy value does nothing\n\t\t\t// Otherwise it is expected that `null` disables teleport and mounts dialog in place like NcDialog/NcModal\n\t\t\tcontainer: null,\n\t\t\tonClose(...rest: E) {\n\t\t\t\tconst payload = (rest.length > 1 ? rest : rest[0]) as NormalizedPayload<E>\n\n\t\t\t\tapp.unmount()\n\t\t\t\telement.remove()\n\t\t\t\tresolve(payload)\n\t\t\t},\n\t\t\t'onVue:unmounted'() {\n\t\t\t\tapp.unmount()\n\t\t\t\telement.remove()\n\t\t\t\treject(new Error('Dialog was unmounted without close event'))\n\t\t\t},\n\t\t})\n\n\t\tapp.mount(element)\n\t})\n}\n"],"names":[],"mappings":";AAiDO,SAAS,YAGd,QAA4B,QAAoC,CAAA,GAAI,UAA8B,CAAA,GAAmC;AACtI,MAAI,EAAE,cAAc;AAGpB,MAAI,eAAe,SAAS,OAAO,MAAM,cAAc,UAAU;AAChE,kBAAc,MAAM;AAAA,EACrB;AAGA,QAAM,oBAAqB,OAAO,cAAc,YAAY,SAAS,cAAc,SAAS,KAAM,SAAS;AAG3G,QAAM,UAAU,kBAAkB,YAAY,SAAS,cAAc,KAAK,CAAC;AAE3E,SAAO,IAAI,QAAQ,CAAC,SAAS,WAAW;AACvC,UAAM,MAAM,UAAU,QAAqB;AAAA,MAC1C,GAAG;AAAA;AAAA;AAAA,MAGH,WAAW;AAAA,MACX,WAAW,MAAS;AACnB,cAAM,UAAW,KAAK,SAAS,IAAI,OAAO,KAAK,CAAC;AAEhD,YAAI,QAAA;AACJ,gBAAQ,OAAA;AACR,gBAAQ,OAAO;AAAA,MAChB;AAAA,MACA,oBAAoB;AACnB,YAAI,QAAA;AACJ,gBAAQ,OAAA;AACR,eAAO,IAAI,MAAM,0CAA0C,CAAC;AAAA,MAC7D;AAAA,IAAA,CACA;AAED,QAAI,MAAM,OAAO;AAAA,EAClB,CAAC;AACF;"}
|
|
@@ -8,5 +8,5 @@ export * from './dialog/index.ts';
|
|
|
8
8
|
export * from './emoji/index.ts';
|
|
9
9
|
export * from './isDarkTheme/index.ts';
|
|
10
10
|
export * from './preloadImage/index.ts';
|
|
11
|
-
export * from './reference/index.
|
|
12
|
-
export
|
|
11
|
+
export * from './reference/index.ts';
|
|
12
|
+
export * from './usernameToColor/index.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/functions/isDarkTheme/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\n/**\n * Check whether the dark theme is used on a specific element\n * @param el - Element to check for dark theme, which is used for `data-theme-*` checking (default is `document.body`)\n * @return {boolean} - Whether the dark theme is enabled via Nextcloud theme\n */\nexport function checkIfDarkTheme(el: HTMLElement = document.body): boolean {\n\t// Nextcloud uses --background-invert-if-dark for dark theme filters in CSS\n\t// Values:\n\t// - 'invert(100%)' for dark theme\n\t// - 'no' for light theme\n\t// This is the most reliable way to check for dark theme, including custom themes\n\tconst backgroundInvertIfDark = window.getComputedStyle(el).getPropertyValue('--background-invert-if-dark')\n\tif (backgroundInvertIfDark !== undefined) {\n\t\treturn backgroundInvertIfDark === 'invert(100%)'\n\t}\n\n\t// There is no theme? Fallback to the light theme\n\treturn false\n}\n\n/**\n * Whether the dark theme is enabled in Nextcloud.\n * The variable is defined on page load and not reactive.\n * Use `checkIfDarkTheme` if you need to check it at a specific moment.\n * Use `useDarkTheme` if you need a reactive variable in a Vue component.\n */\nexport const isDarkTheme = checkIfDarkTheme()\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/functions/isDarkTheme/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\n/**\n * Check whether the dark theme is used on a specific element\n * @param el - Element to check for dark theme, which is used for `data-theme-*` checking (default is `document.body`)\n * @return {boolean} - Whether the dark theme is enabled via Nextcloud theme\n */\nexport function checkIfDarkTheme(el: HTMLElement = document.body): boolean {\n\t// Nextcloud uses --background-invert-if-dark for dark theme filters in CSS\n\t// Values:\n\t// - 'invert(100%)' for dark theme\n\t// - 'no' for light theme\n\t// This is the most reliable way to check for dark theme, including custom themes\n\tconst backgroundInvertIfDark = window.getComputedStyle(el).getPropertyValue('--background-invert-if-dark')\n\tif (backgroundInvertIfDark !== undefined) {\n\t\treturn backgroundInvertIfDark === 'invert(100%)'\n\t}\n\n\t// There is no theme? Fallback to the light theme\n\treturn false\n}\n\n/**\n * Whether the dark theme is enabled in Nextcloud.\n * The variable is defined on page load and not reactive.\n * Use `checkIfDarkTheme` if you need to check it at a specific moment.\n * Use `useDarkTheme` if you need a reactive variable in a Vue component.\n */\nexport const isDarkTheme = checkIfDarkTheme()\n"],"names":[],"mappings":"AAUO,SAAS,iBAAiB,KAAkB,SAAS,MAAe;AAM1E,QAAM,yBAAyB,OAAO,iBAAiB,EAAE,EAAE,iBAAiB,6BAA6B;AACzG,MAAI,2BAA2B,QAAW;AACzC,WAAO,2BAA2B;AAAA,EACnC;AAGA,SAAO;AACR;AAQO,MAAM,cAAc,iBAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/functions/preloadImage/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport PQueue from 'p-queue'\n\nconst queue = new PQueue({ concurrency: 5 })\n\n/**\n * Preload an image URL\n * @param url URL of the image\n */\nexport function preloadImage(url: string): Promise<boolean> {\n\tconst { resolve, promise } = Promise.withResolvers<boolean>()\n\tqueue.add(() => {\n\t\tconst image = new Image()\n\t\timage.onerror = () => resolve(false)\n\t\timage.onload = () => resolve(true)\n\t\timage.src = url\n\t\treturn promise\n\t})\n\n\treturn promise\n}\n"],"names":[],"mappings":";AAOA,MAAM,QAAQ,IAAI,OAAO,EAAE,aAAa,GAAG;AAMpC,SAAS,aAAa,KAA+B;AAC3D,QAAM,EAAE,SAAS,YAAY,QAAQ,
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/functions/preloadImage/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport PQueue from 'p-queue'\n\nconst queue = new PQueue({ concurrency: 5 })\n\n/**\n * Preload an image URL\n * @param url URL of the image\n */\nexport function preloadImage(url: string): Promise<boolean> {\n\tconst { resolve, promise } = Promise.withResolvers<boolean>()\n\tqueue.add(() => {\n\t\tconst image = new Image()\n\t\timage.onerror = () => resolve(false)\n\t\timage.onload = () => resolve(true)\n\t\timage.src = url\n\t\treturn promise\n\t})\n\n\treturn promise\n}\n"],"names":[],"mappings":";AAOA,MAAM,QAAQ,IAAI,OAAO,EAAE,aAAa,GAAG;AAMpC,SAAS,aAAa,KAA+B;AAC3D,QAAM,EAAE,SAAS,YAAY,QAAQ,cAAA;AACrC,QAAM,IAAI,MAAM;AACf,UAAM,QAAQ,IAAI,MAAA;AAClB,UAAM,UAAU,MAAM,QAAQ,KAAK;AACnC,UAAM,SAAS,MAAM,QAAQ,IAAI;AACjC,UAAM,MAAM;AACZ,WAAO;AAAA,EACR,CAAC;AAED,SAAO;AACR;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { N, h, f, i, b, r, c, a } from "../../chunks/customPickerElements-
|
|
2
|
-
import { d, g, a as a2, b as b2, c as c2, s } from "../../chunks/referencePickerModal-
|
|
1
|
+
import { N, h, f, i, b, r, c, a } from "../../chunks/customPickerElements-BmkXSNdO.mjs";
|
|
2
|
+
import { d, g, a as a2, b as b2, c as c2, s } from "../../chunks/referencePickerModal-BtI-8rNN.mjs";
|
|
3
3
|
export {
|
|
4
4
|
N as NcCustomPickerRenderResult,
|
|
5
5
|
d as anyLinkProviderId,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { N, e, d, g, f, i, b, r, c, a } from "../../chunks/customPickerElements-
|
|
1
|
+
import { N, e, d, g, f, i, b, r, c, a } from "../../chunks/customPickerElements-BmkXSNdO.mjs";
|
|
2
2
|
export {
|
|
3
3
|
N as NcCustomPickerRenderResult,
|
|
4
4
|
e as destroyCustomPickerElement,
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
import { Color } from '../../utils/colors.ts';
|
|
1
2
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
3
|
+
* Generate a color from a username
|
|
4
|
+
*
|
|
5
|
+
* @param username - Display name or user id to generate from
|
|
6
|
+
* @return The RGB color
|
|
4
7
|
*/
|
|
5
|
-
export
|
|
8
|
+
export declare function usernameToColor(username: string): Color;
|
|
@@ -1,5 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { g as generatePalette } from "../../chunks/colors-B71CwSnx.mjs";
|
|
2
|
+
function hashCode(str) {
|
|
3
|
+
let hash = 0;
|
|
4
|
+
if (str.length === 0) {
|
|
5
|
+
return hash;
|
|
6
|
+
}
|
|
7
|
+
for (let i = 0; i < str.length; i++) {
|
|
8
|
+
const chr = str.charCodeAt(i);
|
|
9
|
+
hash = (hash << 5) - hash + chr;
|
|
10
|
+
}
|
|
11
|
+
return Math.abs(hash);
|
|
12
|
+
}
|
|
13
|
+
function usernameToColor(username) {
|
|
14
|
+
const steps = 6;
|
|
15
|
+
const finalPalette = generatePalette(steps);
|
|
16
|
+
const hash = hashCode(username.toLocaleLowerCase());
|
|
17
|
+
return finalPalette[hash % finalPalette.length];
|
|
18
|
+
}
|
|
2
19
|
export {
|
|
3
|
-
|
|
20
|
+
usernameToColor
|
|
4
21
|
};
|
|
5
22
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/functions/usernameToColor/index.ts"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport type { Color } from '../../utils/colors.ts'\n\nimport { generatePalette } from '../../utils/colors.ts'\n\n/**\n * Create a simple hash from a string\n * @param str - The string to hash\n */\nfunction hashCode(str: string): number {\n\tlet hash = 0\n\n\tif (str.length === 0) {\n\t\treturn hash\n\t}\n\n\tfor (let i = 0; i < str.length; i++) {\n\t\tconst chr = str.charCodeAt(i)\n\t\thash = ((hash << 5) - hash) + chr\n\t}\n\n\treturn Math.abs(hash)\n}\n\n/**\n * Generate a color from a username\n *\n * @param username - Display name or user id to generate from\n * @return The RGB color\n */\nexport function usernameToColor(username: string): Color {\n\tconst steps = 6\n\tconst finalPalette = generatePalette(steps)\n\tconst hash = hashCode(username.toLocaleLowerCase())\n\n\treturn finalPalette[hash % finalPalette.length]!\n}\n"],"names":[],"mappings":";AAaA,SAAS,SAAS,KAAqB;AACtC,MAAI,OAAO;AAEX,MAAI,IAAI,WAAW,GAAG;AACrB,WAAO;AAAA,EACR;AAEA,WAAS,IAAI,GAAG,IAAI,IAAI,QAAQ,KAAK;AACpC,UAAM,MAAM,IAAI,WAAW,CAAC;AAC5B,YAAS,QAAQ,KAAK,OAAQ;AAAA,EAC/B;AAEA,SAAO,KAAK,IAAI,IAAI;AACrB;AAQO,SAAS,gBAAgB,UAAyB;AACxD,QAAM,QAAQ;AACd,QAAM,eAAe,gBAAgB,KAAK;AAC1C,QAAM,OAAO,SAAS,SAAS,kBAAA,CAAmB;AAElD,SAAO,aAAa,OAAO,aAAa,MAAM;AAC/C;"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,95 +1,96 @@
|
|
|
1
|
-
import { N } from "./chunks/NcActionButton-
|
|
2
|
-
import { N as N2 } from "./chunks/NcActionButtonGroup-
|
|
1
|
+
import { N } from "./chunks/NcActionButton-k1JvZ5eE.mjs";
|
|
2
|
+
import { N as N2 } from "./chunks/NcActionButtonGroup-WjVxibM-.mjs";
|
|
3
3
|
import { N as N3 } from "./chunks/NcActionCaption-Fumfjzxj.mjs";
|
|
4
4
|
import { N as N4 } from "./chunks/NcActionCheckbox-DLPDTACR.mjs";
|
|
5
|
-
import { N as N5 } from "./chunks/NcActionInput-
|
|
5
|
+
import { N as N5 } from "./chunks/NcActionInput-Cu77Jgzr.mjs";
|
|
6
6
|
import { N as N6 } from "./chunks/NcActionLink-BEo7zmXX.mjs";
|
|
7
7
|
import { N as N7 } from "./chunks/NcActionRadio-CPoWB58D.mjs";
|
|
8
8
|
import { N as N8 } from "./chunks/NcActionRouter-ERoQjJKv.mjs";
|
|
9
|
-
import { N as N9 } from "./chunks/NcActions-
|
|
9
|
+
import { N as N9 } from "./chunks/NcActions-CDD8eIxC.mjs";
|
|
10
10
|
import { N as N10 } from "./chunks/NcActionSeparator-Doekl1NX.mjs";
|
|
11
11
|
import { N as N11 } from "./chunks/NcActionText-16Mj4-P1.mjs";
|
|
12
|
-
import { N as N12 } from "./chunks/NcActionTextEditable-
|
|
13
|
-
import { N as N13 } from "./chunks/NcAppContent-
|
|
12
|
+
import { N as N12 } from "./chunks/NcActionTextEditable-BLkdbR1d.mjs";
|
|
13
|
+
import { N as N13 } from "./chunks/NcAppContent-BuPSAcBt.mjs";
|
|
14
14
|
import { _ } from "./chunks/NcAppContentDetails.vue_vue_type_script_setup_true_lang-Dnf4r_Ng.mjs";
|
|
15
15
|
import { N as N14 } from "./chunks/NcAppContentList-DnLY_sWw.mjs";
|
|
16
|
-
import { N as N15 } from "./chunks/NcAppNavigation-
|
|
17
|
-
import { N as N16 } from "./chunks/NcAppNavigationCaption-
|
|
16
|
+
import { N as N15 } from "./chunks/NcAppNavigation-ByAPTGke.mjs";
|
|
17
|
+
import { N as N16 } from "./chunks/NcAppNavigationCaption-SJPzGdtT.mjs";
|
|
18
18
|
import { N as N17 } from "./chunks/NcAppNavigationIconBullet-B1kc4u65.mjs";
|
|
19
|
-
import { N as N18 } from "./chunks/NcAppNavigationItem-
|
|
19
|
+
import { N as N18 } from "./chunks/NcAppNavigationItem-0xVXJPEm.mjs";
|
|
20
20
|
import { N as N19 } from "./chunks/NcAppNavigationList-DX_Yo23V.mjs";
|
|
21
|
-
import { N as N20 } from "./chunks/NcAppNavigationNew-
|
|
22
|
-
import { N as N21 } from "./chunks/NcAppNavigationNewItem-
|
|
23
|
-
import { N as N22 } from "./chunks/NcAppNavigationSearch-
|
|
24
|
-
import { N as N23 } from "./chunks/NcAppNavigationSettings-
|
|
21
|
+
import { N as N20 } from "./chunks/NcAppNavigationNew-CjJgIwfl.mjs";
|
|
22
|
+
import { N as N21 } from "./chunks/NcAppNavigationNewItem-BCFq6zq8.mjs";
|
|
23
|
+
import { N as N22 } from "./chunks/NcAppNavigationSearch-Bnr0rygy.mjs";
|
|
24
|
+
import { N as N23 } from "./chunks/NcAppNavigationSettings-CM0_QsTH.mjs";
|
|
25
25
|
import { N as N24 } from "./chunks/NcAppNavigationSpacer-BvkBfuVw.mjs";
|
|
26
|
-
import { N as N25 } from "./chunks/NcAppSettingsDialog-
|
|
26
|
+
import { N as N25 } from "./chunks/NcAppSettingsDialog-DBI8-FZa.mjs";
|
|
27
27
|
import { N as N26 } from "./chunks/NcAppSettingsSection-CssmXyZ0.mjs";
|
|
28
|
-
import { N as N27 } from "./chunks/NcAppSidebar-
|
|
28
|
+
import { N as N27 } from "./chunks/NcAppSidebar-CyyFi0n6.mjs";
|
|
29
29
|
import { _ as _2 } from "./chunks/NcAppSidebarHeader.vue_vue_type_script_setup_true_lang-0j0aFDeK.mjs";
|
|
30
30
|
import { N as N28 } from "./chunks/NcAppSidebarTab-D1RmFRTu.mjs";
|
|
31
|
-
import { N as N29 } from "./chunks/NcAvatar-
|
|
31
|
+
import { N as N29 } from "./chunks/NcAvatar-CnRCSalb.mjs";
|
|
32
32
|
import { N as N30 } from "./chunks/NcBlurHash-BiFktE2N.mjs";
|
|
33
|
-
import { N as N31 } from "./chunks/NcBreadcrumb-
|
|
34
|
-
import { N as N32 } from "./chunks/NcBreadcrumbs-
|
|
35
|
-
import { N as N33 } from "./chunks/NcButton-
|
|
36
|
-
import { N as N34 } from "./chunks/NcCheckboxRadioSwitch-
|
|
37
|
-
import { N as N35 } from "./chunks/NcChip-
|
|
38
|
-
import { N as N36 } from "./chunks/NcCollectionList-
|
|
39
|
-
import { N as N37 } from "./chunks/NcColorPicker-
|
|
40
|
-
import { N as N38 } from "./chunks/NcContent-
|
|
41
|
-
import { N as N39 } from "./chunks/NcCounterBubble-
|
|
42
|
-
import { N as N40 } from "./chunks/NcDashboardWidget-
|
|
43
|
-
import { N as N41 } from "./chunks/NcDashboardWidgetItem-
|
|
33
|
+
import { N as N31 } from "./chunks/NcBreadcrumb-B97vQkN2.mjs";
|
|
34
|
+
import { N as N32 } from "./chunks/NcBreadcrumbs-CvUgliJa.mjs";
|
|
35
|
+
import { N as N33 } from "./chunks/NcButton-BMnvzy1A.mjs";
|
|
36
|
+
import { N as N34 } from "./chunks/NcCheckboxRadioSwitch-Da0F7y0G.mjs";
|
|
37
|
+
import { N as N35 } from "./chunks/NcChip-DuaqxToL.mjs";
|
|
38
|
+
import { N as N36 } from "./chunks/NcCollectionList-Cr0T14g-.mjs";
|
|
39
|
+
import { N as N37 } from "./chunks/NcColorPicker-D6g3v7Qc.mjs";
|
|
40
|
+
import { N as N38 } from "./chunks/NcContent-DV3z9w_V.mjs";
|
|
41
|
+
import { N as N39 } from "./chunks/NcCounterBubble-Bop3e-Tr.mjs";
|
|
42
|
+
import { N as N40 } from "./chunks/NcDashboardWidget-Wkx_9xKh.mjs";
|
|
43
|
+
import { N as N41 } from "./chunks/NcDashboardWidgetItem-CMrxp0Lc.mjs";
|
|
44
44
|
import { _ as _3 } from "./chunks/NcDateTime.vue_vue_type_script_setup_true_lang-B0Lci6v0.mjs";
|
|
45
|
-
import { N as N42 } from "./chunks/NcDateTimePicker-
|
|
46
|
-
import { N as N43 } from "./chunks/NcDateTimePickerNative-
|
|
47
|
-
import { N as N44 } from "./chunks/NcDialog-
|
|
48
|
-
import { _ as _4 } from "./chunks/NcDialogButton.vue_vue_type_script_setup_true_lang-
|
|
45
|
+
import { N as N42 } from "./chunks/NcDateTimePicker-BarX7J-6.mjs";
|
|
46
|
+
import { N as N43 } from "./chunks/NcDateTimePickerNative-BOoA1aEf.mjs";
|
|
47
|
+
import { N as N44 } from "./chunks/NcDialog-IKWAQK-K.mjs";
|
|
48
|
+
import { _ as _4 } from "./chunks/NcDialogButton.vue_vue_type_script_setup_true_lang-BT66zCa4.mjs";
|
|
49
49
|
import { N as N45 } from "./chunks/NcEllipsisedOption-C8uNDC-j.mjs";
|
|
50
|
-
import { N as N46 } from "./chunks/NcEmojiPicker-
|
|
50
|
+
import { N as N46 } from "./chunks/NcEmojiPicker-DL9u7r5m.mjs";
|
|
51
51
|
import { N as N47 } from "./chunks/NcEmptyContent-BdOezubv.mjs";
|
|
52
|
-
import { N as N48 } from "./chunks/NcGuestContent-
|
|
53
|
-
import { N as N49 } from "./chunks/NcHeaderButton-
|
|
54
|
-
import { N as N50 } from "./chunks/NcHeaderMenu-
|
|
52
|
+
import { N as N48 } from "./chunks/NcGuestContent-CfCh49o0.mjs";
|
|
53
|
+
import { N as N49 } from "./chunks/NcHeaderButton-DAxGG1vc.mjs";
|
|
54
|
+
import { N as N50 } from "./chunks/NcHeaderMenu-DcBWHaZv.mjs";
|
|
55
55
|
import { _ as _5 } from "./chunks/NcHighlight.vue_vue_type_script_lang-DnWQDM_2.mjs";
|
|
56
56
|
import { N as N51 } from "./chunks/NcIconSvgWrapper-CprKb_SE.mjs";
|
|
57
|
-
import { N as N52 } from "./chunks/NcInputField-
|
|
58
|
-
import { N as N53 } from "./chunks/NcListItem-
|
|
59
|
-
import { N as N54 } from "./chunks/NcListItemIcon-
|
|
60
|
-
import { N as N55 } from "./chunks/NcLoadingIcon-
|
|
61
|
-
import { N as N56 } from "./chunks/NcModal-
|
|
62
|
-
import { N as N57 } from "./chunks/NcNoteCard-
|
|
63
|
-
import { N as N58 } from "./chunks/NcPasswordField-
|
|
64
|
-
import { N as N59 } from "./chunks/NcPopover-
|
|
65
|
-
import { N as N60 } from "./chunks/NcProgressBar-
|
|
66
|
-
import { N as N61 } from "./chunks/NcRelatedResourcesPanel-
|
|
67
|
-
import { a, N as N62, b } from "./chunks/NcRichContenteditable-
|
|
68
|
-
import { N as N63 } from "./chunks/NcRichText-
|
|
69
|
-
import { N as N64, h, f, i, b as b2, r, c, a as a2 } from "./chunks/customPickerElements-
|
|
57
|
+
import { N as N52 } from "./chunks/NcInputField-Cz1RwzSy.mjs";
|
|
58
|
+
import { N as N53 } from "./chunks/NcListItem-CwAOX69Q.mjs";
|
|
59
|
+
import { N as N54 } from "./chunks/NcListItemIcon-26IdztJ2.mjs";
|
|
60
|
+
import { N as N55 } from "./chunks/NcLoadingIcon-CiMp51wb.mjs";
|
|
61
|
+
import { N as N56 } from "./chunks/NcModal-CdXZncEM.mjs";
|
|
62
|
+
import { N as N57 } from "./chunks/NcNoteCard-C8JB31rn.mjs";
|
|
63
|
+
import { N as N58 } from "./chunks/NcPasswordField-BlbWNpfS.mjs";
|
|
64
|
+
import { N as N59 } from "./chunks/NcPopover-Zs7qt_Zd.mjs";
|
|
65
|
+
import { N as N60 } from "./chunks/NcProgressBar-Ds0zTPYX.mjs";
|
|
66
|
+
import { N as N61 } from "./chunks/NcRelatedResourcesPanel-DBOgpeIK.mjs";
|
|
67
|
+
import { a, N as N62, b } from "./chunks/NcRichContenteditable-BmrCeWNL.mjs";
|
|
68
|
+
import { N as N63 } from "./chunks/NcRichText-G8kzsdwx.mjs";
|
|
69
|
+
import { N as N64, h, f, i, b as b2, r, c, a as a2 } from "./chunks/customPickerElements-BmkXSNdO.mjs";
|
|
70
70
|
import "@vueuse/core";
|
|
71
71
|
import "vue";
|
|
72
72
|
import "vue-router";
|
|
73
|
-
import { d, g, a as a3, b as b3, c as c2, s } from "./chunks/referencePickerModal-
|
|
74
|
-
import "./chunks/autolink-
|
|
73
|
+
import { d, g, a as a3, b as b3, c as c2, s } from "./chunks/referencePickerModal-BtI-8rNN.mjs";
|
|
74
|
+
import "./chunks/autolink-Y0rlJ_CI.mjs";
|
|
75
75
|
import "@nextcloud/axios";
|
|
76
76
|
import "@nextcloud/sharing/public";
|
|
77
77
|
import "@nextcloud/auth";
|
|
78
78
|
import "@nextcloud/router";
|
|
79
|
-
import { N as N65 } from "./chunks/NcSelect-
|
|
80
|
-
import
|
|
79
|
+
import { N as N65 } from "./chunks/NcSelect-C6qHqfAO.mjs";
|
|
80
|
+
import "debounce";
|
|
81
|
+
import { _ as _6 } from "./chunks/NcTextField.vue_vue_type_script_setup_true_lang-DzcUUWHO.mjs";
|
|
81
82
|
import "@nextcloud/event-bus";
|
|
82
|
-
import { _ as _7 } from "./chunks/NcSavingIndicatorIcon.vue_vue_type_script_setup_true_lang-
|
|
83
|
-
import { N as N66 } from "./chunks/NcSelectTags-
|
|
84
|
-
import { N as N67 } from "./chunks/NcSelectUsers-
|
|
85
|
-
import { N as N68 } from "./chunks/NcSettingsInputText-
|
|
86
|
-
import { N as N69 } from "./chunks/NcSettingsSection-
|
|
87
|
-
import { N as N70 } from "./chunks/NcSettingsSelectGroup-
|
|
88
|
-
import { N as N71 } from "./chunks/NcTextArea-
|
|
83
|
+
import { _ as _7 } from "./chunks/NcSavingIndicatorIcon.vue_vue_type_script_setup_true_lang-jUf1K561.mjs";
|
|
84
|
+
import { N as N66 } from "./chunks/NcSelectTags-Capp69AW.mjs";
|
|
85
|
+
import { N as N67 } from "./chunks/NcSelectUsers-BVn8co_d.mjs";
|
|
86
|
+
import { N as N68 } from "./chunks/NcSettingsInputText-C8Gtj3Ht.mjs";
|
|
87
|
+
import { N as N69 } from "./chunks/NcSettingsSection-CtSg7lH8.mjs";
|
|
88
|
+
import { N as N70 } from "./chunks/NcSettingsSelectGroup-C1DEcBNJ.mjs";
|
|
89
|
+
import { N as N71 } from "./chunks/NcTextArea-BAl6EP4Z.mjs";
|
|
89
90
|
import { _ as _8 } from "./chunks/NcThemeProvider.vue_vue_type_script_setup_true_lang-nUDJsDGI.mjs";
|
|
90
|
-
import { _ as _9 } from "./chunks/NcTimezonePicker.vue_vue_type_script_setup_true_lang-
|
|
91
|
-
import { N as N72 } from "./chunks/NcUserBubble-
|
|
92
|
-
import { N as N73 } from "./chunks/NcUserStatusIcon-
|
|
91
|
+
import { _ as _9 } from "./chunks/NcTimezonePicker.vue_vue_type_script_setup_true_lang-Dsco6qEJ.mjs";
|
|
92
|
+
import { N as N72 } from "./chunks/NcUserBubble-CqKN_gM4.mjs";
|
|
93
|
+
import { N as N73 } from "./chunks/NcUserStatusIcon-CDEUKK60.mjs";
|
|
93
94
|
import { _ as _10 } from "./chunks/NcVNodes.vue_vue_type_script_lang-BqUHinRZ.mjs";
|
|
94
95
|
import { useFormatRelativeTime, useFormatTime } from "./composables/useFormatDateTime/index.mjs";
|
|
95
96
|
import { useHotKey } from "./composables/useHotKey/index.mjs";
|
|
@@ -102,7 +103,7 @@ import { spawnDialog } from "./functions/dialog/index.mjs";
|
|
|
102
103
|
import { E, a as a4, e, g as g2, s as s2 } from "./chunks/emoji-BY_D0V5K.mjs";
|
|
103
104
|
import { checkIfDarkTheme, isDarkTheme } from "./functions/isDarkTheme/index.mjs";
|
|
104
105
|
import { preloadImage } from "./functions/preloadImage/index.mjs";
|
|
105
|
-
import {
|
|
106
|
+
import { usernameToColor } from "./functions/usernameToColor/index.mjs";
|
|
106
107
|
import { default as default2 } from "./directives/Focus/index.mjs";
|
|
107
108
|
import { default as default3 } from "./directives/Linkify/index.mjs";
|
|
108
109
|
export {
|
|
@@ -228,6 +229,6 @@ export {
|
|
|
228
229
|
useIsFullscreen,
|
|
229
230
|
useIsMobile,
|
|
230
231
|
useIsSmallMobile,
|
|
231
|
-
|
|
232
|
+
usernameToColor
|
|
232
233
|
};
|
|
233
234
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/l10n.d.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/*!
|
|
2
|
+
* SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
|
|
3
|
+
* SPDX-License-Identifier: AGPL-3.0-or-later
|
|
4
|
+
*/
|
|
5
|
+
declare const n: (singular: string, plural: string, count: number, placeholders?: Record<string, string | number>) => string;
|
|
6
|
+
declare const t: (original: string, placeholders?: Record<string, string | number>) => string;
|
|
7
|
+
export { t, n };
|
|
@@ -13,6 +13,11 @@ export declare function getTrapStack(): FocusTrap[];
|
|
|
13
13
|
*
|
|
14
14
|
* When some component manually implements its own focus-trap without using global focus-trap stack,
|
|
15
15
|
* it also needs to pause the global stack to avoid conflict.
|
|
16
|
+
*
|
|
17
|
+
* Note: if global focus-trap stack was modified outside TrapStackController (likely due to user actions),
|
|
18
|
+
* trap queue should be correctly handled by focus-trap itself.
|
|
19
|
+
* It is no longer safe to unpause cached `pausedStack`, as it can disrupt the current focus trap state.
|
|
20
|
+
* We assume that the focus-trap stack is self-regulated and ignore unpause.
|
|
16
21
|
*/
|
|
17
22
|
export declare function createTrapStackController(): {
|
|
18
23
|
/**
|
|
@@ -21,6 +26,7 @@ export declare function createTrapStackController(): {
|
|
|
21
26
|
pause(): void;
|
|
22
27
|
/**
|
|
23
28
|
* Unpause the paused focus trap stack
|
|
29
|
+
* If the actual stack is different from the paused one, ignore unpause.
|
|
24
30
|
*/
|
|
25
31
|
unpause(): void;
|
|
26
32
|
};
|