@atlaskit/emoji 67.5.12 → 67.6.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 +6 -0
- package/dist/cjs/api/EmojiResource.js +11 -10
- package/dist/cjs/api/media/SiteEmojiResource.js +49 -21
- package/dist/cjs/util/analytics/analytics.js +1 -1
- package/dist/es2019/api/EmojiResource.js +8 -7
- package/dist/es2019/api/media/SiteEmojiResource.js +37 -13
- package/dist/es2019/util/analytics/analytics.js +1 -1
- package/dist/esm/api/EmojiResource.js +12 -11
- package/dist/esm/api/media/SiteEmojiResource.js +49 -21
- package/dist/esm/util/analytics/analytics.js +1 -1
- package/dist/types/api/media/SiteEmojiResource.d.ts +8 -3
- package/dist/types-ts4.5/api/media/SiteEmojiResource.d.ts +8 -3
- package/package.json +3 -3
- package/report.api.md +10 -1
- package/tmp/api-report-tmp.d.ts +7 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @atlaskit/emoji
|
|
2
2
|
|
|
3
|
+
## 67.6.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#43046](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/43046) [`b48c8bbb269`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b48c8bbb269) - Add media tokens to query attributes when altRepresentation is used
|
|
8
|
+
|
|
3
9
|
## 67.5.12
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -433,26 +433,27 @@ var EmojiResource = exports.EmojiResource = /*#__PURE__*/function (_ref) {
|
|
|
433
433
|
key: "getMediaEmojiDescriptionURLWithInlineToken",
|
|
434
434
|
value: function () {
|
|
435
435
|
var _getMediaEmojiDescriptionURLWithInlineToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(emoji) {
|
|
436
|
-
var
|
|
436
|
+
var _yield$this$siteEmoji, representation, altRepresentation;
|
|
437
437
|
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
438
438
|
while (1) switch (_context5.prev = _context5.next) {
|
|
439
439
|
case 0:
|
|
440
|
-
if (!
|
|
441
|
-
_context5.next =
|
|
440
|
+
if (!this.isRepositoryAvailable(this.siteEmojiResource)) {
|
|
441
|
+
_context5.next = 7;
|
|
442
442
|
break;
|
|
443
443
|
}
|
|
444
444
|
_context5.next = 3;
|
|
445
|
-
return this.siteEmojiResource.
|
|
445
|
+
return this.siteEmojiResource.generateTokenisedMediaURLS(emoji.representation, emoji.altRepresentation);
|
|
446
446
|
case 3:
|
|
447
|
-
|
|
447
|
+
_yield$this$siteEmoji = _context5.sent;
|
|
448
|
+
representation = _yield$this$siteEmoji.representation;
|
|
449
|
+
altRepresentation = _yield$this$siteEmoji.altRepresentation;
|
|
448
450
|
return _context5.abrupt("return", _objectSpread(_objectSpread({}, emoji), {}, {
|
|
449
|
-
representation:
|
|
450
|
-
|
|
451
|
-
})
|
|
451
|
+
representation: representation,
|
|
452
|
+
altRepresentation: altRepresentation
|
|
452
453
|
}));
|
|
453
|
-
case
|
|
454
|
+
case 7:
|
|
454
455
|
return _context5.abrupt("return", emoji);
|
|
455
|
-
case
|
|
456
|
+
case 8:
|
|
456
457
|
case "end":
|
|
457
458
|
return _context5.stop();
|
|
458
459
|
}
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.mediaProportionOfProgress = exports.default = void 0;
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
10
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
11
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
12
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
@@ -73,45 +74,72 @@ var SiteEmojiResource = exports.default = /*#__PURE__*/function () {
|
|
|
73
74
|
}
|
|
74
75
|
|
|
75
76
|
/**
|
|
76
|
-
* Will generate an emoji media path that is inclusive of client and token within the query parameter
|
|
77
|
+
* Will generate an emoji media path that is inclusive of client and token within the query parameter for media representation and altRepresentation
|
|
77
78
|
*/
|
|
78
79
|
(0, _createClass2.default)(SiteEmojiResource, [{
|
|
79
|
-
key: "
|
|
80
|
+
key: "generateTokenisedMediaURLS",
|
|
80
81
|
value: function () {
|
|
81
|
-
var
|
|
82
|
-
var
|
|
82
|
+
var _generateTokenisedMediaURLS = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(representation, altRepresentation) {
|
|
83
|
+
var readToken;
|
|
83
84
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
84
85
|
while (1) switch (_context.prev = _context.next) {
|
|
85
86
|
case 0:
|
|
86
|
-
if (
|
|
87
|
-
_context.next =
|
|
87
|
+
if ((0, _typeHelpers.isMediaRepresentation)(representation)) {
|
|
88
|
+
_context.next = 2;
|
|
88
89
|
break;
|
|
89
90
|
}
|
|
90
|
-
|
|
91
|
-
|
|
91
|
+
return _context.abrupt("return", {
|
|
92
|
+
representation: representation,
|
|
93
|
+
altRepresentation: altRepresentation
|
|
94
|
+
});
|
|
95
|
+
case 2:
|
|
96
|
+
_context.prev = 2;
|
|
92
97
|
_context.next = 5;
|
|
93
98
|
return this.tokenManager.getToken('read');
|
|
94
99
|
case 5:
|
|
95
100
|
readToken = _context.sent;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
101
|
+
return _context.abrupt("return", Object.entries({
|
|
102
|
+
representation: representation,
|
|
103
|
+
altRepresentation: altRepresentation
|
|
104
|
+
}).reduce(function (acc, _ref) {
|
|
105
|
+
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
|
106
|
+
key = _ref2[0],
|
|
107
|
+
value = _ref2[1];
|
|
108
|
+
if (value && (0, _typeHelpers.isMediaRepresentation)(value)) {
|
|
109
|
+
var path = new URL(value.mediaPath);
|
|
110
|
+
var params = path.searchParams;
|
|
111
|
+
if (params.get('token') !== readToken.jwt) {
|
|
112
|
+
params.set('token', readToken.jwt);
|
|
113
|
+
}
|
|
114
|
+
if (params.get('client') !== readToken.clientId) {
|
|
115
|
+
params.set('client', readToken.clientId);
|
|
116
|
+
}
|
|
117
|
+
acc[key] = _objectSpread(_objectSpread({}, value), {}, {
|
|
118
|
+
mediaPath: path.toString()
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
return acc;
|
|
122
|
+
}, {
|
|
123
|
+
representation: representation,
|
|
124
|
+
altRepresentation: altRepresentation
|
|
125
|
+
}));
|
|
103
126
|
case 9:
|
|
104
|
-
|
|
105
|
-
|
|
127
|
+
_context.prev = 9;
|
|
128
|
+
_context.t0 = _context["catch"](2);
|
|
129
|
+
return _context.abrupt("return", {
|
|
130
|
+
representation: representation,
|
|
131
|
+
altRepresentation: altRepresentation
|
|
132
|
+
});
|
|
133
|
+
case 12:
|
|
106
134
|
case "end":
|
|
107
135
|
return _context.stop();
|
|
108
136
|
}
|
|
109
|
-
}, _callee, this);
|
|
137
|
+
}, _callee, this, [[2, 9]]);
|
|
110
138
|
}));
|
|
111
|
-
function
|
|
112
|
-
return
|
|
139
|
+
function generateTokenisedMediaURLS(_x, _x2) {
|
|
140
|
+
return _generateTokenisedMediaURLS.apply(this, arguments);
|
|
113
141
|
}
|
|
114
|
-
return
|
|
142
|
+
return generateTokenisedMediaURLS;
|
|
115
143
|
}()
|
|
116
144
|
/**
|
|
117
145
|
* Will load media emoji, returning a new EmojiDescription if, for example,
|
|
@@ -19,7 +19,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
19
19
|
actionSubjectId: actionSubjectId,
|
|
20
20
|
attributes: _objectSpread({
|
|
21
21
|
packageName: "@atlaskit/emoji",
|
|
22
|
-
packageVersion: "67.
|
|
22
|
+
packageVersion: "67.6.0"
|
|
23
23
|
}, attributes)
|
|
24
24
|
};
|
|
25
25
|
};
|
|
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import { AbstractResource, utils as serviceUtils } from '@atlaskit/util-service-support';
|
|
3
3
|
import { SAMPLING_RATE_EMOJI_RESOURCE_FETCHED_EXP, selectedToneStorageKey } from '../util/constants';
|
|
4
4
|
import debug from '../util/logger';
|
|
5
|
-
import { isMediaEmoji,
|
|
5
|
+
import { isMediaEmoji, isPromise, toEmojiId } from '../util/type-helpers';
|
|
6
6
|
import storageAvailable from '../util/storage-available';
|
|
7
7
|
import { ProviderTypes } from '../types';
|
|
8
8
|
import EmojiLoader from './EmojiLoader';
|
|
@@ -263,14 +263,15 @@ export class EmojiResource extends AbstractResource {
|
|
|
263
263
|
* Returns the EmojiDescription with a valid media path that includes query token and client attributes to access the emoji media inline.
|
|
264
264
|
*/
|
|
265
265
|
async getMediaEmojiDescriptionURLWithInlineToken(emoji) {
|
|
266
|
-
if (this.isRepositoryAvailable(this.siteEmojiResource)
|
|
267
|
-
const
|
|
266
|
+
if (this.isRepositoryAvailable(this.siteEmojiResource)) {
|
|
267
|
+
const {
|
|
268
|
+
representation,
|
|
269
|
+
altRepresentation
|
|
270
|
+
} = await this.siteEmojiResource.generateTokenisedMediaURLS(emoji.representation, emoji.altRepresentation);
|
|
268
271
|
return {
|
|
269
272
|
...emoji,
|
|
270
|
-
representation
|
|
271
|
-
|
|
272
|
-
mediaPath: tokenisedMediaPath
|
|
273
|
-
}
|
|
273
|
+
representation,
|
|
274
|
+
altRepresentation
|
|
274
275
|
};
|
|
275
276
|
}
|
|
276
277
|
return emoji;
|
|
@@ -64,22 +64,46 @@ export default class SiteEmojiResource {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
/**
|
|
67
|
-
* Will generate an emoji media path that is inclusive of client and token within the query parameter
|
|
67
|
+
* Will generate an emoji media path that is inclusive of client and token within the query parameter for media representation and altRepresentation
|
|
68
68
|
*/
|
|
69
|
-
async
|
|
70
|
-
if (
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
async generateTokenisedMediaURLS(representation, altRepresentation) {
|
|
70
|
+
if (!isMediaRepresentation(representation)) {
|
|
71
|
+
return {
|
|
72
|
+
representation,
|
|
73
|
+
altRepresentation
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
73
77
|
const readToken = await this.tokenManager.getToken('read');
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
return Object.entries({
|
|
79
|
+
representation,
|
|
80
|
+
altRepresentation
|
|
81
|
+
}).reduce((acc, [key, value]) => {
|
|
82
|
+
if (value && isMediaRepresentation(value)) {
|
|
83
|
+
const path = new URL(value.mediaPath);
|
|
84
|
+
const params = path.searchParams;
|
|
85
|
+
if (params.get('token') !== readToken.jwt) {
|
|
86
|
+
params.set('token', readToken.jwt);
|
|
87
|
+
}
|
|
88
|
+
if (params.get('client') !== readToken.clientId) {
|
|
89
|
+
params.set('client', readToken.clientId);
|
|
90
|
+
}
|
|
91
|
+
acc[key] = {
|
|
92
|
+
...value,
|
|
93
|
+
mediaPath: path.toString()
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
return acc;
|
|
97
|
+
}, {
|
|
98
|
+
representation,
|
|
99
|
+
altRepresentation
|
|
100
|
+
});
|
|
101
|
+
} catch (error) {
|
|
102
|
+
return {
|
|
103
|
+
representation,
|
|
104
|
+
altRepresentation
|
|
105
|
+
};
|
|
81
106
|
}
|
|
82
|
-
throw Error('Emoji resource is not of type Media Representation');
|
|
83
107
|
}
|
|
84
108
|
|
|
85
109
|
/**
|
|
@@ -15,7 +15,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
15
15
|
import { AbstractResource, utils as serviceUtils } from '@atlaskit/util-service-support';
|
|
16
16
|
import { SAMPLING_RATE_EMOJI_RESOURCE_FETCHED_EXP, selectedToneStorageKey } from '../util/constants';
|
|
17
17
|
import debug from '../util/logger';
|
|
18
|
-
import { isMediaEmoji,
|
|
18
|
+
import { isMediaEmoji, isPromise, toEmojiId } from '../util/type-helpers';
|
|
19
19
|
import storageAvailable from '../util/storage-available';
|
|
20
20
|
import { ProviderTypes } from '../types';
|
|
21
21
|
import EmojiLoader from './EmojiLoader';
|
|
@@ -426,26 +426,27 @@ export var EmojiResource = /*#__PURE__*/function (_ref) {
|
|
|
426
426
|
key: "getMediaEmojiDescriptionURLWithInlineToken",
|
|
427
427
|
value: function () {
|
|
428
428
|
var _getMediaEmojiDescriptionURLWithInlineToken = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee5(emoji) {
|
|
429
|
-
var
|
|
429
|
+
var _yield$this$siteEmoji, representation, altRepresentation;
|
|
430
430
|
return _regeneratorRuntime.wrap(function _callee5$(_context5) {
|
|
431
431
|
while (1) switch (_context5.prev = _context5.next) {
|
|
432
432
|
case 0:
|
|
433
|
-
if (!
|
|
434
|
-
_context5.next =
|
|
433
|
+
if (!this.isRepositoryAvailable(this.siteEmojiResource)) {
|
|
434
|
+
_context5.next = 7;
|
|
435
435
|
break;
|
|
436
436
|
}
|
|
437
437
|
_context5.next = 3;
|
|
438
|
-
return this.siteEmojiResource.
|
|
438
|
+
return this.siteEmojiResource.generateTokenisedMediaURLS(emoji.representation, emoji.altRepresentation);
|
|
439
439
|
case 3:
|
|
440
|
-
|
|
440
|
+
_yield$this$siteEmoji = _context5.sent;
|
|
441
|
+
representation = _yield$this$siteEmoji.representation;
|
|
442
|
+
altRepresentation = _yield$this$siteEmoji.altRepresentation;
|
|
441
443
|
return _context5.abrupt("return", _objectSpread(_objectSpread({}, emoji), {}, {
|
|
442
|
-
representation:
|
|
443
|
-
|
|
444
|
-
})
|
|
444
|
+
representation: representation,
|
|
445
|
+
altRepresentation: altRepresentation
|
|
445
446
|
}));
|
|
446
|
-
case
|
|
447
|
+
case 7:
|
|
447
448
|
return _context5.abrupt("return", emoji);
|
|
448
|
-
case
|
|
449
|
+
case 8:
|
|
449
450
|
case "end":
|
|
450
451
|
return _context5.stop();
|
|
451
452
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
1
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
4
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
@@ -66,45 +67,72 @@ var SiteEmojiResource = /*#__PURE__*/function () {
|
|
|
66
67
|
}
|
|
67
68
|
|
|
68
69
|
/**
|
|
69
|
-
* Will generate an emoji media path that is inclusive of client and token within the query parameter
|
|
70
|
+
* Will generate an emoji media path that is inclusive of client and token within the query parameter for media representation and altRepresentation
|
|
70
71
|
*/
|
|
71
72
|
_createClass(SiteEmojiResource, [{
|
|
72
|
-
key: "
|
|
73
|
+
key: "generateTokenisedMediaURLS",
|
|
73
74
|
value: function () {
|
|
74
|
-
var
|
|
75
|
-
var
|
|
75
|
+
var _generateTokenisedMediaURLS = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(representation, altRepresentation) {
|
|
76
|
+
var readToken;
|
|
76
77
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
77
78
|
while (1) switch (_context.prev = _context.next) {
|
|
78
79
|
case 0:
|
|
79
|
-
if (
|
|
80
|
-
_context.next =
|
|
80
|
+
if (isMediaRepresentation(representation)) {
|
|
81
|
+
_context.next = 2;
|
|
81
82
|
break;
|
|
82
83
|
}
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
return _context.abrupt("return", {
|
|
85
|
+
representation: representation,
|
|
86
|
+
altRepresentation: altRepresentation
|
|
87
|
+
});
|
|
88
|
+
case 2:
|
|
89
|
+
_context.prev = 2;
|
|
85
90
|
_context.next = 5;
|
|
86
91
|
return this.tokenManager.getToken('read');
|
|
87
92
|
case 5:
|
|
88
93
|
readToken = _context.sent;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
return _context.abrupt("return", Object.entries({
|
|
95
|
+
representation: representation,
|
|
96
|
+
altRepresentation: altRepresentation
|
|
97
|
+
}).reduce(function (acc, _ref) {
|
|
98
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
99
|
+
key = _ref2[0],
|
|
100
|
+
value = _ref2[1];
|
|
101
|
+
if (value && isMediaRepresentation(value)) {
|
|
102
|
+
var path = new URL(value.mediaPath);
|
|
103
|
+
var params = path.searchParams;
|
|
104
|
+
if (params.get('token') !== readToken.jwt) {
|
|
105
|
+
params.set('token', readToken.jwt);
|
|
106
|
+
}
|
|
107
|
+
if (params.get('client') !== readToken.clientId) {
|
|
108
|
+
params.set('client', readToken.clientId);
|
|
109
|
+
}
|
|
110
|
+
acc[key] = _objectSpread(_objectSpread({}, value), {}, {
|
|
111
|
+
mediaPath: path.toString()
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
return acc;
|
|
115
|
+
}, {
|
|
116
|
+
representation: representation,
|
|
117
|
+
altRepresentation: altRepresentation
|
|
118
|
+
}));
|
|
96
119
|
case 9:
|
|
97
|
-
|
|
98
|
-
|
|
120
|
+
_context.prev = 9;
|
|
121
|
+
_context.t0 = _context["catch"](2);
|
|
122
|
+
return _context.abrupt("return", {
|
|
123
|
+
representation: representation,
|
|
124
|
+
altRepresentation: altRepresentation
|
|
125
|
+
});
|
|
126
|
+
case 12:
|
|
99
127
|
case "end":
|
|
100
128
|
return _context.stop();
|
|
101
129
|
}
|
|
102
|
-
}, _callee, this);
|
|
130
|
+
}, _callee, this, [[2, 9]]);
|
|
103
131
|
}));
|
|
104
|
-
function
|
|
105
|
-
return
|
|
132
|
+
function generateTokenisedMediaURLS(_x, _x2) {
|
|
133
|
+
return _generateTokenisedMediaURLS.apply(this, arguments);
|
|
106
134
|
}
|
|
107
|
-
return
|
|
135
|
+
return generateTokenisedMediaURLS;
|
|
108
136
|
}()
|
|
109
137
|
/**
|
|
110
138
|
* Will load media emoji, returning a new EmojiDescription if, for example,
|
|
@@ -12,7 +12,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
12
12
|
actionSubjectId: actionSubjectId,
|
|
13
13
|
attributes: _objectSpread({
|
|
14
14
|
packageName: "@atlaskit/emoji",
|
|
15
|
-
packageVersion: "67.
|
|
15
|
+
packageVersion: "67.6.0"
|
|
16
16
|
}, attributes)
|
|
17
17
|
};
|
|
18
18
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ServiceConfig } from '@atlaskit/util-service-support';
|
|
2
|
-
import type { EmojiDescription, EmojiId, EmojiServiceDescription, EmojiUpload, MediaApiToken, OptionalEmojiDescription } from '../../types';
|
|
2
|
+
import type { EmojiDescription, EmojiId, EmojiRepresentation, EmojiServiceDescription, EmojiUpload, MediaApiToken, OptionalEmojiDescription } from '../../types';
|
|
3
3
|
import TokenManager from './TokenManager';
|
|
4
4
|
export interface EmojiUploadResponse {
|
|
5
5
|
emojis: EmojiServiceDescription[];
|
|
@@ -10,6 +10,10 @@ export interface EmojiProgress {
|
|
|
10
10
|
export interface EmojiProgessCallback {
|
|
11
11
|
(progress: EmojiProgress): void;
|
|
12
12
|
}
|
|
13
|
+
type TokenisedEmojiRepresentation = {
|
|
14
|
+
representation?: EmojiRepresentation;
|
|
15
|
+
altRepresentation?: EmojiRepresentation;
|
|
16
|
+
};
|
|
13
17
|
export declare const mediaProportionOfProgress: number;
|
|
14
18
|
export default class SiteEmojiResource {
|
|
15
19
|
private siteServiceConfig;
|
|
@@ -18,9 +22,9 @@ export default class SiteEmojiResource {
|
|
|
18
22
|
protected tokenManager: TokenManager;
|
|
19
23
|
constructor(siteServiceConfig: ServiceConfig, mediaApiToken: MediaApiToken);
|
|
20
24
|
/**
|
|
21
|
-
* Will generate an emoji media path that is inclusive of client and token within the query parameter
|
|
25
|
+
* Will generate an emoji media path that is inclusive of client and token within the query parameter for media representation and altRepresentation
|
|
22
26
|
*/
|
|
23
|
-
|
|
27
|
+
generateTokenisedMediaURLS(representation: EmojiRepresentation, altRepresentation?: EmojiRepresentation): Promise<TokenisedEmojiRepresentation>;
|
|
24
28
|
/**
|
|
25
29
|
* Will load media emoji, returning a new EmojiDescription if, for example,
|
|
26
30
|
* the URL has changed.
|
|
@@ -44,3 +48,4 @@ export default class SiteEmojiResource {
|
|
|
44
48
|
deleteEmoji(emoji: EmojiDescription): Promise<boolean>;
|
|
45
49
|
private postToEmojiService;
|
|
46
50
|
}
|
|
51
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ServiceConfig } from '@atlaskit/util-service-support';
|
|
2
|
-
import type { EmojiDescription, EmojiId, EmojiServiceDescription, EmojiUpload, MediaApiToken, OptionalEmojiDescription } from '../../types';
|
|
2
|
+
import type { EmojiDescription, EmojiId, EmojiRepresentation, EmojiServiceDescription, EmojiUpload, MediaApiToken, OptionalEmojiDescription } from '../../types';
|
|
3
3
|
import TokenManager from './TokenManager';
|
|
4
4
|
export interface EmojiUploadResponse {
|
|
5
5
|
emojis: EmojiServiceDescription[];
|
|
@@ -10,6 +10,10 @@ export interface EmojiProgress {
|
|
|
10
10
|
export interface EmojiProgessCallback {
|
|
11
11
|
(progress: EmojiProgress): void;
|
|
12
12
|
}
|
|
13
|
+
type TokenisedEmojiRepresentation = {
|
|
14
|
+
representation?: EmojiRepresentation;
|
|
15
|
+
altRepresentation?: EmojiRepresentation;
|
|
16
|
+
};
|
|
13
17
|
export declare const mediaProportionOfProgress: number;
|
|
14
18
|
export default class SiteEmojiResource {
|
|
15
19
|
private siteServiceConfig;
|
|
@@ -18,9 +22,9 @@ export default class SiteEmojiResource {
|
|
|
18
22
|
protected tokenManager: TokenManager;
|
|
19
23
|
constructor(siteServiceConfig: ServiceConfig, mediaApiToken: MediaApiToken);
|
|
20
24
|
/**
|
|
21
|
-
* Will generate an emoji media path that is inclusive of client and token within the query parameter
|
|
25
|
+
* Will generate an emoji media path that is inclusive of client and token within the query parameter for media representation and altRepresentation
|
|
22
26
|
*/
|
|
23
|
-
|
|
27
|
+
generateTokenisedMediaURLS(representation: EmojiRepresentation, altRepresentation?: EmojiRepresentation): Promise<TokenisedEmojiRepresentation>;
|
|
24
28
|
/**
|
|
25
29
|
* Will load media emoji, returning a new EmojiDescription if, for example,
|
|
26
30
|
* the URL has changed.
|
|
@@ -44,3 +48,4 @@ export default class SiteEmojiResource {
|
|
|
44
48
|
deleteEmoji(emoji: EmojiDescription): Promise<boolean>;
|
|
45
49
|
private postToEmojiService;
|
|
46
50
|
}
|
|
51
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/emoji",
|
|
3
|
-
"version": "67.
|
|
3
|
+
"version": "67.6.0",
|
|
4
4
|
"description": "Fabric emoji React components",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@atlaskit/analytics-next": "^9.1.0",
|
|
37
|
-
"@atlaskit/button": "^16.
|
|
37
|
+
"@atlaskit/button": "^16.16.0",
|
|
38
38
|
"@atlaskit/icon": "^21.12.0",
|
|
39
39
|
"@atlaskit/media-client": "^25.0.0",
|
|
40
|
-
"@atlaskit/media-client-react": "^1.
|
|
40
|
+
"@atlaskit/media-client-react": "^1.4.0",
|
|
41
41
|
"@atlaskit/spinner": "^15.6.0",
|
|
42
42
|
"@atlaskit/textfield": "^5.6.0",
|
|
43
43
|
"@atlaskit/theme": "^12.6.0",
|
package/report.api.md
CHANGED
|
@@ -1193,7 +1193,10 @@ class SiteEmojiResource {
|
|
|
1193
1193
|
deleteEmoji(emoji: EmojiDescription): Promise<boolean>;
|
|
1194
1194
|
// (undocumented)
|
|
1195
1195
|
findEmoji(emojiId: EmojiId): Promise<OptionalEmojiDescription>;
|
|
1196
|
-
|
|
1196
|
+
generateTokenisedMediaURLS(
|
|
1197
|
+
representation: EmojiRepresentation,
|
|
1198
|
+
altRepresentation?: EmojiRepresentation,
|
|
1199
|
+
): Promise<TokenisedEmojiRepresentation>;
|
|
1197
1200
|
hasUploadToken(): Promise<boolean>;
|
|
1198
1201
|
loadMediaEmoji(
|
|
1199
1202
|
emoji: EmojiDescription,
|
|
@@ -1276,6 +1279,12 @@ export interface Styles {
|
|
|
1276
1279
|
// @public (undocumented)
|
|
1277
1280
|
export const toEmojiId: (emoji: EmojiDescription) => EmojiId;
|
|
1278
1281
|
|
|
1282
|
+
// @public (undocumented)
|
|
1283
|
+
type TokenisedEmojiRepresentation = {
|
|
1284
|
+
representation?: EmojiRepresentation;
|
|
1285
|
+
altRepresentation?: EmojiRepresentation;
|
|
1286
|
+
};
|
|
1287
|
+
|
|
1279
1288
|
// @public (undocumented)
|
|
1280
1289
|
class TokenManager {
|
|
1281
1290
|
constructor(siteServiceConfig: ServiceConfig);
|
package/tmp/api-report-tmp.d.ts
CHANGED
|
@@ -1067,7 +1067,7 @@ class SiteEmojiResource {
|
|
|
1067
1067
|
deleteEmoji(emoji: EmojiDescription): Promise<boolean>;
|
|
1068
1068
|
// (undocumented)
|
|
1069
1069
|
findEmoji(emojiId: EmojiId): Promise<OptionalEmojiDescription>;
|
|
1070
|
-
|
|
1070
|
+
generateTokenisedMediaURLS(representation: EmojiRepresentation, altRepresentation?: EmojiRepresentation): Promise<TokenisedEmojiRepresentation>;
|
|
1071
1071
|
hasUploadToken(): Promise<boolean>;
|
|
1072
1072
|
loadMediaEmoji(emoji: EmojiDescription, useAlt?: boolean): OptionalEmojiDescription | Promise<OptionalEmojiDescription>;
|
|
1073
1073
|
// (undocumented)
|
|
@@ -1140,6 +1140,12 @@ export interface Styles {
|
|
|
1140
1140
|
// @public (undocumented)
|
|
1141
1141
|
export const toEmojiId: (emoji: EmojiDescription) => EmojiId;
|
|
1142
1142
|
|
|
1143
|
+
// @public (undocumented)
|
|
1144
|
+
type TokenisedEmojiRepresentation = {
|
|
1145
|
+
representation?: EmojiRepresentation;
|
|
1146
|
+
altRepresentation?: EmojiRepresentation;
|
|
1147
|
+
};
|
|
1148
|
+
|
|
1143
1149
|
// @public (undocumented)
|
|
1144
1150
|
class TokenManager {
|
|
1145
1151
|
constructor(siteServiceConfig: ServiceConfig);
|