Merged in fix/3697-prettier-configs (pull request #3396)
fix(SW-3691): Setup one prettier config for whole repo * Setup prettierrc in root and remove other configs Approved-by: Joakim Jäderberg Approved-by: Linus Flood
This commit is contained in:
@@ -1,26 +1,26 @@
|
||||
import React, { cloneElement } from 'react'
|
||||
import React, { cloneElement } from "react"
|
||||
|
||||
import { renderOptions } from './renderOptions'
|
||||
import { renderOptions } from "./renderOptions"
|
||||
|
||||
import styles from './jsontohtml.module.css'
|
||||
import styles from "./jsontohtml.module.css"
|
||||
|
||||
import type { Embeds, Node } from './JsonToHtml'
|
||||
import type { Embeds, Node } from "./JsonToHtml"
|
||||
|
||||
import { EmbedByUid } from './JsonToHtml'
|
||||
import { AVAILABLE_LIST_FORMATS } from './types/rte/constants'
|
||||
import { AvailableParagraphFormatEnum, RTETypeEnum } from './types/rte/enums'
|
||||
import { EmbedByUid } from "./JsonToHtml"
|
||||
import { AVAILABLE_LIST_FORMATS } from "./types/rte/constants"
|
||||
import { AvailableParagraphFormatEnum, RTETypeEnum } from "./types/rte/enums"
|
||||
import {
|
||||
RTEMarkType,
|
||||
type RTENode,
|
||||
type RTERenderMark,
|
||||
type RTERenderOptionComponent,
|
||||
type RTETextNode,
|
||||
} from './types/rte/node'
|
||||
import type { RenderOptions } from './types/rte/option'
|
||||
} from "./types/rte/node"
|
||||
import type { RenderOptions } from "./types/rte/option"
|
||||
|
||||
export function groupEmbedsByUid(embedsArray: Node<Embeds>[]) {
|
||||
const embedsByUid = embedsArray.reduce<EmbedByUid>((acc, embed) => {
|
||||
if ('system' in embed.node && embed.node.system?.uid) {
|
||||
if ("system" in embed.node && embed.node.system?.uid) {
|
||||
acc[embed.node.system.uid] = embed
|
||||
}
|
||||
return acc
|
||||
@@ -110,7 +110,7 @@ export function extractAvailableListClassNames(className?: string) {
|
||||
if (!className) {
|
||||
return []
|
||||
}
|
||||
const classNames = className.split(' ')
|
||||
const classNames = className.split(" ")
|
||||
return classNames
|
||||
.filter((name) => AVAILABLE_LIST_FORMATS.includes(name))
|
||||
.map((item) => styles[item] || item)
|
||||
@@ -121,7 +121,7 @@ export function nodeToHtml(
|
||||
embeds: EmbedByUid,
|
||||
fullRenderOptions: RenderOptions
|
||||
) {
|
||||
if ('type' in node === false) {
|
||||
if ("type" in node === false) {
|
||||
return textNodeToHtml(node, fullRenderOptions)
|
||||
} else {
|
||||
const renderer = fullRenderOptions[node.type] as RTERenderOptionComponent
|
||||
@@ -138,7 +138,7 @@ export function nodeToHtml(
|
||||
}
|
||||
|
||||
function getUniqueId(node: RTENode) {
|
||||
if ('uid' in node) {
|
||||
if ("uid" in node) {
|
||||
return node.uid
|
||||
}
|
||||
return node.id
|
||||
|
||||
Reference in New Issue
Block a user