Skip to content
This repository has been archived by the owner on Mar 29, 2021. It is now read-only.

Commit

Permalink
Complete rewrite to support new Block Editor (#537)
Browse files Browse the repository at this point in the history
* update dependencies and stale codebase before digging in to gutenberg

* more refactoring

* progress on gutenberg update

* update dependencies + fix scss import issue

* use external lodash provided by wordpress

* adjust store structrue + add new sidebar store

* make citeproc types non-ambient

* use minified citeproc from jsdelivr CDN

* upgrade dependencies

* misc progress

* move _legacy/utils/resolvers to utils/resolvers

* misc small tweaks

* change sidebarStore to uiStore + other small adjustments

* update various type defs

* update data store

* add cache utility + async controls

* add processor utility + actions

* misc updates

* initial basic working citation inserter/updater

* update dependencies

* misc type definition updates

* improve select and dispatch types

* small adjustmets for wp 5.0 release

* improve classic editor detection

* update dependencies

* weekend sprint progress

* fix various tslint rule violations

* simplify stores

* weekend sprint progress on gutenberg update

* move a few things around

* finish resolvers update + finish manual data form flow

* finish edit reference dialog + begin wiring it up

* finish edit reference dialog functionality

* fix misnomer in state nomenclature

* ignore json files in tslint

* fix deprecation in tslint.json

* dependency updates

* add TextareaAutosize component

* finish up initial edit, save, and transforms for bibliography block

* bump required PHP version to 7.2

* move types into top-level types directory

* switch to global notices for more simplicity

* misc small tweaks to bibliography block + add misc helper methods

* improve bibliography block

* improve citation format reliability

* refactor sidebar components

* improve reliability of citation format

* add static publication list block

* add postcss-loader

* add i18n strings where missing throughout js files

* move get_style_json function

* misc small adjustments

* fix dialog titles

* implement changing citation style on the fly

* add bibliography metadata to bibliography block

* update dependencies

* shift around legacy styles

* misc tweaks/adjustments

* add global bibliography styles

* add subscribe to save method to automatically clear save notices

* re-implement handling of custom styles

* move from globals to using API resolvers for initial state

* improve highlighting of selected citations in the editor

* fix autocite date parsing in legacy editor. closes #459

* move legacy workers into legacy directory

* use babel-loader directly

* fix edit dialog date parsing

* misc small php adjustments

* fix sorting of citation items in tooltips.

Note: this fix affects only the new block editor. Legacy editor is still
affected.

closes #421

* two small php bugfixes

* style frontend + add tooltip.js for rendering tooltips

* prune out deprecated plugin options from options pages

* misc php cleanup

* unset pointer cursor inside tooltips

* upgrade dependencies

* move scripts to top-level directory

* fix broken update-styles script and improve fuzzy matching of citation styles

* fix tslint warnings

* change up export formats

* initial working footnotes implementation

* add footnote list to sidebar

* fix bibliography tooltip bug

* a11y improvements

* small css tweaks

* bump to beta semver number in package.json

* fix issue in prefetching saved state

* autofocus dialog inputs

* remove rollbar for now - maybe add sentry error logger later. closes #493

* clean up various global type declarations

* update dependencies + remove old stale tests

* add URL field to a few more manual types. closes #535

* swap out domReady for @wordpress/dom-ready in legacy files

* split code into several entry chunks

* remove unnecessary calls to apiFetch

* switch to protected meta for editor state

* improve checks for loading legacy code vs new code

* give the php files some much-needed TLC

* only get citations that have an id in getCitationsByIndex

* clean up legacy csl parser and move it to utils since it's still being used

* move files around + delete old components that are no longer needed

* update and clean up options-page stuff

* fix issue with fetching initial post-meta in wordpress core version of gutenberg

* fix error message parsing in csl file parser

* update dependencies

* clean out old translations

* remove php trailing commas

* dependency updates and build script adjustments

* ajax updates & shared code pattern abstractions

* json script abstractions

* do not focus footnotes or bibliography when inserting the block

* fix determining cited items by excluding invalid block types

* only disable insert citation button if selectedItems contains one or more citations

* upgrade dependencies + adjust i18n string on options page

* fix typo in zip script

* fix bug introduced by printing the nonce too early

* make csl citation properties param required

* misc refactors for better code sharing

* use page-embedded JSON for initial state, rather than unreliable resolvers

* remove all legacy tests because most of them are failing now and it isnt worth fixing

* clean up ambient definitions + move fileinput out of legacy

* upgrade dependencies

* fix ambient reference i missed in last commit

* add script for resolving external dependencies automatically using webpack stats

* misc final touches before update

* fix lint errors

* update citation styles
  • Loading branch information
dsifford authored Jan 28, 2019
2 parents 2435a76 + 63c85dd commit 4910ff6
Show file tree
Hide file tree
Showing 390 changed files with 70,964 additions and 75,223 deletions.
15 changes: 9 additions & 6 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"plugins": [
"@babel/transform-runtime"
],
"presets": [
"@babel/env",
"@babel/react"
"plugins": [
"@babel/plugin-syntax-dynamic-import",
[
"@wordpress/babel-plugin-makepot",
{
"output": "src/languages/academic-bloggers-toolkit.pot"
}
]
],
"presets": ["@wordpress/default", "@babel/preset-react" ]
}
60 changes: 0 additions & 60 deletions .codeclimate.yml

This file was deleted.

9 changes: 6 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
[*.{json,yml}]
indent_size = 2

[*.php]
[*.{php,sh}]
indent_style = tab

[*.md]
trim_trailing_whitespace = false
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

9 changes: 2 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
.git
node_modules
.coveralls.yml
dist
coverage
junk
tmp
npm-debug.log
typings/*
!typings/ABT.d.ts
NOTES.md
TODO.md
.env
lib/scripts/get-translation-status.ts
*.zip
src/languages/*.pot
1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

10 changes: 0 additions & 10 deletions .prettierrc

This file was deleted.

26 changes: 26 additions & 0 deletions .prettierrc.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
printWidth = 80
singleQuote = true
tabWidth = 4
trailingComma = 'all'

[[overrides]]
files = '*.js'
[overrides.options]
trailingComma = 'es5'

[[overrides]]
files = '**/{.,}*.{yml,yaml}'
[overrides.options]
tabWidth = 2

[[overrides]]
files = '**/{.,}*.json'
[overrides.options]
parser = 'json-stringify'
tabWidth = 2

[[overrides]]
files = '.babelrc'
[overrides.options]
parser = 'json-stringify'
tabWidth = 2
11 changes: 1 addition & 10 deletions .stylelintrc.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,2 @@
extends:
- stylelint-config-recommended-scss
rules:
selector-pseudo-class-no-unknown:
- true
- ignorePseudoClasses:
- global
property-no-unknown:
- true
- ignoreProperties:
- composes
- '@dsifford/stylelint-config'
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# TODO: Add build stages
language: node_js
node_js:
- "node"
- 'node'
branches:
only:
- master
- /^greenkeeper-.*$/
only:
- master
- /^greenkeeper-.*$/
cache:
directories:
- "node_modules"
directories:
- 'node_modules'
script: npm run test-ci
after_success:
- bash <(curl -s https://codecov.io/bash)
- bash <(curl -s https://codecov.io/bash)
16 changes: 0 additions & 16 deletions .vscode/settings.json

This file was deleted.

65 changes: 33 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
[![codecov](https://codecov.io/gh/dsifford/academic-bloggers-toolkit/branch/master/graph/badge.svg)](https://codecov.io/gh/dsifford/academic-bloggers-toolkit)
[![Maintainability](https://api.codeclimate.com/v1/badges/76a0035688f8197c0f9a/maintainability)](https://codeclimate.com/github/dsifford/academic-bloggers-toolkit/maintainability)
[![WordPress](https://img.shields.io/wordpress/plugin/dt/academic-bloggers-toolkit.svg?maxAge=2592000)](https://wordpress.org/plugins/academic-bloggers-toolkit/)
[![WordPress rating](https://img.shields.io/wordpress/plugin/r/academic-bloggers-toolkit.svg?maxAge=2592000)](https://wordpress.org/plugins/academic-bloggers-toolkit/)
[![WordPress rating](https://img.shields.io/wordpress/plugin/r/academic-bloggers-toolkit.svg?maxAge=2592000)](https://wordpress.org/plugins/academic-bloggers-toolkit/)

An **open source** WordPress plugin providing an all-in-one solution for effective academic blogging.

## Contents

[![Join the chat at https://gitter.im/academic-bloggers-toolkit/Lobby](https://badges.gitter.im/academic-bloggers-toolkit/Lobby.svg)](https://gitter.im/academic-bloggers-toolkit/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)

- [Features](#features)
- [Translations](#translations)
- [Contributing](#contributing)
- [Documentation](https://github.com/dsifford/academic-bloggers-toolkit/wiki)
- [Features](#features)
- [Translations](#translations)
- [Contributing](#contributing)
- [Documentation](https://github.com/dsifford/academic-bloggers-toolkit/wiki)

### Manifesto

Expand All @@ -28,41 +28,42 @@ An **open source** WordPress plugin providing an all-in-one solution for effecti
> Need to write one long blog post with lots of references? Download this plugin, write the post, and then delete the plugin if you don't need it any longer. **Freedom.**
## Features
- Insert formatted references on the fly using **PMID**, **PMCID**, **DOI** (CrossRef, DataCite, & mEDRA), **URL**, or **ISBN**.
- Manually insert formatted references from **over 15 types of references**.
- **Import a full bibliography from your favorite reference manager** using an exported `.ris` or `BibTeX` file.
- Automatically format references for **every citation style on planet earth** (over 1300).
- **Fully interactive** reference list which lives beside the post editor.
- **Search PubMed from the post editor** and insert references instantly.
- Inline citations display full formatted references on the frontend when hovered with the mouse (or when tapped on mobile). No more scrolling down and losing your focus!

## Translations
- Insert formatted references on the fly using **PMID**, **PMCID**, **DOI** (CrossRef, DataCite, & mEDRA), **URL**, or **ISBN**.
- Manually insert formatted references from **over 15 types of references**.
- **Import a full bibliography from your favorite reference manager** using an exported `.ris` or `BibTeX` file.
- Automatically format references for **every citation style on planet earth** (over 1300).
- **Fully interactive** reference list which lives beside the post editor.
- **Search PubMed from the post editor** and insert references instantly.
- Inline citations display full formatted references on the frontend when hovered with the mouse (or when tapped on mobile). No more scrolling down and losing your focus!

<p align="center"><a href="https://poeditor.com/join/project/PGYLKWQM5h"><strong>Click Here to Translate this Plugin</strong></a></p>
## Translations

Translations for this plugin can be completed and submitted [here](https://poeditor.com/join/project/PGYLKWQM5h). After submission of a translation, I'll try to update the plugin with your translations within 7 days.
<p align="center"><a href="https://translate.wordpress.org/projects/wp-plugins/academic-bloggers-toolkit"><strong>Click Here to Translate this Plugin</strong></a></p>

### Translation Status

<!-- TRANSLATION_STATUS_START -->
Language | Contributors | % Complete
-------- | ------------ | ----------
French `fr` | Houssen Moshinaly | ![Progress](http://progressed.io/bar/92)
Spanish `es` | Jose Miguel Villatoro | ![Progress](http://progressed.io/bar/87)
Spanish (AR) `es-ar` | Jose Miguel Villatoro, Lucas | ![Progress](http://progressed.io/bar/87)
Chinese (simplified) `zh-CN` | fishfree | ![Progress](http://progressed.io/bar/85)
Polish `pl` | Krzysztof Ruchniewicz | ![Progress](http://progressed.io/bar/82)
German `de` | Jan-Luca Bauß, Mathias Micheel | ![Progress](http://progressed.io/bar/81)
Portuguese `pt` | Alexandre Rodrigues | ![Progress](http://progressed.io/bar/50)
Indonesian `id` | Alam | ![Progress](http://progressed.io/bar/32)
Arabic `ar` | Ezz El Dean | ![Progress](http://progressed.io/bar/17)
Danish `da` | Dan Bilbo Christensen | ![Progress](http://progressed.io/bar/0)
Romanian `ro` | Maria Estela Mihoc | ![Progress](http://progressed.io/bar/0)
Tamil `ta` | Albert Albs | ![Progress](http://progressed.io/bar/0)
Thai `th` | Jose Miguel Villatoro, Tammakit Intharaksa, wiennat | ![Progress](http://progressed.io/bar/0)
Urdu `ur` | Munir Abbasi | ![Progress](http://progressed.io/bar/0)

| Language | Contributors | % Complete |
| ---------------------------- | --------------------------------------------------- | ---------------------------------------- |
| French `fr` | Houssen Moshinaly | ![Progress](http://progressed.io/bar/92) |
| Spanish `es` | Jose Miguel Villatoro | ![Progress](http://progressed.io/bar/87) |
| Spanish (AR) `es-ar` | Jose Miguel Villatoro, Lucas | ![Progress](http://progressed.io/bar/87) |
| Chinese (simplified) `zh-CN` | fishfree | ![Progress](http://progressed.io/bar/85) |
| Polish `pl` | Krzysztof Ruchniewicz | ![Progress](http://progressed.io/bar/82) |
| German `de` | Jan-Luca Bauß, Mathias Micheel | ![Progress](http://progressed.io/bar/81) |
| Portuguese `pt` | Alexandre Rodrigues | ![Progress](http://progressed.io/bar/50) |
| Indonesian `id` | Alam | ![Progress](http://progressed.io/bar/32) |
| Arabic `ar` | Ezz El Dean | ![Progress](http://progressed.io/bar/17) |
| Danish `da` | Dan Bilbo Christensen | ![Progress](http://progressed.io/bar/0) |
| Romanian `ro` | Maria Estela Mihoc | ![Progress](http://progressed.io/bar/0) |
| Tamil `ta` | Albert Albs | ![Progress](http://progressed.io/bar/0) |
| Thai `th` | Jose Miguel Villatoro, Tammakit Intharaksa, wiennat | ![Progress](http://progressed.io/bar/0) |
| Urdu `ur` | Munir Abbasi | ![Progress](http://progressed.io/bar/0) |

<!-- TRANSLATION_STATUS_END -->

## Contributing

If you'd like to contribute to this project, please read the [contributor guide](https://github.com/dsifford/academic-bloggers-toolkit/blob/master/CONTRIBUTING.md).
If you'd like to contribute to this project, please read the [contributor guide](./.github/CONTRIBUTING.md).
62 changes: 38 additions & 24 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,39 @@
version: '3'
version: '3.7'
services:
wordpress:
image: visiblevc/wordpress:0.17.0-php7.2
ports:
- 8080:80
volumes:
- ./dist:/app/wp-content/plugins/academic-bloggers-toolkit
environment:
DB_NAME: wordpress
DB_PASS: root
WP_DEBUG: 'true'
WP_VERSION: nightly
PLUGINS: >-
co-authors-plus,
query-monitor,
gutenberg,
# relative-url,
# piglatin,
db:
image: mariadb:10
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: root
wordpress:
image: visiblevc/wordpress:0.22.0-php7.3
cap_add:
- SYS_ADMIN
devices:
- /dev/fuse
environment:
DB_PASS: root
WP_DEBUG: 'true'
WP_DEBUG_DISPLAY: 'true'
PLUGINS: >-
classic-editor
gutenberg
query-monitor
EXTRA_PHP: |
define('SCRIPT_DEBUG', true);
ports:
- 8080:80
volumes:
- ./dist:/app/wp-content/plugins/academic-bloggers-toolkit
- ./scripts/init-wp.sh:/docker-entrypoint-initwp.d/init-wp.sh
db:
image: mariadb:10
environment:
MYSQL_ROOT_PASSWORD: root
volumes:
- data:/var/lib/mysql
phpmyadmin:
image: phpmyadmin/phpmyadmin
volumes:
- data:/var/lib/mysql
ports:
- 22222:80

volumes:
data:
Loading

0 comments on commit 4910ff6

Please sign in to comment.