详细说明: - 添加了V2版本的工作流页面和结果页面 - 更新了Serena记忆文件 - 添加了详细实施计划文档 - 优化了Vite配置 - 更新了项目文档CLAUDE.md - 构建了演示系统的dist版本 - 包含了exhibition-demo的完整依赖
35 lines
891 B
JavaScript
35 lines
891 B
JavaScript
let Declaration = require('../declaration')
|
|
let utils = require('./grid-utils')
|
|
|
|
class GridArea extends Declaration {
|
|
/**
|
|
* Translate grid-area to separate -ms- prefixed properties
|
|
*/
|
|
insert(decl, prefix, prefixes, result) {
|
|
if (prefix !== '-ms-') return super.insert(decl, prefix, prefixes)
|
|
|
|
let values = utils.parse(decl)
|
|
|
|
let [rowStart, rowSpan] = utils.translate(values, 0, 2)
|
|
let [columnStart, columnSpan] = utils.translate(values, 1, 3)
|
|
|
|
;[
|
|
['grid-row', rowStart],
|
|
['grid-row-span', rowSpan],
|
|
['grid-column', columnStart],
|
|
['grid-column-span', columnSpan]
|
|
].forEach(([prop, value]) => {
|
|
utils.insertDecl(decl, prop, value)
|
|
})
|
|
|
|
utils.warnTemplateSelectorNotFound(decl, result)
|
|
utils.warnIfGridRowColumnExists(decl, result)
|
|
|
|
return undefined
|
|
}
|
|
}
|
|
|
|
GridArea.names = ['grid-area']
|
|
|
|
module.exports = GridArea
|