How to use the roosterjs-editor-plugins.HyperLink function in roosterjs-editor-plugins

To help you get started, we’ve selected a few roosterjs-editor-plugins examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / roosterjs-react / packages / roosterjs-react-editor / lib / components / LeanRooster.tsx View on Github external
private _createEditorOptions(): EditorOptions {
        const {
            plugins: additionalPlugins = [],
            undo = new Undo(),
            defaultFormat = {},
            contentEditFeatures,
            enableRestoreSelectionOnFocus,
            coreApiOverride,
            sanitizeAttributeCallbacks
        } = this.props;
        const plugins: EditorPlugin[] = [
            new ContentEdit({ ...getDefaultContentEditFeatures(), defaultShortcut: false, smartOrderedList: true, ...contentEditFeatures }),
            new HyperLink(this._hyperlinkToolTipCallback, undefined, this._onHyperlinkClick),
            new Paste(null, { istemptitle: v => v, ...sanitizeAttributeCallbacks }),
            ...additionalPlugins
        ];
        const disableRestoreSelectionOnFocus = !enableRestoreSelectionOnFocus;

        // Important: don't set the initial content, the content editable already starts with initial HTML content
        return { plugins, defaultFormat, undo, disableRestoreSelectionOnFocus, omitContentEditableAttributeChanges: true /* avoid unnecessary reflow */, coreApiOverride };
    }
github microsoft / roosterjs / publish / samplesite / scripts / controls / editor / Editor.tsx View on Github external
private initEditor() {
        let pluginList = this.state.pluginList;
        editorInstanceToggleablePlugins = {
            hyperlink: pluginList.hyperlink ? new HyperLink(this.getLinkCallback()) : null,
            paste: pluginList.paste ? new Paste() : null,
            contentEdit: pluginList.contentEdit
                ? new ContentEdit(this.getContentEditOptions())
                : null,
            watermark: pluginList.watermark ? new Watermark(this.state.watermarkText) : null,
            imageResize: pluginList.imageResize ? new ImageResize() : null,
            tableResize: pluginList.tableResize ? new TableResize() : null,
            pickerPlugin: pluginList.pickerPlugin
                ? new PickerPlugin(new SampleColorPickerPluginDataProvider(), {
                      elementIdPrefix: 'samplepicker-',
                      changeSource: 'SAMPLE_COLOR_PICKER',
                      triggerCharacter: ':',
                      isHorizontal: true,
                  })
                : null,
            customReplace: pluginList.customReplace ? new CustomReplacePlugin() : null,
github microsoft / roosterjs / publish / samplesite / scripts / initOptions.ts View on Github external
export function initEditorForOptions() {
    setCurrentEditor(null);

    let plugins: EditorPlugin[] = [];
    if ((document.getElementById('hyperlinkCheckbox') as HTMLInputElement).checked) {
        plugins.push(new HyperLink());
    }
    if ((document.getElementById('pasteCheckbox') as HTMLInputElement).checked) {
        plugins.push(new Paste());
    }

    let features = getDefaultContentEditFeatures();
    let featuresChanged = false;

    if ((document.getElementById('contentEditCheckbox') as HTMLInputElement).checked) {
        features.autoLink = (document.getElementById('autoLinkCheckbox') as HTMLInputElement).checked;
        features.indentWhenTab = (document.getElementById('indentWhenTabCheckbox') as HTMLInputElement).checked;
        features.outdentWhenShiftTab = (document.getElementById('outdentWhenShiftTabCheckbox') as HTMLInputElement).checked;
        features.outdentWhenBackspaceOnEmptyFirstLine = (document.getElementById('outdentWhenBackspaceOnEmptyFirstLineCheckbox') as HTMLInputElement).checked;
        features.outdentWhenEnterOnEmptyLine = (document.getElementById('outdentWhenEnterOnEmptyLineCheckbox') as HTMLInputElement).checked;
        features.mergeInNewLineWhenBackspaceOnFirstChar = (document.getElementById('mergeInNewLineWhenBackspaceOnFirstCharCheckbox') as HTMLInputElement).checked;
        features.unquoteWhenBackspaceOnEmptyFirstLine = (document.getElementById('unquoteWhenBackspaceOnEmptyFirstLineCheckbox') as HTMLInputElement).checked;