0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2026-01-26 22:43:07 +00:00

Compare commits

..

27 Commits

Author SHA1 Message Date
Víctor Losada Hernández
22e09b0879 Merge branch 'master' of https://github.com/naturalcrit/homebrewery into add-remove-author-if-owner 2025-11-19 11:00:02 +01:00
Víctor Losada Hernández
af477c56b1 last changes 2025-11-15 20:23:03 +01:00
Víctor Losada Hernández
4aacb36b3f Merge branch 'master' of https://github.com/naturalcrit/homebrewery into add-remove-author-if-owner 2025-11-15 20:06:32 +01:00
Víctor Losada Hernández
dd63370d20 Merge branch 'master' of https://github.com/naturalcrit/homebrewery into add-remove-author-if-owner 2025-11-12 10:00:56 +01:00
Víctor Losada Hernández
9d72796a67 requested changes 2025-11-12 10:00:09 +01:00
Víctor Losada Hernández
6473ea571c Merge branch 'master' of https://github.com/naturalcrit/homebrewery into add-remove-author-if-owner 2025-07-23 19:53:37 +02:00
Víctor Losada Hernández
2bcd317a4c reworked to be simpler 2025-07-23 19:52:05 +02:00
Víctor Losada Hernández
0ddca82c86 reorder one test 2025-07-18 16:43:49 +02:00
Víctor Losada Hernández
d5645083f3 remove prop drilling 2025-07-18 16:39:00 +02:00
Víctor Losada Hernández
e0bba53df1 Merge branch 'add-remove-author-if-owner' of https://github.com/naturalcrit/homebrewery into add-remove-author-if-owner 2025-07-18 16:22:13 +02:00
Víctor Losada Hernández
223fc0a514 add prop again 2025-07-18 16:20:17 +02:00
Víctor Losada Hernández
625d30f3a8 Merge branch 'master' of https://github.com/naturalcrit/homebrewery into add-remove-author-if-owner 2025-07-18 16:19:42 +02:00
Trevor Buckner
6388cc7032 Merge branch 'master' into add-remove-author-if-owner 2025-07-17 14:03:04 -04:00
Víctor Losada Hernández
066de435d3 Merge branch 'master' into add-remove-author-if-owner 2025-06-02 12:42:04 +02:00
Víctor Losada Hernández
4ec6ea0f84 fix them? 2025-05-24 22:43:06 +02:00
Víctor Losada Hernández
a7f8ff5212 fix the damn thing 2025-05-24 22:35:29 +02:00
Víctor Losada Hernández
215abbf2f7 fix test 2025-05-24 22:31:11 +02:00
Víctor Losada Hernández
c005d4d387 change test name 2025-05-24 22:29:10 +02:00
Víctor Losada Hernández
fd38371eeb Merge branch 'master' of https://github.com/naturalcrit/homebrewery into add-remove-author-if-owner 2025-05-24 22:14:47 +02:00
Víctor Losada Hernández
3c46312929 end tests? 2025-05-24 22:14:28 +02:00
Víctor Losada Hernández
55850f6d3c star tests 2025-05-20 11:39:22 +02:00
Víctor Losada Hernández
790bb5d1b7 lint 2025-05-20 11:39:16 +02:00
Víctor Losada Hernández
c51e8fd9d1 change api route to avoid collision 2025-05-13 08:23:23 +02:00
Víctor Losada Hernández
60714fbf58 lint 2025-05-12 12:27:17 +02:00
Víctor Losada Hernández
f040805d09 server side 2025-05-11 23:59:30 +02:00
Víctor Losada Hernández
c35138e7e3 client side 2025-05-11 23:59:25 +02:00
Víctor Losada Hernández
91f7d86fd4 prop drilling 2025-05-11 23:59:04 +02:00
13 changed files with 894 additions and 585 deletions

View File

@@ -47,6 +47,7 @@ const MetadataEditor = createClass({
getInitialState : function(){
return {
isOwner : global.account?.username && global.account?.username === this.props.metadata?.authors[0],
showThumbnail : true
};
},
@@ -156,6 +157,15 @@ const MetadataEditor = createClass({
});
},
handleDeleteAuthor : function(author){
if(!confirm('Are you sure you want to remove this author? They will lose all edit access to this brew, and it will dissapear from their userpage.')) return;
if(!this.props.metadata.authors.includes(author)) return;
this.props.onChange({
...this.props.metadata,
authors : this.props.metadata.authors.filter((a)=>a !== author)
});
},
renderSystems : function(){
return _.map(SYSTEMS, (val)=>{
return <label key={val}>
@@ -194,16 +204,54 @@ const MetadataEditor = createClass({
},
renderAuthors : function(){
let text = 'None.';
if(this.props.metadata.authors && this.props.metadata.authors.length){
text = this.props.metadata.authors.join(', ');
}
return <div className='field authors'>
<label>authors</label>
<div className='value'>
{text}
const authors = this.props.metadata.authors;
if(!this.state.isOwner || authors.length < 2) return (
<div className='field authors'>
<label>authors</label>
<div className='value'>
{authors.length > 0 && (
<a href={`/user/${authors[0]}`} className='author-link' title={`Owner - Click to open ${authors[0]}'s profile in a new tab`}>
{authors[0]}{authors.length > 1 && ', '}
</a>
)}
{authors.length > 1 && authors.slice(1).map((author, i)=>(
<a href={`/user/${author}`} className='author-link' title={`Author - Click to open ${author}'s profile in a new tab`}>
{author}{i+2 < authors.length && ', '}
</a>
))}
</div>
</div>
</div>;
);
return (
<div className='field authors'>
<label>Authors</label>
<ul className='list'>
{authors.length > 0 && (
<li className='tag owner' title='Owner'>
<a href={`/user/${authors[0]}`} className='author-link' title={`Owner - Click to open ${authors[0]}'s profile in a new tab`}>
{authors[0]}
</a>
</li>
)}
{authors.length > 1 && authors.slice(1).map((author, i)=>(
<li className='tag author' key={i + 1} title='Author'>
<a href={`/user/${author}`} className='author-link' title={`Author - Click to open ${authors[0]}'s profile in a new tab`}>
{author}
</a>
<button
onClick={()=>this.handleDeleteAuthor(author)}
className='delete'
title={`Remove ${author} as an author`}
>
<i className='fa fa-times fa-fw' />
</button>
</li>
))}
</ul>
</div>
);
},
renderThemeDropdown : function(){

View File

@@ -44,8 +44,6 @@
gap : 10px;
}
.field {
position : relative;
display : flex;
@@ -116,7 +114,6 @@
}
}
.thumbnail-preview {
position : relative;
flex : 1 1;
@@ -164,7 +161,47 @@
.colorButton(@red);
}
}
.authors.field .value { line-height : 1.5em; }
.authors.field {
.tag {
font-weight:300;
transition:background-color 0.2s;
&.owner {
position: relative;
background-color:@silverLight;
min-width:25px;
display:grid;
place-items:center;
font-weight: 900;
&::after {
content: "\f521";
font-family: "Font Awesome 6 Free";
color:gold;
position: absolute;
top: 0;
left: 0;
width:15px;
height:15px;
rotate:-45deg;
translate:-50% -50%;
}
}
&:has(button:hover) {
background:#d97d7d;
}
button {
color:@red;
}
}
a {
color:black;
text-decoration:unset;
}
}
.themes.field {
& .dropdown-container {
@@ -266,13 +303,17 @@
}
.tag {
padding : 0.3em;
padding : 0.35em;
margin : 2px;
font-size : 0.9em;
font-size : 0.95em;
background-color : #DDDDDD;
border-radius : 0.5em;
.icon { #groupedIcon; }
button {
cursor : pointer;
}
}
.input-group {

103
package-lock.json generated
View File

@@ -13,16 +13,16 @@
"@babel/core": "^7.28.4",
"@babel/plugin-transform-runtime": "^7.28.3",
"@babel/preset-env": "^7.28.3",
"@babel/preset-react": "^7.28.5",
"@babel/preset-react": "^7.27.1",
"@babel/runtime": "^7.28.4",
"@dmsnell/diff-match-patch": "^1.1.0",
"@googleapis/drive": "^19.2.0",
"@googleapis/drive": "^18.0.0",
"@sanity/diff-match-patch": "^3.2.0",
"body-parser": "^2.2.0",
"classnames": "^2.5.1",
"codemirror": "^5.65.6",
"cookie-parser": "^1.4.7",
"core-js": "^3.47.0",
"core-js": "^3.46.0",
"cors": "^2.8.5",
"create-react-class": "^15.7.0",
"dedent-tabs": "^0.10.3",
@@ -34,29 +34,29 @@
"fs-extra": "11.3.2",
"hash-wasm": "^4.12.0",
"idb-keyval": "^6.2.2",
"js-yaml": "^4.1.1",
"js-yaml": "^4.1.0",
"jwt-simple": "^0.5.6",
"less": "^3.13.1",
"lodash": "^4.17.21",
"marked": "15.0.12",
"marked-alignment-paragraphs": "^1.0.0",
"marked-definition-lists": "^1.0.1",
"marked-emoji": "^2.0.2",
"marked-emoji": "^2.0.1",
"marked-extended-tables": "^2.0.1",
"marked-gfm-heading-id": "^4.1.3",
"marked-gfm-heading-id": "^4.1.2",
"marked-nonbreaking-spaces": "^1.0.1",
"marked-smartypants-lite": "^1.0.3",
"marked-subsuper-text": "^1.0.4",
"marked-variables": "^1.0.4",
"markedLegacy": "npm:marked@^0.3.19",
"moment": "^2.30.1",
"mongoose": "^8.20.0",
"mongoose": "^8.19.1",
"nanoid": "5.1.6",
"nconf": "^0.13.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-frame-component": "^4.1.3",
"react-router": "^7.9.6",
"react-router": "^7.9.4",
"romans": "^3.1.0",
"sanitize-filename": "1.6.3",
"superagent": "^10.2.1",
@@ -66,8 +66,8 @@
"devDependencies": {
"@stylistic/stylelint-plugin": "^4.0.0",
"babel-plugin-transform-import-meta": "^2.3.3",
"eslint": "^9.39.1",
"eslint-plugin-jest": "^29.1.0",
"eslint": "^9.37.0",
"eslint-plugin-jest": "^29.0.1",
"eslint-plugin-react": "^7.37.5",
"globals": "^16.4.0",
"jest": "^30.2.0",
@@ -1427,9 +1427,9 @@
}
},
"node_modules/@babel/plugin-transform-react-display-name": {
"version": "7.28.0",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.28.0.tgz",
"integrity": "sha512-D6Eujc2zMxKjfa4Zxl4GHMsmhKKZ9VpcqIchJLvwTxad9zWIYulwYItBovpDOoNLISpcZSXoDJ5gaGbQUDqViA==",
"version": "7.27.1",
"resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.27.1.tgz",
"integrity": "sha512-p9+Vl3yuHPmkirRrg021XiP+EETmPMQTLr6Ayjj85RLNEbb3Eya/4VI0vAdzQG9SEAl2Lnt7fy5lZyMzjYoZQQ==",
"license": "MIT",
"dependencies": {
"@babel/helper-plugin-utils": "^7.27.1"
@@ -1795,14 +1795,14 @@
}
},
"node_modules/@babel/preset-react": {
"version": "7.28.5",
"resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.28.5.tgz",
"integrity": "sha512-Z3J8vhRq7CeLjdC58jLv4lnZ5RKFUJWqH5emvxmv9Hv3BD1T9R/Im713R4MTKwvFaV74ejZ3sM01LyEKk4ugNQ==",
"version": "7.27.1",
"resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.27.1.tgz",
"integrity": "sha512-oJHWh2gLhU9dW9HHr42q0cI0/iHHXTLGe39qvpAZZzagHy0MzYLCnCVV0symeRvzmjHyVU7mw2K06E6u/JwbhA==",
"license": "MIT",
"dependencies": {
"@babel/helper-plugin-utils": "^7.27.1",
"@babel/helper-validator-option": "^7.27.1",
"@babel/plugin-transform-react-display-name": "^7.28.0",
"@babel/plugin-transform-react-display-name": "^7.27.1",
"@babel/plugin-transform-react-jsx": "^7.27.1",
"@babel/plugin-transform-react-jsx-development": "^7.27.1",
"@babel/plugin-transform-react-pure-annotations": "^7.27.1"
@@ -2258,9 +2258,9 @@
}
},
"node_modules/@eslint/js": {
"version": "9.39.1",
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.1.tgz",
"integrity": "sha512-S26Stp4zCy88tH94QbBv3XCuzRQiZ9yXofEILmglYTh/Ug/a9/umqvgFtYBAo3Lp0nsI/5/qH1CCrbdK3AP1Tw==",
"version": "9.39.0",
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.39.0.tgz",
"integrity": "sha512-BIhe0sW91JGPiaF1mOuPy5v8NflqfjIcDNpC+LbW9f609WVRX1rArrhi6Z2ymvrAry9jw+5POTj4t2t62o8Bmw==",
"dev": true,
"license": "MIT",
"engines": {
@@ -2295,9 +2295,9 @@
}
},
"node_modules/@googleapis/drive": {
"version": "19.2.0",
"resolved": "https://registry.npmjs.org/@googleapis/drive/-/drive-19.2.0.tgz",
"integrity": "sha512-XzhQ+CNwW54umLecZLzQ5Q2RborJD1+u2YzJIT/BOpne+VJfsCyxWVG0nxYQmcGdiFXJPeW5+V3sdP/A/nt3eA==",
"version": "18.0.0",
"resolved": "https://registry.npmjs.org/@googleapis/drive/-/drive-18.0.0.tgz",
"integrity": "sha512-nk4TirsHttwZSOjBEBjltCPDKUqwFso59G3WitNE+EGNVSVseSEq981f8Dmjq2ah0/fk3i206wuCU4PUCwcoTQ==",
"license": "Apache-2.0",
"dependencies": {
"googleapis-common": "^8.0.0"
@@ -5343,9 +5343,9 @@
}
},
"node_modules/core-js": {
"version": "3.47.0",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.47.0.tgz",
"integrity": "sha512-c3Q2VVkGAUyupsjRnaNX6u8Dq2vAdzm9iuPj5FW0fRxzlxgq9Q39MDq10IvmQSpLgHQNyQzQmOo6bgGHmH3NNg==",
"version": "3.46.0",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-3.46.0.tgz",
"integrity": "sha512-vDMm9B0xnqqZ8uSBpZ8sNtRtOdmfShrvT6h2TuQGLs0Is+cR0DYbj/KWP6ALVNbWPpqA/qPLoOuppJN07humpA==",
"hasInstallScript": true,
"license": "MIT",
"funding": {
@@ -6259,9 +6259,9 @@
}
},
"node_modules/eslint": {
"version": "9.39.1",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.1.tgz",
"integrity": "sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==",
"version": "9.39.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-9.39.0.tgz",
"integrity": "sha512-iy2GE3MHrYTL5lrCtMZ0X1KLEKKUjmK0kzwcnefhR66txcEmXZD2YWgR5GNdcEwkNx3a0siYkSvl0vIC+Svjmg==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -6271,7 +6271,7 @@
"@eslint/config-helpers": "^0.4.2",
"@eslint/core": "^0.17.0",
"@eslint/eslintrc": "^3.3.1",
"@eslint/js": "9.39.1",
"@eslint/js": "9.39.0",
"@eslint/plugin-kit": "^0.4.1",
"@humanfs/node": "^0.16.6",
"@humanwhocodes/module-importer": "^1.0.1",
@@ -6319,9 +6319,9 @@
}
},
"node_modules/eslint-plugin-jest": {
"version": "29.1.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-29.1.0.tgz",
"integrity": "sha512-LabxXbASXVjguqL+kBHTPMf3gUeSqwH4fsrEyHTY/MCs42I/p9+ctg09SJpYiD8eGaIsP6GwYr5xW6xWS9XgZg==",
"version": "29.0.1",
"resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-29.0.1.tgz",
"integrity": "sha512-EE44T0OSMCeXhDrrdsbKAhprobKkPtJTbQz5yEktysNpHeDZTAL1SfDTNKmcFfJkY6yrQLtTKZALrD3j/Gpmiw==",
"dev": true,
"license": "MIT",
"dependencies": {
@@ -9466,9 +9466,9 @@
"license": "MIT"
},
"node_modules/js-yaml": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.1.tgz",
"integrity": "sha512-qQKT4zQxXl8lLwBtHMWwaTcGfFOZviOJet3Oy/xmGk2gZH677CJM9EvtfdSkgWcATZhj/55JZ0rmy3myCT5lsA==",
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
"license": "MIT",
"dependencies": {
"argparse": "^2.0.1"
@@ -10026,12 +10026,12 @@
}
},
"node_modules/marked-emoji": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/marked-emoji/-/marked-emoji-2.0.2.tgz",
"integrity": "sha512-EFnLQn4wTyf+6pXfptkm83Z2mt3VbdEYedHBAsDpwUas5n5satsj42RGqAijBpmetgGerI1EzUuzf7NIccINUQ==",
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/marked-emoji/-/marked-emoji-2.0.1.tgz",
"integrity": "sha512-P+nRr02dD+yPOFhtGdaVBzp0qzwlksI2f5GumIdHW/3UadzJ5sVi78CZikiSLr9PmdtUOZodZUBNIO6k38pDMQ==",
"license": "MIT",
"peerDependencies": {
"marked": ">=4 <18"
"marked": ">=4 <17"
}
},
"node_modules/marked-extended-tables": {
@@ -10044,15 +10044,15 @@
}
},
"node_modules/marked-gfm-heading-id": {
"version": "4.1.3",
"resolved": "https://registry.npmjs.org/marked-gfm-heading-id/-/marked-gfm-heading-id-4.1.3.tgz",
"integrity": "sha512-aR0i63LmFbuxU/gAgrgz1Ir+8HK6zAIFXMlckeKHpV+qKbYaOP95L4Ux5Gi+sKmCZU5qnN2rdKpvpb7PnUBIWg==",
"version": "4.1.2",
"resolved": "https://registry.npmjs.org/marked-gfm-heading-id/-/marked-gfm-heading-id-4.1.2.tgz",
"integrity": "sha512-EQ1WiEGHJh0C8viU+hbXbhHyWTDgEia2i96fiSemm2wdYER6YBw/9QI5TB6YFTqFfmMOxBFXPcPJtlgD0fVV2w==",
"license": "MIT",
"dependencies": {
"github-slugger": "^2.0.0"
},
"peerDependencies": {
"marked": ">=13 <18"
"marked": ">=13 <17"
}
},
"node_modules/marked-nonbreaking-spaces": {
@@ -10436,9 +10436,9 @@
}
},
"node_modules/mongoose": {
"version": "8.20.0",
"resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.20.0.tgz",
"integrity": "sha512-SxqNb8yx+VOjIOx2l7HqkGvYuLC/T85d+jPvqGDdUbKJFz/5PVSsVxQzypQsX7chenYvq5bd8jIr4LtunedE7g==",
"version": "8.19.2",
"resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.19.2.tgz",
"integrity": "sha512-ww2T4dBV+suCbOfG5YPwj9pLCfUVyj8FEA1D3Ux1HHqutpLxGyOYEPU06iPRBW4cKr3PJfOSYsIpHWPTkz5zig==",
"license": "MIT",
"dependencies": {
"bson": "^6.10.4",
@@ -12065,9 +12065,9 @@
"license": "MIT"
},
"node_modules/react-router": {
"version": "7.9.6",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-7.9.6.tgz",
"integrity": "sha512-Y1tUp8clYRXpfPITyuifmSoE2vncSME18uVLgaqyxh9H35JWpIfzHo+9y3Fzh5odk/jxPW29IgLgzcdwxGqyNA==",
"version": "7.9.5",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-7.9.5.tgz",
"integrity": "sha512-JmxqrnBZ6E9hWmf02jzNn9Jm3UqyeimyiwzD69NjxGySG6lIz/1LVPsoTCwN7NBX2XjCEa1LIX5EMz1j2b6u6A==",
"license": "MIT",
"dependencies": {
"cookie": "^1.0.1",
@@ -14742,8 +14742,7 @@
},
"node_modules/vitreum": {
"version": "6.0.4",
"resolved": "git+https://git@github.com/calculuschild/vitreum.git#929c351881c4229550374421c7e2890a94f4dca7",
"integrity": "sha512-dclfZIgvZU4pOeju1U7CjfGcAMNY+HwhYxF5O1cB6j9EtBrUXQh5+8XlYvNrw2XIcjWIxWcWaCpAQgJxKssfbQ==",
"resolved": "git+https://git@github.com/calculuschild/vitreum.git#9d55fd6fb7e85e7070de798c4f9d5b983c1b7dba",
"hasInstallScript": true,
"license": "MIT",
"dependencies": {

View File

@@ -88,16 +88,16 @@
"@babel/core": "^7.28.4",
"@babel/plugin-transform-runtime": "^7.28.3",
"@babel/preset-env": "^7.28.3",
"@babel/preset-react": "^7.28.5",
"@babel/preset-react": "^7.27.1",
"@babel/runtime": "^7.28.4",
"@dmsnell/diff-match-patch": "^1.1.0",
"@googleapis/drive": "^19.2.0",
"@googleapis/drive": "^18.0.0",
"@sanity/diff-match-patch": "^3.2.0",
"body-parser": "^2.2.0",
"classnames": "^2.5.1",
"codemirror": "^5.65.6",
"cookie-parser": "^1.4.7",
"core-js": "^3.47.0",
"core-js": "^3.46.0",
"cors": "^2.8.5",
"create-react-class": "^15.7.0",
"dedent-tabs": "^0.10.3",
@@ -109,29 +109,29 @@
"fs-extra": "11.3.2",
"hash-wasm": "^4.12.0",
"idb-keyval": "^6.2.2",
"js-yaml": "^4.1.1",
"js-yaml": "^4.1.0",
"jwt-simple": "^0.5.6",
"less": "^3.13.1",
"lodash": "^4.17.21",
"marked": "15.0.12",
"marked-alignment-paragraphs": "^1.0.0",
"marked-definition-lists": "^1.0.1",
"marked-emoji": "^2.0.2",
"marked-emoji": "^2.0.1",
"marked-extended-tables": "^2.0.1",
"marked-gfm-heading-id": "^4.1.3",
"marked-gfm-heading-id": "^4.1.2",
"marked-nonbreaking-spaces": "^1.0.1",
"marked-smartypants-lite": "^1.0.3",
"marked-subsuper-text": "^1.0.4",
"marked-variables": "^1.0.4",
"markedLegacy": "npm:marked@^0.3.19",
"moment": "^2.30.1",
"mongoose": "^8.20.0",
"mongoose": "^8.19.1",
"nanoid": "5.1.6",
"nconf": "^0.13.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-frame-component": "^4.1.3",
"react-router": "^7.9.6",
"react-router": "^7.9.4",
"romans": "^3.1.0",
"sanitize-filename": "1.6.3",
"superagent": "^10.2.1",
@@ -141,8 +141,8 @@
"devDependencies": {
"@stylistic/stylelint-plugin": "^4.0.0",
"babel-plugin-transform-import-meta": "^2.3.3",
"eslint": "^9.39.1",
"eslint-plugin-jest": "^29.1.0",
"eslint": "^9.37.0",
"eslint-plugin-jest": "^29.0.1",
"eslint-plugin-react": "^7.37.5",
"globals": "^16.4.0",
"jest": "^30.2.0",

View File

@@ -6,7 +6,6 @@ import config from './config.js';
let serviceAuth;
let clientEmail;
if(!config.get('service_account')){
const reset = '\x1b[0m'; // Reset to default style
const yellow = '\x1b[33m'; // yellow color
@@ -16,10 +15,6 @@ if(!config.get('service_account')){
JSON.parse(config.get('service_account')) :
config.get('service_account');
if(keys?.client_email) {
clientEmail = keys.client_email;
}
try {
serviceAuth = googleDrive.auth.fromJSON(keys);
serviceAuth.scopes = ['https://www.googleapis.com/auth/drive'];
@@ -232,30 +227,14 @@ const GoogleActions = {
if(!obj) return;
if(clientEmail) {
await drive.permissions.create({
resource : {
type : 'user',
emailAddress : clientEmail,
role : 'writer'
},
fileId : obj.data.id,
fields : 'id',
})
.catch((err)=>{
console.log('Error adding Service Account permissions on Google Drive file');
console.error(err);
});
}
await drive.permissions.create({
resource : { type : 'anyone',
role : 'writer' },
role : 'writer' },
fileId : obj.data.id,
fields : 'id',
})
.catch((err)=>{
console.log('Error adding "Anyone" permissions on Google Drive file');
console.log('Error updating permissions');
console.error(err);
});

View File

@@ -171,7 +171,6 @@ const api = {
next();
};
},
getCSS : async (req, res)=>{
const { brew } = req;
if(!brew) return res.status(404).send('');
@@ -184,7 +183,6 @@ const api = {
});
return res.status(200).send(brew.style);
},
mergeBrewText : (brew)=>{
let text = brew.text;
if(brew.style !== undefined) {
@@ -202,7 +200,6 @@ const api = {
`${text}`;
return text;
},
getGoodBrewTitle : (text)=>{
const tokens = Markdown.marked.lexer(text);
return (tokens.find((token)=>token.type === 'heading' || token.type === 'paragraph')?.text || 'No Title')

View File

@@ -204,7 +204,6 @@ describe('Tests for api', ()=>{
expect(id).toEqual('abcdefghij');
});
});
describe('getBrew', ()=>{
const toBrewPromise = (brew)=>new Promise((res)=>res({ toObject: ()=>brew }));
const notFoundError = { HBErrorCode: '05', message: 'Brew not found', name: 'BrewLoad Error', status: 404, accessType: 'share', brewId: '1' };
@@ -382,7 +381,68 @@ describe('Tests for api', ()=>{
await expect(fn(req, null, next)).rejects.toEqual({ 'HBErrorCode': '51', 'brewId': '1', 'brewTitle': 'test brew', 'code': 404, 'message': 'brew locked' });
});
});
describe('Get CSS', ()=>{
it('should return brew style content as CSS text', async ()=>{
const testBrew = { title: 'test brew', text: '```css\n\nI Have a style!\n```\n\n' };
const toBrewPromise = (brew)=>new Promise((res)=>res({ toObject: ()=>brew }));
api.getId = jest.fn(()=>({ id: '1', googleId: undefined }));
model.get = jest.fn(()=>toBrewPromise(testBrew));
const fn = api.getBrew('share', true);
const req = { brew: {} };
const next = jest.fn();
await fn(req, null, next);
await api.getCSS(req, res);
expect(req.brew).toEqual(testBrew);
expect(req.brew).toHaveProperty('style', '\nI Have a style!\n');
expect(res.status).toHaveBeenCalledWith(200);
expect(res.send).toHaveBeenCalledWith('\nI Have a style!\n');
expect(res.set).toHaveBeenCalledWith({
'Cache-Control' : 'no-cache',
'Content-Type' : 'text/css'
});
});
it('should return 404 when brew has no style content', async ()=>{
const testBrew = { title: 'test brew', text: 'I don\'t have a style!' };
const toBrewPromise = (brew)=>new Promise((res)=>res({ toObject: ()=>brew }));
api.getId = jest.fn(()=>({ id: '1', googleId: undefined }));
model.get = jest.fn(()=>toBrewPromise(testBrew));
const fn = api.getBrew('share', true);
const req = { brew: {} };
const next = jest.fn();
await fn(req, null, next);
await api.getCSS(req, res);
expect(req.brew).toEqual(testBrew);
expect(req.brew).toHaveProperty('style');
expect(res.status).toHaveBeenCalledWith(404);
expect(res.send).toHaveBeenCalledWith('');
});
it('should return 404 when brew does not exist', async ()=>{
const testBrew = { };
const toBrewPromise = (brew)=>new Promise((res)=>res({ toObject: ()=>brew }));
api.getId = jest.fn(()=>({ id: '1', googleId: undefined }));
model.get = jest.fn(()=>toBrewPromise(testBrew));
const fn = api.getBrew('share', true);
const req = { brew: {} };
const next = jest.fn();
await fn(req, null, next);
await api.getCSS(req, res);
expect(req.brew).toEqual(testBrew);
expect(req.brew).toHaveProperty('style');
expect(res.status).toHaveBeenCalledWith(404);
expect(res.send).toHaveBeenCalledWith('');
});
});
describe('mergeBrewText', ()=>{
it('should set metadata and no style if it is not present', ()=>{
const result = api.mergeBrewText({
@@ -445,7 +505,6 @@ hello yes i am css
brew`);
});
});
describe('exclusion methods', ()=>{
it('excludePropsFromUpdate removes the correct keys', ()=>{
const sent = Object.assign({}, googleBrew);
@@ -483,7 +542,6 @@ brew`);
expect(result.pageCount).toBe(1);
});
});
describe('beforeNewSave', ()=>{
it('sets the title if none', ()=>{
const brew = {
@@ -525,7 +583,6 @@ brew`);
expect(hbBrew.text).toEqual('merged');
});
});
describe('newGoogleBrew', ()=>{
it('should call the correct methods', ()=>{
api.excludeGoogleProps = jest.fn(()=>'newBrew');
@@ -539,7 +596,6 @@ brew`);
expect(google.newGoogleBrew).toHaveBeenCalledWith('client', 'newBrew');
});
});
describe('newBrew', ()=>{
it('should set up a default brew via Homebrew model', async ()=>{
await api.newBrew({ body: { text: 'asdf' }, query: {}, account: { username: 'test user' } }, res);
@@ -631,17 +687,6 @@ brew`);
});
});
});
describe('deleteGoogleBrew', ()=>{
it('should check auth and delete brew', async ()=>{
const result = await api.deleteGoogleBrew({ username: 'test user' }, 'id', 'editId', res);
expect(result).toBe(true);
expect(google.authCheck).toHaveBeenCalledWith({ username: 'test user' }, expect.objectContaining({}));
expect(google.deleteGoogleBrew).toHaveBeenCalledWith('client', 'id', 'editId');
});
});
describe('Theme bundle', ()=>{
it('should return Theme Bundle for a User Theme', async ()=>{
const brews = {
@@ -785,7 +830,94 @@ brew`);
status : 422 });
});
});
describe('updateBrew', ()=>{
it('should return error on version mismatch', async ()=>{
const brewFromClient = { version: 1 };
const brewFromServer = { version: 1000, text: '' };
const req = {
brew : brewFromServer,
body : brewFromClient
};
await api.updateBrew(req, res);
expect(res.status).toHaveBeenCalledWith(409);
expect(res.send).toHaveBeenCalledWith('{\"message\":\"The server version is out of sync with the saved brew. Please save your changes elsewhere, refresh, and try again.\"}');
});
it('should return error on hash mismatch', async ()=>{
const brewFromClient = { version: 1, hash: '1234' };
const brewFromServer = { version: 1, text: 'test' };
const req = {
brew : brewFromServer,
body : brewFromClient
};
await api.updateBrew(req, res);
expect(req.brew.hash).toBe('098f6bcd4621d373cade4e832627b4f6');
expect(res.status).toHaveBeenCalledWith(409);
expect(res.send).toHaveBeenCalledWith('{\"message\":\"The server copy is out of sync with the saved brew. Please save your changes elsewhere, refresh, and try again.\"}');
});
// Commenting this one out for now, since we are no longer throwing this error while we monitor
// it('should return error on applying patches', async ()=>{
// const brewFromClient = { version: 1, hash: '098f6bcd4621d373cade4e832627b4f6', patches: 'not a valid patch string' };
// const brewFromServer = { version: 1, text: 'test', title: 'Test Title', description: 'Test Description' };
// const req = {
// brew : brewFromServer,
// body : brewFromClient,
// };
// let err;
// try {
// await api.updateBrew(req, res);
// } catch (e) {
// err = e;
// }
// expect(err).toEqual(Error('Invalid patch string: not a valid patch string'));
// });
it('should save brew, no ID', async ()=>{
const brewFromClient = { version: 1, hash: '098f6bcd4621d373cade4e832627b4f6', patches: '' };
const brewFromServer = { version: 1, text: 'test', title: 'Test Title', description: 'Test Description' };
model.save = jest.fn((brew)=>{return brew;});
const req = {
brew : brewFromServer,
body : brewFromClient,
query : { saveToGoogle: false, removeFromGoogle: false }
};
await api.updateBrew(req, res);
expect(res.status).toHaveBeenCalledWith(200);
expect(res.send).toHaveBeenCalledWith(
expect.objectContaining({
_id : '1',
description : 'Test Description',
hash : '098f6bcd4621d373cade4e832627b4f6',
title : 'Test Title',
version : 2
})
);
});
});
describe('deleteGoogleBrew', ()=>{
it('should check auth and delete brew', async ()=>{
const result = await api.deleteGoogleBrew({ username: 'test user' }, 'id', 'editId', res);
expect(result).toBe(true);
expect(google.authCheck).toHaveBeenCalledWith({ username: 'test user' }, expect.objectContaining({}));
expect(google.deleteGoogleBrew).toHaveBeenCalledWith('client', 'id', 'editId');
});
});
describe('deleteBrew', ()=>{
it('should handle case where fetching the brew returns an error', async ()=>{
api.getBrew = jest.fn(()=>async ()=>{ throw { message: 'err', HBErrorCode: '02' }; });
@@ -1006,68 +1138,7 @@ brew`);
expect(saved.googleId).toEqual(brew.googleId);
});
});
describe('Get CSS', ()=>{
it('should return brew style content as CSS text', async ()=>{
const testBrew = { title: 'test brew', text: '```css\n\nI Have a style!\n```\n\n' };
const toBrewPromise = (brew)=>new Promise((res)=>res({ toObject: ()=>brew }));
api.getId = jest.fn(()=>({ id: '1', googleId: undefined }));
model.get = jest.fn(()=>toBrewPromise(testBrew));
const fn = api.getBrew('share', true);
const req = { brew: {} };
const next = jest.fn();
await fn(req, null, next);
await api.getCSS(req, res);
expect(req.brew).toEqual(testBrew);
expect(req.brew).toHaveProperty('style', '\nI Have a style!\n');
expect(res.status).toHaveBeenCalledWith(200);
expect(res.send).toHaveBeenCalledWith('\nI Have a style!\n');
expect(res.set).toHaveBeenCalledWith({
'Cache-Control' : 'no-cache',
'Content-Type' : 'text/css'
});
});
it('should return 404 when brew has no style content', async ()=>{
const testBrew = { title: 'test brew', text: 'I don\'t have a style!' };
const toBrewPromise = (brew)=>new Promise((res)=>res({ toObject: ()=>brew }));
api.getId = jest.fn(()=>({ id: '1', googleId: undefined }));
model.get = jest.fn(()=>toBrewPromise(testBrew));
const fn = api.getBrew('share', true);
const req = { brew: {} };
const next = jest.fn();
await fn(req, null, next);
await api.getCSS(req, res);
expect(req.brew).toEqual(testBrew);
expect(req.brew).toHaveProperty('style');
expect(res.status).toHaveBeenCalledWith(404);
expect(res.send).toHaveBeenCalledWith('');
});
it('should return 404 when brew does not exist', async ()=>{
const testBrew = { };
const toBrewPromise = (brew)=>new Promise((res)=>res({ toObject: ()=>brew }));
api.getId = jest.fn(()=>({ id: '1', googleId: undefined }));
model.get = jest.fn(()=>toBrewPromise(testBrew));
const fn = api.getBrew('share', true);
const req = { brew: {} };
const next = jest.fn();
await fn(req, null, next);
await api.getCSS(req, res);
expect(req.brew).toEqual(testBrew);
expect(req.brew).toHaveProperty('style');
expect(res.status).toHaveBeenCalledWith(404);
expect(res.send).toHaveBeenCalledWith('');
});
});
describe('Split Text, Style, and Metadata', ()=>{
it('basic splitting', async ()=>{
@@ -1121,83 +1192,5 @@ brew`);
expect(testBrew.tags).toEqual(['tag a']);
});
});
describe('updateBrew', ()=>{
it('should return error on version mismatch', async ()=>{
const brewFromClient = { version: 1 };
const brewFromServer = { version: 1000, text: '' };
const req = {
brew : brewFromServer,
body : brewFromClient
};
await api.updateBrew(req, res);
expect(res.status).toHaveBeenCalledWith(409);
expect(res.send).toHaveBeenCalledWith('{\"message\":\"The server version is out of sync with the saved brew. Please save your changes elsewhere, refresh, and try again.\"}');
});
it('should return error on hash mismatch', async ()=>{
const brewFromClient = { version: 1, hash: '1234' };
const brewFromServer = { version: 1, text: 'test' };
const req = {
brew : brewFromServer,
body : brewFromClient
};
await api.updateBrew(req, res);
expect(req.brew.hash).toBe('098f6bcd4621d373cade4e832627b4f6');
expect(res.status).toHaveBeenCalledWith(409);
expect(res.send).toHaveBeenCalledWith('{\"message\":\"The server copy is out of sync with the saved brew. Please save your changes elsewhere, refresh, and try again.\"}');
});
// Commenting this one out for now, since we are no longer throwing this error while we monitor
// it('should return error on applying patches', async ()=>{
// const brewFromClient = { version: 1, hash: '098f6bcd4621d373cade4e832627b4f6', patches: 'not a valid patch string' };
// const brewFromServer = { version: 1, text: 'test', title: 'Test Title', description: 'Test Description' };
// const req = {
// brew : brewFromServer,
// body : brewFromClient,
// };
// let err;
// try {
// await api.updateBrew(req, res);
// } catch (e) {
// err = e;
// }
// expect(err).toEqual(Error('Invalid patch string: not a valid patch string'));
// });
it('should save brew, no ID', async ()=>{
const brewFromClient = { version: 1, hash: '098f6bcd4621d373cade4e832627b4f6', patches: '' };
const brewFromServer = { version: 1, text: 'test', title: 'Test Title', description: 'Test Description' };
model.save = jest.fn((brew)=>{return brew;});
const req = {
brew : brewFromServer,
body : brewFromClient,
query : { saveToGoogle: false, removeFromGoogle: false }
};
await api.updateBrew(req, res);
expect(res.status).toHaveBeenCalledWith(200);
expect(res.send).toHaveBeenCalledWith(
expect.objectContaining({
_id : '1',
description : 'Test Description',
hash : '098f6bcd4621d373cade4e832627b4f6',
title : 'Test Title',
version : 2
})
);
});
});
});

View File

@@ -31,12 +31,7 @@ renderer.html = function (token) {
const openTag = html.substring(0, html.indexOf('>')+1);
html = html.substring(html.indexOf('>')+1);
html = html.substring(0, html.lastIndexOf('</div>'));
// Repeat the markdown processing for content inside the div, minus the preprocessing and postprocessing hooks which should only run once globally
const opts = Marked.defaults;
const tokens = Marked.lexer(html, opts);
Marked.walkTokens(tokens, opts.walkTokens);
return `${openTag} ${Marked.parser(tokens, opts)} </div>`;
return `${openTag} ${Marked.parse(html)} </div>`;
}
return html;
};

View File

@@ -492,7 +492,7 @@ body { counter-reset : page-numbers 0; }
.pageNumber { left : 30px; }
}
&:has(.resetCounting) { counter-set : page-numbers 1; }
.resetCounting { counter-set : page-numbers 1; }
&:not(:has(.skipCounting)) { counter-increment : page-numbers; }

View File

@@ -192,109 +192,7 @@ const diceFont = {
'df_d10_97' : 'df d10-97',
'df_d10_98' : 'df d10-98',
'df_d10_99' : 'df d10-99',
'df_d10_100' : 'df d10-100',
'df_d100_00' : 'df d100-00',
'df_d100_01' : 'df d100-01',
'df_d100_02' : 'df d100-02',
'df_d100_03' : 'df d100-03',
'df_d100_04' : 'df d100-04',
'df_d100_05' : 'df d100-05',
'df_d100_06' : 'df d100-06',
'df_d100_07' : 'df d100-07',
'df_d100_08' : 'df d100-08',
'df_d100_09' : 'df d100-09',
'df_d100_10' : 'df d100-10',
'df_d100_11' : 'df d100-11',
'df_d100_12' : 'df d100-12',
'df_d100_13' : 'df d100-13',
'df_d100_14' : 'df d100-14',
'df_d100_15' : 'df d100-15',
'df_d100_16' : 'df d100-16',
'df_d100_17' : 'df d100-17',
'df_d100_18' : 'df d100-18',
'df_d100_19' : 'df d100-19',
'df_d100_20' : 'df d100-20',
'df_d100_21' : 'df d100-21',
'df_d100_22' : 'df d100-22',
'df_d100_23' : 'df d100-23',
'df_d100_24' : 'df d100-24',
'df_d100_25' : 'df d100-25',
'df_d100_26' : 'df d100-26',
'df_d100_27' : 'df d100-27',
'df_d100_28' : 'df d100-28',
'df_d100_29' : 'df d100-29',
'df_d100_30' : 'df d100-30',
'df_d100_31' : 'df d100-31',
'df_d100_32' : 'df d100-32',
'df_d100_33' : 'df d100-33',
'df_d100_34' : 'df d100-34',
'df_d100_35' : 'df d100-35',
'df_d100_36' : 'df d100-36',
'df_d100_37' : 'df d100-37',
'df_d100_38' : 'df d100-38',
'df_d100_39' : 'df d100-39',
'df_d100_40' : 'df d100-40',
'df_d100_41' : 'df d100-41',
'df_d100_42' : 'df d100-42',
'df_d100_43' : 'df d100-43',
'df_d100_44' : 'df d100-44',
'df_d100_45' : 'df d100-45',
'df_d100_46' : 'df d100-46',
'df_d100_47' : 'df d100-47',
'df_d100_48' : 'df d100-48',
'df_d100_49' : 'df d100-49',
'df_d100_50' : 'df d100-50',
'df_d100_51' : 'df d100-51',
'df_d100_52' : 'df d100-52',
'df_d100_53' : 'df d100-53',
'df_d100_54' : 'df d100-54',
'df_d100_55' : 'df d100-55',
'df_d100_56' : 'df d100-56',
'df_d100_57' : 'df d100-57',
'df_d100_58' : 'df d100-58',
'df_d100_59' : 'df d100-59',
'df_d100_60' : 'df d100-60',
'df_d100_61' : 'df d100-61',
'df_d100_62' : 'df d100-62',
'df_d100_63' : 'df d100-63',
'df_d100_64' : 'df d100-64',
'df_d100_65' : 'df d100-65',
'df_d100_66' : 'df d100-66',
'df_d100_67' : 'df d100-67',
'df_d100_68' : 'df d100-68',
'df_d100_69' : 'df d100-69',
'df_d100_70' : 'df d100-70',
'df_d100_71' : 'df d100-71',
'df_d100_72' : 'df d100-72',
'df_d100_73' : 'df d100-73',
'df_d100_74' : 'df d100-74',
'df_d100_75' : 'df d100-75',
'df_d100_76' : 'df d100-76',
'df_d100_77' : 'df d100-77',
'df_d100_78' : 'df d100-78',
'df_d100_79' : 'df d100-79',
'df_d100_80' : 'df d100-80',
'df_d100_81' : 'df d100-81',
'df_d100_82' : 'df d100-82',
'df_d100_83' : 'df d100-83',
'df_d100_84' : 'df d100-84',
'df_d100_85' : 'df d100-85',
'df_d100_86' : 'df d100-86',
'df_d100_87' : 'df d100-87',
'df_d100_88' : 'df d100-88',
'df_d100_89' : 'df d100-89',
'df_d100_90' : 'df d100-90',
'df_d100_91' : 'df d100-91',
'df_d100_92' : 'df d100-92',
'df_d100_93' : 'df d100-93',
'df_d100_94' : 'df d100-94',
'df_d100_95' : 'df d100-95',
'df_d100_96' : 'df d100-96',
'df_d100_97' : 'df d100-97',
'df_d100_98' : 'df d100-98',
'df_d100_99' : 'df d100-99',
'df_d100_100' : 'df d100-100',
'df_d100' : 'df d100'
'df_d10_100' : 'df d10-100'
};
export default diceFont;

View File

@@ -6,6 +6,14 @@
src : url('../../../fonts/iconFonts/diceFont.woff2');
}
@font-face {
font-family : 'DiceFontD100';
src : url('../../../fonts/iconFonts/diceFontD100.woff2') format('woff2');
font-weight : normal;
font-style : normal;
font-display : block;
}
.df {
display : inline;
font-family : 'DiceFont';
@@ -25,19 +33,8 @@
&.F-minus::before { content : '\f191'; }
&.F-plus::before { content : '\f192'; }
&.F-zero::before { content : '\f193'; }
&.d10::before { content : '\f194'; }
&.d10-0::before { content : '\f100'; }
&.d10-1:before { content : '\f101'; }
&.d10-10::before { content : '\f102'; }
&.d10-2:before { content : '\f103'; }
&.d10-3::before { content : '\f104'; }
&.d10-4::before { content : '\f105'; }
&.d10-5::before { content : '\f106'; }
&.d10-6::before { content : '\f107'; }
&.d10-7::before { content : '\f108'; }
&.d10-8::before { content : '\f109'; }
&.d10-9::before { content : '\f10A'; }
&.d12::before { content : '\f195'; }
&.d10::before { content : '\f194'; }
&.d12::before { content : '\f195'; }
&.d12-1::before { content : '\f10b'; }
&.d12-10::before { content : '\f10c'; }
&.d12-11::before { content : '\f10d'; }
@@ -95,208 +92,6 @@
&.d8-6::before { content : '\f13c'; }
&.d8-7::before { content : '\f13d'; }
&.d8-8::before { content : '\f13e'; }
&.d10-00::before { content : '\f19C'; }
&.d10-01::before { content : '\f19D'; }
&.d10-02::before { content : '\f19E'; }
&.d10-03::before { content : '\f19F'; }
&.d10-04::before { content : '\f1A0'; }
&.d10-05::before { content : '\f1A1'; }
&.d10-06::before { content : '\f1A2'; }
&.d10-07::before { content : '\f1A3'; }
&.d10-08::before { content : '\f1A4'; }
&.d10-09::before { content : '\f1A5'; }
&.d10-11::before { content : '\f1A7'; }
&.d10-12::before { content : '\f1A8'; }
&.d10-13::before { content : '\f1A9'; }
&.d10-14::before { content : '\f1AA'; }
&.d10-15::before { content : '\f1AB'; }
&.d10-16::before { content : '\f1AC'; }
&.d10-17::before { content : '\f1AD'; }
&.d10-18::before { content : '\f1AE'; }
&.d10-19::before { content : '\f1AF'; }
&.d10-20::before { content : '\f1B0'; }
&.d10-21::before { content : '\f1B1'; }
&.d10-22::before { content : '\f1B2'; }
&.d10-23::before { content : '\f1B3'; }
&.d10-24::before { content : '\f1B4'; }
&.d10-25::before { content : '\f1B5'; }
&.d10-26::before { content : '\f1B6'; }
&.d10-27::before { content : '\f1B7'; }
&.d10-28::before { content : '\f1B8'; }
&.d10-29::before { content : '\f1B9'; }
&.d10-30::before { content : '\f1BA'; }
&.d10-31::before { content : '\f1BB'; }
&.d10-32::before { content : '\f1BC'; }
&.d10-33::before { content : '\f1BD'; }
&.d10-34::before { content : '\f1BE'; }
&.d10-35::before { content : '\f1BF'; }
&.d10-36::before { content : '\f1C0'; }
&.d10-37::before { content : '\f1C1'; }
&.d10-38::before { content : '\f1C2'; }
&.d10-39::before { content : '\f1C3'; }
&.d10-40::before { content : '\f1C4'; }
&.d10-41::before { content : '\f1C5'; }
&.d10-42::before { content : '\f1C6'; }
&.d10-43::before { content : '\f1C7'; }
&.d10-44::before { content : '\f1C8'; }
&.d10-45::before { content : '\f1C9'; }
&.d10-46::before { content : '\f1CA'; }
&.d10-47::before { content : '\f1CB'; }
&.d10-48::before { content : '\f1CC'; }
&.d10-49::before { content : '\f1CD'; }
&.d10-50::before { content : '\f1CE'; }
&.d10-51::before { content : '\f1CF'; }
&.d10-52::before { content : '\f1D0'; }
&.d10-53::before { content : '\f1D1'; }
&.d10-54::before { content : '\f1D2'; }
&.d10-55::before { content : '\f1D3'; }
&.d10-56::before { content : '\f1D4'; }
&.d10-57::before { content : '\f1D5'; }
&.d10-58::before { content : '\f1D6'; }
&.d10-59::before { content : '\f1D7'; }
&.d10-60::before { content : '\f1D8'; }
&.d10-61::before { content : '\f1D9'; }
&.d10-62::before { content : '\f1DA'; }
&.d10-63::before { content : '\f1DB'; }
&.d10-64::before { content : '\f1DC'; }
&.d10-65::before { content : '\f1DD'; }
&.d10-66::before { content : '\f1DE'; }
&.d10-67::before { content : '\f1DF'; }
&.d10-68::before { content : '\f1E0'; }
&.d10-69::before { content : '\f1E1'; }
&.d10-70::before { content : '\f1E2'; }
&.d10-71::before { content : '\f1E3'; }
&.d10-72::before { content : '\f1E4'; }
&.d10-73::before { content : '\f1E5'; }
&.d10-74::before { content : '\f1E6'; }
&.d10-75::before { content : '\f1E7'; }
&.d10-76::before { content : '\f1E8'; }
&.d10-77::before { content : '\f1E9'; }
&.d10-78::before { content : '\f1EA'; }
&.d10-79::before { content : '\f1EB'; }
&.d10-80::before { content : '\f1EC'; }
&.d10-81::before { content : '\f1ED'; }
&.d10-82::before { content : '\f1EE'; }
&.d10-83::before { content : '\f1EF'; }
&.d10-84::before { content : '\f1F0'; }
&.d10-85::before { content : '\f1F1'; }
&.d10-86::before { content : '\f1F2'; }
&.d10-87::before { content : '\f1F3'; }
&.d10-88::before { content : '\f1F4'; }
&.d10-89::before { content : '\f1F5'; }
&.d10-90::before { content : '\f1F6'; }
&.d10-91::before { content : '\f1F7'; }
&.d10-92::before { content : '\f1F8'; }
&.d10-93::before { content : '\f1F9'; }
&.d10-94::before { content : '\f1FA'; }
&.d10-95::before { content : '\f1FB'; }
&.d10-96::before { content : '\f1FC'; }
&.d10-97::before { content : '\f1FD'; }
&.d10-98::before { content : '\f1FE'; }
&.d10-99::before { content : '\f1FF'; }
&.d10-100::before { content : '\f200'; }
&.d100-00::before { content : '\f201'; }
&.d100-01::before { content : '\f202'; }
&.d100-02::before { content : '\f203'; }
&.d100-03::before { content : '\f204'; }
&.d100-04::before { content : '\f205'; }
&.d100-05::before { content : '\f206'; }
&.d100-06::before { content : '\f207'; }
&.d100-07::before { content : '\f208'; }
&.d100-08::before { content : '\f209'; }
&.d100-09::before { content : '\f20A'; }
&.d100-10::before { content : '\f20B'; }
&.d100-11::before { content : '\f20C'; }
&.d100-12::before { content : '\f20D'; }
&.d100-13::before { content : '\f20E'; }
&.d100-14::before { content : '\f20F'; }
&.d100-15::before { content : '\f210'; }
&.d100-16::before { content : '\f211'; }
&.d100-17::before { content : '\f212'; }
&.d100-18::before { content : '\f213'; }
&.d100-19::before { content : '\f214'; }
&.d100-20::before { content : '\f215'; }
&.d100-21::before { content : '\f216'; }
&.d100-22::before { content : '\f217'; }
&.d100-23::before { content : '\f218'; }
&.d100-24::before { content : '\f219'; }
&.d100-25::before { content : '\f21A'; }
&.d100-26::before { content : '\f21B'; }
&.d100-27::before { content : '\f21C'; }
&.d100-28::before { content : '\f21D'; }
&.d100-29::before { content : '\f21E'; }
&.d100-30::before { content : '\f21F'; }
&.d100-31::before { content : '\f220'; }
&.d100-32::before { content : '\f221'; }
&.d100-33::before { content : '\f222'; }
&.d100-34::before { content : '\f223'; }
&.d100-35::before { content : '\f224'; }
&.d100-36::before { content : '\f225'; }
&.d100-37::before { content : '\f226'; }
&.d100-38::before { content : '\f227'; }
&.d100-39::before { content : '\f228'; }
&.d100-40::before { content : '\f229'; }
&.d100-41::before { content : '\f22A'; }
&.d100-42::before { content : '\f22B'; }
&.d100-43::before { content : '\f22C'; }
&.d100-44::before { content : '\f22D'; }
&.d100-45::before { content : '\f22E'; }
&.d100-46::before { content : '\f22F'; }
&.d100-47::before { content : '\f230'; }
&.d100-48::before { content : '\f231'; }
&.d100-49::before { content : '\f232'; }
&.d100-50::before { content : '\f233'; }
&.d100-51::before { content : '\f234'; }
&.d100-52::before { content : '\f235'; }
&.d100-53::before { content : '\f236'; }
&.d100-54::before { content : '\f237'; }
&.d100-55::before { content : '\f238'; }
&.d100-56::before { content : '\f239'; }
&.d100-57::before { content : '\f23A'; }
&.d100-58::before { content : '\f23B'; }
&.d100-59::before { content : '\f23C'; }
&.d100-60::before { content : '\f23D'; }
&.d100-61::before { content : '\f23E'; }
&.d100-62::before { content : '\f23F'; }
&.d100-63::before { content : '\f240'; }
&.d100-64::before { content : '\f241'; }
&.d100-65::before { content : '\f242'; }
&.d100-66::before { content : '\f243'; }
&.d100-67::before { content : '\f244'; }
&.d100-68::before { content : '\f245'; }
&.d100-69::before { content : '\f246'; }
&.d100-70::before { content : '\f247'; }
&.d100-71::before { content : '\f248'; }
&.d100-72::before { content : '\f249'; }
&.d100-73::before { content : '\f24A'; }
&.d100-74::before { content : '\f24B'; }
&.d100-75::before { content : '\f24C'; }
&.d100-76::before { content : '\f24D'; }
&.d100-77::before { content : '\f24E'; }
&.d100-78::before { content : '\f24F'; }
&.d100-79::before { content : '\f250'; }
&.d100-80::before { content : '\f251'; }
&.d100-81::before { content : '\f252'; }
&.d100-82::before { content : '\f253'; }
&.d100-83::before { content : '\f254'; }
&.d100-84::before { content : '\f255'; }
&.d100-85::before { content : '\f256'; }
&.d100-86::before { content : '\f257'; }
&.d100-87::before { content : '\f258'; }
&.d100-88::before { content : '\f259'; }
&.d100-89::before { content : '\f25A'; }
&.d100-90::before { content : '\f25B'; }
&.d100-91::before { content : '\f25C'; }
&.d100-92::before { content : '\f25D'; }
&.d100-93::before { content : '\f25E'; }
&.d100-94::before { content : '\f25F'; }
&.d100-95::before { content : '\f260'; }
&.d100-96::before { content : '\f261'; }
&.d100-97::before { content : '\f262'; }
&.d100-98::before { content : '\f263'; }
&.d100-99::before { content : '\f264'; }
&.d100-100::before { content : '\f265'; }
&.d100::before { content : '\f266'; }
&.dot-d6::before { content : '\f19b'; }
&.dot-d6-1::before { content : '\f13f'; }
&.dot-d6-2::before { content : '\f140'; }
@@ -316,4 +111,568 @@
&.solid-small-dot-d6-4::before { content : '\f18c'; }
&.solid-small-dot-d6-5::before { content : '\f18d'; }
&.solid-small-dot-d6-6::before { content : '\f18e'; }
// Replacement d10
&.d10-0::before {
font-family : 'DiceFontD100';
content : '\e900';
}
&.d10-1::before {
font-family : 'DiceFontD100';
content : '\e901';
}
&.d10-2::before {
font-family : 'DiceFontD100';
content : '\e902';
}
&.d10-3::before {
font-family : 'DiceFontD100';
content : '\e903';
}
&.d10-4::before {
font-family : 'DiceFontD100';
content : '\e904';
}
&.d10-5::before {
font-family : 'DiceFontD100';
content : '\e905';
}
&.d10-6::before {
font-family : 'DiceFontD100';
content : '\e906';
}
&.d10-7::before {
font-family : 'DiceFontD100';
content : '\e907';
}
&.d10-8::before {
font-family : 'DiceFontD100';
content : '\e908';
}
&.d10-9::before {
font-family : 'DiceFontD100';
content : '\e909';
}
&.d10-10::before {
font-family : 'DiceFontD100';
content : '\e90a';
}
// d100
&.d10-00::before {
font-family : 'DiceFontD100';
content : '\e90b';
}
&.d10-01::before {
font-family : 'DiceFontD100';
content : '\e90c';
}
&.d10-02::before {
font-family : 'DiceFontD100';
content : '\e90d';
}
&.d10-03::before {
font-family : 'DiceFontD100';
content : '\e90e';
}
&.d10-04::before {
font-family : 'DiceFontD100';
content : '\e90f';
}
&.d10-05::before {
font-family : 'DiceFontD100';
content : '\e910';
}
&.d10-06::before {
font-family : 'DiceFontD100';
content : '\e911';
}
&.d10-07::before {
font-family : 'DiceFontD100';
content : '\e912';
}
&.d10-08::before {
font-family : 'DiceFontD100';
content : '\e913';
}
&.d10-09::before {
font-family : 'DiceFontD100';
content : '\e914';
}
&.d10-10::before {
font-family : 'DiceFontD100';
content : '\e915';
}
&.d10-11::before {
font-family : 'DiceFontD100';
content : '\e916';
}
&.d10-12::before {
font-family : 'DiceFontD100';
content : '\e917';
}
&.d10-13::before {
font-family : 'DiceFontD100';
content : '\e918';
}
&.d10-14::before {
font-family : 'DiceFontD100';
content : '\e919';
}
&.d10-15::before {
font-family : 'DiceFontD100';
content : '\e91a';
}
&.d10-16::before {
font-family : 'DiceFontD100';
content : '\e91b';
}
&.d10-17::before {
font-family : 'DiceFontD100';
content : '\e91c';
}
&.d10-18::before {
font-family : 'DiceFontD100';
content : '\e91d';
}
&.d10-19::before {
font-family : 'DiceFontD100';
content : '\e91e';
}
&.d10-20::before {
font-family : 'DiceFontD100';
content : '\e91f';
}
&.d10-21::before {
font-family : 'DiceFontD100';
content : '\e920';
}
&.d10-22::before {
font-family : 'DiceFontD100';
content : '\e921';
}
&.d10-23::before {
font-family : 'DiceFontD100';
content : '\e922';
}
&.d10-24::before {
font-family : 'DiceFontD100';
content : '\e923';
}
&.d10-25::before {
font-family : 'DiceFontD100';
content : '\e924';
}
&.d10-26::before {
font-family : 'DiceFontD100';
content : '\e925';
}
&.d10-27::before {
font-family : 'DiceFontD100';
content : '\e926';
}
&.d10-28::before {
font-family : 'DiceFontD100';
content : '\e927';
}
&.d10-29::before {
font-family : 'DiceFontD100';
content : '\e928';
}
&.d10-30::before {
font-family : 'DiceFontD100';
content : '\e929';
}
&.d10-31::before {
font-family : 'DiceFontD100';
content : '\e92a';
}
&.d10-32::before {
font-family : 'DiceFontD100';
content : '\e92b';
}
&.d10-33::before {
font-family : 'DiceFontD100';
content : '\e92c';
}
&.d10-34::before {
font-family : 'DiceFontD100';
content : '\e92d';
}
&.d10-35::before {
font-family : 'DiceFontD100';
content : '\e92e';
}
&.d10-36::before {
font-family : 'DiceFontD100';
content : '\e92f';
}
&.d10-37::before {
font-family : 'DiceFontD100';
content : '\e930';
}
&.d10-38::before {
font-family : 'DiceFontD100';
content : '\e931';
}
&.d10-39::before {
font-family : 'DiceFontD100';
content : '\e932';
}
&.d10-40::before {
font-family : 'DiceFontD100';
content : '\e933';
}
&.d10-41::before {
font-family : 'DiceFontD100';
content : '\e934';
}
&.d10-42::before {
font-family : 'DiceFontD100';
content : '\e935';
}
&.d10-43::before {
font-family : 'DiceFontD100';
content : '\e936';
}
&.d10-44::before {
font-family : 'DiceFontD100';
content : '\e937';
}
&.d10-45::before {
font-family : 'DiceFontD100';
content : '\e938';
}
&.d10-46::before {
font-family : 'DiceFontD100';
content : '\e939';
}
&.d10-47::before {
font-family : 'DiceFontD100';
content : '\e93a';
}
&.d10-48::before {
font-family : 'DiceFontD100';
content : '\e93b';
}
&.d10-49::before {
font-family : 'DiceFontD100';
content : '\e93c';
}
&.d10-50::before {
font-family : 'DiceFontD100';
content : '\e93d';
}
&.d10-51::before {
font-family : 'DiceFontD100';
content : '\e93e';
}
&.d10-52::before {
font-family : 'DiceFontD100';
content : '\e93f';
}
&.d10-53::before {
font-family : 'DiceFontD100';
content : '\e940';
}
&.d10-54::before {
font-family : 'DiceFontD100';
content : '\e941';
}
&.d10-55::before {
font-family : 'DiceFontD100';
content : '\e942';
}
&.d10-56::before {
font-family : 'DiceFontD100';
content : '\e943';
}
&.d10-57::before {
font-family : 'DiceFontD100';
content : '\e944';
}
&.d10-58::before {
font-family : 'DiceFontD100';
content : '\e945';
}
&.d10-59::before {
font-family : 'DiceFontD100';
content : '\e946';
}
&.d10-60::before {
font-family : 'DiceFontD100';
content : '\e947';
}
&.d10-61::before {
font-family : 'DiceFontD100';
content : '\e948';
}
&.d10-62::before {
font-family : 'DiceFontD100';
content : '\e949';
}
&.d10-63::before {
font-family : 'DiceFontD100';
content : '\e94a';
}
&.d10-64::before {
font-family : 'DiceFontD100';
content : '\e94b';
}
&.d10-65::before {
font-family : 'DiceFontD100';
content : '\e94c';
}
&.d10-66::before {
font-family : 'DiceFontD100';
content : '\e94d';
}
&.d10-67::before {
font-family : 'DiceFontD100';
content : '\e94e';
}
&.d10-68::before {
font-family : 'DiceFontD100';
content : '\e94f';
}
&.d10-69::before {
font-family : 'DiceFontD100';
content : '\e950';
}
&.d10-70::before {
font-family : 'DiceFontD100';
content : '\e951';
}
&.d10-71::before {
font-family : 'DiceFontD100';
content : '\e952';
}
&.d10-72::before {
font-family : 'DiceFontD100';
content : '\e953';
}
&.d10-73::before {
font-family : 'DiceFontD100';
content : '\e954';
}
&.d10-74::before {
font-family : 'DiceFontD100';
content : '\e955';
}
&.d10-75::before {
font-family : 'DiceFontD100';
content : '\e956';
}
&.d10-76::before {
font-family : 'DiceFontD100';
content : '\e957';
}
&.d10-77::before {
font-family : 'DiceFontD100';
content : '\e958';
}
&.d10-78::before {
font-family : 'DiceFontD100';
content : '\e959';
}
&.d10-79::before {
font-family : 'DiceFontD100';
content : '\e95a';
}
&.d10-80::before {
font-family : 'DiceFontD100';
content : '\e95b';
}
&.d10-81::before {
font-family : 'DiceFontD100';
content : '\e95c';
}
&.d10-82::before {
font-family : 'DiceFontD100';
content : '\e95d';
}
&.d10-83::before {
font-family : 'DiceFontD100';
content : '\e95e';
}
&.d10-84::before {
font-family : 'DiceFontD100';
content : '\e95f';
}
&.d10-85::before {
font-family : 'DiceFontD100';
content : '\e960';
}
&.d10-86::before {
font-family : 'DiceFontD100';
content : '\e961';
}
&.d10-87::before {
font-family : 'DiceFontD100';
content : '\e962';
}
&.d10-88::before {
font-family : 'DiceFontD100';
content : '\e963';
}
&.d10-89::before {
font-family : 'DiceFontD100';
content : '\e964';
}
&.d10-90::before {
font-family : 'DiceFontD100';
content : '\e965';
}
&.d10-91::before {
font-family : 'DiceFontD100';
content : '\e966';
}
&.d10-92::before {
font-family : 'DiceFontD100';
content : '\e967';
}
&.d10-93::before {
font-family : 'DiceFontD100';
content : '\e968';
}
&.d10-94::before {
font-family : 'DiceFontD100';
content : '\e969';
}
&.d10-95::before {
font-family : 'DiceFontD100';
content : '\e96a';
}
&.d10-96::before {
font-family : 'DiceFontD100';
content : '\e96b';
}
&.d10-97::before {
font-family : 'DiceFontD100';
content : '\e96c';
}
&.d10-98::before {
font-family : 'DiceFontD100';
content : '\e96d';
}
&.d10-99::before {
font-family : 'DiceFontD100';
content : '\e96e';
}
&.d10-100::before {
font-family : 'DiceFontD100';
content : '\e96f';
}
}

Binary file not shown.