@atlaskit/editor-core 189.3.37 → 189.4.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 +36 -0
- package/dist/cjs/plugins/extension/commands.js +9 -2
- package/dist/cjs/plugins/extension/index.js +15 -1
- package/dist/cjs/plugins/extension/pm-plugins/main.js +2 -1
- package/dist/cjs/plugins/extension/toolbar.js +1 -1
- package/dist/cjs/plugins/extension/ui/Extension/Extension/index.js +1 -8
- package/dist/cjs/plugins/extension/ui/Extension/ExtensionComponent.js +29 -10
- package/dist/cjs/plugins/extension/ui/Extension/ExtensionNodeWrapper.js +7 -0
- package/dist/cjs/plugins/extension/ui/Extension/MultiBodiedExtension/index.js +154 -0
- package/dist/cjs/plugins/extension/utils.js +6 -4
- package/dist/cjs/ui/ContentStyles/extension.js +2 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/plugins/extension/commands.js +10 -3
- package/dist/es2019/plugins/extension/index.js +16 -2
- package/dist/es2019/plugins/extension/pm-plugins/main.js +2 -1
- package/dist/es2019/plugins/extension/toolbar.js +1 -1
- package/dist/es2019/plugins/extension/ui/Extension/Extension/index.js +1 -8
- package/dist/es2019/plugins/extension/ui/Extension/ExtensionComponent.js +29 -10
- package/dist/es2019/plugins/extension/ui/Extension/ExtensionNodeWrapper.js +7 -0
- package/dist/es2019/plugins/extension/ui/Extension/MultiBodiedExtension/index.js +159 -0
- package/dist/es2019/plugins/extension/utils.js +6 -4
- package/dist/es2019/ui/ContentStyles/extension.js +6 -0
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/plugins/extension/commands.js +9 -2
- package/dist/esm/plugins/extension/index.js +16 -2
- package/dist/esm/plugins/extension/pm-plugins/main.js +2 -1
- package/dist/esm/plugins/extension/toolbar.js +1 -1
- package/dist/esm/plugins/extension/ui/Extension/Extension/index.js +1 -8
- package/dist/esm/plugins/extension/ui/Extension/ExtensionComponent.js +29 -10
- package/dist/esm/plugins/extension/ui/Extension/ExtensionNodeWrapper.js +7 -0
- package/dist/esm/plugins/extension/ui/Extension/MultiBodiedExtension/index.js +146 -0
- package/dist/esm/plugins/extension/utils.js +6 -4
- package/dist/esm/ui/ContentStyles/extension.js +2 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/avatar-group/index.d.ts +4 -1
- package/dist/types/plugins/collab-edit/index.d.ts +5 -2
- package/dist/types/plugins/extension/commands.d.ts +2 -0
- package/dist/types/plugins/extension/ui/Extension/ExtensionComponent.d.ts +1 -0
- package/dist/types/plugins/extension/ui/Extension/ExtensionNodeWrapper.d.ts +7 -0
- package/dist/types/plugins/extension/ui/Extension/MultiBodiedExtension/index.d.ts +16 -0
- package/dist/types/plugins/find-replace/index.d.ts +4 -1
- package/dist/types/plugins/insert-block/types.d.ts +1 -1
- package/dist/types/plugins/toolbar-lists-indentation/index.d.ts +1 -1
- package/dist/types/presets/default.d.ts +72 -72
- package/dist/types-ts4.5/plugins/avatar-group/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/collab-edit/index.d.ts +3 -3
- package/dist/types-ts4.5/plugins/extension/commands.d.ts +2 -0
- package/dist/types-ts4.5/plugins/extension/ui/Extension/ExtensionComponent.d.ts +1 -0
- package/dist/types-ts4.5/plugins/extension/ui/Extension/ExtensionNodeWrapper.d.ts +7 -0
- package/dist/types-ts4.5/plugins/extension/ui/Extension/MultiBodiedExtension/index.d.ts +16 -0
- package/dist/types-ts4.5/plugins/find-replace/index.d.ts +1 -1
- package/dist/types-ts4.5/plugins/insert-block/types.d.ts +1 -1
- package/dist/types-ts4.5/plugins/toolbar-lists-indentation/index.d.ts +1 -1
- package/dist/types-ts4.5/presets/default.d.ts +72 -72
- package/package.json +6 -6
|
@@ -5,8 +5,9 @@ export var getSelectedExtension = function getSelectedExtension(state) {
|
|
|
5
5
|
var _state$schema$nodes = state.schema.nodes,
|
|
6
6
|
inlineExtension = _state$schema$nodes.inlineExtension,
|
|
7
7
|
extension = _state$schema$nodes.extension,
|
|
8
|
-
bodiedExtension = _state$schema$nodes.bodiedExtension
|
|
9
|
-
|
|
8
|
+
bodiedExtension = _state$schema$nodes.bodiedExtension,
|
|
9
|
+
multiBodiedExtension = _state$schema$nodes.multiBodiedExtension;
|
|
10
|
+
var nodeTypes = [extension, bodiedExtension, inlineExtension, multiBodiedExtension];
|
|
10
11
|
return findSelectedNodeOfType(nodeTypes)(state.selection) || searchParent && findParentNodeOfType(nodeTypes)(state.selection) || undefined;
|
|
11
12
|
};
|
|
12
13
|
export var findExtensionWithLocalId = function findExtensionWithLocalId(state, localId) {
|
|
@@ -20,8 +21,9 @@ export var findExtensionWithLocalId = function findExtensionWithLocalId(state, l
|
|
|
20
21
|
var _state$schema$nodes2 = state.schema.nodes,
|
|
21
22
|
inlineExtension = _state$schema$nodes2.inlineExtension,
|
|
22
23
|
extension = _state$schema$nodes2.extension,
|
|
23
|
-
bodiedExtension = _state$schema$nodes2.bodiedExtension
|
|
24
|
-
|
|
24
|
+
bodiedExtension = _state$schema$nodes2.bodiedExtension,
|
|
25
|
+
multiBodiedExtension = _state$schema$nodes2.multiBodiedExtension;
|
|
26
|
+
var nodeTypes = [extension, bodiedExtension, inlineExtension, multiBodiedExtension];
|
|
25
27
|
var matched;
|
|
26
28
|
state.doc.descendants(function (node, pos) {
|
|
27
29
|
if (nodeTypes.includes(node.type) && node.attrs.localId === localId) {
|
|
@@ -2,4 +2,5 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
var _templateObject;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { blockNodesVerticalMargin, akEditorSelectedBorderSize, akEditorDeleteBorder, akEditorDeleteBackground, SelectionStyle, getSelectionStyles, akEditorSelectedNodeClassName } from '@atlaskit/editor-shared-styles';
|
|
5
|
-
|
|
5
|
+
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
6
|
+
export var extensionStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n .multiBodiedExtensionView-content-wrap.", ":not(.danger) {\n ", "\n }\n\n .extensionView-content-wrap,\n .multiBodiedExtensionView-content-wrap,\n .bodiedExtensionView-content-wrap {\n margin: ", " 0;\n\n &:first-of-type {\n margin-top: 0;\n }\n\n &:last-of-type {\n margin-bottom: 0;\n }\n\n &:not(.danger).", " {\n & > span > .extension-container {\n ", "\n }\n }\n\n &.danger > span > .extension-container {\n box-shadow: 0 0 0 ", "px\n ", ";\n background-color: ", ";\n }\n\n &.inline {\n word-wrap: break-all;\n }\n }\n\n .extensionView-content-wrap .extension-container {\n overflow: hidden;\n }\n\n .bodiedExtensionView-content-wrap\n .extensionView-content-wrap\n .extension-container {\n width: 100%;\n max-width: 100%; // ensure width can't go over 100%;\n }\n\n [data-mark-type='fragment'] {\n & > .extensionView-content-wrap,\n & > .bodiedExtensionView-content-wrap {\n margin: ", " 0;\n }\n\n & > [data-mark-type='dataConsumer'] {\n & > .extensionView-content-wrap,\n & > .bodiedExtensionView-content-wrap {\n margin: ", " 0;\n }\n }\n\n &:first-child {\n & > .extensionView-content-wrap,\n & > .bodiedExtensionView-content-wrap {\n margin-top: 0;\n }\n\n & > [data-mark-type='dataConsumer'] {\n & > .extensionView-content-wrap,\n & > .bodiedExtensionView-content-wrap {\n margin-top: 0;\n }\n }\n }\n\n &:nth-last-of-type(-n + 2):not(:first-of-type) {\n & > .extensionView-content-wrap,\n & > .bodiedExtensionView-content-wrap {\n margin-bottom: 0;\n }\n\n & > [data-mark-type='dataConsumer'] {\n & > .extensionView-content-wrap,\n & > .bodiedExtensionView-content-wrap {\n margin-bottom: 0;\n }\n }\n }\n }\n"])), akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.BoxShadow, SelectionStyle.Blanket]), blockNodesVerticalMargin, akEditorSelectedNodeClassName, getSelectionStyles([SelectionStyle.BoxShadow]), akEditorSelectedBorderSize, "var(--ds-border-danger, ".concat(akEditorDeleteBorder, ")"), "var(--ds-background-danger, ".concat(akEditorDeleteBackground, ")"), blockNodesVerticalMargin, blockNodesVerticalMargin);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export var name = "@atlaskit/editor-core";
|
|
2
|
-
export var version = "189.
|
|
2
|
+
export var version = "189.4.0";
|
|
@@ -8,6 +8,9 @@ type Config = {
|
|
|
8
8
|
};
|
|
9
9
|
declare const avatarGroup: NextEditorPlugin<'avatarGroup', {
|
|
10
10
|
pluginConfiguration: Config;
|
|
11
|
-
dependencies: [
|
|
11
|
+
dependencies: [
|
|
12
|
+
OptionalPlugin<FeatureFlagsPlugin>,
|
|
13
|
+
OptionalPlugin<AnalyticsPlugin>
|
|
14
|
+
];
|
|
12
15
|
}>;
|
|
13
16
|
export default avatarGroup;
|
|
@@ -2,10 +2,13 @@ import type { NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/t
|
|
|
2
2
|
import { pluginKey } from './plugin';
|
|
3
3
|
import type { PrivateCollabEditOptions } from './types';
|
|
4
4
|
import type { FeatureFlagsPlugin } from '@atlaskit/editor-plugin-feature-flags';
|
|
5
|
-
import type {
|
|
5
|
+
import type { AnalyticsPlugin } from '@atlaskit/editor-plugin-analytics';
|
|
6
6
|
export { pluginKey };
|
|
7
7
|
declare const collabEditPlugin: NextEditorPlugin<'collabEdit', {
|
|
8
8
|
pluginConfiguration: PrivateCollabEditOptions;
|
|
9
|
-
dependencies: [
|
|
9
|
+
dependencies: [
|
|
10
|
+
OptionalPlugin<FeatureFlagsPlugin>,
|
|
11
|
+
OptionalPlugin<AnalyticsPlugin>
|
|
12
|
+
];
|
|
10
13
|
}>;
|
|
11
14
|
export default collabEditPlugin;
|
|
@@ -3,6 +3,7 @@ import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
3
3
|
import type { ExtensionState } from './types';
|
|
4
4
|
import type { Parameters, TransformBefore, TransformAfter } from '@atlaskit/editor-common/src/extensions';
|
|
5
5
|
import type { ApplyChangeHandler } from '@atlaskit/editor-plugin-context-panel';
|
|
6
|
+
import type { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
6
7
|
export declare function updateState(state: Partial<ExtensionState>): import("@atlaskit/editor-common/types").Command;
|
|
7
8
|
export declare function setEditingContextToContextPanel<T extends Parameters = Parameters>(processParametersBefore: TransformBefore<T>, processParametersAfter: TransformAfter<T>, applyChangeToContextPanel: ApplyChangeHandler | undefined): import("@atlaskit/editor-common/types").Command;
|
|
8
9
|
export declare const clearEditingContext: (applyChangeToContextPanel: ApplyChangeHandler | undefined) => import("@atlaskit/editor-common/types").Command;
|
|
@@ -10,3 +11,4 @@ export declare const forceAutoSave: (applyChangeToContextPanel: ApplyChangeHandl
|
|
|
10
11
|
export declare const updateExtensionLayout: (layout: ExtensionLayout) => import("@atlaskit/editor-common/types").Command;
|
|
11
12
|
export declare const removeExtension: () => import("@atlaskit/editor-common/types").Command;
|
|
12
13
|
export declare const removeDescendantNodes: (sourceNode?: PMNode) => import("@atlaskit/editor-common/types").Command;
|
|
14
|
+
export declare const checkAndRemoveExtensionNode: (state: EditorState, tr: Transaction) => Transaction;
|
|
@@ -3,5 +3,12 @@ type Props = {
|
|
|
3
3
|
children: React.ReactNode;
|
|
4
4
|
nodeType: string;
|
|
5
5
|
};
|
|
6
|
+
/**
|
|
7
|
+
* If inlineExtension, add zero width space to the end of the nodes and wrap with span;
|
|
8
|
+
* else wrap with a div (for multi bodied extensions)
|
|
9
|
+
*
|
|
10
|
+
* @param param0
|
|
11
|
+
* @returns
|
|
12
|
+
*/
|
|
6
13
|
declare const ExtensionNodeWrapper: ({ children, nodeType }: Props) => JSX.Element;
|
|
7
14
|
export default ExtensionNodeWrapper;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import type { MultiBodiedExtensionActions } from '@atlaskit/editor-common/extensions';
|
|
5
|
+
import type { Node as PmNode } from '@atlaskit/editor-prosemirror/model';
|
|
6
|
+
import type { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
7
|
+
export type TryExtensionHandlerType = (actions: MultiBodiedExtensionActions | undefined) => React.ReactElement | null;
|
|
8
|
+
type Props = {
|
|
9
|
+
node: PmNode;
|
|
10
|
+
handleContentDOMRef: (node: HTMLElement | null) => void;
|
|
11
|
+
editorView: EditorView;
|
|
12
|
+
getPos: () => number | undefined;
|
|
13
|
+
tryExtensionHandler: TryExtensionHandlerType;
|
|
14
|
+
};
|
|
15
|
+
declare const MultiBodiedExtension: ({ node, handleContentDOMRef, getPos, tryExtensionHandler, editorView, }: Props) => jsx.JSX.Element;
|
|
16
|
+
export default MultiBodiedExtension;
|
|
@@ -7,7 +7,10 @@ type Config = {
|
|
|
7
7
|
};
|
|
8
8
|
export type FindReplacePlugin = NextEditorPlugin<'findReplace', {
|
|
9
9
|
pluginConfiguration: Config;
|
|
10
|
-
dependencies: [
|
|
10
|
+
dependencies: [
|
|
11
|
+
OptionalPlugin<FeatureFlagsPlugin>,
|
|
12
|
+
OptionalPlugin<AnalyticsPlugin>
|
|
13
|
+
];
|
|
11
14
|
}>;
|
|
12
15
|
export declare const findReplacePlugin: FindReplacePlugin;
|
|
13
16
|
export default findReplacePlugin;
|
|
@@ -21,7 +21,7 @@ import type { PlaceholderTextPlugin } from '@atlaskit/editor-plugin-placeholder-
|
|
|
21
21
|
import type { ExpandPlugin } from '@atlaskit/editor-plugin-expand';
|
|
22
22
|
import type { TasksAndDecisionsPlugin } from '@atlaskit/editor-plugin-tasks-and-decisions';
|
|
23
23
|
export type InsertBlockPluginDependencies = [
|
|
24
|
-
FeatureFlagsPlugin
|
|
24
|
+
OptionalPlugin<FeatureFlagsPlugin>,
|
|
25
25
|
TypeAheadPlugin,
|
|
26
26
|
OptionalPlugin<TablePlugin>,
|
|
27
27
|
OptionalPlugin<HyperlinkPlugin>,
|
|
@@ -14,7 +14,7 @@ type Config = {
|
|
|
14
14
|
type ToolbarListsIndentationPlugin = NextEditorPlugin<'toolbarListsIndentation', {
|
|
15
15
|
pluginConfiguration: Config;
|
|
16
16
|
dependencies: [
|
|
17
|
-
FeatureFlagsPlugin
|
|
17
|
+
OptionalPlugin<FeatureFlagsPlugin>,
|
|
18
18
|
ListPlugin,
|
|
19
19
|
OptionalPlugin<IndentationPlugin>,
|
|
20
20
|
OptionalPlugin<TasksAndDecisionsPlugin>,
|