
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
ak-editor-cq
Advanced tools
This component provides a packaged version of the Atlassian Editor for use in Confluence Questions.
It's specific to CQ in that it:
Interact with a live demo of the ak-editor-cq component with code examples.
Install from NPM:
npm install --save ak-editor-cq
Two flavours of JavaScript are published:
main field in package.json)jsnext:main field in package.json)If you're using webpack, adjust your resolve.packageMains accordingly.
The editor is built as a React component that can be used directly in a JSX file.
Example:
import React, { Component } from 'react';
import Editor from 'ak-editor-cq';
class Page extends Component {
render() {
return (
<div>
<Editor
isExpandedByDefault
onSave={this.handleSave}
/>
</div>
);
}
handleSave = (editor) => {
alert(`Saved with value Confluence Storage value: ${editor.value}`);
}
}
Editor APIimport Editor from 'ak-editor-cq';
context?: 'default' | 'comment'Adjusts the "context" of the editor. This affects the UI of the editor by making it appropriate for the given situation.
isExpandedByDefault?: booleanThe initial "expanded" value. When the editor is expanded it can have content added by the user. The non-expanded mode renders a small placeholder field that when focused, will switch to the expanded mode.
defaultValue?: stringThe initial value for the editor, in Confluence Storage format.
onCancel?: (editor?: Editor) => voidA callback triggered when the cancel button is pressed. The cancel button is only rendered if this prop is provided. Omitting this prop can be used to hide the button.
onChange?: (editor?: Editor) => voidA callback triggered when a content change is made.
onSave?: (editor?: Editor) => voidA callback triggered when the save button is pressed. The save button is only rendered if this prop is provided. Omitting this prop can be used to hide the button.
placeholder?: stringA string to use in the non-expanded placeholder, e.g. "What do you want to say?".
focus(): voidFocuses the the editor.
clear(): voidClears the content from the editor, returning it to an empty state.
isEmpty(): booleanReturns true if the editor content is empty.
get value(): string | undefinedReturns the value of the editor in Confluence Storage format. This getter computes the value on request, as such only access this getter when the value is actually required.
Let us know what you think of our components and docs, your feedback is really important for us.
Ask a question in our forum.
Check if someone has already asked the same question before.
Are you in trouble? Let us know!
FAQs
Atlassian Editor component for Confluence Questions
The npm package ak-editor-cq receives a total of 0 weekly downloads. As such, ak-editor-cq popularity was classified as not popular.
We found that ak-editor-cq demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.