feat: 优化单页编辑、列表留白与友链申请体验
单页全屏编辑并禁用内容门控;对齐 Feed 留白;友链申请区前置并收敛弹框样式;略增大帖子列表标题字号。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -101,6 +101,21 @@ export function insertMarkdownReplyOnly(
|
||||
applyTextareaChange(textarea, next, cursor, cursor, onChange);
|
||||
}
|
||||
|
||||
/** 插入积分可见区块模板 */
|
||||
export function insertMarkdownPointsOnly(
|
||||
textarea: HTMLTextAreaElement,
|
||||
value: string,
|
||||
onChange: ChangeHandler,
|
||||
cost = 10,
|
||||
) {
|
||||
const { selectionStart, selectionEnd } = textarea;
|
||||
const open = `\n\n<points-only data-gate="points" data-cost="${cost}">\n\n`;
|
||||
const snippet = `${open}\n</points-only>\n\n`;
|
||||
const next = value.slice(0, selectionStart) + snippet + value.slice(selectionEnd);
|
||||
const cursor = selectionStart + open.length;
|
||||
applyTextareaChange(textarea, next, cursor, cursor, onChange);
|
||||
}
|
||||
|
||||
/** 在光标处插入链接 Markdown */
|
||||
export function insertMarkdownLink(
|
||||
textarea: HTMLTextAreaElement,
|
||||
|
||||
Reference in New Issue
Block a user