
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-bitbucket
Advanced tools
This component provides a packaged version of the Atlassian Editor for use in Bitbucket Cloud.
It's specific to Bitbucket Cloud in that it:
Interact with a live demo of the ak-editor-bitbucket component with code examples.
Install from NPM:
npm install --save ak-editor-bitbucket
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-bitbucket';
class Page extends Component {
render() {
return (
<div>
<Editor
isExpandedByDefault
onSave={this.handleSave}
/>
</div>
);
}
handleSave = (editor) => {
alert(`Saved with python-markdown value: ${editor.value}`);
}
}
Editor APIimport Editor from 'ak-editor-bitbucket';
context?: 'comment' | 'pr'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 Bitbucket rendered HTML 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?".
imageUploadHandler?: ImageUploadHandlerA handler for image uploads (e.g. when an image is pasted or dragged into the editor).
type ImageUploadHandler = (e: any, insertImageFn: any) => void;
focus(): voidFocuses the the editor.
expand(): voidExpands the the editor.
collapse(): voidCollapses 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.
setFromHtml(html: string): voidReset the editor's content by creating a new document based on the provided HTML. The HTML must be in Bitbucket's rendered markdown HTML structure (e.g. from a pull request comment or description).
If the editor is not yet initialised (e.g. if it's still collapsed), calling this method will throw an error.
get value(): string | undefinedReturns the value of the editor in python-markdown format. This getter computes the value on request, as such only access this getter when the value is actually required.
get doc(): Node | undefinedReturn the current ProseMirror document (if one exists).
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
Editor web component
The npm package ak-editor-bitbucket receives a total of 9 weekly downloads. As such, ak-editor-bitbucket popularity was classified as not popular.
We found that ak-editor-bitbucket 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.