UNPKG

phx-react

Version:

PHX REACT

35 lines 3.67 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getPrepopulatedRichText = getPrepopulatedRichText; const link_1 = require("@lexical/link"); const list_1 = require("@lexical/list"); const rich_text_1 = require("@lexical/rich-text"); const lexical_1 = require("lexical"); function getPrepopulatedRichText() { const root = (0, lexical_1.$getRoot)(); if (root.getFirstChild() === null) { const heading = (0, rich_text_1.$createHeadingNode)('h1'); heading.append((0, lexical_1.$createTextNode)('Welcome to the playground')); root.append(heading); const quote = (0, rich_text_1.$createQuoteNode)(); quote.append((0, lexical_1.$createTextNode)(`In case you were wondering what the black box at the bottom is – it's the debug view, showing the current state of the editor. ` + `You can disable it by pressing on the settings control in the bottom-left of your screen and toggling the debug view setting.`)); root.append(quote); const paragraph = (0, lexical_1.$createParagraphNode)(); paragraph.append((0, lexical_1.$createTextNode)('The playground is a demo environment built with '), (0, lexical_1.$createTextNode)('@lexical/react').toggleFormat('code'), (0, lexical_1.$createTextNode)('.'), (0, lexical_1.$createTextNode)(' Try typing in '), (0, lexical_1.$createTextNode)('some text').toggleFormat('bold'), (0, lexical_1.$createTextNode)(' with '), (0, lexical_1.$createTextNode)('different').toggleFormat('italic'), (0, lexical_1.$createTextNode)(' formats.')); root.append(paragraph); const paragraph2 = (0, lexical_1.$createParagraphNode)(); paragraph2.append((0, lexical_1.$createTextNode)('Make sure to check out the various plugins in the toolbar. You can also use #hashtags or @-mentions too!')); root.append(paragraph2); const paragraph3 = (0, lexical_1.$createParagraphNode)(); paragraph3.append((0, lexical_1.$createTextNode)(`If you'd like to find out more about Lexical, you can:`)); root.append(paragraph3); const list = (0, list_1.$createListNode)('bullet'); list.append((0, list_1.$createListItemNode)().append((0, lexical_1.$createTextNode)(`Visit the `), (0, link_1.$createLinkNode)('https://lexical.dev/').append((0, lexical_1.$createTextNode)('Lexical website')), (0, lexical_1.$createTextNode)(` for documentation and more information.`)), (0, list_1.$createListItemNode)().append((0, lexical_1.$createTextNode)(`Check out the code on our `), (0, link_1.$createLinkNode)('https://github.com/facebook/lexical').append((0, lexical_1.$createTextNode)('GitHub repository')), (0, lexical_1.$createTextNode)(`.`)), (0, list_1.$createListItemNode)().append((0, lexical_1.$createTextNode)(`Playground code can be found `), (0, link_1.$createLinkNode)('https://github.com/facebook/lexical/tree/main/packages/lexical-playground').append((0, lexical_1.$createTextNode)('here')), (0, lexical_1.$createTextNode)(`.`)), (0, list_1.$createListItemNode)().append((0, lexical_1.$createTextNode)(`Join our `), (0, link_1.$createLinkNode)('https://discord.com/invite/KmG4wQnnD9').append((0, lexical_1.$createTextNode)('Discord Server')), (0, lexical_1.$createTextNode)(` and chat with the team.`))); root.append(list); const paragraph4 = (0, lexical_1.$createParagraphNode)(); paragraph4.append((0, lexical_1.$createTextNode)(`Lastly, we're constantly adding cool new features to this playground. So make sure you check back here when you next get a chance :).`)); root.append(paragraph4); } } //# sourceMappingURL=getPrepopulatedRichText.js.map