You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

601 lines
24 KiB

  1. <template lang='pug'>
  2. v-card.editor-modal-media.animated.fadeInLeft(flat, tile, :class='`is-editor-` + editorKey')
  3. v-container.pa-3(grid-list-lg, fluid)
  4. v-layout(row, wrap)
  5. v-flex(xs12, lg9)
  6. v-card.radius-7.animated.fadeInLeft.wait-p1s(:light='!$vuetify.theme.dark', :dark='$vuetify.theme.dark')
  7. v-card-text
  8. .d-flex
  9. v-toolbar.radius-7(:color='$vuetify.theme.dark ? `teal` : `teal lighten-5`', dense, flat, height='44')
  10. .body-2(:class='$vuetify.theme.dark ? `white--text` : `teal--text`') {{$t('editor:assets.title')}}
  11. v-spacer
  12. v-btn(text, icon, @click='refresh')
  13. v-icon(:color='$vuetify.theme.dark ? `white` : `teal`') mdi-refresh
  14. v-dialog(v-model='newFolderDialog', max-width='550')
  15. template(v-slot:activator='{ on }')
  16. v-btn.ml-3.my-0.mr-0.radius-7(outlined, large, color='teal', :icon='$vuetify.breakpoint.xsOnly', v-on='on')
  17. v-icon(:left='$vuetify.breakpoint.mdAndUp') mdi-plus
  18. span.hidden-sm-and-down(:class='$vuetify.theme.dark ? `teal--text text--lighten-3` : ``') {{$t('editor:assets.newFolder')}}
  19. v-card
  20. .dialog-header.is-short.subtitle-1 {{$t('editor:assets.newFolder')}}
  21. v-card-text.pt-5
  22. v-text-field.md2(
  23. outlined
  24. prepend-icon='mdi-folder-outline'
  25. v-model='newFolderName'
  26. :label='$t(`editor:assets.folderName`)'
  27. counter='255'
  28. @keyup.enter='createFolder'
  29. @keyup.esc='newFolderDialog = false'
  30. ref='folderNameIpt'
  31. )
  32. i18next.caption.grey--text.text--darken-1.pl-5(path='editor:assets.folderNameNamingRules', tag='div')
  33. a(place='namingRules', href='https://docs-beta.requarks.io/guide/assets#naming-restrictions', target='_blank') {{$t('editor:assets.folderNameNamingRulesLink')}}
  34. v-card-chin
  35. v-spacer
  36. v-btn(text, @click='newFolderDialog = false') {{$t('common:actions.cancel')}}
  37. v-btn.px-3(color='primary', @click='createFolder', :disabled='!isFolderNameValid', :loading='newFolderLoading') {{$t('common:actions.create')}}
  38. v-toolbar(flat, dense, :color='$vuetify.theme.dark ? `grey darken-3` : `white`')
  39. template(v-if='folderTree.length > 0')
  40. .body-2
  41. span.mr-1 /
  42. template(v-for='folder of folderTree')
  43. span(:key='folder.id') {{folder.name}}
  44. span.mx-1 /
  45. .body-2(v-else) / #[em root]
  46. template(v-if='folders.length > 0 || currentFolderId > 0')
  47. v-btn.is-icon.mx-1(:color='$vuetify.theme.dark ? `grey lighten-1` : `grey darken-2`', outlined, :dark='currentFolderId > 0', @click='upFolder()', :disabled='currentFolderId === 0')
  48. v-icon mdi-folder-upload
  49. v-btn.btn-normalcase.mx-1(v-for='folder of folders', :key='folder.id', depressed, color='grey darken-2', dark, @click='downFolder(folder)')
  50. v-icon(left) mdi-folder
  51. span.caption(style='text-transform: none;') {{ folder.name }}
  52. v-divider.mt-2
  53. v-data-table(
  54. :items='assets'
  55. :headers='headers'
  56. :page.sync='pagination'
  57. :items-per-page='15'
  58. :loading='loading'
  59. must-sort,
  60. hide-default-footer,
  61. dense
  62. )
  63. template(slot='item', slot-scope='props')
  64. tr.is-clickable(
  65. @click.left='currentFileId = props.item.id'
  66. @click.right.prevent=''
  67. :class='currentFileId === props.item.id ? ($vuetify.theme.dark ? `grey darken-3-d5` : `teal lighten-5`) : ``'
  68. )
  69. td.caption(v-if='$vuetify.breakpoint.smAndUp') {{ props.item.id }}
  70. td
  71. .body-2: strong(:class='currentFileId === props.item.id ? `teal--text` : ``') {{ props.item.filename }}
  72. .caption.grey--text {{ props.item.description }}
  73. td.text-xs-center(v-if='$vuetify.breakpoint.lgAndUp')
  74. v-chip.ma-0(x-small, :color='$vuetify.theme.dark ? `grey darken-4` : `grey lighten-4`')
  75. .overline {{props.item.ext.toUpperCase().substring(1)}}
  76. td.caption(v-if='$vuetify.breakpoint.mdAndUp') {{ props.item.fileSize | prettyBytes }}
  77. td.caption(v-if='$vuetify.breakpoint.mdAndUp') {{ props.item.createdAt | moment('from') }}
  78. td(v-if='$vuetify.breakpoint.smAndUp')
  79. v-menu(offset-x, min-width='200')
  80. template(v-slot:activator='{ on }')
  81. v-btn(icon, v-on='on', tile, small)
  82. v-icon(color='grey darken-2') mdi-dots-horizontal
  83. v-list(nav, style='border-top: 5px solid #444;')
  84. v-list-item(@click='', disabled)
  85. v-list-item-avatar(size='24')
  86. v-icon(color='teal') mdi-text-short
  87. v-list-item-content {{$t('common:actions.properties')}}
  88. template(v-if='props.item.kind === `IMAGE`')
  89. v-list-item(@click='previewDialog = true', disabled)
  90. v-list-item-avatar(size='24')
  91. v-icon(color='green') mdi-image-search-outline
  92. v-list-item-content {{$t('common:actions.preview')}}
  93. v-list-item(@click='', disabled)
  94. v-list-item-avatar(size='24')
  95. v-icon(color='indigo') mdi-crop-rotate
  96. v-list-item-content {{$t('common:actions.edit')}}
  97. v-list-item(@click='', disabled)
  98. v-list-item-avatar(size='24')
  99. v-icon(color='purple') mdi-flash-circle
  100. v-list-item-content {{$t('common:actions.optimize')}}
  101. v-list-item(@click='openRenameDialog')
  102. v-list-item-avatar(size='24')
  103. v-icon(color='orange') mdi-keyboard-outline
  104. v-list-item-content {{$t('common:actions.rename')}}
  105. v-list-item(@click='', disabled)
  106. v-list-item-avatar(size='24')
  107. v-icon(color='blue') mdi-file-move
  108. v-list-item-content {{$t('common:actions.move')}}
  109. v-list-item(@click='deleteDialog = true')
  110. v-list-item-avatar(size='24')
  111. v-icon(color='red') mdi-file-hidden
  112. v-list-item-content {{$t('common:actions.delete')}}
  113. template(slot='no-data')
  114. v-alert.mt-3.radius-7(icon='mdi-folder-open-outline', :value='true', outlined, color='teal') {{$t('editor:assets.folderEmpty')}}
  115. .text-xs-center.py-2(v-if='this.pageTotal > 1')
  116. v-pagination(v-model='pagination', :length='pageTotal', color='teal')
  117. .d-flex.mt-3
  118. v-toolbar.radius-7(flat, :color='$vuetify.theme.dark ? `grey darken-2` : `grey lighten-4`', dense, height='44')
  119. .body-2(:class='$vuetify.theme.dark ? `grey--text text--lighten-1` : `grey--text text--darken-1`') {{$t('editor:assets.fileCount', { count: assets.length })}}
  120. v-btn.ml-3.mr-0.my-0.radius-7(color='red darken-2', large, @click='cancel', dark)
  121. v-icon(left) mdi-close
  122. span {{$t('common:actions.cancel')}}
  123. v-btn.ml-3.mr-0.my-0.radius-7(color='teal', large, @click='insert', :disabled='!currentFileId', :dark='currentFileId !== null')
  124. v-icon(left) mdi-playlist-plus
  125. span {{$t('common:actions.insert')}}
  126. v-flex(xs12, lg3)
  127. v-card.radius-7.animated.fadeInRight.wait-p3s(:light='!$vuetify.theme.dark', :dark='$vuetify.theme.dark')
  128. v-card-text
  129. .d-flex
  130. v-toolbar.radius-7(:color='$vuetify.theme.dark ? `teal` : `teal lighten-5`', dense, flat, height='44')
  131. v-icon.mr-3(:color='$vuetify.theme.dark ? `white` : `teal`') mdi-cloud-upload
  132. .body-2(:class='$vuetify.theme.dark ? `white--text` : `teal--text`') {{$t('editor:assets.uploadAssets')}}
  133. v-btn.my-0.ml-3.mr-0.radius-7(outlined, large, color='teal', @click='browse', v-if='$vuetify.breakpoint.mdAndUp')
  134. v-icon(left) mdi-plus-box-multiple
  135. span(:class='$vuetify.theme.dark ? `teal--text text--lighten-3` : ``') {{$t('common:actions.browse')}}
  136. file-pond.mt-3(
  137. name='mediaUpload'
  138. ref='pond'
  139. :label-idle='$t(`editor:assets.uploadAssetsDropZone`)'
  140. allow-multiple='true'
  141. :files='files'
  142. max-files='10'
  143. server='/u'
  144. :instant-upload='false'
  145. :allow-revert='false'
  146. @processfile='onFileProcessed'
  147. )
  148. v-divider
  149. v-card-actions.pa-3
  150. .caption.grey--text.text-darken-2 Max 10 files, 5 MB each
  151. v-spacer
  152. v-btn.px-4(color='teal', dark, @click='upload') {{$t('common:actions.upload')}}
  153. v-card.mt-3.radius-7.animated.fadeInRight.wait-p4s(:light='!$vuetify.theme.dark', :dark='$vuetify.theme.dark')
  154. v-card-text.pb-0
  155. v-toolbar.radius-7(:color='$vuetify.theme.dark ? `teal` : `teal lighten-5`', dense, flat)
  156. v-icon.mr-3(:color='$vuetify.theme.dark ? `white` : `teal`') mdi-cloud-download
  157. .body-2(:class='$vuetify.theme.dark ? `white--text` : `teal--text`') {{$t('editor:assets.fetchImage')}}
  158. v-spacer
  159. v-chip(label, color='white', small).teal--text coming soon
  160. v-text-field.mt-3(
  161. v-model='remoteImageUrl'
  162. outlined
  163. color='teal'
  164. single-line
  165. placeholder='https://example.com/image.jpg'
  166. )
  167. v-divider
  168. v-card-actions.pa-3
  169. .caption.grey--text.text-darken-2 Max 5 MB
  170. v-spacer
  171. v-btn.px-4(color='teal', disabled) {{$t('common:actions.fetch')}}
  172. v-card.mt-3.radius-7.animated.fadeInRight.wait-p4s(:light='!$vuetify.theme.dark', :dark='$vuetify.theme.dark')
  173. v-card-text.pb-0
  174. v-toolbar.radius-7(:color='$vuetify.theme.dark ? `teal` : `teal lighten-5`', dense, flat)
  175. v-icon.mr-3(:color='$vuetify.theme.dark ? `white` : `teal`') mdi-format-align-top
  176. .body-2(:class='$vuetify.theme.dark ? `white--text` : `teal--text`') {{$t('editor:assets.imageAlign')}}
  177. v-select.mt-3(
  178. v-model='imageAlignment'
  179. :items='imageAlignments'
  180. outlined
  181. single-line
  182. color='teal'
  183. placeholder='None'
  184. )
  185. //- RENAME DIALOG
  186. v-dialog(v-model='renameDialog', max-width='550', persistent)
  187. v-card
  188. .dialog-header.is-short.is-orange
  189. v-icon.mr-2(color='white') mdi-keyboard
  190. span {{$t('editor:assets.renameAsset')}}
  191. v-card-text.pt-5
  192. .body-2 {{$t('editor:assets.renameAssetSubtitle')}}
  193. v-text-field(
  194. outlined
  195. single-line
  196. :counter='255'
  197. v-model='renameAssetName'
  198. @keyup.enter='renameAsset'
  199. :disabled='renameAssetLoading'
  200. )
  201. v-card-chin
  202. v-spacer
  203. v-btn(text, @click='renameDialog = false', :disabled='renameAssetLoading') {{$t('common:actions.cancel')}}
  204. v-btn.px-3(color='orange darken-3', @click='renameAsset', :loading='renameAssetLoading').white--text {{$t('common:actions.rename')}}
  205. //- DELETE DIALOG
  206. v-dialog(v-model='deleteDialog', max-width='550', persistent)
  207. v-card
  208. .dialog-header.is-short.is-red
  209. v-icon.mr-2(color='white') mdi-trash-can-outline
  210. span {{$t('editor:assets.deleteAsset')}}
  211. v-card-text.pt-5
  212. .body-2 {{$t('editor:assets.deleteAssetConfirm')}}
  213. .body-2.red--text.text--darken-2 {{currentAsset.filename}}?
  214. .caption.mt-3 {{$t('editor:assets.deleteAssetWarn')}}
  215. v-card-chin
  216. v-spacer
  217. v-btn(text, @click='deleteDialog = false', :disabled='deleteAssetLoading') {{$t('common:actions.cancel')}}
  218. v-btn.px-3(color='red darken-2', @click='deleteAsset', :loading='deleteAssetLoading').white--text {{$t('common:actions.delete')}}
  219. </template>
  220. <script>
  221. import _ from 'lodash'
  222. import { get, sync } from 'vuex-pathify'
  223. import vueFilePond from 'vue-filepond'
  224. import 'filepond/dist/filepond.min.css'
  225. import listAssetQuery from 'gql/editor/editor-media-query-list.gql'
  226. import listFolderAssetQuery from 'gql/editor/editor-media-query-folder-list.gql'
  227. import createAssetFolderMutation from 'gql/editor/editor-media-mutation-folder-create.gql'
  228. import renameAssetMutation from 'gql/editor/editor-media-mutation-asset-rename.gql'
  229. import deleteAssetMutation from 'gql/editor/editor-media-mutation-asset-delete.gql'
  230. const FilePond = vueFilePond()
  231. const localeSegmentRegex = /^[A-Z]{2}(-[A-Z]{2})?$/i
  232. const disallowedFolderChars = /[A-Z()=.!@#$%?&*+`~<>,;:\\/[\]¬{| ]/
  233. export default {
  234. components: {
  235. FilePond
  236. },
  237. props: {
  238. value: {
  239. type: Boolean,
  240. default: false
  241. }
  242. },
  243. data() {
  244. return {
  245. folders: [],
  246. files: [],
  247. assets: [],
  248. pagination: 1,
  249. remoteImageUrl: '',
  250. imageAlignments: [
  251. { text: 'None', value: '' },
  252. { text: 'Left', value: 'left' },
  253. { text: 'Centered', value: 'center' },
  254. { text: 'Right', value: 'right' },
  255. { text: 'Absolute Top Right', value: 'abstopright' }
  256. ],
  257. imageAlignment: '',
  258. loading: false,
  259. newFolderDialog: false,
  260. newFolderName: '',
  261. newFolderLoading: false,
  262. previewDialog: false,
  263. renameDialog: false,
  264. renameAssetName: '',
  265. renameAssetLoading: false,
  266. deleteDialog: false,
  267. deleteAssetLoading: false
  268. }
  269. },
  270. computed: {
  271. isShown: {
  272. get() { return this.value },
  273. set(val) { this.$emit('input', val) }
  274. },
  275. editorKey: get('editor/editorKey'),
  276. activeModal: sync('editor/activeModal'),
  277. folderTree: get('editor/media@folderTree'),
  278. currentFolderId: sync('editor/media@currentFolderId'),
  279. currentFileId: sync('editor/media@currentFileId'),
  280. pageTotal () {
  281. if (!this.assets) {
  282. return 0
  283. }
  284. return Math.ceil(this.assets.length / 15)
  285. },
  286. headers() {
  287. return _.compact([
  288. this.$vuetify.breakpoint.smAndUp && { text: this.$t('editor:assets.headerId'), value: 'id', width: 80 },
  289. { text: this.$t('editor:assets.headerFilename'), value: 'filename' },
  290. this.$vuetify.breakpoint.lgAndUp && { text: this.$t('editor:assets.headerType'), value: 'ext', width: 90 },
  291. this.$vuetify.breakpoint.mdAndUp && { text: this.$t('editor:assets.headerFileSize'), value: 'fileSize', width: 110 },
  292. this.$vuetify.breakpoint.mdAndUp && { text: this.$t('editor:assets.headerAdded'), value: 'createdAt', width: 175 },
  293. this.$vuetify.breakpoint.smAndUp && { text: this.$t('editor:assets.headerActions'), value: '', width: 80, sortable: false, align: 'right' }
  294. ])
  295. },
  296. isFolderNameValid() {
  297. return this.newFolderName.length > 1 && !localeSegmentRegex.test(this.newFolderName) && !disallowedFolderChars.test(this.newFolderName)
  298. },
  299. currentAsset () {
  300. return _.find(this.assets, ['id', this.currentFileId]) || {}
  301. }
  302. },
  303. watch: {
  304. newFolderDialog(newValue, oldValue) {
  305. if (newValue) {
  306. this.$nextTick(() => {
  307. this.$refs.folderNameIpt.focus()
  308. })
  309. }
  310. }
  311. },
  312. filters: {
  313. prettyBytes(num) {
  314. if (typeof num !== 'number' || isNaN(num)) {
  315. throw new TypeError('Expected a number')
  316. }
  317. let exponent
  318. let unit
  319. let neg = num < 0
  320. let units = ['B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
  321. if (neg) {
  322. num = -num
  323. }
  324. if (num < 1) {
  325. return (neg ? '-' : '') + num + ' B'
  326. }
  327. exponent = Math.min(Math.floor(Math.log(num) / Math.log(1000)), units.length - 1)
  328. num = (num / Math.pow(1000, exponent)).toFixed(2) * 1
  329. unit = units[exponent]
  330. return (neg ? '-' : '') + num + ' ' + unit
  331. }
  332. },
  333. methods: {
  334. async refresh() {
  335. await this.$apollo.queries.assets.refetch()
  336. this.$store.commit('showNotification', {
  337. message: this.$t('editor:assets.refreshSuccess'),
  338. style: 'success',
  339. icon: 'check'
  340. })
  341. },
  342. insert () {
  343. const asset = _.find(this.assets, ['id', this.currentFileId])
  344. const assetPath = this.folderTree.map(f => f.slug).join('/')
  345. this.$root.$emit('editorInsert', {
  346. kind: asset.kind,
  347. path: this.currentFolderId > 0 ? `/${assetPath}/${asset.filename}` : `/${asset.filename}`,
  348. text: asset.filename,
  349. align: this.imageAlignment
  350. })
  351. this.activeModal = ''
  352. },
  353. browse () {
  354. this.$refs.pond.browse()
  355. },
  356. async upload () {
  357. const files = this.$refs.pond.getFiles()
  358. if (files.length < 1) {
  359. return this.$store.commit('showNotification', {
  360. message: this.$t('editor:assets.noUploadError'),
  361. style: 'warning',
  362. icon: 'warning'
  363. })
  364. }
  365. for (let file of files) {
  366. file.setMetadata({
  367. folderId: this.currentFolderId
  368. })
  369. }
  370. await this.$refs.pond.processFiles()
  371. },
  372. async onFileProcessed (err, file) {
  373. if (err) {
  374. return this.$store.commit('showNotification', {
  375. message: this.$t('editor:assets.uploadFailed'),
  376. style: 'error',
  377. icon: 'error'
  378. })
  379. }
  380. _.delay(() => {
  381. this.$refs.pond.removeFile(file.id)
  382. }, 5000)
  383. await this.$apollo.queries.assets.refetch()
  384. },
  385. downFolder(folder) {
  386. this.$store.commit('editor/pushMediaFolderTree', folder)
  387. this.currentFolderId = folder.id
  388. this.currentFileId = null
  389. },
  390. upFolder() {
  391. this.$store.commit('editor/popMediaFolderTree')
  392. const parentFolder = _.last(this.folderTree)
  393. this.currentFolderId = parentFolder ? parentFolder.id : 0
  394. this.currentFileId = null
  395. },
  396. async createFolder() {
  397. this.$store.commit(`loadingStart`, 'editor-media-createfolder')
  398. this.newFolderLoading = true
  399. try {
  400. const resp = await this.$apollo.mutate({
  401. mutation: createAssetFolderMutation,
  402. variables: {
  403. parentFolderId: this.currentFolderId,
  404. slug: this.newFolderName
  405. }
  406. })
  407. if (_.get(resp, 'data.assets.createFolder.responseResult.succeeded', false)) {
  408. await this.$apollo.queries.folders.refetch()
  409. this.$store.commit('showNotification', {
  410. message: this.$t('editor:assets.folderCreateSuccess'),
  411. style: 'success',
  412. icon: 'check'
  413. })
  414. this.newFolderDialog = false
  415. this.newFolderName = ''
  416. } else {
  417. this.$store.commit('pushGraphError', new Error(_.get(resp, 'data.assets.createFolder.responseResult.message')))
  418. }
  419. } catch (err) {
  420. this.$store.commit('pushGraphError', err)
  421. }
  422. this.newFolderLoading = false
  423. this.$store.commit(`loadingStop`, 'editor-media-createfolder')
  424. },
  425. openRenameDialog() {
  426. this.renameAssetName = this.currentAsset.filename
  427. this.renameDialog = true
  428. },
  429. async renameAsset() {
  430. this.$store.commit(`loadingStart`, 'editor-media-renameasset')
  431. this.renameAssetLoading = true
  432. try {
  433. const resp = await this.$apollo.mutate({
  434. mutation: renameAssetMutation,
  435. variables: {
  436. id: this.currentFileId,
  437. filename: this.renameAssetName
  438. }
  439. })
  440. if (_.get(resp, 'data.assets.renameAsset.responseResult.succeeded', false)) {
  441. await this.$apollo.queries.assets.refetch()
  442. this.$store.commit('showNotification', {
  443. message: this.$t('editor:assets.renameSuccess'),
  444. style: 'success',
  445. icon: 'check'
  446. })
  447. this.renameDialog = false
  448. this.renameAssetName = ''
  449. } else {
  450. this.$store.commit('pushGraphError', new Error(_.get(resp, 'data.assets.renameAsset.responseResult.message')))
  451. }
  452. } catch (err) {
  453. this.$store.commit('pushGraphError', err)
  454. }
  455. this.renameAssetLoading = false
  456. this.$store.commit(`loadingStop`, 'editor-media-renameasset')
  457. },
  458. async deleteAsset() {
  459. this.$store.commit(`loadingStart`, 'editor-media-deleteasset')
  460. this.deleteAssetLoading = true
  461. try {
  462. const resp = await this.$apollo.mutate({
  463. mutation: deleteAssetMutation,
  464. variables: {
  465. id: this.currentFileId
  466. }
  467. })
  468. if (_.get(resp, 'data.assets.deleteAsset.responseResult.succeeded', false)) {
  469. this.currentFileId = null
  470. await this.$apollo.queries.assets.refetch()
  471. this.$store.commit('showNotification', {
  472. message: this.$t('editor:assets.deleteSuccess'),
  473. style: 'success',
  474. icon: 'check'
  475. })
  476. this.deleteDialog = false
  477. } else {
  478. this.$store.commit('pushGraphError', new Error(_.get(resp, 'data.assets.deleteAsset.responseResult.message')))
  479. }
  480. } catch (err) {
  481. this.$store.commit('pushGraphError', err)
  482. }
  483. this.deleteAssetLoading = false
  484. this.$store.commit(`loadingStop`, 'editor-media-deleteasset')
  485. },
  486. cancel () {
  487. this.activeModal = ''
  488. }
  489. },
  490. apollo: {
  491. folders: {
  492. query: listFolderAssetQuery,
  493. variables() {
  494. return {
  495. parentFolderId: this.currentFolderId
  496. }
  497. },
  498. fetchPolicy: 'network-only',
  499. update: (data) => data.assets.folders,
  500. watchLoading (isLoading) {
  501. this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'editor-media-folders-list-refresh')
  502. }
  503. },
  504. assets: {
  505. query: listAssetQuery,
  506. variables() {
  507. return {
  508. folderId: this.currentFolderId,
  509. kind: 'ALL'
  510. }
  511. },
  512. throttle: 1000,
  513. fetchPolicy: 'network-only',
  514. update: (data) => data.assets.list,
  515. watchLoading (isLoading) {
  516. this.loading = isLoading
  517. this.$store.commit(`loading${isLoading ? 'Start' : 'Stop'}`, 'editor-media-list-refresh')
  518. }
  519. }
  520. }
  521. }
  522. </script>
  523. <style lang='scss'>
  524. .editor-modal-media {
  525. position: fixed !important;
  526. top: 112px;
  527. left: 64px;
  528. z-index: 10;
  529. width: calc(100vw - 64px - 17px);
  530. height: calc(100vh - 112px - 24px);
  531. background-color: rgba(darken(mc('grey', '900'), 3%), .9) !important;
  532. overflow: auto;
  533. @include until($tablet) {
  534. left: 40px;
  535. width: calc(100vw - 40px);
  536. height: calc(100vh - 112px - 24px);
  537. }
  538. &.is-editor-ckeditor {
  539. top: 64px;
  540. left: 0;
  541. width: 100%;
  542. height: calc(100vh - 64px - 26px);
  543. @include until($tablet) {
  544. top: 56px;
  545. left: 0;
  546. width: 100%;
  547. height: calc(100vh - 56px - 24px);
  548. }
  549. }
  550. &.is-editor-code {
  551. top: 64px;
  552. height: calc(100vh - 64px - 26px);
  553. @include until($tablet) {
  554. top: 56px;
  555. height: calc(100vh - 56px - 24px);
  556. }
  557. }
  558. .filepond--root {
  559. margin-bottom: 0;
  560. }
  561. .filepond--drop-label {
  562. cursor: pointer;
  563. > label {
  564. cursor: pointer;
  565. }
  566. }
  567. .filepond--file-action-button.filepond--action-process-item {
  568. display: none;
  569. }
  570. .v-btn--icon {
  571. padding: 0 20px;
  572. }
  573. }
  574. </style>