@atlaskit/editor-plugin-placeholder-text 3.1.6 → 3.1.7
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 +8 -0
- package/dist/types/placeholderTextPluginType.d.ts +4 -4
- package/dist/types/pm-plugins/placeholder-text-nodeview.d.ts +1 -1
- package/dist/types/ui/FloatingToolbar/index.d.ts +10 -10
- package/dist/types/ui/FloatingToolbar/utils.d.ts +6 -6
- package/dist/types/ui/PlaceholderFloatingToolbar/index.d.ts +6 -6
- package/dist/types-ts4.5/placeholderTextPluginType.d.ts +4 -4
- package/dist/types-ts4.5/pm-plugins/placeholder-text-nodeview.d.ts +1 -1
- package/dist/types-ts4.5/ui/FloatingToolbar/index.d.ts +10 -10
- package/dist/types-ts4.5/ui/FloatingToolbar/utils.d.ts +6 -6
- package/dist/types-ts4.5/ui/PlaceholderFloatingToolbar/index.d.ts +6 -6
- package/package.json +3 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-placeholder-text
|
|
2
2
|
|
|
3
|
+
## 3.1.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`265c1bf0cefa4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/265c1bf0cefa4) -
|
|
8
|
+
Sorted type and interface props to improve Atlaskit docs
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
3
11
|
## 3.1.6
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -12,18 +12,18 @@ export interface PlaceholderTextPluginOptions {
|
|
|
12
12
|
*/
|
|
13
13
|
export type PlaceholderTextOptions = PlaceholderTextPluginOptions;
|
|
14
14
|
export interface PlaceholderTextPluginState {
|
|
15
|
-
showInsertPanelAt: number | null;
|
|
16
15
|
allowInserting: boolean;
|
|
16
|
+
showInsertPanelAt: number | null;
|
|
17
17
|
}
|
|
18
18
|
export type PlaceholderTextPluginDependencies = [
|
|
19
19
|
OptionalPlugin<typeof analyticsPlugin>,
|
|
20
20
|
OptionalPlugin<TypeAheadPlugin>
|
|
21
21
|
];
|
|
22
22
|
export type PlaceholderTextPlugin = NextEditorPlugin<'placeholderText', {
|
|
23
|
-
dependencies: PlaceholderTextPluginDependencies;
|
|
24
|
-
pluginConfiguration: PlaceholderTextPluginOptions;
|
|
25
|
-
sharedState: PlaceholderTextPluginState | undefined;
|
|
26
23
|
actions: {
|
|
27
24
|
showPlaceholderFloatingToolbar: typeof showPlaceholderFloatingToolbar;
|
|
28
25
|
};
|
|
26
|
+
dependencies: PlaceholderTextPluginDependencies;
|
|
27
|
+
pluginConfiguration: PlaceholderTextPluginOptions;
|
|
28
|
+
sharedState: PlaceholderTextPluginState | undefined;
|
|
29
29
|
}>;
|
|
@@ -2,8 +2,8 @@ import type { getPosHandler } from '@atlaskit/editor-common/react-node-view';
|
|
|
2
2
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
type PmMutationRecord = MutationRecord | {
|
|
5
|
-
type: 'selection';
|
|
6
5
|
target: Node;
|
|
6
|
+
type: 'selection';
|
|
7
7
|
};
|
|
8
8
|
export declare class PlaceholderTextNodeView implements NodeView {
|
|
9
9
|
private readonly node;
|
|
@@ -5,25 +5,25 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
export type Coordinates = {
|
|
8
|
+
bottom?: number;
|
|
8
9
|
left?: number;
|
|
9
10
|
right?: number;
|
|
10
11
|
top?: number;
|
|
11
|
-
bottom?: number;
|
|
12
12
|
};
|
|
13
13
|
export type PositionOffset = Coordinates;
|
|
14
14
|
export interface Props {
|
|
15
|
-
children?: React.ReactNode;
|
|
16
|
-
zIndex?: number;
|
|
17
|
-
className?: string;
|
|
18
|
-
target?: HTMLElement;
|
|
19
|
-
popupsMountPoint?: HTMLElement;
|
|
20
|
-
popupsBoundariesElement?: HTMLElement;
|
|
21
|
-
offset?: number[];
|
|
22
|
-
fitWidth?: number;
|
|
23
|
-
fitHeight?: number;
|
|
24
15
|
absoluteOffset?: PositionOffset;
|
|
25
16
|
alignX?: 'left' | 'center' | 'right';
|
|
26
17
|
alignY?: 'bottom' | 'top';
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
className?: string;
|
|
20
|
+
fitHeight?: number;
|
|
21
|
+
fitWidth?: number;
|
|
22
|
+
offset?: number[];
|
|
27
23
|
onPositionCalculated?: (position: Coordinates) => Coordinates;
|
|
24
|
+
popupsBoundariesElement?: HTMLElement;
|
|
25
|
+
popupsMountPoint?: HTMLElement;
|
|
26
|
+
target?: HTMLElement;
|
|
27
|
+
zIndex?: number;
|
|
28
28
|
}
|
|
29
29
|
export default function FloatingToolbar({ children, target, offset, fitWidth, fitHeight, onPositionCalculated, popupsMountPoint, popupsBoundariesElement, className, absoluteOffset, alignX, alignY, zIndex, }: Props): jsx.JSX.Element | null;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
export declare const getOffsetParent: (editorViewDom: HTMLElement, popupsMountPoint?: HTMLElement) => HTMLElement;
|
|
2
2
|
export declare const getNearestNonTextNode: (node: Node) => HTMLElement;
|
|
3
3
|
export declare const handlePositionCalculatedWith: (offsetParent: HTMLElement, node: Node, getCurrentFixedCoordinates: () => {
|
|
4
|
-
top?: number;
|
|
5
|
-
left?: number;
|
|
6
4
|
bottom?: number;
|
|
5
|
+
left?: number;
|
|
7
6
|
right?: number;
|
|
8
|
-
}) => (position: {
|
|
9
7
|
top?: number;
|
|
10
|
-
|
|
8
|
+
}) => (position: {
|
|
11
9
|
bottom?: number;
|
|
10
|
+
left?: number;
|
|
12
11
|
right?: number;
|
|
13
|
-
}) => {
|
|
14
12
|
top?: number;
|
|
15
|
-
|
|
13
|
+
}) => {
|
|
16
14
|
bottom?: number;
|
|
15
|
+
left?: number;
|
|
17
16
|
right?: number;
|
|
17
|
+
top?: number;
|
|
18
18
|
};
|
|
@@ -2,16 +2,16 @@ import React from 'react';
|
|
|
2
2
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
3
|
import type { Coordinates } from '../FloatingToolbar';
|
|
4
4
|
export interface Props {
|
|
5
|
-
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
editorViewDOM: HTMLElement;
|
|
6
7
|
getFixedCoordinatesFromPos: (pos: number) => Coordinates;
|
|
7
|
-
|
|
8
|
+
getNodeFromPos: (pos: number) => Node;
|
|
8
9
|
hidePlaceholderFloatingToolbar: () => void;
|
|
10
|
+
insertPlaceholder: (value: string) => void;
|
|
11
|
+
popupsBoundariesElement?: HTMLElement;
|
|
12
|
+
popupsMountPoint?: HTMLElement;
|
|
9
13
|
setFocusInEditor: () => void;
|
|
10
14
|
showInsertPanelAt: number;
|
|
11
|
-
editorViewDOM: HTMLElement;
|
|
12
|
-
popupsMountPoint?: HTMLElement;
|
|
13
|
-
popupsBoundariesElement?: HTMLElement;
|
|
14
|
-
children?: React.ReactNode;
|
|
15
15
|
}
|
|
16
16
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
17
17
|
WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
|
|
@@ -12,18 +12,18 @@ export interface PlaceholderTextPluginOptions {
|
|
|
12
12
|
*/
|
|
13
13
|
export type PlaceholderTextOptions = PlaceholderTextPluginOptions;
|
|
14
14
|
export interface PlaceholderTextPluginState {
|
|
15
|
-
showInsertPanelAt: number | null;
|
|
16
15
|
allowInserting: boolean;
|
|
16
|
+
showInsertPanelAt: number | null;
|
|
17
17
|
}
|
|
18
18
|
export type PlaceholderTextPluginDependencies = [
|
|
19
19
|
OptionalPlugin<typeof analyticsPlugin>,
|
|
20
20
|
OptionalPlugin<TypeAheadPlugin>
|
|
21
21
|
];
|
|
22
22
|
export type PlaceholderTextPlugin = NextEditorPlugin<'placeholderText', {
|
|
23
|
-
dependencies: PlaceholderTextPluginDependencies;
|
|
24
|
-
pluginConfiguration: PlaceholderTextPluginOptions;
|
|
25
|
-
sharedState: PlaceholderTextPluginState | undefined;
|
|
26
23
|
actions: {
|
|
27
24
|
showPlaceholderFloatingToolbar: typeof showPlaceholderFloatingToolbar;
|
|
28
25
|
};
|
|
26
|
+
dependencies: PlaceholderTextPluginDependencies;
|
|
27
|
+
pluginConfiguration: PlaceholderTextPluginOptions;
|
|
28
|
+
sharedState: PlaceholderTextPluginState | undefined;
|
|
29
29
|
}>;
|
|
@@ -2,8 +2,8 @@ import type { getPosHandler } from '@atlaskit/editor-common/react-node-view';
|
|
|
2
2
|
import type { Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
3
3
|
import type { EditorView, NodeView } from '@atlaskit/editor-prosemirror/view';
|
|
4
4
|
type PmMutationRecord = MutationRecord | {
|
|
5
|
-
type: 'selection';
|
|
6
5
|
target: Node;
|
|
6
|
+
type: 'selection';
|
|
7
7
|
};
|
|
8
8
|
export declare class PlaceholderTextNodeView implements NodeView {
|
|
9
9
|
private readonly node;
|
|
@@ -5,25 +5,25 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
export type Coordinates = {
|
|
8
|
+
bottom?: number;
|
|
8
9
|
left?: number;
|
|
9
10
|
right?: number;
|
|
10
11
|
top?: number;
|
|
11
|
-
bottom?: number;
|
|
12
12
|
};
|
|
13
13
|
export type PositionOffset = Coordinates;
|
|
14
14
|
export interface Props {
|
|
15
|
-
children?: React.ReactNode;
|
|
16
|
-
zIndex?: number;
|
|
17
|
-
className?: string;
|
|
18
|
-
target?: HTMLElement;
|
|
19
|
-
popupsMountPoint?: HTMLElement;
|
|
20
|
-
popupsBoundariesElement?: HTMLElement;
|
|
21
|
-
offset?: number[];
|
|
22
|
-
fitWidth?: number;
|
|
23
|
-
fitHeight?: number;
|
|
24
15
|
absoluteOffset?: PositionOffset;
|
|
25
16
|
alignX?: 'left' | 'center' | 'right';
|
|
26
17
|
alignY?: 'bottom' | 'top';
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
className?: string;
|
|
20
|
+
fitHeight?: number;
|
|
21
|
+
fitWidth?: number;
|
|
22
|
+
offset?: number[];
|
|
27
23
|
onPositionCalculated?: (position: Coordinates) => Coordinates;
|
|
24
|
+
popupsBoundariesElement?: HTMLElement;
|
|
25
|
+
popupsMountPoint?: HTMLElement;
|
|
26
|
+
target?: HTMLElement;
|
|
27
|
+
zIndex?: number;
|
|
28
28
|
}
|
|
29
29
|
export default function FloatingToolbar({ children, target, offset, fitWidth, fitHeight, onPositionCalculated, popupsMountPoint, popupsBoundariesElement, className, absoluteOffset, alignX, alignY, zIndex, }: Props): jsx.JSX.Element | null;
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
export declare const getOffsetParent: (editorViewDom: HTMLElement, popupsMountPoint?: HTMLElement) => HTMLElement;
|
|
2
2
|
export declare const getNearestNonTextNode: (node: Node) => HTMLElement;
|
|
3
3
|
export declare const handlePositionCalculatedWith: (offsetParent: HTMLElement, node: Node, getCurrentFixedCoordinates: () => {
|
|
4
|
-
top?: number;
|
|
5
|
-
left?: number;
|
|
6
4
|
bottom?: number;
|
|
5
|
+
left?: number;
|
|
7
6
|
right?: number;
|
|
8
|
-
}) => (position: {
|
|
9
7
|
top?: number;
|
|
10
|
-
|
|
8
|
+
}) => (position: {
|
|
11
9
|
bottom?: number;
|
|
10
|
+
left?: number;
|
|
12
11
|
right?: number;
|
|
13
|
-
}) => {
|
|
14
12
|
top?: number;
|
|
15
|
-
|
|
13
|
+
}) => {
|
|
16
14
|
bottom?: number;
|
|
15
|
+
left?: number;
|
|
17
16
|
right?: number;
|
|
17
|
+
top?: number;
|
|
18
18
|
};
|
|
@@ -2,16 +2,16 @@ import React from 'react';
|
|
|
2
2
|
import type { WrappedComponentProps } from 'react-intl-next';
|
|
3
3
|
import type { Coordinates } from '../FloatingToolbar';
|
|
4
4
|
export interface Props {
|
|
5
|
-
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
editorViewDOM: HTMLElement;
|
|
6
7
|
getFixedCoordinatesFromPos: (pos: number) => Coordinates;
|
|
7
|
-
|
|
8
|
+
getNodeFromPos: (pos: number) => Node;
|
|
8
9
|
hidePlaceholderFloatingToolbar: () => void;
|
|
10
|
+
insertPlaceholder: (value: string) => void;
|
|
11
|
+
popupsBoundariesElement?: HTMLElement;
|
|
12
|
+
popupsMountPoint?: HTMLElement;
|
|
9
13
|
setFocusInEditor: () => void;
|
|
10
14
|
showInsertPanelAt: number;
|
|
11
|
-
editorViewDOM: HTMLElement;
|
|
12
|
-
popupsMountPoint?: HTMLElement;
|
|
13
|
-
popupsBoundariesElement?: HTMLElement;
|
|
14
|
-
children?: React.ReactNode;
|
|
15
15
|
}
|
|
16
16
|
declare const _default: React.FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps>> & {
|
|
17
17
|
WrappedComponent: React.ComponentType<Props & WrappedComponentProps>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-placeholder-text",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.7",
|
|
4
4
|
"description": "placeholder text plugin for @atlaskit/editor-core",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@emotion/react": "^11.7.1"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"@atlaskit/editor-common": "^107.
|
|
42
|
+
"@atlaskit/editor-common": "^107.28.0",
|
|
43
43
|
"react": "^18.2.0",
|
|
44
44
|
"react-dom": "^18.2.0",
|
|
45
45
|
"react-intl-next": "npm:react-intl@^5.18.1"
|
|
@@ -47,9 +47,8 @@
|
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@af/visual-regression": "workspace:^",
|
|
49
49
|
"@atlaskit/analytics-next": "^11.1.0",
|
|
50
|
-
"@atlaskit/editor-plugin-floating-toolbar": "^5.
|
|
50
|
+
"@atlaskit/editor-plugin-floating-toolbar": "^5.2.0",
|
|
51
51
|
"@atlaskit/ssr": "workspace:^",
|
|
52
|
-
"@atlaskit/visual-regression": "workspace:^",
|
|
53
52
|
"@testing-library/react": "^13.4.0",
|
|
54
53
|
"wait-for-expect": "^1.2.0"
|
|
55
54
|
},
|