블록 설정 패널 확장 v1.5.37

This commit is contained in:
2026-06-02 16:13:38 +09:00
parent 093d09c8bf
commit ba17e3aa18
14 changed files with 538 additions and 28 deletions

View File

@@ -19,7 +19,7 @@ import {
stripQuoteMarker
} from '../../lib/markdown-live-edit.js'
import { buildCodeBlockLines, parseCodeFenceLine } from '../../lib/markdown-code-block.js'
import { buildToggleBlockLines } from '../../lib/markdown-toggle.js'
import { buildToggleBlockLines, parseToggleOpenerLine } from '../../lib/markdown-toggle.js'
import { CALLOUT_BACKGROUND_OPTIONS, parseCalloutOptions } from '../../lib/markdown-callout.js'
import { createHeadingIdFactory } from '../../lib/markdown-toc.js'
import ContentMarkdownCodeBlockEditor from './ContentMarkdownCodeBlockEditor.vue'
@@ -566,9 +566,9 @@ const parseMarkdownBlocks = (markdown) => {
if (trimmedLine.startsWith(':::toggle')) {
const startLine = index
const { contentLines, nextIndex } = collectFencedLines(lines, index + 1)
const title = trimmedLine.replace(/^:::toggle\s*/, '').trim()
const toggleOptions = parseToggleOpenerLine(trimmedLine)
blocks.push(attachSourceRange(
createBlock('toggle', contentLines.join('\n'), null, `block-${blocks.length}`, { title }),
createBlock('toggle', contentLines.join('\n'), null, `block-${blocks.length}`, toggleOptions),
startLine,
nextIndex
))
@@ -1245,6 +1245,7 @@ const onToggleBlockInsertBelow = (block, payload) => {
onToggleBlockCommit(block, buildToggleBlockLines({
title: block.title,
defaultOpen: block.defaultOpen,
body: value
}))
pendingFocusPosition.value = 'start'
@@ -2517,13 +2518,14 @@ onBeforeUnmount(() => {
<ContentMarkdownToggleEditor
v-else-if="block.type === 'toggle' && interactive"
:title="block.title"
:default-open="block.defaultOpen"
:title-source-line="block.meta.startLine"
:body-source-line="block.meta.startLine + 1"
:model-value="block.text"
@commit="onToggleBlockCommit(block, $event)"
@insert-below="onToggleBlockInsertBelow(block, $event)"
/>
<ProseToggle v-else-if="block.type === 'toggle'" :title="block.title || '더 보기'" animated>
<ProseToggle v-else-if="block.type === 'toggle'" :title="block.title || '더 보기'" :default-open="block.defaultOpen" animated>
<template v-for="(segment, segmentIndex) in parseInlineSegments(block.text)" :key="`${block.id}-toggle-${segmentIndex}`">
<strong v-if="segment.type === 'strong'">{{ segment.text }}</strong>
<em v-else-if="segment.type === 'em'">{{ segment.text }}</em>