forked from laysense/laysense.cn
Manage dynamic blocks and expand the editor library
This commit is contained in:
@@ -13,6 +13,7 @@ $modules = $kind === 'modules';
|
||||
</button></li>
|
||||
<?php endforeach ?>
|
||||
</ul>
|
||||
<?php if ($modules): ?><?= $anchorForm ?><?php endif ?>
|
||||
<div class="studio-library-content" data-library-content hidden>
|
||||
<div class="studio-library-category-title">
|
||||
<button type="button" data-library-back>返回分类</button>
|
||||
@@ -26,7 +27,7 @@ $modules = $kind === 'modules';
|
||||
<?php foreach ($groups as $group => [$category, $items]): ?>
|
||||
<div class="<?= $modules ? 'studio-template-cards' : 'studio-element-items' ?>" data-template-group="<?= $e($group) ?>" hidden>
|
||||
<?php foreach ($items as $key => $item): ?>
|
||||
<?php [$label, $markup, $mime] = array_pad($item, 3, ''); ?>
|
||||
<?php [$label, $markup, $option, $feed] = array_pad($item, 4, null); ?>
|
||||
<?php if ($modules): ?>
|
||||
<article class="studio-template-card" data-template-card data-library-item data-template-search-text="<?= $e($label . ' ' . $key) ?>">
|
||||
<button type="button" class="studio-template-image" data-template-preview="<?= $e($key) ?>" data-template-title="<?= $e($label) ?>"
|
||||
@@ -36,14 +37,15 @@ $modules = $kind === 'modules';
|
||||
<div class="studio-template-meta">
|
||||
<span><?= $e($label) ?></span>
|
||||
<button type="button" class="button button-outline" disabled data-canvas-template="<?= $e($key) ?>"
|
||||
data-template-title="<?= $e($label) ?>" aria-label="添加<?= $e($label) ?>组件">添加</button>
|
||||
data-template-title="<?= $e($label) ?>" data-template-lead="<?= $e($option) ?>" data-template-style="<?= $e($item[4] ?? 'plain') ?>"
|
||||
<?= $feed !== null ? 'data-template-feed="' . $e($feed) . '"' : '' ?> aria-label="添加<?= $e($label) ?>组件">添加</button>
|
||||
</div>
|
||||
<template data-preset="<?= $e($key) ?>"><?= $markup ?></template>
|
||||
</article>
|
||||
<?php else: ?>
|
||||
<div data-library-item data-template-search-text="<?= $e($label . ' ' . $key) ?>">
|
||||
<button type="button" disabled data-canvas-element="<?= $e($key) ?>"
|
||||
<?php if ($mime): ?>data-element-mime="<?= $e($mime) ?>"<?php endif ?>
|
||||
<?php if ($option): ?>data-element-mime="<?= $e($option) ?>"<?php endif ?>
|
||||
aria-label="插入<?= $e($label) ?>"><?= $e($label) ?></button>
|
||||
<template data-element="<?= $e($key) ?>"><?= $markup ?></template>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user