chore: adds translations, cleans up slate

This commit is contained in:
James
2024-02-22 11:51:07 -05:00
parent ef43a76b0b
commit 1ef3b9ed13
42 changed files with 747 additions and 158 deletions

View File

@@ -15,11 +15,13 @@ import React, { Fragment, useState } from 'react'
import { Editor, Range, Transforms } from 'slate'
import { ReactEditor, useSlate } from 'slate-react'
import { useFieldPath } from '../../../../../../ui/src/forms/FieldPathProvider'
import LinkIcon from '../../../icons/Link'
import { useElementButton } from '../../../providers/ElementButtonProvider'
import ElementButton from '../../Button'
import isElementActive from '../../isActive'
import { LinkDrawer } from '../LinkDrawer'
import { linkFieldsSchemaPath } from '../shared'
import { unwrapLink } from '../utilities'
/**
@@ -71,11 +73,10 @@ export const LinkButton: React.FC = () => {
const { closeModal, openModal } = useModal()
const drawerSlug = useDrawerSlug('rich-text-link')
const { id, getDocPreferences } = useDocumentInfo()
const { schemaPath } = useFieldPath()
const { richTextComponentMap } = fieldProps
const linkFieldsSchemaPath = `link.fields`
const fieldMap = richTextComponentMap.get(linkFieldsSchemaPath)
return (
@@ -101,7 +102,7 @@ export const LinkButton: React.FC = () => {
data,
docPreferences,
operation: 'update',
schemaPath: linkFieldsSchemaPath,
schemaPath: `${schemaPath}.${linkFieldsSchemaPath}`,
},
serverURL: config.serverURL,
})