- {createableCollections.length > 0 && (
+ {creatableCollections.length > 0 && (
- {createableCollections.map(collection => (
+ {creatableCollections.map(collection => (
handleCreatePostClick(collection.name)}
diff --git a/packages/core/src/components/Collection/Entries/EntryCard.tsx b/packages/core/src/components/Collection/Entries/EntryCard.tsx
index f5f64aff..b0c3642d 100644
--- a/packages/core/src/components/Collection/Entries/EntryCard.tsx
+++ b/packages/core/src/components/Collection/Entries/EntryCard.tsx
@@ -54,7 +54,7 @@ const EntryCard = ({
interface EntryCardOwnProps {
entry: Entry;
- inferedFields: {
+ inferredFields: {
titleField?: string | null | undefined;
descriptionField?: string | null | undefined;
imageField?: string | null | undefined;
@@ -67,11 +67,11 @@ interface EntryCardOwnProps {
}
function mapStateToProps(state: RootState, ownProps: EntryCardOwnProps) {
- const { entry, inferedFields, collection } = ownProps;
+ const { entry, inferredFields, collection } = ownProps;
const entryData = entry.data;
- let image = inferedFields.imageField
- ? (entryData?.[inferedFields.imageField] as string | undefined)
+ let image = inferredFields.imageField
+ ? (entryData?.[inferredFields.imageField] as string | undefined)
: undefined;
if (image) {
@@ -86,7 +86,7 @@ function mapStateToProps(state: RootState, ownProps: EntryCardOwnProps) {
image,
imageField:
'fields' in collection
- ? collection.fields?.find(f => f.name === inferedFields.imageField && f.widget === 'image')
+ ? collection.fields?.find(f => f.name === inferredFields.imageField && f.widget === 'image')
: undefined,
isLoadingAsset,
};
diff --git a/packages/core/src/components/Collection/Entries/EntryListing.tsx b/packages/core/src/components/Collection/Entries/EntryListing.tsx
index 0d85e4d0..17a63c07 100644
--- a/packages/core/src/components/Collection/Entries/EntryListing.tsx
+++ b/packages/core/src/components/Collection/Entries/EntryListing.tsx
@@ -4,7 +4,7 @@ import { Waypoint } from 'react-waypoint';
import { VIEW_STYLE_LIST } from '@staticcms/core/constants/collectionViews';
import { transientOptions } from '@staticcms/core/lib';
-import { selectFields, selectInferedField } from '@staticcms/core/lib/util/collection.util';
+import { selectFields, selectInferredField } from '@staticcms/core/lib/util/collection.util';
import EntryCard from './EntryCard';
import type { CollectionViewStyle } from '@staticcms/core/constants/collectionViews';
@@ -86,12 +86,12 @@ const EntryListing = ({
return {};
}
- const titleField = selectInferedField(collection, 'title');
- const descriptionField = selectInferedField(collection, 'description');
- const imageField = selectInferedField(collection, 'image');
+ const titleField = selectInferredField(collection, 'title');
+ const descriptionField = selectInferredField(collection, 'description');
+ const imageField = selectInferredField(collection, 'image');
const fields = selectFields(collection);
- const inferedFields = [titleField, descriptionField, imageField];
- const remainingFields = fields && fields.filter(f => inferedFields.indexOf(f.name) === -1);
+ const inferredFields = [titleField, descriptionField, imageField];
+ const remainingFields = fields && fields.filter(f => inferredFields.indexOf(f.name) === -1);
return { titleField, descriptionField, imageField, remainingFields };
},
[],
@@ -99,11 +99,11 @@ const EntryListing = ({
const renderedCards = useMemo(() => {
if ('collection' in otherProps) {
- const inferedFields = inferFields(otherProps.collection);
+ const inferredFields = inferFields(otherProps.collection);
return entries.map((entry, idx) => (
coll.name === collectionName,
);
const collectionLabel = !isSingleCollectionInList ? collection?.label : undefined;
- const inferedFields = inferFields(collection);
+ const inferredFields = inferFields(collection);
return collection ? (
diff --git a/packages/core/src/components/Editor/EditorControlPane/EditorControlPane.tsx b/packages/core/src/components/Editor/EditorControlPane/EditorControlPane.tsx
index aaa31488..02ccd7a1 100644
--- a/packages/core/src/components/Editor/EditorControlPane/EditorControlPane.tsx
+++ b/packages/core/src/components/Editor/EditorControlPane/EditorControlPane.tsx
@@ -46,7 +46,7 @@ const LocaleRowWrapper = styled('div')`
gap: 8px;
`;
-const DefaultLocaleWrittingIn = styled('div')`
+const DefaultLocaleWritingIn = styled('div')`
display: flex;
align-items: center;
height: 36.5px;
@@ -89,7 +89,7 @@ const LocaleDropdown = ({
);
if (!canChangeLocale) {
- return {dropdownText} ;
+ return {dropdownText} ;
}
return (
diff --git a/packages/core/src/components/Editor/EditorPreviewPane/EditorPreviewPane.tsx b/packages/core/src/components/Editor/EditorPreviewPane/EditorPreviewPane.tsx
index 84685bbf..993d8824 100644
--- a/packages/core/src/components/Editor/EditorPreviewPane/EditorPreviewPane.tsx
+++ b/packages/core/src/components/Editor/EditorPreviewPane/EditorPreviewPane.tsx
@@ -10,7 +10,7 @@ import { getAsset as getAssetAction } from '@staticcms/core/actions/media';
import { ErrorBoundary } from '@staticcms/core/components/UI';
import { lengths } from '@staticcms/core/components/UI/styles';
import { getPreviewStyles, getPreviewTemplate, resolveWidget } from '@staticcms/core/lib/registry';
-import { selectTemplateName, useInferedFields } from '@staticcms/core/lib/util/collection.util';
+import { selectTemplateName, useInferredFields } from '@staticcms/core/lib/util/collection.util';
import { selectField } from '@staticcms/core/lib/util/field.util';
import { selectIsLoadingAsset } from '@staticcms/core/reducers/selectors/medias';
import { getTypedFieldForValue } from '@staticcms/list/typedListHelpers';
@@ -92,7 +92,7 @@ function getWidgetFor(
name: string,
fields: Field[],
entry: Entry,
- inferedFields: Record,
+ inferredFields: Record,
getAsset: GetAssetFunction,
widgetFields: Field[] = fields,
values: EntryData = entry.data,
@@ -116,7 +116,7 @@ function getWidgetFor(
collection,
fields,
entry,
- inferedFields,
+ inferredFields,
getAsset,
field.fields,
value as EntryData | EntryData[],
@@ -130,7 +130,7 @@ function getWidgetFor(
collection,
field,
entry,
- inferedFields,
+ inferredFields,
getAsset,
value as EntryData[],
),
@@ -138,7 +138,7 @@ function getWidgetFor(
}
const labelledWidgets = ['string', 'text', 'number'];
- const inferedField = Object.entries(inferedFields)
+ const inferredField = Object.entries(inferredFields)
.filter(([key]) => {
const fieldToMatch = selectField(collection, key);
return fieldToMatch === fieldWithWidgets;
@@ -146,8 +146,8 @@ function getWidgetFor(
.map(([, value]) => value)[0];
let renderedValue: ValueOrNestedValue | ReactNode = value;
- if (inferedField) {
- renderedValue = inferedField.defaultPreview(String(value));
+ if (inferredField) {
+ renderedValue = inferredField.defaultPreview(String(value));
} else if (
value &&
fieldWithWidgets.widget &&
@@ -235,7 +235,7 @@ function widgetsForNestedFields(
collection: Collection,
fields: Field[],
entry: Entry,
- inferedFields: Record,
+ inferredFields: Record,
getAsset: GetAssetFunction,
widgetFields: Field[],
values: EntryData,
@@ -249,7 +249,7 @@ function widgetsForNestedFields(
field.name,
fields,
entry,
- inferedFields,
+ inferredFields,
getAsset,
widgetFields,
values,
@@ -267,7 +267,7 @@ function getTypedNestedWidgets(
collection: Collection,
field: ListField,
entry: Entry,
- inferedFields: Record,
+ inferredFields: Record,
getAsset: GetAssetFunction,
values: EntryData[],
) {
@@ -283,7 +283,7 @@ function getTypedNestedWidgets(
collection,
itemType.fields,
entry,
- inferedFields,
+ inferredFields,
getAsset,
itemType.fields,
value,
@@ -301,7 +301,7 @@ function getNestedWidgets(
collection: Collection,
fields: Field[],
entry: Entry,
- inferedFields: Record,
+ inferredFields: Record,
getAsset: GetAssetFunction,
widgetFields: Field[],
values: EntryData | EntryData[],
@@ -314,7 +314,7 @@ function getNestedWidgets(
collection,
fields,
entry,
- inferedFields,
+ inferredFields,
getAsset,
widgetFields,
value,
@@ -328,7 +328,7 @@ function getNestedWidgets(
collection,
fields,
entry,
- inferedFields,
+ inferredFields,
getAsset,
widgetFields,
values,
@@ -338,7 +338,7 @@ function getNestedWidgets(
const PreviewPane = (props: TranslatedProps) => {
const { entry, collection, config, fields, previewInFrame, getAsset, t } = props;
- const inferedFields = useInferedFields(collection);
+ const inferredFields = useInferredFields(collection);
const handleGetAsset = useCallback(
(path: string, field?: Field) => {
@@ -359,11 +359,11 @@ const PreviewPane = (props: TranslatedProps) => {
name,
fields,
entry,
- inferedFields,
+ inferredFields,
handleGetAsset,
);
},
- [collection, config, entry, fields, handleGetAsset, inferedFields],
+ [collection, config, entry, fields, handleGetAsset, inferredFields],
);
/**
@@ -413,7 +413,7 @@ const PreviewPane = (props: TranslatedProps) => {
field.name,
fields,
entry,
- inferedFields,
+ inferredFields,
handleGetAsset,
nestedFields,
val,
@@ -445,7 +445,7 @@ const PreviewPane = (props: TranslatedProps) => {
field.name,
fields,
entry,
- inferedFields,
+ inferredFields,
handleGetAsset,
nestedFields,
value,
@@ -457,7 +457,7 @@ const PreviewPane = (props: TranslatedProps) => {
}, {} as Record),
};
},
- [collection, config.config, entry, fields, handleGetAsset, inferedFields],
+ [collection, config.config, entry, fields, handleGetAsset, inferredFields],
);
const previewStyles = useMemo(
diff --git a/packages/core/src/formats/util/j-toml.js b/packages/core/src/formats/util/j-toml.js
index 60e7e2d8..8f8c7d8a 100644
--- a/packages/core/src/formats/util/j-toml.js
+++ b/packages/core/src/formats/util/j-toml.js
@@ -2097,7 +2097,7 @@ const equalStaticArray = function * ( table , finalKey ,
}
else {
if ( lineRest[0]===']' ) { break; }
- throw throws(SyntaxError$1(`Unexpect character in static array item value` + where(', which is found at ')));
+ throw throws(SyntaxError$1(`Unexpected character in static array item value` + where(', which is found at ')));
}
}
inline===null || beInline(staticArray, inline);
@@ -2231,7 +2231,7 @@ const Root = () => {
const { leadingKeys, finalKey, asArrayItem, tag, lineRest } = TABLE_DEFINITION_exec_groups(line, parseKeys);
const table = prepareTable(rootTable, leadingKeys);
if ( lineRest ) {
- lineRest[0]==='#' || throws(SyntaxError$1(`Unexpect charachtor after table header` + where(' at ')));
+ lineRest[0]==='#' || throws(SyntaxError$1(`Unexpected charachtor after table header` + where(' at ')));
}
lastSectionTable = appendTable(table, finalKey, asArrayItem, tag);
preserveComment && lineRest && ( lastSectionTable[commentForThis] = asArrayItem ? lineRest.slice(1) : table[commentFor(finalKey)] = lineRest.slice(1) );
@@ -2244,7 +2244,7 @@ const Root = () => {
let rest = assign(forComment);
typeof rest==='string' || ( rest = x (rest) );
if ( rest ) {
- rest[0]==='#' || throws(SyntaxError$1(`Unexpect charachtor after key/value pair` + where(' at ')));
+ rest[0]==='#' || throws(SyntaxError$1(`Unexpected charachtor after key/value pair` + where(' at ')));
if ( preserveComment ) { forComment.table[commentFor(forComment.finalKey)] = rest.slice(1); }
}
}
diff --git a/packages/core/src/lib/auth/pkce-oauth.ts b/packages/core/src/lib/auth/pkce-oauth.ts
index 17d5de75..6944e351 100644
--- a/packages/core/src/lib/auth/pkce-oauth.ts
+++ b/packages/core/src/lib/auth/pkce-oauth.ts
@@ -16,7 +16,7 @@ async function sha256(text: string) {
// based on https://github.com/auth0/auth0-spa-js/blob/9a83f698127eae7da72691b0d4b1b847567687e3/src/utils.ts#L147
function generateVerifierCode() {
- // characters that can be used for codeVerifer
+ // characters that can be used for codeVerifier
// excludes _~ as if included would cause an uneven distribution as char.length would no longer be a factor of 256
const chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-.';
const randomValues = Array.from(window.crypto.getRandomValues(new Uint8Array(128)));
diff --git a/packages/core/src/lib/formatters.ts b/packages/core/src/lib/formatters.ts
index 7f8bc074..d34566a5 100644
--- a/packages/core/src/lib/formatters.ts
+++ b/packages/core/src/lib/formatters.ts
@@ -4,7 +4,7 @@ import partialRight from 'lodash/partialRight';
import { COMMIT_AUTHOR, COMMIT_DATE } from '../constants/commitProps';
import { sanitizeSlug } from './urlHelper';
-import { selectIdentifier, selectInferedField } from './util/collection.util';
+import { selectIdentifier, selectInferredField } from './util/collection.util';
import { selectField } from './util/field.util';
import { set } from './util/object.util';
import {
@@ -108,7 +108,7 @@ export function slugFormatter(collection: Collection, entryData: EntryData, slug
export function summaryFormatter(summaryTemplate: string, entry: Entry, collection: Collection) {
let entryData = entry.data;
- const date = parseDateFromEntry(entry, selectInferedField(collection, 'date')) || null;
+ const date = parseDateFromEntry(entry, selectInferredField(collection, 'date')) || null;
const identifier = get(entryData, keyToPathArray(selectIdentifier(collection)));
entryData =
@@ -144,7 +144,7 @@ export function folderFormatter(
'folder' in collection ? collection.folder : '',
);
- const date = parseDateFromEntry(entry, selectInferedField(collection, 'date')) || null;
+ const date = parseDateFromEntry(entry, selectInferredField(collection, 'date')) || null;
const identifier = get(fields, keyToPathArray(selectIdentifier(collection)));
const processSegment = getProcessSegment(slugConfig, [defaultFolder, fields?.dirname as string]);
diff --git a/packages/core/src/lib/util/collection.util.ts b/packages/core/src/lib/util/collection.util.ts
index 81e9fad1..a761929e 100644
--- a/packages/core/src/lib/util/collection.util.ts
+++ b/packages/core/src/lib/util/collection.util.ts
@@ -125,7 +125,7 @@ export function selectEntryCollectionTitle(collection: Collection, entry: Entry)
// try to infer a title field from the entry data
const entryData = entry.data;
- const titleField = selectInferedField(collection, 'title');
+ const titleField = selectInferredField(collection, 'title');
const result = titleField && get(entryData, keyToPathArray(titleField));
// if the custom field does not yield a result, fallback to 'title'
@@ -138,7 +138,7 @@ export function selectEntryCollectionTitle(collection: Collection, entry: Entry)
export function selectDefaultSortableFields(collection: Collection, backend: Backend) {
let defaultSortable = SORTABLE_FIELDS.map((type: string) => {
- const field = selectInferedField(collection, type);
+ const field = selectInferredField(collection, type);
if (backend.isGitBackend() && type === 'author' && !field) {
// default to commit author if not author field is found
return COMMIT_AUTHOR;
@@ -336,7 +336,7 @@ export function selectIdentifier(collection: Collection) {
);
}
-export function selectInferedField(collection: Collection, fieldName: string) {
+export function selectInferredField(collection: Collection, fieldName: string) {
if (fieldName === 'title' && collection.identifier_field) {
return selectIdentifier(collection);
}
@@ -393,11 +393,11 @@ export function selectInferedField(collection: Collection, fieldName: string) {
return null;
}
-export function useInferedFields(collection: Collection) {
+export function useInferredFields(collection: Collection) {
return useMemo(() => {
- const titleField = selectInferedField(collection, 'title');
- const shortTitleField = selectInferedField(collection, 'shortTitle');
- const authorField = selectInferedField(collection, 'author');
+ const titleField = selectInferredField(collection, 'title');
+ const shortTitleField = selectInferredField(collection, 'shortTitle');
+ const authorField = selectInferredField(collection, 'author');
const iFields: Record = {};
if (titleField) {
diff --git a/packages/core/src/media-libraries/cloudinary/index.ts b/packages/core/src/media-libraries/cloudinary/index.ts
index ba0df7c4..64f889a5 100644
--- a/packages/core/src/media-libraries/cloudinary/index.ts
+++ b/packages/core/src/media-libraries/cloudinary/index.ts
@@ -48,7 +48,7 @@ declare global {
cloudinary: {
createMediaLibrary: (
config: Record,
- hadlers: { insertHandler: (data: { assets: CloudinaryAsset[] }) => void },
+ handlers: { insertHandler: (data: { assets: CloudinaryAsset[] }) => void },
) => {
show: (config: Record) => void;
hide: () => void;
diff --git a/packages/core/src/widgets/file/withFileControl.tsx b/packages/core/src/widgets/file/withFileControl.tsx
index a5180f38..77c7863a 100644
--- a/packages/core/src/widgets/file/withFileControl.tsx
+++ b/packages/core/src/widgets/file/withFileControl.tsx
@@ -381,7 +381,7 @@ const withFileControl = ({ forImage = false }: WithFileControlProps = {}) => {
if (isMultiple(internalValue)) {
return (
-
+
{internalValue.map(val => (
{renderFileLink(val)}
diff --git a/packages/core/src/widgets/map/withMapControl.tsx b/packages/core/src/widgets/map/withMapControl.tsx
index 2e57cdda..e9c86f46 100644
--- a/packages/core/src/widgets/map/withMapControl.tsx
+++ b/packages/core/src/widgets/map/withMapControl.tsx
@@ -36,7 +36,7 @@ const StyledMapControlContent = styled(
)(
({ $collapsed, $height }) => `
display: flex;
- postion: relative;
+ position: relative;
height: ${$height}
${
$collapsed
diff --git a/packages/demo/public/index.html b/packages/demo/public/index.html
index 6430d7d9..5bb2b928 100644
--- a/packages/demo/public/index.html
+++ b/packages/demo/public/index.html
@@ -30,7 +30,7 @@
_faqs: {
'what-is-static-cms.md': {
content:
- '---\ntitle: What is Static CMS?\ndate: 2015-11-02T00:00.000Z\n---\n\n# Static CMS is Content Manager for Static Site Generators\n\nStatic sites are many times faster, cheaper and safer and traditional dynamic websites.\n\nModern static site generators like Jekyll, Middleman, Roots or Hugo are powerful publishing and development systems, but when we build sites for non-technical users, we need a layer on top of them.\n\nStatic CMS is there to let your marketing team push new content to your public site, or to let technical writers work on your documentation.\n\nStatic CMS integrates with Git and turns normal content editors into git comitters.\n\n',
+ '---\ntitle: What is Static CMS?\ndate: 2015-11-02T00:00.000Z\n---\n\n# Static CMS is Content Manager for Static Site Generators\n\nStatic sites are many times faster, cheaper and safer and traditional dynamic websites.\n\nModern static site generators like Jekyll, Middleman, Roots or Hugo are powerful publishing and development systems, but when we build sites for non-technical users, we need a layer on top of them.\n\nStatic CMS is there to let your marketing team push new content to your public site, or to let technical writers work on your documentation.\n\nStatic CMS integrates with Git and turns normal content editors into git committers.\n\n',
},
'what-is-jam-stack.md': {
content:
diff --git a/packages/docs/content/docs/add-to-your-site-bundling.mdx b/packages/docs/content/docs/add-to-your-site-bundling.mdx
index 9cc374de..2c38ae00 100644
--- a/packages/docs/content/docs/add-to-your-site-bundling.mdx
+++ b/packages/docs/content/docs/add-to-your-site-bundling.mdx
@@ -24,7 +24,7 @@ Then create a new route for your project (for instance at `/admin`), and import
import CMS from '@staticcms/core';
```
-The default export is a _CMS_ object, which has an `init` method that takes an object with a `config` attribute. The `config` attribute is an object representing the [configuration options](docs/configuration-options). You can use destructuring assigment syntax as shorthand:
+The default export is a _CMS_ object, which has an `init` method that takes an object with a `config` attribute. The `config` attribute is an object representing the [configuration options](docs/configuration-options). You can use destructuring assignment syntax as shorthand:
```js
import CMS from '@staticcms/core';