@atlaskit/editor-core 204.7.2 → 204.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/cjs/actions/index.js +8 -0
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/actions/index.js +8 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/actions/index.js +8 -0
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/actions/index.d.ts +8 -0
- package/dist/types-ts4.5/actions/index.d.ts +8 -0
- package/docs/0-intro.tsx +7 -7
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 204.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#126109](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/126109)
|
|
8
|
+
[`b8eb107432364`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b8eb107432364) -
|
|
9
|
+
marked EditorActions as deprecated
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#130624](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/130624)
|
|
14
|
+
[`8f52e4f05f49b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8f52e4f05f49b) -
|
|
15
|
+
updated docs to reflect our upgrade of editor-core to React 18
|
|
16
|
+
- Updated dependencies
|
|
17
|
+
|
|
3
18
|
## 204.7.2
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
|
@@ -33,6 +33,14 @@ var fakePluginKey = {
|
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-26729 Internal documentation for deprecation (no external access)} Editor actions is no longer supported and will be removed in a future version. Please use the core actions, or Plugin APIs directly instead
|
|
38
|
+
* @example If you were using editorActions.getValue() replace with:
|
|
39
|
+
const { editorApi, preset } = usePreset(...);
|
|
40
|
+
editorApi?.core.actions.requestDocument((doc) => {
|
|
41
|
+
// use doc as desired
|
|
42
|
+
})
|
|
43
|
+
*/
|
|
36
44
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
37
45
|
var EditorActions = exports.default = /*#__PURE__*/function () {
|
|
38
46
|
function EditorActions() {
|
|
@@ -23,6 +23,14 @@ const fakePluginKey = {
|
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-26729 Internal documentation for deprecation (no external access)} Editor actions is no longer supported and will be removed in a future version. Please use the core actions, or Plugin APIs directly instead
|
|
28
|
+
* @example If you were using editorActions.getValue() replace with:
|
|
29
|
+
const { editorApi, preset } = usePreset(...);
|
|
30
|
+
editorApi?.core.actions.requestDocument((doc) => {
|
|
31
|
+
// use doc as desired
|
|
32
|
+
})
|
|
33
|
+
*/
|
|
26
34
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
35
|
export default class EditorActions {
|
|
28
36
|
constructor() {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = "@atlaskit/editor-core";
|
|
2
|
-
export const version = "204.
|
|
2
|
+
export const version = "204.8.0";
|
|
@@ -27,6 +27,14 @@ var fakePluginKey = {
|
|
|
27
27
|
}
|
|
28
28
|
};
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-26729 Internal documentation for deprecation (no external access)} Editor actions is no longer supported and will be removed in a future version. Please use the core actions, or Plugin APIs directly instead
|
|
32
|
+
* @example If you were using editorActions.getValue() replace with:
|
|
33
|
+
const { editorApi, preset } = usePreset(...);
|
|
34
|
+
editorApi?.core.actions.requestDocument((doc) => {
|
|
35
|
+
// use doc as desired
|
|
36
|
+
})
|
|
37
|
+
*/
|
|
30
38
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
39
|
var EditorActions = /*#__PURE__*/function () {
|
|
32
40
|
function EditorActions() {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "204.
|
|
2
|
+
export var version = "204.8.0";
|
|
@@ -4,6 +4,14 @@ import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
|
4
4
|
import type { ContextUpdateHandler, EditorActionsOptions, FeatureFlags, ReplaceRawValue, GetResolvedEditorStateReason, Transformer } from '@atlaskit/editor-common/types';
|
|
5
5
|
import { Node } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-26729 Internal documentation for deprecation (no external access)} Editor actions is no longer supported and will be removed in a future version. Please use the core actions, or Plugin APIs directly instead
|
|
9
|
+
* @example If you were using editorActions.getValue() replace with:
|
|
10
|
+
const { editorApi, preset } = usePreset(...);
|
|
11
|
+
editorApi?.core.actions.requestDocument((doc) => {
|
|
12
|
+
// use doc as desired
|
|
13
|
+
})
|
|
14
|
+
*/
|
|
7
15
|
export default class EditorActions<T = any> implements EditorActionsOptions<T> {
|
|
8
16
|
private editorView?;
|
|
9
17
|
private contentTransformer?;
|
|
@@ -4,6 +4,14 @@ import type { EventDispatcher } from '@atlaskit/editor-common/event-dispatcher';
|
|
|
4
4
|
import type { ContextUpdateHandler, EditorActionsOptions, FeatureFlags, ReplaceRawValue, GetResolvedEditorStateReason, Transformer } from '@atlaskit/editor-common/types';
|
|
5
5
|
import { Node } from '@atlaskit/editor-prosemirror/model';
|
|
6
6
|
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-26729 Internal documentation for deprecation (no external access)} Editor actions is no longer supported and will be removed in a future version. Please use the core actions, or Plugin APIs directly instead
|
|
9
|
+
* @example If you were using editorActions.getValue() replace with:
|
|
10
|
+
const { editorApi, preset } = usePreset(...);
|
|
11
|
+
editorApi?.core.actions.requestDocument((doc) => {
|
|
12
|
+
// use doc as desired
|
|
13
|
+
})
|
|
14
|
+
*/
|
|
7
15
|
export default class EditorActions<T = any> implements EditorActionsOptions<T> {
|
|
8
16
|
private editorView?;
|
|
9
17
|
private contentTransformer?;
|
package/docs/0-intro.tsx
CHANGED
|
@@ -18,17 +18,17 @@ ${(<AtlassianInternalWarning />)}
|
|
|
18
18
|
|
|
19
19
|
## Prerequisites
|
|
20
20
|
|
|
21
|
-
* **React
|
|
21
|
+
* **React 18:** at the time of writing, the Atlassian Editor is built on top of React 18 and doesn’t explicitly support any higher versions of React yet, which means both the \`react\` and \`react-dom\` libraries and their dependencies need to be set to React 18 compatible version.
|
|
22
22
|
* **Singleton:** the ProseMirror libraries in use and the document format \(Atlassian Document Format, ADF\) demand that some of the libraries using them are singletons, as multiple versions of the library will cause breaking issues. So, consumers of the Atlassian Editor need to enforce these singletons; this is usually done by deduplicating after installing the dependencies or by setting libraries to specific versions through resolutions to avoid multiple versions. Our recommendation is to use [yarn-deduplicate](https://www.npmjs.com/package/yarn-deduplicate).
|
|
23
23
|
|
|
24
24
|
## Installation
|
|
25
25
|
|
|
26
|
-
1. Install the editor libraries
|
|
26
|
+
1. Install the editor libraries
|
|
27
27
|
- **npm:** \`npm install --save @atlaskit/editor-core @atlaskit/css-reset\`
|
|
28
28
|
- **yarn:** \`yarn add @atlaskit/editor-core @atlaskit/css-reset\`
|
|
29
29
|
|
|
30
30
|
2. Deduplicate the dependencies \(if necessary\) by setting resolutions to avoid multiple versions of the editor libraries or by running [npm dedupe](https://docs.npmjs.com/cli/v6/commands/npm-dedupe) or [yarn dedupe](https://yarnpkg.com/cli/dedupe) after installation.
|
|
31
|
-
3. Setup the CSS reset in your application
|
|
31
|
+
3. Setup the CSS reset in your application
|
|
32
32
|
\`import '@atlaskit/css-reset';\`
|
|
33
33
|
|
|
34
34
|
## Usage
|
|
@@ -112,7 +112,7 @@ const createPreset = () =>
|
|
|
112
112
|
}
|
|
113
113
|
return builder; // Don't add the plugin
|
|
114
114
|
});
|
|
115
|
-
|
|
115
|
+
|
|
116
116
|
const { preset } = usePreset(createPreset);
|
|
117
117
|
`}
|
|
118
118
|
|
|
@@ -199,7 +199,7 @@ ${code`
|
|
|
199
199
|
const createPreset = () =>
|
|
200
200
|
createDefaultPreset({ featureFlags: {}, paste: {} });
|
|
201
201
|
const { preset } = usePreset(createPreset);
|
|
202
|
-
|
|
202
|
+
|
|
203
203
|
return <ComposableEditor appearance='full-page' preset={preset} />;
|
|
204
204
|
// Or full-width
|
|
205
205
|
return <ComposableEditor appearance='full-width' preset={preset} />;
|
|
@@ -231,7 +231,7 @@ ${code`
|
|
|
231
231
|
|
|
232
232
|
### Collapsible Editor
|
|
233
233
|
|
|
234
|
-
Sometimes, you may not want to display the whole Editor initially, and you'd prefer to show it in a collapsed state so that users can expand it when needed.
|
|
234
|
+
Sometimes, you may not want to display the whole Editor initially, and you'd prefer to show it in a collapsed state so that users can expand it when needed.
|
|
235
235
|
|
|
236
236
|
Here's how you can implement this behavior:
|
|
237
237
|
|
|
@@ -368,7 +368,7 @@ function EditorInternal() {
|
|
|
368
368
|
const { editorApi, preset } = usePreset(createPreset);
|
|
369
369
|
|
|
370
370
|
// We memoise the transformer in case this component renders frequently
|
|
371
|
-
const transformer = useMemo(() =>
|
|
371
|
+
const transformer = useMemo(() =>
|
|
372
372
|
editorApi?.core?.actions?.createTransformer((schema) => new BitbucketTransformer(schema))
|
|
373
373
|
, [editorApi])
|
|
374
374
|
|