@ompo-design/mcp-server 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apply-plan.js +16 -6
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/apply-plan.js
CHANGED
|
@@ -169,23 +169,32 @@ function buildDomStructurePlan(operation) {
|
|
|
169
169
|
selector: operation.selector
|
|
170
170
|
}
|
|
171
171
|
};
|
|
172
|
-
case 'dom.move':
|
|
172
|
+
case 'dom.move': {
|
|
173
|
+
const reordered = operation.fromParentSelector === operation.toParentSelector;
|
|
173
174
|
return {
|
|
174
175
|
kind: 'dom.move',
|
|
175
|
-
summary:
|
|
176
|
+
summary: reordered
|
|
177
|
+
? `Reorder element within parent "${operation.toParentSelector}"`
|
|
178
|
+
: `Move element to a new parent "${operation.toParentSelector}"`,
|
|
176
179
|
steps: [
|
|
177
|
-
`Locate element "${operation.selector}" in source using selector
|
|
178
|
-
|
|
179
|
-
|
|
180
|
+
`Locate element "${operation.selector}" in source using selector, tag, id, class, or nearby text.`,
|
|
181
|
+
reordered
|
|
182
|
+
? `Reorder it inside "${operation.toParentSelector}" from child index ${operation.fromIndex} to index ${operation.index}.`
|
|
183
|
+
: `Move it from "${operation.fromParentSelector}" (index ${operation.fromIndex}) to "${operation.toParentSelector}" at index ${operation.index}.`,
|
|
184
|
+
'Update JSX/HTML/component structure in source — this is a markup change, not a CSS tweak.',
|
|
185
|
+
'Preserve the element’s content and non-Ompo styling.',
|
|
186
|
+
'If the project uses mapped lists or arrays, update item order in data when that drives rendering.'
|
|
180
187
|
],
|
|
181
188
|
payload: {
|
|
182
189
|
selector: operation.selector,
|
|
183
190
|
fromParentSelector: operation.fromParentSelector,
|
|
184
191
|
fromIndex: operation.fromIndex,
|
|
185
192
|
toParentSelector: operation.toParentSelector,
|
|
186
|
-
insertIndex: operation.index
|
|
193
|
+
insertIndex: operation.index,
|
|
194
|
+
reordered
|
|
187
195
|
}
|
|
188
196
|
};
|
|
197
|
+
}
|
|
189
198
|
case 'dom.delete':
|
|
190
199
|
return {
|
|
191
200
|
kind: 'dom.delete',
|
|
@@ -278,6 +287,7 @@ export function buildApplyPlan(bundle) {
|
|
|
278
287
|
'Read ompoGlossary.fill and ompoGlossary.gap before applying layout changes — Ompo terms are not literal CSS properties.',
|
|
279
288
|
'When widthMode or heightMode is "fill", apply the grouped flex properties together (flexGrow, flexBasis, alignSelf, removed width/height) — do not set a fixed px width/height on the filled axis.',
|
|
280
289
|
'Gap belongs on the flex/grid parent. Fill belongs on the child inside a flex parent.',
|
|
290
|
+
'DOM moves are in domStructurePlans and domChanges — reorder or reparent elements in source markup/components, not just CSS.',
|
|
281
291
|
'For dom.flexWrap: create a new wrapper, move matched children, then apply wrapperStyles.',
|
|
282
292
|
'Use child anchors (tag, id, class, textSnippet) to find elements in source when selectors are unstable.',
|
|
283
293
|
'Prefer the smallest possible diff for each file.'
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import { editsStoreReady, listEdits, readEditBundle, recordEditApplied, recordEd
|
|
|
8
8
|
import { getOmpoEditsStorePath } from './edits-path.js';
|
|
9
9
|
const server = new McpServer({
|
|
10
10
|
name: 'ompo-mcp-server',
|
|
11
|
-
version: '0.1.
|
|
11
|
+
version: '0.1.5'
|
|
12
12
|
});
|
|
13
13
|
function requireEditsStore() {
|
|
14
14
|
const storePath = getOmpoEditsStorePath();
|