Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@editorjs/attaches",
"version": "1.3.2",
"version": "1.3.3",
"keywords": [
"codex editor",
"attaches",
Expand Down
6 changes: 6 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.cdx-attaches {
--color-line: #EFF0F1;
--color-line--hover: #e7e8e9;
--color-bg: #fff;
--color-bg-secondary: #F8F8F8;
--color-bg-secondary--hover: #f2f2f2;
Expand All @@ -12,6 +13,11 @@
border: 1px solid var(--color-line);
border-radius: 7px;
background: var(--color-bg);
text-decoration: none !important;
Copy link
Contributor Author

@bettysteger bettysteger Oct 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need the !important because .ce-block a has text-decoration style


&[href]:hover, &[href]:focus {
--color-line: var(--color-line--hover);
}

^&__file-info {
display: grid;
Expand Down
6 changes: 4 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,9 @@ export default class AttachesTool {
render() {
const holder = make('div', this.CSS.baseClass);

this.nodes.wrapper = make('div', this.CSS.wrapper);
// Make the whole box clickable in read-only mode
this.nodes.wrapper = make(this.readOnly ? 'a' : 'div', this.CSS.wrapper,
this.readOnly ? { href: this.data.file.url, target: '_blank' } : {});

if (this.pluginHasData()) {
this.showFileData();
Expand Down Expand Up @@ -437,7 +439,7 @@ export default class AttachesTool {
this.nodes.wrapper.appendChild(fileInfo);

if (file.url !== undefined) {
const downloadIcon = make('a', this.CSS.downloadButton, {
const downloadIcon = make(this.readOnly ? 'span' : 'a', this.CSS.downloadButton, {
innerHTML: IconChevronDown,
href: file.url,
target: '_blank',
Expand Down