@justanarthur/payload-www 0.1.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/README.md +381 -0
- package/dist/access.d.ts +11 -0
- package/dist/access.js +34 -0
- package/dist/blocks.d.ts +24 -0
- package/dist/blocks.js +75 -0
- package/dist/collections.d.ts +200 -0
- package/dist/collections.js +625 -0
- package/dist/components.d.ts +6 -0
- package/dist/components.js +38 -0
- package/dist/config.d.ts +100 -0
- package/dist/config.js +914 -0
- package/dist/core-access.d.ts +11 -0
- package/dist/core-access.js +34 -0
- package/dist/core-blocks.d.ts +24 -0
- package/dist/core-blocks.js +75 -0
- package/dist/core-fields.d.ts +36 -0
- package/dist/core-fields.js +134 -0
- package/dist/core-utils.d.ts +16 -0
- package/dist/core-utils.js +59 -0
- package/dist/data-collections.d.ts +200 -0
- package/dist/data-collections.js +625 -0
- package/dist/data-seed.d.ts +76 -0
- package/dist/data-seed.js +212 -0
- package/dist/data-test.d.ts +30 -0
- package/dist/data-test.js +1018 -0
- package/dist/fields.d.ts +36 -0
- package/dist/fields.js +134 -0
- package/dist/globals.d.ts +48 -0
- package/dist/globals.js +228 -0
- package/dist/hooks.d.ts +108 -0
- package/dist/hooks.js +196 -0
- package/dist/imagehash.d.ts +3 -0
- package/dist/imagehash.js +24 -0
- package/dist/import-map-provider.d.ts +20 -0
- package/dist/import-map-provider.js +26 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +38 -0
- package/dist/metadata.d.ts +122 -0
- package/dist/metadata.js +335 -0
- package/dist/pages.d.ts +323 -0
- package/dist/pages.js +1016 -0
- package/dist/render-components.d.ts +42 -0
- package/dist/render-components.js +144 -0
- package/dist/render-metadata.d.ts +122 -0
- package/dist/render-metadata.js +335 -0
- package/dist/render-pages.d.ts +574 -0
- package/dist/render-pages.js +1450 -0
- package/dist/render-utils.d.ts +158 -0
- package/dist/render-utils.js +341 -0
- package/dist/seed.d.ts +76 -0
- package/dist/seed.js +212 -0
- package/dist/server.d.ts +922 -0
- package/dist/server.js +2055 -0
- package/dist/test.d.ts +30 -0
- package/dist/test.js +1018 -0
- package/dist/translator.d.ts +2 -0
- package/dist/translator.js +24 -0
- package/dist/utils.d.ts +16 -0
- package/dist/utils.js +59 -0
- package/dist/with-www-config.d.ts +100 -0
- package/dist/with-www-config.js +914 -0
- package/package.json +246 -0
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { Block, CollectionConfig } from "payload";
|
|
2
|
+
type LocalePrefixMode = "always" | "as-needed" | "never";
|
|
3
|
+
type CreateRevalidateCollectionHookOptions = {
|
|
4
|
+
/**
|
|
5
|
+
* The collection's slug. Used in the per-collection tag fired
|
|
6
|
+
* alongside path invalidation: `collection_<slug>_<id>`.
|
|
7
|
+
*/
|
|
8
|
+
collectionSlug: string;
|
|
9
|
+
/**
|
|
10
|
+
* URL path prefix for this collection's rendered URLs. Pages use
|
|
11
|
+
* `''` (mounted at root); Posts use `'/posts'`. Leading slash,
|
|
12
|
+
* no trailing slash — same convention as
|
|
13
|
+
* `createSitemapFile.urlPrefixes`.
|
|
14
|
+
*/
|
|
15
|
+
urlPathPrefix?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Sitemap tag the collection's revalidation hook invalidates on
|
|
18
|
+
* every save. Defaults to `${collectionSlug}-sitemap`. Pass
|
|
19
|
+
* `false` to opt out (collections without a sitemap handler).
|
|
20
|
+
*/
|
|
21
|
+
sitemapTag?: string | false;
|
|
22
|
+
/**
|
|
23
|
+
* Locale prefix mode — mirrors next-intl's `localePrefix`.
|
|
24
|
+
* Defaults to `'always'` (preserves legacy behavior).
|
|
25
|
+
*/
|
|
26
|
+
localePrefix?: LocalePrefixMode;
|
|
27
|
+
/**
|
|
28
|
+
* Default locale for `localePrefix: 'as-needed'`. Falls back to
|
|
29
|
+
* `req.payload.config.localization.defaultLocale` at request time
|
|
30
|
+
* when omitted.
|
|
31
|
+
*/
|
|
32
|
+
defaultLocale?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Path invalidation strategy. Default: `'url'` — fans out
|
|
35
|
+
* `revalidatePath` for every locale × every slug. Set to
|
|
36
|
+
* `'tag-only'` for collections without a URL (e.g. `staticPages`
|
|
37
|
+
* — addressed by a `kind` discriminator, not a slug). Tag-only
|
|
38
|
+
* mode still fires the per-collection tag (via `sitemapTag`) and
|
|
39
|
+
* the per-id tag (`collection_<slug>_<id>`).
|
|
40
|
+
*/
|
|
41
|
+
pathMode?: "url" | "tag-only";
|
|
42
|
+
};
|
|
43
|
+
declare const HOME_PAGE_SLUG = "";
|
|
44
|
+
declare const PAGES_SLUG = "pages";
|
|
45
|
+
type CreatePagesCollectionOptions = {
|
|
46
|
+
/**
|
|
47
|
+
* Blocks the Pages collection accepts.
|
|
48
|
+
*/
|
|
49
|
+
blocks: Block[];
|
|
50
|
+
/**
|
|
51
|
+
* Optional override for the collection slug. Default: `'pages'`.
|
|
52
|
+
* Hosts that want a different slug (e.g. `'site_pages'`) pass
|
|
53
|
+
* it here. The lib's Header / Footer `linkRelationTo` default
|
|
54
|
+
* uses `'pages'` — combine this with a matching
|
|
55
|
+
* `linkRelationTo` to keep nav links targeting the right
|
|
56
|
+
* collection.
|
|
57
|
+
*/
|
|
58
|
+
slug?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Optional override for the `custom.path` Payload uses to resolve
|
|
61
|
+
* the page's render module. Default: the lib's `PAGES_RENDER_PATH`
|
|
62
|
+
* (a Server Component that calls `RenderBlocks`). Use this when
|
|
63
|
+
* you've defined your own Server Component for the collection.
|
|
64
|
+
*/
|
|
65
|
+
renderPath?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Locale prefix mode for path invalidation. Defaults to `'always'`
|
|
68
|
+
* (preserves current behavior). Set to `'as-needed'` when the host
|
|
69
|
+
* uses next-intl `localePrefix: 'as-needed'` — otherwise the hook
|
|
70
|
+
* invalidates paths the public routes don't use.
|
|
71
|
+
*/
|
|
72
|
+
localePrefix?: CreateRevalidateCollectionHookOptions["localePrefix"];
|
|
73
|
+
/**
|
|
74
|
+
* Default locale for prefix skipping. Falls back to
|
|
75
|
+
* `req.payload.config.localization.defaultLocale` at request time
|
|
76
|
+
* when omitted.
|
|
77
|
+
*/
|
|
78
|
+
defaultLocale?: CreateRevalidateCollectionHookOptions["defaultLocale"];
|
|
79
|
+
};
|
|
80
|
+
declare const createPagesCollection: (blocks: Block[], options?: Omit<CreatePagesCollectionOptions, "blocks">) => CollectionConfig;
|
|
81
|
+
import { CollectionConfig as CollectionConfig2 } from "payload";
|
|
82
|
+
declare const POSTS_SLUG = "posts";
|
|
83
|
+
type CreatePostsCollectionOptions = {
|
|
84
|
+
/**
|
|
85
|
+
* Optional override for the collection slug. Default: `'posts'`.
|
|
86
|
+
* Hosts that want a different slug (e.g. `'articles'` or `'blog'`)
|
|
87
|
+
* pass it here. Combine with the page route's URL convention and
|
|
88
|
+
* the lib's translator plugin's `collections` list.
|
|
89
|
+
*/
|
|
90
|
+
slug?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Override the `custom.path` Payload uses to resolve the post's
|
|
93
|
+
* render module. Defaults to the lib's `POSTS_RENDER_PATH`
|
|
94
|
+
* (the lib's `<PostsPage>` Server Component, which renders
|
|
95
|
+
* `title` + `excerpt` + Lexical `content`). Hosts that want a
|
|
96
|
+
* custom render pass their own Server Component's import path
|
|
97
|
+
* here (e.g. `'@/blog/Post#default'`).
|
|
98
|
+
*/
|
|
99
|
+
renderPath?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Locale prefix mode for path invalidation. Defaults to `'always'`.
|
|
102
|
+
* Set to `'as-needed'` when the host uses next-intl
|
|
103
|
+
* `localePrefix: 'as-needed'` — otherwise the hook invalidates
|
|
104
|
+
* paths the public routes don't use.
|
|
105
|
+
*/
|
|
106
|
+
localePrefix?: "always" | "as-needed" | "never";
|
|
107
|
+
/**
|
|
108
|
+
* Default locale for prefix skipping. Falls back to
|
|
109
|
+
* `req.payload.config.localization.defaultLocale` at request time
|
|
110
|
+
* when omitted.
|
|
111
|
+
*/
|
|
112
|
+
defaultLocale?: string;
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Build the Posts collection. Posts have a simpler shape than
|
|
116
|
+
* Pages: `title` + `excerpt` (both localized) + a Lexical `content`
|
|
117
|
+
* rich text field. Hosts that want blocks can either swap the
|
|
118
|
+
* `content` field for a `blocks` field via the returned config, or
|
|
119
|
+
* define a custom Post shape entirely.
|
|
120
|
+
*
|
|
121
|
+
* The Posts collection exists primarily so the lib's translator
|
|
122
|
+
* plugin has a second localized collection to translate.
|
|
123
|
+
*/
|
|
124
|
+
declare const createPostsCollection: (options?: CreatePostsCollectionOptions) => CollectionConfig2;
|
|
125
|
+
import { Block as Block2, CollectionConfig as CollectionConfig3 } from "payload";
|
|
126
|
+
declare const STATIC_PAGES_SLUG = "staticPages";
|
|
127
|
+
type CreateStaticPagesCollectionOptions = {
|
|
128
|
+
/**
|
|
129
|
+
* Blocks the StaticPages collection accepts. Hosts pass the same
|
|
130
|
+
* `blocks` they use for `createPagesCollection` (or a smaller
|
|
131
|
+
* subset — e.g. just `pageHeroBlock` + `ctaBlock` + `featureGridBlock`).
|
|
132
|
+
* The lib does not curate a separate block set for system pages.
|
|
133
|
+
*/
|
|
134
|
+
blocks: Block2[];
|
|
135
|
+
};
|
|
136
|
+
declare const createStaticPagesCollection: (blocks: Block2[]) => CollectionConfig3;
|
|
137
|
+
import { GlobalConfig } from "payload";
|
|
138
|
+
type CreateHeaderGlobalOptions = {
|
|
139
|
+
/**
|
|
140
|
+
* Optional override for the `custom.path` Payload uses to resolve
|
|
141
|
+
* the header's render module. Default: the lib's `HEADER_RENDER_PATH`.
|
|
142
|
+
*/
|
|
143
|
+
renderPath?: string;
|
|
144
|
+
/**
|
|
145
|
+
* Collection slugs the nav's link fields can reference. Required
|
|
146
|
+
* by Payload 3.85 — empty `relationTo` arrays are rejected.
|
|
147
|
+
* Defaults to `['pages']` (the lib's Pages collection). Pass a
|
|
148
|
+
* different list when your host has additional linkable collections.
|
|
149
|
+
*/
|
|
150
|
+
linkRelationTo?: string[];
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Build the Header global. The lib's default shape: a `nav` blocks
|
|
154
|
+
* field with two block types — `navColumn` (a titled group of links)
|
|
155
|
+
* and `navItem` (a single link).
|
|
156
|
+
*/
|
|
157
|
+
declare const createHeaderGlobal: (options?: CreateHeaderGlobalOptions) => GlobalConfig;
|
|
158
|
+
import { GlobalConfig as GlobalConfig2 } from "payload";
|
|
159
|
+
type CreateFooterGlobalOptions = {
|
|
160
|
+
/**
|
|
161
|
+
* Optional override for the `custom.path` Payload uses to resolve
|
|
162
|
+
* the footer's render module. Default: the lib's `FOOTER_RENDER_PATH`.
|
|
163
|
+
*/
|
|
164
|
+
renderPath?: string;
|
|
165
|
+
/**
|
|
166
|
+
* Collection slugs the nav's link fields can reference. Required
|
|
167
|
+
* by Payload 3.85 — empty `relationTo` arrays are rejected.
|
|
168
|
+
* Defaults to `['pages']` (the lib's Pages collection). Pass a
|
|
169
|
+
* different list when your host has additional linkable collections.
|
|
170
|
+
*/
|
|
171
|
+
linkRelationTo?: string[];
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
* Build the Footer global. The lib's default shape mirrors the
|
|
175
|
+
* Header: a `nav` blocks field with `navColumn` (a titled group of
|
|
176
|
+
* links) and `navItem` (a single link) blocks.
|
|
177
|
+
*/
|
|
178
|
+
declare const createFooterGlobal: (options?: CreateFooterGlobalOptions) => GlobalConfig2;
|
|
179
|
+
import { CollectionSlug, PayloadRequest } from "payload";
|
|
180
|
+
declare function generatePreviewPath({ collection, slug }: {
|
|
181
|
+
collection: CollectionSlug;
|
|
182
|
+
slug: string | null | undefined;
|
|
183
|
+
req?: PayloadRequest;
|
|
184
|
+
}): string | null;
|
|
185
|
+
import { Block as Block_129qi5 } from "payload";
|
|
186
|
+
import { CollectionConfig as CollectionConfig_j7kwbk } from "payload";
|
|
187
|
+
import { GlobalConfig as GlobalConfig_fuin17 } from "payload";
|
|
188
|
+
declare const _default: {
|
|
189
|
+
createPagesCollection: (blocks: Block_129qi5[], options?: Omit<CreatePagesCollectionOptions, "blocks">) => CollectionConfig_j7kwbk;
|
|
190
|
+
createPostsCollection: (options?: CreatePostsCollectionOptions) => CollectionConfig_j7kwbk;
|
|
191
|
+
createStaticPagesCollection: (blocks: Block_129qi5[]) => CollectionConfig_j7kwbk;
|
|
192
|
+
createHeaderGlobal: (options?: CreateHeaderGlobalOptions) => GlobalConfig_fuin17;
|
|
193
|
+
createFooterGlobal: (options?: CreateFooterGlobalOptions) => GlobalConfig_fuin17;
|
|
194
|
+
generatePreviewPath: typeof generatePreviewPath;
|
|
195
|
+
HOME_PAGE_SLUG: string;
|
|
196
|
+
PAGES_SLUG: string;
|
|
197
|
+
POSTS_SLUG: string;
|
|
198
|
+
STATIC_PAGES_SLUG: string;
|
|
199
|
+
};
|
|
200
|
+
export { generatePreviewPath, _default as default, createStaticPagesCollection, createPostsCollection, createPagesCollection, createHeaderGlobal, createFooterGlobal, STATIC_PAGES_SLUG, POSTS_SLUG, PAGES_SLUG, HOME_PAGE_SLUG, CreateStaticPagesCollectionOptions, CreatePostsCollectionOptions, CreatePagesCollectionOptions, CreateHeaderGlobalOptions, CreateFooterGlobalOptions };
|