feat: events (#717)

This commit is contained in:
Daniel Lautzenheiser
2023-04-19 23:49:53 -04:00
committed by GitHub
parent 455bcdc0f2
commit 79877fcd1f
30 changed files with 72 additions and 56 deletions

View File

@ -50,7 +50,9 @@ function validateItem(field: ListField, item: ValueOrNestedValue) {
if (typeof item !== 'object') {
console.warn(
`'${field.name}' field item value value should be an object but is a '${typeof item}'`,
`[StaticCMS] '${
field.name
}' field item value value should be an object but is a '${typeof item}'`,
);
return false;
}

View File

@ -333,7 +333,7 @@ ${bodyRows.join('\n')}`;
)}${shortcodeConfig.closeTag}`;
default:
console.warn('Unrecognized slate node, proceeding as text', `"${type}"`, chunk);
console.warn('[StaticCMS] Unrecognized slate node, proceeding as text', `"${type}"`, chunk);
return children;
}
}

View File

@ -276,7 +276,7 @@ export default function deserializeMarkdown(node: MdastNode, options: Options) {
case 'br':
return { type: NodeTypes.paragraph, children: [{ text: '' }] };
default:
console.warn('unrecognized mdx flow element', node);
console.warn('[StaticCMS] Unrecognized mdx flow element', node);
break;
}
}
@ -335,7 +335,7 @@ export default function deserializeMarkdown(node: MdastNode, options: Options) {
...persistLeafFormats(children as Array<MdastNode>),
} as TextNode;
default:
console.warn('unrecognized mdx text element', node);
console.warn('[StaticCMS] Unrecognized mdx text element', node);
break;
}
}
@ -356,7 +356,7 @@ export default function deserializeMarkdown(node: MdastNode, options: Options) {
return nodes.map(node => (node.type === 'text' ? { text: node.value ?? '' } : node));
default:
console.warn('Unrecognized mdast node, proceeding as text', node);
console.warn('[StaticCMS] Unrecognized mdast node, proceeding as text', node);
return { text: node.value || '' };
}
}