Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@zendesk/help-center-wysiwyg

Package Overview
Dependencies
Maintainers
0
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@zendesk/help-center-wysiwyg

Wysiwyg editor used in Zendesk Help Center

  • 0.0.11
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

help-center-wysiwyg

Wysiwyg editor used in Zendesk Help Center

[!IMPORTANT] This custom CKEditor build cannot be used outside of Zendesk Help Center which is properly licensed to use CKEditor 5. For more information see LICENSE.md.

Install

$ yarn add @zendesk/help-center-wysiwyg

API

The easiest way to initialize the editor is using createEditor:

createEditor
import { createEditor } from "@zendesk/help-center-wysiwyg";

const editor = await createEditor(target, {
  editorType: "supportRequests", // "comments" | "communityPosts" | "supportRequests"
  hasAtMentions: true,
  userRole: "admin",
  brandId: 123,
  baseLocale: "en-us",
});
getEditorConfig

If you're using react and don't need the editor instance, you can also render the editor using @ckeditor/ckeditor5-react:

import { render } from "react-dom";
import { CKEditor } from "@ckeditor/ckeditor5-react";
import Editor, { getEditorConfig } from "@zendesk/help-center-wysiwyg";

render(
  <CKEditor
    editor={Editor}
    config={getEditorConfig({
      editorType: "comments",
      hasAtMentions: true,
      userRole: "admin",
      brandId: 123,
      baseLocale: "en-us",
    })}
  />,
  target
);

Not available when the editorType is "supportRequests".

editor.plugins.get("Notification")

Handling notifications can be done by directly accessing the Notification plugin:

const notifications = editor.plugins.get("Notification");

notifications.on("show", (event, data) => {
  const message =
    data.message instanceof Error ? data.message.message : data.message;
  const { type, title } = data;
  // Log to the console or use your own notification dispatcher:
  console.log({ type, title, message });
});

Development

There is an example page in [public/index.html] and it can be ran with:

yarn start

You should then be able to access it in your browser:

open http://localhost:8080/

Making changes

When you're done with your changes, we use changesets to manage release notes. Please run changeset to autogenerate notes to be appended to your pull request.

FAQs

Package last updated on 04 Nov 2024

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

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc