mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-03-22 08:58:11 +00:00
add small text
This commit is contained in:
@@ -16,7 +16,7 @@ const Combobox = createReactClass({
|
|||||||
suggestMethod : 'includes',
|
suggestMethod : 'includes',
|
||||||
filterOn : [] // should allow as array to filter on multiple attributes, or even custom filter
|
filterOn : [] // should allow as array to filter on multiple attributes, or even custom filter
|
||||||
},
|
},
|
||||||
valuePatterns: [/.+/]
|
valuePatterns: /.+/
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
getInitialState : function() {
|
getInitialState : function() {
|
||||||
|
|||||||
@@ -339,9 +339,12 @@ const MetadataEditor = createReactClass({
|
|||||||
{this.renderThumbnail()}
|
{this.renderThumbnail()}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<TagInput label='tags' valuePatterns={/^(?:(?:group|meta|system|type):)?[A-Za-z0-9][A-Za-z0-9 \/.\-]{0,40}$/}
|
<TagInput
|
||||||
|
label='tags'
|
||||||
|
valuePatterns={/^(?:(?:group|meta|system|type):)?[A-Za-z0-9][A-Za-z0-9 \/.&_\-]{0,40}$/}
|
||||||
placeholder='add tag' unique={true}
|
placeholder='add tag' unique={true}
|
||||||
values={this.props.metadata.tags}
|
values={this.props.metadata.tags}
|
||||||
|
smallText='You may start tags with "type", "system", "group" or "meta" followed by a colon ":", these will be colored in your userpage.'
|
||||||
onChange={(e)=>this.handleFieldChange('tags', e)}
|
onChange={(e)=>this.handleFieldChange('tags', e)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -355,11 +358,13 @@ const MetadataEditor = createReactClass({
|
|||||||
|
|
||||||
{this.renderAuthors()}
|
{this.renderAuthors()}
|
||||||
|
|
||||||
<TagInput label='invited authors' valuePatterns={/.+/}
|
<TagInput
|
||||||
|
label='invited authors'
|
||||||
|
valuePatterns={/.+/}
|
||||||
validators={[(v)=>!this.props.metadata.authors?.includes(v)]}
|
validators={[(v)=>!this.props.metadata.authors?.includes(v)]}
|
||||||
placeholder='invite author' unique={true}
|
placeholder='invite author' unique={true}
|
||||||
values={this.props.metadata.invitedAuthors}
|
values={this.props.metadata.invitedAuthors}
|
||||||
notes={['Invited author usernames are case sensitive.', 'After adding an invited author, send them the edit link. There, they can choose to accept or decline the invitation.']}
|
smallText='Invited author usernames are case sensitive. After adding an invited author, send them the edit link. There, they can choose to accept or decline the invitation.'
|
||||||
onChange={(e)=>this.handleFieldChange('invitedAuthors', e)}
|
onChange={(e)=>this.handleFieldChange('invitedAuthors', e)}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|||||||
@@ -169,108 +169,28 @@ export default [
|
|||||||
|
|
||||||
"meta:v3",
|
"meta:v3",
|
||||||
"meta:Legacy",
|
"meta:Legacy",
|
||||||
];
|
|
||||||
|
|
||||||
const ReadList = [
|
// ############################# Media / Pop Culture
|
||||||
// Systems / Editions
|
|
||||||
"5e",
|
|
||||||
"5th Edition",
|
|
||||||
"5.5e",
|
|
||||||
"5e'24",
|
|
||||||
"5.24",
|
|
||||||
"5e 2024",
|
|
||||||
"D&D 5e",
|
|
||||||
"DnD 5e",
|
|
||||||
"DnD5e",
|
|
||||||
"D&D 5e24",
|
|
||||||
"DnD5e24",
|
|
||||||
"D&D 2024",
|
|
||||||
"system:pf2e",
|
|
||||||
"system:dnd5.5",
|
|
||||||
"system:dnd5e",
|
|
||||||
"system:dnd",
|
|
||||||
"system:5e",
|
|
||||||
"system:d&d5e",
|
|
||||||
"system:D&D 5e24",
|
|
||||||
"system:book clone",
|
|
||||||
"system:curse of strahd",
|
|
||||||
"system:descent into avernus",
|
|
||||||
"system:GM Binder",
|
|
||||||
"system:Ord",
|
|
||||||
"system:sf2e",
|
|
||||||
"system:Mutants and Masterminds",
|
|
||||||
"system:2e",
|
|
||||||
"system:class",
|
|
||||||
"PF2e",
|
|
||||||
"pf2e",
|
|
||||||
"3.5e",
|
|
||||||
"3.5",
|
|
||||||
"system:pf2e",
|
|
||||||
"DnD",
|
|
||||||
"DND",
|
|
||||||
"dnd",
|
|
||||||
"dnd-2014",
|
|
||||||
"dnd-2024",
|
|
||||||
"dnd5e",
|
|
||||||
"DnD 5e",
|
|
||||||
"DnD5e24",
|
|
||||||
"DnDBeyond",
|
|
||||||
"DnDBehindTheScreen",
|
|
||||||
"Dd5",
|
|
||||||
"DD5",
|
|
||||||
"dd5",
|
|
||||||
"dd5e",
|
|
||||||
"system:D&D",
|
|
||||||
"system:D&D 5e24",
|
|
||||||
"system:d&d5e",
|
|
||||||
"system:5e",
|
|
||||||
"system:daggerheart",
|
|
||||||
"system:dnd5e",
|
|
||||||
"system:dnd5.5",
|
|
||||||
"system:dnd",
|
|
||||||
"system:GM Binder",
|
|
||||||
"system:Ord",
|
|
||||||
"system:sf2e",
|
|
||||||
"system:curse of strahd",
|
|
||||||
"system:descent into avernus",
|
|
||||||
"system:class",
|
|
||||||
"system:Mutants and Masterminds",
|
|
||||||
"system:2e",
|
|
||||||
|
|
||||||
// Media / Pop Culture
|
|
||||||
"One Piece",
|
"One Piece",
|
||||||
"One Piece DND",
|
|
||||||
"Luffy",
|
|
||||||
"Dragon Ball",
|
"Dragon Ball",
|
||||||
"Dragon Ball Z",
|
"Dragon Ball Z",
|
||||||
"Dragon Ball Z TTRPG",
|
|
||||||
"Dragon Ball Z RPG",
|
|
||||||
"Dragon Ball Z DND",
|
|
||||||
"Dragon Ball Z 5e",
|
|
||||||
"Naruto",
|
"Naruto",
|
||||||
"Naruto 5e",
|
|
||||||
"Jujutsu Kaisen",
|
"Jujutsu Kaisen",
|
||||||
"Fairy Tail",
|
"Fairy Tail",
|
||||||
"Final Fantasy",
|
"Final Fantasy",
|
||||||
"Final Fantasy XIV",
|
|
||||||
"Final Fantasy 7 Remake",
|
|
||||||
"FF7",
|
|
||||||
"FFXI",
|
|
||||||
"Kingdom Hearts",
|
"Kingdom Hearts",
|
||||||
"Elder Scrolls",
|
"Elder Scrolls",
|
||||||
"Elder Scrolls Offline",
|
|
||||||
"Skyrim",
|
"Skyrim",
|
||||||
"WoW",
|
"WoW",
|
||||||
"World of Warcraft",
|
"World of Warcraft",
|
||||||
"Marvel Comics",
|
"Marvel Comics",
|
||||||
"DC Comics",
|
"DC Comics",
|
||||||
"Pokémon",
|
|
||||||
"Pokemon",
|
"Pokemon",
|
||||||
"League of Legends",
|
"League of Legends",
|
||||||
"Runeterra",
|
"Runeterra",
|
||||||
|
"Arcane",
|
||||||
"Yu-Gi-Oh",
|
"Yu-Gi-Oh",
|
||||||
"Minecraft",
|
"Minecraft",
|
||||||
"Minecraft Mods",
|
|
||||||
"Don't Starve",
|
"Don't Starve",
|
||||||
"Witcher",
|
"Witcher",
|
||||||
"Witcher 3",
|
"Witcher 3",
|
||||||
@@ -293,49 +213,5 @@ const ReadList = [
|
|||||||
"Critical Role",
|
"Critical Role",
|
||||||
"Star Wars",
|
"Star Wars",
|
||||||
"SW5e",
|
"SW5e",
|
||||||
"SW5E",
|
|
||||||
"Star Wars 5e",
|
"Star Wars 5e",
|
||||||
|
|
||||||
// Tools / Resources / Templates / Notes
|
|
||||||
"Template",
|
|
||||||
"Templates",
|
|
||||||
"Style Template",
|
|
||||||
"meta:Template",
|
|
||||||
"meta:Theme",
|
|
||||||
"meta:5e24 Style",
|
|
||||||
"meta:khaoz age",
|
|
||||||
"meta:gratis",
|
|
||||||
"meta:free",
|
|
||||||
"meta:Sheet",
|
|
||||||
"meta:documentation",
|
|
||||||
"meta:npc",
|
|
||||||
"meta:User Guide",
|
|
||||||
"fa-solid fa-sheet-plastic:Ficha",
|
|
||||||
"tag:Class",
|
|
||||||
"tag:Rules",
|
|
||||||
"tag:Spells",
|
|
||||||
"tag:Adventure",
|
|
||||||
"tag:Spell List",
|
|
||||||
"tag:TAoF&F",
|
|
||||||
"tag:Berean",
|
|
||||||
"resource",
|
|
||||||
"Resources",
|
|
||||||
"support",
|
|
||||||
"user help",
|
|
||||||
"notes",
|
|
||||||
"note",
|
|
||||||
"quick ref",
|
|
||||||
"reminder cards",
|
|
||||||
"syntax",
|
|
||||||
"css",
|
|
||||||
"custom css",
|
|
||||||
"example",
|
|
||||||
"examples",
|
|
||||||
"snippet",
|
|
||||||
"snippets",
|
|
||||||
"tables",
|
|
||||||
"chart",
|
|
||||||
"stat block",
|
|
||||||
"stat blocks",
|
|
||||||
"statblock",
|
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import Combobox from "../../../components/combobox.jsx";
|
|||||||
|
|
||||||
import tagSuggestionList from "./curatedTagSuggestionList.js";
|
import tagSuggestionList from "./curatedTagSuggestionList.js";
|
||||||
|
|
||||||
const TagInput = ({ label, valuePatterns, values = [], unique = true, placeholder = "", onChange }) => {
|
const TagInput = ({ label, valuePatterns, values = [], unique = true, placeholder = "", smallText = "", onChange }) => {
|
||||||
const [tagList, setTagList] = useState(
|
const [tagList, setTagList] = useState(
|
||||||
values.map((value) => ({
|
values.map((value) => ({
|
||||||
value,
|
value,
|
||||||
@@ -12,7 +12,6 @@ const TagInput = ({ label, valuePatterns, values = [], unique = true, placeholde
|
|||||||
editing: false,
|
editing: false,
|
||||||
})),
|
})),
|
||||||
);
|
);
|
||||||
//console.log(label, values, placeholder);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const incoming = values || [];
|
const incoming = values || [];
|
||||||
@@ -179,7 +178,7 @@ const TagInput = ({ label, valuePatterns, values = [], unique = true, placeholde
|
|||||||
className="tagInput-dropdown"
|
className="tagInput-dropdown"
|
||||||
default=""
|
default=""
|
||||||
placeholder={placeholder}
|
placeholder={placeholder}
|
||||||
options={label === "tags" ? suggestionOptions : []} // always array
|
options={label === "tags" ? suggestionOptions : []}
|
||||||
autoSuggest={
|
autoSuggest={
|
||||||
label === "tags"
|
label === "tags"
|
||||||
? {
|
? {
|
||||||
@@ -187,7 +186,7 @@ const TagInput = ({ label, valuePatterns, values = [], unique = true, placeholde
|
|||||||
clearAutoSuggestOnClick: true,
|
clearAutoSuggestOnClick: true,
|
||||||
filterOn: ["value", "title"],
|
filterOn: ["value", "title"],
|
||||||
}
|
}
|
||||||
: { suggestMethod: "includes", clearAutoSuggestOnClick: true, filterOn: [] } // empty filter
|
: { suggestMethod: "includes", clearAutoSuggestOnClick: true, filterOn: [] }
|
||||||
}
|
}
|
||||||
valuePatterns={valuePatterns.source}
|
valuePatterns={valuePatterns.source}
|
||||||
onSelect={(value) => submitTag(value)}
|
onSelect={(value) => submitTag(value)}
|
||||||
@@ -199,6 +198,7 @@ const TagInput = ({ label, valuePatterns, values = [], unique = true, placeholde
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
{smallText.length !== 0 && <small>{smallText}</small>}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user