0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-27 11:32:38 +00:00
Commit Graph

64 Commits

Author SHA1 Message Date
Alexey Sachkov
78d4487c58 Fix linter errors 2021-12-29 21:30:03 +03:00
Alexey Sachkov
8a3f52b704 [NFC] Add display name for custom React components
This improves readability of "Components" tab from React Development Tools extension for Chrome
2021-12-29 21:18:54 +03:00
Gazook89
80ea598ec2 match brewRenderer.jsx output to printPage.jsx output 2021-09-16 19:59:54 -05:00
Trevor Buckner
22e54636d4 Fix partial page rendering on v3
"dummy pages" on v3 were unstyled, giving them very small height which led to a cycle of pages changing size, which shifted other pages into view, which changed their sizes, etc.
2021-09-15 14:02:19 -04:00
Trevor Buckner
f435d65db7 Fix block-curly injector leaving behind an empty <p></p> 2021-09-09 10:35:08 -04:00
Trevor Buckner
5d42196297 Give spellList "wide" class for consistency 2021-09-09 09:14:16 -04:00
Trevor Buckner
1a71ba0eb2 Force \page on V3 to be alone on line. 2021-08-31 12:08:31 -04:00
Trevor Buckner
a7005d779a Fix /print, make .page outer element for consistency with legacy 2021-08-26 22:43:57 -04:00
Trevor Buckner
039db01b31 Artificial column-break at page end
Inserting a \column into the end of the page (and a nbsp after). This makes the page emulate column-fill:auto (the standard "Homebrewery" behavior) since there is always at least one column-break, making the browser try less hard to aggressively "balance" the columns.

Then, when a user inserts `wide` or `column-span` elements, `column-fill: balance` will be able to take over and work as we expect.
2021-08-23 23:03:57 -04:00
Trevor Buckner
9c6d875524 Add wrapper to .page to improve wide behavior with columns 2021-08-22 23:00:43 -04:00
Trevor Buckner
21223cbcd4 Merge branch 'master' into fixUndefinedCSS 2021-07-30 18:05:02 -04:00
G.Ambatte
577a434e17 Slight change to isMounted logic 2021-07-29 19:24:36 +12:00
G.Ambatte
cac5aa2475 Combine renderStyle and renderPages logic 2021-07-29 19:23:27 +12:00
G.Ambatte
41e1ed7bd1 Fix issue with undefined Style tab data 2021-07-26 10:29:31 +12:00
Trevor Buckner
4f2ddfa020 Themes are now compiled into separate css files and can be hot-swapped in the renderer as needed 2021-07-12 19:37:10 -04:00
Trevor Buckner
51aba937f5 Fix CSS highlighting 2021-06-07 11:51:02 -04:00
Trevor Buckner
e67fadef02 Separate "style" and "metadata" panels 2021-06-05 15:58:31 -04:00
Trevor Buckner
e5ccfa3a50 Fix /page not working in legacy mode. (#1233)
* Fix brew styles overwriting each other.

* Word wrapping, start fixing spacing on Title letter

* Fix \page in legacy brews when not at line start
2021-02-08 13:58:24 -05:00
Trevor Buckner
c642a35fb3 Fix brew styles overwriting each other. (#1230) 2021-02-05 14:58:41 -05:00
Trevor Buckner
de1017a20a Legacy renderer (#1229)
* Include two versions of Marked.js

* Include two versions of Marked.js

* Working two different render pipelines

Adds stylesheet "styleLegacy.less"
Adds markdownHandler "markdownLegacy.js"
The BrewRenderer will switch between these and the new pipeline dependent on the "version" prop passed in.

* Mustache-style div blocks

* Legacy snippets & columnbreak

* Codemirror styling for Div Blocks

* Lint

* Codemirror highlights for inline Divs as well

These will turn red `{{class Content}}`

Multi-line divs will turn purple

```
{{class,class2
content
}}
```

No real need for these to be different colors. Just for testing.

* More lint

* Update dependencies.

* Adding Button to switch render pipelines

* Update Marked.js

* Popup alert to refresh page when renderer changed

* Don't compress files in Development (very slow)

* Block DIV or inline Span depending on {{ placement

* \column emits a Div instead of Span

* Allow share page to use new renderer

* {{ divs no longer need empty lines. Spans work in lists.

* Typo

* Typo

* Enforce \page must be at start of line. Code cleanup.

* Inject newlines after/before {{/}} to avoid needing blank lines

* Fixes issues with tables.

* Remove console.log

* Fix spacing issue for Spans

* Move things from Brewrenderer to Markdown

Try to keep all custom text fiddling in one spot.

* Rename variables

* Update Font-Awesome to v5.15. Fix style issues on popups.

* Update {{ Divs/Spans, Fix nested hilighting

* Fixed Spans/divs with no tags or just commas

* Use blacklist for {{ to allow more characters

* Update package-lock.json

* Update all icons to Font-awesome 5

* V3 hidden behind config variable

Add "globalThis.enable_v3 = true" in the console to enable.

* lint

* Give user styles higher priority to still allow overrides

* Apply style priority to *all* user styles

* Change .legacy .v3 to .phb, .phb3
2021-02-04 23:31:37 -05:00
Trevor Buckner
e2cd7d9f07 Legacy renderer (#1184)
* Include two versions of Marked.js

* Include two versions of Marked.js

* Working two different render pipelines

Adds stylesheet "styleLegacy.less"
Adds markdownHandler "markdownLegacy.js"
The BrewRenderer will switch between these and the new pipeline dependent on the "version" prop passed in.

* Mustache-style div blocks

* Legacy snippets & columnbreak

* Codemirror styling for Div Blocks

* Lint

* Codemirror highlights for inline Divs as well

These will turn red `{{class Content}}`

Multi-line divs will turn purple

```
{{class,class2
content
}}
```

No real need for these to be different colors. Just for testing.

* More lint

* Update dependencies.

* Adding Button to switch render pipelines

* Update Marked.js

* Popup alert to refresh page when renderer changed

* Don't compress files in Development (very slow)

* Block DIV or inline Span depending on {{ placement

* \column emits a Div instead of Span

* Allow share page to use new renderer

* {{ divs no longer need empty lines. Spans work in lists.

* Typo

* Typo

* Enforce \page must be at start of line. Code cleanup.

* Inject newlines after/before {{/}} to avoid needing blank lines

* Fixes issues with tables.

* Remove console.log

* Fix spacing issue for Spans

* Move things from Brewrenderer to Markdown

Try to keep all custom text fiddling in one spot.

* Rename variables

* Update Font-Awesome to v5.15. Fix style issues on popups.

* Update {{ Divs/Spans, Fix nested hilighting

* Fixed Spans/divs with no tags or just commas

* Use blacklist for {{ to allow more characters

* Update package-lock.json

* Update all icons to Font-awesome 5

* V3 hidden behind config variable

Add "globalThis.enable_v3 = true" in the console to enable.

* lint
2021-02-02 20:38:25 -05:00
Trevor Buckner
aa065fa4d8 Do not Server-Side Render the markdown (#1177)
1) Rendering is fast enough on the client we don't need to provide SSR for the brew contents.
2) This leaves our server open to REDOS attacks if users create ridiculously long single lines of text. The Markdown parser slows down with exponential time which becomes noticeable at 10,000+ characters in one line, and at 200,000+ characters will stall the server and eventually crash.
3) This now shows a nice loading circle for the half-second that a page takes to render. If a user tries to load a huge line of text the loading circle will be there instead of a blank white page.
2021-01-02 16:54:50 -05:00
Trevor Buckner
6c813ddab1 Fix links breaking in iFrame 2020-10-26 13:50:37 -04:00
Trevor Buckner
aa2d1f3bc9 Fix missing FontAwesome fonts in iFrame 2020-10-22 12:44:18 -04:00
Trevor Buckner
c75ac3c0f5 Render brew in Iframe to not crash editor 2020-10-21 20:39:43 -04:00
Trevor Buckner
22a9799674 Update vitreum (#946)
- Updates Vitreum to v6.0.1 + some custom fixes.
  - Stylesheets must be imported with `require('./sheet.less');` but can also can now share stylesheets between jsx components.
  - Should eliminate a lot of security concerns with older nested dependencies.
  - Changed a lot of files to make this work
- Also removes dependency on PicoRouter in favor of React-Router
2020-05-19 01:36:31 -04:00
Trevor Buckner
c634192289 Added a notification popup similar to the "YOU ARE NOT USING CHROME" message. Can be used to notify users of current known issues, updates, etc.
Currently just reminds users to back up documents with a link to the Reddit FAQ.
2019-01-11 16:26:03 -05:00
Rae Che
3532d75365 s/let/const/ to satisfy ESLint 2018-08-24 10:12:53 -04:00
Rae Che
f6b058f3c9 brewRenderer: Capture event properties while still in event loop.
React [pools events](https://github.com/facebook/react/issues/2850),
which means that once the lambda runs later on the properties we want
to read will be null. Instead, we capture the properties in the event
loop.
2018-08-20 14:14:52 -04:00
Rae Che
ec0de7a408 BrewRenderer: Remove redundant errors state property.
The errors are in fact tracked in `this.props`, not `this.state`.
2018-05-31 10:53:07 -04:00
Rae Che
9ea99236ff Omit redundant property definition in brew renderer 2018-05-31 10:53:07 -04:00
Rae Che
15ac397b63 Fix inconsistent React state update.
Flagged by lgtm.com (as js/react/inconsistent-state-update).
2018-05-31 10:53:07 -04:00
Trevor Buckner
d417c76c56 Remove unused event triggers
Removed `onMouseOver` and `onMouseOut` since they are no longer needed to trigger `will-change`
2018-05-14 08:30:19 +01:00
Trevor Buckner
2f15cc5611 Lint 2018-05-14 08:30:19 +01:00
Trevor Buckner
eb08172fb1 Move will-change to stylesheet
This makes `will-change: transform` permanent in the brewRenderer stylesheet rather than trying to load and unload it programatically.
2018-05-14 08:30:19 +01:00
Trevor Buckner
0cc87a4f0f Lint Fixes 2? 2018-05-14 08:30:19 +01:00
Trevor Buckner
004dc79eb2 Lint fixes 2018-05-14 08:30:19 +01:00
Trevor Buckner
a8a70c2d70 Unified spacing 2018-05-14 08:30:19 +01:00
Trevor Buckner
825c259fba Optimize for smooth scrolling of BrewRenderer
The will-change property allows the browser to optimize for smoother animations. This completely eliminates the scrolling stutter.
2018-05-14 08:30:19 +01:00
Rae Che
fd5d142c16 Fix calculation of currently-viewed page.
Previously, this relied on a hard-coded constant determining the
height of a page. However, that's unnecessary -- we know the scroll
height of the window and the number of pages, so we can compute it.
2018-05-10 14:35:03 -04:00
Scott Tolksdorf
f18a181e2e Updating to user create-react-class 2018-04-09 00:12:56 -04:00
Scott Tolksdorf
ed1b5252be lint 2018-04-09 00:12:56 -04:00
Scott Tolksdorf
6e0f042b42 Adding quick fix for PPR getting out of sync 2017-03-03 19:25:56 -05:00
Scott Tolksdorf
5fe7c7a6d8 renamed render warnings and now built into the brewrenderer 2017-01-14 14:21:51 -08:00
Scott Tolksdorf
9fd7586726 Fixed renderer crashing with malformed html on load 2016-12-25 23:44:24 -05:00
Scott Tolksdorf
e5ffb7c629 Greatly improved the user page UI 2016-12-03 16:27:15 -05:00
Scott Tolksdorf
9285e53e55 Added conditional partial page rendering 2016-12-03 14:49:00 -05:00
Scott Tolksdorf
2a0c06cd3d New error bar made 2016-09-24 10:25:10 -04:00
Scott Tolksdorf
cd2337ff2c Experimenting with validation more 2016-09-24 10:24:38 -04:00
Scott Tolksdorf
9a96eebdb1 Adding my own markdown-html validator, still needs line numbers though 2016-09-24 10:24:01 -04:00