chore: relationship slate ssr

This commit is contained in:
James
2024-02-22 14:37:59 -05:00
parent 56c325b526
commit ca7b8e589e
56 changed files with 186 additions and 124 deletions

BIN
media/image-9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

View File

@@ -1,32 +1,24 @@
'use client'
import type { BaseEditor, BaseOperation, Editor } from 'slate'
import type { FormFieldBase } from '@payloadcms/ui/types'
import type { BaseEditor, BaseOperation } from 'slate'
import type { HistoryEditor } from 'slate-history'
import type { ReactEditor } from 'slate-react'
import { getTranslation } from '@payloadcms/translations'
import { useEditDepth, useField, useTranslation } from '@payloadcms/ui'
import isHotkey from 'is-hotkey'
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'
import React, { useCallback, useEffect, useMemo, useRef } from 'react'
import { Node, Element as SlateElement, Text, Transforms, createEditor } from 'slate'
import { withHistory } from 'slate-history'
import { Editable, Slate, withReact } from 'slate-react'
import type { FormFieldBase } from '../../../ui/src/forms/fields/shared'
import type {
ElementNode,
RichTextCustomElement,
RichTextPlugin,
RichTextPluginComponent,
TextNode,
} from '../types'
import type { ElementNode, RichTextPlugin, TextNode } from '../types'
import type { EnabledFeatures } from './types'
import { withCondition } from '../../../ui/src/forms/withCondition'
import { useClientFunctions } from '../../../ui/src/providers/ClientFunction'
import { defaultRichTextValue } from '../data/defaultValue'
import { richTextValidate } from '../data/validation'
import { createFeatureMap } from './createFeatureMap'
import listTypes from './elements/listTypes'
import hotkeys from './hotkeys'
import './index.scss'

View File

@@ -11,7 +11,7 @@ import h6 from './h6'
import li from './li'
import link from './link'
import ol from './ol'
// import relationship from './relationship'
import relationship from './relationship'
// import textAlign from './textAlign'
import ul from './ul'
import upload from './upload'
@@ -28,7 +28,7 @@ const elements: Record<string, RichTextCustomElement> = {
li,
link,
ol,
// relationship,
relationship,
// textAlign,
ul,
upload,

View File

@@ -8,12 +8,12 @@ import {
useEditDepth,
useTranslation,
} from '@payloadcms/ui'
import { FieldPathProvider } from '@payloadcms/ui/forms'
import { useHotkey } from '@payloadcms/ui/hooks'
import React, { useRef } from 'react'
import type { Props } from './types'
import { FieldPathProvider } from '../../../../../../ui/src/forms/FieldPathProvider'
import './index.scss'
const baseClass = 'rich-text-link-edit-modal'

View File

@@ -1,63 +0,0 @@
'use client'
import {
RelationshipComponent,
SelectComponent,
useAuth,
useConfig,
useFormFields,
useTranslation,
} from '@payloadcms/ui'
import React, { Fragment, useEffect, useState } from 'react'
const createOptions = (collections, permissions) =>
collections.reduce((options, collection) => {
if (
permissions?.collections?.[collection.slug]?.read?.permission &&
collection?.admin?.enableRichTextRelationship
) {
return [
...options,
{
label: collection.labels.plural,
value: collection.slug,
},
]
}
return options
}, [])
const RelationshipFields = () => {
const { collections } = useConfig()
const { permissions } = useAuth()
const { t } = useTranslation()
const [options, setOptions] = useState(() => createOptions(collections, permissions))
const relationTo = useFormFields<string>(([fields]) => fields.relationTo?.value as string)
useEffect(() => {
setOptions(createOptions(collections, permissions))
}, [collections, permissions])
return (
<Fragment>
<SelectComponent
label={t('fields:relationTo')}
name="relationTo"
options={options}
required
/>
{relationTo && (
<RelationshipComponent
label={t('fields:relatedDocument')}
name="value"
relationTo={relationTo}
required
/>
)}
</Fragment>
)
}
export default RelationshipFields

View File

@@ -43,9 +43,9 @@ const RelationshipButton: React.FC<Props> = ({ enabledCollectionSlugs }) => {
})
const onSelect = useCallback(
({ collectionConfig, docID }) => {
({ collectionSlug, docID }) => {
insertRelationship(editor, {
relationTo: collectionConfig.slug,
relationTo: collectionSlug,
value: {
id: docID,
},

View File

@@ -1,6 +1,6 @@
'use client'
import type { HTMLAttributes } from 'react'
import type { FormFieldBase } from '@payloadcms/ui/types'
import { getTranslation } from '@payloadcms/translations'
import {
@@ -15,8 +15,9 @@ import React, { useCallback, useReducer, useState } from 'react'
import { Transforms } from 'slate'
import { ReactEditor, useFocused, useSelected, useSlateStatic } from 'slate-react'
import type { FieldProps } from '../../../../types'
import type { RelationshipElementType } from '../types'
import { useElement } from '../../../providers/ElementProvider'
import { EnabledRelationshipsCondition } from '../../EnabledRelationshipsCondition'
import './index.scss'
@@ -26,20 +27,19 @@ const initialParams = {
depth: 0,
}
type Props = {
attributes: HTMLAttributes<HTMLDivElement>
children: React.ReactNode
element: any
fieldProps: FieldProps
type Props = FormFieldBase & {
name: string
richTextComponentMap: Map<string, React.ReactNode>
}
const Element: React.FC<Props> = (props) => {
const Element: React.FC<Props> = () => {
const {
attributes,
children,
element,
element: { relationTo, value },
fieldProps,
} = props
} = useElement<RelationshipElementType>()
const {
collections,
@@ -107,21 +107,21 @@ const Element: React.FC<Props> = (props) => {
)
const swapRelationship = React.useCallback(
({ collectionConfig, docID }) => {
({ collectionSlug, docID }) => {
const elementPath = ReactEditor.findPath(editor, element)
Transforms.setNodes(
editor,
{
children: [{ text: ' ' }],
relationTo: collectionConfig.slug,
relationTo: collectionSlug,
type: 'relationship',
value: { id: docID },
},
{ at: elementPath },
)
setRelatedCollection(collections.find((coll) => coll.slug === collectionConfig.slug))
setRelatedCollection(collections.find((coll) => coll.slug === collectionSlug))
setParams({
...initialParams,
@@ -157,11 +157,11 @@ const Element: React.FC<Props> = (props) => {
<div className={`${baseClass}__actions`}>
<ListDrawerToggler
className={`${baseClass}__list-drawer-toggler`}
disabled={fieldProps?.admin?.readOnly}
disabled={fieldProps?.readOnly}
>
<Button
buttonStyle="icon-label"
disabled={fieldProps?.admin?.readOnly}
disabled={fieldProps?.readOnly}
el="div"
icon="swap"
onClick={() => {
@@ -174,7 +174,7 @@ const Element: React.FC<Props> = (props) => {
<Button
buttonStyle="icon-label"
className={`${baseClass}__removeButton`}
disabled={fieldProps?.admin?.readOnly}
disabled={fieldProps?.readOnly}
icon="x"
onClick={(e) => {
e.preventDefault()

View File

@@ -0,0 +1,15 @@
import type { RichTextCustomElement } from '../../..'
import Button from './Button'
import Element from './Element'
import { WithRelationship } from './plugin'
import { relationshipName } from './shared'
const relationship: RichTextCustomElement = {
name: relationshipName,
Button,
Element,
plugins: [WithRelationship],
}
export default relationship

View File

@@ -1,9 +0,0 @@
import Button from './Button'
import Element from './Element'
import plugin from './plugin'
export default {
Button,
Element,
plugins: [plugin],
}

View File

@@ -1,10 +1,18 @@
const withRelationship = (incomingEditor) => {
const editor = incomingEditor
const { isVoid } = editor
'use client'
editor.isVoid = (element) => (element.type === 'relationship' ? true : isVoid(element))
import type React from 'react'
return editor
import { useSlatePlugin } from '../../../utilities/useSlatePlugin'
import { relationshipName } from './shared'
export const WithRelationship: React.FC = () => {
useSlatePlugin('withRelationship', (incomingEditor) => {
const editor = incomingEditor
const { isVoid } = editor
editor.isVoid = (element) => (element.type === relationshipName ? true : isVoid(element))
return editor
})
return null
}
export default withRelationship

View File

@@ -0,0 +1 @@
export const relationshipName = 'relationship'

View File

@@ -0,0 +1,8 @@
import type { Element } from 'slate'
export type RelationshipElementType = Element & {
relationTo: string
value: {
id: number | string
} | null
}

View File

@@ -1,5 +1,6 @@
'use client'
import type { FormFieldBase } from '@payloadcms/ui/types'
import type { SanitizedCollectionConfig } from 'payload/types'
import { useModal } from '@faceless-ui/modal'
@@ -16,15 +17,14 @@ import {
useLocale,
useTranslation,
} from '@payloadcms/ui'
import { FieldPathProvider } from '@payloadcms/ui/forms'
import { deepCopyObject } from 'payload/utilities'
import React, { useCallback, useEffect, useState } from 'react'
import { Transforms } from 'slate'
import { ReactEditor, useSlateStatic } from 'slate-react'
import type { FormFieldBase } from '../../../../../../../ui/src/forms/fields/shared'
import type { UploadElementType } from '../../types'
import { FieldPathProvider } from '../../../../../../../ui/src/forms/FieldPathProvider'
import { uploadFieldsSchemaPath } from '../../shared'
export const UploadDrawer: React.FC<{

View File

@@ -1,5 +1,6 @@
'use client'
import type { FormFieldBase } from '@payloadcms/ui/types'
import type { SanitizedCollectionConfig } from 'payload/types'
import { getTranslation } from '@payloadcms/translations'
@@ -19,7 +20,6 @@ import React, { useCallback, useReducer, useState } from 'react'
import { Transforms } from 'slate'
import { ReactEditor, useFocused, useSelected, useSlateStatic } from 'slate-react'
import type { FormFieldBase } from '../../../../../../ui/src/forms/fields/shared'
import type { UploadElementType } from '../types'
import { useElement } from '../../../providers/ElementProvider'

View File

@@ -1,8 +1,9 @@
'use client'
import type { FormFieldBase } from '@payloadcms/ui/types'
import { ShimmerEffect } from '@payloadcms/ui'
import React, { Suspense, lazy, useEffect, useState } from 'react'
import type { FormFieldBase } from '../../../ui/src/forms/fields/shared'
import type { RichTextPlugin } from '../types'
import type { EnabledFeatures } from './types'

View File

@@ -1,7 +1,7 @@
'use client'
import React from 'react'
import type { FormFieldBase } from '@payloadcms/ui/types'
import type { FormFieldBase } from '../../../../ui/src/forms/fields/shared'
import React from 'react'
type ElementButtonContextType = {
fieldProps: FormFieldBase & {

View File

@@ -1,10 +1,9 @@
'use client'
import type { FormFieldBase } from '@payloadcms/ui/types'
import type { Element } from 'slate'
import React from 'react'
import type { FormFieldBase } from '../../../../ui/src/forms/fields/shared'
type ElementContextType<T> = {
attributes: Record<string, unknown>
children: React.ReactNode

View File

@@ -1,7 +1,7 @@
'use client'
import React from 'react'
import type { FormFieldBase } from '@payloadcms/ui/types'
import type { FormFieldBase } from '../../../../ui/src/forms/fields/shared'
import React from 'react'
type LeafButtonContextType = {
fieldProps: FormFieldBase & {

View File

@@ -1,7 +1,7 @@
'use client'
import React from 'react'
import type { FormFieldBase } from '@payloadcms/ui/types'
import type { FormFieldBase } from '../../../../ui/src/forms/fields/shared'
import React from 'react'
type LeafContextType = {
attributes: Record<string, unknown>

View File

@@ -171,6 +171,9 @@ const clientTranslationKeys = [
'fields:editRelationship',
'fields:removeUpload',
'fields:saveChanges',
'fields:addRelationship',
'fields:removeRelationship',
'fields:labelRelationship',
'general:aboutToDeleteCount',
'general:aboutToDelete',
'general:addBelow',

View File

@@ -57,6 +57,7 @@
"addLink": "أضف رابط",
"addNew": "أضف جديد",
"addNewLabel": "أضف {{label}} جديد",
"addRelationship": "أضف علاقة",
"addUpload": "أضف تحميل",
"block": "وحدة محتوى",
"blockType": "نوع وحدة المحتوى",
@@ -66,9 +67,11 @@
"editLink": "عدّل الرّابط",
"editRelationship": "عدّل العلاقة",
"itemsAndMore": "{{items}} و {{count}} أخرى",
"labelRelationship": "{{label}} علاقة",
"latitude": "خطّ العرض",
"longitude": "خطّ الطّول",
"passwordsDoNotMatch": "كلمة المرور غير مطابقة.",
"removeRelationship": "حذف العلاقة",
"removeUpload": "حذف المحتوى المرفوع",
"saveChanges": "حفظ التّغييرات",
"searchForBlock": "ابحث عن وحدة محتوى",

View File

@@ -57,6 +57,7 @@
"addLink": "Keçid əlavə et",
"addNew": "Yenisini əlavə et",
"addNewLabel": "Yeni {{label}} əlavə et",
"addRelationship": "Relationship əlavə et",
"addUpload": "Yükləmə əlavə et",
"block": "blok",
"blockType": "Blok Növü",
@@ -66,9 +67,11 @@
"editLink": "Keçidi redaktə et",
"editRelationship": "Relationship redaktə et",
"itemsAndMore": "{{items}} və daha {{count}} nəfər",
"labelRelationship": "{{label}} Relationship",
"latitude": "Enlik",
"longitude": "Uzunluq",
"passwordsDoNotMatch": "Şifrələr uyğun gəlmir.",
"removeRelationship": "Relationship sil",
"removeUpload": "Yükləməni sil",
"saveChanges": "Dəyişiklikləri saxla",
"searchForBlock": "Blok üçün axtarış",

View File

@@ -57,6 +57,7 @@
"addLink": "Добави нова връзка",
"addNew": "Добави нов",
"addNewLabel": "Добави нов {{label}}",
"addRelationship": "Добави отношение",
"addUpload": "Качи",
"block": "блок",
"blockType": "Тип блок",
@@ -66,9 +67,11 @@
"editLink": "Редактирай връзка",
"editRelationship": "Редактирай отношение",
"itemsAndMore": "{{items}} и {{count}} повече",
"labelRelationship": "{{label}} връзка",
"latitude": "Географска ширина",
"longitude": "Географска дължина",
"passwordsDoNotMatch": "Паролите не са еднакви.",
"removeRelationship": "Премахни отношение",
"removeUpload": "Премахни качване",
"saveChanges": "Запази промените",
"searchForBlock": "Търси блок",

View File

@@ -57,6 +57,7 @@
"addLink": "Přidat Odkaz",
"addNew": "Přidat nový",
"addNewLabel": "Přidat nový {{label}}",
"addRelationship": "Přidat vztah",
"addUpload": "Přidat nahrávání",
"block": "blok",
"blockType": "Typ bloku",
@@ -66,9 +67,11 @@
"editLink": "Upravit odkaz",
"editRelationship": "Upravit vztah",
"itemsAndMore": "{{items}} a {{count}} dalších",
"labelRelationship": "Vztah {{label}}",
"latitude": "Zeměpisná šířka",
"longitude": "Zeměpisná délka",
"passwordsDoNotMatch": "Hesla se neshodují.",
"removeRelationship": "Odstranit vztah",
"removeUpload": "Odstranit nahrání",
"saveChanges": "Uložit změny",
"searchForBlock": "Hledat blok",

View File

@@ -57,6 +57,7 @@
"addLink": "Link Hinzufügen",
"addNew": "Neu erstellen",
"addNewLabel": "{{label}} erstellen",
"addRelationship": "Verknüpfung Hinzufügen",
"addUpload": "Hochladen Hinzufügen",
"block": "Block",
"blockType": "Block-Typ",
@@ -66,9 +67,11 @@
"editLink": "Bearbeite Link",
"editRelationship": "Beziehung Hinzufügen",
"itemsAndMore": "{{items}} und {{count}} mehr",
"labelRelationship": "{{label}} Verknüpfung",
"latitude": "Breitengrad",
"longitude": "Längengrad",
"passwordsDoNotMatch": "Passwörter stimmen nicht überein.",
"removeRelationship": "Beziehung Entfernen",
"removeUpload": "Hochgeladene Datei Löschen",
"saveChanges": "Änderungen speichern",
"searchForBlock": "Nach Block suchen",

View File

@@ -59,6 +59,7 @@
"addLink": "Add Link",
"addNew": "Add new",
"addNewLabel": "Add new {{label}}",
"addRelationship": "Add Relationship",
"addUpload": "Add Upload",
"block": "block",
"blockType": "Block Type",
@@ -68,9 +69,11 @@
"editLink": "Edit Link",
"editRelationship": "Edit Relationship",
"itemsAndMore": "{{items}} and {{count}} more",
"labelRelationship": "{{label}} Relationship",
"latitude": "Latitude",
"longitude": "Longitude",
"passwordsDoNotMatch": "Passwords do not match.",
"removeRelationship": "Remove Relationship",
"removeUpload": "Remove Upload",
"saveChanges": "Save changes",
"searchForBlock": "Search for a block",

View File

@@ -57,6 +57,7 @@
"addLink": "Añadir Enlace",
"addNew": "Añadir nuevo",
"addNewLabel": "Añadir {{label}}",
"addRelationship": "Añadir Relación",
"addUpload": "Añadir Carga",
"block": "bloque",
"blockType": "Tipo de bloque",
@@ -66,9 +67,11 @@
"editLink": "Editar Enlace",
"editRelationship": "Editar Relación",
"itemsAndMore": "{{items}} y {{count}} más",
"labelRelationship": "Relación de {{label}}",
"latitude": "Latitud",
"longitude": "Longitud",
"passwordsDoNotMatch": "Las contraseñas no coinciden.",
"removeRelationship": "Eliminar relación",
"removeUpload": "Quitar Carga",
"saveChanges": "Guardar cambios",
"searchForBlock": "Buscar bloque",

View File

@@ -57,6 +57,7 @@
"addLink": "افزودن پیوند",
"addNew": "افزودن",
"addNewLabel": "افزودن {{label}} تازه",
"addRelationship": "افزودن پیوستگی",
"addUpload": "افزودن بارگذار",
"block": "بلوک",
"blockType": "نوع بلوک",
@@ -66,9 +67,11 @@
"editLink": "نگارش پیوند",
"editRelationship": "نگارش پیوستگی",
"itemsAndMore": "{{items}} و {{count}} بیش‌تر",
"labelRelationship": "{{label}} پیوستگی",
"latitude": "عرض جغرافیایی",
"longitude": "طول جغرافیایی",
"passwordsDoNotMatch": "گذرواژه‌های وارد شده مطابقت ندارند.",
"removeRelationship": "حذف پیوستگی",
"removeUpload": "حذف بارگذار",
"saveChanges": "ذخیره تغییرات",
"searchForBlock": "جست‌وجو برای بلوک",

View File

@@ -57,6 +57,7 @@
"addLink": "Ajouter un Lien",
"addNew": "Ajouter nouveau ou nouvelle",
"addNewLabel": "Ajouter nouveau ou nouvelle {{label}}",
"addRelationship": "Ajouter une relation",
"addUpload": "Ajouter le téléchargement",
"block": "bloc",
"blockType": "Type de bloc",
@@ -66,9 +67,11 @@
"editLink": "Modifier le lien",
"editRelationship": "Modifier la relation",
"itemsAndMore": "{{items}} et {{count}} de plus",
"labelRelationship": "Relation de ou du {{label}} ",
"latitude": "Latitude",
"longitude": "Longitude",
"passwordsDoNotMatch": "Les mots de passe ne correspondent pas.",
"removeRelationship": "Supprimer la relation",
"removeUpload": "Supprimer le Téléversement",
"saveChanges": "Sauvegarder les modifications",
"searchForBlock": "Rechercher un bloc",

View File

@@ -57,6 +57,7 @@
"addLink": "Dodaj poveznicu",
"addNew": "Dodaj novi",
"addNewLabel": "Dodaj novi {{label}}",
"addRelationship": "Dodaj odnos",
"addUpload": "Dodaj učitavanje",
"block": "blokiranje",
"blockType": "Vrsta blokiranja",
@@ -66,9 +67,11 @@
"editLink": "Uredi poveznicu",
"editRelationship": "Uredi odnos",
"itemsAndMore": "{{items}} i {{count}} više",
"labelRelationship": "{{label}} veza",
"latitude": "Zemljopisna širina",
"longitude": "Zemljopisna dužina",
"passwordsDoNotMatch": "Lozinke nisu iste.",
"removeRelationship": "Ukloni vezu",
"removeUpload": "Ukloni prijenos",
"saveChanges": "Spremi promjene",
"searchForBlock": "Potraži blok",

View File

@@ -57,6 +57,7 @@
"addLink": "Link hozzáadása",
"addNew": "Új hozzáadása",
"addNewLabel": "Új {{label}} hozzáadása",
"addRelationship": "Kapcsolat hozzáadása",
"addUpload": "Feltöltés hozzáadása",
"block": "blokk",
"blockType": "Blokk típusa",
@@ -66,9 +67,11 @@
"editLink": "Link szerkesztése",
"editRelationship": "Kapcsolat hozzáadása",
"itemsAndMore": "{{items}} és további {{count}}",
"labelRelationship": "{{label}} Kapcsolat",
"latitude": "Szélesség",
"longitude": "Hosszúság",
"passwordsDoNotMatch": "A jelszavak nem egyeznek.",
"removeRelationship": "Kapcsolat eltávolítása",
"removeUpload": "Feltöltés eltávolítása",
"saveChanges": "Módosítások mentése",
"searchForBlock": "Blokk keresése",

View File

@@ -57,6 +57,7 @@
"addLink": "Aggiungi Collegamento",
"addNew": "Aggiungi nuovo",
"addNewLabel": "Aggiungi nuovo {{label}}",
"addRelationship": "Aggiungi Relazione",
"addUpload": "aggiungi Carica",
"block": "blocco",
"blockType": "Tipo di Blocco",
@@ -66,9 +67,11 @@
"editLink": "Modifica Collegamento",
"editRelationship": "Modifica Relazione",
"itemsAndMore": "{{items}} e altri {{count}}",
"labelRelationship": "Relazione {{label}}",
"latitude": "Latitudine",
"longitude": "Longitudine",
"passwordsDoNotMatch": "Le password non corrispondono.",
"removeRelationship": "Rimuovi Relazione",
"removeUpload": "Rimuovi Upload",
"saveChanges": "Salva modifiche",
"searchForBlock": "Cerca un blocco",

View File

@@ -59,6 +59,7 @@
"addLink": "リンクを追加",
"addNew": "新規追加",
"addNewLabel": "{{label}} を新規追加",
"addRelationship": "リレーションシップを追加",
"addUpload": "アップロードを追加",
"block": "ブロック",
"blockType": "ブロックタイプ",
@@ -68,9 +69,11 @@
"editLink": "リンクを編集",
"editRelationship": "リレーションシップを編集",
"itemsAndMore": "{{items}} 他{{count}}件",
"labelRelationship": "{{label}} リレーションシップ",
"latitude": "緯度",
"longitude": "経度",
"passwordsDoNotMatch": "パスワードが一致しません",
"removeRelationship": "関係を削除",
"removeUpload": "削除",
"saveChanges": "変更を保存",
"searchForBlock": "ブロックを検索",

View File

@@ -56,6 +56,7 @@
"addLink": "링크 추가",
"addNew": "새로 추가",
"addNewLabel": "새로운 {{label}} 추가",
"addRelationship": "관계 추가",
"addUpload": "업로드 추가",
"block": "블록",
"blockType": "블록 유형",
@@ -65,9 +66,11 @@
"editLink": "링크 수정",
"editRelationship": "관계 수정",
"itemsAndMore": "{{items}} 및 {{count}}개 더",
"labelRelationship": "{{label}} 관계",
"latitude": "위도",
"longitude": "경도",
"passwordsDoNotMatch": "비밀번호가 일치하지 않습니다.",
"removeRelationship": "관계 제거",
"removeUpload": "제거",
"saveChanges": "변경 사항 저장",
"searchForBlock": "블록 검색",

View File

@@ -57,6 +57,7 @@
"addLink": "လင့်ခ်ထည့်ပါ။",
"addNew": "အသစ် ထည့်သွင်းမည်။",
"addNewLabel": "{{label}} အားအသစ် ထည့်သွင်းမည်။",
"addRelationship": "Relationship အသစ်ထည့်သွင်းမည်။",
"addUpload": "Upload ထည့်ပါ။",
"block": "ဘလောက်",
"blockType": "ဘလောက် အမျိုးအစား",
@@ -66,9 +67,11 @@
"editLink": "လင့်ခ်ကို တည်းဖြတ်ပါ။",
"editRelationship": "ဆက်ဆံရေးကို တည်းဖြတ်ပါ။",
"itemsAndMore": "{{items}} နှင့် နောက်ထပ် {{count}} ခု",
"labelRelationship": "{{label}} Relationship",
"latitude": "vĩ độ",
"longitude": "လောင်ဂျီကျု",
"passwordsDoNotMatch": "စကားဝှက်များနှင့် မကိုက်ညီပါ။",
"removeRelationship": "ဆက်ဆံရေးကို ဖယ်ရှားပါ။",
"removeUpload": "အပ်လုဒ်ကို ဖယ်ရှားပါ။",
"saveChanges": "သိမ်းဆည်းမည်။",
"searchForBlock": "ဘလောက်တစ်ခုရှာမည်။",

View File

@@ -57,6 +57,7 @@
"addLink": "Legg til Lenke",
"addNew": "Legg til ny",
"addNewLabel": "Legg til ny {{label}}",
"addRelationship": "Legg til Relasjon",
"addUpload": "Legg til Opplasting",
"block": "blokk",
"blockType": "Blokktype",
@@ -66,9 +67,11 @@
"editLink": "Rediger lenke",
"editRelationship": "Rediger relasjon",
"itemsAndMore": "{{items}} og {{count}} flere",
"labelRelationship": "{{label}}-relasjon",
"latitude": "Breddegrad",
"longitude": "Lengdegrad",
"passwordsDoNotMatch": "Passordene er ikke like.",
"removeRelationship": "Fjern Forhold",
"removeUpload": "Fjern Opplasting",
"saveChanges": "Lagre endringer",
"searchForBlock": "Søk etter en blokk",

View File

@@ -57,6 +57,7 @@
"addLink": "Voeg een link toe",
"addNew": "Nieuw(e)",
"addNewLabel": "Nieuw(e) {{label}} toevoegen",
"addRelationship": "Nieuwe Relatie",
"addUpload": "Upload Toevoegen",
"block": "blok",
"blockType": "Bloktype",
@@ -66,9 +67,11 @@
"editLink": "Link bewerken",
"editRelationship": "Relatie Relatie",
"itemsAndMore": "{{items}} en {{count}} meer",
"labelRelationship": "{{label}} relatie",
"latitude": "Breedtegraad",
"longitude": "Lengtegraad",
"passwordsDoNotMatch": "Wachtwoorden komen niet overeen.",
"removeRelationship": "Relatie Verwijderen",
"removeUpload": "Verwijder Upload",
"saveChanges": "Bewaar aanpassingen",
"searchForBlock": "Zoeken naar een blok",

View File

@@ -57,6 +57,7 @@
"addLink": "Dodaj Link",
"addNew": "Dodaj nowy",
"addNewLabel": "Dodaj nowy {{label}}",
"addRelationship": "Dodaj Relację",
"addUpload": "Dodaj ładowanie",
"block": "Blok",
"blockType": "Typ Bloku",
@@ -66,9 +67,11 @@
"editLink": "Edytuj Link",
"editRelationship": "Edytuj Relację",
"itemsAndMore": "{{items}} i {{count}} więcej",
"labelRelationship": "Relacja {{label}}",
"latitude": "Szerokość",
"longitude": "Długość geograficzna",
"passwordsDoNotMatch": "Hasła nie pasują",
"removeRelationship": "Usuń Relację",
"removeUpload": "Usuń Wrzucone",
"saveChanges": "Zapisz zmiany",
"searchForBlock": "Szukaj bloku",

View File

@@ -57,6 +57,7 @@
"addLink": "Adicionar Link",
"addNew": "Adicionar novo",
"addNewLabel": "Adicionar novo {{label}}",
"addRelationship": "Adicionar Relação",
"addUpload": "Adicionar Upload",
"block": "bloco",
"blockType": "Tipo de bloco",
@@ -66,9 +67,11 @@
"editLink": "Editar Link",
"editRelationship": "Editar Relacionamento",
"itemsAndMore": "{{items}} e mais {{count}}",
"labelRelationship": "Relacionado a {{label}}",
"latitude": "Latitude",
"longitude": "Longitude",
"passwordsDoNotMatch": "Senhas não coincidem.",
"removeRelationship": "Remover Relacionamento",
"removeUpload": "Remover Upload",
"saveChanges": "Salvar alterações",
"searchForBlock": "Procurar bloco",

View File

@@ -57,6 +57,7 @@
"addLink": "Adăugați un link",
"addNew": "Adăugați un nou",
"addNewLabel": "Adăugați un nou {{label}}",
"addRelationship": "Adăugați o relație",
"addUpload": "Adăugați un fișier",
"block": "bloc",
"blockType": "Tip de bloc",
@@ -66,9 +67,11 @@
"editLink": "Editați Link-ul",
"editRelationship": "Editați relația",
"itemsAndMore": "{{items}} şi {{count}} mai multe",
"labelRelationship": "Relația cu {{label}}",
"latitude": "Latitudine",
"longitude": "Longitudine",
"passwordsDoNotMatch": "Parolele nu corespund.",
"removeRelationship": "Eliminați relația",
"removeUpload": "Eliminați încărcarea",
"saveChanges": "Salvați modificările",
"searchForBlock": "Căutați un bloc",

View File

@@ -57,6 +57,7 @@
"addLink": "Dodaj link",
"addNew": "Dodaj novi",
"addNewLabel": "Dodaj novi {{label}}",
"addRelationship": "Dodaj relaciju",
"addUpload": "Dodaj učitavanje",
"block": "blokiranje",
"blockType": "Vrsta blokiranja",
@@ -66,9 +67,11 @@
"editLink": "Izmeni link",
"editRelationship": "Izmeni odnos",
"itemsAndMore": "{{items}} i {{count}} više",
"labelRelationship": "{{label}} veza",
"latitude": "Geografska širina",
"longitude": "Geografska dužina",
"passwordsDoNotMatch": "Lozinke nisu iste.",
"removeRelationship": "Ukloni vezu",
"removeUpload": "Ukloni prenos",
"saveChanges": "Sačuvaj promene",
"searchForBlock": "Pretraži blok",

View File

@@ -57,6 +57,7 @@
"addLink": "Додај линк",
"addNew": "Додај нови",
"addNewLabel": "Додај нови {{label}}",
"addRelationship": "Додај релацију",
"addUpload": "Додај учитавање",
"block": "блокирање",
"blockType": "Врста блокирања",
@@ -66,9 +67,11 @@
"editLink": "Измени линк",
"editRelationship": "Измени однос",
"itemsAndMore": "{{items}} и {{count}} више",
"labelRelationship": "{{label}} веза",
"latitude": "Географска ширина",
"longitude": "Географска дужина",
"passwordsDoNotMatch": "Лозинке нису исте.",
"removeRelationship": "Уклони везу",
"removeUpload": "Уклони пренос",
"saveChanges": "Сачувај промене",
"searchForBlock": "Претражи блок",

View File

@@ -57,6 +57,7 @@
"addLink": "Добавить ссылку",
"addNew": "Добавить новый",
"addNewLabel": "Добавить {{label}}",
"addRelationship": "Добавить Отношения",
"addUpload": "Добавить загрузку",
"block": "Блок",
"blockType": "Тип Блока",
@@ -66,9 +67,11 @@
"editLink": "Редактировать ссылку",
"editRelationship": "Редактировать Отношения",
"itemsAndMore": "{{items}} и ещё {{count}}",
"labelRelationship": "{{label}} Отношения",
"latitude": "Широта",
"longitude": "Долгота",
"passwordsDoNotMatch": "Пароли не совпадают.",
"removeRelationship": "Удалить связь",
"removeUpload": "Удалить загруженное",
"saveChanges": "Сохранить изменения",
"searchForBlock": "Найти Блок",

View File

@@ -57,6 +57,7 @@
"addLink": "Lägg till Länk",
"addNew": "Lägg till ny",
"addNewLabel": "Lägg till ny {{label}}",
"addRelationship": "Lägg till Relation",
"addUpload": "Lägg till Uppladdning",
"block": "block",
"blockType": "Block Typ",
@@ -66,9 +67,11 @@
"editLink": "Redigera Länk",
"editRelationship": "Redigera Relation",
"itemsAndMore": "{{items}} och {{count}} mer",
"labelRelationship": "{{label}} Relation",
"latitude": "Latitud",
"longitude": "Longitud",
"passwordsDoNotMatch": "Lösenorden matchar inte.",
"removeRelationship": "Ta Bort Relation",
"removeUpload": "Ta Bort Uppladdning",
"saveChanges": "Spara ändringar",
"searchForBlock": "Sök efter ett block",

View File

@@ -57,6 +57,7 @@
"addLink": "เพิ่มลิงค์",
"addNew": "เพิ่ม",
"addNewLabel": "เพิ่ม {{label}} ใหม่",
"addRelationship": "เพิ่มความสัมพันธ์",
"addUpload": "เพิ่มการอัปโหลด",
"block": "Block",
"blockType": "ประเภท Block",
@@ -66,9 +67,11 @@
"editLink": "แก้ไขลิงก์",
"editRelationship": "แก้ไขความสัมพันธ์",
"itemsAndMore": "{{items}} และเพิ่มเติมอีก {{count}}",
"labelRelationship": "ความสัมพันธ์กับ {{label}}",
"latitude": "ละติจูด",
"longitude": "ลองติจูด",
"passwordsDoNotMatch": "รหัสผ่านไม่ตรงกัน",
"removeRelationship": "ลบความสัมพันธ์",
"removeUpload": "ลบอัปโหลด",
"saveChanges": "บันทึก",
"searchForBlock": "ค้นหา Block",

View File

@@ -57,6 +57,7 @@
"addLink": "Link Ekle",
"addNew": "Yeni",
"addNewLabel": "Yeni {{label}}",
"addRelationship": "İlişki Ekle",
"addUpload": "Yükleme Ekle",
"block": "blok",
"blockType": "Blok tipi",
@@ -66,9 +67,11 @@
"editLink": "Bağlantıyı Düzenle",
"editRelationship": "İlişkiyi Ekle",
"itemsAndMore": "{{items}} and {{count}} more",
"labelRelationship": "{{label}} Relationship",
"latitude": "Enlem",
"longitude": "Boylam",
"passwordsDoNotMatch": "Parolalar eşleşmiyor.",
"removeRelationship": "İlişkiyi Kaldır",
"removeUpload": "Dosyayı Sil",
"saveChanges": "Değişiklikleri kaydet",
"searchForBlock": "Blok ara",

View File

@@ -295,6 +295,15 @@
},
"saveChanges": {
"type": "string"
},
"addRelationship": {
"type": "string"
},
"removeRelationship": {
"type": "string"
},
"labelRelationship": {
"type": "string"
}
},
"required": [
@@ -321,7 +330,10 @@
"addUpload",
"editRelationship",
"removeUpload",
"saveChanges"
"saveChanges",
"addRelationship",
"removeRelationship",
"labelRelationship"
],
"type": "object"
},

View File

@@ -57,6 +57,7 @@
"addLink": "Додати посилання",
"addNew": "Додати новий",
"addNewLabel": "Створити {{label}}",
"addRelationship": "Додати взаємозв'язок",
"addUpload": "Додати завантаження",
"block": "блок",
"blockType": "Тип блока",
@@ -66,9 +67,11 @@
"editLink": "Редагувати посилання",
"editRelationship": "Редагувати взаємозв'язок",
"itemsAndMore": "{{items}} і ще {{count}}",
"labelRelationship": "{{label}} Зв'язок",
"latitude": "Широта",
"longitude": "Довгота",
"passwordsDoNotMatch": "Паролі не співпадають.",
"removeRelationship": "Видалити зв'язок",
"removeUpload": "Видалити завантаження",
"saveChanges": "Зберегти зміни",
"searchForBlock": "Знайти блок",

View File

@@ -57,6 +57,7 @@
"addLink": "Thêm liên kết",
"addNew": "Thêm mới",
"addNewLabel": "Thêm mới: {{label}}",
"addRelationship": "Thêm mối quan hệ (relationship)",
"addUpload": "Thêm tải lên (upload)",
"block": "block",
"blockType": "Block Type",
@@ -66,9 +67,11 @@
"editLink": "Chỉnh sửa liên kết",
"editRelationship": "Chỉnh sửa mối quan hệ",
"itemsAndMore": "{{items}} và {{count}} món nữa",
"labelRelationship": "Mối quan hệ của {{label}} (Relationship)",
"latitude": "Vĩ độ",
"longitude": "Kinh độ",
"passwordsDoNotMatch": "Mật khẩu không trùng.",
"removeRelationship": "Xóa Mối quan hệ",
"removeUpload": "Xóa bản tải lên",
"saveChanges": "Luu thay đổi",
"searchForBlock": "Tìm block",

View File

@@ -59,6 +59,7 @@
"addLink": "新增連結",
"addNew": "新增",
"addNewLabel": "新增{{label}}",
"addRelationship": "新增關聯",
"addUpload": "上傳",
"block": "區塊",
"blockType": "區塊類型",
@@ -68,9 +69,11 @@
"editLink": "編輯連結",
"editRelationship": "編輯關聯",
"itemsAndMore": "{{items}} 個,還有 {{count}} 個",
"labelRelationship": "{{label}}關聯",
"latitude": "緯度",
"longitude": "經度",
"passwordsDoNotMatch": "密碼不匹配。",
"removeRelationship": "移除關聯",
"removeUpload": "移除上傳",
"saveChanges": "儲存變更",
"searchForBlock": "搜尋一個區塊",

View File

@@ -57,6 +57,7 @@
"addLink": "添加链接",
"addNew": "添加新的",
"addNewLabel": "添加新的{{label}}",
"addRelationship": "添加关系",
"addUpload": "添加上传",
"block": "区块",
"blockType": "区块类型",
@@ -66,9 +67,11 @@
"editLink": "编辑链接",
"editRelationship": "编辑关系",
"itemsAndMore": "{{items}}和{{count}}更多",
"labelRelationship": "{{label}}关系",
"latitude": "纬度",
"longitude": "经度",
"passwordsDoNotMatch": "密码不匹配。",
"removeRelationship": "移除关系",
"removeUpload": "移除上传",
"saveChanges": "保存更改",
"searchForBlock": "搜索一个区块",

View File

@@ -156,6 +156,9 @@ const clientTranslationKeys = [
'fields:editRelationship',
'fields:removeUpload',
'fields:saveChanges',
'fields:addRelationship',
'fields:removeRelationship',
'fields:labelRelationship',
'general:aboutToDeleteCount',
'general:aboutToDelete',

View File

@@ -29,3 +29,4 @@ export { default as FieldDescription } from '../forms/FieldDescription'
export { default as useField } from '../forms/useField'
export { default as Error } from '../forms/Error'
export type { BuildFormStateArgs } from '../forms/utilities/buildStateFromSchema'
export { FieldPathProvider } from '../forms/FieldPathProvider'

View File

@@ -6,3 +6,4 @@ import React from 'react'
// @example
// import { Link } from 'next/link'
export type LinkType = React.ElementType
export type { FormFieldBase } from '../forms/fields/shared'