@atlaskit/editor-core 185.5.2 → 185.5.7

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 (195) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/i18n/cs.js +0 -10
  3. package/dist/cjs/i18n/da.js +0 -10
  4. package/dist/cjs/i18n/de.js +0 -10
  5. package/dist/cjs/i18n/en.js +0 -10
  6. package/dist/cjs/i18n/en_GB.js +0 -10
  7. package/dist/cjs/i18n/en_ZZ.js +0 -10
  8. package/dist/cjs/i18n/es.js +0 -10
  9. package/dist/cjs/i18n/fi.js +0 -10
  10. package/dist/cjs/i18n/fr.js +0 -10
  11. package/dist/cjs/i18n/hu.js +0 -10
  12. package/dist/cjs/i18n/it.js +0 -10
  13. package/dist/cjs/i18n/ja.js +0 -10
  14. package/dist/cjs/i18n/ko.js +0 -10
  15. package/dist/cjs/i18n/nb.js +0 -10
  16. package/dist/cjs/i18n/nl.js +0 -10
  17. package/dist/cjs/i18n/pl.js +0 -10
  18. package/dist/cjs/i18n/pt_BR.js +0 -10
  19. package/dist/cjs/i18n/ru.js +0 -10
  20. package/dist/cjs/i18n/sv.js +0 -10
  21. package/dist/cjs/i18n/th.js +0 -10
  22. package/dist/cjs/i18n/tr.js +0 -10
  23. package/dist/cjs/i18n/uk.js +0 -10
  24. package/dist/cjs/i18n/vi.js +0 -10
  25. package/dist/cjs/i18n/zh.js +0 -10
  26. package/dist/cjs/i18n/zh_TW.js +0 -10
  27. package/dist/cjs/plugins/breakout/ui/LayoutButton.js +5 -28
  28. package/dist/cjs/plugins/card/index.js +20 -6
  29. package/dist/cjs/plugins/card/nodeviews/datasource.js +39 -4
  30. package/dist/cjs/plugins/card/pm-plugins/actions.js +31 -1
  31. package/dist/cjs/plugins/card/pm-plugins/main.js +48 -3
  32. package/dist/cjs/plugins/card/pm-plugins/reducers.js +22 -0
  33. package/dist/cjs/plugins/card/styles.js +1 -1
  34. package/dist/cjs/plugins/card/ui/LayoutButton/index.js +113 -0
  35. package/dist/cjs/plugins/card/ui/LayoutButton/styled.js +17 -0
  36. package/dist/cjs/plugins/card/ui/LayoutButton/types.js +5 -0
  37. package/dist/cjs/plugins/card/ui/LayoutButton/utils.js +19 -0
  38. package/dist/cjs/plugins/media/pm-plugins/main.js +20 -1
  39. package/dist/cjs/version-wrapper.js +1 -1
  40. package/dist/cjs/version.json +1 -1
  41. package/dist/es2019/i18n/cs.js +0 -10
  42. package/dist/es2019/i18n/da.js +0 -10
  43. package/dist/es2019/i18n/de.js +0 -10
  44. package/dist/es2019/i18n/en.js +0 -10
  45. package/dist/es2019/i18n/en_GB.js +0 -10
  46. package/dist/es2019/i18n/en_ZZ.js +0 -10
  47. package/dist/es2019/i18n/es.js +0 -10
  48. package/dist/es2019/i18n/fi.js +0 -10
  49. package/dist/es2019/i18n/fr.js +0 -10
  50. package/dist/es2019/i18n/hu.js +0 -10
  51. package/dist/es2019/i18n/it.js +0 -10
  52. package/dist/es2019/i18n/ja.js +0 -10
  53. package/dist/es2019/i18n/ko.js +0 -10
  54. package/dist/es2019/i18n/nb.js +0 -10
  55. package/dist/es2019/i18n/nl.js +0 -10
  56. package/dist/es2019/i18n/pl.js +0 -10
  57. package/dist/es2019/i18n/pt_BR.js +0 -10
  58. package/dist/es2019/i18n/ru.js +0 -10
  59. package/dist/es2019/i18n/sv.js +0 -10
  60. package/dist/es2019/i18n/th.js +0 -10
  61. package/dist/es2019/i18n/tr.js +0 -10
  62. package/dist/es2019/i18n/uk.js +0 -10
  63. package/dist/es2019/i18n/vi.js +0 -10
  64. package/dist/es2019/i18n/zh.js +0 -10
  65. package/dist/es2019/i18n/zh_TW.js +0 -10
  66. package/dist/es2019/plugins/breakout/ui/LayoutButton.js +3 -26
  67. package/dist/es2019/plugins/breakout/utils/get-breakout-mode.js +0 -1
  68. package/dist/es2019/plugins/card/index.js +20 -3
  69. package/dist/es2019/plugins/card/nodeviews/datasource.js +38 -1
  70. package/dist/es2019/plugins/card/pm-plugins/actions.js +16 -0
  71. package/dist/es2019/plugins/card/pm-plugins/main.js +55 -4
  72. package/dist/es2019/plugins/card/pm-plugins/reducers.js +25 -0
  73. package/dist/es2019/plugins/card/styles.js +6 -0
  74. package/dist/es2019/plugins/card/ui/LayoutButton/index.js +106 -0
  75. package/dist/es2019/plugins/card/ui/LayoutButton/styled.js +10 -0
  76. package/dist/es2019/plugins/card/ui/LayoutButton/types.js +1 -0
  77. package/dist/es2019/plugins/card/ui/LayoutButton/utils.js +15 -0
  78. package/dist/es2019/plugins/media/pm-plugins/main.js +25 -3
  79. package/dist/es2019/version-wrapper.js +1 -1
  80. package/dist/es2019/version.json +1 -1
  81. package/dist/esm/i18n/cs.js +0 -10
  82. package/dist/esm/i18n/da.js +0 -10
  83. package/dist/esm/i18n/de.js +0 -10
  84. package/dist/esm/i18n/en.js +0 -10
  85. package/dist/esm/i18n/en_GB.js +0 -10
  86. package/dist/esm/i18n/en_ZZ.js +0 -10
  87. package/dist/esm/i18n/es.js +0 -10
  88. package/dist/esm/i18n/fi.js +0 -10
  89. package/dist/esm/i18n/fr.js +0 -10
  90. package/dist/esm/i18n/hu.js +0 -10
  91. package/dist/esm/i18n/it.js +0 -10
  92. package/dist/esm/i18n/ja.js +0 -10
  93. package/dist/esm/i18n/ko.js +0 -10
  94. package/dist/esm/i18n/nb.js +0 -10
  95. package/dist/esm/i18n/nl.js +0 -10
  96. package/dist/esm/i18n/pl.js +0 -10
  97. package/dist/esm/i18n/pt_BR.js +0 -10
  98. package/dist/esm/i18n/ru.js +0 -10
  99. package/dist/esm/i18n/sv.js +0 -10
  100. package/dist/esm/i18n/th.js +0 -10
  101. package/dist/esm/i18n/tr.js +0 -10
  102. package/dist/esm/i18n/uk.js +0 -10
  103. package/dist/esm/i18n/vi.js +0 -10
  104. package/dist/esm/i18n/zh.js +0 -10
  105. package/dist/esm/i18n/zh_TW.js +0 -10
  106. package/dist/esm/plugins/breakout/ui/LayoutButton.js +3 -26
  107. package/dist/esm/plugins/breakout/utils/get-breakout-mode.js +0 -1
  108. package/dist/esm/plugins/card/index.js +20 -3
  109. package/dist/esm/plugins/card/nodeviews/datasource.js +37 -3
  110. package/dist/esm/plugins/card/pm-plugins/actions.js +27 -0
  111. package/dist/esm/plugins/card/pm-plugins/main.js +49 -4
  112. package/dist/esm/plugins/card/pm-plugins/reducers.js +22 -0
  113. package/dist/esm/plugins/card/styles.js +1 -1
  114. package/dist/esm/plugins/card/ui/LayoutButton/index.js +102 -0
  115. package/dist/esm/plugins/card/ui/LayoutButton/styled.js +10 -0
  116. package/dist/esm/plugins/card/ui/LayoutButton/types.js +1 -0
  117. package/dist/esm/plugins/card/ui/LayoutButton/utils.js +12 -0
  118. package/dist/esm/plugins/media/pm-plugins/main.js +22 -3
  119. package/dist/esm/version-wrapper.js +1 -1
  120. package/dist/esm/version.json +1 -1
  121. package/dist/types/i18n/cs.d.ts +0 -10
  122. package/dist/types/i18n/da.d.ts +0 -10
  123. package/dist/types/i18n/de.d.ts +0 -10
  124. package/dist/types/i18n/en.d.ts +0 -10
  125. package/dist/types/i18n/en_GB.d.ts +0 -10
  126. package/dist/types/i18n/en_ZZ.d.ts +0 -10
  127. package/dist/types/i18n/es.d.ts +0 -10
  128. package/dist/types/i18n/fi.d.ts +0 -10
  129. package/dist/types/i18n/fr.d.ts +0 -10
  130. package/dist/types/i18n/hu.d.ts +0 -10
  131. package/dist/types/i18n/it.d.ts +0 -10
  132. package/dist/types/i18n/ja.d.ts +0 -10
  133. package/dist/types/i18n/ko.d.ts +0 -10
  134. package/dist/types/i18n/nb.d.ts +0 -10
  135. package/dist/types/i18n/nl.d.ts +0 -10
  136. package/dist/types/i18n/pl.d.ts +0 -10
  137. package/dist/types/i18n/pt_BR.d.ts +0 -10
  138. package/dist/types/i18n/ru.d.ts +0 -10
  139. package/dist/types/i18n/sv.d.ts +0 -10
  140. package/dist/types/i18n/th.d.ts +0 -10
  141. package/dist/types/i18n/tr.d.ts +0 -10
  142. package/dist/types/i18n/uk.d.ts +0 -10
  143. package/dist/types/i18n/vi.d.ts +0 -10
  144. package/dist/types/i18n/zh.d.ts +0 -10
  145. package/dist/types/i18n/zh_TW.d.ts +0 -10
  146. package/dist/types/plugins/breakout/commands/set-breakout-mode.d.ts +1 -1
  147. package/dist/types/plugins/breakout/utils/get-breakout-mode.d.ts +1 -1
  148. package/dist/types/plugins/card/index.d.ts +3 -1
  149. package/dist/types/plugins/card/nodeviews/datasource.d.ts +18 -2
  150. package/dist/types/plugins/card/pm-plugins/actions.d.ts +7 -0
  151. package/dist/types/plugins/card/pm-plugins/plugin-key.d.ts +2 -1
  152. package/dist/types/plugins/card/pm-plugins/util/state.d.ts +2 -0
  153. package/dist/types/plugins/card/types.d.ts +17 -1
  154. package/dist/types/plugins/card/ui/LayoutButton/index.d.ts +9 -0
  155. package/dist/types/plugins/card/ui/LayoutButton/styled.d.ts +1 -0
  156. package/dist/types/plugins/card/ui/LayoutButton/types.d.ts +19 -0
  157. package/dist/types/plugins/card/ui/LayoutButton/utils.d.ts +5 -0
  158. package/dist/types-ts4.5/i18n/cs.d.ts +0 -10
  159. package/dist/types-ts4.5/i18n/da.d.ts +0 -10
  160. package/dist/types-ts4.5/i18n/de.d.ts +0 -10
  161. package/dist/types-ts4.5/i18n/en.d.ts +0 -10
  162. package/dist/types-ts4.5/i18n/en_GB.d.ts +0 -10
  163. package/dist/types-ts4.5/i18n/en_ZZ.d.ts +0 -10
  164. package/dist/types-ts4.5/i18n/es.d.ts +0 -10
  165. package/dist/types-ts4.5/i18n/fi.d.ts +0 -10
  166. package/dist/types-ts4.5/i18n/fr.d.ts +0 -10
  167. package/dist/types-ts4.5/i18n/hu.d.ts +0 -10
  168. package/dist/types-ts4.5/i18n/it.d.ts +0 -10
  169. package/dist/types-ts4.5/i18n/ja.d.ts +0 -10
  170. package/dist/types-ts4.5/i18n/ko.d.ts +0 -10
  171. package/dist/types-ts4.5/i18n/nb.d.ts +0 -10
  172. package/dist/types-ts4.5/i18n/nl.d.ts +0 -10
  173. package/dist/types-ts4.5/i18n/pl.d.ts +0 -10
  174. package/dist/types-ts4.5/i18n/pt_BR.d.ts +0 -10
  175. package/dist/types-ts4.5/i18n/ru.d.ts +0 -10
  176. package/dist/types-ts4.5/i18n/sv.d.ts +0 -10
  177. package/dist/types-ts4.5/i18n/th.d.ts +0 -10
  178. package/dist/types-ts4.5/i18n/tr.d.ts +0 -10
  179. package/dist/types-ts4.5/i18n/uk.d.ts +0 -10
  180. package/dist/types-ts4.5/i18n/vi.d.ts +0 -10
  181. package/dist/types-ts4.5/i18n/zh.d.ts +0 -10
  182. package/dist/types-ts4.5/i18n/zh_TW.d.ts +0 -10
  183. package/dist/types-ts4.5/plugins/breakout/commands/set-breakout-mode.d.ts +1 -1
  184. package/dist/types-ts4.5/plugins/breakout/utils/get-breakout-mode.d.ts +1 -1
  185. package/dist/types-ts4.5/plugins/card/index.d.ts +3 -1
  186. package/dist/types-ts4.5/plugins/card/nodeviews/datasource.d.ts +18 -2
  187. package/dist/types-ts4.5/plugins/card/pm-plugins/actions.d.ts +7 -0
  188. package/dist/types-ts4.5/plugins/card/pm-plugins/plugin-key.d.ts +2 -1
  189. package/dist/types-ts4.5/plugins/card/pm-plugins/util/state.d.ts +2 -0
  190. package/dist/types-ts4.5/plugins/card/types.d.ts +17 -1
  191. package/dist/types-ts4.5/plugins/card/ui/LayoutButton/index.d.ts +9 -0
  192. package/dist/types-ts4.5/plugins/card/ui/LayoutButton/styled.d.ts +1 -0
  193. package/dist/types-ts4.5/plugins/card/ui/LayoutButton/types.d.ts +19 -0
  194. package/dist/types-ts4.5/plugins/card/ui/LayoutButton/utils.d.ts +5 -0
  195. package/package.json +4 -4
@@ -73,7 +73,6 @@ export default {
73
73
  'fabric.editor.edit': 'Düzenle',
74
74
  'fabric.editor.editAltText': 'Alternatif metni düzenle',
75
75
  'fabric.editor.editDateText': 'Tarihi Düzenle',
76
- 'fabric.editor.editLink': 'Bağlantıyı düzenleyin',
77
76
  'fabric.editor.editStatusColor': 'Durum Rengini Düzenle',
78
77
  'fabric.editor.editStatusText': 'Durumu Düzenle',
79
78
  'fabric.editor.editableContentLabel': 'Düzenlenebilir içerik',
@@ -97,7 +96,6 @@ export default {
97
96
  'fabric.editor.elementbrowser.search.empty-state.sub-heading.link': "Atlassian Marketplace'i keşfedin",
98
97
  'fabric.editor.elementbrowser.sidebar.heading': 'Göz Atın',
99
98
  'fabric.editor.embedTitle': 'Ekle',
100
- 'fabric.editor.emptyLink': 'Lütfen bir bağlantı girin.',
101
99
  'fabric.editor.epic': 'Epik',
102
100
  'fabric.editor.error': 'Hata',
103
101
  'fabric.editor.errorPanel': 'Hata panosu',
@@ -141,7 +139,6 @@ export default {
141
139
  'fabric.editor.hyperlink.linkAriaLabel': 'Bağlantı etiketi',
142
140
  'fabric.editor.hyperlink.searchLinkAriaDescription': 'Alana yazmaya başladığınızda öneriler aşağıda görünecek',
143
141
  'fabric.editor.hyperlink.searchLinkResults': '{count, plural, =0 {sonuç bulunamadı} one {{count,number} sonuç bulundu} other {{count,number} sonuç bulundu}}',
144
- 'fabric.editor.hyperlinkToolbarPlaceholder': 'Bağlantıyı yapıştırın veya arayın',
145
142
  'fabric.editor.imageBorderBold': 'Kalın',
146
143
  'fabric.editor.imageBorderColor': 'Renk',
147
144
  'fabric.editor.imageBorderMedium': 'Orta',
@@ -157,17 +154,13 @@ export default {
157
154
  'fabric.editor.inlineTitle': 'Satır içi',
158
155
  'fabric.editor.inputQueryAssistiveTxt': 'Otomatik tamamlama sonuçları kullanılabilir olduğunda incelemek için yukarı ve aşağı ok tuşlarına, seçmek için Enter tuşuna basın. Dokunmatik cihaz kullanıcısıysanız dokunun veya kaydırma hareketlerini kullanın.',
159
156
  'fabric.editor.invalidDateError': 'Geçerli bir tarih girin',
160
- 'fabric.editor.invalidLink': 'Lütfen geçerli bir bağlantı girin.',
161
157
  'fabric.editor.inviteItem.title': '{userRole, select, admin {Takım arkadaşınızı {productName} ürününe davet edin} trusted {Takım arkadaşınızı {productName} ürününe davet edin} other {Takım arkadaşınızı {productName} ürününe ekleyin}}',
162
158
  'fabric.editor.italic': 'İtalik',
163
159
  'fabric.editor.keyboardShortcuts': 'Klavye kısayolları',
164
160
  'fabric.editor.leftSidebar': 'Sol kenar çubuğu',
165
- 'fabric.editor.linkAddress': 'Adres bağlantısını ekle',
166
- 'fabric.editor.linkPlaceholder': 'Bağlantıyı yapıştır',
167
161
  'fabric.editor.lists': 'Listeler',
168
162
  'fabric.editor.markdown': 'Markdown',
169
163
  'fabric.editor.matchCase': 'Büyük/küçük harf eşleştir',
170
- 'fabric.editor.mediaAddLink': 'Bağlantı ekle',
171
164
  'fabric.editor.mediaGroupDeleteLabel': 'Sil',
172
165
  'fabric.editor.mentionNode.label': 'Şu kullanıcı etiketlendi:',
173
166
  'fabric.editor.mentionsAddLabel': 'ekle-simgesi',
@@ -203,7 +196,6 @@ export default {
203
196
  'fabric.editor.rightSidebar': 'Sağ kenar çubuğu',
204
197
  'fabric.editor.searchResults': '{itemsLength, plural, one {{itemsLength,number} arama sonucu mevcut} other {{itemsLength,number} arama sonucu mevcut}}',
205
198
  'fabric.editor.selectLanguage': 'Dil seçin',
206
- 'fabric.editor.settingsLinks': 'Bağlantı Tercihlerine gidin',
207
199
  'fabric.editor.shortcut': 'Metin kısayolu',
208
200
  'fabric.editor.single': 'Tek sütun',
209
201
  'fabric.editor.statusPlaceholder': 'Durum ayarlayın',
@@ -237,10 +229,8 @@ export default {
237
229
  'fabric.editor.typeahead.mentionInputLabel': 'Etiketlemek üzere kullanıcı aramak için yazmaya başlayın',
238
230
  'fabric.editor.typeahead.mentionPopupLabel': 'Etiketleyebileceğiniz kullanıcılar',
239
231
  'fabric.editor.typeahead.metionListItemLabel': '{name} adlı kullanıcı @{shortName}',
240
- 'fabric.editor.unableToOpenLink': 'Bu bağlantı açılamıyor',
241
232
  'fabric.editor.underline': 'Altı çizili',
242
233
  'fabric.editor.undo': 'Geri al',
243
- 'fabric.editor.unlink': 'Bağlantıyı kaldır',
244
234
  'fabric.editor.unorderedList': 'Madde işaretli liste',
245
235
  'fabric.editor.unorderedList.description': 'Sırasız liste oluşturun',
246
236
  'fabric.editor.url': "URL'yi göster",
@@ -73,7 +73,6 @@ export default {
73
73
  'fabric.editor.edit': 'Редагувати',
74
74
  'fabric.editor.editAltText': 'Редагувати текст заміщення',
75
75
  'fabric.editor.editDateText': 'Змінення дати',
76
- 'fabric.editor.editLink': 'Редагування посилання',
77
76
  'fabric.editor.editStatusColor': 'Змінення кольору стану',
78
77
  'fabric.editor.editStatusText': 'Змінення стану',
79
78
  'fabric.editor.editableContentLabel': 'Вміст, що можна редагувати',
@@ -97,7 +96,6 @@ export default {
97
96
  'fabric.editor.elementbrowser.search.empty-state.sub-heading.link': 'Відкрийте для себе Atlassian Marketplace',
98
97
  'fabric.editor.elementbrowser.sidebar.heading': 'Перегляд',
99
98
  'fabric.editor.embedTitle': 'Вбудувати',
100
- 'fabric.editor.emptyLink': 'Введіть посилання.',
101
99
  'fabric.editor.epic': 'Епос',
102
100
  'fabric.editor.error': 'Помилка',
103
101
  'fabric.editor.errorPanel': 'Панель помилок',
@@ -141,7 +139,6 @@ export default {
141
139
  'fabric.editor.hyperlink.linkAriaLabel': 'Мітка посилання',
142
140
  'fabric.editor.hyperlink.searchLinkAriaDescription': 'Коли ви будете набирати у полі текст, нижче з’явиться список варіантів',
143
141
  'fabric.editor.hyperlink.searchLinkResults': '{count, plural, =0 {нічого не знайдено} one {{count,number} результат} few {{count,number} результати} many {{count,number} результатів} other {{count,number} результатів}}',
144
- 'fabric.editor.hyperlinkToolbarPlaceholder': 'Вставте або знайдіть посилання',
145
142
  'fabric.editor.imageBorderBold': 'Жирна',
146
143
  'fabric.editor.imageBorderColor': 'Колір',
147
144
  'fabric.editor.imageBorderMedium': 'Середня',
@@ -157,17 +154,13 @@ export default {
157
154
  'fabric.editor.inlineTitle': 'Вбудований',
158
155
  'fabric.editor.inputQueryAssistiveTxt': 'Коли результати автозаповнення стануть доступними, перейдіть до потрібного за допомогою стрілок вгору і вниз і натисніть клавішу Enter. Користувачі сенсорних пристроїв можуть переглядати варіанти за допомогою дотиків і проведення пальцем.',
159
156
  'fabric.editor.invalidDateError': 'Введіть дійсну дату',
160
- 'fabric.editor.invalidLink': 'Введіть дійсне посилання.',
161
157
  'fabric.editor.inviteItem.title': '{userRole, select, admin {Запрошення учасника команди до {productName}} trusted {Запрошення учасника команди до {productName}} other {Додавання учасника команди до {productName}}}',
162
158
  'fabric.editor.italic': 'Курсив',
163
159
  'fabric.editor.keyboardShortcuts': 'Гарячі клавіші',
164
160
  'fabric.editor.leftSidebar': 'Бічна панель ліворуч',
165
- 'fabric.editor.linkAddress': 'Адреса посилання',
166
- 'fabric.editor.linkPlaceholder': 'Вставити посилання',
167
161
  'fabric.editor.lists': 'Списки',
168
162
  'fabric.editor.markdown': 'Markdown',
169
163
  'fabric.editor.matchCase': 'Враховувати регістр',
170
- 'fabric.editor.mediaAddLink': 'Додати посилання',
171
164
  'fabric.editor.mediaGroupDeleteLabel': 'Видалити',
172
165
  'fabric.editor.mentionNode.label': 'Згаданий за допомогою тегу користувач',
173
166
  'fabric.editor.mentionsAddLabel': 'додати-значок',
@@ -203,7 +196,6 @@ export default {
203
196
  'fabric.editor.rightSidebar': 'Бічна панель праворуч',
204
197
  'fabric.editor.searchResults': '{itemsLength, plural, one {Доступний {itemsLength,number} результат пошуку} few {Доступно {itemsLength,number} результати пошуку} many {Доступно {itemsLength,number} результатів пошуку} other {Доступно {itemsLength,number} результату пошуку}}',
205
198
  'fabric.editor.selectLanguage': 'Вибір мови',
206
- 'fabric.editor.settingsLinks': 'Перейти до параметрів посилань',
207
199
  'fabric.editor.shortcut': 'Сполучення клавіш для тексту',
208
200
  'fabric.editor.single': 'Один стовпець',
209
201
  'fabric.editor.statusPlaceholder': 'Додати статус',
@@ -237,10 +229,8 @@ export default {
237
229
  'fabric.editor.typeahead.mentionInputLabel': 'Почніть вводити текст для пошуку користувачів і згадування їх за допомогою тегу',
238
230
  'fabric.editor.typeahead.mentionPopupLabel': 'Користувачі, яких можна згадати за допомогою тегу',
239
231
  'fabric.editor.typeahead.metionListItemLabel': 'Користувач {name} (@{shortName})',
240
- 'fabric.editor.unableToOpenLink': 'Не вдалося відкрити посилання',
241
232
  'fabric.editor.underline': 'Підкреслювання',
242
233
  'fabric.editor.undo': 'Скасувати',
243
- 'fabric.editor.unlink': 'Відв’язати',
244
234
  'fabric.editor.unorderedList': 'Маркований список',
245
235
  'fabric.editor.unorderedList.description': 'Створити невпорядкований список',
246
236
  'fabric.editor.url': 'Показати URL-адресу',
@@ -73,7 +73,6 @@ export default {
73
73
  'fabric.editor.edit': 'Chỉnh sửa',
74
74
  'fabric.editor.editAltText': 'Chỉnh sửa văn bản thay thế',
75
75
  'fabric.editor.editDateText': 'Sửa ngày',
76
- 'fabric.editor.editLink': 'Chỉnh sửa liên kết',
77
76
  'fabric.editor.editStatusColor': 'Sửa màu trạng thái',
78
77
  'fabric.editor.editStatusText': 'Sửa trạng thái',
79
78
  'fabric.editor.editableContentLabel': 'Nội dung có thể chỉnh sửa',
@@ -97,7 +96,6 @@ export default {
97
96
  'fabric.editor.elementbrowser.search.empty-state.sub-heading.link': 'Khám phá Atlassian Marketplace',
98
97
  'fabric.editor.elementbrowser.sidebar.heading': 'Duyệt',
99
98
  'fabric.editor.embedTitle': 'Đã nhúng',
100
- 'fabric.editor.emptyLink': 'Vui lòng nhập một liên kết.',
101
99
  'fabric.editor.epic': 'Quá trình',
102
100
  'fabric.editor.error': 'Lỗi',
103
101
  'fabric.editor.errorPanel': 'Ô lỗi',
@@ -141,7 +139,6 @@ export default {
141
139
  'fabric.editor.hyperlink.linkAriaLabel': 'Nhãn liên kết',
142
140
  'fabric.editor.hyperlink.searchLinkAriaDescription': 'Các đề xuất sẽ xuất hiện bên dưới khi bạn nhập thông tin vào trường',
143
141
  'fabric.editor.hyperlink.searchLinkResults': '{count, plural, =0 {không tìm thấy kết quả} other {Đã tìm thấy {count,number} kết quả}}',
144
- 'fabric.editor.hyperlinkToolbarPlaceholder': 'Dán hoặc tìm kiếm liên kết',
145
142
  'fabric.editor.imageBorderBold': 'In đậm',
146
143
  'fabric.editor.imageBorderColor': 'Màu sắc',
147
144
  'fabric.editor.imageBorderMedium': 'Trung bình',
@@ -157,17 +154,13 @@ export default {
157
154
  'fabric.editor.inlineTitle': 'Nội tuyến',
158
155
  'fabric.editor.inputQueryAssistiveTxt': 'Khi có sẵn kết quả tự hoàn tất, hãy dùng các mũi tên lên và xuống để xem lại và enter để chọn. Người dùng thiết bị cảm ứng, khám phá bằng thao tác chạm hoặc bằng các cử chỉ vuốt.',
159
156
  'fabric.editor.invalidDateError': 'Nhập ngày hợp lệ',
160
- 'fabric.editor.invalidLink': 'Vui lòng nhập một liên kết hợp lệ.',
161
157
  'fabric.editor.inviteItem.title': '{userRole, select, admin {Mời thành viên cùng nhóm vào {productName}} trusted {Mời thành viên cùng nhóm vào {productName}} other {Thêm thành viên cùng nhóm vào {productName}}}',
162
158
  'fabric.editor.italic': 'In nghiêng',
163
159
  'fabric.editor.keyboardShortcuts': 'Phím tắt bàn phím',
164
160
  'fabric.editor.leftSidebar': 'Thanh bên trái',
165
- 'fabric.editor.linkAddress': 'Địa chỉ liên kết',
166
- 'fabric.editor.linkPlaceholder': 'Dán liên kết',
167
161
  'fabric.editor.lists': 'Danh sách',
168
162
  'fabric.editor.markdown': 'Ngôn ngữ đánh dấu',
169
163
  'fabric.editor.matchCase': 'Khớp cách viết hoa',
170
- 'fabric.editor.mediaAddLink': 'Thêm liên kết',
171
164
  'fabric.editor.mediaGroupDeleteLabel': 'xóa',
172
165
  'fabric.editor.mentionNode.label': 'Người dùng được gắn thẻ',
173
166
  'fabric.editor.mentionsAddLabel': 'biểu tượng thêm',
@@ -203,7 +196,6 @@ export default {
203
196
  'fabric.editor.rightSidebar': 'Thanh bên phải',
204
197
  'fabric.editor.searchResults': '{itemsLength, plural, other {Có {itemsLength,number} kết quả tìm kiếm}}',
205
198
  'fabric.editor.selectLanguage': 'Chọn ngôn ngữ',
206
- 'fabric.editor.settingsLinks': 'Vào phần Tùy chọn liên kết',
207
199
  'fabric.editor.shortcut': 'Phím tắt văn bản',
208
200
  'fabric.editor.single': 'Cột đơn',
209
201
  'fabric.editor.statusPlaceholder': 'Đặt trạng thái',
@@ -237,10 +229,8 @@ export default {
237
229
  'fabric.editor.typeahead.mentionInputLabel': 'Bắt đầu nhập để tìm kiếm người dùng để gắn thẻ',
238
230
  'fabric.editor.typeahead.mentionPopupLabel': 'Người dùng bạn có thể gắn thẻ',
239
231
  'fabric.editor.typeahead.metionListItemLabel': 'Người dùng {name} @{shortName}',
240
- 'fabric.editor.unableToOpenLink': 'Không thể mở liên kết này',
241
232
  'fabric.editor.underline': 'Gạch dưới',
242
233
  'fabric.editor.undo': 'Hoàn tác',
243
- 'fabric.editor.unlink': 'Hủy liên kết',
244
234
  'fabric.editor.unorderedList': 'Danh sách dấu đầu dòng',
245
235
  'fabric.editor.unorderedList.description': 'Tạo một danh sách kiểu không sắp xếp',
246
236
  'fabric.editor.url': 'Hiển thị URL',
@@ -73,7 +73,6 @@ export default {
73
73
  'fabric.editor.edit': '编辑',
74
74
  'fabric.editor.editAltText': '编辑替代文本',
75
75
  'fabric.editor.editDateText': '编辑日期',
76
- 'fabric.editor.editLink': '编辑链接',
77
76
  'fabric.editor.editStatusColor': '编辑状态颜色',
78
77
  'fabric.editor.editStatusText': '编辑状态',
79
78
  'fabric.editor.editableContentLabel': '可编辑内容',
@@ -97,7 +96,6 @@ export default {
97
96
  'fabric.editor.elementbrowser.search.empty-state.sub-heading.link': '浏览 Atlassian Marketplace',
98
97
  'fabric.editor.elementbrowser.sidebar.heading': '浏览',
99
98
  'fabric.editor.embedTitle': '嵌入',
100
- 'fabric.editor.emptyLink': '请输入链接。',
101
99
  'fabric.editor.epic': '长篇故事',
102
100
  'fabric.editor.error': '错误',
103
101
  'fabric.editor.errorPanel': '错误面板',
@@ -141,7 +139,6 @@ export default {
141
139
  'fabric.editor.hyperlink.linkAriaLabel': '链接标签',
142
140
  'fabric.editor.hyperlink.searchLinkAriaDescription': '在字段中输入内容时,下方会显示建议内容',
143
141
  'fabric.editor.hyperlink.searchLinkResults': '{count, plural, =0 {未找到结果} other {找到 {count,number} 个结果}}',
144
- 'fabric.editor.hyperlinkToolbarPlaceholder': '粘贴或搜索链接',
145
142
  'fabric.editor.imageBorderBold': '加粗',
146
143
  'fabric.editor.imageBorderColor': '颜色',
147
144
  'fabric.editor.imageBorderMedium': '中等',
@@ -157,17 +154,13 @@ export default {
157
154
  'fabric.editor.inlineTitle': '内嵌',
158
155
  'fabric.editor.inputQueryAssistiveTxt': '有可用的自动完成结果时,可以使用向上和向下箭头键进行查看,并按 Enter 键进行选择。触摸设备用户,并通过触摸或滑动手势进行浏览。',
159
156
  'fabric.editor.invalidDateError': '输入有效日期',
160
- 'fabric.editor.invalidLink': '请输入有效链接。',
161
157
  'fabric.editor.inviteItem.title': '{userRole, select, admin {邀请团队成员加入 {productName}} trusted {邀请团队成员加入 {productName}} other {将团队成员添加至 {productName}}}',
162
158
  'fabric.editor.italic': '斜体',
163
159
  'fabric.editor.keyboardShortcuts': '键盘快捷键',
164
160
  'fabric.editor.leftSidebar': '左侧栏',
165
- 'fabric.editor.linkAddress': '链接地址',
166
- 'fabric.editor.linkPlaceholder': '粘贴链接',
167
161
  'fabric.editor.lists': '列表',
168
162
  'fabric.editor.markdown': '进行标记',
169
163
  'fabric.editor.matchCase': '匹配大小写',
170
- 'fabric.editor.mediaAddLink': '添加链接',
171
164
  'fabric.editor.mediaGroupDeleteLabel': '删除',
172
165
  'fabric.editor.mentionNode.label': '已标记用户',
173
166
  'fabric.editor.mentionsAddLabel': '“添加”图标',
@@ -203,7 +196,6 @@ export default {
203
196
  'fabric.editor.rightSidebar': '右侧栏',
204
197
  'fabric.editor.searchResults': '{itemsLength, plural, other {{itemsLength,number} 个搜索结果可用}}',
205
198
  'fabric.editor.selectLanguage': '选择语言',
206
- 'fabric.editor.settingsLinks': '转到“链接首选项”',
207
199
  'fabric.editor.shortcut': '文本快捷方式',
208
200
  'fabric.editor.single': '单列',
209
201
  'fabric.editor.statusPlaceholder': '设置状态',
@@ -237,10 +229,8 @@ export default {
237
229
  'fabric.editor.typeahead.mentionInputLabel': '开始输入以搜索要标记的用户',
238
230
  'fabric.editor.typeahead.mentionPopupLabel': '您可以标记的用户',
239
231
  'fabric.editor.typeahead.metionListItemLabel': '用户 {name} @{shortName}',
240
- 'fabric.editor.unableToOpenLink': '无法打开此链接',
241
232
  'fabric.editor.underline': '下划线',
242
233
  'fabric.editor.undo': '撤销',
243
- 'fabric.editor.unlink': '取消链接',
244
234
  'fabric.editor.unorderedList': '无序列表',
245
235
  'fabric.editor.unorderedList.description': '创建无序列表',
246
236
  'fabric.editor.url': '显示 URL',
@@ -73,7 +73,6 @@ export default {
73
73
  'fabric.editor.edit': '編輯',
74
74
  'fabric.editor.editAltText': '編輯替代文字',
75
75
  'fabric.editor.editDateText': '編輯日期',
76
- 'fabric.editor.editLink': '編輯連結',
77
76
  'fabric.editor.editStatusColor': '編輯狀態顏色',
78
77
  'fabric.editor.editStatusText': '編輯狀態',
79
78
  'fabric.editor.editableContentLabel': '可編輯內容',
@@ -97,7 +96,6 @@ export default {
97
96
  'fabric.editor.elementbrowser.search.empty-state.sub-heading.link': '探索 Atlassian Marketplace',
98
97
  'fabric.editor.elementbrowser.sidebar.heading': '瀏覽',
99
98
  'fabric.editor.embedTitle': '嵌入',
100
- 'fabric.editor.emptyLink': '請輸入連結。',
101
99
  'fabric.editor.epic': '大型工作',
102
100
  'fabric.editor.error': '錯誤',
103
101
  'fabric.editor.errorPanel': '錯誤面板',
@@ -141,7 +139,6 @@ export default {
141
139
  'fabric.editor.hyperlink.linkAriaLabel': '連結標籤',
142
140
  'fabric.editor.hyperlink.searchLinkAriaDescription': '當您在欄位中輸入內容時,建議會顯示在下方',
143
141
  'fabric.editor.hyperlink.searchLinkResults': '{count, plural, =0 {沒有找到任何結果} other {找到 {count,number} 個結果}}',
144
- 'fabric.editor.hyperlinkToolbarPlaceholder': '貼上或搜尋連結',
145
142
  'fabric.editor.imageBorderBold': '粗體',
146
143
  'fabric.editor.imageBorderColor': '顏色',
147
144
  'fabric.editor.imageBorderMedium': '普通',
@@ -157,17 +154,13 @@ export default {
157
154
  'fabric.editor.inlineTitle': '內嵌',
158
155
  'fabric.editor.inputQueryAssistiveTxt': '自動完成結果可用時,請使用向上和向下箭頭查看,並輸入以進行選取。若您使用觸控螢幕裝置,請透過觸控或滑動手勢探索內容。',
159
156
  'fabric.editor.invalidDateError': '請輸入有效的日期',
160
- 'fabric.editor.invalidLink': '請輸入有效的連結。',
161
157
  'fabric.editor.inviteItem.title': '{userRole, select, admin {邀請團隊成員加入 {productName}} trusted {邀請團隊成員加入 {productName}} other {將團隊成員新增至 {productName}}}',
162
158
  'fabric.editor.italic': '斜體',
163
159
  'fabric.editor.keyboardShortcuts': '鍵盤快速鍵',
164
160
  'fabric.editor.leftSidebar': '左側資訊看板',
165
- 'fabric.editor.linkAddress': '連結位址',
166
- 'fabric.editor.linkPlaceholder': '貼上連結',
167
161
  'fabric.editor.lists': '清單',
168
162
  'fabric.editor.markdown': 'Markdown',
169
163
  'fabric.editor.matchCase': '大小寫須相符',
170
- 'fabric.editor.mediaAddLink': '新增連結',
171
164
  'fabric.editor.mediaGroupDeleteLabel': '刪除',
172
165
  'fabric.editor.mentionNode.label': '已標記使用者',
173
166
  'fabric.editor.mentionsAddLabel': '新增圖示',
@@ -203,7 +196,6 @@ export default {
203
196
  'fabric.editor.rightSidebar': '右側資訊看板',
204
197
  'fabric.editor.searchResults': '{itemsLength, plural, other {{itemsLength,number} 個搜尋結果}}',
205
198
  'fabric.editor.selectLanguage': '選取語言',
206
- 'fabric.editor.settingsLinks': '前往連結偏好設定',
207
199
  'fabric.editor.shortcut': '文字快顯',
208
200
  'fabric.editor.single': '單欄',
209
201
  'fabric.editor.statusPlaceholder': '設定狀態',
@@ -237,10 +229,8 @@ export default {
237
229
  'fabric.editor.typeahead.mentionInputLabel': '開始輸入以搜尋要標記的使用者',
238
230
  'fabric.editor.typeahead.mentionPopupLabel': '您可以標記的使用者',
239
231
  'fabric.editor.typeahead.metionListItemLabel': '使用者 {name} @{shortName}',
240
- 'fabric.editor.unableToOpenLink': '無法開啟此連結',
241
232
  'fabric.editor.underline': '底線',
242
233
  'fabric.editor.undo': '復原',
243
- 'fabric.editor.unlink': '取消連結',
244
234
  'fabric.editor.unorderedList': '項目符號清單',
245
235
  'fabric.editor.unorderedList.description': '建立未排序的清單',
246
236
  'fabric.editor.url': '顯示 URL',
@@ -22,37 +22,14 @@ import ToolbarButton from '../../../ui/ToolbarButton';
22
22
  import { getBreakoutMode } from '../utils/get-breakout-mode';
23
23
  import { setBreakoutMode } from '../commands/set-breakout-mode';
24
24
  import { removeBreakout } from '../commands/remove-breakout';
25
- import commonMessages from '../../../messages';
26
25
  import { BreakoutCssClassName } from '../constants';
27
26
  import { isBreakoutMarkAllowed } from '../utils/is-breakout-mark-allowed';
28
27
  import { getPluginState } from '../plugin-key';
29
28
  import { NodeSelection } from 'prosemirror-state';
30
29
  import { isSupportedNodeForBreakout } from '../utils/is-supported-node';
31
30
  import { layers } from '@atlaskit/theme/constants';
31
+ import { getNextBreakoutMode, getTitle } from '@atlaskit/editor-common/utils';
32
32
  var toolbarButtonWrapper = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n && button {\n background: ", ";\n color: ", ";\n :hover {\n background: ", ";\n color: ", " !important;\n }\n }\n"])), "var(--ds-background-neutral, ".concat(N20A, ")"), "var(--ds-icon, ".concat(N300, ")"), "var(--ds-background-neutral-hovered, ".concat(B300, ")"), "var(--ds-icon, white)");
33
- var BREAKOUT_MODE = {
34
- FULL_WIDTH: 'full-width',
35
- CENTER: 'center',
36
- WIDE: 'wide'
37
- };
38
- var getNextBreakoutMode = function getNextBreakoutMode(currentMode) {
39
- if (currentMode === BREAKOUT_MODE.FULL_WIDTH) {
40
- return BREAKOUT_MODE.CENTER;
41
- } else if (currentMode === BREAKOUT_MODE.WIDE) {
42
- return BREAKOUT_MODE.FULL_WIDTH;
43
- }
44
- return BREAKOUT_MODE.WIDE;
45
- };
46
- var getTitle = function getTitle(layout) {
47
- switch (layout) {
48
- case BREAKOUT_MODE.FULL_WIDTH:
49
- return commonMessages.layoutFixedWidth;
50
- case BREAKOUT_MODE.WIDE:
51
- return commonMessages.layoutFullWidth;
52
- default:
53
- return commonMessages.layoutWide;
54
- }
55
- };
56
33
  function getBreakoutNodeElement(pluginState, selection, editorView) {
57
34
  if (selection instanceof NodeSelection && isSupportedNodeForBreakout(selection.node)) {
58
35
  return findDomRefAtPos(selection.from, editorView.domAtPos.bind(editorView));
@@ -74,7 +51,7 @@ var LayoutButton = /*#__PURE__*/function (_React$Component) {
74
51
  var _this$props$editorVie = _this.props.editorView,
75
52
  state = _this$props$editorVie.state,
76
53
  dispatch = _this$props$editorVie.dispatch;
77
- if ([BREAKOUT_MODE.WIDE, BREAKOUT_MODE.FULL_WIDTH].indexOf(breakoutMode) !== -1) {
54
+ if (['wide', 'full-width'].indexOf(breakoutMode) !== -1) {
78
55
  setBreakoutMode(breakoutMode)(state, dispatch);
79
56
  } else {
80
57
  removeBreakout()(state, dispatch);
@@ -129,7 +106,7 @@ var LayoutButton = /*#__PURE__*/function (_React$Component) {
129
106
  title: title,
130
107
  testId: titleMessage.id,
131
108
  onClick: this.handleClick(nextBreakoutMode),
132
- iconBefore: breakoutMode === BREAKOUT_MODE.FULL_WIDTH ? jsx(CollapseIcon, {
109
+ iconBefore: breakoutMode === 'full-width' ? jsx(CollapseIcon, {
133
110
  label: title
134
111
  }) : jsx(ExpandIcon, {
135
112
  label: title
@@ -1,5 +1,4 @@
1
1
  import { findSupportedNodeForBreakout } from './find-breakout-node';
2
-
3
2
  /**
4
3
  * Get the current mode of the breakout at the selection
5
4
  * @param state Current EditorState
@@ -1,18 +1,26 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
3
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
- import React, { Fragment } from 'react';
4
+ import React from 'react';
5
5
  import { inlineCard, blockCard, embedCard } from '@atlaskit/adf-schema';
6
6
  import { createPlugin } from './pm-plugins/main';
7
7
  import { floatingToolbar } from './toolbar';
8
8
  import { EditorSmartCardEvents } from './ui/EditorSmartCardEvents';
9
9
  import { cardKeymap } from './pm-plugins/keymap';
10
10
  import { EditorSmartCardEventsNext } from './ui/EditorSmartCardEventsNext';
11
+ import LayoutButton from './ui/LayoutButton';
12
+ import { pluginKey } from './pm-plugins/plugin-key';
11
13
  var cardPlugin = function cardPlugin(options, api) {
12
14
  var _api$dependencies, _api$dependencies$fea;
13
15
  var featureFlags = (api === null || api === void 0 ? void 0 : (_api$dependencies = api.dependencies) === null || _api$dependencies === void 0 ? void 0 : (_api$dependencies$fea = _api$dependencies.featureFlags) === null || _api$dependencies$fea === void 0 ? void 0 : _api$dependencies$fea.sharedState.currentState()) || {};
14
16
  return {
15
17
  name: 'card',
18
+ getSharedState: function getSharedState(editorState) {
19
+ if (!editorState) {
20
+ return null;
21
+ }
22
+ return pluginKey.getState(editorState);
23
+ },
16
24
  nodes: function nodes() {
17
25
  var nodes = [{
18
26
  name: 'inlineCard',
@@ -56,12 +64,21 @@ var cardPlugin = function cardPlugin(options, api) {
56
64
  return plugins;
57
65
  },
58
66
  contentComponent: function contentComponent(_ref2) {
59
- var editorView = _ref2.editorView;
67
+ var editorView = _ref2.editorView,
68
+ popupsMountPoint = _ref2.popupsMountPoint,
69
+ popupsScrollableElement = _ref2.popupsScrollableElement,
70
+ popupsBoundariesElement = _ref2.popupsBoundariesElement;
60
71
  var lpAnalyticsEventsNext = featureFlags.lpAnalyticsEventsNext;
61
- return /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(EditorSmartCardEvents, {
72
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(EditorSmartCardEvents, {
62
73
  editorView: editorView
63
74
  }), lpAnalyticsEventsNext && /*#__PURE__*/React.createElement(EditorSmartCardEventsNext, {
64
75
  editorView: editorView
76
+ }), /*#__PURE__*/React.createElement(LayoutButton, {
77
+ api: api,
78
+ editorView: editorView,
79
+ mountPoint: popupsMountPoint,
80
+ scrollableElement: popupsScrollableElement,
81
+ boundariesElement: popupsBoundariesElement
65
82
  }));
66
83
  },
67
84
  pluginsOptions: {
@@ -15,6 +15,9 @@ import PropTypes from 'prop-types';
15
15
  import { css, jsx } from '@emotion/react';
16
16
  import ReactNodeView from '@atlaskit/editor-common/react-node-view';
17
17
  import { DatasourceTableView } from '@atlaskit/link-datasource';
18
+ import { SmartCardSharedCssClassName } from '@atlaskit/editor-common/styles';
19
+ import { calcBreakoutWidthPx } from '@atlaskit/editor-common/utils';
20
+ export var DATASOURCE_INNER_CONTAINER_CLASSNAME = 'datasourceView-content-inner-wrap';
18
21
  var containerStyles = css({
19
22
  height: '500px',
20
23
  overflow: 'auto'
@@ -111,15 +114,46 @@ _defineProperty(DatasourceComponent, "contextTypes", {
111
114
  export var Datasource = /*#__PURE__*/function (_ReactNodeView) {
112
115
  _inherits(Datasource, _ReactNodeView);
113
116
  var _super2 = _createSuper(Datasource);
114
- function Datasource() {
117
+ function Datasource(props) {
118
+ var _props$pluginInjectio, _props$pluginInjectio2, _props$pluginInjectio3, _sharedState$currentS;
119
+ var _this2;
115
120
  _classCallCheck(this, Datasource);
116
- return _super2.apply(this, arguments);
121
+ _this2 = _super2.call(this, props.node, props.view, props.getPos, props.portalProviderAPI, props.eventDispatcher, props, undefined, true, undefined, props.hasIntlContext);
122
+ _defineProperty(_assertThisInitialized(_this2), "calcTableWidth", function (layout, containerWidth) {
123
+ if (layout === 'center') {
124
+ return 'inherit';
125
+ }
126
+ return calcBreakoutWidthPx(layout, containerWidth);
127
+ });
128
+ var sharedState = props === null || props === void 0 ? void 0 : (_props$pluginInjectio = props.pluginInjectionApi) === null || _props$pluginInjectio === void 0 ? void 0 : (_props$pluginInjectio2 = _props$pluginInjectio.dependencies) === null || _props$pluginInjectio2 === void 0 ? void 0 : (_props$pluginInjectio3 = _props$pluginInjectio2.width) === null || _props$pluginInjectio3 === void 0 ? void 0 : _props$pluginInjectio3.sharedState;
129
+ _this2.tableWidth = sharedState === null || sharedState === void 0 ? void 0 : (_sharedState$currentS = sharedState.currentState()) === null || _sharedState$currentS === void 0 ? void 0 : _sharedState$currentS.width;
130
+ sharedState === null || sharedState === void 0 ? void 0 : sharedState.onChange(function (_ref2) {
131
+ var nextSharedState = _ref2.nextSharedState;
132
+ if (nextSharedState !== null && nextSharedState !== void 0 && nextSharedState.width && _this2.tableWidth !== (nextSharedState === null || nextSharedState === void 0 ? void 0 : nextSharedState.width)) {
133
+ _this2.tableWidth = nextSharedState === null || nextSharedState === void 0 ? void 0 : nextSharedState.width;
134
+ _this2.update(_this2.node, []); // required to update the width when page is resized.
135
+ }
136
+ });
137
+ return _this2;
117
138
  }
118
139
  _createClass(Datasource, [{
140
+ key: "createDomRef",
141
+ value: function createDomRef() {
142
+ var domRef = document.createElement('div');
143
+ domRef.classList.add(SmartCardSharedCssClassName.DATASOURCE_CONTAINER);
144
+ return domRef;
145
+ }
146
+ }, {
119
147
  key: "render",
120
148
  value: function render() {
149
+ var attrs = this.node.attrs;
150
+ var calculatedWidth = this.calcTableWidth(attrs.layout, this.tableWidth);
121
151
  return jsx("div", {
122
- css: containerStyles
152
+ className: DATASOURCE_INNER_CONTAINER_CLASSNAME,
153
+ css: containerStyles,
154
+ style: {
155
+ minWidth: calculatedWidth
156
+ }
123
157
  }, jsx(DatasourceComponent, {
124
158
  node: this.node,
125
159
  view: this.view,
@@ -50,6 +50,33 @@ export var setProvider = function setProvider(cardProvider) {
50
50
  });
51
51
  };
52
52
  };
53
+ export var setDatasourceTableRef = function setDatasourceTableRef(datasourceTableRef) {
54
+ return function (tr) {
55
+ return cardAction(tr, {
56
+ type: 'SET_DATASOURCE_TABLE_REF',
57
+ datasourceTableRef: datasourceTableRef
58
+ });
59
+ };
60
+ };
61
+ export var setCardLayout = function setCardLayout(layout) {
62
+ return function (tr) {
63
+ return cardAction(tr, {
64
+ type: 'SET_CARD_LAYOUT',
65
+ layout: layout
66
+ });
67
+ };
68
+ };
69
+ export var setCardLayoutAndDatasourceTableRef = function setCardLayoutAndDatasourceTableRef(_ref) {
70
+ var layout = _ref.layout,
71
+ datasourceTableRef = _ref.datasourceTableRef;
72
+ return function (tr) {
73
+ return cardAction(tr, {
74
+ type: 'SET_CARD_LAYOUT_AND_DATASOURCE_TABLE_REF',
75
+ layout: layout,
76
+ datasourceTableRef: datasourceTableRef
77
+ });
78
+ };
79
+ };
53
80
  export var showLinkToolbar = function showLinkToolbar(tr) {
54
81
  return cardAction(tr, {
55
82
  type: 'SHOW_LINK_TOOLBAR'
@@ -1,5 +1,6 @@
1
1
  import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
2
2
  import { SafePlugin } from '@atlaskit/editor-common/safe-plugin';
3
+ import { NodeSelection } from 'prosemirror-state';
3
4
  import rafSchedule from 'raf-schd';
4
5
  import { getInlineNodeViewProducer } from '@atlaskit/editor-common/react-node-view';
5
6
  import { BlockCard } from '../nodeviews/blockCard';
@@ -10,7 +11,9 @@ import reducer from './reducers';
10
11
  import { handleProvider, resolveWithProvider } from './util/resolve';
11
12
  import { getNewRequests, getPluginState, getPluginStateWithUpdatedPos } from './util/state';
12
13
  import { createAnalyticsQueue, eventsFromTransaction } from './analytics';
13
- import { Datasource } from '../nodeviews/datasource';
14
+ import { DATASOURCE_INNER_CONTAINER_CLASSNAME, Datasource } from '../nodeviews/datasource';
15
+ import { setDatasourceTableRef, setCardLayoutAndDatasourceTableRef } from './actions';
16
+ import { findDomRefAtPos } from 'prosemirror-utils';
14
17
  export { pluginKey } from './plugin-key';
15
18
  export var createPlugin = function createPlugin(options, pluginInjectionApi) {
16
19
  return function (pmPluginFactoryParams) {
@@ -34,7 +37,9 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
34
37
  smartLinkEvents: undefined,
35
38
  smartLinkEventsNext: undefined,
36
39
  createAnalyticsEvent: createAnalyticsEvent,
37
- editorAppearance: editorAppearance
40
+ editorAppearance: editorAppearance,
41
+ datasourceTableRef: undefined,
42
+ layout: undefined
38
43
  };
39
44
  },
40
45
  apply: function apply(tr, pluginState, prevEditorState) {
@@ -60,12 +65,42 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
60
65
  var subscriptionHandler = function subscriptionHandler(name, provider) {
61
66
  return handleProvider(name, provider, _view);
62
67
  };
68
+ var domAtPos = _view.domAtPos.bind(_view);
63
69
  var rafCancellationCallbacks = [];
64
70
  pmPluginFactoryParams.providerFactory.subscribe('cardProvider', subscriptionHandler);
65
71
  return {
66
72
  update: function update(view, prevState) {
73
+ var _selection$node;
67
74
  var currentState = getPluginState(view.state);
68
75
  var oldState = getPluginState(prevState);
76
+ var state = view.state,
77
+ dispatch = view.dispatch;
78
+ var selection = state.selection,
79
+ tr = state.tr,
80
+ schema = state.schema;
81
+ var isBlockCardSelected = selection instanceof NodeSelection && ((_selection$node = selection.node) === null || _selection$node === void 0 ? void 0 : _selection$node.type) === schema.nodes.blockCard;
82
+ if (isBlockCardSelected) {
83
+ var _findDomRefAtPos, _node$attrs;
84
+ var datasourceTableRef = (_findDomRefAtPos = findDomRefAtPos(selection.from, domAtPos)) === null || _findDomRefAtPos === void 0 ? void 0 : _findDomRefAtPos.querySelector(".".concat(DATASOURCE_INNER_CONTAINER_CLASSNAME));
85
+ var node = selection.node;
86
+ var isDatasource = !!(node !== null && node !== void 0 && (_node$attrs = node.attrs) !== null && _node$attrs !== void 0 && _node$attrs.datasource);
87
+ var shouldUpdateTableRef = datasourceTableRef && (currentState === null || currentState === void 0 ? void 0 : currentState.datasourceTableRef) !== datasourceTableRef;
88
+ if (isDatasource && shouldUpdateTableRef) {
89
+ var _node$attrs2;
90
+ // since we use the plugin state, which is a shared state, we need to update the datasourceTableRef, layout on each selection
91
+ var layout = (node === null || node === void 0 ? void 0 : (_node$attrs2 = node.attrs) === null || _node$attrs2 === void 0 ? void 0 : _node$attrs2.layout) || 'center';
92
+
93
+ // we use cardAction to set the same meta, hence, we will need to combine both layout+datasourceTableRef in one transaction
94
+ dispatch(setCardLayoutAndDatasourceTableRef({
95
+ datasourceTableRef: datasourceTableRef,
96
+ layout: layout
97
+ })(tr));
98
+ }
99
+ } else {
100
+ if (currentState !== null && currentState !== void 0 && currentState.datasourceTableRef) {
101
+ dispatch(setDatasourceTableRef(undefined)(tr));
102
+ }
103
+ }
69
104
  if (currentState && currentState.provider) {
70
105
  // Find requests in this state that weren't in the old one.
71
106
  var newRequests = getNewRequests(oldState, currentState);
@@ -111,6 +146,7 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
111
146
  }
112
147
  }),
113
148
  blockCard: function blockCard(node, view, getPos) {
149
+ var _node$attrs3;
114
150
  var portalProviderAPI = pmPluginFactoryParams.portalProviderAPI,
115
151
  eventDispatcher = pmPluginFactoryParams.eventDispatcher;
116
152
  var reactComponentProps = {
@@ -118,8 +154,17 @@ export var createPlugin = function createPlugin(options, pluginInjectionApi) {
118
154
  showServerActions: showServerActions
119
155
  };
120
156
  var hasIntlContext = true;
121
- if (node.attrs.datasource) {
122
- return new Datasource(node, view, getPos, portalProviderAPI, eventDispatcher, undefined, undefined, true, undefined, hasIntlContext).init();
157
+ var isDatasource = !!(node !== null && node !== void 0 && (_node$attrs3 = node.attrs) !== null && _node$attrs3 !== void 0 && _node$attrs3.datasource);
158
+ if (isDatasource) {
159
+ return new Datasource({
160
+ node: node,
161
+ view: view,
162
+ getPos: getPos,
163
+ portalProviderAPI: portalProviderAPI,
164
+ eventDispatcher: eventDispatcher,
165
+ hasIntlContext: hasIntlContext,
166
+ pluginInjectionApi: pluginInjectionApi
167
+ }).init();
123
168
  }
124
169
  return new BlockCard(node, view, getPos, portalProviderAPI, eventDispatcher, reactComponentProps, undefined, true, undefined, hasIntlContext).init();
125
170
  },