@namroodinc/liquid-editorial 0.1.7 → 0.1.8

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.
Files changed (96) hide show
  1. package/AGENTS.md +2 -0
  2. package/UPGRADING.md +25 -0
  3. package/dist/chunks/Board-BLhB5_xx.cjs +2 -0
  4. package/dist/chunks/Board-BLhB5_xx.cjs.map +1 -0
  5. package/dist/chunks/Board-BTFSzn6c.js +239 -0
  6. package/dist/chunks/Board-BTFSzn6c.js.map +1 -0
  7. package/dist/chunks/EntryEditor-CcyYtH74.js +191 -0
  8. package/dist/chunks/EntryEditor-CcyYtH74.js.map +1 -0
  9. package/dist/chunks/EntryEditor-DIpc1iPF.cjs +2 -0
  10. package/dist/chunks/EntryEditor-DIpc1iPF.cjs.map +1 -0
  11. package/dist/chunks/{RichTextEditor-DC_0oN1s.cjs → RichTextEditor-BxtlbjXj.cjs} +2 -2
  12. package/dist/chunks/RichTextEditor-BxtlbjXj.cjs.map +1 -0
  13. package/dist/chunks/{RichTextEditor-CSpjsL1z.js → RichTextEditor-Dnx4i7bQ.js} +104 -93
  14. package/dist/chunks/RichTextEditor-Dnx4i7bQ.js.map +1 -0
  15. package/dist/chunks/mergeRefs-Bc3qS0Tt.cjs +2 -0
  16. package/dist/chunks/mergeRefs-Bc3qS0Tt.cjs.map +1 -0
  17. package/dist/chunks/mergeRefs-DGM402mE.js +10 -0
  18. package/dist/chunks/mergeRefs-DGM402mE.js.map +1 -0
  19. package/dist/components/Board/index.cjs +1 -2
  20. package/dist/components/Board/index.d.cts.map +1 -1
  21. package/dist/components/Board/index.d.ts.map +1 -1
  22. package/dist/components/Board/index.js +1 -231
  23. package/dist/components/Board/keyboard.d.cts +7 -0
  24. package/dist/components/Board/keyboard.d.cts.map +1 -0
  25. package/dist/components/Board/keyboard.d.ts +7 -0
  26. package/dist/components/Board/keyboard.d.ts.map +1 -0
  27. package/dist/components/Board/keyboard.test.d.cts +2 -0
  28. package/dist/components/Board/keyboard.test.d.cts.map +1 -0
  29. package/dist/components/Board/keyboard.test.d.ts +2 -0
  30. package/dist/components/Board/keyboard.test.d.ts.map +1 -0
  31. package/dist/components/Board/moves.d.cts +5 -0
  32. package/dist/components/Board/moves.d.cts.map +1 -0
  33. package/dist/components/Board/moves.d.ts +5 -0
  34. package/dist/components/Board/moves.d.ts.map +1 -0
  35. package/dist/components/Board/moves.test.d.cts +2 -0
  36. package/dist/components/Board/moves.test.d.cts.map +1 -0
  37. package/dist/components/Board/moves.test.d.ts +2 -0
  38. package/dist/components/Board/moves.test.d.ts.map +1 -0
  39. package/dist/components/DatePicker/index.cjs +1 -1
  40. package/dist/components/DatePicker/index.cjs.map +1 -1
  41. package/dist/components/DatePicker/index.d.cts.map +1 -1
  42. package/dist/components/DatePicker/index.d.ts.map +1 -1
  43. package/dist/components/DatePicker/index.js +39 -36
  44. package/dist/components/DatePicker/index.js.map +1 -1
  45. package/dist/components/Drawer/index.cjs +1 -1
  46. package/dist/components/Drawer/index.cjs.map +1 -1
  47. package/dist/components/Drawer/index.d.cts.map +1 -1
  48. package/dist/components/Drawer/index.d.ts.map +1 -1
  49. package/dist/components/Drawer/index.js +69 -62
  50. package/dist/components/Drawer/index.js.map +1 -1
  51. package/dist/components/EntryEditor/index.cjs +1 -1
  52. package/dist/components/EntryEditor/index.d.cts.map +1 -1
  53. package/dist/components/EntryEditor/index.d.ts.map +1 -1
  54. package/dist/components/EntryEditor/index.js +1 -1
  55. package/dist/components/EntryEditor/model.d.cts.map +1 -1
  56. package/dist/components/EntryEditor/model.d.ts.map +1 -1
  57. package/dist/components/Pagination/index.cjs +1 -1
  58. package/dist/components/Pagination/index.cjs.map +1 -1
  59. package/dist/components/Pagination/index.js +1 -1
  60. package/dist/components/Pagination/index.js.map +1 -1
  61. package/dist/components/Pagination/style.css +0 -1
  62. package/dist/components/RichTextEditor/index.cjs +1 -1
  63. package/dist/components/RichTextEditor/index.d.cts.map +1 -1
  64. package/dist/components/RichTextEditor/index.d.ts.map +1 -1
  65. package/dist/components/RichTextEditor/index.js +1 -1
  66. package/dist/components/Select/index.cjs +1 -1
  67. package/dist/components/Select/index.cjs.map +1 -1
  68. package/dist/components/Select/index.d.cts.map +1 -1
  69. package/dist/components/Select/index.d.ts.map +1 -1
  70. package/dist/components/Select/index.js +32 -18
  71. package/dist/components/Select/index.js.map +1 -1
  72. package/dist/components/SortableList/index.cjs +1 -1
  73. package/dist/components/SortableList/index.cjs.map +1 -1
  74. package/dist/components/SortableList/index.d.cts.map +1 -1
  75. package/dist/components/SortableList/index.d.ts.map +1 -1
  76. package/dist/components/SortableList/index.js +49 -50
  77. package/dist/components/SortableList/index.js.map +1 -1
  78. package/dist/index.cjs +1 -1
  79. package/dist/index.js +4 -4
  80. package/dist/internal/mergeRefs.d.cts +4 -0
  81. package/dist/internal/mergeRefs.d.cts.map +1 -0
  82. package/dist/internal/mergeRefs.d.ts +4 -0
  83. package/dist/internal/mergeRefs.d.ts.map +1 -0
  84. package/dist/test/dragEvent.d.cts +3 -0
  85. package/dist/test/dragEvent.d.cts.map +1 -0
  86. package/dist/test/dragEvent.d.ts +3 -0
  87. package/dist/test/dragEvent.d.ts.map +1 -0
  88. package/package.json +2 -2
  89. package/dist/chunks/EntryEditor-C32lKKnV.cjs +0 -2
  90. package/dist/chunks/EntryEditor-C32lKKnV.cjs.map +0 -1
  91. package/dist/chunks/EntryEditor-xVuiqtFo.js +0 -181
  92. package/dist/chunks/EntryEditor-xVuiqtFo.js.map +0 -1
  93. package/dist/chunks/RichTextEditor-CSpjsL1z.js.map +0 -1
  94. package/dist/chunks/RichTextEditor-DC_0oN1s.cjs.map +0 -1
  95. package/dist/components/Board/index.cjs.map +0 -1
  96. package/dist/components/Board/index.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","names":["isValidElement","forwardRef","useId","useState","useSensors","useSensor","PointerSensor","KeyboardSensor","sortableKeyboardCoordinates","useCallback","arrayMove","Children","DndContext","closestCenter","restrictToVerticalAxis","SortableContext","verticalListSortingStrategy","DragOverlay","Icon","useSortable","CSS","Button","require_Icon","require_components_Button_index","react","react_jsx_runtime","_dnd_kit_core","_dnd_kit_modifiers","_dnd_kit_sortable","_dnd_kit_utilities","isItem","child","SortableList","rest","dndId","activeId","setActiveId","order","setOrder","items","prevItems","setPrevItems","sensors","handleStart","event","handleEnd","over","active","from","to","next","onReorder","childArray","children","rows","ordered","id","activeRow","className","renderDragOverlay","SortableListItem","setNodeRef","node","ref","transform","isDragging","label","attributes","listeners","action"],"sources":["../../../src/components/SortableList/index.tsx"],"sourcesContent":["import {\n Children,\n forwardRef,\n isValidElement,\n useCallback,\n useId,\n useState,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport {\n DndContext,\n DragOverlay,\n KeyboardSensor,\n PointerSensor,\n closestCenter,\n useSensor,\n useSensors,\n type DragEndEvent,\n type DragStartEvent,\n} from \"@dnd-kit/core\";\nimport { restrictToVerticalAxis } from \"@dnd-kit/modifiers\";\nimport {\n SortableContext,\n arrayMove,\n sortableKeyboardCoordinates,\n useSortable,\n verticalListSortingStrategy,\n} from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport { Button } from \"../Button\";\nimport { Icon } from \"../Icon\";\nimport \"./style.css\";\n\nexport interface SortableListProps extends Omit<HTMLAttributes<HTMLUListElement>, \"onDragEnd\"> {\n /** Item ids in render order. */\n items: string[];\n /** Fired with the whole list in its new order. Apply it to your own state. */\n onReorder?: (items: string[]) => void;\n /** Rendered inside the drag overlay while a row is in the air. Defaults to the row's content. */\n renderDragOverlay?: (id: string) => ReactNode;\n children?: ReactNode;\n}\n\ntype ItemElement = ReactElement<SortableListItemProps>;\n\nfunction isItem(child: ReactNode): child is ItemElement {\n return isValidElement<SortableListItemProps>(child) && typeof child.props.id === \"string\";\n}\n\n/**\n * A single vertical list you can re-order — the board's mechanics without the\n * lanes. Each row carries a grip on the left. The list keeps the dropped order\n * itself, so it works on its own; pass `onReorder` to mirror it into your data.\n * A new `items` value from the parent always wins.\n */\nexport const SortableList = forwardRef<HTMLUListElement, SortableListProps>(\n function SortableList({ items, onReorder, renderDragOverlay, className, children, ...rest }, ref) {\n const dndId = useId();\n const [activeId, setActiveId] = useState<string | null>(null);\n const [order, setOrder] = useState(items);\n const [prevItems, setPrevItems] = useState(items);\n if (items !== prevItems && items.join(\"\\u0000\") !== prevItems.join(\"\\u0000\")) {\n setPrevItems(items);\n setOrder(items);\n }\n const sensors = useSensors(\n useSensor(PointerSensor, { activationConstraint: { distance: 4 } }),\n useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }),\n );\n\n const handleStart = useCallback((event: DragStartEvent) => {\n setActiveId(String(event.active.id));\n }, []);\n\n const handleEnd = useCallback(\n (event: DragEndEvent) => {\n setActiveId(null);\n const { active, over } = event;\n if (!over || active.id === over.id) return;\n const from = order.indexOf(String(active.id));\n const to = order.indexOf(String(over.id));\n if (from < 0 || to < 0) return;\n const next = arrayMove(order, from, to);\n setOrder(next);\n onReorder?.(next);\n },\n [order, onReorder],\n );\n\n // Rows follow the list's own order; anything that isn't a row keeps its place at the end.\n const childArray = Children.toArray(children);\n const rows = new Map(childArray.filter(isItem).map((child) => [child.props.id, child]));\n const ordered = [\n ...order.flatMap((id) => rows.get(id) ?? []),\n ...childArray.filter((child) => !isItem(child) || !order.includes(child.props.id)),\n ];\n const activeRow = activeId ? rows.get(activeId) : undefined;\n\n return (\n <DndContext\n id={`ds-sortable-list-${dndId}`}\n sensors={sensors}\n collisionDetection={closestCenter}\n modifiers={[restrictToVerticalAxis]}\n onDragStart={handleStart}\n onDragEnd={handleEnd}\n onDragCancel={() => setActiveId(null)}\n >\n <SortableContext items={order} strategy={verticalListSortingStrategy}>\n <ul\n ref={ref}\n className={[\"ds-sortable-list\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {ordered}\n </ul>\n </SortableContext>\n <DragOverlay>\n {activeId ? (\n <div className=\"ds-sortable-item\" data-overlay>\n <span className=\"ds-sortable-item__handle\" aria-hidden=\"true\">\n <Icon name=\"grip-vertical\" />\n </span>\n <div className=\"ds-sortable-item__content\">\n {renderDragOverlay ? renderDragOverlay(activeId) : activeRow?.props.children}\n </div>\n </div>\n ) : null}\n </DragOverlay>\n </DndContext>\n );\n },\n);\n\nexport interface SortableListItemProps extends HTMLAttributes<HTMLLIElement> {\n id: string;\n /** Accessible name announced when the row is picked up. */\n label?: string;\n /** A control at the end of the row, e.g. a menu or a delete button. */\n action?: ReactNode;\n children?: ReactNode;\n}\n\n/** One row of a `SortableList`. The grip on the left is the only handle. */\nexport const SortableListItem = forwardRef<HTMLLIElement, SortableListItemProps>(\n function SortableListItem({ id, label, action, className, children, ...rest }, ref) {\n const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({\n id,\n });\n\n return (\n <li\n ref={(node) => {\n setNodeRef(node);\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n style={{ transform: CSS.Translate.toString(transform), transition }}\n className={[\"ds-sortable-item\", className].filter(Boolean).join(\" \")}\n data-dragging={isDragging || undefined}\n {...rest}\n >\n <Button\n variant=\"simple\"\n size=\"sm\"\n isIconOnly\n iconStart=\"grip-vertical\"\n className=\"ds-sortable-item__handle\"\n aria-label={label ? `Move ${label}` : \"Move item\"}\n {...attributes}\n {...listeners}\n />\n <div className=\"ds-sortable-item__content\">{children}</div>\n {action && <div className=\"ds-sortable-item__action\">{action}</div>}\n </li>\n );\n },\n);\n"],"mappings":"A,sUA+CA,SAAS8B,EAAO,EAAwC,CACtD,OAAA,EAAO9B,EAAAA,eAAAA,CAAsC+B,CAAK,GAAK,OAAOA,EAAM,MAAM,IAAO,QACnF,CAQA,IAAaC,GAAA,EAAe/B,EAAAA,WAAAA,CAC1B,SAAsB,CAAE,QAAO,YAAW,oBAAmB,YAAW,WAAU,GAAGgC,GAAQ,EAAK,CAChG,IAAMC,GAAA,EAAQhC,EAAAA,MAAAA,CAAM,EACd,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B,CAAE,KAAI,QAAO,SAAQ,YAAW,WAAU,GAAGgC,GAAQ,EAAK,CAClF,GAAM,CAAE,aAAY,YAAW,aAAY,YAAW,aAAY,eAAA,EAAed,EAAAA,YAAAA,CAAY,CAC3F,IACF,CAAC,EAED,OACE,EAAAM,EAAA,KAAA,CAAC,KAAD,CACE,IAAM,GAAS,CACboC,EAAWC,CAAI,EACX,OAAOC,GAAQ,WAAYA,EAAID,CAAI,EAC9BC,IAAK,EAAI,QAAUD,EAC9B,EACA,MAAO,CAAE,UAAW1C,EAAAA,IAAI,UAAU,SAAS4C,CAAS,EAAG,YAAW,EAClE,UAAW,CAAC,mBAAoBN,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,EACnE,gBAAeO,GAAc,IAAA,GAC7B,GAAIhC,EATN,SAAA,EAWE,EAAAR,EAAA,IAAA,CAACJ,EAAAA,OAAD,CACE,QAAQ,SACR,KAAK,KACL,WAAA,GACA,UAAU,gBACV,UAAU,2BACV,aAAY6C,EAAQ,QAAQA,IAAU,YACtC,GAAIC,EACJ,GAAIC,CACL,CAAA,GACD,EAAA3C,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,4BAA6B,UAAc,CAAA,EACzD4C,IAAU,EAAA5C,EAAA,IAAA,CAAC,MAAD,CAAK,UAAU,2BAA4B,SAAA4C,CAAY,CAAA,CAChE,C,EAER,CACF,E"}
1
+ {"version":3,"file":"index.cjs","names":["isValidElement","forwardRef","useId","useState","useSensors","useSensor","PointerSensor","KeyboardSensor","sortableKeyboardCoordinates","useCallback","arrayMove","Children","DndContext","closestCenter","restrictToVerticalAxis","SortableContext","verticalListSortingStrategy","DragOverlay","Icon","useSortable","mergeRefs","CSS","Button","require_Icon","require_components_Button_index","require_mergeRefs","react","react_jsx_runtime","_dnd_kit_core","_dnd_kit_modifiers","_dnd_kit_sortable","_dnd_kit_utilities","isItem","child","SortableList","rest","dndId","activeId","setActiveId","order","setOrder","items","prevItems","setPrevItems","sensors","handleStart","event","handleEnd","over","active","from","to","next","onReorder","childArray","children","rows","ordered","id","activeRow","className","renderDragOverlay","SortableListItem","setNodeRef","ref","transform","isDragging","label","attributes","listeners","action"],"sources":["../../../src/components/SortableList/index.tsx"],"sourcesContent":["import {\n Children,\n forwardRef,\n isValidElement,\n useCallback,\n useId,\n useState,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport {\n DndContext,\n DragOverlay,\n KeyboardSensor,\n PointerSensor,\n closestCenter,\n useSensor,\n useSensors,\n type DragEndEvent,\n type DragStartEvent,\n} from \"@dnd-kit/core\";\nimport { restrictToVerticalAxis } from \"@dnd-kit/modifiers\";\nimport {\n SortableContext,\n arrayMove,\n sortableKeyboardCoordinates,\n useSortable,\n verticalListSortingStrategy,\n} from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport { Button } from \"../Button\";\nimport { Icon } from \"../Icon\";\nimport { mergeRefs } from \"../../internal/mergeRefs\";\nimport \"./style.css\";\n\nexport interface SortableListProps extends Omit<HTMLAttributes<HTMLUListElement>, \"onDragEnd\"> {\n /** Item ids in render order. */\n items: string[];\n /** Fired with the whole list in its new order. Apply it to your own state. */\n onReorder?: (items: string[]) => void;\n /** Rendered inside the drag overlay while a row is in the air. Defaults to the row's content. */\n renderDragOverlay?: (id: string) => ReactNode;\n children?: ReactNode;\n}\n\ntype ItemElement = ReactElement<SortableListItemProps>;\n\nfunction isItem(child: ReactNode): child is ItemElement {\n return isValidElement<SortableListItemProps>(child) && typeof child.props.id === \"string\";\n}\n\n/**\n * A single vertical list you can re-order — the board's mechanics without the\n * lanes. Each row carries a grip on the left. The list keeps the dropped order\n * itself, so it works on its own; pass `onReorder` to mirror it into your data.\n * A new `items` value from the parent always wins.\n */\nexport const SortableList = forwardRef<HTMLUListElement, SortableListProps>(\n function SortableList({ items, onReorder, renderDragOverlay, className, children, ...rest }, ref) {\n const dndId = useId();\n const [activeId, setActiveId] = useState<string | null>(null);\n const [order, setOrder] = useState(items);\n const [prevItems, setPrevItems] = useState(items);\n if (items !== prevItems && items.join(\"\\u0000\") !== prevItems.join(\"\\u0000\")) {\n setPrevItems(items);\n setOrder(items);\n }\n const sensors = useSensors(\n useSensor(PointerSensor, { activationConstraint: { distance: 4 } }),\n useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }),\n );\n\n const handleStart = useCallback((event: DragStartEvent) => {\n setActiveId(String(event.active.id));\n }, []);\n\n const handleEnd = useCallback(\n (event: DragEndEvent) => {\n setActiveId(null);\n const { active, over } = event;\n if (!over || active.id === over.id) return;\n const from = order.indexOf(String(active.id));\n const to = order.indexOf(String(over.id));\n if (from < 0 || to < 0) return;\n const next = arrayMove(order, from, to);\n setOrder(next);\n onReorder?.(next);\n },\n [order, onReorder],\n );\n\n // Rows follow the list's own order; anything that isn't a row keeps its place at the end.\n const childArray = Children.toArray(children);\n const rows = new Map(childArray.filter(isItem).map((child) => [child.props.id, child]));\n const ordered = [\n ...order.flatMap((id) => rows.get(id) ?? []),\n ...childArray.filter((child) => !isItem(child) || !order.includes(child.props.id)),\n ];\n const activeRow = activeId ? rows.get(activeId) : undefined;\n\n return (\n <DndContext\n id={`ds-sortable-list-${dndId}`}\n sensors={sensors}\n collisionDetection={closestCenter}\n modifiers={[restrictToVerticalAxis]}\n onDragStart={handleStart}\n onDragEnd={handleEnd}\n onDragCancel={() => setActiveId(null)}\n >\n <SortableContext items={order} strategy={verticalListSortingStrategy}>\n <ul\n ref={ref}\n className={[\"ds-sortable-list\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {ordered}\n </ul>\n </SortableContext>\n <DragOverlay>\n {activeId ? (\n <div className=\"ds-sortable-item\" data-overlay>\n <span className=\"ds-sortable-item__handle\" aria-hidden=\"true\">\n <Icon name=\"grip-vertical\" />\n </span>\n <div className=\"ds-sortable-item__content\">\n {renderDragOverlay ? renderDragOverlay(activeId) : activeRow?.props.children}\n </div>\n </div>\n ) : null}\n </DragOverlay>\n </DndContext>\n );\n },\n);\n\nexport interface SortableListItemProps extends HTMLAttributes<HTMLLIElement> {\n id: string;\n /** Accessible name announced when the row is picked up. */\n label?: string;\n /** A control at the end of the row, e.g. a menu or a delete button. */\n action?: ReactNode;\n children?: ReactNode;\n}\n\n/** One row of a `SortableList`. The grip on the left is the only handle. */\nexport const SortableListItem = forwardRef<HTMLLIElement, SortableListItemProps>(\n function SortableListItem({ id, label, action, className, children, ...rest }, ref) {\n const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({\n id,\n });\n\n return (\n <li\n ref={mergeRefs(setNodeRef, ref)}\n style={{ transform: CSS.Translate.toString(transform), transition }}\n className={[\"ds-sortable-item\", className].filter(Boolean).join(\" \")}\n data-dragging={isDragging || undefined}\n {...rest}\n >\n <Button\n variant=\"simple\"\n size=\"sm\"\n isIconOnly\n iconStart=\"grip-vertical\"\n className=\"ds-sortable-item__handle\"\n aria-label={label ? `Move ${label}` : \"Move item\"}\n {...attributes}\n {...listeners}\n />\n <div className=\"ds-sortable-item__content\">{children}</div>\n {action && <div className=\"ds-sortable-item__action\">{action}</div>}\n </li>\n );\n },\n);\n"],"mappings":"A,uXAgDA,SAASgC,EAAO,EAAwC,CACtD,OAAA,EAAOhC,EAAAA,eAAAA,CAAsCiC,CAAK,GAAK,OAAOA,EAAM,MAAM,IAAO,QACnF,CAQA,IAAaC,GAAA,EAAejC,EAAAA,WAAAA,CAC1B,SAAsB,CAAE,QAAO,YAAW,oBAAmB,YAAW,WAAU,GAAGkC,GAAQ,EAAK,CAChG,IAAMC,GAAA,EAAQlC,EAAAA,MAAAA,CAAM,EACd,CAACmC,EAAUC,IAAA,EAAenC,EAAAA,SAAAA,CAAwB,IAAI,EACtD,CAACoC,EAAOC,IAAA,EAAYrC,EAAAA,SAAAA,CAASsC,CAAK,EAClC,CAACC,EAAWC,IAAA,EAAgBxC,EAAAA,SAAAA,CAASsC,CAAK,EAC5CA,IAAUC,GAAaD,EAAM,KAAK,IAAQ,IAA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Aa,CAAC;IAC1E,EAAE,EAAE,MAAM,CAAC;IACX,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,4EAA4E;AAC5E,eAAO,MAAM,gBAAgB,iHAiC5B,CAAC"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/SortableList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,cAAc,EAEnB,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAwBf,OAAO,aAAa,CAAC;AAErB,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,WAAW,CAAC;IAC5F,gCAAgC;IAChC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACtC,iGAAiG;IACjG,iBAAiB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,SAAS,CAAC;IAC9C,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAQD;;;;;GAKG;AACH,eAAO,MAAM,YAAY,gHA6ExB,CAAC;AAEF,MAAM,WAAW,qBAAsB,SAAQ,cAAc,CAAC,aAAa,CAAC;IAC1E,EAAE,EAAE,MAAM,CAAC;IACX,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,4EAA4E;AAC5E,eAAO,MAAM,gBAAgB,iHA6B5B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/SortableList/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAOL,KA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EAAE,EAAE,MAAM,KAAK,SAAS,CAAC;IAC9C,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAQD;;;;;GAKG;AACH,eAAO,MAAM,YAAY,gHA6ExB,CAAC;AAEF,MAAM,WAAW,qBAAsB,SAAQ,cAAc,CAAC,aAAa,CAAC;IAC1E,EAAE,EAAE,MAAM,CAAC;IACX,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uEAAuE;IACvE,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,4EAA4E;AAC5E,eAAO,MAAM,gBAAgB,iHA6B5B,CAAC"}
@@ -1,95 +1,94 @@
1
1
  import { t as e } from "../../chunks/Icon-CGY1FNXT.js";
2
2
  import { Button as t } from "../Button/index.js";
3
- import { Children as n, forwardRef as r, isValidElement as i, useCallback as a, useId as o, useState as s } from "react";
4
- import { jsx as c, jsxs as l } from "react/jsx-runtime";
5
- import { DndContext as u, DragOverlay as d, KeyboardSensor as f, PointerSensor as p, closestCenter as m, useSensor as h, useSensors as g } from "@dnd-kit/core";
6
- import { restrictToVerticalAxis as _ } from "@dnd-kit/modifiers";
7
- import { SortableContext as v, arrayMove as y, sortableKeyboardCoordinates as b, useSortable as x, verticalListSortingStrategy as S } from "@dnd-kit/sortable";
8
- import { CSS as C } from "@dnd-kit/utilities";
3
+ import { t as n } from "../../chunks/mergeRefs-DGM402mE.js";
4
+ import { Children as r, forwardRef as i, isValidElement as a, useCallback as o, useId as s, useState as c } from "react";
5
+ import { jsx as l, jsxs as u } from "react/jsx-runtime";
6
+ import { DndContext as d, DragOverlay as f, KeyboardSensor as p, PointerSensor as m, closestCenter as h, useSensor as g, useSensors as _ } from "@dnd-kit/core";
7
+ import { restrictToVerticalAxis as v } from "@dnd-kit/modifiers";
8
+ import { SortableContext as y, arrayMove as b, sortableKeyboardCoordinates as x, useSortable as S, verticalListSortingStrategy as C } from "@dnd-kit/sortable";
9
+ import { CSS as w } from "@dnd-kit/utilities";
9
10
  //#region src/components/SortableList/index.tsx
10
- function w(e) {
11
- return i(e) && typeof e.props.id == "string";
11
+ function T(e) {
12
+ return a(e) && typeof e.props.id == "string";
12
13
  }
13
- var T = r(function({ items: t, onReorder: r, renderDragOverlay: i, className: x, children: C, ...T }, E) {
14
- let D = o(), [O, k] = s(null), [A, j] = s(t), [M, N] = s(t);
14
+ var E = i(function({ items: t, onReorder: n, renderDragOverlay: i, className: a, children: S, ...w }, E) {
15
+ let D = s(), [O, k] = c(null), [A, j] = c(t), [M, N] = c(t);
15
16
  t !== M && t.join("\0") !== M.join("\0") && (N(t), j(t));
16
- let P = g(h(p, { activationConstraint: { distance: 4 } }), h(f, { coordinateGetter: b })), F = a((e) => {
17
+ let P = _(g(m, { activationConstraint: { distance: 4 } }), g(p, { coordinateGetter: x })), F = o((e) => {
17
18
  k(String(e.active.id));
18
- }, []), I = a((e) => {
19
+ }, []), I = o((e) => {
19
20
  k(null);
20
- let { active: t, over: n } = e;
21
- if (!n || t.id === n.id) return;
22
- let i = A.indexOf(String(t.id)), a = A.indexOf(String(n.id));
21
+ let { active: t, over: r } = e;
22
+ if (!r || t.id === r.id) return;
23
+ let i = A.indexOf(String(t.id)), a = A.indexOf(String(r.id));
23
24
  if (i < 0 || a < 0) return;
24
- let o = y(A, i, a);
25
- j(o), r?.(o);
26
- }, [A, r]), L = n.toArray(C), R = new Map(L.filter(w).map((e) => [e.props.id, e])), z = [...A.flatMap((e) => R.get(e) ?? []), ...L.filter((e) => !w(e) || !A.includes(e.props.id))], B = O ? R.get(O) : void 0;
27
- return /* @__PURE__ */ l(u, {
25
+ let o = b(A, i, a);
26
+ j(o), n?.(o);
27
+ }, [A, n]), L = r.toArray(S), R = new Map(L.filter(T).map((e) => [e.props.id, e])), z = [...A.flatMap((e) => R.get(e) ?? []), ...L.filter((e) => !T(e) || !A.includes(e.props.id))], B = O ? R.get(O) : void 0;
28
+ return /* @__PURE__ */ u(d, {
28
29
  id: `ds-sortable-list-${D}`,
29
30
  sensors: P,
30
- collisionDetection: m,
31
- modifiers: [_],
31
+ collisionDetection: h,
32
+ modifiers: [v],
32
33
  onDragStart: F,
33
34
  onDragEnd: I,
34
35
  onDragCancel: () => k(null),
35
- children: [/* @__PURE__ */ c(v, {
36
+ children: [/* @__PURE__ */ l(y, {
36
37
  items: A,
37
- strategy: S,
38
- children: /* @__PURE__ */ c("ul", {
38
+ strategy: C,
39
+ children: /* @__PURE__ */ l("ul", {
39
40
  ref: E,
40
- className: ["ds-sortable-list", x].filter(Boolean).join(" "),
41
- ...T,
41
+ className: ["ds-sortable-list", a].filter(Boolean).join(" "),
42
+ ...w,
42
43
  children: z
43
44
  })
44
- }), /* @__PURE__ */ c(d, { children: O ? /* @__PURE__ */ l("div", {
45
+ }), /* @__PURE__ */ l(f, { children: O ? /* @__PURE__ */ u("div", {
45
46
  className: "ds-sortable-item",
46
47
  "data-overlay": !0,
47
- children: [/* @__PURE__ */ c("span", {
48
+ children: [/* @__PURE__ */ l("span", {
48
49
  className: "ds-sortable-item__handle",
49
50
  "aria-hidden": "true",
50
- children: /* @__PURE__ */ c(e, { name: "grip-vertical" })
51
- }), /* @__PURE__ */ c("div", {
51
+ children: /* @__PURE__ */ l(e, { name: "grip-vertical" })
52
+ }), /* @__PURE__ */ l("div", {
52
53
  className: "ds-sortable-item__content",
53
54
  children: i ? i(O) : B?.props.children
54
55
  })]
55
56
  }) : null })]
56
57
  });
57
- }), E = r(function({ id: e, label: n, action: r, className: i, children: a, ...o }, s) {
58
- let { attributes: u, listeners: d, setNodeRef: f, transform: p, transition: m, isDragging: h } = x({ id: e });
59
- return /* @__PURE__ */ l("li", {
60
- ref: (e) => {
61
- f(e), typeof s == "function" ? s(e) : s && (s.current = e);
62
- },
58
+ }), D = i(function({ id: e, label: r, action: i, className: a, children: o, ...s }, c) {
59
+ let { attributes: d, listeners: f, setNodeRef: p, transform: m, transition: h, isDragging: g } = S({ id: e });
60
+ return /* @__PURE__ */ u("li", {
61
+ ref: n(p, c),
63
62
  style: {
64
- transform: C.Translate.toString(p),
65
- transition: m
63
+ transform: w.Translate.toString(m),
64
+ transition: h
66
65
  },
67
- className: ["ds-sortable-item", i].filter(Boolean).join(" "),
68
- "data-dragging": h || void 0,
69
- ...o,
66
+ className: ["ds-sortable-item", a].filter(Boolean).join(" "),
67
+ "data-dragging": g || void 0,
68
+ ...s,
70
69
  children: [
71
- /* @__PURE__ */ c(t, {
70
+ /* @__PURE__ */ l(t, {
72
71
  variant: "simple",
73
72
  size: "sm",
74
73
  isIconOnly: !0,
75
74
  iconStart: "grip-vertical",
76
75
  className: "ds-sortable-item__handle",
77
- "aria-label": n ? `Move ${n}` : "Move item",
78
- ...u,
79
- ...d
76
+ "aria-label": r ? `Move ${r}` : "Move item",
77
+ ...d,
78
+ ...f
80
79
  }),
81
- /* @__PURE__ */ c("div", {
80
+ /* @__PURE__ */ l("div", {
82
81
  className: "ds-sortable-item__content",
83
- children: a
82
+ children: o
84
83
  }),
85
- r && /* @__PURE__ */ c("div", {
84
+ i && /* @__PURE__ */ l("div", {
86
85
  className: "ds-sortable-item__action",
87
- children: r
86
+ children: i
88
87
  })
89
88
  ]
90
89
  });
91
90
  });
92
91
  //#endregion
93
- export { T as SortableList, E as SortableListItem };
92
+ export { E as SortableList, D as SortableListItem };
94
93
 
95
94
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["Icon","isItem","isValidElement","child","SortableList","forwardRef","rest","dndId","useId","activeId","setActiveId","useState","order","setOrder","items","prevItems","setPrevItems","sensors","useSensors","useSensor","PointerSensor","KeyboardSensor","sortableKeyboardCoordinates","handleStart","useCallback","event","handleEnd","over","active","from","to","next","arrayMove","onReorder","childArray","Children","children","rows","ordered","id","activeRow","DndContext","closestCenter","restrictToVerticalAxis","SortableContext","verticalListSortingStrategy","className","DragOverlay","renderDragOverlay","SortableListItem","useSortable","setNodeRef","node","ref","CSS","transform","isDragging","Button","label","attributes","listeners","action"],"sources":["../../../src/components/SortableList/index.tsx"],"sourcesContent":["import {\n Children,\n forwardRef,\n isValidElement,\n useCallback,\n useId,\n useState,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport {\n DndContext,\n DragOverlay,\n KeyboardSensor,\n PointerSensor,\n closestCenter,\n useSensor,\n useSensors,\n type DragEndEvent,\n type DragStartEvent,\n} from \"@dnd-kit/core\";\nimport { restrictToVerticalAxis } from \"@dnd-kit/modifiers\";\nimport {\n SortableContext,\n arrayMove,\n sortableKeyboardCoordinates,\n useSortable,\n verticalListSortingStrategy,\n} from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport { Button } from \"../Button\";\nimport { Icon } from \"../Icon\";\nimport \"./style.css\";\n\nexport interface SortableListProps extends Omit<HTMLAttributes<HTMLUListElement>, \"onDragEnd\"> {\n /** Item ids in render order. */\n items: string[];\n /** Fired with the whole list in its new order. Apply it to your own state. */\n onReorder?: (items: string[]) => void;\n /** Rendered inside the drag overlay while a row is in the air. Defaults to the row's content. */\n renderDragOverlay?: (id: string) => ReactNode;\n children?: ReactNode;\n}\n\ntype ItemElement = ReactElement<SortableListItemProps>;\n\nfunction isItem(child: ReactNode): child is ItemElement {\n return isValidElement<SortableListItemProps>(child) && typeof child.props.id === \"string\";\n}\n\n/**\n * A single vertical list you can re-order — the board's mechanics without the\n * lanes. Each row carries a grip on the left. The list keeps the dropped order\n * itself, so it works on its own; pass `onReorder` to mirror it into your data.\n * A new `items` value from the parent always wins.\n */\nexport const SortableList = forwardRef<HTMLUListElement, SortableListProps>(\n function SortableList({ items, onReorder, renderDragOverlay, className, children, ...rest }, ref) {\n const dndId = useId();\n const [activeId, setActiveId] = useState<string | null>(null);\n const [order, setOrder] = useState(items);\n const [prevItems, setPrevItems] = useState(items);\n if (items !== prevItems && items.join(\"\\u0000\") !== prevItems.join(\"\\u0000\")) {\n setPrevItems(items);\n setOrder(items);\n }\n const sensors = useSensors(\n useSensor(PointerSensor, { activationConstraint: { distance: 4 } }),\n useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }),\n );\n\n const handleStart = useCallback((event: DragStartEvent) => {\n setActiveId(String(event.active.id));\n }, []);\n\n const handleEnd = useCallback(\n (event: DragEndEvent) => {\n setActiveId(null);\n const { active, over } = event;\n if (!over || active.id === over.id) return;\n const from = order.indexOf(String(active.id));\n const to = order.indexOf(String(over.id));\n if (from < 0 || to < 0) return;\n const next = arrayMove(order, from, to);\n setOrder(next);\n onReorder?.(next);\n },\n [order, onReorder],\n );\n\n // Rows follow the list's own order; anything that isn't a row keeps its place at the end.\n const childArray = Children.toArray(children);\n const rows = new Map(childArray.filter(isItem).map((child) => [child.props.id, child]));\n const ordered = [\n ...order.flatMap((id) => rows.get(id) ?? []),\n ...childArray.filter((child) => !isItem(child) || !order.includes(child.props.id)),\n ];\n const activeRow = activeId ? rows.get(activeId) : undefined;\n\n return (\n <DndContext\n id={`ds-sortable-list-${dndId}`}\n sensors={sensors}\n collisionDetection={closestCenter}\n modifiers={[restrictToVerticalAxis]}\n onDragStart={handleStart}\n onDragEnd={handleEnd}\n onDragCancel={() => setActiveId(null)}\n >\n <SortableContext items={order} strategy={verticalListSortingStrategy}>\n <ul\n ref={ref}\n className={[\"ds-sortable-list\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {ordered}\n </ul>\n </SortableContext>\n <DragOverlay>\n {activeId ? (\n <div className=\"ds-sortable-item\" data-overlay>\n <span className=\"ds-sortable-item__handle\" aria-hidden=\"true\">\n <Icon name=\"grip-vertical\" />\n </span>\n <div className=\"ds-sortable-item__content\">\n {renderDragOverlay ? renderDragOverlay(activeId) : activeRow?.props.children}\n </div>\n </div>\n ) : null}\n </DragOverlay>\n </DndContext>\n );\n },\n);\n\nexport interface SortableListItemProps extends HTMLAttributes<HTMLLIElement> {\n id: string;\n /** Accessible name announced when the row is picked up. */\n label?: string;\n /** A control at the end of the row, e.g. a menu or a delete button. */\n action?: ReactNode;\n children?: ReactNode;\n}\n\n/** One row of a `SortableList`. The grip on the left is the only handle. */\nexport const SortableListItem = forwardRef<HTMLLIElement, SortableListItemProps>(\n function SortableListItem({ id, label, action, className, children, ...rest }, ref) {\n const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({\n id,\n });\n\n return (\n <li\n ref={(node) => {\n setNodeRef(node);\n if (typeof ref === \"function\") ref(node);\n else if (ref) ref.current = node;\n }}\n style={{ transform: CSS.Translate.toString(transform), transition }}\n className={[\"ds-sortable-item\", className].filter(Boolean).join(\" \")}\n data-dragging={isDragging || undefined}\n {...rest}\n >\n <Button\n variant=\"simple\"\n size=\"sm\"\n isIconOnly\n iconStart=\"grip-vertical\"\n className=\"ds-sortable-item__handle\"\n aria-label={label ? `Move ${label}` : \"Move item\"}\n {...attributes}\n {...listeners}\n />\n <div className=\"ds-sortable-item__content\">{children}</div>\n {action && <div className=\"ds-sortable-item__action\">{action}</div>}\n </li>\n );\n },\n);\n"],"mappings":";;;;;;;;;AA+CA,SAASC,EAAO,GAAwC;CACtD,OAAOC,EAAsCC,CAAK,KAAK,OAAOA,EAAM,MAAM,MAAO;AACnF;AAQA,IAAaC,IAAeC,EAC1B,SAAsB,EAAE,UAAO,cAAW,sBAAmB,cAAW,aAAU,GAAGC,KAAQ,GAAK;CAChG,IAAMC,IAAQC,EAAM,GACd,CAACC,GAAUC,KAAeC,EAAwB,IAAI,GACtD,CAACC,GAAOC,KAAYF,EAASG,CAAK,GAClC,CAACC,GAAWC,KAAgBL,EAASG,CAAK;CAChD,AAAIA,MAAUC,KAAaD,EAAM,KAAK,IAAQ,MAAMC,EAAU,KAAK,IAAQ,MACzEC,EAAaF,CAAK,GAClBD,EAASC,CAAK;CAEhB,IAAMG,IAAUC,EACdC,EAAUC,GAAe,EAAE,sBAAsB,EAAE,UAAU,EAAE,EAAE,CAAC,GAClED,EAAUE,GAAgB,EAAE,kBAAkBC,EAA4B,CAAC,CAC7E,GAEMC,IAAcC,G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,UAAAgC;GACC,CAAA;EACW,CAAA,GACjB,kBAACS,GAAD,EAAA,UACGtC,IACC,kBAAC,OAAD;GAAK,WAAU;GAAmB,gBAAA;GAAlC,UAAA,CACE,kBAAC,QAAD;IAAM,WAAU;IAA2B,eAAY;IACrD,UAAA,kBAACT,GAAD,EAAM,MAAK,gBAAiB,CAAA;GACxB,CAAA,GACN,kBAAC,OAAD;IAAK,WAAU;IACZ,UAAAgD,IAAoBA,EAAkBvC,CAAQ,IAAI+B,GAAW,MAAM;GACjE,CAAA,CACF;EACH,CAAA,IAAA,KACO,CAAA,CACH;;AAEhB,CACF,GAYaS,IAAmB5C,EAC9B,SAA0B,EAAE,OAAI,UAAO,WAAQ,cAAW,aAAU,GAAGC,KAAQ,GAAK;CAClF,IAAM,EAAE,eAAY,cAAW,eAAY,cAAW,eAAY,kBAAe4C,EAAY,EAC3F,MACF,CAAC;CAED,OACE,kBAAC,MAAD;EACE,MAAM,MAAS;GAEb,AADAC,EAAWC,CAAI,GACX,OAAOC,KAAQ,aAAYA,EAAID,CAAI,IAC9BC,MAAK,EAAI,UAAUD;EAC9B;EACA,OAAO;GAAE,WAAWE,EAAI,UAAU,SAASC,CAAS;GAAG;EAAW;EAClE,WAAW,CAAC,oBAAoBT,CAAS,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG;EACnE,iBAAeU,KAAc,KAAA;EAC7B,GAAIlD;EATN,UAAA;GAWE,kBAACmD,GAAD;IACE,SAAQ;IACR,MAAK;IACL,YAAA;IACA,WAAU;IACV,WAAU;IACV,cAAYC,IAAQ,QAAQA,MAAU;IACtC,GAAIC;IACJ,GAAIC;GACL,CAAA;GACD,kBAAC,OAAD;IAAK,WAAU;IAA6B;GAAc,CAAA;GACzDC,KAAU,kBAAC,OAAD;IAAK,WAAU;IAA4B,UAAAA;GAAY,CAAA;EAChE;;AAER,CACF"}
1
+ {"version":3,"file":"index.js","names":["Icon","mergeRefs","isItem","isValidElement","child","SortableList","forwardRef","rest","dndId","useId","activeId","setActiveId","useState","order","setOrder","items","prevItems","setPrevItems","sensors","useSensors","useSensor","PointerSensor","KeyboardSensor","sortableKeyboardCoordinates","handleStart","useCallback","event","handleEnd","over","active","from","to","next","arrayMove","onReorder","childArray","Children","children","rows","ordered","id","activeRow","DndContext","closestCenter","restrictToVerticalAxis","SortableContext","verticalListSortingStrategy","className","DragOverlay","renderDragOverlay","SortableListItem","useSortable","setNodeRef","ref","CSS","transform","isDragging","Button","label","attributes","listeners","action"],"sources":["../../../src/components/SortableList/index.tsx"],"sourcesContent":["import {\n Children,\n forwardRef,\n isValidElement,\n useCallback,\n useId,\n useState,\n type HTMLAttributes,\n type ReactElement,\n type ReactNode,\n} from \"react\";\nimport {\n DndContext,\n DragOverlay,\n KeyboardSensor,\n PointerSensor,\n closestCenter,\n useSensor,\n useSensors,\n type DragEndEvent,\n type DragStartEvent,\n} from \"@dnd-kit/core\";\nimport { restrictToVerticalAxis } from \"@dnd-kit/modifiers\";\nimport {\n SortableContext,\n arrayMove,\n sortableKeyboardCoordinates,\n useSortable,\n verticalListSortingStrategy,\n} from \"@dnd-kit/sortable\";\nimport { CSS } from \"@dnd-kit/utilities\";\nimport { Button } from \"../Button\";\nimport { Icon } from \"../Icon\";\nimport { mergeRefs } from \"../../internal/mergeRefs\";\nimport \"./style.css\";\n\nexport interface SortableListProps extends Omit<HTMLAttributes<HTMLUListElement>, \"onDragEnd\"> {\n /** Item ids in render order. */\n items: string[];\n /** Fired with the whole list in its new order. Apply it to your own state. */\n onReorder?: (items: string[]) => void;\n /** Rendered inside the drag overlay while a row is in the air. Defaults to the row's content. */\n renderDragOverlay?: (id: string) => ReactNode;\n children?: ReactNode;\n}\n\ntype ItemElement = ReactElement<SortableListItemProps>;\n\nfunction isItem(child: ReactNode): child is ItemElement {\n return isValidElement<SortableListItemProps>(child) && typeof child.props.id === \"string\";\n}\n\n/**\n * A single vertical list you can re-order — the board's mechanics without the\n * lanes. Each row carries a grip on the left. The list keeps the dropped order\n * itself, so it works on its own; pass `onReorder` to mirror it into your data.\n * A new `items` value from the parent always wins.\n */\nexport const SortableList = forwardRef<HTMLUListElement, SortableListProps>(\n function SortableList({ items, onReorder, renderDragOverlay, className, children, ...rest }, ref) {\n const dndId = useId();\n const [activeId, setActiveId] = useState<string | null>(null);\n const [order, setOrder] = useState(items);\n const [prevItems, setPrevItems] = useState(items);\n if (items !== prevItems && items.join(\"\\u0000\") !== prevItems.join(\"\\u0000\")) {\n setPrevItems(items);\n setOrder(items);\n }\n const sensors = useSensors(\n useSensor(PointerSensor, { activationConstraint: { distance: 4 } }),\n useSensor(KeyboardSensor, { coordinateGetter: sortableKeyboardCoordinates }),\n );\n\n const handleStart = useCallback((event: DragStartEvent) => {\n setActiveId(String(event.active.id));\n }, []);\n\n const handleEnd = useCallback(\n (event: DragEndEvent) => {\n setActiveId(null);\n const { active, over } = event;\n if (!over || active.id === over.id) return;\n const from = order.indexOf(String(active.id));\n const to = order.indexOf(String(over.id));\n if (from < 0 || to < 0) return;\n const next = arrayMove(order, from, to);\n setOrder(next);\n onReorder?.(next);\n },\n [order, onReorder],\n );\n\n // Rows follow the list's own order; anything that isn't a row keeps its place at the end.\n const childArray = Children.toArray(children);\n const rows = new Map(childArray.filter(isItem).map((child) => [child.props.id, child]));\n const ordered = [\n ...order.flatMap((id) => rows.get(id) ?? []),\n ...childArray.filter((child) => !isItem(child) || !order.includes(child.props.id)),\n ];\n const activeRow = activeId ? rows.get(activeId) : undefined;\n\n return (\n <DndContext\n id={`ds-sortable-list-${dndId}`}\n sensors={sensors}\n collisionDetection={closestCenter}\n modifiers={[restrictToVerticalAxis]}\n onDragStart={handleStart}\n onDragEnd={handleEnd}\n onDragCancel={() => setActiveId(null)}\n >\n <SortableContext items={order} strategy={verticalListSortingStrategy}>\n <ul\n ref={ref}\n className={[\"ds-sortable-list\", className].filter(Boolean).join(\" \")}\n {...rest}\n >\n {ordered}\n </ul>\n </SortableContext>\n <DragOverlay>\n {activeId ? (\n <div className=\"ds-sortable-item\" data-overlay>\n <span className=\"ds-sortable-item__handle\" aria-hidden=\"true\">\n <Icon name=\"grip-vertical\" />\n </span>\n <div className=\"ds-sortable-item__content\">\n {renderDragOverlay ? renderDragOverlay(activeId) : activeRow?.props.children}\n </div>\n </div>\n ) : null}\n </DragOverlay>\n </DndContext>\n );\n },\n);\n\nexport interface SortableListItemProps extends HTMLAttributes<HTMLLIElement> {\n id: string;\n /** Accessible name announced when the row is picked up. */\n label?: string;\n /** A control at the end of the row, e.g. a menu or a delete button. */\n action?: ReactNode;\n children?: ReactNode;\n}\n\n/** One row of a `SortableList`. The grip on the left is the only handle. */\nexport const SortableListItem = forwardRef<HTMLLIElement, SortableListItemProps>(\n function SortableListItem({ id, label, action, className, children, ...rest }, ref) {\n const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({\n id,\n });\n\n return (\n <li\n ref={mergeRefs(setNodeRef, ref)}\n style={{ transform: CSS.Translate.toString(transform), transition }}\n className={[\"ds-sortable-item\", className].filter(Boolean).join(\" \")}\n data-dragging={isDragging || undefined}\n {...rest}\n >\n <Button\n variant=\"simple\"\n size=\"sm\"\n isIconOnly\n iconStart=\"grip-vertical\"\n className=\"ds-sortable-item__handle\"\n aria-label={label ? `Move ${label}` : \"Move item\"}\n {...attributes}\n {...listeners}\n />\n <div className=\"ds-sortable-item__content\">{children}</div>\n {action && <div className=\"ds-sortable-item__action\">{action}</div>}\n </li>\n );\n },\n);\n"],"mappings":";;;;;;;;;;AAgDA,SAASE,EAAO,GAAwC;CACtD,OAAOC,EAAsCC,CAAK,KAAK,OAAOA,EAAM,MAAM,MAAO;AACnF;AAQA,IAAaC,IAAeC,EAC1B,SAAsB,EAAE,UAAO,cAAW,sBAAmB,cAAW,aAAU,GAAGC,KAAQ,GAAK;CAChG,IAAMC,IAAQC,EAAM,GACd,CAACC,GAAUC,KAAeC,EAAwB,IAAI,GACtD,CAACC,GAAOC,KAAYF,EAASG,CAAK,GAClC,CAACC,GAAWC,KAA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L,CAAA;GACD,kBAAC,OAAD;IAAK,WAAU;IAA6B;GAAc,CAAA;GACzDC,KAAU,kBAAC,OAAD;IAAK,WAAU;IAA4B,UAAAA;GAAY,CAAA;EAChE;;AAER,CACF"}
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./chunks/Icon-CWsA1W83.cjs"),t=require("./components/Button/index.cjs"),n=require("./components/Drawer/index.cjs"),r=require("./components/SideNav/index.cjs"),i=require("./components/TopNav/index.cjs"),a=require("./components/AppShell/index.cjs"),o=require("./components/ButtonGroup/index.cjs"),s=require("./components/Field/index.cjs"),c=require("./components/Modal/index.cjs"),l=require("./components/TextField/index.cjs"),u=require("./chunks/RichTextEditor-DC_0oN1s.cjs"),d=require("./components/Badge/index.cjs"),f=require("./components/FieldAffix/index.cjs"),p=require("./components/SearchField/index.cjs"),m=require("./components/SortableList/index.cjs"),h=require("./components/EntryPicker/index.cjs"),g=require("./components/NumberField/index.cjs"),_=require("./components/Switch/index.cjs"),v=require("./chunks/EntryEditor-C32lKKnV.cjs"),y=require("./components/Board/index.cjs"),b=require("./components/Avatar/index.cjs"),x=require("./components/Grid/index.cjs"),S=require("./components/Choice/index.cjs"),C=require("./components/Table/index.cjs"),w=require("./components/Popover/index.cjs"),T=require("./components/Menu/index.cjs"),E=require("./components/Toast/index.cjs"),D=require("./components/Skeleton/index.cjs"),O=require("./components/SubNav/index.cjs"),k=require("./components/SelectionCard/index.cjs"),A=require("./components/Stepper/index.cjs"),j=require("./components/AssetGrid/index.cjs"),M=require("./components/Slider/index.cjs"),N=require("./components/ImageCropper/index.cjs"),P=require("./components/Container/index.cjs"),F=require("./components/Select/index.cjs"),I=require("./components/DatePicker/index.cjs"),L=require("./components/TagsInput/index.cjs"),R=require("./components/Time/index.cjs"),z=require("./components/Pagination/index.cjs");exports.AppShell=a.AppShell,exports.AssetGrid=j.AssetGrid,exports.AssetGridEmpty=j.AssetGridEmpty,exports.AssetTile=j.AssetTile,exports.AssetTileSkeleton=j.AssetTileSkeleton,exports.Avatar=b.Avatar,exports.AvatarGroup=b.AvatarGroup,exports.Badge=d.Badge,exports.Board=y.Board,exports.BoardCard=y.BoardCard,exports.BoardColumn=y.BoardColumn,exports.Button=t.Button,exports.ButtonGroup=o.ButtonGroup,exports.Calendar=I.Calendar,exports.Checkbox=S.Checkbox,exports.CheckboxCard=k.CheckboxCard,exports.ChoiceGroup=S.ChoiceGroup,exports.Container=P.Container,exports.DateField=I.DateField,exports.DateRangeField=I.DateRangeField,exports.Drawer=n.Drawer,exports.EntryEditor=v.t,exports.EntryPicker=h.EntryPicker,exports.Field=s.Field,exports.FieldAffix=f.FieldAffix,exports.Grid=x.Grid,exports.GridItem=x.GridItem,exports.Icon=e.t,exports.ImageCropper=N.ImageCropper,exports.Menu=T.Menu,exports.MenuItem=T.MenuItem,exports.MenuLabel=T.MenuLabel,exports.MenuSeparator=T.MenuSeparator,exports.Modal=c.Modal,exports.NumberField=g.NumberField,exports.NumberRangeField=g.NumberRangeField,exports.Pagination=z.Pagination,exports.Popover=w.Popover,exports.Radio=S.Radio,exports.RadioCard=k.RadioCard,exports.RangeSlider=M.RangeSlider,exports.RichTextEditor=u.t,exports.SearchField=p.SearchField,exports.Select=F.Select,exports.SelectionCardGroup=k.SelectionCardGroup,exports.SideNav=r.SideNav,exports.SideNavFooter=r.SideNavFooter,exports.SideNavHeader=r.SideNavHeader,exports.SideNavItem=r.SideNavItem,exports.SideNavSection=r.SideNavSection,exports.Skeleton=D.Skeleton,exports.SkeletonText=D.SkeletonText,exports.Slider=M.Slider,exports.SortableList=m.SortableList,exports.SortableListItem=m.SortableListItem,exports.Stack=x.Stack,exports.Stepper=A.Stepper,exports.SubNav=O.SubNav,exports.SubNavButton=O.SubNavButton,exports.SubNavItem=O.SubNavItem,exports.Switch=_.Switch,exports.Table=C.Table,exports.TableBody=C.TableBody,exports.TableCell=C.TableCell,exports.TableEmpty=C.TableEmpty,exports.TableFrame=C.TableFrame,exports.TableHead=C.TableHead,exports.TableHeaderCell=C.TableHeaderCell,exports.TableRow=C.TableRow,exports.TableToolbar=C.TableToolbar,exports.TagsInput=L.TagsInput,exports.TextArea=l.TextArea,exports.TextField=l.TextField,exports.Time=R.Time,exports.Toast=E.Toast,exports.ToastProvider=E.ToastProvider,exports.TopNav=i.TopNav,exports.TopNavItem=i.TopNavItem,exports.cropToBlob=N.cropToBlob,exports.formatAbsoluteDate=R.formatAbsoluteDate,exports.formatAbsoluteTime=R.formatAbsoluteTime,exports.formatIsoDate=I.formatIsoDate,exports.formatRelativeTime=R.formatRelativeTime,exports.iconNames=e.n,exports.icons=e.r,exports.useSideNavCollapsed=r.useSideNavCollapsed,exports.useToast=E.useToast,exports.validateEntryValues=v.n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./chunks/Icon-CWsA1W83.cjs"),t=require("./components/Button/index.cjs"),n=require("./components/Drawer/index.cjs"),r=require("./components/SideNav/index.cjs"),i=require("./components/TopNav/index.cjs"),a=require("./components/AppShell/index.cjs"),o=require("./components/ButtonGroup/index.cjs"),s=require("./components/Field/index.cjs"),c=require("./components/Modal/index.cjs"),l=require("./components/TextField/index.cjs"),u=require("./chunks/RichTextEditor-BxtlbjXj.cjs"),d=require("./components/Badge/index.cjs"),f=require("./components/FieldAffix/index.cjs"),p=require("./components/SearchField/index.cjs"),m=require("./components/SortableList/index.cjs"),h=require("./components/EntryPicker/index.cjs"),g=require("./components/NumberField/index.cjs"),_=require("./components/Switch/index.cjs"),v=require("./chunks/EntryEditor-DIpc1iPF.cjs"),y=require("./chunks/Board-BLhB5_xx.cjs"),b=require("./components/Avatar/index.cjs"),x=require("./components/Grid/index.cjs"),S=require("./components/Choice/index.cjs"),C=require("./components/Table/index.cjs"),w=require("./components/Popover/index.cjs"),T=require("./components/Menu/index.cjs"),E=require("./components/Toast/index.cjs"),D=require("./components/Skeleton/index.cjs"),O=require("./components/SubNav/index.cjs"),k=require("./components/SelectionCard/index.cjs"),A=require("./components/Stepper/index.cjs"),j=require("./components/AssetGrid/index.cjs"),M=require("./components/Slider/index.cjs"),N=require("./components/ImageCropper/index.cjs"),P=require("./components/Container/index.cjs"),F=require("./components/Select/index.cjs"),I=require("./components/DatePicker/index.cjs"),L=require("./components/TagsInput/index.cjs"),R=require("./components/Time/index.cjs"),z=require("./components/Pagination/index.cjs");exports.AppShell=a.AppShell,exports.AssetGrid=j.AssetGrid,exports.AssetGridEmpty=j.AssetGridEmpty,exports.AssetTile=j.AssetTile,exports.AssetTileSkeleton=j.AssetTileSkeleton,exports.Avatar=b.Avatar,exports.AvatarGroup=b.AvatarGroup,exports.Badge=d.Badge,exports.Board=y.t,exports.BoardCard=y.n,exports.BoardColumn=y.r,exports.Button=t.Button,exports.ButtonGroup=o.ButtonGroup,exports.Calendar=I.Calendar,exports.Checkbox=S.Checkbox,exports.CheckboxCard=k.CheckboxCard,exports.ChoiceGroup=S.ChoiceGroup,exports.Container=P.Container,exports.DateField=I.DateField,exports.DateRangeField=I.DateRangeField,exports.Drawer=n.Drawer,exports.EntryEditor=v.t,exports.EntryPicker=h.EntryPicker,exports.Field=s.Field,exports.FieldAffix=f.FieldAffix,exports.Grid=x.Grid,exports.GridItem=x.GridItem,exports.Icon=e.t,exports.ImageCropper=N.ImageCropper,exports.Menu=T.Menu,exports.MenuItem=T.MenuItem,exports.MenuLabel=T.MenuLabel,exports.MenuSeparator=T.MenuSeparator,exports.Modal=c.Modal,exports.NumberField=g.NumberField,exports.NumberRangeField=g.NumberRangeField,exports.Pagination=z.Pagination,exports.Popover=w.Popover,exports.Radio=S.Radio,exports.RadioCard=k.RadioCard,exports.RangeSlider=M.RangeSlider,exports.RichTextEditor=u.t,exports.SearchField=p.SearchField,exports.Select=F.Select,exports.SelectionCardGroup=k.SelectionCardGroup,exports.SideNav=r.SideNav,exports.SideNavFooter=r.SideNavFooter,exports.SideNavHeader=r.SideNavHeader,exports.SideNavItem=r.SideNavItem,exports.SideNavSection=r.SideNavSection,exports.Skeleton=D.Skeleton,exports.SkeletonText=D.SkeletonText,exports.Slider=M.Slider,exports.SortableList=m.SortableList,exports.SortableListItem=m.SortableListItem,exports.Stack=x.Stack,exports.Stepper=A.Stepper,exports.SubNav=O.SubNav,exports.SubNavButton=O.SubNavButton,exports.SubNavItem=O.SubNavItem,exports.Switch=_.Switch,exports.Table=C.Table,exports.TableBody=C.TableBody,exports.TableCell=C.TableCell,exports.TableEmpty=C.TableEmpty,exports.TableFrame=C.TableFrame,exports.TableHead=C.TableHead,exports.TableHeaderCell=C.TableHeaderCell,exports.TableRow=C.TableRow,exports.TableToolbar=C.TableToolbar,exports.TagsInput=L.TagsInput,exports.TextArea=l.TextArea,exports.TextField=l.TextField,exports.Time=R.Time,exports.Toast=E.Toast,exports.ToastProvider=E.ToastProvider,exports.TopNav=i.TopNav,exports.TopNavItem=i.TopNavItem,exports.cropToBlob=N.cropToBlob,exports.formatAbsoluteDate=R.formatAbsoluteDate,exports.formatAbsoluteTime=R.formatAbsoluteTime,exports.formatIsoDate=I.formatIsoDate,exports.formatRelativeTime=R.formatRelativeTime,exports.iconNames=e.n,exports.icons=e.r,exports.useSideNavCollapsed=r.useSideNavCollapsed,exports.useToast=E.useToast,exports.validateEntryValues=v.n;
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ import { ButtonGroup as m } from "./components/ButtonGroup/index.js";
8
8
  import { Field as h } from "./components/Field/index.js";
9
9
  import { Modal as g } from "./components/Modal/index.js";
10
10
  import { TextArea as _, TextField as v } from "./components/TextField/index.js";
11
- import { t as y } from "./chunks/RichTextEditor-CSpjsL1z.js";
11
+ import { t as y } from "./chunks/RichTextEditor-Dnx4i7bQ.js";
12
12
  import { Badge as b } from "./components/Badge/index.js";
13
13
  import { FieldAffix as x } from "./components/FieldAffix/index.js";
14
14
  import { SearchField as S } from "./components/SearchField/index.js";
@@ -16,8 +16,8 @@ import { SortableList as C, SortableListItem as w } from "./components/SortableL
16
16
  import { EntryPicker as T } from "./components/EntryPicker/index.js";
17
17
  import { NumberField as E, NumberRangeField as D } from "./components/NumberField/index.js";
18
18
  import { Switch as O } from "./components/Switch/index.js";
19
- import { n as k, t as A } from "./chunks/EntryEditor-xVuiqtFo.js";
20
- import { Board as j, BoardCard as M, BoardColumn as N } from "./components/Board/index.js";
19
+ import { n as k, t as A } from "./chunks/EntryEditor-CcyYtH74.js";
20
+ import { n as j, r as M, t as N } from "./chunks/Board-BTFSzn6c.js";
21
21
  import { Avatar as P, AvatarGroup as F } from "./components/Avatar/index.js";
22
22
  import { Grid as I, GridItem as L, Stack as R } from "./components/Grid/index.js";
23
23
  import { Checkbox as z, ChoiceGroup as B, Radio as V } from "./components/Choice/index.js";
@@ -38,4 +38,4 @@ import { Calendar as we, DateField as Te, DateRangeField as Ee, formatIsoDate as
38
38
  import { TagsInput as Oe } from "./components/TagsInput/index.js";
39
39
  import { Time as ke, formatAbsoluteDate as Ae, formatAbsoluteTime as je, formatRelativeTime as Me } from "./components/Time/index.js";
40
40
  import { Pagination as Ne } from "./components/Pagination/index.js";
41
- export { p as AppShell, me as AssetGrid, he as AssetGridEmpty, ge as AssetTile, _e as AssetTileSkeleton, P as Avatar, F as AvatarGroup, b as Badge, j as Board, M as BoardCard, N as BoardColumn, r as Button, m as ButtonGroup, we as Calendar, z as Checkbox, ue as CheckboxCard, B as ChoiceGroup, Se as Container, Te as DateField, Ee as DateRangeField, i as Drawer, A as EntryEditor, T as EntryPicker, h as Field, x as FieldAffix, I as Grid, L as GridItem, n as Icon, be as ImageCropper, Q as Menu, $ as MenuItem, ee as MenuLabel, te as MenuSeparator, g as Modal, E as NumberField, D as NumberRangeField, Ne as Pagination, Z as Popover, V as Radio, de as RadioCard, ve as RangeSlider, y as RichTextEditor, S as SearchField, Ce as Select, fe as SelectionCardGroup, a as SideNav, o as SideNavFooter, s as SideNavHeader, c as SideNavItem, l as SideNavSection, ae as Skeleton, oe as SkeletonText, ye as Slider, C as SortableList, w as SortableListItem, R as Stack, pe as Stepper, se as SubNav, ce as SubNavButton, le as SubNavItem, O as Switch, H as Table, U as TableBody, W as TableCell, G as TableEmpty, K as TableFrame, q as TableHead, J as TableHeaderCell, Y as TableRow, X as TableToolbar, Oe as TagsInput, _ as TextArea, v as TextField, ke as Time, ne as Toast, re as ToastProvider, d as TopNav, f as TopNavItem, xe as cropToBlob, Ae as formatAbsoluteDate, je as formatAbsoluteTime, De as formatIsoDate, Me as formatRelativeTime, e as iconNames, t as icons, u as useSideNavCollapsed, ie as useToast, k as validateEntryValues };
41
+ export { p as AppShell, me as AssetGrid, he as AssetGridEmpty, ge as AssetTile, _e as AssetTileSkeleton, P as Avatar, F as AvatarGroup, b as Badge, N as Board, j as BoardCard, M as BoardColumn, r as Button, m as ButtonGroup, we as Calendar, z as Checkbox, ue as CheckboxCard, B as ChoiceGroup, Se as Container, Te as DateField, Ee as DateRangeField, i as Drawer, A as EntryEditor, T as EntryPicker, h as Field, x as FieldAffix, I as Grid, L as GridItem, n as Icon, be as ImageCropper, Q as Menu, $ as MenuItem, ee as MenuLabel, te as MenuSeparator, g as Modal, E as NumberField, D as NumberRangeField, Ne as Pagination, Z as Popover, V as Radio, de as RadioCard, ve as RangeSlider, y as RichTextEditor, S as SearchField, Ce as Select, fe as SelectionCardGroup, a as SideNav, o as SideNavFooter, s as SideNavHeader, c as SideNavItem, l as SideNavSection, ae as Skeleton, oe as SkeletonText, ye as Slider, C as SortableList, w as SortableListItem, R as Stack, pe as Stepper, se as SubNav, ce as SubNavButton, le as SubNavItem, O as Switch, H as Table, U as TableBody, W as TableCell, G as TableEmpty, K as TableFrame, q as TableHead, J as TableHeaderCell, Y as TableRow, X as TableToolbar, Oe as TagsInput, _ as TextArea, v as TextField, ke as Time, ne as Toast, re as ToastProvider, d as TopNav, f as TopNavItem, xe as cropToBlob, Ae as formatAbsoluteDate, je as formatAbsoluteTime, De as formatIsoDate, Me as formatRelativeTime, e as iconNames, t as icons, u as useSideNavCollapsed, ie as useToast, k as validateEntryValues };
@@ -0,0 +1,4 @@
1
+ import type { Ref, RefCallback } from "react";
2
+ /** Send the same node (and unmount notification) to internal and forwarded refs. */
3
+ export declare function mergeRefs<T>(...refs: (Ref<T> | undefined)[]): RefCallback<T>;
4
+ //# sourceMappingURL=mergeRefs.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mergeRefs.d.cts","sourceRoot":"","sources":["../../src/internal/mergeRefs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAE9C,oFAAoF;AACpF,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC,CAO5E"}
@@ -0,0 +1,4 @@
1
+ import type { Ref, RefCallback } from "react";
2
+ /** Send the same node (and unmount notification) to internal and forwarded refs. */
3
+ export declare function mergeRefs<T>(...refs: (Ref<T> | undefined)[]): RefCallback<T>;
4
+ //# sourceMappingURL=mergeRefs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mergeRefs.d.ts","sourceRoot":"","sources":["../../src/internal/mergeRefs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAE9C,oFAAoF;AACpF,wBAAgB,SAAS,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC,CAO5E"}
@@ -0,0 +1,3 @@
1
+ import type { DragEndEvent } from "@dnd-kit/core";
2
+ export declare function dragEndEvent(overId: string | number | null, overData?: Record<string, unknown>, activeId?: string | number): DragEndEvent;
3
+ //# sourceMappingURL=dragEvent.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dragEvent.d.cts","sourceRoot":"","sources":["../../src/test/dragEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,GAAE,MAAM,GAAG,MAAgB,GAAG,YAAY,CAiBlJ"}
@@ -0,0 +1,3 @@
1
+ import type { DragEndEvent } from "@dnd-kit/core";
2
+ export declare function dragEndEvent(overId: string | number | null, overData?: Record<string, unknown>, activeId?: string | number): DragEndEvent;
3
+ //# sourceMappingURL=dragEvent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dragEvent.d.ts","sourceRoot":"","sources":["../../src/test/dragEvent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAElD,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,GAAE,MAAM,GAAG,MAAgB,GAAG,YAAY,CAiBlJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@namroodinc/liquid-editorial",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "A bold, accessible React component library for editorial products.",
5
5
  "author": "Namrood Inc",
6
6
  "license": "MIT",
@@ -98,7 +98,7 @@
98
98
  "test": "vitest run",
99
99
  "test:watch": "vitest",
100
100
  "test:coverage": "vitest run --coverage",
101
- "fallow": "fallow dead-code --no-cache --fail-on-issues",
101
+ "fallow": "fallow dead-code --no-cache --fail-on-issues && fallow dupes --no-cache --fail-on-issues",
102
102
  "fallow:report": "node scripts/generate-fallow-report.mjs",
103
103
  "package:smoke": "node scripts/package-smoke.mjs",
104
104
  "package:lint": "publint --strict",
@@ -1,2 +0,0 @@
1
- const e=require("../components/Field/index.cjs"),t=require("../components/TextField/index.cjs"),n=require("./RichTextEditor-DC_0oN1s.cjs"),r=require("../components/EntryPicker/index.cjs"),i=require("../components/NumberField/index.cjs"),a=require("../components/Switch/index.cjs");let o=require("react"),s=require("react/jsx-runtime");var c=new Set([`shortText`,`longText`,`richText`,`number`,`boolean`,`dateTime`,`asset`,`reference`]);function l(e){let t=new Set;for(let n of e.fields){if(!n.id?.trim()||t.has(n.id))throw Error(`Content model field IDs must be nonempty and unique.`);if(!c.has(n.type))throw Error(`Unsupported content field type: ${n.type}`);t.add(n.id)}}function u(e){if(typeof e!=`string`)return;let t=/^(\d{4}-\d{2}-\d{2}T\d{2}:\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?(?:Z|\+00:00)$/.exec(e);if(!t)return;let n=`${t[1]}:${t[2]??`00`}.${(t[3]??``).padEnd(3,`0`)}Z`,r=new Date(n);if(Number.isFinite(r.getTime())&&r.toISOString()===n)return n}function d(e,t){return!!e&&typeof e==`object`&&t in e&&typeof e[t]==`string`&&e[t].trim().length>0}function f(e){return!!e.text?.trim()||e.type===`horizontalRule`||!!e.content?.some(f)}function p(e,t){return l(e),Object.fromEntries(e.fields.flatMap(e=>{let r=Object.hasOwn(t,e.id)?t[e.id]:void 0,i;if(r===void 0)e.required&&(i=`${e.label} is required.`);else switch(e.type){case`shortText`:case`longText`:typeof r==`string`?e.required&&!r.trim()&&(i=`${e.label} is required.`):i=`Enter text.`;break;case`richText`:i=n.n(r),!i&&e.required&&!f(r)&&(i=`${e.label} is required.`);break;case`number`:(typeof r!=`number`||!Number.isFinite(r))&&(i=`Enter a finite number.`);break;case`boolean`:typeof r!=`boolean`&&(i=`Choose a boolean value.`);break;case`dateTime`:u(r)||(i=`Enter a valid UTC date and time.`);break;case`asset`:case`reference`:{let t=e.type===`asset`?`assetId`:`entryId`;(e.multiple?!Array.isArray(r)||!r.every(e=>d(e,t)):!d(r,t))?i=e.multiple?`Choose a list of ${e.type===`asset`?`assets`:`entries`}.`:`Choose an ${e.type===`asset`?`asset`:`entry`}.`:e.required&&Array.isArray(r)&&r.length===0&&(i=`${e.label} is required.`);break}}return i?[[e.id,i]]:[]}))}function m(e,t){let n=e.type===`asset`?`assetId`:`entryId`;return(Array.isArray(t)?t:t===void 0?[]:[t]).flatMap(e=>{if(!e||typeof e!=`object`||!(n in e))return[];let t=e[n];return typeof t==`string`?[t]:[]})}function h({model:c,value:l,defaultValue:d={},onValueChange:f,pickerItems:h={},errors:g={},isDisabled:_=!1,showAllErrors:v=!1,className:y,...b}){let[x,S]=(0,o.useState)(d),[C,w]=(0,o.useState)(()=>new Set),T=l??x,E=p(c,T),D=(e,t)=>{if(_)return;let n={...T};t===void 0?delete n[e]:n[e]=t,l===void 0&&S(n),w(t=>new Set(t).add(e)),f?.(n)};return(0,s.jsx)(`div`,{className:[`ds-entry-editor`,y].filter(Boolean).join(` `),...b,children:c.fields.map(o=>{let c=Object.hasOwn(T,o.id)?T[o.id]:void 0,l=o.type===`asset`||o.type===`reference`,d=o.type===`dateTime`?`${o.label} (UTC)`:o.label,f=g[o.id]??(v||C.has(o.id)?E[o.id]:void 0);return(0,s.jsx)(e.Field,{label:d,hint:o.hint,error:f,isRequired:o.required,isGroup:l,children:({required:e,...l})=>{switch(o.type){case`shortText`:case`longText`:{let n=o.type===`shortText`?t.TextField:t.TextArea;return(0,s.jsx)(n,{...l,required:e,disabled:_,placeholder:o.placeholder,value:typeof c==`string`?c:``,onChange:e=>D(o.id,e.target.value)})}case`number`:return(0,s.jsx)(i.NumberField,{...l,required:e,isDisabled:_,placeholder:o.placeholder,step:`any`,hasSteppers:!1,value:typeof c==`number`&&Number.isFinite(c)?c:``,onValueChange:e=>{(e===``||Number.isFinite(e))&&D(o.id,e===``?void 0:e)}});case`boolean`:return(0,s.jsx)(a.Switch,{...l,isDisabled:_,isSelected:c===!0,onSelectedChange:e=>D(o.id,e)});case`dateTime`:return(0,s.jsx)(t.TextField,{...l,required:e,disabled:_,type:`datetime-local`,step:`0.001`,value:u(c)?.slice(0,-1)??``,onChange:e=>D(o.id,u(`${e.target.value}Z`))});case`richText`:return(0,s.jsx)(n.t,{...l,label:o.label,isRequired:e,isDisabled:_,placeholder:o.placeholder,format:`json`,value:c===void 0?n.r:c,onChange:e=>D(o.id,e)});case`asset`:case`reference`:return(0,s.jsx)(`div`,{...l,role:`group`,children:(0,s.jsx)(r.EntryPicker,{items:h[o.id]??[],value:m(o,c),label:o.type===`asset`?`Assets`:`Entries`,addLabel:`Choose ${o.label}`,mode:o.multiple?`multiple`:`single`,isDisabled:_,onValueChange:e=>{if(o.type===`asset`){let t=e.map(e=>({assetId:e}));D(o.id,o.multiple?t:t[0])}else{let t=e.map(e=>({entryId:e}));D(o.id,o.multiple?t:t[0])}}})})}}},o.id)})})}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return h}});
2
- //# sourceMappingURL=EntryEditor-C32lKKnV.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"EntryEditor-C32lKKnV.cjs","names":["documentError","useState","Field","TextField","TextArea","NumberField","Switch","RichTextEditor","emptyDocument","EntryPicker","require_components_Field_index","require_components_TextField_index","require_RichTextEditor","require_components_EntryPicker_index","require_components_NumberField_index","require_components_Switch_index","react","react_jsx_runtime","fieldTypes","assertModel","ids","field","model","parseUtcDateTime","value","match","canonical","date","isLink","key","hasRichText","node","validateEntryValues","values","error","item","selectedIds","link","id","EntryEditor","rest","internal","setInternal","defaultValue","changed","setChanged","current","validation","commit","isDisabled","next","previous","onValueChange","className","stored","isPicker","label","errors","showAllErrors","accessibility","Control","event","required","pickerItems","links"],"sources":["../../src/components/EntryEditor/model.ts","../../src/components/EntryEditor/index.tsx"],"sourcesContent":["import type { JSONContent } from \"@tiptap/react\";\nimport { documentError } from \"../RichTextEditor/document\";\nimport type { RichTextDocument } from \"../RichTextEditor\";\n\ninterface ContentFieldBase {\n id: string;\n label: string;\n hint?: string;\n placeholder?: string;\n required?: boolean;\n}\n\nexport type ContentField = ContentFieldBase & (\n | { type: \"shortText\" | \"longText\" | \"richText\" | \"number\" | \"boolean\" | \"dateTime\"; multiple?: never }\n | { type: \"asset\" | \"reference\"; multiple?: boolean }\n);\n\nexport interface ContentModel {\n fields: readonly ContentField[];\n}\n\nexport interface AssetValue { assetId: string }\nexport interface ReferenceValue { entryId: string }\nexport type EntryFieldValue = string | number | boolean | RichTextDocument | AssetValue | ReferenceValue | AssetValue[] | ReferenceValue[];\nexport type EntryValues = Record<string, EntryFieldValue | undefined>;\nexport type EntryErrors = Partial<Record<string, string>>;\n\nconst fieldTypes = new Set([\"shortText\", \"longText\", \"richText\", \"number\", \"boolean\", \"dateTime\", \"asset\", \"reference\"]);\n\nfunction assertModel(model: ContentModel) {\n const ids = new Set<string>();\n for (const field of model.fields) {\n if (!field.id?.trim() || ids.has(field.id)) throw new Error(\"Content model field IDs must be nonempty and unique.\");\n if (!fieldTypes.has(field.type)) throw new Error(`Unsupported content field type: ${field.type}`);\n ids.add(field.id);\n }\n}\n\n/** Accept UTC ISO strings without rolling invalid dates into the next month. */\nexport function parseUtcDateTime(value: unknown): string | undefined {\n if (typeof value !== \"string\") return;\n const match = /^(\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2})(?::(\\d{2})(?:\\.(\\d{1,3}))?)?(?:Z|\\+00:00)$/.exec(value);\n if (!match) return;\n const canonical = `${match[1]}:${match[2] ?? \"00\"}.${(match[3] ?? \"\").padEnd(3, \"0\")}Z`;\n const date = new Date(canonical);\n if (Number.isFinite(date.getTime()) && date.toISOString() === canonical) return canonical;\n}\n\nfunction isLink(value: unknown, key: \"assetId\" | \"entryId\"): boolean {\n return !!value && typeof value === \"object\" && key in value &&\n typeof (value as Record<string, unknown>)[key] === \"string\" &&\n ((value as Record<string, string>)[key]).trim().length > 0;\n}\n\nfunction hasRichText(node: JSONContent): boolean {\n return !!node.text?.trim() || node.type === \"horizontalRule\" || !!node.content?.some(hasRichText);\n}\n\n/** Validate data loaded from JSON as well as values emitted by EntryEditor. */\nexport function validateEntryValues(model: ContentModel, values: Record<string, unknown>): EntryErrors {\n assertModel(model);\n return Object.fromEntries(model.fields.flatMap((field): [string, string][] => {\n const value = Object.hasOwn(values, field.id) ? values[field.id] : undefined;\n let error: string | undefined;\n if (value === undefined) {\n if (field.required) error = `${field.label} is required.`;\n } else {\n switch (field.type) {\n case \"shortText\":\n case \"longText\":\n if (typeof value !== \"string\") error = \"Enter text.\";\n else if (field.required && !value.trim()) error = `${field.label} is required.`;\n break;\n case \"richText\":\n error = documentError(value);\n if (!error && field.required && !hasRichText(value as RichTextDocument)) error = `${field.label} is required.`;\n break;\n case \"number\":\n if (typeof value !== \"number\" || !Number.isFinite(value)) error = \"Enter a finite number.\";\n break;\n case \"boolean\":\n if (typeof value !== \"boolean\") error = \"Choose a boolean value.\";\n break;\n case \"dateTime\":\n if (!parseUtcDateTime(value)) error = \"Enter a valid UTC date and time.\";\n break;\n case \"asset\":\n case \"reference\": {\n const key = field.type === \"asset\" ? \"assetId\" : \"entryId\";\n if (field.multiple ? !Array.isArray(value) || !value.every((item) => isLink(item, key)) : !isLink(value, key)) {\n error = field.multiple\n ? `Choose a list of ${field.type === \"asset\" ? \"assets\" : \"entries\"}.`\n : `Choose an ${field.type === \"asset\" ? \"asset\" : \"entry\"}.`;\n } else if (field.required && Array.isArray(value) && value.length === 0) error = `${field.label} is required.`;\n break;\n }\n }\n }\n return error ? [[field.id, error]] : [];\n }));\n}\n","import { useState, type HTMLAttributes, type ReactNode } from \"react\";\nimport { EntryPicker, type EntryItem } from \"../EntryPicker\";\nimport { Field } from \"../Field\";\nimport { NumberField } from \"../NumberField\";\nimport { RichTextEditor, type RichTextDocument } from \"../RichTextEditor\";\nimport { emptyDocument } from \"../RichTextEditor/document\";\nimport { Switch } from \"../Switch\";\nimport { TextArea, TextField } from \"../TextField\";\nimport { parseUtcDateTime, validateEntryValues, type ContentField, type ContentModel, type EntryErrors, type EntryFieldValue, type EntryValues } from \"./model\";\nimport \"./style.css\";\n\nexport { validateEntryValues } from \"./model\";\nexport type { AssetValue, ContentField, ContentModel, EntryErrors, EntryFieldValue, EntryValues, ReferenceValue } from \"./model\";\n\nexport interface EntryEditorProps extends Omit<HTMLAttributes<HTMLDivElement>, \"defaultValue\" | \"onChange\"> {\n model: ContentModel;\n value?: EntryValues;\n defaultValue?: EntryValues;\n onValueChange?: (values: EntryValues) => void;\n /** Available assets or entries, keyed by content field ID. */\n pickerItems?: Record<string, EntryItem[]>;\n /** App-provided messages take precedence over built-in validation. */\n errors?: EntryErrors;\n isDisabled?: boolean;\n /** Reveal validation for untouched fields, for example after a submit attempt. */\n showAllErrors?: boolean;\n}\n\nfunction selectedIds(field: ContentField, value: EntryFieldValue | undefined): string[] {\n const key = field.type === \"asset\" ? \"assetId\" : \"entryId\";\n const links = Array.isArray(value) ? value : value === undefined ? [] : [value];\n return links.flatMap((link) => {\n if (!link || typeof link !== \"object\" || !(key in link)) return [];\n const id = (link as unknown as Record<string, unknown>)[key];\n return typeof id === \"string\" ? [id] : [];\n });\n}\n\n/** An ordered set of content inputs; submission and persistence belong to the app. */\nexport function EntryEditor({\n model,\n value,\n defaultValue = {},\n onValueChange,\n pickerItems = {},\n errors = {},\n isDisabled = false,\n showAllErrors = false,\n className,\n ...rest\n}: EntryEditorProps) {\n const [internal, setInternal] = useState<EntryValues>(defaultValue);\n const [changed, setChanged] = useState<Set<string>>(() => new Set());\n const current = value ?? internal;\n const validation = validateEntryValues(model, current);\n\n const commit = (id: string, next: EntryFieldValue | undefined) => {\n if (isDisabled) return;\n const values = { ...current };\n if (next === undefined) delete values[id];\n else values[id] = next;\n if (value === undefined) setInternal(values);\n setChanged((previous) => new Set(previous).add(id));\n onValueChange?.(values);\n };\n\n return (\n <div className={[\"ds-entry-editor\", className].filter(Boolean).join(\" \")} {...rest}>\n {model.fields.map((field) => {\n const stored = Object.hasOwn(current, field.id) ? current[field.id] : undefined;\n const isPicker = field.type === \"asset\" || field.type === \"reference\";\n const label = field.type === \"dateTime\" ? `${field.label} (UTC)` : field.label;\n const error = errors[field.id] ?? (showAllErrors || changed.has(field.id) ? validation[field.id] : undefined);\n return (\n <Field key={field.id} label={label} hint={field.hint} error={error} isRequired={field.required} isGroup={isPicker}>\n {({ required, ...accessibility }): ReactNode => {\n switch (field.type) {\n case \"shortText\":\n case \"longText\": {\n const Control = field.type === \"shortText\" ? TextField : TextArea;\n return <Control {...accessibility} required={required} disabled={isDisabled} placeholder={field.placeholder}\n value={typeof stored === \"string\" ? stored : \"\"} onChange={(event) => commit(field.id, event.target.value)} />;\n }\n case \"number\":\n return <NumberField {...accessibility} required={required} isDisabled={isDisabled} placeholder={field.placeholder} step=\"any\"\n hasSteppers={false} value={typeof stored === \"number\" && Number.isFinite(stored) ? stored : \"\"}\n onValueChange={(next) => { if (next === \"\" || Number.isFinite(next)) commit(field.id, next === \"\" ? undefined : next); }} />;\n case \"boolean\":\n return <Switch {...accessibility} isDisabled={isDisabled} isSelected={stored === true}\n onSelectedChange={(next) => commit(field.id, next)} />;\n case \"dateTime\":\n return <TextField {...accessibility} required={required} disabled={isDisabled} type=\"datetime-local\" step=\"0.001\"\n value={parseUtcDateTime(stored)?.slice(0, -1) ?? \"\"}\n onChange={(event) => commit(field.id, parseUtcDateTime(`${event.target.value}Z`))} />;\n case \"richText\":\n return <RichTextEditor {...accessibility} label={field.label} isRequired={required} isDisabled={isDisabled}\n placeholder={field.placeholder} format=\"json\" value={stored === undefined ? emptyDocument : stored as RichTextDocument}\n onChange={(next) => commit(field.id, next)} />;\n case \"asset\":\n case \"reference\":\n return <div {...accessibility} role=\"group\">\n <EntryPicker items={pickerItems[field.id] ?? []} value={selectedIds(field, stored)}\n label={field.type === \"asset\" ? \"Assets\" : \"Entries\"} addLabel={`Choose ${field.label}`}\n mode={field.multiple ? \"multiple\" : \"single\"} isDisabled={isDisabled}\n onValueChange={(ids) => {\n if (field.type === \"asset\") {\n const links = ids.map((assetId) => ({ assetId }));\n commit(field.id, field.multiple ? links : links[0]);\n } else {\n const links = ids.map((entryId) => ({ entryId }));\n commit(field.id, field.multiple ? links : links[0]);\n }\n }} />\n </div>;\n }\n }}\n </Field>\n );\n })}\n </div>\n );\n}\n"],"mappings":"A,+UA2BA,IAAMkB,EAAa,IAAI,IAAI,CAAC,YAAa,WAAY,WAAY,SAAU,UAAW,WAAY,QAAS,WAAW,CAAC,EAEvH,SAASC,EAAY,EAAqB,CACxC,IAAMC,EAAM,IAAI,IAChB,IAAK,IAAMC,KAASC,EAAM,OAAQ,CAChC,GAAI,CAACD,EAAM,IAAI,KAAK,GAAKD,EAAI,IAAIC,EAAM,EAAE,EAAG,MAAU,MAAM,sDAAsD,EAClH,GAAI,CAACH,EAAW,IAAIG,EAAM,IAAI,EAAG,MAAU,MAAM,mCAAmCA,EAAM,MAAM,EAChGD,EAAI,IAAIC,EAAM,EAAE,CAClB,CACF,CAGA,SAAgBE,EAAiB,EAAoC,CACnE,GAAI,OAAOC,GAAU,SAAU,OAC/B,IAAMC,EAAQ,8EAA8E,KAAKD,CAAK,EACtG,GAAI,CAACC,EAAO,OACZ,IAAMC,EAAY,GAAGD,EAAM,GAAG,GAAGA,EAAM,IAAM,KAAK,IAAIA,EAAM,IAAM,GAAA,CAAI,OAAO,EAAG,GAAG,EAAE,GAC/EE,EAAO,IAAI,KAAKD,CAAS,EAC/B,GAAI,OAAO,SAASC,EAAK,QAAQ,CAAC,GAAKA,EAAK,YAAY,IAAMD,EAAW,OAAOA,CAClF,CAEA,SAASE,EAAO,EAAgB,EAAqC,CACnE,MAAO,CAAC,CAACJ,GAAS,OAAOA,GAAU,UAAYK,KAAOL,GACpD,OAAQA,EAAkCK,IAAS,UACjDL,EAAiCK,EAAI,CAAE,KAAK,CAAC,CAAC,OAAS,CAC7D,CAEA,SAASC,EAAY,EAA4B,CAC/C,MAAO,CAAC,CAACC,EAAK,MAAM,KAAK,GAAKA,EAAK,OAAS,kBAA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