mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-27 09:33:08 +00:00
change legacy snippets to use named exports and move from dedent-tabs to dedent
This commit is contained in:
@@ -12,7 +12,7 @@ import ToolBar from './toolBar/toolBar.jsx';
|
|||||||
import RenderWarnings from 'client/components/renderWarnings/renderWarnings.jsx';
|
import RenderWarnings from 'client/components/renderWarnings/renderWarnings.jsx';
|
||||||
import NotificationPopup from './notificationPopup/notificationPopup.jsx';
|
import NotificationPopup from './notificationPopup/notificationPopup.jsx';
|
||||||
import Frame from 'react-frame-component';
|
import Frame from 'react-frame-component';
|
||||||
import dedent from 'dedent-tabs';
|
import dedent from 'dedent';
|
||||||
import { printCurrentBrew } from './shared/helpers.js';
|
import { printCurrentBrew } from './shared/helpers.js';
|
||||||
|
|
||||||
import HeaderNav from './headerNav/headerNav.jsx';
|
import HeaderNav from './headerNav/headerNav.jsx';
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import './editor.less';
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import createReactClass from 'create-react-class';
|
import createReactClass from 'create-react-class';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import dedent from 'dedent-tabs';
|
import dedent from 'dedent';
|
||||||
import Markdown from './shared/markdown.js';
|
import Markdown from './shared/markdown.js';
|
||||||
|
|
||||||
import CodeEditor from '../../components/codeEditor/codeEditor.jsx';
|
import CodeEditor from '../../components/codeEditor/codeEditor.jsx';
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const ThemeSnippets = {
|
|||||||
V3_Blank : V3_Blank,
|
V3_Blank : V3_Blank,
|
||||||
};
|
};
|
||||||
|
|
||||||
import EditorThemes from 'build/homebrew/codeMirror/editorThemes.json';
|
import EditorThemes from './build/homebrew/codeMirror/editorThemes.json';
|
||||||
|
|
||||||
const execute = function(val, props){
|
const execute = function(val, props){
|
||||||
if(_.isFunction(val)) return val(props);
|
if(_.isFunction(val)) return val(props);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import dedent from 'dedent-tabs';
|
import dedent from 'dedent';
|
||||||
|
|
||||||
import Nav from 'client/homebrew/navbar/nav.jsx';
|
import Nav from 'client/homebrew/navbar/nav.jsx';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import dedent from 'dedent-tabs';
|
import dedent from 'dedent';
|
||||||
import Nav from 'client/homebrew/navbar/nav.jsx';
|
import Nav from 'client/homebrew/navbar/nav.jsx';
|
||||||
|
|
||||||
const getShareId = (brew)=>(
|
const getShareId = (brew)=>(
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import request from '../../../../utils/request-middleware.js';
|
|||||||
|
|
||||||
import googleDriveIcon from '../../../../googleDrive.svg';
|
import googleDriveIcon from '../../../../googleDrive.svg';
|
||||||
import homebreweryIcon from '../../../../thumbnail.svg';
|
import homebreweryIcon from '../../../../thumbnail.svg';
|
||||||
import dedent from 'dedent-tabs';
|
import dedent from 'dedent';
|
||||||
|
|
||||||
const BrewItem = ({
|
const BrewItem = ({
|
||||||
brew = {
|
brew = {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import dedent from 'dedent-tabs';
|
import dedent from 'dedent';
|
||||||
|
|
||||||
const loginUrl = 'https://www.naturalcrit.com/login';
|
const loginUrl = 'https://www.naturalcrit.com/login';
|
||||||
|
|
||||||
|
|||||||
4248
package-lock.json
generated
4248
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -14,8 +14,8 @@
|
|||||||
"scripts": {
|
"scripts": {
|
||||||
"viteDev": "node scripts/dev.js",
|
"viteDev": "node scripts/dev.js",
|
||||||
"viteDevAdmin": "vite --config vite.config.js --ssr client/admin/admin.jsx",
|
"viteDevAdmin": "vite --config vite.config.js --ssr client/admin/admin.jsx",
|
||||||
"viteBuild":"vite build",
|
"viteBuild": "vite build",
|
||||||
"viteStart":"vite preview",
|
"viteStart": "vite preview",
|
||||||
"dev": "node --experimental-require-module scripts/dev.js",
|
"dev": "node --experimental-require-module scripts/dev.js",
|
||||||
"quick": "node --experimental-require-module scripts/quick.js",
|
"quick": "node --experimental-require-module scripts/quick.js",
|
||||||
"build": "node --experimental-require-module scripts/buildHomebrew.js && node --experimental-require-module scripts/buildAdmin.js",
|
"build": "node --experimental-require-module scripts/buildHomebrew.js && node --experimental-require-module scripts/buildAdmin.js",
|
||||||
@@ -107,7 +107,7 @@
|
|||||||
"core-js": "^3.47.0",
|
"core-js": "^3.47.0",
|
||||||
"cors": "^2.8.5",
|
"cors": "^2.8.5",
|
||||||
"create-react-class": "^15.7.0",
|
"create-react-class": "^15.7.0",
|
||||||
"dedent-tabs": "^0.10.3",
|
"dedent": "^1.7.1",
|
||||||
"expr-eval": "^2.0.2",
|
"expr-eval": "^2.0.2",
|
||||||
"express": "^5.1.0",
|
"express": "^5.1.0",
|
||||||
"express-async-handler": "^1.2.0",
|
"express-async-handler": "^1.2.0",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import Markdown from 'markdown.js';
|
import Markdown from 'markdown.js';
|
||||||
import dedent from 'dedent-tabs';
|
import dedent from 'dedent';
|
||||||
|
|
||||||
// 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,6 +1,6 @@
|
|||||||
/* eslint-disable max-lines */
|
/* eslint-disable max-lines */
|
||||||
|
|
||||||
import dedent from 'dedent-tabs';
|
import dedent from 'dedent';
|
||||||
import Markdown from 'markdown.js';
|
import Markdown from '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.
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/* eslint-disable max-lines */
|
/* eslint-disable max-lines */
|
||||||
|
|
||||||
import dedent from 'dedent-tabs';
|
import dedent from 'dedent';
|
||||||
import Markdown from 'markdown.js';
|
import Markdown from '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.
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
/* eslint-disable max-lines */
|
/* eslint-disable max-lines */
|
||||||
|
|
||||||
import MagicGen from './snippets/magic.gen.js';
|
import MagicGen from './themes/Legacy/5ePHB/snippets/magic.gen.js';
|
||||||
import ClassTableGen from './snippets/classtable.gen.js';
|
import ClassTableGen from './themes/Legacy/5ePHB/snippets/classtable.gen.js';
|
||||||
import MonsterBlockGen from './snippets/monsterblock.gen.js';
|
import MonsterBlockGen from './themes/Legacy/5ePHB/snippets/monsterblock.gen.js';
|
||||||
import ClassFeatureGen from './snippets/classfeature.gen.js';
|
import ClassFeatureGen from './themes/Legacy/5ePHB/snippets/classfeature.gen.js';
|
||||||
import CoverPageGen from './snippets/coverpage.gen.js';
|
import CoverPageGen from './themes/Legacy/5ePHB/snippets/coverpage.gen.js';
|
||||||
import TableOfContentsGen from './snippets/tableOfContents.gen.js';
|
import TableOfContentsGen from './themes/Legacy/5ePHB/snippets/tableOfContents.gen.js';
|
||||||
import dedent from 'dedent-tabs';
|
import dedent from 'dedent';
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
|
|
||||||
export default function(classname){
|
function classFeatureGen(classname) {
|
||||||
|
|
||||||
classname = _.sample(['archivist', 'fancyman', 'linguist', 'fletcher',
|
classname = _.sample(['archivist', 'fancyman', 'linguist', 'fletcher',
|
||||||
'notary', 'berserker-typist', 'fishmongerer', 'manicurist', 'haberdasher', 'concierge']);
|
'notary', 'berserker-typist', 'fishmongerer', 'manicurist', 'haberdasher', 'concierge']);
|
||||||
@@ -49,4 +49,6 @@ export default function(classname){
|
|||||||
`- ${_.sample(['10 lint fluffs', '1 button', 'a cherished lost sock'])}`,
|
`- ${_.sample(['10 lint fluffs', '1 button', 'a cherished lost sock'])}`,
|
||||||
'\n\n\n'
|
'\n\n\n'
|
||||||
].join('\n');
|
].join('\n');
|
||||||
};
|
}
|
||||||
|
|
||||||
|
export default classFeatureGen;
|
||||||
|
|||||||
@@ -98,8 +98,8 @@ const subtitles = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
export default ()=>{
|
function coverPageGen() {
|
||||||
return `<style>
|
return `<style>
|
||||||
.phb#p1{ text-align:center; }
|
.phb#p1{ text-align:center; }
|
||||||
.phb#p1:after{ display:none; }
|
.phb#p1:after{ display:none; }
|
||||||
</style>
|
</style>
|
||||||
@@ -114,4 +114,6 @@ export default ()=>{
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
\\page`;
|
\\page`;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
export default coverPageGen;
|
||||||
@@ -4,7 +4,7 @@ import ClassFeatureGen from './classfeature.gen.js';
|
|||||||
|
|
||||||
import ClassTableGen from './classtable.gen.js';
|
import ClassTableGen from './classtable.gen.js';
|
||||||
|
|
||||||
export default function(){
|
function fullClassGen(){
|
||||||
|
|
||||||
const classname = _.sample(['Archivist', 'Fancyman', 'Linguist', 'Fletcher',
|
const classname = _.sample(['Archivist', 'Fancyman', 'Linguist', 'Fletcher',
|
||||||
'Notary', 'Berserker-Typist', 'Fishmongerer', 'Manicurist', 'Haberdasher', 'Concierge']);
|
'Notary', 'Berserker-Typist', 'Fishmongerer', 'Manicurist', 'Haberdasher', 'Concierge']);
|
||||||
@@ -40,4 +40,6 @@ export default function(){
|
|||||||
|
|
||||||
|
|
||||||
].join('\n')}\n\n\n`;
|
].join('\n')}\n\n\n`;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
export default fullClassGen;
|
||||||
@@ -47,7 +47,8 @@ const getTOC = (pages)=>{
|
|||||||
return res;
|
return res;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function(props){
|
function tableOfContentsGen(props){
|
||||||
|
|
||||||
const pages = props.brew.text.split('\\page');
|
const pages = props.brew.text.split('\\page');
|
||||||
const TOC = getTOC(pages);
|
const TOC = getTOC(pages);
|
||||||
const markdown = _.reduce(TOC, (r, g1, idx1)=>{
|
const markdown = _.reduce(TOC, (r, g1, idx1)=>{
|
||||||
@@ -69,4 +70,6 @@ export default function(props){
|
|||||||
##### Table Of Contents
|
##### Table Of Contents
|
||||||
${markdown}
|
${markdown}
|
||||||
</div>\n`;
|
</div>\n`;
|
||||||
};
|
}
|
||||||
|
|
||||||
|
export default tableOfContentsGen;
|
||||||
@@ -6,7 +6,7 @@ import scriptGen from './snippets/script.gen.js';
|
|||||||
import ClassFeatureGen from './snippets/classfeature.gen.js';
|
import ClassFeatureGen from './snippets/classfeature.gen.js';
|
||||||
import CoverPageGen from './snippets/coverpage.gen.js';
|
import CoverPageGen from './snippets/coverpage.gen.js';
|
||||||
import QuoteGen from './snippets/quote.gen.js';
|
import QuoteGen from './snippets/quote.gen.js';
|
||||||
import dedent from 'dedent-tabs';
|
import dedent from 'dedent';
|
||||||
|
|
||||||
export default [
|
export default [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import dedent from 'dedent-tabs';
|
import dedent from 'dedent';
|
||||||
|
|
||||||
export default function(classname){
|
export default function(classname){
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import dedent from 'dedent-tabs';
|
import dedent from 'dedent';
|
||||||
|
|
||||||
const features = [
|
const features = [
|
||||||
'Astrological Botany', 'Biochemical Sorcery', 'Civil Divination',
|
'Astrological Botany', 'Biochemical Sorcery', 'Civil Divination',
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import dedent from 'dedent-tabs';
|
import dedent from 'dedent';
|
||||||
|
|
||||||
const titles = [
|
const titles = [
|
||||||
'The Burning Gallows', 'The Ring of Nenlast',
|
'The Burning Gallows', 'The Ring of Nenlast',
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import dedent from 'dedent-tabs';
|
import dedent from 'dedent';
|
||||||
|
|
||||||
const genList = function(list, max){
|
const genList = function(list, max){
|
||||||
return _.sampleSize(list, _.random(0, max)).join(', ') || 'None';
|
return _.sampleSize(list, _.random(0, max)).join(', ') || 'None';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import dedent from 'dedent-tabs';
|
import dedent from 'dedent';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
dwarvish : ()=>{
|
dwarvish : ()=>{
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
/* eslint-disable max-lines */
|
/* eslint-disable max-lines */
|
||||||
import dedent from 'dedent-tabs';
|
import dedent from 'dedent';
|
||||||
import WatercolorGen from './snippets/watercolor.gen.js';
|
import WatercolorGen from './snippets/watercolor.gen.js';
|
||||||
import ImageMaskGen from './snippets/imageMask.gen.js';
|
import ImageMaskGen from './snippets/imageMask.gen.js';
|
||||||
import FooterGen from './snippets/footer.gen.js';
|
import FooterGen from './snippets/footer.gen.js';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import dedent from 'dedent-tabs';
|
import dedent from 'dedent';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
center : ()=>{
|
center : ()=>{
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import dedent from 'dedent-tabs';
|
import dedent from 'dedent';
|
||||||
|
|
||||||
export default ()=>{
|
export default ()=>{
|
||||||
return dedent`
|
return dedent`
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import dedent from 'dedent-tabs';
|
import dedent from 'dedent';
|
||||||
|
|
||||||
// Map each actual page to its footer label, accounting for skips or numbering resets
|
// Map each actual page to its footer label, accounting for skips or numbering resets
|
||||||
const mapPages = (pages)=>{
|
const mapPages = (pages)=>{
|
||||||
|
|||||||
Reference in New Issue
Block a user