@atlaskit/editor-core 187.28.2 → 187.28.5
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 +12 -0
- package/dist/cjs/plugins/emoji/index.js +50 -5
- package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +7 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/plugins/emoji/index.js +51 -5
- package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +5 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/plugins/emoji/index.js +49 -5
- package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +7 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/plugins/emoji/index.d.ts +14 -1
- package/dist/types/plugins/text-color/ui/ToolbarTextColor/index.d.ts +1 -0
- package/dist/types-ts4.5/plugins/emoji/index.d.ts +14 -1
- package/dist/types-ts4.5/plugins/text-color/ui/ToolbarTextColor/index.d.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/editor-core
|
|
2
2
|
|
|
3
|
+
## 187.28.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`5ce0bea6aa6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5ce0bea6aa6) - [ED-19399] Fixing text color underline on toolbar
|
|
8
|
+
|
|
9
|
+
## 187.28.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`6cced3b0ed6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6cced3b0ed6) - Warn if the emoji provider prop for the Editor is changing too quickly as it will cause performance issues.
|
|
14
|
+
|
|
3
15
|
## 187.28.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.ACTIONS = void 0;
|
|
8
8
|
exports.createEmojiPlugin = createEmojiPlugin;
|
|
9
|
+
exports.createRateLimitReachedFunction = createRateLimitReachedFunction;
|
|
9
10
|
exports.emojiToTypeaheadItem = exports.emojiPluginKey = exports.emojiPlugin = exports.defaultListLimit = void 0;
|
|
10
11
|
exports.getEmojiPluginState = getEmojiPluginState;
|
|
11
12
|
exports.memoize = memoize;
|
|
@@ -268,7 +269,44 @@ var setAsciiMap = function setAsciiMap(asciiMap) {
|
|
|
268
269
|
return true;
|
|
269
270
|
};
|
|
270
271
|
};
|
|
271
|
-
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
*
|
|
275
|
+
* Wrapper to call `onLimitReached` when a specified number of calls of that function
|
|
276
|
+
* have been made within a time period.
|
|
277
|
+
*
|
|
278
|
+
* Note: It does not rate limit
|
|
279
|
+
*
|
|
280
|
+
* @param fn Function to wrap
|
|
281
|
+
* @param limitTime Time limit in milliseconds
|
|
282
|
+
* @param limitCount Number of function calls before `onRateReached` is called (per time period)
|
|
283
|
+
* @returns Wrapped function
|
|
284
|
+
*/
|
|
285
|
+
function createRateLimitReachedFunction(fn, limitTime, limitCount, onLimitReached) {
|
|
286
|
+
var lastCallTime = 0;
|
|
287
|
+
var callCount = 0;
|
|
288
|
+
return function wrappedFn() {
|
|
289
|
+
var now = Date.now();
|
|
290
|
+
if (now - lastCallTime < limitTime) {
|
|
291
|
+
if (++callCount > limitCount) {
|
|
292
|
+
onLimitReached === null || onLimitReached === void 0 ? void 0 : onLimitReached();
|
|
293
|
+
}
|
|
294
|
+
} else {
|
|
295
|
+
lastCallTime = now;
|
|
296
|
+
callCount = 1;
|
|
297
|
+
}
|
|
298
|
+
return fn.apply(void 0, arguments);
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
// At this stage console.error only
|
|
303
|
+
var logRateWarning = function logRateWarning() {
|
|
304
|
+
if (process.env.NODE_ENV === 'development') {
|
|
305
|
+
// eslint-disable-next-line no-console
|
|
306
|
+
console.error('The emoji provider injected in the Editor is being reloaded frequently, this will cause a slow Editor experience.');
|
|
307
|
+
}
|
|
308
|
+
};
|
|
309
|
+
var setProvider = createRateLimitReachedFunction(function (provider) {
|
|
272
310
|
return function (state, dispatch) {
|
|
273
311
|
if (dispatch) {
|
|
274
312
|
dispatch(state.tr.setMeta(emojiPluginKey, {
|
|
@@ -280,7 +318,11 @@ var setProvider = function setProvider(provider) {
|
|
|
280
318
|
}
|
|
281
319
|
return true;
|
|
282
320
|
};
|
|
283
|
-
}
|
|
321
|
+
},
|
|
322
|
+
// If we change the emoji provider more than three times every 5 seconds we should warn.
|
|
323
|
+
// This seems like a really long time but the performance can be that laggy that we don't
|
|
324
|
+
// even get 3 events in 3 seconds and miss this indicator.
|
|
325
|
+
5000, 3, logRateWarning);
|
|
284
326
|
exports.setProvider = setProvider;
|
|
285
327
|
var emojiPluginKey = new _state.PluginKey('emojiPlugin');
|
|
286
328
|
exports.emojiPluginKey = emojiPluginKey;
|
|
@@ -335,15 +377,18 @@ function createEmojiPlugin(pmPluginFactoryParams) {
|
|
|
335
377
|
switch (name) {
|
|
336
378
|
case 'emojiProvider':
|
|
337
379
|
if (!providerPromise) {
|
|
338
|
-
|
|
380
|
+
var _setProvider;
|
|
381
|
+
return setProvider === null || setProvider === void 0 ? void 0 : (_setProvider = setProvider(undefined)) === null || _setProvider === void 0 ? void 0 : _setProvider(editorView.state, editorView.dispatch);
|
|
339
382
|
}
|
|
340
383
|
providerPromise.then(function (provider) {
|
|
341
|
-
|
|
384
|
+
var _setProvider2;
|
|
385
|
+
setProvider === null || setProvider === void 0 ? void 0 : (_setProvider2 = setProvider(provider)) === null || _setProvider2 === void 0 ? void 0 : _setProvider2(editorView.state, editorView.dispatch);
|
|
342
386
|
provider.getAsciiMap().then(function (asciiMap) {
|
|
343
387
|
setAsciiMap(asciiMap)(editorView.state, editorView.dispatch);
|
|
344
388
|
});
|
|
345
389
|
}).catch(function () {
|
|
346
|
-
|
|
390
|
+
var _setProvider3;
|
|
391
|
+
return setProvider === null || setProvider === void 0 ? void 0 : (_setProvider3 = setProvider(undefined)) === null || _setProvider3 === void 0 ? void 0 : _setProvider3(editorView.state, editorView.dispatch);
|
|
347
392
|
});
|
|
348
393
|
break;
|
|
349
394
|
}
|
|
@@ -181,7 +181,7 @@ var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
181
181
|
// Not sure where the extra 2px comes from
|
|
182
182
|
fitWidth = 242;
|
|
183
183
|
}
|
|
184
|
-
var selectedColor =
|
|
184
|
+
var selectedColor = this.getSelectedColor(pluginState);
|
|
185
185
|
var _getSelectedRowAndCol = (0, _uiColor.getSelectedRowAndColumnFromPalette)(palette, pluginState.color),
|
|
186
186
|
selectedRowIndex = _getSelectedRowAndCol.selectedRowIndex,
|
|
187
187
|
selectedColumnIndex = _getSelectedRowAndCol.selectedColumnIndex;
|
|
@@ -246,6 +246,12 @@ var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
246
246
|
css: _styles2.separatorStyles
|
|
247
247
|
}));
|
|
248
248
|
}
|
|
249
|
+
}, {
|
|
250
|
+
key: "getSelectedColor",
|
|
251
|
+
value: function getSelectedColor(pluginState) {
|
|
252
|
+
var selectedColor = pluginState.color !== pluginState.defaultColor && (pluginState.color ? (0, _editorPalette.hexToEditorTextPaletteColor)(pluginState.color) : pluginState.color);
|
|
253
|
+
return selectedColor;
|
|
254
|
+
}
|
|
249
255
|
}, {
|
|
250
256
|
key: "getCommonAnalyticsAttributes",
|
|
251
257
|
value: function getCommonAnalyticsAttributes() {
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.version = exports.nextMajorVersion = exports.name = void 0;
|
|
7
7
|
var name = "@atlaskit/editor-core";
|
|
8
8
|
exports.name = name;
|
|
9
|
-
var version = "187.28.
|
|
9
|
+
var version = "187.28.5";
|
|
10
10
|
exports.version = version;
|
|
11
11
|
var nextMajorVersion = function nextMajorVersion() {
|
|
12
12
|
return [Number(version.split('.')[0]) + 1, 0, 0].join('.');
|
|
@@ -241,7 +241,44 @@ const setAsciiMap = asciiMap => (state, dispatch) => {
|
|
|
241
241
|
}
|
|
242
242
|
return true;
|
|
243
243
|
};
|
|
244
|
-
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
*
|
|
247
|
+
* Wrapper to call `onLimitReached` when a specified number of calls of that function
|
|
248
|
+
* have been made within a time period.
|
|
249
|
+
*
|
|
250
|
+
* Note: It does not rate limit
|
|
251
|
+
*
|
|
252
|
+
* @param fn Function to wrap
|
|
253
|
+
* @param limitTime Time limit in milliseconds
|
|
254
|
+
* @param limitCount Number of function calls before `onRateReached` is called (per time period)
|
|
255
|
+
* @returns Wrapped function
|
|
256
|
+
*/
|
|
257
|
+
export function createRateLimitReachedFunction(fn, limitTime, limitCount, onLimitReached) {
|
|
258
|
+
let lastCallTime = 0;
|
|
259
|
+
let callCount = 0;
|
|
260
|
+
return function wrappedFn(...args) {
|
|
261
|
+
const now = Date.now();
|
|
262
|
+
if (now - lastCallTime < limitTime) {
|
|
263
|
+
if (++callCount > limitCount) {
|
|
264
|
+
onLimitReached === null || onLimitReached === void 0 ? void 0 : onLimitReached();
|
|
265
|
+
}
|
|
266
|
+
} else {
|
|
267
|
+
lastCallTime = now;
|
|
268
|
+
callCount = 1;
|
|
269
|
+
}
|
|
270
|
+
return fn(...args);
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// At this stage console.error only
|
|
275
|
+
const logRateWarning = () => {
|
|
276
|
+
if (process.env.NODE_ENV === 'development') {
|
|
277
|
+
// eslint-disable-next-line no-console
|
|
278
|
+
console.error('The emoji provider injected in the Editor is being reloaded frequently, this will cause a slow Editor experience.');
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
export const setProvider = createRateLimitReachedFunction(provider => (state, dispatch) => {
|
|
245
282
|
if (dispatch) {
|
|
246
283
|
dispatch(state.tr.setMeta(emojiPluginKey, {
|
|
247
284
|
action: ACTIONS.SET_PROVIDER,
|
|
@@ -251,7 +288,11 @@ export const setProvider = provider => (state, dispatch) => {
|
|
|
251
288
|
}));
|
|
252
289
|
}
|
|
253
290
|
return true;
|
|
254
|
-
}
|
|
291
|
+
},
|
|
292
|
+
// If we change the emoji provider more than three times every 5 seconds we should warn.
|
|
293
|
+
// This seems like a really long time but the performance can be that laggy that we don't
|
|
294
|
+
// even get 3 events in 3 seconds and miss this indicator.
|
|
295
|
+
5000, 3, logRateWarning);
|
|
255
296
|
export const emojiPluginKey = new PluginKey('emojiPlugin');
|
|
256
297
|
export function getEmojiPluginState(state) {
|
|
257
298
|
return emojiPluginKey.getState(state) || {};
|
|
@@ -307,14 +348,19 @@ export function createEmojiPlugin(pmPluginFactoryParams) {
|
|
|
307
348
|
switch (name) {
|
|
308
349
|
case 'emojiProvider':
|
|
309
350
|
if (!providerPromise) {
|
|
310
|
-
|
|
351
|
+
var _setProvider;
|
|
352
|
+
return setProvider === null || setProvider === void 0 ? void 0 : (_setProvider = setProvider(undefined)) === null || _setProvider === void 0 ? void 0 : _setProvider(editorView.state, editorView.dispatch);
|
|
311
353
|
}
|
|
312
354
|
providerPromise.then(provider => {
|
|
313
|
-
|
|
355
|
+
var _setProvider2;
|
|
356
|
+
setProvider === null || setProvider === void 0 ? void 0 : (_setProvider2 = setProvider(provider)) === null || _setProvider2 === void 0 ? void 0 : _setProvider2(editorView.state, editorView.dispatch);
|
|
314
357
|
provider.getAsciiMap().then(asciiMap => {
|
|
315
358
|
setAsciiMap(asciiMap)(editorView.state, editorView.dispatch);
|
|
316
359
|
});
|
|
317
|
-
}).catch(() =>
|
|
360
|
+
}).catch(() => {
|
|
361
|
+
var _setProvider3;
|
|
362
|
+
return setProvider === null || setProvider === void 0 ? void 0 : (_setProvider3 = setProvider(undefined)) === null || _setProvider3 === void 0 ? void 0 : _setProvider3(editorView.state, editorView.dispatch);
|
|
363
|
+
});
|
|
318
364
|
break;
|
|
319
365
|
}
|
|
320
366
|
return;
|
|
@@ -159,7 +159,7 @@ export class ToolbarTextColor extends React.Component {
|
|
|
159
159
|
// Not sure where the extra 2px comes from
|
|
160
160
|
fitWidth = 242;
|
|
161
161
|
}
|
|
162
|
-
const selectedColor =
|
|
162
|
+
const selectedColor = this.getSelectedColor(pluginState);
|
|
163
163
|
const {
|
|
164
164
|
selectedRowIndex,
|
|
165
165
|
selectedColumnIndex
|
|
@@ -223,6 +223,10 @@ export class ToolbarTextColor extends React.Component {
|
|
|
223
223
|
css: separatorStyles
|
|
224
224
|
}));
|
|
225
225
|
}
|
|
226
|
+
getSelectedColor(pluginState) {
|
|
227
|
+
const selectedColor = pluginState.color !== pluginState.defaultColor && (pluginState.color ? hexToEditorTextPaletteColor(pluginState.color) : pluginState.color);
|
|
228
|
+
return selectedColor;
|
|
229
|
+
}
|
|
226
230
|
getCommonAnalyticsAttributes() {
|
|
227
231
|
return {
|
|
228
232
|
experiment: EXPERIMENT_NAME,
|
|
@@ -253,7 +253,44 @@ var setAsciiMap = function setAsciiMap(asciiMap) {
|
|
|
253
253
|
return true;
|
|
254
254
|
};
|
|
255
255
|
};
|
|
256
|
-
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
*
|
|
259
|
+
* Wrapper to call `onLimitReached` when a specified number of calls of that function
|
|
260
|
+
* have been made within a time period.
|
|
261
|
+
*
|
|
262
|
+
* Note: It does not rate limit
|
|
263
|
+
*
|
|
264
|
+
* @param fn Function to wrap
|
|
265
|
+
* @param limitTime Time limit in milliseconds
|
|
266
|
+
* @param limitCount Number of function calls before `onRateReached` is called (per time period)
|
|
267
|
+
* @returns Wrapped function
|
|
268
|
+
*/
|
|
269
|
+
export function createRateLimitReachedFunction(fn, limitTime, limitCount, onLimitReached) {
|
|
270
|
+
var lastCallTime = 0;
|
|
271
|
+
var callCount = 0;
|
|
272
|
+
return function wrappedFn() {
|
|
273
|
+
var now = Date.now();
|
|
274
|
+
if (now - lastCallTime < limitTime) {
|
|
275
|
+
if (++callCount > limitCount) {
|
|
276
|
+
onLimitReached === null || onLimitReached === void 0 ? void 0 : onLimitReached();
|
|
277
|
+
}
|
|
278
|
+
} else {
|
|
279
|
+
lastCallTime = now;
|
|
280
|
+
callCount = 1;
|
|
281
|
+
}
|
|
282
|
+
return fn.apply(void 0, arguments);
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
// At this stage console.error only
|
|
287
|
+
var logRateWarning = function logRateWarning() {
|
|
288
|
+
if (process.env.NODE_ENV === 'development') {
|
|
289
|
+
// eslint-disable-next-line no-console
|
|
290
|
+
console.error('The emoji provider injected in the Editor is being reloaded frequently, this will cause a slow Editor experience.');
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
export var setProvider = createRateLimitReachedFunction(function (provider) {
|
|
257
294
|
return function (state, dispatch) {
|
|
258
295
|
if (dispatch) {
|
|
259
296
|
dispatch(state.tr.setMeta(emojiPluginKey, {
|
|
@@ -265,7 +302,11 @@ export var setProvider = function setProvider(provider) {
|
|
|
265
302
|
}
|
|
266
303
|
return true;
|
|
267
304
|
};
|
|
268
|
-
}
|
|
305
|
+
},
|
|
306
|
+
// If we change the emoji provider more than three times every 5 seconds we should warn.
|
|
307
|
+
// This seems like a really long time but the performance can be that laggy that we don't
|
|
308
|
+
// even get 3 events in 3 seconds and miss this indicator.
|
|
309
|
+
5000, 3, logRateWarning);
|
|
269
310
|
export var emojiPluginKey = new PluginKey('emojiPlugin');
|
|
270
311
|
export function getEmojiPluginState(state) {
|
|
271
312
|
return emojiPluginKey.getState(state) || {};
|
|
@@ -318,15 +359,18 @@ export function createEmojiPlugin(pmPluginFactoryParams) {
|
|
|
318
359
|
switch (name) {
|
|
319
360
|
case 'emojiProvider':
|
|
320
361
|
if (!providerPromise) {
|
|
321
|
-
|
|
362
|
+
var _setProvider;
|
|
363
|
+
return setProvider === null || setProvider === void 0 ? void 0 : (_setProvider = setProvider(undefined)) === null || _setProvider === void 0 ? void 0 : _setProvider(editorView.state, editorView.dispatch);
|
|
322
364
|
}
|
|
323
365
|
providerPromise.then(function (provider) {
|
|
324
|
-
|
|
366
|
+
var _setProvider2;
|
|
367
|
+
setProvider === null || setProvider === void 0 ? void 0 : (_setProvider2 = setProvider(provider)) === null || _setProvider2 === void 0 ? void 0 : _setProvider2(editorView.state, editorView.dispatch);
|
|
325
368
|
provider.getAsciiMap().then(function (asciiMap) {
|
|
326
369
|
setAsciiMap(asciiMap)(editorView.state, editorView.dispatch);
|
|
327
370
|
});
|
|
328
371
|
}).catch(function () {
|
|
329
|
-
|
|
372
|
+
var _setProvider3;
|
|
373
|
+
return setProvider === null || setProvider === void 0 ? void 0 : (_setProvider3 = setProvider(undefined)) === null || _setProvider3 === void 0 ? void 0 : _setProvider3(editorView.state, editorView.dispatch);
|
|
330
374
|
});
|
|
331
375
|
break;
|
|
332
376
|
}
|
|
@@ -171,7 +171,7 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
171
171
|
// Not sure where the extra 2px comes from
|
|
172
172
|
fitWidth = 242;
|
|
173
173
|
}
|
|
174
|
-
var selectedColor =
|
|
174
|
+
var selectedColor = this.getSelectedColor(pluginState);
|
|
175
175
|
var _getSelectedRowAndCol = getSelectedRowAndColumnFromPalette(palette, pluginState.color),
|
|
176
176
|
selectedRowIndex = _getSelectedRowAndCol.selectedRowIndex,
|
|
177
177
|
selectedColumnIndex = _getSelectedRowAndCol.selectedColumnIndex;
|
|
@@ -236,6 +236,12 @@ export var ToolbarTextColor = /*#__PURE__*/function (_React$Component) {
|
|
|
236
236
|
css: separatorStyles
|
|
237
237
|
}));
|
|
238
238
|
}
|
|
239
|
+
}, {
|
|
240
|
+
key: "getSelectedColor",
|
|
241
|
+
value: function getSelectedColor(pluginState) {
|
|
242
|
+
var selectedColor = pluginState.color !== pluginState.defaultColor && (pluginState.color ? hexToEditorTextPaletteColor(pluginState.color) : pluginState.color);
|
|
243
|
+
return selectedColor;
|
|
244
|
+
}
|
|
239
245
|
}, {
|
|
240
246
|
key: "getCommonAnalyticsAttributes",
|
|
241
247
|
value: function getCommonAnalyticsAttributes() {
|
|
@@ -31,7 +31,20 @@ export declare const ACTIONS: {
|
|
|
31
31
|
SET_RESULTS: string;
|
|
32
32
|
SET_ASCII_MAP: string;
|
|
33
33
|
};
|
|
34
|
-
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
* Wrapper to call `onLimitReached` when a specified number of calls of that function
|
|
37
|
+
* have been made within a time period.
|
|
38
|
+
*
|
|
39
|
+
* Note: It does not rate limit
|
|
40
|
+
*
|
|
41
|
+
* @param fn Function to wrap
|
|
42
|
+
* @param limitTime Time limit in milliseconds
|
|
43
|
+
* @param limitCount Number of function calls before `onRateReached` is called (per time period)
|
|
44
|
+
* @returns Wrapped function
|
|
45
|
+
*/
|
|
46
|
+
export declare function createRateLimitReachedFunction<LimitedFunction extends (...args: any[]) => any>(fn: Function, limitTime: number, limitCount: number, onLimitReached: () => void): (...args: Parameters<LimitedFunction>) => ReturnType<LimitedFunction> | undefined;
|
|
47
|
+
export declare const setProvider: ((provider?: EmojiProvider) => Command) | undefined;
|
|
35
48
|
export declare const emojiPluginKey: PluginKey<EmojiPluginState>;
|
|
36
49
|
export declare function getEmojiPluginState(state: EditorState): EmojiPluginState;
|
|
37
50
|
export declare function createEmojiPlugin(pmPluginFactoryParams: PMPluginFactoryParams): SafePlugin<EmojiPluginState>;
|
|
@@ -40,6 +40,7 @@ export declare class ToolbarTextColor extends React.Component<Props & WrappedCom
|
|
|
40
40
|
private handleOpenChange;
|
|
41
41
|
private hide;
|
|
42
42
|
private hideonEsc;
|
|
43
|
+
private getSelectedColor;
|
|
43
44
|
private getCommonAnalyticsAttributes;
|
|
44
45
|
private buildAnalyticsPalette;
|
|
45
46
|
private buildAnalyticsSelectColor;
|
|
@@ -34,7 +34,20 @@ export declare const ACTIONS: {
|
|
|
34
34
|
SET_RESULTS: string;
|
|
35
35
|
SET_ASCII_MAP: string;
|
|
36
36
|
};
|
|
37
|
-
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* Wrapper to call `onLimitReached` when a specified number of calls of that function
|
|
40
|
+
* have been made within a time period.
|
|
41
|
+
*
|
|
42
|
+
* Note: It does not rate limit
|
|
43
|
+
*
|
|
44
|
+
* @param fn Function to wrap
|
|
45
|
+
* @param limitTime Time limit in milliseconds
|
|
46
|
+
* @param limitCount Number of function calls before `onRateReached` is called (per time period)
|
|
47
|
+
* @returns Wrapped function
|
|
48
|
+
*/
|
|
49
|
+
export declare function createRateLimitReachedFunction<LimitedFunction extends (...args: any[]) => any>(fn: Function, limitTime: number, limitCount: number, onLimitReached: () => void): (...args: Parameters<LimitedFunction>) => ReturnType<LimitedFunction> | undefined;
|
|
50
|
+
export declare const setProvider: ((provider?: EmojiProvider) => Command) | undefined;
|
|
38
51
|
export declare const emojiPluginKey: PluginKey<EmojiPluginState>;
|
|
39
52
|
export declare function getEmojiPluginState(state: EditorState): EmojiPluginState;
|
|
40
53
|
export declare function createEmojiPlugin(pmPluginFactoryParams: PMPluginFactoryParams): SafePlugin<EmojiPluginState>;
|
|
@@ -40,6 +40,7 @@ export declare class ToolbarTextColor extends React.Component<Props & WrappedCom
|
|
|
40
40
|
private handleOpenChange;
|
|
41
41
|
private hide;
|
|
42
42
|
private hideonEsc;
|
|
43
|
+
private getSelectedColor;
|
|
43
44
|
private getCommonAnalyticsAttributes;
|
|
44
45
|
private buildAnalyticsPalette;
|
|
45
46
|
private buildAnalyticsSelectColor;
|