diff --git a/.claude/skills/form-compile/scripts/form-compile.ps1 b/.claude/skills/form-compile/scripts/form-compile.ps1 index e4148cd1..7ab7a1ff 100644 --- a/.claude/skills/form-compile/scripts/form-compile.ps1 +++ b/.claude/skills/form-compile/scripts/form-compile.ps1 @@ -1,4 +1,4 @@ -# form-compile v1.81 — Compile 1C managed form from JSON or object metadata +# form-compile v1.82 — Compile 1C managed form from JSON or object metadata # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills param( [string]$JsonPath, @@ -5029,6 +5029,20 @@ if ($def.excludedCommands -and $def.excludedCommands.Count -gt 0) { X "`t" } +# 12c2. MobileDeviceCommandBarContent — форменный список имён командных панелей/кнопок +# (Presentation пустой, CheckState=0, тип xs:string — константы; варьируется только имя-Value). +if ($def.mobileCommandBarContent -and @($def.mobileCommandBarContent).Count -gt 0) { + X "`t" + foreach ($nm in @($def.mobileCommandBarContent)) { + X "`t`t" + X "`t`t`t" + X "`t`t`t0" + X "`t`t`t$(Esc-Xml "$nm")" + X "`t`t" + } + X "`t" +} + # 12d. AutoCommandBar (always present, id=-1) $acbAutofill = Compute-MainAcbAutofill $acbName = "ФормаКоманднаяПанель" diff --git a/.claude/skills/form-compile/scripts/form-compile.py b/.claude/skills/form-compile/scripts/form-compile.py index e3d44ccc..84e32c3f 100644 --- a/.claude/skills/form-compile/scripts/form-compile.py +++ b/.claude/skills/form-compile/scripts/form-compile.py @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# form-compile v1.81 — Compile 1C managed form from JSON or object metadata +# form-compile v1.82 — Compile 1C managed form from JSON or object metadata # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills import argparse import copy @@ -4877,6 +4877,18 @@ def main(): lines.append(f'\t\t{cmd}') lines.append('\t') + # MobileDeviceCommandBarContent — форменный список имён командных панелей/кнопок + # (Presentation пустой, CheckState=0, тип xs:string — константы; варьируется только имя-Value). + if defn.get('mobileCommandBarContent') and len(defn['mobileCommandBarContent']) > 0: + lines.append('\t') + for nm in defn['mobileCommandBarContent']: + lines.append('\t\t') + lines.append('\t\t\t') + lines.append('\t\t\t0') + lines.append(f'\t\t\t{esc_xml(str(nm))}') + lines.append('\t\t') + lines.append('\t') + # AutoCommandBar (always present, id=-1) acb_autofill = _compute_main_acb_autofill() acb_name = '\u0424\u043e\u0440\u043c\u0430\u041a\u043e\u043c\u0430\u043d\u0434\u043d\u0430\u044f\u041f\u0430\u043d\u0435\u043b\u044c' diff --git a/.claude/skills/form-decompile/scripts/form-decompile.ps1 b/.claude/skills/form-decompile/scripts/form-decompile.ps1 index 5ac7ce4a..330774ed 100644 --- a/.claude/skills/form-decompile/scripts/form-decompile.ps1 +++ b/.claude/skills/form-decompile/scripts/form-decompile.ps1 @@ -1,4 +1,4 @@ -# form-decompile v0.57 — Decompile 1C managed Form.xml to JSON DSL (draft) +# form-decompile v0.58 — Decompile 1C managed Form.xml to JSON DSL (draft) # Source: https://github.com/Nikolay-Shirokov/cc-1c-skills # ВНИМАНИЕ: раундтрип не гарантируется. Навык исключён из авто-использования моделью. param( @@ -1655,6 +1655,16 @@ foreach ($pn in $KNOWN_FORM_PROPS) { if ($dsl.Contains('title') -and $props.Contains('autoTitle') -and $props['autoTitle'] -eq $false) { $props.Remove('autoTitle') } if ($props.Count -gt 0) { $dsl['properties'] = $props } +# MobileDeviceCommandBarContent (form-level) → список имён командных панелей/кнопок +$mdcb = $root.SelectSingleNode("lf:MobileDeviceCommandBarContent", $ns) +if ($mdcb) { + $names = New-Object System.Collections.ArrayList + foreach ($it in @($mdcb.SelectNodes("xr:Item", $ns))) { + $v = $it.SelectSingleNode("xr:Value", $ns); if ($v) { [void]$names.Add($v.InnerText) } + } + if ($names.Count -gt 0) { $dsl['mobileCommandBarContent'] = @($names) } +} + # excludedCommands (form-level ) $csForm = $root.SelectSingleNode("lf:CommandSet", $ns) if ($csForm) { diff --git a/docs/form-dsl-spec.md b/docs/form-dsl-spec.md index 7defcfa0..684b9109 100644 --- a/docs/form-dsl-spec.md +++ b/docs/form-dsl-spec.md @@ -24,6 +24,7 @@ | `title` | string | Заголовок формы (необязательный) | | `properties` | object | Свойства формы (необязательный) | | `excludedCommands` | string[] | Исключённые стандартные команды (необязательный) | +| `mobileCommandBarContent` | string[] | Состав командной панели моб. устройства — список имён командных панелей/кнопок (``). Константы (Presentation/CheckState=0/xs:string) ставит компилятор | | `events` | object | Обработчики событий формы (необязательный) | | `elements` | array | Дерево UI-элементов (необязательный) | | `attributes` | array | Реквизиты формы (необязательный) | diff --git a/tests/skills/cases/form-compile/commands.json b/tests/skills/cases/form-compile/commands.json index 9daea9a2..c938abcd 100644 --- a/tests/skills/cases/form-compile/commands.json +++ b/tests/skills/cases/form-compile/commands.json @@ -15,6 +15,7 @@ "validatePath": "DataProcessors/Команды/Forms/Форма/Ext/Form.xml", "input": { "title": "Форма с командами", + "mobileCommandBarContent": ["Панель", "Выполнить"], "elements": [ { "cmdBar": "Панель", "horizontalLocation": "right", "children": [ { "button": "Выполнить", "command": "Выполнить", "defaultButton": true }, diff --git a/tests/skills/cases/form-compile/snapshots/commands/DataProcessors/Команды/Forms/Форма/Ext/Form.xml b/tests/skills/cases/form-compile/snapshots/commands/DataProcessors/Команды/Forms/Форма/Ext/Form.xml index 0500415d..9f024269 100644 --- a/tests/skills/cases/form-compile/snapshots/commands/DataProcessors/Команды/Forms/Форма/Ext/Form.xml +++ b/tests/skills/cases/form-compile/snapshots/commands/DataProcessors/Команды/Forms/Форма/Ext/Form.xml @@ -7,6 +7,18 @@ false + + + + 0 + Панель + + + + 0 + Выполнить + + false