0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-08 16:12:38 +00:00

Merge branch 'master' of https://github.com/naturalcrit/homebrewery into scroll-to-element

This commit is contained in:
Víctor Losada Hernández
2024-10-13 11:15:15 +02:00
48 changed files with 1848 additions and 1316 deletions

View File

@@ -1,7 +1,7 @@
/*eslint max-lines: ["warn", {"max": 300, "skipBlankLines": true, "skipComments": true}]*/
require('./brewRenderer.less');
const React = require('react');
const { useState, useRef, useEffect, useCallback } = React;
const { useState, useRef, useCallback } = React;
const _ = require('lodash');
const MarkdownLegacy = require('naturalcrit/markdownLegacy.js');
@@ -54,16 +54,15 @@ const BrewRenderer = (props)=>{
theme : '5ePHB',
lang : '',
errors : [],
currentEditorCursorPageNum : 0,
currentEditorViewPageNum : 0,
currentBrewRendererPageNum : 0,
currentEditorCursorPageNum : 1,
currentEditorViewPageNum : 1,
currentBrewRendererPageNum : 1,
themeBundle : {},
onPageChange : ()=>{},
...props
};
const [state, setState] = useState({
height : PAGE_HEIGHT,
isMounted : false,
visibility : 'hidden',
zoom : 100
@@ -206,7 +205,6 @@ const BrewRenderer = (props)=>{
}
};
const emitClick = ()=>{ // Allow clicks inside iFrame to interact with dropdowns, etc. from outside
if(!window || !document) return;
document.dispatchEvent(new MouseEvent('click'));
@@ -220,6 +218,12 @@ const BrewRenderer = (props)=>{
}));
};
const styleObject = {};
if(global.config.deployment) {
styleObject.backgroundImage = `url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' version='1.1' height='40px' width='200px'><text x='0' y='15' fill='white' font-size='20'>${global.config.deployment}</text></svg>")`;
}
return (
<>
{/*render dummy page while iFrame is mounting.*/}
@@ -245,11 +249,11 @@ const BrewRenderer = (props)=>{
contentDidMount={frameDidMount}
onClick={()=>{emitClick();}}
>
<div className={'brewRenderer'}
<div className={`brewRenderer ${global.config.deployment && 'deployment'}`}
onScroll={updateCurrentPage}
onKeyDown={handleControlKeys}
tabIndex={-1}
style={{ height: state.height }}>
style={ styleObject }>
{/* Apply CSS from Style tab and render pages from Markdown tab */}
{state.isMounted

View File

@@ -4,6 +4,10 @@
overflow-y : scroll;
will-change : transform;
padding-top : 30px;
height : 100vh;
&.deployment {
background-color: darkred;
}
:where(.pages) {
margin : 30px 0px;
& > :where(.page) {
@@ -39,6 +43,7 @@
overflow-y : unset;
.pages {
margin : 0px;
zoom: 100% !important;
& > .page { box-shadow : unset; }
}
}

View File

@@ -15,34 +15,6 @@ const NotificationPopup = ()=>{
<small>This website is always improving and we are still adding new features and squashing bugs. Keep the following in mind:</small>
</div>
<ul>
<li key='ThrottlingError' style={{
backgroundColor: '#910000',
margin: '-10px -10px -10px -20px',
padding: '10px 10px 10px 20px',
fontSize: '1.0em'
}}>
<em>Known issue with saving/creating Google Drive files</em><br />
Dear users. The <a href="https://github.com/naturalcrit/homebrewery/issues/3770">
issue with saving to Google Drive</a> has resurfaced as of Oct 1, 2024 22:00 UTC.
<br></br><br></br>
Earlier we submitted a bug report to Google and have all but confirmed the issue
lies on Google's end and the disruption has been affecting multiple other
organizations besides us. Unfortunately, it means reliable interaction with
Google remains out of our control until they can resolve their issue.
<br></br><br></br>
Brews saved to Google Drive are <em>not lost</em> and can still be viewed, just not updated.
You can also access them via your Google Drive interface in the <code>/Hombrewery</code> folder.
<br></br><br></br>
If you need to urgently edit documents, you can detatch them from your Google Drive
by transferring them to our Homebrewery storage. To do this, click the colored Google Drive
icon next to the save button when on an edit page; you can transfer them back later,
but this should allow you to edit while this issue is ongoing.
<br></br><br></br>
If you are experiencing errors creating new documents, you can similarly change your
account settings to create new brews by default in the Homebrewery storage. Click
your username and then "account", then change the "default save location".
</li>
<li key='Vault'>
<em>Search brews with our new page!</em><br />
We have been working very hard in making this possible, now you can share your work and look at it in the new <a href='/vault'>Vault</a> page!