@atlaskit/editor-plugin-media-insert 2.6.1 → 2.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/editor-plugin-media-insert
2
2
 
3
+ ## 2.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#141109](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/141109)
8
+ [`cba4ebf07d83b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/cba4ebf07d83b) -
9
+ [ux] [ED-24926] When clicking on media insert from element browser, correctly position the media
10
+ insert popup and scroll into view
11
+
12
+ ## 2.6.2
13
+
14
+ ### Patch Changes
15
+
16
+ - [#140631](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/140631)
17
+ [`deed1759cb1d3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/deed1759cb1d3) -
18
+ Remove passing url to alt for external images
19
+
3
20
  ## 2.6.1
4
21
 
5
22
  ### Patch Changes
@@ -213,7 +213,7 @@ function MediaFromURL(_ref) {
213
213
  if (previewState.warning) {
214
214
  insertExternalMediaSingle({
215
215
  url: url,
216
- alt: url,
216
+ alt: '',
217
217
  inputMethod: _analytics.INPUT_METHOD.MEDIA_PICKER
218
218
  });
219
219
  }
@@ -29,6 +29,13 @@ var getDomRefFromSelection = function getDomRefFromSelection(view, dispatchAnaly
29
29
  try {
30
30
  var domRef = (0, _utils.findDomRefAtPos)(view.state.selection.from, view.domAtPos.bind(view));
31
31
  if (domRef instanceof HTMLElement) {
32
+ // If element is not a paragraph, we need to find the closest paragraph parent
33
+ if (domRef.nodeName !== 'P') {
34
+ var paragraphRef = domRef.closest('p');
35
+ if (paragraphRef) {
36
+ return paragraphRef;
37
+ }
38
+ }
32
39
  return domRef;
33
40
  } else {
34
41
  throw new Error('Invalid DOM reference');
@@ -181,7 +181,7 @@ export function MediaFromURL({
181
181
  if (previewState.warning) {
182
182
  insertExternalMediaSingle({
183
183
  url,
184
- alt: url,
184
+ alt: '',
185
185
  inputMethod: INPUT_METHOD.MEDIA_PICKER
186
186
  });
187
187
  }
@@ -19,6 +19,13 @@ const getDomRefFromSelection = (view, dispatchAnalyticsEvent) => {
19
19
  try {
20
20
  const domRef = findDomRefAtPos(view.state.selection.from, view.domAtPos.bind(view));
21
21
  if (domRef instanceof HTMLElement) {
22
+ // If element is not a paragraph, we need to find the closest paragraph parent
23
+ if (domRef.nodeName !== 'P') {
24
+ const paragraphRef = domRef.closest('p');
25
+ if (paragraphRef) {
26
+ return paragraphRef;
27
+ }
28
+ }
22
29
  return domRef;
23
30
  } else {
24
31
  throw new Error('Invalid DOM reference');
@@ -206,7 +206,7 @@ export function MediaFromURL(_ref) {
206
206
  if (previewState.warning) {
207
207
  insertExternalMediaSingle({
208
208
  url: url,
209
- alt: url,
209
+ alt: '',
210
210
  inputMethod: INPUT_METHOD.MEDIA_PICKER
211
211
  });
212
212
  }
@@ -19,6 +19,13 @@ var getDomRefFromSelection = function getDomRefFromSelection(view, dispatchAnaly
19
19
  try {
20
20
  var domRef = findDomRefAtPos(view.state.selection.from, view.domAtPos.bind(view));
21
21
  if (domRef instanceof HTMLElement) {
22
+ // If element is not a paragraph, we need to find the closest paragraph parent
23
+ if (domRef.nodeName !== 'P') {
24
+ var paragraphRef = domRef.closest('p');
25
+ if (paragraphRef) {
26
+ return paragraphRef;
27
+ }
28
+ }
22
29
  return domRef;
23
30
  } else {
24
31
  throw new Error('Invalid DOM reference');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-media-insert",
3
- "version": "2.6.1",
3
+ "version": "2.7.0",
4
4
  "description": "Media Insert plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -29,7 +29,7 @@
29
29
  "@atlaskit/editor-plugin-media": "^1.31.0",
30
30
  "@atlaskit/editor-prosemirror": "6.0.0",
31
31
  "@atlaskit/editor-shared-styles": "^2.13.0",
32
- "@atlaskit/icon": "^22.17.0",
32
+ "@atlaskit/icon": "^22.18.0",
33
33
  "@atlaskit/media-card": "^78.3.0",
34
34
  "@atlaskit/media-client": "^28.0.0",
35
35
  "@atlaskit/media-client-react": "^2.2.0",
@@ -43,7 +43,7 @@
43
43
  "react-intl-next": "npm:react-intl@^5.18.1"
44
44
  },
45
45
  "peerDependencies": {
46
- "@atlaskit/tokens": "^1.59.0"
46
+ "@atlaskit/tokens": "^1.60.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "typescript": "~5.4.2"