@atlaskit/editor-plugin-block-controls 7.11.4 → 7.12.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 +11 -0
- package/dist/cjs/ui/global-styles.js +12 -14
- package/dist/es2019/ui/global-styles.js +20 -16
- package/dist/esm/ui/global-styles.js +12 -14
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 7.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`ed2e45b56a325`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ed2e45b56a325) -
|
|
8
|
+
ED-29696 fix CSS anchor selector
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
3
14
|
## 7.11.4
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -405,29 +405,27 @@ var blockCardWithoutLayout = (0, _react.css)({
|
|
|
405
405
|
'--ak-editor-block-card-width': 'max(var(--ak-editor--legacy-breakout-wide-layout-width), var(--ak-editor--line-length))'
|
|
406
406
|
}
|
|
407
407
|
});
|
|
408
|
+
var nextAnchorSelector = ['&[data-node-anchor]',
|
|
409
|
+
// adjacent sibling with anchor
|
|
410
|
+
'&:not([data-node-anchor]) [data-node-anchor]',
|
|
411
|
+
// nested anchor inside adjacent sibling
|
|
412
|
+
'&.ProseMirror-widget + [data-node-anchor]',
|
|
413
|
+
// adjacent sibling with anchor (when next to a widget like gap cursor)
|
|
414
|
+
'&.ProseMirror-widget + :not([data-node-anchor]) [data-node-anchor]' // nested anchor inside adjacent sibling (when next to a widget like gap cursor)
|
|
415
|
+
].join(', ');
|
|
408
416
|
var dragHandlerAnchorStyles = (0, _react.css)({
|
|
409
417
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
410
418
|
'.ProseMirror': {
|
|
411
419
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
412
|
-
'[data-testid="block-ctrl-decorator-widget"] + *
|
|
420
|
+
'[data-testid="block-ctrl-decorator-widget"] + *': (0, _defineProperty2.default)({}, "".concat(nextAnchorSelector), {
|
|
413
421
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
414
422
|
anchorName: "var(".concat(_styles.ANCHOR_VARIABLE_NAME, ", attr(data-node-anchor type(<custom-ident>)))")
|
|
415
|
-
},
|
|
416
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
417
|
-
'[data-testid="block-ctrl-quick-insert-button"] + * [data-node-anchor]': {
|
|
418
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
419
|
-
anchorName: "var(".concat(_styles.ANCHOR_VARIABLE_NAME, ", attr(data-node-anchor type(<custom-ident>)))")
|
|
420
|
-
},
|
|
423
|
+
}),
|
|
421
424
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
422
|
-
'[data-testid="block-ctrl-
|
|
425
|
+
'[data-testid="block-ctrl-quick-insert-button"] + *': (0, _defineProperty2.default)({}, "".concat(nextAnchorSelector), {
|
|
423
426
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
424
427
|
anchorName: "var(".concat(_styles.ANCHOR_VARIABLE_NAME, ", attr(data-node-anchor type(<custom-ident>)))")
|
|
425
|
-
}
|
|
426
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
427
|
-
'[data-testid="block-ctrl-quick-insert-button"] + [data-node-anchor]': {
|
|
428
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
429
|
-
anchorName: "var(".concat(_styles.ANCHOR_VARIABLE_NAME, ", attr(data-node-anchor type(<custom-ident>)))")
|
|
430
|
-
}
|
|
428
|
+
})
|
|
431
429
|
}
|
|
432
430
|
});
|
|
433
431
|
|
|
@@ -483,28 +483,32 @@ const blockCardWithoutLayout = css({
|
|
|
483
483
|
'--ak-editor-block-card-width': 'max(var(--ak-editor--legacy-breakout-wide-layout-width), var(--ak-editor--line-length))'
|
|
484
484
|
}
|
|
485
485
|
});
|
|
486
|
+
const nextAnchorSelector = ['&[data-node-anchor]',
|
|
487
|
+
// adjacent sibling with anchor
|
|
488
|
+
'&:not([data-node-anchor]) [data-node-anchor]',
|
|
489
|
+
// nested anchor inside adjacent sibling
|
|
490
|
+
'&.ProseMirror-widget + [data-node-anchor]',
|
|
491
|
+
// adjacent sibling with anchor (when next to a widget like gap cursor)
|
|
492
|
+
'&.ProseMirror-widget + :not([data-node-anchor]) [data-node-anchor]' // nested anchor inside adjacent sibling (when next to a widget like gap cursor)
|
|
493
|
+
].join(', ');
|
|
486
494
|
const dragHandlerAnchorStyles = css({
|
|
487
495
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
488
496
|
'.ProseMirror': {
|
|
489
497
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
490
|
-
'[data-testid="block-ctrl-decorator-widget"] + *
|
|
491
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
497
|
-
anchorName: `var(${ANCHOR_VARIABLE_NAME}, attr(data-node-anchor type(<custom-ident>)))`
|
|
498
|
-
},
|
|
499
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
500
|
-
'[data-testid="block-ctrl-decorator-widget"] + [data-node-anchor]': {
|
|
501
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
502
|
-
anchorName: `var(${ANCHOR_VARIABLE_NAME}, attr(data-node-anchor type(<custom-ident>)))`
|
|
498
|
+
'[data-testid="block-ctrl-decorator-widget"] + *': {
|
|
499
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
500
|
+
[`${nextAnchorSelector}`]: {
|
|
501
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
502
|
+
anchorName: `var(${ANCHOR_VARIABLE_NAME}, attr(data-node-anchor type(<custom-ident>)))`
|
|
503
|
+
}
|
|
503
504
|
},
|
|
504
505
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
505
|
-
'[data-testid="block-ctrl-quick-insert-button"] +
|
|
506
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
507
|
-
|
|
506
|
+
'[data-testid="block-ctrl-quick-insert-button"] + *': {
|
|
507
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
508
|
+
[`${nextAnchorSelector}`]: {
|
|
509
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
510
|
+
anchorName: `var(${ANCHOR_VARIABLE_NAME}, attr(data-node-anchor type(<custom-ident>)))`
|
|
511
|
+
}
|
|
508
512
|
}
|
|
509
513
|
}
|
|
510
514
|
});
|
|
@@ -398,29 +398,27 @@ var blockCardWithoutLayout = css({
|
|
|
398
398
|
'--ak-editor-block-card-width': 'max(var(--ak-editor--legacy-breakout-wide-layout-width), var(--ak-editor--line-length))'
|
|
399
399
|
}
|
|
400
400
|
});
|
|
401
|
+
var nextAnchorSelector = ['&[data-node-anchor]',
|
|
402
|
+
// adjacent sibling with anchor
|
|
403
|
+
'&:not([data-node-anchor]) [data-node-anchor]',
|
|
404
|
+
// nested anchor inside adjacent sibling
|
|
405
|
+
'&.ProseMirror-widget + [data-node-anchor]',
|
|
406
|
+
// adjacent sibling with anchor (when next to a widget like gap cursor)
|
|
407
|
+
'&.ProseMirror-widget + :not([data-node-anchor]) [data-node-anchor]' // nested anchor inside adjacent sibling (when next to a widget like gap cursor)
|
|
408
|
+
].join(', ');
|
|
401
409
|
var dragHandlerAnchorStyles = css({
|
|
402
410
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
403
411
|
'.ProseMirror': {
|
|
404
412
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
405
|
-
'[data-testid="block-ctrl-decorator-widget"] + *
|
|
413
|
+
'[data-testid="block-ctrl-decorator-widget"] + *': _defineProperty({}, "".concat(nextAnchorSelector), {
|
|
406
414
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
407
415
|
anchorName: "var(".concat(ANCHOR_VARIABLE_NAME, ", attr(data-node-anchor type(<custom-ident>)))")
|
|
408
|
-
},
|
|
409
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
410
|
-
'[data-testid="block-ctrl-quick-insert-button"] + * [data-node-anchor]': {
|
|
411
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
412
|
-
anchorName: "var(".concat(ANCHOR_VARIABLE_NAME, ", attr(data-node-anchor type(<custom-ident>)))")
|
|
413
|
-
},
|
|
416
|
+
}),
|
|
414
417
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
415
|
-
'[data-testid="block-ctrl-
|
|
418
|
+
'[data-testid="block-ctrl-quick-insert-button"] + *': _defineProperty({}, "".concat(nextAnchorSelector), {
|
|
416
419
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
417
420
|
anchorName: "var(".concat(ANCHOR_VARIABLE_NAME, ", attr(data-node-anchor type(<custom-ident>)))")
|
|
418
|
-
}
|
|
419
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
420
|
-
'[data-testid="block-ctrl-quick-insert-button"] + [data-node-anchor]': {
|
|
421
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
422
|
-
anchorName: "var(".concat(ANCHOR_VARIABLE_NAME, ", attr(data-node-anchor type(<custom-ident>)))")
|
|
423
|
-
}
|
|
421
|
+
})
|
|
424
422
|
}
|
|
425
423
|
});
|
|
426
424
|
|