0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-23 16:33:05 +00:00

Compare commits

...

606 Commits

Author SHA1 Message Date
Trevor Buckner
134e260d7b Update changelog.md 2022-11-28 13:34:46 -05:00
Trevor Buckner
82c8ca55fc 3.4.0 2022-11-28 12:33:57 -05:00
Trevor Buckner
e92cd3be18 Merge pull request #2517 from G-Ambatte/fixPrintMargins-#2516
Update Style for V3 & Legacy
2022-11-28 11:11:25 -05:00
G.Ambatte
93c2d2d860 Add contain:size to Legacy 2022-11-25 17:53:28 +13:00
G.Ambatte
cd79a38755 Add contain:size to V3 2022-11-25 17:53:17 +13:00
Trevor Buckner
84286b7942 Merge pull request #2515 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.7.3
Bump mongoose from 6.7.2 to 6.7.3
2022-11-23 10:52:13 -05:00
dependabot[bot]
a16ca8c897 Bump mongoose from 6.7.2 to 6.7.3
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.7.2 to 6.7.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.7.2...6.7.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-23 03:01:09 +00:00
Trevor Buckner
fea07429fe Merge pull request #2514 from naturalcrit/dependabot/npm_and_yarn/eslint-plugin-react-7.31.11
Bump eslint-plugin-react from 7.31.10 to 7.31.11
2022-11-21 12:57:35 -05:00
dependabot[bot]
fa29f2281d Bump eslint-plugin-react from 7.31.10 to 7.31.11
Bumps [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) from 7.31.10 to 7.31.11.
- [Release notes](https://github.com/jsx-eslint/eslint-plugin-react/releases)
- [Changelog](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jsx-eslint/eslint-plugin-react/compare/v7.31.10...v7.31.11)

---
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>
2022-11-21 17:41:10 +00:00
Trevor Buckner
002b88ab83 Merge pull request #2513 from naturalcrit/dependabot/npm_and_yarn/marked-4.2.3
Bump marked from 4.2.2 to 4.2.3
2022-11-21 12:38:37 -05:00
Trevor Buckner
54833f9fc6 Merge pull request #2512 from naturalcrit/dependabot/npm_and_yarn/eslint-8.28.0
Bump eslint from 8.27.0 to 8.28.0
2022-11-21 12:38:26 -05:00
dependabot[bot]
cba9286217 Bump marked from 4.2.2 to 4.2.3
Bumps [marked](https://github.com/markedjs/marked) from 4.2.2 to 4.2.3.
- [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.2.2...v4.2.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-21 03:01:20 +00:00
dependabot[bot]
9ebbff49fb Bump eslint from 8.27.0 to 8.28.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.27.0 to 8.28.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.27.0...v8.28.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-11-21 03:01:06 +00:00
Trevor Buckner
9ee39a83c1 Merge pull request #2507 from Gazook89/OG-Meta-Tag-default-object
Move common meta tags to default object
2022-11-17 23:01:32 -05:00
Trevor Buckner
c09a4c4374 cleanup 2022-11-17 22:58:46 -05:00
Trevor Buckner
3e44d0ad13 Merge pull request #2488 from Gazook89/Field-Validation-System-2
Field validation system 2
2022-11-17 21:58:54 -05:00
Trevor Buckner
b23a09b1b8 cleanup 2022-11-17 21:58:24 -05:00
Trevor Buckner
421ed8f51d Remove comments 2022-11-17 21:53:46 -05:00
Gazook89
14a057cf55 change account page title to something generic 2022-11-17 11:37:29 -06:00
Trevor Buckner
ee05392d27 Merge pull request #2503 from Gazook89/Add-syntax-highlighting-for-injections
Add syntax highlighting for injections
2022-11-16 15:43:17 -05:00
Trevor Buckner
1cc84da976 Remove end/start bracket tracking for injectors 2022-11-16 15:42:45 -05:00
Gazook89
5cfdd504c1 Move common meta tags to default object 2022-11-16 12:52:59 -06:00
Gazook89
24debfc75c fix regexp to not include inside of curly spans 2022-11-15 11:09:27 -06:00
Gazook89
ffe6272299 Merge branch 'master' into Add-syntax-highlighting-for-injections 2022-11-15 10:36:06 -06:00
Trevor Buckner
64c3d69641 Merge pull request #2506 from Gazook89/FAQ-in-Navbar
Add link to FAQ in "Need Help" menu
2022-11-15 11:26:23 -05:00
Gazook89
67c19b79e3 Add link to FAQ in "Need Help" menu 2022-11-15 10:21:35 -06:00
Trevor Buckner
ea29106101 Merge pull request #2501 from Gazook89/RegExp-Crash-in-Curly-Syntax
Reg exp crash in curly syntax
2022-11-14 18:57:27 -05:00
Trevor Buckner
8016f82040 Tweak capture group order 2022-11-14 18:56:04 -05:00
Trevor Buckner
7c93e5879c Merge pull request #2442 from Gazook89/Delete-Recent-Items
Add Ability to Remove Brews from Recent Items
2022-11-14 10:01:03 -05:00
Trevor Buckner
dc86f89c4f Add title attribute 2022-11-14 09:58:48 -05:00
Trevor Buckner
d03be052aa Merge pull request #2504 from Gazook89/Remove-Checkboxes-from-GH-Forms
Remove Checkboxes from Github Issue Forms
2022-11-14 00:18:41 -05:00
Gazook89
fef79f4fc3 remove checkboxes 2022-11-13 22:09:50 -06:00
Gazook89
cc58721ccd give span tags to injection syntax for styling 2022-11-13 21:02:45 -06:00
Gazook89
5f2115da0e fix mustacheInjectBlock pattern as well (missed it earlier) 2022-11-13 20:32:01 -06:00
Gazook89
1dd1e677e4 adjust span regexp pattern to capture trailing spaces 2022-11-13 20:19:39 -06:00
Gazook89
29b89bdc00 Merge branch 'master' into RegExp-Crash-in-Curly-Syntax 2022-11-13 20:06:05 -06:00
Gazook89
4493d86fd5 fix injection curly syntax 2022-11-13 20:05:52 -06:00
Gazook89
6a600df19a Merge branch 'master' into Field-Validation-System-2 2022-11-13 19:11:21 -06:00
Trevor Buckner
e8c6e36521 Merge pull request #2499 from G-Ambatte/fixMissingMetaTagsCrash-#2498
Fix template.js crash when ogMeta undefined
2022-11-13 15:46:25 -05:00
G.Ambatte
3e3610a204 Move fix to template.js 2022-11-14 08:20:46 +13:00
G.Ambatte
3e626d91f0 Add empty object as ogMeta default 2022-11-14 08:12:27 +13:00
Gazook89
6a0d8d13b0 don't save errs to state 2022-11-13 12:56:17 -06:00
Gazook89
4f762b376f tweak validation rules on Thumbnail & prevent invalid field from block valid fields 2022-11-13 12:45:31 -06:00
Gazook89
bda80c9984 remove comments 2022-11-13 11:43:55 -06:00
Gazook89
7de60e2345 Merge branch 'master' into Delete-Recent-Items 2022-11-13 11:41:19 -06:00
Trevor Buckner
77ad2c8958 Merge pull request #2481 from naturalcrit/dependabot/npm_and_yarn/react-router-dom-6.4.3
Bump react-router-dom from 6.4.2 to 6.4.3
2022-11-12 21:27:52 -05:00
Trevor Buckner
6cca821ba6 Merge pull request #2487 from naturalcrit/dependabot/npm_and_yarn/googleapis-109.0.1
Bump googleapis from 108.0.1 to 109.0.1
2022-11-12 21:27:44 -05:00
Trevor Buckner
96da053717 Merge branch 'master' into pr/2488 2022-11-11 20:33:20 -05:00
dependabot[bot]
3723006f39 Bump react-router-dom from 6.4.2 to 6.4.3
Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.4.2 to 6.4.3.
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/main/packages/react-router-dom/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@6.4.3/packages/react-router-dom)

---
updated-dependencies:
- dependency-name: react-router-dom
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-11 03:21:08 +00:00
dependabot[bot]
6cfdc47760 Bump googleapis from 108.0.1 to 109.0.1
Bumps [googleapis](https://github.com/googleapis/google-api-nodejs-client) from 108.0.1 to 109.0.1.
- [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-v108.0.1...googleapis-v109.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-11 03:21:02 +00:00
Trevor Buckner
00a5600768 Merge pull request #2490 from naturalcrit/dependabot/npm_and_yarn/marked-4.2.2
Bump marked from 4.1.1 to 4.2.2
2022-11-10 22:10:57 -05:00
Trevor Buckner
d8674d09a2 Merge pull request #2453 from Gazook89/Open-Graph-Meta-Changes
Change `<meta>` tags based on Current Page
2022-11-10 22:02:47 -05:00
dependabot[bot]
a46630f774 Bump marked from 4.1.1 to 4.2.2
Bumps [marked](https://github.com/markedjs/marked) from 4.1.1 to 4.2.2.
- [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.1.1...v4.2.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-11 02:57:54 +00:00
Trevor Buckner
38fb9d467c Merge branch 'master' into pr/2453 2022-11-10 21:56:49 -05:00
Trevor Buckner
fee56ca8e0 Merge pull request #2496 from naturalcrit/fixV3_PreviewTest
Update Jest test  for moved legacy homepage
2022-11-10 21:55:32 -05:00
Trevor Buckner
de60419926 Update config.yml 2022-11-10 21:53:28 -05:00
Trevor Buckner
42a1410cc2 Update config.yml 2022-11-10 21:52:06 -05:00
Trevor Buckner
ddd4f93f01 Merge branch 'fixV3_PreviewTest' of https://github.com/naturalcrit/homebrewery into fixV3_PreviewTest 2022-11-10 21:50:09 -05:00
Trevor Buckner
21de3b31b6 Use lower npm version 2022-11-10 21:49:57 -05:00
Trevor Buckner
aea25119c0 Updated config.yml 2022-11-10 21:46:56 -05:00
Trevor Buckner
aa1100642d update circleCI config 2022-11-10 21:37:45 -05:00
Trevor Buckner
4121cc0e14 Update package-lock.json 2022-11-10 21:23:21 -05:00
Trevor Buckner
3b7b56c789 Update package-lock.json 2022-11-10 21:19:36 -05:00
Trevor Buckner
ebc03aee33 Update Jest test for moved legacy homepage 2022-11-10 21:04:25 -05:00
Gazook89
03c6edf31a change regexp to calculuschild's atomic fix 2022-11-07 10:01:22 -06:00
Gazook89
970d03a5e4 validate thumbnail is URL 2022-11-06 13:17:39 -06:00
Gazook89
ed4c090f21 finish setting OG tags 2022-11-06 12:34:24 -06:00
Gazook89
672d582caf move metaTag objects to app.js 2022-11-05 23:32:30 -05:00
Gazook89
b6c09683be add language field validation (for future pr)
fix an oversight in validations
2022-11-05 20:07:27 -05:00
Gazook89
a13fd48cda prevent crash on input to second field. small css change 2022-11-05 12:19:01 -05:00
Gazook89
aec1147aa5 set :invalid input to light red background 2022-11-05 11:56:48 -05:00
Gazook89
78da48b08d fix issue with async setState using Event.persist() 2022-11-05 11:42:21 -05:00
Gazook89
edce191c29 remove a silly rule 2022-11-05 11:32:35 -05:00
Gazook89
8c52a253dc log errs correctly, setCustomValidity and reportValidity 2022-11-04 20:22:59 -05:00
Gazook89
589ec0251a move validations into it's own file. 2022-11-04 15:32:20 -05:00
Gazook89
ffddc275c1 set removeItem icon to transparent background 2022-11-03 23:38:46 -05:00
Gazook89
4e26bb309c Merge branch 'master' into Open-Graph-Meta-Changes 2022-11-03 22:05:13 -05:00
Gazook89
7696be5d95 first commit 2022-11-03 22:00:45 -05:00
Trevor Buckner
ef80c23034 Merge pull request #2479 from G-Ambatte/excludeGoogleStubsFromAccountPage
[AccountPage] Modify query to exclude Google brew stubs
2022-10-31 22:37:40 -04:00
G.Ambatte
1f7be69624 Modify query to exclude Google brew stubs 2022-10-31 17:43:41 +13:00
Trevor Buckner
6e069dc29d Merge pull request #2161 from G-Ambatte/createUIBasePage
Create UI base page
2022-10-30 11:08:04 -04:00
G.Ambatte
e40bbf56c7 Merge branch 'master' into createUIBasePage 2022-10-30 18:21:45 +13:00
Trevor Buckner
65beb8d65e Merge branch 'master' into pr/2442 2022-10-28 14:07:14 -04:00
Trevor Buckner
ebf4f614c4 Merge pull request #2447 from Gazook89/autosave-default-fix
Fix Autosave Default
2022-10-28 14:05:45 -04:00
Trevor Buckner
26942e276a Merge branch 'master' into pr/2447 2022-10-28 14:04:45 -04:00
Trevor Buckner
0bcce67e39 Small logic simplification 2022-10-28 14:04:28 -04:00
Trevor Buckner
3318ba6277 Merge pull request #2450 from G-Ambatte/fixUserPageStyle-#2449
[UserPage] Fix UserPage groups styling
2022-10-28 14:00:17 -04:00
Trevor Buckner
c5eb7db432 Merge pull request #2448 from naturalcrit/dependabot/npm_and_yarn/dedent-tabs-0.10.2
Bump dedent-tabs from 0.10.1 to 0.10.2
2022-10-28 13:07:26 -04:00
Trevor Buckner
f35345f385 Actually update version number. 2022-10-28 13:03:09 -04:00
Trevor Buckner
a13ac2e0c5 Merge pull request #2469 from jeddai/update-twitter-card
update twitter:card meta tag to have "summary" as the content
2022-10-28 02:31:09 -04:00
Trevor Buckner
27eb95ece8 Simplify split-table margins, .blank should have no margins before or after 2022-10-28 02:10:22 -04:00
Trevor Buckner
7958bb4cda Missed one table style 2022-10-28 00:51:40 -04:00
Trevor Buckner
8fc01ebb12 Merge pull request #2472 from naturalcrit/Version3.3.1
Update changelog.md
2022-10-28 00:11:57 -04:00
Trevor Buckner
d2c10bb9ac Update changelog.md 2022-10-28 00:11:31 -04:00
Trevor Buckner
13eedc9f82 Merge pull request #2467 from naturalcrit/dependabot/npm_and_yarn/googleapis-108.0.1
Bump googleapis from 108.0.0 to 108.0.1
2022-10-28 00:05:45 -04:00
Trevor Buckner
6f919bc214 Merge pull request #2471 from naturalcrit/MoreThemesFixes
More themes fixes
2022-10-28 00:05:28 -04:00
Trevor Buckner
496328d511 Remove unnecessary spacing rules from Blank Theme 2022-10-27 23:46:47 -04:00
Trevor Buckner
d6af56c51c Move table line-height from TD to Table 2022-10-27 23:34:50 -04:00
Trevor Buckner
079d59695f Return :where(.page) to .page 2022-10-27 23:27:56 -04:00
Charlie Humphreys
ac7b2bce9f update twitter:card meta tag to have "summary" as the content 2022-10-27 21:14:14 -05:00
dependabot[bot]
4664d88aad Bump googleapis from 108.0.0 to 108.0.1
Bumps [googleapis](https://github.com/googleapis/google-api-nodejs-client) from 108.0.0 to 108.0.1.
- [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-v108.0.0...googleapis-v108.0.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-26 03:01:07 +00:00
Trevor Buckner
7d6a3da2e2 Merge pull request #2465 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.7.0
Bump mongoose from 6.6.5 to 6.7.0
2022-10-24 23:20:42 -04:00
Trevor Buckner
4180a7cfb4 Merge pull request #2455 from naturalcrit/dependabot/npm_and_yarn/babel/plugin-transform-runtime-7.19.6
Bump @babel/plugin-transform-runtime from 7.19.1 to 7.19.6
2022-10-24 23:20:15 -04:00
Trevor Buckner
a2e11d12c9 Merge pull request #2452 from G-Ambatte/fixBrewItemError-#2451
[UserPage] Add key prop to Brew tags
2022-10-24 23:20:02 -04:00
dependabot[bot]
301c3fbdd2 Bump @babel/plugin-transform-runtime from 7.19.1 to 7.19.6
Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.19.1 to 7.19.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.19.6/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-10-25 03:16:37 +00:00
Trevor Buckner
35088188b3 Merge pull request #2456 from naturalcrit/dependabot/npm_and_yarn/babel/core-7.19.6
Bump @babel/core from 7.19.3 to 7.19.6
2022-10-24 23:15:38 -04:00
Trevor Buckner
95cda71eb5 Merge pull request #2458 from naturalcrit/dependabot/npm_and_yarn/eslint-8.26.0
Bump eslint from 8.25.0 to 8.26.0
2022-10-24 23:15:26 -04:00
Trevor Buckner
a2e9fc67e4 Merge pull request #2463 from naturalcrit/dependabot/npm_and_yarn/jest-29.2.2
Bump jest from 29.2.1 to 29.2.2
2022-10-24 23:15:18 -04:00
dependabot[bot]
50c541f3fa Bump jest from 29.2.1 to 29.2.2
Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.2.1 to 29.2.2.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v29.2.2/packages/jest)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-25 03:12:38 +00:00
dependabot[bot]
f98a3fe6c5 Bump eslint from 8.25.0 to 8.26.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.25.0 to 8.26.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.25.0...v8.26.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-10-25 03:11:05 +00:00
Trevor Buckner
d2c86bf619 Merge pull request #2464 from naturalcrit/dependabot/npm_and_yarn/supertest-6.3.1
Bump supertest from 6.3.0 to 6.3.1
2022-10-24 23:10:00 -04:00
dependabot[bot]
aeb4f85a48 Bump mongoose from 6.6.5 to 6.7.0
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.6.5 to 6.7.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.6.5...6.7.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-10-25 03:01:46 +00:00
dependabot[bot]
b8f32cc2cb Bump supertest from 6.3.0 to 6.3.1
Bumps [supertest](https://github.com/visionmedia/supertest) from 6.3.0 to 6.3.1.
- [Release notes](https://github.com/visionmedia/supertest/releases)
- [Commits](https://github.com/visionmedia/supertest/compare/v6.3.0...v6.3.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-25 03:01:25 +00:00
Trevor Buckner
d562308b63 Merge pull request #2461 from naturalcrit/FixPHBHeaderSpacings
Fix PHB Tables (again) + Header spacings
2022-10-24 19:37:20 -04:00
Trevor Buckner
2d26e7cd07 Handle spacing at bottom of side-by-side tables 2022-10-24 19:29:59 -04:00
Trevor Buckner
8b011804ca Merge branch 'master' into FixPHBHeaderSpacings 2022-10-24 17:08:49 -04:00
Trevor Buckner
93a90dbf13 Merge pull request #2460 from naturalcrit/FixPrintPageMissingBlankTheme
Fix "blank" theme not included on print page.
2022-10-24 17:08:33 -04:00
Trevor Buckner
2b6585545c Fix "blank" theme not included on print page. 2022-10-24 17:04:33 -04:00
Trevor Buckner
047160e4ec Further tweaks to table size/header spacings 2022-10-24 17:01:38 -04:00
Trevor Buckner
6a6ee9fc12 Tweak top margins for headers 2022-10-21 09:27:55 -04:00
dependabot[bot]
96577794e9 Bump @babel/core from 7.19.3 to 7.19.6
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.19.3 to 7.19.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.19.6/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-10-21 03:01:56 +00:00
Gazook89
5c3f7b1b82 small fixes 2022-10-20 11:46:53 -05:00
Gazook89
bdf1bd1e8b add user page 2022-10-20 11:40:10 -05:00
Gazook89
df6d372243 Merge branch 'master' into Open-Graph-Meta-Changes 2022-10-20 11:19:48 -05:00
Gazook89
b237456420 add fn to change meta tags based on page 2022-10-20 11:19:17 -05:00
G.Ambatte
99382adbf6 Add key prop to Brew tags 2022-10-20 17:34:06 +13:00
G.Ambatte
3f0c950e72 Fix UserPage groups styling 2022-10-20 17:26:46 +13:00
dependabot[bot]
2b71ff2dec Bump dedent-tabs from 0.10.1 to 0.10.2
Bumps [dedent-tabs](https://github.com/adrianjost/dedent-tabs) from 0.10.1 to 0.10.2.
- [Release notes](https://github.com/adrianjost/dedent-tabs/releases)
- [Commits](https://github.com/adrianjost/dedent-tabs/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-20 03:01:28 +00:00
Gazook89
1801691f49 fix autosave default 2022-10-19 11:45:47 -05:00
Trevor Buckner
2bad0bfcb0 Further table tweaks for Chrome 106 2022-10-19 09:06:48 -04:00
Trevor Buckner
ac30b3df9d Merge pull request #2446 from naturalcrit/Update-to-v-3.3.0
Update to v 3.3.0
2022-10-19 00:54:29 -04:00
Trevor Buckner
f67ba7ecda Update changelog.md 2022-10-19 00:50:30 -04:00
Trevor Buckner
812b8350d3 3.3.0 2022-10-19 00:49:31 -04:00
Trevor Buckner
0c67a23b57 Update changelog.md 2022-10-19 00:49:24 -04:00
Trevor Buckner
976f6be3f0 Merge pull request #2441 from naturalcrit/TemporaryChromeTableHeightFix
Tweak table padding
2022-10-19 00:07:33 -04:00
Trevor Buckner
852d2a1d5f Merge pull request #2443 from naturalcrit/dependabot/npm_and_yarn/jest-29.2.1
Bump jest from 29.2.0 to 29.2.1
2022-10-19 00:07:11 -04:00
dependabot[bot]
bf39d4124c Bump jest from 29.2.0 to 29.2.1
Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.2.0 to 29.2.1.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v29.2.1/packages/jest)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-19 03:01:25 +00:00
Gazook89
04eebae3ec Merge branch 'master' into Open-Graph-Meta-Changes 2022-10-18 21:19:55 -05:00
Gazook89
23a0a89ead autohide dropdown again 2022-10-18 21:02:44 -05:00
Gazook89
a7a67621a1 added removeItem() function 2022-10-18 21:01:24 -05:00
Trevor Buckner
2d2a81a3ca Tweak table padding 2022-10-18 21:29:34 -04:00
Gazook89
bebb06a36d Merge branch 'master' into Delete-Recent-Items 2022-10-18 19:22:01 -05:00
Trevor Buckner
c4e331ee7e Merge pull request #2438 from G-Ambatte/fixToC-#2437
Change ToC to use flexbox
2022-10-18 15:25:24 -04:00
Trevor Buckner
13192dc102 Merge pull request #2428 from G-Ambatte/fixSaveFromHomePage-#2427
Send entire brew to HomePage save function
2022-10-18 14:12:47 -04:00
Trevor Buckner
ab773f5f7b Merge pull request #2426 from G-Ambatte/ignoreVSCodeFIles
Add .vscode to .gitignore
2022-10-18 14:12:15 -04:00
Trevor Buckner
164a0fe8d5 Merge pull request #2425 from G-Ambatte/addURIEncodingToUserName-#2420
Add URI encoding to User Page link
2022-10-18 14:11:42 -04:00
Trevor Buckner
3032363aea Merge pull request #2392 from G-Ambatte/stopUnfoldingCode-#2135
[Editor] Prevent unfolding code in Editor when adding a Snippet
2022-10-18 13:55:21 -04:00
Trevor Buckner
3327712253 Focus on editor after snippet 2022-10-18 13:52:22 -04:00
Trevor Buckner
2abd0a871b Merge pull request #2416 from naturalcrit/dependabot/npm_and_yarn/supertest-6.3.0
Bump supertest from 6.2.4 to 6.3.0
2022-10-18 13:23:39 -04:00
Trevor Buckner
eff7fde8cf Merge pull request #2384 from Gazook89/Toggle-AutoSave
Add ability to toggle the Auto Save
2022-10-18 13:23:26 -04:00
Trevor Buckner
8b8a60c8ad tweak alert text 2022-10-18 13:22:29 -04:00
Trevor Buckner
5350f7d933 Merge pull request #2418 from naturalcrit/dependabot/npm_and_yarn/react-router-dom-6.4.2
Bump react-router-dom from 6.3.0 to 6.4.2
2022-10-18 11:57:36 -04:00
Trevor Buckner
30c9b35354 Merge pull request #2404 from naturalcrit/dependabot/npm_and_yarn/babel/core-7.19.3
Bump @babel/core from 7.19.1 to 7.19.3
2022-10-18 11:57:23 -04:00
Trevor Buckner
4c46388686 Merge pull request #2419 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.6.5
Bump mongoose from 6.6.1 to 6.6.5
2022-10-18 11:57:12 -04:00
dependabot[bot]
3bd9fe4c99 Bump supertest from 6.2.4 to 6.3.0
Bumps [supertest](https://github.com/visionmedia/supertest) from 6.2.4 to 6.3.0.
- [Release notes](https://github.com/visionmedia/supertest/releases)
- [Commits](https://github.com/visionmedia/supertest/compare/v6.2.4...v6.3.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-18 15:32:04 +00:00
Trevor Buckner
837554eb17 Merge pull request #2439 from naturalcrit/dependabot/npm_and_yarn/jest-29.2.0
Bump jest from 29.0.3 to 29.2.0
2022-10-18 11:30:45 -04:00
Gazook89
d8fe54b7b2 Merge branch 'master' into Toggle-AutoSave 2022-10-17 21:53:35 -05:00
Gazook89
c49be3391e change time delay between warnings to 15min 2022-10-17 21:52:48 -05:00
Gazook89
c56adcba76 only display 'off' warning if changes exist 2022-10-17 21:49:50 -05:00
dependabot[bot]
74e20bf7be Bump jest from 29.0.3 to 29.2.0
Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.0.3 to 29.2.0.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v29.2.0/packages/jest)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-17 03:01:24 +00:00
G.Ambatte
7896fe3ed9 Remove footer on pages with ToC 2022-10-16 22:37:30 +13:00
G.Ambatte
0e0cdfe25b Fix font size in ToC 2022-10-16 21:20:01 +13:00
G.Ambatte
2c2a10730e Change style of page numbers 2022-10-16 21:01:45 +13:00
G.Ambatte
51f8786905 Change ToC to use flexbox 2022-10-16 20:34:18 +13:00
dependabot[bot]
78a5390917 Bump @babel/core from 7.19.1 to 7.19.3
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.19.1 to 7.19.3.
- [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.19.3/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-10-11 01:18:32 +00:00
Trevor Buckner
d998381bbe Merge pull request #2435 from naturalcrit/dependabot/npm_and_yarn/babel/preset-env-7.19.4
Bump @babel/preset-env from 7.19.1 to 7.19.4
2022-10-10 21:17:48 -04:00
Trevor Buckner
6326a93d98 Merge pull request #2434 from naturalcrit/dependabot/npm_and_yarn/eslint-plugin-react-7.31.10
Bump eslint-plugin-react from 7.31.8 to 7.31.10
2022-10-10 21:17:42 -04:00
dependabot[bot]
e4e619ac1e Bump @babel/preset-env from 7.19.1 to 7.19.4
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.19.1 to 7.19.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.19.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>
2022-10-11 01:11:34 +00:00
dependabot[bot]
439afcb667 Bump eslint-plugin-react from 7.31.8 to 7.31.10
Bumps [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) from 7.31.8 to 7.31.10.
- [Release notes](https://github.com/jsx-eslint/eslint-plugin-react/releases)
- [Changelog](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jsx-eslint/eslint-plugin-react/compare/v7.31.8...v7.31.10)

---
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>
2022-10-11 01:11:10 +00:00
Trevor Buckner
f4108f241e Merge pull request #2422 from naturalcrit/dependabot/npm_and_yarn/body-parser-1.20.1
Bump body-parser from 1.20.0 to 1.20.1
2022-10-10 21:10:36 -04:00
Trevor Buckner
2e3c9114c6 Merge pull request #2412 from naturalcrit/dependabot/npm_and_yarn/marked-4.1.1
Bump marked from 4.1.0 to 4.1.1
2022-10-10 21:10:16 -04:00
Trevor Buckner
746b04646c Merge pull request #2431 from naturalcrit/dependabot/npm_and_yarn/express-4.18.2
Bump express from 4.18.1 to 4.18.2
2022-10-10 21:10:04 -04:00
Trevor Buckner
a7577bf83b Merge pull request #2432 from naturalcrit/dependabot/npm_and_yarn/eslint-8.25.0
Bump eslint from 8.24.0 to 8.25.0
2022-10-10 21:09:51 -04:00
dependabot[bot]
b283e8e66a Bump eslint from 8.24.0 to 8.25.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.24.0 to 8.25.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.24.0...v8.25.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-10-10 03:01:22 +00:00
dependabot[bot]
a129e887dd Bump express from 4.18.1 to 4.18.2
Bumps [express](https://github.com/expressjs/express) from 4.18.1 to 4.18.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.18.1...4.18.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-10 03:01:07 +00:00
G.Ambatte
ed65d0c922 Send entire brew to HomePage save function 2022-10-09 11:55:05 +13:00
G.Ambatte
df53369ec1 Add .vscode to .gitignore 2022-10-08 14:56:42 +13:00
G.Ambatte
cc385462de Add URI encoding to User Page link 2022-10-08 14:47:59 +13:00
dependabot[bot]
269ba246ec Bump body-parser from 1.20.0 to 1.20.1
Bumps [body-parser](https://github.com/expressjs/body-parser) from 1.20.0 to 1.20.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.20.0...1.20.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>
2022-10-07 03:01:00 +00:00
dependabot[bot]
a67b1b9c12 Bump mongoose from 6.6.1 to 6.6.5
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.6.1 to 6.6.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.6.1...6.6.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-10-06 03:02:20 +00:00
dependabot[bot]
8c13d4d7ad Bump react-router-dom from 6.3.0 to 6.4.2
Bumps [react-router-dom](https://github.com/remix-run/react-router/tree/HEAD/packages/react-router-dom) from 6.3.0 to 6.4.2.
- [Release notes](https://github.com/remix-run/react-router/releases)
- [Changelog](https://github.com/remix-run/react-router/blob/react-router-dom@6.4.2/packages/react-router-dom/CHANGELOG.md)
- [Commits](https://github.com/remix-run/react-router/commits/react-router-dom@6.4.2/packages/react-router-dom)

---
updated-dependencies:
- dependency-name: react-router-dom
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-06 03:01:39 +00:00
Gazook89
8562d328ff Merge remote-tracking branch 'upstream/master' into Toggle-AutoSave 2022-10-03 20:46:11 -05:00
G.Ambatte
1d8781da90 Modify how data is passed to UIPage 2022-10-03 20:27:34 +13:00
dependabot[bot]
dd64d19037 Bump marked from 4.1.0 to 4.1.1
Bumps [marked](https://github.com/markedjs/marked) from 4.1.0 to 4.1.1.
- [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.1.0...v4.1.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-03 03:01:09 +00:00
G.Ambatte
93918bc26c Nudge SVG size 2022-10-02 11:06:57 +13:00
Gazook89
bfb82e8a21 autosave warning conditional on elapsed time unsaved. 2022-09-30 12:20:59 -05:00
Gazook89
8609026531 add unsavedTime state for better notification 2022-09-30 11:24:15 -05:00
Gazook89
0cd598ae14 rework the whole thing 2022-09-30 10:42:50 -05:00
Gazook89
95497350e4 move test for autosave status to handleTextChange from trySave() 2022-09-28 20:20:11 -05:00
Gazook89
9bb1344538 tweak behavior per calculuschild notes
Default to autosave = true.   trySave() when autosave toggled on.  Display "auto-saved." when save is a result of autosave.
2022-09-28 12:17:14 -05:00
Gazook89
ab695d29fe refactor into handle... and render... methods 2022-09-28 11:13:16 -05:00
Gazook89
fa4b3338af save autosave setting to localStorage 2022-09-27 21:04:51 -05:00
Gazook89
c7ed9ea717 Create autosave toggle dropdown menu 2022-09-27 19:35:29 -05:00
G.Ambatte
7ae939623c Merge branch 'master' into createUIBasePage 2022-09-28 07:06:01 +13:00
G.Ambatte
de86a77dfc Change post-insertion selection option 2022-09-27 17:06:48 +13:00
G.Ambatte
b44a7d3236 Merge branch 'master' into stopUnfoldingCode-#2135 2022-09-27 13:01:30 +13:00
Trevor Buckner
a3c7e2f807 Merge pull request #2396 from G-Ambatte/adjustCodeFold-#1907
[Editor] Change folded code text generation
2022-09-26 16:40:40 -04:00
G.Ambatte
447f8d39dc Reduce variable use 2022-09-27 08:03:43 +13:00
G.Ambatte
7b961af45f Merge branch 'master' into adjustCodeFold-#1907 2022-09-27 07:54:05 +13:00
Gazook89
bc0ee8138e change title and description 2022-09-26 13:03:40 -05:00
G.Ambatte
91b2911bb0 Change capitalization of page title 2022-09-26 20:17:52 +13:00
G.Ambatte
9848dc54ba Add Nav bar items 2022-09-26 19:07:46 +13:00
G.Ambatte
9a3bd4db4b Merge branch 'master' into createUIBasePage 2022-09-26 19:02:07 +13:00
G.Ambatte
891bde6990 Merge branch 'createUIBasePage' of https://github.com/G-Ambatte/homebrewery into createUIBasePage 2022-09-26 18:44:45 +13:00
G.Ambatte
d9228b8c4b Add Account menu item 2022-09-26 18:43:47 +13:00
Trevor Buckner
edd58455f6 Merge pull request #2399 from naturalcrit/dependabot/npm_and_yarn/got-and-nodemon--removed
Bump got and nodemon
2022-09-25 23:56:57 -04:00
Trevor Buckner
e082167c39 Merge pull request #2398 from naturalcrit/dependabot/npm_and_yarn/eslint-8.24.0
Bump eslint from 8.23.1 to 8.24.0
2022-09-25 23:55:04 -04:00
G.Ambatte
5a3daf8ffd Merge branch 'master' into createUIBasePage 2022-09-26 16:34:44 +13:00
dependabot[bot]
3719614dee Bump got and nodemon
Removes [got](https://github.com/sindresorhus/got). It's no longer used after updating ancestor dependency [nodemon](https://github.com/remy/nodemon). These dependencies need to be updated together.


Removes `got`

Updates `nodemon` from 2.0.7 to 2.0.20
- [Release notes](https://github.com/remy/nodemon/releases)
- [Commits](https://github.com/remy/nodemon/compare/v2.0.7...v2.0.20)

---
updated-dependencies:
- dependency-name: got
  dependency-type: indirect
- dependency-name: nodemon
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-26 03:27:43 +00:00
Trevor Buckner
e098dc21ce Merge pull request #2389 from naturalcrit/dependabot/npm_and_yarn/googleapis-108.0.0
Bump googleapis from 107.0.0 to 108.0.0
2022-09-25 23:26:55 -04:00
Trevor Buckner
f4580f9040 Merge pull request #2372 from Gazook89/CSS-Flex-Meta-Editor
Reposition Thumbnail Preview in Metadata Editor
2022-09-25 23:19:27 -04:00
Trevor Buckner
6e05186f1a Merge pull request #2395 from G-Ambatte/shiftThumbnailUrlToStub-#2351
[Stub] Shift thumbnail url to stub #2351
2022-09-25 23:16:50 -04:00
Trevor Buckner
9701c55195 Merge branch 'master' into pr/2395 2022-09-25 23:08:37 -04:00
dependabot[bot]
0d2eebe324 Bump eslint from 8.23.1 to 8.24.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.23.1 to 8.24.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.23.1...v8.24.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-09-26 03:01:13 +00:00
Trevor Buckner
e21fe49359 Merge pull request #2387 from Gazook89/stat-block-color-tweak
Change Monster Stat background color
2022-09-25 22:54:42 -04:00
Trevor Buckner
bc94082eb6 Merge pull request #2383 from Gazook89/Prevent-Selection-on-splitPane-drag
Prevent text selection in editor when dragging splitPane divider.
2022-09-25 22:29:36 -04:00
Trevor Buckner
5d769d2297 Merge pull request #2382 from Gazook89/scroll-behavior-correction
Scroll behavior correction
2022-09-25 22:26:15 -04:00
Trevor Buckner
48d0434178 Merge branch 'master' into pr/2382 2022-09-25 22:23:19 -04:00
Trevor Buckner
f74b84bd12 Merge pull request #2379 from Gazook89/filter-sort-as-divs
Change User Page search bar to Divs
2022-09-25 22:21:58 -04:00
Trevor Buckner
910868cfdb Simplified sort arrow, removed duplicate "onClick" 2022-09-25 22:20:44 -04:00
G.Ambatte
5469ec6683 Format Issued datetime 2022-09-26 13:28:50 +13:00
G.Ambatte
764621f762 Add Homebrewery Icon 2022-09-26 12:12:21 +13:00
G.Ambatte
248687684a Add group styling 2022-09-26 11:31:00 +13:00
G.Ambatte
d7b1f89152 Change data items to a list 2022-09-26 11:30:45 +13:00
G.Ambatte
9a844dae39 Fix class=>className 2022-09-26 00:41:49 +13:00
G.Ambatte
5193271796 Fix Google Drive icon 2022-09-26 00:41:17 +13:00
G.Ambatte
ed5bef27e0 Shift renderUiItems to function 2022-09-26 00:35:12 +13:00
G.Ambatte
be25e90009 Change variable name 2022-09-26 00:34:54 +13:00
G.Ambatte
ab98bf5d6c Fix Routes 2022-09-26 00:05:53 +13:00
G.Ambatte
ffb1c77697 Merge branch 'createUIBasePage' 2022-09-25 23:54:20 +13:00
G.Ambatte
6bddba6762 Merge branch 'master' into createUIBasePage 2022-09-25 23:47:55 +13:00
G.Ambatte
57b0af54df Renamed functions, eliminate unnecessary variable 2022-09-25 23:29:45 +13:00
G.Ambatte
0ac50017c4 Change path to /account 2022-09-25 23:20:45 +13:00
G.Ambatte
9135ca1e43 Fix class => className 2022-09-25 23:20:03 +13:00
G.Ambatte
1dc6256aab Change fold-marker color to grey 2022-09-25 19:59:35 +13:00
G.Ambatte
227be5e3be Modify folded text generation 2022-09-25 13:55:46 +13:00
G.Ambatte
e18e3cf7e4 Remove thumbnail from Google brew properties 2022-09-24 23:51:08 +12:00
G.Ambatte
ca09e98d8f Exclude thumbnail from Google props 2022-09-24 23:50:20 +12:00
G.Ambatte
db174c9655 Add optional overwrite protection 2022-09-24 13:50:26 +12:00
G.Ambatte
22896470e3 Remove unused splice function 2022-09-24 13:36:14 +12:00
G.Ambatte
56fde5a448 Use cm.replaceSelection instead of split/join text 2022-09-24 13:34:26 +12:00
Trevor Buckner
6ade9925d7 Merge pull request #2388 from Gazook89/Display-Renderer-on-Page
Add renderer to pageInfo
2022-09-22 14:51:20 -04:00
Trevor Buckner
e755ab878d Merge pull request #2332 from G-Ambatte/showThumbnailOnUserPage-#2331
[UserPage] Show Brew's Meta thumbnail on UserPage
2022-09-22 14:23:06 -04:00
G.Ambatte
fa0d8e86fc Remove unnecessary empty element 2022-09-22 20:25:18 +12:00
dependabot[bot]
5458b8297c Bump googleapis from 107.0.0 to 108.0.0
Bumps [googleapis](https://github.com/googleapis/google-api-nodejs-client) from 107.0.0 to 108.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-v107.0.0...googleapis-v108.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-09-22 03:01:15 +00:00
Gazook89
f3c9dde801 thumbnail preview de-uglification 2022-09-21 20:50:10 -05:00
Gazook89
45aa8bdfae Add html node and css for Delete button 2022-09-21 20:27:16 -05:00
G.Ambatte
09d161f3a6 Adjust background image properties 2022-09-22 07:48:51 +12:00
Gazook89
90a65d0a57 Add renderer to pageInfo 2022-09-21 11:37:14 -05:00
Gazook89
0bf1328c17 change monster stat background color 2022-09-21 11:29:42 -05:00
Gazook89
3754468cf4 change sortDir by clicking on sort title. 2022-09-21 11:12:23 -05:00
Gazook89
6329cb2cec style changes for better contrast 2022-09-21 10:56:45 -05:00
G.Ambatte
f218f48f0f Apply Gazook89's thumbnail style 2022-09-21 18:38:45 +12:00
G.Ambatte
a179f8d124 Lint fix 2022-09-21 18:16:36 +12:00
Gazook89
f681948a35 pedantic change 2022-09-21 00:42:10 -05:00
Gazook89
475f3e75dd add simple toggle to 'save status' field for auto-save 2022-09-21 00:29:40 -05:00
Gazook89
f337925af9 add e.preventDefault() to mousedown event 2022-09-20 23:46:25 -05:00
G.Ambatte
918690e773 Merge branch 'master' into showThumbnailOnUserPage-#2331 2022-09-21 14:35:27 +12:00
Gazook89
7623d3e93a set scrollbar to 'thin' in recentItems dropdown 2022-09-20 20:37:55 -05:00
Gazook89
f2a8a6a03a match scroll bar style of recentItems to UI 2022-09-20 19:59:38 -05:00
Gazook89
49cc4180a7 set only listPage to overflow-y scroll.
The pages are not all quite set up the same way.  /new/, /edit/, and /share/ all use an iframe and those iframes have their own scroll behavior.  /user/ doesn't have an iframe and so the `.content` portion of the page needs to scroll.
2022-09-20 19:58:52 -05:00
Trevor Buckner
8ebfc772f3 Merge pull request #2381 from Gazook89/Effect-to-Affect-PPR
Update PPR notice with correct spelling.
2022-09-20 13:21:36 -04:00
Gazook89
38dccbae09 change 'effect' to 'affect' 2022-09-20 12:19:27 -05:00
Trevor Buckner
0f68f5a356 Merge pull request #2380 from Gazook89/reddit-issue-template-fix
Make Reddit Issue Template a List
2022-09-19 22:19:04 -04:00
Gazook89
7999553973 make reddit issue template a list 2022-09-19 20:44:31 -05:00
Gazook89
3c75ac6156 change some .less to reflect new focus of .active 2022-09-19 11:30:44 -05:00
Gazook89
9fcc7b84c3 set .sort-option to .active rather than button within. 2022-09-19 11:07:47 -05:00
Gazook89
8ac4d93581 change sort-container to baseline alignment 2022-09-19 10:47:35 -05:00
Gazook89
10a349ade8 change sortDir to always white. 2022-09-19 10:27:02 -05:00
Gazook89
87a9194189 remove unset on listPage height. 2022-09-19 10:08:52 -05:00
Gazook89
ac371946d8 Merge branch 'master' into filter-sort-as-divs 2022-09-19 10:04:47 -05:00
Trevor Buckner
158d47edde Merge pull request #2378 from Gazook89/github-forms
remove labels from dropdowns and add label
2022-09-19 11:00:34 -04:00
Gazook89
5ad4e6b1f1 remove labels from dropdowns and add label 2022-09-19 09:54:34 -05:00
Trevor Buckner
ce7c3dfb8a Merge pull request #2377 from Gazook89/github-forms
GitHub forms tweaks
2022-09-19 10:44:36 -04:00
Gazook89
208e9261ce fixed two more validations 2022-09-19 09:31:55 -05:00
Gazook89
af8d327ae2 fix editPage url query & Saving label 2022-09-18 19:37:40 -05:00
Gazook89
0d931ed5b5 add validation (required) to user-description in save_issue.yml 2022-09-18 19:33:53 -05:00
Gazook89
d8039b0cf2 removed 'title' from save_issue.yml 2022-09-18 19:32:15 -05:00
Gazook89
2e27c5957d fix checkboxes on feature_request.yml 2022-09-18 19:30:30 -05:00
Gazook89
1bfcb5a839 fix 'validations' on general_issue.yaml 2022-09-18 19:25:26 -05:00
Trevor Buckner
6d98119df2 Merge pull request #2367 from Gazook89/github-forms
Add different Issue forms
2022-09-18 17:20:25 -04:00
Trevor Buckner
a90028d93f Merge pull request #2360 from Gazook89/navbar-vs-content-sections
change overflow-y behavior to fix navbar
2022-09-18 17:16:48 -04:00
Gazook89
630ff9d86a add browser field 2022-09-18 10:32:50 -05:00
Gazook89
600b92cbce Move 'additional steps' to end of post. 2022-09-18 10:19:00 -05:00
Gazook89
7a609f5a78 set Report Save Issue to open save_issue.yaml template 2022-09-18 10:08:01 -05:00
Gazook89
4c3b9f8fb6 small requested changes 2022-09-17 23:59:25 -05:00
Gazook89
b120c47faa add vertical scroll - auto 2022-09-15 13:38:09 -05:00
Gazook89
49a3057765 clear out some unused properties 2022-09-15 13:33:19 -05:00
Gazook89
fc5d06be0e fixed vertical spacing 2022-09-15 13:19:27 -05:00
Gazook89
bb25d30663 flex working, but odd vertical spacing 2022-09-15 12:29:25 -05:00
Trevor Buckner
d20bb15204 Merge pull request #2370 from naturalcrit/dependabot/npm_and_yarn/babel/preset-env-7.19.1
Bump @babel/preset-env from 7.19.0 to 7.19.1
2022-09-14 23:03:51 -04:00
Trevor Buckner
4261b515e6 Merge pull request #2368 from naturalcrit/dependabot/npm_and_yarn/babel/core-7.19.1
Bump @babel/core from 7.19.0 to 7.19.1
2022-09-14 23:03:43 -04:00
dependabot[bot]
283db495ad Bump @babel/preset-env from 7.19.0 to 7.19.1
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.19.0 to 7.19.1.
- [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.19.1/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-09-15 03:03:36 +00:00
dependabot[bot]
535bb34ed4 Bump @babel/core from 7.19.0 to 7.19.1
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.19.0 to 7.19.1.
- [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.19.1/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-09-15 03:03:35 +00:00
Trevor Buckner
1d4ebf48f2 Merge pull request #2363 from naturalcrit/dependabot/npm_and_yarn/classnames-2.3.2
Bump classnames from 2.3.1 to 2.3.2
2022-09-14 23:03:18 -04:00
Trevor Buckner
f637018b5d Merge pull request #2369 from naturalcrit/dependabot/npm_and_yarn/babel/plugin-transform-runtime-7.19.1
Bump @babel/plugin-transform-runtime from 7.18.10 to 7.19.1
2022-09-14 23:02:58 -04:00
Trevor Buckner
4dfbf8ecaf Merge pull request #2371 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.6.1
Bump mongoose from 6.6.0 to 6.6.1
2022-09-14 23:02:48 -04:00
Trevor Buckner
c3b17a6816 Merge pull request #2355 from naturalcrit/dependabot/npm_and_yarn/eslint-plugin-react-7.31.8
Bump eslint-plugin-react from 7.31.7 to 7.31.8
2022-09-14 23:02:37 -04:00
dependabot[bot]
f940a9181a Bump mongoose from 6.6.0 to 6.6.1
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.6.0 to 6.6.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.6.0...6.6.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-15 03:02:23 +00:00
dependabot[bot]
95a0151234 Bump @babel/plugin-transform-runtime from 7.18.10 to 7.19.1
Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.18.10 to 7.19.1.
- [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.19.1/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-09-15 03:01:46 +00:00
Gazook89
3bae1565b2 Add different Issue forms 2022-09-14 21:30:01 -05:00
dependabot[bot]
66cf29e58f Bump classnames from 2.3.1 to 2.3.2
Bumps [classnames](https://github.com/JedWatson/classnames) from 2.3.1 to 2.3.2.
- [Release notes](https://github.com/JedWatson/classnames/releases)
- [Changelog](https://github.com/JedWatson/classnames/blob/main/HISTORY.md)
- [Commits](https://github.com/JedWatson/classnames/compare/v2.3.1...v2.3.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-14 03:01:24 +00:00
Gazook89
9f4920fd2a change overflow-y behavior to fix navbar 2022-09-13 15:55:50 -05:00
dependabot[bot]
2724eb6518 Bump eslint-plugin-react from 7.31.7 to 7.31.8
Bumps [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) from 7.31.7 to 7.31.8.
- [Release notes](https://github.com/jsx-eslint/eslint-plugin-react/releases)
- [Changelog](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jsx-eslint/eslint-plugin-react/compare/v7.31.7...v7.31.8)

---
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>
2022-09-13 18:40:08 +00:00
Trevor Buckner
c8742289de Merge pull request #2358 from naturalcrit/dependabot/npm_and_yarn/eslint-8.23.1
Bump eslint from 8.23.0 to 8.23.1
2022-09-13 14:25:01 -04:00
Trevor Buckner
0e40da73f6 Merge pull request #2354 from naturalcrit/dependabot/npm_and_yarn/jest-29.0.3
Bump jest from 29.0.2 to 29.0.3
2022-09-13 14:24:46 -04:00
Trevor Buckner
93b1576de1 Merge pull request #2359 from Gazook89/mongodb-URL-change
Change MongoDB address from localhost to 127.0.0.1
2022-09-13 13:51:02 -04:00
Gazook89
cfdbe06d07 move dir button next to active sort option 2022-09-13 12:26:28 -05:00
Gazook89
46a45a8536 replace sort table with divs and give UI styling 2022-09-13 10:57:28 -05:00
Gazook89
f86ec64714 change localhost to 127.0.0.1
node v16+ better utilizes the address 127.0.01 rather than localhost, at least on MacOS while still working for Windows.
2022-09-13 09:19:34 -05:00
dependabot[bot]
08c7c8b10f Bump eslint from 8.23.0 to 8.23.1
Bumps [eslint](https://github.com/eslint/eslint) from 8.23.0 to 8.23.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.23.0...v8.23.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 20:01:09 -07:00
dependabot[bot]
8cd896fbfa Bump jest from 29.0.2 to 29.0.3
Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.0.2 to 29.0.3.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v29.0.3/packages/jest)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 03:01:21 +00:00
G.Ambatte
abe7d858a8 Merge branch 'master' into showThumbnailOnUserPage-#2331 2022-09-11 12:21:44 +12:00
Trevor Buckner
5e076fc948 Merge pull request #1954 from naturalcrit/SwappableThemes-ReorganizeFolderStructure
Swappable themes
2022-09-09 11:00:57 -04:00
Trevor Buckner
0f566fe912 Merge branch 'master' into SwappableThemes-ReorganizeFolderStructure 2022-09-09 10:51:08 -04:00
Trevor Buckner
be8abe9dcb Merge pull request #2349 from naturalcrit/Up-Version-to-v3.2.2
Up version to v3.2.2
2022-09-09 10:48:19 -04:00
Trevor Buckner
8efdf61143 Merge pull request #2348 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.6.0
Bump mongoose from 6.5.5 to 6.6.0
2022-09-08 23:50:58 -04:00
Trevor Buckner
c3f885012a Update changelog 2022-09-08 23:19:29 -04:00
Trevor Buckner
969eac4c5a 3.2.2 2022-09-08 23:02:00 -04:00
dependabot[bot]
003b9dcd7f Bump mongoose from 6.5.5 to 6.6.0
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.5.5 to 6.6.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.5.5...6.6.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-09-09 03:01:35 +00:00
Trevor Buckner
0bc20112b2 Merge pull request #2345 from jeddai/fix-delete-former-google-brew
update deletion to delete brews when the google brew cannot be found
2022-09-08 22:40:51 -04:00
Trevor Buckner
9e137fa6a8 Merge pull request #2344 from naturalcrit/StyleBrewitemTags
Add Styling to Tags on userpage
2022-09-08 22:40:31 -04:00
Trevor Buckner
1f8701bea6 Merge pull request #2342 from naturalcrit/dependabot/npm_and_yarn/babel/preset-env-7.19.0
Bump @babel/preset-env from 7.18.10 to 7.19.0
2022-09-08 22:39:21 -04:00
Trevor Buckner
313ffab7c1 Merge pull request #2341 from naturalcrit/dependabot/npm_and_yarn/eslint-plugin-react-7.31.7
Bump eslint-plugin-react from 7.31.1 to 7.31.7
2022-09-08 22:39:10 -04:00
Trevor Buckner
9f602e416f Merge pull request #2343 from naturalcrit/dependabot/npm_and_yarn/babel/core-7.19.0
Bump @babel/core from 7.18.13 to 7.19.0
2022-09-08 22:38:54 -04:00
Trevor Buckner
de90e2d801 Merge pull request #2347 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.5.5
Bump mongoose from 6.5.4 to 6.5.5
2022-09-08 22:38:37 -04:00
Trevor Buckner
3c12f1133e Tweak console warning 2022-09-08 22:38:00 -04:00
Charlie Humphreys
0625c57824 override next with an empty function 2022-09-08 08:16:49 -05:00
Charlie Humphreys
a234fdbab7 fix getBrew issue 2022-09-08 08:15:55 -05:00
dependabot[bot]
5830ee471b Bump @babel/core from 7.18.13 to 7.19.0
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.18.13 to 7.19.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.19.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-09-08 04:06:01 +00:00
dependabot[bot]
c35d97bf69 Bump eslint-plugin-react from 7.31.1 to 7.31.7
Bumps [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) from 7.31.1 to 7.31.7.
- [Release notes](https://github.com/jsx-eslint/eslint-plugin-react/releases)
- [Changelog](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jsx-eslint/eslint-plugin-react/compare/v7.31.1...v7.31.7)

---
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>
2022-09-08 04:05:48 +00:00
dependabot[bot]
6c3a9370dc Bump mongoose from 6.5.4 to 6.5.5
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.5.4 to 6.5.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.5.4...6.5.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-09-08 04:05:29 +00:00
dependabot[bot]
edb74237bd Bump @babel/preset-env from 7.18.10 to 7.19.0
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.18.10 to 7.19.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.19.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>
2022-09-08 04:05:20 +00:00
Trevor Buckner
cd8496b62b Merge pull request #2338 from naturalcrit/dependabot/npm_and_yarn/jest-29.0.2
Bump jest from 29.0.1 to 29.0.2
2022-09-08 00:04:23 -04:00
Charlie Humphreys
af1821e697 update deletion to delete brews when the google brew cannot be found 2022-09-06 22:50:51 -05:00
Trevor Buckner
c0a14a5618 remove console.log 2022-09-06 22:57:00 -04:00
Trevor Buckner
8709545f14 Don't display tags that are empty strings. 2022-09-06 22:41:10 -04:00
Trevor Buckner
e0d8846c44 tweaks 2022-09-06 01:00:38 -04:00
Trevor Buckner
cae1bc9f0a Put tags in individual spans 2022-09-05 23:31:23 -04:00
Trevor Buckner
eae5fc9be9 Hide themes behind flag "enable_themes" 2022-09-05 17:05:37 -04:00
Trevor Buckner
c2a5aad1e8 Merge branch 'master' into SwappableThemes-ReorganizeFolderStructure 2022-09-05 16:13:11 -04:00
dependabot[bot]
2a3aeec459 Bump jest from 29.0.1 to 29.0.2
Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 29.0.1 to 29.0.2.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v29.0.2/packages/jest)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-05 13:11:21 +00:00
G.Ambatte
4a89d73f73 Update brewItem.less
Co-authored-by: Trevor Buckner <calculuschild@gmail.com>
2022-09-04 16:44:18 +12:00
Trevor Buckner
746e8f8a6a Merge pull request #2329 from G-Ambatte/smartenApostrophe-#2328
[UserPage] Change apostrophe in `usernameWithS`
2022-09-03 23:12:13 -04:00
Trevor Buckner
4f52cc075a Merge pull request #2327 from G-Ambatte/addSortType&DirToLocalStorage-#2326
[UserPage] Add sort type & dir to local storage
2022-09-03 23:11:24 -04:00
Trevor Buckner
8cf8c5cabb Merge branch 'master' into addSortType&DirToLocalStorage-#2326 2022-09-03 23:11:13 -04:00
Trevor Buckner
2f44c35ede Merge pull request #2320 from G-Ambatte/addBrewTagsToFilter-#2319
[UserPage] Add tags to filter
2022-09-03 22:40:08 -04:00
Trevor Buckner
62dee13881 Merge pull request #2324 from naturalcrit/FixNewPageCloning
Fix conflicts on /new
2022-09-03 22:38:59 -04:00
G.Ambatte
3975c74b2b Add thumbnail styling to BrewItem.less 2022-09-04 00:19:26 +12:00
G.Ambatte
0f1c585567 Add thumbnail functionality to BrewItem 2022-09-04 00:19:05 +12:00
G.Ambatte
1fb3ec4057 Add thumbnail to UserPage data 2022-09-04 00:18:08 +12:00
G.Ambatte
85cad49b03 Simplify getSortedBrews logic 2022-09-03 22:28:03 +12:00
G.Ambatte
76203928d2 Change apostrophe 2022-09-03 22:07:23 +12:00
G.Ambatte
cfbc089207 Add sort type & dir to local storage 2022-09-03 21:15:32 +12:00
G.Ambatte
ba693365ec Lint fixes 2022-09-03 20:53:28 +12:00
Trevor Buckner
2c7fdd3993 Remove unused variables from Journal theme 2022-09-03 01:42:38 -04:00
Trevor Buckner
0828a9fe68 Merge branch 'master' into SwappableThemes-ReorganizeFolderStructure 2022-09-03 01:38:59 -04:00
Trevor Buckner
b4be9bb741 Default brew in getDefaultProps, don't get localstorage when cloning 2022-09-03 01:32:42 -04:00
Trevor Buckner
e5fe6b1fd9 Merge branch 'master' into pr/2320 2022-09-02 23:55:34 -04:00
Trevor Buckner
8d10800cb6 Merge pull request #2318 from G-Ambatte/addTagsToBrewItem-#2317
[UserPage] Add tags to UserPage BrewItem
2022-09-02 23:43:26 -04:00
Trevor Buckner
67099bba40 Merge pull request #2316 from G-Ambatte/addSortTypeAndDirToURL-#2315
[UserPage] Add sort type and dir to URL
2022-09-02 22:46:25 -04:00
Trevor Buckner
d94b274439 Merge branch 'master' into addSortTypeAndDirToURL-#2315 2022-09-02 22:44:43 -04:00
Trevor Buckner
99c2ff15a0 Merge pull request #2300 from G-Ambatte/addUserPageCollapse-#1797
[UserPage] Collapse Brew Groups
2022-09-02 22:33:27 -04:00
G.Ambatte
0b89a895e7 Merge branch 'master' into addSortTypeAndDirToURL-#2315 2022-09-03 13:28:28 +12:00
G.Ambatte
64740ba528 Merge branch 'master' into addBrewTagsToFilter-#2319 2022-09-03 13:28:05 +12:00
G.Ambatte
f35634a295 Merge branch 'master' into addTagsToBrewItem-#2317 2022-09-03 13:27:19 +12:00
G.Ambatte
9807e24e0a Add brewTags class to BrewItem tags 2022-09-03 12:58:45 +12:00
G.Ambatte
de43bd46a5 Merge branch 'master' into addUserPageCollapse-#1797 2022-09-03 12:49:49 +12:00
G.Ambatte
b9f64092b8 Remove unnecessary visible from UserPage 2022-09-03 12:48:04 +12:00
G.Ambatte
3f1bc02885 Reduce duplicate CSS
Co-authored-by: Trevor Buckner <calculuschild@gmail.com>
2022-09-03 09:58:17 +12:00
Trevor Buckner
407d3565cd Fix /new page "default" values not being read 2022-09-01 11:05:47 -04:00
G.Ambatte
2fcccfb48f Expand filtering functionality 2022-09-01 23:55:14 +12:00
G.Ambatte
3262751fea Add tags to UserPage BrewItem 2022-09-01 23:25:52 +12:00
G.Ambatte
80428fc412 Expand updateUrl function 2022-09-01 23:03:33 +12:00
G.Ambatte
66626b3427 Remove unnecessary visible from UserPage props 2022-09-01 20:06:30 +12:00
G.Ambatte
fc3a599f90 Merge branch 'addUserPageCollapse-#1797' of https://github.com/G-Ambatte/homebrewery into addUserPageCollapse-#1797 2022-09-01 19:18:04 +12:00
G.Ambatte
e355621bbf Load from local storage working without errors 2022-09-01 19:17:51 +12:00
G.Ambatte
9571cb0cc4 Initial pass at visibility functionality 2022-09-01 19:17:51 +12:00
Trevor Buckner
66a5f51927 Merge branch 'master' into SwappableThemes-ReorganizeFolderStructure 2022-08-31 23:57:46 -04:00
Trevor Buckner
98e2d57691 Update changelog for v3.2.1 2022-08-31 23:29:38 -04:00
Trevor Buckner
6038b90798 3.2.1 2022-08-31 23:12:36 -04:00
Trevor Buckner
0ca25c06f2 Update Marked-Extended-Tables to V1.0.5 2022-08-31 23:11:55 -04:00
Trevor Buckner
b85b3be1d1 Merge pull request #2291 from naturalcrit/dependabot/npm_and_yarn/jest-29.0.1
Bump jest from 28.1.3 to 29.0.1
2022-08-31 21:57:32 -04:00
Trevor Buckner
78b7e07d09 Merge pull request #2309 from naturalcrit/dependabot/npm_and_yarn/marked-4.1.0
Bump marked from 4.0.19 to 4.1.0
2022-08-31 19:51:54 -04:00
dependabot[bot]
cd3dcfce86 Bump marked from 4.0.19 to 4.1.0
Bumps [marked](https://github.com/markedjs/marked) from 4.0.19 to 4.1.0.
- [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.19...v4.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-31 15:12:51 +00:00
Trevor Buckner
0a0e57ad38 Merge pull request #2310 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.5.4
Bump mongoose from 6.5.3 to 6.5.4
2022-08-31 11:08:37 -04:00
Trevor Buckner
4c565657a9 Merge pull request #2313 from G-Ambatte/fixMissingSnippetButtons-#2311
[NewPage] Load from local storage in componentDidMount
2022-08-31 08:44:03 -04:00
Trevor Buckner
165a15e106 Update newPage.jsx 2022-08-31 08:43:18 -04:00
G.Ambatte
d27e07b620 Load from local storage in componentDidMount 2022-08-31 08:38:31 -04:00
Trevor Buckner
545ea8342e Merge pull request #2308 from jeddai/fix-new-print-page
add elvis to handle missing metaStorage
2022-08-31 08:26:37 -04:00
Trevor Buckner
0831c68e2d Merge pull request #2305 from G-Ambatte/userPage-removeAutofocus-#2121
[UserPage] Remove autofocus from filter textbox
2022-08-31 08:24:20 -04:00
Trevor Buckner
4ad674040d Merge pull request #2304 from G-Ambatte/userPage-fixSortContainerPosition-#2303
[UserPage] Fix sort container position when scroll bar absent
2022-08-31 08:22:05 -04:00
Trevor Buckner
052fd4132b Merge pull request #2302 from G-Ambatte/userPage-changeRenderer
[UserPage] Change UserPage CSS
2022-08-31 08:19:53 -04:00
dependabot[bot]
6c54c0a960 Bump mongoose from 6.5.3 to 6.5.4
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.5.3 to 6.5.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.5.3...6.5.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-31 03:02:06 +00:00
Trevor Buckner
17704e5010 Immediately save brew to localstorage upon page load 2022-08-30 22:50:04 -04:00
Charlie Humphreys
59451f47e6 add elvis to handle missing metaStorage 2022-08-30 19:20:32 -05:00
dependabot[bot]
f8ea556ed5 Bump jest from 28.1.3 to 29.0.1
Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 28.1.3 to 29.0.1.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v29.0.1/packages/jest)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-29 15:09:18 +00:00
Trevor Buckner
9a60d60b6d Merge pull request #2299 from naturalcrit/dependabot/npm_and_yarn/eslint-plugin-react-7.31.1
Bump eslint-plugin-react from 7.31.0 to 7.31.1
2022-08-29 11:06:50 -04:00
dependabot[bot]
4c50f60484 Bump eslint-plugin-react from 7.31.0 to 7.31.1
Bumps [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) from 7.31.0 to 7.31.1.
- [Release notes](https://github.com/jsx-eslint/eslint-plugin-react/releases)
- [Changelog](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jsx-eslint/eslint-plugin-react/compare/v7.31.0...v7.31.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>
2022-08-29 15:04:30 +00:00
Trevor Buckner
e6d034b163 Merge pull request #2298 from naturalcrit/dependabot/npm_and_yarn/eslint-8.23.0
Bump eslint from 8.22.0 to 8.23.0
2022-08-29 11:03:00 -04:00
G.Ambatte
7034da03ab Remove autofocus from filter textbox 2022-08-29 21:57:31 +12:00
G.Ambatte
289fcc531d Fix sort container position when scroll bar absent 2022-08-29 21:50:38 +12:00
G.Ambatte
4e5f86e8b6 Change UserPage CSS 2022-08-29 21:23:18 +12:00
G.Ambatte
a25c7a5ccd Load from local storage working without errors 2022-08-29 20:39:16 +12:00
dependabot[bot]
1fb0b694f6 Bump eslint from 8.22.0 to 8.23.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.22.0 to 8.23.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.22.0...v8.23.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-08-29 03:01:18 +00:00
G.Ambatte
f93d46d2b1 Merge branch 'addUserPageCollapse-#1797' of https://github.com/G-Ambatte/homebrewery into addUserPageCollapse-#1797 2022-08-29 10:12:56 +12:00
G.Ambatte
4bb5e96c42 Initial pass at visibility functionality 2022-08-29 10:12:40 +12:00
Trevor Buckner
0811da79c4 Merge pull request #2297 from jeddai/fix-query-params
update WithRoute to handle query params correctly
2022-08-28 15:00:39 -04:00
Charlie Humphreys
17c426cc91 update WithRoute to handle query params correctly 2022-08-28 12:40:56 -05:00
G.Ambatte
4b5b6e3b02 Initial pass at visibility functionality 2022-08-28 23:46:19 +12:00
Trevor Buckner
a383995522 Cleaning up some redundant styles in Journal Theme 2022-08-27 21:20:35 -04:00
Trevor Buckner
eb9d76655e Merge branch 'master' into SwappableThemes-ReorganizeFolderStructure 2022-08-27 18:24:35 -04:00
Trevor Buckner
e40dbf7935 Merge pull request #2292 from naturalcrit/v3.2.0
Up version to 3.2.0
2022-08-27 13:28:56 -04:00
Trevor Buckner
2ea853aeda Up version to 3.2.0 2022-08-27 13:28:31 -04:00
Trevor Buckner
215b64f5a6 Merge pull request #2287 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.5.3
Bump mongoose from 6.5.2 to 6.5.3
2022-08-27 13:05:57 -04:00
Trevor Buckner
239526f4ee Merge pull request #2286 from naturalcrit/dependabot/npm_and_yarn/eslint-plugin-react-7.31.0
Bump eslint-plugin-react from 7.30.1 to 7.31.0
2022-08-27 13:05:49 -04:00
Trevor Buckner
697d4d98bf Merge pull request #2285 from naturalcrit/dependabot/npm_and_yarn/babel/core-7.18.13
Bump @babel/core from 7.18.10 to 7.18.13
2022-08-27 13:05:37 -04:00
Trevor Buckner
87bc27544b Merge pull request #2290 from naturalcrit/MakeV3Default
Make V3 default setting in /new, and homepage
2022-08-27 13:05:26 -04:00
Trevor Buckner
1bbddacbf3 Merge pull request #2233 from jeddai/document-tags
Document tags
2022-08-27 13:05:09 -04:00
Trevor Buckner
cf2e6aa900 Update notificationPopup.jsx 2022-08-27 13:01:53 -04:00
Charlie Humphreys
6aa9eda5fb update if in stringArrayEditor.jsx componentDidUpdate 2022-08-27 00:52:44 -05:00
Trevor Buckner
3271eae4df Make V3 default setting in /new, and homepage 2022-08-27 01:51:30 -04:00
Charlie Humphreys
5227bbc1d4 add tag length limit, fix tag editing issues 2022-08-26 10:42:34 -05:00
dependabot[bot]
f3cdb0dfc2 Bump mongoose from 6.5.2 to 6.5.3
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.5.2 to 6.5.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.5.2...6.5.3)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-25 03:01:34 +00:00
dependabot[bot]
9a6d409800 Bump eslint-plugin-react from 7.30.1 to 7.31.0
Bumps [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) from 7.30.1 to 7.31.0.
- [Release notes](https://github.com/jsx-eslint/eslint-plugin-react/releases)
- [Changelog](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jsx-eslint/eslint-plugin-react/compare/v7.30.1...v7.31.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>
2022-08-25 03:01:07 +00:00
dependabot[bot]
7f343d4634 Bump @babel/core from 7.18.10 to 7.18.13
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.18.10 to 7.18.13.
- [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.18.13/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-08-23 03:01:18 +00:00
Trevor Buckner
ed933bdf92 Merge pull request #2273 from naturalcrit/dependabot/npm_and_yarn/babel/plugin-transform-runtime-7.18.10
Bump @babel/plugin-transform-runtime from 7.18.6 to 7.18.10
2022-08-22 21:34:43 -04:00
Trevor Buckner
1c4dac6a52 Merge pull request #2255 from naturalcrit/dependabot/npm_and_yarn/jest-28.1.3
Bump jest from 28.1.2 to 28.1.3
2022-08-22 21:34:29 -04:00
Trevor Buckner
f734b29a00 Merge pull request #2284 from naturalcrit/dependabot/npm_and_yarn/marked-4.0.19
Bump marked from 4.0.17 to 4.0.19
2022-08-22 21:33:32 -04:00
dependabot[bot]
889fcb84b2 Bump @babel/plugin-transform-runtime from 7.18.6 to 7.18.10
Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.18.6 to 7.18.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.18.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-08-23 01:33:29 +00:00
Trevor Buckner
fa4db2acfa Merge pull request #2279 from naturalcrit/dependabot/npm_and_yarn/eslint-8.22.0
Bump eslint from 8.19.0 to 8.22.0
2022-08-22 21:33:22 -04:00
Trevor Buckner
167e5c87ae Merge pull request #2283 from naturalcrit/dependabot/npm_and_yarn/googleapis-107.0.0
Bump googleapis from 105.0.0 to 107.0.0
2022-08-22 21:33:13 -04:00
Trevor Buckner
42db46fa33 Merge pull request #2276 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.5.2
Bump mongoose from 6.4.4 to 6.5.2
2022-08-22 21:32:51 -04:00
Trevor Buckner
257920d9db Merge pull request #2272 from naturalcrit/dependabot/npm_and_yarn/babel/preset-env-7.18.10
Bump @babel/preset-env from 7.18.6 to 7.18.10
2022-08-22 21:32:08 -04:00
Trevor Buckner
88a09415e5 Merge pull request #2271 from naturalcrit/dependabot/npm_and_yarn/babel/core-7.18.10
Bump @babel/core from 7.18.6 to 7.18.10
2022-08-22 21:31:56 -04:00
dependabot[bot]
a86f5232cc Bump marked from 4.0.17 to 4.0.19
Bumps [marked](https://github.com/markedjs/marked) from 4.0.17 to 4.0.19.
- [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.17...v4.0.19)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-22 03:01:12 +00:00
dependabot[bot]
4fa0d701c9 Bump googleapis from 105.0.0 to 107.0.0
Bumps [googleapis](https://github.com/googleapis/google-api-nodejs-client) from 105.0.0 to 107.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-v105.0.0...googleapis-v107.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-08-22 03:00:49 +00:00
Trevor Buckner
fc20d73520 Journal theme "complete"? 2022-08-21 00:03:29 -04:00
dependabot[bot]
2544563fea Bump eslint from 8.19.0 to 8.22.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.19.0 to 8.22.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.19.0...v8.22.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-08-15 03:01:04 +00:00
dependabot[bot]
65f943bc21 Bump mongoose from 6.4.4 to 6.5.2
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.4.4 to 6.5.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.4.4...6.5.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-10 03:01:14 +00:00
Trevor Buckner
fd64215298 Make blank theme load by default behind all themes 2022-08-07 00:37:47 -04:00
Trevor Buckner
9d05ee56a3 Further trim Blank theme. Use :where(.page)
where(.page) lowers specificity so styles can be overwritten by the user style tab without needing `.page`
2022-08-07 00:10:14 -04:00
Trevor Buckner
7ff478b542 Make reset.less have lower specificity 2022-08-07 00:08:58 -04:00
Trevor Buckner
aee0337d01 Trim down the "blank" style a lot. 2022-08-06 13:17:01 -04:00
Trevor Buckner
ddcf34c006 Reorder snippets 2022-08-06 12:09:14 -04:00
Charlie Humphreys
ae9eef4fba update location of tags type rewrite 2022-08-05 15:37:22 -05:00
Trevor Buckner
44dbb8f285 Fix merging again. 2022-08-04 22:49:52 -04:00
Trevor Buckner
58edf329f5 Remove basic print snippets from PHB theme 2022-08-04 22:32:04 -04:00
Trevor Buckner
0611c67651 Remove standard tables from PHB snippets 2022-08-04 22:23:28 -04:00
Trevor Buckner
3da2d094a0 Fix merging snippets with base snippets. 2022-08-04 22:20:29 -04:00
dependabot[bot]
539fb8365f Bump @babel/preset-env from 7.18.6 to 7.18.10
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.18.6 to 7.18.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.18.10/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-08-02 03:01:49 +00:00
dependabot[bot]
0e65685b8e Bump @babel/core from 7.18.6 to 7.18.10
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.18.6 to 7.18.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.18.10/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-08-02 03:01:18 +00:00
Trevor Buckner
993bcc2719 Start adding "Blank" theme 2022-07-30 00:28:15 -04:00
Trevor Buckner
947b2f5072 Start adding Journal theme, Add "snippetBase" property 2022-07-23 12:01:34 -04:00
Trevor Buckner
442c5e2d8a Merge branch 'master' into SwappableThemes-ReorganizeFolderStructure 2022-07-23 11:39:06 -04:00
dependabot[bot]
a3038868b9 Bump jest from 28.1.2 to 28.1.3
Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 28.1.2 to 28.1.3.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v28.1.3/packages/jest)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-14 03:01:19 +00:00
Trevor Buckner
80334a1649 Merge pull request #2252 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.4.4
Bump mongoose from 6.4.2 to 6.4.4
2022-07-08 14:19:16 -04:00
dependabot[bot]
3fe43a1f4d Bump mongoose from 6.4.2 to 6.4.4
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.4.2 to 6.4.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.4.2...6.4.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-08 17:45:19 +00:00
Trevor Buckner
b257b4c0fc Merge pull request #2251 from naturalcrit/dependabot/npm_and_yarn/moment-2.29.4
Bump moment from 2.29.3 to 2.29.4
2022-07-08 13:44:39 -04:00
dependabot[bot]
10cc040f16 Bump moment from 2.29.3 to 2.29.4
Bumps [moment](https://github.com/moment/moment) from 2.29.3 to 2.29.4.
- [Release notes](https://github.com/moment/moment/releases)
- [Changelog](https://github.com/moment/moment/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/moment/moment/compare/2.29.3...2.29.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-07 03:01:21 +00:00
Trevor Buckner
985f4abb45 Merge pull request #2232 from naturalcrit/dependabot/npm_and_yarn/eslint-plugin-react-7.30.1
Bump eslint-plugin-react from 7.30.0 to 7.30.1
2022-07-05 20:53:07 -04:00
Trevor Buckner
e20fa09170 Merge pull request #2239 from naturalcrit/dependabot/npm_and_yarn/babel/plugin-transform-runtime-7.18.6
Bump @babel/plugin-transform-runtime from 7.18.5 to 7.18.6
2022-07-05 20:52:59 -04:00
Trevor Buckner
b2a4054561 Merge pull request #2249 from naturalcrit/dependabot/npm_and_yarn/googleapis-105.0.0
Bump googleapis from 104.0.0 to 105.0.0
2022-07-05 20:52:44 -04:00
dependabot[bot]
23e378dcdf Bump googleapis from 104.0.0 to 105.0.0
Bumps [googleapis](https://github.com/googleapis/google-api-nodejs-client) from 104.0.0 to 105.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-v104.0.0...googleapis-v105.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-07-05 03:01:08 +00:00
dependabot[bot]
6d6c9ab102 Bump @babel/plugin-transform-runtime from 7.18.5 to 7.18.6
Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.18.5 to 7.18.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.18.6/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-07-04 05:47:05 +00:00
dependabot[bot]
3f191d5b47 Bump eslint-plugin-react from 7.30.0 to 7.30.1
Bumps [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) from 7.30.0 to 7.30.1.
- [Release notes](https://github.com/jsx-eslint/eslint-plugin-react/releases)
- [Changelog](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jsx-eslint/eslint-plugin-react/compare/v7.30.0...v7.30.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>
2022-07-04 05:46:21 +00:00
Trevor Buckner
5362cc90f4 Merge pull request #2237 from naturalcrit/dependabot/npm_and_yarn/babel/preset-env-7.18.6
Bump @babel/preset-env from 7.18.2 to 7.18.6
2022-07-04 01:46:00 -04:00
Trevor Buckner
66ae4dc67d Merge pull request #2246 from naturalcrit/dependabot/npm_and_yarn/eslint-8.19.0
Bump eslint from 8.18.0 to 8.19.0
2022-07-04 01:45:52 -04:00
Trevor Buckner
7d8890a61a Merge pull request #2247 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.4.2
Bump mongoose from 6.4.1 to 6.4.2
2022-07-04 01:45:45 -04:00
Trevor Buckner
0697673382 Merge pull request #2248 from naturalcrit/dependabot/npm_and_yarn/supertest-6.2.4
Bump supertest from 6.2.3 to 6.2.4
2022-07-04 01:45:38 -04:00
dependabot[bot]
1646fa14e6 Bump supertest from 6.2.3 to 6.2.4
Bumps [supertest](https://github.com/visionmedia/supertest) from 6.2.3 to 6.2.4.
- [Release notes](https://github.com/visionmedia/supertest/releases)
- [Commits](https://github.com/visionmedia/supertest/compare/v6.2.3...v6.2.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-04 03:02:11 +00:00
dependabot[bot]
2f104712ed Bump mongoose from 6.4.1 to 6.4.2
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.4.1 to 6.4.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.4.1...6.4.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-04 03:01:58 +00:00
dependabot[bot]
c23ba26171 Bump eslint from 8.18.0 to 8.19.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.18.0 to 8.19.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.18.0...v8.19.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-07-04 03:01:30 +00:00
dependabot[bot]
fa59f8b156 Bump @babel/preset-env from 7.18.2 to 7.18.6
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.18.2 to 7.18.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.18.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>
2022-07-02 14:20:49 +00:00
Trevor Buckner
bc66ad0221 Merge pull request #2238 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.4.1
Bump mongoose from 6.4.0 to 6.4.1
2022-07-02 10:19:31 -04:00
Trevor Buckner
08c52e4bac Merge pull request #2240 from naturalcrit/dependabot/npm_and_yarn/babel/core-7.18.6
Bump @babel/core from 7.18.5 to 7.18.6
2022-07-02 10:19:13 -04:00
Trevor Buckner
0741066554 Merge pull request #2241 from naturalcrit/dependabot/npm_and_yarn/babel/preset-react-7.18.6
Bump @babel/preset-react from 7.17.12 to 7.18.6
2022-07-02 10:19:05 -04:00
Trevor Buckner
24458ad2af Merge pull request #2242 from naturalcrit/dependabot/npm_and_yarn/jest-28.1.2
Bump jest from 28.1.1 to 28.1.2
2022-07-02 10:18:57 -04:00
dependabot[bot]
e38975177f Bump jest from 28.1.1 to 28.1.2
Bumps [jest](https://github.com/facebook/jest/tree/HEAD/packages/jest) from 28.1.1 to 28.1.2.
- [Release notes](https://github.com/facebook/jest/releases)
- [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md)
- [Commits](https://github.com/facebook/jest/commits/v28.1.2/packages/jest)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-30 03:01:28 +00:00
dependabot[bot]
abebe1b3a0 Bump @babel/preset-react from 7.17.12 to 7.18.6
Bumps [@babel/preset-react](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-react) from 7.17.12 to 7.18.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.18.6/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>
2022-06-28 03:02:41 +00:00
dependabot[bot]
ae8942d989 Bump @babel/core from 7.18.5 to 7.18.6
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.18.5 to 7.18.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.18.6/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-06-28 03:02:03 +00:00
dependabot[bot]
3cded29729 Bump mongoose from 6.4.0 to 6.4.1
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.4.0 to 6.4.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.4.0...6.4.1)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-28 03:01:32 +00:00
Charlie Humphreys
c7cfa86205 remove migration in favor of as-edited approach 2022-06-25 00:43:47 -05:00
Charlie Humphreys
8ee832e633 add MIGRATE environment variable 2022-06-25 00:00:41 -05:00
Charlie Humphreys
c7d5d6800b add close button for string array edit input, update styles 2022-06-24 23:48:32 -05:00
Charlie Humphreys
e963672b65 update tag setup to be based on the latest version of the stringArrayEditor.jsx 2022-06-24 23:31:20 -05:00
Charlie Humphreys
1965218e74 Merge branch 'master' into document-tags
# Conflicts:
#	client/homebrew/editor/metadataEditor/metadataEditor.jsx
#	server/homebrew.api.js
2022-06-24 22:55:35 -05:00
Trevor Buckner
3649099d00 Merge pull request #2229 from naturalcrit/dependabot/npm_and_yarn/googleapis-104.0.0
Bump googleapis from 103.0.0 to 104.0.0
2022-06-22 00:24:28 -04:00
Trevor Buckner
5d7a46abfe Merge pull request #2228 from naturalcrit/dependabot/npm_and_yarn/codemirror-5.65.6
Bump codemirror from 5.65.5 to 5.65.6
2022-06-22 00:24:14 -04:00
dependabot[bot]
209f0ec32a Bump codemirror from 5.65.5 to 5.65.6
Bumps [codemirror](https://github.com/codemirror/CodeMirror) from 5.65.5 to 5.65.6.
- [Release notes](https://github.com/codemirror/CodeMirror/releases)
- [Changelog](https://github.com/codemirror/codemirror5/blob/5.65.6/CHANGELOG.md)
- [Commits](https://github.com/codemirror/CodeMirror/compare/5.65.5...5.65.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-22 04:21:42 +00:00
dependabot[bot]
b336a6b6a3 Bump googleapis from 103.0.0 to 104.0.0
Bumps [googleapis](https://github.com/googleapis/google-api-nodejs-client) from 103.0.0 to 104.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-v103.0.0...googleapis-v104.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-06-22 04:21:26 +00:00
Trevor Buckner
32833459e4 Merge pull request #2230 from naturalcrit/dependabot/npm_and_yarn/shell-quote-1.7.3
Bump shell-quote from 1.7.2 to 1.7.3
2022-06-22 00:20:18 -04:00
dependabot[bot]
0e450f724b Bump shell-quote from 1.7.2 to 1.7.3
Bumps [shell-quote](https://github.com/substack/node-shell-quote) from 1.7.2 to 1.7.3.
- [Release notes](https://github.com/substack/node-shell-quote/releases)
- [Changelog](https://github.com/substack/node-shell-quote/blob/master/CHANGELOG.md)
- [Commits](https://github.com/substack/node-shell-quote/compare/v1.7.2...1.7.3)

---
updated-dependencies:
- dependency-name: shell-quote
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-22 04:18:40 +00:00
Trevor Buckner
5f5ff0023b Merge branch 'master' into SwappableThemes-ReorganizeFolderStructure 2022-06-21 16:07:00 -04:00
Trevor Buckner
1e1a3d891a Change let to const 2022-06-21 15:59:28 -04:00
Trevor Buckner
2e27e9f8f6 Update styles/snippets to match current master 2022-06-21 15:53:24 -04:00
Trevor Buckner
c4ee39461e Merge pull request #2223 from jlgraves/master
Implements issue #2215 - spell-casting ability
2022-06-21 15:40:54 -04:00
Trevor Buckner
586ff67fa0 Small tweaks 2022-06-21 15:38:20 -04:00
jlgraves
dbbc529a57 Merge branch 'master' into master 2022-06-20 15:34:00 -07:00
jlgraves
a4c80f2bbf added review changes requested
- correctly centred the legacy snippet
- fixed a couple small typos in both files
2022-06-20 15:33:51 -07:00
Trevor Buckner
a76715d2b3 Merge pull request #2224 from jeddai/update-react-router-dom
react-router-dom 5->6 upgrade
2022-06-20 17:27:19 -04:00
Trevor Buckner
9073435ff3 Update package-lock.json 2022-06-20 17:26:52 -04:00
Trevor Buckner
802e798492 Merge branch 'master' into update-react-router-dom 2022-06-20 17:24:59 -04:00
Charlie Humphreys
c0405fae08 add catch-all route 2022-06-20 13:19:43 -05:00
Charlie Humphreys
755b9dcc89 update based on feedback, remove query-string dependency, add/move favicon url 2022-06-20 12:53:26 -05:00
Trevor Buckner
038d0c5b68 Merge pull request #1699 from naturalcrit/v3ClassTableTweaks
Allow wide classTables to bleed into top margin
2022-06-20 11:36:38 -04:00
Trevor Buckner
5ac65245b7 Merge pull request #2226 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.4.0
Bump mongoose from 6.3.8 to 6.4.0
2022-06-19 23:12:53 -04:00
Trevor Buckner
06cbcb047b Merge pull request #2225 from naturalcrit/dependabot/npm_and_yarn/eslint-8.18.0
Bump eslint from 8.17.0 to 8.18.0
2022-06-19 23:12:45 -04:00
dependabot[bot]
60811a3295 Bump mongoose from 6.3.8 to 6.4.0
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.3.8 to 6.4.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.3.8...6.4.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-06-20 03:01:19 +00:00
dependabot[bot]
5ca2899b54 Bump eslint from 8.17.0 to 8.18.0
Bumps [eslint](https://github.com/eslint/eslint) from 8.17.0 to 8.18.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.17.0...v8.18.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-06-20 03:00:52 +00:00
Charlie Humphreys
60a372de68 update react-router-dom to 6.3.0, add WithRoute function component wrapper 2022-06-18 16:20:51 -05:00
jlgraves
01c16b4a1c Updating legacy class feature
Separated into two commits - one for new, one for legacy
2022-06-18 12:26:07 -07:00
jlgraves
2ebfd19169 Adding in spell-casting ability
Re issue #2215 added spellcasting ability modifier
2022-06-18 11:30:35 -07:00
Trevor Buckner
f7d8c6434f Small tweaks 2022-06-16 22:41:04 -04:00
Trevor Buckner
936fdff871 Update CSS, Shrink vertical border margins slightly 2022-06-16 22:13:52 -04:00
Trevor Buckner
da3460f3bf Merge branch 'master' into v3ClassTableTweaks 2022-06-16 22:08:01 -04:00
Trevor Buckner
8ea58d22ba Merge pull request #2218 from naturalcrit/dependabot/npm_and_yarn/babel/core-7.18.5
Bump @babel/core from 7.18.2 to 7.18.5
2022-06-16 15:31:18 -04:00
dependabot[bot]
4f9ac9cad0 Bump @babel/core from 7.18.2 to 7.18.5
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.18.2 to 7.18.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.18.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>
2022-06-16 03:47:29 +00:00
Trevor Buckner
7dafd3ee77 Merge pull request #2217 from naturalcrit/dependabot/npm_and_yarn/marked-4.0.17
Bump marked from 4.0.16 to 4.0.17
2022-06-15 23:47:06 -04:00
Trevor Buckner
4e403dd0e9 Merge pull request #2220 from naturalcrit/dependabot/npm_and_yarn/babel/plugin-transform-runtime-7.18.5
Bump @babel/plugin-transform-runtime from 7.18.2 to 7.18.5
2022-06-15 23:46:46 -04:00
dependabot[bot]
530d1bee8d Bump marked from 4.0.16 to 4.0.17
Bumps [marked](https://github.com/markedjs/marked) from 4.0.16 to 4.0.17.
- [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.16...v4.0.17)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-16 03:45:26 +00:00
Trevor Buckner
e8c7bcfee9 Merge pull request #2219 from naturalcrit/dependabot/npm_and_yarn/mongoose-6.3.8
Bump mongoose from 6.3.6 to 6.3.8
2022-06-15 23:44:14 -04:00
Trevor Buckner
6ed12f41f9 Merge pull request #2222 from naturalcrit/dependabot/npm_and_yarn/googleapis-103.0.0
Bump googleapis from 101.0.0 to 103.0.0
2022-06-15 23:44:07 -04:00
dependabot[bot]
a754959a7d Bump googleapis from 101.0.0 to 103.0.0
Bumps [googleapis](https://github.com/googleapis/google-api-nodejs-client) from 101.0.0 to 103.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-v101.0.0...googleapis-v103.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-06-16 03:01:32 +00:00
dependabot[bot]
d0334c69a2 Bump @babel/plugin-transform-runtime from 7.18.2 to 7.18.5
Bumps [@babel/plugin-transform-runtime](https://github.com/babel/babel/tree/HEAD/packages/babel-plugin-transform-runtime) from 7.18.2 to 7.18.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.18.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>
2022-06-14 03:02:23 +00:00
dependabot[bot]
2063d12c42 Bump mongoose from 6.3.6 to 6.3.8
Bumps [mongoose](https://github.com/Automattic/mongoose) from 6.3.6 to 6.3.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.3.6...6.3.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-06-14 03:02:02 +00:00
Trevor Buckner
5601b932c8 Fix Clone to New broken with #2114 2022-06-09 01:09:18 -04:00
Trevor Buckner
204b379fcb Merge pull request #2114 from jeddai/google-document-stubs
Google Drive document stubs
2022-06-09 00:37:49 -04:00
Trevor Buckner
5f7abe2a8f Merge branch 'master' into pr/2114 2022-06-09 00:33:44 -04:00
Trevor Buckner
385a22f199 Merge pull request #2214 from naturalcrit/3.1.1
v3.1.1
2022-06-09 00:27:51 -04:00
Charlie Humphreys
890fbcc250 Merge branch 'master' into google-document-stubs 2022-06-06 15:04:24 +00:00
Charlie Humphreys
18ce232be9 Merge branch 'google-document-stubs' of https://github.com/jeddai/homebrewery into google-document-stubs 2022-06-06 15:01:10 +00:00
Charlie Humphreys
92b3f8252e fix data reuse and add field to projection 2022-06-06 14:59:40 +00:00
Trevor Buckner
45950cb8b4 Merge branch 'google-document-stubs' of https://github.com/jeddai/homebrewery into pr/2114 2022-05-28 23:10:53 -04:00
Trevor Buckner
f1f82abdb4 Merge branch 'master' into pr/2114 2022-05-28 23:10:14 -04:00
Charlie Humphreys
bade09c24c linting 2022-05-26 04:46:07 +00:00
Charlie Humphreys
b54b7e317e pre-filter brews list when finding google brews 2022-05-26 04:45:50 +00:00
Charlie Humphreys
627c52e845 Add comments and adjust google brew for loop 2022-05-26 04:40:33 +00:00
Charlie Humphreys
55c91217ab fix deletion, update urls 2022-05-25 03:03:43 +00:00
Charlie Humphreys
7691e4d24e Merge branch 'master' into google-document-stubs 2022-05-22 00:40:57 +00:00
Trevor Buckner
9ff5818a0d Remove redundant helper files for DMG snippets 2022-05-18 16:25:44 -04:00
Trevor Buckner
59d267dff8 Remove redundant snippets from DMG theme 2022-05-18 16:23:01 -04:00
Trevor Buckner
8153bf7952 Merge branch 'master' into SwappableThemes-ReorganizeFolderStructure 2022-05-18 16:21:20 -04:00
Trevor Buckner
7200889d8c Restore recent snippet changes from after this PR 2022-05-17 23:42:15 -04:00
Trevor Buckner
253db8304a Make dropdown close on clickoutside, not mouseout
Accomplished by adding an onClick event listener to the whole document and then closing if the click was not inside the dropdown.
2022-05-16 23:07:38 -04:00
Trevor Buckner
a17a9ac0a0 lint 2022-05-16 01:41:31 -04:00
Trevor Buckner
4f6555b522 Merge snippets between theme and basetheme
- Current theme has preference over the base theme
- Snippets with the same name are overwritten by the current theme.
- If the overwritten snippet has no `gen` property (or `gen` is falsy), it will remove the base Theme snippet.
- Snippets not overwritten will carry over from base Theme
- New snippets will be added on to base Theme
2022-05-16 01:40:40 -04:00
Trevor Buckner
4167026ca7 Point to new theme location for user page 2022-05-16 00:01:34 -04:00
Trevor Buckner
ef7b8f1ba4 Themes work on Print page 2022-05-15 23:48:23 -04:00
Trevor Buckner
ec57b209b6 Themes work on Share page 2022-05-15 23:36:07 -04:00
Trevor Buckner
1e64ca04d8 BaseTheme is a separate file; not duplicated inside child theme 2022-05-15 23:08:44 -04:00
Trevor Buckner
1f82dbe8ee Make DMG style use CSS variables 2022-05-15 22:45:59 -04:00
Charlie Humphreys
452aa1feaf lint 2022-05-14 04:19:54 +00:00
Charlie Humphreys
74d22a05d0 swap transferToGoogle to saveToGoogle in a spot I missed 2022-05-14 04:19:36 +00:00
Charlie Humphreys
ac905ddf3f add comments, update query params, adjust code based on feedback 2022-05-14 04:17:39 +00:00
Charlie Humphreys
ff885dc6c2 Merge branch 'master' into google-document-stubs 2022-05-11 23:35:31 -05:00
Charlie Humphreys
01441e0610 adjust code based on feedback 2022-05-11 23:34:48 -05:00
G.Ambatte
4f154922c0 Update client/homebrew/pages/accountPage/accountPage.jsx
Co-authored-by: Trevor Buckner <calculuschild@gmail.com>
2022-05-03 22:30:08 +12:00
G.Ambatte
2b1fe5d3fe Update client/homebrew/pages/accountPage/accountPage.jsx
Co-authored-by: Trevor Buckner <calculuschild@gmail.com>
2022-05-03 22:29:53 +12:00
G.Ambatte
03402e4342 Add Google icon
Co-authored-by: Trevor Buckner <calculuschild@gmail.com>
2022-05-03 22:29:33 +12:00
G.Ambatte
1d85eede43 Account information added 2022-05-03 11:38:24 +12:00
G.Ambatte
61f4456842 Styling updates. 2022-05-01 12:58:10 +12:00
G.Ambatte
c925e04f3c Remove unused require 2022-05-01 12:41:10 +12:00
G.Ambatte
00412a70e9 Remove test UI page, add initial Account page 2022-05-01 12:39:19 +12:00
G.Ambatte
0923c50218 Update UI page styling 2022-05-01 12:38:20 +12:00
G.Ambatte
fe536bc9df Initial pass at UI page and styling 2022-04-30 16:54:11 +12:00
G.Ambatte
e8937a285c Add UI route for testing 2022-04-30 16:53:30 +12:00
Trevor Buckner
96e704234c Convert LESS variables to CSS variables 2022-04-18 16:32:56 -04:00
Trevor Buckner
407528bd94 Don't embed base64 images
4+MB down to 17kb CSS file.

Images are only ~1.7MB. They were very bloated as base64
2022-04-18 16:32:35 -04:00
Trevor Buckner
5b107d4e62 Remove unneeded console log 2022-04-18 16:31:23 -04:00
Trevor Buckner
f71dc004c0 Themes list to use object instead of array. 2022-04-15 17:17:13 -04:00
Charlie Humphreys
2e145e7ff1 Merge branch 'master' into google-document-stubs 2022-04-15 00:23:51 -05:00
Charlie Humphreys
8a5e9aa1f6 update app to better handle google brew stubs 2022-04-15 00:22:51 -05:00
Charlie Humphreys
e7fe68d20c merge master into google-document-stubs 2022-04-14 23:31:07 -05:00
Charlie Humphreys
39d29abb19 update app to list stubbed google docs only once 2022-04-11 12:55:19 -05:00
Charlie Humphreys
4941dbb5bd add exclusions for stub props 2022-04-06 11:11:11 -05:00
Trevor Buckner
ff1f70afa8 Merge branch 'master' into SwappableThemes-ReorganizeFolderStructure 2022-04-02 13:50:18 -04:00
Charlie Humphreys
e5021259bb swap usage of delete on possible Mongoose object for setting the value to undefined 2022-03-30 23:34:39 -05:00
Charlie Humphreys
6791df7f75 Merge branch 'master' into google-document-stubs
# Conflicts:
#	server/homebrew.api.js
2022-03-30 23:26:41 -05:00
Charlie Humphreys
fa8d47400f update API and frontend for google drive document stubs 2022-03-30 23:23:45 -05:00
Trevor Buckner
45969127f5 Merge pull request #2070 from Gazook89/z-index-on-dropdown
add z-index to dropdown container.
2022-03-15 21:42:00 -04:00
Gazook89
f13c16bb4f add z-index to dropdown container.
also just format spacing on css rules
2022-03-13 20:40:41 -05:00
Trevor Buckner
438c7eabdc Merge pull request #2065 from Gazook89/Small-Changes-to-Theme-Swapper
Small changes to theme swapper
2022-03-13 01:40:38 -05:00
Trevor Buckner
e12579a2a2 Restore original image size, shift position to not cover text 2022-03-13 01:38:48 -05:00
Gazook89
a6ede58d8e set dropdown items to appear *over* subsequent items
change navdropdown items to position:absolute; so they appear *over* the next metadata items, rather than pushing them down when dropdown is open.
2022-03-11 23:16:08 -06:00
Gazook89
3a82e2a24b fix *suppdorted* typo 2022-03-11 23:11:27 -06:00
Gazook89
28d45b89e0 set mask-image blends to fixed points
fixed blend points allows for different sized metadata panel without inadvertently masking text.
2022-03-11 23:10:50 -06:00
Trevor Buckner
01087ca302 Add preview texture to dropdown options 2022-03-01 11:21:13 -05:00
Trevor Buckner
297365407b Fixed comment showing up on page 2022-03-01 09:30:56 -05:00
Trevor Buckner
8e0629062d Fully disable theme selection when in Legacy mode
Making Legacy a "theme" implies we will add more themes to Legacy, which we aren't planning to.
2022-03-01 00:34:19 -05:00
Trevor Buckner
da5ce35c3c Make themes work on /new 2022-02-11 00:32:05 -05:00
Trevor Buckner
96d9d323d1 Fix merge 2022-02-10 23:42:05 -05:00
Trevor Buckner
dd0112f749 Update to Master 2022-02-10 23:38:33 -05:00
Trevor Buckner
d35c5c2719 Merge branch 'master' into SwappableThemes-ReorganizeFolderStructure 2022-02-10 23:36:41 -05:00
Trevor Buckner
f84e2c316f DMG theme added 2022-01-21 00:27:52 -05:00
Trevor Buckner
65335162fc Merge branch 'master' into SwappableThemes-ReorganizeFolderStructure 2022-01-10 21:58:21 -05:00
Trevor Buckner
94157ec4d4 Theme switches on click 2022-01-09 23:19:03 -05:00
Trevor Buckner
87bb682836 Add dropdown selector (not clickable yet) 2022-01-09 22:35:53 -05:00
Trevor Buckner
9f12e2748d Swapping working. Splitting into separate JS bundles doesn't seem to work. 2022-01-02 23:54:48 -05:00
Trevor Buckner
714a425ae5 Split themes into folders by Renderer (Legacy, V3) 2021-12-30 01:21:34 -05:00
Trevor Buckner
183a8035dd Initial file restructuring 2021-12-29 16:42:25 -05:00
Charlie Humphreys
e2fe77ade7 Update tag keydown handler to allow tags that match a certain pattern
#758
2021-11-18 23:05:39 -06:00
Charlie Humphreys
19c13342c4 Add autoFocus functionality when editing tags and allow for multi-tag entry by comma separation
#758
2021-11-17 23:56:57 -06:00
Charlie Humphreys
330bf20d61 Update UI to support tags
#758
2021-11-17 22:26:25 -06:00
Charlie Humphreys
22f9efd58a Update API to support homebrew tags
#758
2021-11-17 22:22:33 -06:00
Trevor Buckner
4bebdfda79 Allow wide classTables to bleed into top margin 2021-09-18 00:37:21 -04:00
114 changed files with 18088 additions and 8721 deletions

View File

@@ -27,7 +27,7 @@ jobs:
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- node/install-npm
- run: sudo npm install -g npm@8.10.0
- node/install-packages:
app-dir: ~/homebrewery
cache-path: node_modules
@@ -55,13 +55,13 @@ jobs:
at: .
# run tests!
- run:
- run:
name: Test - Basic
command: npm run test:basic
- run:
- run:
name: Test - Mustache Spans
command: npm run test:mustache-span
- run:
- run:
name: Test - Routes
command: npm run test:route
@@ -71,4 +71,4 @@ workflows:
- build
- test:
requires:
- build
- build

7
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,7 @@
contact_links:
- name: /r/Homebrewery Subreddit
url: https://www.reddit.com/r/homebrewery
about: The Homebrewery community on Reddit!
- name: Discord of Many Things
url: https://discord.gg/domt
about: "Join the conversation in the #formatting channel on DoMT!"

View File

@@ -0,0 +1,17 @@
name: Feature Request
description: Have an idea to improve the Homebrewery? Let us know!
labels: ["feature request"]
body:
- type: markdown
attributes:
value: "We'd love to hear your idea! Please be sure to [search the current Issues](https://github.com/naturalcrit/homebrewery/issues) for any duplicate requests."
- type: textarea
id: user-request
attributes:
label: "Your idea:"
description: The best feature requests provide an explanation of the current issue and then an explanation of how it could be improved. Screenshots/images can be pasted right in as well!
validations:
required: true
- type: markdown
attributes:
value: "Please be sure to search for any close matches to your request in the GitHub Issues tracker before opening a new request, thanks!"

View File

@@ -0,0 +1,55 @@
name: General Issue
description: Report an issue unrelated to Saving
body:
- type: markdown
attributes:
value: Please include as much information as possible.
- type: dropdown
id: renderer
attributes:
label: Renderer
description: Which renderer does this issue occur on? If you are unsure, you can check the renderer in the Properties Editor (click the "i" in the Snippet Menu bar above the editor).
options:
- v3
- Legacy
- Both
validations:
required: true
- type: dropdown
id: browser
attributes:
label: Browser
description: Which browser were you using when the issue occurred?
options:
- Chrome
- Firefox
- Edge
- Safari
- other
validations:
required: true
- type: dropdown
id: operating-system
attributes:
label: Operating System
description: Which OS were you using when the issue occurred?
options:
- Windows
- MacOS
- Linux
- other
validations:
required: true
- type: textarea
id: user-description
attributes:
label: "What happened?"
description: Please include any steps you took leading up to the issue and if you can reproduce it. Let us know what you expected to happen, and what did happen.
validations:
required: true
- type: textarea
id: code
attributes:
label: Code
description: Paste in any relevant code snippet below.
render: gfm

26
.github/ISSUE_TEMPLATE/save_issue.yml vendored Normal file
View File

@@ -0,0 +1,26 @@
name: Saving Issue
description: Report an issue Saving
labels: ["Saving"]
body:
- type: markdown
attributes:
value: |
Woops, sorry there was an issue Saving. Please add any detail you can to this report and check back soon!
- type: textarea
id: error-code
attributes:
label: Error Code
render: shell
- type: textarea
id: user-description
attributes:
label: "Your description of what happened:"
validations:
required: true
- type: markdown
attributes:
value: |
Thanks for the report. Here are some steps that may help in the meantime:
1. Refreshing your Google credentials in Homebrewery by signing out, and back in (they expire after one year).
2. Waiting a few minutes and trying again - sometimes there is just a momentary blip in the server.
3. Check the Issues in Github or the /r/homebrewery subreddit to see if others are experiencing the same issue.

1
.gitignore vendored
View File

@@ -11,3 +11,4 @@ config/docker.*
todo.md
startDB.bat
startMViewer.bat
.vscode

View File

@@ -1,6 +1,7 @@
```css
h5 {
font-size: .35cm !important;
margin-top: 0.3cm;
}
.page ul ul {
@@ -14,6 +15,11 @@ h5 {
filter: brightness(1.1) drop-shadow(1px 2px 1px #222);
}
.taskList ul {
margin-bottom: 0px;
margin-top: 0px;
}
.taskList li input[checked] {
filter: sepia(100%) hue-rotate(60deg) saturate(3.5) contrast(4) brightness(1.1) drop-shadow(1px 2px 1px #222);
}
@@ -39,6 +45,197 @@ pre {
## changelog
For a full record of development, visit our [Github Page](https://github.com/naturalcrit/homebrewery).
### Monday 28/11/2022 - v3.4.0
{{taskList
##### G-Ambatte
* [x] Fix for Chrome v108 handling of page size
Fixes issues [#2445](https://github.com/naturalcrit/homebrewery/issues/2445), [#2516](https://github.com/naturalcrit/homebrewery/issues/2516)
* [x] New account page with some user info, at {{openSans **USERNAME {{fa,fa-user}} → ACCOUNT {{fa,fa-user}}**}}
Fixes issues [#2049](https://github.com/naturalcrit/homebrewery/issues/2049), [#2043](https://github.com/naturalcrit/homebrewery/issues/2043)
* [x] Fix "Published/Private Brews" buttons on userpage
Fixes issues [#2449](https://github.com/naturalcrit/homebrewery/issues/2449)
##### Gazook
* [x] Make autosave default on for new users
* [x] Added link to our FAQ at {{openSans **NEED HELP? {{fa,fa-question-circle}} → FAQ {{fa,fa-question-circle}}**}}
* [x] Fix curly blocks freezing with long property lists
Fixes issues [#2393](https://github.com/naturalcrit/homebrewery/issues/2393)
* [x] Items can now be removed from {{openSans **RECENT BREWS** {{fas,fa-history}} }}
Fixes issues [#1918](https://github.com/naturalcrit/homebrewery/issues/1918)
* [x] Curly injector syntax `{blue}` highlighting in editor
Fixes issues [#1670](https://github.com/naturalcrit/homebrewery/issues/1670)
}}
### Thursday 28/10/2022 - v3.3.1
{{taskList
##### Calculuschild
* [x] Fixes to several broken CSS styles from v3.3.0
Fixes issues [#2468](https://github.com/naturalcrit/homebrewery/issues/2468)
##### Jeddai
* [x] Reduce size of thumbnails on social media links
}}
### Friday 19/10/2022 - v3.3.0
{{taskList
##### Calculuschild
* [x] Fix for tables broken by Chrome v106
##### G-Ambatte:
* [x] Fix Table of Contents broken by Chrome v106
Fixes issues [#2437](https://github.com/naturalcrit/homebrewery/issues/2437)
* [x] Show brew thumbnails on user page
Fixes issues [#2331](https://github.com/naturalcrit/homebrewery/issues/2331)
* [x] Allow longer URLs for brew thumbnails
Fixes issues [#2351](https://github.com/naturalcrit/homebrewery/issues/2351)
* [x] Code no longer unfolds when inserting a snippet
Fixes issues [#2135](https://github.com/naturalcrit/homebrewery/issues/2135)
* [x] Fix brew settings being lost on first save
Fixes issues [#2427](https://github.com/naturalcrit/homebrewery/issues/2427)
}}
\column
{{taskList
##### Gazook:
* [x] Several updates to bug reporting and error popups
Fixes issues [#2376](https://github.com/naturalcrit/homebrewery/issues/2376)
* [x] Fixes to userpage search bar
Fixes issues [#1675](https://github.com/naturalcrit/homebrewery/issues/1675), [#2353](https://github.com/naturalcrit/homebrewery/issues/2353)
* [x] Renderer *(legacy / V3)* now shown next to page #
Fixes issues [#1928](https://github.com/naturalcrit/homebrewery/issues/1928)
* [x] Prevent text selection when moving divider bar
Fixes issues [#1632](https://github.com/naturalcrit/homebrewery/issues/1632)
* [x] Tweak Monster Stat Block coloring
Fixes issues [#2123](https://github.com/naturalcrit/homebrewery/issues/2123)
* [x] Added dropdown button to toggle autosave
Fixes issues [#1546](https://github.com/naturalcrit/homebrewery/issues/1546)
}}
### Friday 08/09/2022 - v3.2.2
{{taskList
##### Jeddai:
* [x] Fix brews not deleting from User page when removed from Google Drive externally.
Fixes issues: [#2325](https://github.com/naturalcrit/homebrewery/issues/2325)
##### G-Ambatte:
* [x] Brew Tags are now searchable on the User page
Fixes issues [#2317](https://github.com/naturalcrit/homebrewery/issues/2317), [#2319](https://github.com/naturalcrit/homebrewery/issues/2319), [#2334](https://github.com/naturalcrit/homebrewery/issues/2334)
* [x] Several tweaks to the User page
Fixes issues: [#1797](https://github.com/naturalcrit/homebrewery/issues/1797), [#2315](https://github.com/naturalcrit/homebrewery/issues/2315), [#2326](https://github.com/naturalcrit/homebrewery/issues/2326), [#2328](https://github.com/naturalcrit/homebrewery/issues/2328)
}}
### Wednesday 31/08/2022 - v3.2.1
{{taskList
##### Calculuschild
* [x] Reference Links should now work inside tables
Fixes issues: [#2307](https://github.com/naturalcrit/homebrewery/issues/2307)
##### Jeddai:
* [x] Fix printing from `/new` not working
Fixes issues: [#1789](https://github.com/naturalcrit/homebrewery/issues/1789), [#1806](https://github.com/naturalcrit/homebrewery/issues/1806)
* [x] Fix broken snippet buttons on `/new`
Fixes issues: [#2311](https://github.com/naturalcrit/homebrewery/issues/2311)
##### G-Ambatte:
* [x] Several small tweaks to the User page
Fixes issues: [#2301](https://github.com/naturalcrit/homebrewery/issues/2301), [#2303](https://github.com/naturalcrit/homebrewery/issues/2303), [#2121](https://github.com/naturalcrit/homebrewery/issues/2121)
}}
\page
### Saturday 27/08/2022 - v3.2.0
{{taskList
##### Calculuschild
* [x] The V3 renderer is now the default for new brews.
* [x] Small tweaks to the spacing around the `classTable` style
##### Jeddai:
* [x] Brew transfers between Homebrewery and Google Drive now keep the same share and edit links! Metadata is now also kept across transfers.
Fixes issues: [#1838](https://github.com/naturalcrit/homebrewery/issues/1838)
* [x] Brews can now be labeled with tags; these will be searchable on the My Brews page in a future update.
Fixes issues: [#758](https://github.com/naturalcrit/homebrewery/issues/758)
##### Jlgraves:
* [x] Small tweaks to the `ClassFeature` snippet
Fixes issues: [#2215](https://github.com/naturalcrit/homebrewery/issues/2215)
}}
### Thursday 09/06/2022 - v3.1.1
{{taskList

View File

@@ -1,3 +1,4 @@
/*eslint max-lines: ["warn", {"max": 300, "skipBlankLines": true, "skipComments": true}]*/
require('./brewRenderer.less');
const React = require('react');
const createClass = require('create-react-class');
@@ -13,6 +14,8 @@ const RenderWarnings = require('homebrewery/renderWarnings/renderWarnings.jsx');
const NotificationPopup = require('./notificationPopup/notificationPopup.jsx');
const Frame = require('react-frame-component').default;
const Themes = require('themes/themes.json');
const PAGE_HEIGHT = 1056;
const PPR_THRESHOLD = 50;
@@ -23,6 +26,7 @@ const BrewRenderer = createClass({
text : '',
style : '',
renderer : 'legacy',
theme : '5ePHB',
errors : []
};
},
@@ -105,7 +109,12 @@ const BrewRenderer = createClass({
renderPageInfo : function(){
return <div className='pageInfo' ref='main'>
{this.state.viewablePageNumber + 1} / {this.state.pages.length}
<div>
{this.props.renderer}
</div>
<div>
{this.state.viewablePageNumber + 1} / {this.state.pages.length}
</div>
</div>;
},
@@ -113,7 +122,7 @@ const BrewRenderer = createClass({
if(!this.state.usePPR) return;
return <div className='ppr_msg'>
Partial Page Renderer enabled, because your brew is so large. May effect rendering.
Partial Page Renderer is enabled, because your brew is so large. May affect rendering.
</div>;
},
@@ -177,6 +186,9 @@ const BrewRenderer = createClass({
render : function(){
//render in iFrame so broken code doesn't crash the site.
//Also render dummy page while iframe is mounting.
const rendererPath = this.props.renderer == 'V3' ? 'V3' : 'Legacy';
const themePath = this.props.theme ?? '5ePHB';
const baseThemePath = Themes[rendererPath][themePath].baseTheme;
return (
<React.Fragment>
@@ -200,7 +212,11 @@ const BrewRenderer = createClass({
<RenderWarnings />
<NotificationPopup />
</div>
<link href={`${this.props.renderer == 'legacy' ? '/themes/5ePhbLegacy.style.css' : '/themes/5ePhb.style.css'}`} rel='stylesheet'/>
<link href={`/themes/${rendererPath}/Blank/style.css`} rel='stylesheet'/>
{baseThemePath &&
<link href={`/themes/${rendererPath}/${baseThemePath}/style.css`} rel='stylesheet'/>
}
<link href={`/themes/${rendererPath}/${themePath}/style.css`} rel='stylesheet'/>
{/* Apply CSS from Style tab and render pages from Markdown tab */}
{this.state.isMounted
&&

View File

@@ -21,11 +21,17 @@
right : 17px;
bottom : 0;
z-index : 1000;
padding : 8px 10px;
background-color : #333;
font-size : 10px;
font-weight : 800;
color : white;
div {
display: inline-block;
padding : 8px 10px;
&:not(:last-child){
border-right: 1px solid #666;
}
}
}
.ppr_msg{
position : absolute;

View File

@@ -4,7 +4,7 @@ const createClass = require('create-react-class');
const _ = require('lodash');
const cx = require('classnames'); //Unused variable
const DISMISS_KEY = 'dismiss_notification09-9-21';
const DISMISS_KEY = 'dismiss_notification08-27-22';
const NotificationPopup = createClass({
displayName : 'NotificationPopup',
@@ -22,45 +22,45 @@ const NotificationPopup = createClass({
},
notifications : {
psa : function(){
return <li key='psa'>
<em>V3.0.0 Released!</em> <br />
After a long and bumpy road, we decided it was high time we finally release version 3 of the homebrewery into the wild. You can check out a
brief overview and see how to opt-in to the new features here:&nbsp;
<a target='_blank' href='https://homebrewery.naturalcrit.com/v3_preview'>V3 Welcome Page</a> and&nbsp;
<a target='_blank' href='https://homebrewery.naturalcrit.com/changelog'>the Changelog</a>.
<br /><br />
<em>BE WARNED:</em> As we continue to develop V3, expect small tweaks in the styling, fonts, and snippets; your brews may look slightly
different from day-to-day. All of your old documents will continue to work as normal; we are not touching them. If you don't want to deal
with the possibility of slight formatting changes, you may choose to stick with the Legacy renderer on any of your brews for as long as you like.
<br /><br />
With this in mind, if you still wish to try out V3, you can opt-in any of your brews to the the V3 renderer.
This will likely break much of your formatting as a lot of the Markdown code has been updated, and starting from scratch may be cleaner.
(Don't worry, you can always change the renderer back to Legacy for any brew at any time).
</li>;
},
refreshGoogle : function (){
return <li key='refreshGoogle'>
<em>Refresh your Google Drive Credentials!</em> <br />
Currently a lot of people are striking issues with their Google credentials expiring, which happens one year after the last sign in via
Google. This can cause errors when trying to save your brews. If this happens, simply visit the&nbsp;
<a target='_blank' href='https://www.naturalcrit.com/login'>
logout page
</a>
, sign out, and then sign back in "with Google" to refresh your credentials. See&nbsp;
<a target='_blank' href='https://github.com/naturalcrit/homebrewery/discussions/1580'>
this discussion on Github
</a> for more details.
</li>;
},
faq : function(){
return <li key='faq'>
<em>Protect your work! </em> <br />
If you opt not to use your Google Drive, keep in mind that we do not save a history of your projects. Please make frequent backups of your brews!&nbsp;
<a target='_blank' href='https://www.reddit.com/r/homebrewery/comments/adh6lh/faqs_psas_announcements/'>
See the FAQ
</a> to learn how to avoid losing your work!
</li>;
},
return (
<>
<li key='psa'>
<em>V3.2.0 Released!</em> <br />
We are happy to announce that after nearly a year of use by our many users,
we are making the V3 render mode the default setting for all new brews.
This mode has become quite popular, and has proven to be stable and powerful.
Of course, we will always keep the option to use the Legacy renderer for any
brew, which can still be accessed from the Properties menu.
</li>
<li key='stubs'>
<em>Change to Google Drive Storage!</em> <br />
We have made a change to the process of tranferring brews between Google
Drive and the Homebrewery storage. Starting now, any time a brew is
transferred, it will keep the same links instead of generating new ones!
We hope this change will help reduce issues where people "lost" their work
by trying to visit old links.
</li>
<li key='googleDriveFolder'>
<em>Don't delete your Homebrewery folder on Google Drive!</em> <br />
We have had several reports of users losing their brews, not realizing
that they had deleted the files on their Google Drive. If you have a Homebrewery folder
on your Google Drive with *.txt files inside, <em>do not delete it</em>!
We cannot help you recover files that you have deleted from your own
Google Drive.
</li>
<li key='faq'>
<em>Protect your work! </em> <br />
If you opt not to use your Google Drive, keep in mind that we do not save a history of your projects. Please make frequent backups of your brews!&nbsp;
<a target='_blank' href='https://www.reddit.com/r/homebrewery/comments/adh6lh/faqs_psas_announcements/'>
See the FAQ
</a> to learn how to avoid losing your work!
</li>
</>
);
}
},
checkNotifications : function(){
const hideDismiss = localStorage.getItem(DISMISS_KEY);

View File

@@ -19,11 +19,6 @@ const DEFAULT_STYLE_TEXT = dedent`
color: black;
}`;
const splice = function(str, index, inject){
return str.slice(0, index) + inject + str.slice(index);
};
const Editor = createClass({
displayName : 'Editor',
@@ -80,19 +75,7 @@ const Editor = createClass({
},
handleInject : function(injectText){
let text;
if(this.isText()) text = this.props.brew.text;
if(this.isStyle()) text = this.props.brew.style ?? DEFAULT_STYLE_TEXT;
const lines = text.split('\n');
const cursorPos = this.refs.codeEditor.getCursorPosition();
lines[cursorPos.line] = splice(lines[cursorPos.line], cursorPos.ch, injectText);
const injectLines = injectText.split('\n');
this.refs.codeEditor.setCursorPosition(cursorPos.line + injectLines.length, cursorPos.ch + injectLines[injectLines.length - 1].length);
if(this.isText()) this.props.onTextChange(lines.join('\n'));
if(this.isStyle()) this.props.onStyleChange(lines.join('\n'));
this.refs.codeEditor?.injectText(injectText, false);
},
handleViewChange : function(newView){
@@ -154,9 +137,17 @@ const Editor = createClass({
codeMirror.addLineClass(lineNumber, 'text', 'columnSplit');
}
// Highlight injectors {style}
if(line.includes('{') && line.includes('}')){
const regex = /(?<!{){(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1}/g;
let match;
while ((match = regex.exec(line)) != null) {
codeMirror.markText({ line: lineNumber, ch: match.index }, { line: lineNumber, ch: match.index + match[0].length }, { className: 'injection' });
}
}
// Highlight inline spans {{content}}
if(line.includes('{{') && line.includes('}}')){
const regex = /{{(?::(?:"[\w,\-()#%. ]*"|[\w\,\-()#%.]*)|[^"'{}\s])*\s*|}}/g;
const regex = /{{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1 *|}}/g;
let match;
let blockCount = 0;
while ((match = regex.exec(line)) != null) {
@@ -175,7 +166,7 @@ const Editor = createClass({
// Highlight block divs {{\n Content \n}}
let endCh = line.length+1;
const match = line.match(/^ *{{(?::(?:"[\w,\-()#%. ]*"|[\w\,\-()#%.]*)|[^"'{}\s])* *$|^ *}}$/);
const match = line.match(/^ *{{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1 *$|^ *}}$/);
if(match)
endCh = match.index+match[0].length;
codeMirror.markText({ line: lineNumber, ch: 0 }, { line: lineNumber, ch: endCh }, { className: 'block' });
@@ -327,6 +318,7 @@ const Editor = createClass({
onInject={this.handleInject}
showEditButtons={this.props.showEditButtons}
renderer={this.props.renderer}
theme={this.props.brew.theme}
undo={this.undo}
redo={this.redo}
historySize={this.historySize()} />

View File

@@ -29,6 +29,10 @@
font-weight : bold;
//font-style: italic;
}
.injection{
color : green;
font-weight : bold;
}
}
.brewJump{

View File

@@ -1,9 +1,15 @@
/* eslint-disable max-lines */
require('./metadataEditor.less');
const React = require('react');
const createClass = require('create-react-class');
const _ = require('lodash');
const cx = require('classnames');
const request = require('superagent');
const Nav = require('naturalcrit/nav/nav.jsx');
const StringArrayEditor = require('../stringArrayEditor/stringArrayEditor.jsx');
const Themes = require('themes/themes.json');
const validations = require('./validations.js')
const SYSTEMS = ['5e', '4e', '3.5e', 'Pathfinder'];
@@ -17,11 +23,13 @@ const MetadataEditor = createClass({
editId : null,
title : '',
description : '',
tags : '',
thumbnail : '',
tags : [],
published : false,
authors : [],
systems : [],
renderer : 'legacy'
renderer : 'legacy',
theme : '5ePHB'
},
onChange : ()=>{}
};
@@ -45,10 +53,30 @@ const MetadataEditor = createClass({
},
handleFieldChange : function(name, e){
this.props.onChange(_.merge({}, this.props.metadata, {
[name] : e.target.value
}));
e.persist();
// load validation rules, and check input value against them
const inputRules = validations[name] ?? [];
const validationErr = inputRules.map((rule)=>rule(e.target.value)).filter(Boolean);
// if no validation rules, save to props
if(validationErr.length === 0){
e.target.setCustomValidity('');
this.props.onChange({
...this.props.metadata,
[name] : e.target.value
});
} else {
// if validation issues, display built-in browser error popup with each error.
console.log(validationErr);
const errMessage = validationErr.map((err)=>{
return `- ${err}`;
}).join('\n');
e.target.setCustomValidity(errMessage);
e.target.reportValidity();
};
},
handleSystem : function(system, e){
if(e.target.checked){
this.props.metadata.systems.push(system);
@@ -57,16 +85,26 @@ const MetadataEditor = createClass({
}
this.props.onChange(this.props.metadata);
},
handleRenderer : function(renderer, e){
if(e.target.checked){
this.props.metadata.renderer = renderer;
if(renderer == 'legacy')
this.props.metadata.theme = '5ePHB';
}
this.props.onChange(this.props.metadata);
},
handlePublish : function(val){
this.props.onChange(_.merge({}, this.props.metadata, {
this.props.onChange({
...this.props.metadata,
published : val
}));
});
},
handleTheme : function(theme){
this.props.metadata.renderer = theme.renderer;
this.props.metadata.theme = theme.path;
this.props.onChange(this.props.metadata);
},
handleDelete : function(){
@@ -135,6 +173,45 @@ const MetadataEditor = createClass({
</div>;
},
renderThemeDropdown : function(){
if(!global.enable_themes) return;
const listThemes = (renderer)=>{
return _.map(_.values(Themes[renderer]), (theme)=>{
return <div className='item' key={''} onClick={()=>this.handleTheme(theme)} title={''}>
{`${theme.renderer} : ${theme.name}`}
<img src={`/themes/${theme.renderer}/${theme.path}/dropdownTexture.png`}/>
</div>;
});
};
const currentTheme = Themes[`${_.upperFirst(this.props.metadata.renderer)}`][this.props.metadata.theme];
let dropdown;
if(this.props.metadata.renderer == 'legacy') {
dropdown =
<Nav.dropdown className='disabled' trigger='disabled'>
<div>
{`Themes are not supported in the Legacy Renderer`} <i className='fas fa-caret-down'></i>
</div>
</Nav.dropdown>;
} else {
dropdown =
<Nav.dropdown trigger='click'>
<div>
{`${_.upperFirst(currentTheme.renderer)} : ${currentTheme.name}`} <i className='fas fa-caret-down'></i>
</div>
{/*listThemes('Legacy')*/}
{listThemes('V3')}
</Nav.dropdown>;
}
return <div className='field themes'>
<label>theme</label>
{dropdown}
</div>;
},
renderRenderOptions : function(){
if(!global.enable_v3) return;
@@ -161,8 +238,8 @@ const MetadataEditor = createClass({
V3
</label>
<a href='/v3_preview' target='_blank' rel='noopener noreferrer'>
Click here for a quick intro to V3!
<a href='/legacy' target='_blank' rel='noopener noreferrer'>
Click here to see the demo page for the old Legacy renderer!
</a>
</div>
</div>;
@@ -173,33 +250,35 @@ const MetadataEditor = createClass({
<div className='field title'>
<label>title</label>
<input type='text' className='value'
value={this.props.metadata.title}
defaultValue={this.props.metadata.title}
onChange={(e)=>this.handleFieldChange('title', e)} />
</div>
<div className='field description'>
<label>description</label>
<textarea value={this.props.metadata.description} className='value'
onChange={(e)=>this.handleFieldChange('description', e)} />
</div>
<div className='field thumbnail'>
<label>thumbnail</label>
<input type='text'
value={this.props.metadata.thumbnail}
placeholder='my.thumbnail.url'
className='value'
onChange={(e)=>this.handleFieldChange('thumbnail', e)} />
<button className='display' onClick={this.toggleThumbnailDisplay}>
<i className={`fas fa-caret-${this.state.showThumbnail ? 'right' : 'left'}`} />
</button>
<div className='field-group'>
<div className='field-column'>
<div className='field description'>
<label>description</label>
<textarea defaultValue={this.props.metadata.description} className='value'
onChange={(e)=>this.handleFieldChange('description', e)} />
</div>
<div className='field thumbnail'>
<label>thumbnail</label>
<input type='text'
defaultValue={this.props.metadata.thumbnail}
placeholder='https://my.thumbnail.url'
className='value'
onChange={(e)=>this.handleFieldChange('thumbnail', e)} />
<button className='display' onClick={this.toggleThumbnailDisplay}>
<i className={`fas fa-caret-${this.state.showThumbnail ? 'right' : 'left'}`} />
</button>
</div>
</div>
{this.renderThumbnail()}
</div>
{/*}
<div className='field tags'>
<label>tags</label>
<textarea value={this.props.metadata.tags}
onChange={(e)=>this.handleFieldChange('tags', e)} />
</div>
*/}
<StringArrayEditor label='tags' valuePatterns={[/^(?:(?:group|meta|system|type):)?[A-Za-z0-9][A-Za-z0-9 \/.\-]{0,40}$/]}
placeholder='add tag' unique={true}
values={this.props.metadata.tags}
onChange={(e)=>this.handleFieldChange('tags', e)}/>
{this.renderAuthors()}
@@ -210,6 +289,8 @@ const MetadataEditor = createClass({
</div>
</div>
{this.renderThemeDropdown()}
{this.renderRenderOptions()}
<div className='field publish'>

View File

@@ -1,3 +1,4 @@
@import 'naturalcrit/styles/colors.less';
.metadataEditor{
position : absolute;
@@ -6,23 +7,47 @@
width : 100%;
padding : 25px;
background-color : #999;
height : calc(100vh - 54px); // 54px is the height of the navbar + snippet bar. probably a better way to dynamic get this.
overflow-y : auto;
& > div {
margin-bottom: 10px;
}
.field-group {
display: flex;
width: 100%;
flex-wrap: wrap;
gap: 10px;
}
.field-column {
display: flex;
flex-direction: column;
flex: 5 0 200px;
gap: 10px;
}
.field{
display : flex;
width : 100%;
margin-bottom : 10px;
min-width : 200px;
&>label{
display : inline-block;
vertical-align : top;
width : 80px;
font-size : 0.7em;
font-size : 11px;
font-weight : 800;
line-height : 1.8em;
text-transform : uppercase;
flex : 0 0 auto;
}
&>.value{
flex : 1 1 auto;
min-width : 200px;
width : 50px;
&:invalid {
background : #ffb9b9;
}
}
input[type='text'], textarea {
border : 1px solid gray;
}
&.thumbnail{
height : 1.4em;
@@ -42,22 +67,32 @@
background-color: #777;
}
}
.thumbnail-preview{
position : relative;
width : 80px;
height : min-content;
border : 2px solid white;
margin-left : 5px;
max-height : 115px;
}
&.description {
flex: 1;
textarea.value {
resize : none;
height : auto;
font-family : 'Open Sans', sans-serif;
font-size : 0.8em;
}
}
}
.description.field textarea.value{
resize : none;
height : 5em;
font-family : 'Open Sans', sans-serif;
font-size : 0.8em;
.thumbnail-preview {
position: relative;
justify-self: center;
width: 80px;
height: min-content;
flex: 1 1;
max-height: 115px;
aspect-ratio: 1 / 1;
object-fit: contain;
background-color: #AAA;
}
.systems.field .value{
label{
vertical-align : middle;
@@ -108,4 +143,136 @@
font-size: 0.8em;
line-height : 1.5em;
}
.themes.field{
font-size : 13.33px;
.navDropdownContainer {
background-color : white;
width : 100%;
position : relative;
z-index : 500;
&.disabled {
font-style :italic;
font-style : italic;
background-color : darkgray;
color : dimgray;
}
&>div:first-child {
border : 2px solid rgb(118,118,118);
padding : 6px 3px;
background-color : inherit;
i {
float : right;
}
&:hover {
background-color : @blue;
color : white;
}
}
.navDropdown {
box-shadow : 0px 5px 10px rgba(0, 0, 0, 0.3);
position : absolute;
width : 100%;
.item {
padding : 3px 3px;
border-top : 1px solid rgb(118, 118, 118);
position : relative;
overflow : hidden;
background-color : white;
&:hover {
background-color : @blue;
color : white;
}
img {
mask-image : linear-gradient(90deg, transparent, black 20%);
-webkit-mask-image : linear-gradient(90deg, transparent, black 20%);
position : absolute;
left : ~"max(100px, 100% - 300px)";
top : 0px;
}
}
}
}
}
.field .list {
display: flex;
flex-wrap: wrap;
> * {
flex: 0 0 auto;
}
#groupedIcon {
#backgroundColors;
display: inline-block;
height: ~"calc(100% + 0.6em)";
position: relative;
top: -0.3em;
right: -0.3em;
cursor: pointer;
min-width: 20px;
text-align: center;
color: white;
i {
position: relative;
top: 50%;
transform: translateY(-50%);
}
&:not(:last-child) {
border-right: 1px solid black;
}
&:last-child {
border-radius: 0 0.5em 0.5em 0;
}
}
.badge {
background-color: #dddddd;
border-radius: .5em;
font-size: .9em;
margin: 2px;
padding: .3em;
.icon {
#groupedIcon
}
}
.input-group {
height: ~"calc(.9em + 4px + .6em)";
input {
border-radius: .5em 0 0 .5em;
}
input:last-child {
border-radius: .5em;
}
.value {
width: 7.5vw;
min-width: 75px;
height: 100%;
}
.invalid:focus {
background-color: pink;
}
.icon {
#groupedIcon;
height: 97%;
font-size: .8em;
right: 1px;
top: -.54em;
i {
font-size: 1.125em;
}
}
}
}
}

View File

@@ -0,0 +1,34 @@
module.exports = {
title : [
(value)=>{
return value?.length > 100 ? 'Max title length of 100 characters' : null;
}
],
description : [
(value)=>{
return value?.length > 500 ? 'Max description length of 500 characters.' : null;
}
],
thumbnail : [
(value)=>{
return value?.length > 256 ? 'Max URL length of 256 characters.' : null;
},
(value)=>{
if(value?.length == 0){return null;}
try {
Boolean(new URL(value));
return null;
} catch (e) {
return 'Must be a valid URL';
}
}
],
language : [
(value)=>{
return new RegExp(/[a-z]{2,3}(-.*)?/).test(value || '') === false ? 'Invalid language code.' : null;
}
]
};

View File

@@ -4,9 +4,16 @@ const createClass = require('create-react-class');
const _ = require('lodash');
const cx = require('classnames');
//Import all themes
const SnippetsLegacy = require('./snippetsLegacy/snippets.js');
const SnippetsV3 = require('./snippets/snippets.js');
const Themes = require('themes/themes.json');
const ThemeSnippets = {};
ThemeSnippets['Legacy_5ePHB'] = require('themes/Legacy/5ePHB/snippets.js');
ThemeSnippets['V3_5ePHB'] = require('themes/V3/5ePHB/snippets.js');
ThemeSnippets['V3_5eDMG'] = require('themes/V3/5eDMG/snippets.js');
ThemeSnippets['V3_Journal'] = require('themes/V3/Journal/snippets.js');
ThemeSnippets['V3_Blank'] = require('themes/V3/Blank/snippets.js');
const execute = function(val, brew){
if(_.isFunction(val)) return val(brew);
@@ -32,21 +39,63 @@ const Snippetbar = createClass({
getInitialState : function() {
return {
renderer : this.props.renderer
renderer : this.props.renderer,
snippets : []
};
},
componentDidMount : async function() {
const rendererPath = this.props.renderer == 'V3' ? 'V3' : 'Legacy';
const themePath = this.props.theme ?? '5ePHB';
let snippets = _.cloneDeep(ThemeSnippets[`${rendererPath}_${themePath}`]);
snippets = this.compileSnippets(rendererPath, themePath, snippets);
this.setState({
snippets : snippets
});
},
componentDidUpdate : async function(prevProps) {
if(prevProps.renderer != this.props.renderer || prevProps.theme != this.props.theme) {
const rendererPath = this.props.renderer == 'V3' ? 'V3' : 'Legacy';
const themePath = this.props.theme ?? '5ePHB';
let snippets = _.cloneDeep(ThemeSnippets[`${rendererPath}_${themePath}`]);
snippets = this.compileSnippets(rendererPath, themePath, snippets);
this.setState({
snippets : snippets
});
}
},
mergeCustomizer : function(valueA, valueB, key) {
if(key == 'snippets') {
const result = _.reverse(_.unionBy(_.reverse(valueB), _.reverse(valueA), 'name')); // Join snippets together, with preference for the current theme over the base theme
return _.filter(result, 'gen'); //Only keep snippets with a 'gen' property.
}
},
compileSnippets : function(rendererPath, themePath, snippets) {
let compiledSnippets = snippets;
const baseSnippetsPath = Themes[rendererPath][themePath].baseSnippets;
const objB = _.keyBy(compiledSnippets, 'groupName');
if(baseSnippetsPath) {
const objA = _.keyBy(_.cloneDeep(ThemeSnippets[`${rendererPath}_${baseSnippetsPath}`]), 'groupName');
compiledSnippets = _.values(_.mergeWith(objA, objB, this.mergeCustomizer));
compiledSnippets = this.compileSnippets(rendererPath, baseSnippetsPath, _.cloneDeep(compiledSnippets));
} else {
const objA = _.keyBy(_.cloneDeep(ThemeSnippets[`${rendererPath}_Blank`]), 'groupName');
compiledSnippets = _.values(_.mergeWith(objA, objB, this.mergeCustomizer));
}
return compiledSnippets;
},
handleSnippetClick : function(injectedText){
this.props.onInject(injectedText);
},
renderSnippetGroups : function(){
let snippets = [];
if(this.props.renderer === 'V3')
snippets = SnippetsV3.filter((snippetGroup)=>snippetGroup.view === this.props.view);
else
snippets = SnippetsLegacy.filter((snippetGroup)=>snippetGroup.view === this.props.view);
const snippets = this.state.snippets.filter((snippetGroup)=>snippetGroup.view === this.props.view);
return _.map(snippets, (snippetGroup)=>{
return <SnippetGroup

View File

@@ -0,0 +1,142 @@
const React = require('react');
const createClass = require('create-react-class');
const _ = require('lodash');
const StringArrayEditor = createClass({
displayName : 'StringArrayEditor',
getDefaultProps : function() {
return {
label : '',
values : [],
valuePatterns : null,
placeholder : '',
unique : false,
cannotEdit : [],
onChange : ()=>{}
};
},
getInitialState : function() {
return {
valueContext : !!this.props.values ? this.props.values.map((value)=>({
value,
editing : false
})) : [],
temporaryValue : '',
updateValue : ''
};
},
componentDidUpdate : function(prevProps) {
if(!_.eq(this.props.values, prevProps.values)) {
this.setState({
valueContext : this.props.values ? this.props.values.map((newValue)=>({
value : newValue,
editing : this.state.valueContext.find(({ value })=>value === newValue)?.editing || false
})) : []
});
}
},
handleChange : function(value) {
this.props.onChange({
target : {
value
}
});
},
addValue : function(value){
this.handleChange(_.uniq([...this.props.values, value]));
this.setState({
temporaryValue : ''
});
},
removeValue : function(index){
this.handleChange(this.props.values.filter((_, i)=>i !== index));
},
updateValue : function(value, index){
const valueContext = this.state.valueContext;
valueContext[index].value = value;
valueContext[index].editing = false;
this.handleChange(valueContext.map((context)=>context.value));
this.setState({ valueContext, updateValue: '' });
},
editValue : function(index){
if(!!this.props.cannotEdit && this.props.cannotEdit.includes(this.props.values[index])) {
return;
}
const valueContext = this.state.valueContext.map((context, i)=>{
context.editing = index === i;
return context;
});
this.setState({ valueContext, updateValue: this.props.values[index] });
},
valueIsValid : function(value, index) {
const values = _.clone(this.props.values);
if(index !== undefined) {
values.splice(index, 1);
}
const matchesPatterns = !this.props.valuePatterns || this.props.valuePatterns.some((pattern)=>!!(value || '').match(pattern));
const uniqueIfSet = !this.props.unique || !values.includes(value);
return matchesPatterns && uniqueIfSet;
},
handleValueInputKeyDown : function(event, index) {
if(event.key === 'Enter') {
if(this.valueIsValid(event.target.value, index)) {
if(index !== undefined) {
this.updateValue(event.target.value, index);
} else {
this.addValue(event.target.value);
}
}
} else if(event.key === 'Escape') {
this.closeEditInput(index);
}
},
closeEditInput : function(index) {
const valueContext = this.state.valueContext;
valueContext[index].editing = false;
this.setState({ valueContext, updateValue: '' });
},
render : function() {
const valueElements = Object.values(this.state.valueContext).map((context, i)=>context.editing
? <React.Fragment key={i}>
<div className='input-group'>
<input type='text' className={`value ${this.valueIsValid(this.state.updateValue, i) ? '' : 'invalid'}`} autoFocus placeholder={this.props.placeholder}
value={this.state.updateValue}
onKeyDown={(e)=>this.handleValueInputKeyDown(e, i)}
onChange={(e)=>this.setState({ updateValue: e.target.value })}/>
{<div className='icon steel' onClick={(e)=>{ e.stopPropagation(); this.closeEditInput(i); }}><i className='fa fa-undo fa-fw'/></div>}
{this.valueIsValid(this.state.updateValue, i) ? <div className='icon steel' onClick={(e)=>{ e.stopPropagation(); this.updateValue(this.state.updateValue, i); }}><i className='fa fa-check fa-fw'/></div> : null}
</div>
</React.Fragment>
: <div className='badge' key={i} onClick={()=>this.editValue(i)}>{context.value}
{!!this.props.cannotEdit && this.props.cannotEdit.includes(context.value) ? null : <div className='icon steel' onClick={(e)=>{ e.stopPropagation(); this.removeValue(i); }}><i className='fa fa-times fa-fw'/></div>}
</div>
);
return <div className='field values'>
<label>{this.props.label}</label>
<div className='list'>
{valueElements}
<div className='input-group'>
<input type='text' className={`value ${this.valueIsValid(this.state.temporaryValue) ? '' : 'invalid'}`} placeholder={this.props.placeholder}
value={this.state.temporaryValue}
onKeyDown={(e)=>this.handleValueInputKeyDown(e)}
onChange={(e)=>this.setState({ temporaryValue: e.target.value })}/>
{this.valueIsValid(this.state.temporaryValue) ? <div className='icon steel' onClick={(e)=>{ e.stopPropagation(); this.addValue(this.state.temporaryValue); }}><i className='fa fa-check fa-fw'/></div> : null}
</div>
</div>
</div>;
}
});
module.exports = StringArrayEditor;

View File

@@ -1,8 +1,8 @@
require('./homebrew.less');
const React = require('react');
const createClass = require('create-react-class');
const { StaticRouter:Router, Switch, Route } = require('react-router-dom');
const queryString = require('query-string');
const { StaticRouter:Router } = require('react-router-dom/server');
const { Route, Routes, useParams, useSearchParams } = require('react-router-dom');
const HomePage = require('./pages/homePage/homePage.jsx');
const EditPage = require('./pages/editPage/editPage.jsx');
@@ -11,6 +11,24 @@ const SharePage = require('./pages/sharePage/sharePage.jsx');
const NewPage = require('./pages/newPage/newPage.jsx');
//const ErrorPage = require('./pages/errorPage/errorPage.jsx');
const PrintPage = require('./pages/printPage/printPage.jsx');
const AccountPage = require('./pages/accountPage/accountPage.jsx');
const WithRoute = (props)=>{
const params = useParams();
const [searchParams] = useSearchParams();
const queryParams = {};
for (const [key, value] of searchParams?.entries() || []) {
queryParams[key] = value;
}
const Element = props.el;
const allProps = {
...props,
...params,
query : queryParams,
el : undefined
};
return <Element {...allProps} />;
};
const Homebrew = createClass({
displayName : 'Homebrewery',
@@ -37,6 +55,7 @@ const Homebrew = createClass({
global.account = this.props.account;
global.version = this.props.version;
global.enable_v3 = this.props.enable_v3;
global.enable_themes = this.props.enable_themes;
global.config = this.props.config;
return {};
@@ -46,19 +65,21 @@ const Homebrew = createClass({
return (
<Router location={this.props.url}>
<div className='homebrew'>
<Switch>
<Route path='/edit/:id' component={(routeProps)=><EditPage id={routeProps.match.params.id} brew={this.props.brew} />}/>
<Route path='/share/:id' component={(routeProps)=><SharePage id={routeProps.match.params.id} brew={this.props.brew} />}/>
<Route path='/new/:id' component={(routeProps)=><NewPage id={routeProps.match.params.id} brew={this.props.brew} />}/>
<Route path='/new' exact component={(routeProps)=><NewPage />}/>
<Route path='/user/:username' component={(routeProps)=><UserPage username={routeProps.match.params.username} brews={this.props.brews} 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='/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='/' component={()=><HomePage brew={this.props.brew} />}/>
</Switch>
<Routes>
<Route path='/edit/:id' element={<WithRoute el={EditPage} brew={this.props.brew} />} />
<Route path='/share/:id' element={<WithRoute el={SharePage} brew={this.props.brew} />} />
<Route path='/new/:id' element={<WithRoute el={NewPage} brew={this.props.brew} />} />
<Route path='/new' element={<WithRoute el={NewPage}/>} />
<Route path='/user/:username' element={<WithRoute el={UserPage} brews={this.props.brews} />} />
<Route path='/print/:id' element={<WithRoute el={PrintPage} brew={this.props.brew} />} />
<Route path='/print' element={<WithRoute el={PrintPage} />} />
<Route path='/changelog' element={<WithRoute el={SharePage} brew={this.props.brew} />} />
<Route path='/faq' element={<WithRoute el={SharePage} brew={this.props.brew} />} />
<Route path='/account' element={<WithRoute el={AccountPage} brew={this.props.brew} uiItems={this.props.brew.uiItems} />} />
<Route path='/legacy' element={<WithRoute el={HomePage} brew={this.props.brew} />} />
<Route path='/' element={<WithRoute el={HomePage} brew={this.props.brew} />} />
<Route path='/*' element={<WithRoute el={HomePage} brew={this.props.brew} />} />
</Routes>
</div>
</Router>
);

View File

@@ -6,10 +6,15 @@
height : 100%;
background-color : @steel;
flex-direction : column;
overflow-y : hidden;
.content{
position : relative;
height : calc(~"100% - 29px"); //Navbar height
flex : auto;
overflow-y : hidden;
}
&.listPage .content {
overflow-y : scroll;
}
}
}
}

View File

@@ -70,12 +70,20 @@ const Account = createClass({
{global.account.username}
</Nav.item>
<Nav.item
href={`/user/${global.account.username}`}
href={`/user/${encodeURI(global.account.username)}`}
color='yellow'
icon='fas fa-beer'
>
brews
</Nav.item>
<Nav.item
className='account'
color='orange'
icon='fas fa-user'
href='/account'
>
account
</Nav.item>
<Nav.item
className='logout'
color='red'

View File

@@ -12,14 +12,20 @@ module.exports = function(props){
</Nav.item>
<Nav.item color='red' icon='fas fa-fw fa-bug'
href={`https://www.reddit.com/r/homebrewery/submit?selftext=true&text=${encodeURIComponent(dedent`
**Browser(s)** :
**Operating System** :
**Legacy or v3 Renderer** :
**Issue** : `)}`}
- **Browser(s)** :
- **Operating System** :
- **Legacy or v3 Renderer** :
- **Issue** : `)}`}
newTab={true}
rel='noopener noreferrer'>
report issue
</Nav.item>
<Nav.item color='green' icon='fas fa-question-circle'
href='/faq'
newTab={true}
rel='noopener noreferrer'>
FAQ
</Nav.item>
<Nav.item color='blue' icon='fas fa-fw fa-file-import'
href='/migrate'
newTab={true}

View File

@@ -55,6 +55,18 @@
text-align : center;
text-transform : initial;
}
.save-menu {
.dropdown {
z-index: 1000;
}
.navItem i.fa-power-off {
color : red;
&.active {
color : rgb(0, 182, 52);
filter : drop-shadow(0 0 2px rgba(0, 182, 52, 0.765))
}
}
}
.patreon.navItem{
border-left : 1px solid #666;
border-right : 1px solid #666;
@@ -78,6 +90,8 @@
width : 100%;
overflow : hidden auto;
max-height : ~"calc(100vh - 28px)";
scrollbar-color : #666 #333;
scrollbar-width : thin;
h4{
display : block;
box-sizing : border-box;
@@ -91,7 +105,7 @@
&:nth-of-type(2){ background-color: darken(@purple, 30%); }
}
.item{
#backgroundColors;
#backgroundColorsHover;
.animate(background-color);
position : relative;
display : block;
@@ -101,8 +115,36 @@
color : white;
text-decoration : none;
border-top : 1px solid #888;
overflow : clip;
.clear{
display : none;
position : absolute;
top : 50%;
transform : translateY(-50%);
right : 0px;
width : 20px;
height : 100%;
background-color : #333;
opacity : 70%;
border-radius : 3px;
&:hover {
opacity : 100%;
}
i {
text-align : center;
font-size : 10px;
margin : 0;
height :100%;
width :100%;
}
}
&:hover{
background-color : @blue;
.clear{
display : grid;
place-content : center;
}
}
.title{
display : inline-block;

View File

@@ -119,6 +119,25 @@ const RecentItems = createClass({
});
},
removeItem : function(url, evt){
evt.preventDefault();
let edited = JSON.parse(localStorage.getItem(EDIT_KEY) || '[]');
let viewed = JSON.parse(localStorage.getItem(VIEW_KEY) || '[]');
edited = edited.filter((item)=>{ return (item.url !== url);});
viewed = viewed.filter((item)=>{ return (item.url !== url);});
localStorage.setItem(EDIT_KEY, JSON.stringify(edited));
localStorage.setItem(VIEW_KEY, JSON.stringify(viewed));
this.setState({
edit : edited,
view : viewed
});
},
renderDropdown : function(){
if(!this.state.showDropdown) return null;
@@ -127,6 +146,7 @@ const RecentItems = createClass({
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='time'>{Moment(brew.ts).fromNow()}</span>
<div className='clear' title='Remove from Recents' onClick={(e)=>{this.removeItem(`${brew.url}`, e);}}><i className='fas fa-times'></i></div>
</a>;
});
};

View File

@@ -0,0 +1,71 @@
const React = require('react');
const createClass = require('create-react-class');
const _ = require('lodash');
const cx = require('classnames');
const moment = require('moment');
const UIPage = require('../basePages/uiPage/uiPage.jsx');
const Nav = require('naturalcrit/nav/nav.jsx');
const Navbar = require('../../navbar/navbar.jsx');
const RecentNavItem = require('../../navbar/recent.navitem.jsx').both;
const Account = require('../../navbar/account.navitem.jsx');
const NewBrew = require('../../navbar/newbrew.navitem.jsx');
const HelpNavItem = require('../../navbar/help.navitem.jsx');
const NaturalCritIcon = require('naturalcrit/svg/naturalcrit.svg.jsx');
const AccountPage = createClass({
displayName : 'AccountPage',
getDefaultProps : function() {
return {
brew : {},
uiItems : {}
};
},
getInitialState : function() {
return {
uiItems : this.props.uiItems
};
},
renderNavItems : function() {
return <Navbar>
<Nav.section>
<NewBrew />
<HelpNavItem />
<RecentNavItem />
<Account />
</Nav.section>
</Navbar>;
},
renderUiItems : function() {
// console.log(this.props.uiItems);
return <>
<div className='dataGroup'>
<h1>Account Information <i className='fas fa-user'></i></h1>
<p><strong>Username: </strong> {this.props.uiItems.username || 'No user currently logged in'}</p>
<p><strong>Last Login: </strong> {moment(this.props.uiItems.issued).format('dddd, MMMM Do YYYY, h:mm:ss a ZZ') || '-'}</p>
</div>
<div className='dataGroup'>
<h3>Homebrewery Information <NaturalCritIcon /></h3>
<p><strong>Brews on Homebrewery: </strong> {this.props.uiItems.mongoCount || '-'}</p>
</div>
<div className='dataGroup'>
<h3>Google Information <i className='fab fa-google-drive'></i></h3>
<p><strong>Linked to Google: </strong> {this.props.uiItems.googleId ? 'YES' : 'NO'}</p>
{this.props.uiItems.googleId ? <p><strong>Brews on Google Drive: </strong> {this.props.uiItems.fileCount || '-'}</p> : '' }
</div>
</>;
},
render : function(){
return <UIPage brew={this.props.brew}>
{this.renderUiItems()}
</UIPage>;
}
});
module.exports = AccountPage;

View File

@@ -16,8 +16,8 @@ const BrewItem = createClass({
brew : {
title : '',
description : '',
authors : []
authors : [],
stubbed : true
}
};
},
@@ -50,7 +50,7 @@ const BrewItem = createClass({
if(!this.props.brew.editId) return;
let editLink = this.props.brew.editId;
if(this.props.brew.googleId) {
if(this.props.brew.googleId && !this.props.brew.stubbed) {
editLink = this.props.brew.googleId + editLink;
}
@@ -63,7 +63,7 @@ const BrewItem = createClass({
if(!this.props.brew.shareId) return;
let shareLink = this.props.brew.shareId;
if(this.props.brew.googleId) {
if(this.props.brew.googleId && !this.props.brew.stubbed) {
shareLink = this.props.brew.googleId + shareLink;
}
@@ -76,7 +76,7 @@ const BrewItem = createClass({
if(!this.props.brew.shareId) return;
let shareLink = this.props.brew.shareId;
if(this.props.brew.googleId) {
if(this.props.brew.googleId && !this.props.brew.stubbed) {
shareLink = this.props.brew.googleId + shareLink;
}
@@ -86,7 +86,7 @@ const BrewItem = createClass({
},
renderGoogleDriveIcon : function(){
if(!this.props.brew.gDrive) return;
if(!this.props.brew.googleId) return;
return <span>
<img className='googleDriveIcon' src={googleDriveIcon} alt='googleDriveIcon' />
@@ -95,17 +95,35 @@ const BrewItem = createClass({
render : function(){
const brew = this.props.brew;
if(Array.isArray(brew.tags)) { // temporary fix until dud tags are cleaned
brew.tags = brew.tags?.filter((tag)=>tag); //remove tags that are empty strings
}
const dateFormatString = 'YYYY-MM-DD HH:mm:ss';
return <div className='brewItem'>
{brew.thumbnail &&
<div className='thumbnail' style={{ backgroundImage: `url(${brew.thumbnail})` }} >
</div>
}
<div className='text'>
<h2>{brew.title}</h2>
<p className='description'>{brew.description}</p>
</div>
<hr />
<div className='info'>
<span title={`Authors:\n${brew.authors.join('\n')}`}>
<i className='fas fa-user'/> {brew.authors.join(', ')}
{brew.tags?.length ? <>
<div className='brewTags' title={`Tags:\n${brew.tags.join('\n')}`}>
<i className='fas fa-tags'/>
{brew.tags.map((tag, idx)=>{
const matches = tag.match(/^(?:([^:]+):)?([^:]+)$/);
return <span key={idx} className={matches[1]}>{matches[2]}</span>;
})}
</div>
</> : <></>
}
<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)}`}>

View File

@@ -10,7 +10,7 @@
min-height : 105px;
margin-right : 15px;
margin-bottom : 15px;
padding : 5px 15px 2px 8px;
padding : 5px 15px 2px 6px;
padding-right : 15px;
border : 1px solid #c9ad6a;
border-radius : 5px;
@@ -19,6 +19,20 @@
break-inside : avoid;
box-shadow : 0px 4px 5px 0px #333;
background-color : #cab2802e;
.thumbnail {
position: absolute;
width: 150px;
height: 100%;
top: 0;
right: 0;
z-index: -1;
background-size: contain;
background-repeat: no-repeat;
background-position: right top;
mask-image: linear-gradient(80deg, #0000 20%, #050 40%);
-webkit-mask-image: linear-gradient(80deg, #0000 20%, #050 40%);
opacity: 50%;
}
.text {
min-height : 54px;
h4{
@@ -29,13 +43,23 @@
.info{
position: initial;
bottom: 2px;
font-family : ScalySans;
font-family : ScalySansRemake;
font-size : 1.2em;
&>span{
margin-right : 12px;
line-height : 1.5em;
}
}
.brewTags span {
background-color: #c8ac6e3b;
margin: 2px;
padding: 2px;
border: 1px solid #c8ac6e;
border-radius: 4px;
white-space: nowrap;
display: inline-block;
font-weight: bold;
}
&:hover{
.links{
opacity : 1;

View File

@@ -1,3 +1,4 @@
/*eslint max-lines: ["warn", {"max": 300, "skipBlankLines": true, "skipComments": true}]*/
require('./listPage.less');
const React = require('react');
const createClass = require('create-react-class');
@@ -6,6 +7,11 @@ const moment = require('moment');
const BrewItem = require('./brewItem/brewItem.jsx');
const USERPAGE_KEY_PREFIX = 'HOMEBREWERY-LISTPAGE';
const DEFAULT_SORT_TYPE = 'alpha';
const DEFAULT_SORT_DIR = 'asc';
const ListPage = createClass({
displayName : 'ListPage',
getDefaultProps : function() {
@@ -21,14 +27,56 @@ const ListPage = createClass({
};
},
getInitialState : function() {
// HIDE ALL GROUPS UNTIL LOADED
const brewCollection = this.props.brewCollection.map((brewGroup)=>{
brewGroup.visible = false;
return brewGroup;
});
return {
sortType : 'alpha',
sortDir : 'asc',
filterString : this.props.query?.filter || '',
query : this.props.query
filterString : this.props.query?.filter || '',
sortType : this.props.query?.sort || null,
sortDir : this.props.query?.dir || null,
query : this.props.query,
brewCollection : brewCollection
};
},
componentDidMount : function() {
// SAVE TO LOCAL STORAGE WHEN LEAVING PAGE
window.onbeforeunload = this.saveToLocalStorage;
// LOAD FROM LOCAL STORAGE
if(typeof window !== 'undefined') {
const newSortType = (this.state.sortType ?? (localStorage.getItem(`${USERPAGE_KEY_PREFIX}-SORTTYPE`) || DEFAULT_SORT_TYPE));
const newSortDir = (this.state.sortDir ?? (localStorage.getItem(`${USERPAGE_KEY_PREFIX}-SORTDIR`) || DEFAULT_SORT_DIR));
this.updateUrl(this.state.filterString, newSortType, newSortDir);
const brewCollection = this.props.brewCollection.map((brewGroup)=>{
brewGroup.visible = (localStorage.getItem(`${USERPAGE_KEY_PREFIX}-VISIBILITY-${brewGroup.class}`) ?? 'true')=='true';
return brewGroup;
});
this.setState({
brewCollection : brewCollection,
sortType : newSortType,
sortDir : newSortDir
});
};
},
componentWillUnmount : function() {
window.onbeforeunload = function(){};
},
saveToLocalStorage : function() {
this.state.brewCollection.map((brewGroup)=>{
localStorage.setItem(`${USERPAGE_KEY_PREFIX}-VISIBILITY-${brewGroup.class}`, `${brewGroup.visible}`);
});
localStorage.setItem(`${USERPAGE_KEY_PREFIX}-SORTTYPE`, this.state.sortType);
localStorage.setItem(`${USERPAGE_KEY_PREFIX}-SORTDIR`, this.state.sortDir);
},
renderBrews : function(brews){
if(!brews || !brews.length) return <div className='noBrews'>No Brews.</div>;
@@ -50,124 +98,133 @@ const ListPage = createClass({
},
handleSortOptionChange : function(event){
this.updateUrl(this.state.filterString, event.target.value, this.state.sortDir);
this.setState({
sortType : event.target.value
});
},
handleSortDirChange : function(event){
const newDir = this.state.sortDir == 'asc' ? 'desc' : 'asc';
this.updateUrl(this.state.filterString, this.state.sortType, newDir);
this.setState({
sortDir : `${(this.state.sortDir == 'asc' ? 'desc' : 'asc')}`
sortDir : newDir
});
},
renderSortOption : function(sortTitle, sortValue){
return <td>
<button
value={`${sortValue}`}
onClick={this.handleSortOptionChange}
className={`${(this.state.sortType == sortValue ? 'active' : '')}`}
>
{`${sortTitle}`}
</button>
</td>;
return <div className={`sort-option ${(this.state.sortType == sortValue ? 'active' : '')}`}>
<button
value={`${sortValue}`}
onClick={this.state.sortType == sortValue ? this.handleSortDirChange : this.handleSortOptionChange}
>
{`${sortTitle}`}
</button>
{this.state.sortType == sortValue &&
<i className={`sortDir fas ${this.state.sortDir == 'asc' ? 'fa-sort-up' : 'fa-sort-down'}`}></i>
}
</div>;
},
handleFilterTextChange : function(e){
this.setState({
filterString : e.target.value,
});
this.updateUrl(e.target.value);
this.updateUrl(e.target.value, this.state.sortType, this.state.sortDir);
return;
},
updateUrl : function(filterTerm){
updateUrl : function(filterTerm, sortType, sortDir){
const url = new URL(window.location.href);
const urlParams = new URLSearchParams(url.search);
if(urlParams.get('filter') == filterTerm)
return;
urlParams.set('sort', sortType);
urlParams.set('dir', sortDir);
if(!filterTerm)
urlParams.delete('filter');
else
urlParams.set('filter', filterTerm);
url.search = urlParams;
window.history.replaceState(null, null, url);
},
renderFilterOption : function(){
return <td>
return <div className='filter-option'>
<label>
<i className='fas fa-search'></i>
<input
type='search'
autoFocus={true}
placeholder='filter title/description'
onChange={this.handleFilterTextChange}
value={this.state.filterString}
/>
</label>
</td>;
</div>;
},
renderSortOptions : function(){
return <div className='sort-container'>
<table>
<tbody>
<tr>
<td>
<h6>Sort by :</h6>
</td>
{this.renderSortOption('Title', 'alpha')}
{this.renderSortOption('Created Date', 'created')}
{this.renderSortOption('Updated Date', 'updated')}
{this.renderSortOption('Views', 'views')}
{/* {this.renderSortOption('Latest', 'latest')} */}
<td>
<h6>Direction :</h6>
</td>
<td>
<button
onClick={this.handleSortDirChange}
className='sortDir'
>
{`${(this.state.sortDir == 'asc' ? '\u25B2 ASC' : '\u25BC DESC')}`}
</button>
</td>
{this.renderFilterOption()}
</tr>
</tbody>
</table>
<h6>Sort by :</h6>
{this.renderSortOption('Title', 'alpha')}
{this.renderSortOption('Created Date', 'created')}
{this.renderSortOption('Updated Date', 'updated')}
{this.renderSortOption('Views', 'views')}
{/* {this.renderSortOption('Latest', 'latest')} */}
{this.renderFilterOption()}
</div>;
},
getSortedBrews : function(brews){
const testString = _.deburr(this.state.filterString).toLowerCase();
brews = _.filter(brews, (brew)=>{
return (_.deburr(brew.title).toLowerCase().includes(testString)) ||
(_.deburr(brew.description).toLowerCase().includes(testString));
});
brews = _.filter(brews, (brew)=>{
const brewStrings = _.deburr([
brew.title,
brew.description,
brew.tags].join('\n')
.toLowerCase());
return brewStrings.includes(testString);
});
return _.orderBy(brews, (brew)=>{ return this.sortBrewOrder(brew); }, this.state.sortDir);
},
toggleBrewCollectionState : function(brewGroupClass) {
this.setState((prevState)=>({
brewCollection : prevState.brewCollection.map(
(brewGroup)=>brewGroup.class === brewGroupClass ? { ...brewGroup, visible: !brewGroup.visible } : brewGroup
)
}));
},
renderBrewCollection : function(brewCollection){
if(brewCollection == []) return <div className='brewCollection'>
<h1>No Brews</h1>
</div>;
return _.map(brewCollection, (brewGroup, idx)=>{
return <div key={idx} className={`brewCollection ${brewGroup.class ?? ''}`}>
<h1>{brewGroup.title || 'No Title'}</h1>
{this.renderBrews(this.getSortedBrews(brewGroup.brews))}
<h1 className={brewGroup.visible ? 'active' : 'inactive'} onClick={()=>{this.toggleBrewCollectionState(brewGroup.class);}}>{brewGroup.title || 'No Title'}</h1>
{brewGroup.visible ? this.renderBrews(this.getSortedBrews(brewGroup.brews)) : <></>}
</div>;
});
},
render : function(){
return <div className='listPage sitePage'>
<link href='/themes/5ePhbLegacy.style.css' rel='stylesheet'/>
<link href='/themes/V3/5ePHB/style.css' rel='stylesheet'/>
{this.props.navItems}
{this.renderSortOptions()}
<div className='content V3'>
<div className='phb'>
{this.renderSortOptions()}
{this.renderBrewCollection(this.props.brewCollection)}
<div className='phb page'>
{this.renderBrewCollection(this.state.brewCollection)}
</div>
</div>
</div>;

View File

@@ -13,7 +13,6 @@
}
.listPage{
.content{
overflow-y : scroll;
.phb{
.noColumns();
height : auto;
@@ -27,51 +26,101 @@
font-size : 1.3em;
font-style : italic;
}
.brewCollection {
h1:hover{
cursor: pointer;
}
.active::before, .inactive::before {
font-family: 'Font Awesome 5 Free';
font-weight: 900;
font-size: 0.6cm;
padding-right: 0.5em;
}
.active {
color: var(--HB_Color_HeaderText);
}
.active::before {
content: '\f107';
}
.inactive {
color: #707070;
}
.inactive::before {
content: '\f105';
}
}
}
}
.sort-container{
font-family : 'Open Sans', sans-serif;
position : fixed;
top : 35px;
left : calc(50vw - 408px);
border : 2px solid #58180D;
width : 800px;
background-color : #EEE5CE;
padding : 2px;
position : sticky;
top : 0;
left : 0;
width : 100%;
height : 30px;
background-color : #555;
border-top : 1px solid #666;
border-bottom : 1px solid #666;
color : white;
text-align : center;
z-index : 15;
z-index : 500;
display : flex;
justify-content : center;
align-items : baseline;
column-gap : 15px;
row-gap : 5px;
flex-wrap : wrap;
h6{
text-transform : uppercase;
font-family : 'Open Sans', sans-serif;
font-size : 11px;
font-weight : bold;
color : #58180D;
}
table{
margin : 0px;
vertical-align : middle;
tbody tr{
background-color: transparent !important;
i{
padding-right : 5px
}
button{
background-color : transparent;
color : #58180D;
font-family : 'Open Sans', sans-serif;
font-size : 11px;
text-transform : uppercase;
font-weight : normal;
&.active{
font-weight : bold;
border : 2px solid #58180D;
}
&.sortDir{
width : 75px;
}
.sort-option {
display: flex;
align-items: center;
padding: 0 8px;
color: #ccc;
height: 100%;
&:hover{
background-color : #444;
}
&.active {
font-weight: bold;
color: #ddd;
background-color: #333;
button {
color: white;
font-weight: 800;
height: 100%;
& + .sortDir {
padding-left: 5px;
}
}
}
}
.filter-option {
margin-left: 20px;
background-color : transparent !important;
font-size : 11px;
i{
padding-right : 5px;
}
}
button{
background-color : transparent;
font-family : 'Open Sans', sans-serif;
text-transform : uppercase;
font-weight : normal;
font-size : 11px;
color : #ccc;
padding : 0;
}
}
}

View File

@@ -0,0 +1,38 @@
require('./uiPage.less');
const React = require('react');
const createClass = require('create-react-class');
const Nav = require('naturalcrit/nav/nav.jsx');
const Navbar = require('../../../navbar/navbar.jsx');
const NewBrewItem = require('../../../navbar/newbrew.navitem.jsx');
const HelpNavItem = require('../../../navbar/help.navitem.jsx');
const RecentNavItem = require('../../../navbar/recent.navitem.jsx').both;
const Account = require('../../../navbar/account.navitem.jsx');
const UIPage = createClass({
displayName : 'UIPage',
render : function(){
return <div className='uiPage sitePage'>
<Navbar>
<Nav.section>
<Nav.item className='brewTitle'>{this.props.brew.title}</Nav.item>
</Nav.section>
<Nav.section>
<NewBrewItem />
<HelpNavItem />
<RecentNavItem />
<Account />
</Nav.section>
</Navbar>
<div className='content'>
{this.props.children}
</div>
</div>;
}
});
module.exports = UIPage;

View File

@@ -0,0 +1,47 @@
.uiPage{
.content{
overflow-y : hidden;
width : 90vw;
background-color: #f0f0f0;
font-family: 'Open Sans';
margin-left: auto;
margin-right: auto;
margin-top: 25px;
padding: 2% 4%;
font-size: 0.8em;
line-height: 1.8em;
.dataGroup{
padding: 6px 20px 15px;
border: 2px solid black;
border-radius: 5px;
margin: 5px 0px;
}
h1, h2, h3, h4{
font-weight: 900;
text-transform: uppercase;
margin: 0.5em 30% 0.25em 0;
border-bottom: 2px solid slategrey;
}
h1 {
font-size: 2em;
border-bottom: 2px solid darkslategrey;
margin-bottom: 0.5em;
margin-right: 0;
}
h2 {
font-size: 1.75em;
}
h3 {
font-size: 1.5em;
svg {
width: 19px;
}
}
h4 {
font-size: 1.25em;
}
strong {
font-weight: bold;
}
}
}

View File

@@ -62,7 +62,10 @@ const EditPage = createClass({
confirmGoogleTransfer : false,
errors : null,
htmlErrors : Markdown.validate(this.props.brew.text),
url : ''
url : '',
autoSave : true,
autoSaveWarning : false,
unsavedTime : new Date()
};
},
savedBrew : null,
@@ -72,9 +75,17 @@ const EditPage = createClass({
url : window.location.href
});
this.savedBrew = JSON.parse(JSON.stringify(this.props.brew)); //Deep copy
this.trySave();
this.setState({ autoSave: JSON.parse(localStorage.getItem('AUTOSAVE_ON')) ?? true }, ()=>{
if(this.state.autoSave){
this.trySave();
} else {
this.setState({ autoSaveWarning: true });
}
});
window.onbeforeunload = ()=>{
if(this.state.isSaving || this.state.isPending){
return 'You have unsaved changes!';
@@ -114,24 +125,27 @@ const EditPage = createClass({
if(htmlErrors.length) htmlErrors = Markdown.validate(text);
this.setState((prevState)=>({
brew : _.merge({}, prevState.brew, { text: text }),
brew : { ...prevState.brew, text: text },
isPending : true,
htmlErrors : htmlErrors
}), ()=>this.trySave());
}), ()=>{if(this.state.autoSave) this.trySave();});
},
handleStyleChange : function(style){
this.setState((prevState)=>({
brew : _.merge({}, prevState.brew, { style: style }),
brew : { ...prevState.brew, style: style },
isPending : true
}), ()=>this.trySave());
}), ()=>{if(this.state.autoSave) this.trySave();});
},
handleMetaChange : function(metadata){
this.setState((prevState)=>({
brew : _.merge({}, prevState.brew, metadata),
brew : {
...prevState.brew,
...metadata
},
isPending : true,
}), ()=>this.trySave());
}), ()=>{if(this.state.autoSave) this.trySave();});
},
@@ -200,7 +214,7 @@ const EditPage = createClass({
const brew = this.state.brew;
brew.pageCount = ((brew.renderer=='legacy' ? brew.text.match(/\\page/g) : brew.text.match(/^\\page$/gm)) || []).length + 1;
const params = `${transfer ? `?transfer${this.state.saveGoogle ? 'To' : 'From'}Google=true` : ''}`;
const params = `${transfer ? `?${this.state.saveGoogle ? 'saveToGoogle' : 'removeFromGoogle'}=true` : ''}`;
const res = await request
.put(`/api/update/${brew.editId}${params}`)
.send(brew)
@@ -210,18 +224,17 @@ const EditPage = createClass({
});
this.savedBrew = res.body;
if(transfer) {
history.replaceState(null, null, `/edit/${this.savedBrew.googleId ?? ''}${this.savedBrew.editId}`);
}
history.replaceState(null, null, `/edit/${this.savedBrew.editId}`);
this.setState((prevState)=>({
brew : _.merge({}, prevState.brew, {
brew : { ...prevState.brew,
googleId : this.savedBrew.googleId ? this.savedBrew.googleId : null,
editId : this.savedBrew.editId,
shareId : this.savedBrew.shareId
}),
isPending : false,
isSaving : false,
},
isPending : false,
isSaving : false,
unsavedTime : new Date()
}));
},
@@ -321,26 +334,64 @@ const EditPage = createClass({
<div className='errorContainer'>
Looks like there was a problem saving. <br />
Report the issue <a target='_blank' rel='noopener noreferrer'
href={`https://github.com/naturalcrit/homebrewery/issues/new?body=${encodeURIComponent(errMsg)}`}>
href={`https://github.com/naturalcrit/homebrewery/issues/new?template=save_issue.yml&error-code=${encodeURIComponent(errMsg)}`}>
here
</a>.
</div>
</Nav.item>;
}
if(this.state.autoSaveWarning && this.hasChanges()){
this.setAutosaveWarning();
const elapsedTime = Math.round((new Date() - this.state.unsavedTime) / 1000 / 60);
const text = elapsedTime == 0 ? 'Autosave is OFF.' : `Autosave is OFF, and you haven't saved for ${elapsedTime} minutes.`;
return <Nav.item className='save error' icon='fas fa-exclamation-circle'>
Reminder...
<div className='errorContainer'>
{text}
</div>
</Nav.item>;
}
if(this.state.isSaving){
return <Nav.item className='save' icon='fas fa-spinner fa-spin'>saving...</Nav.item>;
}
if(this.state.isPending && this.hasChanges()){
return <Nav.item className='save' onClick={this.save} color='blue' icon='fas fa-save'>Save Now</Nav.item>;
}
if(!this.state.isPending && !this.state.isSaving && this.state.autoSave){
return <Nav.item className='save saved'>auto-saved.</Nav.item>;
}
if(!this.state.isPending && !this.state.isSaving){
return <Nav.item className='save saved'>saved.</Nav.item>;
}
},
handleAutoSave : function(){
if(this.warningTimer) clearTimeout(this.warningTimer);
this.setState((prevState)=>({
autoSave : !prevState.autoSave,
autoSaveWarning : prevState.autoSave
}), ()=>{
localStorage.setItem('AUTOSAVE_ON', JSON.stringify(this.state.autoSave));
});
},
setAutosaveWarning : function(){
setTimeout(()=>this.setState({ autoSaveWarning: false }), 4000); // 4 seconds to display
this.warningTimer = setTimeout(()=>{this.setState({ autoSaveWarning: true });}, 900000); // 15 minutes between warnings
this.warningTimer;
},
renderAutoSaveButton : function(){
return <Nav.item onClick={this.handleAutoSave}>
Autosave <i className={this.state.autoSave ? 'fas fa-power-off active' : 'fas fa-power-off'}></i>
</Nav.item>;
},
processShareId : function() {
return this.state.brew.googleId ?
return this.state.brew.googleId && !this.state.brew.stubbed ?
this.state.brew.googleId + this.state.brew.shareId :
this.state.brew.shareId;
},
@@ -377,7 +428,10 @@ const EditPage = createClass({
<Nav.section>
{this.renderGoogleDriveIcon()}
{this.renderSaveButton()}
<Nav.dropdown className='save-menu'>
{this.renderSaveButton()}
{this.renderAutoSaveButton()}
</Nav.dropdown>
<NewBrew />
<HelpNavItem/>
<Nav.dropdown>
@@ -417,7 +471,7 @@ const EditPage = createClass({
onMetaChange={this.handleMetaChange}
renderer={this.state.brew.renderer}
/>
<BrewRenderer text={this.state.brew.text} style={this.state.brew.style} renderer={this.state.brew.renderer} errors={this.state.htmlErrors} />
<BrewRenderer text={this.state.brew.text} style={this.state.brew.style} renderer={this.state.brew.renderer} theme={this.state.brew.theme} errors={this.state.htmlErrors} />
</SplitPane>
</div>
</div>;

View File

@@ -32,7 +32,7 @@
position : absolute;
top : 100%;
left : 50%;
z-index : 100000;
z-index : 500;
width : 140px;
padding : 3px;
color : white;

View File

@@ -38,9 +38,7 @@ const HomePage = createClass({
},
handleSave : function(){
request.post('/api')
.send({
text : this.state.brew.text
})
.send(this.state.brew)
.end((err, res)=>{
if(err) return;
const brew = res.body;
@@ -52,7 +50,7 @@ const HomePage = createClass({
},
handleTextChange : function(text){
this.setState((prevState)=>({
brew : _.merge({}, prevState.brew, { text: text })
brew : { ...prevState.brew, text: text }
}));
},
renderNavbar : function(){

View File

@@ -1,50 +1,68 @@
# The Homebrewery
```css
.page #example + table td {
border:1px dashed #00000030;
}
.page {
padding-bottom : 1.1cm;
}
```
# The Homebrewery *V3*
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
The Homebrewery makes the creation and sharing of authentic looking Fifth-Edition homebrews easy. It uses [Markdown](https://help.github.com/articles/markdown-basics/) with a little CSS magic to make your brews come to life.
**Try it!** Simply edit the text on the left and watch it *update live* on the right.
**Try it!** Simply edit the text on the left and watch it *update live* on the right. Note that not every button is visible on this demo page. Click New {{fas,fa-plus-square}} in the navbar above to start brewing with all the features!
### Editing and Sharing
When you create your own homebrew you will be given a *edit url* and a *share url*. Any changes you make will be automatically saved to the database within a few seconds. Anyone with the edit url will be able to make edits to your homebrew. So be careful about who you share it with.
When you create your own homebrew, you will be given a *edit url* and a *share url*.
Any changes you make while on the *edit url* will be automatically saved to the database within a few seconds. Anyone with the edit url will be able to make edits to your homebrew, so be careful about who you share it with.
Anyone with the *share url* will be able to access a read-only version of your homebrew.
## Helping out
{{note
##### PDF Creation
PDF Printing works best in Google Chrome. If you are having quality/consistency issues, try using Chrome to print instead.
After clicking the "Print" item in the navbar a new page will open and a print dialog will pop-up.
* Set the **Destination** to "Save as PDF"
* Set **Paper Size** to "Letter"
* If you are printing on A4 paper, make sure to have the **PRINT → {{far,fa-file}} A4 Pagesize** snippet in your brew
* In **Options** make sure "Background Images" is selected.
* 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!
}}
![homebrew mug](http://i.imgur.com/hMna6G0.png) {position:absolute,bottom:20px,left:130px,width:220px}
{{artist,bottom:160px,left:100px
##### Homebrew Mug
[naturalcrit](https://homebrew.naturalcrit.com)
}}
{{pageNumber 1}}
{{footnote PART 1 | FANCINESS}}
\column
## New in V3.0.0
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, 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!
#### New Things All The Time!
Check out the latest updates in the full changelog [here](/changelog).
### 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.
This tool will **always** be free, never have ads, and I will never offer any "premium" features or whatever.
>##### PDF Exporting
> PDF Printing works best in Chrome. If you are having quality/consistency issues, try using Chrome to print instead.
>
> After clicking the "Print" item in the navbar a new page will open and a print dialog will pop-up.
> * Set the **Destination** to "Save as PDF"
> * Set **Paper Size** to "Letter"
> * If you are printing on A4 paper, make sure to have the "A4 page size snippet" in your brew
> * In **Options** make sure "Background Images" is selected.
> * Hit print and enjoy! You're done!
>
> If you want to save ink or have a monochrome printer, add the **Ink Friendly** snippet to your brew before you print
```
```
## V3.0.0 Released!
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*).
**You can enable V3 via the <span class="fa fa-info-circle" style="text-indent:0"></span> Properties button!**
## New Things All The Time!
What's new in the latest update? Check out the full changelog [here](/changelog)
### Bugs, Issues, Suggestions?
Take a quick look at our [Frequently Asked Questions page](/faq) to see if your question has a handy answer.
@@ -53,56 +71,105 @@ Need help getting started or just the right look for your brew? Head to [r/Homeb
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
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). Which means you are free to use The Homebrewery codebase any way that you want, except for claiming that you made it yourself.
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's created on this site, it's your responsibility to ensure you have the proper licenses/rights for any images or resources used.
### More Resources
#### 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.
### More Homebrew Resources
<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.
<img src='https://i.imgur.com/hMna6G0.png' style='position:absolute;bottom:40px;right:30px;width:280px' />
<div class='pageNumber'>1</div>
<div class='footnote'>PART 1 | FANCINESS</div>
<div style='position: absolute; top: 20px; right: 20px;'>
<a href='https://discord.gg/by3deKx' target='_blank' title='Discord of Many Things'><img src='/assets/discord.png' style='height:30px'/></a>
{{position:absolute;top:20px;right:20px;width:auto
<a href='https://discord.gg/by3deKx' target='_blank' title='Discord of Many Things' style='color: black;'><img src='/assets/discord.png' style='height:30px'/></a>
<a href='https://github.com/naturalcrit/homebrewery' target='_blank' title='Github' style='color: black; padding-left: 5px;'><img src='/assets/github.png' style='height:30px'/></a>
<a href='https://patreon.com/NaturalCrit' target='_blank' title='Patreon' style='color: black; padding-left: 5px;'><img src='/assets/patreon.png' style='height:30px'/></a>
<a href='https://www.reddit.com/r/homebrewery/' target='_blank' title='Reddit' style='color: black; padding-left: 5px;'><img src='/assets/reddit.png' style='height:30px'/></a>
</div>
}}
\page
# Appendix
## Markdown+
The Homebrewery aims to make homebrewing as simple as possible, providing a live editor with Markdown syntax that is more human-readable and faster to write with than raw HTML.
### Not quite Markdown
Although the Homebrewery uses Markdown, to get all the styling features from the PHB, we had to get a little creative. Some base HTML elements are not used as expected and I've had to include a few new keywords.
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!**
___
* **Horizontal Rules** are generally used to *modify* existing elements into a different style. For example, a horizontal rule before a blockquote will give it the style of a Monster Stat Block instead of a note.
* **New Pages** are controlled by the author. It's impossible for the site to detect when the end of a page is reached, so indicate you'd like to start a new page, use the new page snippet to get the syntax.
* **Code Blocks** are used only to indicate column breaks. Since they don't allow for styling within them, they weren't that useful to use.
* **HTML** can be used to get *just* the right look for your homebrew. I've included some examples in the snippet icons above the editor.
### 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:
#### Span
My favorite author is {{pen,#author,color:orange,font-family:"trebuchet ms" Brandon Sanderson}}. The orange text has a class of `pen`, an id of `author`, is colored orange, and given a new font. The first space outside of quotes marks the beginning of the content.
#### Block
{{purple,#book,text-align:center,background:#aa88aa55
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
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.
Inline elements like *italics* {color:#D35400} or images require the injection on the same line.
### Images
Images must be hosted online somewhere, like imgur. You use the address to that image to reference it in your brew. Images can be included 'inline' with the text using Markdown-style images. However for background images more control is needed.
Block elements like headers require the injection to start on the line immediately following.
Background images should be included as HTML-style img tags. Using inline CSS you can precisely position your image where you'd like it to be. I have added both a inflow image snippet and a background image snippet to give you exmaples of how to do it.
##### A Purple Header
{color:purple,text-align:center}
\* *this does not currently work for tables yet*
### Vertical Spacing
A blank line can be achieved with a run of one or more `:` alone on a line. More `:`'s will create more space.
### Crediting Me
If you'd like to credit The Homebrewery in your brew, I'd be flattered! Just reference that you made it with The Homebrewery.
::
Much nicer than `<br><br><br><br><br>`
### Definition Lists
**Example** :: V3 uses HTML *definition lists* to create "lists" with hanging indents.
<div class='pageNumber'>2</div>
<div class='footnote'>PART 2 | BORING STUFF</div>
### Column Breaks
Column and page breaks with `\column` and `\page`.
\column
### Tables
Tables now allow column & row spanning between cells. This is included in some updated snippets, but a simplified example is given below.
A cell can be spanned across columns by grouping multiple pipe `|` characters at the end of a cell.
Row spanning is achieved by adding a `^` at the end of a cell just before the `|`.
These can be combined to span a cell across both columns and rows. Cells must have the same colspan if they are to be rowspan'd.
##### Example
| Head A | Spanned Header ||
| Head B | Head C | Head D |
|:-------|:------:|:------:|
| 1A | 1B | 1C |
| 2A ^| 2B | 2C |
| 3A ^| 3B 3C ||
| 4A | 4B 4C^||
| 5A ^| 5B | 5C |
| 6A | 6B ^| 6C |
## 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 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}
\* *When using Imgur-hosted images, use the "direct link", which can be found when you click into your image in the Imgur interace.*
## 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.
## 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.
{{pageNumber 2}}
{{footnote PART 2 | BORING STUFF}}

View File

@@ -0,0 +1,108 @@
# 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.
### Homebrew D&D made easy
The Homebrewery makes the creation and sharing of authentic looking Fifth-Edition homebrews easy. It uses [Markdown](https://help.github.com/articles/markdown-basics/) with a little CSS magic to make your brews come to life.
**Try it!** Simply edit the text on the left and watch it *update live* on the right.
### Editing and Sharing
When you create your own homebrew you will be given a *edit url* and a *share url*. Any changes you make will be automatically saved to the database within a few seconds. Anyone with the edit url will be able to make edits to your homebrew. So be careful about who you share it with.
Anyone with the *share url* will be able to access a read-only version of your homebrew.
## 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.
This tool will **always** be free, never have ads, and I will never offer any "premium" features or whatever.
>##### PDF Exporting
> PDF Printing works best in Chrome. If you are having quality/consistency issues, try using Chrome to print instead.
>
> After clicking the "Print" item in the navbar a new page will open and a print dialog will pop-up.
> * Set the **Destination** to "Save as PDF"
> * Set **Paper Size** to "Letter"
> * If you are printing on A4 paper, make sure to have the "A4 page size snippet" in your brew
> * In **Options** make sure "Background Images" is selected.
> * Hit print and enjoy! You're done!
>
> If you want to save ink or have a monochrome printer, add the **Ink Friendly** snippet to your brew before you print
```
```
## V3.0.0 Released!
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*).
**You can enable V3 via the <span class="fa fa-info-circle" style="text-indent:0"></span> Properties button!**
## New Things All The Time!
What's new in the latest update? Check out the full changelog [here](/changelog)
### 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!
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
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.
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
<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.
<img src='https://i.imgur.com/hMna6G0.png' style='position:absolute;bottom:40px;right:30px;width:280px' />
<div class='pageNumber'>1</div>
<div class='footnote'>PART 1 | FANCINESS</div>
<div style='position: absolute; top: 20px; right: 20px;'>
<a href='https://discord.gg/by3deKx' target='_blank' title='Discord of Many Things'><img src='/assets/discord.png' style='height:30px'/></a>
<a href='https://github.com/naturalcrit/homebrewery' target='_blank' title='Github' style='color: black; padding-left: 5px;'><img src='/assets/github.png' style='height:30px'/></a>
<a href='https://patreon.com/NaturalCrit' target='_blank' title='Patreon' style='color: black; padding-left: 5px;'><img src='/assets/patreon.png' style='height:30px'/></a>
<a href='https://www.reddit.com/r/homebrewery/' target='_blank' title='Reddit' style='color: black; padding-left: 5px;'><img src='/assets/reddit.png' style='height:30px'/></a>
</div>
\page
# Appendix
### Not quite Markdown
Although the Homebrewery uses Markdown, to get all the styling features from the PHB, we had to get a little creative. Some base HTML elements are not used as expected and I've had to include a few new keywords.
___
* **Horizontal Rules** are generally used to *modify* existing elements into a different style. For example, a horizontal rule before a blockquote will give it the style of a Monster Stat Block instead of a note.
* **New Pages** are controlled by the author. It's impossible for the site to detect when the end of a page is reached, so indicate you'd like to start a new page, use the new page snippet to get the syntax.
* **Code Blocks** are used only to indicate column breaks. Since they don't allow for styling within them, they weren't that useful to use.
* **HTML** can be used to get *just* the right look for your homebrew. I've included some examples in the snippet icons above the editor.
```
```
### Images
Images must be hosted online somewhere, like imgur. You use the address to that image to reference it in your brew. Images can be included 'inline' with the text using Markdown-style images. However for background images more control is needed.
Background images should be included as HTML-style img tags. Using inline CSS you can precisely position your image where you'd like it to be. I have added both a inflow image snippet and a background image snippet to give you exmaples of how to do it.
### Crediting Me
If you'd like to credit The Homebrewery in your brew, I'd be flattered! Just reference that you made it with The Homebrewery.
<div class='pageNumber'>2</div>
<div class='footnote'>PART 2 | BORING STUFF</div>

View File

@@ -1,175 +0,0 @@
```css
.page #example + table td {
border:1px dashed #00000030;
}
.page {
padding-bottom : 1.1cm;
}
```
# The Homebrewery *V3*
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
The Homebrewery makes the creation and sharing of authentic looking Fifth-Edition homebrews easy. It uses [Markdown](https://help.github.com/articles/markdown-basics/) with a little CSS magic to make your brews come to life.
**Try it!** Simply edit the text on the left and watch it *update live* on the right. Note that not every button is visible on this demo page. Click New {{fas,fa-plus-square}} in the navbar above to start brewing with all the features!
### Editing and Sharing
When you create your own homebrew, you will be given a *edit url* and a *share url*.
Any changes you make while on the *edit url* will be automatically saved to the database within a few seconds. Anyone with the edit url will be able to make edits to your homebrew, so be careful about who you share it with.
Anyone with the *share url* will be able to access a read-only version of your homebrew.
{{note
##### PDF Creation
PDF Printing works best in Google Chrome. If you are having quality/consistency issues, try using Chrome to print instead.
After clicking the "Print" item in the navbar a new page will open and a print dialog will pop-up.
* Set the **Destination** to "Save as PDF"
* Set **Paper Size** to "Letter"
* If you are printing on A4 paper, make sure to have the **PRINT → {{far,fa-file}} A4 Pagesize** snippet in your brew
* In **Options** make sure "Background Images" is selected.
* 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!
}}
![homebrew mug](http://i.imgur.com/hMna6G0.png) {position:absolute,bottom:20px,left:130px,width:220px}
{{artist,bottom:160px,left:100px
##### Homebrew Mug
[naturalcrit](https://homebrew.naturalcrit.com)
}}
{{pageNumber 1}}
{{footnote PART 1 | FANCINESS}}
\column
## New in V3.0.0
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, 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!
#### New Things All The Time!
Check out the latest updates in the full changelog [here](/changelog).
### 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.
This tool will **always** be free, never have ads, and I will never offer any "premium" features or whatever.
### 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!
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
The Homebrewery is licensed using the [MIT License](https://github.com/naturalcrit/homebrewery/blob/master/license). Which means you are free to use The Homebrewery codebase any way that you want, except for claiming that you made it yourself.
If you wish to sell or in some way gain profit for what's created on this site, it's your responsibility to ensure you have the proper licenses/rights for any images or resources used.
#### 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.
### More Homebrew Resources
<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.
{{position:absolute;top:20px;right:20px;width:auto
<a href='https://discord.gg/by3deKx' target='_blank' title='Discord of Many Things' style='color: black;'><img src='/assets/discord.png' style='height:30px'/></a>
<a href='https://github.com/naturalcrit/homebrewery' target='_blank' title='Github' style='color: black; padding-left: 5px;'><img src='/assets/github.png' style='height:30px'/></a>
<a href='https://patreon.com/NaturalCrit' target='_blank' title='Patreon' style='color: black; padding-left: 5px;'><img src='/assets/patreon.png' style='height:30px'/></a>
<a href='https://www.reddit.com/r/homebrewery/' target='_blank' title='Reddit' style='color: black; padding-left: 5px;'><img src='/assets/reddit.png' style='height:30px'/></a>
}}
\page
## Markdown+
The Homebrewery aims to make homebrewing as simple as possible, providing a live editor with Markdown syntax that is more human-readable and faster to write with than raw HTML.
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!**
### 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:
#### Span
My favorite author is {{pen,#author,color:orange,font-family:"trebuchet ms" Brandon Sanderson}}. The orange text has a class of `pen`, an id of `author`, is colored orange, and given a new font. The first space outside of quotes marks the beginning of the content.
#### Block
{{purple,#book,text-align:center,background:#aa88aa55
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
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.
Inline elements like *italics* {color:#D35400} or images require the injection on the same line.
Block elements like headers require the injection to start on the line immediately following.
##### A Purple Header
{color:purple,text-align:center}
\* *this does not currently work for tables yet*
### Vertical Spacing
A blank line can be achieved with a run of one or more `:` alone on a line. More `:`'s will create more space.
::
Much nicer than `<br><br><br><br><br>`
### Definition Lists
**Example** :: V3 uses HTML *definition lists* to create "lists" with hanging indents.
### Column Breaks
Column and page breaks with `\column` and `\page`.
\column
### Tables
Tables now allow column & row spanning between cells. This is included in some updated snippets, but a simplified example is given below.
A cell can be spanned across columns by grouping multiple pipe `|` characters at the end of a cell.
Row spanning is achieved by adding a `^` at the end of a cell just before the `|`.
These can be combined to span a cell across both columns and rows. Cells must have the same colspan if they are to be rowspan'd.
##### Example
| Head A | Spanned Header ||
| Head B | Head C | Head D |
|:-------|:------:|:------:|
| 1A | 1B | 1C |
| 2A ^| 2B | 2C |
| 3A ^| 3B 3C ||
| 4A | 4B 4C^||
| 5A ^| 5B | 5C |
| 6A | 6B ^| 6C |
## 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 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}
\* *When using Imgur-hosted images, use the "direct link", which can be found when you click into your image in the Imgur interace.*
## 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.
## 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.
{{pageNumber 2}}
{{footnote PART 2 | BORING STUFF}}

View File

@@ -27,55 +27,32 @@ const NewPage = createClass({
getDefaultProps : function() {
return {
brew : {
text : '',
style : undefined,
shareId : null,
editId : null,
createdAt : null,
updatedAt : null,
gDrive : false,
text : '',
style : undefined,
title : '',
description : '',
tags : '',
published : false,
authors : [],
systems : []
renderer : 'V3',
theme : '5ePHB'
}
};
},
getInitialState : function() {
const brew = this.props.brew;
let 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;
}
if(this.props.brew.shareId) {
brew = {
text : brew.text ?? '',
style : brew.style ?? undefined,
title : brew.title ?? '',
description : brew.description ?? '',
renderer : brew.renderer ?? 'legacy',
theme : brew.theme ?? '5ePHB'
};
}
return {
brew : {
text : brew.text || '',
style : brew.style || undefined,
gDrive : false,
title : brew.title || '',
description : brew.description || '',
tags : brew.tags || '',
published : false,
authors : [],
systems : brew.systems || [],
renderer : brew.renderer || 'legacy'
},
brew : brew,
isSaving : false,
saveGoogle : (global.account && global.account.googleId ? true : false),
errors : null,
@@ -85,6 +62,29 @@ const NewPage = createClass({
componentDidMount : function() {
document.addEventListener('keydown', this.handleControlKeys);
const brew = this.state.brew;
if(!this.props.brew.shareId && 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));
brew.text = brewStorage ?? brew.text;
brew.style = styleStorage ?? brew.style;
// brew.title = metaStorage?.title || this.state.brew.title;
// brew.description = metaStorage?.description || this.state.brew.description;
brew.renderer = metaStorage?.renderer ?? brew.renderer;
brew.theme = metaStorage?.theme ?? brew.theme;
this.setState({
brew : brew
});
}
localStorage.setItem(BREWKEY, brew.text);
localStorage.setItem(STYLEKEY, brew.style);
localStorage.setItem(METAKEY, JSON.stringify({ 'renderer': brew.renderer, 'theme': brew.theme }));
},
componentWillUnmount : function() {
document.removeEventListener('keydown', this.handleControlKeys);
@@ -112,7 +112,7 @@ const NewPage = createClass({
if(htmlErrors.length) htmlErrors = Markdown.validate(text);
this.setState((prevState)=>({
brew : _.merge({}, prevState.brew, { text: text }),
brew : { ...prevState.brew, text: text },
htmlErrors : htmlErrors
}));
localStorage.setItem(BREWKEY, text);
@@ -120,19 +120,20 @@ const NewPage = createClass({
handleStyleChange : function(style){
this.setState((prevState)=>({
brew : _.merge({}, prevState.brew, { style: style }),
brew : { ...prevState.brew, style: style },
}));
localStorage.setItem(STYLEKEY, style);
},
handleMetaChange : function(metadata){
this.setState((prevState)=>({
brew : _.merge({}, prevState.brew, metadata),
brew : { ...prevState.brew, ...metadata },
}));
localStorage.setItem(METAKEY, JSON.stringify({
// 'title' : this.state.brew.title,
// 'description' : this.state.brew.description,
'renderer' : this.state.brew.renderer
'renderer' : this.state.brew.renderer,
'theme' : this.state.brew.theme
}));
},
@@ -162,7 +163,7 @@ const NewPage = createClass({
brew.pageCount=((brew.renderer=='legacy' ? brew.text.match(/\\page/g) : brew.text.match(/^\\page$/gm)) || []).length + 1;
const res = await request
.post(`/api${this.state.saveGoogle ? '?transferToGoogle=true' : ''}`)
.post(`/api${this.state.saveGoogle ? '?saveToGoogle=true' : ''}`)
.send(brew)
.catch((err)=>{
console.log(err);
@@ -174,7 +175,7 @@ const NewPage = createClass({
localStorage.removeItem(BREWKEY);
localStorage.removeItem(STYLEKEY);
localStorage.removeItem(METAKEY);
window.location = `/edit/${brew.googleId ?? ''}${brew.editId}`;
window.location = `/edit/${brew.editId}`;
},
renderSaveButton : function(){
@@ -290,7 +291,7 @@ const NewPage = createClass({
onMetaChange={this.handleMetaChange}
renderer={this.state.brew.renderer}
/>
<BrewRenderer text={this.state.brew.text} style={this.state.brew.style} renderer={this.state.brew.renderer} errors={this.state.htmlErrors}/>
<BrewRenderer text={this.state.brew.text} style={this.state.brew.style} renderer={this.state.brew.renderer} theme={this.state.brew.theme} errors={this.state.htmlErrors}/>
</SplitPane>
</div>
</div>;

View File

@@ -7,6 +7,8 @@ const { Meta } = require('vitreum/headtags');
const MarkdownLegacy = require('naturalcrit/markdownLegacy.js');
const Markdown = require('naturalcrit/markdown.js');
const Themes = require('themes/themes.json');
const BREWKEY = 'homebrewery-new';
const STYLEKEY = 'homebrewery-new-style';
const METAKEY = 'homebrewery-new-meta';
@@ -45,7 +47,8 @@ const PrintPage = createClass({
brew : {
text : brewStorage,
style : styleStorage,
renderer : metaStorage.renderer || 'legacy'
renderer : metaStorage?.renderer || 'legacy',
theme : metaStorage?.theme || '5ePHB'
}
};
});
@@ -82,9 +85,17 @@ const PrintPage = createClass({
},
render : function(){
const rendererPath = this.state.brew.renderer == 'V3' ? 'V3' : 'Legacy';
const themePath = this.state.brew.theme ?? '5ePHB';
const baseThemePath = Themes[rendererPath][themePath].baseTheme;
return <div>
<Meta name='robots' content='noindex, nofollow' />
<link href={`${this.state.brew.renderer == 'legacy' ? '/themes/5ePhbLegacy.style.css' : '/themes/5ePhb.style.css'}`} rel='stylesheet'/>
<link href={`/themes/${rendererPath}/Blank/style.css`} rel='stylesheet'/>
{baseThemePath &&
<link href={`/themes/${rendererPath}/${baseThemePath}/style.css`} rel='stylesheet'/>
}
<link href={`/themes/${rendererPath}/${themePath}/style.css`} rel='stylesheet'/>
{/* Apply CSS from Style tab */}
{this.renderStyle()}
<div className='pages' ref='pages'>

View File

@@ -49,7 +49,7 @@ const SharePage = createClass({
},
processShareId : function() {
return this.props.brew.googleId ?
return this.props.brew.googleId && !this.props.brew.stubbed ?
this.props.brew.googleId + this.props.brew.shareId :
this.props.brew.shareId;
},
@@ -86,7 +86,7 @@ const SharePage = createClass({
</Navbar>
<div className='content'>
<BrewRenderer text={this.props.brew.text} style={this.props.brew.style} renderer={this.props.brew.renderer} />
<BrewRenderer text={this.props.brew.text} style={this.props.brew.style} renderer={this.props.brew.renderer} theme={this.props.brew.theme} />
</div>
</div>;
}

View File

@@ -23,7 +23,7 @@ const UserPage = createClass({
};
},
getInitialState : function() {
const usernameWithS = this.props.username + (this.props.username.endsWith('s') ? `'` : `'s`);
const usernameWithS = this.props.username + (this.props.username.endsWith('s') ? `` : `s`);
const brews = _.groupBy(this.props.brews, (brew)=>{
return (brew.published ? 'published' : 'private');

View File

@@ -1,28 +1,31 @@
module.exports = async(name, title = '', props = {})=>{
const HOMEBREWERY_PUBLIC_URL=props.config.publicUrl;
const template = async function(name, title='', props = {}){
const ogTags = [];
const ogMeta = props.ogMeta ?? {};
Object.entries(ogMeta).forEach(([key, value])=>{
if(!value) return;
const tag = `<meta property="og:${key}" content="${value}">`;
ogTags.push(tag);
});
const ogMetaTags = ogTags.join('\n');
return `
<!DOCTYPE html>
<html>
<head>
<link href="//use.fontawesome.com/releases/v5.15.1/css/all.css" rel="stylesheet" />
<link href="//fonts.googleapis.com/css?family=Open+Sans:400,300,600,700" rel="stylesheet" type="text/css" />
<link href=${`/${name}/bundle.css`} rel='stylesheet' />
<link rel="icon" href="/assets/homebrew/favicon.ico" type="image/x-icon" />
<meta property="og:title" content="${props.brew?.title || 'Homebrewery - Untitled Brew'}">
<meta property="og:url" content="${HOMEBREWERY_PUBLIC_URL}/${props.brew?.shareId ? `share/${props.brew.shareId}` : ''}">
<meta property="og:image" content="${props.brew?.thumbnail || `${HOMEBREWERY_PUBLIC_URL}/thumbnail.png`}">
<meta property="og:description" content="${props.brew?.description || 'No description.'}">
<meta property="og:site_name" content="The Homebrewery - Make your Homebrew content look legit!">
<meta property="og:type" content="article">
<meta name="twitter:card" content="summary_large_image">
<title>${title.length ? `${title} - The Homebrewery`: 'The Homebrewery - NaturalCrit'}</title>
</head>
<body>
<main id="reactRoot">${require(`../build/${name}/ssr.js`)(props)}</main>
<script src=${`/${name}/bundle.js`}></script>
<script>start_app(${JSON.stringify(props)})</script>
</body>
</html>
`;
return `<!DOCTYPE html>
<html>
<head>
<link href="//use.fontawesome.com/releases/v5.15.1/css/all.css" rel="stylesheet" />
<link href="//fonts.googleapis.com/css?family=Open+Sans:400,300,600,700" rel="stylesheet" type="text/css" />
<link href=${`/${name}/bundle.css`} rel='stylesheet' />
<link rel="icon" href="/assets/favicon.ico" type="image/x-icon" />
${ogMetaTags}
<meta name="twitter:card" content="summary">
<title>${title.length ? `${title} - The Homebrewery`: 'The Homebrewery - NaturalCrit'}</title>
</head>
<body>
<main id="reactRoot">${require(`../build/${name}/ssr.js`)(props)}</main>
<script src=${`/${name}/bundle.js`}></script>
<script>start_app(${JSON.stringify(props)})</script>
</body>
</html>
`;
};
module.exports = template;

21257
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
{
"name": "homebrewery",
"description": "Create authentic looking D&D homebrews using only markdown",
"version": "3.1.1",
"version": "3.4.0",
"engines": {
"node": "16.11.x"
},
@@ -51,45 +51,45 @@
]
},
"dependencies": {
"@babel/core": "^7.18.2",
"@babel/plugin-transform-runtime": "^7.18.2",
"@babel/preset-env": "^7.18.2",
"@babel/preset-react": "^7.17.12",
"body-parser": "^1.20.0",
"classnames": "^2.3.1",
"codemirror": "^5.65.5",
"@babel/core": "^7.19.6",
"@babel/plugin-transform-runtime": "^7.19.6",
"@babel/preset-env": "^7.19.4",
"@babel/preset-react": "^7.18.6",
"body-parser": "^1.20.1",
"classnames": "^2.3.2",
"codemirror": "^5.65.6",
"cookie-parser": "^1.4.6",
"create-react-class": "^15.7.0",
"dedent-tabs": "^0.10.1",
"express": "^4.18.1",
"dedent-tabs": "^0.10.2",
"express": "^4.18.2",
"express-async-handler": "^1.2.0",
"express-static-gzip": "2.1.7",
"fs-extra": "10.1.0",
"googleapis": "101.0.0",
"googleapis": "109.0.1",
"js-yaml": "^4.1.0",
"jwt-simple": "^0.5.6",
"less": "^3.13.1",
"lodash": "^4.17.21",
"marked": "4.0.16",
"marked-extended-tables": "^1.0.3",
"marked": "4.2.3",
"marked-extended-tables": "^1.0.5",
"markedLegacy": "npm:marked@^0.3.19",
"moment": "^2.29.3",
"mongoose": "^6.3.6",
"moment": "^2.29.4",
"mongoose": "^6.7.3",
"nanoid": "3.3.4",
"nconf": "^0.12.0",
"query-string": "7.1.1",
"npm": "^8.10.0",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"react-frame-component": "4.1.3",
"react-router-dom": "5.3.0",
"react-router-dom": "6.4.3",
"sanitize-filename": "1.6.3",
"superagent": "^6.1.0",
"vitreum": "git+https://git@github.com/calculuschild/vitreum.git"
},
"devDependencies": {
"eslint": "^8.17.0",
"eslint-plugin-react": "^7.30.0",
"jest": "^28.1.1",
"supertest": "^6.2.3"
"eslint": "^8.28.0",
"eslint-plugin-react": "^7.31.11",
"jest": "^29.2.2",
"supertest": "^6.3.1"
}
}

View File

@@ -10,7 +10,7 @@ const assetTransform = require('vitreum/transforms/asset.js');
const babel = require('@babel/core');
const less = require('less');
const babelify = async (code)=>(await babel.transformAsync(code, { presets: ['@babel/preset-env', '@babel/preset-react'], plugins: ['@babel/plugin-transform-runtime'] })).code;
const babelify = async (code)=>(await babel.transformAsync(code, { presets: [['@babel/preset-env', { 'exclude': ['proposal-dynamic-import'] }], '@babel/preset-react'], plugins: ['@babel/plugin-transform-runtime'] })).code;
const transforms = {
'.js' : (code, filename, opts)=>babelify(code),
@@ -24,28 +24,8 @@ const build = async ({ bundle, render, ssr })=>{
await fs.outputFile('./build/homebrew/bundle.css', css);
await fs.outputFile('./build/homebrew/bundle.js', bundle);
await fs.outputFile('./build/homebrew/ssr.js', ssr);
await fs.copy('./themes/fonts', './build/fonts');
await fs.copy('./themes/assets', './build/assets');
let src = './themes/5ePhbLegacy.style.less';
//Parse brew theme files
less.render(fs.readFileSync(src).toString(), {
compress : !isDev
}, function(e, output) {
fs.outputFile('./build/themes/5ePhbLegacy.style.css', output.css);
});
src = './themes/5ePhb.style.less';
less.render(fs.readFileSync(src).toString(), {
compress : !isDev
}, function(e, output) {
fs.outputFile('./build/themes/5ePhb.style.css', output.css);
});
// await less.render(lessCode, {
// compress : !dev,
// sourceMap : (dev ? {
// sourceMapFileInline: true,
// outputSourceFiles: true
// } : false),
// })
await fs.copy('./client/homebrew/favicon.ico', './build/assets/favicon.ico');
//compress files in production
if(!isDev){
@@ -60,16 +40,98 @@ const build = async ({ bundle, render, ssr })=>{
};
fs.emptyDirSync('./build');
pack('./client/homebrew/homebrew.jsx', {
paths : ['./shared'],
libs : Proj.libs,
dev : isDev && build,
transforms
})
.then(build)
.catch(console.error);
(async ()=>{
//v==----------------------------- COMPILE THEMES --------------------------------==v//
// Update list of all Theme files
const themes = { Legacy: {}, V3: {} };
let themeFiles = fs.readdirSync('./themes/Legacy');
for (dir of themeFiles) {
const themeData = JSON.parse(fs.readFileSync(`./themes/Legacy/${dir}/settings.json`).toString());
themeData.path = dir;
themes.Legacy[dir] = (themeData);
//fs.copy(`./themes/Legacy/${dir}/dropdownTexture.png`, `./build/themes/Legacy/${dir}/dropdownTexture.png`);
const src = `./themes/Legacy/${dir}/style.less`;
((outputDirectory)=>{
less.render(fs.readFileSync(src).toString(), {
compress : !isDev
}, function(e, output) {
fs.outputFile(outputDirectory, output.css);
});
})(`./build/themes/Legacy/${dir}/style.css`);
}
themeFiles = fs.readdirSync('./themes/V3');
for (dir of themeFiles) {
const themeData = JSON.parse(fs.readFileSync(`./themes/V3/${dir}/settings.json`).toString());
themeData.path = dir;
themes.V3[dir] = (themeData);
fs.copy(`./themes/V3/${dir}/dropdownTexture.png`, `./build/themes/V3/${dir}/dropdownTexture.png`);
const src = `./themes/V3/${dir}/style.less`;
((outputDirectory)=>{
less.render(fs.readFileSync(src).toString(), {
compress : !isDev
}, function(e, output) {
fs.outputFile(outputDirectory, output.css);
});
})(`./build/themes/V3/${dir}/style.css`);
}
await fs.outputFile('./themes/themes.json', JSON.stringify(themes, null, 2));
// await less.render(lessCode, {
// compress : !dev,
// sourceMap : (dev ? {
// sourceMapFileInline: true,
// outputSourceFiles: true
// } : false),
// })
// Move assets
await fs.copy('./themes/fonts', './build/fonts');
await fs.copy('./themes/assets', './build/assets');
//v==----------------------------- BUNDLE PACKAGES --------------------------------==v//
const bundles = await pack('./client/homebrew/homebrew.jsx', {
paths : ['./shared', './'],
libs : Proj.libs,
dev : isDev && build,
transforms
});
build(bundles);
// Possible method for generating separate bundles for theme snippets: factor-bundle first sending all common files to bundle.js, then again using default settings, keeping only snippet bundles
// await fs.outputFile('./build/junk.js', '');
// await fs.outputFile('./build/themes/Legacy/5ePHB/snippets.js', '');
//
// const files = ['./client/homebrew/homebrew.jsx','./themes/Legacy/5ePHB/snippets.js'];
//
// bundles = await pack(files, {
// dedupe: false,
// plugin : [['factor-bundle', { outputs: [ './build/junk.js','./build/themes/Legacy/5ePHB/snippets.js'], threshold : function(row, groups) {
// console.log(groups);
// if (groups.some(group => /.*homebrew.jsx$/.test(group))) {
// console.log("found homebrewery")
// return true;
// }
// return this._defaultThreshold(row, groups);
// }}]],
// paths : ['./shared','./','./build'],
// libs : Proj.libs,
// dev : isDev && build,
// transforms
// });
// build(bundles);
//
})().catch(console.error);
//In development set up a watch server and livereload
if(isDev){
livereload('./build');

View File

@@ -1,4 +1,4 @@
/*eslint max-lines: ["warn", {"max": 300, "skipBlankLines": true, "skipComments": true}]*/
/*eslint max-lines: ["warn", {"max": 400, "skipBlankLines": true, "skipComments": true}]*/
// Set working directory to project root
process.chdir(`${__dirname}/..`);
@@ -9,54 +9,19 @@ const yaml = require('js-yaml');
const app = express();
const config = require('./config.js');
const homebrewApi = require('./homebrew.api.js');
const { homebrewApi, getBrew } = 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.getGoogleBrew(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']));
Object.assign(brew, _.pick(metadata, ['title', 'description', 'tags', 'systems', 'renderer', 'theme']));
brew.text = brew.text.slice(index + 5);
}
if(brew.text.startsWith('```css')) {
@@ -64,6 +29,16 @@ const splitTextStyleAndMetadata = (brew)=>{
brew.style = brew.text.slice(7, index - 1);
brew.text = brew.text.slice(index + 5);
}
_.defaults(brew, { 'renderer': 'legacy', 'theme': '5ePHB' });
};
const sanitizeBrew = (brew, accessType)=>{
brew._id = undefined;
brew.__v = undefined;
if(accessType !== 'edit'){
brew.editId = undefined;
}
return brew;
};
app.use('/', serveCompressedStaticAssets(`build`));
@@ -93,78 +68,114 @@ app.use((req, res, 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');
const HomebrewModel = require('./homebrew.model.js').model;
const welcomeText = require('fs').readFileSync('client/homebrew/pages/homePage/welcome_msg.md', 'utf8');
const welcomeTextLegacy = require('fs').readFileSync('client/homebrew/pages/homePage/welcome_msg_legacy.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);};
const defaultMetaTags = {
siteName : 'The Homebrewery - Make your Homebrew content look legit!',
title : 'The Homebrewery',
description : 'A NaturalCrit Tool for Homebrews',
thumbnail : `${config.get('publicUrl')}/thumbnail.png`,
type : 'website'
};
//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
app.get('/', (req, res, next)=>{
req.brew = {
text : welcomeText,
renderer : 'V3'
},
req.ogMeta = { ...defaultMetaTags,
title : 'Homepage',
description : 'Homepage'
};
req.brew = brew;
splitTextStyleAndMetadata(req.brew);
return next();
});
//Home page v3
app.get('/v3_preview', async (req, res, next)=>{
const brew = {
text : welcomeTextV3,
renderer : 'V3'
//Home page Legacy
app.get('/legacy', (req, res, next)=>{
req.brew = {
text : welcomeTextLegacy,
renderer : 'legacy'
},
req.ogMeta = { ...defaultMetaTags,
title : 'Homepage (Legacy)',
description : 'Homepage'
};
splitTextStyleAndMetadata(brew);
req.brew = brew;
splitTextStyleAndMetadata(req.brew);
return next();
});
//Legacy/Other Document -> v3 Migration Guide
app.get('/migrate', async (req, res, next)=>{
const brew = {
app.get('/migrate', (req, res, next)=>{
req.brew = {
text : migrateText,
renderer : 'V3'
},
req.ogMeta = { ...defaultMetaTags,
title : 'v3 Migration Guide',
description : 'A brief guide to converting Legacy documents to the v3 renderer.'
};
splitTextStyleAndMetadata(brew);
req.brew = brew;
splitTextStyleAndMetadata(req.brew);
return next();
});
//Changelog page
app.get('/changelog', async (req, res, next)=>{
const brew = {
req.brew = {
title : 'Changelog',
text : changelogText,
renderer : 'V3'
},
req.ogMeta = { ...defaultMetaTags,
title : 'Changelog',
description : 'Development changelog.',
thumbnail : null
};
splitTextStyleAndMetadata(brew);
req.brew = brew;
splitTextStyleAndMetadata(req.brew);
return next();
});
//FAQ page
app.get('/faq', async (req, res, next)=>{
const brew = {
req.brew = {
title : 'FAQ',
text : faqText,
renderer : 'V3'
},
req.ogMeta = { ...defaultMetaTags,
title : 'FAQ',
description : 'Frequently Asked Questions'
};
splitTextStyleAndMetadata(brew);
req.brew = brew;
splitTextStyleAndMetadata(req.brew);
return next();
});
//Source page
app.get('/source/:id', asyncHandler(async (req, res)=>{
const brew = await getBrewFromId(req.params.id, 'raw');
app.get('/source/:id', asyncHandler(getBrew('share')), (req, res)=>{
const { brew } = req;
const replaceStrings = { '&': '&amp;', '<': '&lt;', '>': '&gt;' };
let text = brew.text;
@@ -173,11 +184,12 @@ app.get('/source/:id', asyncHandler(async (req, res)=>{
}
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');
app.get('/download/:id', asyncHandler(getBrew('share')), (req, res)=>{
const { brew } = req;
sanitizeBrew(brew, 'share');
const prefix = 'HB - ';
let fileName = sanitizeFilename(`${prefix}${brew.title}`).replaceAll(' ', '');
@@ -188,13 +200,21 @@ app.get('/download/:id', asyncHandler(async (req, res)=>{
'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);
req.ogMeta = { ...defaultMetaTags,
title : `${req.params.username}'s Collection`,
description : 'View my collection of homebrew on the Homebrewery.',
image : null
// type : could be 'profile'?
};
const fields = [
'googleId',
'title',
'pageCount',
'description',
@@ -205,7 +225,9 @@ app.get('/user/:username', async (req, res, next)=>{
'editId',
'createdAt',
'updatedAt',
'lastViewed'
'lastViewed',
'thumbnail',
'tags'
];
let brews = await HomebrewModel.getByUser(req.params.username, ownAccount, fields)
@@ -220,59 +242,149 @@ app.get('/user/:username', async (req, res, next)=>{
console.error(err);
});
if(googleBrews) {
if(googleBrews && googleBrews.length > 0) {
for (const brew of brews.filter((brew)=>brew.googleId)) {
const match = googleBrews.findIndex((b)=>b.editId === brew.editId);
if(match !== -1) {
brew.googleId = googleBrews[match].googleId;
brew.stubbed = true;
brew.pageCount = googleBrews[match].pageCount;
brew.renderer = googleBrews[match].renderer;
brew.version = googleBrews[match].version;
googleBrews.splice(match, 1);
}
}
googleBrews = googleBrews.map((brew)=>({ ...brew, authors: [req.account.username] }));
brews = _.concat(brews, googleBrews);
}
}
req.brews = _.map(brews, (brew)=>{
return sanitizeBrew(brew, !ownAccount);
return sanitizeBrew(brew, ownAccount ? 'edit' : 'share');
});
return next();
});
//Edit Page
app.get('/edit/:id', asyncHandler(async (req, res, next)=>{
app.get('/edit/:id', asyncHandler(getBrew('edit')), (req, res, next)=>{
req.brew = req.brew.toObject ? req.brew.toObject() : req.brew;
req.ogMeta = { ...defaultMetaTags,
title : req.brew.title || 'Untitled Brew',
description : req.brew.description || 'No description.',
image : req.brew.thumbnail || null,
type : 'article'
};
sanitizeBrew(req.brew, 'edit');
splitTextStyleAndMetadata(req.brew);
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;
app.get('/new/:id', asyncHandler(getBrew('share')), (req, res, next)=>{
sanitizeBrew(req.brew, 'share');
splitTextStyleAndMetadata(req.brew);
req.brew.title = `CLONE - ${req.brew.title}`;
req.ogMeta = { ...defaultMetaTags,
title : 'New',
description : 'Start crafting your homebrew on the Homebrewery!',
image : null
};
return next();
}));
});
//Share Page
app.get('/share/:id', asyncHandler(async (req, res, next)=>{
const brew = await getBrewFromId(req.params.id, 'share');
app.get('/share/:id', asyncHandler(getBrew('share')), asyncHandler(async (req, res, next)=>{
const { brew } = req;
if(req.params.id.length > 12) {
req.ogMeta = { ...defaultMetaTags,
title : req.brew.title || 'Untitled Brew',
description : req.brew.description || 'No description.',
image : req.brew.thumbnail || null,
type : 'article'
};
if(req.params.id.length > 12 && !brew._id) {
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);});
.catch((err)=>{next(err);});
} else {
await HomebrewModel.increaseView({ shareId: brew.shareId });
}
req.brew = brew;
sanitizeBrew(req.brew, 'share');
splitTextStyleAndMetadata(req.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;
app.get('/print/:id', asyncHandler(getBrew('share')), (req, res, next)=>{
sanitizeBrew(req.brew, 'share');
splitTextStyleAndMetadata(req.brew);
next();
});
//Account Page
app.get('/account', asyncHandler(async (req, res, next)=>{
const data = {};
data.title = 'Account Information Page';
let auth;
let files;
if(req.account) {
if(req.account.googleId) {
try {
auth = await GoogleActions.authCheck(req.account, res);
} catch (e) {
auth = undefined;
console.log('Google auth check failed!');
console.log(e);
}
if(auth.credentials.access_token) {
try {
files = await GoogleActions.listGoogleBrews(auth);
} catch (e) {
files = undefined;
console.log('List Google files failed!');
console.log(e);
}
}
}
const query = { authors: req.account.username, googleId: { $exists: false } };
const brews = await HomebrewModel.find(query, 'id')
.catch((err)=>{
console.log(err);
});
data.uiItems = {
username : req.account.username,
issued : req.account.issued,
mongoCount : brews.length,
googleId : Boolean(req.account.googleId),
authCheck : Boolean(req.account.googleId && auth.credentials.access_token),
fileCount : files?.length || '-'
};
}
req.brew = data;
req.ogMeta = { ...defaultMetaTags,
title : `Account Page`,
description : null,
image : null
};
return next();
}));
const nodeEnv = config.get('node_env');
const isLocalEnvironment = config.get('local_environments').includes(nodeEnv);
// Local only
@@ -287,11 +399,9 @@ if(isLocalEnvironment){
});
}
//Render the page
const templateFn = require('./../client/template.js');
app.use((req, res)=>{
app.use(asyncHandler(async (req, res, next)=>{
// Create configuration object
const configuration = {
local : isLocalEnvironment,
@@ -299,23 +409,26 @@ app.use((req, res)=>{
environment : nodeEnv
};
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'),
config : configuration
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'),
enable_themes : config.get('enable_themes'),
config : configuration,
ogMeta : req.ogMeta
};
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);
});
});
const page = await templateFn('homebrew', title, props)
.catch((err)=>{
console.log(err);
return res.sendStatus(500);
});
if(!page) return;
res.send(page);
}));
//v=====----- Error-Handling Middleware -----=====v//
//Format Errors so all fields will be sent
@@ -339,6 +452,13 @@ app.use((err, req, res, next)=>{
console.error(err);
res.status(status).send(getPureError(err));
});
app.use((req, res)=>{
if(!res.headersSent) {
console.error('Headers have not been sent, responding with a server error.', req.url);
res.status(500).send('An error occurred and the server did not send a response. The error has been logged, please note the time this occurred and report this issue.');
}
});
//^=====--------------------------------------=====^//
module.exports = {

View File

@@ -10,7 +10,7 @@ const Mongoose = require('mongoose');
const getMongoDBURL = (config)=>{
return config.get('mongodb_uri') ||
config.get('mongolab_uri') ||
'mongodb://localhost/homebrewery';
'mongodb://127.0.0.1/homebrewery'; // changed from mongodb://localhost/homebrewery to accommodate versions 16+ of node.
};
const handleConnectionError = (error)=>{

View File

@@ -124,10 +124,8 @@ const GoogleActions = {
title : file.properties.title,
description : file.description,
views : parseInt(file.properties.views),
tags : '',
published : file.properties.published ? file.properties.published == 'true' : false,
systems : [],
thumbnail : file.properties.thumbnail
systems : []
};
});
return brews;
@@ -143,13 +141,11 @@ const GoogleActions = {
description : `${brew.description}`,
properties : {
title : brew.title,
published : brew.published,
version : brew.version,
renderer : brew.renderer,
tags : brew.tags,
shareId : brew.shareId || nanoid(12),
editId : brew.editId || nanoid(12),
pageCount : brew.pageCount,
systems : brew.systems.join(),
thumbnail : brew.thumbnail
renderer : brew.renderer || 'legacy',
isStubbed : true
}
},
media : {
@@ -161,10 +157,9 @@ const GoogleActions = {
console.log('Error saving to google');
console.error(err);
throw (err);
//return res.status(500).send('Error while saving');
});
return (brew);
return true;
},
newGoogleBrew : async (auth, brew)=>{
@@ -178,17 +173,17 @@ const GoogleActions = {
const folderId = await GoogleActions.getGoogleFolder(auth);
const fileMetadata = {
'name' : `${brew.title}.txt`,
'description' : `${brew.description}`,
'parents' : [folderId],
'properties' : { //AppProperties is not accessible
'shareId' : brew.shareId || nanoid(12),
'editId' : brew.editId || nanoid(12),
'title' : brew.title,
'views' : '0',
'pageCount' : brew.pageCount,
'renderer' : brew.renderer || 'legacy',
'thumbnail' : brew.thumbnail || ''
name : `${brew.title}.txt`,
description : `${brew.description}`,
parents : [folderId],
properties : { //AppProperties is not accessible
shareId : brew.shareId || nanoid(12),
editId : brew.editId || nanoid(12),
title : brew.title,
pageCount : brew.pageCount,
renderer : brew.renderer || 'legacy',
isStubbed : true,
version : 1
}
};
@@ -215,26 +210,7 @@ const GoogleActions = {
console.error(err);
});
const newHomebrew = {
text : brew.text,
shareId : fileMetadata.properties.shareId,
editId : fileMetadata.properties.editId,
createdAt : new Date(),
updatedAt : new Date(),
gDrive : true,
googleId : obj.data.id,
pageCount : fileMetadata.properties.pageCount,
title : brew.title,
description : brew.description,
tags : '',
published : brew.published,
renderer : brew.renderer,
authors : [],
systems : []
};
return newHomebrew;
return obj.data.id;
},
getGoogleBrew : async (id, accessId, accessType)=>{
@@ -247,7 +223,6 @@ const GoogleActions = {
.catch((err)=>{
console.log('Error loading from Google');
throw (err);
return;
});
if(obj) {
@@ -257,9 +232,7 @@ const GoogleActions = {
throw ('Share ID does not match');
}
const serviceDrive = google.drive({ version: 'v3' });
const file = await serviceDrive.files.get({
const file = await drive.files.get({
fileId : id,
fields : 'description, properties',
alt : 'media'
@@ -276,7 +249,7 @@ const GoogleActions = {
text : file.data,
description : obj.data.description,
tags : obj.data.properties.tags ? obj.data.properties.tags : '',
tags : obj.data.properties.tags ? obj.data.properties.tags : '',
systems : obj.data.properties.systems ? obj.data.properties.systems.split(',') : [],
authors : [],
published : obj.data.properties.published ? obj.data.properties.published == 'true' : false,
@@ -289,9 +262,7 @@ const GoogleActions = {
views : parseInt(obj.data.properties.views) || 0, //brews with no view parameter will return undefined
version : parseInt(obj.data.properties.version) || 0,
renderer : obj.data.properties.renderer ? obj.data.properties.renderer : 'legacy',
thumbnail : obj.data.properties.thumbnail || '',
gDrive : true,
googleId : id
};
@@ -299,14 +270,11 @@ const GoogleActions = {
}
},
deleteGoogleBrew : async (auth, id)=>{
deleteGoogleBrew : async (auth, id, accessId)=>{
const drive = google.drive({ version: 'v3', auth });
const googleId = id.slice(0, -12);
const accessId = id.slice(-12);
const obj = await drive.files.get({
fileId : googleId,
fileId : id,
fields : 'properties'
})
.catch((err)=>{
@@ -315,11 +283,11 @@ const GoogleActions = {
});
if(obj && obj.data.properties.editId != accessId) {
throw ('Not authorized to delete this Google brew');
throw { status: 403, message: 'Not authorized to delete this Google brew' };
}
await drive.files.update({
fileId : googleId,
fileId : id,
resource : { trashed: true }
})
.catch((err)=>{

View File

@@ -1,3 +1,4 @@
/* eslint-disable max-lines */
const _ = require('lodash');
const HomebrewModel = require('./homebrew.model.js').model;
const router = require('express').Router();
@@ -6,6 +7,7 @@ const GoogleActions = require('./googleActions.js');
const Markdown = require('../shared/naturalcrit/markdown.js');
const yaml = require('js-yaml');
const asyncHandler = require('express-async-handler');
const { nanoid } = require('nanoid');
// const getTopBrews = (cb) => {
// HomebrewModel.find().sort({ views: -1 }).limit(5).exec(function(err, brews) {
@@ -13,6 +15,63 @@ const asyncHandler = require('express-async-handler');
// });
// };
const getId = (req)=>{
// Set the id and initial potential google id, where the google id is present on the existing brew.
let id = req.params.id, googleId = req.body?.googleId;
// If the id is longer than 12, then it's a google id + the edit id. This splits the longer id up.
if(id.length > 12) {
googleId = id.slice(0, -12);
id = id.slice(-12);
}
return { id, googleId };
};
const getBrew = (accessType)=>{
// Create middleware with the accessType passed in as part of the scope
return async (req, res, next)=>{
// Get relevant IDs for the brew
const { id, googleId } = getId(req);
// Try to find the document in the Homebrewery database -- if it doesn't exist, that's fine.
let stub = await HomebrewModel.get(accessType === 'edit' ? { editId: id } : { shareId: id })
.catch((err)=>{
if(googleId) {
console.warn(`Unable to find document stub for ${accessType}Id ${id}`);
} else {
console.warn(err);
}
});
stub = stub?.toObject();
// If there is a google id, try to find the google brew
if(googleId || stub?.googleId) {
let googleError;
const googleBrew = await GoogleActions.getGoogleBrew(googleId || stub?.googleId, id, accessType)
.catch((err)=>{
console.warn(err);
googleError = err;
});
// If we can't find the google brew and there is a google id for the brew, throw an error.
if(!googleBrew) throw googleError;
// Combine the Homebrewery stub with the google brew, or if the stub doesn't exist just use the google brew
stub = stub ? _.assign({ ...excludeStubProps(stub), stubbed: true }, excludeGoogleProps(googleBrew)) : googleBrew;
}
// If after all of that we still don't have a brew, throw an exception
if(!stub) {
throw 'Brew not found in Homebrewery database or Google Drive';
}
if(typeof stub.tags === 'string') {
stub.tags = [];
}
req.brew = stub;
next();
};
};
const mergeBrewText = (brew)=>{
let text = brew.text;
if(brew.style !== undefined) {
@@ -21,7 +80,7 @@ const mergeBrewText = (brew)=>{
`\`\`\`\n\n` +
`${text}`;
}
const metadata = _.pick(brew, ['title', 'description', 'tags', 'systems', 'renderer']);
const metadata = _.pick(brew, ['title', 'description', 'tags', 'systems', 'renderer', 'theme']);
text = `\`\`\`metadata\n` +
`${yaml.dump(metadata)}\n` +
`\`\`\`\n\n` +
@@ -33,15 +92,33 @@ const MAX_TITLE_LENGTH = 100;
const getGoodBrewTitle = (text)=>{
const tokens = Markdown.marked.lexer(text);
return (tokens.find((token)=>token.type == 'heading' || token.type == 'paragraph')?.text || 'No Title')
return (tokens.find((token)=>token.type === 'heading' || token.type === 'paragraph')?.text || 'No Title')
.slice(0, MAX_TITLE_LENGTH);
};
const excludePropsFromUpdate = (brew)=>{
// Remove undesired properties
const propsToExclude = ['views', 'lastViewed'];
const modified = _.clone(brew);
const propsToExclude = ['_id', 'views', 'lastViewed', 'editId', 'shareId', 'googleId'];
for (const prop of propsToExclude) {
delete brew[prop];
delete modified[prop];
}
return modified;
};
const excludeGoogleProps = (brew)=>{
const modified = _.clone(brew);
const propsToExclude = ['tags', 'systems', 'published', 'authors', 'owner', 'views', 'thumbnail'];
for (const prop of propsToExclude) {
delete modified[prop];
}
return modified;
};
const excludeStubProps = (brew)=>{
const propsToExclude = ['text', 'textBin', 'renderer', 'pageCount', 'version'];
for (const prop of propsToExclude) {
brew[prop] = undefined;
}
return brew;
};
@@ -55,33 +132,17 @@ const beforeNewSave = (account, brew)=>{
brew.text = mergeBrewText(brew);
};
const newLocalBrew = async (brew)=>{
const newHomebrew = new HomebrewModel(brew);
// Compress brew text to binary before saving
newHomebrew.textBin = zlib.deflateRawSync(newHomebrew.text);
// Delete the non-binary text field since it's not needed anymore
newHomebrew.text = undefined;
let saved = await newHomebrew.save()
.catch((err)=>{
console.error(err, err.toString(), err.stack);
throw `Error while creating new brew, ${err.toString()}`;
});
saved = saved.toObject();
saved.gDrive = false;
return saved;
};
const newGoogleBrew = async (account, brew, res)=>{
const oAuth2Client = GoogleActions.authCheck(account, res);
return await GoogleActions.newGoogleBrew(oAuth2Client, brew);
const newBrew = excludeGoogleProps(brew);
return await GoogleActions.newGoogleBrew(oAuth2Client, newBrew);
};
const newBrew = async (req, res)=>{
const brew = req.body;
const { transferToGoogle } = req.query;
const { saveToGoogle } = req.query;
delete brew.editId;
delete brew.shareId;
@@ -89,148 +150,189 @@ const newBrew = async (req, res)=>{
beforeNewSave(req.account, brew);
let saved;
if(transferToGoogle) {
saved = await newGoogleBrew(req.account, brew, res)
const newHomebrew = new HomebrewModel(brew);
newHomebrew.editId = nanoid(12);
newHomebrew.shareId = nanoid(12);
let googleId, saved;
if(saveToGoogle) {
googleId = await newGoogleBrew(req.account, newHomebrew, res)
.catch((err)=>{
res.status(err.status || err.response.status).send(err.message || err);
console.error(err);
res.status(err?.status || err?.response?.status || 500).send(err?.message || err);
});
if(!googleId) return;
excludeStubProps(newHomebrew);
newHomebrew.googleId = googleId;
} else {
saved = await newLocalBrew(brew)
.catch((err)=>{
res.status(500).send(err);
});
// Compress brew text to binary before saving
newHomebrew.textBin = zlib.deflateRawSync(newHomebrew.text);
// Delete the non-binary text field since it's not needed anymore
newHomebrew.text = undefined;
}
saved = await newHomebrew.save()
.catch((err)=>{
console.error(err, err.toString(), err.stack);
throw `Error while creating new brew, ${err.toString()}`;
});
if(!saved) return;
return res.status(200).send(saved);
saved = saved.toObject();
res.status(200).send(saved);
};
const updateBrew = async (req, res)=>{
let brew = excludePropsFromUpdate(req.body);
const { transferToGoogle, transferFromGoogle } = req.query;
// Initialize brew from request and body, destructure query params, set a constant for the google id, and set the initial value for the after-save method
let brew = _.assign(req.brew, excludePropsFromUpdate(req.body));
const { saveToGoogle, removeFromGoogle } = req.query;
const googleId = brew.googleId;
let afterSave = async ()=>true;
let saved;
if(brew.googleId && transferFromGoogle) {
beforeNewSave(req.account, brew);
brew.text = mergeBrewText(brew);
saved = await newLocalBrew(brew)
.catch((err)=>{
console.error(err);
res.status(500).send(err);
});
if(!saved) return;
if(brew.googleId && removeFromGoogle) {
// If the google id exists and we're removing it from google, set afterSave to delete the google brew and mark the brew's google id as undefined
afterSave = async ()=>{
return await deleteGoogleBrew(req.account, googleId, brew.editId, res)
.catch((err)=>{
console.error(err);
res.status(err?.status || err?.response?.status || 500).send(err.message || err);
});
};
await deleteGoogleBrew(req.account, `${brew.googleId}${brew.editId}`, res)
brew.googleId = undefined;
} else if(!brew.googleId && saveToGoogle) {
// If we don't have a google id and the user wants to save to google, create the google brew and set the google id on the brew
brew.googleId = await newGoogleBrew(req.account, excludeGoogleProps(brew), res)
.catch((err)=>{
console.error(err);
res.status(err.status || err.response.status).send(err.message || err);
});
} else if(!brew.googleId && transferToGoogle) {
saved = await newGoogleBrew(req.account, brew, res)
.catch((err)=>{
console.error(err);
res.status(err.status || err.response.status).send(err.message || err);
});
if(!saved) return;
await deleteLocalBrew(req.account, brew.editId)
.catch((err)=>{
console.error(err);
res.status(err.status).send(err.message);
});
if(!brew.googleId) return;
} else if(brew.googleId) {
brew.text = mergeBrewText(brew);
saved = await GoogleActions.updateGoogleBrew(brew)
// If the google id exists and no other actions are being performed, update the google brew
const updated = await GoogleActions.updateGoogleBrew(excludeGoogleProps(brew))
.catch((err)=>{
console.error(err);
res.status(err.response?.status || 500).send(err);
res.status(err?.response?.status || 500).send(err);
});
if(!updated) return;
}
if(brew.googleId) {
// If the google id exists after all those actions, exclude the props that are stored in google and aren't needed for rendering the brew items
excludeStubProps(brew);
} else {
const dbBrew = await HomebrewModel.get({ editId: req.params.id })
.catch((err)=>{
console.error(err);
return res.status(500).send('Error while saving');
});
brew = _.merge(dbBrew, brew);
brew.text = mergeBrewText(brew);
// Compress brew text to binary before saving
brew.textBin = zlib.deflateRawSync(brew.text);
// Delete the non-binary text field since it's not needed anymore
brew.text = undefined;
brew.updatedAt = new Date();
if(req.account) {
brew.authors = _.uniq(_.concat(brew.authors, req.account.username));
}
brew.markModified('authors');
brew.markModified('systems');
saved = await brew.save();
}
brew.updatedAt = new Date();
if(req.account) {
brew.authors = _.uniq(_.concat(brew.authors, req.account.username));
}
// Fetch the brew from the database again (if it existed there to begin with), and assign the existing brew to it
brew = _.assign(await HomebrewModel.findOne({ _id: brew._id }), brew);
if(!brew.markModified) {
// If it wasn't in the database, create a new db brew
brew = new HomebrewModel(brew);
}
brew.markModified('authors');
brew.markModified('systems');
// Save the database brew
const saved = await brew.save()
.catch((err)=>{
console.error(err);
res.status(err.status || 500).send(err.message || 'Unable to save brew to Homebrewery database');
});
if(!saved) return;
// Call and wait for afterSave to complete
const after = await afterSave();
if(!after) return;
if(!res.headersSent) return res.status(200).send(saved);
res.status(200).send(saved);
};
const deleteBrew = async (req, res)=>{
if(req.params.id.length > 12) {
const deleted = await deleteGoogleBrew(req.account, req.params.id, res)
.catch((err)=>{
res.status(500).send(err);
});
if(deleted) return res.status(200).send();
} else {
const deleted = await deleteLocalBrew(req.account, req.params.id)
.catch((err)=>{
res.status(err.status).send(err.message);
});
if(deleted) return res.status(200).send(deleted);
return res.status(200).send();
}
};
const deleteLocalBrew = async (account, id)=>{
const brew = await HomebrewModel.findOne({ editId: id });
if(!brew) {
throw { status: 404, message: 'Can not find homebrew with that id' };
}
if(account) {
// Remove current user as author
brew.authors = _.pull(brew.authors, account.username);
brew.markModified('authors');
}
if(brew.authors.length === 0) {
// Delete brew if there are no authors left
await brew.remove()
.catch((err)=>{
console.error(err);
throw { status: 500, message: 'Error while removing' };
});
} else {
// Otherwise, save the brew with updated author list
return await brew.save()
.catch((err)=>{
throw { status: 500, message: err };
});
}
};
const deleteGoogleBrew = async (account, id, res)=>{
const deleteGoogleBrew = async (account, id, editId, res)=>{
const auth = await GoogleActions.authCheck(account, res);
await GoogleActions.deleteGoogleBrew(auth, id);
await GoogleActions.deleteGoogleBrew(auth, id, editId);
return true;
};
const deleteBrew = async (req, res, next)=>{
// Delete an orphaned stub if its Google brew doesn't exist
try {
await getBrew('edit')(req, res, ()=>{});
} catch (err) {
const { id, googleId } = getId(req);
console.warn(`No google brew found for id ${googleId}, the stub with id ${id} will be deleted.`);
await HomebrewModel.deleteOne({ editId: id });
return next();
}
let brew = req.brew;
const { googleId, editId } = brew;
const account = req.account;
const isOwner = account && (brew.authors.length === 0 || brew.authors[0] === account.username);
// If the user is the owner and the file is saved to google, mark the google brew for deletion
const shouldDeleteGoogleBrew = googleId && isOwner;
if(brew._id) {
brew = _.assign(await HomebrewModel.findOne({ _id: brew._id }), brew);
if(account) {
// Remove current user as author
brew.authors = _.pull(brew.authors, account.username);
brew.markModified('authors');
}
if(brew.authors.length === 0) {
// Delete brew if there are no authors left
await brew.remove()
.catch((err)=>{
console.error(err);
throw { status: 500, message: 'Error while removing' };
});
} else {
if(shouldDeleteGoogleBrew) {
// When there are still authors remaining, we delete the google brew but store the full brew in the Homebrewery database
brew.googleId = undefined;
brew.textBin = zlib.deflateRawSync(brew.text);
brew.text = undefined;
}
// Otherwise, save the brew with updated author list
await brew.save()
.catch((err)=>{
throw { status: 500, message: err };
});
}
}
if(shouldDeleteGoogleBrew) {
const deleted = await deleteGoogleBrew(account, googleId, editId, res)
.catch((err)=>{
console.error(err);
res.status(500).send(err);
});
if(!deleted) return;
}
res.status(204).send();
};
router.post('/api', asyncHandler(newBrew));
router.put('/api/:id', asyncHandler(updateBrew));
router.put('/api/update/:id', asyncHandler(updateBrew));
router.put('/api/:id', asyncHandler(getBrew('edit')), asyncHandler(updateBrew));
router.put('/api/update/:id', asyncHandler(getBrew('edit')), asyncHandler(updateBrew));
router.delete('/api/:id', asyncHandler(deleteBrew));
router.get('/api/remove/:id', asyncHandler(deleteBrew));
module.exports = router;
module.exports = {
homebrewApi : router,
getBrew
};

View File

@@ -6,13 +6,14 @@ const zlib = require('zlib');
const HomebrewSchema = mongoose.Schema({
shareId : { type: String, default: ()=>{return nanoid(12);}, index: { unique: true } },
editId : { type: String, default: ()=>{return nanoid(12);}, index: { unique: true } },
googleId : { type: String },
title : { type: String, default: '' },
text : { type: String, default: '' },
textBin : { type: Buffer },
pageCount : { type: Number, default: 1 },
description : { type: String, default: '' },
tags : { type: String, default: '' },
tags : [String],
systems : [String],
renderer : { type: String, default: '' },
authors : [String],

View File

@@ -229,6 +229,15 @@ const CodeEditor = createClass({
this.codeMirror.replaceSelection('\n\\page\n\n', 'end');
},
injectText : function(injectText, overwrite=true) {
const cm = this.codeMirror;
if(!overwrite) {
cm.setCursor(cm.getCursor('from'));
}
cm.replaceSelection(injectText, 'end');
cm.focus();
},
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');
@@ -355,12 +364,20 @@ const CodeEditor = createClass({
let text = '';
let currentLine = from.line;
const maxLength = 50;
let foldPreviewText = '';
while (currentLine <= to.line && text.length <= maxLength) {
text += this.codeMirror.getLine(currentLine);
if(currentLine < to.line)
text += ' ';
currentLine += 1;
const currentText = this.codeMirror.getLine(currentLine);
currentLine++;
if(currentText[0] == '#'){
foldPreviewText = currentText;
break;
}
if(!foldPreviewText && currentText != '\n') {
foldPreviewText = currentText;
}
}
text = foldPreviewText || `Lines ${from.line+1}-${to.line+1}`;
text = text.trim();
if(text.length > maxLength)

View File

@@ -13,7 +13,8 @@
font-family: inherit;
text-shadow: none;
font-weight: 600;
}
color: grey;
}
.sourceMoveFlash .CodeMirror-line{
animation-name: sourceMoveAnimation;

View File

@@ -32,7 +32,7 @@ const mustacheSpans = {
start(src) { return src.match(/{{[^{]/)?.index; }, // Hint to Marked.js to stop and check for a match
tokenizer(src, tokens) {
const completeSpan = /^{{[^\n]*}}/; // Regex for the complete token
const inlineRegex = /{{(?::(?:"[\w,\-()#%. ]*"|[\w\,\-()#%.]*)|[^"'{}\s])*\s*|}}/g;
const inlineRegex = /{{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1 *|}}/g;
const match = completeSpan.exec(src);
if(match) {
//Find closing delimiter
@@ -82,7 +82,7 @@ const mustacheDivs = {
start(src) { return src.match(/\n *{{[^{]/m)?.index; }, // Hint to Marked.js to stop and check for a match
tokenizer(src, tokens) {
const completeBlock = /^ *{{[^\n}]* *\n.*\n *}}/s; // Regex for the complete token
const blockRegex = /^ *{{(?::(?:"[\w,\-()#%. ]*"|[\w\,\-()#%.]*)|[^"'{}\s])* *$|^ *}}$/gm;
const blockRegex = /^ *{{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1 *$|^ *}}$/gm;
const match = completeBlock.exec(src);
if(match) {
//Find closing delimiter
@@ -130,7 +130,7 @@ const mustacheInjectInline = {
level : 'inline',
start(src) { return src.match(/ *{[^{\n]/)?.index; }, // Hint to Marked.js to stop and check for a match
tokenizer(src, tokens) {
const inlineRegex = /^ *{((?::(?:"[\w,\-()#%. ]*"|[\w\,\-()#%.]*)|[^"'{}\s])*)}/g;
const inlineRegex = /^ *{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1}/g;
const match = inlineRegex.exec(src);
if(match) {
const lastToken = tokens[tokens.length - 1];
@@ -165,7 +165,7 @@ const mustacheInjectBlock = {
level : 'block',
start(src) { return src.match(/\n *{[^{\n]/m)?.index; }, // Hint to Marked.js to stop and check for a match
tokenizer(src, tokens) {
const inlineRegex = /^ *{((?::(?:"[\w,\-()#%. ]*"|[\w\,\-()#%.]*)|[^"'{}\s])*)}/ym;
const inlineRegex = /^ *{(?=((?::(?:"[\w,\-()#%. ]*"|[\w\-()#%.]*)|[^"':{}\s]*)*))\1}/ym;
const match = inlineRegex.exec(src);
if(match) {
const lastToken = tokens[tokens.length - 1];

View File

@@ -73,18 +73,35 @@ const Nav = {
dropdown : createClass({
displayName : 'Nav.dropdown',
getDefaultProps : function() {
return {
trigger : 'hover'
};
},
getInitialState : function() {
return {
showDropdown : false
};
},
componentDidMount : function() {
if(this.props.trigger == 'click')
document.addEventListener('click', this.handleClickOutside);
},
componentWillUnmount : function() {
if(this.props.trigger == 'click')
document.removeEventListener('click', this.handleClickOutside);
},
handleClickOutside : function(e){
// Close dropdown when clicked outside
if(this.refs.dropdown && !this.refs.dropdown.contains(e.target)) {
this.handleDropdown(false);
}
},
handleDropdown : function(show){
this.setState({
showDropdown : show
});
},
renderDropdown : function(dropdownChildren){
if(!this.state.showDropdown) return null;
@@ -94,7 +111,6 @@ const Nav = {
</div>
);
},
render : function () {
const dropdownChildren = React.Children.map(this.props.children, (child, i)=>{
// Ignore the first child
@@ -102,10 +118,12 @@ const Nav = {
return child;
});
return (
<div className='navDropdownContainer'
onMouseEnter={()=>this.handleDropdown(true)}
onMouseLeave={()=>this.handleDropdown(false)}>
{this.props.children[0]}
<div className={`navDropdownContainer ${this.props.className}`}
ref='dropdown'
onMouseEnter={this.props.trigger == 'hover' ? ()=>{this.handleDropdown(true);} : undefined}
onClick= {this.props.trigger == 'click' ? ()=>{this.handleDropdown(true);} : undefined}
onMouseLeave={this.props.trigger == 'hover' ? ()=>{this.handleDropdown(false);} : undefined}>
{this.props.children[0] || this.props.children /*children is not an array when only one child*/}
{this.renderDropdown(dropdownChildren)}
</div>
);

View File

@@ -50,7 +50,7 @@ nav{
}
}
.navItem{
#backgroundColors;
#backgroundColorsHover;
.animate(background-color);
padding : 8px 12px;
cursor : pointer;

View File

@@ -69,7 +69,8 @@ const SplitPane = createClass({
this.setState({ isDragging: false });
},
handleDown : function(){
handleDown : function(e){
e.preventDefault();
this.setState({ isDragging: true });
//this.unFocus()
},

View File

@@ -23,6 +23,29 @@
@grey : #7F8C8D;
#backgroundColors {
&.tealLight{ background-color : @tealLight };
&.teal{ background-color : @teal };
&.greenLight{ background-color : @greenLight };
&.green{ background-color : @green };
&.blueLight{ background-color : @blueLight };
&.blue{ background-color : @blue };
&.purpleLight{ background-color : @purpleLight };
&.purple{ background-color : @purple };
&.steelLight{ background-color : @steelLight };
&.steel{ background-color : @steel };
&.yellowLight{ background-color : @yellowLight };
&.yellow{ background-color : @yellow };
&.orangeLight{ background-color : @orangeLight };
&.orange{ background-color : @orange };
&.redLight{ background-color : @redLight };
&.red{ background-color : @red };
&.silverLight{ background-color : @silverLight };
&.silver{ background-color : @silver };
&.greyLight{ background-color : @greyLight };
&.grey{ background-color : @grey };
}
#backgroundColorsHover {
&.tealLight:hover{ background-color : @tealLight };
&.teal:hover{ background-color : @teal };
&.greenLight:hover{ background-color : @greenLight };

View File

@@ -1 +1,27 @@
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{border:0;font-size:100%;font:inherit;vertical-align:baseline;margin:0;padding:0}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:none}table{border-collapse:collapse;border-spacing:0}
:where(html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video){
border:0;font-size:100%;font:inherit;vertical-align:baseline;margin:0;padding:0
}
:where(article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section){
display:block
}
:where(body){
line-height:1
}
:where(ol,ul){
list-style:none
}
:where(blockquote,q){
quotes:none
}
:where(blockquote:before,blockquote:after,q:before,q:after){
content:none
}
:where(table){
border-collapse:collapse;border-spacing:0
}

View File

@@ -9,8 +9,8 @@ describe('Tests for static pages', ()=>{
return app.get('/').expect(200);
});
it('Home page v3 works', ()=>{
return app.get('/v3_preview').expect(200);
it('Home page legacy works', ()=>{
return app.get('/legacy').expect(200);
});
it('Changelog page works', ()=>{

View File

@@ -0,0 +1,5 @@
{
"name" : "5e PHB",
"renderer" : "legacy",
"baseTheme" : false
}

View File

@@ -1,12 +1,12 @@
/* eslint-disable max-lines */
const MagicGen = require('./magic.gen.js');
const ClassTableGen = require('./classtable.gen.js');
const MonsterBlockGen = require('./monsterblock.gen.js');
const ClassFeatureGen = require('./classfeature.gen.js');
const CoverPageGen = require('./coverpage.gen.js');
const TableOfContentsGen = require('./tableOfContents.gen.js');
const dedent = require('dedent-tabs').default;
const MagicGen = require('./snippets/magic.gen.js');
const ClassTableGen = require('./snippets/classtable.gen.js');
const MonsterBlockGen = require('./snippets/monsterblock.gen.js');
const ClassFeatureGen = require('./snippets/classfeature.gen.js');
const CoverPageGen = require('./snippets/coverpage.gen.js');
const TableOfContentsGen = require('./snippets/tableOfContents.gen.js');
const dedent = require('dedent-tabs').default;
module.exports = [

View File

@@ -8,6 +8,7 @@ module.exports = function(classname){
classname = classname.toLowerCase();
const hitDie = _.sample([4, 6, 8, 10, 12]);
const spellSkill = _.sample(['Wisdom', 'Charisma', 'Intelligence']);
const abilityList = ['Strength', 'Dexerity', 'Constitution', 'Wisdom', 'Charisma', 'Intelligence'];
const skillList = ['Acrobatics ', 'Animal Handling', 'Arcana', 'Athletics', 'Deception', 'History', 'Insight', 'Intimidation', 'Investigation', 'Medicine', 'Nature', 'Perception', 'Performance', 'Persuasion', 'Religion', 'Sleight of Hand', 'Stealth', 'Survival'];
@@ -26,12 +27,21 @@ module.exports = function(classname){
'___',
`- **Armor:** ${_.sampleSize(['Light armor', 'Medium armor', 'Heavy armor', 'Shields'], _.random(0, 3)).join(', ') || 'None'}`,
`- **Weapons:** ${_.sampleSize(['Squeegee', 'Rubber Chicken', 'Simple weapons', 'Martial weapons'], _.random(0, 2)).join(', ') || 'None'}`,
`- **Tools:** ${_.sampleSize(['Artian\'s tools', 'one musical instrument', 'Thieve\'s tools'], _.random(0, 2)).join(', ') || 'None'}`,
`- **Tools:** ${_.sampleSize(['Artisan\'s tools', 'one musical instrument', 'Thieves\' tools'], _.random(0, 2)).join(', ') || 'None'}`,
'',
'___',
`- **Saving Throws:** ${_.sampleSize(abilityList, 2).join(', ')}`,
`- **Skills:** Choose two from ${_.sampleSize(skillList, _.random(4, 6)).join(', ')}`,
'',
'#### Spellcasting Ability',
'',
`<div style=text-align:center>`,
'___',
`- **Spell save DC** = ${_.sample([6, 8, 10])} + your proficiency bonus + your ${spellSkill} modifier`,
'',
`- **Spell attack modifier** = your proficiency bonus + your ${spellSkill} modifier`,
`</div>`,
'',
'#### Equipment',
'You start with the following equipment, in addition to the equipment granted by your background:',
'- *(a)* a martial weapon and a shield or *(b)* two martial weapons',

View File

@@ -58,6 +58,7 @@ body {
text-rendering : optimizeLegibility;
page-break-before : always;
page-break-after : always;
contain : size;
//*****************************
// * BASE
// *****************************/

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

@@ -0,0 +1,6 @@
{
"name" : "5e DMG",
"renderer" : "V3",
"baseTheme" : "5ePHB",
"baseSnippets" : "5ePHB"
}

View File

@@ -0,0 +1,4 @@
/* eslint-disable max-lines */
module.exports = [
];

View File

@@ -0,0 +1,19 @@
:root {
//Colors
--HB_Color_Accent : #EBCEC3; // Salmon
--HB_Color_Footnotes : #5C5C5C; // Dark gray
}
.page {
background-image : url(/assets/DMG_background.png);
background-size : cover;
&:after {
background-image : url(/assets/DMG_footerAccent.png);
height: 58px;
}
.footnote {
bottom : 40px;
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -0,0 +1,6 @@
{
"name" : "5e PHB",
"renderer" : "V3",
"baseTheme" : false,
"baseSnippets" : false
}

264
themes/V3/5ePHB/snippets.js Normal file
View File

@@ -0,0 +1,264 @@
/* eslint-disable max-lines */
const MagicGen = require('./snippets/magic.gen.js');
const ClassTableGen = require('./snippets/classtable.gen.js');
const MonsterBlockGen = require('./snippets/monsterblock.gen.js');
const ClassFeatureGen = require('./snippets/classfeature.gen.js');
const CoverPageGen = require('./snippets/coverpage.gen.js');
const TableOfContentsGen = require('./snippets/tableOfContents.gen.js');
const dedent = require('dedent-tabs').default;
module.exports = [
{
groupName : 'Text Editor',
icon : 'fas fa-pencil-alt',
view : 'text',
snippets : [
{
name : 'Page Number',
icon : 'fas fa-bookmark',
gen : '{{pageNumber 1}}\n{{footnote PART 1 | SECTION NAME}}\n\n'
},
{
name : 'Auto-incrementing Page Number',
icon : 'fas fa-sort-numeric-down',
gen : '{{pageNumber,auto}}\n{{footnote PART 1 | SECTION NAME}}\n\n'
},
{
name : 'Table of Contents',
icon : 'fas fa-book',
gen : TableOfContentsGen
}
]
},
{
groupName : 'Style Editor',
icon : 'fas fa-pencil-alt',
view : 'style',
snippets : [
{
name : 'Remove Drop Cap',
icon : 'fas fa-remove-format',
gen : dedent`/* Removes Drop Caps */
.page h1+p:first-letter {
all: unset;
}\n\n
/* Removes Small-Caps in first line */
.page h1+p:first-line {
all: unset;
}`
},
{
name : 'Tweak Drop Cap',
icon : 'fas fa-sliders-h',
gen : dedent`/* Drop Cap settings */
.page h1 + p::first-letter {
font-family: SolberaImitationRemake;
font-size: 3.5cm;
background-image: linear-gradient(-45deg, #322814, #998250, #322814);
line-height: 1em;
}\n\n`
}
]
},
/*********************** IMAGES *******************/
{
groupName : 'Images',
icon : 'fas fa-images',
view : 'text',
snippets : [
{
name : 'Image',
icon : 'fas fa-image',
gen : dedent`
![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:10px,margin-bottom:-30px
##### Cat Warrior
[Kyoung Hwan Kim](https://www.artstation.com/tahra)
}}`
},
{
name : 'Background Image',
icon : 'fas fa-tree',
gen : dedent`
![homebrew mug](http://i.imgur.com/hMna6G0.png) {position:absolute,top:50px,right:30px,width:280px}
{{artist,top:80px,right:30px
##### Homebrew Mug
[naturalcrit](https://homebrew.naturalcrit.com)
}}`
},
{
name : 'Watermark',
icon : 'fas fa-id-card',
gen : dedent`
{{watermark Homebrewery}}\n`
},
]
},
/************************* PHB ********************/
{
groupName : 'PHB',
icon : 'fas fa-book',
view : 'text',
snippets : [
{
name : 'Spell',
icon : 'fas fa-magic',
gen : MagicGen.spell,
},
{
name : 'Spell List',
icon : 'fas fa-scroll',
gen : MagicGen.spellList,
},
{
name : 'Class Feature',
icon : 'fas fa-mask',
gen : ClassFeatureGen,
},
{
name : 'Note',
icon : 'fas fa-sticky-note',
gen : function(){
return dedent`
{{note
##### Time to Drop Knowledge
Use notes to point out some interesting information.
**Tables and lists** both work within a note.
}}
\n`;
},
},
{
name : 'Descriptive Text Box',
icon : 'fas fa-comment-alt',
gen : function(){
return dedent`
{{descriptive
##### Time to Drop Knowledge
Use descriptive boxes to highlight text that should be read aloud.
**Tables and lists** both work within a descriptive box.
}}
\n`;
},
},
{
name : 'Monster Stat Block (unframed)',
icon : 'fas fa-paw',
gen : MonsterBlockGen.monster('monster', 2),
},
{
name : 'Monster Stat Block',
icon : 'fas fa-spider',
gen : MonsterBlockGen.monster('monster,frame', 2),
},
{
name : 'Wide Monster Stat Block',
icon : 'fas fa-dragon',
gen : MonsterBlockGen.monster('monster,frame,wide', 4),
},
{
name : 'Cover Page',
icon : 'fas fa-file-word',
gen : CoverPageGen,
},
{
name : 'Magic Item',
icon : 'fas fa-hat-wizard',
gen : MagicGen.item,
},
{
name : 'Artist Credit',
icon : 'fas fa-signature',
gen : function(){
return dedent`
{{artist,top:90px,right:30px
##### Starry Night
[Van Gogh](https://www.vangoghmuseum.nl/en)
}}
\n`;
},
},
]
},
/********************* TABLES *********************/
{
groupName : 'Tables',
icon : 'fas fa-table',
view : 'text',
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'),
}
]
},
/**************** PAGE *************/
{
groupName : 'Print',
icon : 'fas fa-print',
view : 'style',
snippets : [
{
name : 'Ink Friendly',
icon : 'fas fa-tint',
gen : dedent`
/* Ink Friendly */
*:is(.page,.monster,.note,.descriptive) {
background : white !important;
filter : drop-shadow(0px 0px 3px #888) !important;
}
.page img {
visibility : hidden;
}\n\n`
},
]
}
];

View File

@@ -9,6 +9,7 @@ module.exports = function(classname){
classname = classname.toLowerCase();
const hitDie = _.sample([4, 6, 8, 10, 12]);
const spellSkill = _.sample(['Wisdom', 'Charisma', 'Intelligence']);
const abilityList = ['Strength', 'Dexerity', 'Constitution', 'Wisdom', 'Charisma', 'Intelligence'];
const skillList = ['Acrobatics', 'Animal Handling', 'Arcana', 'Athletics', 'Deception', 'History', 'Insight', 'Intimidation', 'Investigation', 'Medicine', 'Nature', 'Perception', 'Performance', 'Persuasion', 'Religion', 'Sleight of Hand', 'Stealth', 'Survival'];
@@ -16,27 +17,33 @@ module.exports = function(classname){
return dedent`
## Class Features
As a ${classname}, you gain the following class features
#### Hit Points
As a ${classname}, you gain the following class features
#### Hit Points
**Hit Dice:** :: 1d${hitDie} per ${classname} level
**Hit Points at 1st Level:** :: ${hitDie} + your Constitution modifier
**Hit Points at Higher Levels:** :: 1d${hitDie} (or ${hitDie/2 + 1}) + your Constitution modifier per ${classname} level after 1st
#### Proficiencies
**Armor:** :: ${_.sampleSize(['Light armor', 'Medium armor', 'Heavy armor', 'Shields'], _.random(0, 3)).join(', ') || 'None'}
**Weapons:** :: ${_.sampleSize(['Squeegee', 'Rubber Chicken', 'Simple weapons', 'Martial weapons'], _.random(0, 2)).join(', ') || 'None'}
**Tools:** :: ${_.sampleSize(['Artian\'s tools', 'one musical instrument', 'Thieve\'s tools'], _.random(0, 2)).join(', ') || 'None'}
**Tools:** :: ${_.sampleSize(['Artisan\'s tools', 'one musical instrument', 'Thieves\' tools'], _.random(0, 2)).join(', ') || 'None'}
**Saving Throws:** :: ${_.sampleSize(abilityList, 2).join(', ')}
**Skills:** :: Choose two from ${_.sampleSize(skillList, _.random(4, 6)).join(', ')}
#### Spellcasting Ability
{{text-align:center
**Spell save DC**:: = ${_.sample([6, 8, 10])} + your proficiency bonus + your ${spellSkill} modifier
**Spell attack modifier**:: = your proficiency bonus + your ${spellSkill} modifier
}}
#### Equipment
You start with the following equipment, in addition to the equipment granted by your background:
- *(a)* a martial weapon and a shield or *(b)* two martial weapons
- *(a)* five javelins or *(b)* any simple melee weapon
- ${_.sample(['10 lint fluffs', '1 button', 'a cherished lost sock'])}
`;
};

View File

@@ -1,15 +1,19 @@
@import (less) './themes/fonts/5e/fonts.less';
@import (less) './themes/assets/assets.less';
//Colors
@background : #EEE5CE; // Light parchment
@noteGreen : #e0e5c1; // Pastel green
@headerUnderline : #c9ad6a; // Gold
@horizontalRule : #9c2b1b; // Maroon
@headerText : #58180D; // Dark maroon
@monsterStatBackground : #EEDBAB; // Light orange parchment
@captionText : #766649; // Brown
@watercolorStain : #BBAD82; // Light brown
:root {
//Colors
--HB_Color_Background : #EEE5CE; // Light parchment
--HB_Color_Accent : #E0E5C1; // Pastel green
--HB_Color_HeaderUnderline : #C0AD6A; // Gold
--HB_Color_HorizontalRule : #9C2B1B; // Maroon
--HB_Color_HeaderText : #58180D; // Dark Maroon
--HB_Color_MonsterStatBackground : #F2E5B5; // Light orange parchment
--HB_Color_CaptionText : #766649; // Brown
--HB_Color_WatercolorStain : #BBAD82; // Light brown
--HB_Color_Footnotes : #C9AD6A; // Gold
}
@page { margin: 0; }
body {
counter-reset : phb-page-numbers;
@@ -65,7 +69,7 @@ body {
overflow : hidden;
height : 279.4mm;
width : 215.9mm;
background-color : @background;
background-color : var(--HB_Color_Background);
background-image : @backgroundImage;
padding : 1.4cm 1.9cm 1.7cm;
font-family : BookInsanityRemake;
@@ -73,9 +77,12 @@ body {
text-rendering : optimizeLegibility;
page-break-before : always;
page-break-after : always;
}
//*****************************
// * BASE
// *****************************/
.page{
p{
overflow-wrap : break-word; //TODO: MAKE ALL MARGINS TOP-ONLY. USE * + * STYLE SELECTORS
display : block;
@@ -131,12 +138,13 @@ body {
h1,h2,h3,h4{
font-family : MrEavesRemake;
font-weight : 800;
color : @headerText;
color : var(--HB_Color_HeaderText);
}
h1{
margin-bottom : 0.18cm; //Margin-bottom only because this is WIDE
column-span : all;
font-size : 0.89cm;
line-height : 1em;
-webkit-column-span : all;
-moz-column-span : all;
&+p::first-letter{
@@ -150,9 +158,9 @@ body {
padding-bottom : 2px;
margin-bottom : -20px;
background-image : linear-gradient(-45deg, #322814, #998250, #322814);
background-clip : text;
-webkit-background-clip : text;
color : rgba(0, 0, 0, 0);
background-clip : text;
-webkit-background-clip : text;
color : rgba(0, 0, 0, 0);
}
&+p::first-line{
font-variant : small-caps;
@@ -168,14 +176,26 @@ body {
//margin-top : -0.1cm; //Font is misaligned. Shift up slightly
//margin-bottom : 0.1cm;
font-size : 0.575cm;
border-bottom : 2px solid @headerUnderline;
border-bottom : 2px solid var(--HB_Color_HeaderUnderline);;
line-height : 0.995em; //Font is misaligned. Shift up slightly
& + * {
margin-top: 0.17cm;
}
}
* + h3 {
margin-top : 0.155cm; //(0.325 - 0.17)
}
h4{
//margin-top : -0.02cm; //Font is misaligned. Shift up slightly
//margin-bottom : 0.02cm;
font-size : 0.458cm;
line-height : 0.971em; //Font is misaligned. Shift up slightly
& + * {
margin-top: 0.09cm;
}
}
* + h4 {
margin-top : 0.235cm; //(0.325 - 0.09)
}
h5{
//margin-top : -0.02cm; //Font is misaligned. Shift up slightly
@@ -194,6 +214,7 @@ body {
table{
.useSansSerif();
width : 100%;
line-height : 16px;
& + * {
margin-top : 0.325cm;
}
@@ -202,16 +223,20 @@ body {
font-weight : 800;
th{
vertical-align : bottom;
padding : 0.14em 0.4em;
//padding : 0.14em 0.4em;
padding : 0px 1.5px; // Both of these are temporary, just to force
//line-height : 16px; // PDF to render at same height until Chrome 108
}
}
tbody{
tr{
td{
padding : 0.14em 0.4em;
//padding : 0.14em 0.4em;
padding : 0px 1.5px; // Both of these are temporary, just to force
//line-height : 16px; // PDF to render at same height until Chrome 108
}
&:nth-child(odd){
background-color : @noteGreen;
background-color : var(--HB_Color_Accent);
}
}
}
@@ -221,7 +246,7 @@ body {
// *****************************/
.note{
.useSansSerif();
background-color : @noteGreen;
background-color : var(--HB_Color_Accent);
border-style : solid;
border-width : 1px;
border-image : @noteBorderImage 12 stretch;
@@ -287,7 +312,7 @@ body {
text-align : center;
font-family : WalterTurncoat;
font-size : 0.27cm;
color : @captionText;
color : var(--HB_Color_CaptionText);
p, p + p {
margin : unset;
text-indent : unset;
@@ -340,7 +365,7 @@ body {
mask-size : contain;
mask-repeat : no-repeat;
background-size : cover;
background-color : @watercolorStain; /*default color*/
background-color : var(--HB_Color_WatercolorStain); /*default color*/
--wc : @watercolor1; /*default image*/
z-index : -2;
}
@@ -366,7 +391,7 @@ body {
&.frame {
border-style : solid;
border-width : 7px 6px;
background-color : @monsterStatBackground;
background-color : var(--HB_Color_MonsterStatBackground);
background-image : @monsterBlockBackground;
border-image : @monsterBorderImage 14 round;
border-image-outset : 0px 2px;
@@ -397,7 +422,7 @@ body {
font-family : ScalySansRemake;
font-weight : 800;
font-variant : small-caps;
border-bottom : 2px solid @headerText;
border-bottom : 2px solid var(--HB_Color_HeaderText);
// margin-top : 0.05cm; //Font is misaligned. Shift up slightly
padding-bottom : 0.05cm;
}
@@ -414,7 +439,7 @@ body {
//Attribute Lists - All text between HRs is red
hr ~ :is(dl,p) {
color : @headerText;
color : var(--HB_Color_HeaderText);
}
hr:last-of-type {
& ~ :is(dl,p) {
@@ -429,7 +454,7 @@ body {
hr + table:first-of-type{
margin : 0;
column-span : none;
color : @headerText;
color : var(--HB_Color_HeaderText);
background-color : transparent;
border-style : none;
border-image : none;
@@ -484,7 +509,7 @@ body {
bottom : 22px;
width : 50px;
font-size : 0.9em;
color : #c9ad6a;
color : var(--HB_Color_Footnotes);
text-align : center;
text-indent : 0;
&.auto::after {
@@ -498,7 +523,7 @@ body {
z-index : 150;
width : 200px;
font-size : 0.8em;
color : #c9ad6a;
color : var(--HB_Color_Footnotes);
text-align : right;
}
//************************************
@@ -603,8 +628,8 @@ body {
white-space : nowrap;
}
&.frame {
margin-top : 0.66cm;
margin-bottom : 1.05cm;
margin-top : 0.7cm;
margin-bottom : 0.9cm;
margin-left : -0.1cm;
margin-right : -0.1cm;
width : calc(100% + 0.2cm);
@@ -612,11 +637,17 @@ body {
background-color : white;
border : initial;
border-style : solid;
border-image-outset : 0.55cm 0.3cm;
border-image-outset : 0.4cm 0.3cm;
border-image-repeat : stretch;
border-image-slice : 200;
border-image-source : @frameBorderImage;
border-image-width : 47px;
&.wide:first-child {
margin-top: 0.12cm;
}
& + * {
margin-top: 0;
}
}
&.decoration {
position:relative;
@@ -649,90 +680,78 @@ body {
//*****************************
// * TABLE OF CONTENTS
// *****************************/
.page .toc{
.page {
&:has(.toc):after {
display: none;
}
.toc {
-webkit-column-break-inside : avoid;
page-break-inside : avoid;
break-inside : avoid;
h1 {
text-align : center;
margin-bottom : 0.3cm;
}
a{
display : inline;
color : inherit;
text-decoration : none;
&:hover{
text-decoration : underline;
h1 {
text-align : center;
margin-bottom : 0.3cm;
}
}
h4 {
margin-top : 0.2cm;
line-height : 0.4cm;
& + ul li {
line-height: 1.2em;
a{
display : inline;
color : inherit;
text-decoration : none;
&:hover{
text-decoration : underline;
}
}
}
ul{
padding-left : 0;
list-style-type : none;
li + li h3 {
margin-top : 0.26cm;
line-height : 1em
h4 {
margin-top : 0.2cm;
line-height : 0.4cm;
& + ul li {
line-height: 1.2em;
}
}
h3 span:first-child::after {
border : none;
}
span {
display : table-cell;
&:first-child {
position : relative;
overflow : hidden;
&::after {
ul{
padding-left : 0;
list-style-type : none;
margin-top : 0;
a {
width : 100%;
display : flex;
flex-flow : row nowrap;
justify-content : space-between;
}
li + li h3 {
margin-top : 0.26cm;
line-height : 1em
}
h3 span:first-child::after {
border : none;
}
span {
display : contents;
&:first-child::after {
content : "";
position : absolute;
bottom : 0.08cm;
margin-left : 0.06cm; /* Spacing before dot leaders */
width : 100%;
flex : 1;
margin-left : 0.08cm; /* Spacing before dot leaders */
margin-right : 0.16cm;
border-bottom : 0.05cm dotted #000;
margin-bottom : 0.08cm;
}
&:last-child {
display : inline-block;
align-self : flex-end;
font-family : "BookInsanityRemake";
font-size : 0.34cm;
font-weight : normal;
color : #000;
}
}
&:last-child {
font-family : BookInsanityRemake;
font-size : 0.34cm;
font-weight : normal;
color : black;
text-align : right;
vertical-align : bottom; /* Keep page number bottom-aligned */
width : 1%;
padding-left : 0.06cm; /* Spacing after dot leaders */
/*white-space : nowrap; /* Uncomment if needed */
ul { /*List indent*/
margin-left : 1em;
}
}
ul { /*List indent*/
margin-left : 1em;
&.wide{
.useColumns(0.96, @fillMode: balance);
}
}
&.wide{
.useColumns(0.96, @fillMode: balance);
}
}
//*****************************
// * MUSTACHE DIVS/SPANS
// *****************************/
.page {
.block {
break-inside : avoid;
display : inline-block;
.page :where(&) {
width : 100%;
}
//-webkit-transform : translateZ(0); //Prevents shadows from breaking across columns
}
.inline-block {
display : inline-block;
text-indent : initial;
}
}
//*****************************
@@ -765,26 +784,13 @@ body {
}
}
//*****************************
// * BLANK LINE
// *****************************/
.page {
.blank {
height : 1em;
margin-top : 0;
}
}
//*****************************
// * WIDE
// *****************************/
.page .wide{
column-span : all;
-webkit-column-span : all;
-moz-column-span : all;
display : block;
margin-bottom : 0.34cm;
&+* {
margin-top : 0;
}
margin-bottom : 0.325cm;
}
.page h1 + *{
margin-top : 0;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 B

View File

@@ -0,0 +1,6 @@
{
"name" : "Blank",
"renderer" : "V3",
"baseTheme" : false,
"baseSnippets" : false
}

View File

@@ -1,13 +1,8 @@
/* eslint-disable max-lines */
const MagicGen = require('./magic.gen.js');
const ClassTableGen = require('./classtable.gen.js');
const MonsterBlockGen = require('./monsterblock.gen.js');
const ClassFeatureGen = require('./classfeature.gen.js');
const CoverPageGen = require('./coverpage.gen.js');
const TableOfContentsGen = require('./tableOfContents.gen.js');
const dedent = require('dedent-tabs').default;
const watercolorGen = require('./watercolor.gen.js');
const WatercolorGen = require('./snippets/watercolor.gen.js');
const dedent = require('dedent-tabs').default;
module.exports = [
@@ -59,26 +54,11 @@ module.exports = [
`&amp;size=100x100) {width:100px;mix-blend-mode:multiply}`;
}
},
{
name : 'Page Number',
icon : 'fas fa-bookmark',
gen : '{{pageNumber 1}}\n{{footnote PART 1 | SECTION NAME}}\n\n'
},
{
name : 'Auto-incrementing Page Number',
icon : 'fas fa-sort-numeric-down',
gen : '{{pageNumber,auto}}\n{{footnote PART 1 | SECTION NAME}}\n\n'
},
{
name : 'Link to page',
icon : 'fas fa-link',
gen : '[Click here](#p3) to go to page 3\n'
},
{
name : 'Table of Contents',
icon : 'fas fa-book',
gen : TableOfContentsGen
},
{
name : 'Add Comment',
icon : 'fas fa-code',
@@ -91,29 +71,6 @@ module.exports = [
icon : 'fas fa-pencil-alt',
view : 'style',
snippets : [
{
name : 'Remove Drop Cap',
icon : 'fas fa-remove-format',
gen : dedent`/* Removes Drop Caps */
.page h1+p:first-letter {
all: unset;
}\n\n
/* Removes Small-Caps in first line */
.page h1+p:first-line {
all: unset;
}`
},
{
name : 'Tweak Drop Cap',
icon : 'fas fa-sliders-h',
gen : dedent`/* Drop Cap settings */
.page h1 + p::first-letter {
font-family: SolberaImitationRemake;
font-size: 3.5cm;
background-image: linear-gradient(-45deg, #322814, #998250, #322814);
line-height: 1em;
}\n\n`
},
{
name : 'Add Comment',
icon : 'fas fa-code',
@@ -132,28 +89,18 @@ module.exports = [
name : 'Image',
icon : 'fas fa-image',
gen : dedent`
![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:10px,margin-bottom:-30px
##### Cat Warrior
[Kyoung Hwan Kim](https://www.artstation.com/tahra)
}}`
![cat warrior](https://s-media-cache-ak0.pinimg.com/736x/4a/81/79/4a8179462cfdf39054a418efd4cb743e.jpg) {width:325px,mix-blend-mode:multiply}`
},
{
name : 'Background Image',
icon : 'fas fa-tree',
gen : dedent`
![homebrew mug](http://i.imgur.com/hMna6G0.png) {position:absolute,top:50px,right:30px,width:280px}
{{artist,top:80px,right:30px
##### Homebrew Mug
[naturalcrit](https://homebrew.naturalcrit.com)
}}`
![homebrew mug](http://i.imgur.com/hMna6G0.png) {position:absolute,top:50px,right:30px,width:280px}`
},
{
name : 'Watercolor Splatter',
icon : 'fas fa-fill-drip',
gen : watercolorGen,
gen : WatercolorGen,
},
{
name : 'Watermark',
@@ -164,99 +111,6 @@ module.exports = [
]
},
/************************* PHB ********************/
{
groupName : 'PHB',
icon : 'fas fa-book',
view : 'text',
snippets : [
{
name : 'Spell',
icon : 'fas fa-magic',
gen : MagicGen.spell,
},
{
name : 'Spell List',
icon : 'fas fa-scroll',
gen : MagicGen.spellList,
},
{
name : 'Class Feature',
icon : 'fas fa-mask',
gen : ClassFeatureGen,
},
{
name : 'Note',
icon : 'fas fa-sticky-note',
gen : function(){
return dedent`
{{note
##### Time to Drop Knowledge
Use notes to point out some interesting information.
**Tables and lists** both work within a note.
}}
\n`;
},
},
{
name : 'Descriptive Text Box',
icon : 'fas fa-comment-alt',
gen : function(){
return dedent`
{{descriptive
##### Time to Drop Knowledge
Use descriptive boxes to highlight text that should be read aloud.
**Tables and lists** both work within a descriptive box.
}}
\n`;
},
},
{
name : 'Monster Stat Block (unframed)',
icon : 'fas fa-paw',
gen : MonsterBlockGen.monster('monster', 2),
},
{
name : 'Monster Stat Block',
icon : 'fas fa-spider',
gen : MonsterBlockGen.monster('monster,frame', 2),
},
{
name : 'Wide Monster Stat Block',
icon : 'fas fa-dragon',
gen : MonsterBlockGen.monster('monster,frame,wide', 4),
},
{
name : 'Cover Page',
icon : 'fas fa-file-word',
gen : CoverPageGen,
},
{
name : 'Magic Item',
icon : 'fas fa-hat-wizard',
gen : MagicGen.item,
},
{
name : 'Artist Credit',
icon : 'fas fa-signature',
gen : function(){
return dedent`
{{artist,top:90px,right:30px
##### Starry Night
[Van Gogh](https://www.vangoghmuseum.nl/en)
}}
\n`;
},
},
]
},
/********************* TABLES *********************/
{
@@ -323,43 +177,10 @@ module.exports = [
}}
\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'),
}
]
},
/**************** PAGE *************/
{
@@ -392,7 +213,7 @@ module.exports = [
icon : 'fas fa-tint',
gen : dedent`
/* Ink Friendly */
*:is(.page,.monster,.note,.descriptive) {
*:is(.page) {
background : white !important;
filter : drop-shadow(0px 0px 3px #888) !important;
}
@@ -402,6 +223,5 @@ module.exports = [
}\n\n`
},
]
},
}
];

View File

@@ -0,0 +1,5 @@
const _ = require('lodash');
module.exports = ()=>{
return `{{watercolor${_.random(1, 12)},top:20px,left:30px,width:300px,background-color:#BBAD82,opacity:80%}}\n\n`;
};

276
themes/V3/Blank/style.less Normal file
View File

@@ -0,0 +1,276 @@
@import (less) './themes/fonts/5e/fonts.less';
@import (less) './themes/assets/assets.less';
:root {
//Colors
--HB_Color_Background : #FFFFFF; // White
--HB_Color_WatercolorStain : #000000; // Black
}
@page { margin: 0; }
body {
counter-reset : phb-page-numbers;
}
*{
-webkit-print-color-adjust : exact;
}
.useColumns(@multiplier : 1, @fillMode: balance){
column-fill : @fillMode;
column-count : 2;
}
.columnWrapper{
max-height : 100%;
column-span : all;
columns : inherit;
column-gap : inherit;
}
.page{
.useColumns();
height : 279.4mm;
width : 215.9mm;
padding : 1.4cm 1.9cm 1.7cm;
counter-increment : phb-page-numbers;
background-color : var(--HB_Color_Background);
position : relative;
z-index : 15;
box-sizing : border-box;
overflow : hidden;
text-rendering : optimizeLegibility;
page-break-before : always;
page-break-after : always;
contain : size;
}
//*****************************
// * BASE
// *****************************/
.page{
p{
overflow-wrap : break-word;
display : block;
}
strong{
font-weight : bold;
}
em{
font-style : italic;
}
sup{
vertical-align : super;
font-size : smaller;
line-height : 0;
}
sub{
vertical-align : sub;
font-size : smaller;
line-height : 0;
}
ul {
list-style-position : outside; //Needed for multiline list items
list-style-type : disc;
padding-left : 1.4em;
}
ol {
list-style-position : outside;
list-style-type : decimal;
padding-left : 1.4em;
}
img{
z-index : -1;
}
//*****************************
// * HEADERS
// *****************************/
h1,h2,h3,h4,h5,h6{
font-weight : bold;
line-height : 1.2em;
}
h1{
font-size : 2em;
}
h2{
font-size : 1.5em;
}
h3{
font-size : 1.17em;
}
h4{
font-size : 1em;
}
h5{
font-size : 0.83em;
}
//*****************************
// * TABLE
// *****************************/
table{
width : 100%;
thead{
display : table-row-group;
font-weight : bold;
}
}
div:not(.columnWrapper) > table + table { // Side-by-side tables should not
margin-top : 0; // have vertical spacing.
}
/* Watermark */
.watermark {
display : grid !important;
place-items : center;
justify-content : center;
position : absolute;
margin : 0;
top : 0;
left : 0;
width : 100%;
height : 100%;
font-size : 120px;
text-transform : uppercase;
color : black;
mix-blend-mode : overlay;
opacity : 30%;
transform : rotate(-45deg);
z-index : 500;
p {
margin-bottom : none;
}
}
/* Watercolor */
[class*="watercolor"] {
position : absolute;
width : 2000px; /* dimensions need to be real big so the user can set */
height : 2000px; /* height or width and the image will maintain aspect ratio */
-webkit-mask-image : var(--wc);
-webkit-mask-size : contain;
-webkit-mask-repeat : no-repeat;
mask-image : var(--wc);
mask-size : contain;
mask-repeat : no-repeat;
background-size : cover;
background-color : var(--HB_Color_WatercolorStain); /*default color*/
--wc : @watercolor1; /*default image*/
z-index : -2;
}
.watercolor1 { --wc : @watercolor1; }
.watercolor2 { --wc : @watercolor2; }
.watercolor3 { --wc : @watercolor3; }
.watercolor4 { --wc : @watercolor4; }
.watercolor5 { --wc : @watercolor5; }
.watercolor6 { --wc : @watercolor6; }
.watercolor7 { --wc : @watercolor7; }
.watercolor8 { --wc : @watercolor8; }
.watercolor9 { --wc : @watercolor9; }
.watercolor10 { --wc : @watercolor10; }
.watercolor11 { --wc : @watercolor11; }
.watercolor12 { --wc : @watercolor12; }
//************************************
// * CODE BLOCKS
// ************************************/
code{
font-family : "Courier New", Courier, monospace;
white-space : pre-wrap;
overflow-wrap : break-word;
}
pre code{
width : 100%;
display : inline-block;
}
//*****************************
// * EXTRAS
// *****************************/
.columnSplit {
visibility : hidden;
-webkit-column-break-after : always;
break-after : always;
-moz-column-break-after : always;
margin-top : 0;
& + * {
margin-top : 0;
}
}
//Avoid breaking up
blockquote,table{
z-index : 15;
-webkit-column-break-inside : avoid;
page-break-inside : avoid;
break-inside : avoid;
}
// Nested lists
ul ul,ol ol,ul ol,ol ul{
margin-bottom : 0px;
margin-left : 1.5em;
}
li{
-webkit-column-break-inside : avoid;
page-break-inside : avoid;
break-inside : avoid;
}
}
//*****************************
// * MUSTACHE DIVS/SPANS
// *****************************/
.page {
.block {
break-inside : avoid;
display : inline-block;
width : 100%;
}
.inline-block {
display : inline-block;
text-indent : initial;
}
}
//*****************************
// * DEFINITION LISTS
// *****************************/
.page {
dl {
padding-left : 1em;
white-space : pre-line;
}
dt {
display : inline;
margin-right : 0.5ch;
margin-left : -1em;
}
dd {
display : inline;
margin-left : 0;
text-indent : 0;
}
}
//*****************************
// * BLANK LINE
// *****************************/
.page {
.blank {
height : 1em;
margin-top : 0;
& + * {
margin-top : 0;
}
}
}
//*****************************
// * WIDE
// *****************************/
.page {
.wide{
column-span : all;
display : block;
margin-bottom : 1em;
&+* {
margin-top : 0;
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

@@ -0,0 +1,6 @@
{
"name" : "Journal",
"renderer" : "V3",
"baseTheme" : false,
"baseSnippets" : "5ePHB"
}

View File

@@ -0,0 +1,4 @@
/* eslint-disable max-lines */
module.exports = [
];

View File

@@ -0,0 +1,559 @@
@import (less) './themes/fonts/Journal/fonts.less';
@import (less) './themes/assets/assets.less';
:root {
//Colors
--HB_Color_Background : unset; // Light parchment
--HB_Color_Text : #412121; // Dark Maroon Brown
--HB_Color_Text2 : #261C13CC; //Dark Brown
--HB_Color_HeaderText : #58180D; // Dark Maroon
--HB_Color_CaptionText : #766649; // Brown
--HB_Color_WatercolorStain : #BBAD82; // Light brown
}
.useSansSerif(){
font-family : PermanentMarker;
font-size : 0.3cm;
line-height : 1.2em;
color : var(--HB_Color_Text2);
p,dl,ul,ol {
line-height : 1.2em;
}
ul, ol {
padding-left : 1em;
}
em{
font-style : italic;
}
strong{
font-weight : 800;
font-size : 1.1em;
}
h5 + * {
margin-top : 0.1cm;
}
}
.useColumns(@multiplier : 1, @fillMode: balance){
column-gap : 0.5cm;
}
.page{
background-size : 200% 100%;
background-repeat : no-repeat;
filter : drop-shadow(1px 4px 14px black);
background-image : url(/assets/Journal/Background1.webp);
padding : 2.1cm 1.9cm 1.7cm 3.8cm;
&:nth-of-type(2n + 1) {
background-position : left;
}
&:nth-of-type(2n) {
background-position : right;
padding : 2.1cm 3.9cm 1.7cm 1.8cm;
}
&:nth-of-type(2) {
background-image : url(/assets/Journal/Background2.webp); //Only first page should show ribbon
}
& .columnWrapper {
//transform: rotate(-0.5deg); // Breaks absolute positioning of images/footers. Wait for Chrome fix
}
}
//*****************************
// * BASE
// *****************************/
.page{
color : var(--HB_Color_Text);
font-family : ReenieBeanie;
font-size : 0.53cm;
line-height : 0.8em;
p + * {
margin-top : 0.325cm;
}
p + p{
margin-top : 0;
}
ul{
margin-bottom : 0.8em;
}
ol{
margin-bottom : 0.8em;
}
em{
text-decoration : underline;
font-style : unset;
}
del{
text-decoration-style: double;
}
//Indents after p or lists
p+p, ul+p, ol+p{
text-indent : 1em;
}
//*****************************
// * HEADERS
// *****************************/
h1,h2,h3,h4,h5{
font-family : FrederickaTheGreat;
font-weight : unset;
color : var(--HB_Color_HeaderText);
}
h1{
margin-bottom : 0.18cm; //Margin-bottom only because this is WIDE
font-size : 0.89cm;
line-height : 1em;
font-variant : small-caps;
&+p::first-letter{
float : left;
font-family : FrederickaTheGreat;
line-height : 1em;
font-size : 1.9em;
padding-left : 40px; //Allow background color to extend into margins
margin-top : -0.3cm;
margin-bottom : -20px;
margin-left : -40px;
margin-right : 0.1em;
padding-top : 0.3em;
padding-bottom : 2px;
}
&+p::first-line{
font-variant : small-caps;
}
}
h2{
font-size : 0.62cm;
line-height : 0.988em; //Font is misaligned. Shift up slightly
}
h3{
font-size : 0.575cm;
line-height : 0.995em; //Font is misaligned. Shift up slightly
margin-left : -0.9em;
}
h4{
font-size : 0.55cm;
line-height : 0.971em; //Font is misaligned. Shift up slightly
color : var(--HB_Color_Text);
padding-bottom : 5px;
transform:rotate(0deg);
&:nth-of-type(2n) {
transform:rotate(1deg);
}
&:nth-of-type(3n) {
transform:rotate(-1.5deg);
}
}
h5{
font-family : PermanentMarker;
font-size : 0.4cm;
color : var(--HB_Color_Text2);
font-weight : bold;
line-height : 0.951em; //Font is misaligned. Shift up slightly
& + * {
margin-top : 0.2cm;
}
}
//*****************************
// * TABLE
// *****************************/
table{
.useSansSerif();
& + * {
margin-top : 0.325cm;
}
thead{
th{
vertical-align : bottom;
padding : 0.14em 0;
}
}
tbody{
tr{
td{
padding : 0.14em 0;
}
&:nth-child(odd){
background-image : linear-gradient(to left, #41212100, #41212122, #41212100);
}
}
}
}
//*****************************
// * NOTE
// *****************************/
.note{
.useSansSerif();
border-style : solid;
border-width : 1px;
border-image-source : url(/assets/Journal/Border1.png);
border-image-slice : 18 18 18 18;
border-image-width : 6px 6px 6px 6px;
border-image-outset : 5px 5px 5px 5px;
border-image-repeat : stretch stretch;
background-image : url(/assets/Journal/HashMarks.png),
linear-gradient(to bottom right, #ff000000, #a36a4e14, #41212100);
background-size : 120% 120%;
background-repeat : no-repeat;
background-position : center;
padding : 0.2cm;
:where(&) {
margin-top : 9px; //Prevent top border getting cut off on colbreak
}
& + * {
margin-top : 0.45cm;
}
h5 {
font-size : 0.375cm;
}
p{
padding-bottom : 0px;
}
:last-child {
margin-bottom : 0;
}
}
//************************************
// * DESCRIPTIVE TEXT BOX
// ************************************/
* + .descriptive {
margin-top : 0.6cm;
}
.descriptive{
.useSansSerif();
border-style : solid;
border-width : 1px;
border-image-source : url('/assets/Journal/Border2.png');
border-image-slice : 48 48 48 48;
border-image-width : 20px;
border-image-outset : 16px 20px 16px 20px;
border-image-repeat : stretch stretch;
background-image : url(/assets/Journal/HashMarks.png),
linear-gradient(to bottom right, #ff000000, #41212114, #41212100);
background-size : 120% 120%;
background-repeat : no-repeat;
background-position : center;
padding : 0.2cm;
:where(&) {
margin-top : 4px; //Prevent top border getting cut off on colbreak
}
& + * {
margin-top : 0.45cm;
}
h5 {
font-size : 0.375cm;
}
p{
padding-bottom : 0px;
}
:last-child {
margin-bottom : 0;
}
}
//*****************************
// * Images Snippets
// *****************************/
/* Arist Credit */
.artist {
position : absolute;
width : auto;
text-align : center;
font-family : WalterTurncoat;
font-size : 0.27cm;
color : var(--HB_Color_CaptionText);
p, p + p {
margin : unset;
text-indent : unset;
line-height : 1em;
}
h5 {
font-size : 1.3em;
font-family : WalterTurncoat;
}
a{
color : inherit;
text-decoration : unset;
&:hover {
text-decoration : underline;
}
}
}
//*****************************
// * MONSTER STAT BLOCK
// *****************************/
.monster {
.useSansSerif();
&.frame {
border-style : solid;
border-width : 7px 6px;
border-image-source : url('/assets/Journal/Border3.png');
border-image-slice : 63 74 63 74;
border-image-width : 15px 20px 15px 20px;
border-image-outset : 12px 12px 12px 12px;
border-image-repeat : stretch round;
background-image : url('/assets/Journal/HashMarks.png'),
linear-gradient(to bottom right, #ff000000, #a36a4e14, #41212100);
background-blend-mode : screen multiply;
background-size : 100%;
padding : 0.2cm;
}
color: var(--HB_Color_Text);
position : relative;
padding : 0px;
margin-bottom : 0.325cm;
//Headers
h2{
font-size : 0.62cm;
line-height : 1em;
margin : 0;
&+p {
margin-bottom : 0; //Monster size and type subtext
}
}
h3{
margin-left : 0;
font-variant : small-caps;
padding-bottom : 0.05cm;
}
hr{
visibility : visible;
height : 6px;
margin : 0.12cm 0cm;
background-image : url('/assets/Journal/HorizontalRule.png');
background-size : 100% 100%;
}
hr:last-of-type + * {
margin-top : 0.325cm; // Space after last HR
}
// Monster Ability table
hr + table:first-of-type{
margin : 0;
column-span : none;
background-image : none;
border-style : none;
border-image : none;
color : inherit;
tr {
background-image : none;
}
td,th {
padding: 0px;
}
}
:last-child {
margin-bottom : 0;
}
strong, em {
font-style : normal;
text-decoration : none;
}
}
//Full Width
.monster.wide{
.useColumns(0.96, @fillMode: balance);
}
//*****************************
// * FOOTER
// *****************************/
&:nth-child(odd){
.pageNumber{
left : 3cm;
}
.footnote{
left : 4.5cm;
text-align : left;
}
}
.pageNumber{
font-family : FrederickaTheGreat;
position : absolute;
right : 3cm;
bottom : 1.25cm;
width : 50px;
font-size : 0.9em;
color : var(--HB_Color_HeaderText);
text-align : center;
text-indent : 0;
&.auto::after {
content : counter(phb-page-numbers);
}
}
.footnote{
position : absolute;
right : 4.5cm;
bottom : 1.25cm;
z-index : 150;
width : 200px;
font-size : 0.8em;
color : var(--HB_Color_HeaderText);
text-align : right;
}
//************************************
// * CODE BLOCKS
// ************************************/
code{
font-size : 0.3cm;
padding : 0px 4px;
color : var(--HB_Color_Text);
vertical-align : middle;
background-color : #faf7ea;
border-radius : 4px;
}
pre code{
border-style : solid;
border-width : 1px;
border-image : @codeBorderImage 26 stretch;
border-image-width : 10px;
border-image-outset : 2px;
border-radius : 12px;
margin-bottom : 2px;
padding : 0.15cm;
.page :where(&) {
margin-top : 2px; //Prevent top border getting cut off on colbreak
}
& + * {
margin-top : 0.325cm;
}
}
//*****************************
// * EXTRAS
// *****************************/
hr{
visibility : hidden;
border : none;
margin : 0px;
}
//Text indent right after table
table+p{
text-indent : 1em;
}
a, a:visited, a:hover {
color: var(--HB_Color_Text);
transition:all 1s ease;
}
a:hover {
color:red;
}
}
//*****************************
// * SPELL LIST
// *****************************/
.page .spellList{
.useSansSerif();
font-family : PermanentMarker;
column-count : 2;
ul+h5{
margin-top : 15px;
}
ul{
margin-bottom : 0.5em;
padding-left : 1em;
text-indent : -1em;
list-style-type : none;
-webkit-column-break-inside : auto;
page-break-inside : auto;
break-inside : auto;
}
&.wide{
column-count : 4;
}
}
//*****************************
// * CLASS TABLE
// *****************************/
.page .classTable{
th[colspan]:not([rowspan]) {
white-space : nowrap;
}
h5 + table{
margin-top : 0.2cm;
}
}
//*****************************
// * TABLE OF CONTENTS
// *****************************/
.page .toc{
-webkit-column-break-inside : avoid;
page-break-inside : avoid;
break-inside : avoid;
h1 {
text-align : center;
margin-bottom : 0.3cm;
}
a{
display : inline;
color : inherit;
text-decoration : none;
&:hover{
text-decoration : underline;
}
}
h4 {
margin-top : 0.2cm;
line-height : 0.4cm;
& + ul li {
line-height: 1.2em;
}
}
ul{
padding-left : 0;
list-style-type : none;
li + li h3 {
margin-top : 0.26cm;
line-height : 1em
}
h3 span:first-child::after {
border : none;
}
span {
display : table-cell;
&:first-child {
position : relative;
overflow : hidden;
&::after {
content : "";
position : absolute;
bottom : 0.08cm;
margin-left : 0.06cm; /* Spacing before dot leaders */
width : 100%;
border-bottom : 0.05cm dotted #000;
}
}
&:last-child {
font-family : ReenieBeanie;
font-size : 0.34cm;
font-weight : normal;
color : black;
text-align : right;
vertical-align : bottom; /* Keep page number bottom-aligned */
width : 1%;
padding-left : 0.06cm; /* Spacing after dot leaders */
/*white-space : nowrap; /* Uncomment if needed */
}
}
ul { /*List indent*/
margin-left : 1em;
}
}
&.wide{
.useColumns(0.96, @fillMode: balance);
}
}
//*****************************
// * WIDE
// *****************************/
.page .wide {
margin-bottom : 0.45cm;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 KiB

Some files were not shown because too many files have changed in this diff Show More