2222
2323<template >
2424 <div v-if =" enabled"
25- v-show =" file "
25+ v-show =" hasRichWorkspace "
2626 id =" rich-workspace"
27- :class =" {'focus': focus, 'dark': darkTheme, 'creatable': canCreate }" >
28- <SkeletonLoading v-if =" !loaded || !ready" />
27+ :class =" {'focus': focus, 'dark': darkTheme }" >
28+ <RichTextReader v-if =" !loaded || !ready" :content = " content " class = " rich-workspace--preview " />
2929 <Editor v-if =" file"
3030 v-show =" ready"
3131 :key =" file.path"
4848import axios from ' @nextcloud/axios'
4949import { generateOcsUrl } from ' @nextcloud/router'
5050import { subscribe , unsubscribe } from ' @nextcloud/event-bus'
51- import SkeletonLoading from ' ../components/SkeletonLoading.vue'
5251import getEditorInstance from ' ../components/Editor.singleton.js'
52+ import RichTextReader from ' ../components/RichTextReader.vue'
5353
5454const IS_PUBLIC = !! (document .getElementById (' isPublic' ))
5555const WORKSPACE_URL = generateOcsUrl (' apps/text' + (IS_PUBLIC ? ' /public' : ' ' ) + ' /workspace' , 2 )
5656
5757export default {
5858 name: ' RichWorkspace' ,
5959 components: {
60- SkeletonLoading ,
60+ RichTextReader ,
6161 Editor: getEditorInstance,
6262 },
6363 props: {
64+ content: {
65+ type: String ,
66+ default: ' ' ,
67+ },
6468 path: {
6569 type: String ,
6670 required: true ,
@@ -69,6 +73,10 @@ export default {
6973 type: Boolean ,
7074 default: true ,
7175 },
76+ hasRichWorkspace: {
77+ type: Boolean ,
78+ default: false ,
79+ },
7280 },
7381 data () {
7482 return {
@@ -87,9 +95,6 @@ export default {
8795 shareToken () {
8896 return document .getElementById (' sharingToken' )? .value
8997 },
90- canCreate () {
91- return !! (this .folder && (this .folder .permissions & OC .PERMISSION_CREATE ))
92- },
9398 },
9499 watch: {
95100 path () {
@@ -134,9 +139,12 @@ export default {
134139 })
135140 },
136141 getFileInfo (autofocus ) {
137- this .loaded = false
138- this .autofocus = false
142+ if (! this .hasRichWorkspace ) {
143+ return
144+ }
139145 this .ready = false
146+ this .loaded = true
147+ this .autofocus = false
140148 const params = { path: this .path }
141149 if (IS_PUBLIC ) {
142150 params .shareToken = this .shareToken
@@ -209,9 +217,11 @@ export default {
209217 transition: max- height 0 .5s cubic- bezier (0 , 1 , 0 , 1 );
210218 z- index: 61 ;
211219 position: relative;
212- & .creatable {
213- min- height: 100px ;
214- }
220+ min- height: 30vh ;
221+ }
222+
223+ .rich - workspace-- preview {
224+ margin- top: 44px ;
215225 }
216226
217227 /* For subfolders, where there are no Recommendations */
0 commit comments