├── cypress.json ├── packages ├── editor-kit │ ├── dist │ │ ├── features │ │ │ ├── initial-letter │ │ │ │ ├── Dropcaps.d.ts │ │ │ │ ├── InitialLetterAction.d.ts │ │ │ │ ├── InitialLetterButton.d.ts │ │ │ │ ├── InitialLetterContextMenu.d.ts │ │ │ │ ├── InitialLetterMenuItem.d.ts │ │ │ │ └── InitialLetterPluginAction.d.ts │ │ │ ├── color │ │ │ │ ├── ColorGlobalStyle.d.ts │ │ │ │ ├── ColorPlugin.d.ts │ │ │ │ └── ColorPickerButton.d.ts │ │ │ ├── images │ │ │ │ ├── ImageExtensions.d.ts │ │ │ │ ├── InsertImagePluginAction.d.ts │ │ │ │ ├── ImageDropHandler.d.ts │ │ │ │ ├── ImageButton.d.ts │ │ │ │ ├── ImageEditorStyles.d.ts │ │ │ │ ├── ImageElement.d.ts │ │ │ │ ├── InsertImageByUrlAction.d.ts │ │ │ │ ├── ImagePlugin.d.ts │ │ │ │ ├── UploadImageMenuItem.d.ts │ │ │ │ ├── InsertImageByUrlMenuItem.d.ts │ │ │ │ └── UploadImageAction.d.ts │ │ │ ├── links │ │ │ │ ├── LinkGlobalStyle.d.ts │ │ │ │ ├── LinkPlugin.d.ts │ │ │ │ ├── LinkPluginAction.d.ts │ │ │ │ ├── LinkAction.d.ts │ │ │ │ ├── LinkButton.d.ts │ │ │ │ ├── LinkMenuItem.d.ts │ │ │ │ ├── LinkElement.d.ts │ │ │ │ └── LinkToolbar.d.ts │ │ │ ├── headings │ │ │ │ ├── H1Plugin.d.ts │ │ │ │ ├── H2Plugin.d.ts │ │ │ │ ├── H3Plugin.d.ts │ │ │ │ ├── H4Plugin.d.ts │ │ │ │ ├── H5Plugin.d.ts │ │ │ │ ├── H6Plugin.d.ts │ │ │ │ ├── HeadingTogglePlugin.d.ts │ │ │ │ ├── HeadingPluginAction.d.ts │ │ │ │ ├── HeadingTogglePluginAction.d.ts │ │ │ │ ├── H2Action.d.ts │ │ │ │ ├── H3Action.d.ts │ │ │ │ ├── H4Action.d.ts │ │ │ │ ├── H5Action.d.ts │ │ │ │ ├── H6Action.d.ts │ │ │ │ ├── H1Action.d.ts │ │ │ │ ├── HeadingAction.d.ts │ │ │ │ ├── HeadingToggleAction.d.ts │ │ │ │ ├── HeadingMenuItem.d.ts │ │ │ │ ├── HeadingPlugin.d.ts │ │ │ │ ├── HeadingToggleButton.d.ts │ │ │ │ └── HeadingSelect.d.ts │ │ │ ├── theme │ │ │ │ ├── DefaultThemeEditorStyle.d.ts │ │ │ │ ├── DefaultThemeGlobalStyle.d.ts │ │ │ │ └── DefaultThemePlugin.d.ts │ │ │ ├── alert │ │ │ │ ├── InfoAlertPlugin.d.ts │ │ │ │ ├── ErrorAlertPlugin.d.ts │ │ │ │ ├── WarningAlertPlugin.d.ts │ │ │ │ ├── AlertEditorStyle.d.ts │ │ │ │ ├── AlertToggleAction.d.ts │ │ │ │ ├── AlertAction.d.ts │ │ │ │ ├── AlertMenuItem.d.ts │ │ │ │ ├── AlertElement.d.ts │ │ │ │ └── AlertPlugin.d.ts │ │ │ ├── lists │ │ │ │ ├── OrderListPlugin.d.ts │ │ │ │ ├── UnorderedListPlugin.d.ts │ │ │ │ ├── ListTabKeyHandler.d.ts │ │ │ │ ├── ListEnterKeyHandler.d.ts │ │ │ │ ├── ListPluginAction.d.ts │ │ │ │ ├── ListShiftTabKeyHandler.d.ts │ │ │ │ ├── OrderedListAction.d.ts │ │ │ │ ├── UnorderedListAction.d.ts │ │ │ │ ├── OrderedListMenuItem.d.ts │ │ │ │ ├── UnorderedListMenuItem.d.ts │ │ │ │ ├── UnorderListEditorStyle.d.ts │ │ │ │ ├── OrderListEditorStyle.d.ts │ │ │ │ ├── OrderedListButton.d.ts │ │ │ │ ├── UnorderedListButton.d.ts │ │ │ │ └── ListPlugin.d.ts │ │ │ ├── bold │ │ │ │ ├── BoldPlugin.d.ts │ │ │ │ ├── BoldMarkdownTrigger.d.ts │ │ │ │ ├── BoldPluginAction.d.ts │ │ │ │ ├── BoldToggleKeyHandler.d.ts │ │ │ │ ├── BoldAction.d.ts │ │ │ │ ├── BoldButton.d.ts │ │ │ │ └── BoldMenuItem.d.ts │ │ │ ├── fonts │ │ │ │ ├── FontsPlugin.d.ts │ │ │ │ ├── FontGlobalStyle.d.ts │ │ │ │ ├── FontSizeSelect.d.ts │ │ │ │ └── FontSelect.d.ts │ │ │ ├── video │ │ │ │ ├── VideoPlugin.d.ts │ │ │ │ ├── VideoGlobalStyle.d.ts │ │ │ │ ├── VideoNamedTrigger.d.ts │ │ │ │ ├── VideoPluginAction.d.ts │ │ │ │ ├── VideoAction.d.ts │ │ │ │ ├── VideoButton.d.ts │ │ │ │ ├── VideoMenuItem.d.ts │ │ │ │ ├── VideoEditorStyle.d.ts │ │ │ │ └── VideoElement.d.ts │ │ │ ├── italic │ │ │ │ ├── ItalicPlugin.d.ts │ │ │ │ ├── ItalicMarkdownTrigger.d.ts │ │ │ │ ├── ItalicPluginAction.d.ts │ │ │ │ ├── ItalicToggleKeyHandler.d.ts │ │ │ │ ├── ItalicAction.d.ts │ │ │ │ ├── ItalicButton.d.ts │ │ │ │ └── ItalicMenuItem.d.ts │ │ │ ├── layout │ │ │ │ ├── LayoutPlugin.d.ts │ │ │ │ ├── LayoutNamedTrigger.d.ts │ │ │ │ ├── LayoutPluginAction.d.ts │ │ │ │ ├── Layout.d.ts │ │ │ │ ├── LayoutButton.d.ts │ │ │ │ ├── LayoutElement.d.ts │ │ │ │ ├── LayoutCellElement.d.ts │ │ │ │ ├── LayoutGlobalStyle.d.ts │ │ │ │ ├── LayoutAction.d.ts │ │ │ │ ├── CustomLayoutAction.d.ts │ │ │ │ ├── LayoutEditorStyle.d.ts │ │ │ │ ├── CustomLayoutMenuItem.d.ts │ │ │ │ └── LayoutMenuItem.d.ts │ │ │ ├── suggestions │ │ │ │ ├── SuggestionsGlobalStyle.d.ts │ │ │ │ ├── SuggestionsPluginAction.d.ts │ │ │ │ ├── SuggestionList.d.ts │ │ │ │ ├── SuggestionsPlugin.d.ts │ │ │ │ ├── Suggestion.d.ts │ │ │ │ └── Suggestions.d.ts │ │ │ ├── divider │ │ │ │ ├── DividerPlugin.d.ts │ │ │ │ ├── DividerMarkdownTrigger.d.ts │ │ │ │ ├── DividerPluginAction.d.ts │ │ │ │ ├── DividerElement.d.ts │ │ │ │ └── DividerEditorStyle.d.ts │ │ │ ├── enter │ │ │ │ ├── EnterKeyPlugin.d.ts │ │ │ │ └── EnterKeyHandler.d.ts │ │ │ ├── history │ │ │ │ └── HistoryPlugin.d.ts │ │ │ ├── i18n │ │ │ │ ├── EnglishLabels.d.ts │ │ │ │ └── LabelsPlugin.d.ts │ │ │ ├── spoiler │ │ │ │ ├── SpoilerPlugin.d.ts │ │ │ │ ├── SpoilerNamedTrigger.d.ts │ │ │ │ ├── SpoilerPluginAction.d.ts │ │ │ │ ├── SpoilerAction.d.ts │ │ │ │ ├── SpoilerElement.d.ts │ │ │ │ ├── SpoilerButton.d.ts │ │ │ │ └── SpoilerEditorStyle.d.ts │ │ │ ├── auto-focus │ │ │ │ └── AutoFocusPlugin.d.ts │ │ │ ├── blockquote │ │ │ │ ├── BlockquotePlugin.d.ts │ │ │ │ ├── BlockquoteNamedTrigger.d.ts │ │ │ │ ├── BlockquoteMarkdownTrigger.d.ts │ │ │ │ ├── BlockquotePluginAction.d.ts │ │ │ │ ├── BlockquoteAction.d.ts │ │ │ │ ├── BlockquoteEditorStyle.d.ts │ │ │ │ ├── BlockquoteButton.d.ts │ │ │ │ └── BlockquoteMenuItem.d.ts │ │ │ ├── code │ │ │ │ ├── CodeNamedTrigger.d.ts │ │ │ │ ├── CodeMarkdownTrigger.d.ts │ │ │ │ ├── CodeTabKeyHandler.d.ts │ │ │ │ ├── CodeDeleteKeyHandler.d.ts │ │ │ │ ├── CodeEnterKeyHandler.d.ts │ │ │ │ ├── CodePluginAction.d.ts │ │ │ │ ├── CodeBackspaceKeyHandler.d.ts │ │ │ │ ├── CodeAction.d.ts │ │ │ │ ├── CodeHighlighter.d.ts │ │ │ │ ├── CodeMenuItem.d.ts │ │ │ │ ├── CodeElement.d.ts │ │ │ │ ├── CodePlugin.d.ts │ │ │ │ ├── CodeGlobalStyle.d.ts │ │ │ │ └── Languages.d.ts │ │ │ ├── icons │ │ │ │ ├── material-regular │ │ │ │ │ ├── DeleteIcon.d.ts │ │ │ │ │ ├── MaterialRegularIcons.d.ts │ │ │ │ │ ├── CheckIcon.d.ts │ │ │ │ │ ├── DateIcon.d.ts │ │ │ │ │ ├── LinkIcon.d.ts │ │ │ │ │ ├── MoreIcon.d.ts │ │ │ │ │ ├── PlusIcon.d.ts │ │ │ │ │ ├── LaunchIcon.d.ts │ │ │ │ │ ├── UnlinkIcon.d.ts │ │ │ │ │ ├── DropdownIcon.d.ts │ │ │ │ │ ├── ErrorAlertIcon.d.ts │ │ │ │ │ ├── InfoAlertIcon.d.ts │ │ │ │ │ ├── MoreVertIcon.d.ts │ │ │ │ │ ├── SettingsIcon.d.ts │ │ │ │ │ └── WarningAlertIcon.d.ts │ │ │ │ ├── IconProviderPlugin.d.ts │ │ │ │ └── Icons.d.ts │ │ │ ├── mentions │ │ │ │ ├── Mention.d.ts │ │ │ │ ├── MentionsTrigger.d.ts │ │ │ │ ├── MentionElement.d.ts │ │ │ │ ├── MentionEditorStyle.d.ts │ │ │ │ ├── MentionChoice.d.ts │ │ │ │ ├── MentionsPlugin.d.ts │ │ │ │ └── MentionGlobalStyle.d.ts │ │ │ ├── subscript │ │ │ │ ├── SubscriptPlugin.d.ts │ │ │ │ ├── SubscriptMarkdownTrigger.d.ts │ │ │ │ ├── SubscriptPluginAction.d.ts │ │ │ │ ├── SubscriptAction.d.ts │ │ │ │ ├── SubscriptButton.d.ts │ │ │ │ └── SubscriptMenuItem.d.ts │ │ │ ├── text-align │ │ │ │ ├── TextAlignPlugin.d.ts │ │ │ │ ├── TextAlignAction.d.ts │ │ │ │ ├── TextAlignPluginAction.d.ts │ │ │ │ ├── TextAlignLeftButton.d.ts │ │ │ │ ├── TextAlignCenterButton.d.ts │ │ │ │ ├── TextAlignRightButton.d.ts │ │ │ │ └── TextAlignJustifiedButton.d.ts │ │ │ ├── underline │ │ │ │ ├── UnderlinePlugin.d.ts │ │ │ │ ├── UnderlineMarkdownTrigger.d.ts │ │ │ │ ├── UnderlinePluginAction.d.ts │ │ │ │ ├── UnderlineToggleKeyHandler.d.ts │ │ │ │ ├── UnderlineAction.d.ts │ │ │ │ ├── UnderlineButton.d.ts │ │ │ │ └── UnderlineMenuItem.d.ts │ │ │ ├── backspace │ │ │ │ ├── BackspaceKeyPlugin.d.ts │ │ │ │ └── BackspaceKeyHandler.d.ts │ │ │ ├── inline-code │ │ │ │ ├── InlineCodePlugin.d.ts │ │ │ │ ├── InlineCodeMarkdownTrigger.d.ts │ │ │ │ ├── InlineCodePluginAction.d.ts │ │ │ │ ├── InlineCodeAction.d.ts │ │ │ │ ├── InlineCodeButton.d.ts │ │ │ │ ├── InlineCodeMenuItem.d.ts │ │ │ │ └── InlineCodeEditorStyle.d.ts │ │ │ ├── superscript │ │ │ │ ├── SuperscriptPlugin.d.ts │ │ │ │ ├── SuperscriptMarkdownTrigger.d.ts │ │ │ │ ├── SuperscriptPluginAction.d.ts │ │ │ │ ├── SuperscriptAction.d.ts │ │ │ │ ├── SuperscriptIconButton.d.ts │ │ │ │ └── SuperscriptMenuItem.d.ts │ │ │ ├── table │ │ │ │ ├── TableNamedTrigger.d.ts │ │ │ │ ├── TableEnterKeyHandler.d.ts │ │ │ │ ├── TablePluginAction.d.ts │ │ │ │ ├── TableElement.d.ts │ │ │ │ ├── TableCellElement.d.ts │ │ │ │ ├── TableAction.d.ts │ │ │ │ ├── TableKeyDownHandler.d.ts │ │ │ │ ├── TableButton.d.ts │ │ │ │ ├── TableMenuItem.d.ts │ │ │ │ ├── Tables.d.ts │ │ │ │ └── TableElementMenuItem.d.ts │ │ │ ├── toolbar │ │ │ │ ├── EditorToolbarPlugin.d.ts │ │ │ │ ├── SelectionToolbarPlugin.d.ts │ │ │ │ ├── ElementToolbar.d.ts │ │ │ │ ├── SelectionToolbar.d.ts │ │ │ │ ├── EditorToolbar.d.ts │ │ │ │ └── SelectionToolbarGlobalStyle.d.ts │ │ │ ├── strikethrough │ │ │ │ ├── StrikethroughPlugin.d.ts │ │ │ │ ├── StrikethroughMarkdownTrigger.d.ts │ │ │ │ ├── StrikethroughPluginAction.d.ts │ │ │ │ ├── StrikethroughToggleKeyHandler.d.ts │ │ │ │ ├── StrikethroughAction.d.ts │ │ │ │ ├── StrikethroughButton.d.ts │ │ │ │ └── StrikethroughMenuItem.d.ts │ │ │ ├── todo-list │ │ │ │ ├── TodoListDateTrigger.d.ts │ │ │ │ ├── TodoListNamedTrigger.d.ts │ │ │ │ ├── TodoListMarkdownTrigger.d.ts │ │ │ │ ├── TodoListEnterKeyHandler.d.ts │ │ │ │ ├── TodoListGlobalStyle.d.ts │ │ │ │ ├── TodoListPlugin.d.ts │ │ │ │ ├── TodoListElement.d.ts │ │ │ │ ├── TodoListButton.d.ts │ │ │ │ └── TodoItemElement.d.ts │ │ │ ├── breakout │ │ │ │ ├── BreakoutUpKeyHandler.d.ts │ │ │ │ ├── BreakoutDownKeyHandler.d.ts │ │ │ │ └── BreakoutEnterKeyHandler.d.ts │ │ │ ├── selection │ │ │ │ ├── SelectionExtensionsPlugin.d.ts │ │ │ │ └── SelectionPluginEditorStyle.d.ts │ │ │ ├── fixed-title │ │ │ │ ├── FixedTitleEnterKeyHandler.d.ts │ │ │ │ ├── FixedTitleEditorStyle.d.ts │ │ │ │ ├── FixedTitleElement.d.ts │ │ │ │ └── FixedTitlePlugin.d.ts │ │ │ ├── page-divider │ │ │ │ ├── PageDividerPlugin.d.ts │ │ │ │ ├── PageDividerElement.d.ts │ │ │ │ └── PageDividerEditorStyle.d.ts │ │ │ ├── clear-formatting │ │ │ │ ├── ClearFormattingPluginAction.d.ts │ │ │ │ ├── ClearFormattingPlugin.d.ts │ │ │ │ ├── ClearFormattingAction.d.ts │ │ │ │ ├── ClearFormattingButton.d.ts │ │ │ │ └── ClearFormattingMenuItem.d.ts │ │ │ ├── spellcheck │ │ │ │ ├── SpellCheckButton.d.ts │ │ │ │ └── SpellCheck.d.ts │ │ │ ├── popup │ │ │ │ ├── Portal.d.ts │ │ │ │ ├── PopupContent.d.ts │ │ │ │ ├── FocusPopup.d.ts │ │ │ │ ├── ElementModalPopup.d.ts │ │ │ │ ├── HoverPopup.d.ts │ │ │ │ ├── HtmlElementModalPopup.d.ts │ │ │ │ └── CursorPopup.d.ts │ │ │ ├── void │ │ │ │ └── VoidElement.d.ts │ │ │ ├── leafs │ │ │ │ └── LeafRenderer.d.ts │ │ │ ├── elements │ │ │ │ ├── ElementRenderer.d.ts │ │ │ │ ├── DeletableElement.d.ts │ │ │ │ ├── ElementWrapper.d.ts │ │ │ │ └── Elements.d.ts │ │ │ ├── readonly │ │ │ │ ├── ReadOnlyAction.d.ts │ │ │ │ └── ReadOnlyButton.d.ts │ │ │ ├── menu │ │ │ │ ├── Menu.d.ts │ │ │ │ └── MenuButton.d.ts │ │ │ ├── outline │ │ │ │ └── Outline.d.ts │ │ │ ├── marks │ │ │ │ └── MarkMenuItem.d.ts │ │ │ ├── inlines │ │ │ │ └── Inlines.d.ts │ │ │ ├── actions │ │ │ │ └── ActionButton.d.ts │ │ │ └── resizable │ │ │ │ └── Resizable.d.ts │ │ ├── ui │ │ │ ├── ForceUpdate.d.ts │ │ │ ├── Divider.d.ts │ │ │ ├── Spinner.d.ts │ │ │ ├── Show.d.ts │ │ │ ├── Checkbox.d.ts │ │ │ ├── KeyPress.d.ts │ │ │ ├── KeyNavigation.d.ts │ │ │ ├── SaveDialog.d.ts │ │ │ ├── Layers.d.ts │ │ │ └── Utils.d.ts │ │ ├── editor │ │ │ ├── Hover.d.ts │ │ │ ├── Focus.d.ts │ │ │ ├── LastFocusedNode.d.ts │ │ │ └── Matching.d.ts │ │ └── plugins │ │ │ ├── usePlugin.d.ts │ │ │ └── KeyHandler.d.ts │ ├── cypress │ │ ├── plugins │ │ │ └── index.js │ │ └── fixtures │ │ │ └── example.json │ ├── cypress.json │ ├── .npmignore │ └── src │ │ ├── ui │ │ ├── Divider.tsx │ │ ├── ForceUpdate.ts │ │ ├── Spinner.tsx │ │ ├── Show.tsx │ │ └── Layers.ts │ │ ├── features │ │ ├── mentions │ │ │ ├── Mention.ts │ │ │ ├── MentionsTrigger.ts │ │ │ ├── MentionEditorStyle.ts │ │ │ ├── MentionGlobalStyle.ts │ │ │ └── MentionElement.tsx │ │ ├── video │ │ │ ├── VideoGlobalStyle.ts │ │ │ ├── VideoNamedTrigger.ts │ │ │ ├── VideoAction.tsx │ │ │ ├── VideoEditorStyle.ts │ │ │ ├── VideoButton.tsx │ │ │ ├── VideoMenuItem.tsx │ │ │ └── VideoPluginAction.ts │ │ ├── code │ │ │ ├── CodeNamedTrigger.ts │ │ │ ├── CodeMarkdownTrigger.ts │ │ │ ├── CodeAction.tsx │ │ │ ├── CodePluginAction.ts │ │ │ ├── CodeGlobalStyle.ts │ │ │ ├── CodeTabKeyHandler.ts │ │ │ ├── CodeMenuItem.tsx │ │ │ ├── CodeDeleteKeyHandler.ts │ │ │ └── CodeBackspaceKeyHandler.ts │ │ ├── layout │ │ │ ├── LayoutNamedTrigger.ts │ │ │ ├── LayoutGlobalStyle.ts │ │ │ ├── LayoutEditorStyle.ts │ │ │ ├── LayoutAction.tsx │ │ │ ├── Layout.ts │ │ │ ├── CustomLayoutMenuItem.tsx │ │ │ ├── LayoutElement.tsx │ │ │ └── LayoutPluginAction.ts │ │ ├── headings │ │ │ ├── H1Plugin.tsx │ │ │ ├── H2Plugin.tsx │ │ │ ├── H3Plugin.tsx │ │ │ ├── H4Plugin.tsx │ │ │ ├── H5Plugin.tsx │ │ │ ├── H6Plugin.tsx │ │ │ ├── HeadingTogglePlugin.ts │ │ │ ├── H4Action.tsx │ │ │ ├── H2Action.tsx │ │ │ ├── H5Action.tsx │ │ │ ├── H6Action.tsx │ │ │ ├── H1Action.tsx │ │ │ ├── H3Action.tsx │ │ │ ├── HeadingAction.tsx │ │ │ ├── HeadingPluginAction.ts │ │ │ ├── HeadingTogglePluginAction.ts │ │ │ └── HeadingMenuItem.tsx │ │ ├── table │ │ │ ├── TableNamedTrigger.ts │ │ │ ├── TableAction.tsx │ │ │ ├── TableButton.tsx │ │ │ ├── TableMenuItem.tsx │ │ │ ├── TablePluginAction.ts │ │ │ └── TableCellElement.tsx │ │ ├── todo-list │ │ │ ├── TodoListNamedTrigger.ts │ │ │ ├── TodoListGlobalStyle.ts │ │ │ ├── TodoListMarkdownTrigger.ts │ │ │ ├── TodoListElement.tsx │ │ │ └── TodoListButton.tsx │ │ ├── blockquote │ │ │ ├── BlockquoteMarkdownTrigger.ts │ │ │ ├── BlockquoteNamedTrigger.ts │ │ │ ├── BlockquoteEditorStyle.ts │ │ │ ├── BlockquoteAction.tsx │ │ │ ├── BlockquoteButton.tsx │ │ │ ├── BlockquotePluginAction.ts │ │ │ └── BlockquoteMenuItem.tsx │ │ ├── spoiler │ │ │ ├── SpoilerNamedTrigger.ts │ │ │ ├── SpoilerAction.tsx │ │ │ ├── SpoilerPluginAction.ts │ │ │ ├── SpoilerEditorStyle.ts │ │ │ └── SpoilerButton.tsx │ │ ├── selection │ │ │ └── SelectionPluginEditorStyle.ts │ │ ├── divider │ │ │ ├── DividerEditorStyle.ts │ │ │ ├── DividerElement.tsx │ │ │ └── DividerMarkdownTrigger.ts │ │ ├── alert │ │ │ ├── ErrorAlertPlugin.tsx │ │ │ ├── InfoAlertPlugin.tsx │ │ │ ├── WarningAlertPlugin.tsx │ │ │ ├── AlertAction.tsx │ │ │ └── AlertMenuItem.tsx │ │ ├── history │ │ │ └── HistoryPlugin.ts │ │ ├── images │ │ │ ├── ImageEditorStyles.ts │ │ │ └── InsertImagePluginAction.ts │ │ ├── fixed-title │ │ │ └── FixedTitleEditorStyle.ts │ │ ├── popup │ │ │ └── Portal.tsx │ │ ├── toolbar │ │ │ ├── EditorToolbarPlugin.tsx │ │ │ ├── SelectionToolbarPlugin.ts │ │ │ └── SelectionToolbarGlobalStyle.ts │ │ ├── bold │ │ │ ├── BoldAction.tsx │ │ │ ├── BoldButton.tsx │ │ │ ├── BoldPluginAction.ts │ │ │ ├── BoldMenuItem.tsx │ │ │ ├── BoldToggleKeyHandler.ts │ │ │ └── BoldMarkdownTrigger.ts │ │ ├── links │ │ │ ├── LinkAction.tsx │ │ │ ├── LinkButton.tsx │ │ │ └── LinkMenuItem.tsx │ │ ├── lists │ │ │ ├── OrderListPlugin.ts │ │ │ ├── OrderedListAction.tsx │ │ │ ├── UnorderedListPlugin.ts │ │ │ ├── UnorderListEditorStyle.ts │ │ │ ├── UnorderedListAction.tsx │ │ │ ├── OrderListEditorStyle.ts │ │ │ ├── OrderedListMenuItem.tsx │ │ │ ├── OrderedListButton.tsx │ │ │ ├── UnorderedListMenuItem.tsx │ │ │ └── UnorderedListButton.tsx │ │ ├── italic │ │ │ ├── ItalicAction.tsx │ │ │ ├── ItalicButton.tsx │ │ │ ├── ItalicPluginAction.ts │ │ │ ├── ItalicMenuItem.tsx │ │ │ ├── ItalicToggleKeyHandler.ts │ │ │ └── ItalicMarkdownTrigger.ts │ │ ├── subscript │ │ │ ├── SubscriptAction.tsx │ │ │ ├── SubscriptButton.tsx │ │ │ ├── SubscriptPluginAction.ts │ │ │ └── SubscriptMenuItem.tsx │ │ ├── underline │ │ │ ├── UnderlineAction.tsx │ │ │ ├── UnderlineButton.tsx │ │ │ ├── UnderlinePluginAction.ts │ │ │ ├── UnderlineMenuItem.tsx │ │ │ └── UnderlineToggleKeyHandler.ts │ │ ├── inline-code │ │ │ ├── InlineCodeAction.tsx │ │ │ ├── InlineCodeEditorStyle.ts │ │ │ ├── InlineCodeButton.tsx │ │ │ ├── InlineCodePluginAction.ts │ │ │ ├── InlineCodeMarkdownTrigger.ts │ │ │ └── InlineCodeMenuItem.tsx │ │ ├── enter │ │ │ └── EnterKeyPlugin.tsx │ │ ├── superscript │ │ │ ├── SuperscriptAction.tsx │ │ │ ├── SuperscriptIconButton.tsx │ │ │ ├── SuperscriptPluginAction.ts │ │ │ ├── SuperscriptMenuItem.tsx │ │ │ └── SuperscriptMarkdownTrigger.ts │ │ ├── initial-letter │ │ │ ├── InitialLetterAction.tsx │ │ │ ├── InitialLetterButton.tsx │ │ │ └── InitialLetterMenuItem.tsx │ │ ├── strikethrough │ │ │ ├── StrikethroughAction.tsx │ │ │ ├── StrikethroughButton.tsx │ │ │ ├── StrikethroughPluginAction.ts │ │ │ ├── StrikethroughMenuItem.tsx │ │ │ ├── StrikethroughToggleKeyHandler.ts │ │ │ └── StrikethroughMarkdownTrigger.ts │ │ ├── clear-formatting │ │ │ ├── ClearFormattingPluginAction.ts │ │ │ ├── ClearFormattingAction.tsx │ │ │ ├── ClearFormattingButton.tsx │ │ │ └── ClearFormattingMenuItem.tsx │ │ ├── icons │ │ │ ├── material-regular │ │ │ │ ├── PlusIcon.tsx │ │ │ │ ├── DeleteIcon.tsx │ │ │ │ ├── CheckIcon.tsx │ │ │ │ ├── DropdownIcon.tsx │ │ │ │ ├── WarningAlertIcon.tsx │ │ │ │ ├── InfoAlertIcon.tsx │ │ │ │ └── ErrorAlertIcon.tsx │ │ │ └── Icons.ts │ │ ├── fonts │ │ │ └── FontGlobalStyle.ts │ │ ├── page-divider │ │ │ ├── PageDividerEditorStyle.ts │ │ │ └── PageDividerElement.tsx │ │ ├── suggestions │ │ │ └── Suggestions.ts │ │ ├── theme │ │ │ └── DefaultThemePlugin.ts │ │ ├── void │ │ │ └── VoidElement.ts │ │ ├── elements │ │ │ └── ElementRenderer.tsx │ │ ├── i18n │ │ │ ├── LabelsPlugin.ts │ │ │ └── EditorLabels.ts │ │ └── text-align │ │ │ ├── TextAlignLeftButton.tsx │ │ │ ├── TextAlignAction.tsx │ │ │ ├── TextAlignCenterButton.tsx │ │ │ ├── TextAlignRightButton.tsx │ │ │ └── TextAlignJustifiedButton.tsx │ │ └── plugins │ │ ├── KeyHandler.ts │ │ ├── Styl.index.d.ts │ │ └── usePlugin.ts ├── examples │ ├── src │ │ ├── googledocs │ │ │ └── EditorContent.ts │ │ └── Index.tsx │ ├── __tests__ │ │ └── examples.test.js │ ├── README.md │ └── webserver.js └── website │ ├── __tests__ │ └── website.test.js │ ├── README.md │ └── src │ └── ui │ ├── Code.tsx │ ├── Section.tsx │ ├── Link.tsx │ └── Theme.ts ├── lerna.json ├── .idea ├── vcs.xml ├── modules.xml └── react-editor-kit.iml ├── .vscode └── settings.json └── package.json /cypress.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/initial-letter/Dropcaps.d.ts: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /packages/editor-kit/cypress/plugins/index.js: -------------------------------------------------------------------------------- 1 | module.exports = on => {}; 2 | -------------------------------------------------------------------------------- /lerna.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": [ 3 | "packages/*" 4 | ], 5 | "version": "0.0.74" 6 | } 7 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/ui/ForceUpdate.d.ts: -------------------------------------------------------------------------------- 1 | export declare const useForceUpdate: () => () => void; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/color/ColorGlobalStyle.d.ts: -------------------------------------------------------------------------------- 1 | export declare const ColorGlobalStyle: string; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/images/ImageExtensions.d.ts: -------------------------------------------------------------------------------- 1 | export declare const ImageExtensions: string[]; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/links/LinkGlobalStyle.d.ts: -------------------------------------------------------------------------------- 1 | export declare const LinkGlobalStyle: string; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/cypress.json: -------------------------------------------------------------------------------- 1 | { 2 | "integrationFolder": "./src", 3 | "testFiles": "**/*.spec.js" 4 | } 5 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/editor/Hover.d.ts: -------------------------------------------------------------------------------- 1 | export declare const useHover: (element: HTMLElement | null) => boolean; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/headings/H1Plugin.d.ts: -------------------------------------------------------------------------------- 1 | export declare const H1Plugin: import("../../Index").Plugin; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/headings/H2Plugin.d.ts: -------------------------------------------------------------------------------- 1 | export declare const H2Plugin: import("../../Index").Plugin; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/headings/H3Plugin.d.ts: -------------------------------------------------------------------------------- 1 | export declare const H3Plugin: import("../../Index").Plugin; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/headings/H4Plugin.d.ts: -------------------------------------------------------------------------------- 1 | export declare const H4Plugin: import("../../Index").Plugin; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/headings/H5Plugin.d.ts: -------------------------------------------------------------------------------- 1 | export declare const H5Plugin: import("../../Index").Plugin; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/headings/H6Plugin.d.ts: -------------------------------------------------------------------------------- 1 | export declare const H6Plugin: import("../../Index").Plugin; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/.npmignore: -------------------------------------------------------------------------------- 1 | src 2 | !dist/src 3 | test 4 | cypress 5 | tsconfig 6 | webpack 7 | .awcache 8 | lerna-debug.log -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/theme/DefaultThemeEditorStyle.d.ts: -------------------------------------------------------------------------------- 1 | export declare const DefaultThemeEditorStyle: string; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/theme/DefaultThemeGlobalStyle.d.ts: -------------------------------------------------------------------------------- 1 | export declare const DefaultThemeGlobalStyle: string; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/alert/InfoAlertPlugin.d.ts: -------------------------------------------------------------------------------- 1 | export declare const InfoAlertPlugin: import("../../Index").Plugin; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/ui/Divider.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const Divider: () => JSX.Element; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/alert/ErrorAlertPlugin.d.ts: -------------------------------------------------------------------------------- 1 | export declare const ErrorAlertPlugin: import("../../Index").Plugin; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/alert/WarningAlertPlugin.d.ts: -------------------------------------------------------------------------------- 1 | export declare const WarningAlertPlugin: import("../../Index").Plugin; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/lists/OrderListPlugin.d.ts: -------------------------------------------------------------------------------- 1 | export declare const OrderedListPlugin: import("../../Index").Plugin; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/lists/UnorderedListPlugin.d.ts: -------------------------------------------------------------------------------- 1 | export declare const UnorderedListPlugin: import("../../Index").Plugin; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/bold/BoldPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const BoldPlugin: Plugin; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/color/ColorPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const ColorPlugin: Plugin; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/fonts/FontsPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const FontsPlugin: Plugin; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/links/LinkPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const LinkPlugin: Plugin; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/video/VideoPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const VideoPlugin: Plugin; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/src/ui/Divider.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export const Divider = () =>
; 4 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/italic/ItalicPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const ItalicPlugin: Plugin; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/layout/LayoutPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const LayoutPlugin: Plugin; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/suggestions/SuggestionsGlobalStyle.d.ts: -------------------------------------------------------------------------------- 1 | export declare const createSuggestionGlobalStyle: (other?: string) => string; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/mentions/Mention.ts: -------------------------------------------------------------------------------- 1 | export interface Mention { 2 | name: string; 3 | imageUrl?: string; 4 | subText?: string; 5 | } 6 | -------------------------------------------------------------------------------- /packages/examples/src/googledocs/EditorContent.ts: -------------------------------------------------------------------------------- 1 | 2 | export const EditorContent = [ 3 | { type: "paragraph", children: [{ text: "1233" }] }, 4 | ]; 5 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/divider/DividerPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const DividerPlugin: Plugin; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/enter/EnterKeyPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const EnterKeyPlugin: Plugin; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/history/HistoryPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const HistoryPlugin: Plugin; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/i18n/EnglishLabels.d.ts: -------------------------------------------------------------------------------- 1 | import { EditorLabels } from "./EditorLabels"; 2 | export declare const EnglishLabels: EditorLabels; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/spoiler/SpoilerPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const SpoilerPlugin: Plugin; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/plugins/usePlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "./Plugin"; 2 | export declare const usePlugin: (name: string) => T; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/auto-focus/AutoFocusPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const AutoFocusPlugin: Plugin; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/blockquote/BlockquotePlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const BlockquotePlugin: Plugin; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/code/CodeNamedTrigger.d.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | export declare const CodeNamedTrigger: Trigger; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/icons/material-regular/DeleteIcon.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const DeleteIcon: () => JSX.Element; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/mentions/Mention.d.ts: -------------------------------------------------------------------------------- 1 | export interface Mention { 2 | name: string; 3 | imageUrl?: string; 4 | subText?: string; 5 | } 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/mentions/MentionsTrigger.d.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | export declare const MentionsTrigger: Trigger; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/subscript/SubscriptPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const SubscriptPlugin: Plugin; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/text-align/TextAlignPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const TextAlignPlugin: Plugin; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/theme/DefaultThemePlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const DefaultThemePlugin: Plugin; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/underline/UnderlinePlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const UnderlinePlugin: Plugin; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/video/VideoGlobalStyle.d.ts: -------------------------------------------------------------------------------- 1 | export declare const VideoGlobalStyle = "\n .rek-video-settings {\n margin-bottom:16px;\n }\n"; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/video/VideoNamedTrigger.d.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | export declare const VideoNamedTrigger: Trigger; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/video/VideoGlobalStyle.ts: -------------------------------------------------------------------------------- 1 | export const VideoGlobalStyle = ` 2 | .rek-video-settings { 3 | margin-bottom:16px; 4 | } 5 | `; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/backspace/BackspaceKeyPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const BackspaceKeyPlugin: Plugin; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/bold/BoldMarkdownTrigger.d.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | export declare const BoldMarkdownTrigger: Trigger; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/code/CodeMarkdownTrigger.d.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | export declare const CodeMarkdownTrigger: Trigger; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/enter/EnterKeyHandler.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyHandler } from "../../plugins/KeyHandler"; 2 | export declare const EnterKeyHandler: KeyHandler; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/headings/HeadingTogglePlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const HeadingTogglePlugin: Plugin; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/inline-code/InlineCodePlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const InlineCodePlugin: Plugin; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/layout/LayoutNamedTrigger.d.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | export declare const LayoutNamedTrigger: Trigger; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/superscript/SuperscriptPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const SuperscriptPlugin: Plugin; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/table/TableNamedTrigger.d.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | export declare const TabledNamedTrigger: Trigger; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/toolbar/EditorToolbarPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const EditorToolbarPlugin: Plugin; 3 | -------------------------------------------------------------------------------- /packages/website/__tests__/website.test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const website = require('..'); 4 | 5 | describe('website', () => { 6 | it('needs tests'); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/code/CodeTabKeyHandler.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyHandler } from "../../plugins/KeyHandler"; 2 | export declare const CodeTabKeyHandler: KeyHandler; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/icons/material-regular/MaterialRegularIcons.d.ts: -------------------------------------------------------------------------------- 1 | import { Icons } from "../Icons"; 2 | export declare const MaterialRegularIcons: Icons; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/italic/ItalicMarkdownTrigger.d.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | export declare const ItalicMarkdownTrigger: Trigger; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/lists/ListTabKeyHandler.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyHandler } from "../../plugins/KeyHandler"; 2 | export declare const ListTabKeyHandler: KeyHandler; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/spoiler/SpoilerNamedTrigger.d.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | export declare const SpoilerNamedTrigger: Trigger; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/strikethrough/StrikethroughPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const StrikethroughPlugin: Plugin; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/todo-list/TodoListDateTrigger.d.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | export declare const TodoListDateTrigger: Trigger; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/todo-list/TodoListNamedTrigger.d.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | export declare const TodoListNamedTrigger: Trigger; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/toolbar/SelectionToolbarPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const SelectionToolbarPlugin: Plugin; 3 | -------------------------------------------------------------------------------- /packages/examples/__tests__/examples.test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | const examples = require('..'); 4 | 5 | describe('examples', () => { 6 | it('needs tests'); 7 | }); 8 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/alert/AlertEditorStyle.d.ts: -------------------------------------------------------------------------------- 1 | export declare const alertEditorStyle: (alertName: string, backgroundColor: string, iconColor: string) => string; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/alert/AlertToggleAction.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | export declare const AlertToggleAction: PluginAction; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/blockquote/BlockquoteNamedTrigger.d.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | export declare const BlockquoteNamedTrigger: Trigger; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/bold/BoldPluginAction.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | export declare const BoldPluginAction: PluginAction; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/bold/BoldToggleKeyHandler.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyHandler } from "../../plugins/KeyHandler"; 2 | export declare const BoldToggleKeyHandler: KeyHandler; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/code/CodeDeleteKeyHandler.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyHandler } from "../../plugins/KeyHandler"; 2 | export declare const CodeDeleteKeyHandler: KeyHandler; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/code/CodeEnterKeyHandler.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyHandler } from "../../plugins/KeyHandler"; 2 | export declare const CodeEnterKeyHandler: KeyHandler; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/code/CodePluginAction.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | export declare const CodePluginAction: PluginAction; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/divider/DividerMarkdownTrigger.d.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | export declare const DividerMarkdownTrigger: Trigger; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/links/LinkPluginAction.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | export declare const LinkPluginAction: PluginAction; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/lists/ListEnterKeyHandler.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyHandler } from "../../plugins/KeyHandler"; 2 | export declare const ListEnterKeyHandler: KeyHandler; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/lists/ListPluginAction.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | export declare const ListPluginAction: PluginAction; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/table/TableEnterKeyHandler.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyHandler } from "../../plugins/KeyHandler"; 2 | export declare const TableEnterKeyHandler: KeyHandler; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/table/TablePluginAction.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | export declare const TablePluginAction: PluginAction; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/video/VideoPluginAction.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | export declare const VideoPluginAction: PluginAction; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/code/CodeNamedTrigger.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | 3 | export const CodeNamedTrigger: Trigger = { pattern: ":code" }; 4 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/backspace/BackspaceKeyHandler.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyHandler } from "../../plugins/KeyHandler"; 2 | export declare const BackspaceKeyHandler: KeyHandler; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/breakout/BreakoutUpKeyHandler.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyHandler } from "../../plugins/KeyHandler"; 2 | export declare const BreakoutUpKeyHandler: KeyHandler; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/code/CodeBackspaceKeyHandler.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyHandler } from "../../plugins/KeyHandler"; 2 | export declare const CodeBackspaceKeyHandler: KeyHandler; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/italic/ItalicPluginAction.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | export declare const ItalicPluginAction: PluginAction; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/italic/ItalicToggleKeyHandler.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyHandler } from "../../plugins/KeyHandler"; 2 | export declare const ItalicToggleKeyHandler: KeyHandler; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/layout/LayoutPluginAction.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | export declare const LayoutPluginAction: PluginAction; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/lists/ListShiftTabKeyHandler.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyHandler } from "../../plugins/KeyHandler"; 2 | export declare const LisShiftTabKeyHandler: KeyHandler; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/selection/SelectionExtensionsPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const SelectionExtensionsPlugin: Plugin; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/subscript/SubscriptMarkdownTrigger.d.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | export declare const SubscriptMarkdownTrigger: Trigger; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/todo-list/TodoListMarkdownTrigger.d.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | export declare const TodoListMarkdownTrigger: Trigger; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/underline/UnderlineMarkdownTrigger.d.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | export declare const UnderlineMarkdownTrigger: Trigger; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/code/CodeMarkdownTrigger.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | 3 | export const CodeMarkdownTrigger: Trigger = { pattern: "```" }; 4 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/blockquote/BlockquoteMarkdownTrigger.d.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | export declare const BlockquoteMarkdownTrigger: Trigger; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/breakout/BreakoutDownKeyHandler.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyHandler } from "../../plugins/KeyHandler"; 2 | export declare const BreakoutDownKeyHandler: KeyHandler; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/breakout/BreakoutEnterKeyHandler.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyHandler } from "../../plugins/KeyHandler"; 2 | export declare const BreakoutEnterKeyHandler: KeyHandler; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/divider/DividerPluginAction.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | export declare const DividerPluginAction: PluginAction; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/headings/HeadingPluginAction.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | export declare const HeadingPluginAction: PluginAction; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/icons/material-regular/CheckIcon.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export declare const CheckIcon: (props: React.SVGProps) => JSX.Element; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/icons/material-regular/DateIcon.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export declare const DateIcon: (props: React.SVGProps) => JSX.Element; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/icons/material-regular/LinkIcon.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export declare const LinkIcon: (props: React.SVGProps) => JSX.Element; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/icons/material-regular/MoreIcon.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export declare const MoreIcon: (props: React.SVGProps) => JSX.Element; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/icons/material-regular/PlusIcon.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export declare const PlusIcon: (props: React.SVGProps) => JSX.Element; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/inline-code/InlineCodeMarkdownTrigger.d.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | export declare const InlineCodeMarkdownTrigger: Trigger; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/spoiler/SpoilerPluginAction.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | export declare const SpoilerPluginAction: PluginAction; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/superscript/SuperscriptMarkdownTrigger.d.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | export declare const SuperscriptMarkdownTrigger: Trigger; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/todo-list/TodoListEnterKeyHandler.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyHandler } from "../../plugins/KeyHandler"; 2 | export declare const TodoListEnterKeyHandler: KeyHandler; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/layout/LayoutNamedTrigger.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | 3 | export const LayoutNamedTrigger: Trigger = { pattern: /^\:layout / }; 4 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/blockquote/BlockquotePluginAction.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | export declare const BlockquotePluginAction: PluginAction; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/icons/material-regular/LaunchIcon.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export declare const LaunchIcon: (props: React.SVGProps) => JSX.Element; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/icons/material-regular/UnlinkIcon.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export declare const UnlikeIcon: (props: React.SVGProps) => JSX.Element; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/images/InsertImagePluginAction.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | export declare const InsertImagePluginAction: PluginAction; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/strikethrough/StrikethroughMarkdownTrigger.d.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | export declare const StrikethroughMarkdownTrigger: Trigger; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/subscript/SubscriptPluginAction.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | export declare const SubscriptPluginAction: PluginAction; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/underline/UnderlinePluginAction.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | export declare const UnderlinePluginAction: PluginAction; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/underline/UnderlineToggleKeyHandler.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyHandler } from "../../plugins/KeyHandler"; 2 | export declare const UnderlineToggleKeyHandler: KeyHandler; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/headings/H1Plugin.tsx: -------------------------------------------------------------------------------- 1 | import { createDefaultHeadingPlugin } from "./HeadingPlugin"; 2 | 3 | export const H1Plugin = createDefaultHeadingPlugin("h1", ["# "]); 4 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/headings/H2Plugin.tsx: -------------------------------------------------------------------------------- 1 | import { createDefaultHeadingPlugin } from "./HeadingPlugin"; 2 | 3 | export const H2Plugin = createDefaultHeadingPlugin("h2", ["## "]); 4 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/headings/H3Plugin.tsx: -------------------------------------------------------------------------------- 1 | import { createDefaultHeadingPlugin } from "./HeadingPlugin"; 2 | 3 | export const H3Plugin = createDefaultHeadingPlugin("h3", ["### "]); 4 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/headings/H4Plugin.tsx: -------------------------------------------------------------------------------- 1 | import { createDefaultHeadingPlugin } from "./HeadingPlugin"; 2 | 3 | export const H4Plugin = createDefaultHeadingPlugin("h4", ["#### "]); 4 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/table/TableNamedTrigger.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | 3 | export const TabledNamedTrigger: Trigger = { 4 | pattern: ":table", 5 | }; 6 | -------------------------------------------------------------------------------- /packages/website/README.md: -------------------------------------------------------------------------------- 1 | # `website` 2 | 3 | > TODO: description 4 | 5 | ## Usage 6 | 7 | ``` 8 | const website = require('website'); 9 | 10 | // TODO: DEMONSTRATE API 11 | ``` 12 | -------------------------------------------------------------------------------- /packages/website/src/ui/Code.tsx: -------------------------------------------------------------------------------- 1 | import styled from "styled-components"; 2 | import { Theme } from "./Theme"; 3 | 4 | export const Code = styled.code` 5 | color: ${Theme.primaryColor}; 6 | `; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/editor/Focus.d.ts: -------------------------------------------------------------------------------- 1 | import { Node } from "slate"; 2 | export declare const useFocused: (node?: Node) => { 3 | isFocused: boolean; 4 | isFocusedWithin: boolean; 5 | }; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/fixed-title/FixedTitleEnterKeyHandler.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyHandler } from "../../plugins/KeyHandler"; 2 | export declare const FixedTitleEnterKeyHandler: KeyHandler; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/headings/HeadingTogglePluginAction.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | export declare const HeadingTogglePluginAction: PluginAction; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/icons/material-regular/DropdownIcon.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export declare const DropdownIcon: (props: React.SVGProps) => JSX.Element; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/icons/material-regular/ErrorAlertIcon.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export declare const ErrorAlertIcon: (props: React.SVGProps) => JSX.Element; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/icons/material-regular/InfoAlertIcon.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export declare const InfoAlertIcon: (props: React.SVGProps) => JSX.Element; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/icons/material-regular/MoreVertIcon.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export declare const MoreVertIcon: (props: React.SVGProps) => JSX.Element; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/icons/material-regular/SettingsIcon.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export declare const SettingsIcon: (props: React.SVGProps) => JSX.Element; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/inline-code/InlineCodePluginAction.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | export declare const InlineCodePluginAction: PluginAction; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/layout/Layout.d.ts: -------------------------------------------------------------------------------- 1 | import { Element } from "slate"; 2 | export declare type Layout = number[]; 3 | export declare const createLayout: (layout: Layout) => Element; 4 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/page-divider/PageDividerPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const createPageDividerPlugin: (pageArea: number) => Plugin; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/suggestions/SuggestionsPluginAction.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | export declare const SuggestionsPluginAction: PluginAction; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/superscript/SuperscriptPluginAction.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | export declare const SuperscriptPluginAction: PluginAction; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/todo-list/TodoListGlobalStyle.d.ts: -------------------------------------------------------------------------------- 1 | export declare const TodoListGlobalStyle = "\n.rek-todo-item-menu {\n .rek-menu-item-right {\n display:none;\n } \n}\n"; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/headings/H5Plugin.tsx: -------------------------------------------------------------------------------- 1 | import { createDefaultHeadingPlugin } from "./HeadingPlugin"; 2 | 3 | export const H5Plugin = createDefaultHeadingPlugin("h5", ["##### "]); 4 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/headings/H6Plugin.tsx: -------------------------------------------------------------------------------- 1 | import { createDefaultHeadingPlugin } from "./HeadingPlugin"; 2 | 3 | export const H6Plugin = createDefaultHeadingPlugin("h6", ["####### "]); 4 | -------------------------------------------------------------------------------- /packages/examples/README.md: -------------------------------------------------------------------------------- 1 | # `examples` 2 | 3 | > TODO: description 4 | 5 | ## Usage 6 | 7 | ``` 8 | const examples = require('examples'); 9 | 10 | // TODO: DEMONSTRATE API 11 | ``` 12 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/icons/material-regular/WarningAlertIcon.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export declare const WarningAlertIcon: (props: React.SVGProps) => JSX.Element; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/strikethrough/StrikethroughPluginAction.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | export declare const StrikethroughPluginAction: PluginAction; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/todo-list/TodoListNamedTrigger.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | 3 | export const TodoListNamedTrigger: Trigger = { 4 | pattern: ":todo", 5 | }; 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/strikethrough/StrikethroughToggleKeyHandler.d.ts: -------------------------------------------------------------------------------- 1 | import { KeyHandler } from "../../plugins/KeyHandler"; 2 | export declare const StrikethroughToggleKeyHandler: KeyHandler; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/todo-list/TodoListGlobalStyle.ts: -------------------------------------------------------------------------------- 1 | export const TodoListGlobalStyle = ` 2 | .rek-todo-item-menu { 3 | .rek-menu-item-right { 4 | display:none; 5 | } 6 | } 7 | `; 8 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/todo-list/TodoListMarkdownTrigger.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | 3 | export const TodoListMarkdownTrigger: Trigger = { 4 | pattern: "[ ] ", 5 | }; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/clear-formatting/ClearFormattingPluginAction.d.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | export declare const ClearFormattingPluginAction: PluginAction; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/ui/Spinner.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export interface SpinnerProps { 3 | className?: string; 4 | } 5 | export declare const Spinner: (props: SpinnerProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/cypress/fixtures/example.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Using fixtures to represent data", 3 | "email": "hello@cypress.io", 4 | "body": "Fixtures are a great way to mock data for responses to routes" 5 | } -------------------------------------------------------------------------------- /packages/editor-kit/src/features/blockquote/BlockquoteMarkdownTrigger.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | 3 | export const BlockquoteMarkdownTrigger: Trigger = { 4 | pattern: /^\s?> $/, 5 | }; 6 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "git.ignoreLimitWarning": true, 3 | "typescript.tsdk": "packages/editor/node_modules/typescript/lib", 4 | "liveServer.settings.useLocalIp": true, 5 | "liveServer.settings.port": 8091 6 | } 7 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/images/ImageDropHandler.d.ts: -------------------------------------------------------------------------------- 1 | import { EditorState } from "../../editor/EditorState"; 2 | export declare const imageDropHandler: (event: React.DragEvent, { editor }: EditorState) => boolean; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/video/VideoNamedTrigger.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | 3 | export const VideoNamedTrigger: Trigger = { 4 | pattern: ":video", 5 | range: "word-before", 6 | }; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/images/ImageButton.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuButtonProps } from "../menu/MenuButton"; 3 | export declare const ImageButton: (props: MenuButtonProps) => JSX.Element; 4 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/layout/LayoutButton.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuButtonProps } from "../menu/MenuButton"; 3 | export declare const LayoutButton: (props: MenuButtonProps) => JSX.Element; 4 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/layout/LayoutElement.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { RenderElementProps } from "slate-react"; 3 | export declare const LayoutElement: (props: RenderElementProps) => JSX.Element; 4 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/table/TableElement.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { RenderElementProps } from "slate-react"; 3 | export declare const TableElement: (props: RenderElementProps) => JSX.Element; 4 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/spoiler/SpoilerNamedTrigger.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | 3 | export const SpoilerNamedTrigger: Trigger = { 4 | pattern: ":spoiler", 5 | range: "word-before", 6 | }; 7 | -------------------------------------------------------------------------------- /packages/website/src/ui/Section.tsx: -------------------------------------------------------------------------------- 1 | import styled from "styled-components"; 2 | 3 | export const Section = styled.section` 4 | display: flex; 5 | flex-direction: column; 6 | align-items: center; 7 | padding: 32px; 8 | `; 9 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/divider/DividerElement.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { RenderElementProps } from "slate-react"; 3 | export declare const DividerElement: (props: RenderElementProps) => JSX.Element; 4 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/mentions/MentionElement.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { RenderElementProps } from "slate-react"; 3 | export declare const MentionElement: (props: RenderElementProps) => JSX.Element; 4 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/selection/SelectionPluginEditorStyle.d.ts: -------------------------------------------------------------------------------- 1 | export declare const SelectionPluginEditorStyles = "\n .rek-selection-marker {\n background-color: var(--selection-color);\n padding: 8px 0;\n }\n"; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/table/TableCellElement.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { RenderElementProps } from "slate-react"; 3 | export declare const TableCellElement: (props: RenderElementProps) => JSX.Element; 4 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/todo-list/TodoListPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const createTodoListPlugin: (placeholder?: string, dateFormatter?: (date: Date) => string) => Plugin; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/bold/BoldAction.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export interface BoldActionProps { 3 | children: React.ReactNode; 4 | } 5 | export declare const BoldAction: (props: BoldActionProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/code/CodeAction.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export interface CodeActionProps { 3 | children: React.ReactNode; 4 | } 5 | export declare const CodeAction: (props: CodeActionProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/divider/DividerEditorStyle.d.ts: -------------------------------------------------------------------------------- 1 | export declare const DividerEditorStyle = "\n .rek-divider {\n display:flex;\n flex-grow:1;\n height:1px;\n border-top:1px solid var(--divider-color);\n }\n"; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/headings/H2Action.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export interface H2ActionProps { 3 | children: React.ReactNode; 4 | } 5 | export declare const H2Action: (props: H2ActionProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/headings/H3Action.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export interface H3ActionProps { 3 | children: React.ReactNode; 4 | } 5 | export declare const H3Action: (props: H3ActionProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/headings/H4Action.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export interface H4ActionProps { 3 | children: JSX.Element; 4 | } 5 | export declare const H4Action: (props: H4ActionProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/headings/H5Action.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export interface H5ActionProps { 3 | children: React.ReactNode; 4 | } 5 | export declare const H5Action: (props: H5ActionProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/headings/H6Action.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export interface H6ActionProps { 3 | children: React.ReactNode; 4 | } 5 | export declare const H6Action: (props: H6ActionProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/layout/LayoutCellElement.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { RenderElementProps } from "slate-react"; 3 | export declare const LayoutCellElement: (props: RenderElementProps) => JSX.Element; 4 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/todo-list/TodoListElement.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { RenderElementProps } from "slate-react"; 3 | export declare const TodoListElement: (props: RenderElementProps) => JSX.Element; 4 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/blockquote/BlockquoteNamedTrigger.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | 3 | export const BlockquoteNamedTrigger: Trigger = { 4 | pattern: `:quote`, 5 | range: "line-before", 6 | }; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/selection/SelectionPluginEditorStyle.ts: -------------------------------------------------------------------------------- 1 | export const SelectionPluginEditorStyles = ` 2 | .rek-selection-marker { 3 | background-color: var(--selection-color); 4 | padding: 8px 0; 5 | } 6 | `; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/headings/H1Action.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export interface H1ActionProps { 3 | children: React.ReactNode; 4 | } 5 | export declare const H1ActionProps: (props: H1ActionProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/links/LinkAction.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export interface LinkActionProps { 3 | children: React.ReactNode; 4 | } 5 | export declare const LinkAction: (props: LinkActionProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/spellcheck/SpellCheckButton.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { IconButtonProps } from "../buttons/IconButton"; 3 | export declare const SpellCheckButton: (props: IconButtonProps) => JSX.Element; 4 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/table/TableAction.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export interface TableActionProps { 3 | children: React.ReactNode; 4 | } 5 | export declare const TableAction: (props: TableActionProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/table/TableKeyDownHandler.d.ts: -------------------------------------------------------------------------------- 1 | import { EditorState } from "../../editor/EditorState"; 2 | export declare const TableKeyDownHandler: (event: React.KeyboardEvent, { editor, element }: EditorState) => boolean; 3 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/video/VideoAction.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export interface VideoActionProps { 3 | children: React.ReactNode; 4 | } 5 | export declare const VideoAction: (props: VideoActionProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/ui/Show.d.ts: -------------------------------------------------------------------------------- 1 | import { ReactNode } from "react"; 2 | export interface ShowProps { 3 | when: any | undefined | null; 4 | children: ReactNode; 5 | } 6 | export declare const Show: (props: ShowProps) => JSX.Element; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/mentions/MentionsTrigger.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | 3 | export const MentionsTrigger: Trigger = { 4 | pattern: /@(\w+)$/, 5 | range: "line-before", 6 | clear: false, 7 | }; 8 | -------------------------------------------------------------------------------- /packages/editor-kit/src/ui/ForceUpdate.ts: -------------------------------------------------------------------------------- 1 | import { useState } from "react"; 2 | 3 | export const useForceUpdate = () => { 4 | const [, setState] = useState({}); 5 | const forceUpdate = () => setState({}); 6 | return forceUpdate; 7 | }; 8 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/italic/ItalicAction.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export interface ItalicActionProps { 3 | children: React.ReactNode; 4 | } 5 | export declare const ItalicAction: (props: ItalicActionProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/layout/LayoutGlobalStyle.d.ts: -------------------------------------------------------------------------------- 1 | export declare const LayoutGlobalStyle = "\n\n [data-slate-editor=true]:not([contenteditable=true]) {\n .rek-layout-cell {\n border: 1px solid transparent;\n }\n }\n\n\n"; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/page-divider/PageDividerElement.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { RenderElementProps } from "slate-react"; 3 | export declare const PageDividerElement: (props: RenderElementProps) => JSX.Element; 4 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/popup/Portal.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export interface PortalProps { 3 | children: React.ReactNode; 4 | } 5 | export declare const Portal: (props: PortalProps) => import("react").ReactPortal; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/void/VoidElement.d.ts: -------------------------------------------------------------------------------- 1 | import { ReactEditor } from "slate-react"; 2 | /** 3 | * Tell Slate that an Element is void 4 | */ 5 | export declare const registerVoid: (editor: ReactEditor, type: string) => ReactEditor; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/divider/DividerEditorStyle.ts: -------------------------------------------------------------------------------- 1 | export const DividerEditorStyle = ` 2 | .rek-divider { 3 | display:flex; 4 | flex-grow:1; 5 | height:1px; 6 | border-top:1px solid var(--divider-color); 7 | } 8 | `; 9 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/spoiler/SpoilerAction.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export interface SpoilerActionProps { 3 | children: React.ReactNode; 4 | } 5 | export declare const SpoilerAction: (props: SpoilerActionProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/spoiler/SpoilerElement.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { RenderElementProps } from "slate-react"; 3 | export declare const SpoilerElement: React.MemoExoticComponent<(props: RenderElementProps) => JSX.Element>; 4 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/images/ImageEditorStyles.d.ts: -------------------------------------------------------------------------------- 1 | export declare const ImageEditorStyles = "\n .rek-image {\n display: block;\n width: 100%;\n max-width: 100%;\n }\n\n .rek-image.focused {\n box-shadow:0 0 0 3px #B4D5FF;\n }\n"; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/subscript/SubscriptAction.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export interface SubscriptActionProps { 3 | children: React.ReactNode; 4 | } 5 | export declare const SubscriptAction: (props: SubscriptActionProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/underline/UnderlineAction.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export interface UnderlineActionProps { 3 | children: React.ReactNode; 4 | } 5 | export declare const UnderlineAction: (props: UnderlineActionProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/alert/AlertAction.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export interface AlertActionProps { 3 | children: React.ReactNode; 4 | type: string; 5 | } 6 | export declare const AlertAction: (props: AlertActionProps) => JSX.Element; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/blockquote/BlockquoteAction.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export interface BlockquoteActionProps { 3 | children: React.ReactNode; 4 | } 5 | export declare const BlockquoteAction: (props: BlockquoteActionProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/blockquote/BlockquoteEditorStyle.d.ts: -------------------------------------------------------------------------------- 1 | export declare const BlockquoteEditorStyles = "\n blockquote {\n border-left: 4px solid var(--action-color);\n padding-top: 4px;\n padding-bottom: 4px;\n padding-left: 16px;\n }\n"; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/code/CodeHighlighter.d.ts: -------------------------------------------------------------------------------- 1 | import { Range, Node, NodeEntry } from "slate"; 2 | export declare const highlightCode: ([node, path]: NodeEntry, language: string) => Range[]; 3 | export declare const getContent: (token: any) => any; 4 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/leafs/LeafRenderer.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { RenderLeafProps } from "slate-react"; 3 | export declare const renderLeaf: (props: RenderLeafProps, leafType: string, reactType: string) => JSX.Element | undefined; 4 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/lists/OrderedListAction.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export interface OrderedListActionProps { 3 | children: React.ReactNode; 4 | } 5 | export declare const OrderedListAction: (props: OrderedListActionProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/alert/ErrorAlertPlugin.tsx: -------------------------------------------------------------------------------- 1 | import { createAlertPlugin } from "./AlertPlugin"; 2 | 3 | export const ErrorAlertPlugin = createAlertPlugin( 4 | "error", 5 | "error-alert", 6 | "red", 7 | "#ffc5c4", 8 | "error" 9 | ); 10 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/inline-code/InlineCodeAction.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export interface InlineCodeActionProps { 3 | children: React.ReactNode; 4 | } 5 | export declare const InlineCodeAction: (props: InlineCodeActionProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/superscript/SuperscriptAction.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export interface SuperscriptActionProps { 3 | children: React.ReactNode; 4 | } 5 | export declare const SuperscriptAction: (props: SuperscriptActionProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/alert/InfoAlertPlugin.tsx: -------------------------------------------------------------------------------- 1 | import { createAlertPlugin } from "./AlertPlugin"; 2 | 3 | export const InfoAlertPlugin = createAlertPlugin( 4 | "info", 5 | "info-alert", 6 | "blue", 7 | "rgb(222, 235, 255)", 8 | "info" 9 | ); 10 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/clear-formatting/ClearFormattingPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const DefaultClearableEditorFormats: string[]; 3 | export declare const createClearFormattingPlugin: (formats?: string[]) => Plugin; 4 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/layout/LayoutAction.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export interface LayoutActionProps { 3 | children: React.ReactNode; 4 | layout: number[]; 5 | } 6 | export declare const LayoutAction: (props: LayoutActionProps) => JSX.Element; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/lists/UnorderedListAction.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export interface UnorderedListActionProps { 3 | children: React.ReactNode; 4 | } 5 | export declare const UnorderedListAction: (props: UnorderedListActionProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/blockquote/BlockquoteEditorStyle.ts: -------------------------------------------------------------------------------- 1 | export const BlockquoteEditorStyles = ` 2 | blockquote { 3 | border-left: 4px solid var(--action-color); 4 | padding-top: 4px; 5 | padding-bottom: 4px; 6 | padding-left: 16px; 7 | } 8 | `; 9 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/layout/LayoutGlobalStyle.ts: -------------------------------------------------------------------------------- 1 | export const LayoutGlobalStyle = ` 2 | 3 | [data-slate-editor=true]:not([contenteditable=true]) { 4 | .rek-layout-cell { 5 | border: 1px solid transparent; 6 | } 7 | } 8 | 9 | 10 | `; 11 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@mpkelly/react-editor", 3 | "version": "0.0.1", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC" 11 | } 12 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/fixed-title/FixedTitleEditorStyle.d.ts: -------------------------------------------------------------------------------- 1 | export declare const FixedTitleEditorStyle = " \n .rek-fixed-title.rek-empty:before {\n content: attr(placeholder);\n opacity:0.2;\n position:absolute;\n display: block; /* For Firefox */\n }\n"; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/headings/HeadingAction.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export interface HeadingActionProps { 3 | heading: string; 4 | children: React.ReactNode; 5 | } 6 | export declare const HeadingAction: (props: HeadingActionProps) => JSX.Element; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/strikethrough/StrikethroughAction.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export interface StrikethroughActionProps { 3 | children: React.ReactNode; 4 | } 5 | export declare const StrikethroughAction: (props: StrikethroughActionProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/ui/Checkbox.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export interface CheckboxProps { 3 | checked: boolean; 4 | onChange?(checked: boolean): void; 5 | label?: string; 6 | } 7 | export declare const Checkbox: (props: CheckboxProps) => JSX.Element; 8 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/alert/WarningAlertPlugin.tsx: -------------------------------------------------------------------------------- 1 | import { createAlertPlugin } from "./AlertPlugin"; 2 | 3 | export const WarningAlertPlugin = createAlertPlugin( 4 | "warning", 5 | "warning-alert", 6 | "orange", 7 | "#ffdea1", 8 | "warning" 9 | ); 10 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/history/HistoryPlugin.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | import { withHistory } from "slate-history"; 3 | 4 | export const HistoryPlugin: Plugin = { 5 | name: "history", 6 | withPlugin: (editor) => withHistory(editor), 7 | }; 8 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/initial-letter/InitialLetterAction.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export interface InitialLetterActionProps { 3 | children: React.ReactNode; 4 | } 5 | export declare const InitialLetterAction: (props: InitialLetterActionProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/mentions/MentionEditorStyle.d.ts: -------------------------------------------------------------------------------- 1 | export declare const MentionEditorStyle = "\n .rek-mention {\n display:inline-flex;\n background-color: var(--gray-light2-color);\n padding: 1px 3px;\n border-radius: 2px;\n white-space: nowrap;\n }\n"; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/ui/KeyPress.d.ts: -------------------------------------------------------------------------------- 1 | export interface KeyPressProps { 2 | targetKeys: string | string[]; 3 | handler: (event: KeyboardEvent) => any; 4 | deps: any[]; 5 | editor: HTMLElement; 6 | } 7 | export declare const useKeyPress: (props: KeyPressProps) => void; 8 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/images/ImageEditorStyles.ts: -------------------------------------------------------------------------------- 1 | export const ImageEditorStyles = ` 2 | .rek-image { 3 | display: block; 4 | width: 100%; 5 | max-width: 100%; 6 | } 7 | 8 | .rek-image.focused { 9 | box-shadow:0 0 0 3px #B4D5FF; 10 | } 11 | `; 12 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/text-align/TextAlignAction.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export interface TextAlignActionProps { 3 | children: React.ReactNode; 4 | textAlign: string; 5 | } 6 | export declare const TextAlignAction: (props: TextAlignActionProps) => JSX.Element; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/fixed-title/FixedTitleEditorStyle.ts: -------------------------------------------------------------------------------- 1 | export const FixedTitleEditorStyle = ` 2 | .rek-fixed-title.rek-empty:before { 3 | content: attr(placeholder); 4 | opacity:0.2; 5 | position:absolute; 6 | display: block; /* For Firefox */ 7 | } 8 | `; 9 | -------------------------------------------------------------------------------- /packages/website/src/ui/Link.tsx: -------------------------------------------------------------------------------- 1 | import styled from "styled-components"; 2 | import { Theme } from "./Theme"; 3 | 4 | export const Link = styled.a` 5 | color: inherit; 6 | text-decoration: none; 7 | border-bottom: 2px solid ${Theme.primaryColor}; 8 | cursor: pointer; 9 | `; 10 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/bold/BoldButton.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | export declare const BoldButton: (props: IconProps & TooltipContentProps) => JSX.Element; 5 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/clear-formatting/ClearFormattingAction.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export interface ClearFormattingActionProps { 3 | children: React.ReactNode; 4 | } 5 | export declare const ClearFormattingAction: (props: ClearFormattingActionProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/links/LinkButton.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | export declare const LinkButton: (props: IconProps & TooltipContentProps) => JSX.Element; 5 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/table/TableButton.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | export declare const TableButton: (props: IconProps & TooltipContentProps) => JSX.Element; 5 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/video/VideoButton.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | export declare const VideoButton: (props: IconProps & TooltipContentProps) => JSX.Element; 5 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/plugins/KeyHandler.d.ts: -------------------------------------------------------------------------------- 1 | import { EditorState } from "../editor/EditorState"; 2 | import { Plugin } from "./Plugin"; 3 | export declare type KeyHandler = { 4 | pattern: string; 5 | handle: (editor: EditorState, event: KeyboardEvent, plugin: Plugin) => boolean; 6 | }; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/bold/BoldMenuItem.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | export interface BoldMenuItemProps extends Partial { 4 | } 5 | export declare const BoldMenuItem: (props: BoldMenuItemProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/code/CodeMenuItem.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | export interface CodeMenuItemProps extends Partial { 4 | } 5 | export declare const CodeMenuItem: (props: CodeMenuItemProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/images/ImageElement.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { RenderElementProps } from "slate-react"; 3 | export interface ImageElementProps extends RenderElementProps { 4 | } 5 | export declare const ImageElement: (props: RenderElementProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/italic/ItalicButton.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { TooltipContentProps } from "../popup/Tooltip"; 3 | import { IconProps } from "../buttons/IconButton"; 4 | export declare const ItalicButton: (props: IconProps & TooltipContentProps) => JSX.Element; 5 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/links/LinkMenuItem.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | export interface LinkMenuItemProps extends Partial { 4 | } 5 | export declare const LinkMenuItem: (props: LinkMenuItemProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/spoiler/SpoilerButton.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | export declare const SpoilerButton: (props: IconProps & TooltipContentProps) => JSX.Element; 5 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/popup/Portal.tsx: -------------------------------------------------------------------------------- 1 | import ReactDOM from "react-dom"; 2 | 3 | export interface PortalProps { 4 | children: React.ReactNode; 5 | } 6 | 7 | export const Portal = (props: PortalProps) => { 8 | return ReactDOM.createPortal(props.children, document.body); 9 | }; 10 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/table/TableMenuItem.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | export interface TableMenuItemProps extends Partial { 4 | } 5 | export declare const TableMenuItem: (props: TableMenuItemProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/text-align/TextAlignPluginAction.d.ts: -------------------------------------------------------------------------------- 1 | import { ReactEditor } from "slate-react"; 2 | import { PluginAction } from "../../plugins/PluginAction"; 3 | export declare const TextAlignPluginAction: PluginAction; 4 | export declare const getTextAlign: (editor: ReactEditor) => any; 5 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/todo-list/TodoListButton.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | export declare const TodoListButton: (props: IconProps & TooltipContentProps) => JSX.Element; 5 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/video/VideoMenuItem.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | export interface VideoMenuItemProps extends Partial { 4 | } 5 | export declare const VideoMenuItem: (props: VideoMenuItemProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/mentions/MentionEditorStyle.ts: -------------------------------------------------------------------------------- 1 | export const MentionEditorStyle = ` 2 | .rek-mention { 3 | display:inline-flex; 4 | background-color: var(--gray-light2-color); 5 | padding: 1px 3px; 6 | border-radius: 2px; 7 | white-space: nowrap; 8 | } 9 | `; 10 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/blockquote/BlockquoteButton.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | export declare const BlockquoteButton: (props: IconProps & TooltipContentProps) => JSX.Element; 5 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/elements/ElementRenderer.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { RenderElementProps } from "slate-react"; 3 | export declare const renderElement: (props: RenderElementProps, elementType: string, reactType: string) => React.DOMElement, Element>; 4 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/inline-code/InlineCodeButton.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { TooltipContentProps } from "../popup/Tooltip"; 3 | import { IconProps } from "../buttons/IconButton"; 4 | export declare const InlineCodeButton: (props: IconProps & TooltipContentProps) => JSX.Element; 5 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/italic/ItalicMenuItem.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | export interface ItalicMenuItemProps extends Partial { 4 | } 5 | export declare const ItalicMenuItem: (props: ItalicMenuItemProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/mentions/MentionChoice.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Mention } from "./Mention"; 3 | export interface MentionChoiceProps { 4 | choice: Mention; 5 | } 6 | export declare const MentionChoice: React.MemoExoticComponent<(props: MentionChoiceProps) => JSX.Element>; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/readonly/ReadOnlyAction.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | export interface ReadOnlyActionProps { 3 | children: React.ReactNode; 4 | onMouseDown?(event: React.MouseEvent): void; 5 | } 6 | export declare const ReadOnlyAction: (props: ReadOnlyActionProps) => JSX.Element; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/spellcheck/SpellCheck.d.ts: -------------------------------------------------------------------------------- 1 | export declare const useSpellcheck: (enabled: boolean, id: string, callback?: () => void) => { 2 | spellCheck: boolean; 3 | disableSpellCheck: () => void; 4 | enableSpellCheck: () => void; 5 | delaySpellCheck: () => () => void; 6 | }; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/subscript/SubscriptButton.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { TooltipContentProps } from "../popup/Tooltip"; 3 | import { IconProps } from "../buttons/IconButton"; 4 | export declare const SubscriptButton: (props: IconProps & TooltipContentProps) => JSX.Element; 5 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/underline/UnderlineButton.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { TooltipContentProps } from "../popup/Tooltip"; 3 | import { IconProps } from "../buttons/IconButton"; 4 | export declare const UnderlineButton: (props: IconProps & TooltipContentProps) => JSX.Element; 5 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/video/VideoEditorStyle.d.ts: -------------------------------------------------------------------------------- 1 | export declare const VideoEditorStyle = "\n .rek-video {\n position:relative; \n min-height:120px;\n }\n\n .rek-video.rek-no-url {\n background-color: var(--gray-light2-color);\n }\n\n .rek-video div {\n margin: 0 auto;\n }\n\n"; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/text-align/TextAlignLeftButton.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | export declare const TextAlignLeftButton: (props: IconProps & TooltipContentProps) => JSX.Element; 5 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/headings/HeadingToggleAction.d.ts: -------------------------------------------------------------------------------- 1 | import React, { FunctionComponent } from "react"; 2 | export interface HeadingToggleActionProps { 3 | children: React.ReactNode; 4 | heading?: string; 5 | } 6 | export declare const HeadingToggleAction: FunctionComponent; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/initial-letter/InitialLetterButton.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | export declare const InitialLetterButton: (props: IconProps & TooltipContentProps) => JSX.Element; 5 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/strikethrough/StrikethroughButton.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { TooltipContentProps } from "../popup/Tooltip"; 3 | import { IconProps } from "../buttons/IconButton"; 4 | export declare const StrikethroughButton: (props: IconProps & TooltipContentProps) => JSX.Element; 5 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/superscript/SuperscriptIconButton.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | export declare const SuperscriptButton: (props: IconProps & TooltipContentProps) => JSX.Element; 5 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/text-align/TextAlignCenterButton.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | export declare const TextAlignCenterButton: (props: IconProps & TooltipContentProps) => JSX.Element; 5 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/text-align/TextAlignRightButton.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | export declare const TextAlignRightButton: (props: IconProps & TooltipContentProps) => JSX.Element; 5 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/headings/HeadingTogglePlugin.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | import { HeadingTogglePluginAction } from "./HeadingTogglePluginAction"; 3 | 4 | export const HeadingTogglePlugin: Plugin = { 5 | name: "heading-toggle", 6 | actions: [HeadingTogglePluginAction], 7 | }; 8 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/toolbar/EditorToolbarPlugin.tsx: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | import { EditorToolbarGlobalStyle } from "./EditorToolbarGlobalStyle"; 3 | 4 | export const EditorToolbarPlugin: Plugin = { 5 | name: "editor-toolbar", 6 | globalStyle: EditorToolbarGlobalStyle, 7 | }; 8 | -------------------------------------------------------------------------------- /packages/editor-kit/src/ui/Spinner.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export interface SpinnerProps { 4 | className?: string; 5 | } 6 | 7 | export const Spinner = (props: SpinnerProps) => { 8 | const className = props.className || ""; 9 | return
; 10 | }; 11 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/alert/AlertMenuItem.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | export interface AlertMenuItemProps extends Partial { 4 | type: string; 5 | } 6 | export declare const AlertMenuItem: (props: AlertMenuItemProps) => JSX.Element; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/clear-formatting/ClearFormattingButton.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | export declare const ClearFormattingButton: (props: IconProps & TooltipContentProps) => JSX.Element; 5 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/layout/CustomLayoutAction.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { ActionProps } from "../actions/Action"; 3 | export interface CustomLayoutActionProps extends Partial { 4 | } 5 | export declare const CustomLayoutAction: (props: CustomLayoutActionProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/layout/LayoutEditorStyle.d.ts: -------------------------------------------------------------------------------- 1 | export declare const LayoutEditorStyle = "\n .rek-layout {\n display:flex;\n }\n\n .rek-layout-cell {\n flex-grow:1;\n flex-shrink:1;\n min-height:10px;\n padding:0 8px;\n margin:4px;\n \n border: 1px solid var(--divider-color);\n }\n\n"; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/subscript/SubscriptMenuItem.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | export interface SubscriptMenuItemProps extends Partial { 4 | } 5 | export declare const SubscriptMenuItem: (props: SubscriptMenuItemProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/text-align/TextAlignJustifiedButton.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | export declare const TextAlignJustifiedButton: (props: IconProps & TooltipContentProps) => JSX.Element; 5 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/toolbar/ElementToolbar.d.ts: -------------------------------------------------------------------------------- 1 | import React, { FunctionComponent } from "react"; 2 | export interface ElementToolbarProps extends React.DetailedHTMLProps, HTMLDivElement> { 3 | } 4 | export declare const ElementToolbar: FunctionComponent; 5 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/underline/UnderlineMenuItem.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | export interface UnderlineMenuItemProps extends Partial { 4 | } 5 | export declare const UnderlineMenuItem: (props: UnderlineMenuItemProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/blockquote/BlockquoteMenuItem.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | export interface BlockquoteMenuItemProps extends Partial { 4 | } 5 | export declare const BlockquoteMenuItem: (props: BlockquoteMenuItemProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/inline-code/InlineCodeMenuItem.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | export interface InlineCodeMenuItemProps extends Partial { 4 | } 5 | export declare const InlineCodeMenuItem: (props: InlineCodeMenuItemProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/lists/OrderedListMenuItem.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | export interface OrderedListMenuItemProps extends Partial { 4 | } 5 | export declare const OrderedListMenuItem: (props: OrderedListMenuItemProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/src/plugins/KeyHandler.ts: -------------------------------------------------------------------------------- 1 | import { EditorState } from "../editor/EditorState"; 2 | import { Plugin } from "./Plugin"; 3 | 4 | export type KeyHandler = { 5 | pattern: string; 6 | handle: ( 7 | editor: EditorState, 8 | event: KeyboardEvent, 9 | plugin: Plugin 10 | ) => boolean; 11 | }; 12 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/images/InsertImageByUrlAction.d.ts: -------------------------------------------------------------------------------- 1 | import { FunctionComponent, ReactNode } from "react"; 2 | export interface InsertImageByUrlActionProps { 3 | children: ReactNode; 4 | extensions?: string[]; 5 | } 6 | export declare const InsertImageByUrlAction: FunctionComponent; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/layout/CustomLayoutMenuItem.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | export interface CustomLayoutMenuItemProps extends Partial { 4 | } 5 | export declare const CustomLayoutMenuItem: (props: CustomLayoutMenuItemProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/lists/UnorderedListMenuItem.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | export interface UnorderedListMenuItemProps extends Partial { 4 | } 5 | export declare const UnorderedListMenuItem: (props: UnorderedListMenuItemProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/menu/Menu.d.ts: -------------------------------------------------------------------------------- 1 | import React, { CSSProperties, ReactNode } from "react"; 2 | export interface MenuProps { 3 | children: ReactNode; 4 | style?: CSSProperties; 5 | className?: string; 6 | } 7 | export declare const Menu: React.ForwardRefExoticComponent>; 8 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/superscript/SuperscriptMenuItem.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | export interface SuperscriptMenuItemProps extends Partial { 4 | } 5 | export declare const SuperscriptMenuItem: (props: SuperscriptMenuItemProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/toolbar/SelectionToolbarPlugin.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | import { SelectionToolbarGlobalStyle } from "./SelectionToolbarGlobalStyle"; 3 | 4 | export const SelectionToolbarPlugin: Plugin = { 5 | name: "selection-toolbar", 6 | globalStyle: SelectionToolbarGlobalStyle, 7 | }; 8 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/code/CodeElement.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { RenderElementProps } from "slate-react"; 3 | export declare const CodeElement: (props: RenderElementProps) => JSX.Element; 4 | export interface ToolbarProps extends RenderElementProps { 5 | onFocus(): void; 6 | onClose(): void; 7 | } 8 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/headings/HeadingMenuItem.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | export interface HeadingMenuItemProps extends Partial { 4 | type: string; 5 | } 6 | export declare const HeadingMenuItem: (props: HeadingMenuItemProps) => JSX.Element; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/lists/UnorderListEditorStyle.d.ts: -------------------------------------------------------------------------------- 1 | export declare const UnorderedListEditorStyle = "\n ul ul ul ul,\n ul {\n list-style: square outside none;\n }\n\n ul ul ul ul ul,\n ul ul {\n list-style: circle outside none;\n }\n\n ul ul ul ul ul ul,\n ul ul ul {\n list-style: disc outside none;\n }\n"; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/bold/BoldAction.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Action } from "../actions/Action"; 3 | 4 | export interface BoldActionProps { 5 | children: React.ReactNode; 6 | } 7 | 8 | export const BoldAction = (props: BoldActionProps) => { 9 | return ; 10 | }; 11 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/code/CodeAction.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Action } from "../actions/Action"; 3 | 4 | export interface CodeActionProps { 5 | children: React.ReactNode; 6 | } 7 | 8 | export const CodeAction = (props: CodeActionProps) => { 9 | return ; 10 | }; 11 | -------------------------------------------------------------------------------- /packages/editor-kit/src/plugins/Styl.index.d.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * Only nested selectors are supported and not 3 | * the full Stylus syntax. Using this extension 4 | * stops VS Code from complaining that the files 5 | * aren't valid CSS. 6 | */ 7 | declare module "*.styl" { 8 | const content: any; 9 | export default content; 10 | } 11 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/initial-letter/InitialLetterContextMenu.d.ts: -------------------------------------------------------------------------------- 1 | import { ContextMenuContribution } from "../context-menu/ContextMenu"; 2 | import { InitialLetterPluginOptions } from "./InitialLetterPlugin"; 3 | export declare const createInitialLetterContextMenu: (options: InitialLetterPluginOptions) => ContextMenuContribution[]; 4 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/initial-letter/InitialLetterMenuItem.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | export interface InitialLetterMenuItemProps extends Partial { 4 | } 5 | export declare const InitialLetterMenuItem: (props: InitialLetterMenuItemProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/strikethrough/StrikethroughMenuItem.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | export interface StrikethroughMenuItemProps extends Partial { 4 | } 5 | export declare const StrikethroughMenuItem: (props: StrikethroughMenuItemProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/headings/H4Action.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { HeadingAction } from "./HeadingAction"; 3 | 4 | export interface H4ActionProps { 5 | children: JSX.Element; 6 | } 7 | 8 | export const H4Action = (props: H4ActionProps) => { 9 | return ; 10 | }; 11 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/video/VideoAction.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Action } from "../actions/Action"; 3 | 4 | export interface VideoActionProps { 5 | children: React.ReactNode; 6 | } 7 | 8 | export const VideoAction = (props: VideoActionProps) => { 9 | return ; 10 | }; 11 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/fixed-title/FixedTitleElement.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { RenderElementProps } from "slate-react"; 3 | export interface FixedTitleElementProps extends RenderElementProps { 4 | placeholder: string; 5 | } 6 | export declare const FixedTitleElement: (props: FixedTitleElementProps) => JSX.Element; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/headings/HeadingPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | import { Trigger } from "../../plugins/Trigger"; 3 | export declare const createHeadingPlugin: (type: string, triggers?: Trigger[]) => Plugin; 4 | export declare const createDefaultHeadingPlugin: (type: string, patterns: string[]) => Plugin; 5 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/lists/OrderListEditorStyle.d.ts: -------------------------------------------------------------------------------- 1 | export declare const OrderedListEditorStyle = "\n ol ol ol ol, \n ol {\n list-style: decimal outside none;\n }\n\n ol ol ol ol ol,\n ol ol {\n list-style: lower-latin outside none;\n }\n\n ol ol ol ol ol ol,\n ol ol ol {\n list-style: lower-roman outside none;\n }\n"; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/headings/H2Action.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { HeadingAction } from "./HeadingAction"; 3 | 4 | export interface H2ActionProps { 5 | children: React.ReactNode; 6 | } 7 | 8 | export const H2Action = (props: H2ActionProps) => { 9 | return ; 10 | }; 11 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/headings/H5Action.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { HeadingAction } from "./HeadingAction"; 3 | 4 | export interface H5ActionProps { 5 | children: React.ReactNode; 6 | } 7 | 8 | export const H5Action = (props: H5ActionProps) => { 9 | return ; 10 | }; 11 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/headings/H6Action.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { HeadingAction } from "./HeadingAction"; 3 | 4 | export interface H6ActionProps { 5 | children: React.ReactNode; 6 | } 7 | 8 | export const H6Action = (props: H6ActionProps) => { 9 | return ; 10 | }; 11 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/links/LinkAction.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | import { Action } from "../actions/Action"; 4 | 5 | export interface LinkActionProps { 6 | children: React.ReactNode; 7 | } 8 | 9 | export const LinkAction = (props: LinkActionProps) => { 10 | return ; 11 | }; 12 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/lists/OrderListPlugin.ts: -------------------------------------------------------------------------------- 1 | import { createListPlugin } from "./ListPlugin"; 2 | import { OrderedListEditorStyle } from "./OrderListEditorStyle"; 3 | 4 | export const OrderedListPlugin = createListPlugin( 5 | "ordered-list", 6 | "ol", 7 | [{ pattern: /^\s?[0-9]+\.\s/ }], 8 | OrderedListEditorStyle 9 | ); 10 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/clear-formatting/ClearFormattingMenuItem.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | export interface ClearFormattingMenuItemProps extends Partial { 4 | } 5 | export declare const ClearFormattingMenuItem: (props: ClearFormattingMenuItemProps) => JSX.Element; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/i18n/LabelsPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | import { EditorLabels } from "./EditorLabels"; 3 | export interface LabelsPlugin extends Plugin { 4 | name: "label-provider"; 5 | labels: EditorLabels; 6 | } 7 | export declare const createLabelsPlugin: (labels?: EditorLabels) => LabelsPlugin; 8 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/links/LinkElement.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { RenderElementProps, ReactEditor } from "slate-react"; 3 | export interface LinkProps extends RenderElementProps { 4 | } 5 | export declare const Link: (props: LinkProps) => JSX.Element; 6 | export declare const createLink: (editor: ReactEditor) => void; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/outline/Outline.d.ts: -------------------------------------------------------------------------------- 1 | import { Node } from "slate"; 2 | export declare const DefaultOutlineTypes: string[]; 3 | export interface OutlineEntry { 4 | content: string; 5 | depth: number; 6 | node: Node; 7 | } 8 | export declare const createOutline: (nodes: Node[], types?: string[], flat?: boolean) => OutlineEntry[]; 9 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/table/Tables.d.ts: -------------------------------------------------------------------------------- 1 | import { Element } from "slate"; 2 | export declare const useTables: () => { 3 | addColumn: (element: Element, before?: boolean) => void; 4 | addRow: (element: Element, before?: boolean) => void; 5 | deleteColumn: (element: Element) => void; 6 | deleteRow: (element: Element) => void; 7 | }; 8 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/headings/H1Action.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { HeadingAction } from "./HeadingAction"; 3 | 4 | export interface H1ActionProps { 5 | children: React.ReactNode; 6 | } 7 | 8 | export const H1ActionProps = (props: H1ActionProps) => { 9 | return ; 10 | }; 11 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/italic/ItalicAction.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Action } from "../actions/Action"; 3 | 4 | export interface ItalicActionProps { 5 | children: React.ReactNode; 6 | } 7 | 8 | export const ItalicAction = (props: ItalicActionProps) => { 9 | return ; 10 | }; 11 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/video/VideoEditorStyle.ts: -------------------------------------------------------------------------------- 1 | export const VideoEditorStyle = ` 2 | .rek-video { 3 | position:relative; 4 | min-height:120px; 5 | } 6 | 7 | .rek-video.rek-no-url { 8 | background-color: var(--gray-light2-color); 9 | } 10 | 11 | .rek-video div { 12 | margin: 0 auto; 13 | } 14 | 15 | `; 16 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/editor/LastFocusedNode.d.ts: -------------------------------------------------------------------------------- 1 | import { Point, Range, Element } from "slate"; 2 | import { ReactEditor } from "slate-react"; 3 | export declare const useLastFocused: (editor: ReactEditor) => LastFocusedState; 4 | export interface LastFocusedState { 5 | element?: Element; 6 | point?: Point; 7 | selection?: Range | null; 8 | } 9 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/code/CodePlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare type Code = Plugin & CodePluginOptions; 3 | export interface CodePluginOptions { 4 | hideToolbar?: boolean; 5 | } 6 | export declare const createCodePlugin: (options?: CodePluginOptions) => Code; 7 | export declare const CodePlugin: Code; 8 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/ui/KeyNavigation.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | export declare const useKeyNavigation: (total: number, handleSelect: (index: number) => any, initialActive: number, enabled: boolean, editor: HTMLElement) => { 3 | activeIndex: number; 4 | setActive: import("react").Dispatch>; 5 | }; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/spoiler/SpoilerAction.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Action } from "../actions/Action"; 3 | 4 | export interface SpoilerActionProps { 5 | children: React.ReactNode; 6 | } 7 | 8 | export const SpoilerAction = (props: SpoilerActionProps) => { 9 | return ; 10 | }; 11 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/marks/MarkMenuItem.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | export interface MarkMenuItemProps extends MenuItemProps { 4 | type: string; 5 | value?: any; 6 | hideOnIcon?: boolean; 7 | } 8 | export declare const MarkMenuItem: (props: MarkMenuItemProps) => JSX.Element; 9 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/table/TableAction.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Action } from "../actions/Action"; 3 | 4 | export interface TableActionProps { 5 | children: React.ReactNode; 6 | } 7 | 8 | export const TableAction = (props: TableActionProps) => { 9 | return ( 10 | 11 | ); 12 | }; 13 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/alert/AlertElement.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { RenderElementProps } from "slate-react"; 3 | import { Icons } from "../icons/Icons"; 4 | export interface AlertElementProps extends RenderElementProps { 5 | icon: keyof Icons; 6 | } 7 | export declare const AlertElement: (props: AlertElementProps) => JSX.Element; 8 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/fonts/FontGlobalStyle.d.ts: -------------------------------------------------------------------------------- 1 | export declare const FontGlobalStyle = "\n .rek-font-size-select {\n width:60px;\n }\n\n .rek-font-size-select .rek-select-list {\n margin-top:24px;\n max-height:500px;\n }\n\n .rek-font-select input,\n .rek-font-size-select input {\n border: none;\n background-color:rgba(0,0,0,0);\n }\n"; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/mentions/MentionsPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Mention } from "./Mention"; 2 | import { Trigger } from "../../plugins/Trigger"; 3 | export interface StaticMentionOptions { 4 | mentions: Mention[]; 5 | triggers?: Trigger[]; 6 | } 7 | export declare const createStaticMentions: (options: StaticMentionOptions) => import("../../Index").Plugin; 8 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/ui/SaveDialog.d.ts: -------------------------------------------------------------------------------- 1 | import { FunctionComponent } from "react"; 2 | export interface SaveDialogProps { 3 | value?: string; 4 | onSave(value?: string): void; 5 | className?: string; 6 | placeholderText?: string; 7 | saveButtonText?: string; 8 | } 9 | export declare const SaveDialog: FunctionComponent; 10 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/subscript/SubscriptAction.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Action } from "../actions/Action"; 3 | 4 | export interface SubscriptActionProps { 5 | children: React.ReactNode; 6 | } 7 | 8 | export const SubscriptAction = (props: SubscriptActionProps) => { 9 | return ; 10 | }; 11 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/underline/UnderlineAction.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Action } from "../actions/Action"; 3 | 4 | export interface UnderlineActionProps { 5 | children: React.ReactNode; 6 | } 7 | 8 | export const UnderlineAction = (props: UnderlineActionProps) => { 9 | return ; 10 | }; 11 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/code/CodeGlobalStyle.d.ts: -------------------------------------------------------------------------------- 1 | export declare const CodeGlobalStyle = "\n.rek-code-block-toolbar {\n\n input {\n padding:4px;\n height:30px;\n }\n\n .rek-icon.rek-delete-icon path {\n cursor:pointer;\n fill:var(--secondary-text-color); \n }\n\n .rek-icon.rek-delete-icon:hover path {\n fill:var(--danger-color);\n }\n}\n"; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/code/Languages.d.ts: -------------------------------------------------------------------------------- 1 | import "prismjs"; 2 | import "prismjs/components/prism-kotlin"; 3 | import "prismjs/components/prism-swift"; 4 | import "prismjs/components/prism-clojure"; 5 | import "prismjs/components/prism-perl"; 6 | import "prismjs/components/prism-go"; 7 | import "prismjs/components/prism-sql"; 8 | export declare const Languages: any; 9 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/page-divider/PageDividerEditorStyle.d.ts: -------------------------------------------------------------------------------- 1 | export declare const PageDividerEditorStyle = "\n \n .rek-page-divider {\n position: absolute;\n height: 1px;\n left: 0;\n right: 0;\n margin: 0 auto;\n border-top: 1px dotted var(--divider-color);\n }\n @media print {\n .rek-page-divider {\n display:none;\n }\n }\n"; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/blockquote/BlockquoteAction.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Action } from "../actions/Action"; 3 | 4 | export interface BlockquoteActionProps { 5 | children: React.ReactNode; 6 | } 7 | 8 | export const BlockquoteAction = (props: BlockquoteActionProps) => { 9 | return ; 10 | }; 11 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/layout/LayoutEditorStyle.ts: -------------------------------------------------------------------------------- 1 | export const LayoutEditorStyle = ` 2 | .rek-layout { 3 | display:flex; 4 | } 5 | 6 | .rek-layout-cell { 7 | flex-grow:1; 8 | flex-shrink:1; 9 | min-height:10px; 10 | padding:0 8px; 11 | margin:4px; 12 | 13 | border: 1px solid var(--divider-color); 14 | } 15 | 16 | `; 17 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/spoiler/SpoilerPluginAction.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | import { toggleInline } from "../inlines/Inlines"; 3 | 4 | export const SpoilerPluginAction: PluginAction = { 5 | action: ({ editor }) => toggleInline(editor, "spoiler"), 6 | isActionActive: ({ elementType }) => elementType === "spoiler", 7 | }; 8 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/inlines/Inlines.d.ts: -------------------------------------------------------------------------------- 1 | import { ReactEditor } from "slate-react"; 2 | import { Node } from "slate"; 3 | export declare const toggleInline: (editor: ReactEditor, type: string) => Node | undefined; 4 | /** 5 | * Tell Slate that an Element is inline 6 | */ 7 | export declare const registerInline: (editor: ReactEditor, type: string) => ReactEditor; 8 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/inline-code/InlineCodeAction.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Action } from "../actions/Action"; 3 | 4 | export interface InlineCodeActionProps { 5 | children: React.ReactNode; 6 | } 7 | 8 | export const InlineCodeAction = (props: InlineCodeActionProps) => { 9 | return ; 10 | }; 11 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/lists/OrderedListAction.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Action } from "../actions/Action"; 3 | 4 | export interface OrderedListActionProps { 5 | children: React.ReactNode; 6 | } 7 | 8 | export const OrderedListAction = (props: OrderedListActionProps) => { 9 | return ; 10 | }; 11 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/inline-code/InlineCodeEditorStyle.d.ts: -------------------------------------------------------------------------------- 1 | export declare const InlineCodeEditorStyle = "\nspan code {\n font-family:inherit;\n background-color: rgba(9, 30, 66, 0.08);\n box-shadow: rgba(9, 30, 66, 0.08) -4px 0px 0px 0px, rgba(9, 30, 66, 0.08) 4px 0px 0px 0px;\n padding: 2px 0px;\n border-radius: 3px;\n border-style: none;\n margin: 0px 4px;\n}\n"; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/enter/EnterKeyPlugin.tsx: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | import { EnterKeyHandler } from "./EnterKeyHandler"; 3 | 4 | // Allows for soft-breaks when shift key is down when enter key is pressed. 5 | export const EnterKeyPlugin: Plugin = { 6 | name: "enter-handler", 7 | order: 1000, 8 | onKey: [EnterKeyHandler], 9 | }; 10 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/lists/UnorderedListPlugin.ts: -------------------------------------------------------------------------------- 1 | import { createListPlugin } from "./ListPlugin"; 2 | import { UnorderedListEditorStyle } from "./UnorderListEditorStyle"; 3 | 4 | export const UnorderedListPlugin = createListPlugin( 5 | "unordered-list", 6 | "ul", 7 | [{ pattern: /^\s?\*\s/g }, { pattern: /^\s?\-\s/g }], 8 | UnorderedListEditorStyle 9 | ); 10 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/superscript/SuperscriptAction.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Action } from "../actions/Action"; 3 | 4 | export interface SuperscriptActionProps { 5 | children: React.ReactNode; 6 | } 7 | 8 | export const SuperscriptAction = (props: SuperscriptActionProps) => { 9 | return ; 10 | }; 11 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/lists/OrderedListButton.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | export interface OrderedListButtonProps extends IconProps, TooltipContentProps { 5 | } 6 | export declare const OrderedListButton: (props: OrderedListButtonProps) => JSX.Element; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/todo-list/TodoItemElement.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { RenderElementProps } from "slate-react"; 3 | export interface TodoItemElementProps extends RenderElementProps { 4 | placeholder: string; 5 | dateFormatter: (date: Date) => string; 6 | } 7 | export declare const TodoItemElement: (props: TodoItemElementProps) => JSX.Element; 8 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/lists/UnorderListEditorStyle.ts: -------------------------------------------------------------------------------- 1 | export const UnorderedListEditorStyle = ` 2 | ul ul ul ul, 3 | ul { 4 | list-style: square outside none; 5 | } 6 | 7 | ul ul ul ul ul, 8 | ul ul { 9 | list-style: circle outside none; 10 | } 11 | 12 | ul ul ul ul ul ul, 13 | ul ul ul { 14 | list-style: disc outside none; 15 | } 16 | `; 17 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/lists/UnorderedListAction.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Action } from "../actions/Action"; 3 | 4 | export interface UnorderedListActionProps { 5 | children: React.ReactNode; 6 | } 7 | 8 | export const UnorderedListAction = (props: UnorderedListActionProps) => { 9 | return ; 10 | }; 11 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/icons/IconProviderPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | import { Icons } from "./Icons"; 3 | export interface IconProvider extends Plugin { 4 | name: "icon-provider"; 5 | icons: Icons; 6 | } 7 | export declare const createIconProviderPlugin: (icons: Icons) => IconProvider; 8 | export declare const IconProviderPlugin: IconProvider; 9 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/bold/BoldButton.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | import { ActionButton } from "../actions/ActionButton"; 5 | 6 | export const BoldButton = (props: IconProps & TooltipContentProps) => { 7 | return ; 8 | }; 9 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/bold/BoldPluginAction.ts: -------------------------------------------------------------------------------- 1 | import { toggleMark, isMarkActive } from "../marks/Marks"; 2 | import { PluginAction } from "../../plugins/PluginAction"; 3 | 4 | export const BoldPluginAction: PluginAction = { 5 | action: ({ editor }) => { 6 | toggleMark(editor, "bold"); 7 | }, 8 | isActionActive: ({ editor }) => isMarkActive(editor, "bold"), 9 | }; 10 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/initial-letter/InitialLetterAction.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Action } from "../actions/Action"; 3 | 4 | export interface InitialLetterActionProps { 5 | children: React.ReactNode; 6 | } 7 | 8 | export const InitialLetterAction = (props: InitialLetterActionProps) => { 9 | return ; 10 | }; 11 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/links/LinkButton.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { ActionButton } from "../actions/ActionButton"; 4 | import { TooltipContentProps } from "../popup/Tooltip"; 5 | 6 | export const LinkButton = (props: IconProps & TooltipContentProps) => { 7 | return ; 8 | }; 9 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/strikethrough/StrikethroughAction.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Action } from "../actions/Action"; 3 | 4 | export interface StrikethroughActionProps { 5 | children: React.ReactNode; 6 | } 7 | 8 | export const StrikethroughAction = (props: StrikethroughActionProps) => { 9 | return ; 10 | }; 11 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/todo-list/TodoListElement.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { RenderElementProps } from "slate-react"; 3 | 4 | export const TodoListElement = (props: RenderElementProps) => { 5 | const { children, attributes } = props; 6 | return ( 7 |
8 | {children} 9 |
10 | ); 11 | }; 12 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/elements/DeletableElement.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { RenderElementProps } from "slate-react"; 3 | export interface DeletableElementProps extends RenderElementProps { 4 | className?: string; 5 | toolbarContent?: JSX.Element | JSX.Element[]; 6 | } 7 | export declare const DeletableElement: (props: DeletableElementProps) => JSX.Element; 8 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/fonts/FontSizeSelect.d.ts: -------------------------------------------------------------------------------- 1 | import { FunctionComponent } from "react"; 2 | import { TooltipContentProps } from "../popup/Tooltip"; 3 | export interface FontSizeSelectProps extends TooltipContentProps { 4 | fontSizes?: number[]; 5 | } 6 | export declare const FontSizeSelect: FunctionComponent; 7 | export declare const DefaultFontSizes: number[]; 8 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/lists/UnorderedListButton.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | export interface UnorderedListButtonProps extends IconProps, TooltipContentProps { 5 | } 6 | export declare const UnorderedListButton: (props: UnorderedListButtonProps) => JSX.Element; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/headings/H3Action.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { HeadingAction } from "./HeadingAction"; 3 | 4 | export interface H3ActionProps { 5 | children: React.ReactNode; 6 | } 7 | 8 | export const H3Action = (props: H3ActionProps) => { 9 | const { children } = props; 10 | return {children}; 11 | }; 12 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/lists/OrderListEditorStyle.ts: -------------------------------------------------------------------------------- 1 | export const OrderedListEditorStyle = ` 2 | ol ol ol ol, 3 | ol { 4 | list-style: decimal outside none; 5 | } 6 | 7 | ol ol ol ol ol, 8 | ol ol { 9 | list-style: lower-latin outside none; 10 | } 11 | 12 | ol ol ol ol ol ol, 13 | ol ol ol { 14 | list-style: lower-roman outside none; 15 | } 16 | `; 17 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/table/TableButton.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { ActionButton } from "../actions/ActionButton"; 4 | import { TooltipContentProps } from "../popup/Tooltip"; 5 | 6 | export const TableButton = (props: IconProps & TooltipContentProps) => { 7 | return ; 8 | }; 9 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/video/VideoButton.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | import { ActionButton } from "../actions/ActionButton"; 5 | 6 | export const VideoButton = (props: IconProps & TooltipContentProps) => { 7 | return ; 8 | }; 9 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/suggestions/SuggestionList.d.ts: -------------------------------------------------------------------------------- 1 | import * as React from "react"; 2 | import { Suggestions } from "./Suggestions"; 3 | export interface SuggestionListProps { 4 | match: string; 5 | suggestions: Suggestions; 6 | onChoice(choice?: Object): void; 7 | } 8 | export declare const SuggestionList: React.MemoExoticComponent<(props: SuggestionListProps) => JSX.Element>; 9 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/clear-formatting/ClearFormattingPluginAction.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | 3 | export const ClearFormattingPluginAction: PluginAction = { 4 | action: (state, plugin) => { 5 | plugin.formats.forEach((mark: string) => { 6 | state.editor.removeMark(mark); 7 | }); 8 | }, 9 | isActionActive: () => false, 10 | }; 11 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/italic/ItalicButton.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { TooltipContentProps } from "../popup/Tooltip"; 3 | import { IconProps } from "../buttons/IconButton"; 4 | import { ActionButton } from "../actions/ActionButton"; 5 | 6 | export const ItalicButton = (props: IconProps & TooltipContentProps) => { 7 | return ; 8 | }; 9 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/italic/ItalicPluginAction.ts: -------------------------------------------------------------------------------- 1 | import { toggleMark, isMarkActive } from "../marks/Marks"; 2 | import { PluginAction } from "../../plugins/PluginAction"; 3 | 4 | export const ItalicPluginAction: PluginAction = { 5 | action: ({ editor }) => { 6 | toggleMark(editor, "italic"); 7 | }, 8 | isActionActive: ({ editor }) => isMarkActive(editor, "italic"), 9 | }; 10 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/layout/LayoutMenuItem.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | import { LayoutActionProps } from "./LayoutAction"; 4 | export interface LayoutMenuItemProps extends Omit, Omit { 5 | } 6 | export declare const LayoutMenuItem: (props: LayoutMenuItemProps) => JSX.Element; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/lists/ListPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | import { ReactEditor } from "slate-react"; 3 | import { Trigger } from "../../plugins/Trigger"; 4 | export declare const createListPlugin: (type: string, reactType: string, triggers: Trigger[], editorStyle: string) => Plugin; 5 | export declare const toggleList: (editor: ReactEditor, type: string) => void; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/popup/PopupContent.d.ts: -------------------------------------------------------------------------------- 1 | import React, { CSSProperties } from "react"; 2 | export interface PopupContentProps extends React.HTMLAttributes { 3 | children: React.ReactNode; 4 | style?: CSSProperties; 5 | } 6 | export declare const PopupContent: React.MemoExoticComponent>>; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/bold/BoldMenuItem.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | import { MarkMenuItem } from "../marks/MarkMenuItem"; 4 | 5 | export interface BoldMenuItemProps extends Partial {} 6 | 7 | export const BoldMenuItem = (props: BoldMenuItemProps) => { 8 | return ; 9 | }; 10 | -------------------------------------------------------------------------------- /packages/editor-kit/src/ui/Show.tsx: -------------------------------------------------------------------------------- 1 | import React, { Fragment, ReactNode } from "react"; 2 | 3 | export interface ShowProps { 4 | when: any | undefined | null; 5 | children: ReactNode; 6 | } 7 | 8 | export const Show = (props: ShowProps) => { 9 | const { when, children } = props; 10 | if (!Boolean(when)) { 11 | return null; 12 | } 13 | return {children}; 14 | }; 15 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/alert/AlertPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | import { PluginAction } from "../../plugins/PluginAction"; 3 | import { Icons } from "../icons/Icons"; 4 | export declare const AlertActions: PluginAction[]; 5 | export declare const createAlertPlugin: (icon: keyof Icons, name: string, iconColor: string, backgroundColor: string, trigger: string) => Plugin; 6 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/elements/ElementWrapper.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { RenderElementProps } from "slate-react"; 3 | export interface ElementWrapperProps extends RenderElementProps { 4 | className?: string; 5 | focusToolbar?: JSX.Element | JSX.Element[]; 6 | inline?: boolean; 7 | } 8 | export declare const ElementWrapper: (props: ElementWrapperProps) => JSX.Element; 9 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/mentions/MentionGlobalStyle.d.ts: -------------------------------------------------------------------------------- 1 | export declare const MentionGlobalStyle = "\n.rek-mention-choice {\n display:flex;\n align-items:center;\n padding:4px;\n \n img {\n border-radius:50%;\n height:30px;\n width:30px;\n margin-right:16px;\n } \n\n .rek-mention-subtext {\n margin-left:8px;\n color:var(--secondary-text-color);\n font-size:smaller;\n }\n}\n"; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/menu/MenuButton.d.ts: -------------------------------------------------------------------------------- 1 | import { FunctionComponent } from "react"; 2 | import { MenuProps } from "./Menu"; 3 | import { IconProps } from "../buttons/IconButton"; 4 | export interface MenuButtonProps extends IconProps, Omit { 5 | disabled?: boolean; 6 | menuClassName?: string; 7 | } 8 | export declare const MenuButton: FunctionComponent; 9 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/toolbar/SelectionToolbar.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { Location, Offsets } from "../popup/Popups"; 3 | export interface SelectionToolbarProps { 4 | children: JSX.Element[]; 5 | location?: Location; 6 | offsets?: Offsets; 7 | delay?: number; 8 | } 9 | export declare const SelectionToolbar: (props: SelectionToolbarProps) => JSX.Element; 10 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/alert/AlertAction.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Action } from "../actions/Action"; 3 | 4 | export interface AlertActionProps { 5 | children: React.ReactNode; 6 | type: string; 7 | } 8 | 9 | export const AlertAction = (props: AlertActionProps) => { 10 | const { children, type } = props; 11 | return {children}; 12 | }; 13 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/icons/material-regular/PlusIcon.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export const PlusIcon = (props: React.SVGProps) => ( 4 | 11 | 12 | 13 | ); 14 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/inline-code/InlineCodeEditorStyle.ts: -------------------------------------------------------------------------------- 1 | export const InlineCodeEditorStyle = ` 2 | span code { 3 | font-family:inherit; 4 | background-color: rgba(9, 30, 66, 0.08); 5 | box-shadow: rgba(9, 30, 66, 0.08) -4px 0px 0px 0px, rgba(9, 30, 66, 0.08) 4px 0px 0px 0px; 6 | padding: 2px 0px; 7 | border-radius: 3px; 8 | border-style: none; 9 | margin: 0px 4px; 10 | } 11 | `; 12 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/subscript/SubscriptButton.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { TooltipContentProps } from "../popup/Tooltip"; 3 | import { IconProps } from "../buttons/IconButton"; 4 | import { ActionButton } from "../actions/ActionButton"; 5 | 6 | export const SubscriptButton = (props: IconProps & TooltipContentProps) => { 7 | return ; 8 | }; 9 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/todo-list/TodoListButton.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | import { ActionButton } from "../actions/ActionButton"; 5 | 6 | export const TodoListButton = (props: IconProps & TooltipContentProps) => { 7 | return ; 8 | }; 9 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/underline/UnderlineButton.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { TooltipContentProps } from "../popup/Tooltip"; 3 | import { IconProps } from "../buttons/IconButton"; 4 | import { ActionButton } from "../actions/ActionButton"; 5 | 6 | export const UnderlineButton = (props: IconProps & TooltipContentProps) => { 7 | return ; 8 | }; 9 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/spoiler/SpoilerEditorStyle.d.ts: -------------------------------------------------------------------------------- 1 | export declare const SpoilerEditorStyle = "\n.rek-spoiler {\n background-color: rgba(0,0,0,.95);\n display:inline-block;\n color: white;\n}\n\n.rek-spoiler.showspoiler {\n background-color: unset;\n color: var(--primary-text-color);\n}\n\n.rek-spoiler.hidespoiler {\n background-color: rgba(0,0,0,.95);\n color: transparent;\n pointer:cursor;\n}\n"; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/table/TableElementMenuItem.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | import { Element } from "slate"; 4 | export interface TableElementMenuItemProps extends Partial { 5 | table: Element; 6 | property: string; 7 | } 8 | export declare const TableElementMenuItem: (props: TableElementMenuItemProps) => JSX.Element; 9 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/blockquote/BlockquoteButton.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | import { ActionButton } from "../actions/ActionButton"; 5 | 6 | export const BlockquoteButton = (props: IconProps & TooltipContentProps) => { 7 | return ; 8 | }; 9 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/blockquote/BlockquotePluginAction.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | import { toggleElement } from "../elements/Elements"; 3 | 4 | export const BlockquotePluginAction: PluginAction = { 5 | action: ({ editor }) => { 6 | toggleElement(editor, "blockquote"); 7 | }, 8 | isActionActive: ({ elementType }) => elementType == "blockquote", 9 | }; 10 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/fonts/FontGlobalStyle.ts: -------------------------------------------------------------------------------- 1 | export const FontGlobalStyle = ` 2 | .rek-font-size-select { 3 | width:60px; 4 | } 5 | 6 | .rek-font-size-select .rek-select-list { 7 | margin-top:24px; 8 | max-height:500px; 9 | } 10 | 11 | .rek-font-select input, 12 | .rek-font-size-select input { 13 | border: none; 14 | background-color:rgba(0,0,0,0); 15 | } 16 | `; 17 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/inline-code/InlineCodeButton.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { TooltipContentProps } from "../popup/Tooltip"; 3 | import { IconProps } from "../buttons/IconButton"; 4 | import { ActionButton } from "../actions/ActionButton"; 5 | 6 | export const InlineCodeButton = (props: IconProps & TooltipContentProps) => { 7 | return ; 8 | }; 9 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/italic/ItalicMenuItem.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | import { MarkMenuItem } from "../marks/MarkMenuItem"; 4 | 5 | export interface ItalicMenuItemProps extends Partial {} 6 | 7 | export const ItalicMenuItem = (props: ItalicMenuItemProps) => { 8 | return ; 9 | }; 10 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/subscript/SubscriptPluginAction.ts: -------------------------------------------------------------------------------- 1 | import { toggleMark, isMarkActive } from "../marks/Marks"; 2 | import { PluginAction } from "../../plugins/PluginAction"; 3 | 4 | export const SubscriptPluginAction: PluginAction = { 5 | action: ({ editor }) => { 6 | toggleMark(editor, "subscript"); 7 | }, 8 | isActionActive: ({ editor }) => isMarkActive(editor, "subscript"), 9 | }; 10 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/underline/UnderlinePluginAction.ts: -------------------------------------------------------------------------------- 1 | import { toggleMark, isMarkActive } from "../marks/Marks"; 2 | import { PluginAction } from "../../plugins/PluginAction"; 3 | 4 | export const UnderlinePluginAction: PluginAction = { 5 | action: ({ editor }) => { 6 | toggleMark(editor, "underline"); 7 | }, 8 | isActionActive: ({ editor }) => isMarkActive(editor, "underline"), 9 | }; 10 | -------------------------------------------------------------------------------- /packages/editor-kit/src/ui/Layers.ts: -------------------------------------------------------------------------------- 1 | export const PopupMarkerLayer = -1; 2 | export const EditorLayer = 1; 3 | export const FocusedLayer = 2; 4 | export const ResizeHandleLayer = 999; 5 | 6 | export const MenuLayer = 900; 7 | export const MenuItemLayer = MenuLayer + 1; 8 | export const HoverItemLayer = MenuItemLayer + 1; 9 | 10 | export const OverlayLayer = 1001; 11 | export const PopupContentLayer = 1001; 12 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/headings/HeadingToggleButton.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | export interface HeadingToggleButtonProps extends IconProps, TooltipContentProps { 5 | heading?: string; 6 | } 7 | export declare const HeadingToggleButton: (props: HeadingToggleButtonProps) => JSX.Element; 8 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/page-divider/PageDividerEditorStyle.ts: -------------------------------------------------------------------------------- 1 | export const PageDividerEditorStyle = ` 2 | 3 | .rek-page-divider { 4 | position: absolute; 5 | height: 1px; 6 | left: 0; 7 | right: 0; 8 | margin: 0 auto; 9 | border-top: 1px dotted var(--divider-color); 10 | } 11 | @media print { 12 | .rek-page-divider { 13 | display:none; 14 | } 15 | } 16 | `; 17 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/readonly/ReadOnlyButton.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { IconButtonProps } from "../buttons/IconButton"; 3 | export interface ReadOnlyButtonProps extends IconButtonProps { 4 | readOnlyClassName: string; 5 | readOnlyLigature: string; 6 | onMouseDown?(event: React.MouseEvent): void; 7 | } 8 | export declare const ReadOnlyButton: (props: ReadOnlyButtonProps) => JSX.Element; 9 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/video/VideoElement.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { RenderElementProps } from "slate-react"; 3 | export declare const VideoElement: React.MemoExoticComponent<(props: RenderElementProps) => JSX.Element>; 4 | export interface VideoSettingsProps extends RenderElementProps { 5 | } 6 | export declare const VideoSettings: React.MemoExoticComponent<(props: VideoSettingsProps) => JSX.Element>; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/code/CodePluginAction.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | 3 | export const CodePluginAction: PluginAction = { 4 | action: ({ editor }) => { 5 | editor.insertNode({ 6 | type: "code", 7 | children: [{ text: "" }], 8 | lang: "JavaScript", 9 | }); 10 | }, 11 | isActionActive: ({ elementType }) => elementType === "code", 12 | }; 13 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/headings/HeadingAction.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Action } from "../actions/Action"; 3 | 4 | export interface HeadingActionProps { 5 | heading: string; 6 | children: React.ReactNode; 7 | } 8 | 9 | export const HeadingAction = (props: HeadingActionProps) => { 10 | const { heading, ...rest } = props; 11 | 12 | return ; 13 | }; 14 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/inline-code/InlineCodePluginAction.ts: -------------------------------------------------------------------------------- 1 | import { toggleMark, isMarkActive } from "../marks/Marks"; 2 | import { PluginAction } from "../../plugins/PluginAction"; 3 | 4 | export const InlineCodePluginAction: PluginAction = { 5 | action: (state) => { 6 | toggleMark(state.editor, "inline-code"); 7 | }, 8 | isActionActive: (state) => isMarkActive(state.editor, "inline-code"), 9 | }; 10 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/strikethrough/StrikethroughButton.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { TooltipContentProps } from "../popup/Tooltip"; 3 | import { IconProps } from "../buttons/IconButton"; 4 | import { ActionButton } from "../actions/ActionButton"; 5 | 6 | export const StrikethroughButton = (props: IconProps & TooltipContentProps) => { 7 | return ; 8 | }; 9 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/suggestions/Suggestions.ts: -------------------------------------------------------------------------------- 1 | import { RenderElementProps } from "slate-react"; 2 | import { Trigger } from "../../plugins/Trigger"; 3 | 4 | export interface Suggestions { 5 | getSuggestions(match: string): Promise; 6 | renderChoice(choice: any): any; 7 | triggers: Trigger[]; 8 | renderSuggestion(props: RenderElementProps): JSX.Element; 9 | renderLoading?(): any; 10 | } 11 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/superscript/SuperscriptIconButton.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | import { ActionButton } from "../actions/ActionButton"; 5 | 6 | export const SuperscriptButton = (props: IconProps & TooltipContentProps) => { 7 | return ; 8 | }; 9 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/superscript/SuperscriptPluginAction.ts: -------------------------------------------------------------------------------- 1 | import { toggleMark, isMarkActive } from "../marks/Marks"; 2 | import { PluginAction } from "../../plugins/PluginAction"; 3 | 4 | export const SuperscriptPluginAction: PluginAction = { 5 | action: ({ editor }) => { 6 | toggleMark(editor, "superscript"); 7 | }, 8 | isActionActive: ({ editor }) => isMarkActive(editor, "superscript"), 9 | }; 10 | -------------------------------------------------------------------------------- /packages/website/src/ui/Theme.ts: -------------------------------------------------------------------------------- 1 | export const Theme = { 2 | primaryColor: "var(--site-primary-color)", 3 | backgroundColor: "var(--site-background-color)", 4 | secondaryTextLightColor: "var(--site-secondary-text-color)", 5 | lightTextColor: "var(--site-light-text-color)", 6 | corners: { 7 | md: "6px" 8 | }, 9 | fontSizes: { 10 | xl: "42px", 11 | lg: "30px", 12 | md: "20px" 13 | } 14 | }; 15 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/images/ImagePlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | import { ReactEditor } from "slate-react"; 3 | import { Location } from "slate"; 4 | export declare const ImagePlugin: Plugin; 5 | export declare const isImageUrl: (url: string, extensions?: string[]) => boolean; 6 | export declare const insertImage: (editor: ReactEditor, url: string, location?: Location | undefined) => void; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/suggestions/SuggestionsPlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | import { Suggestions } from "./Suggestions"; 3 | export interface SuggestionPluginOptions { 4 | type: string; 5 | suggestions: Suggestions; 6 | globalStyle?: string; 7 | editorStyle?: string; 8 | } 9 | export declare const createSuggestionsPlugin: (options: SuggestionPluginOptions) => Plugin; 10 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/bold/BoldToggleKeyHandler.ts: -------------------------------------------------------------------------------- 1 | import { toggleMark } from "../marks/Marks"; 2 | import { blockEvent } from "../../ui/Utils"; 3 | import { KeyHandler } from "../../plugins/KeyHandler"; 4 | 5 | export const BoldToggleKeyHandler: KeyHandler = { 6 | pattern: "mod+b", 7 | handle: (state, event) => { 8 | toggleMark(state.editor, "bold"); 9 | return blockEvent(event); 10 | }, 11 | }; 12 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/code/CodeGlobalStyle.ts: -------------------------------------------------------------------------------- 1 | export const CodeGlobalStyle = ` 2 | .rek-code-block-toolbar { 3 | 4 | input { 5 | padding:4px; 6 | height:30px; 7 | } 8 | 9 | .rek-icon.rek-delete-icon path { 10 | cursor:pointer; 11 | fill:var(--secondary-text-color); 12 | } 13 | 14 | .rek-icon.rek-delete-icon:hover path { 15 | fill:var(--danger-color); 16 | } 17 | } 18 | `; 19 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/initial-letter/InitialLetterButton.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | import { ActionButton } from "../actions/ActionButton"; 5 | 6 | export const InitialLetterButton = (props: IconProps & TooltipContentProps) => { 7 | return ; 8 | }; 9 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/suggestions/Suggestion.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { RenderLeafProps } from "slate-react"; 3 | import { Suggestions } from "./Suggestions"; 4 | export interface SuggestionProps extends RenderLeafProps { 5 | suggestions: Suggestions; 6 | type: string; 7 | onChoice(choice?: any): void; 8 | } 9 | export declare const Suggestion: (props: SuggestionProps) => JSX.Element; 10 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/code/CodeTabKeyHandler.ts: -------------------------------------------------------------------------------- 1 | import { KeyHandler } from "../../plugins/KeyHandler"; 2 | 3 | export const CodeTabKeyHandler: KeyHandler = { 4 | pattern: "tab", 5 | handle: ({ editor, element }, event) => { 6 | if (element && element.type === "code") { 7 | editor.insertText("\t"); 8 | event.preventDefault(); 9 | return true; 10 | } 11 | return false; 12 | }, 13 | }; 14 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/italic/ItalicToggleKeyHandler.ts: -------------------------------------------------------------------------------- 1 | import { KeyHandler } from "../../plugins/KeyHandler"; 2 | import { toggleMark } from "../marks/Marks"; 3 | import { blockEvent } from "../../ui/Utils"; 4 | 5 | export const ItalicToggleKeyHandler: KeyHandler = { 6 | pattern: "mod+i", 7 | handle: ({ editor }, event) => { 8 | toggleMark(editor, "italic"); 9 | return blockEvent(event); 10 | }, 11 | }; 12 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/strikethrough/StrikethroughPluginAction.ts: -------------------------------------------------------------------------------- 1 | import { toggleMark, isMarkActive } from "../marks/Marks"; 2 | import { PluginAction } from "../../plugins/PluginAction"; 3 | 4 | export const StrikethroughPluginAction: PluginAction = { 5 | action: ({ editor }) => { 6 | toggleMark(editor, "strikethrough"); 7 | }, 8 | isActionActive: ({ editor }) => isMarkActive(editor, "strikethrough"), 9 | }; 10 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/subscript/SubscriptMenuItem.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | import { MarkMenuItem } from "../marks/MarkMenuItem"; 4 | 5 | export interface SubscriptMenuItemProps extends Partial {} 6 | 7 | export const SubscriptMenuItem = (props: SubscriptMenuItemProps) => { 8 | return ; 9 | }; 10 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/theme/DefaultThemePlugin.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | import { DefaultThemeEditorStyle } from "./DefaultThemeEditorStyle"; 3 | import { DefaultThemeGlobalStyle } from "./DefaultThemeGlobalStyle"; 4 | 5 | export const DefaultThemePlugin: Plugin = { 6 | name: "default-theme", 7 | editorStyle: DefaultThemeEditorStyle, 8 | globalStyle: DefaultThemeGlobalStyle, 9 | }; 10 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/underline/UnderlineMenuItem.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | import { MarkMenuItem } from "../marks/MarkMenuItem"; 4 | 5 | export interface UnderlineMenuItemProps extends Partial {} 6 | 7 | export const UnderlineMenuItem = (props: UnderlineMenuItemProps) => { 8 | return ; 9 | }; 10 | -------------------------------------------------------------------------------- /packages/examples/src/Index.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import ReactDOM from "react-dom"; 3 | import { GoogleDocsEditor } from "./googledocs/GoogleDocsEditor"; 4 | import { RedditEditor } from "./reddit/RedditEditor"; 5 | 6 | const App = () => { 7 | return ( 8 |
9 | 10 |
11 | ); 12 | }; 13 | 14 | ReactDOM.render(, document.getElementById("app")); 15 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/images/UploadImageMenuItem.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | import { UploadImageActionProps } from "./UploadImageAction"; 4 | export interface UploadImageMenuItemProps extends Omit, Omit { 5 | } 6 | export declare const UploadImageMenuItem: (props: UploadImageMenuItemProps) => JSX.Element; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/inline-code/InlineCodeMarkdownTrigger.ts: -------------------------------------------------------------------------------- 1 | import { applyRegexMark } from "../marks/Marks"; 2 | import { Trigger } from "../../plugins/Trigger"; 3 | 4 | export const InlineCodeMarkdownTrigger: Trigger = { 5 | pattern: /(`)([^`]+)\1/, 6 | range: "line-before", 7 | onMatch: (state, matches) => { 8 | applyRegexMark(state.editor, matches[0], "inline-code"); 9 | }, 10 | clear: false, 11 | }; 12 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/inline-code/InlineCodeMenuItem.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | import { MarkMenuItem } from "../marks/MarkMenuItem"; 4 | 5 | export interface InlineCodeMenuItemProps extends Partial {} 6 | 7 | export const InlineCodeMenuItem = (props: InlineCodeMenuItemProps) => { 8 | return ; 9 | }; 10 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/void/VoidElement.ts: -------------------------------------------------------------------------------- 1 | import { ReactEditor } from "slate-react"; 2 | 3 | /** 4 | * Tell Slate that an Element is void 5 | */ 6 | export const registerVoid = ( 7 | editor: ReactEditor, 8 | type: string 9 | ): ReactEditor => { 10 | const { isVoid } = editor; 11 | editor.isVoid = (element) => { 12 | return element.type === type ? true : isVoid(element); 13 | }; 14 | return editor; 15 | }; 16 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/initial-letter/InitialLetterPluginAction.d.ts: -------------------------------------------------------------------------------- 1 | import { Range } from "slate"; 2 | import { ReactEditor } from "slate-react"; 3 | import { PluginAction } from "../../plugins/PluginAction"; 4 | export declare const InitialLetterPluginAction: PluginAction; 5 | export declare const isInitialLetterActive: (editor: ReactEditor) => any; 6 | export declare const findInitialLetterRange: (editor: ReactEditor) => Range | null; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/clear-formatting/ClearFormattingAction.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Action } from "../actions/Action"; 3 | 4 | export interface ClearFormattingActionProps { 5 | children: React.ReactNode; 6 | } 7 | 8 | export const ClearFormattingAction = (props: ClearFormattingActionProps) => { 9 | const { children } = props; 10 | return {children}; 11 | }; 12 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/superscript/SuperscriptMenuItem.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | import { MarkMenuItem } from "../marks/MarkMenuItem"; 4 | 5 | export interface SuperscriptMenuItemProps extends Partial {} 6 | 7 | export const SuperscriptMenuItem = (props: SuperscriptMenuItemProps) => { 8 | return ; 9 | }; 10 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/underline/UnderlineToggleKeyHandler.ts: -------------------------------------------------------------------------------- 1 | import { KeyHandler } from "../../plugins/KeyHandler"; 2 | import { toggleMark } from "../marks/Marks"; 3 | import { blockEvent } from "../../ui/Utils"; 4 | 5 | export const UnderlineToggleKeyHandler: KeyHandler = { 6 | pattern: "mod+u", 7 | handle: ({ editor }, event) => { 8 | toggleMark(editor, "underline"); 9 | return blockEvent(event); 10 | }, 11 | }; 12 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/actions/ActionButton.d.ts: -------------------------------------------------------------------------------- 1 | import { FunctionComponent } from "react"; 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | import { ActionProps } from "./Action"; 5 | export interface ActionButtonProps extends IconProps, Omit, TooltipContentProps { 6 | } 7 | export declare const ActionButton: FunctionComponent; 8 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/toolbar/EditorToolbar.d.ts: -------------------------------------------------------------------------------- 1 | import React, { CSSProperties } from "react"; 2 | export interface EditorToolbarProps { 3 | children: JSX.Element[]; 4 | className?: string; 5 | overflowStrategy?: OverflowStrategy; 6 | style?: CSSProperties; 7 | } 8 | export declare enum OverflowStrategy { 9 | Wrap = 0, 10 | Menu = 1 11 | } 12 | export declare const EditorToolbar: React.FC; 13 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/icons/material-regular/DeleteIcon.tsx: -------------------------------------------------------------------------------- 1 | import React, { Fragment } from "react"; 2 | 3 | export const DeleteIcon = () => ( 4 | 5 | 6 | 10 | 11 | 12 | ); 13 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/ui/Layers.d.ts: -------------------------------------------------------------------------------- 1 | export declare const PopupMarkerLayer = -1; 2 | export declare const EditorLayer = 1; 3 | export declare const FocusedLayer = 2; 4 | export declare const ResizeHandleLayer = 999; 5 | export declare const MenuLayer = 900; 6 | export declare const MenuItemLayer: number; 7 | export declare const HoverItemLayer: number; 8 | export declare const OverlayLayer = 1001; 9 | export declare const PopupContentLayer = 1001; 10 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/code/CodeMenuItem.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { MenuItemProps, MenuItem } from "../menu/MenuItem"; 3 | import { CodeAction } from "./CodeAction"; 4 | 5 | export interface CodeMenuItemProps extends Partial {} 6 | 7 | export const CodeMenuItem = (props: CodeMenuItemProps) => { 8 | return ( 9 | 10 | 11 | 12 | ); 13 | }; 14 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/links/LinkMenuItem.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { MenuItemProps, MenuItem } from "../menu/MenuItem"; 3 | import { LinkAction } from "./LinkAction"; 4 | 5 | export interface LinkMenuItemProps extends Partial {} 6 | 7 | export const LinkMenuItem = (props: LinkMenuItemProps) => { 8 | return ( 9 | 10 | 11 | 12 | ); 13 | }; 14 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/editor/Matching.d.ts: -------------------------------------------------------------------------------- 1 | import { Range } from "slate"; 2 | import { ReactEditor } from "slate-react"; 3 | import { EditorRange } from "./Ranges"; 4 | export declare type MatchExpression = string | RegExp; 5 | export interface MatchResult { 6 | range: Range; 7 | regexMatch?: RegExpMatchArray; 8 | } 9 | export declare const findMatches: (expression: MatchExpression, editor: ReactEditor, range?: EditorRange) => MatchResult[]; 10 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/images/InsertImageByUrlMenuItem.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | import { UploadImageActionProps } from "./UploadImageAction"; 4 | export interface InsertImageByUrlMenuItemProps extends Omit, Omit { 5 | } 6 | export declare const InsertImageByUrlMenuItem: (props: InsertImageByUrlMenuItemProps) => JSX.Element; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/resizable/Resizable.d.ts: -------------------------------------------------------------------------------- 1 | import React, { CSSProperties } from "react"; 2 | import { RenderElementProps } from "slate-react"; 3 | export interface ResizableProps extends Partial { 4 | children: React.ReactNode; 5 | style?: CSSProperties; 6 | initialWidth: string | number; 7 | onChange?(width: number): void; 8 | } 9 | export declare const Resizable: (props: ResizableProps) => JSX.Element; 10 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/clear-formatting/ClearFormattingButton.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { ActionButton } from "../actions/ActionButton"; 3 | import { IconProps } from "../buttons/IconButton"; 4 | import { TooltipContentProps } from "../popup/Tooltip"; 5 | 6 | export const ClearFormattingButton = ( 7 | props: IconProps & TooltipContentProps 8 | ) => { 9 | return ; 10 | }; 11 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/strikethrough/StrikethroughMenuItem.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { MenuItemProps } from "../menu/MenuItem"; 3 | import { MarkMenuItem } from "../marks/MarkMenuItem"; 4 | 5 | export interface StrikethroughMenuItemProps extends Partial {} 6 | 7 | export const StrikethroughMenuItem = (props: StrikethroughMenuItemProps) => { 8 | return ; 9 | }; 10 | -------------------------------------------------------------------------------- /packages/editor-kit/src/plugins/usePlugin.ts: -------------------------------------------------------------------------------- 1 | import { useEditorKit } from "../editor/EditorKit"; 2 | import { Plugin } from "./Plugin"; 3 | 4 | export const usePlugin = (name: string): T => { 5 | const { plugins } = useEditorKit(); 6 | const plugin = plugins.find((plugin) => plugin.name === name); 7 | if (!plugin) { 8 | throw Error(`No plugin with name ${name} has been registered`); 9 | } 10 | return plugin as T; 11 | }; 12 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/suggestions/Suggestions.d.ts: -------------------------------------------------------------------------------- 1 | /// 2 | import { RenderElementProps } from "slate-react"; 3 | import { Trigger } from "../../plugins/Trigger"; 4 | export interface Suggestions { 5 | getSuggestions(match: string): Promise; 6 | renderChoice(choice: any): any; 7 | triggers: Trigger[]; 8 | renderSuggestion(props: RenderElementProps): JSX.Element; 9 | renderLoading?(): any; 10 | } 11 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/code/CodeDeleteKeyHandler.ts: -------------------------------------------------------------------------------- 1 | import { KeyHandler } from "../../plugins/KeyHandler"; 2 | 3 | export const CodeDeleteKeyHandler: KeyHandler = { 4 | pattern: "delete", 5 | handle: ({ element, isElementEmpty }, event) => { 6 | if (element && element.type === "code") { 7 | if (isElementEmpty) { 8 | event.preventDefault(); 9 | return true; 10 | } 11 | } 12 | return false; 13 | }, 14 | }; 15 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/elements/ElementRenderer.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { RenderElementProps } from "slate-react"; 3 | 4 | export const renderElement = ( 5 | props: RenderElementProps, 6 | elementType: string, 7 | reactType: string 8 | ) => { 9 | const { children, attributes, element } = props; 10 | if (element.type === elementType) { 11 | return React.createElement(reactType, attributes, children); 12 | } 13 | }; 14 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/strikethrough/StrikethroughToggleKeyHandler.ts: -------------------------------------------------------------------------------- 1 | import { toggleMark } from "../marks/Marks"; 2 | import { blockEvent } from "../../ui/Utils"; 3 | import { KeyHandler } from "../../plugins/KeyHandler"; 4 | 5 | export const StrikethroughToggleKeyHandler: KeyHandler = { 6 | pattern: "mod+y", 7 | handle: (state, event) => { 8 | toggleMark(state.editor, "strikethrough"); 9 | return blockEvent(event); 10 | }, 11 | }; 12 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/table/TableMenuItem.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { MenuItemProps, MenuItem } from "../menu/MenuItem"; 3 | import { TableAction } from "./TableAction"; 4 | 5 | export interface TableMenuItemProps extends Partial {} 6 | 7 | export const TableMenuItem = (props: TableMenuItemProps) => { 8 | return ( 9 | 10 | 11 | 12 | ); 13 | }; 14 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/video/VideoMenuItem.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { MenuItemProps, MenuItem } from "../menu/MenuItem"; 3 | import { VideoAction } from "./VideoAction"; 4 | 5 | export interface VideoMenuItemProps extends Partial {} 6 | 7 | export const VideoMenuItem = (props: VideoMenuItemProps) => { 8 | return ( 9 | 10 | 11 | 12 | ); 13 | }; 14 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/divider/DividerElement.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { RenderElementProps } from "slate-react"; 3 | 4 | export const DividerElement = (props: RenderElementProps) => { 5 | const { attributes, element, children } = props; 6 | const borderTopWidth = element.size; 7 | return ( 8 |
9 | {...children} 10 |
11 | ); 12 | }; 13 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/i18n/LabelsPlugin.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | import { EnglishLabels } from "./EnglishLabels"; 3 | import { EditorLabels } from "./EditorLabels"; 4 | 5 | export interface LabelsPlugin extends Plugin { 6 | name: "label-provider"; 7 | labels: EditorLabels; 8 | } 9 | 10 | export const createLabelsPlugin = (labels = EnglishLabels): LabelsPlugin => ({ 11 | name: "label-provider", 12 | labels, 13 | }); 14 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/layout/LayoutAction.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Action } from "../actions/Action"; 3 | 4 | export interface LayoutActionProps { 5 | children: React.ReactNode; 6 | layout: number[]; 7 | } 8 | 9 | export const LayoutAction = (props: LayoutActionProps) => { 10 | const { layout, ...rest } = props; 11 | return ( 12 | 13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /packages/examples/webserver.js: -------------------------------------------------------------------------------- 1 | "use strict"; 2 | 3 | var liveServer = require("live-server"); 4 | 5 | const internalIp = require("internal-ip"); 6 | 7 | (async () => { 8 | const ip = await internalIp.v4(); 9 | // See https://www.npmjs.com/package/live-server#usage-from-node 10 | var params = { 11 | host: ip, 12 | port: 8090, 13 | root: ".", 14 | file: "index.html", 15 | logLevel: 0 16 | }; 17 | liveServer.start(params); 18 | })(); 19 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/mentions/MentionGlobalStyle.ts: -------------------------------------------------------------------------------- 1 | export const MentionGlobalStyle = ` 2 | .rek-mention-choice { 3 | display:flex; 4 | align-items:center; 5 | padding:4px; 6 | 7 | img { 8 | border-radius:50%; 9 | height:30px; 10 | width:30px; 11 | margin-right:16px; 12 | } 13 | 14 | .rek-mention-subtext { 15 | margin-left:8px; 16 | color:var(--secondary-text-color); 17 | font-size:smaller; 18 | } 19 | } 20 | `; 21 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/spoiler/SpoilerEditorStyle.ts: -------------------------------------------------------------------------------- 1 | export const SpoilerEditorStyle = ` 2 | .rek-spoiler { 3 | background-color: rgba(0,0,0,.95); 4 | display:inline-block; 5 | color: white; 6 | } 7 | 8 | .rek-spoiler.showspoiler { 9 | background-color: unset; 10 | color: var(--primary-text-color); 11 | } 12 | 13 | .rek-spoiler.hidespoiler { 14 | background-color: rgba(0,0,0,.95); 15 | color: transparent; 16 | pointer:cursor; 17 | } 18 | `; 19 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/fonts/FontSelect.d.ts: -------------------------------------------------------------------------------- 1 | import { FunctionComponent } from "react"; 2 | import { TooltipContentProps } from "../popup/Tooltip"; 3 | export interface FontSelectProps extends TooltipContentProps { 4 | fonts?: EditorFont[]; 5 | } 6 | export declare const FontSelect: FunctionComponent; 7 | export declare const DefaultFonts: EditorFont[]; 8 | export interface EditorFont { 9 | name: string; 10 | fontFamily: string; 11 | } 12 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/icons/material-regular/CheckIcon.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export const CheckIcon = (props: React.SVGProps) => ( 4 | 11 | 15 | 16 | ); 17 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/text-align/TextAlignLeftButton.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | import { ActionButton } from "../actions/ActionButton"; 5 | 6 | export const TextAlignLeftButton = (props: IconProps & TooltipContentProps) => { 7 | return ( 8 | 9 | ); 10 | }; 11 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/fixed-title/FixedTitlePlugin.d.ts: -------------------------------------------------------------------------------- 1 | import { Plugin } from "../../plugins/Plugin"; 2 | export declare const createEmptyFixedBlock: (text?: string) => { 3 | type: string; 4 | children: { 5 | text: string; 6 | }[]; 7 | }; 8 | export declare const createFixedTitlePlugin: (placeholder?: string, createBlock?: (text?: string) => { 9 | type: string; 10 | children: { 11 | text: string; 12 | }[]; 13 | }) => Plugin; 14 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/divider/DividerMarkdownTrigger.ts: -------------------------------------------------------------------------------- 1 | import { Trigger } from "../../plugins/Trigger"; 2 | 3 | export const DividerMarkdownTrigger: Trigger = { 4 | pattern: /^\s?-{3,}\s/, 5 | onMatch: (state, matches, plugin) => { 6 | if (plugin.actions && matches[0].regexMatch) { 7 | const text = matches[0].regexMatch[0]; 8 | const size = text.length - 2; 9 | plugin.actions[0].action(state, plugin, { size }); 10 | } 11 | }, 12 | }; 13 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/headings/HeadingPluginAction.ts: -------------------------------------------------------------------------------- 1 | import { isElementActive } from "../elements/Elements"; 2 | import { PluginAction } from "../../plugins/PluginAction"; 3 | import { Transforms } from "slate"; 4 | 5 | export const HeadingPluginAction: PluginAction = { 6 | action: ({ editor }, plugin) => { 7 | Transforms.setNodes(editor, { type: plugin.name }); 8 | }, 9 | isActionActive: ({ editor }, plugin) => isElementActive(editor, plugin.name), 10 | }; 11 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/popup/FocusPopup.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Element } from "slate"; 3 | import { Location, Offsets } from "./Popups"; 4 | export interface FocusPopupProps { 5 | element: Element; 6 | location?: Location; 7 | children: React.ReactNode; 8 | offsets?: Offsets; 9 | fixed?: boolean; 10 | show?: boolean; 11 | } 12 | export declare const FocusPopup: React.MemoExoticComponent<(props: FocusPopupProps) => JSX.Element>; 13 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/icons/Icons.ts: -------------------------------------------------------------------------------- 1 | import { EditorIcon } from "./Icon"; 2 | 3 | export interface Icons { 4 | delete: EditorIcon; 5 | link: EditorIcon; 6 | unlink: EditorIcon; 7 | openLink: EditorIcon; 8 | error: EditorIcon; 9 | warning: EditorIcon; 10 | info: EditorIcon; 11 | settings: EditorIcon; 12 | dropdown: EditorIcon; 13 | more: EditorIcon; 14 | moreVert: EditorIcon; 15 | check: EditorIcon; 16 | date: EditorIcon; 17 | plus: EditorIcon; 18 | } 19 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/layout/Layout.ts: -------------------------------------------------------------------------------- 1 | import { Element } from "slate"; 2 | 3 | export type Layout = number[]; 4 | 5 | export const createLayout = (layout: Layout): Element => { 6 | const children: Element[] = layout.map((cell) => ({ 7 | type: "layout-cell", 8 | width: (100 * cell) / layout.length, 9 | children: [{ type: "paragraph", children: [{ text: "" }] }], 10 | })); 11 | children[0].autoFocus = true; 12 | return { type: "layout", children }; 13 | }; 14 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/video/VideoPluginAction.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | import { Transforms } from "slate"; 3 | 4 | export const VideoPluginAction: PluginAction = { 5 | action: ({ editor }) => { 6 | Transforms.insertNodes(editor, { 7 | type: "video", 8 | url: "", 9 | children: [{ text: "" }], //Include empty child 10 | }); 11 | }, 12 | isActionActive: ({ elementType }) => elementType === "video", 13 | }; 14 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/toolbar/SelectionToolbarGlobalStyle.d.ts: -------------------------------------------------------------------------------- 1 | export declare const SelectionToolbarGlobalStyle = "\n .rek-selection-toolbar {\n border-radius: 4px;\n padding: 4px;\n display: flex;\n align-items: center;\n background-color: #1f2025;\n \n .rek-icon {\n color: white;\n }\n\n .rek-icon-button.active:not(.rek-disabled) {\n background-color:white;\n color: #1f2025;\n .rek-icon {\n color: #1f2025;\n } \n }\n }\n"; 2 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/headings/HeadingSelect.d.ts: -------------------------------------------------------------------------------- 1 | import { FunctionComponent } from "react"; 2 | import { TooltipContentProps } from "../popup/Tooltip"; 3 | export interface HeadingSelectProps extends TooltipContentProps { 4 | types?: { 5 | type: string; 6 | name: string; 7 | }[]; 8 | } 9 | export declare const HeadingSelect: FunctionComponent; 10 | export declare const DefaultTypes: { 11 | type: string; 12 | name: string; 13 | }[]; 14 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/icons/material-regular/DropdownIcon.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export const DropdownIcon = (props: React.SVGProps) => ( 4 | 12 | 16 | 17 | ); 18 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/elements/Elements.d.ts: -------------------------------------------------------------------------------- 1 | import { Editor, Node } from "slate"; 2 | import { ReactEditor } from "slate-react"; 3 | export declare const toggleElement: (editor: Editor, type: string) => void; 4 | export declare const isElementActive: (editor: Editor, type: string) => boolean; 5 | export declare const isElementEmpty: (editor: Editor) => boolean; 6 | export declare const isDeletingElementContents: (editor: ReactEditor, block: Node, event: React.KeyboardEvent | KeyboardEvent) => boolean; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/images/UploadImageAction.d.ts: -------------------------------------------------------------------------------- 1 | import { FunctionComponent, ReactNode } from "react"; 2 | export interface UploadImageActionProps { 3 | children: ReactNode; 4 | extensions?: string[]; 5 | } 6 | export declare const UploadImageAction: FunctionComponent; 7 | export interface UseUploadValue { 8 | openFileBrowser(): void; 9 | } 10 | export declare const useUpload: (onFiles: (files: File[]) => void, extensions: string[]) => UseUploadValue; 11 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/blockquote/BlockquoteMenuItem.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { MenuItemProps, MenuItem } from "../menu/MenuItem"; 3 | import { BlockquoteAction } from "./BlockquoteAction"; 4 | 5 | export interface BlockquoteMenuItemProps extends Partial {} 6 | 7 | export const BlockquoteMenuItem = (props: BlockquoteMenuItemProps) => { 8 | return ( 9 | 10 | 11 | 12 | ); 13 | }; 14 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/lists/OrderedListMenuItem.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { MenuItemProps, MenuItem } from "../menu/MenuItem"; 3 | import { OrderedListAction } from "./OrderedListAction"; 4 | 5 | export interface OrderedListMenuItemProps extends Partial {} 6 | 7 | export const OrderedListMenuItem = (props: OrderedListMenuItemProps) => { 8 | return ( 9 | 10 | 11 | 12 | ); 13 | }; 14 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/text-align/TextAlignAction.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Action } from "../actions/Action"; 3 | 4 | export interface TextAlignActionProps { 5 | children: React.ReactNode; 6 | textAlign: string; 7 | } 8 | 9 | export const TextAlignAction = (props: TextAlignActionProps) => { 10 | const { children, textAlign } = props; 11 | return ( 12 | 13 | {children} 14 | 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/icons/material-regular/WarningAlertIcon.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export const WarningAlertIcon = (props: React.SVGProps) => ( 4 | 12 | 16 | 17 | ); 18 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/icons/Icons.d.ts: -------------------------------------------------------------------------------- 1 | import { EditorIcon } from "./Icon"; 2 | export interface Icons { 3 | delete: EditorIcon; 4 | link: EditorIcon; 5 | unlink: EditorIcon; 6 | openLink: EditorIcon; 7 | error: EditorIcon; 8 | warning: EditorIcon; 9 | info: EditorIcon; 10 | settings: EditorIcon; 11 | dropdown: EditorIcon; 12 | more: EditorIcon; 13 | moreVert: EditorIcon; 14 | check: EditorIcon; 15 | date: EditorIcon; 16 | plus: EditorIcon; 17 | } 18 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/images/InsertImagePluginAction.ts: -------------------------------------------------------------------------------- 1 | import { Transforms } from "slate"; 2 | import { PluginAction } from "../../plugins/PluginAction"; 3 | 4 | export const InsertImagePluginAction: PluginAction = { 5 | action: ({ editor }, plugin, args) => { 6 | if (args) { 7 | const image = { type: "image", ...args, children: [{ text: "" }] }; 8 | Transforms.insertNodes(editor, image); 9 | } 10 | }, 11 | isActionActive: ({ elementType }) => elementType === "image", 12 | }; 13 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/italic/ItalicMarkdownTrigger.ts: -------------------------------------------------------------------------------- 1 | import { applyRegexMark } from "../marks/Marks"; 2 | import { Trigger } from "../../plugins/Trigger"; 3 | 4 | export const ItalicMarkdownTrigger: Trigger = { 5 | pattern: /(^|[^*])\*([^*]+)\*/, 6 | onMatch: (state, matches) => { 7 | if (matches[0].regexMatch) { 8 | matches[0].regexMatch[0] = matches[0].regexMatch[0].trim(); 9 | applyRegexMark(state.editor, matches[0], "italic"); 10 | } 11 | }, 12 | clear: false, 13 | }; 14 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/layout/CustomLayoutMenuItem.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { MenuItemProps, MenuItem } from "../menu/MenuItem"; 3 | import { CustomLayoutAction } from "./CustomLayoutAction"; 4 | 5 | export interface CustomLayoutMenuItemProps extends Partial {} 6 | 7 | export const CustomLayoutMenuItem = (props: CustomLayoutMenuItemProps) => { 8 | return ( 9 | 10 | 11 | 12 | ); 13 | }; 14 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/table/TablePluginAction.ts: -------------------------------------------------------------------------------- 1 | import { PluginAction } from "../../plugins/PluginAction"; 2 | import { Transforms } from "slate"; 3 | import { clone } from "../../ui/Utils"; 4 | import { isElementActive } from "../elements/Elements"; 5 | 6 | export const TablePluginAction: PluginAction = { 7 | action: ({ editor }, plugin) => { 8 | Transforms.insertNodes(editor, clone(plugin.defaultTable)); 9 | }, 10 | isActionActive: ({ editor }) => isElementActive(editor, "table"), 11 | }; 12 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/popup/ElementModalPopup.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Element } from "slate"; 3 | import { Location, Offsets } from "./Popups"; 4 | export interface ModalPopupProps { 5 | element: Element; 6 | children: React.ReactNode; 7 | show: boolean; 8 | location?: Location; 9 | offsets?: Offsets; 10 | onClickOutside?(event?: React.MouseEvent): void; 11 | } 12 | export declare const ModalPopup: (props: ModalPopupProps) => JSX.Element; 13 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/layout/LayoutElement.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { RenderElementProps } from "slate-react"; 3 | import { DeletableElement } from "../elements/DeletableElement"; 4 | 5 | export const LayoutElement = (props: RenderElementProps) => { 6 | const { attributes, children } = props; 7 | return ( 8 | 9 |
10 | {children} 11 |
12 |
13 | ); 14 | }; 15 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/lists/OrderedListButton.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | import { ActionButton } from "../actions/ActionButton"; 5 | 6 | export interface OrderedListButtonProps 7 | extends IconProps, 8 | TooltipContentProps {} 9 | 10 | export const OrderedListButton = (props: OrderedListButtonProps) => { 11 | return ; 12 | }; 13 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/lists/UnorderedListMenuItem.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { MenuItemProps, MenuItem } from "../menu/MenuItem"; 3 | import { UnorderedListAction } from "./UnorderedListAction"; 4 | 5 | export interface UnorderedListMenuItemProps extends Partial {} 6 | 7 | export const UnorderedListMenuItem = (props: UnorderedListMenuItemProps) => { 8 | return ( 9 | 10 | 11 | 12 | ); 13 | }; 14 | -------------------------------------------------------------------------------- /.idea/react-editor-kit.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/color/ColorPickerButton.d.ts: -------------------------------------------------------------------------------- 1 | import { FunctionComponent } from "react"; 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { Color } from "./ColorPickerAction"; 4 | import { TooltipContentProps } from "../popup/Tooltip"; 5 | export interface ColorPickerButtonProps extends IconProps, TooltipContentProps { 6 | colors?: Color[][]; 7 | } 8 | export declare const ColorPickerButton: FunctionComponent; 9 | export declare const DefaultColors: Color[][]; 10 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/popup/HoverPopup.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Node } from "slate"; 3 | import { Location, Offsets } from "./Popups"; 4 | export interface HoverPopupProps { 5 | node?: Node; 6 | element?: HTMLElement; 7 | location?: Location; 8 | children: React.ReactNode; 9 | fixed?: boolean; 10 | hideWhenFocusedWithin?: boolean; 11 | offsets?: Offsets; 12 | } 13 | export declare const HoverPopup: React.MemoExoticComponent<(props: HoverPopupProps) => JSX.Element>; 14 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/headings/HeadingTogglePluginAction.ts: -------------------------------------------------------------------------------- 1 | import { toggleElement, isElementActive } from "../elements/Elements"; 2 | import { PluginAction } from "../../plugins/PluginAction"; 3 | 4 | export const HeadingTogglePluginAction: PluginAction = { 5 | action: ({ editor }, plugin, args) => { 6 | if (args) { 7 | toggleElement(editor, args.heading); 8 | } 9 | }, 10 | isActionActive: ({ editor }, plugin, args) => 11 | Boolean(args && isElementActive(editor, args.heading)), 12 | }; 13 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/page-divider/PageDividerElement.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { RenderElementProps } from "slate-react"; 3 | 4 | export const PageDividerElement = (props: RenderElementProps) => { 5 | const { attributes, element, children } = props; 6 | 7 | return ( 8 |
15 | {children} 16 |
17 | ); 18 | }; 19 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/table/TableCellElement.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { RenderElementProps } from "slate-react"; 3 | import { TableCellControls } from "./TableCellControls"; 4 | 5 | export const TableCellElement = (props: RenderElementProps) => { 6 | const { attributes, children, element, ...rest } = props; 7 | return ( 8 | 9 | 10 | {children} 11 | 12 | ); 13 | }; 14 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/popup/HtmlElementModalPopup.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Location, Offsets } from "./Popups"; 3 | export interface HtmlElementModalPopupProps { 4 | element: HTMLElement | null; 5 | children: React.ReactNode; 6 | location?: Location; 7 | onClickOutside?(event?: React.MouseEvent): void; 8 | show: boolean; 9 | offsets?: Offsets; 10 | } 11 | export declare const HtmlElementModalPopup: (props: HtmlElementModalPopupProps) => JSX.Element; 12 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/bold/BoldMarkdownTrigger.ts: -------------------------------------------------------------------------------- 1 | import { MatchResult } from "../../editor/Matching"; 2 | import { applyRegexMark } from "../marks/Marks"; 3 | import { Trigger } from "../../plugins/Trigger"; 4 | import { EditorState } from "../../editor/EditorState"; 5 | 6 | export const BoldMarkdownTrigger: Trigger = { 7 | pattern: /(\*\*)(.{1,})\1/, 8 | onMatch: (state: EditorState, matches: MatchResult[]) => { 9 | applyRegexMark(state.editor, matches[0], "bold"); 10 | }, 11 | clear: false, 12 | }; 13 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/code/CodeBackspaceKeyHandler.ts: -------------------------------------------------------------------------------- 1 | import { isAtStartOfNode } from "../../editor/Editor"; 2 | import { KeyHandler } from "../../plugins/KeyHandler"; 3 | 4 | export const CodeBackspaceKeyHandler: KeyHandler = { 5 | pattern: "backspace", 6 | handle: ({ element, editor }, event) => { 7 | if (element && element.type === "code") { 8 | if (isAtStartOfNode(editor)) { 9 | event.preventDefault(); 10 | return true; 11 | } 12 | } 13 | return false; 14 | }, 15 | }; 16 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/initial-letter/InitialLetterMenuItem.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { MenuItemProps, MenuItem } from "../menu/MenuItem"; 3 | import { InitialLetterAction } from "./InitialLetterAction"; 4 | 5 | export interface InitialLetterMenuItemProps extends Partial {} 6 | 7 | export const InitialLetterMenuItem = (props: InitialLetterMenuItemProps) => { 8 | return ( 9 | 10 | 11 | 12 | ); 13 | }; 14 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/lists/UnorderedListButton.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | import { ActionButton } from "../actions/ActionButton"; 5 | 6 | export interface UnorderedListButtonProps 7 | extends IconProps, 8 | TooltipContentProps {} 9 | 10 | export const UnorderedListButton = (props: UnorderedListButtonProps) => { 11 | return ; 12 | }; 13 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/alert/AlertMenuItem.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { MenuItemProps, MenuItem } from "../menu/MenuItem"; 3 | import { AlertAction } from "./AlertAction"; 4 | 5 | export interface AlertMenuItemProps extends Partial { 6 | type: string; 7 | } 8 | 9 | export const AlertMenuItem = (props: AlertMenuItemProps) => { 10 | const { type, ...rest } = props; 11 | return ( 12 | 13 | 14 | 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/mentions/MentionElement.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { RenderElementProps } from "slate-react"; 3 | 4 | export const MentionElement = (props: RenderElementProps) => { 5 | const { attributes, element, children } = props; 6 | return ( 7 |
13 | @{element.value.name} 14 | {children} 15 |
16 | ); 17 | }; 18 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/text-align/TextAlignCenterButton.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { ActionButton } from "../actions/ActionButton"; 4 | import { TooltipContentProps } from "../popup/Tooltip"; 5 | 6 | export const TextAlignCenterButton = ( 7 | props: IconProps & TooltipContentProps 8 | ) => { 9 | return ( 10 | 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/text-align/TextAlignRightButton.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | import { ActionButton } from "../actions/ActionButton"; 5 | 6 | export const TextAlignRightButton = ( 7 | props: IconProps & TooltipContentProps 8 | ) => { 9 | return ( 10 | 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/text-align/TextAlignJustifiedButton.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { IconProps } from "../buttons/IconButton"; 3 | import { TooltipContentProps } from "../popup/Tooltip"; 4 | import { ActionButton } from "../actions/ActionButton"; 5 | 6 | export const TextAlignJustifiedButton = ( 7 | props: IconProps & TooltipContentProps 8 | ) => { 9 | return ( 10 | 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/icons/material-regular/InfoAlertIcon.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export const InfoAlertIcon = (props: React.SVGProps) => ( 4 | 12 | 16 | 17 | ); 18 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/popup/CursorPopup.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Location, Offsets } from "./Popups"; 3 | export interface CursorPopupProps { 4 | location?: Location; 5 | children: React.ReactNode; 6 | onClose?(): void; 7 | fixed?: boolean; 8 | offsets?: Offsets; 9 | expanded?: boolean; 10 | delay?: number; 11 | } 12 | export declare const CursorPopup: (props: CursorPopupProps) => JSX.Element; 13 | export declare const getCursor: () => { 14 | range: Range; 15 | length: number; 16 | }; 17 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/icons/material-regular/ErrorAlertIcon.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | export const ErrorAlertIcon = (props: React.SVGProps) => ( 4 | 12 | 16 | 17 | ); 18 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/superscript/SuperscriptMarkdownTrigger.ts: -------------------------------------------------------------------------------- 1 | import { MatchResult } from "../../editor/Matching"; 2 | import { applyRegexMark } from "../marks/Marks"; 3 | import { Trigger } from "../../plugins/Trigger"; 4 | import { EditorState } from "../../editor/EditorState"; 5 | 6 | export const SuperscriptMarkdownTrigger: Trigger = { 7 | pattern: /(\^)(.{1,})\1/, 8 | onMatch: (state: EditorState, matches: MatchResult[]) => { 9 | applyRegexMark(state.editor, matches[0], "superscript"); 10 | }, 11 | clear: false, 12 | }; 13 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/features/links/LinkToolbar.d.ts: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { Element } from "slate"; 3 | export interface LinkToolbarProps { 4 | onEditLink(): any; 5 | element: Element; 6 | } 7 | export declare const LinkToolbar: (props: LinkToolbarProps) => JSX.Element; 8 | export declare const useLinkToolbar: (props: LinkToolbarProps) => { 9 | element: Element; 10 | onEditLink: () => any; 11 | handleRemoveLink: (event: React.MouseEvent) => void; 12 | handleOpenLink: () => void; 13 | }; 14 | -------------------------------------------------------------------------------- /packages/editor-kit/dist/ui/Utils.d.ts: -------------------------------------------------------------------------------- 1 | export declare const isInside: (rect: ClientRect, x: number, y: number) => boolean; 2 | export declare const isDeleting: (event: React.KeyboardEvent | KeyboardEvent) => boolean; 3 | export declare const stopEvent: (event: React.MouseEvent | MouseEvent | React.KeyboardEvent) => boolean; 4 | export declare const blockEvent: (event: React.MouseEvent | MouseEvent | React.KeyboardEvent | KeyboardEvent) => boolean; 5 | export declare const noOp: (...args: any[]) => void; 6 | export declare const clone: (value: any) => any; 7 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/headings/HeadingMenuItem.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { MenuItemProps, MenuItem } from "../menu/MenuItem"; 3 | import { HeadingAction } from "./HeadingAction"; 4 | 5 | export interface HeadingMenuItemProps extends Partial { 6 | type: string; 7 | } 8 | 9 | export const HeadingMenuItem = (props: HeadingMenuItemProps) => { 10 | const { type, ...rest } = props; 11 | return ( 12 | 13 | 14 | 15 | ); 16 | }; 17 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/i18n/EditorLabels.ts: -------------------------------------------------------------------------------- 1 | export interface EditorLabels { 2 | enterUrl: string; 3 | enterDisplayText: string; 4 | editLink: string; 5 | textColor: string; 6 | backgroundColor: string; 7 | headerRow: string; 8 | headerColumn: string; 9 | borderless: string; 10 | save: string; 11 | validVideoUrl: string; 12 | validImageUrl: string; 13 | initialLetterOn: string; 14 | initialLetterOff: string; 15 | removeDueDate: string; 16 | moveToTop: string; 17 | delete: string; 18 | customLayout: string; 19 | } 20 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/spoiler/SpoilerButton.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { IconProps, IconButton } from "../buttons/IconButton"; 3 | import { SpoilerAction } from "./SpoilerAction"; 4 | import { TooltipContentProps } from "../popup/Tooltip"; 5 | 6 | export const SpoilerButton = (props: IconProps & TooltipContentProps) => { 7 | const { className, ligature, ...rest } = props; 8 | return ( 9 | 10 | 11 | 12 | ); 13 | }; 14 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/clear-formatting/ClearFormattingMenuItem.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import { MenuItemProps, MenuItem } from "../menu/MenuItem"; 3 | import { ClearFormattingAction } from "./ClearFormattingAction"; 4 | 5 | export interface ClearFormattingMenuItemProps extends Partial {} 6 | 7 | export const ClearFormattingMenuItem = ( 8 | props: ClearFormattingMenuItemProps 9 | ) => { 10 | return ( 11 | 12 | 13 | 14 | ); 15 | }; 16 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/strikethrough/StrikethroughMarkdownTrigger.ts: -------------------------------------------------------------------------------- 1 | import { MatchResult } from "../../editor/Matching"; 2 | import { applyRegexMark } from "../marks/Marks"; 3 | import { Trigger } from "../../plugins/Trigger"; 4 | import { EditorState } from "../../editor/EditorState"; 5 | 6 | export const StrikethroughMarkdownTrigger: Trigger = { 7 | pattern: /(\~~)(.{1,})\1/, 8 | onMatch: (state: EditorState, matches: MatchResult[]) => { 9 | applyRegexMark(state.editor, matches[0], "strikethrough"); 10 | }, 11 | clear: false, 12 | }; 13 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/layout/LayoutPluginAction.ts: -------------------------------------------------------------------------------- 1 | import { Transforms } from "slate"; 2 | import { PluginAction } from "../../plugins/PluginAction"; 3 | import { createLayout } from "./Layout"; 4 | 5 | export const LayoutPluginAction: PluginAction = { 6 | action: ({ editor }, plugin, args) => { 7 | let layout = [2, 1]; 8 | if (args && args.layout) { 9 | layout = args.layout; 10 | } 11 | Transforms.insertNodes(editor, createLayout(layout)); 12 | }, 13 | isActionActive: ({ elementType }) => elementType === "layout-cell", 14 | }; 15 | -------------------------------------------------------------------------------- /packages/editor-kit/src/features/toolbar/SelectionToolbarGlobalStyle.ts: -------------------------------------------------------------------------------- 1 | export const SelectionToolbarGlobalStyle = ` 2 | .rek-selection-toolbar { 3 | border-radius: 4px; 4 | padding: 4px; 5 | display: flex; 6 | align-items: center; 7 | background-color: #1f2025; 8 | 9 | .rek-icon { 10 | color: white; 11 | } 12 | 13 | .rek-icon-button.active:not(.rek-disabled) { 14 | background-color:white; 15 | color: #1f2025; 16 | .rek-icon { 17 | color: #1f2025; 18 | } 19 | } 20 | } 21 | `; 22 | --------------------------------------------------------------------------------