@nextcloud/vue 8.11.0 → 8.11.2
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 +38 -1
- package/dist/Components/NcActionButtonGroup.cjs +1 -1
- package/dist/Components/NcActionButtonGroup.mjs +1 -1
- package/dist/Components/NcActionInput.cjs +1 -1
- package/dist/Components/NcActionInput.mjs +1 -1
- package/dist/Components/NcActions.cjs +1 -1
- package/dist/Components/NcActions.mjs +1 -1
- package/dist/Components/NcAppContent.cjs +1 -1
- package/dist/Components/NcAppContent.mjs +1 -1
- package/dist/Components/NcAppNavigation.cjs +1 -1
- package/dist/Components/NcAppNavigation.mjs +1 -1
- package/dist/Components/NcAppNavigationCaption.cjs +1 -1
- package/dist/Components/NcAppNavigationCaption.mjs +1 -1
- package/dist/Components/NcAppNavigationItem.cjs +1 -1
- package/dist/Components/NcAppNavigationItem.mjs +1 -1
- package/dist/Components/NcAppNavigationNewItem.cjs +1 -1
- package/dist/Components/NcAppNavigationNewItem.mjs +1 -1
- package/dist/Components/NcAppNavigationSettings.cjs +1 -1
- package/dist/Components/NcAppNavigationSettings.mjs +1 -1
- package/dist/Components/NcAppNavigationToggle.cjs +1 -1
- package/dist/Components/NcAppNavigationToggle.mjs +1 -1
- package/dist/Components/NcAppSettingsDialog.cjs +1 -1
- package/dist/Components/NcAppSettingsDialog.mjs +1 -1
- package/dist/Components/NcAppSidebar.cjs +1 -1
- package/dist/Components/NcAppSidebar.mjs +1 -1
- package/dist/Components/NcAvatar.cjs +1 -1
- package/dist/Components/NcAvatar.mjs +1 -1
- package/dist/Components/NcBreadcrumb.cjs +1 -1
- package/dist/Components/NcBreadcrumb.mjs +1 -1
- package/dist/Components/NcBreadcrumbs.cjs +1 -1
- package/dist/Components/NcBreadcrumbs.mjs +1 -1
- package/dist/Components/NcCheckboxRadioSwitch.cjs +1 -1
- package/dist/Components/NcCheckboxRadioSwitch.mjs +1 -1
- package/dist/Components/NcColorPicker.cjs +1 -1
- package/dist/Components/NcColorPicker.mjs +1 -1
- package/dist/Components/NcContent.cjs +1 -1
- package/dist/Components/NcContent.mjs +1 -1
- package/dist/Components/NcDashboardWidget.cjs +1 -1
- package/dist/Components/NcDashboardWidget.mjs +1 -1
- package/dist/Components/NcDashboardWidgetItem.cjs +1 -1
- package/dist/Components/NcDashboardWidgetItem.mjs +1 -1
- package/dist/Components/NcDateTime.cjs +1 -1
- package/dist/Components/NcDateTime.mjs +1 -1
- package/dist/Components/NcDateTimePicker.cjs +2 -2
- package/dist/Components/NcDateTimePicker.mjs +4 -4
- package/dist/Components/NcDateTimePickerNative.cjs +1 -1
- package/dist/Components/NcDateTimePickerNative.mjs +1 -1
- package/dist/Components/NcDialog.cjs +1 -1
- package/dist/Components/NcDialog.mjs +1 -1
- package/dist/Components/NcEmojiPicker.cjs +1 -1
- package/dist/Components/NcEmojiPicker.mjs +1 -1
- package/dist/Components/NcHeaderMenu.cjs +1 -1
- package/dist/Components/NcHeaderMenu.mjs +1 -1
- package/dist/Components/NcListItem.cjs +1 -1
- package/dist/Components/NcListItem.mjs +1 -1
- package/dist/Components/NcListItemIcon.cjs +1 -1
- package/dist/Components/NcListItemIcon.mjs +1 -1
- package/dist/Components/NcModal.cjs +1 -1
- package/dist/Components/NcModal.mjs +3 -3
- package/dist/Components/NcPasswordField.cjs +1 -1
- package/dist/Components/NcPasswordField.mjs +1 -1
- package/dist/Components/NcRelatedResourcesPanel.cjs +1 -1
- package/dist/Components/NcRelatedResourcesPanel.mjs +1 -1
- package/dist/Components/NcRichContenteditable.cjs +1 -1
- package/dist/Components/NcRichContenteditable.mjs +2 -2
- package/dist/Components/NcRichText.cjs +1 -1
- package/dist/Components/NcRichText.mjs +3 -3
- package/dist/Components/NcSelect.cjs +1 -1
- package/dist/Components/NcSelect.mjs +1 -1
- package/dist/Components/NcSelectTags.cjs +1 -1
- package/dist/Components/NcSelectTags.mjs +1 -1
- package/dist/Components/NcSettingsInputText.cjs +1 -1
- package/dist/Components/NcSettingsInputText.mjs +1 -1
- package/dist/Components/NcSettingsSection.cjs +1 -1
- package/dist/Components/NcSettingsSection.mjs +1 -1
- package/dist/Components/NcSettingsSelectGroup.cjs +1 -1
- package/dist/Components/NcSettingsSelectGroup.mjs +1 -1
- package/dist/Components/NcTextField.cjs +1 -1
- package/dist/Components/NcTextField.mjs +1 -1
- package/dist/Components/NcTimezonePicker.cjs +1 -1
- package/dist/Components/NcTimezonePicker.mjs +1 -1
- package/dist/Components/NcUserBubble.cjs +1 -1
- package/dist/Components/NcUserBubble.mjs +1 -1
- package/dist/Components/NcUserStatusIcon.cjs +1 -1
- package/dist/Components/NcUserStatusIcon.mjs +1 -1
- package/dist/Functions/reference.cjs +1 -1
- package/dist/Functions/reference.mjs +1 -1
- package/dist/Functions/usernameToColor.cjs +1 -1
- package/dist/Functions/usernameToColor.mjs +1 -1
- package/dist/Mixins/richEditor.cjs +1 -1
- package/dist/Mixins/richEditor.mjs +1 -1
- package/dist/assets/{NcActionInput-DjNK8ORa.css → NcActionInput-8F2WF3yH.css} +67 -67
- package/dist/assets/{NcActions-DL7ZZIjx.css → NcActions-CiiQkX9v.css} +12 -12
- package/dist/assets/{NcAppNavigation-BgGJuJPv.css → NcAppNavigation-wkQJnaLW.css} +12 -12
- package/dist/assets/{NcAppNavigationItem-BxoyzD83.css → NcAppNavigationItem-hYyNqvah.css} +44 -44
- package/dist/assets/{NcAppSidebar-BGQX62or.css → NcAppSidebar-DlVjDHcd.css} +45 -50
- package/dist/assets/{NcAvatar-j5b9vXAH.css → NcAvatar-BozWHt1s.css} +27 -27
- package/dist/assets/{NcBreadcrumbs-oFXQlxy-.css → NcBreadcrumbs-E-TglkuV.css} +7 -7
- package/dist/assets/{NcDateTimePicker-D8gouVII.css → NcDateTimePicker-q_BLnhHU.css} +10 -10
- package/dist/assets/{NcDialog-M36tj7nk.css → NcDialog-DEKSpcnR.css} +17 -16
- package/dist/assets/NcListItem-BIFTbr17.css +180 -0
- package/dist/assets/{NcMentionBubble-BhiXWJv8.css → NcMentionBubble-7PQ8wEko.css} +9 -9
- package/dist/assets/{NcRichContenteditable-DvTdg1DO.css → NcRichContenteditable-BQ2-fqnd.css} +10 -10
- package/dist/assets/{NcRichText-D2BBsB-_.css → NcRichText-DNXuHl34.css} +76 -65
- package/dist/chunks/{GenColors-SRrPRTFN.mjs → GenColors-Dceu3ds2.mjs} +1 -1
- package/dist/chunks/{GenColors-SRrPRTFN.mjs.map → GenColors-Dceu3ds2.mjs.map} +1 -1
- package/dist/chunks/{GenColors-BCHzPRPI.cjs → GenColors-hkqGpnOK.cjs} +1 -1
- package/dist/chunks/{GenColors-BCHzPRPI.cjs.map → GenColors-hkqGpnOK.cjs.map} +1 -1
- package/dist/chunks/{NcActionButtonGroup-Dc9G34Er.cjs → NcActionButtonGroup-B1XhnIBl.cjs} +1 -1
- package/dist/chunks/{NcActionButtonGroup-Dc9G34Er.cjs.map → NcActionButtonGroup-B1XhnIBl.cjs.map} +1 -1
- package/dist/chunks/{NcActionButtonGroup-BS4fKDux.mjs → NcActionButtonGroup-DU1taycQ.mjs} +1 -1
- package/dist/chunks/{NcActionButtonGroup-BS4fKDux.mjs.map → NcActionButtonGroup-DU1taycQ.mjs.map} +1 -1
- package/dist/chunks/{NcActionInput-B_upGNjs.mjs → NcActionInput-53RB9uQe.mjs} +6 -6
- package/dist/chunks/NcActionInput-53RB9uQe.mjs.map +1 -0
- package/dist/chunks/{NcActionInput-C6WR9W8-.cjs → NcActionInput-N2wrvq5K.cjs} +3 -3
- package/dist/chunks/NcActionInput-N2wrvq5K.cjs.map +1 -0
- package/dist/chunks/{NcActions-DL722iMU.cjs → NcActions-BtvXtZF4.cjs} +55 -35
- package/dist/chunks/{NcActions-ClU5w8U1.mjs.map → NcActions-BtvXtZF4.cjs.map} +1 -1
- package/dist/chunks/{NcActions-ClU5w8U1.mjs → NcActions-DiFslXqv.mjs} +84 -64
- package/dist/chunks/{NcActions-DL722iMU.cjs.map → NcActions-DiFslXqv.mjs.map} +1 -1
- package/dist/chunks/{NcAppContent-CZUuFw1x.mjs → NcAppContent-BDhK1rUf.mjs} +1 -1
- package/dist/chunks/{NcAppContent-CZUuFw1x.mjs.map → NcAppContent-BDhK1rUf.mjs.map} +1 -1
- package/dist/chunks/{NcAppContent-CyPht0ua.cjs → NcAppContent-Be1m1O_W.cjs} +1 -1
- package/dist/chunks/{NcAppContent-CyPht0ua.cjs.map → NcAppContent-Be1m1O_W.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigation-8_Bef_ph.mjs → NcAppNavigation-CElLRpH-.mjs} +3 -3
- package/dist/chunks/{NcAppNavigation-8_Bef_ph.mjs.map → NcAppNavigation-CElLRpH-.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigation-BPCfq5ox.cjs → NcAppNavigation-DKUnWfen.cjs} +3 -3
- package/dist/chunks/{NcAppNavigation-BPCfq5ox.cjs.map → NcAppNavigation-DKUnWfen.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationCaption-DNugUyEL.cjs → NcAppNavigationCaption-Cdcv-0jj.cjs} +1 -1
- package/dist/chunks/{NcAppNavigationCaption-DNugUyEL.cjs.map → NcAppNavigationCaption-Cdcv-0jj.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationCaption-DZl4aJXn.mjs → NcAppNavigationCaption-DI7SIPdI.mjs} +1 -1
- package/dist/chunks/{NcAppNavigationCaption-DZl4aJXn.mjs.map → NcAppNavigationCaption-DI7SIPdI.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationItem-znyy3LU1.cjs → NcAppNavigationItem-7xN_CMHW.cjs} +6 -8
- package/dist/chunks/{NcAppNavigationItem-D7L6HxhH.mjs.map → NcAppNavigationItem-7xN_CMHW.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationItem-D7L6HxhH.mjs → NcAppNavigationItem-Djfc0DPY.mjs} +8 -10
- package/dist/chunks/{NcAppNavigationItem-znyy3LU1.cjs.map → NcAppNavigationItem-Djfc0DPY.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationNewItem-DgPfNmx6.cjs → NcAppNavigationNewItem-5B4-U2NI.cjs} +1 -1
- package/dist/chunks/{NcAppNavigationNewItem-DgPfNmx6.cjs.map → NcAppNavigationNewItem-5B4-U2NI.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationNewItem-CRLPUH7B.mjs → NcAppNavigationNewItem-CN3vYnc_.mjs} +1 -1
- package/dist/chunks/{NcAppNavigationNewItem-CRLPUH7B.mjs.map → NcAppNavigationNewItem-CN3vYnc_.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationSettings-DPb0p_eD.cjs → NcAppNavigationSettings-Cnr4jYzW.cjs} +2 -2
- package/dist/chunks/{NcAppNavigationSettings-DPb0p_eD.cjs.map → NcAppNavigationSettings-Cnr4jYzW.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationSettings-EcktukV4.mjs → NcAppNavigationSettings-LmpAoM-x.mjs} +2 -2
- package/dist/chunks/{NcAppNavigationSettings-EcktukV4.mjs.map → NcAppNavigationSettings-LmpAoM-x.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationToggle-CSOgniTa.cjs → NcAppNavigationToggle-B5XmO21v.cjs} +1 -1
- package/dist/chunks/{NcAppNavigationToggle-CSOgniTa.cjs.map → NcAppNavigationToggle-B5XmO21v.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationToggle-DwO9-oiH.mjs → NcAppNavigationToggle-D0oeWL17.mjs} +1 -1
- package/dist/chunks/{NcAppNavigationToggle-DwO9-oiH.mjs.map → NcAppNavigationToggle-D0oeWL17.mjs.map} +1 -1
- package/dist/chunks/{NcAppSettingsDialog-EIsS0HU9.cjs → NcAppSettingsDialog-B6crPJ6a.cjs} +1 -1
- package/dist/chunks/{NcAppSettingsDialog-EIsS0HU9.cjs.map → NcAppSettingsDialog-B6crPJ6a.cjs.map} +1 -1
- package/dist/chunks/{NcAppSettingsDialog-fgbU_-h8.mjs → NcAppSettingsDialog-BLOgrVCz.mjs} +2 -2
- package/dist/chunks/{NcAppSettingsDialog-fgbU_-h8.mjs.map → NcAppSettingsDialog-BLOgrVCz.mjs.map} +1 -1
- package/dist/chunks/{NcAppSidebar-BbEflEtM.mjs → NcAppSidebar-CqER6-dl.mjs} +18 -12
- package/dist/chunks/NcAppSidebar-CqER6-dl.mjs.map +1 -0
- package/dist/chunks/{NcAppSidebar-DNAgJFfm.cjs → NcAppSidebar-qC5-u1p0.cjs} +18 -12
- package/dist/chunks/NcAppSidebar-qC5-u1p0.cjs.map +1 -0
- package/dist/chunks/{NcAvatar-k_VeT7Vp.mjs → NcAvatar-BBhoG-za.mjs} +96 -92
- package/dist/chunks/NcAvatar-BBhoG-za.mjs.map +1 -0
- package/dist/chunks/{NcAvatar-CDeuGCns.cjs → NcAvatar-BuqOk4mX.cjs} +66 -67
- package/dist/chunks/NcAvatar-BuqOk4mX.cjs.map +1 -0
- package/dist/chunks/{NcBreadcrumb-6--UKRl5.cjs → NcBreadcrumb-BRpLGeLr.cjs} +1 -1
- package/dist/chunks/{NcBreadcrumb-6--UKRl5.cjs.map → NcBreadcrumb-BRpLGeLr.cjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumb-Yg1njNwp.mjs → NcBreadcrumb-BxCf2hEA.mjs} +1 -1
- package/dist/chunks/{NcBreadcrumb-Yg1njNwp.mjs.map → NcBreadcrumb-BxCf2hEA.mjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumbs-CgSLqCmo.cjs → NcBreadcrumbs-BKPXzHC1.cjs} +28 -28
- package/dist/chunks/{NcBreadcrumbs-CgSLqCmo.cjs.map → NcBreadcrumbs-BKPXzHC1.cjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumbs-DXD2Kiak.mjs → NcBreadcrumbs-BmK-6Q-n.mjs} +25 -25
- package/dist/chunks/{NcBreadcrumbs-DXD2Kiak.mjs.map → NcBreadcrumbs-BmK-6Q-n.mjs.map} +1 -1
- package/dist/chunks/{NcCheckboxRadioSwitch-BS2C-YSz.cjs → NcCheckboxRadioSwitch-B9w3Znu7.cjs} +2 -2
- package/dist/chunks/{NcCheckboxRadioSwitch-BS2C-YSz.cjs.map → NcCheckboxRadioSwitch-B9w3Znu7.cjs.map} +1 -1
- package/dist/chunks/{NcCheckboxRadioSwitch-BRPYihez.mjs → NcCheckboxRadioSwitch-BOl1O2zi.mjs} +2 -2
- package/dist/chunks/{NcCheckboxRadioSwitch-BRPYihez.mjs.map → NcCheckboxRadioSwitch-BOl1O2zi.mjs.map} +1 -1
- package/dist/chunks/{NcCheckboxRadioSwitch.vue_vue_type_style_index_0_scoped_2603be83_lang-CURkxtfw.mjs → NcCheckboxRadioSwitch.vue_vue_type_style_index_0_scoped_2603be83_lang-CCwH-BzH.mjs} +1 -1
- package/dist/chunks/NcCheckboxRadioSwitch.vue_vue_type_style_index_0_scoped_2603be83_lang-CCwH-BzH.mjs.map +1 -0
- package/dist/chunks/{NcCheckboxRadioSwitch.vue_vue_type_style_index_0_scoped_2603be83_lang-B5QWlofX.cjs → NcCheckboxRadioSwitch.vue_vue_type_style_index_0_scoped_2603be83_lang-DAxGPyzS.cjs} +1 -1
- package/dist/chunks/NcCheckboxRadioSwitch.vue_vue_type_style_index_0_scoped_2603be83_lang-DAxGPyzS.cjs.map +1 -0
- package/dist/chunks/{NcColorPicker-DNGismgl.mjs → NcColorPicker-CeoImUTC.mjs} +2 -2
- package/dist/chunks/{NcColorPicker-DNGismgl.mjs.map → NcColorPicker-CeoImUTC.mjs.map} +1 -1
- package/dist/chunks/{NcColorPicker-D0rQKQAy.cjs → NcColorPicker-DOcxlY35.cjs} +1 -1
- package/dist/chunks/{NcColorPicker-D0rQKQAy.cjs.map → NcColorPicker-DOcxlY35.cjs.map} +1 -1
- package/dist/chunks/{NcContent-DCmLP8Ly.mjs → NcContent-BPA0KfuT.mjs} +1 -1
- package/dist/chunks/{NcContent-DCmLP8Ly.mjs.map → NcContent-BPA0KfuT.mjs.map} +1 -1
- package/dist/chunks/{NcContent-BXfreK7p.cjs → NcContent-DbFAEdX_.cjs} +1 -1
- package/dist/chunks/{NcContent-BXfreK7p.cjs.map → NcContent-DbFAEdX_.cjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidget-6UWLF9LM.mjs → NcDashboardWidget-2-nW7dII.mjs} +3 -3
- package/dist/chunks/{NcDashboardWidget-6UWLF9LM.mjs.map → NcDashboardWidget-2-nW7dII.mjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidget-CPXbrHii.cjs → NcDashboardWidget-auMQiAFt.cjs} +1 -1
- package/dist/chunks/{NcDashboardWidget-CPXbrHii.cjs.map → NcDashboardWidget-auMQiAFt.cjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidgetItem-bFGf6_R7.mjs → NcDashboardWidgetItem-D2yoF9Oo.mjs} +2 -2
- package/dist/chunks/{NcDashboardWidgetItem-bFGf6_R7.mjs.map → NcDashboardWidgetItem-D2yoF9Oo.mjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidgetItem-Buh2BPAN.cjs → NcDashboardWidgetItem-xqVAP32n.cjs} +1 -1
- package/dist/chunks/{NcDashboardWidgetItem-Buh2BPAN.cjs.map → NcDashboardWidgetItem-xqVAP32n.cjs.map} +1 -1
- package/dist/chunks/{NcDateTime-GW15p7yp.mjs → NcDateTime-CeOdKcvC.mjs} +1 -1
- package/dist/chunks/{NcDateTime-GW15p7yp.mjs.map → NcDateTime-CeOdKcvC.mjs.map} +1 -1
- package/dist/chunks/{NcDateTime-DG_XAvbT.cjs → NcDateTime-DneyKibb.cjs} +1 -1
- package/dist/chunks/{NcDateTime-DG_XAvbT.cjs.map → NcDateTime-DneyKibb.cjs.map} +1 -1
- package/dist/chunks/{NcDialog-D6YSjidf.mjs → NcDialog-C_1rhUHk.mjs} +2 -2
- package/dist/chunks/{NcDialog-D6YSjidf.mjs.map → NcDialog-C_1rhUHk.mjs.map} +1 -1
- package/dist/chunks/{NcDialog-C6nYgBDF.cjs → NcDialog-Ciz0hlFn.cjs} +2 -2
- package/dist/chunks/{NcDialog-C6nYgBDF.cjs.map → NcDialog-Ciz0hlFn.cjs.map} +1 -1
- package/dist/chunks/{NcEmojiPicker-B34sLJKs.mjs → NcEmojiPicker-Cie30NYK.mjs} +4 -4
- package/dist/chunks/{NcEmojiPicker-B34sLJKs.mjs.map → NcEmojiPicker-Cie30NYK.mjs.map} +1 -1
- package/dist/chunks/{NcEmojiPicker-BDcdqsgr.cjs → NcEmojiPicker-S2pfwxlK.cjs} +1 -1
- package/dist/chunks/{NcEmojiPicker-BDcdqsgr.cjs.map → NcEmojiPicker-S2pfwxlK.cjs.map} +1 -1
- package/dist/chunks/{NcHeaderMenu-BUeI4DGP.cjs → NcHeaderMenu-58OTmM-5.cjs} +1 -1
- package/dist/chunks/{NcHeaderMenu-BUeI4DGP.cjs.map → NcHeaderMenu-58OTmM-5.cjs.map} +1 -1
- package/dist/chunks/{NcHeaderMenu-CXBimxcN.mjs → NcHeaderMenu-DOGXti7v.mjs} +1 -1
- package/dist/chunks/{NcHeaderMenu-CXBimxcN.mjs.map → NcHeaderMenu-DOGXti7v.mjs.map} +1 -1
- package/dist/chunks/{NcInputConfirmCancel-CVgJcgbg.cjs → NcInputConfirmCancel-DVmY85-V.cjs} +1 -1
- package/dist/chunks/{NcInputConfirmCancel-CVgJcgbg.cjs.map → NcInputConfirmCancel-DVmY85-V.cjs.map} +1 -1
- package/dist/chunks/{NcInputConfirmCancel-GFlH1B9I.mjs → NcInputConfirmCancel-Nn_JgG9d.mjs} +1 -1
- package/dist/chunks/{NcInputConfirmCancel-GFlH1B9I.mjs.map → NcInputConfirmCancel-Nn_JgG9d.mjs.map} +1 -1
- package/dist/chunks/{NcListItem-BDrxkM0q.cjs → NcListItem-B_MPLJ_8.cjs} +3 -3
- package/dist/chunks/{NcListItem-rlwo19vU.mjs.map → NcListItem-B_MPLJ_8.cjs.map} +1 -1
- package/dist/chunks/{NcListItem-rlwo19vU.mjs → NcListItem-BopkGRDs.mjs} +4 -4
- package/dist/chunks/{NcListItem-BDrxkM0q.cjs.map → NcListItem-BopkGRDs.mjs.map} +1 -1
- package/dist/chunks/{NcListItemIcon-Bwl8bKaY.mjs → NcListItemIcon-CI23iFQz.mjs} +2 -2
- package/dist/chunks/{NcListItemIcon-Bwl8bKaY.mjs.map → NcListItemIcon-CI23iFQz.mjs.map} +1 -1
- package/dist/chunks/{NcListItemIcon-D_cwlGhm.cjs → NcListItemIcon-Dwgi2cPr.cjs} +2 -2
- package/dist/chunks/{NcListItemIcon-D_cwlGhm.cjs.map → NcListItemIcon-Dwgi2cPr.cjs.map} +1 -1
- package/dist/chunks/{NcPasswordField-D91QgkSR.mjs → NcPasswordField-BgSp7dK4.mjs} +1 -1
- package/dist/chunks/{NcPasswordField-D91QgkSR.mjs.map → NcPasswordField-BgSp7dK4.mjs.map} +1 -1
- package/dist/chunks/{NcPasswordField-EDrr_9PG.cjs → NcPasswordField-BooDzf0Z.cjs} +1 -1
- package/dist/chunks/{NcPasswordField-EDrr_9PG.cjs.map → NcPasswordField-BooDzf0Z.cjs.map} +1 -1
- package/dist/chunks/{NcRelatedResourcesPanel-DaLcC_9H.mjs → NcRelatedResourcesPanel-Ch1b_Gl3.mjs} +2 -2
- package/dist/chunks/{NcRelatedResourcesPanel-DaLcC_9H.mjs.map → NcRelatedResourcesPanel-Ch1b_Gl3.mjs.map} +1 -1
- package/dist/chunks/{NcRelatedResourcesPanel-DDL8rJnB.cjs → NcRelatedResourcesPanel-DaiuNCYU.cjs} +1 -1
- package/dist/chunks/{NcRelatedResourcesPanel-DDL8rJnB.cjs.map → NcRelatedResourcesPanel-DaiuNCYU.cjs.map} +1 -1
- package/dist/chunks/{NcRichContenteditable-DjUF2Kzl.cjs → NcRichContenteditable-BF3BkdqM.cjs} +10 -14
- package/dist/chunks/NcRichContenteditable-BF3BkdqM.cjs.map +1 -0
- package/dist/chunks/{NcRichContenteditable-CaeNwWTC.mjs → NcRichContenteditable-CEqdmoem.mjs} +15 -19
- package/dist/chunks/NcRichContenteditable-CEqdmoem.mjs.map +1 -0
- package/dist/chunks/{NcRichText-DVnS4C_H.mjs → NcRichText-CUKFkHQg.mjs} +72 -62
- package/dist/chunks/NcRichText-CUKFkHQg.mjs.map +1 -0
- package/dist/chunks/{NcRichText-D_p79y2S.cjs → NcRichText-DCkExl5g.cjs} +65 -55
- package/dist/chunks/NcRichText-DCkExl5g.cjs.map +1 -0
- package/dist/chunks/{NcSelect-BVCCppX6.cjs → NcSelect-Bn3oTHtq.cjs} +1 -1
- package/dist/chunks/{NcSelect-BVCCppX6.cjs.map → NcSelect-Bn3oTHtq.cjs.map} +1 -1
- package/dist/chunks/{NcSelect-BjojUUy7.mjs → NcSelect-Bo71Yd6L.mjs} +2 -2
- package/dist/chunks/{NcSelect-BjojUUy7.mjs.map → NcSelect-Bo71Yd6L.mjs.map} +1 -1
- package/dist/chunks/{NcSelectTags-CIa3RL2u.mjs → NcSelectTags-9aCrLRT0.mjs} +2 -2
- package/dist/chunks/{NcSelectTags-CIa3RL2u.mjs.map → NcSelectTags-9aCrLRT0.mjs.map} +1 -1
- package/dist/chunks/{NcSelectTags-b_FdAE_d.cjs → NcSelectTags-CgYWiDjX.cjs} +1 -1
- package/dist/chunks/{NcSelectTags-b_FdAE_d.cjs.map → NcSelectTags-CgYWiDjX.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsInputText-D_wATSbL.cjs → NcSettingsInputText-1i2TqdMB.cjs} +1 -1
- package/dist/chunks/{NcSettingsInputText-D_wATSbL.cjs.map → NcSettingsInputText-1i2TqdMB.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsInputText-BESxHP0m.mjs → NcSettingsInputText-JboV8u2l.mjs} +1 -1
- package/dist/chunks/{NcSettingsInputText-BESxHP0m.mjs.map → NcSettingsInputText-JboV8u2l.mjs.map} +1 -1
- package/dist/chunks/{NcSettingsSection-TG0j5-kd.cjs → NcSettingsSection-CNMpCD3o.cjs} +1 -1
- package/dist/chunks/{NcSettingsSection-TG0j5-kd.cjs.map → NcSettingsSection-CNMpCD3o.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsSection-BzN6JXnV.mjs → NcSettingsSection-Lgwm3w2e.mjs} +1 -1
- package/dist/chunks/{NcSettingsSection-BzN6JXnV.mjs.map → NcSettingsSection-Lgwm3w2e.mjs.map} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-JJ4LZALf.cjs → NcSettingsSelectGroup-CgUJmyF7.cjs} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-JJ4LZALf.cjs.map → NcSettingsSelectGroup-CgUJmyF7.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-BRov--RO.mjs → NcSettingsSelectGroup-DUzmbtZx.mjs} +2 -2
- package/dist/chunks/{NcSettingsSelectGroup-BRov--RO.mjs.map → NcSettingsSelectGroup-DUzmbtZx.mjs.map} +1 -1
- package/dist/chunks/{NcTextField-DgzR5_48.cjs → NcTextField-B5cUYgRy.cjs} +1 -1
- package/dist/chunks/{NcTextField-DgzR5_48.cjs.map → NcTextField-B5cUYgRy.cjs.map} +1 -1
- package/dist/chunks/{NcTextField-BPGi70PD.mjs → NcTextField-D_eUEl2B.mjs} +1 -1
- package/dist/chunks/{NcTextField-BPGi70PD.mjs.map → NcTextField-D_eUEl2B.mjs.map} +1 -1
- package/dist/chunks/{NcTimezonePicker-8ZYdOp_g.cjs → NcTimezonePicker-BF5TeadZ.cjs} +1 -1
- package/dist/chunks/{NcTimezonePicker-8ZYdOp_g.cjs.map → NcTimezonePicker-BF5TeadZ.cjs.map} +1 -1
- package/dist/chunks/{NcTimezonePicker-jCKohlic.mjs → NcTimezonePicker-CH1lkCMF.mjs} +2 -2
- package/dist/chunks/{NcTimezonePicker-jCKohlic.mjs.map → NcTimezonePicker-CH1lkCMF.mjs.map} +1 -1
- package/dist/chunks/{NcUserBubble-Bfph5VfL.cjs → NcUserBubble-BadEJRgs.cjs} +1 -1
- package/dist/chunks/{NcUserBubble-Bfph5VfL.cjs.map → NcUserBubble-BadEJRgs.cjs.map} +1 -1
- package/dist/chunks/{NcUserBubble-DwKN1aRa.mjs → NcUserBubble-C0HbPO9p.mjs} +1 -1
- package/dist/chunks/{NcUserBubble-DwKN1aRa.mjs.map → NcUserBubble-C0HbPO9p.mjs.map} +1 -1
- package/dist/chunks/{NcUserStatusIcon-Bu_nFfO_.cjs → NcUserStatusIcon-B69NZ9Hw.cjs} +1 -1
- package/dist/chunks/{NcUserStatusIcon-Bu_nFfO_.cjs.map → NcUserStatusIcon-B69NZ9Hw.cjs.map} +1 -1
- package/dist/chunks/{NcUserStatusIcon-Blep5GZX.mjs → NcUserStatusIcon-HOUdT_MR.mjs} +1 -1
- package/dist/chunks/{NcUserStatusIcon-Blep5GZX.mjs.map → NcUserStatusIcon-HOUdT_MR.mjs.map} +1 -1
- package/dist/chunks/{ScopeComponent-CGJeYf1D.mjs → ScopeComponent-Dz4pyD77.mjs} +1 -1
- package/dist/chunks/{ScopeComponent-CGJeYf1D.mjs.map → ScopeComponent-Dz4pyD77.mjs.map} +1 -1
- package/dist/chunks/{ScopeComponent-BiLZtJeb.cjs → ScopeComponent-IO407Bzb.cjs} +1 -1
- package/dist/chunks/{ScopeComponent-BiLZtJeb.cjs.map → ScopeComponent-IO407Bzb.cjs.map} +1 -1
- package/dist/chunks/_l10n-B8iumFKB.cjs +66 -0
- package/dist/chunks/_l10n-B8iumFKB.cjs.map +1 -0
- package/dist/chunks/_l10n-BaNxGGXy.mjs +68 -0
- package/dist/chunks/_l10n-BaNxGGXy.mjs.map +1 -0
- package/dist/chunks/autolink-DNGB8YSW.mjs +86 -0
- package/dist/chunks/autolink-DNGB8YSW.mjs.map +1 -0
- package/dist/chunks/autolink-MMzlO_Ai.cjs +82 -0
- package/dist/chunks/autolink-MMzlO_Ai.cjs.map +1 -0
- package/dist/chunks/getAvatarUrl-BHpn8LgJ.mjs +32 -0
- package/dist/chunks/getAvatarUrl-BHpn8LgJ.mjs.map +1 -0
- package/dist/chunks/getAvatarUrl-CjIpoO6I.cjs +31 -0
- package/dist/chunks/getAvatarUrl-CjIpoO6I.cjs.map +1 -0
- package/dist/chunks/{index-CVsxVZon.cjs → index-CMnR5Pf6.cjs} +7 -12
- package/dist/chunks/index-CMnR5Pf6.cjs.map +1 -0
- package/dist/chunks/{index-BAVa4G2v.mjs → index-uiNhPYvS.mjs} +23 -28
- package/dist/chunks/index-uiNhPYvS.mjs.map +1 -0
- package/dist/chunks/{referencePickerModal-ChgMFkNu.mjs → referencePickerModal-AvSHyw1b.mjs} +4 -4
- package/dist/chunks/{referencePickerModal-ChgMFkNu.mjs.map → referencePickerModal-AvSHyw1b.mjs.map} +1 -1
- package/dist/chunks/{referencePickerModal-DRZH-El6.cjs → referencePickerModal-B_Su3XpN.cjs} +1 -1
- package/dist/chunks/{referencePickerModal-DRZH-El6.cjs.map → referencePickerModal-B_Su3XpN.cjs.map} +1 -1
- package/dist/chunks/{usernameToColor-DrnKFnLP.mjs → usernameToColor-BHkzj1tb.mjs} +1 -1
- package/dist/chunks/{usernameToColor-DrnKFnLP.mjs.map → usernameToColor-BHkzj1tb.mjs.map} +1 -1
- package/dist/chunks/{usernameToColor-BG9PjZRM.cjs → usernameToColor-DA36rR48.cjs} +1 -1
- package/dist/chunks/{usernameToColor-BG9PjZRM.cjs.map → usernameToColor-DA36rR48.cjs.map} +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.mjs +45 -45
- package/dist/utils/getAvatarUrl.d.ts +22 -0
- package/package.json +2 -1
- package/dist/assets/NcListItem--ilRNXci.css +0 -179
- package/dist/chunks/NcActionInput-B_upGNjs.mjs.map +0 -1
- package/dist/chunks/NcActionInput-C6WR9W8-.cjs.map +0 -1
- package/dist/chunks/NcAppSidebar-BbEflEtM.mjs.map +0 -1
- package/dist/chunks/NcAppSidebar-DNAgJFfm.cjs.map +0 -1
- package/dist/chunks/NcAvatar-CDeuGCns.cjs.map +0 -1
- package/dist/chunks/NcAvatar-k_VeT7Vp.mjs.map +0 -1
- package/dist/chunks/NcCheckboxRadioSwitch.vue_vue_type_style_index_0_scoped_2603be83_lang-B5QWlofX.cjs.map +0 -1
- package/dist/chunks/NcCheckboxRadioSwitch.vue_vue_type_style_index_0_scoped_2603be83_lang-CURkxtfw.mjs.map +0 -1
- package/dist/chunks/NcRichContenteditable-CaeNwWTC.mjs.map +0 -1
- package/dist/chunks/NcRichContenteditable-DjUF2Kzl.cjs.map +0 -1
- package/dist/chunks/NcRichText-DVnS4C_H.mjs.map +0 -1
- package/dist/chunks/NcRichText-D_p79y2S.cjs.map +0 -1
- package/dist/chunks/_l10n-BG5lXDmm.cjs +0 -66
- package/dist/chunks/_l10n-BG5lXDmm.cjs.map +0 -1
- package/dist/chunks/_l10n-Cj65IvRp.mjs +0 -68
- package/dist/chunks/_l10n-Cj65IvRp.mjs.map +0 -1
- package/dist/chunks/autolink-BtgUDDdk.mjs +0 -59
- package/dist/chunks/autolink-BtgUDDdk.mjs.map +0 -1
- package/dist/chunks/autolink-D0rLUkqm.cjs +0 -55
- package/dist/chunks/autolink-D0rLUkqm.cjs.map +0 -1
- package/dist/chunks/index-BAVa4G2v.mjs.map +0 -1
- package/dist/chunks/index-CVsxVZon.cjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_l10n-BaNxGGXy.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { visit as f, SKIP as g } from "unist-util-visit";
|
|
2
|
+
import { u as p } from "unist-builder";
|
|
3
|
+
import { getBaseUrl as u, getRootUrl as a } from "@nextcloud/router";
|
|
4
|
+
const b = /(\s|^)(https?:\/\/)([-A-Z0-9+_.]+(?::[0-9]+)?(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\s|$)/ig, c = /(\s|\(|^)((https?:\/\/)([-A-Z0-9+_.]+[-A-Z0-9]+(?::[0-9]+)?(?:\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*))(?=\s|\)|$)/ig;
|
|
5
|
+
/**
|
|
6
|
+
* @copyright Copyright (c) 2022 Julius Härtl <jus@bitgrid.net>
|
|
7
|
+
*
|
|
8
|
+
* @author Julius Härtl <jus@bitgrid.net>
|
|
9
|
+
* @author Raimund Schlüßler <raimund.schluessler@mailbox.org>
|
|
10
|
+
* @author Maksim Sukharev <antreesy.web@gmail.com>
|
|
11
|
+
* @author Grigorii K. Shartsev <me@shgk.me>
|
|
12
|
+
*
|
|
13
|
+
* @license AGPL-3.0-or-later
|
|
14
|
+
*
|
|
15
|
+
* This program is free software: you can redistribute it and/or modify
|
|
16
|
+
* it under the terms of the GNU Affero General Public License as
|
|
17
|
+
* published by the Free Software Foundation, either version 3 of the
|
|
18
|
+
* License, or (at your option) any later version.
|
|
19
|
+
*
|
|
20
|
+
* This program is distributed in the hope that it will be useful,
|
|
21
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
22
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
23
|
+
* GNU Affero General Public License for more details.
|
|
24
|
+
*
|
|
25
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
26
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
27
|
+
*
|
|
28
|
+
*/
|
|
29
|
+
const d = {
|
|
30
|
+
name: "NcLink",
|
|
31
|
+
props: {
|
|
32
|
+
href: {
|
|
33
|
+
type: String,
|
|
34
|
+
required: !0
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
render(r) {
|
|
38
|
+
return r("a", {
|
|
39
|
+
attrs: {
|
|
40
|
+
href: this.href,
|
|
41
|
+
rel: "noopener noreferrer",
|
|
42
|
+
target: "_blank",
|
|
43
|
+
class: "rich-text--external-link"
|
|
44
|
+
}
|
|
45
|
+
}, [this.href.trim()]);
|
|
46
|
+
}
|
|
47
|
+
}, k = function({ autolink: r, useMarkdown: e, useExtendedMarkdown: s }) {
|
|
48
|
+
return function(h) {
|
|
49
|
+
s || !e || !r || f(h, (o) => o.type === "text", (o, t, l) => {
|
|
50
|
+
let i = m(o.value);
|
|
51
|
+
return i = i.map((n) => typeof n == "string" ? p("text", n) : p("link", {
|
|
52
|
+
url: n.props.href
|
|
53
|
+
}, [p("text", n.props.href)])).filter((n) => n), l.children.splice(t, 1, ...i.flat()), [g, t + i.flat().length];
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
}, m = (r) => {
|
|
57
|
+
let e = c.exec(r);
|
|
58
|
+
const s = [];
|
|
59
|
+
let h = 0;
|
|
60
|
+
for (; e !== null; ) {
|
|
61
|
+
let t = e[2], l, i = r.substring(h, e.index + e[1].length);
|
|
62
|
+
t[0] === " " && (i += t[0], t = t.substring(1).trim());
|
|
63
|
+
const n = t[t.length - 1];
|
|
64
|
+
(n === "." || n === "," || n === ";" || e[0][0] === "(" && n === ")") && (t = t.substring(0, t.length - 1), l = n), s.push(i), s.push({ component: d, props: { href: t } }), l && s.push(l), h = e.index + e[0].length, e = c.exec(r);
|
|
65
|
+
}
|
|
66
|
+
s.push(r.substring(h));
|
|
67
|
+
const o = s.map((t) => typeof t == "string" ? t : t.props.href).join("");
|
|
68
|
+
return r === o ? s : (console.error("Failed to reassemble the chunked text: " + r), r);
|
|
69
|
+
}, R = (r, e) => {
|
|
70
|
+
if (!r)
|
|
71
|
+
return null;
|
|
72
|
+
const s = /^https?:\/\//.test(e);
|
|
73
|
+
if (s && !e.startsWith(u()) || !s && !e.startsWith(a()))
|
|
74
|
+
return null;
|
|
75
|
+
const h = r.history.base, o = s ? e.slice(new URL(e).origin.length) : e, t = e.startsWith((s ? u() : a()) + "/index.php") ? o.replace("/index.php", "") : o, l = h.replace("/index.php", "");
|
|
76
|
+
if (!t.startsWith(l))
|
|
77
|
+
return null;
|
|
78
|
+
const i = t.replace(l, "") || "/", n = r.resolve(i).route;
|
|
79
|
+
return n.matched.length ? n.fullPath : null;
|
|
80
|
+
};
|
|
81
|
+
export {
|
|
82
|
+
b as U,
|
|
83
|
+
R as g,
|
|
84
|
+
m as p,
|
|
85
|
+
k as r
|
|
86
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autolink-DNGB8YSW.mjs","sources":["../../src/components/NcRichText/helpers.js","../../src/components/NcRichText/autolink.js"],"sourcesContent":["/**\n * Regex pattern to match links to be resolved by the link-reference provider\n *\n * @type {RegExp}\n */\nexport const URL_PATTERN = /(\\s|^)(https?:\\/\\/)([-A-Z0-9+_.]+(?::[0-9]+)?(?:\\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\\s|$)/ig\n\n/**\n * Regex pattern to identify strings as links and then making them clickable\n *\n * @type {RegExp}\n */\nexport const URL_PATTERN_AUTOLINK = /(\\s|\\(|^)((https?:\\/\\/)([-A-Z0-9+_.]+[-A-Z0-9]+(?::[0-9]+)?(?:\\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*))(?=\\s|\\)|$)/ig\n","/**\n * @copyright Copyright (c) 2022 Julius Härtl <jus@bitgrid.net>\n *\n * @author Julius Härtl <jus@bitgrid.net>\n * @author Raimund Schlüßler <raimund.schluessler@mailbox.org>\n * @author Maksim Sukharev <antreesy.web@gmail.com>\n * @author Grigorii K. Shartsev <me@shgk.me>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport { URL_PATTERN_AUTOLINK } from './helpers.js'\n\nimport { visit, SKIP } from 'unist-util-visit'\nimport { u } from 'unist-builder'\nimport { getBaseUrl, getRootUrl } from '@nextcloud/router'\n\nconst NcLink = {\n\tname: 'NcLink',\n\tprops: {\n\t\thref: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t},\n\trender(h) {\n\t\treturn h('a', {\n\t\t\tattrs: {\n\t\t\t\thref: this.href,\n\t\t\t\trel: 'noopener noreferrer',\n\t\t\t\ttarget: '_blank',\n\t\t\t\tclass: 'rich-text--external-link',\n\t\t\t},\n\t\t}, [this.href.trim()])\n\t},\n}\n\nexport const remarkAutolink = function({ autolink, useMarkdown, useExtendedMarkdown }) {\n\treturn function(tree) {\n\t\t// remark-gfm has its own autolink parser which can not be disabled\n\t\t// and thus a local one is not needed\n\t\tif (useExtendedMarkdown || !useMarkdown || !autolink) {\n\t\t\treturn\n\t\t}\n\n\t\tvisit(tree, (node) => node.type === 'text', (node, index, parent) => {\n\t\t\tlet parsed = parseUrl(node.value)\n\t\t\tparsed = parsed.map((n) => {\n\t\t\t\tif (typeof n === 'string') {\n\t\t\t\t\treturn u('text', n)\n\t\t\t\t}\n\n\t\t\t\treturn u('link', {\n\t\t\t\t\turl: n.props.href,\n\t\t\t\t}, [u('text', n.props.href)])\n\t\t\t}).filter((x) => x)\n\n\t\t\tparent.children.splice(index, 1, ...parsed.flat())\n\t\t\treturn [SKIP, index + parsed.flat().length]\n\t\t})\n\t}\n}\n\nexport const parseUrl = (text) => {\n\tlet match = URL_PATTERN_AUTOLINK.exec(text)\n\tconst list = []\n\tlet start = 0\n\twhile (match !== null) {\n\t\tlet href = match[2]\n\t\tlet textAfter\n\t\tlet textBefore = text.substring(start, match.index + match[1].length)\n\t\tif (href[0] === ' ') {\n\t\t\ttextBefore += href[0]\n\t\t\thref = href.substring(1).trim()\n\t\t}\n\t\tconst lastChar = href[(href.length - 1)]\n\t\tif (lastChar === '.' || lastChar === ',' || lastChar === ';' || (match[0][0] === '(' && lastChar === ')')) {\n\t\t\thref = href.substring(0, href.length - 1)\n\t\t\ttextAfter = lastChar\n\t\t}\n\t\tlist.push(textBefore)\n\t\tlist.push({ component: NcLink, props: { href } })\n\t\tif (textAfter) {\n\t\t\tlist.push(textAfter)\n\t\t}\n\t\tstart = match.index + match[0].length\n\t\tmatch = URL_PATTERN_AUTOLINK.exec(text)\n\t}\n\tlist.push(text.substring(start))\n\tconst joinedText = list.map((item) => typeof item === 'string' ? item : item.props.href).join('')\n\tif (text === joinedText) {\n\t\treturn list\n\t}\n\tconsole.error('Failed to reassemble the chunked text: ' + text)\n\treturn text\n}\n\n/**\n * Try to get path for router link from an absolute or relative URL.\n *\n * @param {import('vue-router').default} router - VueRouter instance of the router link\n * @param {string} url - absolute URL to parse\n * @return {string|null} a path that can be useed in the router link or null if this URL doesn't match this router config\n * @example http://cloud.ltd/nextcloud/index.php/app/files/favorites?fileid=2#fragment => /files/favorites?fileid=2#fragment\n */\nexport const getRoute = (router, url) => {\n\t/**\n\t * http://cloud.ltd /nextcloud /index.php/app/files /favorites?fileid=2#fragment\n\t * |_____origin____|__________router-base__________|_________router-path________|\n\t * |__________base____________|\n\t * |___root___|\n\t */\n\n\t// Router is not defined in the app => not an app route\n\tif (!router) {\n\t\treturn null\n\t}\n\n\tconst isAbsoluteURL = /^https?:\\/\\//.test(url)\n\n\t// URL is not a link to this Nextcloud server instance => not an app route\n\tif ((isAbsoluteURL && !url.startsWith(getBaseUrl())) || (!isAbsoluteURL && !url.startsWith(getRootUrl()))) {\n\t\treturn null\n\t}\n\n\t// Vue 3: router.options.history.base\n\tconst routerBase = router.history.base\n\n\tconst urlWithoutOrigin = isAbsoluteURL ? url.slice(new URL(url).origin.length) : url\n\n\t// Remove index.php - it is optional in general case in both, VueRouter base and the URL\n\tconst urlWithoutOriginAndIndexPhp = url.startsWith((isAbsoluteURL ? getBaseUrl() : getRootUrl()) + '/index.php') ? urlWithoutOrigin.replace('/index.php', '') : urlWithoutOrigin\n\tconst routerBaseWithoutIndexPhp = routerBase.replace('/index.php', '')\n\n\t// This URL is not a part of this router by base\n\tif (!urlWithoutOriginAndIndexPhp.startsWith(routerBaseWithoutIndexPhp)) {\n\t\treturn null\n\t}\n\n\t// Root route may have an empty '' path, fallback to '/'\n\tconst routerPath = urlWithoutOriginAndIndexPhp.replace(routerBaseWithoutIndexPhp, '') || '/'\n\n\t// Check if there is actually matching route in the router for this path\n\tconst route = router.resolve(routerPath).route\n\n\tif (!route.matched.length) {\n\t\treturn null\n\t}\n\n\treturn route.fullPath\n}\n"],"names":["URL_PATTERN","URL_PATTERN_AUTOLINK","NcLink","h","remarkAutolink","autolink","useMarkdown","useExtendedMarkdown","tree","visit","node","index","parent","parsed","parseUrl","u","x","SKIP","text","match","list","start","href","textAfter","textBefore","lastChar","joinedText","item","getRoute","router","url","isAbsoluteURL","getBaseUrl","getRootUrl","routerBase","urlWithoutOrigin","urlWithoutOriginAndIndexPhp","routerBaseWithoutIndexPhp","routerPath","route"],"mappings":";;;AAKY,MAACA,IAAc,4FAOdC,IAAuB;ACZpC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+BA,MAAMC,IAAS;AAAA,EACd,MAAM;AAAA,EACN,OAAO;AAAA,IACN,MAAM;AAAA,MACL,MAAM;AAAA,MACN,UAAU;AAAA,IACV;AAAA,EACD;AAAA,EACD,OAAOC,GAAG;AACT,WAAOA,EAAE,KAAK;AAAA,MACb,OAAO;AAAA,QACN,MAAM,KAAK;AAAA,QACX,KAAK;AAAA,QACL,QAAQ;AAAA,QACR,OAAO;AAAA,MACP;AAAA,IACD,GAAE,CAAC,KAAK,KAAK,KAAM,CAAA,CAAC;AAAA,EACrB;AACF,GAEaC,IAAiB,SAAS,EAAE,UAAAC,GAAU,aAAAC,GAAa,qBAAAC,EAAmB,GAAI;AACtF,SAAO,SAASC,GAAM;AAGrB,IAAID,KAAuB,CAACD,KAAe,CAACD,KAI5CI,EAAMD,GAAM,CAACE,MAASA,EAAK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A-Z0-9+&@#%?=~_|!:,.;()]*)*))(?=\s|\)|$)/ig;
|
|
3
|
+
/**
|
|
4
|
+
* @copyright Copyright (c) 2022 Julius Härtl <jus@bitgrid.net>
|
|
5
|
+
*
|
|
6
|
+
* @author Julius Härtl <jus@bitgrid.net>
|
|
7
|
+
* @author Raimund Schlüßler <raimund.schluessler@mailbox.org>
|
|
8
|
+
* @author Maksim Sukharev <antreesy.web@gmail.com>
|
|
9
|
+
* @author Grigorii K. Shartsev <me@shgk.me>
|
|
10
|
+
*
|
|
11
|
+
* @license AGPL-3.0-or-later
|
|
12
|
+
*
|
|
13
|
+
* This program is free software: you can redistribute it and/or modify
|
|
14
|
+
* it under the terms of the GNU Affero General Public License as
|
|
15
|
+
* published by the Free Software Foundation, either version 3 of the
|
|
16
|
+
* License, or (at your option) any later version.
|
|
17
|
+
*
|
|
18
|
+
* This program is distributed in the hope that it will be useful,
|
|
19
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
20
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
21
|
+
* GNU Affero General Public License for more details.
|
|
22
|
+
*
|
|
23
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
24
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
const d = {
|
|
28
|
+
name: "NcLink",
|
|
29
|
+
props: {
|
|
30
|
+
href: {
|
|
31
|
+
type: String,
|
|
32
|
+
required: !0
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
render(r) {
|
|
36
|
+
return r("a", {
|
|
37
|
+
attrs: {
|
|
38
|
+
href: this.href,
|
|
39
|
+
rel: "noopener noreferrer",
|
|
40
|
+
target: "_blank",
|
|
41
|
+
class: "rich-text--external-link"
|
|
42
|
+
}
|
|
43
|
+
}, [this.href.trim()]);
|
|
44
|
+
}
|
|
45
|
+
}, A = function({ autolink: r, useMarkdown: e, useExtendedMarkdown: s }) {
|
|
46
|
+
return function(u) {
|
|
47
|
+
s || !e || !r || c.visit(u, (o) => o.type === "text", (o, t, l) => {
|
|
48
|
+
let i = f(o.value);
|
|
49
|
+
return i = i.map((n) => typeof n == "string" ? p.u("text", n) : p.u("link", {
|
|
50
|
+
url: n.props.href
|
|
51
|
+
}, [p.u("text", n.props.href)])).filter((n) => n), l.children.splice(t, 1, ...i.flat()), [c.SKIP, t + i.flat().length];
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
}, f = (r) => {
|
|
55
|
+
let e = a.exec(r);
|
|
56
|
+
const s = [];
|
|
57
|
+
let u = 0;
|
|
58
|
+
for (; e !== null; ) {
|
|
59
|
+
let t = e[2], l, i = r.substring(u, e.index + e[1].length);
|
|
60
|
+
t[0] === " " && (i += t[0], t = t.substring(1).trim());
|
|
61
|
+
const n = t[t.length - 1];
|
|
62
|
+
(n === "." || n === "," || n === ";" || e[0][0] === "(" && n === ")") && (t = t.substring(0, t.length - 1), l = n), s.push(i), s.push({ component: d, props: { href: t } }), l && s.push(l), u = e.index + e[0].length, e = a.exec(r);
|
|
63
|
+
}
|
|
64
|
+
s.push(r.substring(u));
|
|
65
|
+
const o = s.map((t) => typeof t == "string" ? t : t.props.href).join("");
|
|
66
|
+
return r === o ? s : (console.error("Failed to reassemble the chunked text: " + r), r);
|
|
67
|
+
}, U = (r, e) => {
|
|
68
|
+
if (!r)
|
|
69
|
+
return null;
|
|
70
|
+
const s = /^https?:\/\//.test(e);
|
|
71
|
+
if (s && !e.startsWith(h.getBaseUrl()) || !s && !e.startsWith(h.getRootUrl()))
|
|
72
|
+
return null;
|
|
73
|
+
const u = r.history.base, o = s ? e.slice(new URL(e).origin.length) : e, t = e.startsWith((s ? h.getBaseUrl() : h.getRootUrl()) + "/index.php") ? o.replace("/index.php", "") : o, l = u.replace("/index.php", "");
|
|
74
|
+
if (!t.startsWith(l))
|
|
75
|
+
return null;
|
|
76
|
+
const i = t.replace(l, "") || "/", n = r.resolve(i).route;
|
|
77
|
+
return n.matched.length ? n.fullPath : null;
|
|
78
|
+
};
|
|
79
|
+
exports.URL_PATTERN = g;
|
|
80
|
+
exports.getRoute = U;
|
|
81
|
+
exports.parseUrl = f;
|
|
82
|
+
exports.remarkAutolink = A;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"autolink-MMzlO_Ai.cjs","sources":["../../src/components/NcRichText/helpers.js","../../src/components/NcRichText/autolink.js"],"sourcesContent":["/**\n * Regex pattern to match links to be resolved by the link-reference provider\n *\n * @type {RegExp}\n */\nexport const URL_PATTERN = /(\\s|^)(https?:\\/\\/)([-A-Z0-9+_.]+(?::[0-9]+)?(?:\\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*)(\\s|$)/ig\n\n/**\n * Regex pattern to identify strings as links and then making them clickable\n *\n * @type {RegExp}\n */\nexport const URL_PATTERN_AUTOLINK = /(\\s|\\(|^)((https?:\\/\\/)([-A-Z0-9+_.]+[-A-Z0-9]+(?::[0-9]+)?(?:\\/[-A-Z0-9+&@#%?=~_|!:,.;()]*)*))(?=\\s|\\)|$)/ig\n","/**\n * @copyright Copyright (c) 2022 Julius Härtl <jus@bitgrid.net>\n *\n * @author Julius Härtl <jus@bitgrid.net>\n * @author Raimund Schlüßler <raimund.schluessler@mailbox.org>\n * @author Maksim Sukharev <antreesy.web@gmail.com>\n * @author Grigorii K. Shartsev <me@shgk.me>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport { URL_PATTERN_AUTOLINK } from './helpers.js'\n\nimport { visit, SKIP } from 'unist-util-visit'\nimport { u } from 'unist-builder'\nimport { getBaseUrl, getRootUrl } from '@nextcloud/router'\n\nconst NcLink = {\n\tname: 'NcLink',\n\tprops: {\n\t\thref: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t},\n\trender(h) {\n\t\treturn h('a', {\n\t\t\tattrs: {\n\t\t\t\thref: this.href,\n\t\t\t\trel: 'noopener noreferrer',\n\t\t\t\ttarget: '_blank',\n\t\t\t\tclass: 'rich-text--external-link',\n\t\t\t},\n\t\t}, [this.href.trim()])\n\t},\n}\n\nexport const remarkAutolink = function({ autolink, useMarkdown, useExtendedMarkdown }) {\n\treturn function(tree) {\n\t\t// remark-gfm has its own autolink parser which can not be disabled\n\t\t// and thus a local one is not needed\n\t\tif (useExtendedMarkdown || !useMarkdown || !autolink) {\n\t\t\treturn\n\t\t}\n\n\t\tvisit(tree, (node) => node.type === 'text', (node, index, parent) => {\n\t\t\tlet parsed = parseUrl(node.value)\n\t\t\tparsed = parsed.map((n) => {\n\t\t\t\tif (typeof n === 'string') {\n\t\t\t\t\treturn u('text', n)\n\t\t\t\t}\n\n\t\t\t\treturn u('link', {\n\t\t\t\t\turl: n.props.href,\n\t\t\t\t}, [u('text', n.props.href)])\n\t\t\t}).filter((x) => x)\n\n\t\t\tparent.children.splice(index, 1, ...parsed.flat())\n\t\t\treturn [SKIP, index + parsed.flat().length]\n\t\t})\n\t}\n}\n\nexport const parseUrl = (text) => {\n\tlet match = URL_PATTERN_AUTOLINK.exec(text)\n\tconst list = []\n\tlet start = 0\n\twhile (match !== null) {\n\t\tlet href = match[2]\n\t\tlet textAfter\n\t\tlet textBefore = text.substring(start, match.index + match[1].length)\n\t\tif (href[0] === ' ') {\n\t\t\ttextBefore += href[0]\n\t\t\thref = href.substring(1).trim()\n\t\t}\n\t\tconst lastChar = href[(href.length - 1)]\n\t\tif (lastChar === '.' || lastChar === ',' || lastChar === ';' || (match[0][0] === '(' && lastChar === ')')) {\n\t\t\thref = href.substring(0, href.length - 1)\n\t\t\ttextAfter = lastChar\n\t\t}\n\t\tlist.push(textBefore)\n\t\tlist.push({ component: NcLink, props: { href } })\n\t\tif (textAfter) {\n\t\t\tlist.push(textAfter)\n\t\t}\n\t\tstart = match.index + match[0].length\n\t\tmatch = URL_PATTERN_AUTOLINK.exec(text)\n\t}\n\tlist.push(text.substring(start))\n\tconst joinedText = list.map((item) => typeof item === 'string' ? item : item.props.href).join('')\n\tif (text === joinedText) {\n\t\treturn list\n\t}\n\tconsole.error('Failed to reassemble the chunked text: ' + text)\n\treturn text\n}\n\n/**\n * Try to get path for router link from an absolute or relative URL.\n *\n * @param {import('vue-router').default} router - VueRouter instance of the router link\n * @param {string} url - absolute URL to parse\n * @return {string|null} a path that can be useed in the router link or null if this URL doesn't match this router config\n * @example http://cloud.ltd/nextcloud/index.php/app/files/favorites?fileid=2#fragment => /files/favorites?fileid=2#fragment\n */\nexport const getRoute = (router, url) => {\n\t/**\n\t * http://cloud.ltd /nextcloud /index.php/app/files /favorites?fileid=2#fragment\n\t * |_____origin____|__________router-base__________|_________router-path________|\n\t * |__________base____________|\n\t * |___root___|\n\t */\n\n\t// Router is not defined in the app => not an app route\n\tif (!router) {\n\t\treturn null\n\t}\n\n\tconst isAbsoluteURL = /^https?:\\/\\//.test(url)\n\n\t// URL is not a link to this Nextcloud server instance => not an app route\n\tif ((isAbsoluteURL && !url.startsWith(getBaseUrl())) || (!isAbsoluteURL && !url.startsWith(getRootUrl()))) {\n\t\treturn null\n\t}\n\n\t// Vue 3: router.options.history.base\n\tconst routerBase = router.history.base\n\n\tconst urlWithoutOrigin = isAbsoluteURL ? url.slice(new URL(url).origin.length) : url\n\n\t// Remove index.php - it is optional in general case in both, VueRouter base and the URL\n\tconst urlWithoutOriginAndIndexPhp = url.startsWith((isAbsoluteURL ? getBaseUrl() : getRootUrl()) + '/index.php') ? urlWithoutOrigin.replace('/index.php', '') : urlWithoutOrigin\n\tconst routerBaseWithoutIndexPhp = routerBase.replace('/index.php', '')\n\n\t// This URL is not a part of this router by base\n\tif (!urlWithoutOriginAndIndexPhp.startsWith(routerBaseWithoutIndexPhp)) {\n\t\treturn null\n\t}\n\n\t// Root route may have an empty '' path, fallback to '/'\n\tconst routerPath = urlWithoutOriginAndIndexPhp.replace(routerBaseWithoutIndexPhp, '') || '/'\n\n\t// Check if there is actually matching route in the router for this path\n\tconst route = router.resolve(routerPath).route\n\n\tif (!route.matched.length) {\n\t\treturn null\n\t}\n\n\treturn route.fullPath\n}\n"],"names":["URL_PATTERN","URL_PATTERN_AUTOLINK","NcLink","h","remarkAutolink","autolink","useMarkdown","useExtendedMarkdown","tree","visit","node","index","parent","parsed","parseUrl","u","x","SKIP","text","match","list","start","href","textAfter","textBefore","lastChar","joinedText","item","getRoute","router","url","isAbsoluteURL","getBaseUrl","getRootUrl","routerBase","urlWithoutOrigin","urlWithoutOriginAndIndexPhp","routerBaseWithoutIndexPhp","routerPath","route"],"mappings":";uGAKaA,IAAc,4FAOdC,IAAuB;ACZpC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AA+BA,MAAMC,IAAS;AAAA,EACd,MAAM;AAAA,EACN,OAAO;AAAA,IACN,MAAM;AAAA,MACL,MAAM;AAAA,MACN,UAAU;AAAA,IACV;AAAA,EACD;AAAA,EACD,OAAOC,GAAG;AACT,WAAOA,EAAE,KAAK;AAAA,MACb,OAAO;AAAA,QACN,MAAM,KAAK;AAAA,QACX,KAAK;AAAA,QACL,QAAQ;AAAA,QACR,OAAO;AAAA,MACP;AAAA,IACD,GAAE,CAAC,KAAK,KAAK,KAAM,CAAA,CAAC;AAAA,EACrB;AACF,GAEaC,IAAiB,SAAS,EAAE,UAAAC,GAAU,aAAAC,GAAa,qBAAAC,EAAmB,GAAI;AACtF,SAAO,SAASC,GAAM;AAGr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
5
|
+
* @author Maksim Sukharev <antreesy.web@gmail.com>
|
|
6
|
+
*
|
|
7
|
+
* @license AGPL-3.0-or-later
|
|
8
|
+
*
|
|
9
|
+
* This program is free software: you can redistribute it and/or modify
|
|
10
|
+
* it under the terms of the GNU Affero General Public License as
|
|
11
|
+
* published by the Free Software Foundation, either version 3 of the
|
|
12
|
+
* License, or (at your option) any later version.
|
|
13
|
+
*
|
|
14
|
+
* This program is distributed in the hope that it will be useful,
|
|
15
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
17
|
+
* GNU Affero General Public License for more details.
|
|
18
|
+
*
|
|
19
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
20
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
21
|
+
*
|
|
22
|
+
*/
|
|
23
|
+
const d = (e, r, t) => {
|
|
24
|
+
const a = window.getComputedStyle(document.body).getPropertyValue("--background-invert-if-dark") === "invert(100%)";
|
|
25
|
+
return o("/avatar" + (t ? "/guest" : "") + "/{user}/{size}" + (a ? "/dark" : ""), {
|
|
26
|
+
user: e,
|
|
27
|
+
size: r
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
export {
|
|
31
|
+
d as g
|
|
32
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAvatarUrl-BHpn8LgJ.mjs","sources":["../../src/utils/getAvatarUrl.ts"],"sourcesContent":["/**\n * @copyright Copyright (c) 2024 Maksim Sukharev <antreesy.web@gmail.com>\n *\n * @author Maksim Sukharev <antreesy.web@gmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport { generateUrl } from '@nextcloud/router'\n\nexport const getAvatarUrl = (user: string, size: number | string, isGuest?: boolean): string => {\n\tconst darkTheme = window.getComputedStyle(document.body)\n\t\t.getPropertyValue('--background-invert-if-dark') === 'invert(100%)'\n\n\treturn generateUrl('/avatar' + (isGuest ? '/guest' : '') + '/{user}/{size}' + (darkTheme ? '/dark' : ''), {\n\t\tuser,\n\t\tsize,\n\t})\n}\n"],"names":["getAvatarUrl","user","size","isGuest","darkTheme","generateUrl"],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBO,MAAMA,IAAe,CAACC,GAAcC,GAAuBC,MAA8B;AACzF,QAAAC,IAAY,OAAO,iBAAiB,SAAS,IAAI,EACrD,iBAAiB,6BAA6B,MAAM;AAE/C,SAAAC,EAAY,aAAaF,IAAU,WAAW,MAAM,oBAAoBC,IAAY,UAAU,KAAK;AAAA,IACzG,MAAAH;AAAA,IACA,MAAAC;AAAA,EAAA,CACA;AACF;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const n = require("@nextcloud/router");
|
|
3
|
+
/**
|
|
4
|
+
* @copyright Copyright (c) 2024 Maksim Sukharev <antreesy.web@gmail.com>
|
|
5
|
+
*
|
|
6
|
+
* @author Maksim Sukharev <antreesy.web@gmail.com>
|
|
7
|
+
*
|
|
8
|
+
* @license AGPL-3.0-or-later
|
|
9
|
+
*
|
|
10
|
+
* This program is free software: you can redistribute it and/or modify
|
|
11
|
+
* it under the terms of the GNU Affero General Public License as
|
|
12
|
+
* published by the Free Software Foundation, either version 3 of the
|
|
13
|
+
* License, or (at your option) any later version.
|
|
14
|
+
*
|
|
15
|
+
* This program is distributed in the hope that it will be useful,
|
|
16
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
17
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
18
|
+
* GNU Affero General Public License for more details.
|
|
19
|
+
*
|
|
20
|
+
* You should have received a copy of the GNU Affero General Public License
|
|
21
|
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
22
|
+
*
|
|
23
|
+
*/
|
|
24
|
+
const o = (e, r, t) => {
|
|
25
|
+
const a = window.getComputedStyle(document.body).getPropertyValue("--background-invert-if-dark") === "invert(100%)";
|
|
26
|
+
return n.generateUrl("/avatar" + (t ? "/guest" : "") + "/{user}/{size}" + (a ? "/dark" : ""), {
|
|
27
|
+
user: e,
|
|
28
|
+
size: r
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
exports.getAvatarUrl = o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAvatarUrl-CjIpoO6I.cjs","sources":["../../src/utils/getAvatarUrl.ts"],"sourcesContent":["/**\n * @copyright Copyright (c) 2024 Maksim Sukharev <antreesy.web@gmail.com>\n *\n * @author Maksim Sukharev <antreesy.web@gmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport { generateUrl } from '@nextcloud/router'\n\nexport const getAvatarUrl = (user: string, size: number | string, isGuest?: boolean): string => {\n\tconst darkTheme = window.getComputedStyle(document.body)\n\t\t.getPropertyValue('--background-invert-if-dark') === 'invert(100%)'\n\n\treturn generateUrl('/avatar' + (isGuest ? '/guest' : '') + '/{user}/{size}' + (darkTheme ? '/dark' : ''), {\n\t\tuser,\n\t\tsize,\n\t})\n}\n"],"names":["getAvatarUrl","user","size","isGuest","darkTheme","generateUrl"],"mappings":";;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBO,MAAMA,IAAe,CAACC,GAAcC,GAAuBC,MAA8B;AACzF,QAAAC,IAAY,OAAO,iBAAiB,SAAS,IAAI,EACrD,iBAAiB,6BAA6B,MAAM;AAE/C,SAAAC,cAAY,aAAaF,IAAU,WAAW,MAAM,oBAAoBC,IAAY,UAAU,KAAK;AAAA,IACzG,MAAAH;AAAA,IACA,MAAAC;AAAA,EAAA,CACA;AACF;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
require('../assets/NcMentionBubble-
|
|
1
|
+
require('../assets/NcMentionBubble-7PQ8wEko.css');
|
|
2
2
|
"use strict";
|
|
3
|
-
const _ = require("
|
|
3
|
+
const _ = require("./getAvatarUrl-CjIpoO6I.cjs");
|
|
4
4
|
;/* empty css */
|
|
5
5
|
const m = require("./_plugin-vue2_normalizer-GXKvuwrq.cjs"), b = require("./Linkify-Dola0NBa.cjs"), f = require("escape-html"), g = require("striptags"), E = require("vue"), s = (t) => t && t.__esModule ? t : { default: t }, h = /* @__PURE__ */ s(f), l = /* @__PURE__ */ s(g), T = /* @__PURE__ */ s(E), y = {
|
|
6
6
|
name: "NcMentionBubble",
|
|
@@ -52,28 +52,23 @@ const m = require("./_plugin-vue2_normalizer-GXKvuwrq.cjs"), b = require("./Link
|
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
methods: {
|
|
55
|
-
getAvatarUrl
|
|
56
|
-
return _.generateUrl("/avatar/{user}/{size}", {
|
|
57
|
-
user: t,
|
|
58
|
-
size: e
|
|
59
|
-
});
|
|
60
|
-
}
|
|
55
|
+
getAvatarUrl: _.getAvatarUrl
|
|
61
56
|
}
|
|
62
57
|
};
|
|
63
58
|
var q = function() {
|
|
64
59
|
var e = this, n = e._self._c;
|
|
65
60
|
return n("span", { staticClass: "mention-bubble", class: { "mention-bubble--primary": e.primary }, attrs: { contenteditable: "false" } }, [n("span", { staticClass: "mention-bubble__wrapper" }, [n("span", { staticClass: "mention-bubble__content" }, [n("span", { staticClass: "mention-bubble__icon", class: [e.icon, "mention-bubble__icon--".concat(e.avatarUrl ? "with-avatar" : "")], style: e.avatarUrl ? { backgroundImage: "url(".concat(e.avatarUrl, ")") } : null }), n("span", { staticClass: "mention-bubble__title", attrs: { role: "heading", title: e.labelWithFallback } })]), n("span", { staticClass: "mention-bubble__select", attrs: { role: "none" } }, [e._v(e._s(e.mentionText))])])]);
|
|
66
|
-
}, S = [],
|
|
61
|
+
}, S = [], v = /* @__PURE__ */ m.normalizeComponent(
|
|
67
62
|
y,
|
|
68
63
|
q,
|
|
69
64
|
S,
|
|
70
65
|
!1,
|
|
71
66
|
null,
|
|
72
|
-
"
|
|
67
|
+
"791c3b28",
|
|
73
68
|
null,
|
|
74
69
|
null
|
|
75
70
|
);
|
|
76
|
-
const o =
|
|
71
|
+
const o = v.exports;
|
|
77
72
|
/**
|
|
78
73
|
* @copyright Copyright (c) 2020 John Molakvoæ <skjnldsv@protonmail.com>
|
|
79
74
|
*
|
|
@@ -95,7 +90,7 @@ const o = C.exports;
|
|
|
95
90
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
96
91
|
*
|
|
97
92
|
*/
|
|
98
|
-
const u = new RegExp("\\B(?<![^a-z0-9_\\-@.'\\s])").source,
|
|
93
|
+
const u = new RegExp("\\B(?<![^a-z0-9_\\-@.'\\s])").source, C = /(@[a-z0-9_\-@.']+)/.source, I = /@"guest\/[a-f0-9]+"/.source, $ = /@"(?:federated_)?(?:group|team|user){1}\/[a-z0-9_\-@.' /:]+"/.source, U = /@"[a-z0-9_\-@.' ]+"/.source, N = "(".concat(I, "|").concat($, "|").concat(U, ")"), c = new RegExp("".concat(u).concat(C), "gi"), d = new RegExp("".concat(u).concat(N), "gi"), M = {
|
|
99
94
|
props: {
|
|
100
95
|
userData: {
|
|
101
96
|
type: Object,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CMnR5Pf6.cjs","sources":["../../src/components/NcRichContenteditable/NcMentionBubble.vue","../../src/mixins/richEditor/index.js"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2020 John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @author John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n-->\n\n<template>\n\t<span :class=\"{'mention-bubble--primary': primary}\"\n\t\tclass=\"mention-bubble\"\n\t\tcontenteditable=\"false\">\n\t\t<span class=\"mention-bubble__wrapper\">\n\t\t\t<span class=\"mention-bubble__content\">\n\t\t\t\t<!-- Avatar or icon -->\n\t\t\t\t<span :class=\"[icon, `mention-bubble__icon--${avatarUrl ? 'with-avatar' : ''}`]\"\n\t\t\t\t\t:style=\"avatarUrl ? { backgroundImage: `url(${avatarUrl})` } : null\"\n\t\t\t\t\tclass=\"mention-bubble__icon\" />\n\n\t\t\t\t<!-- Title -->\n\t\t\t\t<span role=\"heading\" class=\"mention-bubble__title\" :title=\"labelWithFallback\" />\n\t\t\t</span>\n\n\t\t\t<!-- Selectable text for copy/paste -->\n\t\t\t<span role=\"none\" class=\"mention-bubble__select\">{{ mentionText }}</span>\n\t\t</span>\n\t</span>\n</template>\n\n<script>\nimport { getAvatarUrl } from '../../utils/getAvatarUrl.ts'\n\nexport default {\n\tname: 'NcMentionBubble',\n\n\tprops: {\n\t\tid: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\t/**\n\t\t * @deprecated Use `label` instead\n\t\t */\n\t\ttitle: {\n\t\t\ttype: String,\n\t\t\trequired: false,\n\t\t\tdefault: null,\n\t\t},\n\t\tlabel: {\n\t\t\ttype: String,\n\t\t\trequired: false,\n\t\t\tdefault: null,\n\t\t},\n\t\ticon: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\ticonUrl: {\n\t\t\ttype: [String, null],\n\t\t\tdefault: null,\n\t\t},\n\t\tsource: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\tprimary: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\tcomputed: {\n\t\tavatarUrl() {\n\t\t\tif (this.iconUrl) {\n\t\t\t\treturn this.iconUrl\n\t\t\t}\n\n\t\t\treturn this.id && this.source === 'users'\n\t\t\t\t? this.getAvatarUrl(this.id, 44)\n\t\t\t\t: null\n\t\t},\n\t\tmentionText() {\n\t\t\treturn !this.id.includes(' ') && !this.id.includes('/')\n\t\t\t\t? `@${this.id}`\n\t\t\t\t: `@\"${this.id}\"`\n\t\t},\n\t\t// Fallback to title for compatibility\n\t\tlabelWithFallback() {\n\t\t\treturn this.label || this.title\n\t\t},\n\t},\n\n\tmethods: {\n\t\tgetAvatarUrl,\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n$bubble-height: 20px;\n$bubble-max-width: 150px;\n$bubble-padding: 2px;\n$bubble-avatar-size: $bubble-height - 2 * $bubble-padding;\n\n.mention-bubble {\n\t&--primary &__content {\n\t\tcolor: var(--color-primary-element-text);\n\t\tbackground-color: var(--color-primary-element);\n\t}\n\n\t&__wrapper {\n\t\tmax-width: $bubble-max-width;\n\t\t// Align with text\n\t\theight: $bubble-height - $bubble-padding;\n\t\tvertical-align: text-bottom;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t}\n\n\t&__content {\n\t\tdisplay: inline-flex;\n\t\toverflow: hidden;\n\t\talign-items: center;\n\t\tmax-width: 100%;\n\t\theight: $bubble-height ;\n\t\t-webkit-user-select: none;\n\t\tuser-select: none;\n\t\tpadding-right: $bubble-padding * 3;\n\t\tpadding-left: $bubble-padding;\n\t\tborder-radius: math.div($bubble-height, 2);\n\t\tbackground-color: var(--color-background-dark);\n\t}\n\n\t&__icon {\n\t\tposition: relative;\n\t\twidth: $bubble-avatar-size;\n\t\theight: $bubble-avatar-size;\n\t\tborder-radius: math.div($bubble-avatar-size, 2);\n\t\tbackground-color: var(--color-background-darker);\n\t\tbackground-repeat: no-repeat;\n\t\tbackground-position: center;\n\t\tbackground-size: $bubble-avatar-size - 2 * $bubble-padding;\n\n\t\t&--with-avatar {\n\t\t\tcolor: inherit;\n\t\t\tbackground-size: cover;\n\t\t}\n\t}\n\n\t&__title {\n\t\toverflow: hidden;\n\t\tmargin-left: $bubble-padding;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t\t// Put title in ::before so it is not selectable\n\t\t&::before {\n\t\t\tcontent: attr(title);\n\t\t}\n\t}\n\n\t// Hide the mention id so it is selectable\n\t&__select {\n\t\tposition: absolute;\n\t\tz-index: -1;\n\t\tleft: -1000px;\n\t}\n}\n\n</style>\n","/**\n * @copyright Copyright (c) 2020 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport NcMentionBubble from '../../components/NcRichContenteditable/NcMentionBubble.vue'\nimport Linkify from '../../utils/Linkify.js'\n\nimport escapeHtml from 'escape-html'\nimport stripTags from 'striptags'\nimport Vue from 'vue'\n\n// Referenced from public function getMentions(): https://github.com/nextcloud/server/blob/master/lib/private/Comments/Comment.php\n// Beginning or whitespace. Non-capturing group within word boundary\nconst MENTION_START = /\\B(?<![^a-z0-9_\\-@.'\\s])/.source\n// Capturing groups like: @user-id, @\"guest/abc16def\", @\"federated_user/user-id\", @\"user-id with space\"\nconst MENTION_SIMPLE = /(@[a-z0-9_\\-@.']+)/.source\nconst MENTION_GUEST = /@"guest\\/[a-f0-9]+"/.source\nconst MENTION_PREFIXED = /@"(?:federated_)?(?:group|team|user){1}\\/[a-z0-9_\\-@.' /:]+"/.source\nconst MENTION_WITH_SPACE = /@"[a-z0-9_\\-@.' ]+"/.source\nconst MENTION_COMPLEX = `(${MENTION_GUEST}|${MENTION_PREFIXED}|${MENTION_WITH_SPACE})`\n// Concatenated regular expressions\nexport const USERID_REGEX = new RegExp(`${MENTION_START}${MENTION_SIMPLE}`, 'gi')\nexport const USERID_REGEX_WITH_SPACE = new RegExp(`${MENTION_START}${MENTION_COMPLEX}`, 'gi')\n\nexport default {\n\tprops: {\n\t\tuserData: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\t},\n\tmethods: {\n\t\t/**\n\t\t * Convert the value string to html for the inner content\n\t\t *\n\t\t * @param {string} value the content without html\n\t\t * @return {string} rendered html\n\t\t */\n\t\trenderContent(value) {\n\t\t\t// Sanitize the value prop\n\t\t\tconst sanitizedValue = escapeHtml(value)\n\n\t\t\t// Extract all the userIds\n\t\t\tconst splitValue = sanitizedValue.split(USERID_REGEX)\n\t\t\t\t.map(part => part.split(USERID_REGEX_WITH_SPACE)).flat()\n\n\t\t\t// Replace userIds by html\n\t\t\treturn splitValue\n\t\t\t\t.map(part => {\n\t\t\t\t\t// When splitting, the string is always putting the userIds\n\t\t\t\t\t// on the uneven indexes. We only want to generate the mentions html\n\t\t\t\t\tif (!part.startsWith('@')) {\n\t\t\t\t\t\t// This part doesn't contain a mention, let's make sure links are parsed\n\t\t\t\t\t\treturn Linkify(part)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Extracting the id, nuking the leading @ and all \"\n\t\t\t\t\tconst id = part.slice(1).replace(/"/gi, '')\n\t\t\t\t\t// Compiling template and prepend with the space we removed during the split\n\t\t\t\t\treturn this.genSelectTemplate(id)\n\t\t\t\t})\n\t\t\t\t.join('')\n\t\t\t\t.replace(/\\n/gmi, '<br>')\n\t\t\t\t.replace(/&/gmi, '&')\n\t\t},\n\n\t\t/**\n\t\t * Convert the innerHtml content to a string with mentions as text\n\t\t *\n\t\t * @param {string} content the content without html\n\t\t * @return {string}\n\t\t */\n\t\tparseContent(content) {\n\t\t\tlet text = content\n\t\t\t// Consecutive spaces in HTML tags should collapse\n\t\t\ttext = text.replace(/>\\s+</g, '><')\n\t\t\t// Replace break lines with new lines\n\t\t\ttext = text.replace(/<br>/gmi, '\\n')\n\t\t\t// Replace some html special characters\n\t\t\ttext = text.replace(/ /gmi, ' ')\n\t\t\ttext = text.replace(/&/gmi, '&')\n\n\t\t\t// Convert the mentions to text only\n\t\t\t// first we replace divs with new lines\n\t\t\ttext = text.replace(/<\\/div>/gmi, '\\n')\n\t\t\t// then we remove all leftover html\n\t\t\ttext = stripTags(text, '<div>')\n\t\t\ttext = stripTags(text)\n\n\t\t\treturn text\n\t\t},\n\n\t\t/**\n\t\t * Generate an autocompletion popup entry template\n\t\t *\n\t\t * @param {string} value the value to match against the userData\n\t\t * @return {string}\n\t\t */\n\t\tgenSelectTemplate(value) {\n\t\t\t// The value returned by this function will replace the trigger '@'\n\t\t\t// and the search text, so when there is no match we simply return\n\t\t\t// '@' and the text.\n\t\t\tif (typeof value === 'undefined') {\n\t\t\t\treturn `${this.autocompleteTribute.current.collection.trigger}${this.autocompleteTribute.current.mentionText}`\n\t\t\t}\n\n\t\t\tconst data = this.userData[value]\n\n\t\t\t// Fallback to @mention in case no data matches\n\t\t\tif (!data) {\n\t\t\t\t// return @value if matches MENTION_SIMPLE, @\"value\" otherwise\n\t\t\t\treturn [' ', '/', ':'].every(char => !value.includes(char))\n\t\t\t\t\t? `@${value}`\n\t\t\t\t\t: `@\"${value}\"`\n\t\t\t}\n\n\t\t\t// Return template and make sure we strip of new lines and tabs\n\t\t\treturn this.renderComponentHtml(data, NcMentionBubble).replace(/[\\n\\t]/gmi, '')\n\t\t},\n\n\t\t/**\n\t\t * Render a component and return its html content\n\t\t *\n\t\t * @param {object} propsData the props to pass to the component\n\t\t * @param {object} component the component to render\n\t\t * @return {string} the rendered html\n\t\t */\n\t\trenderComponentHtml(propsData, component) {\n\t\t\tconst View = Vue.extend(component)\n\t\t\tconst Item = new View({\n\t\t\t\tpropsData,\n\t\t\t})\n\n\t\t\t// Prepare mountpoint\n\t\t\tconst wrapper = document.createElement('div')\n\t\t\tconst mount = document.createElement('div')\n\t\t\twrapper.style.display = 'none'\n\t\t\twrapper.appendChild(mount)\n\t\t\tdocument.body.appendChild(wrapper)\n\n\t\t\t// Mount and get raw html\n\t\t\tItem.$mount(mount)\n\t\t\tconst renderedHtml = wrapper.innerHTML\n\n\t\t\t// Destroy\n\t\t\tItem.$destroy()\n\t\t\twrapper.remove()\n\n\t\t\treturn renderedHtml\n\t\t},\n\t},\n}\n"],"names":["_sfc_main","getAvatarUrl","MENTION_START","MENTION_SIMPLE","MENTION_GUEST","MENTION_PREFIXED","MENTION_WITH_SPACE","MENTION_COMPLEX","USERID_REGEX","USERID_REGEX_WITH_SPACE","richEditor","value","escapeHtml","part","Linkify","id","content","text","stripTags","data","NcMentionBubble","char","propsData","component","View","Vue","Item","wrapper","mount","renderedHtml"],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A,IACP;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQD,kBAAkBN,GAAO;AAIxB,UAAI,OAAOA,IAAU;AACpB,eAAO,GAAG,YAAK,oBAAoB,QAAQ,WAAW,SAAU,YAAK,oBAAoB,QAAQ;AAGlG,YAAMQ,IAAO,KAAK,SAASR,CAAK;AAGhC,aAAKQ,IAQE,KAAK,oBAAoBA,GAAMC,CAAe,EAAE,QAAQ,aAAa,EAAE,IANtE,CAAC,KAAK,KAAK,GAAG,EAAE,MAAM,CAAAC,MAAQ,CAACV,EAAM,SAASU,CAAI,CAAC,IACvD,IAAI,OAAAV,KACJ,KAAK,OAAAA,GAAK;AAAA,IAKd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASD,oBAAoBW,GAAWC,GAAW;AACzC,YAAMC,IAAOC,EAAAA,QAAI,OAAOF,CAAS,GAC3BG,IAAO,IAAIF,EAAK;AAAA,QACrB,WAAAF;AAAA,MACJ,CAAI,GAGKK,IAAU,SAAS,cAAc,KAAK,GACtCC,IAAQ,SAAS,cAAc,KAAK;AAC1C,MAAAD,EAAQ,MAAM,UAAU,QACxBA,EAAQ,YAAYC,CAAK,GACzB,SAAS,KAAK,YAAYD,CAAO,GAGjCD,EAAK,OAAOE,CAAK;AACjB,YAAMC,IAAeF,EAAQ;AAG7B,aAAAD,EAAK,SAAU,GACfC,EAAQ,OAAQ,GAETE;AAAA,IACP;AAAA,EACD;AACF;;;;;"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import '../assets/NcMentionBubble-
|
|
2
|
-
import {
|
|
1
|
+
import '../assets/NcMentionBubble-7PQ8wEko.css';
|
|
2
|
+
import { g as c } from "./getAvatarUrl-BHpn8LgJ.mjs";
|
|
3
3
|
/* empty css */
|
|
4
4
|
import { n as u } from "./_plugin-vue2_normalizer-Bj5bLKV4.mjs";
|
|
5
5
|
import { L as p } from "./Linkify-BaDLLFxP.mjs";
|
|
6
6
|
import m from "escape-html";
|
|
7
7
|
import a from "striptags";
|
|
8
8
|
import d from "vue";
|
|
9
|
-
const
|
|
9
|
+
const b = {
|
|
10
10
|
name: "NcMentionBubble",
|
|
11
11
|
props: {
|
|
12
12
|
id: {
|
|
@@ -56,28 +56,23 @@ const _ = {
|
|
|
56
56
|
}
|
|
57
57
|
},
|
|
58
58
|
methods: {
|
|
59
|
-
getAvatarUrl
|
|
60
|
-
return c("/avatar/{user}/{size}", {
|
|
61
|
-
user: t,
|
|
62
|
-
size: e
|
|
63
|
-
});
|
|
64
|
-
}
|
|
59
|
+
getAvatarUrl: c
|
|
65
60
|
}
|
|
66
61
|
};
|
|
67
|
-
var
|
|
68
|
-
var e = this,
|
|
69
|
-
return
|
|
70
|
-
},
|
|
71
|
-
_,
|
|
62
|
+
var _ = function() {
|
|
63
|
+
var e = this, n = e._self._c;
|
|
64
|
+
return n("span", { staticClass: "mention-bubble", class: { "mention-bubble--primary": e.primary }, attrs: { contenteditable: "false" } }, [n("span", { staticClass: "mention-bubble__wrapper" }, [n("span", { staticClass: "mention-bubble__content" }, [n("span", { staticClass: "mention-bubble__icon", class: [e.icon, "mention-bubble__icon--".concat(e.avatarUrl ? "with-avatar" : "")], style: e.avatarUrl ? { backgroundImage: "url(".concat(e.avatarUrl, ")") } : null }), n("span", { staticClass: "mention-bubble__title", attrs: { role: "heading", title: e.labelWithFallback } })]), n("span", { staticClass: "mention-bubble__select", attrs: { role: "none" } }, [e._v(e._s(e.mentionText))])])]);
|
|
65
|
+
}, g = [], f = /* @__PURE__ */ u(
|
|
72
66
|
b,
|
|
73
|
-
|
|
67
|
+
_,
|
|
68
|
+
g,
|
|
74
69
|
!1,
|
|
75
70
|
null,
|
|
76
|
-
"
|
|
71
|
+
"791c3b28",
|
|
77
72
|
null,
|
|
78
73
|
null
|
|
79
74
|
);
|
|
80
|
-
const h =
|
|
75
|
+
const h = f.exports;
|
|
81
76
|
/**
|
|
82
77
|
* @copyright Copyright (c) 2020 John Molakvoæ <skjnldsv@protonmail.com>
|
|
83
78
|
*
|
|
@@ -99,7 +94,7 @@ const h = g.exports;
|
|
|
99
94
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
100
95
|
*
|
|
101
96
|
*/
|
|
102
|
-
const l = new RegExp("\\B(?<![^a-z0-9_\\-@.'\\s])").source, E = /(@[a-z0-9_\-@.']+)/.source, T = /@"guest\/[a-f0-9]+"/.source, y = /@"(?:federated_)?(?:group|team|user){1}\/[a-z0-9_\-@.' /:]+"/.source, $ = /@"[a-z0-9_\-@.' ]+"/.source,
|
|
97
|
+
const l = new RegExp("\\B(?<![^a-z0-9_\\-@.'\\s])").source, E = /(@[a-z0-9_\-@.']+)/.source, T = /@"guest\/[a-f0-9]+"/.source, y = /@"(?:federated_)?(?:group|team|user){1}\/[a-z0-9_\-@.' /:]+"/.source, $ = /@"[a-z0-9_\-@.' ]+"/.source, C = "(".concat(T, "|").concat(y, "|").concat($, ")"), v = new RegExp("".concat(l).concat(E), "gi"), N = new RegExp("".concat(l).concat(C), "gi"), O = {
|
|
103
98
|
props: {
|
|
104
99
|
userData: {
|
|
105
100
|
type: Object,
|
|
@@ -114,10 +109,10 @@ const l = new RegExp("\\B(?<![^a-z0-9_\\-@.'\\s])").source, E = /(@[a-z0-9_\-@.'
|
|
|
114
109
|
* @return {string} rendered html
|
|
115
110
|
*/
|
|
116
111
|
renderContent(t) {
|
|
117
|
-
return m(t).split(
|
|
118
|
-
if (!
|
|
119
|
-
return p(
|
|
120
|
-
const i =
|
|
112
|
+
return m(t).split(v).map((r) => r.split(N)).flat().map((r) => {
|
|
113
|
+
if (!r.startsWith("@"))
|
|
114
|
+
return p(r);
|
|
115
|
+
const i = r.slice(1).replace(/"/gi, "");
|
|
121
116
|
return this.genSelectTemplate(i);
|
|
122
117
|
}).join("").replace(/\n/gmi, "<br>").replace(/&/gmi, "&");
|
|
123
118
|
},
|
|
@@ -141,7 +136,7 @@ const l = new RegExp("\\B(?<![^a-z0-9_\\-@.'\\s])").source, E = /(@[a-z0-9_\-@.'
|
|
|
141
136
|
if (typeof t > "u")
|
|
142
137
|
return "".concat(this.autocompleteTribute.current.collection.trigger).concat(this.autocompleteTribute.current.mentionText);
|
|
143
138
|
const e = this.userData[t];
|
|
144
|
-
return e ? this.renderComponentHtml(e, h).replace(/[\n\t]/gmi, "") : [" ", "/", ":"].every((
|
|
139
|
+
return e ? this.renderComponentHtml(e, h).replace(/[\n\t]/gmi, "") : [" ", "/", ":"].every((n) => !t.includes(n)) ? "@".concat(t) : '@"'.concat(t, '"');
|
|
145
140
|
},
|
|
146
141
|
/**
|
|
147
142
|
* Render a component and return its html content
|
|
@@ -151,18 +146,18 @@ const l = new RegExp("\\B(?<![^a-z0-9_\\-@.'\\s])").source, E = /(@[a-z0-9_\-@.'
|
|
|
151
146
|
* @return {string} the rendered html
|
|
152
147
|
*/
|
|
153
148
|
renderComponentHtml(t, e) {
|
|
154
|
-
const
|
|
149
|
+
const n = d.extend(e), r = new n({
|
|
155
150
|
propsData: t
|
|
156
151
|
}), i = document.createElement("div"), s = document.createElement("div");
|
|
157
|
-
i.style.display = "none", i.appendChild(s), document.body.appendChild(i),
|
|
152
|
+
i.style.display = "none", i.appendChild(s), document.body.appendChild(i), r.$mount(s);
|
|
158
153
|
const o = i.innerHTML;
|
|
159
|
-
return
|
|
154
|
+
return r.$destroy(), i.remove(), o;
|
|
160
155
|
}
|
|
161
156
|
}
|
|
162
157
|
};
|
|
163
158
|
export {
|
|
164
159
|
h as N,
|
|
165
|
-
|
|
160
|
+
v as U,
|
|
166
161
|
N as a,
|
|
167
|
-
|
|
162
|
+
O as r
|
|
168
163
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-uiNhPYvS.mjs","sources":["../../src/components/NcRichContenteditable/NcMentionBubble.vue","../../src/mixins/richEditor/index.js"],"sourcesContent":["<!--\n - @copyright Copyright (c) 2020 John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @author John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @license GNU AGPL version 3 or any later version\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n-->\n\n<template>\n\t<span :class=\"{'mention-bubble--primary': primary}\"\n\t\tclass=\"mention-bubble\"\n\t\tcontenteditable=\"false\">\n\t\t<span class=\"mention-bubble__wrapper\">\n\t\t\t<span class=\"mention-bubble__content\">\n\t\t\t\t<!-- Avatar or icon -->\n\t\t\t\t<span :class=\"[icon, `mention-bubble__icon--${avatarUrl ? 'with-avatar' : ''}`]\"\n\t\t\t\t\t:style=\"avatarUrl ? { backgroundImage: `url(${avatarUrl})` } : null\"\n\t\t\t\t\tclass=\"mention-bubble__icon\" />\n\n\t\t\t\t<!-- Title -->\n\t\t\t\t<span role=\"heading\" class=\"mention-bubble__title\" :title=\"labelWithFallback\" />\n\t\t\t</span>\n\n\t\t\t<!-- Selectable text for copy/paste -->\n\t\t\t<span role=\"none\" class=\"mention-bubble__select\">{{ mentionText }}</span>\n\t\t</span>\n\t</span>\n</template>\n\n<script>\nimport { getAvatarUrl } from '../../utils/getAvatarUrl.ts'\n\nexport default {\n\tname: 'NcMentionBubble',\n\n\tprops: {\n\t\tid: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\t/**\n\t\t * @deprecated Use `label` instead\n\t\t */\n\t\ttitle: {\n\t\t\ttype: String,\n\t\t\trequired: false,\n\t\t\tdefault: null,\n\t\t},\n\t\tlabel: {\n\t\t\ttype: String,\n\t\t\trequired: false,\n\t\t\tdefault: null,\n\t\t},\n\t\ticon: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\ticonUrl: {\n\t\t\ttype: [String, null],\n\t\t\tdefault: null,\n\t\t},\n\t\tsource: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\tprimary: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\tcomputed: {\n\t\tavatarUrl() {\n\t\t\tif (this.iconUrl) {\n\t\t\t\treturn this.iconUrl\n\t\t\t}\n\n\t\t\treturn this.id && this.source === 'users'\n\t\t\t\t? this.getAvatarUrl(this.id, 44)\n\t\t\t\t: null\n\t\t},\n\t\tmentionText() {\n\t\t\treturn !this.id.includes(' ') && !this.id.includes('/')\n\t\t\t\t? `@${this.id}`\n\t\t\t\t: `@\"${this.id}\"`\n\t\t},\n\t\t// Fallback to title for compatibility\n\t\tlabelWithFallback() {\n\t\t\treturn this.label || this.title\n\t\t},\n\t},\n\n\tmethods: {\n\t\tgetAvatarUrl,\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n$bubble-height: 20px;\n$bubble-max-width: 150px;\n$bubble-padding: 2px;\n$bubble-avatar-size: $bubble-height - 2 * $bubble-padding;\n\n.mention-bubble {\n\t&--primary &__content {\n\t\tcolor: var(--color-primary-element-text);\n\t\tbackground-color: var(--color-primary-element);\n\t}\n\n\t&__wrapper {\n\t\tmax-width: $bubble-max-width;\n\t\t// Align with text\n\t\theight: $bubble-height - $bubble-padding;\n\t\tvertical-align: text-bottom;\n\t\tdisplay: inline-flex;\n\t\talign-items: center;\n\t}\n\n\t&__content {\n\t\tdisplay: inline-flex;\n\t\toverflow: hidden;\n\t\talign-items: center;\n\t\tmax-width: 100%;\n\t\theight: $bubble-height ;\n\t\t-webkit-user-select: none;\n\t\tuser-select: none;\n\t\tpadding-right: $bubble-padding * 3;\n\t\tpadding-left: $bubble-padding;\n\t\tborder-radius: math.div($bubble-height, 2);\n\t\tbackground-color: var(--color-background-dark);\n\t}\n\n\t&__icon {\n\t\tposition: relative;\n\t\twidth: $bubble-avatar-size;\n\t\theight: $bubble-avatar-size;\n\t\tborder-radius: math.div($bubble-avatar-size, 2);\n\t\tbackground-color: var(--color-background-darker);\n\t\tbackground-repeat: no-repeat;\n\t\tbackground-position: center;\n\t\tbackground-size: $bubble-avatar-size - 2 * $bubble-padding;\n\n\t\t&--with-avatar {\n\t\t\tcolor: inherit;\n\t\t\tbackground-size: cover;\n\t\t}\n\t}\n\n\t&__title {\n\t\toverflow: hidden;\n\t\tmargin-left: $bubble-padding;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t\t// Put title in ::before so it is not selectable\n\t\t&::before {\n\t\t\tcontent: attr(title);\n\t\t}\n\t}\n\n\t// Hide the mention id so it is selectable\n\t&__select {\n\t\tposition: absolute;\n\t\tz-index: -1;\n\t\tleft: -1000px;\n\t}\n}\n\n</style>\n","/**\n * @copyright Copyright (c) 2020 John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @author John Molakvoæ <skjnldsv@protonmail.com>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport NcMentionBubble from '../../components/NcRichContenteditable/NcMentionBubble.vue'\nimport Linkify from '../../utils/Linkify.js'\n\nimport escapeHtml from 'escape-html'\nimport stripTags from 'striptags'\nimport Vue from 'vue'\n\n// Referenced from public function getMentions(): https://github.com/nextcloud/server/blob/master/lib/private/Comments/Comment.php\n// Beginning or whitespace. Non-capturing group within word boundary\nconst MENTION_START = /\\B(?<![^a-z0-9_\\-@.'\\s])/.source\n// Capturing groups like: @user-id, @\"guest/abc16def\", @\"federated_user/user-id\", @\"user-id with space\"\nconst MENTION_SIMPLE = /(@[a-z0-9_\\-@.']+)/.source\nconst MENTION_GUEST = /@"guest\\/[a-f0-9]+"/.source\nconst MENTION_PREFIXED = /@"(?:federated_)?(?:group|team|user){1}\\/[a-z0-9_\\-@.' /:]+"/.source\nconst MENTION_WITH_SPACE = /@"[a-z0-9_\\-@.' ]+"/.source\nconst MENTION_COMPLEX = `(${MENTION_GUEST}|${MENTION_PREFIXED}|${MENTION_WITH_SPACE})`\n// Concatenated regular expressions\nexport const USERID_REGEX = new RegExp(`${MENTION_START}${MENTION_SIMPLE}`, 'gi')\nexport const USERID_REGEX_WITH_SPACE = new RegExp(`${MENTION_START}${MENTION_COMPLEX}`, 'gi')\n\nexport default {\n\tprops: {\n\t\tuserData: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\n\t\t},\n\t},\n\tmethods: {\n\t\t/**\n\t\t * Convert the value string to html for the inner content\n\t\t *\n\t\t * @param {string} value the content without html\n\t\t * @return {string} rendered html\n\t\t */\n\t\trenderContent(value) {\n\t\t\t// Sanitize the value prop\n\t\t\tconst sanitizedValue = escapeHtml(value)\n\n\t\t\t// Extract all the userIds\n\t\t\tconst splitValue = sanitizedValue.split(USERID_REGEX)\n\t\t\t\t.map(part => part.split(USERID_REGEX_WITH_SPACE)).flat()\n\n\t\t\t// Replace userIds by html\n\t\t\treturn splitValue\n\t\t\t\t.map(part => {\n\t\t\t\t\t// When splitting, the string is always putting the userIds\n\t\t\t\t\t// on the uneven indexes. We only want to generate the mentions html\n\t\t\t\t\tif (!part.startsWith('@')) {\n\t\t\t\t\t\t// This part doesn't contain a mention, let's make sure links are parsed\n\t\t\t\t\t\treturn Linkify(part)\n\t\t\t\t\t}\n\n\t\t\t\t\t// Extracting the id, nuking the leading @ and all \"\n\t\t\t\t\tconst id = part.slice(1).replace(/"/gi, '')\n\t\t\t\t\t// Compiling template and prepend with the space we removed during the split\n\t\t\t\t\treturn this.genSelectTemplate(id)\n\t\t\t\t})\n\t\t\t\t.join('')\n\t\t\t\t.replace(/\\n/gmi, '<br>')\n\t\t\t\t.replace(/&/gmi, '&')\n\t\t},\n\n\t\t/**\n\t\t * Convert the innerHtml content to a string with mentions as text\n\t\t *\n\t\t * @param {string} content the content without html\n\t\t * @return {string}\n\t\t */\n\t\tparseContent(content) {\n\t\t\tlet text = content\n\t\t\t// Consecutive spaces in HTML tags should collapse\n\t\t\ttext = text.replace(/>\\s+</g, '><')\n\t\t\t// Replace break lines with new lines\n\t\t\ttext = text.replace(/<br>/gmi, '\\n')\n\t\t\t// Replace some html special characters\n\t\t\ttext = text.replace(/ /gmi, ' ')\n\t\t\ttext = text.replace(/&/gmi, '&')\n\n\t\t\t// Convert the mentions to text only\n\t\t\t// first we replace divs with new lines\n\t\t\ttext = text.replace(/<\\/div>/gmi, '\\n')\n\t\t\t// then we remove all leftover html\n\t\t\ttext = stripTags(text, '<div>')\n\t\t\ttext = stripTags(text)\n\n\t\t\treturn text\n\t\t},\n\n\t\t/**\n\t\t * Generate an autocompletion popup entry template\n\t\t *\n\t\t * @param {string} value the value to match against the userData\n\t\t * @return {string}\n\t\t */\n\t\tgenSelectTemplate(value) {\n\t\t\t// The value returned by this function will replace the trigger '@'\n\t\t\t// and the search text, so when there is no match we simply return\n\t\t\t// '@' and the text.\n\t\t\tif (typeof value === 'undefined') {\n\t\t\t\treturn `${this.autocompleteTribute.current.collection.trigger}${this.autocompleteTribute.current.mentionText}`\n\t\t\t}\n\n\t\t\tconst data = this.userData[value]\n\n\t\t\t// Fallback to @mention in case no data matches\n\t\t\tif (!data) {\n\t\t\t\t// return @value if matches MENTION_SIMPLE, @\"value\" otherwise\n\t\t\t\treturn [' ', '/', ':'].every(char => !value.includes(char))\n\t\t\t\t\t? `@${value}`\n\t\t\t\t\t: `@\"${value}\"`\n\t\t\t}\n\n\t\t\t// Return template and make sure we strip of new lines and tabs\n\t\t\treturn this.renderComponentHtml(data, NcMentionBubble).replace(/[\\n\\t]/gmi, '')\n\t\t},\n\n\t\t/**\n\t\t * Render a component and return its html content\n\t\t *\n\t\t * @param {object} propsData the props to pass to the component\n\t\t * @param {object} component the component to render\n\t\t * @return {string} the rendered html\n\t\t */\n\t\trenderComponentHtml(propsData, component) {\n\t\t\tconst View = Vue.extend(component)\n\t\t\tconst Item = new View({\n\t\t\t\tpropsData,\n\t\t\t})\n\n\t\t\t// Prepare mountpoint\n\t\t\tconst wrapper = document.createElement('div')\n\t\t\tconst mount = document.createElement('div')\n\t\t\twrapper.style.display = 'none'\n\t\t\twrapper.appendChild(mount)\n\t\t\tdocument.body.appendChild(wrapper)\n\n\t\t\t// Mount and get raw html\n\t\t\tItem.$mount(mount)\n\t\t\tconst renderedHtml = wrapper.innerHTML\n\n\t\t\t// Destroy\n\t\t\tItem.$destroy()\n\t\t\twrapper.remove()\n\n\t\t\treturn renderedHtml\n\t\t},\n\t},\n}\n"],"names":["_sfc_main","getAvatarUrl","MENTION_START","MENTION_SIMPLE","MENTION_GUEST","MENTION_PREFIXED","MENTION_WITH_SPACE","MENTION_COMPLEX","USERID_REGEX","USERID_REGEX_WITH_SPACE","richEditor","value","escapeHtml","part","Linkify","id","content","text","stripTags","data","NcMentionBubble","char","propsData","component","View","Vue","Item","wrapper","mount","renderedHtml"],"mappings":";;;;;;;AA6CA,MAAAA,IAAA;AAAA,EACA,MAAA;AAAA,EAEA,OAAA;AAAA,IACA,IAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA;AAAA;AAAA;AAAA,IAIA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,IACA,OAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,MACA,SAAA;AAAA,IACA;AAAA,IACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,UAAA;AAAA,IACA;AAAA,IACA,SAAA;AAAA,MACA,MAAA,CAAA,QAAA,IAAA;AAAA,MAC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AAA;AAAA;AAAA;AAAA;AAAA,IASD,oBAAoBW,GAAWC,GAAW;AACzC,YAAMC,IAAOC,EAAI,OAAOF,CAAS,GAC3BG,IAAO,IAAIF,EAAK;AAAA,QACrB,WAAAF;AAAA,MACJ,CAAI,GAGKK,IAAU,SAAS,cAAc,KAAK,GACtCC,IAAQ,SAAS,cAAc,KAAK;AAC1C,MAAAD,EAAQ,MAAM,UAAU,QACxBA,EAAQ,YAAYC,CAAK,GACzB,SAAS,KAAK,YAAYD,CAAO,GAGjCD,EAAK,OAAOE,CAAK;AACjB,YAAMC,IAAeF,EAAQ;AAG7B,aAAAD,EAAK,SAAU,GACfC,EAAQ,OAAQ,GAETE;AAAA,IACP;AAAA,EACD;AACF;"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import '../assets/referencePickerModal-DWB2ghBg.css';
|
|
2
2
|
import { e as Et, i as xe, h as Pt, a as St, f as kt, d as F, g as xt, c as $t, j as Ot } from "./index-CU14QsCg.mjs";
|
|
3
3
|
import { n as O } from "./_plugin-vue2_normalizer-Bj5bLKV4.mjs";
|
|
4
|
-
import { r as q, P as Nt, a as S, Q as Lt, R as Tt, S as Ke, T as It, u as Vt, U as At, E as jt, V as Bt } from "./_l10n-
|
|
4
|
+
import { r as q, P as Nt, a as S, Q as Lt, R as Tt, S as Ke, T as It, u as Vt, U as At, E as jt, V as Bt } from "./_l10n-BaNxGGXy.mjs";
|
|
5
5
|
import ye from "@nextcloud/axios";
|
|
6
6
|
import { loadState as Je } from "@nextcloud/initial-state";
|
|
7
7
|
import { imagePath as qt, generateOcsUrl as Z } from "@nextcloud/router";
|
|
8
8
|
import ge from "../Components/NcEmptyContent.mjs";
|
|
9
9
|
import { N as Xe } from "./index-CnpswYi6.mjs";
|
|
10
|
-
import { N as Ye } from "./NcSelect-
|
|
10
|
+
import { N as Ye } from "./NcSelect-Bo71Yd6L.mjs";
|
|
11
11
|
import { useIntersectionObserver as Mt, useResizeObserver as Ut } from "@vueuse/core";
|
|
12
12
|
import Dt, { ref as fe } from "vue";
|
|
13
|
-
import { g as Wt } from "./autolink-
|
|
13
|
+
import { g as Wt } from "./autolink-DNGB8YSW.mjs";
|
|
14
14
|
import Ze from "../Components/NcButton.mjs";
|
|
15
15
|
import Ft from "../Components/NcLoadingIcon.mjs";
|
|
16
|
-
import { N as zt } from "./NcTextField-
|
|
16
|
+
import { N as zt } from "./NcTextField-D_eUEl2B.mjs";
|
|
17
17
|
import { D as Ht } from "./DotsHorizontal-DfVgEXgz.mjs";
|
|
18
18
|
import Gt from "../Components/NcModal.mjs";
|
|
19
19
|
import { emit as Qt } from "@nextcloud/event-bus";
|