@atlaskit/editor-core 151.1.2 → 152.0.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 +112 -0
- package/dist/cjs/create-editor/ReactEditorView.js +22 -8
- package/dist/cjs/create-editor/create-plugins-list.js +30 -11
- package/dist/cjs/labs/next/presets/cxhtml.js +1 -2
- package/dist/cjs/labs/next/presets/default.js +3 -1
- package/dist/cjs/nodeviews/ReactNodeView.js +2 -2
- package/dist/cjs/nodeviews/SelectionBasedNodeView.js +6 -0
- package/dist/cjs/plugins/analytics/types/enums.js +1 -0
- package/dist/cjs/plugins/annotation/utils.js +19 -8
- package/dist/cjs/plugins/avatar-group/index.js +2 -1
- package/dist/cjs/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +5 -2
- package/dist/cjs/plugins/before-primaryToolbar/index.js +26 -0
- package/dist/cjs/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +28 -0
- package/dist/cjs/plugins/code-bidi-warning/index.js +5 -2
- package/dist/cjs/plugins/code-bidi-warning/pm-plugins/main.js +12 -3
- package/dist/cjs/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +15 -5
- package/dist/cjs/plugins/code-block/index.js +3 -3
- package/dist/cjs/plugins/code-block/nodeviews/highlighting-code-block.js +6 -3
- package/dist/cjs/plugins/code-block/pm-plugins/main.js +11 -3
- package/dist/cjs/plugins/extension/extension-api.js +10 -2
- package/dist/cjs/plugins/extension/ui/styles.js +1 -1
- package/dist/cjs/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
- package/dist/cjs/plugins/find-replace/FindReplaceToolbarButtonWithState.js +172 -0
- package/dist/cjs/plugins/find-replace/index.js +14 -137
- package/dist/cjs/plugins/find-replace/ui/Find.js +16 -9
- package/dist/cjs/plugins/find-replace/ui/FindReplace.js +9 -2
- package/dist/cjs/plugins/find-replace/ui/Replace.js +11 -3
- package/dist/cjs/plugins/find-replace/ui/styles.js +44 -35
- package/dist/cjs/plugins/floating-toolbar/ui/EmojiPickerButton.js +10 -4
- package/dist/cjs/plugins/floating-toolbar/ui/Toolbar.js +1 -1
- package/dist/cjs/plugins/fragment/index.js +34 -0
- package/dist/cjs/plugins/fragment/plugin-key.js +11 -0
- package/dist/cjs/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +1 -1
- package/dist/cjs/plugins/index.js +16 -0
- package/dist/cjs/plugins/list/actions/conversions.js +39 -71
- package/dist/cjs/plugins/list/transforms.js +7 -1
- package/dist/cjs/plugins/media/index.js +2 -3
- package/dist/cjs/plugins/media/nodeviews/mediaGroup.js +3 -1
- package/dist/cjs/plugins/media/nodeviews/mediaInline.js +12 -5
- package/dist/cjs/plugins/media/nodeviews/mediaSingle.js +6 -4
- package/dist/cjs/plugins/media/nodeviews/styles.js +6 -1
- package/dist/cjs/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -1
- package/dist/cjs/plugins/media/pm-plugins/main.js +49 -15
- package/dist/cjs/plugins/media/toolbar/commands.js +59 -0
- package/dist/cjs/plugins/media/toolbar/filePreviewItem.js +7 -2
- package/dist/cjs/plugins/media/toolbar/index.js +90 -3
- package/dist/cjs/plugins/media/ui/ResizableMediaSingle/index.js +9 -1
- package/dist/cjs/plugins/media/utils/media-common.js +1 -1
- package/dist/cjs/plugins/media/utils/media-files.js +5 -1
- package/dist/cjs/plugins/panel/actions.js +2 -2
- package/dist/cjs/plugins/panel/index.js +3 -3
- package/dist/cjs/plugins/panel/nodeviews/panel.js +2 -2
- package/dist/cjs/plugins/panel/toolbar.js +10 -5
- package/dist/cjs/plugins/panel/utils.js +15 -0
- package/dist/cjs/plugins/rank.js +3 -2
- package/dist/cjs/plugins/selection/pm-plugins/selection-main.js +49 -1
- package/dist/cjs/plugins/status/ui/statusPicker.js +4 -2
- package/dist/cjs/plugins/table/commands/insert.js +1 -0
- package/dist/cjs/plugins/table/index.js +3 -2
- package/dist/cjs/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -3
- package/dist/cjs/plugins/table/pm-plugins/main.js +26 -3
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -0
- package/dist/cjs/plugins/table/transforms/column-width.js +14 -5
- package/dist/cjs/plugins/table/transforms/fix-tables.js +43 -6
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +3 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
- package/dist/cjs/plugins/table/ui/common-styles.css.js +1 -1
- package/dist/cjs/plugins/table/ui/consts.js +1 -1
- package/dist/cjs/plugins/table/ui/messages.js +1 -1
- package/dist/cjs/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
- package/dist/cjs/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
- package/dist/cjs/plugins/tasks-and-decisions/pm-plugins/main.js +2 -2
- package/dist/cjs/plugins/text-color/ui/ToolbarTextColor/index.js +2 -1
- package/dist/cjs/plugins/text-formatting/index.js +2 -1
- package/dist/cjs/plugins/type-ahead/ui/TypeAheadList.js +1 -0
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +77 -26
- package/dist/cjs/ui/Appearance/FullPage/MainToolbar.js +32 -9
- package/dist/cjs/ui/ColorPalette/Color/index.js +8 -18
- package/dist/cjs/ui/ColorPalette/index.js +7 -4
- package/dist/cjs/ui/ColorPickerButton/index.js +1 -1
- package/dist/cjs/ui/ConfigPanel/ConfigPanel.js +114 -61
- package/dist/cjs/ui/ConfigPanel/FormContent.js +39 -26
- package/dist/cjs/ui/ConfigPanel/transformers.js +490 -248
- package/dist/cjs/ui/ConfigPanel/utils.js +2 -10
- package/dist/cjs/ui/DropdownMenu/index.js +3 -1
- package/dist/cjs/ui/LinkSearch/LinkSearchListItem.js +1 -1
- package/dist/cjs/ui/Resizer/index.js +9 -1
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/create-editor/ReactEditorView.js +19 -8
- package/dist/es2019/create-editor/create-plugins-list.js +31 -12
- package/dist/es2019/labs/next/presets/cxhtml.js +1 -2
- package/dist/es2019/labs/next/presets/default.js +3 -1
- package/dist/es2019/nodeviews/ReactNodeView.js +1 -1
- package/dist/es2019/nodeviews/SelectionBasedNodeView.js +11 -0
- package/dist/es2019/plugins/analytics/types/enums.js +1 -0
- package/dist/es2019/plugins/annotation/utils.js +18 -7
- package/dist/es2019/plugins/avatar-group/index.js +2 -1
- package/dist/es2019/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +3 -2
- package/dist/es2019/plugins/before-primaryToolbar/index.js +15 -0
- package/dist/es2019/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +12 -0
- package/dist/es2019/plugins/code-bidi-warning/index.js +8 -2
- package/dist/es2019/plugins/code-bidi-warning/pm-plugins/main.js +12 -2
- package/dist/es2019/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +16 -5
- package/dist/es2019/plugins/code-block/index.js +3 -2
- package/dist/es2019/plugins/code-block/nodeviews/highlighting-code-block.js +6 -3
- package/dist/es2019/plugins/code-block/pm-plugins/main.js +11 -3
- package/dist/es2019/plugins/extension/extension-api.js +9 -2
- package/dist/es2019/plugins/extension/ui/styles.js +6 -0
- package/dist/es2019/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
- package/dist/es2019/plugins/find-replace/FindReplaceToolbarButtonWithState.js +152 -0
- package/dist/es2019/plugins/find-replace/index.js +15 -128
- package/dist/es2019/plugins/find-replace/ui/Find.js +18 -10
- package/dist/es2019/plugins/find-replace/ui/FindReplace.js +11 -3
- package/dist/es2019/plugins/find-replace/ui/Replace.js +12 -4
- package/dist/es2019/plugins/find-replace/ui/styles.js +37 -47
- package/dist/es2019/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
- package/dist/es2019/plugins/floating-toolbar/ui/EmojiPickerButton.js +10 -2
- package/dist/es2019/plugins/floating-toolbar/ui/Toolbar.js +1 -1
- package/dist/es2019/plugins/fragment/index.js +22 -0
- package/dist/es2019/plugins/fragment/plugin-key.js +2 -0
- package/dist/es2019/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -2
- package/dist/es2019/plugins/index.js +2 -0
- package/dist/es2019/plugins/list/actions/conversions.js +38 -69
- package/dist/es2019/plugins/list/transforms.js +5 -1
- package/dist/es2019/plugins/media/index.js +2 -2
- package/dist/es2019/plugins/media/nodeviews/mediaGroup.js +2 -1
- package/dist/es2019/plugins/media/nodeviews/mediaInline.js +8 -4
- package/dist/es2019/plugins/media/nodeviews/mediaSingle.js +7 -5
- package/dist/es2019/plugins/media/nodeviews/styles.js +2 -0
- package/dist/es2019/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -1
- package/dist/es2019/plugins/media/pm-plugins/main.js +32 -17
- package/dist/es2019/plugins/media/toolbar/commands.js +47 -0
- package/dist/es2019/plugins/media/toolbar/filePreviewItem.js +6 -2
- package/dist/es2019/plugins/media/toolbar/index.js +90 -3
- package/dist/es2019/plugins/media/ui/ResizableMediaSingle/index.js +7 -1
- package/dist/es2019/plugins/media/utils/media-common.js +1 -1
- package/dist/es2019/plugins/media/utils/media-files.js +6 -1
- package/dist/es2019/plugins/panel/actions.js +2 -2
- package/dist/es2019/plugins/panel/index.js +5 -5
- package/dist/es2019/plugins/panel/nodeviews/panel.js +2 -2
- package/dist/es2019/plugins/panel/toolbar.js +10 -5
- package/dist/es2019/plugins/panel/utils.js +8 -1
- package/dist/es2019/plugins/rank.js +3 -2
- package/dist/es2019/plugins/selection/pm-plugins/selection-main.js +48 -1
- package/dist/es2019/plugins/status/ui/statusPicker.js +4 -2
- package/dist/es2019/plugins/table/commands/insert.js +1 -2
- package/dist/es2019/plugins/table/index.js +2 -1
- package/dist/es2019/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -2
- package/dist/es2019/plugins/table/pm-plugins/main.js +25 -4
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
- package/dist/es2019/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -0
- package/dist/es2019/plugins/table/transforms/column-width.js +13 -3
- package/dist/es2019/plugins/table/transforms/fix-tables.js +43 -5
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +3 -2
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
- package/dist/es2019/plugins/table/ui/common-styles.css.js +5 -1
- package/dist/es2019/plugins/table/ui/consts.js +2 -2
- package/dist/es2019/plugins/table/ui/messages.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
- package/dist/es2019/plugins/tasks-and-decisions/pm-plugins/main.js +3 -3
- package/dist/es2019/plugins/text-color/ui/ToolbarTextColor/index.js +2 -1
- package/dist/es2019/plugins/text-formatting/index.js +3 -2
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadList.js +2 -1
- package/dist/es2019/plugins/type-ahead/ui/TypeAheadListItem.js +2 -1
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +60 -27
- package/dist/es2019/ui/Appearance/FullPage/MainToolbar.js +51 -7
- package/dist/es2019/ui/ColorPalette/Color/index.js +9 -18
- package/dist/es2019/ui/ColorPalette/index.js +7 -4
- package/dist/es2019/ui/ColorPickerButton/index.js +1 -1
- package/dist/es2019/ui/ConfigPanel/ConfigPanel.js +101 -49
- package/dist/es2019/ui/ConfigPanel/FormContent.js +35 -26
- package/dist/es2019/ui/ConfigPanel/transformers.js +243 -72
- package/dist/es2019/ui/ConfigPanel/utils.js +1 -2
- package/dist/es2019/ui/Dropdown/index.js +2 -1
- package/dist/es2019/ui/DropdownMenu/index.js +7 -3
- package/dist/es2019/ui/ElementBrowser/InsertMenu.js +1 -0
- package/dist/es2019/ui/ElementBrowser/components/ElementList/ElementList.js +1 -0
- package/dist/es2019/ui/LinkSearch/LinkSearchListItem.js +2 -2
- package/dist/es2019/ui/Resizer/index.js +9 -1
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/create-editor/ReactEditorView.js +22 -8
- package/dist/esm/create-editor/create-plugins-list.js +31 -12
- package/dist/esm/labs/next/presets/cxhtml.js +1 -2
- package/dist/esm/labs/next/presets/default.js +3 -1
- package/dist/esm/nodeviews/ReactNodeView.js +2 -2
- package/dist/esm/nodeviews/SelectionBasedNodeView.js +7 -0
- package/dist/esm/plugins/analytics/types/enums.js +1 -0
- package/dist/esm/plugins/annotation/utils.js +18 -7
- package/dist/esm/plugins/avatar-group/index.js +2 -1
- package/dist/esm/plugins/avatar-group/ui/AvatarGroupPluginWrapper.js +5 -2
- package/dist/esm/plugins/before-primaryToolbar/index.js +15 -0
- package/dist/esm/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.js +12 -0
- package/dist/esm/plugins/code-bidi-warning/index.js +5 -2
- package/dist/esm/plugins/code-bidi-warning/pm-plugins/main.js +12 -3
- package/dist/esm/plugins/code-bidi-warning/pm-plugins/plugin-factory.js +15 -5
- package/dist/esm/plugins/code-block/index.js +3 -3
- package/dist/esm/plugins/code-block/nodeviews/highlighting-code-block.js +6 -3
- package/dist/esm/plugins/code-block/pm-plugins/main.js +11 -3
- package/dist/esm/plugins/extension/extension-api.js +9 -2
- package/dist/esm/plugins/extension/ui/styles.js +1 -1
- package/dist/esm/plugins/feature-flags-context/feature-flags-from-props.js +4 -2
- package/dist/esm/plugins/find-replace/FindReplaceToolbarButtonWithState.js +155 -0
- package/dist/esm/plugins/find-replace/index.js +14 -131
- package/dist/esm/plugins/find-replace/ui/Find.js +17 -10
- package/dist/esm/plugins/find-replace/ui/FindReplace.js +10 -3
- package/dist/esm/plugins/find-replace/ui/Replace.js +11 -4
- package/dist/esm/plugins/find-replace/ui/styles.js +39 -18
- package/dist/esm/plugins/floating-toolbar/ui/DropdownMenu.js +2 -1
- package/dist/esm/plugins/floating-toolbar/ui/EmojiPickerButton.js +9 -4
- package/dist/esm/plugins/floating-toolbar/ui/Toolbar.js +1 -1
- package/dist/esm/plugins/fragment/index.js +22 -0
- package/dist/esm/plugins/fragment/plugin-key.js +2 -0
- package/dist/esm/plugins/hyperlink/ui/HyperlinkAddToolbar/HyperlinkAddToolbar.js +2 -2
- package/dist/esm/plugins/index.js +2 -0
- package/dist/esm/plugins/list/actions/conversions.js +38 -71
- package/dist/esm/plugins/list/transforms.js +7 -1
- package/dist/esm/plugins/media/index.js +2 -3
- package/dist/esm/plugins/media/nodeviews/mediaGroup.js +2 -1
- package/dist/esm/plugins/media/nodeviews/mediaInline.js +11 -6
- package/dist/esm/plugins/media/nodeviews/mediaSingle.js +7 -5
- package/dist/esm/plugins/media/nodeviews/styles.js +2 -0
- package/dist/esm/plugins/media/pm-plugins/alt-text/ui/AltTextEdit.js +5 -1
- package/dist/esm/plugins/media/pm-plugins/main.js +47 -16
- package/dist/esm/plugins/media/toolbar/commands.js +45 -0
- package/dist/esm/plugins/media/toolbar/filePreviewItem.js +6 -2
- package/dist/esm/plugins/media/toolbar/index.js +88 -3
- package/dist/esm/plugins/media/ui/ResizableMediaSingle/index.js +9 -1
- package/dist/esm/plugins/media/utils/media-common.js +1 -1
- package/dist/esm/plugins/media/utils/media-files.js +6 -1
- package/dist/esm/plugins/panel/actions.js +2 -2
- package/dist/esm/plugins/panel/index.js +5 -5
- package/dist/esm/plugins/panel/nodeviews/panel.js +2 -2
- package/dist/esm/plugins/panel/toolbar.js +9 -4
- package/dist/esm/plugins/panel/utils.js +13 -0
- package/dist/esm/plugins/rank.js +3 -2
- package/dist/esm/plugins/selection/pm-plugins/selection-main.js +50 -1
- package/dist/esm/plugins/status/ui/statusPicker.js +4 -2
- package/dist/esm/plugins/table/commands/insert.js +1 -2
- package/dist/esm/plugins/table/index.js +3 -2
- package/dist/esm/plugins/table/nodeviews/OverflowShadowsObserver.js +1 -2
- package/dist/esm/plugins/table/pm-plugins/main.js +27 -4
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/colgroup.js +2 -2
- package/dist/esm/plugins/table/pm-plugins/table-resizing/utils/resize-state.js +2 -0
- package/dist/esm/plugins/table/transforms/column-width.js +13 -3
- package/dist/esm/plugins/table/transforms/fix-tables.js +42 -4
- package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +3 -2
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/ContextualMenu.js +1 -0
- package/dist/esm/plugins/table/ui/common-styles.css.js +1 -1
- package/dist/esm/plugins/table/ui/consts.js +2 -2
- package/dist/esm/plugins/table/ui/messages.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/nodeviews/decisionItem.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/nodeviews/taskItem.js +1 -1
- package/dist/esm/plugins/tasks-and-decisions/pm-plugins/main.js +3 -3
- package/dist/esm/plugins/text-color/ui/ToolbarTextColor/index.js +2 -1
- package/dist/esm/plugins/text-formatting/index.js +3 -2
- package/dist/esm/plugins/type-ahead/ui/TypeAheadList.js +2 -1
- package/dist/esm/plugins/type-ahead/ui/TypeAheadListItem.js +2 -1
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +67 -27
- package/dist/esm/ui/Appearance/FullPage/MainToolbar.js +20 -7
- package/dist/esm/ui/ColorPalette/Color/index.js +9 -16
- package/dist/esm/ui/ColorPalette/index.js +7 -4
- package/dist/esm/ui/ColorPickerButton/index.js +1 -1
- package/dist/esm/ui/ConfigPanel/ConfigPanel.js +113 -62
- package/dist/esm/ui/ConfigPanel/FormContent.js +39 -26
- package/dist/esm/ui/ConfigPanel/transformers.js +488 -248
- package/dist/esm/ui/ConfigPanel/utils.js +1 -6
- package/dist/esm/ui/Dropdown/index.js +2 -1
- package/dist/esm/ui/DropdownMenu/index.js +7 -3
- package/dist/esm/ui/ElementBrowser/InsertMenu.js +1 -0
- package/dist/esm/ui/ElementBrowser/components/ElementList/ElementList.js +1 -0
- package/dist/esm/ui/LinkSearch/LinkSearchListItem.js +2 -2
- package/dist/esm/ui/Resizer/index.js +9 -1
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/labs/next/full-page.d.ts +1 -1
- package/dist/types/nodeviews/ReactNodeView.d.ts +1 -1
- package/dist/types/nodeviews/SelectionBasedNodeView.d.ts +1 -0
- package/dist/types/plugins/analytics/types/enums.d.ts +1 -0
- package/dist/types/plugins/analytics/types/events.d.ts +7 -1
- package/dist/types/plugins/annotation/utils.d.ts +1 -1
- package/dist/types/plugins/avatar-group/index.d.ts +1 -0
- package/dist/types/plugins/avatar-group/ui/AvatarGroupPluginWrapper.d.ts +1 -0
- package/dist/types/plugins/before-primaryToolbar/index.d.ts +5 -0
- package/dist/types/plugins/before-primaryToolbar/ui/BeforePrimaryToolbarWrapper.d.ts +5 -0
- package/dist/types/plugins/code-bidi-warning/index.d.ts +4 -2
- package/dist/types/plugins/code-bidi-warning/pm-plugins/main.d.ts +4 -2
- package/dist/types/plugins/code-bidi-warning/pm-plugins/plugin-factory.d.ts +2 -1
- package/dist/types/plugins/code-bidi-warning/pm-plugins/types.d.ts +1 -0
- package/dist/types/plugins/code-block/index.d.ts +1 -1
- package/dist/types/plugins/code-block/nodeviews/highlighting-code-block.d.ts +12 -1
- package/dist/types/plugins/code-block/pm-plugins/main.d.ts +3 -1
- package/dist/types/plugins/code-block/types.d.ts +2 -0
- package/dist/types/plugins/feature-flags-context/get-enabled-feature-flag-keys.d.ts +1 -1
- package/dist/types/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +15 -0
- package/dist/types/plugins/find-replace/index.d.ts +1 -0
- package/dist/types/plugins/find-replace/ui/Find.d.ts +1 -0
- package/dist/types/plugins/find-replace/ui/FindReplace.d.ts +1 -0
- package/dist/types/plugins/find-replace/ui/Replace.d.ts +1 -0
- package/dist/types/plugins/find-replace/ui/styles.d.ts +5 -14
- package/dist/types/plugins/floating-toolbar/ui/EmojiPickerButton.d.ts +1 -1
- package/dist/types/plugins/fragment/index.d.ts +5 -0
- package/dist/types/plugins/fragment/plugin-key.d.ts +2 -0
- package/dist/types/plugins/index.d.ts +2 -0
- package/dist/types/plugins/media/nodeviews/mediaInline.d.ts +3 -2
- package/dist/types/plugins/media/nodeviews/mediaSingle.d.ts +1 -1
- package/dist/types/plugins/media/nodeviews/styles.d.ts +2 -0
- package/dist/types/plugins/media/toolbar/commands.d.ts +3 -0
- package/dist/types/plugins/media/toolbar/filePreviewItem.d.ts +2 -0
- package/dist/types/plugins/media/types.d.ts +0 -1
- package/dist/types/plugins/panel/actions.d.ts +1 -1
- package/dist/types/plugins/panel/types.d.ts +8 -2
- package/dist/types/plugins/quick-insert/index.d.ts +2 -1
- package/dist/types/plugins/table/commands/insert.d.ts +3 -0
- package/dist/types/plugins/table/pm-plugins/main.d.ts +2 -1
- package/dist/types/plugins/table/pm-plugins/table-resizing/utils/types.d.ts +1 -0
- package/dist/types/plugins/table/transforms/column-width.d.ts +4 -1
- package/dist/types/plugins/table/transforms/fix-tables.d.ts +3 -2
- package/dist/types/plugins/table/types.d.ts +8 -0
- package/dist/types/plugins/table/ui/consts.d.ts +1 -1
- package/dist/types/types/editor-appearance-component.d.ts +2 -2
- package/dist/types/types/editor-props.d.ts +11 -1
- package/dist/types/types/feature-flags.d.ts +13 -0
- package/dist/types/types/index.d.ts +1 -1
- package/dist/types/ui/Appearance/FullPage/FullPageToolbar.d.ts +2 -2
- package/dist/types/ui/Appearance/FullPage/MainToolbar.d.ts +10 -1
- package/dist/types/ui/ColorPalette/Color/index.d.ts +8 -5
- package/dist/types/ui/ColorPalette/index.d.ts +1 -0
- package/dist/types/ui/ConfigPanel/transformers.d.ts +7 -1
- package/dist/types/ui/ConfigPanel/utils.d.ts +0 -1
- package/dist/types/ui/Resizer/index.d.ts +1 -0
- package/package.json +35 -31
- package/dist/cjs/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.js +0 -38
- package/dist/es2019/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.js +0 -28
- package/dist/esm/plugins/floating-toolbar/ui/EditorRemoveEmojiIcon.js +0 -28
- 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
|
|
12
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
13
|
|
|
14
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
15
|
|
|
16
|
-
var
|
|
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
|
-
|
|
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
|
|
92
|
+
var options,
|
|
65
93
|
result,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
94
|
+
_options$depth,
|
|
95
|
+
depth,
|
|
96
|
+
parentType,
|
|
97
|
+
flattenedFields,
|
|
98
|
+
fillResults,
|
|
99
|
+
parameters,
|
|
69
100
|
hasDuplicateFields,
|
|
70
|
-
|
|
101
|
+
_args2 = arguments;
|
|
71
102
|
|
|
72
|
-
return _regenerator.default.wrap(function _callee2$(
|
|
103
|
+
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
73
104
|
while (1) {
|
|
74
|
-
switch (
|
|
105
|
+
switch (_context2.prev = _context2.next) {
|
|
75
106
|
case 0:
|
|
76
|
-
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
132
|
+
case 7:
|
|
133
|
+
if (!(0, _extensions.isTabField)(field)) {
|
|
134
|
+
_context.next = 14;
|
|
135
|
+
break;
|
|
136
|
+
}
|
|
83
137
|
|
|
84
|
-
|
|
85
|
-
|
|
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
|
-
|
|
95
|
-
|
|
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
|
-
|
|
147
|
+
case 14:
|
|
148
|
+
if (!(0, _extensions.isExpand)(field)) {
|
|
149
|
+
_context.next = 21;
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
100
152
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
value = extract(data[name], field);
|
|
153
|
+
_context.next = 17;
|
|
154
|
+
return serializeExpandField(manifest, field, data);
|
|
104
155
|
|
|
105
|
-
|
|
106
|
-
|
|
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
|
-
|
|
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
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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
|
-
|
|
119
|
-
|
|
181
|
+
case 28:
|
|
182
|
+
value = extract(data[field.name], field, {
|
|
183
|
+
useDefaultValue: true
|
|
184
|
+
}); // ignore undefined values
|
|
120
185
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
-
|
|
131
|
-
|
|
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
|
-
|
|
134
|
-
|
|
135
|
-
return _context.stop();
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}, _callee);
|
|
139
|
-
}));
|
|
212
|
+
return obj;
|
|
213
|
+
}, {}); // Fix up duplicate values (currently only for fieldsets)
|
|
140
214
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}();
|
|
215
|
+
hasDuplicateFields = parentType === 'fieldset' && !!flattenedFields.find(function (field) {
|
|
216
|
+
return field.allowDuplicates;
|
|
217
|
+
});
|
|
145
218
|
|
|
146
|
-
|
|
219
|
+
if (!hasDuplicateFields) {
|
|
220
|
+
_context2.next = 11;
|
|
221
|
+
break;
|
|
222
|
+
}
|
|
147
223
|
|
|
148
|
-
|
|
149
|
-
if (!(i < tabs.length)) {
|
|
150
|
-
_context2.next = 19;
|
|
151
|
-
break;
|
|
152
|
-
}
|
|
224
|
+
return _context2.abrupt("return", serializeMergeDuplicateFieldData(parameters, data, flattenedFields));
|
|
153
225
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
return resolveTabValues(tabField, data[field.name] || {});
|
|
226
|
+
case 11:
|
|
227
|
+
return _context2.abrupt("return", parameters);
|
|
157
228
|
|
|
158
|
-
|
|
159
|
-
|
|
229
|
+
case 12:
|
|
230
|
+
case "end":
|
|
231
|
+
return _context2.stop();
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}, _callee2);
|
|
235
|
+
}));
|
|
160
236
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
237
|
+
return function serialize(_x, _x2, _x3) {
|
|
238
|
+
return _ref.apply(this, arguments);
|
|
239
|
+
};
|
|
240
|
+
}();
|
|
165
241
|
|
|
166
|
-
|
|
167
|
-
_context2.next = 37;
|
|
168
|
-
break;
|
|
242
|
+
exports.serialize = serialize;
|
|
169
243
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
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
|
-
|
|
177
|
-
|
|
255
|
+
case 3:
|
|
256
|
+
fieldSerializer = _context3.sent;
|
|
257
|
+
_context3.next = 10;
|
|
258
|
+
break;
|
|
178
259
|
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
break;
|
|
260
|
+
case 6:
|
|
261
|
+
_context3.prev = 6;
|
|
262
|
+
_context3.t0 = _context3["catch"](0);
|
|
183
263
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
}
|
|
264
|
+
if (!(data[field.name] !== undefined)) {
|
|
265
|
+
_context3.next = 10;
|
|
266
|
+
break;
|
|
267
|
+
}
|
|
189
268
|
|
|
190
|
-
|
|
191
|
-
return (0, _extensions.getFieldSerializer)(manifest, field.options.transformer);
|
|
269
|
+
throw _context3.t0;
|
|
192
270
|
|
|
193
|
-
|
|
194
|
-
|
|
271
|
+
case 10:
|
|
272
|
+
if (fieldSerializer) {
|
|
273
|
+
_context3.next = 12;
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
195
276
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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
|
-
|
|
202
|
-
|
|
203
|
-
|
|
290
|
+
case 16:
|
|
291
|
+
extracted = _context3.sent;
|
|
292
|
+
return _context3.abrupt("return", (0, _defineProperty2.default)({}, field.name, fieldSerializer(extracted)));
|
|
204
293
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
294
|
+
case 18:
|
|
295
|
+
case "end":
|
|
296
|
+
return _context3.stop();
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}, _callee3, null, [[0, 6]]);
|
|
300
|
+
}));
|
|
208
301
|
|
|
209
|
-
|
|
210
|
-
|
|
302
|
+
return function serializeFieldset(_x5, _x6, _x7, _x8) {
|
|
303
|
+
return _ref3.apply(this, arguments);
|
|
304
|
+
};
|
|
305
|
+
}();
|
|
211
306
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
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
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
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
|
-
|
|
228
|
-
return _context3.delegateYield(_loop(name), "t2", 8);
|
|
332
|
+
return _context4.abrupt("return", results);
|
|
229
333
|
|
|
230
|
-
case
|
|
231
|
-
|
|
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
|
-
|
|
234
|
-
|
|
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
|
-
|
|
395
|
+
tabField = tabs[i];
|
|
396
|
+
_context6.next = 8;
|
|
397
|
+
return resolveTabValues(manifest, tabField, field.hasGroupedValues ? data[field.name] || {} : data);
|
|
239
398
|
|
|
240
|
-
case
|
|
241
|
-
|
|
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
|
-
//
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
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
|
|
427
|
+
return _context6.abrupt("return", results);
|
|
257
428
|
|
|
258
|
-
case
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
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
|
-
|
|
265
|
-
}, {}));
|
|
467
|
+
return _context7.abrupt("return", results);
|
|
266
468
|
|
|
267
|
-
case
|
|
469
|
+
case 7:
|
|
268
470
|
case "end":
|
|
269
|
-
return
|
|
471
|
+
return _context7.stop();
|
|
270
472
|
}
|
|
271
473
|
}
|
|
272
|
-
},
|
|
474
|
+
}, _callee7);
|
|
273
475
|
}));
|
|
274
476
|
|
|
275
|
-
return function
|
|
276
|
-
return
|
|
477
|
+
return function serializeTabField(_x18, _x19, _x20) {
|
|
478
|
+
return _ref8.apply(this, arguments);
|
|
277
479
|
};
|
|
278
480
|
}();
|
|
279
481
|
|
|
280
|
-
|
|
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
|
|
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
|
|
552
|
+
var _ret = _loop();
|
|
318
553
|
|
|
319
|
-
if (
|
|
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
|
|
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
|
-
|
|
343
|
-
|
|
344
|
-
|
|
607
|
+
_loop2,
|
|
608
|
+
_ret2,
|
|
609
|
+
_args9 = arguments;
|
|
345
610
|
|
|
346
|
-
return _regenerator.default.wrap(function
|
|
611
|
+
return _regenerator.default.wrap(function _callee8$(_context9) {
|
|
347
612
|
while (1) {
|
|
348
|
-
switch (
|
|
613
|
+
switch (_context9.prev = _context9.next) {
|
|
349
614
|
case 0:
|
|
350
|
-
depth =
|
|
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
|
-
|
|
356
|
-
|
|
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
|
|
625
|
+
return _regenerator.default.wrap(function _loop2$(_context8) {
|
|
360
626
|
while (1) {
|
|
361
|
-
switch (
|
|
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 =
|
|
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
|
-
|
|
636
|
+
_context8.next = 5;
|
|
371
637
|
break;
|
|
372
638
|
}
|
|
373
639
|
|
|
374
|
-
return
|
|
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
|
-
|
|
646
|
+
_context8.next = 8;
|
|
381
647
|
break;
|
|
382
648
|
}
|
|
383
649
|
|
|
384
|
-
return
|
|
650
|
+
return _context8.abrupt("return", "continue");
|
|
385
651
|
|
|
386
652
|
case 8:
|
|
387
653
|
if (!((0, _extensions.isFieldset)(field) && depth === 0)) {
|
|
388
|
-
|
|
654
|
+
_context8.next = 24;
|
|
389
655
|
break;
|
|
390
656
|
}
|
|
391
657
|
|
|
392
|
-
|
|
658
|
+
_context8.next = 11;
|
|
393
659
|
return (0, _extensions.getFieldDeserializer)(manifest, field.options.transformer);
|
|
394
660
|
|
|
395
661
|
case 11:
|
|
396
|
-
fieldDeserializer =
|
|
662
|
+
fieldDeserializer = _context8.sent;
|
|
397
663
|
|
|
398
664
|
if (!fieldDeserializer) {
|
|
399
|
-
|
|
665
|
+
_context8.next = 24;
|
|
400
666
|
break;
|
|
401
667
|
}
|
|
402
668
|
|
|
403
|
-
|
|
669
|
+
_context8.prev = 13;
|
|
404
670
|
value = fieldDeserializer(value);
|
|
405
|
-
|
|
671
|
+
_context8.next = 21;
|
|
406
672
|
break;
|
|
407
673
|
|
|
408
674
|
case 17:
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
errors.push((0, _defineProperty2.default)({}, name,
|
|
412
|
-
return
|
|
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
|
-
|
|
681
|
+
_context8.next = 23;
|
|
416
682
|
return deserialize(manifest, value, field.fields, depth + 1);
|
|
417
683
|
|
|
418
684
|
case 23:
|
|
419
|
-
value =
|
|
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
|
|
692
|
+
return _context8.stop();
|
|
427
693
|
}
|
|
428
694
|
}
|
|
429
|
-
},
|
|
695
|
+
}, _loop2, null, [[13, 17]]);
|
|
430
696
|
});
|
|
431
697
|
|
|
432
698
|
_iterator2.s();
|
|
433
699
|
|
|
434
|
-
case
|
|
700
|
+
case 9:
|
|
435
701
|
if ((_step2 = _iterator2.n()).done) {
|
|
436
|
-
|
|
702
|
+
_context9.next = 16;
|
|
437
703
|
break;
|
|
438
704
|
}
|
|
439
705
|
|
|
440
|
-
return
|
|
706
|
+
return _context9.delegateYield(_loop2(), "t0", 11);
|
|
441
707
|
|
|
442
|
-
case
|
|
443
|
-
|
|
708
|
+
case 11:
|
|
709
|
+
_ret2 = _context9.t0;
|
|
444
710
|
|
|
445
|
-
if (!(
|
|
446
|
-
|
|
711
|
+
if (!(_ret2 === "continue")) {
|
|
712
|
+
_context9.next = 14;
|
|
447
713
|
break;
|
|
448
714
|
}
|
|
449
715
|
|
|
450
|
-
return
|
|
716
|
+
return _context9.abrupt("continue", 14);
|
|
451
717
|
|
|
452
|
-
case
|
|
453
|
-
|
|
718
|
+
case 14:
|
|
719
|
+
_context9.next = 9;
|
|
454
720
|
break;
|
|
455
721
|
|
|
456
|
-
case
|
|
457
|
-
|
|
722
|
+
case 16:
|
|
723
|
+
_context9.next = 21;
|
|
458
724
|
break;
|
|
459
725
|
|
|
460
|
-
case
|
|
461
|
-
|
|
462
|
-
|
|
726
|
+
case 18:
|
|
727
|
+
_context9.prev = 18;
|
|
728
|
+
_context9.t1 = _context9["catch"](6);
|
|
463
729
|
|
|
464
|
-
_iterator2.e(
|
|
730
|
+
_iterator2.e(_context9.t1);
|
|
465
731
|
|
|
466
|
-
case
|
|
467
|
-
|
|
732
|
+
case 21:
|
|
733
|
+
_context9.prev = 21;
|
|
468
734
|
|
|
469
735
|
_iterator2.f();
|
|
470
736
|
|
|
471
|
-
return
|
|
737
|
+
return _context9.finish(21);
|
|
472
738
|
|
|
473
|
-
case
|
|
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
|
|
746
|
+
return _context9.abrupt("return", injectDefaultValues(result, flattenedFields));
|
|
481
747
|
|
|
482
|
-
case
|
|
748
|
+
case 27:
|
|
483
749
|
case "end":
|
|
484
|
-
return
|
|
750
|
+
return _context9.stop();
|
|
485
751
|
}
|
|
486
752
|
}
|
|
487
|
-
},
|
|
753
|
+
}, _callee8, null, [[6, 18, 21, 24]]);
|
|
488
754
|
}));
|
|
489
755
|
|
|
490
|
-
return function deserialize(
|
|
491
|
-
return
|
|
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
|
|
771
|
+
for (var _key2 in current) {
|
|
530
772
|
var keys = Object.keys(obj);
|
|
531
|
-
var resultKey =
|
|
773
|
+
var resultKey = _key2;
|
|
532
774
|
var idx = 1;
|
|
533
775
|
|
|
534
776
|
while (keys.indexOf(resultKey) >= 0) {
|
|
535
|
-
resultKey = "".concat((0, _utils.getNameFromDuplicateField)(
|
|
777
|
+
resultKey = "".concat((0, _utils.getNameFromDuplicateField)(_key2), ":").concat(idx);
|
|
536
778
|
idx++;
|
|
537
779
|
}
|
|
538
780
|
|
|
539
|
-
obj[resultKey] = current[
|
|
781
|
+
obj[resultKey] = current[_key2];
|
|
540
782
|
}
|
|
541
783
|
|
|
542
784
|
return obj;
|