@atlaskit/editor-core 151.3.0 → 151.3.1

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 (297) hide show
  1. package/dist/cjs/create-editor/ReactEditorView.js +22 -8
  2. package/dist/cjs/create-editor/create-plugins-list.js +25 -9
  3. package/dist/cjs/labs/next/presets/cxhtml.js +1 -2
  4. package/dist/cjs/nodeviews/ReactNodeView.js +2 -2
  5. package/dist/cjs/nodeviews/SelectionBasedNodeView.js +6 -0
  6. package/dist/cjs/plugins/analytics/types/enums.js +1 -0
  7. package/dist/cjs/plugins/annotation/utils.js +19 -8
  8. package/dist/cjs/plugins/avatar-group/index.js +2 -1
  9. package/dist/cjs/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +5 -2
  10. package/dist/cjs/plugins/before-primaryToolbar/index.js +26 -0
  11. package/dist/cjs/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +28 -0
  12. package/dist/cjs/plugins/extension/extension-api.js +10 -2
  13. package/dist/cjs/plugins/extension/ui/styles.js +1 -1
  14. package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
  15. package/dist/cjs/plugins/find-replace/FindReplaceToolbarButtonWithState.js +172 -0
  16. package/dist/cjs/plugins/find-replace/index.js +14 -137
  17. package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +10 -4
  18. package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +1 -1
  19. package/dist/cjs/plugins/fragment/index.js +34 -0
  20. package/dist/cjs/plugins/fragment/plugin-key.js +11 -0
  21. package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
  22. package/dist/cjs/plugins/index.js +16 -0
  23. package/dist/cjs/plugins/list/actions/conversions.js +39 -71
  24. package/dist/cjs/plugins/list/transforms.js +7 -1
  25. package/dist/cjs/plugins/media/index.js +2 -3
  26. package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +3 -1
  27. package/dist/cjs/plugins/media/nodeviews/mediaInline.js +12 -5
  28. package/dist/cjs/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
  29. package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +6 -4
  30. package/dist/cjs/plugins/media/nodeviews/styles.js +6 -1
  31. package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -1
  32. package/dist/cjs/plugins/media/pm-plugins/main.js +49 -15
  33. package/dist/cjs/plugins/media/toolbar/commands.js +59 -0
  34. package/dist/cjs/plugins/media/toolbar/filePreviewItem.js +7 -2
  35. package/dist/cjs/plugins/media/toolbar/index.js +90 -3
  36. package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +9 -1
  37. package/dist/cjs/plugins/media/utils/media-common.js +1 -1
  38. package/dist/cjs/plugins/media/utils/media-files.js +5 -1
  39. package/dist/cjs/plugins/panel/actions.js +2 -2
  40. package/dist/cjs/plugins/panel/index.js +3 -3
  41. package/dist/cjs/plugins/panel/nodeviews/panel.js +2 -2
  42. package/dist/cjs/plugins/panel/toolbar.js +10 -5
  43. package/dist/cjs/plugins/panel/utils.js +15 -0
  44. package/dist/cjs/plugins/rank.js +3 -2
  45. package/dist/cjs/plugins/selection/pm-plugins/selection-main.js +49 -1
  46. package/dist/cjs/plugins/status/ui/statusPicker.js +4 -2
  47. package/dist/cjs/plugins/table/commands/insert.js +1 -0
  48. package/dist/cjs/plugins/table/index.js +3 -2
  49. package/dist/cjs/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -3
  50. package/dist/cjs/plugins/table/pm-plugins/main.js +26 -3
  51. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
  52. package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -0
  53. package/dist/cjs/plugins/table/transforms/column-width.js +14 -5
  54. package/dist/cjs/plugins/table/transforms/fix-tables.js +43 -6
  55. package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +3 -2
  56. package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
  57. package/dist/cjs/plugins/table/ui/common-styles.css.js +1 -1
  58. package/dist/cjs/plugins/table/ui/consts.js +1 -1
  59. package/dist/cjs/plugins/table/ui/messages.js +1 -1
  60. package/dist/cjs/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
  61. package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
  62. package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/main.js +2 -2
  63. package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +2 -1
  64. package/dist/cjs/plugins/text-formatting/index.js +2 -1
  65. package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +1 -0
  66. package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +77 -26
  67. package/dist/cjs/ui/Appearance/FullPage/MainToolbar.js +32 -9
  68. package/dist/cjs/ui/ColorPalette/Color/index.js +8 -18
  69. package/dist/cjs/ui/ColorPalette/index.js +7 -4
  70. package/dist/cjs/ui/ColorPickerButton/index.js +1 -1
  71. package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +114 -61
  72. package/dist/cjs/ui/ConfigPanel/FormContent.js +39 -26
  73. package/dist/cjs/ui/ConfigPanel/transformers.js +490 -248
  74. package/dist/cjs/ui/ConfigPanel/utils.js +2 -10
  75. package/dist/cjs/ui/DropdownMenu/index.js +3 -1
  76. package/dist/cjs/ui/LinkSearch/LinkSearchListItem.js +1 -1
  77. package/dist/cjs/ui/Resizer/index.js +9 -1
  78. package/dist/cjs/version-wrapper.js +1 -1
  79. package/dist/cjs/version.json +1 -1
  80. package/dist/es2019/create-editor/ReactEditorView.js +19 -8
  81. package/dist/es2019/create-editor/create-plugins-list.js +26 -10
  82. package/dist/es2019/labs/next/presets/cxhtml.js +1 -2
  83. package/dist/es2019/nodeviews/ReactNodeView.js +1 -1
  84. package/dist/es2019/nodeviews/SelectionBasedNodeView.js +11 -0
  85. package/dist/es2019/plugins/analytics/types/enums.js +1 -0
  86. package/dist/es2019/plugins/annotation/utils.js +18 -7
  87. package/dist/es2019/plugins/avatar-group/index.js +2 -1
  88. package/dist/es2019/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +3 -2
  89. package/dist/es2019/plugins/before-primaryToolbar/index.js +15 -0
  90. package/dist/es2019/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +12 -0
  91. package/dist/es2019/plugins/extension/extension-api.js +9 -2
  92. package/dist/es2019/plugins/extension/ui/styles.js +6 -0
  93. package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
  94. package/dist/es2019/plugins/find-replace/FindReplaceToolbarButtonWithState.js +152 -0
  95. package/dist/es2019/plugins/find-replace/index.js +15 -128
  96. package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
  97. package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +10 -2
  98. package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +1 -1
  99. package/dist/es2019/plugins/fragment/index.js +22 -0
  100. package/dist/es2019/plugins/fragment/plugin-key.js +2 -0
  101. package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -2
  102. package/dist/es2019/plugins/index.js +2 -0
  103. package/dist/es2019/plugins/list/actions/conversions.js +38 -69
  104. package/dist/es2019/plugins/list/transforms.js +5 -1
  105. package/dist/es2019/plugins/media/index.js +2 -2
  106. package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +2 -1
  107. package/dist/es2019/plugins/media/nodeviews/mediaInline.js +8 -4
  108. package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
  109. package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +7 -5
  110. package/dist/es2019/plugins/media/nodeviews/styles.js +2 -0
  111. package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -1
  112. package/dist/es2019/plugins/media/pm-plugins/main.js +32 -17
  113. package/dist/es2019/plugins/media/toolbar/commands.js +47 -0
  114. package/dist/es2019/plugins/media/toolbar/filePreviewItem.js +6 -2
  115. package/dist/es2019/plugins/media/toolbar/index.js +90 -3
  116. package/dist/es2019/plugins/media/ui/ResizableMediaSingle/index.js +7 -1
  117. package/dist/es2019/plugins/media/utils/media-common.js +1 -1
  118. package/dist/es2019/plugins/media/utils/media-files.js +6 -1
  119. package/dist/es2019/plugins/panel/actions.js +2 -2
  120. package/dist/es2019/plugins/panel/index.js +5 -5
  121. package/dist/es2019/plugins/panel/nodeviews/panel.js +2 -2
  122. package/dist/es2019/plugins/panel/toolbar.js +10 -5
  123. package/dist/es2019/plugins/panel/utils.js +8 -1
  124. package/dist/es2019/plugins/rank.js +3 -2
  125. package/dist/es2019/plugins/selection/pm-plugins/selection-main.js +48 -1
  126. package/dist/es2019/plugins/status/ui/statusPicker.js +4 -2
  127. package/dist/es2019/plugins/table/commands/insert.js +1 -2
  128. package/dist/es2019/plugins/table/index.js +2 -1
  129. package/dist/es2019/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -2
  130. package/dist/es2019/plugins/table/pm-plugins/main.js +25 -4
  131. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
  132. package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -0
  133. package/dist/es2019/plugins/table/transforms/column-width.js +13 -3
  134. package/dist/es2019/plugins/table/transforms/fix-tables.js +43 -5
  135. package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +3 -2
  136. package/dist/es2019/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
  137. package/dist/es2019/plugins/table/ui/common-styles.css.js +5 -1
  138. package/dist/es2019/plugins/table/ui/consts.js +2 -2
  139. package/dist/es2019/plugins/table/ui/messages.js +1 -1
  140. package/dist/es2019/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
  141. package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
  142. package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/main.js +3 -3
  143. package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +2 -1
  144. package/dist/es2019/plugins/text-formatting/index.js +3 -2
  145. package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +2 -1
  146. package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +2 -1
  147. package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +60 -27
  148. package/dist/es2019/ui/Appearance/FullPage/MainToolbar.js +51 -7
  149. package/dist/es2019/ui/ColorPalette/Color/index.js +9 -18
  150. package/dist/es2019/ui/ColorPalette/index.js +7 -4
  151. package/dist/es2019/ui/ColorPickerButton/index.js +1 -1
  152. package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +101 -49
  153. package/dist/es2019/ui/ConfigPanel/FormContent.js +35 -26
  154. package/dist/es2019/ui/ConfigPanel/transformers.js +243 -72
  155. package/dist/es2019/ui/ConfigPanel/utils.js +1 -2
  156. package/dist/es2019/ui/Dropdown/index.js +2 -1
  157. package/dist/es2019/ui/DropdownMenu/index.js +7 -3
  158. package/dist/es2019/ui/ElementBrowser/InsertMenu.js +1 -0
  159. package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +1 -0
  160. package/dist/es2019/ui/LinkSearch/LinkSearchListItem.js +2 -2
  161. package/dist/es2019/ui/Resizer/index.js +9 -1
  162. package/dist/es2019/version-wrapper.js +1 -1
  163. package/dist/es2019/version.json +1 -1
  164. package/dist/esm/create-editor/ReactEditorView.js +22 -8
  165. package/dist/esm/create-editor/create-plugins-list.js +26 -10
  166. package/dist/esm/labs/next/presets/cxhtml.js +1 -2
  167. package/dist/esm/nodeviews/ReactNodeView.js +2 -2
  168. package/dist/esm/nodeviews/SelectionBasedNodeView.js +7 -0
  169. package/dist/esm/plugins/analytics/types/enums.js +1 -0
  170. package/dist/esm/plugins/annotation/utils.js +18 -7
  171. package/dist/esm/plugins/avatar-group/index.js +2 -1
  172. package/dist/esm/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +5 -2
  173. package/dist/esm/plugins/before-primaryToolbar/index.js +15 -0
  174. package/dist/esm/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +12 -0
  175. package/dist/esm/plugins/extension/extension-api.js +9 -2
  176. package/dist/esm/plugins/extension/ui/styles.js +1 -1
  177. package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
  178. package/dist/esm/plugins/find-replace/FindReplaceToolbarButtonWithState.js +155 -0
  179. package/dist/esm/plugins/find-replace/index.js +14 -131
  180. package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
  181. package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +9 -4
  182. package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +1 -1
  183. package/dist/esm/plugins/fragment/index.js +22 -0
  184. package/dist/esm/plugins/fragment/plugin-key.js +2 -0
  185. package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -2
  186. package/dist/esm/plugins/index.js +2 -0
  187. package/dist/esm/plugins/list/actions/conversions.js +38 -71
  188. package/dist/esm/plugins/list/transforms.js +7 -1
  189. package/dist/esm/plugins/media/index.js +2 -3
  190. package/dist/esm/plugins/media/nodeviews/mediaGroup.js +2 -1
  191. package/dist/esm/plugins/media/nodeviews/mediaInline.js +11 -6
  192. package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
  193. package/dist/esm/plugins/media/nodeviews/mediaSingle.js +7 -5
  194. package/dist/esm/plugins/media/nodeviews/styles.js +2 -0
  195. package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -1
  196. package/dist/esm/plugins/media/pm-plugins/main.js +47 -16
  197. package/dist/esm/plugins/media/toolbar/commands.js +45 -0
  198. package/dist/esm/plugins/media/toolbar/filePreviewItem.js +6 -2
  199. package/dist/esm/plugins/media/toolbar/index.js +88 -3
  200. package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +9 -1
  201. package/dist/esm/plugins/media/utils/media-common.js +1 -1
  202. package/dist/esm/plugins/media/utils/media-files.js +6 -1
  203. package/dist/esm/plugins/panel/actions.js +2 -2
  204. package/dist/esm/plugins/panel/index.js +5 -5
  205. package/dist/esm/plugins/panel/nodeviews/panel.js +2 -2
  206. package/dist/esm/plugins/panel/toolbar.js +9 -4
  207. package/dist/esm/plugins/panel/utils.js +13 -0
  208. package/dist/esm/plugins/rank.js +3 -2
  209. package/dist/esm/plugins/selection/pm-plugins/selection-main.js +50 -1
  210. package/dist/esm/plugins/status/ui/statusPicker.js +4 -2
  211. package/dist/esm/plugins/table/commands/insert.js +1 -2
  212. package/dist/esm/plugins/table/index.js +3 -2
  213. package/dist/esm/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -2
  214. package/dist/esm/plugins/table/pm-plugins/main.js +27 -4
  215. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
  216. package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -0
  217. package/dist/esm/plugins/table/transforms/column-width.js +13 -3
  218. package/dist/esm/plugins/table/transforms/fix-tables.js +42 -4
  219. package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +3 -2
  220. package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
  221. package/dist/esm/plugins/table/ui/common-styles.css.js +1 -1
  222. package/dist/esm/plugins/table/ui/consts.js +2 -2
  223. package/dist/esm/plugins/table/ui/messages.js +1 -1
  224. package/dist/esm/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
  225. package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
  226. package/dist/esm/plugins/tasks-and-decisions/pm-plugins/main.js +3 -3
  227. package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +2 -1
  228. package/dist/esm/plugins/text-formatting/index.js +3 -2
  229. package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +2 -1
  230. package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +2 -1
  231. package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +67 -27
  232. package/dist/esm/ui/Appearance/FullPage/MainToolbar.js +20 -7
  233. package/dist/esm/ui/ColorPalette/Color/index.js +9 -16
  234. package/dist/esm/ui/ColorPalette/index.js +7 -4
  235. package/dist/esm/ui/ColorPickerButton/index.js +1 -1
  236. package/dist/esm/ui/ConfigPanel/ConfigPanel.js +113 -62
  237. package/dist/esm/ui/ConfigPanel/FormContent.js +39 -26
  238. package/dist/esm/ui/ConfigPanel/transformers.js +488 -248
  239. package/dist/esm/ui/ConfigPanel/utils.js +1 -6
  240. package/dist/esm/ui/Dropdown/index.js +2 -1
  241. package/dist/esm/ui/DropdownMenu/index.js +7 -3
  242. package/dist/esm/ui/ElementBrowser/InsertMenu.js +1 -0
  243. package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +1 -0
  244. package/dist/esm/ui/LinkSearch/LinkSearchListItem.js +2 -2
  245. package/dist/esm/ui/Resizer/index.js +9 -1
  246. package/dist/esm/version-wrapper.js +1 -1
  247. package/dist/esm/version.json +1 -1
  248. package/dist/types/labs/next/full-page.d.ts +1 -1
  249. package/dist/types/nodeviews/ReactNodeView.d.ts +1 -1
  250. package/dist/types/nodeviews/SelectionBasedNodeView.d.ts +1 -0
  251. package/dist/types/plugins/analytics/types/enums.d.ts +1 -0
  252. package/dist/types/plugins/analytics/types/events.d.ts +7 -1
  253. package/dist/types/plugins/annotation/utils.d.ts +1 -1
  254. package/dist/types/plugins/avatar-group/index.d.ts +1 -0
  255. package/dist/types/plugins/avatar-group/ui/AvatarGroupPluginWrapper.d.ts +1 -0
  256. package/dist/types/plugins/before-primaryToolbar/index.d.ts +5 -0
  257. package/dist/types/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.d.ts +5 -0
  258. package/dist/types/plugins/feature-flags-context/get-enabled-feature-flag-keys.d.ts +1 -1
  259. package/dist/types/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +15 -0
  260. package/dist/types/plugins/find-replace/index.d.ts +1 -0
  261. package/dist/types/plugins/floating-toolbar/ui/EmojiPickerButton.d.ts +1 -1
  262. package/dist/types/plugins/fragment/index.d.ts +5 -0
  263. package/dist/types/plugins/fragment/plugin-key.d.ts +2 -0
  264. package/dist/types/plugins/index.d.ts +2 -0
  265. package/dist/types/plugins/media/nodeviews/mediaInline.d.ts +3 -2
  266. package/dist/types/plugins/media/nodeviews/mediaNodeUpdater.d.ts +2 -2
  267. package/dist/types/plugins/media/nodeviews/mediaSingle.d.ts +1 -1
  268. package/dist/types/plugins/media/nodeviews/styles.d.ts +2 -0
  269. package/dist/types/plugins/media/toolbar/commands.d.ts +3 -0
  270. package/dist/types/plugins/media/toolbar/filePreviewItem.d.ts +2 -0
  271. package/dist/types/plugins/media/types.d.ts +0 -1
  272. package/dist/types/plugins/panel/actions.d.ts +1 -1
  273. package/dist/types/plugins/panel/types.d.ts +8 -2
  274. package/dist/types/plugins/quick-insert/index.d.ts +2 -1
  275. package/dist/types/plugins/table/commands/insert.d.ts +3 -0
  276. package/dist/types/plugins/table/pm-plugins/main.d.ts +2 -1
  277. package/dist/types/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +1 -0
  278. package/dist/types/plugins/table/transforms/column-width.d.ts +4 -1
  279. package/dist/types/plugins/table/transforms/fix-tables.d.ts +3 -2
  280. package/dist/types/plugins/table/types.d.ts +8 -0
  281. package/dist/types/plugins/table/ui/consts.d.ts +1 -1
  282. package/dist/types/types/editor-appearance-component.d.ts +2 -2
  283. package/dist/types/types/editor-props.d.ts +11 -1
  284. package/dist/types/types/feature-flags.d.ts +13 -0
  285. package/dist/types/types/index.d.ts +1 -1
  286. package/dist/types/ui/Appearance/FullPage/FullPageToolbar.d.ts +2 -2
  287. package/dist/types/ui/Appearance/FullPage/MainToolbar.d.ts +10 -1
  288. package/dist/types/ui/ColorPalette/Color/index.d.ts +8 -5
  289. package/dist/types/ui/ColorPalette/index.d.ts +1 -0
  290. package/dist/types/ui/ConfigPanel/transformers.d.ts +7 -1
  291. package/dist/types/ui/ConfigPanel/utils.d.ts +0 -1
  292. package/dist/types/ui/Resizer/index.d.ts +1 -0
  293. package/package.json +10 -7
  294. package/dist/cjs/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.js +0 -38
  295. package/dist/es2019/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.js +0 -28
  296. package/dist/esm/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.js +0 -28
  297. package/dist/types/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.d.ts +0 -1
@@ -5,15 +5,15 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.deserialize = exports.serialize = void 0;
8
+ exports.deserialize = exports.serialize = exports.findDuplicateFields = void 0;
9
9
 
10
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
11
 
12
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
12
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
13
13
 
14
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
15
 
16
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
16
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
17
17
 
18
18
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
19
19
 
@@ -36,10 +36,9 @@ var isOption = function isOption(option) {
36
36
  var isOptions = function isOptions(options) {
37
37
  return Array.isArray(options) && options.every(isOption);
38
38
  };
39
- /** maps the typed-values from the Form values object */
40
-
41
39
 
42
- function extract(value, field) {
40
+ /** maps the typed-values from the Form values object */
41
+ function extract(value, field, options) {
43
42
  if (isOptions(value)) {
44
43
  return value.map(function (item) {
45
44
  return item.value;
@@ -54,230 +53,466 @@ function extract(value, field) {
54
53
  }
55
54
 
56
55
  return Number(value);
56
+ } // Workaround for https://product-fabric.atlassian.net/browse/DST-2701
57
+ else if (options !== null && options !== void 0 && options.useDefaultValue && value === undefined && 'defaultValue' in field) {
58
+ return field.defaultValue;
57
59
  }
58
60
 
59
61
  return value;
60
62
  }
61
63
 
64
+ var findDuplicateFields = function findDuplicateFields(fields) {
65
+ return findDuplicateFieldsInternal(flattenFields(fields));
66
+ };
67
+
68
+ exports.findDuplicateFields = findDuplicateFields;
69
+
70
+ var findDuplicateFieldsInternal = function findDuplicateFieldsInternal(fields) {
71
+ var allowDuplicatesMap = {};
72
+ return fields.find(function (field) {
73
+ if ((0, _extensions.isExpand)(field)) {
74
+ return findDuplicateFieldsInternal(field.fields);
75
+ } else if ((0, _extensions.isTabGroup)(field)) {
76
+ return field.fields.find(function (tabField) {
77
+ return findDuplicateFieldsInternal(tabField.fields);
78
+ });
79
+ } else if (allowDuplicatesMap[field.name] === undefined) {
80
+ allowDuplicatesMap[field.name] = !!field.allowDuplicates;
81
+ return;
82
+ } else if (!field.allowDuplicates || !allowDuplicatesMap[field.name]) {
83
+ return field;
84
+ }
85
+
86
+ return;
87
+ });
88
+ };
89
+
62
90
  var serialize = /*#__PURE__*/function () {
63
91
  var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(manifest, data, fields) {
64
- var depth,
92
+ var options,
65
93
  result,
66
- _loop,
67
- name,
68
- _ret,
94
+ _options$depth,
95
+ depth,
96
+ parentType,
97
+ flattenedFields,
98
+ fillResults,
99
+ parameters,
69
100
  hasDuplicateFields,
70
- _args3 = arguments;
101
+ _args2 = arguments;
71
102
 
72
- return _regenerator.default.wrap(function _callee2$(_context3) {
103
+ return _regenerator.default.wrap(function _callee2$(_context2) {
73
104
  while (1) {
74
- switch (_context3.prev = _context3.next) {
105
+ switch (_context2.prev = _context2.next) {
75
106
  case 0:
76
- depth = _args3.length > 3 && _args3[3] !== undefined ? _args3[3] : 0;
107
+ options = _args2.length > 3 && _args2[3] !== undefined ? _args2[3] : {};
77
108
  result = [];
109
+ _options$depth = options.depth, depth = _options$depth === void 0 ? 0 : _options$depth, parentType = options.parentType;
110
+ flattenedFields = flattenFields(fields);
111
+ fillResults = flattenedFields.map( /*#__PURE__*/function () {
112
+ var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(field) {
113
+ var tabGroupData, tabData, expandData, fieldsetData, value;
114
+ return _regenerator.default.wrap(function _callee$(_context) {
115
+ while (1) {
116
+ switch (_context.prev = _context.next) {
117
+ case 0:
118
+ if (!(0, _extensions.isTabGroup)(field)) {
119
+ _context.next = 7;
120
+ break;
121
+ }
122
+
123
+ _context.next = 3;
124
+ return serializeTabGroupField(manifest, field, data);
125
+
126
+ case 3:
127
+ tabGroupData = _context.sent;
128
+ result.push.apply(result, (0, _toConsumableArray2.default)(tabGroupData));
129
+ _context.next = 30;
130
+ break;
78
131
 
79
- if (!data) {
80
- _context3.next = 13;
81
- break;
82
- }
132
+ case 7:
133
+ if (!(0, _extensions.isTabField)(field)) {
134
+ _context.next = 14;
135
+ break;
136
+ }
83
137
 
84
- _loop = /*#__PURE__*/_regenerator.default.mark(function _loop(name) {
85
- var field, value, tabs, resolveTabValues, i, tabField, fieldSerializer, fieldsetFields, extracted;
86
- return _regenerator.default.wrap(function _loop$(_context2) {
87
- while (1) {
88
- switch (_context2.prev = _context2.next) {
89
- case 0:
90
- field = fields.find(function (field) {
91
- return field.name === (0, _utils.getNameFromDuplicateField)(name);
92
- });
138
+ _context.next = 10;
139
+ return serializeTabField(manifest, field, data);
93
140
 
94
- if (!(field === undefined)) {
95
- _context2.next = 3;
141
+ case 10:
142
+ tabData = _context.sent;
143
+ result.push.apply(result, (0, _toConsumableArray2.default)(tabData));
144
+ _context.next = 30;
96
145
  break;
97
- }
98
146
 
99
- return _context2.abrupt("return", "continue");
147
+ case 14:
148
+ if (!(0, _extensions.isExpand)(field)) {
149
+ _context.next = 21;
150
+ break;
151
+ }
100
152
 
101
- case 3:
102
- // ignore undefined values
103
- value = extract(data[name], field);
153
+ _context.next = 17;
154
+ return serializeExpandField(manifest, field, data);
104
155
 
105
- if (!(value === undefined)) {
106
- _context2.next = 6;
156
+ case 17:
157
+ expandData = _context.sent;
158
+ result.push.apply(result, (0, _toConsumableArray2.default)(expandData));
159
+ _context.next = 30;
107
160
  break;
108
- }
109
161
 
110
- return _context2.abrupt("return", "continue");
162
+ case 21:
163
+ if (!((0, _extensions.isFieldset)(field) && depth === 0)) {
164
+ _context.next = 28;
165
+ break;
166
+ }
167
+
168
+ _context.next = 24;
169
+ return serializeFieldset(manifest, field, data, depth);
111
170
 
112
- case 6:
113
- if (!(0, _extensions.isTabGroup)(field)) {
114
- _context2.next = 21;
171
+ case 24:
172
+ fieldsetData = _context.sent;
173
+
174
+ if (fieldsetData) {
175
+ result.push(fieldsetData);
176
+ }
177
+
178
+ _context.next = 30;
115
179
  break;
116
- }
117
180
 
118
- tabs = field.fields;
119
- value = {};
181
+ case 28:
182
+ value = extract(data[field.name], field, {
183
+ useDefaultValue: true
184
+ }); // ignore undefined values
120
185
 
121
- resolveTabValues = /*#__PURE__*/function () {
122
- var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(tabField, groupData) {
123
- return _regenerator.default.wrap(function _callee$(_context) {
124
- while (1) {
125
- switch (_context.prev = _context.next) {
126
- case 0:
127
- _context.next = 2;
128
- return serialize(manifest, groupData[tabField.name] || {}, tabField.fields);
186
+ if (value !== undefined) {
187
+ result.push((0, _defineProperty2.default)({}, field.name, value));
188
+ }
129
189
 
130
- case 2:
131
- return _context.abrupt("return", _context.sent);
190
+ case 30:
191
+ case "end":
192
+ return _context.stop();
193
+ }
194
+ }
195
+ }, _callee);
196
+ }));
197
+
198
+ return function (_x4) {
199
+ return _ref2.apply(this, arguments);
200
+ };
201
+ }());
202
+ _context2.next = 7;
203
+ return Promise.all(fillResults);
204
+
205
+ case 7:
206
+ // Crunch fields down to parameters
207
+ parameters = result.reduce(function (obj, current) {
208
+ for (var _key in current) {
209
+ obj[_key] = current[_key];
210
+ }
132
211
 
133
- case 3:
134
- case "end":
135
- return _context.stop();
136
- }
137
- }
138
- }, _callee);
139
- }));
212
+ return obj;
213
+ }, {}); // Fix up duplicate values (currently only for fieldsets)
140
214
 
141
- return function resolveTabValues(_x4, _x5) {
142
- return _ref2.apply(this, arguments);
143
- };
144
- }();
215
+ hasDuplicateFields = parentType === 'fieldset' && !!flattenedFields.find(function (field) {
216
+ return field.allowDuplicates;
217
+ });
145
218
 
146
- i = 0;
219
+ if (!hasDuplicateFields) {
220
+ _context2.next = 11;
221
+ break;
222
+ }
147
223
 
148
- case 11:
149
- if (!(i < tabs.length)) {
150
- _context2.next = 19;
151
- break;
152
- }
224
+ return _context2.abrupt("return", serializeMergeDuplicateFieldData(parameters, data, flattenedFields));
153
225
 
154
- tabField = tabs[i];
155
- _context2.next = 15;
156
- return resolveTabValues(tabField, data[field.name] || {});
226
+ case 11:
227
+ return _context2.abrupt("return", parameters);
157
228
 
158
- case 15:
159
- value[tabField.name] = _context2.sent;
229
+ case 12:
230
+ case "end":
231
+ return _context2.stop();
232
+ }
233
+ }
234
+ }, _callee2);
235
+ }));
160
236
 
161
- case 16:
162
- i++;
163
- _context2.next = 11;
164
- break;
237
+ return function serialize(_x, _x2, _x3) {
238
+ return _ref.apply(this, arguments);
239
+ };
240
+ }();
165
241
 
166
- case 19:
167
- _context2.next = 37;
168
- break;
242
+ exports.serialize = serialize;
169
243
 
170
- case 21:
171
- if (!(0, _extensions.isExpand)(field)) {
172
- _context2.next = 27;
173
- break;
174
- }
244
+ var serializeFieldset = /*#__PURE__*/function () {
245
+ var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(manifest, field, data, depth) {
246
+ var fieldSerializer, fieldsetFields, fieldParams, extracted;
247
+ return _regenerator.default.wrap(function _callee3$(_context3) {
248
+ while (1) {
249
+ switch (_context3.prev = _context3.next) {
250
+ case 0:
251
+ _context3.prev = 0;
252
+ _context3.next = 3;
253
+ return (0, _extensions.getFieldSerializer)(manifest, field.options.transformer);
175
254
 
176
- _context2.next = 24;
177
- return serialize(manifest, data[field.name] || {}, field.fields);
255
+ case 3:
256
+ fieldSerializer = _context3.sent;
257
+ _context3.next = 10;
258
+ break;
178
259
 
179
- case 24:
180
- value = _context2.sent;
181
- _context2.next = 37;
182
- break;
260
+ case 6:
261
+ _context3.prev = 6;
262
+ _context3.t0 = _context3["catch"](0);
183
263
 
184
- case 27:
185
- if (!((0, _extensions.isFieldset)(field) && depth === 0)) {
186
- _context2.next = 37;
187
- break;
188
- }
264
+ if (!(data[field.name] !== undefined)) {
265
+ _context3.next = 10;
266
+ break;
267
+ }
189
268
 
190
- _context2.next = 30;
191
- return (0, _extensions.getFieldSerializer)(manifest, field.options.transformer);
269
+ throw _context3.t0;
192
270
 
193
- case 30:
194
- fieldSerializer = _context2.sent;
271
+ case 10:
272
+ if (fieldSerializer) {
273
+ _context3.next = 12;
274
+ break;
275
+ }
195
276
 
196
- if (!fieldSerializer) {
197
- _context2.next = 37;
198
- break;
199
- }
277
+ return _context3.abrupt("return");
278
+
279
+ case 12:
280
+ fieldsetFields = field.fields;
281
+ fieldParams = extract(data[field.name], field, {
282
+ useDefaultValue: true
283
+ }) || {};
284
+ _context3.next = 16;
285
+ return serialize(manifest, fieldParams, fieldsetFields, {
286
+ depth: depth + 1,
287
+ parentType: 'fieldset'
288
+ });
200
289
 
201
- fieldsetFields = field.fields;
202
- _context2.next = 35;
203
- return serialize(manifest, value, fieldsetFields, depth + 1);
290
+ case 16:
291
+ extracted = _context3.sent;
292
+ return _context3.abrupt("return", (0, _defineProperty2.default)({}, field.name, fieldSerializer(extracted)));
204
293
 
205
- case 35:
206
- extracted = _context2.sent;
207
- value = fieldSerializer(extracted);
294
+ case 18:
295
+ case "end":
296
+ return _context3.stop();
297
+ }
298
+ }
299
+ }, _callee3, null, [[0, 6]]);
300
+ }));
208
301
 
209
- case 37:
210
- result.push((0, _defineProperty2.default)({}, field.name, value));
302
+ return function serializeFieldset(_x5, _x6, _x7, _x8) {
303
+ return _ref3.apply(this, arguments);
304
+ };
305
+ }();
211
306
 
212
- case 38:
213
- case "end":
214
- return _context2.stop();
215
- }
216
- }
217
- }, _loop);
307
+ var serializeExpandField = /*#__PURE__*/function () {
308
+ var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(manifest, field, data) {
309
+ var expandData, value, results, fieldName;
310
+ return _regenerator.default.wrap(function _callee4$(_context4) {
311
+ while (1) {
312
+ switch (_context4.prev = _context4.next) {
313
+ case 0:
314
+ expandData = field.hasGroupedValues ? data[field.name] || {} : data;
315
+ _context4.next = 3;
316
+ return serialize(manifest, expandData, field.fields, {
317
+ parentType: 'expand'
218
318
  });
219
- _context3.t0 = _regenerator.default.keys(data);
220
319
 
221
- case 5:
222
- if ((_context3.t1 = _context3.t0()).done) {
223
- _context3.next = 13;
224
- break;
320
+ case 3:
321
+ value = _context4.sent;
322
+ results = [];
323
+
324
+ if (!field.hasGroupedValues) {
325
+ for (fieldName in value) {
326
+ results.push((0, _defineProperty2.default)({}, fieldName, value[fieldName]));
327
+ }
328
+ } else {
329
+ results.push((0, _defineProperty2.default)({}, field.name, value));
225
330
  }
226
331
 
227
- name = _context3.t1.value;
228
- return _context3.delegateYield(_loop(name), "t2", 8);
332
+ return _context4.abrupt("return", results);
229
333
 
230
- case 8:
231
- _ret = _context3.t2;
334
+ case 7:
335
+ case "end":
336
+ return _context4.stop();
337
+ }
338
+ }
339
+ }, _callee4);
340
+ }));
341
+
342
+ return function serializeExpandField(_x9, _x10, _x11) {
343
+ return _ref5.apply(this, arguments);
344
+ };
345
+ }();
346
+
347
+ var resolveTabValues = /*#__PURE__*/function () {
348
+ var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(manifest, tabField, groupData) {
349
+ var tabFieldParams;
350
+ return _regenerator.default.wrap(function _callee5$(_context5) {
351
+ while (1) {
352
+ switch (_context5.prev = _context5.next) {
353
+ case 0:
354
+ tabFieldParams = tabField.hasGroupedValues ? groupData[tabField.name] || {} : groupData;
355
+ _context5.next = 3;
356
+ return serialize(manifest, tabFieldParams, tabField.fields, {
357
+ parentType: 'tab'
358
+ });
359
+
360
+ case 3:
361
+ return _context5.abrupt("return", _context5.sent);
362
+
363
+ case 4:
364
+ case "end":
365
+ return _context5.stop();
366
+ }
367
+ }
368
+ }, _callee5);
369
+ }));
370
+
371
+ return function resolveTabValues(_x12, _x13, _x14) {
372
+ return _ref6.apply(this, arguments);
373
+ };
374
+ }();
375
+
376
+ var serializeTabGroupField = /*#__PURE__*/function () {
377
+ var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(manifest, field, data) {
378
+ var tabs, results, value, i, tabField, tabFieldParameters, fieldName, _fieldName;
232
379
 
233
- if (!(_ret === "continue")) {
234
- _context3.next = 11;
380
+ return _regenerator.default.wrap(function _callee6$(_context6) {
381
+ while (1) {
382
+ switch (_context6.prev = _context6.next) {
383
+ case 0:
384
+ tabs = field.fields;
385
+ results = [];
386
+ value = {};
387
+ i = 0;
388
+
389
+ case 4:
390
+ if (!(i < tabs.length)) {
391
+ _context6.next = 13;
235
392
  break;
236
393
  }
237
394
 
238
- return _context3.abrupt("continue", 5);
395
+ tabField = tabs[i];
396
+ _context6.next = 8;
397
+ return resolveTabValues(manifest, tabField, field.hasGroupedValues ? data[field.name] || {} : data);
239
398
 
240
- case 11:
241
- _context3.next = 5;
399
+ case 8:
400
+ tabFieldParameters = _context6.sent;
401
+
402
+ if (tabField.hasGroupedValues) {
403
+ // Keep namespaced by tab
404
+ value[tabField.name] = tabFieldParameters;
405
+ } else {
406
+ // Copy into tabGroup value
407
+ for (fieldName in tabFieldParameters) {
408
+ value[fieldName] = tabFieldParameters[fieldName];
409
+ }
410
+ }
411
+
412
+ case 10:
413
+ i++;
414
+ _context6.next = 4;
242
415
  break;
243
416
 
244
417
  case 13:
245
- // when there are duplicate fields we return an array eg. [{ title: 'one' }, { title: 'two' }]
246
- // when there aren't we return an object eg. { title: 'one' }
247
- hasDuplicateFields = !!Object.keys(data).find(function (key) {
248
- return (0, _utils.isDuplicateField)(key);
249
- });
250
-
251
- if (!hasDuplicateFields) {
252
- _context3.next = 16;
253
- break;
418
+ // Now for tabGroup...
419
+ if (field.hasGroupedValues) {
420
+ results.push((0, _defineProperty2.default)({}, field.name, value));
421
+ } else {
422
+ for (_fieldName in value) {
423
+ results.push((0, _defineProperty2.default)({}, _fieldName, value));
424
+ }
254
425
  }
255
426
 
256
- return _context3.abrupt("return", result);
427
+ return _context6.abrupt("return", results);
257
428
 
258
- case 16:
259
- return _context3.abrupt("return", result.reduce(function (obj, current) {
260
- for (var key in current) {
261
- obj[key] = current[key];
429
+ case 15:
430
+ case "end":
431
+ return _context6.stop();
432
+ }
433
+ }
434
+ }, _callee6);
435
+ }));
436
+
437
+ return function serializeTabGroupField(_x15, _x16, _x17) {
438
+ return _ref7.apply(this, arguments);
439
+ };
440
+ }();
441
+
442
+ var serializeTabField = /*#__PURE__*/function () {
443
+ var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(manifest, field, data) {
444
+ var results, tabField, tabFieldParameters, fieldName;
445
+ return _regenerator.default.wrap(function _callee7$(_context7) {
446
+ while (1) {
447
+ switch (_context7.prev = _context7.next) {
448
+ case 0:
449
+ results = [];
450
+ tabField = field;
451
+ _context7.next = 4;
452
+ return resolveTabValues(manifest, tabField, data);
453
+
454
+ case 4:
455
+ tabFieldParameters = _context7.sent;
456
+
457
+ if (tabField.hasGroupedValues) {
458
+ // Keep namespaced by tab
459
+ results.push((0, _defineProperty2.default)({}, tabField.name, tabFieldParameters));
460
+ } else {
461
+ // Copy into tabGroup value
462
+ for (fieldName in tabFieldParameters) {
463
+ results.push((0, _defineProperty2.default)({}, fieldName, tabFieldParameters[fieldName]));
262
464
  }
465
+ }
263
466
 
264
- return obj;
265
- }, {}));
467
+ return _context7.abrupt("return", results);
266
468
 
267
- case 17:
469
+ case 7:
268
470
  case "end":
269
- return _context3.stop();
471
+ return _context7.stop();
270
472
  }
271
473
  }
272
- }, _callee2);
474
+ }, _callee7);
273
475
  }));
274
476
 
275
- return function serialize(_x, _x2, _x3) {
276
- return _ref.apply(this, arguments);
477
+ return function serializeTabField(_x18, _x19, _x20) {
478
+ return _ref8.apply(this, arguments);
277
479
  };
278
480
  }();
279
481
 
280
- exports.serialize = serialize;
482
+ var serializeMergeDuplicateFieldData = function serializeMergeDuplicateFieldData(parameters, formData, flattenedFields) {
483
+ // Weed out all the non-duplicate field names
484
+ var allDuplicateFieldNames = Object.keys(formData).filter(function (key) {
485
+ return (0, _utils.isDuplicateField)(key);
486
+ });
487
+ return flattenedFields.reduce(function (newParams, field) {
488
+ var paramValue = parameters[field.name];
489
+
490
+ if (!field.allowDuplicates && paramValue !== undefined) {
491
+ newParams[field.name] = paramValue;
492
+ } else {
493
+ // extract the given duplicate values through the field
494
+ var duplicateValues = allDuplicateFieldNames.filter(function (name) {
495
+ return (0, _utils.getNameFromDuplicateField)(name) === field.name;
496
+ }).map(function (duplicateFieldName) {
497
+ return extract(formData[duplicateFieldName], field, {
498
+ useDefaultValue: true
499
+ });
500
+ }); // Merge and ensure that all values are worth serializing
501
+
502
+ var mergedValues = [paramValue].concat((0, _toConsumableArray2.default)(duplicateValues)).filter(function (value) {
503
+ return value !== undefined;
504
+ });
505
+
506
+ if (mergedValues.length > 0) {
507
+ // Replace so the duplicate field values are saved under the
508
+ // fieldName as an array
509
+ newParams[field.name] = mergedValues;
510
+ }
511
+ }
512
+
513
+ return newParams;
514
+ }, {});
515
+ };
281
516
 
282
517
  function injectDefaultValues(data, fields) {
283
518
  var copy = (0, _toConsumableArray2.default)(convertToParametersArray(data));
@@ -286,7 +521,7 @@ function injectDefaultValues(data, fields) {
286
521
  _step;
287
522
 
288
523
  try {
289
- var _loop2 = function _loop2() {
524
+ var _loop = function _loop() {
290
525
  var field = _step.value;
291
526
  var name = field.name;
292
527
  var fieldIndex = copy.findIndex(function (item) {
@@ -314,9 +549,9 @@ function injectDefaultValues(data, fields) {
314
549
  };
315
550
 
316
551
  for (_iterator.s(); !(_step = _iterator.n()).done;) {
317
- var _ret2 = _loop2();
552
+ var _ret = _loop();
318
553
 
319
- if (_ret2 === "continue") continue;
554
+ if (_ret === "continue") continue;
320
555
  }
321
556
  } catch (err) {
322
557
  _iterator.e(err);
@@ -324,200 +559,207 @@ function injectDefaultValues(data, fields) {
324
559
  _iterator.f();
325
560
  }
326
561
 
327
- if (doParametersContainDuplicateFields(copy)) {
328
- return copy;
329
- }
330
-
331
562
  return convertToParametersObject(copy);
332
563
  }
564
+ /**
565
+ * Flattens the given FieldDefinition[] so it resembles the expected data
566
+ * structure in result Parameters.
567
+ */
568
+
569
+
570
+ var flattenFields = function flattenFields(fields) {
571
+ var flattenAccumulator = function flattenAccumulator(accumulator, field) {
572
+ if ((0, _extensions.isTabGroup)(field)) {
573
+ if (field.hasGroupedValues) {
574
+ accumulator.push(field);
575
+ } else {
576
+ var flattenedTabs = field.fields.reduce(function (tabAccumulator, tab) {
577
+ return tabAccumulator.concat(tab.hasGroupedValues ? tab : tab.fields.reduce(flattenAccumulator, []));
578
+ }, []);
579
+ accumulator.push.apply(accumulator, (0, _toConsumableArray2.default)(flattenedTabs));
580
+ }
581
+ } else if ((0, _extensions.isExpand)(field)) {
582
+ if (field.hasGroupedValues) {
583
+ accumulator.push(field);
584
+ } else {
585
+ var flattenedExpand = field.fields.reduce(flattenAccumulator, []);
586
+ accumulator.push.apply(accumulator, (0, _toConsumableArray2.default)(flattenedExpand));
587
+ }
588
+ } else {
589
+ accumulator.push(field);
590
+ }
591
+
592
+ return accumulator;
593
+ };
594
+
595
+ return fields.reduce(flattenAccumulator, []);
596
+ };
333
597
 
334
598
  var deserialize = /*#__PURE__*/function () {
335
- var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(manifest, data, fields) {
599
+ var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(manifest, data, fields) {
336
600
  var depth,
337
601
  dataArray,
338
602
  result,
339
603
  errors,
604
+ flattenedFields,
340
605
  _iterator2,
341
606
  _step2,
342
- _loop3,
343
- _ret3,
344
- _args5 = arguments;
607
+ _loop2,
608
+ _ret2,
609
+ _args9 = arguments;
345
610
 
346
- return _regenerator.default.wrap(function _callee3$(_context5) {
611
+ return _regenerator.default.wrap(function _callee8$(_context9) {
347
612
  while (1) {
348
- switch (_context5.prev = _context5.next) {
613
+ switch (_context9.prev = _context9.next) {
349
614
  case 0:
350
- depth = _args5.length > 3 && _args5[3] !== undefined ? _args5[3] : 0;
615
+ depth = _args9.length > 3 && _args9[3] !== undefined ? _args9[3] : 0;
351
616
  dataArray = convertToParametersArray(data);
352
617
  result = [];
353
618
  errors = [];
619
+ flattenedFields = flattenFields(fields);
354
620
  _iterator2 = _createForOfIteratorHelper(dataArray);
355
- _context5.prev = 5;
356
- _loop3 = /*#__PURE__*/_regenerator.default.mark(function _loop3() {
621
+ _context9.prev = 6;
622
+ _loop2 = /*#__PURE__*/_regenerator.default.mark(function _loop2() {
357
623
  var item, _Object$entries$, name, originalValue, field, value, fieldDeserializer;
358
624
 
359
- return _regenerator.default.wrap(function _loop3$(_context4) {
625
+ return _regenerator.default.wrap(function _loop2$(_context8) {
360
626
  while (1) {
361
- switch (_context4.prev = _context4.next) {
627
+ switch (_context8.prev = _context8.next) {
362
628
  case 0:
363
629
  item = _step2.value;
364
630
  _Object$entries$ = (0, _slicedToArray2.default)(Object.entries(item)[0], 2), name = _Object$entries$[0], originalValue = _Object$entries$[1];
365
- field = fields.find(function (field) {
631
+ field = flattenedFields.find(function (field) {
366
632
  return field.name === (0, _utils.getNameFromDuplicateField)(name);
367
633
  });
368
634
 
369
635
  if (!(field === undefined)) {
370
- _context4.next = 5;
636
+ _context8.next = 5;
371
637
  break;
372
638
  }
373
639
 
374
- return _context4.abrupt("return", "continue");
640
+ return _context8.abrupt("return", "continue");
375
641
 
376
642
  case 5:
377
643
  value = extract(originalValue, field);
378
644
 
379
645
  if (!(value === undefined)) {
380
- _context4.next = 8;
646
+ _context8.next = 8;
381
647
  break;
382
648
  }
383
649
 
384
- return _context4.abrupt("return", "continue");
650
+ return _context8.abrupt("return", "continue");
385
651
 
386
652
  case 8:
387
653
  if (!((0, _extensions.isFieldset)(field) && depth === 0)) {
388
- _context4.next = 24;
654
+ _context8.next = 24;
389
655
  break;
390
656
  }
391
657
 
392
- _context4.next = 11;
658
+ _context8.next = 11;
393
659
  return (0, _extensions.getFieldDeserializer)(manifest, field.options.transformer);
394
660
 
395
661
  case 11:
396
- fieldDeserializer = _context4.sent;
662
+ fieldDeserializer = _context8.sent;
397
663
 
398
664
  if (!fieldDeserializer) {
399
- _context4.next = 24;
665
+ _context8.next = 24;
400
666
  break;
401
667
  }
402
668
 
403
- _context4.prev = 13;
669
+ _context8.prev = 13;
404
670
  value = fieldDeserializer(value);
405
- _context4.next = 21;
671
+ _context8.next = 21;
406
672
  break;
407
673
 
408
674
  case 17:
409
- _context4.prev = 17;
410
- _context4.t0 = _context4["catch"](13);
411
- errors.push((0, _defineProperty2.default)({}, name, _context4.t0.message));
412
- return _context4.abrupt("return", "continue");
675
+ _context8.prev = 17;
676
+ _context8.t0 = _context8["catch"](13);
677
+ errors.push((0, _defineProperty2.default)({}, name, _context8.t0.message));
678
+ return _context8.abrupt("return", "continue");
413
679
 
414
680
  case 21:
415
- _context4.next = 23;
681
+ _context8.next = 23;
416
682
  return deserialize(manifest, value, field.fields, depth + 1);
417
683
 
418
684
  case 23:
419
- value = _context4.sent;
685
+ value = _context8.sent;
420
686
 
421
687
  case 24:
422
688
  result.push((0, _defineProperty2.default)({}, name, value));
423
689
 
424
690
  case 25:
425
691
  case "end":
426
- return _context4.stop();
692
+ return _context8.stop();
427
693
  }
428
694
  }
429
- }, _loop3, null, [[13, 17]]);
695
+ }, _loop2, null, [[13, 17]]);
430
696
  });
431
697
 
432
698
  _iterator2.s();
433
699
 
434
- case 8:
700
+ case 9:
435
701
  if ((_step2 = _iterator2.n()).done) {
436
- _context5.next = 15;
702
+ _context9.next = 16;
437
703
  break;
438
704
  }
439
705
 
440
- return _context5.delegateYield(_loop3(), "t0", 10);
706
+ return _context9.delegateYield(_loop2(), "t0", 11);
441
707
 
442
- case 10:
443
- _ret3 = _context5.t0;
708
+ case 11:
709
+ _ret2 = _context9.t0;
444
710
 
445
- if (!(_ret3 === "continue")) {
446
- _context5.next = 13;
711
+ if (!(_ret2 === "continue")) {
712
+ _context9.next = 14;
447
713
  break;
448
714
  }
449
715
 
450
- return _context5.abrupt("continue", 13);
716
+ return _context9.abrupt("continue", 14);
451
717
 
452
- case 13:
453
- _context5.next = 8;
718
+ case 14:
719
+ _context9.next = 9;
454
720
  break;
455
721
 
456
- case 15:
457
- _context5.next = 20;
722
+ case 16:
723
+ _context9.next = 21;
458
724
  break;
459
725
 
460
- case 17:
461
- _context5.prev = 17;
462
- _context5.t1 = _context5["catch"](5);
726
+ case 18:
727
+ _context9.prev = 18;
728
+ _context9.t1 = _context9["catch"](6);
463
729
 
464
- _iterator2.e(_context5.t1);
730
+ _iterator2.e(_context9.t1);
465
731
 
466
- case 20:
467
- _context5.prev = 20;
732
+ case 21:
733
+ _context9.prev = 21;
468
734
 
469
735
  _iterator2.f();
470
736
 
471
- return _context5.finish(20);
737
+ return _context9.finish(21);
472
738
 
473
- case 23:
739
+ case 24:
474
740
  result = convertToParametersObject(result);
475
741
 
476
742
  if (errors.length > 0) {
477
743
  result.errors = convertToParametersObject(errors);
478
744
  }
479
745
 
480
- return _context5.abrupt("return", injectDefaultValues(result, fields));
746
+ return _context9.abrupt("return", injectDefaultValues(result, flattenedFields));
481
747
 
482
- case 26:
748
+ case 27:
483
749
  case "end":
484
- return _context5.stop();
750
+ return _context9.stop();
485
751
  }
486
752
  }
487
- }, _callee3, null, [[5, 17, 20, 23]]);
753
+ }, _callee8, null, [[6, 18, 21, 24]]);
488
754
  }));
489
755
 
490
- return function deserialize(_x6, _x7, _x8) {
491
- return _ref3.apply(this, arguments);
756
+ return function deserialize(_x21, _x22, _x23) {
757
+ return _ref9.apply(this, arguments);
492
758
  };
493
759
  }();
494
760
 
495
761
  exports.deserialize = deserialize;
496
762
 
497
- var doParametersContainDuplicateFields = function doParametersContainDuplicateFields(parameters) {
498
- var keyMap = new Set();
499
-
500
- var _iterator3 = _createForOfIteratorHelper(parameters),
501
- _step3;
502
-
503
- try {
504
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
505
- var param = _step3.value;
506
- var key = Object.keys(param)[0];
507
-
508
- if (keyMap.has(key)) {
509
- return true;
510
- }
511
-
512
- keyMap.add(key);
513
- }
514
- } catch (err) {
515
- _iterator3.e(err);
516
- } finally {
517
- _iterator3.f();
518
- }
519
- };
520
-
521
763
  var convertToParametersObject = function convertToParametersObject() {
522
764
  var parameters = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
523
765
 
@@ -526,17 +768,17 @@ var convertToParametersObject = function convertToParametersObject() {
526
768
  }
527
769
 
528
770
  return parameters.reduce(function (obj, current) {
529
- for (var key in current) {
771
+ for (var _key2 in current) {
530
772
  var keys = Object.keys(obj);
531
- var resultKey = key;
773
+ var resultKey = _key2;
532
774
  var idx = 1;
533
775
 
534
776
  while (keys.indexOf(resultKey) >= 0) {
535
- resultKey = "".concat((0, _utils.getNameFromDuplicateField)(key), ":").concat(idx);
777
+ resultKey = "".concat((0, _utils.getNameFromDuplicateField)(_key2), ":").concat(idx);
536
778
  idx++;
537
779
  }
538
780
 
539
- obj[resultKey] = current[key];
781
+ obj[resultKey] = current[_key2];
540
782
  }
541
783
 
542
784
  return obj;