feat: ✨ add @payloadcms/translations, enable i18n and localization, update collections and globals and add "Menu" group
- Fix `format` files globmain
parent
e03c6a1067
commit
c3dd300769
File diff suppressed because it is too large
Load Diff
@ -1 +1,49 @@
|
|||||||
export const importMap = {};
|
import { RichTextCell as RichTextCell_0 } from '@payloadcms/richtext-lexical/client'
|
||||||
|
import { RichTextField as RichTextField_1 } from '@payloadcms/richtext-lexical/client'
|
||||||
|
import { getGenerateComponentMap as getGenerateComponentMap_2 } from '@payloadcms/richtext-lexical/generateComponentMap'
|
||||||
|
import { InlineToolbarFeatureClient as InlineToolbarFeatureClient_3 } from '@payloadcms/richtext-lexical/client'
|
||||||
|
import { HorizontalRuleFeatureClient as HorizontalRuleFeatureClient_4 } from '@payloadcms/richtext-lexical/client'
|
||||||
|
import { UploadFeatureClient as UploadFeatureClient_5 } from '@payloadcms/richtext-lexical/client'
|
||||||
|
import { BlockquoteFeatureClient as BlockquoteFeatureClient_6 } from '@payloadcms/richtext-lexical/client'
|
||||||
|
import { RelationshipFeatureClient as RelationshipFeatureClient_7 } from '@payloadcms/richtext-lexical/client'
|
||||||
|
import { LinkFeatureClient as LinkFeatureClient_8 } from '@payloadcms/richtext-lexical/client'
|
||||||
|
import { ChecklistFeatureClient as ChecklistFeatureClient_9 } from '@payloadcms/richtext-lexical/client'
|
||||||
|
import { OrderedListFeatureClient as OrderedListFeatureClient_10 } from '@payloadcms/richtext-lexical/client'
|
||||||
|
import { UnorderedListFeatureClient as UnorderedListFeatureClient_11 } from '@payloadcms/richtext-lexical/client'
|
||||||
|
import { IndentFeatureClient as IndentFeatureClient_12 } from '@payloadcms/richtext-lexical/client'
|
||||||
|
import { AlignFeatureClient as AlignFeatureClient_13 } from '@payloadcms/richtext-lexical/client'
|
||||||
|
import { HeadingFeatureClient as HeadingFeatureClient_14 } from '@payloadcms/richtext-lexical/client'
|
||||||
|
import { ParagraphFeatureClient as ParagraphFeatureClient_15 } from '@payloadcms/richtext-lexical/client'
|
||||||
|
import { InlineCodeFeatureClient as InlineCodeFeatureClient_16 } from '@payloadcms/richtext-lexical/client'
|
||||||
|
import { SuperscriptFeatureClient as SuperscriptFeatureClient_17 } from '@payloadcms/richtext-lexical/client'
|
||||||
|
import { SubscriptFeatureClient as SubscriptFeatureClient_18 } from '@payloadcms/richtext-lexical/client'
|
||||||
|
import { StrikethroughFeatureClient as StrikethroughFeatureClient_19 } from '@payloadcms/richtext-lexical/client'
|
||||||
|
import { UnderlineFeatureClient as UnderlineFeatureClient_20 } from '@payloadcms/richtext-lexical/client'
|
||||||
|
import { BoldFeatureClient as BoldFeatureClient_21 } from '@payloadcms/richtext-lexical/client'
|
||||||
|
import { ItalicFeatureClient as ItalicFeatureClient_22 } from '@payloadcms/richtext-lexical/client'
|
||||||
|
|
||||||
|
export const importMap = {
|
||||||
|
"@payloadcms/richtext-lexical/client#RichTextCell": RichTextCell_0,
|
||||||
|
"@payloadcms/richtext-lexical/client#RichTextField": RichTextField_1,
|
||||||
|
"@payloadcms/richtext-lexical/generateComponentMap#getGenerateComponentMap": getGenerateComponentMap_2,
|
||||||
|
"@payloadcms/richtext-lexical/client#InlineToolbarFeatureClient": InlineToolbarFeatureClient_3,
|
||||||
|
"@payloadcms/richtext-lexical/client#HorizontalRuleFeatureClient": HorizontalRuleFeatureClient_4,
|
||||||
|
"@payloadcms/richtext-lexical/client#UploadFeatureClient": UploadFeatureClient_5,
|
||||||
|
"@payloadcms/richtext-lexical/client#BlockquoteFeatureClient": BlockquoteFeatureClient_6,
|
||||||
|
"@payloadcms/richtext-lexical/client#RelationshipFeatureClient": RelationshipFeatureClient_7,
|
||||||
|
"@payloadcms/richtext-lexical/client#LinkFeatureClient": LinkFeatureClient_8,
|
||||||
|
"@payloadcms/richtext-lexical/client#ChecklistFeatureClient": ChecklistFeatureClient_9,
|
||||||
|
"@payloadcms/richtext-lexical/client#OrderedListFeatureClient": OrderedListFeatureClient_10,
|
||||||
|
"@payloadcms/richtext-lexical/client#UnorderedListFeatureClient": UnorderedListFeatureClient_11,
|
||||||
|
"@payloadcms/richtext-lexical/client#IndentFeatureClient": IndentFeatureClient_12,
|
||||||
|
"@payloadcms/richtext-lexical/client#AlignFeatureClient": AlignFeatureClient_13,
|
||||||
|
"@payloadcms/richtext-lexical/client#HeadingFeatureClient": HeadingFeatureClient_14,
|
||||||
|
"@payloadcms/richtext-lexical/client#ParagraphFeatureClient": ParagraphFeatureClient_15,
|
||||||
|
"@payloadcms/richtext-lexical/client#InlineCodeFeatureClient": InlineCodeFeatureClient_16,
|
||||||
|
"@payloadcms/richtext-lexical/client#SuperscriptFeatureClient": SuperscriptFeatureClient_17,
|
||||||
|
"@payloadcms/richtext-lexical/client#SubscriptFeatureClient": SubscriptFeatureClient_18,
|
||||||
|
"@payloadcms/richtext-lexical/client#StrikethroughFeatureClient": StrikethroughFeatureClient_19,
|
||||||
|
"@payloadcms/richtext-lexical/client#UnderlineFeatureClient": UnderlineFeatureClient_20,
|
||||||
|
"@payloadcms/richtext-lexical/client#BoldFeatureClient": BoldFeatureClient_21,
|
||||||
|
"@payloadcms/richtext-lexical/client#ItalicFeatureClient": ItalicFeatureClient_22
|
||||||
|
}
|
||||||
|
@ -0,0 +1,43 @@
|
|||||||
|
import type { CollectionConfig } from "payload";
|
||||||
|
|
||||||
|
export const MenuCategory: CollectionConfig = {
|
||||||
|
slug: "opening-time",
|
||||||
|
access: {
|
||||||
|
read: () => true,
|
||||||
|
},
|
||||||
|
admin: {
|
||||||
|
useAsTitle: "title",
|
||||||
|
},
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: "title",
|
||||||
|
type: "text",
|
||||||
|
localized: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "description",
|
||||||
|
type: "richText",
|
||||||
|
localized: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "from",
|
||||||
|
type: "date",
|
||||||
|
admin: {
|
||||||
|
date: {
|
||||||
|
pickerAppearance: "dayOnly",
|
||||||
|
displayFormat: "d MMM yyy",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "to",
|
||||||
|
type: "date",
|
||||||
|
admin: {
|
||||||
|
date: {
|
||||||
|
pickerAppearance: "dayOnly",
|
||||||
|
displayFormat: "d MMM yyy",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
@ -0,0 +1,26 @@
|
|||||||
|
import type { CollectionConfig } from "payload";
|
||||||
|
import { Menu } from "../groups/Menu";
|
||||||
|
|
||||||
|
export const FoodDeclaration: CollectionConfig = {
|
||||||
|
slug: "food-declaration",
|
||||||
|
access: {
|
||||||
|
read: () => true,
|
||||||
|
},
|
||||||
|
admin: {
|
||||||
|
useAsTitle: "title",
|
||||||
|
group: Menu,
|
||||||
|
},
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: "title",
|
||||||
|
type: "text",
|
||||||
|
required: true,
|
||||||
|
localized: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "description",
|
||||||
|
type: "richText",
|
||||||
|
localized: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
@ -0,0 +1,20 @@
|
|||||||
|
import type { CollectionConfig } from "payload";
|
||||||
|
import { Menu } from "../groups/Menu";
|
||||||
|
|
||||||
|
export const MenuCategory: CollectionConfig = {
|
||||||
|
slug: "menu-category",
|
||||||
|
access: {
|
||||||
|
read: () => true,
|
||||||
|
},
|
||||||
|
admin: {
|
||||||
|
useAsTitle: "name",
|
||||||
|
group: Menu,
|
||||||
|
},
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: "name",
|
||||||
|
type: "text",
|
||||||
|
localized: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
@ -0,0 +1,42 @@
|
|||||||
|
import type { CollectionConfig } from "payload";
|
||||||
|
import { Menu } from "../groups/Menu";
|
||||||
|
|
||||||
|
export const MenuItem: CollectionConfig = {
|
||||||
|
slug: "menu-item",
|
||||||
|
access: {
|
||||||
|
read: () => true,
|
||||||
|
},
|
||||||
|
admin: {
|
||||||
|
useAsTitle: "name",
|
||||||
|
group: Menu,
|
||||||
|
},
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: "name",
|
||||||
|
type: "text",
|
||||||
|
required: true,
|
||||||
|
localized: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "description",
|
||||||
|
type: "richText",
|
||||||
|
localized: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "image",
|
||||||
|
type: "relationship",
|
||||||
|
relationTo: "media",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "category",
|
||||||
|
type: "relationship",
|
||||||
|
relationTo: "menu-category",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "tags",
|
||||||
|
type: "relationship",
|
||||||
|
relationTo: "menu-item-tag",
|
||||||
|
hasMany: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
@ -0,0 +1,26 @@
|
|||||||
|
import type { CollectionConfig } from "payload";
|
||||||
|
import { Menu } from "../groups/Menu";
|
||||||
|
|
||||||
|
export const MenuItemTag: CollectionConfig = {
|
||||||
|
slug: "menu-item-tag",
|
||||||
|
access: {
|
||||||
|
read: () => true,
|
||||||
|
},
|
||||||
|
admin: {
|
||||||
|
useAsTitle: "name",
|
||||||
|
group: Menu,
|
||||||
|
},
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: "name",
|
||||||
|
type: "text",
|
||||||
|
required: true,
|
||||||
|
localized: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "description",
|
||||||
|
type: "richText",
|
||||||
|
localized: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
@ -0,0 +1,77 @@
|
|||||||
|
import type { CollectionConfig, Option } from "payload";
|
||||||
|
|
||||||
|
export const DayOptions: Option[] = [
|
||||||
|
{
|
||||||
|
label: "Monday",
|
||||||
|
value: "0",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Tuesday",
|
||||||
|
value: "1",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Wednesday",
|
||||||
|
value: "2",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Thursday",
|
||||||
|
value: "3",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Friday",
|
||||||
|
value: "4",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Saturday",
|
||||||
|
value: "5",
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Sunday",
|
||||||
|
value: "6",
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export const OpeningTime: CollectionConfig = {
|
||||||
|
slug: "opening-time",
|
||||||
|
access: {
|
||||||
|
read: () => true,
|
||||||
|
},
|
||||||
|
admin: {
|
||||||
|
defaultColumns: ["from", "to", "timeOpen", "timeClose"],
|
||||||
|
},
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: "from",
|
||||||
|
type: "select",
|
||||||
|
options: DayOptions,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "to",
|
||||||
|
type: "select",
|
||||||
|
options: DayOptions,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "timeOpen",
|
||||||
|
type: "date",
|
||||||
|
required: true,
|
||||||
|
admin: {
|
||||||
|
date: {
|
||||||
|
pickerAppearance: "timeOnly",
|
||||||
|
displayFormat: "h:mm:ss a",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "timeClose",
|
||||||
|
type: "date",
|
||||||
|
required: true,
|
||||||
|
admin: {
|
||||||
|
date: {
|
||||||
|
pickerAppearance: "timeOnly",
|
||||||
|
displayFormat: "h:mm:ss a",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
@ -0,0 +1,20 @@
|
|||||||
|
import type { GlobalConfig } from "payload";
|
||||||
|
|
||||||
|
export const About: GlobalConfig = {
|
||||||
|
slug: "about",
|
||||||
|
access: {
|
||||||
|
read: () => true,
|
||||||
|
},
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: "name",
|
||||||
|
type: "text",
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "text",
|
||||||
|
type: "richText",
|
||||||
|
localized: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
@ -0,0 +1,46 @@
|
|||||||
|
import type { GlobalConfig } from "payload";
|
||||||
|
|
||||||
|
export const Contact: GlobalConfig = {
|
||||||
|
slug: "contact",
|
||||||
|
access: {
|
||||||
|
read: () => true,
|
||||||
|
},
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: "address",
|
||||||
|
type: "group",
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
type: "row",
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: "street",
|
||||||
|
type: "text",
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "number",
|
||||||
|
type: "number",
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "row",
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: "zip",
|
||||||
|
type: "number",
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "area",
|
||||||
|
type: "text",
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
@ -0,0 +1,15 @@
|
|||||||
|
import type { GlobalConfig } from "payload";
|
||||||
|
|
||||||
|
export const Menu: GlobalConfig = {
|
||||||
|
slug: "menu",
|
||||||
|
access: {
|
||||||
|
read: () => true,
|
||||||
|
},
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: "file",
|
||||||
|
type: "relationship",
|
||||||
|
relationTo: "media",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
@ -0,0 +1,4 @@
|
|||||||
|
export const Menu: Record<string, string> = {
|
||||||
|
en: "Menu",
|
||||||
|
de: "Menü",
|
||||||
|
};
|
Loading…
Reference in New Issue