@atlaskit/editor-plugin-placeholder 11.0.15 → 11.0.16
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 +6 -0
- package/package.json +2 -2
- package/placeholder-plugin/package.json +1 -8
- package/placeholder-plugin-type/package.json +1 -8
- package/dist/types-ts4.5/entry-points/placeholder-plugin-type.d.ts +0 -1
- package/dist/types-ts4.5/entry-points/placeholder-plugin.d.ts +0 -1
- package/dist/types-ts4.5/index.d.ts +0 -2
- package/dist/types-ts4.5/placeholderPlugin.d.ts +0 -5
- package/dist/types-ts4.5/placeholderPluginType.d.ts +0 -31
- package/dist/types-ts4.5/pm-plugins/adf-builders.d.ts +0 -4
- package/dist/types-ts4.5/pm-plugins/animation.d.ts +0 -1
- package/dist/types-ts4.5/pm-plugins/constants.d.ts +0 -9
- package/dist/types-ts4.5/pm-plugins/decorations.d.ts +0 -4
- package/dist/types-ts4.5/pm-plugins/main.d.ts +0 -6
- package/dist/types-ts4.5/pm-plugins/types.d.ts +0 -37
- package/dist/types-ts4.5/pm-plugins/utils.d.ts +0 -27
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-placeholder",
|
|
3
|
-
"version": "11.0.
|
|
3
|
+
"version": "11.0.16",
|
|
4
4
|
"description": "Placeholder plugin for @atlaskit/editor-core.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
38
38
|
"@atlaskit/primitives": "^19.0.0",
|
|
39
39
|
"@atlaskit/spinner": "^19.1.0",
|
|
40
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
40
|
+
"@atlaskit/tmp-editor-statsig": "^103.0.0",
|
|
41
41
|
"@atlaskit/tokens": "^13.4.0",
|
|
42
42
|
"@babel/runtime": "^7.0.0"
|
|
43
43
|
},
|
|
@@ -4,12 +4,5 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/placeholder-plugin.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/placeholder-plugin.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/placeholder-plugin.d.ts"
|
|
8
|
-
"typesVersions": {
|
|
9
|
-
">=4.5 <5.9": {
|
|
10
|
-
"*": [
|
|
11
|
-
"../dist/types-ts4.5/entry-points/placeholder-plugin.d.ts"
|
|
12
|
-
]
|
|
13
|
-
}
|
|
14
|
-
}
|
|
7
|
+
"types": "../dist/types/entry-points/placeholder-plugin.d.ts"
|
|
15
8
|
}
|
|
@@ -4,12 +4,5 @@
|
|
|
4
4
|
"module": "../dist/esm/entry-points/placeholder-plugin-type.js",
|
|
5
5
|
"module:es2019": "../dist/es2019/entry-points/placeholder-plugin-type.js",
|
|
6
6
|
"sideEffects": false,
|
|
7
|
-
"types": "../dist/types/entry-points/placeholder-plugin-type.d.ts"
|
|
8
|
-
"typesVersions": {
|
|
9
|
-
">=4.5 <5.9": {
|
|
10
|
-
"*": [
|
|
11
|
-
"../dist/types-ts4.5/entry-points/placeholder-plugin-type.d.ts"
|
|
12
|
-
]
|
|
13
|
-
}
|
|
14
|
-
}
|
|
7
|
+
"types": "../dist/types/entry-points/placeholder-plugin-type.d.ts"
|
|
15
8
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type { PlaceholderPlugin, PlaceholderPluginOptions } from '../placeholderPluginType';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { placeholderPlugin } from '../placeholderPlugin';
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
2
|
-
import type { PlaceholderPlugin } from './placeholderPluginType';
|
|
3
|
-
export declare const EMPTY_PARAGRAPH_TIMEOUT_DELAY = 2000;
|
|
4
|
-
export declare const pluginKey: PluginKey;
|
|
5
|
-
export declare const placeholderPlugin: PlaceholderPlugin;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import type { DocNode } from '@atlaskit/adf-schema';
|
|
2
|
-
import type { EditorCommand, NextEditorPlugin, OptionalPlugin } from '@atlaskit/editor-common/types';
|
|
3
|
-
import type { CompositionPlugin } from '@atlaskit/editor-plugin-composition';
|
|
4
|
-
import type { FocusPlugin } from '@atlaskit/editor-plugin-focus';
|
|
5
|
-
import type { ShowDiffPlugin } from '@atlaskit/editor-plugin-show-diff';
|
|
6
|
-
import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
|
|
7
|
-
export interface PlaceholderPluginOptions {
|
|
8
|
-
emptyLinePlaceholder?: string;
|
|
9
|
-
enableLoadingSpinner?: boolean;
|
|
10
|
-
isPlaceholderHidden?: boolean;
|
|
11
|
-
isRovoLLMEnabled?: boolean;
|
|
12
|
-
placeholder?: string;
|
|
13
|
-
placeholderADF?: DocNode;
|
|
14
|
-
placeholderBracketHint?: string;
|
|
15
|
-
placeholderPrompts?: string[];
|
|
16
|
-
withEmptyParagraph?: boolean;
|
|
17
|
-
}
|
|
18
|
-
export type PlaceholderPlugin = NextEditorPlugin<'placeholder', {
|
|
19
|
-
commands: {
|
|
20
|
-
setAnimatingPlaceholderPrompts: (placeholderPrompts: string[]) => EditorCommand;
|
|
21
|
-
setPlaceholder: (placeholder: string) => EditorCommand;
|
|
22
|
-
setPlaceholderHidden: (isPlaceholderHidden: boolean) => EditorCommand;
|
|
23
|
-
};
|
|
24
|
-
dependencies: [
|
|
25
|
-
FocusPlugin,
|
|
26
|
-
CompositionPlugin,
|
|
27
|
-
TypeAheadPlugin,
|
|
28
|
-
OptionalPlugin<ShowDiffPlugin>
|
|
29
|
-
];
|
|
30
|
-
pluginConfiguration: PlaceholderPluginOptions | undefined;
|
|
31
|
-
}>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { IntlShape } from 'react-intl';
|
|
2
|
-
import type { DocNode } from '@atlaskit/adf-schema';
|
|
3
|
-
export declare const createShortEmptyNodePlaceholderADF: ({ formatMessage }: IntlShape) => DocNode;
|
|
4
|
-
export declare const createLongEmptyNodePlaceholderADF: ({ formatMessage }: IntlShape) => DocNode;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const cycleThroughPlaceholderPrompts: (placeholderPrompts: string[], activeTypewriterTimeouts: (() => void)[] | undefined, placeholderNodeWithText: HTMLElement, initialDelayWhenUserTypedAndDeleted?: number) => void;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export declare const placeholderTestId = "placeholder-test-id";
|
|
2
|
-
export declare const TYPEWRITER_TYPE_DELAY = 50;
|
|
3
|
-
export declare const TYPEWRITER_PAUSE_BEFORE_ERASE = 2000;
|
|
4
|
-
export declare const TYPEWRITER_ERASE_DELAY = 40;
|
|
5
|
-
export declare const TYPEWRITER_CYCLE_DELAY = 500;
|
|
6
|
-
export declare const TYPEWRITER_TYPED_AND_DELETED_DELAY = 1500;
|
|
7
|
-
export declare const nodeTypesWithLongPlaceholderText: string[];
|
|
8
|
-
export declare const nodeTypesWithShortPlaceholderText: string[];
|
|
9
|
-
export declare const nodeTypesWithSyncBlockPlaceholderText: string[];
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { DocNode } from '@atlaskit/adf-schema';
|
|
2
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import { DecorationSet } from '@atlaskit/editor-prosemirror/view';
|
|
4
|
-
export declare function createPlaceholderDecoration(editorState: EditorState, placeholderText: string, placeholderPrompts?: string[], activeTypewriterTimeouts?: (() => void)[], pos?: number, initialDelayWhenUserTypedAndDeleted?: number, placeholderADF?: DocNode, showOnEmptyParagraph?: boolean): DecorationSet;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { IntlShape } from 'react-intl';
|
|
2
|
-
import type { DocNode } from '@atlaskit/adf-schema';
|
|
3
|
-
import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
|
|
4
|
-
import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
|
|
5
|
-
import type { PlaceholderPlugin } from '../placeholderPluginType';
|
|
6
|
-
export default function createPlugin(intl: IntlShape, defaultPlaceholderText?: string, bracketPlaceholderText?: string, emptyLinePlaceholder?: string, placeholderPrompts?: string[], withEmptyParagraph?: boolean, initialIsPlaceholderHidden?: boolean, placeholderADF?: DocNode, isRovoLLMEnabled?: boolean, api?: ExtractInjectionAPI<PlaceholderPlugin>): SafePlugin | undefined;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { IntlShape } from 'react-intl';
|
|
2
|
-
import type { DocNode } from '@atlaskit/adf-schema';
|
|
3
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
4
|
-
export interface PlaceHolderState {
|
|
5
|
-
canShowOnEmptyParagraph?: boolean;
|
|
6
|
-
contextPlaceholderADF?: DocNode;
|
|
7
|
-
hasPlaceholder: boolean;
|
|
8
|
-
isPlaceholderHidden?: boolean;
|
|
9
|
-
placeholderPrompts?: string[];
|
|
10
|
-
placeholderText?: string;
|
|
11
|
-
pos?: number;
|
|
12
|
-
showOnEmptyParagraph?: boolean;
|
|
13
|
-
typedAndDeleted?: boolean;
|
|
14
|
-
userHadTyped?: boolean;
|
|
15
|
-
}
|
|
16
|
-
export type CreatePlaceholderStateProps = {
|
|
17
|
-
bracketPlaceholderText?: string;
|
|
18
|
-
defaultPlaceholderText: string | undefined;
|
|
19
|
-
editorState: EditorState;
|
|
20
|
-
emptyLinePlaceholder?: string;
|
|
21
|
-
intl: IntlShape;
|
|
22
|
-
isEditorFocused: boolean;
|
|
23
|
-
isInitial?: boolean;
|
|
24
|
-
isPlaceholderHidden?: boolean;
|
|
25
|
-
isTypeAheadOpen: ((editorState: EditorState) => boolean) | undefined;
|
|
26
|
-
placeholderADF?: DocNode;
|
|
27
|
-
placeholderPrompts?: string[];
|
|
28
|
-
showOnEmptyParagraph?: boolean;
|
|
29
|
-
typedAndDeleted?: boolean;
|
|
30
|
-
userHadTyped?: boolean;
|
|
31
|
-
withEmptyParagraph?: boolean;
|
|
32
|
-
};
|
|
33
|
-
export type UserInteractionState = {
|
|
34
|
-
newEditorState: EditorState;
|
|
35
|
-
oldEditorState?: EditorState;
|
|
36
|
-
placeholderState?: PlaceHolderState;
|
|
37
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { DocNode } from '@atlaskit/adf-schema';
|
|
2
|
-
import type { EditorState } from '@atlaskit/editor-prosemirror/state';
|
|
3
|
-
import type { CreatePlaceholderStateProps, PlaceHolderState, UserInteractionState } from './types';
|
|
4
|
-
export declare function getPlaceholderState(editorState: EditorState): PlaceHolderState;
|
|
5
|
-
export declare function setPlaceHolderState({ placeholderText, pos, placeholderPrompts, typedAndDeleted, userHadTyped, canShowOnEmptyParagraph, showOnEmptyParagraph, contextPlaceholderADF, }: {
|
|
6
|
-
canShowOnEmptyParagraph?: boolean;
|
|
7
|
-
contextPlaceholderADF?: DocNode;
|
|
8
|
-
placeholderPrompts?: string[];
|
|
9
|
-
placeholderText?: string;
|
|
10
|
-
pos?: number;
|
|
11
|
-
showOnEmptyParagraph?: boolean;
|
|
12
|
-
typedAndDeleted?: boolean;
|
|
13
|
-
userHadTyped?: boolean;
|
|
14
|
-
}): PlaceHolderState;
|
|
15
|
-
export declare const emptyPlaceholder: ({ placeholderText, placeholderPrompts, userHadTyped, pos, canShowOnEmptyParagraph, showOnEmptyParagraph, }: {
|
|
16
|
-
canShowOnEmptyParagraph?: boolean;
|
|
17
|
-
placeholderPrompts?: string[];
|
|
18
|
-
placeholderText: string | undefined;
|
|
19
|
-
pos?: number;
|
|
20
|
-
showOnEmptyParagraph?: boolean;
|
|
21
|
-
userHadTyped?: boolean;
|
|
22
|
-
}) => PlaceHolderState;
|
|
23
|
-
export declare function createPlaceHolderStateFrom({ isInitial, isEditorFocused, editorState, isTypeAheadOpen, defaultPlaceholderText, intl, bracketPlaceholderText, emptyLinePlaceholder, placeholderADF, placeholderPrompts, typedAndDeleted, userHadTyped, isPlaceholderHidden, withEmptyParagraph, showOnEmptyParagraph, }: CreatePlaceholderStateProps): PlaceHolderState;
|
|
24
|
-
export declare function calculateUserInteractionState({ placeholderState, oldEditorState, newEditorState, }: UserInteractionState): {
|
|
25
|
-
typedAndDeleted: boolean;
|
|
26
|
-
userHadTyped: boolean;
|
|
27
|
-
};
|