Socket
Book a DemoInstallSign in
Socket

@etsoo/editor

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@etsoo/editor

ETSOO Free WYSIWYG HTML Editor

1.0.60
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

EOEditor

ETSOO Free WYSIWYG HTML Editor 亿速思维免费提供的所见即所的 HTML 编辑器

Access to https://jsfiddle.net/q2mhLufr/ for a quick look. 访问网址 https://jsfiddle.net/q2mhLufr/ 在线快速预览。

Support / 支持

  • Browsers since 2019 (ES2019+), no Internet Exployer support.
  • Custom HTML element/component feature. Easilly integrate with other frameworks like Angular/React/Vue.
  • Splitted fabric into separate file to reduce load size.
  • English and Chinese(简体/繁体).

/ Picture editing / 图片编辑

  • Browser(client) side picture editing like rotate/resize/filter, text.
  • Integrated with Fabric.js (http://fabricjs.com/).

Installing / 安装

Using npm:

$ npm install @etsoo/editor

Using yarn:

$ yarn add @etsoo/editor

Using web: Use CDN or download the file for the latest version. Replace @latest with a specific version like @1.0.5 for it.

<script src="https://cdn.jsdelivr.net/npm/@etsoo/editor@latest/dist/eoeditor.js"></script>
<eo-editor name="content">
  <p>Content to be edited here<br />包含编辑的内容</p>
</eo-editor>
<script>
  // Get the editor reference
  const editor = document.querySelector("eo-editor");
  if (editor) {
    // Call 'getContent' method to get the editor's content
    const content = editor.getContent();
  }
</script>

Using ReactJs: React component wrapper EOEditorEx, or install '@etsoo/reacteditor'

import { EOEditor, IEOEditor } from '@etsoo/editor';
import React from 'react';

/**
 * EOEditor
 */
export type EOEditorExProps = React.DetailedHTMLProps<
  React.HTMLAttributes<IEOEditor>,
  IEOEditor
> &
  Partial<IEOEditor>;

declare global {
  namespace JSX {
    interface IntrinsicElements {
      'eo-editor': EOEditorExProps;
    }
  }
}

// Make sure import the script
const _editor = new EOEditor();

export const EOEditorEx = React.forwardRef<IEOEditor, EOEditorExProps>(
  (props, ref) => {
    const { cloneStyles = false, ...rest } = props;
    return <eo-editor cloneStyles={cloneStyles} ref={ref} {...rest} />;
  }
);

Properties / 属性

NameDescription
activeColorActive color
backupKeyBackup distinguish key
buttonsAll first-level buttons
cloneStylesClone styles to editor
colorMain color
commandsCommands, a supported collection or commands array like ['redo', 'undo']
contentGet or set editor's content
editorContainerEditor container
editorFrameEditor hosted iframe
editorSourceAreaEditor source code textarea
editorToolbarEditor toolbar
editorWindowEditor hosted iframe window
heightHeight of the editor
labelsEditor current labels
languageLanguage of the UI, like en-US, zh-CN, zh-HK
lastClickedButtonEditor last clicked button
nameName for the hidden form input
imageEditorImage editor
popupPopup component
styleWithCSSStyle with CSS or tag
valueEditor's value, alias of content
widthWidth of the editor

Methods / 方法

NameDescription
backupBackup editor content
clearBackupClear backup
createElementCreate element
deleteDelete selection
editImageEdit image
executeCommandExecute command
getBackupGet backup
getCurrentElementGet current element inside which is selected or focused
getDeepestNodeGet deepest node
getFirstElementGet first selection element
getFirstElementGet first range element
getFirstLinkGet first section outer link
getFirstRangeGet first range
getOnlyElementGet the only child element
getSelectionGet selection
insertHTMLInsert HTML text to current selection point
insertImageInsert image
insertTableInsert table
popupBlocksPopup blocks
popupColorsPopup color palette
popupContentPopup HTML content
popupIconsPopup icons
popupStylePopup styles
popupSymbolsPopup symbols
popupSubsPopup subs
restoreFocusRestore focus to the editor iframe
surroundNodeLet first range surround node
tablePropertiesTable properties
unlinkUnlink

Keywords

EOEditor

FAQs

Package last updated on 22 Apr 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.