From ee67ba729a9e8288581354a44b95d347541f7d2f Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Thu, 1 Jul 2021 23:43:01 -0400 Subject: [PATCH 01/58] V & H spacing, wide block, image snippets --- .../editor/snippetbar/snippets/snippets.js | 28 +++++++++++++++---- client/homebrew/phbStyle/phb.style.less | 4 +-- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js index f72817c7a..fca5a539b 100644 --- a/client/homebrew/editor/snippetbar/snippets/snippets.js +++ b/client/homebrew/editor/snippetbar/snippets/snippets.js @@ -27,18 +27,34 @@ module.exports = [ }, { name : 'Vertical Spacing', - icon : 'fas fa-times-circle', - gen : '' + icon : 'fas fa-arrows-alt-v', + gen : '\n::::\n' + }, + { + name : 'Horizontal Spacing', + icon : 'fas fa-arrows-alt-h', + gen : ' {{width="100px"}} ' }, { name : 'Wide Block', - icon : 'fas fa-times-circle', - gen : '' + icon : 'fas fa-window-maximize', + gen : dedent`\n + {{wide + Everything in here will be extra wide. Tables, text, everything! + Beware though, CSS columns can behave a bit weird sometimes. You may + have to rely on the automatic column-break rather than \`\column\` if + you mix columns and wide blocks on the same page. + }} + \n` }, { name : 'Image', - icon : 'fas fa-times-circle', - gen : '' + icon : 'fas fa-image', + gen : dedent` + + Credit: Kyounghwan Kim` }, { name : 'Background Image', diff --git a/client/homebrew/phbStyle/phb.style.less b/client/homebrew/phbStyle/phb.style.less index a5c66b7f4..ded9462e1 100644 --- a/client/homebrew/phbStyle/phb.style.less +++ b/client/homebrew/phbStyle/phb.style.less @@ -528,8 +528,8 @@ body { .block { break-inside : avoid; } - .inline-block { - display : block; + .inline { + display : inline-block; } div { column-gap : 0.5cm; //Default spacing if a div uses multicolumns From 9333bc73ea1b387f74b7d2e54a0299191d460621 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Jul 2021 03:00:42 +0000 Subject: [PATCH 02/58] Bump eslint from 7.29.0 to 7.30.0 Bumps [eslint](https://github.com/eslint/eslint) from 7.29.0 to 7.30.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v7.29.0...v7.30.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 93 +++++++++++++++++++++++++++++++++++++++++++---- package.json | 2 +- 2 files changed, 87 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9b4537236..0bd9fe22c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,7 +44,7 @@ "vitreum": "git+https://git@github.com/calculuschild/vitreum.git" }, "devDependencies": { - "eslint": "^7.29.0", + "eslint": "^7.30.0", "eslint-plugin-react": "^7.24.0", "pico-check": "^2.1.3" }, @@ -1855,6 +1855,49 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", + "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.0", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@humanwhocodes/config-array/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz", + "integrity": "sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==", + "dev": true + }, "node_modules/@sindresorhus/is": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", @@ -3811,13 +3854,14 @@ } }, "node_modules/eslint": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.29.0.tgz", - "integrity": "sha512-82G/JToB9qIy/ArBzIWG9xvvwL3R86AlCjtGw+A29OMZDqhTybz/MByORSukGxeI+YPCR4coYyITKk8BFH9nDA==", + "version": "7.30.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.30.0.tgz", + "integrity": "sha512-VLqz80i3as3NdloY44BQSJpFw534L9Oh+6zJOUaViV4JPd+DaHwutqP7tcpkW3YiXbK6s05RZl7yl7cQn+lijg==", "dev": true, "dependencies": { "@babel/code-frame": "7.12.11", "@eslint/eslintrc": "^0.4.2", + "@humanwhocodes/config-array": "^0.5.0", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -10767,6 +10811,40 @@ } } }, + "@humanwhocodes/config-array": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.5.0.tgz", + "integrity": "sha512-FagtKFz74XrTl7y6HCzQpwDfXP0yhxe9lHLD1UZxjvZIcbyRz8zTFF/yYNfSfzU414eDwZ1SrO0Qvtyf+wFMQg==", + "dev": true, + "requires": { + "@humanwhocodes/object-schema": "^1.2.0", + "debug": "^4.1.1", + "minimatch": "^3.0.4" + }, + "dependencies": { + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "@humanwhocodes/object-schema": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.0.tgz", + "integrity": "sha512-wdppn25U8z/2yiaT6YGquE6X8sSv7hNMWSXYSSU1jGv/yd6XqjXgTDJ8KP4NgjTXfJ3GbRjeeb8RTV7a/VpM+w==", + "dev": true + }, "@sindresorhus/is": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", @@ -12405,13 +12483,14 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "eslint": { - "version": "7.29.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.29.0.tgz", - "integrity": "sha512-82G/JToB9qIy/ArBzIWG9xvvwL3R86AlCjtGw+A29OMZDqhTybz/MByORSukGxeI+YPCR4coYyITKk8BFH9nDA==", + "version": "7.30.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.30.0.tgz", + "integrity": "sha512-VLqz80i3as3NdloY44BQSJpFw534L9Oh+6zJOUaViV4JPd+DaHwutqP7tcpkW3YiXbK6s05RZl7yl7cQn+lijg==", "dev": true, "requires": { "@babel/code-frame": "7.12.11", "@eslint/eslintrc": "^0.4.2", + "@humanwhocodes/config-array": "^0.5.0", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", diff --git a/package.json b/package.json index 6e31f2c1c..838690595 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "vitreum": "git+https://git@github.com/calculuschild/vitreum.git" }, "devDependencies": { - "eslint": "^7.29.0", + "eslint": "^7.30.0", "eslint-plugin-react": "^7.24.0", "pico-check": "^2.1.3" } From 4e1e6bd69a6c125130ed18ae70e033d621a44aea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Jul 2021 03:00:51 +0000 Subject: [PATCH 03/58] Bump mongoose from 5.13.0 to 5.13.2 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.13.0 to 5.13.2. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.13.0...5.13.2) --- updated-dependencies: - dependency-name: mongoose dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 16 +++++++++------- package.json | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9b4537236..7c4bde08e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,7 +30,7 @@ "marked": "2.1.3", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.29.1", - "mongoose": "^5.13.0", + "mongoose": "^5.13.2", "nanoid": "3.1.23", "nconf": "^0.11.3", "prop-types": "15.7.2", @@ -6309,11 +6309,12 @@ } }, "node_modules/mongoose": { - "version": "5.13.0", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.13.0.tgz", - "integrity": "sha512-8dvu7vxmDzlupj4I9T0g33GPf4HzSZmIOKQfG9RJQ5Nxk/Ztx1b8zlYp+blvaCfWwtBpiAJuKYOBU17Wq1RVFQ==", + "version": "5.13.2", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.13.2.tgz", + "integrity": "sha512-sBUKJGpdwZCq9102Lj6ZOaLcW4z/T4TI9aGWrNX5ZlICwChKWG4Wo5qriLImdww3H7bETPW9vYtSiADNlA4wSQ==", "dependencies": { "@types/mongodb": "^3.5.27", + "@types/node": "14.x || 15.x", "bson": "^1.1.4", "kareem": "2.3.2", "mongodb": "3.6.8", @@ -14352,11 +14353,12 @@ } }, "mongoose": { - "version": "5.13.0", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.13.0.tgz", - "integrity": "sha512-8dvu7vxmDzlupj4I9T0g33GPf4HzSZmIOKQfG9RJQ5Nxk/Ztx1b8zlYp+blvaCfWwtBpiAJuKYOBU17Wq1RVFQ==", + "version": "5.13.2", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.13.2.tgz", + "integrity": "sha512-sBUKJGpdwZCq9102Lj6ZOaLcW4z/T4TI9aGWrNX5ZlICwChKWG4Wo5qriLImdww3H7bETPW9vYtSiADNlA4wSQ==", "requires": { "@types/mongodb": "^3.5.27", + "@types/node": "14.x || 15.x", "bson": "^1.1.4", "kareem": "2.3.2", "mongodb": "3.6.8", diff --git a/package.json b/package.json index 6e31f2c1c..1c9ad59e1 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "marked": "2.1.3", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.29.1", - "mongoose": "^5.13.0", + "mongoose": "^5.13.2", "nanoid": "3.1.23", "nconf": "^0.11.3", "prop-types": "15.7.2", From 5a7767cf0e097273d576d0f35f50d13ea0e17c43 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Jul 2021 03:00:35 +0000 Subject: [PATCH 04/58] Bump googleapis from 79.0.0 to 81.0.0 Bumps [googleapis](https://github.com/googleapis/google-api-nodejs-client) from 79.0.0 to 81.0.0. - [Release notes](https://github.com/googleapis/google-api-nodejs-client/releases) - [Changelog](https://github.com/googleapis/google-api-nodejs-client/blob/master/CHANGELOG.md) - [Commits](https://github.com/googleapis/google-api-nodejs-client/compare/googleapis-v79.0.0...googleapis-v81.0.0) --- updated-dependencies: - dependency-name: googleapis dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9b4537236..cab9e0b82 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "express-async-handler": "^1.1.4", "express-static-gzip": "2.1.1", "fs-extra": "10.0.0", - "googleapis": "79.0.0", + "googleapis": "81.0.0", "jwt-simple": "^0.5.6", "less": "^3.13.1", "lodash": "^4.17.21", @@ -4789,9 +4789,9 @@ } }, "node_modules/googleapis": { - "version": "79.0.0", - "resolved": "https://registry.npmjs.org/googleapis/-/googleapis-79.0.0.tgz", - "integrity": "sha512-yHY0fmcuSQyU3zYUort/gOENCkrEpVLN4ziWdXvSIRG4n1BS9A8ajwzgDKsf68FYpzYRjtMzeh11IKN45cwbOQ==", + "version": "81.0.0", + "resolved": "https://registry.npmjs.org/googleapis/-/googleapis-81.0.0.tgz", + "integrity": "sha512-PV4A3PWbOFkm44k4jk1I4ixFsfwc9dZWthfyGkU3322l0HMx2AYIuYqqN9vqQPlD734fTz4MOetETtQ0pH4KTg==", "dependencies": { "google-auth-library": "^7.0.2", "googleapis-common": "^5.0.2" @@ -13174,9 +13174,9 @@ } }, "googleapis": { - "version": "79.0.0", - "resolved": "https://registry.npmjs.org/googleapis/-/googleapis-79.0.0.tgz", - "integrity": "sha512-yHY0fmcuSQyU3zYUort/gOENCkrEpVLN4ziWdXvSIRG4n1BS9A8ajwzgDKsf68FYpzYRjtMzeh11IKN45cwbOQ==", + "version": "81.0.0", + "resolved": "https://registry.npmjs.org/googleapis/-/googleapis-81.0.0.tgz", + "integrity": "sha512-PV4A3PWbOFkm44k4jk1I4ixFsfwc9dZWthfyGkU3322l0HMx2AYIuYqqN9vqQPlD734fTz4MOetETtQ0pH4KTg==", "requires": { "google-auth-library": "^7.0.2", "googleapis-common": "^5.0.2" diff --git a/package.json b/package.json index 6e31f2c1c..53a39bdc4 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "express-async-handler": "^1.1.4", "express-static-gzip": "2.1.1", "fs-extra": "10.0.0", - "googleapis": "79.0.0", + "googleapis": "81.0.0", "jwt-simple": "^0.5.6", "less": "^3.13.1", "lodash": "^4.17.21", From efd0fd1f4ab6e50046ee863547ce6dc73626c0ac Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Sat, 10 Jul 2021 19:01:12 -0400 Subject: [PATCH 05/58] Table of Contents CSS and snippet --- .../snippets/tableOfContents.gen.js | 16 +++--- client/homebrew/phbStyle/phb.style.less | 49 +++++++++++++++++-- 2 files changed, 55 insertions(+), 10 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippets/tableOfContents.gen.js b/client/homebrew/editor/snippetbar/snippets/tableOfContents.gen.js index 8a03b0530..e2a1221eb 100644 --- a/client/homebrew/editor/snippetbar/snippets/tableOfContents.gen.js +++ b/client/homebrew/editor/snippetbar/snippets/tableOfContents.gen.js @@ -1,4 +1,5 @@ const _ = require('lodash'); +const dedent = require('dedent-tabs').default; const getTOC = (pages)=>{ const add1 = (title, page)=>{ @@ -51,13 +52,13 @@ module.exports = function(brew){ const pages = brew.text.split('\\page'); const TOC = getTOC(pages); const markdown = _.reduce(TOC, (r, g1, idx1)=>{ - r.push(`- **[${idx1 + 1} ${g1.title}](#p${g1.page})**`); + r.push(`\t\t- ### [{{ ${g1.title}}}{{ ${g1.page}}}](#p${g1.page})`); if(g1.children.length){ _.each(g1.children, (g2, idx2)=>{ - r.push(` - [${idx1 + 1}.${idx2 + 1} ${g2.title}](#p${g2.page})`); + r.push(`\t\t - #### [{{ ${g2.title}}}{{ ${g2.page}}}](#p${g2.page})`); if(g2.children.length){ _.each(g2.children, (g3, idx3)=>{ - r.push(` - [${idx1 + 1}.${idx2 + 1}.${idx3 + 1} ${g3.title}](#p${g3.page})`); + r.push(`\t\t - [{{ ${g3.title}}}{{ ${g3.page}}}](#p${g3.page})`); }); } }); @@ -65,8 +66,11 @@ module.exports = function(brew){ return r; }, []).join('\n'); - return `
-##### Table Of Contents + return dedent` + {{toc + # Table Of Contents + ${markdown} -
\n`; + }} + \n`; }; diff --git a/client/homebrew/phbStyle/phb.style.less b/client/homebrew/phbStyle/phb.style.less index ded9462e1..30ecb657a 100644 --- a/client/homebrew/phbStyle/phb.style.less +++ b/client/homebrew/phbStyle/phb.style.less @@ -505,19 +505,60 @@ body { -webkit-column-break-inside : avoid; page-break-inside : avoid; break-inside : avoid; + h1 { + text-align : center; + margin-bottom : 0.1cm; + } a{ - color : black; + display : table; + color : inherit; text-decoration : none; &:hover{ text-decoration : underline; } } + h4 { + margin-top : 0.1cm; + } ul{ padding-left : 0; list-style-type : none; - } - &>ul>li{ - margin-bottom : 10px; + li + li h3 { + margin-top : 0.26cm; + line-height : 1em + } + h3 span:first-child::after { + border : none; + } + span { + display : table-cell; + &:first-child { + position : relative; + overflow : hidden; + &::after { + content : ""; + position : absolute; + bottom : 0.08cm; /* Set as you want */ + margin-left : 0.06cm; /* Spacing before dot leaders */ + width : 100%; + border-bottom : 0.05cm dotted #000; + } + } + &:last-child { + font-family : BookInsanityRemake; + font-size : 0.34cm; + font-weight : normal; + color : black; + text-align : right; + vertical-align : bottom; /* Keep Price text bottom-aligned */ + width : 1%; + padding-left : 0.06cm; /* Spacing after dot leaders */ + /*white-space: nowrap; /* Uncomment if needed */ + } + } + ul { /*List indent*/ + margin-left : 1em; + } } } From 63ba9f4fb9a6a963d2669f0bb6e9e4b9090f48a7 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Sat, 10 Jul 2021 19:01:27 -0400 Subject: [PATCH 06/58] Change {{ span to Marked.js extension --- shared/naturalcrit/markdown.js | 84 ++++++++++++++++++++++------------ 1 file changed, 56 insertions(+), 28 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 317c8fdc0..3bc6c7693 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -19,12 +19,62 @@ renderer.paragraph = function(text){ let match; if(text.startsWith('${text}

\n`; }; +const mustacheSpans = { + name: 'mustacheSpans', + level: 'inline', // Is this a block-level or inline-level tokenizer? + start(src) { return src.match(/{{[^{]/)?.index; }, // Hint to Marked.js to stop and check for a match + tokenizer(src, tokens) { + const completeSpan = /^{{[^\n]*}}/; // Regex for the complete token + const inlineRegex = /{{(?:="[\w,\-. ]*"|[^"'{}}\s])*\s*|}}/g; + const match = completeSpan.exec(src); + if (match) { + //Find closing delimiter + let blockCount = 0; + let tags = ''; + let endIndex = 0; + let delim; + while (delim = inlineRegex.exec(match[0])) { + if(delim[0].startsWith('{{')) { + tags = tags || ' ' + processStyleTags(delim[0].substring(2)); + blockCount++; + } + else if(delim[0] == '}}' && blockCount !== 0) { + blockCount--; + if(blockCount == 0) { + endIndex = inlineRegex.lastIndex; + break; + } + } + } + + if(endIndex) { + const raw = src.slice(0, endIndex); + const text = raw.slice((raw.indexOf(' ')+1) || -2, -2) + + return { // Token to generate + type: 'mustacheSpans', // Should match "name" above + raw: raw, // Text to consume from the source + text: text, // Additional custom properties + tags: tags, + tokens: this.inlineTokens(text) // inlineTokens to process **bold**, *italics*, etc. + } + } + } + }, + renderer(token) { + console.log(token); + return `{ - - if(splitText) r.push(Markdown.parseInline(splitText, { renderer: renderer })); - - const block = matches[matchIndex] ? matches[matchIndex].trimLeft() : ''; - if(block && block.startsWith('{{')) { - const values = processStyleTags(block.substring(2)); - r.push(`tag.replace(/="(.*)"/g, ':$1;')); - return `${classes.join(' ')}" ${id ? `id="${id}"` : ''} ${styles ? `style="${styles.join(' ')}"` : ''}`; + return `${classes.join(' ')}" ${id ? `id="${id}"` : ''} ${styles.length ? `style="${styles.join(' ')}"` : ''}`; }; module.exports = { From 50991dfe9218827dd4f195216d55c4da524e01ef Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Sun, 11 Jul 2021 00:33:47 -0400 Subject: [PATCH 07/58] MustacheDivs to Marked.js extension --- shared/naturalcrit/markdown.js | 138 +++++++++++++++++---------------- 1 file changed, 70 insertions(+), 68 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 3bc6c7693..a8c287c93 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -20,20 +20,20 @@ renderer.paragraph = function(text){ if(text.startsWith('${match[1]}

` : ''}{ - if(splitText) r.push(Markdown.parseInline(splitText, { renderer: renderer })); - - const block = matches[matchIndex] ? matches[matchIndex].trimLeft() : ''; - if(block && block.startsWith('{')) { - const values = processStyleTags(block.substring(2)); - r.push(`
`); - blockCount++; - } else if(block == '}}' && blockCount !== 0){ - r.push('
'); - blockCount--; - } - - matchIndex++; - - return r; - }, []).join(''); - return res; - } else { - if(!matches) { - return `${text}`; } + }, + renderer(token) { + return ` Date: Mon, 19 Jul 2021 03:01:07 +0000 Subject: [PATCH 09/58] Bump mongoose from 5.13.2 to 5.13.3 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.13.2 to 5.13.3. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.13.2...5.13.3) --- updated-dependencies: - dependency-name: mongoose dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 50 +++++++++++++++++++++++++++++++++-------------- package.json | 2 +- 2 files changed, 36 insertions(+), 16 deletions(-) diff --git a/package-lock.json b/package-lock.json index dbca0030f..bd56bb54d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,7 +30,7 @@ "marked": "2.1.3", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.29.1", - "mongoose": "^5.13.2", + "mongoose": "^5.13.3", "nanoid": "3.1.23", "nconf": "^0.11.3", "prop-types": "15.7.2", @@ -6335,9 +6335,9 @@ } }, "node_modules/mongodb": { - "version": "3.6.8", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.8.tgz", - "integrity": "sha512-sDjJvI73WjON1vapcbyBD3Ao9/VN3TKYY8/QX9EPbs22KaCSrQ5rXo5ZZd44tWJ3wl3FlnrFZ+KyUtNH6+1ZPQ==", + "version": "3.6.10", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.10.tgz", + "integrity": "sha512-fvIBQBF7KwCJnDZUnFFy4WqEFP8ibdXeFANnylW19+vOwdjOAvqIzPdsNCEMT6VKTHnYu4K64AWRih0mkFms6Q==", "dependencies": { "bl": "^2.2.1", "bson": "^1.1.4", @@ -6350,18 +6350,38 @@ }, "optionalDependencies": { "saslprep": "^1.0.0" + }, + "peerDependenciesMeta": { + "aws4": { + "optional": true + }, + "bson-ext": { + "optional": true + }, + "kerberos": { + "optional": true + }, + "mongodb-client-encryption": { + "optional": true + }, + "mongodb-extjson": { + "optional": true + }, + "snappy": { + "optional": true + } } }, "node_modules/mongoose": { - "version": "5.13.2", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.13.2.tgz", - "integrity": "sha512-sBUKJGpdwZCq9102Lj6ZOaLcW4z/T4TI9aGWrNX5ZlICwChKWG4Wo5qriLImdww3H7bETPW9vYtSiADNlA4wSQ==", + "version": "5.13.3", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.13.3.tgz", + "integrity": "sha512-q+zX6kqHAvwxf5speMWhq6qF4vdj+x6/kfD5RSKdZKNm52yGmaUygN+zgrtQjBZPFEzG0B3vF6GP0PoAGadE+w==", "dependencies": { "@types/mongodb": "^3.5.27", "@types/node": "14.x || 15.x", "bson": "^1.1.4", "kareem": "2.3.2", - "mongodb": "3.6.8", + "mongodb": "3.6.10", "mongoose-legacy-pluralize": "1.0.2", "mpath": "0.8.3", "mquery": "3.2.5", @@ -14419,9 +14439,9 @@ "integrity": "sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==" }, "mongodb": { - "version": "3.6.8", - "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.8.tgz", - "integrity": "sha512-sDjJvI73WjON1vapcbyBD3Ao9/VN3TKYY8/QX9EPbs22KaCSrQ5rXo5ZZd44tWJ3wl3FlnrFZ+KyUtNH6+1ZPQ==", + "version": "3.6.10", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-3.6.10.tgz", + "integrity": "sha512-fvIBQBF7KwCJnDZUnFFy4WqEFP8ibdXeFANnylW19+vOwdjOAvqIzPdsNCEMT6VKTHnYu4K64AWRih0mkFms6Q==", "requires": { "bl": "^2.2.1", "bson": "^1.1.4", @@ -14432,15 +14452,15 @@ } }, "mongoose": { - "version": "5.13.2", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.13.2.tgz", - "integrity": "sha512-sBUKJGpdwZCq9102Lj6ZOaLcW4z/T4TI9aGWrNX5ZlICwChKWG4Wo5qriLImdww3H7bETPW9vYtSiADNlA4wSQ==", + "version": "5.13.3", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.13.3.tgz", + "integrity": "sha512-q+zX6kqHAvwxf5speMWhq6qF4vdj+x6/kfD5RSKdZKNm52yGmaUygN+zgrtQjBZPFEzG0B3vF6GP0PoAGadE+w==", "requires": { "@types/mongodb": "^3.5.27", "@types/node": "14.x || 15.x", "bson": "^1.1.4", "kareem": "2.3.2", - "mongodb": "3.6.8", + "mongodb": "3.6.10", "mongoose-legacy-pluralize": "1.0.2", "mpath": "0.8.3", "mquery": "3.2.5", diff --git a/package.json b/package.json index baed4f0ae..6e1ab8591 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "marked": "2.1.3", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.29.1", - "mongoose": "^5.13.2", + "mongoose": "^5.13.3", "nanoid": "3.1.23", "nconf": "^0.11.3", "prop-types": "15.7.2", From 72dc62e5ddbd780eacd9c67da9296df1b0326154 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Jul 2021 03:01:17 +0000 Subject: [PATCH 10/58] Bump googleapis from 81.0.0 to 82.0.0 Bumps [googleapis](https://github.com/googleapis/google-api-nodejs-client) from 81.0.0 to 82.0.0. - [Release notes](https://github.com/googleapis/google-api-nodejs-client/releases) - [Changelog](https://github.com/googleapis/google-api-nodejs-client/blob/master/CHANGELOG.md) - [Commits](https://github.com/googleapis/google-api-nodejs-client/compare/googleapis-v81.0.0...googleapis-v82.0.0) --- updated-dependencies: - dependency-name: googleapis dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index dbca0030f..638a0db67 100644 --- a/package-lock.json +++ b/package-lock.json @@ -23,7 +23,7 @@ "express-async-handler": "^1.1.4", "express-static-gzip": "2.1.1", "fs-extra": "10.0.0", - "googleapis": "81.0.0", + "googleapis": "82.0.0", "jwt-simple": "^0.5.6", "less": "^3.13.1", "lodash": "^4.17.21", @@ -4833,9 +4833,9 @@ } }, "node_modules/googleapis": { - "version": "81.0.0", - "resolved": "https://registry.npmjs.org/googleapis/-/googleapis-81.0.0.tgz", - "integrity": "sha512-PV4A3PWbOFkm44k4jk1I4ixFsfwc9dZWthfyGkU3322l0HMx2AYIuYqqN9vqQPlD734fTz4MOetETtQ0pH4KTg==", + "version": "82.0.0", + "resolved": "https://registry.npmjs.org/googleapis/-/googleapis-82.0.0.tgz", + "integrity": "sha512-TytL2h+Cl82RP8ZZ4hgiqOz/ZKWJ5nqn2ZaQ1bNIsIp6z4xuasXyJsgPaZzHADyRx/zNQfRfJGwzRInYJy7X4A==", "dependencies": { "google-auth-library": "^7.0.2", "googleapis-common": "^5.0.2" @@ -13254,9 +13254,9 @@ } }, "googleapis": { - "version": "81.0.0", - "resolved": "https://registry.npmjs.org/googleapis/-/googleapis-81.0.0.tgz", - "integrity": "sha512-PV4A3PWbOFkm44k4jk1I4ixFsfwc9dZWthfyGkU3322l0HMx2AYIuYqqN9vqQPlD734fTz4MOetETtQ0pH4KTg==", + "version": "82.0.0", + "resolved": "https://registry.npmjs.org/googleapis/-/googleapis-82.0.0.tgz", + "integrity": "sha512-TytL2h+Cl82RP8ZZ4hgiqOz/ZKWJ5nqn2ZaQ1bNIsIp6z4xuasXyJsgPaZzHADyRx/zNQfRfJGwzRInYJy7X4A==", "requires": { "google-auth-library": "^7.0.2", "googleapis-common": "^5.0.2" diff --git a/package.json b/package.json index baed4f0ae..844d7213c 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,7 @@ "express-async-handler": "^1.1.4", "express-static-gzip": "2.1.1", "fs-extra": "10.0.0", - "googleapis": "81.0.0", + "googleapis": "82.0.0", "jwt-simple": "^0.5.6", "less": "^3.13.1", "lodash": "^4.17.21", From 4f03df097ca0e85e82b466e5587b2ae01698b520 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Jul 2021 03:01:34 +0000 Subject: [PATCH 11/58] Bump eslint from 7.30.0 to 7.31.0 Bumps [eslint](https://github.com/eslint/eslint) from 7.30.0 to 7.31.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v7.30.0...v7.31.0) --- updated-dependencies: - dependency-name: eslint dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- package-lock.json | 69 ++++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 37 insertions(+), 34 deletions(-) diff --git a/package-lock.json b/package-lock.json index dbca0030f..34d94b9cd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -44,7 +44,7 @@ "vitreum": "git+https://git@github.com/calculuschild/vitreum.git" }, "devDependencies": { - "eslint": "^7.30.0", + "eslint": "^7.31.0", "eslint-plugin-react": "^7.24.0", "pico-check": "^2.1.3" }, @@ -1801,9 +1801,9 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.2.tgz", - "integrity": "sha512-8nmGq/4ycLpIwzvhI4tNDmQztZ8sp+hI7cyG8i1nQDhkAbRzHpXPidRAHlNvCZQpJTKw5ItIpMw9RSToGF00mg==", + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", + "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", "dev": true, "dependencies": { "ajv": "^6.12.4", @@ -1821,9 +1821,9 @@ } }, "node_modules/@eslint/eslintrc/node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "dev": true, "dependencies": { "ms": "2.1.2" @@ -2003,9 +2003,9 @@ } }, "node_modules/acorn-jsx": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" @@ -3854,13 +3854,13 @@ } }, "node_modules/eslint": { - "version": "7.30.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.30.0.tgz", - "integrity": "sha512-VLqz80i3as3NdloY44BQSJpFw534L9Oh+6zJOUaViV4JPd+DaHwutqP7tcpkW3YiXbK6s05RZl7yl7cQn+lijg==", + "version": "7.31.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.31.0.tgz", + "integrity": "sha512-vafgJpSh2ia8tnTkNUkwxGmnumgckLh5aAbLa1xRmIn9+owi8qBNGKL+B881kNKNTy7FFqTEkpNkUvmw0n6PkA==", "dev": true, "dependencies": { "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.2", + "@eslint/eslintrc": "^0.4.3", "@humanwhocodes/config-array": "^0.5.0", "ajv": "^6.10.0", "chalk": "^4.0.0", @@ -4776,9 +4776,9 @@ } }, "node_modules/globals": { - "version": "13.9.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.9.0.tgz", - "integrity": "sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA==", + "version": "13.10.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.10.0.tgz", + "integrity": "sha512-piHC3blgLGFjvOuMmWZX60f+na1lXFDhQXBf1UYp2fXPXqvEUbOhNwi6BsQ0bQishwedgnjkwv1d9zKf+MWw3g==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -4797,6 +4797,9 @@ "dev": true, "engines": { "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/google-auth-library": { @@ -10773,9 +10776,9 @@ } }, "@eslint/eslintrc": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.2.tgz", - "integrity": "sha512-8nmGq/4ycLpIwzvhI4tNDmQztZ8sp+hI7cyG8i1nQDhkAbRzHpXPidRAHlNvCZQpJTKw5ItIpMw9RSToGF00mg==", + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.4.3.tgz", + "integrity": "sha512-J6KFFz5QCYUJq3pf0mjEcCJVERbzv71PUIDczuh9JkwGEzced6CO5ADLHB1rbf/+oPBtoPfMYNOpGDzCANlbXw==", "dev": true, "requires": { "ajv": "^6.12.4", @@ -10790,9 +10793,9 @@ }, "dependencies": { "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", "dev": true, "requires": { "ms": "2.1.2" @@ -10929,9 +10932,9 @@ "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==" }, "acorn-jsx": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", - "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, "requires": {} }, @@ -12484,13 +12487,13 @@ "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, "eslint": { - "version": "7.30.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.30.0.tgz", - "integrity": "sha512-VLqz80i3as3NdloY44BQSJpFw534L9Oh+6zJOUaViV4JPd+DaHwutqP7tcpkW3YiXbK6s05RZl7yl7cQn+lijg==", + "version": "7.31.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.31.0.tgz", + "integrity": "sha512-vafgJpSh2ia8tnTkNUkwxGmnumgckLh5aAbLa1xRmIn9+owi8qBNGKL+B881kNKNTy7FFqTEkpNkUvmw0n6PkA==", "dev": true, "requires": { "@babel/code-frame": "7.12.11", - "@eslint/eslintrc": "^0.4.2", + "@eslint/eslintrc": "^0.4.3", "@humanwhocodes/config-array": "^0.5.0", "ajv": "^6.10.0", "chalk": "^4.0.0", @@ -13213,9 +13216,9 @@ } }, "globals": { - "version": "13.9.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.9.0.tgz", - "integrity": "sha512-74/FduwI/JaIrr1H8e71UbDE+5x7pIPs1C2rrwC52SszOo043CsWOZEMW7o2Y58xwm9b+0RBKDxY5n2sUpEFxA==", + "version": "13.10.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.10.0.tgz", + "integrity": "sha512-piHC3blgLGFjvOuMmWZX60f+na1lXFDhQXBf1UYp2fXPXqvEUbOhNwi6BsQ0bQishwedgnjkwv1d9zKf+MWw3g==", "dev": true, "requires": { "type-fest": "^0.20.2" diff --git a/package.json b/package.json index baed4f0ae..03d5950ef 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "vitreum": "git+https://git@github.com/calculuschild/vitreum.git" }, "devDependencies": { - "eslint": "^7.30.0", + "eslint": "^7.31.0", "eslint-plugin-react": "^7.24.0", "pico-check": "^2.1.3" } From 64d133f8f63cc1a84ec1d65ea184c687b31b3156 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Mon, 19 Jul 2021 20:04:25 -0400 Subject: [PATCH 12/58] Definition List to Markdown Extension. New syntax. --- .../editor/snippetbar/snippets/magic.gen.js | 10 ++--- .../snippetbar/snippets/monsterblock.gen.js | 14 +++---- shared/naturalcrit/markdown.js | 42 +++++++++++++++++-- themes/5ePhb.style.less | 26 +++++++----- 4 files changed, 65 insertions(+), 27 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippets/magic.gen.js b/client/homebrew/editor/snippetbar/snippets/magic.gen.js index a7765e979..caea3c4af 100644 --- a/client/homebrew/editor/snippetbar/snippets/magic.gen.js +++ b/client/homebrew/editor/snippetbar/snippets/magic.gen.js @@ -82,11 +82,11 @@ module.exports = { return [ `#### ${_.sample(spellNames)}`, `*${_.sample(level)}-level ${_.sample(spellSchools)}*`, - '___', - '- **Casting Time:** 1 action', - `- **Range:** ${_.sample(['Self', 'Touch', '30 feet', '60 feet'])}`, - `- **Components:** ${components}`, - `- **Duration:** ${_.sample(['Until dispelled', '1 round', 'Instantaneous', 'Concentration, up to 10 minutes', '1 hour'])}`, + '', + '**Casting Time:** :: 1 action', + `**Range:** :: ${_.sample(['Self', 'Touch', '30 feet', '60 feet'])}`, + `**Components:** :: ${components}`, + `**Duration:** :: ${_.sample(['Until dispelled', '1 round', 'Instantaneous', 'Concentration, up to 10 minutes', '1 hour'])}`, '', 'A flame, equivalent in brightness to a torch, springs from an object that you touch. ', 'The effect look like a regular flame, but it creates no heat and doesn\'t use oxygen. ', diff --git a/client/homebrew/editor/snippetbar/snippets/monsterblock.gen.js b/client/homebrew/editor/snippetbar/snippets/monsterblock.gen.js index c455e90f5..4db3019ea 100644 --- a/client/homebrew/editor/snippetbar/snippets/monsterblock.gen.js +++ b/client/homebrew/editor/snippetbar/snippets/monsterblock.gen.js @@ -146,18 +146,18 @@ module.exports = { ## ${getMonsterName()} *${getType()}, ${getAlignment()}* ___ - : **Armor Class** : ${_.random(10, 20)} (chain mail, shield) - : **Hit Points** : ${_.random(1, 150)}(1d4 + 5) - : **Speed** : ${_.random(0, 50)}ft. + **Armor Class** :: ${_.random(10, 20)} (chain mail, shield) + **Hit Points** :: ${_.random(1, 150)}(1d4 + 5) + **Speed** :: ${_.random(0, 50)}ft. ___ | STR | DEX | CON | INT | WIS | CHA | |:-----:|:-----:|:-----:|:-----:|:-----:|:-----:| ${getStats()} ___ - : **Condition Immunities** : ${genList(['groggy', 'swagged', 'weak-kneed', 'buzzed', 'groovy', 'melancholy', 'drunk'], 3)} - : **Senses** : darkvision 60 ft., passive Perception ${_.random(3, 20)} - : **Languages** : ${genList(['Common', 'Pottymouth', 'Gibberish', 'Latin', 'Jive'], 2)} - : **Challenge** : ${_.random(0, 15)} (${_.random(10, 10000)} XP) + **Condition Immunities** :: ${genList(['groggy', 'swagged', 'weak-kneed', 'buzzed', 'groovy', 'melancholy', 'drunk'], 3)} + **Senses** :: darkvision 60 ft., passive Perception ${_.random(3, 20)} + **Languages** :: ${genList(['Common', 'Pottymouth', 'Gibberish', 'Latin', 'Jive'], 2)} + **Challenge** :: ${_.random(0, 15)} (${_.random(10, 10000)} XP) ___ : ${_.times(_.random(genLines, genLines + 2), function(){return genAbilities();}).join('\n\t\t\t\n\t\t\t')} diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index a8c287c93..37784f740 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -74,7 +74,7 @@ const mustacheSpans = { const mustacheDivs = { name : 'mustacheDivs', level : 'block', - start(src) { return src.match(/^ *{{[^{]/)?.index; }, // Hint to Marked.js to stop and check for a match + start(src) { return src.match(/^ *{{[^{]/m)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { const completeBlock = /^ *{{.*\n *}}/s; // Regex for the complete token const blockRegex = /^ *{{(?:="[\w,\-. ]*"|[^"'{}\s])*$|^ *}}$/gm; @@ -116,7 +116,43 @@ const mustacheDivs = { } }; -Markdown.use({ extensions: [mustacheSpans, mustacheDivs] }); +const definitionLists = { + name : 'definitionLists', + level : 'block', + start(src) { return src.match(/^.*?::.*/m)?.index; }, // Hint to Marked.js to stop and check for a match + tokenizer(src, tokens) { + const regex = /^([^\n]*?)::([^\n]*)/ym; + let match; + let endIndex = 0; + const definitions = []; + //if(!src.match(/^[^\n]*?::/)) {console.log('return'); return;} + while (match = regex.exec(src)) { + definitions.push({ + dt : this.inlineTokens(match[1].trim()), + dd : this.inlineTokens(match[2].trim()) + }); + //console.log(regexl) + endIndex = regex.lastIndex; + } + if(definitions.length) { + return { + type : 'definitionLists', + raw : src.slice(0, endIndex), + definitions + }; + } + }, + renderer(token) { + return `
+ ${token.definitions.reduce((html, def)=>{ + return `${html}
${this.parseInline(def.dt)}
` + + `
${this.parseInline(def.dd)}
\n`; + }, '')} +
`; + } +}; + +Markdown.use({ extensions: [mustacheSpans, mustacheDivs, definitionLists] }); //Fix local links in the Preview iFrame to link inside the frame renderer.link = function (href, title, text) { @@ -216,8 +252,6 @@ module.exports = { render : (rawBrewText)=>{ rawBrewText = rawBrewText.replace(/^\\column$/gm, `
`) .replace(/^(:+)$/gm, (match)=>`${`
`.repeat(match.length)}\n`) - .replace(/(?:^|>) *:([^:\n]*):([^\n]*)\n/gm, (match, term, def)=>`
${Markdown.parseInline(term)}
${def}
`) - .replace(/(
.*<\/dt>
.*<\/dd>\n?)+/gm, `
$1
\n\n`) .replace(/^}}/gm, '\n}}') .replace(/^({{[^\n]*)$/gm, '$1\n'); return Markdown( diff --git a/themes/5ePhb.style.less b/themes/5ePhb.style.less index ce27a89e9..cd37bc185 100644 --- a/themes/5ePhb.style.less +++ b/themes/5ePhb.style.less @@ -283,11 +283,6 @@ body { dl { .useSansSerif(); color : @headerText; - padding-left :1.3em; - text-indent :-1.3em; - } - dd { - text-indent : 0px; } // Monster Ability table @@ -581,17 +576,26 @@ body { // * DEFINITION LISTS // *****************************/ .page { - // dl { - // margin-top: 10px; - // } + dl { + line-height : 1.3em; + padding-left : 1em; + text-indent : -1em; + } + dl + p { + margin-top: 0.5em; + } + p + dl { + margin-top: -0.5em; + } dt { float: left; //clear: left; //Doesn't seem necessary margin-right: 5px; } - // dd { - // margin-left: 0px; - // } + dd { + margin-left : 0px; + text-indent : 0px; + } } //***************************** From 7ff6d9e82588ebe7d94d9b632de4650586255cde Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Tue, 20 Jul 2021 15:40:32 -0400 Subject: [PATCH 13/58] Fix TOC generation for level 3 entries not inside level 2 --- .../snippets/tableOfContents.gen.js | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippets/tableOfContents.gen.js b/client/homebrew/editor/snippetbar/snippets/tableOfContents.gen.js index e2a1221eb..c351ff1aa 100644 --- a/client/homebrew/editor/snippetbar/snippets/tableOfContents.gen.js +++ b/client/homebrew/editor/snippetbar/snippets/tableOfContents.gen.js @@ -10,7 +10,7 @@ const getTOC = (pages)=>{ }); }; const add2 = (title, page)=>{ - if(!_.last(res)) add1('', page); + if(!_.last(res)) add1(null, page); _.last(res).children.push({ title : title, page : page + 1, @@ -18,8 +18,8 @@ const getTOC = (pages)=>{ }); }; const add3 = (title, page)=>{ - if(!_.last(res)) add1('', page); - if(!_.last(_.last(res).children)) add2('', page); + if(!_.last(res)) add1(null, page); + if(!_.last(_.last(res).children)) add2(null, page); _.last(_.last(res).children).children.push({ title : title, page : page + 1, @@ -52,13 +52,22 @@ module.exports = function(brew){ const pages = brew.text.split('\\page'); const TOC = getTOC(pages); const markdown = _.reduce(TOC, (r, g1, idx1)=>{ - r.push(`\t\t- ### [{{ ${g1.title}}}{{ ${g1.page}}}](#p${g1.page})`); + if(g1.title !== null) { + r.push(`\t\t- ### [{{ ${g1.title}}}{{ ${g1.page}}}](#p${g1.page})`); + } if(g1.children.length){ _.each(g1.children, (g2, idx2)=>{ - r.push(`\t\t - #### [{{ ${g2.title}}}{{ ${g2.page}}}](#p${g2.page})`); + if(g2.title !== null) { + r.push(`\t\t - #### [{{ ${g2.title}}}{{ ${g2.page}}}](#p${g2.page})`); + } if(g2.children.length){ _.each(g2.children, (g3, idx3)=>{ - r.push(`\t\t - [{{ ${g3.title}}}{{ ${g3.page}}}](#p${g3.page})`); + if(g2.title !== null) { + r.push(`\t\t - [{{ ${g3.title}}}{{ ${g3.page}}}](#p${g3.page})`); + } + else { // Don't over-indent if no level-2 parent entry + r.push(`\t\t - [{{ ${g3.title}}}{{ ${g3.page}}}](#p${g3.page})`); + } }); } }); From 76e4023b37bbb32f90fda6c087775d7cd8022c45 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Tue, 20 Jul 2021 15:44:42 -0400 Subject: [PATCH 14/58] Add theme CSS file to print page --- .../homebrew/editor/snippetbar/snippets/tableOfContents.gen.js | 3 +-- client/homebrew/pages/printPage/printPage.jsx | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippets/tableOfContents.gen.js b/client/homebrew/editor/snippetbar/snippets/tableOfContents.gen.js index c351ff1aa..a90f8c8b2 100644 --- a/client/homebrew/editor/snippetbar/snippets/tableOfContents.gen.js +++ b/client/homebrew/editor/snippetbar/snippets/tableOfContents.gen.js @@ -64,8 +64,7 @@ module.exports = function(brew){ _.each(g2.children, (g3, idx3)=>{ if(g2.title !== null) { r.push(`\t\t - [{{ ${g3.title}}}{{ ${g3.page}}}](#p${g3.page})`); - } - else { // Don't over-indent if no level-2 parent entry + } else { // Don't over-indent if no level-2 parent entry r.push(`\t\t - [{{ ${g3.title}}}{{ ${g3.page}}}](#p${g3.page})`); } }); diff --git a/client/homebrew/pages/printPage/printPage.jsx b/client/homebrew/pages/printPage/printPage.jsx index ffd11841c..d4f15c91b 100644 --- a/client/homebrew/pages/printPage/printPage.jsx +++ b/client/homebrew/pages/printPage/printPage.jsx @@ -59,6 +59,7 @@ const PrintPage = createClass({ render : function(){ return
+ {/* Apply CSS from Style tab */}
${this.props.brew.style} ` }} /> {this.renderPages()} From 3ed4ceb7a343ceb45789dcde6db2f6bcf920c465 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Tue, 20 Jul 2021 19:50:23 -0400 Subject: [PATCH 15/58] Fix description box snippet --- client/homebrew/editor/snippetbar/snippets/snippets.js | 4 ++-- themes/5ePhb.style.less | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js index fca5a539b..42039dfc0 100644 --- a/client/homebrew/editor/snippetbar/snippets/snippets.js +++ b/client/homebrew/editor/snippetbar/snippets/snippets.js @@ -159,12 +159,12 @@ module.exports = [ icon : 'fas fa-comment-alt', gen : function(){ return [ - '
', + '{{descriptive', '##### Time to Drop Knowledge', 'Use notes to point out some interesting information. ', '', '**Tables and lists** both work within a note.', - '
' + '}}' ].join('\n'); }, }, diff --git a/themes/5ePhb.style.less b/themes/5ePhb.style.less index cd37bc185..979856167 100644 --- a/themes/5ePhb.style.less +++ b/themes/5ePhb.style.less @@ -464,7 +464,7 @@ body { // ************************************/ .page .descriptive{ display : block-inline; - margin-bottom : 1em; + margin-top : 1.3em; background-color : #faf7ea; font-family : ScalySansRemake; border-style : solid; @@ -472,6 +472,10 @@ body { border-image : @descriptiveBoxImage 12 stretch; border-image-outset : 4px; box-shadow : 0px 0px 6px #faf7ea; + padding : 0.1em; + & + * { + margin-top : 1.3em; + } p{ display : block; padding-bottom : 0px; @@ -480,6 +484,9 @@ body { p + p { padding-top : .8em; } + p:last-of-type { + margin-bottom : 0em; + } em { font-family : ScalySansRemake; font-style : italic; From 7b44b5b7db7d93a54630014229606ff8e24cc09b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Jul 2021 03:00:52 +0000 Subject: [PATCH 16/58] Bump @babel/core from 7.14.6 to 7.14.8 Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.14.6 to 7.14.8. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.14.8/packages/babel-core) --- updated-dependencies: - dependency-name: "@babel/core" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 182 +++++++++++++++++++++++----------------------- package.json | 2 +- 2 files changed, 92 insertions(+), 92 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4d6c020cb..ff70e310f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "hasInstallScript": true, "license": "MIT", "dependencies": { - "@babel/core": "^7.14.6", + "@babel/core": "^7.14.8", "@babel/plugin-transform-runtime": "^7.14.5", "@babel/preset-env": "^7.14.7", "@babel/preset-react": "^7.14.5", @@ -72,19 +72,19 @@ } }, "node_modules/@babel/core": { - "version": "7.14.6", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.14.6.tgz", - "integrity": "sha512-gJnOEWSqTk96qG5BoIrl5bVtc23DCycmIePPYnamY9RboYdI4nFy5vAQMSl81O5K/W0sLDWfGysnOECC+KUUCA==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.14.8.tgz", + "integrity": "sha512-/AtaeEhT6ErpDhInbXmjHcUQXH0L0TEgscfcxk1qbOvLuKCa5aZT0SOOtDKFY96/CLROwbLSKyFor6idgNaU4Q==", "dependencies": { "@babel/code-frame": "^7.14.5", - "@babel/generator": "^7.14.5", + "@babel/generator": "^7.14.8", "@babel/helper-compilation-targets": "^7.14.5", - "@babel/helper-module-transforms": "^7.14.5", - "@babel/helpers": "^7.14.6", - "@babel/parser": "^7.14.6", + "@babel/helper-module-transforms": "^7.14.8", + "@babel/helpers": "^7.14.8", + "@babel/parser": "^7.14.8", "@babel/template": "^7.14.5", - "@babel/traverse": "^7.14.5", - "@babel/types": "^7.14.5", + "@babel/traverse": "^7.14.8", + "@babel/types": "^7.14.8", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -146,11 +146,11 @@ } }, "node_modules/@babel/generator": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.5.tgz", - "integrity": "sha512-y3rlP+/G25OIX3mYKKIOlQRcqj7YgrvHxOLbVmyLJ9bPmi5ttvUmpydVjcFjZphOktWuA7ovbx91ECloWTfjIA==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.8.tgz", + "integrity": "sha512-cYDUpvIzhBVnMzRoY1fkSEhK/HmwEVwlyULYgn/tMQYd6Obag3ylCjONle3gdErfXBW61SVTlR9QR7uWlgeIkg==", "dependencies": { - "@babel/types": "^7.14.5", + "@babel/types": "^7.14.8", "jsesc": "^2.5.1", "source-map": "^0.5.0" }, @@ -356,18 +356,18 @@ } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.5.tgz", - "integrity": "sha512-iXpX4KW8LVODuAieD7MzhNjmM6dzYY5tfRqT+R9HDXWl0jPn/djKmA+G9s/2C2T9zggw5tK1QNqZ70USfedOwA==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.8.tgz", + "integrity": "sha512-RyE+NFOjXn5A9YU1dkpeBaduagTlZ0+fccnIcAGbv1KGUlReBj7utF7oEth8IdIBQPcux0DDgW5MFBH2xu9KcA==", "dependencies": { "@babel/helper-module-imports": "^7.14.5", "@babel/helper-replace-supers": "^7.14.5", - "@babel/helper-simple-access": "^7.14.5", + "@babel/helper-simple-access": "^7.14.8", "@babel/helper-split-export-declaration": "^7.14.5", - "@babel/helper-validator-identifier": "^7.14.5", + "@babel/helper-validator-identifier": "^7.14.8", "@babel/template": "^7.14.5", - "@babel/traverse": "^7.14.5", - "@babel/types": "^7.14.5" + "@babel/traverse": "^7.14.8", + "@babel/types": "^7.14.8" }, "engines": { "node": ">=6.9.0" @@ -420,11 +420,11 @@ } }, "node_modules/@babel/helper-simple-access": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.14.5.tgz", - "integrity": "sha512-nfBN9xvmCt6nrMZjfhkl7i0oTV3yxR4/FztsbOASyTvVcoYd0TRHh7eMLdlEcCqobydC0LAF3LtC92Iwxo0wyw==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.14.8.tgz", + "integrity": "sha512-TrFN4RHh9gnWEU+s7JloIho2T76GPwRHhdzOWLqTrMnlas8T9O7ec+oEDNsRXndOmru9ymH9DFrEOxpzPoSbdg==", "dependencies": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.14.8" }, "engines": { "node": ">=6.9.0" @@ -453,9 +453,9 @@ } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz", - "integrity": "sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", + "integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==", "engines": { "node": ">=6.9.0" } @@ -483,13 +483,13 @@ } }, "node_modules/@babel/helpers": { - "version": "7.14.6", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.14.6.tgz", - "integrity": "sha512-yesp1ENQBiLI+iYHSJdoZKUtRpfTlL1grDIX9NRlAVppljLw/4tTyYupIB7uIYmC3stW/imAv8EqaKaS/ibmeA==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.14.8.tgz", + "integrity": "sha512-ZRDmI56pnV+p1dH6d+UN6GINGz7Krps3+270qqI9UJ4wxYThfAIcI5i7j5vXC4FJ3Wap+S9qcebxeYiqn87DZw==", "dependencies": { "@babel/template": "^7.14.5", - "@babel/traverse": "^7.14.5", - "@babel/types": "^7.14.5" + "@babel/traverse": "^7.14.8", + "@babel/types": "^7.14.8" }, "engines": { "node": ">=6.9.0" @@ -538,9 +538,9 @@ "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "node_modules/@babel/parser": { - "version": "7.14.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.7.tgz", - "integrity": "sha512-X67Z5y+VBJuHB/RjwECp8kSl5uYi0BvRbNeWqkaJCVh+LiTPl19WBUfG627psSgp9rSf6ojuXghQM3ha6qHHdA==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.8.tgz", + "integrity": "sha512-syoCQFOoo/fzkWDeM0dLEZi5xqurb5vuyzwIMNZRNun+N/9A4cUZeQaE7dTrB8jGaKuJRBtEOajtnmw0I5hvvA==", "bin": { "parser": "bin/babel-parser.js" }, @@ -1746,17 +1746,17 @@ } }, "node_modules/@babel/traverse": { - "version": "7.14.7", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.7.tgz", - "integrity": "sha512-9vDr5NzHu27wgwejuKL7kIOm4bwEtaPQ4Z6cpCmjSuaRqpH/7xc4qcGEscwMqlkwgcXl6MvqoAjZkQ24uSdIZQ==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.8.tgz", + "integrity": "sha512-kexHhzCljJcFNn1KYAQ6A5wxMRzq9ebYpEDV4+WdNyr3i7O44tanbDOR/xjiG2F3sllan+LgwK+7OMk0EmydHg==", "dependencies": { "@babel/code-frame": "^7.14.5", - "@babel/generator": "^7.14.5", + "@babel/generator": "^7.14.8", "@babel/helper-function-name": "^7.14.5", "@babel/helper-hoist-variables": "^7.14.5", "@babel/helper-split-export-declaration": "^7.14.5", - "@babel/parser": "^7.14.7", - "@babel/types": "^7.14.5", + "@babel/parser": "^7.14.8", + "@babel/types": "^7.14.8", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -1789,11 +1789,11 @@ "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" }, "node_modules/@babel/types": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz", - "integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", + "integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", "dependencies": { - "@babel/helper-validator-identifier": "^7.14.5", + "@babel/helper-validator-identifier": "^7.14.8", "to-fast-properties": "^2.0.0" }, "engines": { @@ -9584,19 +9584,19 @@ "integrity": "sha512-nS6dZaISCXJ3+518CWiBfEr//gHyMO02uDxBkXTKZDN5POruCnOZ1N4YBRZDCabwF8nZMWBpRxIicmXtBs+fvw==" }, "@babel/core": { - "version": "7.14.6", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.14.6.tgz", - "integrity": "sha512-gJnOEWSqTk96qG5BoIrl5bVtc23DCycmIePPYnamY9RboYdI4nFy5vAQMSl81O5K/W0sLDWfGysnOECC+KUUCA==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.14.8.tgz", + "integrity": "sha512-/AtaeEhT6ErpDhInbXmjHcUQXH0L0TEgscfcxk1qbOvLuKCa5aZT0SOOtDKFY96/CLROwbLSKyFor6idgNaU4Q==", "requires": { "@babel/code-frame": "^7.14.5", - "@babel/generator": "^7.14.5", + "@babel/generator": "^7.14.8", "@babel/helper-compilation-targets": "^7.14.5", - "@babel/helper-module-transforms": "^7.14.5", - "@babel/helpers": "^7.14.6", - "@babel/parser": "^7.14.6", + "@babel/helper-module-transforms": "^7.14.8", + "@babel/helpers": "^7.14.8", + "@babel/parser": "^7.14.8", "@babel/template": "^7.14.5", - "@babel/traverse": "^7.14.5", - "@babel/types": "^7.14.5", + "@babel/traverse": "^7.14.8", + "@babel/types": "^7.14.8", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -9639,11 +9639,11 @@ } }, "@babel/generator": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.5.tgz", - "integrity": "sha512-y3rlP+/G25OIX3mYKKIOlQRcqj7YgrvHxOLbVmyLJ9bPmi5ttvUmpydVjcFjZphOktWuA7ovbx91ECloWTfjIA==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.8.tgz", + "integrity": "sha512-cYDUpvIzhBVnMzRoY1fkSEhK/HmwEVwlyULYgn/tMQYd6Obag3ylCjONle3gdErfXBW61SVTlR9QR7uWlgeIkg==", "requires": { - "@babel/types": "^7.14.5", + "@babel/types": "^7.14.8", "jsesc": "^2.5.1", "source-map": "^0.5.0" }, @@ -9798,18 +9798,18 @@ } }, "@babel/helper-module-transforms": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.5.tgz", - "integrity": "sha512-iXpX4KW8LVODuAieD7MzhNjmM6dzYY5tfRqT+R9HDXWl0jPn/djKmA+G9s/2C2T9zggw5tK1QNqZ70USfedOwA==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.8.tgz", + "integrity": "sha512-RyE+NFOjXn5A9YU1dkpeBaduagTlZ0+fccnIcAGbv1KGUlReBj7utF7oEth8IdIBQPcux0DDgW5MFBH2xu9KcA==", "requires": { "@babel/helper-module-imports": "^7.14.5", "@babel/helper-replace-supers": "^7.14.5", - "@babel/helper-simple-access": "^7.14.5", + "@babel/helper-simple-access": "^7.14.8", "@babel/helper-split-export-declaration": "^7.14.5", - "@babel/helper-validator-identifier": "^7.14.5", + "@babel/helper-validator-identifier": "^7.14.8", "@babel/template": "^7.14.5", - "@babel/traverse": "^7.14.5", - "@babel/types": "^7.14.5" + "@babel/traverse": "^7.14.8", + "@babel/types": "^7.14.8" } }, "@babel/helper-optimise-call-expression": { @@ -9847,11 +9847,11 @@ } }, "@babel/helper-simple-access": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.14.5.tgz", - "integrity": "sha512-nfBN9xvmCt6nrMZjfhkl7i0oTV3yxR4/FztsbOASyTvVcoYd0TRHh7eMLdlEcCqobydC0LAF3LtC92Iwxo0wyw==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.14.8.tgz", + "integrity": "sha512-TrFN4RHh9gnWEU+s7JloIho2T76GPwRHhdzOWLqTrMnlas8T9O7ec+oEDNsRXndOmru9ymH9DFrEOxpzPoSbdg==", "requires": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.14.8" } }, "@babel/helper-skip-transparent-expression-wrappers": { @@ -9871,9 +9871,9 @@ } }, "@babel/helper-validator-identifier": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz", - "integrity": "sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg==" + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", + "integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==" }, "@babel/helper-validator-option": { "version": "7.14.5", @@ -9892,13 +9892,13 @@ } }, "@babel/helpers": { - "version": "7.14.6", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.14.6.tgz", - "integrity": "sha512-yesp1ENQBiLI+iYHSJdoZKUtRpfTlL1grDIX9NRlAVppljLw/4tTyYupIB7uIYmC3stW/imAv8EqaKaS/ibmeA==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.14.8.tgz", + "integrity": "sha512-ZRDmI56pnV+p1dH6d+UN6GINGz7Krps3+270qqI9UJ4wxYThfAIcI5i7j5vXC4FJ3Wap+S9qcebxeYiqn87DZw==", "requires": { "@babel/template": "^7.14.5", - "@babel/traverse": "^7.14.5", - "@babel/types": "^7.14.5" + "@babel/traverse": "^7.14.8", + "@babel/types": "^7.14.8" } }, "@babel/highlight": { @@ -9937,9 +9937,9 @@ } }, "@babel/parser": { - "version": "7.14.7", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.7.tgz", - "integrity": "sha512-X67Z5y+VBJuHB/RjwECp8kSl5uYi0BvRbNeWqkaJCVh+LiTPl19WBUfG627psSgp9rSf6ojuXghQM3ha6qHHdA==" + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.8.tgz", + "integrity": "sha512-syoCQFOoo/fzkWDeM0dLEZi5xqurb5vuyzwIMNZRNun+N/9A4cUZeQaE7dTrB8jGaKuJRBtEOajtnmw0I5hvvA==" }, "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { "version": "7.14.5", @@ -10751,17 +10751,17 @@ } }, "@babel/traverse": { - "version": "7.14.7", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.7.tgz", - "integrity": "sha512-9vDr5NzHu27wgwejuKL7kIOm4bwEtaPQ4Z6cpCmjSuaRqpH/7xc4qcGEscwMqlkwgcXl6MvqoAjZkQ24uSdIZQ==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.8.tgz", + "integrity": "sha512-kexHhzCljJcFNn1KYAQ6A5wxMRzq9ebYpEDV4+WdNyr3i7O44tanbDOR/xjiG2F3sllan+LgwK+7OMk0EmydHg==", "requires": { "@babel/code-frame": "^7.14.5", - "@babel/generator": "^7.14.5", + "@babel/generator": "^7.14.8", "@babel/helper-function-name": "^7.14.5", "@babel/helper-hoist-variables": "^7.14.5", "@babel/helper-split-export-declaration": "^7.14.5", - "@babel/parser": "^7.14.7", - "@babel/types": "^7.14.5", + "@babel/parser": "^7.14.8", + "@babel/types": "^7.14.8", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -10787,11 +10787,11 @@ } }, "@babel/types": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.5.tgz", - "integrity": "sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", + "integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", "requires": { - "@babel/helper-validator-identifier": "^7.14.5", + "@babel/helper-validator-identifier": "^7.14.8", "to-fast-properties": "^2.0.0" } }, diff --git a/package.json b/package.json index cf509f327..ff7deb77a 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ ] }, "dependencies": { - "@babel/core": "^7.14.6", + "@babel/core": "^7.14.8", "@babel/plugin-transform-runtime": "^7.14.5", "@babel/preset-env": "^7.14.7", "@babel/preset-react": "^7.14.5", From 38cca54b7f135bc791875cba3bad329bb7908022 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Jul 2021 03:01:03 +0000 Subject: [PATCH 17/58] Bump codemirror from 5.62.0 to 5.62.1 Bumps [codemirror](https://github.com/codemirror/CodeMirror) from 5.62.0 to 5.62.1. - [Release notes](https://github.com/codemirror/CodeMirror/releases) - [Changelog](https://github.com/codemirror/CodeMirror/blob/master/CHANGELOG.md) - [Commits](https://github.com/codemirror/CodeMirror/compare/5.62.0...5.62.1) --- updated-dependencies: - dependency-name: codemirror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4d6c020cb..1bd569bfe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "@babel/preset-react": "^7.14.5", "body-parser": "^1.19.0", "classnames": "^2.3.1", - "codemirror": "^5.62.0", + "codemirror": "^5.62.1", "cookie-parser": "^1.4.5", "create-react-class": "^15.7.0", "dedent-tabs": "^0.9.0", @@ -3181,9 +3181,9 @@ } }, "node_modules/codemirror": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.62.0.tgz", - "integrity": "sha512-Xnl3304iCc8nyVZuRkzDVVwc794uc9QNX0UcPGeNic1fbzkSrO4l4GVXho9tRNKBgPYZXgocUqXyfIv3BILhCQ==" + "version": "5.62.1", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.62.1.tgz", + "integrity": "sha512-39ce8tHh/M9J+Epa90R5zMGg06pxVXc1+Y0SRR6eKaUjjzuj5iYkk7rHc2uU+FzvfsWYGEYKPFf0pBVBLmYXNQ==" }, "node_modules/collection-visit": { "version": "1.0.0", @@ -11938,9 +11938,9 @@ } }, "codemirror": { - "version": "5.62.0", - "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.62.0.tgz", - "integrity": "sha512-Xnl3304iCc8nyVZuRkzDVVwc794uc9QNX0UcPGeNic1fbzkSrO4l4GVXho9tRNKBgPYZXgocUqXyfIv3BILhCQ==" + "version": "5.62.1", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.62.1.tgz", + "integrity": "sha512-39ce8tHh/M9J+Epa90R5zMGg06pxVXc1+Y0SRR6eKaUjjzuj5iYkk7rHc2uU+FzvfsWYGEYKPFf0pBVBLmYXNQ==" }, "collection-visit": { "version": "1.0.0", diff --git a/package.json b/package.json index cf509f327..f58b526d2 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "@babel/preset-react": "^7.14.5", "body-parser": "^1.19.0", "classnames": "^2.3.1", - "codemirror": "^5.62.0", + "codemirror": "^5.62.1", "cookie-parser": "^1.4.5", "create-react-class": "^15.7.0", "dedent-tabs": "^0.9.0", From 8f34e8bb2d79af5d47c7af0848d5e905582d8bf4 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Tue, 20 Jul 2021 23:32:49 -0400 Subject: [PATCH 18/58] Change note block to div, restyle notes and descript boxes --- .../editor/snippetbar/snippets/snippets.js | 30 ++-- themes/5ePhb.style.less | 129 +++++++++--------- 2 files changed, 84 insertions(+), 75 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js index 42039dfc0..6cb04e610 100644 --- a/client/homebrew/editor/snippetbar/snippets/snippets.js +++ b/client/homebrew/editor/snippetbar/snippets/snippets.js @@ -146,26 +146,28 @@ module.exports = [ name : 'Note', icon : 'fas fa-sticky-note', gen : function(){ - return [ - '> ##### Time to Drop Knowledge', - '> Use notes to point out some interesting information. ', - '> ', - '> **Tables and lists** both work within a note.' - ].join('\n'); + return dedent` + {{note + ##### Time to Drop Knowledge', + Use notes to point out some interesting information. + + **Tables and lists** both work within a note. + }} + \n`; }, }, { name : 'Descriptive Text Box', icon : 'fas fa-comment-alt', gen : function(){ - return [ - '{{descriptive', - '##### Time to Drop Knowledge', - 'Use notes to point out some interesting information. ', - '', - '**Tables and lists** both work within a note.', - '}}' - ].join('\n'); + return dedent` + {{descriptive + ##### Time to Drop Knowledge + Use descriptive boxes to highlight text that should be read aloud. + + **Tables and lists** both work within a descriptive box. + }} + \n`; }, }, { diff --git a/themes/5ePhb.style.less b/themes/5ePhb.style.less index 979856167..17d27d00a 100644 --- a/themes/5ePhb.style.less +++ b/themes/5ePhb.style.less @@ -19,9 +19,12 @@ body { font-family : ScalySansRemake; font-size : 0.325cm; line-height : 1.2em; - p,dl,ul { + p,dl,ul,ol { line-height : 1.2em; } + ul, ol { + padding-left : 1em; + } em{ font-style : italic; } @@ -64,10 +67,10 @@ body { // *****************************/ p{ overflow-wrap : break-word; //TODO: MAKE ALL MARGINS TOP-ONLY. USE * + * STYLE SELECTORS - margin-bottom : 1em; + margin-bottom : 0.8em; line-height : 1.3em; &+p{ - margin-top : -1em; + margin-top : -0.8em; } } ul{ @@ -194,31 +197,75 @@ body { //***************************** // * NOTE // *****************************/ - blockquote{ + .note{ + &::before{ + content : ""; + box-sizing : border-box; + border-style : solid; + border-width : 11px; + border-image : @noteBorderImage 12; + border-image-outset : 9px 0px; + box-shadow : 1px 4px 14px #888; + position : absolute; + width : 100%; + height : 100%; + top : 0; + left : 0; + } .useSansSerif(); - box-sizing : border-box; - margin-bottom : 1em; - padding : 5px 10px; + position : relative; + margin-top : 1.3em; + margin-left : -0.1em; + margin-right : -0.1em; background-color : @noteGreen; - border-style : solid; - border-width : 11px; - border-image : @noteBorderImage 11; - border-image-outset : 9px 0px; - box-shadow : 1px 4px 14px #888; - -webkit-transform : translateZ(0); //Prevents shadows from breaking across columns - p, ul{ - font-size : 0.352cm; - line-height : 1.1em; + padding : 0.5em 0.6em; + & + * { + margin-top : 1.3em; + } + p{ + display : block; + padding-bottom : 0px; + } + p + p { + padding-top : .8em; + } + :last-child { + margin-bottom : 0em; } } - //If a note starts a column, give it space at the top to render border - pre+blockquote, h2+blockquote, h3+blockquote, h4+blockquote, h5+blockquote { - margin-top : 13px; + //************************************ + // * DESCRIPTIVE TEXT BOX + // ************************************/ + .descriptive{ + .useSansSerif(); + display : block-inline; + margin-top : 1.4em; + background-color : #faf7ea; + font-family : ScalySansRemake; + border-style : solid; + border-width : 7px; + border-image : @descriptiveBoxImage 12 stretch; + border-image-outset : 4px; + box-shadow : 0px 0px 6px #faf7ea; + padding : 0.1em; + & + * { + margin-top : 1.4em; + } + p{ + display : block; + padding-bottom : 0px; + line-height : 1.5em; + } + p + p { + padding-top : .8em; + } + :last-child { + margin-bottom : 0em; + } } //***************************** // * MONSTER STAT BLOCK // *****************************/ - .monster { &.frame { border-style : solid; @@ -459,47 +506,6 @@ body { margin-bottom : 10px; } } -//************************************ -// * DESCRIPTIVE TEXT BOX -// ************************************/ -.page .descriptive{ - display : block-inline; - margin-top : 1.3em; - background-color : #faf7ea; - font-family : ScalySansRemake; - border-style : solid; - border-width : 7px; - border-image : @descriptiveBoxImage 12 stretch; - border-image-outset : 4px; - box-shadow : 0px 0px 6px #faf7ea; - padding : 0.1em; - & + * { - margin-top : 1.3em; - } - p{ - display : block; - padding-bottom : 0px; - line-height : 1.5em; - } - p + p { - padding-top : .8em; - } - p:last-of-type { - margin-bottom : 0em; - } - em { - font-family : ScalySansRemake; - font-style : italic; - } - strong { - font-family : ScalySansRemake; - font-weight : 800; - letter-spacing : -0.02em; - } -} -.page pre+.descriptive{ - margin-top : 8px; -} //***************************** // * TABLE OF CONTENTS // *****************************/ @@ -570,6 +576,7 @@ body { .page { .block { break-inside : avoid; + -webkit-transform : translateZ(0); //Prevents shadows from breaking across columns } .inline { display : inline-block; From ba766254f834c155f15f2a525e631d35785ad139 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Tue, 20 Jul 2021 23:39:34 -0400 Subject: [PATCH 19/58] typo --- client/homebrew/editor/snippetbar/snippets/snippets.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js index 6cb04e610..6ecae9429 100644 --- a/client/homebrew/editor/snippetbar/snippets/snippets.js +++ b/client/homebrew/editor/snippetbar/snippets/snippets.js @@ -148,7 +148,7 @@ module.exports = [ gen : function(){ return dedent` {{note - ##### Time to Drop Knowledge', + ##### Time to Drop Knowledge Use notes to point out some interesting information. **Tables and lists** both work within a note. @@ -164,7 +164,7 @@ module.exports = [ {{descriptive ##### Time to Drop Knowledge Use descriptive boxes to highlight text that should be read aloud. - + **Tables and lists** both work within a descriptive box. }} \n`; From c23763a2cfb583f610a370e8733629599ccf1cf8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 21 Jul 2021 03:45:53 +0000 Subject: [PATCH 20/58] Bump @babel/preset-env from 7.14.7 to 7.14.8 Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.14.7 to 7.14.8. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.14.8/packages/babel-preset-env) --- updated-dependencies: - dependency-name: "@babel/preset-env" dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 18 +++++++++--------- package.json | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/package-lock.json b/package-lock.json index ff70e310f..e22b6e225 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "@babel/core": "^7.14.8", "@babel/plugin-transform-runtime": "^7.14.5", - "@babel/preset-env": "^7.14.7", + "@babel/preset-env": "^7.14.8", "@babel/preset-react": "^7.14.5", "body-parser": "^1.19.0", "classnames": "^2.3.1", @@ -1595,9 +1595,9 @@ } }, "node_modules/@babel/preset-env": { - "version": "7.14.7", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.14.7.tgz", - "integrity": "sha512-itOGqCKLsSUl0Y+1nSfhbuuOlTs0MJk2Iv7iSH+XT/mR8U1zRLO7NjWlYXB47yhK4J/7j+HYty/EhFZDYKa/VA==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.14.8.tgz", + "integrity": "sha512-a9aOppDU93oArQ51H+B8M1vH+tayZbuBqzjOhntGetZVa+4tTu5jp+XTwqHGG2lxslqomPYVSjIxQkFwXzgnxg==", "dependencies": { "@babel/compat-data": "^7.14.7", "@babel/helper-compilation-targets": "^7.14.5", @@ -1666,7 +1666,7 @@ "@babel/plugin-transform-unicode-escapes": "^7.14.5", "@babel/plugin-transform-unicode-regex": "^7.14.5", "@babel/preset-modules": "^0.1.4", - "@babel/types": "^7.14.5", + "@babel/types": "^7.14.8", "babel-plugin-polyfill-corejs2": "^0.2.2", "babel-plugin-polyfill-corejs3": "^0.2.2", "babel-plugin-polyfill-regenerator": "^0.2.2", @@ -10614,9 +10614,9 @@ } }, "@babel/preset-env": { - "version": "7.14.7", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.14.7.tgz", - "integrity": "sha512-itOGqCKLsSUl0Y+1nSfhbuuOlTs0MJk2Iv7iSH+XT/mR8U1zRLO7NjWlYXB47yhK4J/7j+HYty/EhFZDYKa/VA==", + "version": "7.14.8", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.14.8.tgz", + "integrity": "sha512-a9aOppDU93oArQ51H+B8M1vH+tayZbuBqzjOhntGetZVa+4tTu5jp+XTwqHGG2lxslqomPYVSjIxQkFwXzgnxg==", "requires": { "@babel/compat-data": "^7.14.7", "@babel/helper-compilation-targets": "^7.14.5", @@ -10685,7 +10685,7 @@ "@babel/plugin-transform-unicode-escapes": "^7.14.5", "@babel/plugin-transform-unicode-regex": "^7.14.5", "@babel/preset-modules": "^0.1.4", - "@babel/types": "^7.14.5", + "@babel/types": "^7.14.8", "babel-plugin-polyfill-corejs2": "^0.2.2", "babel-plugin-polyfill-corejs3": "^0.2.2", "babel-plugin-polyfill-regenerator": "^0.2.2", diff --git a/package.json b/package.json index ff7deb77a..09561fb54 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ "dependencies": { "@babel/core": "^7.14.8", "@babel/plugin-transform-runtime": "^7.14.5", - "@babel/preset-env": "^7.14.7", + "@babel/preset-env": "^7.14.8", "@babel/preset-react": "^7.14.5", "body-parser": "^1.19.0", "classnames": "^2.3.1", From 7c9defb85c1eb641277023507ee5875143ba3fe7 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 21 Jul 2021 15:09:37 -0400 Subject: [PATCH 21/58] Put theme in user page. --- client/homebrew/pages/userPage/userPage.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/client/homebrew/pages/userPage/userPage.jsx b/client/homebrew/pages/userPage/userPage.jsx index e6b7530b8..6527c3993 100644 --- a/client/homebrew/pages/userPage/userPage.jsx +++ b/client/homebrew/pages/userPage/userPage.jsx @@ -53,6 +53,7 @@ const UserPage = createClass({ const brews = this.getSortedBrews(); return
+ From 42b0ea173d3d8e1f4371884fef2d83591c633425 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 21 Jul 2021 16:05:29 -0400 Subject: [PATCH 22/58] Make toc two-columns --- .../homebrew/editor/snippetbar/snippets/tableOfContents.gen.js | 2 +- themes/5ePhb.style.less | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/client/homebrew/editor/snippetbar/snippets/tableOfContents.gen.js b/client/homebrew/editor/snippetbar/snippets/tableOfContents.gen.js index a90f8c8b2..f0964e582 100644 --- a/client/homebrew/editor/snippetbar/snippets/tableOfContents.gen.js +++ b/client/homebrew/editor/snippetbar/snippets/tableOfContents.gen.js @@ -75,7 +75,7 @@ module.exports = function(brew){ }, []).join('\n'); return dedent` - {{toc + {{toc,wide # Table Of Contents ${markdown} diff --git a/themes/5ePhb.style.less b/themes/5ePhb.style.less index 17d27d00a..137fcafa9 100644 --- a/themes/5ePhb.style.less +++ b/themes/5ePhb.style.less @@ -568,6 +568,9 @@ body { margin-left : 1em; } } + &.wide{ + .useColumns(0.96); + } } //***************************** From c77338c65e615bd9254c5fd2ebd2b2db8873a533 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Jul 2021 03:00:58 +0000 Subject: [PATCH 23/58] Bump codemirror from 5.62.1 to 5.62.2 Bumps [codemirror](https://github.com/codemirror/CodeMirror) from 5.62.1 to 5.62.2. - [Release notes](https://github.com/codemirror/CodeMirror/releases) - [Changelog](https://github.com/codemirror/CodeMirror/blob/master/CHANGELOG.md) - [Commits](https://github.com/codemirror/CodeMirror/compare/5.62.1...5.62.2) --- updated-dependencies: - dependency-name: codemirror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 14 +++++++------- package.json | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index e938095f9..140fd0a27 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "@babel/preset-react": "^7.14.5", "body-parser": "^1.19.0", "classnames": "^2.3.1", - "codemirror": "^5.62.1", + "codemirror": "^5.62.2", "cookie-parser": "^1.4.5", "create-react-class": "^15.7.0", "dedent-tabs": "^0.9.0", @@ -3181,9 +3181,9 @@ } }, "node_modules/codemirror": { - "version": "5.62.1", - "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.62.1.tgz", - "integrity": "sha512-39ce8tHh/M9J+Epa90R5zMGg06pxVXc1+Y0SRR6eKaUjjzuj5iYkk7rHc2uU+FzvfsWYGEYKPFf0pBVBLmYXNQ==" + "version": "5.62.2", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.62.2.tgz", + "integrity": "sha512-tVFMUa4J3Q8JUd1KL9yQzQB0/BJt7ZYZujZmTPgo/54Lpuq3ez4C8x/ATUY/wv7b7X3AUq8o3Xd+2C5ZrCGWHw==" }, "node_modules/collection-visit": { "version": "1.0.0", @@ -11938,9 +11938,9 @@ } }, "codemirror": { - "version": "5.62.1", - "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.62.1.tgz", - "integrity": "sha512-39ce8tHh/M9J+Epa90R5zMGg06pxVXc1+Y0SRR6eKaUjjzuj5iYkk7rHc2uU+FzvfsWYGEYKPFf0pBVBLmYXNQ==" + "version": "5.62.2", + "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.62.2.tgz", + "integrity": "sha512-tVFMUa4J3Q8JUd1KL9yQzQB0/BJt7ZYZujZmTPgo/54Lpuq3ez4C8x/ATUY/wv7b7X3AUq8o3Xd+2C5ZrCGWHw==" }, "collection-visit": { "version": "1.0.0", diff --git a/package.json b/package.json index de6fc676b..e31d91cea 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "@babel/preset-react": "^7.14.5", "body-parser": "^1.19.0", "classnames": "^2.3.1", - "codemirror": "^5.62.1", + "codemirror": "^5.62.2", "cookie-parser": "^1.4.5", "create-react-class": "^15.7.0", "dedent-tabs": "^0.9.0", From 9f8a857cef8d262e6af44e2ab6ea7a155c39a84a Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 25 Jul 2021 16:39:29 +1200 Subject: [PATCH 24/58] Fix for Issue #1438 - style data not cloning to `/new` --- client/homebrew/pages/newPage/newPage.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/client/homebrew/pages/newPage/newPage.jsx b/client/homebrew/pages/newPage/newPage.jsx index d29a858a2..bbbf663ec 100644 --- a/client/homebrew/pages/newPage/newPage.jsx +++ b/client/homebrew/pages/newPage/newPage.jsx @@ -26,6 +26,7 @@ const NewPage = createClass({ return { brew : { text : '', + style : undefined, shareId : null, editId : null, createdAt : null, @@ -46,6 +47,7 @@ const NewPage = createClass({ return { brew : { text : this.props.brew.text || '', + style : this.props.brew.style || undefined, gDrive : false, title : this.props.brew.title || '', description : this.props.brew.description || '', From f31fe6cbf0d1204932bc14c361c497d75ce4bcc6 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Sun, 25 Jul 2021 16:54:24 +1200 Subject: [PATCH 25/58] Prepend 'CLONE:- ' to title of cloned brew --- server.js | 1 + 1 file changed, 1 insertion(+) diff --git a/server.js b/server.js index 45e073065..3b9ff6b04 100644 --- a/server.js +++ b/server.js @@ -170,6 +170,7 @@ app.get('/edit/:id', asyncHandler(async (req, res, next)=>{ //New Page app.get('/new/:id', asyncHandler(async (req, res, next)=>{ const brew = await getBrewFromId(req.params.id, 'share'); + brew.title = `CLONE:- ${brew.title}`; req.brew = brew; return next(); })); From 36627bc18877f6731e87eaabb9dfcec76871ee34 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Sun, 25 Jul 2021 16:48:59 -0400 Subject: [PATCH 26/58] code block style --- themes/5ePhb.style.less | 21 +++++++++++++++++++++ themes/assets/assets.less | 1 + themes/assets/codeBorder.png | Bin 0 -> 3276 bytes 3 files changed, 22 insertions(+) create mode 100644 themes/assets/codeBorder.png diff --git a/themes/5ePhb.style.less b/themes/5ePhb.style.less index 137fcafa9..7db001466 100644 --- a/themes/5ePhb.style.less +++ b/themes/5ePhb.style.less @@ -406,6 +406,27 @@ body { color : #c9ad6a; text-align : right; } + //************************************ + // * CODE BLOCKS + // ************************************/ + code{ + font-family: "Courier New", Courier, monospace; + font-size: 0.325; + padding: 2px 4px; + color: #58180d; + background-color: #faf7ea; + border-radius: 4px; + } + + pre code{ + width : 100%; + display : block; + border : 4px solid; + border-image : @codeBorderImage 26 stretch; + border-image-width : 10px; + border-image-outset : 2px; + border-radius : 12px; + } //***************************** // * EXTRAS // *****************************/ diff --git a/themes/assets/assets.less b/themes/assets/assets.less index 672e3261e..f159c9fc6 100644 --- a/themes/assets/assets.less +++ b/themes/assets/assets.less @@ -7,3 +7,4 @@ @descriptiveBoxImage : data-uri('./themes/assets/descriptiveBorder.png'); @monsterBlockBackground : data-uri('./themes/assets/parchmentBackgroundGrayscale.jpg'); @monsterBorderImage : data-uri('./themes/assets/monsterBorderFancy.png'); +@codeBorderImage : data-uri('./themes/assets/codeBorder.png'); diff --git a/themes/assets/codeBorder.png b/themes/assets/codeBorder.png new file mode 100644 index 0000000000000000000000000000000000000000..ac4eb8883318035146c24e655a80c928353d320f GIT binary patch literal 3276 zcmd5<`8O1d_a6H;6S5D6n6gEdk|k@DJu*nj46^T(iFplU--#^A7AZ`KGz=3$jWus} zhOtjfwz4n7*ZcV^zCS$oIp_Xz?>YC}`#d+%(&8?N9n1~@06@k@2KUeT$$wyFK92zl z*|2kB3ox<|KBuz(K0UnD*%Z^DtP*N2fH{0xGMMuxxe1H z1qJ|s_QnQ!u;&Hqg{T0SO@4dC?3WoXT?`?_>%ALs63lD>eaFMlFCJC9tVCx_R7^(< ziQf0&W7oW@$o65ZDXolcf#ix4>9#Hqa*;wTNNe8_ykh`ii*c5>M9#=#3t}08;u1Yy zW=~)EUEzRcq=9b!Ijy=sN}Cy;#Y?qKqx_0da>ZPd{7=ds`6uIbY!7RpxQTJQxINJX zLqAD=V>+Ks5i#tv9hgD#vMpY#&g6rtj09jB?nv6P{BVRXV5GGkN5V@}SkS`B+Rh;{ z2`lCR=Lt=hQR4C)n-B(RvossAp!oi?g!-TFfCVwD%fQ(XgOkd?L2n3OP@i!RXr z)s$v#2+O>95eJTYS}^`y(Zp>q;-K2&c!eZmy1v@J{wvNfrp?$Q#$vv4r;?N9r+Q6H zH_21L%Vok=GQc$^A(I=87jcC{TV2M_33PhW@m z-LQSL-lqArNxk;>9bUrtx@(7J+ODIvHD)5vBR0f^wBaR9N;Zy;v3|Ig?=xp4TD!~V zj53waAaz_HZBd5!k%t{s*|A0>lX?zG%-qc~Wxmwof$UwaD8C0-uL5`XH9PH0f>gcf40e8jgp(G_dPK9i z`ZPU289+kjtFtYVJ90#I4B!YGtEu%p+Vlw8XOUIipb5^8M~?Hln4i~#|GlyW-U6*7 zo?XYID7Uq8x2m7T$EwJu;_Aa`m(t*-x7ZKkWAf%Jg4Yj}!~qWy6n+p| zcE$mi_6D^@15&Y#vA~P`ddo!uc}+J$YHt4vGy}9YG%x8_Q!x<)p3AN(MKx@vj{qL0 z%g8AQo2EU!3QyOk!XM;3X+TBKv)vL>OEmJM%%l^58Ch8_j;`ScnsW-U3t?KyfAINQ zzFNy79=!cR!JqSQBgG%Ze_YKU<3?(IbTwts4R;O9VI6H(jP0byYPq*w-CWH)xOEAX z{jD+DLf{23Hc?k3Qa_sL{HGt$L;P39C2#kqh8{yZx9R$8iSZ@)P4=Ms-z!}G7&7@P z52jE2oXpKrnYQAS_+~$Yw(SvjnhrhxMKXo3)rZPQ307SE?9kr5u$y@g~5wr=B@)JC0l`nyuH-8j>Rp&8{f%d55ti0eP{&)Wag)J5v- zzUQYnV%XY`Wi={Gae+iT#UeVr zZf6peZlcv?aIp}J+!|1rypqRT_ts9-*wPEFRb2xWa}8h!*DK59NL-tk>SjpsVNrzy&jlOs%fx z{mEpU_{Yw?P#M!HU)}6W+R%|BFsxa3k~izVO{YiE&tnn788KZ4aN6?IKFQJ1fnxaA zK%ihpa zWGxcW{wlgb_fKpM+yMK-q2dL6Lsk&46ProXW5;x#fJ7|`=j?d!&3LgaYNVhx^U_7p z8m{!1O|8lq?=$*?yBcSjO|*eF zb25#V=*a`yU7tKGZw&E`Aiq_JV%mx}_LPI|JmfwEMRqt_PjNDR8m7SG0)edT_5Xy5 zMz7s&{{oQsD{Q)6r_;Sv&Dy3@3-wL6v*&yBMeJoPSm2=-oRa{AmOK>g--``$w-A9u zD*;*gDR0wRkF33IDqxo(PFYE5avV1l2oHX~Hf>%zZxLBRz^z(jh%v}ZpXvp!Yj!^4 zc-(B6m#vEHtVc#Yp}T9aba(m9JACd#<5JWmlOy~$?mlnf2!H3pNYR8etG;Q-)_Zg6 zFe@|HVes&f{LgCkGQ$ZM-8=Rbf4sB+A}+m5Vii1=&w( zt3L3j=j_70@rD z(*_O0U-X(aM+;pIMy|O31k*4y>4)b$K18lYTJE6TU7&9qYl97tx<_9sG5Ki|{X|mN z(c-Alyw8vEqTw^N{R|oO1!AuQ%`41LH(?6s>N0V#Bb~6d%Z+}UtRk>V_h$B=WPaAV zLe;O$Ga?hPhxI-K04WhApDNaUK zP>75J$4U82k{nh0_P)Vos7m8fUc#-ZS6?6UCgzS_7lT#M6XIN-ISkad4Lb?<0czP@ ze|v*A2&*4W*wTSb*nf+_ zl`W2V6?cn2u?^?v871+mUFJq*f@(zZ21pgg*9J0U$SGS(?n16jIZTnsFLGY0)jwU! zv-007=X@VHN8@xC(b}7={~FD_UJ&5Y+h(vpugzy$c4X^@US0o5*{mD-_07^LS9&<| z#^X_o{0wlYJ@2WIVoHl2Y-yQsF11@&i=-d2e>tK!CSl+=YisZ#uDU2^tjt>Py1ESd zckCGLSn_{FG^kr&v%;H<|~$}L@mkyc64^}E)pJ(P`sk0gaR5Fkm)RMs5qZ{>F-fnRk&6jtoG5%v7}V$^qW%wC!ZjWM literal 0 HcmV?d00001 From c6d0a2e2add5b0ff89ae51572b179e8459df275c Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Mon, 26 Jul 2021 09:55:04 +1200 Subject: [PATCH 27/58] Make WelcomeText and ChangeLogText conditional --- server.js | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 45e073065..32576e4f6 100644 --- a/server.js +++ b/server.js @@ -105,6 +105,18 @@ app.get('/robots.txt', (req, res)=>{ return res.sendFile(`${__dirname}/robots.txt`); }); +//Home page +app.get('/', async (req, res, next)=>{ + req.welcomeText = welcomeText; + return next(); +}); + +//Changelog page +app.get('/changelog', async (req, res, next)=>{ + req.changelogText = changelogText; + return next(); +}); + //Source page app.get('/source/:id', asyncHandler(async (req, res)=>{ const brew = await getBrewFromId(req.params.id, 'raw'); @@ -204,8 +216,8 @@ app.use((req, res)=>{ const props = { version : require('./package.json').version, url : req.originalUrl, - welcomeText : welcomeText, - changelog : changelogText, + welcomeText : req.welcomeText, + changelog : req.changelogText, brew : req.brew, brews : req.brews, googleBrews : req.googleBrews, From 7eb63db502ad88e910cf940bb946eb9bf75ecd77 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Mon, 26 Jul 2021 10:05:43 +1200 Subject: [PATCH 28/58] Clean up link validation in template --- client/template.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/template.js b/client/template.js index 6307b744b..e2e0893e3 100644 --- a/client/template.js +++ b/client/template.js @@ -5,15 +5,15 @@ module.exports = async(name, title = '', props = {})=>{ - + ${title.length ? `${title} - The Homebrewery`: 'The Homebrewery - NaturalCrit'}
${require(`../build/${name}/ssr.js`)(props)}
+ + - - `; }; From 495a68893dc4d3abc9f47bdd0cf27010ca61fac7 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Mon, 26 Jul 2021 20:52:23 +1200 Subject: [PATCH 29/58] Initial pass at sorting User brews --- client/homebrew/pages/userPage/userPage.jsx | 132 ++++++++++++++++++- client/homebrew/pages/userPage/userPage.less | 27 ++++ 2 files changed, 157 insertions(+), 2 deletions(-) diff --git a/client/homebrew/pages/userPage/userPage.jsx b/client/homebrew/pages/userPage/userPage.jsx index e6b7530b8..3dd7cbef2 100644 --- a/client/homebrew/pages/userPage/userPage.jsx +++ b/client/homebrew/pages/userPage/userPage.jsx @@ -24,7 +24,15 @@ const UserPage = createClass({ getDefaultProps : function() { return { username : '', - brews : [] + brews : [], + sortType : 'alpha', + sortDir : 'desc' + }; + }, + getInitialState : function() { + return { + sortType : 'alpha', + sortDir : 'desc' }; }, getUsernameWithS : function() { @@ -36,13 +44,132 @@ const UserPage = createClass({ renderBrews : function(brews){ if(!brews || !brews.length) return
No Brews.
; - const sortedBrews = _.sortBy(brews, (brew)=>{ return brew.title; }); + const sortedBrews = this.sortBrews(brews, this.state.sortType); return _.map(sortedBrews, (brew, idx)=>{ return ; }); }, + sortBrews : function(brews, sortType){ + if(sortType == 'alpha') { + return _.orderBy(brews, (brew)=>{ return brew.title; }, this.state.sortDir); + } + if(sortType == 'created'){ + return _.orderBy(brews, (brew)=>{ return brew.createdAt; }, this.state.sortDir); + } + if(sortType == 'updated'){ + return _.orderBy(brews, (brew)=>{ return brew.updatedAt; }, this.state.sortDir); + } + if(sortType == 'views'){ + return _.orderBy(brews, (brew)=>{ return brew.views; }, this.state.sortDir); + } + if(sortType == 'latest'){ + return _.orderBy(brews, (brew)=>{ return brew.lastViewed; }, this.state.sortDir); + } + return _.orderBy(brews, (brew)=>{ return brew.title; }, this.state.sortDir); + }, + + handleSortOptionChange : function(event){ + this.setState({ + sortType : event.target.value + }); + }, + + handleSortDirChange : function(event){ + const newDir = (this.state.sortDir == 'asc' ? 'desc' : 'asc'); + this.setState({ + sortDir : `${newDir}` + }); + }, + + renderSortOptions : function(){ + return
+ + + + + + + + + + + +
+
Sort Type :
+
+ + + + + + + + + + +
Direction :
+
+ +
+
; + }, + getSortedBrews : function(){ return _.groupBy(this.props.brews, (brew)=>{ return (brew.published ? 'published' : 'private'); @@ -63,6 +190,7 @@ const UserPage = createClass({
+ {this.renderSortOptions()}

{this.getUsernameWithS()} brews

{this.renderBrews(brews.published)} diff --git a/client/homebrew/pages/userPage/userPage.less b/client/homebrew/pages/userPage/userPage.less index d002966de..77f11e564 100644 --- a/client/homebrew/pages/userPage/userPage.less +++ b/client/homebrew/pages/userPage/userPage.less @@ -30,4 +30,31 @@ } } + .sort-container{ + font-family : 'Open Sans', sans-serif; + position : fixed; + top : 35px; + border : 2px solid #58180D; + width : 675px; + background-color : #EEE5CE; + padding : 2px; + text-align : center; + z-index : 15; + h6{ + text-transform : uppercase; + font-family : 'Open Sans', sans-serif; + font-size : 11px; + font-weight : bold; + color : #58180D; + } + button{ + background-color : #58180D; + border : 5px double white; + width : 75px; + } + table{ + margin-top : 1px; + margin-bottom : 0; + } + } } From 48e80803f7be45decdeb63cb9939407150c9e73d Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Mon, 26 Jul 2021 21:33:20 +1200 Subject: [PATCH 30/58] Ignore case when ordering by title ( a > B ) --- client/homebrew/pages/userPage/userPage.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/pages/userPage/userPage.jsx b/client/homebrew/pages/userPage/userPage.jsx index 3dd7cbef2..2b1726dbc 100644 --- a/client/homebrew/pages/userPage/userPage.jsx +++ b/client/homebrew/pages/userPage/userPage.jsx @@ -53,7 +53,7 @@ const UserPage = createClass({ sortBrews : function(brews, sortType){ if(sortType == 'alpha') { - return _.orderBy(brews, (brew)=>{ return brew.title; }, this.state.sortDir); + return _.orderBy(brews, (brew)=>{ return brew.title.toLowerCase(); }, this.state.sortDir); } if(sortType == 'created'){ return _.orderBy(brews, (brew)=>{ return brew.createdAt; }, this.state.sortDir); @@ -67,7 +67,7 @@ const UserPage = createClass({ if(sortType == 'latest'){ return _.orderBy(brews, (brew)=>{ return brew.lastViewed; }, this.state.sortDir); } - return _.orderBy(brews, (brew)=>{ return brew.title; }, this.state.sortDir); + return _.orderBy(brews, (brew)=>{ return brew.title.toLowerCase(); }, this.state.sortDir); }, handleSortOptionChange : function(event){ From c91e5784acb33c833d110e9b59fe11763a353bba Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Mon, 26 Jul 2021 21:38:22 +1200 Subject: [PATCH 31/58] Change to Unicode characters for asc/desc arrows --- client/homebrew/pages/userPage/userPage.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/homebrew/pages/userPage/userPage.jsx b/client/homebrew/pages/userPage/userPage.jsx index 2b1726dbc..ff3ea9121 100644 --- a/client/homebrew/pages/userPage/userPage.jsx +++ b/client/homebrew/pages/userPage/userPage.jsx @@ -162,7 +162,7 @@ const UserPage = createClass({ From 54d0e2c483648d5c90e2eb7730a16f9e29da060a Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Mon, 26 Jul 2021 22:08:54 +1200 Subject: [PATCH 32/58] Add Lodash deburr to sorting by title --- client/homebrew/pages/userPage/userPage.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/pages/userPage/userPage.jsx b/client/homebrew/pages/userPage/userPage.jsx index ff3ea9121..9dd72c2ca 100644 --- a/client/homebrew/pages/userPage/userPage.jsx +++ b/client/homebrew/pages/userPage/userPage.jsx @@ -53,7 +53,7 @@ const UserPage = createClass({ sortBrews : function(brews, sortType){ if(sortType == 'alpha') { - return _.orderBy(brews, (brew)=>{ return brew.title.toLowerCase(); }, this.state.sortDir); + return _.orderBy(brews, (brew)=>{ return _.deburr(brew.title.toLowerCase()); }, this.state.sortDir); } if(sortType == 'created'){ return _.orderBy(brews, (brew)=>{ return brew.createdAt; }, this.state.sortDir); @@ -67,7 +67,7 @@ const UserPage = createClass({ if(sortType == 'latest'){ return _.orderBy(brews, (brew)=>{ return brew.lastViewed; }, this.state.sortDir); } - return _.orderBy(brews, (brew)=>{ return brew.title.toLowerCase(); }, this.state.sortDir); + return _.orderBy(brews, (brew)=>{ return _.deburr(brew.title.toLowerCase()); }, this.state.sortDir); }, handleSortOptionChange : function(event){ From b80a249cf7cd193e0d8d3761dd9db35aef9dd426 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Mon, 26 Jul 2021 22:40:01 +1200 Subject: [PATCH 33/58] Reduce code duplication in sorting radio options --- client/homebrew/pages/userPage/userPage.jsx | 88 ++++++--------------- 1 file changed, 22 insertions(+), 66 deletions(-) diff --git a/client/homebrew/pages/userPage/userPage.jsx b/client/homebrew/pages/userPage/userPage.jsx index 9dd72c2ca..b32e09f79 100644 --- a/client/homebrew/pages/userPage/userPage.jsx +++ b/client/homebrew/pages/userPage/userPage.jsx @@ -83,6 +83,22 @@ const UserPage = createClass({ }); }, + renderSortRadioOption : function(sortTitle, sortValue){ + return + + ; + }, + renderSortOptions : function(){ return
@@ -90,72 +106,12 @@ const UserPage = createClass({ - - - - - - ; }, renderSortOptions : function(){ return
Sort Type :
- - - - - - - - - - + {this.renderSortRadioOption('Title', 'alpha')} + {this.renderSortRadioOption('Created Date', 'created')} + {this.renderSortRadioOption('Updated Date', 'updated')} + {this.renderSortRadioOption('Views', 'views')} + {/* {this.renderSortRadioOption('Latest', 'latest')} */} +
Direction :
From 1031e8a55a4e2147aa3c49092a2938556583a46b Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Tue, 27 Jul 2021 23:14:05 +1200 Subject: [PATCH 34/58] Changed from Radios to Buttons --- client/homebrew/pages/userPage/userPage.jsx | 98 +++++++++----------- client/homebrew/pages/userPage/userPage.less | 27 ++++-- 2 files changed, 65 insertions(+), 60 deletions(-) diff --git a/client/homebrew/pages/userPage/userPage.jsx b/client/homebrew/pages/userPage/userPage.jsx index b32e09f79..f9a761bab 100644 --- a/client/homebrew/pages/userPage/userPage.jsx +++ b/client/homebrew/pages/userPage/userPage.jsx @@ -25,14 +25,12 @@ const UserPage = createClass({ return { username : '', brews : [], - sortType : 'alpha', - sortDir : 'desc' }; }, getInitialState : function() { return { sortType : 'alpha', - sortDir : 'desc' + sortDir : 'asc' }; }, getUsernameWithS : function() { @@ -51,23 +49,19 @@ const UserPage = createClass({ }); }, - sortBrews : function(brews, sortType){ - if(sortType == 'alpha') { - return _.orderBy(brews, (brew)=>{ return _.deburr(brew.title.toLowerCase()); }, this.state.sortDir); - } - if(sortType == 'created'){ - return _.orderBy(brews, (brew)=>{ return brew.createdAt; }, this.state.sortDir); - } - if(sortType == 'updated'){ - return _.orderBy(brews, (brew)=>{ return brew.updatedAt; }, this.state.sortDir); - } - if(sortType == 'views'){ - return _.orderBy(brews, (brew)=>{ return brew.views; }, this.state.sortDir); - } - if(sortType == 'latest'){ - return _.orderBy(brews, (brew)=>{ return brew.lastViewed; }, this.state.sortDir); - } - return _.orderBy(brews, (brew)=>{ return _.deburr(brew.title.toLowerCase()); }, this.state.sortDir); + sortBrewOrder : function(brew){ + const mapping = { + 'alpha' : _.deburr(brew.title.toLowerCase()), + 'created' : brew.createdAt, + 'updated' : brew.updatedAt, + 'views' : brew.views, + 'latest' : brew.lastViewed + }; + return mapping[this.state.sortType]; + }, + + sortBrews : function(brews){ + return _.orderBy(brews, (brew)=>{ return this.sortBrewOrder(brew); }, this.state.sortDir); }, handleSortOptionChange : function(event){ @@ -77,51 +71,49 @@ const UserPage = createClass({ }, handleSortDirChange : function(event){ - const newDir = (this.state.sortDir == 'asc' ? 'desc' : 'asc'); this.setState({ - sortDir : `${newDir}` + sortDir : `${(this.state.sortDir == 'asc' ? 'desc' : 'asc')}` }); }, - renderSortRadioOption : function(sortTitle, sortValue){ + renderSortOption : function(sortTitle, sortValue){ return - + onClick={this.handleSortOptionChange} + className={`${(this.state.sortType == sortValue ? 'active' : '')}`} + > + {`${sortTitle}`} +
- - - {this.renderSortRadioOption('Title', 'alpha')} - {this.renderSortRadioOption('Created Date', 'created')} - {this.renderSortRadioOption('Updated Date', 'updated')} - {this.renderSortRadioOption('Views', 'views')} - {/* {this.renderSortRadioOption('Latest', 'latest')} */} - - - + + + + {this.renderSortOption('Title', 'alpha')} + {this.renderSortOption('Created Date', 'created')} + {this.renderSortOption('Updated Date', 'updated')} + {this.renderSortOption('Views', 'views')} + {/* {this.renderSortOption('Latest', 'latest')} */} + + + +
-
Sort Type :
-
-
Direction :
-
- -
+
Sort by :
+
+
Direction :
+
+ +
; }, diff --git a/client/homebrew/pages/userPage/userPage.less b/client/homebrew/pages/userPage/userPage.less index 77f11e564..c7e8621e3 100644 --- a/client/homebrew/pages/userPage/userPage.less +++ b/client/homebrew/pages/userPage/userPage.less @@ -47,14 +47,27 @@ font-weight : bold; color : #58180D; } - button{ - background-color : #58180D; - border : 5px double white; - width : 75px; - } table{ - margin-top : 1px; - margin-bottom : 0; + margin : 0px; + vertical-align : middle; + tbody tr{ + background-color: transparent !important; + button{ + background-color : transparent; + color : #58180D; + font-family : 'Open Sans', sans-serif; + font-size : 11px; + text-transform : uppercase; + font-weight : normal; + &.active{ + font-weight : bold; + border : 2px solid #58180D; + } + &.sortDir{ + width : 75px; + } + } + } } } } From caf151a0dd6d943857c7673d697148f9cad234d4 Mon Sep 17 00:00:00 2001 From: Sean Robertson Date: Wed, 28 Jul 2021 15:25:17 +1200 Subject: [PATCH 35/58] Initial code pass to not display "Source" and "Get PDF" NavBar buttons on the `/changelog` page. --- client/homebrew/homebrew.jsx | 2 +- client/homebrew/pages/sharePage/sharePage.jsx | 28 +++++++++++++------ 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/client/homebrew/homebrew.jsx b/client/homebrew/homebrew.jsx index 94131b1dd..d3cc1e824 100644 --- a/client/homebrew/homebrew.jsx +++ b/client/homebrew/homebrew.jsx @@ -48,7 +48,7 @@ const Homebrew = createClass({ }/> } /> } /> - }/> + }/> }/>
diff --git a/client/homebrew/pages/sharePage/sharePage.jsx b/client/homebrew/pages/sharePage/sharePage.jsx index 82b948675..3e51aafb0 100644 --- a/client/homebrew/pages/sharePage/sharePage.jsx +++ b/client/homebrew/pages/sharePage/sharePage.jsx @@ -25,7 +25,9 @@ const SharePage = createClass({ updatedAt : null, views : 0, renderer : '' - } + }, + showSource : true, + showPrint : true }; }, @@ -79,6 +81,21 @@ const SharePage = createClass({
; }, + renderPrint : function(){ + if(!this.state.showPrint) return; + return ; + } + + renderSourceDropdown : function(){ + if(!this.state.showSource) return; + return this.handleDropdown(true)} + onMouseLeave={()=>this.handleDropdown(false)}> + source + {this.renderDropdown()} + ; + }, + render : function(){ return
@@ -88,13 +105,8 @@ const SharePage = createClass({ - - this.handleDropdown(true)} - onMouseLeave={()=>this.handleDropdown(false)}> - source - {this.renderDropdown()} - + {this.renderPrint()} + {this.renderSourceDropdown()} From 189fdb45551efad5a4bf9d51472b4abf0809e7df Mon Sep 17 00:00:00 2001 From: Sean Robertson Date: Wed, 28 Jul 2021 15:29:04 +1200 Subject: [PATCH 36/58] Missed a vital comma. --- client/homebrew/pages/sharePage/sharePage.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/homebrew/pages/sharePage/sharePage.jsx b/client/homebrew/pages/sharePage/sharePage.jsx index 3e51aafb0..1b714a147 100644 --- a/client/homebrew/pages/sharePage/sharePage.jsx +++ b/client/homebrew/pages/sharePage/sharePage.jsx @@ -84,7 +84,7 @@ const SharePage = createClass({ renderPrint : function(){ if(!this.state.showPrint) return; return ; - } + }, renderSourceDropdown : function(){ if(!this.state.showSource) return; From fa5bd92406f4aeedd375172df2cc5872bd1348ca Mon Sep 17 00:00:00 2001 From: Sean Robertson Date: Wed, 28 Jul 2021 15:37:36 +1200 Subject: [PATCH 37/58] Shift check to presence of `this.props.brew.shareId`. Revert changes to Homebrew.jsx. --- client/homebrew/homebrew.jsx | 2 +- client/homebrew/pages/sharePage/sharePage.jsx | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/client/homebrew/homebrew.jsx b/client/homebrew/homebrew.jsx index d3cc1e824..94131b1dd 100644 --- a/client/homebrew/homebrew.jsx +++ b/client/homebrew/homebrew.jsx @@ -48,7 +48,7 @@ const Homebrew = createClass({ }/> } /> } /> - }/> + }/> }/>
diff --git a/client/homebrew/pages/sharePage/sharePage.jsx b/client/homebrew/pages/sharePage/sharePage.jsx index 1b714a147..f8e19a8d1 100644 --- a/client/homebrew/pages/sharePage/sharePage.jsx +++ b/client/homebrew/pages/sharePage/sharePage.jsx @@ -25,9 +25,7 @@ const SharePage = createClass({ updatedAt : null, views : 0, renderer : '' - }, - showSource : true, - showPrint : true + } }; }, @@ -82,12 +80,12 @@ const SharePage = createClass({ }, renderPrint : function(){ - if(!this.state.showPrint) return; + if(!this.props.brew.shareId) return; return ; }, renderSourceDropdown : function(){ - if(!this.state.showSource) return; + if(!this.props.brew.shareId) return; return this.handleDropdown(true)} onMouseLeave={()=>this.handleDropdown(false)}> From 6238ed6b779535bf7a44153fd1c4999d53f06c65 Mon Sep 17 00:00:00 2001 From: Sean Robertson Date: Wed, 28 Jul 2021 16:04:28 +1200 Subject: [PATCH 38/58] Further simplification of code. --- client/homebrew/pages/sharePage/sharePage.jsx | 24 ++++++------------- 1 file changed, 7 insertions(+), 17 deletions(-) diff --git a/client/homebrew/pages/sharePage/sharePage.jsx b/client/homebrew/pages/sharePage/sharePage.jsx index f8e19a8d1..6c0771a74 100644 --- a/client/homebrew/pages/sharePage/sharePage.jsx +++ b/client/homebrew/pages/sharePage/sharePage.jsx @@ -79,21 +79,6 @@ const SharePage = createClass({
; }, - renderPrint : function(){ - if(!this.props.brew.shareId) return; - return ; - }, - - renderSourceDropdown : function(){ - if(!this.props.brew.shareId) return; - return this.handleDropdown(true)} - onMouseLeave={()=>this.handleDropdown(false)}> - source - {this.renderDropdown()} - ; - }, - render : function(){ return
@@ -103,8 +88,13 @@ const SharePage = createClass({ - {this.renderPrint()} - {this.renderSourceDropdown()} + {this.props.shareId && + this.handleDropdown(true)} + onMouseLeave={()=>this.handleDropdown(false)}> + source + {this.renderDropdown()} + } From 72d8b5ea1655a981b939891c66eda8b07d095f98 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Wed, 28 Jul 2021 17:10:53 +1200 Subject: [PATCH 39/58] Linter fixes; correction of condtional JSX element --- client/homebrew/pages/sharePage/sharePage.jsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/client/homebrew/pages/sharePage/sharePage.jsx b/client/homebrew/pages/sharePage/sharePage.jsx index 6c0771a74..3ea1629af 100644 --- a/client/homebrew/pages/sharePage/sharePage.jsx +++ b/client/homebrew/pages/sharePage/sharePage.jsx @@ -88,13 +88,15 @@ const SharePage = createClass({ - {this.props.shareId && - this.handleDropdown(true)} - onMouseLeave={()=>this.handleDropdown(false)}> - source - {this.renderDropdown()} - } + {this.props.shareId && <> + + this.handleDropdown(true)} + onMouseLeave={()=>this.handleDropdown(false)}> + source + {this.renderDropdown()} + + } From acb750c18a0bc0ae3739963ebadc0fa455b35fbd Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Wed, 28 Jul 2021 17:15:38 +1200 Subject: [PATCH 40/58] Fix logic for enabling Source and Get PDF --- client/homebrew/pages/sharePage/sharePage.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/homebrew/pages/sharePage/sharePage.jsx b/client/homebrew/pages/sharePage/sharePage.jsx index 3ea1629af..5adc25bda 100644 --- a/client/homebrew/pages/sharePage/sharePage.jsx +++ b/client/homebrew/pages/sharePage/sharePage.jsx @@ -88,7 +88,7 @@ const SharePage = createClass({ - {this.props.shareId && <> + {this.props.brew.shareId && <> this.handleDropdown(true)} From 7fa1e16b5a4129295497725b4d4adcab37724658 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Wed, 28 Jul 2021 17:51:35 +1200 Subject: [PATCH 41/58] Create minimal Changelog brew --- client/homebrew/homebrew.jsx | 2 +- client/homebrew/pages/homePage/homePage.jsx | 2 -- server.js | 6 +++++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/client/homebrew/homebrew.jsx b/client/homebrew/homebrew.jsx index 94131b1dd..164369083 100644 --- a/client/homebrew/homebrew.jsx +++ b/client/homebrew/homebrew.jsx @@ -48,7 +48,7 @@ const Homebrew = createClass({ }/> } /> } /> - }/> + }/> }/>
diff --git a/client/homebrew/pages/homePage/homePage.jsx b/client/homebrew/pages/homePage/homePage.jsx index d1e749482..6349883f2 100644 --- a/client/homebrew/pages/homePage/homePage.jsx +++ b/client/homebrew/pages/homePage/homePage.jsx @@ -28,8 +28,6 @@ const HomePage = createClass({ welcomeText : '', ver : '0.0.0' }; - - }, getInitialState : function() { return { diff --git a/server.js b/server.js index 32576e4f6..a508a6e42 100644 --- a/server.js +++ b/server.js @@ -113,7 +113,11 @@ app.get('/', async (req, res, next)=>{ //Changelog page app.get('/changelog', async (req, res, next)=>{ - req.changelogText = changelogText; + const brew = { + title : 'Changelog', + text : changelogText + }; + req.brew = brew; return next(); }); From 0818a3485a5025b0784876469ee9aecb3be9809f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 29 Jul 2021 03:00:58 +0000 Subject: [PATCH 42/58] Bump mongoose from 5.13.3 to 5.13.4 Bumps [mongoose](https://github.com/Automattic/mongoose) from 5.13.3 to 5.13.4. - [Release notes](https://github.com/Automattic/mongoose/releases) - [Changelog](https://github.com/Automattic/mongoose/blob/master/History.md) - [Commits](https://github.com/Automattic/mongoose/compare/5.13.3...5.13.4) --- updated-dependencies: - dependency-name: mongoose dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- package-lock.json | 16 +++++++++------- package.json | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index 140fd0a27..31e336cb7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,7 +30,7 @@ "marked": "2.1.3", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.29.1", - "mongoose": "^5.13.3", + "mongoose": "^5.13.4", "nanoid": "3.1.23", "nconf": "^0.11.3", "prop-types": "15.7.2", @@ -6376,9 +6376,9 @@ } }, "node_modules/mongoose": { - "version": "5.13.3", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.13.3.tgz", - "integrity": "sha512-q+zX6kqHAvwxf5speMWhq6qF4vdj+x6/kfD5RSKdZKNm52yGmaUygN+zgrtQjBZPFEzG0B3vF6GP0PoAGadE+w==", + "version": "5.13.4", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.13.4.tgz", + "integrity": "sha512-D1yVHAOa+G8iQZsC/nNzZe+CI1FCYu6Qk384s1vSyaSfKCu/alKeyL78BA73SsxeRKT9zmswSIueLbGBURjrKg==", "dependencies": { "@types/mongodb": "^3.5.27", "@types/node": "14.x || 15.x", @@ -6389,6 +6389,7 @@ "mpath": "0.8.3", "mquery": "3.2.5", "ms": "2.1.2", + "optional-require": "1.0.x", "regexp-clone": "1.0.0", "safe-buffer": "5.2.1", "sift": "13.5.2", @@ -14455,9 +14456,9 @@ } }, "mongoose": { - "version": "5.13.3", - "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.13.3.tgz", - "integrity": "sha512-q+zX6kqHAvwxf5speMWhq6qF4vdj+x6/kfD5RSKdZKNm52yGmaUygN+zgrtQjBZPFEzG0B3vF6GP0PoAGadE+w==", + "version": "5.13.4", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-5.13.4.tgz", + "integrity": "sha512-D1yVHAOa+G8iQZsC/nNzZe+CI1FCYu6Qk384s1vSyaSfKCu/alKeyL78BA73SsxeRKT9zmswSIueLbGBURjrKg==", "requires": { "@types/mongodb": "^3.5.27", "@types/node": "14.x || 15.x", @@ -14468,6 +14469,7 @@ "mpath": "0.8.3", "mquery": "3.2.5", "ms": "2.1.2", + "optional-require": "1.0.x", "regexp-clone": "1.0.0", "safe-buffer": "5.2.1", "sift": "13.5.2", diff --git a/package.json b/package.json index e31d91cea..a363b6db8 100644 --- a/package.json +++ b/package.json @@ -61,7 +61,7 @@ "marked": "2.1.3", "markedLegacy": "npm:marked@^0.3.19", "moment": "^2.29.1", - "mongoose": "^5.13.3", + "mongoose": "^5.13.4", "nanoid": "3.1.23", "nconf": "^0.11.3", "prop-types": "15.7.2", From d9c83379fef87e4cebef05f305e4e18b927aa2c2 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 28 Jul 2021 23:26:12 -0400 Subject: [PATCH 43/58] Add "inject style" syntax, for use with images, headers, etc. --- shared/naturalcrit/markdown.js | 87 +++++++++++++++++++++++++++++++--- themes/5ePhb.style.less | 1 + 2 files changed, 82 insertions(+), 6 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 37784f740..0d5d67e09 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -31,7 +31,7 @@ const mustacheSpans = { start(src) { return src.match(/{{[^{]/)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { const completeSpan = /^{{[^\n]*}}/; // Regex for the complete token - const inlineRegex = /{{(?:="[\w,\-. ]*"|[^"'{}\s])*\s*|}}/g; + const inlineRegex = /{{(?:="[\w,\-(). ]*"|[^"'{}\s])*\s*|}}/g; const match = completeSpan.exec(src); if(match) { //Find closing delimiter @@ -77,7 +77,7 @@ const mustacheDivs = { start(src) { return src.match(/^ *{{[^{]/m)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { const completeBlock = /^ *{{.*\n *}}/s; // Regex for the complete token - const blockRegex = /^ *{{(?:="[\w,\-. ]*"|[^"'{}\s])*$|^ *}}$/gm; + const blockRegex = /^ *{{(?:="[\w,\-(). ]*"|[^"'{}\s])*$|^ *}}$/gm; const match = completeBlock.exec(src); if(match) { //Find closing delimiter @@ -116,6 +116,82 @@ const mustacheDivs = { } }; +const mustacheInjectInline = { + name : 'mustacheInjectInline', + level : 'inline', + start(src) { return src.match(/ *{[^{\n]/)?.index; }, // Hint to Marked.js to stop and check for a match + tokenizer(src, tokens) { + const inlineRegex = /^ *{((?:="[\w,\-(). ]*"|[^"'{}\s])*)}/g; + const match = inlineRegex.exec(src); + if(match) { + const lastToken = tokens[tokens.length - 1]; + if(!lastToken) + return false; + + const tags = ` ${processStyleTags(match[1])}`; + lastToken.originalType = lastToken.type; + lastToken.type = 'mustacheInjectInline'; + lastToken.tags = tags; + return { + type : 'text', // Should match "name" above + raw : match[0], // Text to consume from the source + text : '' + }; + } + }, + renderer(token) { + token.type = token.originalType; + const text = this.parseInline([token]); + const openingTag = /(<[^\s<>]+)([^\n<>]*>.*)/s.exec(text); + if(openingTag) { + return `${openingTag[1]} class="${token.tags}${openingTag[2]}`; + } + return text; + } +}; + +const mustacheInjectBlock = { + extensions : [{ + name : 'mustacheInjectBlock', + level : 'block', + start(src) { return src.match(/^ *{[^{\n]/m)?.index; }, // Hint to Marked.js to stop and check for a match + tokenizer(src, tokens) { + const inlineRegex = /^ *{((?:="[\w,\-(). ]*"|[^"'{}\s])*)}/ym; + const match = inlineRegex.exec(src); + if(match) { + const lastToken = tokens[tokens.length - 1]; + if(!lastToken) + return false; + + lastToken.originalType = 'mustacheInjectBlock'; + lastToken.tags = ` ${processStyleTags(match[1])}`; + return { + type : 'text', // Should match "name" above + raw : match[0], // Text to consume from the source + text : '' + }; + } + }, + renderer(token) { + token.type = token.originalType; + const text = this.parse([token]); + const openingTag = /(<[^\s<>]+)([^\n<>]*>.*)/s.exec(text); + if(openingTag) { + return `${openingTag[1]} class="${token.tags}${openingTag[2]}`; + } + return text; + } + }], + walkTokens(token) { + // After token tree is finished, tag tokens to apply styles to so Renderer can find them + // Does not work with tables since Marked.js tables generate invalid "tokens", and changing "type" ruins Marked handling that edge-case + if(token.originalType == 'mustacheInjectBlock' && token.type !== 'table') { + token.originalType = token.type; + token.type = 'mustacheInjectBlock'; + } + } +}; + const definitionLists = { name : 'definitionLists', level : 'block', @@ -125,13 +201,11 @@ const definitionLists = { let match; let endIndex = 0; const definitions = []; - //if(!src.match(/^[^\n]*?::/)) {console.log('return'); return;} while (match = regex.exec(src)) { definitions.push({ dt : this.inlineTokens(match[1].trim()), dd : this.inlineTokens(match[2].trim()) }); - //console.log(regexl) endIndex = regex.lastIndex; } if(definitions.length) { @@ -146,13 +220,14 @@ const definitionLists = { return `
${token.definitions.reduce((html, def)=>{ return `${html}
${this.parseInline(def.dt)}
` - + `
${this.parseInline(def.dd)}
\n`; + + `
${this.parseInline(def.dd)}
\n`; }, '')}
`; } }; -Markdown.use({ extensions: [mustacheSpans, mustacheDivs, definitionLists] }); +Markdown.use({ extensions: [mustacheSpans, mustacheDivs, mustacheInjectInline, definitionLists] }); +Markdown.use(mustacheInjectBlock); //Fix local links in the Preview iFrame to link inside the frame renderer.link = function (href, title, text) { diff --git a/themes/5ePhb.style.less b/themes/5ePhb.style.less index 7db001466..a1395554d 100644 --- a/themes/5ePhb.style.less +++ b/themes/5ePhb.style.less @@ -604,6 +604,7 @@ body { } .inline { display : inline-block; + text-indent : initial; } div { column-gap : 0.5cm; //Default spacing if a div uses multicolumns From 4e2a3cc5bef2492c639f7e5daf6a8672e9a11c63 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 28 Jul 2021 23:42:51 -0400 Subject: [PATCH 44/58] Update image snippets to be pure markdown --- client/homebrew/editor/snippetbar/snippets/snippets.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js index 6ecae9429..9abedcf28 100644 --- a/client/homebrew/editor/snippetbar/snippets/snippets.js +++ b/client/homebrew/editor/snippetbar/snippets/snippets.js @@ -51,16 +51,13 @@ module.exports = [ name : 'Image', icon : 'fas fa-image', gen : dedent` - + ![cat warrior](https://s-media-cache-ak0.pinimg.com/736x/4a/81/79/4a8179462cfdf39054a418efd4cb743e.jpg) {width="325px"} Credit: Kyounghwan Kim` }, { name : 'Background Image', icon : 'fas fa-tree', - gen : `` + gen : `![homebrew mug](http://i.imgur.com/hMna6G0.png) {position="absolute",top="50px",right="30px",width="280px"}` }, { name : 'QR Code', From 8bd09e58cb41be7f2e3468ac67b9fea9981395f0 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 28 Jul 2021 23:55:22 -0400 Subject: [PATCH 45/58] Smartypants setting to show left and right quote marks. --- shared/naturalcrit/markdown.js | 1 + 1 file changed, 1 insertion(+) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 0d5d67e09..a154d6631 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -228,6 +228,7 @@ const definitionLists = { Markdown.use({ extensions: [mustacheSpans, mustacheDivs, mustacheInjectInline, definitionLists] }); Markdown.use(mustacheInjectBlock); +Markdown.use({ smartypants: true }); //Fix local links in the Preview iFrame to link inside the frame renderer.link = function (href, title, text) { From e237cd8be4f5749e5a485ef93a7bb3cc5b57db56 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Wed, 28 Jul 2021 23:55:56 -0400 Subject: [PATCH 46/58] Remove artificial spacing between mustache divs. --- shared/naturalcrit/markdown.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index a154d6631..580ba5b5a 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -327,9 +327,7 @@ module.exports = { marked : Markdown, render : (rawBrewText)=>{ rawBrewText = rawBrewText.replace(/^\\column$/gm, `
`) - .replace(/^(:+)$/gm, (match)=>`${`
`.repeat(match.length)}\n`) - .replace(/^}}/gm, '\n}}') - .replace(/^({{[^\n]*)$/gm, '$1\n'); + .replace(/^(:+)$/gm, (match)=>`${`
`.repeat(match.length)}\n`); return Markdown( sanatizeScriptTags(rawBrewText), { renderer: renderer } From fdfea3661422940d728d2463729101d3917f6e08 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Thu, 29 Jul 2021 19:00:26 +1200 Subject: [PATCH 47/58] Shift HomePage to use a minimal brew --- client/homebrew/homebrew.jsx | 8 ++++---- client/homebrew/pages/homePage/homePage.jsx | 12 +++++------- server.js | 6 +++++- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/client/homebrew/homebrew.jsx b/client/homebrew/homebrew.jsx index 164369083..118c21e91 100644 --- a/client/homebrew/homebrew.jsx +++ b/client/homebrew/homebrew.jsx @@ -44,12 +44,12 @@ const Homebrew = createClass({ }/> }/> }/> - }/> + }/> }/> - } /> - } /> + }/> + }/> }/> - }/> + }/>
diff --git a/client/homebrew/pages/homePage/homePage.jsx b/client/homebrew/pages/homePage/homePage.jsx index 6349883f2..c89f6c95b 100644 --- a/client/homebrew/pages/homePage/homePage.jsx +++ b/client/homebrew/pages/homePage/homePage.jsx @@ -23,17 +23,15 @@ const HomePage = createClass({ getDefaultProps : function() { return { brew : { - text : '' + text : '', + welcomeText : '' }, - welcomeText : '', - ver : '0.0.0' + ver : '0.0.0' }; }, getInitialState : function() { return { - brew : { - text : this.props.welcomeText - } + brew : this.props.brew }; }, handleSave : function(){ @@ -87,7 +85,7 @@ const HomePage = createClass({
-
+
Save current
diff --git a/server.js b/server.js index a508a6e42..6d3006016 100644 --- a/server.js +++ b/server.js @@ -107,7 +107,11 @@ app.get('/robots.txt', (req, res)=>{ //Home page app.get('/', async (req, res, next)=>{ - req.welcomeText = welcomeText; + const brew = { + text : welcomeText, + welcomeText : welcomeText + }; + req.brew = brew; return next(); }); From 85fa73b9bf03cba012447935e8a072b19c9f0d41 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Thu, 29 Jul 2021 19:02:48 +1200 Subject: [PATCH 48/58] Remove welcomText+changelogText from default props --- server.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/server.js b/server.js index 6d3006016..88019de4b 100644 --- a/server.js +++ b/server.js @@ -224,8 +224,6 @@ app.use((req, res)=>{ const props = { version : require('./package.json').version, url : req.originalUrl, - welcomeText : req.welcomeText, - changelog : req.changelogText, brew : req.brew, brews : req.brews, googleBrews : req.googleBrews, From db3bec9e2bb3067006b43dec6a99527a5e007d55 Mon Sep 17 00:00:00 2001 From: "G.Ambatte" Date: Thu, 29 Jul 2021 21:05:55 +1200 Subject: [PATCH 49/58] Combine `setState` calls in `componentDidMount` --- client/homebrew/pages/newPage/newPage.jsx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/client/homebrew/pages/newPage/newPage.jsx b/client/homebrew/pages/newPage/newPage.jsx index d29a858a2..76cab5292 100644 --- a/client/homebrew/pages/newPage/newPage.jsx +++ b/client/homebrew/pages/newPage/newPage.jsx @@ -26,6 +26,7 @@ const NewPage = createClass({ return { brew : { text : '', + style : undefined, shareId : null, editId : null, createdAt : null, @@ -46,6 +47,7 @@ const NewPage = createClass({ return { brew : { text : this.props.brew.text || '', + style : this.props.brew.style || undefined, gDrive : false, title : this.props.brew.title || '', description : this.props.brew.description || '', @@ -67,16 +69,15 @@ const NewPage = createClass({ const brewStorage = localStorage.getItem(BREWKEY); const styleStorage = localStorage.getItem(STYLEKEY); + const brew = this.state.brew; + if(!this.props.brew.text || !this.props.brew.style){ - this.setState({ - brew : { - text : this.props.brew.text || (brewStorage ?? ''), - style : this.props.brew.style || (styleStorage ?? undefined) - } - }); + brew.text = this.props.brew.text || (brewStorage ?? ''); + brew.style = this.props.brew.style || (styleStorage ?? undefined); } this.setState((prevState)=>({ + brew : brew, htmlErrors : Markdown.validate(prevState.brew.text) })); From 295a4cd1cd2e883763b2f22d81cf571ace2c6ca7 Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Thu, 29 Jul 2021 10:13:31 -0500 Subject: [PATCH 50/58] Update magic.gen.js Add "1st Level" to levels in spell list. convert spell list to moustache syntax. --- client/homebrew/editor/snippetbar/snippets/magic.gen.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/editor/snippetbar/snippets/magic.gen.js b/client/homebrew/editor/snippetbar/snippets/magic.gen.js index caea3c4af..43bc5843b 100644 --- a/client/homebrew/editor/snippetbar/snippets/magic.gen.js +++ b/client/homebrew/editor/snippetbar/snippets/magic.gen.js @@ -57,7 +57,7 @@ const itemNames = [ module.exports = { spellList : function(){ - const levels = ['Cantrips (0 Level)', '2nd Level', '3rd Level', '4th Level', '5th Level', '6th Level', '7th Level', '8th Level', '9th Level']; + const levels = ['Cantrips (0 Level)', '1st Level', '2nd Level', '3rd Level', '4th Level', '5th Level', '6th Level', '7th Level', '8th Level', '9th Level']; const content = _.map(levels, (level)=>{ const spells = _.map(_.sampleSize(spellNames, _.random(5, 15)), (spell)=>{ @@ -66,7 +66,7 @@ module.exports = { return `##### ${level} \n${spells} \n`; }).join('\n'); - return `
\n${content}\n
`; + return `{{spellList\n${content}\n}}`; }, spell : function(){ From 0c0ba0b6ca1cba76387cb76785239daad5784fe5 Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Thu, 29 Jul 2021 11:26:41 -0500 Subject: [PATCH 51/58] Update metadataEditor.less - Fix Publish button and following small text so there is no overlap - set `nowrap` on checkbox inputs/labels so that the labels do not wrap to the next line from their input. - set min-width on values so that text boxes shrink to the same width; and can flex to any larger size. --- .../editor/metadataEditor/metadataEditor.less | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/client/homebrew/editor/metadataEditor/metadataEditor.less b/client/homebrew/editor/metadataEditor/metadataEditor.less index c3141f0d4..9d4e9534d 100644 --- a/client/homebrew/editor/metadataEditor/metadataEditor.less +++ b/client/homebrew/editor/metadataEditor/metadataEditor.less @@ -18,10 +18,11 @@ font-weight : 800; line-height : 1.8em; text-transform : uppercase; - flex-grow : 0; + flex : 0 0 auto; } &>.value{ - flex-grow : 1; + flex : 1 1 auto; + min-width : 200px; } } .description.field textarea.value{ @@ -38,6 +39,8 @@ font-size : 0.7em; font-weight : 800; user-select : none; + white-space : nowrap; + display : inline-block; } input{ vertical-align : middle; @@ -47,6 +50,9 @@ .publish.field .value{ position : relative; margin-bottom: 15px; + button{ + width:100%; + } button.publish{ .button(@blueLight); } @@ -76,4 +82,4 @@ font-size: 0.8em; line-height : 1.5em; } -} \ No newline at end of file +} From c4c5e21ce07a3191938809a6acbfe5164026027a Mon Sep 17 00:00:00 2001 From: Gazook89 <58999374+Gazook89@users.noreply.github.com> Date: Thu, 29 Jul 2021 12:28:02 -0500 Subject: [PATCH 52/58] Vertically center button labels Set labels as inline-flex containers and vertically align children to center. --- client/homebrew/editor/metadataEditor/metadataEditor.less | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/homebrew/editor/metadataEditor/metadataEditor.less b/client/homebrew/editor/metadataEditor/metadataEditor.less index 9d4e9534d..a58df14cd 100644 --- a/client/homebrew/editor/metadataEditor/metadataEditor.less +++ b/client/homebrew/editor/metadataEditor/metadataEditor.less @@ -40,11 +40,13 @@ font-weight : 800; user-select : none; white-space : nowrap; - display : inline-block; + display : inline-flex; + align-items : center; } input{ vertical-align : middle; cursor : pointer; + margin : 3px; } } .publish.field .value{ From 6b61bb05c087cacdc00a8223b74f454bedb8ea5b Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Fri, 30 Jul 2021 01:27:05 -0400 Subject: [PATCH 53/58] Update markdown.js - Fix "start" function for Divs and BlockInject, which were being generated mid-line (must start only after a newline) - Fix Divs consuming part of Spans above them. - Add % and # as valid characters for inline-styles --- shared/naturalcrit/markdown.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 580ba5b5a..83828f967 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -31,7 +31,7 @@ const mustacheSpans = { start(src) { return src.match(/{{[^{]/)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { const completeSpan = /^{{[^\n]*}}/; // Regex for the complete token - const inlineRegex = /{{(?:="[\w,\-(). ]*"|[^"'{}\s])*\s*|}}/g; + const inlineRegex = /{{(?:="[\w,\-()#%. ]*"|[^"'{}\s])*\s*|}}/g; const match = completeSpan.exec(src); if(match) { //Find closing delimiter @@ -74,10 +74,10 @@ const mustacheSpans = { const mustacheDivs = { name : 'mustacheDivs', level : 'block', - start(src) { return src.match(/^ *{{[^{]/m)?.index; }, // Hint to Marked.js to stop and check for a match + start(src) { return src.match(/\n *{{[^{]/m)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { - const completeBlock = /^ *{{.*\n *}}/s; // Regex for the complete token - const blockRegex = /^ *{{(?:="[\w,\-(). ]*"|[^"'{}\s])*$|^ *}}$/gm; + const completeBlock = /^ *{{[^\s}]*\n.*\n *}}/s; // Regex for the complete token + const blockRegex = /^ *{{(?:="[\w,\-()#%. ]*"|[^"'{}\s])*$|^ *}}$/gm; const match = completeBlock.exec(src); if(match) { //Find closing delimiter @@ -121,7 +121,7 @@ const mustacheInjectInline = { level : 'inline', start(src) { return src.match(/ *{[^{\n]/)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { - const inlineRegex = /^ *{((?:="[\w,\-(). ]*"|[^"'{}\s])*)}/g; + const inlineRegex = /^ *{((?:="[\w,\-()#%. ]*"|[^"'{}\s])*)}/g; const match = inlineRegex.exec(src); if(match) { const lastToken = tokens[tokens.length - 1]; @@ -154,9 +154,9 @@ const mustacheInjectBlock = { extensions : [{ name : 'mustacheInjectBlock', level : 'block', - start(src) { return src.match(/^ *{[^{\n]/m)?.index; }, // Hint to Marked.js to stop and check for a match + start(src) { return src.match(/\n *{[^{\n]/m)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { - const inlineRegex = /^ *{((?:="[\w,\-(). ]*"|[^"'{}\s])*)}/ym; + const inlineRegex = /^ *{((?:="[\w,\-()#%. ]*"|[^"'{}\s])*)}/ym; const match = inlineRegex.exec(src); if(match) { const lastToken = tokens[tokens.length - 1]; From 9be71a5159d0baf00b59fcad23ff9d55df7aff2e Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Fri, 30 Jul 2021 02:08:08 -0400 Subject: [PATCH 54/58] Mustache syntax now uses : instead of =. Single words don't need quotes --- shared/naturalcrit/markdown.js | 16 +++++++++------- themes/5ePhb.style.less | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index 83828f967..d54adce00 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -31,7 +31,7 @@ const mustacheSpans = { start(src) { return src.match(/{{[^{]/)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { const completeSpan = /^{{[^\n]*}}/; // Regex for the complete token - const inlineRegex = /{{(?:="[\w,\-()#%. ]*"|[^"'{}\s])*\s*|}}/g; + const inlineRegex = /{{(?::(?:"[\w,\-()#%. ]*"|[\w\,\-()#%.]*)|[^"'{}\s])*\s*|}}/g; const match = completeSpan.exec(src); if(match) { //Find closing delimiter @@ -77,7 +77,7 @@ const mustacheDivs = { start(src) { return src.match(/\n *{{[^{]/m)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { const completeBlock = /^ *{{[^\s}]*\n.*\n *}}/s; // Regex for the complete token - const blockRegex = /^ *{{(?:="[\w,\-()#%. ]*"|[^"'{}\s])*$|^ *}}$/gm; + const blockRegex = /^ *{{(?::(?:"[\w,\-()#%. ]*"|[\w\,\-()#%.]*)|[^"'{}\s])*$|^ *}}$/gm; const match = completeBlock.exec(src); if(match) { //Find closing delimiter @@ -121,7 +121,7 @@ const mustacheInjectInline = { level : 'inline', start(src) { return src.match(/ *{[^{\n]/)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { - const inlineRegex = /^ *{((?:="[\w,\-()#%. ]*"|[^"'{}\s])*)}/g; + const inlineRegex = /^ *{((?::(?:"[\w,\-()#%. ]*"|[\w\,\-()#%.]*)|[^"'{}\s])*)}/g; const match = inlineRegex.exec(src); if(match) { const lastToken = tokens[tokens.length - 1]; @@ -156,7 +156,7 @@ const mustacheInjectBlock = { level : 'block', start(src) { return src.match(/\n *{[^{\n]/m)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { - const inlineRegex = /^ *{((?:="[\w,\-()#%. ]*"|[^"'{}\s])*)}/ym; + const inlineRegex = /^ *{((?::(?:"[\w,\-()#%. ]*"|[\w\,\-()#%.]*)|[^"'{}\s])*)}/ym; const match = inlineRegex.exec(src); if(match) { const lastToken = tokens[tokens.length - 1]; @@ -313,13 +313,15 @@ const tagRegex = new RegExp(`(${ }).join('|')})`, 'g'); const processStyleTags = (string)=>{ - const tags = string.match(/(?:[^, "=]+|="[^"]*")+/g); + //split tags up. quotes can only occur right after colons. + //TODO: can we simplify to just split on commas? + const tags = string.match(/(?:[^, ":]+|:(?:"[^"]*"|))+/g); if(!tags) return '"'; const id = _.remove(tags, (tag)=>tag.startsWith('#')).map((tag)=>tag.slice(1))[0]; - const classes = _.remove(tags, (tag)=>!tag.includes('"')); - const styles = tags.map((tag)=>tag.replace(/="(.*)"/g, ':$1;')); + const classes = _.remove(tags, (tag)=>!tag.includes(':')); + const styles = tags.map((tag)=>tag.replace(/:"?([^"]*)"?/g, ':$1;')); return `${classes.join(' ')}" ${id ? `id="${id}"` : ''} ${styles.length ? `style="${styles.join(' ')}"` : ''}`; }; diff --git a/themes/5ePhb.style.less b/themes/5ePhb.style.less index a1395554d..ac8fff139 100644 --- a/themes/5ePhb.style.less +++ b/themes/5ePhb.style.less @@ -602,7 +602,7 @@ body { break-inside : avoid; -webkit-transform : translateZ(0); //Prevents shadows from breaking across columns } - .inline { + .inline-block { display : inline-block; text-indent : initial; } From 98915e158de6465adfd5a0e978760ba78069a25d Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Fri, 30 Jul 2021 02:11:26 -0400 Subject: [PATCH 55/58] Fix editor highlighting --- client/homebrew/editor/editor.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index 12cb0aa37..91865ef4a 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -131,7 +131,7 @@ const Editor = createClass({ // Highlight inline spans {{content}} if(line.includes('{{') && line.includes('}}')){ - const regex = /{{(?:="[\w,\-. ]*"|[^"'\s])*\s*|}}/g; + const regex = /{{(?::(?:"[\w,\-()#%. ]*"|[\w\,\-()#%.]*)|[^"'{}\s])*\s*|}}/g; let match; let blockCount = 0; while ((match = regex.exec(line)) != null) { @@ -150,7 +150,7 @@ const Editor = createClass({ // Highlight block divs {{\n Content \n}} let endCh = line.length+1; - const match = line.match(/^ *{{(?:="[\w,\-. ]*"|[^"'\s])*$|^ *}}$/); + const match = line.match(/^ *{{(?::(?:"[\w,\-()#%. ]*"|[\w\,\-()#%.]*)|[^"'{}\s])*$|^ *}}$/); if(match) endCh = match.index+match[0].length; codeMirror.markText({ line: lineNumber, ch: 0 }, { line: lineNumber, ch: endCh }, { className: 'block' }); From 5b039b82a3c5f892f4e6dd9429d2746d321daadc Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Fri, 30 Jul 2021 12:31:30 -0400 Subject: [PATCH 56/58] Update snippets --- client/homebrew/editor/editor.jsx | 2 +- .../editor/snippetbar/snippets/snippets.js | 15 +++++++-------- shared/naturalcrit/markdown.js | 4 ++-- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/client/homebrew/editor/editor.jsx b/client/homebrew/editor/editor.jsx index 91865ef4a..ebfd74060 100644 --- a/client/homebrew/editor/editor.jsx +++ b/client/homebrew/editor/editor.jsx @@ -150,7 +150,7 @@ const Editor = createClass({ // Highlight block divs {{\n Content \n}} let endCh = line.length+1; - const match = line.match(/^ *{{(?::(?:"[\w,\-()#%. ]*"|[\w\,\-()#%.]*)|[^"'{}\s])*$|^ *}}$/); + const match = line.match(/^ *{{(?::(?:"[\w,\-()#%. ]*"|[\w\,\-()#%.]*)|[^"'{}\s])* *$|^ *}}$/); if(match) endCh = match.index+match[0].length; codeMirror.markText({ line: lineNumber, ch: 0 }, { line: lineNumber, ch: endCh }, { className: 'block' }); diff --git a/client/homebrew/editor/snippetbar/snippets/snippets.js b/client/homebrew/editor/snippetbar/snippets/snippets.js index 9abedcf28..e61289b6b 100644 --- a/client/homebrew/editor/snippetbar/snippets/snippets.js +++ b/client/homebrew/editor/snippetbar/snippets/snippets.js @@ -33,7 +33,7 @@ module.exports = [ { name : 'Horizontal Spacing', icon : 'fas fa-arrows-alt-h', - gen : ' {{width="100px"}} ' + gen : ' {{width:100px}} ' }, { name : 'Wide Block', @@ -51,23 +51,22 @@ module.exports = [ name : 'Image', icon : 'fas fa-image', gen : dedent` - ![cat warrior](https://s-media-cache-ak0.pinimg.com/736x/4a/81/79/4a8179462cfdf39054a418efd4cb743e.jpg) {width="325px"} + ![cat warrior](https://s-media-cache-ak0.pinimg.com/736x/4a/81/79/4a8179462cfdf39054a418efd4cb743e.jpg) {width:325px} Credit: Kyounghwan Kim` }, { name : 'Background Image', icon : 'fas fa-tree', - gen : `![homebrew mug](http://i.imgur.com/hMna6G0.png) {position="absolute",top="50px",right="30px",width="280px"}` + gen : `![homebrew mug](http://i.imgur.com/hMna6G0.png) {position:absolute,top:50px,right:30px,width:280px}` }, { name : 'QR Code', icon : 'fas fa-qrcode', gen : (brew)=>{ - return ``; + `&size=100x100) {width:100px;mix-blend-mode:multiply}`; } }, @@ -257,7 +256,7 @@ module.exports = [ gen : function(){ return dedent` ##### Typical Difficulty Classes - {{column-count="2" + {{column-count:2 | Task Difficulty | DC | |:----------------|:--:| | Very easy | 5 | diff --git a/shared/naturalcrit/markdown.js b/shared/naturalcrit/markdown.js index d54adce00..1d360751b 100644 --- a/shared/naturalcrit/markdown.js +++ b/shared/naturalcrit/markdown.js @@ -76,8 +76,8 @@ const mustacheDivs = { level : 'block', start(src) { return src.match(/\n *{{[^{]/m)?.index; }, // Hint to Marked.js to stop and check for a match tokenizer(src, tokens) { - const completeBlock = /^ *{{[^\s}]*\n.*\n *}}/s; // Regex for the complete token - const blockRegex = /^ *{{(?::(?:"[\w,\-()#%. ]*"|[\w\,\-()#%.]*)|[^"'{}\s])*$|^ *}}$/gm; + const completeBlock = /^ *{{[^\s}]* *\n.*\n *}}/s; // Regex for the complete token + const blockRegex = /^ *{{(?::(?:"[\w,\-()#%. ]*"|[\w\,\-()#%.]*)|[^"'{}\s])* *$|^ *}}$/gm; const match = completeBlock.exec(src); if(match) { //Find closing delimiter From ebd28f41a2f2eb35ba6ba3e85e9f7b65e6458758 Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Fri, 30 Jul 2021 17:29:36 -0400 Subject: [PATCH 57/58] replace :- with just - --- server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.js b/server.js index 3b9ff6b04..f16418828 100644 --- a/server.js +++ b/server.js @@ -170,7 +170,7 @@ app.get('/edit/:id', asyncHandler(async (req, res, next)=>{ //New Page app.get('/new/:id', asyncHandler(async (req, res, next)=>{ const brew = await getBrewFromId(req.params.id, 'share'); - brew.title = `CLONE:- ${brew.title}`; + brew.title = `CLONE - ${brew.title}`; req.brew = brew; return next(); })); From 99d2f6d48d71707945a1bcb86e42fa6b91e8c58c Mon Sep 17 00:00:00 2001 From: Trevor Buckner Date: Fri, 30 Jul 2021 17:47:11 -0400 Subject: [PATCH 58/58] avoid sending two copies of welcome text in the same brew --- client/homebrew/pages/homePage/homePage.jsx | 8 ++++---- server.js | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/client/homebrew/pages/homePage/homePage.jsx b/client/homebrew/pages/homePage/homePage.jsx index c89f6c95b..b8ee5634b 100644 --- a/client/homebrew/pages/homePage/homePage.jsx +++ b/client/homebrew/pages/homePage/homePage.jsx @@ -23,15 +23,15 @@ const HomePage = createClass({ getDefaultProps : function() { return { brew : { - text : '', - welcomeText : '' + text : '', }, ver : '0.0.0' }; }, getInitialState : function() { return { - brew : this.props.brew + brew : this.props.brew, + welcomeText : this.props.brew.text }; }, handleSave : function(){ @@ -85,7 +85,7 @@ const HomePage = createClass({
-
+
Save current
diff --git a/server.js b/server.js index 88019de4b..648a08cd1 100644 --- a/server.js +++ b/server.js @@ -108,8 +108,7 @@ app.get('/robots.txt', (req, res)=>{ //Home page app.get('/', async (req, res, next)=>{ const brew = { - text : welcomeText, - welcomeText : welcomeText + text : welcomeText }; req.brew = brew; return next();