Skip to content

Commit

Permalink
build(release): merge branch develop (release 1.9.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcantondahmen committed Oct 13, 2021
2 parents 8bbc8f2 + e434131 commit dff5972
Show file tree
Hide file tree
Showing 263 changed files with 11,632 additions and 6,035 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ lib/vendor/michelf/php-markdown/.gitignore
lib/vendor/michelf/php-markdown/.scrutinizer.yml
lib/vendor/michelf/php-markdown/.travis.yml
lib/vendor/michelf/php-markdown/phpunit.xml.dist
phpunit-*.phar
phpunit-*.phar
.phpunit.result.cache
17 changes: 9 additions & 8 deletions automad/blocks/less/stretched.less
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@
* Licensed under the MIT license.
*/


am-stretched {

display: block;
padding: 0;
margin-left: ~"calc(var(--am-container-padding) * -1)" !important;
margin-right: ~"calc(var(--am-container-padding) * -1)" !important;
margin-left: ~'calc(var(--am-container-padding) * -1)' !important;
margin-right: ~'calc(var(--am-container-padding) * -1)' !important;

* + & {
margin-top: var(--am-block-margin-top);
Expand All @@ -49,21 +47,24 @@ am-stretched {
}

& > .am-block {

max-width: none;

& > * > figcaption {
padding: 0.75em var(--am-container-padding);
}

}

& > am-table,
& > am-pagelist {
padding: 0 var(--am-container-padding);
}

& + & > am-table,
& + & > am-pagelist {
padding-top: var(--am-block-margin-top);
}

& img {
min-width: 100%;
}

}
}
799 changes: 400 additions & 399 deletions automad/dist/automad.min.css

Large diffs are not rendered by default.

327 changes: 143 additions & 184 deletions automad/dist/automad.min.js

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions automad/dist/blocks.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion automad/dist/blocks.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 8 additions & 2 deletions automad/dist/libs.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions automad/gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,9 @@ gulp.task('libs-js', function () {
gulp.src([
'node_modules/@editorjs/editorjs/dist/editor.js.LICENSE.txt',
'node_modules/@editorjs/editorjs/dist/editor.js',
'node_modules/@editorjs/nested-list/dist/nested-list.js',
'node_modules/@editorjs/quote/dist/bundle.js',
'node_modules/@editorjs/table/dist/table.js',
'node_modules/editorjs-drag-drop/dist/bundle.js',
'node_modules/editorjs-style/dist/index.js',
]),
Expand Down
35 changes: 30 additions & 5 deletions automad/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions automad/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{
"name": "automad",
"version": "1.8.7",
"version": "1.9.0",
"description": "Automad",
"author": "Marc Anton Dahmen",
"license": "MIT",
"private": true,
"devDependencies": {
"@editorjs/editorjs": "^2.20.2",
"@editorjs/editorjs": "^2.22.2",
"@editorjs/nested-list": "^1.0.2",
"@editorjs/quote": "^2.4.0",
"@editorjs/table": "^2.0.1",
"blueimp-file-upload": "^9.21.0",
"codemirror": "^5.35.0",
"draggabilly": "^2.1.1",
Expand Down
2 changes: 1 addition & 1 deletion automad/src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class App {
/**
* Required PHP version.
*/
private $requiredVersion = '7.2.0';
private $requiredVersion = '7.4.0';

/**
* The main app constructor takes care of running all required startup tests,
Expand Down
16 changes: 8 additions & 8 deletions automad/src/Blocks/Buttons.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ public static function render(object $data, Automad $Automad) {
}

$html .= <<< HTML
<a
href="$link"
class="am-button{$class}"
$style
>
$text
</a>
HTML;
<a
href="$link"
class="am-button{$class}"
$style
>
$text
</a>
HTML;
}
}

Expand Down
50 changes: 26 additions & 24 deletions automad/src/Blocks/Embed.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,42 +58,44 @@ class Embed extends AbstractBlock {
*/
public static function render(object $data, Automad $Automad) {
$attr = <<< HTML
scrolling="no"
frameborder="no"
allowtransparency="true"
allowfullscreen="true"
HTML;
scrolling="no"
frameborder="no"
allowtransparency="true"
allowfullscreen="true"
HTML;

if ($data->service == 'twitter') {
$url = Str::stripStart($data->embed, 'https://twitframe.com/show?url=');

$html = <<< HTML
<blockquote class="twitter-tweet tw-align-center" style="visibility: hidden;">
<a href="$url"></a>
</blockquote>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
HTML;
<blockquote class="twitter-tweet tw-align-center" style="visibility: hidden;">
<a href="$url"></a>
</blockquote>
<script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script>
HTML;
} elseif (!empty($data->width)) {
$paddingTop = $data->height / $data->width * 100;

$html = <<< HTML
<div style="position: relative; padding-top: $paddingTop%;">
<iframe
src="$data->embed"
$attr
style="position: absolute; top: 0; width: 100%; height: 100%;"
>
</iframe>
</div>
HTML;
} else {
$html = <<< HTML
<div style="position: relative; padding-top: $paddingTop%;">
<iframe
src="$data->embed"
height="$data->height"
$attr
style="width: 100%;"
style="position: absolute; top: 0; width: 100%; height: 100%;"
>
</iframe>
HTML;
</div>
HTML;
} else {
$html = <<< HTML
<iframe
src="$data->embed"
height="$data->height"
$attr
style="width: 100%;"
>
</iframe>
HTML;
}

if (!empty($data->caption)) {
Expand Down
38 changes: 19 additions & 19 deletions automad/src/Blocks/Gallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,16 @@ private static function flexbox($files, $data) {
$width = round($Image->width / 2);

$html .= <<< HTML
<a
href="$file"
class="am-gallery-flex-item am-gallery-img-small"
style="width: {$width}px"
data-caption="$caption"
data-am-block-lightbox
>
<img src="$Image->file" />
</a>
HTML;
<a
href="$file"
class="am-gallery-flex-item am-gallery-img-small"
style="width: {$width}px"
data-caption="$caption"
data-am-block-lightbox
>
<img src="$Image->file" />
</a>
HTML;
}

$html .= '</div>';
Expand Down Expand Up @@ -165,15 +165,15 @@ private static function masonry($files, $data) {
$span = round($Image->height / ($masonryRowHeight * 2));

$html .= <<< HTML
<div
class="am-gallery-masonry-item"
style="--am-gallery-masonry-rows: $span;"
>
<a href="$file" class="am-gallery-img-small" data-caption="$caption" data-am-block-lightbox>
<img src="$Image->file" />
</a>
</div>
HTML;
<div
class="am-gallery-masonry-item"
style="--am-gallery-masonry-rows: $span;"
>
<a href="$file" class="am-gallery-img-small" data-caption="$caption" data-am-block-lightbox>
<img src="$Image->file" />
</a>
</div>
HTML;
}

$html .= '</div>';
Expand Down
14 changes: 7 additions & 7 deletions automad/src/Blocks/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ public static function render(object $data, Automad $Automad) {
}

return <<< HTML
<am-img $class>
<figure>
$img
$caption
</figure>
</am-img>
HTML;
<am-img $class>
<figure>
$img
$caption
</figure>
</am-img>
HTML;
}
}
39 changes: 28 additions & 11 deletions automad/src/Blocks/Lists.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@
* @license MIT license - https://automad.org/license
*/
class Lists extends AbstractBlock {
/**
* The list type tag
*/
private static $tag;

/**
* Render a list block.
*
Expand All @@ -57,23 +62,35 @@ class Lists extends AbstractBlock {
*/
public static function render(object $data, Automad $Automad) {
if ($data->style == 'ordered') {
$open = '<ol>';
$close = '</ol>';
self::$tag = 'ol';
} else {
$open = '<ul>';
$close = '</ul>';
self::$tag = 'ul';
}

$html = $open;
$html = self::renderItems((array) $data->items);
$class = self::classAttr();

return "<am-list $class>$html</am-list>";
}

foreach ($data->items as $item) {
$item = htmlspecialchars_decode($item);
$html .= "<li>$item</li>";
/**
* Render list items.
*
* @param array $items
* @return string the rendered item
*/
private static function renderItems(array $items) {
$tag = self::$tag;
$html = "<$tag>";

foreach ($items as $item) {
$content = htmlspecialchars_decode($item->content);
$children = self::renderItems((array) $item->items);
$html .= "<li><span>$content</span>$children</li>";
}

$html .= $close;
$class = self::classAttr();
$html .= "</$tag>";

return "<am-list $class>$html</am-list>";
return $html;
}
}
Loading

0 comments on commit dff5972

Please sign in to comment.