@atlaskit/editor-common 59.1.0 → 60.3.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.
Files changed (163) hide show
  1. package/CHANGELOG.md +69 -0
  2. package/dist/cjs/i18n/cs.js +1 -0
  3. package/dist/cjs/i18n/da.js +1 -0
  4. package/dist/cjs/i18n/de.js +1 -0
  5. package/dist/cjs/i18n/es.js +1 -0
  6. package/dist/cjs/i18n/fi.js +1 -0
  7. package/dist/cjs/i18n/fr.js +1 -0
  8. package/dist/cjs/i18n/hu.js +1 -0
  9. package/dist/cjs/i18n/it.js +1 -0
  10. package/dist/cjs/i18n/ja.js +1 -0
  11. package/dist/cjs/i18n/ko.js +1 -0
  12. package/dist/cjs/i18n/nb.js +1 -0
  13. package/dist/cjs/i18n/nl.js +1 -0
  14. package/dist/cjs/i18n/pl.js +1 -0
  15. package/dist/cjs/i18n/pt_BR.js +1 -0
  16. package/dist/cjs/i18n/ru.js +1 -0
  17. package/dist/cjs/i18n/sv.js +1 -0
  18. package/dist/cjs/i18n/th.js +1 -0
  19. package/dist/cjs/i18n/tr.js +1 -0
  20. package/dist/cjs/i18n/uk.js +1 -0
  21. package/dist/cjs/i18n/vi.js +1 -0
  22. package/dist/cjs/i18n/zh.js +1 -1
  23. package/dist/cjs/i18n/zh_TW.js +1 -0
  24. package/dist/cjs/index.js +6 -0
  25. package/dist/cjs/messages/codeBidiWarning.js +21 -0
  26. package/dist/cjs/messages/index.js +8 -0
  27. package/dist/cjs/styles/shared/panel.js +12 -2
  28. package/dist/cjs/styles/shared/table.js +1 -1
  29. package/dist/cjs/type-ahead/index.js +25 -0
  30. package/dist/cjs/types/{typeAhead.js → type-ahead.js} +0 -0
  31. package/dist/cjs/ufo/experience-store.js +159 -0
  32. package/dist/cjs/ufo/index.js +25 -0
  33. package/dist/cjs/ui/Messages/index.js +1 -3
  34. package/dist/cjs/utils/browser.js +7 -1
  35. package/dist/cjs/utils/index.js +9 -1
  36. package/dist/cjs/utils/profiler/render-count.js +135 -0
  37. package/dist/cjs/utils/validator.js +34 -11
  38. package/dist/cjs/version.json +1 -1
  39. package/dist/es2019/i18n/cs.js +1 -0
  40. package/dist/es2019/i18n/da.js +1 -0
  41. package/dist/es2019/i18n/de.js +1 -0
  42. package/dist/es2019/i18n/es.js +1 -0
  43. package/dist/es2019/i18n/fi.js +1 -0
  44. package/dist/es2019/i18n/fr.js +1 -0
  45. package/dist/es2019/i18n/hu.js +1 -0
  46. package/dist/es2019/i18n/it.js +1 -0
  47. package/dist/es2019/i18n/ja.js +1 -0
  48. package/dist/es2019/i18n/ko.js +1 -0
  49. package/dist/es2019/i18n/nb.js +1 -0
  50. package/dist/es2019/i18n/nl.js +1 -0
  51. package/dist/es2019/i18n/pl.js +1 -0
  52. package/dist/es2019/i18n/pt_BR.js +1 -0
  53. package/dist/es2019/i18n/ru.js +1 -0
  54. package/dist/es2019/i18n/sv.js +1 -0
  55. package/dist/es2019/i18n/th.js +1 -0
  56. package/dist/es2019/i18n/tr.js +1 -0
  57. package/dist/es2019/i18n/uk.js +1 -0
  58. package/dist/es2019/i18n/vi.js +1 -0
  59. package/dist/es2019/i18n/zh.js +1 -1
  60. package/dist/es2019/i18n/zh_TW.js +1 -0
  61. package/dist/es2019/index.js +1 -1
  62. package/dist/es2019/messages/codeBidiWarning.js +12 -0
  63. package/dist/es2019/messages/index.js +1 -0
  64. package/dist/es2019/styles/shared/panel.js +19 -2
  65. package/dist/es2019/styles/shared/table.js +1 -1
  66. package/dist/es2019/type-ahead/index.js +17 -0
  67. package/dist/es2019/types/{typeAhead.js → type-ahead.js} +0 -0
  68. package/dist/es2019/ufo/experience-store.js +115 -0
  69. package/dist/es2019/ufo/index.js +1 -0
  70. package/dist/es2019/ui/Messages/index.js +1 -2
  71. package/dist/es2019/utils/browser.js +7 -1
  72. package/dist/es2019/utils/index.js +2 -1
  73. package/dist/es2019/utils/profiler/render-count.js +107 -0
  74. package/dist/es2019/utils/validator.js +25 -0
  75. package/dist/es2019/version.json +1 -1
  76. package/dist/esm/i18n/cs.js +1 -0
  77. package/dist/esm/i18n/da.js +1 -0
  78. package/dist/esm/i18n/de.js +1 -0
  79. package/dist/esm/i18n/es.js +1 -0
  80. package/dist/esm/i18n/fi.js +1 -0
  81. package/dist/esm/i18n/fr.js +1 -0
  82. package/dist/esm/i18n/hu.js +1 -0
  83. package/dist/esm/i18n/it.js +1 -0
  84. package/dist/esm/i18n/ja.js +1 -0
  85. package/dist/esm/i18n/ko.js +1 -0
  86. package/dist/esm/i18n/nb.js +1 -0
  87. package/dist/esm/i18n/nl.js +1 -0
  88. package/dist/esm/i18n/pl.js +1 -0
  89. package/dist/esm/i18n/pt_BR.js +1 -0
  90. package/dist/esm/i18n/ru.js +1 -0
  91. package/dist/esm/i18n/sv.js +1 -0
  92. package/dist/esm/i18n/th.js +1 -0
  93. package/dist/esm/i18n/tr.js +1 -0
  94. package/dist/esm/i18n/uk.js +1 -0
  95. package/dist/esm/i18n/vi.js +1 -0
  96. package/dist/esm/i18n/zh.js +1 -1
  97. package/dist/esm/i18n/zh_TW.js +1 -0
  98. package/dist/esm/index.js +1 -1
  99. package/dist/esm/messages/codeBidiWarning.js +12 -0
  100. package/dist/esm/messages/index.js +1 -0
  101. package/dist/esm/styles/shared/panel.js +10 -2
  102. package/dist/esm/styles/shared/table.js +1 -1
  103. package/dist/esm/type-ahead/index.js +17 -0
  104. package/dist/esm/types/{typeAhead.js → type-ahead.js} +0 -0
  105. package/dist/esm/ufo/experience-store.js +143 -0
  106. package/dist/esm/ufo/index.js +1 -0
  107. package/dist/esm/ui/Messages/index.js +1 -2
  108. package/dist/esm/utils/browser.js +7 -1
  109. package/dist/esm/utils/index.js +2 -1
  110. package/dist/esm/utils/profiler/render-count.js +123 -0
  111. package/dist/esm/utils/validator.js +34 -11
  112. package/dist/esm/version.json +1 -1
  113. package/dist/types/collab/types.d.ts +6 -0
  114. package/dist/types/extensions/extension-handlers.d.ts +3 -3
  115. package/dist/types/extensions/index.d.ts +1 -1
  116. package/dist/types/extensions/types/extension-handler.d.ts +2 -0
  117. package/dist/types/extensions/types/index.d.ts +1 -1
  118. package/dist/types/extensions.d.ts +1 -1
  119. package/dist/types/i18n/cs.d.ts +1 -0
  120. package/dist/types/i18n/da.d.ts +1 -0
  121. package/dist/types/i18n/de.d.ts +1 -0
  122. package/dist/types/i18n/es.d.ts +1 -0
  123. package/dist/types/i18n/fi.d.ts +1 -0
  124. package/dist/types/i18n/fr.d.ts +1 -0
  125. package/dist/types/i18n/hu.d.ts +1 -0
  126. package/dist/types/i18n/it.d.ts +1 -0
  127. package/dist/types/i18n/ja.d.ts +1 -0
  128. package/dist/types/i18n/ko.d.ts +1 -0
  129. package/dist/types/i18n/nb.d.ts +1 -0
  130. package/dist/types/i18n/nl.d.ts +1 -0
  131. package/dist/types/i18n/pl.d.ts +1 -0
  132. package/dist/types/i18n/pt_BR.d.ts +1 -0
  133. package/dist/types/i18n/ru.d.ts +1 -0
  134. package/dist/types/i18n/sv.d.ts +1 -0
  135. package/dist/types/i18n/th.d.ts +1 -0
  136. package/dist/types/i18n/tr.d.ts +1 -0
  137. package/dist/types/i18n/uk.d.ts +1 -0
  138. package/dist/types/i18n/vi.d.ts +1 -0
  139. package/dist/types/i18n/zh.d.ts +1 -0
  140. package/dist/types/i18n/zh_TW.d.ts +1 -0
  141. package/dist/types/index.d.ts +2 -2
  142. package/dist/types/messages/codeBidiWarning.d.ts +11 -0
  143. package/dist/types/messages/index.d.ts +1 -0
  144. package/dist/types/provider-factory/quick-insert-provider.d.ts +2 -2
  145. package/dist/types/provider-factory.d.ts +1 -1
  146. package/dist/types/styles/shared/panel.d.ts +5 -0
  147. package/dist/types/type-ahead/index.d.ts +12 -0
  148. package/dist/types/types/index.d.ts +1 -1
  149. package/dist/types/types/{typeAhead.d.ts → type-ahead.d.ts} +0 -0
  150. package/dist/types/ufo/experience-store.d.ts +32 -0
  151. package/dist/types/ufo/index.d.ts +1 -0
  152. package/dist/types/utils/browser.d.ts +3 -0
  153. package/dist/types/utils/index.d.ts +1 -0
  154. package/dist/types/utils/profiler/render-count.d.ts +50 -0
  155. package/package.json +20 -17
  156. package/type-ahead/package.json +7 -0
  157. package/ufo/package.json +7 -0
  158. package/dist/cjs/ui/Caption/index.test.js +0 -82
  159. package/dist/cjs/utils/performance/measure-tti.test.js +0 -183
  160. package/dist/es2019/ui/Caption/index.test.js +0 -73
  161. package/dist/es2019/utils/performance/measure-tti.test.js +0 -124
  162. package/dist/esm/ui/Caption/index.test.js +0 -73
  163. package/dist/esm/utils/performance/measure-tti.test.js +0 -174
@@ -13,7 +13,10 @@ var result = {
13
13
  chrome_version: 0,
14
14
  android: false,
15
15
  ios: false,
16
- webkit: false
16
+ webkit: false,
17
+ safari: false,
18
+ supportsIntersectionObserver: false,
19
+ supportsResizeObserver: false
17
20
  };
18
21
 
19
22
  if (typeof navigator !== 'undefined') {
@@ -29,6 +32,9 @@ if (typeof navigator !== 'undefined') {
29
32
  result.android = /Android \d/.test(navigator.userAgent);
30
33
  result.ios = !ie && /AppleWebKit/.test(navigator.userAgent) && /Mobile\/\w+/.test(navigator.userAgent);
31
34
  result.webkit = !ie && !!document.documentElement && 'WebkitAppearance' in document.documentElement.style;
35
+ result.safari = Boolean(navigator.vendor && navigator.vendor.indexOf('Apple') > -1 && navigator.userAgent && navigator.userAgent.indexOf('CriOS') === -1 && navigator.userAgent.indexOf('FxiOS') === -1);
36
+ result.supportsIntersectionObserver = typeof window !== 'undefined' && 'IntersectionObserver' in window && 'IntersectionObserverEntry' in window && 'intersectionRatio' in window.IntersectionObserverEntry.prototype;
37
+ result.supportsResizeObserver = typeof window !== 'undefined' && 'ResizeObserver' in window && 'ResizeObserverEntry' in window;
32
38
  }
33
39
 
34
40
  var _default = result;
@@ -335,6 +335,12 @@ Object.defineProperty(exports, "sniffUserBrowserExtensions", {
335
335
  return _browserExtensions.sniffUserBrowserExtensions;
336
336
  }
337
337
  });
338
+ Object.defineProperty(exports, "RenderCountProfiler", {
339
+ enumerable: true,
340
+ get: function get() {
341
+ return _renderCount.RenderCountProfiler;
342
+ }
343
+ });
338
344
 
339
345
  var _annotation = require("./annotation");
340
346
 
@@ -382,4 +388,6 @@ var _shouldForceTracking = require("./should-force-tracking");
382
388
 
383
389
  var _getModeFromTheme = require("./getModeFromTheme");
384
390
 
385
- var _browserExtensions = require("./browser-extensions");
391
+ var _browserExtensions = require("./browser-extensions");
392
+
393
+ var _renderCount = require("./profiler/render-count");
@@ -0,0 +1,135 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.RenderCountProfiler = exports.PROFILER_KEY = void 0;
9
+
10
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
+
12
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
+
14
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
15
+
16
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
17
+
18
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
19
+
20
+ var PROFILER_KEY = '__editorRenderCountProfiler';
21
+ exports.PROFILER_KEY = PROFILER_KEY;
22
+
23
+ var RenderCountProfiler = /*#__PURE__*/function () {
24
+ /**
25
+ * The singleton/cached instance of RenderCountProfiler that will be shared
26
+ * betweenRenderCountProfiler.getInstance() calls
27
+ */
28
+ function RenderCountProfiler(_ref) {
29
+ var store = _ref.store;
30
+ (0, _classCallCheck2.default)(this, RenderCountProfiler);
31
+ this.store = store;
32
+ }
33
+ /**
34
+ * Returns the singleton/cached instance of RenderCountProfiler that
35
+ * currently exists. If it hasn't been instantiated yet, the singleton
36
+ * instance will be created using the given params. Returns the latest
37
+ * singleton/instance.
38
+ */
39
+
40
+
41
+ (0, _createClass2.default)(RenderCountProfiler, [{
42
+ key: "getData",
43
+ value: function getData(profilerKey) {
44
+ var _this$store;
45
+
46
+ return (_this$store = this.store) === null || _this$store === void 0 ? void 0 : _this$store[profilerKey];
47
+ }
48
+ }, {
49
+ key: "enable",
50
+ value: function enable() {
51
+ this.store[PROFILER_KEY] = _objectSpread(_objectSpread({}, this.store[PROFILER_KEY]), {}, {
52
+ enabled: true
53
+ });
54
+ }
55
+ }, {
56
+ key: "remove",
57
+ value: function remove() {
58
+ delete this.store[PROFILER_KEY];
59
+ }
60
+ }, {
61
+ key: "isEnabled",
62
+ value: function isEnabled() {
63
+ var _this$store2, _this$store2$PROFILER;
64
+
65
+ return Boolean((_this$store2 = this.store) === null || _this$store2 === void 0 ? void 0 : (_this$store2$PROFILER = _this$store2[PROFILER_KEY]) === null || _this$store2$PROFILER === void 0 ? void 0 : _this$store2$PROFILER.enabled);
66
+ }
67
+ }, {
68
+ key: "setRenderCount",
69
+ value: function setRenderCount(_ref2) {
70
+ var componentId = _ref2.componentId,
71
+ renderCount = _ref2.renderCount,
72
+ instanceId = _ref2.instanceId;
73
+ var profilerData = this.store[PROFILER_KEY];
74
+ var instance = {
75
+ count: renderCount
76
+ };
77
+ var existingComponents = profilerData === null || profilerData === void 0 ? void 0 : profilerData.components;
78
+ var existingInstances = existingComponents === null || existingComponents === void 0 ? void 0 : existingComponents[componentId];
79
+
80
+ var updatedComponent = _objectSpread(_objectSpread({}, existingInstances), {}, (0, _defineProperty2.default)({}, instanceId, instance));
81
+
82
+ this.store[PROFILER_KEY] = _objectSpread(_objectSpread({}, profilerData), {}, {
83
+ components: _objectSpread(_objectSpread({}, existingComponents), {}, (0, _defineProperty2.default)({}, componentId, updatedComponent))
84
+ });
85
+ }
86
+ }, {
87
+ key: "getInstanceRenderCounters",
88
+ value: function getInstanceRenderCounters(_ref3) {
89
+ var _this$store$PROFILER_, _this$store3, _this$store3$PROFILER, _this$store3$PROFILER2;
90
+
91
+ var componentId = _ref3.componentId;
92
+ var component = (_this$store$PROFILER_ = (_this$store3 = this.store) === null || _this$store3 === void 0 ? void 0 : (_this$store3$PROFILER = _this$store3[PROFILER_KEY]) === null || _this$store3$PROFILER === void 0 ? void 0 : (_this$store3$PROFILER2 = _this$store3$PROFILER.components) === null || _this$store3$PROFILER2 === void 0 ? void 0 : _this$store3$PROFILER2[componentId]) !== null && _this$store$PROFILER_ !== void 0 ? _this$store$PROFILER_ : {};
93
+ var counters = [];
94
+
95
+ for (var _instanceId in component) {
96
+ var counter = {
97
+ instanceId: _instanceId,
98
+ count: component[_instanceId].count
99
+ };
100
+ counters.push(counter);
101
+ }
102
+
103
+ return counters;
104
+ }
105
+ }, {
106
+ key: "getRenderCount",
107
+ value: function getRenderCount(_ref4) {
108
+ var _this$store$PROFILER_2, _this$store4, _this$store4$PROFILER, _this$store4$PROFILER2;
109
+
110
+ var componentId = _ref4.componentId;
111
+ var component = (_this$store$PROFILER_2 = (_this$store4 = this.store) === null || _this$store4 === void 0 ? void 0 : (_this$store4$PROFILER = _this$store4[PROFILER_KEY]) === null || _this$store4$PROFILER === void 0 ? void 0 : (_this$store4$PROFILER2 = _this$store4$PROFILER.components) === null || _this$store4$PROFILER2 === void 0 ? void 0 : _this$store4$PROFILER2[componentId]) !== null && _this$store$PROFILER_2 !== void 0 ? _this$store$PROFILER_2 : {};
112
+ var total = 0;
113
+
114
+ for (var _instanceId2 in component) {
115
+ total += component[_instanceId2].count;
116
+ }
117
+
118
+ return total;
119
+ }
120
+ }], [{
121
+ key: "getInstance",
122
+ value: function getInstance(params) {
123
+ if (!RenderCountProfiler.instance) {
124
+ RenderCountProfiler.instance = new RenderCountProfiler({
125
+ store: params.store
126
+ });
127
+ }
128
+
129
+ return RenderCountProfiler.instance;
130
+ }
131
+ }]);
132
+ return RenderCountProfiler;
133
+ }();
134
+
135
+ exports.RenderCountProfiler = RenderCountProfiler;
@@ -387,21 +387,44 @@ var getValidNode = function getValidNode(originalNode) {
387
387
  break;
388
388
  }
389
389
 
390
- case 'media':
390
+ case 'mediaInline':
391
391
  {
392
392
  var mediaId = '';
393
- var mediaType = '';
394
393
  var mediaCollection = [];
395
- var mediaUrl = '';
396
394
 
397
395
  if (attrs) {
398
396
  var id = attrs.id,
399
- collection = attrs.collection,
397
+ collection = attrs.collection;
398
+ mediaId = id;
399
+ mediaCollection = collection;
400
+ }
401
+
402
+ if (mediaId && mediaCollection && adfStage === 'stage0') {
403
+ return {
404
+ type: type,
405
+ attrs: attrs,
406
+ marks: marks
407
+ };
408
+ }
409
+
410
+ break;
411
+ }
412
+
413
+ case 'media':
414
+ {
415
+ var _mediaId = '';
416
+ var mediaType = '';
417
+ var _mediaCollection = [];
418
+ var mediaUrl = '';
419
+
420
+ if (attrs) {
421
+ var _id = attrs.id,
422
+ _collection = attrs.collection,
400
423
  _type = attrs.type,
401
424
  url = attrs.url;
402
- mediaId = id;
425
+ _mediaId = _id;
403
426
  mediaType = _type;
404
- mediaCollection = collection;
427
+ _mediaCollection = _collection;
405
428
  mediaUrl = url;
406
429
  }
407
430
 
@@ -421,11 +444,11 @@ var getValidNode = function getValidNode(originalNode) {
421
444
  type: type,
422
445
  attrs: mediaAttrs
423
446
  };
424
- } else if (mediaId && mediaType) {
447
+ } else if (_mediaId && mediaType) {
425
448
  var _mediaAttrs = {
426
449
  type: mediaType,
427
- id: mediaId,
428
- collection: mediaCollection
450
+ id: _mediaId,
451
+ collection: _mediaCollection
429
452
  };
430
453
 
431
454
  if (attrs.width) {
@@ -494,10 +517,10 @@ var getValidNode = function getValidNode(originalNode) {
494
517
  if (attrs) {
495
518
  var _text = attrs.text,
496
519
  displayName = attrs.displayName,
497
- _id = attrs.id,
520
+ _id2 = attrs.id,
498
521
  accessLevel = attrs.accessLevel;
499
522
  mentionText = _text || displayName;
500
- mentionId = _id;
523
+ mentionId = _id2;
501
524
  mentionAccess = accessLevel;
502
525
  }
503
526
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "59.1.0",
3
+ "version": "60.3.0",
4
4
  "sideEffects": false
5
5
  }
@@ -6,6 +6,7 @@
6
6
  */
7
7
  // Czech
8
8
  export default {
9
+ 'fabric.editor.codeBidiWarningLabel': 'Obousměrné znaky mění pořadí vykreslování textu. Může to být použito k zakrytí škodlivého kódu.',
9
10
  'fabric.editor.captionPlaceholder': 'Přidejte popisek',
10
11
  'fabric.editor.collapseNode': 'Sbalit obsah',
11
12
  'fabric.editor.expandDefaultTitle': 'Klikněte sem pro rozbalení...',
@@ -6,6 +6,7 @@
6
6
  */
7
7
  // Danish
8
8
  export default {
9
+ 'fabric.editor.codeBidiWarningLabel': 'Tegn med tovejsfunktionalitet ændrer rækkefølgen, som teksten er gengivet i. Dette kan udnyttes til at skjule skadelig kode.',
9
10
  'fabric.editor.captionPlaceholder': 'Tilføj en billedtekst',
10
11
  'fabric.editor.collapseNode': 'skjul indhold',
11
12
  'fabric.editor.expandDefaultTitle': 'Klik her for at udvide...',
@@ -6,6 +6,7 @@
6
6
  */
7
7
  // German
8
8
  export default {
9
+ 'fabric.editor.codeBidiWarningLabel': 'Bidirektionale Zeichen ändern die Reihenfolge, in der Text gerendert wird. Dies könnte verwendet werden, um bösartigen Code zu verbergen.',
9
10
  'fabric.editor.captionPlaceholder': 'Eine Bildunterschrift hinzufügen',
10
11
  'fabric.editor.collapseNode': 'Inhaltsanzeige reduzieren',
11
12
  'fabric.editor.expandDefaultTitle': 'Klicken Sie hier, um zu erweitern …',
@@ -6,6 +6,7 @@
6
6
  */
7
7
  // Spanish
8
8
  export default {
9
+ 'fabric.editor.codeBidiWarningLabel': 'Los caracteres bidireccionales cambian el orden de renderización del texto. Esto podría utilizarse para ocultar código malicioso.',
9
10
  'fabric.editor.captionPlaceholder': 'Añadir un subtítulo',
10
11
  'fabric.editor.collapseNode': 'contraer contenido',
11
12
  'fabric.editor.expandDefaultTitle': 'Haz clic aquí para ampliar...',
@@ -6,6 +6,7 @@
6
6
  */
7
7
  // Finnish
8
8
  export default {
9
+ 'fabric.editor.codeBidiWarningLabel': 'Kaksisuuntaiset merkit muuttavat tekstin renderöintijärjestystä. Tätä voidaan hyödyntää haitallisen koodin peittämisessä.',
9
10
  'fabric.editor.captionPlaceholder': 'Lisää kuvateksti',
10
11
  'fabric.editor.collapseNode': 'piilota sisältö',
11
12
  'fabric.editor.expandDefaultTitle': 'Klikkaa tähän laajentaaksesi...',
@@ -6,6 +6,7 @@
6
6
  */
7
7
  // French
8
8
  export default {
9
+ 'fabric.editor.codeBidiWarningLabel': "Les caractères bidirectionnels changent l'ordre de rendu du texte. Ils peuvent être utilisés pour masquer du code malveillant.",
9
10
  'fabric.editor.captionPlaceholder': 'Ajouter une légende',
10
11
  'fabric.editor.collapseNode': 'Réduire le contenu',
11
12
  'fabric.editor.expandDefaultTitle': 'Cliquez ici pour développer...',
@@ -6,6 +6,7 @@
6
6
  */
7
7
  // Hungarian
8
8
  export default {
9
+ 'fabric.editor.codeBidiWarningLabel': 'A kétirányú karakterek megváltoztatják a szöveg renderelési sorrendjét. Ez felhasználható rosszindulatú kód elfedésére.',
9
10
  'fabric.editor.captionPlaceholder': 'Képaláírás hozzáadása',
10
11
  'fabric.editor.collapseNode': 'tartalom összecsukása',
11
12
  'fabric.editor.expandDefaultTitle': 'Kattints ide a kibontáshoz…',
@@ -6,6 +6,7 @@
6
6
  */
7
7
  // Italian
8
8
  export default {
9
+ 'fabric.editor.codeBidiWarningLabel': "I caratteri bidirezionali modificano l'ordine in cui è visualizzato il testo. Possono essere utilizzati per nascondere un codice dannoso.",
9
10
  'fabric.editor.captionPlaceholder': 'Aggiungi didascalia',
10
11
  'fabric.editor.collapseNode': 'Comprimi contenuto',
11
12
  'fabric.editor.expandDefaultTitle': 'Clicca qui per espandere...',
@@ -6,6 +6,7 @@
6
6
  */
7
7
  // Japanese
8
8
  export default {
9
+ 'fabric.editor.codeBidiWarningLabel': '双方向文字はテキストのレンダリング順序を変更します。このため、悪意あるコードを隠すために使用される場合があります。',
9
10
  'fabric.editor.captionPlaceholder': 'キャプションを追加',
10
11
  'fabric.editor.collapseNode': 'コンテンツを折りたたむ',
11
12
  'fabric.editor.expandDefaultTitle': 'こちらをクリックして展開…',
@@ -6,6 +6,7 @@
6
6
  */
7
7
  // Korean
8
8
  export default {
9
+ 'fabric.editor.codeBidiWarningLabel': '양방향 문자가 텍스트가 렌더링되는 순서를 변경합니다. 악성 코드를 가리는 데 사용할 수 있습니다.',
9
10
  'fabric.editor.captionPlaceholder': '캡션 추가',
10
11
  'fabric.editor.collapseNode': '콘텐츠 접기',
11
12
  'fabric.editor.expandDefaultTitle': '여기를 클릭하여 펼치기...',
@@ -6,6 +6,7 @@
6
6
  */
7
7
  // Norwegian Bokmål
8
8
  export default {
9
+ 'fabric.editor.codeBidiWarningLabel': 'Toveistegn endrer rekkefølgen som tekst vises i. Dette kan brukes til å skjule skadelig kode.',
9
10
  'fabric.editor.captionPlaceholder': 'Legg til bildetekst',
10
11
  'fabric.editor.collapseNode': 'Minimer innhold',
11
12
  'fabric.editor.expandDefaultTitle': 'Klikk her for å utvide …',
@@ -6,6 +6,7 @@
6
6
  */
7
7
  // Dutch
8
8
  export default {
9
+ 'fabric.editor.codeBidiWarningLabel': 'Bidirectionele tekens wijzigen de volgorde waarin de tekst wordt weergegeven. Dit kan worden gebruikt om schadelijke code te verdoezelen.',
9
10
  'fabric.editor.captionPlaceholder': 'Bijschrift toevoegen',
10
11
  'fabric.editor.collapseNode': 'Content inklappen',
11
12
  'fabric.editor.expandDefaultTitle': 'Klik hier om uit te breiden...',
@@ -6,6 +6,7 @@
6
6
  */
7
7
  // Polish
8
8
  export default {
9
+ 'fabric.editor.codeBidiWarningLabel': 'Znaki dwukierunkowe zmieniają kolejność, w jakiej tekst jest renderowany. Może to zostać wykorzystane do ukrycia złośliwego kodu.',
9
10
  'fabric.editor.captionPlaceholder': 'Dodaj podpis',
10
11
  'fabric.editor.collapseNode': 'Zwiń zawartość',
11
12
  'fabric.editor.expandDefaultTitle': 'Kliknij tutaj, aby rozwinąć...',
@@ -6,6 +6,7 @@
6
6
  */
7
7
  // Portuguese (Brazil)
8
8
  export default {
9
+ 'fabric.editor.codeBidiWarningLabel': 'Caracteres bidirecionais alteram a ordem em que o texto é renderizado. Eles podem ser usados para ocultar códigos mal-intencionados.',
9
10
  'fabric.editor.captionPlaceholder': 'Adicionar legenda',
10
11
  'fabric.editor.collapseNode': 'Recolher conteúdo',
11
12
  'fabric.editor.expandDefaultTitle': 'Clique aqui para expandir...',
@@ -6,6 +6,7 @@
6
6
  */
7
7
  // Russian
8
8
  export default {
9
+ 'fabric.editor.codeBidiWarningLabel': 'Двунаправленные символы изменяют порядок отображения текста. Они могут использоваться для маскировки вредоносного кода.',
9
10
  'fabric.editor.captionPlaceholder': 'Добавьте подпись',
10
11
  'fabric.editor.collapseNode': 'Свернуть содержимое',
11
12
  'fabric.editor.expandDefaultTitle': 'Нажмите здесь, чтобы развернуть…',
@@ -6,6 +6,7 @@
6
6
  */
7
7
  // Swedish
8
8
  export default {
9
+ 'fabric.editor.codeBidiWarningLabel': 'Dubbelriktade tecken ändrar återgivningsordningen för text. Detta kan användas för att dölja skadlig kod.',
9
10
  'fabric.editor.captionPlaceholder': 'Lägg till en bildtext',
10
11
  'fabric.editor.collapseNode': 'komprimera innehåll',
11
12
  'fabric.editor.expandDefaultTitle': 'Klicka här för att expandera ...',
@@ -6,6 +6,7 @@
6
6
  */
7
7
  // Thai
8
8
  export default {
9
+ 'fabric.editor.codeBidiWarningLabel': 'ตัวอักษรแบบสองทิศทางเปลี่ยนลำดับการแสดงข้อความ ซึ่งอาจนำไปใช้เพื่อปิดบังรหัสที่มีวัตถุประสงค์ในทางที่ไม่ดีได้',
9
10
  'fabric.editor.captionPlaceholder': 'เพิ่มคำอธิบาย',
10
11
  'fabric.editor.collapseNode': 'ย่อเนื้อหา',
11
12
  'fabric.editor.expandDefaultTitle': 'คลิกที่นี่เพื่อขยาย...',
@@ -6,6 +6,7 @@
6
6
  */
7
7
  // Turkish
8
8
  export default {
9
+ 'fabric.editor.codeBidiWarningLabel': 'Çift yönlü karakterler metnin oluşturulduğu sırayı değiştirir. Bu, kötü amaçlı kodu gizlemek için kullanılabilir.',
9
10
  'fabric.editor.captionPlaceholder': 'Açıklama yazısı ekleyin',
10
11
  'fabric.editor.collapseNode': 'içeriği daraltın',
11
12
  'fabric.editor.expandDefaultTitle': 'Genişletmek için buraya tıklayın...',
@@ -6,6 +6,7 @@
6
6
  */
7
7
  // Ukrainian
8
8
  export default {
9
+ 'fabric.editor.codeBidiWarningLabel': 'Двонаправлені символи змінюють порядок відображення тексту. Такий спосіб може використовуватися, щоб приховати зловмисний код.',
9
10
  'fabric.editor.captionPlaceholder': 'Додати підпис',
10
11
  'fabric.editor.collapseNode': 'Згорніть вміст',
11
12
  'fabric.editor.expandDefaultTitle': 'Натисніть, щоб розгорнути…',
@@ -6,6 +6,7 @@
6
6
  */
7
7
  // Vietnamese
8
8
  export default {
9
+ 'fabric.editor.codeBidiWarningLabel': 'Ký tự hai chiều thay đổi thứ tự kết xuất văn bản. Điều này có thể được dùng để che giấu mã độc hại.',
9
10
  'fabric.editor.captionPlaceholder': 'Thêm chú thích',
10
11
  'fabric.editor.collapseNode': 'thu gọn nội dung',
11
12
  'fabric.editor.expandDefaultTitle': 'Nhấp vào đây để mở rộng...',
@@ -4,8 +4,8 @@
4
4
  * This file is automatically generated by i18n-tools.
5
5
  * DO NOT CHANGE IT BY HAND or your changes will be lost.
6
6
  */
7
- // Chinese
8
7
  export default {
8
+ 'fabric.editor.codeBidiWarningLabel': '双向字符会更改文本的呈现顺序。这可能被用于掩盖恶意代码。',
9
9
  'fabric.editor.captionPlaceholder': '添加标题',
10
10
  'fabric.editor.collapseNode': '收起内容',
11
11
  'fabric.editor.expandDefaultTitle': '点击此处展开...',
@@ -6,6 +6,7 @@
6
6
  */
7
7
  // undefined
8
8
  export default {
9
+ 'fabric.editor.codeBidiWarningLabel': '雙向字元會變更文字呈現的順序。這可用來將惡意程式碼模糊化。',
9
10
  'fabric.editor.captionPlaceholder': '新增標題',
10
11
  'fabric.editor.collapseNode': '摺疊內容',
11
12
  'fabric.editor.expandDefaultTitle': '按一下此處以展開...',
@@ -1,4 +1,4 @@
1
- export { ADFTraversor, ErrorReporter, ZERO_WIDTH_SPACE, absoluteBreakoutWidth, browser, calcBreakoutWidth, breakoutConsts, calcTableColumnWidths, calcWideWidth, clearMeasure, compose, convertProsemirrorTableNodeToArrayOfRows, createCompareNodes, findAndTrackUnsupportedContentNodes, getAnalyticsAppearance, analyticsEventKey, getAnalyticsEventSeverity, getUnsupportedContentLevelData, UNSUPPORTED_CONTENT_LEVEL_SEVERITY_THRESHOLD_DEFAULTS, getExtensionLozengeData, getExtensionRenderer, getMarksByOrder, getModeFromTheme, getResponseEndTime, getValidContent, getValidDocument, getValidMark, getValidNode, getValidUnknownNode, hasMergedCell, isPastDate, isPerformanceAPIAvailable, isPerformanceObserverAvailable, isSameMark, isSubSupType, markOrder, measureRender, startMeasure, stopMeasure, measureTTI, getTTISeverity, TTI_SEVERITY_THRESHOLD_DEFAULTS, TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS, timestampToIsoFormat, timestampToString, timestampToTaskContext, timestampToUTCDate, todayTimestampInUTC, withImageLoader, canApplyAnnotationOnRange, getAnnotationIdsFromRange, SEVERITY, UNSUPPORTED_CONTENT_LEVEL_SEVERITY, shouldForceTracking, sniffUserBrowserExtensions } from './utils';
1
+ export { ADFTraversor, ErrorReporter, ZERO_WIDTH_SPACE, absoluteBreakoutWidth, browser, calcBreakoutWidth, breakoutConsts, calcTableColumnWidths, calcWideWidth, clearMeasure, compose, convertProsemirrorTableNodeToArrayOfRows, createCompareNodes, findAndTrackUnsupportedContentNodes, getAnalyticsAppearance, analyticsEventKey, getAnalyticsEventSeverity, getUnsupportedContentLevelData, UNSUPPORTED_CONTENT_LEVEL_SEVERITY_THRESHOLD_DEFAULTS, getExtensionLozengeData, getExtensionRenderer, getMarksByOrder, getModeFromTheme, getResponseEndTime, getValidContent, getValidDocument, getValidMark, getValidNode, getValidUnknownNode, hasMergedCell, isPastDate, isPerformanceAPIAvailable, isPerformanceObserverAvailable, isSameMark, isSubSupType, markOrder, measureRender, startMeasure, stopMeasure, measureTTI, getTTISeverity, TTI_SEVERITY_THRESHOLD_DEFAULTS, TTI_FROM_INVOCATION_SEVERITY_THRESHOLD_DEFAULTS, timestampToIsoFormat, timestampToString, timestampToTaskContext, timestampToUTCDate, todayTimestampInUTC, withImageLoader, canApplyAnnotationOnRange, getAnnotationIdsFromRange, SEVERITY, UNSUPPORTED_CONTENT_LEVEL_SEVERITY, shouldForceTracking, sniffUserBrowserExtensions, RenderCountProfiler } from './utils';
2
2
  export { SortOrder, AnnotationUpdateEmitter, AnnotationUpdateEvent } from './types';
3
3
  export { DefaultExtensionProvider, combineExtensionProviders, getExtensionKeyAndNodeKey, getExtensionModuleNode, getExtensionModuleNodePrivateProps, getQuickInsertItemsFromModule, getNodeRenderer, getContextualToolbarItemsFromModule, buildMenuItem, resolveImport } from './extensions';
4
4
  export { ProviderFactory, WithProviders } from './provider-factory';
@@ -0,0 +1,12 @@
1
+ import { defineMessages } from 'react-intl';
2
+ export const codeBidiWarningMessages = defineMessages({
3
+ /**
4
+ * Message taken from
5
+ * https://hello.atlassian.net/wiki/spaces/~tswan/pages/1366555782/PSHELP-2943+Investigate+Trojan+Source+Attack+Vulnerability+design
6
+ */
7
+ label: {
8
+ id: 'fabric.editor.codeBidiWarningLabel',
9
+ defaultMessage: 'Bidirectional characters change the order that text is rendered. This could be used to obscure malicious code.',
10
+ description: 'Tooltip message to present to users when a bidirectional character is encountered in code.'
11
+ }
12
+ });
@@ -1,2 +1,3 @@
1
+ export { codeBidiWarningMessages } from './codeBidiWarning';
1
2
  export { linkMessages } from './link';
2
3
  export { unsupportedContentMessages } from './unsupportedContent';
@@ -1,6 +1,8 @@
1
1
  import { css } from 'styled-components';
2
2
  import { hexToRgba, PanelType } from '@atlaskit/adf-schema';
3
3
  import { akEditorTableCellMinWidth, blockNodesVerticalMargin } from '@atlaskit/editor-shared-styles';
4
+ import { akEditorCustomIconSize } from '@atlaskit/editor-shared-styles/consts';
5
+ import { emojiImage, emojiSprite } from '@atlaskit/emoji';
4
6
  import * as colors from '@atlaskit/theme/colors';
5
7
  import { themed } from '@atlaskit/theme/components';
6
8
  import { borderRadius, gridSize } from '@atlaskit/theme/constants';
@@ -53,6 +55,7 @@ const darkTextColor = {
53
55
  warning: colors.Y75,
54
56
  error: colors.R75
55
57
  };
58
+ const verticalAlignment = -((gridSize() * 3 - akEditorCustomIconSize) / 2);
56
59
  const prefix = 'ak-editor-panel';
57
60
  export const PanelSharedCssClassName = {
58
61
  prefix,
@@ -67,7 +70,12 @@ export const PanelSharedSelectors = {
67
70
  successPanel: `.${prefix}[data-panel-type=${PanelType.SUCCESS}]`,
68
71
  noteButton: `button[aria-label="Note"]`,
69
72
  removeButton: `button[aria-label="Remove"]`,
70
- emojiIcon: `span[aria-label="emoji"]`
73
+ colorPalette: `[aria-label="Background color"]`,
74
+ selectedColor: `[aria-label="The smell"]`,
75
+ removeEmojiIcon: `[aria-label="Remove emoji"]`,
76
+ emojiIcon: `[aria-label="editor-add-emoji"]`,
77
+ selectedEmoji: `[aria-label=":grinning:"]`,
78
+ title: `#editor-title`
71
79
  };
72
80
 
73
81
  const iconDynamicStyles = panelType => props => {
@@ -118,24 +126,33 @@ export const panelSharedStyles = css`
118
126
  padding: ${gridSize()}px;
119
127
  min-width: ${akEditorTableCellMinWidth}px;
120
128
  display: flex;
129
+ position: relative;
121
130
  align-items: baseline;
122
131
  word-break: break-word;
123
132
 
124
133
  ${mainDynamicStyles(PanelType.INFO)}
125
134
 
126
135
  .${PanelSharedCssClassName.icon} {
127
- display: block;
128
136
  flex-shrink: 0;
129
137
  height: ${gridSize() * 3}px;
130
138
  width: ${gridSize() * 3}px;
131
139
  box-sizing: content-box;
132
140
  padding-right: ${gridSize()}px;
141
+ text-align: center;
142
+ user-select: none;
143
+ -moz-user-select: none;
144
+ -webkit-user-select: none;
145
+ -ms-user-select: none;
133
146
  ${iconDynamicStyles(PanelType.INFO)}
134
147
 
135
148
  > span {
136
149
  vertical-align: middle;
137
150
  display: inline;
138
151
  }
152
+
153
+ .${emojiSprite}, .${emojiImage} {
154
+ vertical-align: ${verticalAlignment}px;
155
+ }
139
156
  }
140
157
 
141
158
  .ak-editor-panel__content {
@@ -88,7 +88,7 @@ const tableSharedStyle = css`
88
88
  border-bottom-width: 0;
89
89
  padding: ${tableCellPadding}px;
90
90
  /* https://stackoverflow.com/questions/7517127/borders-not-shown-in-firefox-with-border-collapse-on-table-position-relative-o */
91
- ${browser.gecko || browser.ie ? 'background-clip: padding-box;' : ''}
91
+ ${browser.gecko || browser.ie || browser.mac && browser.chrome ? 'background-clip: padding-box;' : ''}
92
92
 
93
93
  ${themed({
94
94
  dark: getTableCellBackgroundDarkModeColors
@@ -0,0 +1,17 @@
1
+ export let TypeAheadAvailableNodes;
2
+
3
+ (function (TypeAheadAvailableNodes) {
4
+ TypeAheadAvailableNodes["EMOJI"] = "emojiTypeAhead";
5
+ TypeAheadAvailableNodes["MENTION"] = "mentionTypeAhead";
6
+ TypeAheadAvailableNodes["QUICK_INSERT"] = "quickInsertTypeAhead";
7
+ })(TypeAheadAvailableNodes || (TypeAheadAvailableNodes = {}));
8
+
9
+ export let SelectItemMode;
10
+
11
+ (function (SelectItemMode) {
12
+ SelectItemMode["SHIFT_ENTER"] = "shift-enter";
13
+ SelectItemMode["ENTER"] = "enter";
14
+ SelectItemMode["SPACE"] = "space";
15
+ SelectItemMode["SELECTED"] = "selected";
16
+ SelectItemMode["TAB"] = "tab";
17
+ })(SelectItemMode || (SelectItemMode = {}));