@atlaskit/editor-plugin-placeholder 8.0.5 → 8.1.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,12 @@
1
1
  # @atlaskit/editor-plugin-placeholder
2
2
 
3
+ ## 8.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`403274e761790`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/403274e761790) -
8
+ Add Rovo enabled check to cwr_blank_object_experiment evaluations
9
+
3
10
  ## 8.0.5
4
11
 
5
12
  ### Patch Changes
@@ -60,7 +60,7 @@ var placeholderPlugin = exports.placeholderPlugin = function placeholderPlugin(_
60
60
  name: 'placeholder',
61
61
  plugin: function plugin(_ref5) {
62
62
  var getIntl = _ref5.getIntl;
63
- 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 === null || options === void 0 ? void 0 : options.isPlaceholderHidden, options && options.placeholderADF, api);
63
+ 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 === null || options === void 0 ? void 0 : options.isPlaceholderHidden, options && options.placeholderADF, options === null || options === void 0 ? void 0 : options.isRovoLLMEnabled, api);
64
64
  }
65
65
  }];
66
66
  },
@@ -11,7 +11,7 @@ var _placeholderPlugin = require("../placeholderPlugin");
11
11
  var _constants = require("./constants");
12
12
  var _decorations = require("./decorations");
13
13
  var _utils = require("./utils");
14
- function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderText, emptyLinePlaceholder, placeholderPrompts, withEmptyParagraph, initialIsPlaceholderHidden, placeholderADF, api) {
14
+ function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderText, emptyLinePlaceholder, placeholderPrompts, withEmptyParagraph, initialIsPlaceholderHidden, placeholderADF, isRovoLLMEnabled, api) {
15
15
  if (!defaultPlaceholderText && !placeholderPrompts && !bracketPlaceholderText && !placeholderADF) {
16
16
  return;
17
17
  }
@@ -62,7 +62,7 @@ function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderText, empt
62
62
  isPlaceholderHidden = meta.isPlaceholderHidden;
63
63
  }
64
64
  if ((meta === null || meta === void 0 ? void 0 : meta.placeholderText) !== undefined && withEmptyParagraph) {
65
- var isCreateWithRovoOverride = !!meta.placeholderText && (0, _expVal.expVal)('cwr_blank_object_experiment', 'isEnabled', false);
65
+ var isCreateWithRovoOverride = !!meta.placeholderText && isRovoLLMEnabled && (0, _expVal.expVal)('cwr_blank_object_experiment', 'isEnabled', false);
66
66
  // Only update defaultPlaceholderText from meta if we're not using ADF placeholder
67
67
  // OR when the create-with-rovo experiment is active to allow intentional non-empty placeholder overrides
68
68
  if (!placeholderADF || isCreateWithRovoOverride) {
@@ -51,7 +51,7 @@ export const placeholderPlugin = ({
51
51
  name: 'placeholder',
52
52
  plugin: ({
53
53
  getIntl
54
- }) => createPlugin(getIntl(), options && options.placeholder, options && options.placeholderBracketHint, options && options.emptyLinePlaceholder, options && options.placeholderPrompts, options === null || options === void 0 ? void 0 : options.withEmptyParagraph, options === null || options === void 0 ? void 0 : options.isPlaceholderHidden, options && options.placeholderADF, api)
54
+ }) => createPlugin(getIntl(), options && options.placeholder, options && options.placeholderBracketHint, options && options.emptyLinePlaceholder, options && options.placeholderPrompts, options === null || options === void 0 ? void 0 : options.withEmptyParagraph, options === null || options === void 0 ? void 0 : options.isPlaceholderHidden, options && options.placeholderADF, options === null || options === void 0 ? void 0 : options.isRovoLLMEnabled, api)
55
55
  }];
56
56
  },
57
57
  contentComponent: expValEquals('confluence_load_editor_title_on_transition', 'contentPlaceholder', true) ? params => {
@@ -5,7 +5,7 @@ import { EMPTY_PARAGRAPH_TIMEOUT_DELAY, pluginKey } from '../placeholderPlugin';
5
5
  import { TYPEWRITER_TYPED_AND_DELETED_DELAY } from './constants';
6
6
  import { createPlaceholderDecoration } from './decorations';
7
7
  import { calculateUserInteractionState, createPlaceHolderStateFrom, getPlaceholderState } from './utils';
8
- export default function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderText, emptyLinePlaceholder, placeholderPrompts, withEmptyParagraph, initialIsPlaceholderHidden, placeholderADF, api) {
8
+ export default function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderText, emptyLinePlaceholder, placeholderPrompts, withEmptyParagraph, initialIsPlaceholderHidden, placeholderADF, isRovoLLMEnabled, api) {
9
9
  if (!defaultPlaceholderText && !placeholderPrompts && !bracketPlaceholderText && !placeholderADF) {
10
10
  return;
11
11
  }
@@ -55,7 +55,7 @@ export default function createPlugin(intl, defaultPlaceholderText, bracketPlaceh
55
55
  isPlaceholderHidden = meta.isPlaceholderHidden;
56
56
  }
57
57
  if ((meta === null || meta === void 0 ? void 0 : meta.placeholderText) !== undefined && withEmptyParagraph) {
58
- const isCreateWithRovoOverride = !!meta.placeholderText && expVal('cwr_blank_object_experiment', 'isEnabled', false);
58
+ const isCreateWithRovoOverride = !!meta.placeholderText && isRovoLLMEnabled && expVal('cwr_blank_object_experiment', 'isEnabled', false);
59
59
  // Only update defaultPlaceholderText from meta if we're not using ADF placeholder
60
60
  // OR when the create-with-rovo experiment is active to allow intentional non-empty placeholder overrides
61
61
  if (!placeholderADF || isCreateWithRovoOverride) {
@@ -53,7 +53,7 @@ export var placeholderPlugin = function placeholderPlugin(_ref) {
53
53
  name: 'placeholder',
54
54
  plugin: function plugin(_ref5) {
55
55
  var getIntl = _ref5.getIntl;
56
- 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 === null || options === void 0 ? void 0 : options.isPlaceholderHidden, options && options.placeholderADF, api);
56
+ 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 === null || options === void 0 ? void 0 : options.isPlaceholderHidden, options && options.placeholderADF, options === null || options === void 0 ? void 0 : options.isRovoLLMEnabled, api);
57
57
  }
58
58
  }];
59
59
  },
@@ -5,7 +5,7 @@ import { EMPTY_PARAGRAPH_TIMEOUT_DELAY, pluginKey } from '../placeholderPlugin';
5
5
  import { TYPEWRITER_TYPED_AND_DELETED_DELAY } from './constants';
6
6
  import { createPlaceholderDecoration } from './decorations';
7
7
  import { calculateUserInteractionState, createPlaceHolderStateFrom, getPlaceholderState } from './utils';
8
- export default function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderText, emptyLinePlaceholder, placeholderPrompts, withEmptyParagraph, initialIsPlaceholderHidden, placeholderADF, api) {
8
+ export default function createPlugin(intl, defaultPlaceholderText, bracketPlaceholderText, emptyLinePlaceholder, placeholderPrompts, withEmptyParagraph, initialIsPlaceholderHidden, placeholderADF, isRovoLLMEnabled, api) {
9
9
  if (!defaultPlaceholderText && !placeholderPrompts && !bracketPlaceholderText && !placeholderADF) {
10
10
  return;
11
11
  }
@@ -56,7 +56,7 @@ export default function createPlugin(intl, defaultPlaceholderText, bracketPlaceh
56
56
  isPlaceholderHidden = meta.isPlaceholderHidden;
57
57
  }
58
58
  if ((meta === null || meta === void 0 ? void 0 : meta.placeholderText) !== undefined && withEmptyParagraph) {
59
- var isCreateWithRovoOverride = !!meta.placeholderText && expVal('cwr_blank_object_experiment', 'isEnabled', false);
59
+ var isCreateWithRovoOverride = !!meta.placeholderText && isRovoLLMEnabled && expVal('cwr_blank_object_experiment', 'isEnabled', false);
60
60
  // Only update defaultPlaceholderText from meta if we're not using ADF placeholder
61
61
  // OR when the create-with-rovo experiment is active to allow intentional non-empty placeholder overrides
62
62
  if (!placeholderADF || isCreateWithRovoOverride) {
@@ -8,6 +8,7 @@ export interface PlaceholderPluginOptions {
8
8
  emptyLinePlaceholder?: string;
9
9
  enableLoadingSpinner?: boolean;
10
10
  isPlaceholderHidden?: boolean;
11
+ isRovoLLMEnabled?: boolean;
11
12
  placeholder?: string;
12
13
  placeholderADF?: DocNode;
13
14
  placeholderBracketHint?: string;
@@ -3,4 +3,4 @@ import type { DocNode } from '@atlaskit/adf-schema';
3
3
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
4
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
5
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, api?: ExtractInjectionAPI<PlaceholderPlugin>): SafePlugin | undefined;
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;
@@ -8,6 +8,7 @@ export interface PlaceholderPluginOptions {
8
8
  emptyLinePlaceholder?: string;
9
9
  enableLoadingSpinner?: boolean;
10
10
  isPlaceholderHidden?: boolean;
11
+ isRovoLLMEnabled?: boolean;
11
12
  placeholder?: string;
12
13
  placeholderADF?: DocNode;
13
14
  placeholderBracketHint?: string;
@@ -3,4 +3,4 @@ import type { DocNode } from '@atlaskit/adf-schema';
3
3
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
4
4
  import type { ExtractInjectionAPI } from '@atlaskit/editor-common/types';
5
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, api?: ExtractInjectionAPI<PlaceholderPlugin>): SafePlugin | undefined;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-placeholder",
3
- "version": "8.0.5",
3
+ "version": "8.1.0",
4
4
  "description": "Placeholder plugin for @atlaskit/editor-core.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -37,12 +37,12 @@
37
37
  "@atlaskit/platform-feature-flags": "^1.1.0",
38
38
  "@atlaskit/primitives": "^18.0.0",
39
39
  "@atlaskit/spinner": "^19.0.0",
40
- "@atlaskit/tmp-editor-statsig": "^40.0.0",
40
+ "@atlaskit/tmp-editor-statsig": "^40.3.0",
41
41
  "@atlaskit/tokens": "^11.1.0",
42
42
  "@babel/runtime": "^7.0.0"
43
43
  },
44
44
  "peerDependencies": {
45
- "@atlaskit/editor-common": "^112.4.0",
45
+ "@atlaskit/editor-common": "^112.5.0",
46
46
  "react": "^18.2.0",
47
47
  "react-dom": "^18.2.0",
48
48
  "react-intl-next": "npm:react-intl@^5.18.1"