[{"name":"MiniRte","comment":"\n\nDon't forget to hook [subscriptions](#subscriptions) and [update](#update) into your app's own `subscriptions` and `update` function. Without that, the editor won't do anything.\n\n# Init and update\n\n@docs init, Rte, Parameters, subscriptions, update, textToContent\n\n\n# View\n\n@docs textarea, display, DisplayParams\n\n\n# Toolbar\n\n@docs emojiBox, EmojiBoxParams, fontSelector, FontSelectorParams\n@docs fontSizeSelector, FontSizeSelectorParams, inputBox, InputBoxParams\n@docs onOffSwitch, SwitchParams\n\n\n# Serialize/deserialize content\n\n@docs encodeContentString, encodeContentGZip, decodeContentString, decodeContentGZip\n\n\n# Info\n\n@docs isActive, textContent\n\n","unions":[],"aliases":[{"name":"DisplayParams","comment":" `content` can be plain text (in which case it is turned into [Content](MiniRte-Types#Content) by [textToContent](#textToContent)), or it can be a json string created with [encodeContentString](#encodeContentString).\n\n`fontSizeUnit` defaults to `\"px\"`.\n\nUse `highlighter` to to re-style the text the way you want it (e.g. code highlighting). See the [Content](MiniRte-Types#Content) type and the [example](https://github.com/dkodaj/rte/blob/master/example/src/Highlighter.elm).\n\n`id` must be unique.    \n\n`indentUnit` defaults to `(50,\"px\")`.\n\nThe content of `styling` is attached to the div that contains the text.\n\n","args":["msg"],"type":"{ content : String.String, fontSizeUnit : Maybe.Maybe String.String, highlighter : Maybe.Maybe (MiniRte.Types.Content -> MiniRte.Types.Content), id : String.String, indentUnit : Maybe.Maybe ( Basics.Float, String.String ), styling : List.List (Html.Attribute msg) }"},{"name":"EmojiBoxParams","comment":" ","args":["msg"],"type":"{ styling : { active : List.List (Html.Attribute msg), inactive : List.List (Html.Attribute msg) }, emojis : List.List String.String }"},{"name":"FontSelectorParams","comment":" ","args":["msg"],"type":"{ styling : List.List (Html.Attribute msg), fonts : List.List (List.List String.String) }"},{"name":"FontSizeSelectorParams","comment":" ","args":["msg"],"type":"{ styling : List.List (Html.Attribute msg), sizes : List.List Basics.Float }"},{"name":"InputBoxParams","comment":" ","args":["msg"],"type":"{ styling : { active : List.List (Html.Attribute msg), inactive : List.List (Html.Attribute msg) } }"},{"name":"Parameters","comment":" `id` must be unique.\n\n`content` is the initial content of the textarea. Use `[]` to initialize with empty content. To initialize with saved content, use [decodeContentString](#decodeContentString) or [decodeContentGZip](#decodeContentGZip) ([example](https://github.com/dkodaj/rte/blob/0b3d980d61ccf20ce09f9e82fd7039c5ae477582/example/src/Main.elm#L43)). To convert plain text into [Content](MiniRte-Types#Content), use [textToContent](#textToContent).\n\n`fontSizeUnit` defaults to `\"px\"`.\n\n`highlighter` runs before each view update, re-stylings the text as you see fit. See the [Content](MiniRte-Types#Content) type and the [example](https://github.com/dkodaj/rte/blob/master/example/src/Highlighter.elm).\n\n`indentUnit` defaults to `(50,\"px\")`.\n\nIf `pasteImageLinksAsImages` is `True`, then pasting an image link or an image (data url) into the RTE will insert the image into the text.\n\nif `pasteLinksAsLinks` is `True`, then pasting a link ([something that starts with](https://github.com/dkodaj/rte/blob/65308588421a7000e27bb7165538999e59b8fceb/src/MiniRte/Core.elm#L1596) `\"http://\"` or `\"https://\"`) will create a clickable link.\n\n`selectionStyle` controls the appearance of selected text. It defaults to `[(\"background\", \"hsl(217,71%,53%)\"), (\"color\", \"white\")]`.\n\n`styling.active` styles the textarea div in active mode (when editing). Use `update (Active True/False)` to switch between modes.\n\n`tagger` turns the package's own [Msg](MiniRte-Types#Msg) type into your app's msg.\n\n","args":["msg"],"type":"{ id : String.String, content : MiniRte.Types.Content, fontSizeUnit : Maybe.Maybe String.String, highlighter : Maybe.Maybe (MiniRte.Types.Content -> MiniRte.Types.Content), indentUnit : Maybe.Maybe ( Basics.Float, String.String ), pasteImageLinksAsImages : Basics.Bool, pasteLinksAsLinks : Basics.Bool, selectionStyle : List.List ( String.String, String.String ), styling : { active : List.List (Html.Attribute msg), inactive : List.List (Html.Attribute msg) }, tagger : MiniRte.Msg -> msg }"},{"name":"Rte","comment":" You normally shouldn't mess with these variables; use [update](#update) and [Msg](MiniRte-Types#Msg) to modify the editor.\n\nIf `emojiBox` is `True`, then the [emojiBox](#emojiBox) is visible.\n\nIf `inputBox` is `Nothing`, then the [inputBox](#inputBox) is not visible.\n\n`styling.active` styles the textarea div in active mode (when editing), `styling.passive` in [display](#display) or inactive mode. Use [init](#init) to set it.\n\n`tagger` connects RTE [Msg](MiniRte-Types#Msg)'s with your app's own Msg type. Use [init](#init) to set it.\n\n`textarea` is a [complicated object](https://github.com/dkodaj/rte/blob/0b3d980d61ccf20ce09f9e82fd7039c5ae477582/src/MiniRte/Core.elm#L76) that you shouldn't mess with.\n","args":["msg"],"type":"{ emojiBox : Basics.Bool, inputBox : Maybe.Maybe MiniRte.Types.InputBox, styling : { active : List.List (Html.Attribute msg), inactive : List.List (Html.Attribute msg) }, tagger : MiniRte.Msg -> msg, textarea : MiniRte.Core.Editor }"},{"name":"SwitchParams","comment":" ","args":[],"type":"{ activeColor : String.String, inactiveColor : String.String, width : Basics.Float }"}],"values":[{"name":"decodeContentGZip","comment":" Convert gzipped serialized content back into content ([example](https://github.com/dkodaj/rte/blob/0b3d980d61ccf20ce09f9e82fd7039c5ae477582/example/src/Main.elm#L96)).\n","type":"Bytes.Bytes -> Result.Result String.String MiniRte.Types.Content"},{"name":"decodeContentString","comment":" Convert serialized content string back into content.\n","type":"String.String -> Result.Result String.String MiniRte.Types.Content"},{"name":"display","comment":" Display formatted content, without an editor (e.g. as a blog post).\n","type":"(MiniRte.Msg -> msg) -> MiniRte.DisplayParams msg -> Html.Html msg"},{"name":"emojiBox","comment":" Make it appear/disappear with `update ToggleEmojiBox`.\nEach `x` in `params.emojis` turns into a clickable div that triggers `update AddText` events. [Example](https://github.com/dkodaj/rte/blob/0b3d980d61ccf20ce09f9e82fd7039c5ae477582/example/src/Main.elm#L231)\n","type":"MiniRte.Rte msg -> MiniRte.EmojiBoxParams msg -> Html.Html msg"},{"name":"encodeContentGZip","comment":" Serialize the edited text as a gzip file ([example](https://github.com/dkodaj/rte/blob/0b3d980d61ccf20ce09f9e82fd7039c5ae477582/example/src/Main.elm#L82)).\n","type":"MiniRte.Rte msg -> Bytes.Bytes"},{"name":"encodeContentString","comment":" Serialize the edited text as string.\n","type":"MiniRte.Rte msg -> String.String"},{"name":"fontSelector","comment":" A `Html.select` element that triggers `update Font` events. [Example](https://github.com/dkodaj/rte/blob/0b3d980d61ccf20ce09f9e82fd7039c5ae477582/example/src/Main.elm#L210)\n","type":"MiniRte.Rte msg -> MiniRte.FontSelectorParams msg -> Html.Html msg"},{"name":"fontSizeSelector","comment":" A `Html.select` element that triggers `update FontSize` events. [Example](https://github.com/dkodaj/rte/blob/0b3d980d61ccf20ce09f9e82fd7039c5ae477582/example/src/Main.elm#L219)\n","type":"MiniRte.Rte msg -> MiniRte.FontSizeSelectorParams msg -> Html.Html msg"},{"name":"init","comment":" ","type":"MiniRte.Parameters msg -> ( MiniRte.Rte msg, Platform.Cmd.Cmd msg )"},{"name":"inputBox","comment":" Input box for adding hyperlinks and image links.\nMake it appear/disappear with `update ToggleImageBox` or `update ToggleLinkBox`.\nIt contains an OK button that triggers `update ImageAdd` or `update LinkAdd`. [Example](https://github.com/dkodaj/rte/blob/0b3d980d61ccf20ce09f9e82fd7039c5ae477582/example/src/Main.elm#L248)\n","type":"MiniRte.Rte msg -> MiniRte.InputBoxParams msg -> Html.Html msg"},{"name":"isActive","comment":" Checks if the editor is active.\n","type":"MiniRte.Rte msg -> Basics.Bool"},{"name":"onOffSwitch","comment":" A switch that turns editing on/off. The `params.width` field controls its width in px. [Example](https://github.com/dkodaj/rte/blob/0b3d980d61ccf20ce09f9e82fd7039c5ae477582/example/src/Main.elm#L168)\n","type":"MiniRte.Rte msg -> MiniRte.SwitchParams -> Html.Html msg"},{"name":"subscriptions","comment":" Handles keydown/keyup and mouse events and it keeps the RTE in focus ([source](https://github.com/dkodaj/rte/blob/0b3d980d61ccf20ce09f9e82fd7039c5ae477582/src/MiniRte/Core.elm#L258)). The RTE won't do anything unless you build this into your app's own subscriptions ([example](https://github.com/dkodaj/rte/blob/0b3d980d61ccf20ce09f9e82fd7039c5ae477582/example/src/Main.elm#L71)).\n","type":"MiniRte.Rte msg -> Platform.Sub.Sub msg"},{"name":"textContent","comment":" The plain text content of the textarea.\n","type":"MiniRte.Rte msg -> String.String"},{"name":"textToContent","comment":" Convert a string into [Content](MiniRte-Types#Content).\n","type":"String.String -> MiniRte.Types.Content"},{"name":"textarea","comment":" Display the edited text plus the cursor. [Example](https://github.com/dkodaj/rte/blob/0b3d980d61ccf20ce09f9e82fd7039c5ae477582/example/src/Main.elm#L132)\n","type":"MiniRte.Rte msg -> Html.Html msg"},{"name":"update","comment":" Use this to handle the RTE's own [Msg](MiniRte-Types#Msg) updates ([example](https://github.com/dkodaj/rte/blob/0b3d980d61ccf20ce09f9e82fd7039c5ae477582/example/src/Main.elm#L79)). You can also use it to alter the RTE's state on your own (e.g. to apply a CSS class to the current paragraph via a button; [example](https://github.com/dkodaj/rte/blob/0b3d980d61ccf20ce09f9e82fd7039c5ae477582/example/src/Main.elm#L196)).\n","type":"MiniRte.Msg -> MiniRte.Rte msg -> ( MiniRte.Rte msg, Platform.Cmd.Cmd msg )"}],"binops":[]},{"name":"MiniRte.Styled","comment":" Same as `MiniRte` except it uses [Html.Styled](https://package.elm-lang.org/packages/rtfeldman/elm-css/latest/Html-Styled).\n\n\n# Init and update\n\n@docs init, Rte, Parameters, subscriptions, update, textToContent\n\n\n# View\n\n@docs textarea, display, DisplayParams\n\n\n# Toolbar\n\n@docs emojiBox, EmojiBoxParams, fontSelector, FontSelectorParams\n@docs fontSizeSelector, FontSizeSelectorParams, inputBox, InputBoxParams\n@docs onOffSwitch, SwitchParams\n\n\n# Serialize/deserialize content\n\n@docs encodeContentString, encodeContentGZip, decodeContentString, decodeContentGZip\n\n\n# Info\n\n@docs isActive, textContent\n\n","unions":[],"aliases":[{"name":"DisplayParams","comment":" `content` can be plain text or a json string created with [encodedContent](#encodedContent).\n\n`fontSizeUnit` defaults to `\"px\"`.\n\n`indentUnit` defaults to `(50,\"px\")`.\n\nThe attributes in `styling` will be attached to the div that contains the text.\n\n","args":["msg"],"type":"{ content : String.String, fontSizeUnit : Maybe.Maybe String.String, highlighter : Maybe.Maybe (MiniRte.Types.Content -> MiniRte.Types.Content), id : String.String, indentUnit : Maybe.Maybe ( Basics.Float, String.String ), styling : List.List (Html.Styled.Attribute msg) }"},{"name":"EmojiBoxParams","comment":" ","args":["msg"],"type":"{ styling : { active : List.List (Html.Styled.Attribute msg), inactive : List.List (Html.Styled.Attribute msg) }, emojis : List.List String.String }"},{"name":"FontSelectorParams","comment":" ","args":["msg"],"type":"{ styling : List.List (Html.Styled.Attribute msg), fonts : List.List (List.List String.String) }"},{"name":"FontSizeSelectorParams","comment":" ","args":["msg"],"type":"{ styling : List.List (Html.Styled.Attribute msg), sizes : List.List Basics.Float }"},{"name":"InputBoxParams","comment":" ","args":["msg"],"type":"{ styling : { active : List.List (Html.Styled.Attribute msg), inactive : List.List (Html.Styled.Attribute msg) } }"},{"name":"Parameters","comment":" `id` must be unique; it is used to monitor the position of characters.\n\n`content` is the initial content of the textarea. It can be `Just` some plain text or a json string generated by [encodedContent](#encodedContent).\n\n`fontSizeUnit` defaults to `\"px\"`.\n\n`highlighter` runs before each view update and it re-styles the text. See the [Content](MiniRte-Types#Content) type and the [example](https://github.com/dkodaj/rte/tree/master/example).\n\n`indentUnit` defaults to `(50,\"px\")`.\n\n`selectionStyle` controls the appearance of selected text. It defaults to `[(\"background\", \"hsl(217,71%,53%)\"), (\"color\", \"white\")]`.\n\n`styling.active` styles the textarea div in active mode (when editing). Use `update (Active True/False)` to switch between modes.\n\n`tagger` turns the package's own [Msg](MiniRte-Types#Msg) type into your app's msg.\n\n","args":["msg"],"type":"{ id : String.String, content : MiniRte.Types.Content, fontSizeUnit : Maybe.Maybe String.String, highlighter : Maybe.Maybe (MiniRte.Types.Content -> MiniRte.Types.Content), indentUnit : Maybe.Maybe ( Basics.Float, String.String ), pasteImageLinksAsImages : Basics.Bool, pasteLinksAsLinks : Basics.Bool, selectionStyle : List.List ( String.String, String.String ), styling : { active : List.List (Html.Styled.Attribute msg), inactive : List.List (Html.Styled.Attribute msg) }, tagger : MiniRte.Types.Msg -> msg }"},{"name":"Rte","comment":" ","args":["msg"],"type":"{ emojiBox : Basics.Bool, inputBox : Maybe.Maybe MiniRte.Types.InputBox, styling : { active : List.List (Html.Styled.Attribute msg), inactive : List.List (Html.Styled.Attribute msg) }, tagger : MiniRte.Types.Msg -> msg, textarea : MiniRte.Core.Editor }"},{"name":"SwitchParams","comment":" ","args":[],"type":"{ activeColor : String.String, inactiveColor : String.String, width : Basics.Float }"}],"values":[{"name":"decodeContentGZip","comment":" Convert gzipped serialized content back into content.\n","type":"Bytes.Bytes -> Result.Result String.String MiniRte.Types.Content"},{"name":"decodeContentString","comment":" Convert serialized content string back into content.\n","type":"String.String -> Result.Result String.String MiniRte.Types.Content"},{"name":"display","comment":" Display formatted text, without an editor.\n\nIf you want to preserve the option of editing it, create an editor with [init](#init) and put it in passive mode with `update (Active False)`.\n\n","type":"(MiniRte.Types.Msg -> msg) -> MiniRte.Styled.DisplayParams msg -> Html.Styled.Html msg"},{"name":"emojiBox","comment":" Make it appear/disappear with `update ToggleEmojiBox`.\nEach `x` in `params.emojis` turns into a clickable div that triggers `update AddText` events.\n","type":"MiniRte.Styled.Rte msg -> MiniRte.Styled.EmojiBoxParams msg -> Html.Styled.Html msg"},{"name":"encodeContentGZip","comment":" Serialize the edited text as a gzip file.\n","type":"MiniRte.Styled.Rte msg -> Bytes.Bytes"},{"name":"encodeContentString","comment":" Serialize the edited text as string.\n","type":"MiniRte.Styled.Rte msg -> String.String"},{"name":"fontSelector","comment":" A `Html.select` element that triggers `update Font` events.\n","type":"MiniRte.Styled.Rte msg -> MiniRte.Styled.FontSelectorParams msg -> Html.Styled.Html msg"},{"name":"fontSizeSelector","comment":" A `Html.select` element that triggers `update FontSize` events.\n","type":"MiniRte.Styled.Rte msg -> MiniRte.Styled.FontSizeSelectorParams msg -> Html.Styled.Html msg"},{"name":"init","comment":" ","type":"MiniRte.Styled.Parameters msg -> ( MiniRte.Styled.Rte msg, Platform.Cmd.Cmd msg )"},{"name":"inputBox","comment":" Input box for adding hyperlinks and image links.\nMake it appear/disappear with `update ToggleImageBox` or `update ToggleLinkBox`.\nIt contains an OK button that triggers `update ImageAdd` or `update LinkAdd`.\n","type":"MiniRte.Styled.Rte msg -> MiniRte.Styled.InputBoxParams msg -> Html.Styled.Html msg"},{"name":"isActive","comment":" Checks if the editor is active.\n","type":"MiniRte.Styled.Rte msg -> Basics.Bool"},{"name":"onOffSwitch","comment":" A switch that turns editing on/off. The `params.width` field controls its width in px.\n","type":"MiniRte.Styled.Rte msg -> MiniRte.Styled.SwitchParams -> Html.Styled.Html msg"},{"name":"subscriptions","comment":" ","type":"MiniRte.Styled.Rte msg -> Platform.Sub.Sub msg"},{"name":"textContent","comment":" The plain text content of the textarea. Suitable for both `Rte` and `Rte`.\n","type":"MiniRte.Styled.Rte msg -> String.String"},{"name":"textToContent","comment":" ","type":"String.String -> MiniRte.Types.Content"},{"name":"textarea","comment":" Displays the edited text plus the cursor.\n","type":"MiniRte.Styled.Rte msg -> Html.Styled.Html msg"},{"name":"update","comment":" ","type":"MiniRte.Types.Msg -> MiniRte.Styled.Rte msg -> ( MiniRte.Styled.Rte msg, Platform.Cmd.Cmd msg )"}],"binops":[]},{"name":"MiniRte.Types","comment":"\n\n@docs Msg, InputBox, TextAlignType\n\n\n# Writing highlighters\n\nWhen writing a highlighter, pass in a `Content -> Content` function on init.\nThe function should modify the `highlightClasses` or `highlightStyling` fields of the elements.\nEach string `x` in `highlightClasses` turns into `Html.Attribute.class x`.\nEach `(x,y)` in `highlightStyling` turns into `Html.Attribute.style x y`.\nAttributes of `LineBreak`s apply to the preceding paragraph as a whole.\n\n@docs Content, Element, Character, EmbeddedHtml, emptyEmbeddedHtml, LineBreak, Child, FontStyle\n\n","unions":[{"name":"Child","comment":" ","args":[],"cases":[["Child",["MiniRte.Types.EmbeddedHtml"]]]},{"name":"Element","comment":" ","args":[],"cases":[["Break",["MiniRte.Types.LineBreak"]],["Char",["MiniRte.Types.Character"]],["Embedded",["MiniRte.Types.EmbeddedHtml"]]]},{"name":"InputBox","comment":" ","args":[],"cases":[["ImageInputBox",["String.String"]],["LinkInputBox",["String.String"]]]},{"name":"Msg","comment":" For toolbar icons or shortcut keys. See the [example](https://github.com/dkodaj/rte/tree/master/example) for tips.\n\n      Active Bool       -- turn editing on/off\n    | AddText String    -- insert text\n    | Bold              -- make text bold\n    | Class String      -- toggle class on current paragraph\n    | Core MiniRte.CoreTypes.Msg\n                        -- don't mess with this\n    | Cut               -- cut current selection\n    | Copy              -- copy current selection\n    | Font (List String)\n                        -- set current font families\n                        -- e.g. [\"Oswald\", \"sans-serif\"]\n    | FontSize Float    -- set current font size\n    | FromBrowserClipboard String\n                        -- see package description\n    | Heading           -- toggles between h1 and plain div\n    | ImageAdd String   -- embed image (the String is a link)\n    | ImageInput String -- modify content of image input box\n    | Indent            -- increase indent of current paragraph\n    | Italic            -- make text italic\n    | LinkAdd String    -- add link to current selection\n    | LinkInput String  -- modify content of link input box\n    | StrikeThrough     -- cross out text\n    | TextAlign TextAlignType\n                        -- change alignment of current paragraph\n    | ToBrowserClipboard String\n                        -- see package description\n    | ToggleEmojiBox    -- turn emoji input box on/off\n    | ToggleImageBox    -- turn image link input box on/off\n    | ToggleLinkBox     -- turn link input box on/off\n    | Underline         -- underline text\n    | Undo              -- undo last action\n    | Unindent          -- decrease indent of current paragraph\n    | Unlink            -- remove the link the cursor is touching\n\n","args":[],"cases":[["Active",["Basics.Bool"]],["AddContent",["MiniRte.Types.Content"]],["AddCustomHtml",["MiniRte.Types.EmbeddedHtml"]],["AddImage",["String.String"]],["AddLink",["String.String"]],["AddText",["String.String"]],["Bold",[]],["Class",["String.String"]],["Copy",[]],["Cut",[]],["Font",["List.List String.String"]],["FontSize",["Basics.Float"]],["FromBrowserClipboard",["String.String"]],["Heading",[]],["ImageSourceInput",["String.String"]],["Indent",[]],["Internal",["MiniRte.TypesThatAreNotPublic.InternalMsg"]],["Italic",[]],["LinkHrefInput",["String.String"]],["LoadContent",["MiniRte.Types.Content"]],["LoadText",["String.String"]],["NodeType",["String.String"]],["StrikeThrough",[]],["TextAlign",["MiniRte.Types.TextAlignType"]],["ToBrowserClipboard",["String.String"]],["ToggleEmojiBox",[]],["ToggleImageBox",[]],["ToggleLinkBox",[]],["Underline",[]],["Undo",[]],["Unindent",[]],["Unlink",[]]]},{"name":"TextAlignType","comment":" ","args":[],"cases":[["Center",[]],["Left",[]],["Right",[]]]}],"aliases":[{"name":"Character","comment":" ","args":[],"type":"{ char : Char.Char, fontStyle : MiniRte.Types.FontStyle, highlightClasses : List.List String.String, highlightStyling : List.List ( String.String, String.String ), id : Basics.Int, link : Maybe.Maybe String.String }"},{"name":"Content","comment":" ","args":[],"type":"List.List MiniRte.Types.Element"},{"name":"EmbeddedHtml","comment":" `id` is set internally by the module; it doesn't matter what value you enter. ","args":[],"type":"{ attributes : List.List ( String.String, String.String ), classes : List.List String.String, children : List.List MiniRte.Types.Child, highlightClasses : List.List String.String, highlightStyling : List.List ( String.String, String.String ), id : Basics.Int, nodeType : Maybe.Maybe String.String, styling : List.List ( String.String, String.String ), text : Maybe.Maybe String.String }"},{"name":"FontStyle","comment":" ","args":[],"type":"{ classes : List.List String.String, fontFamily : List.List String.String, fontSize : Maybe.Maybe Basics.Float, styling : List.List ( String.String, String.String ) }"},{"name":"LineBreak","comment":" ","args":[],"type":"{ classes : List.List String.String, highlightClasses : List.List String.String, highlightIndent : Basics.Int, highlightStyling : List.List ( String.String, String.String ), id : Basics.Int, indent : Basics.Int, nodeType : Maybe.Maybe String.String, styling : List.List ( String.String, String.String ) }"}],"values":[{"name":"emptyEmbeddedHtml","comment":" An empty div.\n","type":"MiniRte.Types.EmbeddedHtml"}],"binops":[]}]