@atlaskit/editor-plugin-placeholder 7.1.1 → 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 CHANGED
@@ -1,5 +1,16 @@
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
+
3
14
  ## 7.1.1
4
15
 
5
16
  ### Patch Changes
@@ -0,0 +1,5 @@
1
+ ._1bah1h6o{justify-content:center}
2
+ ._1bsb1osq{width:100%}
3
+ ._1e0c1txw{display:flex}
4
+ ._2lx21bp4{flex-direction:column}
5
+ ._4cvr1h6o{align-items:center}
@@ -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)('cc_editor_placeholder_collab_wait', 'isEnabled', true)) {
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;
@@ -0,0 +1,5 @@
1
+ ._1bah1h6o{justify-content:center}
2
+ ._1bsb1osq{width:100%}
3
+ ._1e0c1txw{display:flex}
4
+ ._2lx21bp4{flex-direction:column}
5
+ ._4cvr1h6o{align-items:center}
@@ -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('cc_editor_placeholder_collab_wait', 'isEnabled', true)) {
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;
@@ -0,0 +1,5 @@
1
+ ._1bah1h6o{justify-content:center}
2
+ ._1bsb1osq{width:100%}
3
+ ._1e0c1txw{display:flex}
4
+ ._2lx21bp4{flex-direction:column}
5
+ ._4cvr1h6o{align-items:center}
@@ -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('cc_editor_placeholder_collab_wait', 'isEnabled', true)) {
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-placeholder",
3
- "version": "7.1.1",
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/tmp-editor-statsig": "^16.15.0",
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
  },