Commit graph

45 commits

Author SHA1 Message Date
Dan Stillman
1c7973c157 Update Babel and ESLint 2021-12-23 04:58:11 -05:00
Dan Stillman
6e0bc58052 Upgrade to React 17
And update other React dependencies
2021-12-23 01:18:22 -05:00
Adomas Ven
44b6cd0525
citeproc-rs support (#2220)
Disabled under zotero.cite.useCiteprocRs by default
2021-12-15 17:28:41 -05:00
Dan Stillman
21df5d12b7 Add @babel/plugin-proposal-unicode-property-regex
Can now use Unicode property escapes in regular expressions

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Unicode_Property_Escapes
2021-08-22 04:07:33 -04:00
Dan Stillman
4021492797 Babel: Add support for optional chaining
https://babeljs.io/docs/en/babel-plugin-proposal-optional-chaining
2021-08-17 00:41:59 -04:00
Dan Stillman
dfb32fd098 Update to 1.0.6 of the ESLint config 2020-12-24 02:57:57 -05:00
Fletcher Hazlehurst
36d81e839c Use ace-builds NPM package 2020-12-18 10:45:38 -07:00
Tom Najdek
67f4b5254c
Switch to pure js sass compiler 2020-10-30 13:15:30 +01:00
Dan Stillman
e9473caa14 Update node-sass to 4.14.1 2020-08-11 03:55:54 -04:00
Dan Stillman
bfceb10e03 Update 'colors' package
On the off chance a problem in the older version caused #1763
2019-12-23 05:01:17 -05:00
Dan Stillman
bfe3f7ebf9 Update node-sass for Node 13 2019-11-21 22:38:41 -07:00
Dan Stillman
5791ffeb16 Reactify item tags box
Improvements:

- Fixes autocomplete text remaining in field after selection in Fx60
- No more text or icon shifting on select (tested on macOS)

Changes:

- Tags are now selected on mousedown with no active state, as in web
  library

Regressions:

- Tooltip with tag type doesn't appear when hovering over icon
- Pressing Tab after modifying a tag loses focus
- Right-click in textbox shows custom menu instead of default text
  editing context menu (Cut/Copy/Paste)

To-do:

- Switch to this version for note tags box
- Style colored tags in autocomplete drop-down? Sort to top?
- Only show delete button on row hover, as in web library?
2019-11-08 06:41:06 -05:00
Dan Stillman
513f7d6555 Fx60: Fix localization
Also fixes #1690 (at least on Catalina), and possibly other things

general.useragent.locale and intl.locale.matchOS are no longer used.
2019-10-23 19:08:13 -04:00
Dan Stillman
d4f682aa88 Merge branch 'fx60' 2019-10-21 21:44:01 -04:00
Dan Stillman
dc60e5f840 HTTP.request() improvements
- Move 5xx retries and connection checking out of the sync API client
  and into HTTP.request() so that they apply to all requests. 429 handling
  remains in the API client, since not all callers necessarily want to
  handle that the same way. Callers can still handle 5xx themselves by
  including the relevant 5xx status codes in `successCodes` or by passing
  `errorDelayMax: 0`.
- Add `cancellerReceiver` option, which is a callback that receives a
  function that will cancel the request, whether it's an active request
  or an automatic delay before a 5xx retry.

This also updates Sinon to 7.3.2.
2019-09-16 01:26:34 -04:00
Dan Stillman
8c59df435f Fx60: Fix snapshot filenames
nsIURL doesn't seem to work anymore, so add Zotero.Utilities.parseURL(),
which uses the `url` package from NPM and adds fileName, fileExtension,
and fileBaseName.
2019-08-27 00:47:39 -04:00
Dan Stillman
8670718ffa Update node-sass for Node 12 2019-08-22 00:29:29 -04:00
Dan Stillman
2b57bd8206 Update ReactDOM to support hooks 2019-07-17 03:06:15 -04:00
Dan Stillman
5b9b39dfb7 Update eslint config to 1.0.3 2019-06-12 00:31:47 -04:00
Dan Stillman
2dce15c35c Update eslint config version 2019-06-11 04:44:57 -04:00
Dan Stillman
89992665cd Inherit ESLint config 2019-03-31 21:12:43 -04:00
Dan Stillman
d9cee322cd Tag selector performance overhaul
- Use react-virtualized to render tags on demand, reducing the number
  of DOM elements from potentially tens of thousands to <100. This
  requires tags to be absolutely positioned, so sizing and
  positioning need to be precomputed rather than relying on CSS.
- Avoid unnecessary refreshes, speed up tag retrieval, and optimize
  sorting
- Debounce reflowing when resizing tag selector

Also:

- Scroll to top when changing collections
- Allow tags to take up full width of tag selector without truncation

Closes #1649
Closes #281
2019-03-28 06:28:34 -04:00
Dan Stillman
c52589f96b Upgrade to Babel 7 2019-03-28 04:57:31 -04:00
Dan Stillman
f596a203f7 Update React to 16.8.4 and chokidar to 2.1.2 2019-03-21 05:08:04 -04:00
Dan Stillman
c26c85a262 Add babel-eslint for class field syntax in JSX 2019-03-18 18:22:28 -04:00
Dan Stillman
0cdbae8353 Update eslint-plugin-react 2019-02-26 05:55:51 -05:00
Dan Stillman
9b55884693 Add eslint to package.json 2019-02-26 01:57:22 -05:00
Adomas Venčkauskas
a24cada451 React Tag Selector polish, i18n and tests
- Added icon-button UI code for the menubutton
- Upgrade to React 16 to allow non-standard attrs, such as `tooltiptext`
to support XUL tooltips
- Add i18n support for React UI elements
- Update tests for reactified tag selector
2019-01-21 11:01:27 +02:00
Tom Najdek
897e74c7f1 Reactify the Tag Selector 2019-01-07 15:33:45 +02:00
Dan Stillman
ce5be0bc75 Automatically download open-access PDFs when saving via the connector
If there's no translated PDF or the translated PDF fails and the item
has a DOI, check Zotero's Unpaywall mirror for possible sources and try
to download one of those.

Unlike with "Add Item by Identifier" and "Find Available PDF" in the
item context menu, this does not try the DOI/URL page, since it would
result in more data leakage and most of the time you'd be saving from
the DOI page already. We could consider offering it as an option, but
for it to be useful, you'd have to have an institutional subscription,
be on-campus or connected via VPN (for now), and be saving from
somewhere other than the main page.

A new connector endpoint, sessionProgress, takes the place of
attachmentProgress. Unlike attachmentProgress, sessionProgress can show
new attachments that have been added to the save, and with a little more
work should also be able to show when a parent item has been recognized
for a directly saved PDF.

This also adds support for custom PDF resolvers, available to all PDF
retrieval methods. I'll document those separately.

Closes #1542
2018-08-16 00:57:22 -04:00
Dan Stillman
da5db4cb38 Update node-sass to fix build breakage 2018-06-11 09:01:32 -04:00
Dan Stillman
b4244f8a25 Update to Sinon 4.5.0 2018-04-07 17:01:46 -04:00
Dan Stillman
c17695939c Update Node packages 2017-12-10 03:45:07 -05:00
Dan Stillman
241df13954 Update chai-as-promised after chai update
(Though we should mostly just use async/await)
2017-10-27 01:35:12 -04:00
Dan Stillman
7f8699b937 Update chai to 4.1.2 2017-10-27 01:08:38 -04:00
Dan Stillman
e14b8f94bd Remove babel-plugin-transform-async-to-module-method
Everything we support supports async/await now, so stop converting to
Bluebird coroutine().
2017-10-05 17:18:43 -04:00
Tom Najdek
b53fabbb58 Better build process (#1248)
* Remove gulp, replace with custom scripts
* Symlink entire dirs where possible (fixes #1232)
* Significantly speed up subsequent builds (fixes #1238)
* Watch process now observes new/removed files, not only changed
* Add ignoreMask, exclude all files with names starting with a #
* Better logging during builds
* Update travis.yml to use new, non-gulp-based build
2017-06-20 19:18:46 -04:00
Dan Stillman
7dd9cee0d4 Update package.json and package-lock.json 2017-06-13 18:04:10 -04:00
Tom Najdek
c335099465 Add support for glob in babel-worker ignored paths
* Also fixes an issue with handling paths on Windows
2017-06-06 00:35:59 -04:00
Tom Najdek
f98ccdee46 Ensure build process exits with non-zero result on failure
* During build, error is printed out with stack and process exits
* During development, initial build behaves as above, however when
  watching files, errors are displayed but watch process does not
  exit allowing fixes without a complete rebuild.
2017-06-05 11:41:10 +01:00
Dan Stillman
201af23484 Remove sinon-as-promised from package.json 2017-06-01 15:44:25 -04:00
Tom Najdek
289b049377 Support generators in tests via coMocha, instead of custom code
* coMocha offers better error stack trace
2017-06-01 11:36:17 -04:00
Tom Najdek
14bf3184bb Fixes and tweaks to make tests work with babelized code
* Use mocha, chai & sinon from the npm. As of sinon 2.0
  sinon-as-promised is no longer required so it is removed
* Tweak code to re-use the same loader with the same environment
  throghout the code
* Introduce browserify step for testing tools that only provide
  node-compatible libraries (sinon, chai-as-promised)
* Introduce copy step for test data to resolve multiple issues with
  tests depending on files not being symlinks
* Re-introduce custom implementation of setTimeout to resolve issues
  with few tests
* Re-introduce custom Bluebird Promises config & monkey patch
2017-06-01 11:36:16 -04:00
Dan Stillman
748c30206f Run tests from build dir 2017-06-01 11:36:16 -04:00
Tom Najdek
9aa057edee Introduce a build system
* Add a multi-process, gulp-based build system to support es6 features,
  async/await, jsx and scss
* Add a package.json to support dependency management and allow starting
  the build process via npm
* Replace embedded Bluebird library with npm-installed one
* Add react, react-dom and web-library
* Introduce a custom require() loader in include.js as well as a minimal
  local require() implementation in various other places
2017-05-23 17:02:50 +01:00