@atlaskit/editor-core 161.0.0 → 162.0.2
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 +50 -0
- package/dist/cjs/actions/index.js +76 -48
- package/dist/cjs/extensibility.js +2 -2
- package/dist/cjs/labs/next/full-page.js +2 -2
- package/dist/cjs/plugins/block-type/styles.js +5 -2
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/index.js +13 -11
- package/dist/cjs/plugins/block-type/ui/ToolbarBlockType/styled.js +11 -7
- package/dist/cjs/plugins/card/messages.js +4 -4
- package/dist/cjs/plugins/card/ui/LinkToolbarAppearance.js +29 -11
- package/dist/cjs/plugins/card/ui/LinkToolbarButtonGroup.js +66 -7
- package/dist/cjs/plugins/card/ui/LinkToolbarIconDropdown.js +166 -7
- package/dist/cjs/plugins/card/ui/ResizableEmbedCard.js +9 -6
- package/dist/cjs/plugins/card/ui/assets/card.js +1 -1
- package/dist/cjs/plugins/card/ui/assets/embed.js +1 -1
- package/dist/cjs/plugins/card/ui/assets/inline.js +1 -1
- package/dist/cjs/plugins/card/ui/assets/url.js +1 -1
- package/dist/cjs/plugins/card/ui/link-toolbar-button-group-options.js +60 -0
- package/dist/cjs/plugins/card/ui/link-toolbar-icon-dropdown-options.js +66 -0
- package/dist/cjs/plugins/card/ui/styled.js +5 -13
- package/dist/cjs/plugins/card/ui/types.js +5 -0
- package/dist/cjs/plugins/clipboard/pm-plugins/main.js +99 -3
- package/dist/cjs/plugins/code-block/styles.js +45 -38
- package/dist/cjs/plugins/extension/plugin-factory.js +4 -1
- package/dist/cjs/plugins/extension/pm-plugins/main.js +34 -11
- package/dist/cjs/plugins/extension/utils.js +57 -12
- package/dist/cjs/plugins/find-replace/ui/Find.js +12 -12
- package/dist/cjs/plugins/find-replace/ui/FindReplace.js +5 -5
- package/dist/cjs/plugins/find-replace/ui/Replace.js +5 -5
- package/dist/cjs/plugins/find-replace/ui/styles.js +12 -15
- package/dist/cjs/plugins/layout/styles.js +2 -2
- package/dist/cjs/plugins/list/actions/wrap-and-join-lists.js +180 -0
- package/dist/cjs/plugins/list/commands/index.js +35 -38
- package/dist/cjs/plugins/list/utils/replace-content.js +31 -0
- package/dist/cjs/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
- package/dist/cjs/plugins/media/styles.js +2 -2
- package/dist/cjs/plugins/media/utils/media-single.js +15 -2
- package/dist/cjs/plugins/paste/handlers.js +19 -5
- package/dist/cjs/plugins/paste/pm-plugins/analytics.js +1 -1
- package/dist/cjs/plugins/placeholder-text/index.js +45 -1
- package/dist/cjs/plugins/placeholder-text/placeholder-text-nodeview.js +66 -22
- package/dist/cjs/plugins/placeholder-text/selection-utils.js +19 -0
- package/dist/cjs/plugins/placeholder-text/styles.js +3 -1
- package/dist/cjs/plugins/table/commands/index.js +0 -6
- package/dist/cjs/plugins/table/commands/insert.js +1 -1
- package/dist/cjs/plugins/table/commands/misc.js +5 -18
- package/dist/cjs/plugins/table/commands-with-analytics.js +1 -1
- package/dist/cjs/plugins/table/handlers.js +6 -2
- package/dist/cjs/plugins/table/index.js +7 -13
- package/dist/cjs/plugins/table/nodeviews/TableComponent.js +2 -2
- package/dist/cjs/plugins/table/nodeviews/table.js +7 -38
- package/dist/cjs/plugins/table/pm-plugins/decorations/plugin.js +2 -2
- package/dist/cjs/plugins/table/pm-plugins/main.js +3 -1
- package/dist/cjs/plugins/table/pm-plugins/plugin-factory.js +4 -7
- package/dist/cjs/plugins/table/pm-plugins/plugin-key.js +11 -0
- package/dist/cjs/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
- package/dist/cjs/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +3 -3
- package/dist/cjs/plugins/table/reducer.js +0 -7
- package/dist/cjs/plugins/table/toolbar.js +5 -15
- package/dist/cjs/plugins/table/transforms/metadata.js +2 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/index.js +1 -1
- package/dist/cjs/plugins/table/ui/FloatingContextualButton/{styles.css.js → styles.js} +0 -0
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/index.js +4 -2
- package/dist/cjs/plugins/table/ui/FloatingContextualMenu/{styles.css.js → styles.js} +0 -0
- package/dist/cjs/plugins/table/ui/FloatingInsertButton/index.js +1 -1
- package/dist/cjs/plugins/table/ui/LayoutButton/index.js +1 -2
- package/dist/cjs/plugins/table/ui/common-styles.js +53 -0
- package/dist/cjs/plugins/table/ui/ui-styles.js +109 -0
- package/dist/cjs/plugins/table/utils/nodes.js +15 -15
- package/dist/cjs/plugins/tasks-and-decisions/commands.js +15 -1
- package/dist/cjs/plugins/text-formatting/styles.js +5 -2
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/index.js +71 -1
- package/dist/cjs/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
- package/dist/cjs/plugins/text-formatting/utils.js +30 -2
- package/dist/cjs/plugins/type-ahead/api.js +32 -1
- package/dist/cjs/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +20 -5
- package/dist/cjs/plugins/type-ahead/ui/InputQuery.js +12 -0
- package/dist/cjs/plugins/type-ahead/utils.js +22 -4
- package/dist/cjs/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/cjs/ui/Appearance/FullPage/StyledComponents.js +2 -2
- package/dist/cjs/ui/ContentStyles/index.js +33 -10
- package/dist/cjs/utils/index.js +1 -8
- package/dist/cjs/utils/insert.js +1 -9
- package/dist/cjs/utils/selection.js +2 -9
- package/dist/cjs/version-wrapper.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/actions/index.js +20 -23
- package/dist/es2019/extensibility.js +1 -1
- package/dist/es2019/labs/next/full-page.js +2 -2
- package/dist/es2019/plugins/block-type/styles.js +3 -3
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/index.js +15 -12
- package/dist/es2019/plugins/block-type/ui/ToolbarBlockType/styled.js +19 -14
- package/dist/es2019/plugins/card/messages.js +4 -4
- package/dist/es2019/plugins/card/ui/LinkToolbarAppearance.js +21 -9
- package/dist/es2019/plugins/card/ui/LinkToolbarButtonGroup.js +54 -3
- package/dist/es2019/plugins/card/ui/LinkToolbarIconDropdown.js +145 -3
- package/dist/es2019/plugins/card/ui/ResizableEmbedCard.js +10 -6
- package/dist/es2019/plugins/card/ui/assets/card.js +1 -1
- package/dist/es2019/plugins/card/ui/assets/embed.js +1 -1
- package/dist/es2019/plugins/card/ui/assets/inline.js +1 -1
- package/dist/es2019/plugins/card/ui/assets/url.js +1 -1
- package/dist/es2019/plugins/card/ui/link-toolbar-button-group-options.js +45 -0
- package/dist/es2019/plugins/card/ui/link-toolbar-icon-dropdown-options.js +51 -0
- package/dist/es2019/plugins/card/ui/styled.js +2 -2
- package/dist/es2019/plugins/card/ui/types.js +1 -0
- package/dist/es2019/plugins/clipboard/pm-plugins/main.js +91 -9
- package/dist/es2019/plugins/code-block/styles.js +14 -14
- package/dist/es2019/plugins/extension/plugin-factory.js +3 -1
- package/dist/es2019/plugins/extension/pm-plugins/main.js +38 -12
- package/dist/es2019/plugins/extension/utils.js +37 -2
- package/dist/es2019/plugins/find-replace/ui/Find.js +1 -1
- package/dist/es2019/plugins/find-replace/ui/FindReplace.js +1 -1
- package/dist/es2019/plugins/find-replace/ui/Replace.js +1 -1
- package/dist/es2019/plugins/find-replace/ui/styles.js +14 -9
- package/dist/es2019/plugins/layout/styles.js +5 -1
- package/dist/es2019/plugins/list/actions/wrap-and-join-lists.js +163 -0
- package/dist/es2019/plugins/list/commands/index.js +29 -28
- package/dist/es2019/plugins/list/utils/replace-content.js +22 -0
- package/dist/es2019/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
- package/dist/es2019/plugins/media/styles.js +1 -1
- package/dist/es2019/plugins/media/utils/media-single.js +14 -1
- package/dist/es2019/plugins/paste/handlers.js +19 -5
- package/dist/es2019/plugins/paste/pm-plugins/analytics.js +2 -2
- package/dist/es2019/plugins/placeholder-text/index.js +46 -1
- package/dist/es2019/plugins/placeholder-text/placeholder-text-nodeview.js +66 -20
- package/dist/es2019/plugins/placeholder-text/selection-utils.js +9 -0
- package/dist/es2019/plugins/placeholder-text/styles.js +22 -0
- package/dist/es2019/plugins/table/commands/index.js +1 -1
- package/dist/es2019/plugins/table/commands/insert.js +1 -1
- package/dist/es2019/plugins/table/commands/misc.js +5 -11
- package/dist/es2019/plugins/table/commands-with-analytics.js +1 -1
- package/dist/es2019/plugins/table/handlers.js +6 -2
- package/dist/es2019/plugins/table/index.js +4 -8
- package/dist/es2019/plugins/table/nodeviews/TableComponent.js +2 -2
- package/dist/es2019/plugins/table/nodeviews/table.js +2 -16
- package/dist/es2019/plugins/table/pm-plugins/decorations/plugin.js +1 -1
- package/dist/es2019/plugins/table/pm-plugins/main.js +2 -1
- package/dist/es2019/plugins/table/pm-plugins/plugin-factory.js +1 -2
- package/dist/es2019/plugins/table/pm-plugins/plugin-key.js +2 -0
- package/dist/es2019/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
- package/dist/es2019/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +1 -1
- package/dist/es2019/plugins/table/reducer.js +0 -9
- package/dist/es2019/plugins/table/toolbar.js +1 -4
- package/dist/es2019/plugins/table/transforms/metadata.js +1 -1
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/index.js +1 -1
- package/dist/es2019/plugins/table/ui/FloatingContextualButton/{styles.css.js → styles.js} +0 -0
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/index.js +3 -2
- package/dist/es2019/plugins/table/ui/FloatingContextualMenu/{styles.css.js → styles.js} +0 -0
- package/dist/es2019/plugins/table/ui/FloatingInsertButton/index.js +1 -1
- package/dist/es2019/plugins/table/ui/LayoutButton/index.js +1 -2
- package/dist/es2019/plugins/table/ui/{common-styles.css.js → common-styles.js} +57 -27
- package/dist/es2019/plugins/table/ui/{ui-styles.css.js → ui-styles.js} +99 -78
- package/dist/es2019/plugins/table/utils/nodes.js +11 -11
- package/dist/es2019/plugins/tasks-and-decisions/commands.js +13 -1
- package/dist/es2019/plugins/text-formatting/styles.js +3 -3
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/index.js +61 -2
- package/dist/es2019/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
- package/dist/es2019/plugins/text-formatting/utils.js +13 -1
- package/dist/es2019/plugins/type-ahead/api.js +31 -2
- package/dist/es2019/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +17 -5
- package/dist/es2019/plugins/type-ahead/ui/InputQuery.js +12 -0
- package/dist/es2019/plugins/type-ahead/utils.js +15 -0
- package/dist/es2019/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/es2019/ui/Appearance/FullPage/StyledComponents.js +2 -2
- package/dist/es2019/ui/ContentStyles/index.js +46 -24
- package/dist/es2019/utils/index.js +1 -1
- package/dist/es2019/utils/insert.js +2 -10
- package/dist/es2019/utils/selection.js +1 -6
- package/dist/es2019/version-wrapper.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/actions/index.js +76 -48
- package/dist/esm/extensibility.js +1 -1
- package/dist/esm/labs/next/full-page.js +2 -2
- package/dist/esm/plugins/block-type/styles.js +4 -2
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/index.js +14 -12
- package/dist/esm/plugins/block-type/ui/ToolbarBlockType/styled.js +9 -5
- package/dist/esm/plugins/card/messages.js +4 -4
- package/dist/esm/plugins/card/ui/LinkToolbarAppearance.js +25 -9
- package/dist/esm/plugins/card/ui/LinkToolbarButtonGroup.js +57 -5
- package/dist/esm/plugins/card/ui/LinkToolbarIconDropdown.js +154 -5
- package/dist/esm/plugins/card/ui/ResizableEmbedCard.js +9 -6
- package/dist/esm/plugins/card/ui/assets/card.js +1 -1
- package/dist/esm/plugins/card/ui/assets/embed.js +1 -1
- package/dist/esm/plugins/card/ui/assets/inline.js +1 -1
- package/dist/esm/plugins/card/ui/assets/url.js +1 -1
- package/dist/esm/plugins/card/ui/link-toolbar-button-group-options.js +45 -0
- package/dist/esm/plugins/card/ui/link-toolbar-icon-dropdown-options.js +51 -0
- package/dist/esm/plugins/card/ui/styled.js +2 -2
- package/dist/esm/plugins/card/ui/types.js +1 -0
- package/dist/esm/plugins/clipboard/pm-plugins/main.js +91 -2
- package/dist/esm/plugins/code-block/styles.js +42 -38
- package/dist/esm/plugins/extension/plugin-factory.js +3 -1
- package/dist/esm/plugins/extension/pm-plugins/main.js +34 -11
- package/dist/esm/plugins/extension/utils.js +51 -9
- package/dist/esm/plugins/find-replace/ui/Find.js +1 -1
- package/dist/esm/plugins/find-replace/ui/FindReplace.js +1 -1
- package/dist/esm/plugins/find-replace/ui/Replace.js +1 -1
- package/dist/esm/plugins/find-replace/ui/styles.js +6 -10
- package/dist/esm/plugins/layout/styles.js +2 -2
- package/dist/esm/plugins/list/actions/wrap-and-join-lists.js +168 -0
- package/dist/esm/plugins/list/commands/index.js +33 -34
- package/dist/esm/plugins/list/utils/replace-content.js +21 -0
- package/dist/esm/plugins/media/nodeviews/mediaNodeUpdater.js +3 -3
- package/dist/esm/plugins/media/styles.js +1 -1
- package/dist/esm/plugins/media/utils/media-single.js +12 -1
- package/dist/esm/plugins/paste/handlers.js +19 -5
- package/dist/esm/plugins/paste/pm-plugins/analytics.js +2 -2
- package/dist/esm/plugins/placeholder-text/index.js +44 -1
- package/dist/esm/plugins/placeholder-text/placeholder-text-nodeview.js +67 -20
- package/dist/esm/plugins/placeholder-text/selection-utils.js +9 -0
- package/dist/esm/plugins/placeholder-text/styles.js +2 -1
- package/dist/esm/plugins/table/commands/index.js +1 -1
- package/dist/esm/plugins/table/commands/insert.js +1 -1
- package/dist/esm/plugins/table/commands/misc.js +5 -15
- package/dist/esm/plugins/table/commands-with-analytics.js +1 -1
- package/dist/esm/plugins/table/handlers.js +6 -2
- package/dist/esm/plugins/table/index.js +6 -11
- package/dist/esm/plugins/table/nodeviews/TableComponent.js +2 -2
- package/dist/esm/plugins/table/nodeviews/table.js +6 -37
- package/dist/esm/plugins/table/pm-plugins/decorations/plugin.js +1 -1
- package/dist/esm/plugins/table/pm-plugins/main.js +2 -1
- package/dist/esm/plugins/table/pm-plugins/plugin-factory.js +1 -2
- package/dist/esm/plugins/table/pm-plugins/plugin-key.js +2 -0
- package/dist/esm/plugins/table/pm-plugins/safari-delayed-dom-selection-syncing-workaround.js +2 -0
- package/dist/esm/plugins/table/pm-plugins/sticky-headers/nodeviews/tableRow.js +1 -1
- package/dist/esm/plugins/table/reducer.js +0 -7
- package/dist/esm/plugins/table/toolbar.js +1 -10
- package/dist/esm/plugins/table/transforms/metadata.js +1 -1
- package/dist/esm/plugins/table/ui/FloatingContextualButton/index.js +1 -1
- package/dist/esm/plugins/table/ui/FloatingContextualButton/{styles.css.js → styles.js} +0 -0
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/index.js +3 -2
- package/dist/esm/plugins/table/ui/FloatingContextualMenu/{styles.css.js → styles.js} +0 -0
- package/dist/esm/plugins/table/ui/FloatingInsertButton/index.js +1 -1
- package/dist/esm/plugins/table/ui/LayoutButton/index.js +1 -2
- package/dist/esm/plugins/table/ui/common-styles.js +27 -0
- package/dist/esm/plugins/table/ui/ui-styles.js +68 -0
- package/dist/esm/plugins/table/utils/nodes.js +14 -14
- package/dist/esm/plugins/tasks-and-decisions/commands.js +13 -1
- package/dist/esm/plugins/text-formatting/styles.js +4 -2
- package/dist/esm/plugins/text-formatting/ui/Toolbar/index.js +69 -2
- package/dist/esm/plugins/text-formatting/ui/Toolbar/toolbar-messages.js +30 -0
- package/dist/esm/plugins/text-formatting/utils.js +18 -0
- package/dist/esm/plugins/type-ahead/api.js +30 -2
- package/dist/esm/plugins/type-ahead/transforms/open-typeahead-at-cursor.js +16 -4
- package/dist/esm/plugins/type-ahead/ui/InputQuery.js +12 -0
- package/dist/esm/plugins/type-ahead/utils.js +17 -3
- package/dist/esm/ui/Appearance/Comment/Comment.js +2 -2
- package/dist/esm/ui/Appearance/FullPage/StyledComponents.js +2 -2
- package/dist/esm/ui/ContentStyles/index.js +28 -10
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/utils/insert.js +2 -10
- package/dist/esm/utils/selection.js +1 -6
- package/dist/esm/version-wrapper.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/actions/index.d.ts +2 -2
- package/dist/types/extensibility.d.ts +1 -1
- package/dist/types/plugins/analytics/types/list-events.d.ts +0 -1
- package/dist/types/plugins/block-type/styles.d.ts +2 -1
- package/dist/types/plugins/block-type/ui/ToolbarBlockType/index.d.ts +1 -0
- package/dist/types/plugins/block-type/ui/ToolbarBlockType/styled.d.ts +2 -7
- package/dist/types/plugins/card/messages.d.ts +2 -2
- package/dist/types/plugins/card/ui/LinkToolbarButtonGroup.d.ts +18 -2
- package/dist/types/plugins/card/ui/LinkToolbarIconDropdown.d.ts +23 -3
- package/dist/types/plugins/card/ui/ResizableEmbedCard.d.ts +3 -1
- package/dist/types/plugins/card/ui/link-toolbar-button-group-options.d.ts +5 -0
- package/dist/types/plugins/card/ui/link-toolbar-icon-dropdown-options.d.ts +5 -0
- package/dist/types/plugins/card/ui/styled.d.ts +2 -3
- package/dist/types/plugins/card/ui/types.d.ts +12 -0
- package/dist/types/plugins/clipboard/pm-plugins/main.d.ts +10 -1
- package/dist/types/plugins/code-block/styles.d.ts +3 -2
- package/dist/types/plugins/extension/pm-plugins/main.d.ts +2 -1
- package/dist/types/plugins/extension/types.d.ts +1 -0
- package/dist/types/plugins/extension/utils.d.ts +3 -1
- package/dist/types/plugins/find-replace/ui/FindReplace.d.ts +2 -1
- package/dist/types/plugins/find-replace/ui/styles.d.ts +5 -5
- package/dist/types/plugins/layout/styles.d.ts +1 -1
- package/dist/types/plugins/list/actions/wrap-and-join-lists.d.ts +25 -0
- package/dist/types/plugins/list/commands/index.d.ts +0 -1
- package/dist/types/plugins/list/utils/replace-content.d.ts +8 -0
- package/dist/types/plugins/media/nodeviews/mediaNodeUpdater.d.ts +2 -2
- package/dist/types/plugins/media/styles.d.ts +1 -1
- package/dist/types/plugins/media/utils/media-single.d.ts +1 -0
- package/dist/types/plugins/panel/styles.d.ts +1 -1
- package/dist/types/plugins/paste/handlers.d.ts +1 -1
- package/dist/types/plugins/placeholder-text/placeholder-text-nodeview.d.ts +3 -2
- package/dist/types/plugins/placeholder-text/selection-utils.d.ts +2 -0
- package/dist/types/plugins/rule/styles.d.ts +1 -1
- package/dist/types/plugins/table/commands/index.d.ts +1 -1
- package/dist/types/plugins/table/commands/misc.d.ts +0 -1
- package/dist/types/plugins/table/nodeviews/table.d.ts +0 -1
- package/dist/types/plugins/table/pm-plugins/plugin-factory.d.ts +1 -4
- package/dist/types/plugins/table/pm-plugins/plugin-key.d.ts +3 -0
- package/dist/types/plugins/table/types.d.ts +1 -8
- package/dist/types/plugins/table/ui/FloatingContextualButton/{styles.css.d.ts → styles.d.ts} +0 -0
- package/dist/types/plugins/table/ui/FloatingContextualMenu/{styles.css.d.ts → styles.d.ts} +0 -0
- package/dist/types/plugins/table/ui/LayoutButton/index.d.ts +0 -1
- package/dist/types/plugins/table/ui/common-styles.d.ts +6 -0
- package/dist/types/plugins/table/ui/ui-styles.d.ts +15 -0
- package/dist/types/plugins/table/utils/nodes.d.ts +6 -6
- package/dist/types/plugins/text-formatting/pm-plugins/smart-input-rule.d.ts +1 -1
- package/dist/types/plugins/text-formatting/styles.d.ts +2 -1
- package/dist/types/plugins/text-formatting/ui/Toolbar/toolbar-messages.d.ts +30 -0
- package/dist/types/plugins/text-formatting/utils.d.ts +4 -0
- package/dist/types/plugins/type-ahead/api.d.ts +11 -1
- package/dist/types/plugins/type-ahead/transforms/open-typeahead-at-cursor.d.ts +1 -0
- package/dist/types/plugins/type-ahead/utils.d.ts +4 -0
- package/dist/types/ui/ContentStyles/index.d.ts +1 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/selection.d.ts +0 -1
- package/package.json +28 -26
- package/dist/cjs/plugins/table/ui/common-styles.css.js +0 -44
- package/dist/cjs/plugins/table/ui/ui-styles.css.js +0 -95
- package/dist/esm/plugins/table/ui/common-styles.css.js +0 -23
- package/dist/esm/plugins/table/ui/ui-styles.css.js +0 -59
- package/dist/types/plugins/table/ui/common-styles.css.d.ts +0 -3
- package/dist/types/plugins/table/ui/ui-styles.css.d.ts +0 -14
|
@@ -11,7 +11,7 @@ exports.highlightingCodeBlockStyles = exports.codeBlockStyles = void 0;
|
|
|
11
11
|
|
|
12
12
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
13
13
|
|
|
14
|
-
var
|
|
14
|
+
var _react = require("@emotion/react");
|
|
15
15
|
|
|
16
16
|
var _components = require("@atlaskit/theme/components");
|
|
17
17
|
|
|
@@ -29,46 +29,53 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
29
29
|
|
|
30
30
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
31
|
|
|
32
|
-
var highlightingCodeBlockStyles =
|
|
33
|
-
background: (0,
|
|
32
|
+
var highlightingCodeBlockStyles = function highlightingCodeBlockStyles(props) {
|
|
33
|
+
return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror .code-block {\n position: relative;\n background-image: ", ";\n background-repeat: no-repeat;\n background-color: ", ";\n --ds--code--bg-color: transparent;\n background-attachment: local, scroll, scroll;\n background-size: 8px 100%, 8px 100%, 8px 100%;\n background-position: 100% 0, 100% 0, 0 0;\n font-family: ", ";\n border-radius: ", "px;\n margin: ", " 0 0 0;\n counter-reset: line;\n display: flex;\n min-width: ", "px;\n cursor: pointer;\n overflow-x: auto;\n\n .", " {\n /* https://bitbucket.org/atlassian/atlassian-frontend/src/develop/packages/design-system/code/src/themes/themeBuilder.ts#packages/design-system/code/src/themes/themeBuilder.ts-19:28 */\n flex-shrink: 0;\n text-align: right;\n background-color: ", ";\n padding: ", "px;\n color: ", ";\n\n span {\n display: block;\n line-height: 0;\n font-size: 0;\n\n &::before {\n display: inline-block;\n content: counter(line);\n counter-increment: line;\n font-size: ", ";\n line-height: 1.5rem;\n color: ", ";\n }\n }\n }\n\n .", " {\n position: absolute;\n z-index: 2;\n width: 100%;\n height: 100%;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n pointer-events: none;\n overflow: hidden;\n tab-size: 4;\n\n & [data-ds--code--code-block] {\n font-size: ", ";\n line-height: 1.5rem;\n }\n }\n\n .", " {\n position: relative;\n z-index: 1;\n display: flex;\n flex: 1;\n\n > code {\n flex-grow: 1;\n tab-size: 4;\n cursor: text;\n /* https://bitbucket.org/atlassian/atlassian-frontend/src/218202daeaf527262c21841e6f88fa058d349ad4/packages/design-system/code/src/themes/themeBuilder.ts#lines-12:17 */\n font-size: ", ";\n line-height: 1.5rem;\n border-radius: ", "px;\n margin: ", "px;\n white-space: pre;\n }\n\n &[data-debounce='true'] {\n .", " {\n display: none;\n }\n }\n\n &:not([data-debounce='true']) {\n > code:not([data-language='plaintext']):not([data-language='none']):not([data-language='']) {\n color: transparent;\n caret-color: ", ";\n }\n }\n }\n }\n\n .ProseMirror li > .code-block {\n margin: 0;\n }\n\n .ProseMirror .code-block.", ":not(.danger) {\n ", "\n }\n\n /* Danger when top level node */\n .ProseMirror .danger.code-block {\n box-shadow: 0 0 0 ", "px ", ";\n\n .", " {\n background-color: ", ";\n color: ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n\n /* Danger when nested node */\n .ProseMirror .danger .code-block {\n .", " {\n background-color: rgba(255, 143, 115, 0.5);\n color: ", ";\n }\n\n .", " {\n background-color: rgba(255, 189, 173, 0.5);\n }\n }\n"])), (0, _editorSharedStyles.overflowShadow)({
|
|
34
|
+
background: (0, _components.themed)({
|
|
35
|
+
light: colors.N20,
|
|
36
|
+
dark: colors.DN50
|
|
37
|
+
})(props),
|
|
38
|
+
width: '8px'
|
|
39
|
+
}), (0, _components.themed)({
|
|
34
40
|
light: colors.N20,
|
|
35
41
|
dark: colors.DN50
|
|
36
|
-
}),
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
light: colors.N800,
|
|
52
|
-
dark: colors.DN500
|
|
53
|
-
}), _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow, _editorSharedStyles.SelectionStyle.Blanket]), _editorSharedStyles.akEditorSelectedBorderSize, _editorSharedStyles.akEditorDeleteBorder, _classNames.codeBlockClassNames.gutter, colors.R75, _editorSharedStyles.akEditorDeleteIconColor, _classNames.codeBlockClassNames.content, _editorSharedStyles.akEditorDeleteBackground, _classNames.codeBlockClassNames.gutter, _editorSharedStyles.akEditorDeleteIconColor, _classNames.codeBlockClassNames.content);
|
|
42
|
+
})(props), _editorSharedStyles.akEditorCodeFontFamily, (0, _constants.borderRadius)(), _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.akEditorTableCellMinWidth, _classNames.codeBlockClassNames.gutter, (0, _components.themed)({
|
|
43
|
+
light: colors.N30,
|
|
44
|
+
dark: colors.DN20
|
|
45
|
+
})(props), (0, _constants.gridSize)(), (0, _components.themed)({
|
|
46
|
+
light: colors.N90,
|
|
47
|
+
dark: colors.DN90
|
|
48
|
+
})(props), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _components.themed)({
|
|
49
|
+
light: colors.N400,
|
|
50
|
+
dark: colors.DN400
|
|
51
|
+
})(props), _classNames.codeBlockClassNames.highlighting, (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), _classNames.codeBlockClassNames.content, (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _constants.borderRadius)(), (0, _constants.gridSize)(), _classNames.codeBlockClassNames.highlighting, (0, _components.themed)({
|
|
52
|
+
light: colors.N800,
|
|
53
|
+
dark: colors.DN500
|
|
54
|
+
})(props), _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow, _editorSharedStyles.SelectionStyle.Blanket]), _editorSharedStyles.akEditorSelectedBorderSize, _editorSharedStyles.akEditorDeleteBorder, _classNames.codeBlockClassNames.gutter, colors.R75, _editorSharedStyles.akEditorDeleteIconColor, _classNames.codeBlockClassNames.content, _editorSharedStyles.akEditorDeleteBackground, _classNames.codeBlockClassNames.gutter, _editorSharedStyles.akEditorDeleteIconColor, _classNames.codeBlockClassNames.content);
|
|
55
|
+
};
|
|
56
|
+
|
|
54
57
|
exports.highlightingCodeBlockStyles = highlightingCodeBlockStyles;
|
|
55
|
-
|
|
56
|
-
|
|
58
|
+
|
|
59
|
+
var codeBlockStyles = function codeBlockStyles(props) {
|
|
60
|
+
return (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror .code-block {\n position: relative;\n background-image: ", ";\n --ds--code--bg-color: transparent;\n background-repeat: no-repeat;\n background-color: ", ";\n background-attachment: local, scroll, scroll;\n background-size: 8px 100%, 8px 100%, 8px 100%;\n background-position: 100% 0, 100% 0, 0 0;\n font-family: ", ";\n border-radius: ", "px;\n margin: ", " 0 0 0;\n counter-reset: line;\n display: flex;\n min-width: ", "px;\n cursor: pointer;\n overflow-x: auto;\n\n .", " {\n /* https://bitbucket.org/atlassian/atlassian-frontend/src/develop/packages/design-system/code/src/themes/themeBuilder.ts#packages/design-system/code/src/themes/themeBuilder.ts-19:28 */\n flex-shrink: 0;\n text-align: right;\n background-color: ", ";\n padding: ", "px;\n\n span {\n display: block;\n line-height: 0;\n font-size: 0;\n\n &::before {\n display: inline-block;\n content: counter(line);\n counter-increment: line;\n font-size: ", ";\n line-height: 1.5rem;\n color: ", ";\n }\n }\n }\n\n .", " {\n display: flex;\n flex: 1;\n\n code {\n flex-grow: 1;\n tab-size: 4;\n cursor: text;\n /* https://bitbucket.org/atlassian/atlassian-frontend/src/218202daeaf527262c21841e6f88fa058d349ad4/packages/design-system/code/src/themes/themeBuilder.ts#lines-12:17 */\n font-size: ", ";\n line-height: 1.5rem;\n color: ", ";\n border-radius: ", "px;\n margin: ", "px;\n white-space: pre;\n }\n }\n }\n\n .ProseMirror li > .code-block {\n margin: 0;\n }\n\n .ProseMirror .code-block.", ":not(.danger) {\n ", "\n }\n\n /* Danger when top level node */\n .ProseMirror .danger.code-block {\n box-shadow: 0 0 0 ", "px ", ";\n\n .", " {\n background-color: ", ";\n color: ", ";\n }\n\n .", " {\n background-color: ", ";\n }\n }\n\n /* Danger when nested node */\n .ProseMirror .danger .code-block {\n .", " {\n background-color: rgba(255, 143, 115, 0.5);\n color: ", ";\n }\n\n .", " {\n background-color: rgba(255, 189, 173, 0.5);\n }\n }\n"])), (0, _editorSharedStyles.overflowShadow)({
|
|
61
|
+
background: (0, _components.themed)({
|
|
62
|
+
light: colors.N20,
|
|
63
|
+
dark: colors.DN50
|
|
64
|
+
})(props),
|
|
65
|
+
width: '8px'
|
|
66
|
+
}), (0, _components.themed)({
|
|
57
67
|
light: colors.N20,
|
|
58
68
|
dark: colors.DN50
|
|
59
|
-
}),
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
light: colors.N800,
|
|
72
|
-
dark: colors.DN800
|
|
73
|
-
}), (0, _constants.borderRadius)(), (0, _constants.gridSize)(), _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow, _editorSharedStyles.SelectionStyle.Blanket]), _editorSharedStyles.akEditorSelectedBorderSize, _editorSharedStyles.akEditorDeleteBorder, _classNames.codeBlockClassNames.gutter, colors.R75, _editorSharedStyles.akEditorDeleteIconColor, _classNames.codeBlockClassNames.content, _editorSharedStyles.akEditorDeleteBackground, _classNames.codeBlockClassNames.gutter, _editorSharedStyles.akEditorDeleteIconColor, _classNames.codeBlockClassNames.content);
|
|
69
|
+
})(props), _editorSharedStyles.akEditorCodeFontFamily, (0, _constants.borderRadius)(), _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.akEditorTableCellMinWidth, _classNames.codeBlockClassNames.gutter, (0, _components.themed)({
|
|
70
|
+
light: colors.N30,
|
|
71
|
+
dark: colors.DN20
|
|
72
|
+
})(props), (0, _constants.gridSize)(), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _components.themed)({
|
|
73
|
+
light: colors.N400,
|
|
74
|
+
dark: colors.DN400
|
|
75
|
+
})(props), _classNames.codeBlockClassNames.content, (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), (0, _components.themed)({
|
|
76
|
+
light: colors.N800,
|
|
77
|
+
dark: colors.DN800
|
|
78
|
+
})(props), (0, _constants.borderRadius)(), (0, _constants.gridSize)(), _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.BoxShadow, _editorSharedStyles.SelectionStyle.Blanket]), _editorSharedStyles.akEditorSelectedBorderSize, _editorSharedStyles.akEditorDeleteBorder, _classNames.codeBlockClassNames.gutter, colors.R75, _editorSharedStyles.akEditorDeleteIconColor, _classNames.codeBlockClassNames.content, _editorSharedStyles.akEditorDeleteBackground, _classNames.codeBlockClassNames.gutter, _editorSharedStyles.akEditorDeleteIconColor, _classNames.codeBlockClassNames.content);
|
|
79
|
+
};
|
|
80
|
+
|
|
74
81
|
exports.codeBlockStyles = codeBlockStyles;
|
|
@@ -15,6 +15,8 @@ var _reducer = _interopRequireDefault(require("./reducer"));
|
|
|
15
15
|
|
|
16
16
|
var _pluginKey = require("./plugin-key");
|
|
17
17
|
|
|
18
|
+
var _utils = require("./utils");
|
|
19
|
+
|
|
18
20
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19
21
|
|
|
20
22
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -37,7 +39,8 @@ var factory = (0, _pluginStateFactory.pluginFactory)(_pluginKey.pluginKey, _redu
|
|
|
37
39
|
return _objectSpread(_objectSpread({}, state), {}, {
|
|
38
40
|
positions: positions
|
|
39
41
|
});
|
|
40
|
-
}
|
|
42
|
+
},
|
|
43
|
+
onSelectionChanged: _utils.onSelectionChanged
|
|
41
44
|
});
|
|
42
45
|
var createPluginState = factory.createPluginState;
|
|
43
46
|
exports.createPluginState = createPluginState;
|
|
@@ -296,6 +296,7 @@ var createPlugin = function createPlugin(dispatch, providerFactory, extensionHan
|
|
|
296
296
|
var useLongPressSelection = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
|
|
297
297
|
var options = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : {};
|
|
298
298
|
var state = (0, _pluginFactory.createPluginState)(dispatch, {
|
|
299
|
+
shouldRefreshEditButton: false,
|
|
299
300
|
showEditButton: false,
|
|
300
301
|
showContextPanel: false
|
|
301
302
|
});
|
|
@@ -319,25 +320,45 @@ var createPlugin = function createPlugin(dispatch, providerFactory, extensionHan
|
|
|
319
320
|
element = _getPluginState.element,
|
|
320
321
|
localId = _getPluginState.localId,
|
|
321
322
|
extensionProvider = _getPluginState.extensionProvider,
|
|
322
|
-
showContextPanel = _getPluginState.showContextPanel
|
|
323
|
+
showContextPanel = _getPluginState.showContextPanel,
|
|
324
|
+
shouldRefreshEditButton = _getPluginState.shouldRefreshEditButton;
|
|
323
325
|
|
|
326
|
+
if (!shouldRefreshEditButton) {
|
|
327
|
+
return false;
|
|
328
|
+
} // This fetches the selected extension node, either by keyboard selection or click for all types of extensions
|
|
324
329
|
|
|
325
|
-
|
|
330
|
+
|
|
331
|
+
var selectedExtension = (0, _utils2.getSelectedExtension)(state, true); // If our selection isn't on an extension node, clear some state and hide the config panel
|
|
326
332
|
|
|
327
333
|
if (!selectedExtension) {
|
|
328
334
|
if (showContextPanel) {
|
|
329
335
|
(0, _commands.clearEditingContext)(state, dispatch);
|
|
330
336
|
}
|
|
331
337
|
|
|
338
|
+
(0, _commands.updateState)({
|
|
339
|
+
shouldRefreshEditButton: false,
|
|
340
|
+
localId: undefined,
|
|
341
|
+
element: undefined,
|
|
342
|
+
showEditButton: false,
|
|
343
|
+
updateExtension: undefined
|
|
344
|
+
})(state, dispatch);
|
|
332
345
|
return;
|
|
333
|
-
}
|
|
346
|
+
} // By this point we're certain we've selected an extension node.
|
|
347
|
+
// But we need to determine if the selection has changed to another
|
|
348
|
+
// extension node or remained on the same node.
|
|
349
|
+
|
|
334
350
|
|
|
335
351
|
var node = selectedExtension.node;
|
|
336
352
|
var newElement = (0, _utils2.getSelectedDomElement)(state.schema, domAtPos, selectedExtension); // New node is selection
|
|
337
353
|
|
|
338
|
-
|
|
354
|
+
var hasSelectedNodeChanged = node.attrs.localId ? localId !== node.attrs.localId : // This is the current assumption and it's wrong but we are keeping it
|
|
339
355
|
// as fallback in case we need to turn off `allowLocalIdGeneration`
|
|
340
|
-
element !== newElement
|
|
356
|
+
element !== newElement;
|
|
357
|
+
var nextState = {
|
|
358
|
+
shouldRefreshEditButton: false
|
|
359
|
+
};
|
|
360
|
+
|
|
361
|
+
if (hasSelectedNodeChanged) {
|
|
341
362
|
if (showContextPanel) {
|
|
342
363
|
(0, _commands.clearEditingContext)(state, dispatch);
|
|
343
364
|
}
|
|
@@ -348,20 +369,20 @@ var createPlugin = function createPlugin(dispatch, providerFactory, extensionHan
|
|
|
348
369
|
var showEditButton = shouldShowEditButton(extensionHandler, extensionProvider);
|
|
349
370
|
var updateExtension = getUpdateExtensionPromise(view, extensionHandler, extensionProvider).catch(function () {// do nothing;
|
|
350
371
|
});
|
|
351
|
-
(
|
|
372
|
+
Object.assign(nextState, {
|
|
352
373
|
localId: node.attrs.localId,
|
|
353
|
-
showContextPanel: false,
|
|
354
374
|
element: newElement,
|
|
355
375
|
showEditButton: showEditButton,
|
|
356
376
|
updateExtension: updateExtension
|
|
357
|
-
})
|
|
377
|
+
});
|
|
358
378
|
} // New DOM element doesn't necessarily mean it's a new Node
|
|
359
379
|
else if (element !== newElement) {
|
|
360
|
-
(
|
|
380
|
+
Object.assign(nextState, {
|
|
361
381
|
element: newElement
|
|
362
|
-
})
|
|
382
|
+
});
|
|
363
383
|
}
|
|
364
384
|
|
|
385
|
+
(0, _commands.updateState)(nextState)(state, dispatch);
|
|
365
386
|
return true;
|
|
366
387
|
},
|
|
367
388
|
destroy: function destroy() {
|
|
@@ -378,7 +399,9 @@ var createPlugin = function createPlugin(dispatch, providerFactory, extensionHan
|
|
|
378
399
|
inlineExtension: (0, _extension.default)(portalProviderAPI, eventDispatcher, providerFactory, extensionHandlers, extensionNodeViewOptions)
|
|
379
400
|
},
|
|
380
401
|
handleClickOn: (0, _utils.createSelectionClickHandler)(['extension', 'bodiedExtension'], function (target) {
|
|
381
|
-
|
|
402
|
+
// Clicked on anything around the extension content
|
|
403
|
+
// or specifically on the content border of a bodied extension
|
|
404
|
+
return !target.closest('.extension-content') || target.classList.contains('extension-content');
|
|
382
405
|
}, {
|
|
383
406
|
useLongPressSelection: useLongPressSelection
|
|
384
407
|
})
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
|
-
exports.getSelectedExtension = exports.getSelectedDomElement = exports.getNodeTypesReferenced = exports.getDataConsumerMark = exports.findNodePosWithLocalId = exports.findExtensionWithLocalId = void 0;
|
|
8
|
+
exports.onSelectionChanged = exports.getSelectedExtension = exports.getSelectedDomElement = exports.getNodeTypesReferenced = exports.getDataConsumerMark = exports.findNodePosWithLocalId = exports.findExtensionWithLocalId = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
7
11
|
|
|
8
12
|
var _prosemirrorUtils = require("prosemirror-utils");
|
|
9
13
|
|
|
@@ -11,18 +15,31 @@ var _dom = require("../../utils/dom");
|
|
|
11
15
|
|
|
12
16
|
var _nodesByLocalIds = require("../../utils/nodes-by-localIds");
|
|
13
17
|
|
|
18
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
+
|
|
20
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
|
+
|
|
22
|
+
var getSelectedExtensionByTransaction = function getSelectedExtensionByTransaction(transaction) {
|
|
23
|
+
var searchParent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
24
|
+
return _getSelectedExtension(transaction.doc.type.schema, transaction.selection, searchParent);
|
|
25
|
+
};
|
|
26
|
+
|
|
14
27
|
var getSelectedExtension = function getSelectedExtension(state) {
|
|
15
28
|
var searchParent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
16
|
-
|
|
17
|
-
inlineExtension = _state$schema$nodes.inlineExtension,
|
|
18
|
-
extension = _state$schema$nodes.extension,
|
|
19
|
-
bodiedExtension = _state$schema$nodes.bodiedExtension;
|
|
20
|
-
var nodeTypes = [extension, bodiedExtension, inlineExtension];
|
|
21
|
-
return (0, _prosemirrorUtils.findSelectedNodeOfType)(nodeTypes)(state.selection) || searchParent && (0, _prosemirrorUtils.findParentNodeOfType)(nodeTypes)(state.selection) || undefined;
|
|
29
|
+
return _getSelectedExtension(state.schema, state.selection, searchParent);
|
|
22
30
|
};
|
|
23
31
|
|
|
24
32
|
exports.getSelectedExtension = getSelectedExtension;
|
|
25
33
|
|
|
34
|
+
var _getSelectedExtension = function _getSelectedExtension(schema, selection, searchParent) {
|
|
35
|
+
var _schema$nodes = schema.nodes,
|
|
36
|
+
inlineExtension = _schema$nodes.inlineExtension,
|
|
37
|
+
extension = _schema$nodes.extension,
|
|
38
|
+
bodiedExtension = _schema$nodes.bodiedExtension;
|
|
39
|
+
var nodeTypes = [extension, bodiedExtension, inlineExtension];
|
|
40
|
+
return (0, _prosemirrorUtils.findSelectedNodeOfType)(nodeTypes)(selection) || searchParent && (0, _prosemirrorUtils.findParentNodeOfType)(nodeTypes)(selection) || undefined;
|
|
41
|
+
};
|
|
42
|
+
|
|
26
43
|
var findExtensionWithLocalId = function findExtensionWithLocalId(state, localId) {
|
|
27
44
|
var selectedExtension = getSelectedExtension(state, true);
|
|
28
45
|
|
|
@@ -34,10 +51,10 @@ var findExtensionWithLocalId = function findExtensionWithLocalId(state, localId)
|
|
|
34
51
|
return selectedExtension;
|
|
35
52
|
}
|
|
36
53
|
|
|
37
|
-
var _state$schema$
|
|
38
|
-
inlineExtension = _state$schema$
|
|
39
|
-
extension = _state$schema$
|
|
40
|
-
bodiedExtension = _state$schema$
|
|
54
|
+
var _state$schema$nodes = state.schema.nodes,
|
|
55
|
+
inlineExtension = _state$schema$nodes.inlineExtension,
|
|
56
|
+
extension = _state$schema$nodes.extension,
|
|
57
|
+
bodiedExtension = _state$schema$nodes.bodiedExtension;
|
|
41
58
|
var nodeTypes = [extension, bodiedExtension, inlineExtension];
|
|
42
59
|
var matched;
|
|
43
60
|
state.doc.descendants(function (node, pos) {
|
|
@@ -91,4 +108,32 @@ var findNodePosWithLocalId = function findNodePosWithLocalId(state, localId) {
|
|
|
91
108
|
return nodes.length >= 1 ? nodes[0] : undefined;
|
|
92
109
|
};
|
|
93
110
|
|
|
94
|
-
exports.findNodePosWithLocalId = findNodePosWithLocalId;
|
|
111
|
+
exports.findNodePosWithLocalId = findNodePosWithLocalId;
|
|
112
|
+
|
|
113
|
+
var onSelectionChanged = function onSelectionChanged(tr, state) {
|
|
114
|
+
var selectedExtension = getSelectedExtensionByTransaction(tr, true);
|
|
115
|
+
var hasUnselectedExtension = !!state.element && !selectedExtension;
|
|
116
|
+
/*
|
|
117
|
+
* We use this to indicate to our plugin that the selection has changed.
|
|
118
|
+
*
|
|
119
|
+
* - ignore if shouldRefreshEditButton already set
|
|
120
|
+
* - restrict to scenarios when an extension is
|
|
121
|
+
* - a) actually selected
|
|
122
|
+
* - b) or un-selected (not accounting for selection extensionA -> extensionB)
|
|
123
|
+
*
|
|
124
|
+
* The rest of the logic will be handled in Extension main plugin view update().
|
|
125
|
+
*
|
|
126
|
+
* Known issue: typing inside of a bodiedExtension will trigger state changes each keystroke
|
|
127
|
+
* as the toolbar always being open while it is focused.
|
|
128
|
+
*/
|
|
129
|
+
|
|
130
|
+
if (!state.shouldRefreshEditButton && (selectedExtension || hasUnselectedExtension)) {
|
|
131
|
+
return _objectSpread(_objectSpread({}, state), {}, {
|
|
132
|
+
shouldRefreshEditButton: true
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
return state;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
exports.onSelectionChanged = onSelectionChanged;
|
|
@@ -23,7 +23,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
23
23
|
|
|
24
24
|
var _react = _interopRequireDefault(require("react"));
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _react2 = require("@emotion/react");
|
|
27
27
|
|
|
28
28
|
var _reactIntlNext = require("react-intl-next");
|
|
29
29
|
|
|
@@ -194,16 +194,16 @@ var Find = /*#__PURE__*/function (_React$Component) {
|
|
|
194
194
|
_this.findNext = formatMessage(messages.findNext);
|
|
195
195
|
_this.findPrevious = formatMessage(messages.findPrevious);
|
|
196
196
|
_this.matchCase = formatMessage(messages.matchCase);
|
|
197
|
-
_this.matchCaseIcon = (0,
|
|
197
|
+
_this.matchCaseIcon = (0, _react2.jsx)(_keyboard.default, {
|
|
198
198
|
label: _this.matchCase
|
|
199
199
|
});
|
|
200
|
-
_this.findNextIcon = (0,
|
|
200
|
+
_this.findNextIcon = (0, _react2.jsx)(_chevronDown.default, {
|
|
201
201
|
label: _this.findNext
|
|
202
202
|
});
|
|
203
|
-
_this.findPrevIcon = (0,
|
|
203
|
+
_this.findPrevIcon = (0, _react2.jsx)(_chevronUp.default, {
|
|
204
204
|
label: _this.findPrevious
|
|
205
205
|
});
|
|
206
|
-
_this.closeIcon = (0,
|
|
206
|
+
_this.closeIcon = (0, _react2.jsx)(_close.default, {
|
|
207
207
|
label: _this.closeFindReplaceDialog
|
|
208
208
|
}); // We locally manage the value of the input inside this component in order to support compositions.
|
|
209
209
|
// This requires some additional work inside componentDidUpdate to ensure we support changes that
|
|
@@ -241,9 +241,9 @@ var Find = /*#__PURE__*/function (_React$Component) {
|
|
|
241
241
|
selectedMatchPosition: count.index + 1,
|
|
242
242
|
totalResultsCount: count.total
|
|
243
243
|
});
|
|
244
|
-
return (0,
|
|
244
|
+
return (0, _react2.jsx)("div", {
|
|
245
245
|
css: _styles.sectionWrapperStyles
|
|
246
|
-
}, (0,
|
|
246
|
+
}, (0, _react2.jsx)(_textfield.default, {
|
|
247
247
|
name: "find",
|
|
248
248
|
appearance: "none",
|
|
249
249
|
placeholder: this.find,
|
|
@@ -255,27 +255,27 @@ var Find = /*#__PURE__*/function (_React$Component) {
|
|
|
255
255
|
onBlur: this.props.onFindBlur,
|
|
256
256
|
onCompositionStart: this.handleCompositionStart,
|
|
257
257
|
onCompositionEnd: this.handleCompositionEnd
|
|
258
|
-
}), findText && (0,
|
|
258
|
+
}), findText && (0, _react2.jsx)("span", {
|
|
259
259
|
"data-testid": "textfield-count",
|
|
260
260
|
css: _styles.countStyles
|
|
261
|
-
}, count.total === 0 ? this.noResultsFound : resultsCount), allowMatchCase && (0,
|
|
261
|
+
}, count.total === 0 ? this.noResultsFound : resultsCount), allowMatchCase && (0, _react2.jsx)(_FindReplaceTooltipButton.FindReplaceTooltipButton, {
|
|
262
262
|
title: this.matchCase,
|
|
263
263
|
icon: this.matchCaseIcon,
|
|
264
264
|
onClick: this.handleMatchCaseClick,
|
|
265
265
|
isPressed: shouldMatchCase
|
|
266
|
-
}), (0,
|
|
266
|
+
}), (0, _react2.jsx)(_FindReplaceTooltipButton.FindReplaceTooltipButton, {
|
|
267
267
|
title: this.findNext,
|
|
268
268
|
icon: this.findNextIcon,
|
|
269
269
|
keymapDescription: 'Enter',
|
|
270
270
|
onClick: this.handleFindNextClick,
|
|
271
271
|
disabled: count.total <= 1
|
|
272
|
-
}), (0,
|
|
272
|
+
}), (0, _react2.jsx)(_FindReplaceTooltipButton.FindReplaceTooltipButton, {
|
|
273
273
|
title: this.findPrevious,
|
|
274
274
|
icon: this.findPrevIcon,
|
|
275
275
|
keymapDescription: 'Shift Enter',
|
|
276
276
|
onClick: this.handleFindPrevClick,
|
|
277
277
|
disabled: count.total <= 1
|
|
278
|
-
}), (0,
|
|
278
|
+
}), (0, _react2.jsx)(_FindReplaceTooltipButton.FindReplaceTooltipButton, {
|
|
279
279
|
title: this.closeFindReplaceDialog,
|
|
280
280
|
icon: this.closeIcon,
|
|
281
281
|
keymapDescription: 'Escape',
|
|
@@ -23,7 +23,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
23
23
|
|
|
24
24
|
var _react = _interopRequireDefault(require("react"));
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _react2 = require("@emotion/react");
|
|
27
27
|
|
|
28
28
|
var _Find = _interopRequireDefault(require("./Find"));
|
|
29
29
|
|
|
@@ -90,9 +90,9 @@ var FindReplace = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
90
90
|
allowMatchCase = _this$props.allowMatchCase,
|
|
91
91
|
shouldMatchCase = _this$props.shouldMatchCase,
|
|
92
92
|
onToggleMatchCase = _this$props.onToggleMatchCase;
|
|
93
|
-
return (0,
|
|
93
|
+
return (0, _react2.jsx)("div", {
|
|
94
94
|
css: _styles.wrapperStyles
|
|
95
|
-
}, (0,
|
|
95
|
+
}, (0, _react2.jsx)(_Find.default, {
|
|
96
96
|
allowMatchCase: allowMatchCase,
|
|
97
97
|
shouldMatchCase: shouldMatchCase,
|
|
98
98
|
onToggleMatchCase: onToggleMatchCase,
|
|
@@ -106,10 +106,10 @@ var FindReplace = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
106
106
|
onFindTextfieldRefSet: this.setFindTextfieldRef,
|
|
107
107
|
onCancel: onCancel,
|
|
108
108
|
onArrowDown: this.setFocusToReplace
|
|
109
|
-
}), (0,
|
|
109
|
+
}), (0, _react2.jsx)("hr", {
|
|
110
110
|
css: _styles.ruleStyles,
|
|
111
111
|
id: "replace-hr-element"
|
|
112
|
-
}), (0,
|
|
112
|
+
}), (0, _react2.jsx)(_Replace.default, {
|
|
113
113
|
canReplace: count.total > 0,
|
|
114
114
|
replaceText: replaceText,
|
|
115
115
|
onReplace: onReplace,
|
|
@@ -23,7 +23,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
23
23
|
|
|
24
24
|
var _react = _interopRequireDefault(require("react"));
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _react2 = require("@emotion/react");
|
|
27
27
|
|
|
28
28
|
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
29
29
|
|
|
@@ -171,9 +171,9 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
171
171
|
value: function render() {
|
|
172
172
|
var replaceText = this.state.replaceText;
|
|
173
173
|
var canReplace = this.props.canReplace;
|
|
174
|
-
return (0,
|
|
174
|
+
return (0, _react2.jsx)("div", {
|
|
175
175
|
css: _styles.sectionWrapperStyles
|
|
176
|
-
}, (0,
|
|
176
|
+
}, (0, _react2.jsx)(_textfield.default, {
|
|
177
177
|
name: "replace",
|
|
178
178
|
appearance: "none",
|
|
179
179
|
placeholder: this.replaceWith,
|
|
@@ -184,12 +184,12 @@ var Replace = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
184
184
|
onKeyDown: this.handleReplaceKeyDown,
|
|
185
185
|
onCompositionStart: this.handleCompositionStart,
|
|
186
186
|
onCompositionEnd: this.handleCompositionEnd
|
|
187
|
-
}), (0,
|
|
187
|
+
}), (0, _react2.jsx)(_standardButton.default, {
|
|
188
188
|
css: _styles.replaceSectionButtonStyles,
|
|
189
189
|
testId: this.replace,
|
|
190
190
|
onClick: this.handleReplaceClick,
|
|
191
191
|
isDisabled: !canReplace
|
|
192
|
-
}, this.replace), (0,
|
|
192
|
+
}, this.replace), (0, _react2.jsx)(_standardButton.default, {
|
|
193
193
|
css: _styles.replaceSectionButtonStyles,
|
|
194
194
|
testId: this.replaceAll,
|
|
195
195
|
onClick: this.handleReplaceAllClick,
|
|
@@ -1,22 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
3
5
|
Object.defineProperty(exports, "__esModule", {
|
|
4
6
|
value: true
|
|
5
7
|
});
|
|
6
8
|
exports.wrapperStyles = exports.sectionWrapperStyles = exports.ruleStyles = exports.replaceSectionButtonStyles = exports.countStyles = void 0;
|
|
7
9
|
|
|
8
|
-
var
|
|
10
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
|
+
|
|
12
|
+
var _react = require("@emotion/react");
|
|
9
13
|
|
|
10
14
|
var _colors = require("@atlaskit/theme/colors");
|
|
11
15
|
|
|
12
16
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
13
17
|
|
|
14
|
-
|
|
15
|
-
|
|
18
|
+
var _templateObject;
|
|
19
|
+
|
|
20
|
+
var replaceSectionButtonStyles = (0, _react.css)({
|
|
16
21
|
marginLeft: '4px'
|
|
17
22
|
});
|
|
18
23
|
exports.replaceSectionButtonStyles = replaceSectionButtonStyles;
|
|
19
|
-
var ruleStyles = (0,
|
|
24
|
+
var ruleStyles = (0, _react.css)({
|
|
20
25
|
width: '100%',
|
|
21
26
|
border: 'none',
|
|
22
27
|
backgroundColor: "".concat(_colors.N30A),
|
|
@@ -25,7 +30,7 @@ var ruleStyles = (0, _core.css)({
|
|
|
25
30
|
borderRadius: '1px'
|
|
26
31
|
});
|
|
27
32
|
exports.ruleStyles = ruleStyles;
|
|
28
|
-
var wrapperStyles = (0,
|
|
33
|
+
var wrapperStyles = (0, _react.css)({
|
|
29
34
|
display: 'flex',
|
|
30
35
|
flexDirection: 'column',
|
|
31
36
|
'> *:not(#replace-hr-element)': {
|
|
@@ -33,17 +38,9 @@ var wrapperStyles = (0, _core.css)({
|
|
|
33
38
|
}
|
|
34
39
|
});
|
|
35
40
|
exports.wrapperStyles = wrapperStyles;
|
|
36
|
-
var sectionWrapperStyles = (0,
|
|
37
|
-
display: 'flex',
|
|
38
|
-
alignItems: 'column',
|
|
39
|
-
'> *': {
|
|
40
|
-
display: 'inline-flex',
|
|
41
|
-
height: '32px',
|
|
42
|
-
flex: '0 0 auto'
|
|
43
|
-
}
|
|
44
|
-
});
|
|
41
|
+
var sectionWrapperStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n\n & > * {\n display: inline-flex;\n height: 32px;\n flex: 0 0 auto;\n }\n\n & > [data-ds--text-field--container] {\n display: flex;\n flex: 1 1 auto;\n }\n"])));
|
|
45
42
|
exports.sectionWrapperStyles = sectionWrapperStyles;
|
|
46
|
-
var countStyles = (0,
|
|
43
|
+
var countStyles = (0, _react.css)({
|
|
47
44
|
color: "".concat(_colors.N60),
|
|
48
45
|
fontSize: "".concat((0, _editorSharedStyles.relativeFontSizeToBase16)(12)),
|
|
49
46
|
flex: '0 0 auto',
|
|
@@ -9,7 +9,7 @@ exports.layoutStyles = exports.LAYOUT_SECTION_MARGIN = exports.LAYOUT_COLUMN_PAD
|
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
|
12
|
-
var
|
|
12
|
+
var _react = require("@emotion/react");
|
|
13
13
|
|
|
14
14
|
var _constants = require("@atlaskit/theme/constants");
|
|
15
15
|
|
|
@@ -29,5 +29,5 @@ var LAYOUT_SECTION_MARGIN = (0, _constants.gridSize)();
|
|
|
29
29
|
exports.LAYOUT_SECTION_MARGIN = LAYOUT_SECTION_MARGIN;
|
|
30
30
|
var LAYOUT_COLUMN_PADDING = (0, _constants.gridSize)() * 1.5;
|
|
31
31
|
exports.LAYOUT_COLUMN_PADDING = LAYOUT_COLUMN_PADDING;
|
|
32
|
-
var layoutStyles = (0,
|
|
32
|
+
var layoutStyles = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n .ProseMirror {\n ", " [data-layout-section] {\n margin: ", "px -", "px 0;\n transition: border-color 0.3s ", ";\n cursor: pointer;\n\n /* Inner cursor located 26px from left */\n [data-layout-column] {\n flex: 1;\n min-width: 0;\n border: ", "px solid ", ";\n border-radius: 4px;\n padding: ", "px;\n box-sizing: border-box;\n\n > div {\n > *:first-child {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-child + * {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child + span + * {\n margin-top: 0;\n }\n\n .rich-media-item {\n margin-top: 0;\n }\n\n > .mediaSingleView-content-wrap:first-child .rich-media-item {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor.-right:first-child\n + .mediaSingleView-content-wrap\n .rich-media-item {\n margin-top: 0;\n }\n\n > .ProseMirror-gapcursor:first-child\n + span\n + .mediaSingleView-content-wrap\n .rich-media-item {\n margin-top: 0;\n }\n\n /* Prevent first DecisionWrapper's margin-top: 8px from shifting decisions down\n and shrinking layout's node selectable area (leniency margin) */\n > [data-node-type='decisionList'] {\n li:first-of-type [data-decision-wrapper] {\n margin-top: 0;\n }\n }\n }\n\n /* Make the 'content' fill the entire height of the layout column to allow click\n handler of layout section nodeview to target only data-layout-column */\n [data-layout-content] {\n height: 100%;\n cursor: text;\n }\n }\n\n [data-layout-column] + [data-layout-column] {\n margin-left: ", "px;\n }\n\n @media screen and (max-width: ", "px) {\n [data-layout-column] + [data-layout-column] {\n margin-left: 0;\n }\n }\n\n /* Shows the border when cursor is inside a layout */\n &.selected [data-layout-column],\n &:hover [data-layout-column] {\n border-color: ", ";\n }\n\n &.selected.danger > [data-layout-column] {\n background-color: ", ";\n border-color: ", ";\n }\n\n &.", ":not(.danger) {\n [data-layout-column] {\n ", "\n }\n }\n }\n }\n\n .fabric-editor--full-width-mode .ProseMirror {\n [data-layout-section] {\n .", " {\n margin: 0 ", "px;\n }\n }\n }\n"])), _styles.columnLayoutSharedStyle, (0, _constants.gridSize)() - 1, _editorSharedStyles.akLayoutGutterOffset, _editorSharedStyles.akEditorSwoopCubicBezier, _editorSharedStyles.akEditorSelectedBorderSize, _colors.N40A, LAYOUT_COLUMN_PADDING, LAYOUT_SECTION_MARGIN, _editorSharedStyles.gridMediumMaxWidth, _colors.N50A, _editorSharedStyles.akEditorDeleteBackground, _editorSharedStyles.akEditorDeleteBorder, _editorSharedStyles.akEditorSelectedNodeClassName, (0, _editorSharedStyles.getSelectionStyles)([_editorSharedStyles.SelectionStyle.Border, _editorSharedStyles.SelectionStyle.Blanket]), _types.TableCssClassName.TABLE_CONTAINER, _consts.tableMarginFullWidthMode);
|
|
33
33
|
exports.layoutStyles = layoutStyles;
|