@nextcloud/vue 3.10.2 → 4.1.1
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 +114 -19
- package/README.md +9 -10
- package/dist/Components/ActionButton.js +24 -3
- package/dist/Components/ActionButton.js.map +1 -1
- package/dist/Components/ActionCaption.js +23 -0
- package/dist/Components/ActionCaption.js.map +1 -0
- package/dist/Components/ActionCheckbox.js +24 -3
- package/dist/Components/ActionCheckbox.js.map +1 -1
- package/dist/Components/ActionInput.js +124 -21
- package/dist/Components/ActionInput.js.map +1 -1
- package/dist/Components/ActionLink.js +24 -3
- package/dist/Components/ActionLink.js.map +1 -1
- package/dist/Components/ActionRadio.js +24 -3
- package/dist/Components/ActionRadio.js.map +1 -1
- package/dist/Components/ActionRouter.js +23 -2
- package/dist/Components/ActionRouter.js.map +1 -1
- package/dist/Components/ActionSeparator.js +1 -1
- package/dist/Components/ActionSeparator.js.map +1 -1
- package/dist/Components/ActionText.js +23 -2
- package/dist/Components/ActionText.js.map +1 -1
- package/dist/Components/ActionTextEditable.js +45 -3
- package/dist/Components/ActionTextEditable.js.map +1 -1
- package/dist/Components/Actions.js +25 -4
- package/dist/Components/Actions.js.map +1 -1
- package/dist/Components/AppContent.js +21 -1
- package/dist/Components/AppContent.js.map +1 -1
- package/dist/Components/AppContentDetails.js +1 -1
- package/dist/Components/AppContentDetails.js.map +1 -1
- package/dist/Components/AppContentList.js +1 -1
- package/dist/Components/AppContentList.js.map +1 -1
- package/dist/Components/AppNavigation.js +109 -2
- package/dist/Components/AppNavigation.js.map +1 -1
- package/dist/Components/AppNavigationCaption.js +66 -1
- package/dist/Components/AppNavigationCaption.js.map +1 -1
- package/dist/Components/AppNavigationCounter.js +2 -2
- package/dist/Components/AppNavigationCounter.js.map +1 -1
- package/dist/Components/AppNavigationIconBullet.js +2 -2
- package/dist/Components/AppNavigationIconBullet.js.map +1 -1
- package/dist/Components/AppNavigationItem.js +49 -7
- package/dist/Components/AppNavigationItem.js.map +1 -1
- package/dist/Components/AppNavigationNew.js +1 -1
- package/dist/Components/AppNavigationNew.js.map +1 -1
- package/dist/Components/AppNavigationNewItem.js +2 -2
- package/dist/Components/AppNavigationNewItem.js.map +1 -1
- package/dist/Components/AppNavigationSettings.js +5 -5
- package/dist/Components/AppNavigationSettings.js.map +1 -1
- package/dist/Components/AppNavigationSpacer.js +1 -1
- package/dist/Components/AppNavigationSpacer.js.map +1 -1
- package/dist/Components/AppNavigationToggle.js +109 -2
- package/dist/Components/AppNavigationToggle.js.map +1 -1
- package/dist/Components/AppSettingsDialog.js +64 -22
- package/dist/Components/AppSettingsDialog.js.map +1 -1
- package/dist/Components/AppSettingsSection.js +1 -1
- package/dist/Components/AppSettingsSection.js.map +1 -1
- package/dist/Components/AppSidebar.js +38 -17
- package/dist/Components/AppSidebar.js.map +1 -1
- package/dist/Components/AppSidebarTab.js +1 -1
- package/dist/Components/AppSidebarTab.js.map +1 -1
- package/dist/Components/Avatar.js +9 -10
- package/dist/Components/Avatar.js.map +1 -1
- package/dist/Components/Breadcrumb.js +33 -12
- package/dist/Components/Breadcrumb.js.map +1 -1
- package/dist/Components/Breadcrumbs.js +59 -17
- package/dist/Components/Breadcrumbs.js.map +1 -1
- package/dist/Components/CheckboxRadioSwitch.js +44 -0
- package/dist/Components/CheckboxRadioSwitch.js.map +1 -0
- package/dist/Components/ColorPicker.js +6 -7
- package/dist/Components/ColorPicker.js.map +1 -1
- package/dist/Components/Content.js +2 -2
- package/dist/Components/Content.js.map +1 -1
- package/dist/Components/CounterBubble.js +23 -0
- package/dist/Components/CounterBubble.js.map +1 -0
- package/dist/Components/DatetimePicker.js +341 -3
- package/dist/Components/DatetimePicker.js.map +1 -1
- package/dist/Components/EmojiPicker.js +14 -14
- package/dist/Components/EmojiPicker.js.map +1 -1
- package/dist/Components/EmptyContent.js +2 -2
- package/dist/Components/EmptyContent.js.map +1 -1
- package/dist/Components/Highlight.js +3 -3
- package/dist/Components/Highlight.js.map +1 -1
- package/dist/Components/ListItem.js +130 -0
- package/dist/Components/ListItem.js.map +1 -0
- package/dist/Components/ListItemIcon.js +20 -21
- package/dist/Components/ListItemIcon.js.map +1 -1
- package/dist/Components/Modal.js +53 -11
- package/dist/Components/Modal.js.map +1 -1
- package/dist/Components/Multiselect.js +22 -23
- package/dist/Components/Multiselect.js.map +1 -1
- package/dist/Components/MultiselectTags.js +24 -25
- package/dist/Components/MultiselectTags.js.map +1 -1
- package/dist/Components/Popover.js +2 -2
- package/dist/Components/Popover.js.map +1 -1
- package/dist/Components/PopoverMenu.js +1 -1
- package/dist/Components/PopoverMenu.js.map +1 -1
- package/dist/Components/ProgressBar.js +2 -2
- package/dist/Components/ProgressBar.js.map +1 -1
- package/dist/Components/RichContenteditable.js +2 -2
- package/dist/Components/RichContenteditable.js.map +1 -1
- package/dist/Components/SettingsInputText.js +22 -1
- package/dist/Components/SettingsInputText.js.map +1 -1
- package/dist/Components/SettingsSection.js +2 -2
- package/dist/Components/SettingsSection.js.map +1 -1
- package/dist/Components/SettingsSelectGroup.js +41 -21
- package/dist/Components/SettingsSelectGroup.js.map +1 -1
- package/dist/Components/TimezonePicker.js +340 -0
- package/dist/Components/TimezonePicker.js.map +1 -0
- package/dist/Components/UserBubble.js +35 -36
- package/dist/Components/UserBubble.js.map +1 -1
- package/dist/Directives/Focus.js +1 -1
- package/dist/Directives/Focus.js.map +1 -1
- package/dist/Directives/Linkify.js +1 -1
- package/dist/Directives/Linkify.js.map +1 -1
- package/dist/Directives/Tooltip.js +2 -2
- package/dist/Directives/Tooltip.js.map +1 -1
- package/dist/Functions/usernameToColor.js +2 -3
- package/dist/Functions/usernameToColor.js.map +1 -1
- package/dist/Mixins/excludeClickOutsideClasses.js +2 -2
- package/dist/Mixins/excludeClickOutsideClasses.js.map +1 -1
- package/dist/Mixins/isFullscreen.js +1 -1
- package/dist/Mixins/isFullscreen.js.map +1 -1
- package/dist/Mixins/isMobile.js +1 -1
- package/dist/Mixins/isMobile.js.map +1 -1
- package/dist/Mixins/richEditor.js +1 -1
- package/dist/Mixins/richEditor.js.map +1 -1
- package/dist/ncvuecomponents.js +276 -69
- package/dist/ncvuecomponents.js.map +1 -1
- package/package.json +28 -43
- package/src/assets/action.scss +0 -132
- package/src/assets/iconfont/README.md +0 -30
- package/src/assets/iconfont/arrow-left-double.svg +0 -3
- package/src/assets/iconfont/arrow-left.svg +0 -3
- package/src/assets/iconfont/arrow-right-double.svg +0 -3
- package/src/assets/iconfont/arrow-right.svg +0 -3
- package/src/assets/iconfont/breadcrumb.svg +0 -1
- package/src/assets/iconfont/checkmark.svg +0 -1
- package/src/assets/iconfont/close.svg +0 -1
- package/src/assets/iconfont/confirm.svg +0 -1
- package/src/assets/iconfont/info.svg +0 -1
- package/src/assets/iconfont/menu.svg +0 -1
- package/src/assets/iconfont/more.svg +0 -1
- package/src/assets/iconfont/pause.svg +0 -1
- package/src/assets/iconfont/play.svg +0 -1
- package/src/assets/iconfont/triangle-s.svg +0 -1
- package/src/assets/iconfont/user-status-away.svg +0 -2
- package/src/assets/iconfont/user-status-dnd.svg +0 -2
- package/src/assets/iconfont/user-status-invisible.svg +0 -2
- package/src/assets/iconfont/user-status-online.svg +0 -2
- package/src/assets/inputs.scss +0 -104
- package/src/assets/variables.scss +0 -57
- package/src/components/ActionButton/ActionButton.vue +0 -160
- package/src/components/ActionButton/index.js +0 -24
- package/src/components/ActionCheckbox/ActionCheckbox.vue +0 -220
- package/src/components/ActionCheckbox/index.js +0 -24
- package/src/components/ActionInput/ActionInput.vue +0 -418
- package/src/components/ActionInput/index.js +0 -24
- package/src/components/ActionLink/ActionLink.vue +0 -132
- package/src/components/ActionLink/index.js +0 -24
- package/src/components/ActionRadio/ActionRadio.vue +0 -219
- package/src/components/ActionRadio/index.js +0 -24
- package/src/components/ActionRouter/ActionRouter.vue +0 -100
- package/src/components/ActionRouter/index.js +0 -24
- package/src/components/ActionSeparator/ActionSeparator.vue +0 -43
- package/src/components/ActionSeparator/index.js +0 -24
- package/src/components/ActionText/ActionText.vue +0 -87
- package/src/components/ActionText/index.js +0 -24
- package/src/components/ActionTextEditable/ActionTextEditable.vue +0 -306
- package/src/components/ActionTextEditable/index.js +0 -24
- package/src/components/Actions/Actions.vue +0 -764
- package/src/components/Actions/index.js +0 -24
- package/src/components/AppContent/AppContent.vue +0 -93
- package/src/components/AppContent/index.js +0 -23
- package/src/components/AppContentDetails/AppContentDetails.vue +0 -34
- package/src/components/AppContentDetails/index.js +0 -23
- package/src/components/AppContentList/AppContentList.vue +0 -44
- package/src/components/AppContentList/index.js +0 -23
- package/src/components/AppNavigation/AppNavigation.vue +0 -190
- package/src/components/AppNavigation/index.js +0 -23
- package/src/components/AppNavigationCaption/AppNavigationCaption.vue +0 -39
- package/src/components/AppNavigationCaption/index.js +0 -3
- package/src/components/AppNavigationCounter/AppNavigationCounter.vue +0 -82
- package/src/components/AppNavigationCounter/index.js +0 -25
- package/src/components/AppNavigationIconBullet/AppNavigationIconBullet.vue +0 -95
- package/src/components/AppNavigationIconBullet/index.js +0 -24
- package/src/components/AppNavigationItem/AppNavigationIconCollapsible.vue +0 -90
- package/src/components/AppNavigationItem/AppNavigationItem.vue +0 -629
- package/src/components/AppNavigationItem/InputConfirmCancel.vue +0 -134
- package/src/components/AppNavigationItem/index.js +0 -24
- package/src/components/AppNavigationNew/AppNavigationNew.vue +0 -76
- package/src/components/AppNavigationNew/index.js +0 -23
- package/src/components/AppNavigationNewItem/AppNavigationNewItem.vue +0 -165
- package/src/components/AppNavigationNewItem/index.js +0 -24
- package/src/components/AppNavigationSettings/AppNavigationSettings.vue +0 -105
- package/src/components/AppNavigationSettings/index.js +0 -23
- package/src/components/AppNavigationSpacer/AppNavigationSpacer.vue +0 -39
- package/src/components/AppNavigationSpacer/index.js +0 -23
- package/src/components/AppNavigationToggle/AppNavigationToggle.vue +0 -78
- package/src/components/AppNavigationToggle/index.js +0 -24
- package/src/components/AppSettingsDialog/AppSettingsDialog.vue +0 -331
- package/src/components/AppSettingsDialog/index.js +0 -25
- package/src/components/AppSettingsSection/AppSettingsSection.vue +0 -64
- package/src/components/AppSettingsSection/index.js +0 -25
- package/src/components/AppSidebar/AppSidebar.vue +0 -802
- package/src/components/AppSidebar/AppSidebarTabs.vue +0 -348
- package/src/components/AppSidebar/index.js +0 -23
- package/src/components/AppSidebarTab/AppSidebarTab.vue +0 -103
- package/src/components/AppSidebarTab/index.js +0 -23
- package/src/components/Avatar/Avatar.vue +0 -758
- package/src/components/Avatar/index.js +0 -25
- package/src/components/Breadcrumb/Breadcrumb.vue +0 -262
- package/src/components/Breadcrumb/index.js +0 -25
- package/src/components/Breadcrumbs/Breadcrumbs.vue +0 -537
- package/src/components/Breadcrumbs/index.js +0 -25
- package/src/components/ColorPicker/ColorPicker.vue +0 -380
- package/src/components/ColorPicker/index.js +0 -25
- package/src/components/Content/Content.vue +0 -77
- package/src/components/Content/index.js +0 -23
- package/src/components/DatetimePicker/DatetimePicker.vue +0 -195
- package/src/components/DatetimePicker/index.js +0 -28
- package/src/components/DatetimePicker/index.scss +0 -405
- package/src/components/EmojiPicker/EmojiPicker.vue +0 -302
- package/src/components/EmojiPicker/index.js +0 -23
- package/src/components/EmptyContent/EmptyContent.vue +0 -120
- package/src/components/EmptyContent/index.js +0 -24
- package/src/components/Highlight/Highlight.vue +0 -183
- package/src/components/Highlight/index.js +0 -25
- package/src/components/ListItemIcon/ListItemIcon.vue +0 -277
- package/src/components/ListItemIcon/index.js +0 -25
- package/src/components/Modal/Modal.vue +0 -833
- package/src/components/Modal/index.js +0 -27
- package/src/components/Multiselect/EllipsisedOption.vue +0 -141
- package/src/components/Multiselect/Multiselect.vue +0 -430
- package/src/components/Multiselect/index.js +0 -28
- package/src/components/Multiselect/index.scss +0 -290
- package/src/components/MultiselectTags/MultiselectTags.vue +0 -179
- package/src/components/MultiselectTags/api.js +0 -115
- package/src/components/MultiselectTags/index.js +0 -23
- package/src/components/Popover/Popover.vue +0 -208
- package/src/components/Popover/index.js +0 -25
- package/src/components/PopoverMenu/PopoverMenu.vue +0 -62
- package/src/components/PopoverMenu/PopoverMenuItem.vue +0 -382
- package/src/components/PopoverMenu/index.js +0 -24
- package/src/components/ProgressBar/ProgressBar.vue +0 -135
- package/src/components/ProgressBar/index.js +0 -25
- package/src/components/RichContenteditable/AutoCompleteResult.vue +0 -191
- package/src/components/RichContenteditable/MentionBubble.vue +0 -165
- package/src/components/RichContenteditable/RichContenteditable.vue +0 -517
- package/src/components/RichContenteditable/index.js +0 -25
- package/src/components/SettingsInputText/SettingsInputText.vue +0 -207
- package/src/components/SettingsInputText/index.js +0 -24
- package/src/components/SettingsSection/SettingsSection.vue +0 -151
- package/src/components/SettingsSection/index.js +0 -24
- package/src/components/SettingsSelectGroup/SettingsSelectGroup.vue +0 -149
- package/src/components/SettingsSelectGroup/index.js +0 -25
- package/src/components/UserBubble/UserBubble.vue +0 -319
- package/src/components/UserBubble/index.js +0 -25
- package/src/components/index.js +0 -110
- package/src/directives/Focus/index.js +0 -29
- package/src/directives/Linkify/index.js +0 -31
- package/src/directives/Tooltip/index.js +0 -32
- package/src/directives/Tooltip/index.scss +0 -117
- package/src/directives/index.js +0 -31
- package/src/fonts/iconfont-vue-f56d517.eot +0 -0
- package/src/fonts/iconfont-vue-f56d517.svg +0 -1
- package/src/fonts/iconfont-vue-f56d517.ttf +0 -0
- package/src/fonts/iconfont-vue-f56d517.woff +0 -0
- package/src/fonts/scss/iconfont-vue.scss +0 -115
- package/src/functions/usernameToColor/index.js +0 -25
- package/src/functions/usernameToColor/usernameToColor.js +0 -68
- package/src/index.js +0 -40
- package/src/l10n.js +0 -42
- package/src/mixins/actionGlobal.js +0 -59
- package/src/mixins/actionText.js +0 -85
- package/src/mixins/excludeClickOutsideClasses/index.js +0 -72
- package/src/mixins/index.js +0 -35
- package/src/mixins/isFullscreen/index.js +0 -46
- package/src/mixins/isMobile/index.js +0 -43
- package/src/mixins/l10n.js +0 -8
- package/src/mixins/richEditor/index.js +0 -160
- package/src/mixins/userStatus.js +0 -76
- package/src/utils/FindRanges.js +0 -47
- package/src/utils/GenColors.js +0 -79
- package/src/utils/GenRandomId.js +0 -31
- package/src/utils/GetChildren.js +0 -47
- package/src/utils/GetParent.js +0 -41
- package/src/utils/IsMobileState.js +0 -49
- package/src/utils/IsOutOfViewport.js +0 -36
- package/src/utils/ScopeComponent.js +0 -37
- package/src/utils/Timer.js +0 -61
- package/src/utils/ValidateChildren.js +0 -50
- package/src/utils/ValidateSlot.js +0 -57
package/src/index.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
|
|
3
|
-
*
|
|
4
|
-
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
|
5
|
-
*
|
|
6
|
-
* @license GNU AGPL version 3 or any later version
|
|
7
|
-
*
|
|
8
|
-
* This program is free software: you can redistribute it and/or modify
|
|
9
|
-
* it under the terms of the GNU Affero General Public License as
|
|
10
|
-
* published by the Free Software Foundation, either version 3 of the
|
|
11
|
-
* License, or (at your option) any later version.
|
|
12
|
-
*
|
|
13
|
-
* This program is distributed in the hope that it will be useful,
|
|
14
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
* GNU Affero General Public License for more details.
|
|
17
|
-
*
|
|
18
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
19
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
import * as NcComponents from './components'
|
|
23
|
-
|
|
24
|
-
function install(Vue) {
|
|
25
|
-
Object.values(NcComponents).forEach((component) => {
|
|
26
|
-
Vue.component(component.name, component)
|
|
27
|
-
})
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
if (typeof window !== 'undefined' && window.Vue) {
|
|
31
|
-
install(window.Vue)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export default {
|
|
35
|
-
install,
|
|
36
|
-
...NcComponents,
|
|
37
|
-
}
|
|
38
|
-
export * from './components'
|
|
39
|
-
export * from './directives'
|
|
40
|
-
export * from './mixins'
|
package/src/l10n.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { getGettextBuilder } from '@nextcloud/l10n/dist/gettext'
|
|
2
|
-
|
|
3
|
-
const gtBuilder = getGettextBuilder()
|
|
4
|
-
.detectLocale()
|
|
5
|
-
|
|
6
|
-
// Decompress Translations to gettext format and add to gtBuilder
|
|
7
|
-
TRANSLATIONS.forEach((lang) => {
|
|
8
|
-
const translations = {}
|
|
9
|
-
|
|
10
|
-
for (const key in lang.translations) {
|
|
11
|
-
// Plural
|
|
12
|
-
if (lang.translations[key].pluralId) {
|
|
13
|
-
translations[key] = {
|
|
14
|
-
msgid: key,
|
|
15
|
-
msgid_plural: lang.translations[key].pluralId,
|
|
16
|
-
msgstr: lang.translations[key].msgstr,
|
|
17
|
-
}
|
|
18
|
-
continue
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// Singular
|
|
22
|
-
translations[key] = {
|
|
23
|
-
msgid: key,
|
|
24
|
-
msgstr: [
|
|
25
|
-
lang.translations[key],
|
|
26
|
-
],
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
gtBuilder.addTranslation(lang.locale, {
|
|
31
|
-
translations: {
|
|
32
|
-
'': translations,
|
|
33
|
-
},
|
|
34
|
-
})
|
|
35
|
-
})
|
|
36
|
-
|
|
37
|
-
const gt = gtBuilder.build()
|
|
38
|
-
|
|
39
|
-
const n = gt.ngettext.bind(gt)
|
|
40
|
-
const t = gt.gettext.bind(gt)
|
|
41
|
-
|
|
42
|
-
export { t, n }
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
|
|
4
|
-
*
|
|
5
|
-
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
|
6
|
-
*
|
|
7
|
-
* @license GNU AGPL version 3 or any later version
|
|
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
|
-
import Vue from 'vue'
|
|
24
|
-
|
|
25
|
-
export default {
|
|
26
|
-
before() {
|
|
27
|
-
// all actions requires a valid text content
|
|
28
|
-
// if none, forbid the component mount and throw error
|
|
29
|
-
if (!this.$slots.default || this.text.trim() === '') {
|
|
30
|
-
Vue.util.warn(`${this.$options.name} cannot be empty and requires a meaningful text content`, this)
|
|
31
|
-
this.$destroy()
|
|
32
|
-
this.$el.remove()
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
beforeUpdate() {
|
|
37
|
-
this.text = this.getText()
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
data() {
|
|
41
|
-
return {
|
|
42
|
-
// $slots are not reactive.
|
|
43
|
-
// We need to update the content manually
|
|
44
|
-
text: this.getText(),
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
computed: {
|
|
49
|
-
isLongText() {
|
|
50
|
-
return this.text && this.text.trim().length > 20
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
|
|
54
|
-
methods: {
|
|
55
|
-
getText() {
|
|
56
|
-
return this.$slots.default ? this.$slots.default[0].text.trim() : ''
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
}
|
package/src/mixins/actionText.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
|
|
4
|
-
*
|
|
5
|
-
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
|
6
|
-
*
|
|
7
|
-
* @license GNU AGPL version 3 or any later version
|
|
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
|
-
import actionGlobal from './actionGlobal'
|
|
24
|
-
import GetParent from '../utils/GetParent'
|
|
25
|
-
|
|
26
|
-
export default {
|
|
27
|
-
mixins: [actionGlobal],
|
|
28
|
-
props: {
|
|
29
|
-
/**
|
|
30
|
-
* Icon to show with the action, can be either a CSS class or an URL
|
|
31
|
-
*/
|
|
32
|
-
icon: {
|
|
33
|
-
type: String,
|
|
34
|
-
default: '',
|
|
35
|
-
},
|
|
36
|
-
/**
|
|
37
|
-
* Title to show next to the icon
|
|
38
|
-
*/
|
|
39
|
-
title: {
|
|
40
|
-
type: String,
|
|
41
|
-
default: '',
|
|
42
|
-
},
|
|
43
|
-
/**
|
|
44
|
-
* Whether we close the Actions menu after the click
|
|
45
|
-
*/
|
|
46
|
-
closeAfterClick: {
|
|
47
|
-
type: Boolean,
|
|
48
|
-
default: false,
|
|
49
|
-
},
|
|
50
|
-
/**
|
|
51
|
-
* Aria label for the button. Not needed if the button has text.
|
|
52
|
-
*/
|
|
53
|
-
ariaLabel: {
|
|
54
|
-
type: String,
|
|
55
|
-
default: '',
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
computed: {
|
|
60
|
-
isIconUrl() {
|
|
61
|
-
try {
|
|
62
|
-
return new URL(this.icon)
|
|
63
|
-
} catch (error) {
|
|
64
|
-
return false
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
methods: {
|
|
70
|
-
onClick(event) {
|
|
71
|
-
/**
|
|
72
|
-
* Emitted when the action is clicked
|
|
73
|
-
* @type {Event}
|
|
74
|
-
*/
|
|
75
|
-
this.$emit('click', event)
|
|
76
|
-
|
|
77
|
-
if (this.closeAfterClick) {
|
|
78
|
-
const parent = GetParent(this, 'Actions')
|
|
79
|
-
if (parent && parent.closeMenu) {
|
|
80
|
-
parent.closeMenu()
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) 2020 Georg Ehrke <georg-nextcloud@ehrke.email>
|
|
3
|
-
*
|
|
4
|
-
* @author Georg Ehrke <georg-nextcloud@ehrke.email>
|
|
5
|
-
*
|
|
6
|
-
* @license GNU AGPL version 3 or any later version
|
|
7
|
-
*
|
|
8
|
-
* This program is free software: you can redistribute it and/or modify
|
|
9
|
-
* it under the terms of the GNU Affero General Public License as
|
|
10
|
-
* published by the Free Software Foundation, either version 3 of the
|
|
11
|
-
* License, or (at your option) any later version.
|
|
12
|
-
*
|
|
13
|
-
* This program is distributed in the hope that it will be useful,
|
|
14
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
* GNU Affero General Public License for more details.
|
|
17
|
-
*
|
|
18
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
19
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
export default {
|
|
24
|
-
props: {
|
|
25
|
-
/**
|
|
26
|
-
* A class-name or an array of class-names
|
|
27
|
-
* to be ignored when clicking outside
|
|
28
|
-
* an element
|
|
29
|
-
*/
|
|
30
|
-
excludeClickOutsideClasses: {
|
|
31
|
-
type: String | Array,
|
|
32
|
-
default: () => [],
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
methods: {
|
|
36
|
-
/**
|
|
37
|
-
* Middleware Handler for V-Click-Outside
|
|
38
|
-
*
|
|
39
|
-
* @param {Event} event The click event
|
|
40
|
-
* @returns {Boolean}
|
|
41
|
-
*/
|
|
42
|
-
clickOutsideMiddleware(event) {
|
|
43
|
-
const excludedClassList = Array.isArray(this.excludeClickOutsideClasses)
|
|
44
|
-
? this.excludeClickOutsideClasses
|
|
45
|
-
: [this.excludeClickOutsideClasses]
|
|
46
|
-
|
|
47
|
-
// No need to iterate through all parents
|
|
48
|
-
// if class-list is empty
|
|
49
|
-
if (excludedClassList.length === 0) {
|
|
50
|
-
return true
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return !this.hasNodeOrAnyParentClass(event.target, excludedClassList)
|
|
54
|
-
},
|
|
55
|
-
/**
|
|
56
|
-
* Checks if given node or any of it's parents have a class of classArray
|
|
57
|
-
*
|
|
58
|
-
* @param {Element} node Node to test
|
|
59
|
-
* @param {Array} classArray List of classes to check for
|
|
60
|
-
* @returns {Boolean}
|
|
61
|
-
*/
|
|
62
|
-
hasNodeOrAnyParentClass(node, classArray) {
|
|
63
|
-
for (const className of classArray) {
|
|
64
|
-
if (node?.classList?.contains(className)) {
|
|
65
|
-
return true
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return !!node.parentElement && this.hasNodeOrAnyParentClass(node.parentElement, classArray)
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
}
|
package/src/mixins/index.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
|
|
3
|
-
*
|
|
4
|
-
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
|
5
|
-
*
|
|
6
|
-
* @license GNU AGPL version 3 or any later version
|
|
7
|
-
*
|
|
8
|
-
* This program is free software: you can redistribute it and/or modify
|
|
9
|
-
* it under the terms of the GNU Affero General Public License as
|
|
10
|
-
* published by the Free Software Foundation, either version 3 of the
|
|
11
|
-
* License, or (at your option) any later version.
|
|
12
|
-
*
|
|
13
|
-
* This program is distributed in the hope that it will be useful,
|
|
14
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
* GNU Affero General Public License for more details.
|
|
17
|
-
*
|
|
18
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
19
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
import excludeClickOutsideClasses from './excludeClickOutsideClasses'
|
|
24
|
-
import isFullscreen from './isFullscreen'
|
|
25
|
-
import isMobile from './isMobile'
|
|
26
|
-
import richEditor from './richEditor'
|
|
27
|
-
import userStatus from './userStatus'
|
|
28
|
-
|
|
29
|
-
export {
|
|
30
|
-
excludeClickOutsideClasses,
|
|
31
|
-
isFullscreen,
|
|
32
|
-
isMobile,
|
|
33
|
-
richEditor,
|
|
34
|
-
userStatus,
|
|
35
|
-
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
|
|
3
|
-
*
|
|
4
|
-
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
|
5
|
-
*
|
|
6
|
-
* @license GNU AGPL version 3 or any later version
|
|
7
|
-
*
|
|
8
|
-
* This program is free software: you can redistribute it and/or modify
|
|
9
|
-
* it under the terms of the GNU Affero General Public License as
|
|
10
|
-
* published by the Free Software Foundation, either version 3 of the
|
|
11
|
-
* License, or (at your option) any later version.
|
|
12
|
-
*
|
|
13
|
-
* This program is distributed in the hope that it will be useful,
|
|
14
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
* GNU Affero General Public License for more details.
|
|
17
|
-
*
|
|
18
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
19
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
export default {
|
|
24
|
-
data() {
|
|
25
|
-
return {
|
|
26
|
-
isFullscreen: this._isFullscreen(),
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
beforeMount() {
|
|
30
|
-
window.addEventListener('resize', this._onResize)
|
|
31
|
-
},
|
|
32
|
-
beforeDestroy() {
|
|
33
|
-
window.removeEventListener('resize', this._onResize)
|
|
34
|
-
},
|
|
35
|
-
methods: {
|
|
36
|
-
_onResize() {
|
|
37
|
-
// Update fullscreen mode
|
|
38
|
-
this.isFullscreen = this._isFullscreen()
|
|
39
|
-
},
|
|
40
|
-
_isFullscreen() {
|
|
41
|
-
// if the window height is equal to the screen height,
|
|
42
|
-
// we're in full screen mode
|
|
43
|
-
return window.outerHeight === screen.height
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>
|
|
3
|
-
*
|
|
4
|
-
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
|
5
|
-
*
|
|
6
|
-
* @license GNU AGPL version 3 or any later version
|
|
7
|
-
*
|
|
8
|
-
* This program is free software: you can redistribute it and/or modify
|
|
9
|
-
* it under the terms of the GNU Affero General Public License as
|
|
10
|
-
* published by the Free Software Foundation, either version 3 of the
|
|
11
|
-
* License, or (at your option) any later version.
|
|
12
|
-
*
|
|
13
|
-
* This program is distributed in the hope that it will be useful,
|
|
14
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
* GNU Affero General Public License for more details.
|
|
17
|
-
*
|
|
18
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
19
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
import { IsMobileState } from '../../utils/IsMobileState'
|
|
24
|
-
|
|
25
|
-
export default {
|
|
26
|
-
data() {
|
|
27
|
-
return {
|
|
28
|
-
isMobile: false,
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
mounted() {
|
|
32
|
-
IsMobileState.$on('changed', this.onIsMobileChanged)
|
|
33
|
-
this.isMobile = IsMobileState.isMobile
|
|
34
|
-
},
|
|
35
|
-
beforeDestroy() {
|
|
36
|
-
IsMobileState.$off('changed', this.onIsMobileChanged)
|
|
37
|
-
},
|
|
38
|
-
methods: {
|
|
39
|
-
onIsMobileChanged(val) {
|
|
40
|
-
this.isMobile = val
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
}
|
package/src/mixins/l10n.js
DELETED
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @copyright Copyright (c) 2020 John Molakvoæ <skjnldsv@protonmail.com>
|
|
3
|
-
*
|
|
4
|
-
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
|
5
|
-
*
|
|
6
|
-
* @license GNU AGPL version 3 or any later version
|
|
7
|
-
*
|
|
8
|
-
* This program is free software: you can redistribute it and/or modify
|
|
9
|
-
* it under the terms of the GNU Affero General Public License as
|
|
10
|
-
* published by the Free Software Foundation, either version 3 of the
|
|
11
|
-
* License, or (at your option) any later version.
|
|
12
|
-
*
|
|
13
|
-
* This program is distributed in the hope that it will be useful,
|
|
14
|
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
15
|
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
16
|
-
* GNU Affero General Public License for more details.
|
|
17
|
-
*
|
|
18
|
-
* You should have received a copy of the GNU Affero General Public License
|
|
19
|
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
import escapeHtml from 'escape-html'
|
|
24
|
-
import linkifyStr from 'linkifyjs/string'
|
|
25
|
-
import stripTags from 'striptags'
|
|
26
|
-
import Vue from 'vue'
|
|
27
|
-
|
|
28
|
-
import MentionBubble from '../../components/RichContenteditable/MentionBubble'
|
|
29
|
-
|
|
30
|
-
// Beginning or whitespace. Non-capturing group
|
|
31
|
-
const MENTION_START = '(?:^|\\s)'
|
|
32
|
-
// Anything that is not text or end-of-line. Non-capturing group
|
|
33
|
-
const MENTION_END = '(?:[^a-z]|$)'
|
|
34
|
-
export const USERID_REGEX = new RegExp(`${MENTION_START}(@[a-zA-Z0-9_.@\\-']+)(${MENTION_END})`, 'gi')
|
|
35
|
-
export const USERID_REGEX_WITH_SPACE = new RegExp(`${MENTION_START}(@"[a-zA-Z0-9 _.@\\-']+")(${MENTION_END})`, 'gi')
|
|
36
|
-
|
|
37
|
-
export default {
|
|
38
|
-
props: {
|
|
39
|
-
userData: {
|
|
40
|
-
type: Object,
|
|
41
|
-
default: () => ({}),
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
methods: {
|
|
45
|
-
/**
|
|
46
|
-
* Convert the value string to html for the inner content
|
|
47
|
-
*
|
|
48
|
-
* @param {string} value the content without html
|
|
49
|
-
* @returns {string} rendered html
|
|
50
|
-
*/
|
|
51
|
-
renderContent(value) {
|
|
52
|
-
// Sanitize the value prop
|
|
53
|
-
const sanitizedValue = escapeHtml(value)
|
|
54
|
-
|
|
55
|
-
// Extract all the userIds
|
|
56
|
-
const splitValue = sanitizedValue.split(USERID_REGEX)
|
|
57
|
-
.map(part => part.split(USERID_REGEX_WITH_SPACE)).flat()
|
|
58
|
-
|
|
59
|
-
// Replace userIds by html
|
|
60
|
-
return splitValue
|
|
61
|
-
.map(part => {
|
|
62
|
-
// When splitting, the string is always putting the userIds
|
|
63
|
-
// on the the uneven indexes. We only want to generate the mentions html
|
|
64
|
-
if (!part.startsWith('@')) {
|
|
65
|
-
// This part doesn't contain a mention, let's make sure links are parsed
|
|
66
|
-
return linkifyStr(part, {
|
|
67
|
-
defaultProtocol: 'https',
|
|
68
|
-
target: '_blank',
|
|
69
|
-
className: 'external',
|
|
70
|
-
attributes: {
|
|
71
|
-
rel: 'noopener noreferrer',
|
|
72
|
-
},
|
|
73
|
-
})
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// Extracting the id, nuking the " and @
|
|
77
|
-
const id = part.replace(/[@"]/gi, '')
|
|
78
|
-
|
|
79
|
-
// Compiling template and prepend with the space we removed during the split
|
|
80
|
-
return ' ' + this.genSelectTemplate(id)
|
|
81
|
-
})
|
|
82
|
-
.join('')
|
|
83
|
-
.replace(/\n/gmi, '<br>')
|
|
84
|
-
.replace(/&/gmi, '&')
|
|
85
|
-
},
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Convert the innerHtml content to a string with mentions as text
|
|
89
|
-
*
|
|
90
|
-
* @param {string} content the content without html
|
|
91
|
-
* @returns {string}
|
|
92
|
-
*/
|
|
93
|
-
parseContent(content) {
|
|
94
|
-
let text = content.replace(/<br>/gmi, '\n')
|
|
95
|
-
text = text.replace(/ /gmi, ' ')
|
|
96
|
-
text = text.replace(/&/gmi, '&')
|
|
97
|
-
|
|
98
|
-
// Convert the mentions to text only
|
|
99
|
-
// first we replace divs with new lines
|
|
100
|
-
text = text.replace(/<\/div>/gmi, '\n')
|
|
101
|
-
// then we remove all leftover html
|
|
102
|
-
text = stripTags(text, '<div>')
|
|
103
|
-
text = stripTags(text)
|
|
104
|
-
|
|
105
|
-
return text
|
|
106
|
-
},
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* Generate an autocompletion popup entry template
|
|
110
|
-
*
|
|
111
|
-
* @param {string} value the value to match against the userData
|
|
112
|
-
* @returns {string}
|
|
113
|
-
*/
|
|
114
|
-
genSelectTemplate(value) {
|
|
115
|
-
const data = this.userData[value]
|
|
116
|
-
|
|
117
|
-
// Fallback to @mention in case no data matches
|
|
118
|
-
if (!data) {
|
|
119
|
-
// return `@${value}`
|
|
120
|
-
return value.indexOf(' ') === -1
|
|
121
|
-
? `@${value}`
|
|
122
|
-
: `@"${value}"`
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
// Return template and make sure we strip of new lines and tabs
|
|
126
|
-
return this.renderComponentHtml(data, MentionBubble).replace(/[\n\t]/gmi, '')
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Render a component and return its html content
|
|
131
|
-
*
|
|
132
|
-
* @param {Object} propsData the props to pass to the component
|
|
133
|
-
* @param {Object} component the component to render
|
|
134
|
-
* @returns {string} the rendered html
|
|
135
|
-
*/
|
|
136
|
-
renderComponentHtml(propsData, component) {
|
|
137
|
-
const View = Vue.extend(component)
|
|
138
|
-
const Item = new View({
|
|
139
|
-
propsData,
|
|
140
|
-
})
|
|
141
|
-
|
|
142
|
-
// Prepare mountpoint
|
|
143
|
-
const wrapper = document.createElement('div')
|
|
144
|
-
const mount = document.createElement('div')
|
|
145
|
-
wrapper.style.display = 'none'
|
|
146
|
-
wrapper.appendChild(mount)
|
|
147
|
-
document.body.appendChild(wrapper)
|
|
148
|
-
|
|
149
|
-
// Mount and get raw html
|
|
150
|
-
Item.$mount(mount)
|
|
151
|
-
const renderedHtml = wrapper.innerHTML
|
|
152
|
-
|
|
153
|
-
// Destroy
|
|
154
|
-
Item.$destroy()
|
|
155
|
-
wrapper.remove()
|
|
156
|
-
|
|
157
|
-
return renderedHtml
|
|
158
|
-
},
|
|
159
|
-
},
|
|
160
|
-
}
|