Prepare LaySite 1.4.4 editor templates and MCP settings
@@ -41,7 +41,7 @@
|
||||
.login-box p { margin-block: .6rem 1.25rem; }
|
||||
.admin-form { display: grid; gap: 1rem; }
|
||||
.admin-form label { display: grid; gap: .4rem; font-weight: 570; color: var(--ink); }
|
||||
.admin-form :where(input:not([type=hidden], [type=checkbox], [type=radio]), select, textarea) {
|
||||
.admin-form :where(input:not([type=hidden], [type=checkbox], [type=radio], [type=range]), select, textarea) {
|
||||
background: white;
|
||||
color: var(--ink);
|
||||
width: 100%;
|
||||
@@ -109,10 +109,29 @@
|
||||
.studio-canvas-toolbar { margin-bottom: .55rem; }
|
||||
.canvas-format-tools label { display: flex; align-items: center; gap: .3rem; font-size: .875rem; }
|
||||
.canvas-format-tools input { width: 4.3rem; min-height: 2.45rem; padding: .4rem; border: 1px solid var(--line); border-radius: .35rem; }
|
||||
.canvas-font-picker, .canvas-font-combo { display: inline-flex; align-items: center; gap: .3rem; }
|
||||
.canvas-font-combo { gap: 0; }
|
||||
.canvas-font-combo input { border-start-end-radius: 0; border-end-end-radius: 0; }
|
||||
.canvas-font-combo select {
|
||||
appearance: none; text-align: center; width: 2.15rem; min-height: 2.45rem; padding: 0;
|
||||
color: var(--ink); background: var(--white); border: 1px solid var(--line); border-inline-start: 0;
|
||||
border-start-end-radius: .35rem; border-end-end-radius: .35rem; cursor: pointer;
|
||||
}
|
||||
.canvas-font-combo select:disabled { opacity: .5; cursor: default; }
|
||||
.canvas-format-tools [aria-pressed=true] { background: var(--accent-light); color: var(--accent-deep); }
|
||||
.canvas-spacing-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
|
||||
.canvas-spacing-fields input { padding-inline: .4rem; }
|
||||
.canvas-spacing-preset { grid-column: 1 / -1; grid-template-columns: max-content minmax(0, 15rem); align-items: center; }
|
||||
.canvas-spacing-fields input[type=number] { padding-inline: .4rem; }
|
||||
.canvas-spacing-preset {
|
||||
display: grid; grid-column: 1 / -1; gap: .45rem .75rem; align-items: center; margin-block-end: .4rem;
|
||||
grid-template-columns: max-content minmax(0, 1fr) 4.5rem max-content;
|
||||
}
|
||||
.canvas-spacing-preset input { width: 100%; min-width: 0; min-height: 2rem; margin: 0; accent-color: var(--accent); }
|
||||
.canvas-spacing-preset output { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
|
||||
.canvas-spacing-preset .button { min-height: 2.25rem; padding: .2rem .6rem; font-size: .875rem; }
|
||||
@media (max-width: 32rem) {
|
||||
.canvas-spacing-preset { grid-template-columns: minmax(0, 1fr) 4.5rem max-content; }
|
||||
.canvas-spacing-preset label { grid-column: 1 / -1; }
|
||||
}
|
||||
.studio-canvas-toolbar button:disabled { opacity: .5; cursor: default; }
|
||||
.preview-selector { display: flex; gap: .35rem; flex-wrap: wrap; }
|
||||
.preview-selector [aria-pressed="true"] { background: var(--accent-light); color: var(--accent-deep); }
|
||||
|
||||
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 21 KiB |
@@ -413,6 +413,24 @@ progress { width: 100%; height: .8rem; accent-color: var(--accent); }
|
||||
.studio-banner { padding: clamp(1.25rem, 4vw, 3.25rem); border-radius: var(--radius); background: var(--accent-light); }
|
||||
@media (max-width: 44rem) { .studio-split { grid-template-columns: 1fr; } }
|
||||
|
||||
.studio-split:is(.studio-split-balanced, .studio-split-cover, .studio-split-guide, .studio-split-story) {
|
||||
gap: clamp(1rem, 4vw, 3.5rem);
|
||||
}
|
||||
.studio-split-cover {
|
||||
padding: clamp(1rem, 3vw, 2rem); background: var(--paper);
|
||||
border: 1px solid var(--line); border-radius: var(--radius);
|
||||
}
|
||||
.rich .studio-split-cover h3 { font-size: clamp(1.5rem, 3.7vw, 2.6rem); }
|
||||
.studio-split-guide > img { border: 1px solid var(--line); background: var(--paper); }
|
||||
.studio-split-story { padding-block: 1rem; border-block: 1px solid var(--line); }
|
||||
.studio-split-story figure { margin: 0; min-width: 0; }
|
||||
.studio-alternating { display: grid; gap: clamp(1.5rem, 4vw, 3rem); }
|
||||
.studio-comparison > :last-child { border-block-start: 3px solid var(--accent); }
|
||||
@media (min-width: 44.01rem) {
|
||||
.studio-split-media-left { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
|
||||
.studio-split-media-right { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
|
||||
}
|
||||
|
||||
:where(img, video, audio, .hero-visual)[class*="studio-media-"] { max-width: 100%; }
|
||||
:is(.rich, .hero-inner, .editor-preview, .studio-layout-block) [class*="studio-media-"] { width: var(--studio-media-width, auto); }
|
||||
.studio-media-1 { --studio-media-width: 1%; }
|
||||
|
||||
@@ -379,6 +379,7 @@ jQuery(function ($) {
|
||||
const $commands = $toolbar.find('[data-canvas-command]');
|
||||
const $format = $toolbar.find('[data-canvas-format]');
|
||||
const $fontSize = $toolbar.find('[data-canvas-font-size]');
|
||||
const $fontPreset = $toolbar.find('[data-font-preset]');
|
||||
const $color = $toolbar.find('[data-canvas-color]');
|
||||
const $clearColor = $toolbar.find('[data-clear-color]');
|
||||
const $imageDisplay = $toolbar.find('[data-canvas-image-display]');
|
||||
@@ -749,7 +750,7 @@ jQuery(function ($) {
|
||||
|
||||
function syncFormatControls() {
|
||||
const target = doc && formatTarget();
|
||||
$format.add($fontSize).prop('disabled', !target);
|
||||
$format.add($fontSize).add($fontPreset).prop('disabled', !target);
|
||||
const sample = target && (selectedText()[0]?.node || target);
|
||||
const computed = sample ? doc.defaultView.getComputedStyle(sample.nodeType === 1 ? sample : sample.parentElement) : null;
|
||||
if (!$fontSize.is(':focus')) $fontSize.val(computed ? Math.round(parseFloat(computed.fontSize)) : '');
|
||||
@@ -811,8 +812,12 @@ jQuery(function ($) {
|
||||
});
|
||||
$toolbar.on('mousedown', '[data-canvas-format], [data-clear-color]', (event) => event.preventDefault());
|
||||
$format.on('click', function () { applyTextStyle(this.dataset.canvasFormat); });
|
||||
$fontPreset.on('change', function () {
|
||||
applyTextStyle('size', this.value);
|
||||
this.value = '';
|
||||
});
|
||||
$fontSize.on('change', function () {
|
||||
if (this.validity.valid) applyTextStyle('size', this.value);
|
||||
if (this.validity.valid) applyTextStyle('size', this.value === '' ? '' : String(this.valueAsNumber));
|
||||
}).on('keydown', function (event) {
|
||||
if (event.key === 'Enter') {
|
||||
event.preventDefault();
|
||||
@@ -820,20 +825,38 @@ jQuery(function ($) {
|
||||
}
|
||||
});
|
||||
|
||||
function syncSpacingPreset($fields) {
|
||||
const values = $fields.find('[data-spacing-side]').map((_, input) => input.value).get();
|
||||
const same = values.every((value) => value === values[0]);
|
||||
const $preset = $fields.find('[data-spacing-preset]');
|
||||
const presets = $preset.data('spacingPreset');
|
||||
const index = same && values[0] !== '' ? presets.indexOf(Number(values[0])) : -1;
|
||||
const label = !same ? '自定义' : (values[0] === '' ? '默认' : values[0] + ' px');
|
||||
$preset.val(index === -1 ? $preset.prop('defaultValue') : index).attr('aria-valuetext', label);
|
||||
$fields.find('[data-spacing-readout]').text(label);
|
||||
}
|
||||
|
||||
$elementTools.on('click', '[data-element-spacing]', () => {
|
||||
spacingTarget = styleTarget(selectedElement);
|
||||
if (!spacingTarget) return;
|
||||
const styles = classesOf(spacingTarget);
|
||||
$spacingForm.find('input').each(function () {
|
||||
$spacingForm.find('[data-spacing-side]').each(function () {
|
||||
this.value = styles[this.name]?.slice(('studio-style-' + this.name + '-').length) || '';
|
||||
});
|
||||
$spacingForm.find('[data-spacing-preset]').val('');
|
||||
$spacingForm.find('fieldset').each((_, fields) => syncSpacingPreset($(fields)));
|
||||
$spacing.get(0).showModal();
|
||||
});
|
||||
$spacingForm.on('change', '[data-spacing-preset]', function () {
|
||||
if (this.value !== '') $(this).closest('fieldset').find('input').val(this.value === 'template' ? '' : this.value);
|
||||
}).on('input', 'input', function () {
|
||||
$(this).closest('fieldset').find('[data-spacing-preset]').val('');
|
||||
$spacingForm.on('input', '[data-spacing-preset]', function () {
|
||||
const $preset = $(this);
|
||||
const $fields = $preset.closest('fieldset');
|
||||
$fields.find('[data-spacing-side]').val($preset.data('spacingPreset')[this.valueAsNumber]);
|
||||
syncSpacingPreset($fields);
|
||||
}).on('input', '[data-spacing-side]', function () {
|
||||
syncSpacingPreset($(this).closest('fieldset'));
|
||||
}).on('click', '[data-spacing-reset]', function () {
|
||||
const $fields = $(this).closest('fieldset');
|
||||
$fields.find('[data-spacing-side]').val('');
|
||||
syncSpacingPreset($fields);
|
||||
});
|
||||
$elementTools.on('click', '[data-element-parent]', () => {
|
||||
const parent = parentElement(selectedElement);
|
||||
@@ -847,7 +870,9 @@ jQuery(function ($) {
|
||||
$spacingForm.on('submit', (event) => {
|
||||
event.preventDefault();
|
||||
if (spacingTarget?.isConnected) {
|
||||
$spacingForm.find('input').each(function () { putStyle(spacingTarget, this.name, this.value); });
|
||||
$spacingForm.find('[data-spacing-side]').each(function () {
|
||||
putStyle(spacingTarget, this.name, this.value === '' ? '' : String(this.valueAsNumber));
|
||||
});
|
||||
}
|
||||
$spacing.get(0).close();
|
||||
positionSelection();
|
||||
|
||||
|
After Width: | Height: | Size: 136 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 5.4 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 5.9 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 5.8 KiB |
|
After Width: | Height: | Size: 7.2 KiB |
|
After Width: | Height: | Size: 7.2 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 7.5 KiB |
|
After Width: | Height: | Size: 6.2 KiB |