nextpress-core 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/acf-functions/core/acf-builder.d.ts +50 -0
- package/{lib/acf-functions/core/acf-builder.ts → dist/acf-functions/core/acf-builder.js} +17 -41
- package/dist/acf-functions/core/acf-component-autoloader.d.ts +11 -0
- package/{lib/acf-functions/core/acf-component-autoloader.ts → dist/acf-functions/core/acf-component-autoloader.js} +7 -13
- package/dist/acf-functions/core/acf-field-group-autoloader.d.ts +9 -0
- package/{lib/acf-functions/core/acf-field-group-autoloader.ts → dist/acf-functions/core/acf-field-group-autoloader.js} +4 -9
- package/dist/acf-functions/services/define-field-group.d.ts +8 -0
- package/{lib/acf-functions/services/define-field-group.ts → dist/acf-functions/services/define-field-group.js} +1 -1
- package/dist/acf-functions/services/define-layout.d.ts +8 -0
- package/{lib/acf-functions/services/define-layout.ts → dist/acf-functions/services/define-layout.js} +1 -1
- package/dist/acf-functions/services/map-fields/helpers/map-choice-object.d.ts +2 -0
- package/dist/acf-functions/services/map-fields/helpers/map-choice-object.js +18 -0
- package/dist/acf-functions/services/map-fields/map-fields.d.ts +18 -0
- package/{lib/acf-functions/services/map-fields/map-fields.ts → dist/acf-functions/services/map-fields/map-fields.js} +88 -124
- package/dist/entities/option/option.d.ts +19 -0
- package/{lib/entities/option/option.ts → dist/entities/option/option.js} +13 -20
- package/dist/entities/post/post.d.ts +50 -0
- package/dist/entities/post/post.js +184 -0
- package/dist/entities/term/term.d.ts +28 -0
- package/dist/entities/term/term.js +67 -0
- package/dist/entities/user/user.d.ts +27 -0
- package/dist/entities/user/user.js +74 -0
- package/dist/globals/entity-loader/entity-loader-base.d.ts +65 -0
- package/{lib/globals/entity-loader/entity-loader-base.ts → dist/globals/entity-loader/entity-loader-base.js} +10 -64
- package/dist/globals/entity-loader/option-loader.d.ts +15 -0
- package/dist/globals/entity-loader/option-loader.js +31 -0
- package/dist/globals/entity-loader/post-loader.d.ts +21 -0
- package/dist/globals/entity-loader/post-loader.js +28 -0
- package/dist/globals/entity-loader/term-loader.d.ts +21 -0
- package/dist/globals/entity-loader/term-loader.js +28 -0
- package/dist/globals/entity-loader/user-loader.d.ts +21 -0
- package/dist/globals/entity-loader/user-loader.js +28 -0
- package/dist/globals/get-field/get-field.d.ts +17 -0
- package/dist/globals/get-field/get-field.js +44 -0
- package/dist/globals/globals.d.ts +18 -0
- package/{lib/globals/globals.ts → dist/globals/globals.js} +3 -8
- package/dist/globals/nextpress-config/nextpress-config.d.ts +4 -0
- package/{lib/globals/nextpress-config/nextpress-config.ts → dist/globals/nextpress-config/nextpress-config.js} +0 -5
- package/dist/globals/queried-object/queried-object.d.ts +62 -0
- package/dist/globals/queried-object/queried-object.js +56 -0
- package/dist/repository/optionquery/option-query.d.ts +12 -0
- package/dist/repository/optionquery/option-query.js +20 -0
- package/dist/repository/postquery/post-query.d.ts +12 -0
- package/dist/repository/postquery/post-query.js +272 -0
- package/dist/repository/termquery/term-query.d.ts +11 -0
- package/dist/repository/termquery/term-query.js +213 -0
- package/dist/repository/userquery/user-query.d.ts +12 -0
- package/{lib/repository/userquery/user-query.ts → dist/repository/userquery/user-query.js} +75 -91
- package/dist/router/helpers.d.ts +14 -0
- package/{lib/router/helpers.ts → dist/router/helpers.js} +4 -4
- package/dist/router/nextpress-layout.d.ts +11 -0
- package/{lib/router/nextpress-layout.tsx → dist/router/nextpress-layout.js} +6 -23
- package/dist/router/nextpress-proxy.d.ts +8 -0
- package/{lib/router/nextpress-proxy.ts → dist/router/nextpress-proxy.js} +3 -15
- package/dist/router/nextpress-static-params.d.ts +9 -0
- package/{lib/router/nextpress-static-params.ts → dist/router/nextpress-static-params.js} +5 -17
- package/dist/router/router.d.ts +23 -0
- package/{lib/router/router.tsx → dist/router/router.js} +21 -29
- package/dist/router/routes/api/api-get-admin-bar.d.ts +8 -0
- package/{lib/router/routes/api/api-get-admin-bar.ts → dist/router/routes/api/api-get-admin-bar.js} +6 -8
- package/dist/router/routes/api/api-get-draft-mode.d.ts +8 -0
- package/{lib/router/routes/api/api-get-draft-mode.ts → dist/router/routes/api/api-get-draft-mode.js} +6 -15
- package/dist/router/routes/api/api-get-field-groups.d.ts +7 -0
- package/{lib/router/routes/api/api-get-field-groups.ts → dist/router/routes/api/api-get-field-groups.js} +6 -11
- package/dist/router/routes/api/api-post-revalidate.d.ts +7 -0
- package/{lib/router/routes/api/api-post-revalidate.ts → dist/router/routes/api/api-post-revalidate.js} +4 -6
- package/dist/router/routes/api/helpers.d.ts +8 -0
- package/{lib/router/routes/api/helpers.ts → dist/router/routes/api/helpers.js} +3 -4
- package/dist/router/routes/author-archive.d.ts +25 -0
- package/{lib/router/routes/author-archive.tsx → dist/router/routes/author-archive.js} +11 -37
- package/dist/router/routes/not-found-page.d.ts +15 -0
- package/{lib/router/routes/not-found-page.tsx → dist/router/routes/not-found-page.js} +3 -5
- package/dist/router/routes/post-index-page.d.ts +25 -0
- package/dist/router/routes/post-index-page.js +33 -0
- package/dist/router/routes/singular-page.d.ts +29 -0
- package/dist/router/routes/singular-page.js +51 -0
- package/dist/router/routes/site-front-page.d.ts +27 -0
- package/dist/router/routes/site-front-page.js +26 -0
- package/dist/router/routes/term-archive.d.ts +29 -0
- package/{lib/router/routes/term-archive.tsx → dist/router/routes/term-archive.js} +17 -45
- package/dist/services/get-menu.d.ts +13 -0
- package/{lib/services/get-menu.ts → dist/services/get-menu.js} +32 -56
- package/dist/services/get-theme-mods.d.ts +7 -0
- package/{lib/services/get-theme-mods.ts → dist/services/get-theme-mods.js} +4 -6
- package/dist/services/metadata/get-blogname.d.ts +6 -0
- package/{lib/services/metadata/get-blogname.ts → dist/services/metadata/get-blogname.js} +2 -2
- package/dist/services/metadata/get-favicon-url.d.ts +6 -0
- package/{lib/services/metadata/get-favicon-url.ts → dist/services/metadata/get-favicon-url.js} +4 -5
- package/dist/services/metadata/get-language-attribute.d.ts +6 -0
- package/{lib/services/metadata/get-language-attribute.ts → dist/services/metadata/get-language-attribute.js} +1 -1
- package/{lib/services/services.ts → dist/services/services.d.ts} +1 -5
- package/dist/services/services.js +3 -0
- package/dist/services/utilities/capitalise-first-letter.d.ts +7 -0
- package/{lib/services/utilities/capitalise-first-letter.ts → dist/services/utilities/capitalise-first-letter.js} +3 -2
- package/dist/services/utilities/esc-html.d.ts +7 -0
- package/{lib/services/utilities/esc-html.ts → dist/services/utilities/esc-html.js} +1 -3
- package/dist/services/utilities/get-date-time-formatter.d.ts +6 -0
- package/{lib/services/utilities/get-date-time-formatter.ts → dist/services/utilities/get-date-time-formatter.js} +6 -16
- package/dist/services/utilities/index.js +1 -0
- package/dist/services/utilities/kses-post.d.ts +7 -0
- package/{lib/services/utilities/kses-post.ts → dist/services/utilities/kses-post.js} +1 -2
- package/dist/services/utilities/process-url.d.ts +7 -0
- package/{lib/services/utilities/process-url.ts → dist/services/utilities/process-url.js} +3 -4
- package/dist/template-heirarchy/_autoloader/template-autoloader.d.ts +9 -0
- package/{lib/template-heirarchy/_autoloader/template-autoloader.ts → dist/template-heirarchy/_autoloader/template-autoloader.js} +9 -18
- package/dist/template-heirarchy/archive/archive.d.ts +16 -0
- package/{lib/template-heirarchy/archive/archive.tsx → dist/template-heirarchy/archive/archive.js} +7 -10
- package/dist/template-heirarchy/archive/author.d.ts +16 -0
- package/{lib/template-heirarchy/archive/author.tsx → dist/template-heirarchy/archive/author.js} +7 -10
- package/dist/template-heirarchy/archive/category.d.ts +16 -0
- package/{lib/template-heirarchy/archive/category.tsx → dist/template-heirarchy/archive/category.js} +7 -11
- package/dist/template-heirarchy/archive/posttypearchive.d.ts +24 -0
- package/{lib/template-heirarchy/archive/posttypearchive.tsx → dist/template-heirarchy/archive/posttypearchive.js} +7 -10
- package/dist/template-heirarchy/archive/tag.d.ts +16 -0
- package/{lib/template-heirarchy/archive/tag.tsx → dist/template-heirarchy/archive/tag.js} +7 -12
- package/dist/template-heirarchy/archive/taxonomy.d.ts +16 -0
- package/{lib/template-heirarchy/archive/taxonomy.tsx → dist/template-heirarchy/archive/taxonomy.js} +7 -10
- package/dist/template-heirarchy/home/home.d.ts +16 -0
- package/{lib/template-heirarchy/home/home.tsx → dist/template-heirarchy/home/home.js} +7 -10
- package/dist/template-heirarchy/index.d.ts +17 -0
- package/{lib/template-heirarchy/index.tsx → dist/template-heirarchy/index.js} +5 -9
- package/dist/template-heirarchy/not-found.tsx/not-found.d.ts +16 -0
- package/{lib/template-heirarchy/not-found.tsx/not-found.tsx → dist/template-heirarchy/not-found.tsx/not-found.js} +7 -10
- package/dist/template-heirarchy/page/page.d.ts +16 -0
- package/{lib/template-heirarchy/page/page.tsx → dist/template-heirarchy/page/page.js} +7 -10
- package/dist/template-heirarchy/page/posttype.d.ts +24 -0
- package/{lib/template-heirarchy/page/posttype.tsx → dist/template-heirarchy/page/posttype.js} +7 -11
- package/dist/template-heirarchy/page/single.d.ts +16 -0
- package/{lib/template-heirarchy/page/single.tsx → dist/template-heirarchy/page/single.js} +7 -10
- package/dist/template-heirarchy/page/singular.d.ts +16 -0
- package/{lib/template-heirarchy/page/singular.tsx → dist/template-heirarchy/page/singular.js} +7 -10
- package/dist/ui/render-attachment-image.d.ts +12 -0
- package/dist/ui/render-attachment-image.js +24 -0
- package/{lib/ui/render-components.tsx → dist/ui/render-components.d.ts} +4 -7
- package/dist/ui/render-components.js +7 -0
- package/dist/ui/render-the-admin-bar.d.ts +8 -0
- package/dist/ui/render-the-admin-bar.js +36 -0
- package/dist/ui/render-the-logo.d.ts +10 -0
- package/dist/ui/render-the-logo.js +16 -0
- package/dist/wpdb/wpdb.d.ts +3 -0
- package/{lib/wpdb/wpdb.ts → dist/wpdb/wpdb.js} +5 -9
- package/package.json +7 -3
- package/lib/acf-functions/services/map-fields/helpers/map-choice-object.ts +0 -20
- package/lib/acf-functions/types/acf-field-group.d.ts +0 -118
- package/lib/acf-functions/types/acf-field.d.ts +0 -2851
- package/lib/acf-functions/types/acf-layout.d.ts +0 -20
- package/lib/acf-functions/types/acf-values.d.ts +0 -4
- package/lib/acf-functions/types/components/field-props.d.ts +0 -189
- package/lib/acf-functions/types/components/nextpress-component.d.ts +0 -11
- package/lib/ambient.d.ts +0 -15
- package/lib/entities/common.d.ts +0 -30
- package/lib/entities/option/option.interface.d.ts +0 -8
- package/lib/entities/post/post.interface.d.ts +0 -72
- package/lib/entities/post/post.ts +0 -209
- package/lib/entities/term/term.interface.d.ts +0 -8
- package/lib/entities/term/term.ts +0 -82
- package/lib/entities/user/user.interface.d.ts +0 -10
- package/lib/entities/user/user.ts +0 -86
- package/lib/globals/entity-loader/entity-loader.d.ts +0 -50
- package/lib/globals/entity-loader/option-loader.ts +0 -56
- package/lib/globals/entity-loader/post-loader.ts +0 -59
- package/lib/globals/entity-loader/term-loader.ts +0 -59
- package/lib/globals/entity-loader/user-loader.ts +0 -60
- package/lib/globals/get-field/get-field.ts +0 -75
- package/lib/globals/nextpress-config/nextpress-config.interface.d.ts +0 -18
- package/lib/globals/queried-object/queried-object.ts +0 -124
- package/lib/repository/optionquery/option-query-args.d.ts +0 -21
- package/lib/repository/optionquery/option-query.ts +0 -29
- package/lib/repository/postquery/post-query-args.d.ts +0 -108
- package/lib/repository/postquery/post-query.ts +0 -281
- package/lib/repository/termquery/term-query-args.d.ts +0 -61
- package/lib/repository/termquery/term-query.ts +0 -243
- package/lib/repository/userquery/user-query-args.d.ts +0 -75
- package/lib/router/routes/post-index-page.tsx +0 -58
- package/lib/router/routes/singular-page.tsx +0 -78
- package/lib/router/routes/site-front-page.tsx +0 -51
- package/lib/router/types.d.ts +0 -9
- package/lib/ui/render-attachment-image.tsx +0 -29
- package/lib/ui/render-the-admin-bar.tsx +0 -79
- package/lib/ui/render-the-logo.tsx +0 -24
- package/lib/wpdb/wpdb.interface.d.ts +0 -171
- /package/{lib/services/utilities/index.ts → dist/services/utilities/index.d.ts} +0 -0
package/{lib/template-heirarchy/archive/archive.tsx → dist/template-heirarchy/archive/archive.js}
RENAMED
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { JSX } from "react";
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { loadMetadata, loadTemplate } from "../_autoloader/template-autoloader";
|
|
4
3
|
import { IndexMetadata, IndexTemplate } from "..";
|
|
5
|
-
|
|
6
4
|
/**
|
|
7
5
|
* Loads the metadata for the Archive template.
|
|
8
6
|
* Fallback: Index
|
|
9
7
|
*
|
|
10
8
|
* @returns {Promise<Metadata>} The merged metadata object.
|
|
11
9
|
*/
|
|
12
|
-
export async function ArchiveMetadata()
|
|
10
|
+
export async function ArchiveMetadata() {
|
|
13
11
|
const metadata = await loadMetadata('Archive');
|
|
14
|
-
return {
|
|
12
|
+
return Object.assign(Object.assign({}, (await IndexMetadata())), metadata);
|
|
15
13
|
}
|
|
16
|
-
|
|
17
14
|
/**
|
|
18
15
|
* Renders the Archive template. Falls back to the Index template if not found.
|
|
19
16
|
* Fallback: Index
|
|
20
17
|
*
|
|
21
18
|
* @returns {Promise<JSX.Element>} The rendered template component.
|
|
22
19
|
*/
|
|
23
|
-
export async function ArchiveTemplate()
|
|
20
|
+
export async function ArchiveTemplate() {
|
|
24
21
|
const Archive = await loadTemplate('Archive');
|
|
25
|
-
if (!Archive)
|
|
26
|
-
|
|
27
|
-
return
|
|
22
|
+
if (!Archive)
|
|
23
|
+
return _jsx(IndexTemplate, {});
|
|
24
|
+
return _jsx(Archive, {});
|
|
28
25
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Metadata } from "next";
|
|
2
|
+
import { JSX } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Loads the metadata for the Author template.
|
|
5
|
+
* Fallback: Archive
|
|
6
|
+
*
|
|
7
|
+
* @returns {Promise<Metadata>} The merged metadata object.
|
|
8
|
+
*/
|
|
9
|
+
export declare function AuthorMetadata(): Promise<Metadata>;
|
|
10
|
+
/**
|
|
11
|
+
* Renders the Author template. Falls back to the Archive template if not found.
|
|
12
|
+
* Fallback: Archive
|
|
13
|
+
*
|
|
14
|
+
* @returns {Promise<JSX.Element>} The rendered template component.
|
|
15
|
+
*/
|
|
16
|
+
export declare function AuthorTemplate(): Promise<JSX.Element>;
|
package/{lib/template-heirarchy/archive/author.tsx → dist/template-heirarchy/archive/author.js}
RENAMED
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { JSX } from "react";
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { loadMetadata, loadTemplate } from "../_autoloader/template-autoloader";
|
|
4
3
|
import { ArchiveMetadata, ArchiveTemplate } from "./archive";
|
|
5
|
-
|
|
6
4
|
/**
|
|
7
5
|
* Loads the metadata for the Author template.
|
|
8
6
|
* Fallback: Archive
|
|
9
7
|
*
|
|
10
8
|
* @returns {Promise<Metadata>} The merged metadata object.
|
|
11
9
|
*/
|
|
12
|
-
export async function AuthorMetadata()
|
|
10
|
+
export async function AuthorMetadata() {
|
|
13
11
|
const metadata = await loadMetadata('Author');
|
|
14
|
-
return {
|
|
12
|
+
return Object.assign(Object.assign({}, (await ArchiveMetadata())), metadata);
|
|
15
13
|
}
|
|
16
|
-
|
|
17
14
|
/**
|
|
18
15
|
* Renders the Author template. Falls back to the Archive template if not found.
|
|
19
16
|
* Fallback: Archive
|
|
20
17
|
*
|
|
21
18
|
* @returns {Promise<JSX.Element>} The rendered template component.
|
|
22
19
|
*/
|
|
23
|
-
export async function AuthorTemplate()
|
|
20
|
+
export async function AuthorTemplate() {
|
|
24
21
|
const Author = await loadTemplate('Author');
|
|
25
|
-
if (!Author)
|
|
26
|
-
|
|
27
|
-
return
|
|
22
|
+
if (!Author)
|
|
23
|
+
return _jsx(ArchiveTemplate, {});
|
|
24
|
+
return _jsx(Author, {});
|
|
28
25
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Metadata } from "next";
|
|
2
|
+
import { JSX } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Loads the metadata for the Category template.
|
|
5
|
+
* Fallback: Archive
|
|
6
|
+
*
|
|
7
|
+
* @returns {Promise<Metadata>} The merged metadata object.
|
|
8
|
+
*/
|
|
9
|
+
export declare function CategoryMetadata(): Promise<Metadata>;
|
|
10
|
+
/**
|
|
11
|
+
* Renders the Category template. Falls back to the Archive template if not found.
|
|
12
|
+
* Fallback: Archive
|
|
13
|
+
*
|
|
14
|
+
* @returns {Promise<JSX.Element>} The rendered template component.
|
|
15
|
+
*/
|
|
16
|
+
export declare function CategoryTemplate(): Promise<JSX.Element>;
|
package/{lib/template-heirarchy/archive/category.tsx → dist/template-heirarchy/archive/category.js}
RENAMED
|
@@ -1,29 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { JSX } from "react";
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { loadMetadata, loadTemplate } from "../_autoloader/template-autoloader";
|
|
4
3
|
import { ArchiveMetadata, ArchiveTemplate } from "./archive";
|
|
5
|
-
|
|
6
4
|
/**
|
|
7
5
|
* Loads the metadata for the Category template.
|
|
8
6
|
* Fallback: Archive
|
|
9
7
|
*
|
|
10
8
|
* @returns {Promise<Metadata>} The merged metadata object.
|
|
11
9
|
*/
|
|
12
|
-
export async function CategoryMetadata()
|
|
10
|
+
export async function CategoryMetadata() {
|
|
13
11
|
const metadata = await loadMetadata('Category');
|
|
14
|
-
return {
|
|
12
|
+
return Object.assign(Object.assign({}, (await ArchiveMetadata())), metadata);
|
|
15
13
|
}
|
|
16
|
-
|
|
17
14
|
/**
|
|
18
15
|
* Renders the Category template. Falls back to the Archive template if not found.
|
|
19
16
|
* Fallback: Archive
|
|
20
17
|
*
|
|
21
18
|
* @returns {Promise<JSX.Element>} The rendered template component.
|
|
22
19
|
*/
|
|
23
|
-
export async function CategoryTemplate()
|
|
20
|
+
export async function CategoryTemplate() {
|
|
24
21
|
const Category = await loadTemplate('Category');
|
|
25
|
-
if (!Category)
|
|
26
|
-
|
|
27
|
-
return
|
|
22
|
+
if (!Category)
|
|
23
|
+
return _jsx(ArchiveTemplate, {});
|
|
24
|
+
return _jsx(Category, {});
|
|
28
25
|
}
|
|
29
|
-
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Metadata } from "next";
|
|
2
|
+
import { JSX } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Loads the metadata for a Post Type Archive template based on the given post type.
|
|
5
|
+
* Fallback: Archive
|
|
6
|
+
*
|
|
7
|
+
* @param {object} props - The properties for loading metadata.
|
|
8
|
+
* @param {string} props.postType - The post type to load the metadata for.
|
|
9
|
+
* @returns {Promise<Metadata>} The merged metadata object.
|
|
10
|
+
*/
|
|
11
|
+
export declare function PostTypeArchiveMetadata({ postType }: {
|
|
12
|
+
postType: string;
|
|
13
|
+
}): Promise<Metadata>;
|
|
14
|
+
/**
|
|
15
|
+
* Renders a Post Type Archive template. Falls back to the Archive template if not found.
|
|
16
|
+
* Fallback: Archive
|
|
17
|
+
*
|
|
18
|
+
* @param {object} props - The properties for rendering the template.
|
|
19
|
+
* @param {string} props.postType - The post type to load the template for.
|
|
20
|
+
* @returns {Promise<JSX.Element>} The rendered template component.
|
|
21
|
+
*/
|
|
22
|
+
export declare function PostTypeArchiveTemplate({ postType }: {
|
|
23
|
+
postType: string;
|
|
24
|
+
}): Promise<JSX.Element>;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { JSX } from "react";
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { loadMetadata, loadTemplate } from "../_autoloader/template-autoloader";
|
|
4
3
|
import { ArchiveMetadata, ArchiveTemplate } from "./archive";
|
|
5
4
|
import { capitalizeFirstLetter } from "@/services/utilities/capitalise-first-letter";
|
|
6
|
-
|
|
7
5
|
/**
|
|
8
6
|
* Loads the metadata for a Post Type Archive template based on the given post type.
|
|
9
7
|
* Fallback: Archive
|
|
@@ -12,11 +10,10 @@ import { capitalizeFirstLetter } from "@/services/utilities/capitalise-first-let
|
|
|
12
10
|
* @param {string} props.postType - The post type to load the metadata for.
|
|
13
11
|
* @returns {Promise<Metadata>} The merged metadata object.
|
|
14
12
|
*/
|
|
15
|
-
export async function PostTypeArchiveMetadata({
|
|
13
|
+
export async function PostTypeArchiveMetadata({ postType }) {
|
|
16
14
|
const metadata = await loadMetadata(capitalizeFirstLetter(postType));
|
|
17
|
-
return {
|
|
15
|
+
return Object.assign(Object.assign({}, (await ArchiveMetadata())), metadata);
|
|
18
16
|
}
|
|
19
|
-
|
|
20
17
|
/**
|
|
21
18
|
* Renders a Post Type Archive template. Falls back to the Archive template if not found.
|
|
22
19
|
* Fallback: Archive
|
|
@@ -25,9 +22,9 @@ export async function PostTypeArchiveMetadata({postType}: {postType: string}): P
|
|
|
25
22
|
* @param {string} props.postType - The post type to load the template for.
|
|
26
23
|
* @returns {Promise<JSX.Element>} The rendered template component.
|
|
27
24
|
*/
|
|
28
|
-
export async function PostTypeArchiveTemplate({
|
|
25
|
+
export async function PostTypeArchiveTemplate({ postType }) {
|
|
29
26
|
const PostTypeArchive = await loadTemplate(capitalizeFirstLetter(postType));
|
|
30
|
-
if (!PostTypeArchive)
|
|
31
|
-
|
|
32
|
-
return
|
|
27
|
+
if (!PostTypeArchive)
|
|
28
|
+
return _jsx(ArchiveTemplate, {});
|
|
29
|
+
return _jsx(PostTypeArchive, {});
|
|
33
30
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Metadata } from "next";
|
|
2
|
+
import { JSX } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Loads the metadata for the Tag template.
|
|
5
|
+
* Fallback: Archive
|
|
6
|
+
*
|
|
7
|
+
* @returns {Promise<Metadata>} The merged metadata object.
|
|
8
|
+
*/
|
|
9
|
+
export declare function TagMetadata(): Promise<Metadata>;
|
|
10
|
+
/**
|
|
11
|
+
* Renders the Tag template. Falls back to the Archive template if not found.
|
|
12
|
+
* Fallback: Archive
|
|
13
|
+
*
|
|
14
|
+
* @returns {Promise<JSX.Element>} The rendered template component.
|
|
15
|
+
*/
|
|
16
|
+
export declare function TagTemplate(): Promise<JSX.Element>;
|
|
@@ -1,30 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { JSX } from "react";
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { loadMetadata, loadTemplate } from "../_autoloader/template-autoloader";
|
|
4
3
|
import { ArchiveMetadata, ArchiveTemplate } from "./archive";
|
|
5
|
-
|
|
6
4
|
/**
|
|
7
5
|
* Loads the metadata for the Tag template.
|
|
8
6
|
* Fallback: Archive
|
|
9
7
|
*
|
|
10
8
|
* @returns {Promise<Metadata>} The merged metadata object.
|
|
11
9
|
*/
|
|
12
|
-
export async function TagMetadata()
|
|
10
|
+
export async function TagMetadata() {
|
|
13
11
|
const metadata = await loadMetadata('Tag');
|
|
14
|
-
return {
|
|
12
|
+
return Object.assign(Object.assign({}, (await ArchiveMetadata())), metadata);
|
|
15
13
|
}
|
|
16
|
-
|
|
17
14
|
/**
|
|
18
15
|
* Renders the Tag template. Falls back to the Archive template if not found.
|
|
19
16
|
* Fallback: Archive
|
|
20
17
|
*
|
|
21
18
|
* @returns {Promise<JSX.Element>} The rendered template component.
|
|
22
19
|
*/
|
|
23
|
-
export async function TagTemplate()
|
|
20
|
+
export async function TagTemplate() {
|
|
24
21
|
const Category = await loadTemplate('Tag');
|
|
25
|
-
if (!Category)
|
|
26
|
-
|
|
27
|
-
return
|
|
22
|
+
if (!Category)
|
|
23
|
+
return _jsx(ArchiveTemplate, {});
|
|
24
|
+
return _jsx(Category, {});
|
|
28
25
|
}
|
|
29
|
-
|
|
30
|
-
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Metadata } from "next";
|
|
2
|
+
import { JSX } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Loads the metadata for the Taxonomy template.
|
|
5
|
+
* Fallback: Archive
|
|
6
|
+
*
|
|
7
|
+
* @returns {Promise<Metadata>} The merged metadata object.
|
|
8
|
+
*/
|
|
9
|
+
export declare function TaxonomyMetadata(): Promise<Metadata>;
|
|
10
|
+
/**
|
|
11
|
+
* Renders the Taxonomy template. Falls back to the Archive template if not found.
|
|
12
|
+
* Fallback: Archive
|
|
13
|
+
*
|
|
14
|
+
* @returns {Promise<JSX.Element>} The rendered template component.
|
|
15
|
+
*/
|
|
16
|
+
export declare function TaxonomyTemplate(): Promise<JSX.Element>;
|
package/{lib/template-heirarchy/archive/taxonomy.tsx → dist/template-heirarchy/archive/taxonomy.js}
RENAMED
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { JSX } from "react";
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { loadMetadata, loadTemplate } from "../_autoloader/template-autoloader";
|
|
4
3
|
import { ArchiveMetadata, ArchiveTemplate } from "./archive";
|
|
5
|
-
|
|
6
4
|
/**
|
|
7
5
|
* Loads the metadata for the Taxonomy template.
|
|
8
6
|
* Fallback: Archive
|
|
9
7
|
*
|
|
10
8
|
* @returns {Promise<Metadata>} The merged metadata object.
|
|
11
9
|
*/
|
|
12
|
-
export async function TaxonomyMetadata()
|
|
10
|
+
export async function TaxonomyMetadata() {
|
|
13
11
|
const metadata = await loadMetadata('Taxonomy');
|
|
14
|
-
return {
|
|
12
|
+
return Object.assign(Object.assign({}, (await ArchiveMetadata())), metadata);
|
|
15
13
|
}
|
|
16
|
-
|
|
17
14
|
/**
|
|
18
15
|
* Renders the Taxonomy template. Falls back to the Archive template if not found.
|
|
19
16
|
* Fallback: Archive
|
|
20
17
|
*
|
|
21
18
|
* @returns {Promise<JSX.Element>} The rendered template component.
|
|
22
19
|
*/
|
|
23
|
-
export async function TaxonomyTemplate()
|
|
20
|
+
export async function TaxonomyTemplate() {
|
|
24
21
|
const Taxonomy = await loadTemplate('Taxonomy');
|
|
25
|
-
if (!Taxonomy)
|
|
26
|
-
|
|
27
|
-
return
|
|
22
|
+
if (!Taxonomy)
|
|
23
|
+
return _jsx(ArchiveTemplate, {});
|
|
24
|
+
return _jsx(Taxonomy, {});
|
|
28
25
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Metadata } from "next";
|
|
2
|
+
import { JSX } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Loads the metadata for the Home template.
|
|
5
|
+
* Fallback: Index
|
|
6
|
+
*
|
|
7
|
+
* @returns {Promise<Metadata>} The merged metadata object.
|
|
8
|
+
*/
|
|
9
|
+
export declare function HomeMetadata(): Promise<Metadata>;
|
|
10
|
+
/**
|
|
11
|
+
* Renders the Home template. Falls back to the Index template if not found.
|
|
12
|
+
* Fallback: Index
|
|
13
|
+
*
|
|
14
|
+
* @returns {Promise<JSX.Element>} The rendered template component.
|
|
15
|
+
*/
|
|
16
|
+
export declare function HomeTemplate(): Promise<JSX.Element>;
|
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { JSX } from "react";
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { loadMetadata, loadTemplate } from "../_autoloader/template-autoloader";
|
|
4
3
|
import { IndexMetadata, IndexTemplate } from "..";
|
|
5
|
-
|
|
6
4
|
/**
|
|
7
5
|
* Loads the metadata for the Home template.
|
|
8
6
|
* Fallback: Index
|
|
9
7
|
*
|
|
10
8
|
* @returns {Promise<Metadata>} The merged metadata object.
|
|
11
9
|
*/
|
|
12
|
-
export async function HomeMetadata()
|
|
10
|
+
export async function HomeMetadata() {
|
|
13
11
|
const metadata = await loadMetadata('Home');
|
|
14
|
-
return {
|
|
12
|
+
return Object.assign(Object.assign({}, (await IndexMetadata())), metadata);
|
|
15
13
|
}
|
|
16
|
-
|
|
17
14
|
/**
|
|
18
15
|
* Renders the Home template. Falls back to the Index template if not found.
|
|
19
16
|
* Fallback: Index
|
|
20
17
|
*
|
|
21
18
|
* @returns {Promise<JSX.Element>} The rendered template component.
|
|
22
19
|
*/
|
|
23
|
-
export async function HomeTemplate()
|
|
20
|
+
export async function HomeTemplate() {
|
|
24
21
|
const Home = await loadTemplate('Home');
|
|
25
|
-
if (!Home)
|
|
26
|
-
|
|
27
|
-
return
|
|
22
|
+
if (!Home)
|
|
23
|
+
return _jsx(IndexTemplate, {});
|
|
24
|
+
return _jsx(Home, {});
|
|
28
25
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Metadata } from "next";
|
|
2
|
+
import { JSX } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Loads the metadata for the Index template.
|
|
5
|
+
* Fallback: None
|
|
6
|
+
*
|
|
7
|
+
* @returns {Promise<Metadata>} The loaded metadata object.
|
|
8
|
+
*/
|
|
9
|
+
export declare function IndexMetadata(): Promise<Metadata>;
|
|
10
|
+
/**
|
|
11
|
+
* Renders the Index template.
|
|
12
|
+
* Fallback: None
|
|
13
|
+
*
|
|
14
|
+
* @throws {Error} Throws if the Index template cannot be found in the _templates directory.
|
|
15
|
+
* @returns {Promise<JSX.Element>} The rendered template component.
|
|
16
|
+
*/
|
|
17
|
+
export declare function IndexTemplate(): Promise<JSX.Element>;
|
|
@@ -1,18 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { JSX } from "react";
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { loadMetadata, loadTemplate } from "./_autoloader/template-autoloader";
|
|
4
|
-
|
|
5
3
|
/**
|
|
6
4
|
* Loads the metadata for the Index template.
|
|
7
5
|
* Fallback: None
|
|
8
6
|
*
|
|
9
7
|
* @returns {Promise<Metadata>} The loaded metadata object.
|
|
10
8
|
*/
|
|
11
|
-
export async function IndexMetadata()
|
|
9
|
+
export async function IndexMetadata() {
|
|
12
10
|
const metadata = await loadMetadata('Index');
|
|
13
|
-
return metadata
|
|
11
|
+
return metadata !== null && metadata !== void 0 ? metadata : {};
|
|
14
12
|
}
|
|
15
|
-
|
|
16
13
|
/**
|
|
17
14
|
* Renders the Index template.
|
|
18
15
|
* Fallback: None
|
|
@@ -20,11 +17,10 @@ export async function IndexMetadata(): Promise<Metadata> {
|
|
|
20
17
|
* @throws {Error} Throws if the Index template cannot be found in the _templates directory.
|
|
21
18
|
* @returns {Promise<JSX.Element>} The rendered template component.
|
|
22
19
|
*/
|
|
23
|
-
export async function IndexTemplate()
|
|
20
|
+
export async function IndexTemplate() {
|
|
24
21
|
const Index = await loadTemplate('Index');
|
|
25
22
|
if (!Index) {
|
|
26
23
|
throw new Error('Nextpress needs an index.tsx file in the template heirarchy in the _templates directory to function');
|
|
27
24
|
}
|
|
28
|
-
|
|
29
|
-
return <Index/>;
|
|
25
|
+
return _jsx(Index, {});
|
|
30
26
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Metadata } from "next";
|
|
2
|
+
import { JSX } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Loads the metadata for the NotFound template.
|
|
5
|
+
* Fallback: Index
|
|
6
|
+
*
|
|
7
|
+
* @returns {Promise<Metadata>} The merged metadata object.
|
|
8
|
+
*/
|
|
9
|
+
export declare function NotFoundMetadata(): Promise<Metadata>;
|
|
10
|
+
/**
|
|
11
|
+
* Renders the NotFound template. Falls back to the Index template if not found.
|
|
12
|
+
* Fallback: Index
|
|
13
|
+
*
|
|
14
|
+
* @returns {Promise<JSX.Element>} The rendered template component.
|
|
15
|
+
*/
|
|
16
|
+
export declare function NotFoundTemplate(): Promise<JSX.Element>;
|
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { JSX } from "react";
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { loadMetadata, loadTemplate } from "../_autoloader/template-autoloader";
|
|
4
3
|
import { IndexMetadata, IndexTemplate } from "..";
|
|
5
|
-
|
|
6
4
|
/**
|
|
7
5
|
* Loads the metadata for the NotFound template.
|
|
8
6
|
* Fallback: Index
|
|
9
7
|
*
|
|
10
8
|
* @returns {Promise<Metadata>} The merged metadata object.
|
|
11
9
|
*/
|
|
12
|
-
export async function NotFoundMetadata()
|
|
10
|
+
export async function NotFoundMetadata() {
|
|
13
11
|
const metadata = await loadMetadata('NotFound');
|
|
14
|
-
return {
|
|
12
|
+
return Object.assign(Object.assign({}, (await IndexMetadata())), metadata);
|
|
15
13
|
}
|
|
16
|
-
|
|
17
14
|
/**
|
|
18
15
|
* Renders the NotFound template. Falls back to the Index template if not found.
|
|
19
16
|
* Fallback: Index
|
|
20
17
|
*
|
|
21
18
|
* @returns {Promise<JSX.Element>} The rendered template component.
|
|
22
19
|
*/
|
|
23
|
-
export async function NotFoundTemplate()
|
|
20
|
+
export async function NotFoundTemplate() {
|
|
24
21
|
const NotFound = await loadTemplate('NotFound');
|
|
25
|
-
if (!NotFound)
|
|
26
|
-
|
|
27
|
-
return
|
|
22
|
+
if (!NotFound)
|
|
23
|
+
return _jsx(IndexTemplate, {});
|
|
24
|
+
return _jsx(NotFound, {});
|
|
28
25
|
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Metadata } from "next";
|
|
2
|
+
import { JSX } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Loads the metadata for the Page template.
|
|
5
|
+
* Fallback: Singular
|
|
6
|
+
*
|
|
7
|
+
* @returns {Promise<Metadata>} The merged metadata object.
|
|
8
|
+
*/
|
|
9
|
+
export declare function PageMetadata(): Promise<Metadata>;
|
|
10
|
+
/**
|
|
11
|
+
* Renders the Page template. Falls back to the Singular template if not found.
|
|
12
|
+
* Fallback: Singular
|
|
13
|
+
*
|
|
14
|
+
* @returns {Promise<JSX.Element>} The rendered template component.
|
|
15
|
+
*/
|
|
16
|
+
export declare function PageTemplate(): Promise<JSX.Element>;
|
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { JSX } from "react";
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { loadMetadata, loadTemplate } from "../_autoloader/template-autoloader";
|
|
4
3
|
import { SingularMetadata, SingularTemplate } from "./singular";
|
|
5
|
-
|
|
6
4
|
/**
|
|
7
5
|
* Loads the metadata for the Page template.
|
|
8
6
|
* Fallback: Singular
|
|
9
7
|
*
|
|
10
8
|
* @returns {Promise<Metadata>} The merged metadata object.
|
|
11
9
|
*/
|
|
12
|
-
export async function PageMetadata()
|
|
10
|
+
export async function PageMetadata() {
|
|
13
11
|
const metadata = await loadMetadata('Page');
|
|
14
|
-
return {
|
|
12
|
+
return Object.assign(Object.assign({}, (await SingularMetadata())), metadata);
|
|
15
13
|
}
|
|
16
|
-
|
|
17
14
|
/**
|
|
18
15
|
* Renders the Page template. Falls back to the Singular template if not found.
|
|
19
16
|
* Fallback: Singular
|
|
20
17
|
*
|
|
21
18
|
* @returns {Promise<JSX.Element>} The rendered template component.
|
|
22
19
|
*/
|
|
23
|
-
export async function PageTemplate()
|
|
20
|
+
export async function PageTemplate() {
|
|
24
21
|
const Page = await loadTemplate('Page');
|
|
25
|
-
if (!Page)
|
|
26
|
-
|
|
27
|
-
return
|
|
22
|
+
if (!Page)
|
|
23
|
+
return _jsx(SingularTemplate, {});
|
|
24
|
+
return _jsx(Page, {});
|
|
28
25
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Metadata } from "next";
|
|
2
|
+
import { JSX } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Loads the metadata for a Post Type template based on the provided post type string.
|
|
5
|
+
* Fallback: Singular
|
|
6
|
+
*
|
|
7
|
+
* @param {object} props - The properties for loading metadata.
|
|
8
|
+
* @param {string} props.postType - The post type to load metadata for.
|
|
9
|
+
* @returns {Promise<Metadata>} The merged metadata object.
|
|
10
|
+
*/
|
|
11
|
+
export declare function PostTypeMetadata({ postType }: {
|
|
12
|
+
postType: string;
|
|
13
|
+
}): Promise<Metadata>;
|
|
14
|
+
/**
|
|
15
|
+
* Renders a Post Type template based on the provided post type string. Falls back to Singular template if not found.
|
|
16
|
+
* Fallback: Singular
|
|
17
|
+
*
|
|
18
|
+
* @param {object} props - The properties for rendering the template.
|
|
19
|
+
* @param {string} props.postType - The post type to load the template for.
|
|
20
|
+
* @returns {Promise<JSX.Element>} The rendered template component.
|
|
21
|
+
*/
|
|
22
|
+
export declare function PostTypeTemplate({ postType }: {
|
|
23
|
+
postType: string;
|
|
24
|
+
}): Promise<JSX.Element>;
|
package/{lib/template-heirarchy/page/posttype.tsx → dist/template-heirarchy/page/posttype.js}
RENAMED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { JSX } from "react";
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
2
|
import { loadMetadata, loadTemplate } from "../_autoloader/template-autoloader";
|
|
4
3
|
import { SingularMetadata, SingularTemplate } from "./singular";
|
|
5
4
|
import { capitalizeFirstLetter } from "@/services/utilities/capitalise-first-letter";
|
|
6
|
-
|
|
7
5
|
/**
|
|
8
6
|
* Loads the metadata for a Post Type template based on the provided post type string.
|
|
9
7
|
* Fallback: Singular
|
|
@@ -12,11 +10,10 @@ import { capitalizeFirstLetter } from "@/services/utilities/capitalise-first-let
|
|
|
12
10
|
* @param {string} props.postType - The post type to load metadata for.
|
|
13
11
|
* @returns {Promise<Metadata>} The merged metadata object.
|
|
14
12
|
*/
|
|
15
|
-
export async function PostTypeMetadata({
|
|
13
|
+
export async function PostTypeMetadata({ postType }) {
|
|
16
14
|
const metadata = await loadMetadata(capitalizeFirstLetter(postType));
|
|
17
|
-
return {
|
|
15
|
+
return Object.assign(Object.assign({}, (await SingularMetadata())), metadata);
|
|
18
16
|
}
|
|
19
|
-
|
|
20
17
|
/**
|
|
21
18
|
* Renders a Post Type template based on the provided post type string. Falls back to Singular template if not found.
|
|
22
19
|
* Fallback: Singular
|
|
@@ -25,10 +22,9 @@ export async function PostTypeMetadata({postType}: {postType: string}): Promise<
|
|
|
25
22
|
* @param {string} props.postType - The post type to load the template for.
|
|
26
23
|
* @returns {Promise<JSX.Element>} The rendered template component.
|
|
27
24
|
*/
|
|
28
|
-
export async function PostTypeTemplate({
|
|
25
|
+
export async function PostTypeTemplate({ postType }) {
|
|
29
26
|
const PostType = await loadTemplate(capitalizeFirstLetter(postType));
|
|
30
|
-
if (!PostType)
|
|
31
|
-
|
|
32
|
-
return
|
|
27
|
+
if (!PostType)
|
|
28
|
+
return _jsx(SingularTemplate, {});
|
|
29
|
+
return _jsx(PostType, {});
|
|
33
30
|
}
|
|
34
|
-
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Metadata } from "next";
|
|
2
|
+
import { JSX } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* Loads the metadata for the Single template.
|
|
5
|
+
* Fallback: Singular
|
|
6
|
+
*
|
|
7
|
+
* @returns {Promise<Metadata>} The merged metadata object.
|
|
8
|
+
*/
|
|
9
|
+
export declare function SingleMetadata(): Promise<Metadata>;
|
|
10
|
+
/**
|
|
11
|
+
* Renders the Single template. Falls back to the Singular template if not found.
|
|
12
|
+
* Fallback: Singular
|
|
13
|
+
*
|
|
14
|
+
* @returns {Promise<JSX.Element>} The rendered template component.
|
|
15
|
+
*/
|
|
16
|
+
export declare function SingleTemplate(): Promise<JSX.Element>;
|