Commit 9f7dbbcc authored by Alexandros Georgantas's avatar Alexandros Georgantas

Initial Commit

parents
# Editoria
## 1.3.0
#### Wax
* Search / find and replace
* Notes pane is hidden if there are no notes in the document
* Note callouts work with track changes
* Track changes previous / next navigation
* Copy / cut and paste works with track changes
* Indicator for how many items exist in a collapsed comment discussion
* Performance improvements
* Find and Replace a single match and undo throws an Error
* Undo / Redo Notes on certain Occasions throws an Error
* Opening an Empty Chapter Save is Enabled and modal is triggered if you try to go back without any change in the Editor
* if Track Changes is on, user cannot remove an image
* Remove additions on cut operation in track changes if done from the same user
* With track Changes on if you accept a deleted note and undo throws an error
* With track Changes on if you delete a whole paragraph and undo throws an error
* Navigate Through Notes with left and right arrow
* Toggle on /off Native Spell Checker
* Full screen mode
* Track Spaces
* Image Captions
* Change note icon in the toolbar
* Add keyboard shortcuts for accept & reject track changes
* Small Caps
#### Maintenance
* Switch to using yarn instead of npm by default
* React 16
* Upgrade to latest pubsweet client
* Clean up component prop types and refs
* Switch to Postgres
* Docker container for the DB provided via yarn start:services
## 1.2.0
* Upgrade to latest Pubsweet server, client, and components
* Introduce password reset
#### Book Builder
* Preview exported book in Vivliostyle Viewer
* Chapters keep track of their own numbering (independently from parts) in the Body
* Renaming of fragments has been removed in favour of using the title tag in Wax
* Drag and drop fixes
#### Wax Editor
* Can now style multiple blocks/paragraphs at once, including lists
* Keyboard shortcuts
* Turn track changes on/off => ctrl/cmd+y
* Hide / show tracked changes => ctrl/cmd+shift+y
* Comments => ctrl/cmd+m
* Save => ctrl/cmd+s
* New Title style (which will also rename the fragment in the book builder)
* New Subtitle style
* New Bibliography Entry style
* Revamped track changes UI: Tools are now in the toolbar instead of inline, and line height in the document has been reduced
* Surface doesn't lose focus any more unless the user clicks outside of Wax
* Paragraph indentation
## 1.1.4
#### Wax Editor
* Fix for unsaved changes warning
## 1.1.3
* New design for the book builder, the dashboard and the theme
#### Dashboard
* Renamed 'remove' button to 'delete' for consistency with the book builder
* Double clicking on a book will take you to the book builder for that book, instead of opening the renaming interface
* The position of 'Edit' and 'Rename' actions have been swapped ('Edit' now comes first)
* Books now appear in alphabetical order
#### Book Builder
* Fixed issue with fragments disappearing when uploading multiple files
* Renamed 'Front Matter' and 'Back Matter' to 'Frontmatter' and 'Backmatter'
#### Wax Editor
* Introduce layouts
* Accept configuration options (`layout` and `lockWhenEditing`)
* It is now broken down into separate modules for better separation of concerns
* Pubsweet integration
* React integration
* Core
* Diacritics work within notes
### Editoria 1.0, July 2017
Editoria was started as a collaboration between UCP and Coko, initial funding came from the Mellon Foundation.
Those involved in conceptualising, designing, and building Editoria (including the Wax Editor) from 0 to 1.0 include:
* Erich van Rijn
* Catherine Mitchell
* Kate Warne
* Cindy Fulton
* Lisa Schiff
* Justin Gonder
* Juliana Froggatt
* Adam Hyde
* Kristen Ratan
* Yannis Barlas
* Christos Kokosias
* Julien Taquet
* Alex Theg
* Alexandros Georgantas
* Giannis Kopanas
MIT License
Copyright (c) 2017 The Regents of the University of California
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
\ No newline at end of file
This diff is collapsed.
{
"lerna": "2.4.0",
"packages": [
"packages/*"
],
"version": "independent"
}
{
"author": "Coko Foundation",
"description": "Monorepo grouping all the different parts of the Editoria project for the case of Book Sprints",
"devDependencies": {
"babel-eslint": "^8.0.3",
"babel-preset-es2015": "^6.24.1",
"eslint": "^4.13.1",
"eslint-config-pubsweet": "^0.0.6",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-jest": "^21.4.2",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-node": "^5.2.1",
"eslint-plugin-prettier": "^2.3.1",
"eslint-plugin-promise": "^3.6.0",
"eslint-plugin-react": "^7.4.0",
"eslint-plugin-standard": "^3.0.1",
"lerna": "^2.5.1",
"lint-staged": "^6.0.0",
"prettier": "^1.8.2",
"stylelint": "^8.2.0",
"stylelint-config-prettier": "^2.0.0",
"stylelint-config-pubsweet": "^0.0.3"
},
"license": "MIT",
"name": "editoria-booksprints-monorepo",
"private": true,
"repository": {
"type": "git",
"url": "git@gitlab.coko.foundation:editoria/booksprints.git"
},
"scripts": {
"bootstrap": "lerna bootstrap",
"clean": "lerna clean",
"publish": "lerna publish",
"updated": "lerna updated",
"test": "lerna run test"
},
"version": "0.0.0",
"dependencies": {
"babel-preset-stage-0": "^6.24.1"
},
"workspaces": [
"packages/*"
]
}
MIT License
Copyright (c) 2017 University of California Press
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
module.exports = {
frontend: {
components: [
() => require('./src/BookBuilder')
]
}
}
\ No newline at end of file
{
"name": "pubsweet-component-bookbuilder",
"version": "1.1.0",
"description": "",
"main": "index.js",
"scripts": {
"styleguide": "styleguidist server",
"styleguide:build": "styleguidist build",
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"pubsweet-component",
"pubsweet-client"
],
"author": "",
"license": "ISC",
"dependencies": {
"axios": "^0.17.1",
"classnames": "^2.2.5",
"config": "^1.27.0",
"editoria-common": "^0.1.1",
"font-awesome": "4.7.0",
"lodash": "4.17.4",
"pubsweet-client": "^2.5.5",
"react": "^16.2.0",
"react-bootstrap": "0.32.1",
"react-dnd": "2.5.4",
"react-dnd-html5-backend": "2.5.4",
"react-dom": "^16.2.0",
"react-redux": "5.0.4",
"react-router-bootstrap": "0.24.4",
"react-router-dom": "4.2.2",
"redux": "3.7.2"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-env": "^1.6.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-2": "^6.24.1",
"enzyme": "^2.9.1",
"enzyme-to-json": "^1.5.1",
"file-loader": "^0.11.2",
"identity-obj-proxy": "^3.0.0",
"jest": "^20.0.4",
"node-sass": "^4.5.3",
"prop-types": "^15.5.10",
"react-addons-test-utils": "^15.6.0",
"react-styleguidist": "^6.0.24",
"react-test-renderer": "^15.6.1",
"sass-loader": "^6.0.6",
"sinon": "^2.3.6",
"sinon-as-promised": "^4.0.3",
"webpack": "^2.7.0",
"webpack-node-externals": "^1.6.0"
}
}
import React from 'react'
import PropTypes from 'prop-types'
import styles from './styles/bookBuilder.local.scss'
export default class AddButton extends React.Component {
constructor(props) {
super(props)
this._addGroup = this._addGroup.bind(this)
}
_addGroup() {
const { add, group } = this.props
add(group)
}
render() {
const { group } = this.props
return (
<button className={styles.sectionBtn} onClick={this._addGroup}>
<i className={styles.addBtnIcon} />
{`add ${group}`}
</button>
)
}
}
AddButton.propTypes = {
add: PropTypes.func.isRequired,
group: PropTypes.string.isRequired,
}
This diff is collapsed.
import { flow } from 'lodash'
import React from 'react'
import PropTypes from 'prop-types'
import { DragSource, DropTarget } from 'react-dnd'
import Authorize from 'pubsweet-client/src/helpers/Authorize'
import FirstRow from './Chapter/FirstRow'
import SecondRow from './Chapter/SecondRow'
import {
chapterSource,
chapterTarget,
collectDrag,
collectDrop,
itemTypes,
} from './dnd'
import styles from './styles/bookBuilder.local.scss'
class Chapter extends React.PureComponent {
constructor(props) {
super(props)
this.toggleUpload = this.toggleUpload.bind(this)
this.update = this.update.bind(this)
this.state = {
isUploadInProgress: false,
}
}
update(patch) {
const { book, update, chapter } = this.props
// SHOULD BE REMOVED. This automaticaly sets track changes on for the case
// or review in progress
if (patch.progress.review === 0 && chapter.trackChanges === false) {
patch.trackChanges = true
}
update(book, patch)
}
toggleUpload() {
this.setState({
isUploadInProgress: !this.state.isUploadInProgress,
})
// if (!this.state.isUploadInProgress) this.removeUploadState()
}
renderHasContent() {
const { chapter } = this.props
const source = chapter.source || ''
const hasContent = source.trim().length > 0
return hasContent
}
// componentWillReceiveProps(nextProps) {
// const { chapter } = nextProps
// const source = chapter.source || ''
// const sourceBefore = this.props.chapter.source || ''
// const hasContentBefore = sourceBefore.trim().length > 0
// const hasContent = source.trim().length > 0
// // console.log('fragment old', this.props.chapter.source)
// // console.log('fragment new', chapter.source)
// if (!hasContentBefore && hasContent) {
// const patch = {
// id: chapter.id,
// progress: chapter.progress,
// }
// patch.progress.upload = 1
// patch.progress.file_prep = 0
// this.update(patch)
// }
// }
// getLocalStorageKey () {
// const { chapter } = this.props
// return 'chapter:upload:' + chapter.id
// }
//
// persistUploadState () {
// const key = this.getLocalStorageKey()
// window.localStorage.setItem(key, true)
// }
//
// removeUploadState () {
// const key = this.getLocalStorageKey()
// window.localStorage.removeItem(key)
// }
//
// componentWillMount () {
// const key = this.getLocalStorageKey()
// var entry = window.localStorage.getItem(key)
// if (entry) {
// this.setState({
// isUploadInProgress: true
// })
// }
// }
//
// componentWillUnmount () {
// if (this.state.isUploadInProgress) {
// this.persistUploadState()
// }
// }
render() {
const {
book,
chapter,
connectDragSource,
connectDropTarget,
ink,
isDragging,
outerContainer,
remove,
user,
title,
type,
uploading,
} = this.props
const hasContent = this.renderHasContent()
const { isUploadInProgress } = this.state
const listItemStyle = {
opacity: isDragging ? 0 : 1,
}
const indicatorGrabAllowed = allowed => {
if (isUploadInProgress || !allowed) {
return (
<div className={`${styles.grabContainer} ${styles.notAllowed}`}>
<svg viewBox="0 0 24 48">
<circle
cx="110%"
cy="50%"
fill="transparent"
r="20"
stroke={hasContent === true ? '#0d78f2' : '#666'}
strokeWidth="2"
/>
<circle
cx="110%"
cy="50%"
fill={hasContent === true ? '#0d78f2' : '#666'}
r="17"
strokeWidth="0"
/>
</svg>
</div>
)
}
return (
<div
className={styles.grabContainer}
// className={`${styles.grabIcon} ${
// hasContent === true ? styles.hasContent : ''
// }`}
>
<svg viewBox="0 0 24 48">
<circle
cx="110%"
cy="50%"
fill="transparent"
r="20"
stroke={hasContent === true ? '#0d78f2' : '#666'}
strokeWidth="2"
/>
<circle
cx="110%"
cy="50%"
fill={hasContent === true ? '#0d78f2' : '#666'}
r="17"
strokeWidth="0"
/>
</svg>
<div className={styles.tooltip}>grab to sort</div>
</div>
)
}
// TODO -- refactor these huge class names
// TODO -- make the dot and line component/s
return connectDragSource(
connectDropTarget(
<li
className={`${styles.chapterContainer} ${
chapter.subCategory === 'chapter' ||
chapter.subCategory === 'un-numbered'
? styles.isChapter
: ''
}`}
style={listItemStyle}
>
<Authorize
object={book}
operation="can reorder bookComponents"
unauthorized={indicatorGrabAllowed(false)}
>
{indicatorGrabAllowed(true)}
</Authorize>
<div className={` ${styles.chapterMainContent}`}>
<FirstRow
book={book}
chapter={chapter}
isUploadInProgress={isUploadInProgress || uploading}
outerContainer={outerContainer}
remove={remove}
title={title}
type={type}
update={this.update}
user={user}
/>
<SecondRow
chapter={chapter}
convertFile={ink}
isUploadInProgress={isUploadInProgress || uploading}
outerContainer={outerContainer}
toggleUpload={this.toggleUpload}
update={this.update}
user={user}
viewOrEdit={this._viewOrEdit}
/>
</div>
</li>,
),
)
}
}
Chapter.propTypes = {
book: PropTypes.shape({
id: PropTypes.string,
rev: PropTypes.string,
title: PropTypes.string,
}).isRequired,
chapter: PropTypes.shape({
alignment: PropTypes.objectOf(PropTypes.bool),
author: PropTypes.string,
book: PropTypes.string,
division: PropTypes.string,
id: PropTypes.string,
index: PropTypes.number,
kind: PropTypes.string,
lock: PropTypes.shape({
editor: PropTypes.shape({
username: PropTypes.string,
}),
timestamp: PropTypes.string,
}),
number: PropTypes.number,
owners: PropTypes.arrayOf(
PropTypes.shape({
id: PropTypes.string,
username: PropTypes.string,
}),
),
progress: PropTypes.objectOf(PropTypes.number),
rev: PropTypes.string,
source: PropTypes.string,
status: PropTypes.string,
subCategory: PropTypes.string,
title: PropTypes.string,
trackChanges: PropTypes.bool,
type: PropTypes.string,
}).isRequired,
connectDragSource: PropTypes.func.isRequired,
connectDropTarget: PropTypes.func.isRequired,
ink: PropTypes.func.isRequired,
isDragging: PropTypes.bool.isRequired,
outerContainer: PropTypes.any.isRequired,
remove: PropTypes.func.isRequired,
user: PropTypes.shape({
admin: PropTypes.bool,
email: PropTypes.string,
id: PropTypes.string,
rev: PropTypes.string,
type: PropTypes.string,
username: PropTypes.string,
}),
title: PropTypes.string,
type: PropTypes.string.isRequired,
update: PropTypes.func.isRequired,
uploading: PropTypes.bool,
}
Chapter.defaultProps = {
uploading: false,
title: null,
}
export { Chapter as UnwrappedChapter }
// const comparison = (nextProps, props) => {
// return nextProps.chapter.id === props.chapter.id && nextProps.chapter.index === props.chapter.index
// }
// combine them, as each chapter can be both a source and a target
export default flow(
DragSource(itemTypes.CHAPTER, chapterSource, collectDrag),
DropTarget(itemTypes.CHAPTER, chapterTarget, collectDrop),
</