Skip to content

Commit

Permalink
Release: Version 1.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
mediakreativ committed Dec 22, 2024
1 parent 9d0ead1 commit d9cf5b8
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 17 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [1.2.5] - 2024-12-22
### Fixed
- Correct extraction of Matrix field handles for nested Matrix fields.
- Ensured proper handling of `fields-` prefix removal.

## [1.2.4] - 2024-12-20

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "mediakreativ/craft-blocksmith",
"description": "Enhances Craft's Matrix fields with block previews and a user-friendly block selection modal.",
"type": "craft-plugin",
"version": "1.2.4",
"version": "1.2.5",
"keywords": [
"craftcms",
"craft",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"prettier": "^3.3.3"
},
"name": "craft-blocksmith",
"version": "1.2.4",
"version": "1.2.5",
"description": "Enhances Craft's Matrix fields with block previews and a user-friendly block selection modal.",
"author": {
"name": "Christian Schindler",
Expand Down
27 changes: 15 additions & 12 deletions src/assets/css/blocksmith.css
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,19 @@

.blocksmith-block-image {
flex-shrink: 0;
width: 220px; /* Einheitliche Breite */
height: 165px; /* Einheitliche Höhe */
aspect-ratio: auto; /* Optional für Browser-Kompatibilität */
width: 220px;
height: 165px;
aspect-ratio: auto;
margin-right: 16px;
border: 1px solid #e0e0e0;
border-radius: 4px;
overflow: hidden; /* Zusätzlicher Schutz vor Überlauf */
overflow: hidden;
}

.blocksmith-block-image img {
width: 100%;
height: 100%;
object-fit: contain; /* Alternativ: cover, je nach gewünschtem Effekt */
object-fit: contain;
background: #f7f7f7;
}

Expand Down Expand Up @@ -200,7 +200,7 @@
}

@media only screen and (min-width: 800px) {
.blocksmith-wide-view .blocksmith-block{
.blocksmith-wide-view .blocksmith-block {
width: 32%;
}
}
Expand Down Expand Up @@ -434,11 +434,11 @@ body .blocksmith-modal {
margin-top: 20px;
}

.blocksmith-block-gutter{
.blocksmith-block-gutter {
width: 2%;
}

.blocksmith-block.blocksmith-block-hidden{
.blocksmith-block.blocksmith-block-hidden {
opacity: 0 !important;
height: 0 !important; /* Override Masonry's height */
margin: 0 !important;
Expand All @@ -452,7 +452,7 @@ body .blocksmith-modal {
width: 49%;
}

.blocksmith-block-inner{
.blocksmith-block-inner {
background: #f9f9f9;
border: 1px solid #ddd;
border-radius: 5px;
Expand Down Expand Up @@ -506,13 +506,16 @@ body .blocksmith-modal {
display: none !important;
}

.matrix-extended-buttons-above.matrix-extended-buttons, .matrix-extended-buttons.blocksmith-preview-disabled {
.matrix-extended-buttons-above.matrix-extended-buttons,
.matrix-extended-buttons.blocksmith-preview-disabled {
display: flex !important;
}

ul.matrix-extended > li > button[data-action="add-block"] {
display: none !important;
}
ul.matrix-extended.blocksmith-preview-disabled > li > button[data-action="add-block"] {
ul.matrix-extended.blocksmith-preview-disabled
> li
> button[data-action="add-block"] {
display: flex !important;
}
}
3 changes: 0 additions & 3 deletions src/assets/js/blocksmith.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,14 +91,11 @@
Craft.MatrixInput.prototype.updateAddEntryBtn = function (...args) {
originalUpdateAddEntryBtn.apply(this, args);
const matrixContainer = this.$container.closest(".matrix-field");
console.log("matrixContainer: ", matrixContainer);
const matrixFieldId = matrixContainer.attr("id");
console.log("matrixFieldId: ", matrixFieldId);
const matrixFieldHandle = matrixFieldId
?.replace(/^fields-/, "")
.split("-fields-")
.pop();
console.log("matrixFieldHandle: ", matrixFieldHandle);

// Skip modification if preview is disabled for this field
if (
Expand Down

0 comments on commit d9cf5b8

Please sign in to comment.