@atlaskit/emoji 71.11.3 → 71.13.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,21 @@
1
1
  # @atlaskit/emoji
2
2
 
3
+ ## 71.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`5228612e884f4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5228612e884f4) -
8
+ Update i18n NPM package versions for editor,editor-extensions,activity-platform,media,elements
9
+ (Group 3)
10
+
11
+ ## 71.12.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [`d68d46361e5c5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d68d46361e5c5) -
16
+ Send the new `emoji` image generation theme to the Confluence header image backend for Create
17
+ emoji with Rovo instead of prepending emoji-style instructions to the prompt.
18
+
3
19
  ## 71.11.3
4
20
 
5
21
  ### 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
  }
@@ -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.2"
23
+ packageVersion: "71.12.0"
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
  }
@@ -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.2",
12
+ packageVersion: "71.12.0",
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
  }
@@ -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.2"
17
+ packageVersion: "71.12.0"
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.3",
3
+ "version": "71.13.0",
4
4
  "description": "Fabric emoji React components",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -29,7 +29,7 @@
29
29
  "access": "public"
30
30
  },
31
31
  "dependencies": {
32
- "@atlaskit/afm-i18n-platform-elements-emoji": "2.194.0",
32
+ "@atlaskit/afm-i18n-platform-elements-emoji": "2.196.0",
33
33
  "@atlaskit/analytics-next": "^12.3.0",
34
34
  "@atlaskit/browser-apis": "^1.2.0",
35
35
  "@atlaskit/button": "^24.3.0",
@@ -45,13 +45,13 @@
45
45
  "@atlaskit/media-client-react": "^6.1.0",
46
46
  "@atlaskit/platform-feature-flags": "^2.1.0",
47
47
  "@atlaskit/pragmatic-drag-and-drop": "^2.0.0",
48
- "@atlaskit/primitives": "^22.1.0",
48
+ "@atlaskit/primitives": "^22.2.0",
49
49
  "@atlaskit/radio": "^9.1.0",
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.1.0",
54
- "@atlaskit/tokens": "^16.2.0",
53
+ "@atlaskit/tmp-editor-statsig": "^132.6.0",
54
+ "@atlaskit/tokens": "^16.3.0",
55
55
  "@atlaskit/tooltip": "^23.1.0",
56
56
  "@atlaskit/ufo": "^1.0.0",
57
57
  "@atlaskit/util-service-support": "^7.2.0",