@atlaskit/editor-core 182.1.2 → 182.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/cjs/actions/index.js +90 -98
- package/dist/cjs/create-editor/ErrorBoundary.js +86 -93
- package/dist/cjs/create-editor/ReactEditorViewInternal.js +8 -6
- package/dist/cjs/editor-next/index.js +5 -6
- package/dist/cjs/editor-next/utils/sendDurationAnalytics.js +34 -37
- package/dist/cjs/editor-next/utils/trackEditorActions.js +48 -51
- package/dist/cjs/editor.js +29 -34
- package/dist/cjs/i18n/cs.js +34 -6
- package/dist/cjs/i18n/da.js +34 -6
- package/dist/cjs/i18n/de.js +34 -7
- package/dist/cjs/i18n/en.js +31 -4
- package/dist/cjs/i18n/en_GB.js +34 -7
- package/dist/cjs/i18n/en_ZZ.js +35 -8
- package/dist/cjs/i18n/es.js +33 -6
- package/dist/cjs/i18n/fi.js +33 -6
- package/dist/cjs/i18n/fr.js +34 -7
- package/dist/cjs/i18n/hu.js +33 -6
- package/dist/cjs/i18n/it.js +34 -7
- package/dist/cjs/i18n/ja.js +33 -6
- package/dist/cjs/i18n/ko.js +33 -6
- package/dist/cjs/i18n/nb.js +35 -8
- package/dist/cjs/i18n/nl.js +34 -7
- package/dist/cjs/i18n/pl.js +34 -7
- package/dist/cjs/i18n/pt_BR.js +34 -7
- package/dist/cjs/i18n/ru.js +34 -7
- package/dist/cjs/i18n/sv.js +33 -6
- package/dist/cjs/i18n/th.js +34 -7
- package/dist/cjs/i18n/tr.js +33 -6
- package/dist/cjs/i18n/uk.js +34 -7
- package/dist/cjs/i18n/vi.js +35 -8
- package/dist/cjs/i18n/zh.js +33 -4
- package/dist/cjs/i18n/zh_TW.js +33 -6
- package/dist/cjs/labs/CollapsedEditor/index.js +1 -1
- package/dist/cjs/plugins/analytics/plugin.js +1 -1
- package/dist/cjs/plugins/annotation/pm-plugins/inline-comment.js +39 -44
- package/dist/cjs/plugins/annotation/pm-plugins/types.js +4 -4
- package/dist/cjs/plugins/annotation/types.js +4 -4
- package/dist/cjs/plugins/base/pm-plugins/decoration.js +4 -4
- package/dist/cjs/plugins/block-type/commands/block-type.js +1 -1
- package/dist/cjs/plugins/card/nodeviews/embedCard.js +5 -6
- package/dist/cjs/plugins/card/ui/EditLinkToolbar.js +3 -4
- package/dist/cjs/plugins/card/ui/EditorSmartCardEventsNext.js +16 -1
- package/dist/cjs/plugins/collab-edit/index.js +29 -32
- package/dist/cjs/plugins/collab-edit/plugin-state.js +2 -4
- package/dist/cjs/plugins/custom-autoformat/doc.js +28 -31
- package/dist/cjs/plugins/custom-autoformat/index.js +20 -23
- package/dist/cjs/plugins/date/index.js +1 -1
- package/dist/cjs/plugins/date/ui/DatePicker/date-picker-input.js +7 -10
- package/dist/cjs/plugins/date/utils/internal.js +1 -1
- package/dist/cjs/plugins/emoji/pm-plugins/ascii-input-rules.js +27 -28
- package/dist/cjs/plugins/extension/actions.js +36 -39
- package/dist/cjs/plugins/extension/context-panel.js +123 -130
- package/dist/cjs/plugins/extension/pm-plugins/main.js +82 -89
- package/dist/cjs/plugins/extension/pm-plugins/utils.js +46 -51
- package/dist/cjs/plugins/extension/ui/Extension/ExtensionComponent.js +44 -48
- package/dist/cjs/plugins/feedback-dialog/index.js +52 -57
- package/dist/cjs/plugins/feedback-dialog/loadJiraCollectorDialogScript.js +44 -47
- package/dist/cjs/plugins/find-replace/actions.js +4 -4
- package/dist/cjs/plugins/find-replace/utils/batch-decorations.js +144 -153
- package/dist/cjs/plugins/find-replace/utils/index.js +2 -2
- package/dist/cjs/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +40 -46
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +2 -1
- package/dist/cjs/plugins/floating-toolbar/ui/ToolbarLoader.js +2 -1
- package/dist/cjs/plugins/fragment/pm-plugins/fragment-consistency.js +86 -86
- package/dist/cjs/plugins/help-dialog/ui/HelpDialogLoader.js +2 -1
- package/dist/cjs/plugins/history/actions.js +4 -4
- package/dist/cjs/plugins/hyperlink/HyperlinkToolbarAppearance.js +76 -82
- package/dist/cjs/plugins/hyperlink/pm-plugins/input-rule.js +3 -0
- package/dist/cjs/plugins/hyperlink/pm-plugins/main.js +16 -16
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +339 -352
- package/dist/cjs/plugins/hyperlink/utils.js +3 -0
- package/dist/cjs/plugins/image-upload/pm-plugins/main.js +24 -27
- package/dist/cjs/plugins/list/utils/node.js +4 -4
- package/dist/cjs/plugins/macro/actions.js +107 -112
- package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +43 -46
- package/dist/cjs/plugins/media/nodeviews/mediaInline.js +62 -66
- package/dist/cjs/plugins/media/nodeviews/mediaNodeUpdater.js +544 -575
- package/dist/cjs/plugins/media/nodeviews/mediaNodeView/media.js +38 -42
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +108 -113
- package/dist/cjs/plugins/media/picker-facade.js +22 -25
- package/dist/cjs/plugins/media/pm-plugins/linking/actions.js +4 -4
- package/dist/cjs/plugins/media/pm-plugins/main.js +159 -172
- package/dist/cjs/plugins/media/pm-plugins/mediaTaskManager.js +36 -39
- package/dist/cjs/plugins/media/toolbar/utils.js +30 -33
- package/dist/cjs/plugins/media/ui/MediaPicker/PickerFacadeProvider.js +71 -74
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +52 -57
- package/dist/cjs/plugins/media/utils/check-media-type.js +37 -40
- package/dist/cjs/plugins/mentions/nodeviews/mention.js +29 -31
- package/dist/cjs/plugins/mentions/type-ahead/index.js +1 -1
- package/dist/cjs/plugins/mobile-dimensions/actions.js +4 -4
- package/dist/cjs/plugins/paste/actions.js +4 -4
- package/dist/cjs/plugins/paste/handlers.js +23 -26
- package/dist/cjs/plugins/paste/linkify-md-plugin.js +3 -0
- package/dist/cjs/plugins/paste/md.js +3 -0
- package/dist/cjs/plugins/paste/newline-md-plugin.js +3 -0
- package/dist/cjs/plugins/paste/paragraph-md-plugin.js +3 -0
- package/dist/cjs/plugins/paste/pm-plugins/main.js +25 -27
- package/dist/cjs/plugins/quick-insert/assets/index.js +63 -39
- package/dist/cjs/plugins/quick-insert/index.js +30 -33
- package/dist/cjs/plugins/selection/actions.js +4 -4
- package/dist/cjs/plugins/selection/gap-cursor/direction.js +4 -4
- package/dist/cjs/plugins/selection/types.js +4 -4
- package/dist/cjs/plugins/status/ui/statusPicker.js +7 -8
- package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +9 -10
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/commands.js +16 -6
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/keymaps.js +12 -20
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/main.js +3 -3
- package/dist/cjs/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.js +41 -42
- package/dist/cjs/plugins/tasks-and-decisions/utils.js +31 -2
- package/dist/cjs/plugins/text-color/pm-plugins/main.js +4 -4
- package/dist/cjs/plugins/text-formatting/pm-plugins/input-rule.js +3 -3
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/types.js +4 -4
- package/dist/cjs/plugins/type-ahead/constants.js +4 -4
- package/dist/cjs/plugins/type-ahead/pm-plugins/actions.js +4 -4
- package/dist/cjs/plugins/undo-redo/enums.js +4 -4
- package/dist/cjs/ui/Appearance/Comment/Comment.js +3 -3
- package/dist/cjs/ui/Appearance/FullPage/FullPage.js +1 -2
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +2 -1
- package/dist/cjs/ui/ColorPickerButton/index.js +3 -2
- package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +68 -73
- package/dist/cjs/ui/ConfigPanel/ConfigPanelLoader.js +2 -1
- package/dist/cjs/ui/ConfigPanel/Fields/CustomSelect.js +54 -56
- package/dist/cjs/ui/ConfigPanel/Fields/UserSelect.js +51 -55
- package/dist/cjs/ui/ConfigPanel/FormErrorBoundary.js +24 -27
- package/dist/cjs/ui/ConfigPanel/transformers.js +344 -363
- package/dist/cjs/ui/ConfigPanel/types.js +8 -8
- package/dist/cjs/ui/Dropdown/index.js +2 -1
- package/dist/cjs/ui/DropdownMenu/index.js +2 -1
- package/dist/cjs/ui/ElementBrowser/components/ElementBrowserLoader.js +1 -1
- package/dist/cjs/ui/ElementBrowser/hooks/use-select-and-focus-on-arrow-navigation.js +4 -4
- package/dist/cjs/ui/ElementBrowser/types.js +4 -4
- package/dist/cjs/ui/LinkSearch/index.js +94 -101
- package/dist/cjs/ui/ToolbarArrowKeyNavigationProvider/index.js +19 -2
- package/dist/cjs/ui/ToolbarFeedback/index.js +27 -31
- package/dist/cjs/utils/action.js +31 -36
- package/dist/cjs/utils/clipboard.js +82 -86
- package/dist/cjs/utils/deprecation-warnings.js +1 -1
- package/dist/cjs/utils/extensions.js +62 -67
- package/dist/cjs/utils/insert.js +4 -4
- package/dist/cjs/utils/mark.js +2 -2
- package/dist/cjs/utils/performance/simple-measure-to-entries.js +1 -2
- package/dist/cjs/utils/performance/track-transactions.js +3 -2
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +8 -9
- package/dist/es2019/create-editor/ReactEditorViewInternal.js +5 -3
- package/dist/es2019/editor-next/index.js +5 -6
- package/dist/es2019/editor.js +29 -36
- package/dist/es2019/i18n/cs.js +34 -6
- package/dist/es2019/i18n/da.js +34 -6
- package/dist/es2019/i18n/de.js +34 -7
- package/dist/es2019/i18n/en.js +31 -4
- package/dist/es2019/i18n/en_GB.js +34 -7
- package/dist/es2019/i18n/en_ZZ.js +35 -8
- package/dist/es2019/i18n/es.js +33 -6
- package/dist/es2019/i18n/fi.js +33 -6
- package/dist/es2019/i18n/fr.js +34 -7
- package/dist/es2019/i18n/hu.js +33 -6
- package/dist/es2019/i18n/it.js +34 -7
- package/dist/es2019/i18n/ja.js +33 -6
- package/dist/es2019/i18n/ko.js +33 -6
- package/dist/es2019/i18n/nb.js +35 -8
- package/dist/es2019/i18n/nl.js +34 -7
- package/dist/es2019/i18n/pl.js +34 -7
- package/dist/es2019/i18n/pt_BR.js +34 -7
- package/dist/es2019/i18n/ru.js +34 -7
- package/dist/es2019/i18n/sv.js +33 -6
- package/dist/es2019/i18n/th.js +34 -7
- package/dist/es2019/i18n/tr.js +33 -6
- package/dist/es2019/i18n/uk.js +34 -7
- package/dist/es2019/i18n/vi.js +35 -8
- package/dist/es2019/i18n/zh.js +33 -4
- package/dist/es2019/i18n/zh_TW.js +33 -6
- package/dist/es2019/plugins/annotation/pm-plugins/types.js +3 -3
- package/dist/es2019/plugins/annotation/types.js +3 -3
- package/dist/es2019/plugins/base/pm-plugins/decoration.js +3 -3
- package/dist/es2019/plugins/card/nodeviews/embedCard.js +5 -7
- package/dist/es2019/plugins/card/ui/EditLinkToolbar.js +3 -5
- package/dist/es2019/plugins/card/ui/EditorSmartCardEventsNext.js +17 -2
- package/dist/es2019/plugins/collab-edit/plugin-state.js +1 -2
- package/dist/es2019/plugins/date/ui/DatePicker/date-picker-input.js +7 -11
- package/dist/es2019/plugins/emoji/pm-plugins/ascii-input-rules.js +27 -28
- package/dist/es2019/plugins/extension/ui/Extension/ExtensionComponent.js +8 -12
- package/dist/es2019/plugins/find-replace/actions.js +3 -3
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +2 -1
- package/dist/es2019/plugins/fragment/pm-plugins/fragment-consistency.js +56 -71
- package/dist/es2019/plugins/history/actions.js +3 -3
- package/dist/es2019/plugins/hyperlink/pm-plugins/input-rule.js +3 -0
- package/dist/es2019/plugins/hyperlink/pm-plugins/main.js +6 -6
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -2
- package/dist/es2019/plugins/hyperlink/utils.js +3 -0
- package/dist/es2019/plugins/list/utils/node.js +3 -3
- package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +4 -8
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +2 -3
- package/dist/es2019/plugins/media/pm-plugins/linking/actions.js +3 -3
- package/dist/es2019/plugins/media/pm-plugins/main.js +22 -31
- package/dist/es2019/plugins/mobile-dimensions/actions.js +3 -3
- package/dist/es2019/plugins/paste/actions.js +3 -3
- package/dist/es2019/plugins/paste/linkify-md-plugin.js +3 -0
- package/dist/es2019/plugins/paste/md.js +3 -0
- package/dist/es2019/plugins/paste/newline-md-plugin.js +3 -0
- package/dist/es2019/plugins/paste/paragraph-md-plugin.js +3 -0
- package/dist/es2019/plugins/selection/actions.js +3 -3
- package/dist/es2019/plugins/selection/gap-cursor/direction.js +3 -3
- package/dist/es2019/plugins/selection/types.js +3 -3
- package/dist/es2019/plugins/status/ui/statusPicker.js +6 -7
- package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +9 -11
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/commands.js +15 -3
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/keymaps.js +6 -16
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/main.js +3 -3
- package/dist/es2019/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.js +6 -5
- package/dist/es2019/plugins/tasks-and-decisions/utils.js +30 -0
- package/dist/es2019/plugins/text-color/pm-plugins/main.js +3 -3
- package/dist/es2019/plugins/text-formatting/pm-plugins/input-rule.js +3 -3
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/types.js +3 -3
- package/dist/es2019/plugins/type-ahead/constants.js +3 -3
- package/dist/es2019/plugins/type-ahead/pm-plugins/actions.js +3 -3
- package/dist/es2019/plugins/undo-redo/enums.js +3 -3
- package/dist/es2019/ui/Appearance/Comment/Comment.js +3 -3
- package/dist/es2019/ui/Appearance/FullPage/FullPage.js +1 -2
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +2 -1
- package/dist/es2019/ui/ColorPickerButton/index.js +5 -3
- package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +3 -4
- package/dist/es2019/ui/ConfigPanel/types.js +6 -6
- package/dist/es2019/ui/ElementBrowser/hooks/use-select-and-focus-on-arrow-navigation.js +3 -3
- package/dist/es2019/ui/ElementBrowser/types.js +3 -3
- package/dist/es2019/ui/ToolbarArrowKeyNavigationProvider/index.js +18 -2
- package/dist/es2019/ui/ToolbarFeedback/index.js +1 -3
- package/dist/es2019/utils/insert.js +3 -3
- package/dist/es2019/utils/performance/simple-measure-to-entries.js +1 -1
- package/dist/es2019/utils/performance/track-transactions.js +3 -2
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +90 -98
- package/dist/esm/create-editor/ErrorBoundary.js +86 -93
- package/dist/esm/create-editor/ReactEditorViewInternal.js +6 -5
- package/dist/esm/editor-next/index.js +5 -6
- package/dist/esm/editor-next/utils/sendDurationAnalytics.js +34 -37
- package/dist/esm/editor-next/utils/trackEditorActions.js +48 -51
- package/dist/esm/editor.js +29 -34
- package/dist/esm/i18n/cs.js +34 -6
- package/dist/esm/i18n/da.js +34 -6
- package/dist/esm/i18n/de.js +34 -7
- package/dist/esm/i18n/en.js +31 -4
- package/dist/esm/i18n/en_GB.js +34 -7
- package/dist/esm/i18n/en_ZZ.js +35 -8
- package/dist/esm/i18n/es.js +33 -6
- package/dist/esm/i18n/fi.js +33 -6
- package/dist/esm/i18n/fr.js +34 -7
- package/dist/esm/i18n/hu.js +33 -6
- package/dist/esm/i18n/it.js +34 -7
- package/dist/esm/i18n/ja.js +33 -6
- package/dist/esm/i18n/ko.js +33 -6
- package/dist/esm/i18n/nb.js +35 -8
- package/dist/esm/i18n/nl.js +34 -7
- package/dist/esm/i18n/pl.js +34 -7
- package/dist/esm/i18n/pt_BR.js +34 -7
- package/dist/esm/i18n/ru.js +34 -7
- package/dist/esm/i18n/sv.js +33 -6
- package/dist/esm/i18n/th.js +34 -7
- package/dist/esm/i18n/tr.js +33 -6
- package/dist/esm/i18n/uk.js +34 -7
- package/dist/esm/i18n/vi.js +35 -8
- package/dist/esm/i18n/zh.js +33 -4
- package/dist/esm/i18n/zh_TW.js +33 -6
- package/dist/esm/plugins/analytics/plugin.js +1 -1
- package/dist/esm/plugins/annotation/pm-plugins/inline-comment.js +39 -44
- package/dist/esm/plugins/annotation/pm-plugins/types.js +3 -3
- package/dist/esm/plugins/annotation/types.js +3 -3
- package/dist/esm/plugins/base/pm-plugins/decoration.js +3 -3
- package/dist/esm/plugins/block-type/commands/block-type.js +1 -1
- package/dist/esm/plugins/card/nodeviews/embedCard.js +5 -6
- package/dist/esm/plugins/card/ui/EditLinkToolbar.js +3 -4
- package/dist/esm/plugins/card/ui/EditorSmartCardEventsNext.js +17 -2
- package/dist/esm/plugins/collab-edit/index.js +29 -32
- package/dist/esm/plugins/collab-edit/plugin-state.js +2 -4
- package/dist/esm/plugins/custom-autoformat/doc.js +28 -31
- package/dist/esm/plugins/custom-autoformat/index.js +20 -23
- package/dist/esm/plugins/date/ui/DatePicker/date-picker-input.js +7 -10
- package/dist/esm/plugins/date/utils/internal.js +1 -1
- package/dist/esm/plugins/emoji/pm-plugins/ascii-input-rules.js +27 -28
- package/dist/esm/plugins/extension/actions.js +36 -39
- package/dist/esm/plugins/extension/context-panel.js +123 -129
- package/dist/esm/plugins/extension/pm-plugins/main.js +82 -88
- package/dist/esm/plugins/extension/pm-plugins/utils.js +46 -51
- package/dist/esm/plugins/extension/ui/Extension/ExtensionComponent.js +44 -49
- package/dist/esm/plugins/feedback-dialog/index.js +52 -57
- package/dist/esm/plugins/feedback-dialog/loadJiraCollectorDialogScript.js +44 -47
- package/dist/esm/plugins/find-replace/actions.js +3 -3
- package/dist/esm/plugins/find-replace/utils/batch-decorations.js +144 -153
- package/dist/esm/plugins/find-replace/utils/index.js +2 -2
- package/dist/esm/plugins/floating-toolbar/ui/ExtensionsPlaceholder.js +40 -47
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +2 -1
- package/dist/esm/plugins/fragment/pm-plugins/fragment-consistency.js +78 -76
- package/dist/esm/plugins/history/actions.js +3 -3
- package/dist/esm/plugins/hyperlink/HyperlinkToolbarAppearance.js +76 -83
- package/dist/esm/plugins/hyperlink/pm-plugins/input-rule.js +3 -0
- package/dist/esm/plugins/hyperlink/pm-plugins/main.js +14 -14
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +339 -353
- package/dist/esm/plugins/hyperlink/utils.js +3 -0
- package/dist/esm/plugins/image-upload/pm-plugins/main.js +24 -27
- package/dist/esm/plugins/list/utils/node.js +3 -3
- package/dist/esm/plugins/macro/actions.js +107 -112
- package/dist/esm/plugins/media/nodeviews/mediaGroup.js +43 -46
- package/dist/esm/plugins/media/nodeviews/mediaInline.js +62 -67
- package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +544 -575
- package/dist/esm/plugins/media/nodeviews/mediaNodeView/media.js +38 -43
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +108 -114
- package/dist/esm/plugins/media/picker-facade.js +22 -25
- package/dist/esm/plugins/media/pm-plugins/linking/actions.js +3 -3
- package/dist/esm/plugins/media/pm-plugins/main.js +159 -173
- package/dist/esm/plugins/media/pm-plugins/mediaTaskManager.js +36 -39
- package/dist/esm/plugins/media/toolbar/utils.js +30 -33
- package/dist/esm/plugins/media/ui/MediaPicker/PickerFacadeProvider.js +71 -74
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +52 -57
- package/dist/esm/plugins/media/utils/check-media-type.js +37 -40
- package/dist/esm/plugins/mentions/nodeviews/mention.js +29 -32
- package/dist/esm/plugins/mentions/type-ahead/index.js +1 -1
- package/dist/esm/plugins/mobile-dimensions/actions.js +3 -3
- package/dist/esm/plugins/paste/actions.js +3 -3
- package/dist/esm/plugins/paste/handlers.js +23 -26
- package/dist/esm/plugins/paste/linkify-md-plugin.js +3 -0
- package/dist/esm/plugins/paste/md.js +3 -0
- package/dist/esm/plugins/paste/newline-md-plugin.js +3 -0
- package/dist/esm/plugins/paste/paragraph-md-plugin.js +3 -0
- package/dist/esm/plugins/paste/pm-plugins/main.js +25 -28
- package/dist/esm/plugins/quick-insert/index.js +30 -33
- package/dist/esm/plugins/selection/actions.js +3 -3
- package/dist/esm/plugins/selection/gap-cursor/direction.js +3 -3
- package/dist/esm/plugins/selection/types.js +3 -3
- package/dist/esm/plugins/status/ui/statusPicker.js +6 -7
- package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +9 -10
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/commands.js +17 -7
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/keymaps.js +13 -21
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/main.js +3 -3
- package/dist/esm/plugins/tasks-and-decisions/ui/Task/task-item-with-providers.js +41 -43
- package/dist/esm/plugins/tasks-and-decisions/utils.js +28 -0
- package/dist/esm/plugins/text-color/pm-plugins/main.js +3 -3
- package/dist/esm/plugins/text-formatting/pm-plugins/input-rule.js +3 -3
- package/dist/esm/plugins/text-formatting/ui/Toolbar/types.js +3 -3
- package/dist/esm/plugins/type-ahead/constants.js +3 -3
- package/dist/esm/plugins/type-ahead/pm-plugins/actions.js +3 -3
- package/dist/esm/plugins/undo-redo/enums.js +3 -3
- package/dist/esm/ui/Appearance/Comment/Comment.js +3 -3
- package/dist/esm/ui/Appearance/FullPage/FullPage.js +1 -2
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +2 -1
- package/dist/esm/ui/ColorPickerButton/index.js +3 -2
- package/dist/esm/ui/ConfigPanel/ConfigPanel.js +68 -74
- package/dist/esm/ui/ConfigPanel/Fields/CustomSelect.js +54 -57
- package/dist/esm/ui/ConfigPanel/Fields/UserSelect.js +51 -56
- package/dist/esm/ui/ConfigPanel/FormErrorBoundary.js +24 -27
- package/dist/esm/ui/ConfigPanel/transformers.js +344 -362
- package/dist/esm/ui/ConfigPanel/types.js +6 -6
- package/dist/esm/ui/Dropdown/index.js +2 -1
- package/dist/esm/ui/DropdownMenu/index.js +2 -1
- package/dist/esm/ui/ElementBrowser/hooks/use-select-and-focus-on-arrow-navigation.js +3 -3
- package/dist/esm/ui/ElementBrowser/types.js +3 -3
- package/dist/esm/ui/LinkSearch/index.js +94 -101
- package/dist/esm/ui/ToolbarArrowKeyNavigationProvider/index.js +18 -2
- package/dist/esm/ui/ToolbarFeedback/index.js +27 -31
- package/dist/esm/utils/action.js +31 -36
- package/dist/esm/utils/clipboard.js +82 -87
- package/dist/esm/utils/deprecation-warnings.js +1 -1
- package/dist/esm/utils/extensions.js +62 -67
- package/dist/esm/utils/insert.js +3 -3
- package/dist/esm/utils/mark.js +2 -2
- package/dist/esm/utils/performance/simple-measure-to-entries.js +1 -2
- package/dist/esm/utils/performance/track-transactions.js +3 -2
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/create-editor/ReactEditorViewInternal.d.ts +1 -0
- package/dist/types/i18n/cs.d.ts +29 -2
- package/dist/types/i18n/da.d.ts +29 -2
- package/dist/types/i18n/de.d.ts +28 -2
- package/dist/types/i18n/en.d.ts +28 -2
- package/dist/types/i18n/en_GB.d.ts +31 -5
- package/dist/types/i18n/en_ZZ.d.ts +28 -2
- package/dist/types/i18n/es.d.ts +28 -2
- package/dist/types/i18n/fi.d.ts +28 -2
- package/dist/types/i18n/fr.d.ts +28 -2
- package/dist/types/i18n/hu.d.ts +28 -2
- package/dist/types/i18n/it.d.ts +28 -2
- package/dist/types/i18n/ja.d.ts +28 -2
- package/dist/types/i18n/ko.d.ts +28 -2
- package/dist/types/i18n/nb.d.ts +28 -2
- package/dist/types/i18n/nl.d.ts +28 -2
- package/dist/types/i18n/pl.d.ts +28 -2
- package/dist/types/i18n/pt_BR.d.ts +28 -2
- package/dist/types/i18n/ru.d.ts +28 -2
- package/dist/types/i18n/sv.d.ts +28 -2
- package/dist/types/i18n/th.d.ts +28 -2
- package/dist/types/i18n/tr.d.ts +28 -2
- package/dist/types/i18n/uk.d.ts +28 -2
- package/dist/types/i18n/vi.d.ts +28 -2
- package/dist/types/i18n/zh.d.ts +30 -2
- package/dist/types/i18n/zh_TW.d.ts +28 -2
- package/dist/types/plugins/tasks-and-decisions/utils.d.ts +2 -0
- package/dist/types/ui/ToolbarArrowKeyNavigationProvider/index.d.ts +3 -1
- package/dist/types/utils/document.d.ts +2 -2
- package/package.json +14 -14
- package/report.api.md +1 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof3 = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.serialize = exports.findDuplicateFields = exports.deserialize = void 0;
|
|
8
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
@@ -15,8 +15,7 @@ var _extensions = require("@atlaskit/editor-common/extensions");
|
|
|
15
15
|
var _utils = require("./utils");
|
|
16
16
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
17
17
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
18
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
19
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof3(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
18
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
20
19
|
var isOption = function isOption(option) {
|
|
21
20
|
return option && (0, _typeof2.default)(option) === 'object' && 'label' in option && 'value' in option;
|
|
22
21
|
};
|
|
@@ -68,7 +67,7 @@ var findDuplicateFieldsInternal = function findDuplicateFieldsInternal(fields) {
|
|
|
68
67
|
});
|
|
69
68
|
};
|
|
70
69
|
var serialize = /*#__PURE__*/function () {
|
|
71
|
-
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
70
|
+
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(manifest, data, fields) {
|
|
72
71
|
var options,
|
|
73
72
|
result,
|
|
74
73
|
_options$depth,
|
|
@@ -79,112 +78,108 @@ var serialize = /*#__PURE__*/function () {
|
|
|
79
78
|
parameters,
|
|
80
79
|
hasDuplicateFields,
|
|
81
80
|
_args2 = arguments;
|
|
82
|
-
return
|
|
83
|
-
while (1) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
var
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
_context.next = 7;
|
|
99
|
-
break;
|
|
100
|
-
}
|
|
101
|
-
_context.next = 3;
|
|
102
|
-
return serializeTabGroupField(manifest, field, data);
|
|
103
|
-
case 3:
|
|
104
|
-
tabGroupData = _context.sent;
|
|
105
|
-
result.push.apply(result, (0, _toConsumableArray2.default)(tabGroupData));
|
|
106
|
-
_context.next = 30;
|
|
107
|
-
break;
|
|
108
|
-
case 7:
|
|
109
|
-
if (!(0, _extensions.isTabField)(field)) {
|
|
110
|
-
_context.next = 14;
|
|
111
|
-
break;
|
|
112
|
-
}
|
|
113
|
-
_context.next = 10;
|
|
114
|
-
return serializeTabField(manifest, field, data);
|
|
115
|
-
case 10:
|
|
116
|
-
tabData = _context.sent;
|
|
117
|
-
result.push.apply(result, (0, _toConsumableArray2.default)(tabData));
|
|
118
|
-
_context.next = 30;
|
|
119
|
-
break;
|
|
120
|
-
case 14:
|
|
121
|
-
if (!(0, _extensions.isExpand)(field)) {
|
|
122
|
-
_context.next = 21;
|
|
123
|
-
break;
|
|
124
|
-
}
|
|
125
|
-
_context.next = 17;
|
|
126
|
-
return serializeExpandField(manifest, field, data);
|
|
127
|
-
case 17:
|
|
128
|
-
expandData = _context.sent;
|
|
129
|
-
result.push.apply(result, (0, _toConsumableArray2.default)(expandData));
|
|
130
|
-
_context.next = 30;
|
|
131
|
-
break;
|
|
132
|
-
case 21:
|
|
133
|
-
if (!((0, _extensions.isFieldset)(field) && depth === 0)) {
|
|
134
|
-
_context.next = 28;
|
|
135
|
-
break;
|
|
136
|
-
}
|
|
137
|
-
_context.next = 24;
|
|
138
|
-
return serializeFieldset(manifest, field, data, depth);
|
|
139
|
-
case 24:
|
|
140
|
-
fieldsetData = _context.sent;
|
|
141
|
-
if (fieldsetData) {
|
|
142
|
-
result.push(fieldsetData);
|
|
143
|
-
}
|
|
144
|
-
_context.next = 30;
|
|
145
|
-
break;
|
|
146
|
-
case 28:
|
|
147
|
-
value = extract(data[field.name], field, {
|
|
148
|
-
useDefaultValue: true
|
|
149
|
-
}); // ignore undefined values
|
|
150
|
-
if (value !== undefined) {
|
|
151
|
-
result.push((0, _defineProperty2.default)({}, field.name, value));
|
|
152
|
-
}
|
|
153
|
-
case 30:
|
|
154
|
-
case "end":
|
|
155
|
-
return _context.stop();
|
|
81
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
82
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
83
|
+
case 0:
|
|
84
|
+
options = _args2.length > 3 && _args2[3] !== undefined ? _args2[3] : {};
|
|
85
|
+
result = [];
|
|
86
|
+
_options$depth = options.depth, depth = _options$depth === void 0 ? 0 : _options$depth, parentType = options.parentType;
|
|
87
|
+
flattenedFields = flattenFields(fields);
|
|
88
|
+
fillResults = flattenedFields.map( /*#__PURE__*/function () {
|
|
89
|
+
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(field) {
|
|
90
|
+
var tabGroupData, tabData, expandData, fieldsetData, value;
|
|
91
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
92
|
+
while (1) switch (_context.prev = _context.next) {
|
|
93
|
+
case 0:
|
|
94
|
+
if (!(0, _extensions.isTabGroup)(field)) {
|
|
95
|
+
_context.next = 7;
|
|
96
|
+
break;
|
|
156
97
|
}
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
98
|
+
_context.next = 3;
|
|
99
|
+
return serializeTabGroupField(manifest, field, data);
|
|
100
|
+
case 3:
|
|
101
|
+
tabGroupData = _context.sent;
|
|
102
|
+
result.push.apply(result, (0, _toConsumableArray2.default)(tabGroupData));
|
|
103
|
+
_context.next = 30;
|
|
104
|
+
break;
|
|
105
|
+
case 7:
|
|
106
|
+
if (!(0, _extensions.isTabField)(field)) {
|
|
107
|
+
_context.next = 14;
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
_context.next = 10;
|
|
111
|
+
return serializeTabField(manifest, field, data);
|
|
112
|
+
case 10:
|
|
113
|
+
tabData = _context.sent;
|
|
114
|
+
result.push.apply(result, (0, _toConsumableArray2.default)(tabData));
|
|
115
|
+
_context.next = 30;
|
|
116
|
+
break;
|
|
117
|
+
case 14:
|
|
118
|
+
if (!(0, _extensions.isExpand)(field)) {
|
|
119
|
+
_context.next = 21;
|
|
120
|
+
break;
|
|
121
|
+
}
|
|
122
|
+
_context.next = 17;
|
|
123
|
+
return serializeExpandField(manifest, field, data);
|
|
124
|
+
case 17:
|
|
125
|
+
expandData = _context.sent;
|
|
126
|
+
result.push.apply(result, (0, _toConsumableArray2.default)(expandData));
|
|
127
|
+
_context.next = 30;
|
|
128
|
+
break;
|
|
129
|
+
case 21:
|
|
130
|
+
if (!((0, _extensions.isFieldset)(field) && depth === 0)) {
|
|
131
|
+
_context.next = 28;
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
134
|
+
_context.next = 24;
|
|
135
|
+
return serializeFieldset(manifest, field, data, depth);
|
|
136
|
+
case 24:
|
|
137
|
+
fieldsetData = _context.sent;
|
|
138
|
+
if (fieldsetData) {
|
|
139
|
+
result.push(fieldsetData);
|
|
140
|
+
}
|
|
141
|
+
_context.next = 30;
|
|
142
|
+
break;
|
|
143
|
+
case 28:
|
|
144
|
+
value = extract(data[field.name], field, {
|
|
145
|
+
useDefaultValue: true
|
|
146
|
+
}); // ignore undefined values
|
|
147
|
+
if (value !== undefined) {
|
|
148
|
+
result.push((0, _defineProperty2.default)({}, field.name, value));
|
|
149
|
+
}
|
|
150
|
+
case 30:
|
|
151
|
+
case "end":
|
|
152
|
+
return _context.stop();
|
|
153
|
+
}
|
|
154
|
+
}, _callee);
|
|
155
|
+
}));
|
|
156
|
+
return function (_x4) {
|
|
157
|
+
return _ref2.apply(this, arguments);
|
|
158
|
+
};
|
|
159
|
+
}());
|
|
160
|
+
_context2.next = 7;
|
|
161
|
+
return Promise.all(fillResults);
|
|
162
|
+
case 7:
|
|
163
|
+
// Crunch fields down to parameters
|
|
164
|
+
parameters = result.reduce(function (obj, current) {
|
|
165
|
+
for (var _key in current) {
|
|
166
|
+
obj[_key] = current[_key];
|
|
180
167
|
}
|
|
181
|
-
return
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
168
|
+
return obj;
|
|
169
|
+
}, {}); // Fix up duplicate values (currently only for fieldsets)
|
|
170
|
+
hasDuplicateFields = parentType === 'fieldset' && !!flattenedFields.find(function (field) {
|
|
171
|
+
return field.allowDuplicates;
|
|
172
|
+
});
|
|
173
|
+
if (!hasDuplicateFields) {
|
|
174
|
+
_context2.next = 11;
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
return _context2.abrupt("return", serializeMergeDuplicateFieldData(parameters, data, flattenedFields));
|
|
178
|
+
case 11:
|
|
179
|
+
return _context2.abrupt("return", parameters);
|
|
180
|
+
case 12:
|
|
181
|
+
case "end":
|
|
182
|
+
return _context2.stop();
|
|
188
183
|
}
|
|
189
184
|
}, _callee2);
|
|
190
185
|
}));
|
|
@@ -194,50 +189,48 @@ var serialize = /*#__PURE__*/function () {
|
|
|
194
189
|
}();
|
|
195
190
|
exports.serialize = serialize;
|
|
196
191
|
var serializeFieldset = /*#__PURE__*/function () {
|
|
197
|
-
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
192
|
+
var _ref3 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(manifest, field, data, depth) {
|
|
198
193
|
var fieldSerializer, fieldsetFields, fieldParams, extracted;
|
|
199
|
-
return
|
|
200
|
-
while (1) {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
194
|
+
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
195
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
196
|
+
case 0:
|
|
197
|
+
_context3.prev = 0;
|
|
198
|
+
_context3.next = 3;
|
|
199
|
+
return (0, _extensions.getFieldSerializer)(manifest, field.options.transformer);
|
|
200
|
+
case 3:
|
|
201
|
+
fieldSerializer = _context3.sent;
|
|
202
|
+
_context3.next = 10;
|
|
203
|
+
break;
|
|
204
|
+
case 6:
|
|
205
|
+
_context3.prev = 6;
|
|
206
|
+
_context3.t0 = _context3["catch"](0);
|
|
207
|
+
if (!(data[field.name] !== undefined)) {
|
|
208
208
|
_context3.next = 10;
|
|
209
209
|
break;
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
case 16:
|
|
235
|
-
extracted = _context3.sent;
|
|
236
|
-
return _context3.abrupt("return", (0, _defineProperty2.default)({}, field.name, fieldSerializer(extracted)));
|
|
237
|
-
case 18:
|
|
238
|
-
case "end":
|
|
239
|
-
return _context3.stop();
|
|
240
|
-
}
|
|
210
|
+
}
|
|
211
|
+
throw _context3.t0;
|
|
212
|
+
case 10:
|
|
213
|
+
if (fieldSerializer) {
|
|
214
|
+
_context3.next = 12;
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
return _context3.abrupt("return");
|
|
218
|
+
case 12:
|
|
219
|
+
fieldsetFields = field.fields;
|
|
220
|
+
fieldParams = extract(data[field.name], field, {
|
|
221
|
+
useDefaultValue: true
|
|
222
|
+
}) || {};
|
|
223
|
+
_context3.next = 16;
|
|
224
|
+
return serialize(manifest, fieldParams, fieldsetFields, {
|
|
225
|
+
depth: depth + 1,
|
|
226
|
+
parentType: 'fieldset'
|
|
227
|
+
});
|
|
228
|
+
case 16:
|
|
229
|
+
extracted = _context3.sent;
|
|
230
|
+
return _context3.abrupt("return", (0, _defineProperty2.default)({}, field.name, fieldSerializer(extracted)));
|
|
231
|
+
case 18:
|
|
232
|
+
case "end":
|
|
233
|
+
return _context3.stop();
|
|
241
234
|
}
|
|
242
235
|
}, _callee3, null, [[0, 6]]);
|
|
243
236
|
}));
|
|
@@ -246,32 +239,30 @@ var serializeFieldset = /*#__PURE__*/function () {
|
|
|
246
239
|
};
|
|
247
240
|
}();
|
|
248
241
|
var serializeExpandField = /*#__PURE__*/function () {
|
|
249
|
-
var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
242
|
+
var _ref5 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(manifest, field, data) {
|
|
250
243
|
var expandData, value, results, fieldName;
|
|
251
|
-
return
|
|
252
|
-
while (1) {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
results.push((0, _defineProperty2.default)({}, fieldName, value[fieldName]));
|
|
266
|
-
}
|
|
267
|
-
} else {
|
|
268
|
-
results.push((0, _defineProperty2.default)({}, field.name, value));
|
|
244
|
+
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
245
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
246
|
+
case 0:
|
|
247
|
+
expandData = field.hasGroupedValues ? data[field.name] || {} : data;
|
|
248
|
+
_context4.next = 3;
|
|
249
|
+
return serialize(manifest, expandData, field.fields, {
|
|
250
|
+
parentType: 'expand'
|
|
251
|
+
});
|
|
252
|
+
case 3:
|
|
253
|
+
value = _context4.sent;
|
|
254
|
+
results = [];
|
|
255
|
+
if (!field.hasGroupedValues) {
|
|
256
|
+
for (fieldName in value) {
|
|
257
|
+
results.push((0, _defineProperty2.default)({}, fieldName, value[fieldName]));
|
|
269
258
|
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
259
|
+
} else {
|
|
260
|
+
results.push((0, _defineProperty2.default)({}, field.name, value));
|
|
261
|
+
}
|
|
262
|
+
return _context4.abrupt("return", results);
|
|
263
|
+
case 7:
|
|
264
|
+
case "end":
|
|
265
|
+
return _context4.stop();
|
|
275
266
|
}
|
|
276
267
|
}, _callee4);
|
|
277
268
|
}));
|
|
@@ -280,23 +271,21 @@ var serializeExpandField = /*#__PURE__*/function () {
|
|
|
280
271
|
};
|
|
281
272
|
}();
|
|
282
273
|
var resolveTabValues = /*#__PURE__*/function () {
|
|
283
|
-
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
274
|
+
var _ref6 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(manifest, tabField, groupData) {
|
|
284
275
|
var tabFieldParams;
|
|
285
|
-
return
|
|
286
|
-
while (1) {
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
return _context5.stop();
|
|
299
|
-
}
|
|
276
|
+
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
277
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
278
|
+
case 0:
|
|
279
|
+
tabFieldParams = tabField.hasGroupedValues ? groupData[tabField.name] || {} : groupData;
|
|
280
|
+
_context5.next = 3;
|
|
281
|
+
return serialize(manifest, tabFieldParams, tabField.fields, {
|
|
282
|
+
parentType: 'tab'
|
|
283
|
+
});
|
|
284
|
+
case 3:
|
|
285
|
+
return _context5.abrupt("return", _context5.sent);
|
|
286
|
+
case 4:
|
|
287
|
+
case "end":
|
|
288
|
+
return _context5.stop();
|
|
300
289
|
}
|
|
301
290
|
}, _callee5);
|
|
302
291
|
}));
|
|
@@ -305,53 +294,51 @@ var resolveTabValues = /*#__PURE__*/function () {
|
|
|
305
294
|
};
|
|
306
295
|
}();
|
|
307
296
|
var serializeTabGroupField = /*#__PURE__*/function () {
|
|
308
|
-
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
297
|
+
var _ref7 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(manifest, field, data) {
|
|
309
298
|
var tabs, results, value, i, tabField, tabFieldParameters, fieldName, _fieldName;
|
|
310
|
-
return
|
|
311
|
-
while (1) {
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
_context6.next = 13;
|
|
321
|
-
break;
|
|
322
|
-
}
|
|
323
|
-
tabField = tabs[i];
|
|
324
|
-
_context6.next = 8;
|
|
325
|
-
return resolveTabValues(manifest, tabField, field.hasGroupedValues ? data[field.name] || {} : data);
|
|
326
|
-
case 8:
|
|
327
|
-
tabFieldParameters = _context6.sent;
|
|
328
|
-
if (tabField.hasGroupedValues) {
|
|
329
|
-
// Keep namespaced by tab
|
|
330
|
-
value[tabField.name] = tabFieldParameters;
|
|
331
|
-
} else {
|
|
332
|
-
// Copy into tabGroup value
|
|
333
|
-
for (fieldName in tabFieldParameters) {
|
|
334
|
-
value[fieldName] = tabFieldParameters[fieldName];
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
case 10:
|
|
338
|
-
i++;
|
|
339
|
-
_context6.next = 4;
|
|
299
|
+
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
300
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
301
|
+
case 0:
|
|
302
|
+
tabs = field.fields;
|
|
303
|
+
results = [];
|
|
304
|
+
value = {};
|
|
305
|
+
i = 0;
|
|
306
|
+
case 4:
|
|
307
|
+
if (!(i < tabs.length)) {
|
|
308
|
+
_context6.next = 13;
|
|
340
309
|
break;
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
310
|
+
}
|
|
311
|
+
tabField = tabs[i];
|
|
312
|
+
_context6.next = 8;
|
|
313
|
+
return resolveTabValues(manifest, tabField, field.hasGroupedValues ? data[field.name] || {} : data);
|
|
314
|
+
case 8:
|
|
315
|
+
tabFieldParameters = _context6.sent;
|
|
316
|
+
if (tabField.hasGroupedValues) {
|
|
317
|
+
// Keep namespaced by tab
|
|
318
|
+
value[tabField.name] = tabFieldParameters;
|
|
319
|
+
} else {
|
|
320
|
+
// Copy into tabGroup value
|
|
321
|
+
for (fieldName in tabFieldParameters) {
|
|
322
|
+
value[fieldName] = tabFieldParameters[fieldName];
|
|
349
323
|
}
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
324
|
+
}
|
|
325
|
+
case 10:
|
|
326
|
+
i++;
|
|
327
|
+
_context6.next = 4;
|
|
328
|
+
break;
|
|
329
|
+
case 13:
|
|
330
|
+
// Now for tabGroup...
|
|
331
|
+
if (field.hasGroupedValues) {
|
|
332
|
+
results.push((0, _defineProperty2.default)({}, field.name, value));
|
|
333
|
+
} else {
|
|
334
|
+
for (_fieldName in value) {
|
|
335
|
+
results.push((0, _defineProperty2.default)({}, _fieldName, value));
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
return _context6.abrupt("return", results);
|
|
339
|
+
case 15:
|
|
340
|
+
case "end":
|
|
341
|
+
return _context6.stop();
|
|
355
342
|
}
|
|
356
343
|
}, _callee6);
|
|
357
344
|
}));
|
|
@@ -360,32 +347,30 @@ var serializeTabGroupField = /*#__PURE__*/function () {
|
|
|
360
347
|
};
|
|
361
348
|
}();
|
|
362
349
|
var serializeTabField = /*#__PURE__*/function () {
|
|
363
|
-
var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
350
|
+
var _ref8 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7(manifest, field, data) {
|
|
364
351
|
var results, tabField, tabFieldParameters, fieldName;
|
|
365
|
-
return
|
|
366
|
-
while (1) {
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
results.push((0, _defineProperty2.default)({}, fieldName, tabFieldParameters[fieldName]));
|
|
382
|
-
}
|
|
352
|
+
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
353
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
354
|
+
case 0:
|
|
355
|
+
results = [];
|
|
356
|
+
tabField = field;
|
|
357
|
+
_context7.next = 4;
|
|
358
|
+
return resolveTabValues(manifest, tabField, data);
|
|
359
|
+
case 4:
|
|
360
|
+
tabFieldParameters = _context7.sent;
|
|
361
|
+
if (tabField.hasGroupedValues) {
|
|
362
|
+
// Keep namespaced by tab
|
|
363
|
+
results.push((0, _defineProperty2.default)({}, tabField.name, tabFieldParameters));
|
|
364
|
+
} else {
|
|
365
|
+
// Copy into tabGroup value
|
|
366
|
+
for (fieldName in tabFieldParameters) {
|
|
367
|
+
results.push((0, _defineProperty2.default)({}, fieldName, tabFieldParameters[fieldName]));
|
|
383
368
|
}
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
369
|
+
}
|
|
370
|
+
return _context7.abrupt("return", results);
|
|
371
|
+
case 7:
|
|
372
|
+
case "end":
|
|
373
|
+
return _context7.stop();
|
|
389
374
|
}
|
|
390
375
|
}, _callee7);
|
|
391
376
|
}));
|
|
@@ -493,7 +478,7 @@ var flattenFields = function flattenFields(fields) {
|
|
|
493
478
|
return fields.reduce(flattenAccumulator, []);
|
|
494
479
|
};
|
|
495
480
|
var deserialize = /*#__PURE__*/function () {
|
|
496
|
-
var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/
|
|
481
|
+
var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8(manifest, data, fields) {
|
|
497
482
|
var depth,
|
|
498
483
|
dataArray,
|
|
499
484
|
result,
|
|
@@ -504,114 +489,110 @@ var deserialize = /*#__PURE__*/function () {
|
|
|
504
489
|
_loop2,
|
|
505
490
|
_ret2,
|
|
506
491
|
_args9 = arguments;
|
|
507
|
-
return
|
|
508
|
-
while (1) {
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
_context8.next = 5;
|
|
531
|
-
break;
|
|
532
|
-
}
|
|
533
|
-
return _context8.abrupt("return", "continue");
|
|
534
|
-
case 5:
|
|
535
|
-
value = extract(originalValue, field);
|
|
536
|
-
if (!(value === undefined)) {
|
|
537
|
-
_context8.next = 8;
|
|
538
|
-
break;
|
|
539
|
-
}
|
|
540
|
-
return _context8.abrupt("return", "continue");
|
|
541
|
-
case 8:
|
|
542
|
-
if (!((0, _extensions.isFieldset)(field) && depth === 0)) {
|
|
543
|
-
_context8.next = 24;
|
|
544
|
-
break;
|
|
545
|
-
}
|
|
546
|
-
_context8.next = 11;
|
|
547
|
-
return (0, _extensions.getFieldDeserializer)(manifest, field.options.transformer);
|
|
548
|
-
case 11:
|
|
549
|
-
fieldDeserializer = _context8.sent;
|
|
550
|
-
if (!fieldDeserializer) {
|
|
551
|
-
_context8.next = 24;
|
|
552
|
-
break;
|
|
553
|
-
}
|
|
554
|
-
_context8.prev = 13;
|
|
555
|
-
value = fieldDeserializer(value);
|
|
556
|
-
_context8.next = 21;
|
|
557
|
-
break;
|
|
558
|
-
case 17:
|
|
559
|
-
_context8.prev = 17;
|
|
560
|
-
_context8.t0 = _context8["catch"](13);
|
|
561
|
-
errors.push((0, _defineProperty2.default)({}, name, _context8.t0 instanceof Error ? _context8.t0.message : String(_context8.t0)));
|
|
562
|
-
return _context8.abrupt("return", "continue");
|
|
563
|
-
case 21:
|
|
564
|
-
_context8.next = 23;
|
|
565
|
-
return deserialize(manifest, value, field.fields, depth + 1);
|
|
566
|
-
case 23:
|
|
567
|
-
value = _context8.sent;
|
|
568
|
-
case 24:
|
|
569
|
-
result.push((0, _defineProperty2.default)({}, name, value));
|
|
570
|
-
case 25:
|
|
571
|
-
case "end":
|
|
572
|
-
return _context8.stop();
|
|
492
|
+
return _regenerator.default.wrap(function _callee8$(_context9) {
|
|
493
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
494
|
+
case 0:
|
|
495
|
+
depth = _args9.length > 3 && _args9[3] !== undefined ? _args9[3] : 0;
|
|
496
|
+
dataArray = convertToParametersArray(data);
|
|
497
|
+
result = [];
|
|
498
|
+
errors = [];
|
|
499
|
+
flattenedFields = flattenFields(fields);
|
|
500
|
+
_iterator2 = _createForOfIteratorHelper(dataArray);
|
|
501
|
+
_context9.prev = 6;
|
|
502
|
+
_loop2 = /*#__PURE__*/_regenerator.default.mark(function _loop2() {
|
|
503
|
+
var item, _Object$entries$, name, originalValue, field, value, fieldDeserializer;
|
|
504
|
+
return _regenerator.default.wrap(function _loop2$(_context8) {
|
|
505
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
506
|
+
case 0:
|
|
507
|
+
item = _step2.value;
|
|
508
|
+
_Object$entries$ = (0, _slicedToArray2.default)(Object.entries(item)[0], 2), name = _Object$entries$[0], originalValue = _Object$entries$[1];
|
|
509
|
+
field = flattenedFields.find(function (field) {
|
|
510
|
+
return field.name === (0, _utils.getNameFromDuplicateField)(name);
|
|
511
|
+
});
|
|
512
|
+
if (!(field === undefined)) {
|
|
513
|
+
_context8.next = 5;
|
|
514
|
+
break;
|
|
573
515
|
}
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
516
|
+
return _context8.abrupt("return", "continue");
|
|
517
|
+
case 5:
|
|
518
|
+
value = extract(originalValue, field);
|
|
519
|
+
if (!(value === undefined)) {
|
|
520
|
+
_context8.next = 8;
|
|
521
|
+
break;
|
|
522
|
+
}
|
|
523
|
+
return _context8.abrupt("return", "continue");
|
|
524
|
+
case 8:
|
|
525
|
+
if (!((0, _extensions.isFieldset)(field) && depth === 0)) {
|
|
526
|
+
_context8.next = 24;
|
|
527
|
+
break;
|
|
528
|
+
}
|
|
529
|
+
_context8.next = 11;
|
|
530
|
+
return (0, _extensions.getFieldDeserializer)(manifest, field.options.transformer);
|
|
531
|
+
case 11:
|
|
532
|
+
fieldDeserializer = _context8.sent;
|
|
533
|
+
if (!fieldDeserializer) {
|
|
534
|
+
_context8.next = 24;
|
|
535
|
+
break;
|
|
536
|
+
}
|
|
537
|
+
_context8.prev = 13;
|
|
538
|
+
value = fieldDeserializer(value);
|
|
539
|
+
_context8.next = 21;
|
|
540
|
+
break;
|
|
541
|
+
case 17:
|
|
542
|
+
_context8.prev = 17;
|
|
543
|
+
_context8.t0 = _context8["catch"](13);
|
|
544
|
+
errors.push((0, _defineProperty2.default)({}, name, _context8.t0 instanceof Error ? _context8.t0.message : String(_context8.t0)));
|
|
545
|
+
return _context8.abrupt("return", "continue");
|
|
546
|
+
case 21:
|
|
547
|
+
_context8.next = 23;
|
|
548
|
+
return deserialize(manifest, value, field.fields, depth + 1);
|
|
549
|
+
case 23:
|
|
550
|
+
value = _context8.sent;
|
|
551
|
+
case 24:
|
|
552
|
+
result.push((0, _defineProperty2.default)({}, name, value));
|
|
553
|
+
case 25:
|
|
554
|
+
case "end":
|
|
555
|
+
return _context8.stop();
|
|
556
|
+
}
|
|
557
|
+
}, _loop2, null, [[13, 17]]);
|
|
558
|
+
});
|
|
559
|
+
_iterator2.s();
|
|
560
|
+
case 9:
|
|
561
|
+
if ((_step2 = _iterator2.n()).done) {
|
|
562
|
+
_context9.next = 16;
|
|
593
563
|
break;
|
|
594
|
-
|
|
595
|
-
|
|
564
|
+
}
|
|
565
|
+
return _context9.delegateYield(_loop2(), "t0", 11);
|
|
566
|
+
case 11:
|
|
567
|
+
_ret2 = _context9.t0;
|
|
568
|
+
if (!(_ret2 === "continue")) {
|
|
569
|
+
_context9.next = 14;
|
|
596
570
|
break;
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
571
|
+
}
|
|
572
|
+
return _context9.abrupt("continue", 14);
|
|
573
|
+
case 14:
|
|
574
|
+
_context9.next = 9;
|
|
575
|
+
break;
|
|
576
|
+
case 16:
|
|
577
|
+
_context9.next = 21;
|
|
578
|
+
break;
|
|
579
|
+
case 18:
|
|
580
|
+
_context9.prev = 18;
|
|
581
|
+
_context9.t1 = _context9["catch"](6);
|
|
582
|
+
_iterator2.e(_context9.t1);
|
|
583
|
+
case 21:
|
|
584
|
+
_context9.prev = 21;
|
|
585
|
+
_iterator2.f();
|
|
586
|
+
return _context9.finish(21);
|
|
587
|
+
case 24:
|
|
588
|
+
result = convertToParametersObject(result);
|
|
589
|
+
if (errors.length > 0) {
|
|
590
|
+
result.errors = convertToParametersObject(errors);
|
|
591
|
+
}
|
|
592
|
+
return _context9.abrupt("return", injectDefaultValues(result, flattenedFields));
|
|
593
|
+
case 27:
|
|
594
|
+
case "end":
|
|
595
|
+
return _context9.stop();
|
|
615
596
|
}
|
|
616
597
|
}, _callee8, null, [[6, 18, 21, 24]]);
|
|
617
598
|
}));
|