Add support for never_be_nested metadata.

pull/43/head
Atul Varma 2021-02-28 19:10:53 -05:00
rodzic c62214186b
commit b1b0176e4a
3 zmienionych plików z 15 dodań i 1 usunięć

Wyświetl plik

@ -39,7 +39,10 @@ const ATTACHMENT_SYMBOLS = ROOT_SYMBOLS;
/** Symbols that can be nested within any part of a creature. */
const NESTED_SYMBOLS = SvgVocabulary.filter(
(data) => data.meta?.always_nest !== true
// Since we don't currently support recursive nesting, ignore anything that
// wants nested children.
(data) =>
data.meta?.always_nest !== true && data.meta?.never_be_nested !== true
);
/**

Wyświetl plik

@ -10,11 +10,18 @@ type SvgSymbolMetadataBooleans = {
* be nested inside another symbol's nesting area.
*/
always_be_nested?: boolean;
/**
* If true, this indicates that the symbol should never
* be nested inside another symbol's nesting area.
*/
never_be_nested?: boolean;
};
const METADATA_BOOLEANS: Set<keyof SvgSymbolMetadataBooleans> = new Set([
"always_nest",
"always_be_nested",
"never_be_nested",
]);
function isSvgSymbolMetadataBoolean(

Wyświetl plik

@ -15,3 +15,7 @@ always_nest = false
# If true, this indicates that the symbol should always
# be nested inside another symbol's nesting area.
always_be_nested = false
# If true, this indicates that the symbol should never
# be nested inside another symbol's nesting area.
never_be_nested = false