forked from laysense/laysite
Launch LaySite visual editor and MCP workspace
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
use App\Content\View;
|
||||
|
||||
$e = View::escape(...);
|
||||
$modules = $kind === 'modules';
|
||||
?>
|
||||
<section role="tabpanel" id="studio-panel-<?= $kind ?>" aria-labelledby="studio-tab-<?= $kind ?>" data-library-panel="<?= $kind ?>" hidden>
|
||||
<ul class="studio-library-categories" data-library-index>
|
||||
<?php foreach ($groups as $group => [$category, $items]): ?>
|
||||
<li><button type="button" data-library-category="<?= $e($group) ?>" data-library-label="<?= $e($category) ?>">
|
||||
<span><?= $e($category) ?></span><small><?= count($items) ?></small>
|
||||
</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>
|
||||
<h3 data-library-title></h3>
|
||||
</div>
|
||||
<label class="studio-template-search">查找本分类<input type="search" data-template-search autocomplete="off"></label>
|
||||
<?php if ($modules): ?>
|
||||
<label class="studio-insert-mode"><input type="checkbox" data-template-inline> 插入当前正文</label>
|
||||
<?php endif ?>
|
||||
<p class="field-note" data-template-empty hidden role="status">没有匹配的<?= $modules ? '组件' : '元素' ?>。</p>
|
||||
<?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, $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) ?>"
|
||||
aria-label="预览<?= $e($label) ?>组件">
|
||||
<img src="/assets/template-previews/<?= $e($key) ?>.webp" alt="" width="768" height="480" loading="lazy">
|
||||
</button>
|
||||
<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) ?>" 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 ($option): ?>data-element-mime="<?= $e($option) ?>"<?php endif ?>
|
||||
aria-label="插入<?= $e($label) ?>"><?= $e($label) ?></button>
|
||||
<template data-element="<?= $e($key) ?>"><?= $markup ?></template>
|
||||
</div>
|
||||
<?php endif ?>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
<?php endforeach ?>
|
||||
</div>
|
||||
<?php if ($modules): ?>
|
||||
<p class="field-note" data-template-status role="status"></p>
|
||||
<ul class="studio-pending" data-template-pending aria-label="待保存区块" hidden></ul>
|
||||
<?php else: ?>
|
||||
<p class="field-note" data-element-status role="status"></p>
|
||||
<?php endif ?>
|
||||
</section>
|
||||
Reference in New Issue
Block a user