@atlaskit/emoji 71.11.2 → 71.12.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,22 @@
1
1
  # @atlaskit/emoji
2
2
 
3
+ ## 71.12.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`d68d46361e5c5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d68d46361e5c5) -
8
+ Send the new `emoji` image generation theme to the Confluence header image backend for Create
9
+ emoji with Rovo instead of prepending emoji-style instructions to the prompt.
10
+
11
+ ## 71.11.3
12
+
13
+ ### Patch Changes
14
+
15
+ - [`22bc749d89dc9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/22bc749d89dc9) -
16
+ Clean up platform_change_emoji_button_label FG and avoid unsupported ARIA attributes on editor
17
+ emoji nodes Stabilize renderer integration tests for smart cards, heading anchors, and table
18
+ triple-click selection
19
+
3
20
  ## 71.11.2
4
21
 
5
22
  ### Patch Changes
@@ -7,7 +7,6 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.generateEmojiImage = void 0;
8
8
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
9
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
- var _aiEmoji = require("../../util/ai-emoji");
11
10
  var _logger = _interopRequireDefault(require("../../util/logger"));
12
11
  /**
13
12
  * Calls the Confluence "header image" AI backend to generate an emoji-style
@@ -29,12 +28,12 @@ var EMOJI_ASPECT_RATIO = '1:1';
29
28
  */
30
29
  var generateEmojiImage = exports.generateEmojiImage = /*#__PURE__*/function () {
31
30
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
32
- var contentId, prompt, wrappedPrompt, response, json, output;
31
+ var contentId, prompt, trimmedPrompt, response, json, output;
33
32
  return _regenerator.default.wrap(function (_context) {
34
33
  while (1) switch (_context.prev = _context.next) {
35
34
  case 0:
36
35
  contentId = _ref.contentId, prompt = _ref.prompt;
37
- wrappedPrompt = (0, _aiEmoji.wrapEmojiPrompt)(prompt);
36
+ trimmedPrompt = prompt.trim();
38
37
  _context.next = 1;
39
38
  return fetch(HEADER_IMAGE_GENERATION_ENDPOINT, {
40
39
  method: 'POST',
@@ -45,9 +44,10 @@ var generateEmojiImage = exports.generateEmojiImage = /*#__PURE__*/function () {
45
44
  },
46
45
  body: JSON.stringify({
47
46
  ai_feature_input: {
48
- adfContent: wrappedPrompt,
47
+ adfContent: trimmedPrompt,
49
48
  contentId: contentId,
50
- useRawPrompt: true,
49
+ useRawPrompt: false,
50
+ theme: 'emoji',
51
51
  // Emojis are square — request a 1:1 image from the BE.
52
52
  aspectRatio: EMOJI_ASPECT_RATIO
53
53
  }
@@ -30,7 +30,6 @@ var _ufoExperiences = require("../../util/analytics/ufoExperiences");
30
30
  var _DeletableEmojiTooltipContent = require("./DeletableEmojiTooltipContent");
31
31
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
32
32
  var _browserApis = require("@atlaskit/browser-apis");
33
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
34
33
  var _i18n = require("../i18n");
35
34
  var _isSsr = require("../../util/is-ssr");
36
35
  var _renderUnicodeEmojiToImagePath = require("../../util/renderUnicodeEmojiToImagePath");
@@ -452,9 +451,9 @@ var EmojiNodeWrapper = exports.EmojiNodeWrapper = /*#__PURE__*/(0, _react.forwar
452
451
  renderUnicodeEmojiAsImage = props.renderUnicodeEmojiAsImage,
453
452
  other = (0, _objectWithoutProperties2.default)(props, _excluded);
454
453
  var intl = (0, _react.useContext)(_reactIntl.IntlContext);
455
- var ariaLabel = intl && (0, _platformFeatureFlags.fg)('platform_change_emoji_button_label') ? intl.formatMessage(_i18n.messages.changeEmojiShortnameButtonLabel, {
454
+ var ariaLabel = editorEmoji ? undefined : intl ? intl.formatMessage(_i18n.messages.changeEmojiShortnameButtonLabel, {
456
455
  shortName: (_emoji$name = emoji.name) !== null && _emoji$name !== void 0 ? _emoji$name : emoji.shortName
457
- }) : editorEmoji ? undefined : emoji.shortName;
456
+ }) : emoji.shortName;
458
457
  return /*#__PURE__*/_react.default.createElement("span", (0, _extends2.default)({
459
458
  role: editorEmoji ? undefined : shouldBeInteractive ? 'button' : ariaLabel ? 'img' : 'presentation',
460
459
  "aria-label": ariaLabel,
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.wrapEmojiPrompt = exports.slugifyPrompt = exports.MAX_SHORTNAME_LENGTH = exports.EMOJI_PROMPT_PREFIX = void 0;
6
+ exports.slugifyPrompt = exports.MAX_SHORTNAME_LENGTH = void 0;
7
7
  /**
8
8
  * Pure utilities for the "Create an emoji with Rovo" (AI emoji generation) flow.
9
9
  */
@@ -48,25 +48,4 @@ var slugifyPrompt = exports.slugifyPrompt = function slugifyPrompt(prompt) {
48
48
  // trim leading/trailing underscores
49
49
  .replace(/^_+|_+$/g, '');
50
50
  return slug.slice(0, MAX_SHORTNAME_LENGTH);
51
- };
52
-
53
- /**
54
- * Prefix prepended to the user's description so the header-image backend
55
- * produces clean, emoji-style output instead of a scene/photo.
56
- *
57
- * Kept as a single line (no newlines) — newlines in the prompt can degrade the
58
- * model's output. Learnings from ShipIt 56 ("Emoji Pop") showed that a simple
59
- * prompt prefix significantly improved emoji quality.
60
- */
61
- var EMOJI_PROMPT_PREFIX = exports.EMOJI_PROMPT_PREFIX = 'Generate a clean, simple, emoji-style icon of ';
62
-
63
- /**
64
- * Wrap the raw user prompt with the emoji-style prefix.
65
- *
66
- * @example
67
- * wrapEmojiPrompt('a cat wearing a hard hat')
68
- * // => 'Generate a clean, simple, emoji-style icon of a cat wearing a hard hat'
69
- */
70
- var wrapEmojiPrompt = exports.wrapEmojiPrompt = function wrapEmojiPrompt(userPrompt) {
71
- return "".concat(EMOJI_PROMPT_PREFIX).concat(userPrompt.trim());
72
51
  };
@@ -20,7 +20,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
20
20
  actionSubjectId: actionSubjectId,
21
21
  attributes: _objectSpread({
22
22
  packageName: "@atlaskit/emoji",
23
- packageVersion: "71.11.1"
23
+ packageVersion: "71.11.3"
24
24
  }, attributes)
25
25
  };
26
26
  };
@@ -3,7 +3,6 @@
3
3
  * image (base64) from a text description.
4
4
  */
5
5
 
6
- import { wrapEmojiPrompt } from '../../util/ai-emoji';
7
6
  import debug from '../../util/logger';
8
7
  const HEADER_IMAGE_GENERATION_ENDPOINT = '/gateway/api/assist/api/ai/v2/ai-feature/confluence-header-image-generation';
9
8
 
@@ -22,7 +21,7 @@ export const generateEmojiImage = async ({
22
21
  contentId,
23
22
  prompt
24
23
  }) => {
25
- const wrappedPrompt = wrapEmojiPrompt(prompt);
24
+ const trimmedPrompt = prompt.trim();
26
25
  const response = await fetch(HEADER_IMAGE_GENERATION_ENDPOINT, {
27
26
  method: 'POST',
28
27
  headers: {
@@ -32,9 +31,10 @@ export const generateEmojiImage = async ({
32
31
  },
33
32
  body: JSON.stringify({
34
33
  ai_feature_input: {
35
- adfContent: wrappedPrompt,
34
+ adfContent: trimmedPrompt,
36
35
  contentId,
37
- useRawPrompt: true,
36
+ useRawPrompt: false,
37
+ theme: 'emoji',
38
38
  // Emojis are square — request a 1:1 image from the BE.
39
39
  aspectRatio: EMOJI_ASPECT_RATIO
40
40
  }
@@ -19,7 +19,6 @@ import { hasUfoMarked } from '../../util/analytics/ufoExperiences';
19
19
  import { DeletableEmojiTooltipContent, DeletableEmojiTooltipContentForScreenReader } from './DeletableEmojiTooltipContent';
20
20
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
21
21
  import { getDocument } from '@atlaskit/browser-apis';
22
- import { fg } from '@atlaskit/platform-feature-flags';
23
22
  import { messages } from '../i18n';
24
23
  import { isSSR } from '../../util/is-ssr';
25
24
  import { renderUnicodeEmojiToImagePath } from '../../util/renderUnicodeEmojiToImagePath';
@@ -445,9 +444,9 @@ export const EmojiNodeWrapper = /*#__PURE__*/forwardRef((props, ref) => {
445
444
  ...other
446
445
  } = props;
447
446
  const intl = useContext(IntlContext);
448
- const ariaLabel = intl && fg('platform_change_emoji_button_label') ? intl.formatMessage(messages.changeEmojiShortnameButtonLabel, {
447
+ const ariaLabel = editorEmoji ? undefined : intl ? intl.formatMessage(messages.changeEmojiShortnameButtonLabel, {
449
448
  shortName: (_emoji$name = emoji.name) !== null && _emoji$name !== void 0 ? _emoji$name : emoji.shortName
450
- }) : editorEmoji ? undefined : emoji.shortName;
449
+ }) : emoji.shortName;
451
450
  return /*#__PURE__*/React.createElement("span", _extends({
452
451
  role: editorEmoji ? undefined : shouldBeInteractive ? 'button' : ariaLabel ? 'img' : 'presentation',
453
452
  "aria-label": ariaLabel,
@@ -42,23 +42,4 @@ export const slugifyPrompt = prompt => {
42
42
  // trim leading/trailing underscores
43
43
  .replace(/^_+|_+$/g, '');
44
44
  return slug.slice(0, MAX_SHORTNAME_LENGTH);
45
- };
46
-
47
- /**
48
- * Prefix prepended to the user's description so the header-image backend
49
- * produces clean, emoji-style output instead of a scene/photo.
50
- *
51
- * Kept as a single line (no newlines) — newlines in the prompt can degrade the
52
- * model's output. Learnings from ShipIt 56 ("Emoji Pop") showed that a simple
53
- * prompt prefix significantly improved emoji quality.
54
- */
55
- export const EMOJI_PROMPT_PREFIX = 'Generate a clean, simple, emoji-style icon of ';
56
-
57
- /**
58
- * Wrap the raw user prompt with the emoji-style prefix.
59
- *
60
- * @example
61
- * wrapEmojiPrompt('a cat wearing a hard hat')
62
- * // => 'Generate a clean, simple, emoji-style icon of a cat wearing a hard hat'
63
- */
64
- export const wrapEmojiPrompt = userPrompt => `${EMOJI_PROMPT_PREFIX}${userPrompt.trim()}`;
45
+ };
@@ -9,7 +9,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
9
9
  actionSubjectId,
10
10
  attributes: {
11
11
  packageName: "@atlaskit/emoji",
12
- packageVersion: "71.11.1",
12
+ packageVersion: "71.11.3",
13
13
  ...attributes
14
14
  }
15
15
  });
@@ -5,7 +5,6 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
5
5
  * image (base64) from a text description.
6
6
  */
7
7
 
8
- import { wrapEmojiPrompt } from '../../util/ai-emoji';
9
8
  import debug from '../../util/logger';
10
9
  var HEADER_IMAGE_GENERATION_ENDPOINT = '/gateway/api/assist/api/ai/v2/ai-feature/confluence-header-image-generation';
11
10
 
@@ -22,12 +21,12 @@ var EMOJI_ASPECT_RATIO = '1:1';
22
21
  */
23
22
  export var generateEmojiImage = /*#__PURE__*/function () {
24
23
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
25
- var contentId, prompt, wrappedPrompt, response, json, output;
24
+ var contentId, prompt, trimmedPrompt, response, json, output;
26
25
  return _regeneratorRuntime.wrap(function (_context) {
27
26
  while (1) switch (_context.prev = _context.next) {
28
27
  case 0:
29
28
  contentId = _ref.contentId, prompt = _ref.prompt;
30
- wrappedPrompt = wrapEmojiPrompt(prompt);
29
+ trimmedPrompt = prompt.trim();
31
30
  _context.next = 1;
32
31
  return fetch(HEADER_IMAGE_GENERATION_ENDPOINT, {
33
32
  method: 'POST',
@@ -38,9 +37,10 @@ export var generateEmojiImage = /*#__PURE__*/function () {
38
37
  },
39
38
  body: JSON.stringify({
40
39
  ai_feature_input: {
41
- adfContent: wrappedPrompt,
40
+ adfContent: trimmedPrompt,
42
41
  contentId: contentId,
43
- useRawPrompt: true,
42
+ useRawPrompt: false,
43
+ theme: 'emoji',
44
44
  // Emojis are square — request a 1:1 image from the BE.
45
45
  aspectRatio: EMOJI_ASPECT_RATIO
46
46
  }
@@ -25,7 +25,6 @@ import { hasUfoMarked } from '../../util/analytics/ufoExperiences';
25
25
  import { DeletableEmojiTooltipContent, DeletableEmojiTooltipContentForScreenReader } from './DeletableEmojiTooltipContent';
26
26
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
27
27
  import { getDocument } from '@atlaskit/browser-apis';
28
- import { fg } from '@atlaskit/platform-feature-flags';
29
28
  import { messages } from '../i18n';
30
29
  import { isSSR } from '../../util/is-ssr';
31
30
  import { renderUnicodeEmojiToImagePath } from '../../util/renderUnicodeEmojiToImagePath';
@@ -443,9 +442,9 @@ export var EmojiNodeWrapper = /*#__PURE__*/forwardRef(function (props, ref) {
443
442
  renderUnicodeEmojiAsImage = props.renderUnicodeEmojiAsImage,
444
443
  other = _objectWithoutProperties(props, _excluded);
445
444
  var intl = useContext(IntlContext);
446
- var ariaLabel = intl && fg('platform_change_emoji_button_label') ? intl.formatMessage(messages.changeEmojiShortnameButtonLabel, {
445
+ var ariaLabel = editorEmoji ? undefined : intl ? intl.formatMessage(messages.changeEmojiShortnameButtonLabel, {
447
446
  shortName: (_emoji$name = emoji.name) !== null && _emoji$name !== void 0 ? _emoji$name : emoji.shortName
448
- }) : editorEmoji ? undefined : emoji.shortName;
447
+ }) : emoji.shortName;
449
448
  return /*#__PURE__*/React.createElement("span", _extends({
450
449
  role: editorEmoji ? undefined : shouldBeInteractive ? 'button' : ariaLabel ? 'img' : 'presentation',
451
450
  "aria-label": ariaLabel,
@@ -42,25 +42,4 @@ export var slugifyPrompt = function slugifyPrompt(prompt) {
42
42
  // trim leading/trailing underscores
43
43
  .replace(/^_+|_+$/g, '');
44
44
  return slug.slice(0, MAX_SHORTNAME_LENGTH);
45
- };
46
-
47
- /**
48
- * Prefix prepended to the user's description so the header-image backend
49
- * produces clean, emoji-style output instead of a scene/photo.
50
- *
51
- * Kept as a single line (no newlines) — newlines in the prompt can degrade the
52
- * model's output. Learnings from ShipIt 56 ("Emoji Pop") showed that a simple
53
- * prompt prefix significantly improved emoji quality.
54
- */
55
- export var EMOJI_PROMPT_PREFIX = 'Generate a clean, simple, emoji-style icon of ';
56
-
57
- /**
58
- * Wrap the raw user prompt with the emoji-style prefix.
59
- *
60
- * @example
61
- * wrapEmojiPrompt('a cat wearing a hard hat')
62
- * // => 'Generate a clean, simple, emoji-style icon of a cat wearing a hard hat'
63
- */
64
- export var wrapEmojiPrompt = function wrapEmojiPrompt(userPrompt) {
65
- return "".concat(EMOJI_PROMPT_PREFIX).concat(userPrompt.trim());
66
45
  };
@@ -14,7 +14,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
14
14
  actionSubjectId: actionSubjectId,
15
15
  attributes: _objectSpread({
16
16
  packageName: "@atlaskit/emoji",
17
- packageVersion: "71.11.1"
17
+ packageVersion: "71.11.3"
18
18
  }, attributes)
19
19
  };
20
20
  };
@@ -15,8 +15,8 @@ export interface GenerateEmojiImageOptions {
15
15
  */
16
16
  contentId: string;
17
17
  /**
18
- * The raw text description typed by the user (e.g. "a cat wearing a hard hat").
19
- * It is wrapped with the emoji-style prefix before being sent to the backend.
18
+ * The raw text description typed by the user. It is trimmed and sent as-is
19
+ * with the `emoji` theme to the backend.
20
20
  */
21
21
  prompt: string;
22
22
  }
@@ -22,20 +22,3 @@ export declare const MAX_SHORTNAME_LENGTH = 50;
22
22
  * slugifyPrompt('a cat wearing a hard hat') // => 'cat_wearing_a_hard_hat'
23
23
  */
24
24
  export declare const slugifyPrompt: (prompt: string) => string;
25
- /**
26
- * Prefix prepended to the user's description so the header-image backend
27
- * produces clean, emoji-style output instead of a scene/photo.
28
- *
29
- * Kept as a single line (no newlines) — newlines in the prompt can degrade the
30
- * model's output. Learnings from ShipIt 56 ("Emoji Pop") showed that a simple
31
- * prompt prefix significantly improved emoji quality.
32
- */
33
- export declare const EMOJI_PROMPT_PREFIX = "Generate a clean, simple, emoji-style icon of ";
34
- /**
35
- * Wrap the raw user prompt with the emoji-style prefix.
36
- *
37
- * @example
38
- * wrapEmojiPrompt('a cat wearing a hard hat')
39
- * // => 'Generate a clean, simple, emoji-style icon of a cat wearing a hard hat'
40
- */
41
- export declare const wrapEmojiPrompt: (userPrompt: string) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/emoji",
3
- "version": "71.11.2",
3
+ "version": "71.12.0",
4
4
  "description": "Fabric emoji React components",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -50,7 +50,7 @@
50
50
  "@atlaskit/spinner": "^20.1.0",
51
51
  "@atlaskit/textfield": "^9.1.0",
52
52
  "@atlaskit/theme": "^26.1.0",
53
- "@atlaskit/tmp-editor-statsig": "^132.0.0",
53
+ "@atlaskit/tmp-editor-statsig": "^132.1.0",
54
54
  "@atlaskit/tokens": "^16.2.0",
55
55
  "@atlaskit/tooltip": "^23.1.0",
56
56
  "@atlaskit/ufo": "^1.0.0",
@@ -128,9 +128,6 @@
128
128
  "platform_suppression_removal_fix_reactions": {
129
129
  "type": "boolean"
130
130
  },
131
- "platform_change_emoji_button_label": {
132
- "type": "boolean"
133
- },
134
131
  "platform_emoji_grid_presentation": {
135
132
  "type": "boolean"
136
133
  },