@atlaskit/editor-core 191.0.0 → 191.0.3
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 +16 -0
- package/afm-cc/tsconfig.json +0 -42
- package/dist/cjs/actions/index.js +5 -4
- package/dist/cjs/i18n/cs.js +0 -4
- package/dist/cjs/i18n/da.js +0 -4
- package/dist/cjs/i18n/de.js +0 -4
- package/dist/cjs/i18n/en.js +0 -4
- package/dist/cjs/i18n/en_GB.js +0 -4
- package/dist/cjs/i18n/en_ZZ.js +0 -4
- package/dist/cjs/i18n/es.js +0 -4
- package/dist/cjs/i18n/fi.js +0 -4
- package/dist/cjs/i18n/fr.js +0 -4
- package/dist/cjs/i18n/hu.js +0 -4
- package/dist/cjs/i18n/it.js +0 -4
- package/dist/cjs/i18n/ja.js +0 -4
- package/dist/cjs/i18n/ko.js +0 -4
- package/dist/cjs/i18n/nb.js +0 -4
- package/dist/cjs/i18n/nl.js +0 -4
- package/dist/cjs/i18n/pl.js +0 -4
- package/dist/cjs/i18n/pt_BR.js +0 -4
- package/dist/cjs/i18n/ru.js +0 -4
- package/dist/cjs/i18n/sv.js +0 -4
- package/dist/cjs/i18n/th.js +0 -4
- package/dist/cjs/i18n/tr.js +0 -4
- package/dist/cjs/i18n/uk.js +0 -4
- package/dist/cjs/i18n/vi.js +0 -4
- package/dist/cjs/i18n/zh.js +0 -4
- package/dist/cjs/i18n/zh_TW.js +0 -4
- package/dist/cjs/plugins/find-replace/FindReplaceToolbarButtonWithState.js +82 -62
- package/dist/cjs/plugins/find-replace/commands.js +1 -1
- package/dist/cjs/plugins/find-replace/index.js +42 -10
- package/dist/cjs/plugins/find-replace/keymap.js +1 -1
- package/dist/cjs/plugins/{extension → find-replace}/plugin-key.js +2 -2
- package/dist/cjs/plugins/find-replace/plugin.js +15 -16
- package/dist/cjs/plugins/find-replace/types.js +1 -4
- package/dist/cjs/plugins/find-replace/ui/FindReplaceToolbarButton.js +2 -6
- package/dist/cjs/plugins/find-replace/ui/FindReplaceTooltipButton.js +1 -1
- package/dist/cjs/plugins/find-replace/utils/commands.js +16 -0
- package/dist/cjs/plugins/index.js +0 -7
- package/dist/cjs/presets/universal.js +9 -3
- package/dist/cjs/ui/Appearance/FullPage/FullPageToolbar.js +2 -9
- package/dist/cjs/utils/action.js +7 -7
- package/dist/cjs/utils/commands.js +1 -11
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/es2019/actions/index.js +5 -3
- package/dist/es2019/i18n/cs.js +0 -4
- package/dist/es2019/i18n/da.js +0 -4
- package/dist/es2019/i18n/de.js +0 -4
- package/dist/es2019/i18n/en.js +0 -4
- package/dist/es2019/i18n/en_GB.js +0 -4
- package/dist/es2019/i18n/en_ZZ.js +0 -4
- package/dist/es2019/i18n/es.js +0 -4
- package/dist/es2019/i18n/fi.js +0 -4
- package/dist/es2019/i18n/fr.js +0 -4
- package/dist/es2019/i18n/hu.js +0 -4
- package/dist/es2019/i18n/it.js +0 -4
- package/dist/es2019/i18n/ja.js +0 -4
- package/dist/es2019/i18n/ko.js +0 -4
- package/dist/es2019/i18n/nb.js +0 -4
- package/dist/es2019/i18n/nl.js +0 -4
- package/dist/es2019/i18n/pl.js +0 -4
- package/dist/es2019/i18n/pt_BR.js +0 -4
- package/dist/es2019/i18n/ru.js +0 -4
- package/dist/es2019/i18n/sv.js +0 -4
- package/dist/es2019/i18n/th.js +0 -4
- package/dist/es2019/i18n/tr.js +0 -4
- package/dist/es2019/i18n/uk.js +0 -4
- package/dist/es2019/i18n/vi.js +0 -4
- package/dist/es2019/i18n/zh.js +0 -4
- package/dist/es2019/i18n/zh_TW.js +0 -4
- package/dist/es2019/plugins/find-replace/FindReplaceToolbarButtonWithState.js +58 -43
- package/dist/es2019/plugins/find-replace/commands.js +1 -1
- package/dist/es2019/plugins/find-replace/index.js +35 -2
- package/dist/es2019/plugins/find-replace/keymap.js +1 -1
- package/dist/es2019/plugins/find-replace/plugin-key.js +2 -0
- package/dist/es2019/plugins/find-replace/plugin.js +2 -2
- package/dist/es2019/plugins/find-replace/types.js +1 -2
- package/dist/es2019/plugins/find-replace/ui/FindReplaceToolbarButton.js +1 -1
- package/dist/es2019/plugins/find-replace/ui/FindReplaceTooltipButton.js +1 -1
- package/dist/es2019/plugins/find-replace/utils/commands.js +6 -0
- package/dist/es2019/plugins/index.js +0 -1
- package/dist/es2019/presets/universal.js +10 -3
- package/dist/es2019/ui/Appearance/FullPage/FullPageToolbar.js +2 -9
- package/dist/es2019/utils/action.js +5 -5
- package/dist/es2019/utils/commands.js +1 -7
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/esm/actions/index.js +5 -4
- package/dist/esm/i18n/cs.js +0 -4
- package/dist/esm/i18n/da.js +0 -4
- package/dist/esm/i18n/de.js +0 -4
- package/dist/esm/i18n/en.js +0 -4
- package/dist/esm/i18n/en_GB.js +0 -4
- package/dist/esm/i18n/en_ZZ.js +0 -4
- package/dist/esm/i18n/es.js +0 -4
- package/dist/esm/i18n/fi.js +0 -4
- package/dist/esm/i18n/fr.js +0 -4
- package/dist/esm/i18n/hu.js +0 -4
- package/dist/esm/i18n/it.js +0 -4
- package/dist/esm/i18n/ja.js +0 -4
- package/dist/esm/i18n/ko.js +0 -4
- package/dist/esm/i18n/nb.js +0 -4
- package/dist/esm/i18n/nl.js +0 -4
- package/dist/esm/i18n/pl.js +0 -4
- package/dist/esm/i18n/pt_BR.js +0 -4
- package/dist/esm/i18n/ru.js +0 -4
- package/dist/esm/i18n/sv.js +0 -4
- package/dist/esm/i18n/th.js +0 -4
- package/dist/esm/i18n/tr.js +0 -4
- package/dist/esm/i18n/uk.js +0 -4
- package/dist/esm/i18n/vi.js +0 -4
- package/dist/esm/i18n/zh.js +0 -4
- package/dist/esm/i18n/zh_TW.js +0 -4
- package/dist/esm/plugins/find-replace/FindReplaceToolbarButtonWithState.js +80 -62
- package/dist/esm/plugins/find-replace/commands.js +1 -1
- package/dist/esm/plugins/find-replace/index.js +42 -10
- package/dist/esm/plugins/find-replace/keymap.js +1 -1
- package/dist/esm/plugins/{extension → find-replace}/plugin-key.js +1 -1
- package/dist/esm/plugins/find-replace/plugin.js +2 -2
- package/dist/esm/plugins/find-replace/types.js +1 -2
- package/dist/esm/plugins/find-replace/ui/FindReplaceToolbarButton.js +1 -1
- package/dist/esm/plugins/find-replace/ui/FindReplaceTooltipButton.js +1 -1
- package/dist/esm/plugins/find-replace/utils/commands.js +10 -0
- package/dist/esm/plugins/index.js +0 -1
- package/dist/esm/presets/universal.js +9 -3
- package/dist/esm/ui/Appearance/FullPage/FullPageToolbar.js +2 -9
- package/dist/esm/utils/action.js +7 -7
- package/dist/esm/utils/commands.js +1 -11
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/types/i18n/cs.d.ts +0 -4
- package/dist/types/i18n/da.d.ts +0 -4
- package/dist/types/i18n/de.d.ts +0 -4
- package/dist/types/i18n/en.d.ts +0 -4
- package/dist/types/i18n/en_GB.d.ts +0 -4
- package/dist/types/i18n/en_ZZ.d.ts +0 -4
- package/dist/types/i18n/es.d.ts +0 -4
- package/dist/types/i18n/fi.d.ts +0 -4
- package/dist/types/i18n/fr.d.ts +0 -4
- package/dist/types/i18n/hu.d.ts +0 -4
- package/dist/types/i18n/it.d.ts +0 -4
- package/dist/types/i18n/ja.d.ts +0 -4
- package/dist/types/i18n/ko.d.ts +0 -4
- package/dist/types/i18n/nb.d.ts +0 -4
- package/dist/types/i18n/nl.d.ts +0 -4
- package/dist/types/i18n/pl.d.ts +0 -4
- package/dist/types/i18n/pt_BR.d.ts +0 -4
- package/dist/types/i18n/ru.d.ts +0 -4
- package/dist/types/i18n/sv.d.ts +0 -4
- package/dist/types/i18n/th.d.ts +0 -4
- package/dist/types/i18n/tr.d.ts +0 -4
- package/dist/types/i18n/uk.d.ts +0 -4
- package/dist/types/i18n/vi.d.ts +0 -4
- package/dist/types/i18n/zh.d.ts +0 -4
- package/dist/types/i18n/zh_TW.d.ts +0 -4
- package/dist/types/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +4 -19
- package/dist/types/plugins/find-replace/commands-with-analytics.d.ts +2 -2
- package/dist/types/plugins/find-replace/index.d.ts +1 -14
- package/dist/types/plugins/find-replace/plugin-key.d.ts +3 -0
- package/dist/types/plugins/find-replace/plugin.d.ts +1 -1
- package/dist/types/plugins/find-replace/types.d.ts +37 -2
- package/dist/types/plugins/find-replace/utils/commands.d.ts +2 -0
- package/dist/types/plugins/index.d.ts +0 -1
- package/dist/types/presets/default.d.ts +16 -0
- package/dist/types/ui/Appearance/FullPage/StyledComponents.d.ts +2 -2
- package/dist/types/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types/utils/action.d.ts +7 -1
- package/dist/types/utils/commands.d.ts +1 -3
- package/dist/types-ts4.5/i18n/cs.d.ts +0 -4
- package/dist/types-ts4.5/i18n/da.d.ts +0 -4
- package/dist/types-ts4.5/i18n/de.d.ts +0 -4
- package/dist/types-ts4.5/i18n/en.d.ts +0 -4
- package/dist/types-ts4.5/i18n/en_GB.d.ts +0 -4
- package/dist/types-ts4.5/i18n/en_ZZ.d.ts +0 -4
- package/dist/types-ts4.5/i18n/es.d.ts +0 -4
- package/dist/types-ts4.5/i18n/fi.d.ts +0 -4
- package/dist/types-ts4.5/i18n/fr.d.ts +0 -4
- package/dist/types-ts4.5/i18n/hu.d.ts +0 -4
- package/dist/types-ts4.5/i18n/it.d.ts +0 -4
- package/dist/types-ts4.5/i18n/ja.d.ts +0 -4
- package/dist/types-ts4.5/i18n/ko.d.ts +0 -4
- package/dist/types-ts4.5/i18n/nb.d.ts +0 -4
- package/dist/types-ts4.5/i18n/nl.d.ts +0 -4
- package/dist/types-ts4.5/i18n/pl.d.ts +0 -4
- package/dist/types-ts4.5/i18n/pt_BR.d.ts +0 -4
- package/dist/types-ts4.5/i18n/ru.d.ts +0 -4
- package/dist/types-ts4.5/i18n/sv.d.ts +0 -4
- package/dist/types-ts4.5/i18n/th.d.ts +0 -4
- package/dist/types-ts4.5/i18n/tr.d.ts +0 -4
- package/dist/types-ts4.5/i18n/uk.d.ts +0 -4
- package/dist/types-ts4.5/i18n/vi.d.ts +0 -4
- package/dist/types-ts4.5/i18n/zh.d.ts +0 -4
- package/dist/types-ts4.5/i18n/zh_TW.d.ts +0 -4
- package/dist/types-ts4.5/plugins/find-replace/FindReplaceToolbarButtonWithState.d.ts +4 -19
- package/dist/types-ts4.5/plugins/find-replace/commands-with-analytics.d.ts +2 -2
- package/dist/types-ts4.5/plugins/find-replace/index.d.ts +1 -14
- package/dist/types-ts4.5/plugins/find-replace/plugin-key.d.ts +3 -0
- package/dist/types-ts4.5/plugins/find-replace/plugin.d.ts +1 -1
- package/dist/types-ts4.5/plugins/find-replace/types.d.ts +37 -2
- package/dist/types-ts4.5/plugins/find-replace/utils/commands.d.ts +2 -0
- package/dist/types-ts4.5/plugins/index.d.ts +0 -1
- package/dist/types-ts4.5/presets/default.d.ts +16 -0
- package/dist/types-ts4.5/ui/Appearance/FullPage/StyledComponents.d.ts +2 -2
- package/dist/types-ts4.5/ui/ContentStyles/index.d.ts +2 -2
- package/dist/types-ts4.5/utils/action.d.ts +7 -1
- package/dist/types-ts4.5/utils/commands.d.ts +1 -3
- package/docs/3-annotations.tsx +5 -5
- package/package.json +13 -29
- package/tsconfig.json +3 -2
- package/dist/cjs/plugins/extension/actions.js +0 -236
- package/dist/cjs/plugins/extension/commands.js +0 -120
- package/dist/cjs/plugins/extension/context-panel.js +0 -269
- package/dist/cjs/plugins/extension/extension-api.js +0 -266
- package/dist/cjs/plugins/extension/index.js +0 -137
- package/dist/cjs/plugins/extension/plugin-factory.js +0 -32
- package/dist/cjs/plugins/extension/pm-plugins/keymap.js +0 -21
- package/dist/cjs/plugins/extension/pm-plugins/macro/actions.js +0 -186
- package/dist/cjs/plugins/extension/pm-plugins/macro/index.js +0 -72
- package/dist/cjs/plugins/extension/pm-plugins/macro/plugin-key.js +0 -8
- package/dist/cjs/plugins/extension/pm-plugins/macro/types.js +0 -5
- package/dist/cjs/plugins/extension/pm-plugins/main.js +0 -323
- package/dist/cjs/plugins/extension/pm-plugins/unique-id.js +0 -80
- package/dist/cjs/plugins/extension/pm-plugins/utils.js +0 -75
- package/dist/cjs/plugins/extension/reducer.js +0 -18
- package/dist/cjs/plugins/extension/toolbar.js +0 -239
- package/dist/cjs/plugins/extension/types.js +0 -5
- package/dist/cjs/plugins/extension/ui/ConfigPanel/ConfigPanel.js +0 -474
- package/dist/cjs/plugins/extension/ui/ConfigPanel/ConfigPanelFieldsLoader.js +0 -122
- package/dist/cjs/plugins/extension/ui/ConfigPanel/ConfigPanelLoader.js +0 -23
- package/dist/cjs/plugins/extension/ui/ConfigPanel/ErrorMessage/ErrorImage.js +0 -74
- package/dist/cjs/plugins/extension/ui/ConfigPanel/ErrorMessage/index.js +0 -33
- package/dist/cjs/plugins/extension/ui/ConfigPanel/FieldMessages.js +0 -103
- package/dist/cjs/plugins/extension/ui/ConfigPanel/Fields/Boolean.js +0 -144
- package/dist/cjs/plugins/extension/ui/ConfigPanel/Fields/CheckboxGroup.js +0 -101
- package/dist/cjs/plugins/extension/ui/ConfigPanel/Fields/ColorPicker.js +0 -411
- package/dist/cjs/plugins/extension/ui/ConfigPanel/Fields/CustomSelect.js +0 -192
- package/dist/cjs/plugins/extension/ui/ConfigPanel/Fields/Date.js +0 -55
- package/dist/cjs/plugins/extension/ui/ConfigPanel/Fields/DateRange.js +0 -155
- package/dist/cjs/plugins/extension/ui/ConfigPanel/Fields/Enum.js +0 -41
- package/dist/cjs/plugins/extension/ui/ConfigPanel/Fields/Expand.js +0 -64
- package/dist/cjs/plugins/extension/ui/ConfigPanel/Fields/Fieldset.js +0 -266
- package/dist/cjs/plugins/extension/ui/ConfigPanel/Fields/Number.js +0 -64
- package/dist/cjs/plugins/extension/ui/ConfigPanel/Fields/RadioGroup.js +0 -56
- package/dist/cjs/plugins/extension/ui/ConfigPanel/Fields/Select.js +0 -60
- package/dist/cjs/plugins/extension/ui/ConfigPanel/Fields/SelectItem.js +0 -40
- package/dist/cjs/plugins/extension/ui/ConfigPanel/Fields/String.js +0 -75
- package/dist/cjs/plugins/extension/ui/ConfigPanel/Fields/TabGroup.js +0 -60
- package/dist/cjs/plugins/extension/ui/ConfigPanel/Fields/UnhandledType.js +0 -19
- package/dist/cjs/plugins/extension/ui/ConfigPanel/Fields/UserSelect.js +0 -268
- package/dist/cjs/plugins/extension/ui/ConfigPanel/Fields/common/RequiredIndicator.js +0 -12
- package/dist/cjs/plugins/extension/ui/ConfigPanel/FormContent.js +0 -231
- package/dist/cjs/plugins/extension/ui/ConfigPanel/FormErrorBoundary.js +0 -139
- package/dist/cjs/plugins/extension/ui/ConfigPanel/Header.js +0 -99
- package/dist/cjs/plugins/extension/ui/ConfigPanel/LoadingState.js +0 -22
- package/dist/cjs/plugins/extension/ui/ConfigPanel/NestedForms/RemovableField.js +0 -48
- package/dist/cjs/plugins/extension/ui/ConfigPanel/constants.js +0 -13
- package/dist/cjs/plugins/extension/ui/ConfigPanel/index.js +0 -9
- package/dist/cjs/plugins/extension/ui/ConfigPanel/messages.js +0 -99
- package/dist/cjs/plugins/extension/ui/ConfigPanel/transformers.js +0 -629
- package/dist/cjs/plugins/extension/ui/ConfigPanel/types.js +0 -15
- package/dist/cjs/plugins/extension/ui/ConfigPanel/use-abortable-effect/index.js +0 -56
- package/dist/cjs/plugins/extension/ui/ConfigPanel/use-state-from-promise/index.js +0 -41
- package/dist/cjs/plugins/extension/ui/ConfigPanel/utils.js +0 -116
- package/dist/cjs/plugins/extension/ui/SaveIndicator/SaveIndicator.js +0 -63
- package/dist/cjs/plugins/extension/ui/SaveIndicator/messages.js +0 -14
- package/dist/cjs/plugins/extension/ui/SaveIndicator/types.js +0 -5
- package/dist/cjs/plugins/extension/utils.js +0 -73
- package/dist/es2019/plugins/extension/actions.js +0 -203
- package/dist/es2019/plugins/extension/commands.js +0 -97
- package/dist/es2019/plugins/extension/context-panel.js +0 -181
- package/dist/es2019/plugins/extension/extension-api.js +0 -284
- package/dist/es2019/plugins/extension/index.js +0 -128
- package/dist/es2019/plugins/extension/plugin-factory.js +0 -26
- package/dist/es2019/plugins/extension/plugin-key.js +0 -2
- package/dist/es2019/plugins/extension/pm-plugins/keymap.js +0 -15
- package/dist/es2019/plugins/extension/pm-plugins/macro/actions.js +0 -152
- package/dist/es2019/plugins/extension/pm-plugins/macro/index.js +0 -36
- package/dist/es2019/plugins/extension/pm-plugins/macro/plugin-key.js +0 -2
- package/dist/es2019/plugins/extension/pm-plugins/macro/types.js +0 -1
- package/dist/es2019/plugins/extension/pm-plugins/main.js +0 -230
- package/dist/es2019/plugins/extension/pm-plugins/unique-id.js +0 -69
- package/dist/es2019/plugins/extension/pm-plugins/utils.js +0 -30
- package/dist/es2019/plugins/extension/reducer.js +0 -11
- package/dist/es2019/plugins/extension/toolbar.js +0 -234
- package/dist/es2019/plugins/extension/types.js +0 -1
- package/dist/es2019/plugins/extension/ui/ConfigPanel/ConfigPanel.js +0 -415
- package/dist/es2019/plugins/extension/ui/ConfigPanel/ConfigPanelFieldsLoader.js +0 -100
- package/dist/es2019/plugins/extension/ui/ConfigPanel/ConfigPanelLoader.js +0 -7
- package/dist/es2019/plugins/extension/ui/ConfigPanel/ErrorMessage/ErrorImage.js +0 -66
- package/dist/es2019/plugins/extension/ui/ConfigPanel/ErrorMessage/index.js +0 -25
- package/dist/es2019/plugins/extension/ui/ConfigPanel/FieldMessages.js +0 -99
- package/dist/es2019/plugins/extension/ui/ConfigPanel/Fields/Boolean.js +0 -136
- package/dist/es2019/plugins/extension/ui/ConfigPanel/Fields/CheckboxGroup.js +0 -95
- package/dist/es2019/plugins/extension/ui/ConfigPanel/Fields/ColorPicker.js +0 -410
- package/dist/es2019/plugins/extension/ui/ConfigPanel/Fields/CustomSelect.js +0 -132
- package/dist/es2019/plugins/extension/ui/ConfigPanel/Fields/Date.js +0 -50
- package/dist/es2019/plugins/extension/ui/ConfigPanel/Fields/DateRange.js +0 -139
- package/dist/es2019/plugins/extension/ui/ConfigPanel/Fields/Enum.js +0 -35
- package/dist/es2019/plugins/extension/ui/ConfigPanel/Fields/Expand.js +0 -69
- package/dist/es2019/plugins/extension/ui/ConfigPanel/Fields/Fieldset.js +0 -226
- package/dist/es2019/plugins/extension/ui/ConfigPanel/Fields/Number.js +0 -61
- package/dist/es2019/plugins/extension/ui/ConfigPanel/Fields/RadioGroup.js +0 -40
- package/dist/es2019/plugins/extension/ui/ConfigPanel/Fields/Select.js +0 -50
- package/dist/es2019/plugins/extension/ui/ConfigPanel/Fields/SelectItem.js +0 -47
- package/dist/es2019/plugins/extension/ui/ConfigPanel/Fields/String.js +0 -67
- package/dist/es2019/plugins/extension/ui/ConfigPanel/Fields/TabGroup.js +0 -56
- package/dist/es2019/plugins/extension/ui/ConfigPanel/Fields/UnhandledType.js +0 -11
- package/dist/es2019/plugins/extension/ui/ConfigPanel/Fields/UserSelect.js +0 -194
- package/dist/es2019/plugins/extension/ui/ConfigPanel/Fields/common/RequiredIndicator.js +0 -5
- package/dist/es2019/plugins/extension/ui/ConfigPanel/FormContent.js +0 -225
- package/dist/es2019/plugins/extension/ui/ConfigPanel/FormErrorBoundary.js +0 -99
- package/dist/es2019/plugins/extension/ui/ConfigPanel/Header.js +0 -141
- package/dist/es2019/plugins/extension/ui/ConfigPanel/LoadingState.js +0 -15
- package/dist/es2019/plugins/extension/ui/ConfigPanel/NestedForms/RemovableField.js +0 -54
- package/dist/es2019/plugins/extension/ui/ConfigPanel/constants.js +0 -7
- package/dist/es2019/plugins/extension/ui/ConfigPanel/index.js +0 -2
- package/dist/es2019/plugins/extension/ui/ConfigPanel/messages.js +0 -93
- package/dist/es2019/plugins/extension/ui/ConfigPanel/transformers.js +0 -365
- package/dist/es2019/plugins/extension/ui/ConfigPanel/types.js +0 -9
- package/dist/es2019/plugins/extension/ui/ConfigPanel/use-abortable-effect/index.js +0 -46
- package/dist/es2019/plugins/extension/ui/ConfigPanel/use-state-from-promise/index.js +0 -30
- package/dist/es2019/plugins/extension/ui/ConfigPanel/utils.js +0 -86
- package/dist/es2019/plugins/extension/ui/SaveIndicator/SaveIndicator.js +0 -67
- package/dist/es2019/plugins/extension/ui/SaveIndicator/messages.js +0 -8
- package/dist/es2019/plugins/extension/ui/SaveIndicator/types.js +0 -1
- package/dist/es2019/plugins/extension/utils.js +0 -65
- package/dist/esm/plugins/extension/actions.js +0 -223
- package/dist/esm/plugins/extension/commands.js +0 -111
- package/dist/esm/plugins/extension/context-panel.js +0 -261
- package/dist/esm/plugins/extension/extension-api.js +0 -259
- package/dist/esm/plugins/extension/index.js +0 -130
- package/dist/esm/plugins/extension/plugin-factory.js +0 -25
- package/dist/esm/plugins/extension/pm-plugins/keymap.js +0 -15
- package/dist/esm/plugins/extension/pm-plugins/macro/actions.js +0 -179
- package/dist/esm/plugins/extension/pm-plugins/macro/index.js +0 -42
- package/dist/esm/plugins/extension/pm-plugins/macro/plugin-key.js +0 -2
- package/dist/esm/plugins/extension/pm-plugins/macro/types.js +0 -1
- package/dist/esm/plugins/extension/pm-plugins/main.js +0 -298
- package/dist/esm/plugins/extension/pm-plugins/unique-id.js +0 -74
- package/dist/esm/plugins/extension/pm-plugins/utils.js +0 -68
- package/dist/esm/plugins/extension/reducer.js +0 -11
- package/dist/esm/plugins/extension/toolbar.js +0 -233
- package/dist/esm/plugins/extension/types.js +0 -1
- package/dist/esm/plugins/extension/ui/ConfigPanel/ConfigPanel.js +0 -465
- package/dist/esm/plugins/extension/ui/ConfigPanel/ConfigPanelFieldsLoader.js +0 -112
- package/dist/esm/plugins/extension/ui/ConfigPanel/ConfigPanelLoader.js +0 -11
- package/dist/esm/plugins/extension/ui/ConfigPanel/ErrorMessage/ErrorImage.js +0 -67
- package/dist/esm/plugins/extension/ui/ConfigPanel/ErrorMessage/index.js +0 -26
- package/dist/esm/plugins/extension/ui/ConfigPanel/FieldMessages.js +0 -95
- package/dist/esm/plugins/extension/ui/ConfigPanel/Fields/Boolean.js +0 -134
- package/dist/esm/plugins/extension/ui/ConfigPanel/Fields/CheckboxGroup.js +0 -94
- package/dist/esm/plugins/extension/ui/ConfigPanel/Fields/ColorPicker.js +0 -406
- package/dist/esm/plugins/extension/ui/ConfigPanel/Fields/CustomSelect.js +0 -182
- package/dist/esm/plugins/extension/ui/ConfigPanel/Fields/Date.js +0 -48
- package/dist/esm/plugins/extension/ui/ConfigPanel/Fields/DateRange.js +0 -148
- package/dist/esm/plugins/extension/ui/ConfigPanel/Fields/Enum.js +0 -34
- package/dist/esm/plugins/extension/ui/ConfigPanel/Fields/Expand.js +0 -54
- package/dist/esm/plugins/extension/ui/ConfigPanel/Fields/Fieldset.js +0 -256
- package/dist/esm/plugins/extension/ui/ConfigPanel/Fields/Number.js +0 -57
- package/dist/esm/plugins/extension/ui/ConfigPanel/Fields/RadioGroup.js +0 -46
- package/dist/esm/plugins/extension/ui/ConfigPanel/Fields/Select.js +0 -50
- package/dist/esm/plugins/extension/ui/ConfigPanel/Fields/SelectItem.js +0 -33
- package/dist/esm/plugins/extension/ui/ConfigPanel/Fields/String.js +0 -65
- package/dist/esm/plugins/extension/ui/ConfigPanel/Fields/TabGroup.js +0 -50
- package/dist/esm/plugins/extension/ui/ConfigPanel/Fields/UnhandledType.js +0 -10
- package/dist/esm/plugins/extension/ui/ConfigPanel/Fields/UserSelect.js +0 -258
- package/dist/esm/plugins/extension/ui/ConfigPanel/Fields/common/RequiredIndicator.js +0 -5
- package/dist/esm/plugins/extension/ui/ConfigPanel/FormContent.js +0 -223
- package/dist/esm/plugins/extension/ui/ConfigPanel/FormErrorBoundary.js +0 -132
- package/dist/esm/plugins/extension/ui/ConfigPanel/Header.js +0 -92
- package/dist/esm/plugins/extension/ui/ConfigPanel/LoadingState.js +0 -15
- package/dist/esm/plugins/extension/ui/ConfigPanel/NestedForms/RemovableField.js +0 -41
- package/dist/esm/plugins/extension/ui/ConfigPanel/constants.js +0 -7
- package/dist/esm/plugins/extension/ui/ConfigPanel/index.js +0 -2
- package/dist/esm/plugins/extension/ui/ConfigPanel/messages.js +0 -93
- package/dist/esm/plugins/extension/ui/ConfigPanel/transformers.js +0 -622
- package/dist/esm/plugins/extension/ui/ConfigPanel/types.js +0 -9
- package/dist/esm/plugins/extension/ui/ConfigPanel/use-abortable-effect/index.js +0 -49
- package/dist/esm/plugins/extension/ui/ConfigPanel/use-state-from-promise/index.js +0 -34
- package/dist/esm/plugins/extension/ui/ConfigPanel/utils.js +0 -109
- package/dist/esm/plugins/extension/ui/SaveIndicator/SaveIndicator.js +0 -56
- package/dist/esm/plugins/extension/ui/SaveIndicator/messages.js +0 -8
- package/dist/esm/plugins/extension/ui/SaveIndicator/types.js +0 -1
- package/dist/esm/plugins/extension/utils.js +0 -67
- package/dist/types/plugins/extension/actions.d.ts +0 -20
- package/dist/types/plugins/extension/commands.d.ts +0 -15
- package/dist/types/plugins/extension/context-panel.d.ts +0 -10
- package/dist/types/plugins/extension/extension-api.d.ts +0 -12
- package/dist/types/plugins/extension/index.d.ts +0 -3
- package/dist/types/plugins/extension/plugin-factory.d.ts +0 -4
- package/dist/types/plugins/extension/plugin-key.d.ts +0 -3
- package/dist/types/plugins/extension/pm-plugins/keymap.d.ts +0 -3
- package/dist/types/plugins/extension/pm-plugins/macro/actions.d.ts +0 -9
- package/dist/types/plugins/extension/pm-plugins/macro/index.d.ts +0 -8
- package/dist/types/plugins/extension/pm-plugins/macro/plugin-key.d.ts +0 -3
- package/dist/types/plugins/extension/pm-plugins/macro/types.d.ts +0 -4
- package/dist/types/plugins/extension/pm-plugins/main.d.ts +0 -25
- package/dist/types/plugins/extension/pm-plugins/unique-id.d.ts +0 -3
- package/dist/types/plugins/extension/pm-plugins/utils.d.ts +0 -3
- package/dist/types/plugins/extension/reducer.d.ts +0 -2
- package/dist/types/plugins/extension/toolbar.d.ts +0 -44
- package/dist/types/plugins/extension/types.d.ts +0 -22
- package/dist/types/plugins/extension/ui/ConfigPanel/ConfigPanel.d.ts +0 -21
- package/dist/types/plugins/extension/ui/ConfigPanel/ConfigPanelFieldsLoader.d.ts +0 -20
- package/dist/types/plugins/extension/ui/ConfigPanel/ConfigPanelLoader.d.ts +0 -5
- package/dist/types/plugins/extension/ui/ConfigPanel/ErrorMessage/ErrorImage.d.ts +0 -4
- package/dist/types/plugins/extension/ui/ConfigPanel/ErrorMessage/index.d.ts +0 -10
- package/dist/types/plugins/extension/ui/ConfigPanel/FieldMessages.d.ts +0 -12
- package/dist/types/plugins/extension/ui/ConfigPanel/Fields/Boolean.d.ts +0 -8
- package/dist/types/plugins/extension/ui/ConfigPanel/Fields/CheckboxGroup.d.ts +0 -8
- package/dist/types/plugins/extension/ui/ConfigPanel/Fields/ColorPicker.d.ts +0 -21
- package/dist/types/plugins/extension/ui/ConfigPanel/Fields/CustomSelect.d.ts +0 -24
- package/dist/types/plugins/extension/ui/ConfigPanel/Fields/Date.d.ts +0 -20
- package/dist/types/plugins/extension/ui/ConfigPanel/Fields/DateRange.d.ts +0 -20
- package/dist/types/plugins/extension/ui/ConfigPanel/Fields/Enum.d.ts +0 -10
- package/dist/types/plugins/extension/ui/ConfigPanel/Fields/Expand.d.ts +0 -18
- package/dist/types/plugins/extension/ui/ConfigPanel/Fields/Fieldset.d.ts +0 -20
- package/dist/types/plugins/extension/ui/ConfigPanel/Fields/Number.d.ts +0 -10
- package/dist/types/plugins/extension/ui/ConfigPanel/Fields/RadioGroup.d.ts +0 -8
- package/dist/types/plugins/extension/ui/ConfigPanel/Fields/Select.d.ts +0 -11
- package/dist/types/plugins/extension/ui/ConfigPanel/Fields/SelectItem.d.ts +0 -5
- package/dist/types/plugins/extension/ui/ConfigPanel/Fields/String.d.ts +0 -10
- package/dist/types/plugins/extension/ui/ConfigPanel/Fields/TabGroup.d.ts +0 -14
- package/dist/types/plugins/extension/ui/ConfigPanel/Fields/UnhandledType.d.ts +0 -6
- package/dist/types/plugins/extension/ui/ConfigPanel/Fields/UserSelect.d.ts +0 -10
- package/dist/types/plugins/extension/ui/ConfigPanel/Fields/common/RequiredIndicator.d.ts +0 -1
- package/dist/types/plugins/extension/ui/ConfigPanel/FormContent.d.ts +0 -4
- package/dist/types/plugins/extension/ui/ConfigPanel/FormErrorBoundary.d.ts +0 -16
- package/dist/types/plugins/extension/ui/ConfigPanel/Header.d.ts +0 -23
- package/dist/types/plugins/extension/ui/ConfigPanel/LoadingState.d.ts +0 -4
- package/dist/types/plugins/extension/ui/ConfigPanel/NestedForms/RemovableField.d.ts +0 -19
- package/dist/types/plugins/extension/ui/ConfigPanel/constants.d.ts +0 -2
- package/dist/types/plugins/extension/ui/ConfigPanel/index.d.ts +0 -2
- package/dist/types/plugins/extension/ui/ConfigPanel/messages.d.ts +0 -92
- package/dist/types/plugins/extension/ui/ConfigPanel/transformers.d.ts +0 -9
- package/dist/types/plugins/extension/ui/ConfigPanel/types.d.ts +0 -37
- package/dist/types/plugins/extension/ui/ConfigPanel/use-abortable-effect/index.d.ts +0 -16
- package/dist/types/plugins/extension/ui/ConfigPanel/use-state-from-promise/index.d.ts +0 -15
- package/dist/types/plugins/extension/ui/ConfigPanel/utils.d.ts +0 -16
- package/dist/types/plugins/extension/ui/SaveIndicator/SaveIndicator.d.ts +0 -4
- package/dist/types/plugins/extension/ui/SaveIndicator/messages.d.ts +0 -7
- package/dist/types/plugins/extension/ui/SaveIndicator/types.d.ts +0 -11
- package/dist/types/plugins/extension/utils.d.ts +0 -15
- package/dist/types-ts4.5/plugins/extension/actions.d.ts +0 -20
- package/dist/types-ts4.5/plugins/extension/commands.d.ts +0 -15
- package/dist/types-ts4.5/plugins/extension/context-panel.d.ts +0 -10
- package/dist/types-ts4.5/plugins/extension/extension-api.d.ts +0 -12
- package/dist/types-ts4.5/plugins/extension/index.d.ts +0 -3
- package/dist/types-ts4.5/plugins/extension/plugin-factory.d.ts +0 -4
- package/dist/types-ts4.5/plugins/extension/plugin-key.d.ts +0 -3
- package/dist/types-ts4.5/plugins/extension/pm-plugins/keymap.d.ts +0 -3
- package/dist/types-ts4.5/plugins/extension/pm-plugins/macro/actions.d.ts +0 -9
- package/dist/types-ts4.5/plugins/extension/pm-plugins/macro/index.d.ts +0 -8
- package/dist/types-ts4.5/plugins/extension/pm-plugins/macro/plugin-key.d.ts +0 -3
- package/dist/types-ts4.5/plugins/extension/pm-plugins/macro/types.d.ts +0 -4
- package/dist/types-ts4.5/plugins/extension/pm-plugins/main.d.ts +0 -25
- package/dist/types-ts4.5/plugins/extension/pm-plugins/unique-id.d.ts +0 -3
- package/dist/types-ts4.5/plugins/extension/pm-plugins/utils.d.ts +0 -3
- package/dist/types-ts4.5/plugins/extension/reducer.d.ts +0 -2
- package/dist/types-ts4.5/plugins/extension/toolbar.d.ts +0 -44
- package/dist/types-ts4.5/plugins/extension/types.d.ts +0 -22
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/ConfigPanel.d.ts +0 -21
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/ConfigPanelFieldsLoader.d.ts +0 -20
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/ConfigPanelLoader.d.ts +0 -5
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/ErrorMessage/ErrorImage.d.ts +0 -4
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/ErrorMessage/index.d.ts +0 -10
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/FieldMessages.d.ts +0 -12
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/Fields/Boolean.d.ts +0 -8
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/Fields/CheckboxGroup.d.ts +0 -8
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/Fields/ColorPicker.d.ts +0 -21
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/Fields/CustomSelect.d.ts +0 -24
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/Fields/Date.d.ts +0 -20
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/Fields/DateRange.d.ts +0 -20
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/Fields/Enum.d.ts +0 -10
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/Fields/Expand.d.ts +0 -18
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/Fields/Fieldset.d.ts +0 -20
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/Fields/Number.d.ts +0 -10
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/Fields/RadioGroup.d.ts +0 -8
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/Fields/Select.d.ts +0 -11
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/Fields/SelectItem.d.ts +0 -5
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/Fields/String.d.ts +0 -10
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/Fields/TabGroup.d.ts +0 -14
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/Fields/UnhandledType.d.ts +0 -6
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/Fields/UserSelect.d.ts +0 -10
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/Fields/common/RequiredIndicator.d.ts +0 -1
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/FormContent.d.ts +0 -4
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/FormErrorBoundary.d.ts +0 -16
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/Header.d.ts +0 -23
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/LoadingState.d.ts +0 -4
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/NestedForms/RemovableField.d.ts +0 -19
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/constants.d.ts +0 -2
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/index.d.ts +0 -2
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/messages.d.ts +0 -92
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/transformers.d.ts +0 -9
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/types.d.ts +0 -40
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/use-abortable-effect/index.d.ts +0 -16
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/use-state-from-promise/index.d.ts +0 -18
- package/dist/types-ts4.5/plugins/extension/ui/ConfigPanel/utils.d.ts +0 -16
- package/dist/types-ts4.5/plugins/extension/ui/SaveIndicator/SaveIndicator.d.ts +0 -4
- package/dist/types-ts4.5/plugins/extension/ui/SaveIndicator/messages.d.ts +0 -7
- package/dist/types-ts4.5/plugins/extension/ui/SaveIndicator/types.d.ts +0 -11
- package/dist/types-ts4.5/plugins/extension/utils.d.ts +0 -15
|
@@ -1,465 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
6
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
11
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
|
-
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
13
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
15
|
-
import React, { useCallback, useRef, useEffect } from 'react';
|
|
16
|
-
import memoizeOne from 'memoize-one';
|
|
17
|
-
import { withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
18
|
-
import Form from '@atlaskit/form';
|
|
19
|
-
import { isTabGroup } from '@atlaskit/editor-common/extensions';
|
|
20
|
-
import _isEqual from 'lodash/isEqual';
|
|
21
|
-
import _mergeRecursive from 'lodash/merge';
|
|
22
|
-
import { fireAnalyticsEvent, EVENT_TYPE, ACTION_SUBJECT, ACTION } from '@atlaskit/editor-common/analytics';
|
|
23
|
-
import LoadingState from './LoadingState';
|
|
24
|
-
import Header from './Header';
|
|
25
|
-
import ErrorMessage from './ErrorMessage';
|
|
26
|
-
import { serialize, deserialize, findDuplicateFields } from './transformers';
|
|
27
|
-
import { injectIntl } from 'react-intl-next';
|
|
28
|
-
import ButtonGroup from '@atlaskit/button/button-group';
|
|
29
|
-
import Button from '@atlaskit/button/custom-theme-button';
|
|
30
|
-
import { FormFooter } from '@atlaskit/form';
|
|
31
|
-
import { pluginKey as extensionPluginKey } from '../../plugin-key';
|
|
32
|
-
import { WithPluginState } from '@atlaskit/editor-common/with-plugin-state';
|
|
33
|
-
import FormContent from './FormContent';
|
|
34
|
-
import { messages } from './messages';
|
|
35
|
-
import { FormErrorBoundary } from './FormErrorBoundary';
|
|
36
|
-
import { getLoggedParameters } from './utils';
|
|
37
|
-
import { ALLOWED_LOGGED_MACRO_PARAMS } from './constants';
|
|
38
|
-
function ConfigForm(_ref) {
|
|
39
|
-
var canSave = _ref.canSave,
|
|
40
|
-
errorMessage = _ref.errorMessage,
|
|
41
|
-
extensionManifest = _ref.extensionManifest,
|
|
42
|
-
fields = _ref.fields,
|
|
43
|
-
firstVisibleFieldName = _ref.firstVisibleFieldName,
|
|
44
|
-
hasParsedParameters = _ref.hasParsedParameters,
|
|
45
|
-
intl = _ref.intl,
|
|
46
|
-
isLoading = _ref.isLoading,
|
|
47
|
-
onCancel = _ref.onCancel,
|
|
48
|
-
onFieldChange = _ref.onFieldChange,
|
|
49
|
-
parameters = _ref.parameters,
|
|
50
|
-
submitting = _ref.submitting,
|
|
51
|
-
contextIdentifierProvider = _ref.contextIdentifierProvider,
|
|
52
|
-
featureFlags = _ref.featureFlags;
|
|
53
|
-
useEffect(function () {
|
|
54
|
-
if (fields) {
|
|
55
|
-
var firstDuplicateField = findDuplicateFields(fields);
|
|
56
|
-
if (firstDuplicateField) {
|
|
57
|
-
throw new Error("Possible duplicate field name: `".concat(firstDuplicateField.name, "`."));
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}, [fields]);
|
|
61
|
-
if (isLoading || !hasParsedParameters && errorMessage === null) {
|
|
62
|
-
return /*#__PURE__*/React.createElement(LoadingState, null);
|
|
63
|
-
}
|
|
64
|
-
if (errorMessage || !fields) {
|
|
65
|
-
return /*#__PURE__*/React.createElement(ErrorMessage, {
|
|
66
|
-
errorMessage: errorMessage || ''
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(FormContent, {
|
|
70
|
-
fields: fields,
|
|
71
|
-
parameters: parameters,
|
|
72
|
-
extensionManifest: extensionManifest,
|
|
73
|
-
onFieldChange: onFieldChange,
|
|
74
|
-
firstVisibleFieldName: firstVisibleFieldName,
|
|
75
|
-
contextIdentifierProvider: contextIdentifierProvider,
|
|
76
|
-
featureFlags: featureFlags
|
|
77
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
78
|
-
style: canSave ? {} : {
|
|
79
|
-
display: 'none'
|
|
80
|
-
}
|
|
81
|
-
}, /*#__PURE__*/React.createElement(FormFooter, {
|
|
82
|
-
align: "start"
|
|
83
|
-
}, /*#__PURE__*/React.createElement(ButtonGroup, null, /*#__PURE__*/React.createElement(Button, {
|
|
84
|
-
type: "submit",
|
|
85
|
-
appearance: "primary"
|
|
86
|
-
}, intl.formatMessage(messages.submit)), /*#__PURE__*/React.createElement(Button, {
|
|
87
|
-
appearance: "default",
|
|
88
|
-
isDisabled: submitting,
|
|
89
|
-
onClick: onCancel
|
|
90
|
-
}, intl.formatMessage(messages.cancel))))));
|
|
91
|
-
}
|
|
92
|
-
var ConfigFormIntl = injectIntl(ConfigForm);
|
|
93
|
-
var WithOnFieldChange = function WithOnFieldChange(_ref2) {
|
|
94
|
-
var getState = _ref2.getState,
|
|
95
|
-
autoSave = _ref2.autoSave,
|
|
96
|
-
handleSubmit = _ref2.handleSubmit,
|
|
97
|
-
children = _ref2.children;
|
|
98
|
-
var getStateRef = useRef(getState);
|
|
99
|
-
useEffect(function () {
|
|
100
|
-
getStateRef.current = getState;
|
|
101
|
-
}, [getState]);
|
|
102
|
-
var handleFieldChange = useCallback(function (name, isDirty) {
|
|
103
|
-
if (!autoSave) {
|
|
104
|
-
return;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// Don't trigger submit if nothing actually changed
|
|
108
|
-
if (!isDirty) {
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
var _getStateRef$current = getStateRef.current(),
|
|
112
|
-
errors = _getStateRef$current.errors,
|
|
113
|
-
values = _getStateRef$current.values;
|
|
114
|
-
|
|
115
|
-
// Get only values that does not contain errors
|
|
116
|
-
var validValues = {};
|
|
117
|
-
for (var _i = 0, _Object$keys = Object.keys(values); _i < _Object$keys.length; _i++) {
|
|
118
|
-
var key = _Object$keys[_i];
|
|
119
|
-
if (!errors[key]) {
|
|
120
|
-
// not has error
|
|
121
|
-
validValues[key] = values[key];
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
handleSubmit(validValues);
|
|
125
|
-
}, [autoSave, handleSubmit]);
|
|
126
|
-
return children(handleFieldChange);
|
|
127
|
-
};
|
|
128
|
-
var ConfigPanel = /*#__PURE__*/function (_React$Component) {
|
|
129
|
-
_inherits(ConfigPanel, _React$Component);
|
|
130
|
-
var _super = _createSuper(ConfigPanel);
|
|
131
|
-
function ConfigPanel(props) {
|
|
132
|
-
var _this;
|
|
133
|
-
_classCallCheck(this, ConfigPanel);
|
|
134
|
-
_this = _super.call(this, props);
|
|
135
|
-
_defineProperty(_assertThisInitialized(_this), "handleKeyDown", function (e) {
|
|
136
|
-
if ((e.key === 'Esc' || e.key === 'Escape') && _this.props.closeOnEsc) {
|
|
137
|
-
_this.props.onCancel();
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
// https://product-fabric.atlassian.net/browse/DST-2697
|
|
141
|
-
// workaround for DST-2697, remove this function once fix.
|
|
142
|
-
_defineProperty(_assertThisInitialized(_this), "backfillTabFormData", function (fields, formData, currentParameters) {
|
|
143
|
-
var getRelevantData = function getRelevantData(field, formParams, currentParams, backfill) {
|
|
144
|
-
if (field.hasGroupedValues && !(field.name in backfill)) {
|
|
145
|
-
backfill[field.name] = {};
|
|
146
|
-
}
|
|
147
|
-
var actualFormParams = field.hasGroupedValues ? formParams[field.name] || {} : formParams;
|
|
148
|
-
var actualCurrentParams = field.hasGroupedValues ? currentParams[field.name] || {} : currentParams;
|
|
149
|
-
var actualBackfillParams = field.hasGroupedValues ? backfill[field.name] : backfill;
|
|
150
|
-
return {
|
|
151
|
-
formParams: actualFormParams,
|
|
152
|
-
currentParams: actualCurrentParams,
|
|
153
|
-
backfillParams: actualBackfillParams
|
|
154
|
-
};
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
// Traverse any tab structures and backfill field values on tabs
|
|
158
|
-
// which aren't shown. This filter should be ok because tabs are
|
|
159
|
-
// currently only allowed on top level
|
|
160
|
-
var mergedTabGroups = fields.filter(isTabGroup).reduce(function (missingBackfill, tabGroup) {
|
|
161
|
-
var _getRelevantData = getRelevantData(tabGroup, formData, currentParameters, missingBackfill),
|
|
162
|
-
tabGroupFormData = _getRelevantData.formParams,
|
|
163
|
-
tabGroupCurrentData = _getRelevantData.currentParams,
|
|
164
|
-
tabGroupParams = _getRelevantData.backfillParams;
|
|
165
|
-
|
|
166
|
-
// Loop through tabs and see what fields are missing from current data
|
|
167
|
-
tabGroup.fields.forEach(function (tabField) {
|
|
168
|
-
var _getRelevantData2 = getRelevantData(tabField, tabGroupFormData, tabGroupCurrentData, tabGroupParams),
|
|
169
|
-
tabFormData = _getRelevantData2.formParams,
|
|
170
|
-
tabCurrentData = _getRelevantData2.currentParams,
|
|
171
|
-
tabParams = _getRelevantData2.backfillParams;
|
|
172
|
-
tabField.fields.forEach(function (field) {
|
|
173
|
-
if (field.name in tabFormData || !(field.name in tabCurrentData)) {
|
|
174
|
-
return;
|
|
175
|
-
}
|
|
176
|
-
tabParams[field.name] = tabCurrentData[field.name];
|
|
177
|
-
});
|
|
178
|
-
});
|
|
179
|
-
return missingBackfill;
|
|
180
|
-
}, {});
|
|
181
|
-
return _mergeRecursive({}, mergedTabGroups, formData);
|
|
182
|
-
});
|
|
183
|
-
_defineProperty(_assertThisInitialized(_this), "handleSubmit", /*#__PURE__*/function () {
|
|
184
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(formData) {
|
|
185
|
-
var _this$props, fields, extensionManifest, onChange, autoSaveReject, serializedData;
|
|
186
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
187
|
-
while (1) switch (_context.prev = _context.next) {
|
|
188
|
-
case 0:
|
|
189
|
-
_this$props = _this.props, fields = _this$props.fields, extensionManifest = _this$props.extensionManifest, onChange = _this$props.onChange, autoSaveReject = _this$props.autoSaveReject;
|
|
190
|
-
if (!(!extensionManifest || !fields)) {
|
|
191
|
-
_context.next = 4;
|
|
192
|
-
break;
|
|
193
|
-
}
|
|
194
|
-
if (!extensionManifest) {
|
|
195
|
-
autoSaveReject === null || autoSaveReject === void 0 || autoSaveReject(new Error('Extension manifest not loaded'));
|
|
196
|
-
} else if (!fields) {
|
|
197
|
-
autoSaveReject === null || autoSaveReject === void 0 || autoSaveReject(new Error('Config fields not loaded'));
|
|
198
|
-
}
|
|
199
|
-
return _context.abrupt("return");
|
|
200
|
-
case 4:
|
|
201
|
-
_context.prev = 4;
|
|
202
|
-
_context.next = 7;
|
|
203
|
-
return serialize(extensionManifest, _this.backfillTabFormData(fields, formData, _this.state.currentParameters), fields);
|
|
204
|
-
case 7:
|
|
205
|
-
serializedData = _context.sent;
|
|
206
|
-
onChange(serializedData);
|
|
207
|
-
_context.next = 15;
|
|
208
|
-
break;
|
|
209
|
-
case 11:
|
|
210
|
-
_context.prev = 11;
|
|
211
|
-
_context.t0 = _context["catch"](4);
|
|
212
|
-
autoSaveReject === null || autoSaveReject === void 0 || autoSaveReject(_context.t0);
|
|
213
|
-
// eslint-disable-next-line no-console
|
|
214
|
-
console.error("Error serializing parameters", _context.t0);
|
|
215
|
-
case 15:
|
|
216
|
-
case "end":
|
|
217
|
-
return _context.stop();
|
|
218
|
-
}
|
|
219
|
-
}, _callee, null, [[4, 11]]);
|
|
220
|
-
}));
|
|
221
|
-
return function (_x) {
|
|
222
|
-
return _ref3.apply(this, arguments);
|
|
223
|
-
};
|
|
224
|
-
}());
|
|
225
|
-
_defineProperty(_assertThisInitialized(_this), "parseParameters", /*#__PURE__*/function () {
|
|
226
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(fields, parameters) {
|
|
227
|
-
var extensionManifest, currentParameters;
|
|
228
|
-
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
229
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
230
|
-
case 0:
|
|
231
|
-
extensionManifest = _this.props.extensionManifest;
|
|
232
|
-
if (!(!extensionManifest || !fields || fields.length === 0)) {
|
|
233
|
-
_context2.next = 3;
|
|
234
|
-
break;
|
|
235
|
-
}
|
|
236
|
-
return _context2.abrupt("return");
|
|
237
|
-
case 3:
|
|
238
|
-
if (!(typeof parameters === 'undefined')) {
|
|
239
|
-
_context2.next = 6;
|
|
240
|
-
break;
|
|
241
|
-
}
|
|
242
|
-
_this.setState({
|
|
243
|
-
currentParameters: {},
|
|
244
|
-
hasParsedParameters: true
|
|
245
|
-
});
|
|
246
|
-
return _context2.abrupt("return");
|
|
247
|
-
case 6:
|
|
248
|
-
_context2.next = 8;
|
|
249
|
-
return deserialize(extensionManifest, parameters, fields);
|
|
250
|
-
case 8:
|
|
251
|
-
currentParameters = _context2.sent;
|
|
252
|
-
_this.setState({
|
|
253
|
-
currentParameters: currentParameters,
|
|
254
|
-
hasParsedParameters: true
|
|
255
|
-
});
|
|
256
|
-
case 10:
|
|
257
|
-
case "end":
|
|
258
|
-
return _context2.stop();
|
|
259
|
-
}
|
|
260
|
-
}, _callee2);
|
|
261
|
-
}));
|
|
262
|
-
return function (_x2, _x3) {
|
|
263
|
-
return _ref4.apply(this, arguments);
|
|
264
|
-
};
|
|
265
|
-
}());
|
|
266
|
-
// memoized to prevent rerender on new parameters
|
|
267
|
-
_defineProperty(_assertThisInitialized(_this), "renderHeader", memoizeOne(function (extensionManifest) {
|
|
268
|
-
var _this$props2 = _this.props,
|
|
269
|
-
onCancel = _this$props2.onCancel,
|
|
270
|
-
showHeader = _this$props2.showHeader;
|
|
271
|
-
|
|
272
|
-
// Use a temporary allowlist of top 3 macros to test out a new "Documentation" CTA ("Need help?")
|
|
273
|
-
// This will be removed when Top 5 Modernized Macros updates are rolled out
|
|
274
|
-
var modernizedMacrosList = ['children', 'recently-updated', 'excerpt'];
|
|
275
|
-
var enableHelpCTA = modernizedMacrosList.includes(extensionManifest.key);
|
|
276
|
-
if (!showHeader) {
|
|
277
|
-
return null;
|
|
278
|
-
}
|
|
279
|
-
return /*#__PURE__*/React.createElement(Header, {
|
|
280
|
-
icon: extensionManifest.icons['48'],
|
|
281
|
-
title: extensionManifest.title,
|
|
282
|
-
description: extensionManifest.description,
|
|
283
|
-
summary: extensionManifest.summary,
|
|
284
|
-
documentationUrl: extensionManifest.documentationUrl,
|
|
285
|
-
onClose: onCancel,
|
|
286
|
-
enableHelpCTA: enableHelpCTA
|
|
287
|
-
});
|
|
288
|
-
}));
|
|
289
|
-
_defineProperty(_assertThisInitialized(_this), "getFirstVisibleFieldName", memoizeOne(function (fields) {
|
|
290
|
-
function nonHidden(field) {
|
|
291
|
-
if ('isHidden' in field) {
|
|
292
|
-
return !field.isHidden;
|
|
293
|
-
}
|
|
294
|
-
return true;
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
// finds the first visible field, true for FieldSets too
|
|
298
|
-
var firstVisibleField = fields.find(nonHidden);
|
|
299
|
-
var newFirstVisibleFieldName;
|
|
300
|
-
if (firstVisibleField) {
|
|
301
|
-
// if it was a fieldset, go deeper trying to locate the field
|
|
302
|
-
if (firstVisibleField.type === 'fieldset') {
|
|
303
|
-
var firstVisibleFieldWithinFieldset = firstVisibleField.fields.find(nonHidden);
|
|
304
|
-
newFirstVisibleFieldName = firstVisibleFieldWithinFieldset && firstVisibleFieldWithinFieldset.name;
|
|
305
|
-
} else {
|
|
306
|
-
newFirstVisibleFieldName = firstVisibleField.name;
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
return newFirstVisibleFieldName;
|
|
310
|
-
}));
|
|
311
|
-
_defineProperty(_assertThisInitialized(_this), "setFirstVisibleFieldName", function (fields) {
|
|
312
|
-
var newFirstVisibleFieldName = _this.getFirstVisibleFieldName(fields);
|
|
313
|
-
if (newFirstVisibleFieldName !== _this.state.firstVisibleFieldName) {
|
|
314
|
-
_this.setState({
|
|
315
|
-
firstVisibleFieldName: newFirstVisibleFieldName
|
|
316
|
-
});
|
|
317
|
-
}
|
|
318
|
-
});
|
|
319
|
-
_this.state = {
|
|
320
|
-
hasParsedParameters: false,
|
|
321
|
-
currentParameters: {},
|
|
322
|
-
firstVisibleFieldName: props.fields ? _this.getFirstVisibleFieldName(props.fields) : undefined
|
|
323
|
-
};
|
|
324
|
-
_this.onFieldChange = null;
|
|
325
|
-
return _this;
|
|
326
|
-
}
|
|
327
|
-
_createClass(ConfigPanel, [{
|
|
328
|
-
key: "componentDidMount",
|
|
329
|
-
value: function componentDidMount() {
|
|
330
|
-
var _this$props3 = this.props,
|
|
331
|
-
fields = _this$props3.fields,
|
|
332
|
-
parameters = _this$props3.parameters;
|
|
333
|
-
this.parseParameters(fields, parameters);
|
|
334
|
-
}
|
|
335
|
-
}, {
|
|
336
|
-
key: "componentWillUnmount",
|
|
337
|
-
value: function componentWillUnmount() {
|
|
338
|
-
var _this$props4 = this.props,
|
|
339
|
-
createAnalyticsEvent = _this$props4.createAnalyticsEvent,
|
|
340
|
-
extensionManifest = _this$props4.extensionManifest,
|
|
341
|
-
fields = _this$props4.fields;
|
|
342
|
-
var currentParameters = this.state.currentParameters;
|
|
343
|
-
fireAnalyticsEvent(createAnalyticsEvent)({
|
|
344
|
-
payload: {
|
|
345
|
-
action: ACTION.CLOSED,
|
|
346
|
-
actionSubject: ACTION_SUBJECT.CONFIG_PANEL,
|
|
347
|
-
eventType: EVENT_TYPE.UI,
|
|
348
|
-
attributes: _objectSpread({
|
|
349
|
-
extensionKey: extensionManifest === null || extensionManifest === void 0 ? void 0 : extensionManifest.key,
|
|
350
|
-
extensionType: extensionManifest === null || extensionManifest === void 0 ? void 0 : extensionManifest.type
|
|
351
|
-
}, extensionManifest !== null && extensionManifest !== void 0 && extensionManifest.key && ALLOWED_LOGGED_MACRO_PARAMS[extensionManifest.key] ? {
|
|
352
|
-
parameters: getLoggedParameters(extensionManifest.key, currentParameters, fields)
|
|
353
|
-
} : {})
|
|
354
|
-
}
|
|
355
|
-
});
|
|
356
|
-
}
|
|
357
|
-
}, {
|
|
358
|
-
key: "componentDidUpdate",
|
|
359
|
-
value: function componentDidUpdate(prevProps) {
|
|
360
|
-
var _this$props5 = this.props,
|
|
361
|
-
parameters = _this$props5.parameters,
|
|
362
|
-
fields = _this$props5.fields,
|
|
363
|
-
autoSaveTrigger = _this$props5.autoSaveTrigger,
|
|
364
|
-
extensionManifest = _this$props5.extensionManifest;
|
|
365
|
-
if (parameters && parameters !== prevProps.parameters || fields && (!prevProps.fields || !_isEqual(fields, prevProps.fields))) {
|
|
366
|
-
this.parseParameters(fields, parameters);
|
|
367
|
-
}
|
|
368
|
-
if (fields && (!prevProps.fields || !_isEqual(fields, prevProps.fields))) {
|
|
369
|
-
this.setFirstVisibleFieldName(fields);
|
|
370
|
-
}
|
|
371
|
-
if (prevProps.autoSaveTrigger !== autoSaveTrigger) {
|
|
372
|
-
if (this.onFieldChange) {
|
|
373
|
-
this.onFieldChange('', true);
|
|
374
|
-
}
|
|
375
|
-
}
|
|
376
|
-
if (prevProps.extensionManifest === undefined && prevProps.extensionManifest !== extensionManifest) {
|
|
377
|
-
// This will only be fired once when extensionManifest is loaded initially
|
|
378
|
-
// Can't do this in componentDidMount because extensionManifest is still undefined at that point
|
|
379
|
-
fireAnalyticsEvent(this.props.createAnalyticsEvent)({
|
|
380
|
-
payload: {
|
|
381
|
-
action: ACTION.OPENED,
|
|
382
|
-
actionSubject: ACTION_SUBJECT.CONFIG_PANEL,
|
|
383
|
-
eventType: EVENT_TYPE.UI,
|
|
384
|
-
attributes: {
|
|
385
|
-
extensionKey: extensionManifest === null || extensionManifest === void 0 ? void 0 : extensionManifest.key,
|
|
386
|
-
extensionType: extensionManifest === null || extensionManifest === void 0 ? void 0 : extensionManifest.type
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
});
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
}, {
|
|
393
|
-
key: "render",
|
|
394
|
-
value: function render() {
|
|
395
|
-
var _this2 = this;
|
|
396
|
-
var _this$props6 = this.props,
|
|
397
|
-
extensionManifest = _this$props6.extensionManifest,
|
|
398
|
-
featureFlags = _this$props6.featureFlags;
|
|
399
|
-
if (!extensionManifest) {
|
|
400
|
-
return /*#__PURE__*/React.createElement(LoadingState, null);
|
|
401
|
-
}
|
|
402
|
-
var _this$props7 = this.props,
|
|
403
|
-
autoSave = _this$props7.autoSave,
|
|
404
|
-
errorMessage = _this$props7.errorMessage,
|
|
405
|
-
fields = _this$props7.fields,
|
|
406
|
-
isLoading = _this$props7.isLoading,
|
|
407
|
-
onCancel = _this$props7.onCancel;
|
|
408
|
-
var _this$state = this.state,
|
|
409
|
-
currentParameters = _this$state.currentParameters,
|
|
410
|
-
hasParsedParameters = _this$state.hasParsedParameters,
|
|
411
|
-
firstVisibleFieldName = _this$state.firstVisibleFieldName;
|
|
412
|
-
var handleSubmit = this.handleSubmit,
|
|
413
|
-
handleKeyDown = this.handleKeyDown;
|
|
414
|
-
return /*#__PURE__*/React.createElement(Form, {
|
|
415
|
-
onSubmit: handleSubmit
|
|
416
|
-
}, function (_ref5) {
|
|
417
|
-
var formProps = _ref5.formProps,
|
|
418
|
-
getState = _ref5.getState,
|
|
419
|
-
submitting = _ref5.submitting;
|
|
420
|
-
return /*#__PURE__*/React.createElement(WithOnFieldChange, {
|
|
421
|
-
autoSave: !!autoSave,
|
|
422
|
-
getState: getState,
|
|
423
|
-
handleSubmit: handleSubmit
|
|
424
|
-
}, function (onFieldChange) {
|
|
425
|
-
_this2.onFieldChange = onFieldChange;
|
|
426
|
-
return /*#__PURE__*/React.createElement("form", _extends({}, formProps, {
|
|
427
|
-
noValidate: true,
|
|
428
|
-
onKeyDown: handleKeyDown,
|
|
429
|
-
"data-testid": "extension-config-panel"
|
|
430
|
-
}), _this2.renderHeader(extensionManifest), /*#__PURE__*/React.createElement(WithPluginState, {
|
|
431
|
-
plugins: {
|
|
432
|
-
extension: extensionPluginKey
|
|
433
|
-
},
|
|
434
|
-
render: function render(_ref6) {
|
|
435
|
-
var extension = _ref6.extension;
|
|
436
|
-
return /*#__PURE__*/React.createElement(FormErrorBoundary, {
|
|
437
|
-
contextIdentifierProvider: extension === null || extension === void 0 ? void 0 : extension.contextIdentifierProvider,
|
|
438
|
-
extensionKey: extensionManifest.key,
|
|
439
|
-
fields: fields || []
|
|
440
|
-
}, /*#__PURE__*/React.createElement(ConfigFormIntl, {
|
|
441
|
-
canSave: !autoSave,
|
|
442
|
-
errorMessage: errorMessage,
|
|
443
|
-
extensionManifest: extensionManifest,
|
|
444
|
-
fields: fields,
|
|
445
|
-
firstVisibleFieldName: firstVisibleFieldName,
|
|
446
|
-
hasParsedParameters: hasParsedParameters,
|
|
447
|
-
isLoading: isLoading || false,
|
|
448
|
-
onCancel: onCancel,
|
|
449
|
-
onFieldChange: onFieldChange,
|
|
450
|
-
parameters: currentParameters,
|
|
451
|
-
submitting: submitting,
|
|
452
|
-
contextIdentifierProvider: extension === null || extension === void 0 ? void 0 : extension.contextIdentifierProvider,
|
|
453
|
-
featureFlags: featureFlags
|
|
454
|
-
}));
|
|
455
|
-
}
|
|
456
|
-
}));
|
|
457
|
-
});
|
|
458
|
-
});
|
|
459
|
-
}
|
|
460
|
-
}]);
|
|
461
|
-
return ConfigPanel;
|
|
462
|
-
}(React.Component);
|
|
463
|
-
export default withAnalyticsContext({
|
|
464
|
-
source: 'ConfigPanel'
|
|
465
|
-
})(withAnalyticsEvents()(ConfigPanel));
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import React, { useState, useEffect } from 'react';
|
|
3
|
-
import { useStateFromPromise } from './use-state-from-promise';
|
|
4
|
-
import ConfigPanel from './ConfigPanel';
|
|
5
|
-
var getFieldsDefinitionFn = function getFieldsDefinitionFn(extensionManifest, nodeKey) {
|
|
6
|
-
if (extensionManifest && extensionManifest.modules.nodes && extensionManifest.modules.nodes[nodeKey] && extensionManifest.modules.nodes[nodeKey].getFieldsDefinition) {
|
|
7
|
-
return extensionManifest.modules.nodes[nodeKey].getFieldsDefinition;
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
// having the default value in the props instead of a reference will cause excessive rerenders
|
|
12
|
-
var defaultEmptyObject = {};
|
|
13
|
-
var FieldDefinitionsPromiseResolver = function FieldDefinitionsPromiseResolver(props) {
|
|
14
|
-
var extensionManifest = props.extensionManifest,
|
|
15
|
-
nodeKey = props.nodeKey,
|
|
16
|
-
extensionParameters = props.extensionParameters,
|
|
17
|
-
setErrorMessage = props.setErrorMessage;
|
|
18
|
-
var _useState = useState(undefined),
|
|
19
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
20
|
-
fields = _useState2[0],
|
|
21
|
-
setFields = _useState2[1];
|
|
22
|
-
|
|
23
|
-
// Resolve the promise
|
|
24
|
-
// useStateFromPromise() has an issue which isn't compatible with
|
|
25
|
-
// DynamicFieldDefinitions when it returns a function as setState()
|
|
26
|
-
// will immediately run the function returned and pass it the currentState.
|
|
27
|
-
useEffect(function () {
|
|
28
|
-
if (!extensionManifest) {
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
var promiseFn = getFieldsDefinitionFn(extensionManifest, nodeKey);
|
|
32
|
-
if (typeof promiseFn !== 'function') {
|
|
33
|
-
setFields(undefined);
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
promiseFn(extensionParameters).catch(function (err) {
|
|
37
|
-
if (err && typeof err.message === 'string') {
|
|
38
|
-
setErrorMessage(err.message);
|
|
39
|
-
}
|
|
40
|
-
setFields(undefined);
|
|
41
|
-
}).then(function (value) {
|
|
42
|
-
if (Array.isArray(value)) {
|
|
43
|
-
// value: FieldDefinition[]
|
|
44
|
-
setFields(value);
|
|
45
|
-
} else if (typeof value === 'function') {
|
|
46
|
-
try {
|
|
47
|
-
// value: DynamicFieldDefinitions
|
|
48
|
-
var dynamicFields = value(extensionParameters);
|
|
49
|
-
setFields(dynamicFields);
|
|
50
|
-
} catch (err) {
|
|
51
|
-
if (err instanceof Error) {
|
|
52
|
-
setErrorMessage(err.message);
|
|
53
|
-
}
|
|
54
|
-
setFields(undefined);
|
|
55
|
-
}
|
|
56
|
-
} else {
|
|
57
|
-
// value: undefined
|
|
58
|
-
setFields(undefined);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
}, [extensionManifest, nodeKey, extensionParameters, setErrorMessage]);
|
|
62
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, props.children(fields));
|
|
63
|
-
};
|
|
64
|
-
export default function FieldsLoader(_ref) {
|
|
65
|
-
var extensionType = _ref.extensionType,
|
|
66
|
-
extensionKey = _ref.extensionKey,
|
|
67
|
-
nodeKey = _ref.nodeKey,
|
|
68
|
-
extensionProvider = _ref.extensionProvider,
|
|
69
|
-
_ref$extensionParamet = _ref.extensionParameters,
|
|
70
|
-
extensionParameters = _ref$extensionParamet === void 0 ? defaultEmptyObject : _ref$extensionParamet,
|
|
71
|
-
_ref$parameters = _ref.parameters,
|
|
72
|
-
parameters = _ref$parameters === void 0 ? defaultEmptyObject : _ref$parameters,
|
|
73
|
-
autoSave = _ref.autoSave,
|
|
74
|
-
autoSaveTrigger = _ref.autoSaveTrigger,
|
|
75
|
-
autoSaveReject = _ref.autoSaveReject,
|
|
76
|
-
closeOnEsc = _ref.closeOnEsc,
|
|
77
|
-
showHeader = _ref.showHeader,
|
|
78
|
-
featureFlags = _ref.featureFlags,
|
|
79
|
-
onChange = _ref.onChange,
|
|
80
|
-
onCancel = _ref.onCancel;
|
|
81
|
-
var _useStateFromPromise = useStateFromPromise(function () {
|
|
82
|
-
return extensionProvider.getExtension(extensionType, extensionKey);
|
|
83
|
-
}, [extensionProvider, extensionType, extensionKey]),
|
|
84
|
-
_useStateFromPromise2 = _slicedToArray(_useStateFromPromise, 1),
|
|
85
|
-
extensionManifest = _useStateFromPromise2[0];
|
|
86
|
-
var _useState3 = useState(null),
|
|
87
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
88
|
-
errorMessage = _useState4[0],
|
|
89
|
-
setErrorMessage = _useState4[1];
|
|
90
|
-
return /*#__PURE__*/React.createElement(FieldDefinitionsPromiseResolver, {
|
|
91
|
-
setErrorMessage: setErrorMessage,
|
|
92
|
-
extensionManifest: extensionManifest,
|
|
93
|
-
nodeKey: nodeKey,
|
|
94
|
-
extensionParameters: extensionParameters
|
|
95
|
-
}, function (fields) {
|
|
96
|
-
return /*#__PURE__*/React.createElement(ConfigPanel, {
|
|
97
|
-
extensionManifest: extensionManifest,
|
|
98
|
-
isLoading: !extensionManifest || errorMessage === null && !fields,
|
|
99
|
-
fields: fields,
|
|
100
|
-
parameters: parameters,
|
|
101
|
-
autoSave: autoSave,
|
|
102
|
-
autoSaveTrigger: autoSaveTrigger,
|
|
103
|
-
autoSaveReject: autoSaveReject,
|
|
104
|
-
closeOnEsc: closeOnEsc,
|
|
105
|
-
showHeader: showHeader,
|
|
106
|
-
onChange: onChange,
|
|
107
|
-
onCancel: onCancel,
|
|
108
|
-
errorMessage: errorMessage,
|
|
109
|
-
featureFlags: featureFlags
|
|
110
|
-
});
|
|
111
|
-
});
|
|
112
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import Loadable from 'react-loadable';
|
|
2
|
-
import LoadingState from './LoadingState';
|
|
3
|
-
export default Loadable({
|
|
4
|
-
loader: function loader() {
|
|
5
|
-
return import( /* webpackChunkName: "@atlaskit-internal_editor-core-config-panel" */
|
|
6
|
-
'./ConfigPanelFieldsLoader').then(function (module) {
|
|
7
|
-
return module.default;
|
|
8
|
-
});
|
|
9
|
-
},
|
|
10
|
-
loading: LoadingState
|
|
11
|
-
});
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject;
|
|
3
|
-
/* eslint-disable @atlaskit/design-system/ensure-design-token-usage */
|
|
4
|
-
// Quality Ticket: https://product-fabric.atlassian.net/browse/DSP-4249
|
|
5
|
-
/** @jsx jsx */
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import { css, jsx } from '@emotion/react';
|
|
8
|
-
var imageContainer = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n margin: 0 auto ", ";\n height: 80px;\n"])), "var(--ds-space-300, 24px)");
|
|
9
|
-
var ErrorImage = function ErrorImage() {
|
|
10
|
-
return jsx("div", {
|
|
11
|
-
css: imageContainer
|
|
12
|
-
}, jsx("svg", {
|
|
13
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
-
viewBox: "0 0 163.28 218",
|
|
15
|
-
height: "80"
|
|
16
|
-
}, jsx("defs", null, jsx("linearGradient", {
|
|
17
|
-
id: "linear-gradient",
|
|
18
|
-
x1: "133.86",
|
|
19
|
-
x2: "-2.79",
|
|
20
|
-
y1: "136.43",
|
|
21
|
-
y2: "200.15",
|
|
22
|
-
gradientUnits: "userSpaceOnUse"
|
|
23
|
-
}, jsx("stop", {
|
|
24
|
-
offset: "0",
|
|
25
|
-
stopColor: "#ffd740"
|
|
26
|
-
}), jsx("stop", {
|
|
27
|
-
offset: "1",
|
|
28
|
-
stopColor: "#ffab00"
|
|
29
|
-
})), jsx("clipPath", {
|
|
30
|
-
id: "clip-path"
|
|
31
|
-
}, jsx("path", {
|
|
32
|
-
id: "_Polygon_",
|
|
33
|
-
d: "M94.78 80.16l66.44 115.08A15.17 15.17 0 01148.08 218H15.2a15.17 15.17 0 01-13.14-22.76L68.5 80.16a15.17 15.17 0 0126.28 0z",
|
|
34
|
-
className: "cls-1",
|
|
35
|
-
"data-name": "<Polygon>"
|
|
36
|
-
})), jsx("style", null, ".cls-1{fill:url(#linear-gradient)}.cls-2{fill:#253858}.cls-6{fill:none;stroke-linecap:round;stroke-miterlimit:10;stroke-width:2px;stroke:#5e6c84}")), jsx("g", {
|
|
37
|
-
id: "Layer_2",
|
|
38
|
-
"data-name": "Layer 2"
|
|
39
|
-
}, jsx("g", {
|
|
40
|
-
id: "Software"
|
|
41
|
-
}, jsx("path", {
|
|
42
|
-
id: "_Polygon_2",
|
|
43
|
-
d: "M94.78 80.16l66.44 115.08A15.17 15.17 0 01148.08 218H15.2a15.17 15.17 0 01-13.14-22.76L68.5 80.16a15.17 15.17 0 0126.28 0z",
|
|
44
|
-
className: "cls-1",
|
|
45
|
-
"data-name": "<Polygon>"
|
|
46
|
-
}), jsx("path", {
|
|
47
|
-
d: "M87.22 163.71l2.88-44.35a9.18 9.18 0 00-9.16-9.78 9.18 9.18 0 00-9.16 9.78l2.88 44.35a6.3 6.3 0 006.28 5.89 6.3 6.3 0 006.28-5.89zM71.38 187.25a9.53 9.53 0 0010.39 9.58 9.68 9.68 0 00-.9-19.32 9.64 9.64 0 00-9.49 9.74z",
|
|
48
|
-
className: "cls-2"
|
|
49
|
-
}), jsx("path", {
|
|
50
|
-
fill: "#ffc400",
|
|
51
|
-
d: "M91.7 27.17L84.29.45A.61.61 0 0083.1.5l-4.66 25.1-5.8-1.08a.61.61 0 00-.7.76L79.35 52a.61.61 0 001.19 0l4.66-25.1 5.8 1.03a.61.61 0 00.7-.76z"
|
|
52
|
-
}), jsx("path", {
|
|
53
|
-
fill: "#ffab00",
|
|
54
|
-
d: "M65.12 41.81l-10.88-8.55a.27.27 0 00-.41.33L59.36 45l-2.66 1.31a.27.27 0 000 .45l10.87 8.55a.27.27 0 00.41-.33l-5.57-11.43 2.66-1.29a.27.27 0 00.05-.45z"
|
|
55
|
-
}), jsx("path", {
|
|
56
|
-
fill: "none",
|
|
57
|
-
stroke: "#344563",
|
|
58
|
-
strokeLinecap: "round",
|
|
59
|
-
strokeMiterlimit: "10",
|
|
60
|
-
strokeWidth: "2",
|
|
61
|
-
d: "M115.15 36.6c-1.17 1.59-11-5.6-12.16-4s8.66 8.79 7.5 10.39-11-5.6-12.17-4 8.66 8.79 7.49 10.39-11-5.6-12.17-4 8.66 8.79 7.49 10.39"
|
|
62
|
-
}), jsx("path", {
|
|
63
|
-
d: "M119.92 64.19c-1.46 1.33-7.05-4.78-8.51-3.44s4.13 7.45 2.67 8.78-7.05-4.78-8.51-3.44c-.68.62.16 2.27 1.11 4M44.8 64c1.82.77 5-6.87 6.86-6.1s-1.39 8.4.43 9.17 5-6.87 6.86-6.1c.85.36.61 2.19.29 4.13",
|
|
64
|
-
className: "cls-6"
|
|
65
|
-
})))));
|
|
66
|
-
};
|
|
67
|
-
export default ErrorImage;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import EmptyState from '@atlaskit/empty-state';
|
|
3
|
-
import { defineMessages, injectIntl } from 'react-intl-next';
|
|
4
|
-
import ErrorImage from './ErrorImage';
|
|
5
|
-
var messages = defineMessages({
|
|
6
|
-
configFailedToLoad: {
|
|
7
|
-
id: 'fabric.editor.configFailedToLoad',
|
|
8
|
-
defaultMessage: 'Failed to load',
|
|
9
|
-
description: 'Displayed when the config panel fails to load fields'
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var ConfigPanelErrorMessage = function ConfigPanelErrorMessage(_ref) {
|
|
13
|
-
var errorMessage = _ref.errorMessage,
|
|
14
|
-
intl = _ref.intl;
|
|
15
|
-
return /*#__PURE__*/React.createElement(EmptyState, {
|
|
16
|
-
header: intl.formatMessage(messages.configFailedToLoad),
|
|
17
|
-
description: errorMessage,
|
|
18
|
-
renderImage: function renderImage() {
|
|
19
|
-
return /*#__PURE__*/React.createElement(ErrorImage, null);
|
|
20
|
-
},
|
|
21
|
-
size: "narrow",
|
|
22
|
-
imageHeight: 80,
|
|
23
|
-
testId: "config-panel-error-message"
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
export default injectIntl(ConfigPanelErrorMessage);
|