chore: remaining slate ssr

This commit is contained in:
James
2024-02-22 14:48:09 -05:00
parent ca7b8e589e
commit 05b2692eb5
8 changed files with 18 additions and 10 deletions

BIN
media/image-10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

BIN
media/image-11.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

BIN
media/image-12.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

View File

@@ -1,12 +1,12 @@
'use client'
import React, { useCallback } from 'react'
import React from 'react'
import { useCallback } from 'react'
import { Editor, Element, Text, Transforms } from 'slate'
import { ReactEditor, useSlate } from 'slate-react'
import type { ElementNode } from '../../../types'
import { indentType } from '.'
import IndentLeft from '../../icons/IndentLeft'
import IndentRight from '../../icons/IndentRight'
import { baseClass } from '../Button'
@@ -15,6 +15,7 @@ import isElementActive from '../isActive'
import { isBlockElement } from '../isBlockElement'
import listTypes from '../listTypes'
import { unwrapList } from '../unwrapList'
import { indentType } from './shared'
export const IndentButton: React.FC = () => {
const editor = useSlate()

View File

@@ -1,9 +1,10 @@
import type { RichTextCustomElement } from '../../..'
import { IndentButton } from './Button'
import { IndentElement } from './Element'
import { indentType } from './shared'
export const indentType = 'indent'
const indent = {
const indent: RichTextCustomElement = {
name: indentType,
Button: IndentButton,
Element: IndentElement,

View File

@@ -0,0 +1 @@
export const indentType = 'indent'

View File

@@ -7,12 +7,12 @@ import h3 from './h3'
import h4 from './h4'
import h5 from './h5'
import h6 from './h6'
// import indent from './indent'
import indent from './indent'
import li from './li'
import link from './link'
import ol from './ol'
import relationship from './relationship'
// import textAlign from './textAlign'
import textAlign from './textAlign'
import ul from './ul'
import upload from './upload'
@@ -24,12 +24,12 @@ const elements: Record<string, RichTextCustomElement> = {
h4,
h5,
h6,
// indent,
indent,
li,
link,
ol,
relationship,
// textAlign,
textAlign,
ul,
upload,
}

View File

@@ -1,11 +1,13 @@
import React from 'react'
import type { RichTextCustomElement } from '../../..'
import AlignCenterIcon from '../../icons/AlignCenter'
import AlignLeftIcon from '../../icons/AlignLeft'
import AlignRightIcon from '../../icons/AlignRight'
import ElementButton from '../Button'
export default {
const alignment: RichTextCustomElement = {
name: 'alignment',
Button: () => {
return (
@@ -22,4 +24,7 @@ export default {
</React.Fragment>
)
},
Element: () => null,
}
export default alignment