
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
ak-editor-core
Advanced tools
This packages provides core components shared across all Atlassian Editor packages.
It's the home for shared editor functionality and implements shared editor behaviours, and is the preferred destination for editor functionality.
Source location: src/analytics/
Import: import { … } from 'ak-editor-core'
A set of tools for emitting analytics relating to user interaction with the product. These can be wired into product integrations. Transport is left as the responsibility for the product.
Source location: src/plugins/
Import: import { … } from 'ak-editor-core'
Plugins (and "plugin states") are the mechanisms by which functionality is added to the editor.
Plugin principles:
Plugins should avoid making too many assumptions about the shape of the schema. Different products use different schemas, so the plugin should gracefully handle the absence of nodes or marks, or fail loudly in the constructor.
A good rule of thumb is one plugin per content-type. For example:
HyperlinkPlugin
for hyperlinks.MentionsPlugin
for mentions.HorizontalRulePlugin
for horizontal rules.Plugins are responsible for attaching keymaps and input rules that are specific to the content. For example MentionsPlugin intercepts arrow keys when the selection is in a mention query and uses them to navigate items in the mention picker.
Plugins will be used on all platforms (browser + mobile native).
Plugins should expose "logical APIs" that are suitable for integrating into UI components. For example the HyperlinkState expose:
class HyperlinkState {
// …
// public state
href?: string;
text?: string;
active = false;
canAddLink = false;
element?: HTMLElement;
// …
}
These fields allow a UI to present the current hyperlink href and text, and position a floating
toolbar at the correct position on the screen (thanks to element
being exposed).
Source location: src/prosemirror/
Import: import { … } from 'ak-editor-core'
The prosemirror directory provides a flat export of ProseMirror 0.10 objects, to solve the recurring
problem figuring out which prosemirror/dist/*
package to import from.
A hoped side-benefit of this approach is a simplified upgrade-path for code for ProseMirror upgrades.
It also includes TypeScript definitions for a large chunk of ProseMirror's API surface, and that of browserkeymap too. As a general practice, ProseMirror objects should be imported via this directory.
Source location: src/schema/
Import: import { … } from 'ak-editor-core'
The schema modules implement node and mark types for use in product-specific schemas. Node and mark types are responsible for:
Schema principles:
Some complex node and mark types (to use as examples):
MentionQueryMarkType
-- used to indicate a new editing context where typed characters perform a
user-search, and arrow keys and enter are used to navigate a user-picker.MentionNodeType
-- an immutable node that represents a user.Source location: src/ui/
Import: import { … } from 'ak-editor-core'
The UI modules are responsible for implementing non-content elements of the user interface, for example:
src/ui/ChromeCollapsed
-- A collapsed editor that provides an initial affordance in the UI,
suitable for a comment editor.src/ui/ChromeExpanded
-- An expanded editor that includes a fixed toolbar, save & cancel
buttons, surrounding borders, etc.src/ui/Chrome
-- An encapsulation of ChromeCollapsed
and ChromeExpanded
, providing "click to
expand" behaviour.src/ui/Panel
-- A floating popup that can be used as the base for a floating toolbar (e.g.
HyperlinkEdit
).src/ui/Toolbar*
-- A collection of button-groups that are suitable for placing in the fixed
toolbar.A few notes on development:
The UI is only intended for use in a web browser, it is not used for the mobile native web view editor.
Although ProseMirror is not built on React, the UI is.
Styling is achived via TypeStyle.
The UI can be coupled to (have knowledge of) plugins, but not the other way around.
This allows the plugins to be used on mobile with a completely different UI (a native one) to that which is used on web.
The UI modules are exported from the top level index.ts
, which means that they'll be pulled in in
the ES5 distribution. If you're building a mobile editor the ES2015 sources should be used instead
as they can enable tree shaking with webpack 2.
Source location: src/ui/
Import: import { … } from 'ak-editor-core/test-helper'
A set of testing utilities are provided that making testing the editor easier, these include:
Test helpers are not exported from the root package, as a courtesy to ES5 consumers that are unable to imploy tree shaking.
Install from NPM:
npm install --save ak-editor-core
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.
Unless you're developing a new editor for a product, you've probably arrived at the wrong package. Consider using:
If you're sure you want to consume this package, refer to one of the packages above for an example of how to use it.
One important omission from this package are pre-built schemas. Due to the nature of different products using different storage backend, per-product schemas exist in product-specific editor packages that ensure that authored content does not violate the constraints of the underlying storage.
The schemas in those packages are composed on node and mark types defined in this package.
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
A package contains Atlassian editor core functionality
The npm package ak-editor-core receives a total of 87 weekly downloads. As such, ak-editor-core popularity was classified as not popular.
We found that ak-editor-core 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.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.