@astryxdesign/cli 0.1.4 → 0.1.5-canary.3f81427
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/CHANGELOG.md +45 -1
- package/docs/getting-started.doc.mjs +4 -0
- package/docs/migration.doc.mjs +134 -0
- package/docs/styling.doc.mjs +53 -0
- package/docs/working-with-ai.doc.mjs +1 -1
- package/package.json +15 -10
- package/src/api/component.mjs +2 -1
- package/src/api/doctor.mjs +13 -2
- package/src/api/template.mjs +14 -3
- package/src/codemods/__tests__/registry.test.mjs +1 -0
- package/src/codemods/__tests__/runner.test.mjs +38 -0
- package/src/codemods/registry.mjs +1 -0
- package/src/codemods/runner.mjs +2 -0
- package/src/codemods/transforms/v0.1.5/__tests__/rename-switch-label-spacing-default-to-hug.test.mjs +93 -0
- package/src/codemods/transforms/v0.1.5/index.mjs +19 -0
- package/src/codemods/transforms/v0.1.5/rename-switch-label-spacing-default-to-hug.mjs +140 -0
- package/src/commands/agent-docs.mjs +9 -6
- package/src/commands/agent-docs.test.mjs +33 -0
- package/src/commands/build-theme.color-scheme.test.mjs +153 -0
- package/src/commands/build-theme.mjs +112 -14
- package/src/commands/build-theme.variants.test.mjs +193 -0
- package/src/commands/component-resolution.test.mjs +4 -4
- package/src/commands/doctor.test.mjs +34 -0
- package/src/commands/init.mjs +1 -1
- package/src/commands/swizzle.mjs +34 -0
- package/src/commands/swizzle.routing.test.mjs +67 -0
- package/src/lib/component-discovery.mjs +8 -4
- package/templates/blocks/components/AspectRatio/AspectRatioCircleImage.tsx +1 -6
- package/templates/blocks/components/AspectRatio/AspectRatioImageGallery.tsx +2 -7
- package/templates/blocks/components/AspectRatio/AspectRatioShowcase.tsx +2 -5
- package/templates/blocks/components/AspectRatio/AspectRatioSquareImage.tsx +1 -6
- package/templates/blocks/components/AspectRatio/AspectRatioWidescreen.tsx +1 -6
- package/templates/blocks/components/BaseTypeahead/BaseTypeaheadCustomSearch.doc.mjs +14 -0
- package/templates/blocks/components/BaseTypeahead/BaseTypeaheadCustomSearch.tsx +58 -0
- package/templates/blocks/components/CodeBlock/CodeBlockTerminal.doc.mjs +14 -0
- package/templates/blocks/components/CodeBlock/CodeBlockTerminal.tsx +24 -0
- package/templates/blocks/components/Collapsible/CollapsibleDividedAccordion.doc.mjs +13 -0
- package/templates/blocks/components/Collapsible/CollapsibleDividedAccordion.tsx +33 -0
- package/templates/blocks/components/Collapsible/CollapsibleWithoutCard.tsx +25 -23
- package/templates/blocks/components/CommandPaletteGroup/CommandPaletteGroupShowcase.tsx +27 -48
- package/templates/blocks/components/CommandPaletteInput/CommandPaletteInputBasic.doc.mjs +15 -0
- package/templates/blocks/components/CommandPaletteInput/CommandPaletteInputBasic.tsx +39 -0
- package/templates/blocks/components/CommandPaletteInput/CommandPaletteInputShowcase.doc.mjs +15 -0
- package/templates/blocks/components/CommandPaletteInput/CommandPaletteInputShowcase.tsx +39 -0
- package/templates/blocks/components/CommandPaletteItem/CommandPaletteItemShowcase.tsx +31 -54
- package/templates/blocks/components/CommandPaletteList/CommandPaletteListBasic.doc.mjs +15 -0
- package/templates/blocks/components/CommandPaletteList/CommandPaletteListBasic.tsx +27 -0
- package/templates/blocks/components/CommandPaletteList/CommandPaletteListShowcase.doc.mjs +15 -0
- package/templates/blocks/components/CommandPaletteList/CommandPaletteListShowcase.tsx +38 -0
- package/templates/blocks/components/ContextMenuItem/ContextMenuItemBasic.doc.mjs +14 -0
- package/templates/blocks/components/ContextMenuItem/ContextMenuItemBasic.tsx +44 -0
- package/templates/blocks/components/ContextMenuItem/ContextMenuItemShowcase.doc.mjs +15 -0
- package/templates/blocks/components/ContextMenuItem/ContextMenuItemShowcase.tsx +107 -0
- package/templates/blocks/components/NavHeadingMenu/NavHeadingMenuShowcase.doc.mjs +15 -0
- package/templates/blocks/components/NavHeadingMenu/NavHeadingMenuShowcase.tsx +47 -0
- package/templates/blocks/components/Table/TableGroupedRowsTable.doc.mjs +14 -0
- package/templates/blocks/components/Table/TableGroupedRowsTable.tsx +66 -0
- package/templates/blocks/components/Table/TableRowIndexTable.doc.mjs +14 -0
- package/templates/blocks/components/Table/TableRowIndexTable.tsx +47 -0
- package/templates/pages/classic-gallery/page.tsx +1 -1
- package/templates/pages/dashboard/page.tsx +1 -1
- package/templates/pages/documentation/page.tsx +1 -1
- package/templates/pages/incident-console/page.tsx +580 -0
- package/templates/pages/incident-console/template.doc.mjs +12 -0
- package/templates/pages/kanban-board/page.tsx +37 -13
- package/templates/pages/messaging-shell/page.tsx +676 -0
- package/templates/pages/messaging-shell/template.doc.mjs +12 -0
- package/templates/pages/mixed-gallery/page.tsx +1 -1
- package/templates/pages/payment-form/page.tsx +2 -6
- package/templates/pages/product-detail/page.tsx +3 -11
- package/templates/pages/product-gallery/page.tsx +1 -1
- package/templates/pages/settings/page.tsx +1 -1
- package/templates/pages/side-gallery/page.tsx +1 -1
- package/templates/pages/table-page/page.tsx +1 -1
- package/templates/pages/table-page-chart/page.tsx +4 -14
- package/templates/pages/table-page-heatmap-status/page.tsx +1 -1
- package/templates/pages/table-page-shoe-store-heatmap/page.tsx +5 -19
|
@@ -439,8 +439,11 @@ export default function KanbanBoardTemplate() {
|
|
|
439
439
|
let cb = columnRefCbs.current.get(id);
|
|
440
440
|
if (!cb) {
|
|
441
441
|
cb = el => {
|
|
442
|
-
if (el) {
|
|
443
|
-
|
|
442
|
+
if (el) {
|
|
443
|
+
columnEls.current.set(id, el);
|
|
444
|
+
} else {
|
|
445
|
+
columnEls.current.delete(id);
|
|
446
|
+
}
|
|
444
447
|
};
|
|
445
448
|
columnRefCbs.current.set(id, cb);
|
|
446
449
|
}
|
|
@@ -451,8 +454,11 @@ export default function KanbanBoardTemplate() {
|
|
|
451
454
|
let cb = cardRefCbs.current.get(id);
|
|
452
455
|
if (!cb) {
|
|
453
456
|
cb = el => {
|
|
454
|
-
if (el) {
|
|
455
|
-
|
|
457
|
+
if (el) {
|
|
458
|
+
cardEls.current.set(id, el);
|
|
459
|
+
} else {
|
|
460
|
+
cardEls.current.delete(id);
|
|
461
|
+
}
|
|
456
462
|
};
|
|
457
463
|
cardRefCbs.current.set(id, cb);
|
|
458
464
|
}
|
|
@@ -487,7 +493,9 @@ export default function KanbanBoardTemplate() {
|
|
|
487
493
|
): DropTarget | null => {
|
|
488
494
|
for (const [colId, el] of Array.from(columnEls.current.entries())) {
|
|
489
495
|
const r = el.getBoundingClientRect();
|
|
490
|
-
if (px < r.left || px > r.right || py < r.top || py > r.bottom) {
|
|
496
|
+
if (px < r.left || px > r.right || py < r.top || py > r.bottom) {
|
|
497
|
+
continue;
|
|
498
|
+
}
|
|
491
499
|
|
|
492
500
|
const ids = itemsByColumn[colId]
|
|
493
501
|
.filter(it => it.id !== draggedId)
|
|
@@ -496,7 +504,9 @@ export default function KanbanBoardTemplate() {
|
|
|
496
504
|
let index = ids.length;
|
|
497
505
|
for (let i = 0; i < ids.length; i++) {
|
|
498
506
|
const cardEl = cardEls.current.get(ids[i]);
|
|
499
|
-
if (!cardEl) {
|
|
507
|
+
if (!cardEl) {
|
|
508
|
+
continue;
|
|
509
|
+
}
|
|
500
510
|
const cr = cardEl.getBoundingClientRect();
|
|
501
511
|
if (py < cr.top + cr.height / 2) {
|
|
502
512
|
index = i;
|
|
@@ -513,21 +523,27 @@ export default function KanbanBoardTemplate() {
|
|
|
513
523
|
const commitDrag = (id: string, target: DropTarget) => {
|
|
514
524
|
setItems(prev => {
|
|
515
525
|
const moved = prev.find(it => it.id === id);
|
|
516
|
-
if (!moved) {
|
|
526
|
+
if (!moved) {
|
|
527
|
+
return prev;
|
|
528
|
+
}
|
|
517
529
|
|
|
518
530
|
const rest = prev.filter(it => it.id !== id);
|
|
519
531
|
const updated: WorkItem = {...moved, column: target.column};
|
|
520
532
|
const colItems = rest.filter(it => it.column === target.column);
|
|
521
533
|
const anchor = colItems[target.index];
|
|
522
534
|
|
|
523
|
-
if (!anchor) {
|
|
535
|
+
if (!anchor) {
|
|
536
|
+
return [...rest, updated];
|
|
537
|
+
}
|
|
524
538
|
const at = rest.indexOf(anchor);
|
|
525
539
|
return [...rest.slice(0, at), updated, ...rest.slice(at)];
|
|
526
540
|
});
|
|
527
541
|
};
|
|
528
542
|
|
|
529
543
|
const onCardPointerDown = (e: ReactPointerEvent, id: string) => {
|
|
530
|
-
if (e.button !== 0) {
|
|
544
|
+
if (e.button !== 0) {
|
|
545
|
+
return;
|
|
546
|
+
}
|
|
531
547
|
// Let the card's own controls (the actions menu) handle the press.
|
|
532
548
|
if (
|
|
533
549
|
(e.target as HTMLElement).closest(
|
|
@@ -538,7 +554,9 @@ export default function KanbanBoardTemplate() {
|
|
|
538
554
|
}
|
|
539
555
|
|
|
540
556
|
const el = cardEls.current.get(id);
|
|
541
|
-
if (!el) {
|
|
557
|
+
if (!el) {
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
542
560
|
|
|
543
561
|
const rect = el.getBoundingClientRect();
|
|
544
562
|
const startX = e.clientX;
|
|
@@ -574,7 +592,9 @@ export default function KanbanBoardTemplate() {
|
|
|
574
592
|
|
|
575
593
|
const onUp = () => {
|
|
576
594
|
teardownRef.current?.();
|
|
577
|
-
if (started && target) {
|
|
595
|
+
if (started && target) {
|
|
596
|
+
commitDrag(id, target);
|
|
597
|
+
}
|
|
578
598
|
setDrag(null);
|
|
579
599
|
};
|
|
580
600
|
|
|
@@ -594,7 +614,9 @@ export default function KanbanBoardTemplate() {
|
|
|
594
614
|
|
|
595
615
|
// Suppress selection while dragging and detach listeners on unmount.
|
|
596
616
|
useEffect(() => {
|
|
597
|
-
if (!isDragging) {
|
|
617
|
+
if (!isDragging) {
|
|
618
|
+
return;
|
|
619
|
+
}
|
|
598
620
|
const previous = document.body.style.userSelect;
|
|
599
621
|
document.body.style.userSelect = 'none';
|
|
600
622
|
return () => {
|
|
@@ -612,7 +634,9 @@ export default function KanbanBoardTemplate() {
|
|
|
612
634
|
const ghostTarget =
|
|
613
635
|
drag && drag.target && drag.target.column === colId ? drag : null;
|
|
614
636
|
|
|
615
|
-
if (visible.length === 0 && !ghostTarget) {
|
|
637
|
+
if (visible.length === 0 && !ghostTarget) {
|
|
638
|
+
return null;
|
|
639
|
+
}
|
|
616
640
|
|
|
617
641
|
const nodes: ReactNode[] = visible.map(it => (
|
|
618
642
|
<BoardCard
|