{"_id":"s-dnm","_rev":"5-b745c3cea1cd766e2005fee6532ea36b","name":"s-dnm","dist-tags":{"latest":"0.0.6"},"versions":{"0.0.1":{"name":"s-dnm","version":"0.0.1","description":"Drag and Move components with React","main":"./dist/cjs/index.js","module":"./dist/esm/index.js","types":"./dist/esm/index.d.ts","scripts":{"build":"npm run build:esm && npm run build:cjs","build:esm":"tsc","build:cjs":"tsc --module commonjs --outDir dist/cjs","lint":"eslint \"{**/*,*}.{js,ts,jsx,tsx}\"","prettier":"prettier --write \"{src,tests,example/src}/**/*.{js,ts,jsx,tsx}\"","prepare":"npm run build","prepublishOnly":"npm run prettier && npm run lint"},"license":"MIT","author":{"name":"Sami Salih İbrahimbaş","email":"info@ssibrahimbas.com","url":"ssibrahimbas"},"repository":{"type":"git","url":"git+https://github.com/ssibrahimbas/react-dno.git"},"peerDependencies":{"react":">=16"},"devDependencies":{"@types/react":"^18.2.6","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","eslint":"^8.40.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","eslint-plugin-react":"^7.32.2","eslint-plugin-react-hooks":"^4.6.0","prettier":"^2.8.8","react":"^18.2.0","react-dom":"^18.2.0","typescript":"^5.0.4"},"keywords":["react","react-drag","react-move","drag","move","drag-move","typescript"],"bugs":{"url":"https://github.com/ssibrahimbas/react-dno/issues"},"homepage":"https://github.com/ssibrahimbas/react-dno#readme","_id":"s-dnm@0.0.1","_nodeVersion":"20.3.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-owce0VkeHJmyS/MtmU1Dm1U/YTmwnzZ5Fq2izezfxUDVdU9GGypodCCJC5esSwwcnWZj8ngkaGwfwhe6RNBuRQ==","shasum":"21912ac2330727c98e225c0091e2fc2f7b5d80bf","tarball":"https://registry.npmjs.org/s-dnm/-/s-dnm-0.0.1.tgz","fileCount":25,"unpackedSize":12634,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHfWKHNYZM1v7gDMQ6tVdnc6WfVxtD+DmB9Q3DNyteEQAiAUFiV4LVsOfnR+p/+GOHpisczLoiCAy4MAsk1CU7hvDg=="}]},"_npmUser":{"name":"ssibrahimbase","email":"sami.salih_54@outlook.com"},"directories":{},"maintainers":[{"name":"ssibrahimbase","email":"sami.salih_54@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/s-dnm_0.0.1_1691013481006_0.4172092698491512"},"_hasShrinkwrap":false},"0.0.2":{"name":"s-dnm","version":"0.0.2","description":"Drag and Move components with React","main":"./dist/cjs/index.js","module":"./dist/esm/index.js","types":"./dist/esm/index.d.ts","scripts":{"build":"npm run build:esm && npm run build:cjs","build:esm":"tsc","build:cjs":"tsc --module commonjs --outDir dist/cjs","lint":"eslint \"{**/*,*}.{js,ts,jsx,tsx}\"","prettier":"prettier --write \"{src,tests,example/src}/**/*.{js,ts,jsx,tsx}\"","prepare":"npm run build","prepublishOnly":"npm run prettier && npm run lint"},"license":"MIT","author":{"name":"Sami Salih İbrahimbaş","email":"info@ssibrahimbas.com","url":"ssibrahimbas"},"repository":{"type":"git","url":"git+https://github.com/ssibrahimbas/react-dno.git"},"peerDependencies":{"react":">=16"},"devDependencies":{"@types/react":"^18.2.6","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","eslint":"^8.40.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","eslint-plugin-react":"^7.32.2","eslint-plugin-react-hooks":"^4.6.0","prettier":"^2.8.8","react":"^18.2.0","react-dom":"^18.2.0","typescript":"^5.0.4"},"keywords":["react","react-drag","react-move","drag","move","drag-move","typescript"],"bugs":{"url":"https://github.com/ssibrahimbas/react-dno/issues"},"homepage":"https://github.com/ssibrahimbas/react-dno#readme","_id":"s-dnm@0.0.2","_nodeVersion":"20.3.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-YRXBbbla56VGEr5xplrVNBJ7xoBDVxZmSJQa41/NQHUkColXHaRvOJ9AX5Jgo7U/K8+cjOr1cjAg8zG+Mn7g2Q==","shasum":"cb148909dba4fab5c1f3ad14927290382022e1f9","tarball":"https://registry.npmjs.org/s-dnm/-/s-dnm-0.0.2.tgz","fileCount":26,"unpackedSize":12694,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDseUUImW2XcO0PLEIlpsick3lw0W7pePXCJKNoYNTyXwIgO9QRUiJpzrWKBBTuxpPxSVTBZwn/zy/iJzbXlXeEn8E="}]},"_npmUser":{"name":"ssibrahimbase","email":"sami.salih_54@outlook.com"},"directories":{},"maintainers":[{"name":"ssibrahimbase","email":"sami.salih_54@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/s-dnm_0.0.2_1691013782084_0.7375227103074156"},"_hasShrinkwrap":false},"0.0.3":{"name":"s-dnm","version":"0.0.3","description":"Drag and Move components for React","main":"./dist/cjs/index.js","module":"./dist/esm/index.js","types":"./dist/esm/index.d.ts","scripts":{"build":"npm run build:esm && npm run build:cjs","build:esm":"tsc","build:cjs":"tsc --module commonjs --outDir dist/cjs","lint":"eslint \"{**/*,*}.{js,ts,jsx,tsx}\"","prettier":"prettier --write \"{src,tests,example/src}/**/*.{js,ts,jsx,tsx}\"","prepare":"npm run build","prepublishOnly":"npm run prettier && npm run lint"},"license":"MIT","author":{"name":"Sami Salih İbrahimbaş","email":"info@ssibrahimbas.com","url":"ssibrahimbas"},"repository":{"type":"git","url":"git+https://github.com/ssibrahimbas/s-dnm.git"},"peerDependencies":{"react":">=16"},"devDependencies":{"@types/react":"^18.2.6","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","eslint":"^8.40.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","eslint-plugin-react":"^7.32.2","eslint-plugin-react-hooks":"^4.6.0","prettier":"^2.8.8","react":"^18.2.0","react-dom":"^18.2.0","typescript":"^5.0.4"},"keywords":["react","react-drag","react-move","drag","move","drag-move","typescript"],"gitHead":"a4658606c34bb42eadfd88a32a06d162cec2ac4e","bugs":{"url":"https://github.com/ssibrahimbas/s-dnm/issues"},"homepage":"https://github.com/ssibrahimbas/s-dnm#readme","_id":"s-dnm@0.0.3","_nodeVersion":"20.3.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-rclyIGkicjZkpzOi6EH2UcNV01xTyOWsJK5yB40jemlgH9gKzph5xxkQ82melGaDxFzTcNxmTzX+oNVMMu9Exg==","shasum":"6432785a7b03fc0dc6307d77487bd57eb923c5b8","tarball":"https://registry.npmjs.org/s-dnm/-/s-dnm-0.0.3.tgz","fileCount":34,"unpackedSize":22172,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCcQz7aedgzA+gQHa2PljurUh516JhQKcQMWzXi2zbVFQIhAMtTPHTr9mSo4PFPcsksAFtPCAPC14Z7AWZLGLCOXpo4"}]},"_npmUser":{"name":"ssibrahimbase","email":"sami.salih_54@outlook.com"},"directories":{},"maintainers":[{"name":"ssibrahimbase","email":"sami.salih_54@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/s-dnm_0.0.3_1691015536253_0.1106940578970117"},"_hasShrinkwrap":false},"0.0.4":{"name":"s-dnm","version":"0.0.4","description":"Drag and Move components for React","main":"./dist/cjs/index.js","module":"./dist/esm/index.js","types":"./dist/esm/index.d.ts","scripts":{"build":"npm run build:esm && npm run build:cjs","build:esm":"tsc","build:cjs":"tsc --module commonjs --outDir dist/cjs","lint":"eslint \"{**/*,*}.{js,ts,jsx,tsx}\"","prettier":"prettier --write \"{src,tests,example/src}/**/*.{js,ts,jsx,tsx}\"","prepare":"npm run build","prepublishOnly":"npm run prettier && npm run lint"},"license":"MIT","author":{"name":"Sami Salih İbrahimbaş","email":"info@ssibrahimbas.com","url":"ssibrahimbas"},"repository":{"type":"git","url":"git+https://github.com/ssibrahimbas/s-dnm.git"},"peerDependencies":{"react":">=16"},"devDependencies":{"@types/react":"^18.2.6","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","eslint":"^8.40.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","eslint-plugin-react":"^7.32.2","eslint-plugin-react-hooks":"^4.6.0","prettier":"^2.8.8","react":"^18.2.0","react-dom":"^18.2.0","typescript":"^5.0.4"},"keywords":["react","react-drag","react-move","drag","move","drag-move","typescript"],"gitHead":"ac4afba9308a7b13f1b778d80f8979c70b4fcfa0","bugs":{"url":"https://github.com/ssibrahimbas/s-dnm/issues"},"homepage":"https://github.com/ssibrahimbas/s-dnm#readme","_id":"s-dnm@0.0.4","_nodeVersion":"20.3.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-gpqkO6PBJvxWVcrw5m884cptXH7s8bBsccspockYkyyf2OQnfUnzSASfU+f1K+7Ha4hxdXTkVl2Cfg5qbnTuGQ==","shasum":"8ed58677e5883e52386fcfb2ea2df6b754cb40ce","tarball":"https://registry.npmjs.org/s-dnm/-/s-dnm-0.0.4.tgz","fileCount":34,"unpackedSize":22172,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDlSPBh0+lXDjoEjxuNuGoD/znzVu0g+JZsBdEI5h7ifAiA1pESw/TejrUUNN8RlGLxpoHDJ3+jpscdgawmUoXwe+w=="}]},"_npmUser":{"name":"ssibrahimbase","email":"sami.salih_54@outlook.com"},"directories":{},"maintainers":[{"name":"ssibrahimbase","email":"sami.salih_54@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/s-dnm_0.0.4_1691015581444_0.9606451386582404"},"_hasShrinkwrap":false},"0.0.5":{"name":"s-dnm","version":"0.0.5","description":"Drag and Move components for React","main":"./dist/cjs/index.js","module":"./dist/esm/index.js","types":"./dist/esm/index.d.ts","scripts":{"build":"npm run build:esm && npm run build:cjs","build:esm":"tsc","build:cjs":"tsc --module commonjs --outDir dist/cjs","lint":"eslint \"{**/*,*}.{js,ts,jsx,tsx}\"","prettier":"prettier --write \"{src,tests,example/src}/**/*.{js,ts,jsx,tsx}\"","prepare":"npm run build","prepublishOnly":"npm run prettier && npm run lint"},"license":"MIT","author":{"name":"Sami Salih İbrahimbaş","email":"info@ssibrahimbas.com","url":"ssibrahimbas"},"repository":{"type":"git","url":"git+https://github.com/ssibrahimbas/s-dnm.git"},"peerDependencies":{"react":">=16"},"devDependencies":{"@types/react":"^18.2.6","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","eslint":"^8.40.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","eslint-plugin-react":"^7.32.2","eslint-plugin-react-hooks":"^4.6.0","prettier":"^2.8.8","react":"^18.2.0","react-dom":"^18.2.0","typescript":"^5.0.4"},"keywords":["react","react-drag","react-move","drag","move","drag-move","typescript"],"_id":"s-dnm@0.0.5","gitHead":"aa46b88adb6a0db83b04d631db4782b448d464d6","bugs":{"url":"https://github.com/ssibrahimbas/s-dnm/issues"},"homepage":"https://github.com/ssibrahimbas/s-dnm#readme","_nodeVersion":"20.8.0","_npmVersion":"10.1.0","dist":{"integrity":"sha512-VXIY9z8PpAOy/F8dXDSCpkiekzbKUMQjH0TX2DxscNAtPyiTt6xaPtOnau7phdXoxZxD43mSCKSmtGdCwG3K1g==","shasum":"5582efb6cd6a24743f877b77a93cc80a1d18017a","tarball":"https://registry.npmjs.org/s-dnm/-/s-dnm-0.0.5.tgz","fileCount":33,"unpackedSize":32704,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGClz5l6nEoFxF/fJUJbGLt2w+eABdq5z3XzBkUzsJXTAiEA8mjewgnkVE0rc9jdtAqjxbKEbfcgR9556X1UO5OpnTQ="}]},"_npmUser":{"name":"ssibrahimbase","email":"sami.salih_54@outlook.com"},"directories":{},"maintainers":[{"name":"ssibrahimbase","email":"sami.salih_54@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/s-dnm_0.0.5_1700248429581_0.08778281506691465"},"_hasShrinkwrap":false},"0.0.6":{"name":"s-dnm","version":"0.0.6","description":"Drag and Move components for React","main":"./dist/cjs/index.js","module":"./dist/esm/index.js","types":"./dist/esm/index.d.ts","scripts":{"build":"npm run build:esm && npm run build:cjs","build:esm":"tsc","build:cjs":"tsc --module commonjs --outDir dist/cjs","lint":"eslint \"{**/*,*}.{js,ts,jsx,tsx}\"","prettier":"prettier --write \"{src,tests,example/src}/**/*.{js,ts,jsx,tsx}\"","prepare":"npm run build","prepublishOnly":"npm run prettier && npm run lint"},"license":"MIT","author":{"name":"Sami Salih İbrahimbaş","email":"info@ssibrahimbas.com","url":"ssibrahimbas"},"repository":{"type":"git","url":"git+https://github.com/ssibrahimbas/s-dnm.git"},"peerDependencies":{"react":">=16"},"devDependencies":{"@types/react":"^18.2.6","@typescript-eslint/eslint-plugin":"^5.59.6","@typescript-eslint/parser":"^5.59.6","eslint":"^8.40.0","eslint-config-prettier":"^8.8.0","eslint-plugin-prettier":"^4.2.1","eslint-plugin-react":"^7.32.2","eslint-plugin-react-hooks":"^4.6.0","prettier":"^2.8.8","react":"^18.2.0","react-dom":"^18.2.0","typescript":"^5.0.4"},"keywords":["react","react-drag","react-move","drag","move","drag-move","typescript"],"_id":"s-dnm@0.0.6","gitHead":"aa46b88adb6a0db83b04d631db4782b448d464d6","bugs":{"url":"https://github.com/ssibrahimbas/s-dnm/issues"},"homepage":"https://github.com/ssibrahimbas/s-dnm#readme","_nodeVersion":"20.8.0","_npmVersion":"10.1.0","dist":{"integrity":"sha512-ud4YGNadnQpaMmSyI7ME4k5W/f5Uy0+EErXUOJ10D/8J1oKTrqPgd1CeR8L97EN6vLjHm64lQddNvMGRmog7Ug==","shasum":"a1afad161a97878ba944597dc8f25d7731f35caa","tarball":"https://registry.npmjs.org/s-dnm/-/s-dnm-0.0.6.tgz","fileCount":34,"unpackedSize":32948,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDY6KoUNsNINKY0CWxh3xUH2Q/4SEz2X/bfdEYtK5Lv3QIhAMGUjuNcqBKV/cpWubcsQ1JhDtwSW6HxXliU64rW1J0+"}]},"_npmUser":{"name":"ssibrahimbase","email":"sami.salih_54@outlook.com"},"directories":{},"maintainers":[{"name":"ssibrahimbase","email":"sami.salih_54@outlook.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/s-dnm_0.0.6_1700248736690_0.4842430145320229"},"_hasShrinkwrap":false}},"time":{"created":"2023-08-02T21:58:00.939Z","0.0.1":"2023-08-02T21:58:01.113Z","modified":"2023-11-17T19:18:57.075Z","0.0.2":"2023-08-02T22:03:02.340Z","0.0.3":"2023-08-02T22:32:16.474Z","0.0.4":"2023-08-02T22:33:01.795Z","0.0.5":"2023-11-17T19:13:49.825Z","0.0.6":"2023-11-17T19:18:56.899Z"},"maintainers":[{"name":"ssibrahimbase","email":"sami.salih_54@outlook.com"}],"description":"Drag and Move components for React","homepage":"https://github.com/ssibrahimbas/s-dnm#readme","keywords":["react","react-drag","react-move","drag","move","drag-move","typescript"],"repository":{"type":"git","url":"git+https://github.com/ssibrahimbas/s-dnm.git"},"author":{"name":"Sami Salih İbrahimbaş","email":"info@ssibrahimbas.com","url":"ssibrahimbas"},"bugs":{"url":"https://github.com/ssibrahimbas/s-dnm/issues"},"license":"MIT","readme":"# s-dnm\n\n`s-dnm` is a React component library that provides draggable functionality for managing lists. It includes two main components: `DraggableContainer` and `DraggableContainer.Managed`.\n\n## Installation\n\nYou can install `s-dnm` using npm:\n\n```shell\nnpm install s-dnm\n```\n\nor yarn:\n\n```shell\nyarn add s-dnm\n```\n\n## Quick Examples\n\nYou can set up the reordering process according to your own logic, or you can easily sort by using our managed component.\n\nHere are full examples:\n\n### DraggableContainer Full Example\n\n```jsx\nimport React, { useState } from 'react';\nimport DraggableContainer, { move } from 's-dnm';\nimport \"s-dnm/dist/style.css\"\n\nfunction MyComponent() {\n  const [list, setList] = useState([\"Item 1\", \"Item 2\", \"Item 3\"]);\n\n  const handleOrderChange = (oldIndex, newIndex) => {\n    setList(move(list, oldIndex, newIndex));\n  };\n\n  return (\n    <DraggableContainer onOrderChange={handleOrderChange}>\n      {list.map((item, index) => (\n        <div key={index}>{item}</div>\n      ))}\n    </DraggableContainer>\n  );\n}\n```\n\n### DraggableContainer.Managed Full Example\n\n```jsx\nimport React, { useState } from 'react';\nimport DraggableContainer from 's-dnm';\nimport \"s-dnm/dist/style.css\"\n\nfunction MyManagedComponent() {\n  const [list, setList] = useState([\"Item 1\", \"Item 2\", \"Item 3\"]);\n\n  return (\n    <DraggableContainer.Managed list={list} setList={setList}>\n      {list.map((item, index) => (\n        <div key={index}>{item}</div>\n      ))}\n    </DraggableContainer.Managed>\n  );\n}\n```\n\n## API\n\n### DraggableContainer\n\n`DraggableContainer` is a wrapper component that allows you to create a draggable list. It takes the following prop:\n\n- `onOrderChange`: A callback function that will be triggered when the order of items in the list changes. It receives the old index and the new index of the item as arguments.\n\n```jsx\nimport React from 'react';\nimport DraggableContainer from 's-dnm';\n\nfunction MyComponent() {\n  const handleOrderChange = (oldIndex, newIndex) => {\n    // Handle the change in order here\n  };\n\n  return (\n    <DraggableContainer onOrderChange={handleOrderChange}>\n      {/* Your list items here */}\n    </DraggableContainer>\n  );\n}\n```\n\n### DraggableContainer.Managed\n\n`DraggableContainer.Managed` is a component that allows you to manage a list with state. It takes the following props:\n\n`list`: An array of items representing the list.\n`setList`: A state setter function to update the list.\n\n```jsx\nimport React, { useState } from 'react';\nimport DraggableContainer from 's-dnm';\n\nfunction MyManagedComponent() {\n  const [list, setList] = useState([/* Your initial list items here */]);\n\n  return (\n    <DraggableContainer.Managed list={list} setList={setList}>\n      {/* Your draggable list items here */}\n    </DraggableContainer.Managed>\n  );\n}\n```\n\n### Utilities\n\n`s-dnm` also provides a utility function that you can use to move items within a list.\n\n#### move (function)\n\nThe `move` function takes an array, the current index of the item to move, and the target index where the item should be moved to. It returns a new array with the item moved to the desired position.\n\n```js\nimport { move } from 's-dnm';\n\nconst list = [/* Your list items here */];\nconst movedList = move(list, currentIndex, targetIndex);\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.\n","readmeFilename":"README.md"}