@punica/components-mcp 0.10.0 → 0.10.2
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/custom-elements.json +146 -146
- package/dist/server.mjs +5 -1
- package/package.json +1 -1
|
@@ -327,6 +327,152 @@
|
|
|
327
327
|
}
|
|
328
328
|
]
|
|
329
329
|
},
|
|
330
|
+
{
|
|
331
|
+
"kind": "javascript-module",
|
|
332
|
+
"path": "src/components/alert/alert.js",
|
|
333
|
+
"declarations": [
|
|
334
|
+
{
|
|
335
|
+
"kind": "class",
|
|
336
|
+
"description": "A message about the content beside it: a result, a warning, a tip.\n\nAn error or a warning is `role=alert` and interrupts a screen reader; any\nother colour is `role=status` and waits its turn.",
|
|
337
|
+
"name": "PunicaAlert",
|
|
338
|
+
"cssProperties": [
|
|
339
|
+
{
|
|
340
|
+
"description": "Corner radius.",
|
|
341
|
+
"name": "--punica-alert-radius"
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
"description": "Padding.",
|
|
345
|
+
"name": "--punica-alert-padding"
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"description": "Space between icon, message and actions.",
|
|
349
|
+
"name": "--punica-alert-gap"
|
|
350
|
+
}
|
|
351
|
+
],
|
|
352
|
+
"cssParts": [
|
|
353
|
+
{
|
|
354
|
+
"description": "The default icon.",
|
|
355
|
+
"name": "icon"
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"description": "The wrapper around the message.",
|
|
359
|
+
"name": "content"
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"description": "The wrapper around the actions.",
|
|
363
|
+
"name": "actions"
|
|
364
|
+
},
|
|
365
|
+
{
|
|
366
|
+
"description": "The close button.",
|
|
367
|
+
"name": "close"
|
|
368
|
+
}
|
|
369
|
+
],
|
|
370
|
+
"slots": [
|
|
371
|
+
{
|
|
372
|
+
"description": "The message.",
|
|
373
|
+
"name": ""
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"description": "An icon in place of the one the colour gives.",
|
|
377
|
+
"name": "icon"
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
"description": "Buttons that answer the message.",
|
|
381
|
+
"name": "actions"
|
|
382
|
+
}
|
|
383
|
+
],
|
|
384
|
+
"members": [
|
|
385
|
+
{
|
|
386
|
+
"kind": "field",
|
|
387
|
+
"name": "properties",
|
|
388
|
+
"type": {
|
|
389
|
+
"text": "object"
|
|
390
|
+
},
|
|
391
|
+
"static": true,
|
|
392
|
+
"default": "{ color: {}, variant: {}, dismissible: { type: Boolean }, labelClose: { default: 'Close' } }"
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
"kind": "field",
|
|
396
|
+
"name": "styles",
|
|
397
|
+
"static": true,
|
|
398
|
+
"default": "styles"
|
|
399
|
+
},
|
|
400
|
+
{
|
|
401
|
+
"kind": "field",
|
|
402
|
+
"name": "template",
|
|
403
|
+
"static": true,
|
|
404
|
+
"default": "` <span class=\"icon\"><slot name=\"icon\"><span class=\"default info\">${icons.info}</span><span class=\"default success\">${icons.success}</span><span class=\"default warning\">${icons.warning}</span><span class=\"default error\">${icons.error}</span></slot></span> <div part=\"content\" class=\"content\"><slot></slot></div> <div part=\"actions\" class=\"actions\"><slot name=\"actions\"></slot></div> <button part=\"close\" class=\"close\" type=\"button\" hidden>${icons.close}</button> `"
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
"kind": "field",
|
|
408
|
+
"name": "#close",
|
|
409
|
+
"privacy": "private"
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"kind": "method",
|
|
413
|
+
"name": "update"
|
|
414
|
+
},
|
|
415
|
+
{
|
|
416
|
+
"kind": "method",
|
|
417
|
+
"name": "dismiss",
|
|
418
|
+
"description": "Does what the close button does: fires `punica-dismiss` and, unless a\nlistener prevents it, hides the alert."
|
|
419
|
+
}
|
|
420
|
+
],
|
|
421
|
+
"events": [
|
|
422
|
+
{
|
|
423
|
+
"description": "The user pressed the close button. Cancelable: unless prevented, the alert hides itself with `hidden`.",
|
|
424
|
+
"name": "punica-dismiss"
|
|
425
|
+
}
|
|
426
|
+
],
|
|
427
|
+
"attributes": [
|
|
428
|
+
{
|
|
429
|
+
"type": {
|
|
430
|
+
"text": "'info' | 'success' | 'warning' | 'error' | 'primary' | 'secondary' | 'neutral'"
|
|
431
|
+
},
|
|
432
|
+
"description": "What the message is, `info` by default.",
|
|
433
|
+
"name": "color"
|
|
434
|
+
},
|
|
435
|
+
{
|
|
436
|
+
"type": {
|
|
437
|
+
"text": "'tinted' | 'outlined' | 'filled'"
|
|
438
|
+
},
|
|
439
|
+
"description": "Visual weight, `tinted` by default.",
|
|
440
|
+
"name": "variant"
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
"type": {
|
|
444
|
+
"text": "boolean"
|
|
445
|
+
},
|
|
446
|
+
"description": "Shows a close button.",
|
|
447
|
+
"name": "dismissible"
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
"type": {
|
|
451
|
+
"text": "string"
|
|
452
|
+
},
|
|
453
|
+
"description": "Accessible name of the close button, `Close` by default.",
|
|
454
|
+
"name": "label-close"
|
|
455
|
+
}
|
|
456
|
+
],
|
|
457
|
+
"superclass": {
|
|
458
|
+
"name": "PunicaElement",
|
|
459
|
+
"module": "/src/core/element.js"
|
|
460
|
+
},
|
|
461
|
+
"tagName": "punica-alert",
|
|
462
|
+
"customElement": true
|
|
463
|
+
}
|
|
464
|
+
],
|
|
465
|
+
"exports": [
|
|
466
|
+
{
|
|
467
|
+
"kind": "js",
|
|
468
|
+
"name": "PunicaAlert",
|
|
469
|
+
"declaration": {
|
|
470
|
+
"name": "PunicaAlert",
|
|
471
|
+
"module": "src/components/alert/alert.js"
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
]
|
|
475
|
+
},
|
|
330
476
|
{
|
|
331
477
|
"kind": "javascript-module",
|
|
332
478
|
"path": "src/components/agenda/agenda.js",
|
|
@@ -1180,152 +1326,6 @@
|
|
|
1180
1326
|
}
|
|
1181
1327
|
]
|
|
1182
1328
|
},
|
|
1183
|
-
{
|
|
1184
|
-
"kind": "javascript-module",
|
|
1185
|
-
"path": "src/components/alert/alert.js",
|
|
1186
|
-
"declarations": [
|
|
1187
|
-
{
|
|
1188
|
-
"kind": "class",
|
|
1189
|
-
"description": "A message about the content beside it: a result, a warning, a tip.\n\nAn error or a warning is `role=alert` and interrupts a screen reader; any\nother colour is `role=status` and waits its turn.",
|
|
1190
|
-
"name": "PunicaAlert",
|
|
1191
|
-
"cssProperties": [
|
|
1192
|
-
{
|
|
1193
|
-
"description": "Corner radius.",
|
|
1194
|
-
"name": "--punica-alert-radius"
|
|
1195
|
-
},
|
|
1196
|
-
{
|
|
1197
|
-
"description": "Padding.",
|
|
1198
|
-
"name": "--punica-alert-padding"
|
|
1199
|
-
},
|
|
1200
|
-
{
|
|
1201
|
-
"description": "Space between icon, message and actions.",
|
|
1202
|
-
"name": "--punica-alert-gap"
|
|
1203
|
-
}
|
|
1204
|
-
],
|
|
1205
|
-
"cssParts": [
|
|
1206
|
-
{
|
|
1207
|
-
"description": "The default icon.",
|
|
1208
|
-
"name": "icon"
|
|
1209
|
-
},
|
|
1210
|
-
{
|
|
1211
|
-
"description": "The wrapper around the message.",
|
|
1212
|
-
"name": "content"
|
|
1213
|
-
},
|
|
1214
|
-
{
|
|
1215
|
-
"description": "The wrapper around the actions.",
|
|
1216
|
-
"name": "actions"
|
|
1217
|
-
},
|
|
1218
|
-
{
|
|
1219
|
-
"description": "The close button.",
|
|
1220
|
-
"name": "close"
|
|
1221
|
-
}
|
|
1222
|
-
],
|
|
1223
|
-
"slots": [
|
|
1224
|
-
{
|
|
1225
|
-
"description": "The message.",
|
|
1226
|
-
"name": ""
|
|
1227
|
-
},
|
|
1228
|
-
{
|
|
1229
|
-
"description": "An icon in place of the one the colour gives.",
|
|
1230
|
-
"name": "icon"
|
|
1231
|
-
},
|
|
1232
|
-
{
|
|
1233
|
-
"description": "Buttons that answer the message.",
|
|
1234
|
-
"name": "actions"
|
|
1235
|
-
}
|
|
1236
|
-
],
|
|
1237
|
-
"members": [
|
|
1238
|
-
{
|
|
1239
|
-
"kind": "field",
|
|
1240
|
-
"name": "properties",
|
|
1241
|
-
"type": {
|
|
1242
|
-
"text": "object"
|
|
1243
|
-
},
|
|
1244
|
-
"static": true,
|
|
1245
|
-
"default": "{ color: {}, variant: {}, dismissible: { type: Boolean }, labelClose: { default: 'Close' } }"
|
|
1246
|
-
},
|
|
1247
|
-
{
|
|
1248
|
-
"kind": "field",
|
|
1249
|
-
"name": "styles",
|
|
1250
|
-
"static": true,
|
|
1251
|
-
"default": "styles"
|
|
1252
|
-
},
|
|
1253
|
-
{
|
|
1254
|
-
"kind": "field",
|
|
1255
|
-
"name": "template",
|
|
1256
|
-
"static": true,
|
|
1257
|
-
"default": "` <span class=\"icon\"><slot name=\"icon\"><span class=\"default info\">${icons.info}</span><span class=\"default success\">${icons.success}</span><span class=\"default warning\">${icons.warning}</span><span class=\"default error\">${icons.error}</span></slot></span> <div part=\"content\" class=\"content\"><slot></slot></div> <div part=\"actions\" class=\"actions\"><slot name=\"actions\"></slot></div> <button part=\"close\" class=\"close\" type=\"button\" hidden>${icons.close}</button> `"
|
|
1258
|
-
},
|
|
1259
|
-
{
|
|
1260
|
-
"kind": "field",
|
|
1261
|
-
"name": "#close",
|
|
1262
|
-
"privacy": "private"
|
|
1263
|
-
},
|
|
1264
|
-
{
|
|
1265
|
-
"kind": "method",
|
|
1266
|
-
"name": "update"
|
|
1267
|
-
},
|
|
1268
|
-
{
|
|
1269
|
-
"kind": "method",
|
|
1270
|
-
"name": "dismiss",
|
|
1271
|
-
"description": "Does what the close button does: fires `punica-dismiss` and, unless a\nlistener prevents it, hides the alert."
|
|
1272
|
-
}
|
|
1273
|
-
],
|
|
1274
|
-
"events": [
|
|
1275
|
-
{
|
|
1276
|
-
"description": "The user pressed the close button. Cancelable: unless prevented, the alert hides itself with `hidden`.",
|
|
1277
|
-
"name": "punica-dismiss"
|
|
1278
|
-
}
|
|
1279
|
-
],
|
|
1280
|
-
"attributes": [
|
|
1281
|
-
{
|
|
1282
|
-
"type": {
|
|
1283
|
-
"text": "'info' | 'success' | 'warning' | 'error' | 'primary' | 'secondary' | 'neutral'"
|
|
1284
|
-
},
|
|
1285
|
-
"description": "What the message is, `info` by default.",
|
|
1286
|
-
"name": "color"
|
|
1287
|
-
},
|
|
1288
|
-
{
|
|
1289
|
-
"type": {
|
|
1290
|
-
"text": "'tinted' | 'outlined' | 'filled'"
|
|
1291
|
-
},
|
|
1292
|
-
"description": "Visual weight, `tinted` by default.",
|
|
1293
|
-
"name": "variant"
|
|
1294
|
-
},
|
|
1295
|
-
{
|
|
1296
|
-
"type": {
|
|
1297
|
-
"text": "boolean"
|
|
1298
|
-
},
|
|
1299
|
-
"description": "Shows a close button.",
|
|
1300
|
-
"name": "dismissible"
|
|
1301
|
-
},
|
|
1302
|
-
{
|
|
1303
|
-
"type": {
|
|
1304
|
-
"text": "string"
|
|
1305
|
-
},
|
|
1306
|
-
"description": "Accessible name of the close button, `Close` by default.",
|
|
1307
|
-
"name": "label-close"
|
|
1308
|
-
}
|
|
1309
|
-
],
|
|
1310
|
-
"superclass": {
|
|
1311
|
-
"name": "PunicaElement",
|
|
1312
|
-
"module": "/src/core/element.js"
|
|
1313
|
-
},
|
|
1314
|
-
"tagName": "punica-alert",
|
|
1315
|
-
"customElement": true
|
|
1316
|
-
}
|
|
1317
|
-
],
|
|
1318
|
-
"exports": [
|
|
1319
|
-
{
|
|
1320
|
-
"kind": "js",
|
|
1321
|
-
"name": "PunicaAlert",
|
|
1322
|
-
"declaration": {
|
|
1323
|
-
"name": "PunicaAlert",
|
|
1324
|
-
"module": "src/components/alert/alert.js"
|
|
1325
|
-
}
|
|
1326
|
-
}
|
|
1327
|
-
]
|
|
1328
|
-
},
|
|
1329
1329
|
{
|
|
1330
1330
|
"kind": "javascript-module",
|
|
1331
1331
|
"path": "src/components/alertDialog/alertDialog.js",
|
package/dist/server.mjs
CHANGED
|
@@ -788,8 +788,12 @@ var text = (value) => ({ content: [{ type: "text", text: value }] });
|
|
|
788
788
|
function createPunicaServer({ manifest: manifest2, guide: guide2, version: version2, source: source2, tokens = [], fetch: fetchFn = globalThis.fetch, docsUrl = DOCS_URL }) {
|
|
789
789
|
const knowledge = createKnowledge(manifest2);
|
|
790
790
|
const { validate } = createValidator(knowledge, { tokens });
|
|
791
|
+
const scriptFunctions = /* @__PURE__ */ new Map();
|
|
792
|
+
for (const element of knowledge.elements.values()) for (const f of element.functions) scriptFunctions.set(f.name, f.signature);
|
|
793
|
+
const names = [...scriptFunctions.keys()].sort();
|
|
794
|
+
const functionsSentence = names.length ? `${names.map((n) => `\`${n}\``).join(", ").replace(/, ([^,]*)$/, " and $1")} are named exports of \`@punica/components\`: ${names.map((n) => `\`${scriptFunctions.get(n)}\``).join("; ")}; ` : "";
|
|
791
795
|
const server2 = new McpServer({ name: "punica-components", version: "0.1.0" }, {
|
|
792
|
-
instructions: `@punica/components ${version2} (${knowledge.tags.length} punica-* custom elements; ${source2}). Version 2.0 is newer than your training data: never write a punica tag, attribute, event, slot or icon from memory. Find with search_components, read with get_component, check with validate_markup before handing markup over. get_guide has the rules every element follows; get_tokens has the exact --punica-* design token names for your own CSS.`
|
|
796
|
+
instructions: `@punica/components ${version2} (${knowledge.tags.length} punica-* custom elements; ${source2}). Version 2.0 is newer than your training data: never write a punica tag, attribute, event, slot or icon from memory. Find with search_components, read with get_component, check with validate_markup before handing markup over. Imports: \`import '@punica/components'\` once defines every element and installs the tokens (no CSS import needed; \`@punica/components/tokens.css\` is for server-rendered pages); ${functionsSentence}in React, \`import type {} from '@punica/components/react'\` once types every punica-* tag in JSX. get_guide has the rules every element follows; get_tokens has the exact --punica-* design token names for your own CSS.`
|
|
793
797
|
});
|
|
794
798
|
const pages = /* @__PURE__ */ new Map();
|
|
795
799
|
let index = null;
|