@walkeros/explorer 2.0.1 → 2.1.0
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/STYLE.md +240 -136
- package/dist/components/atoms/code.d.ts +4 -1
- package/dist/components/atoms/code.d.ts.map +1 -1
- package/dist/components/atoms/code.js +31 -10
- package/dist/components/atoms/code.js.map +1 -1
- package/dist/components/molecules/code-box.d.ts +2 -1
- package/dist/components/molecules/code-box.d.ts.map +1 -1
- package/dist/components/molecules/code-box.js +32 -6
- package/dist/components/molecules/code-box.js.map +1 -1
- package/dist/components/molecules/code-box.stories.d.ts +13 -0
- package/dist/components/molecules/code-box.stories.d.ts.map +1 -1
- package/dist/components/molecules/code-box.stories.js +76 -0
- package/dist/components/molecules/code-box.stories.js.map +1 -1
- package/dist/components/molecules/code-snippet.stories.d.ts +11 -0
- package/dist/components/molecules/code-snippet.stories.d.ts.map +1 -1
- package/dist/components/molecules/code-snippet.stories.js +38 -0
- package/dist/components/molecules/code-snippet.stories.js.map +1 -1
- package/dist/components/molecules/flow-selector.js +1 -1
- package/dist/components/molecules/flow-selector.js.map +1 -1
- package/dist/components/molecules/flow-selector.stories.js +4 -4
- package/dist/components/molecules/flow-selector.stories.js.map +1 -1
- package/dist/components/molecules/split-button.stories.js +6 -6
- package/dist/components/molecules/split-button.stories.js.map +1 -1
- package/dist/index.d.cts +23 -34
- package/dist/index.d.ts +1 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +342 -294
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +46 -91
- package/dist/themes/lighthouse.d.ts.map +1 -1
- package/dist/themes/lighthouse.js +1 -0
- package/dist/themes/lighthouse.js.map +1 -1
- package/dist/themes/palenight.d.ts.map +1 -1
- package/dist/themes/palenight.js +1 -0
- package/dist/themes/palenight.js.map +1 -1
- package/dist/utils/format-code.d.ts.map +1 -1
- package/dist/utils/format-code.js +11 -2
- package/dist/utils/format-code.js.map +1 -1
- package/dist/utils/monaco-decorators.d.ts.map +1 -1
- package/dist/utils/monaco-decorators.js +2 -0
- package/dist/utils/monaco-decorators.js.map +1 -1
- package/dist/utils/monaco-json-schema.d.ts +24 -0
- package/dist/utils/monaco-json-schema.d.ts.map +1 -0
- package/dist/utils/monaco-json-schema.js +65 -0
- package/dist/utils/monaco-json-schema.js.map +1 -0
- package/package.json +1 -1
- package/dist/components/molecules/flow-deploy-panel.d.ts +0 -31
- package/dist/components/molecules/flow-deploy-panel.d.ts.map +0 -1
- package/dist/components/molecules/flow-deploy-panel.js +0 -72
- package/dist/components/molecules/flow-deploy-panel.js.map +0 -1
- package/dist/components/molecules/flow-deploy-panel.stories.d.ts +0 -40
- package/dist/components/molecules/flow-deploy-panel.stories.d.ts.map +0 -1
- package/dist/components/molecules/flow-deploy-panel.stories.js +0 -145
- package/dist/components/molecules/flow-deploy-panel.stories.js.map +0 -1
package/STYLE.md
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Complete guide to styling, theming, and customization in walkerOS Explorer.
|
|
4
4
|
|
|
5
|
-
**Quick Links:** [Quick Start](#quick-start) ·
|
|
5
|
+
**Quick Links:** [Quick Start](#quick-start) ·
|
|
6
|
+
[Theme Variables](#theme-variables) · [Grid System](#grid-system) ·
|
|
7
|
+
[Monaco Editor](#monaco-editor) · [SCSS Architecture](#scss-architecture)
|
|
6
8
|
|
|
7
9
|
---
|
|
8
10
|
|
|
@@ -25,6 +27,7 @@ Explorer supports two built-in themes via the `data-theme` attribute:
|
|
|
25
27
|
```
|
|
26
28
|
|
|
27
29
|
Theme detection priority:
|
|
30
|
+
|
|
28
31
|
1. Closest ancestor `data-theme` attribute
|
|
29
32
|
2. Document root `data-theme` attribute
|
|
30
33
|
3. System preference via `prefers-color-scheme`
|
|
@@ -34,7 +37,7 @@ Theme detection priority:
|
|
|
34
37
|
Override CSS variables in your stylesheet:
|
|
35
38
|
|
|
36
39
|
```css
|
|
37
|
-
[data-theme=
|
|
40
|
+
[data-theme='dark'] {
|
|
38
41
|
--color-primary: #your-brand-color;
|
|
39
42
|
--bg-box: #your-background;
|
|
40
43
|
--text-primary: #your-text-color;
|
|
@@ -55,132 +58,132 @@ import '@walkeros/explorer/styles.css';
|
|
|
55
58
|
|
|
56
59
|
#### Text Colors
|
|
57
60
|
|
|
58
|
-
| Variable
|
|
59
|
-
|
|
60
|
-
| `--color-text`
|
|
61
|
-
| `--color-text-label`
|
|
62
|
-
| `--color-text-button`
|
|
63
|
-
| `--color-text-button-hover`
|
|
61
|
+
| Variable | Light | Dark | Usage |
|
|
62
|
+
| ---------------------------- | --------- | --------- | ----------------------- |
|
|
63
|
+
| `--color-text` | `#000` | `#e0e0e0` | Primary text |
|
|
64
|
+
| `--color-text-label` | `#424242` | `#cccccc` | Labels, headers |
|
|
65
|
+
| `--color-text-button` | `#616161` | `#cccccc` | Button text (inactive) |
|
|
66
|
+
| `--color-text-button-hover` | `#424242` | `#ffffff` | Button text on hover |
|
|
64
67
|
| `--color-text-button-active` | `#1f2937` | `#ffffff` | Button text when active |
|
|
65
|
-
| `--color-text-muted`
|
|
66
|
-
| `--color-text-toggle`
|
|
67
|
-
| `--color-text-input`
|
|
68
|
-
| `--color-text-placeholder`
|
|
68
|
+
| `--color-text-muted` | `#666` | `#999` | Secondary/muted text |
|
|
69
|
+
| `--color-text-toggle` | `#666` | `#999` | Toggle/switch labels |
|
|
70
|
+
| `--color-text-input` | `#000` | `#e0e0e0` | Input field text |
|
|
71
|
+
| `--color-text-placeholder` | `#9ca3af` | `#666` | Input placeholder text |
|
|
69
72
|
|
|
70
73
|
#### Background Colors
|
|
71
74
|
|
|
72
|
-
| Variable
|
|
73
|
-
|
|
74
|
-
| `--bg-box`
|
|
75
|
-
| `--bg-header`
|
|
76
|
-
| `--bg-footer`
|
|
77
|
-
| `--bg-button-hover`
|
|
78
|
-
| `--bg-button-active`
|
|
79
|
-
| `--bg-button-group`
|
|
80
|
-
| `--bg-input`
|
|
81
|
-
| `--bg-input-hover`
|
|
82
|
-
| `--bg-code-inline`
|
|
83
|
-
| `--bg-dropdown`
|
|
84
|
-
| `--bg-dropdown-option-hover`
|
|
85
|
-
| `--bg-dropdown-option-highlighted` | `#e3f2fd` | `#1e3a5f`
|
|
75
|
+
| Variable | Light | Dark | Usage |
|
|
76
|
+
| ---------------------------------- | --------- | ------------------------ | ----------------------------- |
|
|
77
|
+
| `--bg-box` | `#ffffff` | `#1e1e1e` | Main container background |
|
|
78
|
+
| `--bg-header` | `#f5f5f5` | `#252526` | Header background |
|
|
79
|
+
| `--bg-footer` | `#f5f5f5` | `#252526` | Footer background |
|
|
80
|
+
| `--bg-button-hover` | `#e8e8e8` | `#2a2d2e` | Button background on hover |
|
|
81
|
+
| `--bg-button-active` | `#ffffff` | `#1e1e1e` | Button background when active |
|
|
82
|
+
| `--bg-button-group` | `#f3f4f6` | `#2a2d2e` | Button group container |
|
|
83
|
+
| `--bg-input` | `#ffffff` | `#252526` | Input field background |
|
|
84
|
+
| `--bg-input-hover` | `#f9f9f9` | `#2a2d2e` | Input field on hover |
|
|
85
|
+
| `--bg-code-inline` | `#f9f9f9` | `rgba(255,255,255,0.05)` | Inline code background |
|
|
86
|
+
| `--bg-dropdown` | `#ffffff` | `#252526` | Dropdown menu background |
|
|
87
|
+
| `--bg-dropdown-option-hover` | `#f0f0f0` | `#2a2d2e` | Dropdown option on hover |
|
|
88
|
+
| `--bg-dropdown-option-highlighted` | `#e3f2fd` | `#1e3a5f` | Highlighted dropdown option |
|
|
86
89
|
|
|
87
90
|
#### Border Colors
|
|
88
91
|
|
|
89
|
-
| Variable
|
|
90
|
-
|
|
91
|
-
| `--border-box`
|
|
92
|
-
| `--border-header`
|
|
93
|
-
| `--border-footer`
|
|
94
|
-
| `--border-button-group` | `#d1d5db` | `#3c3c3c` | Button group borders
|
|
95
|
-
| `--border-input`
|
|
96
|
-
| `--border-input-focus`
|
|
92
|
+
| Variable | Light | Dark | Usage |
|
|
93
|
+
| ----------------------- | --------- | --------- | ------------------------- |
|
|
94
|
+
| `--border-box` | `#e0e0e0` | `#3c3c3c` | Main container border |
|
|
95
|
+
| `--border-header` | `#e0e0e0` | `#3c3c3c` | Header border |
|
|
96
|
+
| `--border-footer` | `#e0e0e0` | `#3c3c3c` | Footer border |
|
|
97
|
+
| `--border-button-group` | `#d1d5db` | `#3c3c3c` | Button group borders |
|
|
98
|
+
| `--border-input` | `#d1d5db` | `#3c3c3c` | Input field border |
|
|
99
|
+
| `--border-input-focus` | `#3b82f6` | `#4a90e2` | Input border when focused |
|
|
97
100
|
|
|
98
101
|
#### Button Colors
|
|
99
102
|
|
|
100
|
-
| Variable
|
|
101
|
-
|
|
102
|
-
| `--color-button-primary`
|
|
103
|
-
| `--color-button-primary-hover` | `#2563eb` | `#357abd` | Primary button on hover
|
|
104
|
-
| `--color-button-primary-text`
|
|
105
|
-
| `--color-button-danger`
|
|
106
|
-
| `--color-button-danger-hover`
|
|
107
|
-
| `--color-button-danger-text`
|
|
103
|
+
| Variable | Light | Dark | Usage |
|
|
104
|
+
| ------------------------------ | --------- | --------- | ------------------------- |
|
|
105
|
+
| `--color-button-primary` | `#3b82f6` | `#4a90e2` | Primary button background |
|
|
106
|
+
| `--color-button-primary-hover` | `#2563eb` | `#357abd` | Primary button on hover |
|
|
107
|
+
| `--color-button-primary-text` | `#ffffff` | `#ffffff` | Primary button text |
|
|
108
|
+
| `--color-button-danger` | `#ef4444` | `#ef4444` | Danger button background |
|
|
109
|
+
| `--color-button-danger-hover` | `#dc2626` | `#dc2626` | Danger button on hover |
|
|
110
|
+
| `--color-button-danger-text` | `#ffffff` | `#ffffff` | Danger button text |
|
|
108
111
|
|
|
109
112
|
#### Status Colors
|
|
110
113
|
|
|
111
|
-
| Variable
|
|
112
|
-
|
|
113
|
-
| `--color-status-enabled`
|
|
114
|
-
| `--color-status-disabled` | `#9ca3af` | `#9ca3af` | Disabled state
|
|
115
|
-
| `--color-status-warning`
|
|
114
|
+
| Variable | Light | Dark | Usage |
|
|
115
|
+
| ------------------------- | --------- | --------- | --------------------- |
|
|
116
|
+
| `--color-status-enabled` | `#22c55e` | `#22c55e` | Enabled/success state |
|
|
117
|
+
| `--color-status-disabled` | `#9ca3af` | `#9ca3af` | Disabled state |
|
|
118
|
+
| `--color-status-warning` | `#f59e0b` | `#f59e0b` | Warning state |
|
|
116
119
|
|
|
117
120
|
#### Highlight Colors
|
|
118
121
|
|
|
119
122
|
Used for code highlighting and data attribute visualization.
|
|
120
123
|
|
|
121
|
-
| Variable
|
|
122
|
-
|
|
123
|
-
| `--color-highlight-primary` | `#01b5e2`
|
|
124
|
-
| `--highlight-globals`
|
|
125
|
-
| `--highlight-context`
|
|
126
|
-
| `--highlight-entity`
|
|
127
|
-
| `--highlight-property`
|
|
128
|
-
| `--highlight-action`
|
|
129
|
-
| `--highlight-background`
|
|
130
|
-
| `--highlight-text`
|
|
131
|
-
| `--highlight-hover`
|
|
132
|
-
| `--highlight-separator`
|
|
124
|
+
| Variable | Light | Dark | Usage |
|
|
125
|
+
| --------------------------- | ------------------------ | ------------------------ | ---------------------------- |
|
|
126
|
+
| `--color-highlight-primary` | `#01b5e2` | `#01b5e2` | Primary highlight color |
|
|
127
|
+
| `--highlight-globals` | `#4fc3f7cc` | `#4fc3f7cc` | Global properties highlight |
|
|
128
|
+
| `--highlight-context` | `#ffbd44cc` | `#ffbd44cc` | Context properties highlight |
|
|
129
|
+
| `--highlight-entity` | `#00ca4ecc` | `#00ca4ecc` | Entity name highlight |
|
|
130
|
+
| `--highlight-property` | `#ff605ccc` | `#ff605ccc` | Property name highlight |
|
|
131
|
+
| `--highlight-action` | `#9900ffcc` | `#9900ffcc` | Action name highlight |
|
|
132
|
+
| `--highlight-background` | `#1f2937` | `#1f2937` | Highlight tooltip background |
|
|
133
|
+
| `--highlight-text` | `#9ca3af` | `#9ca3af` | Highlight tooltip text |
|
|
134
|
+
| `--highlight-hover` | `rgba(255,255,255,0.05)` | `rgba(255,255,255,0.05)` | Highlight hover effect |
|
|
135
|
+
| `--highlight-separator` | `rgba(255,255,255,0.05)` | `rgba(255,255,255,0.05)` | Separator in highlights |
|
|
133
136
|
|
|
134
137
|
#### Typography
|
|
135
138
|
|
|
136
|
-
| Variable
|
|
137
|
-
|
|
138
|
-
| `--font-family-base`
|
|
139
|
-
| `--font-mono`
|
|
140
|
-
| `--font-size-base`
|
|
141
|
-
| `--font-size-label`
|
|
142
|
-
| `--font-size-toggle`
|
|
143
|
-
| `--font-size-highlight-button` | `0.75rem`
|
|
144
|
-
| `--line-height-base`
|
|
145
|
-
| `--font-weight-normal`
|
|
146
|
-
| `--font-weight-semibold`
|
|
139
|
+
| Variable | Light | Dark | Usage |
|
|
140
|
+
| ------------------------------ | ------------------------------- | ---- | -------------------------- |
|
|
141
|
+
| `--font-family-base` | `system-ui, -apple-system, ...` | Same | Base font family |
|
|
142
|
+
| `--font-mono` | `'SF Mono', 'Monaco', ...` | Same | Monospace font for code |
|
|
143
|
+
| `--font-size-base` | `14px` | Same | Base font size |
|
|
144
|
+
| `--font-size-label` | `13px` | Same | Label font size |
|
|
145
|
+
| `--font-size-toggle` | `12px` | Same | Toggle/switch font size |
|
|
146
|
+
| `--font-size-highlight-button` | `0.75rem` | Same | Highlight button font size |
|
|
147
|
+
| `--line-height-base` | `1.5` | Same | Base line height |
|
|
148
|
+
| `--font-weight-normal` | `400` | Same | Normal font weight |
|
|
149
|
+
| `--font-weight-semibold` | `600` | Same | Semibold font weight |
|
|
147
150
|
|
|
148
151
|
#### Spacing & Layout
|
|
149
152
|
|
|
150
|
-
| Variable
|
|
151
|
-
|
|
152
|
-
| `--spacing-header`
|
|
153
|
-
| `--spacing-footer`
|
|
154
|
-
| `--spacing-button`
|
|
155
|
-
| `--spacing-button-group`
|
|
156
|
-
| `--spacing-grid-gap`
|
|
157
|
-
| `--grid-min-box-width`
|
|
158
|
-
| `--grid-row-min-height`
|
|
159
|
-
| `--grid-row-max-height`
|
|
160
|
-
| `--grid-box-max-height-mobile` | `500px`
|
|
153
|
+
| Variable | Light | Dark | Usage |
|
|
154
|
+
| ------------------------------ | ---------- | ---- | ------------------------------ |
|
|
155
|
+
| `--spacing-header` | `6px 10px` | Same | Header padding |
|
|
156
|
+
| `--spacing-footer` | `6px 10px` | Same | Footer padding |
|
|
157
|
+
| `--spacing-button` | `4px 8px` | Same | Button padding |
|
|
158
|
+
| `--spacing-button-group` | `1px` | Same | Gap between button group items |
|
|
159
|
+
| `--spacing-grid-gap` | `12px` | Same | Grid gap spacing |
|
|
160
|
+
| `--grid-min-box-width` | `350px` | Same | Minimum box width in grid |
|
|
161
|
+
| `--grid-row-min-height` | `250px` | Same | Minimum grid row height |
|
|
162
|
+
| `--grid-row-max-height` | `450px` | Same | Maximum grid row height |
|
|
163
|
+
| `--grid-box-max-height-mobile` | `500px` | Same | Max box height on mobile |
|
|
161
164
|
|
|
162
165
|
#### Border Radius
|
|
163
166
|
|
|
164
|
-
| Variable
|
|
165
|
-
|
|
166
|
-
| `--radius-box`
|
|
167
|
-
| `--radius-button`
|
|
168
|
-
| `--radius-button-group`
|
|
167
|
+
| Variable | Light | Dark | Usage |
|
|
168
|
+
| --------------------------- | ----- | ---- | ------------------------------ |
|
|
169
|
+
| `--radius-box` | `4px` | Same | Main container border radius |
|
|
170
|
+
| `--radius-button` | `3px` | Same | Button border radius |
|
|
171
|
+
| `--radius-button-group` | `4px` | Same | Button group border radius |
|
|
169
172
|
| `--radius-highlight-button` | `6px` | Same | Highlight button border radius |
|
|
170
173
|
|
|
171
174
|
#### Shadows
|
|
172
175
|
|
|
173
|
-
| Variable
|
|
174
|
-
|
|
176
|
+
| Variable | Light | Dark | Usage |
|
|
177
|
+
| ------------------------ | --------------------------- | --------------------------- | -------------------- |
|
|
175
178
|
| `--shadow-button-active` | `0 1px 2px rgba(0,0,0,0.1)` | `0 1px 2px rgba(0,0,0,0.3)` | Active button shadow |
|
|
176
|
-
| `--shadow-dropdown`
|
|
179
|
+
| `--shadow-dropdown` | `0 4px 6px rgba(0,0,0,0.1)` | `0 4px 6px rgba(0,0,0,0.5)` | Dropdown shadow |
|
|
177
180
|
|
|
178
181
|
#### Monaco Editor
|
|
179
182
|
|
|
180
|
-
| Variable
|
|
181
|
-
|
|
182
|
-
| `--monaco-font-size`
|
|
183
|
-
| `--monaco-line-height` | `1.5`
|
|
183
|
+
| Variable | Light | Dark | Usage |
|
|
184
|
+
| ---------------------- | ------ | ---- | ------------------------- |
|
|
185
|
+
| `--monaco-font-size` | `13px` | Same | Monaco editor font size |
|
|
186
|
+
| `--monaco-line-height` | `1.5` | Same | Monaco editor line height |
|
|
184
187
|
|
|
185
188
|
### Customization Examples
|
|
186
189
|
|
|
@@ -227,11 +230,13 @@ Used for code highlighting and data attribute visualization.
|
|
|
227
230
|
|
|
228
231
|
## Grid System
|
|
229
232
|
|
|
230
|
-
Explorer uses a sophisticated Grid component with three height modes for
|
|
233
|
+
Explorer uses a sophisticated Grid component with three height modes for
|
|
234
|
+
responsive layouts.
|
|
231
235
|
|
|
232
236
|
### Height Modes
|
|
233
237
|
|
|
234
238
|
**1. Equal Heights** - All boxes in same row share the tallest content height
|
|
239
|
+
|
|
235
240
|
```tsx
|
|
236
241
|
<Grid columns={3} heightMode="equal">
|
|
237
242
|
<CodeBox code={event} />
|
|
@@ -241,6 +246,7 @@ Explorer uses a sophisticated Grid component with three height modes for respons
|
|
|
241
246
|
```
|
|
242
247
|
|
|
243
248
|
**2. Auto Heights** - Each box sized independently to content
|
|
249
|
+
|
|
244
250
|
```tsx
|
|
245
251
|
<Grid columns={3} heightMode="auto">
|
|
246
252
|
<CodeBox code={shortEvent} />
|
|
@@ -249,7 +255,9 @@ Explorer uses a sophisticated Grid component with three height modes for respons
|
|
|
249
255
|
</Grid>
|
|
250
256
|
```
|
|
251
257
|
|
|
252
|
-
**3. Synced Heights** - Boxes in same row share height, different rows can
|
|
258
|
+
**3. Synced Heights** - Boxes in same row share height, different rows can
|
|
259
|
+
differ
|
|
260
|
+
|
|
253
261
|
```tsx
|
|
254
262
|
<Grid columns={3} heightMode="synced">
|
|
255
263
|
<CodeBox code={event} />
|
|
@@ -266,21 +274,27 @@ Explorer uses a sophisticated Grid component with three height modes for respons
|
|
|
266
274
|
|
|
267
275
|
The Grid height synchronization required sophisticated coordination because:
|
|
268
276
|
|
|
269
|
-
1. **Monaco reports content-only height** - Excludes header (40px) and border
|
|
270
|
-
|
|
277
|
+
1. **Monaco reports content-only height** - Excludes header (40px) and border
|
|
278
|
+
(2px)
|
|
279
|
+
2. **Box needs total height** - Must add header + border for consistent row
|
|
280
|
+
sizing
|
|
271
281
|
3. **Height changes cascade** - Content → Monaco → Box → Grid → Row
|
|
272
282
|
4. **Race conditions during mount** - Components mount asynchronously
|
|
273
283
|
5. **Automatic layout detection** - Must detect container resize events
|
|
274
284
|
|
|
275
285
|
**Key Files:**
|
|
276
|
-
|
|
277
|
-
- [
|
|
286
|
+
|
|
287
|
+
- [useMonacoHeight.ts](./src/hooks/useMonacoHeight.ts) - Monaco content
|
|
288
|
+
measurement
|
|
289
|
+
- [GridHeightContext.tsx](./src/contexts/GridHeightContext.tsx) -
|
|
290
|
+
Cross-component coordination
|
|
278
291
|
- [box.tsx](./src/components/molecules/box.tsx) - Total height calculation
|
|
279
292
|
- [grid.tsx](./src/components/organisms/grid.tsx) - Row height orchestration
|
|
280
293
|
|
|
281
294
|
**Common Pitfalls:**
|
|
282
295
|
|
|
283
|
-
1. **Forgetting Box overhead** - Always add header (40px) + border (2px) to
|
|
296
|
+
1. **Forgetting Box overhead** - Always add header (40px) + border (2px) to
|
|
297
|
+
Monaco height
|
|
284
298
|
2. **Not handling async layout** - Monaco's layout() is async, use callbacks
|
|
285
299
|
3. **ResizeObserver loops** - Debounce layout calls with requestAnimationFrame
|
|
286
300
|
4. **Theme-specific heights** - Test both light and dark themes for consistency
|
|
@@ -325,7 +339,8 @@ const rowHeight = Math.max(...boxHeightsInRow); // Use tallest box
|
|
|
325
339
|
|
|
326
340
|
### Theme Integration
|
|
327
341
|
|
|
328
|
-
Explorer includes two Monaco themes that automatically sync with `data-theme`
|
|
342
|
+
Explorer includes two Monaco themes that automatically sync with `data-theme`
|
|
343
|
+
attribute:
|
|
329
344
|
|
|
330
345
|
- **`elbTheme-dark`** - Dark theme based on Prism Palenight
|
|
331
346
|
- **`elbTheme-light`** - Light theme based on GitHub syntax highlighting
|
|
@@ -336,8 +351,10 @@ Explorer includes two Monaco themes that automatically sync with `data-theme` at
|
|
|
336
351
|
// Theme detection in code.tsx
|
|
337
352
|
const checkTheme = () => {
|
|
338
353
|
const dataTheme = getDataTheme();
|
|
339
|
-
const isDark =
|
|
340
|
-
|
|
354
|
+
const isDark =
|
|
355
|
+
dataTheme === 'dark' ||
|
|
356
|
+
(dataTheme === null &&
|
|
357
|
+
window.matchMedia('(prefers-color-scheme: dark)').matches);
|
|
341
358
|
const newTheme = isDark ? 'elbTheme-dark' : 'elbTheme-light';
|
|
342
359
|
setMonacoTheme(newTheme);
|
|
343
360
|
};
|
|
@@ -347,24 +364,25 @@ const checkTheme = () => {
|
|
|
347
364
|
|
|
348
365
|
Current color scheme matches Prism Palenight:
|
|
349
366
|
|
|
350
|
-
| Token Type
|
|
351
|
-
|
|
352
|
-
| Comments
|
|
353
|
-
| Strings
|
|
354
|
-
| Numbers
|
|
355
|
-
| Functions
|
|
356
|
-
| Delimiters
|
|
357
|
-
| Operators
|
|
358
|
-
| Keywords
|
|
359
|
-
| Types/Classes
|
|
360
|
-
| Variables
|
|
361
|
-
| Booleans
|
|
362
|
-
| Tags (HTML)
|
|
363
|
-
| Attributes (HTML) | `#bfc7d5` | Light gray
|
|
367
|
+
| Token Type | Color | Usage |
|
|
368
|
+
| ----------------- | --------- | ------------------------- |
|
|
369
|
+
| Comments | `#697098` | Gray, italic |
|
|
370
|
+
| Strings | `#c3e88d` | Green |
|
|
371
|
+
| Numbers | `#f78c6c` | Orange |
|
|
372
|
+
| Functions | `#82aaff` | Blue |
|
|
373
|
+
| Delimiters | `#c792ea` | Purple (braces, brackets) |
|
|
374
|
+
| Operators | `#89ddff` | Cyan |
|
|
375
|
+
| Keywords | `#c084fc` | Bright purple, italic |
|
|
376
|
+
| Types/Classes | `#ffcb6b` | Yellow/gold |
|
|
377
|
+
| Variables | `#bfc7d5` | Light gray |
|
|
378
|
+
| Booleans | `#ff5874` | Red |
|
|
379
|
+
| Tags (HTML) | `#bfc7d5` | Light gray |
|
|
380
|
+
| Attributes (HTML) | `#bfc7d5` | Light gray |
|
|
364
381
|
|
|
365
382
|
### Language-Specific Token Rules
|
|
366
383
|
|
|
367
|
-
**Critical**: Monaco uses specific token names per language. Always add
|
|
384
|
+
**Critical**: Monaco uses specific token names per language. Always add
|
|
385
|
+
language-specific rules for proper highlighting:
|
|
368
386
|
|
|
369
387
|
```typescript
|
|
370
388
|
// Generic rule (may not work)
|
|
@@ -382,29 +400,30 @@ Current color scheme matches Prism Palenight:
|
|
|
382
400
|
|
|
383
401
|
```typescript
|
|
384
402
|
// HTML
|
|
385
|
-
'entity.name.tag.html'
|
|
386
|
-
'attribute.name.html'
|
|
387
|
-
'attribute.value.html'
|
|
388
|
-
'delimiter.html'
|
|
389
|
-
'comment.html'
|
|
403
|
+
'entity.name.tag.html'; // <div>
|
|
404
|
+
'attribute.name.html'; // class=""
|
|
405
|
+
'attribute.value.html'; // ="value"
|
|
406
|
+
'delimiter.html'; // < > / =
|
|
407
|
+
'comment.html'; // <!-- -->
|
|
390
408
|
|
|
391
409
|
// JSON
|
|
392
|
-
'string.key.json'
|
|
393
|
-
'string.value.json'
|
|
394
|
-
'support.type.property-name.json' // Object keys
|
|
410
|
+
'string.key.json'; // "key":
|
|
411
|
+
'string.value.json'; // : "value"
|
|
412
|
+
'support.type.property-name.json'; // Object keys
|
|
395
413
|
|
|
396
414
|
// JavaScript/TypeScript
|
|
397
|
-
'variable.parameter.ts'
|
|
398
|
-
'support.type.primitive.ts'
|
|
399
|
-
'entity.name.type.ts'
|
|
400
|
-
'keyword.operator.type.ts'
|
|
415
|
+
'variable.parameter.ts'; // Function parameters
|
|
416
|
+
'support.type.primitive.ts'; // string, number, etc.
|
|
417
|
+
'entity.name.type.ts'; // Type names
|
|
418
|
+
'keyword.operator.type.ts'; // : => |
|
|
401
419
|
```
|
|
402
420
|
|
|
403
421
|
### Local Loading (Not CDN)
|
|
404
422
|
|
|
405
423
|
**Problem:** Monaco's default behavior loads from CDN, causing CORS issues.
|
|
406
424
|
|
|
407
|
-
**Solution:** Static synchronous imports in
|
|
425
|
+
**Solution:** Static synchronous imports in
|
|
426
|
+
[code.tsx](./src/components/atoms/code.tsx):
|
|
408
427
|
|
|
409
428
|
```typescript
|
|
410
429
|
// Static imports for Monaco and workers
|
|
@@ -428,6 +447,7 @@ if (typeof window !== 'undefined') {
|
|
|
428
447
|
```
|
|
429
448
|
|
|
430
449
|
**Why It Works:**
|
|
450
|
+
|
|
431
451
|
- Static imports execute synchronously at module load time
|
|
432
452
|
- `loader.config()` runs BEFORE any `<Editor>` component mounts
|
|
433
453
|
- No network requests to CDN
|
|
@@ -502,6 +522,7 @@ Scopes:
|
|
|
502
522
|
**Step 3: Verify in Browser DevTools**
|
|
503
523
|
|
|
504
524
|
Inspect rendered Monaco token span:
|
|
525
|
+
|
|
505
526
|
```html
|
|
506
527
|
<span class="mtk5">const</span>
|
|
507
528
|
```
|
|
@@ -510,7 +531,8 @@ Check computed styles for `.mtk5` - should have your foreground color.
|
|
|
510
531
|
|
|
511
532
|
### TypeScript IntelliSense
|
|
512
533
|
|
|
513
|
-
Monaco Editor provides IntelliSense for walkerOS packages through a virtual file
|
|
534
|
+
Monaco Editor provides IntelliSense for walkerOS packages through a virtual file
|
|
535
|
+
system.
|
|
514
536
|
|
|
515
537
|
**How It Works:**
|
|
516
538
|
|
|
@@ -524,6 +546,7 @@ User types code → Monaco TypeScript Service → Virtual File System
|
|
|
524
546
|
```
|
|
525
547
|
|
|
526
548
|
**Bundled Types** (included at build time):
|
|
549
|
+
|
|
527
550
|
- `@walkeros/core`
|
|
528
551
|
- `@walkeros/collector`
|
|
529
552
|
- `@walkeros/web-source-browser`
|
|
@@ -531,6 +554,7 @@ User types code → Monaco TypeScript Service → Virtual File System
|
|
|
531
554
|
**Setup** (automatic):
|
|
532
555
|
|
|
533
556
|
The [monaco-types.ts](./src/utils/monaco-types.ts) utility:
|
|
557
|
+
|
|
534
558
|
1. Registers walkerOS type definitions with Monaco
|
|
535
559
|
2. Creates virtual files in Monaco's file system
|
|
536
560
|
3. Provides autocomplete and type checking
|
|
@@ -547,6 +571,63 @@ const handleBeforeMount = (monaco: typeof import('monaco-editor')) => {
|
|
|
547
571
|
};
|
|
548
572
|
```
|
|
549
573
|
|
|
574
|
+
### JSON IntelliSense
|
|
575
|
+
|
|
576
|
+
CodeBox supports JSON Schema-driven IntelliSense via the `jsonSchema` prop. When
|
|
577
|
+
provided, the editor offers autocomplete, validation, and hover documentation
|
|
578
|
+
for JSON content.
|
|
579
|
+
|
|
580
|
+
**How It Works:**
|
|
581
|
+
|
|
582
|
+
```
|
|
583
|
+
jsonSchema prop → Schema Registry → Monaco JSON Language Service
|
|
584
|
+
↓
|
|
585
|
+
Autocomplete, validation squiggles, hover docs
|
|
586
|
+
```
|
|
587
|
+
|
|
588
|
+
The [monaco-json-schema.ts](./src/utils/monaco-json-schema.ts) registry manages
|
|
589
|
+
schemas globally. Each Code instance with a `jsonSchema` prop gets a unique
|
|
590
|
+
model URI (`path`), and the registry calls `setDiagnosticsOptions` with all
|
|
591
|
+
active schemas whenever one is added or removed.
|
|
592
|
+
|
|
593
|
+
**Usage:**
|
|
594
|
+
|
|
595
|
+
```tsx
|
|
596
|
+
// Static schema (e.g., Flow.Setup)
|
|
597
|
+
import { setupV2JsonSchema } from '@walkeros/core/dev';
|
|
598
|
+
|
|
599
|
+
<CodeBox
|
|
600
|
+
code={flowJson}
|
|
601
|
+
onChange={setFlowJson}
|
|
602
|
+
language="json"
|
|
603
|
+
showFormat
|
|
604
|
+
jsonSchema={setupV2JsonSchema as Record<string, unknown>}
|
|
605
|
+
/>;
|
|
606
|
+
```
|
|
607
|
+
|
|
608
|
+
**What the prop enables:**
|
|
609
|
+
|
|
610
|
+
- `quickSuggestions` — auto-popup on typing (normally disabled)
|
|
611
|
+
- `renderValidationDecorations` — red squiggles for schema violations
|
|
612
|
+
- `hover` — tooltip descriptions from schema `description` fields
|
|
613
|
+
- Unique model `path` — auto-generated to isolate schema per editor instance
|
|
614
|
+
|
|
615
|
+
**Advanced: Direct Registry Access:**
|
|
616
|
+
|
|
617
|
+
```typescript
|
|
618
|
+
import {
|
|
619
|
+
registerJsonSchema,
|
|
620
|
+
unregisterJsonSchema,
|
|
621
|
+
generateModelPath,
|
|
622
|
+
} from '@walkeros/explorer';
|
|
623
|
+
|
|
624
|
+
// For dynamic schemas (e.g., package-specific settings fetched from CDN)
|
|
625
|
+
const path = generateModelPath();
|
|
626
|
+
registerJsonSchema(path, fetchedSchema);
|
|
627
|
+
// ... later
|
|
628
|
+
unregisterJsonSchema(path);
|
|
629
|
+
```
|
|
630
|
+
|
|
550
631
|
---
|
|
551
632
|
|
|
552
633
|
## SCSS Architecture
|
|
@@ -590,7 +671,8 @@ src/styles/
|
|
|
590
671
|
2. Use `--font-family-mono` (correct: `--font-mono`)
|
|
591
672
|
3. Hardcode colors, spacing, or font sizes
|
|
592
673
|
4. Use inline `style` attributes
|
|
593
|
-
5. Skip wrapper pattern for widgets: `elb-rjsf-widget` →
|
|
674
|
+
5. Skip wrapper pattern for widgets: `elb-rjsf-widget` →
|
|
675
|
+
`elb-{name}-widget-wrapper`
|
|
594
676
|
|
|
595
677
|
### Example Component SCSS
|
|
596
678
|
|
|
@@ -672,21 +754,26 @@ Don't add CSS variables for:
|
|
|
672
754
|
### Color Selection Guidelines
|
|
673
755
|
|
|
674
756
|
**Primary Colors:**
|
|
757
|
+
|
|
675
758
|
- Use for interactive elements (buttons, links, focus states)
|
|
676
759
|
- Should have 4.5:1 contrast ratio with background
|
|
677
760
|
- Provide variants (hover, active, disabled)
|
|
678
761
|
|
|
679
762
|
**Text Colors:**
|
|
763
|
+
|
|
680
764
|
- Primary text: 7:1 contrast minimum
|
|
681
765
|
- Secondary text: 4.5:1 contrast minimum
|
|
682
|
-
- Always test with
|
|
766
|
+
- Always test with
|
|
767
|
+
[WebAIM Contrast Checker](https://webaim.org/resources/contrastchecker/)
|
|
683
768
|
|
|
684
769
|
**Syntax Highlighting:**
|
|
770
|
+
|
|
685
771
|
- Follow established palette (Prism Palenight for dark, GitHub for light)
|
|
686
772
|
- Ensure readability (4.5:1 minimum for code)
|
|
687
773
|
- Use semantic colors (green for strings, red for errors)
|
|
688
774
|
|
|
689
775
|
**Accessibility:**
|
|
776
|
+
|
|
690
777
|
- All interactive elements: 3:1 contrast with background minimum
|
|
691
778
|
- Focus indicators: 3:1 contrast with adjacent colors
|
|
692
779
|
- Test with multiple color vision deficiencies
|
|
@@ -766,14 +853,14 @@ export function YourComponent({
|
|
|
766
853
|
|
|
767
854
|
```css
|
|
768
855
|
/* custom-theme.css */
|
|
769
|
-
[data-theme=
|
|
856
|
+
[data-theme='dark'] {
|
|
770
857
|
--color-button-primary: #your-brand-color;
|
|
771
858
|
--bg-app: #your-dark-bg;
|
|
772
859
|
--bg-box: #your-dark-box-bg;
|
|
773
860
|
--color-text: #your-dark-text;
|
|
774
861
|
}
|
|
775
862
|
|
|
776
|
-
[data-theme=
|
|
863
|
+
[data-theme='light'] {
|
|
777
864
|
--color-button-primary: #your-brand-color;
|
|
778
865
|
--bg-app: #your-light-bg;
|
|
779
866
|
--bg-box: #your-light-box-bg;
|
|
@@ -806,6 +893,7 @@ import './custom-theme.css'; // Overrides Explorer defaults
|
|
|
806
893
|
**Cause:** Monaco theme not registered before Editor mounts
|
|
807
894
|
|
|
808
895
|
**Solution:** Ensure `handleBeforeMount` registers themes:
|
|
896
|
+
|
|
809
897
|
```typescript
|
|
810
898
|
const handleBeforeMount = (monaco: typeof import('monaco-editor')) => {
|
|
811
899
|
registerAllThemes(monaco);
|
|
@@ -820,6 +908,7 @@ const handleBeforeMount = (monaco: typeof import('monaco-editor')) => {
|
|
|
820
908
|
**Cause:** Missing language-specific token rules
|
|
821
909
|
|
|
822
910
|
**Solution:** Add language variant rules:
|
|
911
|
+
|
|
823
912
|
```typescript
|
|
824
913
|
{ token: 'string', foreground: 'c3e88d' }, // Generic
|
|
825
914
|
{ token: 'string.html', foreground: 'c3e88d' }, // HTML-specific
|
|
@@ -833,6 +922,7 @@ const handleBeforeMount = (monaco: typeof import('monaco-editor')) => {
|
|
|
833
922
|
**Cause:** `loader.config()` called after Editor mounts
|
|
834
923
|
|
|
835
924
|
**Solution:** Use static imports at module level:
|
|
925
|
+
|
|
836
926
|
```typescript
|
|
837
927
|
// Top of file - runs synchronously
|
|
838
928
|
import * as monaco from 'monaco-editor';
|
|
@@ -848,6 +938,7 @@ if (typeof window !== 'undefined') {
|
|
|
848
938
|
**Cause:** Monaco's `automaticLayout: true` missed resize event
|
|
849
939
|
|
|
850
940
|
**Solution:** Add ResizeObserver to force layout:
|
|
941
|
+
|
|
851
942
|
```typescript
|
|
852
943
|
const resizeObserver = new ResizeObserver(() => {
|
|
853
944
|
requestAnimationFrame(() => editor.layout());
|
|
@@ -864,6 +955,7 @@ resizeObserver.observe(container);
|
|
|
864
955
|
**Cause:** Box height calculation missing header/border
|
|
865
956
|
|
|
866
957
|
**Solution:** Verify Box adds header (40px) + border (2px):
|
|
958
|
+
|
|
867
959
|
```typescript
|
|
868
960
|
const boxHeight = monacoHeight + 40 + 2;
|
|
869
961
|
```
|
|
@@ -875,6 +967,7 @@ const boxHeight = monacoHeight + 40 + 2;
|
|
|
875
967
|
**Cause:** Flex container constraints not set
|
|
876
968
|
|
|
877
969
|
**Solution:** Apply flex constraints to Grid:
|
|
970
|
+
|
|
878
971
|
```scss
|
|
879
972
|
.elb-grid {
|
|
880
973
|
display: flex;
|
|
@@ -896,6 +989,7 @@ const boxHeight = monacoHeight + 40 + 2;
|
|
|
896
989
|
**Cause:** Race condition between Monaco layout and Grid calculation
|
|
897
990
|
|
|
898
991
|
**Solution:** Use `requestAnimationFrame` to batch updates:
|
|
992
|
+
|
|
899
993
|
```typescript
|
|
900
994
|
requestAnimationFrame(() => {
|
|
901
995
|
editor.layout();
|
|
@@ -912,6 +1006,7 @@ requestAnimationFrame(() => {
|
|
|
912
1006
|
**Cause:** Monaco theme name doesn't match data-theme value
|
|
913
1007
|
|
|
914
1008
|
**Solution:** Map data-theme to Monaco theme name:
|
|
1009
|
+
|
|
915
1010
|
```typescript
|
|
916
1011
|
const themeName = dataTheme === 'dark' ? 'elbTheme-dark' : 'elbTheme-light';
|
|
917
1012
|
setMonacoTheme(themeName);
|
|
@@ -924,6 +1019,7 @@ setMonacoTheme(themeName);
|
|
|
924
1019
|
**Cause:** Components caching old CSS variable values
|
|
925
1020
|
|
|
926
1021
|
**Solution:** CSS variables update immediately - check for hard-coded colors:
|
|
1022
|
+
|
|
927
1023
|
```scss
|
|
928
1024
|
// Wrong
|
|
929
1025
|
.component {
|
|
@@ -943,16 +1039,19 @@ setMonacoTheme(themeName);
|
|
|
943
1039
|
### November 2025
|
|
944
1040
|
|
|
945
1041
|
**HTML Token Standardization**
|
|
1042
|
+
|
|
946
1043
|
- Changed HTML tag colors from red (#ff5572) to light gray (#bfc7d5)
|
|
947
1044
|
- Changed HTML attribute colors from green (#c3e88d) to light gray (#bfc7d5)
|
|
948
1045
|
- Kept attribute string values green for consistency
|
|
949
1046
|
- Added comprehensive HTML-specific token rules
|
|
950
1047
|
|
|
951
1048
|
**Debug Logging Cleanup**
|
|
1049
|
+
|
|
952
1050
|
- Removed all console.log statements from production code
|
|
953
1051
|
- Cleaned up code.tsx, monaco-setup.ts, theme files
|
|
954
1052
|
|
|
955
1053
|
**Documentation Consolidation**
|
|
1054
|
+
|
|
956
1055
|
- Created unified STYLE.md as single source of truth
|
|
957
1056
|
- Archived historical docs (STYLE.md, THEME.md, etc.)
|
|
958
1057
|
- Eliminated ~30% duplicate content
|
|
@@ -960,16 +1059,19 @@ setMonacoTheme(themeName);
|
|
|
960
1059
|
### October 2025
|
|
961
1060
|
|
|
962
1061
|
**Monaco Theme Rename**
|
|
1062
|
+
|
|
963
1063
|
- Renamed `palenight` theme to `elbTheme-dark`
|
|
964
1064
|
- Renamed `lighthouse` theme to `elbTheme-light`
|
|
965
1065
|
- Updated all references
|
|
966
1066
|
|
|
967
1067
|
**Local Monaco Loading**
|
|
1068
|
+
|
|
968
1069
|
- Migrated from CDN to local npm package loading
|
|
969
1070
|
- Added static imports for Monaco and language workers
|
|
970
1071
|
- Configured MonacoEnvironment for Vite workers
|
|
971
1072
|
|
|
972
1073
|
**Language-Specific Token Rules**
|
|
1074
|
+
|
|
973
1075
|
- Added HTML-specific tokens
|
|
974
1076
|
- Added JSON-specific tokens
|
|
975
1077
|
- Added JavaScript/TypeScript-specific tokens
|
|
@@ -978,11 +1080,13 @@ setMonacoTheme(themeName);
|
|
|
978
1080
|
### September 2025
|
|
979
1081
|
|
|
980
1082
|
**Website Color Alignment**
|
|
1083
|
+
|
|
981
1084
|
- Aligned Explorer colors with walkerOS website
|
|
982
1085
|
- Updated Prism Palenight colors for dark theme
|
|
983
1086
|
- Updated GitHub colors for light theme
|
|
984
1087
|
|
|
985
1088
|
**Contrast Improvements**
|
|
1089
|
+
|
|
986
1090
|
- Fixed low-contrast text issues (7:1 for primary text)
|
|
987
1091
|
- Fixed button contrast issues (4.5:1 minimum)
|
|
988
1092
|
- Fixed border contrast issues (3:1 minimum)
|