@atlaskit/editor-plugin-paste 1.2.3 → 1.2.4

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,13 @@
1
1
  # @atlaskit/editor-plugin-paste
2
2
 
3
+ ## 1.2.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#112281](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/112281)
8
+ [`2e2ef0bbefc4b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2e2ef0bbefc4b) -
9
+ Null check mention node so we don't crash if the mention plugin hasn't been added.
10
+
3
11
  ## 1.2.3
4
12
 
5
13
  ### Patch Changes
@@ -73,7 +73,11 @@ function compose(func) {
73
73
  // remove text attribute from mention for copy/paste (GDPR)
74
74
  function handleMention(slice, schema) {
75
75
  return (0, _utils.mapSlice)(slice, function (node) {
76
- if (node.type.name === schema.nodes.mention.name) {
76
+ var _schema$nodes$mention;
77
+ // We should move this to the mention plugin when we refactor how paste works in the future
78
+ // For now we can just null check mention exists in the schema to ensure we don't crash if it doesn't
79
+ // exist.
80
+ if (node.type.name === ((_schema$nodes$mention = schema.nodes.mention) === null || _schema$nodes$mention === void 0 ? void 0 : _schema$nodes$mention.name)) {
77
81
  var mention = node.attrs;
78
82
  var newMention = _objectSpread(_objectSpread({}, mention), {}, {
79
83
  text: ''
@@ -37,7 +37,11 @@ function compose(func, ...funcs) {
37
37
  // remove text attribute from mention for copy/paste (GDPR)
38
38
  export function handleMention(slice, schema) {
39
39
  return mapSlice(slice, node => {
40
- if (node.type.name === schema.nodes.mention.name) {
40
+ var _schema$nodes$mention;
41
+ // We should move this to the mention plugin when we refactor how paste works in the future
42
+ // For now we can just null check mention exists in the schema to ensure we don't crash if it doesn't
43
+ // exist.
44
+ if (node.type.name === ((_schema$nodes$mention = schema.nodes.mention) === null || _schema$nodes$mention === void 0 ? void 0 : _schema$nodes$mention.name)) {
41
45
  const mention = node.attrs;
42
46
  const newMention = {
43
47
  ...mention,
@@ -50,7 +50,11 @@ function compose(func) {
50
50
  // remove text attribute from mention for copy/paste (GDPR)
51
51
  export function handleMention(slice, schema) {
52
52
  return mapSlice(slice, function (node) {
53
- if (node.type.name === schema.nodes.mention.name) {
53
+ var _schema$nodes$mention;
54
+ // We should move this to the mention plugin when we refactor how paste works in the future
55
+ // For now we can just null check mention exists in the schema to ensure we don't crash if it doesn't
56
+ // exist.
57
+ if (node.type.name === ((_schema$nodes$mention = schema.nodes.mention) === null || _schema$nodes$mention === void 0 ? void 0 : _schema$nodes$mention.name)) {
54
58
  var mention = node.attrs;
55
59
  var newMention = _objectSpread(_objectSpread({}, mention), {}, {
56
60
  text: ''
package/package.json CHANGED
@@ -1,147 +1,147 @@
1
1
  {
2
- "name": "@atlaskit/editor-plugin-paste",
3
- "version": "1.2.3",
4
- "description": "Paste plugin 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: Lego",
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
- },
35
- "dependencies": {
36
- "@atlaskit/editor-common": "^82.0.0",
37
- "@atlaskit/editor-markdown-transformer": "^5.6.0",
38
- "@atlaskit/editor-plugin-analytics": "^1.2.0",
39
- "@atlaskit/editor-plugin-annotation": "^1.9.0",
40
- "@atlaskit/editor-plugin-better-type-history": "^1.2.0",
41
- "@atlaskit/editor-plugin-card": "^2.0.0",
42
- "@atlaskit/editor-plugin-feature-flags": "^1.1.0",
43
- "@atlaskit/editor-plugin-list": "^3.3.0",
44
- "@atlaskit/editor-plugin-media": "^1.20.0",
45
- "@atlaskit/editor-prosemirror": "4.0.1",
46
- "@atlaskit/editor-tables": "^2.7.0",
47
- "@atlaskit/media-client": "^27.2.0",
48
- "@atlaskit/media-common": "^11.2.0",
49
- "@atlaskit/platform-feature-flags": "^0.2.0",
50
- "@babel/runtime": "^7.0.0",
51
- "lodash": "^4.17.21",
52
- "uuid": "^3.1.0"
53
- },
54
- "peerDependencies": {
55
- "react": "^16.8.0"
56
- },
57
- "devDependencies": {
58
- "@af/visual-regression": "*",
59
- "@atlaskit/adf-schema": "^36.10.7",
60
- "@atlaskit/editor-plugin-block-type": "^3.5.0",
61
- "@atlaskit/editor-plugin-history": "^1.1.0",
62
- "@atlaskit/editor-plugin-type-ahead": "^1.2.0",
63
- "@atlaskit/ssr": "*",
64
- "@atlaskit/visual-regression": "*",
65
- "@atlassian/feature-flags-test-utils": "^0.2.0",
66
- "@testing-library/react": "^12.1.5",
67
- "react-dom": "^16.8.0",
68
- "typescript": "~5.4.2",
69
- "wait-for-expect": "^1.2.0"
70
- },
71
- "techstack": {
72
- "@atlassian/frontend": {
73
- "code-structure": [
74
- "tangerine-next"
75
- ],
76
- "import-structure": [
77
- "atlassian-conventions"
78
- ],
79
- "circular-dependencies": [
80
- "file-and-folder-level"
81
- ]
82
- },
83
- "@repo/internal": {
84
- "dom-events": "use-bind-event-listener",
85
- "analytics": [
86
- "analytics-next"
87
- ],
88
- "design-tokens": [
89
- "color"
90
- ],
91
- "theming": [
92
- "react-context"
93
- ],
94
- "ui-components": [
95
- "lite-mode"
96
- ],
97
- "deprecation": "no-deprecated-imports",
98
- "styling": [
99
- "emotion",
100
- "emotion"
101
- ],
102
- "imports": [
103
- "import-no-extraneous-disable-for-examples-and-docs"
104
- ]
105
- }
106
- },
107
- "techstackIgnore": {
108
- "stricter": [
109
- "@atlassian/tangerine/project-structure"
110
- ]
111
- },
112
- "platform-feature-flags": {
113
- "platform.editor.media.extended-resize-experience": {
114
- "type": "boolean"
115
- },
116
- "platform.editor.allow-extended-panel": {
117
- "type": "boolean"
118
- },
119
- "platform.editor.allow-action-in-list": {
120
- "type": "boolean"
121
- },
122
- "platform.editor.media.fix-copy-paste-excel_62g4s": {
123
- "type": "boolean"
124
- },
125
- "platform.editor.handle-paste-for-action-in-panel": {
126
- "type": "boolean"
127
- },
128
- "platform.editor.place-cursor-inside-text-block": {
129
- "type": "boolean"
130
- },
131
- "platform.editor.multi-bodied-extension_0rygg": {
132
- "type": "boolean"
133
- },
134
- "platform.editor.table.copy-paste-in-bodied-extension": {
135
- "type": "boolean"
136
- },
137
- "platform.editor.paste-markdown-table-in-a-table": {
138
- "type": "boolean"
139
- },
140
- "platform.editor.extractlistfromparagraphv2": {
141
- "type": "boolean"
142
- },
143
- "platform.editor.preserve-whitespace-clipboard-text-serialization": {
144
- "type": "boolean"
145
- }
146
- }
147
- }
2
+ "name": "@atlaskit/editor-plugin-paste",
3
+ "version": "1.2.4",
4
+ "description": "Paste plugin 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: Lego",
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
+ },
35
+ "dependencies": {
36
+ "@atlaskit/editor-common": "^82.8.0",
37
+ "@atlaskit/editor-markdown-transformer": "^5.6.0",
38
+ "@atlaskit/editor-plugin-analytics": "^1.2.0",
39
+ "@atlaskit/editor-plugin-annotation": "^1.10.0",
40
+ "@atlaskit/editor-plugin-better-type-history": "^1.2.0",
41
+ "@atlaskit/editor-plugin-card": "^2.0.0",
42
+ "@atlaskit/editor-plugin-feature-flags": "^1.1.0",
43
+ "@atlaskit/editor-plugin-list": "^3.3.0",
44
+ "@atlaskit/editor-plugin-media": "^1.20.0",
45
+ "@atlaskit/editor-prosemirror": "4.0.1",
46
+ "@atlaskit/editor-tables": "^2.7.0",
47
+ "@atlaskit/media-client": "^27.2.0",
48
+ "@atlaskit/media-common": "^11.2.0",
49
+ "@atlaskit/platform-feature-flags": "^0.2.0",
50
+ "@babel/runtime": "^7.0.0",
51
+ "lodash": "^4.17.21",
52
+ "uuid": "^3.1.0"
53
+ },
54
+ "peerDependencies": {
55
+ "react": "^16.8.0"
56
+ },
57
+ "devDependencies": {
58
+ "@af/visual-regression": "*",
59
+ "@atlaskit/adf-schema": "^36.10.7",
60
+ "@atlaskit/editor-plugin-block-type": "^3.6.0",
61
+ "@atlaskit/editor-plugin-history": "^1.1.0",
62
+ "@atlaskit/editor-plugin-type-ahead": "^1.2.0",
63
+ "@atlaskit/ssr": "*",
64
+ "@atlaskit/visual-regression": "*",
65
+ "@atlassian/feature-flags-test-utils": "^0.2.0",
66
+ "@testing-library/react": "^12.1.5",
67
+ "react-dom": "^16.8.0",
68
+ "typescript": "~5.4.2",
69
+ "wait-for-expect": "^1.2.0"
70
+ },
71
+ "techstack": {
72
+ "@atlassian/frontend": {
73
+ "code-structure": [
74
+ "tangerine-next"
75
+ ],
76
+ "import-structure": [
77
+ "atlassian-conventions"
78
+ ],
79
+ "circular-dependencies": [
80
+ "file-and-folder-level"
81
+ ]
82
+ },
83
+ "@repo/internal": {
84
+ "dom-events": "use-bind-event-listener",
85
+ "analytics": [
86
+ "analytics-next"
87
+ ],
88
+ "design-tokens": [
89
+ "color"
90
+ ],
91
+ "theming": [
92
+ "react-context"
93
+ ],
94
+ "ui-components": [
95
+ "lite-mode"
96
+ ],
97
+ "deprecation": "no-deprecated-imports",
98
+ "styling": [
99
+ "emotion",
100
+ "emotion"
101
+ ],
102
+ "imports": [
103
+ "import-no-extraneous-disable-for-examples-and-docs"
104
+ ]
105
+ }
106
+ },
107
+ "techstackIgnore": {
108
+ "stricter": [
109
+ "@atlassian/tangerine/project-structure"
110
+ ]
111
+ },
112
+ "platform-feature-flags": {
113
+ "platform.editor.media.extended-resize-experience": {
114
+ "type": "boolean"
115
+ },
116
+ "platform.editor.allow-extended-panel": {
117
+ "type": "boolean"
118
+ },
119
+ "platform.editor.allow-action-in-list": {
120
+ "type": "boolean"
121
+ },
122
+ "platform.editor.media.fix-copy-paste-excel_62g4s": {
123
+ "type": "boolean"
124
+ },
125
+ "platform.editor.handle-paste-for-action-in-panel": {
126
+ "type": "boolean"
127
+ },
128
+ "platform.editor.place-cursor-inside-text-block": {
129
+ "type": "boolean"
130
+ },
131
+ "platform.editor.multi-bodied-extension_0rygg": {
132
+ "type": "boolean"
133
+ },
134
+ "platform.editor.table.copy-paste-in-bodied-extension": {
135
+ "type": "boolean"
136
+ },
137
+ "platform.editor.paste-markdown-table-in-a-table": {
138
+ "type": "boolean"
139
+ },
140
+ "platform.editor.extractlistfromparagraphv2": {
141
+ "type": "boolean"
142
+ },
143
+ "platform.editor.preserve-whitespace-clipboard-text-serialization": {
144
+ "type": "boolean"
145
+ }
146
+ }
147
+ }