@rolldate/mcp 1.0.0 → 1.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.
@@ -1,2 +1,2 @@
1
- #!/usr/bin/env node
2
- import '../src/index.js'
1
+ #!/usr/bin/env node
2
+ import '../src/index.js'
package/package.json CHANGED
@@ -3,8 +3,8 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.0.0",
7
- "description": "MCP server for RollDate — install assets, snippets, API reference for AI agents (Cursor & other IDEs)",
6
+ "version": "1.1.0",
7
+ "description": "MCP server for RollDate 1.1 — install assets, snippets, API reference for AI agents (Cursor & other IDEs)",
8
8
  "type": "module",
9
9
  "bin": {
10
10
  "rolldate-mcp": "bin/rolldate-mcp.js"
package/src/catalog.js CHANGED
@@ -15,6 +15,8 @@ export const OPTIONS = [
15
15
  { name: 'locale', type: 'string', default: '—', description: 'Browser locale hint for default dateFormat' },
16
16
  { name: 'startWeekFromMonday', type: 'boolean', default: 'true', description: 'Week starts on Monday when true' },
17
17
  { name: 'disabledDates', type: 'string[]', default: '[]', description: 'Dates that cannot be selected' },
18
+ { name: 'highlightDates', type: '(string|Date|{date,color?,colors?})[]', default: '[]', description: 'Dot markers on days; optional color(s) per date' },
19
+ { name: 'rangePresets', type: 'RangePreset[]', default: '[]', description: 'Quick range buttons (range mode); getRange(picker) returns [start,end]' },
18
20
  { name: 'closeOnSelect', type: 'boolean', default: 'true', description: 'Close popup after selection (single mode)' },
19
21
  { name: 'triggerSelector', type: 'string', default: '—', description: 'CSS selector for open trigger' },
20
22
  { name: 'monthsNames', type: 'string[]', default: 'English month names', description: 'Full month labels' },
@@ -37,10 +39,20 @@ export const METHODS = [
37
39
  { name: 'close()', description: 'Hide popup' },
38
40
  { name: 'selectToday()', description: 'Select today (respects disabled dates; applies time if enabled)' },
39
41
  { name: 'clearSelection()', description: 'Clear current selection' },
42
+ { name: 'goToDate(dateLike)', description: 'Navigate calendar to date without selecting' },
43
+ { name: 'getValue()', description: 'Current value: Date|null (single) or Date[] (range/multi)' },
44
+ { name: 'setValue(value)', description: 'Set selection programmatically; null clears' },
45
+ { name: 'getViewMonth()', description: 'Visible month { year, month } (follows scroll)' },
46
+ { name: 'getViewDate()', description: 'First day of visible month' },
40
47
  { name: 'setDisabledDates(dates)', description: 'Replace full disabled list' },
41
48
  { name: 'disableDate(dateLike)', description: 'Disable one date' },
42
49
  { name: 'enableDate(dateLike)', description: 'Enable one date' },
43
50
  { name: 'isDateDisabled(dateLike)', description: 'Returns boolean' },
51
+ { name: 'setHighlightDates(dates)', description: 'Replace highlight markers' },
52
+ { name: 'highlightDate(dateLike, color?)', description: 'Add dot marker (append)' },
53
+ { name: 'unhighlightDate(dateLike, color?)', description: 'Remove dot marker(s)' },
54
+ { name: 'isDateHighlighted(dateLike)', description: 'Returns boolean' },
55
+ { name: 'getHighlightColors(dateLike)', description: 'Dot colors for a day' },
44
56
  { name: 'destroy()', description: 'Remove picker from DOM and detach listeners' }
45
57
  ]
46
58
 
@@ -251,6 +263,64 @@ picker.enableDate('31.12.2026');`
251
263
  { text: 'Clear', action: 'clear' },
252
264
  { text: 'Done', onClick: (picker) => picker.close() }
253
265
  ]
266
+ });`
267
+ )
268
+ },
269
+ highlight: {
270
+ id: 'highlight',
271
+ title: 'Highlighted dates',
272
+ description: 'Dot markers with optional colors; multiple dots per day.',
273
+ js: `new RollDate('#calendar', {
274
+ highlightDates: [
275
+ { date: '15.08.2026', color: '#22c55e' },
276
+ { date: '20.08.2026', colors: ['#ef4444', '#a855f7'] }
277
+ ]
278
+ });`,
279
+ html: htmlShell(
280
+ ` <div id="calendar"></div>`,
281
+ `new RollDate('#calendar', {
282
+ highlightDates: [
283
+ { date: '15.08.2026', color: '#22c55e' },
284
+ { date: '20.08.2026', colors: ['#ef4444', '#a855f7'] }
285
+ ]
286
+ });`
287
+ )
288
+ },
289
+ 'range-presets': {
290
+ id: 'range-presets',
291
+ title: 'Range presets',
292
+ description: 'Quick range buttons; use picker.getViewMonth() for visible month.',
293
+ js: `new RollDate('#range', {
294
+ selectType: 'range',
295
+ closeOnSelect: false,
296
+ rangePresets: [
297
+ {
298
+ label: '7 days',
299
+ getRange(picker) {
300
+ const start = picker.selectedDates[0] ?? picker.getViewDate();
301
+ const end = new Date(start);
302
+ end.setDate(end.getDate() + 6);
303
+ return [start, end];
304
+ }
305
+ },
306
+ {
307
+ label: 'This month',
308
+ getRange(picker) {
309
+ const { year, month } = picker.getViewMonth();
310
+ return [new Date(year, month, 1), new Date(year, month + 1, 0)];
311
+ }
312
+ }
313
+ ]
314
+ });`,
315
+ html: htmlShell(
316
+ ` <input id="range" type="text" placeholder="Select range" autocomplete="off">`,
317
+ `new RollDate('#range', {
318
+ selectType: 'range',
319
+ closeOnSelect: false,
320
+ rangePresets: [
321
+ { label: '7 days', getRange(p => { const s = p.selectedDates[0] ?? p.getViewDate(); const e = new Date(s); e.setDate(e.getDate() + 6); return [s, e]; }) },
322
+ { label: 'This month', getRange(p => { const { year, month } = p.getViewMonth(); return [new Date(year, month, 1), new Date(year, month + 1, 0)]; }) }
323
+ ]
254
324
  });`
255
325
  )
256
326
  }
@@ -17,6 +17,9 @@
17
17
  --rd-accent-strong: #368cfd;
18
18
  --rd-accent-dark: #1e5093;
19
19
  --rd-accent-muted: #375985;
20
+ --rd-range: #a78bfa;
21
+ --rd-range-strong: #7c3aed;
22
+ --rd-range-muted: #3d3558;
20
23
  --rd-button-icon: #fff;
21
24
  background: var(--rd-bg);
22
25
  border: 1px solid var(--rd-border);
@@ -43,6 +46,9 @@
43
46
  --rd-accent-strong: #368cfd;
44
47
  --rd-accent-dark: #1e5093;
45
48
  --rd-accent-muted: #375985;
49
+ --rd-range: #a78bfa;
50
+ --rd-range-strong: #7c3aed;
51
+ --rd-range-muted: #3d3558;
46
52
  --rd-button-icon: #fff;
47
53
  }
48
54
  .RollDate__container.RollDate__theme_light {
@@ -60,6 +66,9 @@
60
66
  --rd-accent-strong: #2d7cff;
61
67
  --rd-accent-dark: #1f5dc1;
62
68
  --rd-accent-muted: #d9e8ff;
69
+ --rd-range: #8b5cf6;
70
+ --rd-range-strong: #6d28d9;
71
+ --rd-range-muted: #ede9fe;
63
72
  --rd-button-icon: #334155;
64
73
  }
65
74
  .RollDate__container.RollDate__calendar__type--days .RollDate__calendar__header {
@@ -178,6 +187,7 @@
178
187
  transition: all 0.3s;
179
188
  border-radius: 4px;
180
189
  border: 2px solid transparent;
190
+ position: relative;
181
191
  }
182
192
  .RollDate__calendar__day:hover {
183
193
  border-color: var(--rd-hover-border);
@@ -188,27 +198,28 @@
188
198
  .RollDate__calendar__day--selected:hover {
189
199
  border-color: var(--rd-accent-strong);
190
200
  }
191
- .RollDate__calendar__day--range-first {
192
- border-color: var(--rd-accent-dark);
193
- border-right-color: transparent;
201
+ .RollDate__calendar__day--range-first, .RollDate__calendar__day--range-last {
202
+ background: var(--rd-range-strong);
203
+ color: #fff;
204
+ border-color: transparent;
205
+ font-weight: 600;
194
206
  }
195
- .RollDate__calendar__day--range-first:hover {
196
- border-color: var(--rd-accent-strong);
197
- border-right-color: transparent;
207
+ .RollDate__calendar__day--range-first:hover, .RollDate__calendar__day--range-last:hover {
208
+ background: var(--rd-range);
209
+ border-color: transparent;
210
+ }
211
+ .RollDate__calendar__day--range-first .RollDate__calendar__day-dot:not(.RollDate__calendar__day-dot--custom):not(.RollDate__calendar__day-dot--more), .RollDate__calendar__day--range-last .RollDate__calendar__day-dot:not(.RollDate__calendar__day-dot--custom):not(.RollDate__calendar__day-dot--more) {
212
+ background: #fff;
198
213
  }
199
214
  .RollDate__calendar__day--range-selected {
200
- border-color: var(--rd-accent-dark) transparent var(--rd-accent-dark) transparent;
215
+ background: var(--rd-range-muted);
216
+ color: var(--rd-text-primary);
217
+ border-color: transparent;
218
+ border-radius: 2px;
201
219
  }
202
220
  .RollDate__calendar__day--range-selected:hover {
203
- border-color: var(--rd-accent-strong) transparent var(--rd-accent-strong) transparent;
204
- }
205
- .RollDate__calendar__day--range-last {
206
- border-color: var(--rd-accent-dark);
207
- border-left-color: transparent;
208
- }
209
- .RollDate__calendar__day--range-last:hover {
210
- border-color: var(--rd-accent-strong);
211
- border-left-color: transparent;
221
+ background: var(--rd-range-muted);
222
+ border-color: transparent;
212
223
  }
213
224
  .RollDate__calendar__day--active {
214
225
  color: var(--rd-text-primary);
@@ -218,12 +229,57 @@
218
229
  }
219
230
  .RollDate__calendar__day--today {
220
231
  background: var(--rd-accent);
221
- color: white;
232
+ color: #fff;
233
+ border-color: transparent;
222
234
  }
223
235
  .RollDate__calendar__day--today:hover {
224
236
  border-color: var(--rd-accent-strong);
225
237
  background: var(--rd-accent-strong);
226
238
  }
239
+ .RollDate__calendar__day--today.RollDate__calendar__day--range-first, .RollDate__calendar__day--today.RollDate__calendar__day--range-last, .RollDate__calendar__day--today.RollDate__calendar__day--range-selected {
240
+ background: var(--rd-accent);
241
+ color: #fff;
242
+ }
243
+ .RollDate__calendar__day--today.RollDate__calendar__day--range-first:hover, .RollDate__calendar__day--today.RollDate__calendar__day--range-last:hover, .RollDate__calendar__day--today.RollDate__calendar__day--range-selected:hover {
244
+ background: var(--rd-accent-strong);
245
+ border-color: transparent;
246
+ }
247
+ .RollDate__calendar__day-dots {
248
+ position: absolute;
249
+ bottom: 2px;
250
+ left: 50%;
251
+ transform: translateX(-50%);
252
+ display: flex;
253
+ gap: 2px;
254
+ align-items: center;
255
+ justify-content: center;
256
+ max-width: calc(100% - 4px);
257
+ pointer-events: none;
258
+ }
259
+ .RollDate__calendar__day-dot {
260
+ width: 5px;
261
+ height: 5px;
262
+ border-radius: 50%;
263
+ background: var(--rd-accent);
264
+ flex-shrink: 0;
265
+ }
266
+ .RollDate__calendar__day-dot--custom {
267
+ background: var(--rd-highlight-dot);
268
+ }
269
+ .RollDate__calendar__day-dot--compact {
270
+ width: 4px;
271
+ height: 4px;
272
+ }
273
+ .RollDate__calendar__day-dot--more {
274
+ width: auto;
275
+ height: auto;
276
+ background: none;
277
+ color: var(--rd-text-secondary);
278
+ font-size: 8px;
279
+ line-height: 1;
280
+ font-weight: 700;
281
+ padding-left: 1px;
282
+ }
227
283
  .RollDate__calendar__day--disabled {
228
284
  color: var(--rd-text-disabled);
229
285
  cursor: default;
@@ -304,6 +360,30 @@
304
360
  .RollDate__calendar__button[data-direction=next] {
305
361
  transform: rotate(-180deg);
306
362
  }
363
+ .RollDate__presets {
364
+ flex: 0 0 auto;
365
+ display: flex;
366
+ flex-wrap: wrap;
367
+ gap: 6px;
368
+ margin-top: 10px;
369
+ padding-top: 10px;
370
+ border-top: 1px solid var(--rd-border);
371
+ }
372
+ .RollDate__presets__button {
373
+ border: 1px solid var(--rd-border);
374
+ background: var(--rd-hover-bg);
375
+ color: var(--rd-text-primary);
376
+ border-radius: 6px;
377
+ padding: 5px 10px;
378
+ font-size: 11px;
379
+ font-weight: 600;
380
+ cursor: pointer;
381
+ transition: background-color 0.2s, border-color 0.2s;
382
+ }
383
+ .RollDate__presets__button:hover {
384
+ border-color: var(--rd-range);
385
+ background: var(--rd-range-muted);
386
+ }
307
387
  .RollDate__footer {
308
388
  flex: 0 0 auto;
309
389
  margin-top: 10px;