diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..cf70988 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +**/node_modules diff --git a/.gitignore b/.gitignore index 46aa385..7d0e412 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,7 @@ server/api/**/*.nedb server/static/javascript server/static/react client/node_modules/ +Dockerfile .vscode +site diff --git a/client/package.json b/client/package.json index 32eb938..6647ba3 100644 --- a/client/package.json +++ b/client/package.json @@ -35,6 +35,7 @@ "react-ga": "^3.2.0", "react-helmet": "^6.1.0", "react-live": "^2.2.3", + "react-loadable": "^5.5.0", "react-redux": "^7.2.2", "react-scripts": "4.0.0", "react-sortable-hoc": "^1.11.0", @@ -43,6 +44,7 @@ "redial": "^0.5.0", "redux": "^4.0.5", "redux-logger": "^3.0.6", + "source-map-explorer": "^2.5.0", "web-vitals": "^0.2.4" }, "devDependencies": { @@ -52,7 +54,8 @@ "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", - "eject": "react-scripts eject" + "eject": "react-scripts eject", + "analyze": "source-map-explorer 'build/static/js/*.js'" }, "eslintConfig": { "extends": [ diff --git a/client/public/android-icon-144x144.png b/client/public/android-icon-144x144.png new file mode 100644 index 0000000..9573d85 Binary files /dev/null and b/client/public/android-icon-144x144.png differ diff --git a/client/public/android-icon-192x192.png b/client/public/android-icon-192x192.png new file mode 100644 index 0000000..a307773 Binary files /dev/null and b/client/public/android-icon-192x192.png differ diff --git a/client/public/android-icon-36x36.png b/client/public/android-icon-36x36.png new file mode 100644 index 0000000..2187a4e Binary files /dev/null and b/client/public/android-icon-36x36.png differ diff --git a/client/public/android-icon-48x48.png b/client/public/android-icon-48x48.png new file mode 100644 index 0000000..bd491aa Binary files /dev/null and b/client/public/android-icon-48x48.png differ diff --git a/client/public/android-icon-72x72.png b/client/public/android-icon-72x72.png new file mode 100644 index 0000000..7d3ec43 Binary files /dev/null and b/client/public/android-icon-72x72.png differ diff --git a/client/public/android-icon-96x96.png b/client/public/android-icon-96x96.png new file mode 100644 index 0000000..6df06c3 Binary files /dev/null and b/client/public/android-icon-96x96.png differ diff --git a/client/public/apple-icon-114x114.png b/client/public/apple-icon-114x114.png new file mode 100644 index 0000000..cb0bae4 Binary files /dev/null and b/client/public/apple-icon-114x114.png differ diff --git a/client/public/apple-icon-120x120.png b/client/public/apple-icon-120x120.png new file mode 100644 index 0000000..eaba344 Binary files /dev/null and b/client/public/apple-icon-120x120.png differ diff --git a/client/public/apple-icon-144x144.png b/client/public/apple-icon-144x144.png new file mode 100644 index 0000000..9573d85 Binary files /dev/null and b/client/public/apple-icon-144x144.png differ diff --git a/client/public/apple-icon-152x152.png b/client/public/apple-icon-152x152.png new file mode 100644 index 0000000..9801896 Binary files /dev/null and b/client/public/apple-icon-152x152.png differ diff --git a/client/public/apple-icon-180x180.png b/client/public/apple-icon-180x180.png new file mode 100644 index 0000000..53a2703 Binary files /dev/null and b/client/public/apple-icon-180x180.png differ diff --git a/client/public/apple-icon-57x57.png b/client/public/apple-icon-57x57.png new file mode 100644 index 0000000..e0e6fb3 Binary files /dev/null and b/client/public/apple-icon-57x57.png differ diff --git a/client/public/apple-icon-60x60.png b/client/public/apple-icon-60x60.png new file mode 100644 index 0000000..4a165aa Binary files /dev/null and b/client/public/apple-icon-60x60.png differ diff --git a/client/public/apple-icon-72x72.png b/client/public/apple-icon-72x72.png new file mode 100644 index 0000000..7d3ec43 Binary files /dev/null and b/client/public/apple-icon-72x72.png differ diff --git a/client/public/apple-icon-76x76.png b/client/public/apple-icon-76x76.png new file mode 100644 index 0000000..42a7eb2 Binary files /dev/null and b/client/public/apple-icon-76x76.png differ diff --git a/client/public/apple-icon-precomposed.png b/client/public/apple-icon-precomposed.png new file mode 100644 index 0000000..b4b8bc0 Binary files /dev/null and b/client/public/apple-icon-precomposed.png differ diff --git a/client/public/apple-icon.png b/client/public/apple-icon.png new file mode 100644 index 0000000..b4b8bc0 Binary files /dev/null and b/client/public/apple-icon.png differ diff --git a/client/public/browserconfig.xml b/client/public/browserconfig.xml new file mode 100644 index 0000000..c554148 --- /dev/null +++ b/client/public/browserconfig.xml @@ -0,0 +1,2 @@ + +#ffffff \ No newline at end of file diff --git a/client/public/favicon-16x16.png b/client/public/favicon-16x16.png new file mode 100644 index 0000000..225b154 Binary files /dev/null and b/client/public/favicon-16x16.png differ diff --git a/client/public/favicon-32x32.png b/client/public/favicon-32x32.png new file mode 100644 index 0000000..e81753c Binary files /dev/null and b/client/public/favicon-32x32.png differ diff --git a/client/public/favicon-96x96.png b/client/public/favicon-96x96.png new file mode 100644 index 0000000..6df06c3 Binary files /dev/null and b/client/public/favicon-96x96.png differ diff --git a/client/public/favicon.ico b/client/public/favicon.ico index 306910a..bc6fb20 100644 Binary files a/client/public/favicon.ico and b/client/public/favicon.ico differ diff --git a/client/public/logo192.png b/client/public/logo192.png index fc44b0a..a307773 100644 Binary files a/client/public/logo192.png and b/client/public/logo192.png differ diff --git a/client/public/logo512.png b/client/public/logo512.png index a4e47a6..0471266 100644 Binary files a/client/public/logo512.png and b/client/public/logo512.png differ diff --git a/client/public/manifest.json b/client/public/manifest.json index 080d6c7..cb5d0a9 100644 --- a/client/public/manifest.json +++ b/client/public/manifest.json @@ -1,25 +1,52 @@ { - "short_name": "React App", - "name": "Create React App Sample", - "icons": [ - { - "src": "favicon.ico", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" - }, - { - "src": "logo192.png", - "type": "image/png", - "sizes": "192x192" - }, - { - "src": "logo512.png", - "type": "image/png", - "sizes": "512x512" - } - ], - "start_url": ".", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" -} +"short_name": "Basic Primitives Diagrams", +"name": "Basic Primitives Diagrams - Data visualization diagramming Components for dependencies visualization and analysis", +"icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + }, + { + "src": "android-icon-36x36.png", + "sizes": "36x36", + "type": "image/png", + "density": "0.75" + }, + { + "src": "android-icon-48x48.png", + "sizes": "48x48", + "type": "image/png", + "density": "1.0" + }, + { + "src": "android-icon-72x72.png", + "sizes": "72x72", + "type": "image/png", + "density": "1.5" + }, + { + "src": "android-icon-96x96.png", + "sizes": "96x96", + "type": "image/png", + "density": "2.0" + }, + { + "src": "android-icon-144x144.png", + "sizes": "144x144", + "type": "image/png", + "density": "3.0" + }, + { + "src": "android-icon-192x192.png", + "sizes": "192x192", + "type": "image/png", + "density": "4.0" + }, + { + "src": "logo512.png", + "type": "image/png", + "sizes": "512x512" + } + ] +} \ No newline at end of file diff --git a/client/public/ms-icon-144x144.png b/client/public/ms-icon-144x144.png new file mode 100644 index 0000000..9573d85 Binary files /dev/null and b/client/public/ms-icon-144x144.png differ diff --git a/client/public/ms-icon-150x150.png b/client/public/ms-icon-150x150.png new file mode 100644 index 0000000..30be040 Binary files /dev/null and b/client/public/ms-icon-150x150.png differ diff --git a/client/public/ms-icon-310x310.png b/client/public/ms-icon-310x310.png new file mode 100644 index 0000000..4929201 Binary files /dev/null and b/client/public/ms-icon-310x310.png differ diff --git a/client/public/ms-icon-70x70.png b/client/public/ms-icon-70x70.png new file mode 100644 index 0000000..917b397 Binary files /dev/null and b/client/public/ms-icon-70x70.png differ diff --git a/client/public/robots.txt b/client/public/robots.txt index e9e57dc..3de9fbf 100644 --- a/client/public/robots.txt +++ b/client/public/robots.txt @@ -1,3 +1,4 @@ # https://www.robotstxt.org/robotstxt.html User-agent: * Disallow: +Sitemap: https://www.basicprimitives.com/sitemap.txt \ No newline at end of file diff --git a/client/src/components/Options/OptionsPanel.js b/client/src/components/Options/OptionsPanel.js index b4b263b..076d959 100644 --- a/client/src/components/Options/OptionsPanel.js +++ b/client/src/components/Options/OptionsPanel.js @@ -5,13 +5,13 @@ import AccordionSummary from '@material-ui/core/AccordionSummary'; import AccordionDetails from '@material-ui/core/AccordionDetails'; import Typography from '@material-ui/core/Typography'; import ExpandMoreIcon from '@material-ui/icons/ExpandMore'; -import { RadioGroupOption } from 'components'; -import { CheckboxOption } from 'components'; -import { ComboBoxOption } from 'components'; -import { SizeOption } from 'components'; -import { ThicknessOption } from 'components'; -import { TextOption } from 'components'; -import { ItemsOrderOption } from 'components'; +import RadioGroupOption from 'components/Options/RadioGroupOption'; +import CheckboxOption from 'components/Options/CheckboxOption'; +import ComboBoxOption from 'components/Options/ComboBoxOption'; +import SizeOption from 'components/Options/SizeOption'; +import ThicknessOption from 'components/Options/ThicknessOption'; +import TextOption from 'components/Options/TextOption'; +import ItemsOrderOption from 'components/Options/ItemsOrderOption'; import { makeStyles } from "@material-ui/core/styles"; const useStyles = makeStyles(theme => { diff --git a/client/src/components/PdfViewDialog/FamPdfViewDialog.js b/client/src/components/PdfViewDialog/FamPdfViewDialog.js new file mode 100644 index 0000000..70e6c1c --- /dev/null +++ b/client/src/components/PdfViewDialog/FamPdfViewDialog.js @@ -0,0 +1,9 @@ +import React from 'react'; +import PdfViewDialog from './PdfViewDialog'; +import primitives from 'basicprimitives'; + +function FamPdfViewDialog(props) { + return +} + +export default FamPdfViewDialog; \ No newline at end of file diff --git a/client/src/components/PdfViewDialog/FamPdfViewDialogLoadable.js b/client/src/components/PdfViewDialog/FamPdfViewDialogLoadable.js new file mode 100644 index 0000000..c43c5b8 --- /dev/null +++ b/client/src/components/PdfViewDialog/FamPdfViewDialogLoadable.js @@ -0,0 +1,11 @@ +import React from "react" +import Loadable from "react-loadable" + +const loadable = Loadable({ + loader: () => import("./FamPdfViewDialog"), + loading() { + return
Loading...
+ } + }) + +export default loadable; \ No newline at end of file diff --git a/client/src/components/PdfViewDialog/OrgPdfViewDialog.js b/client/src/components/PdfViewDialog/OrgPdfViewDialog.js new file mode 100644 index 0000000..6aa81b0 --- /dev/null +++ b/client/src/components/PdfViewDialog/OrgPdfViewDialog.js @@ -0,0 +1,9 @@ +import React from 'react'; +import PdfViewDialog from './PdfViewDialog'; +import primitives from 'basicprimitives'; + +function OrgPdfViewDialog(props) { + return +} + +export default OrgPdfViewDialog; \ No newline at end of file diff --git a/client/src/components/PdfViewDialog/OrgPdfViewDialogLoadable.js b/client/src/components/PdfViewDialog/OrgPdfViewDialogLoadable.js new file mode 100644 index 0000000..31b9aec --- /dev/null +++ b/client/src/components/PdfViewDialog/OrgPdfViewDialogLoadable.js @@ -0,0 +1,11 @@ +import React from "react" +import Loadable from "react-loadable" + +const loadable = Loadable({ + loader: () => import("./OrgPdfViewDialog"), + loading() { + return
Loading...
+ } + }) + +export default loadable; \ No newline at end of file diff --git a/client/src/components/PdfViewDialog/PdfViewDialog.js b/client/src/components/PdfViewDialog/PdfViewDialog.js index e5b3a52..2360234 100644 --- a/client/src/components/PdfViewDialog/PdfViewDialog.js +++ b/client/src/components/PdfViewDialog/PdfViewDialog.js @@ -97,17 +97,4 @@ function PdfViewDialog(props) { ); } -function OrgPdfViewDialog(props) { - return -} - -function FamPdfViewDialog(props) { - return -} - -const result = { - OrgPdfViewDialog, - FamPdfViewDialog -} - -export default result; \ No newline at end of file +export default PdfViewDialog; \ No newline at end of file diff --git a/client/src/components/index.js b/client/src/components/index.js index 75f3bc7..765a9a6 100644 --- a/client/src/components/index.js +++ b/client/src/components/index.js @@ -1,4 +1,5 @@ -import pdfViewDialog from './PdfViewDialog/PdfViewDialog'; +import orgPdfViewDialog from './PdfViewDialog/OrgPdfViewDialogLoadable'; +import famPdfViewDialog from './PdfViewDialog/FamPdfViewDialogLoadable'; import radioGroupOption from './Options/RadioGroupOption'; import checkboxOption from './Options/CheckboxOption'; import comboBoxOption from './Options/ComboBoxOption'; @@ -9,8 +10,8 @@ import itemsOrderOption from './Options/ItemsOrderOption'; import optionsPanel from './Options/OptionsPanel'; import options from './Options/options'; -export const OrgPdfViewDialog = pdfViewDialog.OrgPdfViewDialog; -export const FamPdfViewDialog = pdfViewDialog.FamPdfViewDialog; +export const OrgPdfViewDialog = orgPdfViewDialog; +export const FamPdfViewDialog = famPdfViewDialog; export const RadioGroupOption = radioGroupOption; export const CheckboxOption = checkboxOption; export const ComboBoxOption = comboBoxOption; diff --git a/client/src/containers/App/AppDrawer.js b/client/src/containers/App/AppDrawer.js index 9e9bad8..21f2644 100644 --- a/client/src/containers/App/AppDrawer.js +++ b/client/src/containers/App/AppDrawer.js @@ -4,7 +4,7 @@ import { withStyles } from '@material-ui/core/styles'; import List from '@material-ui/core/List'; import AppDrawerNavItem from './AppDrawerNavItem'; import {pageToTitle} from './helpers'; -import { useSelector, useDispatch } from 'react-redux' +import { useSelector, useDispatch } from 'react-redux'; import { load } from 'redux/modules/pages'; import { useLocation } from "@reach/router" import primitives from 'basicprimitives'; diff --git a/client/src/containers/App/Version.js b/client/src/containers/App/Version.js index 141fa92..448dc61 100644 --- a/client/src/containers/App/Version.js +++ b/client/src/containers/App/Version.js @@ -1,8 +1,8 @@ import React from 'react'; -import primitives from 'basicprimitives'; import { makeStyles } from '@material-ui/core/styles'; import ListSubheader from '@material-ui/core/ListSubheader'; import List from '@material-ui/core/List'; +import { useSelector } from 'react-redux'; const useStyles = makeStyles((theme) => ({ root: { @@ -17,13 +17,14 @@ const useStyles = makeStyles((theme) => ({ export default function Navigation() { const classes = useStyles(); + const version = useSelector(state => state.pages.version); return ( - Current Version: {primitives.common.version} + Current Version: {version} } className={classes.root} diff --git a/client/src/containers/CrossTeamGroup/Loadable.js b/client/src/containers/CrossTeamGroup/Loadable.js new file mode 100644 index 0000000..2a3af55 --- /dev/null +++ b/client/src/containers/CrossTeamGroup/Loadable.js @@ -0,0 +1,11 @@ +import React from "react" +import Loadable from "react-loadable" + +const loadable = Loadable({ + loader: () => import("./CrossTeamGroup"), + loading() { + return
Loading...
+ } + }) + +export default loadable; \ No newline at end of file diff --git a/client/src/containers/Dependencies/Loadable.js b/client/src/containers/Dependencies/Loadable.js new file mode 100644 index 0000000..391d321 --- /dev/null +++ b/client/src/containers/Dependencies/Loadable.js @@ -0,0 +1,11 @@ +import React from "react" +import Loadable from "react-loadable" + +const loadable = Loadable({ + loader: () => import("./Dependencies"), + loading() { + return
Loading...
+ } + }) + +export default loadable; \ No newline at end of file diff --git a/client/src/containers/DynamicLoading/Loadable.js b/client/src/containers/DynamicLoading/Loadable.js new file mode 100644 index 0000000..877f4b7 --- /dev/null +++ b/client/src/containers/DynamicLoading/Loadable.js @@ -0,0 +1,11 @@ +import React from "react" +import Loadable from "react-loadable" + +const loadable = Loadable({ + loader: () => import("./DynamicLoading"), + loading() { + return
Loading...
+ } + }) + +export default loadable; \ No newline at end of file diff --git a/client/src/containers/FamilyChartItemsOrdering/Loadable.js b/client/src/containers/FamilyChartItemsOrdering/Loadable.js new file mode 100644 index 0000000..6570fee --- /dev/null +++ b/client/src/containers/FamilyChartItemsOrdering/Loadable.js @@ -0,0 +1,11 @@ +import React from "react" +import Loadable from "react-loadable" + +const loadable = Loadable({ + loader: () => import("./FamilyChartItemsOrdering"), + loading() { + return
Loading...
+ } + }) + +export default loadable; \ No newline at end of file diff --git a/client/src/containers/FamilyChartWithAnnotations/Loadable.js b/client/src/containers/FamilyChartWithAnnotations/Loadable.js new file mode 100644 index 0000000..6f33e69 --- /dev/null +++ b/client/src/containers/FamilyChartWithAnnotations/Loadable.js @@ -0,0 +1,11 @@ +import React from "react" +import Loadable from "react-loadable" + +const loadable = Loadable({ + loader: () => import("./FamilyChartWithAnnotations"), + loading() { + return
Loading...
+ } + }) + +export default loadable; \ No newline at end of file diff --git a/client/src/containers/FinancialOwnership/Loadable.js b/client/src/containers/FinancialOwnership/Loadable.js new file mode 100644 index 0000000..b8e2a50 --- /dev/null +++ b/client/src/containers/FinancialOwnership/Loadable.js @@ -0,0 +1,11 @@ +import React from "react" +import Loadable from "react-loadable" + +const loadable = Loadable({ + loader: () => import("./FinancialOwnership"), + loading() { + return
Loading...
+ } + }) + +export default loadable; \ No newline at end of file diff --git a/client/src/containers/HighlightAnnotations/Loadable.js b/client/src/containers/HighlightAnnotations/Loadable.js new file mode 100644 index 0000000..ce4fc36 --- /dev/null +++ b/client/src/containers/HighlightAnnotations/Loadable.js @@ -0,0 +1,11 @@ +import React from "react" +import Loadable from "react-loadable" + +const loadable = Loadable({ + loader: () => import("./HighlightAnnotations"), + loading() { + return
Loading...
+ } + }) + +export default loadable; \ No newline at end of file diff --git a/client/src/containers/LargeHierarchy/Loadable.js b/client/src/containers/LargeHierarchy/Loadable.js new file mode 100644 index 0000000..2a0a56d --- /dev/null +++ b/client/src/containers/LargeHierarchy/Loadable.js @@ -0,0 +1,11 @@ +import React from "react" +import Loadable from "react-loadable" + +const loadable = Loadable({ + loader: () => import("./LargeHierarchy"), + loading() { + return
Loading...
+ } + }) + +export default loadable; \ No newline at end of file diff --git a/client/src/containers/MutualFinancialOwnership/Loadable.js b/client/src/containers/MutualFinancialOwnership/Loadable.js new file mode 100644 index 0000000..7192c2d --- /dev/null +++ b/client/src/containers/MutualFinancialOwnership/Loadable.js @@ -0,0 +1,11 @@ +import React from "react" +import Loadable from "react-loadable" + +const loadable = Loadable({ + loader: () => import("./MutualFinancialOwnership"), + loading() { + return
Loading...
+ } + }) + +export default loadable; \ No newline at end of file diff --git a/client/src/containers/OrgEditor/Loadable.js b/client/src/containers/OrgEditor/Loadable.js new file mode 100644 index 0000000..b9fdd5e --- /dev/null +++ b/client/src/containers/OrgEditor/Loadable.js @@ -0,0 +1,11 @@ +import React from "react" +import Loadable from "react-loadable" + +const loadable = Loadable({ + loader: () => import("./OrgEditor"), + loading() { + return
Loading...
+ } + }) + +export default loadable; \ No newline at end of file diff --git a/client/src/containers/Partners/Loadable.js b/client/src/containers/Partners/Loadable.js new file mode 100644 index 0000000..f2696a8 --- /dev/null +++ b/client/src/containers/Partners/Loadable.js @@ -0,0 +1,11 @@ +import React from "react" +import Loadable from "react-loadable" + +const loadable = Loadable({ + loader: () => import("./Partners"), + loading() { + return
Loading...
+ } + }) + +export default loadable; \ No newline at end of file diff --git a/client/src/containers/Patents/Loadable.js b/client/src/containers/Patents/Loadable.js new file mode 100644 index 0000000..d1032ac --- /dev/null +++ b/client/src/containers/Patents/Loadable.js @@ -0,0 +1,11 @@ +import React from "react" +import Loadable from "react-loadable" + +const loadable = Loadable({ + loader: () => import("./Patents"), + loading() { + return
Loading...
+ } + }) + +export default loadable; \ No newline at end of file diff --git a/client/src/containers/ReactUseCases/Loadable.js b/client/src/containers/ReactUseCases/Loadable.js new file mode 100644 index 0000000..c1df518 --- /dev/null +++ b/client/src/containers/ReactUseCases/Loadable.js @@ -0,0 +1,11 @@ +import React from "react" +import Loadable from "react-loadable" + +const loadable = Loadable({ + loader: () => import("./ReactHowToUse"), + loading() { + return
Loading...
+ } + }) + +export default loadable; \ No newline at end of file diff --git a/client/src/containers/ReactUseCases/ReactHowToUse.js b/client/src/containers/ReactUseCases/ReactHowToUse.js index c851ef5..e612a90 100644 --- a/client/src/containers/ReactUseCases/ReactHowToUse.js +++ b/client/src/containers/ReactUseCases/ReactHowToUse.js @@ -8,8 +8,9 @@ import MDReactComponent from 'markdown-react-js'; import { LiveProvider, LivePreview } from 'react-live' import LiveEditor from './LiveEditor'; import LiveError from './LiveError'; -import SyntaxHighlighter from 'react-syntax-highlighter'; -import { docco } from 'react-syntax-highlighter/dist/esm/styles/hljs'; +import { Light as SyntaxHighlighter } from 'react-syntax-highlighter'; +import js from 'react-syntax-highlighter/dist/esm/languages/hljs/javascript'; +import docco from 'react-syntax-highlighter/dist/esm/styles/hljs/docco'; import { faUserPlus, faUserSlash, faCoffee, faSitemap, faUser, faComment, faCog } from '@fortawesome/free-solid-svg-icons' import primitives from 'basicprimitives'; @@ -19,6 +20,8 @@ import { DndProvider, useDrag, useDrop, DropTarget, DragSource } from 'react-dnd import { HTML5Backend } from 'react-dnd-html5-backend'; require('./global.scss'); +SyntaxHighlighter.registerLanguage('javascript', js); + function ReactHowToUse(props) { const { fileName } = props; const loaded = useSelector(state => state.reacthowtouse.files[fileName] && state.reacthowtouse.files[fileName].loaded); diff --git a/client/src/containers/Reference/ApiReference.js b/client/src/containers/Reference/ApiReference.js index d135478..fd9b739 100644 --- a/client/src/containers/Reference/ApiReference.js +++ b/client/src/containers/Reference/ApiReference.js @@ -11,10 +11,13 @@ import { load } from 'redux/modules/reference'; import MDReactComponent from 'markdown-react-js'; import { useSelector, useDispatch } from 'react-redux'; import Container from '@material-ui/core/Container'; -import SyntaxHighlighter from 'react-syntax-highlighter'; -import { docco } from 'react-syntax-highlighter/dist/esm/styles/hljs'; +import { Light as SyntaxHighlighter } from 'react-syntax-highlighter'; +import js from 'react-syntax-highlighter/dist/esm/languages/hljs/javascript'; +import docco from 'react-syntax-highlighter/dist/esm/styles/hljs/docco'; import { makeStyles } from "@material-ui/core/styles"; +SyntaxHighlighter.registerLanguage('javascript', js); + const useStyles = makeStyles((theme) => ({ grow: { flexGrow: 1, diff --git a/client/src/containers/Reference/Loadable.js b/client/src/containers/Reference/Loadable.js new file mode 100644 index 0000000..ec520af --- /dev/null +++ b/client/src/containers/Reference/Loadable.js @@ -0,0 +1,11 @@ +import React from "react" +import Loadable from "react-loadable" + +const loadable = Loadable({ + loader: () => import("./Reference"), + loading() { + return
Loading...
+ } + }) + +export default loadable; \ No newline at end of file diff --git a/client/src/containers/TechTree/Loadable.js b/client/src/containers/TechTree/Loadable.js new file mode 100644 index 0000000..8ac222d --- /dev/null +++ b/client/src/containers/TechTree/Loadable.js @@ -0,0 +1,11 @@ +import React from "react" +import Loadable from "react-loadable" + +const loadable = Loadable({ + loader: () => import("./TechTree"), + loading() { + return
Loading...
+ } + }) + +export default loadable; \ No newline at end of file diff --git a/client/src/containers/UseCases/HowToUse.js b/client/src/containers/UseCases/HowToUse.js index 46e25da..b9df7e7 100644 --- a/client/src/containers/UseCases/HowToUse.js +++ b/client/src/containers/UseCases/HowToUse.js @@ -6,8 +6,11 @@ import Container from '@material-ui/core/Container'; import TryMe from './TryMe'; import { load, setCode } from 'redux/modules/howtouse'; import MDReactComponent from 'markdown-react-js'; -import SyntaxHighlighter from 'react-syntax-highlighter'; -import { docco } from 'react-syntax-highlighter/dist/esm/styles/hljs'; +import { Light as SyntaxHighlighter } from 'react-syntax-highlighter'; +import js from 'react-syntax-highlighter/dist/esm/languages/hljs/javascript'; +import docco from 'react-syntax-highlighter/dist/esm/styles/hljs/docco'; + +SyntaxHighlighter.registerLanguage('javascript', js); const useStyles = makeStyles(() => ({ placeholder: { diff --git a/client/src/containers/UseCases/Loadable.js b/client/src/containers/UseCases/Loadable.js new file mode 100644 index 0000000..fb90569 --- /dev/null +++ b/client/src/containers/UseCases/Loadable.js @@ -0,0 +1,11 @@ +import React from "react" +import Loadable from "react-loadable" + +const loadable = Loadable({ + loader: () => import("./HowToUse"), + loading() { + return
Loading...
+ } + }) + +export default loadable; \ No newline at end of file diff --git a/client/src/containers/VerticalLayout/Loadable.js b/client/src/containers/VerticalLayout/Loadable.js new file mode 100644 index 0000000..212a92c --- /dev/null +++ b/client/src/containers/VerticalLayout/Loadable.js @@ -0,0 +1,11 @@ +import React from "react" +import Loadable from "react-loadable" + +const loadable = Loadable({ + loader: () => import("./VerticalLayout"), + loading() { + return
Loading...
+ } + }) + +export default loadable; \ No newline at end of file diff --git a/client/src/containers/index.js b/client/src/containers/index.js index 365bb53..ba82d9a 100644 --- a/client/src/containers/index.js +++ b/client/src/containers/index.js @@ -1,25 +1,25 @@ import app from './App/App'; import home from './Home/Home'; import demos from './Demos/Demos'; -import largeHierarchy from './LargeHierarchy/LargeHierarchy'; -import dynamicLoading from './DynamicLoading/DynamicLoading'; -import orgEditor from './OrgEditor/OrgEditor'; -import verticalLayout from './VerticalLayout/VerticalLayout'; -import crossTeamGroup from './CrossTeamGroup/CrossTeamGroup'; -import highlightAnnotations from './HighlightAnnotations/HighlightAnnotations'; -import familyChartWithAnnotations from './FamilyChartWithAnnotations/FamilyChartWithAnnotations'; -import familyChartItemsOrdering from './FamilyChartItemsOrdering/FamilyChartItemsOrdering'; -import dependencies from './Dependencies/Dependencies'; -import patents from './Patents/Patents'; -import financialOwnership from './FinancialOwnership/FinancialOwnership'; -import mutualFinancialOwnership from './MutualFinancialOwnership/MutualFinancialOwnership'; -import techTree from './TechTree/TechTree'; -import partners from './Partners/Partners'; +import largeHierarchy from './LargeHierarchy/Loadable'; +import dynamicLoading from './DynamicLoading/Loadable'; +import orgEditor from './OrgEditor/Loadable'; +import verticalLayout from './VerticalLayout/Loadable'; +import crossTeamGroup from './CrossTeamGroup/Loadable'; +import highlightAnnotations from './HighlightAnnotations/Loadable'; +import familyChartWithAnnotations from './FamilyChartWithAnnotations/Loadable'; +import familyChartItemsOrdering from './FamilyChartItemsOrdering/Loadable'; +import dependencies from './Dependencies/Loadable'; +import patents from './Patents/Loadable'; +import financialOwnership from './FinancialOwnership/Loadable'; +import mutualFinancialOwnership from './MutualFinancialOwnership/Loadable'; +import techTree from './TechTree/Loadable'; +import partners from './Partners/Loadable'; import useCases from './UseCases/UseCases'; -import howToUse from './UseCases/HowToUse'; +import howToUse from './UseCases/Loadable'; import reactUseCases from './ReactUseCases/ReactUseCases'; -import reactHowToUse from './ReactUseCases/ReactHowToUse'; -import reference from './Reference/Reference'; +import reactHowToUse from './ReactUseCases/Loadable'; +import reference from './Reference/Loadable'; import apiReference from './Reference/ApiReference'; import changelog from './Changelog/Changelog'; import downloads from './Downloads/Downloads'; diff --git a/client/src/redux/modules/pages.js b/client/src/redux/modules/pages.js index 625892e..d370465 100644 --- a/client/src/redux/modules/pages.js +++ b/client/src/redux/modules/pages.js @@ -165,7 +165,7 @@ export default function reducer(state = initialState, action = {}) { case LOAD_SUCCESS: { const { result } = action; const { pages } = state; - const { javascript, react, reference } = result; + const { javascript, react, reference, packageinfo } = result; const childPages = { reference: getAPIPages(reference.markdown, 'reference'), usecases: getSamplePages(javascript.markdown, 'usecases'), @@ -175,6 +175,7 @@ export default function reducer(state = initialState, action = {}) { ...state, loading: false, loaded: true, + version: packageinfo.version, pages: pages.map(page => { const { pathname, title, children } = page; const newChildren = childPages[pathname.substring(1)]; @@ -218,11 +219,13 @@ export function load() { promise: ({ client }) => Promise.all([ client.get('/load-markdown?name=javascript-readme'), client.get('/load-markdown?name=react-readme'), - client.get('/load-markdown?name=reference-readme') + client.get('/load-markdown?name=reference-readme'), + client.get('/min/package.json') ]).then(results => ({ javascript: results[0], react: results[1], - reference: results[2] + reference: results[2], + packageinfo: results[3] })) }; } diff --git a/client/src/setupProxy.js b/client/src/setupProxy.js index aa6c6c5..db3ad9d 100644 --- a/client/src/setupProxy.js +++ b/client/src/setupProxy.js @@ -5,10 +5,7 @@ module.exports = function(app) { '/api', createProxyMiddleware({ target: 'http://localhost:3030', - changeOrigin: true, - pathRewrite: { - '^/api/': '/' - }, + changeOrigin: true }) ); }; \ No newline at end of file diff --git a/client/yarn.lock b/client/yarn.lock index 181f561..feb9610 100644 --- a/client/yarn.lock +++ b/client/yarn.lock @@ -2640,6 +2640,11 @@ async-limiter@~1.0.0: resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== +async@0.9.x: + version "0.9.2" + resolved "https://registry.yarnpkg.com/async/-/async-0.9.2.tgz#aea74d5e61c1f899613bf64bda66d4c78f2fd17d" + integrity sha1-rqdNXmHB+JlhO/ZL2mbUx48v0X0= + async@^2.6.2: version "2.6.3" resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" @@ -3143,6 +3148,11 @@ bser@2.1.1: dependencies: node-int64 "^0.4.0" +btoa@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/btoa/-/btoa-1.2.1.tgz#01a9909f8b2c93f6bf680ba26131eb30f7fa3d73" + integrity sha512-SB4/MIGlsiVkMcHmT+pSmIPoNDoHg+7cMzmt3Uxt628MTz2487DKSqK/fuhFBrkuqrYv5UCEnACpF4dTFNKc/g== + buble@0.19.6: version "0.19.6" resolved "https://registry.yarnpkg.com/buble/-/buble-0.19.6.tgz#915909b6bd5b11ee03b1c885ec914a8b974d34d3" @@ -4638,6 +4648,13 @@ ejs@^2.6.1: resolved "https://registry.yarnpkg.com/ejs/-/ejs-2.7.4.tgz#48661287573dcc53e366c7a1ae52c3a120eec9ba" integrity sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA== +ejs@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.5.tgz#aed723844dc20acb4b170cd9ab1017e476a0d93b" + integrity sha512-dldq3ZfFtgVTJMLjOe+/3sROTzALlL9E34V4/sDtUd/KlBSS0s6U1/+WPE1B4sj9CXHJpL1M6rhNJnc9Wbal9w== + dependencies: + jake "^10.6.1" + electron-to-chromium@^1.3.564, electron-to-chromium@^1.3.591: version "1.3.603" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.603.tgz#1b71bec27fb940eccd79245f6824c63d5f7e8abf" @@ -4820,7 +4837,7 @@ escalade@^3.0.2, escalade@^3.1.1: resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== -escape-html@~1.0.3: +escape-html@^1.0.3, escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= @@ -5373,6 +5390,13 @@ file-uri-to-path@1.0.0: resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd" integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw== +filelist@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/filelist/-/filelist-1.0.1.tgz#f10d1a3ae86c1694808e8f20906f43d4c9132dbb" + integrity sha512-8zSK6Nu0DQIC08mUC46sWGXi+q3GGpKydAG36k+JDba6VRpkevvOWUW5a/PhShij4+vHT9M+ghgG7eM+a9JDUQ== + dependencies: + minimatch "^3.0.4" + filesize@6.1.0: version "6.1.0" resolved "https://registry.yarnpkg.com/filesize/-/filesize-6.1.0.tgz#e81bdaa780e2451d714d71c0d7a4f3238d37ad00" @@ -5835,7 +5859,7 @@ gud@^1.0.0: resolved "https://registry.yarnpkg.com/gud/-/gud-1.0.0.tgz#a489581b17e6a70beca9abe3ae57de7a499852c0" integrity sha512-zGEOVKFM5sVPPrYs7J5/hYEw2Pof8KCyOwyhG8sAF26mCAeUFAcYPu1mwB7hhpIP29zOIBaDqwuHdLp0jvZXjw== -gzip-size@5.1.1: +gzip-size@5.1.1, gzip-size@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-5.1.1.tgz#cb9bee692f87c0612b232840a873904e4c135274" integrity sha512-FNHi6mmoHvs1mxZAds4PpdCS6QG8B4C1krxJsMutgxl5t3+GlRTzzI3NEkifXx2pVsOvJdOGSmIgDhQ55FwdPA== @@ -6836,6 +6860,16 @@ istanbul-reports@^3.0.2: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" +jake@^10.6.1: + version "10.8.2" + resolved "https://registry.yarnpkg.com/jake/-/jake-10.8.2.tgz#ebc9de8558160a66d82d0eadc6a2e58fbc500a7b" + integrity sha512-eLpKyrfG3mzvGE2Du8VoPbeSkRry093+tyNjdYaBbJS9v17knImYGNXQCUV0gLxQtF82m3E8iRb/wdSQZLoq7A== + dependencies: + async "0.9.x" + chalk "^2.4.2" + filelist "^1.0.1" + minimatch "^3.0.4" + jest-changed-files@^26.6.2: version "26.6.2" resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-26.6.2.tgz#f6198479e1cc66f22f9ae1e22acaa0b429c042d0" @@ -8526,7 +8560,7 @@ onetime@^5.1.0: dependencies: mimic-fn "^2.1.0" -open@^7.0.2: +open@^7.0.2, open@^7.1.0: version "7.3.0" resolved "https://registry.yarnpkg.com/open/-/open-7.3.0.tgz#45461fdee46444f3645b6e14eb3ca94b82e1be69" integrity sha512-mgLwQIx2F/ye9SmbrUkurZCnkoXyXyu9EbHtJZrICjVAJfyMArdHp3KkixGdZx1ZHFPNIwl0DDM1dFFqXbTLZw== @@ -9728,7 +9762,7 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.5" -prop-types@15.7.2, prop-types@^15.5.7, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2: +prop-types@15.7.2, prop-types@^15.5.0, prop-types@^15.5.7, prop-types@^15.5.8, prop-types@^15.6.0, prop-types@^15.6.1, prop-types@^15.6.2, prop-types@^15.7.2: version "15.7.2" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5" integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ== @@ -10027,6 +10061,13 @@ react-live@^2.2.3: react-simple-code-editor "^0.10.0" unescape "^1.0.1" +react-loadable@^5.5.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/react-loadable/-/react-loadable-5.5.0.tgz#582251679d3da86c32aae2c8e689c59f1196d8c4" + integrity sha512-C8Aui0ZpMd4KokxRdVAm2bQtI03k2RMRNzOB+IipV3yxFTSVICv7WoUr5L9ALB5BmKO1iHgZtWM8EvYG83otdg== + dependencies: + prop-types "^15.5.0" + react-redux@^7.2.2: version "7.2.2" resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-7.2.2.tgz#03862e803a30b6b9ef8582dadcc810947f74b736" @@ -10606,7 +10647,7 @@ rimraf@2, rimraf@^2.5.4, rimraf@^2.6.3: dependencies: glob "^7.1.3" -rimraf@2.6.3: +rimraf@2.6.3, rimraf@~2.6.2: version "2.6.3" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.3.tgz#b2d104fe0d8fb27cf9e0a1cda8262dd3833c6cab" integrity sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA== @@ -11094,6 +11135,24 @@ source-list-map@^2.0.0: resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== +source-map-explorer@^2.5.0: + version "2.5.0" + resolved "https://registry.yarnpkg.com/source-map-explorer/-/source-map-explorer-2.5.0.tgz#42e12c76743e8a0ca0579d472ea5ba623e0d0498" + integrity sha512-kWhlt0celEwwuULIY+sRoZKibc/8/Ec4ckcKThDMQW3hT7KxReYW1XktwFJIbZ2VF9Yf/hA74bcoIZOSXXQIgQ== + dependencies: + btoa "^1.2.1" + chalk "^4.1.0" + convert-source-map "^1.7.0" + ejs "^3.1.5" + escape-html "^1.0.3" + glob "^7.1.6" + gzip-size "^5.1.1" + lodash "^4.17.20" + open "^7.1.0" + source-map "^0.7.3" + temp "^0.9.1" + yargs "^15.4.1" + source-map-resolve@^0.5.0, source-map-resolve@^0.5.2: version "0.5.3" resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a" @@ -11635,6 +11694,14 @@ temp-dir@^1.0.0: resolved "https://registry.yarnpkg.com/temp-dir/-/temp-dir-1.0.0.tgz#0a7c0ea26d3a39afa7e0ebea9c1fc0bc4daa011d" integrity sha1-CnwOom06Oa+n4OvqnB/AvE2qAR0= +temp@^0.9.1: + version "0.9.4" + resolved "https://registry.yarnpkg.com/temp/-/temp-0.9.4.tgz#cd20a8580cb63635d0e4e9d4bd989d44286e7620" + integrity sha512-yYrrsWnrXMcdsnu/7YMYAofM1ktpL5By7vZhf15CrXijWWrEYZks5AXBudalfSWJLlnen/QUJUB5aoB0kqZUGA== + dependencies: + mkdirp "^0.5.1" + rimraf "~2.6.2" + tempy@^0.3.0: version "0.3.0" resolved "https://registry.yarnpkg.com/tempy/-/tempy-0.3.0.tgz#6f6c5b295695a16130996ad5ab01a8bd726e8bf8" diff --git a/server/package.json b/server/package.json index f30505c..41c6169 100644 --- a/server/package.json +++ b/server/package.json @@ -28,7 +28,6 @@ "@feathersjs/socketio": "^3.0.1", "@feathersjs/socketio-client": "^1.0.1", "basicprimitives": "^5.9.2", - "basicprimitivesreact": "^5.9.3", "compression": "^1.6.2", "cookie-parser": "^1.4.3", "cookies-js": "^1.2.3", @@ -39,7 +38,6 @@ "feathers-nedb": "^4.0.1", "hooks": "^0.3.2", "lodash": "^4.17.10", - "markdown-react-js": "^1.0.2", "memory-cache": "^0.2.0", "morgan": "^1.10.0", "nedb": "^1.8.0", diff --git a/server/src/server.js b/server/src/server.js index 3f43f5e..2c50954 100644 --- a/server/src/server.js +++ b/server/src/server.js @@ -15,10 +15,9 @@ process.on('unhandledRejection', (reason, p) => { console.error('Unhandled Rejection at: Promise ', p, pretty.render(reason)); }); -const app = express(feathers()); +const fApp = express(feathers()); -app - .set('config', config) +fApp.set('config', config) .use(morgan('dev')) .use(cookieParser()) .use( @@ -48,6 +47,9 @@ app }) ); +const app = express(); +app.use('/api', fApp); + if (process.env.APIPORT) { app.listen(process.env.APIPORT, err => { if (err) { diff --git a/server/src/services/howtouse/markdown.js b/server/src/services/howtouse/markdown.js index 53c5f33..6e19353 100644 --- a/server/src/services/howtouse/markdown.js +++ b/server/src/services/howtouse/markdown.js @@ -52,6 +52,7 @@ async function getMarkdownFileContent(name) { if (filePath != null) { fileContent = (await readFile(filePath)).toString(); fileContent = fileContent.replace(/(samples\/images)/g, match => 'api/images'); + fileContent = fileContent.replace(/(\(images)/g, match => '(api/images'); } return fileContent; } @@ -71,12 +72,13 @@ async function getSampleFileContent(link) { } // remove SSI command used for package primary library development. fileContent = fileContent.replace(//g, match => ''); - fileContent = fileContent.replace(/(\.\.\/\.\.\/packages)/g, match => '/packages'); - fileContent = fileContent.replace(/(\.\.\/\.\.\/min)/g, match => '/min'); - fileContent = fileContent.replace(/(\.\.\/images\/photos)/g, match => '/images/photos'); + fileContent = fileContent.replace(/(\.\.\/\.\.\/packages)/g, match => '/api/packages'); + fileContent = fileContent.replace(/(\.\.\/\.\.\/min)/g, match => '/api/min'); + fileContent = fileContent.replace(/(\.\.\/images\/photos)/g, match => '/api/images/photos'); + fileContent = fileContent.replace(/(\.\.\/data\/photos)/g, match => '/api/data/photos'); fileContent = fileContent.replace(/(\'photos)/g, match => '\'/photos'); fileContent = fileContent.replace(/(\"photos)/g, match => '\"/photos'); - fileContent = fileContent.replace(/(\(\.\/images)/g, match => '/images'); + fileContent = fileContent.replace(/(\(\.\/images)/g, match => '/api/images'); fileContent = fileContent.replace(/(\ \;)/g, match => ' '); fileContent = fileContent.replace(/(\/react\/photos)/g, match => '/api/images/photos'); return fileContent;