@atlaskit/editor-plugin-paste-options-toolbar 1.1.6 → 1.1.8

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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/editor-plugin-paste-options-toolbar
2
2
 
3
+ ## 1.1.8
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 1.1.7
10
+
11
+ ### Patch Changes
12
+
13
+ - [#113525](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/113525)
14
+ [`f60b24002afb7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f60b24002afb7) -
15
+ Null check code block node so we don't crash if the code block plugin hasn't been added.
16
+ - Updated dependencies
17
+
3
18
  ## 1.1.6
4
19
 
5
20
  ### Patch Changes
@@ -13,7 +13,7 @@ var _types = require("./types");
13
13
  var _pasteIcon = _interopRequireDefault(require("./ui/paste-icon"));
14
14
  var _util = require("./util");
15
15
  var isToolbarVisible = exports.isToolbarVisible = function isToolbarVisible(state, lastContentPasted) {
16
- var _$from$parent, _$from$node;
16
+ var _$from$parent, _$from$node, _state$schema$nodes$c;
17
17
  /**
18
18
  * Conditions for not showing the toolbar:
19
19
  * 1. Pasting link, media or text containing media(note: markdown link and images are allowed)
@@ -27,7 +27,7 @@ var isToolbarVisible = exports.isToolbarVisible = function isToolbarVisible(stat
27
27
  }
28
28
  var parentNodeType = (_$from$parent = $from.parent) === null || _$from$parent === void 0 ? void 0 : _$from$parent.type;
29
29
  var grandParentNodeType = (_$from$node = $from.node($from.depth - 1)) === null || _$from$node === void 0 ? void 0 : _$from$node.type;
30
- if (grandParentNodeType && grandParentNodeType.name === state.schema.nodes.doc.name && parentNodeType.name !== state.schema.nodes.codeBlock.name && !(0, _util.isPastedFromFabricEditor)(lastContentPasted.pasteSource) && !(0, _util.hasLinkMark)(lastContentPasted.pastedSlice) && !(0, _util.hasMediaNode)(lastContentPasted.pastedSlice)) {
30
+ if (grandParentNodeType && grandParentNodeType.name === state.schema.nodes.doc.name && parentNodeType.name !== ((_state$schema$nodes$c = state.schema.nodes.codeBlock) === null || _state$schema$nodes$c === void 0 ? void 0 : _state$schema$nodes$c.name) && !(0, _util.isPastedFromFabricEditor)(lastContentPasted.pasteSource) && !(0, _util.hasLinkMark)(lastContentPasted.pastedSlice) && !(0, _util.hasMediaNode)(lastContentPasted.pastedSlice)) {
31
31
  return true;
32
32
  }
33
33
  return false;
@@ -8,6 +8,6 @@ exports.textHighlightStyle = void 0;
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
9
  var _react = require("@emotion/react");
10
10
  var _constants = require("../pm-plugins/constants");
11
- var _templateObject;
12
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
11
+ var _templateObject; // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
12
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
13
13
  var textHighlightStyle = exports.textHighlightStyle = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.", " {\n\t\tbackground-color: ", ";\n\n\t\tborder-bottom: 2px solid ", ";\n\t}\n"])), _constants.TEXT_HIGHLIGHT_CLASS, "var(--ds-background-accent-blue-subtlest, #E9F2FF)", "var(--ds-background-accent-blue-subtler, #cce0ff)");
@@ -6,7 +6,7 @@ import { pasteOptionsPluginKey, ToolbarDropdownOption } from './types';
6
6
  import EditorPasteIcon from './ui/paste-icon';
7
7
  import { hasLinkMark, hasMediaNode, hasRuleNode, isPastedFromFabricEditor } from './util';
8
8
  export const isToolbarVisible = (state, lastContentPasted) => {
9
- var _$from$parent, _$from$node;
9
+ var _$from$parent, _$from$node, _state$schema$nodes$c;
10
10
  /**
11
11
  * Conditions for not showing the toolbar:
12
12
  * 1. Pasting link, media or text containing media(note: markdown link and images are allowed)
@@ -20,7 +20,7 @@ export const isToolbarVisible = (state, lastContentPasted) => {
20
20
  }
21
21
  const parentNodeType = (_$from$parent = $from.parent) === null || _$from$parent === void 0 ? void 0 : _$from$parent.type;
22
22
  const grandParentNodeType = (_$from$node = $from.node($from.depth - 1)) === null || _$from$node === void 0 ? void 0 : _$from$node.type;
23
- if (grandParentNodeType && grandParentNodeType.name === state.schema.nodes.doc.name && parentNodeType.name !== state.schema.nodes.codeBlock.name && !isPastedFromFabricEditor(lastContentPasted.pasteSource) && !hasLinkMark(lastContentPasted.pastedSlice) && !hasMediaNode(lastContentPasted.pastedSlice)) {
23
+ if (grandParentNodeType && grandParentNodeType.name === state.schema.nodes.doc.name && parentNodeType.name !== ((_state$schema$nodes$c = state.schema.nodes.codeBlock) === null || _state$schema$nodes$c === void 0 ? void 0 : _state$schema$nodes$c.name) && !isPastedFromFabricEditor(lastContentPasted.pasteSource) && !hasLinkMark(lastContentPasted.pastedSlice) && !hasMediaNode(lastContentPasted.pastedSlice)) {
24
24
  return true;
25
25
  }
26
26
  return false;
@@ -1,7 +1,8 @@
1
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
1
2
  import { css } from '@emotion/react';
2
3
  import { TEXT_HIGHLIGHT_CLASS } from '../pm-plugins/constants';
3
4
 
4
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
5
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
5
6
  export const textHighlightStyle = css`
6
7
  .${TEXT_HIGHLIGHT_CLASS} {
7
8
  background-color: ${"var(--ds-background-accent-blue-subtlest, #E9F2FF)"};
@@ -6,7 +6,7 @@ import { pasteOptionsPluginKey, ToolbarDropdownOption } from './types';
6
6
  import EditorPasteIcon from './ui/paste-icon';
7
7
  import { hasLinkMark, hasMediaNode, hasRuleNode, isPastedFromFabricEditor } from './util';
8
8
  export var isToolbarVisible = function isToolbarVisible(state, lastContentPasted) {
9
- var _$from$parent, _$from$node;
9
+ var _$from$parent, _$from$node, _state$schema$nodes$c;
10
10
  /**
11
11
  * Conditions for not showing the toolbar:
12
12
  * 1. Pasting link, media or text containing media(note: markdown link and images are allowed)
@@ -20,7 +20,7 @@ export var isToolbarVisible = function isToolbarVisible(state, lastContentPasted
20
20
  }
21
21
  var parentNodeType = (_$from$parent = $from.parent) === null || _$from$parent === void 0 ? void 0 : _$from$parent.type;
22
22
  var grandParentNodeType = (_$from$node = $from.node($from.depth - 1)) === null || _$from$node === void 0 ? void 0 : _$from$node.type;
23
- if (grandParentNodeType && grandParentNodeType.name === state.schema.nodes.doc.name && parentNodeType.name !== state.schema.nodes.codeBlock.name && !isPastedFromFabricEditor(lastContentPasted.pasteSource) && !hasLinkMark(lastContentPasted.pastedSlice) && !hasMediaNode(lastContentPasted.pastedSlice)) {
23
+ if (grandParentNodeType && grandParentNodeType.name === state.schema.nodes.doc.name && parentNodeType.name !== ((_state$schema$nodes$c = state.schema.nodes.codeBlock) === null || _state$schema$nodes$c === void 0 ? void 0 : _state$schema$nodes$c.name) && !isPastedFromFabricEditor(lastContentPasted.pasteSource) && !hasLinkMark(lastContentPasted.pastedSlice) && !hasMediaNode(lastContentPasted.pastedSlice)) {
24
24
  return true;
25
25
  }
26
26
  return false;
@@ -1,7 +1,8 @@
1
1
  import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
2
  var _templateObject;
3
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
4
  import { css } from '@emotion/react';
4
5
  import { TEXT_HIGHLIGHT_CLASS } from '../pm-plugins/constants';
5
6
 
6
- // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression -- needs manual remediation
7
+ // eslint-disable-next-line @atlaskit/design-system/no-css-tagged-template-expression, @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
7
8
  export var textHighlightStyle = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n\t.", " {\n\t\tbackground-color: ", ";\n\n\t\tborder-bottom: 2px solid ", ";\n\t}\n"])), TEXT_HIGHLIGHT_CLASS, "var(--ds-background-accent-blue-subtlest, #E9F2FF)", "var(--ds-background-accent-blue-subtler, #cce0ff)");
package/package.json CHANGED
@@ -1,102 +1,102 @@
1
1
  {
2
- "name": "@atlaskit/editor-plugin-paste-options-toolbar",
3
- "version": "1.1.6",
4
- "description": "Paste options toolbar for @atlaskit/editor-core",
5
- "author": "Atlassian Pty Ltd",
6
- "license": "Apache-2.0",
7
- "publishConfig": {
8
- "registry": "https://registry.npmjs.org/"
9
- },
10
- "atlassian": {
11
- "team": "Editor: Scarlet",
12
- "singleton": true,
13
- "inPublicMirror": false,
14
- "releaseModel": "continuous",
15
- "runReact18": false
16
- },
17
- "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
18
- "main": "dist/cjs/index.js",
19
- "module": "dist/esm/index.js",
20
- "module:es2019": "dist/es2019/index.js",
21
- "types": "dist/types/index.d.ts",
22
- "typesVersions": {
23
- ">=4.5 <4.9": {
24
- "*": [
25
- "dist/types-ts4.5/*",
26
- "dist/types-ts4.5/index.d.ts"
27
- ]
28
- }
29
- },
30
- "sideEffects": false,
31
- "atlaskit:src": "src/index.ts",
32
- "af:exports": {
33
- ".": "./src/index.ts",
34
- "./styles": "./src/styles.ts"
35
- },
36
- "dependencies": {
37
- "@atlaskit/editor-common": "^82.0.0",
38
- "@atlaskit/editor-markdown-transformer": "^5.6.0",
39
- "@atlaskit/editor-plugin-analytics": "^1.2.0",
40
- "@atlaskit/editor-plugin-paste": "^1.2.0",
41
- "@atlaskit/editor-prosemirror": "4.0.1",
42
- "@atlaskit/editor-shared-styles": "^2.12.0",
43
- "@atlaskit/icon": "^22.3.0",
44
- "@atlaskit/tokens": "^1.49.0",
45
- "@babel/runtime": "^7.0.0",
46
- "@emotion/react": "^11.7.1",
47
- "react-intl-next": "npm:react-intl@^5.18.1"
48
- },
49
- "peerDependencies": {
50
- "react": "^16.8.0"
51
- },
52
- "devDependencies": {
53
- "@af/visual-regression": "*",
54
- "@atlaskit/ssr": "*",
55
- "@atlaskit/visual-regression": "*",
56
- "@testing-library/react": "^12.1.5",
57
- "react-dom": "^16.8.0",
58
- "typescript": "~5.4.2",
59
- "wait-for-expect": "^1.2.0"
60
- },
61
- "techstack": {
62
- "@atlassian/frontend": {
63
- "code-structure": [
64
- "tangerine-next"
65
- ],
66
- "import-structure": [
67
- "atlassian-conventions"
68
- ],
69
- "circular-dependencies": [
70
- "file-and-folder-level"
71
- ]
72
- },
73
- "@repo/internal": {
74
- "dom-events": "use-bind-event-listener",
75
- "analytics": [
76
- "analytics-next"
77
- ],
78
- "design-tokens": [
79
- "color"
80
- ],
81
- "theming": [
82
- "react-context"
83
- ],
84
- "ui-components": [
85
- "lite-mode"
86
- ],
87
- "deprecation": "no-deprecated-imports",
88
- "styling": [
89
- "emotion",
90
- "emotion"
91
- ],
92
- "imports": [
93
- "import-no-extraneous-disable-for-examples-and-docs"
94
- ]
95
- }
96
- },
97
- "techstackIgnore": {
98
- "stricter": [
99
- "@atlassian/tangerine/project-structure"
100
- ]
101
- }
102
- }
2
+ "name": "@atlaskit/editor-plugin-paste-options-toolbar",
3
+ "version": "1.1.8",
4
+ "description": "Paste options toolbar for @atlaskit/editor-core",
5
+ "author": "Atlassian Pty Ltd",
6
+ "license": "Apache-2.0",
7
+ "publishConfig": {
8
+ "registry": "https://registry.npmjs.org/"
9
+ },
10
+ "atlassian": {
11
+ "team": "Editor: Scarlet",
12
+ "singleton": true,
13
+ "inPublicMirror": false,
14
+ "releaseModel": "continuous",
15
+ "runReact18": false
16
+ },
17
+ "repository": "https://bitbucket.org/atlassian/atlassian-frontend-mirror",
18
+ "main": "dist/cjs/index.js",
19
+ "module": "dist/esm/index.js",
20
+ "module:es2019": "dist/es2019/index.js",
21
+ "types": "dist/types/index.d.ts",
22
+ "typesVersions": {
23
+ ">=4.5 <4.9": {
24
+ "*": [
25
+ "dist/types-ts4.5/*",
26
+ "dist/types-ts4.5/index.d.ts"
27
+ ]
28
+ }
29
+ },
30
+ "sideEffects": false,
31
+ "atlaskit:src": "src/index.ts",
32
+ "af:exports": {
33
+ ".": "./src/index.ts",
34
+ "./styles": "./src/styles.ts"
35
+ },
36
+ "dependencies": {
37
+ "@atlaskit/editor-common": "^83.0.0",
38
+ "@atlaskit/editor-markdown-transformer": "^5.7.0",
39
+ "@atlaskit/editor-plugin-analytics": "^1.3.0",
40
+ "@atlaskit/editor-plugin-paste": "^1.3.0",
41
+ "@atlaskit/editor-prosemirror": "4.0.1",
42
+ "@atlaskit/editor-shared-styles": "^2.12.0",
43
+ "@atlaskit/icon": "^22.4.0",
44
+ "@atlaskit/tokens": "^1.53.0",
45
+ "@babel/runtime": "^7.0.0",
46
+ "@emotion/react": "^11.7.1",
47
+ "react-intl-next": "npm:react-intl@^5.18.1"
48
+ },
49
+ "peerDependencies": {
50
+ "react": "^16.8.0"
51
+ },
52
+ "devDependencies": {
53
+ "@af/visual-regression": "*",
54
+ "@atlaskit/ssr": "*",
55
+ "@atlaskit/visual-regression": "*",
56
+ "@testing-library/react": "^12.1.5",
57
+ "react-dom": "^16.8.0",
58
+ "typescript": "~5.4.2",
59
+ "wait-for-expect": "^1.2.0"
60
+ },
61
+ "techstack": {
62
+ "@atlassian/frontend": {
63
+ "code-structure": [
64
+ "tangerine-next"
65
+ ],
66
+ "import-structure": [
67
+ "atlassian-conventions"
68
+ ],
69
+ "circular-dependencies": [
70
+ "file-and-folder-level"
71
+ ]
72
+ },
73
+ "@repo/internal": {
74
+ "dom-events": "use-bind-event-listener",
75
+ "analytics": [
76
+ "analytics-next"
77
+ ],
78
+ "design-tokens": [
79
+ "color"
80
+ ],
81
+ "theming": [
82
+ "react-context"
83
+ ],
84
+ "ui-components": [
85
+ "lite-mode"
86
+ ],
87
+ "deprecation": "no-deprecated-imports",
88
+ "styling": [
89
+ "emotion",
90
+ "emotion"
91
+ ],
92
+ "imports": [
93
+ "import-no-extraneous-disable-for-examples-and-docs"
94
+ ]
95
+ }
96
+ },
97
+ "techstackIgnore": {
98
+ "stricter": [
99
+ "@atlassian/tangerine/project-structure"
100
+ ]
101
+ }
102
+ }