@ompo-design/mcp-server 0.1.5 → 0.1.6

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.
@@ -1,7 +1,8 @@
1
1
  const OMPO_GLOSSARY = {
2
2
  gap: `Ompo "Gap" is the space between children inside a flex or grid container. Apply \`gap\` on the parent layout element (not on children). The parent needs \`display: flex\` or \`display: grid\`. Example: gap "16px" → CSS \`gap: 16px\` or Tailwind \`gap-4\`.`,
3
3
  fill: `Ompo "Fill" means an element should expand to consume free space inside its parent. Fill is NOT a CSS property — read \`widthMode: fill\` / \`heightMode: fill\` together with \`ensureParentFlex\`, \`flexGrow\`, \`flexShrink\`, \`flexBasis\`, and \`alignSelf\` on the same selector. Parent must be \`display: flex\`. Main axis (direction of flex): use \`flex: 1 1 0\` (grow/shrink/basis). Cross axis: use \`align-self: stretch\` and remove fixed width/height on that axis. If \`ensureParentFlex\` is present, make the parent a flex container with that direction first.`,
4
- fit: `Ompo "Fit" means size to content. Map \`widthMode: fit\` → \`width: fit-content\`, \`heightMode: fit\` → \`height: fit-content\` (or the project's equivalent).`
4
+ fit: `Ompo "Fit" means size to content. Map \`widthMode: fit\` → \`width: fit-content\`, \`heightMode: fit\` → \`height: fit-content\` (or the project's equivalent).`,
5
+ imageFill: `Ompo image background fill: copy the source file from \`backgroundImageSource\` into the project (e.g. public/images/), then set \`background-image\` to a project-relative url(), with \`background-size: cover\`, \`background-position: center\`, and \`background-repeat: no-repeat\`. Do not commit file:// URLs to source.`
5
6
  };
6
7
  function formatChangedValue(property, value) {
7
8
  const text = String(value);
@@ -103,6 +104,35 @@ function styleSuggestionForProperty(property, value, changed) {
103
104
  strategy: 'css-rule',
104
105
  notes: 'Supporting constraint for Ompo Fill sizing. max-width/max-height: none allows the element to grow.'
105
106
  };
107
+ case 'backgroundImageSource':
108
+ return {
109
+ property,
110
+ value: formatChangedValue(property, value),
111
+ strategy: 'component-markup',
112
+ notes: `${OMPO_GLOSSARY.imageFill} Read this file from the user's machine (${String(value)}), copy it into the repo, and reference the copied asset in CSS.`
113
+ };
114
+ case 'backgroundImage':
115
+ if (changed.backgroundImageSource) {
116
+ return {
117
+ property,
118
+ value: formatChangedValue(property, value),
119
+ strategy: 'css-rule',
120
+ notes: `${OMPO_GLOSSARY.imageFill} Apply after copying the file from backgroundImageSource.`
121
+ };
122
+ }
123
+ break;
124
+ case 'backgroundSize':
125
+ case 'backgroundPosition':
126
+ case 'backgroundRepeat':
127
+ if (changed.backgroundImageSource) {
128
+ return {
129
+ property,
130
+ value: formatChangedValue(property, value),
131
+ strategy: 'css-rule',
132
+ notes: `Part of Ompo image background fill (${OMPO_GLOSSARY.imageFill}).`
133
+ };
134
+ }
135
+ break;
106
136
  }
107
137
  return {
108
138
  property,
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.5'
11
+ version: '0.1.6'
12
12
  });
13
13
  function requireEditsStore() {
14
14
  const storePath = getOmpoEditsStorePath();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ompo-design/mcp-server",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "MCP server for applying Ompo visual edits to a codebase",
5
5
  "type": "module",
6
6
  "license": "MIT",