0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-24 07:43:01 +00:00

Compare commits

..

554 Commits

Author SHA1 Message Date
Trevor Buckner
790420b320 Merge pull request #2004 from naturalcrit/v3.0.7
Update to Version 3.0.7
2022-02-02 23:07:27 -05:00
Trevor Buckner
2f011ebb24 Merge pull request #2002 from naturalcrit/dependabot/npm_and_yarn/babel/core-7.17.0
Bump @babel/core from 7.16.12 to 7.17.0
2022-02-02 23:07:08 -05:00
Trevor Buckner
191adf0a7c Update to Version 3.0.7 2022-02-02 23:05:32 -05:00
dependabot[bot]
2ab95d908b Bump @babel/core from 7.16.12 to 7.17.0
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.16.12 to 7.17.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.17.0/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-03 03:06:17 +00:00
Trevor Buckner
62f505f982 Merge pull request #2003 from naturalcrit/dependabot/npm_and_yarn/babel/plugin-transform-runtime-7.17.0
Bump @babel/plugin-transform-runtime from 7.16.10 to 7.17.0
2022-02-02 22:05:37 -05:00
Trevor Buckner
eaafce0517 Merge pull request #2001 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.2.0
Bump mongoose from 6.1.10 to 6.2.0
2022-02-02 22:05:22 -05:00
dependabot[bot]
10f529c6b6 Bump @babel/plugin-transform-runtime from 7.16.10 to 7.17.0
Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.16.10 to 7.17.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.17.0/packages/babel-plugin-transform-runtime)

---
updated-dependencies:
- dependency-name: "@babel/plugin-transform-runtime"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-03 03:01:47 +00:00
dependabot[bot]
8424e51592 Bump mongoose from 6.1.10 to 6.2.0
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.1.10 to 6.2.0.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Automattic/mongoose/compare/6.1.10...6.2.0)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-03 03:01:09 +00:00
Trevor Buckner
45e391b273 Merge pull request #2000 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.1.10
Bump mongoose from 6.1.9 to 6.1.10
2022-02-02 09:21:59 -05:00
dependabot[bot]
0c41fdee6f Bump mongoose from 6.1.9 to 6.1.10
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.1.9 to 6.1.10.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Automattic/mongoose/compare/6.1.9...6.1.10)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-02 03:01:14 +00:00
Trevor Buckner
11bbf1b8fa Merge pull request #1999 from naturalcrit/dependabot/npm_and_yarn/googleapis-94.0.0
Bump googleapis from 92.0.0 to 94.0.0
2022-02-01 00:08:10 -05:00
Trevor Buckner
f89f686097 Merge pull request #1998 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.1.9
Bump mongoose from 6.1.8 to 6.1.9
2022-02-01 00:07:58 -05:00
Trevor Buckner
d93e4c7458 Merge pull request #1897 from jeddai/migration-guide
Legacy -> v3 Migration guide
2022-02-01 00:05:01 -05:00
Trevor Buckner
6bf4fc6cf8 Help dropdown uses existing dropdown class. Small tweaks. 2022-02-01 00:02:46 -05:00
dependabot[bot]
35a8f7dd98 Bump googleapis from 92.0.0 to 94.0.0
Bumps [googleapis](https://github.com/googleapis/google-api-nodejs-client) from 92.0.0 to 94.0.0.
- [Release notes](https://github.com/googleapis/google-api-nodejs-client/releases)
- [Changelog](https://github.com/googleapis/google-api-nodejs-client/blob/main/CHANGELOG.md)
- [Commits](https://github.com/googleapis/google-api-nodejs-client/compare/googleapis-v92.0.0...googleapis-v94.0.0)

---
updated-dependencies:
- dependency-name: googleapis
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-01 03:01:35 +00:00
dependabot[bot]
d0ec8ba22f Bump mongoose from 6.1.8 to 6.1.9
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.1.8 to 6.1.9.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Automattic/mongoose/compare/6.1.8...6.1.9)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-01 03:01:08 +00:00
Charlie Humphreys
57d3db5322 Merge branch 'master' into migration-guide
# Conflicts:
#	server/app.js
2022-01-31 17:13:36 -06:00
Trevor Buckner
e43ee7ddba Merge pull request #1997 from naturalcrit/dependabot/npm_and_yarn/eslint-8.8.0
Bump eslint from 8.7.0 to 8.8.0
2022-01-31 11:20:14 -05:00
dependabot[bot]
7a7bffab24 Bump eslint from 8.7.0 to 8.8.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.7.0 to 8.8.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.7.0...v8.8.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-31 03:00:57 +00:00
Trevor Buckner
1001e57249 Merge pull request #1981 from AlexeySachkov/private/asachkov/refactor-config-initialization
[NFC] Outline config creation into a separate module
2022-01-30 16:30:21 -05:00
Trevor Buckner
ccbeca2cad Move process.chdir up so it occurs before config.js is ever called.
app.js should be required before config to make sure process.cwd is updated first
2022-01-30 00:13:35 -05:00
Trevor Buckner
d7aa4afa60 process.chdir in app.js.
Everything works, no need for path.resolve. All tests pass.
2022-01-29 23:53:30 -05:00
Trevor Buckner
e4c2ce6a8c Merge branch 'private/asachkov/refactor-config-initialization' of https://github.com/AlexeySachkov/homebrewery into pr/1981 2022-01-29 21:36:10 -05:00
Trevor Buckner
de115c5113 Merge branch 'master' into pr/1981 2022-01-29 21:34:38 -05:00
Alexey Sachkov
4e0ab4b393 Adjust paths to config files 2022-01-28 21:40:40 +03:00
Trevor Buckner
050bc472d0 Merge pull request #1990 from naturalcrit/dependabot/npm_and_yarn/cached-path-relative-1.1.0
Bump cached-path-relative from 1.0.2 to 1.1.0
2022-01-28 11:52:19 -05:00
Trevor Buckner
48da1da5ee Merge pull request #1946 from naturalcrit/dependabot/npm_and_yarn/prop-types-15.8.1
Bump prop-types from 15.8.0 to 15.8.1
2022-01-28 11:51:52 -05:00
Trevor Buckner
1b5f408bef Merge pull request #1989 from naturalcrit/dependabot/npm_and_yarn/node-fetch-2.6.7
Bump node-fetch from 2.6.1 to 2.6.7
2022-01-28 11:51:37 -05:00
dependabot[bot]
b1869a33f9 Bump prop-types from 15.8.0 to 15.8.1
Bumps [prop-types](https://github.com/facebook/prop-types) from 15.8.0 to 15.8.1.
- [Release notes](https://github.com/facebook/prop-types/releases)
- [Changelog](https://github.com/facebook/prop-types/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/prop-types/compare/v15.8.0...v15.8.1)

---
updated-dependencies:
- dependency-name: prop-types
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-28 16:50:48 +00:00
Trevor Buckner
bb07cdaa9f Merge pull request #1992 from naturalcrit/RemovePropTypes
Remove prop-types dependency
2022-01-28 11:49:16 -05:00
Trevor Buckner
db0e4fcc0c Remove prop-types dependency 2022-01-28 11:47:24 -05:00
Trevor Buckner
ba8a2af87d Merge pull request #1929 from jeddai/links-in-home-document
Add discord, github, and reddit links to home page document
2022-01-28 10:29:26 -05:00
Trevor Buckner
85e7071d6c Merge pull request #1991 from naturalcrit/dependabot/npm_and_yarn/marked-4.0.12
Bump marked from 4.0.11 to 4.0.12
2022-01-28 10:27:28 -05:00
Trevor Buckner
ece6df023a Restore custom CSS styling on v3 preview 2022-01-28 09:59:29 -05:00
Trevor Buckner
4c08f4a6e1 Condense v3_preview to fit on two pages again. 2022-01-28 09:44:43 -05:00
Trevor Buckner
039e4dd4e5 Revert extraneous Config changes
Looks like these were part of something else? In any case it conflicts with #1981 so just undoing these changes.
2022-01-28 00:38:00 -05:00
dependabot[bot]
041abf1220 Bump marked from 4.0.11 to 4.0.12
Bumps [marked](https://github.com/markedjs/marked) from 4.0.11 to 4.0.12.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Changelog](https://github.com/markedjs/marked/blob/master/.releaserc.json)
- [Commits](https://github.com/markedjs/marked/compare/v4.0.11...v4.0.12)

---
updated-dependencies:
- dependency-name: marked
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-28 03:00:41 +00:00
dependabot[bot]
56fc23f23a Bump cached-path-relative from 1.0.2 to 1.1.0
Bumps [cached-path-relative](https://github.com/ashaffer/cached-path-relative) from 1.0.2 to 1.1.0.
- [Release notes](https://github.com/ashaffer/cached-path-relative/releases)
- [Commits](https://github.com/ashaffer/cached-path-relative/commits)

---
updated-dependencies:
- dependency-name: cached-path-relative
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-27 14:36:29 +00:00
Trevor Buckner
87c28c76f3 Merge pull request #1979 from AlexeySachkov/private/asachkov/testing-with-supertest
Add very basic infrastructure for HTTP testing
2022-01-26 23:42:36 -05:00
dependabot[bot]
235f878dba Bump node-fetch from 2.6.1 to 2.6.7
Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.1 to 2.6.7.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Commits](https://github.com/node-fetch/node-fetch/compare/v2.6.1...v2.6.7)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-27 03:59:52 +00:00
Trevor Buckner
b2ec0d4a0c Merge pull request #1986 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.1.8
Bump mongoose from 6.1.7 to 6.1.8
2022-01-26 22:59:29 -05:00
Trevor Buckner
02560d82ab Merge pull request #1988 from naturalcrit/dependabot/npm_and_yarn/marked-4.0.11
Bump marked from 4.0.10 to 4.0.11
2022-01-26 22:59:18 -05:00
Charlie Humphreys
22b80ffbb2 update app templates for welcome messages, add new images 2022-01-26 21:56:12 -06:00
dependabot[bot]
2db127d805 Bump marked from 4.0.10 to 4.0.11
Bumps [marked](https://github.com/markedjs/marked) from 4.0.10 to 4.0.11.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Changelog](https://github.com/markedjs/marked/blob/master/.releaserc.json)
- [Commits](https://github.com/markedjs/marked/compare/v4.0.10...v4.0.11)

---
updated-dependencies:
- dependency-name: marked
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-27 03:01:08 +00:00
Charlie Humphreys
c2ca9f8f10 Merge branch 'master' into links-in-home-document
# Conflicts:
#	server.js
2022-01-26 13:59:47 -06:00
Charlie Humphreys
e614fbc5a1 Update app.js from master 2022-01-26 08:46:45 -06:00
Charlie Humphreys
7f001ee391 Merge branch 'master' into migration-guide
# Conflicts:
#	server.js
2022-01-26 08:44:28 -06:00
Charlie Humphreys
9432304be5 Merge branch 'master' into migration-guide
# Conflicts:
#	package-lock.json
2022-01-26 08:43:17 -06:00
Charlie Humphreys
38c0527d35 Add color mixins, help dropdown, and remove unused nav items 2022-01-26 08:40:33 -06:00
dependabot[bot]
6fc176e616 Bump mongoose from 6.1.7 to 6.1.8
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.1.7 to 6.1.8.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Automattic/mongoose/compare/6.1.7...6.1.8)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-25 03:01:18 +00:00
Alexey Sachkov
588bcebc87 [NFC] Outline config creation into a separate module
This is done in order to have config creation rules
unified in one place to avoid modifying them multiple times
if they change.

We already had 3 duplicated pieces of code initializing the
config and there will be more config uses in future tests.

This resolves #1960
2022-01-23 20:06:52 +03:00
Alexey Sachkov
4fd085b684 Update package-lock.json 2022-01-23 20:00:16 +03:00
Alexey Sachkov
d2250cdabb Merge remote-tracking branch 'origin/master' into private/asachkov/testing-with-supertest 2022-01-23 19:58:56 +03:00
Trevor Buckner
179d5e6312 Merge pull request #1980 from naturalcrit/dependabot/npm_and_yarn/babel/core-7.16.12
Bump @babel/core from 7.16.7 to 7.16.12
2022-01-22 22:04:36 -05:00
dependabot[bot]
12d0f69e9c Bump @babel/core from 7.16.7 to 7.16.12
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.16.7 to 7.16.12.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.16.12/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-22 18:23:01 +00:00
Trevor Buckner
788ff65283 Merge pull request #1973 from naturalcrit/dependabot/npm_and_yarn/babel/plugin-transform-runtime-7.16.10
Bump @babel/plugin-transform-runtime from 7.16.8 to 7.16.10
2022-01-22 13:22:02 -05:00
dependabot[bot]
d7d93c8975 Bump @babel/plugin-transform-runtime from 7.16.8 to 7.16.10
Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.16.8 to 7.16.10.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.16.10/packages/babel-plugin-transform-runtime)

---
updated-dependencies:
- dependency-name: "@babel/plugin-transform-runtime"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-22 16:36:20 +00:00
Trevor Buckner
eb07fd7c38 Merge pull request #1966 from naturalcrit/dependabot/npm_and_yarn/nanoid-3.2.0
Bump nanoid from 3.1.30 to 3.2.0
2022-01-22 11:35:49 -05:00
Trevor Buckner
c09b87482a Merge pull request #1977 from naturalcrit/dependabot/npm_and_yarn/babel/preset-env-7.16.11
Bump @babel/preset-env from 7.16.8 to 7.16.11
2022-01-22 11:35:17 -05:00
Trevor Buckner
19562a2445 Merge pull request #1978 from naturalcrit/dependabot/npm_and_yarn/codemirror-5.65.1
Bump codemirror from 5.65.0 to 5.65.1
2022-01-22 11:34:51 -05:00
Alexey Sachkov
543d65f43f Add very first HTTP tests
Added tests for "static" pages like Home, Changelog, FAQ, etc.
2022-01-22 00:36:54 +03:00
Alexey Sachkov
fc1af353f3 Install and configure required packages for HTTP testing
Two new dev dependencies were added:
- supertest package to perform HTTP testing
- @babel/plugin-transform-runtime

Configured jest to so it is able load files from server directory
2022-01-22 00:36:10 +03:00
Alexey Sachkov
9c57450330 [NFC] Explicitly define variables before using them
Fixed two errors which were discovered by trying to run the code in "strict" mode,
which is automatically done by Jest testing framework.
2022-01-22 00:18:13 +03:00
Trevor Buckner
0573084ffd Merge pull request #1959 from AlexeySachkov/private/asachkov/refactor-server-js
[NFC] Outline an express app into a separate module
2022-01-21 00:22:58 -05:00
dependabot[bot]
6cb39709c4 Bump codemirror from 5.65.0 to 5.65.1
Bumps [codemirror](https://github.com/codemirror/CodeMirror) from 5.65.0 to 5.65.1.
- [Release notes](https://github.com/codemirror/CodeMirror/releases)
- [Changelog](https://github.com/codemirror/CodeMirror/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codemirror/CodeMirror/compare/5.65.0...5.65.1)

---
updated-dependencies:
- dependency-name: codemirror
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-21 03:01:49 +00:00
dependabot[bot]
4ea2fc34f0 Bump @babel/preset-env from 7.16.8 to 7.16.11
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.16.8 to 7.16.11.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.16.11/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-21 03:01:12 +00:00
dependabot[bot]
a0e2bcb8e4 Bump nanoid from 3.1.30 to 3.2.0
Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.30 to 3.2.0.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.1.30...3.2.0)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-18 22:01:45 +00:00
Trevor Buckner
015644453b Merge pull request #1967 from naturalcrit/dependabot/npm_and_yarn/eslint-8.7.0
Bump eslint from 8.6.0 to 8.7.0
2022-01-18 17:00:45 -05:00
Trevor Buckner
199c7d4e02 Merge pull request #1969 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.1.7
Bump mongoose from 6.1.6 to 6.1.7
2022-01-18 17:00:38 -05:00
Trevor Buckner
1d71e96421 Merge pull request #1964 from naturalcrit/dependabot/npm_and_yarn/marked-4.0.10
Bump marked from 4.0.9 to 4.0.10
2022-01-18 17:00:32 -05:00
dependabot[bot]
8d0dbac882 Bump mongoose from 6.1.6 to 6.1.7
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.1.6 to 6.1.7.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Automattic/mongoose/compare/6.1.6...6.1.7)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-18 03:01:19 +00:00
dependabot[bot]
6c1b4b1839 Bump eslint from 8.6.0 to 8.7.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.6.0 to 8.7.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.6.0...v8.7.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-17 03:01:30 +00:00
dependabot[bot]
d4a4e7d139 Bump marked from 4.0.9 to 4.0.10
Bumps [marked](https://github.com/markedjs/marked) from 4.0.9 to 4.0.10.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Changelog](https://github.com/markedjs/marked/blob/master/.releaserc.json)
- [Commits](https://github.com/markedjs/marked/compare/v4.0.9...v4.0.10)

---
updated-dependencies:
- dependency-name: marked
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-13 03:01:44 +00:00
Alexey Sachkov
0dfe18cd18 Fix liner errors 2022-01-11 23:24:50 +03:00
Alexey Sachkov
8895b44be9 [NFC] Outline an express app into a separate module
This is done in order to be able to re-use that app in API unit tests later
2022-01-11 22:24:23 +03:00
Trevor Buckner
279352377b Merge pull request #1957 from naturalcrit/dependabot/npm_and_yarn/babel/preset-env-7.16.8
Bump @babel/preset-env from 7.16.7 to 7.16.8
2022-01-11 11:32:59 -05:00
dependabot[bot]
51cf363c84 Bump @babel/preset-env from 7.16.7 to 7.16.8
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.16.7 to 7.16.8.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.16.8/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-11 16:25:18 +00:00
Trevor Buckner
bdd554851d Merge pull request #1956 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.1.6
Bump mongoose from 6.1.5 to 6.1.6
2022-01-11 11:24:06 -05:00
Trevor Buckner
f611a36089 Merge pull request #1955 from naturalcrit/dependabot/npm_and_yarn/babel/plugin-transform-runtime-7.16.8
Bump @babel/plugin-transform-runtime from 7.16.7 to 7.16.8
2022-01-11 11:23:59 -05:00
dependabot[bot]
0861e1ed29 Bump mongoose from 6.1.5 to 6.1.6
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.1.5 to 6.1.6.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Automattic/mongoose/compare/6.1.5...6.1.6)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-11 03:01:23 +00:00
dependabot[bot]
4070c53112 Bump @babel/plugin-transform-runtime from 7.16.7 to 7.16.8
Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.16.7 to 7.16.8.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.16.8/packages/babel-plugin-transform-runtime)

---
updated-dependencies:
- dependency-name: "@babel/plugin-transform-runtime"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-11 03:01:11 +00:00
Trevor Buckner
ac8ad98939 Merge pull request #1937 from AlexeySachkov/private/asachkov/v3-markdown-tests
Add tests for our markdown parser/renderer
2022-01-10 13:58:04 -05:00
Trevor Buckner
e315c29620 Merge pull request #1931 from AlexeySachkov/private/asachkov/outline-db-connection
[NFC] Outline database connection into a separate file
2022-01-10 13:55:55 -05:00
Alexey Sachkov
e84cd4fe8b Apply review comments
Switched from raw promises to async/await.
Outlined error handling function to reduce amount of nested code.
Added comment about the new file intent.
2022-01-10 19:25:36 +03:00
Alexey Sachkov
2d85638d7d Update package-lock.json after merge 2022-01-10 18:56:23 +03:00
Alexey Sachkov
1daa700a1a Merge remote-tracking branch 'origin/master' into private/asachkov/v3-markdown-tests 2022-01-10 18:54:53 +03:00
Trevor Buckner
c06176b3bf Merge pull request #1950 from naturalcrit/dependabot/npm_and_yarn/marked-4.0.9
Bump marked from 4.0.8 to 4.0.9
2022-01-06 23:18:59 -05:00
Trevor Buckner
85f93c7861 Merge pull request #1949 from naturalcrit/dependabot/npm_and_yarn/query-string-7.1.0
Bump query-string from 7.0.1 to 7.1.0
2022-01-06 23:18:35 -05:00
dependabot[bot]
e1457b5308 Bump marked from 4.0.8 to 4.0.9
Bumps [marked](https://github.com/markedjs/marked) from 4.0.8 to 4.0.9.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Changelog](https://github.com/markedjs/marked/blob/master/.releaserc.json)
- [Commits](https://github.com/markedjs/marked/compare/v4.0.8...v4.0.9)

---
updated-dependencies:
- dependency-name: marked
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-07 03:01:25 +00:00
dependabot[bot]
fc6fd00fe9 Bump query-string from 7.0.1 to 7.1.0
Bumps [query-string](https://github.com/sindresorhus/query-string) from 7.0.1 to 7.1.0.
- [Release notes](https://github.com/sindresorhus/query-string/releases)
- [Commits](https://github.com/sindresorhus/query-string/compare/v7.0.1...v7.1.0)

---
updated-dependencies:
- dependency-name: query-string
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-07 03:00:55 +00:00
Trevor Buckner
3ccc36f87a Merge pull request #1945 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.1.5
Bump mongoose from 6.1.4 to 6.1.5
2022-01-05 13:14:03 -05:00
Trevor Buckner
ceae540aa0 Merge pull request #1944 from G-Ambatte/increaseGooglePageSize-#1943
Increase Google pageSize to 1000
2022-01-05 13:13:53 -05:00
dependabot[bot]
a5cab7005e Bump mongoose from 6.1.4 to 6.1.5
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.1.4 to 6.1.5.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Automattic/mongoose/compare/6.1.4...6.1.5)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-05 03:00:44 +00:00
G.Ambatte
e48e8cd05b Increase pageSize to 1000 2022-01-05 13:17:56 +13:00
Trevor Buckner
e74800916e Merge pull request #1941 from naturalcrit/dependabot/npm_and_yarn/babel/preset-env-7.16.7
Bump @babel/preset-env from 7.16.5 to 7.16.7
2022-01-04 15:29:30 -05:00
Trevor Buckner
34f154d09d Merge pull request #1940 from naturalcrit/dependabot/npm_and_yarn/babel/core-7.16.7
Bump @babel/core from 7.16.5 to 7.16.7
2022-01-04 15:29:22 -05:00
dependabot[bot]
1bcdd6bc38 Bump @babel/core from 7.16.5 to 7.16.7
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.16.5 to 7.16.7.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.16.7/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-04 20:25:26 +00:00
dependabot[bot]
dd82ee68f0 Bump @babel/preset-env from 7.16.5 to 7.16.7
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.16.5 to 7.16.7.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.16.7/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-04 20:24:50 +00:00
Trevor Buckner
564486f6d0 Merge pull request #1942 from naturalcrit/dependabot/npm_and_yarn/eslint-8.6.0
Bump eslint from 8.5.0 to 8.6.0
2022-01-04 15:23:35 -05:00
Trevor Buckner
bf632a8584 Merge pull request #1939 from naturalcrit/dependabot/npm_and_yarn/babel/plugin-transform-runtime-7.16.7
Bump @babel/plugin-transform-runtime from 7.16.5 to 7.16.7
2022-01-04 15:23:25 -05:00
Trevor Buckner
506cf78dac Merge pull request #1938 from naturalcrit/dependabot/npm_and_yarn/babel/preset-react-7.16.7
Bump @babel/preset-react from 7.16.5 to 7.16.7
2022-01-04 15:23:18 -05:00
dependabot[bot]
0dbb5f18ba Bump eslint from 8.5.0 to 8.6.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.5.0 to 8.6.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.5.0...v8.6.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-03 03:01:02 +00:00
dependabot[bot]
85e9c57ee2 Bump @babel/plugin-transform-runtime from 7.16.5 to 7.16.7
Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.16.5 to 7.16.7.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.16.7/packages/babel-plugin-transform-runtime)

---
updated-dependencies:
- dependency-name: "@babel/plugin-transform-runtime"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-31 03:01:07 +00:00
dependabot[bot]
257c266a2e Bump @babel/preset-react from 7.16.5 to 7.16.7
Bumps [@babel/preset-react](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-react) from 7.16.5 to 7.16.7.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.16.7/packages/babel-preset-react)

---
updated-dependencies:
- dependency-name: "@babel/preset-react"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-31 03:00:54 +00:00
Alexey Sachkov
28793e06fc Fix linter errors 2021-12-30 23:40:58 +03:00
Alexey Sachkov
ba74b5aa13 Update package-lock.json 2021-12-30 23:24:38 +03:00
Alexey Sachkov
01bceca7df Add some tests for mustache span syntax
Also refactored test files a bit
2021-12-30 23:23:44 +03:00
Alexey Sachkov
ccca313a15 Initial commit with jest enabling
Removed dependency on pico-check and existing tests.
Added jest as dev dependency, introduced minimal configuration for it.
Added a very first couple of tests for our markdown parser/renderer.
2021-12-30 22:41:01 +03:00
Trevor Buckner
c463eedc50 Merge pull request #1933 from AlexeySachkov/private/asachkov/add-display-name-to-react-components
[NFC] Add display name for custom React components
2021-12-29 17:21:31 -05:00
Trevor Buckner
7f49d6f08b Merge pull request #1927 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.1.4
Bump mongoose from 6.1.3 to 6.1.4
2021-12-29 16:33:08 -05:00
Alexey Sachkov
78d4487c58 Fix linter errors 2021-12-29 21:30:03 +03:00
Alexey Sachkov
8a3f52b704 [NFC] Add display name for custom React components
This improves readability of "Components" tab from React Development Tools extension for Chrome
2021-12-29 21:18:54 +03:00
Alexey Sachkov
6e04535eff [NFC] Outline database connection into a separate file 2021-12-29 19:04:17 +03:00
Charlie Humphreys
5bb580147a Add discord, github, and reddit links to home page document 2021-12-28 21:59:02 -06:00
dependabot[bot]
1adaa9f5c4 Bump mongoose from 6.1.3 to 6.1.4
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.1.3 to 6.1.4.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Automattic/mongoose/compare/6.1.3...6.1.4)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-28 03:01:01 +00:00
Trevor Buckner
7b19bbb1a7 Merge pull request #1922 from naturalcrit/dependabot/npm_and_yarn/prop-types-15.8.0
Bump prop-types from 15.7.2 to 15.8.0
2021-12-23 22:41:44 -05:00
Trevor Buckner
e3d4165fa4 Merge pull request #1921 from naturalcrit/dependabot/npm_and_yarn/eslint-plugin-react-7.28.0
Bump eslint-plugin-react from 7.27.1 to 7.28.0
2021-12-23 22:41:35 -05:00
dependabot[bot]
ec54434427 Bump prop-types from 15.7.2 to 15.8.0
Bumps [prop-types](https://github.com/facebook/prop-types) from 15.7.2 to 15.8.0.
- [Release notes](https://github.com/facebook/prop-types/releases)
- [Changelog](https://github.com/facebook/prop-types/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/prop-types/compare/v15.7.2...v15.8.0)

---
updated-dependencies:
- dependency-name: prop-types
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-23 03:01:28 +00:00
dependabot[bot]
67bf69fc21 Bump eslint-plugin-react from 7.27.1 to 7.28.0
Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.27.1 to 7.28.0.
- [Release notes](https://github.com/yannickcr/eslint-plugin-react/releases)
- [Changelog](https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yannickcr/eslint-plugin-react/compare/v7.27.1...v7.28.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-react
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-23 03:01:10 +00:00
Trevor Buckner
c60e287cbe Merge pull request #1901 from G-Ambatte/addInstallDocs-#1896
Add Install Instructions - Ubuntu
2021-12-21 23:50:01 -05:00
Trevor Buckner
de4b2861b6 Merge pull request #1911 from naturalcrit/dependabot/npm_and_yarn/express-4.17.2
Bump express from 4.17.1 to 4.17.2
2021-12-21 23:19:02 -05:00
Trevor Buckner
eb4234d814 Merge pull request #1912 from naturalcrit/dependabot/npm_and_yarn/marked-4.0.8
Bump marked from 4.0.7 to 4.0.8
2021-12-21 23:18:52 -05:00
Trevor Buckner
4da7b8bd17 Merge pull request #1919 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.1.3
Bump mongoose from 6.1.2 to 6.1.3
2021-12-21 23:18:39 -05:00
Trevor Buckner
c0f5f224bf Merge pull request #1917 from naturalcrit/dependabot/npm_and_yarn/codemirror-5.65.0
Bump codemirror from 5.64.0 to 5.65.0
2021-12-21 23:18:29 -05:00
Trevor Buckner
9b89814056 Merge pull request #1910 from naturalcrit/dependabot/npm_and_yarn/eslint-8.5.0
Bump eslint from 8.4.1 to 8.5.0
2021-12-21 23:18:14 -05:00
Trevor Buckner
12d0baf5d3 Merge pull request #1913 from jeddai/codemirror-tweak-updates
Revert some codemirror tweaks, disable code folding in style tab
2021-12-21 22:48:37 -05:00
dependabot[bot]
8a695c14d7 Bump mongoose from 6.1.2 to 6.1.3
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.1.2 to 6.1.3.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Automattic/mongoose/compare/6.1.2...6.1.3)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-22 03:00:58 +00:00
dependabot[bot]
f253bdf954 Bump codemirror from 5.64.0 to 5.65.0
Bumps [codemirror](https://github.com/codemirror/CodeMirror) from 5.64.0 to 5.65.0.
- [Release notes](https://github.com/codemirror/CodeMirror/releases)
- [Changelog](https://github.com/codemirror/CodeMirror/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codemirror/CodeMirror/compare/5.64.0...5.65.0)

---
updated-dependencies:
- dependency-name: codemirror
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-21 03:00:47 +00:00
Charlie Humphreys
38d8764f15 Disable code folding in style tab, disable active line highlight and whitespace visibility 2021-12-20 00:42:53 -06:00
dependabot[bot]
01f6d106a2 Bump marked from 4.0.7 to 4.0.8
Bumps [marked](https://github.com/markedjs/marked) from 4.0.7 to 4.0.8.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Changelog](https://github.com/markedjs/marked/blob/master/.releaserc.json)
- [Commits](https://github.com/markedjs/marked/compare/v4.0.7...v4.0.8)

---
updated-dependencies:
- dependency-name: marked
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-20 03:01:12 +00:00
dependabot[bot]
9119860012 Bump express from 4.17.1 to 4.17.2
Bumps [express](https://github.com/expressjs/express) from 4.17.1 to 4.17.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/master/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.17.1...4.17.2)

---
updated-dependencies:
- dependency-name: express
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-20 03:01:01 +00:00
dependabot[bot]
eeaaa0e6c9 Bump eslint from 8.4.1 to 8.5.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.4.1 to 8.5.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.4.1...v8.5.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-20 03:00:51 +00:00
G.Ambatte
db5987a466 Shift install instruction READMEs into install directory 2021-12-19 19:26:12 +13:00
G.Ambatte
b5d5cb085b Merge branch 'addInstallDocs-#1896' of https://github.com/G-Ambatte/homebrewery into addInstallDocs-#1896 2021-12-19 19:22:55 +13:00
G.Ambatte
dcf17e3b72 Add README.UBUNTU.md 2021-12-19 19:22:33 +13:00
G.Ambatte
5b746c0d9c Merge branch 'naturalcrit:master' into addInstallDocs-#1896 2021-12-19 18:51:59 +13:00
G.Ambatte
41bc6ca444 Add HB service file
Update install.sh to create service and set to start automatically
2021-12-19 18:50:35 +13:00
Trevor Buckner
aba2f58fc4 Merge pull request #1898 from naturalcrit/v3.0.6
3.0.6
2021-12-18 23:02:43 -05:00
Trevor Buckner
fb1d947e97 Update changelog.md 2021-12-18 22:56:18 -05:00
Trevor Buckner
f02bda2c52 3.0.6 2021-12-17 00:00:00 -05:00
Sean Robertson
aa4de67e90 Ensure curl is installed
Fix mongodb package name
Use apt satisfy instead of apt install
2021-12-17 16:06:34 +13:00
Sean Robertson
b1a9fbe3ca Update location of FreeBSD install instructions 2021-12-17 15:21:52 +13:00
Charlie Humphreys
603cf2c0ab Adjust migrate document text 2021-12-16 00:03:23 -06:00
Charlie Humphreys
0bc27e83ed Fix reference to old function 2021-12-16 00:01:16 -06:00
Charlie Humphreys
25c1d03cca Update package-lock.json 2021-12-15 23:59:36 -06:00
Charlie Humphreys
e2b4151ab4 Merge branch 'master' into migration-guide
# Conflicts:
#	shared/naturalcrit/markdown.js
2021-12-15 23:59:10 -06:00
Charlie Humphreys
889d307372 Lint change double quotes into single quotes 2021-12-15 23:58:49 -06:00
Charlie Humphreys
fd23396b95 Add migrate nav item to pages and update migrate document 2021-12-15 23:57:52 -06:00
Trevor Buckner
fa5266626a Merge pull request #1895 from naturalcrit/dependabot/npm_and_yarn/pico-check-2.2.0
Bump pico-check from 2.1.3 to 2.2.0
2021-12-15 23:45:22 -05:00
dependabot[bot]
cfe9bcdfe6 Bump pico-check from 2.1.3 to 2.2.0
Bumps [pico-check](https://github.com/stolksdorf/pico-check) from 2.1.3 to 2.2.0.
- [Release notes](https://github.com/stolksdorf/pico-check/releases)
- [Commits](https://github.com/stolksdorf/pico-check/commits)

---
updated-dependencies:
- dependency-name: pico-check
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-16 03:01:09 +00:00
Trevor Buckner
0555427805 Merge pull request #1863 from jeddai/random-fixes
Cover page v3 CSS and table of contents snippet fixes
2021-12-15 21:48:46 -05:00
Trevor Buckner
cebc74009d Couple more tweaks to spacings in the TOC 2021-12-15 21:48:13 -05:00
Trevor Buckner
61af0842e6 Merge pull request #1867 from G-Ambatte/addClassNameToUserPageLinks-#1866
Add classes to User Page sort options + brew links
2021-12-15 21:25:03 -05:00
Charlie Humphreys
7d58ce6e00 Merge remote-tracking branch 'origin/random-fixes' into random-fixes 2021-12-15 20:14:17 -06:00
Charlie Humphreys
d4c5ac8110 Change div syntax in snippet to curly-brace v3 syntax 2021-12-15 20:14:07 -06:00
Trevor Buckner
2dbfd1cc67 Merge branch 'master' into pr/1867 2021-12-15 21:13:41 -05:00
Trevor Buckner
6d461155e8 Merge pull request #1894 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.1.2
Bump mongoose from 6.1.1 to 6.1.2
2021-12-15 21:05:44 -05:00
Trevor Buckner
e198a8931a Merge branch 'master' into pr/1863 2021-12-15 01:07:25 -05:00
dependabot[bot]
e981fe04f9 Bump mongoose from 6.1.1 to 6.1.2
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.1.1 to 6.1.2.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Automattic/mongoose/compare/6.1.1...6.1.2)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-15 03:00:47 +00:00
Trevor Buckner
6233a72b8a Merge pull request #1891 from naturalcrit/dependabot/npm_and_yarn/babel/plugin-transform-runtime-7.16.5
Bump @babel/plugin-transform-runtime from 7.16.4 to 7.16.5
2021-12-13 23:41:28 -05:00
Trevor Buckner
4e013d218f Merge pull request #1892 from naturalcrit/dependabot/npm_and_yarn/babel/preset-react-7.16.5
Bump @babel/preset-react from 7.16.0 to 7.16.5
2021-12-13 23:41:18 -05:00
Trevor Buckner
31b95db10b Merge pull request #1857 from Gazook89/process-googleID-for-Print-hotkey
Process GoogleId for Print Hotkey
2021-12-13 23:41:08 -05:00
Trevor Buckner
90708c3ca9 Merge branch 'master' into pr/1857 2021-12-13 23:21:19 -05:00
dependabot[bot]
ef1074d169 Bump @babel/plugin-transform-runtime from 7.16.4 to 7.16.5
Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.16.4 to 7.16.5.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.16.5/packages/babel-plugin-transform-runtime)

---
updated-dependencies:
- dependency-name: "@babel/plugin-transform-runtime"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-14 04:17:46 +00:00
dependabot[bot]
63fa174814 Bump @babel/preset-react from 7.16.0 to 7.16.5
Bumps [@babel/preset-react](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-react) from 7.16.0 to 7.16.5.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.16.5/packages/babel-preset-react)

---
updated-dependencies:
- dependency-name: "@babel/preset-react"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-14 04:17:41 +00:00
Trevor Buckner
7942f05961 Merge pull request #1893 from naturalcrit/dependabot/npm_and_yarn/marked-extended-tables-1.0.3
Bump marked-extended-tables from 1.0.2 to 1.0.3
2021-12-13 23:16:13 -05:00
Trevor Buckner
5456290692 Merge pull request #1890 from naturalcrit/dependabot/npm_and_yarn/babel/preset-env-7.16.5
Bump @babel/preset-env from 7.16.4 to 7.16.5
2021-12-13 23:15:54 -05:00
Trevor Buckner
7ead0d02db Merge pull request #1889 from naturalcrit/dependabot/npm_and_yarn/babel/core-7.16.5
Bump @babel/core from 7.16.0 to 7.16.5
2021-12-13 23:15:45 -05:00
dependabot[bot]
9c5f0e5140 Bump marked-extended-tables from 1.0.2 to 1.0.3
Bumps [marked-extended-tables](https://github.com/calculuschild/marked-extended-tables) from 1.0.2 to 1.0.3.
- [Release notes](https://github.com/calculuschild/marked-extended-tables/releases)
- [Changelog](https://github.com/calculuschild/marked-extended-tables/blob/main/release.config.cjs)
- [Commits](https://github.com/calculuschild/marked-extended-tables/commits/v1.0.3)

---
updated-dependencies:
- dependency-name: marked-extended-tables
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-14 03:01:57 +00:00
dependabot[bot]
91735b3e19 Bump @babel/preset-env from 7.16.4 to 7.16.5
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.16.4 to 7.16.5.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.16.5/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-14 03:01:14 +00:00
dependabot[bot]
ad5fb5ee56 Bump @babel/core from 7.16.0 to 7.16.5
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.16.0 to 7.16.5.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.16.5/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-14 03:00:55 +00:00
Trevor Buckner
b9040226e4 Merge pull request #1819 from jeddai/codemirror-tweaks
Codemirror tweaks
2021-12-13 21:58:26 -05:00
Charlie Humphreys
2c2579ae2b Update usage of trailing space to include special chars for spaces 2021-12-13 20:49:32 -06:00
Charlie Humphreys
53fcdd8d7a Prevent activeline class from being removed 2021-12-13 20:29:28 -06:00
Trevor Buckner
87bf6301dc Merge pull request #1887 from naturalcrit/dependabot/npm_and_yarn/body-parser-1.19.1
Bump body-parser from 1.19.0 to 1.19.1
2021-12-13 15:30:15 -05:00
Trevor Buckner
98f6ba6045 Update Marked to v4.0.7, use Extended-Tables extension 2021-12-13 15:21:53 -05:00
dependabot[bot]
0ea40499e9 Bump body-parser from 1.19.0 to 1.19.1
Bumps [body-parser](https://github.com/expressjs/body-parser) from 1.19.0 to 1.19.1.
- [Release notes](https://github.com/expressjs/body-parser/releases)
- [Changelog](https://github.com/expressjs/body-parser/blob/master/HISTORY.md)
- [Commits](https://github.com/expressjs/body-parser/compare/1.19.0...1.19.1)

---
updated-dependencies:
- dependency-name: body-parser
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-13 03:01:13 +00:00
Charlie Humphreys
84f3519dbe Remove unnecessary findPersistent method 2021-12-10 23:39:26 -06:00
Charlie Humphreys
61cfef445b Update trailing space background and remove tab background when it is inside a trailing space 2021-12-10 23:07:21 -06:00
Charlie Humphreys
b60bc2996b Update search/replace shortcuts and add 'Enter'-based shortcut for navigating backwards 2021-12-10 23:05:16 -06:00
Charlie Humphreys
65c9a2cba0 Update CodeMirror library import order and add comments explaining each file 2021-12-10 23:04:22 -06:00
Charlie Humphreys
f1c4910993 Add to migrate document and update colon-replacement for the markdown renderer 2021-12-10 20:25:31 -06:00
Trevor Buckner
cd18692a53 Merge pull request #1886 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.1.1
Bump mongoose from 6.0.15 to 6.1.1
2021-12-09 23:01:08 -05:00
Trevor Buckner
220316ec7e Merge branch 'master' into pr/1819 2021-12-09 22:30:23 -05:00
Trevor Buckner
bbf6f7fb06 Merge pull request #1759 from G-Ambatte/fixCodeWrapping-#1736
Fix text wrapping in code blocks
2021-12-09 22:20:27 -05:00
Trevor Buckner
82fc581125 Change to overflow-wrap : break-word 2021-12-09 22:19:53 -05:00
Trevor Buckner
6be4fcefdb Merge branch 'master' into pr/1759 2021-12-09 22:16:56 -05:00
Trevor Buckner
f6eab47ab8 Merge pull request #1758 from naturalcrit/dependabot/npm_and_yarn/express-async-handler-1.2.0
Bump express-async-handler from 1.1.4 to 1.2.0
2021-12-09 22:14:42 -05:00
dependabot[bot]
dd887e9a4f Bump mongoose from 6.0.15 to 6.1.1
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.0.15 to 6.1.1.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Automattic/mongoose/compare/6.0.15...6.1.1)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-10 03:01:21 +00:00
Trevor Buckner
a8f5f71b32 Send 500 error if Google doesn't send an error
Fixes crash where error did not contain the expected `response` field from Google.
2021-12-09 13:57:43 -05:00
Trevor Buckner
dd93c4cdd4 Merge pull request #1841 from jeddai/metadata-document-block
Adding metadata block to brew text for Google brews
2021-12-07 23:19:29 -05:00
Charlie Humphreys
7eded57d79 Update package-lock.json after fixing my npm version 2021-12-07 22:11:16 -06:00
Charlie Humphreys
3de1d3afb0 Merge branch 'master' into metadata-document-block
# Conflicts:
#	package-lock.json
2021-12-07 22:09:44 -06:00
Charlie Humphreys
b817148d1c Initial page for migrating from GMB to HB 2021-12-07 22:09:01 -06:00
Trevor Buckner
902f91e25f Merge pull request #1880 from naturalcrit/v3.0.5
Up to Version 3.0.5
2021-12-07 23:02:01 -05:00
Trevor Buckner
12cb457c60 Up to Version 3.0.5 2021-12-07 23:01:42 -05:00
Trevor Buckner
cb3cfd44ee Merge pull request #1849 from Gazook89/better-google-errors
Change conditions for Google error
2021-12-06 22:42:11 -05:00
Trevor Buckner
0a335cefbf Update newPage.jsx 2021-12-06 22:41:11 -05:00
Trevor Buckner
fe9998c6e4 Update editPage.jsx 2021-12-06 22:40:42 -05:00
Trevor Buckner
634a98c2cb Update newPage.jsx 2021-12-06 22:39:48 -05:00
Trevor Buckner
d8b7e299fd Update newPage.jsx 2021-12-06 22:39:12 -05:00
Trevor Buckner
53ad7ecd57 Update editPage.jsx 2021-12-06 22:37:55 -05:00
Trevor Buckner
69a3e283f8 Merge pull request #1874 from naturalcrit/BatchCodeMirrorHighlighting
Tell CodeMirror to batch custom highlights before updating the browser
2021-12-06 22:32:28 -05:00
Trevor Buckner
58bb33cdcc Merge pull request #1876 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.0.15
Bump mongoose from 6.0.14 to 6.0.15
2021-12-06 22:31:57 -05:00
Trevor Buckner
1bbacc974b lint 2021-12-06 22:31:25 -05:00
Trevor Buckner
b6e29c8a61 Change to callback style 2021-12-06 22:30:58 -05:00
Trevor Buckner
f56d576a1e Merge pull request #1875 from naturalcrit/dependabot/npm_and_yarn/eslint-8.4.1
Bump eslint from 8.4.0 to 8.4.1
2021-12-06 22:15:35 -05:00
dependabot[bot]
da4dc9eb7e Bump mongoose from 6.0.14 to 6.0.15
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.0.14 to 6.0.15.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Automattic/mongoose/compare/6.0.14...6.0.15)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-07 03:01:19 +00:00
dependabot[bot]
e2b2b38e5b Bump eslint from 8.4.0 to 8.4.1
Bumps [eslint](https://github.com/eslint/eslint) from 8.4.0 to 8.4.1.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.4.0...v8.4.1)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-07 03:00:52 +00:00
Trevor Buckner
09f64e018e Tell CodeMirror to batch custom highlights before updating the browser 2021-12-06 16:23:18 -05:00
Trevor Buckner
3762c278c4 Merge pull request #1809 from Gazook89/page-numbers-via-JS
Page numbers via js
2021-12-06 15:51:58 -05:00
Trevor Buckner
8acd42fcbe Small cleanup. Reduce redundant code. 2021-12-06 15:36:41 -05:00
Trevor Buckner
23deef7a9a Merge branch 'master' into pr/1809 2021-12-06 14:57:55 -05:00
Trevor Buckner
782e8dc495 Merge pull request #1873 from naturalcrit/dependabot/npm_and_yarn/eslint-8.4.0
Bump eslint from 8.3.0 to 8.4.0
2021-12-06 11:47:12 -05:00
dependabot[bot]
0049137932 Bump eslint from 8.3.0 to 8.4.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.3.0 to 8.4.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.3.0...v8.4.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-12-06 03:00:58 +00:00
Gazook89
dcf4fe10cd lint 2021-12-03 20:25:04 -06:00
Gazook89
5cd45a1413 remove "in viewport" requirement for markdown highlight/pg numbers 2021-12-03 20:20:40 -06:00
Trevor Buckner
65bac929ca Merge pull request #1719 from Gazook89/Hotkey-for-Lists
Hotkey for Lists
2021-12-03 15:24:02 -05:00
Trevor Buckner
d4b26cc4c4 Merge branch 'master' into pr/1719 2021-12-03 15:16:19 -05:00
Trevor Buckner
a88443563e Merge pull request #1707 from RKuerten/header-functions
Added heading shortcuts (H1 to H6)
2021-12-02 23:45:55 -05:00
Trevor Buckner
1865e56b04 lint 2021-12-02 23:44:48 -05:00
Trevor Buckner
4fefc1e4d2 Merge branch 'master' into pr/1707 2021-12-02 23:29:47 -05:00
Trevor Buckner
8092192210 Merge pull request #1645 from Gazook89/Hotkey-Mania
Add Hotkeys for Underline and makeDiv
2021-12-02 15:52:54 -05:00
Trevor Buckner
a30e150ade Disable max lines to satisfy lint
Eventually we should move the hotkey scripts into a separate file. They are becoming a beast of their own.
2021-12-02 15:47:18 -05:00
Trevor Buckner
9da1bfc606 Finish Merge with Master 2021-12-02 12:18:22 -05:00
Trevor Buckner
28f29ac49e Merge branch 'master' into pr/1645 2021-12-02 12:17:41 -05:00
Trevor Buckner
97f079311d Merge pull request #1568 from Gazook89/Hotkey-for-Links
Hotkey for hyperlinks (`Ctrl`/`Cmd` + `K`)
2021-12-02 11:50:17 -05:00
Trevor Buckner
2586a871e1 Use capture groups, add default "alt text" if none selected
Also allow whitespace at end and start of selection, so you don't have to be perfect.
2021-12-02 11:45:10 -05:00
Charlie Humphreys
6a73136176 Update object parsing to use _.pick 2021-12-01 19:20:16 -06:00
Trevor Buckner
76553d1e65 Merge branch 'master' into pr/1568 2021-12-01 16:56:10 -05:00
Charlie Humphreys
20e1fb406f Update package-lock.json 2021-12-01 10:48:05 -06:00
Charlie Humphreys
fadfe7d091 Merge branch 'master' into metadata-document-block
# Conflicts:
#	package-lock.json
#	package.json
2021-12-01 10:37:03 -06:00
Charlie Humphreys
db3980a716 Add yaml require back in 2021-11-30 23:32:16 -06:00
Charlie Humphreys
25c36425be Update code based on feedback 2021-11-30 23:05:08 -06:00
G.Ambatte
806a60e356 Add classes to User Page sort options + brew links 2021-11-30 21:57:42 +13:00
dependabot[bot]
06def81b0a Bump express-async-handler from 1.1.4 to 1.2.0
Bumps [express-async-handler](https://github.com/Abazhenov/express-async-handler) from 1.1.4 to 1.2.0.
- [Release notes](https://github.com/Abazhenov/express-async-handler/releases)
- [Commits](https://github.com/Abazhenov/express-async-handler/commits)

---
updated-dependencies:
- dependency-name: express-async-handler
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-30 04:19:03 +00:00
Trevor Buckner
ce5058538d Merge pull request #1865 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.0.14
Bump mongoose from 6.0.13 to 6.0.14
2021-11-29 23:17:04 -05:00
Trevor Buckner
b5b6eba5da Merge pull request #1864 from naturalcrit/dependabot/npm_and_yarn/googleapis-92.0.0
Bump googleapis from 91.0.0 to 92.0.0
2021-11-29 23:16:53 -05:00
dependabot[bot]
e4162f3716 Bump mongoose from 6.0.13 to 6.0.14
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.0.13 to 6.0.14.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Automattic/mongoose/compare/6.0.13...6.0.14)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-30 03:01:37 +00:00
dependabot[bot]
4000ec546a Bump googleapis from 91.0.0 to 92.0.0
Bumps [googleapis](https://github.com/googleapis/google-api-nodejs-client) from 91.0.0 to 92.0.0.
- [Release notes](https://github.com/googleapis/google-api-nodejs-client/releases)
- [Changelog](https://github.com/googleapis/google-api-nodejs-client/blob/main/CHANGELOG.md)
- [Commits](https://github.com/googleapis/google-api-nodejs-client/compare/googleapis-v91.0.0...googleapis-v92.0.0)

---
updated-dependencies:
- dependency-name: googleapis
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-30 03:00:57 +00:00
Charlie Humphreys
46b64b8001 Update package-lock.json for addition of js-yaml 2021-11-28 23:32:05 -06:00
Charlie Humphreys
49bc2cb32a Merge branch 'master' into metadata-document-block
# Conflicts:
#	package-lock.json
2021-11-28 23:31:14 -06:00
Charlie Humphreys
85c221e9bd Change counter usage in cover page snippet to no longer increment the counter on the cover page 2021-11-28 23:02:44 -06:00
Charlie Humphreys
9e7239cfef Fix table of contents CSS so the first items in both columns start at the same vertical position 2021-11-28 22:37:51 -06:00
Charlie Humphreys
640bc33719 Fix cover page snippet styles and formatting for v3 2021-11-28 22:17:02 -06:00
Charlie Humphreys
5ffdd022c2 Changed uses of the 'raw' brew access type to 'view' and update uses of mergeBrewText as a result
#1838
2021-11-25 22:44:59 -06:00
Gazook89
9618e802d1 Update client/homebrew/pages/editPage/editPage.jsx
Co-authored-by: Trevor Buckner <calculuschild@gmail.com>
2021-11-24 14:35:36 -06:00
Gazook89
2e5d1b3b55 Update client/homebrew/pages/newPage/newPage.jsx
Co-authored-by: Trevor Buckner <calculuschild@gmail.com>
2021-11-24 07:48:44 -06:00
Gazook89
fe15ae07a1 Update client/homebrew/pages/sharePage/sharePage.jsx
Co-authored-by: Trevor Buckner <calculuschild@gmail.com>
2021-11-24 07:45:51 -06:00
Charlie Humphreys
ef433bbbe2 Update brew content merging functionality and add it to downloads/page source views
#1838
2021-11-23 23:53:02 -06:00
Trevor Buckner
1bc68a9e85 Merge pull request #1847 from Gazook89/note-interparagraph-spacing
remove p + p padding in .note & .descriptive
2021-11-23 23:31:02 -05:00
Gazook89
be75019afd Update sharePage.jsx 2021-11-22 14:26:32 -06:00
Trevor Buckner
be88a0fde8 Merge pull request #1831 from naturalcrit/dependabot/npm_and_yarn/babel/preset-env-7.16.4
Bump @babel/preset-env from 7.16.0 to 7.16.4
2021-11-22 00:30:15 -05:00
Trevor Buckner
a1f9459ee9 Merge pull request #1854 from naturalcrit/dependabot/npm_and_yarn/eslint-plugin-react-7.27.1
Bump eslint-plugin-react from 7.27.0 to 7.27.1
2021-11-21 23:41:02 -05:00
Trevor Buckner
77089719c0 Merge pull request #1852 from naturalcrit/dependabot/npm_and_yarn/codemirror-5.64.0
Bump codemirror from 5.63.3 to 5.64.0
2021-11-21 23:30:19 -05:00
dependabot[bot]
161db209e6 Bump eslint-plugin-react from 7.27.0 to 7.27.1
Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.27.0 to 7.27.1.
- [Release notes](https://github.com/yannickcr/eslint-plugin-react/releases)
- [Changelog](https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yannickcr/eslint-plugin-react/compare/v7.27.0...v7.27.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-react
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-22 04:28:28 +00:00
Trevor Buckner
04d285164a Merge pull request #1853 from naturalcrit/dependabot/npm_and_yarn/eslint-8.3.0
Bump eslint from 8.2.0 to 8.3.0
2021-11-21 23:24:17 -05:00
dependabot[bot]
7cda37c5e2 Bump eslint from 8.2.0 to 8.3.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.2.0 to 8.3.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.2.0...v8.3.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-22 03:01:35 +00:00
dependabot[bot]
63259ef8f4 Bump codemirror from 5.63.3 to 5.64.0
Bumps [codemirror](https://github.com/codemirror/CodeMirror) from 5.63.3 to 5.64.0.
- [Release notes](https://github.com/codemirror/CodeMirror/releases)
- [Changelog](https://github.com/codemirror/CodeMirror/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codemirror/CodeMirror/compare/5.63.3...5.64.0)

---
updated-dependencies:
- dependency-name: codemirror
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-22 03:01:12 +00:00
Gazook89
372d33271d Change widgets to bookmarks for page counters 2021-11-21 15:17:23 -06:00
Gazook89
7997698bcd change conditions for google error 2021-11-21 10:58:41 -06:00
Gazook89
833f08d245 remove p + p padding in .note & .descriptive 2021-11-20 10:48:16 -06:00
Gazook89
09f9e1d398 Merge branch 'master' into page-numbers-via-JS 2021-11-20 10:07:07 -06:00
Charlie Humphreys
f40b4b2f30 Update brew text merge and split functions to include metadata
#1838
2021-11-18 23:23:05 -06:00
Gazook89
f72d8f0ef0 merge pageNumber() into customHighlight() 2021-11-17 10:47:16 -06:00
Gazook89
f0608441fc fix circleCI errors 2021-11-17 09:58:31 -06:00
Gazook89
8b13528661 add check for change to current viewport 2021-11-17 09:47:51 -06:00
dependabot[bot]
2b2c4c15f5 Bump @babel/preset-env from 7.16.0 to 7.16.4
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.16.0 to 7.16.4.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.16.4/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-17 06:14:20 +00:00
Trevor Buckner
0d685acfca Merge pull request #1835 from naturalcrit/v3.0.4
Up version to v3.0.4
2021-11-17 01:13:40 -05:00
Trevor Buckner
6471ee0577 Merge pull request #1830 from naturalcrit/dependabot/npm_and_yarn/babel/plugin-transform-runtime-7.16.4
Bump @babel/plugin-transform-runtime from 7.16.0 to 7.16.4
2021-11-17 01:13:02 -05:00
Trevor Buckner
a890e25e3f Merge pull request #1832 from naturalcrit/dependabot/npm_and_yarn/cookie-parser-1.4.6
Bump cookie-parser from 1.4.5 to 1.4.6
2021-11-17 01:12:37 -05:00
Trevor Buckner
acfd0a2a6b Merge pull request #1833 from jeddai/chrome-96-fix-v3
Chrome 96 Style Tweaks for v3 PHB Theme
2021-11-17 01:10:22 -05:00
Trevor Buckner
c945984d88 Slight nudges. Comments that header line-height is just to fix bad font baseline 2021-11-17 01:09:52 -05:00
Trevor Buckner
de8f15d726 Up version to v3.0.4 2021-11-17 00:43:31 -05:00
Charlie Humphreys
1c648e5c2d Update less for line-height em changes due to renderer changes in Chrome 96
#1828
2021-11-16 23:34:48 -06:00
Trevor Buckner
aa009f8854 Merge pull request #1829 from jeddai/chrome-96-fix
Chrome 96 Style Tweaks for Legacy PHB Theme
2021-11-17 00:18:45 -05:00
Trevor Buckner
ebe76cbb0e Nudge values to line up with live site on Chrome 95 2021-11-17 00:14:15 -05:00
dependabot[bot]
9319b887c2 Bump cookie-parser from 1.4.5 to 1.4.6
Bumps [cookie-parser](https://github.com/expressjs/cookie-parser) from 1.4.5 to 1.4.6.
- [Release notes](https://github.com/expressjs/cookie-parser/releases)
- [Changelog](https://github.com/expressjs/cookie-parser/blob/master/HISTORY.md)
- [Commits](https://github.com/expressjs/cookie-parser/compare/1.4.5...1.4.6)

---
updated-dependencies:
- dependency-name: cookie-parser
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-17 03:01:26 +00:00
dependabot[bot]
11aa6cccb8 Bump @babel/plugin-transform-runtime from 7.16.0 to 7.16.4
Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.16.0 to 7.16.4.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.16.4/packages/babel-plugin-transform-runtime)

---
updated-dependencies:
- dependency-name: "@babel/plugin-transform-runtime"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-17 03:00:49 +00:00
Charlie Humphreys
ecfda87262 Update legacy less for font-size and line-height em cases due to renderer changes in Chrome 96
#1828
2021-11-16 17:16:55 -06:00
Trevor Buckner
c8fab7f1d2 Merge pull request #1827 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.0.13
Bump mongoose from 6.0.12 to 6.0.13
2021-11-15 22:51:25 -05:00
Trevor Buckner
920c8846c8 Merge pull request #1821 from naturalcrit/dependabot/npm_and_yarn/eslint-plugin-react-7.27.0
Bump eslint-plugin-react from 7.26.1 to 7.27.0
2021-11-15 22:49:25 -05:00
dependabot[bot]
fc324babf0 Bump mongoose from 6.0.12 to 6.0.13
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.0.12 to 6.0.13.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Automattic/mongoose/compare/6.0.12...6.0.13)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-16 03:00:50 +00:00
Trevor Buckner
258dca8569 Merge pull request #1792 from jeddai/code-folding
Add code folding feature for all content within a single page
2021-11-14 21:35:46 -05:00
Charlie Humphreys
2ea6610c57 Merge branch 'code-folding' into codemirror-tweaks
# Conflicts:
#	shared/naturalcrit/codeEditor/codeEditor.jsx
2021-11-14 14:46:26 -06:00
Charlie Humphreys
1ec1ddc80c Remove code fold toggling shortcut
#629
2021-11-14 09:58:41 -06:00
Trevor Buckner
b67dc1621b More simplification to fold-code script 2021-11-13 20:57:33 -05:00
Charlie Humphreys
602ff67f3c Add style for tabs to show tabs differently from spaces in the code editor
#1622
2021-11-11 22:38:27 -06:00
Charlie Humphreys
278a4d35c7 Adjust calling of removeLineClass to limit the classes it removes
#1201 #1202
2021-11-11 21:47:15 -06:00
Charlie Humphreys
ea68e4778e Merge branch 'code-folding' into codemirror-tweaks 2021-11-11 21:16:40 -06:00
Charlie Humphreys
2d30ac21a7 Update code based on PR feedback
#692
2021-11-11 17:08:05 -06:00
dependabot[bot]
5fbae3271f Bump eslint-plugin-react from 7.26.1 to 7.27.0
Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.26.1 to 7.27.0.
- [Release notes](https://github.com/yannickcr/eslint-plugin-react/releases)
- [Changelog](https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yannickcr/eslint-plugin-react/compare/v7.26.1...v7.27.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-react
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-11 03:00:58 +00:00
Charlie Humphreys
da6b00918d Add addons for code search, auto-closing code, active line highlight, and trailing whitespace
#1201 #1202
2021-11-10 17:11:00 -06:00
Charlie Humphreys
52d7e6892b Adjust comment to better describe the require section
#629
2021-11-10 11:37:18 -06:00
Gazook89
9f05aae876 remove left property entirely and set height to cm.defaultTextHeight 2021-11-10 11:17:45 -06:00
Charlie Humphreys
cac9e208df Update editor.jsx to only clear marks that are not folds
#629
2021-11-10 10:27:32 -06:00
Charlie Humphreys
c86e8c51cb Remove code added for debugging purposes
#629
2021-11-10 10:26:55 -06:00
Charlie Humphreys
3abb399045 Update homebrewery fold helper to allow folding the last page to the end of the document
#629
2021-11-09 10:08:48 -06:00
Trevor Buckner
fb52618ce9 Merge pull request #1794 from G-Ambatte/fixViewCountOrdering-#1793
Fix UserPage ordering of Google Brews
2021-11-09 10:49:41 -05:00
Trevor Buckner
f8a2ffa4fa Merge pull request #1811 from naturalcrit/dependabot/npm_and_yarn/eslint-8.2.0
Bump eslint from 8.1.0 to 8.2.0
2021-11-08 22:02:14 -05:00
Trevor Buckner
ff521f64a6 Merge pull request #1812 from naturalcrit/dependabot/npm_and_yarn/googleapis-91.0.0
Bump googleapis from 89.0.0 to 91.0.0
2021-11-08 22:01:44 -05:00
dependabot[bot]
edb8f28098 Bump googleapis from 89.0.0 to 91.0.0
Bumps [googleapis](https://github.com/googleapis/google-api-nodejs-client) from 89.0.0 to 91.0.0.
- [Release notes](https://github.com/googleapis/google-api-nodejs-client/releases)
- [Changelog](https://github.com/googleapis/google-api-nodejs-client/blob/main/CHANGELOG.md)
- [Commits](https://github.com/googleapis/google-api-nodejs-client/compare/googleapis-v89.0.0...googleapis-v91.0.0)

---
updated-dependencies:
- dependency-name: googleapis
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-09 03:00:55 +00:00
Charlie Humphreys
b06dedfa4a Fix linting issues
#629
2021-11-08 17:24:33 -06:00
Charlie Humphreys
f3d0d3e2c9 Add new library files to the browserify lib array
#629
2021-11-08 17:24:22 -06:00
Gazook89
3e54f6e6e1 remove collection array from _.forEach() function
Co-authored-by: Trevor Buckner <calculuschild@gmail.com>
2021-11-08 10:49:41 -06:00
Gazook89
796bd22000 circleCI update 2021-11-08 09:07:59 -06:00
Gazook89
403e5050e8 adjust position from right to accommodate scrollbar 2021-11-08 09:05:08 -06:00
Gazook89
c3e24ef4c5 replace _.reduce() with _.forEach() 2021-11-08 08:59:30 -06:00
Charlie Humphreys
eec6e66543 Replace copied code with require methods to import the CodeMirror helpers
Put back the correct require notation for importing the foldcode and foldgutter helpers

#629
2021-11-07 21:35:35 -06:00
dependabot[bot]
b17c2dc341 Bump eslint from 8.1.0 to 8.2.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.1.0 to 8.2.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.1.0...v8.2.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-08 03:01:22 +00:00
Gazook89
9141b93a6b fix pageCountWidgets to get elements by correct class name 2021-11-07 16:47:54 -06:00
Gazook89
1fb63f8be3 initial commit to add programmatic page counts in editor
update element classname to be more descriptive, remove some commented code.
2021-11-07 16:33:50 -06:00
Trevor Buckner
34bc242b76 Merge pull request #1802 from naturalcrit/revert-1777-experimentalAddMetadata-#820
Revert "Add `<meta>` tags to template"
2021-11-03 22:09:28 -04:00
Trevor Buckner
f4529594a2 Revert "Add <meta> tags to template" 2021-11-03 22:07:58 -04:00
Trevor Buckner
3a4cf4f2dd Merge pull request #1777 from G-Ambatte/experimentalAddMetadata-#820
Add `<meta>` tags to template
2021-11-03 21:59:21 -04:00
Trevor Buckner
fbcd4036f5 Merge pull request #1788 from naturalcrit/dependabot/npm_and_yarn/babel/preset-env-7.16.0
Bump @babel/preset-env from 7.15.8 to 7.16.0
2021-11-03 21:03:24 -04:00
dependabot[bot]
3528503604 Bump @babel/preset-env from 7.15.8 to 7.16.0
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.15.8 to 7.16.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.16.0/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-03 14:16:58 +00:00
Trevor Buckner
954fb6064e Merge pull request #1787 from naturalcrit/dependabot/npm_and_yarn/babel/plugin-transform-runtime-7.16.0
Bump @babel/plugin-transform-runtime from 7.15.8 to 7.16.0
2021-11-03 10:16:09 -04:00
G.Ambatte
2948a9ffc3 Update listGoogleBrews to ensure pageCount and views are integers 2021-11-03 21:39:20 +13:00
dependabot[bot]
e54649bf66 Bump @babel/plugin-transform-runtime from 7.15.8 to 7.16.0
Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.15.8 to 7.16.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.16.0/packages/babel-plugin-transform-runtime)

---
updated-dependencies:
- dependency-name: "@babel/plugin-transform-runtime"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-03 03:46:38 +00:00
Trevor Buckner
dcb99fff80 Merge pull request #1786 from naturalcrit/dependabot/npm_and_yarn/babel/preset-react-7.16.0
Bump @babel/preset-react from 7.14.5 to 7.16.0
2021-11-02 23:45:42 -04:00
Trevor Buckner
a851469ae1 Merge pull request #1785 from naturalcrit/dependabot/npm_and_yarn/babel/core-7.16.0
Bump @babel/core from 7.15.8 to 7.16.0
2021-11-02 23:45:34 -04:00
Charlie Humphreys
c0b9f4488f Add code folding feature for all content within a single page
Added the gutter definitions and css for code folding. Enabling code folding in the editor was
tricky due to how CodeMirror loads its files. At the moment, the CodeMirror code-folding code has
been copied into the fold-code.js file. Additionally, that file contains the helper registration
for the Homebrewery-specific code folding function.

#629
2021-11-02 22:40:17 -05:00
dependabot[bot]
594aebaf8f Bump @babel/preset-react from 7.14.5 to 7.16.0
Bumps [@babel/preset-react](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-react) from 7.14.5 to 7.16.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.16.0/packages/babel-preset-react)

---
updated-dependencies:
- dependency-name: "@babel/preset-react"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-01 03:01:27 +00:00
dependabot[bot]
34c8646477 Bump @babel/core from 7.15.8 to 7.16.0
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.15.8 to 7.16.0.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.16.0/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-01 03:01:02 +00:00
G.Ambatte
5bc3de1e0a Added Prod check to template function for meta URL 2021-10-31 00:21:42 +13:00
G.Ambatte
bd5f3c74e7 Add public URL in template.js 2021-10-31 00:07:25 +13:00
G.Ambatte
68341bf6a5 Use PUBLIC_ENV variable and localhost thumbnail 2021-10-30 19:00:44 +13:00
G.Ambatte
95f1561f0d Change to locally hosted thumbnail image 2021-10-30 18:57:53 +13:00
G.Ambatte
056024372b Fix button arrow size. 2021-10-30 18:25:51 +13:00
G.Ambatte
cd8962f68b Nudge Metadata Editor elements 2021-10-30 18:14:46 +13:00
G.Ambatte
bade8ad32f Remove showThumbnail from MetadataEditor props 2021-10-30 18:14:21 +13:00
G.Ambatte
4714074b12 Remove unnecessary thumbnail default prop 2021-10-30 18:13:04 +13:00
G.Ambatte
785b859d63 Changed label from thumbnail URL to thumbnail 2021-10-30 14:03:01 +13:00
G.Ambatte
de39ef938a Added placeholder to text input 2021-10-30 14:02:09 +13:00
G.Ambatte
6295b7561e Modularize default icon location 2021-10-30 13:51:59 +13:00
G.Ambatte
defae3cc3a Add overflow control to URL textbox 2021-10-30 13:51:28 +13:00
G.Ambatte
47c2b4bbde Add max-height to thumbnail preview 2021-10-30 13:38:41 +13:00
G.Ambatte
029077b92b Default thumbnail to visible rather than hidden 2021-10-30 13:26:08 +13:00
G.Ambatte
ed042a66a4 Fix label line height 2021-10-29 12:03:13 +13:00
G.Ambatte
7499a0d9ab Add thumbnail preview to Metadata Editor 2021-10-29 11:54:56 +13:00
Trevor Buckner
09ca2a4fd9 Merge pull request #1779 from naturalcrit/v3.0.3
Update Changelog to v3.0.3
2021-10-27 21:53:42 -04:00
Trevor Buckner
a4b2fe2b91 Update Changelog 2021-10-27 21:52:52 -04:00
Trevor Buckner
8b219ba38a Merge pull request #1773 from naturalcrit/dependabot/npm_and_yarn/marked-3.0.8
Bump marked from 3.0.7 to 3.0.8
2021-10-27 21:41:22 -04:00
G.Ambatte
6160d3ddd1 Correct thumbnail type in model
Co-authored-by: Trevor Buckner <calculuschild@gmail.com>
2021-10-28 09:08:54 +13:00
G.Ambatte
20d7193fb2 Add thumbnail to metadata and saving functions 2021-10-28 00:29:42 +13:00
G.Ambatte
3ce1ea610d Update template.js to add <meta> tags 2021-10-27 19:51:52 +13:00
Trevor Buckner
8722791419 Merge pull request #1772 from naturalcrit/dependabot/npm_and_yarn/eslint-8.1.0
Bump eslint from 8.0.1 to 8.1.0
2021-10-26 23:11:45 -04:00
Trevor Buckner
55c175d9dd Merge pull request #1775 from G-Ambatte/fixDockerNodeConfig-#1767
[Docker] Shift to Alpine base image
2021-10-26 23:10:25 -04:00
G.Ambatte
da2dfd3736 Shift from 16.11 to 16.11-alpine with git added 2021-10-26 19:15:58 +13:00
dependabot[bot]
bf489513dc Bump marked from 3.0.7 to 3.0.8
Bumps [marked](https://github.com/markedjs/marked) from 3.0.7 to 3.0.8.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Changelog](https://github.com/markedjs/marked/blob/master/release.config.js)
- [Commits](https://github.com/markedjs/marked/compare/v3.0.7...v3.0.8)

---
updated-dependencies:
- dependency-name: marked
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-25 03:00:59 +00:00
dependabot[bot]
56054e2607 Bump eslint from 8.0.1 to 8.1.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.0.1 to 8.1.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.0.1...v8.1.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-25 03:00:36 +00:00
Trevor Buckner
732021f5a5 Merge pull request #1769 from naturalcrit/FixStartingUndoOnNewPage
Fix starting undo on new page
2021-10-24 19:10:58 -04:00
Trevor Buckner
34293bcc1d Merge pull request #1763 from naturalcrit/keepHistoryOnTabSwitch
use CodeMirror Documents
2021-10-24 19:04:14 -04:00
Trevor Buckner
ddb12ffbe2 Make sure initial tab loads with language for code highlighting 2021-10-24 18:03:10 -04:00
Trevor Buckner
47b99a24fb Clear out unneeded style when editor is hidden in Metadata panel 2021-10-24 16:46:46 -04:00
Trevor Buckner
a4e0768105 Move Localstorage load to GetInitialState
Prevents the extra change to the CodeMirror document which was creating a starting "undo" history point that would blank out the page.
2021-10-24 16:42:39 -04:00
Trevor Buckner
11f7e3b8fc Merge pull request #1768 from G-Ambatte/fixDockerNodeConfig-#1767
Up Dockerfile Node version
2021-10-24 11:26:22 -04:00
G.Ambatte
e42c346ebc Up Dockerfile Node version 2021-10-23 14:21:06 +13:00
Trevor Buckner
23799b8d41 Merge pull request #1765 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.0.12
Bump mongoose from 6.0.11 to 6.0.12
2021-10-21 23:47:14 -04:00
dependabot[bot]
9515e13ce5 Bump mongoose from 6.0.11 to 6.0.12
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.0.11 to 6.0.12.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Automattic/mongoose/compare/6.0.11...6.0.12)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-22 03:01:17 +00:00
Trevor Buckner
e1d7a363ef Merge pull request #1760 from G-Ambatte/fixDivider-#1674
Limit divider position
2021-10-20 10:55:28 -04:00
Trevor Buckner
63d659ff49 use CodeMirror Documents
Instead of re-building the whole editor box with every tab switch, we just swap in and out CodeMirror "documents".

Maintains undo history, scroll position, highlight coloring, etc.
2021-10-19 23:49:11 -04:00
G.Ambatte
dbf6020194 Darken divider on hover 2021-10-19 23:19:26 +13:00
Trevor Buckner
b5ad75bcf2 Merge pull request #1761 from naturalcrit/dependabot/npm_and_yarn/googleapis-89.0.0
Bump googleapis from 88.2.0 to 89.0.0
2021-10-18 23:33:17 -04:00
dependabot[bot]
67d3c44017 Bump googleapis from 88.2.0 to 89.0.0
Bumps [googleapis](https://github.com/googleapis/google-api-nodejs-client) from 88.2.0 to 89.0.0.
- [Release notes](https://github.com/googleapis/google-api-nodejs-client/releases)
- [Changelog](https://github.com/googleapis/google-api-nodejs-client/blob/main/CHANGELOG.md)
- [Commits](https://github.com/googleapis/google-api-nodejs-client/compare/googleapis-v88.2.0...googleapis-v89.0.0)

---
updated-dependencies:
- dependency-name: googleapis
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-19 03:00:46 +00:00
G.Ambatte
3b37cacea2 Limit position to min/max window limits 2021-10-19 15:04:53 +13:00
G.Ambatte
a2a6a3d3f6 Add limits to central divider position 2021-10-19 14:39:51 +13:00
Trevor Buckner
e9b9c87188 Merge pull request #1701 from G-Ambatte/addEditorBar
Editor Toolbar - Undo and Redo.
2021-10-18 15:18:20 -04:00
G.Ambatte
fec6aacee5 Add word-break: break-word to fix code wrapping 2021-10-18 22:51:17 +13:00
G.Ambatte
941159425b Merge branch 'addEditorBar' of https://github.com/G-Ambatte/homebrewery into addEditorBar 2021-10-18 22:30:55 +13:00
G.Ambatte
f33cd39300 Add conditional highlighting to Undo/Redo 2021-10-18 22:29:27 +13:00
G.Ambatte
8983960ca8 Add divider and tool active class 2021-10-18 22:29:27 +13:00
G.Ambatte
9dd885e7eb Move Undo/Redo to SnippetBar 2021-10-18 22:29:26 +13:00
G.Ambatte
ab2900cadf Expose CodeMirror functions in codeEditor.jsx 2021-10-18 22:29:25 +13:00
Sean Robertson
bfcb29ff9c Reduce CodeMirror codeEditor historyEventDelay to 250 2021-10-18 22:29:25 +13:00
G.Ambatte
9bc52b412c Initial pass at Editor Toolbar - Undo and Redo. 2021-10-18 22:29:25 +13:00
G.Ambatte
606a3c843d Add conditional highlighting to Undo/Redo 2021-10-18 22:26:34 +13:00
G.Ambatte
5b3953094e Add divider and tool active class 2021-10-18 21:39:01 +13:00
Trevor Buckner
aec8133046 Merge pull request #1755 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.0.11
Bump mongoose from 6.0.10 to 6.0.11
2021-10-14 23:06:52 -04:00
dependabot[bot]
97cad9f52c Bump mongoose from 6.0.10 to 6.0.11
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.0.10 to 6.0.11.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Automattic/mongoose/compare/6.0.10...6.0.11)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-15 03:01:06 +00:00
Trevor Buckner
44d4198f69 Merge pull request #1754 from naturalcrit/dependabot/npm_and_yarn/eslint-8.0.1
Bump eslint from 8.0.0 to 8.0.1
2021-10-14 00:46:14 -04:00
Trevor Buckner
432cce4ccf Merge pull request #1753 from naturalcrit/dependabot/npm_and_yarn/nanoid-3.1.30
Bump nanoid from 3.1.29 to 3.1.30
2021-10-14 00:45:59 -04:00
Trevor Buckner
7eb43b7c61 Merge pull request #1752 from naturalcrit/DropdownButtonComponent
Working dropdown component
2021-10-14 00:45:42 -04:00
Trevor Buckner
feb8fcadd6 Animate dropdown 2021-10-14 00:40:51 -04:00
Trevor Buckner
872125515e Apply to Edit page 2021-10-14 00:03:22 -04:00
dependabot[bot]
cb9bb37234 Bump eslint from 8.0.0 to 8.0.1
Bumps [eslint](https://github.com/eslint/eslint) from 8.0.0 to 8.0.1.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v8.0.0...v8.0.1)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-14 03:01:26 +00:00
dependabot[bot]
d223f5e21d Bump nanoid from 3.1.29 to 3.1.30
Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.29 to 3.1.30.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.1.29...3.1.30)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-14 03:00:50 +00:00
Trevor Buckner
b9891d1c08 Merge pull request #1751 from naturalcrit/dependabot/npm_and_yarn/codemirror-5.63.3
Bump codemirror from 5.63.1 to 5.63.3
2021-10-13 11:58:33 -04:00
Trevor Buckner
a695540f60 Working dropdown component on the Share Page 2021-10-13 11:53:01 -04:00
dependabot[bot]
414ae1b7e9 Bump codemirror from 5.63.1 to 5.63.3
Bumps [codemirror](https://github.com/codemirror/CodeMirror) from 5.63.1 to 5.63.3.
- [Release notes](https://github.com/codemirror/CodeMirror/releases)
- [Changelog](https://github.com/codemirror/CodeMirror/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codemirror/CodeMirror/compare/5.63.1...5.63.3)

---
updated-dependencies:
- dependency-name: codemirror
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-13 03:00:41 +00:00
Trevor Buckner
2b2869dc47 Merge pull request #1750 from naturalcrit/Make-V3-Welcome-use-all-V3-syntax
Make V3 Welcome page use all V3 syntax
2021-10-12 22:40:49 -04:00
Trevor Buckner
8244b59b57 Update welcome_msg_v3.md 2021-10-12 22:38:16 -04:00
Trevor Buckner
e1a3d8c303 Merge pull request #1676 from Gazook89/FAQ-Page
Update the FAQ
2021-10-12 22:27:46 -04:00
Trevor Buckner
9add142edf Tweak v3 welcome to fit in page 2021-10-12 22:25:38 -04:00
Gazook89
1ff8308647 add link to FAQ in welcome pages 2021-10-11 20:31:13 -05:00
Gazook89
b6739483ee update faq.md with revisions from calculuschild. 2021-10-11 18:26:10 -05:00
Gazook89
2d0569ed22 Create a FAQ.md doc for use within HB
Just the document for this commit.
2021-10-11 18:25:41 -05:00
Trevor Buckner
7cba892778 Merge pull request #1747 from naturalcrit/dependabot/npm_and_yarn/eslint-8.0.0
Bump eslint from 7.32.0 to 8.0.0
2021-10-11 14:52:12 -04:00
dependabot[bot]
b2814947df Bump eslint from 7.32.0 to 8.0.0
Bumps [eslint](https://github.com/eslint/eslint) from 7.32.0 to 8.0.0.
- [Release notes](https://github.com/eslint/eslint/releases)
- [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/eslint/eslint/compare/v7.32.0...v8.0.0)

---
updated-dependencies:
- dependency-name: eslint
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-11 17:12:15 +00:00
Trevor Buckner
b65295b1df Merge pull request #1748 from naturalcrit/Update-CircleCi-to-Node16+Mongo4.4
Update Circleci config to node16 and mongo4.4
2021-10-11 13:10:25 -04:00
Trevor Buckner
a31ad79eec 16.11 not available yet in circleci. Back to 16.10 2021-10-11 13:09:38 -04:00
Trevor Buckner
8fffdc83cf Update config.yml 2021-10-11 13:07:25 -04:00
Trevor Buckner
0a41f72d37 Update to Node v16 2021-10-11 12:44:05 -04:00
Trevor Buckner
7086524cf3 Merge pull request #1745 from G-Ambatte/updateWelcomePageLink-#1744
Update Unearthed Arcana links
2021-10-10 23:03:51 -04:00
Trevor Buckner
9f1f7f272a Merge pull request #1746 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.0.10
Bump mongoose from 6.0.9 to 6.0.10
2021-10-10 23:02:40 -04:00
dependabot[bot]
9900e3194e Bump mongoose from 6.0.9 to 6.0.10
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.0.9 to 6.0.10.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Automattic/mongoose/compare/6.0.9...6.0.10)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-11 03:00:44 +00:00
G.Ambatte
c1d0bdbf03 Update links 2021-10-10 16:13:36 +13:00
Trevor Buckner
f90f956364 Merge pull request #1743 from naturalcrit/dependabot/npm_and_yarn/marked-3.0.7
Bump marked from 3.0.4 to 3.0.7
2021-10-08 09:28:50 -04:00
dependabot[bot]
088702f4d6 Bump marked from 3.0.4 to 3.0.7
Bumps [marked](https://github.com/markedjs/marked) from 3.0.4 to 3.0.7.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Changelog](https://github.com/markedjs/marked/blob/master/release.config.js)
- [Commits](https://github.com/markedjs/marked/compare/v3.0.4...v3.0.7)

---
updated-dependencies:
- dependency-name: marked
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-08 03:00:34 +00:00
Trevor Buckner
d4fedf62de Merge pull request #1726 from G-Ambatte/fixPrintPageRenderer-#1702
Get renderer information from localStorage when printing from `/new`
2021-10-07 22:32:49 -04:00
Trevor Buckner
1f4ffa6785 Use same brew object throughout
Rather than using separate `brewText` and `styleText` state variables when printing from /new, just load the files into the same `brew` object the rest of the page uses.

Also load localstorage in the same way as on `/new` via BREWKEY and STYLEKEY for consistency, rather than passing it in as a separate `brew` item in localstorage
2021-10-07 22:01:53 -04:00
Trevor Buckner
749f4ca6aa Merge pull request #1732 from Gazook89/Share-to-Reddit-and-Copy-Share-URL-to-Clipboard
Add Share to Reddit and Copy Share URL to Share Menu
2021-10-07 16:49:28 -04:00
Trevor Buckner
2511b1d832 Merge pull request #1740 from naturalcrit/dependabot/npm_and_yarn/babel/plugin-transform-runtime-7.15.8
Bump @babel/plugin-transform-runtime from 7.15.0 to 7.15.8
2021-10-07 09:49:50 -04:00
dependabot[bot]
f3c29f4c24 Bump @babel/plugin-transform-runtime from 7.15.0 to 7.15.8
Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.15.0 to 7.15.8.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.15.8/packages/babel-plugin-transform-runtime)

---
updated-dependencies:
- dependency-name: "@babel/plugin-transform-runtime"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-07 03:09:46 +00:00
Trevor Buckner
950c78fda2 Merge pull request #1741 from naturalcrit/dependabot/npm_and_yarn/babel/preset-env-7.15.8
Bump @babel/preset-env from 7.15.6 to 7.15.8
2021-10-06 23:08:36 -04:00
Trevor Buckner
6910a2b2ad Merge pull request #1739 from naturalcrit/dependabot/npm_and_yarn/babel/core-7.15.8
Bump @babel/core from 7.15.5 to 7.15.8
2021-10-06 23:08:22 -04:00
dependabot[bot]
bcea9875d5 Bump @babel/preset-env from 7.15.6 to 7.15.8
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.15.6 to 7.15.8.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.15.8/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-07 03:01:30 +00:00
dependabot[bot]
9d839a037c Bump @babel/core from 7.15.5 to 7.15.8
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.15.5 to 7.15.8.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.15.8/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-07 03:00:52 +00:00
Trevor Buckner
063f71037d Merge pull request #1738 from naturalcrit/v3.0.2
Up version to v3.0.2
2021-10-06 12:17:00 -04:00
Trevor Buckner
56037a2dca Up version to v3.0.2 2021-10-06 12:16:39 -04:00
Trevor Buckner
0cf3d3c883 Merge pull request #1733 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.0.9
Bump mongoose from 6.0.8 to 6.0.9
2021-10-06 11:39:08 -04:00
dependabot[bot]
3f21e40e62 Bump mongoose from 6.0.8 to 6.0.9
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.0.8 to 6.0.9.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Automattic/mongoose/compare/6.0.8...6.0.9)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-06 14:06:19 +00:00
Trevor Buckner
64cb0ba146 Merge pull request #1737 from naturalcrit/dependabot/npm_and_yarn/nanoid-3.1.29
Bump nanoid from 3.1.28 to 3.1.29
2021-10-06 10:05:40 -04:00
dependabot[bot]
67931dfcf9 Bump nanoid from 3.1.28 to 3.1.29
Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.28 to 3.1.29.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.1.28...3.1.29)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-06 03:01:17 +00:00
Trevor Buckner
c8e27d209c Merge pull request #1592 from Gazook89/changelog-link
Move Change Log link to Version Number, add Report Issue to User Page
2021-10-05 22:43:39 -04:00
G.Ambatte
96af13b71f Move Undo/Redo to SnippetBar 2021-10-05 20:25:24 +13:00
G.Ambatte
fbabae8793 Expose CodeMirror functions in codeEditor.jsx 2021-10-05 20:24:45 +13:00
Gazook89
99d2648901 small change to changelog header 2021-10-04 18:52:58 -05:00
Gazook89
700f84adec add import issue.navitem.jsx to user page 2021-10-04 18:50:52 -05:00
Sean Robertson
09b1543660 Reduce CodeMirror codeEditor historyEventDelay to 250 2021-10-05 10:50:13 +13:00
Sean Robertson
213a469dd0 Correct stringify to parse 2021-10-05 10:40:38 +13:00
Gazook89
45101b7c09 Add Share to Reddit and Copy Share URL to Share Menu 2021-10-04 16:34:40 -05:00
Trevor Buckner
c9f9b87a6d Merge branch 'master' into pr/1592 2021-10-01 14:51:49 -04:00
Trevor Buckner
dd09aab191 Merge pull request #1728 from naturalcrit/dependabot/npm_and_yarn/eslint-plugin-react-7.26.1
Bump eslint-plugin-react from 7.26.0 to 7.26.1
2021-10-01 14:43:46 -04:00
Trevor Buckner
7bab65c138 Merge pull request #1727 from naturalcrit/dependabot/npm_and_yarn/googleapis-88.2.0
Bump googleapis from 87.0.0 to 88.2.0
2021-10-01 14:43:39 -04:00
dependabot[bot]
3da56f28f8 Bump eslint-plugin-react from 7.26.0 to 7.26.1
Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.26.0 to 7.26.1.
- [Release notes](https://github.com/yannickcr/eslint-plugin-react/releases)
- [Changelog](https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yannickcr/eslint-plugin-react/compare/v7.26.0...v7.26.1)

---
updated-dependencies:
- dependency-name: eslint-plugin-react
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-01 03:01:05 +00:00
dependabot[bot]
83630e1fde Bump googleapis from 87.0.0 to 88.2.0
Bumps [googleapis](https://github.com/googleapis/google-api-nodejs-client) from 87.0.0 to 88.2.0.
- [Release notes](https://github.com/googleapis/google-api-nodejs-client/releases)
- [Changelog](https://github.com/googleapis/google-api-nodejs-client/blob/main/CHANGELOG.md)
- [Commits](https://github.com/googleapis/google-api-nodejs-client/compare/googleapis-v87.0.0...googleapis-v88.2.0)

---
updated-dependencies:
- dependency-name: googleapis
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-01 03:00:44 +00:00
Trevor Buckner
4a222ad16d Merge pull request #1724 from G-Ambatte/fixQRCodeOnNew-#1710
Fix QR code snippet when `brew.shareId` doesn't exist
2021-09-30 21:07:51 -04:00
Trevor Buckner
d9893e29ff Update client/homebrew/editor/snippetbar/snippets/snippets.js 2021-09-30 21:06:25 -04:00
Trevor Buckner
bdfc6bc1fa Merge pull request #1721 from naturalcrit/dependabot/npm_and_yarn/codemirror-5.63.1
Bump codemirror from 5.63.0 to 5.63.1
2021-09-30 21:04:19 -04:00
Sean Robertson
41c1b04f0e Get renderer information from localStorage when printing from /new
Default to `legacy`.
2021-10-01 13:31:09 +13:00
Sean Robertson
f69f73fcda Revert "Update to use dedent in the same manner as other snippets"
This reverts commit b24c3527ca.
2021-10-01 13:03:08 +13:00
Sean Robertson
b24c3527ca Update to use dedent in the same manner as other snippets 2021-10-01 12:44:28 +13:00
Gazook89
3bf5d7a2db change makeComment function to adapt to gfm or css editor 2021-09-30 17:59:45 -05:00
Sean Robertson
68f9b0d8ff Fix QR code snippet when brew.shareId doesn't exist 2021-10-01 11:39:00 +13:00
Gazook89
e14c5442e0 Merge remote-tracking branch 'upstream/master' into Hotkey-Mania 2021-09-30 09:20:35 -05:00
dependabot[bot]
643eb5a5c7 Bump codemirror from 5.63.0 to 5.63.1
Bumps [codemirror](https://github.com/codemirror/CodeMirror) from 5.63.0 to 5.63.1.
- [Release notes](https://github.com/codemirror/CodeMirror/releases)
- [Changelog](https://github.com/codemirror/CodeMirror/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codemirror/CodeMirror/compare/5.63.0...5.63.1)

---
updated-dependencies:
- dependency-name: codemirror
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-30 03:00:54 +00:00
Trevor Buckner
2401993018 Merge pull request #1586 from Gazook89/CodeMirror-Page-Break-Style-Tweak
Update editor.less for .pageLine
2021-09-29 21:00:00 -04:00
Trevor Buckner
9e61bab336 Merge pull request #1714 from naturalcrit/dependabot/npm_and_yarn/nanoid-3.1.28
Bump nanoid from 3.1.25 to 3.1.28
2021-09-29 15:31:18 -04:00
dependabot[bot]
fc60ac3fb0 Bump nanoid from 3.1.25 to 3.1.28
Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.25 to 3.1.28.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.1.25...3.1.28)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-29 19:30:41 +00:00
Trevor Buckner
9e99c1729d Merge pull request #1717 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.0.8
Bump mongoose from 6.0.7 to 6.0.8
2021-09-29 15:29:21 -04:00
Gazook89
39f745639f remove gradient, set counter to start at '2' 2021-09-28 20:06:29 -05:00
Gazook89
40a75b9b27 increment ordered list numbering 2021-09-28 16:09:00 -05:00
Gazook89
63c59a223a refine removal of lists regardless if UL or OL
Next step after this is to get numbered lists to increase
2021-09-28 14:34:31 -05:00
Gazook89
6717692187 finish UL creation/removal function 2021-09-28 11:19:02 -05:00
dependabot[bot]
f78a9f9112 Bump mongoose from 6.0.7 to 6.0.8
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.0.7 to 6.0.8.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Automattic/mongoose/compare/6.0.7...6.0.8)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-28 03:00:56 +00:00
Gazook89
41609f90ea update to detect if an unordered list or not. 2021-09-27 21:34:09 -05:00
Gazook89
cb0f5217fe get and set selection to cover entire lines 2021-09-27 21:23:05 -05:00
Gazook89
ba9413eae5 initial commit, add hotkey definitions 2021-09-27 09:31:59 -05:00
Gazook89
b3e37dd2c1 add comment about trying capture groups in future. 2021-09-23 01:01:02 -05:00
Gazook89
beb3c7ec89 make undo behavior work regardless of url text 2021-09-23 00:22:40 -05:00
Rodrigo Kuerten
c10bdabee0 Added h1 and h2 & cmd version 2021-09-22 18:21:34 -03:00
Trevor Buckner
4e24f0dd4b Merge branch 'master' into pr/1586 2021-09-21 23:37:21 -04:00
Trevor Buckner
723232659f Merge pull request #1572 from Gazook89/Style-Editor-Menu-and-comments
CSS Commenting + New "Style Editor" snippet menu
2021-09-21 23:34:53 -04:00
Trevor Buckner
eb7340434e Revert dropcap background to background-image
Changing to just `background` undoes `background-clip` as well. This is more explicit.
2021-09-21 23:31:08 -04:00
Trevor Buckner
3c1ecf1292 Fix merge 2021-09-21 22:59:25 -04:00
Trevor Buckner
5f11607358 Merge branch 'master' into pr/1572 2021-09-21 22:53:49 -04:00
Trevor Buckner
7e727ada94 Merge branch 'master' into pr/1568 2021-09-21 22:41:37 -04:00
Rodrigo Kuerten
bbad4b9e8a Removed H1 and H2 options and updated cursor after added hashtags 2021-09-21 17:25:37 -03:00
Rodrigo Kuerten
ec2c74f093 Created base make header functions 2021-09-21 17:11:07 -03:00
Trevor Buckner
c20fa90c3f Merge pull request #1706 from naturalcrit/dependabot/npm_and_yarn/codemirror-5.63.0
Bump codemirror from 5.62.3 to 5.63.0
2021-09-21 07:55:50 -04:00
Trevor Buckner
8135ee53ba Merge pull request #1705 from naturalcrit/dependabot/npm_and_yarn/eslint-plugin-react-7.26.0
Bump eslint-plugin-react from 7.25.3 to 7.26.0
2021-09-21 07:55:02 -04:00
Trevor Buckner
61d4b7fcec Merge pull request #1704 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.0.7
Bump mongoose from 6.0.6 to 6.0.7
2021-09-21 07:54:53 -04:00
dependabot[bot]
2ea5148c4a Bump codemirror from 5.62.3 to 5.63.0
Bumps [codemirror](https://github.com/codemirror/CodeMirror) from 5.62.3 to 5.63.0.
- [Release notes](https://github.com/codemirror/CodeMirror/releases)
- [Changelog](https://github.com/codemirror/CodeMirror/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codemirror/CodeMirror/compare/5.62.3...5.63.0)

---
updated-dependencies:
- dependency-name: codemirror
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-21 03:01:53 +00:00
dependabot[bot]
8084786718 Bump eslint-plugin-react from 7.25.3 to 7.26.0
Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.25.3 to 7.26.0.
- [Release notes](https://github.com/yannickcr/eslint-plugin-react/releases)
- [Changelog](https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yannickcr/eslint-plugin-react/compare/v7.25.3...v7.26.0)

---
updated-dependencies:
- dependency-name: eslint-plugin-react
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-21 03:01:28 +00:00
dependabot[bot]
2ab010acad Bump mongoose from 6.0.6 to 6.0.7
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.0.6 to 6.0.7.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Automattic/mongoose/compare/6.0.6...6.0.7)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-21 03:01:04 +00:00
Trevor Buckner
b10bd6ac12 Merge pull request #1703 from naturalcrit/dependabot/npm_and_yarn/eslint-plugin-react-7.25.3
Bump eslint-plugin-react from 7.25.1 to 7.25.3
2021-09-19 23:09:34 -04:00
dependabot[bot]
b4a658cac5 Bump eslint-plugin-react from 7.25.1 to 7.25.3
Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.25.1 to 7.25.3.
- [Release notes](https://github.com/yannickcr/eslint-plugin-react/releases)
- [Changelog](https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yannickcr/eslint-plugin-react/compare/v7.25.1...v7.25.3)

---
updated-dependencies:
- dependency-name: eslint-plugin-react
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-20 03:00:37 +00:00
G.Ambatte
508eee3f95 Initial pass at Editor Toolbar - Undo and Redo. 2021-09-19 19:26:44 +12:00
Trevor Buckner
6e38b673ac Merge pull request #1698 from naturalcrit/v3.0.1
Update changelog and version to 3.0.1
2021-09-18 00:37:44 -04:00
Trevor Buckner
f168bf94e1 Merge pull request #1693 from Gazook89/fix-print-page-footer-issue
Add `.pages` container div to printPage.jsx
2021-09-17 21:52:14 -04:00
Trevor Buckner
875e8b59a6 Update changelog and version to 3.0.1 2021-09-17 13:57:07 -04:00
Trevor Buckner
f25d8e13c2 Merge pull request #1697 from naturalcrit/dependabot/npm_and_yarn/googleapis-87.0.0
Bump googleapis from 86.1.0 to 87.0.0
2021-09-17 12:17:11 -04:00
dependabot[bot]
356c062ce5 Bump googleapis from 86.1.0 to 87.0.0
Bumps [googleapis](https://github.com/googleapis/google-api-nodejs-client) from 86.1.0 to 87.0.0.
- [Release notes](https://github.com/googleapis/google-api-nodejs-client/releases)
- [Changelog](https://github.com/googleapis/google-api-nodejs-client/blob/main/CHANGELOG.md)
- [Commits](https://github.com/googleapis/google-api-nodejs-client/compare/googleapis-v86.1.0...googleapis-v87.0.0)

---
updated-dependencies:
- dependency-name: googleapis
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-17 03:01:16 +00:00
Gazook89
80ea598ec2 match brewRenderer.jsx output to printPage.jsx output 2021-09-16 19:59:54 -05:00
Gazook89
837cacc992 add .page container div to printPage.jsx 2021-09-16 09:51:16 -05:00
Gazook89
1c88eb80c0 update v3 ink friendly again to remove .pages from css selector
having `.pages` included in the selector did not match the selectivity in the base .less sheet.  Oddly, it was working in the Edit Page, but not in the Print Page.
2021-09-15 16:30:30 -05:00
Gazook89
0de0c22e61 Update v3 ink-friendly snippet to reset drop-shadow rather than box-shadow 2021-09-15 16:14:14 -05:00
Gazook89
b8df5d083f update v3 drop cap snippets to .page 2021-09-15 15:45:58 -05:00
Trevor Buckner
3eee00bea7 Merge pull request #1689 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.0.6
Bump mongoose from 6.0.5 to 6.0.6
2021-09-15 15:16:34 -04:00
Trevor Buckner
a39a2898bb Merge pull request #1688 from naturalcrit/dependabot/npm_and_yarn/googleapis-86.1.0
Bump googleapis from 85.0.0 to 86.1.0
2021-09-15 15:01:42 -04:00
Trevor Buckner
c73a2184a0 Merge pull request #1690 from naturalcrit/AllowMonsterParagraphIndents
Fix typo in snippet
2021-09-15 14:57:28 -04:00
Trevor Buckner
aff764d91c Fix typo in snippet 2021-09-15 14:56:58 -04:00
Trevor Buckner
8e7fc47e2b Merge pull request #1687 from naturalcrit/dependabot/npm_and_yarn/dedent-tabs-0.10.1
Bump dedent-tabs from 0.10.0 to 0.10.1
2021-09-15 14:41:12 -04:00
dependabot[bot]
1f2809a913 Bump mongoose from 6.0.5 to 6.0.6
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.0.5 to 6.0.6.
- [Release notes](https://github.com/Automattic/mongoose/releases)
- [Changelog](https://github.com/Automattic/mongoose/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Automattic/mongoose/compare/6.0.5...6.0.6)

---
updated-dependencies:
- dependency-name: mongoose
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-15 18:40:48 +00:00
dependabot[bot]
f7b5cfc623 Bump googleapis from 85.0.0 to 86.1.0
Bumps [googleapis](https://github.com/googleapis/google-api-nodejs-client) from 85.0.0 to 86.1.0.
- [Release notes](https://github.com/googleapis/google-api-nodejs-client/releases)
- [Changelog](https://github.com/googleapis/google-api-nodejs-client/blob/main/CHANGELOG.md)
- [Commits](https://github.com/googleapis/google-api-nodejs-client/compare/googleapis-v85.0.0...googleapis-v86.1.0)

---
updated-dependencies:
- dependency-name: googleapis
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-15 18:40:37 +00:00
dependabot[bot]
74e746ace9 Bump dedent-tabs from 0.10.0 to 0.10.1
Bumps [dedent-tabs](https://github.com/adrianjost/dedent-tabs) from 0.10.0 to 0.10.1.
- [Release notes](https://github.com/adrianjost/dedent-tabs/releases)
- [Commits](https://github.com/adrianjost/dedent-tabs/compare/v0.10.0...v0.10.1)

---
updated-dependencies:
- dependency-name: dedent-tabs
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-15 18:40:18 +00:00
Trevor Buckner
3b64cb43c1 Merge pull request #1684 from G-Ambatte/addFAQ-#810
Add FAQ page, using current FAQ from the subreddit
2021-09-15 14:37:23 -04:00
Trevor Buckner
ca491067f1 linting 2021-09-15 14:36:34 -04:00
Trevor Buckner
0ff5af5e0b Merge pull request #1583 from G-Ambatte/fixMarkdownTags-#432
Fix incorrect detection of unclosed <a> tag
2021-09-15 14:34:16 -04:00
Trevor Buckner
85650cdfb3 Merge pull request #1686 from naturalcrit/updateMongooseTov6
Migrate Mongoose to v6
2021-09-15 14:16:08 -04:00
Trevor Buckner
0e4c830435 Migrate Mongoose to v6 2021-09-15 14:15:44 -04:00
Trevor Buckner
570c1a9b5f Merge pull request #1680 from naturalcrit/AllowMonsterParagraphIndents
[v3] Better Paragraph formatting in Monster blocks
2021-09-15 14:02:51 -04:00
Trevor Buckner
22e54636d4 Fix partial page rendering on v3
"dummy pages" on v3 were unstyled, giving them very small height which led to a cycle of pages changing size, which shifted other pages into view, which changed their sizes, etc.
2021-09-15 14:02:19 -04:00
Trevor Buckner
3e8f9b18d0 Merge pull request #1683 from naturalcrit/dependabot/npm_and_yarn/marked-3.0.4
Bump marked from 3.0.3 to 3.0.4
2021-09-15 09:14:19 -04:00
G.Ambatte
8f0b3ff569 Add FAQ page, using current FAQ from the subreddit 2021-09-15 18:46:32 +12:00
dependabot[bot]
c1dadff525 Bump marked from 3.0.3 to 3.0.4
Bumps [marked](https://github.com/markedjs/marked) from 3.0.3 to 3.0.4.
- [Release notes](https://github.com/markedjs/marked/releases)
- [Changelog](https://github.com/markedjs/marked/blob/master/release.config.js)
- [Commits](https://github.com/markedjs/marked/compare/v3.0.3...v3.0.4)

---
updated-dependencies:
- dependency-name: marked
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-15 03:00:58 +00:00
G.Ambatte
bb87281057 Apply changes to markdownLegacy.js 2021-09-15 13:21:34 +12:00
Trevor Buckner
1690c3b977 Merge pull request #1605 from G-Ambatte/addToolTipToTimeSinceUpdate
Add tooltip to the Time Since Last Update `info <span>`
2021-09-14 15:13:55 -04:00
Trevor Buckner
470de383bd Merge pull request #1606 from G-Ambatte/rearrangeBrewItemMetaData
Rearrange BrewItem metadata items - put `authors` first on it's own line
2021-09-14 15:11:01 -04:00
Trevor Buckner
239a384281 Merge pull request #1681 from naturalcrit/Clean_Legacy_Snippet_SplitTable
Remove backticks from splitTable
2021-09-14 13:11:12 -04:00
Trevor Buckner
ed6a0ef29b Remove backticks from splitTable 2021-09-14 13:09:53 -04:00
Trevor Buckner
d1ffab5487 Update Monster styles and snippets. 2021-09-14 12:17:28 -04:00
Trevor Buckner
d0cddcfb91 Merge pull request #1640 from naturalcrit/dependabot/npm_and_yarn/dedent-tabs-0.10.0
Bump dedent-tabs from 0.9.0 to 0.10.0
2021-09-13 23:56:58 -04:00
Trevor Buckner
07729a7529 Merge pull request #1617 from blitzher/master
Moved server start log to `app.listen` callback
2021-09-13 22:44:15 -04:00
Trevor Buckner
d002485636 Merge pull request #1678 from naturalcrit/changeMinWidthToWidth
Change .block min-width to width
2021-09-13 22:43:19 -04:00
Trevor Buckner
2192c91acb Change .block min-width to width so users can resize position:absolute elements easier. 2021-09-13 22:40:36 -04:00
Trevor Buckner
2ea8d8e152 Merge pull request #1659 from naturalcrit/dependabot/npm_and_yarn/babel/preset-env-7.15.6
Bump @babel/preset-env from 7.15.4 to 7.15.6
2021-09-11 23:33:01 -04:00
dependabot[bot]
7a176c494f Bump @babel/preset-env from 7.15.4 to 7.15.6
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.15.4 to 7.15.6.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.15.6/packages/babel-preset-env)

---
updated-dependencies:
- dependency-name: "@babel/preset-env"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-12 03:24:16 +00:00
Trevor Buckner
0541b5baad Merge pull request #1639 from naturalcrit/dependabot/npm_and_yarn/babel/core-7.15.5
Bump @babel/core from 7.15.0 to 7.15.5
2021-09-11 23:23:27 -04:00
Gazook89
eee343c197 change tack, keep border on bottom but add page counter 2021-09-11 16:12:47 -05:00
Gazook89
bec2a7c77a add hotkeys for new \page and \column 2021-09-11 00:12:58 -05:00
Gazook89
389ad1cf17 add hotkeys for &nbsp; and empty <spans>
makeNbsp, makeSpace, removeSpace
2021-09-10 23:18:23 -05:00
Gazook89
7dcd335630 add makeDiv hotkey - V3 Curly Divs
Shift-Cmd/Ctrl-M  makes a curly div.
2021-09-06 21:12:48 -05:00
Gazook89
08c845ff00 add underline hotkey and change italic hotkey to *
Using `*` rather than `_` characters for italics is more inline with existing snippets.
2021-09-06 20:35:55 -05:00
blitzher
5445f950c5 Merge branch 'naturalcrit:master' into master 2021-09-06 10:00:38 +02:00
dependabot[bot]
85447e0b6a Bump @babel/core from 7.15.0 to 7.15.5
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.15.0 to 7.15.5.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.15.5/packages/babel-core)

---
updated-dependencies:
- dependency-name: "@babel/core"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-06 04:41:08 +00:00
dependabot[bot]
6d6beb23b1 Bump dedent-tabs from 0.9.0 to 0.10.0
Bumps [dedent-tabs](https://github.com/adrianjost/dedent-tabs) from 0.9.0 to 0.10.0.
- [Release notes](https://github.com/adrianjost/dedent-tabs/releases)
- [Commits](https://github.com/adrianjost/dedent-tabs/compare/v0.9.0...v0.10.0)

---
updated-dependencies:
- dependency-name: dedent-tabs
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-06 03:01:02 +00:00
Gazook89
ae75eb07b7 matched functionality of link hotkey in github 2021-09-05 20:33:51 -05:00
Gazook89
ad5d7d2097 added dedents 2021-09-05 16:21:23 -05:00
Gazook89
3063337eb2 update v3 drop cap tweak to match new styling
and change v3 drop cap to use only `background` rather than `background-image` so that the tweak snippet can easily change between gradient and just a regular color.

and re-order table menu so that the regular table snippet is at top.
2021-09-05 15:40:08 -05:00
Gazook89
cf5a1cee24 Merge remote-tracking branch 'upstream/master' into Style-Editor-Menu-and-comments 2021-09-05 15:11:58 -05:00
blitzher
7f0029d8a4 Merge branch 'naturalcrit:master' into master 2021-08-31 19:41:10 +02:00
blitzher
c541fd551e Removed spaces before and after arrow in callback function 2021-08-29 00:54:51 +02:00
blitzher
2b89efc923 Moved server start log to app.listen callback 2021-08-29 00:49:13 +02:00
G.Ambatte
755d8591aa Add small gap to keep Google Drive icon clear of characters in brew author's name.
Remove unnecessary/incorrect `display` line.
2021-08-26 12:48:02 +12:00
G.Ambatte
ea493ac1a5 Rearrange BrewItem metadata items - put authors first on it's own line 2021-08-26 11:49:21 +12:00
Trevor Buckner
9af41b2dc4 rename dedent-tabs to dedent to match usage elsewhere in HB 2021-08-25 13:34:16 -04:00
G.Ambatte
57940bc994 Add tooltip to the Time Since Last Update info <span> 2021-08-25 18:14:13 +12:00
Gazook89
e80e4827a8 add Report Issue to user page 2021-08-20 14:58:28 -05:00
Gazook89
b11d130393 Update changelog.md to include link to github 2021-08-20 14:57:43 -05:00
Gazook89
af8ac832fd Move ChangeLog link to Version Number 2021-08-20 14:31:56 -05:00
Gazook89
0db37bc204 Update editor.less for .pageLine
Change the .pageLine (page break) border from bottom to top, since any text on the same line is part of the following page rather than the preceding page.
2021-08-17 19:47:23 -05:00
G.Ambatte
c051ec19f2 Add voidTags whitelist and functionality 2021-08-17 20:50:41 +12:00
G.Ambatte
2be0d82a35 Fix typo. 2021-08-17 20:37:07 +12:00
G.Ambatte
bdfcde7661 Fix issue with <a>/<aside> 2021-08-17 20:23:26 +12:00
Gazook89
4653fcd782 Remove reference to hotkeys in Style Comments
Removed reference to hotkeys for commenting in the Style Editor since that is not implemented yet.  can be added back to match the Text Editor commenting snippet once implemented.
2021-08-14 20:24:51 -05:00
Gazook89
84698aa68f Match changes in commit 143d390 to Legacy
Matching legacy to v3 (adds another menu to style editor, etc).
2021-08-14 20:18:11 -05:00
Gazook89
143d390895 Add "Style Editor" menu to Style pane
And other tweaks:
- Move drop caps snippets to Style Editor menu
- retitle Editor menu to either Text Editor or Style Editor
- minor:  removed old unnecessary comments in code from earlier (my own).
- Removed leading spaces on drop cap comment
- added drop cap comment on "remove drop caps" snippet.
2021-08-14 20:16:33 -05:00
Gazook89
8c03b453b2 circleCI fix 2021-08-13 08:31:41 -05:00
Gazook89
727a58f56d Fixed cursor finish position
- tested on single words and multi word strings
- tested removal of hyperlink
- tested with highlighting selection from left to right, and right to left.
- tested on empty strings
2021-08-13 08:28:02 -05:00
Gazook89
b89c10a298 Change cursor finish position
Change cursor finish position
2021-08-12 23:09:06 -05:00
Gazook89
5258e9f0e6 Add Hotkey Ctrl/Cmd + K to create Link 2021-08-12 22:41:34 -05:00
82 changed files with 11208 additions and 3758 deletions

View File

@@ -6,8 +6,8 @@ version: 2
jobs: jobs:
build: build:
docker: docker:
- image: circleci/node:12.16.3 - image: circleci/node:16.10.0
- image: circleci/mongo:3.4-jessie - image: circleci/mongo:4.4
working_directory: ~/repo working_directory: ~/repo

View File

@@ -1,4 +1,5 @@
FROM node:14.15 FROM node:16.11-alpine
RUN apk --no-cache add git
ENV NODE_ENV=docker ENV NODE_ENV=docker

View File

@@ -3,11 +3,12 @@ h5 {
font-size: .35cm !important; font-size: .35cm !important;
} }
.taskList li { .page ul ul {
list-style-type : none; margin-left: 0px;
} }
.taskList li input { .taskList li input {
list-style-type : none;
margin-left : -0.52cm; margin-left : -0.52cm;
transform: translateY(.05cm); transform: translateY(.05cm);
filter: brightness(1.1) drop-shadow(1px 2px 1px #222); filter: brightness(1.1) drop-shadow(1px 2px 1px #222);
@@ -30,7 +31,194 @@ pre {
} }
``` ```
# changelog ## changelog
For a full record of development, visit our [Github Page](https://github.com/naturalcrit/homebrewery).
### Wednesday 02/02/2022 - v3.0.7
{{taskList
* [x] Revert active line highlighting.
Fixes issues: [#1913](https://github.com/naturalcrit/homebrewery/issues/1913)
* [x] Added install steps for Ubuntu. [HERE](https://github.com/naturalcrit/homebrewery/blob/master/install/README.UBUNTU.md)
Fixes issues: [#1900](https://github.com/naturalcrit/homebrewery/issues/1900)
* [x] Added social media links to home page.
* [x] Increase brews visible on the user page to 1,000.
Fixes issues: [#1943](https://github.com/naturalcrit/homebrewery/issues/1943)
* [x] Added a Legacy to V3 migration guide under **NEED HELP? {{fa,fa-question-circle}} → MIGRATE {{fas,fa-file-import}}**
* [x] Background refactoring and unit tests.
}}
### Saturday 18/12/2021 - v3.0.6
{{taskList
* [x] Fixed text wrapping for long strings in code blocks.
Fixes issues: [#1736](https://github.com/naturalcrit/homebrewery/issues/1736)
* [x] Code search/replace `CTRL F / CTRL SHIFT F`
Fixes issues: [#1201](https://github.com/naturalcrit/homebrewery/issues/1201)
* [x] Auto-closing HTML tags and curly braces `{{ }}`
* [x] Highlight current active line
Fixes issues: [#1202](https://github.com/naturalcrit/homebrewery/issues/1202)
* [x] Display tabs and trailing spaces
Fixes issues: [#1622](https://github.com/naturalcrit/homebrewery/issues/1622)
* [x] Make columns even in V3 Table of Contents.
Fixes issues: [#1671](https://github.com/naturalcrit/homebrewery/issues/1671)
* [x] Fix `CTRL P` failing to print from `/new` pages.
Fixes issues: [#1815](https://github.com/naturalcrit/homebrewery/issues/1815)
}}
\page
### Tuesday 07/12/2021 - v3.0.5
{{taskList
* [x] Fixed paragraph spacing for **note** and **descriptive** boxes in V3.
Fixes issues: [#1836](https://github.com/naturalcrit/homebrewery/issues/1836)
* [x] Added a whole bunch of hotkeys:
* Page Break `CTRL + ENTER`
* Column Break `CTRL + SHIFT + ENTER`
* Bulleted Lists `CTRL + L`
* Numbered Lists `CTRL + SHIFT + L`
* Headers `CTRL + SHIFT + (1-6)`
* Underline `CTRL + U`
* Link `CTRL + K`
* Non-breaking space (\&nbsp;) `CTRL + .`
* Add Horizontal Space `CTRL + SHIFT + .`
* Remove Horizontal Space `CTRL + SHIFT + ,`
* Curly Span `CTRL + M`
* Curly Div `CTRL + SHIFT + M`
* [x] Fixed page numbers in the editor panel getting scrambled when scrolling up and down.
* [x] Faster swapping between tabs on long brews.
* [x] Better error messages for common issue with Google Drive credentials expiring.
}}
### Wednesday 17/11/2021 - v3.0.4
{{taskList
* [x] Fixed incorrect sorting of Google brews by page count and views on the user page.
Fixes issues: [#1793](https://github.com/naturalcrit/homebrewery/issues/1793)
* [x] Added code folding! Only on a page-level for now. Hotkeys `CTRL + [` and `CTRL + ]` to fold/unfold all pages. (Thanks jeddai, new contributor!)
Fixes issues: [#629](https://github.com/naturalcrit/homebrewery/issues/629)
* [x] Fixed rendering issues due to the latest Chrome update to version 96. (Also thanks to jeddai!)
Fixes issues: [#1828](https://github.com/naturalcrit/homebrewery/issues/1828)
}}
### Wednesday 27/10/2021 - v3.0.3
{{taskList
* [x] Moved **Post To Reddit** button from {{fa,fa-info-circle}} **Properties** menu to the **SHARE** {{fa,fa-share-alt}} button as a dropdown.
* [x] Added a **Copy URL** button to the **SHARE** {{fa,fa-share-alt}} button as a dropdown.
* [x] Fixed pages being printed directly from `/new` not recognizing the V3 renderer.
Fixes issues: [#1702](https://github.com/naturalcrit/homebrewery/issues/1702)
* [x] Updated links to [r/UnearthedArcana](https://www.reddit.com/r/UnearthedArcana/) on home page.
Fixes issues: [#1744](https://github.com/naturalcrit/homebrewery/issues/1744)
* [x] Added a [FAQ page](https://homebrewery.naturalcrit.com/faq).
Fixes issues: [#810](https://github.com/naturalcrit/homebrewery/issues/810)
* [x] Added {{fa,fa-undo}} **Undo** and {{fa,fa-redo}} **Redo** buttons to the snippet bar.
}}
\column
{{taskList
* [x] Switching between the {{fa,fa-beer}} **Brew** and {{fa,fa-paint-brush}} **Style** tabs no longer loses your scroll position or undo history.
Fixes issues: [#1735](https://github.com/naturalcrit/homebrewery/issues/1735)
* [x] Divider bar between editor and preview panels can no longer be dragged off the edge of the screen.
Fixes issues: [#1674](https://github.com/naturalcrit/homebrewery/issues/1674)
}}
### Wednesday 06/10/2021 - v3.0.2
{{taskList
* [x] Fixed V3 **EDITOR → QR Code** snippet not working on `/new` (unsaved) pages.
Fixes issues: [#1710](https://github.com/naturalcrit/homebrewery/issues/1710)
* [x] Reorganized several snippets from the **Brew Editor** panel into the **Style Editor** panel.
Fixes issues: [Reported on Reddit](https://www.reddit.com/r/homebrewery/comments/pm6ki7/two_version_of_class_features_making_it_look_more/)
* [x] Added a page counter to the right of each `\page` line in V3 to help navigate your brews. Starts counting from page 2.
Fixes issues: [#846](https://github.com/naturalcrit/homebrewery/issues/846)
* [x] Moved the changelog to be accessible by clicking on the Homebrewery version number.
Fixes issues: [#1166](https://github.com/naturalcrit/homebrewery/issues/1166)
}}
### Friday, 17/09/2021 - v3.0.1
{{taskList
* [x] Updated V3 **PHB → Class Feature** snippet to use V3 syntax.
Fixes issues: [Reported on Reddit](https://www.reddit.com/r/homebrewery/comments/pm6ki7/two_version_of_class_features_making_it_look_more/)
* [x] Improved V3 **PHB → Monster Stat Block** snippet and styling to allow for easier control of paragraph indentation in the Abilities text.
Fixes issues: [#181](https://github.com/naturalcrit/homebrewery/issues/181)
* [x] Improved Legacy **TABLES → Split Table** snippet by removing unneeded column-break backticks.
Fixes issues: [#844](https://github.com/naturalcrit/homebrewery/issues/844)
* [x] Changed block elements to use CSS `width` instead of `min-width`. This should make custom styles behave more predictably when trying to resize items.
Fixes issues: [Reported on Reddit](https://www.reddit.com/r/homebrewery/comments/pohoy3/looking_for_help_with_basic_stuff_in_v3/)
* [x] Fixed Partial Page Rendering in V3 for large brews
Fixes issues: [Reported on Reddit](https://www.reddit.com/r/homebrewery/comments/pori3a/weird_behaviour_of_the_brew_after_page_50/)
* [x] Fixed HTML validation to handle tags starting with 'a', as in `<aside>`.
Fixes issues: [#230](https://github.com/naturalcrit/homebrewery/issues/230)
* [x] Fixed page footers switching side when printing.
Fixes issues: [#1612](https://github.com/naturalcrit/homebrewery/issues/1612)
}}
\page
### Saturday, 11/09/2021 - v3.0.0 ### Saturday, 11/09/2021 - v3.0.0

View File

@@ -17,6 +17,7 @@ const PAGE_HEIGHT = 1056;
const PPR_THRESHOLD = 50; const PPR_THRESHOLD = 50;
const BrewRenderer = createClass({ const BrewRenderer = createClass({
displayName : 'BrewRenderer',
getDefaultProps : function() { getDefaultProps : function() {
return { return {
text : '', text : '',
@@ -117,7 +118,7 @@ const BrewRenderer = createClass({
}, },
renderDummyPage : function(index){ renderDummyPage : function(index){
return <div className='phb' id={`p${index + 1}`} key={index}> return <div className='phb page' id={`p${index + 1}`} key={index}>
<i className='fas fa-spinner fa-spin' /> <i className='fas fa-spinner fa-spin' />
</div>; </div>;
}, },
@@ -188,7 +189,6 @@ const BrewRenderer = createClass({
: null} : null}
<Frame initialContent={this.state.initialContent} <Frame initialContent={this.state.initialContent}
head = <link href={`${this.props.renderer == 'legacy' ? '/themes/5ePhbLegacy.style.css' : '/themes/5ePhb.style.css'}`} rel='stylesheet'/>
style={{ width: '100%', height: '100%', visibility: this.state.visibility }} style={{ width: '100%', height: '100%', visibility: this.state.visibility }}
contentDidMount={this.frameDidMount}> contentDidMount={this.frameDidMount}>
<div className={'brewRenderer'} <div className={'brewRenderer'}
@@ -200,17 +200,17 @@ const BrewRenderer = createClass({
<RenderWarnings /> <RenderWarnings />
<NotificationPopup /> <NotificationPopup />
</div> </div>
<link href={`${this.props.renderer == 'legacy' ? '/themes/5ePhbLegacy.style.css' : '/themes/5ePhb.style.css'}`} rel='stylesheet'/>
<div className='pages' ref='pages'> {/* Apply CSS from Style tab and render pages from Markdown tab */}
{/* Apply CSS from Style tab and render pages from Markdown tab */} {this.state.isMounted
{this.state.isMounted &&
&& <>
<> {this.renderStyle()}
{this.renderStyle()} <div className='pages' ref='pages'>
{this.renderPages()} {this.renderPages()}
</> </div>
} </>
</div> }
</div> </div>
</Frame> </Frame>
{this.renderPageInfo()} {this.renderPageInfo()}

View File

@@ -5,6 +5,7 @@ const _ = require('lodash');
const cx = require('classnames'); const cx = require('classnames');
const ErrorBar = createClass({ const ErrorBar = createClass({
displayName : 'ErrorBar',
getDefaultProps : function() { getDefaultProps : function() {
return { return {
errors : [] errors : []

View File

@@ -7,6 +7,7 @@ const cx = require('classnames'); //Unused variable
const DISMISS_KEY = 'dismiss_notification09-9-21'; const DISMISS_KEY = 'dismiss_notification09-9-21';
const NotificationPopup = createClass({ const NotificationPopup = createClass({
displayName : 'NotificationPopup',
getInitialState : function() { getInitialState : function() {
return { return {
notifications : {} notifications : {}

View File

@@ -1,3 +1,4 @@
/*eslint max-lines: ["warn", {"max": 300, "skipBlankLines": true, "skipComments": true}]*/
require('./editor.less'); require('./editor.less');
const React = require('react'); const React = require('react');
const createClass = require('create-react-class'); const createClass = require('create-react-class');
@@ -25,6 +26,7 @@ const splice = function(str, index, inject){
const Editor = createClass({ const Editor = createClass({
displayName : 'Editor',
getDefaultProps : function() { getDefaultProps : function() {
return { return {
brew : { brew : {
@@ -59,6 +61,10 @@ const Editor = createClass({
window.removeEventListener('resize', this.updateEditorSize); window.removeEventListener('resize', this.updateEditorSize);
}, },
componentDidUpdate : function() {
this.highlightCustomMarkdown();
},
updateEditorSize : function() { updateEditorSize : function() {
if(this.refs.codeEditor) { if(this.refs.codeEditor) {
let paneHeight = this.refs.main.parentNode.clientHeight; let paneHeight = this.refs.main.parentNode.clientHeight;
@@ -102,67 +108,69 @@ const Editor = createClass({
if(this.state.view === 'text') { if(this.state.view === 'text') {
const codeMirror = this.refs.codeEditor.codeMirror; const codeMirror = this.refs.codeEditor.codeMirror;
//reset custom text styles codeMirror.operation(()=>{ // Batch CodeMirror styling
const customHighlights = codeMirror.getAllMarks(); //reset custom text styles
for (let i=0;i<customHighlights.length;i++) customHighlights[i].clear(); const customHighlights = codeMirror.getAllMarks().filter((mark)=>!mark.__isFold); //Don't undo code folding
for (let i=customHighlights.length - 1;i>=0;i--) customHighlights[i].clear();
const lineNumbers = _.reduce(this.props.brew.text.split('\n'), (r, line, lineNumber)=>{ let editorPageCount = 2; // start page count from page 2
//reset custom line styles _.forEach(this.props.brew.text.split('\n'), (line, lineNumber)=>{
codeMirror.removeLineClass(lineNumber, 'background');
codeMirror.removeLineClass(lineNumber, 'text');
// Legacy Codemirror styling //reset custom line styles
if(this.props.renderer == 'legacy') { codeMirror.removeLineClass(lineNumber, 'background', 'pageLine');
if(line.includes('\\page')){ codeMirror.removeLineClass(lineNumber, 'text');
// Styling for \page breaks
if((this.props.renderer == 'legacy' && line.includes('\\page')) ||
(this.props.renderer == 'V3' && line.match(/^\\page$/))) {
// add back the original class 'background' but also add the new class '.pageline'
codeMirror.addLineClass(lineNumber, 'background', 'pageLine'); codeMirror.addLineClass(lineNumber, 'background', 'pageLine');
r.push(lineNumber); const pageCountElement = Object.assign(document.createElement('span'), {
} className : 'editor-page-count',
} textContent : editorPageCount
});
codeMirror.setBookmark({ line: lineNumber, ch: line.length }, pageCountElement);
// New Codemirror styling for V3 renderer editorPageCount += 1;
if(this.props.renderer == 'V3') { };
if(line.match(/^\\page$/)){
codeMirror.addLineClass(lineNumber, 'background', 'pageLine');
r.push(lineNumber);
}
if(line.match(/^\\column$/)){ // New Codemirror styling for V3 renderer
codeMirror.addLineClass(lineNumber, 'text', 'columnSplit'); if(this.props.renderer == 'V3') {
r.push(lineNumber); if(line.match(/^\\column$/)){
} codeMirror.addLineClass(lineNumber, 'text', 'columnSplit');
// Highlight inline spans {{content}}
if(line.includes('{{') && line.includes('}}')){
const regex = /{{(?::(?:"[\w,\-()#%. ]*"|[\w\,\-()#%.]*)|[^"'{}\s])*\s*|}}/g;
let match;
let blockCount = 0;
while ((match = regex.exec(line)) != null) {
if(match[0].startsWith('{')) {
blockCount += 1;
} else {
blockCount -= 1;
}
if(blockCount < 0) {
blockCount = 0;
continue;
}
codeMirror.markText({ line: lineNumber, ch: match.index }, { line: lineNumber, ch: match.index + match[0].length }, { className: 'inline-block' });
} }
} else if(line.trimLeft().startsWith('{{') || line.trimLeft().startsWith('}}')){
// Highlight block divs {{\n Content \n}}
let endCh = line.length+1;
const match = line.match(/^ *{{(?::(?:"[\w,\-()#%. ]*"|[\w\,\-()#%.]*)|[^"'{}\s])* *$|^ *}}$/); // Highlight inline spans {{content}}
if(match) if(line.includes('{{') && line.includes('}}')){
endCh = match.index+match[0].length; const regex = /{{(?::(?:"[\w,\-()#%. ]*"|[\w\,\-()#%.]*)|[^"'{}\s])*\s*|}}/g;
codeMirror.markText({ line: lineNumber, ch: 0 }, { line: lineNumber, ch: endCh }, { className: 'block' }); let match;
let blockCount = 0;
while ((match = regex.exec(line)) != null) {
if(match[0].startsWith('{')) {
blockCount += 1;
} else {
blockCount -= 1;
}
if(blockCount < 0) {
blockCount = 0;
continue;
}
codeMirror.markText({ line: lineNumber, ch: match.index }, { line: lineNumber, ch: match.index + match[0].length }, { className: 'inline-block' });
}
} else if(line.trimLeft().startsWith('{{') || line.trimLeft().startsWith('}}')){
// Highlight block divs {{\n Content \n}}
let endCh = line.length+1;
const match = line.match(/^ *{{(?::(?:"[\w,\-()#%. ]*"|[\w\,\-()#%.]*)|[^"'{}\s])* *$|^ *}}$/);
if(match)
endCh = match.index+match[0].length;
codeMirror.markText({ line: lineNumber, ch: 0 }, { line: lineNumber, ch: endCh }, { className: 'block' });
}
} }
} });
});
return r;
}, []);
return lineNumbers;
} }
}, },
@@ -176,30 +184,61 @@ const Editor = createClass({
this.refs.codeEditor?.updateSize(); this.refs.codeEditor?.updateSize();
}, },
//Called by CodeEditor after document switch, so Snippetbar can refresh UndoHistory
rerenderParent : function (){
this.forceUpdate();
},
renderEditor : function(){ renderEditor : function(){
if(this.isText()){ if(this.isText()){
return <CodeEditor key='text' return <>
ref='codeEditor' <CodeEditor key='codeEditor'
language='gfm' ref='codeEditor'
value={this.props.brew.text} language='gfm'
onChange={this.props.onTextChange} />; view={this.state.view}
value={this.props.brew.text}
onChange={this.props.onTextChange}
rerenderParent={this.rerenderParent} />
</>;
} }
if(this.isStyle()){ if(this.isStyle()){
return <CodeEditor key='style' return <>
ref='codeEditor' <CodeEditor key='codeEditor'
language='css' ref='codeEditor'
value={this.props.brew.style ?? DEFAULT_STYLE_TEXT} language='css'
onChange={this.props.onStyleChange} />; view={this.state.view}
value={this.props.brew.style ?? DEFAULT_STYLE_TEXT}
onChange={this.props.onStyleChange}
enableFolding={false}
rerenderParent={this.rerenderParent} />
</>;
} }
if(this.isMeta()){ if(this.isMeta()){
return <MetadataEditor return <>
metadata={this.props.brew} <CodeEditor key='codeEditor'
onChange={this.props.onMetaChange} />; view={this.state.view}
style={{ display: 'none' }}
rerenderParent={this.rerenderParent} />
<MetadataEditor
metadata={this.props.brew}
onChange={this.props.onMetaChange} />
</>;
} }
}, },
redo : function(){
return this.refs.codeEditor?.redo();
},
historySize : function(){
return this.refs.codeEditor?.historySize();
},
undo : function(){
return this.refs.codeEditor?.undo();
},
render : function(){ render : function(){
this.highlightCustomMarkdown();
return ( return (
<div className='editor' ref='main'> <div className='editor' ref='main'>
<SnippetBar <SnippetBar
@@ -208,7 +247,10 @@ const Editor = createClass({
onViewChange={this.handleViewChange} onViewChange={this.handleViewChange}
onInject={this.handleInject} onInject={this.handleInject}
showEditButtons={this.props.showEditButtons} showEditButtons={this.props.showEditButtons}
renderer={this.props.renderer} /> renderer={this.props.renderer}
undo={this.undo}
redo={this.redo}
historySize={this.historySize()} />
{this.renderEditor()} {this.renderEditor()}
</div> </div>

View File

@@ -4,42 +4,58 @@
width : 100%; width : 100%;
.codeEditor{ .codeEditor{
height : 100%; height : 100%;
.pageLine{ .pageLine{
background-color : fade(#333, 15%); background : #33333328;
border-bottom : #333 solid 1px; border-top : #339 solid 1px;
}
.editor-page-count{
color : grey;
float : right;
} }
.columnSplit{ .columnSplit{
font-style : italic; font-style : italic;
color : grey; color : grey;
background-color : fade(#299, 15%); background-color : fade(#299, 15%);
border-bottom : #299 solid 1px; border-bottom : #299 solid 1px;
} }
.block{ .block{
color : purple; color : purple;
font-weight : bold; font-weight : bold;
//font-style: italic; //font-style: italic;
} }
.inline-block{ .inline-block{
color : red; color : red;
font-weight : bold; font-weight : bold;
//font-style: italic; //font-style: italic;
} }
} }
.brewJump{ .brewJump{
position: absolute; position : absolute;
background-color: @teal; background-color : @teal;
cursor: pointer; cursor : pointer;
width : 30px; width : 30px;
height : 30px; height : 30px;
display : flex; display : flex;
align-items : center; align-items : center;
bottom : 20px; bottom : 20px;
right : 20px; right : 20px;
z-index: 1000000; z-index : 1000000;
justify-content:center; justify-content : center;
.tooltipLeft("Jump to brew page"); .tooltipLeft("Jump to brew page");
} }
.editorToolbar{
position: absolute;
top: 5px;
left: 50%;
color: black;
font-size: 13px;
z-index: 9;
span {
padding: 2px 5px;
}
}
} }

View File

@@ -8,6 +8,7 @@ const request = require('superagent');
const SYSTEMS = ['5e', '4e', '3.5e', 'Pathfinder']; const SYSTEMS = ['5e', '4e', '3.5e', 'Pathfinder'];
const MetadataEditor = createClass({ const MetadataEditor = createClass({
displayName : 'MetadataEditor',
getDefaultProps : function() { getDefaultProps : function() {
return { return {
metadata : { metadata : {
@@ -65,18 +66,6 @@ const MetadataEditor = createClass({
}); });
}, },
getRedditLink : function(){
const meta = this.props.metadata;
const shareLink = (meta.googleId || '') + meta.shareId;
const title = `${meta.title} [${meta.systems.join(' ')}]`;
const text = `Hey guys! I've been working on this homebrew. I'd love your feedback. Check it out.
**[Homebrewery Link](https://homebrewery.naturalcrit.com/share/${shareLink})**`;
return `https://www.reddit.com/r/UnearthedArcana/submit?title=${encodeURIComponent(title)}&text=${encodeURIComponent(text)}`;
},
renderSystems : function(){ renderSystems : function(){
return _.map(SYSTEMS, (val)=>{ return _.map(SYSTEMS, (val)=>{
return <label key={val}> return <label key={val}>
@@ -127,21 +116,6 @@ const MetadataEditor = createClass({
</div>; </div>;
}, },
renderShareToReddit : function(){
if(!this.props.metadata.shareId) return;
return <div className='field reddit'>
<label>reddit</label>
<div className='value'>
<a href={this.getRedditLink()} target='_blank' rel='noopener noreferrer'>
<button className='publish'>
<i className='fab fa-reddit-alien' /> share to reddit
</button>
</a>
</div>
</div>;
},
renderRenderOptions : function(){ renderRenderOptions : function(){
if(!global.enable_v3) return; if(!global.enable_v3) return;
@@ -215,8 +189,6 @@ const MetadataEditor = createClass({
</div> </div>
</div> </div>
{this.renderShareToReddit()}
{this.renderDelete()} {this.renderDelete()}
</div>; </div>;

View File

@@ -77,11 +77,6 @@
.button(@red); .button(@red);
} }
} }
.reddit.field .value{
button{
.button(@purple);
}
}
.authors.field .value{ .authors.field .value{
font-size: 0.8em; font-size: 0.8em;
line-height : 1.5em; line-height : 1.5em;

View File

@@ -14,6 +14,7 @@ const execute = function(val, brew){
}; };
const Snippetbar = createClass({ const Snippetbar = createClass({
displayName : 'SnippetBar',
getDefaultProps : function() { getDefaultProps : function() {
return { return {
brew : {}, brew : {},
@@ -22,7 +23,10 @@ const Snippetbar = createClass({
onInject : ()=>{}, onInject : ()=>{},
onToggle : ()=>{}, onToggle : ()=>{},
showEditButtons : true, showEditButtons : true,
renderer : 'legacy' renderer : 'legacy',
undo : ()=>{},
redo : ()=>{},
historySize : ()=>{}
}; };
}, },
@@ -60,6 +64,15 @@ const Snippetbar = createClass({
if(!this.props.showEditButtons) return; if(!this.props.showEditButtons) return;
return <div className='editors'> return <div className='editors'>
<div className={`editorTool undo ${this.props.historySize.undo ? 'active' : ''}`}
onClick={this.props.undo} >
<i className='fas fa-undo' />
</div>
<div className={`editorTool redo ${this.props.historySize.redo ? 'active' : ''}`}
onClick={this.props.redo} >
<i className='fas fa-redo' />
</div>
<div className='divider'></div>
<div className={cx('text', { selected: this.props.view === 'text' })} <div className={cx('text', { selected: this.props.view === 'text' })}
onClick={()=>this.props.onViewChange('text')}> onClick={()=>this.props.onViewChange('text')}>
<i className='fa fa-beer' /> <i className='fa fa-beer' />
@@ -91,6 +104,7 @@ module.exports = Snippetbar;
const SnippetGroup = createClass({ const SnippetGroup = createClass({
displayName : 'SnippetGroup',
getDefaultProps : function() { getDefaultProps : function() {
return { return {
brew : {}, brew : {},

View File

@@ -10,7 +10,7 @@
top : 0px; top : 0px;
right : 0px; right : 0px;
height : @menuHeight; height : @menuHeight;
width : 90px; width : 125px;
justify-content : space-between; justify-content : space-between;
&>div{ &>div{
height : @menuHeight; height : @menuHeight;
@@ -30,6 +30,29 @@
&.meta{ &.meta{
.tooltipLeft('Properties'); .tooltipLeft('Properties');
} }
&.undo{
.tooltipLeft('Undo');
font-size : 0.75em;
color : grey;
&.active{
color : black;
}
}
&.redo{
.tooltipLeft('Redo');
font-size : 0.75em;
color : grey;
&.active{
color : black;
}
}
&.divider {
background: linear-gradient(#000, #000) no-repeat center/1px 100%;
width: 5px;
&:hover{
background-color: inherit;
}
}
} }
} }
.snippetBarButton{ .snippetBarButton{

View File

@@ -100,25 +100,25 @@ const subtitles = [
module.exports = ()=>{ module.exports = ()=>{
return `<style> return `<style>
.phb#p1{ text-align:center; } .page#p1{ text-align:center; counter-increment: none; }
.phb#p1:after{ display:none; } .page#p1:after{ display:none; }
.phb#p2 { counter-reset:phb-page-numbers; } .page:nth-child(2n) .pageNumber { left: inherit !important; right: 2px !important; }
.phb:nth-child(2n) .pageNumber { left: inherit !important; right: 2px !important; } .page:nth-child(2n+1) .pageNumber { right: inherit !important; left: 2px !important; }
.phb:nth-child(2n+1) .pageNumber { right: inherit !important; left: 2px !important; } .page:nth-child(2n)::after { transform: scaleX(1); }
.phb:nth-child(2n)::after { transform: scaleX(1); } .page:nth-child(2n+1)::after { transform: scaleX(-1); }
.phb:nth-child(2n+1)::after { transform: scaleX(-1); } .page:nth-child(2n) .footnote { left: inherit; text-align: right; }
.phb:nth-child(2n) .footnote { left: inherit; text-align: right; } .page:nth-child(2n+1) .footnote { left: 80px; text-align: left; }
.phb:nth-child(2n+1) .footnote { left: 80px; text-align: left; }
</style> </style>
<div style='margin-top:450px;'></div> {{margin-top:225px}}
# ${_.sample(titles)} # ${_.sample(titles)}
<div style='margin-top:25px'></div> {{margin-top:25px}}
<div class='wide'>
{{wide
##### ${_.sample(subtitles)} ##### ${_.sample(subtitles)}
</div> }}
\\page`; \\page`;
}; };

View File

@@ -105,6 +105,20 @@ const genAbilities = function(){
]); ]);
}; };
const genLongAbilities = function(){
return _.sample([
dedent`***Pack Tactics.*** These guys work together like peanut butter and jelly. Jelly and peanut butter.
When one of these guys attacks, the target is covered with, well, peanut butter and jelly.`,
dedent`***Hangriness.*** This creature is angry, and hungry. It will refuse to do anything with you until its hunger is satisfied.
When in visual contact with this creature, you must purchase an extra order of fries, even if they say they aren't hungry.`,
dedent`***Full of Detergent.*** This creature has swallowed an entire bottle of dish detergent and is actually having a pretty good time.
While walking near this creature, you must make a dexterity check or become "a soapy mess" for three hours, after which your skin will get all dry and itchy.`
]);
};
const genAction = function(){ const genAction = function(){
const name = _.sample([ const name = _.sample([
'Abdominal Drop', 'Abdominal Drop',
@@ -159,11 +173,11 @@ module.exports = {
**Languages** :: ${genList(['Common', 'Pottymouth', 'Gibberish', 'Latin', 'Jive'], 2)} **Languages** :: ${genList(['Common', 'Pottymouth', 'Gibberish', 'Latin', 'Jive'], 2)}
**Challenge** :: ${_.random(0, 15)} (${_.random(10, 10000)} XP) **Challenge** :: ${_.random(0, 15)} (${_.random(10, 10000)} XP)
___ ___
${_.times(_.random(genLines, genLines + 2), function(){return genAbilities();}).join('\n:\n')}
: :
${_.times(_.random(genLines, genLines + 2), function(){return genAbilities();}).join('\n\t\t\t\n\t\t\t')} ${genLongAbilities()}
:
### Actions ### Actions
${_.times(_.random(genLines, genLines + 2), function(){return genAction();}).join('\n\t\t\t\n\t\t\t')} ${_.times(_.random(genLines, genLines + 2), function(){return genAction();}).join('\n:\n')}
}} }}
\n`; \n`;
} }

View File

@@ -13,7 +13,7 @@ const watercolorGen = require('./watercolor.gen.js');
module.exports = [ module.exports = [
{ {
groupName : 'Editor', groupName : 'Text Editor',
icon : 'fas fa-pencil-alt', icon : 'fas fa-pencil-alt',
view : 'text', view : 'text',
snippets : [ snippets : [
@@ -55,7 +55,7 @@ module.exports = [
gen : (brew)=>{ gen : (brew)=>{
return `![]` + return `![]` +
`(https://api.qrserver.com/v1/create-qr-code/?data=` + `(https://api.qrserver.com/v1/create-qr-code/?data=` +
`https://homebrewery.naturalcrit.com/share/${brew.shareId}` + `https://homebrewery.naturalcrit.com${brew.shareId ? `/share/${brew.shareId}` : ''}` +
`&amp;size=100x100) {width:100px;mix-blend-mode:multiply}`; `&amp;size=100x100) {width:100px;mix-blend-mode:multiply}`;
} }
}, },
@@ -79,35 +79,41 @@ module.exports = [
icon : 'fas fa-book', icon : 'fas fa-book',
gen : TableOfContentsGen gen : TableOfContentsGen
}, },
{
name : 'Add Comment',
icon : 'fas fa-code',
gen : '<!-- This is a comment that will not be rendered into your brew. Hotkey (Ctrl/Cmd + /). -->'
},
]
},
{
groupName : 'Style Editor',
icon : 'fas fa-pencil-alt',
view : 'style',
snippets : [
{ {
name : 'Remove Drop Cap', name : 'Remove Drop Cap',
icon : 'fas fa-remove-format', icon : 'fas fa-remove-format',
gen : '<style>\n' + gen : dedent`/* Removes Drop Caps */
' .phb3 h1+p:first-letter {\n' + .page h1+p:first-letter {
' all: unset;\n' + all: unset;
' }\n' + }\n\n`
'</style>'
}, },
{ {
name : 'Tweak Drop Cap', name : 'Tweak Drop Cap',
icon : 'fas fa-sliders-h', icon : 'fas fa-sliders-h',
gen : '<style>\n' + gen : dedent`/* Drop Cap settings */
' /* Drop Cap settings */\n' + .page h1 + p::first-letter {
' .phb3 h1 + p::first-letter {\n' + font-family: SolberaImitationRemake;
' float: left;\n' + font-size: 3.5cm;
' font-family: SolberaImitationRemake;\n' + background-image: linear-gradient(-45deg, #322814, #998250, #322814);
' font-size: 3.5cm;\n' + line-height: 1em;
' color: #222;\n' + }\n\n`
' line-height: .8em;\n' +
' }\n' +
'</style>'
}, },
{ {
name : 'Add Comment', name : 'Add Comment',
icon : 'fas fa-code', /* might need to be fa-solid fa-comment-code --not sure, Gazook */ icon : 'fas fa-code',
gen : dedent`\n gen : '/* This is a comment that will not be rendered into your brew. */'
<!-- This is a comment that will not be rendered into your brew. Hotkey (Ctrl/Cmd + /). -->
`
}, },
] ]
}, },
@@ -124,7 +130,7 @@ module.exports = [
gen : dedent` gen : dedent`
![cat warrior](https://s-media-cache-ak0.pinimg.com/736x/4a/81/79/4a8179462cfdf39054a418efd4cb743e.jpg) {width:325px,mix-blend-mode:multiply} ![cat warrior](https://s-media-cache-ak0.pinimg.com/736x/4a/81/79/4a8179462cfdf39054a418efd4cb743e.jpg) {width:325px,mix-blend-mode:multiply}
{{artist,position:relative,top:-230px,left:-100px,margin-bottom:-30px {{artist,position:relative,top:-230px,left:10px,margin-bottom:-30px
##### Cat Warrior ##### Cat Warrior
[Kyoung Hwan Kim](https://www.artstation.com/tahra) [Kyoung Hwan Kim](https://www.artstation.com/tahra)
}}` }}`
@@ -135,7 +141,7 @@ module.exports = [
gen : dedent` gen : dedent`
![homebrew mug](http://i.imgur.com/hMna6G0.png) {position:absolute,top:50px,right:30px,width:280px} ![homebrew mug](http://i.imgur.com/hMna6G0.png) {position:absolute,top:50px,right:30px,width:280px}
{{artist,top:90px,right:30px {{artist,top:80px,right:30px
##### Homebrew Mug ##### Homebrew Mug
[naturalcrit](https://homebrew.naturalcrit.com) [naturalcrit](https://homebrew.naturalcrit.com)
}}` }}`
@@ -254,36 +260,6 @@ module.exports = [
icon : 'fas fa-table', icon : 'fas fa-table',
view : 'text', view : 'text',
snippets : [ snippets : [
{
name : 'Class Table',
icon : 'fas fa-table',
gen : ClassTableGen.full('classTable,frame,decoration,wide'),
},
{
name : 'Class Table (unframed)',
icon : 'fas fa-border-none',
gen : ClassTableGen.full('classTable,wide'),
},
{
name : '1/2 Class Table',
icon : 'fas fa-list-alt',
gen : ClassTableGen.half('classTable,decoration,frame'),
},
{
name : '1/2 Class Table (unframed)',
icon : 'fas fa-border-none',
gen : ClassTableGen.half('classTable'),
},
{
name : '1/3 Class Table',
icon : 'fas fa-border-all',
gen : ClassTableGen.third('classTable,frame'),
},
{
name : '1/3 Class Table (unframed)',
icon : 'fas fa-border-none',
gen : ClassTableGen.third('classTable'),
},
{ {
name : 'Table', name : 'Table',
icon : 'fas fa-th-list', icon : 'fas fa-th-list',
@@ -343,6 +319,36 @@ module.exports = [
}} }}
\n`; \n`;
} }
},
{
name : 'Class Table',
icon : 'fas fa-table',
gen : ClassTableGen.full('classTable,frame,decoration,wide'),
},
{
name : 'Class Table (unframed)',
icon : 'fas fa-border-none',
gen : ClassTableGen.full('classTable,wide'),
},
{
name : '1/2 Class Table',
icon : 'fas fa-list-alt',
gen : ClassTableGen.half('classTable,decoration,frame'),
},
{
name : '1/2 Class Table (unframed)',
icon : 'fas fa-border-none',
gen : ClassTableGen.half('classTable'),
},
{
name : '1/3 Class Table',
icon : 'fas fa-border-all',
gen : ClassTableGen.third('classTable,frame'),
},
{
name : '1/3 Class Table (unframed)',
icon : 'fas fa-border-none',
gen : ClassTableGen.third('classTable'),
} }
] ]
}, },
@@ -360,44 +366,36 @@ module.exports = [
{ {
name : 'A4 Page Size', name : 'A4 Page Size',
icon : 'far fa-file', icon : 'far fa-file',
gen : ['/* A4 Page Size */', gen : dedent`/* A4 Page Size */
'.page{', .page{
' width : 210mm;', width : 210mm;
' height : 296.8mm;', height : 296.8mm;
'}', }\n\n`
''
].join('\n')
}, },
{ {
name : 'Square Page Size', name : 'Square Page Size',
icon : 'far fa-file', icon : 'far fa-file',
gen : ['/* Square Page Size */', gen : dedent`/* Square Page Size */
'.page {', .page {
' width : 125mm;', width : 125mm;
' height : 125mm;', height : 125mm;
' padding : 12.5mm;', padding : 12.5mm;
' columns : unset;', columns : unset;
'}', }\n\n`
''
].join('\n')
}, },
{ {
name : 'Ink Friendly', name : 'Ink Friendly',
icon : 'fas fa-tint', icon : 'fas fa-tint',
gen : dedent` gen : dedent`
/* Ink Friendly */ /* Ink Friendly */
.pages *:is(.page,.monster,.note,.descriptive) { *:is(.page,.monster,.note,.descriptive) {
background : white !important; background : white !important;
box-shadow : 0px 0px 3px !important; filter : drop-shadow(0px 0px 3px #888) !important;
}
.page .note:before {
box-shadow : 0px 0px 3px;
} }
.page img { .page img {
visibility : hidden; visibility : hidden;
}` }\n\n`
}, },
] ]
}, },

View File

@@ -53,19 +53,19 @@ module.exports = function(brew){
const TOC = getTOC(pages); const TOC = getTOC(pages);
const markdown = _.reduce(TOC, (r, g1, idx1)=>{ const markdown = _.reduce(TOC, (r, g1, idx1)=>{
if(g1.title !== null) { if(g1.title !== null) {
r.push(`\t\t- ### [{{ ${g1.title}}}{{ ${g1.page}}}](#p${g1.page})`); r.push(`- ### [{{ ${g1.title}}}{{ ${g1.page}}}](#p${g1.page})`);
} }
if(g1.children.length){ if(g1.children.length){
_.each(g1.children, (g2, idx2)=>{ _.each(g1.children, (g2, idx2)=>{
if(g2.title !== null) { if(g2.title !== null) {
r.push(`\t\t - #### [{{ ${g2.title}}}{{ ${g2.page}}}](#p${g2.page})`); r.push(` - #### [{{ ${g2.title}}}{{ ${g2.page}}}](#p${g2.page})`);
} }
if(g2.children.length){ if(g2.children.length){
_.each(g2.children, (g3, idx3)=>{ _.each(g2.children, (g3, idx3)=>{
if(g2.title !== null) { if(g2.title !== null) {
r.push(`\t\t - [{{ ${g3.title}}}{{ ${g3.page}}}](#p${g3.page})`); r.push(` - [{{ ${g3.title}}}{{ ${g3.page}}}](#p${g3.page})`);
} else { // Don't over-indent if no level-2 parent entry } else { // Don't over-indent if no level-2 parent entry
r.push(`\t\t - [{{ ${g3.title}}}{{ ${g3.page}}}](#p${g3.page})`); r.push(` - [{{ ${g3.title}}}{{ ${g3.page}}}](#p${g3.page})`);
} }
}); });
} }
@@ -78,7 +78,7 @@ module.exports = function(brew){
{{toc,wide {{toc,wide
# Table Of Contents # Table Of Contents
${markdown} ${markdown}
}} }}
\n`; \n`;
}; };

View File

@@ -11,7 +11,7 @@ const dedent = require('dedent-tabs').default;
module.exports = [ module.exports = [
{ {
groupName : 'Editor', groupName : 'Text Editor',
icon : 'fas fa-pencil-alt', icon : 'fas fa-pencil-alt',
view : 'text', view : 'text',
snippets : [ snippets : [
@@ -78,33 +78,44 @@ module.exports = [
icon : 'fas fa-book', icon : 'fas fa-book',
gen : TableOfContentsGen gen : TableOfContentsGen
}, },
{
name : 'Add Comment',
icon : 'fas fa-code',
gen : '<!-- This is a comment that will not be rendered into your brew. Hotkey (Ctrl/Cmd + /). -->'
}
]
},
{
groupName : 'Style Editor',
icon : 'fas fa-pencil-alt',
view : 'style',
snippets : [
{ {
name : 'Remove Drop Cap', name : 'Remove Drop Cap',
icon : 'fas fa-remove-format', icon : 'fas fa-remove-format',
gen : '<style>\n' + gen : dedent`/* Removes Drop Caps */
' .phb h1+p:first-letter {\n' + .phb h1+p:first-letter {
' all: unset;\n' + all: unset;
' }\n' + }\n\n`
'</style>'
}, },
{ {
name : 'Tweak Drop Cap', name : 'Tweak Drop Cap',
icon : 'fas fa-sliders-h', icon : 'fas fa-sliders-h',
gen : '<style>\n' + gen : dedent`/* Drop Cap Settings */
' /* Drop Cap settings */\n' + .phb h1 + p::first-letter {
' .phb h1 + p::first-letter {\n' + float: left;
' float: left;\n' + font-family: Solberry;
' font-family: Solberry;\n' + font-size: 10em;
' font-size: 10em;\n' + color: #222;
' color: #222;\n' + line-height: .8em;
' line-height: .8em;\n' + }\n\n`
' }\n' +
'</style>'
}, },
{ {
name : 'Add Comment', name : 'Add Comment',
icon : 'fas fa-code', icon : 'fas fa-code',
gen : `\n<!-- This is a comment that will not be rendered into your brew. Hotkey (Ctrl/Cmd + /). -->\n\n` gen : '/* This is a comment that will not be rendered into your brew. */'
} }
] ]
}, },
@@ -240,30 +251,25 @@ module.exports = [
{ {
name : 'Split Table', name : 'Split Table',
icon : 'fas fa-th-large', icon : 'fas fa-th-large',
gen : function(){ gen : dedent`\n
return [ <div style='column-count:2'>
'<div style=\'column-count:2\'>', | d10 | Damage Type |
'| d10 | Damage Type |', |:---:|:------------|
'|:---:|:------------|', | 1 | Acid |
'| 1 | Acid |', | 2 | Cold |
'| 2 | Cold |', | 3 | Fire |
'| 3 | Fire |', | 4 | Force |
'| 4 | Force |', | 5 | Lightning |
'| 5 | Lightning |',
'', | d10 | Damage Type |
'```', |:---:|:------------|
'```', | 6 | Necrotic |
'', | 7 | Poison |
'| d10 | Damage Type |', | 8 | Psychic |
'|:---:|:------------|', | 9 | Radiant |
'| 6 | Necrotic |', | 10 | Thunder |
'| 7 | Poison |', </div>
'| 8 | Psychic |', \n`
'| 9 | Radiant |',
'| 10 | Thunder |',
'</div>\n\n',
].join('\n');
},
} }
] ]
}, },

View File

@@ -13,6 +13,7 @@ const NewPage = require('./pages/newPage/newPage.jsx');
const PrintPage = require('./pages/printPage/printPage.jsx'); const PrintPage = require('./pages/printPage/printPage.jsx');
const Homebrew = createClass({ const Homebrew = createClass({
displayName : 'Homebrewery',
getDefaultProps : function() { getDefaultProps : function() {
return { return {
url : '', url : '',
@@ -49,6 +50,7 @@ const Homebrew = createClass({
<Route path='/print/:id' component={(routeProps)=><PrintPage brew={this.props.brew} query={queryString.parse(routeProps.location.search)} />}/> <Route path='/print/:id' component={(routeProps)=><PrintPage brew={this.props.brew} query={queryString.parse(routeProps.location.search)} />}/>
<Route path='/print' exact component={(routeProps)=><PrintPage query={queryString.parse(routeProps.location.search)} />}/> <Route path='/print' exact component={(routeProps)=><PrintPage query={queryString.parse(routeProps.location.search)} />}/>
<Route path='/changelog' exact component={()=><SharePage brew={this.props.brew} />}/> <Route path='/changelog' exact component={()=><SharePage brew={this.props.brew} />}/>
<Route path='/faq' exact component={()=><SharePage brew={this.props.brew} />}/>
<Route path='/v3_preview' exact component={()=><HomePage brew={this.props.brew} />}/> <Route path='/v3_preview' exact component={()=><HomePage brew={this.props.brew} />}/>
<Route path='/' component={()=><HomePage brew={this.props.brew} />}/> <Route path='/' component={()=><HomePage brew={this.props.brew} />}/>
</Switch> </Switch>

View File

@@ -3,7 +3,7 @@ const createClass = require('create-react-class');
const Nav = require('naturalcrit/nav/nav.jsx'); const Nav = require('naturalcrit/nav/nav.jsx');
const Account = createClass({ const Account = createClass({
displayName : 'AccountNavItem',
getInitialState : function() { getInitialState : function() {
return { return {
url : '' url : ''

View File

@@ -7,6 +7,7 @@ const MAX_TITLE_LENGTH = 50;
const EditTitle = createClass({ const EditTitle = createClass({
displayName : 'EditTitleNavItem',
getDefaultProps : function() { getDefaultProps : function() {
return { return {
title : '', title : '',

View File

@@ -0,0 +1,25 @@
const React = require('react');
const createClass = require('create-react-class');
const _ = require('lodash');
const Nav = require('naturalcrit/nav/nav.jsx');
module.exports = function(props){
return <Nav.dropdown>
<Nav.item color='grey' icon='fas fa-question-circle'>
need help?
</Nav.item>
<Nav.item color='red' icon='fas fa-fw fa-bug'
href={`https://www.reddit.com/r/homebrewery/submit?selftext=true&title=${encodeURIComponent('[Issue] Describe Your Issue Here')}`}
newTab={true}
rel='noopener noreferrer'>
report issue
</Nav.item>
<Nav.item color='blue' icon='fas fa-fw fa-file-import'
href='/migrate'
newTab={true}
rel='noopener noreferrer'>
migrate
</Nav.item>
</Nav.dropdown>;
};

View File

@@ -1,13 +0,0 @@
const React = require('react');
const createClass = require('create-react-class');
const Nav = require('naturalcrit/nav/nav.jsx');
module.exports = function(props){
return <Nav.item
newTab={true}
color='red'
icon='fas fa-bug'
href={`https://www.reddit.com/r/homebrewery/submit?selftext=true&title=${encodeURIComponent('[Issue] Describe Your Issue Here')}`} >
report issue
</Nav.item>;
};

View File

@@ -6,6 +6,7 @@ const Nav = require('naturalcrit/nav/nav.jsx');
const PatreonNavItem = require('./patreon.navitem.jsx'); const PatreonNavItem = require('./patreon.navitem.jsx');
const Navbar = createClass({ const Navbar = createClass({
displayName : 'Navbar',
getInitialState : function() { getInitialState : function() {
return { return {
//showNonChromeWarning : false, //showNonChromeWarning : false,
@@ -39,7 +40,9 @@ const Navbar = createClass({
<Nav.item href='/' className='homebrewLogo'> <Nav.item href='/' className='homebrewLogo'>
<div>The Homebrewery</div> <div>The Homebrewery</div>
</Nav.item> </Nav.item>
<Nav.item>{`v${this.state.ver}`}</Nav.item> <Nav.item newTab={true} href='/changelog' color='purple' icon='far fa-file-alt'>
{`v${this.state.ver}`}
</Nav.item>
<PatreonNavItem /> <PatreonNavItem />
{/*this.renderChromeWarning()*/} {/*this.renderChromeWarning()*/}
</Nav.section> </Nav.section>

View File

@@ -1,5 +1,6 @@
@import 'naturalcrit/styles/colors.less';
@navbarHeight : 28px; @navbarHeight : 28px;
@keyframes coloring { @keyframes pinkColoring {
//from {color: white;} //from {color: white;}
//to {color: red;} //to {color: red;}
0% {color: pink;} 0% {color: pink;}
@@ -62,19 +63,21 @@
} }
i{ i{
.animate(color); .animate(color);
animation-name: coloring; animation-name: pinkColoring;
animation-duration: 2s; animation-duration: 2s;
color: pink; color: pink;
} }
} }
.recent.navItem{ .recent.navItem {
position : relative; position : relative;
.dropdown{ .dropdown{
position : absolute; position : absolute;
top : 28px; top : 28px;
left : 0px; left : 0px;
z-index : 10000; z-index : 10000;
width : 100%; width : 100%;
overflow : hidden auto;
max-height : ~"calc(100vh - 28px)";
h4{ h4{
display : block; display : block;
box-sizing : border-box; box-sizing : border-box;
@@ -88,11 +91,12 @@
&:nth-of-type(2){ background-color: darken(@purple, 30%); } &:nth-of-type(2){ background-color: darken(@purple, 30%); }
} }
.item{ .item{
#backgroundColors;
.animate(background-color); .animate(background-color);
position : relative; position : relative;
display : block; display : block;
box-sizing : border-box; box-sizing : border-box;
padding : 13px 5px; padding : 8px 5px 13px;
background-color : #333; background-color : #333;
color : white; color : white;
text-decoration : none; text-decoration : none;

View File

@@ -10,7 +10,7 @@ const VIEW_KEY = 'homebrewery-recently-viewed';
const RecentItems = createClass({ const RecentItems = createClass({
DisplayName : 'RecentItems',
getDefaultProps : function() { getDefaultProps : function() {
return { return {
storageKey : '', storageKey : '',
@@ -123,8 +123,8 @@ const RecentItems = createClass({
if(!this.state.showDropdown) return null; if(!this.state.showDropdown) return null;
const makeItems = (brews)=>{ const makeItems = (brews)=>{
return _.map(brews, (brew)=>{ return _.map(brews, (brew, i)=>{
return <a href={brew.url} className='item' key={brew.id} target='_blank' rel='noopener noreferrer' title={brew.title || '[ no title ]'}> return <a href={brew.url} className='item' key={`${brew.id}-${i}`} target='_blank' rel='noopener noreferrer' title={brew.title || '[ no title ]'}>
<span className='title'>{brew.title || '[ no title ]'}</span> <span className='title'>{brew.title || '[ no title ]'}</span>
<span className='time'>{Moment(brew.ts).fromNow()}</span> <span className='time'>{Moment(brew.ts).fromNow()}</span>
</a>; </a>;

View File

@@ -8,6 +8,7 @@ const MAIN_URL = 'https://www.reddit.com/r/UnearthedArcana/submit?selftext=true'
const RedditShare = createClass({ const RedditShare = createClass({
displayName : 'RedditShareNavItem',
getDefaultProps : function() { getDefaultProps : function() {
return { return {
brew : { brew : {

View File

@@ -10,7 +10,7 @@ const Nav = require('naturalcrit/nav/nav.jsx');
const Navbar = require('../../navbar/navbar.jsx'); const Navbar = require('../../navbar/navbar.jsx');
const NewBrew = require('../../navbar/newbrew.navitem.jsx'); const NewBrew = require('../../navbar/newbrew.navitem.jsx');
const ReportIssue = require('../../navbar/issue.navitem.jsx'); const HelpNavItem = require('../../navbar/help.navitem.jsx');
const PrintLink = require('../../navbar/print.navitem.jsx'); const PrintLink = require('../../navbar/print.navitem.jsx');
const Account = require('../../navbar/account.navitem.jsx'); const Account = require('../../navbar/account.navitem.jsx');
const RecentNavItem = require('../../navbar/recent.navitem.jsx').both; const RecentNavItem = require('../../navbar/recent.navitem.jsx').both;
@@ -27,6 +27,7 @@ const googleDriveInactive = require('../../googleDriveMono.png');
const SAVE_TIMEOUT = 3000; const SAVE_TIMEOUT = 3000;
const EditPage = createClass({ const EditPage = createClass({
displayName : 'EditPage',
getDefaultProps : function() { getDefaultProps : function() {
return { return {
brew : { brew : {
@@ -349,14 +350,14 @@ const EditPage = createClass({
</Nav.item>; </Nav.item>;
} }
if(this.state.errors.status == '403' && this.state.errors.response.body.errors[0].reason == 'insufficientPermissions'){ if(this.state.errors.response.req.url.match(/^\/api\/.*Google.*$/m)){
return <Nav.item className='save error' icon='fas fa-exclamation-triangle'> return <Nav.item className='save error' icon='fas fa-exclamation-triangle'>
Oops! Oops!
<div className='errorContainer' onClick={this.clearErrors}> <div className='errorContainer' onClick={this.clearErrors}>
Looks like your Google credentials have Looks like your Google credentials have
expired! Visit the log in page to sign out expired! Visit our log in page to sign out
and sign back in with Google and sign back in with Google,
to save this to Google Drive! then try saving again!
<a target='_blank' rel='noopener noreferrer' <a target='_blank' rel='noopener noreferrer'
href={`https://www.naturalcrit.com/login?redirect=${this.state.url}`}> href={`https://www.naturalcrit.com/login?redirect=${this.state.url}`}>
<div className='confirm'> <div className='confirm'>
@@ -399,7 +400,21 @@ const EditPage = createClass({
this.state.brew.shareId; this.state.brew.shareId;
}, },
getRedditLink : function(){
const shareLink = this.processShareId();
const systems = this.props.brew.systems.length > 0 ? ` [${this.props.brew.systems.join(' - ')}]` : '';
const title = `${this.props.brew.title} ${systems}`;
const text = `Hey guys! I've been working on this homebrew. I'd love your feedback. Check it out.
**[Homebrewery Link](https://homebrewery.naturalcrit.com/share/${shareLink})**`;
return `https://www.reddit.com/r/UnearthedArcana/submit?title=${encodeURIComponent(title)}&text=${encodeURIComponent(text)}`;
},
renderNavbar : function(){ renderNavbar : function(){
const shareLink = this.processShareId();
return <Navbar> return <Navbar>
{this.state.alertTrashedGoogleBrew && {this.state.alertTrashedGoogleBrew &&
@@ -419,10 +434,21 @@ const EditPage = createClass({
{this.renderGoogleDriveIcon()} {this.renderGoogleDriveIcon()}
{this.renderSaveButton()} {this.renderSaveButton()}
<NewBrew /> <NewBrew />
<ReportIssue /> <HelpNavItem/>
<Nav.item newTab={true} href={`/share/${this.processShareId()}`} color='teal' icon='fas fa-share-alt'> <Nav.dropdown>
Share <Nav.item color='teal' icon='fas fa-share-alt'>
</Nav.item> share
</Nav.item>
<Nav.item color='blue' href={`/share/${shareLink}`}>
view
</Nav.item>
<Nav.item color='blue' onClick={()=>{navigator.clipboard.writeText(`https://homebrewery.naturalcrit.com/share/${shareLink}`);}}>
copy url
</Nav.item>
<Nav.item color='blue' href={this.getRedditLink()} newTab={true} rel='noopener noreferrer'>
post to reddit
</Nav.item>
</Nav.dropdown>
<PrintLink shareId={this.processShareId()} /> <PrintLink shareId={this.processShareId()} />
<RecentNavItem brew={this.state.brew} storageKey='edit' /> <RecentNavItem brew={this.state.brew} storageKey='edit' />
<Account /> <Account />

View File

@@ -7,8 +7,8 @@ const cx = require('classnames');
const Nav = require('naturalcrit/nav/nav.jsx'); const Nav = require('naturalcrit/nav/nav.jsx');
const Navbar = require('../../navbar/navbar.jsx'); const Navbar = require('../../navbar/navbar.jsx');
const PatreonNavItem = require('../../navbar/patreon.navitem.jsx'); const PatreonNavItem = require('../../navbar/patreon.navitem.jsx');
const IssueNavItem = require('../../navbar/issue.navitem.jsx');
const RecentNavItem = require('../../navbar/recent.navitem.jsx').both; const RecentNavItem = require('../../navbar/recent.navitem.jsx').both;
const HelpNavItem = require('../../navbar/help.navitem.jsx');
const BrewRenderer = require('../../brewRenderer/brewRenderer.jsx'); const BrewRenderer = require('../../brewRenderer/brewRenderer.jsx');
@@ -33,7 +33,7 @@ const ErrorPage = createClass({
<Nav.section> <Nav.section>
<PatreonNavItem /> <PatreonNavItem />
<IssueNavItem /> <HelpNavItem />
<RecentNavItem /> <RecentNavItem />
</Nav.section> </Nav.section>
</Navbar> </Navbar>

View File

@@ -9,7 +9,7 @@ const { Meta } = require('vitreum/headtags');
const Nav = require('naturalcrit/nav/nav.jsx'); const Nav = require('naturalcrit/nav/nav.jsx');
const Navbar = require('../../navbar/navbar.jsx'); const Navbar = require('../../navbar/navbar.jsx');
const NewBrewItem = require('../../navbar/newbrew.navitem.jsx'); const NewBrewItem = require('../../navbar/newbrew.navitem.jsx');
const IssueNavItem = require('../../navbar/issue.navitem.jsx'); const HelpNavItem = require('../../navbar/help.navitem.jsx');
const RecentNavItem = require('../../navbar/recent.navitem.jsx').both; const RecentNavItem = require('../../navbar/recent.navitem.jsx').both;
const AccountNavItem = require('../../navbar/account.navitem.jsx'); const AccountNavItem = require('../../navbar/account.navitem.jsx');
@@ -21,6 +21,7 @@ const BrewRenderer = require('../../brewRenderer/brewRenderer.jsx');
const HomePage = createClass({ const HomePage = createClass({
displayName : 'HomePage',
getDefaultProps : function() { getDefaultProps : function() {
return { return {
brew : { brew : {
@@ -58,10 +59,7 @@ const HomePage = createClass({
return <Navbar ver={this.props.ver}> return <Navbar ver={this.props.ver}>
<Nav.section> <Nav.section>
<NewBrewItem /> <NewBrewItem />
<IssueNavItem /> <HelpNavItem />
<Nav.item newTab={true} href='/changelog' color='purple' icon='far fa-file-alt'>
Changelog
</Nav.item>
<RecentNavItem /> <RecentNavItem />
<AccountNavItem /> <AccountNavItem />
</Nav.section> </Nav.section>

View File

@@ -0,0 +1,202 @@
# How to Convert a Legacy Document to v3
Here you will find a number of steps to guide you through converting a Legacy document into a Homebrewery v3 document.
**The first thing you'll want to do is switch the editor's rendering engine from `Legacy` to `v3`.** This will be the renderer we design features for moving forward.
There are some examples of Legacy code in the code pane if you need more context behind some of the changes.
**This document will evolve as users like yourself inform us of issues with it, or areas of conversion that it does not cover. _Please_ reach out if you have any suggestions for this document.**
## Simple Replacements
To make your life a little easier with this section, a text editor like [VSCode](https://code.visualstudio.com/) or Notepad will help a lot.
The following table describes Legacy and other document elements and their Homebrewery counterparts. A simple find/replace should get these in working order.
| Legacy / Other | Homebrewery |
|:----------------|:-----------------------------|
| `\pagebreak` | `\page` |
| `======` | `\page` |
| `\pagebreaknum` | `{{pageNumber,auto}}\n\page` |
| `@=====` | `{{pageNumber,auto}}\n\page` |
| `\columnbreak` | `\column` |
| `.phb` | `.page` |
## Classed or Styled Divs
Anything that relies on the following syntax can be changed to the new Homebrewery v3 curly brace syntax:
```
<div class="classTable wide">
...
</div>
```
:
The above example is equivalent to the following in v3 syntax.
```
{{classTable,wide
...
}}
```
:
Some examples of this include class tables (as shown above), descriptive blocks, notes, and spell lists.
\column
## Margins and Padding
Any manual margins and padding to push text down the page will likely need to be updated. Colons can be used on lines by themselves to push things down the page vertically if you'd rather not set pixel-perfect margins or padding.
## Notes
In Legacy, notes are denoted using markdown blockquote syntax. In Homebrewery v3, this is replaced by the curly brace syntax.
<!--
> ##### Catchy Title
> Useful Information
-->
{{note
##### Title
Information
}}
## Split Tables
Split tables also use the curly brace syntax, as the new renderer can handle style values separately from class names.
<!--
<div style='column-count:2'>
| d8 | Loot |
|:---:|:-----------:|
| 1 | 100gp |
| 2 | 200gp |
| 3 | 300gp |
| 4 | 400gp |
| d8 | Loot |
|:---:|:-----------:|
| 5 | 500gp |
| 6 | 600gp |
| 7 | 700gp |
| 8 | 1000gp |
</div>
-->
##### Typical Difficulty Classes
{{column-count:2
| Task Difficulty | DC |
|:----------------|:--:|
| Very easy | 5 |
| Easy | 10 |
| Medium | 15 |
| Task Difficulty | DC |
|:------------------|:--:|
| Hard | 20 |
| Very hard | 25 |
| Nearly impossible | 30 |
}}
## Blockquotes
Blockquotes are denoted by the `>` character at the beginning of the line. In Homebrewery's v3 renderer, they hold virtually no meaning and have no CSS styling. You are free to use blockquotes when styling your document or creating themes without needing to worry about your CSS affecting other parts of the document.
{{pageNumber,auto}}
\page
## Stat Blocks
There are pretty significant differences between stat blocks on the Legacy renderer and Homebrewery v3. This section contains a list of changes that will need to be made to update the stat block.
### Initial Changes
You will want to **remove all leading** `___` that started the stat block in Legacy, and replace that with `{{monster` before the stat block, and `}}` after it.
**If you want a frame** around the stat block, you can add `,frame` to the curly brace definition.
**If the stat block was wide**, make sure to add `,wide` to the curly brace definition.
### Blockquotes
The key difference is the lack of blockquotes. Legacy documents use the `>` symbol at the start of the line for each line in the stat block, and the v3 renderer does not. **You will want to remove all `>` characters at the beginning of all lines, and delete any leading spaces.**
### Lists
The basic characteristics and advanced characteristics sections are not list elements in Homebrewery. You will want to **remove all `-` or `*` characters from the beginning of lines.**
### Spacing
In order to have the correct spacing after removing the list elements, you will want to **add two colons between the name of each basic/advanced characteristic and its value.** _(see example in the code pane)_
Additionally, in the special traits and actions sections, you will want to add a colon at the beginning of each line that separates a trait/action from another, as seen below. **Any empty lines between special traits and actions should contain only a colon.** _(see example in the code pane)_
\column
{{margin-top:102px}}
<!--
### Legacy/Other Document Example:
___
> ## Centaur
> *Large Monstrosity, neutral good*
>___
> - **Armor Class** 12
> - **Hit Points** 45(6d10 + 12)
> - **Speed** 50ft.
>___
>|STR|DEX|CON|INT|WIS|CHA|
>|:---:|:---:|:---:|:---:|:---:|:---:|
>|18 (+4)|14 (+2)|14 (+2)|9 (-1)|13 (+1)|11 (+0)|
>___
> - **Skills** Athletics +6, Perception +3, Survival +3
> - **Senses** passive Perception 13
> - **Languages** Elvish, Sylvan
> - **Challenge** 2 (450 XP)
> ___
> ***Charge.*** If the centaur moves at least 30 feet straight toward a target and then hits it with a pike attack on the same turn, the target takes an extra 10 (3d6) piercing damage.
>
> ***Second Thing*** More details.
>
> ### Actions
> ***Multiattack.*** The centaur makes two attacks: one with its pike and one with its hooves or two with its longbow.
>
> ***Pike.*** *Melee Weapon Attack:* +6 to hit, reach 10 ft., one target. *Hit:* 9 (1d10 + 4) piercing damage.
>
> ***Hooves.*** *Melee Weapon Attack:* +6 to hit, reach 5 ft., one target. *Hit:* 11 (2d6 + 4) bludgeoning damage.
>
> ***Longbow.*** *Ranged Weapon Attack:* +4 to hit, range 150/600 ft., one target. *Hit:* 6 (1d8 + 2) piercing damage.
-->
### Homebrewery v3 Example:
{{monster
## Centaur
*Large monstrosity, neutral good*
___
**Armor Class** :: 12
**Hit Points** :: 45(6d10 + 12)
**Speed** :: 50ft.
___
| STR | DEX | CON | INT | WIS | CHA |
|:-----:|:-----:|:-----:|:-----:|:-----:|:-----:|
|18 (+4)|14 (+2)|14 (+2)|9 (-1) |13 (+1)|11 (+0)|
___
**Skills** :: Athletics +6, Perception +3, Survival +3
**Senses** :: passive Perception 13
**Languages** :: Elvish, Sylvan
**Challenge** :: 2 (450 XP)
___
***Charge.*** If the centaur moves at least 30 feet straight toward a target and then hits it with a pike attack on the same turn, the target takes an extra 10 (3d6) piercing damage.
:
***Second Thing*** More details.
### Actions
***Multiattack.*** The centaur makes two attacks: one with its pike and one with its hooves or two with its longbow.
:
***Pike.*** *Melee Weapon Attack:* +6 to hit, reach 10 ft., one target. *Hit:* 9 (1d10 + 4) piercing damage.
:
***Hooves.*** *Melee Weapon Attack:* +6 to hit, reach 5 ft., one target. *Hit:* 11 (2d6 + 4) bludgeoning damage.
:
***Longbow.*** *Ranged Weapon Attack:* +4 to hit, range 150/600 ft., one target. *Hit:* 6 (1d8 + 2) piercing damage.
}}
{{pageNumber,auto}}

View File

@@ -1,4 +1,5 @@
# The Homebrewery # The Homebrewery
Welcome traveler from an antique land. Please sit and tell us of what you have seen. The unheard of monsters, who slither and bite. Tell us of the wondrous items and and artifacts you have found, their mysteries yet to be unlocked. Of the vexing vocations and surprising skills you have seen. Welcome traveler from an antique land. Please sit and tell us of what you have seen. The unheard of monsters, who slither and bite. Tell us of the wondrous items and and artifacts you have found, their mysteries yet to be unlocked. Of the vexing vocations and surprising skills you have seen.
### Homebrew D&D made easy ### Homebrew D&D made easy
@@ -45,7 +46,11 @@ With the latest major update to *The Homebrewery* we've implemented an extended
What's new in the latest update? Check out the full changelog [here](/changelog) What's new in the latest update? Check out the full changelog [here](/changelog)
### Bugs, Issues, Suggestions? ### Bugs, Issues, Suggestions?
Have an idea of how to make The Homebrewery better? Or did you find something that wasn't quite right? Head [here](https://www.reddit.com/r/homebrewery/submit?selftext=true&title=%5BIssue%5D%20Describe%20Your%20Issue%20Here) and let me know!. Take a quick look at our [Frequently Asked Questions page](/faq) to see if your question has a handy answer.
Need help getting started or just the right look for your brew? Head to [r/Homebrewery](https://www.reddit.com/r/homebrewery/submit?selftext=true&title=%5BIssue%5D%20Describe%20Your%20Issue%20Here) and let us know!
Have an idea to make The Homebrewery better? Or did you find something that wasn't quite right? Check out the [GitHub Repo](https://github.com/naturalcrit/homebrewery/) to report technical issues.
### Legal Junk ### Legal Junk
The Homebrewery is licensed using the [MIT License](https://github.com/naturalcrit/homebrewery/blob/master/license). This means you are free to use The Homebrewery codebase any way that you want, except for claiming that you made it yourself. The Homebrewery is licensed using the [MIT License](https://github.com/naturalcrit/homebrewery/blob/master/license). This means you are free to use The Homebrewery codebase any way that you want, except for claiming that you made it yourself.
@@ -53,17 +58,20 @@ The Homebrewery is licensed using the [MIT License](https://github.com/naturalcr
If you wish to sell or in some way gain profit for what you make on this site, it's your responsibility to ensure you have the proper licenses/rights for any images or resources used. If you wish to sell or in some way gain profit for what you make on this site, it's your responsibility to ensure you have the proper licenses/rights for any images or resources used.
### More Resources ### More Resources
If you are looking for more 5e Homebrew resources check out [r/UnearthedArcana](https://www.reddit.com/r/UnearthedArcana/) and their list of useful resources [here](https://www.reddit.com/r/UnearthedArcana/comments/3uwxx9/resources_open_to_the_community/). <a href='https://discord.gg/by3deKx' target='_blank'><img src='/assets/discordOfManyThings.svg' alt='Discord of Many Things Logo' title='Discord of Many Things Logo' style='width:50px; float: right; padding-left: 10px;'/></a>
If you are looking for more 5e Homebrew resources check out [r/UnearthedArcana](https://www.reddit.com/r/UnearthedArcana/) and their list of useful resources [here](https://www.reddit.com/r/UnearthedArcana/wiki/resources). The Discord of Many Things is another great resource to connect with fellow homebrewers for help and feedback.
<img src='https://i.imgur.com/hMna6G0.png' style='position:absolute;bottom:40px;right:30px;width:280px' />
<img src='https://i.imgur.com/hMna6G0.png' style='position:absolute;bottom:50px;right:30px;width:280px' />
<div class='pageNumber'>1</div> <div class='pageNumber'>1</div>
<div class='footnote'>PART 1 | FANCINESS</div> <div class='footnote'>PART 1 | FANCINESS</div>
<div style='position: absolute; top: 40px; right: 60px;'>
<a href='https://discord.gg/by3deKx' target='_blank' title='Discord of Many Things'><img src='/assets/discord.png' height='36px'/></a><span style='position: absolute; left: -4px; top: 40px'>Discord</span>
<a href='https://github.com/naturalcrit/homebrewery' target='_blank' title='github' style='color: black; padding-left: 10px;'><img src='/assets/github.png' height='36px'/></a><span style='position: absolute; top: 40px; left: 48px'>Github</span>
<a href='https://patreon.com/NaturalCrit' target='_blank' title='patreon' style='color: black; padding-left: 10px;'><img src='/assets/patreon.png' height='36px'/></a><span style='position: absolute; top: 40px; right: 46px'>Patreon</span>
<a href='https://www.reddit.com/r/homebrewery/' target='_blank' title='reddit' style='color: black; padding-left: 10px;'><img src='/assets/reddit.png' height='36px'/></a><span style='position: absolute; top: 40px; right: 0px;'>Reddit</span>
</div>
\page \page

View File

@@ -2,7 +2,6 @@
.page #example + table td { .page #example + table td {
border:1px dashed #00000030; border:1px dashed #00000030;
} }
.page { .page {
padding-bottom : 1.1cm; padding-bottom : 1.1cm;
} }
@@ -34,25 +33,37 @@ After clicking the "Print" item in the navbar a new page will open and a print d
* In **Options** make sure "Background Images" is selected. * In **Options** make sure "Background Images" is selected.
* Hit print and enjoy! You're done! * Hit print and enjoy! You're done!
If you want to save ink or have a monochrome printer, add the **PRINT → {{fas,fa-tint}} Ink Friendly** snippet to your brew before you print If you want to save ink or have a monochrome printer, add the **PRINT → {{fas,fa-tint}} Ink Friendly** snippet to your brew!
}} }}
<img src='https://i.imgur.com/hMna6G0.png' style='position:absolute;bottom:50px;left:120px;width:180px' /> ![homebrew mug](http://i.imgur.com/hMna6G0.png) {position:absolute,bottom:20px,left:130px,width:220px}
<div class='pageNumber'>1</div> {{artist,bottom:160px,left:100px
<div class='footnote'>PART 1 | FANCINESS</div> ##### Homebrew Mug
[naturalcrit](https://homebrew.naturalcrit.com)
}}
{{position:absolute;top:40px;right:-580px
<a href='https://discord.gg/by3deKx' target='_blank' title='discord' style='color: black;'><img src='/assets/discord.png' height='36px'/></a><span style='position: absolute; left: -6px; top: 40px'>Discord</span>
<a href='https://github.com/naturalcrit/homebrewery' target='_blank' title='github' style='color: black; padding-left: 10px;'><img src='/assets/github.png' height='36px'/></a><span style='position: absolute; top: 40px; left: 47px'>Github</span>
<a href='https://patreon.com/NaturalCrit' target='_blank' title='patreon' style='color: black; padding-left: 10px;'><img src='/assets/patreon.png' height='36px'/></a><span style='position: absolute; top: 40px; left: 93px'>Patreon</span>
<a href='https://www.reddit.com/r/homebrewery/' target='_blank' title='reddit' style='color: black; padding-left: 10px;'><img src='/assets/reddit.png' height='36px'/></a><span style='position: absolute; top: 40px; left: 147px;'>Reddit</span>
}}
{{pageNumber 1}}
{{footnote PART 1 | FANCINESS}}
\column \column
## New in V3.0.0 ## New in V3.0.0
With the latest major update to *The Homebrewery* we've implemented an extended Markdown-like syntax for block and span elements, plus a few other changes, eliminating the need for HTML tags like `div` and `span` in most cases. No raw HTML tags should be needed in a brew, and going forward, raw HTML will no longer receive debugging support (*but can still be used if you insist*). We've implemented an extended Markdown-like syntax for block and span elements, plus a few other changes, eliminating the need for HTML tags like `div` and `span` in most cases. No raw HTML tags should be needed in a brew (*but can still be used if you insist*).
Much of the syntax and styling has changed in V3. Code in one version may be broken in the other, and updating an older brew to V3 will require more than just a copy and paste. *However*, all brews made prior to the release of v3.0.0 will still render normally, and you may switch between the "Legacy" brew renderer and the newer "V3" renderer via the {{fa,fa-info-circle}} **Properties** button on your brew at any time. Much of the syntax and styling has changed in V3, so converting a Legacy brew to V3 (or vice-versa) will require tweaking your document. *However*, all brews made prior to the release of v3.0.0 will still render normally, and you may switch between the "Legacy" brew renderer and the newer "V3" renderer via the {{fa,fa-info-circle}} **Properties** button on your brew at any time.
Scroll down to the next page for a brief summary of the changes and new features available in V3! Scroll down to the next page for a brief summary of the changes and new features available in V3!
#### New Things All The Time! #### New Things All The Time!
What's new in the latest update? Check out the full changelog [here](/changelog). Check out the latest updates in the full changelog [here](/changelog).
### Helping out ### Helping out
Like this tool? Want to buy me a beer? [Head here](https://www.patreon.com/Naturalcrit) to help me keep the servers running. Like this tool? Want to buy me a beer? [Head here](https://www.patreon.com/Naturalcrit) to help me keep the servers running.
@@ -60,6 +71,8 @@ Like this tool? Want to buy me a beer? [Head here](https://www.patreon.com/Natur
This tool will **always** be free, never have ads, and I will never offer any "premium" features or whatever. This tool will **always** be free, never have ads, and I will never offer any "premium" features or whatever.
### Bugs, Issues, Suggestions? ### Bugs, Issues, Suggestions?
Take a quick look at our [Frequently Asked Questions page](/faq) to see if your question has a handy answer.
Need help getting started or just the right look for your brew? Head to [r/Homebrewery](https://www.reddit.com/r/homebrewery/submit?selftext=true&title=%5BIssue%5D%20Describe%20Your%20Issue%20Here) and let us know! Need help getting started or just the right look for your brew? Head to [r/Homebrewery](https://www.reddit.com/r/homebrewery/submit?selftext=true&title=%5BIssue%5D%20Describe%20Your%20Issue%20Here) and let us know!
Have an idea to make The Homebrewery better? Or did you find something that wasn't quite right? Check out the [GitHub Repo](https://github.com/naturalcrit/homebrewery/) to report technical issues. Have an idea to make The Homebrewery better? Or did you find something that wasn't quite right? Check out the [GitHub Repo](https://github.com/naturalcrit/homebrewery/) to report technical issues.
@@ -72,9 +85,9 @@ If you wish to sell or in some way gain profit for what's created on this site,
#### Crediting Me #### Crediting Me
If you'd like to credit me in your brew, I'd be flattered! Just reference that you made it with The Homebrewery. If you'd like to credit me in your brew, I'd be flattered! Just reference that you made it with The Homebrewery.
### More Resources ### More Homebrew Resources
If you are looking for more 5e Homebrew resources check out [r/UnearthedArcana](https://www.reddit.com/r/UnearthedArcana/) and their list of useful resources [here](https://www.reddit.com/r/UnearthedArcana/comments/3uwxx9/resources_open_to_the_community/). <a href='https://discord.gg/by3deKx' target='_blank'><img src='/assets/discordOfManyThings.svg' alt='Discord of Many Things Logo' title='Discord of Many Things Logo' style='width:50px; float: right; padding-left: 10px;'/></a>
If you are looking for more 5e Homebrew resources check out [r/UnearthedArcana](https://www.reddit.com/r/UnearthedArcana/) and their list of useful resources [here](https://www.reddit.com/r/UnearthedArcana/wiki/resources). The <a href='https://discord.gg/by3deKx' target='_blank' title='Discord of Many Things'>Discord of Many Things</a> is another great resource to connect with fellow homebrewers for help and feedback.
\page \page
@@ -84,7 +97,6 @@ The Homebrewery aims to make homebrewing as simple as possible, providing a live
In version 3.0.0, with a goal of adding maximum flexibility without users resorting to complex HTML to accomplish simple tasks, Homebrewery provides an extended verision of Markdown with additional syntax. In version 3.0.0, with a goal of adding maximum flexibility without users resorting to complex HTML to accomplish simple tasks, Homebrewery provides an extended verision of Markdown with additional syntax.
**You can enable V3 via the {{fa,fa-info-circle}} Properties button!** **You can enable V3 via the {{fa,fa-info-circle}} Properties button!**
### Curly Brackets ### Curly Brackets
The biggest change in V3 is the replacement of `<span></span>` and `<div></div>` with `{{ }}` for a cleaner custom formatting. Inline spans and block elements can be created and given ID's and Classes, as well as css properties, each of which are comma separated with no spaces. Use double quotes if a value requires spaces. Spans and Blocks start the same: The biggest change in V3 is the replacement of `<span></span>` and `<div></div>` with `{{ }}` for a cleaner custom formatting. Inline spans and block elements can be created and given ID's and Classes, as well as css properties, each of which are comma separated with no spaces. Use double quotes if a value requires spaces. Spans and Blocks start the same:
@@ -97,7 +109,6 @@ My favorite author is {{pen,#author,color:orange,font-family:"trebuchet ms" Bran
My favorite book is Wheel of Time. This block has a class of `purple`, an id of `book`, and centered text with a colored background. The opening and closing brackets are on lines separate from the block contents. My favorite book is Wheel of Time. This block has a class of `purple`, an id of `book`, and centered text with a colored background. The opening and closing brackets are on lines separate from the block contents.
}} }}
#### Injection #### Injection
For any element not inside a span or block, you can *inject* attributes using the same syntax but with single brackets in a single line immediately after the element. For any element not inside a span or block, you can *inject* attributes using the same syntax but with single brackets in a single line immediately after the element.
@@ -118,9 +129,7 @@ A blank line can be achieved with a run of one or more `:` alone on a line. More
Much nicer than `<br><br><br><br><br>` Much nicer than `<br><br><br><br><br>`
### Definition Lists ### Definition Lists
V3 uses HTML *definition lists* to create "lists" with hanging indents. **Example** :: V3 uses HTML *definition lists* to create "lists" with hanging indents.
**Senses** :: Here is some text that is long and overflows into a second line, creating a "hanging indent".
### Column Breaks ### Column Breaks
Column and page breaks with `\column` and `\page`. Column and page breaks with `\column` and `\page`.
@@ -148,9 +157,9 @@ These can be combined to span a cell across both columns and rows. Cells must ha
| 6A | 6B ^| 6C | | 6A | 6B ^| 6C |
## Images ## Images
Images must be hosted online somewhere, like [Imgur](https://www.imgur.com). You use the address to that image to reference it in your brew\*. Images can be included using Markdown-style images. Images must be hosted online somewhere, like [Imgur](https://www.imgur.com). You use the address to that image to reference it in your brew\*.
Using *Curly Injection* you can assign an id, classes, or specific inline CSS properties to the image. Using *Curly Injection* you can assign an id, classes, or inline CSS properties to the Markdown image syntax.
![alt-text](https://s-media-cache-ak0.pinimg.com/736x/4a/81/79/4a8179462cfdf39054a418efd4cb743e.jpg) {width:100px,border:"2px solid",border-radius:10px} ![alt-text](https://s-media-cache-ak0.pinimg.com/736x/4a/81/79/4a8179462cfdf39054a418efd4cb743e.jpg) {width:100px,border:"2px solid",border-radius:10px}
@@ -159,12 +168,8 @@ Using *Curly Injection* you can assign an id, classes, or specific inline CSS pr
## Snippets ## Snippets
Homebrewery comes with a series of *code snippets* found at the top of the editor pane that make it easy to create brews as quickly as possible. Just set your cursor where you want the code to appear in the editor pane, choose a snippet, and make the adjustments you need. Homebrewery comes with a series of *code snippets* found at the top of the editor pane that make it easy to create brews as quickly as possible. Just set your cursor where you want the code to appear in the editor pane, choose a snippet, and make the adjustments you need.
## Style Editor Panel ## Style Editor Panel
{{fa,fa-paint-brush}} Technically released prior to v3 but still new to many users, check out the new **Style Editor** located on the right side of the Snippet bar. This editor accepts CSS for styling without requiring `<style>` tags-- anything that would have gone inside style tags before can now be placed here, and snippets that insert CSS styles are now located on that tab. {{fa,fa-paint-brush}} Technically released prior to v3 but still new to many users, check out the new **Style Editor** located on the right side of the Snippet bar. This editor accepts CSS for styling without requiring `<style>` tags-- anything that would have gone inside style tags before can now be placed here, and snippets that insert CSS styles are now located on that tab.
{{pageNumber 2}}
{{footnote PART 2 | BORING STUFF}}
<div class='pageNumber'>2</div>
<div class='footnote'>PART 2 | BORING STUFF</div>

View File

@@ -11,7 +11,7 @@ const Nav = require('naturalcrit/nav/nav.jsx');
const Navbar = require('../../navbar/navbar.jsx'); const Navbar = require('../../navbar/navbar.jsx');
const AccountNavItem = require('../../navbar/account.navitem.jsx'); const AccountNavItem = require('../../navbar/account.navitem.jsx');
const RecentNavItem = require('../../navbar/recent.navitem.jsx').both; const RecentNavItem = require('../../navbar/recent.navitem.jsx').both;
const IssueNavItem = require('../../navbar/issue.navitem.jsx'); const HelpNavItem = require('../../navbar/help.navitem.jsx');
const SplitPane = require('naturalcrit/splitPane/splitPane.jsx'); const SplitPane = require('naturalcrit/splitPane/splitPane.jsx');
const Editor = require('../../editor/editor.jsx'); const Editor = require('../../editor/editor.jsx');
@@ -23,6 +23,7 @@ const METAKEY = 'homebrewery-new-meta';
const NewPage = createClass({ const NewPage = createClass({
displayName : 'NewPage',
getDefaultProps : function() { getDefaultProps : function() {
return { return {
brew : { brew : {
@@ -45,47 +46,44 @@ const NewPage = createClass({
}, },
getInitialState : function() { getInitialState : function() {
const brew = this.props.brew;
if(typeof window !== 'undefined') { //Load from localStorage if in client browser
const brewStorage = localStorage.getItem(BREWKEY);
const styleStorage = localStorage.getItem(STYLEKEY);
const metaStorage = JSON.parse(localStorage.getItem(METAKEY));
if(!brew.text || !brew.style){
brew.text = brew.text || (brewStorage ?? '');
brew.style = brew.style || (styleStorage ?? undefined);
// brew.title = metaStorage?.title || this.state.brew.title;
// brew.description = metaStorage?.description || this.state.brew.description;
brew.renderer = metaStorage?.renderer || brew.renderer;
}
}
return { return {
brew : { brew : {
text : this.props.brew.text || '', text : brew.text || '',
style : this.props.brew.style || undefined, style : brew.style || undefined,
gDrive : false, gDrive : false,
title : this.props.brew.title || '', title : brew.title || '',
description : this.props.brew.description || '', description : brew.description || '',
tags : this.props.brew.tags || '', tags : brew.tags || '',
published : false, published : false,
authors : [], authors : [],
systems : this.props.brew.systems || [], systems : brew.systems || [],
renderer : this.props.brew.renderer || 'legacy' renderer : brew.renderer || 'legacy'
}, },
isSaving : false, isSaving : false,
saveGoogle : (global.account && global.account.googleId ? true : false), saveGoogle : (global.account && global.account.googleId ? true : false),
errors : null, errors : null,
htmlErrors : Markdown.validate(this.props.brew.text) htmlErrors : Markdown.validate(brew.text)
}; };
}, },
componentDidMount : function() { componentDidMount : function() {
const brewStorage = localStorage.getItem(BREWKEY);
const styleStorage = localStorage.getItem(STYLEKEY);
const metaStorage = JSON.parse(localStorage.getItem(METAKEY));
const brew = this.state.brew;
if(!this.state.brew.text || !this.state.brew.style){
brew.text = this.state.brew.text || (brewStorage ?? '');
brew.style = this.state.brew.style || (styleStorage ?? undefined);
// brew.title = metaStorage?.title || this.state.brew.title;
// brew.description = metaStorage?.description || this.state.brew.description;
brew.renderer = metaStorage?.renderer || this.state.brew.renderer;
}
this.setState((prevState)=>({
brew : brew,
htmlErrors : Markdown.validate(prevState.brew.text)
}));
document.addEventListener('keydown', this.handleControlKeys); document.addEventListener('keydown', this.handleControlKeys);
}, },
componentWillUnmount : function() { componentWillUnmount : function() {
@@ -146,14 +144,6 @@ const NewPage = createClass({
}); });
}, },
clearErrors : function(){
this.setState({
errors : null,
isSaving : false
});
},
save : async function(){ save : async function(){
this.setState({ this.setState({
isSaving : true isSaving : true
@@ -237,14 +227,14 @@ const NewPage = createClass({
</Nav.item>; </Nav.item>;
} }
if(this.state.errors.status == '403' && this.state.errors.response.body.errors[0].reason == 'insufficientPermissions'){ if(this.state.errors.response.req.url.match(/^\/api\/.*Google.*$/m)){
return <Nav.item className='save error' icon='fas fa-exclamation-triangle'> return <Nav.item className='save error' icon='fas fa-exclamation-triangle'>
Oops! Oops!
<div className='errorContainer' onClick={this.clearErrors}> <div className='errorContainer' onClick={this.clearErrors}>
Looks like your Google credentials have Looks like your Google credentials have
expired! Visit the log in page to sign out expired! Visit our log in page to sign out
and sign back in with Google and sign back in with Google,
to save this to Google Drive! then try saving again!
<a target='_blank' rel='noopener noreferrer' <a target='_blank' rel='noopener noreferrer'
href={`https://www.naturalcrit.com/login?redirect=${this.state.url}`}> href={`https://www.naturalcrit.com/login?redirect=${this.state.url}`}>
<div className='confirm'> <div className='confirm'>
@@ -282,7 +272,6 @@ const NewPage = createClass({
}, },
print : function(){ print : function(){
localStorage.setItem('print', `<style>\n${this.state.brew.style}\n</style>\n\n${this.state.brew.text}`);
window.open('/print?dialog=true&local=print', '_blank'); window.open('/print?dialog=true&local=print', '_blank');
}, },
@@ -302,7 +291,7 @@ const NewPage = createClass({
<Nav.section> <Nav.section>
{this.renderSaveButton()} {this.renderSaveButton()}
{this.renderLocalPrintButton()} {this.renderLocalPrintButton()}
<IssueNavItem /> <HelpNavItem />
<RecentNavItem /> <RecentNavItem />
<AccountNavItem /> <AccountNavItem />
</Nav.section> </Nav.section>

View File

@@ -7,7 +7,12 @@ const { Meta } = require('vitreum/headtags');
const MarkdownLegacy = require('naturalcrit/markdownLegacy.js'); const MarkdownLegacy = require('naturalcrit/markdownLegacy.js');
const Markdown = require('naturalcrit/markdown.js'); const Markdown = require('naturalcrit/markdown.js');
const BREWKEY = 'homebrewery-new';
const STYLEKEY = 'homebrewery-new-style';
const METAKEY = 'homebrewery-new-meta';
const PrintPage = createClass({ const PrintPage = createClass({
displayName : 'PrintPage',
getDefaultProps : function() { getDefaultProps : function() {
return { return {
query : {}, query : {},
@@ -21,23 +26,42 @@ const PrintPage = createClass({
getInitialState : function() { getInitialState : function() {
return { return {
brewText : this.props.brew.text brew : {
text : this.props.brew.text || '',
style : this.props.brew.style || undefined,
renderer : this.props.brew.renderer || 'legacy'
}
}; };
}, },
componentDidMount : function() { componentDidMount : function() {
if(this.props.query.local){ if(this.props.query.local == 'print'){
this.setState((prevState, prevProps)=>({ const brewStorage = localStorage.getItem(BREWKEY);
brewText : localStorage.getItem(prevProps.query.local) const styleStorage = localStorage.getItem(STYLEKEY);
})); const metaStorage = JSON.parse(localStorage.getItem(METAKEY));
this.setState((prevState, prevProps)=>{
return {
brew : {
text : brewStorage,
style : styleStorage,
renderer : metaStorage.renderer || 'legacy'
}
};
});
} }
if(this.props.query.dialog) window.print(); if(this.props.query.dialog) window.print();
}, },
renderStyle : function() {
if(!this.state.brew.style) return;
return <div style={{ display: 'none' }} dangerouslySetInnerHTML={{ __html: `<style> ${this.state.brew.style} </style>` }} />;
},
renderPages : function(){ renderPages : function(){
if(this.props.brew.renderer == 'legacy') { if(this.state.brew.renderer == 'legacy') {
return _.map(this.state.brewText.split('\\page'), (pageText, index)=>{ return _.map(this.state.brew.text.split('\\page'), (pageText, index)=>{
return <div return <div
className='phb page' className='phb page'
id={`p${index + 1}`} id={`p${index + 1}`}
@@ -45,7 +69,7 @@ const PrintPage = createClass({
key={index} />; key={index} />;
}); });
} else { } else {
return _.map(this.state.brewText.split(/^\\page$/gm), (pageText, index)=>{ return _.map(this.state.brew.text.split(/^\\page$/gm), (pageText, index)=>{
pageText += `\n\n&nbsp;\n\\column\n&nbsp;`; //Artificial column break at page end to emulate column-fill:auto (until `wide` is used, when column-fill:balance will reappear) pageText += `\n\n&nbsp;\n\\column\n&nbsp;`; //Artificial column break at page end to emulate column-fill:auto (until `wide` is used, when column-fill:balance will reappear)
return ( return (
<div className='page' id={`p${index + 1}`} key={index} > <div className='page' id={`p${index + 1}`} key={index} >
@@ -60,10 +84,12 @@ const PrintPage = createClass({
render : function(){ render : function(){
return <div> return <div>
<Meta name='robots' content='noindex, nofollow' /> <Meta name='robots' content='noindex, nofollow' />
<link href={`${this.props.brew.renderer == 'legacy' ? '/themes/5ePhbLegacy.style.css' : '/themes/5ePhb.style.css'}`} rel='stylesheet'/> <link href={`${this.state.brew.renderer == 'legacy' ? '/themes/5ePhbLegacy.style.css' : '/themes/5ePhb.style.css'}`} rel='stylesheet'/>
{/* Apply CSS from Style tab */} {/* Apply CSS from Style tab */}
<div style={{ display: 'none' }} dangerouslySetInnerHTML={{ __html: `<style> ${this.props.brew.style} </style>` }} /> {this.renderStyle()}
{this.renderPages()} <div className='pages' ref='pages'>
{this.renderPages()}
</div>
</div>; </div>;
} }
}); });

View File

@@ -14,6 +14,7 @@ const BrewRenderer = require('../../brewRenderer/brewRenderer.jsx');
const SharePage = createClass({ const SharePage = createClass({
displayName : 'SharePage',
getDefaultProps : function() { getDefaultProps : function() {
return { return {
brew : { brew : {
@@ -29,23 +30,19 @@ const SharePage = createClass({
}; };
}, },
getInitialState : function() {
return {
showDropdown : false
};
},
componentDidMount : function() { componentDidMount : function() {
document.addEventListener('keydown', this.handleControlKeys); document.addEventListener('keydown', this.handleControlKeys);
}, },
componentWillUnmount : function() { componentWillUnmount : function() {
document.removeEventListener('keydown', this.handleControlKeys); document.removeEventListener('keydown', this.handleControlKeys);
}, },
handleControlKeys : function(e){ handleControlKeys : function(e){
if(!(e.ctrlKey || e.metaKey)) return; if(!(e.ctrlKey || e.metaKey)) return;
const P_KEY = 80; const P_KEY = 80;
if(e.keyCode == P_KEY){ if(e.keyCode == P_KEY){
window.open(`/print/${this.props.brew.shareId}?dialog=true`, '_blank').focus(); window.open(`/print/${this.processShareId()}?dialog=true`, '_blank').focus();
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
} }
@@ -57,28 +54,6 @@ const SharePage = createClass({
this.props.brew.shareId; this.props.brew.shareId;
}, },
handleDropdown : function(show){
this.setState({
showDropdown : show
});
},
renderDropdown : function(){
if(!this.state.showDropdown) return null;
return <div className='dropdown'>
<a href={`/source/${this.processShareId()}`} className='item'>
view
</a>
<a href={`/download/${this.processShareId()}`} className='item'>
download
</a>
<a href={`/new/${this.processShareId()}`} className='item'>
clone to new
</a>
</div>;
},
render : function(){ render : function(){
return <div className='sharePage sitePage'> return <div className='sharePage sitePage'>
<Meta name='robots' content='noindex, nofollow' /> <Meta name='robots' content='noindex, nofollow' />
@@ -90,12 +65,20 @@ const SharePage = createClass({
<Nav.section> <Nav.section>
{this.props.brew.shareId && <> {this.props.brew.shareId && <>
<PrintLink shareId={this.processShareId()} /> <PrintLink shareId={this.processShareId()} />
<Nav.item icon='fas fa-code' color='red' className='source' <Nav.dropdown>
onMouseEnter={()=>this.handleDropdown(true)} <Nav.item color='red' icon='fas fa-code'>
onMouseLeave={()=>this.handleDropdown(false)}> source
source </Nav.item>
{this.renderDropdown()} <Nav.item color='blue' href={`/source/${this.processShareId()}`}>
</Nav.item> view
</Nav.item>
<Nav.item color='blue' href={`/download/${this.processShareId()}`}>
download
</Nav.item>
<Nav.item color='blue' href={`/new/${this.processShareId()}`}>
clone to new
</Nav.item>
</Nav.dropdown>
</>} </>}
<RecentNavItem brew={this.props.brew} storageKey='view' /> <RecentNavItem brew={this.props.brew} storageKey='view' />
<Account /> <Account />

View File

@@ -2,49 +2,4 @@
.content{ .content{
overflow-y : hidden; overflow-y : hidden;
} }
.source.navItem{ }
position : relative;
.dropdown{
position : absolute;
top : 28px;
left : 0px;
z-index : 10000;
width : 100%;
h4{
display : block;
box-sizing : border-box;
padding : 5px 0px;
background-color : #333;
font-size : 0.8em;
color : #bbb;
text-align : center;
border-top : 1px solid #888;
&:nth-of-type(1){ background-color: darken(@teal, 20%); }
&:nth-of-type(2){ background-color: darken(@purple, 30%); }
}
.item{
.animate(background-color);
position : relative;
display : block;
width : 100%;
vertical-align : middle;
padding : 13px 5px;
box-sizing : border-box;
background-color : #333;
color : white;
text-decoration : none;
border-top : 1px solid #888;
&:hover{
background-color : @blue;
}
.title{
display : inline-block;
overflow : hidden;
width : 100%;
text-overflow : ellipsis;
white-space : nowrap;
}
}
}
}
}

View File

@@ -7,8 +7,10 @@ const moment = require('moment');
const request = require('superagent'); const request = require('superagent');
const googleDriveIcon = require('../../../googleDrive.png'); const googleDriveIcon = require('../../../googleDrive.png');
const dedent = require('dedent-tabs').default;
const BrewItem = createClass({ const BrewItem = createClass({
displayName : 'BrewItem',
getDefaultProps : function() { getDefaultProps : function() {
return { return {
brew : { brew : {
@@ -47,7 +49,7 @@ const BrewItem = createClass({
renderDeleteBrewLink : function(){ renderDeleteBrewLink : function(){
if(!this.props.brew.editId) return; if(!this.props.brew.editId) return;
return <a onClick={this.deleteBrew}> return <a className='deleteLink' onClick={this.deleteBrew}>
<i className='fas fa-trash-alt' title='Delete' /> <i className='fas fa-trash-alt' title='Delete' />
</a>; </a>;
}, },
@@ -60,7 +62,7 @@ const BrewItem = createClass({
editLink = this.props.brew.googleId + editLink; editLink = this.props.brew.googleId + editLink;
} }
return <a href={`/edit/${editLink}`} target='_blank' rel='noopener noreferrer'> return <a className='editLink' href={`/edit/${editLink}`} target='_blank' rel='noopener noreferrer'>
<i className='fas fa-pencil-alt' title='Edit' /> <i className='fas fa-pencil-alt' title='Edit' />
</a>; </a>;
}, },
@@ -73,7 +75,7 @@ const BrewItem = createClass({
shareLink = this.props.brew.googleId + shareLink; shareLink = this.props.brew.googleId + shareLink;
} }
return <a href={`/share/${shareLink}`} target='_blank' rel='noopener noreferrer'> return <a className='shareLink' href={`/share/${shareLink}`} target='_blank' rel='noopener noreferrer'>
<i className='fas fa-share-alt' title='Share' /> <i className='fas fa-share-alt' title='Share' />
</a>; </a>;
}, },
@@ -86,7 +88,7 @@ const BrewItem = createClass({
shareLink = this.props.brew.googleId + shareLink; shareLink = this.props.brew.googleId + shareLink;
} }
return <a href={`/download/${shareLink}`}> return <a className='downloadLink' href={`/download/${shareLink}`}>
<i className='fas fa-download' title='Download' /> <i className='fas fa-download' title='Download' />
</a>; </a>;
}, },
@@ -110,6 +112,10 @@ const BrewItem = createClass({
</div> </div>
<hr /> <hr />
<div className='info'> <div className='info'>
<span title={`Authors:\n${brew.authors.join('\n')}`}>
<i className='fas fa-user'/> {brew.authors.join(', ')}
</span>
<br />
<span title={`Last viewed: ${moment(brew.lastViewed).local().format(dateFormatString)}`}> <span title={`Last viewed: ${moment(brew.lastViewed).local().format(dateFormatString)}`}>
<i className='fas fa-eye'/> {brew.views} <i className='fas fa-eye'/> {brew.views}
</span> </span>
@@ -118,14 +124,12 @@ const BrewItem = createClass({
<i className='far fa-file' /> {brew.pageCount} <i className='far fa-file' /> {brew.pageCount}
</span> </span>
} }
<span> <span title={dedent`
Created: ${moment(brew.createdAt).local().format(dateFormatString)}
Last updated: ${moment(brew.updatedAt).local().format(dateFormatString)}`}>
<i className='fas fa-sync-alt' /> {moment(brew.updatedAt).fromNow()} <i className='fas fa-sync-alt' /> {moment(brew.updatedAt).fromNow()}
</span> </span>
{this.renderGoogleDriveIcon()} {this.renderGoogleDriveIcon()}
<br />
<span title={`Authors:\n${brew.authors.join('\n')}`}>
<i className='fas fa-user'/> {brew.authors.join(', ')}
</span>
</div> </div>
<div className='links'> <div className='links'>

View File

@@ -27,12 +27,11 @@
.info{ .info{
position: initial; position: initial;
bottom: 2px; bottom: 2px;
margin-bottom: 4px;
font-family : ScalySans; font-family : ScalySans;
font-size : 1.2em; font-size : 1.2em;
&>span{ &>span{
display : float;
margin-right : 12px; margin-right : 12px;
line-height : 1.5em;
} }
} }
&:hover{ &:hover{

View File

@@ -13,6 +13,7 @@ const RecentNavItem = require('../../navbar/recent.navitem.jsx').both;
const Account = require('../../navbar/account.navitem.jsx'); const Account = require('../../navbar/account.navitem.jsx');
const NewBrew = require('../../navbar/newbrew.navitem.jsx'); const NewBrew = require('../../navbar/newbrew.navitem.jsx');
const BrewItem = require('./brewItem/brewItem.jsx'); const BrewItem = require('./brewItem/brewItem.jsx');
const HelpNavItem = require('../../navbar/help.navitem.jsx');
// const brew = { // const brew = {
// title : 'SUPER Long title woah now', // title : 'SUPER Long title woah now',
@@ -23,6 +24,7 @@ const BrewItem = require('./brewItem/brewItem.jsx');
const UserPage = createClass({ const UserPage = createClass({
displayName : 'UserPage',
getDefaultProps : function() { getDefaultProps : function() {
return { return {
username : '', username : '',
@@ -85,7 +87,7 @@ const UserPage = createClass({
<button <button
value={`${sortValue}`} value={`${sortValue}`}
onClick={this.handleSortOptionChange} onClick={this.handleSortOptionChange}
className={`${(this.state.sortType == sortValue ? 'active' : '')}`} className={`sortOption ${(this.state.sortType == sortValue ? 'active' : '')}`}
> >
{`${sortTitle}`} {`${sortTitle}`}
</button> </button>
@@ -101,7 +103,7 @@ const UserPage = createClass({
renderFilterOption : function(){ renderFilterOption : function(){
return <td> return <td>
<label> <label className='filterOption'>
<i className='fas fa-search'></i> <i className='fas fa-search'></i>
<input <input
type='search' type='search'
@@ -162,6 +164,7 @@ const UserPage = createClass({
<Navbar> <Navbar>
<Nav.section> <Nav.section>
<NewBrew /> <NewBrew />
<HelpNavItem />
<RecentNavItem /> <RecentNavItem />
<Account /> <Account />
</Nav.section> </Nav.section>

View File

@@ -2,5 +2,6 @@
"host" : "homebrewery.local.naturalcrit.com:8000", "host" : "homebrewery.local.naturalcrit.com:8000",
"naturalcrit_url" : "local.naturalcrit.com:8010", "naturalcrit_url" : "local.naturalcrit.com:8010",
"secret" : "secret", "secret" : "secret",
"web_port" : 8000 "web_port" : 8000,
"enable_v3" : true
} }

152
faq.md Normal file
View File

@@ -0,0 +1,152 @@
```css
h5 {
font-size: .35cm !important;
}
.taskList li {
list-style-type : none;
}
.taskList li input {
margin-left : -0.52cm;
transform: translateY(.05cm);
filter: brightness(1.1) drop-shadow(1px 2px 1px #222);
}
.taskList li input[checked] {
filter: sepia(100%) hue-rotate(60deg) saturate(3.5) contrast(4) brightness(1.1) drop-shadow(1px 2px 1px #222);
}
pre + * {
margin-top: 0.17cm;
}
pre {
margin-top: 0.17cm;
}
.page pre code {
word-break:break-word;
}
.page p + pre {
margin-top : 0.1cm;
}
.page h1 + p:first-letter {
all:unset;
}
.page .toc ul {
margin-top:0;
}
.page h3 {
font-family:inherit;
font-size:inherit;
border:inherit;
margin-top:12px;
margin-bottom:5px
}
.page h3:before {
content:'Q.';
position:absolute;
font-size:2em;
margin-left:-1.2em;
}
.page .columnSplit + h3 {
margin-top:0;
}
```
# FAQ
{{wide Updated Oct. 11, 2021}}
### The site is down for me! Anyone else?
You can check the site status here: [Everyone or Just Me](https://downforeveryoneorjustme.com/homebrewery.naturalcrit.com)
### How do I log out?
Go to https://homebrewery.naturalcrit.com/login, and hit the "*logout*" link.
### Why am I getting an error when trying to save, and my account is linked to Google?
A sign-in with Google only lasts a year until the authentication expires. You must go [here](https://www.naturalcrit.com/login), click the *Log-out* button, and then sign back in using your Google account.
### I lost my password, how do I reset it? How do I change my password?
Homebrewery is specifically designed to not hold personal information as a measure to protect both users and admin, and does not require an email address. Thus it would be difficult to send a new password to a user. Reach out to the moderators on [the subreddit](https://www.reddit.com/r/homebrewery) with your Homebrewery username.
If you have linked your account with a Google account, you would change your password within Google.
### Is there a way to restore a previous version of my brew?
Currently, there is no way to do this through the site yourself. This would take too much of a toll on the amount of storage the homebrewery requires. However, we do have daily backups of our database that we keep for 8 days, and you can contact the moderators on [the subreddit](https://www.reddit.com/r/homebrewery) with your Homebrewery username, the name of the lost brew, and the last known time it was working properly. We can manually look through our backups and restore it if it exists.
### I worked on a brew for X hours, and suddenly all the text disappeared!
This usually happens if you accidentally drag-select all of your text and then start typing which overwrites the selection. Do not panic, and do not refresh the page or reload your brew quite yet as it is probably auto-saved in this state already. Simply press CTRL+Z as many times as needed to undo your last few changes and you will be back to where you were, then make sure to save your brew in the "good" state.
\column
### Why is only Chrome supported?
Different browsers have differing abilities to handle web styling (or "CSS"). For example, Firefox is not currently capable of handling column breaks well but Chrome has no problem. Also, each browser has slight differences in how they display pages which can make it a nightmare to compensate for. These capabilities change over time and we are hopeful that each browser update bridges these gaps and adds more features; until then, we will develop with one browser in mind.
### Both my friend and myself are using Chrome, but the brews still look different. Why?
A pixel can be rendered differently depending on the browser, operating system, computer, or screen. Unless you and your friend have exactly the same setup, it is likely your online brew will have very tiny differences. However, sometimes a few pixels is all it takes to create *big* differences....for example, an extra pixel can cause a whole line of text or even a monster stat block to run out of space in it's current column and be pushed to the next column or even off the page.
The best way to avoid this is to leave space at the end of a column equal to one or two lines of text. Or, create a PDF from your document for sharing--- PDF's are designed to be rendered the same on all devices.
### Why do I need to manually create a new page? Why doesn't text flow between pages?
A Homebrewery document is at it's core an HTML & CSS document, and currently limited by the specs of those technologies. It is currently not possible to flow content from inside one box ("page") to the inside of another box. It seems likely that someday CSS will add this capability, and if/when that happens, Homebrewery will adopt it as soon as possible.
### Where do I get images?
The Homebrewery does not provide images for use besides some page elements and example images for snippets. You will need to find your own images for use and be sure you are following the appropriate license requirements.
Once you have an image you would like to use, it is recommended to host it somewhere that won't disappear; commonly, people host their images on [Imgur](https://www.imgur.com). Create an account and upload your images there, and use the *Direct Link* that is shown when you click into the image from the gallery in your Homebrewery document.
\page
### A particular font does not work for my language, what do I do?
The fonts used were originally created for use with the English language, though revisions since then have added more support for other languages. They are still not complete sets and may be missing a glyph/character you need. Unfortunately, the volunteer group as it stands at the time of this writing does not have a font guru, so it would be difficult to add more glyphs (especially complicated glyphs). Let us know which glyph is missing on the subreddit, but you may need to search [Google Fonts](https://fonts.google.com) for an alternative font if you need something fast.
### Whenever I click on the "Get PDF" button, instead of getting a download, it opens Print Preview in another tab.
Yes, this is by design. In the print preview, select "Save as PDF" as the Destination, and then click "Save". There will be a normal download dialog where you can save your brew as a PDF.
### The preview window is suddenly gone, I can only see the editor side of the Homebrewery (or the other way around).
1. Press `CTRL`+`SHIFT`+`i` (or right-click and select "Inspect") while in the Homebrewery.
2. Expand...
```
- `body`
- `main`
- `div class="homebrew"`
- `div class="editPage page"`
- `div class="content"`
- `div class="splitPane"`
```
There you will find 3 divs: `div class="pane" [...]`, `div class="divider" [...]`, and `div class="pane" [...]`.
The `class="pane"` looks similar to this: `div class="pane" data-reactid="36" style="flex: 0 0 auto; width: 925px;"`.
Change whatever stands behind width: to something smaller than your display width.
### I have white borders on the bottom/sides of the print preview.
The Homebrewery paper size and your print paper size do not match.
The Homebrewery defaults to creating US Letter page sizes. If you are printing with A4 size paper, you must add the "A4 Page Size" snippet. In the "Print" dialog be sure your Paper Size matches the page size in Homebrewery.
### Typing `#### Adhesion` in the text editor doesn't show the header at all in the completed page?
Your ad-blocking software is mistakenly assuming your text to be an ad. Whitelist homebrewery.naturalcrit.com in your ad-blocking software.

View File

@@ -10,7 +10,7 @@ These instructions assume that you are installing to a completely new, fresh Fre
2. Install wget (`pkg install -y wget`). On a fresh jail, you will be prompted to press 'Y' to set up `pkg`. 2. Install wget (`pkg install -y wget`). On a fresh jail, you will be prompted to press 'Y' to set up `pkg`.
3. Download the installation script (`wget --no-check-certificate https://raw.githubusercontent.com/naturalcrit/homebrewery/master/freebsd/install.sh`). The parameter `--no-check-certificate` is required as we haven't set up any trusted certificates/authorities yet. 3. Download the installation script (`wget --no-check-certificate https://raw.githubusercontent.com/naturalcrit/homebrewery/master/install/freebsd/install.sh`). The parameter `--no-check-certificate` is required as we haven't set up any trusted certificates/authorities yet.
4. Make the downloaded file executable (`chmod +x install.sh`). 4. Make the downloaded file executable (`chmod +x install.sh`).

35
install/README.UBUNTU.md Normal file
View File

@@ -0,0 +1,35 @@
# Ubuntu Installation Instructions
## Before Installing
These instructions assume that you are installing to a completely new, fresh Ubuntu installation. As such, some steps will not be necessary if you are installing to an existing Ubuntu instance.
## Installation instructions
1. Install Ubuntu.
2. Install wget (`apt install -y wget`). This may already be installed, depending on your exact Ubuntu version.
3. Download the installation script (`wget https://raw.githubusercontent.com/naturalcrit/homebrewery/master/install/ubuntu/install.sh`).
4. Make the downloaded file executable (`chmod +x install.sh`).
5. Run the script (`sudo ./install.sh`). This will automatically download all of the required packages, install both them and HomeBrewery, configure the system and finally start HomeBrewery.
**NOTE:** At this time, the script **ONLY** installs HomeBrewery. It does **NOT** install the NaturalCrit login system, as that is currently a completely separate project.
---
### Testing
These installation instructions have been tested on the following Ubuntu releases:
- *ubuntu-20.04.3-desktop-amd64*
## Final Notes
While this installation process works successfully at the time of writing (December 19, 2021), it relies on all of the Node.JS packages used in the HomeBrewery project retaining their cross-platform capabilities to continue to function. This is one of the inherent advantages of Node.JS, but it is by no means guaranteed and as such, functionality or even installation may fail without warning at some point in the future.
Regards,
G
December 19, 2021

View File

@@ -0,0 +1,13 @@
[Unit]
Description=Homebrewery Web Server
[Service]
User=root
After=mongodb
Environment=NODE_ENV=local
WorkingDirectory=/usr/local/homebrewery
ExecStart=node server.js
Restart=always
[Install]
WantedBy=multi-user.target

34
install/ubuntu/install.sh Normal file
View File

@@ -0,0 +1,34 @@
#!/bin/sh
# Install CURL and add required NodeJS source to package repo
echo ::Install CURL
apt install -y curl
echo ::Add NodeJS source to package repo
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
# Install required packages
echo ::Install Homebrewery requirements
apt satisfy -y git nodejs npm mongodb
# Clone Homebrewery repo
echo ::Get Homebrewery files
cd /usr/local/
git clone https://github.com/naturalcrit/homebrewery.git
# Install Homebrewery
echo ::Install Homebrewery
cd homebrewery
npm install
npm audit fix
npm run postinstall
# Create Homebrewery service
echo ::Create Homebrewery service
ln -s /usr/local/homebrewery/install/ubuntu/etc/systemd/system/homebrewery.service /etc/systemd/system/homebrewery.service
systemctl daemon-reload
echo ::Set Homebrewery to start automatically
systemctl enable homebrewery
# Start Homebrewery
echo ::Start Homebrewery
systemctl start homebrewery

11372
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,9 @@
{ {
"name": "homebrewery", "name": "homebrewery",
"description": "Create authentic looking D&D homebrews using only markdown", "description": "Create authentic looking D&D homebrews using only markdown",
"version": "3.0.0", "version": "3.0.7",
"engines": { "engines": {
"node": "14.15.x" "node": "16.11.x"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@@ -18,8 +18,8 @@
"lint:dry": "eslint **/*.{js,jsx}", "lint:dry": "eslint **/*.{js,jsx}",
"circleci": "npm test && eslint **/*.{js,jsx} --max-warnings=0", "circleci": "npm test && eslint **/*.{js,jsx} --max-warnings=0",
"verify": "npm run lint && npm test", "verify": "npm run lint && npm test",
"test": "pico-check", "test": "jest",
"test:dev": "pico-check -v -w", "test:dev": "jest --verbose --watch",
"phb": "node scripts/phb.js", "phb": "node scripts/phb.js",
"prod": "set NODE_ENV=production && npm run build", "prod": "set NODE_ENV=production && npm run build",
"postinstall": "npm run buildall", "postinstall": "npm run buildall",
@@ -30,42 +30,50 @@
"eslintIgnore": [ "eslintIgnore": [
"build/*" "build/*"
], ],
"pico-check": { "jest": {
"require": "./tests/test.init.js" "modulePaths": [
"mode_modules",
"shared",
"server"
]
}, },
"babel": { "babel": {
"presets": [ "presets": [
"@babel/preset-env", "@babel/preset-env",
"@babel/preset-react" "@babel/preset-react"
],
"plugins": [
"@babel/plugin-transform-runtime"
] ]
}, },
"dependencies": { "dependencies": {
"@babel/core": "^7.15.0", "@babel/core": "^7.17.0",
"@babel/plugin-transform-runtime": "^7.15.0", "@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.15.4", "@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.14.5", "@babel/preset-react": "^7.16.7",
"body-parser": "^1.19.0", "body-parser": "^1.19.1",
"classnames": "^2.3.1", "classnames": "^2.3.1",
"codemirror": "^5.62.3", "codemirror": "^5.65.1",
"cookie-parser": "^1.4.5", "cookie-parser": "^1.4.6",
"create-react-class": "^15.7.0", "create-react-class": "^15.7.0",
"dedent-tabs": "^0.9.0", "dedent-tabs": "^0.10.1",
"express": "^4.17.1", "express": "^4.17.2",
"express-async-handler": "^1.1.4", "express-async-handler": "^1.2.0",
"express-static-gzip": "2.1.1", "express-static-gzip": "2.1.1",
"fs-extra": "10.0.0", "fs-extra": "10.0.0",
"googleapis": "85.0.0", "googleapis": "94.0.0",
"js-yaml": "^4.1.0",
"jwt-simple": "^0.5.6", "jwt-simple": "^0.5.6",
"less": "^3.13.1", "less": "^3.13.1",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"marked": "3.0.3", "marked": "4.0.12",
"marked-extended-tables": "^1.0.3",
"markedLegacy": "npm:marked@^0.3.19", "markedLegacy": "npm:marked@^0.3.19",
"moment": "^2.29.1", "moment": "^2.29.1",
"mongoose": "^5.13.7", "mongoose": "^6.2.0",
"nanoid": "3.1.25", "nanoid": "3.2.0",
"nconf": "^0.11.3", "nconf": "^0.11.3",
"prop-types": "15.7.2", "query-string": "7.1.0",
"query-string": "7.0.1",
"react": "^16.14.0", "react": "^16.14.0",
"react-dom": "^16.14.0", "react-dom": "^16.14.0",
"react-frame-component": "4.1.3", "react-frame-component": "4.1.3",
@@ -75,8 +83,9 @@
"vitreum": "git+https://git@github.com/calculuschild/vitreum.git" "vitreum": "git+https://git@github.com/calculuschild/vitreum.git"
}, },
"devDependencies": { "devDependencies": {
"eslint": "^7.32.0", "eslint": "^8.8.0",
"eslint-plugin-react": "^7.25.1", "eslint-plugin-react": "^7.28.0",
"pico-check": "^2.1.3" "jest": "^27.4.5",
"supertest": "^6.2.2"
} }
} }

View File

@@ -25,6 +25,7 @@ const build = async ({ bundle, render, ssr })=>{
await fs.outputFile('./build/homebrew/bundle.js', bundle); await fs.outputFile('./build/homebrew/bundle.js', bundle);
await fs.outputFile('./build/homebrew/ssr.js', ssr); await fs.outputFile('./build/homebrew/ssr.js', ssr);
await fs.copy('./themes/fonts', './build/fonts'); await fs.copy('./themes/fonts', './build/fonts');
await fs.copy('./themes/assets', './build/assets');
let src = './themes/5ePhbLegacy.style.less'; let src = './themes/5ePhbLegacy.style.less';
//Parse brew theme files //Parse brew theme files
less.render(fs.readFileSync(src).toString(), { less.render(fs.readFileSync(src).toString(), {
@@ -73,6 +74,6 @@ pack('./client/homebrew/homebrew.jsx', {
if(isDev){ if(isDev){
livereload('./build'); livereload('./build');
watchFile('./server.js', { watchFile('./server.js', {
watch : ['./client'] // Watch additional folders if you want watch : ['./client', './server'] // Watch additional folders if you want
}); });
} }

View File

@@ -12,6 +12,18 @@
"codemirror/mode/gfm/gfm.js", "codemirror/mode/gfm/gfm.js",
"codemirror/mode/css/css.js", "codemirror/mode/css/css.js",
"codemirror/mode/javascript/javascript.js", "codemirror/mode/javascript/javascript.js",
"codemirror/addon/fold/foldcode.js",
"codemirror/addon/fold/foldgutter.js",
"codemirror/addon/fold/xml-fold.js",
"codemirror/addon/search/search.js",
"codemirror/addon/search/searchcursor.js",
"codemirror/addon/search/jump-to-line.js",
"codemirror/addon/search/match-highlighter.js",
"codemirror/addon/search/matchesonscrollbar.js",
"codemirror/addon/dialog/dialog.js",
"codemirror/addon/edit/closetag.js",
"codemirror/addon/edit/trailingspace.js",
"codemirror/addon/selection/active-line.js",
"moment", "moment",
"superagent", "superagent",
"marked" "marked"

292
server.js
View File

@@ -1,286 +1,12 @@
/*eslint max-lines: ["warn", {"max": 300, "skipBlankLines": true, "skipComments": true}]*/ const DB = require('./server/db.js');
const _ = require('lodash'); const server = require('./server/app.js');
const jwt = require('jwt-simple'); const config = require('./server/config.js');
const express = require('express');
const app = express();
const homebrewApi = require('./server/homebrew.api.js'); DB.connect(config).then(()=>{
const GoogleActions = require('./server/googleActions.js'); // Ensure that we have successfully connected to the database
const serveCompressedStaticAssets = require('./server/static-assets.mv.js'); // before launching server
const sanitizeFilename = require('sanitize-filename'); const PORT = process.env.PORT || config.get('web_port') || 8000;
const asyncHandler = require('express-async-handler'); server.app.listen(PORT, ()=>{
console.log(`server on port: ${PORT}`);
const brewAccessTypes = ['edit', 'share', 'raw'];
//Get the brew object from the HB database or Google Drive
const getBrewFromId = asyncHandler(async (id, accessType)=>{
if(!brewAccessTypes.includes(accessType))
throw ('Invalid Access Type when getting brew');
let brew;
if(id.length > 12) {
const googleId = id.slice(0, -12);
id = id.slice(-12);
brew = await GoogleActions.readFileMetadata(config.get('google_api_key'), googleId, id, accessType);
} else {
brew = await HomebrewModel.get(accessType == 'edit' ? { editId: id } : { shareId: id });
brew = brew.toObject(); // Convert MongoDB object to standard Javascript Object
}
brew = sanitizeBrew(brew, accessType === 'edit' ? false : true);
//Split brew.text into text and style
//unless the Access Type is RAW, in which case return immediately
if(accessType == 'raw') {
return brew;
}
splitTextAndStyle(brew);
return brew;
});
const sanitizeBrew = (brew, full=false)=>{
delete brew._id;
delete brew.__v;
if(full){
delete brew.editId;
}
return brew;
};
const splitTextAndStyle = (brew)=>{
brew.text = brew.text.replaceAll('\r\n', '\n');
if(brew.text.startsWith('```css')) {
const index = brew.text.indexOf('```\n\n');
brew.style = brew.text.slice(7, index - 1);
brew.text = brew.text.slice(index + 5);
}
};
app.use('/', serveCompressedStaticAssets(`${__dirname}/build`));
process.chdir(__dirname);
//app.use(express.static(`${__dirname}/build`));
app.use(require('body-parser').json({ limit: '25mb' }));
app.use(require('cookie-parser')());
app.use(require('./server/forcessl.mw.js'));
const config = require('nconf')
.argv()
.env({ lowerCase: true })
.file('environment', { file: `config/${process.env.NODE_ENV}.json` })
.file('defaults', { file: 'config/default.json' });
//DB
const mongoose = require('mongoose');
mongoose.connect(config.get('mongodb_uri') || config.get('mongolab_uri') || 'mongodb://localhost/naturalcrit',
{ retryWrites: false, useNewUrlParser: true, useCreateIndex: true, useUnifiedTopology: true });
mongoose.connection.on('error', ()=>{
console.log('Error : Could not connect to a Mongo Database.');
console.log(' If you are running locally, make sure mongodb.exe is running.');
throw 'Can not connect to Mongo';
});
//Account Middleware
app.use((req, res, next)=>{
if(req.cookies && req.cookies.nc_session){
try {
req.account = jwt.decode(req.cookies.nc_session, config.get('secret'));
//console.log("Just loaded up JWT from cookie:");
//console.log(req.account);
} catch (e){}
}
req.config = {
google_client_id : config.get('google_client_id'),
google_client_secret : config.get('google_client_secret')
};
return next();
});
app.use(homebrewApi);
app.use(require('./server/admin.api.js'));
const HomebrewModel = require('./server/homebrew.model.js').model;
const welcomeText = require('fs').readFileSync('./client/homebrew/pages/homePage/welcome_msg.md', 'utf8');
const welcomeTextV3 = require('fs').readFileSync('./client/homebrew/pages/homePage/welcome_msg_v3.md', 'utf8');
const changelogText = require('fs').readFileSync('./changelog.md', 'utf8');
String.prototype.replaceAll = function(s, r){return this.split(s).join(r);};
//Robots.txt
app.get('/robots.txt', (req, res)=>{
return res.sendFile(`${__dirname}/robots.txt`);
});
//Home page
app.get('/', async (req, res, next)=>{
const brew = {
text : welcomeText
};
req.brew = brew;
return next();
});
//Home page v3
app.get('/v3_preview', async (req, res, next)=>{
const brew = {
text : welcomeTextV3,
renderer : 'V3'
};
splitTextAndStyle(brew);
req.brew = brew;
return next();
});
//Changelog page
app.get('/changelog', async (req, res, next)=>{
const brew = {
title : 'Changelog',
text : changelogText,
renderer : 'V3'
};
splitTextAndStyle(brew);
req.brew = brew;
return next();
});
//Source page
app.get('/source/:id', asyncHandler(async (req, res)=>{
const brew = await getBrewFromId(req.params.id, 'raw');
const replaceStrings = { '&': '&amp;', '<': '&lt;', '>': '&gt;' };
let text = brew.text;
for (const replaceStr in replaceStrings) {
text = text.replaceAll(replaceStr, replaceStrings[replaceStr]);
}
text = `<code><pre style="white-space: pre-wrap;">${text}</pre></code>`;
res.status(200).send(text);
}));
//Download brew source page
app.get('/download/:id', asyncHandler(async (req, res)=>{
const brew = await getBrewFromId(req.params.id, 'raw');
const prefix = 'HB - ';
let fileName = sanitizeFilename(`${prefix}${brew.title}`).replaceAll(' ', '');
if(!fileName || !fileName.length) { fileName = `${prefix}-Untitled-Brew`; };
res.set({
'Cache-Control' : 'no-cache',
'Content-Type' : 'text/plain',
'Content-Disposition' : `attachment; filename="${fileName}.txt"`
}); });
res.status(200).send(brew.text);
}));
//User Page
app.get('/user/:username', async (req, res, next)=>{
const ownAccount = req.account && (req.account.username == req.params.username);
let brews = await HomebrewModel.getByUser(req.params.username, ownAccount)
.catch((err)=>{
console.log(err);
});
if(ownAccount && req?.account?.googleId){
const googleBrews = await GoogleActions.listGoogleBrews(req, res)
.catch((err)=>{
console.error(err);
});
if(googleBrews)
brews = _.concat(brews, googleBrews);
}
req.brews = _.map(brews, (brew)=>{
return sanitizeBrew(brew, !ownAccount);
});
return next();
}); });
//Edit Page
app.get('/edit/:id', asyncHandler(async (req, res, next)=>{
res.header('Cache-Control', 'no-cache, no-store'); //reload the latest saved brew when pressing back button, not the cached version before save.
const brew = await getBrewFromId(req.params.id, 'edit');
req.brew = brew;
return next();
}));
//New Page
app.get('/new/:id', asyncHandler(async (req, res, next)=>{
const brew = await getBrewFromId(req.params.id, 'share');
brew.title = `CLONE - ${brew.title}`;
req.brew = brew;
return next();
}));
//Share Page
app.get('/share/:id', asyncHandler(async (req, res, next)=>{
const brew = await getBrewFromId(req.params.id, 'share');
if(req.params.id.length > 12) {
const googleId = req.params.id.slice(0, -12);
const shareId = req.params.id.slice(-12);
await GoogleActions.increaseView(googleId, shareId, 'share', brew)
.catch((err)=>{next(err);});
} else {
await HomebrewModel.increaseView({ shareId: brew.shareId });
}
req.brew = brew;
return next();
}));
//Print Page
app.get('/print/:id', asyncHandler(async (req, res, next)=>{
const brew = await getBrewFromId(req.params.id, 'share');
req.brew = brew;
return next();
}));
//Render the page
const templateFn = require('./client/template.js');
app.use((req, res)=>{
const props = {
version : require('./package.json').version,
url : req.originalUrl,
brew : req.brew,
brews : req.brews,
googleBrews : req.googleBrews,
account : req.account,
enable_v3 : config.get('enable_v3')
};
templateFn('homebrew', title = req.brew ? req.brew.title : '', props)
.then((page)=>{ res.send(page); })
.catch((err)=>{
console.log(err);
return res.sendStatus(500);
});
});
//v=====----- Error-Handling Middleware -----=====v//
//Format Errors so all fields will be sent
const replaceErrors = (key, value)=>{
if(value instanceof Error) {
const error = {};
Object.getOwnPropertyNames(value).forEach(function (key) {
error[key] = value[key];
});
return error;
}
return value;
};
const getPureError = (error)=>{
return JSON.parse(JSON.stringify(error, replaceErrors));
};
app.use((err, req, res, next)=>{
const status = err.status || 500;
console.error(err);
res.status(status).send(getPureError(err));
});
//^=====--------------------------------------=====^//
const PORT = process.env.PORT || config.get('web_port') || 8000;
app.listen(PORT);
console.log(`server on port:${PORT}`);

306
server/app.js Normal file
View File

@@ -0,0 +1,306 @@
/*eslint max-lines: ["warn", {"max": 300, "skipBlankLines": true, "skipComments": true}]*/
// Set working directory to project root
process.chdir(`${__dirname}/..`);
const _ = require('lodash');
const jwt = require('jwt-simple');
const express = require('express');
const yaml = require('js-yaml');
const app = express();
const config = require('./config.js');
const homebrewApi = require('./homebrew.api.js');
const GoogleActions = require('./googleActions.js');
const serveCompressedStaticAssets = require('./static-assets.mv.js');
const sanitizeFilename = require('sanitize-filename');
const asyncHandler = require('express-async-handler');
const brewAccessTypes = ['edit', 'share', 'raw'];
//Get the brew object from the HB database or Google Drive
const getBrewFromId = asyncHandler(async (id, accessType)=>{
if(!brewAccessTypes.includes(accessType))
throw ('Invalid Access Type when getting brew');
let brew;
if(id.length > 12) {
const googleId = id.slice(0, -12);
id = id.slice(-12);
brew = await GoogleActions.readFileMetadata(config.get('google_api_key'), googleId, id, accessType);
} else {
brew = await HomebrewModel.get(accessType == 'edit' ? { editId: id } : { shareId: id });
brew = brew.toObject(); // Convert MongoDB object to standard Javascript Object
}
brew = sanitizeBrew(brew, accessType === 'edit' ? false : true);
//Split brew.text into text and style
//unless the Access Type is RAW, in which case return immediately
if(accessType == 'raw') {
return brew;
}
splitTextStyleAndMetadata(brew);
return brew;
});
const sanitizeBrew = (brew, full=false)=>{
delete brew._id;
delete brew.__v;
if(full){
delete brew.editId;
}
return brew;
};
const splitTextStyleAndMetadata = (brew)=>{
brew.text = brew.text.replaceAll('\r\n', '\n');
if(brew.text.startsWith('```metadata')) {
const index = brew.text.indexOf('```\n\n');
const metadataSection = brew.text.slice(12, index - 1);
const metadata = yaml.load(metadataSection);
Object.assign(brew, _.pick(metadata, ['title', 'description', 'tags', 'systems', 'renderer']));
brew.text = brew.text.slice(index + 5);
}
if(brew.text.startsWith('```css')) {
const index = brew.text.indexOf('```\n\n');
brew.style = brew.text.slice(7, index - 1);
brew.text = brew.text.slice(index + 5);
}
};
app.use('/', serveCompressedStaticAssets(`build`));
//app.use(express.static(`${__dirname}/build`));
app.use(require('body-parser').json({ limit: '25mb' }));
app.use(require('cookie-parser')());
app.use(require('./forcessl.mw.js'));
//Account Middleware
app.use((req, res, next)=>{
if(req.cookies && req.cookies.nc_session){
try {
req.account = jwt.decode(req.cookies.nc_session, config.get('secret'));
//console.log("Just loaded up JWT from cookie:");
//console.log(req.account);
} catch (e){}
}
req.config = {
google_client_id : config.get('google_client_id'),
google_client_secret : config.get('google_client_secret')
};
return next();
});
app.use(homebrewApi);
app.use(require('./admin.api.js'));
const HomebrewModel = require('./homebrew.model.js').model;
const welcomeText = require('fs').readFileSync('client/homebrew/pages/homePage/welcome_msg.md', 'utf8');
const welcomeTextV3 = require('fs').readFileSync('client/homebrew/pages/homePage/welcome_msg_v3.md', 'utf8');
const migrateText = require('fs').readFileSync('client/homebrew/pages/homePage/migrate.md', 'utf8');
const changelogText = require('fs').readFileSync('changelog.md', 'utf8');
const faqText = require('fs').readFileSync('faq.md', 'utf8');
String.prototype.replaceAll = function(s, r){return this.split(s).join(r);};
//Robots.txt
app.get('/robots.txt', (req, res)=>{
return res.sendFile(`robots.txt`, { root: process.cwd() });
});
//Home page
app.get('/', async (req, res, next)=>{
const brew = {
text : welcomeText
};
req.brew = brew;
return next();
});
//Home page v3
app.get('/v3_preview', async (req, res, next)=>{
const brew = {
text : welcomeTextV3,
renderer : 'V3'
};
splitTextStyleAndMetadata(brew);
req.brew = brew;
return next();
});
//Legacy/Other Document -> v3 Migration Guide
app.get('/migrate', async (req, res, next)=>{
const brew = {
text : migrateText,
renderer : 'V3'
};
splitTextStyleAndMetadata(brew);
req.brew = brew;
return next();
});
//Changelog page
app.get('/changelog', async (req, res, next)=>{
const brew = {
title : 'Changelog',
text : changelogText,
renderer : 'V3'
};
splitTextStyleAndMetadata(brew);
req.brew = brew;
return next();
});
//FAQ page
app.get('/faq', async (req, res, next)=>{
const brew = {
title : 'FAQ',
text : faqText,
renderer : 'V3'
};
splitTextStyleAndMetadata(brew);
req.brew = brew;
return next();
});
//Source page
app.get('/source/:id', asyncHandler(async (req, res)=>{
const brew = await getBrewFromId(req.params.id, 'raw');
const replaceStrings = { '&': '&amp;', '<': '&lt;', '>': '&gt;' };
let text = brew.text;
for (const replaceStr in replaceStrings) {
text = text.replaceAll(replaceStr, replaceStrings[replaceStr]);
}
text = `<code><pre style="white-space: pre-wrap;">${text}</pre></code>`;
res.status(200).send(text);
}));
//Download brew source page
app.get('/download/:id', asyncHandler(async (req, res)=>{
const brew = await getBrewFromId(req.params.id, 'raw');
const prefix = 'HB - ';
let fileName = sanitizeFilename(`${prefix}${brew.title}`).replaceAll(' ', '');
if(!fileName || !fileName.length) { fileName = `${prefix}-Untitled-Brew`; };
res.set({
'Cache-Control' : 'no-cache',
'Content-Type' : 'text/plain',
'Content-Disposition' : `attachment; filename="${fileName}.txt"`
});
res.status(200).send(brew.text);
}));
//User Page
app.get('/user/:username', async (req, res, next)=>{
const ownAccount = req.account && (req.account.username == req.params.username);
let brews = await HomebrewModel.getByUser(req.params.username, ownAccount)
.catch((err)=>{
console.log(err);
});
if(ownAccount && req?.account?.googleId){
const googleBrews = await GoogleActions.listGoogleBrews(req, res)
.catch((err)=>{
console.error(err);
});
if(googleBrews)
brews = _.concat(brews, googleBrews);
}
req.brews = _.map(brews, (brew)=>{
return sanitizeBrew(brew, !ownAccount);
});
return next();
});
//Edit Page
app.get('/edit/:id', asyncHandler(async (req, res, next)=>{
res.header('Cache-Control', 'no-cache, no-store'); //reload the latest saved brew when pressing back button, not the cached version before save.
const brew = await getBrewFromId(req.params.id, 'edit');
req.brew = brew;
return next();
}));
//New Page
app.get('/new/:id', asyncHandler(async (req, res, next)=>{
const brew = await getBrewFromId(req.params.id, 'share');
brew.title = `CLONE - ${brew.title}`;
req.brew = brew;
return next();
}));
//Share Page
app.get('/share/:id', asyncHandler(async (req, res, next)=>{
const brew = await getBrewFromId(req.params.id, 'share');
if(req.params.id.length > 12) {
const googleId = req.params.id.slice(0, -12);
const shareId = req.params.id.slice(-12);
await GoogleActions.increaseView(googleId, shareId, 'share', brew)
.catch((err)=>{next(err);});
} else {
await HomebrewModel.increaseView({ shareId: brew.shareId });
}
req.brew = brew;
return next();
}));
//Print Page
app.get('/print/:id', asyncHandler(async (req, res, next)=>{
const brew = await getBrewFromId(req.params.id, 'share');
req.brew = brew;
return next();
}));
//Render the page
const templateFn = require('./../client/template.js');
app.use((req, res)=>{
const props = {
version : require('./../package.json').version,
url : req.originalUrl,
brew : req.brew,
brews : req.brews,
googleBrews : req.googleBrews,
account : req.account,
enable_v3 : config.get('enable_v3')
};
const title = req.brew ? req.brew.title : '';
templateFn('homebrew', title, props)
.then((page)=>{ res.send(page); })
.catch((err)=>{
console.log(err);
return res.sendStatus(500);
});
});
//v=====----- Error-Handling Middleware -----=====v//
//Format Errors so all fields will be sent
const replaceErrors = (key, value)=>{
if(value instanceof Error) {
const error = {};
Object.getOwnPropertyNames(value).forEach(function (key) {
error[key] = value[key];
});
return error;
}
return value;
};
const getPureError = (error)=>{
return JSON.parse(JSON.stringify(error, replaceErrors));
};
app.use((err, req, res, next)=>{
const status = err.status || 500;
console.error(err);
res.status(status).send(getPureError(err));
});
//^=====--------------------------------------=====^//
module.exports = {
app : app
};

5
server/config.js Normal file
View File

@@ -0,0 +1,5 @@
module.exports = require('nconf')
.argv()
.env({ lowerCase: true })
.file('environment', { file: `config/${process.env.NODE_ENV}.json` })
.file('defaults', { file: 'config/default.json' });

37
server/db.js Normal file
View File

@@ -0,0 +1,37 @@
// The main purpose of this file is to provide an interface for database
// connection. Even though the code is quite simple and basically a tiny
// wrapper around mongoose package, it works as single point where
// database setup/config is performed and the interface provided here can be
// reused by both the main application and all tests which require database
// connection.
const Mongoose = require('mongoose');
const getMongoDBURL = (config)=>{
return config.get('mongodb_uri') ||
config.get('mongolab_uri') ||
'mongodb://localhost/homebrewery';
};
const handleConnectionError = (error)=>{
if(error) {
console.error('Could not connect to a Mongo database: \n');
console.error(error);
console.error('\nIf you are running locally, make sure mongodb.exe is running and DB URL is configured properly');
process.exit(1); // non-zero exit code to indicate an error
}
};
const disconnect = async ()=>{
return await Mongoose.disconnect();
};
const connect = async (config)=>{
return await Mongoose.connect(getMongoDBURL(config),
{ retryWrites: false }, handleConnectionError);
};
module.exports = {
connect : connect,
disconnect : disconnect
};

View File

@@ -3,15 +3,11 @@ const _ = require('lodash');
const { google } = require('googleapis'); const { google } = require('googleapis');
const { nanoid } = require('nanoid'); const { nanoid } = require('nanoid');
const token = require('./token.js'); const token = require('./token.js');
const config = require('nconf') const config = require('./config.js');
.argv()
.env({ lowerCase: true }) // Load environment variables
.file('environment', { file: `config/${process.env.NODE_ENV}.json` })
.file('defaults', { file: 'config/default.json' });
//let oAuth2Client; //let oAuth2Client;
GoogleActions = { const GoogleActions = {
authCheck : (account, res)=>{ authCheck : (account, res)=>{
if(!account || !account.googleId){ // If not signed into Google if(!account || !account.googleId){ // If not signed into Google
@@ -96,7 +92,7 @@ GoogleActions = {
const drive = google.drive({ version: 'v3', auth: oAuth2Client }); const drive = google.drive({ version: 'v3', auth: oAuth2Client });
const obj = await drive.files.list({ const obj = await drive.files.list({
pageSize : 100, pageSize : 1000,
fields : 'nextPageToken, files(id, name, description, createdTime, modifiedTime, properties)', fields : 'nextPageToken, files(id, name, description, createdTime, modifiedTime, properties)',
q : 'mimeType != \'application/vnd.google-apps.folder\' and trashed = false' q : 'mimeType != \'application/vnd.google-apps.folder\' and trashed = false'
}) })
@@ -120,10 +116,10 @@ GoogleActions = {
updatedAt : file.modifiedTime, updatedAt : file.modifiedTime,
gDrive : true, gDrive : true,
googleId : file.id, googleId : file.id,
pageCount : file.properties.pageCount, pageCount : parseInt(file.properties.pageCount),
title : file.properties.title, title : file.properties.title,
description : file.description, description : file.description,
views : file.properties.views, views : parseInt(file.properties.views),
tags : '', tags : '',
published : file.properties.published ? file.properties.published == 'true' : false, published : file.properties.published ? file.properties.published == 'true' : false,
authors : [req.account.username], //TODO: properly save and load authors to google drive authors : [req.account.username], //TODO: properly save and load authors to google drive

View File

@@ -4,6 +4,7 @@ const router = require('express').Router();
const zlib = require('zlib'); const zlib = require('zlib');
const GoogleActions = require('./googleActions.js'); const GoogleActions = require('./googleActions.js');
const Markdown = require('../shared/naturalcrit/markdown.js'); const Markdown = require('../shared/naturalcrit/markdown.js');
const yaml = require('js-yaml');
// const getTopBrews = (cb) => { // const getTopBrews = (cb) => {
// HomebrewModel.find().sort({ views: -1 }).limit(5).exec(function(err, brews) { // HomebrewModel.find().sort({ views: -1 }).limit(5).exec(function(err, brews) {
@@ -11,6 +12,22 @@ const Markdown = require('../shared/naturalcrit/markdown.js');
// }); // });
// }; // };
const mergeBrewText = (brew)=>{
let text = brew.text;
if(brew.style !== undefined) {
text = `\`\`\`css\n` +
`${brew.style || ''}\n` +
`\`\`\`\n\n` +
`${text}`;
}
const metadata = _.pick(brew, ['title', 'description', 'tags', 'systems', 'renderer']);
text = `\`\`\`metadata\n` +
`${yaml.dump(metadata)}\n` +
`\`\`\`\n\n` +
`${text}`;
return text;
};
const MAX_TITLE_LENGTH = 100; const MAX_TITLE_LENGTH = 100;
const getGoodBrewTitle = (text)=>{ const getGoodBrewTitle = (text)=>{
@@ -28,16 +45,6 @@ const excludePropsFromUpdate = (brew)=>{
return brew; return brew;
}; };
const mergeBrewText = (text, style)=>{
if(typeof style !== 'undefined') {
text = `\`\`\`css\n` +
`${style}\n` +
`\`\`\`\n\n` +
`${text}`;
}
return text;
};
const newBrew = (req, res)=>{ const newBrew = (req, res)=>{
const brew = req.body; const brew = req.body;
@@ -46,7 +53,7 @@ const newBrew = (req, res)=>{
} }
brew.authors = (req.account) ? [req.account.username] : []; brew.authors = (req.account) ? [req.account.username] : [];
brew.text = mergeBrewText(brew.text, brew.style); brew.text = mergeBrewText(brew);
delete brew.editId; delete brew.editId;
delete brew.shareId; delete brew.shareId;
@@ -75,7 +82,7 @@ const updateBrew = (req, res)=>{
.then((brew)=>{ .then((brew)=>{
const updateBrew = excludePropsFromUpdate(req.body); const updateBrew = excludePropsFromUpdate(req.body);
brew = _.merge(brew, updateBrew); brew = _.merge(brew, updateBrew);
brew.text = mergeBrewText(brew.text, brew.style); brew.text = mergeBrewText(brew);
// Compress brew text to binary before saving // Compress brew text to binary before saving
brew.textBin = zlib.deflateRawSync(brew.text); brew.textBin = zlib.deflateRawSync(brew.text);
@@ -143,7 +150,7 @@ const newGoogleBrew = async (req, res, next)=>{
} }
brew.authors = (req.account) ? [req.account.username] : []; brew.authors = (req.account) ? [req.account.username] : [];
brew.text = mergeBrewText(brew.text, brew.style); brew.text = mergeBrewText(brew);
delete brew.editId; delete brew.editId;
delete brew.shareId; delete brew.shareId;
@@ -165,13 +172,13 @@ const updateGoogleBrew = async (req, res, next)=>{
try { oAuth2Client = GoogleActions.authCheck(req.account, res); } catch (err) { return res.status(err.status).send(err.message); } try { oAuth2Client = GoogleActions.authCheck(req.account, res); } catch (err) { return res.status(err.status).send(err.message); }
const brew = excludePropsFromUpdate(req.body); const brew = excludePropsFromUpdate(req.body);
brew.text = mergeBrewText(brew.text, brew.style); brew.text = mergeBrewText(brew);
try { try {
const updatedBrew = await GoogleActions.updateGoogleBrew(oAuth2Client, brew); const updatedBrew = await GoogleActions.updateGoogleBrew(oAuth2Client, brew);
return res.status(200).send(updatedBrew); return res.status(200).send(updatedBrew);
} catch (err) { } catch (err) {
return res.status(err.response.status).send(err); return res.status(err.response?.status || 500).send(err);
} }
}; };

View File

@@ -1,11 +1,7 @@
const jwt = require('jwt-simple'); const jwt = require('jwt-simple');
// Load configuration values // Load configuration values
const config = require('nconf') const config = require('./config.js');
.argv()
.env({ lowerCase: true }) // Load environment variables
.file('environment', { file: `config/${process.env.NODE_ENV}.json` })
.file('defaults', { file: 'config/default.json' });
// Generate an Access Token for the given User ID // Generate an Access Token for the given User ID
const generateAccessToken = (account)=>{ const generateAccessToken = (account)=>{

View File

@@ -7,6 +7,7 @@ const cx = require('classnames');
const DISMISS_KEY = 'dismiss_render_warning'; const DISMISS_KEY = 'dismiss_render_warning';
const RenderWarnings = createClass({ const RenderWarnings = createClass({
displayName : 'RenderWarnings',
getInitialState : function() { getInitialState : function() {
return { return {
warnings : {} warnings : {}

View File

@@ -0,0 +1,48 @@
const autoCloseCurlyBraces = function(CodeMirror, cm, typingClosingBrace) {
const ranges = cm.listSelections(), replacements = [];
for (let i = 0; i < ranges.length; i++) {
if(!ranges[i].empty()) return CodeMirror.Pass;
const pos = ranges[i].head, line = cm.getLine(pos.line), tok = cm.getTokenAt(pos);
if(!typingClosingBrace && (tok.type == 'string' || tok.string.charAt(0) != '{' || tok.start != pos.ch - 1))
return CodeMirror.Pass;
else if(typingClosingBrace) {
let hasUnclosedBraces = false, index = -1;
do {
index = line.indexOf('{{', index + 1);
if(index !== -1 && line.indexOf('}}', index + 1) === -1) {
hasUnclosedBraces = true;
break;
}
} while (index !== -1);
if(!hasUnclosedBraces) return CodeMirror.Pass;
}
replacements[i] = typingClosingBrace ? {
text : '}}',
newPos : CodeMirror.Pos(pos.line, pos.ch + 2)
} : {
text : '{}}',
newPos : CodeMirror.Pos(pos.line, pos.ch + 1)
};
}
for (let i = ranges.length - 1; i >= 0; i--) {
const info = replacements[i];
cm.replaceRange(info.text, ranges[i].head, ranges[i].anchor, '+insert');
const sel = cm.listSelections().slice(0);
sel[i] = {
head : info.newPos,
anchor : info.newPos
};
cm.setSelections(sel);
}
};
module.exports = {
autoCloseCurlyBraces : function(CodeMirror, codeMirror) {
const map = { name: 'autoCloseCurlyBraces' };
map[`'{'`] = function(cm) { return autoCloseCurlyBraces(CodeMirror, cm); };
map[`'}'`] = function(cm) { return autoCloseCurlyBraces(CodeMirror, cm, true); };
codeMirror.addKeyMap(map);
}
};

View File

@@ -1,9 +1,10 @@
/* eslint-disable max-lines */
require('./codeEditor.less'); require('./codeEditor.less');
const React = require('react'); const React = require('react');
const createClass = require('create-react-class'); const createClass = require('create-react-class');
const _ = require('lodash'); const _ = require('lodash');
const cx = require('classnames'); const cx = require('classnames');
const closeTag = require('./close-tag');
let CodeMirror; let CodeMirror;
if(typeof navigator !== 'undefined'){ if(typeof navigator !== 'undefined'){
@@ -13,56 +14,168 @@ if(typeof navigator !== 'undefined'){
require('codemirror/mode/gfm/gfm.js'); //Github flavoured markdown require('codemirror/mode/gfm/gfm.js'); //Github flavoured markdown
require('codemirror/mode/css/css.js'); require('codemirror/mode/css/css.js');
require('codemirror/mode/javascript/javascript.js'); require('codemirror/mode/javascript/javascript.js');
//Addons
//Code folding
require('codemirror/addon/fold/foldcode.js');
require('codemirror/addon/fold/foldgutter.js');
//Search and replace
require('codemirror/addon/search/search.js');
require('codemirror/addon/search/searchcursor.js');
require('codemirror/addon/search/jump-to-line.js');
require('codemirror/addon/search/match-highlighter.js');
require('codemirror/addon/search/matchesonscrollbar.js');
require('codemirror/addon/dialog/dialog.js');
//Trailing space highlighting
// require('codemirror/addon/edit/trailingspace.js');
//Active line highlighting
// require('codemirror/addon/selection/active-line.js');
//Auto-closing
//XML code folding is a requirement of the auto-closing tag feature and is not enabled
require('codemirror/addon/fold/xml-fold.js');
require('codemirror/addon/edit/closetag.js');
const foldCode = require('./fold-code');
foldCode.registerHomebreweryHelper(CodeMirror);
} }
const CodeEditor = createClass({ const CodeEditor = createClass({
displayName : 'CodeEditor',
getDefaultProps : function() { getDefaultProps : function() {
return { return {
language : '', language : '',
value : '', value : '',
wrap : true, wrap : true,
onChange : ()=>{} onChange : ()=>{},
enableFolding : true
};
},
getInitialState : function() {
return {
docs : {}
}; };
}, },
componentDidMount : function() { componentDidMount : function() {
this.buildEditor(); this.buildEditor();
const newDoc = CodeMirror.Doc(this.props.value, this.props.language);
this.codeMirror.swapDoc(newDoc);
}, },
componentDidUpdate : function(prevProps) { componentDidUpdate : function(prevProps) {
if(prevProps.language !== this.props.language){ //rebuild editor when switching tabs if(prevProps.view !== this.props.view){ //view changed; swap documents
this.buildEditor(); let newDoc;
}
if(this.codeMirror && this.codeMirror.getValue() != this.props.value) { //update editor contents if brew.text is changed from outside if(!this.state.docs[this.props.view]) {
newDoc = CodeMirror.Doc(this.props.value, this.props.language);
} else {
newDoc = this.state.docs[this.props.view];
}
const oldDoc = { [prevProps.view]: this.codeMirror.swapDoc(newDoc) };
this.setState((prevState)=>({
docs : _.merge({}, prevState.docs, oldDoc)
}));
this.props.rerenderParent();
} else if(this.codeMirror?.getValue() != this.props.value) { //update editor contents if brew.text is changed from outside
this.codeMirror.setValue(this.props.value); this.codeMirror.setValue(this.props.value);
} }
if(this.props.enableFolding) {
this.codeMirror.setOption('foldOptions', this.foldOptions(this.codeMirror));
} else {
this.codeMirror.setOption('foldOptions', false);
}
}, },
buildEditor : function() { buildEditor : function() {
this.codeMirror = CodeMirror(this.refs.editor, { this.codeMirror = CodeMirror(this.refs.editor, {
value : this.props.value, lineNumbers : true,
lineNumbers : true, lineWrapping : this.props.wrap,
lineWrapping : this.props.wrap, indentWithTabs : true,
mode : this.props.language, //TODO: CSS MODE DOESN'T SEEM TO LOAD PROPERLY tabSize : 2,
indentWithTabs : true, historyEventDelay : 250,
tabSize : 2, extraKeys : {
extraKeys : { 'Ctrl-B' : this.makeBold,
'Ctrl-B' : this.makeBold, 'Cmd-B' : this.makeBold,
'Cmd-B' : this.makeBold, 'Ctrl-I' : this.makeItalic,
'Ctrl-I' : this.makeItalic, 'Cmd-I' : this.makeItalic,
'Cmd-I' : this.makeItalic, 'Ctrl-U' : this.makeUnderline,
'Ctrl-M' : this.makeSpan, 'Cmd-U' : this.makeUnderline,
'Cmd-M' : this.makeSpan, 'Ctrl-.' : this.makeNbsp,
'Ctrl-/' : this.makeComment, 'Cmd-.' : this.makeNbsp,
'Cmd-/' : this.makeComment 'Shift-Ctrl-.' : this.makeSpace,
} 'Shift-Cmd-.' : this.makeSpace,
'Shift-Ctrl-,' : this.removeSpace,
'Shift-Cmd-,' : this.removeSpace,
'Ctrl-M' : this.makeSpan,
'Cmd-M' : this.makeSpan,
'Shift-Ctrl-M' : this.makeDiv,
'Shift-Cmd-M' : this.makeDiv,
'Ctrl-/' : this.makeComment,
'Cmd-/' : this.makeComment,
'Ctrl-K' : this.makeLink,
'Cmd-K' : this.makeLink,
'Ctrl-L' : ()=>this.makeList('UL'),
'Cmd-L' : ()=>this.makeList('UL'),
'Shift-Ctrl-L' : ()=>this.makeList('OL'),
'Shift-Cmd-L' : ()=>this.makeList('OL'),
'Shift-Ctrl-1' : ()=>this.makeHeader(1),
'Shift-Ctrl-2' : ()=>this.makeHeader(2),
'Shift-Ctrl-3' : ()=>this.makeHeader(3),
'Shift-Ctrl-4' : ()=>this.makeHeader(4),
'Shift-Ctrl-5' : ()=>this.makeHeader(5),
'Shift-Ctrl-6' : ()=>this.makeHeader(6),
'Shift-Cmd-1' : ()=>this.makeHeader(1),
'Shift-Cmd-2' : ()=>this.makeHeader(2),
'Shift-Cmd-3' : ()=>this.makeHeader(3),
'Shift-Cmd-4' : ()=>this.makeHeader(4),
'Shift-Cmd-5' : ()=>this.makeHeader(5),
'Shift-Cmd-6' : ()=>this.makeHeader(6),
'Shift-Ctrl-Enter' : this.newColumn,
'Shift-Cmd-Enter' : this.newColumn,
'Ctrl-Enter' : this.newPage,
'Cmd-Enter' : this.newPage,
'Ctrl-F' : 'findPersistent',
'Cmd-F' : 'findPersistent',
'Shift-Enter' : 'findPersistentPrevious',
'Ctrl-[' : this.foldAllCode,
'Cmd-[' : this.foldAllCode,
'Ctrl-]' : this.unfoldAllCode,
'Cmd-]' : this.unfoldAllCode
},
foldGutter : true,
foldOptions : this.foldOptions(this.codeMirror),
gutters : ['CodeMirror-linenumbers', 'CodeMirror-foldgutter'],
autoCloseTags : true,
styleActiveLine : true,
showTrailingSpace : false,
// specialChars : / /,
// specialCharPlaceholder : function(char) {
// const el = document.createElement('span');
// el.className = 'cm-space';
// el.innerHTML = ' ';
// return el;
// }
}); });
closeTag.autoCloseCurlyBraces(CodeMirror, this.codeMirror);
// Note: codeMirror passes a copy of itself in this callback. cm === this.codeMirror. Either one works. // Note: codeMirror passes a copy of itself in this callback. cm === this.codeMirror. Either one works.
this.codeMirror.on('change', (cm)=>{this.props.onChange(cm.getValue());}); this.codeMirror.on('change', (cm)=>{this.props.onChange(cm.getValue());});
this.updateSize(); this.updateSize();
}, },
makeHeader : function (number) {
const selection = this.codeMirror.getSelection();
const header = Array(number).fill('#').join('');
this.codeMirror.replaceSelection(`${header} ${selection}`, 'around');
const cursor = this.codeMirror.getCursor();
this.codeMirror.setCursor({ line: cursor.line, ch: cursor.ch + selection.length + number + 1 });
},
makeBold : function() { makeBold : function() {
const selection = this.codeMirror.getSelection(), t = selection.slice(0, 2) === '**' && selection.slice(-2) === '**'; const selection = this.codeMirror.getSelection(), t = selection.slice(0, 2) === '**' && selection.slice(-2) === '**';
this.codeMirror.replaceSelection(t ? selection.slice(2, -2) : `**${selection}**`, 'around'); this.codeMirror.replaceSelection(t ? selection.slice(2, -2) : `**${selection}**`, 'around');
@@ -73,14 +186,55 @@ const CodeEditor = createClass({
}, },
makeItalic : function() { makeItalic : function() {
const selection = this.codeMirror.getSelection(), t = selection.slice(0, 1) === '_' && selection.slice(-1) === '_'; const selection = this.codeMirror.getSelection(), t = selection.slice(0, 1) === '*' && selection.slice(-1) === '*';
this.codeMirror.replaceSelection(t ? selection.slice(1, -1) : `_${selection}_`, 'around'); this.codeMirror.replaceSelection(t ? selection.slice(1, -1) : `*${selection}*`, 'around');
if(selection.length === 0){ if(selection.length === 0){
const cursor = this.codeMirror.getCursor(); const cursor = this.codeMirror.getCursor();
this.codeMirror.setCursor({ line: cursor.line, ch: cursor.ch - 1 }); this.codeMirror.setCursor({ line: cursor.line, ch: cursor.ch - 1 });
} }
}, },
makeNbsp : function() {
this.codeMirror.replaceSelection('&nbsp;', 'end');
},
makeSpace : function() {
const selection = this.codeMirror.getSelection();
const t = selection.slice(0, 8) === '{{width:' && selection.slice(0 -4) === '% }}';
if(t){
const percent = parseInt(selection.slice(8, -4)) + 10;
this.codeMirror.replaceSelection(percent < 90 ? `{{width:${percent}% }}` : '{{width:100% }}', 'around');
} else {
this.codeMirror.replaceSelection(`{{width:10% }}`, 'around');
}
},
removeSpace : function() {
const selection = this.codeMirror.getSelection();
const t = selection.slice(0, 8) === '{{width:' && selection.slice(0 -4) === '% }}';
if(t){
const percent = parseInt(selection.slice(8, -4)) - 10;
this.codeMirror.replaceSelection(percent > 10 ? `{{width:${percent}% }}` : '', 'around');
}
},
newColumn : function() {
this.codeMirror.replaceSelection('\n\\column\n\n', 'end');
},
newPage : function() {
this.codeMirror.replaceSelection('\n\\page\n\n', 'end');
},
makeUnderline : function() {
const selection = this.codeMirror.getSelection(), t = selection.slice(0, 3) === '<u>' && selection.slice(-4) === '</u>';
this.codeMirror.replaceSelection(t ? selection.slice(3, -4) : `<u>${selection}</u>`, 'around');
if(selection.length === 0){
const cursor = this.codeMirror.getCursor();
this.codeMirror.setCursor({ line: cursor.line, ch: cursor.ch - 4 });
}
},
makeSpan : function() { makeSpan : function() {
const selection = this.codeMirror.getSelection(), t = selection.slice(0, 2) === '{{' && selection.slice(-2) === '}}'; const selection = this.codeMirror.getSelection(), t = selection.slice(0, 2) === '{{' && selection.slice(-2) === '}}';
this.codeMirror.replaceSelection(t ? selection.slice(2, -2) : `{{ ${selection}}}`, 'around'); this.codeMirror.replaceSelection(t ? selection.slice(2, -2) : `{{ ${selection}}}`, 'around');
@@ -90,15 +244,83 @@ const CodeEditor = createClass({
} }
}, },
makeComment : function() { makeDiv : function() {
const selection = this.codeMirror.getSelection(), t = selection.slice(0, 4) === '<!--' && selection.slice(-3) === '-->'; const selection = this.codeMirror.getSelection(), t = selection.slice(0, 2) === '{{' && selection.slice(-2) === '}}';
this.codeMirror.replaceSelection(t ? selection.slice(4, -3) : `<!-- ${selection} -->`, 'around'); this.codeMirror.replaceSelection(t ? selection.slice(2, -2) : `{{\n${selection}\n}}`, 'around');
if(selection.length === 0){ if(selection.length === 0){
const cursor = this.codeMirror.getCursor(); const cursor = this.codeMirror.getCursor();
this.codeMirror.setCursor({ line: cursor.line, ch: cursor.ch - 4 }); this.codeMirror.setCursor({ line: cursor.line - 1, ch: cursor.ch }); // set to -2? if wanting to enter classes etc. if so, get rid of first \n when replacing selection
} }
}, },
makeComment : function() {
let regex;
let cursorPos;
let newComment;
const selection = this.codeMirror.getSelection();
if(this.props.language === 'gfm'){
regex = /^\s*(<!--\s?)(.*?)(\s?-->)\s*$/gs;
cursorPos = 4;
newComment = `<!-- ${selection} -->`;
} else {
regex = /^\s*(\/\*\s?)(.*?)(\s?\*\/)\s*$/gs;
cursorPos = 3;
newComment = `/* ${selection} */`;
}
this.codeMirror.replaceSelection(regex.test(selection) == true ? selection.replace(regex, '$2') : newComment, 'around');
if(selection.length === 0){
const cursor = this.codeMirror.getCursor();
this.codeMirror.setCursor({ line: cursor.line, ch: cursor.ch - cursorPos });
};
},
makeLink : function() {
const isLink = /^\[(.*)\]\((.*)\)$/;
const selection = this.codeMirror.getSelection().trim();
let match;
if(match = isLink.exec(selection)){
const altText = match[1];
const url = match[2];
this.codeMirror.replaceSelection(`${altText} ${url}`);
const cursor = this.codeMirror.getCursor();
this.codeMirror.setSelection({ line: cursor.line, ch: cursor.ch - url.length }, { line: cursor.line, ch: cursor.ch });
} else {
this.codeMirror.replaceSelection(`[${selection || 'alt text'}](url)`);
const cursor = this.codeMirror.getCursor();
this.codeMirror.setSelection({ line: cursor.line, ch: cursor.ch - 4 }, { line: cursor.line, ch: cursor.ch - 1 });
}
},
makeList : function(listType) {
const selectionStart = this.codeMirror.getCursor('from'), selectionEnd = this.codeMirror.getCursor('to');
this.codeMirror.setSelection(
{ line: selectionStart.line, ch: 0 },
{ line: selectionEnd.line, ch: this.codeMirror.getLine(selectionEnd.line).length }
);
const newSelection = this.codeMirror.getSelection();
const regex = /^\d+\.\s|^-\s/gm;
if(newSelection.match(regex) != null){ // if selection IS A LIST
this.codeMirror.replaceSelection(newSelection.replace(regex, ''), 'around');
} else { // if selection IS NOT A LIST
listType == 'UL' ? this.codeMirror.replaceSelection(newSelection.replace(/^/gm, `- `), 'around') :
this.codeMirror.replaceSelection(newSelection.replace(/^/gm, (()=>{
let n = 1;
return ()=>{
return `${n++}. `;
};
})()), 'around');
}
},
foldAllCode : function() {
this.codeMirror.execCommand('foldAll');
},
unfoldAllCode : function() {
this.codeMirror.execCommand('unfoldAll');
},
//=-- Externally used -==// //=-- Externally used -==//
setCursorPosition : function(line, char){ setCursorPosition : function(line, char){
setTimeout(()=>{ setTimeout(()=>{
@@ -112,10 +334,43 @@ const CodeEditor = createClass({
updateSize : function(){ updateSize : function(){
this.codeMirror.refresh(); this.codeMirror.refresh();
}, },
redo : function(){
return this.codeMirror.redo();
},
undo : function(){
return this.codeMirror.undo();
},
historySize : function(){
return this.codeMirror.doc.historySize();
},
foldOptions : function(cm){
return {
scanUp : true,
rangeFinder : CodeMirror.fold.homebrewery,
widget : (from, to)=>{
let text = '';
let currentLine = from.line;
const maxLength = 50;
while (currentLine <= to.line && text.length <= maxLength) {
text += this.codeMirror.getLine(currentLine);
if(currentLine < to.line)
text += ' ';
currentLine += 1;
}
text = text.trim();
if(text.length > maxLength)
text = `${text.substr(0, maxLength)}...`;
return `\u21A4 ${text} \u21A6`;
}
};
},
//----------------------// //----------------------//
render : function(){ render : function(){
return <div className='codeEditor' ref='editor' />; return <div className='codeEditor' ref='editor' style={this.props.style}/>;
} }
}); });

View File

@@ -1,5 +1,22 @@
@import (less) 'codemirror/lib/codemirror.css'; @import (less) 'codemirror/lib/codemirror.css';
@import (less) 'codemirror/addon/fold/foldgutter.css';
@import (less) 'codemirror/addon/search/matchesonscrollbar.css';
@import (less) 'codemirror/addon/dialog/dialog.css';
.codeEditor{ .codeEditor{
.CodeMirror-foldmarker {
font-family: inherit;
text-shadow: none;
font-weight: 600;
}
//.cm-tab {
// background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAMCAQAAACOs/baAAAARUlEQVR4nGJgIAG8JkXxUAcCtDWemcGR1lY4MvgzCEKY7jSBjgxBDAG09UEQzAe0AMwMHrSOAwEGRtpaMIwAAAAA//8DAG4ID9EKs6YqAAAAAElFTkSuQmCC) no-repeat right;
//}
//.cm-trailingspace {
// .cm-space {
// background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAQAgMAAABW5NbuAAAACVBMVEVHcEwAAAAAAAAWawmTAAAAA3RSTlMAPBJ6PMxpAAAACXBIWXMAAC4jAAAuIwF4pT92AAAAFUlEQVQI12NgwACcCQysASAEZGAAACMuAX06aCQUAAAAAElFTkSuQmCC) no-repeat right;
// }
//}
} }

View File

@@ -0,0 +1,26 @@
module.exports = {
registerHomebreweryHelper : function(CodeMirror) {
CodeMirror.registerHelper('fold', 'homebrewery', function(cm, start) {
const matcher = /^\\page.*/;
const prevLine = cm.getLine(start.line - 1);
if(start.line === cm.firstLine() || prevLine.match(matcher)) {
const lastLineNo = cm.lastLine();
let end = start.line;
while (end < lastLineNo) {
if(cm.getLine(end + 1).match(matcher))
break;
++end;
}
return {
from : CodeMirror.Pos(start.line, 0),
to : CodeMirror.Pos(end, cm.getLine(end).length)
};
}
return null;
});
}
};

View File

@@ -1,7 +1,8 @@
/* eslint-disable max-lines */ /* eslint-disable max-lines */
const _ = require('lodash'); const _ = require('lodash');
const Markdown = require('marked'); const Marked = require('marked');
const renderer = new Markdown.Renderer(); const MarkedExtendedTables = require('marked-extended-tables');
const renderer = new Marked.Renderer();
//Processes the markdown within an HTML block if it's just a class-wrapper //Processes the markdown within an HTML block if it's just a class-wrapper
renderer.html = function (html) { renderer.html = function (html) {
@@ -9,7 +10,7 @@ renderer.html = function (html) {
const openTag = html.substring(0, html.indexOf('>')+1); const openTag = html.substring(0, html.indexOf('>')+1);
html = html.substring(html.indexOf('>')+1); html = html.substring(html.indexOf('>')+1);
html = html.substring(0, html.lastIndexOf('</div>')); html = html.substring(0, html.lastIndexOf('</div>'));
return `${openTag} ${Markdown(html)} </div>`; return `${openTag} ${Marked.parse(html)} </div>`;
} }
return html; return html;
}; };
@@ -235,200 +236,10 @@ const definitionLists = {
} }
}; };
const spanTable = { Marked.use({ extensions: [mustacheSpans, mustacheDivs, mustacheInjectInline, definitionLists] });
name : 'spanTable', Marked.use(MarkedExtendedTables());
level : 'block', // Is this a block-level or inline-level tokenizer? Marked.use(mustacheInjectBlock);
start(src) { return src.match(/^\n *([^\n ].*\|.*)\n/)?.index; }, // Hint to Marked.js to stop and check for a match Marked.use({ smartypants: true });
tokenizer(src, tokens) {
//const regex = this.tokenizer.rules.block.table;
const regex = new RegExp('^ *([^\\n ].*\\|.*\\n(?: *[^\\s].*\\n)*?)' // Header
+ ' {0,3}(?:\\| *)?(:?-+:? *(?:\\| *:?-+:? *)*)\\|?' // Align
+ '(?:\\n *((?:(?!\\n| {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})' // Cells
+ '(?:\\n+|$)| {0,3}#{1,6} | {0,3}>| {4}[^\\n]| {0,3}(?:`{3,}'
+ '(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n| {0,3}(?:[*+-]|1[.)]) |'
+ '<\\/?(?:address|article|aside|base|basefont|blockquote|body|'
+ 'caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?: +|\\n|\\/?>)|<(?:script|pre|style|textarea|!--)).*(?:\\n|$))*)\\n*|$)'); // Cells
const cap = regex.exec(src);
if(cap) {
const item = {
type : 'spanTable',
header : cap[1].replace(/\n$/, '').split('\n'),
align : cap[2].replace(/^ *|\| *$/g, '').split(/ *\| */),
rows : cap[3] ? cap[3].replace(/\n$/, '').split('\n') : []
};
// Get first header row to determine how many columns
item.header[0] = splitCells(item.header[0]);
const colCount = item.header[0].reduce((length, header)=>{
return length + header.colspan;
}, 0);
if(colCount === item.align.length) {
item.raw = cap[0];
let i, j, k, row;
// Get alignment row (:---:)
let l = item.align.length;
for (i = 0; i < l; i++) {
if(/^ *-+: *$/.test(item.align[i])) {
item.align[i] = 'right';
} else if(/^ *:-+: *$/.test(item.align[i])) {
item.align[i] = 'center';
} else if(/^ *:-+ *$/.test(item.align[i])) {
item.align[i] = 'left';
} else {
item.align[i] = null;
}
}
// Get any remaining header rows
l = item.header.length;
for (i = 1; i < l; i++) {
item.header[i] = splitCells(item.header[i], colCount, item.header[i-1]);
}
// Get main table cells
l = item.rows.length;
for (i = 0; i < l; i++) {
item.rows[i] = splitCells(item.rows[i], colCount, item.rows[i-1]);
}
// header child tokens
l = item.header.length;
for (j = 0; j < l; j++) {
row = item.header[j];
for (k = 0; k < row.length; k++) {
row[k].tokens = [];
this.lexer.inlineTokens(row[k].text, row[k].tokens);
}
}
// cell child tokens
l = item.rows.length;
for (j = 0; j < l; j++) {
row = item.rows[j];
for (k = 0; k < row.length; k++) {
row[k].tokens = [];
this.lexer.inlineTokens(row[k].text, row[k].tokens);
}
}
return item;
}
}
},
renderer(token) {
let i, j, row, cell, col, text;
let output = `<table>`;
output += `<thead>`;
for (i = 0; i < token.header.length; i++) {
row = token.header[i];
let col = 0;
output += `<tr>`;
for (j = 0; j < row.length; j++) {
cell = row[j];
text = this.parser.parseInline(cell.tokens);
output += getTableCell(text, cell, 'th', token.align[col]);
col += cell.colspan;
}
output += `</tr>`;
}
output += `</thead>`;
if(token.rows.length) {
output += `<tbody>`;
for (i = 0; i < token.rows.length; i++) {
row = token.rows[i];
col = 0;
output += `<tr>`;
for (j = 0; j < row.length; j++) {
cell = row[j];
text = this.parser.parseInline(cell.tokens);
output += getTableCell(text, cell, 'td', token.align[col]);
col += cell.colspan;
}
output += `</tr>`;
}
output += `</tbody>`;
}
output += `</table>`;
return output;
}
};
const getTableCell = (text, cell, type, align)=>{
if(!cell.rowspan) {
return '';
}
const tag = `<${type}`
+ `${cell.colspan > 1 ? ` colspan=${cell.colspan}` : ''}`
+ `${cell.rowspan > 1 ? ` rowspan=${cell.rowspan}` : ''}`
+ `${align ? ` align=${align}` : ''}>`;
return `${tag + text}</${type}>\n`;
};
const splitCells = (tableRow, count, prevRow = [])=>{
const cells = [...tableRow.matchAll(/(?:[^|\\]|\\.?)+(?:\|+|$)/g)].map((x)=>x[0]);
// Remove first/last cell in a row if whitespace only and no leading/trailing pipe
if(!cells[0]?.trim()) { cells.shift(); }
if(!cells[cells.length - 1]?.trim()) { cells.pop(); }
let numCols = 0;
let i, j, trimmedCell, prevCell, prevCols;
for (i = 0; i < cells.length; i++) {
trimmedCell = cells[i].split(/\|+$/)[0];
cells[i] = {
rowspan : 1,
colspan : Math.max(cells[i].length - trimmedCell.length, 1),
text : trimmedCell.trim().replace(/\\\|/g, '|')
// display escaped pipes as normal character
};
// Handle Rowspan
if(trimmedCell.slice(-1) == '^' && prevRow.length) {
// Find matching cell in previous row
prevCols = 0;
for (j = 0; j < prevRow.length; j++) {
prevCell = prevRow[j];
if((prevCols == numCols) && (prevCell.colspan == cells[i].colspan)) {
// merge into matching cell in previous row (the "target")
cells[i].rowSpanTarget = prevCell.rowSpanTarget ?? prevCell;
cells[i].rowSpanTarget.text += ` ${cells[i].text.slice(0, -1)}`;
cells[i].rowSpanTarget.rowspan += 1;
cells[i].rowspan = 0;
break;
}
prevCols += prevCell.colspan;
if(prevCols > numCols)
break;
}
}
numCols += cells[i].colspan;
}
// Force main cell rows to match header column count
if(numCols > count) {
cells.splice(count);
} else {
while (numCols < count) {
cells.push({
colspan : 1,
text : ''
});
numCols += 1;
}
}
return cells;
};
Markdown.use({ extensions: [mustacheSpans, mustacheDivs, mustacheInjectInline, definitionLists, spanTable] });
Markdown.use(mustacheInjectBlock);
Markdown.use({ smartypants: true });
//Fix local links in the Preview iFrame to link inside the frame //Fix local links in the Preview iFrame to link inside the frame
renderer.link = function (href, title, text) { renderer.link = function (href, title, text) {
@@ -509,9 +320,15 @@ const sanatizeScriptTags = (content)=>{
const tagTypes = ['div', 'span', 'a']; const tagTypes = ['div', 'span', 'a'];
const tagRegex = new RegExp(`(${ const tagRegex = new RegExp(`(${
_.map(tagTypes, (type)=>{ _.map(tagTypes, (type)=>{
return `\\<${type}|\\</${type}>`; return `\\<${type}\\b|\\</${type}>`;
}).join('|')})`, 'g'); }).join('|')})`, 'g');
// Special "void" tags that can be self-closed but don't need to be.
const voidTags = new Set([
'area', 'base', 'br', 'col', 'command', 'hr', 'img',
'input', 'keygen', 'link', 'meta', 'param', 'source'
]);
const processStyleTags = (string)=>{ const processStyleTags = (string)=>{
//split tags up. quotes can only occur right after colons. //split tags up. quotes can only occur right after colons.
//TODO: can we simplify to just split on commas? //TODO: can we simplify to just split on commas?
@@ -526,11 +343,11 @@ const processStyleTags = (string)=>{
}; };
module.exports = { module.exports = {
marked : Markdown, marked : Marked,
render : (rawBrewText)=>{ render : (rawBrewText)=>{
rawBrewText = rawBrewText.replace(/^\\column$/gm, `\n<div class='columnSplit'></div>\n`) rawBrewText = rawBrewText.replace(/^\\column$/gm, `\n<div class='columnSplit'></div>\n`)
.replace(/^(:+)$/gm, (match)=>`${`<div class='blank'></div>`.repeat(match.length)}\n`); .replace(/^(:+)$/gm, (match)=>`${`<div class='blank'></div>`.repeat(match.length)}\n`);
return Markdown( return Marked.parse(
sanatizeScriptTags(rawBrewText), sanatizeScriptTags(rawBrewText),
{ renderer: renderer } { renderer: renderer }
); );
@@ -552,6 +369,13 @@ module.exports = {
}); });
} }
if(match === `</${type}>`){ if(match === `</${type}>`){
// Closing tag: Check we expect it to be closed.
// The accumulator may contain a sequence of voidable opening tags,
// over which we skip before checking validity of the close.
while (acc.length && voidTags.has(_.last(acc).type) && _.last(acc).type != type) {
acc.pop();
}
// Now check that what remains in the accumulator is valid.
if(!acc.length){ if(!acc.length){
errors.push({ errors.push({
line : lineNumber, line : lineNumber,

View File

@@ -99,9 +99,15 @@ const sanatizeScriptTags = (content)=>{
const tagTypes = ['div', 'span', 'a']; const tagTypes = ['div', 'span', 'a'];
const tagRegex = new RegExp(`(${ const tagRegex = new RegExp(`(${
_.map(tagTypes, (type)=>{ _.map(tagTypes, (type)=>{
return `\\<${type}|\\</${type}>`; return `\\<${type}\\b|\\</${type}>`;
}).join('|')})`, 'g'); }).join('|')})`, 'g');
// Special "void" tags that can be self-closed but don't need to be.
const voidTags = new Set([
'area', 'base', 'br', 'col', 'command', 'hr', 'img',
'input', 'keygen', 'link', 'meta', 'param', 'source'
]);
module.exports = { module.exports = {
marked : Markdown, marked : Markdown,
@@ -128,6 +134,13 @@ module.exports = {
}); });
} }
if(match === `</${type}>`){ if(match === `</${type}>`){
// Closing tag: Check we expect it to be closed.
// The accumulator may contain a sequence of voidable opening tags,
// over which we skip before checking validity of the close.
while (acc.length && voidTags.has(_.last(acc).type) && _.last(acc).type != type) {
acc.pop();
}
// Now check that what remains in the accumulator is valid.
if(!acc.length){ if(!acc.length){
errors.push({ errors.push({
line : lineNumber, line : lineNumber,

View File

@@ -8,7 +8,8 @@ const NaturalCritIcon = require('naturalcrit/svg/naturalcrit.svg.jsx');
const Nav = { const Nav = {
base : createClass({ base : createClass({
render : function(){ displayName : 'Nav.base',
render : function(){
return <nav> return <nav>
<div className='navContent'> <div className='navContent'>
{this.props.children} {this.props.children}
@@ -26,7 +27,8 @@ const Nav = {
}, },
section : createClass({ section : createClass({
render : function(){ displayName : 'Nav.section',
render : function(){
return <div className='navSection'> return <div className='navSection'>
{this.props.children} {this.props.children}
</div>; </div>;
@@ -34,6 +36,7 @@ const Nav = {
}), }),
item : createClass({ item : createClass({
displayName : 'Nav.item',
getDefaultProps : function() { getDefaultProps : function() {
return { return {
icon : null, icon : null,
@@ -68,6 +71,47 @@ const Nav = {
} }
}), }),
dropdown : createClass({
displayName : 'Nav.dropdown',
getInitialState : function() {
return {
showDropdown : false
};
},
handleDropdown : function(show){
this.setState({
showDropdown : show
});
},
renderDropdown : function(dropdownChildren){
if(!this.state.showDropdown) return null;
return (
<div className='navDropdown'>
{dropdownChildren}
</div>
);
},
render : function () {
const dropdownChildren = React.Children.map(this.props.children, (child, i)=>{
// Ignore the first child
if(i < 1) return;
return child;
});
return (
<div className='navDropdownContainer'
onMouseEnter={()=>this.handleDropdown(true)}
onMouseLeave={()=>this.handleDropdown(false)}>
{this.props.children[0]}
{this.renderDropdown(dropdownChildren)}
</div>
);
}
})
}; };

View File

@@ -1,3 +1,12 @@
@import '../styles/colors';
@keyframes glideDropDown {
0% {transform : translate(0px, -100%);
opacity : 0;
background-color: #333;}
100% {transform : translate(0px, 0px);
opacity : 1;
background-color: #333;}
}
nav{ nav{
background-color : #333; background-color : #333;
.navContent{ .navContent{
@@ -41,6 +50,7 @@ nav{
} }
} }
.navItem{ .navItem{
#backgroundColors;
.animate(background-color); .animate(background-color);
padding : 8px 12px; padding : 8px 12px;
cursor : pointer; cursor : pointer;
@@ -50,32 +60,35 @@ nav{
color : white; color : white;
text-decoration : none; text-decoration : none;
text-transform : uppercase; text-transform : uppercase;
line-height : 13px;
i{ i{
margin-left : 5px; margin-left : 5px;
font-size : 13px; font-size : 13px;
float : right;
} }
&.tealLight:hover{ background-color : @tealLight };
&.teal:hover{ background-color : @teal };
&.greenLight:hover{ background-color : @greenLight };
&.green:hover{ background-color : @green };
&.blueLight:hover{ background-color : @blueLight };
&.blue:hover{ background-color : @blue };
&.purpleLight:hover{ background-color : @purpleLight };
&.purple:hover{ background-color : @purple };
&.steelLight:hover{ background-color : @steelLight };
&.steel:hover{ background-color : @steel };
&.yellowLight:hover{ background-color : @yellowLight };
&.yellow:hover{ background-color : @yellow };
&.orangeLight:hover{ background-color : @orangeLight };
&.orange:hover{ background-color : @orange };
&.redLight:hover{ background-color : @redLight };
&.red:hover{ background-color : @red };
&.silverLight:hover{ background-color : @silverLight };
&.silver:hover{ background-color : @silver };
&.greyLight:hover{ background-color : @greyLight };
&.grey:hover{ background-color : @grey };
} }
.navSection:last-child .navItem{ .navSection:last-child .navItem{
border-left : 1px solid #666; border-left : 1px solid #666;
} }
.navDropdownContainer{
position: relative;
.navDropdown {
position : absolute;
top : 28px;
left : 0px;
z-index : 10000;
width : 100%;
.navItem{
animation-name: glideDropDown;
animation-duration: 0.4s;
position : relative;
display : block;
width : 100%;
vertical-align : middle;
padding : 8px 5px;
border : 1px solid #888;
border-bottom : 0;
}
}
}
} }

View File

@@ -5,6 +5,7 @@ const _ = require('lodash');
const cx = require('classnames'); const cx = require('classnames');
const SplitPane = createClass({ const SplitPane = createClass({
displayName : 'SplitPane',
getDefaultProps : function() { getDefaultProps : function() {
return { return {
storageKey : 'naturalcrit-pane-split', storageKey : 'naturalcrit-pane-split',
@@ -40,8 +41,12 @@ const SplitPane = createClass({
}, },
handleMove : function(e){ handleMove : function(e){
if(!this.state.isDragging) return; if(!this.state.isDragging) return;
const minWidth = 1;
const maxWidth = window.innerWidth - 13;
const newSize = Math.min(maxWidth, Math.max(minWidth, e.pageX));
this.setState({ this.setState({
size : e.pageX size : newSize
}); });
}, },
/* /*
@@ -73,6 +78,7 @@ const SplitPane = createClass({
}); });
const Pane = createClass({ const Pane = createClass({
displayName : 'Pane',
getDefaultProps : function() { getDefaultProps : function() {
return { return {
width : null width : null

View File

@@ -28,5 +28,8 @@
color : #666; color : #666;
} }
} }
&:hover{
background-color: #999;
}
} }
} }

View File

@@ -20,4 +20,27 @@
@silverLight : #ECF0F1; @silverLight : #ECF0F1;
@silver : #BDC3C7; @silver : #BDC3C7;
@greyLight : #95A5A6; @greyLight : #95A5A6;
@grey : #7F8C8D; @grey : #7F8C8D;
#backgroundColors {
&.tealLight:hover{ background-color : @tealLight };
&.teal:hover{ background-color : @teal };
&.greenLight:hover{ background-color : @greenLight };
&.green:hover{ background-color : @green };
&.blueLight:hover{ background-color : @blueLight };
&.blue:hover{ background-color : @blue };
&.purpleLight:hover{ background-color : @purpleLight };
&.purple:hover{ background-color : @purple };
&.steelLight:hover{ background-color : @steelLight };
&.steel:hover{ background-color : @steel };
&.yellowLight:hover{ background-color : @yellowLight };
&.yellow:hover{ background-color : @yellow };
&.orangeLight:hover{ background-color : @orangeLight };
&.orange:hover{ background-color : @orange };
&.redLight:hover{ background-color : @redLight };
&.red:hover{ background-color : @red };
&.silverLight:hover{ background-color : @silverLight };
&.silver:hover{ background-color : @silver };
&.greyLight:hover{ background-color : @greyLight };
&.grey:hover{ background-color : @grey };
}

View File

@@ -1,7 +0,0 @@
const test = require('pico-check');
test('Just setting up a spot for future tests', (t)=>{
t.pass();
});
module.exports = test;

View File

@@ -0,0 +1,15 @@
/* eslint-disable max-lines */
const Markdown = require('naturalcrit/markdown.js');
test('Escapes <script> tag', function() {
const source = '<script></script>';
const rendered = Markdown.render(source);
expect(rendered).toMatch('&lt;script&gt;&lt;/script&gt;');
});
test('Processes the markdown within an HTML block if its just a class wrapper', function() {
const source = '<div>*Bold text*</div>';
const rendered = Markdown.render(source);
expect(rendered).toBe('<div> <p><em>Bold text</em></p>\n </div>');
});

View File

@@ -0,0 +1,128 @@
/* eslint-disable max-lines */
const Markdown = require('naturalcrit/markdown.js');
test('Renders a mustache span with text only', function() {
const source = '{{ text}}';
const rendered = Markdown.render(source);
expect(rendered).toBe('<span class="inline-block ">text</span>');
});
test('Renders a mustache span with text only, but with spaces', function() {
const source = '{{ this is a text}}';
const rendered = Markdown.render(source);
expect(rendered).toBe('<span class="inline-block ">this is a text</span>');
});
test('Renders an empty mustache span', function() {
const source = '{{}}';
const rendered = Markdown.render(source);
expect(rendered).toBe('<span class="inline-block "></span>');
});
test('Renders a mustache span with just a space', function() {
const source = '{{ }}';
const rendered = Markdown.render(source);
expect(rendered).toBe('<span class="inline-block "></span>');
});
test('Renders a mustache span with a few spaces only', function() {
const source = '{{ }}';
const rendered = Markdown.render(source);
expect(rendered).toBe('<span class="inline-block "></span>');
});
test('Renders a mustache span with text and class', function() {
const source = '{{my-class text}}';
const rendered = Markdown.render(source);
// FIXME: why do we have those two extra spaces after closing "?
expect(rendered).toBe('<span class="inline-block my-class" >text</span>');
});
test('Renders a mustache span with text and two classes', function() {
const source = '{{my-class,my-class2 text}}';
const rendered = Markdown.render(source);
// FIXME: why do we have those two extra spaces after closing "?
expect(rendered).toBe('<span class="inline-block my-class my-class2" >text</span>');
});
test('Renders a mustache span with text with spaces and class', function() {
const source = '{{my-class this is a text}}';
const rendered = Markdown.render(source);
// FIXME: why do we have those two extra spaces after closing "?
expect(rendered).toBe('<span class="inline-block my-class" >this is a text</span>');
});
test('Renders a mustache span with text and id', function() {
const source = '{{#my-span text}}';
const rendered = Markdown.render(source);
// FIXME: why do we have that one extra space after closing "?
expect(rendered).toBe('<span class="inline-block " id="my-span" >text</span>');
});
test('Renders a mustache span with text and two ids', function() {
const source = '{{#my-span,#my-favorite-span text}}';
const rendered = Markdown.render(source);
// FIXME: do we need to report an error here somehow?
expect(rendered).toBe('<span class="inline-block " id="my-span" >text</span>');
});
test('Renders a mustache span with text and css property', function() {
const source = '{{color:red text}}';
const rendered = Markdown.render(source);
expect(rendered).toBe('<span class="inline-block " style="color:red;">text</span>');
});
test('Renders a mustache span with text and two css properties', function() {
const source = '{{color:red,padding:5px text}}';
const rendered = Markdown.render(source);
expect(rendered).toBe('<span class="inline-block " style="color:red; padding:5px;">text</span>');
});
test('Renders a mustache span with text and css property which contains quotes', function() {
const source = '{{font:"trebuchet ms" text}}';
const rendered = Markdown.render(source);
// FIXME: is it correct to remove quotes surrounding css property value?
expect(rendered).toBe('<span class="inline-block " style="font:trebuchet ms;">text</span>');
});
test('Renders a mustache span with text and two css properties which contains quotes', function() {
const source = '{{font:"trebuchet ms",padding:"5px 10px" text}}';
const rendered = Markdown.render(source);
expect(rendered).toBe('<span class="inline-block " style="font:trebuchet ms; padding:5px 10px;">text</span>');
});
test('Renders a mustache span with text with quotes and css property which contains quotes', function() {
const source = '{{font:"trebuchet ms" text "with quotes"}}';
const rendered = Markdown.render(source);
expect(rendered).toBe('<span class="inline-block " style="font:trebuchet ms;">text “with quotes”</span>');
});
test('Renders a mustache span with text, id, class and a couple of css properties', function() {
const source = '{{pen,#author,color:orange,font-family:"trebuchet ms" text}}';
const rendered = Markdown.render(source);
expect(rendered).toBe('<span class="inline-block pen" id="author" style="color:orange; font-family:trebuchet ms;">text</span>');
});
// TODO: add tests for ID with accordance to CSS spec:
//
// From https://drafts.csswg.org/selectors/#id-selectors:
//
// > An ID selector consists of a “number sign” (U+0023, #) immediately followed by the ID value, which must be a CSS identifier.
//
// From: https://www.w3.org/TR/CSS21/syndata.html#value-def-identifier:
//
// > In CSS, identifiers (including element names, classes, and IDs in selectors) can contain only the characters [a-zA-Z0-9]
// > and ISO 10646 characters U+00A0 and higher, plus the hyphen (-) and the underscore (_);
// > they cannot start with a digit, two hyphens, or a hyphen followed by a digit.
// > Identifiers can also contain escaped characters and any ISO 10646 character as a numeric code (see next item).
// > For instance, the identifier "B&W?" may be written as "B\&W\?" or "B\26 W\3F".
// > Note that Unicode is code-by-code equivalent to ISO 10646 (see [UNICODE] and [ISO10646]).
// TODO: add tests for class with accordance to CSS spec:
//
// From: https://drafts.csswg.org/selectors/#class-html:
//
// > The class selector is given as a full stop (. U+002E) immediately followed by an identifier.

View File

@@ -0,0 +1,27 @@
const supertest = require('supertest');
// Mimic https responses to avoid being redirected all the time
const app = supertest.agent(require('app.js').app)
.set('X-Forwarded-Proto', 'https');
describe('Tests for static pages', ()=>{
it('Home page works', ()=>{
return app.get('/').expect(200);
});
it('Home page v3 works', ()=>{
return app.get('/v3_preview').expect(200);
});
it('Changelog page works', ()=>{
return app.get('/changelog').expect(200);
});
it('FAQ page works', ()=>{
return app.get('/faq').expect(200);
});
it('robots.txt works', ()=>{
return app.get('/robots.txt').expect(200);
});
});

View File

@@ -1 +0,0 @@
//Set up configs and DB connectiosna nd what not in here

View File

@@ -79,7 +79,7 @@ body {
p{ p{
overflow-wrap : break-word; //TODO: MAKE ALL MARGINS TOP-ONLY. USE * + * STYLE SELECTORS overflow-wrap : break-word; //TODO: MAKE ALL MARGINS TOP-ONLY. USE * + * STYLE SELECTORS
display : block; display : block;
line-height : 1.3em; line-height : 1.25em;
&+* { &+* {
margin-top : 0.325cm; margin-top : 0.325cm;
} }
@@ -90,14 +90,14 @@ body {
ul{ ul{
margin-bottom : 0.8em; margin-bottom : 0.8em;
padding-left : 1.4em; padding-left : 1.4em;
line-height : 1.3em; line-height : 1.25em;
list-style-position : outside; list-style-position : outside;
list-style-type : disc; list-style-type : disc;
} }
ol{ ol{
margin-bottom : 0.8em; margin-bottom : 0.8em;
padding-left : 1.4em; padding-left : 1.4em;
line-height : 1.3em; line-height : 1.25em;
list-style-position : outside; list-style-position : outside;
list-style-type : decimal; list-style-type : decimal;
} }
@@ -146,9 +146,9 @@ body {
font-size : 3.5cm; font-size : 3.5cm;
padding-left : 40px; //Allow background color to extend into margins padding-left : 40px; //Allow background color to extend into margins
margin-left : -40px; margin-left : -40px;
margin-top :-0.3cm; margin-top : -0.3cm;
padding-bottom :2px; padding-bottom : 2px;
margin-bottom :-20px; margin-bottom : -20px;
background-image : linear-gradient(-45deg, #322814, #998250, #322814); background-image : linear-gradient(-45deg, #322814, #998250, #322814);
background-clip : text; background-clip : text;
-webkit-background-clip : text; -webkit-background-clip : text;
@@ -162,17 +162,20 @@ body {
//margin-top : 0px; //Font is misaligned. Shift up slightly //margin-top : 0px; //Font is misaligned. Shift up slightly
//margin-bottom : 0.05cm; //margin-bottom : 0.05cm;
font-size : 0.75cm; font-size : 0.75cm;
line-height : 0.988em; //Font is misaligned. Shift up slightly
} }
h3{ h3{
//margin-top : -0.1cm; //Font is misaligned. Shift up slightly //margin-top : -0.1cm; //Font is misaligned. Shift up slightly
//margin-bottom : 0.1cm; //margin-bottom : 0.1cm;
font-size : 0.575cm; font-size : 0.575cm;
border-bottom : 2px solid @headerUnderline; border-bottom : 2px solid @headerUnderline;
line-height : 0.995em; //Font is misaligned. Shift up slightly
} }
h4{ h4{
//margin-top : -0.02cm; //Font is misaligned. Shift up slightly //margin-top : -0.02cm; //Font is misaligned. Shift up slightly
//margin-bottom : 0.02cm; //margin-bottom : 0.02cm;
font-size : 0.458cm; font-size : 0.458cm;
line-height : 0.971em; //Font is misaligned. Shift up slightly
} }
h5{ h5{
//margin-top : -0.02cm; //Font is misaligned. Shift up slightly //margin-top : -0.02cm; //Font is misaligned. Shift up slightly
@@ -180,6 +183,7 @@ body {
font-family : ScalySansSmallCapsRemake; font-family : ScalySansSmallCapsRemake;
font-size : 0.423cm; font-size : 0.423cm;
font-weight : 900; font-weight : 900;
line-height : 0.951em; //Font is misaligned. Shift up slightly
& + * { & + * {
margin-top : 0.2cm; margin-top : 0.2cm;
} }
@@ -238,9 +242,6 @@ body {
display : block; display : block;
padding-bottom : 0px; padding-bottom : 0px;
} }
p + p {
padding-top : .8em;
}
:last-child { :last-child {
margin-bottom : 0; margin-bottom : 0;
} }
@@ -271,9 +272,6 @@ body {
padding-bottom : 0px; padding-bottom : 0px;
line-height : 1.5em; line-height : 1.5em;
} }
p + p {
padding-top : .8em;
}
:last-child { :last-child {
margin-bottom : 0; margin-bottom : 0;
} }
@@ -285,6 +283,7 @@ body {
/* Arist Credit */ /* Arist Credit */
.artist { .artist {
position : absolute; position : absolute;
width : auto;
text-align : center; text-align : center;
font-family : WalterTurncoat; font-family : WalterTurncoat;
font-size : 0.27cm; font-size : 0.27cm;
@@ -309,21 +308,21 @@ body {
/* Watermark */ /* Watermark */
.watermark { .watermark {
display : grid !important; display : grid !important;
place-items : center; place-items : center;
justify-content : center; justify-content : center;
position : absolute; position : absolute;
top : 0; top : 0;
left : 0; left : 0;
width : 100%; width : 100%;
height : 100%; height : 100%;
font-size : 120px; font-size : 120px;
text-transform : uppercase; text-transform : uppercase;
color : black; color : black;
mix-blend-mode : overlay; mix-blend-mode : overlay;
opacity : 30%; opacity : 30%;
transform : rotate(-45deg); transform : rotate(-45deg);
z-index : 500; z-index : 500;
p { p {
margin-bottom : none; margin-bottom : none;
} }
@@ -375,25 +374,15 @@ body {
background-attachment : fixed; background-attachment : fixed;
filter : drop-shadow(1px 4px 6px #888); filter : drop-shadow(1px 4px 6px #888);
padding : 4px 2px; padding : 4px 2px;
margin-left : -6px; margin-left : -0.16cm;
margin-right : -6px; margin-right : -0.16cm;
width : calc(100% + 0.32cm);
} }
position : relative; position : relative;
padding : 0px; padding : 0px;
margin-bottom : 0.325cm; margin-bottom : 0.325cm;
p{
margin-bottom : 0.3cm;
}
p+p {
margin-top : 0; //May not be needed
text-indent : 0;
}
p:last-of-type {
margin-bottom: 0;
}
//Headers //Headers
h2{ h2{
font-size : 0.62cm; font-size : 0.62cm;
@@ -409,7 +398,7 @@ body {
font-weight : 800; font-weight : 800;
font-variant : small-caps; font-variant : small-caps;
border-bottom : 2px solid @headerText; border-bottom : 2px solid @headerText;
margin-top : 0.05cm; // margin-top : 0.05cm; //Font is misaligned. Shift up slightly
padding-bottom : 0.05cm; padding-bottom : 0.05cm;
} }
@@ -423,12 +412,17 @@ body {
border : none; border : none;
} }
//Attribute Lists //Attribute Lists - All text between HRs is red
dl { hr ~ :is(dl,p) {
color : @headerText; color : @headerText;
} }
hr:last-of-type~dl{ hr:last-of-type {
color : inherit; // After the HRs, hanging indents remain black. & ~ :is(dl,p) {
color : inherit; // After the HRs, reset text to black
}
& + * {
margin-top : 0.325cm; // Space after last HR
}
} }
// Monster Ability table // Monster Ability table
@@ -447,6 +441,10 @@ body {
padding: 0px; padding: 0px;
} }
} }
:last-child {
margin-bottom : 0;
}
} }
//Full Width //Full Width
@@ -513,7 +511,8 @@ body {
color : #58180d; color : #58180d;
background-color : #faf7ea; background-color : #faf7ea;
border-radius : 4px; border-radius : 4px;
white-space : pre-wrap white-space : pre-wrap;
overflow-wrap : break-word;
} }
pre code{ pre code{
@@ -581,7 +580,7 @@ body {
} }
p, ul{ p, ul{
font-size : 0.352cm; font-size : 0.352cm;
line-height : 1.3em; line-height : 1.265em;
} }
ul{ ul{
margin-bottom : 0.5em; margin-bottom : 0.5em;
@@ -609,6 +608,7 @@ body {
margin-bottom : 1.05cm; margin-bottom : 1.05cm;
margin-left : -0.1cm; margin-left : -0.1cm;
margin-right : -0.1cm; margin-right : -0.1cm;
width : calc(100% + 0.2cm);
border-collapse : separate; border-collapse : separate;
background-color : white; background-color : white;
border : initial; border : initial;
@@ -653,7 +653,7 @@ body {
break-inside : avoid; break-inside : avoid;
h1 { h1 {
text-align : center; text-align : center;
margin-bottom : 0cm; margin-bottom : 0.3cm;
} }
a{ a{
display : table; display : table;
@@ -664,14 +664,12 @@ body {
} }
} }
h4 { h4 {
margin-top : 0.14cm; margin-top : 0.2cm;
line-height : 0.4cm;
& + ul li { & + ul li {
line-height: 1.2em; line-height: 1.2em;
} }
} }
& > ul {
margin-top: 0.52cm;
}
ul{ ul{
padding-left : 0; padding-left : 0;
list-style-type : none; list-style-type : none;
@@ -724,7 +722,9 @@ body {
.block { .block {
break-inside : avoid; break-inside : avoid;
display : inline-block; display : inline-block;
min-width : 100%; .page :where(&) {
width : 100%;
}
//-webkit-transform : translateZ(0); //Prevents shadows from breaking across columns //-webkit-transform : translateZ(0); //Prevents shadows from breaking across columns
} }
.inline-block { .inline-block {
@@ -738,7 +738,7 @@ body {
// *****************************/ // *****************************/
.page { .page {
dl { dl {
line-height : 1.3em; line-height : 1.25em;
padding-left : 1em; padding-left : 1em;
white-space : pre-line; white-space : pre-line;
& + * { & + * {
@@ -768,10 +768,8 @@ body {
// *****************************/ // *****************************/
.page { .page {
.blank { .blank {
height: 0.75em; height : 1em;
} margin-top : 0;
p + .blank {
margin-top: -1em;
} }
} }

View File

@@ -63,7 +63,7 @@ body {
// *****************************/ // *****************************/
p{ p{
padding-bottom : 0.8em; padding-bottom : 0.8em;
line-height : 1.3em; line-height : 1.269em;
&+p{ &+p{
margin-top : -0.8em; margin-top : -0.8em;
} }
@@ -71,14 +71,14 @@ body {
ul{ ul{
margin-bottom : 0.8em; margin-bottom : 0.8em;
padding-left : 1.4em; padding-left : 1.4em;
line-height : 1.3em; line-height : 1.269em;
list-style-position : outside; list-style-position : outside;
list-style-type : disc; list-style-type : disc;
} }
ol{ ol{
margin-bottom : 0.8em; margin-bottom : 0.8em;
padding-left : 1.4em; padding-left : 1.4em;
line-height : 1.3em; line-height : 1.269em;
list-style-position : outside; list-style-position : outside;
list-style-type : decimal; list-style-type : decimal;
} }
@@ -126,7 +126,7 @@ body {
font-family : Solberry; font-family : Solberry;
font-size : 10em; font-size : 10em;
color : #222; color : #222;
line-height : 0.8em; line-height : 0.795em;
} }
} }
h2{ h2{
@@ -191,7 +191,7 @@ body {
box-shadow : 1px 4px 14px #888; box-shadow : 1px 4px 14px #888;
p, ul{ p, ul{
font-size : 0.352cm; font-size : 0.352cm;
line-height : 1.1em; line-height : 1.083em;
} }
} }
//If a note starts a column, give it space at the top to render border //If a note starts a column, give it space at the top to render border
@@ -371,7 +371,7 @@ body {
} }
p, ul{ p, ul{
font-size : 0.352cm; font-size : 0.352cm;
line-height : 1.3em; line-height : 1.263em;
} }
ul{ ul{
margin-bottom : 0.5em; margin-bottom : 0.5em;
@@ -425,7 +425,7 @@ body {
p{ p{
display : block; display : block;
padding-bottom : 0px; padding-bottom : 0px;
line-height : 1.5em; line-height : 1.47em;
} }
p + p { p + p {
padding-top : .8em; padding-top : .8em;
@@ -457,7 +457,7 @@ body {
p, p + p { p, p + p {
margin : unset; margin : unset;
text-indent : unset; text-indent : unset;
line-height : 1em; line-height : 0.941em;
} }
h5 { h5 {
font-size : 1.3em; font-size : 1.3em;

BIN
themes/assets/discord.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -0,0 +1 @@
<svg id="Layer_3" data-name="Layer 3" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 350.028 390.552"><defs><style>.cls-1{opacity:0.9;}.cls-2{fill:#001013;}.cls-3{fill:#fff;}.cls-4{fill:#aa2a29;}</style></defs><title>Discord of Many Things blank</title><g class="cls-1"><path d="M100.991,82.743c-1.649,3.324-3.395,5.768-4.1,8.482-1.49,5.753-3.44,11.644-3.455,17.482q-.332,125.259-.141,250.519c.007,20.122,12.708,36.368,31.407,40.239a38.328,38.328,0,0,0,7.722.761q103.611,0,207.222-.088h6.314c-3.256-11.462-9.664-34.015-9.664-34.015l2.431,2.023s41.561,37.755,62.33,56.6c2.489,2.26,3.694,4.462,3.593,7.885-.241,8.186-.078,16.383-.078,25.492-6.333-5.527-11.928-10.35-17.457-15.247-9.586-8.493-19.2-16.957-28.644-25.6a10.032,10.032,0,0,0-7.39-2.774q-117.228-.1-234.457-.334c-20.632-.031-33.959-9.189-41.021-28.578-.852-2.339-.783-5.091-.784-7.653q-.057-116.5-.031-233.007V119.145C74.791,102.517,84.2,89.068,100.991,82.743Z" transform="translate(-74.79 -67.573)"/></g><path class="cls-2" d="M338.234,371.589s5.556,19.924,8.513,30.53h-5.075c-69.335,0-138.67-.1-208,.074-16.925.043-35.116-9.515-40.505-33.247a26.538,26.538,0,0,1-.379-5.827q-.027-128.172.025-256.344c.021-19.276,15.226-36.749,34.427-38.688a82.669,82.669,0,0,1,8.279-.447q123.288-.034,246.578-.067c13.265-.016,24.7,3.79,33.278,14.235a39.273,39.273,0,0,1,9.447,25.5q-.015,167.477-.012,334.955c0,1.245-.1,2.49-.2,4.645-4.075-3.565-7.6-6.552-11.018-9.655q-35.236-31.992-70.44-64.017c-1.2-1.091-3.713-3.147-3.713-3.147l-2-1.775Z" transform="translate(-74.79 -67.573)"/><path class="cls-3" d="M419.838,435.934c-7.848-6.892-15.026-12.977-21.961-19.329q-28.235-25.86-56.253-51.954c-2.314-2.157-4.59-3.247-7.356-1.784-3.036,1.607-2.77,4.676-2.022,7.359,2.286,8.2,4.817,16.338,7.24,24.5a17.108,17.108,0,0,1,.294,1.851c-1.486.084-2.872.233-4.258.233-67.363.012-134.726-.155-202.088.123-18.267.075-32.955-13.095-34.769-29.353a92.257,92.257,0,0,1-.886-10.108Q97.7,233.488,97.793,109.5c.013-10.518,3.19-20.063,11.156-27.471a31.92,31.92,0,0,1,20.439-8.917c1.948-.109,3.9-.181,5.852-.181q123.5-.014,247-.063c9.957-.012,18.894,2.145,26.329,9.1,7.956,7.441,11.177,16.934,11.214,27.457.142,40.84.057,81.681.057,122.522V435.934Z" transform="translate(-74.79 -67.573)"/><path class="cls-4" d="M311.029,170.975c-11.8,45.005-23.315,88.959-35.123,134.016l-97.168-98.883Z" transform="translate(-74.79 -67.573)"/><path class="cls-4" d="M380.8,265.712l-95.97,40.316c11.438-43.808,22.639-86.709,33.839-129.609l1.08-.272Z" transform="translate(-74.79 -67.573)"/><path class="cls-4" d="M165.3,322.955c2.91-36.463,5.761-72.179,8.709-109.116l94.711,96.472Z" transform="translate(-74.79 -67.573)"/><path class="cls-4" d="M223.458,107.926l83.127,55.063L178.71,196.919Z" transform="translate(-74.79 -67.573)"/><path class="cls-4" d="M366.285,281.366l-72.5,73.414c-3.524-13.182-6.849-25.617-10.306-38.549Z" transform="translate(-74.79 -67.573)"/><path class="cls-4" d="M274.874,318.478c3.445,12.8,6.765,25.143,10.376,38.559l-98.635-26.556.032-1.153Z" transform="translate(-74.79 -67.573)"/><path class="cls-4" d="M374.888,241.261l-51.71-75.57,26.8-21.529,25.831,96.619Z" transform="translate(-74.79 -67.573)"/><path class="cls-4" d="M165.492,207.523c-2.39,30.748-4.736,60.942-7.083,91.135l-1.063.159c-8.5-31.936-17-63.872-25.705-96.581Z" transform="translate(-74.79 -67.573)"/><path class="cls-4" d="M317.039,159.316l-68.251-45.24.307-.794,93.794,25.212Z" transform="translate(-74.79 -67.573)"/><path class="cls-4" d="M136.517,193.952,203.5,125.03l1.086.832L167.794,198.9Z" transform="translate(-74.79 -67.573)"/></svg>

After

Width:  |  Height:  |  Size: 3.5 KiB

BIN
themes/assets/github.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

BIN
themes/assets/patreon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

BIN
themes/assets/reddit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB