@nextcloud/vue 8.6.1 → 8.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/dist/Components/NcActionButton.cjs +6 -6
- package/dist/Components/NcActionButton.cjs.map +1 -1
- package/dist/Components/NcActionButton.mjs +3 -3
- package/dist/Components/NcActionButton.mjs.map +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/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/NcAppNavigationSettings.cjs +1 -1
- package/dist/Components/NcAppNavigationSettings.mjs +1 -1
- package/dist/Components/NcAppSidebar.cjs +1 -1
- package/dist/Components/NcAppSidebar.mjs +1 -1
- package/dist/Components/NcAppSidebarTab.cjs +3 -3
- package/dist/Components/NcAppSidebarTab.cjs.map +1 -1
- package/dist/Components/NcAppSidebarTab.mjs +5 -5
- package/dist/Components/NcAppSidebarTab.mjs.map +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/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/NcDateTimePicker.cjs +3 -3
- package/dist/Components/NcDateTimePicker.cjs.map +1 -1
- package/dist/Components/NcDateTimePicker.mjs +8 -8
- package/dist/Components/NcDateTimePicker.mjs.map +1 -1
- package/dist/Components/NcDateTimePickerNative.cjs +1 -1
- package/dist/Components/NcDateTimePickerNative.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 +7 -7
- package/dist/Components/NcModal.cjs.map +1 -1
- package/dist/Components/NcModal.mjs +7 -7
- package/dist/Components/NcModal.mjs.map +1 -1
- package/dist/Components/NcRichContenteditable.cjs +1 -1
- package/dist/Components/NcRichContenteditable.mjs +2 -2
- package/dist/Components/NcRichText.cjs +11 -11
- package/dist/Components/NcRichText.cjs.map +1 -1
- package/dist/Components/NcRichText.mjs +22 -21
- package/dist/Components/NcRichText.mjs.map +1 -1
- 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/NcSettingsSelectGroup.cjs +1 -1
- package/dist/Components/NcSettingsSelectGroup.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/Functions/reference.cjs +16 -0
- package/dist/Functions/reference.cjs.map +1 -0
- package/dist/Functions/reference.mjs +17 -0
- package/dist/Functions/reference.mjs.map +1 -0
- package/dist/Functions/registerReference.cjs +71 -0
- package/dist/Functions/registerReference.cjs.map +1 -0
- package/dist/Functions/registerReference.mjs +71 -0
- package/dist/Functions/registerReference.mjs.map +1 -0
- package/dist/Mixins/richEditor.cjs +1 -1
- package/dist/Mixins/richEditor.mjs +1 -1
- package/dist/assets/{NcActionButton-1Z9lN7ar.css → NcActionButton-rOZFVQA8.css} +17 -17
- package/dist/assets/{NcActions-mSL9fcPO.css → NcActions-4Gq5bZLW.css} +12 -12
- package/dist/assets/{NcAppSidebar-iU8Zp4Qk.css → NcAppSidebar-YHd7DpMW.css} +44 -44
- package/dist/assets/{NcAppSidebarTab-Phau6edJ.css → NcAppSidebarTab-FywbKxqo.css} +4 -4
- package/dist/assets/{NcBreadcrumb-M3hqCbqS.css → NcBreadcrumb-HspaFygg.css} +16 -16
- package/dist/assets/{NcDateTimePicker-vivOLt2Q.css → NcDateTimePicker-w8SEtYvQ.css} +17 -17
- package/dist/assets/{NcHeaderMenu-06vdn4tC.css → NcHeaderMenu-Srn5iXdL.css} +14 -15
- package/dist/assets/NcListItem-L8LeGwpe.css +165 -0
- package/dist/assets/{NcMentionBubble-2OXF_uEJ.css → NcMentionBubble-YYl1ib_F.css} +9 -9
- package/dist/assets/{NcModal-UZh031V1.css → NcModal-sIK5sUoC.css} +63 -63
- package/dist/assets/{NcRichContenteditable-j9edXOEH.css → NcRichContenteditable-N1TxeACO.css} +76 -84
- package/dist/assets/NcRichText-kDp48Nji.css +215 -0
- package/dist/assets/referencePickerModal-A0PlFUEI.css +316 -0
- package/dist/chunks/{NcActionInput-jQFZLsoe.mjs → NcActionInput-XHMzOL_h.mjs} +1 -1
- package/dist/chunks/{NcActionInput-jQFZLsoe.mjs.map → NcActionInput-XHMzOL_h.mjs.map} +1 -1
- package/dist/chunks/{NcActionInput--MiyWKmE.cjs → NcActionInput-f1Oq2O71.cjs} +1 -1
- package/dist/chunks/{NcActionInput--MiyWKmE.cjs.map → NcActionInput-f1Oq2O71.cjs.map} +1 -1
- package/dist/chunks/{NcActions-qCVw08zV.mjs → NcActions-5_igU-CH.mjs} +21 -21
- package/dist/chunks/{NcActions-qCVw08zV.mjs.map → NcActions-5_igU-CH.mjs.map} +1 -1
- package/dist/chunks/{NcActions-SlBohqiI.cjs → NcActions-JXnhQhum.cjs} +7 -7
- package/dist/chunks/{NcActions-SlBohqiI.cjs.map → NcActions-JXnhQhum.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationCaption-0lGP-5CR.mjs → NcAppNavigationCaption-2rUO5Mns.mjs} +1 -1
- package/dist/chunks/{NcAppNavigationCaption-0lGP-5CR.mjs.map → NcAppNavigationCaption-2rUO5Mns.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationCaption-nEKQXQYr.cjs → NcAppNavigationCaption-JQWbmgdy.cjs} +1 -1
- package/dist/chunks/{NcAppNavigationCaption-nEKQXQYr.cjs.map → NcAppNavigationCaption-JQWbmgdy.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationItem-g_XncGxL.mjs → NcAppNavigationItem-A1yAdDNN.mjs} +1 -1
- package/dist/chunks/{NcAppNavigationItem-g_XncGxL.mjs.map → NcAppNavigationItem-A1yAdDNN.mjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationItem-AdLvgSbV.cjs → NcAppNavigationItem-Wb8gX-Ln.cjs} +1 -1
- package/dist/chunks/{NcAppNavigationItem-AdLvgSbV.cjs.map → NcAppNavigationItem-Wb8gX-Ln.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationSettings-UKQnGAEz.cjs → NcAppNavigationSettings-VLa79G7w.cjs} +1 -1
- package/dist/chunks/{NcAppNavigationSettings-UKQnGAEz.cjs.map → NcAppNavigationSettings-VLa79G7w.cjs.map} +1 -1
- package/dist/chunks/{NcAppNavigationSettings-DQHPDc4X.mjs → NcAppNavigationSettings-gwL_FqLN.mjs} +1 -1
- package/dist/chunks/{NcAppNavigationSettings-DQHPDc4X.mjs.map → NcAppNavigationSettings-gwL_FqLN.mjs.map} +1 -1
- package/dist/chunks/{NcAppSidebar-WyDtlgwP.cjs → NcAppSidebar-rRNJnN-k.cjs} +59 -31
- package/dist/chunks/NcAppSidebar-rRNJnN-k.cjs.map +1 -0
- package/dist/chunks/{NcAppSidebar-Wo8-p3nm.mjs → NcAppSidebar-tnHBPGbL.mjs} +138 -109
- package/dist/chunks/NcAppSidebar-tnHBPGbL.mjs.map +1 -0
- package/dist/chunks/{NcAvatar-c9ryo-7h.mjs → NcAvatar-xT3kz6mU.mjs} +2 -2
- package/dist/chunks/{NcAvatar-c9ryo-7h.mjs.map → NcAvatar-xT3kz6mU.mjs.map} +1 -1
- package/dist/chunks/{NcAvatar-khVnYpF2.cjs → NcAvatar-zTS9P1lK.cjs} +2 -2
- package/dist/chunks/{NcAvatar-khVnYpF2.cjs.map → NcAvatar-zTS9P1lK.cjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumb-SEyo99to.cjs → NcBreadcrumb-DEWk7wO9.cjs} +27 -20
- package/dist/chunks/NcBreadcrumb-DEWk7wO9.cjs.map +1 -0
- package/dist/chunks/{NcBreadcrumb-Ac0G-oky.mjs → NcBreadcrumb-w1UX2NR-.mjs} +14 -7
- package/dist/chunks/NcBreadcrumb-w1UX2NR-.mjs.map +1 -0
- package/dist/chunks/{NcBreadcrumbs-DXpOwLNx.cjs → NcBreadcrumbs-VuaG3ex5.cjs} +1 -1
- package/dist/chunks/{NcBreadcrumbs-DXpOwLNx.cjs.map → NcBreadcrumbs-VuaG3ex5.cjs.map} +1 -1
- package/dist/chunks/{NcBreadcrumbs-YOANgGCY.mjs → NcBreadcrumbs-tRR9CjKD.mjs} +2 -2
- package/dist/chunks/{NcBreadcrumbs-YOANgGCY.mjs.map → NcBreadcrumbs-tRR9CjKD.mjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidget-zBrcpL_E.cjs → NcDashboardWidget-QciRRvL4.cjs} +1 -1
- package/dist/chunks/{NcDashboardWidget-zBrcpL_E.cjs.map → NcDashboardWidget-QciRRvL4.cjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidget-bEnoXtKm.mjs → NcDashboardWidget-ogqyHahY.mjs} +2 -2
- package/dist/chunks/{NcDashboardWidget-bEnoXtKm.mjs.map → NcDashboardWidget-ogqyHahY.mjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidgetItem-LcxIx2-S.cjs → NcDashboardWidgetItem-mIPkPR7r.cjs} +1 -1
- package/dist/chunks/{NcDashboardWidgetItem-LcxIx2-S.cjs.map → NcDashboardWidgetItem-mIPkPR7r.cjs.map} +1 -1
- package/dist/chunks/{NcDashboardWidgetItem-p7yyFX-b.mjs → NcDashboardWidgetItem-wuUHTeLl.mjs} +2 -2
- package/dist/chunks/{NcDashboardWidgetItem-p7yyFX-b.mjs.map → NcDashboardWidgetItem-wuUHTeLl.mjs.map} +1 -1
- package/dist/chunks/{NcHeaderMenu-BSi8E43v.cjs → NcHeaderMenu-0d6eqre6.cjs} +6 -6
- package/dist/chunks/{NcHeaderMenu-Vytc8Eqg.mjs.map → NcHeaderMenu-0d6eqre6.cjs.map} +1 -1
- package/dist/chunks/{NcHeaderMenu-Vytc8Eqg.mjs → NcHeaderMenu-91qMsRIw.mjs} +3 -3
- package/dist/chunks/{NcHeaderMenu-BSi8E43v.cjs.map → NcHeaderMenu-91qMsRIw.mjs.map} +1 -1
- package/dist/chunks/{NcListItem-lqYZQhuZ.cjs → NcListItem--_PCqetA.cjs} +30 -47
- package/dist/chunks/NcListItem--_PCqetA.cjs.map +1 -0
- package/dist/chunks/{NcListItem-90hXqC4C.mjs → NcListItem-AMcc69jK.mjs} +33 -50
- package/dist/chunks/NcListItem-AMcc69jK.mjs.map +1 -0
- package/dist/chunks/{NcListItemIcon-ccke4gpg.cjs → NcListItemIcon-BnoIbVbD.cjs} +2 -2
- package/dist/chunks/{NcListItemIcon-ccke4gpg.cjs.map → NcListItemIcon-BnoIbVbD.cjs.map} +1 -1
- package/dist/chunks/{NcListItemIcon-hTbMo3-O.mjs → NcListItemIcon-rqgXledP.mjs} +2 -2
- package/dist/chunks/{NcListItemIcon-hTbMo3-O.mjs.map → NcListItemIcon-rqgXledP.mjs.map} +1 -1
- package/dist/chunks/NcRichContenteditable-eG8Fyo-M.mjs +638 -0
- package/dist/chunks/NcRichContenteditable-eG8Fyo-M.mjs.map +1 -0
- package/dist/chunks/{NcRichContenteditable-WxSgSNot.cjs → NcRichContenteditable-jReu2l-M.cjs} +235 -111
- package/dist/chunks/NcRichContenteditable-jReu2l-M.cjs.map +1 -0
- package/dist/chunks/NcRichText-Yo5pFnd0.cjs +310 -0
- package/dist/chunks/NcRichText-Yo5pFnd0.cjs.map +1 -0
- package/dist/chunks/NcRichText-qID66jAy.mjs +325 -0
- package/dist/chunks/NcRichText-qID66jAy.mjs.map +1 -0
- package/dist/chunks/{NcSelect-rMSul72R.cjs → NcSelect-U9LJcdIo.cjs} +55 -45
- package/dist/chunks/NcSelect-U9LJcdIo.cjs.map +1 -0
- package/dist/chunks/{NcSelect-vSPKKiyt.mjs → NcSelect-b2H-YQsK.mjs} +40 -30
- package/dist/chunks/NcSelect-b2H-YQsK.mjs.map +1 -0
- package/dist/chunks/{NcSelectTags-MwCs_QbM.mjs → NcSelectTags-MlILya2b.mjs} +1 -1
- package/dist/chunks/{NcSelectTags-MwCs_QbM.mjs.map → NcSelectTags-MlILya2b.mjs.map} +1 -1
- package/dist/chunks/{NcSelectTags-beMN3ZsT.cjs → NcSelectTags-rO88Pk-1.cjs} +1 -1
- package/dist/chunks/{NcSelectTags-beMN3ZsT.cjs.map → NcSelectTags-rO88Pk-1.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-msn3aYsn.cjs → NcSettingsSelectGroup-rfeDPLCg.cjs} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-msn3aYsn.cjs.map → NcSettingsSelectGroup-rfeDPLCg.cjs.map} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-HkS2QpZS.mjs → NcSettingsSelectGroup-xhnDBg8a.mjs} +1 -1
- package/dist/chunks/{NcSettingsSelectGroup-HkS2QpZS.mjs.map → NcSettingsSelectGroup-xhnDBg8a.mjs.map} +1 -1
- package/dist/chunks/{NcTimezonePicker-Cp479kFL.cjs → NcTimezonePicker-KG0dvgUv.cjs} +1 -1
- package/dist/chunks/{NcTimezonePicker-Cp479kFL.cjs.map → NcTimezonePicker-KG0dvgUv.cjs.map} +1 -1
- package/dist/chunks/{NcTimezonePicker-I6wF2jeF.mjs → NcTimezonePicker-jJeiI-Ff.mjs} +1 -1
- package/dist/chunks/{NcTimezonePicker-I6wF2jeF.mjs.map → NcTimezonePicker-jJeiI-Ff.mjs.map} +1 -1
- package/dist/chunks/{NcUserBubble-6AbwSr2B.cjs → NcUserBubble-027_C0cM.cjs} +1 -1
- package/dist/chunks/{NcUserBubble-6AbwSr2B.cjs.map → NcUserBubble-027_C0cM.cjs.map} +1 -1
- package/dist/chunks/{NcUserBubble-imSUw-aP.mjs → NcUserBubble-9StjszDh.mjs} +1 -1
- package/dist/chunks/{NcUserBubble-imSUw-aP.mjs.map → NcUserBubble-9StjszDh.mjs.map} +1 -1
- package/dist/chunks/{ScopeComponent-CjAOgGnx.mjs → ScopeComponent-9fOoDGYa.mjs} +1 -1
- package/dist/chunks/{ScopeComponent-CjAOgGnx.mjs.map → ScopeComponent-9fOoDGYa.mjs.map} +1 -1
- package/dist/chunks/{ScopeComponent-V9SPec9g.cjs → ScopeComponent-R0tAsT2f.cjs} +1 -1
- package/dist/chunks/{ScopeComponent-V9SPec9g.cjs.map → ScopeComponent-R0tAsT2f.cjs.map} +1 -1
- package/dist/chunks/{index-U21dQVa7.cjs → index-5TyVc_TT.cjs} +29 -16
- package/dist/chunks/index-5TyVc_TT.cjs.map +1 -0
- package/dist/chunks/{index-n2q3iT69.mjs → index-xnq0-IMW.mjs} +26 -13
- package/dist/chunks/index-xnq0-IMW.mjs.map +1 -0
- package/dist/chunks/referencePickerModal-cPBjsn4r.cjs +2393 -0
- package/dist/chunks/referencePickerModal-cPBjsn4r.cjs.map +1 -0
- package/dist/chunks/referencePickerModal-gDBkGfNV.mjs +2414 -0
- package/dist/chunks/referencePickerModal-gDBkGfNV.mjs.map +1 -0
- package/dist/index.cjs +189 -170
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +184 -165
- package/dist/index.mjs.map +1 -1
- package/dist/vendor.LICENSE.txt +4 -0
- package/package.json +4 -4
- package/dist/assets/NcListItem-6sL-frKJ.css +0 -165
- package/dist/assets/referencePickerModal-iy5QSWj6.css +0 -509
- package/dist/chunks/NcAppSidebar-Wo8-p3nm.mjs.map +0 -1
- package/dist/chunks/NcAppSidebar-WyDtlgwP.cjs.map +0 -1
- package/dist/chunks/NcBreadcrumb-Ac0G-oky.mjs.map +0 -1
- package/dist/chunks/NcBreadcrumb-SEyo99to.cjs.map +0 -1
- package/dist/chunks/NcListItem-90hXqC4C.mjs.map +0 -1
- package/dist/chunks/NcListItem-lqYZQhuZ.cjs.map +0 -1
- package/dist/chunks/NcRichContenteditable-WxSgSNot.cjs.map +0 -1
- package/dist/chunks/NcRichContenteditable-gQh2HFSV.mjs +0 -515
- package/dist/chunks/NcRichContenteditable-gQh2HFSV.mjs.map +0 -1
- package/dist/chunks/NcRichText-RSAcESV2.mjs +0 -353
- package/dist/chunks/NcRichText-RSAcESV2.mjs.map +0 -1
- package/dist/chunks/NcRichText-fHn-j5sa.cjs +0 -337
- package/dist/chunks/NcRichText-fHn-j5sa.cjs.map +0 -1
- package/dist/chunks/NcSelect-rMSul72R.cjs.map +0 -1
- package/dist/chunks/NcSelect-vSPKKiyt.mjs.map +0 -1
- package/dist/chunks/index-U21dQVa7.cjs.map +0 -1
- package/dist/chunks/index-n2q3iT69.mjs.map +0 -1
- package/dist/chunks/referencePickerModal-FeA-PRqB.mjs +0 -897
- package/dist/chunks/referencePickerModal-FeA-PRqB.mjs.map +0 -1
- package/dist/chunks/referencePickerModal-GXRJ351Q.cjs +0 -880
- package/dist/chunks/referencePickerModal-GXRJ351Q.cjs.map +0 -1
|
@@ -0,0 +1,638 @@
|
|
|
1
|
+
import '../assets/NcRichText-kDp48Nji.css';
|
|
2
|
+
import '../assets/NcRichContenteditable-N1TxeACO.css';
|
|
3
|
+
import { r as p, v as d, B as h, a } from "./_l10n-FmsZpnE4.mjs";
|
|
4
|
+
import { generateUrl as b } from "@nextcloud/router";
|
|
5
|
+
import { N as f } from "./NcUserStatusIcon-pRUzQidI.mjs";
|
|
6
|
+
import { n as c } from "./_plugin-vue2_normalizer-u6G_3nkj.mjs";
|
|
7
|
+
import { r as _ } from "./index-xnq0-IMW.mjs";
|
|
8
|
+
import "../Directives/Tooltip.mjs";
|
|
9
|
+
import { a as g, e as y } from "./emoji-tllD0Rvt.mjs";
|
|
10
|
+
import "unist-util-visit";
|
|
11
|
+
import "unist-builder";
|
|
12
|
+
import "../Functions/registerReference.mjs";
|
|
13
|
+
import "@vueuse/core";
|
|
14
|
+
import { d as C, g as v } from "./referencePickerModal-gDBkGfNV.mjs";
|
|
15
|
+
import "@nextcloud/axios";
|
|
16
|
+
/* empty css */
|
|
17
|
+
import "../Components/NcLoadingIcon.mjs";
|
|
18
|
+
import "./NcCheckboxRadioSwitch.vue_vue_type_style_index_0_scoped_2603be83_lang-rJ3UZLGm.mjs";
|
|
19
|
+
import { G as l } from "./GenRandomId-VodkdWbp.mjs";
|
|
20
|
+
import "unified";
|
|
21
|
+
import "remark-parse";
|
|
22
|
+
import "remark-gfm";
|
|
23
|
+
import "remark-breaks";
|
|
24
|
+
import "remark-rehype";
|
|
25
|
+
import "rehype-react";
|
|
26
|
+
import "rehype-external-links";
|
|
27
|
+
import "../Components/NcEmptyContent.mjs";
|
|
28
|
+
import "./NcSelect-b2H-YQsK.mjs";
|
|
29
|
+
import "./NcTextField-NnW31cA4.mjs";
|
|
30
|
+
import "../Components/NcButton.mjs";
|
|
31
|
+
import "../Components/NcModal.mjs";
|
|
32
|
+
import "@nextcloud/event-bus";
|
|
33
|
+
import T from "tributejs/dist/tribute.esm.js";
|
|
34
|
+
import A from "debounce";
|
|
35
|
+
import k from "string-length";
|
|
36
|
+
import { VTooltip as w } from "floating-vue";
|
|
37
|
+
const S = {
|
|
38
|
+
name: "NcAutoCompleteResult",
|
|
39
|
+
components: {
|
|
40
|
+
NcUserStatusIcon: f
|
|
41
|
+
},
|
|
42
|
+
props: {
|
|
43
|
+
/**
|
|
44
|
+
* @deprecated Use `label` instead
|
|
45
|
+
*/
|
|
46
|
+
title: {
|
|
47
|
+
type: String,
|
|
48
|
+
required: !1,
|
|
49
|
+
default: null
|
|
50
|
+
},
|
|
51
|
+
label: {
|
|
52
|
+
type: String,
|
|
53
|
+
required: !1,
|
|
54
|
+
default: null
|
|
55
|
+
},
|
|
56
|
+
subline: {
|
|
57
|
+
type: String,
|
|
58
|
+
default: null
|
|
59
|
+
},
|
|
60
|
+
id: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: null
|
|
63
|
+
},
|
|
64
|
+
icon: {
|
|
65
|
+
type: String,
|
|
66
|
+
required: !0
|
|
67
|
+
},
|
|
68
|
+
iconUrl: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: null
|
|
71
|
+
},
|
|
72
|
+
source: {
|
|
73
|
+
type: String,
|
|
74
|
+
required: !0
|
|
75
|
+
},
|
|
76
|
+
status: {
|
|
77
|
+
type: [Object, Array],
|
|
78
|
+
default: () => ({})
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
computed: {
|
|
82
|
+
avatarUrl() {
|
|
83
|
+
return this.iconUrl ? this.iconUrl : this.id && this.source === "users" ? this.getAvatarUrl(this.id, 44) : null;
|
|
84
|
+
},
|
|
85
|
+
// For backwards compatibility
|
|
86
|
+
labelWithFallback() {
|
|
87
|
+
return this.label || this.title;
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
methods: {
|
|
91
|
+
getAvatarUrl(i, t) {
|
|
92
|
+
return b("/avatar/{user}/{size}", {
|
|
93
|
+
user: i,
|
|
94
|
+
size: t
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
var x = function() {
|
|
100
|
+
var t = this, n = t._self._c;
|
|
101
|
+
return n("div", { staticClass: "autocomplete-result" }, [n("div", { staticClass: "autocomplete-result__icon", class: [t.icon, `autocomplete-result__icon--${t.avatarUrl ? "with-avatar" : ""}`], style: t.avatarUrl ? { backgroundImage: `url(${t.avatarUrl})` } : null }, [t.status.icon ? n("span", { staticClass: "autocomplete-result__status autocomplete-result__status--icon" }, [t._v(" " + t._s(t.status && t.status.icon || "") + " ")]) : t.status.status && t.status.status !== "offline" ? n("NcUserStatusIcon", { staticClass: "autocomplete-result__status", attrs: { status: t.status.status } }) : t._e()], 1), n("span", { staticClass: "autocomplete-result__content" }, [n("span", { staticClass: "autocomplete-result__title", attrs: { title: t.labelWithFallback } }, [t._v(" " + t._s(t.labelWithFallback) + " ")]), t.subline ? n("span", { staticClass: "autocomplete-result__subline" }, [t._v(" " + t._s(t.subline) + " ")]) : t._e()])]);
|
|
102
|
+
}, I = [], $ = /* @__PURE__ */ c(
|
|
103
|
+
S,
|
|
104
|
+
x,
|
|
105
|
+
I,
|
|
106
|
+
!1,
|
|
107
|
+
null,
|
|
108
|
+
"9cff39ed",
|
|
109
|
+
null,
|
|
110
|
+
null
|
|
111
|
+
);
|
|
112
|
+
const E = $.exports;
|
|
113
|
+
p(h, d);
|
|
114
|
+
const O = {
|
|
115
|
+
"material-design-icon": "_material-design-icon_6omw8_26",
|
|
116
|
+
"tribute-container": "_tribute-container_6omw8_34",
|
|
117
|
+
"tribute-container__item": "_tribute-container__item_6omw8_44",
|
|
118
|
+
"tribute-container--focus-visible": "_tribute-container--focus-visible_6omw8_61",
|
|
119
|
+
"tribute-container-autocomplete": "_tribute-container-autocomplete_6omw8_65",
|
|
120
|
+
"tribute-container-emoji": "_tribute-container-emoji_6omw8_71",
|
|
121
|
+
"tribute-container-link": "_tribute-container-link_6omw8_72",
|
|
122
|
+
"tribute-item": "_tribute-item_6omw8_77",
|
|
123
|
+
"tribute-item__emoji": "_tribute-item__emoji_6omw8_83",
|
|
124
|
+
"tribute-item__title": "_tribute-item__title_6omw8_96",
|
|
125
|
+
"tribute-item__icon": "_tribute-item__icon_6omw8_101"
|
|
126
|
+
}, D = ["d", "D", "p", "P", "s", "S", "x", "X", ")", "(", "|", "/"], o = [];
|
|
127
|
+
D.forEach((i) => {
|
|
128
|
+
o.push(":" + i), o.push(":-" + i);
|
|
129
|
+
});
|
|
130
|
+
const R = {
|
|
131
|
+
name: "NcRichContenteditable",
|
|
132
|
+
directives: {
|
|
133
|
+
tooltip: w
|
|
134
|
+
},
|
|
135
|
+
mixins: [_],
|
|
136
|
+
inheritAttrs: !1,
|
|
137
|
+
props: {
|
|
138
|
+
/**
|
|
139
|
+
* The ID attribute of the content editable
|
|
140
|
+
*/
|
|
141
|
+
id: {
|
|
142
|
+
type: String,
|
|
143
|
+
default: () => l(7)
|
|
144
|
+
},
|
|
145
|
+
/**
|
|
146
|
+
* Visual label of the contenteditable
|
|
147
|
+
*/
|
|
148
|
+
label: {
|
|
149
|
+
type: String,
|
|
150
|
+
default: ""
|
|
151
|
+
},
|
|
152
|
+
value: {
|
|
153
|
+
type: String,
|
|
154
|
+
default: "",
|
|
155
|
+
required: !0
|
|
156
|
+
},
|
|
157
|
+
placeholder: {
|
|
158
|
+
type: String,
|
|
159
|
+
default: a("Write a message …")
|
|
160
|
+
},
|
|
161
|
+
autoComplete: {
|
|
162
|
+
type: Function,
|
|
163
|
+
default: () => []
|
|
164
|
+
},
|
|
165
|
+
menuContainer: {
|
|
166
|
+
type: Element,
|
|
167
|
+
default: () => document.body
|
|
168
|
+
},
|
|
169
|
+
/**
|
|
170
|
+
* Make the contenteditable looks like a textarea or not.
|
|
171
|
+
* Default looks like a single-line input.
|
|
172
|
+
* This also handle the default enter/shift+enter behaviour.
|
|
173
|
+
* if multiline, enter = newline; otherwise enter = submit
|
|
174
|
+
* shift+enter always add a new line. ctrl+enter always submits
|
|
175
|
+
*/
|
|
176
|
+
multiline: {
|
|
177
|
+
type: Boolean,
|
|
178
|
+
default: !1
|
|
179
|
+
},
|
|
180
|
+
/**
|
|
181
|
+
* Is the content editable ?
|
|
182
|
+
*/
|
|
183
|
+
contenteditable: {
|
|
184
|
+
type: Boolean,
|
|
185
|
+
default: !0
|
|
186
|
+
},
|
|
187
|
+
/**
|
|
188
|
+
* Disable the editing and show specific disabled design
|
|
189
|
+
*/
|
|
190
|
+
disabled: {
|
|
191
|
+
type: Boolean,
|
|
192
|
+
default: !1
|
|
193
|
+
},
|
|
194
|
+
/**
|
|
195
|
+
* Max allowed length
|
|
196
|
+
*/
|
|
197
|
+
maxlength: {
|
|
198
|
+
type: Number,
|
|
199
|
+
default: null
|
|
200
|
+
},
|
|
201
|
+
/**
|
|
202
|
+
* Enable or disable emoji autocompletion
|
|
203
|
+
*/
|
|
204
|
+
emojiAutocomplete: {
|
|
205
|
+
type: Boolean,
|
|
206
|
+
default: !0
|
|
207
|
+
},
|
|
208
|
+
/**
|
|
209
|
+
* Enable or disable link autocompletion
|
|
210
|
+
*/
|
|
211
|
+
linkAutocomplete: {
|
|
212
|
+
type: Boolean,
|
|
213
|
+
default: !0
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
emits: [
|
|
217
|
+
"submit",
|
|
218
|
+
"paste",
|
|
219
|
+
"update:value",
|
|
220
|
+
"smart-picker-submit"
|
|
221
|
+
],
|
|
222
|
+
setup() {
|
|
223
|
+
const i = l(5);
|
|
224
|
+
return {
|
|
225
|
+
// Constants
|
|
226
|
+
labelId: `nc-rich-contenteditable-${i}-label`,
|
|
227
|
+
tributeId: `nc-rich-contenteditable-${i}-tribute`,
|
|
228
|
+
/**
|
|
229
|
+
* Non-reactive property to store Tribute instance
|
|
230
|
+
*
|
|
231
|
+
* @type {import('tributejs').default | null}
|
|
232
|
+
*/
|
|
233
|
+
tribute: null,
|
|
234
|
+
tributeStyleMutationObserver: null
|
|
235
|
+
};
|
|
236
|
+
},
|
|
237
|
+
data() {
|
|
238
|
+
return {
|
|
239
|
+
// Represent the raw untrimmed text of the contenteditable
|
|
240
|
+
// serves no other purpose than to check whether the
|
|
241
|
+
// content is empty or not
|
|
242
|
+
localValue: this.value,
|
|
243
|
+
// Is in text composition session in IME
|
|
244
|
+
isComposing: !1,
|
|
245
|
+
// Tribute autocomplete
|
|
246
|
+
isAutocompleteOpen: !1,
|
|
247
|
+
autocompleteActiveId: void 0,
|
|
248
|
+
isTributeIntegrationDone: !1
|
|
249
|
+
};
|
|
250
|
+
},
|
|
251
|
+
computed: {
|
|
252
|
+
/**
|
|
253
|
+
* Is the current trimmed value empty?
|
|
254
|
+
*
|
|
255
|
+
* @return {boolean}
|
|
256
|
+
*/
|
|
257
|
+
isEmptyValue() {
|
|
258
|
+
return !this.localValue || this.localValue.trim() === "";
|
|
259
|
+
},
|
|
260
|
+
/**
|
|
261
|
+
* Is this Firefox? 🙄
|
|
262
|
+
*
|
|
263
|
+
* @return {boolean}
|
|
264
|
+
*/
|
|
265
|
+
isFF() {
|
|
266
|
+
return !!navigator.userAgent.match(/firefox/i);
|
|
267
|
+
},
|
|
268
|
+
/**
|
|
269
|
+
* Is the current value over maxlength?
|
|
270
|
+
*
|
|
271
|
+
* @return {boolean}
|
|
272
|
+
*/
|
|
273
|
+
isOverMaxlength() {
|
|
274
|
+
return this.isEmptyValue || !this.maxlength ? !1 : k(this.localValue) > this.maxlength;
|
|
275
|
+
},
|
|
276
|
+
/**
|
|
277
|
+
* Tooltip to show if characters count is over limit
|
|
278
|
+
*
|
|
279
|
+
* @return {string}
|
|
280
|
+
*/
|
|
281
|
+
tooltipString() {
|
|
282
|
+
return this.isOverMaxlength ? {
|
|
283
|
+
content: a("Message limit of {count} characters reached", { count: this.maxlength }),
|
|
284
|
+
shown: !0,
|
|
285
|
+
trigger: "manual"
|
|
286
|
+
} : null;
|
|
287
|
+
},
|
|
288
|
+
/**
|
|
289
|
+
* Edit is only allowed when contenteditableis true and disabled is false
|
|
290
|
+
*
|
|
291
|
+
* @return {boolean}
|
|
292
|
+
*/
|
|
293
|
+
canEdit() {
|
|
294
|
+
return this.contenteditable && !this.disabled;
|
|
295
|
+
},
|
|
296
|
+
/**
|
|
297
|
+
* Proxied native event handlers without custom event handlers
|
|
298
|
+
*
|
|
299
|
+
* @return {Record<string, Function>}
|
|
300
|
+
*/
|
|
301
|
+
listeners() {
|
|
302
|
+
const i = { ...this.$listeners };
|
|
303
|
+
return delete i.paste, i;
|
|
304
|
+
},
|
|
305
|
+
/**
|
|
306
|
+
* Compute debounce function for the autocomplete function
|
|
307
|
+
*/
|
|
308
|
+
debouncedAutoComplete() {
|
|
309
|
+
return A(async (i, t) => {
|
|
310
|
+
this.autoComplete(i, t);
|
|
311
|
+
}, 100);
|
|
312
|
+
}
|
|
313
|
+
},
|
|
314
|
+
watch: {
|
|
315
|
+
/**
|
|
316
|
+
* If the parent value change, we compare the plain text rendering
|
|
317
|
+
* If it's different, we render everything and update the main content
|
|
318
|
+
*/
|
|
319
|
+
value() {
|
|
320
|
+
const i = this.$refs.contenteditable.innerHTML;
|
|
321
|
+
this.value.trim() !== this.parseContent(i).trim() && this.updateContent(this.value);
|
|
322
|
+
}
|
|
323
|
+
},
|
|
324
|
+
mounted() {
|
|
325
|
+
this.initializeTribute(), this.updateContent(this.value), this.$refs.contenteditable.contentEditable = this.canEdit;
|
|
326
|
+
},
|
|
327
|
+
beforeDestroy() {
|
|
328
|
+
this.tribute && this.tribute.detach(this.$refs.contenteditable), this.tributeStyleMutationObserver && this.tributeStyleMutationObserver.disconnect();
|
|
329
|
+
},
|
|
330
|
+
methods: {
|
|
331
|
+
/**
|
|
332
|
+
* Focus the richContenteditable
|
|
333
|
+
*
|
|
334
|
+
* @public
|
|
335
|
+
*/
|
|
336
|
+
focus() {
|
|
337
|
+
this.$refs.contenteditable.focus();
|
|
338
|
+
},
|
|
339
|
+
initializeTribute() {
|
|
340
|
+
const i = (n) => `<div id="nc-rich-contenteditable-tribute-item-${l(5)}" class="${this.$style["tribute-item"]}" role="option">${n}</div>`, t = [];
|
|
341
|
+
t.push({
|
|
342
|
+
// Allow spaces in the middle of mentions
|
|
343
|
+
allowSpaces: !0,
|
|
344
|
+
fillAttr: "id",
|
|
345
|
+
// Search against id and label (display name) (fallback to title for v8.0.0..8.6.1 compatibility)
|
|
346
|
+
lookup: (n) => `${n.id} ${n.label ?? n.title}`,
|
|
347
|
+
// Where to inject the menu popup
|
|
348
|
+
menuContainer: this.menuContainer,
|
|
349
|
+
// Popup mention autocompletion templates
|
|
350
|
+
menuItemTemplate: (n) => i(this.renderComponentHtml(n.original, E)),
|
|
351
|
+
// Hide if no results
|
|
352
|
+
noMatchTemplate: () => '<span class="hidden"></span>',
|
|
353
|
+
// Inner display of mentions
|
|
354
|
+
selectTemplate: (n) => this.genSelectTemplate(n?.original?.id),
|
|
355
|
+
// Autocompletion results
|
|
356
|
+
values: this.debouncedAutoComplete,
|
|
357
|
+
// Class added to the menu container
|
|
358
|
+
containerClass: `${this.$style["tribute-container"]} ${this.$style["tribute-container-autocomplete"]}`,
|
|
359
|
+
// Class added to each list item
|
|
360
|
+
itemClass: this.$style["tribute-container__item"]
|
|
361
|
+
}), this.emojiAutocomplete && t.push({
|
|
362
|
+
trigger: ":",
|
|
363
|
+
// Don't use the tribute search function at all
|
|
364
|
+
// We pass search results as values (see below)
|
|
365
|
+
lookup: (n, e) => e,
|
|
366
|
+
// Where to inject the menu popup
|
|
367
|
+
menuContainer: this.menuContainer,
|
|
368
|
+
// Popup mention autocompletion templates
|
|
369
|
+
menuItemTemplate: (n) => o.includes(n.original) ? n.original : i(`<span class="${this.$style["tribute-item__emoji"]}">${n.original.native}</span> :${n.original.short_name}`),
|
|
370
|
+
// Hide if no results
|
|
371
|
+
noMatchTemplate: () => a("No emoji found"),
|
|
372
|
+
// Display raw emoji along with its name
|
|
373
|
+
selectTemplate: (n) => o.includes(n.original) ? n.original : (g(n.original), n.original.native),
|
|
374
|
+
// Pass the search results as values
|
|
375
|
+
values: (n, e) => {
|
|
376
|
+
const r = y(n);
|
|
377
|
+
o.includes(":" + n) && r.unshift(":" + n), e(r);
|
|
378
|
+
},
|
|
379
|
+
// Class added to the menu container
|
|
380
|
+
containerClass: `${this.$style["tribute-container"]} ${this.$style["tribute-container-emoji"]}`,
|
|
381
|
+
// Class added to each list item
|
|
382
|
+
itemClass: this.$style["tribute-container__item"]
|
|
383
|
+
}), this.linkAutocomplete && t.push({
|
|
384
|
+
trigger: "/",
|
|
385
|
+
// Don't use the tribute search function at all
|
|
386
|
+
// We pass search results as values (see below)
|
|
387
|
+
lookup: (n, e) => e,
|
|
388
|
+
// Where to inject the menu popup
|
|
389
|
+
menuContainer: this.menuContainer,
|
|
390
|
+
// Popup mention autocompletion templates
|
|
391
|
+
menuItemTemplate: (n) => i(`<img class="${this.$style["tribute-item__icon"]}" src="${n.original.icon_url}"> <span class="${this.$style["tribute-item__title"]}">${n.original.title}</span>`),
|
|
392
|
+
// Hide if no results
|
|
393
|
+
noMatchTemplate: () => a("No link provider found"),
|
|
394
|
+
selectTemplate: this.getLink,
|
|
395
|
+
// Pass the search results as values
|
|
396
|
+
values: (n, e) => e(C(n)),
|
|
397
|
+
// Class added to the menu container
|
|
398
|
+
containerClass: `${this.$style["tribute-container"]} ${this.$style["tribute-container-link"]}`,
|
|
399
|
+
// Class added to each list item
|
|
400
|
+
itemClass: this.$style["tribute-container__item"]
|
|
401
|
+
}), this.tribute = new T({ collection: t }), this.tribute.attach(this.$refs.contenteditable);
|
|
402
|
+
},
|
|
403
|
+
getLink(i) {
|
|
404
|
+
return v(i.original.id).then((t) => {
|
|
405
|
+
const n = document.getElementById("tmp-smart-picker-result-node"), e = {
|
|
406
|
+
result: t,
|
|
407
|
+
insertText: !0
|
|
408
|
+
};
|
|
409
|
+
if (this.$emit("smart-picker-submit", e), e.insertText) {
|
|
410
|
+
const r = document.createTextNode(t);
|
|
411
|
+
n.replaceWith(r), this.setCursorAfter(r), this.updateValue(this.$refs.contenteditable.innerHTML);
|
|
412
|
+
} else
|
|
413
|
+
n.remove();
|
|
414
|
+
}).catch((t) => {
|
|
415
|
+
console.debug("Smart picker promise rejected:", t);
|
|
416
|
+
const n = document.getElementById("tmp-smart-picker-result-node");
|
|
417
|
+
this.setCursorAfter(n), n.remove();
|
|
418
|
+
}), '<span id="tmp-smart-picker-result-node"></span>';
|
|
419
|
+
},
|
|
420
|
+
setCursorAfter(i) {
|
|
421
|
+
const t = document.createRange();
|
|
422
|
+
t.setEndAfter(i), t.collapse();
|
|
423
|
+
const n = window.getSelection();
|
|
424
|
+
n.removeAllRanges(), n.addRange(t);
|
|
425
|
+
},
|
|
426
|
+
moveCursorToEnd() {
|
|
427
|
+
if (!document.createRange)
|
|
428
|
+
return;
|
|
429
|
+
const i = document.createRange();
|
|
430
|
+
i.selectNodeContents(this.$refs.contenteditable), i.collapse(!1);
|
|
431
|
+
const t = window.getSelection();
|
|
432
|
+
t.removeAllRanges(), t.addRange(i);
|
|
433
|
+
},
|
|
434
|
+
/**
|
|
435
|
+
* Re-emit the input event to the parent
|
|
436
|
+
*
|
|
437
|
+
* @param {Event} event the input event
|
|
438
|
+
*/
|
|
439
|
+
onInput(i) {
|
|
440
|
+
this.updateValue(i.target.innerHTML);
|
|
441
|
+
},
|
|
442
|
+
/**
|
|
443
|
+
* When pasting, sanitize the content, extract text
|
|
444
|
+
* and render it again
|
|
445
|
+
*
|
|
446
|
+
* @param {Event} event the paste event
|
|
447
|
+
* @fires Event paste the original paste event
|
|
448
|
+
*/
|
|
449
|
+
onPaste(i) {
|
|
450
|
+
if (!this.canEdit)
|
|
451
|
+
return;
|
|
452
|
+
i.preventDefault();
|
|
453
|
+
const t = i.clipboardData;
|
|
454
|
+
if (this.$emit("paste", i), t.files.length !== 0 || !Object.values(t.items).find((m) => m?.type.startsWith("text")))
|
|
455
|
+
return;
|
|
456
|
+
const n = t.getData("text"), e = window.getSelection();
|
|
457
|
+
if (!e.rangeCount) {
|
|
458
|
+
this.updateValue(n);
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
const r = e.getRangeAt(0);
|
|
462
|
+
e.deleteFromDocument(), r.insertNode(document.createTextNode(n));
|
|
463
|
+
const s = document.createRange();
|
|
464
|
+
s.setStart(i.target, r.endOffset), s.collapse(!0), e.removeAllRanges(), e.addRange(s), this.updateValue(this.$refs.contenteditable.innerHTML);
|
|
465
|
+
},
|
|
466
|
+
/**
|
|
467
|
+
* Update the value text from the provided html
|
|
468
|
+
*
|
|
469
|
+
* @param {string} htmlOrText the html content (or raw text with @mentions)
|
|
470
|
+
*/
|
|
471
|
+
updateValue(i) {
|
|
472
|
+
const t = this.parseContent(i);
|
|
473
|
+
this.localValue = t, this.$emit("update:value", t);
|
|
474
|
+
},
|
|
475
|
+
/**
|
|
476
|
+
* Update content and local value
|
|
477
|
+
*
|
|
478
|
+
* @param {string} value the message value
|
|
479
|
+
*/
|
|
480
|
+
updateContent(i) {
|
|
481
|
+
const t = this.renderContent(i);
|
|
482
|
+
this.$refs.contenteditable.innerHTML = t, this.localValue = i;
|
|
483
|
+
},
|
|
484
|
+
/**
|
|
485
|
+
* Because FF have a decade old bug preventing contenteditable=false
|
|
486
|
+
* to properly be deleted on backspace, we have to hack 👀
|
|
487
|
+
* https://stackoverflow.com/a/59383394/3885878
|
|
488
|
+
* https://stackoverflow.com/a/30574622
|
|
489
|
+
*
|
|
490
|
+
* @param {Event} event the delete keydown event
|
|
491
|
+
*/
|
|
492
|
+
onDelete(i) {
|
|
493
|
+
if (!this.isFF || !window.getSelection || !this.canEdit)
|
|
494
|
+
return;
|
|
495
|
+
const t = window.getSelection(), n = i.target;
|
|
496
|
+
if (!t.isCollapsed || !t.rangeCount)
|
|
497
|
+
return;
|
|
498
|
+
const e = t.getRangeAt(t.rangeCount - 1);
|
|
499
|
+
if (e.commonAncestorContainer.nodeType === 3 && e.startOffset > 0)
|
|
500
|
+
return;
|
|
501
|
+
const r = document.createRange();
|
|
502
|
+
if (t.anchorNode !== n)
|
|
503
|
+
r.selectNodeContents(n), r.setEndBefore(t.anchorNode);
|
|
504
|
+
else if (t.anchorOffset > 0)
|
|
505
|
+
r.setEnd(n, t.anchorOffset);
|
|
506
|
+
else
|
|
507
|
+
return;
|
|
508
|
+
r.setStart(n, r.endOffset - 1);
|
|
509
|
+
const s = r.cloneContents().lastChild;
|
|
510
|
+
s && s.contentEditable === "false" && (r.deleteContents(), i.preventDefault());
|
|
511
|
+
},
|
|
512
|
+
/**
|
|
513
|
+
* Enter key pressed. Submits if not multiline
|
|
514
|
+
*
|
|
515
|
+
* @param {Event} event the keydown event
|
|
516
|
+
*/
|
|
517
|
+
onEnter(i) {
|
|
518
|
+
this.multiline || this.isOverMaxlength || this.tribute.isActive || this.isComposing || (i.preventDefault(), i.stopPropagation(), this.$emit("submit", i));
|
|
519
|
+
},
|
|
520
|
+
/**
|
|
521
|
+
* Ctrl + Enter key pressed is used to submit
|
|
522
|
+
*
|
|
523
|
+
* @param {Event} event the keydown event
|
|
524
|
+
*/
|
|
525
|
+
onCtrlEnter(i) {
|
|
526
|
+
this.isOverMaxlength || this.$emit("submit", i);
|
|
527
|
+
},
|
|
528
|
+
onKeyUp(i) {
|
|
529
|
+
i.stopImmediatePropagation();
|
|
530
|
+
},
|
|
531
|
+
/**
|
|
532
|
+
* Get HTML element with Tribute.js container
|
|
533
|
+
* @return {HTMLElement}
|
|
534
|
+
*/
|
|
535
|
+
getTributeContainer() {
|
|
536
|
+
return this.tribute.menu;
|
|
537
|
+
},
|
|
538
|
+
/**
|
|
539
|
+
* Get the currently selected item element id in Tribute.js container
|
|
540
|
+
* @return {HTMLElement}
|
|
541
|
+
*/
|
|
542
|
+
getTributeSelectedItem() {
|
|
543
|
+
return this.getTributeContainer().querySelector('.highlight [id^="nc-rich-contenteditable-tribute-item-"]');
|
|
544
|
+
},
|
|
545
|
+
/**
|
|
546
|
+
* Handle Tribute activation
|
|
547
|
+
* @param {boolean} isActive - is active
|
|
548
|
+
*/
|
|
549
|
+
onTributeActive(i) {
|
|
550
|
+
this.isAutocompleteOpen = i, i ? (this.getTributeContainer().setAttribute("class", this.tribute.current.collection.containerClass || this.$style["tribute-container"]), this.setupTributeIntegration()) : (this.debouncedAutoComplete.clear(), this.autocompleteActiveId = void 0, this.setTributeFocusVisible(!1));
|
|
551
|
+
},
|
|
552
|
+
onTributeArrowKeyDown() {
|
|
553
|
+
this.isAutocompleteOpen && (this.setTributeFocusVisible(!0), this.onTributeSelectedItemWillChange());
|
|
554
|
+
},
|
|
555
|
+
onTributeSelectedItemWillChange() {
|
|
556
|
+
requestAnimationFrame(() => {
|
|
557
|
+
this.autocompleteActiveId = this.getTributeSelectedItem()?.id;
|
|
558
|
+
});
|
|
559
|
+
},
|
|
560
|
+
setupTributeIntegration() {
|
|
561
|
+
if (this.isTributeIntegrationDone)
|
|
562
|
+
return;
|
|
563
|
+
this.isTributeIntegrationDone = !0;
|
|
564
|
+
const i = this.getTributeContainer();
|
|
565
|
+
i.id = this.tributeId, i.setAttribute("role", "listbox"), i.children[0].setAttribute("role", "presentation"), this.tributeStyleMutationObserver = new MutationObserver(([{ target: n }]) => {
|
|
566
|
+
n.style.display !== "none" && this.onTributeSelectedItemWillChange();
|
|
567
|
+
}).observe(i, {
|
|
568
|
+
attributes: !0,
|
|
569
|
+
attributeFilter: ["style"]
|
|
570
|
+
}), i.addEventListener("mousemove", () => {
|
|
571
|
+
this.setTributeFocusVisible(!1), this.onTributeSelectedItemWillChange();
|
|
572
|
+
}, { passive: !0 });
|
|
573
|
+
},
|
|
574
|
+
/**
|
|
575
|
+
* Set tribute-container--focus-visible class on the Tribute container when the user navigates the listbox via keyboard.
|
|
576
|
+
*
|
|
577
|
+
* Because the real focus is kept on the textbox, we cannot use the :focus-visible pseudo-class
|
|
578
|
+
* to style selected options in the autocomplete listbox.
|
|
579
|
+
*
|
|
580
|
+
* @param {boolean} withFocusVisible - should the focus-visible class be added
|
|
581
|
+
*/
|
|
582
|
+
setTributeFocusVisible(i) {
|
|
583
|
+
i ? this.getTributeContainer().classList.add(this.$style["tribute-container--focus-visible"]) : this.getTributeContainer().classList.remove(this.$style["tribute-container--focus-visible"]);
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
};
|
|
587
|
+
var K = function() {
|
|
588
|
+
var t = this, n = t._self._c;
|
|
589
|
+
return n("div", { staticClass: "rich-contenteditable" }, [n("div", t._g(t._b({ directives: [{ name: "tooltip", rawName: "v-tooltip", value: t.tooltipString, expression: "tooltipString" }], ref: "contenteditable", staticClass: "rich-contenteditable__input", class: {
|
|
590
|
+
"rich-contenteditable__input--empty": t.isEmptyValue,
|
|
591
|
+
"rich-contenteditable__input--multiline": t.multiline,
|
|
592
|
+
"rich-contenteditable__input--has-label": t.label,
|
|
593
|
+
"rich-contenteditable__input--overflow": t.isOverMaxlength,
|
|
594
|
+
"rich-contenteditable__input--disabled": t.disabled
|
|
595
|
+
}, attrs: { id: t.id, contenteditable: t.canEdit, "aria-labelledby": t.label ? t.labelId : void 0, "aria-placeholder": t.placeholder, "aria-multiline": "true", role: "textbox", "aria-haspopup": "listbox", "aria-autocomplete": "inline", "aria-controls": t.tributeId, "aria-expanded": t.isAutocompleteOpen ? "true" : "false", "aria-activedescendant": t.autocompleteActiveId }, on: { focus: t.moveCursorToEnd, input: t.onInput, compositionstart: function(e) {
|
|
596
|
+
t.isComposing = !0;
|
|
597
|
+
}, compositionend: function(e) {
|
|
598
|
+
t.isComposing = !1;
|
|
599
|
+
}, keydown: [function(e) {
|
|
600
|
+
return !e.type.indexOf("key") && t._k(e.keyCode, "delete", [8, 46], e.key, ["Backspace", "Delete", "Del"]) ? null : t.onDelete.apply(null, arguments);
|
|
601
|
+
}, function(e) {
|
|
602
|
+
return !e.type.indexOf("key") && t._k(e.keyCode, "enter", 13, e.key, "Enter") || e.ctrlKey || e.shiftKey || e.altKey || e.metaKey ? null : t.onEnter.apply(null, arguments);
|
|
603
|
+
}, function(e) {
|
|
604
|
+
return !e.type.indexOf("key") && t._k(e.keyCode, "enter", 13, e.key, "Enter") || !e.ctrlKey || e.shiftKey || e.altKey || e.metaKey ? null : (e.stopPropagation(), e.preventDefault(), t.onCtrlEnter.apply(null, arguments));
|
|
605
|
+
}, function(e) {
|
|
606
|
+
return !e.type.indexOf("key") && t._k(e.keyCode, "up", 38, e.key, ["Up", "ArrowUp"]) || e.ctrlKey || e.shiftKey || e.altKey || e.metaKey ? null : (e.stopPropagation(), t.onTributeArrowKeyDown.apply(null, arguments));
|
|
607
|
+
}, function(e) {
|
|
608
|
+
return !e.type.indexOf("key") && t._k(e.keyCode, "down", 40, e.key, ["Down", "ArrowDown"]) || e.ctrlKey || e.shiftKey || e.altKey || e.metaKey ? null : (e.stopPropagation(), t.onTributeArrowKeyDown.apply(null, arguments));
|
|
609
|
+
}], paste: t.onPaste, "!keyup": function(e) {
|
|
610
|
+
return e.stopPropagation(), e.preventDefault(), t.onKeyUp.apply(null, arguments);
|
|
611
|
+
}, "tribute-active-true": function(e) {
|
|
612
|
+
return t.onTributeActive(!0);
|
|
613
|
+
}, "tribute-active-false": function(e) {
|
|
614
|
+
return t.onTributeActive(!1);
|
|
615
|
+
} } }, "div", t.$attrs, !1), t.listeners)), t.label ? n("div", { staticClass: "rich-contenteditable__label", attrs: { id: t.labelId } }, [t._v(" " + t._s(t.label) + " ")]) : t._e()]);
|
|
616
|
+
}, M = [];
|
|
617
|
+
const u = {
|
|
618
|
+
$style: O
|
|
619
|
+
};
|
|
620
|
+
function N(i) {
|
|
621
|
+
for (var t in u)
|
|
622
|
+
this[t] = u[t];
|
|
623
|
+
}
|
|
624
|
+
var V = /* @__PURE__ */ c(
|
|
625
|
+
R,
|
|
626
|
+
K,
|
|
627
|
+
M,
|
|
628
|
+
!1,
|
|
629
|
+
N,
|
|
630
|
+
"0c65f921",
|
|
631
|
+
null,
|
|
632
|
+
null
|
|
633
|
+
);
|
|
634
|
+
const gt = V.exports;
|
|
635
|
+
export {
|
|
636
|
+
E as N,
|
|
637
|
+
gt as a
|
|
638
|
+
};
|