diff --git a/shared/naturalcrit/codeEditor/autocompleteEmoji.js b/client/components/codeEditor/autocompleteEmoji.js similarity index 89% rename from shared/naturalcrit/codeEditor/autocompleteEmoji.js rename to client/components/codeEditor/autocompleteEmoji.js index c7efa172b..ae7f2628f 100644 --- a/shared/naturalcrit/codeEditor/autocompleteEmoji.js +++ b/client/components/codeEditor/autocompleteEmoji.js @@ -1,7 +1,7 @@ -import diceFont from '../../../themes/fonts/iconFonts/diceFont.js'; -import elderberryInn from '../../../themes/fonts/iconFonts/elderberryInn.js'; -import fontAwesome from '../../../themes/fonts/iconFonts/fontAwesome.js'; -import gameIcons from '../../../themes/fonts/iconFonts/gameIcons.js'; +import diceFont from 'themes/fonts/iconFonts/diceFont.js'; +import elderberryInn from 'themes/fonts/iconFonts/elderberryInn.js'; +import fontAwesome from 'themes/fonts/iconFonts/fontAwesome.js'; +import gameIcons from 'themes/fonts/iconFonts/gameIcons.js'; const emojis = { ...diceFont, diff --git a/shared/naturalcrit/codeEditor/close-tag.js b/client/components/codeEditor/close-tag.js similarity index 100% rename from shared/naturalcrit/codeEditor/close-tag.js rename to client/components/codeEditor/close-tag.js diff --git a/shared/naturalcrit/codeEditor/codeEditor.jsx b/client/components/codeEditor/codeEditor.jsx similarity index 100% rename from shared/naturalcrit/codeEditor/codeEditor.jsx rename to client/components/codeEditor/codeEditor.jsx diff --git a/shared/naturalcrit/codeEditor/codeEditor.less b/client/components/codeEditor/codeEditor.less similarity index 100% rename from shared/naturalcrit/codeEditor/codeEditor.less rename to client/components/codeEditor/codeEditor.less diff --git a/shared/naturalcrit/codeEditor/fold-css.js b/client/components/codeEditor/fold-css.js similarity index 100% rename from shared/naturalcrit/codeEditor/fold-css.js rename to client/components/codeEditor/fold-css.js diff --git a/shared/naturalcrit/codeEditor/fold-pages.js b/client/components/codeEditor/fold-pages.js similarity index 100% rename from shared/naturalcrit/codeEditor/fold-pages.js rename to client/components/codeEditor/fold-pages.js diff --git a/shared/homebrewery/renderWarnings/renderWarnings.jsx b/client/components/renderWarnings/renderWarnings.jsx similarity index 93% rename from shared/homebrewery/renderWarnings/renderWarnings.jsx rename to client/components/renderWarnings/renderWarnings.jsx index e9c5f6f57..6b8ea8184 100644 --- a/shared/homebrewery/renderWarnings/renderWarnings.jsx +++ b/client/components/renderWarnings/renderWarnings.jsx @@ -3,7 +3,7 @@ const React = require('react'); const createClass = require('create-react-class'); const _ = require('lodash'); -import Dialog from '../../../client/components/dialog.jsx'; +import Dialog from '../dialog.jsx'; const RenderWarnings = createClass({ displayName : 'RenderWarnings', @@ -25,7 +25,7 @@ const RenderWarnings = createClass({ if(!isChrome){ return
  • Built for Chrome
    - Other browsers have not been tested for compatiblilty. If you + Other browsers have not been tested for compatibility. If you experience issues with your document not rendering or printing properly, please try using the latest version of Chrome before submitting a bug report. diff --git a/shared/homebrewery/renderWarnings/renderWarnings.less b/client/components/renderWarnings/renderWarnings.less similarity index 100% rename from shared/homebrewery/renderWarnings/renderWarnings.less rename to client/components/renderWarnings/renderWarnings.less diff --git a/shared/naturalcrit/svg/homebrew.svg.jsx b/client/components/svg/cauldron.svg.jsx similarity index 100% rename from shared/naturalcrit/svg/homebrew.svg.jsx rename to client/components/svg/cauldron.svg.jsx diff --git a/shared/naturalcrit/svg/naturalcrit.svg.jsx b/client/components/svg/naturalcrit-d20.svg.jsx similarity index 100% rename from shared/naturalcrit/svg/naturalcrit.svg.jsx rename to client/components/svg/naturalcrit-d20.svg.jsx diff --git a/client/homebrew/brewRenderer/brewRenderer.jsx b/client/homebrew/brewRenderer/brewRenderer.jsx index a19d33375..7e6681c57 100644 --- a/client/homebrew/brewRenderer/brewRenderer.jsx +++ b/client/homebrew/brewRenderer/brewRenderer.jsx @@ -4,13 +4,13 @@ const React = require('react'); const { useState, useRef, useMemo, useEffect } = React; const _ = require('lodash'); -const MarkdownLegacy = require('naturalcrit/markdownLegacy.js'); -import Markdown from 'naturalcrit/markdown.js'; +const MarkdownLegacy = require('markdownLegacy.js'); +import Markdown from 'markdown.js'; const ErrorBar = require('./errorBar/errorBar.jsx'); const ToolBar = require('./toolBar/toolBar.jsx'); //TODO: move to the brew renderer -const RenderWarnings = require('homebrewery/renderWarnings/renderWarnings.jsx'); +const RenderWarnings = require('client/components/renderWarnings/renderWarnings.jsx'); const NotificationPopup = require('./notificationPopup/notificationPopup.jsx'); const Frame = require('react-frame-component').default; const dedent = require('dedent-tabs').default; diff --git a/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx b/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx index 38a85e0c7..ad8f9140a 100644 --- a/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx +++ b/client/homebrew/brewRenderer/notificationPopup/notificationPopup.jsx @@ -1,7 +1,7 @@ require('./notificationPopup.less'); import React, { useEffect, useState } from 'react'; import request from '../../utils/request-middleware.js'; -import Markdown from 'naturalcrit/markdown.js'; +import Markdown from 'markdown.js'; import Dialog from '../../../components/dialog.jsx'; diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index d6fdf3f08..a00c47403 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -4,9 +4,9 @@ const React = require('react'); const createClass = require('create-react-class'); const _ = require('lodash'); const dedent = require('dedent-tabs').default; -import Markdown from '../../../shared/naturalcrit/markdown.js'; +import Markdown from '../../../shared/markdown.js'; -const CodeEditor = require('naturalcrit/codeEditor/codeEditor.jsx'); +const CodeEditor = require('client/components/codeEditor/codeEditor.jsx'); const SnippetBar = require('./snippetbar/snippetbar.jsx'); const MetadataEditor = require('./metadataEditor/metadataEditor.jsx'); diff --git a/client/homebrew/navbar/account.navitem.jsx b/client/homebrew/navbar/account.navitem.jsx index 6b412c368..5f7424e25 100644 --- a/client/homebrew/navbar/account.navitem.jsx +++ b/client/homebrew/navbar/account.navitem.jsx @@ -1,6 +1,6 @@ const React = require('react'); const createClass = require('create-react-class'); -const Nav = require('naturalcrit/nav/nav.jsx'); +const Nav = require('client/homebrew/navbar/nav.jsx'); const request = require('superagent'); const Account = createClass({ diff --git a/client/homebrew/navbar/error-navitem.jsx b/client/homebrew/navbar/error-navitem.jsx index a2650dbc8..6b739379b 100644 --- a/client/homebrew/navbar/error-navitem.jsx +++ b/client/homebrew/navbar/error-navitem.jsx @@ -1,6 +1,6 @@ require('./error-navitem.less'); const React = require('react'); -const Nav = require('naturalcrit/nav/nav.jsx'); +const Nav = require('client/homebrew/navbar/nav.jsx'); const ErrorNavItem = ({ error = '', clearError })=>{ const response = error.response; diff --git a/client/homebrew/navbar/help.navitem.jsx b/client/homebrew/navbar/help.navitem.jsx index bf0098c8d..0b1ff6c3a 100644 --- a/client/homebrew/navbar/help.navitem.jsx +++ b/client/homebrew/navbar/help.navitem.jsx @@ -1,7 +1,7 @@ const React = require('react'); const dedent = require('dedent-tabs').default; -const Nav = require('naturalcrit/nav/nav.jsx'); +const Nav = require('client/homebrew/navbar/nav.jsx'); module.exports = function(props){ return diff --git a/client/homebrew/navbar/metadata.navitem.jsx b/client/homebrew/navbar/metadata.navitem.jsx index 2a29aec40..435ad4491 100644 --- a/client/homebrew/navbar/metadata.navitem.jsx +++ b/client/homebrew/navbar/metadata.navitem.jsx @@ -2,7 +2,7 @@ const React = require('react'); const createClass = require('create-react-class'); const Moment = require('moment'); -const Nav = require('naturalcrit/nav/nav.jsx'); +const Nav = require('client/homebrew/navbar/nav.jsx'); const MetadataNav = createClass({ diff --git a/shared/naturalcrit/nav/nav.jsx b/client/homebrew/navbar/nav.jsx similarity index 97% rename from shared/naturalcrit/nav/nav.jsx rename to client/homebrew/navbar/nav.jsx index 50dff4c33..16f194716 100644 --- a/shared/naturalcrit/nav/nav.jsx +++ b/client/homebrew/navbar/nav.jsx @@ -5,7 +5,7 @@ const createClass = require('create-react-class'); const _ = require('lodash'); const cx = require('classnames'); -const NaturalCritIcon = require('naturalcrit/svg/naturalcrit.svg.jsx'); +const NaturalCritIcon = require('client/components/svg/naturalcrit-d20.svg.jsx'); const Nav = { base : createClass({ diff --git a/client/homebrew/navbar/navbar.jsx b/client/homebrew/navbar/navbar.jsx index 7929bb5e2..bafed9db0 100644 --- a/client/homebrew/navbar/navbar.jsx +++ b/client/homebrew/navbar/navbar.jsx @@ -2,7 +2,7 @@ require('./navbar.less'); const React = require('react'); const createClass = require('create-react-class'); -const Nav = require('naturalcrit/nav/nav.jsx'); +const Nav = require('client/homebrew/navbar/nav.jsx'); const PatreonNavItem = require('./patreon.navitem.jsx'); const Navbar = createClass({ diff --git a/client/homebrew/navbar/newbrew.navitem.jsx b/client/homebrew/navbar/newbrew.navitem.jsx index d19b7595f..fe8c05dc7 100644 --- a/client/homebrew/navbar/newbrew.navitem.jsx +++ b/client/homebrew/navbar/newbrew.navitem.jsx @@ -1,6 +1,6 @@ const React = require('react'); const _ = require('lodash'); -const Nav = require('naturalcrit/nav/nav.jsx'); +const Nav = require('client/homebrew/navbar/nav.jsx'); const { splitTextStyleAndMetadata } = require('../../../shared/helpers.js'); // Importing the function from helpers.js const BREWKEY = 'homebrewery-new'; diff --git a/client/homebrew/navbar/patreon.navitem.jsx b/client/homebrew/navbar/patreon.navitem.jsx index 92b42dceb..d957231de 100644 --- a/client/homebrew/navbar/patreon.navitem.jsx +++ b/client/homebrew/navbar/patreon.navitem.jsx @@ -1,5 +1,5 @@ const React = require('react'); -const Nav = require('naturalcrit/nav/nav.jsx'); +const Nav = require('client/homebrew/navbar/nav.jsx'); module.exports = function(props){ return ( brew.googleId && !brew.stubbed diff --git a/client/homebrew/navbar/vault.navitem.jsx b/client/homebrew/navbar/vault.navitem.jsx index 087297011..1087ca978 100644 --- a/client/homebrew/navbar/vault.navitem.jsx +++ b/client/homebrew/navbar/vault.navitem.jsx @@ -1,6 +1,6 @@ const React = require('react'); -const Nav = require('naturalcrit/nav/nav.jsx'); +const Nav = require('client/homebrew/navbar/nav.jsx'); module.exports = function (props) { return ( diff --git a/client/homebrew/pages/accountPage/accountPage.jsx b/client/homebrew/pages/accountPage/accountPage.jsx index b69eb6e3e..412cf7812 100644 --- a/client/homebrew/pages/accountPage/accountPage.jsx +++ b/client/homebrew/pages/accountPage/accountPage.jsx @@ -1,7 +1,7 @@ const React = require('react'); const moment = require('moment'); const UIPage = require('../basePages/uiPage/uiPage.jsx'); -const NaturalCritIcon = require('naturalcrit/svg/naturalcrit.svg.jsx'); +const NaturalCritIcon = require('client/components/svg/naturalcrit-d20.svg.jsx'); let SAVEKEY = ''; diff --git a/client/homebrew/pages/basePages/uiPage/uiPage.jsx b/client/homebrew/pages/basePages/uiPage/uiPage.jsx index 20dc6b26b..1880779c9 100644 --- a/client/homebrew/pages/basePages/uiPage/uiPage.jsx +++ b/client/homebrew/pages/basePages/uiPage/uiPage.jsx @@ -2,12 +2,12 @@ require('./uiPage.less'); const React = require('react'); const createClass = require('create-react-class'); -const Nav = require('naturalcrit/nav/nav.jsx'); -const Navbar = require('../../../navbar/navbar.jsx'); -const NewBrewItem = require('../../../navbar/newbrew.navitem.jsx'); -const HelpNavItem = require('../../../navbar/help.navitem.jsx'); -const RecentNavItem = require('../../../navbar/recent.navitem.jsx').both; -const Account = require('../../../navbar/account.navitem.jsx'); +const Nav = require('client/homebrew/navbar/nav.jsx'); +const Navbar = require('client/homebrew/navbar/navbar.jsx'); +const NewBrewItem = require('client/homebrew/navbar/newbrew.navitem.jsx'); +const HelpNavItem = require('client/homebrew/navbar/help.navitem.jsx'); +const RecentNavItem = require('client/homebrew/navbar/recent.navitem.jsx').both; +const Account = require('client/homebrew/navbar/account.navitem.jsx'); const UIPage = createClass({ diff --git a/client/homebrew/pages/editPage/editPage.jsx b/client/homebrew/pages/editPage/editPage.jsx index 99567ea24..595436c5b 100644 --- a/client/homebrew/pages/editPage/editPage.jsx +++ b/client/homebrew/pages/editPage/editPage.jsx @@ -4,7 +4,7 @@ import './editPage.less'; // Common imports import React, { useState, useEffect, useRef } from 'react'; import request from '../../utils/request-middleware.js'; -import Markdown from 'naturalcrit/markdown.js'; +import Markdown from 'markdown.js'; import _ from 'lodash'; import { DEFAULT_BREW_LOAD } from '../../../../server/brewDefaults.js'; @@ -14,15 +14,15 @@ import SplitPane from 'client/components/splitPane/splitPane.jsx'; import Editor from '../../editor/editor.jsx'; import BrewRenderer from '../../brewRenderer/brewRenderer.jsx'; -import Nav from 'naturalcrit/nav/nav.jsx'; -import Navbar from '../../navbar/navbar.jsx'; -import NewBrewItem from '../../navbar/newbrew.navitem.jsx'; -import AccountNavItem from '../../navbar/account.navitem.jsx'; -import ErrorNavItem from '../../navbar/error-navitem.jsx'; -import HelpNavItem from '../../navbar/help.navitem.jsx'; -import VaultNavItem from '../../navbar/vault.navitem.jsx'; -import PrintNavItem from '../../navbar/print.navitem.jsx'; -import { both as RecentNavItem } from '../../navbar/recent.navitem.jsx'; +import Nav from 'client/homebrew/navbar/nav.jsx'; +import Navbar from 'client/homebrew/navbar/navbar.jsx'; +import NewBrewItem from 'client/homebrew/navbar/newbrew.navitem.jsx'; +import AccountNavItem from 'client/homebrew/navbar/account.navitem.jsx'; +import ErrorNavItem from 'client/homebrew/navbar/error-navitem.jsx'; +import HelpNavItem from 'client/homebrew/navbar/help.navitem.jsx'; +import VaultNavItem from 'client/homebrew/navbar/vault.navitem.jsx'; +import PrintNavItem from 'client/homebrew/navbar/print.navitem.jsx'; +import { both as RecentNavItem } from 'client/homebrew/navbar/recent.navitem.jsx'; // Page specific imports import { Meta } from 'vitreum/headtags'; @@ -30,7 +30,7 @@ import { md5 } from 'hash-wasm'; import { gzipSync, strToU8 } from 'fflate'; import { makePatches, stringifyPatches } from '@sanity/diff-match-patch'; -import ShareNavItem from '../../navbar/share.navitem.jsx'; +import ShareNavItem from 'client/homebrew/navbar/share.navitem.jsx'; import LockNotification from './lockNotification/lockNotification.jsx'; import { updateHistory, versionHistoryGarbageCollection } from '../../utils/versionHistory.js'; import googleDriveIcon from '../../googleDrive.svg'; diff --git a/client/homebrew/pages/errorPage/errorPage.jsx b/client/homebrew/pages/errorPage/errorPage.jsx index 4ac73da8c..1b7b19e2f 100644 --- a/client/homebrew/pages/errorPage/errorPage.jsx +++ b/client/homebrew/pages/errorPage/errorPage.jsx @@ -1,7 +1,7 @@ require('./errorPage.less'); const React = require('react'); const UIPage = require('../basePages/uiPage/uiPage.jsx'); -import Markdown from '../../../../shared/naturalcrit/markdown.js'; +import Markdown from '../../../../shared/markdown.js'; const ErrorIndex = require('./errors/errorIndex.js'); const ErrorPage = ({ brew })=>{ diff --git a/client/homebrew/pages/homePage/homePage.jsx b/client/homebrew/pages/homePage/homePage.jsx index 82c5b7084..32401163c 100644 --- a/client/homebrew/pages/homePage/homePage.jsx +++ b/client/homebrew/pages/homePage/homePage.jsx @@ -4,7 +4,7 @@ import './homePage.less'; // Common imports import React, { useState, useEffect, useRef } from 'react'; import request from '../../utils/request-middleware.js'; -import Markdown from 'naturalcrit/markdown.js'; +import Markdown from 'markdown.js'; import _ from 'lodash'; import { DEFAULT_BREW } from '../../../../server/brewDefaults.js'; @@ -14,15 +14,15 @@ import SplitPane from 'client/components/splitPane/splitPane.jsx'; import Editor from '../../editor/editor.jsx'; import BrewRenderer from '../../brewRenderer/brewRenderer.jsx'; -import Nav from 'naturalcrit/nav/nav.jsx'; -import Navbar from '../../navbar/navbar.jsx'; -import NewBrewItem from '../../navbar/newbrew.navitem.jsx'; -import AccountNavItem from '../../navbar/account.navitem.jsx'; -import ErrorNavItem from '../../navbar/error-navitem.jsx'; -import HelpNavItem from '../../navbar/help.navitem.jsx'; -import VaultNavItem from '../../navbar/vault.navitem.jsx'; -import PrintNavItem from '../../navbar/print.navitem.jsx'; -import { both as RecentNavItem } from '../../navbar/recent.navitem.jsx'; +import Nav from 'client/homebrew/navbar/nav.jsx'; +import Navbar from 'client/homebrew/navbar/navbar.jsx'; +import NewBrewItem from 'client/homebrew/navbar/newbrew.navitem.jsx'; +import AccountNavItem from 'client/homebrew/navbar/account.navitem.jsx'; +import ErrorNavItem from 'client/homebrew/navbar/error-navitem.jsx'; +import HelpNavItem from 'client/homebrew/navbar/help.navitem.jsx'; +import VaultNavItem from 'client/homebrew/navbar/vault.navitem.jsx'; +import PrintNavItem from 'client/homebrew/navbar/print.navitem.jsx'; +import { both as RecentNavItem } from 'client/homebrew/navbar/recent.navitem.jsx'; // Page specific imports import { Meta } from 'vitreum/headtags'; diff --git a/client/homebrew/pages/newPage/newPage.jsx b/client/homebrew/pages/newPage/newPage.jsx index dccf7deb7..83eaeda45 100644 --- a/client/homebrew/pages/newPage/newPage.jsx +++ b/client/homebrew/pages/newPage/newPage.jsx @@ -4,7 +4,7 @@ import './newPage.less'; // Common imports import React, { useState, useEffect, useRef } from 'react'; import request from '../../utils/request-middleware.js'; -import Markdown from 'naturalcrit/markdown.js'; +import Markdown from 'markdown.js'; import _ from 'lodash'; import { DEFAULT_BREW } from '../../../../server/brewDefaults.js'; @@ -14,15 +14,15 @@ import SplitPane from 'client/components/splitPane/splitPane.jsx'; import Editor from '../../editor/editor.jsx'; import BrewRenderer from '../../brewRenderer/brewRenderer.jsx'; -import Nav from 'naturalcrit/nav/nav.jsx'; -import Navbar from '../../navbar/navbar.jsx'; -import NewBrewItem from '../../navbar/newbrew.navitem.jsx'; -import AccountNavItem from '../../navbar/account.navitem.jsx'; -import ErrorNavItem from '../../navbar/error-navitem.jsx'; -import HelpNavItem from '../../navbar/help.navitem.jsx'; -import VaultNavItem from '../../navbar/vault.navitem.jsx'; -import PrintNavItem from '../../navbar/print.navitem.jsx'; -import { both as RecentNavItem } from '../../navbar/recent.navitem.jsx'; +import Nav from 'client/homebrew/navbar/nav.jsx'; +import Navbar from 'client/homebrew/navbar/navbar.jsx'; +import NewBrewItem from 'client/homebrew/navbar/newbrew.navitem.jsx'; +import AccountNavItem from 'client/homebrew/navbar/account.navitem.jsx'; +import ErrorNavItem from 'client/homebrew/navbar/error-navitem.jsx'; +import HelpNavItem from 'client/homebrew/navbar/help.navitem.jsx'; +import VaultNavItem from 'client/homebrew/navbar/vault.navitem.jsx'; +import PrintNavItem from 'client/homebrew/navbar/print.navitem.jsx'; +import { both as RecentNavItem } from 'client/homebrew/navbar/recent.navitem.jsx'; // Page specific imports import { Meta } from 'vitreum/headtags'; @@ -56,6 +56,10 @@ const NewPage = (props)=>{ const editorRef = useRef(null); const lastSavedBrew = useRef(_.cloneDeep(props.brew)); + // const saveTimeout = useRef(null); + // const warnUnsavedTimeout = useRef(null); + const trySaveRef = useRef(trySave); // CTRL+S listener lives outside React and needs ref to use trySave with latest copy of brew + const unsavedChangesRef = useRef(unsavedChanges); // Similarly, onBeforeUnload lives outside React and needs ref to unsavedChanges useEffect(()=>{ loadBrew(); @@ -114,6 +118,11 @@ const NewPage = (props)=>{ if(autoSaveEnabled) trySave(false, hasChange); }, [currentBrew]); + useEffect(()=>{ + trySaveRef.current = trySave; + unsavedChangesRef.current = unsavedChanges; + }); + const handleSplitMove = ()=>{ editorRef.current.update(); }; @@ -141,7 +150,7 @@ const NewPage = (props)=>{ } }; - const save = async ()=>{ + const trySave = async ()=>{ setIsSaving(true); const updatedBrew = { ...currentBrew }; @@ -190,7 +199,7 @@ const NewPage = (props)=>{ // #3 - Unsaved changes exist, click to save, show SAVE NOW if(unsavedChanges) - return save now; + return save now; // #4 - No unsaved changes, autosave is ON, show AUTO-SAVED if(autoSaveEnabled) diff --git a/client/homebrew/pages/sharePage/sharePage.jsx b/client/homebrew/pages/sharePage/sharePage.jsx index 50104a665..32e88c9d8 100644 --- a/client/homebrew/pages/sharePage/sharePage.jsx +++ b/client/homebrew/pages/sharePage/sharePage.jsx @@ -3,12 +3,12 @@ const React = require('react'); const { useState, useEffect, useCallback } = React; const { Meta } = require('vitreum/headtags'); -const Nav = require('naturalcrit/nav/nav.jsx'); -const Navbar = require('../../navbar/navbar.jsx'); -const MetadataNav = require('../../navbar/metadata.navitem.jsx'); -const PrintNavItem = require('../../navbar/print.navitem.jsx'); -const RecentNavItem = require('../../navbar/recent.navitem.jsx').both; -const Account = require('../../navbar/account.navitem.jsx'); +const Nav = require('client/homebrew/navbar/nav.jsx'); +const Navbar = require('client/homebrew/navbar/navbar.jsx'); +const MetadataNav = require('client/homebrew/navbar/metadata.navitem.jsx'); +const PrintNavItem = require('client/homebrew/navbar/print.navitem.jsx'); +const RecentNavItem = require('client/homebrew/navbar/recent.navitem.jsx').both; +const Account = require('client/homebrew/navbar/account.navitem.jsx'); const BrewRenderer = require('../../brewRenderer/brewRenderer.jsx'); const { DEFAULT_BREW_LOAD } = require('../../../../server/brewDefaults.js'); diff --git a/client/homebrew/pages/userPage/userPage.jsx b/client/homebrew/pages/userPage/userPage.jsx index e4a8b0b4e..b9273f3c3 100644 --- a/client/homebrew/pages/userPage/userPage.jsx +++ b/client/homebrew/pages/userPage/userPage.jsx @@ -4,14 +4,14 @@ const _ = require('lodash'); const ListPage = require('../basePages/listPage/listPage.jsx'); -const Nav = require('naturalcrit/nav/nav.jsx'); -const Navbar = require('../../navbar/navbar.jsx'); -const RecentNavItem = require('../../navbar/recent.navitem.jsx').both; -const Account = require('../../navbar/account.navitem.jsx'); -const NewBrew = require('../../navbar/newbrew.navitem.jsx'); -const HelpNavItem = require('../../navbar/help.navitem.jsx'); -const ErrorNavItem = require('../../navbar/error-navitem.jsx'); -const VaultNavitem = require('../../navbar/vault.navitem.jsx'); +const Nav = require('client/homebrew/navbar/nav.jsx'); +const Navbar = require('client/homebrew/navbar/navbar.jsx'); +const RecentNavItem = require('client/homebrew/navbar/recent.navitem.jsx').both; +const Account = require('client/homebrew/navbar/account.navitem.jsx'); +const NewBrew = require('client/homebrew/navbar/newbrew.navitem.jsx'); +const HelpNavItem = require('client/homebrew/navbar/help.navitem.jsx'); +const ErrorNavItem = require('client/homebrew/navbar/error-navitem.jsx'); +const VaultNavitem = require('client/homebrew/navbar/vault.navitem.jsx'); const UserPage = (props)=>{ props = { diff --git a/client/homebrew/pages/vaultPage/vaultPage.jsx b/client/homebrew/pages/vaultPage/vaultPage.jsx index e098bb1a2..f9e14c180 100644 --- a/client/homebrew/pages/vaultPage/vaultPage.jsx +++ b/client/homebrew/pages/vaultPage/vaultPage.jsx @@ -5,12 +5,12 @@ require('./vaultPage.less'); const React = require('react'); const { useState, useEffect, useRef } = React; -const Nav = require('naturalcrit/nav/nav.jsx'); -const Navbar = require('../../navbar/navbar.jsx'); -const RecentNavItem = require('../../navbar/recent.navitem.jsx').both; -const Account = require('../../navbar/account.navitem.jsx'); -const NewBrew = require('../../navbar/newbrew.navitem.jsx'); -const HelpNavItem = require('../../navbar/help.navitem.jsx'); +const Nav = require('client/homebrew/navbar/nav.jsx'); +const Navbar = require('client/homebrew/navbar/navbar.jsx'); +const RecentNavItem = require('client/homebrew/navbar/recent.navitem.jsx').both; +const Account = require('client/homebrew/navbar/account.navitem.jsx'); +const NewBrew = require('client/homebrew/navbar/newbrew.navitem.jsx'); +const HelpNavItem = require('client/homebrew/navbar/help.navitem.jsx'); const BrewItem = require('../basePages/listPage/brewItem/brewItem.jsx'); const SplitPane = require('client/components/splitPane/splitPane.jsx'); const ErrorIndex = require('../errorPage/errors/errorIndex.js'); diff --git a/package.json b/package.json index 36b467438..bb1fed2a9 100644 --- a/package.json +++ b/package.json @@ -44,7 +44,9 @@ "phb": "node --experimental-require-module scripts/phb.js", "prod": "set NODE_ENV=production && npm run build", "postinstall": "npm run build", - "start": "node --experimental-require-module server.js" + "start": "node --experimental-require-module server.js", + "docker:build": "docker build -t ${DOCKERID}/homebrewery:$npm_package_version .", + "docker:publish": "docker login && docker push ${DOCKERID}/homebrewery:$npm_package_version" }, "author": "stolksdorf", "license": "MIT", diff --git a/server/homebrew.api.js b/server/homebrew.api.js index 2cedb5972..4d4f5a911 100644 --- a/server/homebrew.api.js +++ b/server/homebrew.api.js @@ -4,7 +4,7 @@ import { model as HomebrewModel } from './homebrew.model.js'; import express from 'express'; import zlib from 'zlib'; import GoogleActions from './googleActions.js'; -import Markdown from '../shared/naturalcrit/markdown.js'; +import Markdown from '../shared/markdown.js'; import yaml from 'js-yaml'; import asyncHandler from 'express-async-handler'; import { nanoid } from 'nanoid'; diff --git a/shared/naturalcrit/markdown.js b/shared/markdown.js similarity index 98% rename from shared/naturalcrit/markdown.js rename to shared/markdown.js index c48539008..412be27a7 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/markdown.js @@ -16,10 +16,10 @@ import { gfmHeadingId as MarkedGFMHeadingId, resetHeadings as MarkedGFMResetHead import { markedEmoji as MarkedEmojis } from 'marked-emoji'; //Icon fonts included so they can appear in emoji autosuggest dropdown -import diceFont from '../../themes/fonts/iconFonts/diceFont.js'; -import elderberryInn from '../../themes/fonts/iconFonts/elderberryInn.js'; -import gameIcons from '../../themes/fonts/iconFonts/gameIcons.js'; -import fontAwesome from '../../themes/fonts/iconFonts/fontAwesome.js'; +import diceFont from '../themes/fonts/iconFonts/diceFont.js'; +import elderberryInn from '../themes/fonts/iconFonts/elderberryInn.js'; +import gameIcons from '../themes/fonts/iconFonts/gameIcons.js'; +import fontAwesome from '../themes/fonts/iconFonts/fontAwesome.js'; const renderer = new Marked.Renderer(); const tokenizer = new Marked.Tokenizer(); diff --git a/shared/naturalcrit/markdownLegacy.js b/shared/markdownLegacy.js similarity index 100% rename from shared/naturalcrit/markdownLegacy.js rename to shared/markdownLegacy.js diff --git a/shared/naturalcrit/svg/combat.svg.jsx b/shared/naturalcrit/svg/combat.svg.jsx deleted file mode 100644 index fc92b4df4..000000000 --- a/shared/naturalcrit/svg/combat.svg.jsx +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = function(props){ - return ; -}; diff --git a/tests/markdown/basic.test.js b/tests/markdown/basic.test.js index aaa2adf58..ddceb9197 100644 --- a/tests/markdown/basic.test.js +++ b/tests/markdown/basic.test.js @@ -1,6 +1,6 @@ -import Markdown from 'naturalcrit/markdown.js'; +import Markdown from 'markdown.js'; test('Processes the markdown within an HTML block if its just a class wrapper', function() { const source = '
    *Bold text*
    '; diff --git a/tests/markdown/definition-lists.test.js b/tests/markdown/definition-lists.test.js index 144dad880..12499d559 100644 --- a/tests/markdown/definition-lists.test.js +++ b/tests/markdown/definition-lists.test.js @@ -1,6 +1,6 @@ -import Markdown from 'naturalcrit/markdown.js'; +import Markdown from 'markdown.js'; describe('Inline Definition Lists', ()=>{ test('No Term 1 Definition', function() { diff --git a/tests/markdown/emojis.test.js b/tests/markdown/emojis.test.js index e70ebb673..e21eec414 100644 --- a/tests/markdown/emojis.test.js +++ b/tests/markdown/emojis.test.js @@ -1,4 +1,4 @@ -import Markdown from 'naturalcrit/markdown.js'; +import Markdown from 'markdown.js'; const dedent = require('dedent-tabs').default; // Marked.js adds line returns after closing tags on some default tokens. diff --git a/tests/markdown/hard-breaks.test.js b/tests/markdown/hard-breaks.test.js index 63bfaef9c..068b2053a 100644 --- a/tests/markdown/hard-breaks.test.js +++ b/tests/markdown/hard-breaks.test.js @@ -1,6 +1,6 @@ -import Markdown from 'naturalcrit/markdown.js'; +import Markdown from 'markdown.js'; describe('Hard Breaks', ()=>{ test('Single Break', function() { diff --git a/tests/markdown/mustache-syntax.test.js b/tests/markdown/mustache-syntax.test.js index d17518411..5743f7903 100644 --- a/tests/markdown/mustache-syntax.test.js +++ b/tests/markdown/mustache-syntax.test.js @@ -1,7 +1,7 @@ /* eslint-disable max-lines */ const dedent = require('dedent-tabs').default; -import Markdown from 'naturalcrit/markdown.js'; +import Markdown from 'markdown.js'; // Marked.js adds line returns after closing tags on some default tokens. // This removes those line returns for comparison sake. diff --git a/tests/markdown/non-breaking-spaces.test.js b/tests/markdown/non-breaking-spaces.test.js index e498645a6..9da59b047 100644 --- a/tests/markdown/non-breaking-spaces.test.js +++ b/tests/markdown/non-breaking-spaces.test.js @@ -1,6 +1,6 @@ -import Markdown from 'naturalcrit/markdown.js'; +import Markdown from 'markdown.js'; describe('Non-Breaking Spaces Interactions', ()=>{ test('I am actually a single-line definition list!', function() { diff --git a/tests/markdown/paragraph-justification.test.js b/tests/markdown/paragraph-justification.test.js index 7876f5a26..f5a5b12ab 100644 --- a/tests/markdown/paragraph-justification.test.js +++ b/tests/markdown/paragraph-justification.test.js @@ -1,6 +1,6 @@ -import Markdown from 'naturalcrit/markdown.js'; +import Markdown from 'markdown.js'; describe('Justification', ()=>{ test('Left Justify', function() { diff --git a/tests/markdown/variables.test.js b/tests/markdown/variables.test.js index ea98fe56c..64232078f 100644 --- a/tests/markdown/variables.test.js +++ b/tests/markdown/variables.test.js @@ -1,7 +1,7 @@ /* eslint-disable max-lines */ const dedent = require('dedent-tabs').default; -import Markdown from 'naturalcrit/markdown.js'; +import Markdown from 'markdown.js'; // Marked.js adds line returns after closing tags on some default tokens. // This removes those line returns for comparison sake. diff --git a/themes/V3/Blank/snippets/footer.gen.js b/themes/V3/Blank/snippets/footer.gen.js index 9384baed7..417085642 100644 --- a/themes/V3/Blank/snippets/footer.gen.js +++ b/themes/V3/Blank/snippets/footer.gen.js @@ -1,4 +1,4 @@ -import Markdown from '../../../../shared/naturalcrit/markdown.js'; +import Markdown from '../../../../shared/markdown.js'; module.exports = { createFooterFunc : function(headerSize=1){