Skip to content

Commit

Permalink
Merge pull request #58 from bumpcore/47-2x-fakeable-contract
Browse files Browse the repository at this point in the history
`Fakeable` contract.
  • Loading branch information
megasteve19 authored Jan 27, 2024
2 parents 17023d0 + 13658ee commit 5b1f120
Show file tree
Hide file tree
Showing 46 changed files with 186 additions and 149 deletions.
30 changes: 15 additions & 15 deletions config/editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

return [
'blocks' => [
'attaches' => \BumpCore\EditorPhp\Blocks\Attaches::class,
'checklist' => \BumpCore\EditorPhp\Blocks\Checklist::class,
'code' => \BumpCore\EditorPhp\Blocks\Code::class,
'delimiter' => \BumpCore\EditorPhp\Blocks\Delimiter::class,
'embed' => \BumpCore\EditorPhp\Blocks\Embed::class,
'header' => \BumpCore\EditorPhp\Blocks\Header::class,
'image' => \BumpCore\EditorPhp\Blocks\Image::class,
'linkTool' => \BumpCore\EditorPhp\Blocks\LinkTool::class,
'list' => \BumpCore\EditorPhp\Blocks\ListBlock::class,
'paragraph' => \BumpCore\EditorPhp\Blocks\Paragraph::class,
'personality' => \BumpCore\EditorPhp\Blocks\Personality::class,
'quote' => \BumpCore\EditorPhp\Blocks\Quote::class,
'raw' => \BumpCore\EditorPhp\Blocks\Raw::class,
'table' => \BumpCore\EditorPhp\Blocks\Table::class,
'warning' => \BumpCore\EditorPhp\Blocks\Warning::class,
'attaches' => BumpCore\EditorPhp\Blocks\Attaches::class,
'checklist' => BumpCore\EditorPhp\Blocks\Checklist::class,
'code' => BumpCore\EditorPhp\Blocks\Code::class,
'delimiter' => BumpCore\EditorPhp\Blocks\Delimiter::class,
'embed' => BumpCore\EditorPhp\Blocks\Embed::class,
'header' => BumpCore\EditorPhp\Blocks\Header::class,
'image' => BumpCore\EditorPhp\Blocks\Image::class,
'linkTool' => BumpCore\EditorPhp\Blocks\LinkTool::class,
'list' => BumpCore\EditorPhp\Blocks\ListBlock::class,
'paragraph' => BumpCore\EditorPhp\Blocks\Paragraph::class,
'personality' => BumpCore\EditorPhp\Blocks\Personality::class,
'quote' => BumpCore\EditorPhp\Blocks\Quote::class,
'raw' => BumpCore\EditorPhp\Blocks\Raw::class,
'table' => BumpCore\EditorPhp\Blocks\Table::class,
'warning' => BumpCore\EditorPhp\Blocks\Warning::class,
],
];
8 changes: 4 additions & 4 deletions resources/php/bootstrap-five/attaches.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<div class="rounded d-flex gap-3 mb-3">
<div class="bg-light text-uppercase fs-5 fw-bold p-4 rounded"><?php echo $data('file.extension'); ?></div>
<div class="bg-light text-uppercase fs-5 fw-bold p-4 rounded"><?= $data('file.extension'); ?></div>
<div>
<p class="text-lg fw-bold mb-0">
<a
class="link-dark gap-1 d-inline-flex justify-content-center align-items-center"
href="<?php echo $data('file.url'); ?>"
href="<?= $data('file.url'); ?>"
target="_blank"
>
<span><?php echo $data('title') ?? $data('file.name'); ?></span>
<span><?= $data('title') ?? $data('file.name'); ?></span>
<svg
class="inline"
fill="currentColor"
Expand All @@ -27,6 +27,6 @@ class="inline"
</svg>
</a>
</p>
<p class="fw-semibold text-secondary"><small><?php echo number_format($data('file.size') * 0.000001, 2); ?>MiB</small></p>
<p class="fw-semibold text-secondary"><small><?= number_format($data('file.size') * 0.000001, 2); ?>MiB</small></p>
</div>
</div>
6 changes: 3 additions & 3 deletions resources/php/bootstrap-five/checklist.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class="d-flex flex-column align-items-start pl-8 gap-1 mb-3"
>
<?php foreach($data('items', []) as $item): ?>
<li class="inline-flex justify-center align-items-center gap-2">
<span class="bg-light rounded-circle <?php echo $item['checked'] ? 'text-secondary' : 'text-black'; ?>">
<span class="bg-light rounded-circle <?= $item['checked'] ? 'text-secondary' : 'text-black'; ?>">
<svg
fill="currentColor"
height="24"
Expand All @@ -19,9 +19,9 @@ class="d-flex flex-column align-items-start pl-8 gap-1 mb-3"
</span>

<?php if($item['checked']): ?>
<del><?php echo $item['text']; ?></del>
<del><?= $item['text']; ?></del>
<?php else: ?>
<span><?php echo $item['text']; ?></span>
<span><?= $item['text']; ?></span>
<?php endif; ?>
</li>
<?php endforeach; ?>
Expand Down
2 changes: 1 addition & 1 deletion resources/php/bootstrap-five/code.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="p-4 bg-light rounded mb-3">
<div class="overflow-x-auto w-full bg-white rounded p-3">
<pre><?php echo $data('code'); ?></pre>
<pre><?= $data('code'); ?></pre>
</div>
</div>
10 changes: 5 additions & 5 deletions resources/php/bootstrap-five/embed.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<div class="mb-3 bg-light p-4 rounded">
<iframe
class="block mb-3 rounded bg-white"
height="<?php echo $data('height'); ?>"
height="<?= $data('height'); ?>"
loading="lazy"
src="<?php echo $data('embed'); ?>"
src="<?= $data('embed'); ?>"
width="100%"
></iframe>

<p class="bg-white p-4 rounded mb-1">
<?php echo $data('caption'); ?>
<?= $data('caption'); ?>

</p>

<p>
<small>
<a
class="link-secondary"
href="<?php echo $data('source'); ?>"
href="<?= $data('source'); ?>"
target="_blank"
><?php echo $data('source'); ?></a>
><?= $data('source'); ?></a>
</small>
</p>

Expand Down
12 changes: 6 additions & 6 deletions resources/php/bootstrap-five/header.php
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<?php switch($data('level')):
case (1): ?>
<h1 class="fw-bold mb-3"><?php echo $data('text'); ?></h1>
<h1 class="fw-bold mb-3"><?= $data('text'); ?></h1>
<?php break; ?>

<?php case (2): ?>
<h2 class="fw-bold mb-3"><?php echo $data('text'); ?></h2>
<h2 class="fw-bold mb-3"><?= $data('text'); ?></h2>
<?php break; ?>

<?php case (3): ?>
<h3 class="fw-bold mb-3"><?php echo $data('text'); ?></h3>
<h3 class="fw-bold mb-3"><?= $data('text'); ?></h3>
<?php break; ?>

<?php case (4): ?>
<h4 class="fw-semibold mb-3"><?php echo $data('text'); ?></h4>
<h4 class="fw-semibold mb-3"><?= $data('text'); ?></h4>
<?php break; ?>

<?php case (5): ?>
<h5 class="fw-semibold mb-3"><?php echo $data('text'); ?></h5>
<h5 class="fw-semibold mb-3"><?= $data('text'); ?></h5>
<?php break; ?>

<?php case (6): ?>
<h6 class="fw-semibold mb-1"><?php echo $data('text'); ?></h6>
<h6 class="fw-semibold mb-1"><?= $data('text'); ?></h6>
<?php break; ?>
<?php endswitch; ?>
4 changes: 2 additions & 2 deletions resources/php/bootstrap-five/image.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<img
alt="<?php echo $data('caption'); ?>"
src="<?php echo $data('file.url'); ?>"
alt="<?= $data('caption'); ?>"
src="<?= $data('file.url'); ?>"
class="d-block mb-3 w-100 rounded"
>
12 changes: 6 additions & 6 deletions resources/php/bootstrap-five/linktool.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<div class="bg-light d-flex mb-3 rounded overflow-hidden flex-column flex-sm-row">
<img
alt="<?php echo $data('meta.title'); ?>"
alt="<?= $data('meta.title'); ?>"
width="100%"
src="<?php echo $data('meta.image.url'); ?>"
src="<?= $data('meta.image.url'); ?>"
style="object-fit: cover"
>
<div class="m-4 p-4 bg-white rounded flex-2">
<h4 class="text-xl fw-semibold"><?php echo $data('meta.title'); ?></h4>
<h4 class="text-xl fw-semibold"><?= $data('meta.title'); ?></h4>
<p class="mb-3 text-sm">
<small>
<a
class="link-dark fw-bold"
href="<?php echo $data('link'); ?>"
href="<?= $data('link'); ?>"
target="_blank"
><?php echo $data('link'); ?></a>
><?= $data('link'); ?></a>
</small>
</p>
<p class="mb-0"><?php echo $data('meta.description'); ?></p>
<p class="mb-0"><?= $data('meta.description'); ?></p>
</div>
</div>
4 changes: 2 additions & 2 deletions resources/php/bootstrap-five/list.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php if($data('style') === 'ordered'): ?>
<ol class="mb-3">
<?php foreach($data('items', []) as $item): ?>
<li class="mb-1"><?php echo $item; ?></li>
<li class="mb-1"><?= $item; ?></li>
<?php endforeach; ?>
</ol>
<?php else: ?>
<ul class="mb-3">
<?php foreach($data('items', []) as $item): ?>
<li class="mb-1"><?php echo $item; ?></li>
<li class="mb-1"><?= $item; ?></li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
2 changes: 1 addition & 1 deletion resources/php/bootstrap-five/paragraph.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<p class="mb-3"><?php echo $data('text'); ?></p>
<p class="mb-3"><?= $data('text'); ?></p>
12 changes: 6 additions & 6 deletions resources/php/bootstrap-five/personality.php
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<div class="bg-light d-flex mb-3 rounded overflow-hidden flex-column flex-sm-row">
<img
alt="<?php echo $data('name'); ?>"
src="<?php echo $data('photo'); ?>"
alt="<?= $data('name'); ?>"
src="<?= $data('photo'); ?>"
style="object-fit: cover"
width="100%"
>
<div class="m-4 p-4 bg-white rounded flex-2">
<h4 class="text-xl fw-semibold"><?php echo $data('name'); ?></h4>
<h4 class="text-xl fw-semibold"><?= $data('name'); ?></h4>
<p class="mb-3 text-sm">
<small>
<a
class="link-dark fw-bold"
href="<?php echo $data('link'); ?>"
href="<?= $data('link'); ?>"
target="_blank"
><?php echo $data('link'); ?></a>
><?= $data('link'); ?></a>
</small>
</p>
<p class="mb-0"><?php echo $data('description'); ?></p>
<p class="mb-0"><?= $data('description'); ?></p>
</div>
</div>
4 changes: 2 additions & 2 deletions resources/php/bootstrap-five/quote.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
</svg>
</div>
<div class="z-1 position-relative">
<p class="fs-4 fw-semibold mb-0"><?php echo $data('text'); ?></p>
<small class="d-block text-end"><?php echo $data('caption'); ?></small>
<p class="fs-4 fw-semibold mb-0"><?= $data('text'); ?></p>
<small class="d-block text-end"><?= $data('caption'); ?></small>
</div>
</blockquote>
4 changes: 2 additions & 2 deletions resources/php/bootstrap-five/table.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<thead class=" text-gray-700 text-uppercase bg-light">
<tr>
<?php foreach($headings as $heading): ?>
<th class="px-4 py-3"><?php echo $heading; ?></th>
<th class="px-4 py-3"><?= $heading; ?></th>
<?php endforeach; ?>
</tr>
</thead>
Expand All @@ -18,7 +18,7 @@

<tr class="bg-white">
<?php foreach($row as $cell): ?>
<td class="px-4 py-3 fw-semibold"><?php echo $cell; ?></td>
<td class="px-4 py-3 fw-semibold"><?= $cell; ?></td>
<?php endforeach; ?>
</tr>
<?php endforeach; ?>
Expand Down
4 changes: 2 additions & 2 deletions resources/php/bootstrap-five/warning.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class="d-flex justify-content-center align-items-start align-items-sm-center"
</div>

<div class="flex-grow-1">
<p class="fs-4 fw-semibold mb-0"><?php echo $data('title'); ?></p>
<p><?php echo $data('message'); ?></p>
<p class="fs-4 fw-semibold mb-0"><?= $data('title'); ?></p>
<p><?= $data('message'); ?></p>
</div>
</aside>
8 changes: 4 additions & 4 deletions resources/php/tailwind/attaches.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<div class="rounded-xl flex gap-4 mb-4">
<div class="bg-gray-100 uppercase font-black p-4 rounded-xl"><?php echo $data('file.extension'); ?></div>
<div class="bg-gray-100 uppercase font-black p-4 rounded-xl"><?= $data('file.extension'); ?></div>
<div>
<p class="text-lg font-bold">
<a
class="hover:text-gray-600 gap-1 flex justify-center items-center"
href="<?php echo $data('file.url'); ?>"
href="<?= $data('file.url'); ?>"
target="_blank"
>
<span><?php echo $data('title') ?? $data('file.name'); ?></span>
<span><?= $data('title') ?? $data('file.name'); ?></span>
<svg
class="inline"
fill="currentColor"
Expand All @@ -27,6 +27,6 @@ class="inline"
</svg>
</a>
</p>
<p class="text-xs font-semibold text-gray-600"><?php echo number_format($data('file.size') * 0.000001, 2); ?>MiB</p>
<p class="text-xs font-semibold text-gray-600"><?= number_format($data('file.size') * 0.000001, 2); ?>MiB</p>
</div>
</div>
6 changes: 3 additions & 3 deletions resources/php/tailwind/checklist.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ul class="flex flex-col items-start pl-8 gap-1 mb-4">
<?php foreach($data('items', []) as $item): ?>
<li class="inline-flex justify-center items-center gap-2">
<span class="bg-gray-100 rounded-full <?php echo $item['checked'] ? 'text-gray-700' : 'text-gray-400'; ?>">
<span class="bg-gray-100 rounded-full <?= $item['checked'] ? 'text-gray-700' : 'text-gray-400'; ?>">
<svg
class="bi bi-check"
fill="currentColor"
Expand All @@ -17,9 +17,9 @@ class="bi bi-check"
</span>

<?php if($item['checked']): ?>
<del><?php echo $item['text']; ?></del>
<del><?= $item['text']; ?></del>
<?php else: ?>
<span><?php echo $item['text']; ?></span>
<span><?= $item['text']; ?></span>
<?php endif; ?>
</li>
<?php endforeach; ?>
Expand Down
2 changes: 1 addition & 1 deletion resources/php/tailwind/code.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="p-4 bg-gray-100 rounded-xl mb-4">
<div class="overflow-x-auto w-full bg-white rounded-xl p-4">
<pre><?php echo $data('code'); ?></pre>
<pre><?= $data('code'); ?></pre>
</div>
</div>
10 changes: 5 additions & 5 deletions resources/php/tailwind/embed.php
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<div class="mb-4 bg-gray-100 p-4 rounded-xl">
<iframe
class="block mb-4 rounded-xl bg-white"
height="<?php echo $data('height'); ?>"
height="<?= $data('height'); ?>"
loading="lazy"
src="<?php echo $data('embed'); ?>"
src="<?= $data('embed'); ?>"
width="100%"
></iframe>

<p class="bg-white p-4 rounded-xl mb-1">
<?php echo $data('caption'); ?>
<?= $data('caption'); ?>

</p>

<p>
<small>
<a
class="text-gray-400 hover:text-gray-700"
href="<?php echo $data('source'); ?>"
href="<?= $data('source'); ?>"
target="_blank"
><?php echo $data('source'); ?></a>
><?= $data('source'); ?></a>
</small>
</p>

Expand Down
12 changes: 6 additions & 6 deletions resources/php/tailwind/header.php
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<?php switch($data('level')):
case (1): ?>
<h1 class="text-5xl font-bold mb-4"><?php echo $data('text'); ?></h1>
<h1 class="text-5xl font-bold mb-4"><?= $data('text'); ?></h1>
<?php break; ?>

<?php case (2): ?>
<h2 class="text-3xl font-bold mb-4"><?php echo $data('text'); ?></h2>
<h2 class="text-3xl font-bold mb-4"><?= $data('text'); ?></h2>
<?php break; ?>

<?php case (3): ?>
<h3 class="text-2xl font-bold mb-2"><?php echo $data('text'); ?></h3>
<h3 class="text-2xl font-bold mb-2"><?= $data('text'); ?></h3>
<?php break; ?>

<?php case (4): ?>
<h4 class="text-xl font-semibold mb-2"><?php echo $data('text'); ?></h4>
<h4 class="text-xl font-semibold mb-2"><?= $data('text'); ?></h4>
<?php break; ?>

<?php case (5): ?>
<h5 class="text-base font-semibold mb-2"><?php echo $data('text'); ?></h5>
<h5 class="text-base font-semibold mb-2"><?= $data('text'); ?></h5>
<?php break; ?>

<?php case (6): ?>
<h6 class="text-sm font-semibold mb-1"><?php echo $data('text'); ?></h6>
<h6 class="text-sm font-semibold mb-1"><?= $data('text'); ?></h6>
<?php break; ?>
<?php endswitch; ?>
4 changes: 2 additions & 2 deletions resources/php/tailwind/image.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<img
alt="<?php echo $data('caption'); ?>"
src="<?php echo $data('file.url'); ?>"
alt="<?= $data('caption'); ?>"
src="<?= $data('file.url'); ?>"
class="block rounded-xl mb-4"
>
Loading

0 comments on commit 5b1f120

Please sign in to comment.