@atlaskit/editor-common 74.30.0 → 74.32.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 +12 -0
- package/dist/cjs/lists/analytics.js +40 -0
- package/dist/cjs/lists/indentation.js +24 -0
- package/dist/cjs/lists/index.js +89 -0
- package/dist/cjs/lists/node.js +97 -0
- package/dist/cjs/lists/replace-content.js +24 -0
- package/dist/cjs/lists/selection.js +59 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/node-width/index.js +10 -2
- package/dist/cjs/types/input-rules.js +5 -0
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/utils/commands.js +110 -2
- package/dist/cjs/utils/document.js +26 -1
- package/dist/cjs/utils/index.js +58 -2
- package/dist/cjs/utils/input-rules.js +26 -0
- package/dist/cjs/utils/prosemirror/autojoin.js +68 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/lists/analytics.js +36 -0
- package/dist/es2019/lists/indentation.js +18 -0
- package/dist/es2019/lists/index.js +6 -0
- package/dist/es2019/lists/node.js +97 -0
- package/dist/es2019/lists/replace-content.js +18 -0
- package/dist/es2019/lists/selection.js +53 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/node-width/index.js +7 -0
- package/dist/es2019/types/input-rules.js +1 -0
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/utils/commands.js +106 -2
- package/dist/es2019/utils/document.js +25 -1
- package/dist/es2019/utils/index.js +5 -3
- package/dist/es2019/utils/input-rules.js +16 -0
- package/dist/es2019/utils/prosemirror/autojoin.js +57 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/lists/analytics.js +32 -0
- package/dist/esm/lists/indentation.js +17 -0
- package/dist/esm/lists/index.js +6 -0
- package/dist/esm/lists/node.js +87 -0
- package/dist/esm/lists/replace-content.js +17 -0
- package/dist/esm/lists/selection.js +50 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/node-width/index.js +7 -0
- package/dist/esm/types/input-rules.js +1 -0
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/utils/commands.js +104 -2
- package/dist/esm/utils/document.js +25 -1
- package/dist/esm/utils/index.js +5 -3
- package/dist/esm/utils/input-rules.js +18 -0
- package/dist/esm/utils/prosemirror/autojoin.js +63 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/lists/analytics.d.ts +4 -0
- package/dist/types/lists/indentation.d.ts +5 -0
- package/dist/types/lists/index.d.ts +6 -0
- package/dist/types/lists/node.d.ts +18 -0
- package/dist/types/lists/replace-content.d.ts +8 -0
- package/dist/types/lists/selection.d.ts +13 -0
- package/dist/types/node-width/index.d.ts +1 -0
- package/dist/types/types/index.d.ts +1 -0
- package/dist/types/types/input-rules.d.ts +8 -0
- package/dist/types/utils/commands.d.ts +36 -2
- package/dist/types/utils/document.d.ts +4 -0
- package/dist/types/utils/index.d.ts +5 -2
- package/dist/types/utils/input-rules.d.ts +7 -0
- package/dist/types/utils/prosemirror/autojoin.d.ts +13 -0
- package/dist/types-ts4.5/lists/analytics.d.ts +4 -0
- package/dist/types-ts4.5/lists/indentation.d.ts +5 -0
- package/dist/types-ts4.5/lists/index.d.ts +6 -0
- package/dist/types-ts4.5/lists/node.d.ts +18 -0
- package/dist/types-ts4.5/lists/replace-content.d.ts +8 -0
- package/dist/types-ts4.5/lists/selection.d.ts +13 -0
- package/dist/types-ts4.5/node-width/index.d.ts +1 -0
- package/dist/types-ts4.5/types/index.d.ts +1 -0
- package/dist/types-ts4.5/types/input-rules.d.ts +8 -0
- package/dist/types-ts4.5/utils/commands.d.ts +42 -2
- package/dist/types-ts4.5/utils/document.d.ts +4 -0
- package/dist/types-ts4.5/utils/index.d.ts +5 -2
- package/dist/types-ts4.5/utils/input-rules.d.ts +7 -0
- package/dist/types-ts4.5/utils/prosemirror/autojoin.d.ts +13 -0
- package/lists/package.json +15 -0
- package/package.json +3 -2
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
export declare const numberNestedLists: (resolvedPos: ResolvedPos) => number;
|
|
4
|
+
export declare const getListItemAttributes: ($pos: ResolvedPos) => {
|
|
5
|
+
indentLevel: number;
|
|
6
|
+
itemIndex: number;
|
|
7
|
+
};
|
|
8
|
+
type NormalizeListItemsSelection = (props: {
|
|
9
|
+
selection: Selection;
|
|
10
|
+
doc: PMNode;
|
|
11
|
+
}) => Selection;
|
|
12
|
+
export declare const normalizeListItemsSelection: NormalizeListItemsSelection;
|
|
13
|
+
export {};
|
|
@@ -12,3 +12,4 @@ export declare const layoutToWidth: {
|
|
|
12
12
|
*/
|
|
13
13
|
export declare const getParentNodeWidth: (pos: number | undefined, state: EditorState, containerWidth: EditorContainerWidth, isFullWidthModeEnabled?: boolean) => any;
|
|
14
14
|
export declare const getTableContainerWidth: (node: PMNode) => number;
|
|
15
|
+
export declare const getTableWidthWithNumberColumn: (node: PMNode, offset: number) => number;
|
|
@@ -41,3 +41,4 @@ export type { DatasourceModalType } from './datasource';
|
|
|
41
41
|
export type { ImageUploadPluginReferenceEventBase, ImageUploadPluginReferenceEventDragEvent, ImageUploadPluginReferenceEventClipboardEvent, ImageUploadPluginReferenceEvent, } from './image-upload-reference-event';
|
|
42
42
|
export type { HeadingLevels, NormalTextLevel, HeadingLevelsAndNormalText, } from './block-type';
|
|
43
43
|
export type { ColumnResizingPluginState } from './tables';
|
|
44
|
+
export type { InputRuleHandler, OnHandlerApply, InputRuleWrapper, } from './input-rules';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { EditorState, Transaction } from 'prosemirror-state';
|
|
2
|
+
export type InputRuleHandler = (state: EditorState, matchResult: RegExpExecArray, start: number, end: number) => Transaction | null;
|
|
3
|
+
export type OnHandlerApply = (state: EditorState, tr: Transaction, matchResult: RegExpExecArray) => void;
|
|
4
|
+
export interface InputRuleWrapper {
|
|
5
|
+
match: RegExp;
|
|
6
|
+
handler: InputRuleHandler;
|
|
7
|
+
onHandlerApply?: OnHandlerApply;
|
|
8
|
+
}
|
|
@@ -1,2 +1,36 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { Fragment, Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import type { Command } from '../types';
|
|
5
|
+
export type WalkNode = {
|
|
6
|
+
$pos: ResolvedPos;
|
|
7
|
+
foundNode: boolean;
|
|
8
|
+
};
|
|
9
|
+
type Predicate = (state: EditorState, view?: EditorView) => boolean;
|
|
10
|
+
declare const filter: (predicates: Predicate[] | Predicate, cmd: Command) => Command;
|
|
11
|
+
/**
|
|
12
|
+
* Walk forwards from a position until we encounter the (inside) start of
|
|
13
|
+
* the next node, or reach the end of the document.
|
|
14
|
+
*
|
|
15
|
+
* @param $startPos Position to start walking from.
|
|
16
|
+
*/
|
|
17
|
+
export declare const walkNextNode: ($startPos: ResolvedPos) => WalkNode;
|
|
18
|
+
/**
|
|
19
|
+
* Walk backwards from a position until we encounter the (inside) end of
|
|
20
|
+
* the previous node, or reach the start of the document.
|
|
21
|
+
*
|
|
22
|
+
* @param $startPos Position to start walking from.
|
|
23
|
+
*/
|
|
24
|
+
export declare const walkPrevNode: ($startPos: ResolvedPos) => WalkNode;
|
|
25
|
+
/**
|
|
26
|
+
* If the selection is empty, is inside a paragraph node and `canNextNodeMoveUp` is true then delete current paragraph
|
|
27
|
+
* and move the node below it up. The selection will be retained, to be placed in the moved node.
|
|
28
|
+
*
|
|
29
|
+
* @param canNextNodeMoveUp check if node directly after the selection is able to be brought up to selection
|
|
30
|
+
* @returns PM Command
|
|
31
|
+
*/
|
|
32
|
+
export declare const deleteEmptyParagraphAndMoveBlockUp: (canNextNodeMoveUp: (nextNode: PMNode) => boolean) => Command;
|
|
33
|
+
export declare const insertContentDeleteRange: (tr: Transaction, getSelectionResolvedPos: (tr: Transaction) => ResolvedPos, insertions: [Fragment, number][], deletions: [number, number][]) => void;
|
|
34
|
+
export declare const isEmptySelectionAtStart: (state: EditorState) => boolean;
|
|
35
|
+
export declare const isEmptySelectionAtEnd: (state: EditorState) => boolean;
|
|
36
|
+
export { filter as filterCommand };
|
|
@@ -16,4 +16,8 @@ export declare function isEmptyDocument(node: Node): boolean;
|
|
|
16
16
|
export declare function bracketTyped(state: EditorState): boolean;
|
|
17
17
|
export declare function nodesBetweenChanged(tr: Transaction | ReadonlyTransaction, f: ChangedFn, startPos?: number): void;
|
|
18
18
|
export declare function processRawValue(schema: Schema, value?: ReplaceRawValue, providerFactory?: ProviderFactory, sanitizePrivateContent?: boolean, contentTransformer?: Transformer<string>, dispatchAnalyticsEvent?: DispatchAnalyticsEvent): Node | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Returns false if node contains only empty inline nodes and hardBreaks.
|
|
21
|
+
*/
|
|
22
|
+
export declare function hasVisibleContent(node: Node): boolean;
|
|
19
23
|
export {};
|
|
@@ -45,14 +45,17 @@ export type { ShallowPropsDifference, PropsDifference } from './compare-props';
|
|
|
45
45
|
export { useComponentRenderTracking } from './performance/hooks/use-component-render-tracking';
|
|
46
46
|
export type { UseComponentRenderTrackingArgs } from './performance/hooks/use-component-render-tracking';
|
|
47
47
|
export { isOutdatedBrowser } from './outdated-browsers';
|
|
48
|
+
export { autoJoinTr } from './prosemirror/autojoin';
|
|
48
49
|
export { isReferencedSource, removeConnectedNodes, getChildrenInfo, getNodeName, } from './referentiality';
|
|
49
50
|
export { getItemCounterDigitsSize, getOrderFromOrderedListNode, resolveOrder, isListNode, isParagraphNode, isListItemNode, isBulletList, } from './list';
|
|
50
51
|
export { isFromCurrentDomain, LinkMatcher, normalizeUrl, linkifyContent, getLinkDomain, findFilepaths, isLinkInMatches, FILEPATH_REGEXP, DONTLINKIFY_REGEXP, getLinkCreationAnalyticsEvent, canLinkBeCreatedInRange, } from './hyperlink';
|
|
51
52
|
export declare const pmHistoryPluginKey = "history$";
|
|
52
53
|
export { gridTypeForLayout } from './grid';
|
|
53
|
-
export { nodesBetweenChanged, getStepRange, isEmptyDocument, processRawValue, hasDocAsParent, bracketTyped, } from './document';
|
|
54
|
+
export { nodesBetweenChanged, getStepRange, isEmptyDocument, processRawValue, hasDocAsParent, bracketTyped, hasVisibleContent, } from './document';
|
|
54
55
|
export { floatingLayouts, isRichMediaInsideOfBlockNode, calculateSnapPoints, alignAttributes, } from './rich-media-utils';
|
|
55
56
|
export { sanitizeNodeForPrivacy } from './filter/privacy-filter';
|
|
56
57
|
export { canRenderDatasource } from './datasource';
|
|
57
|
-
export {
|
|
58
|
+
export { filterCommand, walkPrevNode, walkNextNode, isEmptySelectionAtStart, isEmptySelectionAtEnd, insertContentDeleteRange, deleteEmptyParagraphAndMoveBlockUp, } from './commands';
|
|
59
|
+
export type { WalkNode } from './commands';
|
|
58
60
|
export declare function shallowEqual(obj1?: any, obj2?: any): boolean;
|
|
61
|
+
export { inputRuleWithAnalytics } from './input-rules';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EditorState } from 'prosemirror-state';
|
|
2
|
+
import type { EditorAnalyticsAPI } from '../analytics';
|
|
3
|
+
import type { AnalyticsEventPayload } from '../analytics/types';
|
|
4
|
+
import type { InputRuleWrapper } from '../types/input-rules';
|
|
5
|
+
type GetPayload = AnalyticsEventPayload | ((state: EditorState, matchResult: RegExpExecArray) => AnalyticsEventPayload);
|
|
6
|
+
export declare const inputRuleWithAnalytics: (getPayload: GetPayload, analyticsApi: EditorAnalyticsAPI | undefined) => (originalRule: InputRuleWrapper) => InputRuleWrapper;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
/**
|
|
4
|
+
* Checks whether two adjacent nodes can be joined. If so, the document
|
|
5
|
+
* will be updated to join those nodes. If not, the original transaction
|
|
6
|
+
* remains untouched.
|
|
7
|
+
*
|
|
8
|
+
* Nodes are considered joinable if the `isJoinable` predicate returns true or,
|
|
9
|
+
* if an array of strings was passed, if their node type name is in that array.
|
|
10
|
+
*
|
|
11
|
+
* Adapted from https://github.com/ProseMirror/prosemirror-commands/blob/master/src/commands.js#L597-L610
|
|
12
|
+
*/
|
|
13
|
+
export declare function autoJoinTr(tr: Transaction, isJoinable: ((before: Node, after: Node) => boolean) | string[]): void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
+
import { CommonListAnalyticsAttributes } from '../analytics';
|
|
3
|
+
export declare const getCommonListAnalyticsAttributes: (state: EditorState) => CommonListAnalyticsAttributes;
|
|
4
|
+
export declare const countListItemsInSelection: (state: EditorState) => number;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { getListItemAttributes, normalizeListItemsSelection, } from './selection';
|
|
2
|
+
export { moveTargetIntoList } from './replace-content';
|
|
3
|
+
export { JoinDirection, isListNodeValidContent, joinSiblingLists, } from './node';
|
|
4
|
+
export { getCommonListAnalyticsAttributes, countListItemsInSelection, } from './analytics';
|
|
5
|
+
export { hasValidListIndentationLevel } from './indentation';
|
|
6
|
+
export { isListNode, isListItemNode, isBulletList, isParagraphNode, } from '../utils';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NodeType, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
export declare function isListNodeValidContent(node: PMNode): boolean;
|
|
4
|
+
export declare enum JoinDirection {
|
|
5
|
+
LEFT = 1,
|
|
6
|
+
RIGHT = -1
|
|
7
|
+
}
|
|
8
|
+
type JoinSiblingListsProps = {
|
|
9
|
+
tr: Transaction;
|
|
10
|
+
direction?: JoinDirection;
|
|
11
|
+
forceListType?: NodeType;
|
|
12
|
+
};
|
|
13
|
+
type ListsJoined = {
|
|
14
|
+
orderedList: number;
|
|
15
|
+
bulletList: number;
|
|
16
|
+
};
|
|
17
|
+
export declare const joinSiblingLists: ({ tr, direction, forceListType, }: JoinSiblingListsProps) => ListsJoined;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import { Step } from '@atlaskit/editor-prosemirror/transform';
|
|
3
|
+
type Params = {
|
|
4
|
+
insertPosition: number;
|
|
5
|
+
$target: ResolvedPos;
|
|
6
|
+
};
|
|
7
|
+
export declare const moveTargetIntoList: ({ insertPosition, $target, }: Params) => Step;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import { Selection } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
export declare const numberNestedLists: (resolvedPos: ResolvedPos) => number;
|
|
4
|
+
export declare const getListItemAttributes: ($pos: ResolvedPos) => {
|
|
5
|
+
indentLevel: number;
|
|
6
|
+
itemIndex: number;
|
|
7
|
+
};
|
|
8
|
+
type NormalizeListItemsSelection = (props: {
|
|
9
|
+
selection: Selection;
|
|
10
|
+
doc: PMNode;
|
|
11
|
+
}) => Selection;
|
|
12
|
+
export declare const normalizeListItemsSelection: NormalizeListItemsSelection;
|
|
13
|
+
export {};
|
|
@@ -12,3 +12,4 @@ export declare const layoutToWidth: {
|
|
|
12
12
|
*/
|
|
13
13
|
export declare const getParentNodeWidth: (pos: number | undefined, state: EditorState, containerWidth: EditorContainerWidth, isFullWidthModeEnabled?: boolean) => any;
|
|
14
14
|
export declare const getTableContainerWidth: (node: PMNode) => number;
|
|
15
|
+
export declare const getTableWidthWithNumberColumn: (node: PMNode, offset: number) => number;
|
|
@@ -41,3 +41,4 @@ export type { DatasourceModalType } from './datasource';
|
|
|
41
41
|
export type { ImageUploadPluginReferenceEventBase, ImageUploadPluginReferenceEventDragEvent, ImageUploadPluginReferenceEventClipboardEvent, ImageUploadPluginReferenceEvent, } from './image-upload-reference-event';
|
|
42
42
|
export type { HeadingLevels, NormalTextLevel, HeadingLevelsAndNormalText, } from './block-type';
|
|
43
43
|
export type { ColumnResizingPluginState } from './tables';
|
|
44
|
+
export type { InputRuleHandler, OnHandlerApply, InputRuleWrapper, } from './input-rules';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { EditorState, Transaction } from 'prosemirror-state';
|
|
2
|
+
export type InputRuleHandler = (state: EditorState, matchResult: RegExpExecArray, start: number, end: number) => Transaction | null;
|
|
3
|
+
export type OnHandlerApply = (state: EditorState, tr: Transaction, matchResult: RegExpExecArray) => void;
|
|
4
|
+
export interface InputRuleWrapper {
|
|
5
|
+
match: RegExp;
|
|
6
|
+
handler: InputRuleHandler;
|
|
7
|
+
onHandlerApply?: OnHandlerApply;
|
|
8
|
+
}
|
|
@@ -1,2 +1,42 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type { Fragment, Node as PMNode, ResolvedPos } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import { EditorState, Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
import { EditorView } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
+
import type { Command } from '../types';
|
|
5
|
+
export type WalkNode = {
|
|
6
|
+
$pos: ResolvedPos;
|
|
7
|
+
foundNode: boolean;
|
|
8
|
+
};
|
|
9
|
+
type Predicate = (state: EditorState, view?: EditorView) => boolean;
|
|
10
|
+
declare const filter: (predicates: Predicate[] | Predicate, cmd: Command) => Command;
|
|
11
|
+
/**
|
|
12
|
+
* Walk forwards from a position until we encounter the (inside) start of
|
|
13
|
+
* the next node, or reach the end of the document.
|
|
14
|
+
*
|
|
15
|
+
* @param $startPos Position to start walking from.
|
|
16
|
+
*/
|
|
17
|
+
export declare const walkNextNode: ($startPos: ResolvedPos) => WalkNode;
|
|
18
|
+
/**
|
|
19
|
+
* Walk backwards from a position until we encounter the (inside) end of
|
|
20
|
+
* the previous node, or reach the start of the document.
|
|
21
|
+
*
|
|
22
|
+
* @param $startPos Position to start walking from.
|
|
23
|
+
*/
|
|
24
|
+
export declare const walkPrevNode: ($startPos: ResolvedPos) => WalkNode;
|
|
25
|
+
/**
|
|
26
|
+
* If the selection is empty, is inside a paragraph node and `canNextNodeMoveUp` is true then delete current paragraph
|
|
27
|
+
* and move the node below it up. The selection will be retained, to be placed in the moved node.
|
|
28
|
+
*
|
|
29
|
+
* @param canNextNodeMoveUp check if node directly after the selection is able to be brought up to selection
|
|
30
|
+
* @returns PM Command
|
|
31
|
+
*/
|
|
32
|
+
export declare const deleteEmptyParagraphAndMoveBlockUp: (canNextNodeMoveUp: (nextNode: PMNode) => boolean) => Command;
|
|
33
|
+
export declare const insertContentDeleteRange: (tr: Transaction, getSelectionResolvedPos: (tr: Transaction) => ResolvedPos, insertions: [
|
|
34
|
+
Fragment,
|
|
35
|
+
number
|
|
36
|
+
][], deletions: [
|
|
37
|
+
number,
|
|
38
|
+
number
|
|
39
|
+
][]) => void;
|
|
40
|
+
export declare const isEmptySelectionAtStart: (state: EditorState) => boolean;
|
|
41
|
+
export declare const isEmptySelectionAtEnd: (state: EditorState) => boolean;
|
|
42
|
+
export { filter as filterCommand };
|
|
@@ -16,4 +16,8 @@ export declare function isEmptyDocument(node: Node): boolean;
|
|
|
16
16
|
export declare function bracketTyped(state: EditorState): boolean;
|
|
17
17
|
export declare function nodesBetweenChanged(tr: Transaction | ReadonlyTransaction, f: ChangedFn, startPos?: number): void;
|
|
18
18
|
export declare function processRawValue(schema: Schema, value?: ReplaceRawValue, providerFactory?: ProviderFactory, sanitizePrivateContent?: boolean, contentTransformer?: Transformer<string>, dispatchAnalyticsEvent?: DispatchAnalyticsEvent): Node | undefined;
|
|
19
|
+
/**
|
|
20
|
+
* Returns false if node contains only empty inline nodes and hardBreaks.
|
|
21
|
+
*/
|
|
22
|
+
export declare function hasVisibleContent(node: Node): boolean;
|
|
19
23
|
export {};
|
|
@@ -45,14 +45,17 @@ export type { ShallowPropsDifference, PropsDifference } from './compare-props';
|
|
|
45
45
|
export { useComponentRenderTracking } from './performance/hooks/use-component-render-tracking';
|
|
46
46
|
export type { UseComponentRenderTrackingArgs } from './performance/hooks/use-component-render-tracking';
|
|
47
47
|
export { isOutdatedBrowser } from './outdated-browsers';
|
|
48
|
+
export { autoJoinTr } from './prosemirror/autojoin';
|
|
48
49
|
export { isReferencedSource, removeConnectedNodes, getChildrenInfo, getNodeName, } from './referentiality';
|
|
49
50
|
export { getItemCounterDigitsSize, getOrderFromOrderedListNode, resolveOrder, isListNode, isParagraphNode, isListItemNode, isBulletList, } from './list';
|
|
50
51
|
export { isFromCurrentDomain, LinkMatcher, normalizeUrl, linkifyContent, getLinkDomain, findFilepaths, isLinkInMatches, FILEPATH_REGEXP, DONTLINKIFY_REGEXP, getLinkCreationAnalyticsEvent, canLinkBeCreatedInRange, } from './hyperlink';
|
|
51
52
|
export declare const pmHistoryPluginKey = "history$";
|
|
52
53
|
export { gridTypeForLayout } from './grid';
|
|
53
|
-
export { nodesBetweenChanged, getStepRange, isEmptyDocument, processRawValue, hasDocAsParent, bracketTyped, } from './document';
|
|
54
|
+
export { nodesBetweenChanged, getStepRange, isEmptyDocument, processRawValue, hasDocAsParent, bracketTyped, hasVisibleContent, } from './document';
|
|
54
55
|
export { floatingLayouts, isRichMediaInsideOfBlockNode, calculateSnapPoints, alignAttributes, } from './rich-media-utils';
|
|
55
56
|
export { sanitizeNodeForPrivacy } from './filter/privacy-filter';
|
|
56
57
|
export { canRenderDatasource } from './datasource';
|
|
57
|
-
export {
|
|
58
|
+
export { filterCommand, walkPrevNode, walkNextNode, isEmptySelectionAtStart, isEmptySelectionAtEnd, insertContentDeleteRange, deleteEmptyParagraphAndMoveBlockUp, } from './commands';
|
|
59
|
+
export type { WalkNode } from './commands';
|
|
58
60
|
export declare function shallowEqual(obj1?: any, obj2?: any): boolean;
|
|
61
|
+
export { inputRuleWithAnalytics } from './input-rules';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EditorState } from 'prosemirror-state';
|
|
2
|
+
import type { EditorAnalyticsAPI } from '../analytics';
|
|
3
|
+
import type { AnalyticsEventPayload } from '../analytics/types';
|
|
4
|
+
import type { InputRuleWrapper } from '../types/input-rules';
|
|
5
|
+
type GetPayload = AnalyticsEventPayload | ((state: EditorState, matchResult: RegExpExecArray) => AnalyticsEventPayload);
|
|
6
|
+
export declare const inputRuleWithAnalytics: (getPayload: GetPayload, analyticsApi: EditorAnalyticsAPI | undefined) => (originalRule: InputRuleWrapper) => InputRuleWrapper;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Node } from '@atlaskit/editor-prosemirror/model';
|
|
2
|
+
import type { Transaction } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
+
/**
|
|
4
|
+
* Checks whether two adjacent nodes can be joined. If so, the document
|
|
5
|
+
* will be updated to join those nodes. If not, the original transaction
|
|
6
|
+
* remains untouched.
|
|
7
|
+
*
|
|
8
|
+
* Nodes are considered joinable if the `isJoinable` predicate returns true or,
|
|
9
|
+
* if an array of strings was passed, if their node type name is in that array.
|
|
10
|
+
*
|
|
11
|
+
* Adapted from https://github.com/ProseMirror/prosemirror-commands/blob/master/src/commands.js#L597-L610
|
|
12
|
+
*/
|
|
13
|
+
export declare function autoJoinTr(tr: Transaction, isJoinable: ((before: Node, after: Node) => boolean) | string[]): void;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/editor-common/lists",
|
|
3
|
+
"main": "../dist/cjs/lists/index.js",
|
|
4
|
+
"module": "../dist/esm/lists/index.js",
|
|
5
|
+
"module:es2019": "../dist/es2019/lists/index.js",
|
|
6
|
+
"sideEffects": false,
|
|
7
|
+
"types": "../dist/types/lists/index.d.ts",
|
|
8
|
+
"typesVersions": {
|
|
9
|
+
">=4.5 <4.9": {
|
|
10
|
+
"*": [
|
|
11
|
+
"../dist/types-ts4.5/lists/index.d.ts"
|
|
12
|
+
]
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "74.
|
|
3
|
+
"version": "74.32.0",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -75,7 +75,8 @@
|
|
|
75
75
|
"./guideline": "./src/guideline/index.ts",
|
|
76
76
|
"./quick-insert": "./src/quick-insert/index.ts",
|
|
77
77
|
"./link": "./src/link/index.ts",
|
|
78
|
-
"./mark": "./src/mark/index.ts"
|
|
78
|
+
"./mark": "./src/mark/index.ts",
|
|
79
|
+
"./lists": "./src/lists/index.ts"
|
|
79
80
|
},
|
|
80
81
|
"dependencies": {
|
|
81
82
|
"@atlaskit/activity-provider": "^2.4.0",
|