mirror of
https://github.com/Nikolay-Shirokov/cc-1c-skills.git
synced 2026-08-26 21:19:42 +03:00
feat(form-decompile,form-compile): CommandSet (отключённые команды) — общее свойство поля
Ранее excludedCommands обрабатывался только для Table-элемента и форм-уровня. Обычные поля (InputField/LabelField/CheckBoxField/SpreadSheetDocumentField/HTML/ Formatted/Picture) идут через Emit-SimpleField и др. — CommandSet там терялся (кластер SpreadSheetDocumentField>CommandSet, baseline impact ~1443). Централизовал: захват в Add-CommonProps (декомпилятор, общий для всех полей), эмит в Emit-Layout (компилятор ps1+py), убрал дубль из Table-эмиттера. CommandSet — дочерний элемент базового FormField в схеме, позиция фиксирована независимо от подтипа → ранняя (после TitleLocation, перед скалярами/Height), как у spreadsheet. Таргет-верификация (новый цикл category-forms.py): 43 формы корпуса с CommandSet → после фикса 0 остатка (CommandSet + ExcludedCommand cascade), 26 стали match. Кейс table пере-сертифицирован в 1С (ранняя позиция грузится), ps1==py, регресс 43/43. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
d5d19710cb
commit
d8689b3674
@@ -1,4 +1,4 @@
|
||||
# form-decompile v0.84 — Decompile 1C managed Form.xml to JSON DSL (draft)
|
||||
# form-decompile v0.85 — Decompile 1C managed Form.xml to JSON DSL (draft)
|
||||
# Source: https://github.com/Nikolay-Shirokov/cc-1c-skills
|
||||
# ВНИМАНИЕ: раундтрип не гарантируется. Навык исключён из авто-использования моделью.
|
||||
param(
|
||||
@@ -1027,6 +1027,14 @@ function Add-CommonProps {
|
||||
$fp = Get-PictureRef $node 'FooterPicture'; if ($null -ne $fp) { $obj['footerPicture'] = $fp }
|
||||
$ev = Get-Events $node $elName
|
||||
if ($ev) { $obj['events'] = $ev }
|
||||
# CommandSet — общий для полей (input/label/check/spreadsheet/html/formatted/picture):
|
||||
# список отключённых команд редактора. Только <ExcludedCommand>, пустого не бывает.
|
||||
$csNode = $node.SelectSingleNode("lf:CommandSet", $ns)
|
||||
if ($csNode) {
|
||||
$exc = New-Object System.Collections.ArrayList
|
||||
foreach ($ec in @($csNode.SelectNodes("lf:ExcludedCommand", $ns))) { [void]$exc.Add($ec.InnerText) }
|
||||
if ($exc.Count -gt 0) { $obj['excludedCommands'] = @($exc) }
|
||||
}
|
||||
}
|
||||
|
||||
# --- 3. Type decompile (inverse of Emit-Type) ---
|
||||
|
||||
Reference in New Issue
Block a user