@atlaskit/editor-plugin-placeholder 7.1.0 → 7.2.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 +19 -0
- package/dist/cjs/placeholderPlugin.compiled.css +5 -0
- package/dist/cjs/placeholderPlugin.js +25 -1
- package/dist/cjs/pm-plugins/main.js +1 -1
- package/dist/cjs/pm-plugins/placeholderPluginLegacy.js +1 -1
- package/dist/cjs/pm-plugins/utils.js +1 -1
- package/dist/es2019/placeholderPlugin.compiled.css +5 -0
- package/dist/es2019/placeholderPlugin.js +25 -1
- package/dist/es2019/pm-plugins/main.js +1 -1
- package/dist/es2019/pm-plugins/placeholderPluginLegacy.js +1 -1
- package/dist/es2019/pm-plugins/utils.js +1 -1
- package/dist/esm/placeholderPlugin.compiled.css +5 -0
- package/dist/esm/placeholderPlugin.js +25 -1
- package/dist/esm/pm-plugins/main.js +1 -1
- package/dist/esm/pm-plugins/placeholderPluginLegacy.js +1 -1
- package/dist/esm/pm-plugins/utils.js +1 -1
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-placeholder
|
|
2
2
|
|
|
3
|
+
## 7.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`333b858014e54`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/333b858014e54) -
|
|
8
|
+
Move content placeholder behind title_on_transition flag
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 7.1.1
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- [`38c83ce57623b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/38c83ce57623b) -
|
|
19
|
+
[ux] [EDITOR-3853] Update copy for sync block placeholder and copy flag
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 7.1.0
|
|
4
23
|
|
|
5
24
|
### Minor Changes
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* placeholderPlugin.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
1
2
|
"use strict";
|
|
2
3
|
|
|
3
4
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
@@ -5,8 +6,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
6
|
value: true
|
|
6
7
|
});
|
|
7
8
|
exports.pluginKey = exports.placeholderPlugin = exports.EMPTY_PARAGRAPH_TIMEOUT_DELAY = void 0;
|
|
9
|
+
require("./placeholderPlugin.compiled.css");
|
|
10
|
+
var _runtime = require("@compiled/react/runtime");
|
|
11
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
12
|
var _state = require("@atlaskit/editor-prosemirror/state");
|
|
9
13
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
|
+
var _compiled = require("@atlaskit/primitives/compiled");
|
|
15
|
+
var _spinner = _interopRequireDefault(require("@atlaskit/spinner/spinner"));
|
|
16
|
+
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
10
17
|
var _main = _interopRequireDefault(require("./pm-plugins/main"));
|
|
11
18
|
var _placeholderPluginLegacy = require("./pm-plugins/placeholderPluginLegacy");
|
|
12
19
|
var EMPTY_PARAGRAPH_TIMEOUT_DELAY = exports.EMPTY_PARAGRAPH_TIMEOUT_DELAY = 2000; // Delay before showing placeholder on empty paragraph
|
|
@@ -62,6 +69,23 @@ var placeholderPlugin = exports.placeholderPlugin = function placeholderPlugin(_
|
|
|
62
69
|
return (0, _main.default)(getIntl(), options && options.placeholder, options && options.placeholderBracketHint, options && options.emptyLinePlaceholder, options && options.placeholderPrompts, options === null || options === void 0 ? void 0 : options.withEmptyParagraph, options && options.placeholderADF, api);
|
|
63
70
|
}
|
|
64
71
|
}];
|
|
65
|
-
}
|
|
72
|
+
},
|
|
73
|
+
contentComponent: (0, _expValEquals.expValEquals)('confluence_load_editor_title_on_transition', 'contentPlaceholder', true) ? function (params) {
|
|
74
|
+
var _params$editorView;
|
|
75
|
+
// @ts-ignore fix which needs follow up to use standard apis
|
|
76
|
+
var collabEditPluginState = (_params$editorView = params.editorView) === null || _params$editorView === void 0 || (_params$editorView = _params$editorView.state) === null || _params$editorView === void 0 ? void 0 : _params$editorView.collabEditPlugin$;
|
|
77
|
+
if (collabEditPluginState && collabEditPluginState.isReady !== true) {
|
|
78
|
+
return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
|
|
79
|
+
xcss: spinnerContainerStyles.spinnerContainer
|
|
80
|
+
}, /*#__PURE__*/_react.default.createElement(_spinner.default, {
|
|
81
|
+
interactionName: "live-pages-loading-spinner",
|
|
82
|
+
size: "medium"
|
|
83
|
+
}));
|
|
84
|
+
}
|
|
85
|
+
return null;
|
|
86
|
+
} : undefined
|
|
66
87
|
};
|
|
88
|
+
};
|
|
89
|
+
var spinnerContainerStyles = {
|
|
90
|
+
spinnerContainer: "_1e0c1txw _2lx21bp4 _1bah1h6o _4cvr1h6o _1bsb1osq"
|
|
67
91
|
};
|
|
@@ -93,7 +93,7 @@ function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderText, empt
|
|
|
93
93
|
props: {
|
|
94
94
|
decorations: function decorations(editorState) {
|
|
95
95
|
var _api$composition, _api$showDiff;
|
|
96
|
-
if ((0, _expValEquals.expValEquals)('
|
|
96
|
+
if ((0, _expValEquals.expValEquals)('confluence_load_editor_title_on_transition', 'contentPlaceholder', true)) {
|
|
97
97
|
// @ts-ignore quick fix which needs follow up to use standard apis
|
|
98
98
|
if (editorState.collabEditPlugin$ && editorState.collabEditPlugin$.isReady !== true) {
|
|
99
99
|
return;
|
|
@@ -393,7 +393,7 @@ function createPlaceHolderStateFrom(_ref5) {
|
|
|
393
393
|
}
|
|
394
394
|
if (nodeTypesWithSyncBlockPlaceholderText.includes(parentType) && isEmptyNode && (0, _experiments.editorExperiment)('platform_synced_block', true)) {
|
|
395
395
|
return setPlaceHolderState({
|
|
396
|
-
placeholderText: intl.formatMessage(_messages.placeholderTextMessages.
|
|
396
|
+
placeholderText: intl.formatMessage(_messages.placeholderTextMessages.sourceSyncBlockPlaceholderText),
|
|
397
397
|
pos: $from.pos,
|
|
398
398
|
placeholderPrompts: placeholderPrompts,
|
|
399
399
|
typedAndDeleted: typedAndDeleted,
|
|
@@ -220,7 +220,7 @@ function createPlaceHolderStateFrom(_ref3) {
|
|
|
220
220
|
}
|
|
221
221
|
if (_constants.nodeTypesWithSyncBlockPlaceholderText.includes(parentType) && isEmptyNode && (0, _experiments.editorExperiment)('platform_synced_block', true)) {
|
|
222
222
|
return setPlaceHolderState({
|
|
223
|
-
placeholderText: intl.formatMessage(_messages.placeholderTextMessages.
|
|
223
|
+
placeholderText: intl.formatMessage(_messages.placeholderTextMessages.sourceSyncBlockPlaceholderText),
|
|
224
224
|
pos: $from.pos,
|
|
225
225
|
placeholderPrompts: placeholderPrompts,
|
|
226
226
|
typedAndDeleted: typedAndDeleted,
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
/* placeholderPlugin.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
|
+
import "./placeholderPlugin.compiled.css";
|
|
3
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
+
import React from 'react';
|
|
1
5
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
2
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
|
+
import { Box } from '@atlaskit/primitives/compiled';
|
|
8
|
+
import Spinner from '@atlaskit/spinner/spinner';
|
|
9
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
3
10
|
import createPlugin from './pm-plugins/main';
|
|
4
11
|
import { placeholderPluginLegacy } from './pm-plugins/placeholderPluginLegacy';
|
|
5
12
|
export const EMPTY_PARAGRAPH_TIMEOUT_DELAY = 2000; // Delay before showing placeholder on empty paragraph
|
|
@@ -52,6 +59,23 @@ export const placeholderPlugin = ({
|
|
|
52
59
|
getIntl
|
|
53
60
|
}) => createPlugin(getIntl(), options && options.placeholder, options && options.placeholderBracketHint, options && options.emptyLinePlaceholder, options && options.placeholderPrompts, options === null || options === void 0 ? void 0 : options.withEmptyParagraph, options && options.placeholderADF, api)
|
|
54
61
|
}];
|
|
55
|
-
}
|
|
62
|
+
},
|
|
63
|
+
contentComponent: expValEquals('confluence_load_editor_title_on_transition', 'contentPlaceholder', true) ? params => {
|
|
64
|
+
var _params$editorView, _params$editorView$st;
|
|
65
|
+
// @ts-ignore fix which needs follow up to use standard apis
|
|
66
|
+
const collabEditPluginState = (_params$editorView = params.editorView) === null || _params$editorView === void 0 ? void 0 : (_params$editorView$st = _params$editorView.state) === null || _params$editorView$st === void 0 ? void 0 : _params$editorView$st.collabEditPlugin$;
|
|
67
|
+
if (collabEditPluginState && collabEditPluginState.isReady !== true) {
|
|
68
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
69
|
+
xcss: spinnerContainerStyles.spinnerContainer
|
|
70
|
+
}, /*#__PURE__*/React.createElement(Spinner, {
|
|
71
|
+
interactionName: "live-pages-loading-spinner",
|
|
72
|
+
size: "medium"
|
|
73
|
+
}));
|
|
74
|
+
}
|
|
75
|
+
return null;
|
|
76
|
+
} : undefined
|
|
56
77
|
};
|
|
78
|
+
};
|
|
79
|
+
const spinnerContainerStyles = {
|
|
80
|
+
spinnerContainer: "_1e0c1txw _2lx21bp4 _1bah1h6o _4cvr1h6o _1bsb1osq"
|
|
57
81
|
};
|
|
@@ -86,7 +86,7 @@ export default function createPlugin(intl, defaultPlaceholderText, bracketPlaceh
|
|
|
86
86
|
props: {
|
|
87
87
|
decorations(editorState) {
|
|
88
88
|
var _api$composition, _api$showDiff, _api$showDiff$sharedS;
|
|
89
|
-
if (expValEquals('
|
|
89
|
+
if (expValEquals('confluence_load_editor_title_on_transition', 'contentPlaceholder', true)) {
|
|
90
90
|
// @ts-ignore quick fix which needs follow up to use standard apis
|
|
91
91
|
if (editorState.collabEditPlugin$ && editorState.collabEditPlugin$.isReady !== true) {
|
|
92
92
|
return;
|
|
@@ -373,7 +373,7 @@ function createPlaceHolderStateFrom({
|
|
|
373
373
|
}
|
|
374
374
|
if (nodeTypesWithSyncBlockPlaceholderText.includes(parentType) && isEmptyNode && editorExperiment('platform_synced_block', true)) {
|
|
375
375
|
return setPlaceHolderState({
|
|
376
|
-
placeholderText: intl.formatMessage(messages.
|
|
376
|
+
placeholderText: intl.formatMessage(messages.sourceSyncBlockPlaceholderText),
|
|
377
377
|
pos: $from.pos,
|
|
378
378
|
placeholderPrompts,
|
|
379
379
|
typedAndDeleted,
|
|
@@ -208,7 +208,7 @@ export function createPlaceHolderStateFrom({
|
|
|
208
208
|
}
|
|
209
209
|
if (nodeTypesWithSyncBlockPlaceholderText.includes(parentType) && isEmptyNode && editorExperiment('platform_synced_block', true)) {
|
|
210
210
|
return setPlaceHolderState({
|
|
211
|
-
placeholderText: intl.formatMessage(messages.
|
|
211
|
+
placeholderText: intl.formatMessage(messages.sourceSyncBlockPlaceholderText),
|
|
212
212
|
pos: $from.pos,
|
|
213
213
|
placeholderPrompts,
|
|
214
214
|
typedAndDeleted,
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
+
/* placeholderPlugin.tsx generated by @compiled/babel-plugin v0.38.1 */
|
|
2
|
+
import "./placeholderPlugin.compiled.css";
|
|
3
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
4
|
+
import React from 'react';
|
|
1
5
|
import { PluginKey } from '@atlaskit/editor-prosemirror/state';
|
|
2
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
|
+
import { Box } from '@atlaskit/primitives/compiled';
|
|
8
|
+
import Spinner from '@atlaskit/spinner/spinner';
|
|
9
|
+
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
3
10
|
import createPlugin from './pm-plugins/main';
|
|
4
11
|
import { placeholderPluginLegacy } from './pm-plugins/placeholderPluginLegacy';
|
|
5
12
|
export var EMPTY_PARAGRAPH_TIMEOUT_DELAY = 2000; // Delay before showing placeholder on empty paragraph
|
|
@@ -55,6 +62,23 @@ export var placeholderPlugin = function placeholderPlugin(_ref) {
|
|
|
55
62
|
return createPlugin(getIntl(), options && options.placeholder, options && options.placeholderBracketHint, options && options.emptyLinePlaceholder, options && options.placeholderPrompts, options === null || options === void 0 ? void 0 : options.withEmptyParagraph, options && options.placeholderADF, api);
|
|
56
63
|
}
|
|
57
64
|
}];
|
|
58
|
-
}
|
|
65
|
+
},
|
|
66
|
+
contentComponent: expValEquals('confluence_load_editor_title_on_transition', 'contentPlaceholder', true) ? function (params) {
|
|
67
|
+
var _params$editorView;
|
|
68
|
+
// @ts-ignore fix which needs follow up to use standard apis
|
|
69
|
+
var collabEditPluginState = (_params$editorView = params.editorView) === null || _params$editorView === void 0 || (_params$editorView = _params$editorView.state) === null || _params$editorView === void 0 ? void 0 : _params$editorView.collabEditPlugin$;
|
|
70
|
+
if (collabEditPluginState && collabEditPluginState.isReady !== true) {
|
|
71
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
72
|
+
xcss: spinnerContainerStyles.spinnerContainer
|
|
73
|
+
}, /*#__PURE__*/React.createElement(Spinner, {
|
|
74
|
+
interactionName: "live-pages-loading-spinner",
|
|
75
|
+
size: "medium"
|
|
76
|
+
}));
|
|
77
|
+
}
|
|
78
|
+
return null;
|
|
79
|
+
} : undefined
|
|
59
80
|
};
|
|
81
|
+
};
|
|
82
|
+
var spinnerContainerStyles = {
|
|
83
|
+
spinnerContainer: "_1e0c1txw _2lx21bp4 _1bah1h6o _4cvr1h6o _1bsb1osq"
|
|
60
84
|
};
|
|
@@ -87,7 +87,7 @@ export default function createPlugin(intl, defaultPlaceholderText, bracketPlaceh
|
|
|
87
87
|
props: {
|
|
88
88
|
decorations: function decorations(editorState) {
|
|
89
89
|
var _api$composition, _api$showDiff;
|
|
90
|
-
if (expValEquals('
|
|
90
|
+
if (expValEquals('confluence_load_editor_title_on_transition', 'contentPlaceholder', true)) {
|
|
91
91
|
// @ts-ignore quick fix which needs follow up to use standard apis
|
|
92
92
|
if (editorState.collabEditPlugin$ && editorState.collabEditPlugin$.isReady !== true) {
|
|
93
93
|
return;
|
|
@@ -383,7 +383,7 @@ function createPlaceHolderStateFrom(_ref5) {
|
|
|
383
383
|
}
|
|
384
384
|
if (nodeTypesWithSyncBlockPlaceholderText.includes(parentType) && isEmptyNode && editorExperiment('platform_synced_block', true)) {
|
|
385
385
|
return setPlaceHolderState({
|
|
386
|
-
placeholderText: intl.formatMessage(messages.
|
|
386
|
+
placeholderText: intl.formatMessage(messages.sourceSyncBlockPlaceholderText),
|
|
387
387
|
pos: $from.pos,
|
|
388
388
|
placeholderPrompts: placeholderPrompts,
|
|
389
389
|
typedAndDeleted: typedAndDeleted,
|
|
@@ -209,7 +209,7 @@ export function createPlaceHolderStateFrom(_ref3) {
|
|
|
209
209
|
}
|
|
210
210
|
if (nodeTypesWithSyncBlockPlaceholderText.includes(parentType) && isEmptyNode && editorExperiment('platform_synced_block', true)) {
|
|
211
211
|
return setPlaceHolderState({
|
|
212
|
-
placeholderText: intl.formatMessage(messages.
|
|
212
|
+
placeholderText: intl.formatMessage(messages.sourceSyncBlockPlaceholderText),
|
|
213
213
|
pos: $from.pos,
|
|
214
214
|
placeholderPrompts: placeholderPrompts,
|
|
215
215
|
typedAndDeleted: typedAndDeleted,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-placeholder",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.2.0",
|
|
4
4
|
"description": "Placeholder plugin for @atlaskit/editor-core.",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -28,13 +28,16 @@
|
|
|
28
28
|
"atlaskit:src": "src/index.ts",
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@atlaskit/adf-utils": "^19.26.0",
|
|
31
|
+
"@atlaskit/css": "^0.19.0",
|
|
31
32
|
"@atlaskit/editor-plugin-composition": "^6.0.0",
|
|
32
33
|
"@atlaskit/editor-plugin-focus": "^6.0.0",
|
|
33
34
|
"@atlaskit/editor-plugin-show-diff": "^4.0.0",
|
|
34
35
|
"@atlaskit/editor-plugin-type-ahead": "^7.0.0",
|
|
35
36
|
"@atlaskit/editor-prosemirror": "^7.2.0",
|
|
36
37
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
37
|
-
"@atlaskit/
|
|
38
|
+
"@atlaskit/primitives": "^17.0.0",
|
|
39
|
+
"@atlaskit/spinner": "^19.0.0",
|
|
40
|
+
"@atlaskit/tmp-editor-statsig": "^16.17.0",
|
|
38
41
|
"@atlaskit/tokens": "^9.1.0",
|
|
39
42
|
"@babel/runtime": "^7.0.0"
|
|
40
43
|
},
|