This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .ProseMirror .MathBlock pre { | |
| background: var(--default-back); | |
| color: rgb(var(--default-font)); | |
| font-size: 0.8em; | |
| display: flex; | |
| padding: 1em; | |
| } | |
| .ProseMirror .MathBlock { | |
| display: flex; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Plugin, PluginKey, Extension } from 'tiptap' | |
| import { Decoration, DecorationSet } from 'prosemirror-view' | |
| import { findBlockNodes } from 'prosemirror-utils' | |
| import CodeMirror from 'codemirror/addon/runmode/runmode.node.js'; | |
| import "codemirror/mode/meta"; | |
| /* | |
| * Global set of CodeMirror languages to dynamically import. | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export function isVisible(item: any, snapshot?: any): boolean; | |
| /** | |
| * Either a node if type is YXmlElement or an Array of text nodes if YXmlText | |
| * @typedef {Map<Y.AbstractType, PModel.Node | Array<PModel.Node>>} ProsemirrorMapping | |
| */ | |
| /** | |
| * The unique prosemirror plugin key for prosemirrorPlugin. | |
| * | |
| * @public | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { VNode, CreateElement } from "vue" | |
| import { Component, Vue, Prop } from 'vue-property-decorator'; | |
| import { Emoji } from "./utils" | |
| import "./EmojiMart.css" | |
| import * as Fuse from 'fuse.js'; | |
| @Component({}) | |
| export default class EmojiMart extends Vue { | |
| @Prop({ required: true }) emojiData!: Record<string, Emoji[]>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .input-tags { | |
| display: flex; | |
| flex-wrap: wrap; | |
| border: 1px solid #dae1e7; | |
| border-radius: .25rem; | |
| padding-top: .50rem; | |
| padding-left: .50rem; | |
| align-items: center; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { InputRule } from 'prosemirror-inputrules' | |
| import {findWrapping, ReplaceAroundStep, canJoin} from "prosemirror-transform" | |
| import {Slice, Fragment} from "prosemirror-model" | |
| /** | |
| * Stiches together liftListItem and wrappingInputRule. | |
| * See: https://github.com/ProseMirror/prosemirror-schema-list/blob/master/src/schema-list.js | |
| */ | |
| export default function listInputRule(regex, listType, getAttrs, joinPredicate) { | |
| return new InputRule(regex, (state, match, start, end) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Extension from "./Extension"; | |
| import type { EditorState, Transaction } from 'prosemirror-state'; | |
| import { Plugin, PluginKey } from 'prosemirror-state' | |
| /** | |
| * Adds ability to toggle the class 'ProseMirror-focusmode' onto the parent ProseMirror DOM node. | |
| * Note: This extension requires the Placeholder extension to be used in conjuction. | |
| */ | |
| export default class FocusMode extends Extension { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export function debounce(func: Function, wait: number, immediate = false) { | |
| var timeout; | |
| return function(...args: any[]) { | |
| var context = this; | |
| clearTimeout(timeout); | |
| timeout = setTimeout(function() { | |
| timeout = null; | |
| (!immediate) && func.apply(context, args); | |
| }, wait); | |
| (immediate && !timeout) && func.apply(context, args); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import 'codemirror/src/addon/runmode/codemirror-standalone'; | |
| if (typeof exports == "object" && typeof module == "object") // shim codemirror-standalone in cjs distributions to avoid loading full codemirror library | |
| require.cache[require.resolve("codemirror/lib/codemirror")] = require.cache[require.resolve("codemirror/src/addon/runmode/codemirror-standalone")]; | |
| import 'codemirror/addon/runmode/runmode'; | |
| import 'codemirror/mode/meta'; // required to resolve languages | |
| var root = typeof globalThis !== 'undefined' ? globalThis : window; | |
| var CodeMirror = root.CodeMirror; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {LanguageDescription, LanguageSupport} from "@codemirror/language" | |
| import {languages} from "@codemirror/language-data" | |
| import {highlightTree} from "@codemirror/highlight" | |
| import {highlightStyle} from "./highlight-style" | |
| export function syntaxHighlight(text: string, support: LanguageSupport, callback: (token: {text: string; style: string; from: number; to: number}) => void, options = {match: highlightStyle.match}) { | |
| let pos = 0; | |
| let tree = support.language.parseString(text); | |
| highlightTree(tree, options.match, (from, to, classes) => { | |
| from > pos && callback({text: text.slice(pos, from), style: null, from: pos, to: from}); |