UNPKG

fastcomments-react-native-sdk

Version:

React Native FastComments Components. Add live commenting to any React Native application.

66 lines (65 loc) 1.64 kB
import { getNextNodeId } from "./node-id"; import { EditorNodeType } from "./node-types"; export function createTextNode(startingValue) { return { id: getNextNodeId(), content: startingValue, type: EditorNodeType.TEXT, isFocused: false }; } export function createBoldNode(startingValue) { return { id: getNextNodeId(), content: startingValue, type: EditorNodeType.TEXT_BOLD, isFocused: false }; } export function createEmoticonNode(startingValue) { return { id: getNextNodeId(), content: startingValue, type: EditorNodeType.EMOTICON, isFocused: false }; } export function createImageNode(startingValue) { return { id: getNextNodeId(), content: startingValue, type: EditorNodeType.IMAGE, isFocused: false }; } export function createItalicNode(startingValue) { return { id: getNextNodeId(), content: startingValue, type: EditorNodeType.TEXT_ITALIC, isFocused: false }; } export function createNewlineNode(children) { return { id: getNextNodeId(), type: EditorNodeType.NEWLINE, children }; } export function createStrikethroughNode(startingValue) { return { id: getNextNodeId(), content: startingValue, type: EditorNodeType.TEXT_STRIKETHROUGH, isFocused: false }; } export function createUnderlineNode(startingValue) { return { id: getNextNodeId(), content: startingValue, type: EditorNodeType.TEXT_UNDERLINE, isFocused: false }; }