mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-15 06:12:43 +00:00
Merge branch 'master' into dependabot/npm_and_yarn/elliptic-6.6.0
This commit is contained in:
@@ -76,6 +76,9 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
name: Test - Routes
|
name: Test - Routes
|
||||||
command: npm run test:route
|
command: npm run test:route
|
||||||
|
- run:
|
||||||
|
name: Test - HTML sanitization
|
||||||
|
command: npm run test:safehtml
|
||||||
- run:
|
- run:
|
||||||
name: Test - Coverage
|
name: Test - Coverage
|
||||||
command: npm run test:coverage
|
command: npm run test:coverage
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
require('./brewLookup.less');
|
||||||
|
|
||||||
const React = require('react');
|
const React = require('react');
|
||||||
const createClass = require('create-react-class');
|
const createClass = require('create-react-class');
|
||||||
const cx = require('classnames');
|
const cx = require('classnames');
|
||||||
@@ -12,22 +14,43 @@ const BrewLookup = createClass({
|
|||||||
},
|
},
|
||||||
getInitialState() {
|
getInitialState() {
|
||||||
return {
|
return {
|
||||||
query : '',
|
query : '',
|
||||||
foundBrew : null,
|
foundBrew : null,
|
||||||
searching : false,
|
searching : false,
|
||||||
error : null
|
error : null,
|
||||||
|
scriptCount : 0
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
handleChange(e){
|
handleChange(e){
|
||||||
this.setState({ query: e.target.value });
|
this.setState({ query: e.target.value });
|
||||||
},
|
},
|
||||||
lookup(){
|
lookup(){
|
||||||
this.setState({ searching: true, error: null });
|
this.setState({ searching: true, error: null, scriptCount: 0 });
|
||||||
|
|
||||||
request.get(`/admin/lookup/${this.state.query}`)
|
request.get(`/admin/lookup/${this.state.query}`)
|
||||||
.then((res)=>this.setState({ foundBrew: res.body }))
|
.then((res)=>{
|
||||||
|
const foundBrew = res.body;
|
||||||
|
const scriptCheck = foundBrew?.text.match(/(<\/?s)cript/g);
|
||||||
|
this.setState({
|
||||||
|
foundBrew : foundBrew,
|
||||||
|
scriptCount : scriptCheck?.length || 0,
|
||||||
|
});
|
||||||
|
})
|
||||||
.catch((err)=>this.setState({ error: err }))
|
.catch((err)=>this.setState({ error: err }))
|
||||||
.finally(()=>this.setState({ searching: false }));
|
.finally(()=>{
|
||||||
|
this.setState({
|
||||||
|
searching : false
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
async cleanScript(){
|
||||||
|
if(!this.state.foundBrew?.shareId) return;
|
||||||
|
|
||||||
|
await request.put(`/admin/clean/script/${this.state.foundBrew.shareId}`)
|
||||||
|
.catch((err)=>{ this.setState({ error: err }); return; });
|
||||||
|
|
||||||
|
this.lookup();
|
||||||
},
|
},
|
||||||
|
|
||||||
renderFoundBrew(){
|
renderFoundBrew(){
|
||||||
@@ -46,12 +69,23 @@ const BrewLookup = createClass({
|
|||||||
<dt>Share Link</dt>
|
<dt>Share Link</dt>
|
||||||
<dd><a href={`/share/${brew.shareId}`} target='_blank' rel='noopener noreferrer'>/share/{brew.shareId}</a></dd>
|
<dd><a href={`/share/${brew.shareId}`} target='_blank' rel='noopener noreferrer'>/share/{brew.shareId}</a></dd>
|
||||||
|
|
||||||
|
<dt>Created Time</dt>
|
||||||
|
<dd>{brew.createdAt ? Moment(brew.createdAt).toLocaleString() : 'No creation date'}</dd>
|
||||||
|
|
||||||
<dt>Last Updated</dt>
|
<dt>Last Updated</dt>
|
||||||
<dd>{Moment(brew.updatedAt).fromNow()}</dd>
|
<dd>{Moment(brew.updatedAt).fromNow()}</dd>
|
||||||
|
|
||||||
<dt>Num of Views</dt>
|
<dt>Num of Views</dt>
|
||||||
<dd>{brew.views}</dd>
|
<dd>{brew.views}</dd>
|
||||||
|
|
||||||
|
<dt>SCRIPT tags detected</dt>
|
||||||
|
<dd>{this.state.scriptCount}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
{this.state.scriptCount > 0 &&
|
||||||
|
<div className='cleanButton'>
|
||||||
|
<button onClick={this.cleanScript}>CLEAN BREW</button>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
</div>;
|
</div>;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
6
client/admin/brewUtils/brewLookup/brewLookup.less
Normal file
6
client/admin/brewUtils/brewLookup/brewLookup.less
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
.brewLookup {
|
||||||
|
.cleanButton {
|
||||||
|
display : inline-block;
|
||||||
|
width : 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
91
client/components/Anchored.jsx
Normal file
91
client/components/Anchored.jsx
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
import React, { useState, useRef, forwardRef, useEffect, cloneElement, Children } from 'react';
|
||||||
|
import './Anchored.less';
|
||||||
|
|
||||||
|
// Anchored is a wrapper component that must have as children an <AnchoredTrigger> and a <AnchoredBox> component.
|
||||||
|
// AnchoredTrigger must have a unique `id` prop, which is passed up to Anchored, saved in state on mount, and
|
||||||
|
// then passed down through props into AnchoredBox. The `id` is used for the CSS Anchor Positioning properties.
|
||||||
|
// **The Anchor Positioning API is not available in Firefox yet**
|
||||||
|
// So in Firefox the positioning isn't perfect but is likely sufficient, and FF team seems to be working on the API quickly.
|
||||||
|
|
||||||
|
|
||||||
|
const Anchored = ({ children })=>{
|
||||||
|
const [visible, setVisible] = useState(false);
|
||||||
|
const [anchorId, setAnchorId] = useState(null);
|
||||||
|
const boxRef = useRef(null);
|
||||||
|
const triggerRef = useRef(null);
|
||||||
|
|
||||||
|
// promote trigger id to Anchored id (to pass it back down to the box as "anchorId")
|
||||||
|
useEffect(()=>{
|
||||||
|
if(triggerRef.current){
|
||||||
|
setAnchorId(triggerRef.current.id);
|
||||||
|
}
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
// close box on outside click or Escape key
|
||||||
|
useEffect(()=>{
|
||||||
|
const handleClickOutside = (evt)=>{
|
||||||
|
if(
|
||||||
|
boxRef.current &&
|
||||||
|
!boxRef.current.contains(evt.target) &&
|
||||||
|
triggerRef.current &&
|
||||||
|
!triggerRef.current.contains(evt.target)
|
||||||
|
) {
|
||||||
|
setVisible(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleEscapeKey = (evt)=>{
|
||||||
|
if(evt.key === 'Escape') setVisible(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
window.addEventListener('click', handleClickOutside);
|
||||||
|
window.addEventListener('keydown', handleEscapeKey);
|
||||||
|
|
||||||
|
return ()=>{
|
||||||
|
window.removeEventListener('click', handleClickOutside);
|
||||||
|
window.removeEventListener('keydown', handleEscapeKey);
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
const toggleVisibility = ()=>setVisible((prev)=>!prev);
|
||||||
|
|
||||||
|
// Map children to inject necessary props
|
||||||
|
const mappedChildren = Children.map(children, (child)=>{
|
||||||
|
if(child.type === AnchoredTrigger) {
|
||||||
|
return cloneElement(child, { ref: triggerRef, toggleVisibility, visible });
|
||||||
|
}
|
||||||
|
if(child.type === AnchoredBox) {
|
||||||
|
return cloneElement(child, { ref: boxRef, visible, anchorId });
|
||||||
|
}
|
||||||
|
return child;
|
||||||
|
});
|
||||||
|
|
||||||
|
return <>{mappedChildren}</>;
|
||||||
|
};
|
||||||
|
|
||||||
|
// forward ref for AnchoredTrigger
|
||||||
|
const AnchoredTrigger = forwardRef(({ toggleVisibility, visible, children, className, ...props }, ref)=>(
|
||||||
|
<button
|
||||||
|
ref={ref}
|
||||||
|
className={`anchored-trigger${visible ? ' active' : ''} ${className}`}
|
||||||
|
onClick={toggleVisibility}
|
||||||
|
style={{ anchorName: `--${props.id}` }} // setting anchor properties here allows greater recyclability.
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</button>
|
||||||
|
));
|
||||||
|
|
||||||
|
// forward ref for AnchoredBox
|
||||||
|
const AnchoredBox = forwardRef(({ visible, children, className, anchorId, ...props }, ref)=>(
|
||||||
|
<div
|
||||||
|
ref={ref}
|
||||||
|
className={`anchored-box${visible ? ' active' : ''} ${className}`}
|
||||||
|
style={{ positionAnchor: `--${anchorId}` }} // setting anchor properties here allows greater recyclability.
|
||||||
|
{...props}
|
||||||
|
>
|
||||||
|
{children}
|
||||||
|
</div>
|
||||||
|
));
|
||||||
|
|
||||||
|
export { Anchored, AnchoredTrigger, AnchoredBox };
|
||||||
13
client/components/Anchored.less
Normal file
13
client/components/Anchored.less
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
|
||||||
|
|
||||||
|
.anchored-box {
|
||||||
|
position:absolute;
|
||||||
|
@supports (inset-block-start: anchor(bottom)){
|
||||||
|
inset-block-start: anchor(bottom);
|
||||||
|
}
|
||||||
|
justify-self: anchor-center;
|
||||||
|
visibility: hidden;
|
||||||
|
&.active {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,25 +1,25 @@
|
|||||||
// Dialog box, for popups and modal blocking messages
|
// Dialog box, for popups and modal blocking messages
|
||||||
import React from "react";
|
import React from 'react';
|
||||||
const { useRef, useEffect } = React;
|
const { useRef, useEffect } = React;
|
||||||
|
|
||||||
function Dialog({ dismisskeys, closeText = 'Close', blocking = false, ...rest }) {
|
function Dialog({ dismisskeys = [], closeText = 'Close', blocking = false, ...rest }) {
|
||||||
const dialogRef = useRef(null);
|
const dialogRef = useRef(null);
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if (dismisskeys.length !== 0) {
|
if(dismisskeys.length !== 0) {
|
||||||
blocking ? dialogRef.current?.showModal() : dialogRef.current?.show();
|
blocking ? dialogRef.current?.showModal() : dialogRef.current?.show();
|
||||||
}
|
}
|
||||||
}, [dialogRef.current, dismisskeys]);
|
}, [dialogRef.current, dismisskeys]);
|
||||||
|
|
||||||
const dismiss = () => {
|
const dismiss = ()=>{
|
||||||
dismisskeys.forEach(key => {
|
dismisskeys.forEach((key)=>{
|
||||||
if (key) {
|
if(key) {
|
||||||
localStorage.setItem(key, 'true');
|
localStorage.setItem(key, 'true');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
dialogRef.current?.close();
|
dialogRef.current?.close();
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<dialog ref={dialogRef} onCancel={dismiss} {...rest}>
|
<dialog ref={dialogRef} onCancel={dismiss} {...rest}>
|
||||||
{rest.children}
|
{rest.children}
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ const { useState, useRef, useCallback, useMemo } = React;
|
|||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
|
|
||||||
const MarkdownLegacy = require('naturalcrit/markdownLegacy.js');
|
const MarkdownLegacy = require('naturalcrit/markdownLegacy.js');
|
||||||
const Markdown = require('naturalcrit/markdown.js');
|
import Markdown from 'naturalcrit/markdown.js';
|
||||||
const ErrorBar = require('./errorBar/errorBar.jsx');
|
const ErrorBar = require('./errorBar/errorBar.jsx');
|
||||||
const ToolBar = require('./toolBar/toolBar.jsx');
|
const ToolBar = require('./toolBar/toolBar.jsx');
|
||||||
|
|
||||||
@@ -16,8 +16,7 @@ const Frame = require('react-frame-component').default;
|
|||||||
const dedent = require('dedent-tabs').default;
|
const dedent = require('dedent-tabs').default;
|
||||||
const { printCurrentBrew } = require('../../../shared/helpers.js');
|
const { printCurrentBrew } = require('../../../shared/helpers.js');
|
||||||
|
|
||||||
const DOMPurify = require('dompurify');
|
import { safeHTML } from './safeHTML.js';
|
||||||
const purifyConfig = { FORCE_BODY: true, SANITIZE_DOM: false };
|
|
||||||
|
|
||||||
const PAGE_HEIGHT = 1056;
|
const PAGE_HEIGHT = 1056;
|
||||||
|
|
||||||
@@ -29,6 +28,7 @@ const INITIAL_CONTENT = dedent`
|
|||||||
<base target=_blank>
|
<base target=_blank>
|
||||||
</head><body style='overflow: hidden'><div></div></body></html>`;
|
</head><body style='overflow: hidden'><div></div></body></html>`;
|
||||||
|
|
||||||
|
|
||||||
//v=====----------------------< Brew Page Component >---------------------=====v//
|
//v=====----------------------< Brew Page Component >---------------------=====v//
|
||||||
const BrewPage = (props)=>{
|
const BrewPage = (props)=>{
|
||||||
props = {
|
props = {
|
||||||
@@ -36,8 +36,8 @@ const BrewPage = (props)=>{
|
|||||||
index : 0,
|
index : 0,
|
||||||
...props
|
...props
|
||||||
};
|
};
|
||||||
const cleanText = props.contents; //DOMPurify.sanitize(props.contents, purifyConfig);
|
const cleanText = safeHTML(props.contents);
|
||||||
return <div className={props.className} id={`p${props.index + 1}`} >
|
return <div className={props.className} id={`p${props.index + 1}`} style={props.style}>
|
||||||
<div className='columnWrapper' dangerouslySetInnerHTML={{ __html: cleanText }} />
|
<div className='columnWrapper' dangerouslySetInnerHTML={{ __html: cleanText }} />
|
||||||
</div>;
|
</div>;
|
||||||
};
|
};
|
||||||
@@ -65,8 +65,14 @@ const BrewRenderer = (props)=>{
|
|||||||
|
|
||||||
const [state, setState] = useState({
|
const [state, setState] = useState({
|
||||||
isMounted : false,
|
isMounted : false,
|
||||||
visibility : 'hidden',
|
visibility : 'hidden'
|
||||||
zoom : 100
|
});
|
||||||
|
|
||||||
|
const [displayOptions, setDisplayOptions] = useState({
|
||||||
|
zoomLevel : 100,
|
||||||
|
spread : 'single',
|
||||||
|
startOnRight : true,
|
||||||
|
pageShadows : true
|
||||||
});
|
});
|
||||||
|
|
||||||
const mainRef = useRef(null);
|
const mainRef = useRef(null);
|
||||||
@@ -77,19 +83,19 @@ const BrewRenderer = (props)=>{
|
|||||||
rawPages = props.text.split(/^\\page$/gm);
|
rawPages = props.text.split(/^\\page$/gm);
|
||||||
}
|
}
|
||||||
|
|
||||||
const scrollToHash = (hash) => {
|
const scrollToHash = (hash)=>{
|
||||||
if (!hash) return;
|
if(!hash) return;
|
||||||
|
|
||||||
const iframeDoc = document.getElementById('BrewRenderer').contentDocument;
|
const iframeDoc = document.getElementById('BrewRenderer').contentDocument;
|
||||||
let anchor = iframeDoc.querySelector(hash);
|
let anchor = iframeDoc.querySelector(hash);
|
||||||
|
|
||||||
if (anchor) {
|
if(anchor) {
|
||||||
anchor.scrollIntoView({ behavior: 'smooth' });
|
anchor.scrollIntoView({ behavior: 'smooth' });
|
||||||
} else {
|
} else {
|
||||||
// Use MutationObserver to wait for the element if it's not immediately available
|
// Use MutationObserver to wait for the element if it's not immediately available
|
||||||
new MutationObserver((mutations, obs) => {
|
new MutationObserver((mutations, obs)=>{
|
||||||
anchor = iframeDoc.querySelector(hash);
|
anchor = iframeDoc.querySelector(hash);
|
||||||
if (anchor) {
|
if(anchor) {
|
||||||
anchor.scrollIntoView({ behavior: 'smooth' });
|
anchor.scrollIntoView({ behavior: 'smooth' });
|
||||||
obs.disconnect();
|
obs.disconnect();
|
||||||
}
|
}
|
||||||
@@ -125,9 +131,9 @@ const BrewRenderer = (props)=>{
|
|||||||
};
|
};
|
||||||
|
|
||||||
const renderStyle = ()=>{
|
const renderStyle = ()=>{
|
||||||
const cleanStyle = props.style; //DOMPurify.sanitize(props.style, purifyConfig);
|
|
||||||
const themeStyles = props.themeBundle?.joinedStyles ?? '<style>@import url("/themes/V3/Blank/style.css");</style>';
|
const themeStyles = props.themeBundle?.joinedStyles ?? '<style>@import url("/themes/V3/Blank/style.css");</style>';
|
||||||
return <div style={{ display: 'none' }} dangerouslySetInnerHTML={{ __html: `${themeStyles} \n\n <style> ${cleanStyle} </style>` }} />;
|
const cleanStyle = safeHTML(`${themeStyles} \n\n <style> ${props.style} </style>`);
|
||||||
|
return <div style={{ display: 'none' }} dangerouslySetInnerHTML={{ __html: cleanStyle }} />;
|
||||||
};
|
};
|
||||||
|
|
||||||
const renderPage = (pageText, index)=>{
|
const renderPage = (pageText, index)=>{
|
||||||
@@ -137,7 +143,13 @@ const BrewRenderer = (props)=>{
|
|||||||
} else {
|
} else {
|
||||||
pageText += `\n\n \n\\column\n `; //Artificial column break at page end to emulate column-fill:auto (until `wide` is used, when column-fill:balance will reappear)
|
pageText += `\n\n \n\\column\n `; //Artificial column break at page end to emulate column-fill:auto (until `wide` is used, when column-fill:balance will reappear)
|
||||||
const html = Markdown.render(pageText, index);
|
const html = Markdown.render(pageText, index);
|
||||||
return <BrewPage className='page' index={index} key={index} contents={html} />;
|
|
||||||
|
const styles = {
|
||||||
|
...(!displayOptions.pageShadows ? { boxShadow: 'none' } : {})
|
||||||
|
// Add more conditions as needed
|
||||||
|
};
|
||||||
|
|
||||||
|
return <BrewPage className='page' index={index} key={index} contents={html} style={styles} />;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -149,7 +161,8 @@ const BrewRenderer = (props)=>{
|
|||||||
renderedPages.length = 0;
|
renderedPages.length = 0;
|
||||||
|
|
||||||
// Render currently-edited page first so cross-page effects (variables, links) can propagate out first
|
// Render currently-edited page first so cross-page effects (variables, links) can propagate out first
|
||||||
renderedPages[props.currentEditorCursorPageNum - 1] = renderPage(rawPages[props.currentEditorCursorPageNum - 1], props.currentEditorCursorPageNum - 1);
|
if(rawPages.length > props.currentEditorCursorPageNum -1)
|
||||||
|
renderedPages[props.currentEditorCursorPageNum - 1] = renderPage(rawPages[props.currentEditorCursorPageNum - 1], props.currentEditorCursorPageNum - 1);
|
||||||
|
|
||||||
_.forEach(rawPages, (page, index)=>{
|
_.forEach(rawPages, (page, index)=>{
|
||||||
if((isInView(index) || !renderedPages[index]) && typeof window !== 'undefined'){
|
if((isInView(index) || !renderedPages[index]) && typeof window !== 'undefined'){
|
||||||
@@ -187,12 +200,14 @@ const BrewRenderer = (props)=>{
|
|||||||
document.dispatchEvent(new MouseEvent('click'));
|
document.dispatchEvent(new MouseEvent('click'));
|
||||||
};
|
};
|
||||||
|
|
||||||
//Toolbar settings:
|
const handleDisplayOptionsChange = (newDisplayOptions)=>{
|
||||||
const handleZoom = (newZoom)=>{
|
setDisplayOptions(newDisplayOptions);
|
||||||
setState((prevState)=>({
|
};
|
||||||
...prevState,
|
|
||||||
zoom : newZoom
|
const pagesStyle = {
|
||||||
}));
|
zoom : `${displayOptions.zoomLevel}%`,
|
||||||
|
columnGap : `${displayOptions.columnGap}px`,
|
||||||
|
rowGap : `${displayOptions.rowGap}px`
|
||||||
};
|
};
|
||||||
|
|
||||||
const styleObject = {};
|
const styleObject = {};
|
||||||
@@ -201,8 +216,8 @@ const BrewRenderer = (props)=>{
|
|||||||
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='%23fff7' font-size='20'>${global.config.deployment}</text></svg>")`;
|
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='%23fff7' font-size='20'>${global.config.deployment}</text></svg>")`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const renderedStyle = useMemo(()=> renderStyle(), [props.style, props.themeBundle]);
|
const renderedStyle = useMemo(()=>renderStyle(), [props.style, props.themeBundle]);
|
||||||
renderedPages = useMemo(() => renderPages(), [props.text]);
|
renderedPages = useMemo(()=>renderPages(), [props.text]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -221,7 +236,7 @@ const BrewRenderer = (props)=>{
|
|||||||
<NotificationPopup />
|
<NotificationPopup />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<ToolBar onZoomChange={handleZoom} currentPage={props.currentBrewRendererPageNum} totalPages={rawPages.length}/>
|
<ToolBar displayOptions={displayOptions} currentPage={props.currentBrewRendererPageNum} totalPages={rawPages.length} onDisplayOptionsChange={handleDisplayOptionsChange} />
|
||||||
|
|
||||||
{/*render in iFrame so broken code doesn't crash the site.*/}
|
{/*render in iFrame so broken code doesn't crash the site.*/}
|
||||||
<Frame id='BrewRenderer' initialContent={INITIAL_CONTENT}
|
<Frame id='BrewRenderer' initialContent={INITIAL_CONTENT}
|
||||||
@@ -240,7 +255,8 @@ const BrewRenderer = (props)=>{
|
|||||||
&&
|
&&
|
||||||
<>
|
<>
|
||||||
{renderedStyle}
|
{renderedStyle}
|
||||||
<div className='pages' lang={`${props.lang || 'en'}`} style={{ zoom: `${state.zoom}%` }}>
|
<div lang={`${props.lang || 'en'}`} style={pagesStyle} className={
|
||||||
|
`pages ${displayOptions.startOnRight ? 'recto' : 'verso'} ${displayOptions.spread}` } >
|
||||||
{renderedPages}
|
{renderedPages}
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -3,13 +3,45 @@
|
|||||||
.brewRenderer {
|
.brewRenderer {
|
||||||
overflow-y : scroll;
|
overflow-y : scroll;
|
||||||
will-change : transform;
|
will-change : transform;
|
||||||
padding-top : 30px;
|
padding-top : 60px;
|
||||||
height : 100vh;
|
height : 100vh;
|
||||||
|
&:has(.facing, .flow) {
|
||||||
|
padding : 60px 30px;
|
||||||
|
}
|
||||||
&.deployment {
|
&.deployment {
|
||||||
background-color: darkred;
|
background-color: darkred;
|
||||||
}
|
}
|
||||||
:where(.pages) {
|
:where(.pages) {
|
||||||
margin : 30px 0px;
|
&.facing {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(2, auto);
|
||||||
|
grid-template-rows: repeat(3, auto);
|
||||||
|
gap: 10px 10px;
|
||||||
|
justify-content: center;
|
||||||
|
&.recto .page:first-child {
|
||||||
|
// sets first page on 'right' ('recto') of the preview, as if for a Cover page.
|
||||||
|
// todo: add a checkbox to toggle this setting
|
||||||
|
grid-column-start: 2;
|
||||||
|
}
|
||||||
|
& :where(.page) {
|
||||||
|
margin-left: unset !important;
|
||||||
|
margin-right: unset !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.flow {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 10px;
|
||||||
|
justify-content: flex-start;
|
||||||
|
& :where(.page) {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
margin-left: unset !important;
|
||||||
|
margin-right: unset !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
& > :where(.page) {
|
& > :where(.page) {
|
||||||
width : 215.9mm;
|
width : 215.9mm;
|
||||||
height : 279.4mm;
|
height : 279.4mm;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
require('./notificationPopup.less');
|
require('./notificationPopup.less');
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
const request = require('../../utils/request-middleware.js');
|
import request from '../../utils/request-middleware.js';
|
||||||
|
|
||||||
import Dialog from '../../../components/dialog.jsx';
|
import Dialog from '../../../components/dialog.jsx';
|
||||||
|
|
||||||
|
|||||||
46
client/homebrew/brewRenderer/safeHTML.js
Normal file
46
client/homebrew/brewRenderer/safeHTML.js
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
// Derived from the vue-html-secure package, customized for Homebrewery
|
||||||
|
|
||||||
|
let doc = null;
|
||||||
|
let div = null;
|
||||||
|
|
||||||
|
function safeHTML(htmlString) {
|
||||||
|
// If the Document interface doesn't exist, exit
|
||||||
|
if(typeof document == 'undefined') return null;
|
||||||
|
// If the test document and div don't exist, create them
|
||||||
|
if(!doc) doc = document.implementation.createHTMLDocument('');
|
||||||
|
if(!div) div = doc.createElement('div');
|
||||||
|
|
||||||
|
// Set the test div contents to the evaluation string
|
||||||
|
div.innerHTML = htmlString;
|
||||||
|
// Grab all nodes from the test div
|
||||||
|
const elements = div.querySelectorAll('*');
|
||||||
|
|
||||||
|
// Blacklisted tags
|
||||||
|
const blacklistTags = ['script', 'noscript', 'noembed'];
|
||||||
|
// Tests to remove attributes
|
||||||
|
const blacklistAttrs = [
|
||||||
|
(test)=>{return test.localName.indexOf('on') == 0;},
|
||||||
|
(test)=>{return test.localName.indexOf('type') == 0 && test.value.match(/submit/i);},
|
||||||
|
(test)=>{return test.value.replace(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205f\u3000]/g, '').toLowerCase().trim().indexOf('javascript:') == 0;}
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
elements.forEach((element)=>{
|
||||||
|
// Check each element for blacklisted type
|
||||||
|
if(blacklistTags.includes(element?.localName?.toLowerCase())) {
|
||||||
|
element.remove();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// Check remaining elements for blacklisted attributes
|
||||||
|
for (const attribute of element.attributes){
|
||||||
|
if(blacklistAttrs.some((test)=>{return test(attribute);})) {
|
||||||
|
element.removeAttribute(attribute.localName);
|
||||||
|
break;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
return div.innerHTML;
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports.safeHTML = safeHTML;
|
||||||
@@ -3,26 +3,28 @@ const React = require('react');
|
|||||||
const { useState, useEffect } = React;
|
const { useState, useEffect } = React;
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
|
|
||||||
|
import { Anchored, AnchoredBox, AnchoredTrigger } from '../../../components/Anchored.jsx';
|
||||||
|
// import * as ZoomIcons from '../../../icons/icon-components/zoomIcons.jsx';
|
||||||
|
|
||||||
const MAX_ZOOM = 300;
|
const MAX_ZOOM = 300;
|
||||||
const MIN_ZOOM = 10;
|
const MIN_ZOOM = 10;
|
||||||
|
|
||||||
const ToolBar = ({ onZoomChange, currentPage, onPageChange, totalPages })=>{
|
const ToolBar = ({ displayOptions, currentPage, totalPages, onDisplayOptionsChange })=>{
|
||||||
|
|
||||||
const [zoomLevel, setZoomLevel] = useState(100);
|
const [pageNum, setPageNum] = useState(currentPage);
|
||||||
const [pageNum, setPageNum] = useState(currentPage);
|
|
||||||
const [toolsVisible, setToolsVisible] = useState(true);
|
const [toolsVisible, setToolsVisible] = useState(true);
|
||||||
|
|
||||||
useEffect(()=>{
|
|
||||||
onZoomChange(zoomLevel);
|
|
||||||
}, [zoomLevel]);
|
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
setPageNum(currentPage);
|
setPageNum(currentPage);
|
||||||
}, [currentPage]);
|
}, [currentPage]);
|
||||||
|
|
||||||
const handleZoomButton = (zoom)=>{
|
const handleZoomButton = (zoom)=>{
|
||||||
setZoomLevel(_.round(_.clamp(zoom, MIN_ZOOM, MAX_ZOOM)));
|
handleOptionChange('zoomLevel', _.round(_.clamp(zoom, MIN_ZOOM, MAX_ZOOM)));
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleOptionChange = (optionKey, newValue)=>{
|
||||||
|
//setDisplayOptions(prevOptions => ({ ...prevOptions, [optionKey]: newValue }));
|
||||||
|
onDisplayOptionsChange({ ...displayOptions, [optionKey]: newValue });
|
||||||
};
|
};
|
||||||
|
|
||||||
const handlePageInput = (pageInput)=>{
|
const handlePageInput = (pageInput)=>{
|
||||||
@@ -63,47 +65,51 @@ const ToolBar = ({ onZoomChange, currentPage, onPageChange, totalPages })=>{
|
|||||||
|
|
||||||
const margin = 5; // extra space so page isn't edge to edge (not truly "to fill")
|
const margin = 5; // extra space so page isn't edge to edge (not truly "to fill")
|
||||||
|
|
||||||
const deltaZoom = (desiredZoom - zoomLevel) - margin;
|
const deltaZoom = (desiredZoom - displayOptions.zoomLevel) - margin;
|
||||||
return deltaZoom;
|
return deltaZoom;
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`toolBar ${toolsVisible ? 'visible' : 'hidden'}`}>
|
<div id='preview-toolbar' className={`toolBar ${toolsVisible ? 'visible' : 'hidden'}`} role='toolbar'>
|
||||||
<button className='toggleButton' title={`${toolsVisible ? 'Hide' : 'Show'} Preview Toolbar`} onClick={()=>{setToolsVisible(!toolsVisible);}}><i className='fas fa-glasses' /></button>
|
<button className='toggleButton' title={`${toolsVisible ? 'Hide' : 'Show'} Preview Toolbar`} onClick={()=>{setToolsVisible(!toolsVisible);}}><i className='fas fa-glasses' /></button>
|
||||||
{/*v=====----------------------< Zoom Controls >---------------------=====v*/}
|
{/*v=====----------------------< Zoom Controls >---------------------=====v*/}
|
||||||
<div className='group'>
|
<div className='group' role='group' aria-label='Zoom' aria-hidden={!toolsVisible}>
|
||||||
<button
|
<button
|
||||||
id='fill-width'
|
id='fill-width'
|
||||||
className='tool'
|
className='tool'
|
||||||
onClick={()=>handleZoomButton(zoomLevel + calculateChange('fill'))}
|
title='Set zoom to fill preview with one page'
|
||||||
|
onClick={()=>handleZoomButton(displayOptions.zoomLevel + calculateChange('fill'))}
|
||||||
>
|
>
|
||||||
<i className='fac fit-width' />
|
<i className='fac fit-width' />
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
id='zoom-to-fit'
|
id='zoom-to-fit'
|
||||||
className='tool'
|
className='tool'
|
||||||
onClick={()=>handleZoomButton(zoomLevel + calculateChange('fit'))}
|
title='Set zoom to fit entire page in preview'
|
||||||
|
onClick={()=>handleZoomButton(displayOptions.zoomLevel + calculateChange('fit'))}
|
||||||
>
|
>
|
||||||
<i className='fac zoom-to-fit' />
|
<i className='fac zoom-to-fit' />
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
id='zoom-out'
|
id='zoom-out'
|
||||||
className='tool'
|
className='tool'
|
||||||
onClick={()=>handleZoomButton(zoomLevel - 20)}
|
onClick={()=>handleZoomButton(displayOptions.zoomLevel - 20)}
|
||||||
disabled={zoomLevel <= MIN_ZOOM}
|
disabled={displayOptions.zoomLevel <= MIN_ZOOM}
|
||||||
|
title='Zoom Out'
|
||||||
>
|
>
|
||||||
<i className='fas fa-magnifying-glass-minus' />
|
<i className='fas fa-magnifying-glass-minus' />
|
||||||
</button>
|
</button>
|
||||||
<input
|
<input
|
||||||
id='zoom-slider'
|
id='zoom-slider'
|
||||||
className='range-input tool'
|
className='range-input tool hover-tooltip'
|
||||||
type='range'
|
type='range'
|
||||||
name='zoom'
|
name='zoom'
|
||||||
|
title='Set Zoom'
|
||||||
list='zoomLevels'
|
list='zoomLevels'
|
||||||
min={MIN_ZOOM}
|
min={MIN_ZOOM}
|
||||||
max={MAX_ZOOM}
|
max={MAX_ZOOM}
|
||||||
step='1'
|
step='1'
|
||||||
value={zoomLevel}
|
value={displayOptions.zoomLevel}
|
||||||
onChange={(e)=>handleZoomButton(parseInt(e.target.value))}
|
onChange={(e)=>handleZoomButton(parseInt(e.target.value))}
|
||||||
/>
|
/>
|
||||||
<datalist id='zoomLevels'>
|
<datalist id='zoomLevels'>
|
||||||
@@ -113,18 +119,72 @@ const ToolBar = ({ onZoomChange, currentPage, onPageChange, totalPages })=>{
|
|||||||
<button
|
<button
|
||||||
id='zoom-in'
|
id='zoom-in'
|
||||||
className='tool'
|
className='tool'
|
||||||
onClick={()=>handleZoomButton(zoomLevel + 20)}
|
onClick={()=>handleZoomButton(displayOptions.zoomLevel + 20)}
|
||||||
disabled={zoomLevel >= MAX_ZOOM}
|
disabled={displayOptions.zoomLevel >= MAX_ZOOM}
|
||||||
|
title='Zoom In'
|
||||||
>
|
>
|
||||||
<i className='fas fa-magnifying-glass-plus' />
|
<i className='fas fa-magnifying-glass-plus' />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/*v=====----------------------< Spread Controls >---------------------=====v*/}
|
||||||
|
<div className='group' role='group' aria-label='Spread' aria-hidden={!toolsVisible}>
|
||||||
|
<div className='radio-group' role='radiogroup'>
|
||||||
|
<button role='radio'
|
||||||
|
id='single-spread'
|
||||||
|
className='tool'
|
||||||
|
title='Single Page'
|
||||||
|
onClick={()=>{handleOptionChange('spread', 'active');}}
|
||||||
|
aria-checked={displayOptions.spread === 'single'}
|
||||||
|
><i className='fac single-spread' /></button>
|
||||||
|
<button role='radio'
|
||||||
|
id='facing-spread'
|
||||||
|
className='tool'
|
||||||
|
title='Facing Pages'
|
||||||
|
onClick={()=>{handleOptionChange('spread', 'facing');}}
|
||||||
|
aria-checked={displayOptions.spread === 'facing'}
|
||||||
|
><i className='fac facing-spread' /></button>
|
||||||
|
<button role='radio'
|
||||||
|
id='flow-spread'
|
||||||
|
className='tool'
|
||||||
|
title='Flow Pages'
|
||||||
|
onClick={()=>{handleOptionChange('spread', 'flow');}}
|
||||||
|
aria-checked={displayOptions.spread === 'flow'}
|
||||||
|
><i className='fac flow-spread' /></button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<Anchored>
|
||||||
|
<AnchoredTrigger id='spread-settings' className='tool' title='Spread options'><i className='fas fa-gear' /></AnchoredTrigger>
|
||||||
|
<AnchoredBox title='Options'>
|
||||||
|
<h1>Options</h1>
|
||||||
|
<label title='Modify the horizontal space between pages.'>
|
||||||
|
Column gap
|
||||||
|
<input type='range' min={0} max={200} defaultValue={10} className='range-input' onChange={(evt)=>handleOptionChange('columnGap', evt.target.value)} />
|
||||||
|
</label>
|
||||||
|
<label title='Modify the vertical space between rows of pages.'>
|
||||||
|
Row gap
|
||||||
|
<input type='range' min={0} max={200} defaultValue={10} className='range-input' onChange={(evt)=>handleOptionChange('rowGap', evt.target.value)} />
|
||||||
|
</label>
|
||||||
|
<label title='Start 1st page on the right side, such as if you have cover page.'>
|
||||||
|
Start on right
|
||||||
|
<input type='checkbox' checked={displayOptions.startOnRight} onChange={()=>{handleOptionChange('startOnRight', !displayOptions.startOnRight);}}
|
||||||
|
title={displayOptions.spread !== 'facing' ? 'Switch to Facing to enable toggle.' : null} />
|
||||||
|
</label>
|
||||||
|
<label title='Toggle the page shadow on every page.'>
|
||||||
|
Page shadows
|
||||||
|
<input type='checkbox' checked={displayOptions.pageShadows} onChange={()=>{handleOptionChange('pageShadows', !displayOptions.pageShadows);}} />
|
||||||
|
</label>
|
||||||
|
</AnchoredBox>
|
||||||
|
</Anchored>
|
||||||
|
</div>
|
||||||
|
|
||||||
{/*v=====----------------------< Page Controls >---------------------=====v*/}
|
{/*v=====----------------------< Page Controls >---------------------=====v*/}
|
||||||
<div className='group'>
|
<div className='group' role='group' aria-label='Pages' aria-hidden={!toolsVisible}>
|
||||||
<button
|
<button
|
||||||
id='previous-page'
|
id='previous-page'
|
||||||
className='previousPage tool'
|
className='previousPage tool'
|
||||||
|
type='button'
|
||||||
|
title='Previous Page(s)'
|
||||||
onClick={()=>scrollToPage(pageNum - 1)}
|
onClick={()=>scrollToPage(pageNum - 1)}
|
||||||
disabled={pageNum <= 1}
|
disabled={pageNum <= 1}
|
||||||
>
|
>
|
||||||
@@ -137,6 +197,7 @@ const ToolBar = ({ onZoomChange, currentPage, onPageChange, totalPages })=>{
|
|||||||
className='text-input'
|
className='text-input'
|
||||||
type='text'
|
type='text'
|
||||||
name='page'
|
name='page'
|
||||||
|
title='Current page(s) in view'
|
||||||
inputMode='numeric'
|
inputMode='numeric'
|
||||||
pattern='[0-9]'
|
pattern='[0-9]'
|
||||||
value={pageNum}
|
value={pageNum}
|
||||||
@@ -145,12 +206,14 @@ const ToolBar = ({ onZoomChange, currentPage, onPageChange, totalPages })=>{
|
|||||||
onBlur={()=>scrollToPage(pageNum)}
|
onBlur={()=>scrollToPage(pageNum)}
|
||||||
onKeyDown={(e)=>e.key == 'Enter' && scrollToPage(pageNum)}
|
onKeyDown={(e)=>e.key == 'Enter' && scrollToPage(pageNum)}
|
||||||
/>
|
/>
|
||||||
<span id='page-count'>/ {totalPages}</span>
|
<span id='page-count' title='Total Page Count'>/ {totalPages}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
id='next-page'
|
id='next-page'
|
||||||
className='tool'
|
className='tool'
|
||||||
|
type='button'
|
||||||
|
title='Next Page(s)'
|
||||||
onClick={()=>scrollToPage(pageNum + 1)}
|
onClick={()=>scrollToPage(pageNum + 1)}
|
||||||
disabled={pageNum >= totalPages}
|
disabled={pageNum >= totalPages}
|
||||||
>
|
>
|
||||||
|
|||||||
@@ -13,11 +13,12 @@
|
|||||||
height : auto;
|
height : auto;
|
||||||
padding : 2px 0;
|
padding : 2px 0;
|
||||||
font-family : 'Open Sans', sans-serif;
|
font-family : 'Open Sans', sans-serif;
|
||||||
|
font-size : 13px;
|
||||||
color : #CCCCCC;
|
color : #CCCCCC;
|
||||||
background-color : #555555;
|
background-color : #555555;
|
||||||
& > *:not(.toggleButton) {
|
& > *:not(.toggleButton) {
|
||||||
opacity: 1;
|
opacity : 1;
|
||||||
transition: all .2s ease;
|
transition : all 0.2s ease;
|
||||||
}
|
}
|
||||||
|
|
||||||
.group {
|
.group {
|
||||||
@@ -34,6 +35,70 @@
|
|||||||
align-items : center;
|
align-items : center;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.active, [aria-checked='true'] { background-color : #444444; }
|
||||||
|
|
||||||
|
.anchored-trigger {
|
||||||
|
&.active { background-color : #444444; }
|
||||||
|
}
|
||||||
|
|
||||||
|
.anchored-box {
|
||||||
|
--box-color : #555555;
|
||||||
|
top : 30px;
|
||||||
|
display : flex;
|
||||||
|
flex-direction : column;
|
||||||
|
gap : 5px;
|
||||||
|
padding : 15px;
|
||||||
|
margin-top : 10px;
|
||||||
|
font-size : 0.8em;
|
||||||
|
color : #CCCCCC;
|
||||||
|
background-color : var(--box-color);
|
||||||
|
border-radius : 5px;
|
||||||
|
|
||||||
|
h1 {
|
||||||
|
padding-bottom : 0.3em;
|
||||||
|
margin-bottom : 0.5em;
|
||||||
|
border-bottom : 1px solid currentColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
padding-bottom : 0.3em;
|
||||||
|
margin : 1em 0 0.5em 0;
|
||||||
|
color : lightgray;
|
||||||
|
border-bottom : 1px solid currentColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
label {
|
||||||
|
display : flex;
|
||||||
|
gap : 6px;
|
||||||
|
align-items : center;
|
||||||
|
justify-content : space-between;
|
||||||
|
|
||||||
|
}
|
||||||
|
input {
|
||||||
|
height : unset;
|
||||||
|
&[type='range'] { padding : 0; }
|
||||||
|
}
|
||||||
|
&::before {
|
||||||
|
position : absolute;
|
||||||
|
top : -20px;
|
||||||
|
left : 50%;
|
||||||
|
width : 0px;
|
||||||
|
height : 0px;
|
||||||
|
pointer-events : none;
|
||||||
|
content : '';
|
||||||
|
border : 10px solid transparent;
|
||||||
|
border-bottom : 10px solid var(--box-color);
|
||||||
|
transform : translateX(-50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.radio-group:has(button[role='radio']) {
|
||||||
|
display : flex;
|
||||||
|
height : 100%;
|
||||||
|
border : 1px solid #333333;
|
||||||
|
}
|
||||||
|
|
||||||
input {
|
input {
|
||||||
position : relative;
|
position : relative;
|
||||||
height : 1.5em;
|
height : 1.5em;
|
||||||
@@ -57,7 +122,7 @@
|
|||||||
outline : none;
|
outline : none;
|
||||||
}
|
}
|
||||||
|
|
||||||
&:hover::after {
|
&.hover-tooltip[value]:hover::after {
|
||||||
position : absolute;
|
position : absolute;
|
||||||
bottom : -30px;
|
bottom : -30px;
|
||||||
left : 50%;
|
left : 50%;
|
||||||
@@ -83,46 +148,40 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
button {
|
button {
|
||||||
box-sizing : content-box;
|
box-sizing : border-box;
|
||||||
display : flex;
|
display : flex;
|
||||||
align-items : center;
|
align-items : center;
|
||||||
justify-content : center;
|
justify-content : center;
|
||||||
width : auto;
|
width : auto;
|
||||||
min-width : 46px;
|
min-width : 46px;
|
||||||
height : 100%;
|
height : 100%;
|
||||||
padding : 0 0px;
|
|
||||||
font-weight : unset;
|
|
||||||
color : inherit;
|
|
||||||
background-color : unset;
|
|
||||||
&:hover { background-color : #444444; }
|
&:hover { background-color : #444444; }
|
||||||
&:focus { outline : 1px solid #D3D3D3; }
|
&:focus { border : 1px solid #D3D3D3;outline : none;}
|
||||||
&:disabled {
|
&:disabled {
|
||||||
color : #777777;
|
color : #777777;
|
||||||
background-color : unset !important;
|
background-color : unset !important;
|
||||||
}
|
}
|
||||||
i {
|
i { font-size : 1.2em; }
|
||||||
font-size:1.2em;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&.hidden {
|
&.hidden {
|
||||||
width: 32px;
|
flex-wrap : nowrap;
|
||||||
transition: all .3s ease;
|
width : 32px;
|
||||||
flex-wrap:nowrap;
|
overflow : hidden;
|
||||||
overflow: hidden;
|
background-color : unset;
|
||||||
background-color: unset;
|
opacity : 0.5;
|
||||||
opacity: .5;
|
transition : all 0.3s ease;
|
||||||
& > *:not(.toggleButton) {
|
& > *:not(.toggleButton) {
|
||||||
opacity: 0;
|
opacity : 0;
|
||||||
transition: all .2s ease;
|
transition : all 0.2s ease;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
button.toggleButton {
|
button.toggleButton {
|
||||||
z-index : 5;
|
position : absolute;
|
||||||
position:absolute;
|
left : 0;
|
||||||
left: 0;
|
z-index : 5;
|
||||||
width: 32px;
|
width : 32px;
|
||||||
min-width: unset;
|
min-width : unset;
|
||||||
}
|
}
|
||||||
@@ -4,7 +4,7 @@ const React = require('react');
|
|||||||
const createClass = require('create-react-class');
|
const createClass = require('create-react-class');
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
const dedent = require('dedent-tabs').default;
|
const dedent = require('dedent-tabs').default;
|
||||||
const Markdown = require('../../../shared/naturalcrit/markdown.js');
|
import Markdown from '../../../shared/naturalcrit/markdown.js';
|
||||||
|
|
||||||
const CodeEditor = require('naturalcrit/codeEditor/codeEditor.jsx');
|
const CodeEditor = require('naturalcrit/codeEditor/codeEditor.jsx');
|
||||||
const SnippetBar = require('./snippetbar/snippetbar.jsx');
|
const SnippetBar = require('./snippetbar/snippetbar.jsx');
|
||||||
|
|||||||
@@ -3,10 +3,10 @@ require('./metadataEditor.less');
|
|||||||
const React = require('react');
|
const React = require('react');
|
||||||
const createClass = require('create-react-class');
|
const createClass = require('create-react-class');
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
const request = require('../../utils/request-middleware.js');
|
import request from '../../utils/request-middleware.js';
|
||||||
const Nav = require('naturalcrit/nav/nav.jsx');
|
const Nav = require('naturalcrit/nav/nav.jsx');
|
||||||
const Combobox = require('client/components/combobox.jsx');
|
const Combobox = require('client/components/combobox.jsx');
|
||||||
const StringArrayEditor = require('../stringArrayEditor/stringArrayEditor.jsx');
|
const TagInput = require('../tagInput/tagInput.jsx');
|
||||||
|
|
||||||
|
|
||||||
const Themes = require('themes/themes.json');
|
const Themes = require('themes/themes.json');
|
||||||
@@ -341,10 +341,11 @@ const MetadataEditor = createClass({
|
|||||||
{this.renderThumbnail()}
|
{this.renderThumbnail()}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<StringArrayEditor label='tags' valuePatterns={[/^(?:(?:group|meta|system|type):)?[A-Za-z0-9][A-Za-z0-9 \/.\-]{0,40}$/]}
|
<TagInput label='tags' valuePatterns={[/^(?:(?:group|meta|system|type):)?[A-Za-z0-9][A-Za-z0-9 \/.\-]{0,40}$/]}
|
||||||
placeholder='add tag' unique={true}
|
placeholder='add tag' unique={true}
|
||||||
values={this.props.metadata.tags}
|
values={this.props.metadata.tags}
|
||||||
onChange={(e)=>this.handleFieldChange('tags', e)}/>
|
onChange={(e)=>this.handleFieldChange('tags', e)}
|
||||||
|
/>
|
||||||
|
|
||||||
<div className='field systems'>
|
<div className='field systems'>
|
||||||
<label>systems</label>
|
<label>systems</label>
|
||||||
@@ -363,12 +364,13 @@ const MetadataEditor = createClass({
|
|||||||
|
|
||||||
{this.renderAuthors()}
|
{this.renderAuthors()}
|
||||||
|
|
||||||
<StringArrayEditor label='invited authors' valuePatterns={[/.+/]}
|
<TagInput label='invited authors' valuePatterns={[/.+/]}
|
||||||
validators={[(v)=>!this.props.metadata.authors?.includes(v)]}
|
validators={[(v)=>!this.props.metadata.authors?.includes(v)]}
|
||||||
placeholder='invite author' unique={true}
|
placeholder='invite author' unique={true}
|
||||||
values={this.props.metadata.invitedAuthors}
|
values={this.props.metadata.invitedAuthors}
|
||||||
notes={['Invited author usernames are case sensitive.', 'After adding an invited author, send them the edit link. There, they can choose to accept or decline the invitation.']}
|
notes={['Invited author usernames are case sensitive.', 'After adding an invited author, send them the edit link. There, they can choose to accept or decline the invitation.']}
|
||||||
onChange={(e)=>this.handleFieldChange('invitedAuthors', e)}/>
|
onChange={(e)=>this.handleFieldChange('invitedAuthors', e)}
|
||||||
|
/>
|
||||||
|
|
||||||
<h2>Privacy</h2>
|
<h2>Privacy</h2>
|
||||||
|
|
||||||
|
|||||||
@@ -79,6 +79,7 @@
|
|||||||
text-overflow : ellipsis;
|
text-overflow : ellipsis;
|
||||||
}
|
}
|
||||||
button {
|
button {
|
||||||
|
.colorButton();
|
||||||
padding : 0px 5px;
|
padding : 0px 5px;
|
||||||
color : white;
|
color : white;
|
||||||
background-color : black;
|
background-color : black;
|
||||||
@@ -138,16 +139,16 @@
|
|||||||
margin-bottom : 15px;
|
margin-bottom : 15px;
|
||||||
button { width : 100%; }
|
button { width : 100%; }
|
||||||
button.publish {
|
button.publish {
|
||||||
.button(@blueLight);
|
.colorButton(@blueLight);
|
||||||
}
|
}
|
||||||
button.unpublish {
|
button.unpublish {
|
||||||
.button(@silver);
|
.colorButton(@silver);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.delete.field .value {
|
.delete.field .value {
|
||||||
button {
|
button {
|
||||||
.button(@red);
|
.colorButton(@red);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.authors.field .value {
|
.authors.field .value {
|
||||||
@@ -271,7 +272,7 @@
|
|||||||
&:last-child { border-radius : 0 0.5em 0.5em 0; }
|
&:last-child { border-radius : 0 0.5em 0.5em 0; }
|
||||||
}
|
}
|
||||||
|
|
||||||
.badge {
|
.tag {
|
||||||
padding : 0.3em;
|
padding : 0.3em;
|
||||||
margin : 2px;
|
margin : 2px;
|
||||||
font-size : 0.9em;
|
font-size : 0.9em;
|
||||||
|
|||||||
@@ -1,149 +0,0 @@
|
|||||||
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,
|
|
||||||
validators : [],
|
|
||||||
placeholder : '',
|
|
||||||
notes : [],
|
|
||||||
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);
|
|
||||||
const passesValidators = !this.props.validators || this.props.validators.every((validator)=>validator(value));
|
|
||||||
return matchesPatterns && uniqueIfSet && passesValidators;
|
|
||||||
},
|
|
||||||
|
|
||||||
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'>
|
|
||||||
<label>{this.props.label}</label>
|
|
||||||
<div style={{ flex: '1 0' }} className='value'>
|
|
||||||
<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>
|
|
||||||
|
|
||||||
{this.props.notes ? this.props.notes.map((n, index)=><p key={index}><small>{n}</small></p>) : null}
|
|
||||||
</div>
|
|
||||||
</div>;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
module.exports = StringArrayEditor;
|
|
||||||
105
client/homebrew/editor/tagInput/tagInput.jsx
Normal file
105
client/homebrew/editor/tagInput/tagInput.jsx
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
require('./tagInput.less');
|
||||||
|
const React = require('react');
|
||||||
|
const { useState, useEffect } = React;
|
||||||
|
const _ = require('lodash');
|
||||||
|
|
||||||
|
const TagInput = ({ unique = true, values = [], ...props }) => {
|
||||||
|
const [tempInputText, setTempInputText] = useState('');
|
||||||
|
const [tagList, setTagList] = useState(values.map((value) => ({ value, editing: false })));
|
||||||
|
|
||||||
|
useEffect(()=>{
|
||||||
|
handleChange(tagList.map((context)=>context.value))
|
||||||
|
}, [tagList])
|
||||||
|
|
||||||
|
const handleChange = (value)=>{
|
||||||
|
props.onChange({
|
||||||
|
target : { value }
|
||||||
|
})
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleInputKeyDown = ({ evt, value, index, options = {} }) => {
|
||||||
|
if (_.includes(['Enter', ','], evt.key)) {
|
||||||
|
evt.preventDefault();
|
||||||
|
submitTag(evt.target.value, value, index);
|
||||||
|
if (options.clear) {
|
||||||
|
setTempInputText('');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const submitTag = (newValue, originalValue, index) => {
|
||||||
|
setTagList((prevContext) => {
|
||||||
|
// remove existing tag
|
||||||
|
if(newValue === null){
|
||||||
|
return [...prevContext].filter((context, i)=>i !== index);
|
||||||
|
}
|
||||||
|
// add new tag
|
||||||
|
if(originalValue === null){
|
||||||
|
return [...prevContext, { value: newValue, editing: false }]
|
||||||
|
}
|
||||||
|
// update existing tag
|
||||||
|
return prevContext.map((context, i) => {
|
||||||
|
if (i === index) {
|
||||||
|
return { ...context, value: newValue, editing: false };
|
||||||
|
}
|
||||||
|
return context;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const editTag = (index) => {
|
||||||
|
setTagList((prevContext) => {
|
||||||
|
return prevContext.map((context, i) => {
|
||||||
|
if (i === index) {
|
||||||
|
return { ...context, editing: true };
|
||||||
|
}
|
||||||
|
return { ...context, editing: false };
|
||||||
|
});
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const renderReadTag = (context, index) => {
|
||||||
|
return (
|
||||||
|
<li key={index}
|
||||||
|
data-value={context.value}
|
||||||
|
className='tag'
|
||||||
|
onClick={() => editTag(index)}>
|
||||||
|
{context.value}
|
||||||
|
<button onClick={(evt)=>{evt.stopPropagation(); submitTag(null, context.value, index)}}><i className='fa fa-times fa-fw'/></button>
|
||||||
|
</li>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
const renderWriteTag = (context, index) => {
|
||||||
|
return (
|
||||||
|
<input type='text'
|
||||||
|
key={index}
|
||||||
|
defaultValue={context.value}
|
||||||
|
onKeyDown={(evt) => handleInputKeyDown({evt, value: context.value, index: index})}
|
||||||
|
autoFocus
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className='field'>
|
||||||
|
<label>{props.label}</label>
|
||||||
|
<div className='value'>
|
||||||
|
<ul className='list'>
|
||||||
|
{tagList.map((context, index) => { return context.editing ? renderWriteTag(context, index) : renderReadTag(context, index); })}
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
<input
|
||||||
|
type='text'
|
||||||
|
className='value'
|
||||||
|
placeholder={props.placeholder}
|
||||||
|
value={tempInputText}
|
||||||
|
onChange={(e) => setTempInputText(e.target.value)}
|
||||||
|
onKeyDown={(evt) => handleInputKeyDown({ evt, value: null, options: { clear: true } })}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = TagInput;
|
||||||
0
client/homebrew/editor/tagInput/tagInput.less
Normal file
0
client/homebrew/editor/tagInput/tagInput.less
Normal file
@@ -2,7 +2,7 @@ require('./brewItem.less');
|
|||||||
const React = require('react');
|
const React = require('react');
|
||||||
const createClass = require('create-react-class');
|
const createClass = require('create-react-class');
|
||||||
const moment = require('moment');
|
const moment = require('moment');
|
||||||
const request = require('../../../../utils/request-middleware.js');
|
import request from '../../../../utils/request-middleware.js';
|
||||||
|
|
||||||
const googleDriveIcon = require('../../../../googleDrive.svg');
|
const googleDriveIcon = require('../../../../googleDrive.svg');
|
||||||
const homebreweryIcon = require('../../../../thumbnail.png');
|
const homebreweryIcon = require('../../../../thumbnail.png');
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ const React = require('react');
|
|||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
const createClass = require('create-react-class');
|
const createClass = require('create-react-class');
|
||||||
|
|
||||||
const request = require('../../utils/request-middleware.js');
|
import request from '../../utils/request-middleware.js';
|
||||||
const { Meta } = require('vitreum/headtags');
|
const { Meta } = require('vitreum/headtags');
|
||||||
|
|
||||||
const Nav = require('naturalcrit/nav/nav.jsx');
|
const Nav = require('naturalcrit/nav/nav.jsx');
|
||||||
@@ -23,7 +23,7 @@ const BrewRenderer = require('../../brewRenderer/brewRenderer.jsx');
|
|||||||
|
|
||||||
const LockNotification = require('./lockNotification/lockNotification.jsx');
|
const LockNotification = require('./lockNotification/lockNotification.jsx');
|
||||||
|
|
||||||
const Markdown = require('naturalcrit/markdown.js');
|
import Markdown from 'naturalcrit/markdown.js';
|
||||||
|
|
||||||
const { DEFAULT_BREW_LOAD } = require('../../../../server/brewDefaults.js');
|
const { DEFAULT_BREW_LOAD } = require('../../../../server/brewDefaults.js');
|
||||||
const { printCurrentBrew, fetchThemeBundle } = require('../../../../shared/helpers.js');
|
const { printCurrentBrew, fetchThemeBundle } = require('../../../../shared/helpers.js');
|
||||||
@@ -430,6 +430,7 @@ const EditPage = createClass({
|
|||||||
{this.renderNavbar()}
|
{this.renderNavbar()}
|
||||||
|
|
||||||
{this.props.brew.lock && <LockNotification shareId={this.props.brew.shareId} message={this.props.brew.lock.editMessage} />}
|
{this.props.brew.lock && <LockNotification shareId={this.props.brew.shareId} message={this.props.brew.lock.editMessage} />}
|
||||||
|
<div className="content">
|
||||||
<SplitPane onDragFinish={this.handleSplitMove}>
|
<SplitPane onDragFinish={this.handleSplitMove}>
|
||||||
<Editor
|
<Editor
|
||||||
ref={this.editor}
|
ref={this.editor}
|
||||||
@@ -463,6 +464,7 @@ const EditPage = createClass({
|
|||||||
allowPrint={true}
|
allowPrint={true}
|
||||||
/>
|
/>
|
||||||
</SplitPane>
|
</SplitPane>
|
||||||
|
</div>
|
||||||
</div>;
|
</div>;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
require('./errorPage.less');
|
require('./errorPage.less');
|
||||||
const React = require('react');
|
const React = require('react');
|
||||||
const UIPage = require('../basePages/uiPage/uiPage.jsx');
|
const UIPage = require('../basePages/uiPage/uiPage.jsx');
|
||||||
const Markdown = require('../../../../shared/naturalcrit/markdown.js');
|
import Markdown from '../../../../shared/naturalcrit/markdown.js';
|
||||||
const ErrorIndex = require('./errors/errorIndex.js');
|
const ErrorIndex = require('./errors/errorIndex.js');
|
||||||
|
|
||||||
const ErrorPage = ({ brew })=>{
|
const ErrorPage = ({ brew })=>{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ require('./homePage.less');
|
|||||||
const React = require('react');
|
const React = require('react');
|
||||||
const createClass = require('create-react-class');
|
const createClass = require('create-react-class');
|
||||||
const cx = require('classnames');
|
const cx = require('classnames');
|
||||||
const request = require('../../utils/request-middleware.js');
|
import request from '../../utils/request-middleware.js';
|
||||||
const { Meta } = require('vitreum/headtags');
|
const { Meta } = require('vitreum/headtags');
|
||||||
|
|
||||||
const Nav = require('naturalcrit/nav/nav.jsx');
|
const Nav = require('naturalcrit/nav/nav.jsx');
|
||||||
@@ -100,6 +100,7 @@ const HomePage = createClass({
|
|||||||
return <div className='homePage sitePage'>
|
return <div className='homePage sitePage'>
|
||||||
<Meta name='google-site-verification' content='NwnAQSSJZzAT7N-p5MY6ydQ7Njm67dtbu73ZSyE5Fy4' />
|
<Meta name='google-site-verification' content='NwnAQSSJZzAT7N-p5MY6ydQ7Njm67dtbu73ZSyE5Fy4' />
|
||||||
{this.renderNavbar()}
|
{this.renderNavbar()}
|
||||||
|
<div className="content">
|
||||||
<SplitPane onDragFinish={this.handleSplitMove}>
|
<SplitPane onDragFinish={this.handleSplitMove}>
|
||||||
<Editor
|
<Editor
|
||||||
ref={this.editor}
|
ref={this.editor}
|
||||||
@@ -125,6 +126,7 @@ const HomePage = createClass({
|
|||||||
themeBundle={this.state.themeBundle}
|
themeBundle={this.state.themeBundle}
|
||||||
/>
|
/>
|
||||||
</SplitPane>
|
</SplitPane>
|
||||||
|
</div>
|
||||||
<div className={cx('floatingSaveButton', { show: this.state.welcomeText != this.state.brew.text })} onClick={this.handleSave}>
|
<div className={cx('floatingSaveButton', { show: this.state.welcomeText != this.state.brew.text })} onClick={this.handleSave}>
|
||||||
Save current <i className='fas fa-save' />
|
Save current <i className='fas fa-save' />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -2,9 +2,9 @@
|
|||||||
require('./newPage.less');
|
require('./newPage.less');
|
||||||
const React = require('react');
|
const React = require('react');
|
||||||
const createClass = require('create-react-class');
|
const createClass = require('create-react-class');
|
||||||
const request = require('../../utils/request-middleware.js');
|
import request from '../../utils/request-middleware.js';
|
||||||
|
|
||||||
const Markdown = require('naturalcrit/markdown.js');
|
import Markdown from 'naturalcrit/markdown.js';
|
||||||
|
|
||||||
const Nav = require('naturalcrit/nav/nav.jsx');
|
const Nav = require('naturalcrit/nav/nav.jsx');
|
||||||
const PrintNavItem = require('../../navbar/print.navitem.jsx');
|
const PrintNavItem = require('../../navbar/print.navitem.jsx');
|
||||||
@@ -223,6 +223,7 @@ const NewPage = createClass({
|
|||||||
render : function(){
|
render : function(){
|
||||||
return <div className='newPage sitePage'>
|
return <div className='newPage sitePage'>
|
||||||
{this.renderNavbar()}
|
{this.renderNavbar()}
|
||||||
|
<div className="content">
|
||||||
<SplitPane onDragFinish={this.handleSplitMove}>
|
<SplitPane onDragFinish={this.handleSplitMove}>
|
||||||
<Editor
|
<Editor
|
||||||
ref={this.editor}
|
ref={this.editor}
|
||||||
@@ -254,6 +255,7 @@ const NewPage = createClass({
|
|||||||
allowPrint={true}
|
allowPrint={true}
|
||||||
/>
|
/>
|
||||||
</SplitPane>
|
</SplitPane>
|
||||||
|
</div>
|
||||||
</div>;
|
</div>;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ const BrewItem = require('../basePages/listPage/brewItem/brewItem.jsx');
|
|||||||
const SplitPane = require('../../../../shared/naturalcrit/splitPane/splitPane.jsx');
|
const SplitPane = require('../../../../shared/naturalcrit/splitPane/splitPane.jsx');
|
||||||
const ErrorIndex = require('../errorPage/errors/errorIndex.js');
|
const ErrorIndex = require('../errorPage/errors/errorIndex.js');
|
||||||
|
|
||||||
const request = require('../../utils/request-middleware.js');
|
import request from '../../utils/request-middleware.js';
|
||||||
|
|
||||||
const VaultPage = (props)=>{
|
const VaultPage = (props)=>{
|
||||||
const [pageState, setPageState] = useState(parseInt(props.query.page) || 1);
|
const [pageState, setPageState] = useState(parseInt(props.query.page) || 1);
|
||||||
@@ -411,10 +411,11 @@ const VaultPage = (props)=>{
|
|||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='vaultPage'>
|
<div className='sitePage vaultPage'>
|
||||||
<link href='/themes/V3/Blank/style.css' rel='stylesheet' />
|
<link href='/themes/V3/Blank/style.css' rel='stylesheet' />
|
||||||
<link href='/themes/V3/5ePHB/style.css' rel='stylesheet' />
|
<link href='/themes/V3/5ePHB/style.css' rel='stylesheet' />
|
||||||
{renderNavItems()}
|
{renderNavItems()}
|
||||||
|
<div className="content">
|
||||||
<SplitPane showDividerButtons={false}>
|
<SplitPane showDividerButtons={false}>
|
||||||
<div className='form dataGroup'>{renderForm()}</div>
|
<div className='form dataGroup'>{renderForm()}</div>
|
||||||
<div className='resultsContainer dataGroup'>
|
<div className='resultsContainer dataGroup'>
|
||||||
@@ -422,6 +423,7 @@ const VaultPage = (props)=>{
|
|||||||
{renderFoundBrews()}
|
{renderFoundBrews()}
|
||||||
</div>
|
</div>
|
||||||
</SplitPane>
|
</SplitPane>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,373 +5,369 @@
|
|||||||
|
|
||||||
*:not(input) { user-select : none; }
|
*:not(input) { user-select : none; }
|
||||||
|
|
||||||
.content {
|
.content .dataGroup {
|
||||||
|
width : 100%;
|
||||||
height : 100%;
|
height : 100%;
|
||||||
background : #2C3E50;
|
background : white;
|
||||||
|
|
||||||
.dataGroup {
|
&.form .brewLookup {
|
||||||
width : 100%;
|
position : relative;
|
||||||
height : 100%;
|
padding : 50px clamp(20px, 4vw, 50px);
|
||||||
background : white;
|
|
||||||
|
|
||||||
&.form .brewLookup {
|
small {
|
||||||
position : relative;
|
font-size : 10pt;
|
||||||
padding : 50px clamp(20px, 4vw, 50px);
|
color : #555555;
|
||||||
|
|
||||||
small {
|
|
||||||
font-size : 10pt;
|
|
||||||
color : #555555;
|
|
||||||
|
|
||||||
a { color : #333333; }
|
a { color : #333333; }
|
||||||
}
|
}
|
||||||
|
|
||||||
code {
|
code {
|
||||||
padding-inline : 5px;
|
padding-inline : 5px;
|
||||||
font-family : monospace;
|
font-family : monospace;
|
||||||
background : lightgrey;
|
background : lightgrey;
|
||||||
border-radius : 5px;
|
border-radius : 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
h1, h2, h3, h4 {
|
h1, h2, h3, h4 {
|
||||||
font-family : 'CodeBold';
|
font-family : 'CodeBold';
|
||||||
letter-spacing : 2px;
|
letter-spacing : 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
legend {
|
legend {
|
||||||
h3 {
|
h3 {
|
||||||
margin-block : 30px 20px;
|
margin-block : 30px 20px;
|
||||||
font-size : 20px;
|
font-size : 20px;
|
||||||
text-align : center;
|
|
||||||
border-bottom : 2px solid;
|
|
||||||
}
|
|
||||||
ul {
|
|
||||||
padding-inline : 30px 10px;
|
|
||||||
li {
|
|
||||||
margin-block : 5px;
|
|
||||||
line-height : calc(1em + 5px);
|
|
||||||
list-style : disc;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
position : absolute;
|
|
||||||
top : 0;
|
|
||||||
right : 0;
|
|
||||||
left : 0;
|
|
||||||
display : block;
|
|
||||||
padding : 10px;
|
|
||||||
font-weight : 900;
|
|
||||||
color : white;
|
|
||||||
white-space : pre-wrap;
|
|
||||||
content : 'Error:\A At least one renderer should be enabled to make a search';
|
|
||||||
background : rgb(255, 60, 60);
|
|
||||||
opacity : 0;
|
|
||||||
transition : opacity 0.5s;
|
|
||||||
}
|
|
||||||
&:not(:has(input[type='checkbox']:checked))::after { opacity : 1; }
|
|
||||||
|
|
||||||
.formTitle {
|
|
||||||
margin : 20px 0;
|
|
||||||
font-size : 30px;
|
|
||||||
color : black;
|
|
||||||
text-align : center;
|
text-align : center;
|
||||||
border-bottom : 2px solid;
|
border-bottom : 2px solid;
|
||||||
}
|
}
|
||||||
|
ul {
|
||||||
.formContents {
|
padding-inline : 30px 10px;
|
||||||
position : relative;
|
li {
|
||||||
display : flex;
|
margin-block : 5px;
|
||||||
flex-direction : column;
|
line-height : calc(1em + 5px);
|
||||||
|
list-style : disc;
|
||||||
label {
|
|
||||||
display : flex;
|
|
||||||
align-items : center;
|
|
||||||
margin : 10px 0;
|
|
||||||
}
|
}
|
||||||
select { margin : 0 10px; }
|
}
|
||||||
|
|
||||||
input {
|
|
||||||
margin : 0 10px;
|
|
||||||
|
|
||||||
&:invalid { background : rgb(255, 188, 181); }
|
|
||||||
|
|
||||||
&[type='checkbox'] {
|
|
||||||
position : relative;
|
|
||||||
display : inline-block;
|
|
||||||
width : 50px;
|
|
||||||
height : 30px;
|
|
||||||
font-family : 'WalterTurncoat';
|
|
||||||
font-size : 20px;
|
|
||||||
font-weight : 800;
|
|
||||||
color : white;
|
|
||||||
letter-spacing : 2px;
|
|
||||||
appearance : none;
|
|
||||||
background : red;
|
|
||||||
isolation : isolate;
|
|
||||||
border-radius : 5px;
|
|
||||||
|
|
||||||
&::before,&::after {
|
|
||||||
position : absolute;
|
|
||||||
inset : 0;
|
|
||||||
z-index : 5;
|
|
||||||
padding-top : 2px;
|
|
||||||
text-align : center;
|
|
||||||
}
|
|
||||||
|
|
||||||
&::before {
|
|
||||||
display : block;
|
|
||||||
content : 'No';
|
|
||||||
}
|
|
||||||
|
|
||||||
&::after {
|
|
||||||
display : none;
|
|
||||||
content : 'Yes';
|
|
||||||
}
|
|
||||||
|
|
||||||
&:checked {
|
|
||||||
background : green;
|
|
||||||
|
|
||||||
&::before { display : none; }
|
|
||||||
&::after { display : block; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#searchButton {
|
|
||||||
position : absolute;
|
|
||||||
right : 20px;
|
|
||||||
bottom : 0;
|
|
||||||
|
|
||||||
i {
|
|
||||||
margin-left : 10px;
|
|
||||||
animation-duration : 1000s;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&.resultsContainer {
|
&::after {
|
||||||
|
position : absolute;
|
||||||
|
top : 0;
|
||||||
|
right : 0;
|
||||||
|
left : 0;
|
||||||
|
display : block;
|
||||||
|
padding : 10px;
|
||||||
|
font-weight : 900;
|
||||||
|
color : white;
|
||||||
|
white-space : pre-wrap;
|
||||||
|
content : 'Error:\A At least one renderer should be enabled to make a search';
|
||||||
|
background : rgb(255, 60, 60);
|
||||||
|
opacity : 0;
|
||||||
|
transition : opacity 0.5s;
|
||||||
|
}
|
||||||
|
&:not(:has(input[type='checkbox']:checked))::after { opacity : 1; }
|
||||||
|
|
||||||
|
.formTitle {
|
||||||
|
margin : 20px 0;
|
||||||
|
font-size : 30px;
|
||||||
|
color : black;
|
||||||
|
text-align : center;
|
||||||
|
border-bottom : 2px solid;
|
||||||
|
}
|
||||||
|
|
||||||
|
.formContents {
|
||||||
|
position : relative;
|
||||||
display : flex;
|
display : flex;
|
||||||
flex-direction : column;
|
flex-direction : column;
|
||||||
height : 100%;
|
|
||||||
overflow-y : auto;
|
label {
|
||||||
font-family : 'BookInsanityRemake';
|
display : flex;
|
||||||
font-size : 0.34cm;
|
align-items : center;
|
||||||
|
margin : 10px 0;
|
||||||
h3 {
|
|
||||||
font-family : 'Open Sans';
|
|
||||||
font-weight : 900;
|
|
||||||
color : white;
|
|
||||||
}
|
}
|
||||||
|
select { margin : 0 10px; }
|
||||||
|
|
||||||
.sort-container {
|
input {
|
||||||
display : flex;
|
margin : 0 10px;
|
||||||
flex-wrap : wrap;
|
|
||||||
column-gap : 15px;
|
&:invalid { background : rgb(255, 188, 181); }
|
||||||
justify-content : center;
|
|
||||||
height : 30px;
|
|
||||||
color : white;
|
|
||||||
background-color : #555555;
|
|
||||||
border-top : 1px solid #666666;
|
|
||||||
border-bottom : 1px solid #666666;
|
|
||||||
|
|
||||||
.sort-option {
|
&[type='checkbox'] {
|
||||||
display : flex;
|
position : relative;
|
||||||
align-items : center;
|
display : inline-block;
|
||||||
padding : 0 8px;
|
width : 50px;
|
||||||
|
height : 30px;
|
||||||
&:hover { background-color : #444444; }
|
font-family : 'WalterTurncoat';
|
||||||
|
font-size : 20px;
|
||||||
&.active {
|
font-weight : 800;
|
||||||
background-color : #333333;
|
color : white;
|
||||||
|
letter-spacing : 2px;
|
||||||
button {
|
appearance : none;
|
||||||
font-weight : 800;
|
background : red;
|
||||||
color : white;
|
isolation : isolate;
|
||||||
|
border-radius : 5px;
|
||||||
& + .sortDir { padding-left : 5px; }
|
|
||||||
}
|
&::before,&::after {
|
||||||
|
position : absolute;
|
||||||
|
inset : 0;
|
||||||
|
z-index : 5;
|
||||||
|
padding-top : 2px;
|
||||||
|
text-align : center;
|
||||||
}
|
}
|
||||||
|
|
||||||
button {
|
&::before {
|
||||||
padding : 0;
|
display : block;
|
||||||
font-size : 11px;
|
content : 'No';
|
||||||
font-weight : normal;
|
|
||||||
color : #CCCCCC;
|
|
||||||
text-transform : uppercase;
|
|
||||||
background-color : transparent;
|
|
||||||
|
|
||||||
&:hover { background : none; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.foundBrews {
|
|
||||||
position : relative;
|
|
||||||
width : 100%;
|
|
||||||
height : 100%;
|
|
||||||
max-height : 100%;
|
|
||||||
padding : 50px 50px 70px 50px;
|
|
||||||
overflow-y : scroll;
|
|
||||||
background-color : #2C3E50;
|
|
||||||
|
|
||||||
h3 { font-size : 25px; }
|
|
||||||
|
|
||||||
&.noBrews {
|
|
||||||
display : grid;
|
|
||||||
place-items : center;
|
|
||||||
color : white;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.searching {
|
|
||||||
display : grid;
|
|
||||||
place-items : center;
|
|
||||||
color : white;
|
|
||||||
|
|
||||||
h3 { position : relative; }
|
|
||||||
|
|
||||||
h3.searchAnim::after {
|
|
||||||
position : absolute;
|
|
||||||
top : 50%;
|
|
||||||
right : 0;
|
|
||||||
width : max-content;
|
|
||||||
height : 1em;
|
|
||||||
content : '';
|
|
||||||
translate : calc(100% + 5px) -50%;
|
|
||||||
animation : trailingDots 2s ease infinite;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.totalBrews {
|
|
||||||
position : fixed;
|
|
||||||
right : 0;
|
|
||||||
bottom : 0;
|
|
||||||
z-index : 1000;
|
|
||||||
padding : 8px 10px;
|
|
||||||
font-family : 'Open Sans';
|
|
||||||
font-size : 11px;
|
|
||||||
font-weight : 800;
|
|
||||||
color : white;
|
|
||||||
background-color : #333333;
|
|
||||||
|
|
||||||
.searchAnim {
|
|
||||||
position : relative;
|
|
||||||
display : inline-block;
|
|
||||||
width : 3ch;
|
|
||||||
height : 1em;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.searchAnim::after {
|
|
||||||
position : absolute;
|
|
||||||
top : 50%;
|
|
||||||
right : 0;
|
|
||||||
width : max-content;
|
|
||||||
height : 1em;
|
|
||||||
content : '';
|
|
||||||
translate : -50% -50%;
|
|
||||||
animation : trailingDots 2s ease infinite;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.brewItem {
|
|
||||||
width : 47%;
|
|
||||||
margin-right : 40px;
|
|
||||||
color : black;
|
|
||||||
isolation : isolate;
|
|
||||||
|
|
||||||
&::after {
|
&::after {
|
||||||
position : absolute;
|
display : none;
|
||||||
inset : 0;
|
content : 'Yes';
|
||||||
z-index : -2;
|
|
||||||
display : block;
|
|
||||||
content : '';
|
|
||||||
background-image : url('/assets/parchmentBackground.jpg');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&:nth-child(even of .brewItem) { margin-right : 0; }
|
&:checked {
|
||||||
|
background : green;
|
||||||
|
|
||||||
h2 {
|
&::before { display : none; }
|
||||||
font-family : 'MrEavesRemake';
|
&::after { display : block; }
|
||||||
font-size : 0.75cm;
|
|
||||||
font-weight : 800;
|
|
||||||
line-height : 0.988em;
|
|
||||||
color : var(--HB_Color_HeaderText);
|
|
||||||
}
|
}
|
||||||
.info {
|
|
||||||
position : relative;
|
|
||||||
z-index : 2;
|
|
||||||
font-family : 'ScalySansRemake';
|
|
||||||
font-size : 1.2em;
|
|
||||||
|
|
||||||
>span {
|
|
||||||
margin-right : 12px;
|
|
||||||
line-height : 1.5em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.links { z-index : 2; }
|
|
||||||
|
|
||||||
hr {
|
|
||||||
margin : 0px;
|
|
||||||
visibility : hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.thumbnail { z-index : -1; }
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.paginationControls {
|
#searchButton {
|
||||||
position : absolute;
|
position : absolute;
|
||||||
left : 50%;
|
right : 20px;
|
||||||
display : grid;
|
bottom : 0;
|
||||||
grid-template-areas : 'previousPage currentPage nextPage';
|
|
||||||
grid-template-columns : 50px 1fr 50px;
|
|
||||||
place-items : center;
|
|
||||||
width : auto;
|
|
||||||
translate : -50%;
|
|
||||||
|
|
||||||
.pages {
|
|
||||||
display : flex;
|
|
||||||
grid-area : currentPage;
|
|
||||||
justify-content : space-evenly;
|
|
||||||
width : 100%;
|
|
||||||
height : 100%;
|
|
||||||
padding : 5px 8px;
|
|
||||||
text-align : center;
|
|
||||||
|
|
||||||
.pageNumber {
|
|
||||||
margin-inline : 1vw;
|
|
||||||
font-family : 'Open Sans';
|
|
||||||
font-weight : 900;
|
|
||||||
color : white;
|
|
||||||
text-underline-position : under;
|
|
||||||
text-wrap : nowrap;
|
|
||||||
cursor : pointer;
|
|
||||||
|
|
||||||
&.currentPage {
|
|
||||||
color : gold;
|
|
||||||
text-decoration : underline;
|
|
||||||
pointer-events : none;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.firstPage { margin-right : -5px; }
|
|
||||||
|
|
||||||
&.lastPage { margin-left : -5px; }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
|
||||||
width : max-content;
|
|
||||||
|
|
||||||
&.previousPage { grid-area : previousPage; }
|
|
||||||
|
|
||||||
&.nextPage { grid-area : nextPage; }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
i {
|
||||||
|
margin-left : 10px;
|
||||||
|
animation-duration : 1000s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.resultsContainer {
|
||||||
|
display : flex;
|
||||||
|
flex-direction : column;
|
||||||
|
height : 100%;
|
||||||
|
overflow-y : auto;
|
||||||
|
font-family : 'BookInsanityRemake';
|
||||||
|
font-size : 0.34cm;
|
||||||
|
|
||||||
|
h3 {
|
||||||
|
font-family : 'Open Sans';
|
||||||
|
font-weight : 900;
|
||||||
|
color : white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sort-container {
|
||||||
|
display : flex;
|
||||||
|
flex-wrap : wrap;
|
||||||
|
column-gap : 15px;
|
||||||
|
justify-content : center;
|
||||||
|
height : 30px;
|
||||||
|
color : white;
|
||||||
|
background-color : #555555;
|
||||||
|
border-top : 1px solid #666666;
|
||||||
|
border-bottom : 1px solid #666666;
|
||||||
|
|
||||||
|
.sort-option {
|
||||||
|
display : flex;
|
||||||
|
align-items : center;
|
||||||
|
padding : 0 8px;
|
||||||
|
|
||||||
|
&:hover { background-color : #444444; }
|
||||||
|
|
||||||
|
&.active {
|
||||||
|
background-color : #333333;
|
||||||
|
|
||||||
|
button {
|
||||||
|
font-weight : 800;
|
||||||
|
color : white;
|
||||||
|
|
||||||
|
& + .sortDir { padding-left : 5px; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
padding : 0;
|
||||||
|
font-size : 11px;
|
||||||
|
font-weight : normal;
|
||||||
|
color : #CCCCCC;
|
||||||
|
text-transform : uppercase;
|
||||||
|
background-color : transparent;
|
||||||
|
|
||||||
|
&:hover { background : none; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.foundBrews {
|
||||||
|
position : relative;
|
||||||
|
width : 100%;
|
||||||
|
height : 100%;
|
||||||
|
max-height : 100%;
|
||||||
|
padding : 50px 50px 70px 50px;
|
||||||
|
overflow-y : scroll;
|
||||||
|
background-color : #2C3E50;
|
||||||
|
|
||||||
|
h3 { font-size : 25px; }
|
||||||
|
|
||||||
|
&.noBrews {
|
||||||
|
display : grid;
|
||||||
|
place-items : center;
|
||||||
|
color : white;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.searching {
|
||||||
|
display : grid;
|
||||||
|
place-items : center;
|
||||||
|
color : white;
|
||||||
|
|
||||||
|
h3 { position : relative; }
|
||||||
|
|
||||||
|
h3.searchAnim::after {
|
||||||
|
position : absolute;
|
||||||
|
top : 50%;
|
||||||
|
right : 0;
|
||||||
|
width : max-content;
|
||||||
|
height : 1em;
|
||||||
|
content : '';
|
||||||
|
translate : calc(100% + 5px) -50%;
|
||||||
|
animation : trailingDots 2s ease infinite;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.totalBrews {
|
||||||
|
position : fixed;
|
||||||
|
right : 0;
|
||||||
|
bottom : 0;
|
||||||
|
z-index : 1000;
|
||||||
|
padding : 8px 10px;
|
||||||
|
font-family : 'Open Sans';
|
||||||
|
font-size : 11px;
|
||||||
|
font-weight : 800;
|
||||||
|
color : white;
|
||||||
|
background-color : #333333;
|
||||||
|
|
||||||
|
.searchAnim {
|
||||||
|
position : relative;
|
||||||
|
display : inline-block;
|
||||||
|
width : 3ch;
|
||||||
|
height : 1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.searchAnim::after {
|
||||||
|
position : absolute;
|
||||||
|
top : 50%;
|
||||||
|
right : 0;
|
||||||
|
width : max-content;
|
||||||
|
height : 1em;
|
||||||
|
content : '';
|
||||||
|
translate : -50% -50%;
|
||||||
|
animation : trailingDots 2s ease infinite;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.brewItem {
|
||||||
|
width : 47%;
|
||||||
|
margin-right : 40px;
|
||||||
|
color : black;
|
||||||
|
isolation : isolate;
|
||||||
|
|
||||||
|
&::after {
|
||||||
|
position : absolute;
|
||||||
|
inset : 0;
|
||||||
|
z-index : -2;
|
||||||
|
display : block;
|
||||||
|
content : '';
|
||||||
|
background-image : url('/assets/parchmentBackground.jpg');
|
||||||
|
}
|
||||||
|
|
||||||
|
&:nth-child(even of .brewItem) { margin-right : 0; }
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-family : 'MrEavesRemake';
|
||||||
|
font-size : 0.75cm;
|
||||||
|
font-weight : 800;
|
||||||
|
line-height : 0.988em;
|
||||||
|
color : var(--HB_Color_HeaderText);
|
||||||
|
}
|
||||||
|
.info {
|
||||||
|
position : relative;
|
||||||
|
z-index : 2;
|
||||||
|
font-family : 'ScalySansRemake';
|
||||||
|
font-size : 1.2em;
|
||||||
|
|
||||||
|
>span {
|
||||||
|
margin-right : 12px;
|
||||||
|
line-height : 1.5em;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.links { z-index : 2; }
|
||||||
|
|
||||||
|
hr {
|
||||||
|
margin : 0px;
|
||||||
|
visibility : hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.thumbnail { z-index : -1; }
|
||||||
|
}
|
||||||
|
|
||||||
|
.paginationControls {
|
||||||
|
position : absolute;
|
||||||
|
left : 50%;
|
||||||
|
display : grid;
|
||||||
|
grid-template-areas : 'previousPage currentPage nextPage';
|
||||||
|
grid-template-columns : 50px 1fr 50px;
|
||||||
|
place-items : center;
|
||||||
|
width : auto;
|
||||||
|
translate : -50%;
|
||||||
|
|
||||||
|
.pages {
|
||||||
|
display : flex;
|
||||||
|
grid-area : currentPage;
|
||||||
|
justify-content : space-evenly;
|
||||||
|
width : 100%;
|
||||||
|
height : 100%;
|
||||||
|
padding : 5px 8px;
|
||||||
|
text-align : center;
|
||||||
|
|
||||||
|
.pageNumber {
|
||||||
|
margin-inline : 1vw;
|
||||||
|
font-family : 'Open Sans';
|
||||||
|
font-weight : 900;
|
||||||
|
color : white;
|
||||||
|
text-underline-position : under;
|
||||||
|
text-wrap : nowrap;
|
||||||
|
cursor : pointer;
|
||||||
|
|
||||||
|
&.currentPage {
|
||||||
|
color : gold;
|
||||||
|
text-decoration : underline;
|
||||||
|
pointer-events : none;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.firstPage { margin-right : -5px; }
|
||||||
|
|
||||||
|
&.lastPage { margin-left : -5px; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
button {
|
||||||
|
width : max-content;
|
||||||
|
|
||||||
|
&.previousPage { grid-area : previousPage; }
|
||||||
|
|
||||||
|
&.nextPage { grid-area : nextPage; }
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@keyframes trailingDots {
|
@keyframes trailingDots {
|
||||||
@@ -388,7 +384,7 @@
|
|||||||
|
|
||||||
// media query for when the page is smaller than 1079 px in width
|
// media query for when the page is smaller than 1079 px in width
|
||||||
@media screen and (max-width : 1079px) {
|
@media screen and (max-width : 1079px) {
|
||||||
.vaultPage .content {
|
.vaultPage {
|
||||||
|
|
||||||
.dataGroup.form .brewLookup { padding : 1px 20px 20px 10px; }
|
.dataGroup.form .brewLookup { padding : 1px 20px 20px 10px; }
|
||||||
|
|
||||||
|
|||||||
19
client/homebrew/utils/customIDBStore.js
Normal file
19
client/homebrew/utils/customIDBStore.js
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import * as IDB from 'idb-keyval/dist/index.js';
|
||||||
|
|
||||||
|
export function initCustomStore(db, store){
|
||||||
|
const createCustomStore = async ()=>IDB.createStore(db, store);
|
||||||
|
|
||||||
|
return {
|
||||||
|
entries : async ()=>IDB.entries(await createCustomStore()),
|
||||||
|
keys : async ()=>IDB.keys(await createCustomStore()),
|
||||||
|
values : async ()=>IDB.values(await createCustomStore()),
|
||||||
|
clear : async ()=>IDB.clear(await createCustomStore),
|
||||||
|
get : async (key)=>IDB.get(key, await createCustomStore()),
|
||||||
|
getMany : async (keys)=>IDB.getMany(keys, await createCustomStore()),
|
||||||
|
set : async (key, value)=>IDB.set(key, value, await createCustomStore()),
|
||||||
|
setMany : async (entries)=>IDB.setMany(entries, await createCustomStore()),
|
||||||
|
update : async (key, updateFn)=>IDB.update(key, updateFn, await createCustomStore()),
|
||||||
|
del : async (key)=>IDB.del(key, await createCustomStore()),
|
||||||
|
delMany : async (keys)=>IDB.delMany(keys, await createCustomStore())
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
const request = require('superagent');
|
import request from 'superagent';
|
||||||
|
|
||||||
const addHeader = (request)=>request.set('Homebrewery-Version', global.version);
|
const addHeader = (request)=>request.set('Homebrewery-Version', global.version);
|
||||||
|
|
||||||
@@ -9,4 +9,4 @@ const requestMiddleware = {
|
|||||||
delete : (path)=>addHeader(request.delete(path)),
|
delete : (path)=>addHeader(request.delete(path)),
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = requestMiddleware;
|
export default requestMiddleware;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import * as IDB from 'idb-keyval/dist/index.js';
|
import { initCustomStore } from './customIDBStore.js';
|
||||||
|
|
||||||
export const HISTORY_PREFIX = 'HOMEBREWERY-HISTORY';
|
export const HISTORY_PREFIX = 'HOMEBREWERY-HISTORY';
|
||||||
export const HISTORY_SLOTS = 5;
|
export const HISTORY_SLOTS = 5;
|
||||||
@@ -21,13 +21,15 @@ const HISTORY_SAVE_DELAYS = {
|
|||||||
// '5' : 5
|
// '5' : 5
|
||||||
// };
|
// };
|
||||||
|
|
||||||
const HB_DB = 'HOMEBREWERY-DB';
|
|
||||||
const HB_STORE = 'HISTORY';
|
|
||||||
|
|
||||||
const GARBAGE_COLLECT_DELAY = 28 * 24 * 60;
|
const GARBAGE_COLLECT_DELAY = 28 * 24 * 60;
|
||||||
// const GARBAGE_COLLECT_DELAY = 10;
|
// const GARBAGE_COLLECT_DELAY = 10;
|
||||||
|
|
||||||
|
|
||||||
|
const HB_DB = 'HOMEBREWERY-DB';
|
||||||
|
const HB_STORE = 'HISTORY';
|
||||||
|
|
||||||
|
const IDB = initCustomStore(HB_DB, HB_STORE);
|
||||||
|
|
||||||
function getKeyBySlot(brew, slot){
|
function getKeyBySlot(brew, slot){
|
||||||
// Return a string representing the key for this brew and history slot
|
// Return a string representing the key for this brew and history slot
|
||||||
return `${HISTORY_PREFIX}-${brew.shareId}-${slot}`;
|
return `${HISTORY_PREFIX}-${brew.shareId}-${slot}`;
|
||||||
@@ -53,11 +55,6 @@ function parseBrewForStorage(brew, slot = 0) {
|
|||||||
return [key, archiveBrew];
|
return [key, archiveBrew];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a custom IDB store
|
|
||||||
async function createHBStore(){
|
|
||||||
return await IDB.createStore(HB_DB, HB_STORE);
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function loadHistory(brew){
|
export async function loadHistory(brew){
|
||||||
const DEFAULT_HISTORY_ITEM = { expireAt: '2000-01-01T00:00:00.000Z', shareId: brew.shareId, noData: true };
|
const DEFAULT_HISTORY_ITEM = { expireAt: '2000-01-01T00:00:00.000Z', shareId: brew.shareId, noData: true };
|
||||||
|
|
||||||
@@ -69,7 +66,7 @@ export async function loadHistory(brew){
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Load all keys from IDB at once
|
// Load all keys from IDB at once
|
||||||
const dataArray = await IDB.getMany(historyKeys, await createHBStore());
|
const dataArray = await IDB.getMany(historyKeys);
|
||||||
return dataArray.map((data)=>{ return data ?? DEFAULT_HISTORY_ITEM; });
|
return dataArray.map((data)=>{ return data ?? DEFAULT_HISTORY_ITEM; });
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,7 +94,7 @@ export async function updateHistory(brew) {
|
|||||||
// Update the most recent brew
|
// Update the most recent brew
|
||||||
historyUpdate.push(parseBrewForStorage(brew, 1));
|
historyUpdate.push(parseBrewForStorage(brew, 1));
|
||||||
|
|
||||||
await IDB.setMany(historyUpdate, await createHBStore());
|
await IDB.setMany(historyUpdate);
|
||||||
|
|
||||||
// Break out of data checks because we found an expired value
|
// Break out of data checks because we found an expired value
|
||||||
break;
|
break;
|
||||||
@@ -106,14 +103,17 @@ export async function updateHistory(brew) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export async function versionHistoryGarbageCollection(){
|
export async function versionHistoryGarbageCollection(){
|
||||||
|
const entries = await IDB.entries();
|
||||||
|
|
||||||
const entries = await IDB.entries(await createHBStore());
|
const expiredKeys = [];
|
||||||
|
|
||||||
for (const [key, value] of entries){
|
for (const [key, value] of entries){
|
||||||
const expireAt = new Date(value.savedAt);
|
const expireAt = new Date(value.savedAt);
|
||||||
expireAt.setMinutes(expireAt.getMinutes() + GARBAGE_COLLECT_DELAY);
|
expireAt.setMinutes(expireAt.getMinutes() + GARBAGE_COLLECT_DELAY);
|
||||||
if(new Date() > expireAt){
|
if(new Date() > expireAt){
|
||||||
await IDB.del(key, await createHBStore());
|
expiredKeys.push(key);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
if(expiredKeys.length > 0){
|
||||||
|
await IDB.delMany(expiredKeys);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
@@ -73,3 +73,12 @@
|
|||||||
.fit-width {
|
.fit-width {
|
||||||
mask-image: url('../icons/fit-width.svg');
|
mask-image: url('../icons/fit-width.svg');
|
||||||
}
|
}
|
||||||
|
.single-spread {
|
||||||
|
mask-image: url('../icons/single-spread.svg');
|
||||||
|
}
|
||||||
|
.facing-spread {
|
||||||
|
mask-image: url('../icons/facing-spread.svg');
|
||||||
|
}
|
||||||
|
.flow-spread {
|
||||||
|
mask-image: url('../icons/flow-spread.svg');
|
||||||
|
}
|
||||||
|
|||||||
10
client/icons/facing-spread.svg
Normal file
10
client/icons/facing-spread.svg
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg width="100%" height="100%" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||||
|
<g transform="matrix(0.979101,0,0,0.919064,-29.0748,1.98095)">
|
||||||
|
<path d="M78.584,16.13C78.584,15.335 78.164,14.69 77.647,14.69L30.632,14.69C30.115,14.69 29.695,15.335 29.695,16.13L29.695,88.365C29.695,89.16 30.115,89.805 30.632,89.805L77.647,89.805C78.164,89.805 78.584,89.16 78.584,88.365L78.584,16.13Z"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(0.979101,0,0,0.919064,23.058,1.98095)">
|
||||||
|
<path d="M78.584,16.13C78.584,15.335 78.164,14.69 77.647,14.69L30.632,14.69C30.115,14.69 29.695,15.335 29.695,16.13L29.695,88.365C29.695,89.16 30.115,89.805 30.632,89.805L77.647,89.805C78.164,89.805 78.584,89.16 78.584,88.365L78.584,16.13Z"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.1 KiB |
24
client/icons/flow-spread.svg
Normal file
24
client/icons/flow-spread.svg
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg width="100%" height="100%" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||||
|
<g transform="matrix(1.0781,0,0,1.0781,-3.90545,-3.90502)">
|
||||||
|
<g transform="matrix(0.590052,0,0,0.553871,-13.8993,-2.19227)">
|
||||||
|
<path d="M78.584,16.13C78.584,15.335 78.164,14.69 77.647,14.69L30.632,14.69C30.115,14.69 29.695,15.335 29.695,16.13L29.695,88.365C29.695,89.16 30.115,89.805 30.632,89.805L77.647,89.805C78.164,89.805 78.584,89.16 78.584,88.365L78.584,16.13Z"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(0.590052,0,0,0.553871,-13.8993,44.3152)">
|
||||||
|
<path d="M78.584,16.13C78.584,15.335 78.164,14.69 77.647,14.69L30.632,14.69C30.115,14.69 29.695,15.335 29.695,16.13L29.695,88.365C29.695,89.16 30.115,89.805 30.632,89.805L77.647,89.805C78.164,89.805 78.584,89.16 78.584,88.365L78.584,16.13Z"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(0.590052,0,0,0.553871,17.5184,-2.19227)">
|
||||||
|
<path d="M78.584,16.13C78.584,15.335 78.164,14.69 77.647,14.69L30.632,14.69C30.115,14.69 29.695,15.335 29.695,16.13L29.695,88.365C29.695,89.16 30.115,89.805 30.632,89.805L77.647,89.805C78.164,89.805 78.584,89.16 78.584,88.365L78.584,16.13Z"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(0.590052,0,0,0.553871,50.0095,-2.19227)">
|
||||||
|
<path d="M78.584,16.13C78.584,15.335 78.164,14.69 77.647,14.69L30.632,14.69C30.115,14.69 29.695,15.335 29.695,16.13L29.695,88.365C29.695,89.16 30.115,89.805 30.632,89.805L77.647,89.805C78.164,89.805 78.584,89.16 78.584,88.365L78.584,16.13Z"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(0.590052,0,0,0.553871,17.5184,44.3152)">
|
||||||
|
<path d="M78.584,16.13C78.584,15.335 78.164,14.69 77.647,14.69L30.632,14.69C30.115,14.69 29.695,15.335 29.695,16.13L29.695,88.365C29.695,89.16 30.115,89.805 30.632,89.805L77.647,89.805C78.164,89.805 78.584,89.16 78.584,88.365L78.584,16.13Z"/>
|
||||||
|
</g>
|
||||||
|
<g transform="matrix(0.590052,0,0,0.553871,50.0095,44.3152)">
|
||||||
|
<path d="M78.584,16.13C78.584,15.335 78.164,14.69 77.647,14.69L30.632,14.69C30.115,14.69 29.695,15.335 29.695,16.13L29.695,88.365C29.695,89.16 30.115,89.805 30.632,89.805L77.647,89.805C78.164,89.805 78.584,89.16 78.584,88.365L78.584,16.13Z"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 2.5 KiB |
7
client/icons/single-spread.svg
Normal file
7
client/icons/single-spread.svg
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg width="100%" height="100%" viewBox="0 0 100 100" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;">
|
||||||
|
<g transform="matrix(1.41826,0,0,1.3313,-26.7845,-19.5573)">
|
||||||
|
<path d="M78.584,16.13C78.584,15.335 78.164,14.69 77.647,14.69L30.632,14.69C30.115,14.69 29.695,15.335 29.695,16.13L29.695,88.365C29.695,89.16 30.115,89.805 30.632,89.805L77.647,89.805C78.164,89.805 78.584,89.16 78.584,88.365L78.584,16.13Z"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 777 B |
@@ -8,6 +8,8 @@ const template = async function(name, title='', props = {}){
|
|||||||
});
|
});
|
||||||
const ogMetaTags = ogTags.join('\n');
|
const ogMetaTags = ogTags.join('\n');
|
||||||
|
|
||||||
|
const ssrModule = await import(`../build/${name}/ssr.cjs`);
|
||||||
|
|
||||||
return `<!DOCTYPE html>
|
return `<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
@@ -21,7 +23,7 @@ const template = async function(name, title='', props = {}){
|
|||||||
<title>${title.length ? `${title} - The Homebrewery`: 'The Homebrewery - NaturalCrit'}</title>
|
<title>${title.length ? `${title} - The Homebrewery`: 'The Homebrewery - NaturalCrit'}</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<main id="reactRoot">${require(`../build/${name}/ssr.js`)(props)}</main>
|
<main id="reactRoot">${ssrModule.default(props)}</main>
|
||||||
<script src=${`/${name}/bundle.js`}></script>
|
<script src=${`/${name}/bundle.js`}></script>
|
||||||
<script>start_app(${JSON.stringify(props)})</script>
|
<script>start_app(${JSON.stringify(props)})</script>
|
||||||
</body>
|
</body>
|
||||||
@@ -29,4 +31,4 @@ const template = async function(name, title='', props = {}){
|
|||||||
`;
|
`;
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = template;
|
export default template;
|
||||||
632
package-lock.json
generated
632
package-lock.json
generated
@@ -21,11 +21,11 @@
|
|||||||
"cookie-parser": "^1.4.7",
|
"cookie-parser": "^1.4.7",
|
||||||
"create-react-class": "^15.7.0",
|
"create-react-class": "^15.7.0",
|
||||||
"dedent-tabs": "^0.10.3",
|
"dedent-tabs": "^0.10.3",
|
||||||
"dompurify": "^3.1.7",
|
"dompurify": "^3.2.1",
|
||||||
"expr-eval": "^2.0.2",
|
"expr-eval": "^2.0.2",
|
||||||
"express": "^4.21.1",
|
"express": "^4.21.1",
|
||||||
"express-async-handler": "^1.2.0",
|
"express-async-handler": "^1.2.0",
|
||||||
"express-static-gzip": "2.1.8",
|
"express-static-gzip": "2.2.0",
|
||||||
"fs-extra": "11.2.0",
|
"fs-extra": "11.2.0",
|
||||||
"idb-keyval": "^6.2.1",
|
"idb-keyval": "^6.2.1",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
@@ -33,31 +33,33 @@
|
|||||||
"less": "^3.13.1",
|
"less": "^3.13.1",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"marked": "11.2.0",
|
"marked": "11.2.0",
|
||||||
"marked-emoji": "^1.4.2",
|
"marked-emoji": "^1.4.3",
|
||||||
"marked-extended-tables": "^1.0.10",
|
"marked-extended-tables": "^1.0.10",
|
||||||
"marked-gfm-heading-id": "^3.2.0",
|
"marked-gfm-heading-id": "^3.2.0",
|
||||||
"marked-smartypants-lite": "^1.0.2",
|
"marked-smartypants-lite": "^1.0.2",
|
||||||
"markedLegacy": "npm:marked@^0.3.19",
|
"markedLegacy": "npm:marked@^0.3.19",
|
||||||
"moment": "^2.30.1",
|
"moment": "^2.30.1",
|
||||||
"mongoose": "^8.7.3",
|
"mongoose": "^8.8.2",
|
||||||
"nanoid": "3.3.4",
|
"nanoid": "3.3.4",
|
||||||
"nconf": "^0.12.1",
|
"nconf": "^0.12.1",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-dom": "^18.3.1",
|
"react-dom": "^18.3.1",
|
||||||
"react-frame-component": "^4.1.3",
|
"react-frame-component": "^4.1.3",
|
||||||
"react-router-dom": "6.27.0",
|
"react-router-dom": "6.28.0",
|
||||||
"sanitize-filename": "1.6.3",
|
"sanitize-filename": "1.6.3",
|
||||||
"superagent": "^10.1.1",
|
"superagent": "^10.1.1",
|
||||||
"vitreum": "git+https://git@github.com/calculuschild/vitreum.git"
|
"vitreum": "git+https://git@github.com/calculuschild/vitreum.git"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@stylistic/stylelint-plugin": "^3.1.1",
|
"@stylistic/stylelint-plugin": "^3.1.1",
|
||||||
"eslint": "^9.13.0",
|
"babel-plugin-transform-import-meta": "^2.2.1",
|
||||||
"eslint-plugin-jest": "^28.8.3",
|
"eslint": "^9.14.0",
|
||||||
|
"eslint-plugin-jest": "^28.9.0",
|
||||||
"eslint-plugin-react": "^7.37.2",
|
"eslint-plugin-react": "^7.37.2",
|
||||||
"globals": "^15.11.0",
|
"globals": "^15.12.0",
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"jest-expect-message": "^1.1.3",
|
"jest-expect-message": "^1.1.3",
|
||||||
|
"jsdom-global": "^3.0.2",
|
||||||
"postcss-less": "^6.0.0",
|
"postcss-less": "^6.0.0",
|
||||||
"stylelint": "^16.10.0",
|
"stylelint": "^16.10.0",
|
||||||
"stylelint-config-recess-order": "^5.1.1",
|
"stylelint-config-recess-order": "^5.1.1",
|
||||||
@@ -65,7 +67,7 @@
|
|||||||
"supertest": "^7.0.0"
|
"supertest": "^7.0.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^20.17.x",
|
"node": "^20.18.x",
|
||||||
"npm": "^10.2.x"
|
"npm": "^10.2.x"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -558,6 +560,7 @@
|
|||||||
"version": "7.26.0",
|
"version": "7.26.0",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.26.0.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-attributes/-/plugin-syntax-import-attributes-7.26.0.tgz",
|
||||||
"integrity": "sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A==",
|
"integrity": "sha512-e2dttdsJ1ZTpi3B9UYGLw41hifAubg19AtCu/2I/F1QNVclOBr1dYpTdmdyZ84Xiz43BS/tCUkMAZNLv12Pi+A==",
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/helper-plugin-utils": "^7.25.9"
|
"@babel/helper-plugin-utils": "^7.25.9"
|
||||||
},
|
},
|
||||||
@@ -1859,11 +1862,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint-community/regexpp": {
|
"node_modules/@eslint-community/regexpp": {
|
||||||
"version": "4.11.0",
|
"version": "4.12.1",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.11.0.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.1.tgz",
|
||||||
"integrity": "sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==",
|
"integrity": "sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^12.0.0 || ^14.0.0 || >=16.0.0"
|
"node": "^12.0.0 || ^14.0.0 || >=16.0.0"
|
||||||
}
|
}
|
||||||
@@ -1929,9 +1931,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@eslint/js": {
|
"node_modules/@eslint/js": {
|
||||||
"version": "9.13.0",
|
"version": "9.14.0",
|
||||||
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.13.0.tgz",
|
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.14.0.tgz",
|
||||||
"integrity": "sha512-IFLyoY4d72Z5y/6o/BazFBezupzI/taV8sGumxTAVw3lXG9A6md1Dc34T9s1FoD/an9pJH8RHbAxsaEbBed9lA==",
|
"integrity": "sha512-pFoEtFWCPyDOl+C6Ift+wC7Ro89otjigCf5vcuWqWgqNSQbRrpjSvdeE6ofLz4dHmyxD5f7gIdGT4+p36L6Twg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
@@ -1970,27 +1972,40 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@humanfs/core": {
|
"node_modules/@humanfs/core": {
|
||||||
"version": "0.19.0",
|
"version": "0.19.1",
|
||||||
"resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.0.tgz",
|
"resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.1.tgz",
|
||||||
"integrity": "sha512-2cbWIHbZVEweE853g8jymffCA+NCMiuqeECeBBLm8dg2oFdjuGJhgN4UAbI+6v0CKbbhvtXA4qV8YR5Ji86nmw==",
|
"integrity": "sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.18.0"
|
"node": ">=18.18.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@humanfs/node": {
|
"node_modules/@humanfs/node": {
|
||||||
"version": "0.16.5",
|
"version": "0.16.6",
|
||||||
"resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.5.tgz",
|
"resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.6.tgz",
|
||||||
"integrity": "sha512-KSPA4umqSG4LHYRodq31VDwKAvaTF4xmVlzM8Aeh4PlU1JQ3IG0wiA8C25d3RQ9nJyM3mBHyI53K06VVL/oFFg==",
|
"integrity": "sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@humanfs/core": "^0.19.0",
|
"@humanfs/core": "^0.19.1",
|
||||||
"@humanwhocodes/retry": "^0.3.0"
|
"@humanwhocodes/retry": "^0.3.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.18.0"
|
"node": ">=18.18.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@humanfs/node/node_modules/@humanwhocodes/retry": {
|
||||||
|
"version": "0.3.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz",
|
||||||
|
"integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==",
|
||||||
|
"dev": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18.18"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"type": "github",
|
||||||
|
"url": "https://github.com/sponsors/nzakas"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@humanwhocodes/module-importer": {
|
"node_modules/@humanwhocodes/module-importer": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
|
||||||
@@ -2006,9 +2021,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@humanwhocodes/retry": {
|
"node_modules/@humanwhocodes/retry": {
|
||||||
"version": "0.3.1",
|
"version": "0.4.1",
|
||||||
"resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.1.tgz",
|
||||||
"integrity": "sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==",
|
"integrity": "sha512-c7hNEllBlenFTHBky65mhq8WD2kbN9Q6gk0bTk8lSBvc554jpXSkST1iePudpt7+A/AQvuHs9EMqjHDXMY1lrA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.18"
|
"node": ">=18.18"
|
||||||
@@ -2902,9 +2917,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@remix-run/router": {
|
"node_modules/@remix-run/router": {
|
||||||
"version": "1.20.0",
|
"version": "1.21.0",
|
||||||
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.20.0.tgz",
|
"resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.21.0.tgz",
|
||||||
"integrity": "sha512-mUnk8rPJBI9loFDZ+YzPGdeniYK+FTmRD1TMCz7ev2SNIozyKKpnGgsxO34u6Z4z/t0ITuu7voi/AshfsGsgFg==",
|
"integrity": "sha512-xfSkCAchbdG5PnbrKqFWwia4Bi61nH+wm8wLEqfHDyp7Y3dZzgqS2itV8i4gAq9pC2HsTpwyBC6Ds8VHZ96JlA==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.0.0"
|
"node": ">=14.0.0"
|
||||||
}
|
}
|
||||||
@@ -3069,6 +3084,12 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/trusted-types": {
|
||||||
|
"version": "2.0.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz",
|
||||||
|
"integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==",
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
"node_modules/@types/webidl-conversions": {
|
"node_modules/@types/webidl-conversions": {
|
||||||
"version": "7.0.3",
|
"version": "7.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz",
|
||||||
@@ -3254,11 +3275,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/acorn": {
|
"node_modules/acorn": {
|
||||||
"version": "8.12.1",
|
"version": "8.14.0",
|
||||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz",
|
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.14.0.tgz",
|
||||||
"integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==",
|
"integrity": "sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
|
||||||
"bin": {
|
"bin": {
|
||||||
"acorn": "bin/acorn"
|
"acorn": "bin/acorn"
|
||||||
},
|
},
|
||||||
@@ -3869,6 +3889,27 @@
|
|||||||
"@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0"
|
"@babel/core": "^7.4.0 || ^8.0.0-0 <8.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/babel-plugin-transform-import-meta": {
|
||||||
|
"version": "2.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/babel-plugin-transform-import-meta/-/babel-plugin-transform-import-meta-2.2.1.tgz",
|
||||||
|
"integrity": "sha512-AxNh27Pcg8Kt112RGa3Vod2QS2YXKKJ6+nSvRtv7qQTJAdx0MZa4UHZ4lnxHUWA2MNbLuZQv5FVab4P1CoLOWw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "BSD",
|
||||||
|
"dependencies": {
|
||||||
|
"@babel/template": "^7.4.4",
|
||||||
|
"tslib": "^2.4.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@babel/core": "^7.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/babel-plugin-transform-import-meta/node_modules/tslib": {
|
||||||
|
"version": "2.8.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",
|
||||||
|
"integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "0BSD"
|
||||||
|
},
|
||||||
"node_modules/babel-preset-current-node-syntax": {
|
"node_modules/babel-preset-current-node-syntax": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz",
|
||||||
@@ -4315,9 +4356,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/bson": {
|
"node_modules/bson": {
|
||||||
"version": "6.8.0",
|
"version": "6.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/bson/-/bson-6.8.0.tgz",
|
"resolved": "https://registry.npmjs.org/bson/-/bson-6.9.0.tgz",
|
||||||
"integrity": "sha512-iOJg8pr7wq2tg/zSlCCHMi3hMm5JTOxLTagf3zxhcenHsFp+c6uOs6K7W5UE7A4QIJGtqh/ZovFNMP4mOPJynQ==",
|
"integrity": "sha512-X9hJeyeM0//Fus+0pc5dSUMhhrrmWwQUtdavaQeF3Ta6m69matZkGWV/MrBcnwUeLC8W9kwwc2hfkZgUuCX3Ig==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.20.1"
|
"node": ">=16.20.1"
|
||||||
}
|
}
|
||||||
@@ -5036,12 +5077,81 @@
|
|||||||
"node": ">=4"
|
"node": ">=4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/cssstyle": {
|
||||||
|
"version": "4.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-4.1.0.tgz",
|
||||||
|
"integrity": "sha512-h66W1URKpBS5YMI/V8PyXvTMFT8SupJ1IzoIV8IeBC/ji8WVmrO8dGlTi+2dh6whmdk6BiKJLD/ZBkhWbcg6nA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
|
"dependencies": {
|
||||||
|
"rrweb-cssom": "^0.7.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/dash-ast": {
|
"node_modules/dash-ast": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/dash-ast/-/dash-ast-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/dash-ast/-/dash-ast-1.0.0.tgz",
|
||||||
"integrity": "sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA==",
|
"integrity": "sha512-Vy4dx7gquTeMcQR/hDkYLGUnwVil6vk4FOOct+djUnHOUWt+zJPJAaRIXaAFkPXtJjvlY7o3rfRu0/3hpnwoUA==",
|
||||||
"license": "Apache-2.0"
|
"license": "Apache-2.0"
|
||||||
},
|
},
|
||||||
|
"node_modules/data-urls": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/data-urls/-/data-urls-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-ZYP5VBHshaDAiVZxjbRVcFJpc+4xGgT0bK3vzy1HLN8jTO975HEbuYzZJcHoQEY5K1a0z8YayJkyVETa08eNTg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
|
"dependencies": {
|
||||||
|
"whatwg-mimetype": "^4.0.0",
|
||||||
|
"whatwg-url": "^14.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/data-urls/node_modules/tr46": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
|
"dependencies": {
|
||||||
|
"punycode": "^2.3.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/data-urls/node_modules/webidl-conversions": {
|
||||||
|
"version": "7.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz",
|
||||||
|
"integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "BSD-2-Clause",
|
||||||
|
"peer": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/data-urls/node_modules/whatwg-url": {
|
||||||
|
"version": "14.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.0.0.tgz",
|
||||||
|
"integrity": "sha512-1lfMEm2IEr7RIV+f4lUNPOqfFL+pO+Xw3fJSqmjX9AbXcXcYOkCe1P6+9VBZB6n94af16NfZf+sSk0JCBZC9aw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
|
"dependencies": {
|
||||||
|
"tr46": "^5.0.0",
|
||||||
|
"webidl-conversions": "^7.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/data-view-buffer": {
|
"node_modules/data-view-buffer": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/data-view-buffer/-/data-view-buffer-1.0.1.tgz",
|
||||||
@@ -5112,6 +5222,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/decimal.js": {
|
||||||
|
"version": "10.4.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz",
|
||||||
|
"integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"peer": true
|
||||||
|
},
|
||||||
"node_modules/decode-uri-component": {
|
"node_modules/decode-uri-component": {
|
||||||
"version": "0.2.2",
|
"version": "0.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz",
|
"resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.2.tgz",
|
||||||
@@ -5366,9 +5484,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/dompurify": {
|
"node_modules/dompurify": {
|
||||||
"version": "3.1.7",
|
"version": "3.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.1.7.tgz",
|
"resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.2.1.tgz",
|
||||||
"integrity": "sha512-VaTstWtsneJY8xzy7DekmYWEOZcmzIe3Qb3zPd4STve1OBTa+e+WmS1ITQec1fZYXI3HCsOZZiSMpG6oxoWMWQ=="
|
"integrity": "sha512-NBHEsc0/kzRYQd+AY6HR6B/IgsqzBABrqJbpCDQII/OK6h7B7LXzweZTDsqSW2LkTRpoxf18YUP+YjGySk6B3w==",
|
||||||
|
"optionalDependencies": {
|
||||||
|
"@types/trusted-types": "^2.0.7"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"node_modules/duplexer2": {
|
"node_modules/duplexer2": {
|
||||||
"version": "0.1.4",
|
"version": "0.1.4",
|
||||||
@@ -5446,6 +5567,20 @@
|
|||||||
"node": ">= 0.8"
|
"node": ">= 0.8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/entities": {
|
||||||
|
"version": "4.5.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",
|
||||||
|
"integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "BSD-2-Clause",
|
||||||
|
"peer": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.12"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/fb55/entities?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/env-paths": {
|
"node_modules/env-paths": {
|
||||||
"version": "2.2.1",
|
"version": "2.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz",
|
||||||
@@ -5658,21 +5793,21 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/eslint": {
|
"node_modules/eslint": {
|
||||||
"version": "9.13.0",
|
"version": "9.14.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint/-/eslint-9.13.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint/-/eslint-9.14.0.tgz",
|
||||||
"integrity": "sha512-EYZK6SX6zjFHST/HRytOdA/zE72Cq/bfw45LSyuwrdvcclb/gqV8RRQxywOBEWO2+WDpva6UZa4CcDeJKzUCFA==",
|
"integrity": "sha512-c2FHsVBr87lnUtjP4Yhvk4yEhKrQavGafRA/Se1ouse8PfbfC/Qh9Mxa00yWsZRlqeUB9raXip0aiiUZkgnr9g==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@eslint-community/eslint-utils": "^4.2.0",
|
"@eslint-community/eslint-utils": "^4.2.0",
|
||||||
"@eslint-community/regexpp": "^4.11.0",
|
"@eslint-community/regexpp": "^4.12.1",
|
||||||
"@eslint/config-array": "^0.18.0",
|
"@eslint/config-array": "^0.18.0",
|
||||||
"@eslint/core": "^0.7.0",
|
"@eslint/core": "^0.7.0",
|
||||||
"@eslint/eslintrc": "^3.1.0",
|
"@eslint/eslintrc": "^3.1.0",
|
||||||
"@eslint/js": "9.13.0",
|
"@eslint/js": "9.14.0",
|
||||||
"@eslint/plugin-kit": "^0.2.0",
|
"@eslint/plugin-kit": "^0.2.0",
|
||||||
"@humanfs/node": "^0.16.5",
|
"@humanfs/node": "^0.16.6",
|
||||||
"@humanwhocodes/module-importer": "^1.0.1",
|
"@humanwhocodes/module-importer": "^1.0.1",
|
||||||
"@humanwhocodes/retry": "^0.3.1",
|
"@humanwhocodes/retry": "^0.4.0",
|
||||||
"@types/estree": "^1.0.6",
|
"@types/estree": "^1.0.6",
|
||||||
"@types/json-schema": "^7.0.15",
|
"@types/json-schema": "^7.0.15",
|
||||||
"ajv": "^6.12.4",
|
"ajv": "^6.12.4",
|
||||||
@@ -5680,9 +5815,9 @@
|
|||||||
"cross-spawn": "^7.0.2",
|
"cross-spawn": "^7.0.2",
|
||||||
"debug": "^4.3.2",
|
"debug": "^4.3.2",
|
||||||
"escape-string-regexp": "^4.0.0",
|
"escape-string-regexp": "^4.0.0",
|
||||||
"eslint-scope": "^8.1.0",
|
"eslint-scope": "^8.2.0",
|
||||||
"eslint-visitor-keys": "^4.1.0",
|
"eslint-visitor-keys": "^4.2.0",
|
||||||
"espree": "^10.2.0",
|
"espree": "^10.3.0",
|
||||||
"esquery": "^1.5.0",
|
"esquery": "^1.5.0",
|
||||||
"esutils": "^2.0.2",
|
"esutils": "^2.0.2",
|
||||||
"fast-deep-equal": "^3.1.3",
|
"fast-deep-equal": "^3.1.3",
|
||||||
@@ -5718,9 +5853,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint-plugin-jest": {
|
"node_modules/eslint-plugin-jest": {
|
||||||
"version": "28.8.3",
|
"version": "28.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-28.8.3.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-28.9.0.tgz",
|
||||||
"integrity": "sha512-HIQ3t9hASLKm2IhIOqnu+ifw7uLZkIlR7RYNv7fMcEi/p0CIiJmfriStQS2LDkgtY4nyLbIZAD+JL347Yc2ETQ==",
|
"integrity": "sha512-rLu1s1Wf96TgUUxSw6loVIkNtUjq1Re7A9QdCCHSohnvXEBAjuL420h0T/fMmkQlNsQP2GhQzEUpYHPfxBkvYQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@typescript-eslint/utils": "^6.0.0 || ^7.0.0 || ^8.0.0"
|
"@typescript-eslint/utils": "^6.0.0 || ^7.0.0 || ^8.0.0"
|
||||||
@@ -5806,9 +5941,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint-scope": {
|
"node_modules/eslint-scope": {
|
||||||
"version": "8.1.0",
|
"version": "8.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz",
|
||||||
"integrity": "sha512-14dSvlhaVhKKsa9Fx1l8A17s7ah7Ef7wCakJ10LYk6+GYmP9yDti2oq2SEwcyndt6knfcZyhyxwY3i9yL78EQw==",
|
"integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"esrecurse": "^4.3.0",
|
"esrecurse": "^4.3.0",
|
||||||
@@ -5901,9 +6036,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/eslint/node_modules/eslint-visitor-keys": {
|
"node_modules/eslint/node_modules/eslint-visitor-keys": {
|
||||||
"version": "4.1.0",
|
"version": "4.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz",
|
||||||
"integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==",
|
"integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
@@ -5936,14 +6071,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/espree": {
|
"node_modules/espree": {
|
||||||
"version": "10.2.0",
|
"version": "10.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/espree/-/espree-10.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz",
|
||||||
"integrity": "sha512-upbkBJbckcCNBDBDXEbuhjbP68n+scUd3k/U2EkyM9nw+I/jPiL4cLF/Al06CF96wRltFda16sxDFrxsI1v0/g==",
|
"integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"acorn": "^8.12.0",
|
"acorn": "^8.14.0",
|
||||||
"acorn-jsx": "^5.3.2",
|
"acorn-jsx": "^5.3.2",
|
||||||
"eslint-visitor-keys": "^4.1.0"
|
"eslint-visitor-keys": "^4.2.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
@@ -5953,9 +6088,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/espree/node_modules/eslint-visitor-keys": {
|
"node_modules/espree/node_modules/eslint-visitor-keys": {
|
||||||
"version": "4.1.0",
|
"version": "4.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz",
|
||||||
"integrity": "sha512-Q7lok0mqMUSf5a/AdAZkA5a/gHcO6snwQClVNNvFKCAVlxXucdU8pKydU5ZVZjBx5xr37vGbFFWtLQYreLzrZg==",
|
"integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
|
||||||
@@ -6187,10 +6322,11 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/express-static-gzip": {
|
"node_modules/express-static-gzip": {
|
||||||
"version": "2.1.8",
|
"version": "2.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/express-static-gzip/-/express-static-gzip-2.1.8.tgz",
|
"resolved": "https://registry.npmjs.org/express-static-gzip/-/express-static-gzip-2.2.0.tgz",
|
||||||
"integrity": "sha512-g8tiJuI9Y9Ffy59ehVXvqb0hhP83JwZiLxzanobPaMbkB5qBWA8nuVgd+rcd5qzH3GkgogTALlc0BaADYwnMbQ==",
|
"integrity": "sha512-4ZQ0pHX0CAauxmzry2/8XFLM6aZA4NBvg9QezSlsEO1zLnl7vMFa48/WIcjzdfOiEUS4S1npPPKP2NHHYAp6qg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"parseurl": "^1.3.3",
|
||||||
"serve-static": "^1.16.2"
|
"serve-static": "^1.16.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -6845,9 +6981,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/globals": {
|
"node_modules/globals": {
|
||||||
"version": "15.11.0",
|
"version": "15.12.0",
|
||||||
"resolved": "https://registry.npmjs.org/globals/-/globals-15.11.0.tgz",
|
"resolved": "https://registry.npmjs.org/globals/-/globals-15.12.0.tgz",
|
||||||
"integrity": "sha512-yeyNSjdbyVaWurlwCpcA6XNBrHTMIeDdj0/hnvX/OLJ9ekOXYbLsLinH/MucQyGvNnXhidTdNhTtJaffL2sMfw==",
|
"integrity": "sha512-1+gLErljJFhbOVyaetcwJiJ4+eLe45S2E7P5UiZ9xGfeq3ATQf5DOv9G7MH3gGbKQLkzmNh2DxfZwLdw+j6oTQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
@@ -7163,6 +7299,20 @@
|
|||||||
"minimalistic-crypto-utils": "^1.0.1"
|
"minimalistic-crypto-utils": "^1.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/html-encoding-sniffer": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-Y22oTqIU4uuPgEemfz7NDJz6OeKf12Lsu+QC+s3BVpda64lTiMYCyGwg5ki4vFxkMwQdeZDl2adZoqUgdFuTgQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
|
"dependencies": {
|
||||||
|
"whatwg-encoding": "^3.1.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/html-escaper": {
|
"node_modules/html-escaper": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz",
|
||||||
@@ -7208,6 +7358,21 @@
|
|||||||
"node": ">= 0.8"
|
"node": ">= 0.8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/http-proxy-agent": {
|
||||||
|
"version": "7.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz",
|
||||||
|
"integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
|
"dependencies": {
|
||||||
|
"agent-base": "^7.1.0",
|
||||||
|
"debug": "^4.3.4"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 14"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/https-browserify": {
|
"node_modules/https-browserify": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz",
|
||||||
@@ -7768,6 +7933,14 @@
|
|||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/is-potential-custom-element-name": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"peer": true
|
||||||
|
},
|
||||||
"node_modules/is-regex": {
|
"node_modules/is-regex": {
|
||||||
"version": "1.1.4",
|
"version": "1.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz",
|
||||||
@@ -9770,6 +9943,121 @@
|
|||||||
"js-yaml": "bin/js-yaml.js"
|
"js-yaml": "bin/js-yaml.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/jsdom": {
|
||||||
|
"version": "25.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/jsdom/-/jsdom-25.0.1.tgz",
|
||||||
|
"integrity": "sha512-8i7LzZj7BF8uplX+ZyOlIz86V6TAsSs+np6m1kpW9u0JWi4z/1t+FzcK1aek+ybTnAC4KhBL4uXCNT0wcUIeCw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
|
"dependencies": {
|
||||||
|
"cssstyle": "^4.1.0",
|
||||||
|
"data-urls": "^5.0.0",
|
||||||
|
"decimal.js": "^10.4.3",
|
||||||
|
"form-data": "^4.0.0",
|
||||||
|
"html-encoding-sniffer": "^4.0.0",
|
||||||
|
"http-proxy-agent": "^7.0.2",
|
||||||
|
"https-proxy-agent": "^7.0.5",
|
||||||
|
"is-potential-custom-element-name": "^1.0.1",
|
||||||
|
"nwsapi": "^2.2.12",
|
||||||
|
"parse5": "^7.1.2",
|
||||||
|
"rrweb-cssom": "^0.7.1",
|
||||||
|
"saxes": "^6.0.0",
|
||||||
|
"symbol-tree": "^3.2.4",
|
||||||
|
"tough-cookie": "^5.0.0",
|
||||||
|
"w3c-xmlserializer": "^5.0.0",
|
||||||
|
"webidl-conversions": "^7.0.0",
|
||||||
|
"whatwg-encoding": "^3.1.1",
|
||||||
|
"whatwg-mimetype": "^4.0.0",
|
||||||
|
"whatwg-url": "^14.0.0",
|
||||||
|
"ws": "^8.18.0",
|
||||||
|
"xml-name-validator": "^5.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"canvas": "^2.11.2"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"canvas": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/jsdom-global": {
|
||||||
|
"version": "3.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/jsdom-global/-/jsdom-global-3.0.2.tgz",
|
||||||
|
"integrity": "sha512-t1KMcBkz/pT5JrvcJbpUR2u/w1kO9jXctaaGJ0vZDzwFnIvGWw9IDSRciT83kIs8Bnw4qpOl8bQK08V01YgMPg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"peerDependencies": {
|
||||||
|
"jsdom": ">=10.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/jsdom/node_modules/tr46": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/tr46/-/tr46-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-tk2G5R2KRwBd+ZN0zaEXpmzdKyOYksXwywulIX95MBODjSzMIuQnQ3m8JxgbhnL1LeVo7lqQKsYa1O3Htl7K5g==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
|
"dependencies": {
|
||||||
|
"punycode": "^2.3.1"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/jsdom/node_modules/webidl-conversions": {
|
||||||
|
"version": "7.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz",
|
||||||
|
"integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "BSD-2-Clause",
|
||||||
|
"peer": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/jsdom/node_modules/whatwg-url": {
|
||||||
|
"version": "14.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-14.0.0.tgz",
|
||||||
|
"integrity": "sha512-1lfMEm2IEr7RIV+f4lUNPOqfFL+pO+Xw3fJSqmjX9AbXcXcYOkCe1P6+9VBZB6n94af16NfZf+sSk0JCBZC9aw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
|
"dependencies": {
|
||||||
|
"tr46": "^5.0.0",
|
||||||
|
"webidl-conversions": "^7.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/jsdom/node_modules/ws": {
|
||||||
|
"version": "8.18.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz",
|
||||||
|
"integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10.0.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"bufferutil": "^4.0.1",
|
||||||
|
"utf-8-validate": ">=5.0.2"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"bufferutil": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"utf-8-validate": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/jsesc": {
|
"node_modules/jsesc": {
|
||||||
"version": "3.0.2",
|
"version": "3.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/jsesc/-/jsesc-3.0.2.tgz",
|
||||||
@@ -10232,11 +10520,11 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/marked-emoji": {
|
"node_modules/marked-emoji": {
|
||||||
"version": "1.4.2",
|
"version": "1.4.3",
|
||||||
"resolved": "https://registry.npmjs.org/marked-emoji/-/marked-emoji-1.4.2.tgz",
|
"resolved": "https://registry.npmjs.org/marked-emoji/-/marked-emoji-1.4.3.tgz",
|
||||||
"integrity": "sha512-2sP+bp2z76dwbILzQ7ijy2PyjjAJR3iAZCzaNGThD2UijFUBeidkn6MoCdX/j47tPIcWt9nwnjqRQPd01ZrfdA==",
|
"integrity": "sha512-HDZx1VOmzu7XT2QNKWfrHGbNRMTWKj9XD78yrcH1madD30HpGLMODPOmKr/e7CA7NKKXkpXXNdndQn++ysXmHg==",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"marked": ">=4 <15"
|
"marked": ">=4 <16"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/marked-extended-tables": {
|
"node_modules/marked-extended-tables": {
|
||||||
@@ -10610,13 +10898,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mongoose": {
|
"node_modules/mongoose": {
|
||||||
"version": "8.7.3",
|
"version": "8.8.2",
|
||||||
"resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.7.3.tgz",
|
"resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.8.2.tgz",
|
||||||
"integrity": "sha512-Xl6+dzU5ZpEcDoJ8/AyrIdAwTY099QwpolvV73PIytpK13XqwllLq/9XeVzzLEQgmyvwBVGVgjmMrKbuezxrIA==",
|
"integrity": "sha512-jCTSqDANfRzk909v4YoZQi7jlGRB2MTvgG+spVBc/BA4tOs1oWJr//V6yYujqNq9UybpOtsSfBqxI0dSOEFJHQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bson": "^6.7.0",
|
"bson": "^6.7.0",
|
||||||
"kareem": "2.6.3",
|
"kareem": "2.6.3",
|
||||||
"mongodb": "6.9.0",
|
"mongodb": "~6.10.0",
|
||||||
"mpath": "0.9.0",
|
"mpath": "0.9.0",
|
||||||
"mquery": "5.0.0",
|
"mquery": "5.0.0",
|
||||||
"ms": "2.1.3",
|
"ms": "2.1.3",
|
||||||
@@ -10688,9 +10976,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mongoose/node_modules/mongodb": {
|
"node_modules/mongoose/node_modules/mongodb": {
|
||||||
"version": "6.9.0",
|
"version": "6.10.0",
|
||||||
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.9.0.tgz",
|
"resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.10.0.tgz",
|
||||||
"integrity": "sha512-UMopBVx1LmEUbW/QE0Hw18u583PEDVQmUmVzzBRH0o/xtE9DBRA5ZYLOjpLIa03i8FXjzvQECJcqoMvCXftTUA==",
|
"integrity": "sha512-gP9vduuYWb9ZkDM546M+MP2qKVk5ZG2wPF63OvSRuUbqCR+11ZCAE1mOfllhlAG0wcoJY5yDL/rV3OmYEwXIzg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@mongodb-js/saslprep": "^1.1.5",
|
"@mongodb-js/saslprep": "^1.1.5",
|
||||||
"bson": "^6.7.0",
|
"bson": "^6.7.0",
|
||||||
@@ -11039,6 +11327,14 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/nwsapi": {
|
||||||
|
"version": "2.2.13",
|
||||||
|
"resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.13.tgz",
|
||||||
|
"integrity": "sha512-cTGB9ptp9dY9A5VbMSe7fQBcl/tt22Vcqdq8+eN93rblOuE0aCFu4aZ2vMwct/2t+lFnosm8RkQW1I0Omb1UtQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"peer": true
|
||||||
|
},
|
||||||
"node_modules/object-assign": {
|
"node_modules/object-assign": {
|
||||||
"version": "4.1.1",
|
"version": "4.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||||
@@ -11371,6 +11667,20 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/parse5": {
|
||||||
|
"version": "7.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/parse5/-/parse5-7.2.1.tgz",
|
||||||
|
"integrity": "sha512-BuBYQYlv1ckiPdQi/ohiivi9Sagc9JG+Ozs0r7b/0iK3sKmrb0b9FdWdBbOdx6hBCM/F9Ir82ofnBhtZOjCRPQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
|
"dependencies": {
|
||||||
|
"entities": "^4.5.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/inikulin/parse5?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/parseurl": {
|
"node_modules/parseurl": {
|
||||||
"version": "1.3.3",
|
"version": "1.3.3",
|
||||||
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
|
"resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
|
||||||
@@ -12009,11 +12319,11 @@
|
|||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/react-router": {
|
"node_modules/react-router": {
|
||||||
"version": "6.27.0",
|
"version": "6.28.0",
|
||||||
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.27.0.tgz",
|
"resolved": "https://registry.npmjs.org/react-router/-/react-router-6.28.0.tgz",
|
||||||
"integrity": "sha512-YA+HGZXz4jaAkVoYBE98VQl+nVzI+cVI2Oj/06F5ZM+0u3TgedN9Y9kmMRo2mnkSK2nCpNQn0DVob4HCsY/WLw==",
|
"integrity": "sha512-HrYdIFqdrnhDw0PqG/AKjAqEqM7AvxCz0DQ4h2W8k6nqmc5uRBYDag0SBxx9iYz5G8gnuNVLzUe13wl9eAsXXg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@remix-run/router": "1.20.0"
|
"@remix-run/router": "1.21.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.0.0"
|
"node": ">=14.0.0"
|
||||||
@@ -12023,12 +12333,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/react-router-dom": {
|
"node_modules/react-router-dom": {
|
||||||
"version": "6.27.0",
|
"version": "6.28.0",
|
||||||
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.27.0.tgz",
|
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-6.28.0.tgz",
|
||||||
"integrity": "sha512-+bvtFWMC0DgAFrfKXKG9Fc+BcXWRUO1aJIihbB79xaeq0v5UzfvnM5houGUm1Y461WVRcgAQ+Clh5rdb1eCx4g==",
|
"integrity": "sha512-kQ7Unsl5YdyOltsPGl31zOjLrDv+m2VcIEcIHqYYD3Lp0UppLjrzcfJqDJwXxFw3TH/yvapbnUvPlAj7Kx5nbg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@remix-run/router": "1.20.0",
|
"@remix-run/router": "1.21.0",
|
||||||
"react-router": "6.27.0"
|
"react-router": "6.28.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.0.0"
|
"node": ">=14.0.0"
|
||||||
@@ -12386,6 +12696,14 @@
|
|||||||
"inherits": "^2.0.1"
|
"inherits": "^2.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/rrweb-cssom": {
|
||||||
|
"version": "0.7.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/rrweb-cssom/-/rrweb-cssom-0.7.1.tgz",
|
||||||
|
"integrity": "sha512-TrEMa7JGdVm0UThDJSx7ddw5nVm3UJS9o9CCIZ72B1vSyEZoziDqBYP3XIoi/12lKrJR8rE3jeFHMok2F/Mnsg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"peer": true
|
||||||
|
},
|
||||||
"node_modules/run-parallel": {
|
"node_modules/run-parallel": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
|
||||||
@@ -12491,6 +12809,20 @@
|
|||||||
"truncate-utf8-bytes": "^1.0.0"
|
"truncate-utf8-bytes": "^1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/saxes": {
|
||||||
|
"version": "6.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/saxes/-/saxes-6.0.0.tgz",
|
||||||
|
"integrity": "sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "ISC",
|
||||||
|
"peer": true,
|
||||||
|
"dependencies": {
|
||||||
|
"xmlchars": "^2.2.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=v12.22.7"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/scheduler": {
|
"node_modules/scheduler": {
|
||||||
"version": "0.23.2",
|
"version": "0.23.2",
|
||||||
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz",
|
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz",
|
||||||
@@ -13688,6 +14020,14 @@
|
|||||||
"integrity": "sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==",
|
"integrity": "sha512-ovssysQTa+luh7A5Weu3Rta6FJlFBBbInjOh722LIt6klpU2/HtdUbszju/G4devcvk8PGt7FCLv5wftu3THUA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"node_modules/symbol-tree": {
|
||||||
|
"version": "3.2.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz",
|
||||||
|
"integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"peer": true
|
||||||
|
},
|
||||||
"node_modules/syntax-error": {
|
"node_modules/syntax-error": {
|
||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/syntax-error/-/syntax-error-1.4.0.tgz",
|
||||||
@@ -13787,6 +14127,28 @@
|
|||||||
"node": ">=0.6.0"
|
"node": ">=0.6.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/tldts": {
|
||||||
|
"version": "6.1.56",
|
||||||
|
"resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.56.tgz",
|
||||||
|
"integrity": "sha512-2PT1oRZCxtsbLi5R2SQjE/v4vvgRggAtVcYj+3Rrcnu2nPZvu7m64+gDa/EsVSWd3QzEc0U0xN+rbEKsJC47kA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
|
"dependencies": {
|
||||||
|
"tldts-core": "^6.1.56"
|
||||||
|
},
|
||||||
|
"bin": {
|
||||||
|
"tldts": "bin/cli.js"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/tldts-core": {
|
||||||
|
"version": "6.1.56",
|
||||||
|
"resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.56.tgz",
|
||||||
|
"integrity": "sha512-Ihxv/Bwiyj73icTYVgBUkQ3wstlCglLoegSgl64oSrGUBX1hc7Qmf/CnrnJLaQdZrCnTaLqMYOwKMKlkfkFrxQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"peer": true
|
||||||
|
},
|
||||||
"node_modules/tmpl": {
|
"node_modules/tmpl": {
|
||||||
"version": "1.0.5",
|
"version": "1.0.5",
|
||||||
"resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz",
|
"resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.5.tgz",
|
||||||
@@ -13926,6 +14288,20 @@
|
|||||||
"nodetouch": "bin/nodetouch.js"
|
"nodetouch": "bin/nodetouch.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/tough-cookie": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-FRKsF7cz96xIIeMZ82ehjC3xW2E+O2+v11udrDYewUbszngYhsGa8z6YUMMzO9QJZzzyd0nGGXnML/TReX6W8Q==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "BSD-3-Clause",
|
||||||
|
"peer": true,
|
||||||
|
"dependencies": {
|
||||||
|
"tldts": "^6.1.32"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/tr46": {
|
"node_modules/tr46": {
|
||||||
"version": "0.0.3",
|
"version": "0.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||||
@@ -14507,6 +14883,20 @@
|
|||||||
"integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==",
|
"integrity": "sha512-2ham8XPWTONajOR0ohOKOHXkm3+gaBmGut3SRuu75xLd/RRaY6vqgh8NBYYk7+RW3u5AtzPQZG8F10LHkl0lAQ==",
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
|
"node_modules/w3c-xmlserializer": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-o8qghlI8NZHU1lLPrpi2+Uq7abh4GGPpYANlalzWxyWteJOCsr/P+oPBA49TOLu5FTZO4d3F9MnWJfiMo4BkmA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
|
"dependencies": {
|
||||||
|
"xml-name-validator": "^5.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/walker": {
|
"node_modules/walker": {
|
||||||
"version": "1.0.8",
|
"version": "1.0.8",
|
||||||
"resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz",
|
"resolved": "https://registry.npmjs.org/walker/-/walker-1.0.8.tgz",
|
||||||
@@ -14832,6 +15222,45 @@
|
|||||||
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==",
|
"integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==",
|
||||||
"license": "BSD-2-Clause"
|
"license": "BSD-2-Clause"
|
||||||
},
|
},
|
||||||
|
"node_modules/whatwg-encoding": {
|
||||||
|
"version": "3.1.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz",
|
||||||
|
"integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
|
"dependencies": {
|
||||||
|
"iconv-lite": "0.6.3"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/whatwg-encoding/node_modules/iconv-lite": {
|
||||||
|
"version": "0.6.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",
|
||||||
|
"integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
|
"dependencies": {
|
||||||
|
"safer-buffer": ">= 2.1.2 < 3.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=0.10.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/whatwg-mimetype": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/whatwg-url": {
|
"node_modules/whatwg-url": {
|
||||||
"version": "5.0.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||||
@@ -15040,6 +15469,25 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/xml-name-validator": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "Apache-2.0",
|
||||||
|
"peer": true,
|
||||||
|
"engines": {
|
||||||
|
"node": ">=18"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/xmlchars": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz",
|
||||||
|
"integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"peer": true
|
||||||
|
},
|
||||||
"node_modules/xtend": {
|
"node_modules/xtend": {
|
||||||
"version": "4.0.2",
|
"version": "4.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz",
|
||||||
|
|||||||
25
package.json
25
package.json
@@ -2,9 +2,10 @@
|
|||||||
"name": "homebrewery",
|
"name": "homebrewery",
|
||||||
"description": "Create authentic looking D&D homebrews using only markdown",
|
"description": "Create authentic looking D&D homebrews using only markdown",
|
||||||
"version": "3.16.0",
|
"version": "3.16.0",
|
||||||
|
"type": "module",
|
||||||
"engines": {
|
"engines": {
|
||||||
"npm": "^10.2.x",
|
"npm": "^10.2.x",
|
||||||
"node": "^20.17.x"
|
"node": "^20.18.x"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -38,6 +39,7 @@
|
|||||||
"test:hard-breaks": "jest tests/markdown/hard-breaks.test.js --verbose --noStackTrace",
|
"test:hard-breaks": "jest tests/markdown/hard-breaks.test.js --verbose --noStackTrace",
|
||||||
"test:emojis": "jest tests/markdown/emojis.test.js --verbose --noStackTrace",
|
"test:emojis": "jest tests/markdown/emojis.test.js --verbose --noStackTrace",
|
||||||
"test:route": "jest tests/routes/static-pages.test.js --verbose",
|
"test:route": "jest tests/routes/static-pages.test.js --verbose",
|
||||||
|
"test:safehtml": "jest tests/html/safeHTML.test.js --verbose",
|
||||||
"phb": "node --experimental-require-module scripts/phb.js",
|
"phb": "node --experimental-require-module scripts/phb.js",
|
||||||
"prod": "set NODE_ENV=production && npm run build",
|
"prod": "set NODE_ENV=production && npm run build",
|
||||||
"postinstall": "npm run build",
|
"postinstall": "npm run build",
|
||||||
@@ -82,7 +84,8 @@
|
|||||||
"@babel/preset-react"
|
"@babel/preset-react"
|
||||||
],
|
],
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"@babel/plugin-transform-runtime"
|
"@babel/plugin-transform-runtime",
|
||||||
|
"babel-plugin-transform-import-meta"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -97,11 +100,11 @@
|
|||||||
"cookie-parser": "^1.4.7",
|
"cookie-parser": "^1.4.7",
|
||||||
"create-react-class": "^15.7.0",
|
"create-react-class": "^15.7.0",
|
||||||
"dedent-tabs": "^0.10.3",
|
"dedent-tabs": "^0.10.3",
|
||||||
"dompurify": "^3.1.7",
|
"dompurify": "^3.2.1",
|
||||||
"expr-eval": "^2.0.2",
|
"expr-eval": "^2.0.2",
|
||||||
"express": "^4.21.1",
|
"express": "^4.21.1",
|
||||||
"express-async-handler": "^1.2.0",
|
"express-async-handler": "^1.2.0",
|
||||||
"express-static-gzip": "2.1.8",
|
"express-static-gzip": "2.2.0",
|
||||||
"fs-extra": "11.2.0",
|
"fs-extra": "11.2.0",
|
||||||
"idb-keyval": "^6.2.1",
|
"idb-keyval": "^6.2.1",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
@@ -109,31 +112,33 @@
|
|||||||
"less": "^3.13.1",
|
"less": "^3.13.1",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"marked": "11.2.0",
|
"marked": "11.2.0",
|
||||||
"marked-emoji": "^1.4.2",
|
"marked-emoji": "^1.4.3",
|
||||||
"marked-extended-tables": "^1.0.10",
|
"marked-extended-tables": "^1.0.10",
|
||||||
"marked-gfm-heading-id": "^3.2.0",
|
"marked-gfm-heading-id": "^3.2.0",
|
||||||
"marked-smartypants-lite": "^1.0.2",
|
"marked-smartypants-lite": "^1.0.2",
|
||||||
"markedLegacy": "npm:marked@^0.3.19",
|
"markedLegacy": "npm:marked@^0.3.19",
|
||||||
"moment": "^2.30.1",
|
"moment": "^2.30.1",
|
||||||
"mongoose": "^8.7.3",
|
"mongoose": "^8.8.2",
|
||||||
"nanoid": "3.3.4",
|
"nanoid": "3.3.4",
|
||||||
"nconf": "^0.12.1",
|
"nconf": "^0.12.1",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-dom": "^18.3.1",
|
"react-dom": "^18.3.1",
|
||||||
"react-frame-component": "^4.1.3",
|
"react-frame-component": "^4.1.3",
|
||||||
"react-router-dom": "6.27.0",
|
"react-router-dom": "6.28.0",
|
||||||
"sanitize-filename": "1.6.3",
|
"sanitize-filename": "1.6.3",
|
||||||
"superagent": "^10.1.1",
|
"superagent": "^10.1.1",
|
||||||
"vitreum": "git+https://git@github.com/calculuschild/vitreum.git"
|
"vitreum": "git+https://git@github.com/calculuschild/vitreum.git"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@stylistic/stylelint-plugin": "^3.1.1",
|
"@stylistic/stylelint-plugin": "^3.1.1",
|
||||||
"eslint": "^9.13.0",
|
"babel-plugin-transform-import-meta": "^2.2.1",
|
||||||
"eslint-plugin-jest": "^28.8.3",
|
"eslint": "^9.14.0",
|
||||||
|
"eslint-plugin-jest": "^28.9.0",
|
||||||
"eslint-plugin-react": "^7.37.2",
|
"eslint-plugin-react": "^7.37.2",
|
||||||
"globals": "^15.11.0",
|
"globals": "^15.12.0",
|
||||||
"jest": "^29.7.0",
|
"jest": "^29.7.0",
|
||||||
"jest-expect-message": "^1.1.3",
|
"jest-expect-message": "^1.1.3",
|
||||||
|
"jsdom-global": "^3.0.2",
|
||||||
"postcss-less": "^6.0.0",
|
"postcss-less": "^6.0.0",
|
||||||
"stylelint": "^16.10.0",
|
"stylelint": "^16.10.0",
|
||||||
"stylelint-config-recess-order": "^5.1.1",
|
"stylelint-config-recess-order": "^5.1.1",
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
const fs = require('fs-extra');
|
|
||||||
const Proj = require('./project.json');
|
|
||||||
|
|
||||||
const { pack } = require('vitreum');
|
import fs from 'fs-extra';
|
||||||
|
import Proj from './project.json' with { type: 'json' };
|
||||||
|
import vitreum from 'vitreum';
|
||||||
|
const { pack } = vitreum;
|
||||||
|
|
||||||
|
import lessTransform from 'vitreum/transforms/less.js';
|
||||||
|
import assetTransform from 'vitreum/transforms/asset.js';
|
||||||
|
|
||||||
const isDev = !!process.argv.find((arg)=>arg=='--dev');
|
const isDev = !!process.argv.find((arg)=>arg=='--dev');
|
||||||
|
|
||||||
const lessTransform = require('vitreum/transforms/less.js');
|
|
||||||
const assetTransform = require('vitreum/transforms/asset.js');
|
|
||||||
//const Meta = require('vitreum/headtags');
|
|
||||||
|
|
||||||
const transforms = {
|
const transforms = {
|
||||||
'.less' : lessTransform,
|
'.less' : lessTransform,
|
||||||
'*' : assetTransform('./build')
|
'*' : assetTransform('./build')
|
||||||
@@ -17,7 +18,7 @@ const build = async ({ bundle, render, ssr })=>{
|
|||||||
const css = await lessTransform.generate({ paths: './shared' });
|
const css = await lessTransform.generate({ paths: './shared' });
|
||||||
await fs.outputFile('./build/admin/bundle.css', css);
|
await fs.outputFile('./build/admin/bundle.css', css);
|
||||||
await fs.outputFile('./build/admin/bundle.js', bundle);
|
await fs.outputFile('./build/admin/bundle.js', bundle);
|
||||||
await fs.outputFile('./build/admin/ssr.js', ssr);
|
await fs.outputFile('./build/admin/ssr.cjs', ssr);
|
||||||
};
|
};
|
||||||
|
|
||||||
fs.emptyDirSync('./build/admin');
|
fs.emptyDirSync('./build/admin');
|
||||||
|
|||||||
@@ -1,14 +1,15 @@
|
|||||||
const fs = require('fs-extra');
|
import fs from 'fs-extra';
|
||||||
const zlib = require('zlib');
|
import zlib from 'zlib';
|
||||||
const Proj = require('./project.json');
|
import Proj from './project.json' with { type: 'json' };
|
||||||
|
import vitreum from 'vitreum';
|
||||||
|
const { pack, watchFile, livereload } = vitreum;
|
||||||
|
|
||||||
const { pack, watchFile, livereload } = require('vitreum');
|
import lessTransform from 'vitreum/transforms/less.js';
|
||||||
const isDev = !!process.argv.find((arg)=>arg=='--dev');
|
import assetTransform from 'vitreum/transforms/asset.js';
|
||||||
|
import babel from '@babel/core';
|
||||||
|
import less from 'less';
|
||||||
|
|
||||||
const lessTransform = require('vitreum/transforms/less.js');
|
const isDev = !!process.argv.find((arg) => arg === '--dev');
|
||||||
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', { 'exclude': ['proposal-dynamic-import'] }], '@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;
|
||||||
|
|
||||||
@@ -24,7 +25,7 @@ const build = async ({ bundle, render, ssr })=>{
|
|||||||
//css = `@layer bundle {\n${css}\n}`;
|
//css = `@layer bundle {\n${css}\n}`;
|
||||||
await fs.outputFile('./build/homebrew/bundle.css', css);
|
await fs.outputFile('./build/homebrew/bundle.css', css);
|
||||||
await fs.outputFile('./build/homebrew/bundle.js', bundle);
|
await fs.outputFile('./build/homebrew/bundle.js', bundle);
|
||||||
await fs.outputFile('./build/homebrew/ssr.js', ssr);
|
await fs.outputFile('./build/homebrew/ssr.cjs', ssr);
|
||||||
|
|
||||||
await fs.copy('./client/homebrew/favicon.ico', './build/assets/favicon.ico');
|
await fs.copy('./client/homebrew/favicon.ico', './build/assets/favicon.ico');
|
||||||
|
|
||||||
@@ -51,7 +52,7 @@ fs.emptyDirSync('./build');
|
|||||||
const themes = { Legacy: {}, V3: {} };
|
const themes = { Legacy: {}, V3: {} };
|
||||||
|
|
||||||
let themeFiles = fs.readdirSync('./themes/Legacy');
|
let themeFiles = fs.readdirSync('./themes/Legacy');
|
||||||
for (dir of themeFiles) {
|
for (let dir of themeFiles) {
|
||||||
const themeData = JSON.parse(fs.readFileSync(`./themes/Legacy/${dir}/settings.json`).toString());
|
const themeData = JSON.parse(fs.readFileSync(`./themes/Legacy/${dir}/settings.json`).toString());
|
||||||
themeData.path = dir;
|
themeData.path = dir;
|
||||||
themes.Legacy[dir] = (themeData);
|
themes.Legacy[dir] = (themeData);
|
||||||
@@ -68,7 +69,7 @@ fs.emptyDirSync('./build');
|
|||||||
}
|
}
|
||||||
|
|
||||||
themeFiles = fs.readdirSync('./themes/V3');
|
themeFiles = fs.readdirSync('./themes/V3');
|
||||||
for (dir of themeFiles) {
|
for (let dir of themeFiles) {
|
||||||
const themeData = JSON.parse(fs.readFileSync(`./themes/V3/${dir}/settings.json`).toString());
|
const themeData = JSON.parse(fs.readFileSync(`./themes/V3/${dir}/settings.json`).toString());
|
||||||
themeData.path = dir;
|
themeData.path = dir;
|
||||||
themes.V3[dir] = (themeData);
|
themes.V3[dir] = (themeData);
|
||||||
@@ -104,14 +105,14 @@ fs.emptyDirSync('./build');
|
|||||||
const editorThemesBuildDir = './build/homebrew/cm-themes';
|
const editorThemesBuildDir = './build/homebrew/cm-themes';
|
||||||
await fs.copy('./node_modules/codemirror/theme', editorThemesBuildDir);
|
await fs.copy('./node_modules/codemirror/theme', editorThemesBuildDir);
|
||||||
await fs.copy('./themes/codeMirror/customThemes', editorThemesBuildDir);
|
await fs.copy('./themes/codeMirror/customThemes', editorThemesBuildDir);
|
||||||
editorThemeFiles = fs.readdirSync(editorThemesBuildDir);
|
const editorThemeFiles = fs.readdirSync(editorThemesBuildDir);
|
||||||
|
|
||||||
const editorThemeFile = './themes/codeMirror/editorThemes.json';
|
const editorThemeFile = './themes/codeMirror/editorThemes.json';
|
||||||
if(fs.existsSync(editorThemeFile)) fs.rmSync(editorThemeFile);
|
if(fs.existsSync(editorThemeFile)) fs.rmSync(editorThemeFile);
|
||||||
const stream = fs.createWriteStream(editorThemeFile, { flags: 'a' });
|
const stream = fs.createWriteStream(editorThemeFile, { flags: 'a' });
|
||||||
stream.write('[\n"default"');
|
stream.write('[\n"default"');
|
||||||
|
|
||||||
for (themeFile of editorThemeFiles) {
|
for (let themeFile of editorThemeFiles) {
|
||||||
stream.write(`,\n"${themeFile.slice(0, -4)}"`);
|
stream.write(`,\n"${themeFile.slice(0, -4)}"`);
|
||||||
}
|
}
|
||||||
stream.write('\n]\n');
|
stream.write('\n]\n');
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
const DB = require('./server/db.js');
|
import DB from './server/db.js';
|
||||||
const server = require('./server/app.js');
|
import server from './server/app.js';
|
||||||
const config = require('./server/config.js');
|
import config from './server/config.js';
|
||||||
|
|
||||||
DB.connect(config).then(()=>{
|
DB.connect(config).then(()=>{
|
||||||
// Ensure that we have successfully connected to the database
|
// Ensure that we have successfully connected to the database
|
||||||
// before launching server
|
// before launching server
|
||||||
const PORT = process.env.PORT || config.get('web_port') || 8000;
|
const PORT = process.env.PORT || config.get('web_port') || 8000;
|
||||||
server.app.listen(PORT, ()=>{
|
server.listen(PORT, ()=>{
|
||||||
const reset = '\x1b[0m'; // Reset to default style
|
const reset = '\x1b[0m'; // Reset to default style
|
||||||
const bright = '\x1b[1m'; // Bright (bold) style
|
const bright = '\x1b[1m'; // Bright (bold) style
|
||||||
const cyan = '\x1b[36m'; // Cyan color
|
const cyan = '\x1b[36m'; // Cyan color
|
||||||
|
|||||||
@@ -1,9 +1,15 @@
|
|||||||
const HomebrewModel = require('./homebrew.model.js').model;
|
import {model as HomebrewModel } from './homebrew.model.js';
|
||||||
const NotificationModel = require('./notifications.model.js').model;
|
import {model as NotificationModel } from './notifications.model.js';
|
||||||
const router = require('express').Router();
|
import express from 'express';
|
||||||
const Moment = require('moment');
|
import Moment from 'moment';
|
||||||
const templateFn = require('../client/template.js');
|
import zlib from 'zlib';
|
||||||
const zlib = require('zlib');
|
import templateFn from '../client/template.js';
|
||||||
|
|
||||||
|
import HomebrewAPI from './homebrew.api.js';
|
||||||
|
import asyncHandler from 'express-async-handler';
|
||||||
|
import { splitTextStyleAndMetadata } from '../shared/helpers.js';
|
||||||
|
|
||||||
|
const router = express.Router();
|
||||||
|
|
||||||
process.env.ADMIN_USER = process.env.ADMIN_USER || 'admin';
|
process.env.ADMIN_USER = process.env.ADMIN_USER || 'admin';
|
||||||
process.env.ADMIN_PASS = process.env.ADMIN_PASS || 'password3';
|
process.env.ADMIN_PASS = process.env.ADMIN_PASS || 'password3';
|
||||||
@@ -66,23 +72,8 @@ router.post('/admin/cleanup', mw.adminOnly, (req, res)=>{
|
|||||||
});
|
});
|
||||||
|
|
||||||
/* Searches for matching edit or share id, also attempts to partial match */
|
/* Searches for matching edit or share id, also attempts to partial match */
|
||||||
router.get('/admin/lookup/:id', mw.adminOnly, async (req, res, next)=>{
|
router.get('/admin/lookup/:id', mw.adminOnly, asyncHandler(HomebrewAPI.getBrew('admin', false)), async (req, res, next)=>{
|
||||||
HomebrewModel.findOne({
|
return res.json(req.brew);
|
||||||
$or : [
|
|
||||||
{ editId: { $regex: req.params.id, $options: 'i' } },
|
|
||||||
{ shareId: { $regex: req.params.id, $options: 'i' } },
|
|
||||||
]
|
|
||||||
}).exec()
|
|
||||||
.then((brew)=>{
|
|
||||||
if(!brew) // No document found
|
|
||||||
return res.status(404).json({ error: 'Document not found' });
|
|
||||||
else
|
|
||||||
return res.json(brew);
|
|
||||||
})
|
|
||||||
.catch((err)=>{
|
|
||||||
console.error(err);
|
|
||||||
return res.status(500).json({ error: 'Internal Server Error' });
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/* Find 50 brews that aren't compressed yet */
|
/* Find 50 brews that aren't compressed yet */
|
||||||
@@ -100,6 +91,25 @@ router.get('/admin/finduncompressed', mw.adminOnly, (req, res)=>{
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/* Cleans `<script` and `</script>` from the "text" field of a brew */
|
||||||
|
router.put('/admin/clean/script/:id', asyncHandler(HomebrewAPI.getBrew('admin', false)), async (req, res)=>{
|
||||||
|
console.log(`[ADMIN] Cleaning script tags from ShareID ${req.params.id}`);
|
||||||
|
|
||||||
|
function cleanText(text){return text.replaceAll(/(<\/?s)cript/gi, '');};
|
||||||
|
|
||||||
|
const brew = req.brew;
|
||||||
|
|
||||||
|
const properties = ['text', 'description', 'title'];
|
||||||
|
properties.forEach((property)=>{
|
||||||
|
brew[property] = cleanText(brew[property]);
|
||||||
|
});
|
||||||
|
|
||||||
|
splitTextStyleAndMetadata(brew);
|
||||||
|
|
||||||
|
req.body = brew;
|
||||||
|
|
||||||
|
return await HomebrewAPI.updateBrew(req, res);
|
||||||
|
});
|
||||||
|
|
||||||
/* Compresses the "text" field of a brew to binary */
|
/* Compresses the "text" field of a brew to binary */
|
||||||
router.put('/admin/compress/:id', (req, res)=>{
|
router.put('/admin/compress/:id', (req, res)=>{
|
||||||
@@ -144,7 +154,7 @@ router.get('/admin/notification/all', async (req, res, next)=>{
|
|||||||
try {
|
try {
|
||||||
const notifications = await NotificationModel.getAll();
|
const notifications = await NotificationModel.getAll();
|
||||||
return res.json(notifications);
|
return res.json(notifications);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('Error getting all notifications: ', error.message);
|
console.log('Error getting all notifications: ', error.message);
|
||||||
return res.status(500).json({ message: error.message });
|
return res.status(500).json({ message: error.message });
|
||||||
@@ -182,4 +192,4 @@ router.get('/admin', mw.adminOnly, (req, res)=>{
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = router;
|
export default router;
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
const supertest = require('supertest');
|
import supertest from 'supertest';
|
||||||
|
import HBApp from './app.js';
|
||||||
|
import {model as NotificationModel } from './notifications.model.js';
|
||||||
|
|
||||||
const app = supertest.agent(require('app.js').app)
|
|
||||||
.set('X-Forwarded-Proto', 'https');
|
|
||||||
|
|
||||||
const NotificationModel = require('./notifications.model.js').model;
|
// Mimic https responses to avoid being redirected all the time
|
||||||
|
const app = supertest.agent(HBApp).set('X-Forwarded-Proto', 'https');
|
||||||
|
|
||||||
describe('Tests for admin api', ()=>{
|
describe('Tests for admin api', ()=>{
|
||||||
afterEach(()=>{
|
afterEach(()=>{
|
||||||
|
|||||||
@@ -1,25 +1,41 @@
|
|||||||
/*eslint max-lines: ["warn", {"max": 500, "skipBlankLines": true, "skipComments": true}]*/
|
/*eslint max-lines: ["warn", {"max": 500, "skipBlankLines": true, "skipComments": true}]*/
|
||||||
// Set working directory to project root
|
// Set working directory to project root
|
||||||
|
import { dirname } from 'path';
|
||||||
|
import { fileURLToPath } from 'url';
|
||||||
|
import packageJSON from './../package.json' with { type: "json" };
|
||||||
|
|
||||||
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
||||||
process.chdir(`${__dirname}/..`);
|
process.chdir(`${__dirname}/..`);
|
||||||
|
const version = packageJSON.version;
|
||||||
|
|
||||||
|
import _ from 'lodash';
|
||||||
|
import jwt from 'jwt-simple';
|
||||||
|
import express from 'express';
|
||||||
|
import yaml from 'js-yaml';
|
||||||
|
import config from './config.js';
|
||||||
|
import fs from 'fs-extra';
|
||||||
|
|
||||||
const _ = require('lodash');
|
|
||||||
const jwt = require('jwt-simple');
|
|
||||||
const express = require('express');
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
const app = express();
|
const app = express();
|
||||||
const config = require('./config.js');
|
|
||||||
const fs = require('fs-extra');
|
|
||||||
|
|
||||||
const { homebrewApi, getBrew, getUsersBrewThemes, getCSS } = require('./homebrew.api.js');
|
import api from './homebrew.api.js';
|
||||||
const GoogleActions = require('./googleActions.js');
|
const { homebrewApi, getBrew, getUsersBrewThemes, getCSS } = api;
|
||||||
const serveCompressedStaticAssets = require('./static-assets.mv.js');
|
import adminApi from './admin.api.js';
|
||||||
const sanitizeFilename = require('sanitize-filename');
|
import vaultApi from './vault.api.js';
|
||||||
const asyncHandler = require('express-async-handler');
|
import GoogleActions from './googleActions.js';
|
||||||
const templateFn = require('./../client/template.js');
|
import serveCompressedStaticAssets from './static-assets.mv.js';
|
||||||
|
import sanitizeFilename from 'sanitize-filename';
|
||||||
|
import asyncHandler from 'express-async-handler';
|
||||||
|
import templateFn from '../client/template.js';
|
||||||
|
import {model as HomebrewModel } from './homebrew.model.js';
|
||||||
|
|
||||||
const { DEFAULT_BREW } = require('./brewDefaults.js');
|
import { DEFAULT_BREW } from './brewDefaults.js';
|
||||||
|
import { splitTextStyleAndMetadata } from '../shared/helpers.js';
|
||||||
|
|
||||||
const { splitTextStyleAndMetadata } = require('../shared/helpers.js');
|
//==== Middleware Imports ====//
|
||||||
|
import contentNegotiation from './middleware/content-negotiation.js';
|
||||||
|
import bodyParser from 'body-parser';
|
||||||
|
import cookieParser from 'cookie-parser';
|
||||||
|
import forceSSL from './forcessl.mw.js';
|
||||||
|
|
||||||
|
|
||||||
const sanitizeBrew = (brew, accessType)=>{
|
const sanitizeBrew = (brew, accessType)=>{
|
||||||
@@ -34,10 +50,10 @@ const sanitizeBrew = (brew, accessType)=>{
|
|||||||
app.set('trust proxy', 1 /* number of proxies between user and server */)
|
app.set('trust proxy', 1 /* number of proxies between user and server */)
|
||||||
|
|
||||||
app.use('/', serveCompressedStaticAssets(`build`));
|
app.use('/', serveCompressedStaticAssets(`build`));
|
||||||
app.use(require('./middleware/content-negotiation.js'));
|
app.use(contentNegotiation);
|
||||||
app.use(require('body-parser').json({ limit: '25mb' }));
|
app.use(bodyParser.json({ limit: '25mb' }));
|
||||||
app.use(require('cookie-parser')());
|
app.use(cookieParser());
|
||||||
app.use(require('./forcessl.mw.js'));
|
app.use(forceSSL);
|
||||||
|
|
||||||
//Account Middleware
|
//Account Middleware
|
||||||
app.use((req, res, next)=>{
|
app.use((req, res, next)=>{
|
||||||
@@ -57,15 +73,14 @@ app.use((req, res, next)=>{
|
|||||||
});
|
});
|
||||||
|
|
||||||
app.use(homebrewApi);
|
app.use(homebrewApi);
|
||||||
app.use(require('./admin.api.js'));
|
app.use(adminApi);
|
||||||
app.use(require('./vault.api.js'));
|
app.use(vaultApi);
|
||||||
|
|
||||||
const HomebrewModel = require('./homebrew.model.js').model;
|
const welcomeText = fs.readFileSync('client/homebrew/pages/homePage/welcome_msg.md', 'utf8');
|
||||||
const welcomeText = require('fs').readFileSync('client/homebrew/pages/homePage/welcome_msg.md', 'utf8');
|
const welcomeTextLegacy = fs.readFileSync('client/homebrew/pages/homePage/welcome_msg_legacy.md', 'utf8');
|
||||||
const welcomeTextLegacy = require('fs').readFileSync('client/homebrew/pages/homePage/welcome_msg_legacy.md', 'utf8');
|
const migrateText = fs.readFileSync('client/homebrew/pages/homePage/migrate.md', 'utf8');
|
||||||
const migrateText = require('fs').readFileSync('client/homebrew/pages/homePage/migrate.md', 'utf8');
|
const changelogText = fs.readFileSync('changelog.md', 'utf8');
|
||||||
const changelogText = require('fs').readFileSync('changelog.md', 'utf8');
|
const faqText = fs.readFileSync('faq.md', 'utf8');
|
||||||
const faqText = require('fs').readFileSync('faq.md', 'utf8');
|
|
||||||
|
|
||||||
String.prototype.replaceAll = function(s, r){return this.split(s).join(r);};
|
String.prototype.replaceAll = function(s, r){return this.split(s).join(r);};
|
||||||
|
|
||||||
@@ -479,7 +494,7 @@ const renderPage = async (req, res)=>{
|
|||||||
deployment : config.get('heroku_app_name') ?? ''
|
deployment : config.get('heroku_app_name') ?? ''
|
||||||
};
|
};
|
||||||
const props = {
|
const props = {
|
||||||
version : require('./../package.json').version,
|
version : version,
|
||||||
url : req.customUrl || req.originalUrl,
|
url : req.customUrl || req.originalUrl,
|
||||||
brew : req.brew,
|
brew : req.brew,
|
||||||
brews : req.brews,
|
brews : req.brews,
|
||||||
@@ -556,6 +571,4 @@ app.use((req, res)=>{
|
|||||||
});
|
});
|
||||||
//^=====--------------------------------------=====^//
|
//^=====--------------------------------------=====^//
|
||||||
|
|
||||||
module.exports = {
|
export default app;
|
||||||
app : app
|
|
||||||
};
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
const _ = require('lodash');
|
import _ from 'lodash';
|
||||||
|
|
||||||
// Default properties for newly-created brews
|
// Default properties for newly-created brews
|
||||||
const DEFAULT_BREW = {
|
const DEFAULT_BREW = {
|
||||||
@@ -32,7 +32,7 @@ const DEFAULT_BREW_LOAD = _.defaults(
|
|||||||
},
|
},
|
||||||
DEFAULT_BREW);
|
DEFAULT_BREW);
|
||||||
|
|
||||||
module.exports = {
|
export {
|
||||||
DEFAULT_BREW,
|
DEFAULT_BREW,
|
||||||
DEFAULT_BREW_LOAD
|
DEFAULT_BREW_LOAD
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
module.exports = require('nconf')
|
import nconf from 'nconf';
|
||||||
.argv()
|
|
||||||
.env({ lowerCase: true })
|
export default nconf
|
||||||
.file('environment', { file: `config/${process.env.NODE_ENV}.json` })
|
.argv()
|
||||||
.file('defaults', { file: 'config/default.json' });
|
.env({ lowerCase: true })
|
||||||
|
.file('environment', { file: `config/${process.env.NODE_ENV}.json` })
|
||||||
|
.file('defaults', { file: 'config/default.json' });
|
||||||
@@ -5,7 +5,7 @@
|
|||||||
// reused by both the main application and all tests which require database
|
// reused by both the main application and all tests which require database
|
||||||
// connection.
|
// connection.
|
||||||
|
|
||||||
const Mongoose = require('mongoose');
|
import Mongoose from 'mongoose';
|
||||||
|
|
||||||
const getMongoDBURL = (config)=>{
|
const getMongoDBURL = (config)=>{
|
||||||
return config.get('mongodb_uri') ||
|
return config.get('mongodb_uri') ||
|
||||||
@@ -31,7 +31,7 @@ const connect = async (config)=>{
|
|||||||
.catch((error)=>handleConnectionError(error));
|
.catch((error)=>handleConnectionError(error));
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = {
|
export default {
|
||||||
connect : connect,
|
connect,
|
||||||
disconnect : disconnect
|
disconnect
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
module.exports = (req, res, next)=>{
|
export default (req, res, next)=>{
|
||||||
if(process.env.NODE_ENV === 'local' || process.env.NODE_ENV === 'docker') return next();
|
if(process.env.NODE_ENV === 'local' || process.env.NODE_ENV === 'docker') return next();
|
||||||
if(req.header('x-forwarded-proto') !== 'https') {
|
if(req.header('x-forwarded-proto') !== 'https') {
|
||||||
return res.redirect(302, `https://${req.get('Host')}${req.url}`);
|
return res.redirect(302, `https://${req.get('Host')}${req.url}`);
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
/* eslint-disable max-lines */
|
/* eslint-disable max-lines */
|
||||||
const googleDrive = require('@googleapis/drive');
|
import googleDrive from '@googleapis/drive';
|
||||||
const { nanoid } = require('nanoid');
|
import { nanoid } from 'nanoid';
|
||||||
const token = require('./token.js');
|
import token from './token.js';
|
||||||
const config = require('./config.js');
|
import config from './config.js';
|
||||||
|
|
||||||
|
|
||||||
let serviceAuth;
|
let serviceAuth;
|
||||||
if(!config.get('service_account')){
|
if(!config.get('service_account')){
|
||||||
@@ -72,7 +73,7 @@ const GoogleActions = {
|
|||||||
getGoogleFolder : async (auth)=>{
|
getGoogleFolder : async (auth)=>{
|
||||||
const drive = googleDrive.drive({ version: 'v3', auth });
|
const drive = googleDrive.drive({ version: 'v3', auth });
|
||||||
|
|
||||||
fileMetadata = {
|
const fileMetadata = {
|
||||||
'name' : 'Homebrewery',
|
'name' : 'Homebrewery',
|
||||||
'mimeType' : 'application/vnd.google-apps.folder'
|
'mimeType' : 'application/vnd.google-apps.folder'
|
||||||
};
|
};
|
||||||
@@ -344,4 +345,4 @@ const GoogleActions = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = GoogleActions;
|
export default GoogleActions;
|
||||||
|
|||||||
@@ -1,18 +1,20 @@
|
|||||||
/* eslint-disable max-lines */
|
/* eslint-disable max-lines */
|
||||||
const _ = require('lodash');
|
import _ from 'lodash';
|
||||||
const HomebrewModel = require('./homebrew.model.js').model;
|
import {model as HomebrewModel} from './homebrew.model.js';
|
||||||
const router = require('express').Router();
|
import express from 'express';
|
||||||
const zlib = require('zlib');
|
import zlib from 'zlib';
|
||||||
const GoogleActions = require('./googleActions.js');
|
import GoogleActions from './googleActions.js';
|
||||||
const Markdown = require('../shared/naturalcrit/markdown.js');
|
import Markdown from '../shared/naturalcrit/markdown.js';
|
||||||
const yaml = require('js-yaml');
|
import yaml from 'js-yaml';
|
||||||
const asyncHandler = require('express-async-handler');
|
import asyncHandler from 'express-async-handler';
|
||||||
const { nanoid } = require('nanoid');
|
import { nanoid } from 'nanoid';
|
||||||
const { splitTextStyleAndMetadata } = require('../shared/helpers.js');
|
import { splitTextStyleAndMetadata } from '../shared/helpers.js';
|
||||||
|
import checkClientVersion from './middleware/check-client-version.js';
|
||||||
|
|
||||||
const { DEFAULT_BREW, DEFAULT_BREW_LOAD } = require('./brewDefaults.js');
|
const router = express.Router();
|
||||||
|
|
||||||
const Themes = require('../themes/themes.json');
|
import { DEFAULT_BREW, DEFAULT_BREW_LOAD } from './brewDefaults.js';
|
||||||
|
import Themes from '../themes/themes.json' with { type: 'json' };
|
||||||
|
|
||||||
const isStaticTheme = (renderer, themeName)=>{
|
const isStaticTheme = (renderer, themeName)=>{
|
||||||
return Themes[renderer]?.[themeName] !== undefined;
|
return Themes[renderer]?.[themeName] !== undefined;
|
||||||
@@ -87,8 +89,18 @@ const api = {
|
|||||||
// Get relevant IDs for the brew
|
// Get relevant IDs for the brew
|
||||||
const { id, googleId } = api.getId(req);
|
const { id, googleId } = api.getId(req);
|
||||||
|
|
||||||
|
const accessMap = {
|
||||||
|
edit : { editId: id },
|
||||||
|
share : { shareId: id },
|
||||||
|
admin : {
|
||||||
|
$or : [
|
||||||
|
{ editId: id },
|
||||||
|
{ shareId: id },
|
||||||
|
] }
|
||||||
|
};
|
||||||
|
|
||||||
// Try to find the document in the Homebrewery database -- if it doesn't exist, that's fine.
|
// 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 })
|
let stub = await HomebrewModel.get(accessMap[accessType])
|
||||||
.catch((err)=>{
|
.catch((err)=>{
|
||||||
if(googleId) {
|
if(googleId) {
|
||||||
console.warn(`Unable to find document stub for ${accessType}Id ${id}`);
|
console.warn(`Unable to find document stub for ${accessType}Id ${id}`);
|
||||||
@@ -295,9 +307,8 @@ const api = {
|
|||||||
|
|
||||||
req.params.id = currentTheme.theme;
|
req.params.id = currentTheme.theme;
|
||||||
req.params.renderer = currentTheme.renderer;
|
req.params.renderer = currentTheme.renderer;
|
||||||
}
|
} else {
|
||||||
//=== Static Themes ===//
|
//=== Static Themes ===//
|
||||||
else {
|
|
||||||
const localSnippets = `${req.params.renderer}_${req.params.id}`; // Just log the name for loading on client
|
const localSnippets = `${req.params.renderer}_${req.params.id}`; // Just log the name for loading on client
|
||||||
const localStyle = `@import url(\"/themes/${req.params.renderer}/${req.params.id}/style.css\");`;
|
const localStyle = `@import url(\"/themes/${req.params.renderer}/${req.params.id}/style.css\");`;
|
||||||
completeSnippets.push(localSnippets);
|
completeSnippets.push(localSnippets);
|
||||||
@@ -464,7 +475,7 @@ const api = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
router.use('/api', require('./middleware/check-client-version.js'));
|
router.use('/api', checkClientVersion);
|
||||||
router.post('/api', asyncHandler(api.newBrew));
|
router.post('/api', asyncHandler(api.newBrew));
|
||||||
router.put('/api/:id', asyncHandler(api.getBrew('edit', true)), asyncHandler(api.updateBrew));
|
router.put('/api/:id', asyncHandler(api.getBrew('edit', true)), asyncHandler(api.updateBrew));
|
||||||
router.put('/api/update/:id', asyncHandler(api.getBrew('edit', true)), asyncHandler(api.updateBrew));
|
router.put('/api/update/:id', asyncHandler(api.getBrew('edit', true)), asyncHandler(api.updateBrew));
|
||||||
@@ -472,4 +483,4 @@ router.delete('/api/:id', asyncHandler(api.deleteBrew));
|
|||||||
router.get('/api/remove/:id', asyncHandler(api.deleteBrew));
|
router.get('/api/remove/:id', asyncHandler(api.deleteBrew));
|
||||||
router.get('/api/theme/:renderer/:id', asyncHandler(api.getThemeBundle));
|
router.get('/api/theme/:renderer/:id', asyncHandler(api.getThemeBundle));
|
||||||
|
|
||||||
module.exports = api;
|
export default api;
|
||||||
@@ -36,8 +36,9 @@ describe('Tests for api', ()=>{
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
google = require('./googleActions.js');
|
google = require('./googleActions.js').default;
|
||||||
model = require('./homebrew.model.js').model;
|
model = require('./homebrew.model.js').model;
|
||||||
|
api = require('./homebrew.api').default;
|
||||||
|
|
||||||
jest.mock('./googleActions.js');
|
jest.mock('./googleActions.js');
|
||||||
google.authCheck = jest.fn(()=>'client');
|
google.authCheck = jest.fn(()=>'client');
|
||||||
@@ -54,8 +55,6 @@ describe('Tests for api', ()=>{
|
|||||||
setHeader : jest.fn(()=>{})
|
setHeader : jest.fn(()=>{})
|
||||||
};
|
};
|
||||||
|
|
||||||
api = require('./homebrew.api');
|
|
||||||
|
|
||||||
hbBrew = {
|
hbBrew = {
|
||||||
text : `brew text`,
|
text : `brew text`,
|
||||||
style : 'hello yes i am css',
|
style : 'hello yes i am css',
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
const mongoose = require('mongoose');
|
import mongoose from 'mongoose';
|
||||||
const { nanoid } = require('nanoid');
|
import { nanoid } from 'nanoid';
|
||||||
const _ = require('lodash');
|
import _ from 'lodash';
|
||||||
const zlib = require('zlib');
|
import zlib from 'zlib';
|
||||||
|
|
||||||
|
|
||||||
const HomebrewSchema = mongoose.Schema({
|
const HomebrewSchema = mongoose.Schema({
|
||||||
shareId : { type: String, default: ()=>{return nanoid(12);}, index: { unique: true } },
|
shareId : { type: String, default: ()=>{return nanoid(12);}, index: { unique: true } },
|
||||||
@@ -44,7 +45,7 @@ HomebrewSchema.statics.get = async function(query, fields=null){
|
|||||||
const brew = await Homebrew.findOne(query, fields).orFail()
|
const brew = await Homebrew.findOne(query, fields).orFail()
|
||||||
.catch((error)=>{throw 'Can not find brew';});
|
.catch((error)=>{throw 'Can not find brew';});
|
||||||
if(!_.isNil(brew.textBin)) { // Uncompress zipped text field
|
if(!_.isNil(brew.textBin)) { // Uncompress zipped text field
|
||||||
unzipped = zlib.inflateRawSync(brew.textBin);
|
const unzipped = zlib.inflateRawSync(brew.textBin);
|
||||||
brew.text = unzipped.toString();
|
brew.text = unzipped.toString();
|
||||||
}
|
}
|
||||||
return brew;
|
return brew;
|
||||||
@@ -62,7 +63,7 @@ HomebrewSchema.statics.getByUser = async function(username, allowAccess=false, f
|
|||||||
|
|
||||||
const Homebrew = mongoose.model('Homebrew', HomebrewSchema);
|
const Homebrew = mongoose.model('Homebrew', HomebrewSchema);
|
||||||
|
|
||||||
module.exports = {
|
export {
|
||||||
schema : HomebrewSchema,
|
HomebrewSchema as schema,
|
||||||
model : Homebrew,
|
Homebrew as model
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
module.exports = (req, res, next)=>{
|
import packageJSON from '../../package.json' with { type: "json" };
|
||||||
|
const version = packageJSON.version;
|
||||||
|
|
||||||
|
export default (req, res, next)=>{
|
||||||
const userVersion = req.get('Homebrewery-Version');
|
const userVersion = req.get('Homebrewery-Version');
|
||||||
const version = require('../../package.json').version;
|
|
||||||
|
|
||||||
if(userVersion != version) {
|
if(userVersion != version) {
|
||||||
return res.status(412).send({
|
return res.status(412).send({
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
const config = require('../config.js');
|
import config from '../config.js';
|
||||||
const nodeEnv = config.get('node_env');
|
const nodeEnv = config.get('node_env');
|
||||||
const isLocalEnvironment = config.get('local_environments').includes(nodeEnv);
|
const isLocalEnvironment = config.get('local_environments').includes(nodeEnv);
|
||||||
|
|
||||||
module.exports = (req, res, next)=>{
|
export default (req, res, next)=>{
|
||||||
const isImageRequest = req.get('Accept')?.split(',')
|
const isImageRequest = req.get('Accept')?.split(',')
|
||||||
?.filter((h)=>!h.includes('q='))
|
?.filter((h)=>!h.includes('q='))
|
||||||
?.every((h)=>/image\/.*/.test(h));
|
?.every((h)=>/image\/.*/.test(h));
|
||||||
|
|||||||
@@ -1,41 +0,0 @@
|
|||||||
const contentNegotiationMiddleware = require('./content-negotiation.js');
|
|
||||||
|
|
||||||
describe('content-negotiation-middleware', ()=>{
|
|
||||||
let request;
|
|
||||||
let response;
|
|
||||||
let next;
|
|
||||||
|
|
||||||
beforeEach(()=>{
|
|
||||||
request = {
|
|
||||||
get : function(key) {
|
|
||||||
return this[key];
|
|
||||||
}
|
|
||||||
};
|
|
||||||
response = {
|
|
||||||
status : jest.fn(()=>response),
|
|
||||||
send : jest.fn(()=>{})
|
|
||||||
};
|
|
||||||
next = jest.fn();
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should return 406 on image request', ()=>{
|
|
||||||
contentNegotiationMiddleware({
|
|
||||||
Accept : 'image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8',
|
|
||||||
...request
|
|
||||||
}, response);
|
|
||||||
|
|
||||||
expect(response.status).toHaveBeenLastCalledWith(406);
|
|
||||||
expect(response.send).toHaveBeenCalledWith({
|
|
||||||
message : 'Request for image at this URL is not supported'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should call next on non-image request', ()=>{
|
|
||||||
contentNegotiationMiddleware({
|
|
||||||
Accept : 'text,image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8',
|
|
||||||
...request
|
|
||||||
}, response, next);
|
|
||||||
|
|
||||||
expect(next).toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
const mongoose = require('mongoose');
|
import mongoose from 'mongoose';
|
||||||
const _ = require('lodash');
|
import _ from 'lodash';
|
||||||
|
|
||||||
const NotificationSchema = new mongoose.Schema({
|
const NotificationSchema = new mongoose.Schema({
|
||||||
dismissKey : { type: String, unique: true, required: true },
|
dismissKey : { type: String, unique: true, required: true },
|
||||||
@@ -56,7 +56,7 @@ NotificationSchema.statics.getAll = async function() {
|
|||||||
|
|
||||||
const Notification = mongoose.model('Notification', NotificationSchema);
|
const Notification = mongoose.model('Notification', NotificationSchema);
|
||||||
|
|
||||||
module.exports = {
|
export {
|
||||||
schema : NotificationSchema,
|
NotificationSchema as schema,
|
||||||
model : Notification,
|
Notification as model
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
const expressStaticGzip = require('express-static-gzip');
|
import expressStaticGzip from 'express-static-gzip';
|
||||||
|
|
||||||
// Serve brotli-compressed static files if available
|
// Serve brotli-compressed static files if available
|
||||||
const customCacheControlHandler=(response, path)=>{
|
const customCacheControlHandler=(response, path)=>{
|
||||||
@@ -28,4 +28,4 @@ const init=(pathToAssets)=>{
|
|||||||
} });
|
} });
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = init;
|
export default init;
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
const jwt = require('jwt-simple');
|
import jwt from 'jwt-simple';
|
||||||
|
import config from './config.js';
|
||||||
// Load configuration values
|
|
||||||
const config = require('./config.js');
|
|
||||||
|
|
||||||
// Generate an Access Token for the given User ID
|
// Generate an Access Token for the given User ID
|
||||||
const generateAccessToken = (account)=>{
|
const generateAccessToken = (account)=>{
|
||||||
@@ -24,6 +22,4 @@ const generateAccessToken = (account)=>{
|
|||||||
return token;
|
return token;
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = {
|
export default generateAccessToken;
|
||||||
generateAccessToken : generateAccessToken
|
|
||||||
};
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
const express = require('express');
|
import express from 'express';
|
||||||
const asyncHandler = require('express-async-handler');
|
import asyncHandler from 'express-async-handler';
|
||||||
const HomebrewModel = require('./homebrew.model.js').model;
|
import {model as HomebrewModel } from './homebrew.model.js';
|
||||||
|
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
|
|
||||||
@@ -106,4 +106,4 @@ const findTotal = async (req, res)=>{
|
|||||||
router.get('/api/vault/total', asyncHandler(findTotal));
|
router.get('/api/vault/total', asyncHandler(findTotal));
|
||||||
router.get('/api/vault', asyncHandler(findBrews));
|
router.get('/api/vault', asyncHandler(findBrews));
|
||||||
|
|
||||||
module.exports = router;
|
export default router;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
const _ = require('lodash');
|
import _ from 'lodash';
|
||||||
const yaml = require('js-yaml');
|
import yaml from 'js-yaml';
|
||||||
const request = require('../client/homebrew/utils/request-middleware.js');
|
import request from '../client/homebrew/utils/request-middleware.js';
|
||||||
|
|
||||||
const splitTextStyleAndMetadata = (brew)=>{
|
const splitTextStyleAndMetadata = (brew)=>{
|
||||||
brew.text = brew.text.replaceAll('\r\n', '\n');
|
brew.text = brew.text.replaceAll('\r\n', '\n');
|
||||||
@@ -51,7 +51,7 @@ const fetchThemeBundle = async (obj, renderer, theme)=>{
|
|||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = {
|
export {
|
||||||
splitTextStyleAndMetadata,
|
splitTextStyleAndMetadata,
|
||||||
printCurrentBrew,
|
printCurrentBrew,
|
||||||
fetchThemeBundle,
|
fetchThemeBundle,
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
/* eslint-disable max-lines */
|
/* eslint-disable max-lines */
|
||||||
const _ = require('lodash');
|
import _ from 'lodash';
|
||||||
const Marked = require('marked');
|
import { Parser as MathParser } from 'expr-eval';
|
||||||
const MarkedExtendedTables = require('marked-extended-tables');
|
import { marked as Marked } from 'marked';
|
||||||
const { markedSmartypantsLite: MarkedSmartypantsLite } = require('marked-smartypants-lite');
|
import MarkedExtendedTables from 'marked-extended-tables';
|
||||||
const { gfmHeadingId: MarkedGFMHeadingId, resetHeadings: MarkedGFMResetHeadingIDs } = require('marked-gfm-heading-id');
|
import { markedSmartypantsLite as MarkedSmartypantsLite } from 'marked-smartypants-lite';
|
||||||
const { markedEmoji: MarkedEmojis } = require('marked-emoji');
|
import { gfmHeadingId as MarkedGFMHeadingId, resetHeadings as MarkedGFMResetHeadingIDs } from 'marked-gfm-heading-id';
|
||||||
|
import { markedEmoji as MarkedEmojis } from 'marked-emoji';
|
||||||
|
|
||||||
//Icon fonts included so they can appear in emoji autosuggest dropdown
|
//Icon fonts included so they can appear in emoji autosuggest dropdown
|
||||||
const diceFont = require('../../themes/fonts/iconFonts/diceFont.js');
|
import diceFont from '../../themes/fonts/iconFonts/diceFont.js';
|
||||||
const elderberryInn = require('../../themes/fonts/iconFonts/elderberryInn.js');
|
import elderberryInn from '../../themes/fonts/iconFonts/elderberryInn.js';
|
||||||
const fontAwesome = require('../../themes/fonts/iconFonts/fontAwesome.js');
|
import gameIcons from '../../themes/fonts/iconFonts/gameIcons.js';
|
||||||
const gameIcons = require('../../themes/fonts/iconFonts/gameIcons.js');
|
import fontAwesome from '../../themes/fonts/iconFonts/fontAwesome.js';
|
||||||
|
|
||||||
const MathParser = require('expr-eval').Parser;
|
const renderer = new Marked.Renderer();
|
||||||
const renderer = new Marked.Renderer();
|
|
||||||
const tokenizer = new Marked.Tokenizer();
|
const tokenizer = new Marked.Tokenizer();
|
||||||
|
|
||||||
//Limit math features to simple items
|
//Limit math features to simple items
|
||||||
@@ -854,7 +854,7 @@ const globalVarsList = {};
|
|||||||
let varsQueue = [];
|
let varsQueue = [];
|
||||||
let globalPageNumber = 0;
|
let globalPageNumber = 0;
|
||||||
|
|
||||||
module.exports = {
|
const Markdown = {
|
||||||
marked : Marked,
|
marked : Marked,
|
||||||
render : (rawBrewText, pageNumber=0)=>{
|
render : (rawBrewText, pageNumber=0)=>{
|
||||||
globalVarsList[pageNumber] = {}; //Reset global links for current page, to ensure values are parsed in order
|
globalVarsList[pageNumber] = {}; //Reset global links for current page, to ensure values are parsed in order
|
||||||
@@ -865,6 +865,7 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
rawBrewText = rawBrewText.replace(/^\\column$/gm, `\n<div class='columnSplit'></div>\n`);
|
rawBrewText = rawBrewText.replace(/^\\column$/gm, `\n<div class='columnSplit'></div>\n`);
|
||||||
|
|
||||||
const opts = Marked.defaults;
|
const opts = Marked.defaults;
|
||||||
|
|
||||||
rawBrewText = opts.hooks.preprocess(rawBrewText);
|
rawBrewText = opts.hooks.preprocess(rawBrewText);
|
||||||
@@ -935,3 +936,6 @@ module.exports = {
|
|||||||
return errors;
|
return errors;
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export default Markdown;
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,7 @@ html,body, #reactRoot{
|
|||||||
*{
|
*{
|
||||||
box-sizing : border-box;
|
box-sizing : border-box;
|
||||||
}
|
}
|
||||||
button{
|
.colorButton(@backgroundColor : @green){
|
||||||
.button();
|
|
||||||
}
|
|
||||||
.button(@backgroundColor : @green){
|
|
||||||
.animate(background-color);
|
.animate(background-color);
|
||||||
display : inline-block;
|
display : inline-block;
|
||||||
padding : 0.6em 1.2em;
|
padding : 0.6em 1.2em;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
: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){
|
: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,button,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
|
border:0;font-size:100%;font:inherit;vertical-align:baseline;margin:0;padding:0
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -25,3 +25,9 @@
|
|||||||
:where(table){
|
:where(table){
|
||||||
border-collapse:collapse;border-spacing:0
|
border-collapse:collapse;border-spacing:0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:where(button) {
|
||||||
|
background-color: unset;
|
||||||
|
text-transform: unset;
|
||||||
|
color: unset;
|
||||||
|
}
|
||||||
|
|||||||
50
tests/html/safeHTML.test.js
Normal file
50
tests/html/safeHTML.test.js
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
|
||||||
|
|
||||||
|
require('jsdom-global')();
|
||||||
|
|
||||||
|
import { safeHTML } from '../../client/homebrew/brewRenderer/safeHTML';
|
||||||
|
|
||||||
|
test('Javascript via href', function() {
|
||||||
|
const source = `<a href="javascript:alert('This is a JavaScript injection via href attribute')">Click me</a>`;
|
||||||
|
const rendered = safeHTML(source);
|
||||||
|
expect(rendered).toBe('<a>Click me</a>');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Javascript via src', function() {
|
||||||
|
const source = `<img src="javascript:alert('This is a JavaScript injection via src attribute')">`;
|
||||||
|
const rendered = safeHTML(source);
|
||||||
|
expect(rendered).toBe('<img>');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Javascript via form submit action', function() {
|
||||||
|
const source = `<form action="javascript:alert('This is a JavaScript injection via action attribute')">\n<input type="submit" value="Submit">\n</form>`;
|
||||||
|
const rendered = safeHTML(source);
|
||||||
|
expect(rendered).toBe('<form>\n<input value=\"Submit\">\n</form>');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Javascript via inline event handler - onClick', function() {
|
||||||
|
const source = `<div style="background-color: red; color: white; width: 100px; height: 100px;" onclick="alert('This is a JavaScript injection via inline event handler')">\nClick me\n</div>`;
|
||||||
|
const rendered = safeHTML(source);
|
||||||
|
expect(rendered).toBe('<div style=\"background-color: red; color: white; width: 100px; height: 100px;\">\nClick me\n</div>');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Javascript via inline event handler - onMouseOver', function() {
|
||||||
|
const source = `<div onmouseover="alert('This is a JavaScript injection via inline event handler')">Hover over me</div>`;
|
||||||
|
const rendered = safeHTML(source);
|
||||||
|
expect(rendered).toBe('<div>Hover over me</div>');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Javascript via data attribute', function() {
|
||||||
|
const source = `<div data-code="javascript:alert('This is a JavaScript injection via data attribute')">Test</div>`;
|
||||||
|
const rendered = safeHTML(source);
|
||||||
|
expect(rendered).toBe('<div>Test</div>');
|
||||||
|
});
|
||||||
|
|
||||||
|
test('Javascript via event delegation', function() {
|
||||||
|
const source = `<div id="parent"><button id="child">Click me</button></div><script>document.getElementById('parent').addEventListener('click', function(event) {if (event.target.id === 'child') {console.log('This is JavaScript executed via event delegation');}});</script>`;
|
||||||
|
const rendered = safeHTML(source);
|
||||||
|
expect(rendered).toBe('<div id="parent"><button id="child">Click me</button></div>');
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable max-lines */
|
/* eslint-disable max-lines */
|
||||||
|
|
||||||
const Markdown = require('naturalcrit/markdown.js');
|
import Markdown from 'naturalcrit/markdown.js';
|
||||||
|
|
||||||
test('Processes the markdown within an HTML block if its just a class wrapper', function() {
|
test('Processes the markdown within an HTML block if its just a class wrapper', function() {
|
||||||
const source = '<div>*Bold text*</div>';
|
const source = '<div>*Bold text*</div>';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable max-lines */
|
/* eslint-disable max-lines */
|
||||||
|
|
||||||
const Markdown = require('naturalcrit/markdown.js');
|
import Markdown from 'naturalcrit/markdown.js';
|
||||||
|
|
||||||
describe('Inline Definition Lists', ()=>{
|
describe('Inline Definition Lists', ()=>{
|
||||||
test('No Term 1 Definition', function() {
|
test('No Term 1 Definition', function() {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
const Markdown = require('naturalcrit/markdown.js');
|
import Markdown from 'naturalcrit/markdown.js';
|
||||||
const dedent = require('dedent-tabs').default;
|
const dedent = require('dedent-tabs').default;
|
||||||
|
|
||||||
// Marked.js adds line returns after closing tags on some default tokens.
|
// Marked.js adds line returns after closing tags on some default tokens.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable max-lines */
|
/* eslint-disable max-lines */
|
||||||
|
|
||||||
const Markdown = require('naturalcrit/markdown.js');
|
import Markdown from 'naturalcrit/markdown.js';
|
||||||
|
|
||||||
describe('Hard Breaks', ()=>{
|
describe('Hard Breaks', ()=>{
|
||||||
test('Single Break', function() {
|
test('Single Break', function() {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/* eslint-disable max-lines */
|
/* eslint-disable max-lines */
|
||||||
|
|
||||||
const dedent = require('dedent-tabs').default;
|
const dedent = require('dedent-tabs').default;
|
||||||
const Markdown = require('naturalcrit/markdown.js');
|
import Markdown from 'naturalcrit/markdown.js';
|
||||||
|
|
||||||
// Marked.js adds line returns after closing tags on some default tokens.
|
// Marked.js adds line returns after closing tags on some default tokens.
|
||||||
// This removes those line returns for comparison sake.
|
// This removes those line returns for comparison sake.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/* eslint-disable max-lines */
|
/* eslint-disable max-lines */
|
||||||
|
|
||||||
const dedent = require('dedent-tabs').default;
|
const dedent = require('dedent-tabs').default;
|
||||||
const Markdown = require('naturalcrit/markdown.js');
|
import Markdown from 'naturalcrit/markdown.js';
|
||||||
|
|
||||||
// Marked.js adds line returns after closing tags on some default tokens.
|
// Marked.js adds line returns after closing tags on some default tokens.
|
||||||
// This removes those line returns for comparison sake.
|
// This removes those line returns for comparison sake.
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
const supertest = require('supertest');
|
import supertest from 'supertest';
|
||||||
|
import HBApp from 'app.js';
|
||||||
|
|
||||||
// Mimic https responses to avoid being redirected all the time
|
// Mimic https responses to avoid being redirected all the time
|
||||||
const app = supertest.agent(require('app.js').app)
|
const app = supertest.agent(HBApp).set('X-Forwarded-Proto', 'https');
|
||||||
.set('X-Forwarded-Proto', 'https');
|
|
||||||
|
|
||||||
describe('Tests for static pages', ()=>{
|
describe('Tests for static pages', ()=>{
|
||||||
it('Home page works', ()=>{
|
it('Home page works', ()=>{
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
const Markdown = require('../../../../shared/naturalcrit/markdown.js');
|
import Markdown from '../../../../shared/naturalcrit/markdown.js';
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
createFooterFunc : function(headerSize=1){
|
createFooterFunc : function(headerSize=1){
|
||||||
|
|||||||
@@ -93,4 +93,4 @@ const diceFont = {
|
|||||||
'df_solid_small_dot_d6_6' : 'df solid-small-dot-d6-6'
|
'df_solid_small_dot_d6_6' : 'df solid-small-dot-d6-6'
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = diceFont;
|
export default diceFont;
|
||||||
@@ -206,4 +206,4 @@ const elderberryInn = {
|
|||||||
'ei_wish' : 'ei wish'
|
'ei_wish' : 'ei wish'
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = elderberryInn;
|
export default elderberryInn;
|
||||||
@@ -2051,4 +2051,4 @@ const fontAwesome = {
|
|||||||
'fab_zhihu' : 'fab fa-zhihu'
|
'fab_zhihu' : 'fab fa-zhihu'
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = fontAwesome;
|
export default fontAwesome;
|
||||||
@@ -506,4 +506,4 @@ const gameIcons = {
|
|||||||
'gi_acid' : 'gi acid'
|
'gi_acid' : 'gi acid'
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = gameIcons;
|
export default gameIcons;
|
||||||
Reference in New Issue
Block a user