Преглед на файлове

real integration of plugin pageHtml

Skylsmoi преди 6 години
родител
ревизия
96091ab9d6

+ 3 - 4
dist/index.html Целия файл

32
     <script src="./dev/bootstrap-4.0.0-beta.2.js"></script>
32
     <script src="./dev/bootstrap-4.0.0-beta.2.js"></script>
33
 
33
 
34
     <script type='text/javascript'>
34
     <script type='text/javascript'>
35
-      GLOBAL_renderPlugin = pluginName => {
36
-        if (pluginName === 'PageHtml') {
37
-          pluginPageHtml.renderPlugin('pluginContainer')
38
-          console.log('plugin pagehtml rendered')
35
+      GLOBAL_renderPlugin = data => {
36
+        if (data.file.type === 'PageHtml') {
37
+          pluginPageHtml.renderPlugin('pluginContainer', data)
39
         }
38
         }
40
       }
39
       }
41
 
40
 

Файловите разлики са ограничени, защото са твърде много
+ 8 - 3
dist/plugin/pageHtml.plugin.js


+ 2 - 2
package.json Целия файл

39
     "style-loader": "^0.19.0",
39
     "style-loader": "^0.19.0",
40
     "stylus": "^0.54.5",
40
     "stylus": "^0.54.5",
41
     "stylus-loader": "^3.0.1",
41
     "stylus-loader": "^3.0.1",
42
+    "tracim_lib": "git://github.com/Skylsmoi/tracim_lib.git",
42
     "url-loader": "^0.6.2",
43
     "url-loader": "^0.6.2",
43
     "webpack": "^3.8.1",
44
     "webpack": "^3.8.1",
44
-    "whatwg-fetch": "^2.0.3",
45
-    "tracim_lib": "git://github.com/Skylsmoi/tracim_lib.git"
45
+    "whatwg-fetch": "^2.0.3"
46
   },
46
   },
47
   "devDependencies": {
47
   "devDependencies": {
48
     "json-server": "^0.12.0",
48
     "json-server": "^0.12.0",

+ 1 - 1
src/component/Header/Logo.jsx Целия файл

10
 }
10
 }
11
 export default Logo
11
 export default Logo
12
 
12
 
13
-Logo.PropTypes = {
13
+Logo.propTypes = {
14
   logoSrc: PropTypes.string.isRequired,
14
   logoSrc: PropTypes.string.isRequired,
15
   onClickImg: PropTypes.func.isRequired
15
   onClickImg: PropTypes.func.isRequired
16
 }
16
 }

+ 1 - 1
src/component/Header/MenuActionListItem/DropdownLang.jsx Целия файл

30
 }
30
 }
31
 export default DropdownLang
31
 export default DropdownLang
32
 
32
 
33
-DropdownLang.PropTypes = {
33
+DropdownLang.propTypes = {
34
   langList: PropTypes.array.isRequired,
34
   langList: PropTypes.array.isRequired,
35
   onChangeLang: PropTypes.func.isRequired
35
   onChangeLang: PropTypes.func.isRequired
36
 }
36
 }

+ 1 - 1
src/component/Header/MenuActionListItem/Help.jsx Целия файл

16
 }
16
 }
17
 export default Help
17
 export default Help
18
 
18
 
19
-Help.PropTypes = {
19
+Help.propTypes = {
20
   onClickHelp: PropTypes.func.isRequired
20
   onClickHelp: PropTypes.func.isRequired
21
 }
21
 }

+ 1 - 1
src/component/Header/MenuActionListItem/MenuProfil.jsx Целия файл

24
 }
24
 }
25
 export default MenuProfil
25
 export default MenuProfil
26
 
26
 
27
-MenuProfil.PropTypes = {
27
+MenuProfil.propTypes = {
28
   user: PropTypes.object.isRequired,
28
   user: PropTypes.object.isRequired,
29
   onClickMyProfil: PropTypes.func.isRequired,
29
   onClickMyProfil: PropTypes.func.isRequired,
30
   onClickLogout: PropTypes.func.isRequired
30
   onClickLogout: PropTypes.func.isRequired

+ 1 - 1
src/component/Header/MenuActionListItem/Search.jsx Целия файл

25
 }
25
 }
26
 export default Search
26
 export default Search
27
 
27
 
28
-Search.PropTypes = {
28
+Search.propTypes = {
29
   onChangeInput: PropTypes.func.isRequired,
29
   onChangeInput: PropTypes.func.isRequired,
30
   onClickSubmit: PropTypes.func.isRequired
30
   onClickSubmit: PropTypes.func.isRequired
31
 }
31
 }

+ 1 - 1
src/component/Header/MenuLinkList.jsx Целия файл

18
 }
18
 }
19
 export default MenuLinkList
19
 export default MenuLinkList
20
 
20
 
21
-MenuLinkList.PropTypes = {
21
+MenuLinkList.propTypes = {
22
   onClickFeature: PropTypes.func.isRequired,
22
   onClickFeature: PropTypes.func.isRequired,
23
   onClickExplore: PropTypes.func.isRequired,
23
   onClickExplore: PropTypes.func.isRequired,
24
   onClickAbout: PropTypes.func.isRequired
24
   onClickAbout: PropTypes.func.isRequired

+ 1 - 1
src/component/common/Card/CardBody.jsx Целия файл

14
 
14
 
15
 export default CardBody
15
 export default CardBody
16
 
16
 
17
-CardBody.PropTypes = {
17
+CardBody.propTypes = {
18
   children: PropTypes.element.isRequired,
18
   children: PropTypes.element.isRequired,
19
   formClass: PropTypes.string
19
   formClass: PropTypes.string
20
 }
20
 }

+ 1 - 1
src/component/common/Card/CardHeader.jsx Целия файл

12
 
12
 
13
 export default CardHeader
13
 export default CardHeader
14
 
14
 
15
-CardHeader.PropTypes = {
15
+CardHeader.propTypes = {
16
   children: PropTypes.element.isRequired,
16
   children: PropTypes.element.isRequired,
17
   customClass: PropTypes.string
17
   customClass: PropTypes.string
18
 }
18
 }

+ 1 - 1
src/component/common/Input/Button.jsx Целия файл

16
 
16
 
17
 export default Button
17
 export default Button
18
 
18
 
19
-Button.PropTypes = {
19
+Button.propTypes = {
20
   htmlType: PropTypes.oneOf(['button', 'submit', 'reset']).isRequired,
20
   htmlType: PropTypes.oneOf(['button', 'submit', 'reset']).isRequired,
21
   bootstrapType: PropTypes.oneOf(
21
   bootstrapType: PropTypes.oneOf(
22
     ['primary', 'default', 'default', 'success', 'danger', 'warning', 'info', 'light', 'dark']
22
     ['primary', 'default', 'default', 'success', 'danger', 'warning', 'info', 'light', 'dark']

+ 1 - 1
src/component/common/Input/InputCheckbox.jsx Целия файл

21
 
21
 
22
 export default InputGroupText
22
 export default InputGroupText
23
 
23
 
24
-InputGroupText.PropTypes = {
24
+InputGroupText.propTypes = {
25
   parentClassName: PropTypes.string.isRequired,
25
   parentClassName: PropTypes.string.isRequired,
26
   checked: PropTypes.bool.isRequired,
26
   checked: PropTypes.bool.isRequired,
27
   onChange: PropTypes.func.isRequired,
27
   onChange: PropTypes.func.isRequired,

+ 1 - 1
src/component/common/Input/InputGroupText.jsx Целия файл

24
 
24
 
25
 export default InputGroupText
25
 export default InputGroupText
26
 
26
 
27
-InputGroupText.PropTypes = {
27
+InputGroupText.propTypes = {
28
   parentClassName: PropTypes.string.isRequired,
28
   parentClassName: PropTypes.string.isRequired,
29
   value: PropTypes.string.isRequired,
29
   value: PropTypes.string.isRequired,
30
   type: PropTypes.oneOf(['text', 'email', 'password', 'tel']).isRequired,
30
   type: PropTypes.oneOf(['text', 'email', 'password', 'tel']).isRequired,

+ 2 - 4
src/container/PrivateRoute.jsx Целия файл

17
 const mapStateToProps = ({ user }) => ({ user })
17
 const mapStateToProps = ({ user }) => ({ user })
18
 export default withRouter(connect(mapStateToProps)(PrivateRoute))
18
 export default withRouter(connect(mapStateToProps)(PrivateRoute))
19
 
19
 
20
-PrivateRoute.PropTypes = {
21
-  component: PropTypes.shape({
22
-    Component: PropTypes.object.isRequired
23
-  }),
20
+PrivateRoute.propTypes = {
21
+  component: PropTypes.func.isRequired,
24
   user: PropTypes.shape({ // user is get with redux connect
22
   user: PropTypes.shape({ // user is get with redux connect
25
     isLoggedIn: PropTypes.bool.isRequired
23
     isLoggedIn: PropTypes.bool.isRequired
26
   })
24
   })

+ 5 - 16
src/container/WorkspaceContent.jsx Целия файл

7
 import PageTitle from '../component/common/layout/PageTitle.jsx'
7
 import PageTitle from '../component/common/layout/PageTitle.jsx'
8
 import PageContent from '../component/common/layout/PageContent.jsx'
8
 import PageContent from '../component/common/layout/PageContent.jsx'
9
 import DropdownCreateButton from '../component/common/Input/DropdownCreateButton.jsx'
9
 import DropdownCreateButton from '../component/common/Input/DropdownCreateButton.jsx'
10
-// import pluginDatabase from '../plugin/index.js'
11
 import {
10
 import {
12
   getPluginList,
11
   getPluginList,
13
   getWorkspaceContent
12
   getWorkspaceContent
14
 } from '../action-creator.async.js'
13
 } from '../action-creator.async.js'
15
-import { setActiveFileContent } from '../action-creator.sync.js'
16
-import { bonjour } from 'tracim_lib'
14
+// import pluginDatabase from '../plugin/index.js'
17
 
15
 
18
 class WorkspaceContent extends React.Component {
16
 class WorkspaceContent extends React.Component {
19
   constructor (props) {
17
   constructor (props) {
29
   }
27
   }
30
 
28
 
31
   handleClickFileItem = file => {
29
   handleClickFileItem = file => {
32
-    // this.props.dispatch(setActiveFileContent(file))
33
-    GLOBAL_renderPlugin(file.type)
34
-  }
35
-
36
-  handleDummyBtn = () => {
37
-    // GLOBAL_dispatchEvent({
38
-    //   source: 'Tracim',
39
-    //   type: 'PageHtml_showMsg',
40
-    //   content: 'Bonjour ?'
41
-    // })
42
-    bonjour()
30
+    GLOBAL_renderPlugin({
31
+      file,
32
+      pluginData: this.props.plugin[file.type]
33
+    })
43
   }
34
   }
44
 
35
 
45
   render () {
36
   render () {
58
         </PageTitle>
49
         </PageTitle>
59
 
50
 
60
         <PageContent parentClass='workspace__content'>
51
         <PageContent parentClass='workspace__content'>
61
-          <button onClick={this.handleDummyBtn}>Click Me</button>
62
-
63
           <div className='workspace__content__fileandfolder folder__content active'>
52
           <div className='workspace__content__fileandfolder folder__content active'>
64
             <FileItemHeader />
53
             <FileItemHeader />
65
 
54
 

+ 0 - 105
src/css/Generic.styl Целия файл

161
       border 1px solid grey
161
       border 1px solid grey
162
       border-radius 10px
162
       border-radius 10px
163
       padding 15px 25px
163
       padding 15px 25px
164
-
165
-/********************/
166
-
167
-/*** PAGE FILE, THREAD, HTML, MARKDOWN, ISSUE ***/
168
-
169
-.wsFileGeneric
170
-  position fixed
171
-  top 85px
172
-  right 0
173
-  border 1px solid grey
174
-  height 100%
175
-  background-color lightGrey
176
-  box-shadow shadow-page
177
-  visibility hidden
178
-  z-index 1
179
-  &.visible
180
-    visibility visible
181
-  &__header
182
-    display flex
183
-    align-items center
184
-    padding 15px
185
-    height 64px
186
-    &__icon
187
-      margin-right 15px
188
-      font-size 22px
189
-      color white
190
-    &__title
191
-      margin-right 15px
192
-      color white
193
-      text-overflow ellipsis
194
-      overflow hidden
195
-      white-space nowrap
196
-    &__edittitle
197
-      margin 0 15px
198
-      color white
199
-      font-size 20px
200
-      cursor pointer
201
-      &:hover , &:focus
202
-        border 1px solid off-white
203
-        padding 0 10px
204
-        border-radius 5px
205
-    &__close
206
-      border 1px solid white
207
-      border-radius 5px
208
-      padding 2px 5px
209
-      cursor pointer
210
-      & > i
211
-        color white
212
-        font-size 20px
213
-  &__option
214
-    border-bottom 1px solid grey
215
-    padding 10px
216
-    height 58px
217
-    background-color off-white
218
-    & > i
219
-      vertical-align middle
220
-      margin-right 15px
221
-      font-size 25px
222
-      cursor pointer
223
-    &__menu
224
-      display flex
225
-      align-items center
226
-      &__status
227
-        margin-right 20px
228
-        .current
229
-          color blue
230
-        .check
231
-          color green
232
-        .invalid
233
-          color red
234
-        .ban
235
-          color grey
236
-        &__dropdownbtn
237
-          border 1px solid grey
238
-          width 150px
239
-          background-color transparent
240
-          cursor pointer
241
-          &::after
242
-            color fontColor
243
-          &:hover
244
-            background-color transparent
245
-          &__icon
246
-            display inline-block
247
-            margin 0 15px
248
-        &__submenu
249
-          &__item
250
-            display flex
251
-            justify-content space-between
252
-            margin 5px 0
253
-            cursor pointer
254
-            &:active
255
-              background-color transparent
256
-      &__action
257
-        margin 5px 10px 0 0
258
-        font-size 18px
259
-        cursor pointer
260
-        &:hover , &:focus
261
-          font-size 22px
262
-          color blue
263
-  &__content
264
-    display flex
265
-    &__left
266
-      width 55%
267
-    &__right
268
-      width 45%

+ 2 - 0
src/css/Variable.styl Целия файл

1
+// Côme - 2018/02/27 - DEPRECATED : now using Variable.styl from tracim_lib
2
+
1
 /**** VARIABLES ****/
3
 /**** VARIABLES ****/
2
 /*** COULEURS ****/
4
 /*** COULEURS ****/
3
 
5
 

+ 3 - 1
src/css/index.styl Целия файл

3
 html, body, #content, #content > div
3
 html, body, #content, #content > div
4
   height 100%
4
   height 100%
5
 
5
 
6
-@import 'Variable.styl'
6
+// @TODO Côme - 2018/02/27 - do not manually import from node_module relative path
7
+@import '../../node_modules/tracim_lib/src/css/Variable.styl'
8
+
7
 @import 'Generic.styl'
9
 @import 'Generic.styl'
8
 
10
 
9
 @import 'Sidebar.styl'
11
 @import 'Sidebar.styl'

+ 10 - 4
src/plugin/ContentType/PageHtml/PageHtmlContainer.jsx Целия файл

1
 import React from 'react'
1
 import React from 'react'
2
 import { connect } from 'react-redux'
2
 import { connect } from 'react-redux'
3
-import PopinFixed from '../../../component/common/PopinFixed/PopinFixed.jsx'
4
-import PopinFixedHeader from '../../../component/common/PopinFixed/PopinFixedHeader.jsx'
5
-import PopinFixedOption from '../../../component/common/PopinFixed/PopinFixedOption.jsx'
6
-import PopinFixedContent from '../../../component/common/PopinFixed/PopinFixedContent.jsx'
3
+// import PopinFixed from '../../../component/common/PopinFixed/PopinFixed.jsx'
4
+// import PopinFixedHeader from '../../../component/common/PopinFixed/PopinFixedHeader.jsx'
5
+// import PopinFixedOption from '../../../component/common/PopinFixed/PopinFixedOption.jsx'
6
+// import PopinFixedContent from '../../../component/common/PopinFixed/PopinFixedContent.jsx'
7
+import {
8
+  PopinFixed,
9
+  PopinFixedHeader,
10
+  PopinFixedOption,
11
+  PopinFixedContent
12
+} from 'tracim_lib'
7
 import PageHtmlComponent from './PageHtmlComponent.jsx'
13
 import PageHtmlComponent from './PageHtmlComponent.jsx'
8
 import Timeline from '../../../component/Timeline.jsx'
14
 import Timeline from '../../../component/Timeline.jsx'
9
 import { hideActiveFileContent } from '../../../action-creator.sync.js'
15
 import { hideActiveFileContent } from '../../../action-creator.sync.js'

+ 4 - 4
src/plugin/ContentType/PageHtml/index.js Целия файл

1
 import reducer from './pageHtml.js'
1
 import reducer from './pageHtml.js'
2
-import container from './PageHtmlContainer.jsx'
3
-import component from './PageHtmlComponent.jsx'
2
+// import container from './PageHtmlContainer.jsx'
3
+// import component from './PageHtmlComponent.jsx'
4
 
4
 
5
 const PageHtml = {
5
 const PageHtml = {
6
   name: 'PageHtml',
6
   name: 'PageHtml',
7
-  container,
8
-  component,
7
+  // container,
8
+  // component,
9
   reducer
9
   reducer
10
 }
10
 }
11
 
11
 

+ 8 - 3
src/plugin/ContentType/Thread/index.js Целия файл

1
 import reducer from './thread.js'
1
 import reducer from './thread.js'
2
-import component from './Thread.jsx'
3
-import style from './Thread.styl'
2
+// import container from './ThreadContainer.jsx'
3
+// import component from './ThreadComponent.jsx'
4
 
4
 
5
-const Thread = { name: 'Thread', component, reducer, style }
5
+const Thread = {
6
+  name: 'Thread',
7
+  // container,
8
+  // component,
9
+  reducer
10
+}
6
 
11
 
7
 export default Thread
12
 export default Thread