@symbo.ls/mcp 1.0.10 → 1.0.11

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,265 +0,0 @@
1
- # Symbols / DOMQL v3 — AI Agent Instructions
2
-
3
- You are working inside a **Symbols.app** project. These rules are absolute and override any general coding instincts. Violations cause silent failures (black page, nothing renders).
4
-
5
- ---
6
-
7
- ## 1. Components are OBJECTS — never functions
8
-
9
- ```js
10
- // CORRECT
11
- export const Header = { extends: "Flex", padding: "A" };
12
-
13
- // WRONG — never
14
- export const Header = (el, state) => ({ padding: "A" });
15
- ```
16
-
17
- ---
18
-
19
- ## 2. NO imports between project files — EVER
20
-
21
- Components reference each other by PascalCase key name in the tree. No `import` statements between `components/`, `pages/`, `functions/`, etc.
22
-
23
- ```js
24
- // WRONG
25
- import { Navbar } from './Navbar.js'
26
-
27
- // CORRECT — just use the key name in the tree
28
- Nav: { extends: 'Navbar' }
29
- ```
30
-
31
- ---
32
-
33
- ## 3. `components/index.js` — use `export *` NOT `export * as`
34
-
35
- `export * as Foo` wraps everything in a namespace object and **breaks component resolution entirely**.
36
-
37
- ```js
38
- // CORRECT
39
- export * from "./Navbar.js";
40
- export * from "./PostCard.js";
41
-
42
- // WRONG — this breaks everything
43
- export * as Navbar from "./Navbar.js";
44
- ```
45
-
46
- ---
47
-
48
- ## 4. Pages extend `'Page'`, not `'Flex'` or `'Box'`
49
-
50
- ```js
51
- // CORRECT
52
- export const main = { extends: 'Page', ... }
53
-
54
- // WRONG
55
- export const main = { extends: 'Flex', ... }
56
- ```
57
-
58
- ---
59
-
60
- ## 5. `pages/index.js` — imports ARE allowed here (it's the registry)
61
-
62
- ```js
63
- import { main } from "./main.js";
64
- export default { "/": main };
65
- ```
66
-
67
- This is the **only** file where cross-file imports are permitted.
68
-
69
- ---
70
-
71
- ## 6. Tab / view switching — use DOM IDs + a function, NOT reactive `display` bindings
72
-
73
- Reactive `display: (el, s) => ...` on multiple full-page trees causes rendering failures. Use the DOM ID pattern instead:
74
-
75
- ```js
76
- // In page definition — assign ids to views
77
- HomeView: { id: 'view-home', extends: 'Flex', ... },
78
- ExploreView: { id: 'view-explore', extends: 'Flex', display: 'none', ... },
79
-
80
- // In Navbar onClick
81
- onClick: (e, el) => { el.call('switchView', 'explore') }
82
-
83
- // functions/switchView.js
84
- export const switchView = function switchView(view) {
85
- ['home', 'explore', 'profile'].forEach(function(v) {
86
- const el = document.getElementById('view-' + v)
87
- if (el) el.style.display = v === view ? 'flex' : 'none'
88
- })
89
- }
90
- ```
91
-
92
- ---
93
-
94
- ## 7. `el.call('fn', arg)` — element is `this` inside the function, NOT the first arg
95
-
96
- ```js
97
- // functions/myFn.js
98
- export const myFn = function myFn(arg1) {
99
- const node = this.node; // 'this' is the DOMQL element
100
- };
101
-
102
- // In component
103
- onClick: (e, el) => el.call("myFn", someArg); // CORRECT
104
- onClick: (e, el) => el.call("myFn", el, someArg); // WRONG — el passed twice
105
- ```
106
-
107
- ---
108
-
109
- ## 8. Icon rendering — NEVER use `Icon` inside `Button` or `Flex+tag:button`
110
-
111
- Use `Svg` atom with `html` prop instead. Key MUST be named `Svg`.
112
-
113
- ```js
114
- // CORRECT
115
- MyBtn: {
116
- extends: 'Flex', tag: 'button', flexAlign: 'center center', cursor: 'pointer',
117
- Svg: { viewBox: '0 0 24 24', width: '22', height: '22',
118
- html: '<path d="..." fill="currentColor"/>' }
119
- }
120
-
121
- // WRONG — Icon will NOT render inside Button
122
- MyBtn: { extends: 'Button', Icon: { name: 'heart' } }
123
- ```
124
-
125
- ---
126
-
127
- ## 9. Use `flexAlign` not `align` for Flex shorthand
128
-
129
- ```js
130
- { extends: 'Flex', flexAlign: 'center center' } // CORRECT
131
- { extends: 'Flex', align: 'center center' } // WRONG — no effect
132
- ```
133
-
134
- ---
135
-
136
- ## 10. State — use `s.update()`, never mutate directly
137
-
138
- ```js
139
- onClick: (e, el, s) => s.update({ count: s.count + 1 }); // CORRECT
140
- onClick: (e, el, s) => {
141
- s.count = s.count + 1;
142
- }; // WRONG — no re-render
143
- ```
144
-
145
- Root-level state (global): `s.root.update({ key: val })`
146
-
147
- ---
148
-
149
- ## 11. v3 syntax — never use v2
150
-
151
- | v3 ✅ | v2 ❌ |
152
- | ----------------------- | ------------------------ |
153
- | `extends: 'X'` | `extend: 'X'` |
154
- | `childExtends: 'X'` | `childExtend: 'X'` |
155
- | `onClick: fn` | `on: { click: fn }` |
156
- | props flattened at root | `props: { ... }` wrapper |
157
-
158
- ---
159
-
160
- ## 12. All folders are flat — no subfolders
161
-
162
- ```
163
- components/Navbar.js ✅
164
- components/nav/Navbar.js ❌
165
- ```
166
-
167
- ---
168
-
169
- ## 13. `onRender` — guard against double-init
170
-
171
- ```js
172
- onRender: (el) => {
173
- if (el.__initialized) return;
174
- el.__initialized = true;
175
- // imperative logic here
176
- };
177
- ```
178
-
179
- ---
180
-
181
- ## 14. `childExtends` — MUST be a named component string, never an inline object
182
-
183
- Inline `childExtends` objects cause ALL property values to be concatenated as visible text content on every child element.
184
-
185
- ```js
186
- // CORRECT — reference a named component
187
- childExtends: 'NavLink'
188
-
189
- // WRONG — dumps all prop values as raw text on every child
190
- childExtends: {
191
- tag: 'button',
192
- background: 'transparent',
193
- border: '2px solid transparent', // renders as visible text!
194
- color: 'white'
195
- }
196
- ```
197
-
198
- Define the shared style as a named component in `components/`, register it in `components/index.js`, then reference it by name.
199
-
200
- ---
201
-
202
- ## 15. Color tokens — NO opacity modifier syntax
203
-
204
- `color: 'white .7'` is NOT valid — Symbols renders it as raw text content.
205
- Define named tokens in `designSystem/COLOR.js` instead:
206
-
207
- ```js
208
- // designSystem/COLOR.js
209
- export default {
210
- whiteMuted: "rgba(255,255,255,0.7)",
211
- whiteSubtle: "rgba(255,255,255,0.6)",
212
- whiteFaint: "rgba(255,255,255,0.5)",
213
- };
214
-
215
- // In component — CORRECT
216
- {
217
- color: "whiteMuted";
218
- }
219
-
220
- // WRONG — renders as literal text, not a style
221
- {
222
- color: "white .7";
223
- }
224
- {
225
- color: "black .5";
226
- }
227
- ```
228
-
229
- ---
230
-
231
- ## 15. Border shorthand — split into individual props
232
-
233
- `border: '2px solid transparent'` in `childExtends` or any Symbols prop renders the raw string as text content. Always split:
234
-
235
- ```js
236
- // CORRECT
237
- { borderWidth: '2px', borderStyle: 'solid', borderColor: 'transparent' }
238
-
239
- // WRONG — raw string appears as visible text
240
- { border: '2px solid transparent' }
241
- ```
242
-
243
- `border: 'none'` is the only shorthand that works safely.
244
-
245
- ---
246
-
247
- ## Project structure quick reference
248
-
249
- ```
250
- smbls/
251
- ├── index.js # export * as components, export default pages, etc.
252
- ├── state.js # export default { ... }
253
- ├── dependencies.js # export default { 'pkg': 'version' }
254
- ├── components/
255
- │ ├── index.js # export * from './Foo.js' ← flat re-exports
256
- │ └── Navbar.js # export const Navbar = { ... }
257
- ├── pages/
258
- │ ├── index.js # import + export default { '/': main }
259
- │ └── main.js # export const main = { extends: 'Page', ... }
260
- ├── functions/
261
- │ ├── index.js # export * from './switchView.js'
262
- │ └── switchView.js # export const switchView = function(...) {}
263
- └── designSystem/
264
- └── index.js # export default { COLOR, THEME, ... }
265
- ```
@@ -1,304 +0,0 @@
1
- # Built-in atoms and property usage
2
-
3
- This document lists the built-in components (atoms and UI kit components) and how their properties are commonly used in Symbols.app.
4
-
5
- ## Built-in atoms
6
-
7
- - `Text` -> <span>
8
- - `Box` -> <div>
9
- - `Flex` -> <div>
10
- - `Grid` -> <div>
11
- - `Link` -> <a>
12
- - `Input` -> <input>
13
- - `Radio` -> <input>
14
- - `Checkbox` -> <input>
15
- - `Svg` -> <svg>
16
- - `Icon` -> <svg> (icon sprite)
17
- - `IconText` -> <div>
18
- - `Button` -> <button>
19
- - `Img` -> <img>
20
- - `Iframe` -> <iframe>
21
- - `Video` -> <video>
22
-
23
- ## Built-in components (UI kit)
24
-
25
- These are the higher-level components shipped in the UI kit. They are composed from atoms and share the same prop rules.
26
-
27
- - `Avatar`
28
- - `Button`
29
- - `Dialog`
30
- - `Dropdown`
31
- - `Icon`
32
- - `Input`
33
- - `Link`
34
- - `Notification`
35
- - `Range`
36
- - `Select`
37
- - `Tooltip`
38
-
39
- ## Property usage by atom
40
-
41
- These components all use flattened props (no `props` wrapper) and `onX` events.
42
-
43
- ### Text
44
-
45
- Primary use: inline text content.
46
-
47
- Common props:
48
-
49
- - `text`: string or binding (e.g. `'{{ title }}'`)
50
- - `color`, `fontSize`, `fontWeight`, `lineHeight`, `letterSpacing`
51
- - `textTransform`, `textDecoration`, `textAlign`
52
- - `maxWidth`, `overflow`, `whiteSpace`
53
-
54
- Example:
55
-
56
- ```js
57
- Text: {
58
- text: 'Hello',
59
- fontSize: 'B',
60
- color: 'title'
61
- }
62
- ```
63
-
64
- ### Box
65
-
66
- Primary use: generic container.
67
-
68
- Common props:
69
-
70
- - `padding`, `margin`, `border`, `borderRadius`, `background`, `shadow`
71
- - `width`, `height`, `minWidth`, `maxWidth`, `minHeight`, `maxHeight`
72
- - `position`, `inset`, `top`, `right`, `bottom`, `left`
73
- - `overflow`, `zIndex`
74
-
75
- Example:
76
-
77
- ```js
78
- Box: {
79
- padding: 'A B',
80
- background: 'surface',
81
- borderRadius: 'B'
82
- }
83
- ```
84
-
85
- ### Flex
86
-
87
- Primary use: layout container using flexbox.
88
-
89
- Common props:
90
-
91
- - `flow` or `flexFlow`
92
- - `align` or `flexAlign`
93
- - `alignItems`, `justifyContent`, `gap`
94
- - `flex`, `flexGrow`, `flexShrink`, `flexBasis`
95
- - `wrap`
96
-
97
- Example:
98
-
99
- ```js
100
- Flex: {
101
- flow: 'y',
102
- align: 'center space-between',
103
- gap: 'B'
104
- }
105
- ```
106
-
107
- ### Grid
108
-
109
- Primary use: layout container using CSS grid.
110
-
111
- Common props:
112
-
113
- - `columns` or `gridTemplateColumns`
114
- - `rows` or `gridTemplateRows`
115
- - `gap`, `columnGap`, `rowGap`
116
- - `gridAutoFlow`, `gridAutoColumns`, `gridAutoRows`
117
-
118
- Example:
119
-
120
- ```js
121
- Grid: {
122
- columns: 'repeat(3, 1fr)',
123
- gap: 'A'
124
- }
125
- ```
126
-
127
- ### Link
128
-
129
- Primary use: navigation or external link.
130
-
131
- Common props:
132
-
133
- - `href`, `target`, `rel`
134
- - `text` or child content
135
- - `color`, `textDecoration`
136
- - `onClick`
137
-
138
- Example:
139
-
140
- ```js
141
- Link: {
142
- text: 'Docs',
143
- href: '/docs'
144
- }
145
- ```
146
-
147
- ### Input
148
-
149
- Primary use: text input.
150
-
151
- Common props:
152
-
153
- - `type`, `name`, `value`, `placeholder`, `required`, `disabled`
154
- - `onInput`, `onChange`, `onKeydown`
155
- - `padding`, `background`, `border`, `round`
156
-
157
- Example:
158
-
159
- ```js
160
- Input: {
161
- type: 'text',
162
- name: 'title',
163
- placeholder: 'Enter title'
164
- }
165
- ```
166
-
167
- ### Radio and Checkbox
168
-
169
- Primary use: selectable inputs.
170
-
171
- Common props:
172
-
173
- - `name`, `value`, `checked`, `disabled`
174
- - `onChange`
175
-
176
- Example:
177
-
178
- ```js
179
- Checkbox: { name: 'agree', checked: true }
180
- ```
181
-
182
- ### Svg
183
-
184
- Primary use: raw SVG container.
185
-
186
- Common props:
187
-
188
- - `html` (inline SVG markup)
189
- - `width`, `height`, `viewBox`, `fill`, `stroke`
190
-
191
- Example:
192
-
193
- ```js
194
- Svg: { html: '<path d="..." />', viewBox: '0 0 24 24' }
195
- ```
196
-
197
- ### Icon
198
-
199
- Primary use: icon from sprite.
200
-
201
- Common props:
202
-
203
- - `name` (sprite symbol id)
204
- - `size` or `boxSize`
205
- - `color`
206
-
207
- Example:
208
-
209
- ```js
210
- Icon: { name: 'chevronRight', boxSize: 'A' }
211
- ```
212
-
213
- ### IconText
214
-
215
- Primary use: icon + text combo.
216
-
217
- Common props:
218
-
219
- - `icon`, `text`
220
- - `gap`, `align`, `color`
221
-
222
- Example:
223
-
224
- ```js
225
- IconText: { icon: 'search', text: 'Search', gap: 'Z' }
226
- ```
227
-
228
- ### Button
229
-
230
- Primary use: actionable control.
231
-
232
- Common props:
233
-
234
- - `text`, `icon`, `type`, `disabled`
235
- - `theme`, `padding`, `round`
236
- - `onClick`, `onSubmit`
237
-
238
- Example:
239
-
240
- ```js
241
- Button: { text: 'Save', theme: 'primary', type: 'submit' }
242
- ```
243
-
244
- ### Img
245
-
246
- Primary use: image element.
247
-
248
- Common props:
249
-
250
- - `src`, `alt`, `loading`
251
- - `width`, `height`, `boxSize`, `objectFit`
252
-
253
- Example:
254
-
255
- ```js
256
- Img: { src: '/logo.png', alt: 'Logo', boxSize: 'B' }
257
- ```
258
-
259
- ### Iframe
260
-
261
- Primary use: embedded content.
262
-
263
- Common props:
264
-
265
- - `src`, `title`, `allow`, `sandbox`
266
- - `width`, `height`, `border`
267
-
268
- Example:
269
-
270
- ```js
271
- Iframe: { src: 'https://example.com', width: '100%', height: '300px' }
272
- ```
273
-
274
- ### Video
275
-
276
- Primary use: video player.
277
-
278
- Common props:
279
-
280
- - `src`, `poster`, `controls`, `autoplay`, `muted`, `loop`
281
- - `width`, `height`, `objectFit`
282
-
283
- Example:
284
-
285
- ```js
286
- Video: { src: '/demo.mp4', controls: true, width: '100%' }
287
- ```
288
-
289
- ## Cross-cutting props
290
-
291
- All atoms can also use:
292
-
293
- - `@media` keys (e.g. `@mobile`)
294
- - pseudo selectors (e.g. `:hover`, `:active`)
295
- - conditional cases (e.g. `.isActive`, `!isActive`)
296
- - `childProps` for one-level child overrides
297
- - `children` arrays or nested object trees
298
- - `onInit`, `onRender`, `onUpdate`, `onStateUpdate`
299
-
300
- ---
301
-
302
- ## Symbols Feedback Conventions
303
-
304
- Supplemental conventions are merged into [CLAUDE.md](CLAUDE.md).