[
  {
    "path": ".gitignore",
    "content": "node_modules\ndist\n\n**/.DS_Store\n\n.vscode/*\n.idea\n.iml\n*.code-workspace\n\n.env\nyarn-debug.log*\nyarn-error.log*\n"
  },
  {
    "path": "CODE_OF_CONDUCT.md",
    "content": "# Contributor Covenant Code of Conduct\n\n## Our Pledge\n\nIn the interest of fostering an open and welcoming environment, we as contributors and maintainers\npledge to making participation in our project and our community a harassment-free experience for\neveryone, regardless of age, body size, disability, ethnicity, gender identity and expression, level\nof experience, nationality, personal appearance, race, religion, or sexual identity and orientation.\n\n## Our Standards\n\nExamples of behavior that contributes to creating a positive environment include:\n\n- Using welcoming and inclusive language\n- Being respectful of differing viewpoints and experiences\n- Gracefully accepting constructive criticism\n- Focusing on what is best for the community\n- Showing empathy towards other community members\n\nExamples of unacceptable behavior by participants include:\n\n- The use of sexualized language or imagery and unwelcome sexual attention or advances\n- Trolling, insulting/derogatory comments, and personal or political attacks\n- Public or private harassment\n- Publishing others' private information, such as a physical or electronic address, without explicit\n  permission\n- Other conduct which could reasonably be considered inappropriate in a professional setting\n\n## Our Responsibilities\n\nProject maintainers are responsible for clarifying the standards of acceptable behavior and are\nexpected to take appropriate and fair corrective action in response to any instances of unacceptable\nbehavior.\n\nProject maintainers have the right and responsibility to remove, edit, or reject comments, commits,\ncode, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or\nto ban temporarily or permanently any contributor for other behaviors that they deem inappropriate,\nthreatening, offensive, or harmful.\n\n## Scope\n\nThis Code of Conduct applies both within project spaces and in public spaces when an individual is\nrepresenting the project or its community. Examples of representing a project or community include\nusing an official project e-mail address, posting via an official social media account, or acting as\nan appointed representative at an online or offline event. Representation of a project may be\nfurther defined and clarified by project maintainers.\n\n## Enforcement\n\nInstances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting\nthe project team at areardon@atlassian.com. The project team will review and investigate all\ncomplaints, and will respond in a way that it deems appropriate to the circumstances. The project\nteam is obligated to maintain confidentiality with regard to the reporter of an incident. Further\ndetails of specific enforcement policies may be posted separately.\n\nProject maintainers who do not follow or enforce the Code of Conduct in good faith may face\ntemporary or permanent repercussions as determined by other members of the project's leadership.\n\n## Attribution\n\nThis Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at\n[http://contributor-covenant.org/version/1/4][version]\n\n[homepage]: http://contributor-covenant.org\n[version]: http://contributor-covenant.org/version/1/4/\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing\n\nThank you for considering contributing to Pragmatic drag and drop!\n\nAt this stage, we are not accepting code contributions. This repo is currently a one-way partial\nmirror from an internal monorepo at Atlassian. We might change this repo to be a two way mirror in\nthe future, at which point code contributions would be possible.\n\nAt this stage contributions could take the following forms:\n\nLeveraging Github issues for:\n\n- Suggestions\n- Bug reports\n- Discussions\n\nYou _can_ raise a pull request if you would spot a bug / improvement and making a pull request would\nbe a helpful way to demonstrate things. We will be able make our own changes to Pragmatic drag and\ndrop, as inspired by these pull requests, but unfortunately at this stage we cannot directly merge\nthose changes (nor attribute them properly in the Git history).\n"
  },
  {
    "path": "LICENSE",
    "content": "Copyright 2024 Atlassian Pty Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n"
  },
  {
    "path": "README.md",
    "content": "<div align=\"center\">\n<picture>\n  <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://github.com/alexreardon/files/assets/2182637/4405f071-4d88-4ad7-bcc0-a050420f3f3e\" height=\"372px\" width=\"372px\" aria-label=\"Pragmatic drag and drop logo\">\n  <img src=\"https://github.com/alexreardon/files/assets/2182637/9e57e0bb-aa9b-4552-affa-59aecf70bfc0\" height=\"372px\" width=\"372px\" aria-label=\"Pragmatic drag and drop logo\">\n</picture>\n\n_Fast drag and drop for any experience on any tech stack_\n\n[📖 **Documentation**](https://atlassian.design/components/pragmatic-drag-and-drop) | [🤹 **Examples**](https://atlassian.design/components/pragmatic-drag-and-drop/examples) | [🎥  **How it works**](https://www.youtube.com/watch?v=5SQkOyzZLHM)\n\n![Show case of some examples](https://github.com/alexreardon/files/assets/2182637/2b533f88-bf3f-402f-93f2-74a466918ac4)\n\n</div>\n\n<br/>\n\n## About\n\nPragmatic drag and drop is a low level drag and drop toolchain that enables safe and successful usage of the browsers built in drag and drop functionality. Pragmatic drag and drop can be used with any view layer ([`react`](https://react.dev/), [`svelte`](https://svelte.dev/), [`vue`](https://vuejs.org/), [`angular`](https://angular.io/) and so on). Pragmatic drag and drop is powering some of the biggest products on the web, including [Trello](https://trello.com), [Jira](https://www.atlassian.com/software/jira) and [Confluence](https://www.atlassian.com/software/confluence).\n\n<details>\n    <summary>Capabilities</summary>\n\nPragmatic drag and drop consists of a few high level pieces:\n\n1. **Low level drag and drop behavior**\n\nPragmatic drag and drop contains a core package, and a number of optional packages, that provide you the pieces to create _any_ drag and drop experience.\n\nThese pieces are unopinionated about visual language or accessibility, and have no dependency on the Atlassian Design System.\n\n- _Tiny_: ~`4.7kB` core\n- _Incremental_: Only use the pieces that you need\n- _Headless_: Full rendering and style control\n- _Framework agnostic_: Works with any frontend framework\n- _Deferred compatible_: Delay the loading the core packages and optional packages in order to further improve page load speeds\n- _Flexible_: create any experience you want, make any changes you want during a drag operation.\n- _Works everywhere_: Full feature support in Firefox, Safari, and Chrome, iOS and Android\n- _Virtualization support_: create any virtual experience you want!\n\n2. **Optional visual outputs**\n\nWe have created optional visual outputs (eg our drop indicator) to make it super fast for us to build consistent Atlassian user experiences. Non Atlassian consumers are welcome to use these outputs, create their own that copy the visual styling, or go a totally different direction.\n\n3. **Optional assistive technology controls**\n\nNot all users can achieve pointer based drag and drop experiences. In order to achieve fantastic experiences for assistive technology users, we provide a toolchain to allow you to quickly wire up performant assistive technology friendly flows for any experience.\n\nThe optional assistive controls we provide are based on the Atlassian Design System. If you do not want to use the Atlassian Design System, you can use our guidelines and substitute our components with your own components, or you can go about accessibility in a different way if you choose.\n\n</details>\n\n## What is this repository?\n\nThis repository is currently one way mirror from our internal monorepo that contains all the code for Pragmatic drag and drop.\n\n<div align=\"center\">\n\n<img src=\"https://github.com/alexreardon/files/assets/2182637/b45c2dfe-2c54-459e-a3e6-68b2342fe97b\" alt=\"Diagram of how the mirror works\" width=\"600px\">\n\n</div>\n\n The intention of this repository is to make public our code, but not to accept code contributions (at this stage). In the future we could explore setting up a two way mirror so that contributions to this repo can also make their way back to our monorepo. You are still welcome to raise issues or suggestions on this repository!\n\nAll documentation and `npm` packages are public and available for use by everyone.\n\n## Can I use this with my own Design System?\n\nYep! Pragmatic drag and drop as a [small core package](https://atlassian.design/components/pragmatic-drag-and-drop/core-package), and then a range of [optional packages](https://atlassian.design/components/pragmatic-drag-and-drop/optional-packages). Some of the optional packages have dependencies on styling solutions (eg `emotion`), view libraries (eg `react`) or on some additional Atlassian outputs (eg `@atlaskit/tokens`). We have separated out optional packages that have other dependencies so they can be easily swapped with your own pieces that use your own tech stack and visual outputs.\n\n## Can I use my own design language?\n\nYep! We have created some design guidelines which embody how we want to achieve drag and drop in our products, and some of those decisions are embodied in some optional packages. However, you are free to use whatever design language you like, including ours!\n\n## What is `@atlaskit`?\n\nThe Pragmatic drag and drop packages are published under the `@atlaskit` namespace on `npm`\n\n```ts\nimport { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n```\n\n`@atlaskit` is the `npm` namespace that we publish all of our public packages on from inside our internal monorepo. We _could_ look at creating a separate namespace in the future just for Pragmatic drag and drop. If we do that, we'll release some tooling to help folks automatically switch over.\n\n## `npm` release and repo sync timing\n\nThis mirror repository is currently being synced with our internal repository once a day. We publish packages to `npm` immediately as we merge new versions into the internal repository. This means that code can be released onto `npm` up to 24 hours _before_ it is available in this mirror repository.\n\n## Credits\n\nMade with love by:\n\n- [Alex Reardon](https://twitter.com/alexandereardon)\n- [Declan Warn](https://twitter.com/DeclanWarn)\n- [Lewis Healey](https://twitter.com/lewishealey)\n- [Eleni Misthos](https://www.linkedin.com/in/elenimisthos/)\n- [Jesse Bauer](https://soundcloud.com/jessebauer)\n- [Mitch Gavan](https://twitter.com/MitchG23)\n- [Michael Abrahamian](https://twitter.com/michaelguitars7)\n- [Tim Keir](https://twitter.com/ReDrUmNZ)\n- [Greta Ritchard](https://www.linkedin.com/in/gretarit/)\n- [Many other folks at Atlassian](https://www.atlassian.com/)\n- Logo created by [Michelle Holik](https://twitter.com/michelleholik) and [Vojta Holik](https://twitter.com/vojta_holik)\n\nPragmatic drag and drop stands on the shoulders of giants, including the folks who created the [drag and drop specifications](https://html.spec.whatwg.org/multipage/dnd.html), implemented drag and drop in browsers, and the many drag and drop libraries that came before this.\n"
  },
  {
    "path": "jest.config.js",
    "content": ""
  },
  {
    "path": "package.json",
    "content": "{\n\t\"name\": \"pragmatic-drag-and-drop\",\n\t\"private\": true,\n\t\"version\": \"1.0.0\",\n\t\"description\": \"Pragmatic drag and drop is a low level toolchain that enables fast and successful usage of the browsers built in drag and drop capabilities, for everyone\",\n\t\"author\": \"Atlassian Pty Ltd\",\n\t\"license\": \"Apache-2.0\",\n\t\"scripts\": {\n\t\t\"postinstall\": \"patch-package\",\n\t\t\"test\": \"jest --forceExit\"\n\t},\n\t\"workspaces\": [\n\t\t\"packages/*\"\n\t],\n\t\"dependencies\": {\n\t\t\"tslib\": \"^2.4.0\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@types/jest\": \"^29.5.12\",\n\t\t\"jest\": \"^29.7.0\",\n\t\t\"jest-environment-jsdom\": \"^29.7.0\",\n\t\t\"patch-package\": \"^8.0.0\",\n\t\t\"postinstall-postinstall\": \"^2.1.0\",\n\t\t\"typescript\": \"5.9.2\"\n\t}\n}\n"
  },
  {
    "path": "packages/auto-scroll/.npmignore",
    "content": "src/\nexamples-utils/\nexamples/\nindex.ts\ndocs/\nbuild/\n__tests__/\ntsconfig.json\ntsconfig.app.json\ntsconfig.dev.json\n"
  },
  {
    "path": "packages/auto-scroll/CHANGELOG.md",
    "content": "# @atlaskit/pragmatic-drag-and-drop-auto-scroll\n\n## 2.1.5\n\n### Patch Changes\n\n- [`d3ed1b65a2181`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d3ed1b65a2181) -\n  Add @atlassian/a11y-jest-testing to devDependencies.\n\n## 2.1.4\n\n### Patch Changes\n\n- [`e4b717d8304e8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e4b717d8304e8) -\n  Add @atlassian/a11y-jest-testing to devDependencies.\n\n## 2.1.3\n\n### Patch Changes\n\n- [`aa9ff75020fcb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/aa9ff75020fcb) -\n  Add @atlassian/a11y-jest-testing to devDependencies.\n\n## 2.1.2\n\n### Patch Changes\n\n- [`beaa6ee463aa8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/beaa6ee463aa8) -\n  Internal changes to how border radius is applied.\n- Updated dependencies\n\n## 2.1.1\n\n### Patch Changes\n\n- [#164244](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/164244)\n  [`65021fc0267e2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/65021fc0267e2) -\n  The cleanup functions returned by the following utilities now only work on the first call. This\n  was done to prevent unexpected side effects of calling a cleanup function multiple times.\n  - `@atlaskit/pragmatic-drag-and-drop/adapter/element`\n    - `draggable`\n    - `dropTargetForElements`\n    - `monitorForElements`\n  - `@atlaskit/pragmatic-drag-and-drop/adapter/text-selection`\n    - `dropTargetForTextSelection`\n    - `monitorForTextSelection`\n  - `@atlaskit/pragmatic-drag-and-drop/adapter/external`\n    - `dropTargetForExternal`\n    - `monitorForExternal`\n  - `@atlaskit/pragmatic-drag-and-drop-auto-scroll/element`\n    - `autoScrollForElements`\n    - `autoScrollWindowForElements`\n  - `@atlaskit/pragmatic-drag-and-drop-auto-scroll/external`\n    - `autoScrollForExternal`\n    - `autoScrollWindowForExternal`\n  - `@atlaskit/pragmatic-drag-and-drop-auto-scroll/text-selection`\n    - `autoScrollForTextSelection`\n    - `autoScrollWindowForTextSelection`\n\n- Updated dependencies\n\n## 2.1.0\n\n### Minor Changes\n\n- [#172374](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/172374)\n  [`4ca6346256c8a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4ca6346256c8a) -\n  Minor increase of time dampening duration. After lots of explorations, we have increased the value\n  to make it easier for people to avoid the impacts of rapid scroll speed spikes when lifting or\n  entering into a high scroll speed area.\n\n## 2.0.0\n\n### Major Changes\n\n- [#170839](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/170839)\n  [`1534389dcb75b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1534389dcb75b) -\n  In order to improve clarity, we have renamed the `from*Edge` (eg `fromTopEdge`) argument\n  properties to `for*Edge` (eg `forTopEdge`) for the overflow scroller. If you are not using\n  overflow scrolling, there is nothing you need to do.\n\n  ```diff\n  - fromTopEdge\n  + forTopEdge\n  - fromRightEdge\n  + forRightEdge\n  - fromBottomEdge\n  + forBottomEdge\n  - fromLeftEdge\n  + forLeftEdge\n  ```\n\n  ```diff\n  const unbind = unsafeOverflowAutoScrollForElements({\n  \t\telement,\n  \t\tgetOverflow: () => ({\n  -\t\t\tfromTopEdge: {\n  +\t\t\tforTopEdge: {\n  \t\t\t\ttop: 6000,\n  \t\t\t\tright: 6000,\n  \t\t\t\tleft: 6000,\n  \t\t\t},\n  -\t\t\tfromRightEdge: {\n  +\t\t\tforRightEdge: {\n  \t\t\t\ttop: 6000,\n  \t\t\t\tright: 6000,\n  \t\t\t\tbottom: 6000,\n  \t\t\t},\n  -\t\t\tfromBottomEdge: {\n  +\t\t\tforBottomEdge: {\n  \t\t\t\tright: 6000,\n  \t\t\t\tbottom: 6000,\n  \t\t\t\tleft: 6000,\n  \t\t\t},\n  -\t\t\tfromLeftEdge: {\n  +\t\t\tforLeftEdge: {\n  \t\t\t\ttop: 6000,\n  \t\t\t\tleft: 6000,\n  \t\t\t\tbottom: 6000,\n  \t\t\t},\n  \t\t}),\n  });\n  ```\n\n  We thought that `for*` more accurately represented what was being provided, as these are the\n  overflow definitions _for_ a defined edge.\n\n  We have also improved the types for `for*Edge` so that you do not need to provide redundant cross\n  axis information if you only want to overflow scroll on the main axis.\n\n  ```diff\n  const unbind = unsafeOverflowAutoScrollForElements({\n  \t\telement,\n  \t\tgetOverflow: () => ({\n  \t\t\tforTopEdge: {\n  \t\t\t\ttop: 100,\n  +       // no longer need to pass `0` for the cross axis if you don't need it\n  -\t\t\t\tright: 0,\n  -\t\t\t\tleft: 0,\n  \t\t\t},\n  \t\t\tforRightEdge: {\n  \t\t\t\tright: 100,\n  -\t\t\t\ttop: 0,\n  -\t\t\t\tbottom: 0,\n  \t\t\t},\n  \t\t\tforBottomEdge: {\n  \t\t\t\tbottom: 100,\n  -\t\t\t\tright: 0,\n  -\t\t\t\tleft: 0,\n  \t\t\t},\n  \t\t\tforLeftEdge: {\n  \t\t\t\tleft: 100,\n  -\t\t\t\ttop: 0,\n  -\t\t\t\tbottom: 0,\n  \t\t\t},\n  \t\t}),\n  });\n  ```\n\n  When declaring overflow scrolling for an edge, you cannot provide how deep the scrolling should\n  occur into the element (that is defined by the \"over element\" overflow scroller). Providing\n  redundant information for an edge will now also give a type error rather than providing no\n  feedback.\n\n  ```ts\n  const unbind = unsafeOverflowAutoScrollForElements({\n  \telement,\n  \tgetOverflow: () => ({\n  \t\tforTopEdge: {\n  \t\t\ttop: 100,\n  \t\t\tbottom: 30, // ❌ now a type error\n  \t\t},\n  \t\tforRightEdge: {\n  \t\t\tright: 100,\n  \t\t\tleft: 10, // ❌ now a type error\n  \t\t},\n  \t\tforBottomEdge: {\n  \t\t\tbottom: 100,\n  \t\t\ttop: 200, // ❌ now a type error\n  \t\t},\n  \t\tforLeftEdge: {\n  \t\t\tleft: 100,\n  \t\t\tright: 20, // ❌ now a type error\n  \t\t},\n  \t}),\n  });\n  ```\n\n## 1.4.0\n\n### Minor Changes\n\n- [#116572](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116572)\n  [`98c65e7ff719c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/98c65e7ff719c) -\n  🍯 Introducing \"the honey pot fix\" which is an improved workaround for a\n  [painful browser bug](https://issues.chromium.org/issues/41129937).\n\n  **Background**\n\n  The browser bug causes the browser to think the users pointer is continually depressed at the\n  point that the user started a drag. This could lead to incorrect events being triggered, and\n  incorrect styles being applied to elements that the user is not currently over during a drag.\n\n  **Outcomes**\n  - Elements will no longer receive `MouseEvent`s (eg `\"mouseenter\"` and `\"mouseleave\"`) during a\n    drag (which is a violation of the\n    [drag and drop specification](https://html.spec.whatwg.org/multipage/dnd.html#drag-and-drop-processing-model))\n  - Elements will no longer apply `:hover` or `:active` styles during a drag. Previously consumers\n    would need to disable these style rules during a drag to prevent these styles being applied.\n  - Dramatically improved post drop performance. Our prior solution could require a noticeable delay\n    due to a large style recalculation after a drop.\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.3.0\n\n### Minor Changes\n\n- [#95426](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/95426)\n  [`a58266bf88e6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a58266bf88e6) -\n  Adding axis locking functionality\n\n  ```diff\n  + // `getAllowedAxis` added to element, text selection and external auto scrollers\n\n    autoScrollForElements({\n      element: myElement,\n  +    getAllowedAxis: (args: ElementGetFeedbackArgs<DragType>) =>  'horizontal' | 'vertical' | 'all',\n    });\n\n    autoScrollWindowForElements({\n  +    getAllowedAxis: (args: WindowGetFeedbackArgs<DragType>) =>  'horizontal' | 'vertical' | 'all',\n    });\n\n    unsafeOverflowAutoScrollForElements({\n  +    getAllowedAxis?: (args: ElementGetFeedbackArgs<DragType>) => AllowedAxis;\n    })\n  ```\n\n## 1.2.0\n\n### Minor Changes\n\n> `1.2.0` is deprecated on `npm` and should not be used. Shortly after release we decided to change\n> this API\n\n- [#94103](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94103)\n  [`4e3fb63eb288`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4e3fb63eb288) -\n  Added axis locking functionality.\n\n  ```diff\n  autoScrollForElements({\n    element: myElement,\n    getConfiguration: () => ({\n      maxScrollSpeed: 'fast' | 'standard',\n  +    allowedAxis: 'horizontal' | 'vertical' | 'all',\n    }),\n  })\n  ```\n\n## 1.1.0\n\n### Minor Changes\n\n- [#94454](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94454)\n  [`4b40eb010074`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4b40eb010074) -\n  Exposing the unsafe overflow auto scroller for external drags\n  (`unsafeOverflowAutoScrollForExternal()`). This already existed, but it was not exposed publicly\n  🤦‍♂️.\n\n  ```diff\n  import {unsafeOverflowAutoScrollForElements from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/unsafe-overflow/element';\n  import {unsafeOverflowAutoScrollForTextSelection} from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/unsafe-overflow/text-selection';\n  + import {unsafeOverflowAutoScrollForExternal} from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/unsafe-overflow/external';\n  ```\n\n## 1.0.4\n\n### Patch Changes\n\n- [#94316](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94316)\n  [`35fd5ed8e1d7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/35fd5ed8e1d7) -\n  Upgrading internal dependency `bind-event-listener` to `@^3.0.0`\n\n## 1.0.3\n\n### Patch Changes\n\n- [#84398](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84398)\n  [`77694db987fc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/77694db987fc) -\n  Public release of Pragmatic drag and drop documentation\n\n## 1.0.2\n\n### Patch Changes\n\n- [#83702](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83702)\n  [`4d9e25ab4eaa`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4d9e25ab4eaa) -\n  Updating the descriptions of Pragmatic drag and drop packages, so they each provide a consistent\n  description to various consumers, and so they are consistently formed amongst each other.\n  - `package.json` `description`\n  - `README.md`\n  - Website documentation\n\n## 1.0.1\n\n### Patch Changes\n\n- [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116)\n  [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) -\n  Upgrade Typescript from `4.9.5` to `5.4.2`\n\n## 1.0.0\n\n### Major Changes\n\n- [#70616](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70616)\n  [`42e57ea65fee`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/42e57ea65fee) -\n  This is our first `major` release (`1.0`) for all Pragmatic drag and drop packages.\n\n  For a detailed explanation of these changes, and how to upgrade (automatically) to `1.0` please\n  see our\n  [1.0 upgrade guide](http://atlassian.design/components/pragmatic-drag-and-drop/core-package/upgrade-guides/upgrade-guide-for-1.0)\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.8.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.8.0\n\n### Minor Changes\n\n- [#57337](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/57337)\n  [`4ad3fa749a5c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4ad3fa749a5c) -\n  Adding the ability to increase the maximum automatic scroll speed.\n\n  ```diff\n  autoScrollForElements({\n    element: myElement,\n  +  getConfiguration: () => ({maxScrollSpeed: 'fast' | 'standard'}),\n  })\n  ```\n\n  `getConfiguration()` is a new _optional_ argument be used with all auto scrolling registration\n  functions:\n  - `autoScrollForElements`\n  - `autoScrollWindowForElements`\n  - `autoScrollForFiles`\n  - `autoScrollWindowForFiles`\n  - `unsafeOverflowForElements`\n  - `unsafeOverflowForFiles`\n\n  ```ts\n  autoScrollForElements({\n    element: myElement,\n    getConfiguration: () => ({ maxScrollSpeed : 'fast' })\n  }),\n  ```\n\n  We recommend using the default `\"standard\"` max scroll speed for most experiences. However, on\n  _some_ larger experiences, a faster max scroll speed (`\"fast\"`) can feel better.\n\n## 0.7.0\n\n### Minor Changes\n\n- [#42774](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42774)\n  [`66d9475437e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/66d9475437e) - Internal\n  refactoring to improve clarity and safety\n\n## 0.6.0\n\n### Minor Changes\n\n- [#42668](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42668)\n  [`0a4e3f44ba3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0a4e3f44ba3) - We have\n  landed a few fixes for \"overflow scrolling\"\n  - Fix: Time dampening could be incorrectly reset when transitioning from \"over element\" auto\n    scrolling to \"overflow\" auto scrolling for certain element configurations.\n  - Fix: Parent \"overflow scrolling\" registrations could prevent overflow scrolling on children\n    elements, if the parent was registered first.\n  - Fix: \"overflow scrolling\" `canScroll() => false` would incorrectly opt out of \"overflow\n    scrolling\" for younger registrations.\n\n## 0.5.0\n\n### Minor Changes\n\n- [#39935](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39935)\n  [`20a91012629`](https://bitbucket.org/atlassian/atlassian-frontend/commits/20a91012629) - First\n  public release of this package. Please refer to documentation for usage and API information.\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.4.0\n\n### Minor Changes\n\n- [#39303](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39303)\n  [`a6d9f3bb566`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a6d9f3bb566) - Adding\n  optional overflow scrolling API. API information shared directly with Trello\n\n## 0.3.2\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.3.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.3.0\n\n### Minor Changes\n\n- [#38658](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38658)\n  [`7803a90e9c6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7803a90e9c6) - This\n  change makes it so that distance dampening is based on the size of the hitbox and not the\n  container. Now that we clamp the size of the hitbox, our distance dampening needs to be based on\n  the size of the hitbox, and not the container.\n\n## 0.2.0\n\n### Minor Changes\n\n- [#38630](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38630)\n  [`5c643ce004d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5c643ce004d) - Limiting\n  the max size of auto scrolling hitboxes. This prevents large elements having giant auto scroll\n  hitboxes\n\n## 0.1.0\n\n### Minor Changes\n\n- [#38525](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38525)\n  [`693af8c5775`](https://bitbucket.org/atlassian/atlassian-frontend/commits/693af8c5775) - Early\n  release of our new optional drag and drop package for Pragmatic drag and drop. Package release is\n  only for early integration with Trello.\n\n### Patch Changes\n\n- Updated dependencies\n"
  },
  {
    "path": "packages/auto-scroll/LICENSE.md",
    "content": "Copyright 2023 Atlassian Pty Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in\ncompliance with the License. You may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is\ndistributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\nimplied. See the License for the specific language governing permissions and limitations under the\nLicense.\n"
  },
  {
    "path": "packages/auto-scroll/README.md",
    "content": "## Pragmatic drag and drop\n\nAn optional Pragmatic drag and drop package that enables automatic scrolling during a drag operation. This package works with any configuration of scrollable entities, and you can change the configuration of your scrollable entities in any way you like during a drag.\n\n[📖 Documentation](https://atlassian.design/components/pragmatic-drag-and-drop/)\n"
  },
  {
    "path": "packages/auto-scroll/__tests__/playwright/over-element-smoke-test.spec.tsx",
    "content": "import invariant from 'tiny-invariant';\n\nimport { expect, test } from '@af/integration-testing';\n\ntest.describe('over element automatic scrolling', () => {\n\ttest('should scroll a scrollable element forwards', async ({ page }) => {\n\t\tawait page.visitExample<typeof import('../../examples/over-element.tsx')>('pragmatic-drag-and-drop', 'auto-scroll', 'over-element');\n\n\t\tconst columnTestId = 'column-0';\n\t\tconst card = page.getByTestId('column-0::item-0');\n\t\tconst column = page.getByTestId(columnTestId);\n\n\t\t// first check: ensure the column is not scrolled yet\n\t\texpect(await column.evaluate((element) => element.scrollTop)).toBe(0);\n\n\t\tconst columnRect = await column.boundingBox();\n\t\tinvariant(columnRect, 'Could not obtain bounding box from column');\n\n\t\tawait card.hover();\n\t\tawait page.mouse.down();\n\t\t// Using 'move' rather than 'hover' as 'hover' also does it's own scrolling\n\t\tawait page.mouse.move(\n\t\t\tcolumnRect.x + columnRect.width / 2,\n\t\t\t// Going up a bit from the bottom so we know it is\n\t\t\t// our auto scroller and not the browsers built in one\n\t\t\tcolumnRect.y + columnRect.height - 30,\n\t\t\t// having one step so we don't trigger the browsers built in auto scroller\n\t\t\t{ steps: 1 },\n\t\t);\n\n\t\tawait page.waitForFunction((testId) => {\n\t\t\tconst element = document.querySelector(`[data-testid=\"${testId}\"]`);\n\t\t\tif (!element) {\n\t\t\t\tthrow new Error(`Unable to find element with test id \"${testId}\"`);\n\t\t\t}\n\t\t\treturn element.scrollTop > 0;\n\t\t}, columnTestId);\n\t});\n});\n"
  },
  {
    "path": "packages/auto-scroll/__tests__/playwright/unsafe-overflow-smoke-test.spec.tsx",
    "content": "import invariant from 'tiny-invariant';\n\nimport { expect, test } from '@af/integration-testing';\n\ntest.describe('over element automatic scrolling', () => {\n\ttest('should scroll a scrollable element forwards', async ({ page }) => {\n\t\tawait page.visitExample<typeof import('../../examples/unsafe-overflow-only.tsx')>('pragmatic-drag-and-drop', 'auto-scroll', 'unsafe-overflow-only');\n\n\t\tconst columnTestId = 'column-0';\n\t\tconst card = page.getByTestId('column-0::item-0');\n\t\tconst column = page.getByTestId(columnTestId);\n\n\t\t// first check: ensure the column is not scrolled yet\n\t\texpect(await column.evaluate((element) => element.scrollTop)).toBe(0);\n\n\t\tconst columnRect = await column.boundingBox();\n\t\tinvariant(columnRect, 'Could not obtain bounding box from column');\n\n\t\tawait card.hover();\n\t\tawait page.mouse.down();\n\t\t// Using 'move' rather than 'hover' as 'hover' also does it's own scrolling\n\t\tawait page.mouse.move(\n\t\t\tcolumnRect.x + columnRect.width / 2,\n\t\t\t// Going below the column a bit so we know we are triggering the overflow scroller\n\t\t\tcolumnRect.y + columnRect.height + 100,\n\t\t\t{ steps: 20 },\n\t\t);\n\n\t\tawait page.waitForFunction((testId) => {\n\t\t\tconst element = document.querySelector(`[data-testid=\"${testId}\"]`);\n\t\t\tif (!element) {\n\t\t\t\tthrow new Error(`Unable to find element with test id \"${testId}\"`);\n\t\t\t}\n\t\t\treturn element.scrollTop > 0;\n\t\t}, columnTestId);\n\t});\n});\n"
  },
  {
    "path": "packages/auto-scroll/__tests__/unit/_util.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport invariant from 'tiny-invariant';\n\nimport {\n\ttype CleanupFn,\n\ttype DragLocation,\n\ttype DragLocationHistory,\n\ttype DropTargetRecord,\n\ttype Input,\n\ttype Position,\n} from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport { type Axis, type Edge } from '../../src/internal-types';\n\nexport function getDefaultInput(overrides: Partial<Input> = {}): Input {\n\tconst defaults: Input = {\n\t\t// user input\n\t\taltKey: false,\n\t\tbutton: 0,\n\t\tbuttons: 0,\n\t\tctrlKey: false,\n\t\tmetaKey: false,\n\t\tshiftKey: false,\n\n\t\t// coordinates\n\t\tclientX: 0,\n\t\tclientY: 0,\n\t\tpageX: 0,\n\t\tpageY: 0,\n\t};\n\n\treturn {\n\t\t...defaults,\n\t\t...overrides,\n\t};\n}\n\nexport function appendToBody(...elements: Element[]): CleanupFn {\n\telements.forEach((element) => {\n\t\tdocument.body.appendChild(element);\n\t});\n\n\treturn function removeFromBody() {\n\t\telements.forEach((element) => {\n\t\t\tdocument.body.removeChild(element);\n\t\t});\n\t};\n}\n\nexport function getEmptyHistory(input: Input = getDefaultInput()): DragLocationHistory {\n\tconst noWhere: DragLocation = {\n\t\tinput,\n\t\tdropTargets: [],\n\t};\n\n\treturn {\n\t\tinitial: noWhere,\n\t\tprevious: {\n\t\t\tdropTargets: noWhere.dropTargets,\n\t\t},\n\t\tcurrent: noWhere,\n\t};\n}\n\nexport function getInitialHistory(\n\tdropTargets: DropTargetRecord[],\n\tinput: Input = getDefaultInput(),\n): DragLocationHistory {\n\tconst location: DragLocation = {\n\t\tinput,\n\t\tdropTargets,\n\t};\n\n\treturn {\n\t\tinitial: location,\n\t\tcurrent: location,\n\t\tprevious: {\n\t\t\tdropTargets: [],\n\t\t},\n\t};\n}\n\nexport function setBoundingClientRect(el: HTMLElement, rect: DOMRect): CleanupFn {\n\tconst original = el.getBoundingClientRect;\n\n\tel.getBoundingClientRect = () => rect;\n\treturn () => {\n\t\tel.getBoundingClientRect = original;\n\t};\n}\n\nexport function tryGetRect(box: Partial<Parameters<typeof getRect>[0]>): DOMRect {\n\tconst { top, right, bottom, left } = box;\n\tinvariant(typeof top === 'number');\n\tinvariant(typeof right === 'number');\n\tinvariant(typeof bottom === 'number');\n\tinvariant(typeof left === 'number');\n\n\treturn getRect({ top, right, bottom, left });\n}\n\nexport function getRect(box: {\n\ttop: number;\n\tright: number;\n\tbottom: number;\n\tleft: number;\n}): DOMRect {\n\treturn {\n\t\ttop: box.top,\n\t\tright: box.right,\n\t\tbottom: box.bottom,\n\t\tleft: box.left,\n\t\t// calculated\n\t\theight: box.bottom - box.top,\n\t\twidth: box.right - box.left,\n\t\tx: box.left,\n\t\ty: box.top,\n\t\ttoJSON: function () {\n\t\t\treturn JSON.stringify(this);\n\t\t},\n\t};\n}\n\n// usage: const [A, B, C, D, F] = getElements();\nexport function getElements(tagName: keyof HTMLElementTagNameMap = 'div'): Iterable<HTMLElement> {\n\tconst iterator = {\n\t\tnext() {\n\t\t\treturn {\n\t\t\t\tdone: false,\n\t\t\t\tvalue: document.createElement(tagName),\n\t\t\t};\n\t\t},\n\t\t[Symbol.iterator]() {\n\t\t\treturn iterator;\n\t\t},\n\t};\n\treturn iterator;\n}\n\n/**\n * Returns a connected tree of elements\n * `[grandChild, parent, grandParent]`\n */\nexport function getBubbleOrderedTree(\n\ttagName: keyof HTMLElementTagNameMap = 'div',\n): Iterable<HTMLElement> {\n\tlet last: HTMLElement | null;\n\tconst iterator = {\n\t\tnext() {\n\t\t\tconst element = document.createElement(tagName);\n\n\t\t\tif (last) {\n\t\t\t\telement.appendChild(last);\n\t\t\t}\n\t\t\tlast = element;\n\n\t\t\treturn {\n\t\t\t\tdone: false,\n\t\t\t\tvalue: element,\n\t\t\t};\n\t\t},\n\t\t[Symbol.iterator]() {\n\t\t\treturn iterator;\n\t\t},\n\t};\n\treturn iterator;\n}\n\nexport const userEvent = {\n\tlift(target: HTMLElement, input?: Partial<Input>): void {\n\t\tconst final: Input = { ...getDefaultInput(), ...input };\n\t\t// accurate representation of events:\n\t\tfirePointer.down(target, final);\n\t\tfirePointer.move(target, { ...final, clientX: final.clientX + 10 });\n\n\t\t// will fire `onGenerateDragPreview`\n\t\tfireEvent.dragStart(target, final);\n\t\tfirePointer.cancel(target, final);\n\n\t\t// after an animation frame we fire `onDragStart`\n\t\tadvanceTimersToNextFrame();\n\t},\n\tdrop(target: Element): void {\n\t\tfireEvent.drop(target);\n\t},\n\tcancel(target: Element = document.body): void {\n\t\t// A \"cancel\" (drop on nothing, or pressing \"Escape\") will\n\t\t// cause a \"dragleave\" and then a \"dragend\"\n\t\tfireEvent.dragLeave(target);\n\t\tfireEvent.dragEnd(target);\n\t},\n\tleaveWindow(): void {\n\t\tfireEvent.dragLeave(document.documentElement, { relatedTarget: null });\n\t},\n\tstartExternalDrag({\n\t\ttypes,\n\t\ttarget = document.body,\n\t}: {\n\t\ttypes: string[];\n\t\ttarget?: Element;\n\t}): void {\n\t\tconst event = new DragEvent('dragenter', {\n\t\t\tcancelable: true,\n\t\t\tbubbles: true,\n\t\t});\n\t\tfor (const type of types) {\n\t\t\t// @ts-expect-error\n\t\t\tevent.dataTransfer?.types.push(type);\n\t\t}\n\t\ttarget.dispatchEvent(event);\n\t\tadvanceTimersToNextFrame();\n\t},\n\trougePointerMoves(): void {\n\t\t// first 20 are ignored due to firefox issue\n\t\t// 21st pointermove will cancel a drag\n\t\tfor (let i = 0; i < 21; i++) {\n\t\t\tfireEvent.pointerMove(document.body);\n\t\t}\n\t},\n};\n\n/** Cleanup function to unbind all event listeners */\nexport async function reset(): Promise<void> {\n\t// cleanup any pending drags\n\tfireEvent.dragEnd(window);\n\n\t// cleanup honey pot fix\n\tfireEvent.pointerMove(window);\n}\n\nexport function getBubbleOrderedPath(path: Element[]): Element[] {\n\tconst last = path[path.length - 1];\n\t// will happen if you pass in an empty array\n\tif (!last) {\n\t\treturn path;\n\t}\n\t// exit condition: no more parents\n\tif (!last.parentElement) {\n\t\treturn path;\n\t}\n\t// bubble ordered\n\treturn getBubbleOrderedPath([...path, last.parentElement]);\n}\n\nexport function setElementFromPointWithPath(path: Element[]): CleanupFn {\n\tconst originalElementFromPoint = document.elementFromPoint;\n\tconst originalElementsFromPoint = document.elementsFromPoint;\n\n\tdocument.elementsFromPoint = () => path;\n\tdocument.elementFromPoint = () => path[0] ?? null;\n\n\treturn () => {\n\t\tdocument.elementFromPoint = originalElementFromPoint;\n\t\tdocument.elementsFromPoint = originalElementsFromPoint;\n\t};\n}\n\nexport function setElementFromPoint(element: Element | null): CleanupFn {\n\tconst path = element ? getBubbleOrderedPath([element]) : [];\n\treturn setElementFromPointWithPath(path);\n}\n\n/** Release a pending scrollBy (they are scheduled for the next task) */\nexport function stepScrollBy(): void {\n\tjest.advanceTimersByTime(1);\n}\n\nlet startTime: number | null = null;\n\n/** Record the initial (mocked) system start time\n *\n * This is no longer needed once `jest.advanceTimersToNextFrame()` is available\n * https://github.com/jestjs/jest/pull/14598\n */\nexport function setStartSystemTime(): void {\n\tstartTime = Date.now();\n}\n\n/** Step forward a single animation frame\n *\n * This is no longer needed once `jest.advanceTimersToNextFrame()` is available\n * https://github.com/jestjs/jest/pull/14598\n */\nexport function advanceTimersToNextFrame(): void {\n\tinvariant(\n\t\tstartTime != null,\n\t\t'Must call `setStartSystemTime` before using `advanceTimersToNextFrame()`',\n\t);\n\n\t// Stealing logic from sinon fake timers\n\t// https://github.com/sinonjs/fake-timers/blob/fc312b9ce96a4ea2c7e60bb0cccd2c604b75cdbd/src/fake-timers-src.js#L1102-L1105\n\tconst timePassedInFrame = (Date.now() - startTime) % 16;\n\tconst timeToNextFrame = 16 - timePassedInFrame;\n\tjest.advanceTimersByTime(timeToNextFrame);\n}\n\ntype BasicElementArgs = {\n\twidth: number;\n\theight: number;\n\tx?: number;\n\ty?: number;\n\tid?: string;\n};\nexport function setupNestedScrollContainers(bubbleOrdered: BasicElementArgs[]): HTMLElement[] {\n\t// argument validation\n\tfor (let i = 0; i < bubbleOrdered.length - 1; i++) {\n\t\tconst current = bubbleOrdered[i];\n\t\tconst parent = bubbleOrdered[i + 1];\n\n\t\tinvariant(\n\t\t\tcurrent.height >= parent.height,\n\t\t\t`validation error: a child's height (${current.height}) was bigger than it's parent (${current.height})`,\n\t\t);\n\n\t\tinvariant(\n\t\t\tcurrent.width >= parent.width,\n\t\t\t`validation error: a child's width (${current.width}) was bigger than it's parent (${current.width})`,\n\t\t);\n\t}\n\n\ttype Item = { args: BasicElementArgs; element: HTMLElement };\n\n\t// Making all elements first so we can link everything correctly.\n\tconst items: Item[] = bubbleOrdered.map(\n\t\t(args): Item => ({\n\t\t\targs,\n\t\t\telement: document.createElement('div'),\n\t\t}),\n\t);\n\n\tfor (let i = 0; i < items.length; i++) {\n\t\tconst item = items[i];\n\t\tconst parent: Item | undefined = items[i + 1];\n\t\tconst isInnerMost = i === 0;\n\n\t\t// Establish parent relationship\n\t\tif (parent) {\n\t\t\tparent.element.appendChild(item.element);\n\t\t}\n\n\t\t// helpful for logging\n\t\titem.element.id = item.args.id ?? `element-index-${i}-in-${items.length - 1}`;\n\n\t\tObject.assign(item.element.style, {\n\t\t\t// enabling scrolling in both directions if not the inner most\n\t\t\toverflowX: isInnerMost ? undefined : 'auto',\n\t\t\toverflowY: isInnerMost ? undefined : 'auto',\n\t\t\theight: `${item.args.height}px`,\n\t\t\twidth: `${item.args.width}px`,\n\t\t});\n\n\t\titem.element.getBoundingClientRect = () => {\n\t\t\t// for simplicity, all elements are currently drawn from 0,0\n\t\t\tconst start: Position = {\n\t\t\t\tx: item.args.x ?? 0,\n\t\t\t\ty: item.args.y ?? 0,\n\t\t\t};\n\t\t\tconst box = DOMRect.fromRect({\n\t\t\t\tx: start.x,\n\t\t\t\ty: start.y,\n\t\t\t\twidth: item.args.width,\n\t\t\t\theight: item.args.height,\n\t\t\t});\n\n\t\t\tif (!parent) {\n\t\t\t\treturn box;\n\t\t\t}\n\n\t\t\t// The border box of an element will be shifted by:\n\t\t\t// 1. the scroll of a parent\n\t\t\t// 2. changes in the x/y of the parent\n\n\t\t\tconst parentRect = parent.element.getBoundingClientRect();\n\n\t\t\t// What is the difference between the original parent.getBoundingClientRect() and where it is now?\n\t\t\t// Given that we know an element is always starting at `x: 0, y: 0`, the value of `x` and `y` can\n\t\t\t// only have changed if a parent was scrolled\n\t\t\tconst parentChange: Position = {\n\t\t\t\tx: parentRect.x,\n\t\t\t\ty: parentRect.y,\n\t\t\t};\n\n\t\t\tconst shiftedByParents = DOMRect.fromRect({\n\t\t\t\tx: box.x - parent.element.scrollLeft + parentChange.x,\n\t\t\t\ty: box.y - parent.element.scrollTop + parentChange.y,\n\t\t\t\twidth: box.width,\n\t\t\t\theight: box.height,\n\t\t\t});\n\n\t\t\treturn shiftedByParents;\n\t\t};\n\n\t\t// scroll properties will be based on children\n\t\t// TODO: could find the maximum height of any child\n\t\tconst child: Item | undefined = items[i - 1];\n\n\t\tObject.defineProperties(item.element, {\n\t\t\tscrollHeight: {\n\t\t\t\tvalue: child ? child.args.height : item.args.height,\n\t\t\t\twritable: false,\n\t\t\t},\n\t\t\tscrollWidth: {\n\t\t\t\tvalue: child ? child.args.width : item.args.width,\n\t\t\t\twritable: false,\n\t\t\t},\n\t\t});\n\n\t\t// Note: these only measure paddingBox, but we are\n\t\t// not currently using borders so we are all good\n\t\tObject.defineProperties(item.element, {\n\t\t\tclientHeight: {\n\t\t\t\tvalue: item.args.height,\n\t\t\t\twritable: false,\n\t\t\t},\n\t\t\tclientWidth: {\n\t\t\t\tvalue: item.args.width,\n\t\t\t\twritable: false,\n\t\t\t},\n\t\t});\n\t}\n\n\treturn items.map((item) => item.element);\n}\n\nexport function setupBasicScrollContainer({\n\tscrollContainer = { width: 1000, height: 1000 },\n\tchild = { width: 10000, height: 10000 },\n}: {\n\tscrollContainer?: { width: number; height: number };\n\tchild?: { width: number; height: number };\n} = {}): { parentScrollContainer: HTMLElement; child: HTMLElement } {\n\tconst elements = setupNestedScrollContainers([child, scrollContainer]);\n\treturn {\n\t\tchild: elements[0],\n\t\tparentScrollContainer: elements[1],\n\t};\n}\n\nexport type Point = Position & { label: string };\nexport function getInsidePoints(rect: DOMRect): Point[] {\n\treturn [\n\t\t{ label: 'top left', x: rect.left, y: rect.top },\n\t\t{ label: 'top right', x: rect.right, y: rect.top },\n\t\t{ label: 'bottom right', x: rect.right, y: rect.bottom },\n\t\t{ label: 'bottom left', x: rect.left, y: rect.bottom },\n\t\t{\n\t\t\tlabel: 'center',\n\t\t\tx: rect.left + rect.width / 2,\n\t\t\ty: rect.top + rect.height / 2,\n\t\t},\n\t];\n}\n\nexport function getOutsidePoints(rect: DOMRect): Point[] {\n\treturn [\n\t\t{ label: 'left of top left', x: rect.left - 1, y: rect.top },\n\t\t{ label: 'top of top left', x: rect.left, y: rect.top - 1 },\n\t\t{ label: 'right of top right', x: rect.right + 1, y: rect.top },\n\t\t{ label: 'top of top right', x: rect.right, y: rect.top - 1 },\n\t\t{ label: 'right of bottom right', x: rect.right + 1, y: rect.bottom },\n\t\t{ label: 'bottom of bottom right', x: rect.right, y: rect.bottom + 1 },\n\t\t{ label: 'left of bottom left', x: rect.left - 1, y: rect.bottom },\n\t\t{ label: 'bottom of bottom left', x: rect.left, y: rect.bottom + 1 },\n\t];\n}\n\nexport const mainAxisForSide: { [T in Edge]: Axis } = {\n\tbottom: 'vertical',\n\ttop: 'vertical',\n\tleft: 'horizontal',\n\tright: 'horizontal',\n};\n\nexport type AxisScroll = Record<Axis, number>;\nexport type AxisMovement = Record<Axis, boolean>;\nexport type Event = { type: string } & Partial<AxisMovement>;\nexport type Scenario = {\n\tlabel: string;\n\tstartPosition: Position;\n\tendPosition: Position;\n\texpectedMovement: AxisMovement;\n};\n\nexport function getScenarios(rect: DOMRect, offset: number = 0): Scenario[] {\n\treturn [\n\t\t{\n\t\t\tlabel: 'top left',\n\t\t\tstartPosition: {\n\t\t\t\tx: rect.left,\n\t\t\t\ty: rect.top,\n\t\t\t},\n\t\t\tendPosition: {\n\t\t\t\tx: rect.left - offset,\n\t\t\t\ty: rect.top - offset,\n\t\t\t},\n\t\t\texpectedMovement: { horizontal: true, vertical: true },\n\t\t},\n\t\t{\n\t\t\tlabel: 'top',\n\t\t\tstartPosition: {\n\t\t\t\tx: rect.left + rect.width / 2,\n\t\t\t\ty: rect.top,\n\t\t\t},\n\t\t\tendPosition: {\n\t\t\t\tx: rect.left + rect.width / 2,\n\t\t\t\ty: rect.top - offset,\n\t\t\t},\n\t\t\texpectedMovement: { horizontal: false, vertical: true },\n\t\t},\n\t\t{\n\t\t\tlabel: 'top right',\n\t\t\tstartPosition: {\n\t\t\t\tx: rect.right,\n\t\t\t\ty: rect.top,\n\t\t\t},\n\t\t\tendPosition: {\n\t\t\t\tx: rect.right + offset,\n\t\t\t\ty: rect.top - offset,\n\t\t\t},\n\t\t\texpectedMovement: { horizontal: true, vertical: true },\n\t\t},\n\t\t{\n\t\t\tlabel: 'right',\n\t\t\tstartPosition: {\n\t\t\t\tx: rect.right,\n\t\t\t\ty: rect.top + rect.height / 2,\n\t\t\t},\n\t\t\tendPosition: {\n\t\t\t\tx: rect.right + offset,\n\t\t\t\ty: rect.top + rect.height / 2,\n\t\t\t},\n\t\t\texpectedMovement: { horizontal: true, vertical: false },\n\t\t},\n\t\t{\n\t\t\tlabel: 'bottom right',\n\t\t\tstartPosition: {\n\t\t\t\tx: rect.right,\n\t\t\t\ty: rect.bottom,\n\t\t\t},\n\t\t\tendPosition: {\n\t\t\t\tx: rect.right + offset,\n\t\t\t\ty: rect.bottom + offset,\n\t\t\t},\n\t\t\texpectedMovement: { horizontal: true, vertical: true },\n\t\t},\n\t\t{\n\t\t\tlabel: 'bottom',\n\t\t\tstartPosition: {\n\t\t\t\tx: rect.left + rect.width / 2,\n\t\t\t\ty: rect.bottom,\n\t\t\t},\n\t\t\tendPosition: {\n\t\t\t\tx: rect.left + rect.width / 2,\n\t\t\t\ty: rect.bottom + offset,\n\t\t\t},\n\t\t\texpectedMovement: { horizontal: false, vertical: true },\n\t\t},\n\t\t{\n\t\t\tlabel: 'bottom left',\n\t\t\tstartPosition: {\n\t\t\t\tx: rect.left,\n\t\t\t\ty: rect.bottom,\n\t\t\t},\n\t\t\tendPosition: {\n\t\t\t\tx: rect.left - offset,\n\t\t\t\ty: rect.bottom + offset,\n\t\t\t},\n\t\t\texpectedMovement: { horizontal: true, vertical: true },\n\t\t},\n\t\t{\n\t\t\tlabel: 'left',\n\t\t\tstartPosition: {\n\t\t\t\tx: rect.left,\n\t\t\t\ty: rect.top + rect.height / 2,\n\t\t\t},\n\t\t\tendPosition: {\n\t\t\t\tx: rect.left - offset,\n\t\t\t\ty: rect.top + rect.height / 2,\n\t\t\t},\n\t\t\texpectedMovement: { horizontal: true, vertical: false },\n\t\t},\n\t];\n}\n\nexport function getAxisScroll(container: HTMLElement): AxisScroll {\n\treturn {\n\t\thorizontal: container.scrollLeft,\n\t\tvertical: container.scrollTop,\n\t};\n}\n\nexport function hasAxisScrolled(container: HTMLElement, previousScroll: AxisScroll): AxisMovement {\n\treturn {\n\t\thorizontal: container.scrollLeft !== previousScroll.horizontal,\n\t\tvertical: container.scrollTop !== previousScroll.vertical,\n\t};\n}\n\nexport function isExpectingScrollEvent(movement: AxisMovement): boolean {\n\treturn Object.values(movement).some(Boolean);\n}\n\nexport function getExpectedEvents(movement: AxisMovement): Event[] {\n\treturn isExpectingScrollEvent(movement)\n\t\t? [\n\t\t\t\t{\n\t\t\t\t\ttype: 'scroll event',\n\t\t\t\t\t...movement,\n\t\t\t\t},\n\t\t\t]\n\t\t: [];\n}\n\nexport const firePointer = (() => {\n\ttype TTarget = Element | Window | Document;\n\tfunction makeDispatch(eventName: string) {\n\t\treturn function dispatch(target: TTarget, input: Partial<Input> = {}): void {\n\t\t\tconst inputWithDefaults = {\n\t\t\t\t...getDefaultInput(),\n\t\t\t\t...input,\n\t\t\t};\n\t\t\ttarget.dispatchEvent(\n\t\t\t\tnew MouseEvent(eventName, {\n\t\t\t\t\tbubbles: true,\n\t\t\t\t\tcancelable: true,\n\t\t\t\t\t...inputWithDefaults,\n\t\t\t\t}),\n\t\t\t);\n\t\t};\n\t}\n\n\treturn {\n\t\tdown: makeDispatch('pointerdown'),\n\t\tup: makeDispatch('pointerup'),\n\t\tmove: makeDispatch('pointermove'),\n\t\tcancel: makeDispatch('pointercancel'),\n\t};\n})();\n"
  },
  {
    "path": "packages/auto-scroll/__tests__/unit/over-element/allowed-axis.spec.ts",
    "content": "import { bind } from 'bind-event-listener';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { autoScrollForElements } from '../../../src/entry-point/element';\nimport { type AllowedAxis } from '../../../src/internal-types';\nimport {\n\tadvanceTimersToNextFrame,\n\tappendToBody,\n\ttype AxisScroll,\n\ttype Event,\n\tgetAxisScroll,\n\tgetExpectedEvents,\n\tgetScenarios,\n\thasAxisScrolled,\n\treset,\n\tsetElementFromPoint,\n\tsetStartSystemTime,\n\tsetupBasicScrollContainer,\n\tsetupNestedScrollContainers,\n\tstepScrollBy,\n\tuserEvent,\n} from '../_util';\n\njest.useFakeTimers();\nsetStartSystemTime();\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nbeforeEach(reset);\n\ndescribe('allowed axis', () => {\n\tconst { child, parentScrollContainer: parent } = setupBasicScrollContainer();\n\n\tconst originalScrollTop = parent.scrollTop;\n\tconst originalScrollLeft = parent.scrollLeft;\n\n\tafterEach(() => {\n\t\tparent.scrollTop = originalScrollTop;\n\t\tparent.scrollLeft = originalScrollLeft;\n\t});\n\n\tgetScenarios(parent.getBoundingClientRect()).forEach(\n\t\t({ label, startPosition, expectedMovement }) => {\n\t\t\tit(`should only scroll on axis that are allowed - ${label}`, () => {\n\t\t\t\tconst events: Event[] = [];\n\n\t\t\t\tlet allowedAxis: AllowedAxis = 'all';\n\t\t\t\tlet axisScroll: AxisScroll;\n\n\t\t\t\tconst cleanup = combine(\n\t\t\t\t\tappendToBody(parent),\n\t\t\t\t\tdraggable({\n\t\t\t\t\t\telement: child,\n\t\t\t\t\t\tonDragStart: () => events.push({ type: 'draggable:start' }),\n\t\t\t\t\t}),\n\t\t\t\t\tdropTargetForElements({\n\t\t\t\t\t\telement: child,\n\t\t\t\t\t\tonDragStart: () => events.push({ type: 'dropTarget:start' }),\n\t\t\t\t\t}),\n\t\t\t\t\tautoScrollForElements({\n\t\t\t\t\t\telement: parent,\n\t\t\t\t\t\tgetAllowedAxis: () => allowedAxis,\n\t\t\t\t\t}),\n\t\t\t\t\tsetElementFromPoint(child),\n\t\t\t\t\tbind(parent, {\n\t\t\t\t\t\ttype: 'scroll',\n\t\t\t\t\t\tlistener: (event) => {\n\t\t\t\t\t\t\tevents.push({\n\t\t\t\t\t\t\t\ttype: 'scroll event',\n\t\t\t\t\t\t\t\t...hasAxisScrolled(parent, axisScroll),\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\taxisScroll = getAxisScroll(parent);\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t);\n\n\t\t\t\t// Scroll container is now looking over the center of the element\n\t\t\t\tparent.scrollTop = 500;\n\t\t\t\tparent.scrollLeft = 500;\n\t\t\t\taxisScroll = getAxisScroll(parent);\n\n\t\t\t\tuserEvent.lift(child, {\n\t\t\t\t\tclientX: startPosition.x,\n\t\t\t\t\tclientY: startPosition.y,\n\t\t\t\t});\n\n\t\t\t\texpect(events).toEqual([{ type: 'draggable:start' }, { type: 'dropTarget:start' }]);\n\t\t\t\tevents.length = 0;\n\n\t\t\t\t// First frame: allowedAxis is all.\n\t\t\t\t// Expecting no scroll to occur.\n\t\t\t\t// We don't know what the scroll speed should be until a single frame has passed.\n\t\t\t\tadvanceTimersToNextFrame();\n\t\t\t\tstepScrollBy();\n\n\t\t\t\texpect(events).toEqual([]);\n\n\t\t\t\t// Second frame: allowedAxis is all.\n\t\t\t\t// Expecting a scroll to occur on expected axis.\n\t\t\t\tadvanceTimersToNextFrame();\n\t\t\t\tstepScrollBy();\n\n\t\t\t\tconst movement = { ...expectedMovement };\n\t\t\t\tconst expectedEvents = getExpectedEvents(movement);\n\n\t\t\t\texpect(events).toEqual(expectedEvents);\n\t\t\t\tevents.length = 0;\n\n\t\t\t\t// Third frame: allowedAxis is vertical.\n\t\t\t\t// Expecting a scroll to occur on expected axis, except horizontal.\n\t\t\t\t// If neither are expected, expect no scroll.\n\t\t\t\tallowedAxis = 'vertical';\n\n\t\t\t\tadvanceTimersToNextFrame();\n\t\t\t\tstepScrollBy();\n\n\t\t\t\tconst verticalMovement = {\n\t\t\t\t\t...expectedMovement,\n\t\t\t\t\thorizontal: false,\n\t\t\t\t};\n\t\t\t\tconst expectedVerticalEvents = getExpectedEvents(verticalMovement);\n\n\t\t\t\texpect(events).toEqual(expectedVerticalEvents);\n\t\t\t\tevents.length = 0;\n\n\t\t\t\t// Fourth frame: allowedAxis is horizontal.\n\t\t\t\t// Expecting a scroll to occur on expected axis, except vertical.\n\t\t\t\t// If neither are expected, expect no scroll.\n\t\t\t\tallowedAxis = 'horizontal';\n\n\t\t\t\tadvanceTimersToNextFrame();\n\t\t\t\tstepScrollBy();\n\n\t\t\t\tconst horizontalMovement = {\n\t\t\t\t\t...expectedMovement,\n\t\t\t\t\tvertical: false,\n\t\t\t\t};\n\t\t\t\tconst expectedHorizontalEvents = getExpectedEvents(horizontalMovement);\n\n\t\t\t\texpect(events).toEqual(expectedHorizontalEvents);\n\t\t\t\tcleanup();\n\t\t\t});\n\t\t},\n\t);\n});\n\nit('should scroll on available parent axis if child axis are not allowed', () => {\n\tconst [child, parent, grandParent] = setupNestedScrollContainers([\n\t\t{ width: 10000, height: 10000 },\n\t\t{ width: 1000, height: 1000 },\n\t\t{ width: 1000, height: 1000 },\n\t]);\n\n\tconst events: Event[] = [];\n\n\tlet parentAllowedAxis: AllowedAxis = 'all';\n\tlet parentAxisScroll: AxisScroll;\n\n\tlet grandParentAllowedAxis: AllowedAxis = 'all';\n\tlet grandParentAxisScroll: AxisScroll;\n\n\tconst cleanup = combine(\n\t\tappendToBody(grandParent),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => events.push({ type: 'draggable:start' }),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => events.push({ type: 'dropTarget:start' }),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: parent,\n\t\t\tonDragStart: () => events.push({ type: 'parent:start' }),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: grandParent,\n\t\t\tonDragStart: () => events.push({ type: 'grandParent:start' }),\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: parent,\n\t\t\tgetAllowedAxis: () => parentAllowedAxis,\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: grandParent,\n\t\t\tgetAllowedAxis: () => grandParentAllowedAxis,\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(parent, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener: (event) => {\n\t\t\t\tevents.push({\n\t\t\t\t\ttype: 'parent:scroll',\n\t\t\t\t\t...hasAxisScrolled(parent, parentAxisScroll),\n\t\t\t\t});\n\t\t\t\tparentAxisScroll = getAxisScroll(parent);\n\t\t\t},\n\t\t}),\n\t\tbind(grandParent, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener: (event) => {\n\t\t\t\tevents.push({\n\t\t\t\t\ttype: 'grandParent:scroll',\n\t\t\t\t\t...hasAxisScrolled(grandParent, grandParentAxisScroll),\n\t\t\t\t});\n\t\t\t\tgrandParentAxisScroll = getAxisScroll(grandParent);\n\t\t\t},\n\t\t}),\n\t);\n\n\t// Set some initial scroll on the scroll containers\n\tparent.scrollTop = 60;\n\tparent.scrollLeft = 60;\n\tparentAxisScroll = getAxisScroll(parent);\n\n\tgrandParent.scrollTop = 120;\n\tgrandParent.scrollLeft = 120;\n\tgrandParentAxisScroll = getAxisScroll(grandParent);\n\n\t// Lifting the shared top left corner\n\tuserEvent.lift(child, {\n\t\tclientX: grandParent.getBoundingClientRect().left,\n\t\tclientY: grandParent.getBoundingClientRect().top,\n\t});\n\n\texpect(events).toEqual([\n\t\t{ type: 'draggable:start' },\n\t\t{ type: 'dropTarget:start' },\n\t\t{ type: 'parent:start' },\n\t\t{ type: 'grandParent:start' },\n\t]);\n\tevents.length = 0;\n\n\t// First frame: parent allowedAxis is all, grandparent allowedAxis is all.\n\t// Expecting no scroll to occur.\n\t// We don't know what the scroll speed should be until a single frame has passed.\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(events).toEqual([]);\n\n\t// Second frame: parent allowedAxis is all, grandparent allowedAxis is all.\n\t// Expecting a scroll to occur on both parent axis.\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(events).toEqual([{ type: 'parent:scroll', horizontal: true, vertical: true }]);\n\tevents.length = 0;\n\n\t// Third frame: parent allowedAxis is vertical, grandparent allowedAxis is all.\n\t// Expecting a scroll to occur on parent vertical axis, but not horizontal.\n\t// Expecting a scroll to occur on grandparent horizontal axis, but not vertical.\n\tparentAllowedAxis = 'vertical';\n\tgrandParentAllowedAxis = 'all';\n\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(events).toEqual([\n\t\t{ type: 'parent:scroll', horizontal: false, vertical: true },\n\t\t{ type: 'grandParent:scroll', horizontal: true, vertical: false },\n\t]);\n\tevents.length = 0;\n\n\t// Fourth frame: parent allowedAxis is horizontal, grandparent allowedAxis is all.\n\t// Expecting a scroll to occur on parent horizontal axis, but not vertical.\n\t// Expecting a scroll to occur on grandparent vertical axis, but not horizontal.\n\tparentAllowedAxis = 'horizontal';\n\tgrandParentAllowedAxis = 'all';\n\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(events).toEqual([\n\t\t{ type: 'parent:scroll', horizontal: true, vertical: false },\n\t\t{ type: 'grandParent:scroll', horizontal: false, vertical: true },\n\t]);\n\tevents.length = 0;\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/auto-scroll/__tests__/unit/over-element/can-scroll.spec.ts",
    "content": "import { bind } from 'bind-event-listener';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nimport { autoScrollForElements } from '../../../src/entry-point/element';\nimport {\n\tadvanceTimersToNextFrame,\n\tappendToBody,\n\treset,\n\tsetElementFromPoint,\n\tsetStartSystemTime,\n\tsetupBasicScrollContainer,\n\tstepScrollBy,\n\tuserEvent,\n} from '../_util';\n\n// Using modern timers as it is important that the system clock moves in sync with the frames.\n// We need this as we are keeping track of when a drop target is entered into.\njest.useFakeTimers();\nsetStartSystemTime();\n\nbeforeEach(reset);\n\nit('should not scroll scroll containers that have canScroll: () => false', () => {\n\tconst { child, parentScrollContainer } = setupBasicScrollContainer();\n\tconst ordered: string[] = [];\n\tlet isAutoScrollingAllowed: boolean = true;\n\n\tconst cleanup = combine(\n\t\tappendToBody(parentScrollContainer),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: parentScrollContainer,\n\t\t\tcanScroll: () => isAutoScrollingAllowed,\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(parentScrollContainer, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener: () => ordered.push('scroll event'),\n\t\t}),\n\t);\n\n\t// Scroll container is now looking over the center of the element\n\tparentScrollContainer.scrollTop = 500;\n\tparentScrollContainer.scrollLeft = 500;\n\n\tuserEvent.lift(child, { clientX: 1, clientY: 1 });\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\n\t// Second frame: an auto scroll will occur\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual(['scroll event']);\n\tordered.length = 0;\n\n\t// disabling auto scrolling for the third frame\n\t// expecting no scroll will occur\n\tisAutoScrollingAllowed = false;\n\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\n\t// enabling auto scrolling for the third frame\n\t// expecting a scroll to occur\n\tisAutoScrollingAllowed = true;\n\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual(['scroll event']);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/auto-scroll/__tests__/unit/over-element/distance-dampening.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport { bind } from 'bind-event-listener';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { autoScrollForElements } from '../../../src/entry-point/element';\nimport { type Axis, type Side } from '../../../src/internal-types';\nimport { axisLookup } from '../../../src/shared/axis';\nimport { getInternalConfig } from '../../../src/shared/configuration';\nimport {\n\tadvanceTimersToNextFrame,\n\tappendToBody,\n\treset,\n\tsetElementFromPoint,\n\tsetStartSystemTime,\n\tsetupBasicScrollContainer,\n\tstepScrollBy,\n\ttryGetRect,\n\tuserEvent,\n} from '../_util';\n\n// Using modern timers as it is important that the system clock moves in sync with the frames.\n// We need this as we are keeping track of when a drop target is entered into.\njest.useFakeTimers();\nsetStartSystemTime();\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nbeforeEach(reset);\n\nconst defaultConfig = getInternalConfig();\nconst maxScrollPerFrame = defaultConfig.maxPixelScrollPerSecond / 60;\n\ntype Scenario = {\n\tside: Side;\n\taxis: Axis;\n};\n\nconst scenarios: Scenario[] = [\n\t{\n\t\taxis: 'vertical',\n\t\tside: 'start',\n\t},\n\t{\n\t\taxis: 'vertical',\n\t\tside: 'end',\n\t},\n\t{\n\t\taxis: 'horizontal',\n\t\tside: 'start',\n\t},\n\t{\n\t\taxis: 'horizontal',\n\t\tside: 'end',\n\t},\n];\n\nscenarios.forEach(({ axis, side }) => {\n\tconst scrollProperty = axis === 'vertical' ? 'scrollTop' : 'scrollLeft';\n\tconst mainAxisClientPoint = axis === 'vertical' ? 'clientY' : 'clientX';\n\tconst crossAxisClientPoint = mainAxisClientPoint === 'clientY' ? 'clientX' : 'clientY';\n\n\tconst { mainAxis, crossAxis } = axisLookup[axis];\n\n\tit(`should dampen acceleration based on the distance away from an edge [axis: ${axis}, side: ${side}]`, () => {\n\t\tconst { parentScrollContainer, child } = setupBasicScrollContainer({\n\t\t\tscrollContainer: { width: 1000, height: 1000 },\n\t\t\t// giving us enough room to slowly move down through the hitbox\n\t\t\tchild: { width: 20000, height: 20000 },\n\t\t});\n\t\tconst ordered: string[] = [];\n\n\t\tconst cleanup = combine(\n\t\t\tappendToBody(parentScrollContainer),\n\t\t\tsetElementFromPoint(child),\n\t\t\tdraggable({\n\t\t\t\telement: child,\n\t\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement: child,\n\t\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t\t}),\n\t\t\tautoScrollForElements({\n\t\t\t\telement: parentScrollContainer,\n\t\t\t}),\n\t\t\tbind(parentScrollContainer, {\n\t\t\t\ttype: 'scroll',\n\t\t\t\tlistener() {\n\t\t\t\t\tordered.push(`scroll event`);\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\n\t\t// setting initial scroll\n\t\tparentScrollContainer[scrollProperty] = child.getBoundingClientRect()[mainAxis.size] / 2;\n\n\t\tconst parentRect = parentScrollContainer.getBoundingClientRect();\n\n\t\tuserEvent.lift(child, {\n\t\t\t// start or end point on main axis\n\t\t\t[mainAxisClientPoint]: parentRect[mainAxis[side]],\n\t\t\t// half way point\n\t\t\t[crossAxisClientPoint]: parentRect[crossAxis.start] + parentRect[crossAxis.size] / 2,\n\t\t});\n\n\t\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\t\tordered.length = 0;\n\n\t\t// on first frame, there is no auto scroll as\n\t\t// we don't know what the scroll speed should be until\n\t\t// a single frame has passed\n\t\tadvanceTimersToNextFrame();\n\n\t\texpect(ordered).toEqual([]);\n\n\t\t// on second frame we get our first auto scroll\n\t\t{\n\t\t\tconst before = parentScrollContainer[scrollProperty];\n\t\t\tadvanceTimersToNextFrame();\n\t\t\tstepScrollBy();\n\t\t\tconst after = parentScrollContainer[scrollProperty];\n\t\t\t// end side = scroll amount will increase\n\t\t\t// start side = scroll amount will decrease\n\t\t\texpect(after - before).toBe(side === 'end' ? 1 : -1);\n\t\t}\n\n\t\t// fast forward so there is no more time dampening\n\t\tjest.advanceTimersByTime(defaultConfig.timeDampeningDurationMs);\n\t\tordered.length = 0;\n\n\t\t// now expecting to be moving at the maximum speed\n\t\tconst maxScrollInDirection = side === 'end' ? maxScrollPerFrame : -maxScrollPerFrame;\n\t\t{\n\t\t\tconst before = parentScrollContainer[scrollProperty];\n\t\t\tadvanceTimersToNextFrame();\n\t\t\tstepScrollBy();\n\t\t\tconst after = parentScrollContainer[scrollProperty];\n\n\t\t\t// end side = scroll amount will increase\n\t\t\t// start side = scroll amount will decrease\n\t\t\texpect(after - before).toBe(maxScrollInDirection);\n\t\t}\n\n\t\t// Okay, we now know that the time dampening is finished\n\t\t// Let's start our actual test! 😅\n\n\t\tconst autoScrollHitbox = tryGetRect({\n\t\t\t[crossAxis.start]: parentRect[crossAxis.start],\n\t\t\t[crossAxis.end]: parentRect[crossAxis.end],\n\t\t\t[mainAxis.start]:\n\t\t\t\tside === 'start'\n\t\t\t\t\t? parentRect[mainAxis.start]\n\t\t\t\t\t: parentRect[mainAxis.end] - defaultConfig.maxMainAxisHitboxSize,\n\t\t\t[mainAxis.end]:\n\t\t\t\tside === 'start'\n\t\t\t\t\t? parentRect[mainAxis.start] + defaultConfig.maxMainAxisHitboxSize\n\t\t\t\t\t: parentRect[mainAxis.end],\n\t\t});\n\n\t\t// 1. scroll up to the `startHitboxAtPercentageRemainingOfElement`\n\t\t// - expect scroll to get bigger as we get closer to edge\n\n\t\tconst maxSpeedBuffer =\n\t\t\tautoScrollHitbox[mainAxis.size] *\n\t\t\tdefaultConfig.maxScrollAtPercentageRemainingOfHitbox[mainAxis[side]];\n\n\t\t// we are currently at the max scroll speed\n\t\tlet previousChange = maxScrollInDirection;\n\n\t\t// side: 'start' → moving from the end of the hitbox upwards\n\t\t// side: 'end' → moving from the start of the hitbox downwards\n\t\tlet currentMainAxisClientPoint =\n\t\t\tside === 'start' ? autoScrollHitbox[mainAxis.end] : autoScrollHitbox[mainAxis.start];\n\n\t\tconst casesHit = {\n\t\t\tfirst: false,\n\t\t\taccelerating: [] as number[],\n\t\t\tinMaxSpeedBuffer: false,\n\t\t};\n\n\t\t// Move through the hitbox\n\t\t// side: 'start' → moving from the end of the hitbox upwards\n\t\t// side: 'end' → moving from the start of the hitbox downwards\n\t\twhile (\n\t\t\tside === 'start'\n\t\t\t\t? autoScrollHitbox[mainAxis.start] <= currentMainAxisClientPoint\n\t\t\t\t: currentMainAxisClientPoint <= autoScrollHitbox[mainAxis.end]\n\t\t) {\n\t\t\tfireEvent.dragOver(child, {\n\t\t\t\t[mainAxisClientPoint]: currentMainAxisClientPoint,\n\t\t\t\t[crossAxisClientPoint]: parentRect[crossAxis.start] + parentRect[crossAxis.size] / 2,\n\t\t\t});\n\n\t\t\t// the new drag location will not be picked up until the second frame\n\t\t\t// after a user input change.\n\t\t\t// frame 1: dragOver is throttled\n\t\t\t{\n\t\t\t\tconst before = parentScrollContainer[scrollProperty];\n\t\t\t\tadvanceTimersToNextFrame();\n\t\t\t\tstepScrollBy();\n\t\t\t\tconst after = parentScrollContainer[scrollProperty];\n\n\t\t\t\tconst diff = after - before;\n\t\t\t\t// diff has not changed as we are still using the old input for this frame\n\t\t\t\texpect(previousChange).toBe(diff);\n\t\t\t}\n\n\t\t\t// second frame: a scroll should occur based on the updated input\n\t\t\t{\n\t\t\t\tconst before = parentScrollContainer[scrollProperty];\n\t\t\t\tadvanceTimersToNextFrame();\n\t\t\t\tstepScrollBy();\n\t\t\t\tconst after = parentScrollContainer[scrollProperty];\n\n\t\t\t\tconst diff = after - before;\n\n\t\t\t\tconst situation = (() => {\n\t\t\t\t\tif (!casesHit.first) {\n\t\t\t\t\t\treturn 'first';\n\t\t\t\t\t}\n\t\t\t\t\t// accelerating forwards\n\t\t\t\t\tif (\n\t\t\t\t\t\tside === 'end' &&\n\t\t\t\t\t\tcurrentMainAxisClientPoint < autoScrollHitbox[mainAxis.end] - maxSpeedBuffer\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn 'accelerating';\n\t\t\t\t\t}\n\n\t\t\t\t\t// accelerating backwards\n\t\t\t\t\tif (\n\t\t\t\t\t\tside === 'start' &&\n\t\t\t\t\t\tcurrentMainAxisClientPoint > autoScrollHitbox[mainAxis.start] + maxSpeedBuffer\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn 'accelerating';\n\t\t\t\t\t}\n\n\t\t\t\t\treturn 'in-max-speed-buffer';\n\t\t\t\t})();\n\n\t\t\t\t// first hit: starting from the smallest scroll amount\n\t\t\t\tif (situation === 'first') {\n\t\t\t\t\t// side: start → scrolling backwards\n\t\t\t\t\t// side: start → scrolling forwards\n\t\t\t\t\texpect(diff).toBe(side === 'start' ? -1 : 1);\n\t\t\t\t\tcasesHit.first = true;\n\n\t\t\t\t\t// when the acceleration percentage is less than 1,\n\t\t\t\t\t// we will roll up to the minimum scroll change of 1px\n\t\t\t\t} else if (situation === 'accelerating') {\n\t\t\t\t\tcasesHit.accelerating.push(diff);\n\n\t\t\t\t\t// Using 'or equal to' because scrolls under 1% can result in the minimum scroll of 1px\n\t\t\t\t\t// There is an assertion outside of this loop to ensure that an acceleration occurred\n\n\t\t\t\t\t// scrolling forwards: scroll value is growing\n\t\t\t\t\tif (side === 'end') {\n\t\t\t\t\t\texpect(diff).toBeGreaterThanOrEqual(previousChange);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// scrolling forwards: scroll value is shrinking\n\t\t\t\t\t\texpect(diff).toBeLessThanOrEqual(previousChange);\n\t\t\t\t\t}\n\n\t\t\t\t\t// third case: we are in the max speed buffer\n\t\t\t\t} else {\n\t\t\t\t\tcasesHit.inMaxSpeedBuffer = true;\n\t\t\t\t\texpect(diff).toBe(maxScrollInDirection);\n\t\t\t\t}\n\n\t\t\t\tpreviousChange = diff;\n\n\t\t\t\t// side: end → scrolling forwards and moving forwards through hitbox\n\t\t\t\tif (side === 'end') {\n\t\t\t\t\tcurrentMainAxisClientPoint++;\n\t\t\t\t\t// side: start → scrolling backwards and moving forwards through hitbox\n\t\t\t\t} else {\n\t\t\t\t\tcurrentMainAxisClientPoint--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\texpect(casesHit.first).toBe(true);\n\t\texpect(casesHit.accelerating.length).toBeGreaterThan(0);\n\t\texpect(casesHit.inMaxSpeedBuffer).toBe(true);\n\n\t\t// asserting that acceleration occurred, and that we where not just on a single speed\n\t\t{\n\t\t\tconst uniques = Array.from(new Set(casesHit.accelerating.map((value) => Math.round(value))));\n\t\t\tconst expected = Array.from({ length: maxScrollPerFrame }, (_, index) => {\n\t\t\t\tconst value = index + 1;\n\t\t\t\treturn side === 'end' ? value : -value;\n\t\t\t});\n\t\t\texpect(uniques).toEqual(expected);\n\t\t}\n\n\t\tcleanup();\n\t});\n});\n"
  },
  {
    "path": "packages/auto-scroll/__tests__/unit/over-element/hitbox.spec.ts",
    "content": "import { bind } from 'bind-event-listener';\nimport invariant from 'tiny-invariant';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { autoScrollForElements } from '../../../src/entry-point/element';\nimport type { Axis, Side } from '../../../src/internal-types';\nimport { axisLookup } from '../../../src/shared/axis';\nimport { getInternalConfig } from '../../../src/shared/configuration';\nimport {\n\tadvanceTimersToNextFrame,\n\tappendToBody,\n\tgetInsidePoints,\n\tgetOutsidePoints,\n\tgetRect,\n\treset,\n\tsetElementFromPoint,\n\tsetStartSystemTime,\n\tsetupBasicScrollContainer,\n\tstepScrollBy,\n\tuserEvent,\n} from '../_util';\n\ntype Scenario = {\n\tside: Side;\n\thitbox: DOMRect;\n\taxis: Axis;\n};\n\ntype Group = {\n\tlabel: string;\n\tchild: HTMLElement;\n\tparentScrollContainer: HTMLElement;\n\tscenarios: Scenario[];\n};\n\nconst defaultConfig = getInternalConfig();\n\nconst smallGroup: Group = (() => {\n\tconst { child, parentScrollContainer } = setupBasicScrollContainer({\n\t\t// where a hitbox would be less than `defaultConfig.max\n\t\tscrollContainer: { width: 400, height: 400 },\n\t\tchild: { width: 100000, height: 100000 },\n\t});\n\n\tconst rect = parentScrollContainer.getBoundingClientRect();\n\n\tconst scenarios: Scenario[] = [\n\t\t{\n\t\t\tside: 'start',\n\t\t\taxis: 'vertical',\n\t\t\thitbox: getRect({\n\t\t\t\ttop: rect.top,\n\t\t\t\tleft: rect.left,\n\t\t\t\tbottom:\n\t\t\t\t\trect.top + rect.height * defaultConfig.startHitboxAtPercentageRemainingOfElement['top'],\n\t\t\t\tright: rect.right,\n\t\t\t}),\n\t\t},\n\t\t{\n\t\t\tside: 'end',\n\t\t\taxis: 'vertical',\n\t\t\thitbox: getRect({\n\t\t\t\ttop:\n\t\t\t\t\trect.bottom -\n\t\t\t\t\trect.height * defaultConfig.startHitboxAtPercentageRemainingOfElement['bottom'],\n\t\t\t\tleft: rect.left,\n\t\t\t\tbottom: rect.bottom,\n\t\t\t\tright: rect.right,\n\t\t\t}),\n\t\t},\n\t\t{\n\t\t\tside: 'start',\n\t\t\taxis: 'horizontal',\n\t\t\thitbox: getRect({\n\t\t\t\ttop: rect.top,\n\t\t\t\tleft: rect.left,\n\t\t\t\tbottom: rect.bottom,\n\t\t\t\tright:\n\t\t\t\t\trect.left + rect.width * defaultConfig.startHitboxAtPercentageRemainingOfElement['top'],\n\t\t\t}),\n\t\t},\n\t\t{\n\t\t\tside: 'end',\n\t\t\taxis: 'horizontal',\n\t\t\thitbox: getRect({\n\t\t\t\ttop: rect.top,\n\t\t\t\tleft:\n\t\t\t\t\trect.right -\n\t\t\t\t\trect.width * defaultConfig.startHitboxAtPercentageRemainingOfElement['bottom'],\n\t\t\t\tbottom: rect.bottom,\n\t\t\t\tright: rect.right,\n\t\t\t}),\n\t\t},\n\t];\n\n\t// validating all hitboxes are less than 200px in size\n\tscenarios.forEach((scenario) => {\n\t\tconst { mainAxis } = axisLookup[scenario.axis];\n\t\tconst size =\n\t\t\tscenario.hitbox[mainAxis.size] *\n\t\t\tdefaultConfig.startHitboxAtPercentageRemainingOfElement[mainAxis[scenario.side]];\n\t\tinvariant(\n\t\t\tsize < defaultConfig.maxMainAxisHitboxSize,\n\t\t\t'Expected hitbox to be less than the max hitbox size',\n\t\t);\n\t});\n\n\treturn {\n\t\tlabel: 'Small scroll container',\n\t\tscenarios,\n\t\tchild,\n\t\tparentScrollContainer,\n\t};\n})();\n\nconst largeGroup: Group = (() => {\n\tconst { child, parentScrollContainer } = setupBasicScrollContainer({\n\t\tscrollContainer: { width: 10000, height: 10000 },\n\t\tchild: { width: 100000, height: 100000 },\n\t});\n\n\tconst rect = parentScrollContainer.getBoundingClientRect();\n\n\tconst scenarios: Scenario[] = [\n\t\t{\n\t\t\tside: 'start',\n\t\t\taxis: 'vertical',\n\t\t\thitbox: getRect({\n\t\t\t\ttop: rect.top,\n\t\t\t\tleft: rect.left,\n\t\t\t\tbottom: rect.top + defaultConfig.maxMainAxisHitboxSize,\n\t\t\t\tright: rect.right,\n\t\t\t}),\n\t\t},\n\t\t{\n\t\t\tside: 'end',\n\t\t\taxis: 'vertical',\n\t\t\thitbox: getRect({\n\t\t\t\ttop: rect.bottom - defaultConfig.maxMainAxisHitboxSize,\n\t\t\t\tleft: rect.left,\n\t\t\t\tbottom: rect.bottom,\n\t\t\t\tright: rect.right,\n\t\t\t}),\n\t\t},\n\t\t{\n\t\t\tside: 'start',\n\t\t\taxis: 'horizontal',\n\t\t\thitbox: getRect({\n\t\t\t\ttop: rect.top,\n\t\t\t\tleft: rect.left,\n\t\t\t\tbottom: rect.bottom,\n\t\t\t\tright: rect.left + defaultConfig.maxMainAxisHitboxSize,\n\t\t\t}),\n\t\t},\n\t\t{\n\t\t\tside: 'end',\n\t\t\taxis: 'horizontal',\n\t\t\thitbox: getRect({\n\t\t\t\ttop: rect.top,\n\t\t\t\tleft: rect.right - defaultConfig.maxMainAxisHitboxSize,\n\t\t\t\tbottom: rect.bottom,\n\t\t\t\tright: rect.right,\n\t\t\t}),\n\t\t},\n\t];\n\n\t// validating all hitboxes would be greater than `defaultConfig.maxMainAxisHitboxSize`\n\t// (and so will be capped to defaultConfig.maxMainAxisHitboxSize later)\n\tscenarios.forEach((scenario) => {\n\t\tconst { mainAxis } = axisLookup[scenario.axis];\n\t\tconst potentialHitboxSize =\n\t\t\trect[mainAxis.size] *\n\t\t\tdefaultConfig.startHitboxAtPercentageRemainingOfElement[mainAxis[scenario.side]];\n\t\tinvariant(\n\t\t\tpotentialHitboxSize > defaultConfig.maxMainAxisHitboxSize,\n\t\t\t`hitbox size: (${potentialHitboxSize}) is not > (${defaultConfig.maxMainAxisHitboxSize})`,\n\t\t);\n\t});\n\n\treturn {\n\t\tlabel: `Large scroll container (will be capped to ${defaultConfig.maxMainAxisHitboxSize}px hitbox)`,\n\t\tscenarios,\n\t\tchild,\n\t\tparentScrollContainer,\n\t};\n})();\n\n// Using modern timers as it is important that the system clock moves in sync with the frames.\n// We need this as we are keeping track of when a drop target is entered into.\njest.useFakeTimers();\nsetStartSystemTime();\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nbeforeEach(reset);\n\n[smallGroup, largeGroup].forEach(({ label, parentScrollContainer, child, scenarios }) => {\n\tdescribe(`Group: ${label}`, () => {\n\t\tconst originalScrollTop = parentScrollContainer.scrollTop;\n\t\tconst originalScrollLeft = parentScrollContainer.scrollLeft;\n\n\t\tafterEach(() => {\n\t\t\tparentScrollContainer.scrollTop = originalScrollTop;\n\t\t\tparentScrollContainer.scrollLeft = originalScrollLeft;\n\t\t});\n\n\t\tscenarios.forEach((scenario) => {\n\t\t\tconst { mainAxis } = axisLookup[scenario.axis];\n\t\t\tconst scrollProperty = scenario.axis === 'vertical' ? 'scrollTop' : 'scrollLeft';\n\n\t\t\tdescribe(`axis: ${scenario.axis}, side: ${scenario.side} [on boundary]`, () => {\n\t\t\t\tgetInsidePoints(scenario.hitbox).forEach((point) => {\n\t\t\t\t\ttest(`point: [${point.label}] {x: ${point.x}, y: ${point.y}}`, () => {\n\t\t\t\t\t\tconst ordered: string[] = [];\n\n\t\t\t\t\t\tconst cleanup = combine(\n\t\t\t\t\t\t\tappendToBody(parentScrollContainer),\n\t\t\t\t\t\t\tsetElementFromPoint(child),\n\t\t\t\t\t\t\tdraggable({\n\t\t\t\t\t\t\t\telement: child,\n\t\t\t\t\t\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\t\t\t\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tdropTargetForElements({\n\t\t\t\t\t\t\t\telement: child,\n\t\t\t\t\t\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\t\t\t\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\t\t\t\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\t\t\t\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tautoScrollForElements({\n\t\t\t\t\t\t\t\telement: parentScrollContainer,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tbind(parentScrollContainer, {\n\t\t\t\t\t\t\t\ttype: 'scroll',\n\t\t\t\t\t\t\t\tlistener() {\n\t\t\t\t\t\t\t\t\tordered.push(`scroll event`);\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// Scroll container is now looking over the center of the element\n\t\t\t\t\t\tconst initialScrollValue = child.getBoundingClientRect()[mainAxis.size] / 2;\n\t\t\t\t\t\tparentScrollContainer[scrollProperty] = initialScrollValue;\n\n\t\t\t\t\t\t// lifting on the top vertical edge of the container\n\t\t\t\t\t\tuserEvent.lift(child, {\n\t\t\t\t\t\t\tclientX: point.x,\n\t\t\t\t\t\t\tclientY: point.y,\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\t\t\t\t\t\tordered.length = 0;\n\n\t\t\t\t\t\t// on first frame, there is no auto scroll as\n\t\t\t\t\t\t// we don't know what the scroll speed should be until\n\t\t\t\t\t\t// a single frame has passed\n\t\t\t\t\t\tadvanceTimersToNextFrame();\n\n\t\t\t\t\t\texpect(ordered).toEqual([]);\n\n\t\t\t\t\t\t// scroll container has still not scrolled\n\t\t\t\t\t\texpect(parentScrollContainer[scrollProperty]).toBe(initialScrollValue);\n\n\t\t\t\t\t\t// Triggering another auto scroll - should be the minimum scroll\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconst before = parentScrollContainer[scrollProperty];\n\t\t\t\t\t\t\tadvanceTimersToNextFrame();\n\t\t\t\t\t\t\tstepScrollBy();\n\t\t\t\t\t\t\tconst after = parentScrollContainer[scrollProperty];\n\n\t\t\t\t\t\t\t// only a single scroll event\n\t\t\t\t\t\t\texpect(ordered).toEqual(['scroll event']);\n\n\t\t\t\t\t\t\t// Scrolling up → scroll value will get lower\n\t\t\t\t\t\t\t// Scrolling down → scroll value will get higher\n\t\t\t\t\t\t\t// Scrolling on the \"start\" will scroll backwards\n\t\t\t\t\t\t\t// Scrolling on the \"end\" will scroll forwards\n\t\t\t\t\t\t\texpect(after - before).toBe(scenario.side === 'start' ? -1 : 1);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcleanup();\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tdescribe(`axis: ${scenario.axis}, side: ${scenario.side} [outside boundary]`, () => {\n\t\t\t\tgetOutsidePoints(scenario.hitbox).forEach((point) => {\n\t\t\t\t\ttest(`point: [${point.label}] {x: ${point.x}, y: ${point.y}}`, () => {\n\t\t\t\t\t\tconst ordered: string[] = [];\n\n\t\t\t\t\t\tconst cleanup = combine(\n\t\t\t\t\t\t\tappendToBody(parentScrollContainer),\n\t\t\t\t\t\t\tsetElementFromPoint(child),\n\t\t\t\t\t\t\tdraggable({\n\t\t\t\t\t\t\t\telement: child,\n\t\t\t\t\t\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\t\t\t\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tdropTargetForElements({\n\t\t\t\t\t\t\t\telement: child,\n\t\t\t\t\t\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\t\t\t\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\t\t\t\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\t\t\t\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tautoScrollForElements({\n\t\t\t\t\t\t\t\telement: parentScrollContainer,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tbind(parentScrollContainer, {\n\t\t\t\t\t\t\t\ttype: 'scroll',\n\t\t\t\t\t\t\t\tlistener() {\n\t\t\t\t\t\t\t\t\tordered.push(`scroll event`);\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\t// Scroll container is now looking over the center of the element\n\t\t\t\t\t\tconst initialScrollValue = child.getBoundingClientRect()[mainAxis.size] / 2;\n\t\t\t\t\t\tparentScrollContainer[scrollProperty] = initialScrollValue;\n\n\t\t\t\t\t\t// lifting on the top vertical edge of the container\n\t\t\t\t\t\tuserEvent.lift(child, {\n\t\t\t\t\t\t\tclientX: point.x,\n\t\t\t\t\t\t\tclientY: point.y,\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\t\t\t\t\t\tordered.length = 0;\n\n\t\t\t\t\t\t// on first frame, there is no auto scroll as\n\t\t\t\t\t\t// we don't know what the scroll speed should be until\n\t\t\t\t\t\t// a single frame has passed\n\t\t\t\t\t\tadvanceTimersToNextFrame();\n\n\t\t\t\t\t\texpect(ordered).toEqual([]);\n\n\t\t\t\t\t\t// scroll container has still not scrolled\n\t\t\t\t\t\texpect(parentScrollContainer[scrollProperty]).toBe(initialScrollValue);\n\n\t\t\t\t\t\t// No auto scroll should be triggered in the next frame\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tconst before = parentScrollContainer[scrollProperty];\n\t\t\t\t\t\t\tadvanceTimersToNextFrame();\n\t\t\t\t\t\t\tstepScrollBy();\n\t\t\t\t\t\t\tconst after = parentScrollContainer[scrollProperty];\n\n\t\t\t\t\t\t\t// only a single scroll event\n\t\t\t\t\t\t\t// expect(ordered).toEqual(['scroll event']);\n\n\t\t\t\t\t\t\t// Scrolling up → scroll value will get lower\n\t\t\t\t\t\t\t// Scrolling down → scroll value will get higher\n\t\t\t\t\t\t\t// Scrolling on the \"start\" will scroll backwards\n\t\t\t\t\t\t\t// Scrolling on the \"end\" will scroll forwards\n\t\t\t\t\t\t\texpect(after - before).toBe(0);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tcleanup();\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t});\n});\n"
  },
  {
    "path": "packages/auto-scroll/__tests__/unit/over-element/max-speed.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport { bind } from 'bind-event-listener';\nimport { replaceRaf } from 'raf-stub';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { autoScrollForElements } from '../../../src/entry-point/element';\nimport { getInternalConfig } from '../../../src/shared/configuration';\nimport { appendToBody, reset, setElementFromPoint, setupBasicScrollContainer } from '../_util';\n\n// need to use \"legacy\" timers so we can control\n// the exact amount of time that passes for a frame.\n// For \"modern\" jest timers, the frame rate is locked at 60fps\njest.useFakeTimers({ legacyFakeTimers: true });\nreplaceRaf();\n\nconst startTime = 0;\nlet currentTime: number = startTime;\njest.spyOn(Date, 'now').mockImplementation(() => currentTime);\n\nbeforeEach(reset);\n\nbeforeEach(() => {\n\t// @ts-expect-error: raf-stub\n\trequestAnimationFrame.reset();\n\tcurrentTime = startTime;\n});\n\nfunction stepFrame({ frameDuration }: { frameDuration: number }) {\n\tcurrentTime += frameDuration;\n\t// @ts-expect-error: raf-stub\n\trequestAnimationFrame.step(1, frameDuration);\n}\n\nfunction stepScrollBy() {\n\t// setTimeout(fn, 0) is released by `jest.advanceTimersByTime(0)` for \"legacy\" timers\n\tjest.advanceTimersByTime(0);\n}\n\nconst defaultConfig = getInternalConfig();\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nit('should not scroll faster than the target 60fps scroll change on higher frame rate devices', () => {\n\tconst frameDuration120fps = 1000 / 120;\n\n\tconst { child, parentScrollContainer } = setupBasicScrollContainer({\n\t\tchild: { height: 10000, width: 10000 },\n\t\tscrollContainer: { height: 500, width: 500 },\n\t});\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(parentScrollContainer),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: parentScrollContainer,\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(parentScrollContainer, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener() {\n\t\t\t\tordered.push('scroll event');\n\t\t\t},\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(child, {\n\t\tclientX:\n\t\t\tparentScrollContainer.getBoundingClientRect().left +\n\t\t\tparentScrollContainer.getBoundingClientRect().width / 2,\n\t\tclientY: parentScrollContainer.getBoundingClientRect().bottom,\n\t});\n\t// @ts-expect-error: raf-stub\n\trequestAnimationFrame.step(1, frameDuration120fps);\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame after starting, the auto scrolling will be collecting how long the frame took\n\t// but there will be no scroll\n\tstepFrame({ frameDuration: frameDuration120fps });\n\tstepScrollBy();\n\texpect(ordered).toEqual([]);\n\n\t// Second frame: an auto scroll will occur\n\tstepFrame({ frameDuration: frameDuration120fps });\n\tstepScrollBy();\n\texpect(ordered).toEqual(['scroll event']);\n\tordered.length = 0;\n\n\t// ensure time dampening is finished\n\t{\n\t\tconst loopStartTime = Date.now();\n\t\tconst hit = jest.fn();\n\t\twhile (Date.now() - loopStartTime <= defaultConfig.timeDampeningDurationMs) {\n\t\t\thit();\n\t\t\tstepFrame({ frameDuration: frameDuration120fps });\n\t\t\tstepScrollBy();\n\t\t\texpect(ordered).toEqual(['scroll event']);\n\t\t\tordered.length = 0;\n\t\t}\n\t\texpect(hit).toHaveBeenCalled();\n\t}\n\tconst before = {\n\t\tscrollTop: parentScrollContainer.scrollTop,\n\t\tnow: Date.now(),\n\t};\n\tstepFrame({ frameDuration: frameDuration120fps });\n\tstepScrollBy();\n\tconst after = {\n\t\tscrollTop: parentScrollContainer.scrollTop,\n\t\tnow: Date.now(),\n\t};\n\t// a scroll occurred\n\texpect(ordered).toEqual(['scroll event']);\n\t// slower than the 60fps speed\n\texpect(after.scrollTop - before.scrollTop).toBeLessThan(\n\t\t(defaultConfig.maxPixelScrollPerSecond / 1000) * 60,\n\t);\n\t// adjusted the speed for 120fps\n\tconst targetScrollPerMs = defaultConfig.maxPixelScrollPerSecond / 1000;\n\texpect(after.scrollTop - before.scrollTop).toBe(\n\t\tMath.ceil(targetScrollPerMs * frameDuration120fps),\n\t);\n\n\tcleanup();\n});\n\nit('should not make a scroll change bigger than the target 60fps scroll change when running at lower than 60fps', () => {\n\tconst frameDuration30fps = 1000 / 30;\n\n\tconst { child, parentScrollContainer } = setupBasicScrollContainer({\n\t\tchild: { height: 10000, width: 10000 },\n\t\tscrollContainer: { height: 500, width: 500 },\n\t});\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(parentScrollContainer),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: parentScrollContainer,\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(parentScrollContainer, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener() {\n\t\t\t\tordered.push('scroll event');\n\t\t\t},\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(child, {\n\t\tclientX:\n\t\t\tparentScrollContainer.getBoundingClientRect().left +\n\t\t\tparentScrollContainer.getBoundingClientRect().width / 2,\n\t\tclientY: parentScrollContainer.getBoundingClientRect().bottom,\n\t});\n\tstepFrame({ frameDuration: frameDuration30fps });\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame after starting, the auto scrolling will be collecting how long the frame took\n\t// but there will be no scroll\n\tstepFrame({ frameDuration: frameDuration30fps });\n\tstepScrollBy();\n\texpect(ordered).toEqual([]);\n\n\t// Second frame: an auto scroll will occur\n\tstepFrame({ frameDuration: frameDuration30fps });\n\tstepScrollBy();\n\texpect(ordered).toEqual(['scroll event']);\n\tordered.length = 0;\n\n\t// ensure time dampening is finished\n\t{\n\t\tconst loopStartTime = Date.now();\n\t\tconst hit = jest.fn();\n\t\twhile (Date.now() - loopStartTime <= defaultConfig.timeDampeningDurationMs) {\n\t\t\thit();\n\t\t\tstepFrame({ frameDuration: frameDuration30fps });\n\t\t\tstepScrollBy();\n\t\t\texpect(ordered).toEqual(['scroll event']);\n\t\t\tordered.length = 0;\n\t\t}\n\t\texpect(hit).toHaveBeenCalled();\n\t}\n\n\tconst before = {\n\t\tscrollTop: parentScrollContainer.scrollTop,\n\t\tnow: Date.now(),\n\t};\n\tstepFrame({ frameDuration: frameDuration30fps });\n\tstepScrollBy();\n\tconst after = {\n\t\tscrollTop: parentScrollContainer.scrollTop,\n\t\tnow: Date.now(),\n\t};\n\t// a scroll occurred\n\texpect(ordered).toEqual(['scroll event']);\n\t// the same scroll change as if scrolling at 60fps\n\n\tconst targetScrollPerMs = defaultConfig.maxPixelScrollPerSecond / 1000;\n\tconst frameDuration60fps = 1000 / 60;\n\t// Accounting for javascript precision inaccuracy caused by `1000 / 60`\n\texpect(after.scrollTop - before.scrollTop).toBeCloseTo(targetScrollPerMs * frameDuration60fps, 1);\n\n\tcleanup();\n});\n\nit('should allow the max speed to be configured', () => {\n\tconst frameDuration60fps = 1000 / 60;\n\tconst config = getInternalConfig({ maxScrollSpeed: 'fast' });\n\tlet maxScrollSpeed: 'fast' | 'standard' = 'fast';\n\n\t// validation that our scroll speed will be faster\n\texpect(config.maxPixelScrollPerSecond).toBeGreaterThan(defaultConfig.maxPixelScrollPerSecond);\n\n\tconst { child, parentScrollContainer } = setupBasicScrollContainer({\n\t\tchild: { height: 10000, width: 10000 },\n\t\tscrollContainer: { height: 500, width: 500 },\n\t});\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(parentScrollContainer),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: parentScrollContainer,\n\t\t\tgetConfiguration: () => ({\n\t\t\t\tmaxScrollSpeed,\n\t\t\t}),\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(parentScrollContainer, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener() {\n\t\t\t\tordered.push('scroll event');\n\t\t\t},\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(child, {\n\t\tclientX:\n\t\t\tparentScrollContainer.getBoundingClientRect().left +\n\t\t\tparentScrollContainer.getBoundingClientRect().width / 2,\n\t\tclientY: parentScrollContainer.getBoundingClientRect().bottom,\n\t});\n\t// @ts-expect-error: raf-stub\n\trequestAnimationFrame.step(1, frameDuration60fps);\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame after starting, the auto scrolling will be collecting how long the frame took\n\t// but there will be no scroll\n\tstepFrame({ frameDuration: frameDuration60fps });\n\tstepScrollBy();\n\texpect(ordered).toEqual([]);\n\n\t// Second frame: an auto scroll will occur\n\tstepFrame({ frameDuration: frameDuration60fps });\n\tstepScrollBy();\n\texpect(ordered).toEqual(['scroll event']);\n\tordered.length = 0;\n\n\t// ensure time dampening is finished\n\t{\n\t\tconst loopStartTime = Date.now();\n\t\tconst hit = jest.fn();\n\t\twhile (Date.now() - loopStartTime <= defaultConfig.timeDampeningDurationMs) {\n\t\t\thit();\n\t\t\tstepFrame({ frameDuration: frameDuration60fps });\n\t\t\tstepScrollBy();\n\t\t\texpect(ordered).toEqual(['scroll event']);\n\t\t\tordered.length = 0;\n\t\t}\n\t\texpect(hit).toHaveBeenCalled();\n\t}\n\n\t{\n\t\tconst before = {\n\t\t\tscrollTop: parentScrollContainer.scrollTop,\n\t\t};\n\t\tstepFrame({ frameDuration: frameDuration60fps });\n\t\tstepScrollBy();\n\t\tconst after = {\n\t\t\tscrollTop: parentScrollContainer.scrollTop,\n\t\t};\n\t\t// a scroll occurred\n\t\texpect(ordered).toEqual(['scroll event']);\n\t\tordered.length = 0;\n\n\t\t// running at maximum \"fast\" speed\n\t\tconst targetScrollPerMs = config.maxPixelScrollPerSecond / 1000;\n\t\texpect(after.scrollTop - before.scrollTop).toBeCloseTo(\n\t\t\t// Accounting for javascript precision inaccuracy caused by:\n\t\t\t// - `1000 / 60`\n\t\t\t// - `after.scrollTop - before.scrollTop`\n\t\t\ttargetScrollPerMs * frameDuration60fps,\n\t\t\t1,\n\t\t);\n\t}\n\t// changing from \"fast\" to \"standard\" scroll speed during a drag\n\t{\n\t\tmaxScrollSpeed = 'standard';\n\t\tconst before = {\n\t\t\tscrollTop: parentScrollContainer.scrollTop,\n\t\t};\n\t\tstepFrame({ frameDuration: frameDuration60fps });\n\t\tstepScrollBy();\n\t\tconst after = {\n\t\t\tscrollTop: parentScrollContainer.scrollTop,\n\t\t};\n\t\t// a scroll occurred\n\t\texpect(ordered).toEqual(['scroll event']);\n\t\tordered.length = 0;\n\n\t\t// running at maximum \"standard\" speed\n\t\tconst targetScrollPerMs = defaultConfig.maxPixelScrollPerSecond / 1000;\n\t\texpect(after.scrollTop - before.scrollTop).toBeCloseTo(\n\t\t\t// Accounting for javascript precision inaccuracy caused by:\n\t\t\t// - `1000 / 60`\n\t\t\t// - `after.scrollTop - before.scrollTop`\n\t\t\ttargetScrollPerMs * frameDuration60fps,\n\t\t\t1,\n\t\t);\n\t}\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/auto-scroll/__tests__/unit/over-element/nested-scroll-containers.spec.ts",
    "content": "import { bind } from 'bind-event-listener';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { type Position } from '@atlaskit/pragmatic-drag-and-drop/types';\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { autoScrollForElements } from '../../../src/entry-point/element';\nimport { isWithin } from '../../../src/shared/is-within'; // this internal util is helpful for what we are trying to do\nimport {\n\tadvanceTimersToNextFrame,\n\tappendToBody,\n\treset,\n\tsetElementFromPoint,\n\tsetStartSystemTime,\n\tsetupNestedScrollContainers,\n\tstepScrollBy,\n\tuserEvent,\n} from '../_util';\n\n// Using modern timers as it is important that the system clock moves in sync with the frames.\n// We need this as we are keeping track of when a drop target is entered into.\njest.useFakeTimers();\nsetStartSystemTime();\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nbeforeEach(reset);\n\nit('should scroll inner elements before outer elements [single axis]', () => {\n\tconst [child, parent, grandParent] = setupNestedScrollContainers([\n\t\t// child\n\t\t{ width: 10000, height: 10000 },\n\t\t// parent\n\t\t{ width: 5000, height: 5000 },\n\t\t// grandparent,\n\t\t{ width: 1000, height: 1000 },\n\t]);\n\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(grandParent),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('child:start'),\n\t\t\tonDrop: () => ordered.push('child:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: parent,\n\t\t\tonDragStart: () => ordered.push('parent:start'),\n\t\t\tonDrop: () => ordered.push('parent:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: grandParent,\n\t\t\tonDragStart: () => ordered.push('grandParent:start'),\n\t\t\tonDrop: () => ordered.push('grandParent:drop'),\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: parent,\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: grandParent,\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(window, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener: (event) => {\n\t\t\t\tif (event.target === grandParent) {\n\t\t\t\t\tordered.push('grandParent:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (event.target === parent) {\n\t\t\t\t\t// console.log('parent', parent.scrollTop, parent.scrollLeft);\n\t\t\t\t\tordered.push('parent:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tordered.push('unknown:scroll');\n\t\t\t},\n\t\t\t// scroll events do not bubble, so leveraging the capture phase\n\t\t\toptions: { capture: true },\n\t\t}),\n\t);\n\n\t// Set some initial scroll on the scroll containers\n\t// These are in the range where auto scrolling will occur on both\n\tparent.scrollTop = 60;\n\tgrandParent.scrollTop = 120;\n\n\t// lifting the mid point of the top edge\n\tuserEvent.lift(child, {\n\t\tclientX:\n\t\t\tgrandParent.getBoundingClientRect().left + grandParent.getBoundingClientRect().width / 2,\n\t\tclientY: grandParent.getBoundingClientRect().top,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'child:start', 'parent:start', 'grandParent:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\n\t{\n\t\tconst hit = jest.fn();\n\t\twhile (parent.scrollTop > 0) {\n\t\t\thit();\n\t\t\tadvanceTimersToNextFrame();\n\t\t\tstepScrollBy();\n\t\t\texpect(ordered).toEqual(['parent:scroll']);\n\t\t\tordered.length = 0;\n\t\t}\n\t\texpect(hit.mock.calls.length).toBeGreaterThan(1);\n\t}\n\n\t// Now it will scroll the grand parent until it's finished\n\t{\n\t\tconst hit = jest.fn();\n\t\twhile (grandParent.scrollTop > 0) {\n\t\t\thit();\n\t\t\tadvanceTimersToNextFrame();\n\t\t\tstepScrollBy();\n\t\t\texpect(ordered).toEqual(['grandParent:scroll']);\n\t\t\tordered.length = 0;\n\t\t}\n\t\texpect(hit.mock.calls.length).toBeGreaterThan(1);\n\t}\n\n\tcleanup();\n});\n\nit('should scroll inner elements before outer elements [both axis at a time]', () => {\n\tconst [child, parent, grandParent] = setupNestedScrollContainers([\n\t\t// child\n\t\t{ width: 10000, height: 10000 },\n\t\t// parent\n\t\t{ width: 5000, height: 5000 },\n\t\t// grandParent,\n\t\t{ width: 1000, height: 1000 },\n\t]);\n\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(grandParent),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('child:start'),\n\t\t\tonDrop: () => ordered.push('child:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: parent,\n\t\t\tonDragStart: () => ordered.push('parent:start'),\n\t\t\tonDrop: () => ordered.push('parent:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: grandParent,\n\t\t\tonDragStart: () => ordered.push('grandParent:start'),\n\t\t\tonDrop: () => ordered.push('grandParent:drop'),\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: parent,\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: grandParent,\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(window, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener: (event) => {\n\t\t\t\tif (event.target === grandParent) {\n\t\t\t\t\tordered.push('grandParent:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (event.target === parent) {\n\t\t\t\t\t// console.log('parent', parent.scrollTop, parent.scrollLeft);\n\t\t\t\t\tordered.push('parent:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tordered.push('unknown:scroll');\n\t\t\t},\n\t\t\t// scroll events do not bubble, so leveraging the capture phase\n\t\t\toptions: { capture: true },\n\t\t}),\n\t);\n\n\t// Set some initial scroll on the scroll containers\n\tparent.scrollTop = 60;\n\tparent.scrollLeft = 60;\n\tgrandParent.scrollTop = 120;\n\tgrandParent.scrollLeft = 120;\n\n\t// lifting the shared top left corner\n\tuserEvent.lift(child, {\n\t\tclientX: grandParent.getBoundingClientRect().left,\n\t\tclientY: grandParent.getBoundingClientRect().top,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'child:start', 'parent:start', 'grandParent:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\n\t{\n\t\tconst hit = jest.fn();\n\t\twhile (parent.scrollTop > 0) {\n\t\t\thit();\n\t\t\tconst before = {\n\t\t\t\tscrollTop: parent.scrollTop,\n\t\t\t\tscrollLeft: parent.scrollLeft,\n\t\t\t};\n\t\t\tadvanceTimersToNextFrame();\n\t\t\tstepScrollBy();\n\t\t\tconst after = {\n\t\t\t\tscrollTop: parent.scrollTop,\n\t\t\t\tscrollLeft: parent.scrollLeft,\n\t\t\t};\n\n\t\t\t// only the parent scrolled\n\t\t\texpect(ordered).toEqual(['parent:scroll']);\n\t\t\tordered.length = 0;\n\n\t\t\t// asserting we scrolled in both directions\n\t\t\texpect(before.scrollTop).toBeGreaterThan(after.scrollTop);\n\t\t\texpect(before.scrollLeft).toBeGreaterThan(after.scrollLeft);\n\t\t}\n\t\texpect(hit.mock.calls.length).toBeGreaterThan(1);\n\t}\n\n\t// Now it will scroll the grand parent until it's finished\n\t{\n\t\tconst hit = jest.fn();\n\t\twhile (grandParent.scrollTop > 0) {\n\t\t\thit();\n\t\t\tconst before = {\n\t\t\t\tscrollTop: grandParent.scrollTop,\n\t\t\t\tscrollLeft: grandParent.scrollLeft,\n\t\t\t};\n\t\t\tadvanceTimersToNextFrame();\n\t\t\tstepScrollBy();\n\t\t\tconst after = {\n\t\t\t\tscrollTop: grandParent.scrollTop,\n\t\t\t\tscrollLeft: grandParent.scrollLeft,\n\t\t\t};\n\n\t\t\t// only the grandParent scrolled\n\t\t\texpect(ordered).toEqual(['grandParent:scroll']);\n\t\t\tordered.length = 0;\n\n\t\t\t// asserting we scrolled in both directions\n\t\t\texpect(before.scrollTop).toBeGreaterThan(after.scrollTop);\n\t\t\texpect(before.scrollLeft).toBeGreaterThan(after.scrollLeft);\n\t\t}\n\t\texpect(hit.mock.calls.length).toBeGreaterThan(1);\n\t}\n\n\tcleanup();\n});\n\nit('should only scroll one scroll container per axis [case: inner is scrolling on vertical, parent on both]', () => {\n\tconst [child, parent, grandParent] = setupNestedScrollContainers([\n\t\t// child\n\t\t{ width: 10000, height: 10000 },\n\t\t// parent\n\t\t{ width: 5000, height: 5000 },\n\t\t// grandparent,\n\t\t{ width: 1000, height: 1000 },\n\t]);\n\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(grandParent),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('child:start'),\n\t\t\tonDrop: () => ordered.push('child:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: parent,\n\t\t\tonDragStart: () => ordered.push('parent:start'),\n\t\t\tonDrop: () => ordered.push('parent:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: grandParent,\n\t\t\tonDragStart: () => ordered.push('grandParent:start'),\n\t\t\tonDrop: () => ordered.push('grandParent:drop'),\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: parent,\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: grandParent,\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(window, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener: (event) => {\n\t\t\t\tif (event.target === grandParent) {\n\t\t\t\t\tordered.push('grandParent:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (event.target === parent) {\n\t\t\t\t\t// console.log('parent', parent.scrollTop, parent.scrollLeft);\n\t\t\t\t\tordered.push('parent:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tordered.push('unknown:scroll');\n\t\t\t},\n\t\t\t// scroll events do not bubble, so leveraging the capture phase\n\t\t\toptions: { capture: true },\n\t\t}),\n\t);\n\n\t// These values are more magic than I originally planned 😅\n\t// Small amount of scroll on the parent (should finish first)\n\tparent.scrollTop = 10;\n\t// → No available scroll on the left\n\t// Larger amount on the grand parent\n\t// (due to lift point this will accelerate faster than parent)\n\tgrandParent.scrollTop = 80;\n\tgrandParent.scrollLeft = 80;\n\n\tconst client: Position = {\n\t\tx: grandParent.getBoundingClientRect().left,\n\t\ty: grandParent.getBoundingClientRect().top,\n\t};\n\n\t// validating setup\n\texpect(isWithin({ client, clientRect: parent.getBoundingClientRect() })).toBe(true);\n\texpect(isWithin({ client, clientRect: grandParent.getBoundingClientRect() })).toBe(true);\n\n\t// lifting the top left corner\n\tuserEvent.lift(child, {\n\t\tclientX: client.x,\n\t\tclientY: client.y,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'child:start', 'parent:start', 'grandParent:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\n\t// scroll the parent until it cannot scroll any more\n\t{\n\t\tconst hit = jest.fn();\n\t\twhile (parent.scrollTop > 0) {\n\t\t\thit();\n\t\t\tconst parentBefore = {\n\t\t\t\tscrollTop: parent.scrollTop,\n\t\t\t\tscrollLeft: parent.scrollLeft,\n\t\t\t};\n\t\t\tconst grandParentBefore = {\n\t\t\t\tscrollTop: grandParent.scrollTop,\n\t\t\t\tscrollLeft: grandParent.scrollLeft,\n\t\t\t};\n\t\t\tadvanceTimersToNextFrame();\n\t\t\tstepScrollBy();\n\t\t\tconst parentAfter = {\n\t\t\t\tscrollTop: parent.scrollTop,\n\t\t\t\tscrollLeft: parent.scrollLeft,\n\t\t\t};\n\t\t\tconst grandParentAfter = {\n\t\t\t\tscrollTop: grandParent.scrollTop,\n\t\t\t\tscrollLeft: grandParent.scrollLeft,\n\t\t\t};\n\n\t\t\t// we scroll inner most elements outwards (bubble ordering)\n\t\t\texpect(ordered).toEqual(['parent:scroll', 'grandParent:scroll']);\n\t\t\tordered.length = 0;\n\n\t\t\t// parent scrolled on the top, but not on the left\n\t\t\texpect(parentBefore.scrollTop).toBeGreaterThan(parentAfter.scrollTop);\n\t\t\texpect(parentBefore.scrollLeft).toBe(parentAfter.scrollLeft);\n\n\t\t\t// grand parent not permitted to scroll on the top, but can scroll on left\n\t\t\texpect(grandParentBefore.scrollTop).toBe(grandParentAfter.scrollTop);\n\t\t\texpect(grandParentBefore.scrollLeft).toBeGreaterThan(grandParentAfter.scrollLeft);\n\t\t}\n\t\texpect(hit.mock.calls.length).toBeGreaterThan(1);\n\t}\n\n\t// finish off scrolling the grand parent\n\t{\n\t\tconst hit = jest.fn();\n\t\twhile (grandParent.scrollTop > 0 || grandParent.scrollLeft > 0) {\n\t\t\thit();\n\t\t\tconst grandParentBefore = {\n\t\t\t\tscrollTop: grandParent.scrollTop,\n\t\t\t\tscrollLeft: grandParent.scrollLeft,\n\t\t\t};\n\t\t\tadvanceTimersToNextFrame();\n\t\t\tstepScrollBy();\n\t\t\tconst grandParentAfter = {\n\t\t\t\tscrollTop: grandParent.scrollTop,\n\t\t\t\tscrollLeft: grandParent.scrollLeft,\n\t\t\t};\n\n\t\t\t// only the grandParent scrolled\n\t\t\texpect(ordered).toEqual(['grandParent:scroll']);\n\t\t\tordered.length = 0;\n\n\t\t\texpect(grandParentBefore.scrollTop).toBeGreaterThan(grandParentAfter.scrollTop);\n\n\t\t\t// There was already some scroll on the left, so expecting left\n\t\t\t// will finish scrolling before the top\n\t\t\texpect(grandParentBefore.scrollLeft).toBeGreaterThanOrEqual(grandParentAfter.scrollLeft);\n\t\t}\n\t\texpect(hit.mock.calls.length).toBeGreaterThan(1);\n\t}\n\n\tcleanup();\n});\n\nit('should only scroll one scroll container per axis [case: inner is scrolling on horizontal, parent on both]', () => {\n\tconst [child, parent, grandParent] = setupNestedScrollContainers([\n\t\t// child\n\t\t{ width: 10000, height: 10000 },\n\t\t// parent\n\t\t{ width: 5000, height: 5000 },\n\t\t// grandparent,\n\t\t{ width: 1000, height: 1000 },\n\t]);\n\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(grandParent),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('child:start'),\n\t\t\tonDrop: () => ordered.push('child:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: parent,\n\t\t\tonDragStart: () => ordered.push('parent:start'),\n\t\t\tonDrop: () => ordered.push('parent:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: grandParent,\n\t\t\tonDragStart: () => ordered.push('grandParent:start'),\n\t\t\tonDrop: () => ordered.push('grandParent:drop'),\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: parent,\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: grandParent,\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(window, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener: (event) => {\n\t\t\t\tif (event.target === grandParent) {\n\t\t\t\t\tordered.push('grandParent:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (event.target === parent) {\n\t\t\t\t\tordered.push('parent:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tordered.push('unknown:scroll');\n\t\t\t},\n\t\t\t// scroll events do not bubble, so leveraging the capture phase\n\t\t\toptions: { capture: true },\n\t\t}),\n\t);\n\n\t// These values are more magic than I originally planned 😅\n\t// Small amount of scroll on the parent (should finish first)\n\tparent.scrollLeft = 10;\n\t// → No available scroll on the top\n\t// Larger amount on the grand parent\n\t// (due to lift point this will accelerate faster than parent)\n\tgrandParent.scrollTop = 80;\n\tgrandParent.scrollLeft = 80;\n\n\tconst client: Position = {\n\t\tx: grandParent.getBoundingClientRect().left,\n\t\ty: grandParent.getBoundingClientRect().top,\n\t};\n\n\t// validating setup\n\texpect(isWithin({ client, clientRect: parent.getBoundingClientRect() })).toBe(true);\n\texpect(isWithin({ client, clientRect: grandParent.getBoundingClientRect() })).toBe(true);\n\n\t// lifting the top left corner\n\tuserEvent.lift(child, {\n\t\tclientX: client.x,\n\t\tclientY: client.y,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'child:start', 'parent:start', 'grandParent:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\n\t// scroll the parent until it cannot scroll any more\n\t{\n\t\tconst hit = jest.fn();\n\t\twhile (parent.scrollLeft > 0) {\n\t\t\thit();\n\t\t\tconst parentBefore = {\n\t\t\t\tscrollTop: parent.scrollTop,\n\t\t\t\tscrollLeft: parent.scrollLeft,\n\t\t\t};\n\t\t\tconst grandParentBefore = {\n\t\t\t\tscrollTop: grandParent.scrollTop,\n\t\t\t\tscrollLeft: grandParent.scrollLeft,\n\t\t\t};\n\t\t\tadvanceTimersToNextFrame();\n\t\t\tstepScrollBy();\n\t\t\tconst parentAfter = {\n\t\t\t\tscrollTop: parent.scrollTop,\n\t\t\t\tscrollLeft: parent.scrollLeft,\n\t\t\t};\n\t\t\tconst grandParentAfter = {\n\t\t\t\tscrollTop: grandParent.scrollTop,\n\t\t\t\tscrollLeft: grandParent.scrollLeft,\n\t\t\t};\n\n\t\t\t// we scroll inner most elements outwards (bubble ordering)\n\t\t\texpect(ordered).toEqual(['parent:scroll', 'grandParent:scroll']);\n\t\t\tordered.length = 0;\n\n\t\t\t// parent scrolled on the left, but not on the top\n\t\t\texpect(parentBefore.scrollLeft).toBeGreaterThan(parentAfter.scrollLeft);\n\t\t\texpect(parentBefore.scrollTop).toBe(parentAfter.scrollTop);\n\n\t\t\t// grand parent not permitted to scroll on the left, but can scroll on top\n\t\t\texpect(grandParentBefore.scrollLeft).toBe(grandParentAfter.scrollLeft);\n\t\t\texpect(grandParentBefore.scrollTop).toBeGreaterThan(grandParentAfter.scrollTop);\n\t\t}\n\t\texpect(hit.mock.calls.length).toBeGreaterThan(1);\n\t}\n\n\t// finish off scrolling the grand parent\n\t{\n\t\tconst hit = jest.fn();\n\t\twhile (grandParent.scrollTop > 0 || grandParent.scrollLeft > 0) {\n\t\t\thit();\n\t\t\tconst grandParentBefore = {\n\t\t\t\tscrollTop: grandParent.scrollTop,\n\t\t\t\tscrollLeft: grandParent.scrollLeft,\n\t\t\t};\n\t\t\tadvanceTimersToNextFrame();\n\t\t\tstepScrollBy();\n\t\t\tconst grandParentAfter = {\n\t\t\t\tscrollTop: grandParent.scrollTop,\n\t\t\t\tscrollLeft: grandParent.scrollLeft,\n\t\t\t};\n\n\t\t\t// only the grandParent scrolled\n\t\t\texpect(ordered).toEqual(['grandParent:scroll']);\n\t\t\tordered.length = 0;\n\n\t\t\texpect(grandParentBefore.scrollLeft).toBeGreaterThan(grandParentAfter.scrollLeft);\n\n\t\t\t// There was already some scroll on the top, so expecting top\n\t\t\t// will finish scrolling before the top\n\t\t\texpect(grandParentBefore.scrollTop).toBeGreaterThanOrEqual(grandParentAfter.scrollTop);\n\t\t}\n\t\texpect(hit.mock.calls.length).toBeGreaterThan(1);\n\t}\n\n\tcleanup();\n});\n\nit('should ignore scroll containers that have `canScroll: () => false` [case: inner is scrolling on horizontal, parent on both]', () => {\n\tconst [child, parent, grandParent, greatGrandParent] = setupNestedScrollContainers([\n\t\t// child\n\t\t{ width: 10000, height: 10000 },\n\t\t// parent\n\t\t{ width: 8000, height: 8000 },\n\t\t// grandparent,\n\t\t{ width: 5000, height: 5000 },\n\t\t// great grandparent,\n\t\t{ width: 2000, height: 2000 },\n\t]);\n\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(greatGrandParent),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('child:start'),\n\t\t\tonDrop: () => ordered.push('child:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: parent,\n\t\t\tonDragStart: () => ordered.push('parent:start'),\n\t\t\tonDrop: () => ordered.push('parent:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: grandParent,\n\t\t\tonDragStart: () => ordered.push('grandParent:start'),\n\t\t\tonDrop: () => ordered.push('grandParent:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: greatGrandParent,\n\t\t\tonDragStart: () => ordered.push('greatGrandParent:start'),\n\t\t\tonDrop: () => ordered.push('greatGrandParent:drop'),\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: parent,\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: grandParent,\n\t\t\tcanScroll: () => false,\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: greatGrandParent,\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(window, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener: (event) => {\n\t\t\t\tif (event.target === greatGrandParent) {\n\t\t\t\t\tordered.push('greatGrandParent:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (event.target === grandParent) {\n\t\t\t\t\tordered.push('grandParent:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (event.target === parent) {\n\t\t\t\t\t// console.log('parent', parent.scrollTop, parent.scrollLeft);\n\t\t\t\t\tordered.push('parent:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tordered.push('unknown:scroll');\n\t\t\t},\n\t\t\t// scroll events do not bubble, so leveraging the capture phase\n\t\t\toptions: { capture: true },\n\t\t}),\n\t);\n\n\tparent.scrollLeft = 20;\n\t// no scroll available on the top side of the parent\n\tgrandParent.scrollTop = 30;\n\tgrandParent.scrollLeft = 30;\n\tgreatGrandParent.scrollTop = 40;\n\tgreatGrandParent.scrollLeft = 40;\n\n\t// lifting the top left corner\n\tuserEvent.lift(child, {\n\t\tclientX: greatGrandParent.getBoundingClientRect().left,\n\t\tclientY: greatGrandParent.getBoundingClientRect().top,\n\t});\n\n\texpect(ordered).toEqual([\n\t\t'draggable:start',\n\t\t'child:start',\n\t\t'parent:start',\n\t\t'grandParent:start',\n\t\t'greatGrandParent:start',\n\t]);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\n\t// scroll the parent until it cannot scroll any more\n\n\tconst parentBefore = {\n\t\tscrollTop: parent.scrollTop,\n\t\tscrollLeft: parent.scrollLeft,\n\t};\n\tconst grandParentBefore = {\n\t\tscrollTop: grandParent.scrollTop,\n\t\tscrollLeft: grandParent.scrollLeft,\n\t};\n\tconst greatGrandParentBefore = {\n\t\tscrollTop: greatGrandParent.scrollTop,\n\t\tscrollLeft: greatGrandParent.scrollLeft,\n\t};\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\tconst parentAfter = {\n\t\tscrollTop: parent.scrollTop,\n\t\tscrollLeft: parent.scrollLeft,\n\t};\n\tconst grandParentAfter = {\n\t\tscrollTop: grandParent.scrollTop,\n\t\tscrollLeft: grandParent.scrollLeft,\n\t};\n\tconst greatGrandParentAfter = {\n\t\tscrollTop: greatGrandParent.scrollTop,\n\t\tscrollLeft: greatGrandParent.scrollLeft,\n\t};\n\n\t// we scroll inner most elements outwards (bubble ordering)\n\t// grandParent is disabled, so it will be skipped\n\texpect(ordered).toEqual(['parent:scroll', 'greatGrandParent:scroll']);\n\tordered.length = 0;\n\n\t// parent scrolled on the left, but not on the top\n\texpect(parentBefore.scrollLeft).toBeGreaterThan(parentAfter.scrollLeft);\n\texpect(parentBefore.scrollTop).toBe(parentAfter.scrollTop);\n\n\t// no changes to grandParent as scrolling is disabled\n\texpect(grandParentBefore.scrollTop).toBe(grandParentAfter.scrollTop);\n\texpect(grandParentBefore.scrollLeft).toBe(grandParentAfter.scrollLeft);\n\n\t// great grand parent not permitted to scroll on the left, but can scroll on top\n\texpect(greatGrandParentBefore.scrollLeft).toBe(greatGrandParentAfter.scrollLeft);\n\texpect(greatGrandParentBefore.scrollTop).toBeGreaterThan(greatGrandParentAfter.scrollTop);\n\n\tcleanup();\n});\n\n// TODO: could also add similar tests for scrolling forward, but they are proving extremely difficult to setup well\n"
  },
  {
    "path": "packages/auto-scroll/__tests__/unit/over-element/registration.spec.ts",
    "content": "import { bind } from 'bind-event-listener';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { autoScrollForElements } from '../../../src/entry-point/element';\nimport {\n\tadvanceTimersToNextFrame,\n\tappendToBody,\n\treset,\n\tsetElementFromPoint,\n\tsetStartSystemTime,\n\tsetupBasicScrollContainer,\n\tstepScrollBy,\n\tuserEvent,\n} from '../_util';\n\n// Using modern timers as it is important that the system clock moves in sync with the frames.\n// We need this as we are keeping track of when a drop target is entered into.\njest.useFakeTimers();\nsetStartSystemTime();\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nbeforeEach(reset);\n\nit('should not scroll scrollable elements that are not registered', () => {\n\tconst { child, parentScrollContainer } = setupBasicScrollContainer();\n\tconst ordered: string[] = [];\n\n\t// not marking outerScrollContainer as a scroll container\n\tconst cleanup = combine(\n\t\tappendToBody(parentScrollContainer),\n\t\tsetElementFromPoint(child),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tbind(parentScrollContainer, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener() {\n\t\t\t\tordered.push(`scroll event`);\n\t\t\t},\n\t\t}),\n\t);\n\n\t// setting an initial scroll\n\tparentScrollContainer.scrollTop = 500;\n\n\tuserEvent.lift(child, {\n\t\tclientX:\n\t\t\tparentScrollContainer.getBoundingClientRect().left +\n\t\t\tparentScrollContainer.getBoundingClientRect().width / 2,\n\t\tclientY: parentScrollContainer.getBoundingClientRect().top,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\n\texpect(ordered).toEqual([]);\n\n\t// on second frame - there would be a scroll is there was a registered scroll container\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\n\tcleanup();\n});\n\nit('should not scroll scrollable elements that are no longer registered', () => {\n\tconst { child, parentScrollContainer } = setupBasicScrollContainer();\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(parentScrollContainer),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(parentScrollContainer, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener() {\n\t\t\t\tordered.push(`scroll event`);\n\t\t\t},\n\t\t}),\n\t);\n\tconst unbindAutoScrolling = autoScrollForElements({\n\t\telement: parentScrollContainer,\n\t});\n\n\t// setting an initial scroll\n\tparentScrollContainer.scrollTop = 500;\n\n\t// top center of scroll container\n\tuserEvent.lift(child, {\n\t\tclientX:\n\t\t\tparentScrollContainer.getBoundingClientRect().left +\n\t\t\tparentScrollContainer.getBoundingClientRect().width / 2,\n\t\tclientY: parentScrollContainer.getBoundingClientRect().top,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\n\texpect(ordered).toEqual([]);\n\n\t// on second frame we will get a scroll\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual(['scroll event']);\n\tordered.length = 0;\n\n\t// we will no longer get scroll updates after unregistered\n\tunbindAutoScrolling();\n\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\n\tcleanup();\n});\n\nit('should scroll scrollable elements are registered mid drag', () => {\n\tconst { child, parentScrollContainer } = setupBasicScrollContainer();\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(parentScrollContainer),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(parentScrollContainer, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener() {\n\t\t\t\tordered.push(`scroll event`);\n\t\t\t},\n\t\t}),\n\t);\n\n\t// setting an initial scroll\n\tparentScrollContainer.scrollTop = 500;\n\n\t// top center of scroll container\n\tuserEvent.lift(child, {\n\t\tclientX:\n\t\t\tparentScrollContainer.getBoundingClientRect().left +\n\t\t\tparentScrollContainer.getBoundingClientRect().width / 2,\n\t\tclientY: parentScrollContainer.getBoundingClientRect().top,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\n\texpect(ordered).toEqual([]);\n\n\t// on second frame there is no scroll\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\tordered.length = 0;\n\n\t// there will be a registration for the third frame, so we will get a scroll\n\tconst unbindAutoScrolling = autoScrollForElements({\n\t\telement: parentScrollContainer,\n\t});\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual(['scroll event']);\n\n\tunbindAutoScrolling();\n\tcleanup();\n});\n\nit('should warn if an elements is registered but are not scrollable', () => {\n\tconst { child } = setupBasicScrollContainer();\n\tconst warn = jest.spyOn(console, 'warn').mockImplementation(() => {});\n\n\tconst cleanup = autoScrollForElements({\n\t\telement: child,\n\t});\n\n\texpect(warn).toHaveBeenCalled();\n\n\tcleanup();\n\twarn.mockRestore();\n});\n\nit('should log a warning if an existing registration exists for an element', () => {\n\tconst { parentScrollContainer } = setupBasicScrollContainer();\n\tconst warn = jest.spyOn(console, 'warn').mockImplementation(() => {});\n\n\tconst cleanup1 = autoScrollForElements({\n\t\telement: parentScrollContainer,\n\t});\n\n\texpect(warn).not.toHaveBeenCalled();\n\n\tconst cleanup2 = autoScrollForElements({\n\t\telement: parentScrollContainer,\n\t});\n\n\texpect(warn).toHaveBeenCalled();\n\n\tcleanup1();\n\tcleanup2();\n\twarn.mockRestore();\n});\n"
  },
  {
    "path": "packages/auto-scroll/__tests__/unit/over-element/start.spec.ts",
    "content": "import { bind } from 'bind-event-listener';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nimport { autoScrollForElements } from '../../../src/entry-point/element';\nimport {\n\tadvanceTimersToNextFrame,\n\tappendToBody,\n\treset,\n\tsetElementFromPoint,\n\tsetStartSystemTime,\n\tsetupBasicScrollContainer,\n\tstepScrollBy,\n\tuserEvent,\n} from '../_util';\n\njest.useFakeTimers();\nsetStartSystemTime();\n\nbeforeEach(reset);\n\nit('should start automatically scrolling when a drag starts', () => {\n\tconst { child, parentScrollContainer } = setupBasicScrollContainer();\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(parentScrollContainer),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: parentScrollContainer,\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(parentScrollContainer, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener() {\n\t\t\t\tordered.push(\n\t\t\t\t\t`scroll event {scrollLeft: ${parentScrollContainer.scrollLeft}, scrollTop: ${parentScrollContainer.scrollTop}}`,\n\t\t\t\t);\n\t\t\t},\n\t\t}),\n\t);\n\n\t// Scroll container is now looking over the center of the element\n\tparentScrollContainer.scrollTop = 500;\n\tparentScrollContainer.scrollLeft = 500;\n\n\tuserEvent.lift(child, { clientX: 1, clientY: 1 });\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\n\t// Second frame: an auto scroll will occur\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\t// Scroll backwards on both axis by 1px\n\texpect(ordered).toEqual(['scroll event {scrollLeft: 499, scrollTop: 499}']);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/auto-scroll/__tests__/unit/over-element/stop.spec.ts",
    "content": "import { bind } from 'bind-event-listener';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { autoScrollForElements } from '../../../src/entry-point/element';\nimport {\n\tadvanceTimersToNextFrame,\n\tappendToBody,\n\treset,\n\tsetElementFromPoint,\n\tsetStartSystemTime,\n\tsetupBasicScrollContainer,\n\tstepScrollBy,\n\tuserEvent,\n} from '../_util';\n\njest.useFakeTimers();\nsetStartSystemTime();\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nbeforeEach(reset);\n\nit('should stop scrolling when a drag ends', () => {\n\tconst { child, parentScrollContainer } = setupBasicScrollContainer();\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(parentScrollContainer),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: parentScrollContainer,\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(parentScrollContainer, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener() {\n\t\t\t\tordered.push(\n\t\t\t\t\t`scroll event {scrollLeft: ${parentScrollContainer.scrollLeft}, scrollTop: ${parentScrollContainer.scrollTop}}`,\n\t\t\t\t);\n\t\t\t},\n\t\t}),\n\t);\n\n\t// Scroll container is now looking over the center of the element\n\tparentScrollContainer.scrollTop = 500;\n\tparentScrollContainer.scrollLeft = 500;\n\n\tuserEvent.lift(child, { clientX: 1, clientY: 1 });\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\n\t// Second frame: an auto scroll will occur\n\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\t// Scroll backwards on both axis by 1px\n\texpect(ordered).toEqual(['scroll event {scrollLeft: 499, scrollTop: 499}']);\n\tordered.length = 0;\n\n\t// Third frame: auto scrolling should occur again\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual(['scroll event {scrollLeft: 498, scrollTop: 498}']);\n\tordered.length = 0;\n\n\t// End the drag\n\tuserEvent.drop(child);\n\texpect(ordered).toEqual(['draggable:drop', 'dropTarget:drop']);\n\tordered.length = 0;\n\n\t// Fourth frame: no auto scroll should occur\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\n\tcleanup();\n});\n\nit('should not start scrolling if the drag is cancelled in the first frame', () => {\n\tconst { child, parentScrollContainer } = setupBasicScrollContainer();\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(parentScrollContainer),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: parentScrollContainer,\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(parentScrollContainer, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener() {\n\t\t\t\tordered.push(\n\t\t\t\t\t`scroll event {scrollLeft: ${parentScrollContainer.scrollLeft}, scrollTop: ${parentScrollContainer.scrollTop}}`,\n\t\t\t\t);\n\t\t\t},\n\t\t}),\n\t);\n\n\t// Scroll container is now looking over the center of the element\n\tparentScrollContainer.scrollTop = 500;\n\tparentScrollContainer.scrollLeft = 500;\n\n\tuserEvent.lift(child, { clientX: 1, clientY: 1 });\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\t// End the drag\n\tuserEvent.drop(child);\n\n\texpect(ordered).toEqual(['draggable:drop', 'dropTarget:drop']);\n\tordered.length = 0;\n\n\t// Second frame: an auto scroll will normally have occurred, but the drag was cancelled.\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\t// no scroll events should have occurred\n\texpect(ordered).toEqual([]);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/auto-scroll/__tests__/unit/over-element/time-dampening.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport { bind } from 'bind-event-listener';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport {\n\tautoScrollForElements,\n\tautoScrollWindowForElements,\n} from '../../../src/entry-point/element';\nimport { getInternalConfig } from '../../../src/shared/configuration';\nimport {\n\tadvanceTimersToNextFrame,\n\tappendToBody,\n\tgetBubbleOrderedTree,\n\treset,\n\tsetElementFromPoint,\n\tsetStartSystemTime,\n\tsetupBasicScrollContainer,\n\tstepScrollBy,\n\tuserEvent,\n} from '../_util';\n\n// Using modern timers as it is important that the system clock moves in sync with the frames.\n// We need this as we are keeping track of when a drop target is entered into.\njest.useFakeTimers();\nsetStartSystemTime();\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nbeforeEach(reset);\n\nconst defaultConfig = getInternalConfig();\nconst maxScrollPerFrame = defaultConfig.maxPixelScrollPerSecond / 60;\n\nbeforeEach(() => {\n\t// resetting document scroll\n\tdocument.documentElement.scrollTop = 0;\n\tdocument.documentElement.scrollLeft = 0;\n});\n\n// Splitting up, right, down and left into separate cases rather than a loop, because doing it\n// in one helper loop was super messy and difficult to follow\nit('should dampen the acceleration of auto scrolling [new drag] - up', () => {\n\tconst { parentScrollContainer, child } = setupBasicScrollContainer();\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(parentScrollContainer),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: parentScrollContainer,\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(parentScrollContainer, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener() {\n\t\t\t\tordered.push(`scroll event`);\n\t\t\t},\n\t\t}),\n\t);\n\n\t// Scroll container is now looking over the center of the element\n\tparentScrollContainer.scrollTop = child.getBoundingClientRect().height / 2;\n\tconst initialScrollTop = parentScrollContainer.scrollTop;\n\tconst initialScrollLeft = parentScrollContainer.scrollLeft;\n\n\t// lifting on the top vertical edge of the container\n\tuserEvent.lift(child, {\n\t\tclientX:\n\t\t\tparentScrollContainer.getBoundingClientRect().left +\n\t\t\tparentScrollContainer.getBoundingClientRect().width / 2,\n\t\tclientY:\n\t\t\t// when on the 'top' side we are scrolling up\n\t\t\tparentScrollContainer.getBoundingClientRect().top,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\n\texpect(ordered).toEqual([]);\n\n\t// scroll container has still not scrolled\n\texpect(parentScrollContainer.scrollTop).toBe(initialScrollTop);\n\n\tlet lastScrollTop = parentScrollContainer.scrollTop;\n\tlet lastScrollChangeSize = 0;\n\n\tlet engagementStart: number | null = null;\n\n\t// tracking the various cases to make sure we are actually hitting them\n\tconst casesHit = {\n\t\t// first few scrolls will just be 1px\n\t\t'initial-acceleration': false,\n\t\tacceleration: false,\n\t\t'time-dampening-finished': false,\n\t\t'time-dampening-finished-last-scroll': false,\n\t};\n\n\t// Keep going until we cannot scroll any more\n\twhile (parentScrollContainer.scrollTop > 0) {\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\n\t\t// asserting that one scroll event has occurred\n\t\texpect(ordered).toEqual(['scroll event']);\n\t\tordered.length = 0;\n\n\t\t// Engagement not set until first active scroll\n\t\tif (!engagementStart) {\n\t\t\tengagementStart = Date.now();\n\t\t}\n\n\t\tconst currentScrollTop = parentScrollContainer.scrollTop;\n\t\t/**\n\t\t * Sometimes minus can run into IEEE 754 floating point math issues.\n\t\t * Example: `256.4 - 241.4` is `14.99999999999972` and not `15` 😮‍💨\n\t\t * Never use `.toBe()` with `scrollChange`, only `.toBeCloseTo()`,\n\t\t * or other _not strictly equal_ assertions (eg `toBeGreaterThan()`)\n\t\t **/\n\t\tconst scrollChange = currentScrollTop - lastScrollTop;\n\n\t\t// we are scrolling backwards so our change will be negative\n\t\texpect(scrollChange).toBeLessThan(0);\n\n\t\tconst scrollChangeSize = Math.abs(scrollChange);\n\n\t\tlastScrollTop = currentScrollTop;\n\n\t\tconst now = Date.now();\n\t\tconst duration = now - engagementStart;\n\n\t\t// Case 1: in the time dampening period\n\t\tif (duration < defaultConfig.timeDampeningDurationMs) {\n\t\t\t// We are still not at the max scroll speed\n\t\t\texpect(scrollChangeSize).not.toBeGreaterThan(defaultConfig.maxPixelScrollPerSecond);\n\n\t\t\tif (scrollChangeSize === 1) {\n\t\t\t\texpect(scrollChangeSize).toBe(1);\n\t\t\t\tcasesHit['initial-acceleration'] = true;\n\t\t\t} else {\n\t\t\t\t// Each scroll is bigger than the last\n\t\t\t\texpect(scrollChangeSize).toBeGreaterThan(lastScrollChangeSize);\n\t\t\t\tcasesHit.acceleration = true;\n\t\t\t}\n\n\t\t\tlastScrollChangeSize = scrollChangeSize;\n\t\t\tcontinue;\n\t\t}\n\t\t// Case 2: scrolling at max speed, but not finished scrolling\n\t\t// Expecting max scroll speed\n\t\tif (parentScrollContainer.scrollTop !== 0) {\n\t\t\texpect(scrollChangeSize).toBeCloseTo(defaultConfig.maxPixelScrollPerSecond / 60);\n\t\t\tcasesHit['time-dampening-finished'] = true;\n\t\t\tcontinue;\n\t\t}\n\t\t// Case 3: the last scroll finished the scrolling of the element.\n\t\t// The last scroll could be slightly less than the max scroll amount\n\t\t// as there might not have been the max scroll amount left to scroll\n\t\texpect(scrollChangeSize).toBeLessThanOrEqual(defaultConfig.maxPixelScrollPerSecond / 60);\n\t\tcasesHit['time-dampening-finished-last-scroll'] = true;\n\n\t\t// We can finish here (even though the exit condition would catch us too)\n\t\tbreak;\n\t}\n\n\t// scroll container has been scrolled all the way to the top\n\texpect(parentScrollContainer.scrollTop).toBe(0);\n\t// asserting all our cases where hit\n\texpect(casesHit['initial-acceleration']).toBe(true);\n\texpect(casesHit.acceleration).toBe(true);\n\texpect(casesHit['time-dampening-finished']).toBe(true);\n\texpect(casesHit['time-dampening-finished-last-scroll']).toBe(true);\n\n\t// scrollLeft should not have changed\n\texpect(parentScrollContainer.scrollLeft).toBe(initialScrollLeft);\n\n\tcleanup();\n});\n\nit('should dampen the acceleration of auto scrolling [new drag] - right', () => {\n\tconst { parentScrollContainer, child } = setupBasicScrollContainer();\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(parentScrollContainer),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: parentScrollContainer,\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(parentScrollContainer, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener() {\n\t\t\t\tordered.push(`scroll event`);\n\t\t\t},\n\t\t}),\n\t);\n\n\t// Scroll container is now looking over the center of the element\n\tparentScrollContainer.scrollLeft = child.getBoundingClientRect().width / 2;\n\tconst initialScrollLeft = parentScrollContainer.scrollLeft;\n\tconst initialScrollTop = parentScrollContainer.scrollTop;\n\n\t// lifting the mid point of the right edge\n\tuserEvent.lift(child, {\n\t\tclientX: parentScrollContainer.getBoundingClientRect().right,\n\t\tclientY:\n\t\t\tparentScrollContainer.getBoundingClientRect().top +\n\t\t\tparentScrollContainer.getBoundingClientRect().height / 2,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\n\texpect(ordered).toEqual([]);\n\n\t// scroll container has still not scrolled\n\texpect(parentScrollContainer.scrollLeft).toBe(initialScrollLeft);\n\n\tlet lastScrollLeft = parentScrollContainer.scrollLeft;\n\tlet lastScrollChange = 0;\n\n\tlet engagementStart: number | null = null;\n\n\t// tracking the various cases to make sure we are actually hitting them\n\tconst casesHit = {\n\t\t// first few scrolls will just be 1px\n\t\t'initial-acceleration': false,\n\t\tacceleration: false,\n\t\t'time-dampening-finished': false,\n\t\t'time-dampening-finished-last-scroll': false,\n\t};\n\n\tconst maxScrollLeft = parentScrollContainer.scrollWidth - parentScrollContainer.clientWidth;\n\n\t// Keep going until we cannot scroll any more\n\twhile (parentScrollContainer.scrollLeft <= maxScrollLeft) {\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\n\t\t// asserting that one scroll event has occurred\n\t\texpect(ordered).toEqual(['scroll event']);\n\t\tordered.length = 0;\n\n\t\t// Engagement not set until first active scroll\n\t\tif (!engagementStart) {\n\t\t\tengagementStart = Date.now();\n\t\t}\n\n\t\tconst currentScrollLeft = parentScrollContainer.scrollLeft;\n\t\t/**\n\t\t * Sometimes minus can run into IEEE 754 floating point math issues.\n\t\t * Example: `256.4 - 241.4` is `14.99999999999972` and not `15` 😮‍💨\n\t\t * Never use `.toBe()` with `scrollChange`, only `.toBeCloseTo()`\n\t\t * or other _not strictly equal_ assertions (eg `toBeGreaterThan()`)\n\t\t **/\n\t\tconst scrollChange = currentScrollLeft - lastScrollLeft;\n\n\t\t// we are scrolling forward so our change will be positive\n\t\texpect(scrollChange).toBeGreaterThan(0);\n\n\t\tlastScrollLeft = currentScrollLeft;\n\n\t\tconst now = Date.now();\n\t\tconst duration = now - engagementStart;\n\n\t\t// Case 1: in the time dampening period\n\t\tif (duration < defaultConfig.timeDampeningDurationMs) {\n\t\t\t// We are still not at the max scroll speed\n\t\t\texpect(scrollChange).not.toBeGreaterThan(defaultConfig.maxPixelScrollPerSecond);\n\n\t\t\tif (scrollChange === 1) {\n\t\t\t\tcasesHit['initial-acceleration'] = true;\n\t\t\t\texpect(scrollChange).toBe(1);\n\t\t\t} else {\n\t\t\t\t// Each scroll is bigger than the last\n\t\t\t\tcasesHit.acceleration = true;\n\t\t\t\texpect(scrollChange).toBeGreaterThan(lastScrollChange);\n\t\t\t}\n\n\t\t\tlastScrollChange = scrollChange;\n\t\t\tcontinue;\n\t\t}\n\t\t// Case 2: scrolling at max speed, but not finished scrolling\n\t\t// Expecting max scroll speed\n\t\tif (parentScrollContainer.scrollLeft < maxScrollLeft) {\n\t\t\texpect(scrollChange).toBeCloseTo(defaultConfig.maxPixelScrollPerSecond / 60);\n\t\t\tcasesHit['time-dampening-finished'] = true;\n\t\t\tcontinue;\n\t\t}\n\t\t// Case 3: the last scroll finished the scrolling of the element.\n\t\t// The last scroll could be slightly less than the max scroll amount\n\t\t// as there might not have been the max scroll amount left to scroll\n\t\texpect(scrollChange).toBeLessThanOrEqual(defaultConfig.maxPixelScrollPerSecond / 60);\n\t\tcasesHit['time-dampening-finished-last-scroll'] = true;\n\n\t\t// We can finish here (even though the exit condition would catch us too)\n\t\tbreak;\n\t}\n\n\t// scroll container has been scrolled all the way to the top\n\texpect(parentScrollContainer.scrollLeft).toBe(maxScrollLeft);\n\t// asserting all our cases where hit\n\texpect(casesHit['initial-acceleration']).toBe(true);\n\texpect(casesHit.acceleration).toBe(true);\n\texpect(casesHit['time-dampening-finished']).toBe(true);\n\texpect(casesHit['time-dampening-finished-last-scroll']).toBe(true);\n\n\t// scrollTop should not have changed\n\texpect(parentScrollContainer.scrollTop).toBe(initialScrollTop);\n\n\tcleanup();\n});\n\nit('should dampen the acceleration of auto scrolling [new drag] - down', () => {\n\tconst { parentScrollContainer, child } = setupBasicScrollContainer();\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(parentScrollContainer),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: parentScrollContainer,\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(parentScrollContainer, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener() {\n\t\t\t\tordered.push(`scroll event`);\n\t\t\t},\n\t\t}),\n\t);\n\n\t// Scroll container is now looking over the center of the element\n\tparentScrollContainer.scrollTop = child.getBoundingClientRect().height / 2;\n\tconst initialScrollTop = parentScrollContainer.scrollTop;\n\tconst initialScrollLeft = parentScrollContainer.scrollLeft;\n\n\t// lifting on the mid point of the bottom edge\n\tuserEvent.lift(child, {\n\t\tclientX:\n\t\t\tparentScrollContainer.getBoundingClientRect().left +\n\t\t\tparentScrollContainer.getBoundingClientRect().width / 2,\n\t\tclientY: parentScrollContainer.getBoundingClientRect().bottom,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\n\texpect(ordered).toEqual([]);\n\n\t// scroll container has still not scrolled\n\texpect(parentScrollContainer.scrollTop).toBe(initialScrollTop);\n\n\tlet lastScrollTop = parentScrollContainer.scrollTop;\n\tlet lastScrollChange = 0;\n\n\tlet engagementStart: number | null = null;\n\n\t// tracking the various cases to make sure we are actually hitting them\n\tconst casesHit = {\n\t\t// first few scrolls will just be 1px\n\t\t'initial-acceleration': false,\n\t\tacceleration: false,\n\t\t'time-dampening-finished': false,\n\t\t'time-dampening-finished-last-scroll': false,\n\t};\n\n\tconst maxScrollTop = parentScrollContainer.scrollHeight - parentScrollContainer.clientHeight;\n\n\t// Keep going until we cannot scroll any more\n\twhile (parentScrollContainer.scrollTop <= maxScrollTop) {\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\n\t\t// asserting that one scroll event has occurred\n\t\texpect(ordered).toEqual(['scroll event']);\n\t\tordered.length = 0;\n\n\t\t// Engagement not set until first active scroll\n\t\tif (!engagementStart) {\n\t\t\tengagementStart = Date.now();\n\t\t}\n\n\t\tconst currentScrollTop = parentScrollContainer.scrollTop;\n\t\t/**\n\t\t * Sometimes minus can run into IEEE 754 floating point math issues.\n\t\t * Example: `256.4 - 241.4` is `14.99999999999972` and not `15` 😮‍💨\n\t\t * Never use `.toBe()` with `scrollChange`, only `.toBeCloseTo()`\n\t\t * or other _not strictly equal_ assertions (eg `toBeGreaterThan()`)\n\t\t **/\n\t\tconst scrollChange = currentScrollTop - lastScrollTop;\n\n\t\t// we are scrolling forward so our change will be positive\n\t\texpect(scrollChange).toBeGreaterThan(0);\n\n\t\tlastScrollTop = currentScrollTop;\n\n\t\tconst now = Date.now();\n\t\tconst duration = now - engagementStart;\n\n\t\t// Case 1: in the time dampening period\n\t\tif (duration < defaultConfig.timeDampeningDurationMs) {\n\t\t\t// We are still not at the max scroll speed\n\t\t\texpect(scrollChange).not.toBeGreaterThan(defaultConfig.maxPixelScrollPerSecond);\n\n\t\t\tif (scrollChange === 1) {\n\t\t\t\texpect(scrollChange).toBe(1);\n\t\t\t\tcasesHit['initial-acceleration'] = true;\n\t\t\t} else {\n\t\t\t\t// Each scroll is bigger than the last\n\t\t\t\texpect(scrollChange).toBeGreaterThan(lastScrollChange);\n\t\t\t\tcasesHit.acceleration = true;\n\t\t\t}\n\n\t\t\tlastScrollChange = scrollChange;\n\t\t\tcontinue;\n\t\t}\n\t\t// Case 2: scrolling at max speed, but not finished scrolling\n\t\t// Expecting max scroll speed\n\t\tif (parentScrollContainer.scrollTop < maxScrollTop) {\n\t\t\texpect(scrollChange).toBeCloseTo(defaultConfig.maxPixelScrollPerSecond / 60);\n\t\t\tcasesHit['time-dampening-finished'] = true;\n\t\t\tcontinue;\n\t\t}\n\t\t// Case 3: the last scroll finished the scrolling of the element.\n\t\t// The last scroll could be slightly less than the max scroll amount\n\t\t// as there might not have been the max scroll amount left to scroll\n\t\texpect(scrollChange).toBeLessThanOrEqual(defaultConfig.maxPixelScrollPerSecond / 60);\n\t\tcasesHit['time-dampening-finished-last-scroll'] = true;\n\n\t\t// We can finish here (even though the exit condition would catch us too)\n\t\tbreak;\n\t}\n\n\t// scroll container has been scrolled all the way to the top\n\texpect(parentScrollContainer.scrollTop).toBe(maxScrollTop);\n\t// asserting all our cases where hit\n\texpect(casesHit['initial-acceleration']).toBe(true);\n\texpect(casesHit.acceleration).toBe(true);\n\texpect(casesHit['time-dampening-finished']).toBe(true);\n\texpect(casesHit['time-dampening-finished-last-scroll']).toBe(true);\n\n\t// scrollLeft should not have changed\n\texpect(parentScrollContainer.scrollLeft).toBe(initialScrollLeft);\n\n\tcleanup();\n});\n\nit('should dampen the acceleration of auto scrolling [new drag] - left', () => {\n\tconst { parentScrollContainer, child } = setupBasicScrollContainer();\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(parentScrollContainer),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: parentScrollContainer,\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(parentScrollContainer, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener() {\n\t\t\t\tordered.push(`scroll event`);\n\t\t\t},\n\t\t}),\n\t);\n\n\t// Scroll container is now looking over the center of the element\n\tparentScrollContainer.scrollLeft = child.getBoundingClientRect().width / 2;\n\tconst initialScrollLeft = parentScrollContainer.scrollLeft;\n\tconst initialScrollTop = parentScrollContainer.scrollTop;\n\n\t// lifting on the vertical midpoint of the left edge of the container\n\tuserEvent.lift(child, {\n\t\tclientX: parentScrollContainer.getBoundingClientRect().left,\n\t\tclientY:\n\t\t\tparentScrollContainer.getBoundingClientRect().top +\n\t\t\tparentScrollContainer.getBoundingClientRect().height / 2,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\n\texpect(ordered).toEqual([]);\n\n\t// scroll container has still not scrolled\n\texpect(parentScrollContainer.scrollLeft).toBe(initialScrollLeft);\n\n\tlet lastScrollLeft = parentScrollContainer.scrollLeft;\n\tlet lastScrollChangeSize = 0;\n\n\tlet engagementStart: number | null = null;\n\n\t// tracking the various cases to make sure we are actually hitting them\n\tconst casesHit = {\n\t\t// first few scrolls will just be 1px\n\t\t'initial-acceleration': false,\n\t\tacceleration: false,\n\t\t'time-dampening-finished': false,\n\t\t'time-dampening-finished-last-scroll': false,\n\t};\n\n\t// Keep going until we cannot scroll any more\n\twhile (parentScrollContainer.scrollLeft > 0) {\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\n\t\t// asserting that one scroll event has occurred\n\t\texpect(ordered).toEqual(['scroll event']);\n\t\tordered.length = 0;\n\n\t\t// Engagement not set until first active scroll\n\t\tif (!engagementStart) {\n\t\t\tengagementStart = Date.now();\n\t\t}\n\n\t\tconst currentScrollLeft = parentScrollContainer.scrollLeft;\n\t\t/**\n\t\t * Sometimes minus can run into IEEE 754 floating point math issues.\n\t\t * Example: `256.4 - 241.4` is `14.99999999999972` and not `15` 😮‍💨\n\t\t * Never use `.toBe()` with `scrollChange`, only `.toBeCloseTo()`\n\t\t * or other _not strictly equal_ assertions (eg `toBeGreaterThan()`)\n\t\t **/\n\t\tconst scrollChange = currentScrollLeft - lastScrollLeft;\n\n\t\t// we are scrolling backwards so our change will be negative\n\t\texpect(scrollChange).toBeLessThan(0);\n\n\t\tconst scrollChangeSize = Math.abs(scrollChange);\n\n\t\tlastScrollLeft = currentScrollLeft;\n\n\t\tconst now = Date.now();\n\t\tconst duration = now - engagementStart;\n\n\t\t// Case 1: in the time dampening period\n\t\tif (duration < defaultConfig.timeDampeningDurationMs) {\n\t\t\tif (scrollChangeSize === 1) {\n\t\t\t\texpect(scrollChangeSize).toBe(1);\n\t\t\t\tcasesHit['initial-acceleration'] = true;\n\t\t\t} else {\n\t\t\t\t// Each scroll is bigger than the last\n\t\t\t\texpect(scrollChangeSize).toBeGreaterThan(lastScrollChangeSize);\n\t\t\t\tcasesHit.acceleration = true;\n\t\t\t}\n\n\t\t\tlastScrollChangeSize = scrollChangeSize;\n\t\t\tcontinue;\n\t\t}\n\t\t// Case 2: scrolling at max speed, but not finished scrolling\n\t\t// Expecting max scroll speed\n\t\tif (parentScrollContainer.scrollLeft !== 0) {\n\t\t\texpect(scrollChangeSize).toBeCloseTo(defaultConfig.maxPixelScrollPerSecond / 60);\n\t\t\tcasesHit['time-dampening-finished'] = true;\n\t\t\tcontinue;\n\t\t}\n\t\t// Case 3: the last scroll finished the scrolling of the element.\n\t\t// The last scroll could be slightly less than the max scroll amount\n\t\t// as there might not have been the max scroll amount left to scroll\n\t\texpect(scrollChangeSize).toBeLessThanOrEqual(defaultConfig.maxPixelScrollPerSecond / 60);\n\t\tcasesHit['time-dampening-finished-last-scroll'] = true;\n\n\t\t// We can finish here (even though the exit condition would catch us too)\n\t\tbreak;\n\t}\n\n\t// scroll container has been scrolled all the way to the top\n\texpect(parentScrollContainer.scrollLeft).toBe(0);\n\t// asserting all our cases where hit\n\texpect(casesHit['initial-acceleration']).toBe(true);\n\texpect(casesHit.acceleration).toBe(true);\n\texpect(casesHit['time-dampening-finished']).toBe(true);\n\texpect(casesHit['time-dampening-finished-last-scroll']).toBe(true);\n\n\t// scrollTop should not have changed\n\texpect(parentScrollContainer.scrollTop).toBe(initialScrollTop);\n\n\tcleanup();\n});\n\nit('should dampen the acceleration of auto scrolling [entering into a new drop target]', () => {\n\tconst { parentScrollContainer, child } = setupBasicScrollContainer();\n\tconst [original] = getBubbleOrderedTree();\n\tconst originalRect = DOMRect.fromRect({\n\t\tx: parentScrollContainer.getBoundingClientRect().x + 20,\n\t\ty: parentScrollContainer.getBoundingClientRect().y + 20,\n\t\twidth: 100,\n\t\theight: 100,\n\t});\n\toriginal.getBoundingClientRect = () => originalRect;\n\n\tconst ordered: string[] = [];\n\n\tlet unsetElementFromPoint = setElementFromPoint(original);\n\n\tconst cleanup = combine(\n\t\tappendToBody(original),\n\t\tappendToBody(parentScrollContainer),\n\t\tdraggable({\n\t\t\telement: original,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: parentScrollContainer,\n\t\t}),\n\t\tbind(parentScrollContainer, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener() {\n\t\t\t\tordered.push(\n\t\t\t\t\t`scroll event {scrollLeft: ${parentScrollContainer.scrollLeft}, scrollTop: ${parentScrollContainer.scrollTop}}`,\n\t\t\t\t);\n\t\t\t},\n\t\t}),\n\t);\n\n\t// Scroll container is now looking over the center of the element\n\tconst initialScrollTop = child.getBoundingClientRect().height / 2;\n\tparentScrollContainer.scrollTop = initialScrollTop;\n\n\t// lifting in center of original\n\tuserEvent.lift(original, {\n\t\tclientX: originalRect.left + originalRect.width / 2,\n\t\tclientY: originalRect.top + originalRect.height / 2,\n\t});\n\n\t// not over the inner element\n\texpect(ordered).toEqual(['draggable:start']);\n\tordered.length = 0;\n\n\t// we are expecting no auto scrolling as we are currently not over the drop target\n\tfor (let i = 0; i < 10; i++) {\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\t}\n\t// also just being safe and ensuring we are totally outside any initial time dampening\n\tjest.advanceTimersByTime(defaultConfig.timeDampeningDurationMs);\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\t// scroll container has still not scrolled\n\texpect(parentScrollContainer.scrollTop).toBe(initialScrollTop);\n\n\t// dragging over the top center of our scroll container\n\t// while over the 'inner' element\n\tunsetElementFromPoint();\n\tunsetElementFromPoint = setElementFromPoint(child);\n\n\tfireEvent.dragEnter(child, {\n\t\tclientX:\n\t\t\tparentScrollContainer.getBoundingClientRect().left +\n\t\t\tparentScrollContainer.getBoundingClientRect().width / 2,\n\t\tclientY: parentScrollContainer.getBoundingClientRect().top,\n\t});\n\n\t// we are now over the drop target\n\texpect(ordered).toEqual(['dropTarget:enter']);\n\n\t// no scrolling has occurred yet\n\texpect(parentScrollContainer.scrollTop).toBe(initialScrollTop);\n\n\tlet lastScrollTop = parentScrollContainer.scrollTop;\n\tlet lastScrollChange = 0;\n\tlet engagementStart: number | null = null;\n\n\t// tracking the various cases to make sure we are actually hitting them\n\tconst casesHit = {\n\t\tacceleration: false,\n\t\t'time-dampening-finished': false,\n\t\t'time-dampening-finished-last-scroll': false,\n\t};\n\n\t// Keep going until we cannot scroll any more\n\twhile (parentScrollContainer.scrollTop > 0) {\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\n\t\t// Engagement not set until first active scroll\n\t\tif (!engagementStart) {\n\t\t\tengagementStart = Date.now();\n\t\t}\n\n\t\tconst currentScrollTop = parentScrollContainer.scrollTop;\n\t\t/**\n\t\t * Sometimes minus can run into IEEE 754 floating point math issues.\n\t\t * Example: `256.4 - 241.4` is `14.99999999999972` and not `15` 😮‍💨\n\t\t * Never use `.toBe()` with `scrollChange`, only `.toBeCloseTo()`\n\t\t * or other _not strictly equal_ assertions (eg `toBeGreaterThan()`)\n\t\t **/\n\t\tconst scrollChange = Math.abs(currentScrollTop - lastScrollTop);\n\t\tlastScrollTop = currentScrollTop;\n\n\t\tconst now = Date.now();\n\t\tconst duration = now - engagementStart;\n\n\t\t// Case 1: in the time dampening period\n\t\tif (duration < defaultConfig.timeDampeningDurationMs) {\n\t\t\t// We are still not at the max scroll speed\n\t\t\texpect(scrollChange).not.toBeGreaterThan(defaultConfig.maxPixelScrollPerSecond);\n\t\t\t// Each scroll is bigger than the last\n\t\t\texpect(scrollChange).toBeGreaterThan(lastScrollChange);\n\t\t\tcasesHit.acceleration = true;\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Case 2: scrolling at max speed, but not finished scrolling\n\t\t// Expecting max scroll speed\n\t\tif (parentScrollContainer.scrollTop !== 0) {\n\t\t\texpect(scrollChange).toBeCloseTo(defaultConfig.maxPixelScrollPerSecond / 60);\n\t\t\tcasesHit['time-dampening-finished'] = true;\n\t\t\tcontinue;\n\t\t}\n\t\t// Case 3: the last scroll finished the scrolling of the element.\n\t\t// The last scroll could be slightly less than the max scroll amount\n\t\t// as there might not have been the max scroll amount left to scroll\n\t\texpect(scrollChange).toBeLessThanOrEqual(defaultConfig.maxPixelScrollPerSecond / 60);\n\t\tcasesHit['time-dampening-finished-last-scroll'] = true;\n\t\t// We can finish here\n\t\tbreak;\n\t}\n\n\t// scroll container has been scrolled all the way to the top\n\texpect(parentScrollContainer.scrollTop).toBe(0);\n\t// asserting all our cases where hit\n\texpect(casesHit.acceleration).toBe(true);\n\texpect(casesHit['time-dampening-finished']).toBe(true);\n\texpect(casesHit['time-dampening-finished-last-scroll']).toBe(true);\n\n\t// TODO: pull out into separate test?\n\t// checking that no more scrolls will occur\n\tordered.length = 0;\n\tjest.advanceTimersByTime(defaultConfig.maxPixelScrollPerSecond * 2);\n\texpect(ordered).toEqual([]);\n\n\tcleanup();\n\tunsetElementFromPoint();\n});\n\nit('should start time dampening from when the element is dragged over, even if auto scrolling is not being triggered', () => {\n\tconst { parentScrollContainer, child } = setupBasicScrollContainer();\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(parentScrollContainer),\n\t\tsetElementFromPoint(child),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: parentScrollContainer,\n\t\t}),\n\t\tbind(parentScrollContainer, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener: () => ordered.push('scroll event'),\n\t\t}),\n\t);\n\n\t// Scroll container is now looking over the center of the element\n\tconst initialScrollTop = child.getBoundingClientRect().height / 2;\n\tparentScrollContainer.scrollTop = initialScrollTop;\n\n\t// lifting in center of the the scroll container, this should not trigger any auto scrolling\n\tuserEvent.lift(child, {\n\t\tclientX:\n\t\t\tparentScrollContainer.getBoundingClientRect().left +\n\t\t\tparentScrollContainer.getBoundingClientRect().width / 2,\n\t\tclientY:\n\t\t\tparentScrollContainer.getBoundingClientRect().top +\n\t\t\tparentScrollContainer.getBoundingClientRect().height / 2,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// first frame: no scroll expected even if we were auto scrolling\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\texpect(ordered).toEqual([]);\n\n\t// second frame: if we were in a hitbox for auto scrolling, scroll would occur.\n\t// not expecting any scroll event as we are not in a hitbox for auto scrolling.\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\texpect(ordered).toEqual([]);\n\n\t// ensuring we are out of the time dampening period\n\tjest.advanceTimersByTime(defaultConfig.timeDampeningDurationMs);\n\tstepScrollBy();\n\t// still expecting no scroll events\n\texpect(ordered).toEqual([]);\n\n\t// moving over the bottom center - this should trigger an auto scroll\n\tfireEvent.dragOver(child, {\n\t\tclientX:\n\t\t\tparentScrollContainer.getBoundingClientRect().left +\n\t\t\tparentScrollContainer.getBoundingClientRect().width / 2,\n\t\tclientY: parentScrollContainer.getBoundingClientRect().bottom,\n\t});\n\n\t// not expecting the change to be picked up until the frame after the current frame\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\texpect(ordered).toEqual([]);\n\n\t// now scrolling at max speed as time dampening is finished\n\t{\n\t\tconst before = parentScrollContainer.scrollTop;\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\t\tconst after = parentScrollContainer.scrollTop;\n\t\texpect(after - before).toBe(maxScrollPerFrame);\n\t\texpect(ordered).toEqual(['scroll event']);\n\t}\n\n\tcleanup();\n});\n\nit('should reset time dampening when re-entering a scrollable element', () => {\n\tconst { parentScrollContainer, child } = setupBasicScrollContainer();\n\tconst ordered: string[] = [];\n\n\tlet unsetElementFromPoint = setElementFromPoint(child);\n\n\tconst cleanup = combine(\n\t\tappendToBody(parentScrollContainer),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: parentScrollContainer,\n\t\t}),\n\t\tbind(parentScrollContainer, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener() {\n\t\t\t\tordered.push(\n\t\t\t\t\t`scroll event {scrollLeft: ${parentScrollContainer.scrollLeft}, scrollTop: ${parentScrollContainer.scrollTop}}`,\n\t\t\t\t);\n\t\t\t},\n\t\t}),\n\t);\n\n\t// Scroll container is now looking over the center of the element\n\tconst initialScrollTop = child.getBoundingClientRect().height / 2;\n\tparentScrollContainer.scrollTop = initialScrollTop;\n\n\t// lifting on the top vertical edge of the container\n\tuserEvent.lift(child, {\n\t\tclientX:\n\t\t\tparentScrollContainer.getBoundingClientRect().left +\n\t\t\tparentScrollContainer.getBoundingClientRect().width / 2,\n\t\tclientY: parentScrollContainer.getBoundingClientRect().top,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\n\texpect(ordered).toEqual([]);\n\n\t// scroll container has still not scrolled\n\texpect(parentScrollContainer.scrollTop).toBe(initialScrollTop);\n\n\tfunction execute() {\n\t\tlet lastScrollTop = parentScrollContainer.scrollTop;\n\t\tlet lastScrollChange = 0;\n\n\t\tlet engagementStart: number | null = null;\n\n\t\t// tracking the various cases to make sure we are actually hitting them\n\t\tconst casesHit = {\n\t\t\tacceleration: false,\n\t\t\t'time-dampening-finished': false,\n\t\t\t'time-dampening-finished-last-scroll': false,\n\t\t};\n\n\t\t// Keep going until we cannot scroll any more\n\t\twhile (parentScrollContainer.scrollTop > 0) {\n\t\t\tadvanceTimersToNextFrame();\n\t\t\tstepScrollBy();\n\n\t\t\t// Engagement not set until first active scroll\n\t\t\tif (!engagementStart) {\n\t\t\t\tengagementStart = Date.now();\n\t\t\t}\n\n\t\t\tconst currentScrollTop = parentScrollContainer.scrollTop;\n\t\t\t/**\n\t\t\t * Sometimes minus can run into IEEE 754 floating point math issues.\n\t\t\t * Example: `256.4 - 241.4` is `14.99999999999972` and not `15` 😮‍💨\n\t\t\t * Never use `.toBe()` with `scrollChange`, only `.toBeCloseTo()`\n\t\t\t * or other _not strictly equal_ assertions (eg `toBeGreaterThan()`)\n\t\t\t **/\n\t\t\tconst scrollChange = Math.abs(currentScrollTop - lastScrollTop);\n\t\t\tlastScrollTop = currentScrollTop;\n\n\t\t\tconst now = Date.now();\n\t\t\tconst duration = now - engagementStart;\n\n\t\t\t// Case 1: in the time dampening period\n\t\t\tif (duration < defaultConfig.timeDampeningDurationMs) {\n\t\t\t\t// We are still not at the max scroll speed\n\t\t\t\texpect(scrollChange).not.toBeGreaterThan(defaultConfig.maxPixelScrollPerSecond);\n\t\t\t\t// Each scroll is bigger than the last\n\t\t\t\texpect(scrollChange).toBeGreaterThan(lastScrollChange);\n\t\t\t\tcasesHit.acceleration = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// Case 2: scrolling at max speed, but not finished scrolling\n\t\t\t// Expecting max scroll speed\n\t\t\tif (parentScrollContainer.scrollTop !== 0) {\n\t\t\t\texpect(scrollChange).toBeCloseTo(defaultConfig.maxPixelScrollPerSecond / 60);\n\t\t\t\tcasesHit['time-dampening-finished'] = true;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t// Case 3: the last scroll finished the scrolling of the element.\n\t\t\t// The last scroll could be slightly less than the max scroll amount\n\t\t\t// as there might not have been the max scroll amount left to scroll\n\t\t\texpect(scrollChange).toBeLessThanOrEqual(defaultConfig.maxPixelScrollPerSecond / 60);\n\t\t\tcasesHit['time-dampening-finished-last-scroll'] = true;\n\t\t\t// We can finish here\n\t\t\tbreak;\n\t\t}\n\n\t\t// scroll container has been scrolled all the way to the top\n\t\texpect(parentScrollContainer.scrollTop).toBe(0);\n\t\t// asserting all our cases where hit\n\t\texpect(casesHit.acceleration).toBe(true);\n\t\texpect(casesHit['time-dampening-finished']).toBe(true);\n\t\texpect(casesHit['time-dampening-finished-last-scroll']).toBe(true);\n\t}\n\n\t// first auto scroll\n\texecute();\n\tordered.length = 0;\n\n\t// leaving the drop target\n\tunsetElementFromPoint();\n\tunsetElementFromPoint = setElementFromPoint(document.body);\n\tfireEvent.dragEnter(document.body);\n\n\texpect(ordered).toEqual(['dropTarget:leave']);\n\tordered.length = 0;\n\n\t// let some time pass\n\tjest.advanceTimersByTime(defaultConfig.timeDampeningDurationMs * 2);\n\n\t// no scrolling has occurred in this time\n\texpect(ordered).toEqual([]);\n\n\t// let's drag back over the drop target\n\tunsetElementFromPoint();\n\tunsetElementFromPoint = setElementFromPoint(child);\n\tfireEvent.dragEnter(child, {\n\t\tclientX:\n\t\t\tparentScrollContainer.getBoundingClientRect().left +\n\t\t\tparentScrollContainer.getBoundingClientRect().width / 2,\n\t\tclientY: parentScrollContainer.getBoundingClientRect().top,\n\t});\n\n\t// we are now over the drop target\n\texpect(ordered).toEqual(['dropTarget:enter']);\n\tordered.length = 0;\n\n\t// our auto scroll should be in action\n\t// TODO: be a bit more elegant here?\n\tparentScrollContainer.scrollTop = initialScrollTop;\n\texecute();\n\n\tcleanup();\n\tunsetElementFromPoint();\n});\n\nit('should not reset time dampening if an element is re-registered (in the same frame)', () => {\n\tconst { parentScrollContainer, child } = setupBasicScrollContainer();\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(parentScrollContainer),\n\t\tsetElementFromPoint(child),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t);\n\n\tlet unbindAutoScrolling = autoScrollForElements({\n\t\telement: parentScrollContainer,\n\t});\n\n\t// Scroll container is now looking over the center of the element\n\tconst initialScrollTop = child.getBoundingClientRect().height / 2;\n\tparentScrollContainer.scrollTop = initialScrollTop;\n\n\t// lifting on the top vertical edge of the container\n\tuserEvent.lift(child, {\n\t\tclientX:\n\t\t\tparentScrollContainer.getBoundingClientRect().left +\n\t\t\tparentScrollContainer.getBoundingClientRect().width / 2,\n\t\tclientY: parentScrollContainer.getBoundingClientRect().top,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\n\texpect(ordered).toEqual([]);\n\n\t// scroll container has still not scrolled\n\texpect(parentScrollContainer.scrollTop).toBe(initialScrollTop);\n\n\t// on the second frame we are performing our initial scroll\n\t// which will mark the first engagement\n\t// (and will also perform the first scroll)\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\t// scroll container has now been scrolled\n\texpect(parentScrollContainer.scrollTop).toBeLessThan(initialScrollTop);\n\n\t// Complete the time dampening duration\n\tjest.advanceTimersByTime(defaultConfig.timeDampeningDurationMs);\n\n\t// Triggering another frame\n\t// we are expecting the scroll change to be the maximum allowed\n\t{\n\t\tconst before = parentScrollContainer.scrollTop;\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\t\tconst after = parentScrollContainer.scrollTop;\n\t\texpect(before - after).toBe(maxScrollPerFrame);\n\t}\n\n\t// Rebinding the auto scroll element\n\tunbindAutoScrolling();\n\tunbindAutoScrolling = autoScrollForElements({\n\t\telement: parentScrollContainer,\n\t});\n\n\t// Triggering another auto scroll - should be at the max speed\n\t{\n\t\tconst before = parentScrollContainer.scrollTop;\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\t\tconst after = parentScrollContainer.scrollTop;\n\t\texpect(before - after).toBe(maxScrollPerFrame);\n\t}\n\n\tcleanup();\n});\n\nit('should not reset time dampening if window scrolling is re-registered (in the same frame)', () => {\n\tconst [element] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\n\t// Setting some large scroll height on the window\n\tObject.defineProperties(document.documentElement, {\n\t\tscrollHeight: {\n\t\t\tvalue: document.documentElement.clientHeight * 10,\n\t\t\twritable: false,\n\t\t},\n\t});\n\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tsetElementFromPoint(element),\n\t\tdraggable({\n\t\t\telement: element,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: element,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tbind(window, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener: (event) => {\n\t\t\t\tif (event.target === document.documentElement) {\n\t\t\t\t\tordered.push('window:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tordered.push('unknown:scroll');\n\t\t\t},\n\t\t\t// scroll events do not bubble, so leveraging the capture phase\n\t\t\toptions: { capture: true },\n\t\t}),\n\t);\n\n\tconst initialScrollTop = document.documentElement.scrollTop;\n\tlet unbindAutoScrolling = autoScrollWindowForElements();\n\n\tuserEvent.lift(element, {\n\t\tclientX: document.documentElement.clientLeft + document.documentElement.clientWidth / 2,\n\t\tclientY: document.documentElement.clientLeft + document.documentElement.clientHeight,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\n\texpect(ordered).toEqual([]);\n\n\t// scroll container has still not scrolled\n\texpect(document.documentElement.scrollTop).toBe(initialScrollTop);\n\n\t// on the second frame we are performing our initial scroll\n\t// which will mark the first engagement\n\t// (and will also perform the first scroll)\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\t// scroll container has now been scrolled\n\texpect(document.documentElement.scrollTop).toBeGreaterThan(initialScrollTop);\n\n\t// Complete the time dampening duration\n\tjest.advanceTimersByTime(defaultConfig.timeDampeningDurationMs);\n\n\t// Triggering another frame\n\t// we are expecting the scroll change to be the maximum allowed\n\t{\n\t\tconst before = document.documentElement.scrollTop;\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\t\tconst after = document.documentElement.scrollTop;\n\t\texpect(after - before).toBe(maxScrollPerFrame);\n\t}\n\n\t// Re-registering window scrolling\n\tunbindAutoScrolling();\n\tunbindAutoScrolling = autoScrollWindowForElements();\n\n\t// Triggering another auto scroll - should be at the max speed\n\t{\n\t\tconst before = document.documentElement.scrollTop;\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\t\tconst after = document.documentElement.scrollTop;\n\t\texpect(after - before).toBe(maxScrollPerFrame);\n\t}\n\n\tunbindAutoScrolling();\n\tcleanup();\n});\n\nit('should reset time dampening if a element is re-registered in a future frame', () => {\n\tconst { parentScrollContainer, child } = setupBasicScrollContainer();\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(parentScrollContainer),\n\t\tsetElementFromPoint(child),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\n\t\tbind(parentScrollContainer, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener() {\n\t\t\t\tordered.push(\n\t\t\t\t\t`scroll event {scrollLeft: ${parentScrollContainer.scrollLeft}, scrollTop: ${parentScrollContainer.scrollTop}}`,\n\t\t\t\t);\n\t\t\t},\n\t\t}),\n\t);\n\n\tlet unbindAutoScrolling = autoScrollForElements({\n\t\telement: parentScrollContainer,\n\t});\n\n\t// Scroll container is now looking over the center of the element\n\tconst initialScrollTop = child.getBoundingClientRect().height / 2;\n\tparentScrollContainer.scrollTop = initialScrollTop;\n\n\t// lifting on the top vertical edge of the container\n\tuserEvent.lift(child, {\n\t\tclientX:\n\t\t\tparentScrollContainer.getBoundingClientRect().left +\n\t\t\tparentScrollContainer.getBoundingClientRect().width / 2,\n\t\tclientY: parentScrollContainer.getBoundingClientRect().top,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\n\texpect(ordered).toEqual([]);\n\n\t// scroll container has still not scrolled\n\texpect(parentScrollContainer.scrollTop).toBe(initialScrollTop);\n\n\t// on the second frame we are performing our initial scroll\n\t// which will mark the first engagement\n\t// (and will also perform the first scroll)\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\t// scroll container has now been scrolled\n\texpect(parentScrollContainer.scrollTop).toBeLessThan(initialScrollTop);\n\n\t// Complete the time dampening duration\n\tjest.advanceTimersByTime(defaultConfig.timeDampeningDurationMs);\n\n\t// Triggering another frame\n\t// we are expecting the scroll change to be the maximum allowed\n\t{\n\t\tconst before = parentScrollContainer.scrollTop;\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\t\tconst after = parentScrollContainer.scrollTop;\n\t\texpect(before - after).toBe(maxScrollPerFrame);\n\t}\n\n\t// Unbinding the auto scroll element\n\tunbindAutoScrolling();\n\n\t// Triggering a scroll - should not scroll the scroll container\n\t{\n\t\tconst before = parentScrollContainer.scrollTop;\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\t\tconst after = parentScrollContainer.scrollTop;\n\t\texpect(before).toBe(after);\n\t}\n\n\t// Binding the scrollable element again\n\tunbindAutoScrolling = autoScrollForElements({\n\t\telement: parentScrollContainer,\n\t});\n\n\t// Triggering another auto scroll - should be the minimum scroll\n\t{\n\t\tconst before = parentScrollContainer.scrollTop;\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\t\tconst after = parentScrollContainer.scrollTop;\n\t\texpect(before - after).toBe(1);\n\t}\n\n\tcleanup();\n\tunbindAutoScrolling();\n});\n\nit('should reset time dampening if a element scroll is disabled and re-enabled in a future frame', () => {\n\tconst { parentScrollContainer, child } = setupBasicScrollContainer();\n\tconst ordered: string[] = [];\n\tlet isAutoScrollingAllowed: boolean = true;\n\n\tconst cleanup = combine(\n\t\tappendToBody(parentScrollContainer),\n\t\tsetElementFromPoint(child),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: parentScrollContainer,\n\t\t\tcanScroll: () => isAutoScrollingAllowed,\n\t\t}),\n\t);\n\n\t// Scroll container is now looking over the center of the element\n\tconst initialScrollTop = child.getBoundingClientRect().height / 2;\n\tparentScrollContainer.scrollTop = initialScrollTop;\n\n\t// lifting on the top vertical edge of the container\n\tuserEvent.lift(child, {\n\t\tclientX:\n\t\t\tparentScrollContainer.getBoundingClientRect().left +\n\t\t\tparentScrollContainer.getBoundingClientRect().width / 2,\n\t\tclientY: parentScrollContainer.getBoundingClientRect().top,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\n\t// scroll container has still not scrolled\n\texpect(ordered).toEqual([]);\n\texpect(parentScrollContainer.scrollTop).toBe(initialScrollTop);\n\n\t// on the second frame we are performing our initial scroll\n\t// which will mark the first engagement\n\t// (and will also perform the first scroll)\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\t// scroll container has now been scrolled\n\texpect(parentScrollContainer.scrollTop).toBeLessThan(initialScrollTop);\n\n\t// Complete the time dampening duration\n\tjest.advanceTimersByTime(defaultConfig.timeDampeningDurationMs);\n\n\t// Triggering another frame\n\t// we are expecting the scroll change to be the maximum allowed\n\t{\n\t\tconst before = parentScrollContainer.scrollTop;\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\t\tconst after = parentScrollContainer.scrollTop;\n\t\texpect(before - after).toBe(maxScrollPerFrame);\n\t}\n\n\t// No longer allowing auto scrolling\n\tisAutoScrollingAllowed = false;\n\n\t// Triggering a scroll - should not scroll the scroll container\n\t{\n\t\tconst before = parentScrollContainer.scrollTop;\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\t\tconst after = parentScrollContainer.scrollTop;\n\t\texpect(before).toBe(after);\n\t}\n\n\t// Binding the scrollable element again\n\tisAutoScrollingAllowed = true;\n\n\t// Triggering another auto scroll - should be the minimum scroll\n\t{\n\t\tconst before = parentScrollContainer.scrollTop;\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\t\tconst after = parentScrollContainer.scrollTop;\n\t\texpect(before - after).toBe(1);\n\t}\n\n\tcleanup();\n});\n\nit('should reset time dampening if a window scrolling is re-registered in a future frame', () => {\n\tconst [element] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\n\t// Setting some large scroll height on the window\n\tObject.defineProperties(document.documentElement, {\n\t\tscrollHeight: {\n\t\t\tvalue: document.documentElement.clientHeight * 10,\n\t\t\twritable: false,\n\t\t},\n\t});\n\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tsetElementFromPoint(element),\n\t\tdraggable({\n\t\t\telement: element,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: element,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tbind(window, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener: (event) => {\n\t\t\t\tif (event.target === document.documentElement) {\n\t\t\t\t\tordered.push('window:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tordered.push('unknown:scroll');\n\t\t\t},\n\t\t\t// scroll events do not bubble, so leveraging the capture phase\n\t\t\toptions: { capture: true },\n\t\t}),\n\t);\n\n\tconst initialScrollTop = document.documentElement.scrollTop;\n\tlet unbindAutoScrolling = autoScrollWindowForElements();\n\n\tuserEvent.lift(element, {\n\t\tclientX: document.documentElement.clientLeft + document.documentElement.clientWidth / 2,\n\t\tclientY: document.documentElement.clientLeft + document.documentElement.clientHeight,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\n\texpect(ordered).toEqual([]);\n\n\t// scroll container has still not scrolled\n\texpect(document.documentElement.scrollTop).toBe(initialScrollTop);\n\n\t// on the second frame we are performing our initial scroll\n\t// which will mark the first engagement\n\t// (and will also perform the first scroll)\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\t// scroll container has now been scrolled\n\texpect(document.documentElement.scrollTop).toBeGreaterThan(initialScrollTop);\n\n\t// Complete the time dampening duration\n\tjest.advanceTimersByTime(defaultConfig.timeDampeningDurationMs);\n\n\t// Triggering another frame\n\t// we are expecting the scroll change to be the maximum allowed\n\t{\n\t\tconst before = document.documentElement.scrollTop;\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\t\tconst after = document.documentElement.scrollTop;\n\t\texpect(after - before).toBe(maxScrollPerFrame);\n\t}\n\n\t// un-registering window scrolling\n\tunbindAutoScrolling();\n\n\t// Triggering another auto scroll - should not scroll\n\t{\n\t\tconst before = document.documentElement.scrollTop;\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\t\tconst after = document.documentElement.scrollTop;\n\t\texpect(after).toBe(before);\n\t}\n\n\tunbindAutoScrolling = autoScrollWindowForElements();\n\n\t// Triggering another auto scroll - should be the minimum scroll\n\t{\n\t\tconst before = document.documentElement.scrollTop;\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\t\tconst after = document.documentElement.scrollTop;\n\t\texpect(after - before).toBe(1);\n\t}\n\n\tunbindAutoScrolling();\n\tcleanup();\n});\n\nit('should reset time dampening if a window scrolling is re-enabled in a future frame', () => {\n\tconst [element] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tlet isAutoScrollingAllowed: boolean = true;\n\n\t// Setting some large scroll height on the window\n\tObject.defineProperties(document.documentElement, {\n\t\tscrollHeight: {\n\t\t\tvalue: document.documentElement.clientHeight * 10,\n\t\t\twritable: false,\n\t\t},\n\t});\n\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tsetElementFromPoint(element),\n\t\tdraggable({\n\t\t\telement: element,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: element,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tautoScrollWindowForElements({\n\t\t\tcanScroll: () => isAutoScrollingAllowed,\n\t\t}),\n\t\tbind(window, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener: (event) => {\n\t\t\t\tif (event.target === document.documentElement) {\n\t\t\t\t\tordered.push('window:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tordered.push('unknown:scroll');\n\t\t\t},\n\t\t\t// scroll events do not bubble, so leveraging the capture phase\n\t\t\toptions: { capture: true },\n\t\t}),\n\t);\n\n\tconst initialScrollTop = document.documentElement.scrollTop;\n\n\tuserEvent.lift(element, {\n\t\tclientX: document.documentElement.clientLeft + document.documentElement.clientWidth / 2,\n\t\tclientY: document.documentElement.clientLeft + document.documentElement.clientHeight,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\n\t// scroll container has still not scrolled\n\texpect(ordered).toEqual([]);\n\texpect(document.documentElement.scrollTop).toBe(initialScrollTop);\n\n\t// on the second frame we are performing our initial scroll\n\t// which will mark the first engagement\n\t// (and will also perform the first scroll)\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\t// scroll container has now been scrolled\n\texpect(document.documentElement.scrollTop).toBeGreaterThan(initialScrollTop);\n\texpect(ordered).toEqual(['window:scroll']);\n\tordered.length = 0;\n\n\t// Complete the time dampening duration\n\tjest.advanceTimersByTime(defaultConfig.timeDampeningDurationMs);\n\n\t// Triggering another frame\n\t// we are expecting the scroll change to be the maximum allowed\n\t{\n\t\tconst before = document.documentElement.scrollTop;\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\t\tconst after = document.documentElement.scrollTop;\n\t\texpect(after - before).toBe(maxScrollPerFrame);\n\t}\n\n\t// disabling auto scroll\n\tisAutoScrollingAllowed = false;\n\n\t// Triggering another auto scroll - should not scroll\n\t{\n\t\tconst before = document.documentElement.scrollTop;\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\t\tconst after = document.documentElement.scrollTop;\n\t\texpect(after).toBe(before);\n\t}\n\n\t// re-enabling auto scrolling\n\tisAutoScrollingAllowed = true;\n\n\t// Triggering another auto scroll - should be the minimum scroll\n\t{\n\t\tconst before = document.documentElement.scrollTop;\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\t\tconst after = document.documentElement.scrollTop;\n\t\texpect(after - before).toBe(1);\n\t}\n\n\tcleanup();\n});\n\nit('should not dampen time after the time dampening period has finished [on original axis]', () => {\n\tconst { child, parentScrollContainer } = setupBasicScrollContainer();\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(parentScrollContainer),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: parentScrollContainer,\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(parentScrollContainer, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener() {\n\t\t\t\tordered.push(\n\t\t\t\t\t`scroll event {scrollLeft: ${parentScrollContainer.scrollLeft}, scrollTop: ${parentScrollContainer.scrollTop}}`,\n\t\t\t\t);\n\t\t\t},\n\t\t}),\n\t);\n\n\t// Scroll container is now looking over the center of the element\n\tconst initialScrollTop = parentScrollContainer.getBoundingClientRect().height / 2;\n\tparentScrollContainer.scrollTop = initialScrollTop;\n\t// just checking I got the math right\n\texpect(initialScrollTop).toBe(500);\n\n\t// lifting on the top vertical edge of the container\n\tuserEvent.lift(child, {\n\t\tclientX:\n\t\t\tparentScrollContainer.getBoundingClientRect().left +\n\t\t\tparentScrollContainer.getBoundingClientRect().width / 2,\n\t\tclientY: parentScrollContainer.getBoundingClientRect().top,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\n\t// scroll container has still not scrolled\n\texpect(parentScrollContainer.scrollTop).toBe(initialScrollTop);\n\n\t// on the second frame we are performing our initial scroll\n\t// which will mark the first engagement\n\t// (and will also perform the first scroll)\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\t// scroll container has still been scrolled\n\texpect(parentScrollContainer.scrollTop).toBeLessThan(initialScrollTop);\n\n\t// Complete the time dampening duration\n\tjest.advanceTimersByTime(defaultConfig.timeDampeningDurationMs);\n\n\t// just asserting we have a setup that will execute the test correctly\n\tconst beforeScrollTop = parentScrollContainer.scrollTop;\n\texpect(beforeScrollTop).toBeLessThan(initialScrollTop);\n\t// our next scroll should have room for more than the max scroll\n\t// (otherwise we are not testing what we expect)\n\texpect(beforeScrollTop).toBeGreaterThan(maxScrollPerFrame);\n\n\t// Triggering another frame\n\t// we are expecting the scroll change to be the maximum allowed\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\tconst afterScrollTop = parentScrollContainer.scrollTop;\n\texpect(beforeScrollTop - afterScrollTop).toBe(maxScrollPerFrame);\n\n\tcleanup();\n});\n\nit('should not dampen time after the time dampening period has finished [on different axis]', () => {\n\tconst { child, parentScrollContainer } = setupBasicScrollContainer();\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(parentScrollContainer),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: parentScrollContainer,\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(parentScrollContainer, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener() {\n\t\t\t\tordered.push(\n\t\t\t\t\t`scroll event {scrollLeft: ${parentScrollContainer.scrollLeft}, scrollTop: ${parentScrollContainer.scrollTop}}`,\n\t\t\t\t);\n\t\t\t},\n\t\t}),\n\t);\n\n\t// Initial scrolling on the top and left\n\tconst initialScrollTop = parentScrollContainer.getBoundingClientRect().height / 2;\n\tparentScrollContainer.scrollTop = initialScrollTop;\n\tconst initialScrollLeft = parentScrollContainer.getBoundingClientRect().width / 2;\n\tparentScrollContainer.scrollLeft = initialScrollLeft;\n\n\t// checking our initial math is correct\n\texpect(parentScrollContainer.scrollLeft).toBe(500);\n\n\t// lifting on the top vertical edge of the container\n\tuserEvent.lift(child, {\n\t\tclientX:\n\t\t\tparentScrollContainer.getBoundingClientRect().left +\n\t\t\tparentScrollContainer.getBoundingClientRect().width / 2,\n\t\tclientY: parentScrollContainer.getBoundingClientRect().top,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\n\t// scroll container has still not scrolled\n\texpect(parentScrollContainer.scrollTop).toBe(initialScrollTop);\n\n\t// on the second frame we are performing our initial scroll\n\t// which will mark the first engagement\n\t// (and will also perform the first scroll)\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\t// scroll container has been scrolled on the top\n\texpect(parentScrollContainer.scrollTop).toBeLessThan(initialScrollTop);\n\t// scroll container has not been scrolled on the left yet\n\texpect(parentScrollContainer.scrollLeft).toBe(initialScrollLeft);\n\t// ensuring we have enough room to do a max scroll\n\texpect(parentScrollContainer.scrollLeft).toBeGreaterThan(maxScrollPerFrame);\n\n\t// Complete the time dampening duration\n\tjest.advanceTimersByTime(defaultConfig.timeDampeningDurationMs);\n\n\texpect(parentScrollContainer.scrollLeft).toBe(initialScrollLeft);\n\n\tconst rect = parentScrollContainer.getBoundingClientRect();\n\t// mid center on left edge\n\tfireEvent.dragOver(child, {\n\t\tclientX: rect.left,\n\t\tclientY: rect.top + rect.height,\n\t});\n\n\t// first frame: this will update the 'input' for a drag (update changes are throttled inside of a frame)\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(initialScrollLeft).toBe(parentScrollContainer.scrollLeft);\n\n\t// this should now trigger an auto scroll of the max scroll (no time dampening)\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(initialScrollLeft - parentScrollContainer.scrollLeft).toBe(maxScrollPerFrame);\n\n\tcleanup();\n});\n\n// only checking forward direction, as code path is the same as scroll containers\nit('should reset time dampening when doing repeated drag operations', () => {\n\tconst { parentScrollContainer, child } = setupBasicScrollContainer();\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(parentScrollContainer),\n\t\tsetElementFromPoint(child),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: parentScrollContainer,\n\t\t}),\n\t);\n\n\tfunction dragOperation() {\n\t\t// Scroll container is now looking over the center of the element\n\t\tconst initialScrollTop = child.getBoundingClientRect().height / 2;\n\t\tparentScrollContainer.scrollTop = initialScrollTop;\n\n\t\t// lifting on the top vertical edge of the container\n\t\tuserEvent.lift(child, {\n\t\t\tclientX:\n\t\t\t\tparentScrollContainer.getBoundingClientRect().left +\n\t\t\t\tparentScrollContainer.getBoundingClientRect().width / 2,\n\t\t\tclientY: parentScrollContainer.getBoundingClientRect().top,\n\t\t});\n\n\t\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\t\tordered.length = 0;\n\n\t\t// on first frame, there is no auto scroll as\n\t\t// we don't know what the scroll speed should be until\n\t\t// a single frame has passed\n\t\tadvanceTimersToNextFrame();\n\n\t\texpect(ordered).toEqual([]);\n\n\t\t// scroll container has still not scrolled\n\t\texpect(parentScrollContainer.scrollTop).toBe(initialScrollTop);\n\n\t\t// on the second frame we are performing our initial scroll\n\t\t// which will mark the first engagement\n\t\t// (and will also perform the first scroll)\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\n\t\t// scroll container has now been scrolled\n\t\texpect(parentScrollContainer.scrollTop).toBeLessThan(initialScrollTop);\n\n\t\t// Complete the time dampening duration\n\t\tjest.advanceTimersByTime(defaultConfig.timeDampeningDurationMs);\n\n\t\t// Triggering another frame\n\t\t// we are expecting the scroll change to be the maximum allowed\n\t\t{\n\t\t\tconst before = parentScrollContainer.scrollTop;\n\t\t\tadvanceTimersToNextFrame();\n\t\t\tstepScrollBy();\n\t\t\tconst after = parentScrollContainer.scrollTop;\n\t\t\texpect(before - after).toBe(maxScrollPerFrame);\n\t\t}\n\n\t\tuserEvent.drop(child);\n\t\texpect(ordered).toEqual(['draggable:drop', 'dropTarget:drop']);\n\t\tordered.length = 0;\n\t}\n\n\t// Let's do a few drag operations and ensure that the behaviour is the same\n\n\tdragOperation();\n\tdragOperation();\n\tdragOperation();\n\tdragOperation();\n\n\tcleanup();\n});\n\nit('should apply time dampening for window scrolling', () => {\n\tconst [element] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdraggable({\n\t\t\telement: element,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: element,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tautoScrollWindowForElements(),\n\t\tsetElementFromPoint(element),\n\t\tbind(window, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener(event) {\n\t\t\t\tif (event.target === document.documentElement) {\n\t\t\t\t\tordered.push('window:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tordered.push('unknown:scroll');\n\t\t\t},\n\t\t\toptions: { capture: true },\n\t\t}),\n\t);\n\n\t// setting a large vertical amount of available scroll\n\tObject.defineProperties(document.documentElement, {\n\t\tscrollHeight: {\n\t\t\tvalue: document.documentElement.clientHeight * 10,\n\t\t\twritable: false,\n\t\t},\n\t});\n\n\tconst initialScrollTop = document.documentElement.scrollTop;\n\tconst initialScrollLeft = document.documentElement.scrollLeft;\n\texpect(initialScrollTop).toBe(0);\n\texpect(initialScrollLeft).toBe(0);\n\n\t// starting a drag\n\tuserEvent.lift(element);\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// in the first frame before auto scrolling has started\n\t// we are updating our drag so that we are over\n\tfireEvent.dragEnter(document.body, {\n\t\tclientX: document.documentElement.clientLeft + document.documentElement.clientWidth / 2,\n\t\tclientY: document.documentElement.clientTop + document.documentElement.clientHeight,\n\t});\n\texpect(ordered).toEqual(['dropTarget:leave']);\n\tordered.length = 0;\n\n\t// in the first frame, there will be no auto scroll\n\tadvanceTimersToNextFrame();\n\texpect(ordered).toEqual([]);\n\n\t// checking window has not been scrolled\n\texpect(document.documentElement.scrollTop).toBe(initialScrollTop);\n\n\tlet lastScrollTop = initialScrollTop;\n\tlet lastScrollChange = 0;\n\n\tlet engagementStart: number | null = null;\n\n\t// tracking the various cases to make sure we are actually hitting them\n\tconst casesHit = {\n\t\tacceleration: false,\n\t\t'time-dampening-finished': false,\n\t\t'time-dampening-finished-last-scroll': false,\n\t};\n\n\tconst maxScrollTop =\n\t\tdocument.documentElement.scrollHeight - document.documentElement.clientHeight;\n\n\t// Keep going until we cannot scroll any more\n\twhile (document.documentElement.scrollTop <= maxScrollTop) {\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\n\t\t// asserting that one scroll event has occurred\n\t\texpect(ordered).toEqual(['window:scroll']);\n\t\tordered.length = 0;\n\n\t\t// Engagement not set until first active scroll\n\t\tif (!engagementStart) {\n\t\t\tengagementStart = Date.now();\n\t\t}\n\n\t\tconst currentScrollTop = document.documentElement.scrollTop;\n\t\t/**\n\t\t * Sometimes minus can run into IEEE 754 floating point math issues.\n\t\t * Example: `256.4 - 241.4` is `14.99999999999972` and not `15` 😮‍💨\n\t\t * Never use `.toBe()` with `scrollChange`, only `.toBeCloseTo()`\n\t\t * or other _not strictly equal_ assertions (eg `toBeGreaterThan()`)\n\t\t * (which takes into account floating point issues).\n\t\t **/\n\t\tconst scrollChange = currentScrollTop - lastScrollTop;\n\n\t\t// we are scrolling forward so our change will be positive\n\t\texpect(scrollChange).toBeGreaterThan(0);\n\n\t\tlastScrollTop = currentScrollTop;\n\n\t\tconst now = Date.now();\n\t\tconst duration = now - engagementStart;\n\n\t\t// Case 1: in the time dampening period\n\t\tif (duration < defaultConfig.timeDampeningDurationMs) {\n\t\t\t// We are still not at the max scroll speed\n\t\t\texpect(scrollChange).not.toBeGreaterThan(defaultConfig.maxPixelScrollPerSecond);\n\t\t\t// Each scroll is bigger than the last\n\t\t\texpect(scrollChange).toBeGreaterThan(lastScrollChange);\n\t\t\tcasesHit.acceleration = true;\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Case 2: scrolling at max speed, but not finished scrolling\n\t\t// Expecting max scroll speed\n\t\tif (document.documentElement.scrollTop < maxScrollTop) {\n\t\t\texpect(scrollChange).toBeCloseTo(defaultConfig.maxPixelScrollPerSecond / 60);\n\t\t\tcasesHit['time-dampening-finished'] = true;\n\t\t\tcontinue;\n\t\t}\n\t\t// Case 3: the last scroll finished the scrolling of the element.\n\t\t// The last scroll could be slightly less than the max scroll amount\n\t\t// as there might not have been the max scroll amount left to scroll\n\t\texpect(scrollChange).toBeLessThanOrEqual(defaultConfig.maxPixelScrollPerSecond / 60);\n\t\tcasesHit['time-dampening-finished-last-scroll'] = true;\n\n\t\t// We can finish here (even though the exit condition would catch us too)\n\t\tbreak;\n\t}\n\n\t// scroll container has been scrolled all the way to the top\n\texpect(document.documentElement.scrollTop).toBe(maxScrollTop);\n\t// asserting all our cases where hit\n\texpect(casesHit.acceleration).toBe(true);\n\texpect(casesHit['time-dampening-finished']).toBe(true);\n\texpect(casesHit['time-dampening-finished-last-scroll']).toBe(true);\n\n\t// scrollLeft should not have changed\n\texpect(document.documentElement.scrollLeft).toBe(initialScrollLeft);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/auto-scroll/__tests__/unit/over-element/window-scrolling.spec.ts",
    "content": "import { bind } from 'bind-event-listener';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport {\n\tautoScrollForElements,\n\tautoScrollWindowForElements,\n} from '../../../src/entry-point/element';\nimport {\n\tadvanceTimersToNextFrame,\n\tappendToBody,\n\tgetBubbleOrderedTree,\n\treset,\n\tsetElementFromPoint,\n\tsetStartSystemTime,\n\tsetupBasicScrollContainer,\n\tstepScrollBy,\n\tuserEvent,\n} from '../_util';\n\n// Using modern timers as it is important that the system clock moves in sync with the frames.\n// We need this as we are keeping track of when a drop target is entered into.\njest.useFakeTimers();\nsetStartSystemTime();\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nbeforeEach(reset);\n\nbeforeEach(() => {\n\tdocument.documentElement.scrollTop = 0;\n});\n\nfunction canScrollOnBottom(element: HTMLElement): boolean {\n\treturn Math.ceil(element.scrollTop) + element.clientHeight < element.scrollHeight;\n}\n\ntest('validating initial properties are set by jsdom', () => {\n\texpect(document.documentElement.clientHeight).toBe(768);\n\texpect(document.documentElement.clientWidth).toBe(1024);\n\texpect(document.documentElement.clientTop).toBe(0);\n\texpect(document.documentElement.clientLeft).toBe(0);\n\texpect(document.documentElement.scrollTop).toBe(0);\n\texpect(document.documentElement.scrollLeft).toBe(0);\n});\n\nit('should scroll the window if it is scrollable', () => {\n\tconst [element] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\n\t// Setting some large scroll height on the window\n\tObject.defineProperties(document.documentElement, {\n\t\tscrollHeight: {\n\t\t\tvalue: document.documentElement.clientHeight * 10,\n\t\t\twritable: false,\n\t\t},\n\t});\n\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdraggable({\n\t\t\telement: element,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: element,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tautoScrollWindowForElements(),\n\t\tsetElementFromPoint(element),\n\t\tbind(window, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener: (event) => {\n\t\t\t\tif (event.target === document.documentElement) {\n\t\t\t\t\tordered.push('window:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tordered.push('unknown:scroll');\n\t\t\t},\n\t\t\t// scroll events do not bubble, so leveraging the capture phase\n\t\t\toptions: { capture: true },\n\t\t}),\n\t);\n\n\tuserEvent.lift(element, {\n\t\tclientX: document.documentElement.clientLeft + document.documentElement.clientWidth / 2,\n\t\tclientY: document.documentElement.clientLeft + document.documentElement.clientHeight,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\n\texpect(ordered).toEqual([]);\n\n\t// next frame should scroll the window\n\tconst before = document.documentElement.scrollTop;\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\tconst after = document.documentElement.scrollTop;\n\texpect(after).toBeGreaterThan(before);\n\texpect(ordered).toEqual(['window:scroll']);\n\tordered.length = 0;\n\n\tcleanup();\n});\n\nit('should not warn if there are multiple registrations', () => {\n\tconst warn = jest.spyOn(console, 'warn').mockImplementation(() => {});\n\tconst cleanup = combine(\n\t\tautoScrollWindowForElements(),\n\t\tautoScrollWindowForElements(),\n\t\tautoScrollWindowForElements(),\n\t);\n\n\texpect(warn).not.toHaveBeenCalled();\n\n\tcleanup();\n\twarn.mockRestore();\n});\n\nit('should only scroll the window once, even if there are other registrations', () => {\n\tconst [element] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\n\t// Setting some large scroll height on the window\n\tObject.defineProperties(document.documentElement, {\n\t\tscrollHeight: {\n\t\t\tvalue: document.documentElement.clientHeight * 10,\n\t\t\twritable: false,\n\t\t},\n\t});\n\n\t// multiple registrations\n\tconst unregister1 = autoScrollWindowForElements();\n\tconst unregister2 = autoScrollWindowForElements();\n\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdraggable({\n\t\t\telement: element,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: element,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tsetElementFromPoint(element),\n\t\tbind(window, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener: (event) => {\n\t\t\t\tif (event.target === document.documentElement) {\n\t\t\t\t\tordered.push('window:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tordered.push('unknown:scroll');\n\t\t\t},\n\t\t\t// scroll events do not bubble, so leveraging the capture phase\n\t\t\toptions: { capture: true },\n\t\t}),\n\t);\n\n\tuserEvent.lift(element, {\n\t\tclientX: document.documentElement.clientLeft + document.documentElement.clientWidth / 2,\n\t\tclientY: document.documentElement.clientLeft + document.documentElement.clientHeight,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\n\texpect(ordered).toEqual([]);\n\n\t// next frame should scroll the window\n\t{\n\t\tconst before = document.documentElement.scrollTop;\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\t\tconst after = document.documentElement.scrollTop;\n\t\texpect(after).toBeGreaterThan(before);\n\t\texpect(ordered).toEqual(['window:scroll']);\n\t\tordered.length = 0;\n\t}\n\t// removing one registration, scroll should still occur\n\tunregister1();\n\t{\n\t\tconst before = document.documentElement.scrollTop;\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\t\tconst after = document.documentElement.scrollTop;\n\t\texpect(after).toBeGreaterThan(before);\n\t\texpect(ordered).toEqual(['window:scroll']);\n\t\tordered.length = 0;\n\t}\n\n\t// removing final registration, scroll should not occur\n\tunregister2();\n\t{\n\t\tconst before = document.documentElement.scrollTop;\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\t\tconst after = document.documentElement.scrollTop;\n\t\texpect(after).toBe(before);\n\t\texpect(ordered).toEqual([]);\n\t\tordered.length = 0;\n\t}\n\n\tcleanup();\n});\n\nit('should only scroll the window if there are any registrations that have canScroll: () => true', () => {\n\tconst [element] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\n\t// Setting some large scroll height on the window\n\tObject.defineProperties(document.documentElement, {\n\t\tscrollHeight: {\n\t\t\tvalue: document.documentElement.clientHeight * 10,\n\t\t\twritable: false,\n\t\t},\n\t});\n\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdraggable({\n\t\t\telement: element,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tautoScrollWindowForElements({\n\t\t\tcanScroll: () => {\n\t\t\t\tordered.push('1. canScroll: false');\n\t\t\t\treturn false;\n\t\t\t},\n\t\t}),\n\t\tautoScrollWindowForElements({\n\t\t\tcanScroll: () => {\n\t\t\t\tordered.push('2. canScroll: true');\n\t\t\t\treturn true;\n\t\t\t},\n\t\t}),\n\t\tautoScrollWindowForElements({\n\t\t\tcanScroll: () => {\n\t\t\t\tordered.push('3. canScroll: false');\n\t\t\t\treturn false;\n\t\t\t},\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: element,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tsetElementFromPoint(element),\n\t\tbind(window, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener: (event) => {\n\t\t\t\tif (event.target === document.documentElement) {\n\t\t\t\t\tordered.push('window:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tordered.push('unknown:scroll');\n\t\t\t},\n\t\t\t// scroll events do not bubble, so leveraging the capture phase\n\t\t\toptions: { capture: true },\n\t\t}),\n\t);\n\n\tuserEvent.lift(element, {\n\t\tclientX: document.documentElement.clientLeft + document.documentElement.clientWidth / 2,\n\t\tclientY: document.documentElement.clientLeft + document.documentElement.clientHeight,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\n\texpect(ordered).toEqual([]);\n\n\t// next frame should scroll the window\n\t{\n\t\tconst before = document.documentElement.scrollTop;\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\t\tconst after = document.documentElement.scrollTop;\n\t\texpect(after).toBeGreaterThan(before);\n\t\texpect(ordered).toEqual([\n\t\t\t'1. canScroll: false',\n\t\t\t'2. canScroll: true',\n\t\t\t// '3. canScroll: false' should not be called as it was not needed\n\t\t\t'window:scroll',\n\t\t]);\n\t\tordered.length = 0;\n\t}\n\n\tcleanup();\n});\n\nit('should not scroll the window if there are no active registrations', () => {\n\tconst [element] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\n\t// Setting some large scroll height on the window\n\tObject.defineProperties(document.documentElement, {\n\t\tscrollHeight: {\n\t\t\tvalue: document.documentElement.clientHeight * 10,\n\t\t\twritable: false,\n\t\t},\n\t});\n\n\tlet unregisterAutoScrolling = autoScrollWindowForElements();\n\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdraggable({\n\t\t\telement: element,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: element,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tsetElementFromPoint(element),\n\t\tbind(window, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener: (event) => {\n\t\t\t\tif (event.target === document.documentElement) {\n\t\t\t\t\tordered.push('window:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tordered.push('unknown:scroll');\n\t\t\t},\n\t\t\t// scroll events do not bubble, so leveraging the capture phase\n\t\t\toptions: { capture: true },\n\t\t}),\n\t);\n\n\tuserEvent.lift(element, {\n\t\tclientX: document.documentElement.clientLeft + document.documentElement.clientWidth / 2,\n\t\tclientY: document.documentElement.clientLeft + document.documentElement.clientHeight,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\n\texpect(ordered).toEqual([]);\n\n\t// next frame should scroll the window\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual(['window:scroll']);\n\tordered.length = 0;\n\n\t// now un registering our auto scroll\n\tunregisterAutoScrolling();\n\n\t// an auto scroll on the window should not occur in the next frame\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\n\t// enabling auto scrolling again\n\tunregisterAutoScrolling = autoScrollWindowForElements();\n\n\t// an auto scroll should occur in the next frame\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual(['window:scroll']);\n\n\tunregisterAutoScrolling();\n\tcleanup();\n});\n\nit('should not scroll the window if no registrations are allowing scrolling', () => {\n\tconst [element] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\n\t// Setting some large scroll height on the window\n\tObject.defineProperties(document.documentElement, {\n\t\tscrollHeight: {\n\t\t\tvalue: document.documentElement.clientHeight * 10,\n\t\t\twritable: false,\n\t\t},\n\t});\n\tlet allowScrolling: boolean = true;\n\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdraggable({\n\t\t\telement: element,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tautoScrollWindowForElements({\n\t\t\tcanScroll: () => allowScrolling,\n\t\t}),\n\t\tautoScrollWindowForElements({\n\t\t\tcanScroll: () => allowScrolling,\n\t\t}),\n\t\tautoScrollWindowForElements({\n\t\t\tcanScroll: () => allowScrolling,\n\t\t}),\n\n\t\tdropTargetForElements({\n\t\t\telement: element,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tsetElementFromPoint(element),\n\t\tbind(window, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener: (event) => {\n\t\t\t\tif (event.target === document.documentElement) {\n\t\t\t\t\tordered.push('window:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tordered.push('unknown:scroll');\n\t\t\t},\n\t\t\t// scroll events do not bubble, so leveraging the capture phase\n\t\t\toptions: { capture: true },\n\t\t}),\n\t);\n\n\tuserEvent.lift(element, {\n\t\tclientX: document.documentElement.clientLeft + document.documentElement.clientWidth / 2,\n\t\tclientY: document.documentElement.clientLeft + document.documentElement.clientHeight,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\n\texpect(ordered).toEqual([]);\n\n\t// next frame should scroll the window\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual(['window:scroll']);\n\tordered.length = 0;\n\n\t// now un registering our auto scroll\n\tallowScrolling = false;\n\n\t// an auto scroll on the window should not occur in the next frame\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\n\t// scrolling allowed again\n\tallowScrolling = true;\n\n\t// we should now expect to see auto scrolling enabled again\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual(['window:scroll']);\n\n\tcleanup();\n});\n\nit('should scroll the window once, even if there are multiple registrations', () => {\n\tconst [element] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\n\t// Setting some large scroll height on the window\n\tObject.defineProperties(document.documentElement, {\n\t\tscrollHeight: {\n\t\t\tvalue: document.documentElement.clientHeight * 10,\n\t\t\twritable: false,\n\t\t},\n\t});\n\n\tconst cleanup = combine(\n\t\t// multiple registrations - only one allowing scrolling\n\t\tautoScrollWindowForElements(),\n\t\tautoScrollWindowForElements(),\n\t\tautoScrollWindowForElements(),\n\t\tautoScrollWindowForElements(),\n\t\tautoScrollWindowForElements(),\n\n\t\tappendToBody(element),\n\t\tdraggable({\n\t\t\telement: element,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: element,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tsetElementFromPoint(element),\n\t\tbind(window, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener: (event) => {\n\t\t\t\tif (event.target === document.documentElement) {\n\t\t\t\t\tordered.push('window:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tordered.push('unknown:scroll');\n\t\t\t},\n\t\t\t// scroll events do not bubble, so leveraging the capture phase\n\t\t\toptions: { capture: true },\n\t\t}),\n\t);\n\n\tuserEvent.lift(element, {\n\t\tclientX: document.documentElement.clientLeft + document.documentElement.clientWidth / 2,\n\t\tclientY: document.documentElement.clientTop + document.documentElement.clientHeight,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\n\texpect(ordered).toEqual([]);\n\n\t// next frame should scroll the window\n\tconst before = document.documentElement.scrollTop;\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\tconst after = document.documentElement.scrollTop;\n\texpect(after).toBeGreaterThan(before);\n\texpect(ordered).toEqual(['window:scroll']);\n\tordered.length = 0;\n\n\tcleanup();\n});\n\nit('should scroll a scroll container before the window', () => {\n\tconst { child, parentScrollContainer } = setupBasicScrollContainer({\n\t\tchild: {\n\t\t\twidth: document.documentElement.clientWidth,\n\t\t\theight: document.documentElement.clientHeight * 20,\n\t\t},\n\t\tscrollContainer: {\n\t\t\twidth: document.documentElement.clientWidth,\n\t\t\theight: document.documentElement.clientHeight,\n\t\t},\n\t});\n\tconst ordered: string[] = [];\n\n\t// Setting some large scroll height on the window\n\tObject.defineProperties(document.documentElement, {\n\t\tscrollHeight: {\n\t\t\tvalue: document.documentElement.clientHeight * 10,\n\t\t\twritable: false,\n\t\t},\n\t});\n\n\tconst cleanup = combine(\n\t\tautoScrollWindowForElements(),\n\t\tautoScrollForElements({\n\t\t\telement: parentScrollContainer,\n\t\t}),\n\t\tappendToBody(parentScrollContainer),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(window, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener: (event) => {\n\t\t\t\tif (event.target === document.documentElement) {\n\t\t\t\t\tordered.push('window:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (event.target === parentScrollContainer) {\n\t\t\t\t\tordered.push('parent:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tordered.push('unknown:scroll');\n\t\t\t},\n\t\t\t// scroll events do not bubble, so leveraging the capture phase\n\t\t\toptions: { capture: true },\n\t\t}),\n\t);\n\n\tuserEvent.lift(child, {\n\t\tclientX:\n\t\t\tparentScrollContainer.getBoundingClientRect().left +\n\t\t\tparentScrollContainer.getBoundingClientRect().width / 2,\n\t\tclientY: parentScrollContainer.getBoundingClientRect().bottom,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\n\texpect(ordered).toEqual([]);\n\n\t// scroll the scroll parent until it is finished\n\t// (window should not be scrolled yet)\n\t{\n\t\tconst hit = jest.fn();\n\t\twhile (canScrollOnBottom(parentScrollContainer)) {\n\t\t\thit();\n\t\t\tadvanceTimersToNextFrame();\n\t\t\tstepScrollBy();\n\t\t\texpect(ordered).toEqual(['parent:scroll']);\n\t\t\tordered.length = 0;\n\t\t}\n\t\texpect(hit).toHaveBeenCalled();\n\t}\n\n\t// window should now scroll\n\t{\n\t\tconst hit = jest.fn();\n\t\twhile (canScrollOnBottom(document.documentElement)) {\n\t\t\thit();\n\t\t\tadvanceTimersToNextFrame();\n\t\t\tstepScrollBy();\n\t\t\texpect(ordered).toEqual(['window:scroll']);\n\t\t\tordered.length = 0;\n\t\t}\n\t\texpect(hit).toHaveBeenCalled();\n\t}\n\n\t// asserting there is nothing left to scroll\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\texpect(ordered).toEqual([]);\n\n\tcleanup();\n});\n\nit('should not scroll the window if a scroll container absorbed all the scroll axis', () => {\n\tconst { child, parentScrollContainer } = setupBasicScrollContainer({\n\t\tchild: {\n\t\t\t// won't be scrolling the scroll parent on the horizontal axis\n\t\t\twidth: document.documentElement.clientWidth,\n\t\t\theight: document.documentElement.clientHeight * 20,\n\t\t},\n\t\tscrollContainer: {\n\t\t\twidth: document.documentElement.clientWidth,\n\t\t\theight: document.documentElement.clientHeight,\n\t\t},\n\t});\n\tconst ordered: string[] = [];\n\n\t// Setting some large scroll width and height on the window\n\tObject.defineProperties(document.documentElement, {\n\t\tscrollWidth: {\n\t\t\tvalue: document.documentElement.clientWidth * 10,\n\t\t\twritable: false,\n\t\t},\n\t\tscrollHeight: {\n\t\t\tvalue: document.documentElement.clientHeight * 10,\n\t\t\twritable: false,\n\t\t},\n\t});\n\n\tconst cleanup = combine(\n\t\tautoScrollWindowForElements(),\n\t\tautoScrollForElements({\n\t\t\telement: parentScrollContainer,\n\t\t}),\n\t\tappendToBody(parentScrollContainer),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(window, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener: (event) => {\n\t\t\t\tif (event.target === document.documentElement) {\n\t\t\t\t\tordered.push('window:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (event.target === parentScrollContainer) {\n\t\t\t\t\tordered.push('parent:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tordered.push('unknown:scroll');\n\t\t\t},\n\t\t\t// scroll events do not bubble, so leveraging the capture phase\n\t\t\toptions: { capture: true },\n\t\t}),\n\t);\n\n\t// lifting on bottom right\n\t// expecting to scroll vertically on the scroll container\n\t// and horizontally on the window\n\tuserEvent.lift(child, {\n\t\tclientX: parentScrollContainer.getBoundingClientRect().right,\n\t\tclientY: parentScrollContainer.getBoundingClientRect().bottom,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\n\texpect(ordered).toEqual([]);\n\n\tconst parentBefore = {\n\t\tscrollTop: parentScrollContainer.scrollTop,\n\t\tscrollLeft: parentScrollContainer.scrollLeft,\n\t};\n\tconst windowBefore = {\n\t\tscrollTop: document.documentElement.scrollTop,\n\t\tscrollLeft: document.documentElement.scrollLeft,\n\t};\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\tconst parentAfter = {\n\t\tscrollTop: parentScrollContainer.scrollTop,\n\t\tscrollLeft: parentScrollContainer.scrollLeft,\n\t};\n\tconst windowAfter = {\n\t\tscrollTop: document.documentElement.scrollTop,\n\t\tscrollLeft: document.documentElement.scrollLeft,\n\t};\n\texpect(ordered).toEqual(['parent:scroll', 'window:scroll']);\n\tordered.length = 0;\n\n\t// expecting vertical scroll on the scroll container,\n\t// and because the scroll container cannot scroll horizontally,\n\t// we should see some horizontal scrolling on the window\n\texpect(parentAfter.scrollTop).toBeGreaterThan(parentBefore.scrollTop);\n\texpect(parentAfter.scrollLeft).toBe(parentBefore.scrollLeft);\n\texpect(windowAfter.scrollLeft).toBeGreaterThan(windowBefore.scrollLeft);\n\texpect(windowAfter.scrollTop).toBe(windowBefore.scrollTop);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/auto-scroll/__tests__/unit/overflow/allowed-axis.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport { bind } from 'bind-event-listener';\n\nimport { unsafeOverflowAutoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/unsafe-overflow/element';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { type AllowedAxis } from '../../../src/internal-types';\nimport {\n\tadvanceTimersToNextFrame,\n\tappendToBody,\n\ttype AxisScroll,\n\ttype Event,\n\tgetAxisScroll,\n\tgetExpectedEvents,\n\tgetScenarios,\n\thasAxisScrolled,\n\treset,\n\tsetElementFromPoint,\n\tsetStartSystemTime,\n\tsetupBasicScrollContainer,\n\tstepScrollBy,\n\tuserEvent,\n} from '../_util';\n\njest.useFakeTimers();\nsetStartSystemTime();\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nbeforeEach(reset);\n\nconst OUTSIDE_OFFSET = 10;\n\ndescribe('allowed axis', () => {\n\tconst { child, parentScrollContainer } = setupBasicScrollContainer();\n\n\tconst originalScrollTop = parentScrollContainer.scrollTop;\n\tconst originalScrollLeft = parentScrollContainer.scrollLeft;\n\n\tafterEach(() => {\n\t\tparentScrollContainer.scrollTop = originalScrollTop;\n\t\tparentScrollContainer.scrollLeft = originalScrollLeft;\n\t});\n\n\tgetScenarios(parentScrollContainer.getBoundingClientRect(), OUTSIDE_OFFSET).forEach(\n\t\t({ label, startPosition, endPosition, expectedMovement }) => {\n\t\t\tit(`should only scroll on axis that are allowed - ${label}`, () => {\n\t\t\t\tconst events: Event[] = [];\n\n\t\t\t\tlet allowedAxis: AllowedAxis = 'all';\n\t\t\t\tlet axisScroll: AxisScroll;\n\n\t\t\t\tconst cleanup = combine(\n\t\t\t\t\tappendToBody(parentScrollContainer),\n\t\t\t\t\tdraggable({\n\t\t\t\t\t\telement: child,\n\t\t\t\t\t\tonDragStart: () => events.push({ type: 'draggable:start' }),\n\t\t\t\t\t}),\n\t\t\t\t\tdropTargetForElements({\n\t\t\t\t\t\telement: child,\n\t\t\t\t\t\tonDragStart: () => events.push({ type: 'dropTarget:start' }),\n\t\t\t\t\t}),\n\t\t\t\t\tunsafeOverflowAutoScrollForElements({\n\t\t\t\t\t\telement: parentScrollContainer,\n\t\t\t\t\t\tgetOverflow: () => ({\n\t\t\t\t\t\t\tforTopEdge: {\n\t\t\t\t\t\t\t\ttop: 100,\n\t\t\t\t\t\t\t\tright: 100,\n\t\t\t\t\t\t\t\tleft: 100,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tforRightEdge: {\n\t\t\t\t\t\t\t\ttop: 100,\n\t\t\t\t\t\t\t\tright: 100,\n\t\t\t\t\t\t\t\tbottom: 100,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tforBottomEdge: {\n\t\t\t\t\t\t\t\tright: 100,\n\t\t\t\t\t\t\t\tbottom: 100,\n\t\t\t\t\t\t\t\tleft: 100,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tforLeftEdge: {\n\t\t\t\t\t\t\t\ttop: 100,\n\t\t\t\t\t\t\t\tleft: 100,\n\t\t\t\t\t\t\t\tbottom: 100,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tgetAllowedAxis: () => allowedAxis,\n\t\t\t\t\t}),\n\t\t\t\t\tbind(parentScrollContainer, {\n\t\t\t\t\t\ttype: 'scroll',\n\t\t\t\t\t\tlistener: (_event) => {\n\t\t\t\t\t\t\tevents.push({\n\t\t\t\t\t\t\t\ttype: 'scroll event',\n\t\t\t\t\t\t\t\t...hasAxisScrolled(parentScrollContainer, axisScroll),\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\taxisScroll = getAxisScroll(parentScrollContainer);\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\tlet unsetElementFromPoint = setElementFromPoint(child);\n\n\t\t\t\t// Scroll container is now looking over the center of the element\n\t\t\t\tparentScrollContainer.scrollTop = 500;\n\t\t\t\tparentScrollContainer.scrollLeft = 500;\n\t\t\t\taxisScroll = getAxisScroll(parentScrollContainer);\n\n\t\t\t\tuserEvent.lift(child, {\n\t\t\t\t\tclientX: startPosition.x,\n\t\t\t\t\tclientY: startPosition.y,\n\t\t\t\t});\n\n\t\t\t\texpect(events).toEqual([{ type: 'draggable:start' }, { type: 'dropTarget:start' }]);\n\t\t\t\tevents.length = 0;\n\n\t\t\t\t// First frame: allowedAxis is all.\n\t\t\t\t// Expecting no scroll to occur.\n\t\t\t\t// We don't know what the scroll speed should be until a single frame has passed.\n\t\t\t\tadvanceTimersToNextFrame();\n\t\t\t\tstepScrollBy();\n\n\t\t\t\texpect(events).toEqual([]);\n\n\t\t\t\tfireEvent.dragOver(document.body, {\n\t\t\t\t\tclientX: endPosition.x,\n\t\t\t\t\tclientY: endPosition.y,\n\t\t\t\t});\n\t\t\t\tunsetElementFromPoint();\n\t\t\t\tunsetElementFromPoint = setElementFromPoint(document.body);\n\n\t\t\t\t// Second frame: allowedAxis is all.\n\t\t\t\t// Expecting a scroll to occur on expected axis.\n\t\t\t\tadvanceTimersToNextFrame();\n\t\t\t\tstepScrollBy();\n\n\t\t\t\tconst movement = {\n\t\t\t\t\t...expectedMovement,\n\t\t\t\t};\n\n\t\t\t\tconst expectedEvents = getExpectedEvents(movement);\n\n\t\t\t\texpect(events).toEqual(expectedEvents);\n\t\t\t\tevents.length = 0;\n\n\t\t\t\t// Third frame: allowedAxis is vertical.\n\t\t\t\t// Expecting a scroll to occur on expected axis, except horizontal.\n\t\t\t\t// If neither are expected, expect no scroll.\n\t\t\t\tallowedAxis = 'vertical';\n\n\t\t\t\tadvanceTimersToNextFrame();\n\t\t\t\tstepScrollBy();\n\n\t\t\t\tconst verticalMovement = {\n\t\t\t\t\t...expectedMovement,\n\t\t\t\t\thorizontal: false,\n\t\t\t\t};\n\n\t\t\t\tconst expectedVerticalEvents = getExpectedEvents(verticalMovement);\n\n\t\t\t\texpect(events).toEqual(expectedVerticalEvents);\n\t\t\t\tevents.length = 0;\n\n\t\t\t\t// Fourth frame: allowedAxis is horizontal.\n\t\t\t\t// Expecting a scroll to occur on expected axis, except vertical.\n\t\t\t\t// If neither are expected, expect no scroll.\n\t\t\t\tallowedAxis = 'horizontal';\n\n\t\t\t\tadvanceTimersToNextFrame();\n\t\t\t\tstepScrollBy();\n\n\t\t\t\tconst horizontalMovement = {\n\t\t\t\t\t...expectedMovement,\n\t\t\t\t\tvertical: false,\n\t\t\t\t};\n\n\t\t\t\tconst expectedHorizontalEvents = getExpectedEvents(horizontalMovement);\n\n\t\t\t\texpect(events).toEqual(expectedHorizontalEvents);\n\n\t\t\t\tcleanup();\n\t\t\t});\n\t\t},\n\t);\n});\n"
  },
  {
    "path": "packages/auto-scroll/__tests__/unit/overflow/can-scroll.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport { bind } from 'bind-event-listener';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { unsafeOverflowAutoScrollForElements } from '../../../src/entry-point/unsafe-overflow/element';\nimport {\n\tadvanceTimersToNextFrame,\n\tappendToBody,\n\treset,\n\tsetElementFromPoint,\n\tsetStartSystemTime,\n\tsetupBasicScrollContainer,\n\tsetupNestedScrollContainers,\n\tstepScrollBy,\n\tuserEvent,\n} from '../_util';\n\n// Using modern timers as it is important that the system clock moves in sync with the frames.\n// We need this as we are keeping track of when a drop target is entered into.\njest.useFakeTimers();\nsetStartSystemTime();\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nbeforeEach(reset);\n\nit('should not scroll scroll containers that have canScroll: () => false', () => {\n\tconst { child, parentScrollContainer } = setupBasicScrollContainer();\n\tconst ordered: string[] = [];\n\tlet isAutoScrollingAllowed: boolean = true;\n\n\tconst cleanup = combine(\n\t\tappendToBody(parentScrollContainer),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t}),\n\t\tunsafeOverflowAutoScrollForElements({\n\t\t\telement: parentScrollContainer,\n\t\t\tcanScroll: () => isAutoScrollingAllowed,\n\t\t\tgetOverflow: () => ({\n\t\t\t\tforBottomEdge: {\n\t\t\t\t\tleft: 0,\n\t\t\t\t\tright: 0,\n\t\t\t\t\tbottom: 100,\n\t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t\tbind(parentScrollContainer, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener: () => ordered.push('scroll event'),\n\t\t}),\n\t);\n\tlet unsetElementFromPoint = setElementFromPoint(child);\n\n\t// Scroll container is now looking over the center of the element\n\tparentScrollContainer.scrollTop = 500;\n\tparentScrollContainer.scrollLeft = 500;\n\n\t// lifting on mid point\n\t// This will not cause auto scrolling as we have not setup the \"over element\" auto scroller\n\tuserEvent.lift(child, {\n\t\tclientX:\n\t\t\tparentScrollContainer.getBoundingClientRect().left +\n\t\t\tparentScrollContainer.getBoundingClientRect().width,\n\t\tclientY:\n\t\t\tparentScrollContainer.getBoundingClientRect().top +\n\t\t\tparentScrollContainer.getBoundingClientRect().height / 2,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\n\t// Second frame: no auto scroll will occur as we have not registered \"over element\" overflow scrolling\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\tordered.length = 0;\n\n\tfireEvent.dragOver(document.body, {\n\t\tclientX:\n\t\t\tparentScrollContainer.getBoundingClientRect().left +\n\t\t\tparentScrollContainer.getBoundingClientRect().width,\n\t\tclientY: parentScrollContainer.getBoundingClientRect().bottom + 1,\n\t});\n\tunsetElementFromPoint();\n\tunsetElementFromPoint = setElementFromPoint(document.body);\n\n\t// expecting overflow auto scroll in next frame\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual(['scroll event']);\n\tordered.length = 0;\n\n\tisAutoScrollingAllowed = false;\n\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\n\t// re-enabling\n\tisAutoScrollingAllowed = true;\n\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual(['scroll event']);\n\n\tcleanup();\n});\n\nit('should allow earlier registrations to scroll when a later registration has canScroll: () => false', () => {\n\tconst [child, parent, grandParent] = setupNestedScrollContainers([\n\t\t// child\n\t\t{ width: 10000, height: 10000 },\n\t\t// parent\n\t\t{ width: 5000, height: 5000 },\n\t\t// grandparent,\n\t\t{ width: 1000, height: 1000 },\n\t]);\n\n\tconst ordered: string[] = [];\n\tlet isParentScrollingAllowed: boolean = true;\n\n\tconst cleanup = combine(\n\t\tappendToBody(grandParent),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('child:start'),\n\t\t\tonDrop: () => ordered.push('child:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: parent,\n\t\t\tonDragStart: () => ordered.push('parent:start'),\n\t\t\tonDrop: () => ordered.push('parent:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: grandParent,\n\t\t\tonDragStart: () => ordered.push('grandParent:start'),\n\t\t\tonDrop: () => ordered.push('grandParent:drop'),\n\t\t}),\n\t\t// Important for this test: grandParent is registered before parent\n\t\t// We are checking that blocking scrolling on `parent` does not stop `grandParent`\n\t\t// from scrolling.\n\t\tunsafeOverflowAutoScrollForElements({\n\t\t\telement: grandParent,\n\t\t\tgetOverflow: () => ({\n\t\t\t\tforTopEdge: {\n\t\t\t\t\tleft: 0,\n\t\t\t\t\tright: 0,\n\t\t\t\t\ttop: 100,\n\t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t\tunsafeOverflowAutoScrollForElements({\n\t\t\telement: parent,\n\t\t\tcanScroll: () => isParentScrollingAllowed,\n\t\t\tgetOverflow: () => ({\n\t\t\t\tforTopEdge: {\n\t\t\t\t\tleft: 0,\n\t\t\t\t\tright: 0,\n\t\t\t\t\ttop: 100,\n\t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(window, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener: (event) => {\n\t\t\t\tif (event.target === grandParent) {\n\t\t\t\t\tordered.push('grandParent:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (event.target === parent) {\n\t\t\t\t\t// console.log('parent', parent.scrollTop, parent.scrollLeft);\n\t\t\t\t\tordered.push('parent:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tordered.push('unknown:scroll');\n\t\t\t},\n\t\t\t// scroll events do not bubble, so leveraging the capture phase\n\t\t\toptions: { capture: true },\n\t\t}),\n\t);\n\tlet unsetElementFromPoint = setElementFromPoint(child);\n\n\t// Set some initial scroll on the scroll containers\n\t// These are in the range where auto scrolling will occur on both\n\tparent.scrollTop = 60;\n\tgrandParent.scrollTop = 120;\n\n\t// lifting the mid point\n\tuserEvent.lift(child, {\n\t\tclientX:\n\t\t\tgrandParent.getBoundingClientRect().left + grandParent.getBoundingClientRect().width / 2,\n\t\tclientY:\n\t\t\tgrandParent.getBoundingClientRect().top + grandParent.getBoundingClientRect().height / 2,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'child:start', 'parent:start', 'grandParent:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\n\t// on second frame there will be no auto scrolling as we have not set up \"over element\"\n\t// auto scrolling\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\n\tfireEvent.dragOver(document.body, {\n\t\tclientX: grandParent.getBoundingClientRect().left + grandParent.getBoundingClientRect().width,\n\t\tclientY: grandParent.getBoundingClientRect().top - 1,\n\t});\n\tunsetElementFromPoint();\n\tunsetElementFromPoint = setElementFromPoint(document.body);\n\n\t// expecting to now scroll both\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\t// grand parent will scroll first as it was registered first\n\texpect(ordered).toEqual(['grandParent:scroll', 'parent:scroll']);\n\tordered.length = 0;\n\n\tisParentScrollingAllowed = false;\n\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual(['grandParent:scroll']);\n\n\tcleanup();\n});\n\nit('should allow later registrations to scroll when an earlier registration has canScroll: () => false', () => {\n\tconst [child, parent, grandParent] = setupNestedScrollContainers([\n\t\t// child\n\t\t{ width: 10000, height: 10000 },\n\t\t// parent\n\t\t{ width: 5000, height: 5000 },\n\t\t// grandparent,\n\t\t{ width: 1000, height: 1000 },\n\t]);\n\n\tconst ordered: string[] = [];\n\tlet isParentScrollingAllowed: boolean = true;\n\n\tconst cleanup = combine(\n\t\tappendToBody(grandParent),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('child:start'),\n\t\t\tonDrop: () => ordered.push('child:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: parent,\n\t\t\tonDragStart: () => ordered.push('parent:start'),\n\t\t\tonDrop: () => ordered.push('parent:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: grandParent,\n\t\t\tonDragStart: () => ordered.push('grandParent:start'),\n\t\t\tonDrop: () => ordered.push('grandParent:drop'),\n\t\t}),\n\t\t// Important for this test: `parent` is registered before `grandParent`.\n\t\t// We are validating that blocking scrolling on `parent` should not stop\n\t\t// the scrolling of `grandParent`.\n\t\tunsafeOverflowAutoScrollForElements({\n\t\t\telement: parent,\n\t\t\tcanScroll: () => isParentScrollingAllowed,\n\t\t\tgetOverflow: () => ({\n\t\t\t\tforTopEdge: {\n\t\t\t\t\tleft: 0,\n\t\t\t\t\tright: 0,\n\t\t\t\t\ttop: 100,\n\t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t\tunsafeOverflowAutoScrollForElements({\n\t\t\telement: grandParent,\n\t\t\tgetOverflow: () => ({\n\t\t\t\tforTopEdge: {\n\t\t\t\t\tleft: 0,\n\t\t\t\t\tright: 0,\n\t\t\t\t\ttop: 100,\n\t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(window, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener: (event) => {\n\t\t\t\tif (event.target === grandParent) {\n\t\t\t\t\tordered.push('grandParent:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (event.target === parent) {\n\t\t\t\t\t// console.log('parent', parent.scrollTop, parent.scrollLeft);\n\t\t\t\t\tordered.push('parent:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tordered.push('unknown:scroll');\n\t\t\t},\n\t\t\t// scroll events do not bubble, so leveraging the capture phase\n\t\t\toptions: { capture: true },\n\t\t}),\n\t);\n\tlet unsetElementFromPoint = setElementFromPoint(child);\n\n\t// Set some initial scroll on the scroll containers\n\t// These are in the range where auto scrolling will occur on both\n\tparent.scrollTop = 60;\n\tgrandParent.scrollTop = 120;\n\n\t// lifting the mid point\n\tuserEvent.lift(child, {\n\t\tclientX:\n\t\t\tgrandParent.getBoundingClientRect().left + grandParent.getBoundingClientRect().width / 2,\n\t\tclientY:\n\t\t\tgrandParent.getBoundingClientRect().top + grandParent.getBoundingClientRect().height / 2,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'child:start', 'parent:start', 'grandParent:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\n\t// on second frame there will be no auto scrolling as we have not set up \"over element\"\n\t// auto scrolling\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\n\tfireEvent.dragOver(document.body, {\n\t\tclientX: grandParent.getBoundingClientRect().left + grandParent.getBoundingClientRect().width,\n\t\tclientY: grandParent.getBoundingClientRect().top - 1,\n\t});\n\tunsetElementFromPoint();\n\tunsetElementFromPoint = setElementFromPoint(document.body);\n\n\t// expecting to now scroll both\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual(['parent:scroll', 'grandParent:scroll']);\n\tordered.length = 0;\n\n\tisParentScrollingAllowed = false;\n\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual(['grandParent:scroll']);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/auto-scroll/__tests__/unit/overflow/cross-axis-hitbox.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport { bind } from 'bind-event-listener';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { unsafeOverflowAutoScrollForElements } from '../../../src/entry-point/unsafe-overflow/element';\nimport { type Axis, type Edge, type Side } from '../../../src/internal-types';\nimport { axisLookup } from '../../../src/shared/axis';\nimport { getInternalConfig } from '../../../src/shared/configuration';\nimport { getOverElementHitbox } from '../../../src/shared/get-over-element-hitbox';\nimport { mainAxisSideLookup } from '../../../src/shared/side';\nimport {\n\tadvanceTimersToNextFrame,\n\tappendToBody,\n\tgetInsidePoints,\n\tgetOutsidePoints,\n\tgetRect,\n\tmainAxisForSide,\n\treset,\n\tsetElementFromPoint,\n\tsetStartSystemTime,\n\tsetupBasicScrollContainer,\n\tstepScrollBy,\n\tuserEvent,\n} from '../_util';\n\n// Using modern timers as it is important that the system clock moves in sync with the frames.\n// We need this as we are keeping track of when a drop target is entered into.\njest.useFakeTimers();\nsetStartSystemTime();\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nbeforeEach(reset);\n\nconst { child, parentScrollContainer } = setupBasicScrollContainer();\nconst defaultConfig = getInternalConfig();\n\nbeforeEach(() => {\n\t// setting some initial scroll so the element\n\t// can be scrolled in any direction\n\tparentScrollContainer.scrollTop = 10;\n\tparentScrollContainer.scrollLeft = 10;\n});\n\ntype Scenario = {\n\tedge: Edge;\n\thitbox: DOMRect;\n};\n\nconst overflowSizeOnMainAxis: number = 100;\nconst overflowSizeOnEachSideOfCrossAxis: number = 200;\n\nconst overflow: Required<\n\tReturnType<Parameters<typeof unsafeOverflowAutoScrollForElements>[0]['getOverflow']>\n> = {\n\tforBottomEdge: {\n\t\tright: overflowSizeOnEachSideOfCrossAxis,\n\t\tleft: overflowSizeOnEachSideOfCrossAxis,\n\t\tbottom: overflowSizeOnMainAxis,\n\t},\n\tforTopEdge: {\n\t\tright: overflowSizeOnEachSideOfCrossAxis,\n\t\tleft: overflowSizeOnEachSideOfCrossAxis,\n\t\ttop: overflowSizeOnMainAxis,\n\t},\n\tforRightEdge: {\n\t\tright: overflowSizeOnMainAxis,\n\t\ttop: overflowSizeOnEachSideOfCrossAxis,\n\t\tbottom: overflowSizeOnEachSideOfCrossAxis,\n\t},\n\tforLeftEdge: {\n\t\tleft: overflowSizeOnMainAxis,\n\t\ttop: overflowSizeOnEachSideOfCrossAxis,\n\t\tbottom: overflowSizeOnEachSideOfCrossAxis,\n\t},\n};\n\nconst parentRect: DOMRect = parentScrollContainer.getBoundingClientRect();\n\nfunction getOverElementMainHitboxSize(edge: Edge) {\n\tconst overElementHitbox = getOverElementHitbox[edge]({\n\t\tclientRect: parentRect,\n\t\tconfig: defaultConfig,\n\t});\n\tconst axis: Axis = mainAxisForSide[edge];\n\tconst { mainAxis } = axisLookup[axis];\n\treturn overElementHitbox[mainAxis.size];\n}\n\nconst scenarios: Scenario[] = [\n\t{\n\t\tedge: 'top',\n\t\thitbox: getRect({\n\t\t\t// Main axis\n\t\t\ttop: parentRect.top - overflowSizeOnMainAxis,\n\t\t\t// pushing down into the element\n\t\t\tbottom: parentRect.top + getOverElementMainHitboxSize('top'),\n\n\t\t\t// Cross axis\n\t\t\tright: parentRect.right + overflowSizeOnEachSideOfCrossAxis,\n\t\t\tleft: parentRect.left - overflowSizeOnEachSideOfCrossAxis,\n\t\t}),\n\t},\n\t{\n\t\tedge: 'bottom',\n\t\thitbox: getRect({\n\t\t\t// Main axis\n\t\t\tbottom: parentRect.bottom + overflowSizeOnMainAxis,\n\t\t\t// pulling up into the element\n\t\t\ttop: parentRect.bottom - getOverElementMainHitboxSize('bottom'),\n\n\t\t\t// Cross axis\n\t\t\tright: parentRect.right + overflowSizeOnEachSideOfCrossAxis,\n\t\t\tleft: parentRect.left - overflowSizeOnEachSideOfCrossAxis,\n\t\t}),\n\t},\n\t{\n\t\tedge: 'left',\n\t\thitbox: getRect({\n\t\t\t// main axis\n\t\t\tleft: parentRect.left - overflowSizeOnMainAxis,\n\t\t\t// push into the element\n\t\t\tright: parentRect.left + getOverElementMainHitboxSize('left'),\n\n\t\t\t// cross axis\n\t\t\ttop: parentRect.top - overflowSizeOnEachSideOfCrossAxis,\n\t\t\tbottom: parentRect.bottom + overflowSizeOnEachSideOfCrossAxis,\n\t\t}),\n\t},\n\t{\n\t\tedge: 'right',\n\t\thitbox: getRect({\n\t\t\t// main axis\n\t\t\tright: parentRect.right + overflowSizeOnMainAxis,\n\t\t\t// pull back into the element\n\t\t\tleft: parentRect.right - getOverElementMainHitboxSize('right'),\n\t\t\t// cross axis\n\t\t\ttop: parentRect.top - overflowSizeOnEachSideOfCrossAxis,\n\t\t\tbottom: parentRect.bottom + overflowSizeOnEachSideOfCrossAxis,\n\t\t}),\n\t},\n];\n\nscenarios.forEach((scenario) => {\n\tconst axis: Axis = mainAxisForSide[scenario.edge];\n\tconst side: Side = mainAxisSideLookup[scenario.edge];\n\tconst mainAxisScrollProperty = axis === 'vertical' ? 'scrollTop' : 'scrollLeft';\n\tconst crossAxisScrollProperty =\n\t\tmainAxisScrollProperty === 'scrollTop' ? 'scrollLeft' : 'scrollTop';\n\n\tdescribe(`Scenario edge: ${scenario.edge}`, () => {\n\t\tgetInsidePoints(scenario.hitbox)\n\t\t\t// We don't want to include the 'center' as that could be\n\t\t\t// over the element, which would not trigger an overflow scroll\n\t\t\t.filter((point) => point.label !== 'center')\n\t\t\t.forEach((point) => {\n\t\t\t\tit(`should scroll the main axis when in the cross axis hitbox for that edge. Point: [${point.label}]`, () => {\n\t\t\t\t\tconst ordered: string[] = [];\n\n\t\t\t\t\tconst cleanup = combine(\n\t\t\t\t\t\tappendToBody(parentScrollContainer),\n\t\t\t\t\t\tdraggable({\n\t\t\t\t\t\t\telement: child,\n\t\t\t\t\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\t\t\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tdropTargetForElements({\n\t\t\t\t\t\t\telement: parentScrollContainer,\n\t\t\t\t\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\t\t\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\t\t\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\t\t\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tunsafeOverflowAutoScrollForElements({\n\t\t\t\t\t\t\telement: parentScrollContainer,\n\t\t\t\t\t\t\tgetOverflow: () => overflow,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tbind(parentScrollContainer, {\n\t\t\t\t\t\t\ttype: 'scroll',\n\t\t\t\t\t\t\tlistener: () => ordered.push(`scroll event`),\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t\tlet unsetElementFromPoint = setElementFromPoint(child);\n\n\t\t\t\t\t// lifting in middle of element, should not trigger auto scrolling\n\t\t\t\t\tuserEvent.lift(child, {\n\t\t\t\t\t\tclientX: parentRect.left + parentRect.width / 2,\n\t\t\t\t\t\tclientY: parentRect.top + parentRect.height / 2,\n\t\t\t\t\t});\n\n\t\t\t\t\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\t\t\t\t\tordered.length = 0;\n\n\t\t\t\t\t// on first frame, there is no auto scroll,\n\t\t\t\t\t// as we don't know what the scroll speed should be\n\t\t\t\t\tadvanceTimersToNextFrame();\n\t\t\t\t\tstepScrollBy();\n\n\t\t\t\t\texpect(ordered).toEqual([]);\n\n\t\t\t\t\t// not expecting auto scrolling on the second frame as we are\n\t\t\t\t\t// over the second of the element\n\t\t\t\t\tadvanceTimersToNextFrame();\n\t\t\t\t\tstepScrollBy();\n\n\t\t\t\t\texpect(ordered).toEqual([]);\n\n\t\t\t\t\t// updating where we are to trigger auto scrolling\n\t\t\t\t\t// we will now be outside the drop target\n\t\t\t\t\tunsetElementFromPoint();\n\t\t\t\t\tunsetElementFromPoint = setElementFromPoint(document.body);\n\t\t\t\t\tfireEvent.dragEnter(document.body, {\n\t\t\t\t\t\tclientX: point.x,\n\t\t\t\t\t\tclientY: point.y,\n\t\t\t\t\t});\n\n\t\t\t\t\texpect(ordered).toEqual(['dropTarget:leave']);\n\t\t\t\t\tordered.length = 0;\n\n\t\t\t\t\t// the drop target changed will be picked up in the next frame\n\t\t\t\t\tconst before = {\n\t\t\t\t\t\tscrollTop: parentScrollContainer.scrollTop,\n\t\t\t\t\t\tscrollLeft: parentScrollContainer.scrollLeft,\n\t\t\t\t\t};\n\t\t\t\t\tadvanceTimersToNextFrame();\n\t\t\t\t\tstepScrollBy();\n\t\t\t\t\tconst after = {\n\t\t\t\t\t\tscrollTop: parentScrollContainer.scrollTop,\n\t\t\t\t\t\tscrollLeft: parentScrollContainer.scrollLeft,\n\t\t\t\t\t};\n\t\t\t\t\t// only a single scroll event occurred\n\t\t\t\t\texpect(ordered).toEqual(['scroll event']);\n\n\t\t\t\t\t// scrolling forward when on the \"end\" edge\n\t\t\t\t\tif (side === 'end') {\n\t\t\t\t\t\texpect(after[mainAxisScrollProperty]).toBeGreaterThan(before[mainAxisScrollProperty]);\n\t\t\t\t\t\t// Should be scrolling backwards on the \"start\" edge\n\t\t\t\t\t} else {\n\t\t\t\t\t\texpect(after[mainAxisScrollProperty]).toBeLessThan(before[mainAxisScrollProperty]);\n\t\t\t\t\t}\n\t\t\t\t\t// scroll axis should not have been scrolled\n\t\t\t\t\texpect(before[crossAxisScrollProperty]).toBe(after[crossAxisScrollProperty]);\n\n\t\t\t\t\tcleanup();\n\t\t\t\t});\n\t\t\t});\n\n\t\tgetOutsidePoints(scenario.hitbox).forEach((point) => {\n\t\t\tit(`should not scroll the main axis when outside cross axis overflow for that edge. Point: [${point.label}]`, () => {\n\t\t\t\tconst ordered: string[] = [];\n\n\t\t\t\tconst fromEdge: ReturnType<\n\t\t\t\t\tParameters<typeof unsafeOverflowAutoScrollForElements>[0]['getOverflow']\n\t\t\t\t> = (() => {\n\t\t\t\t\tif (scenario.edge === 'top') {\n\t\t\t\t\t\treturn { forTopEdge: overflow.forTopEdge };\n\t\t\t\t\t}\n\t\t\t\t\tif (scenario.edge === 'bottom') {\n\t\t\t\t\t\treturn { forBottomEdge: overflow.forBottomEdge };\n\t\t\t\t\t}\n\t\t\t\t\tif (scenario.edge === 'left') {\n\t\t\t\t\t\treturn { forLeftEdge: overflow.forLeftEdge };\n\t\t\t\t\t}\n\t\t\t\t\tif (scenario.edge === 'right') {\n\t\t\t\t\t\treturn { forRightEdge: overflow.forRightEdge };\n\t\t\t\t\t}\n\t\t\t\t\tthrow Error('unhandled');\n\t\t\t\t})();\n\n\t\t\t\tconst cleanup = combine(\n\t\t\t\t\tappendToBody(parentScrollContainer),\n\t\t\t\t\tdraggable({\n\t\t\t\t\t\telement: child,\n\t\t\t\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\t\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t\t\t\t}),\n\t\t\t\t\tdropTargetForElements({\n\t\t\t\t\t\telement: parentScrollContainer,\n\t\t\t\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\t\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\t\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\t\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t\t\t\t}),\n\t\t\t\t\tunsafeOverflowAutoScrollForElements({\n\t\t\t\t\t\telement: parentScrollContainer,\n\t\t\t\t\t\tgetOverflow: () => fromEdge,\n\t\t\t\t\t}),\n\t\t\t\t\tbind(parentScrollContainer, {\n\t\t\t\t\t\ttype: 'scroll',\n\t\t\t\t\t\tlistener: () => ordered.push(`scroll event`),\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\tlet unsetElementFromPoint = setElementFromPoint(child);\n\n\t\t\t\t// lifting in middle of element, should not trigger auto scrolling\n\t\t\t\tuserEvent.lift(child, {\n\t\t\t\t\tclientX: parentRect.left + parentRect.width / 2,\n\t\t\t\t\tclientY: parentRect.top + parentRect.height / 2,\n\t\t\t\t});\n\n\t\t\t\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\t\t\t\tordered.length = 0;\n\n\t\t\t\t// on first frame, there is no auto scroll,\n\t\t\t\t// as we don't know what the scroll speed should be\n\t\t\t\tadvanceTimersToNextFrame();\n\t\t\t\tstepScrollBy();\n\n\t\t\t\texpect(ordered).toEqual([]);\n\n\t\t\t\t// not expecting auto scrolling on the second frame as we are\n\t\t\t\t// over the second of the element\n\t\t\t\tadvanceTimersToNextFrame();\n\t\t\t\tstepScrollBy();\n\n\t\t\t\texpect(ordered).toEqual([]);\n\n\t\t\t\t// updating where we are to trigger auto scrolling\n\t\t\t\t// we will now be outside the drop target\n\t\t\t\tunsetElementFromPoint();\n\t\t\t\tunsetElementFromPoint = setElementFromPoint(document.body);\n\t\t\t\tfireEvent.dragEnter(document.body, {\n\t\t\t\t\tclientX: point.x,\n\t\t\t\t\tclientY: point.y,\n\t\t\t\t});\n\n\t\t\t\texpect(ordered).toEqual(['dropTarget:leave']);\n\t\t\t\tordered.length = 0;\n\n\t\t\t\t// the drop target changed will be picked up in the next frame\n\t\t\t\t// we are expecting no scroll to have occurred\n\t\t\t\tadvanceTimersToNextFrame();\n\t\t\t\tstepScrollBy();\n\t\t\t\texpect(ordered).toEqual([]);\n\n\t\t\t\tcleanup();\n\t\t\t});\n\t\t});\n\t});\n});\n"
  },
  {
    "path": "packages/auto-scroll/__tests__/unit/overflow/main-axis-hitbox.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport { bind } from 'bind-event-listener';\nimport invariant from 'tiny-invariant';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { unsafeOverflowAutoScrollForElements } from '../../../src/entry-point/unsafe-overflow/element';\nimport { type Axis, type Edge, type Side } from '../../../src/internal-types';\nimport { isWithin } from '../../../src/shared/is-within';\nimport { mainAxisSideLookup } from '../../../src/shared/side';\nimport {\n\tadvanceTimersToNextFrame,\n\tappendToBody,\n\tgetInsidePoints,\n\tgetOutsidePoints,\n\tgetRect,\n\tmainAxisForSide,\n\treset,\n\tsetElementFromPoint,\n\tsetStartSystemTime,\n\tsetupBasicScrollContainer,\n\tstepScrollBy,\n\tuserEvent,\n} from '../_util';\n\n// Using modern timers as it is important that the system clock moves in sync with the frames.\n// We need this as we are keeping track of when a drop target is entered into.\njest.useFakeTimers();\nsetStartSystemTime();\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nbeforeEach(reset);\n\nconst { child, parentScrollContainer } = setupBasicScrollContainer();\n\nbeforeEach(() => {\n\t// setting some initial scroll so the element\n\t// can be scrolled in any direction\n\tparentScrollContainer.scrollTop = 10;\n\tparentScrollContainer.scrollLeft = 10;\n});\n\ntype Scenario = {\n\tedge: Edge;\n\thitbox: DOMRect;\n};\n\nconst overflowSizeOnMainAxis: number = 100;\n\nconst overflow: Required<\n\tReturnType<Parameters<typeof unsafeOverflowAutoScrollForElements>[0]['getOverflow']>\n> = {\n\tforBottomEdge: {\n\t\tright: 0,\n\t\tleft: 0,\n\t\tbottom: overflowSizeOnMainAxis,\n\t},\n\tforTopEdge: {\n\t\tright: 0,\n\t\tleft: 0,\n\t\ttop: overflowSizeOnMainAxis,\n\t},\n\tforRightEdge: {\n\t\tright: overflowSizeOnMainAxis,\n\t\ttop: 0,\n\t\tbottom: 0,\n\t},\n\tforLeftEdge: {\n\t\tleft: overflowSizeOnMainAxis,\n\t\ttop: 0,\n\t\tbottom: 0,\n\t},\n};\n\nconst parentRect: DOMRect = parentScrollContainer.getBoundingClientRect();\n\nconst scenarios: Scenario[] = [\n\t{\n\t\tedge: 'top',\n\t\thitbox: getRect({\n\t\t\ttop: parentRect.top - overflowSizeOnMainAxis,\n\t\t\tright: parentRect.right,\n\t\t\t// (the first pixel is \"cut out\" by the \"over element\" auto scroller)\n\t\t\t// bottom: parentRect.top,\n\t\t\tbottom: parentRect.top - 1,\n\t\t\tleft: parentRect.left,\n\t\t}),\n\t},\n\t{\n\t\tedge: 'bottom',\n\t\thitbox: getRect({\n\t\t\t// (the first pixel is \"cut out\" by the \"over element\" auto scroller)\n\t\t\ttop: parentRect.bottom + 1,\n\t\t\tright: parentRect.right,\n\t\t\tbottom: parentRect.bottom + overflowSizeOnMainAxis,\n\t\t\tleft: parentRect.left,\n\t\t}),\n\t},\n\t{\n\t\tedge: 'left',\n\t\thitbox: getRect({\n\t\t\ttop: parentRect.top,\n\t\t\t// (the first pixel is \"cut out\" by the \"over element\" auto scroller)\n\t\t\tright: parentRect.left - 1,\n\t\t\tbottom: parentRect.bottom,\n\t\t\tleft: parentRect.left - overflowSizeOnMainAxis,\n\t\t}),\n\t},\n\t{\n\t\tedge: 'right',\n\t\thitbox: getRect({\n\t\t\ttop: parentRect.top,\n\t\t\tright: parentRect.right + overflowSizeOnMainAxis,\n\t\t\tbottom: parentRect.bottom,\n\t\t\t// (the first pixel is \"cut out\" by the \"over element\" auto scroller)\n\t\t\tleft: parentRect.right + 1,\n\t\t}),\n\t},\n];\n\nscenarios.forEach((scenario) => {\n\tconst axis: Axis = mainAxisForSide[scenario.edge];\n\tconst side: Side = mainAxisSideLookup[scenario.edge];\n\n\tconst mainAxisScrollProperty = axis === 'vertical' ? 'scrollTop' : 'scrollLeft';\n\tconst crossAxisScrollProperty =\n\t\tmainAxisScrollProperty === 'scrollTop' ? 'scrollLeft' : 'scrollTop';\n\n\tdescribe(`Scenario edge: ${scenario.edge}`, () => {\n\t\tgetInsidePoints(scenario.hitbox).forEach((point) => {\n\t\t\tit(`should scroll when in the main axis overflow. Point: [${point.label}]`, () => {\n\t\t\t\tconst ordered: string[] = [];\n\n\t\t\t\tconst cleanup = combine(\n\t\t\t\t\tappendToBody(parentScrollContainer),\n\t\t\t\t\tdraggable({\n\t\t\t\t\t\telement: child,\n\t\t\t\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\t\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t\t\t\t}),\n\t\t\t\t\tdropTargetForElements({\n\t\t\t\t\t\telement: parentScrollContainer,\n\t\t\t\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\t\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\t\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\t\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t\t\t\t}),\n\t\t\t\t\tunsafeOverflowAutoScrollForElements({\n\t\t\t\t\t\telement: parentScrollContainer,\n\t\t\t\t\t\tgetOverflow: () => overflow,\n\t\t\t\t\t}),\n\t\t\t\t\tbind(parentScrollContainer, {\n\t\t\t\t\t\ttype: 'scroll',\n\t\t\t\t\t\tlistener: () => ordered.push(`scroll event`),\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\tlet unsetElementFromPoint = setElementFromPoint(child);\n\n\t\t\t\t// lifting in middle of element, should not trigger auto scrolling\n\t\t\t\tuserEvent.lift(child, {\n\t\t\t\t\tclientX: parentRect.left + parentRect.width / 2,\n\t\t\t\t\tclientY: parentRect.top + parentRect.height / 2,\n\t\t\t\t});\n\n\t\t\t\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\t\t\t\tordered.length = 0;\n\n\t\t\t\t// on first frame, there is no auto scroll,\n\t\t\t\t// as we don't know what the scroll speed should be\n\t\t\t\tadvanceTimersToNextFrame();\n\t\t\t\tstepScrollBy();\n\n\t\t\t\texpect(ordered).toEqual([]);\n\n\t\t\t\t// not expecting auto scrolling on the second frame as we are\n\t\t\t\t// over the second of the element\n\t\t\t\tadvanceTimersToNextFrame();\n\t\t\t\tstepScrollBy();\n\n\t\t\t\texpect(ordered).toEqual([]);\n\n\t\t\t\t// updating where we are to trigger auto scrolling\n\t\t\t\t// we will now be outside the drop target\n\t\t\t\tunsetElementFromPoint();\n\t\t\t\tunsetElementFromPoint = setElementFromPoint(document.body);\n\t\t\t\tfireEvent.dragEnter(document.body, {\n\t\t\t\t\tclientX: point.x,\n\t\t\t\t\tclientY: point.y,\n\t\t\t\t});\n\n\t\t\t\texpect(ordered).toEqual(['dropTarget:leave']);\n\t\t\t\tordered.length = 0;\n\n\t\t\t\t// the drop target changed will be picked up in the next frame\n\t\t\t\tconst before = {\n\t\t\t\t\tscrollTop: parentScrollContainer.scrollTop,\n\t\t\t\t\tscrollLeft: parentScrollContainer.scrollLeft,\n\t\t\t\t};\n\t\t\t\tadvanceTimersToNextFrame();\n\t\t\t\tstepScrollBy();\n\t\t\t\tconst after = {\n\t\t\t\t\tscrollTop: parentScrollContainer.scrollTop,\n\t\t\t\t\tscrollLeft: parentScrollContainer.scrollLeft,\n\t\t\t\t};\n\n\t\t\t\t// scrolling forward when on the \"end\" edge\n\t\t\t\tif (side === 'end') {\n\t\t\t\t\texpect(after[mainAxisScrollProperty]).toBeGreaterThan(before[mainAxisScrollProperty]);\n\t\t\t\t\t// Should be scrolling backwards on the \"start\" edge\n\t\t\t\t} else {\n\t\t\t\t\texpect(after[mainAxisScrollProperty]).toBeLessThan(before[mainAxisScrollProperty]);\n\t\t\t\t}\n\t\t\t\t// scroll axis should not have been scrolled\n\t\t\t\texpect(before[crossAxisScrollProperty]).toBe(after[crossAxisScrollProperty]);\n\t\t\t\t// only a single scroll event occurred\n\t\t\t\texpect(ordered).toEqual(['scroll event']);\n\n\t\t\t\tcleanup();\n\t\t\t});\n\t\t});\n\n\t\t// need to exclude points that would be over the main parent rect and would usually\n\t\t// be excluded by our `elementFromPoint()` check.\n\t\tconst relevantOutsidePoints = getOutsidePoints(scenario.hitbox).filter((point) => {\n\t\t\tconst isOverParent = isWithin({\n\t\t\t\tclient: point,\n\t\t\t\tclientRect: parentRect,\n\t\t\t});\n\t\t\treturn !isOverParent;\n\t\t});\n\t\tinvariant(relevantOutsidePoints.length > 1);\n\n\t\trelevantOutsidePoints.forEach((point) => {\n\t\t\tit(`should not scroll when outside the main axis overflow. Point: [${point.label}]`, () => {\n\t\t\t\tconst ordered: string[] = [];\n\n\t\t\t\tconst cleanup = combine(\n\t\t\t\t\tappendToBody(parentScrollContainer),\n\t\t\t\t\tdraggable({\n\t\t\t\t\t\telement: child,\n\t\t\t\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\t\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t\t\t\t}),\n\t\t\t\t\tdropTargetForElements({\n\t\t\t\t\t\telement: parentScrollContainer,\n\t\t\t\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\t\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\t\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\t\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t\t\t\t}),\n\t\t\t\t\tunsafeOverflowAutoScrollForElements({\n\t\t\t\t\t\telement: parentScrollContainer,\n\t\t\t\t\t\tgetOverflow: () => overflow,\n\t\t\t\t\t}),\n\t\t\t\t\tbind(parentScrollContainer, {\n\t\t\t\t\t\ttype: 'scroll',\n\t\t\t\t\t\tlistener: () => ordered.push(`scroll event`),\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t\tlet unsetElementFromPoint = setElementFromPoint(child);\n\n\t\t\t\t// lifting in middle of element, should not trigger auto scrolling\n\t\t\t\tuserEvent.lift(child, {\n\t\t\t\t\tclientX: parentRect.left + parentRect.width / 2,\n\t\t\t\t\tclientY: parentRect.top + parentRect.height / 2,\n\t\t\t\t});\n\n\t\t\t\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\t\t\t\tordered.length = 0;\n\n\t\t\t\t// on first frame, there is no auto scroll,\n\t\t\t\t// as we don't know what the scroll speed should be\n\t\t\t\tadvanceTimersToNextFrame();\n\t\t\t\tstepScrollBy();\n\n\t\t\t\texpect(ordered).toEqual([]);\n\n\t\t\t\t// not expecting auto scrolling on the second frame as we are\n\t\t\t\t// over the second of the element\n\t\t\t\tadvanceTimersToNextFrame();\n\t\t\t\tstepScrollBy();\n\n\t\t\t\texpect(ordered).toEqual([]);\n\n\t\t\t\t// updating where we are to trigger auto scrolling\n\t\t\t\t// we will now be outside the drop target\n\t\t\t\tunsetElementFromPoint();\n\t\t\t\tunsetElementFromPoint = setElementFromPoint(document.body);\n\t\t\t\tfireEvent.dragEnter(document.body, {\n\t\t\t\t\tclientX: point.x,\n\t\t\t\t\tclientY: point.y,\n\t\t\t\t});\n\n\t\t\t\texpect(ordered).toEqual(['dropTarget:leave']);\n\t\t\t\tordered.length = 0;\n\n\t\t\t\t// the drop target changed will be picked up in the next frame\n\t\t\t\t// we are expecting no scroll to have occurred\n\t\t\t\tadvanceTimersToNextFrame();\n\t\t\t\tstepScrollBy();\n\t\t\t\texpect(ordered).toEqual([]);\n\n\t\t\t\tcleanup();\n\t\t\t});\n\t\t});\n\t});\n});\n"
  },
  {
    "path": "packages/auto-scroll/__tests__/unit/overflow/nested-elements.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport { bind } from 'bind-event-listener';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { type Position } from '@atlaskit/pragmatic-drag-and-drop/types';\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { unsafeOverflowAutoScrollForElements } from '../../../src/entry-point/unsafe-overflow/element';\nimport { isWithin } from '../../../src/shared/is-within';\nimport {\n\tadvanceTimersToNextFrame,\n\tappendToBody,\n\treset,\n\tsetElementFromPoint,\n\tsetStartSystemTime,\n\tsetupNestedScrollContainers,\n\tstepScrollBy,\n\tuserEvent,\n} from '../_util';\n\n// Using modern timers as it is important that the system clock moves in sync with the frames.\n// We need this as we are keeping track of when a drop target is entered into.\njest.useFakeTimers();\nsetStartSystemTime();\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nbeforeEach(reset);\n\ntest('a parent should allow a child to be overflow scrolled (when the parent is registered before the child)', () => {\n\tconst [child, parent, grandParent] = setupNestedScrollContainers([\n\t\t// child\n\t\t{ width: 10000, height: 10000 },\n\t\t// parent\n\t\t// We are making space above the the `parent` so\n\t\t// that it can have overflow scrolling inside of the `grandParent`.\n\t\t// We want to check that the `grandParent` does not block\n\t\t// auto scrolling of it's children\n\t\t{ width: 5000, height: 5000, x: 0, y: 10 },\n\t\t// grandparent,\n\t\t{ width: 1000, height: 1000 },\n\t]);\n\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(grandParent),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('child:start'),\n\t\t\tonDrop: () => ordered.push('child:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: parent,\n\t\t\tonDragStart: () => ordered.push('parent:start'),\n\t\t\tonDrop: () => ordered.push('parent:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: grandParent,\n\t\t\tonDragStart: () => ordered.push('grandParent:start'),\n\t\t\tonDrop: () => ordered.push('grandParent:drop'),\n\t\t}),\n\t\t// Registering the `grandParent` first.\n\t\t// We are testing that when `grandParent` cannot be scrolled,\n\t\t// `parent` still can be.\n\t\tunsafeOverflowAutoScrollForElements({\n\t\t\telement: grandParent,\n\t\t\tgetOverflow: () => ({\n\t\t\t\tforTopEdge: {\n\t\t\t\t\tleft: 0,\n\t\t\t\t\tright: 0,\n\t\t\t\t\ttop: 100,\n\t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t\tunsafeOverflowAutoScrollForElements({\n\t\t\telement: parent,\n\t\t\tgetOverflow: () => ({\n\t\t\t\tforTopEdge: {\n\t\t\t\t\tleft: 0,\n\t\t\t\t\tright: 0,\n\t\t\t\t\ttop: 100,\n\t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(window, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener: (event) => {\n\t\t\t\tif (event.target === grandParent) {\n\t\t\t\t\tordered.push('grandParent:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (event.target === parent) {\n\t\t\t\t\t// console.log('parent', parent.scrollTop, parent.scrollLeft);\n\t\t\t\t\tordered.push('parent:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tordered.push('unknown:scroll');\n\t\t\t},\n\t\t\t// scroll events do not bubble, so leveraging the capture phase\n\t\t\toptions: { capture: true },\n\t\t}),\n\t);\n\tlet unsetElementFromPoint = setElementFromPoint(child);\n\n\t// Set some initial scroll on the scroll containers\n\t// These are in the range where auto scrolling will occur on both\n\tparent.scrollTop = 2;\n\tgrandParent.scrollTop = 2;\n\n\t// lifting the mid point visible area\n\tuserEvent.lift(child, {\n\t\tclientX:\n\t\t\tgrandParent.getBoundingClientRect().left + grandParent.getBoundingClientRect().width / 2,\n\t\tclientY:\n\t\t\tgrandParent.getBoundingClientRect().top + grandParent.getBoundingClientRect().height / 2,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'child:start', 'parent:start', 'grandParent:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\n\t// on second frame there will be no auto scrolling as we have not set up \"over element\"\n\t// auto scrolling\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\n\tconst aboveParent: Position = {\n\t\tx: grandParent.getBoundingClientRect().left + grandParent.getBoundingClientRect().width / 2,\n\t\t// over grandParent, but in the overflow scroll area of parent\n\t\ty: grandParent.getBoundingClientRect().top + 2,\n\t};\n\n\t// validating our point is where we expect\n\texpect(\n\t\tisWithin({\n\t\t\tclient: aboveParent,\n\t\t\tclientRect: grandParent.getBoundingClientRect(),\n\t\t}),\n\t).toBe(true);\n\texpect(\n\t\tisWithin({\n\t\t\tclient: aboveParent,\n\t\t\tclientRect: parent.getBoundingClientRect(),\n\t\t}),\n\t).toBe(false);\n\n\t// moving above parent sibling\n\tfireEvent.dragOver(grandParent, {\n\t\tclientX: aboveParent.x,\n\t\tclientY: aboveParent.y,\n\t});\n\tunsetElementFromPoint();\n\tunsetElementFromPoint = setElementFromPoint(grandParent);\n\n\t// now expecting just the parent to scroll\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual(['parent:scroll']);\n\tordered.length = 0;\n\n\tcleanup();\n});\n\ntest('a parent should allow a child to be overflow scrolled (when the parent is registered after the child)', () => {\n\tconst [child, parent, grandParent] = setupNestedScrollContainers([\n\t\t// child\n\t\t{ width: 10000, height: 10000 },\n\t\t// parent\n\t\t// We are making space above the the `parent` so\n\t\t// that it can have overflow scrolling inside of the `grandParent`.\n\t\t// We want to check that the `grandParent` does not block\n\t\t// auto scrolling of it's children\n\t\t{ width: 5000, height: 5000, x: 0, y: 10 },\n\t\t// grandparent,\n\t\t{ width: 1000, height: 1000 },\n\t]);\n\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(grandParent),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('child:start'),\n\t\t\tonDrop: () => ordered.push('child:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: parent,\n\t\t\tonDragStart: () => ordered.push('parent:start'),\n\t\t\tonDrop: () => ordered.push('parent:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: grandParent,\n\t\t\tonDragStart: () => ordered.push('grandParent:start'),\n\t\t\tonDrop: () => ordered.push('grandParent:drop'),\n\t\t}),\n\t\t// Registering the `parent` first.\n\t\t// We are testing that when `grandParent` cannot be scrolled,\n\t\t// `parent` still can be.\n\t\tunsafeOverflowAutoScrollForElements({\n\t\t\telement: parent,\n\t\t\tgetOverflow: () => ({\n\t\t\t\tforTopEdge: {\n\t\t\t\t\tleft: 0,\n\t\t\t\t\tright: 0,\n\t\t\t\t\ttop: 100,\n\t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t\tunsafeOverflowAutoScrollForElements({\n\t\t\telement: grandParent,\n\t\t\tgetOverflow: () => ({\n\t\t\t\tforTopEdge: {\n\t\t\t\t\tleft: 0,\n\t\t\t\t\tright: 0,\n\t\t\t\t\ttop: 100,\n\t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(window, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener: (event) => {\n\t\t\t\tif (event.target === grandParent) {\n\t\t\t\t\tordered.push('grandParent:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tif (event.target === parent) {\n\t\t\t\t\t// console.log('parent', parent.scrollTop, parent.scrollLeft);\n\t\t\t\t\tordered.push('parent:scroll');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tordered.push('unknown:scroll');\n\t\t\t},\n\t\t\t// scroll events do not bubble, so leveraging the capture phase\n\t\t\toptions: { capture: true },\n\t\t}),\n\t);\n\tlet unsetElementFromPoint = setElementFromPoint(child);\n\n\t// Set some initial scroll on the scroll containers\n\t// These are in the range where auto scrolling will occur on both\n\tparent.scrollTop = 2;\n\tgrandParent.scrollTop = 2;\n\n\t// lifting the mid point visible area\n\tuserEvent.lift(child, {\n\t\tclientX:\n\t\t\tgrandParent.getBoundingClientRect().left + grandParent.getBoundingClientRect().width / 2,\n\t\tclientY:\n\t\t\tgrandParent.getBoundingClientRect().top + grandParent.getBoundingClientRect().height / 2,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'child:start', 'parent:start', 'grandParent:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\n\t// on second frame there will be no auto scrolling as we have not set up \"over element\"\n\t// auto scrolling\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\n\tconst aboveParent: Position = {\n\t\tx: grandParent.getBoundingClientRect().left + grandParent.getBoundingClientRect().width / 2,\n\t\t// over grandParent, but in the overflow scroll area of parent\n\t\ty: grandParent.getBoundingClientRect().top + 2,\n\t};\n\n\t// validating our point is where we expect\n\texpect(\n\t\tisWithin({\n\t\t\tclient: aboveParent,\n\t\t\tclientRect: grandParent.getBoundingClientRect(),\n\t\t}),\n\t).toBe(true);\n\texpect(\n\t\tisWithin({\n\t\t\tclient: aboveParent,\n\t\t\tclientRect: parent.getBoundingClientRect(),\n\t\t}),\n\t).toBe(false);\n\n\t// moving above parent sibling\n\tfireEvent.dragOver(grandParent, {\n\t\tclientX: aboveParent.x,\n\t\tclientY: aboveParent.y,\n\t});\n\tunsetElementFromPoint();\n\tunsetElementFromPoint = setElementFromPoint(grandParent);\n\n\t// now expecting just the parent to scroll\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual(['parent:scroll']);\n\tordered.length = 0;\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/auto-scroll/__tests__/unit/overflow/over-element-should-not-scroll.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport { bind } from 'bind-event-listener';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { unsafeOverflowAutoScrollForElements } from '../../../src/entry-point/unsafe-overflow/element';\nimport { getInternalConfig } from '../../../src/shared/configuration';\nimport {\n\tadvanceTimersToNextFrame,\n\tappendToBody,\n\tgetInsidePoints,\n\treset,\n\tsetElementFromPoint,\n\tsetStartSystemTime,\n\tsetupBasicScrollContainer,\n\tstepScrollBy,\n\tuserEvent,\n} from '../_util';\n\n// Using modern timers as it is important that the system clock moves in sync with the frames.\n// We need this as we are keeping track of when a drop target is entered into.\njest.useFakeTimers();\nsetStartSystemTime();\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nbeforeEach(reset);\n\nconst { child, parentScrollContainer } = setupBasicScrollContainer();\n\nbeforeEach(() => {\n\tparentScrollContainer.scrollTop = 0;\n\tparentScrollContainer.scrollLeft = 0;\n});\n\nconst defaultConfig = getInternalConfig();\n\ngetInsidePoints(parentScrollContainer.getBoundingClientRect()).forEach((point) => {\n\tit(`should not scroll an element when over an element [${point.label}]`, () => {\n\t\tconst ordered: string[] = [];\n\n\t\tconst cleanup = combine(\n\t\t\tappendToBody(parentScrollContainer),\n\t\t\tsetElementFromPoint(child),\n\t\t\tdraggable({\n\t\t\t\telement: child,\n\t\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement: child,\n\t\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t\t}),\n\t\t\tunsafeOverflowAutoScrollForElements({\n\t\t\t\telement: parentScrollContainer,\n\t\t\t\tgetOverflow: () => ({\n\t\t\t\t\tforTopEdge: {\n\t\t\t\t\t\ttop: 10000,\n\t\t\t\t\t\tleft: 10000,\n\t\t\t\t\t\tright: 1000,\n\t\t\t\t\t},\n\t\t\t\t\tforRightEdge: {\n\t\t\t\t\t\ttop: 10000,\n\t\t\t\t\t\tbottom: 10000,\n\t\t\t\t\t\tright: 10000,\n\t\t\t\t\t},\n\t\t\t\t\tforBottomEdge: {\n\t\t\t\t\t\tright: 10000,\n\t\t\t\t\t\tbottom: 10000,\n\t\t\t\t\t\tleft: 10000,\n\t\t\t\t\t},\n\t\t\t\t\tforLeftEdge: {\n\t\t\t\t\t\ttop: 10000,\n\t\t\t\t\t\tbottom: 10000,\n\t\t\t\t\t\tleft: 10000,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t}),\n\t\t\tbind(parentScrollContainer, {\n\t\t\t\ttype: 'scroll',\n\t\t\t\tlistener() {\n\t\t\t\t\tordered.push(`scroll event`);\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\n\t\t// setting some initial scroll\n\t\tparentScrollContainer.scrollLeft = 100;\n\t\tparentScrollContainer.scrollTop = 100;\n\n\t\t// lifting in middle of element, should not trigger auto scrolling\n\t\tuserEvent.lift(child, {\n\t\t\tclientX:\n\t\t\t\tparentScrollContainer.getBoundingClientRect().left +\n\t\t\t\tparentScrollContainer.getBoundingClientRect().width / 2,\n\t\t\tclientY:\n\t\t\t\tparentScrollContainer.getBoundingClientRect().top +\n\t\t\t\tparentScrollContainer.getBoundingClientRect().height / 2,\n\t\t});\n\n\t\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\t\tordered.length = 0;\n\n\t\t// on first frame, there is no auto scroll,\n\t\t// as we don't know what the scroll speed should be\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\n\t\texpect(ordered).toEqual([]);\n\n\t\t// not expecting auto scrolling on the second frame as we are\n\t\t// over the second of the element\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\n\t\texpect(ordered).toEqual([]);\n\n\t\t// updating where we are\n\t\tfireEvent.dragOver(child, point);\n\n\t\t// update won't be picked up until after the next frame\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\t\texpect(ordered).toEqual([]);\n\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\t\texpect(ordered).toEqual([]);\n\n\t\t// just being safe and checking nothing will happen\n\t\tjest.advanceTimersByTime(defaultConfig.timeDampeningDurationMs);\n\t\texpect(ordered).toEqual([]);\n\n\t\tcleanup();\n\t});\n});\n\n// TODO: outside edge on main axis\n// TODO: inside edge on main axis (but outside of the element)\n"
  },
  {
    "path": "packages/auto-scroll/__tests__/unit/overflow/provided-hitbox-spacing-type.spec.ts",
    "content": "import { type unsafeOverflowAutoScrollForElements } from '../../../src/entry-point/unsafe-overflow/element';\n\nconst isEqual = <T>(a: T): void => {\n\texpect(true).toBe(true);\n};\n\ntype GetOverflowFn = Parameters<typeof unsafeOverflowAutoScrollForElements>[0]['getOverflow'];\ntype ProvidedHitboxSpacing = ReturnType<GetOverflowFn>;\n\nit('should allow to main axis edge', () => {\n\tisEqual<ProvidedHitboxSpacing>({ forTopEdge: { top: 5 } });\n\tisEqual<ProvidedHitboxSpacing>({ forRightEdge: { right: 5 } });\n\tisEqual<ProvidedHitboxSpacing>({ forBottomEdge: { bottom: 5 } });\n\tisEqual<ProvidedHitboxSpacing>({ forLeftEdge: { left: 5 } });\n});\n\nit('should allow cross axis definitions', () => {\n\tisEqual<ProvidedHitboxSpacing>({ forTopEdge: { top: 100, left: 2, right: 3 } });\n\tisEqual<ProvidedHitboxSpacing>({ forRightEdge: { right: 100, top: 2, bottom: 3 } });\n\tisEqual<ProvidedHitboxSpacing>({ forBottomEdge: { bottom: 100, left: 2, right: 3 } });\n\tisEqual<ProvidedHitboxSpacing>({ forLeftEdge: { left: 100, top: 2, bottom: 3 } });\n});\n\nit('should not allow stretching back into the element', () => {\n\t// @ts-expect-error\n\tisEqual<ProvidedHitboxSpacing>({ forTopEdge: { top: 100, bottom: 10 } });\n\t// @ts-expect-error\n\tisEqual<ProvidedHitboxSpacing>({ forRightEdge: { right: 100, left: 2 } });\n\t// @ts-expect-error\n\tisEqual<ProvidedHitboxSpacing>({ forBottomEdge: { bottom: 100, top: 3 } });\n\t// @ts-expect-error\n\tisEqual<ProvidedHitboxSpacing>({ forLeftEdge: { left: 100, right: 4 } });\n});\n"
  },
  {
    "path": "packages/auto-scroll/__tests__/unit/shared/_util.ts",
    "content": "import invariant from 'tiny-invariant';\n\nconst honeyPotSelector = '[data-pdnd-honey-pot]';\n\nexport function findHoneyPot(): Element | null {\n\treturn document.querySelector(honeyPotSelector);\n}\n\nexport function getHoneyPot(): HTMLElement {\n\tconst possible = document.querySelectorAll(honeyPotSelector);\n\tinvariant(possible.length !== 0, `No honey pot element found`);\n\tinvariant(possible.length === 1, `Multiple honey pot elements found (expected 1)`);\n\n\tconst [element] = possible;\n\tinvariant(element instanceof HTMLElement, 'Honey pot is not a HTMLElement');\n\treturn element;\n}\n"
  },
  {
    "path": "packages/auto-scroll/__tests__/unit/shared/async-loading.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport { bind } from 'bind-event-listener';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nimport {\n\tadvanceTimersToNextFrame,\n\tappendToBody,\n\treset,\n\tsetElementFromPoint,\n\tsetStartSystemTime,\n\tsetupBasicScrollContainer,\n\tstepScrollBy,\n\tuserEvent,\n} from '../_util';\n\n// Using modern timers as it is important that the system clock moves in sync with the frames.\n// We need this as we are keeping track of when a drop target is entered into.\njest.useFakeTimers();\nsetStartSystemTime();\n\nbeforeEach(reset);\n\nit('should start auto scrolling if imported after a drag has started', async () => {\n\tconst { child, parentScrollContainer } = setupBasicScrollContainer();\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(parentScrollContainer),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tsetElementFromPoint(child),\n\t\tbind(parentScrollContainer, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener: () => ordered.push('scroll event'),\n\t\t}),\n\t);\n\n\tconst onCenterBottom = {\n\t\tclientX:\n\t\t\tparentScrollContainer.getBoundingClientRect().left +\n\t\t\tparentScrollContainer.getBoundingClientRect().width / 2,\n\t\tclientY: parentScrollContainer.getBoundingClientRect().bottom,\n\t};\n\n\t// lifting on mid bottom\n\tuserEvent.lift(child, onCenterBottom);\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame: no scroll would occur as we are waiting to know the frame duration\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\texpect(ordered).toEqual([]);\n\n\t// on first frame: no scroll as we are not registered for auto scrolling\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\texpect(ordered).toEqual([]);\n\n\t// just being safe and checking nothing is pending\n\tfireEvent.dragOver(child, onCenterBottom);\n\tjest.advanceTimersByTime(1000);\n\texpect(ordered).toEqual([]);\n\n\t// Okay, let's load in our auto scroller\n\t// eslint-disable-next-line import/dynamic-import-chunkname\n\tconst { autoScrollForElements } = await import('../../../src/entry-point/element');\n\n\tconst unbindAutoScrolling = autoScrollForElements({\n\t\telement: parentScrollContainer,\n\t});\n\n\t// triggering a \"dragover\" event with no input changes\n\t// this is need for the monitor \"onDrag\" function to fire\n\tfireEvent.dragOver(child, onCenterBottom);\n\n\t// first frame: waiting for scheduled `dragOver` event to be released in \"onDrag\"\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\texpect(ordered).toEqual([]);\n\n\t// second frame: waiting for a first frame to finish to know our frame duration\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\texpect(ordered).toEqual([]);\n\n\t// third frame: we should get an auto scroll\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\texpect(ordered).toEqual(['scroll event']);\n\n\tunbindAutoScrolling();\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/auto-scroll/__tests__/unit/shared/ignore-honey-pot.spec.ts",
    "content": "import { bind } from 'bind-event-listener';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nimport { autoScrollForElements } from '../../../src/entry-point/element';\nimport {\n\tadvanceTimersToNextFrame,\n\tappendToBody,\n\tgetBubbleOrderedPath,\n\treset,\n\tsetElementFromPoint,\n\tsetElementFromPointWithPath,\n\tsetStartSystemTime,\n\tsetupBasicScrollContainer,\n\tstepScrollBy,\n\tuserEvent,\n} from '../_util';\n\nimport { getHoneyPot } from './_util';\n\njest.useFakeTimers();\nsetStartSystemTime();\n\nafterEach(reset);\n\nit('should not consider the honey pot when looking up the element the user is over', () => {\n\tconst { child, parentScrollContainer } = setupBasicScrollContainer();\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tsetElementFromPoint(child),\n\t\tappendToBody(parentScrollContainer),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: parentScrollContainer,\n\t\t}),\n\t\tbind(parentScrollContainer, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener() {\n\t\t\t\tordered.push(\n\t\t\t\t\t`scroll event {scrollLeft: ${parentScrollContainer.scrollLeft}, scrollTop: ${parentScrollContainer.scrollTop}}`,\n\t\t\t\t);\n\t\t\t},\n\t\t}),\n\t);\n\n\t// Scroll container is now looking over the center of the element\n\tparentScrollContainer.scrollTop = 500;\n\tparentScrollContainer.scrollLeft = 500;\n\n\tuserEvent.lift(child, { clientX: 1, clientY: 1 });\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\tconst honeyPot = getHoneyPot();\n\tconst path = getBubbleOrderedPath([honeyPot, child, parentScrollContainer]);\n\tconst cleanupElementFrom = setElementFromPointWithPath(path);\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\texpect(ordered).toEqual([]);\n\n\t// Second frame: an auto scroll will occur\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\t// Scroll backwards on both axis by 1px\n\texpect(ordered).toEqual(['scroll event {scrollLeft: 499, scrollTop: 499}']);\n\n\tcleanup();\n\tcleanupElementFrom();\n});\n"
  },
  {
    "path": "packages/auto-scroll/__tests__/unit/shared/monitor-binding.spec.ts",
    "content": "import { reset, setStartSystemTime, setupNestedScrollContainers } from '../_util';\n\n// Using modern timers as it is important that the system clock moves in sync with the frames.\n// We need this as we are keeping track of when a drop target is entered into.\njest.useFakeTimers();\nsetStartSystemTime();\n\nbeforeEach(reset);\n\nit('should share a single monitor binding between imports', () => {\n\tjest.isolateModules(() => {\n\t\tjest.mock('@atlaskit/pragmatic-drag-and-drop/element/adapter');\n\n\t\tconst { monitorForElements } = require('@atlaskit/pragmatic-drag-and-drop/element/adapter');\n\t\tconst { combine } = require('@atlaskit/pragmatic-drag-and-drop/combine');\n\n\t\tconst [_, parent, grandParent] = setupNestedScrollContainers([\n\t\t\t{ width: 10000, height: 10000 },\n\t\t\t{ width: 5000, height: 5000 },\n\t\t\t{ width: 2000, height: 2000 },\n\t\t]);\n\t\texpect(monitorForElements).not.toHaveBeenCalled();\n\n\t\t// first import will cause the monitor to be bound to\n\t\tconst {\n\t\t\tautoScrollForElements: autoScrollForElements1,\n\t\t} = require('../../../src/entry-point/element');\n\t\texpect(monitorForElements).toHaveBeenCalledTimes(1);\n\n\t\t// second import will not cause another monitor binding\n\t\tconst {\n\t\t\tautoScrollForElements: autoScrollForElements2,\n\t\t} = require('../../../src/entry-point/element');\n\t\texpect(monitorForElements).toHaveBeenCalledTimes(1);\n\n\t\t// registration will not cause another monitor binding;\n\t\tconst unbind = combine(\n\t\t\tautoScrollForElements1({\n\t\t\t\telement: grandParent,\n\t\t\t}),\n\t\t\tautoScrollForElements2({\n\t\t\t\telement: parent,\n\t\t\t}),\n\t\t);\n\t\texpect(monitorForElements).toHaveBeenCalledTimes(1);\n\n\t\tunbind();\n\t});\n});\n\nit('should share a monitor binding between standard and overflow scrolling', () => {\n\tjest.isolateModules(() => {\n\t\tjest.mock('@atlaskit/pragmatic-drag-and-drop/element/adapter');\n\n\t\tconst { monitorForElements } = require('@atlaskit/pragmatic-drag-and-drop/element/adapter');\n\t\tconst { combine } = require('@atlaskit/pragmatic-drag-and-drop/combine');\n\n\t\tconst [_, parent, grandParent] = setupNestedScrollContainers([\n\t\t\t{ width: 10000, height: 10000 },\n\t\t\t{ width: 5000, height: 5000 },\n\t\t\t{ width: 2000, height: 2000 },\n\t\t]);\n\t\texpect(monitorForElements).not.toHaveBeenCalled();\n\n\t\t// first import will cause the monitor to be bound to\n\t\tconst { autoScrollForElements } = require('../../../src/entry-point/element');\n\t\texpect(monitorForElements).toHaveBeenCalledTimes(1);\n\t\tconst {\n\t\t\tunsafeOverflowAutoScrollForElements,\n\t\t} = require('../../../src/entry-point/unsafe-overflow/element');\n\t\texpect(monitorForElements).toHaveBeenCalledTimes(1);\n\n\t\t// registration will not cause another monitor binding;\n\t\tconst unbind = combine(\n\t\t\tautoScrollForElements({\n\t\t\t\telement: grandParent,\n\t\t\t}),\n\t\t\tunsafeOverflowAutoScrollForElements({\n\t\t\t\telement: parent,\n\t\t\t}),\n\t\t);\n\t\texpect(monitorForElements).toHaveBeenCalledTimes(1);\n\n\t\tunbind();\n\t});\n});\n"
  },
  {
    "path": "packages/auto-scroll/__tests__/unit/shared/time-dampening-handover.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport { bind } from 'bind-event-listener';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { type Position } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport { autoScrollForElements } from '../../../src/entry-point/element';\nimport { unsafeOverflowAutoScrollForElements } from '../../../src/entry-point/unsafe-overflow/element';\nimport { getInternalConfig } from '../../../src/shared/configuration';\nimport {\n\tadvanceTimersToNextFrame,\n\tappendToBody,\n\treset,\n\tsetElementFromPoint,\n\tsetStartSystemTime,\n\tsetupBasicScrollContainer,\n\tstepScrollBy,\n\tuserEvent,\n} from '../_util';\n\n// Using modern timers as it is important that the system clock moves in sync with the frames.\n// We need this as we are keeping track of when a drop target is entered into.\njest.useFakeTimers();\nsetStartSystemTime();\n\nbeforeEach(reset);\n\nconst defaultConfig = getInternalConfig();\nconst maxScrollPerFrame = defaultConfig.maxPixelScrollPerSecond / 60;\n\nit('should dampen the acceleration of auto scrolling [new drag] - up', () => {\n\tconst { parentScrollContainer, child } = setupBasicScrollContainer();\n\tconst ordered: string[] = [];\n\tconst scrollHistory: number[] = [parentScrollContainer.scrollTop];\n\n\tlet unsetElementAtPoint = setElementFromPoint(child);\n\tconst cleanup = combine(\n\t\tappendToBody(parentScrollContainer),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: parentScrollContainer,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t}),\n\t\tautoScrollForElements({\n\t\t\telement: parentScrollContainer,\n\t\t}),\n\t\tunsafeOverflowAutoScrollForElements({\n\t\t\telement: parentScrollContainer,\n\t\t\tgetOverflow: () => ({\n\t\t\t\tforBottomEdge: {\n\t\t\t\t\tbottom: 1000,\n\t\t\t\t\tleft: 0,\n\t\t\t\t\tright: 0,\n\t\t\t\t},\n\t\t\t}),\n\t\t}),\n\t\tbind(parentScrollContainer, {\n\t\t\ttype: 'scroll',\n\t\t\tlistener() {\n\t\t\t\tordered.push(`scroll event`);\n\t\t\t\tscrollHistory.push(parentScrollContainer.scrollTop);\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst onBottomEdge: Position = {\n\t\tx:\n\t\t\tparentScrollContainer.getBoundingClientRect().left +\n\t\t\tparentScrollContainer.getBoundingClientRect().width / 2,\n\t\ty: parentScrollContainer.getBoundingClientRect().bottom,\n\t};\n\tconst belowBottomEdge: Position = {\n\t\tx: onBottomEdge.x,\n\t\ty: onBottomEdge.y + 10,\n\t};\n\n\t// lifting on the mid point of the bottom edge\n\tuserEvent.lift(child, {\n\t\tclientX: onBottomEdge.x,\n\t\tclientY: onBottomEdge.y,\n\t});\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t// on first frame, there is no auto scroll as\n\t// we don't know what the scroll speed should be until\n\t// a single frame has passed\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\n\t// scroll container has still not scrolled\n\texpect(ordered).toEqual([]);\n\texpect(parentScrollContainer.scrollTop).toBe(scrollHistory.at(-1));\n\n\t// expecting scroll on second frame\n\tadvanceTimersToNextFrame();\n\tstepScrollBy();\n\texpect(ordered).toEqual(['scroll event']);\n\tordered.length = 0;\n\n\tfunction dragBelowParent() {\n\t\tunsetElementAtPoint();\n\t\tunsetElementAtPoint = setElementFromPoint(document.body);\n\t\tfireEvent.dragEnter(document.body, {\n\t\t\tclientX: belowBottomEdge.x,\n\t\t\tclientY: belowBottomEdge.y,\n\t\t});\n\t\texpect(ordered).toEqual(['dropTarget:leave']);\n\t\tordered.length = 0;\n\t}\n\tfunction dragOntoParentBottomEdge() {\n\t\tunsetElementAtPoint();\n\t\tunsetElementAtPoint = setElementFromPoint(child);\n\t\tfireEvent.dragEnter(child, {\n\t\t\tclientX: onBottomEdge.x,\n\t\t\tclientY: onBottomEdge.y,\n\t\t});\n\t\texpect(ordered).toEqual(['dropTarget:enter']);\n\t\tordered.length = 0;\n\t}\n\n\t// engagement will be recorded during the first scroll event\n\tconst engagementStart = Date.now();\n\n\tfunction isInTimeDampeningPeriod() {\n\t\treturn Date.now() - engagementStart < defaultConfig.timeDampeningDurationMs;\n\t}\n\n\tlet lastScrollChange = 0;\n\tconst hit = jest.fn();\n\tconst actions = [dragBelowParent, dragOntoParentBottomEdge];\n\n\twhile (isInTimeDampeningPeriod()) {\n\t\tactions.forEach((action) => {\n\t\t\t// the first action might have taken us over the time dampening period\n\t\t\tif (!isInTimeDampeningPeriod()) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\thit();\n\n\t\t\tconst before = parentScrollContainer.scrollTop;\n\t\t\t// okay, let's leave the drop target\n\t\t\taction();\n\t\t\t// The next frame will be scrolled by the over flow auto scroller\n\t\t\tadvanceTimersToNextFrame();\n\t\t\tstepScrollBy();\n\n\t\t\texpect(ordered).toEqual(['scroll event']);\n\t\t\tordered.length = 0;\n\n\t\t\tconst after = parentScrollContainer.scrollTop;\n\t\t\tconst scrollChange = after - before;\n\t\t\texpect(scrollChange).toBeGreaterThan(lastScrollChange);\n\n\t\t\tlastScrollChange = scrollChange;\n\t\t});\n\t}\n\n\t// expecting each action to have been called at least once each\n\texpect(hit.mock.calls.length).toBeGreaterThan(actions.length);\n\n\t// Based on what the tim dampening period it is, we might be mid way through\n\t// the actions. This is being a bit resilient by checking what\n\t// action we are up to and continuing from there\n\tconst nextActionIndex = hit.mock.calls.length % actions.length;\n\tconst nextAction = actions[nextActionIndex];\n\tconst next = [\n\t\tnextAction,\n\t\tnextAction === dragBelowParent ? dragOntoParentBottomEdge : dragBelowParent,\n\t];\n\n\t// now that we are outside of the time dampening period, expecting no time dampening\n\tnext.forEach((action) => {\n\t\tconst before = parentScrollContainer.scrollTop;\n\t\t// okay, let's leave the drop target\n\t\taction();\n\t\t// The next frame will be scrolled by the over flow auto scroller\n\t\tadvanceTimersToNextFrame();\n\t\tstepScrollBy();\n\n\t\texpect(ordered).toEqual(['scroll event']);\n\t\tordered.length = 0;\n\n\t\tconst after = parentScrollContainer.scrollTop;\n\t\tconst scrollChange = after - before;\n\t\texpect(scrollChange).toBe(maxScrollPerFrame);\n\t});\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/auto-scroll/afm-jira/tsconfig.json",
    "content": "{\n\t\"extends\": \"../../../../tsconfig.local-consumption.json\",\n\t\"compilerOptions\": {\n\t\t\"target\": \"es5\",\n\t\t\"outDir\": \"../../../../../jira/tsDist/@atlaskit__pragmatic-drag-and-drop-auto-scroll/app\",\n\t\t\"rootDir\": \"../\",\n\t\t\"composite\": true,\n\t\t\"noCheck\": true\n\t},\n\t\"include\": [\n\t\t\"../src/**/*.ts\",\n\t\t\"../src/**/*.tsx\"\n\t],\n\t\"exclude\": [\n\t\t\"../src/**/__tests__/*\",\n\t\t\"../src/**/*.test.*\",\n\t\t\"../src/**/test.*\",\n\t\t\"../src/**/examples.*\",\n\t\t\"../src/**/examples/*\",\n\t\t\"../src/**/examples/**/*\",\n\t\t\"../src/**/*.stories.*\",\n\t\t\"../src/**/stories/*\",\n\t\t\"../src/**/stories/**/*\"\n\t],\n\t\"references\": [\n\t\t{\n\t\t\t\"path\": \"../../core/afm-jira/tsconfig.json\"\n\t\t}\n\t]\n}\n"
  },
  {
    "path": "packages/auto-scroll/afm-products/tsconfig.json",
    "content": "{\n\t\"extends\": \"../../../../tsconfig.local-consumption.json\",\n\t\"compilerOptions\": {\n\t\t\"target\": \"es5\",\n\t\t\"outDir\": \"../../../../../tsDist/@atlaskit__pragmatic-drag-and-drop-auto-scroll/app\",\n\t\t\"rootDir\": \"../\",\n\t\t\"composite\": true,\n\t\t\"noCheck\": true\n\t},\n\t\"include\": [\n\t\t\"../src/**/*.ts\",\n\t\t\"../src/**/*.tsx\"\n\t],\n\t\"exclude\": [\n\t\t\"../src/**/__tests__/*\",\n\t\t\"../src/**/*.test.*\",\n\t\t\"../src/**/test.*\",\n\t\t\"../src/**/examples.*\",\n\t\t\"../src/**/examples/*\",\n\t\t\"../src/**/examples/**/*\",\n\t\t\"../src/**/*.stories.*\",\n\t\t\"../src/**/stories/*\",\n\t\t\"../src/**/stories/**/*\"\n\t],\n\t\"references\": [\n\t\t{\n\t\t\t\"path\": \"../../core/afm-products/tsconfig.json\"\n\t\t}\n\t]\n}\n"
  },
  {
    "path": "packages/auto-scroll/constellation/index/about.mdx",
    "content": "---\norder: 0\ntitle: Auto scroll\ndescription: An optional package that enables automatic scrolling during a drag operation\n---\n\nimport SectionMessage from '@atlaskit/section-message';\nimport OverElementExample from '../../examples/over-element';\nimport LazyLoadedExample from '../../examples/lazy-loaded';\nimport AxisLocking from '../../examples/axis-locking';\n\nThis package works with any configuration of scrollable entities, and you can change the\nconfiguration of your scrollable entities in any way you like during a drag.\n\n<SectionMessage>\n\nThis package depends on [the core package](/components/pragmatic-drag-and-drop/core-package).\n\nThis package has no dependency on any view library (eg `react`), or on the Atlassian Design System.\n\n</SectionMessage>\n\n<Example Component={OverElementExample} appearance=\"showcase-only\" />\n\n## Registering auto scrolling for scrollable elements\n\nElements that are _registered_ for auto scrolling will be scrolled as a user drags close to the\nedges of the element.\n\n```ts\n// each adapter type has its own auto scroller\nimport { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';\nimport { autoScrollForExternal } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/external';\nimport { autoScrollForTextSelection } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/text-selection';\n\n// enable better auto scrolling\nconst cleanup = autoScrollForElements({\n\telement: myScrollableElement,\n});\n\n// disable better auto scrolling\ncleanup();\n```\n\nA slightly fuller example of a `react` list that is a _drop target_, and has auto scrolling\n\n```tsx\nimport { useRef, ReactElement } from 'react';\nimport { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport invariant from 'tiny-invariant';\n\nfunction ScrollableList({ children }: { children: ReactElement }) {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element, 'Element ref not set');\n\n\t\treturn combine(\n\t\t\tdropTargetForElements({\n\t\t\t\telement,\n\t\t\t}),\n\t\t\t// A scrollable element does not need to be a drop target,\n\t\t\t// but in this case it is.\n\t\t\t// We can add auto scrolling to an element along side our other\n\t\t\t// Pragmatic drag and drop bindings\n\t\t\tautoScrollForElements({\n\t\t\t\telement,\n\t\t\t}),\n\t\t);\n\t});\n\n\treturn (\n\t\t<div ref={ref} style={{ overflowY: 'scroll' }}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n```\n\n### Element scrolling rules and behaviour\n\n- You can position and style your scrollable elements however you like.\n- Your scroll containers can have as many levels of nesting as you like.\n- You have to register an element (eg with `autoScrollForElements`) to enable auto scrolling\n  (otherwise the default auto scrolling will apply).\n- A _registered_ scrollable element does not need to be drop target.\n- Auto scrolling is registered for particular entity types. For example, `autoScrollForElements` is\n  a drop target for elements, and `autoScrollForExternal` is for native drags.\n- During a drag operation, you can:\n  - Register new scrollable elements\n  - Unregister scrollable elements\n  - Change the styling, layout or dimensions of any scrollable element\n\n## `autoScrollFor*` arguments\n\n- `element`: the `HTMLElement` you want to add auto scrolling too. The `element` does not need to be\n  a drop target. The `element` is the unique key for an auto scrolling registration.\n- _(optional)_: `canScroll: (args: ElementGetFeedbackArgs) => boolean`: whether or not auto\n  scrolling should occur. Disabling auto scrolling with `canScroll` will _not_ prevent the browsers\n  built in auto scrolling, or manual user scrolling during a drag. Unfortunately, there is no way to\n  opt out of the platforms built in auto scrolling. We included `canScroll` because it is helpful to\n  disable this package's auto scrolling, as it is much easier for users to trigger than the\n  platforms built in auto scrolling.\n\n`canScroll` is a helpful way to only enable auto scrolling for particular entity types.\n\n```ts\nautoScrollForElements({\n  element: myElement,\n  // only enable auto scrolling when a Card is being dragged\n  canScroll: ({ source }) => source.data.type === 'card',\n}),\n```\n\n```ts\nexport type ElementGetFeedbackArgs = {\n\t/**\n\t * The users _current_ input\n\t */\n\tinput: Input;\n\t/**\n\t * The data associated with the entity being dragged\n\t */\n\tsource: DragType['payload'];\n\t/**\n\t * The element trying to be scrolled\n\t */\n\telement: Element;\n};\n```\n\n- _(optional)_: `getAllowedAxis: (args: ElementGetFeedbackArgs) => AllowedAxis`: used to enable auto\n  scrolling only on a particular axis. [See Axis locking guide](#axis-locking).\n\n- _(optional)_: `getConfiguration: (args: ElementGetFeedbackArgs) => PublicConfig`: used to control\n  some aspects of auto scrolling\n\n```ts\nautoScrollForElements({\n  element: myElement,\n  getConfiguration: () => ({\n    maxScrollSpeed: 'fast',\n  })\n}),\n```\n\nWe are intentionally only exposing a limited amount of configuration in order to promote\nconsistency. Right now we only expose a single simple configuration option:\n\n- `maxScrollSpeed`: `'fast' | 'standard'`. We recommend using the default `\"standard\"` max scroll\n  speed for most experiences. However, on _some_ larger experiences, a faster max scroll speed\n  `\"fast\"` _can_ feel better.\n\n## Registering auto scrolling for the `window`\n\n```ts\nimport { autoScrollWindowForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';\nimport { autoScrollWindowForExternal } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/external';\nimport { autoScrollWindowForInternalUncontrolled } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/internal-uncontrolled';\n\n// enable better auto scrolling on the window during drag operations\nconst cleanup = autoScrollWindowForElements();\n\n// disable better auto scrolling on the window\ncleanup();\n```\n\nA slightly fuller example of a `react` board that has window auto scrolling\n\n```tsx\nimport { useRef, ReactElement } from 'react';\nimport { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';\nimport invariant from 'tiny-invariant';\n\nfunction Board({ children }: { children: ReactElement }) {\n\tuseEffect(() => {\n\t\treturn autoScrollWindowForElements();\n\t});\n\n\treturn <div className=\"board\">{children}</div>;\n}\n```\n\n### Window auto scrolling rules and behaviour\n\n- You have to register window auto scrolling (eg with `autoScrollWindowForElements`) to enable auto\n  scrolling (otherwise the default auto scrolling will apply).\n- Auto scrolling is registered for particular entity types. For example,\n  `autoScrollWindowForElements` will do auto scrolling when an element is being dragged, and\n  `autoScrollWindowForExternal` will do auto scrolling when something from outside the `window` is\n  being dragged over the `window`\n- You can have multiple registrations for `window` auto scrolling, but only one registration will be\n  needed for `window` auto scrolling to occur.\n- If there are no active registrations for `window` auto scrolling, then no `window` auto scrolling\n  will occur (except for the built in one).\n- During a drag operation:\n  - You can register or unregister window auto scrolling\n  - You can change the content of the `document` so that the `window` grows or shrinks\n\n## `autoScrollWindowFor*` arguments\n\n- _(optional)_: `canScroll: (args: WindowGetFeedbackArgs) => boolean`: whether or not auto scrolling\n  should occur. Disabling auto scrolling with `canScroll` will _not_ prevent the browsers built in\n  auto scrolling, or manual user scrolling during a drag. Unfortunately, there is no way to opt out\n  of the platforms built in auto scrolling. We included `canScroll` because it is helpful to disable\n  this packages auto scrolling, as it is much easier for users to trigger than the platforms built\n  in auto scrolling.\n\n`canScroll` is a helpful way to only enable auto scrolling for particular entity types.\n\n```tsx\nautoScrollWindowForElements({\n  // only enable auto scrolling when a Card is being dragged\n  canScroll: ({ source }) => source.data.type === 'card',\n}),\n```\n\n```ts\nexport type ElementGetFeedbackArgs = {\n\t/**\n\t * The users _current_ input\n\t */\n\tinput: Input;\n\t/**\n\t * The data associated with the entity being dragged\n\t */\n\tsource: DragType['payload'];\n};\n```\n\n## Scroll speed dampening\n\nWe slow down the scroll speed based on two factors: time over an element, and closeness to an edge.\n\n### Time dampening\n\nThe longer a user drags over a scrollable entity, the faster the scroll speed will be (up to a\nlimit).\n\nTime dampening helps a user to avoid loosing context by scrolling too quickly when:\n\n- Lifting a draggable element inside of a scrollable element\n- Dragging into a scrollable element\n\nTime dampening is reset when you leave an element, so if you re-renter an element again, time\ndampening starts again.\n\nOur time dampening value has been tuned to balance:\n\n1. Trying to avoid losing context\n2. Letting the user get stuff done quickly\n\nTime dampening is shared between \"over element\" and \"overflow\" auto scroll regions.\n\nTime dampening is reset when:\n\n- A scrollable entity is unregistered for more than one frame\n- A scrollable entity is no longer being dragged over (except for the `window` - see below)\n- A drag operation is finished\n\nThe `window` time dampening timer does not reset if leaving the `window`. Currently no\n`onDragLeaveWindow` and `onDragEnterWindow` events are published by Pragmatic drag and drop. If we\ndid publish those events, then we _could_ reset the auto scrolling acceleration timer for the\n`window` when entering the `window`.\n\n### Distance dampening\n\nThe closer a user's pointer is to the edge of a scrollable entity (element or window), the faster\nthe scroll will be. Distance dampening allows a user to control the scroll speed by moving closer /\nfurther away from a scrollable edge\n\nThe max speed can be reached a distance away from the actual edge of a scrollable element. This is\nso that users don't have to move right onto the edge to get the max speed - they can get the max\nspeed from a small distance out from the edge\n\n<img src=\"images/distance-dampening.jpg\" alt=\"Distance dampening\" style=\"max-width:300px\" />\n\n## Dynamic scroll speed\n\nIn order to facilitate a great experience for all users, on all devices, we dynamically adjust the\nspeed of scroll changes based on the devices frame rate (measured in frames per second - `fps`)\n\n**Devices running at `60fps`**\n\nWe can scroll up to our maximum target scroll change in a frame\n\n**Devices running at higher frame rates (eg `120fps` displays)**\n\nWe lower the max scroll change per frame to ensure we don’t scroll too fast.\n\nIf we made the same scroll change per frame on a `120fps` device as we did on a 60fps device, then\nthe `120fps` device would be scrolling twice as fast\n\nThe auto scroller ensures that a `120fps` display scrolls at the same visible speed as a 60fps\ndevices.\n\n**Devices running at slower than `60fps`**\n\nYou might think we would do the inverse of what we do for the `120fps` devices - increase the max\nchange per frame so that the overall speed would match a `60fps` device. However, this can lead to\nlarge scroll changes in a single frame causing the experience to feel janky.\n\nFor lower frame rate devices, we cap the max scroll change per frame to match would it would be if\nthe device was running at `60fps`. This can result in a slower over all scroll speed, but the scroll\nwill always feel smooth.\n\n**Dynamic switching**\n\nThese rules are applied on a _per frame_ basis. One device might move between all three categories\nin the same drag operation.\n\n## Scroll bubbling\n\nIn order to match the browser as closely as possible, as well as to provide an experience that feels\ngreat, we have landed on the following algorithm for scrolling:\n\n- Only scroll scrollable entities that the user is currently dragging over with their pointer.\n- We scroll the inner most scrollable entity first, and then work upwards. This is known as _bubble\n  ordering_ and it is the same order that Pragmatic drag and drop events flow.\n- Only scroll one scrollable entity per axis (vertical / horizontal) in a frame. In order for a\n  scrollable entity to be scrolled on an axis, it needs to have some available scroll in the\n  applicable direction (forwards / backwards).\n\n### Bubbling examples\n\nFor these examples, we have two elements that are both scrollable: `child` and `parent`\n\n```html\n<div id=\"parent\">\n\t<div id=\"child\">\n\t\t<!-- content -->\n\t</div>\n</div>\n```\n\n**Scenario:** Based on hitboxes, both `child` and `parent` could be scrolled forwards vertically and\nhorizontally `child` and `parent` both have available scroll vertically and horizontally.\n\n- `child` is scrolled forwards vertically and horizontally\n- `parent` is not scrolled\n\n**Scenario:** Based on hitboxes, both `child` and `parent` could be scrolled forwards vertically and\nhorizontally `child` has no available scroll vertically, but has scroll available horizontally\n`parent` has available scroll vertically and horizontally\n\n- `child` is scrolled horizontally (`child` has no available scroll vertically)\n- `parent` is scrolled vertically (`child` has already been scrolled horizontally so `parent` can\n  only be scrolled vertically)\n\n## Deferred loading\n\nThis package supports being loaded in asyncronously, and can be loaded even after a drag has\nstarted.\n\n```ts\nconst { autoScrollForElements } =\n\tawait import('@atlaskit/pragmatic-drag-and-drop-auto-scroll/element');\n```\n\nIn this example, we start loading the auto scroller code after the drag has started, but you could\nload in the auto scroller whenever you like.\n\n<Example Component={LazyLoadedExample} appearance=\"showcase-only\" />\n\nSee our\n[deferred loading guide](/components/pragmatic-drag-and-drop/core-package/recipes/deferred-loading/index)\nfor more information.\n\n## Axis Locking\n\nThis package provides support for axis locking, which allows you to disable auto scrolling on a\nspecific axis. However, there are some important considerations to keep in mind.\n\n```typescript\nautoScrollForElements({\n  element: myElement,\n  getAllowedAxis: () => 'vertical',\n}),\n```\n\nBrowsers have built in auto scrolling during a drag operation, which does not provide a great\nexperience and it cannot be disabled. This package has been designed to complement built in auto\nscrolling. Additionally, a user can manually scroll any scroll container during a drag.\n\nDue to the inability to disable the browser's built-in auto scroller, full axis locking\nfunctionality cannot be provided by this package alone. To achieve complete axis locking, you must\nmodify the scroll container to restrict scrolling to a single direction. This is typically\naccomplished by setting `overflowX` or `overflowY` to `hidden` on the scroll container.\n\nPlease note that even with the `allowedAxis` prop set to a specific axis, the browser's built-in\nauto scroller will continue to scroll on all scrollable axes. The `allowedAxis` prop only restricts\nthe axis from the perspective of this package, not the browser's perspective.\n\nOne important aspect to note is that time dampening is not cancelled when changing the allowed axis\nmid-drag. This is different from the `canScroll` function, where changing it's return value does\nreset time dampening. This means that if you switch the allowed axis during a drag, the auto\nscroller will continue at its current speed on the newly allowed axis. We decided not to reset time\ndampening on allowed axis changes for now as it would introduce a decent amount of internal\ncomplexity.\n\n<Example Component={AxisLocking} appearance=\"showcase-only\" />\n\n## Declarative vs automatic scrollable entity registration\n\nThis package works by declaratively registering scrollable entities. An alternative would be to\nautomatically apply auto scrolling to everything that is scrollable during a drag.\n\nWe chose declarative registrations for a few reasons:\n\n- They allow for per item configuration (for example, adjusting the speed and auto scroll hitboxes\n  for specific entities).\n- They allow us to easily enable / disable scrolling during a drag (through `canScroll()`)\n- They align with the existing declarative Pragmatic drag and drop API\n- Registrations are a cheap way of identifying what is scrollable, otherwise we have to check all\n  elements (through `window.getComputedStyles(element)`) to check what is scrollable, which has poor\n  performance characteristics.\n"
  },
  {
    "path": "packages/auto-scroll/constellation/index/props.mdx",
    "content": ""
  },
  {
    "path": "packages/auto-scroll/constellation/index/unsafe-overflow-scrolling.mdx",
    "content": "---\norder: 1\ntitle: Unsafe overflow scrolling\ndescription: Continuing to scroll after leaving a scrollable element\n---\n\nimport SectionMessage from '@atlaskit/section-message';\nimport UnsafeOverflowExample from '../../examples/unsafe-overflow';\n\nUnsafe overflow scrolling allows the user to scroll a scrollable element when they are no longer\nover the element.\n\n<Example Component={UnsafeOverflowExample} appearance=\"showcase-only\" />\n\n## Challenges with overflow scrolling\n\n<SectionMessage appearance=\"warning\" title=\"Avoid overflow scrolling\">\n\nThese challenges are why overflow scrolling is considered unsafe. It should only be used when there\nis a strong justification.\n\n</SectionMessage>\n\n### It can be confusing for users\n\nOverflow scrolling can feel great, but it does not play well with the web platform's drag and drop\ncapabilities. In order to update the drop target for a drag operation, the user needs to drag over\nan element. With overflow scrolling, the interface can be changing, but the drop target might not be\nas the user might not be over the drop target. This can be confusing for users\n\n### It is easy to create strange experiences\n\nWhen you enable overflow scrolling, it is easy to have multiple scrollable elements scrolling at the\nsame time in unexpected ways. This is because we can no longer rely on the DOM hierarchy to help us\nprovide an scrolling experience that will always feel great. This package gives you the control to\nsetup auto scrolling how you want it, but you will need to be careful to ensure that the settings\nyou have chosen work well for the experience you are making.\n\n### It is more expensive than standard overflow scrolling\n\nWhen doing standard 'over element' auto scrolling, we can leverage the DOM hierarchy to quickly\nsearch for relevant scroll containers. We cannot do that for overflow scrolling. For every overflow\nscrolling registration (eg `unsafeOverflowForElements()`), we need to do a\n`element.getBoundingClientRect()` in each animation frame to see if we are over the element (we have\nto re-create hitbox testing). Doing excessive amounts of of `getBoundingClientRect()` can get\nexpensive, so we suggest you don't add too many overflow scrolling registrations.\n\n## Registering unsafe overflow scrolling for scrollable elements\n\nRegistering unsafe overflow scrolling will only enable scrolling when outside of the element. If you\nwant the element to be scrollable when over the element, then you will also need to add 'over\nelement' auto scrolling as well (eg `autoScrollForElements()`).\n\n```ts\n// each adapter type has its own overflow auto scroller\nimport { unsafeOverflowForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/unsafe-overflow/element';\nimport { unsafeOverflowForExternal } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/unsafe-overflow/external';\nimport { unsafeOverflowForTextSelection } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/unsafe-overflow/text-selection';\n\nimport { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';\n\nconst cleanup = combine(\n\t// Enabling scrolling when over an element\n\tautoScrollForElements({\n\t\telement,\n\t}),\n\t// Enabling scrolling when outside an element - in the overflow\n\tunsafeOverflowForElements({\n\t\telement,\n\t}),\n);\n\n// disable auto scrolling\ncleanup();\n```\n\nA slightly fuller example of a `react` list that is a drop target, and has auto scrolling:\n\n```tsx\nimport { useRef, ReactElement } from 'react';\nimport { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';\nimport { unsafeOverflowForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/unsafe-overflow/element';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport invariant from 'tiny-invariant';\n\nfunction ScrollableList({ children }: { children: ReactElement }) {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element, 'Element ref not set');\n\n\t\treturn combine(\n\t\t\tdropTargetForElements({\n\t\t\t\telement,\n\t\t\t}),\n\t\t\t// Enabling scrolling when \"over\" an element\n\t\t\tautoScrollForElements({\n\t\t\t\telement,\n\t\t\t}),\n\t\t\t// Enabling overflow auto scrolling\n\t\t\tunsafeOverflowForElements({\n\t\t\t\telement,\n\t\t\t}),\n\t\t);\n\t});\n\n\treturn (\n\t\t<div ref={ref} style={{ overflowY: 'scroll' }}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n```\n\n### Element scrolling rules and behaviour\n\nOverflow scrolling has the same flexible rules as 'over element' auto scrolling - you can have any\nsetup you want, and change anything you want during a drag.\n\n## `unsafeOverflowAutoScrollFor*` arguments\n\n- `element`: the `HTMLElement` you want to add auto scrolling too. The `element` does not need to be\n  a `dropTarget`. The `element` is the unique key for an auto scrolling registration.\n- `getOverflow: () => ProvidedHitboxSpacing`. `ProvidedHitboxSpacing` allows you to specify how\n  overflow scrolling should occur for a element.\n\n`getOverflow()` allows you to specify how overflow scrolling should work for each edge of an\nelement.\n\n![API visual explanation](images/from-top-edge-example.jpg)\n\n```ts\n// Only allow overflow scrolling above and below an element by 400px\nunsafeOverflowAutoScrollForElements({\n\telement,\n\tgetOverflow: () => ({\n\t\tforTopEdge: {\n\t\t\ttop: 400,\n\t\t},\n\t\tforBottomEdge: {\n\t\t\tbottom: 400,\n\t\t},\n\t}),\n});\n\nunsafeOverflowAutoScrollForElements({\n\telement,\n\tgetOverflow: () => ({\n\t\tforTopEdge: {\n\t\t\t// Allow the top element to be overflow scrolled up to\n\t\t\t// 2000px away from the element\n\t\t\ttop: 2000,\n\t\t\t// Allow the top element to be overflow scrolled when\n\t\t\t// up to 200px on the left or right of the top edge.\n\t\t\t// The hitbox for scrolling will extend down below the top edge\n\t\t\t// to match the \"over element\" hitbox for the top edge.\n\t\t\t// See the diagram for more details.\n\t\t\tleft: 200,\n\t\t\tright: 200,\n\n\t\t\t// The \"bottom\" edge definition for the \"top\" edge is\n\t\t\t// handled by the \"over element\" auto scroller.\n\t\t},\n\t}),\n});\n```\n\n- _(optional)_: `canScroll: (args: ElementGetFeedbackArgs) => boolean`: whether or not auto\n  scrolling should occur. Disabling auto scrolling with `canScroll` will _not_ prevent the browser's\n  built in auto scrolling, or manual user scrolling during a drag. Unfortunately, there is no way to\n  opt out of the platform's built in auto scrolling. We included `canScroll` because it is helpful\n  to disable this package's auto scrolling, as it is much easier for users to trigger than the\n  platform's built in auto scrolling.\n\n## Scroll acceleration\n\n- Builds on 'over element' auto scrolling.\n- When outside of the element on the main axis of an edge (eg vertical axis for the top edge), then\n  the max scroll speed is applied.\n- Time dampening timer is shared with 'over element' auto scrolling. This means that time dampening\n  will carry over correctly when moving between 'over element' and 'overflow scrolling'.\n- Distance dampening is applied when in the \"cross axis\" component of an edges hitbox (see the\n  checkered area of the diagram below). This is so that the scroll speed inside an edge is the same\n  when inside the element, or when outside the element.\n\n![Diagram of overflow scrolling logic](images/overflow-scrolling-example.jpg)\n\n## Window scrolling\n\nOverflow scrolling is not applicable for window scrolling as the browser stops publishing events to\nthe document once the user has left the window. If you want to have window scrolling, then use our\nstandard approach for [registering auto scrolling for the window](../about).\n"
  },
  {
    "path": "packages/auto-scroll/examples/axis-locking.tsx",
    "content": "import React from 'react';\n\nimport { Table } from './pieces/table';\n\nexport default function AxisLocking(): React.JSX.Element {\n\treturn <Table />;\n}\n"
  },
  {
    "path": "packages/auto-scroll/examples/lazy-loaded.tsx",
    "content": "import React from 'react';\n\nimport { Board } from './pieces/lazy-loaded-board';\n\nexport default function LazyLoaded(): React.JSX.Element {\n\treturn <Board />;\n}\n"
  },
  {
    "path": "packages/auto-scroll/examples/nested-scroll.tsx",
    "content": "/* eslint-disable @atlaskit/design-system/no-nested-styles */\n/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { Fragment, type ReactElement, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, Global, jsx } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Stack, xcss } from '@atlaskit/primitives';\n\nimport { autoScrollForElements, autoScrollWindowForElements } from '../src/entry-point/element';\n\nconst globalStyles = css({\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':root': {\n\t\t'--grid': '8px',\n\t},\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766\n\tbody: {\n\t\theight: '150vh',\n\t},\n});\n\ntype ItemType = {\n\tid: string;\n};\n\nconst itemStyles = xcss({\n\tpadding: 'space.050',\n\tborderWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border.brand',\n\tborderRadius: 'radius.small',\n\tbackgroundColor: 'color.background.accent.lime.subtlest',\n\twidth: '300px',\n});\n\nfunction Item({ item }: { item: ItemType }) {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\t\treturn combine(\n\t\t\tdraggable({\n\t\t\t\telement,\n\t\t\t\tgetInitialData: () => item,\n\t\t\t}),\n\t\t\tdropTargetForElements({ element, getIsSticky: () => true }),\n\t\t);\n\t}, [item]);\n\treturn (\n\t\t<Box xcss={itemStyles} ref={ref}>\n\t\t\t{item.id}\n\t\t</Box>\n\t);\n}\n\nfunction getItems({ listId, count }: { listId: string; count: number }): ItemType[] {\n\treturn Array.from({ length: count }).map((_, k) => ({\n\t\tid: `list[${listId}] index[${k}]`,\n\t}));\n}\n\nconst scrollContainerStyles = xcss({\n\theight: '300px',\n\toverflowY: 'scroll',\n\tborder: '1px solid green',\n});\n\nfunction List({ listId, children }: { listId: string; children?: ReactElement | ReactElement[] }) {\n\tconst [items] = useState(() => getItems({ listId, count: 20 }));\n\tconst ref = useRef<HTMLElement | null>(null);\n\n\tuseEffect(() => {\n\t\tinvariant(ref.current);\n\t\treturn autoScrollForElements({\n\t\t\telement: ref.current,\n\t\t});\n\t}, []);\n\n\treturn (\n\t\t<Box xcss={scrollContainerStyles} padding=\"space.075\" ref={ref}>\n\t\t\t<h4>List: {listId}</h4>\n\t\t\t<Stack space=\"space.050\">\n\t\t\t\t{items.map((item) => (\n\t\t\t\t\t<Item item={item} key={item.id} />\n\t\t\t\t))}\n\t\t\t</Stack>\n\t\t\t<Fragment>{children}</Fragment>\n\t\t</Box>\n\t);\n}\n\nexport default function WindowScroll(): React.JSX.Element {\n\tuseEffect(() => {\n\t\treturn autoScrollWindowForElements({});\n\t});\n\treturn (\n\t\t<Fragment>\n\t\t\t<Global styles={globalStyles} />\n\t\t\t<List listId=\"1\">\n\t\t\t\t<List listId=\"1.1\" />\n\t\t\t\t<List listId=\"1.2\">\n\t\t\t\t\t<List listId=\"1.2.1\" />\n\t\t\t\t\t<List listId=\"1.2.2\" />\n\t\t\t\t</List>\n\t\t\t\t<List listId=\"1.3\" />\n\t\t\t</List>\n\t\t</Fragment>\n\t);\n}\n"
  },
  {
    "path": "packages/auto-scroll/examples/over-element.tsx",
    "content": "import React from 'react';\n\nimport { autoScrollForElements } from '../src/entry-point/element';\n\nimport { Board } from './pieces/board';\nimport { BoardContext, type TBoardContext } from './pieces/board-context';\n\nconst context: TBoardContext = {\n\tautoScrollColumn: autoScrollForElements,\n\tautoScrollBoard: autoScrollForElements,\n};\n\nexport default function OverElement(): React.JSX.Element {\n\treturn (\n\t\t<BoardContext.Provider value={context}>\n\t\t\t<Board />\n\t\t</BoardContext.Provider>\n\t);\n}\n"
  },
  {
    "path": "packages/auto-scroll/examples/pieces/board-context.ts",
    "content": "import { createContext } from 'react';\n\nimport { type autoScrollForElements } from '../../src/entry-point/element';\n\nexport type TBoardContext = {\n\tautoScrollColumn: typeof autoScrollForElements;\n\tautoScrollBoard: typeof autoScrollForElements;\n};\n\nexport const BoardContext = createContext<TBoardContext | null>(null);\n"
  },
  {
    "path": "packages/auto-scroll/examples/pieces/board.tsx",
    "content": "import React, { useContext, useEffect, useRef, useState } from 'react';\n\nimport invariant from 'tiny-invariant';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Flex, Stack, xcss } from '@atlaskit/primitives';\n\nimport { autoScrollWindowForElements } from '../../src/entry-point/element';\n\nimport { BoardContext } from './board-context';\nimport { Card } from './card';\n\nfunction useRequiredContext<TContextValue>(\n\tContext: React.Context<TContextValue | null>,\n): TContextValue {\n\tconst value = useContext<TContextValue | null>(Context);\n\tinvariant(value, 'Could not find context value');\n\treturn value;\n}\n\ntype TItem = { id: string };\ntype TColumn = {\n\tid: string;\n\titems: TItem[];\n};\n\nconst columnStyles = xcss({\n\toverflowY: 'auto',\n\theight: '300px',\n\twidth: '140px',\n\tbackgroundColor: 'elevation.surface',\n\tborderColor: 'color.border.accent.purple',\n\tborderRadius: 'radius.small',\n\tborderWidth: 'border.width',\n\tborderStyle: 'solid',\n\tflexShrink: 0,\n});\n\nfunction Column({ column }: { column: TColumn }) {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tconst { autoScrollColumn } = useRequiredContext(BoardContext);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\n\t\treturn combine(\n\t\t\tautoScrollColumn({\n\t\t\t\telement,\n\t\t\t}),\n\t\t);\n\t}, [autoScrollColumn]);\n\n\treturn (\n\t\t<Box ref={ref} xcss={columnStyles} padding=\"space.100\" testId={column.id}>\n\t\t\t<Stack space=\"space.100\">\n\t\t\t\t{column.items.map((item) => (\n\t\t\t\t\t<Card key={item.id} item={item} />\n\t\t\t\t))}\n\t\t\t</Stack>\n\t\t</Box>\n\t);\n}\n\nconst boardStyles = xcss({\n\toverflowX: 'auto',\n\tborderWidth: 'border.width',\n\tborderColor: 'color.border.accent.purple',\n\tborderStyle: 'solid',\n\tborderRadius: 'radius.small',\n\tpadding: 'space.200',\n\tbackgroundColor: 'elevation.surface.sunken',\n});\n\nfunction getColumns({ count }: { count: number }): TColumn[] {\n\treturn Array.from({ length: count }, (_, columnIndex) => {\n\t\tconst columnId = `column-${columnIndex}`;\n\t\tconst items = Array.from({ length: 50 }, (_, itemIndex) => {\n\t\t\treturn {\n\t\t\t\tid: `${columnId}::item-${itemIndex}`,\n\t\t\t};\n\t\t});\n\t\treturn { id: columnId, items };\n\t});\n}\n\nconst columnContainerStyles = xcss({\n\twidth: 'min-content', // so we can have padding around the board\n});\n\nexport function Board(): React.JSX.Element {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tconst [columns] = useState<TColumn[]>(() => getColumns({ count: 30 }));\n\n\tconst { autoScrollBoard } = useRequiredContext(BoardContext);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\n\t\treturn combine(\n\t\t\tautoScrollBoard({\n\t\t\t\telement,\n\t\t\t}),\n\t\t\tautoScrollWindowForElements(),\n\t\t);\n\t}, [autoScrollBoard]);\n\n\treturn (\n\t\t<Box xcss={boardStyles} ref={ref}>\n\t\t\t<Flex gap=\"space.200\" xcss={columnContainerStyles}>\n\t\t\t\t{columns.map((column) => (\n\t\t\t\t\t<Column key={column.id} column={column} />\n\t\t\t\t))}\n\t\t\t</Flex>\n\t\t</Box>\n\t);\n}\n"
  },
  {
    "path": "packages/auto-scroll/examples/pieces/card.tsx",
    "content": "import React, { Fragment, useEffect, useRef, useState } from 'react';\n\nimport { createPortal } from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport { durations, easeInOut } from '@atlaskit/motion';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { preserveOffsetOnSource } from '@atlaskit/pragmatic-drag-and-drop/element/preserve-offset-on-source';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, xcss } from '@atlaskit/primitives';\n\nconst cardStyles = xcss({\n\theight: 'size.400',\n\tborderWidth: 'border.width',\n\tborderColor: 'color.border.accent.purple',\n\tborderStyle: 'solid',\n\tbackgroundColor: 'color.background.accent.purple.subtler',\n\tborderRadius: 'radius.small',\n\ttransitionProperty: 'background-color, opacity',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values\n\ttransitionDuration: `${durations.medium}ms`,\n\ttransitionTimingFunction: easeInOut,\n\n\tdisplay: 'flex',\n\talignItems: 'center',\n\tpadding: 'space.050',\n});\n\ntype TItem = { id: string };\n\ntype CardState =\n\t| { type: 'idle' }\n\t| { type: 'preview'; container: HTMLElement; rect: DOMRect }\n\t| { type: 'is-dragging' }\n\t| { type: 'is-over' };\n\nconst cardStateStyles: {\n\t[Key in CardState['type']]: ReturnType<typeof xcss> | undefined;\n} = {\n\tidle: undefined,\n\tpreview: undefined,\n\t'is-dragging': xcss({ opacity: 0.4 }),\n\t'is-over': xcss({\n\t\tbackgroundColor: 'color.background.accent.purple.subtler.hovered',\n\t}),\n};\n\nconst idle: CardState = { type: 'idle' };\nconst isDragging: CardState = { type: 'is-dragging' };\nconst isOver: CardState = { type: 'is-over' };\n\nexport function Card({ item }: { item: TItem }): React.JSX.Element {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<CardState>(idle);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\n\t\treturn combine(\n\t\t\tdraggable({\n\t\t\t\telement,\n\t\t\t\tonGenerateDragPreview: ({ source, nativeSetDragImage, location }) => {\n\t\t\t\t\t// Using a custom native drag preview\n\t\t\t\t\t// so that we get a nicer border radius on\n\t\t\t\t\t// the preview 👩‍🍳🤌\n\t\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\t\tgetOffset: preserveOffsetOnSource({\n\t\t\t\t\t\t\telement: source.element,\n\t\t\t\t\t\t\tinput: location.initial.input,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\t\tsetState({\n\t\t\t\t\t\t\t\ttype: 'preview',\n\t\t\t\t\t\t\t\tcontainer,\n\t\t\t\t\t\t\t\trect: element.getBoundingClientRect(),\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn () => setState(isDragging);\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragStart: () => setState(isDragging),\n\t\t\t\tonDrop: () => setState(idle),\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement,\n\t\t\t\tgetIsSticky: () => true,\n\t\t\t\tcanDrop: ({ source }) => source.element !== element,\n\t\t\t\tonDragStart: () => setState(isOver),\n\t\t\t\tonDragEnter: () => setState(isOver),\n\t\t\t\tonDragLeave: () => setState(idle),\n\t\t\t\tonDrop: () => setState(idle),\n\t\t\t}),\n\t\t);\n\t}, []);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<Box ref={ref} xcss={[cardStyles, cardStateStyles[state.type]]} testId={item.id} />\n\t\t\t{state.type === 'preview'\n\t\t\t\t? createPortal(<CardPreview rect={state.rect} />, state.container)\n\t\t\t\t: null}\n\t\t</Fragment>\n\t);\n}\n\nfunction CardPreview({ rect }: { rect: DOMRect }) {\n\treturn <Box xcss={cardStyles} style={{ width: rect.width, height: rect.height }} />;\n}\n"
  },
  {
    "path": "packages/auto-scroll/examples/pieces/lazy-loaded-board.tsx",
    "content": "import React, { useEffect, useRef, useState } from 'react';\n\nimport { bind } from 'bind-event-listener';\nimport invariant from 'tiny-invariant';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Flex, Inline, Stack, xcss } from '@atlaskit/primitives';\n\nimport { Card } from './card';\n\ntype TItem = { id: string };\ntype TColumn = {\n\tid: string;\n\titems: TItem[];\n};\n\nconst columnStyles = xcss({\n\toverflowY: 'auto',\n\theight: '300px',\n\twidth: '140px',\n\tbackgroundColor: 'elevation.surface',\n\tborderColor: 'color.border.accent.purple',\n\tborderRadius: 'radius.small',\n\tborderWidth: 'border.width',\n\tborderStyle: 'solid',\n\tflexShrink: 0,\n});\n\nfunction Column({ column }: { column: TColumn }) {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\n\t\tlet operation = new AbortController();\n\n\t\treturn monitorForElements({\n\t\t\tonDragStart: async () => {\n\t\t\t\toperation = new AbortController();\n\n\t\t\t\tconst { autoScrollForElements, autoScrollWindowForElements } =\n\t\t\t\t\t// eslint-disable-next-line import/dynamic-import-chunkname\n\t\t\t\t\tawait import('../../src/entry-point/element');\n\n\t\t\t\tconsole.log('scroller loaded');\n\t\t\t\tif (operation.signal.aborted) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst cleanup = combine(\n\t\t\t\t\tautoScrollForElements({\n\t\t\t\t\t\telement,\n\t\t\t\t\t}),\n\t\t\t\t\tautoScrollWindowForElements(),\n\t\t\t\t);\n\n\t\t\t\tbind(operation.signal, {\n\t\t\t\t\ttype: 'abort',\n\t\t\t\t\tlistener: cleanup,\n\t\t\t\t\toptions: { once: true },\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDrop() {\n\t\t\t\toperation.abort();\n\t\t\t},\n\t\t});\n\t}, []);\n\n\treturn (\n\t\t<Box ref={ref} xcss={columnStyles} padding=\"space.100\" testId={column.id}>\n\t\t\t<Stack space=\"space.100\">\n\t\t\t\t{column.items.map((item) => (\n\t\t\t\t\t<Card key={item.id} item={item} />\n\t\t\t\t))}\n\t\t\t</Stack>\n\t\t</Box>\n\t);\n}\n\nconst boardStyles = xcss({\n\toverflowX: 'auto',\n\tborderWidth: 'border.width',\n\tborderColor: 'color.border.accent.purple',\n\tborderStyle: 'solid',\n\tborderRadius: 'radius.small',\n\tpadding: 'space.200',\n\tbackgroundColor: 'elevation.surface.sunken',\n});\n\ntype LoadingState = 'pending' | 'loading' | 'loaded';\n\nconst loadingStyles: { [Key in LoadingState]: ReturnType<typeof xcss> } = {\n\tpending: xcss({\n\t\tcolor: 'color.text.warning',\n\t}),\n\tloading: xcss({\n\t\tcolor: 'color.text.discovery',\n\t}),\n\tloaded: xcss({\n\t\tcolor: 'color.text.success',\n\t}),\n};\n\nfunction getColumns({ count }: { count: number }): TColumn[] {\n\treturn Array.from({ length: count }, (_, columnIndex) => {\n\t\tconst columnId = `column-${columnIndex}`;\n\t\tconst items = Array.from({ length: 50 }, (_, itemIndex) => {\n\t\t\treturn {\n\t\t\t\tid: `${columnId}::item-${itemIndex}`,\n\t\t\t};\n\t\t});\n\t\treturn { id: columnId, items };\n\t});\n}\n\nconst columnContainerStyles = xcss({\n\twidth: 'min-content', // so we can have padding around the board\n});\n\nexport function Board(): React.JSX.Element {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tconst [columns] = useState<TColumn[]>(() => getColumns({ count: 8 }));\n\tconst [state, setState] = useState<LoadingState>('pending');\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\t\tlet operation: AbortController | null = null;\n\n\t\treturn combine(\n\t\t\tmonitorForElements({\n\t\t\t\tonDragStart: async () => {\n\t\t\t\t\toperation = new AbortController();\n\t\t\t\t\tsetState((current) => {\n\t\t\t\t\t\tif (current === 'pending') {\n\t\t\t\t\t\t\treturn 'loading';\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn current;\n\t\t\t\t\t});\n\n\t\t\t\t\t// Note: for example simplicity we are not handling errors\n\t\t\t\t\tconst { autoScrollForElements, autoScrollWindowForElements } =\n\t\t\t\t\t\t// eslint-disable-next-line import/dynamic-import-chunkname\n\t\t\t\t\t\tawait import('../../src/entry-point/element');\n\n\t\t\t\t\tif (operation.signal.aborted) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tsetState((current) => {\n\t\t\t\t\t\tif (current === 'loading') {\n\t\t\t\t\t\t\treturn 'loaded';\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn current;\n\t\t\t\t\t});\n\n\t\t\t\t\tconst cleanup = combine(\n\t\t\t\t\t\tautoScrollForElements({\n\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tautoScrollWindowForElements(),\n\t\t\t\t\t);\n\n\t\t\t\t\tbind(operation.signal, {\n\t\t\t\t\t\ttype: 'abort',\n\t\t\t\t\t\tlistener: cleanup,\n\t\t\t\t\t\toptions: { once: true },\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\toperation?.abort();\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, []);\n\n\treturn (\n\t\t<Stack space=\"space.100\">\n\t\t\t<Box xcss={boardStyles} ref={ref}>\n\t\t\t\t<Flex gap=\"space.200\" xcss={columnContainerStyles}>\n\t\t\t\t\t{columns.map((column) => (\n\t\t\t\t\t\t<Column key={column.id} column={column} />\n\t\t\t\t\t))}\n\t\t\t\t</Flex>\n\t\t\t</Box>\n\t\t\t<Inline space=\"space.050\">\n\t\t\t\t<Box>Auto scrolling:</Box>\n\t\t\t\t<Box xcss={loadingStyles[state]}>\n\t\t\t\t\t{/* eslint-disable-next-line @atlaskit/design-system/no-html-code */}\n\t\t\t\t\t<code>{state}</code>\n\t\t\t\t</Box>\n\t\t\t</Inline>\n\t\t</Stack>\n\t);\n}\n"
  },
  {
    "path": "packages/auto-scroll/examples/pieces/table.tsx",
    "content": "import React, { type PropsWithChildren, useEffect, useRef, useState } from 'react';\n\nimport invariant from 'tiny-invariant';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, xcss } from '@atlaskit/primitives';\n\nimport { autoScrollForElements, autoScrollWindowForElements } from '../../src/entry-point/element';\n\nimport { Card } from './card';\n\ntype TItem = { id: string };\n\nconst COLUMN_COUNT = 8;\nconst columns = new Array(COLUMN_COUNT).fill(null);\n\nfunction getItems({ count }: { count: number }): TItem[] {\n\treturn Array.from({ length: count }, (_, itemIndex) => ({\n\t\tid: `item-${itemIndex}`,\n\t}));\n}\n\nfunction Cell({ isSticky, children }: PropsWithChildren<{ isSticky?: boolean }>) {\n\treturn (\n\t\t<Box as=\"td\" xcss={[cellStyles, isSticky && stickyStyles]}>\n\t\t\t{children}\n\t\t</Box>\n\t);\n}\n\nfunction Row({ item }: { item: TItem }) {\n\treturn (\n\t\t<Box as=\"tr\" xcss={rowStyles} testId={item.id}>\n\t\t\t{columns.map((_, index) =>\n\t\t\t\tindex === 0 ? (\n\t\t\t\t\t<Cell isSticky>\n\t\t\t\t\t\t<Card item={item} />\n\t\t\t\t\t</Cell>\n\t\t\t\t) : (\n\t\t\t\t\t<Cell key={index} />\n\t\t\t\t),\n\t\t\t)}\n\t\t</Box>\n\t);\n}\n\nexport function Table(): React.JSX.Element {\n\tconst ref = useRef<HTMLTableElement | null>(null);\n\tconst [items] = useState<TItem[]>(() => getItems({ count: 20 }));\n\n\tconst [isDragging, setIsDragging] = useState<boolean>(false);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\n\t\treturn combine(\n\t\t\tmonitorForElements({\n\t\t\t\tonDragStart() {\n\t\t\t\t\tsetIsDragging(true);\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tsetIsDragging(false);\n\t\t\t\t},\n\t\t\t}),\n\t\t\tautoScrollForElements({\n\t\t\t\telement,\n\t\t\t\tgetAllowedAxis: () => 'vertical',\n\t\t\t}),\n\t\t\tautoScrollWindowForElements(),\n\t\t);\n\t}, []);\n\n\treturn (\n\t\t<Box xcss={[wrapperStyles, isDragging && scrollLockStyles]} ref={ref}>\n\t\t\t<Box as=\"table\" xcss={tableStyles}>\n\t\t\t\t<colgroup>\n\t\t\t\t\t{columns.map((_, index) => (\n\t\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\t\t<col key={index} style={{ width: '150px' }} />\n\t\t\t\t\t))}\n\t\t\t\t</colgroup>\n\t\t\t\t<Box as=\"tbody\">\n\t\t\t\t\t{items.map((item) => (\n\t\t\t\t\t\t<Row key={item.id} item={item} />\n\t\t\t\t\t))}\n\t\t\t\t</Box>\n\t\t\t</Box>\n\t\t</Box>\n\t);\n}\n\nconst cellStyles = xcss({\n\tpadding: 'space.0',\n\twidth: 'size.600',\n\tborderColor: 'color.border',\n\tborderWidth: 'border.width',\n\tborderStyle: 'solid',\n});\n\nconst stickyStyles = xcss({\n\tposition: 'sticky',\n\tleft: '0',\n\tbackgroundColor: 'elevation.surface',\n});\n\nconst rowStyles = xcss({\n\theight: 'size.400',\n\tposition: 'relative',\n\tborderColor: 'color.border',\n\tborderWidth: 'border.width',\n\tborderStyle: 'solid',\n});\n\nconst wrapperStyles = xcss({\n\toverflow: 'auto',\n\tdisplay: 'flex',\n\tmaxHeight: '500px',\n});\n\nconst scrollLockStyles = xcss({\n\toverflowX: 'hidden',\n});\n\nconst tableStyles = xcss({\n\ttableLayout: 'fixed',\n\tborderWidth: 'border.width',\n\tborderColor: 'color.border',\n\tborderStyle: 'solid',\n\tborderRadius: 'radius.small',\n\tbackgroundColor: 'elevation.surface.sunken',\n});\n"
  },
  {
    "path": "packages/auto-scroll/examples/unsafe-overflow-box.tsx",
    "content": "import React, { useEffect, useRef, useState } from 'react';\n\nimport invariant from 'tiny-invariant';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, xcss } from '@atlaskit/primitives';\n\nimport { unsafeOverflowAutoScrollForElements } from '../src/entry-point/unsafe-overflow/element';\n\nfunction getHugeContent(): string {\n\treturn Array.from({ length: 10000 }, (_, index) => `index:${index}`).join(' ');\n}\n\nconst scrollContainerStyles = xcss({\n\toverflowX: 'scroll',\n\toverflowY: 'scroll',\n\twidth: '400px',\n\theight: '400px',\n\tborderWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border',\n\tpadding: 'space.200',\n\tgap: 'space.200',\n});\nconst containerStyles = xcss({\n\theight: '100vh',\n\tdisplay: 'flex',\n\tflexDirection: 'column',\n\talignItems: 'center',\n\tjustifyContent: 'center',\n});\nconst draggableStyles = xcss({\n\tpadding: 'space.100',\n\tbackgroundColor: 'color.background.accent.blue.subtle',\n});\n\nconst contentStyles = xcss({\n\twidth: '1000px',\n});\n\nexport default function Example(): React.JSX.Element {\n\tconst [content] = useState(() => getHugeContent());\n\tconst scrollableRef = useRef<HTMLDivElement | null>(null);\n\tconst draggableRef = useRef<HTMLDivElement | null>(null);\n\n\tuseEffect(() => {\n\t\tconst scrollableEl = scrollableRef.current;\n\t\tinvariant(scrollableEl);\n\n\t\tscrollableEl.scrollTop = scrollableEl.scrollHeight / 2;\n\t\tscrollableEl.scrollLeft = scrollableEl.scrollWidth / 2;\n\t}, []);\n\n\tuseEffect(() => {\n\t\tconst scrollableEl = scrollableRef.current;\n\t\tconst draggableEl = draggableRef.current;\n\t\tinvariant(scrollableEl && draggableEl);\n\t\treturn combine(\n\t\t\tdraggable({\n\t\t\t\telement: draggableEl,\n\t\t\t}),\n\t\t\tunsafeOverflowAutoScrollForElements({\n\t\t\t\telement: scrollableEl,\n\t\t\t\tgetOverflow() {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tforTopEdge: {\n\t\t\t\t\t\t\ttop: 100,\n\t\t\t\t\t\t\tleft: 100,\n\t\t\t\t\t\t\tright: 100,\n\t\t\t\t\t\t},\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, []);\n\n\treturn (\n\t\t<Box xcss={containerStyles}>\n\t\t\t<Box xcss={scrollContainerStyles} ref={scrollableRef}>\n\t\t\t\t<Box xcss={contentStyles}>{content}</Box>\n\t\t\t</Box>\n\t\t\t<Box xcss={draggableStyles} ref={draggableRef}>\n\t\t\t\tDrag me\n\t\t\t</Box>\n\t\t</Box>\n\t);\n}\n"
  },
  {
    "path": "packages/auto-scroll/examples/unsafe-overflow-only.tsx",
    "content": "import React from 'react';\n\nimport { type autoScrollForElements } from '../src/entry-point/element';\nimport { unsafeOverflowAutoScrollForElements } from '../src/entry-point/unsafe-overflow/element';\n\nimport { Board } from './pieces/board';\nimport { BoardContext, type TBoardContext } from './pieces/board-context';\n\nconst context: TBoardContext = {\n\tautoScrollBoard: (\n\t\targs: Parameters<typeof autoScrollForElements>[0],\n\t): ReturnType<typeof autoScrollForElements> => {\n\t\treturn unsafeOverflowAutoScrollForElements({\n\t\t\t...args,\n\t\t\t// allow auto scrolling all around the board\n\t\t\tgetOverflow: () => ({\n\t\t\t\tforTopEdge: {\n\t\t\t\t\ttop: 6000,\n\t\t\t\t\tright: 6000,\n\t\t\t\t\tleft: 6000,\n\t\t\t\t},\n\t\t\t\tforRightEdge: {\n\t\t\t\t\ttop: 6000,\n\t\t\t\t\tright: 6000,\n\t\t\t\t\tbottom: 6000,\n\t\t\t\t},\n\t\t\t\tforBottomEdge: {\n\t\t\t\t\tright: 6000,\n\t\t\t\t\tbottom: 6000,\n\t\t\t\t\tleft: 6000,\n\t\t\t\t},\n\t\t\t\tforLeftEdge: {\n\t\t\t\t\ttop: 6000,\n\t\t\t\t\tleft: 6000,\n\t\t\t\t\tbottom: 6000,\n\t\t\t\t},\n\t\t\t}),\n\t\t});\n\t},\n\tautoScrollColumn: (\n\t\targs: Parameters<typeof autoScrollForElements>[0],\n\t): ReturnType<typeof autoScrollForElements> => {\n\t\treturn unsafeOverflowAutoScrollForElements({\n\t\t\t...args,\n\t\t\t// allow auto scrolling above and below the column\n\t\t\tgetOverflow: () => ({\n\t\t\t\tforTopEdge: {\n\t\t\t\t\ttop: 6000,\n\t\t\t\t\tright: 0,\n\t\t\t\t\tleft: 0,\n\t\t\t\t},\n\t\t\t\tforBottomEdge: {\n\t\t\t\t\tright: 0,\n\t\t\t\t\tbottom: 6000,\n\t\t\t\t\tleft: 0,\n\t\t\t\t},\n\t\t\t}),\n\t\t});\n\t},\n};\n\nexport default function UnsafeOverflowOnly(): React.JSX.Element {\n\treturn (\n\t\t<BoardContext.Provider value={context}>\n\t\t\t<Board />\n\t\t</BoardContext.Provider>\n\t);\n}\n"
  },
  {
    "path": "packages/auto-scroll/examples/unsafe-overflow.tsx",
    "content": "import React from 'react';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\n\nimport { autoScrollForElements } from '../src/entry-point/element';\nimport { unsafeOverflowAutoScrollForElements } from '../src/entry-point/unsafe-overflow/element';\n\nimport { Board } from './pieces/board';\nimport { BoardContext, type TBoardContext } from './pieces/board-context';\n\nconst context: TBoardContext = {\n\tautoScrollBoard: (\n\t\targs: Parameters<typeof autoScrollForElements>[0],\n\t): ReturnType<typeof autoScrollForElements> => {\n\t\treturn combine(\n\t\t\tautoScrollForElements(args),\n\t\t\tunsafeOverflowAutoScrollForElements({\n\t\t\t\t...args,\n\t\t\t\t// allow auto scrolling all around the board\n\t\t\t\tgetOverflow: () => ({\n\t\t\t\t\tforTopEdge: {\n\t\t\t\t\t\ttop: 6000,\n\t\t\t\t\t\tright: 6000,\n\t\t\t\t\t\tleft: 6000,\n\t\t\t\t\t},\n\t\t\t\t\tforRightEdge: {\n\t\t\t\t\t\ttop: 6000,\n\t\t\t\t\t\tright: 6000,\n\t\t\t\t\t\tbottom: 6000,\n\t\t\t\t\t},\n\t\t\t\t\tforBottomEdge: {\n\t\t\t\t\t\tright: 6000,\n\t\t\t\t\t\tbottom: 6000,\n\t\t\t\t\t\tleft: 6000,\n\t\t\t\t\t},\n\t\t\t\t\tforLeftEdge: {\n\t\t\t\t\t\ttop: 6000,\n\t\t\t\t\t\tleft: 6000,\n\t\t\t\t\t\tbottom: 6000,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t}),\n\t\t);\n\t},\n\tautoScrollColumn: (\n\t\targs: Parameters<typeof autoScrollForElements>[0],\n\t): ReturnType<typeof autoScrollForElements> => {\n\t\treturn combine(\n\t\t\tautoScrollForElements(args),\n\t\t\tunsafeOverflowAutoScrollForElements({\n\t\t\t\t...args,\n\t\t\t\t// allow auto scrolling above and below the column\n\t\t\t\tgetOverflow: () => ({\n\t\t\t\t\tforTopEdge: {\n\t\t\t\t\t\ttop: 6000,\n\t\t\t\t\t\tright: 0,\n\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t},\n\t\t\t\t\tforBottomEdge: {\n\t\t\t\t\t\tright: 0,\n\t\t\t\t\t\tbottom: 6000,\n\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t}),\n\t\t);\n\t},\n};\n\nexport default function UnsafeOverflow(): React.JSX.Element {\n\treturn (\n\t\t<BoardContext.Provider value={context}>\n\t\t\t<Board />\n\t\t</BoardContext.Provider>\n\t);\n}\n"
  },
  {
    "path": "packages/auto-scroll/examples/window-scroll-with-scroll-container.tsx",
    "content": "/* eslint-disable @atlaskit/design-system/no-nested-styles */\n/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { Fragment, useEffect, useRef } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, Global, jsx } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Stack, xcss } from '@atlaskit/primitives';\n\nimport { autoScrollForElements, autoScrollWindowForElements } from '../src/entry-point/element';\n\nconst globalStyles = css({\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':root': {\n\t\t'--grid': '8px',\n\t},\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766\n\tbody: {\n\t\theight: '150vh',\n\t},\n});\n\ntype ItemType = {\n\tid: string;\n};\n\nconst itemStyles = xcss({\n\tpadding: 'space.050',\n\tborderWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border.brand',\n\tborderRadius: 'radius.small',\n\tbackgroundColor: 'color.background.accent.lime.subtlest',\n\twidth: '300px',\n});\n\nfunction Item({ item }: { item: ItemType }) {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\t\treturn combine(\n\t\t\tdraggable({\n\t\t\t\telement,\n\t\t\t\tgetInitialData: () => item,\n\t\t\t}),\n\t\t\tdropTargetForElements({ element, getIsSticky: () => true }),\n\t\t);\n\t}, [item]);\n\treturn (\n\t\t<Box xcss={itemStyles} ref={ref}>\n\t\t\t{item.id}\n\t\t</Box>\n\t);\n}\n\nconst items: ItemType[] = Array.from({ length: 200 }).map((_, i) => ({\n\tid: `id:${i}`,\n}));\n\nconst scrollContainerStyles = xcss({\n\theight: '100vh',\n\toverflowY: 'scroll',\n});\n\nconst rootStyles = xcss({\n\tbackgroundColor: 'color.background.accent.blue.subtle',\n\theight: '200vh',\n\twidth: '200vw',\n});\n\nexport default function WindowScroll(): React.JSX.Element {\n\tconst scrollContainerRef = useRef<HTMLDivElement | null>(null);\n\tuseEffect(() => {\n\t\tconst scrollContainer = scrollContainerRef.current;\n\t\tinvariant(scrollContainer);\n\t\treturn combine(\n\t\t\tautoScrollWindowForElements(),\n\t\t\tautoScrollForElements({\n\t\t\t\telement: scrollContainer,\n\t\t\t}),\n\t\t);\n\t});\n\treturn (\n\t\t<Fragment>\n\t\t\t<Global styles={globalStyles} />\n\t\t\t<Box xcss={rootStyles}>\n\t\t\t\t<Box ref={scrollContainerRef} xcss={scrollContainerStyles}>\n\t\t\t\t\t<Stack space=\"space.050\">\n\t\t\t\t\t\t{items.map((item) => (\n\t\t\t\t\t\t\t<Item item={item} key={item.id} />\n\t\t\t\t\t\t))}\n\t\t\t\t\t</Stack>\n\t\t\t\t</Box>\n\t\t\t</Box>\n\t\t</Fragment>\n\t);\n}\n"
  },
  {
    "path": "packages/auto-scroll/examples/window-scroll.tsx",
    "content": "/* eslint-disable @atlaskit/design-system/no-nested-styles */\n/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { Fragment, useEffect, useRef } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, Global, jsx } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, xcss } from '@atlaskit/primitives';\n\nimport { autoScrollWindowForElements } from '../src/entry-point/element';\n\nconst globalStyles = css({\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':root': {\n\t\t'--grid': '8px',\n\t},\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766\n\tbody: {\n\t\theight: '150vh',\n\t},\n});\n\ntype ItemType = {\n\tid: string;\n};\n\nconst itemStyles = xcss({\n\tpadding: 'space.050',\n\tborderWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border.brand',\n\tborderRadius: 'radius.small',\n\tbackgroundColor: 'color.background.accent.lime.subtlest',\n\twidth: '300px',\n});\n\nfunction Item({ item }: { item: ItemType }) {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\t\treturn combine(\n\t\t\tdraggable({\n\t\t\t\telement,\n\t\t\t\tgetInitialData: () => item,\n\t\t\t}),\n\t\t\tdropTargetForElements({ element, getIsSticky: () => true }),\n\t\t);\n\t}, [item]);\n\treturn (\n\t\t<Box xcss={itemStyles} ref={ref}>\n\t\t\t{item.id}\n\t\t</Box>\n\t);\n}\n\nconst items: ItemType[] = Array.from({ length: 200 }).map((_, i) => ({\n\tid: `id:${i}`,\n}));\n\nconst listStyles = xcss({\n\tdisplay: 'flex',\n\tflexDirection: 'column',\n\tgap: 'space.050',\n\twidth: '200vw',\n});\n\nexport default function WindowScroll(): React.JSX.Element {\n\tuseEffect(() => {\n\t\treturn autoScrollWindowForElements();\n\t});\n\treturn (\n\t\t<Fragment>\n\t\t\t<Global styles={globalStyles} />\n\t\t\t<Box xcss={listStyles}>\n\t\t\t\t{items.map((item) => (\n\t\t\t\t\t<Item item={item} key={item.id} />\n\t\t\t\t))}\n\t\t\t</Box>\n\t\t</Fragment>\n\t);\n}\n"
  },
  {
    "path": "packages/auto-scroll/package.json",
    "content": "{\n  \"name\": \"@atlaskit/pragmatic-drag-and-drop-auto-scroll\",\n  \"version\": \"2.1.5\",\n  \"description\": \"An optional Pragmatic drag and drop package that enables automatic scrolling during a drag operation\",\n  \"author\": \"Atlassian Pty Ltd\",\n  \"license\": \"Apache-2.0\",\n  \"publishConfig\": {\n    \"registry\": \"https://registry.npmjs.org/\"\n  },\n  \"repository\": \"https://github.com/atlassian/pragmatic-drag-and-drop\",\n  \"main\": \"dist/cjs/index.js\",\n  \"module\": \"dist/esm/index.js\",\n  \"module:es2019\": \"dist/es2019/index.js\",\n  \"types\": \"dist/types/index.d.ts\",\n  \"sideEffects\": false,\n  \"exports\": {\n    \".\": \"./src/index.ts\",\n    \"./element\": \"./src/entry-point/element.ts\",\n    \"./external\": \"./src/entry-point/external.ts\",\n    \"./text-selection\": \"./src/entry-point/text-selection.ts\",\n    \"./unsafe-overflow/element\": \"./src/entry-point/unsafe-overflow/element.ts\",\n    \"./unsafe-overflow/external\": \"./src/entry-point/unsafe-overflow/external.ts\",\n    \"./unsafe-overflow/text-selection\": \"./src/entry-point/unsafe-overflow/text-selection.ts\"\n  },\n  \"dependencies\": {\n    \"@atlaskit/pragmatic-drag-and-drop\": \"^1.7.0\",\n    \"@babel/runtime\": \"^7.0.0\"\n  },\n  \"devDependencies\": {\n    \"@testing-library/dom\": \"^10.1.0\",\n    \"bind-event-listener\": \"^3.0.0\",\n    \"raf-stub\": \"^2.0.1\",\n    \"tiny-invariant\": \"^1.2.0\"\n  },\n  \"homepage\": \"https://atlassian.design/components/pragmatic-drag-and-drop/\"\n}\n"
  },
  {
    "path": "packages/auto-scroll/src/entry-point/element.ts",
    "content": "import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nimport { makeApi } from '../over-element/make-api';\n\nconst api = makeApi({ monitor: monitorForElements });\n\nexport const autoScrollForElements = api.autoScroll;\nexport const autoScrollWindowForElements = api.autoScrollWindow;\n"
  },
  {
    "path": "packages/auto-scroll/src/entry-point/external.ts",
    "content": "import { monitorForExternal } from '@atlaskit/pragmatic-drag-and-drop/external/adapter';\n\nimport { makeApi } from '../over-element/make-api';\n\nconst api = makeApi({ monitor: monitorForExternal });\n\nexport const autoScrollForExternal = api.autoScroll;\nexport const autoScrollWindowForExternal = api.autoScrollWindow;\n"
  },
  {
    "path": "packages/auto-scroll/src/entry-point/text-selection.ts",
    "content": "import { monitorForTextSelection } from '@atlaskit/pragmatic-drag-and-drop/text-selection/adapter';\n\nimport { makeApi } from '../over-element/make-api';\n\nconst api = makeApi({ monitor: monitorForTextSelection });\n\nexport const autoScrollForTextSelection = api.autoScroll;\nexport const autoScrollWindowForTextSelection = api.autoScrollWindow;\n"
  },
  {
    "path": "packages/auto-scroll/src/entry-point/unsafe-overflow/element.ts",
    "content": "import { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nimport { makeApi } from '../../unsafe-overflow/make-api';\n\nconst api = makeApi({ monitor: monitorForElements });\n\nexport const unsafeOverflowAutoScrollForElements = api.unsafeOverflowAutoScroll;\n"
  },
  {
    "path": "packages/auto-scroll/src/entry-point/unsafe-overflow/external.ts",
    "content": "import { monitorForExternal } from '@atlaskit/pragmatic-drag-and-drop/external/adapter';\n\nimport { makeApi } from '../../unsafe-overflow/make-api';\n\nconst api = makeApi({ monitor: monitorForExternal });\n\nexport const unsafeOverflowAutoScrollForExternal = api.unsafeOverflowAutoScroll;\n"
  },
  {
    "path": "packages/auto-scroll/src/entry-point/unsafe-overflow/text-selection.ts",
    "content": "import { monitorForTextSelection } from '@atlaskit/pragmatic-drag-and-drop/text-selection/adapter';\n\nimport { makeApi } from '../../unsafe-overflow/make-api';\n\nconst api = makeApi({ monitor: monitorForTextSelection });\n\nexport const unsafeOverflowAutoScrollForTextSelection = api.unsafeOverflowAutoScroll;\n"
  },
  {
    "path": "packages/auto-scroll/src/index.ts",
    "content": "export default {};\n"
  },
  {
    "path": "packages/auto-scroll/src/internal-types.ts",
    "content": "import type { AllDragTypes, Input } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nexport type ElementGetFeedbackArgs<DragType extends AllDragTypes> = {\n\t/**\n\t * The users _current_ input\n\t */\n\tinput: Input;\n\t/**\n\t * The data associated with the entity being dragged\n\t */\n\tsource: DragType['payload'];\n\t/**\n\t * The element trying to be scrolled\n\t */\n\telement: Element;\n};\n\nexport type WindowGetFeedbackArgs<DragType extends AllDragTypes> = Omit<\n\tElementGetFeedbackArgs<DragType>,\n\t'element'\n>;\n\nexport type Spacing = {\n\ttop: number;\n\tright: number;\n\tbottom: number;\n\tleft: number;\n};\n\nexport type Edge = keyof Spacing;\n\nexport type EngagementHistoryEntry = {\n\ttimeOfEngagementStart: number;\n};\n\nexport type InternalConfig = {\n\tstartHitboxAtPercentageRemainingOfElement: Spacing;\n\tmaxScrollAtPercentageRemainingOfHitbox: Spacing;\n\tmaxPixelScrollPerSecond: number;\n\ttimeDampeningDurationMs: number;\n\tmaxMainAxisHitboxSize: number;\n};\n\nexport type PublicConfig = Partial<{\n\tmaxScrollSpeed: 'standard' | 'fast';\n}>;\n\nexport type ElementAutoScrollArgs<DragType extends AllDragTypes> = {\n\telement: Element;\n\tcanScroll?: (args: ElementGetFeedbackArgs<DragType>) => boolean;\n\tgetAllowedAxis?: (args: ElementGetFeedbackArgs<DragType>) => AllowedAxis;\n\tgetConfiguration?: (args: ElementGetFeedbackArgs<DragType>) => PublicConfig;\n};\n\nexport type WindowAutoScrollArgs<DragType extends AllDragTypes> = {\n\tcanScroll?: (args: WindowGetFeedbackArgs<DragType>) => boolean;\n\tgetAllowedAxis?: (args: WindowGetFeedbackArgs<DragType>) => AllowedAxis;\n\tgetConfiguration?: (args: WindowGetFeedbackArgs<DragType>) => PublicConfig;\n};\n\nexport type Side = 'start' | 'end';\nexport type Axis = 'vertical' | 'horizontal';\nexport type AllowedAxis = Axis | 'all';\n"
  },
  {
    "path": "packages/auto-scroll/src/over-element/data-attributes.ts",
    "content": "import type { CleanupFn } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nexport const dataAttribute = 'data-auto-scrollable';\nexport const selector = `[${dataAttribute}=\"true\"]`;\n\nexport function addScrollableAttribute(element: Element): CleanupFn {\n\telement.setAttribute(dataAttribute, 'true');\n\treturn () => element.removeAttribute(dataAttribute);\n}\n"
  },
  {
    "path": "packages/auto-scroll/src/over-element/get-scroll-by.ts",
    "content": "import type { Input, Position } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport type {\n\tAllowedAxis,\n\tAxis,\n\tEdge,\n\tEngagementHistoryEntry,\n\tInternalConfig,\n} from '../internal-types';\nimport { canScrollOnEdge } from '../shared/can-scroll-on-edge';\nimport { edgeAxisLookup, edges } from '../shared/edges';\nimport { getOverElementHitbox } from '../shared/get-over-element-hitbox';\nimport { getScrollChange } from '../shared/get-scroll-change';\nimport { isAxisAllowed } from '../shared/is-axis-allowed';\nimport { isWithin } from '../shared/is-within';\n\ntype ScrollableEdge = {\n\tedge: Edge;\n\thitbox: DOMRect;\n};\n\nfunction getRectDefault(element: Element) {\n\treturn element.getBoundingClientRect();\n}\n\nexport function getScrollBy({\n\telement,\n\tinput,\n\ttimeSinceLastFrame,\n\tengagement,\n\tconfig,\n\tallowedAxis,\n\tgetRect = getRectDefault,\n}: {\n\telement: Element;\n\tinput: Input;\n\tengagement: EngagementHistoryEntry;\n\ttimeSinceLastFrame: number;\n\tallowedAxis: AllowedAxis;\n\tconfig: InternalConfig;\n\tgetRect?: (element: Element) => DOMRect;\n}): Required<Pick<ScrollToOptions, 'top' | 'left'>> {\n\tconst client: Position = {\n\t\tx: input.clientX,\n\t\ty: input.clientY,\n\t};\n\tconst clientRect: DOMRect = getRect(element);\n\n\tconst scrollableEdges: Map<Edge, ScrollableEdge> = edges.reduce((map, edge) => {\n\t\tconst hitbox = getOverElementHitbox[edge]({ clientRect, config });\n\t\tconst axis = edgeAxisLookup[edge];\n\n\t\t// Note: changing the allowed axis during a drag will not\n\t\t// reset time dampening. It was decided it would be too\n\t\t// complex to implement initially, and we can add it\n\t\t// later if needed.\n\t\tif (!isAxisAllowed(axis, allowedAxis)) {\n\t\t\treturn map;\n\t\t}\n\n\t\tif (!isWithin({ client, clientRect: hitbox })) {\n\t\t\treturn map;\n\t\t}\n\t\tif (!canScrollOnEdge[edge](element)) {\n\t\t\treturn map;\n\t\t}\n\n\t\tmap.set(edge, { edge, hitbox });\n\t\treturn map;\n\t}, new Map<Edge, ScrollableEdge>());\n\n\tconst left: number = (() => {\n\t\tconst axis: Axis = 'horizontal';\n\t\tconst leftEdge = scrollableEdges.get('left');\n\t\tif (leftEdge) {\n\t\t\treturn getScrollChange({\n\t\t\t\tclient,\n\t\t\t\tedge: leftEdge.edge,\n\t\t\t\thitbox: leftEdge.hitbox,\n\t\t\t\taxis,\n\t\t\t\ttimeSinceLastFrame,\n\t\t\t\tengagement,\n\t\t\t\tisDistanceDampeningEnabled: true,\n\t\t\t\tconfig,\n\t\t\t});\n\t\t}\n\t\tconst rightEdge = scrollableEdges.get('right');\n\t\tif (rightEdge) {\n\t\t\treturn getScrollChange({\n\t\t\t\tclient,\n\t\t\t\tedge: rightEdge.edge,\n\t\t\t\thitbox: rightEdge.hitbox,\n\t\t\t\taxis,\n\t\t\t\ttimeSinceLastFrame,\n\t\t\t\tengagement,\n\t\t\t\tisDistanceDampeningEnabled: true,\n\t\t\t\tconfig,\n\t\t\t});\n\t\t}\n\n\t\treturn 0;\n\t})();\n\n\tconst top: number = (() => {\n\t\tconst axis: Axis = 'vertical';\n\t\tconst bottomEdge = scrollableEdges.get('bottom');\n\t\tif (bottomEdge) {\n\t\t\treturn getScrollChange({\n\t\t\t\tclient,\n\t\t\t\tedge: bottomEdge.edge,\n\t\t\t\thitbox: bottomEdge.hitbox,\n\t\t\t\taxis,\n\t\t\t\ttimeSinceLastFrame,\n\t\t\t\tengagement,\n\t\t\t\tisDistanceDampeningEnabled: true,\n\t\t\t\tconfig,\n\t\t\t});\n\t\t}\n\t\tconst topEdge = scrollableEdges.get('top');\n\t\tif (topEdge) {\n\t\t\treturn getScrollChange({\n\t\t\t\tclient,\n\t\t\t\tedge: topEdge.edge,\n\t\t\t\thitbox: topEdge.hitbox,\n\t\t\t\taxis,\n\t\t\t\ttimeSinceLastFrame,\n\t\t\t\tengagement,\n\t\t\t\tisDistanceDampeningEnabled: true,\n\t\t\t\tconfig,\n\t\t\t});\n\t\t}\n\n\t\treturn 0;\n\t})();\n\n\treturn {\n\t\tleft,\n\t\ttop,\n\t};\n}\n"
  },
  {
    "path": "packages/auto-scroll/src/over-element/make-api.ts",
    "content": "import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { once } from '@atlaskit/pragmatic-drag-and-drop/once';\nimport type {\n\tAllDragTypes,\n\tBaseEventPayload,\n\tCleanupFn,\n\tMonitorArgs,\n} from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport type { ElementAutoScrollArgs, WindowAutoScrollArgs } from '../internal-types';\nimport { getScheduler } from '../shared/scheduler';\n\nimport { addScrollableAttribute } from './data-attributes';\nimport { tryScroll } from './try-scroll';\n\nexport function makeApi<DragType extends AllDragTypes>({\n\tmonitor,\n}: {\n\tmonitor: (args: MonitorArgs<DragType>) => CleanupFn;\n}) {\n\tconst elementRegistry: Map<Element, ElementAutoScrollArgs<DragType>> = new Map();\n\tconst windowRegistry: Set<WindowAutoScrollArgs<DragType>> = new Set();\n\n\tfunction autoScroll(args: ElementAutoScrollArgs<DragType>): CleanupFn {\n\t\t// Warn during development if trying to add auto scroll to an element\n\t\t// that is not scrollable.\n\t\t// Note: this can produce a false positive when a scroll container is not\n\t\t// scrollable initially, but becomes scrollable during a drag.\n\t\t// I thought of adding the warning as I think it would be a more common pitfall\n\t\t// to accidentally register auto scrolling on the wrong element\n\t\t// If requested, we could provide a mechanism to opt out of this warning\n\t\tif (process.env.NODE_ENV !== 'production') {\n\t\t\tconst { overflowX, overflowY }: CSSStyleDeclaration = window.getComputedStyle(args.element);\n\t\t\tconst isScrollable =\n\t\t\t\toverflowX === 'auto' ||\n\t\t\t\toverflowX === 'scroll' ||\n\t\t\t\toverflowY === 'auto' ||\n\t\t\t\toverflowY === 'scroll';\n\t\t\tif (!isScrollable) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn(\n\t\t\t\t\t'Auto scrolling has been attached to an element that appears not to be scrollable',\n\t\t\t\t\t{ element: args.element, overflowX, overflowY },\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\t// Warn if there is an existing registration\n\t\tif (process.env.NODE_ENV !== 'production') {\n\t\t\tconst existing = elementRegistry.get(args.element);\n\t\t\tif (existing) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn('You have already registered autoScrolling on the same element', {\n\t\t\t\t\texisting,\n\t\t\t\t\tproposed: args,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\telementRegistry.set(args.element, args);\n\n\t\tconst cleanup = combine(addScrollableAttribute(args.element), () =>\n\t\t\telementRegistry.delete(args.element),\n\t\t);\n\n\t\treturn once(cleanup);\n\t}\n\n\tfunction autoScrollWindow(args: WindowAutoScrollArgs<DragType> = {}): CleanupFn {\n\t\t// Putting `args` in a unique object so that\n\t\t// each call will create a unique entry, even if a consumer\n\t\t// shares the `args` object between calls.\n\t\t// Just being safe here.\n\t\tconst unique = { ...args };\n\t\twindowRegistry.add(unique);\n\n\t\tfunction cleanup() {\n\t\t\twindowRegistry.delete(unique);\n\t\t}\n\n\t\treturn once(cleanup);\n\t}\n\n\tfunction findEntry(element: Element): ElementAutoScrollArgs<DragType> | null {\n\t\treturn elementRegistry.get(element) ?? null;\n\t}\n\n\tfunction getWindowScrollEntries(): WindowAutoScrollArgs<DragType>[] {\n\t\treturn Array.from(windowRegistry);\n\t}\n\n\tfunction onFrame({\n\t\tlatestArgs,\n\t\tunderUsersPointer,\n\t\ttimeSinceLastFrame,\n\t}: {\n\t\tlatestArgs: BaseEventPayload<DragType>;\n\t\tunderUsersPointer: Element | null;\n\t\ttimeSinceLastFrame: number;\n\t}) {\n\t\ttryScroll({\n\t\t\tinput: latestArgs.location.current.input,\n\t\t\tsource: latestArgs.source,\n\t\t\tfindEntry,\n\t\t\tunderUsersPointer,\n\t\t\ttimeSinceLastFrame,\n\t\t\tgetWindowScrollEntries,\n\t\t});\n\t}\n\n\tgetScheduler(monitor).onFrame(onFrame);\n\n\treturn {\n\t\tautoScroll,\n\t\tautoScrollWindow,\n\t};\n}\n"
  },
  {
    "path": "packages/auto-scroll/src/over-element/try-scroll.ts",
    "content": "import type { AllDragTypes, Input } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport {\n\ttype AllowedAxis,\n\ttype ElementAutoScrollArgs,\n\ttype ElementGetFeedbackArgs,\n\ttype EngagementHistoryEntry,\n\ttype InternalConfig,\n\ttype WindowAutoScrollArgs,\n} from '../internal-types';\nimport { getInternalConfig } from '../shared/configuration';\nimport { markAndGetEngagement } from '../shared/engagement-history';\n\nimport { selector } from './data-attributes';\nimport { getScrollBy } from './get-scroll-by';\n\ntype AvailableScrollDirection = { top: boolean; left: boolean };\n\nfunction isScrollingAvailable(value: AvailableScrollDirection): boolean {\n\treturn Boolean(value.top || value.left);\n}\n\nfunction tryScrollElements<DragType extends AllDragTypes>({\n\ttarget,\n\tinput,\n\tsource,\n\tfindEntry,\n\ttimeSinceLastFrame,\n\tavailable = { top: true, left: true },\n}: {\n\ttarget: Element | null;\n\tinput: Input;\n\tsource: DragType['payload'];\n\ttimeSinceLastFrame: number;\n\tfindEntry: (element: Element) => ElementAutoScrollArgs<DragType> | null;\n\tavailable?: AvailableScrollDirection;\n}): AvailableScrollDirection {\n\t// we cannot do any more scrolling\n\tif (!isScrollingAvailable(available)) {\n\t\treturn available;\n\t}\n\n\t// run out of parents to search\n\tif (!target) {\n\t\treturn available;\n\t}\n\n\tconst element = target.closest(selector);\n\n\t// cannot find any more scroll containers\n\tif (!element) {\n\t\treturn available;\n\t}\n\n\tconst container = findEntry(element);\n\n\t// cannot find registration, this is bad.\n\t// fail and just exit\n\tif (!container) {\n\t\treturn available;\n\t}\n\n\tfunction continueSearchUp() {\n\t\treturn tryScrollElements({\n\t\t\ttarget: element?.parentElement ?? null,\n\t\t\tfindEntry,\n\t\t\tsource,\n\t\t\ttimeSinceLastFrame,\n\t\t\tinput,\n\t\t\tavailable,\n\t\t});\n\t}\n\n\tconst feedback: ElementGetFeedbackArgs<DragType> = {\n\t\tinput,\n\t\tsource,\n\t\telement,\n\t};\n\n\t// Engagement is not marked if scrolling is explicitly not allowed\n\tif (container.canScroll && !container.canScroll(feedback)) {\n\t\treturn continueSearchUp();\n\t}\n\n\t// Marking engagement even if no edges are scrollable.\n\t// We are marking engagement as soon as the element is scrolled over\n\tconst engagement = markAndGetEngagement(element);\n\n\tconst config: InternalConfig = getInternalConfig(container.getConfiguration?.(feedback));\n\n\tconst allowedAxis: AllowedAxis = container.getAllowedAxis?.(feedback) ?? 'all';\n\n\tconst scrollBy = getScrollBy({\n\t\telement,\n\t\tengagement,\n\t\tinput,\n\t\ttimeSinceLastFrame,\n\t\tallowedAxis,\n\t\tconfig,\n\t});\n\n\t// Only allow scrolling in directions that have not already been used\n\tconst scroll = { top: 0, left: 0 };\n\n\tif (available.top && scrollBy.top !== 0) {\n\t\tscroll.top = scrollBy.top;\n\t\t// can no longer scroll on the top after this\n\t\tavailable.top = false;\n\t}\n\n\tif (available.left && scrollBy.left !== 0) {\n\t\tscroll.left = scrollBy.left;\n\t\t// can no longer scroll on the left after this\n\t\tavailable.left = false;\n\t}\n\n\t// Only scroll if there is something to scroll\n\tif (scroll.top !== 0 || scroll.left !== 0) {\n\t\telement.scrollBy(scroll);\n\t}\n\n\treturn continueSearchUp();\n}\n\nfunction tryScrollWindow<DragType extends AllDragTypes>({\n\tinput,\n\ttimeSinceLastFrame,\n\tavailable,\n\tsource,\n\tentries,\n}: {\n\tinput: Input;\n\ttimeSinceLastFrame: number;\n\tavailable: AvailableScrollDirection;\n\tsource: DragType['payload'];\n\tentries: WindowAutoScrollArgs<DragType>[];\n}): void {\n\tconst element = document.documentElement;\n\n\tconst feedback: ElementGetFeedbackArgs<DragType> = {\n\t\tinput,\n\t\tsource,\n\t\telement,\n\t};\n\n\tfor (const entry of entries) {\n\t\t// this entry is not allowing scrolling, we need to look for another\n\t\tif (entry.canScroll && !entry.canScroll(feedback)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t// Note: if we had an event for when the user is leaving a tab\n\t\t// we _could_ conceptually reset the engagement\n\t\tconst engagement: EngagementHistoryEntry = markAndGetEngagement(element);\n\n\t\tconst config: InternalConfig = getInternalConfig(entry.getConfiguration?.(feedback));\n\n\t\tconst allowedAxis: AllowedAxis = entry.getAllowedAxis?.(feedback) ?? 'all';\n\n\t\tconst scrollBy = getScrollBy({\n\t\t\telement,\n\t\t\tengagement,\n\t\t\tinput,\n\t\t\tconfig,\n\t\t\tallowedAxis,\n\t\t\tgetRect: (element: Element) =>\n\t\t\t\tDOMRect.fromRect({\n\t\t\t\t\ty: 0,\n\t\t\t\t\tx: 0,\n\t\t\t\t\twidth: element.clientWidth,\n\t\t\t\t\theight: element.clientHeight,\n\t\t\t\t}),\n\t\t\ttimeSinceLastFrame,\n\t\t});\n\n\t\tconst scroll = {\n\t\t\ttop: available.top ? scrollBy.top : 0,\n\t\t\tleft: available.left ? scrollBy.left : 0,\n\t\t};\n\n\t\t// only trigger a scroll if we are actually scrolling\n\t\tif (scroll.top !== 0 || scroll.left !== 0) {\n\t\t\telement.scrollBy(scroll);\n\t\t}\n\n\t\t// We only want the window to scroll once\n\t\tbreak;\n\t}\n}\n\nexport function tryScroll<DragType extends AllDragTypes>({\n\tinput,\n\tfindEntry,\n\ttimeSinceLastFrame,\n\tsource,\n\tgetWindowScrollEntries,\n\tunderUsersPointer,\n}: {\n\tinput: Input;\n\ttimeSinceLastFrame: number;\n\tsource: DragType['payload'];\n\tfindEntry: (element: Element) => ElementAutoScrollArgs<DragType> | null;\n\tgetWindowScrollEntries: () => WindowAutoScrollArgs<DragType>[];\n\tunderUsersPointer: Element | null;\n}): void {\n\t// We are matching browser behaviour and scrolling inner elements\n\t// before outer ones. So we try to scroll scroller containers before\n\t// the window.\n\tconst remainder: AvailableScrollDirection = tryScrollElements({\n\t\ttarget: underUsersPointer,\n\t\ttimeSinceLastFrame,\n\t\tinput,\n\t\tsource,\n\t\tfindEntry,\n\t});\n\n\t// Check if we can do any window scrolling\n\tif (!isScrollingAvailable(remainder)) {\n\t\treturn;\n\t}\n\n\ttryScrollWindow({\n\t\tinput,\n\t\tsource,\n\t\tentries: getWindowScrollEntries(),\n\t\ttimeSinceLastFrame,\n\t\tavailable: remainder,\n\t});\n}\n"
  },
  {
    "path": "packages/auto-scroll/src/shared/axis.ts",
    "content": "const vertical = {\n\tstart: 'top',\n\tend: 'bottom',\n\tpoint: 'y',\n\tsize: 'height',\n} as const;\n\nconst horizontal = {\n\tstart: 'left',\n\tend: 'right',\n\tpoint: 'x',\n\tsize: 'width',\n} as const;\n\nexport const axisLookup = {\n\tvertical: {\n\t\tmainAxis: vertical,\n\t\tcrossAxis: horizontal,\n\t},\n\thorizontal: {\n\t\tmainAxis: horizontal,\n\t\tcrossAxis: vertical,\n\t},\n} as const;\n"
  },
  {
    "path": "packages/auto-scroll/src/shared/can-scroll-on-edge.ts",
    "content": "import { type Edge } from '../internal-types';\n\nexport const canScrollOnEdge: {\n\t[key in Edge]: (element: Element) => boolean;\n} = {\n\t// Notes:\n\t//\n\t// 🌏 Chrome 115.0: uses fractional units for `scrollLeft` and `scrollTop`\n\t//    (and fractional units don't reach true integer maximum when zoomed in / out)\n\t// 🍎 Safari 16.5.2: no fractional units\n\t// 🦊 Firefox 115.0: no fractional units\n\n\t// we have some scroll we can move backwards into\n\ttop: (element) => element.scrollTop > 0,\n\t// We have some scroll we can move forward into\n\tright: (element) => Math.ceil(element.scrollLeft) + element.clientWidth < element.scrollWidth,\n\t// We have some scroll we can move forwards into\n\tbottom: (element) => Math.ceil(element.scrollTop) + element.clientHeight < element.scrollHeight,\n\t// we have some scroll we can move back into.\n\tleft: (element) => element.scrollLeft > 0,\n};\n"
  },
  {
    "path": "packages/auto-scroll/src/shared/configuration.ts",
    "content": "import type { InternalConfig, PublicConfig } from '../internal-types';\n\nconst baseConfig = {\n\tstartHitboxAtPercentageRemainingOfElement: {\n\t\ttop: 0.25,\n\t\tright: 0.25,\n\t\tbottom: 0.25,\n\t\tleft: 0.25,\n\t},\n\tmaxScrollAtPercentageRemainingOfHitbox: {\n\t\ttop: 0.5,\n\t\tright: 0.5,\n\t\tbottom: 0.5,\n\t\tleft: 0.5,\n\t},\n\ttimeDampeningDurationMs: 400,\n\t// Too big and it's too easy to trigger auto scrolling\n\t// Too small and it's too hard 😅\n\tmaxMainAxisHitboxSize: 180,\n};\n\n/** What the max scroll should be per second. Using \"per second\" rather than \"per frame\"\n * as we want a consistent scroll speed regardless of frame rate.\n *\n *\n * I explored trying to make the max scroll speed dynamic based on particular factors.\n * However, it ended up being difficult to find a _perfect_ formula.\n *\n * Likely the perfect answer would involve:\n * - the size of the scrollable element\n * - the size of the scrollable element relative to the screen size\n * - the size of the drag preview\n * - the size of elements being scrolled in scrollable elements (expensive and difficult to compute)\n */\nconst maxPixelScrollPerSecond: {\n\t[Key in Required<PublicConfig>['maxScrollSpeed']]: number;\n} = {\n\t// What the value would be if we were scrolling at 15px per frame at 60fps.\n\t// This is the default as it works well for most experiences.\n\t// In certain scenarios though it can feel a bit slow.\n\tstandard: 15 * 60,\n\t// What the value would be if we were scrolling at 25px per frame at 60fps.\n\t// This is not the default as it feels too fast for a lot of experiences.\n\tfast: 25 * 60,\n};\n\nexport function getInternalConfig(provided?: PublicConfig | undefined): InternalConfig {\n\treturn {\n\t\t...baseConfig,\n\t\t// only allowing limited control over the config at this stage\n\t\tmaxPixelScrollPerSecond: maxPixelScrollPerSecond[provided?.maxScrollSpeed ?? 'standard'],\n\t};\n}\n"
  },
  {
    "path": "packages/auto-scroll/src/shared/edges.ts",
    "content": "import { type Axis, type Edge } from '../internal-types';\n\nexport const edges: Edge[] = ['top', 'right', 'bottom', 'left'];\n\nexport const edgeAxisLookup: Record<Edge, Axis> = {\n\ttop: 'vertical',\n\tright: 'horizontal',\n\tbottom: 'vertical',\n\tleft: 'horizontal',\n};\n"
  },
  {
    "path": "packages/auto-scroll/src/shared/engagement-history.ts",
    "content": "import { type EngagementHistoryEntry } from '../internal-types';\n\nconst ledger: Map<Element, EngagementHistoryEntry> = new Map();\nconst requested: Set<Element> = new Set();\n\nexport function markAndGetEngagement(element: Element): EngagementHistoryEntry {\n\tmarkEngagement(element);\n\n\tconst entry = ledger.get(element);\n\tif (entry) {\n\t\treturn entry;\n\t}\n\tconst fresh: EngagementHistoryEntry = {\n\t\ttimeOfEngagementStart: Date.now(),\n\t};\n\tledger.set(element, fresh);\n\treturn fresh;\n}\n\nexport function markEngagement(element: Element): void {\n\trequested.add(element);\n}\n\nexport function clearUnusedEngagements(fn: () => void): void {\n\t// make sure previous engagement requests don't linger\n\trequested.clear();\n\n\t// perform the required work\n\tfn();\n\n\t// if engagements where not requested, purge it\n\tledger.forEach((_, element) => {\n\t\tif (!requested.has(element)) {\n\t\t\tledger.delete(element);\n\t\t}\n\t});\n\n\t// cleaning up after ourselves\n\trequested.clear();\n}\n\nexport function clearEngagementHistory(): void {\n\tledger.clear();\n}\n"
  },
  {
    "path": "packages/auto-scroll/src/shared/get-over-element-hitbox.ts",
    "content": "import type { Axis, Edge, InternalConfig, Side } from '../internal-types';\n\nimport { axisLookup } from './axis';\nimport { mainAxisSideLookup } from './side';\n\nfunction makeGetHitbox({ edge, axis }: { edge: Edge; axis: Axis }) {\n\treturn function hitbox({ clientRect, config }: { clientRect: DOMRect; config: InternalConfig }) {\n\t\tconst { mainAxis, crossAxis } = axisLookup[axis];\n\t\tconst side: Side = mainAxisSideLookup[edge];\n\n\t\tconst mainAxisHitboxSize: number = Math.min(\n\t\t\t// scale the size of the hitbox down for smaller elements\n\t\t\tconfig.startHitboxAtPercentageRemainingOfElement[edge] * clientRect[mainAxis.size],\n\t\t\t// Don't let the hitbox grow too big for big elements\n\t\t\tconfig.maxMainAxisHitboxSize,\n\t\t);\n\n\t\treturn DOMRect.fromRect({\n\t\t\t[mainAxis.point]:\n\t\t\t\tside === 'start'\n\t\t\t\t\t? // begin from the start edge and grow inwards\n\t\t\t\t\t\tclientRect[mainAxis.point]\n\t\t\t\t\t: // begin from inside the end edge and grow towards the end edge\n\t\t\t\t\t\tclientRect[mainAxis.point] + clientRect[mainAxis.size] - mainAxisHitboxSize,\n\t\t\t[crossAxis.point]: clientRect[crossAxis.point],\n\t\t\t[mainAxis.size]: mainAxisHitboxSize,\n\t\t\t[crossAxis.size]: clientRect[crossAxis.size],\n\t\t});\n\t};\n}\n\nexport const getOverElementHitbox: {\n\t[Key in Edge]: (args: { clientRect: DOMRect; config: InternalConfig }) => DOMRect;\n} = {\n\ttop: makeGetHitbox({\n\t\taxis: 'vertical',\n\t\tedge: 'top',\n\t}),\n\tright: makeGetHitbox({\n\t\taxis: 'horizontal',\n\t\tedge: 'right',\n\t}),\n\tbottom: makeGetHitbox({\n\t\taxis: 'vertical',\n\t\tedge: 'bottom',\n\t}),\n\tleft: makeGetHitbox({\n\t\taxis: 'horizontal',\n\t\tedge: 'left',\n\t}),\n};\n"
  },
  {
    "path": "packages/auto-scroll/src/shared/get-percentage-in-range.ts",
    "content": "export function getPercentageInRange({\n\tstartOfRange,\n\tendOfRange,\n\tvalue,\n}: {\n\tstartOfRange: number;\n\tendOfRange: number;\n\tvalue: number;\n}): number {\n\t// checking inputs\n\tconst isValid: boolean = startOfRange < endOfRange;\n\n\tif (!isValid) {\n\t\treturn 0;\n\t}\n\n\tif (value < startOfRange) {\n\t\treturn 0;\n\t}\n\tif (value > endOfRange) {\n\t\treturn 1;\n\t}\n\n\tconst range: number = endOfRange - startOfRange;\n\treturn (value - startOfRange) / range;\n}\n"
  },
  {
    "path": "packages/auto-scroll/src/shared/get-scroll-change.ts",
    "content": "import { type Position } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport type { Axis, Edge, EngagementHistoryEntry, InternalConfig } from '../internal-types';\n\nimport { axisLookup } from './axis';\nimport { getPercentageInRange } from './get-percentage-in-range';\nimport { mainAxisSideLookup } from './side';\n\n// We want a consistent scroll speed across devices, regardless of framerate\nfunction getMaxScrollChange({\n\ttimeSinceLastFrame,\n\tconfig,\n}: {\n\ttimeSinceLastFrame: number;\n\tconfig: InternalConfig;\n}): number {\n\tconst targetScrollPerMs = config.maxPixelScrollPerSecond / 1000;\n\n\t// Adjusting out target scroll rate to match the frame rate of the target device\n\t// This will pull the scroll speed down on high frame rate devices\n\t// so we get a consistent visual scroll speed regardless of device.\n\tconst proposed = Math.ceil(targetScrollPerMs * timeSinceLastFrame);\n\n\t// If lots of time as passed since that last frame (such on lower frame rate devices)\n\t// we don't want the scroll speed to be too fast, otherwise it can feel jumpy\n\t// We are capping the scroll speed at what it would be if we were hitting 60fps\n\tconst maximum = config.maxPixelScrollPerSecond / 60;\n\n\treturn Math.min(proposed, maximum);\n}\n\nfunction getDistanceDampening({\n\tclient,\n\taxis,\n\tedge,\n\thitbox,\n\tconfig,\n}: {\n\tclient: Position;\n\taxis: Axis;\n\tedge: Edge;\n\thitbox: DOMRect;\n\tconfig: InternalConfig;\n}): number {\n\tconst { mainAxis } = axisLookup[axis];\n\tconst side = mainAxisSideLookup[edge];\n\n\t// We want to hit the max speed before the edge of the hitbox\n\tconst maxSpeedBuffer =\n\t\thitbox[mainAxis.size] * config.maxScrollAtPercentageRemainingOfHitbox[edge];\n\n\tif (side === 'end') {\n\t\treturn getPercentageInRange({\n\t\t\tstartOfRange: hitbox[mainAxis.start],\n\t\t\tendOfRange: hitbox[mainAxis.end] - maxSpeedBuffer,\n\t\t\tvalue: client[mainAxis.point],\n\t\t});\n\t}\n\n\t// Moving towards start edge\n\n\tconst raw = getPercentageInRange({\n\t\tstartOfRange: hitbox[mainAxis.start] + maxSpeedBuffer,\n\t\tendOfRange: hitbox[mainAxis.end],\n\t\tvalue: client[mainAxis.point],\n\t});\n\t// When moving near start edge\n\t// - the 'end' edge is where we start scrolling\n\t// - the 'start' edge is where we reach max speed\n\t// So we need to invert the percentage when moving backwards\n\treturn 1 - raw;\n}\n\nexport function getScrollChange({\n\tclient,\n\ttimeSinceLastFrame,\n\tengagement,\n\taxis,\n\thitbox,\n\tedge,\n\tisDistanceDampeningEnabled,\n\tconfig,\n}: {\n\ttimeSinceLastFrame: number;\n\taxis: Axis;\n\tengagement: EngagementHistoryEntry;\n\tclient: Position;\n\thitbox: DOMRect;\n\tedge: Edge;\n\tisDistanceDampeningEnabled: boolean;\n\tconfig: InternalConfig;\n}): number {\n\t// We have two forms of speed dampening:\n\t// 1. 🗺️ Distance\n\t// The closer you are to a hitbox edge, the faster the scroll speed will be\n\t// 2. ⏱️ Time\n\t// When first entering a scroll container we want to dampening all scrolling\n\t// This is to prevent super fast auto scrolling when first entering into\n\t// a scroll container, or when lifting in a scroll container\n\n\tconst maxScroll = getMaxScrollChange({\n\t\ttimeSinceLastFrame,\n\t\tconfig,\n\t});\n\n\tconst percentageDistanceDampening: number = isDistanceDampeningEnabled\n\t\t? getDistanceDampening({\n\t\t\t\tclient,\n\t\t\t\tedge,\n\t\t\t\thitbox,\n\t\t\t\taxis,\n\t\t\t\tconfig,\n\t\t\t})\n\t\t: 1;\n\n\t// Dampen speed by time\n\tconst percentageThroughTimeDampening = getPercentageInRange({\n\t\tstartOfRange: engagement.timeOfEngagementStart,\n\t\tendOfRange: engagement.timeOfEngagementStart + config.timeDampeningDurationMs,\n\t\tvalue: Date.now(),\n\t});\n\n\t// Calculate how much of the max scroll we should apply based on dampening\n\tconst percentageOfMaxScroll = percentageDistanceDampening * percentageThroughTimeDampening;\n\n\t// We _could_ ease this update (`Math.pow(percentageOfMaxSpeed, 2)`)\n\t// But linear is feeling really good\n\t// Always scrolling by at least one pixel, otherwise the scroll does nothing\n\tconst scroll = Math.max(maxScroll * percentageOfMaxScroll, 1);\n\n\tconst side = mainAxisSideLookup[edge];\n\n\t// When moving backwards, we will be scrolling backwards\n\treturn side === 'end' ? scroll : -1 * scroll;\n}\n"
  },
  {
    "path": "packages/auto-scroll/src/shared/is-axis-allowed.ts",
    "content": "import { type AllowedAxis, type Axis } from '../internal-types';\n\nexport function isAxisAllowed(axis: Axis, allowedAxis: AllowedAxis): boolean {\n\treturn allowedAxis === 'all' || axis === allowedAxis;\n}\n"
  },
  {
    "path": "packages/auto-scroll/src/shared/is-within.ts",
    "content": "import type { Position } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nexport function isWithin({\n\tclient,\n\tclientRect,\n}: {\n\tclient: Position;\n\tclientRect: DOMRect;\n}): boolean {\n\treturn (\n\t\t// is within horizontal bounds\n\t\tclient.x >= clientRect.x &&\n\t\tclient.x <= clientRect.x + clientRect.width &&\n\t\t// is within vertical bounds\n\t\tclient.y >= clientRect.y &&\n\t\tclient.y <= clientRect.y + clientRect.height\n\t);\n}\n"
  },
  {
    "path": "packages/auto-scroll/src/shared/scheduler.ts",
    "content": "import { getElementFromPointWithoutHoneypot } from '@atlaskit/pragmatic-drag-and-drop/private/get-element-from-point-without-honey-pot';\nimport {\n\ttype AllDragTypes,\n\ttype BaseEventPayload,\n\ttype CleanupFn,\n\ttype MonitorArgs,\n} from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport { clearEngagementHistory, clearUnusedEngagements } from './engagement-history';\n\ntype State<DragType extends AllDragTypes> =\n\t| {\n\t\t\ttype: 'idle';\n\t  }\n\t| {\n\t\t\t// When the auto scroller first starts, we need to wait\n\t\t\t// for a single frame before we can start scrolling.\n\t\t\t// This is so that we can always have an accurate `timeSinceLastFrame`.\n\t\t\t// `timeSinceLastFrame` is used to dynamically change the max\n\t\t\t// scroll speed based on the frame rate.\n\t\t\ttype: 'initializing';\n\t\t\tframeId: number;\n\t\t\tlatestArgs: BaseEventPayload<DragType>;\n\t  }\n\t| {\n\t\t\ttype: 'running';\n\t\t\tframeId: number;\n\t\t\ttimeLastFrameFinished: DOMHighResTimeStamp;\n\t\t\tlatestArgs: BaseEventPayload<DragType>;\n\t  };\n\ntype OnFrameFn<DragType extends AllDragTypes> = (args: {\n\t// This is a shared starting point between the\n\t// \"overflow\" and \"over element auto scroller's.\n\t// This is important to ensure that there is a clean handover between the auto scroller's\n\tunderUsersPointer: Element | null;\n\tlatestArgs: BaseEventPayload<DragType>;\n\ttimeSinceLastFrame: number;\n}) => void;\n\ntype Scheduler<DragType extends AllDragTypes> = {\n\tonFrame: (fn: OnFrameFn<DragType>) => void;\n};\n\n// We keep this map so that \"over element\" scrolling and \"overflow\" scrolling\n// can leverage the same scheduler.\n// The 'monitor' is the key for looking up schedulers\nconst schedulers: Map<\n\t(args: MonitorArgs<AllDragTypes>) => CleanupFn,\n\tScheduler<AllDragTypes>\n> = new Map();\n\nexport function getScheduler<DragType extends AllDragTypes>(\n\tmonitor: (args: MonitorArgs<DragType>) => CleanupFn,\n): Scheduler<DragType> {\n\tconst scheduler = schedulers.get(monitor);\n\tif (scheduler) {\n\t\t// @ts-expect-error: I don't know how to link the DragType generic between the key and the value when the\n\t\t// monitor itself is the key\n\t\treturn scheduler;\n\t}\n\tconst created = makeScheduler(monitor);\n\tschedulers.set(monitor, created);\n\treturn created;\n}\n\nfunction makeScheduler<DragType extends AllDragTypes>(\n\tmonitor: (args: MonitorArgs<DragType>) => CleanupFn,\n): Scheduler<DragType> {\n\tlet state: State<DragType> = { type: 'idle' };\n\tconst callbacks: OnFrameFn<DragType>[] = [];\n\n\tfunction loop(timeLastFrameFinished: DOMHighResTimeStamp) {\n\t\tif (state.type !== 'running') {\n\t\t\treturn;\n\t\t}\n\t\tconst timeSinceLastFrame = timeLastFrameFinished - state.timeLastFrameFinished;\n\n\t\tconst { latestArgs } = state;\n\n\t\t// A common starting lookup point for determining\n\t\t// which auto scroller should be used, and what should be scrolled.\n\t\tconst underUsersPointer = getElementFromPointWithoutHoneypot({\n\t\t\tx: latestArgs.location.current.input.clientX,\n\t\t\ty: latestArgs.location.current.input.clientY,\n\t\t});\n\n\t\tclearUnusedEngagements(() => {\n\t\t\tcallbacks.forEach((onFrame) =>\n\t\t\t\tonFrame({ underUsersPointer, latestArgs, timeSinceLastFrame }),\n\t\t\t);\n\t\t});\n\n\t\tstate.timeLastFrameFinished = timeLastFrameFinished;\n\t\tstate.frameId = requestAnimationFrame(loop);\n\t}\n\n\tfunction reset() {\n\t\tif (state.type === 'idle') {\n\t\t\treturn;\n\t\t}\n\t\tcancelAnimationFrame(state.frameId);\n\t\tclearEngagementHistory();\n\t\tstate = { type: 'idle' };\n\t}\n\n\tfunction start(args: BaseEventPayload<DragType>) {\n\t\tif (state.type !== 'idle') {\n\t\t\treturn;\n\t\t}\n\n\t\tstate = {\n\t\t\t// Waiting a frame so we can accurately determine `timeSinceLastFrame`.\n\t\t\ttype: 'initializing',\n\t\t\tlatestArgs: args,\n\t\t\tframeId: requestAnimationFrame((timeLastFrameFinished) => {\n\t\t\t\tif (state.type !== 'initializing') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tstate = {\n\t\t\t\t\ttype: 'running',\n\t\t\t\t\ttimeLastFrameFinished,\n\t\t\t\t\tlatestArgs: state.latestArgs,\n\t\t\t\t\tframeId: requestAnimationFrame(loop),\n\t\t\t\t};\n\t\t\t}),\n\t\t};\n\t}\n\n\t// this module might have been imported after a drag has started\n\t// We are starting the auto scroller if we get an update event and\n\t// the auto scroller has not started yet\n\tfunction update(args: BaseEventPayload<DragType>) {\n\t\tif (state.type === 'idle') {\n\t\t\tstart(args);\n\t\t\treturn;\n\t\t}\n\t\tstate.latestArgs = args;\n\t}\n\n\t// Not exposing a way to stop listening\n\tmonitor({\n\t\tonDragStart: start,\n\t\tonDropTargetChange: update,\n\t\tonDrag: update,\n\t\tonDrop: reset,\n\t});\n\n\tconst api: Scheduler<DragType> = {\n\t\tonFrame(fn: OnFrameFn<DragType>) {\n\t\t\tcallbacks.push(fn);\n\t\t},\n\t};\n\treturn api;\n}\n"
  },
  {
    "path": "packages/auto-scroll/src/shared/side.ts",
    "content": "import type { Edge, Side } from '../internal-types';\n\nexport const mainAxisSideLookup: { [Key in Edge]: Side } = {\n\ttop: 'start',\n\tright: 'end',\n\tbottom: 'end',\n\tleft: 'start',\n};\n"
  },
  {
    "path": "packages/auto-scroll/src/unsafe-overflow/get-scroll-by.ts",
    "content": "import type { AllDragTypes, Input, Position } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport type { AllowedAxis, Axis, Edge, InternalConfig, Spacing } from '../internal-types';\nimport { canScrollOnEdge } from '../shared/can-scroll-on-edge';\nimport { edgeAxisLookup, edges } from '../shared/edges';\nimport { markAndGetEngagement } from '../shared/engagement-history';\nimport { getScrollChange } from '../shared/get-scroll-change';\nimport { isAxisAllowed } from '../shared/is-axis-allowed';\nimport { isWithin } from '../shared/is-within';\n\nimport { getHitbox } from './hitbox';\nimport {\n\ttype HitboxSpacing,\n\ttype ProvidedHitboxSpacing,\n\ttype UnsafeOverflowAutoScrollArgs,\n} from './types';\n\nexport type HitboxForEdge = {\n\tedge: Edge;\n\ttype: 'inside-of-edge' | 'outside-of-edge';\n\thitbox: DOMRect;\n};\n\n// Distance dampening is enabled when we are inside the edge\n// In order to match \"over element\" scrolling\nfunction getIsDistanceDampeningEnabled(value: HitboxForEdge): boolean {\n\treturn value.type === 'inside-of-edge';\n}\n\nfunction getSpacingFromProvided(value: Partial<Spacing> | undefined): Spacing {\n\treturn {\n\t\ttop: value?.top ?? 0,\n\t\tright: value?.right ?? 0,\n\t\tbottom: value?.bottom ?? 0,\n\t\tleft: value?.left ?? 0,\n\t};\n}\n\nfunction getHitboxSpacing(provided: ProvidedHitboxSpacing): HitboxSpacing {\n\treturn {\n\t\ttop: getSpacingFromProvided(provided.forTopEdge),\n\t\tright: getSpacingFromProvided(provided.forRightEdge),\n\t\tbottom: getSpacingFromProvided(provided.forBottomEdge),\n\t\tleft: getSpacingFromProvided(provided.forLeftEdge),\n\t};\n}\n\nexport function getScrollBy<DragType extends AllDragTypes>({\n\tentry,\n\ttimeSinceLastFrame,\n\tinput,\n\tconfig,\n\tallowedAxis,\n}: {\n\tentry: UnsafeOverflowAutoScrollArgs<DragType>;\n\tinput: Input;\n\tallowedAxis: AllowedAxis;\n\ttimeSinceLastFrame: number;\n\tconfig: InternalConfig;\n}): Pick<ScrollToOptions, 'top' | 'left'> | null {\n\tconst client: Position = {\n\t\tx: input.clientX,\n\t\ty: input.clientY,\n\t};\n\n\t// 🔥\n\t// For each registered item we need to do `getBoundingClientRect()` which is not great\n\t// Why?\n\t// 1. The hitbox can extend outside of an elements bounds\n\t// 2. We want overflow scrolling to start before the user has entered the bounds of the element\n\t//     Otherwise we could search upwards in the DOM from the `elementFromPoint`\n\tconst clientRect: DOMRect = entry.element.getBoundingClientRect();\n\tconst overflow = getHitboxSpacing(entry.getOverflow());\n\n\tconst inHitboxForEdge: HitboxForEdge[] = edges\n\t\t.map((edge): HitboxForEdge | false => {\n\t\t\tconst { insideOfEdge, outsideOfEdge } = getHitbox[edge]({\n\t\t\t\tclientRect,\n\t\t\t\toverflow,\n\t\t\t\tconfig,\n\t\t\t});\n\n\t\t\t/** Note:\n\t\t\t * Intentionally _not_ doing an explicit check to\n\t\t\t * see if `client` is with within the `overElementHitbox`.\n\t\t\t *\n\t\t\t * **Why?**\n\t\t\t *\n\t\t\t * 1. 🥱 Redundant\n\t\t\t * This check is already achieved by `element.contains(underUsersPointer)`\n\t\t\t *\n\t\t\t * 2. 📐 Overlap on boundaries\n\t\t\t * Two elements can share the same `{x,y}` points on shared edges.\n\t\t\t * It's not clear which of the two will be picked by\n\t\t\t * `const underUsersPointer = document.elementFromPoint(x,y)`\n\t\t\t * The edge of an \"outside\" element, can have shared `{x,y}`\n\t\t\t * values along the edge of an \"inside element\".\n\t\t\t * So when `underUsersPointer` is the \"outer\" element, the `client`\n\t\t\t * point might actually be also within the \"inner\" element.\n\t\t\t * We are exclusively relying on `underUsersPointer` make the decision\n\t\t\t * on what we are \"over\" so we should not be doing \"over element\" hitbox\n\t\t\t * testing here.\n\t\t\t * https://twitter.com/alexandereardon/status/1721758766507638996\n\t\t\t *\n\t\t\t *\n\t\t\t * 3. 🐞 Chrome bug\n\t\t\t * `document.elementFromPoint(x, y)` can return an element that does not contain `{x,y}`,\n\t\t\t * In these cases, `isWithin({client, clientRect: overElementHitbox})` can return `false`.\n\t\t\t * https://bugs.chromium.org/p/chromium/issues/detail?id=1500073\n\t\t\t */\n\n\t\t\tif (isWithin({ client, clientRect: outsideOfEdge })) {\n\t\t\t\treturn {\n\t\t\t\t\tedge,\n\t\t\t\t\thitbox: outsideOfEdge,\n\t\t\t\t\ttype: 'outside-of-edge',\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (isWithin({ client, clientRect: insideOfEdge })) {\n\t\t\t\treturn {\n\t\t\t\t\tedge,\n\t\t\t\t\thitbox: insideOfEdge,\n\t\t\t\t\ttype: 'inside-of-edge',\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn false;\n\t\t})\n\t\t.filter((value): value is HitboxForEdge => Boolean(value));\n\n\tif (!inHitboxForEdge.length) {\n\t\treturn null;\n\t}\n\n\t// Even if no edges are scrollable, we are marking the element\n\t// as being engaged with to start applying time dampening\n\tconst engagement = markAndGetEngagement(entry.element);\n\n\t// Note: changing the allowed axis during a drag will not\n\t// reset time dampening. It was decided it would be too\n\t// complex to implement initially, and we can add it\n\t// later if needed.\n\tconst scrollableEdges: HitboxForEdge[] = inHitboxForEdge.filter(\n\t\t(value) =>\n\t\t\tisAxisAllowed(edgeAxisLookup[value.edge], allowedAxis) &&\n\t\t\tcanScrollOnEdge[value.edge](entry.element),\n\t);\n\n\t// Nothing can be scrolled\n\tif (!scrollableEdges.length) {\n\t\treturn null;\n\t}\n\n\tconst lookup = new Map<Edge, HitboxForEdge>(scrollableEdges.map((value) => [value.edge, value]));\n\n\tconst left: number = (() => {\n\t\tconst axis: Axis = 'horizontal';\n\t\tconst leftEdge = lookup.get('left');\n\t\tif (leftEdge) {\n\t\t\treturn getScrollChange({\n\t\t\t\tclient,\n\t\t\t\tisDistanceDampeningEnabled: getIsDistanceDampeningEnabled(leftEdge),\n\t\t\t\thitbox: leftEdge.hitbox,\n\t\t\t\tedge: 'left',\n\t\t\t\taxis,\n\t\t\t\ttimeSinceLastFrame,\n\t\t\t\tengagement,\n\t\t\t\tconfig,\n\t\t\t});\n\t\t}\n\t\tconst rightEdge = lookup.get('right');\n\t\tif (rightEdge) {\n\t\t\treturn getScrollChange({\n\t\t\t\tclient,\n\t\t\t\tisDistanceDampeningEnabled: getIsDistanceDampeningEnabled(rightEdge),\n\t\t\t\thitbox: rightEdge.hitbox,\n\t\t\t\tedge: 'right',\n\t\t\t\taxis,\n\t\t\t\ttimeSinceLastFrame,\n\t\t\t\tengagement,\n\t\t\t\tconfig,\n\t\t\t});\n\t\t}\n\n\t\treturn 0;\n\t})();\n\n\tconst top: number = (() => {\n\t\tconst axis: Axis = 'vertical';\n\t\tconst bottomEdge = lookup.get('bottom');\n\t\tif (bottomEdge) {\n\t\t\treturn getScrollChange({\n\t\t\t\tclient,\n\t\t\t\tisDistanceDampeningEnabled: getIsDistanceDampeningEnabled(bottomEdge),\n\t\t\t\thitbox: bottomEdge.hitbox,\n\t\t\t\tedge: 'bottom',\n\t\t\t\taxis,\n\t\t\t\ttimeSinceLastFrame,\n\t\t\t\tengagement,\n\t\t\t\tconfig,\n\t\t\t});\n\t\t}\n\t\tconst topEdge = lookup.get('top');\n\t\tif (topEdge) {\n\t\t\treturn getScrollChange({\n\t\t\t\tclient,\n\t\t\t\tisDistanceDampeningEnabled: getIsDistanceDampeningEnabled(topEdge),\n\t\t\t\thitbox: topEdge.hitbox,\n\t\t\t\tedge: 'top',\n\t\t\t\taxis,\n\t\t\t\ttimeSinceLastFrame,\n\t\t\t\tengagement,\n\t\t\t\tconfig,\n\t\t\t});\n\t\t}\n\n\t\treturn 0;\n\t})();\n\n\treturn {\n\t\tleft,\n\t\ttop,\n\t};\n}\n"
  },
  {
    "path": "packages/auto-scroll/src/unsafe-overflow/hitbox.ts",
    "content": "import type { Axis, Edge, InternalConfig, Side } from '../internal-types';\nimport { axisLookup } from '../shared/axis';\n// Borrowing the hitbox calculation from over-element\n// So we can be sure that the 'insideEdge' calculations\n// line up perfectly with the 'over element' edge calculations\nimport { getOverElementHitbox } from '../shared/get-over-element-hitbox';\n\nimport { type HitboxSpacing } from './types';\n\nfunction makeGetHitbox({ axis, side }: { axis: Axis; side: Side }) {\n\treturn function hitbox({\n\t\tclientRect,\n\t\toverflow,\n\t\tconfig,\n\t}: {\n\t\tclientRect: DOMRect;\n\t\toverflow: HitboxSpacing;\n\t\tconfig: InternalConfig;\n\t}): {\n\t\tinsideOfEdge: DOMRect;\n\t\toutsideOfEdge: DOMRect;\n\t} {\n\t\tconst { mainAxis, crossAxis } = axisLookup[axis];\n\t\tconst edge: Edge = mainAxis[side];\n\t\tconst spacingForEdge = overflow[edge];\n\n\t\tconst overElementHitbox = getOverElementHitbox[edge]({\n\t\t\tclientRect,\n\t\t\tconfig,\n\t\t});\n\t\t// Same as the over element hitbox,\n\t\t// but we are stretching out on the cross axis (if needed)\n\t\tconst insideOfEdge = DOMRect.fromRect({\n\t\t\t[mainAxis.point]: overElementHitbox[mainAxis.point],\n\t\t\t[mainAxis.size]: overElementHitbox[mainAxis.size],\n\n\t\t\t// pull the cross axis backwards\n\t\t\t[crossAxis.point]: overElementHitbox[crossAxis.point] - spacingForEdge[crossAxis.start],\n\t\t\t// grow the cross axis\n\t\t\t[crossAxis.size]:\n\t\t\t\toverElementHitbox[crossAxis.size] +\n\t\t\t\tspacingForEdge[crossAxis.start] +\n\t\t\t\tspacingForEdge[crossAxis.end],\n\t\t});\n\n\t\t// Note: this will be \"cut out\" by the \"overElementHitbox\"\n\t\tconst outsideOfEdge = DOMRect.fromRect({\n\t\t\t[mainAxis.point]:\n\t\t\t\tside === 'start'\n\t\t\t\t\t? // begin from before the start edge and growing forward\n\t\t\t\t\t\tclientRect[mainAxis.point] - spacingForEdge[mainAxis.start]\n\t\t\t\t\t: // begin from on the end edge and go outwards\n\t\t\t\t\t\tclientRect[mainAxis.end],\n\t\t\t[crossAxis.point]: clientRect[crossAxis.point] - spacingForEdge[crossAxis.start],\n\t\t\t[mainAxis.size]:\n\t\t\t\tside === 'start' ? spacingForEdge[mainAxis.start] : spacingForEdge[mainAxis.end],\n\t\t\t[crossAxis.size]:\n\t\t\t\tspacingForEdge[crossAxis.start] +\n\t\t\t\tclientRect[crossAxis.size] +\n\t\t\t\tspacingForEdge[crossAxis.end],\n\t\t});\n\n\t\treturn { insideOfEdge, outsideOfEdge };\n\t};\n}\n\nexport const getHitbox: {\n\t[Key in Edge]: (args: {\n\t\tclientRect: DOMRect;\n\t\toverflow: HitboxSpacing;\n\t\tconfig: InternalConfig;\n\t}) => {\n\t\tinsideOfEdge: DOMRect;\n\t\toutsideOfEdge: DOMRect;\n\t};\n} = {\n\ttop: makeGetHitbox({\n\t\taxis: 'vertical',\n\t\tside: 'start',\n\t}),\n\tright: makeGetHitbox({\n\t\taxis: 'horizontal',\n\t\tside: 'end',\n\t}),\n\tbottom: makeGetHitbox({\n\t\taxis: 'vertical',\n\t\tside: 'end',\n\t}),\n\tleft: makeGetHitbox({\n\t\taxis: 'horizontal',\n\t\tside: 'start',\n\t}),\n};\n"
  },
  {
    "path": "packages/auto-scroll/src/unsafe-overflow/make-api.ts",
    "content": "import type {\n\tAllDragTypes,\n\tBaseEventPayload,\n\tCleanupFn,\n\tMonitorArgs,\n} from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport { getScheduler } from '../shared/scheduler';\n\nimport { tryOverflowScrollElements } from './try-overflow-scroll';\nimport { type UnsafeOverflowAutoScrollArgs } from './types';\n\nexport function makeApi<DragType extends AllDragTypes>({\n\tmonitor,\n}: {\n\tmonitor: (args: MonitorArgs<DragType>) => CleanupFn;\n}) {\n\tconst ledger: Map<Element, UnsafeOverflowAutoScrollArgs<DragType>> = new Map();\n\n\tfunction unsafeOverflowAutoScroll(args: UnsafeOverflowAutoScrollArgs<DragType>): CleanupFn {\n\t\tledger.set(args.element, args);\n\n\t\treturn () => ledger.delete(args.element);\n\t}\n\n\tfunction onFrame({\n\t\tlatestArgs,\n\t\tunderUsersPointer,\n\t\ttimeSinceLastFrame,\n\t}: {\n\t\tlatestArgs: BaseEventPayload<DragType>;\n\t\ttimeSinceLastFrame: number;\n\t\tunderUsersPointer: Element | null;\n\t}) {\n\t\ttryOverflowScrollElements({\n\t\t\tinput: latestArgs.location.current.input,\n\t\t\tsource: latestArgs.source,\n\t\t\tentries: Array.from(ledger).map(([_, args]) => args),\n\t\t\tunderUsersPointer,\n\t\t\ttimeSinceLastFrame,\n\t\t});\n\t}\n\n\t// scheduler is never cleaned up\n\tgetScheduler(monitor).onFrame(onFrame);\n\n\treturn {\n\t\tunsafeOverflowAutoScroll,\n\t};\n}\n"
  },
  {
    "path": "packages/auto-scroll/src/unsafe-overflow/try-overflow-scroll.ts",
    "content": "import type { AllDragTypes, Input } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport { type ElementGetFeedbackArgs } from '../internal-types';\nimport { getInternalConfig } from '../shared/configuration';\n\nimport { getScrollBy } from './get-scroll-by';\nimport { type UnsafeOverflowAutoScrollArgs } from './types';\n\nexport function tryOverflowScrollElements<DragType extends AllDragTypes>({\n\tinput,\n\tsource,\n\tentries,\n\ttimeSinceLastFrame,\n\tunderUsersPointer,\n}: {\n\tinput: Input;\n\ttimeSinceLastFrame: number;\n\tunderUsersPointer: Element | null;\n\tsource: DragType['payload'];\n\tentries: UnsafeOverflowAutoScrollArgs<DragType>[];\n}): void {\n\t// For now we are auto scrolling any element that wants to.\n\t// Otherwise it's hard to know what should scroll first as we might\n\t// be scrolling elements that have no hierarchical relationship\n\tfor (const entry of entries) {\n\t\t// \"overflow\" scrolling not relevant when directly over the element\n\t\t// \"over element\" scrolling is responsible for scrolling when over an element\n\t\t// 1. If we are over the element, then we want to exit and let the \"overflow\" scroller take over\n\t\t// 2. The overflow hitbox area for an edge actually stretches over the element\n\t\t//    This check is used to \"mask\" or \"cut out\" the element hitbox from the overflow hitbox\n\t\tif (entry.element.contains(underUsersPointer)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst feedback: ElementGetFeedbackArgs<DragType> = {\n\t\t\tinput,\n\t\t\tsource,\n\t\t\telement: entry.element,\n\t\t};\n\n\t\t// Scrolling not allowed for this entity\n\t\t// Note: not marking engagement if an entity is opting out of scrolling\n\t\tif (entry.canScroll && !entry.canScroll(feedback)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst config = getInternalConfig(entry.getConfiguration?.(feedback));\n\t\tconst allowedAxis = entry.getAllowedAxis?.(feedback) ?? 'all';\n\n\t\tconst scrollBy = getScrollBy({\n\t\t\tentry,\n\t\t\tinput,\n\t\t\ttimeSinceLastFrame,\n\t\t\tallowedAxis,\n\t\t\tconfig,\n\t\t});\n\n\t\tif (scrollBy) {\n\t\t\tentry.element.scrollBy(scrollBy);\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "packages/auto-scroll/src/unsafe-overflow/types.ts",
    "content": "import type { AllDragTypes } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport { type Edge, type ElementAutoScrollArgs, type Spacing } from '../internal-types';\n\ntype VerticalEdges = ['top' | 'bottom'];\ntype HorizontalEdges = ['left' | 'right'];\ntype CrossAxisEdges<T extends Edge> = T extends VerticalEdges[number]\n\t? HorizontalEdges\n\t: VerticalEdges;\n\n/** Specify outward reach of a scroll container */\nexport type HitboxSpacing = {\n\t[TEdge in keyof Spacing]: Spacing;\n};\n\n/** The public type for specifying the outward reach of a scroll container */\nexport type ProvidedHitboxSpacing = {\n\t[TEdge in keyof Spacing as `for${Capitalize<TEdge>}Edge`]?: {\n\t\t// Allow\n\t\t// Example for \"top\" edge: { top: 5 }\n\t\t[TKey in TEdge]: number;\n\t} & {\n\t\t// Optional edges for the cross axis\n\t\t// Example for \"top\" edge: {top: 5, left: 1, right: 2}\n\t\t[TKey in CrossAxisEdges<TEdge>[number]]?: number;\n\t};\n\t// Disallowing (by not including) the opposite edge.\n\t// Example for \"top\" edge: {top: 5, bottom: 2} is not allowed\n};\n\nexport type UnsafeOverflowAutoScrollArgs<DragType extends AllDragTypes> =\n\tElementAutoScrollArgs<DragType> & {\n\t\tgetOverflow: () => ProvidedHitboxSpacing;\n\t};\n"
  },
  {
    "path": "packages/auto-scroll/tsconfig.json",
    "content": "{\n  \"extends\": \"../../tsconfig.json\",\n  \"include\": [\n    \"__tests__/**/*.ts\",\n    \"__tests__/**/*.tsx\",\n    \"docs/**/*.ts\",\n    \"docs/**/*.tsx\",\n    \"examples/**/*.ts\",\n    \"examples/**/*.tsx\",\n    \"src/**/*.ts\",\n    \"src/**/*.tsx\",\n    \"**/stories.ts\",\n    \"**/stories.tsx\",\n    \"**/stories/*.ts\",\n    \"**/stories/*.tsx\",\n    \"**/stories/**/*.ts\",\n    \"**/stories/**/*.tsx\"\n  ]\n}\n"
  },
  {
    "path": "packages/core/.npmignore",
    "content": "src/\nexamples-utils/\nexamples/\nindex.ts\ndocs/\nbuild/\n__tests__/\ntsconfig.json\ntsconfig.app.json\ntsconfig.dev.json\n"
  },
  {
    "path": "packages/core/CHANGELOG.md",
    "content": "# @atlaskit/pragmatic-drag-and-drop\n\n## 1.7.9\n\n### Patch Changes\n\n- [`acb61d1d6efd9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/acb61d1d6efd9) -\n  Add dependency for a11y testing.\n\n## 1.7.8\n\n### Patch Changes\n\n- [`6d87d08be8526`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6d87d08be8526) -\n  Add dependency for a11y testing.\n\n## 1.7.7\n\n### Patch Changes\n\n- [`5d0b8ba5e6f7f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5d0b8ba5e6f7f) -\n  Internal changes to how borders are applied.\n\n## 1.7.6\n\n### Patch Changes\n\n- [`6c430bfbb035d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6c430bfbb035d) -\n  Updated code to fix typescript issues during adoption of local consumption for adminhub\n\n## 1.7.5\n\n### Patch Changes\n\n- [`beaa6ee463aa8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/beaa6ee463aa8) -\n  Internal changes to how border radius is applied.\n\n## 1.7.4\n\n### Patch Changes\n\n- [#174472](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/174472)\n  [`fda983a832f81`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fda983a832f81) -\n  On Android `pointerOutsideOfPreview` will now also center the drag preview under the users\n  pointer. Technically this was already existing observed behaviour as Android always centers the\n  drag preview under the users pointer. We now make this behaviour explicit in the code, and call\n  this out behaviour in jsdoc and documentation.\n\n## 1.7.3\n\n### Patch Changes\n\n- [#173859](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/173859)\n  [`d6f17206f8859`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d6f17206f8859) -\n  In order to provide the best experience for iOS, the optional function `pointerOutsideOfPreview`\n  will now center the drag preview under the users pointer on iOS.\n\n  Some more detail (in case you are interested):\n\n  **Borders**\n\n  _(Existing behaviour)_\n\n  In `pointerOutsideOfPreview` we use transparent borders to push the preview away from the users\n  pointer. On iOS these borders will always be black. So we don't use transparent border on iOS.\n\n  **Placement**\n\n  _(Improvement)_\n\n  During a drag on iOS the drag preview will shift under the center of the users pointer, even if we\n  start the drag with the users pointer on the top left or top right corner of the drag preview. So\n  now `pointerOutsideOfPreview` will always put the preview under the center of the users pointer in\n  order to avoid the drag preview position shifting as the drag is starting.\n\n## 1.7.2\n\n### Patch Changes\n\n- [#164244](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/164244)\n  [`65021fc0267e2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/65021fc0267e2) -\n  The cleanup functions returned by the following utilities now only work on the first call. This\n  was done to prevent unexpected side effects of calling a cleanup function multiple times.\n  - `@atlaskit/pragmatic-drag-and-drop/adapter/element`\n    - `draggable`\n    - `dropTargetForElements`\n    - `monitorForElements`\n  - `@atlaskit/pragmatic-drag-and-drop/adapter/text-selection`\n    - `dropTargetForTextSelection`\n    - `monitorForTextSelection`\n  - `@atlaskit/pragmatic-drag-and-drop/adapter/external`\n    - `dropTargetForExternal`\n    - `monitorForExternal`\n  - `@atlaskit/pragmatic-drag-and-drop-auto-scroll/element`\n    - `autoScrollForElements`\n    - `autoScrollWindowForElements`\n  - `@atlaskit/pragmatic-drag-and-drop-auto-scroll/external`\n    - `autoScrollForExternal`\n    - `autoScrollWindowForExternal`\n  - `@atlaskit/pragmatic-drag-and-drop-auto-scroll/text-selection`\n    - `autoScrollForTextSelection`\n    - `autoScrollWindowForTextSelection`\n\n## 1.7.1\n\n### Patch Changes\n\n- [#162456](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/162456)\n  [`f916af5aab898`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f916af5aab898) -\n  Removes `@atlaskit/platform-feature-flags` as a dependency. Removes `@atlaskit/link` as a runtime\n  dependency, although it is still used in examples.\n\n## 1.7.0\n\n### Minor Changes\n\n- [#157071](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/157071)\n  [`a149a0b1559ec`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a149a0b1559ec) -\n  We are testing the migration to the ADS Link component behind a feature flag. If this fix is\n  successful it will be available in a later release.\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.6.1\n\n### Patch Changes\n\n- [#150602](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/150602)\n  [`f83b03a3b239e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f83b03a3b239e) -\n  `pointerOutsideOfPreview` will no longer push the preview away from the users pointer on iOS due\n  to platform limitations. On iOS the preview will start the drag on the top left corner (or top\n  right corner for right to left interfaces). While dragging, iOS will shift the drag preview under\n  the center of the users pointer, so the \"pushing away\" is short lived on iOS.\n\n## 1.6.0\n\n### Minor Changes\n\n- [#146341](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/146341)\n  [`ef9d1cdc6ea92`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ef9d1cdc6ea92) -\n  The `pointerOutsideOfPreview()` utility will now correctly push the preview forward in right to\n  left layouts.\n  - Left to right (ltr): preview on right hand side of pointer\n  - Right to left (rtl): preview on left hand side of pointer (**new improvement**)\n\n## 1.5.3\n\n### Patch Changes\n\n- [#145191](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/145191)\n  [`cd21ebedb9a08`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cd21ebedb9a08) -\n  Internal change to move towards Compiled CSS-in-JS styling.\n\n## 1.5.2\n\n### Patch Changes\n\n- [#128775](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/128775)\n  [`7a47573fb87cd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7a47573fb87cd) -\n  The optional `reorder` utility is helpful for returning a new reordered array, without modifying\n  the original array. Previously the _original_ array was returned unmodified if an invalid\n  `startIndex` or `finishIndex` was provided. `reorder` now always returns a new array, even when an\n  invalid `startIndex` or `finishIndex` is provided for consistency.\n\n  We consider this a bug fix as the `reorder` function claimed that it returned a new array. Now it\n  always does that.\n\n  Here is how things continue to work for `reorder` with valid arguments:\n\n  ```ts\n  import { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';\n\n  const original = ['A', 'B'];\n\n  const result = reorder({\n  \tlist: original,\n  \t// Grab A\n  \tstartIndex: 0,\n  \t// Move it to where B is\n  \tfinishIndex: 1,\n  });\n\n  console.log(result); // ['B', 'A']\n  console.log(result === original); // false - we got a new array back\n  ```\n\n  Things were a little different when an invalid `startIndex` or `finishIndex` was provided:\n\n  ```ts\n  import { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';\n\n  const original = ['A', 'B'];\n\n  const result = reorder({\n  \tlist: original,\n  \tstartIndex: -1, // invalid start index\n  \tfinishIndex: 1,\n  });\n\n  console.log(result); // ['A', 'B'] (array not reordered)\n\n  // Original array was returned for this error case\n  console.log(result === original); // true\n  ```\n\n  When an invalid `startIndex` or `finishIndex` is provided, `reorder` will now return a new array\n\n  ```ts\n  import { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';\n\n  const original = ['A', 'B'];\n\n  const result = reorder({\n  \tlist: original,\n  \tstartIndex: -1, // invalid start index\n  \tfinishIndex: 1,\n  });\n\n  console.log(result); // ['A', 'B'] (array not reordered - unchanged)\n\n  // We now return a new array in this case\n  console.log(result === original); // false\n  ```\n\n  In addition to this improvement, we have also improved the clarity of documentation and jsdoc for\n  `reorder`\n\n## 1.5.1\n\n### Patch Changes\n\n- [#125185](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/125185)\n  [`423e7b65d4846`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/423e7b65d4846) -\n  Fixing an incorrectly exported `type` name from our external adapter.\n\n  ```diff\n  - import type { ElementDropTargetEventBasePayload } from '@atlaskit/pragmatic-drag-and-drop/external/adapter';\n  + import type { ExternalDropTargetEventBasePayload } from '@atlaskit/pragmatic-drag-and-drop/external/adapter';\n  ```\n\n## 1.5.0\n\n### Minor Changes\n\n- [#109060](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109060)\n  [`4660ec858a305`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4660ec858a305) -\n  Update `React` from v16 to v18\n\n## 1.4.0\n\n### Minor Changes\n\n- [#145232](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/145232)\n  [`04641b5e6ed55`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/04641b5e6ed55) -\n  Adding new optional utility for element dragging: `blockDraggingToIFrames` which disables the\n  ability for a user to drag into an `<iframe>` element.\n\n  Scenarios where this can be helpful:\n  - When you are shifting the interface around in reponse to a drag operation and you don't want the\n    drag to enter into an `<iframe>` (for example - when resizing)\n  - When you don't want the user to be able to drag into a `<iframe>` on the page (there could be\n    lots of reasons why!)\n\n  ```ts\n  import { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\n  import { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n  import { blockDraggingToIFrames } from '@atlaskit/pragmatic-drag-and-drop/element/block-dragging-to-iframes';\n\n  const cleanup = combine(\n  \tblockDraggingToIFrames({ element }),\n  \tdraggable({\n  \t\telement,\n  \t}),\n  );\n  ```\n\n## 1.3.1\n\n### Patch Changes\n\n- [#141279](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/141279)\n  [`a38f3af4bfc79`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a38f3af4bfc79) -\n  Minor refactor of internal helper.\n\n## 1.3.0\n\n### Minor Changes\n\n- [#128458](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/128458)\n  [`71c5224450c8a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/71c5224450c8a) -\n  Adding workaround for a [bug in Firefox](https://bugzilla.mozilla.org/show_bug.cgi?id=1912164).\n  The external adpater optional URL utilities `containsURLs` and `getURLs` will now correctly\n  recognize URLs dragged from the Firefox address bar or bookmarks in to a Firefox `window`.\n\n## 1.2.3\n\n### Patch Changes\n\n- [#123738](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/123738)\n  [`abd0776a2a2d5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/abd0776a2a2d5) -\n  Improving `react@18` support for `setCustomNativeDragPreview`. Fixes a bug where\n  `preserveOffsetOnSource` would always position the top left drag preview under the user's pointer.\n\n  `getOffset` is now called in the next\n  [`microtask`](https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide) after\n  `setCustomNativeDragPreview:render`. This helps ensure that the drag preview element has finished\n  rendering into the `container` before `getOffset` is called. Some frameworks like `react@18` won't\n  render the element to be used for the drag preview into the `container` until the next\n  `microtask`.\n\n## 1.2.2\n\n### Patch Changes\n\n- [#124164](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/124164)\n  [`58941fa1d332a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/58941fa1d332a) -\n  All `react` unit tests will now run against `react@16` and `react@18` on CI.\n\n## 1.2.1\n\n### Patch Changes\n\n- [#117296](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/117296)\n  [`ef11f570968a2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ef11f570968a2) -\n  Adding some browser tests for the honey pot fix\n\n## 1.2.0\n\n### Minor Changes\n\n- [#116572](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116572)\n  [`98c65e7ff719c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/98c65e7ff719c) -\n  🍯 Introducing \"the honey pot fix\" which is an improved workaround for a\n  [painful browser bug](https://issues.chromium.org/issues/41129937).\n\n  **Background**\n\n  The browser bug causes the browser to think the users pointer is continually depressed at the\n  point that the user started a drag. This could lead to incorrect events being triggered, and\n  incorrect styles being applied to elements that the user is not currently over during a drag.\n\n  **Outcomes**\n  - Elements will no longer receive `MouseEvent`s (eg `\"mouseenter\"` and `\"mouseleave\"`) during a\n    drag (which is a violation of the\n    [drag and drop specification](https://html.spec.whatwg.org/multipage/dnd.html#drag-and-drop-processing-model))\n  - Elements will no longer apply `:hover` or `:active` styles during a drag. Previously consumers\n    would need to disable these style rules during a drag to prevent these styles being applied.\n  - Dramatically improved post drop performance. Our prior solution could require a noticeable delay\n    due to a large style recalculation after a drop.\n\n## 1.1.12\n\n### Patch Changes\n\n- [#109670](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109670)\n  [`8eb3fe4136d55`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8eb3fe4136d55) -\n  Internal consolidation of `once()` code\n\n## 1.1.11\n\n### Patch Changes\n\n- [#107751](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/107751)\n  [`ac9352b7e0ce`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ac9352b7e0ce) -\n  Fixing timing issue with `preventUnhandled()` introduced in the prior release.\n  `preventUnhandled.stop()` called inside of `onDrop()` will now correctly cancel a native `\"drop\"`\n  event.\n\n## 1.1.10\n\n### Patch Changes\n\n- [#105574](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/105574)\n  [`2f5d213b2613`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2f5d213b2613) -\n  These fixes only impact situations were you have native drag and drop code in addition to\n  Pragmatic drag and drop running on your page.\n  - Fix: if a `\"drop\"` is caused by non Pragmatic drag and drop code on the page, then we will no\n    longer cancel the `\"drop\"` event.\n  - Fix: No longer exposing external adapter data (`source.items`) in `onDrop` if not dropping on a\n    Pragmatic drag and drop drop target. Previously, if some non Pragmatic drag and drop code\n    accepted a drop then `source.items` would be populated. Now all unsuccessful (or un managed)\n    drops are handled consistently.\n\n## 1.1.9\n\n### Patch Changes\n\n- [#100243](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/100243)\n  [`1ba7a4e942d4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1ba7a4e942d4) -\n  Fixing typos in dev time warnings\n\n## 1.1.8\n\n### Patch Changes\n\n- [#100196](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/100196)\n  [`da322bbbe7f5`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/da322bbbe7f5) -\n  Setting `sideEffects: true` in `package.json` as a few essential files in `core` have side\n  effects. Unfortunately we require side effects to work around browser bugs and strangeness 😅.\n\n## 1.1.7\n\n### Patch Changes\n\n- [#95385](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/95385)\n  [`c8d2e32f5071`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c8d2e32f5071) -\n  Minor internal refactor of code concerning entering / leaving a window\n\n## 1.1.6\n\n### Patch Changes\n\n- [#94759](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94759)\n  [`140fc0d20c02`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/140fc0d20c02) -\n  Fixing our Safari workaround in `setCustomNativeDragPreview()` for a\n  [Safari drag preview bug](https://bugs.webkit.org/show_bug.cgi?id=266025) so that it works\n  correctly for `react@18+` usage.\n\n## 1.1.5\n\n### Patch Changes\n\n- [#94316](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94316)\n  [`35fd5ed8e1d7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/35fd5ed8e1d7) -\n  Upgrading internal dependency `bind-event-listener` to `@^3.0.0`\n\n## 1.1.4\n\n### Patch Changes\n\n- [#94302](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94302)\n  [`66ca9d1d1602`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/66ca9d1d1602) -\n  Improving jsdoc for the drop target `canDrop` function\n\n## 1.1.3\n\n### Patch Changes\n\n- [#84398](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84398)\n  [`77694db987fc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/77694db987fc) -\n  Public release of Pragmatic drag and drop documentation\n\n## 1.1.2\n\n### Patch Changes\n\n- [#84047](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84047)\n  [`72a86ac4a940`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/72a86ac4a940) -\n  Removing experimental `DropData` from `onDrop()`. Exposing the native `dropEffect` turned out to\n  problematic, as you will always get a `\"none\"` drop effect if dropping externally if the original\n  `draggable` was removed (a native `\"dragend\"` event is targetted at the original draggable). This\n  made the weak signal of `dropEffect` for even weaker and more problematic. In order to not create\n  footguns for folks, we have decided to remove this experimental API for now. We can explore adding\n  the API back in the future if folks think it would be valuable.\n\n## 1.1.1\n\n### Patch Changes\n\n- [#83702](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83702)\n  [`4d9e25ab4eaa`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4d9e25ab4eaa) -\n  Updating the descriptions of Pragmatic drag and drop packages, so they each provide a consistent\n  description to various consumers, and so they are consistently formed amongst each other.\n  - `package.json` `description`\n  - `README.md`\n  - Website documentation\n\n## 1.1.0\n\n### Minor Changes\n\n- [#82653](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/82653)\n  [`136d8da5542d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/136d8da5542d) -\n  _Experimental_: Adding additional information to `onDrop()` events to expose what the final\n  `dropEffect` was for a drag operation (_now removed_)\n\n  Fixing a bug where `preventUnhandled.start()` would prevent unhandled drag operations forever. It\n  now only prevents unhandled drag operations for the current drag operation.\n  `preventUnhandled.stop()` is now optional, as `preventUnhandled.start()` now tidies up itself. You\n  can still leverage `preventUnhandled.stop()` to stop preventing unhandled drag operations during a\n  drag.\n\n  Tightening the `getDropEffect()` function on drop targets slightly so that `\"none\"` cannot be\n  provided. Using `\"none\"` as the drop effect would break the expected behaviour for nested drop\n  targets.\n\n## 1.0.2\n\n### Patch Changes\n\n- [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116)\n  [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) -\n  Upgrade Typescript from `4.9.5` to `5.4.2`\n\n## 1.0.1\n\n### Patch Changes\n\n- [#76476](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/76476)\n  [`35148e092790`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/35148e092790) -\n  Adding warning for test environments to let people know if DragEvents have not been setup\n  correctly.\n\n## 1.0.0\n\n### Major Changes\n\n- [#70616](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70616)\n  [`42e57ea65fee`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/42e57ea65fee) -\n  This is our first `major` release (`1.0`) for all Pragmatic drag and drop packages.\n\n  For a detailed explanation of these changes, and how to upgrade (automatically) to `1.0` please\n  see our\n  [1.0 upgrade guide](http://atlassian.design/components/pragmatic-drag-and-drop/core-package/upgrade-guides/upgrade-guide-for-1.0)\n\n## 0.25.0\n\n### Minor Changes\n\n- [#59458](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/59458)\n  [`7d6a69cfa61c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7d6a69cfa61c) -\n  Adding workaround for Safari bug.\n\n  In Safari (and iOS) if the element used for generating a native drag preview has opacity applied,\n  then the native drag preview can include elements underneath the drag preview element.\n\n  Pragmatic drag and drop now includes a workaround for this Safari bug.\n\n## 0.24.0\n\n### Minor Changes\n\n- [#39935](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39935)\n  [`03b91562fec`](https://bitbucket.org/atlassian/atlassian-frontend/commits/03b91562fec) - Exposing\n  `AllDragTypes` type. This was previously an internal type, but it provided helpful to expose for\n  our new auto scroller. `AllDragTypes` is helpful if you need a function to work with either\n  `element` or `file` drag operations.\n\n## 0.23.0\n\n### Minor Changes\n\n- [#38713](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38713)\n  [`3da89e29dfc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3da89e29dfc) - We have\n  renamed and tweaked the recently added `setCustomNativeDragPreview` `getOffset` utility\n  `preserveOffsetFromPointer` to be a bit easier to understand what it is doing.\n\n  ```diff\n  - import { preserveOffsetFromPointer } from '@atlaskit/pragmatic-drag-and-drop/util/preserve-offset-from-pointer';\n  + import { preserveOffsetOnSource } from '@atlaskit/pragmatic-drag-and-drop/util/preserve-offset-on-source';\n\n  draggable({\n    element: myElement,\n    onGenerateDragPreview: ({ nativeSetDragImage, location, source }) => {\n      setCustomNativeDragPreview({\n  -      getOffset: preserveOffsetFromPointer({\n  +      'preserveOffsetOnSource' is a more accurate description of what is being achieved\n  +      getOffset: preserveOffsetOnSource({\n  -        sourceElement: source.element,\n  +        // no longer including 'source' in argument name\n  +        // as it is implied by the function name\n  +        element: source.element,\n          input: location.current.input,\n        }),\n        render: function render({ container }) {\n          /* ... */\n        },\n        nativeSetDragImage,\n      });\n    },\n  });\n  ```\n\n## 0.22.0\n\n### Minor Changes\n\n- [#38397](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38397)\n  [`d644a68ddf6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d644a68ddf6) - Added a\n  new `setCustomNativeDragPreview` `getOffset` utility: `preserveOffsetFromPointer`.\n  `preserveOffsetFromPointer` mimics the default behaviour for non custom drag previews when\n  starting a drag: the initial cursor position offset is preserved for a seamless drag and drop\n  experience.\n\n  ```ts\n  import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/util/set-custom-native-drag-preview';\n  import { preserveOffsetFromPointer } from '@atlaskit/pragmatic-drag-and-drop/util/preserve-offset-from-pointer';\n\n  draggable({\n  \telement: myElement,\n  \tonGenerateDragPreview: ({ nativeSetDragImage, location, source }) => {\n  \t\tsetCustomNativeDragPreview({\n  \t\t\tgetOffset: preserveOffsetFromPointer({\n  \t\t\t\tsourceElement: source.element,\n  \t\t\t\tinput: location.current.input,\n  \t\t\t}),\n  \t\t\trender: function render({ container }) {\n  \t\t\t\t/* ... */\n  \t\t\t},\n  \t\t\tnativeSetDragImage,\n  \t\t});\n  \t},\n  });\n  ```\n\n## 0.21.0\n\n### Minor Changes\n\n- [#38525](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38525)\n  [`de7463c7096`](https://bitbucket.org/atlassian/atlassian-frontend/commits/de7463c7096) - Exposing\n  some additional TypeScript types. These can be helpful when creating helper packages.\n\n  ```ts\n  import type {\n  \t// These types are not needed for consumers\n  \t// They are mostly helpful for other packages\n  \tAllDragTypes,\n  \tMonitorArgs,\n  \tBaseEventPayload,\n  } from '@atlaskit/pragmatic-drag-and-drop/types';\n  ```\n\n  - `AllDragTypes`: representation of all entities types in the system (eg element and file)\n  - `MonitorArgs<DragType extends AllDragTypes>`: the arguments that can be passed to a monitor\n  - `BaseEventPayload<DragType extends AllDragTypes>`: the shared properties in all events\n\n## 0.20.0\n\n### Minor Changes\n\n- [#38453](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38453)\n  [`554a6d8cc34`](https://bitbucket.org/atlassian/atlassian-frontend/commits/554a6d8cc34) - ###\n  Stickiness algorithm improvement\n\n  We have made some improvements to the drop target stickiness algorithm to allow sticky drop\n  targets that are no longer dragged over to cancel their stickiness.\n\n  Stickiness is no longer maintained when a sticky drop target states it cannot be dropped on\n\n  > Scenario: `[A(sticky)]` → `[]` + `A:canDrop()` returns `false` Result: `[]`\n\n  Stickiness is no longer maintained when a sticky drop start states it is no longer sticky\n\n  > Scenario: `[A(sticky)]` → `[]` + `A:getIsSticky()` returns `false` Result: `[]`\n\n  Stickiness is no longer maintained when a sticky drop start is unmounted\n\n  > Scenario: `[A(sticky)]` → `[]` + `A` is unmounted Result: `[]`\n\n  To help facilitate this change:\n  - `getIsSticky()` is now only called when an _drop target_ is a potential candidate for stickiness\n    (previously it was called repeatedly)\n  - `getIsSticky()` and `canDrop()` are called on _drop targets_ that are no longer being dragged\n    over, but are candidates for stickiness\n\n  ### Change to `DropTargetRecord` `type`\n\n  Previously, the `DropTargetRecord` type had a property called `sticky` which would represent\n  whether the _drop target_ was registering itself as sticky via `getIsSticky()`. Knowing `sticky`\n  is not overly helpful given that we now regularly recompute stickiness and a _drop target_ can\n  change disable stickiness after it is applied.\n\n  What is helpful, is knowing whether a _drop target_ is active _because_ of stickiness. So we have\n  removed `sticky` and added `isActiveDueToStickiness` to the `DropTargetRecord` type.\n\n  ```diff\n  type DropTargetRecord = {\n    element: Element;\n    data: Record<string | symbol, unknown>;\n    dropEffect: DataTransfer['dropEffect'];\n  -  sticky: boolean;\n  +  isActiveDueToStickiness: boolean;\n  };\n  ```\n\n## 0.19.0\n\n### Minor Changes\n\n- [#35574](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/35574)\n  [`8c301a251e4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8c301a251e4) - We have\n  changed the API of `setCustomNativeDragPreview()` to allow increased control and slightly lower\n  bundles as well.\n\n  We have removed the `placement` argument, and replaced it with `getOffset()`.\n\n  ```diff\n  - placement: { type: 'center' } | { type: 'offset-from-pointer'; x: CSSValue; y: CSSValue };\n  + getOffset: (args: { container: HTMLElement }) => {x: number, y: number}\n  ```\n\n  `getOffset()` allows unlimited control over how to place the custom native drag preview relative\n  to the users pointer. Please see our updated documentation for detailed information about the new\n  `getOffset()` API. Our new `getOffset()` approach means that we also no longer need to bake in all\n  `placement` options into the bundle - consumers now only pay for what they use!\n\n  `placement: { type: 'offset-from-pointer' }` has been replaced by `offsetFromPointer()`\n\n  ```diff\n  import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/util/set-custom-native-drag-preview';\n  + import { offsetFromPointer } from '@atlaskit/pragmatic-drag-and-drop/util/offset-from-pointer;\n\n  draggable({\n    element: myElement,\n    onGenerateDragPreview: ({ nativeSetDragImage }) => {\n      setCustomNativeDragPreview({\n  -      placement: { type: 'offset-from-pointer', x: '16px', y: '8px' }\n  +      getOffset: offsetFromPointer({x: '16px', y: '8px'}),\n        render: function render({ container }) {\n          ReactDOM.render(<Preview item={item} />, container);\n          return function cleanup() {\n            ReactDOM.unmountComponentAtNode(container);\n          };\n        },\n        nativeSetDragImage,\n      });\n    },\n  });\n  ```\n\n  `placement: { type: 'center' }` has been replaced by `centerUnderPointer()`\n\n  ```diff\n  import { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/util/set-custom-native-drag-preview';\n  + import { centerUnderPointer } from '@atlaskit/pragmatic-drag-and-drop/util/center-under-pointer-pointer;\n\n  draggable({\n    element: myElement,\n    onGenerateDragPreview: ({ nativeSetDragImage }) => {\n      setCustomNativeDragPreview({\n  -      placement: { type: 'center' }\n  +      getOffset: centerUnderPointer,\n        render: function render({ container }) {\n          ReactDOM.render(<Preview item={item} />, container);\n          return function cleanup() {\n            ReactDOM.unmountComponentAtNode(container);\n          };\n        },\n        nativeSetDragImage,\n      });\n    },\n  });\n  ```\n\n## 0.18.2\n\n### Patch Changes\n\n- [#33793](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33793)\n  [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure\n  legacy types are published for TS 4.5-4.8\n\n## 0.18.1\n\n### Patch Changes\n\n- [#33649](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33649)\n  [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade\n  Typescript from `4.5.5` to `4.9.5`\n\n## 0.18.0\n\n### Minor Changes\n\n- [#33344](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33344)\n  [`9fd8556db17`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9fd8556db17) - Internal\n  folder name structure change\n\n## 0.17.0\n\n### Minor Changes\n\n- [#33262](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33262)\n  [`34ed7b2ec63`](https://bitbucket.org/atlassian/atlassian-frontend/commits/34ed7b2ec63) - We have\n  changed the name of our drag and drop packages to align on the single name of \"Pragmatic drag and\n  drop\"\n\n  ```diff\n  - @atlaskit/drag-and-drop\n  + @atlaskit/pragmatic-drag-and-drop\n\n  - @atlaskit/drag-and-drop-autoscroll\n  + @atlaskit/pragmatic-drag-and-drop-autoscroll\n\n  - @atlaskit/drag-and-drop-hitbox\n  + @atlaskit/pragmatic-drag-and-drop-hitbox\n\n  - @atlaskit/drag-and-drop-indicator\n  + @atlaskit/pragmatic-drag-and-drop-react-indicator\n  # Note: `react` was added to this package name as our indicator package is designed for usage with `react`.\n\n  - @atlaskit/drag-and-drop-live-region\n  + @atlaskit/pragmatic-drag-and-drop-live-region\n\n  - @atlaskit/drag-and-drop-react-beautiful-dnd-migration\n  + @atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration\n\n  - @atlaskit/drag-and-drop-docs\n  + @atlaskit/pragmatic-drag-and-drop-docs\n  ```\n\n  The new `@atlaskit/pragmatic-drag-and-drop*` packages will start their initial versions from where\n  the ``@atlaskit/drag-and-drop*` packages left off. Doing this will make it easier to look back on\n  changelogs and see how the packages have progressed.\n\n## 0.16.0\n\n### Minor Changes\n\n- [#33258](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33258)\n  [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip\n  minor dependency bump\n\n## 0.15.1\n\n### Patch Changes\n\n- [#32424](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32424)\n  [`2e01c9c74b5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e01c9c74b5) - DUMMY\n  remove before merging to master; dupe adf-schema via adf-utils\n\n## 0.15.0\n\n### Minor Changes\n\n- [#31909](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/31909)\n  [`ed028658f13`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ed028658f13) - Minor\n  internal refactor and adding additional tests\n\n## 0.14.0\n\n### Minor Changes\n\n- [#31794](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/31794)\n  [`eab6d26451d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/eab6d26451d) -\n  Improving the resilience of our workaround for a\n  [Browser bug](https://bugs.chromium.org/p/chromium/issues/detail?id=410328) where after a drag\n  finishes, an unrelated element can be entered into.\n- [`ba7ea570aee`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ba7ea570aee) - > Both\n  of these changes should not impact most consumers as they are targeted at edge cases.\n  - **Fix**: We no longer extract user input (eg `clientX`) from native `\"dragleave\"` events due to\n    a\n    [Bug with Chrome we discovered](https://bugs.chromium.org/p/chromium/issues/detail?id=1429937).\n    Due to this bug, it was possible for `location.current.input` to be incorrectly set in\n    `onDropTargetChange` and `onDrop` when a user was cancelling a drag or dropping or no drop\n    targets.\n\n  - **Fix**: `location.previous.dropTargets` _should_ always point to the\n    `location.current.dropTargets` value from the previous event (exception: `onGenerateDragPreview`\n    and `onDragStart` have the same `location.previous` and `location.current` values). Previously,\n    the `location.previous.dropTargets` value did not match the last events\n    `location.current.dropTargets` value in `onDrop`. `onDrop()` would incorrectly use the\n    `location.current` and `location.previous` values from the last event rather than creating a new\n    `location.current` entry. Now, `onDrop()`, `location.previous.dropTargets` points to the\n    `location.current.dropTargets` from the last event (same as all other events) and\n    `location.current.dropTargets` points to what the previous drop target was as well (no change)\n\n## 0.13.0\n\n### Minor Changes\n\n- [#30879](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/30879)\n  [`2582df26509`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2582df26509) - Fixing a\n  browser bug where after a drag finishes, a unrelated element can be entered into by the browser\n  - [Visual explanation of bug](https://twitter.com/alexandereardon/status/1633614212873465856)\n  - [Chrome bug](https://bugs.chromium.org/p/chromium/issues/detail?id=410328)\n\n## 0.12.0\n\n### Minor Changes\n\n- [#30953](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/30953)\n  [`90901f5bbe0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/90901f5bbe0) - Replace\n  default entry point of `undefined` with `{}`.\n\n  > **NOTE:** Importing from the default entry point isn't supported. _Please use individual entry\n  > points in order to always obtain minimum kbs._\n\n## 0.11.0\n\n### Minor Changes\n\n- [#30668](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/30668)\n  [`1ecbb19d450`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1ecbb19d450) - Adding a\n  new function to make creating _custom_ native drag previews safe and easy:\n  `setCustomNativeDragPreview`\n\n  ```tsx\n  import { setCustomNativeDragPreview } from '@atlaskit/drag-and-drop/util/set-custom-native-drag-preview';\n\n  draggable({\n  \telement: myElement,\n  \tonGenerateDragPreview: ({ nativeSetDragImage }) => {\n  \t\tsetCustomNativeDragPreview({\n  \t\t\trender: function render({ container }) {\n  \t\t\t\tReactDOM.render(<Preview item={item} />, container);\n  \t\t\t\treturn function cleanup() {\n  \t\t\t\t\tReactDOM.unmountComponentAtNode(container);\n  \t\t\t\t};\n  \t\t\t},\n  \t\t\tnativeSetDragImage,\n  \t\t});\n  \t},\n  });\n  ```\n\n  Please see our element adapter documentation for more detailed usage information\n\n## 0.10.0\n\n### Minor Changes\n\n- [#29951](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/29951)\n  [`9c0975e2fab`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9c0975e2fab) - Bug fix:\n  A _monitor_ should not be called after it is removed. Previously, if a _monitor_ (monitor 1)\n  removed another _monitor_ (monitor 2) for the same event, then the second monitor (monitor 2)\n  would still be called. This has been fixed\n\n  ```ts\n  const cleanupMonitor1 = monitorForElements({\n  \tonDragStart: () => {\n  \t\tcleanupMonitor2();\n  \t},\n  });\n  const cleanupMonitor2 = monitorForElements({\n  \t// Previously this `onDragStart` would have been called during `onDragStart` even though it was unbound by the first monitor\n  \tonDragStart: () => {},\n  });\n  ```\n\n## 0.9.0\n\n### Minor Changes\n\n- [#29651](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/29651)\n  [`03e0aa5ae85`](https://bitbucket.org/atlassian/atlassian-frontend/commits/03e0aa5ae85) -\n  `@atlaskit/drag-and-drop` adds event listeners to the `window` during a drag operation. These drag\n  operation event listeners were [`bubble` phase event listeners](https://domevents.dev/), but they\n  are now `capture` phase event listeners to be more resliant against external code (incorrectly)\n  stopping events.\n\n  This does not impact the ability of a consumer to have their own `draggable`s on a page not\n  controlled by `@atlaskit/drag-and-drop`\n\n## 0.8.1\n\n### Patch Changes\n\n- [#28324](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/28324)\n  [`6455cf006b3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6455cf006b3) - Builds\n  for this package now pass through a tokens babel plugin, removing runtime invocations of the\n  tokens() function and improving performance.\n\n## 0.8.0\n\n### Minor Changes\n\n- [#26317](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/26317)\n  [`1e3f9743e57`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1e3f9743e57) - A\n  _monitor_ that is added during an event (eg `onDragStart`) will no longer be called for the\n  current event. This is to prevent the accidental creation of infinite loops. This behaviour\n  matches native [`EventTargets`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget)\n  where an event listener cannot add another event listener during an active event to the same event\n  target in the same event phase.\n\n## 0.7.1\n\n### Patch Changes\n\n- [#24874](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24874)\n  [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade\n  Typescript from `4.3.5` to `4.5.5`\n\n## 0.7.0\n\n### Minor Changes\n\n- [#25428](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/25428)\n  [`f2a7931d609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f2a7931d609) - Adding\n  jsdoc to DragLocation type for better autocomplete\n\n## 0.6.0\n\n### Minor Changes\n\n- [#25002](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/25002)\n  [`0f755214ee7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0f755214ee7) - Internal\n  folder renaming. No API impact\n\n## 0.5.0\n\n### Minor Changes\n\n- [#25007](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/25007)\n  [`17950433a70`](https://bitbucket.org/atlassian/atlassian-frontend/commits/17950433a70) - Touching\n  package to release re-release previous version. The previous (now deprecated) version did not have\n  it's entry points built correctly\n\n## 0.4.0\n\n### Minor Changes\n\n- [#24861](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24861)\n  [`4d739042b04`](https://bitbucket.org/atlassian/atlassian-frontend/commits/4d739042b04) -\n  Improving jsdoc auto complete information for `GetFeedbackArgs`\n\n## 0.3.0\n\n### Minor Changes\n\n- [#24810](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24810)\n  [`52403a2c11f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/52403a2c11f) - Adding a\n  `canMonitor()` function to _monitors_ to allow a _monitor_ to conditionally apply to a drag\n  operation.\n\n  ```ts\n  monitorForElements({\n  \tcanMonitor: ({ source }) => source.data.type === 'card',\n  \tonDragStart: () => console.log('I will only be activated when dragging a card!'),\n  });\n  ```\n\n## 0.2.0\n\n### Minor Changes\n\n- [#24613](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24613)\n  [`1cf9e484b4b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1cf9e484b4b) - We have\n  improved our naming consistency across our drag and drop packages.\n  - `@atlaskit/drag-and-drop/util/cancel-unhandled` has been renamed to\n    `@atlaskit/drag-and-drop/addon/cancel-unhandled`\n\n## 0.1.0\n\n### Minor Changes\n\n- [#24532](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24532)\n  [`73427c38077`](https://bitbucket.org/atlassian/atlassian-frontend/commits/73427c38077) - Initial\n  release of `@atlaskit/drag-and-drop` packages 🎉\n\n## 0.0.1\n\n### Patch Changes\n\n- [#24492](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24492)\n  [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade\n  Typescript from `4.2.4` to `4.3.5`.\n"
  },
  {
    "path": "packages/core/LICENSE.md",
    "content": "Copyright 2022 Atlassian Pty Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in\ncompliance with the License. You may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is\ndistributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\nimplied. See the License for the specific language governing permissions and limitations under the\nLicense.\n"
  },
  {
    "path": "packages/core/README.md",
    "content": "# Pragmatic drag and drop\n\n> Fast drag and drop for any experience on any tech stack\n\nThe core package for Pragmatic drag and drop.\n\n[📖 Documentation](https://atlassian.design/components/pragmatic-drag-and-drop/)\n"
  },
  {
    "path": "packages/core/__tests__/playwright/external-files.spec.ts",
    "content": "import { readFileSync } from 'fs';\nimport path from 'path';\n\nimport invariant from 'tiny-invariant';\n\nimport { expect, type Page, test } from '@af/integration-testing';\n\nasync function getElement(page: Page, selector: string) {\n\tconst result = page.locator(selector);\n\tinvariant(result !== null);\n\treturn result;\n}\n\ntest.describe('file dropping', () => {\n\ttest('should support dropping of many files at once', async ({ browserName, page }) => {\n\t\t// eslint-disable-next-line playwright/no-conditional-in-test\n\t\tif (browserName === 'webkit') {\n\t\t\t/**\n\t\t\t * We are skipping this specific test for webkit due to failures.\n\t\t\t *\n\t\t\t * https://github.com/microsoft/playwright/issues/10667#issuecomment-1462668995\n\t\t\t * indicates that this is due to webkit not support DataTransfer\n\t\t\t * construction, but further investigation may be needed.\n\t\t\t *\n\t\t\t * We are still keeping webkit tests enabled for the package,\n\t\t\t * because tests unrelated to files still work.\n\t\t\t */\n\t\t\treturn;\n\t\t}\n\n\t\tawait page.visitExample<typeof import('../../examples/file.tsx')>('pragmatic-drag-and-drop', 'core', 'file');\n\n\t\t// waiting for the drop target to be visible as a way to ensure the example\n\t\t// is completely loaded (preemptively avoiding flakiness)\n\t\tawait page.locator('[data-drop-target-for-external]').waitFor({ state: 'visible' });\n\n\t\tconst fileData = [\n\t\t\t{\n\t\t\t\tname: 'package.json',\n\t\t\t\tdata: readFileSync(path.resolve(__dirname, '../../package.json')),\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: 'tsconfig.json',\n\t\t\t\tdata: readFileSync(path.resolve(__dirname, '../../tsconfig.json')),\n\t\t\t},\n\t\t];\n\n\t\tawait page.evaluateHandle((data) => {\n\t\t\tconst dataTransfer = new DataTransfer();\n\n\t\t\tdata.forEach((file) => {\n\t\t\t\tdataTransfer.items.add(\n\t\t\t\t\tnew File([file.data.toString('utf8')], file.name, {\n\t\t\t\t\t\ttype: 'application/json',\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t});\n\n\t\t\t/**\n\t\t\t * The drag enter on the window is what 'activates' the file adapter\n\t\t\t */\n\t\t\twindow.dispatchEvent(new DragEvent('dragenter', { dataTransfer }));\n\n\t\t\tconst dropTarget = document.querySelector('[data-testid=\"drop-target\"]');\n\t\t\tif (!dropTarget) {\n\t\t\t\tthrow new Error('no drop target');\n\t\t\t}\n\n\t\t\tdropTarget.dispatchEvent(new DragEvent('dragover', { dataTransfer }));\n\t\t\tdropTarget.dispatchEvent(new DragEvent('drop', { dataTransfer }));\n\t\t}, fileData);\n\n\t\t// just incase there are any delays in the processing of files\n\t\t// we will wait until the `dropped-files` element is visible\n\t\t// before continuing\n\t\t// (eg if the update is delayed by react)\n\t\tawait page.locator('[data-testid=\"dropped-files\"]').waitFor({ state: 'visible' });\n\n\t\tconst results = await getElement(page, '[data-testid=\"dropped-files\"]');\n\t\tconst text = await results.textContent();\n\t\texpect(text?.includes('package.json')).toBe(true);\n\t\texpect(text?.includes('tsconfig.json')).toBe(true);\n\t});\n\n\ttest('should capture and report a11y violations', async ({ browserName, page }) => {\n\t\t// eslint-disable-next-line playwright/no-conditional-in-test\n\t\tif (browserName === 'webkit') {\n\t\t\treturn;\n\t\t}\n\t\tawait page.visitExample<typeof import('../../examples/file.tsx')>('pragmatic-drag-and-drop', 'core', 'file');\n\t\tawait page.locator('[data-drop-target-for-external]').waitFor({ state: 'visible' });\n\n\t\tawait expect(page).toBeAccessible({ violationCount: 1 });\n\t});\n});\n"
  },
  {
    "path": "packages/core/__tests__/playwright/honey-pot.spec.ts",
    "content": "import invariant from 'tiny-invariant';\n\nimport { expect as baseExpect, type Locator, test } from '@af/integration-testing';\n\ntype Data = {\n\tmouseenter: number;\n\tmouseleave: number;\n\tdragstart: number;\n\tdrop: number;\n};\n\n// adding our own custom matcher\nconst expect = baseExpect.extend({\n\tasync toContainData(locator: Locator, expected: Partial<Data>) {\n\t\tconst assertionName = 'toContainData';\n\t\tlet pass: boolean;\n\t\tlet matcherResult: any;\n\t\ttry {\n\t\t\tfor (let [key, value] of Object.entries(expected)) {\n\t\t\t\t// eslint-disable-next-line playwright/no-standalone-expect\n\t\t\t\tawait expect(locator).toContainText(`${key}:${value}`);\n\t\t\t}\n\t\t\tpass = true;\n\t\t} catch (e: any) {\n\t\t\tmatcherResult = e.matcherResult;\n\t\t\tpass = false;\n\t\t}\n\n\t\t// copy pasted from\n\t\t// https://playwright.dev/docs/test-assertions#add-custom-matchers-using-expectextend\n\t\tconst message = pass\n\t\t\t? () =>\n\t\t\t\t\tthis.utils.matcherHint(assertionName, undefined, undefined, { isNot: this.isNot }) +\n\t\t\t\t\t'\\n\\n' +\n\t\t\t\t\t`Locator: ${locator}\\n` +\n\t\t\t\t\t`Expected: ${this.isNot ? 'not' : ''}${this.utils.printExpected(expected)}\\n` +\n\t\t\t\t\t(matcherResult ? `Received: ${this.utils.printReceived(matcherResult.actual)}` : '')\n\t\t\t: () =>\n\t\t\t\t\tthis.utils.matcherHint(assertionName, undefined, undefined, { isNot: this.isNot }) +\n\t\t\t\t\t'\\n\\n' +\n\t\t\t\t\t`Locator: ${locator}\\n` +\n\t\t\t\t\t`Expected: ${this.utils.printExpected(expected)}\\n` +\n\t\t\t\t\t(matcherResult ? `Received: ${this.utils.printReceived(matcherResult.actual)}` : '');\n\n\t\treturn {\n\t\t\tmessage,\n\t\t\tpass,\n\t\t\tname: assertionName,\n\t\t\texpected,\n\t\t\tactual: matcherResult?.actual,\n\t\t};\n\t},\n});\n\nconst notTouched: Data = { mouseenter: 0, mouseleave: 0, dragstart: 0, drop: 0 };\n\ntest.describe('honey pot', () => {\n\ttest('no \"mouseenter\" on incorrect elements after a drag', async ({ page }) => {\n\t\tawait page.visitExample<typeof import('../../examples/post-drop-bug-fix-simple.tsx')>('pragmatic-drag-and-drop', 'core', 'post-drop-bug-fix-simple');\n\t\tconst card0 = page.locator('[data-testid=\"card-0\"]');\n\t\tconst card1 = page.locator('[data-testid=\"card-1\"]');\n\t\tconst dragCount = page.locator('[data-testid=\"drag-count\"]');\n\t\tconst box0 = await card0.boundingBox();\n\t\tconst box1 = await card1.boundingBox();\n\t\tinvariant(box0);\n\t\tinvariant(box1);\n\n\t\tawait expect(card0).toContainData(notTouched);\n\t\tawait expect(card1).toContainData(notTouched);\n\t\tawait expect(dragCount).toContainText('Drags completed: 0');\n\n\t\t// start a drag\n\t\tawait page.mouse.move(box0.x + 1, box0.y + 1);\n\t\tawait page.mouse.down();\n\t\tawait page.mouse.move(box0.x + 10, box0.y + 1);\n\n\t\t// Not asserting that 'leave' has changed.\n\t\t// The honey pot will cause a 'leave' that won't happen\n\t\t// until a bit later when not using the honey pot\n\t\tawait expect(card0).toContainData({ mouseenter: 1, dragstart: 1, drop: 0 });\n\t\tawait expect(card1).toContainData(notTouched);\n\n\t\t// drag over card1\n\t\tawait page.mouse.move(box1.x + 1, box1.y + 1);\n\n\t\t// card 1 still not touched\n\t\tawait expect(card1).toContainData(notTouched);\n\n\t\t// dropped on card 1 which will swap card0 with card1\n\t\tawait page.mouse.up();\n\n\t\t// waiting for drop to finish\n\t\tawait expect(dragCount).toContainText('Drags completed: 1');\n\n\t\tawait expect(card1).toContainData({ drop: 1, mouseenter: 0, mouseleave: 0 });\n\t\t// Honey pot fix at work: counts have not incremented on card0\n\t\tawait expect(card0).toContainData({ mouseenter: 1, dragstart: 1, drop: 0 });\n\t});\n\n\ttest('no \"mouseenter\" on incorrect elements during a drag', async ({ page }) => {\n\t\tawait page.visitExample<typeof import('../../examples/post-drop-bug-fix-simple.tsx')>('pragmatic-drag-and-drop', 'core', 'post-drop-bug-fix-simple');\n\t\tconst card0 = page.locator('[data-testid=\"card-0\"]');\n\t\tconst card1 = page.locator('[data-testid=\"card-1\"]');\n\t\tconst dragCount = page.locator('[data-testid=\"drag-count\"]');\n\t\tconst box0 = await card0.boundingBox();\n\t\tconst box1 = await card1.boundingBox();\n\t\tinvariant(box0);\n\t\tinvariant(box1);\n\n\t\tawait expect(card0).toContainData(notTouched);\n\t\tawait expect(card1).toContainData(notTouched);\n\t\tawait expect(dragCount).toContainText('Drags completed: 0');\n\n\t\t// start a drag\n\t\tawait page.mouse.move(box0.x + 1, box0.y + 1);\n\t\tawait page.mouse.down();\n\t\tawait page.mouse.move(box0.x + 10, box0.y + 1);\n\n\t\t// Not asserting that 'leave' has changed.\n\t\t// The honey pot will cause a 'leave' that won't happen\n\t\t// until a bit later when not using the honey pot\n\t\tawait expect(card0).toContainData({ mouseenter: 1, dragstart: 1, drop: 0 });\n\t\tawait expect(card1).toContainData(notTouched);\n\n\t\t// this seems to be the most reliable way to scroll to the bottom\n\t\tawait page.locator('[data-testid=\"scroll-container\"]').evaluate((element) => {\n\t\t\telement.scrollTop = element.scrollHeight;\n\t\t});\n\n\t\t// we should have scrolled enough that card0 is no longer visible\n\t\tawait expect(card0).not.toBeInViewport();\n\n\t\t// check that no elements have been entered into by the mouse\n\t\tfor (let i = 2; i <= 29; i++) {\n\t\t\tconst locator = page.locator(`[data-testid=\"card-${i}\"]`);\n\t\t\tawait expect(locator).toContainData(notTouched);\n\t\t}\n\t});\n\n\ttest('should capture and report a11y violations', async ({ page }) => {\n\t\tawait page.visitExample<typeof import('../../examples/post-drop-bug-fix-simple.tsx')>('pragmatic-drag-and-drop', 'core', 'post-drop-bug-fix-simple');\n\t\tconst card0 = page.locator('[data-testid=\"card-0\"]');\n\t\tawait expect(card0).toContainData(notTouched);\n\n\t\tawait expect(page).toBeAccessible();\n\t});\n});\n"
  },
  {
    "path": "packages/core/__tests__/playwright/iframe.spec.ts",
    "content": "import invariant from 'tiny-invariant';\n\nimport { BROWSERS, expect, fixTest, type Locator, type Page, test } from '@af/integration-testing';\n\nfunction center(box: { x: number; y: number; height: number; width: number }): {\n\tx: number;\n\ty: number;\n} {\n\treturn {\n\t\tx: box.x + box.width / 2,\n\t\ty: box.y + box.height / 2,\n\t};\n}\n\n/**\n * When dragging into and out of iframes, it is important for the sequencing of events\n * the drag operation be closer to what a user would do.\n *\n * If we don't do this approach, then the drag won't exit the current document as the user\n * will always be over the honey pot element (in the current document)\n *\n * Locator.dragTo does this roughly:\n * - mouse.down\n * - mouse.move(destination)\n * - mouse.up\n *\n * The huge second mouse.move is problematic as it means that the honey pot will be created exactly\n * where the user will drop, and preventing the drag from leaving the current document\n */\nasync function realisticDragTo({ page, start, end }: { page: Page; start: Locator; end: Locator }) {\n\t// step 1: move mouse into the right spot\n\tconst startBox = await start.boundingBox();\n\tinvariant(startBox);\n\tconst centerOfStart = center(startBox);\n\tawait page.mouse.move(centerOfStart.x, centerOfStart.y);\n\n\t// step 2: start a drag\n\tawait page.mouse.down();\n\tawait page.mouse.move(centerOfStart.x + 20, centerOfStart.y);\n\n\t// step 3: move to the right spot\n\tconst endBox = await end.boundingBox();\n\tinvariant(endBox);\n\tconst centerOfEnd = center(endBox);\n\tawait page.mouse.move(centerOfEnd.x, centerOfEnd.y, { steps: 10 });\n\n\tawait page.mouse.up();\n}\n\nasync function setup({ page }: { page: Page }) {\n\tawait page.visitExample<typeof import('../../examples/iframe.tsx')>('pragmatic-drag-and-drop', 'core', 'iframe');\n\n\tconst dropTargetInParent = page.locator('[data-testid=\"drop-target-in-parent\"]');\n\tconst draggableInParent = page.locator('[data-testid=\"draggable-in-parent\"]');\n\n\tconst iframe = page.frameLocator('[data-testid=\"child-iframe\"]');\n\n\tconst dropTargetInIframe = iframe.locator('[data-testid=\"drop-target-in-iframe\"]');\n\tconst draggableInIframe = iframe.locator('[data-testid=\"draggable-in-iframe\"]');\n\n\tconst locators = {\n\t\tdropTargetInParent,\n\t\tdraggableInParent,\n\t\tdropTargetInIframe,\n\t\tdraggableInIframe,\n\t};\n\n\t// wait for everything to be ready before starting\n\tawait Promise.all(\n\t\tObject.values(locators).map((locator) =>\n\t\t\tlocator.waitFor({\n\t\t\t\tstate: 'visible',\n\t\t\t\t// adding a long timeout for CI,\n\t\t\t\t// as the iframe can take longer to load in CI\n\t\t\t\ttimeout: 90 * 1000,\n\t\t\t}),\n\t\t),\n\t);\n\n\t// asserting there is no drag data yet\n\tawait expect(dropTargetInParent).toContainText('Latest drop data: none');\n\tawait expect(dropTargetInIframe).toContainText('Latest drop data: none');\n\n\treturn locators;\n}\n\ntest.describe('iframes', () => {\n\ttest('parent → iframe', async ({ page }) => {\n\t\t// Dragging from parent → iframe works correctly with pdnd in Firefox@122.\n\t\t// However, there is a bug with Playwright where `.dragTo()` does not\n\t\t// publish drag events when dragging from parent → iframe\n\t\t// https://github.com/microsoft/playwright/issues/29278\n\t\tfixTest({\n\t\t\tjiraIssueId: 'TBD',\n\t\t\treason: 'Playwright bug when dragging from parent → iframe',\n\t\t\tbrowsers: [BROWSERS.firefox],\n\t\t});\n\n\t\tconst { dropTargetInParent, dropTargetInIframe, draggableInParent } = await setup({ page });\n\n\t\tawait realisticDragTo({ page, start: draggableInParent, end: dropTargetInIframe });\n\n\t\tawait expect(dropTargetInParent).toContainText(\n\t\t\t'Latest drop data: none',\n\t\t\t// Adding longer timeout for CI\n\t\t\t{ timeout: 60 * 1000 },\n\t\t);\n\t\tawait expect(dropTargetInIframe).toContainText(\n\t\t\t'Latest drop data: Drag from parent: 0',\n\t\t\t// Adding longer timeout for CI\n\t\t\t{ timeout: 60 * 1000 },\n\t\t);\n\t});\n\n\ttest('iframe → parent', async ({ page }) => {\n\t\tconst { dropTargetInParent, dropTargetInIframe, draggableInIframe } = await setup({ page });\n\n\t\tawait realisticDragTo({ page, start: draggableInIframe, end: dropTargetInParent });\n\n\t\tawait expect(dropTargetInIframe).toContainText(\n\t\t\t'Latest drop data: none',\n\t\t\t// Adding longer timeout for CI\n\t\t\t{ timeout: 60 * 1000 },\n\t\t);\n\t\tawait expect(dropTargetInParent).toContainText(\n\t\t\t'Latest drop data: Drag from iframe: 0',\n\t\t\t// Adding longer timeout for CI\n\t\t\t{ timeout: 60 * 1000 },\n\t\t);\n\t});\n\n\ttest('parent → iframe (multiple operations)', async ({ page }) => {\n\t\t// Dragging from parent → iframe works correctly with pdnd in Firefox@122.\n\t\t// However, there is a bug with Playwright where `.dragTo()` does not\n\t\t// publish drag events when dragging from parent → iframe\n\t\t// https://github.com/microsoft/playwright/issues/29278\n\t\tfixTest({\n\t\t\tjiraIssueId: 'TBD',\n\t\t\treason: 'Playwright bug when dragging from parent → iframe',\n\t\t\tbrowsers: [BROWSERS.firefox],\n\t\t});\n\n\t\tconst { dropTargetInParent, dropTargetInIframe, draggableInParent } = await setup({ page });\n\n\t\t// doing a few operations\n\t\tfor (let i = 0; i < 5; i++) {\n\t\t\tawait realisticDragTo({ page, start: draggableInParent, end: dropTargetInIframe });\n\n\t\t\tawait expect(dropTargetInIframe).toContainText(\n\t\t\t\t`Latest drop data: Drag from parent: ${i}`,\n\t\t\t\t// Adding longer timeout for CI\n\t\t\t\t{ timeout: 60 * 1000 },\n\t\t\t);\n\t\t\tawait expect(dropTargetInParent).toContainText(\n\t\t\t\t'Latest drop data: none',\n\t\t\t\t// Adding longer timeout for CI\n\t\t\t\t{ timeout: 60 * 1000 },\n\t\t\t);\n\t\t}\n\t});\n\n\ttest('iframe → parent (multiple operations)', async ({ page }) => {\n\t\tconst { dropTargetInParent, dropTargetInIframe, draggableInIframe } = await setup({ page });\n\n\t\t// doing a few operations\n\t\tfor (let i = 0; i < 5; i++) {\n\t\t\tawait realisticDragTo({ page, start: draggableInIframe, end: dropTargetInParent });\n\n\t\t\tawait expect(dropTargetInParent).toContainText(\n\t\t\t\t`Latest drop data: Drag from iframe: ${i}`,\n\t\t\t\t// Adding longer timeout for CI\n\t\t\t\t{ timeout: 60 * 1000 },\n\t\t\t);\n\t\t\tawait expect(dropTargetInIframe).toContainText(\n\t\t\t\t'Latest drop data: none',\n\t\t\t\t// Adding longer timeout for CI\n\t\t\t\t{ timeout: 60 * 1000 },\n\t\t\t);\n\t\t}\n\t});\n\n\t// this previously triggered a bug with our post drop fix in the iframe\n\ttest('iframe → parent, then parent → iframe', async ({ page }) => {\n\t\t// Dragging from parent → iframe works correctly with pdnd in Firefox@122.\n\t\t// However, there is a bug with Playwright where `.dragTo()` does not\n\t\t// publish drag events when dragging from parent → iframe\n\t\t// https://github.com/microsoft/playwright/issues/29278\n\t\tfixTest({\n\t\t\tjiraIssueId: 'TBD',\n\t\t\treason: 'Playwright bug when dragging from parent → iframe',\n\t\t\tbrowsers: [BROWSERS.firefox],\n\t\t});\n\n\t\tconst { dropTargetInParent, dropTargetInIframe, draggableInIframe, draggableInParent } =\n\t\t\tawait setup({ page });\n\n\t\t// iframe → parent\n\t\tawait realisticDragTo({ page, start: draggableInIframe, end: dropTargetInParent });\n\n\t\tawait expect(dropTargetInParent).toContainText(\n\t\t\t'Latest drop data: Drag from iframe: 0',\n\t\t\t// Adding longer timeout for CI\n\t\t\t{ timeout: 60 * 1000 },\n\t\t);\n\t\tawait expect(dropTargetInIframe).toContainText(\n\t\t\t'Latest drop data: none',\n\t\t\t// Adding longer timeout for CI\n\t\t\t{ timeout: 60 * 1000 },\n\t\t);\n\n\t\t// parent → iframe\n\t\tawait realisticDragTo({ page, start: draggableInParent, end: dropTargetInIframe });\n\n\t\tawait expect(dropTargetInParent).toContainText(\n\t\t\t'Latest drop data: Drag from iframe: 0',\n\t\t\t// Adding longer timeout for CI\n\t\t\t{ timeout: 60 * 1000 },\n\t\t);\n\t\tawait expect(dropTargetInIframe).toContainText(\n\t\t\t'Latest drop data: Drag from parent: 0',\n\t\t\t// Adding longer timeout for CI\n\t\t\t{ timeout: 60 * 1000 },\n\t\t);\n\t});\n\n\ttest('parent → iframe, then iframe → parent', async ({ page }) => {\n\t\t// Dragging from parent → iframe works correctly with pdnd in Firefox@122.\n\t\t// However, there is a bug with Playwright where `.dragTo()` does not\n\t\t// publish drag events when dragging from parent → iframe\n\t\t// https://github.com/microsoft/playwright/issues/29278\n\t\tfixTest({\n\t\t\tjiraIssueId: 'TBD',\n\t\t\treason: 'Playwright bug when dragging from parent → iframe',\n\t\t\tbrowsers: [BROWSERS.firefox],\n\t\t});\n\n\t\tconst { dropTargetInParent, dropTargetInIframe, draggableInIframe, draggableInParent } =\n\t\t\tawait setup({ page });\n\n\t\t// parent → iframe\n\t\tawait realisticDragTo({ page, start: draggableInParent, end: dropTargetInIframe });\n\n\t\tawait expect(dropTargetInIframe).toContainText(\n\t\t\t'Latest drop data: Drag from parent: 0',\n\t\t\t// Adding longer timeout for CI\n\t\t\t{ timeout: 60 * 1000 },\n\t\t);\n\t\tawait expect(dropTargetInParent).toContainText(\n\t\t\t'Latest drop data: none',\n\t\t\t// Adding longer timeout for CI\n\t\t\t{ timeout: 60 * 1000 },\n\t\t);\n\n\t\t// iframe → parent\n\t\tawait realisticDragTo({ page, start: draggableInIframe, end: dropTargetInParent });\n\n\t\tawait expect(dropTargetInIframe).toContainText(\n\t\t\t'Latest drop data: Drag from parent: 0',\n\t\t\t// Adding longer timeout for CI\n\t\t\t{ timeout: 60 * 1000 },\n\t\t);\n\t\tawait expect(dropTargetInParent).toContainText(\n\t\t\t'Latest drop data: Drag from iframe: 0',\n\t\t\t// Adding longer timeout for CI\n\t\t\t{ timeout: 60 * 1000 },\n\t\t);\n\t});\n\n\ttest('should capture and report a11y violations', async ({ page }) => {\n\t\tconst { dropTargetInIframe, draggableInParent } = await setup({ page });\n\n\t\tawait realisticDragTo({ page, start: draggableInParent, end: dropTargetInIframe });\n\n\t\tawait expect(page).toBeAccessible();\n\t});\n});\n"
  },
  {
    "path": "packages/core/__tests__/playwright/scroll-just-enough-into-view.spec.ts",
    "content": "import invariant from 'tiny-invariant';\n\nimport { expect, type Locator, test } from '@af/integration-testing';\n\nasync function getScrollTop(locator: Locator) {\n\treturn await locator.evaluate((element) => element.scrollTop);\n}\n\ntest.describe('scrollJustEnoughIntoView', () => {\n\tconst containerSelector = '[data-testid=\"container\"]';\n\tconst secondCardSelector = `[data-testid=\"card-1\"]`;\n\n\ttest('should scroll a partially hidden element into full visibility', async ({\n\t\tpage,\n\t\tbrowserName,\n\t}) => {\n\t\tawait page.visitExample<typeof import('../../examples/scroll-just-enough-into-view.tsx')>('pragmatic-drag-and-drop', 'core', 'scroll-just-enough-into-view');\n\n\t\tconst scrollContainer = page.locator(containerSelector);\n\t\t// this card begins partially obscured\n\t\tconst secondCard = page.locator(secondCardSelector);\n\t\texpect(await getScrollTop(scrollContainer)).toBe(0);\n\n\t\tawait await expect(secondCard).toHaveAttribute('data-state', 'idle');\n\n\t\tconst box = await secondCard.boundingBox();\n\t\tinvariant(box);\n\n\t\t// Note: this hover causes a scroll in Firefox :(\n\t\tawait secondCard.hover({\n\t\t\tposition: { x: 1, y: 1 },\n\t\t\t// using `force` to avoid built in scrolling by playwright to\n\t\t\t// make the element visible\n\t\t\t// eslint-disable-next-line playwright/no-force-option\n\t\t\tforce: true,\n\t\t});\n\n\t\tawait page.mouse.down();\n\n\t\t// checking the drag hasn't started yet\n\t\tawait await expect(secondCard).toHaveAttribute('data-state', 'idle');\n\t\t// eslint-disable-next-line playwright/no-conditional-in-test\n\t\tif (browserName !== 'firefox') {\n\t\t\texpect(await getScrollTop(scrollContainer)).toBe(0);\n\t\t}\n\n\t\t// move a bit to trigger a drag to start\n\t\tawait secondCard.hover({\n\t\t\t// using `force` to avoid built in scrolling by playwright to\n\t\t\t// make the element visible\n\t\t\t// eslint-disable-next-line playwright/no-force-option\n\t\t\tforce: true,\n\t\t});\n\n\t\tawait await expect(secondCard).toHaveAttribute('data-state', 'dragging');\n\n\t\t// After the drag the container should have scrolled.\n\t\texpect(await getScrollTop(scrollContainer)).toBeGreaterThan(0);\n\n\t\t// finish the drag\n\t\tawait page.mouse.up();\n\t\tawait await expect(secondCard).toHaveAttribute('data-state', 'idle');\n\t});\n\n\ttest('should not scroll if the element is already fully visible', async ({ page }) => {\n\t\tawait page.visitExample<typeof import('../../examples/scroll-just-enough-into-view.tsx')>('pragmatic-drag-and-drop', 'core', 'scroll-just-enough-into-view');\n\n\t\tconst scrollContainer = page.locator(containerSelector);\n\t\tconst secondCard = page.locator(secondCardSelector);\n\n\t\t/**\n\t\t * Begin by scrolling the second card fully into view.\n\t\t */\n\t\tawait secondCard.evaluate((element) => {\n\t\t\telement.scrollIntoView({ block: 'nearest' });\n\t\t});\n\t\tconst initialScrollTop = await getScrollTop(scrollContainer);\n\n\t\texpect(initialScrollTop).toBeGreaterThan(0);\n\n\t\tawait await expect(secondCard).toHaveAttribute('data-state', 'idle');\n\n\t\tconst box = await secondCard.boundingBox();\n\t\tinvariant(box);\n\t\tawait secondCard.hover({\n\t\t\tposition: { x: 1, y: 1 },\n\t\t\t// using `force` to avoid built in scrolling by playwright to\n\t\t\t// make the element visible\n\t\t\t// eslint-disable-next-line playwright/no-force-option\n\t\t\tforce: true,\n\t\t});\n\t\tawait page.mouse.down();\n\n\t\t// move a bit to trigger a drag to start\n\t\tawait secondCard.hover({\n\t\t\t// using `force` to avoid built in scrolling by playwright to\n\t\t\t// make the element visible\n\t\t\t// eslint-disable-next-line playwright/no-force-option\n\t\t\tforce: true,\n\t\t});\n\n\t\tawait await expect(secondCard).toHaveAttribute('data-state', 'dragging');\n\n\t\t// no scroll change required\n\t\texpect(await getScrollTop(scrollContainer)).toBe(initialScrollTop);\n\n\t\t// finish the drag\n\t\tawait page.mouse.up();\n\t\tawait await expect(secondCard).toHaveAttribute('data-state', 'idle');\n\t});\n\n\ttest('should capture and report a11y violations', async ({ page, browserName }) => {\n\t\tawait page.visitExample<typeof import('../../examples/scroll-just-enough-into-view.tsx')>('pragmatic-drag-and-drop', 'core', 'scroll-just-enough-into-view');\n\t\tawait expect(page).toBeAccessible({ violationCount: 1 });\n\t});\n});\n"
  },
  {
    "path": "packages/core/__tests__/playwright/stickiness.spec.tsx",
    "content": "import { expect, test } from '@af/integration-testing';\n\ntest.describe('stickiness', () => {\n\ttest('should hold on to the previous item and list container drop targets when drag moves outside of any drop target', async ({\n\t\tpage,\n\t}) => {\n\t\tawait page.visitExample<typeof import('../../examples/stickiness.tsx')>('pragmatic-drag-and-drop', 'core', 'stickiness');\n\t\tawait page.waitForSelector('[draggable=\"true\"]');\n\n\t\tconst dragHandle = page.getByTestId('list-item-2');\n\t\tconst dropTarget = page.getByTestId('list-item-5');\n\n\t\t// start the drag\n\t\tawait dragHandle.hover({ position: { x: 1, y: 1 } });\n\t\tawait page.mouse.down();\n\n\t\t// Explicitly starting the drag like this is needed for firefox\n\t\tawait dragHandle.hover({ position: { x: 10, y: 0 } });\n\n\t\t// move over drop target\n\t\tawait dropTarget.hover();\n\n\t\t// Expect both list item and list container are marked as being dragged over\n\t\tconst listItemDragIndicator = page.getByTestId('list-item-5.drag-indicator');\n\t\tawait expect(listItemDragIndicator).toHaveAttribute('data-is-dragged-over', 'true');\n\n\t\tconst listContainer = page.getByTestId('list-container');\n\t\tawait expect(listContainer).toHaveAttribute('data-is-dragged-over', 'true');\n\n\t\t// Move mouse onto the adjacent element that, so it is no longer over any drop targets.\n\t\tawait page.getByTestId('element-without-drop-target').hover();\n\n\t\t// Both list item and list container should still be marked as being dragged over\n\t\tawait expect(listItemDragIndicator).toHaveAttribute('data-is-dragged-over', 'true');\n\t\tawait expect(listContainer).toHaveAttribute('data-is-dragged-over', 'true');\n\t});\n});\n"
  },
  {
    "path": "packages/core/__tests__/playwright/text-selection.spec.ts",
    "content": "import { expect, test } from '@af/integration-testing';\n\ntest.describe('text selection', () => {\n\ttest('dragging text selection', async ({ page, browserName }) => {\n\t\t/**\n\t\t * Unfortunately there is a bug with text selection dragging\n\t\t * in Playwright for Chrome and Webkit.\n\t\t * https://github.com/microsoft/playwright/issues/29466\n\t\t */\n\t\t// eslint-disable-next-line playwright/no-conditional-in-test\n\t\tif (browserName !== 'firefox') {\n\t\t\treturn;\n\t\t}\n\n\t\tawait page.visitExample<typeof import('../../examples/text-selection.tsx')>('pragmatic-drag-and-drop', 'core', 'text-selection');\n\t\tconst dropTarget = page.locator('[data-testid=\"drop-target\"]');\n\t\tconst text = page.locator('[data-testid=\"text\"]');\n\t\tconst data = await text.innerText();\n\n\t\tawait text.selectText();\n\t\tawait text.dragTo(dropTarget);\n\n\t\tawait expect(dropTarget).toContainText(data);\n\t});\n\n\ttest('should capture and report a11y violations', async ({ page, browserName }) => {\n\t\t// eslint-disable-next-line playwright/no-conditional-in-test\n\t\tif (browserName !== 'firefox') {\n\t\t\treturn;\n\t\t}\n\t\tawait page.visitExample<typeof import('../../examples/text-selection.tsx')>('pragmatic-drag-and-drop', 'core', 'text-selection');\n\t\tconst dropTarget = page.locator('[data-testid=\"drop-target\"]');\n\t\tconst text = page.locator('[data-testid=\"text\"]');\n\t\tawait text.dragTo(dropTarget);\n\n\t\tawait expect(page).toBeAccessible();\n\t});\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/_util.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport invariant from 'tiny-invariant';\n\nimport {\n\ttype CleanupFn,\n\ttype DragLocation,\n\ttype DragLocationHistory,\n\ttype DropTargetRecord,\n\ttype Input,\n} from '../../src/entry-point/types';\nimport { type NativeMediaType } from '../../src/internal-types';\n\nexport function getDefaultInput(overrides: Partial<Input> = {}): Input {\n\tconst defaults: Input = {\n\t\t// user input\n\t\taltKey: false,\n\t\tbutton: 0,\n\t\tbuttons: 0,\n\t\tctrlKey: false,\n\t\tmetaKey: false,\n\t\tshiftKey: false,\n\n\t\t// coordinates\n\t\tclientX: 0,\n\t\tclientY: 0,\n\t\tpageX: 0,\n\t\tpageY: 0,\n\t};\n\n\treturn {\n\t\t...defaults,\n\t\t...overrides,\n\t};\n}\n\nexport function appendToBody(...elements: Element[]): CleanupFn {\n\telements.forEach((element) => {\n\t\tdocument.body.appendChild(element);\n\t});\n\n\treturn function removeFromBody() {\n\t\telements.forEach((element) => {\n\t\t\tdocument.body.removeChild(element);\n\t\t});\n\t};\n}\n\nexport function getEmptyHistory(input: Input = getDefaultInput()): DragLocationHistory {\n\tconst noWhere: DragLocation = {\n\t\tinput,\n\t\tdropTargets: [],\n\t};\n\n\treturn {\n\t\tinitial: noWhere,\n\t\tprevious: {\n\t\t\tdropTargets: noWhere.dropTargets,\n\t\t},\n\t\tcurrent: noWhere,\n\t};\n}\n\nexport function getInitialHistory(\n\tdropTargets: DropTargetRecord[],\n\tinput: Input = getDefaultInput(),\n): DragLocationHistory {\n\tconst location: DragLocation = {\n\t\tinput,\n\t\tdropTargets,\n\t};\n\n\treturn {\n\t\tinitial: location,\n\t\tcurrent: location,\n\t\tprevious: {\n\t\t\tdropTargets: [],\n\t\t},\n\t};\n}\n\nexport function setBoundingClientRect(el: HTMLElement, rect: DOMRect): CleanupFn {\n\tconst original = el.getBoundingClientRect;\n\n\tel.getBoundingClientRect = () => rect;\n\treturn () => {\n\t\tel.getBoundingClientRect = original;\n\t};\n}\n\nexport function getRect(box: {\n\ttop: number;\n\tbottom: number;\n\tleft: number;\n\tright: number;\n}): DOMRect {\n\treturn {\n\t\ttop: box.top,\n\t\tright: box.right,\n\t\tbottom: box.bottom,\n\t\tleft: box.left,\n\t\t// calculated\n\t\theight: box.bottom - box.top,\n\t\twidth: box.right - box.left,\n\t\tx: box.left,\n\t\ty: box.top,\n\t\ttoJSON: function () {\n\t\t\treturn JSON.stringify(this);\n\t\t},\n\t};\n}\n\nexport function getBubbleOrderedPath(path: Element[]): Element[] {\n\tconst last = path[path.length - 1];\n\t// will happen if you pass in an empty array\n\tif (!last) {\n\t\treturn path;\n\t}\n\t// exit condition: no more parents\n\tif (!last.parentElement) {\n\t\treturn path;\n\t}\n\t// bubble ordered\n\treturn getBubbleOrderedPath([...path, last.parentElement]);\n}\n\nexport function setElementFromPointWithPath(path: Element[]): CleanupFn {\n\tconst originalElementFromPoint = document.elementFromPoint;\n\tconst originalElementsFromPoint = document.elementsFromPoint;\n\n\tdocument.elementsFromPoint = () => path;\n\tdocument.elementFromPoint = () => path[0] ?? null;\n\n\treturn () => {\n\t\tdocument.elementFromPoint = originalElementFromPoint;\n\t\tdocument.elementsFromPoint = originalElementsFromPoint;\n\t};\n}\n\nexport function setElementFromPoint(element: Element | null): CleanupFn {\n\tconst path = element ? getBubbleOrderedPath([element]) : [];\n\treturn setElementFromPointWithPath(path);\n}\n\n/**\n *\n * @example const [A, B, C, D, E] = getElements('div');\n */\nexport function getElements<TagName extends keyof HTMLElementTagNameMap>(\n\ttagName: TagName,\n): Iterable<HTMLElementTagNameMap[TagName]> {\n\tconst iterator = {\n\t\tnext() {\n\t\t\treturn {\n\t\t\t\tdone: false,\n\t\t\t\tvalue: document.createElement(tagName),\n\t\t\t};\n\t\t},\n\t\t[Symbol.iterator]() {\n\t\t\treturn iterator;\n\t\t},\n\t};\n\treturn iterator;\n}\n\n/**\n * Returns a connected tree of elements\n *\n * @example const [child, parent, grandParent] = getBubbleOrderedTree();\n */\nexport function getBubbleOrderedTree(\n\ttagName: keyof HTMLElementTagNameMap = 'div',\n): Iterable<HTMLElement> {\n\tlet last: HTMLElement | null;\n\tconst iterator = {\n\t\tnext() {\n\t\t\tconst element = document.createElement(tagName);\n\n\t\t\tif (last) {\n\t\t\t\telement.appendChild(last);\n\t\t\t}\n\t\t\tlast = element;\n\n\t\t\treturn {\n\t\t\t\tdone: false,\n\t\t\t\tvalue: element,\n\t\t\t};\n\t\t},\n\t\t[Symbol.iterator]() {\n\t\t\treturn iterator;\n\t\t},\n\t};\n\treturn iterator;\n}\n\ntype SimpleItem = { data: string; type: NativeMediaType } | File;\nexport function addItemsToEvent({ event, items }: { event: DragEvent; items: SimpleItem[] }): void {\n\tfor (const item of items) {\n\t\tif (item instanceof File) {\n\t\t\tevent.dataTransfer?.items.add(item);\n\t\t\tcontinue;\n\t\t}\n\t\tevent.dataTransfer?.items.add(item.data, item.type);\n\t}\n}\n\nexport const nativeDrag = {\n\tstartExternal({\n\t\titems,\n\t\ttarget = document.body,\n\t}: {\n\t\titems: SimpleItem[];\n\t\ttarget?: Element;\n\t}): void {\n\t\tconst event = new DragEvent('dragenter', {\n\t\t\tcancelable: true,\n\t\t\tbubbles: true,\n\t\t});\n\t\taddItemsToEvent({ event, items });\n\t\ttarget.dispatchEvent(event);\n\t\t// @ts-expect-error\n\t\trequestAnimationFrame.step();\n\t},\n\t// making items and target required as they are needed for internal drags\n\tstartInternal({ items, target }: { items: SimpleItem[]; target: Element }): void {\n\t\tconst event = new DragEvent('dragstart', {\n\t\t\tcancelable: true,\n\t\t\tbubbles: true,\n\t\t});\n\t\taddItemsToEvent({ event, items });\n\t\ttarget.dispatchEvent(event);\n\t\t// @ts-expect-error\n\t\trequestAnimationFrame.step();\n\t},\n\tstartTextSelectionDrag({ element = document.body }: { element: Element }): void {\n\t\tconst text = getFirstTextNode(element);\n\n\t\tconst event = new DragEvent('dragstart', {\n\t\t\tcancelable: true,\n\t\t\tbubbles: true,\n\t\t});\n\n\t\taddItemsToEvent({\n\t\t\tevent,\n\t\t\titems: [\n\t\t\t\t{ type: 'text/plain', data: element.textContent ?? '' },\n\t\t\t\t// Note: the outer HTML of the whole selection is dragged.\n\t\t\t\t// `element.outerHTML` is a reasonable approximation for testing\n\t\t\t\t{ type: 'text/html', data: element.outerHTML ?? '' },\n\t\t\t],\n\t\t});\n\n\t\ttext.dispatchEvent(event);\n\t\t// @ts-expect-error\n\t\trequestAnimationFrame.step();\n\t},\n\tdrop({\n\t\titems = [],\n\t\ttarget = document.body,\n\t}: {\n\t\titems?: SimpleItem[];\n\t\ttarget?: Element;\n\t}): DragEvent {\n\t\tconst event = new DragEvent('drop', { cancelable: true, bubbles: true });\n\t\taddItemsToEvent({ event, items });\n\t\ttarget.dispatchEvent(event);\n\t\treturn event;\n\t},\n};\n\nfunction isTextNode(node: Node): node is Text {\n\treturn node.nodeType === Node.TEXT_NODE;\n}\n\nexport function getFirstTextNode(element: Element): Text {\n\tconst walker = document.createTreeWalker(element, NodeFilter.SHOW_TEXT);\n\tconst first = walker.firstChild();\n\tinvariant(first, 'element contained no text nodes');\n\tinvariant(isTextNode(first), 'invalid text node found');\n\treturn first;\n}\n\nexport const assortedNativeMediaTypes: NativeMediaType[] = [\n\t// common\n\t'text/html',\n\t'text/plain',\n\t'text/uri-list',\n\n\t// Internally, the type is stored as \"files\",\n\t// But the DataTransfer.types array value will be \"Files\"\n\t'files',\n\n\t// uncommon\n\t'text/css',\n\t'text/csv',\n];\n\nfunction withDefaults(input?: Partial<Input>): Input {\n\treturn {\n\t\t...getDefaultInput(),\n\t\t...input,\n\t};\n}\n\nexport const userEvent = {\n\tlift(target: HTMLElement, input?: Partial<Input>): void {\n\t\tfireEvent.dragStart(target, withDefaults(input));\n\n\t\t// after an animation frame we fire `onDragStart`\n\t\t// @ts-ignore\n\t\trequestAnimationFrame.step();\n\t},\n\tdrop(target: Element, input?: Partial<Input>): void {\n\t\tfireEvent.drop(target, withDefaults(input));\n\t},\n\tcancel(target: Element = document.body, input?: Partial<Input>): void {\n\t\tconst value = withDefaults(input);\n\t\t// A \"cancel\" (drop on nothing, or pressing \"Escape\") will\n\t\t// cause a \"dragleave\" and then a \"dragend\"\n\t\tfireEvent.dragLeave(target, value);\n\t\tfireEvent.dragEnd(target, value);\n\t},\n\tleaveWindow(): void {\n\t\tfireEvent.dragLeave(document.documentElement, { relatedTarget: null });\n\t},\n\trougePointerMoves(): void {\n\t\t// first 20 are ignored due to firefox issue\n\t\t// 21st pointermove will cancel a drag\n\t\tfor (let i = 0; i < 21; i++) {\n\t\t\tfireEvent.pointerMove(document.body);\n\t\t}\n\t},\n};\n\n/** Cleanup function to unbind all event listeners */\nexport function reset(): void {\n\t// cleanup any pending drags\n\tfireEvent.dragEnd(window);\n\n\t// Cleaning up post-drop fix\n\tfireEvent.pointerMove(window);\n}\n\nexport const firePointer: {\n\tdown: (target: Element | Document | Window, input?: Partial<Input>) => void;\n\tup: (target: Element | Document | Window, input?: Partial<Input>) => void;\n\tmove: (target: Element | Document | Window, input?: Partial<Input>) => void;\n\tcancel: (target: Element | Document | Window, input?: Partial<Input>) => void;\n} = (() => {\n\tfunction makeDispatch(eventName: string) {\n\t\treturn function dispatch(\n\t\t\ttarget: Element | Document | Window,\n\t\t\tinput: Partial<Input> = {},\n\t\t): void {\n\t\t\tconst inputWithDefaults = {\n\t\t\t\t...getDefaultInput(),\n\t\t\t\t...input,\n\t\t\t};\n\t\t\ttarget.dispatchEvent(\n\t\t\t\tnew MouseEvent(eventName, {\n\t\t\t\t\tbubbles: true,\n\t\t\t\t\tcancelable: true,\n\t\t\t\t\t...inputWithDefaults,\n\t\t\t\t}),\n\t\t\t);\n\t\t};\n\t}\n\n\treturn {\n\t\tdown: makeDispatch('pointerdown'),\n\t\tup: makeDispatch('pointerup'),\n\t\tmove: makeDispatch('pointermove'),\n\t\tcancel: makeDispatch('pointercancel'),\n\t};\n})();\n\nexport function clearSelection(): void {\n\tdocument.getSelection()?.empty();\n}\n\nexport function select(element: HTMLElement): CleanupFn {\n\tconst selection = document.getSelection();\n\tconst range = new Range();\n\trange.selectNode(element);\n\tselection?.addRange(range);\n\treturn clearSelection;\n}\n"
  },
  {
    "path": "packages/core/__tests__/unit/android/is-android.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport { bind } from 'bind-event-listener';\nimport invariant from 'tiny-invariant';\n\nimport { elementAdapterNativeDataKey } from '../../../src/adapter/element-adapter-native-data-key';\nimport { combine } from '../../../src/entry-point/combine';\nimport { draggable } from '../../../src/entry-point/element/adapter';\nimport {\n\tdropTargetForExternal,\n\tmonitorForExternal,\n} from '../../../src/entry-point/external/adapter';\nimport type { CleanupFn } from '../../../src/entry-point/types';\nimport { getHTML } from '../../../src/public-utils/external/html';\nimport { androidFallbackText } from '../../../src/util/android';\nimport { textMediaType } from '../../../src/util/media-types/text-media-type';\nimport { appendToBody, getElements, nativeDrag, reset, userEvent } from '../_util';\n\nfunction setAndroidUserAgent(): CleanupFn {\n\tconst original = navigator.userAgent;\n\n\tObject.defineProperty(navigator, 'userAgent', {\n\t\tvalue:\n\t\t\t'Mozilla/5.0 (Linux; Android 14) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.6099.43 Mobile Safari/537.36',\n\t\twritable: true,\n\t});\n\n\treturn function cleanup() {\n\t\tObject.defineProperty(navigator, 'userAgent', {\n\t\t\tvalue: original,\n\t\t\twritable: true,\n\t\t});\n\t};\n}\n\nconst resetUserAgent = setAndroidUserAgent();\nafterAll(resetUserAgent);\nafterEach(reset);\n\nit('should add fallback \"text/plain\" data if none is already added by an draggable', () => {\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\tlet transfer: DataTransfer = new DataTransfer();\n\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t}),\n\t\tbind(window, {\n\t\t\ttype: 'dragstart',\n\t\t\tlistener(event) {\n\t\t\t\tinvariant(event.dataTransfer);\n\t\t\t\tordered.push('native:start');\n\t\t\t\ttransfer = event.dataTransfer;\n\t\t\t},\n\t\t\t// want to come in after the external adapter\n\t\t\toptions: { capture: false },\n\t\t}),\n\t);\n\n\tuserEvent.lift(element);\n\n\texpect(ordered).toEqual(['draggable:preview', 'native:start', 'draggable:start']);\n\tinvariant(transfer);\n\n\texpect(transfer.types).toEqual([elementAdapterNativeDataKey, 'text/plain']);\n\texpect(transfer.getData('text/plain')).toEqual(androidFallbackText);\n\n\tcleanup();\n});\n\nit('should not add fallback \"text/plain\" data if \"text/plain\" is already added by an draggable', () => {\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\tlet transfer: DataTransfer = new DataTransfer();\n\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tgetInitialDataForExternal: () => ({ 'text/plain': 'Hello' }),\n\t\t}),\n\t\tbind(window, {\n\t\t\ttype: 'dragstart',\n\t\t\tlistener(event) {\n\t\t\t\tinvariant(event.dataTransfer);\n\t\t\t\tordered.push('native:start');\n\t\t\t\ttransfer = event.dataTransfer;\n\t\t\t},\n\t\t\t// want to come in after the external adapter\n\t\t\toptions: { capture: false },\n\t\t}),\n\t);\n\n\tuserEvent.lift(element);\n\n\texpect(ordered).toEqual(['draggable:preview', 'native:start', 'draggable:start']);\n\tinvariant(transfer);\n\n\texpect(transfer.types).toEqual([elementAdapterNativeDataKey, 'text/plain']);\n\texpect(transfer.getData('text/plain')).toEqual('Hello');\n\n\tcleanup();\n});\n\nit('should not add fallback \"text/plain\" data if \"text/uri-list\" is already added by an draggable', () => {\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\tlet nativeDataTransfer: DataTransfer = new DataTransfer();\n\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tgetInitialDataForExternal: () => ({\n\t\t\t\t'text/uri-list': 'https://atlassian.design',\n\t\t\t}),\n\t\t}),\n\t\tbind(window, {\n\t\t\ttype: 'dragstart',\n\t\t\tlistener(event) {\n\t\t\t\tinvariant(event.dataTransfer);\n\t\t\t\tordered.push('native:start');\n\t\t\t\tnativeDataTransfer = event.dataTransfer;\n\t\t\t},\n\t\t\t// want to come in after the external adapter\n\t\t\toptions: { capture: false },\n\t\t}),\n\t);\n\n\t// firing \"dragstart\", but not doing a full lift\n\t// (which comes after an animation frame)\n\tfireEvent.dragStart(element);\n\n\texpect(ordered).toEqual(['draggable:preview', 'native:start']);\n\tinvariant(nativeDataTransfer);\n\n\texpect(nativeDataTransfer.types).toEqual([\n\t\telementAdapterNativeDataKey,\n\t\t'text/uri-list',\n\t\t// text/plain not included\n\t]);\n\t// the native data transfer returns \"\" when no data is set,\n\t// or if the empty string is explicitly set.\n\texpect(nativeDataTransfer.getData('text/plain')).toBe('');\n\n\tcleanup();\n});\n\nit('should not start a external drag if the only data is the android fallback \"text/plain\" data', () => {\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t}),\n\t);\n\n\tnativeDrag.startExternal({\n\t\titems: [\n\t\t\t{ type: elementAdapterNativeDataKey, data: '' },\n\t\t\t{ type: textMediaType, data: androidFallbackText },\n\t\t],\n\t});\n\n\t// drag not started\n\texpect(ordered).toEqual([]);\n\n\tcleanup();\n});\n\nit('should not expose a \"text/plain\" type (or item) to the external adapter if the data is the fake android data', () => {\n\tconst ordered: string[] = [];\n\tconst [A] = getElements('div');\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\tonDrop: () => ordered.push('A:drop'),\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: ({ source }) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t\t// Android fallback is removed, and we only get html\n\t\t\t\texpect(source.types).toEqual(['text/html']);\n\n\t\t\t\t// items not exposed until drop\n\t\t\t\texpect(source.items).toEqual([]);\n\t\t\t},\n\t\t\tonDrop({ source }) {\n\t\t\t\tordered.push('monitor:drop');\n\n\t\t\t\t// Android fallback is removed, and we only get html\n\t\t\t\texpect(source.types).toEqual(['text/html']);\n\n\t\t\t\texpect(source.items.length).toBe(1);\n\t\t\t\texpect(getHTML({ source })).toBe('<strong>Hello</strong>');\n\t\t\t\texpect(source.getStringData('text/plain')).toBe(null);\n\t\t\t},\n\t\t}),\n\t);\n\n\tnativeDrag.startExternal({\n\t\titems: [\n\t\t\t{ type: textMediaType, data: androidFallbackText },\n\t\t\t{ type: 'text/html', data: '<strong>Hello</strong>' },\n\t\t],\n\t});\n\n\t// drag not started\n\texpect(ordered).toEqual(['monitor:start']);\n\tordered.length = 0;\n\n\tfireEvent.dragEnter(A);\n\texpect(ordered).toEqual(['A:enter']);\n\tordered.length = 0;\n\n\tnativeDrag.drop({\n\t\titems: [\n\t\t\t{ type: textMediaType, data: androidFallbackText },\n\t\t\t{ type: 'text/html', data: '<strong>Hello</strong>' },\n\t\t],\n\t});\n\n\texpect(ordered).toEqual(['A:drop', 'monitor:drop']);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/android/not-android.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport { bind } from 'bind-event-listener';\nimport invariant from 'tiny-invariant';\n\nimport { combine } from '../../../src/entry-point/combine';\nimport { draggable } from '../../../src/entry-point/element/adapter';\nimport {\n\tdropTargetForExternal,\n\tmonitorForExternal,\n} from '../../../src/entry-point/external/adapter';\nimport { getHTML } from '../../../src/public-utils/external/html';\nimport { androidFallbackText } from '../../../src/util/android';\nimport { textMediaType } from '../../../src/util/media-types/text-media-type';\nimport { appendToBody, getElements, nativeDrag, reset, userEvent } from '../_util';\n\n/** Why these tests are in a separate file to `android.spec.ts`?\n * - our `isAndroid()` result is cached, so we need to reset it's cache\n * - using `jest.isolateModules(fn)` requires using `require()`\n * - `require()` in our repo (right now) makes all the types `any`\n */\n\nafterEach(reset);\n\nit('should not add a fake \"text/plain\" entry', () => {\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\tlet transfer: DataTransfer = new DataTransfer();\n\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t}),\n\t\tbind(window, {\n\t\t\ttype: 'dragstart',\n\t\t\tlistener(event) {\n\t\t\t\tinvariant(event.dataTransfer);\n\t\t\t\tordered.push('native:start');\n\t\t\t\ttransfer = event.dataTransfer;\n\t\t\t},\n\t\t\t// want to come in after the element adapter\n\t\t\toptions: { capture: false },\n\t\t}),\n\t);\n\n\tuserEvent.lift(element);\n\n\texpect(ordered).toEqual(['draggable:preview', 'native:start', 'draggable:start']);\n\tinvariant(transfer);\n\n\texpect(transfer.types).toEqual(['application/vnd.pdnd']);\n\texpect(transfer.getData('text/plain')).toEqual('');\n\n\tcleanup();\n});\n\nit('should not expose a \"text/plain\" type (or item) to the external adapter if the data is the fake android data', () => {\n\tconst [A] = getElements('div');\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\tonDrop: () => ordered.push('A:drop'),\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: ({ source }) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t\t// Android fallback is removed, and we only get html\n\t\t\t\texpect(source.types).toEqual(['text/html']);\n\n\t\t\t\t// items not exposed until drop\n\t\t\t\texpect(source.items).toEqual([]);\n\t\t\t},\n\t\t\tonDrop({ source }) {\n\t\t\t\tordered.push('monitor:drop');\n\n\t\t\t\t// Android fallback is removed, and we only get html\n\t\t\t\texpect(source.types).toEqual(['text/html']);\n\t\t\t\t// item not exposed\n\t\t\t\texpect(source.items.length).toBe(1);\n\t\t\t\t// data not exposed\n\t\t\t\texpect(source.getStringData('text/plain')).toBe(null);\n\n\t\t\t\texpect(getHTML({ source: source })).toBe('<strong>Hello</strong>');\n\t\t\t},\n\t\t}),\n\t);\n\n\tnativeDrag.startExternal({\n\t\titems: [\n\t\t\t{ type: textMediaType, data: androidFallbackText },\n\t\t\t{ type: 'text/html', data: '<strong>Hello</strong>' },\n\t\t],\n\t});\n\n\texpect(ordered).toEqual(['monitor:start']);\n\tordered.length = 0;\n\n\tfireEvent.dragEnter(A);\n\texpect(ordered).toEqual(['A:enter']);\n\tordered.length = 0;\n\n\tnativeDrag.drop({\n\t\titems: [\n\t\t\t{ type: textMediaType, data: androidFallbackText },\n\t\t\t{ type: 'text/html', data: '<strong>Hello</strong>' },\n\t\t],\n\t\ttarget: A,\n\t});\n\n\texpect(ordered).toEqual(['A:drop', 'monitor:drop']);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/dependency-guardrails.spec.ts",
    "content": "// @atlaskit/pragmatic-drag-and-drop is a public (open source) package.\n// These tests guard against accidentally growing the bundle size\n// by pulling in large Atlassian-internal dependencies.\n\nimport fs from 'fs';\nimport path from 'path';\n\n// Atlassian feature flag libraries add significant bundle weight\n// and should never be shipped to open source consumers.\nconst blockedPackages = [\n\t'@atlaskit/platform-feature-flags',\n\t'@atlaskit/platform-feature-flags-react',\n\t'@atlaskit/feature-flag-client',\n\t'@atlassian/feature-flags-test-utils',\n\t'@atlassian/feature-flag-metrics',\n\t'@atlassiansox/feature-flag-web-client',\n];\n\n// Known violations that need to be cleaned up.\n// Do not add to this list - instead, remove the feature flag usage.\nconst allowlist: string[] = [\n\t'react-accessibility/src/ambient.d.ts',\n\t'react-accessibility/src/drag-handle-button-small.tsx',\n];\n\nconst importPattern = new RegExp(\n\tblockedPackages.map((pkg) => pkg.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')).join('|'),\n);\n\ntest('pragmatic-drag-and-drop source files should not import Atlassian feature flag libraries', () => {\n\tconst globby = require('globby');\n\tconst pdndRoot = path.resolve(__dirname, '..', '..', '..');\n\n\tconst sourceFiles: string[] = globby.sync('*/src/**/*.{ts,tsx}', {\n\t\tcwd: pdndRoot,\n\t});\n\n\texpect(sourceFiles.length).toBeGreaterThan(0);\n\n\tconst violations: string[] = [];\n\n\tfor (const file of sourceFiles) {\n\t\tif (allowlist.includes(file)) {\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst fullPath = path.resolve(pdndRoot, file);\n\t\tconst contents = fs.readFileSync(fullPath, 'utf-8');\n\n\t\tif (importPattern.test(contents)) {\n\t\t\tviolations.push(file);\n\t\t}\n\t}\n\n\texpect(violations).toEqual([]);\n});\n\n// Lock down the core package's dependency list to keep the bundle small for open source consumers.\n// If you need to add a dependency, consider the bundle size impact carefully.\nconst allowedCoreDependencies = ['@babel/runtime', 'bind-event-listener', 'raf-schd'];\n\ntest('@atlaskit/pragmatic-drag-and-drop should only have allowed dependencies', () => {\n\tconst packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');\n\tconst packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));\n\tconst deps = Object.keys(packageJson.dependencies ?? {});\n\n\texpect(deps).toEqual(allowedCoreDependencies);\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/changes-during-a-drag.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../src/entry-point/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\ttype ElementEventPayloadMap,\n\tmonitorForElements,\n} from '../../../src/entry-point/element/adapter';\nimport { appendToBody, getBubbleOrderedTree, getElements, reset, userEvent } from '../_util';\n\nafterEach(reset);\n\ntest('adding a draggable during a drag', () => {\n\tconst [A, B] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\tonDrop: () => ordered.push('a:drop'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(A);\n\texpect(ordered).toEqual(['a:start']);\n\tordered.length = 0;\n\n\t// this should not throw\n\tconst cleanup2 = combine(\n\t\tappendToBody(B),\n\t\tdraggable({\n\t\t\telement: B,\n\t\t\tonDragStart: () => ordered.push('b:start'),\n\t\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\t\tonDrop: () => ordered.push('b:drop'),\n\t\t}),\n\t);\n\n\tfireEvent.dragEnter(B);\n\texpect(ordered).toEqual([]);\n\n\tuserEvent.cancel(A);\n\n\texpect(ordered).toEqual(['a:drop']);\n\n\tcleanup();\n\tcleanup2();\n});\n\ntest('removing the dragging item during a drag (drop)', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst [X] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanupDropTargets = combine(\n\t\tappendToBody(A, X),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDrop: () => ordered.push('a:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: X,\n\t\t\tonDragStart: () => ordered.push('x:start'),\n\t\t\tonDropTargetChange: () => ordered.push('x:update'),\n\t\t\tonDragEnter: () => ordered.push('x:enter'),\n\t\t\tonDragLeave: () => ordered.push('x:leave'),\n\t\t\tonDrop: () => ordered.push('x:drop'),\n\t\t}),\n\t);\n\tconst cleanupDraggable = combine(\n\t\t() => A.removeChild(draggableEl),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\texpect(ordered).toEqual(['draggable:start', 'a:start']);\n\tordered.length = 0;\n\n\t// nothing changed!\n\texpect(ordered).toEqual([]);\n\n\t// moving over B\n\tfireEvent.dragEnter(X);\n\texpect(ordered).toEqual(['draggable:update', 'a:update', 'a:leave', 'x:update', 'x:enter']);\n\tordered.length = 0;\n\n\t// remove the draggable\n\tcleanupDraggable();\n\n\tuserEvent.drop(X);\n\n\texpect(ordered).toEqual([\n\t\t// draggable is gone!\n\t\t// 'draggable:drop',\n\t\t'x:drop',\n\t]);\n\n\tcleanupDropTargets();\n});\n\ntest('removing the dragging item during a drag (cancel [looking a \"pointermove\"])', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst cleanupDropTarget = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tgetData: () => ({ id: 'A' }),\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:change'),\n\t\t\tonDrop: () => ordered.push('a:drop'),\n\t\t}),\n\t);\n\tconst cleanupMonitor = monitorForElements({\n\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\tonDropTargetChange: () => ordered.push('monitor:change'),\n\t\tonDrop: () => ordered.push('monitor:drop'),\n\t});\n\tconst cleanupDraggable = combine(\n\t\t() => A.removeChild(draggableEl),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\n\texpect(ordered).toEqual(['draggable:start', 'a:start', 'monitor:start']);\n\tordered.length = 0;\n\n\tcleanupDraggable();\n\n\t// Note: `dragend` is not fired on the source element if it is removed from the DOM\n\t// `draggableEl` is no longer in the DOM so the event won't bubble anywhere\n\texpect(ordered).toEqual([]);\n\n\t// after some rouge pointer movements the drag will be killed for real\n\tuserEvent.rougePointerMoves();\n\n\texpect(ordered).toEqual([\n\t\t// when a drag is canceled we first leave the current drop targets\n\t\t'a:change',\n\t\t'monitor:change',\n\t\t// the monitor will hear about the final drop event\n\t\t'monitor:drop',\n\t]);\n\n\tcleanupDropTarget();\n\tcleanupMonitor();\n});\n\ntest('removing the dragging item during a drag (cancel [looking a \"pointerdown\"])', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst cleanupDropTarget = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tgetData: () => ({ id: 'A' }),\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:change'),\n\t\t\tonDrop: () => ordered.push('a:drop'),\n\t\t}),\n\t);\n\tconst cleanupMonitor = monitorForElements({\n\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\tonDropTargetChange: () => ordered.push('monitor:change'),\n\t\tonDrop: () => ordered.push('monitor:drop'),\n\t});\n\tconst cleanupDraggable = combine(\n\t\t() => A.removeChild(draggableEl),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\n\texpect(ordered).toEqual(['draggable:start', 'a:start', 'monitor:start']);\n\tordered.length = 0;\n\n\tcleanupDraggable();\n\n\t// Note: `dragend` is not fired on the source element if it is removed from the DOM\n\t// `draggableEl` is no longer in the DOM so the event won't bubble anywhere\n\texpect(ordered).toEqual([]);\n\n\t// if we see a \"pointerdown\" event we know the last drag is finished\n\tfireEvent.pointerDown(A);\n\n\texpect(ordered).toEqual([\n\t\t// when a drag is canceled we first leave the current drop targets\n\t\t'a:change',\n\t\t'monitor:change',\n\t\t// the monitor will hear about the final drop event\n\t\t'monitor:drop',\n\t]);\n\n\tcleanupDropTarget();\n\tcleanupMonitor();\n});\n\ntest('changing the dragging item during a drag', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst cleanupDropTargets = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonDragStart: ({ source }) => ordered.push(`a:start[sourceId:${source.data.id}]`),\n\t\t\tonDrag: ({ source }) => ordered.push(`a:drag[sourceId:${source.data.id}]`),\n\t\t\tonDrop: ({ source }) => ordered.push(`a:drop[sourceId:${source.data.id}]`),\n\t\t}),\n\t);\n\tconst cleanupDraggable1 = draggable({\n\t\telement: draggableEl,\n\t\tgetInitialData: () => ({ id: '1' }),\n\t\tonDragStart: ({ source }) => ordered.push(`draggable(1):start[sourceId:${source.data.id}]`),\n\t\tonDrag: ({ source }) => ordered.push(`draggable(1):drag[sourceId:${source.data.id}]`),\n\t\tonDrop: ({ source }) => ordered.push(`draggable(1):drop[sourceId:${source.data.id}]`),\n\t});\n\n\tuserEvent.lift(draggableEl);\n\texpect(ordered).toEqual(['draggable(1):start[sourceId:1]', 'a:start[sourceId:1]']);\n\tordered.length = 0;\n\n\t// nothing changed!\n\texpect(ordered).toEqual([]);\n\n\tfireEvent.dragOver(A);\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['draggable(1):drag[sourceId:1]', 'a:drag[sourceId:1]']);\n\tordered.length = 0;\n\n\t// remove the old draggable\n\tcleanupDraggable1();\n\n\t// add draggable on same element with new events callbacks (and data)\n\tconst cleanupDraggable2 = draggable({\n\t\telement: draggableEl,\n\t\t// changed data will not be picked up (only collected on pickup)\n\t\tgetInitialData: () => ({ id: '2' }),\n\t\tonDragStart: ({ source }) => ordered.push(`draggable(2):start[sourceId:${source.data.id}]`),\n\t\tonDrag: ({ source }) => ordered.push(`draggable(2):drag[sourceId:${source.data.id}]`),\n\t\tonDrop: ({ source }) => ordered.push(`draggable(2):drop[sourceId:${source.data.id}]`),\n\t});\n\n\tfireEvent.dragOver(A);\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\t// continued using the original `getData()` object\n\texpect(ordered).toEqual(['draggable(2):drag[sourceId:1]', 'a:drag[sourceId:1]']);\n\tordered.length = 0;\n\n\tfireEvent.drop(A);\n\n\t// continued using the original `getData()` object\n\texpect(ordered).toEqual(['draggable(2):drop[sourceId:1]', 'a:drop[sourceId:1]']);\n\n\tcleanupDropTargets();\n\tcleanupDraggable2();\n});\n\ntest('adding a drop target during a drag', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst [Z] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst cleanupA = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDrop: () => ordered.push('a:drop'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\texpect(ordered).toEqual(['draggable:start', 'a:start']);\n\tordered.length = 0;\n\n\tconst cleanupZ = combine(\n\t\tappendToBody(Z),\n\t\tdropTargetForElements({\n\t\t\telement: Z,\n\t\t\tonDragStart: () => ordered.push('z:start'),\n\t\t\tonDropTargetChange: () => ordered.push('z:update'),\n\t\t\tonDragEnter: () => ordered.push('z:enter'),\n\t\t\tonDragLeave: () => ordered.push('z:leave'),\n\t\t\tonDrop: () => ordered.push('z:drop'),\n\t\t}),\n\t);\n\n\t// nothing changed!\n\texpect(ordered).toEqual([]);\n\n\t// [A] -> [Z]\n\tfireEvent.dragEnter(Z);\n\texpect(ordered).toEqual(['draggable:update', 'a:update', 'a:leave', 'z:update', 'z:enter']);\n\tordered.length = 0;\n\n\tuserEvent.drop(Z);\n\n\texpect(ordered).toEqual(['draggable:drop', 'z:drop']);\n\n\tcleanupA();\n\tcleanupZ();\n});\n\ntest('removing a drop target during a drag', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst [Z] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst cleanupA = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDrop: () => ordered.push('a:drop'),\n\t\t}),\n\t);\n\tconst cleanupZ = combine(\n\t\tappendToBody(Z),\n\t\tdropTargetForElements({\n\t\t\telement: Z,\n\t\t\tonDragStart: () => ordered.push('z:start'),\n\t\t\tonDropTargetChange: () => ordered.push('z:update'),\n\t\t\tonDragEnter: () => ordered.push('z:enter'),\n\t\t\tonDragLeave: () => ordered.push('z:leave'),\n\t\t\tonDrop: () => ordered.push('z:drop'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\texpect(ordered).toEqual(['draggable:start', 'a:start']);\n\tordered.length = 0;\n\n\t// [A] -> [Z]\n\tfireEvent.dragEnter(Z);\n\texpect(ordered).toEqual(['draggable:update', 'a:update', 'a:leave', 'z:update', 'z:enter']);\n\tordered.length = 0;\n\n\t// Remove Z\n\t// [Z] -> []\n\tcleanupZ();\n\n\tfireEvent.dragOver(document.body);\n\n\t// Z no longer communicated with\n\texpect(ordered).toEqual(['draggable:update']);\n\tordered.length = 0;\n\n\tuserEvent.cancel(draggableEl);\n\texpect(ordered).toEqual(['draggable:drop']);\n\n\tcleanupA();\n});\n\ntest('changing a drop target during a drag', () => {\n\tconst [draggableEl, A] = getElements('div');\n\tconst ordered: string[] = [];\n\n\tfunction getLabel({\n\t\tid,\n\t\teventName,\n\t\texpectedData,\n\t}: {\n\t\tid: string;\n\t\teventName: string;\n\t\texpectedData: Record<string, unknown>;\n\t}): string {\n\t\treturn `id:[${id}] event:[${eventName}] data:[${JSON.stringify(expectedData)}]`;\n\t}\n\n\tfunction add({ id, eventName }: { id: string; eventName: string }) {\n\t\treturn function onEvent({ location }: ElementEventPayloadMap[keyof ElementEventPayloadMap]) {\n\t\t\tconst targetId = location.current.dropTargets[0]?.data.id ?? 'NO-TARGET';\n\t\t\tordered.push(getLabel({ id, eventName, expectedData: { id: targetId } }));\n\t\t};\n\t}\n\tconst cleanupDraggable = combine(\n\t\tappendToBody(draggableEl),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrag: () => ordered.push('draggable:drag'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\tconst cleanupAElement = appendToBody(A);\n\tconst cleanupA1 = dropTargetForElements({\n\t\telement: A,\n\t\tgetData: () => ({ id: 'A1' }),\n\t\tonDragStart: add({ id: 'A1', eventName: 'start' }),\n\t\tonDropTargetChange: add({ id: 'A1', eventName: 'change' }),\n\t\tonDragEnter: add({ id: 'A1', eventName: 'enter' }),\n\t\tonDragLeave: add({ id: 'A1', eventName: 'leave' }),\n\t\tonDrop: add({ id: 'A1', eventName: 'drop' }),\n\t});\n\n\tuserEvent.lift(draggableEl);\n\texpect(ordered).toEqual(['draggable:start']);\n\tordered.length = 0;\n\n\t// [] -> [A]\n\tfireEvent.dragEnter(A);\n\texpect(ordered).toEqual([\n\t\t'draggable:change',\n\t\tgetLabel({ id: 'A1', eventName: 'change', expectedData: { id: 'A1' } }),\n\t\tgetLabel({ id: 'A1', eventName: 'enter', expectedData: { id: 'A1' } }),\n\t]);\n\tordered.length = 0;\n\n\t// Remounting A1\n\tcleanupA1();\n\tconst cleanupA2 = dropTargetForElements({\n\t\telement: A,\n\t\tgetData: () => ({ id: 'A2' }),\n\t\tonDragStart: add({ id: 'A2', eventName: 'start' }),\n\t\tonDropTargetChange: add({ id: 'A2', eventName: 'change' }),\n\t\tonDrag: add({ id: 'A2', eventName: 'drag' }),\n\t\tonDragEnter: add({ id: 'A2', eventName: 'enter' }),\n\t\tonDragLeave: add({ id: 'A2', eventName: 'leave' }),\n\t\tonDrop: add({ id: 'A2', eventName: 'drop' }),\n\t});\n\n\t// no change events\n\texpect(ordered).toEqual([]);\n\n\tfireEvent.dragOver(A);\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\t// now it is the remounted drop target that is having their data collected\n\texpect(ordered).toEqual([\n\t\t'draggable:drag',\n\t\tgetLabel({ id: 'A2', eventName: 'drag', expectedData: { id: 'A2' } }),\n\t]);\n\tordered.length = 0;\n\n\tfireEvent.drop(A);\n\texpect(ordered).toEqual([\n\t\t'draggable:drop',\n\t\tgetLabel({ id: 'A2', eventName: 'drop', expectedData: { id: 'A2' } }),\n\t]);\n\n\tcleanupA2();\n\tcleanupAElement();\n\tcleanupDraggable();\n});\n\ntest('removing home drop target during a drag', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tappendToBody(A);\n\tconst cleanupA = dropTargetForElements({\n\t\telement: A,\n\t\tonDragStart: () => ordered.push('a:start'),\n\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\tonDrop: () => ordered.push('a:drop'),\n\t});\n\tconst cleanupDraggable = combine(\n\t\t() => draggableEl.parentElement?.removeChild(draggableEl),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\n\t// initial lift\n\tuserEvent.lift(draggableEl);\n\texpect(ordered).toEqual(['draggable:start', 'a:start']);\n\tordered.length = 0;\n\n\t// Removing parent `A` while keeping `draggableEl`\n\n\tconst parent = A.parentElement;\n\tparent?.removeChild(A);\n\tparent?.appendChild(draggableEl);\n\tcleanupA();\n\n\t// now we are going to drag over draggableEl\n\tfireEvent.dragOver(draggableEl);\n\n\texpect(ordered).toEqual(['draggable:update']);\n\tordered.length = 0;\n\n\tuserEvent.cancel(draggableEl);\n\texpect(ordered).toEqual(['draggable:drop']);\n\n\tcleanupA();\n\tcleanupDraggable();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/changes-during-a-drop.spec.ts",
    "content": "import { combine } from '../../../src/entry-point/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\tmonitorForElements,\n} from '../../../src/entry-point/element/adapter';\nimport { appendToBody, getBubbleOrderedTree, getElements, reset, userEvent } from '../_util';\n\nafterEach(reset);\n\ntest('changing a drop target during a drop', () => {\n\tconst [A] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst removeFromBody = appendToBody(A);\n\tconst cleanupDropTarget1 = dropTargetForElements({\n\t\telement: A,\n\t\tonDragStart: () => ordered.push('dropTarget1:start'),\n\t\tonDrop: () => ordered.push('dropTarget1:drop'),\n\t});\n\tconst cleanupMonitor = monitorForElements({\n\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\tonDrop: () => ordered.push('monitor:drop'),\n\t});\n\tlet cleanupDropTarget2: () => void = () => {};\n\tconst cleanupDraggable = draggable({\n\t\telement: A,\n\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\tonDrop: () => {\n\t\t\tordered.push('draggable:drop');\n\t\t\tordered.push('changing drop target');\n\t\t\tcleanupDropTarget1();\n\t\t\t// This new drop target will be treated as the original drop target\n\t\t\t// as they are both created on the same element (the unique key)\n\t\t\tcleanupDropTarget2 = dropTargetForElements({\n\t\t\t\telement: A,\n\t\t\t\tonDragStart: () => ordered.push('dropTarget2:start'),\n\t\t\t\tonDrop: () => ordered.push('dropTarget2:drop'),\n\t\t\t});\n\t\t},\n\t});\n\n\t// start drag [A]\n\tuserEvent.lift(A);\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget1:start', 'monitor:start']);\n\tordered.length = 0;\n\n\tuserEvent.drop(A);\n\n\texpect(ordered).toEqual([\n\t\t'draggable:drop',\n\t\t'changing drop target',\n\t\t'dropTarget2:drop',\n\t\t'monitor:drop',\n\t]);\n\n\tcleanupDraggable();\n\tcleanupDropTarget1();\n\tcleanupDropTarget2();\n\tcleanupMonitor();\n\tremoveFromBody();\n});\n\ntest('removing a drop target during a drop', () => {\n\tconst [A] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst removeFromBody = appendToBody(A);\n\tconst cleanupMonitor = monitorForElements({\n\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\tonDrop: () => ordered.push('monitor:drop'),\n\t});\n\tconst cleanupDraggable = draggable({\n\t\telement: A,\n\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\tonDrop: () => {\n\t\t\tordered.push('draggable:drop');\n\t\t\tcleanupDropTarget();\n\t\t},\n\t});\n\tconst cleanupDropTarget = combine(\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\t() => ordered.push('cleanup drop target'),\n\t);\n\n\t// start drag [A]\n\tuserEvent.lift(A);\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start', 'monitor:start']);\n\tordered.length = 0;\n\n\tuserEvent.drop(A);\n\n\texpect(ordered).toEqual(['draggable:drop', 'cleanup drop target', 'monitor:drop']);\n\n\tcleanupDraggable();\n\tcleanupDropTarget();\n\tcleanupMonitor();\n\tremoveFromBody();\n});\n\ntest('changing a parent drop target during a drop', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst removeFromBody = appendToBody(A);\n\tconst cleanupMonitor = monitorForElements({\n\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\tonDrop: () => ordered.push('monitor:drop'),\n\t});\n\tconst cleanupDropTarget1 = dropTargetForElements({\n\t\telement: A,\n\t\tonDragStart: () => ordered.push('dropTarget1:start'),\n\t\tonDrop: () => ordered.push('dropTarget1:drop'),\n\t});\n\tlet cleanupDropTarget2: () => void = () => {};\n\tconst cleanupDraggable = draggable({\n\t\telement: draggableEl,\n\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\tonDrop: () => {\n\t\t\tordered.push('draggable:drop');\n\t\t\tordered.push('changing drop target');\n\t\t\tcleanupDropTarget1();\n\t\t\t// This new drop target will be treated as the original drop target\n\t\t\t// as they are both created on the same element (the unique key)\n\t\t\tcleanupDropTarget2 = dropTargetForElements({\n\t\t\t\telement: A,\n\t\t\t\tonDragStart: () => ordered.push('dropTarget2:start'),\n\t\t\t\tonDrop: () => ordered.push('dropTarget2:drop'),\n\t\t\t});\n\t\t},\n\t});\n\n\t// start drag in [A]\n\tuserEvent.lift(draggableEl);\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget1:start', 'monitor:start']);\n\tordered.length = 0;\n\n\tuserEvent.drop(A);\n\n\texpect(ordered).toEqual([\n\t\t'draggable:drop',\n\t\t'changing drop target',\n\t\t'dropTarget2:drop',\n\t\t'monitor:drop',\n\t]);\n\n\tcleanupDraggable();\n\tcleanupDropTarget1();\n\tcleanupDropTarget2();\n\tcleanupMonitor();\n\tremoveFromBody();\n});\n\ntest('removing a parent drop target during a drop', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst removeFromBody = appendToBody(A);\n\tconst cleanupMonitor = monitorForElements({\n\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\tonDrop: () => ordered.push('monitor:drop'),\n\t});\n\tconst cleanupDraggable = draggable({\n\t\telement: draggableEl,\n\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\tonDrop: () => {\n\t\t\tordered.push('draggable:drop');\n\t\t\tcleanupDropTarget();\n\t\t},\n\t});\n\tconst cleanupDropTarget = combine(\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\t() => ordered.push('cleanup drop target'),\n\t);\n\n\t// start drag in [A]\n\tuserEvent.lift(draggableEl);\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start', 'monitor:start']);\n\tordered.length = 0;\n\n\tuserEvent.drop(A);\n\n\texpect(ordered).toEqual(['draggable:drop', 'cleanup drop target', 'monitor:drop']);\n\n\tcleanupDraggable();\n\tcleanupDropTarget();\n\tcleanupMonitor();\n\tremoveFromBody();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/draggable/conditional-dragging.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport { draggable, dropTargetForElements } from '../../../../src/entry-point/element/adapter';\nimport { appendToBody, getBubbleOrderedTree, getElements, reset } from '../../_util';\n\nafterEach(reset);\n\nit('should be possible to opt out of a drag', () => {\n\tconst [target] = getElements('div');\n\tconst onGenerateDragPreview = jest.fn();\n\tconst cleanup = combine(\n\t\tappendToBody(target),\n\t\tdraggable({\n\t\t\telement: target,\n\t\t\tonGenerateDragPreview,\n\t\t\tcanDrag: () => false,\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(target);\n\n\texpect(onGenerateDragPreview).not.toHaveBeenCalled();\n\n\tcleanup();\n});\n\nit('should not drag a parent when child is opting out of a drag', () => {\n\tconst [child, parent] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(parent),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonGenerateDragPreview: () => ordered.push('child:preview'),\n\t\t\tcanDrag: () => false,\n\t\t}),\n\t\tdraggable({\n\t\t\telement: parent,\n\t\t\tonGenerateDragPreview: () => ordered.push('parent:preview'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(child);\n\n\texpect(ordered).toEqual([]);\n\n\tcleanup();\n});\n\nit('should allow a parent to drag when a child opts out of dragging altogether!', () => {\n\t// This test doesn't really exercise much, but it does validate this:\n\t// https://twitter.com/alexandereardon/status/1531058393837752321\n\tconst [parent] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(parent),\n\t\tdraggable({\n\t\t\telement: parent,\n\t\t\tonGenerateDragPreview: () => ordered.push('parent:preview'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(parent);\n\n\texpect(ordered).toEqual(['parent:preview']);\n\n\tcleanup();\n});\n\nit('should not try to collect draggable data when opting out of a drag', () => {\n\tconst [target] = getElements('div');\n\tconst onGenerateDragPreview = jest.fn();\n\tconst getData = jest.fn();\n\tconst cleanup = combine(\n\t\tappendToBody(target),\n\t\tdraggable({\n\t\t\telement: target,\n\t\t\tonGenerateDragPreview,\n\t\t\tgetInitialData: getData,\n\t\t\tcanDrag: () => false,\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(target);\n\n\texpect(getData).not.toHaveBeenCalled();\n\texpect(onGenerateDragPreview).not.toHaveBeenCalled();\n\n\tcleanup();\n});\n\nit('should not try to collect drop target data when opting out of a drag', () => {\n\tconst [target] = getElements('div');\n\tconst onGenerateDragPreview = jest.fn();\n\tconst getDropTargetData = jest.fn();\n\tconst cleanup = combine(\n\t\tappendToBody(target),\n\t\tdraggable({\n\t\t\telement: target,\n\t\t\tonGenerateDragPreview,\n\t\t\tcanDrag: () => false,\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: target,\n\t\t\tgetData: getDropTargetData,\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(target);\n\n\texpect(getDropTargetData).not.toHaveBeenCalled();\n\texpect(onGenerateDragPreview).not.toHaveBeenCalled();\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/draggable/custom-drag-preview.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdraggable,\n\ttype ElementEventPayloadMap,\n} from '../../../../src/entry-point/element/adapter';\nimport { appendToBody, getEmptyHistory, reset } from '../../_util';\n\nafterEach(reset);\n\nit('should be possible to modify the element during the \"dragstart\" event in order to customise the drag preview', () => {\n\tconst element = document.createElement('div');\n\tconst onGenerateDragPreview = jest.fn();\n\tconst onDragStart = jest.fn();\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdraggable({\n\t\t\telement: element,\n\t\t\tonGenerateDragPreview,\n\t\t\tonDragStart,\n\t\t}),\n\t);\n\n\t// let's start this drag!\n\tfireEvent.dragStart(element);\n\t// onGenerateDragPreview called synchronously so we can impact the drag preview\n\t// https://twitter.com/alexandereardon/status/1510826920023248900\n\t{\n\t\tconst expected: ElementEventPayloadMap['onGenerateDragPreview'] = {\n\t\t\tlocation: getEmptyHistory(),\n\t\t\tsource: {\n\t\t\t\tdata: {},\n\t\t\t\tdragHandle: null,\n\t\t\t\t// dragging element provided so that user can modify\n\t\t\t\telement: element,\n\t\t\t},\n\t\t\tnativeSetDragImage: expect.any(Function),\n\t\t};\n\t\texpect(onGenerateDragPreview).toHaveBeenCalledWith(expected);\n\t\texpect(onDragStart).not.toHaveBeenCalled();\n\t}\n\n\t// After a frame the `onDragStart` event will occur where consumers can cleanup their changes\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\t{\n\t\tconst expected: ElementEventPayloadMap['onDragStart'] = {\n\t\t\tlocation: getEmptyHistory(),\n\t\t\tsource: {\n\t\t\t\tdata: {},\n\t\t\t\tdragHandle: null,\n\t\t\t\t// dragging element provided so that user can modify\n\t\t\t\telement: element,\n\t\t\t},\n\t\t};\n\t\texpect(onDragStart).toHaveBeenCalledWith(expected);\n\t}\n\n\tcleanup();\n});\n\nit('should be possible to use the native \"setDragImage\" function', () => {\n\tconst element = document.createElement('div');\n\tconst onGenerateDragPreview = jest.fn();\n\tconst onDragStart = jest.fn();\n\tconst nativeSetDragImageSpy = jest.spyOn(DataTransfer.prototype, 'setDragImage');\n\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdraggable({\n\t\t\telement: element,\n\t\t\tonGenerateDragPreview,\n\t\t\tonDragStart,\n\t\t}),\n\t\t() => nativeSetDragImageSpy.mockReset(),\n\t);\n\n\t// let's start this drag!\n\tfireEvent.dragStart(element);\n\n\t// onGenerateDragPreview called synchronously so we can impact the drag preview\n\t// https://twitter.com/alexandereardon/status/1510826920023248900\n\tconst expected: ElementEventPayloadMap['onGenerateDragPreview'] = {\n\t\tlocation: getEmptyHistory(),\n\t\tsource: {\n\t\t\tdata: {},\n\t\t\tdragHandle: null,\n\t\t\t// dragging element provided so that user can modify\n\t\t\telement: element,\n\t\t},\n\t\tnativeSetDragImage: expect.any(Function),\n\t};\n\texpect(onGenerateDragPreview).toHaveBeenCalledWith(expected);\n\n\t// should be provided with the native set drag image\n\texpect(nativeSetDragImageSpy).not.toHaveBeenCalled();\n\n\tconst args = [new Image(), 10, 15];\n\tonGenerateDragPreview.mock.calls[0][0].nativeSetDragImage(...args);\n\texpect(nativeSetDragImageSpy).toHaveBeenCalledWith(...args);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/draggable/drag-handle-guardrails.spec.ts",
    "content": "import { combine } from '../../../../src/entry-point/combine';\nimport { draggable } from '../../../../src/entry-point/element/adapter';\nimport { appendToBody, reset, setElementFromPoint } from '../../_util';\n\nafterEach(reset);\n\nit('should warn if a drag handle is parent of the draggable', () => {\n\tconst warn = jest.spyOn(console, 'warn').mockImplementation(() => {});\n\tconst dragHandleThatIsTheParent = document.createElement('div');\n\tconst draggableEl = document.createElement('div');\n\tdragHandleThatIsTheParent.appendChild(draggableEl);\n\tconst onGenerateDragPreview = jest.fn();\n\tconst cleanup = combine(\n\t\tappendToBody(dragHandleThatIsTheParent),\n\t\tsetElementFromPoint(dragHandleThatIsTheParent),\n\t\t// ❌ this is bad, the drag handle cannot be a parent of the draggable\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tdragHandle: dragHandleThatIsTheParent,\n\t\t\tonGenerateDragPreview,\n\t\t}),\n\t\t() => warn.mockReset(),\n\t);\n\n\texpect(warn).toHaveBeenCalled();\n\n\tcleanup();\n});\n\nit('should warn if a drag handle is disconnected from the draggable', () => {\n\tconst warn = jest.spyOn(console, 'warn').mockImplementation(() => {});\n\t// No parent/child relationship between dragHandle and element\n\tconst dragHandle = document.createElement('div');\n\tconst element = document.createElement('div');\n\tconst onGenerateDragPreview = jest.fn();\n\tconst cleanup = combine(\n\t\tappendToBody(dragHandle, element),\n\t\tsetElementFromPoint(dragHandle),\n\t\tdraggable({\n\t\t\telement: element,\n\t\t\tdragHandle: dragHandle,\n\t\t\tonGenerateDragPreview,\n\t\t}),\n\t\t() => warn.mockReset(),\n\t);\n\n\texpect(warn).toHaveBeenCalled();\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/draggable/drag-handle.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdraggable,\n\ttype ElementEventPayloadMap,\n} from '../../../../src/entry-point/element/adapter';\nimport { appendToBody, getEmptyHistory, reset, setElementFromPoint } from '../../_util';\n\nafterEach(reset);\n\nit('should allow dragging from the drag handle when the drag handle is the same element as the draggable', () => {\n\tconst parent = document.createElement('div');\n\tconst onGenerateDragPreview = jest.fn();\n\tconst cleanup = combine(\n\t\tappendToBody(parent),\n\t\tsetElementFromPoint(parent),\n\t\tdraggable({\n\t\t\telement: parent,\n\t\t\tdragHandle: parent,\n\t\t\tonGenerateDragPreview,\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(parent);\n\n\tconst expected: ElementEventPayloadMap['onGenerateDragPreview'] = {\n\t\tlocation: getEmptyHistory(),\n\t\tsource: {\n\t\t\tdata: {},\n\t\t\tdragHandle: parent,\n\t\t\telement: parent,\n\t\t},\n\t\tnativeSetDragImage: expect.any(Function),\n\t};\n\texpect(onGenerateDragPreview).toHaveBeenCalledWith(expected);\n\n\tcleanup();\n});\n\nit('should allow dragging if dragging from a child drag handle element', () => {\n\tconst parent = document.createElement('div');\n\tconst dragHandle = document.createElement('div');\n\tparent.appendChild(dragHandle);\n\tconst onGenerateDragPreview = jest.fn();\n\tconst cleanup = combine(\n\t\tappendToBody(parent),\n\t\tsetElementFromPoint(dragHandle),\n\t\tdraggable({\n\t\t\telement: parent,\n\t\t\tdragHandle: dragHandle,\n\t\t\tonGenerateDragPreview,\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(parent);\n\n\tconst expected: ElementEventPayloadMap['onGenerateDragPreview'] = {\n\t\tlocation: getEmptyHistory(),\n\t\tsource: {\n\t\t\tdata: {},\n\t\t\tdragHandle: dragHandle,\n\t\t\telement: parent,\n\t\t},\n\t\tnativeSetDragImage: expect.any(Function),\n\t};\n\texpect(onGenerateDragPreview).toHaveBeenCalledWith(expected);\n\n\tcleanup();\n});\n\nit('should allow dragging from the child of a drag handle', () => {\n\tconst draggableEl = document.createElement('div');\n\tconst dragHandle = document.createElement('div');\n\tconst dragHandleChild = document.createElement('div');\n\tdragHandle.appendChild(dragHandleChild);\n\tdraggableEl.appendChild(dragHandle);\n\tconst onGenerateDragPreview = jest.fn();\n\tconst cleanup = combine(\n\t\tappendToBody(draggableEl),\n\t\tsetElementFromPoint(dragHandleChild),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tdragHandle: dragHandle,\n\t\t\tonGenerateDragPreview,\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(draggableEl);\n\n\tconst expected: ElementEventPayloadMap['onGenerateDragPreview'] = {\n\t\tlocation: getEmptyHistory(),\n\t\tsource: {\n\t\t\tdata: {},\n\t\t\tdragHandle: dragHandle,\n\t\t\telement: draggableEl,\n\t\t},\n\t\tnativeSetDragImage: expect.any(Function),\n\t};\n\texpect(onGenerateDragPreview).toHaveBeenCalledWith(expected);\n\n\tcleanup();\n});\n\nit('should not allow dragging if not dragging from the drag handle', () => {\n\tconst parent = document.createElement('div');\n\tconst dragHandle = document.createElement('div');\n\tconst dragHandleChild = document.createElement('div');\n\tdragHandle.appendChild(dragHandleChild);\n\tparent.appendChild(dragHandle);\n\tconst onGenerateDragPreview = jest.fn();\n\tconst cleanup = combine(\n\t\tappendToBody(parent),\n\t\t// not using the drag handle\n\t\tsetElementFromPoint(parent),\n\t\tdraggable({\n\t\t\telement: parent,\n\t\t\tdragHandle: dragHandle,\n\t\t\tonGenerateDragPreview,\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(parent);\n\n\texpect(onGenerateDragPreview).not.toHaveBeenCalled();\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/draggable/get-initial-data-for-external.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { elementAdapterNativeDataKey } from '../../../../src/adapter/element-adapter-native-data-key';\nimport { combine } from '../../../../src/entry-point/combine';\nimport { draggable, dropTargetForElements } from '../../../../src/entry-point/element/adapter';\nimport { type Input } from '../../../../src/entry-point/types';\nimport {\n\tappendToBody,\n\tgetBubbleOrderedTree,\n\tgetDefaultInput,\n\tgetElements,\n\tuserEvent,\n} from '../../_util';\n\nafterEach(() => {\n\t// cleanup any pending drags\n\tfireEvent.dragEnd(window);\n});\n\nit('should be able to add data to the native store', () => {\n\tconst [A] = getElements('div');\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tgetInitialData: () => ({ message: 'Own data' }),\n\t\t\tgetInitialDataForExternal: () => ({\n\t\t\t\t'text/plain': 'External data',\n\t\t\t}),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonDragStart: () => ordered.push('target(element):start'),\n\t\t}),\n\t);\n\n\tconst start = new DragEvent('dragstart', {\n\t\tbubbles: true,\n\t\tcancelable: true,\n\t});\n\tA.dispatchEvent(start);\n\n\t// native data attached to event\n\texpect(start.dataTransfer?.types).toEqual([\n\t\t// our default type\n\t\telementAdapterNativeDataKey,\n\t\t// the newly added type\n\t\t'text/plain',\n\t]);\n\texpect(ordered).toEqual(['draggable:preview']);\n\tordered.length = 0;\n\n\t// finish the lift\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['draggable:start', 'target(element):start']);\n\n\t// checking we can get the external data when a drop occurs\n\tconst drop = new DragEvent('drop', {\n\t\tbubbles: true,\n\t\tcancelable: true,\n\t});\n\tA.dispatchEvent(drop);\n\n\texpect(start.dataTransfer?.getData('text/plain')).toBe('External data');\n\n\tcleanup();\n});\n\nit('should only collect native data once during a drag', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst getInitialDataForExternal = jest.fn().mockImplementation(() => ({ 'text/plain': 'Alex' }));\n\tconst firstInput: Input = {\n\t\t...getDefaultInput(),\n\t\tpageX: 5,\n\t};\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t}),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tgetInitialDataForExternal: getInitialDataForExternal,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrag: () => ordered.push('draggable:drag'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(draggableEl, firstInput);\n\n\texpect(ordered).toEqual(['draggable:preview']);\n\tordered.length = 0;\n\texpect(getInitialDataForExternal).toHaveBeenCalled();\n\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['draggable:start']);\n\tordered.length = 0;\n\n\t// Dragging over A\n\tfireEvent.dragOver(A);\n\t// not called until the next frame\n\texpect(ordered).toEqual([]);\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['draggable:drag']);\n\tordered.length = 0;\n\n\t// Leaving A\n\tfireEvent.dragEnter(document.body);\n\texpect(ordered).toEqual(['draggable:change']);\n\tordered.length = 0;\n\n\t// cancelling drag\n\tuserEvent.cancel();\n\texpect(ordered).toEqual(['draggable:drop']);\n\n\t// getData only ever called once\n\texpect(getInitialDataForExternal).toHaveBeenCalledTimes(1);\n\n\tcleanup();\n});\n\nit('should not request native data from non-dragging draggables', () => {\n\tconst [A, B] = getElements('div');\n\tconst getDataA = jest.fn().mockImplementation(() => ({ name: 'A' }));\n\tconst getDataB = jest.fn().mockImplementation(() => ({ name: 'B' }));\n\n\tconst cleanup = combine(\n\t\tappendToBody(A, B),\n\t\tdraggable({ element: A, getInitialDataForExternal: getDataA }),\n\t\tdraggable({ element: B, getInitialDataForExternal: getDataB }),\n\t);\n\n\tuserEvent.lift(A);\n\n\texpect(getDataA).toHaveBeenCalledTimes(1);\n\texpect(getDataB).not.toHaveBeenCalled();\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/draggable/get-initial-data.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport { draggable, dropTargetForElements } from '../../../../src/entry-point/element/adapter';\nimport { type Input } from '../../../../src/entry-point/types';\nimport {\n\tappendToBody,\n\tgetBubbleOrderedTree,\n\tgetDefaultInput,\n\tgetElements,\n\treset,\n\tuserEvent,\n} from '../../_util';\n\nafterEach(reset);\n\nit('should only collect data once during a drag', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst getInitialData = jest.fn().mockImplementation(() => ({ name: 'Alex' }));\n\tconst firstInput: Input = {\n\t\t...getDefaultInput(),\n\t\tpageX: 5,\n\t};\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t}),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tgetInitialData,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrag: () => ordered.push('draggable:drag'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(draggableEl, firstInput);\n\n\texpect(ordered).toEqual(['draggable:preview']);\n\tordered.length = 0;\n\texpect(getInitialData).toHaveBeenCalled();\n\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['draggable:start']);\n\tordered.length = 0;\n\n\t// Dragging over A\n\tfireEvent.dragOver(A);\n\t// not called until the next frame\n\texpect(ordered).toEqual([]);\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['draggable:drag']);\n\tordered.length = 0;\n\n\t// Leaving A\n\tfireEvent.dragEnter(document.body);\n\texpect(ordered).toEqual(['draggable:change']);\n\tordered.length = 0;\n\n\t// cancelling drag\n\tuserEvent.cancel();\n\texpect(ordered).toEqual(['draggable:drop']);\n\n\t// getData only ever called once\n\texpect(getInitialData).toHaveBeenCalledTimes(1);\n\n\tcleanup();\n});\n\nit('should not request data from non-dragging draggables', () => {\n\tconst [A, B] = getElements('div');\n\tconst getDataA = jest.fn().mockImplementation(() => ({ name: 'A' }));\n\tconst getDataB = jest.fn().mockImplementation(() => ({ name: 'B' }));\n\n\tconst cleanup = combine(\n\t\tappendToBody(A, B),\n\t\tdraggable({ element: A, getInitialData: getDataA }),\n\t\tdraggable({ element: B, getInitialData: getDataB }),\n\t);\n\n\tuserEvent.lift(A);\n\n\texpect(getDataA).toHaveBeenCalledTimes(1);\n\texpect(getDataB).not.toHaveBeenCalled();\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/draggable/nested-draggables.spec.ts",
    "content": "import { combine } from '../../../../src/entry-point/combine';\nimport { draggable } from '../../../../src/entry-point/element/adapter';\nimport { appendToBody, getBubbleOrderedTree, reset, userEvent } from '../../_util';\n\nafterEach(reset);\n\nit('should allow nested draggables', () => {\n\tconst [child, parent] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(parent),\n\t\tdraggable({\n\t\t\telement: parent,\n\t\t\tonDragStart: () => ordered.push('parent:start'),\n\t\t\tonDrop: () => ordered.push('parent:drop'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('child:start'),\n\t\t\tonDrop: () => ordered.push('child:drop'),\n\t\t}),\n\t);\n\n\t// lets drag the child\n\tuserEvent.lift(child);\n\tuserEvent.drop(document.body);\n\n\texpect(ordered).toEqual(['child:start', 'child:drop']);\n\tordered.length = 0;\n\n\t// now lets drag the parent\n\tuserEvent.lift(parent);\n\tuserEvent.drop(document.body);\n\texpect(ordered).toEqual(['parent:start', 'parent:drop']);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/draggable/start-location.spec.ts",
    "content": "import { combine } from '../../../../src/entry-point/combine';\nimport { draggable, dropTargetForElements } from '../../../../src/entry-point/element/adapter';\nimport { appendToBody, getBubbleOrderedTree, getElements, reset, userEvent } from '../../_util';\n\nafterEach(reset);\n\ntest('scenario: [] (lifting outside a drop target)', () => {\n\tconst [draggableEl] = getElements('div');\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(draggableEl),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\n\texpect(ordered).toEqual(['draggable:start']);\n\n\tcleanup();\n});\n\ntest('scenario: [B, A] (lifting inside drop targets)', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t\tonDragStart: () => ordered.push('b:start'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\n\texpect(ordered).toEqual(['draggable:start', 'b:start', 'a:start']);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/dragleave-should-not-update-input.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../src/entry-point/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\tmonitorForElements,\n} from '../../../src/entry-point/element/adapter';\nimport { appendToBody, getDefaultInput, getElements, reset } from '../_util';\n\nafterEach(reset);\n\n// 🐛 Bug workaround: intentionally not updating `input` in \"dragleave\"\n// In Chrome, this final \"dragleave\" has default input values (eg clientX == 0)\n// rather than the users current input values\n//\n// - [Conversation](https://twitter.com/alexandereardon/status/1642697633864241152)\n// - [Bug](https://bugs.chromium.org/p/chromium/issues/detail?id=1429937)\nit('should not update input published to users based on the \"dragleave\" event', () => {\n\tconst [A] = getElements('div');\n\tconst ordered: string[] = [];\n\n\tfunction getEntry(label: string, current: { clientX: number; clientY: number }): string {\n\t\treturn `${label} current:(${current.clientX}, ${current.clientY})`;\n\t}\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: ({ location }) =>\n\t\t\t\tordered.push(getEntry('draggable:preview', location.current.input)),\n\t\t\tonDragStart: ({ location }) =>\n\t\t\t\tordered.push(getEntry('draggable:start', location.current.input)),\n\t\t\tonDrag: ({ location }) => ordered.push(getEntry('draggable:drag', location.current.input)),\n\t\t\tonDrop: ({ location }) => ordered.push(getEntry('draggable:drop', location.current.input)),\n\t\t\tonDropTargetChange: ({ location }) =>\n\t\t\t\tordered.push(getEntry('draggable:change', location.current.input)),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: ({ location }) =>\n\t\t\t\tordered.push(getEntry('dropTarget:preview', location.current.input)),\n\t\t\tonDragStart: ({ location }) =>\n\t\t\t\tordered.push(getEntry('dropTarget:start', location.current.input)),\n\t\t\tonDrag: ({ location }) => ordered.push(getEntry('dropTarget:drag', location.current.input)),\n\t\t\tonDrop: ({ location }) => ordered.push(getEntry('dropTarget:drop', location.current.input)),\n\t\t\tonDropTargetChange: ({ location }) =>\n\t\t\t\tordered.push(getEntry('dropTarget:change', location.current.input)),\n\t\t\tonDragEnter: ({ location }) =>\n\t\t\t\tordered.push(getEntry('dropTarget:enter', location.current.input)),\n\t\t\tonDragLeave: ({ location }) =>\n\t\t\t\tordered.push(getEntry('dropTarget:leave', location.current.input)),\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonGenerateDragPreview: ({ location }) =>\n\t\t\t\tordered.push(getEntry('monitor:preview', location.current.input)),\n\t\t\tonDragStart: ({ location }) =>\n\t\t\t\tordered.push(getEntry('monitor:start', location.current.input)),\n\t\t\tonDrag: ({ location }) => ordered.push(getEntry('monitor:drag', location.current.input)),\n\t\t\tonDrop: ({ location }) => ordered.push(getEntry('monitor:drop', location.current.input)),\n\t\t\tonDropTargetChange: ({ location }) =>\n\t\t\t\tordered.push(getEntry('monitor:change', location.current.input)),\n\t\t}),\n\t);\n\n\texpect(ordered).toEqual([]);\n\n\t// starting a lift, this will trigger the previews to be generated\n\tfireEvent.dragStart(A, getDefaultInput({ clientX: 1, clientY: 2 }));\n\n\texpect(ordered).toEqual([\n\t\tgetEntry('draggable:preview', { clientX: 1, clientY: 2 }),\n\t\tgetEntry('dropTarget:preview', { clientX: 1, clientY: 2 }),\n\t\tgetEntry('monitor:preview', { clientX: 1, clientY: 2 }),\n\t]);\n\tordered.length = 0;\n\n\t// ticking forward an animation frame will complete the lift\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual([\n\t\tgetEntry('draggable:start', { clientX: 1, clientY: 2 }),\n\t\tgetEntry('dropTarget:start', { clientX: 1, clientY: 2 }),\n\t\tgetEntry('monitor:start', { clientX: 1, clientY: 2 }),\n\t]);\n\tordered.length = 0;\n\n\t// [A] -> []\n\tfireEvent.dragEnter(document.body, getDefaultInput({ clientX: 3, clientY: 4 }));\n\texpect(ordered).toEqual([\n\t\tgetEntry('draggable:change', { clientX: 3, clientY: 4 }),\n\t\tgetEntry('dropTarget:change', { clientX: 3, clientY: 4 }),\n\t\tgetEntry('dropTarget:leave', { clientX: 3, clientY: 4 }),\n\t\tgetEntry('monitor:change', { clientX: 3, clientY: 4 }),\n\t]);\n\tordered.length = 0;\n\n\t// [] -> [A]\n\tfireEvent.dragEnter(A, getDefaultInput({ clientX: 5, clientY: 6 }));\n\texpect(ordered).toEqual([\n\t\tgetEntry('draggable:change', { clientX: 5, clientY: 6 }),\n\t\tgetEntry('dropTarget:change', { clientX: 5, clientY: 6 }),\n\t\tgetEntry('dropTarget:enter', { clientX: 5, clientY: 6 }),\n\t\tgetEntry('monitor:change', { clientX: 5, clientY: 6 }),\n\t]);\n\tordered.length = 0;\n\n\t// [A] -> [A]\n\tfireEvent.dragOver(A, getDefaultInput({ clientX: 7, clientY: 8 }));\n\t// no updates yet (need to wait for the next animation frame)\n\texpect(ordered).toEqual([]);\n\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual([\n\t\tgetEntry('draggable:drag', { clientX: 7, clientY: 8 }),\n\t\tgetEntry('dropTarget:drag', { clientX: 7, clientY: 8 }),\n\t\tgetEntry('monitor:drag', { clientX: 7, clientY: 8 }),\n\t]);\n\tordered.length = 0;\n\n\t// [A] -> cancel. Part 1: dragleave\n\tfireEvent.dragLeave(A, getDefaultInput({ clientX: 9, clientY: 10 }));\n\n\t// using input from last `dragOver`\n\texpect(ordered).toEqual([\n\t\tgetEntry('draggable:change', { clientX: 7, clientY: 8 }),\n\t\tgetEntry('dropTarget:change', { clientX: 7, clientY: 8 }),\n\t\tgetEntry('dropTarget:leave', { clientX: 7, clientY: 8 }),\n\t\tgetEntry('monitor:change', { clientX: 7, clientY: 8 }),\n\t]);\n\tordered.length = 0;\n\n\t// [A] -> cancel. Part 2: dragend\n\tfireEvent.dragEnd(A, { clientX: 6, clientY: 7 });\n\n\t// using input from \"dragend\"\n\texpect(ordered).toEqual([\n\t\tgetEntry('draggable:drop', { clientX: 6, clientY: 7 }),\n\t\tgetEntry('monitor:drop', { clientX: 6, clientY: 7 }),\n\t]);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/drop-target/conditional-dropping.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\tmonitorForElements,\n} from '../../../../src/entry-point/element/adapter';\nimport { appendToBody, getBubbleOrderedTree, getElements, reset, userEvent } from '../../_util';\n\nafterEach(reset);\n\ntest('scenario: [A(blocked)] = [] (blocked drop targets are ignored when lifting)', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tmonitorForElements({\n\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tcanDrop: () => false,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\n\texpect(ordered).toEqual(['draggable:start', 'monitor:start']);\n\n\tcleanup();\n});\n\nconst triggers = [\n\t{\n\t\tname: 'dragenter',\n\t\tfire: (element: Element) => fireEvent.dragEnter(element),\n\t},\n\t{\n\t\tname: 'dragover',\n\t\tfire: (element: Element) => fireEvent.dragOver(element),\n\t},\n];\n\ntriggers.forEach((trigger) => {\n\tdescribe(`update trigger: ${trigger.name}`, () => {\n\t\ttest('scenario: [] -> [A(blocked)] = [] (blocked drop targets are ignored when entering)', () => {\n\t\t\tconst [draggableEl, A] = getElements('div');\n\n\t\t\tconst ordered: string[] = [];\n\n\t\t\tconst cleanup = combine(\n\t\t\t\tappendToBody(A, draggableEl),\n\t\t\t\tmonitorForElements({\n\t\t\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('monitor:update'),\n\t\t\t\t}),\n\t\t\t\tdropTargetForElements({\n\t\t\t\t\telement: A,\n\t\t\t\t\tcanDrop: () => false,\n\t\t\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\t\t}),\n\t\t\t\tdraggable({\n\t\t\t\t\telement: draggableEl,\n\t\t\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t\t\t}),\n\t\t\t);\n\n\t\t\tuserEvent.lift(draggableEl);\n\n\t\t\texpect(ordered).toEqual(['draggable:start', 'monitor:start']);\n\t\t\tordered.length = 0;\n\n\t\t\ttrigger.fire(draggableEl);\n\n\t\t\texpect(ordered).toEqual([]);\n\n\t\t\tcleanup();\n\t\t});\n\n\t\ttest('scenario: [A] -> [A(blocked)] = [] (drop targets can change their mind about being blocked)', () => {\n\t\t\tconst [draggableEl, A] = getBubbleOrderedTree();\n\n\t\t\tconst ordered: string[] = [];\n\n\t\t\tlet allowDropInA: boolean = true;\n\n\t\t\tconst cleanup = combine(\n\t\t\t\tappendToBody(A),\n\t\t\t\tmonitorForElements({\n\t\t\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('monitor:update'),\n\t\t\t\t}),\n\t\t\t\tdropTargetForElements({\n\t\t\t\t\telement: A,\n\t\t\t\t\tcanDrop: () => allowDropInA,\n\t\t\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\t\t}),\n\t\t\t\tdraggable({\n\t\t\t\t\telement: draggableEl,\n\t\t\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t\t\t}),\n\t\t\t);\n\n\t\t\tuserEvent.lift(draggableEl);\n\n\t\t\texpect(ordered).toEqual(['draggable:start', 'a:start', 'monitor:start']);\n\t\t\tordered.length = 0;\n\n\t\t\t// now disabling A\n\t\t\tallowDropInA = false;\n\n\t\t\ttrigger.fire(draggableEl);\n\n\t\t\texpect(ordered).toEqual([\n\t\t\t\t'draggable:update',\n\t\t\t\t'a:update',\n\t\t\t\t// leaving A\n\t\t\t\t'a:leave',\n\t\t\t\t'monitor:update',\n\t\t\t]);\n\n\t\t\tcleanup();\n\t\t});\n\n\t\ttest('scenario: [] -> [C, B(blocked), A] = [C, A] (blocking continues upward search)', () => {\n\t\t\tconst [draggableEl, A, B, C] = getElements('div');\n\t\t\tA.appendChild(B);\n\t\t\tB.appendChild(C);\n\n\t\t\tconst ordered: string[] = [];\n\n\t\t\tconst cleanup = combine(\n\t\t\t\tappendToBody(draggableEl, A),\n\t\t\t\tdropTargetForElements({\n\t\t\t\t\telement: A,\n\t\t\t\t\t// I will allow a drop (but it won't matter because B will block it)\n\t\t\t\t\tcanDrop: () => true,\n\t\t\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\t\t}),\n\t\t\t\tdropTargetForElements({\n\t\t\t\t\telement: B,\n\t\t\t\t\t// I am not going to allow a drop\n\t\t\t\t\tcanDrop: () => false,\n\t\t\t\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\t\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t\t\t}),\n\t\t\t\tdropTargetForElements({\n\t\t\t\t\telement: C,\n\t\t\t\t\tcanDrop: () => true,\n\t\t\t\t\tonDropTargetChange: () => ordered.push('c:update'),\n\t\t\t\t\tonDragEnter: () => ordered.push('c:enter'),\n\t\t\t\t\tonDragLeave: () => ordered.push('c:leave'),\n\t\t\t\t}),\n\t\t\t\tdraggable({\n\t\t\t\t\telement: draggableEl,\n\t\t\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t\t\t}),\n\t\t\t);\n\n\t\t\tfireEvent.dragStart(draggableEl);\n\n\t\t\t// @ts-ignore\n\t\t\trequestAnimationFrame.step();\n\n\t\t\tfireEvent.dragEnter(C);\n\n\t\t\texpect(ordered).toEqual(['draggable:update', 'c:update', 'c:enter', 'a:update', 'a:enter']);\n\n\t\t\tcleanup();\n\t\t});\n\n\t\ttest('scenario: [] -> [C, B(blocked), A] = [C, A] (blocked drop targets should not have data/dropEffect requested)', () => {\n\t\t\tconst [draggableEl, A, B, C] = getElements('div');\n\t\t\tA.appendChild(B);\n\t\t\tB.appendChild(C);\n\t\t\tconst ordered: string[] = [];\n\n\t\t\tconst cleanup = combine(\n\t\t\t\tappendToBody(draggableEl, A),\n\t\t\t\tdropTargetForElements({\n\t\t\t\t\telement: A,\n\t\t\t\t\t// I will allow a drop (but it won't matter because B will block it)\n\t\t\t\t\tcanDrop: () => true,\n\t\t\t\t\tgetData: () => {\n\t\t\t\t\t\tordered.push('a:data');\n\t\t\t\t\t\treturn {};\n\t\t\t\t\t},\n\t\t\t\t\tgetDropEffect: () => {\n\t\t\t\t\t\tordered.push('a:dropEffect');\n\t\t\t\t\t\treturn 'move';\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tdropTargetForElements({\n\t\t\t\t\telement: B,\n\t\t\t\t\t// I am not going to allow a drop\n\t\t\t\t\tcanDrop: () => false,\n\t\t\t\t\tgetData: () => {\n\t\t\t\t\t\tordered.push('b:data');\n\t\t\t\t\t\treturn {};\n\t\t\t\t\t},\n\t\t\t\t\tgetDropEffect: () => {\n\t\t\t\t\t\tordered.push('b:dropEffect');\n\t\t\t\t\t\treturn 'move';\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tdropTargetForElements({\n\t\t\t\t\telement: C,\n\t\t\t\t\t// canDrop: () => true is the default\n\t\t\t\t\tgetData: () => {\n\t\t\t\t\t\tordered.push('c:data');\n\t\t\t\t\t\treturn {};\n\t\t\t\t\t},\n\t\t\t\t\tgetDropEffect: () => {\n\t\t\t\t\t\tordered.push('c:dropEffect');\n\t\t\t\t\t\treturn 'move';\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tdraggable({\n\t\t\t\t\telement: draggableEl,\n\t\t\t\t}),\n\t\t\t);\n\n\t\t\tfireEvent.dragStart(draggableEl);\n\t\t\t// @ts-ignore\n\t\t\trequestAnimationFrame.step();\n\t\t\texpect(ordered).toEqual([]);\n\n\t\t\tfireEvent.dragEnter(C);\n\n\t\t\texpect(ordered).toEqual(['c:data', 'c:dropEffect', 'a:data', 'a:dropEffect']);\n\n\t\t\tcleanup();\n\t\t});\n\t});\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/drop-target/data-collection.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\ttype ElementDropTargetGetFeedbackArgs,\n} from '../../../../src/entry-point/element/adapter';\nimport type { DropTargetAllowedDropEffect } from '../../../../src/entry-point/types';\nimport { appendToBody, getBubbleOrderedTree, getDefaultInput, reset, userEvent } from '../../_util';\n\nafterEach(reset);\n\nit('should recollect data and dropEffect during a drag', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\n\tconst ordered: string[] = [];\n\n\tconst canDrop = jest.fn(\n\t\t(() => {\n\t\t\tlet count = 0;\n\t\t\treturn () => {\n\t\t\t\tordered.push(`canDrop():${count++}`);\n\t\t\t\treturn true;\n\t\t\t};\n\t\t})(),\n\t);\n\n\tconst getData = jest.fn(\n\t\t(() => {\n\t\t\tlet count = 0;\n\t\t\treturn () => {\n\t\t\t\tconst result = count++;\n\t\t\t\tordered.push(`getData():${result}`);\n\t\t\t\treturn {\n\t\t\t\t\tcount: result,\n\t\t\t\t};\n\t\t\t};\n\t\t})(),\n\t);\n\n\tconst getDropEffect = jest.fn(\n\t\t(() => {\n\t\t\tlet count = 0;\n\t\t\treturn (): DropTargetAllowedDropEffect => {\n\t\t\t\tordered.push(`getDropEffect():${count++}`);\n\t\t\t\treturn 'move';\n\t\t\t};\n\t\t})(),\n\t);\n\n\tconst getIsSticky = jest.fn(\n\t\t(() => {\n\t\t\tlet count = 0;\n\t\t\treturn () => {\n\t\t\t\tordered.push(`getIsSticky():${count++}`);\n\t\t\t\treturn true;\n\t\t\t};\n\t\t})(),\n\t);\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tcanDrop,\n\t\t\tgetData,\n\t\t\tgetDropEffect,\n\t\t\tgetIsSticky,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDrag: () => ordered.push('a:drag'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrag: () => ordered.push('draggable:drag'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl, getDefaultInput({ pageX: 10 }));\n\n\texpect(ordered).toEqual([\n\t\t'canDrop():0',\n\t\t'getData():0',\n\t\t'getDropEffect():0',\n\t\t'draggable:start',\n\t\t'a:start',\n\t]);\n\tordered.length = 0;\n\t{\n\t\tconst expected: ElementDropTargetGetFeedbackArgs = {\n\t\t\telement: A,\n\t\t\tinput: getDefaultInput({ pageX: 10 }),\n\t\t\tsource: {\n\t\t\t\telement: draggableEl,\n\t\t\t\tdragHandle: null,\n\t\t\t\tdata: {},\n\t\t\t},\n\t\t};\n\t\texpect(canDrop).toHaveBeenCalledWith(expected);\n\t\texpect(getData).toHaveBeenCalledWith(expected);\n\t\texpect(getDropEffect).toHaveBeenCalledWith(expected);\n\t\t// getIsSticky() is only called if trying to figure out whether to\n\t\t// make a drop target sticky\n\t\texpect(getIsSticky).not.toHaveBeenCalled();\n\t\tcanDrop.mockClear();\n\t\tgetData.mockClear();\n\t\tgetDropEffect.mockClear();\n\t\tgetIsSticky.mockClear();\n\t}\n\n\tfireEvent.dragOver(A, getDefaultInput({ pageX: 25 }));\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual([\n\t\t'canDrop():1',\n\t\t'getData():1',\n\t\t'getDropEffect():1',\n\t\t'draggable:drag',\n\t\t'a:drag',\n\t]);\n\t{\n\t\tconst expected: ElementDropTargetGetFeedbackArgs = {\n\t\t\telement: A,\n\t\t\tinput: getDefaultInput({ pageX: 25 }),\n\t\t\tsource: {\n\t\t\t\telement: draggableEl,\n\t\t\t\tdragHandle: null,\n\t\t\t\tdata: {},\n\t\t\t},\n\t\t};\n\t\texpect(canDrop).toHaveBeenCalledWith(expected);\n\t\texpect(getData).toHaveBeenCalledWith(expected);\n\t\texpect(getDropEffect).toHaveBeenCalledWith(expected);\n\t\t// getIsSticky() is only called if trying to figure out whether to\n\t\t// make a drop target sticky\n\t\texpect(getIsSticky).not.toHaveBeenCalled();\n\t}\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/drop-target/drop-effect.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport invariant from 'tiny-invariant';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport { draggable, dropTargetForElements } from '../../../../src/entry-point/element/adapter';\nimport type { DropTargetAllowedDropEffect } from '../../../../src/entry-point/types';\nimport { appendToBody, getBubbleOrderedTree, getElements, reset } from '../../_util';\n\nafterEach(reset);\n\ntest('[] -> none', () => {\n\tconst [draggableEl] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(draggableEl),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonGenerateDragPreview: () => ordered.push('preview'),\n\t\t}),\n\t);\n\n\tconst event = new DragEvent('dragstart', { bubbles: true, cancelable: true });\n\tfireEvent(draggableEl, event);\n\n\texpect(ordered).toEqual(['preview']);\n\n\texpect(event.dataTransfer?.dropEffect).toEqual('none');\n\n\tcleanup();\n});\n\ntest('[A(default: move)] -> move', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('a:preview'),\n\t\t}),\n\t);\n\n\tconst event = new DragEvent('dragstart', { bubbles: true, cancelable: true });\n\tfireEvent(draggableEl, event);\n\n\texpect(ordered).toEqual(['draggable:preview', 'a:preview']);\n\n\texpect(event.dataTransfer?.dropEffect).toEqual('move');\n\n\tcleanup();\n});\n\ntest('[A(copy)] -> copy', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('a:preview'),\n\t\t\tgetDropEffect: () => 'copy',\n\t\t}),\n\t);\n\n\tconst event = new DragEvent('dragstart', { bubbles: true, cancelable: true });\n\tfireEvent(draggableEl, event);\n\n\texpect(ordered).toEqual(['draggable:preview', 'a:preview']);\n\n\texpect(event.dataTransfer?.dropEffect).toEqual('copy');\n\n\tcleanup();\n});\n\ntest('[B(link), A(copy)] -> link', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('a:preview'),\n\t\t\tgetDropEffect: () => 'copy',\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t\tonGenerateDragPreview: () => ordered.push('b:preview'),\n\t\t\tgetDropEffect: () => 'link',\n\t\t}),\n\t);\n\n\tconst event = new DragEvent('dragstart', { bubbles: true, cancelable: true });\n\tfireEvent(draggableEl, event);\n\n\texpect(ordered).toEqual(['draggable:preview', 'b:preview', 'a:preview']);\n\n\texpect(event.dataTransfer?.dropEffect).toEqual('link');\n\n\tcleanup();\n});\n\ntest('[B(default: move), A(copy)] -> move', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('a:preview'),\n\t\t\tgetDropEffect: () => 'copy',\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t\tonGenerateDragPreview: () => ordered.push('b:preview'),\n\t\t}),\n\t);\n\n\tconst event = new DragEvent('dragstart', { bubbles: true, cancelable: true });\n\tfireEvent(draggableEl, event);\n\n\texpect(ordered).toEqual(['draggable:preview', 'b:preview', 'a:preview']);\n\n\texpect(event.dataTransfer?.dropEffect).toEqual('move');\n\n\tcleanup();\n});\n\nfunction getChangingEffects(...effects: DropTargetAllowedDropEffect[]) {\n\tlet index = 0;\n\treturn function getDropEffect(): DropTargetAllowedDropEffect {\n\t\tconst effect = effects[index];\n\t\tinvariant(effect, `no effect for index found ${index}`);\n\t\tindex++;\n\t\treturn effect;\n\t};\n}\n\nit('[B(link), A(copy)] => C[copy] -> copy', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tconst [C] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A, C),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonGenerateDragPreview: () => ordered.push('a:preview'),\n\t\t\tgetDropEffect: () => 'copy',\n\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t\tonDragStart: () => ordered.push('b:start'),\n\t\t\tonGenerateDragPreview: () => ordered.push('b:preview'),\n\t\t\tgetDropEffect: getChangingEffects('link', 'copy'),\n\t\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: C,\n\t\t\tonDragStart: () => ordered.push('c:start'),\n\t\t\tonGenerateDragPreview: () => ordered.push('c:preview'),\n\t\t\tgetDropEffect: () => 'copy',\n\t\t\tonDropTargetChange: () => ordered.push('c:update'),\n\t\t\tonDragEnter: () => ordered.push('c:enter'),\n\t\t\tonDragLeave: () => ordered.push('c:leave'),\n\t\t}),\n\t);\n\n\tconst dragStart = new DragEvent('dragstart', {\n\t\tbubbles: true,\n\t\tcancelable: true,\n\t});\n\tfireEvent(draggableEl, dragStart);\n\n\texpect(ordered).toEqual(['draggable:preview', 'b:preview', 'a:preview']);\n\tordered.length = 0;\n\n\t// initial 'B'\n\texpect(dragStart.dataTransfer?.dropEffect).toEqual('link');\n\n\t// finish lift\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['draggable:start', 'b:start', 'a:start']);\n\tordered.length = 0;\n\n\tconst dragEnter = new DragEvent('dragenter', {\n\t\tbubbles: true,\n\t\tcancelable: true,\n\t});\n\tfireEvent(C, dragEnter);\n\n\t// 'C' drop effect\n\texpect(dragEnter.dataTransfer?.dropEffect).toEqual('copy');\n\n\texpect(ordered).toEqual([\n\t\t'draggable:update',\n\t\t'b:update',\n\t\t'b:leave',\n\t\t'a:update',\n\t\t'a:leave',\n\t\t'c:update',\n\t\t'c:enter',\n\t]);\n\n\tcleanup();\n});\n\nit('[A(copy)] => A[link] -> link', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('a:preview'),\n\t\t\tgetDropEffect: getChangingEffects('copy', 'link'),\n\t\t}),\n\t);\n\n\tconst dragStart = new DragEvent('dragstart', {\n\t\tbubbles: true,\n\t\tcancelable: true,\n\t});\n\tfireEvent(draggableEl, dragStart);\n\n\texpect(ordered).toEqual(['draggable:preview', 'a:preview']);\n\n\texpect(dragStart.dataTransfer?.dropEffect).toEqual('copy');\n\n\t// finish lift\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\tconst dragOver = new DragEvent('dragover', {\n\t\tbubbles: true,\n\t\tcancelable: true,\n\t});\n\tfireEvent(A, dragOver);\n\n\texpect(dragOver.dataTransfer?.dropEffect).toEqual('link');\n\n\tcleanup();\n});\n\nit('[B(link), A(copy)] => [B(copy), A(link)] -> copy', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('a:preview'),\n\t\t\tgetDropEffect: () => 'move',\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t\tonGenerateDragPreview: () => ordered.push('b:preview'),\n\t\t\tgetDropEffect: getChangingEffects('copy', 'link'),\n\t\t}),\n\t);\n\n\tconst dragStart = new DragEvent('dragstart', {\n\t\tbubbles: true,\n\t\tcancelable: true,\n\t});\n\tfireEvent(draggableEl, dragStart);\n\n\texpect(ordered).toEqual(['draggable:preview', 'b:preview', 'a:preview']);\n\n\t// initial 'B'\n\texpect(dragStart.dataTransfer?.dropEffect).toEqual('copy');\n\n\t// finish lift\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\tconst dragOver = new DragEvent('dragover', {\n\t\tbubbles: true,\n\t\tcancelable: true,\n\t});\n\tfireEvent(B, dragOver);\n\n\t// second 'B' drop effect\n\texpect(dragOver.dataTransfer?.dropEffect).toEqual('link');\n\n\tcleanup();\n});\n\ntest('[B(default: move), A(copy)] => [B(default: move), A(link)] -> move', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('a:preview'),\n\t\t\tgetDropEffect: getChangingEffects('copy', 'link'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t\tonGenerateDragPreview: () => ordered.push('b:preview'),\n\t\t}),\n\t);\n\n\tconst event = new DragEvent('dragstart', { bubbles: true, cancelable: true });\n\tfireEvent(draggableEl, event);\n\n\texpect(ordered).toEqual(['draggable:preview', 'b:preview', 'a:preview']);\n\n\texpect(event.dataTransfer?.dropEffect).toEqual('move');\n\n\tconst dragOver = new DragEvent('dragover', {\n\t\tbubbles: true,\n\t\tcancelable: true,\n\t});\n\tfireEvent(draggableEl, dragOver);\n\n\texpect(dragOver.dataTransfer?.dropEffect).toEqual('move');\n\n\tcleanup();\n});\n\ntest('A[copy] => \"dragover\" -> copy', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('a:preview'),\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:change'),\n\t\t\tgetDropEffect: () => 'copy',\n\t\t}),\n\t);\n\n\tconst dragStart = new DragEvent('dragstart', {\n\t\tbubbles: true,\n\t\tcancelable: true,\n\t});\n\tfireEvent(draggableEl, dragStart);\n\n\texpect(dragStart.dataTransfer?.dropEffect).toEqual('copy');\n\n\texpect(ordered).toEqual(['draggable:preview', 'a:preview']);\n\tordered.length = 0;\n\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['draggable:start', 'a:start']);\n\tordered.length = 0;\n\n\tconst dragOver = new DragEvent('dragover', {\n\t\tbubbles: true,\n\t\tcancelable: true,\n\t});\n\tfireEvent(A, dragOver);\n\n\texpect(dragOver.dataTransfer?.dropEffect).toEqual('copy');\n\texpect(ordered).toEqual([]);\n\n\tcleanup();\n});\n\ntest('A[copy] => \"drop\" -> copy', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('a:preview'),\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:change'),\n\t\t\tonDrop: () => ordered.push('a:drop'),\n\t\t\tgetDropEffect: () => 'copy',\n\t\t}),\n\t);\n\n\tconst dragStart = new DragEvent('dragstart', {\n\t\tbubbles: true,\n\t\tcancelable: true,\n\t});\n\tfireEvent(draggableEl, dragStart);\n\n\texpect(dragStart.dataTransfer?.dropEffect).toEqual('copy');\n\n\texpect(ordered).toEqual(['draggable:preview', 'a:preview']);\n\tordered.length = 0;\n\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['draggable:start', 'a:start']);\n\tordered.length = 0;\n\n\t// dropping on A\n\tconst drop = new DragEvent('drop', {\n\t\tbubbles: true,\n\t\tcancelable: true,\n\t});\n\tfireEvent(A, drop);\n\n\texpect(drop.dataTransfer?.dropEffect).toEqual('copy');\n\texpect(ordered).toEqual(['draggable:drop', 'a:drop']);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/drop-target/guardrails.spec.ts",
    "content": "import { dropTargetForElements } from '../../../../src/entry-point/element/adapter';\nimport { dropTargetForExternal } from '../../../../src/entry-point/external/adapter';\nimport { getElements, reset } from '../../_util';\n\nconst warn = jest.spyOn(console, 'warn').mockImplementation(() => {});\n\nbeforeEach(() => {\n\twarn.mockClear();\n\treset();\n});\n\nit('should warn if registering two drop targets of the same type on an element', () => {\n\tconst [A] = getElements('div');\n\n\tconst unbind1 = dropTargetForElements({\n\t\telement: A,\n\t});\n\n\texpect(warn).not.toHaveBeenCalled();\n\n\tconst unbind2 = dropTargetForElements({\n\t\telement: A,\n\t});\n\n\texpect(warn).toHaveBeenCalled();\n\n\tunbind1();\n\tunbind2();\n});\n\nit('should not warn if registering two drop targets of different types on an element', () => {\n\tconst [A] = getElements('div');\n\n\tconst unbind1 = dropTargetForElements({\n\t\telement: A,\n\t});\n\n\texpect(warn).not.toHaveBeenCalled();\n\n\tconst unbind2 = dropTargetForExternal({\n\t\telement: A,\n\t});\n\n\texpect(warn).not.toHaveBeenCalled();\n\n\tunbind1();\n\tunbind2();\n});\n\n// this can mess with detecting when entering / leaving an iframe\nit('should warn if registering an iframe element as a drop target', () => {\n\tconst [iframe] = getElements('iframe');\n\n\tconst unbind = dropTargetForElements({\n\t\telement: iframe,\n\t});\n\n\texpect(warn).toHaveBeenCalled();\n\n\tunbind();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/drop-target/lift.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\t// ElementDropTargetArgs,\n\ttype ElementDropTargetEventPayloadMap,\n} from '../../../../src/entry-point/element/adapter';\nimport { type DropTargetRecord, type Input } from '../../../../src/entry-point/types';\nimport {\n\tappendToBody,\n\tgetDefaultInput,\n\tgetInitialHistory,\n\treset,\n\tsetElementFromPoint,\n} from '../../_util';\n\nafterEach(reset);\n\nit('should notify a drop target when a draggable is being lifted inside of it', () => {\n\tconst element = document.createElement('div');\n\tconst dropTarget = document.createElement('div');\n\tdropTarget.appendChild(element);\n\tconst onGenerateDragPreview = jest.fn();\n\tconst onDragStart = jest.fn();\n\n\tconst cleanup = combine(\n\t\tappendToBody(dropTarget),\n\t\tdraggable({\n\t\t\telement: element,\n\t\t\tgetInitialData: () => ({ hello: 'world' }),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: dropTarget,\n\t\t\tonGenerateDragPreview,\n\t\t\tonDragStart,\n\t\t\tgetData: () => ({ name: 'Alex' }),\n\t\t\tgetDropEffect: () => 'move',\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(element);\n\n\tconst self: DropTargetRecord = {\n\t\telement: dropTarget,\n\t\tdata: { name: 'Alex' },\n\t\tdropEffect: 'move',\n\t\tisActiveDueToStickiness: false,\n\t};\n\t{\n\t\tconst expected: ElementDropTargetEventPayloadMap['onGenerateDragPreview'] = {\n\t\t\tlocation: getInitialHistory([self]),\n\t\t\tsource: {\n\t\t\t\tdata: { hello: 'world' },\n\t\t\t\tdragHandle: null,\n\t\t\t\telement: element,\n\t\t\t},\n\t\t\tself,\n\t\t\tnativeSetDragImage: expect.any(Function),\n\t\t};\n\t\texpect(onGenerateDragPreview).toHaveBeenCalledTimes(1);\n\t\texpect(onGenerateDragPreview).toHaveBeenCalledWith(expected);\n\t\texpect(onDragStart).not.toHaveBeenCalled();\n\t}\n\n\t// After an animation frame the drag start event should be called\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\t{\n\t\tconst expected: ElementDropTargetEventPayloadMap['onDragStart'] = {\n\t\t\tlocation: getInitialHistory([self]),\n\t\t\tsource: {\n\t\t\t\tdata: { hello: 'world' },\n\t\t\t\tdragHandle: null,\n\t\t\t\telement: element,\n\t\t\t},\n\t\t\tself,\n\t\t};\n\t\texpect(onDragStart).toHaveBeenCalledTimes(1);\n\t\texpect(onDragStart).toHaveBeenCalledWith(expected);\n\t}\n\n\tcleanup();\n});\n\nit('should notify a drop target with the appropriate data', () => {\n\tconst element = document.createElement('div');\n\tconst dragHandle = document.createElement('div');\n\telement.appendChild(dragHandle);\n\tconst dropTarget = document.createElement('div');\n\tdropTarget.appendChild(element);\n\tconst onGenerateDragPreview = jest.fn();\n\tconst draggableData = { hello: 'world' };\n\tconst dropTargetData = { name: 'alex' };\n\n\tconst cleanup = combine(\n\t\tappendToBody(dropTarget),\n\t\tsetElementFromPoint(dragHandle),\n\t\tdraggable({\n\t\t\telement: element,\n\t\t\tdragHandle,\n\t\t\tgetInitialData: () => draggableData,\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: dropTarget,\n\t\t\tgetData: () => dropTargetData,\n\t\t\tonGenerateDragPreview,\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(element);\n\n\tconst self: DropTargetRecord = {\n\t\telement: dropTarget,\n\t\tdata: dropTargetData,\n\t\tdropEffect: 'move',\n\t\tisActiveDueToStickiness: false,\n\t};\n\tconst expected: ElementDropTargetEventPayloadMap['onGenerateDragPreview'] = {\n\t\tlocation: getInitialHistory([self]),\n\t\tsource: {\n\t\t\tdata: draggableData,\n\t\t\tdragHandle: dragHandle,\n\t\t\telement: element,\n\t\t},\n\t\tnativeSetDragImage: expect.any(Function),\n\t\tself,\n\t};\n\texpect(onGenerateDragPreview).toHaveBeenCalledTimes(1);\n\texpect(onGenerateDragPreview).toHaveBeenCalledWith(expected);\n\n\tcleanup();\n});\n\nit('should notify a drop target when a draggable and drop target are the same element', () => {\n\tconst element = document.createElement('div');\n\tconst onGenerateDragPreview = jest.fn();\n\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdraggable({\n\t\t\telement: element,\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: element,\n\t\t\tonGenerateDragPreview,\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(element);\n\n\tconst self: DropTargetRecord = {\n\t\telement: element,\n\t\tdata: {},\n\t\tdropEffect: 'move',\n\t\tisActiveDueToStickiness: false,\n\t};\n\tconst expected: ElementDropTargetEventPayloadMap['onGenerateDragPreview'] = {\n\t\tlocation: getInitialHistory([self]),\n\t\tsource: {\n\t\t\tdata: {},\n\t\t\tdragHandle: null,\n\t\t\telement: element,\n\t\t},\n\t\tnativeSetDragImage: expect.any(Function),\n\t\tself,\n\t};\n\texpect(onGenerateDragPreview).toHaveBeenCalledTimes(1);\n\texpect(onGenerateDragPreview).toHaveBeenCalledWith(expected);\n\n\tcleanup();\n});\n\nit('should only collect data and dropEffect once from a drop target when lifting', () => {\n\tconst element = document.createElement('div');\n\tconst dropTarget = document.createElement('div');\n\tdropTarget.appendChild(element);\n\tconst onGenerateDragPreview = jest.fn();\n\tconst onDragStart = jest.fn();\n\tconst getData = jest.fn(() => ({}));\n\tconst getDropEffect = jest.fn(() => 'move' as const);\n\n\tconst cleanup = combine(\n\t\tappendToBody(dropTarget),\n\t\tdraggable({\n\t\t\telement: element,\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: dropTarget,\n\t\t\tonGenerateDragPreview,\n\t\t\tonDragStart,\n\t\t\tgetData,\n\t\t\tgetDropEffect,\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(element);\n\n\texpect(getData).toHaveBeenCalledTimes(1);\n\texpect(getDropEffect).toHaveBeenCalledTimes(1);\n\tgetData.mockClear();\n\tgetDropEffect.mockClear();\n\texpect(onGenerateDragPreview).toHaveBeenCalledTimes(1);\n\n\t// After an animation frame the drag start event should be called\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\t// `getData` and `getDropEffect` should not have been called again\n\texpect(getData).not.toHaveBeenCalled();\n\texpect(getDropEffect).not.toHaveBeenCalled();\n\texpect(onDragStart).toHaveBeenCalledTimes(1);\n\n\tcleanup();\n});\n\nit('should not notify drop targets that do not contain the draggable on lift', () => {\n\tconst element = document.createElement('div');\n\tconst unrelated = document.createElement('div');\n\tconst onGenerateDragPreview = jest.fn();\n\n\tconst cleanup = combine(\n\t\tappendToBody(element, unrelated),\n\t\tdraggable({\n\t\t\telement: element,\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: unrelated,\n\t\t\tonGenerateDragPreview,\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(element);\n\n\texpect(onGenerateDragPreview).not.toHaveBeenCalled();\n\n\tcleanup();\n});\n\nit('should notify all drop target parents when a inner draggable is lifted', () => {\n\tconst element = document.createElement('div');\n\tconst parent = document.createElement('div');\n\tconst grandParent = document.createElement('div');\n\tparent.appendChild(element);\n\tgrandParent.appendChild(parent);\n\tconst parentOnGenerateDragPreview = jest.fn();\n\tconst parentOnDragStart = jest.fn();\n\tconst grandParentOnGenerateDragPreview = jest.fn();\n\tconst grandParentOnDragStart = jest.fn();\n\n\tconst cleanup = combine(\n\t\tappendToBody(grandParent),\n\t\tdraggable({\n\t\t\telement: element,\n\t\t\tgetInitialData: () => ({ name: 'draggable' }),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: parent,\n\t\t\tgetData: () => ({ name: 'parent' }),\n\t\t\tonGenerateDragPreview: parentOnGenerateDragPreview,\n\t\t\tonDragStart: parentOnDragStart,\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: grandParent,\n\t\t\tgetData: () => ({ name: 'grandParent' }),\n\t\t\tonGenerateDragPreview: grandParentOnGenerateDragPreview,\n\t\t\tonDragStart: grandParentOnDragStart,\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(element);\n\n\tconst parentRecord: DropTargetRecord = {\n\t\telement: parent,\n\t\tdata: { name: 'parent' },\n\t\tdropEffect: 'move',\n\t\tisActiveDueToStickiness: false,\n\t};\n\tconst grandParentRecord: DropTargetRecord = {\n\t\telement: grandParent,\n\t\tdata: { name: 'grandParent' },\n\t\tdropEffect: 'move',\n\t\tisActiveDueToStickiness: false,\n\t};\n\t{\n\t\tconst expected: ElementDropTargetEventPayloadMap['onGenerateDragPreview'] = {\n\t\t\tlocation: getInitialHistory([parentRecord, grandParentRecord]),\n\t\t\tsource: {\n\t\t\t\tdata: { name: 'draggable' },\n\t\t\t\tdragHandle: null,\n\t\t\t\telement: element,\n\t\t\t},\n\t\t\tnativeSetDragImage: expect.any(Function),\n\t\t\tself: parentRecord,\n\t\t};\n\t\texpect(parentOnGenerateDragPreview).toHaveBeenCalledWith(expected);\n\t\texpect(parentOnGenerateDragPreview).toHaveBeenCalledTimes(1);\n\t}\n\t{\n\t\tconst expected: ElementDropTargetEventPayloadMap['onGenerateDragPreview'] = {\n\t\t\tlocation: getInitialHistory([parentRecord, grandParentRecord]),\n\t\t\tsource: {\n\t\t\t\tdata: { name: 'draggable' },\n\t\t\t\tdragHandle: null,\n\t\t\t\telement: element,\n\t\t\t},\n\t\t\tnativeSetDragImage: expect.any(Function),\n\t\t\tself: grandParentRecord,\n\t\t};\n\t\texpect(grandParentOnGenerateDragPreview).toHaveBeenCalledWith(expected);\n\t\texpect(grandParentOnGenerateDragPreview).toHaveBeenCalledTimes(1);\n\t}\n\n\t// finish the lift\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\t{\n\t\tconst expected: ElementDropTargetEventPayloadMap['onDragStart'] = {\n\t\t\tlocation: getInitialHistory([parentRecord, grandParentRecord]),\n\t\t\tsource: {\n\t\t\t\tdata: { name: 'draggable' },\n\t\t\t\tdragHandle: null,\n\t\t\t\telement: element,\n\t\t\t},\n\t\t\tself: parentRecord,\n\t\t};\n\t\texpect(parentOnDragStart).toHaveBeenCalledWith(expected);\n\t\texpect(parentOnDragStart).toHaveBeenCalledTimes(1);\n\t}\n\t{\n\t\tconst expected: ElementDropTargetEventPayloadMap['onDragStart'] = {\n\t\t\tlocation: getInitialHistory([parentRecord, grandParentRecord]),\n\t\t\tsource: {\n\t\t\t\tdata: { name: 'draggable' },\n\t\t\t\tdragHandle: null,\n\t\t\t\telement: element,\n\t\t\t},\n\t\t\tself: grandParentRecord,\n\t\t};\n\t\texpect(grandParentOnDragStart).toHaveBeenCalledWith(expected);\n\t\texpect(grandParentOnDragStart).toHaveBeenCalledTimes(1);\n\t}\n\n\tcleanup();\n});\n\nit('should provide the getData and getDropEffect functions with information about the drag', () => {\n\tconst element = document.createElement('div');\n\tconst dropTarget = document.createElement('div');\n\tdropTarget.appendChild(element);\n\tconst getData = jest.fn();\n\tconst getDropEffect = jest.fn(() => 'move' as const);\n\tconst cleanup = combine(\n\t\tappendToBody(dropTarget),\n\t\tdraggable({\n\t\t\telement: element,\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: dropTarget,\n\t\t\tgetData,\n\t\t\tgetDropEffect,\n\t\t}),\n\t);\n\tconst input: Input = getDefaultInput({ button: 2 });\n\n\tfireEvent.dragStart(element, input);\n\n\ttype Args = Parameters<typeof dropTargetForElements>[0];\n\ttype GetDataArgs = Parameters<NonNullable<Args['getData']>>[0];\n\n\tconst expected: GetDataArgs = {\n\t\telement: dropTarget,\n\t\tinput: input,\n\t\tsource: {\n\t\t\telement: element,\n\t\t\tdragHandle: null,\n\t\t\tdata: {},\n\t\t},\n\t};\n\texpect(getData).toHaveBeenCalledWith(expected);\n\texpect(getDropEffect).toHaveBeenCalledWith(expected);\n\n\tcleanup();\n});\n\nit('should not trigger any non-lift events on lift', () => {\n\tconst element = document.createElement('div');\n\tconst onGenerateDragPreview = jest.fn();\n\tconst onDragStart = jest.fn();\n\tconst onDrag = jest.fn();\n\tconst onDropTargetChange = jest.fn();\n\tconst onDrop = jest.fn();\n\tconst onDragEnter = jest.fn();\n\tconst onDragLeave = jest.fn();\n\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdraggable({\n\t\t\telement: element,\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: element,\n\t\t\tonGenerateDragPreview,\n\t\t\tonDragStart,\n\t\t\tonDrag: onDrag,\n\t\t\tonDropTargetChange: onDropTargetChange,\n\t\t\tonDragEnter,\n\t\t\tonDragLeave,\n\t\t\tonDrop,\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(element);\n\n\texpect(onGenerateDragPreview).toHaveBeenCalledTimes(1);\n\texpect(onDragStart).not.toHaveBeenCalled();\n\texpect(onDrag).not.toHaveBeenCalled();\n\texpect(onDropTargetChange).not.toHaveBeenCalled();\n\texpect(onDragEnter).not.toHaveBeenCalled();\n\texpect(onDragLeave).not.toHaveBeenCalled();\n\texpect(onDrop).not.toHaveBeenCalled();\n\n\tonGenerateDragPreview.mockClear();\n\n\t// After an animation frame the drag start event should be called\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\texpect(onGenerateDragPreview).not.toHaveBeenCalled();\n\texpect(onDragStart).toHaveBeenCalledTimes(1);\n\texpect(onDrag).not.toHaveBeenCalled();\n\texpect(onDropTargetChange).not.toHaveBeenCalled();\n\texpect(onDragEnter).not.toHaveBeenCalled();\n\texpect(onDragLeave).not.toHaveBeenCalled();\n\texpect(onDrop).not.toHaveBeenCalled();\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/drop-target/stickiness.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport { draggable, dropTargetForElements } from '../../../../src/entry-point/element/adapter';\nimport { appendToBody, getBubbleOrderedTree, getElements, reset, userEvent } from '../../_util';\n\nafterEach(reset);\n\ntest('[A(sticky)] -> [] = [A]', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tA.id = 'A';\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tgetIsSticky: () => true,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\texpect(ordered).toEqual(['draggable:start', 'a:start']);\n\tordered.length = 0;\n\n\tfireEvent.dragEnter(document.body);\n\n\t// no 'leave' events fired\n\texpect(ordered).toEqual([]);\n\n\tcleanup();\n});\n\ntest('[B(sticky), A(sticky)] -> [] = [B, A]', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tA.id = 'A';\n\tB.id = 'B';\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tgetIsSticky: () => true,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t\tgetIsSticky: () => true,\n\t\t\tonDragStart: () => ordered.push('b:start'),\n\t\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\texpect(ordered).toEqual(['draggable:start', 'b:start', 'a:start']);\n\tordered.length = 0;\n\n\tfireEvent.dragEnter(document.body);\n\n\texpect(ordered).toEqual([]);\n\n\tcleanup();\n});\n\ntest('[C, B(sticky), A(sticky)] -> [] = [B, A]', () => {\n\tconst [draggableEl, C, B, A] = getBubbleOrderedTree();\n\tA.id = 'A';\n\tB.id = 'B';\n\tC.id = 'C';\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tgetIsSticky: () => true,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t\tgetIsSticky: () => true,\n\t\t\tonDragStart: () => ordered.push('b:start'),\n\t\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: C,\n\t\t\tgetIsSticky: () => false,\n\t\t\tonDragStart: () => ordered.push('c:start'),\n\t\t\tonDropTargetChange: () => ordered.push('c:update'),\n\t\t\tonDragLeave: () => ordered.push('c:leave'),\n\t\t\tonDragEnter: () => ordered.push('c:enter'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\texpect(ordered).toEqual(['draggable:start', 'c:start', 'b:start', 'a:start']);\n\tordered.length = 0;\n\n\tfireEvent.dragEnter(document.body);\n\n\texpect(ordered).toEqual([\n\t\t'draggable:update',\n\t\t'c:update',\n\t\t'c:leave',\n\t\t// not leaving b or a, but letting them know something changed\n\t\t'b:update',\n\t\t'a:update',\n\t]);\n\n\tcleanup();\n});\n\ntest('[A(sticky)] -> [B] = [B]', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst [B] = getElements('div');\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A, B),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tgetIsSticky: () => true,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t\tonDragStart: () => ordered.push('b:start'),\n\t\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\texpect(ordered).toEqual(['draggable:start', 'a:start']);\n\tordered.length = 0;\n\n\tfireEvent.dragEnter(B);\n\n\texpect(ordered).toEqual(['draggable:update', 'a:update', 'a:leave', 'b:update', 'b:enter']);\n\n\tcleanup();\n});\n\ntest('[B(sticky), A] -> [A] = [B, A]', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tA.id = 'A';\n\tB.id = 'B';\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t\tgetIsSticky: () => true,\n\t\t\tonDragStart: () => ordered.push('b:start'),\n\t\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\texpect(ordered).toEqual(['draggable:start', 'b:start', 'a:start']);\n\tordered.length = 0;\n\n\tfireEvent.dragEnter(A);\n\n\texpect(ordered).toEqual([]);\n\n\tcleanup();\n});\n\ntest('[B, A(sticky)] -> [A] = [A]', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tA.id = 'A';\n\tB.id = 'B';\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tgetIsSticky: () => true,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t\tonDragStart: () => ordered.push('b:start'),\n\t\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\texpect(ordered).toEqual(['draggable:start', 'b:start', 'a:start']);\n\tordered.length = 0;\n\n\tfireEvent.dragEnter(A);\n\n\texpect(ordered).toEqual(['draggable:update', 'b:update', 'b:leave', 'a:update']);\n\n\tcleanup();\n});\n\ntest('[B(sticky), A] -> [X] = [X]', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tconst [X] = getElements('div');\n\tA.id = 'A';\n\tB.id = 'B';\n\tX.id = 'X';\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A, X),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tgetIsSticky: () => true,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t\tgetIsSticky: () => true,\n\t\t\tonDragStart: () => ordered.push('b:start'),\n\t\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: X,\n\t\t\tgetIsSticky: () => false,\n\t\t\tonDragStart: () => ordered.push('x:start'),\n\t\t\tonDropTargetChange: () => ordered.push('x:update'),\n\t\t\tonDragLeave: () => ordered.push('x:leave'),\n\t\t\tonDragEnter: () => ordered.push('x:enter'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\texpect(ordered).toEqual(['draggable:start', 'b:start', 'a:start']);\n\tordered.length = 0;\n\n\tfireEvent.dragEnter(X);\n\n\texpect(ordered).toEqual([\n\t\t'draggable:update',\n\t\t'b:update',\n\t\t'b:leave',\n\t\t'a:update',\n\t\t'a:leave',\n\t\t'x:update',\n\t\t'x:enter',\n\t]);\n\n\tcleanup();\n});\n\ntest('[B(sticky), A] -> [] = []', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tA.id = 'A';\n\tB.id = 'B';\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t\tgetIsSticky: () => true,\n\t\t\tonDragStart: () => ordered.push('b:start'),\n\t\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\texpect(ordered).toEqual(['draggable:start', 'b:start', 'a:start']);\n\tordered.length = 0;\n\n\tfireEvent.dragEnter(document.body);\n\n\texpect(ordered).toEqual(['draggable:update', 'b:update', 'b:leave', 'a:update', 'a:leave']);\n\n\tcleanup();\n});\n\ntest('[B(sticky), A(sticky)] -> [X] = [X]', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tA.id = 'A';\n\tB.id = 'B';\n\tconst [X] = getElements('div');\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A, X),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t\tgetIsSticky: () => true,\n\t\t\tonDragStart: () => ordered.push('b:start'),\n\t\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: X,\n\t\t\tgetIsSticky: () => true,\n\t\t\tonDragStart: () => ordered.push('x:start'),\n\t\t\tonDropTargetChange: () => ordered.push('x:update'),\n\t\t\tonDragLeave: () => ordered.push('x:leave'),\n\t\t\tonDragEnter: () => ordered.push('x:enter'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\texpect(ordered).toEqual(['draggable:start', 'b:start', 'a:start']);\n\tordered.length = 0;\n\n\tfireEvent.dragEnter(X);\n\n\texpect(ordered).toEqual([\n\t\t'draggable:update',\n\t\t'b:update',\n\t\t'b:leave',\n\t\t'a:update',\n\t\t'a:leave',\n\t\t'x:update',\n\t\t'x:enter',\n\t]);\n\n\tcleanup();\n});\n\nit('A(sticky) -> [] (+ A not sticky) => []', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tlet isASticky: boolean = true;\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tgetIsSticky: () => isASticky,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\texpect(ordered).toEqual(['draggable:start', 'a:start']);\n\tordered.length = 0;\n\n\t// first update: A is no longer sticky\n\tisASticky = false;\n\tfireEvent.dragEnter(document.body);\n\texpect(ordered).toEqual(['draggable:update', 'a:update', 'a:leave']);\n\n\tcleanup();\n});\n\nit('[B(sticky), A(sticky)] -> [] (+ B not sticky) => [A]', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tA.id = 'A';\n\tB.id = 'B';\n\tconst ordered: string[] = [];\n\tlet isBSticky: boolean = true;\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tgetIsSticky: () => true,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t\tgetIsSticky: () => isBSticky,\n\t\t\tonDragStart: () => ordered.push('b:start'),\n\t\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\texpect(ordered).toEqual(['draggable:start', 'b:start', 'a:start']);\n\tordered.length = 0;\n\n\t// Marking B as no longer sticky\n\tisBSticky = false;\n\n\tfireEvent.dragEnter(document.body);\n\n\texpect(ordered).toEqual(['draggable:update', 'b:update', 'b:leave', 'a:update']);\n\n\tcleanup();\n});\n\nit('[B(sticky), A(sticky)] -> [] (+ A not sticky) => []', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tA.id = 'A';\n\tB.id = 'B';\n\tconst ordered: string[] = [];\n\tlet isASticky: boolean = true;\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tgetIsSticky: () => isASticky,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t\tgetIsSticky: () => true,\n\t\t\tonDragStart: () => ordered.push('b:start'),\n\t\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\texpect(ordered).toEqual(['draggable:start', 'b:start', 'a:start']);\n\tordered.length = 0;\n\n\t// Marking A as no longer sticky\n\tisASticky = false;\n\n\tfireEvent.dragEnter(document.body);\n\n\texpect(ordered).toEqual(['draggable:update', 'b:update', 'b:leave', 'a:update', 'a:leave']);\n\n\tcleanup();\n});\n\nit('A(sticky) -> [] (+ A cannot drop) => []', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tlet canDropOnA: boolean = true;\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tcanDrop: () => canDropOnA,\n\t\t\tgetIsSticky: () => true,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\texpect(ordered).toEqual(['draggable:start', 'a:start']);\n\tordered.length = 0;\n\n\t// first update: A can no longer be dropped on\n\tcanDropOnA = false;\n\tfireEvent.dragEnter(document.body);\n\texpect(ordered).toEqual(['draggable:update', 'a:update', 'a:leave']);\n\n\tcleanup();\n});\n\nit('[B(sticky), A(sticky)] -> [] (+ B cannot drop) => [A]', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tA.id = 'A';\n\tB.id = 'B';\n\tconst ordered: string[] = [];\n\tlet canDropOnB: boolean = true;\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tgetIsSticky: () => true,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t\tgetIsSticky: () => true,\n\t\t\tcanDrop: () => canDropOnB,\n\t\t\tonDragStart: () => ordered.push('b:start'),\n\t\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\texpect(ordered).toEqual(['draggable:start', 'b:start', 'a:start']);\n\tordered.length = 0;\n\n\t// Can no longer drop on B\n\tcanDropOnB = false;\n\n\tfireEvent.dragEnter(document.body);\n\n\texpect(ordered).toEqual(['draggable:update', 'b:update', 'b:leave', 'a:update']);\n\n\tcleanup();\n});\n\nit('[B(sticky), A(sticky)] -> [] (+ A cannot drop) => []', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tA.id = 'A';\n\tB.id = 'B';\n\tconst ordered: string[] = [];\n\tlet canDropOnA: boolean = true;\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tgetIsSticky: () => true,\n\t\t\tcanDrop: () => canDropOnA,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t\tgetIsSticky: () => true,\n\t\t\tonDragStart: () => ordered.push('b:start'),\n\t\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\texpect(ordered).toEqual(['draggable:start', 'b:start', 'a:start']);\n\tordered.length = 0;\n\n\t// Can no longer drop on A\n\tcanDropOnA = false;\n\n\tfireEvent.dragEnter(document.body);\n\n\texpect(ordered).toEqual(['draggable:update', 'b:update', 'b:leave', 'a:update', 'a:leave']);\n\n\tcleanup();\n});\n\nit('A(sticky) -> [] (+ A unmounted) => []', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\n\tconst cleanupA = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t}),\n\t);\n\tconst cleanupDropTarget = dropTargetForElements({\n\t\telement: A,\n\t\tgetIsSticky: () => true,\n\t\tonDragStart: () => ordered.push('a:start'),\n\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\tonDragEnter: () => ordered.push('a:enter'),\n\t});\n\n\tuserEvent.lift(draggableEl);\n\texpect(ordered).toEqual(['draggable:start', 'a:start']);\n\tordered.length = 0;\n\n\t// A can no longer be dropped on\n\n\tcleanupDropTarget();\n\n\t// first update: leave A\n\n\tfireEvent.dragEnter(document.body);\n\texpect(ordered).toEqual(['draggable:update']);\n\n\tcleanupA();\n});\n\nit('[B(sticky), A(sticky)] -> [] (+ B unmounted) => [A]', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tA.id = 'A';\n\tB.id = 'B';\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tgetIsSticky: () => true,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t}),\n\t);\n\tconst cleanupBDropTarget = dropTargetForElements({\n\t\telement: B,\n\t\tgetIsSticky: () => true,\n\t\tonDragStart: () => ordered.push('b:start'),\n\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\tonDragEnter: () => ordered.push('b:enter'),\n\t});\n\n\tuserEvent.lift(draggableEl);\n\texpect(ordered).toEqual(['draggable:start', 'b:start', 'a:start']);\n\tordered.length = 0;\n\n\t// B is no longer a drop target\n\tcleanupBDropTarget();\n\n\tfireEvent.dragEnter(document.body);\n\n\texpect(ordered).toEqual(['draggable:update', 'a:update']);\n\n\tcleanup();\n});\n\nit('[B(sticky), A(sticky)] -> [] (+ A unmounted) => []', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tA.id = 'A';\n\tB.id = 'B';\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t\tgetIsSticky: () => true,\n\t\t\tonDragStart: () => ordered.push('b:start'),\n\t\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t}),\n\t);\n\tconst cleanupDropTargetA = dropTargetForElements({\n\t\telement: A,\n\t\tgetIsSticky: () => true,\n\t\tonDragStart: () => ordered.push('a:start'),\n\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\tonDragEnter: () => ordered.push('a:enter'),\n\t});\n\n\tuserEvent.lift(draggableEl);\n\texpect(ordered).toEqual(['draggable:start', 'b:start', 'a:start']);\n\tordered.length = 0;\n\n\t// B is no longer a drop target\n\tcleanupDropTargetA();\n\n\tfireEvent.dragEnter(document.body);\n\n\texpect(ordered).toEqual(['draggable:update', 'b:update', 'b:leave']);\n\n\tcleanup();\n});\n\nit('should not recalculate the latest data for sticky records', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tlet count: number = 0;\n\n\tconst cleanupA = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tgetIsSticky: () => true,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tgetData: () => {\n\t\t\t\tordered.push(`getData(${count++})`);\n\t\t\t\treturn {};\n\t\t\t},\n\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\n\texpect(ordered).toEqual(['getData(0)', 'draggable:start', 'a:start']);\n\tordered.length = 0;\n\n\t// first update: leave A\n\n\tfireEvent.dragEnter(document.body);\n\texpect(ordered).toEqual([]);\n\n\tcleanupA();\n});\n\nit('should ensure drop target record has `isActiveDueToStickiness` set correctly', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tA.id = 'A';\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tgetIsSticky: () => true,\n\t\t\tonDragStart: (args) =>\n\t\t\t\tordered.push(`a:start[isActiveDueToStickiness=${args.self.isActiveDueToStickiness}]`),\n\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\tonDrag: (args) =>\n\t\t\t\tordered.push(`a:drag[isActiveDueToStickiness=${args.self.isActiveDueToStickiness}]`),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\texpect(ordered).toEqual(['draggable:start', 'a:start[isActiveDueToStickiness=false]']);\n\tordered.length = 0;\n\n\t// leaving A\n\tfireEvent.dragEnter(document.body);\n\n\t// no 'leave' events fired\n\texpect(ordered).toEqual([]);\n\n\t// A drag outside of A\n\tfireEvent.dragOver(document.body);\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['a:drag[isActiveDueToStickiness=true]']);\n\tordered.length = 0;\n\n\t// re-entering A\n\tfireEvent.dragEnter(A);\n\t// no 'enter' events fired - already in A before due to stickiness\n\texpect(ordered).toEqual([]);\n\n\t// A drag inside of A\n\tfireEvent.dragOver(A);\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['a:drag[isActiveDueToStickiness=false]']);\n\n\tcleanup();\n});\n\nit('should collect stickiness when needed', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst [B] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst getIsASticky = jest.fn(() => true);\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tappendToBody(B),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tgetIsSticky: getIsASticky,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\tonDrag: () => ordered.push('a:drag'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t\tonDragStart: () => ordered.push('b:start'),\n\t\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\t\tonDrag: () => ordered.push('b:drag'),\n\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\texpect(ordered).toEqual(['draggable:start', 'a:start']);\n\t// no need to check stickiness\n\texpect(getIsASticky).not.toHaveBeenCalled();\n\tordered.length = 0;\n\n\t// continuing to drag over A\n\n\tfireEvent.dragOver(A);\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['a:drag']);\n\t// no need to check stickiness\n\texpect(getIsASticky).not.toHaveBeenCalled();\n\tordered.length = 0;\n\n\t// leaving A\n\n\tfireEvent.dragEnter(document.body);\n\t// no 'leave' events fired\n\texpect(ordered).toEqual([]);\n\t// stickiness needed to be checked\n\texpect(getIsASticky).toHaveBeenCalled();\n\tgetIsASticky.mockClear();\n\n\t// continuing to be outside of A\n\n\tfireEvent.dragOver(document.body);\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['a:drag']);\n\t// stickiness needed to be checked again\n\texpect(getIsASticky).toHaveBeenCalled();\n\tgetIsASticky.mockClear();\n\tordered.length = 0;\n\n\t// Moving over B\n\n\tfireEvent.dragOver(B);\n\t// already over\n\texpect(ordered).toEqual(['draggable:update', 'a:update', 'a:leave', 'b:update', 'b:enter']);\n\n\t// stickiness for A not needed to be checked again\n\texpect(getIsASticky).not.toHaveBeenCalled();\n\tgetIsASticky.mockClear();\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/dropping-outside-window.spec.ts",
    "content": "import { combine } from '../../../src/entry-point/combine';\nimport { draggable } from '../../../src/entry-point/element/adapter';\nimport { appendToBody, getElements, reset, userEvent } from '../_util';\n\nafterEach(reset);\n\nit('should cancel the drag', () => {\n\tconst [draggableEl] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(draggableEl),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('start'),\n\t\t\tonDrop: () => ordered.push('drop'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\n\texpect(ordered).toEqual(['start']);\n\tordered.length = 0;\n\n\tuserEvent.leaveWindow();\n\n\t// no changes yet\n\texpect(ordered).toEqual([]);\n\n\tuserEvent.cancel(draggableEl);\n\n\texpect(ordered).toEqual(['drop']);\n\n\tcleanup();\n});\n\nit('should cancel a drag if a \"pointermove\" occurs (should not happen during a drag)', () => {\n\tconst [draggableEl] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(draggableEl),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('start'),\n\t\t\tonDrop: () => ordered.push('drop'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\n\texpect(ordered).toEqual(['start']);\n\tordered.length = 0;\n\n\tuserEvent.leaveWindow();\n\n\t// no changes yet\n\texpect(ordered).toEqual([]);\n\n\t// pointer events\n\tuserEvent.rougePointerMoves();\n\texpect(ordered).toEqual(['drop']);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/error-recovery.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../src/entry-point/combine';\nimport { draggable } from '../../../src/entry-point/element/adapter';\nimport { appendToBody, getElements, reset } from '../_util';\n\nafterEach(reset);\n\ntest('an error in \"dragstart\" will cause a \"dragend\" which will cancel the drag', () => {\n\tconst [draggableEl] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(draggableEl),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('start'),\n\t\t\tonDrop: () => ordered.push('drop'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(draggableEl);\n\n\t// simulating an error in \"dragstart\"\n\tfireEvent.dragEnd(draggableEl);\n\n\texpect(ordered).toEqual(['start', 'drop']);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/event-ordering/all.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\tmonitorForElements,\n} from '../../../../src/entry-point/element/adapter';\nimport { appendToBody, getElements, reset } from '../../_util';\n\nafterEach(reset);\n\nit('should execute callbacks in response to native events', () => {\n\tconst [A] = getElements('div');\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrag: () => ordered.push('draggable:drag'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('dropTarget:preview'),\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDrag: () => ordered.push('dropTarget:drag'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t\tonDropTargetChange: () => ordered.push('dropTarget:change'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonGenerateDragPreview: () => ordered.push('monitor:preview'),\n\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t\tonDrag: () => ordered.push('monitor:drag'),\n\t\t\tonDrop: () => ordered.push('monitor:drop'),\n\t\t\tonDropTargetChange: () => ordered.push('monitor:change'),\n\t\t}),\n\t);\n\n\texpect(ordered).toEqual([]);\n\n\t// starting a lift, this will trigger the previews to be generated\n\tfireEvent.dragStart(A);\n\n\texpect(ordered).toEqual(['draggable:preview', 'dropTarget:preview', 'monitor:preview']);\n\tordered.length = 0;\n\n\t// ticking forward an animation frame will complete the lift\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start', 'monitor:start']);\n\tordered.length = 0;\n\n\t// [A] -> []\n\tfireEvent.dragEnter(document.body);\n\texpect(ordered).toEqual([\n\t\t'draggable:change',\n\t\t'dropTarget:change',\n\t\t'dropTarget:leave',\n\t\t'monitor:change',\n\t]);\n\tordered.length = 0;\n\n\t// [] -> [A]\n\tfireEvent.dragEnter(A);\n\texpect(ordered).toEqual([\n\t\t'draggable:change',\n\t\t'dropTarget:change',\n\t\t'dropTarget:enter',\n\t\t'monitor:change',\n\t]);\n\tordered.length = 0;\n\n\t// [A] -> [A]\n\tfireEvent.dragOver(A, { clientX: 10 });\n\t// no updates yet (need to wait for the next animation frame)\n\texpect(ordered).toEqual([]);\n\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['draggable:drag', 'dropTarget:drag', 'monitor:drag']);\n\tordered.length = 0;\n\n\t// drop\n\tfireEvent.drop(A);\n\texpect(ordered).toEqual(['draggable:drop', 'dropTarget:drop', 'monitor:drop']);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/event-ordering/callback-data.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\ttype ElementEventPayloadMap,\n\tmonitorForElements,\n} from '../../../../src/entry-point/element/adapter';\nimport { type DragLocation, type Input } from '../../../../src/entry-point/types';\nimport { appendToBody, getBubbleOrderedTree, getDefaultInput, reset, userEvent } from '../../_util';\n\nafterEach(reset);\n\ntest('scenario: [A] -> [A] -> [] -> cancel', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst monitorOnGenerateDragPreview = jest.fn();\n\tconst monitorOnDragStart = jest.fn();\n\tconst monitorOnDrag = jest.fn();\n\tconst monitorOnDropTargetChange = jest.fn();\n\tconst monitorOnDrop = jest.fn();\n\tconst dropTargetOnGenerateDragPreview = jest.fn();\n\tconst dropTargetOnDragStart = jest.fn();\n\tconst dropTargetOnDrag = jest.fn();\n\tconst dropTargetOnDropTargetChange = jest.fn();\n\tconst dropTargetOnDrop = jest.fn();\n\tconst draggableOnGenerateDragPreview = jest.fn();\n\tconst draggableOnDragStart = jest.fn();\n\tconst draggableOnDrag = jest.fn();\n\tconst draggableOnDropTargetChange = jest.fn();\n\tconst draggableOnDrop = jest.fn();\n\tconst draggableData = { name: 'Alex' };\n\tconst getInitialData = () => draggableData;\n\tconst dropTargetData = { type: 'Person' };\n\tconst getData = () => dropTargetData;\n\n\tconst firstInput: Input = {\n\t\t...getDefaultInput(),\n\t\tpageX: 5,\n\t};\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tgetData,\n\t\t\tonGenerateDragPreview: dropTargetOnGenerateDragPreview,\n\t\t\tonDragStart: dropTargetOnDragStart,\n\t\t\tonDrag: dropTargetOnDrag,\n\t\t\tonDropTargetChange: dropTargetOnDropTargetChange,\n\t\t\tonDrop: dropTargetOnDrop,\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonGenerateDragPreview: monitorOnGenerateDragPreview,\n\t\t\tonDragStart: monitorOnDragStart,\n\t\t\tonDrag: monitorOnDrag,\n\t\t\tonDropTargetChange: monitorOnDropTargetChange,\n\t\t\tonDrop: monitorOnDrop,\n\t\t}),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tgetInitialData,\n\t\t\tonGenerateDragPreview: draggableOnGenerateDragPreview,\n\t\t\tonDragStart: draggableOnDragStart,\n\t\t\tonDrag: draggableOnDrag,\n\t\t\tonDropTargetChange: draggableOnDropTargetChange,\n\t\t\tonDrop: draggableOnDrop,\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(draggableEl, firstInput);\n\n\tconst initial: DragLocation = {\n\t\tinput: firstInput,\n\t\tdropTargets: [\n\t\t\t{\n\t\t\t\telement: A,\n\t\t\t\tdata: dropTargetData,\n\t\t\t\tisActiveDueToStickiness: false,\n\t\t\t\tdropEffect: 'move',\n\t\t\t},\n\t\t],\n\t};\n\n\t{\n\t\tconst expected: ElementEventPayloadMap['onGenerateDragPreview'] = {\n\t\t\tlocation: {\n\t\t\t\tinitial,\n\t\t\t\tprevious: {\n\t\t\t\t\tdropTargets: [],\n\t\t\t\t},\n\t\t\t\tcurrent: initial,\n\t\t\t},\n\t\t\tsource: {\n\t\t\t\tdata: draggableData,\n\t\t\t\tdragHandle: null,\n\t\t\t\telement: draggableEl,\n\t\t\t},\n\t\t\tnativeSetDragImage: expect.any(Function),\n\t\t};\n\t\texpect(draggableOnGenerateDragPreview).toHaveBeenCalledWith(expected);\n\t\texpect(dropTargetOnGenerateDragPreview).toHaveBeenCalledWith({\n\t\t\t...expected,\n\t\t\tself: initial.dropTargets[0],\n\t\t});\n\t\texpect(monitorOnGenerateDragPreview).toHaveBeenCalledWith(expected);\n\t}\n\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\t{\n\t\tconst expected: ElementEventPayloadMap['onDragStart'] = {\n\t\t\tlocation: {\n\t\t\t\tinitial,\n\t\t\t\tprevious: {\n\t\t\t\t\tdropTargets: [],\n\t\t\t\t},\n\t\t\t\tcurrent: initial,\n\t\t\t},\n\t\t\tsource: {\n\t\t\t\tdata: draggableData,\n\t\t\t\tdragHandle: null,\n\t\t\t\telement: draggableEl,\n\t\t\t},\n\t\t};\n\t\texpect(draggableOnDragStart).toHaveBeenCalledWith(expected);\n\t\texpect(dropTargetOnDragStart).toHaveBeenCalledWith({\n\t\t\t...expected,\n\t\t\tself: initial.dropTargets[0],\n\t\t});\n\t\texpect(monitorOnDragStart).toHaveBeenCalledWith(expected);\n\t}\n\n\tconst secondInput: Input = {\n\t\t...firstInput,\n\t\tpageX: 10,\n\t};\n\tfireEvent.dragOver(A, secondInput);\n\t// not called until the next frame\n\texpect(draggableOnDrag).not.toHaveBeenCalled();\n\texpect(dropTargetOnDrag).not.toHaveBeenCalled();\n\texpect(monitorOnDrag).not.toHaveBeenCalled();\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\n\t{\n\t\tconst expected: ElementEventPayloadMap['onDrag'] = {\n\t\t\tlocation: {\n\t\t\t\tinitial,\n\t\t\t\tprevious: {\n\t\t\t\t\tdropTargets: initial.dropTargets,\n\t\t\t\t},\n\t\t\t\tcurrent: {\n\t\t\t\t\tdropTargets: initial.dropTargets,\n\t\t\t\t\tinput: secondInput,\n\t\t\t\t},\n\t\t\t},\n\t\t\tsource: {\n\t\t\t\tdata: draggableData,\n\t\t\t\tdragHandle: null,\n\t\t\t\telement: draggableEl,\n\t\t\t},\n\t\t};\n\t\texpect(draggableOnDrag).toHaveBeenCalledWith(expected);\n\t\texpect(dropTargetOnDrag).toHaveBeenCalledWith({\n\t\t\t...expected,\n\t\t\tself: initial.dropTargets[0],\n\t\t});\n\t\texpect(monitorOnDrag).toHaveBeenCalledWith(expected);\n\t}\n\n\t// Leaving A\n\t// [A] -> []\n\tconst thirdInput: Input = {\n\t\t...secondInput,\n\t\tpageX: 15,\n\t};\n\n\tfireEvent.dragEnter(document.body, thirdInput);\n\n\t{\n\t\tconst expected: ElementEventPayloadMap['onDropTargetChange'] = {\n\t\t\tlocation: {\n\t\t\t\tinitial,\n\t\t\t\tprevious: {\n\t\t\t\t\tdropTargets: initial.dropTargets,\n\t\t\t\t},\n\t\t\t\tcurrent: {\n\t\t\t\t\tdropTargets: [],\n\t\t\t\t\tinput: thirdInput,\n\t\t\t\t},\n\t\t\t},\n\t\t\tsource: {\n\t\t\t\tdata: draggableData,\n\t\t\t\tdragHandle: null,\n\t\t\t\telement: draggableEl,\n\t\t\t},\n\t\t};\n\t\texpect(draggableOnDropTargetChange).toHaveBeenCalledWith(expected);\n\t\texpect(dropTargetOnDropTargetChange).toHaveBeenCalledWith({\n\t\t\t...expected,\n\t\t\tself: initial.dropTargets[0],\n\t\t});\n\t\texpect(monitorOnDropTargetChange).toHaveBeenCalledWith(expected);\n\n\t\texpect(draggableOnDropTargetChange).toHaveBeenCalledTimes(1);\n\t\texpect(dropTargetOnDropTargetChange).toHaveBeenCalledTimes(1);\n\t\texpect(monitorOnDropTargetChange).toHaveBeenCalledTimes(1);\n\t}\n\n\t// \"dragleave\" will fire after \"dragenter\"\n\t// this won't result in any pragmatic-dnd events being called\n\tfireEvent.dragLeave(draggableEl);\n\texpect(draggableOnDropTargetChange).toHaveBeenCalledTimes(1);\n\texpect(dropTargetOnDropTargetChange).toHaveBeenCalledTimes(1);\n\texpect(monitorOnDropTargetChange).toHaveBeenCalledTimes(1);\n\n\t// Okay, now we cancel the drag\n\tconst fourthInput = {\n\t\t...thirdInput,\n\t\tpageX: thirdInput.pageX + 1,\n\t};\n\tfireEvent.dragLeave(document.body, fourthInput);\n\tfireEvent.dragEnd(document.body, fourthInput);\n\n\t{\n\t\tconst expected: ElementEventPayloadMap['onDrop'] = {\n\t\t\tlocation: {\n\t\t\t\tinitial,\n\t\t\t\tprevious: {\n\t\t\t\t\tdropTargets: [],\n\t\t\t\t},\n\t\t\t\tcurrent: {\n\t\t\t\t\tdropTargets: [],\n\t\t\t\t\tinput: fourthInput,\n\t\t\t\t},\n\t\t\t},\n\t\t\tsource: {\n\t\t\t\tdata: draggableData,\n\t\t\t\tdragHandle: null,\n\t\t\t\telement: draggableEl,\n\t\t\t},\n\t\t};\n\t\texpect(draggableOnDrop).toHaveBeenCalledWith(expected);\n\t\texpect(monitorOnDrop).toHaveBeenCalledWith(expected);\n\t\t// not dropped on\n\t\texpect(dropTargetOnDrop).not.toHaveBeenCalled();\n\t}\n\n\t// validation\n\texpect(draggableOnGenerateDragPreview).toHaveBeenCalledTimes(1);\n\texpect(draggableOnDragStart).toHaveBeenCalledTimes(1);\n\texpect(draggableOnDrag).toHaveBeenCalledTimes(1);\n\texpect(draggableOnDropTargetChange).toHaveBeenCalledTimes(1);\n\texpect(draggableOnDrop).toHaveBeenCalledTimes(1);\n\texpect(dropTargetOnGenerateDragPreview).toHaveBeenCalledTimes(1);\n\texpect(dropTargetOnDragStart).toHaveBeenCalledTimes(1);\n\texpect(dropTargetOnDrag).toHaveBeenCalledTimes(1);\n\texpect(dropTargetOnDropTargetChange).toHaveBeenCalledTimes(1);\n\t// not dropped on\n\texpect(dropTargetOnDrop).toHaveBeenCalledTimes(0);\n\texpect(monitorOnGenerateDragPreview).toHaveBeenCalledTimes(1);\n\texpect(monitorOnDragStart).toHaveBeenCalledTimes(1);\n\texpect(monitorOnDrag).toHaveBeenCalledTimes(1);\n\texpect(monitorOnDropTargetChange).toHaveBeenCalledTimes(1);\n\texpect(monitorOnDrop).toHaveBeenCalledTimes(1);\n\n\tcleanup();\n});\n\ntest('scenario: [A] -> [A] -> cancel', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tdraggableEl.setAttribute('data-draggable-el', 'true');\n\tA.setAttribute('data-drop-target', 'true');\n\tconst monitorOnGenerateDragPreview = jest.fn();\n\tconst monitorOnDragStart = jest.fn();\n\tconst monitorOnDrag = jest.fn();\n\tconst monitorOnDropTargetChange = jest.fn();\n\tconst monitorOnDrop = jest.fn();\n\tconst dropTargetOnGenerateDragPreview = jest.fn();\n\tconst dropTargetOnDragStart = jest.fn();\n\tconst dropTargetOnDrag = jest.fn();\n\tconst dropTargetOnDropTargetChange = jest.fn();\n\tconst dropTargetOnDrop = jest.fn();\n\tconst draggableOnGenerateDragPreview = jest.fn();\n\tconst draggableOnDragStart = jest.fn();\n\tconst draggableOnDrag = jest.fn();\n\tconst draggableOnDropTargetChange = jest.fn();\n\tconst draggableOnDrop = jest.fn();\n\tconst draggableData = { name: 'Alex' };\n\tconst getInitialData = () => draggableData;\n\tconst dropTargetData = { type: 'Person' };\n\tconst getData = () => dropTargetData;\n\n\tconst firstInput: Input = {\n\t\t...getDefaultInput(),\n\t\tpageX: 5,\n\t};\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tgetData,\n\t\t\tonGenerateDragPreview: dropTargetOnGenerateDragPreview,\n\t\t\tonDragStart: dropTargetOnDragStart,\n\t\t\tonDrag: dropTargetOnDrag,\n\t\t\tonDropTargetChange: dropTargetOnDropTargetChange,\n\t\t\tonDrop: dropTargetOnDrop,\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonGenerateDragPreview: monitorOnGenerateDragPreview,\n\t\t\tonDragStart: monitorOnDragStart,\n\t\t\tonDrag: monitorOnDrag,\n\t\t\tonDropTargetChange: monitorOnDropTargetChange,\n\t\t\tonDrop: monitorOnDrop,\n\t\t}),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tgetInitialData,\n\t\t\tonGenerateDragPreview: draggableOnGenerateDragPreview,\n\t\t\tonDragStart: draggableOnDragStart,\n\t\t\tonDrag: draggableOnDrag,\n\t\t\tonDropTargetChange: draggableOnDropTargetChange,\n\t\t\tonDrop: draggableOnDrop,\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(draggableEl, firstInput);\n\n\tconst initial: DragLocation = {\n\t\tinput: firstInput,\n\t\tdropTargets: [\n\t\t\t{\n\t\t\t\telement: A,\n\t\t\t\tdata: dropTargetData,\n\t\t\t\tisActiveDueToStickiness: false,\n\t\t\t\tdropEffect: 'move',\n\t\t\t},\n\t\t],\n\t};\n\n\t{\n\t\tconst expected: ElementEventPayloadMap['onGenerateDragPreview'] = {\n\t\t\tlocation: {\n\t\t\t\tinitial,\n\t\t\t\tprevious: {\n\t\t\t\t\tdropTargets: [],\n\t\t\t\t},\n\t\t\t\tcurrent: initial,\n\t\t\t},\n\t\t\tsource: {\n\t\t\t\tdata: draggableData,\n\t\t\t\tdragHandle: null,\n\t\t\t\telement: draggableEl,\n\t\t\t},\n\t\t\tnativeSetDragImage: expect.any(Function),\n\t\t};\n\t\texpect(draggableOnGenerateDragPreview).toHaveBeenCalledWith(expected);\n\t\texpect(dropTargetOnGenerateDragPreview).toHaveBeenCalledWith({\n\t\t\t...expected,\n\t\t\tself: initial.dropTargets[0],\n\t\t});\n\t\texpect(monitorOnGenerateDragPreview).toHaveBeenCalledWith(expected);\n\t}\n\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\t{\n\t\tconst expected: ElementEventPayloadMap['onDragStart'] = {\n\t\t\tlocation: {\n\t\t\t\tinitial,\n\t\t\t\tprevious: {\n\t\t\t\t\tdropTargets: [],\n\t\t\t\t},\n\t\t\t\tcurrent: initial,\n\t\t\t},\n\t\t\tsource: {\n\t\t\t\tdata: draggableData,\n\t\t\t\tdragHandle: null,\n\t\t\t\telement: draggableEl,\n\t\t\t},\n\t\t};\n\t\texpect(draggableOnDragStart).toHaveBeenCalledWith(expected);\n\t\texpect(dropTargetOnDragStart).toHaveBeenCalledWith({\n\t\t\t...expected,\n\t\t\tself: initial.dropTargets[0],\n\t\t});\n\t\texpect(monitorOnDragStart).toHaveBeenCalledWith(expected);\n\t}\n\n\t// [A] -> [A]\n\tconst secondInput: Input = {\n\t\t...firstInput,\n\t\tpageX: 10,\n\t};\n\tfireEvent.dragOver(A, secondInput);\n\t// not called until the next frame\n\texpect(draggableOnDrag).not.toHaveBeenCalled();\n\texpect(dropTargetOnDrag).not.toHaveBeenCalled();\n\texpect(monitorOnDrag).not.toHaveBeenCalled();\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\t{\n\t\tconst expected: ElementEventPayloadMap['onDrag'] = {\n\t\t\tlocation: {\n\t\t\t\tinitial,\n\t\t\t\tprevious: {\n\t\t\t\t\tdropTargets: initial.dropTargets,\n\t\t\t\t},\n\t\t\t\tcurrent: {\n\t\t\t\t\tdropTargets: initial.dropTargets,\n\t\t\t\t\tinput: secondInput,\n\t\t\t\t},\n\t\t\t},\n\t\t\tsource: {\n\t\t\t\tdata: draggableData,\n\t\t\t\tdragHandle: null,\n\t\t\t\telement: draggableEl,\n\t\t\t},\n\t\t};\n\t\texpect(draggableOnDrag).toHaveBeenCalledWith(expected);\n\t\texpect(dropTargetOnDrag).toHaveBeenCalledWith({\n\t\t\t...expected,\n\t\t\tself: initial.dropTargets[0],\n\t\t});\n\t\texpect(monitorOnDrag).toHaveBeenCalledWith(expected);\n\t}\n\n\t// Now cancelling the drag. Will cause a \"dragleave\" and and a \"drop\"\n\tconst thirdInput: Input = {\n\t\t...secondInput,\n\t\tpageX: secondInput.pageX + 1,\n\t};\n\tuserEvent.cancel(document.body, thirdInput);\n\n\t// 1. the current drop target [A] will be left\n\t// [A] -> []\n\t{\n\t\tconst expected: ElementEventPayloadMap['onDropTargetChange'] = {\n\t\t\tlocation: {\n\t\t\t\tinitial,\n\t\t\t\t// leaving 'A'\n\t\t\t\tprevious: {\n\t\t\t\t\tdropTargets: initial.dropTargets,\n\t\t\t\t},\n\t\t\t\tcurrent: {\n\t\t\t\t\tdropTargets: [],\n\t\t\t\t\t// input not updated by the \"leave\" event\n\t\t\t\t\tinput: secondInput,\n\t\t\t\t},\n\t\t\t},\n\t\t\tsource: {\n\t\t\t\tdata: draggableData,\n\t\t\t\tdragHandle: null,\n\t\t\t\telement: draggableEl,\n\t\t\t},\n\t\t};\n\t\texpect(draggableOnDropTargetChange).toHaveBeenCalledWith(expected);\n\t\texpect(monitorOnDropTargetChange).toHaveBeenCalledWith(expected);\n\t\t// A is being left\n\t\texpect(dropTargetOnDropTargetChange).toHaveBeenCalledWith({\n\t\t\t...expected,\n\t\t\tself: initial.dropTargets[0],\n\t\t});\n\t}\n\n\t{\n\t\tconst expected: ElementEventPayloadMap['onDrop'] = {\n\t\t\tlocation: {\n\t\t\t\tinitial,\n\t\t\t\tprevious: {\n\t\t\t\t\t// This points to the dropTargets in the `onDropTargetChange` event\n\t\t\t\t\t// which cleared the drop targets\n\t\t\t\t\tdropTargets: [],\n\t\t\t\t},\n\t\t\t\tcurrent: {\n\t\t\t\t\tdropTargets: [],\n\t\t\t\t\t// the \"drop\" updates the input\n\t\t\t\t\tinput: thirdInput,\n\t\t\t\t},\n\t\t\t},\n\t\t\tsource: {\n\t\t\t\tdata: draggableData,\n\t\t\t\tdragHandle: null,\n\t\t\t\telement: draggableEl,\n\t\t\t},\n\t\t};\n\t\texpect(draggableOnDrop).toHaveBeenCalledWith(expected);\n\t\texpect(monitorOnDrop).toHaveBeenCalledWith(expected);\n\t\t// not dropped on\n\t\texpect(dropTargetOnDrop).not.toHaveBeenCalled();\n\t}\n\n\t// validation\n\texpect(draggableOnGenerateDragPreview).toHaveBeenCalledTimes(1);\n\texpect(draggableOnDragStart).toHaveBeenCalledTimes(1);\n\texpect(draggableOnDrag).toHaveBeenCalledTimes(1);\n\texpect(draggableOnDropTargetChange).toHaveBeenCalledTimes(1);\n\texpect(draggableOnDrop).toHaveBeenCalledTimes(1);\n\texpect(dropTargetOnGenerateDragPreview).toHaveBeenCalledTimes(1);\n\texpect(dropTargetOnDragStart).toHaveBeenCalledTimes(1);\n\texpect(dropTargetOnDrag).toHaveBeenCalledTimes(1);\n\texpect(dropTargetOnDropTargetChange).toHaveBeenCalledTimes(1);\n\t// not dropped on\n\texpect(dropTargetOnDrop).toHaveBeenCalledTimes(0);\n\texpect(monitorOnGenerateDragPreview).toHaveBeenCalledTimes(1);\n\texpect(monitorOnDragStart).toHaveBeenCalledTimes(1);\n\texpect(monitorOnDrag).toHaveBeenCalledTimes(1);\n\texpect(monitorOnDropTargetChange).toHaveBeenCalledTimes(1);\n\texpect(monitorOnDrop).toHaveBeenCalledTimes(1);\n\n\tcleanup();\n});\n\ntest('scenario: [B, A] -> [A] -> drop', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tdraggableEl.setAttribute('data-draggable-el', 'true');\n\tA.setAttribute('data-drop-target', 'true');\n\tconst monitorOnGenerateDragPreview = jest.fn();\n\tconst monitorOnDragStart = jest.fn();\n\tconst monitorOnDrag = jest.fn();\n\tconst monitorOnDropTargetChange = jest.fn();\n\tconst monitorOnDrop = jest.fn();\n\tconst AOnGenerateDragPreview = jest.fn();\n\tconst AOnDragStart = jest.fn();\n\tconst AOnDrag = jest.fn();\n\tconst AOnDropTargetChange = jest.fn();\n\tconst AOnDrop = jest.fn();\n\tconst BOnGenerateDragPreview = jest.fn();\n\tconst BOnDragStart = jest.fn();\n\tconst BOnDrag = jest.fn();\n\tconst BOnDropTargetChange = jest.fn();\n\tconst BOnDrop = jest.fn();\n\tconst draggableOnGenerateDragPreview = jest.fn();\n\tconst draggableOnDragStart = jest.fn();\n\tconst draggableOnDrag = jest.fn();\n\tconst draggableOnDropTargetChange = jest.fn();\n\tconst draggableOnDrop = jest.fn();\n\tconst draggableData = { name: 'Alex' };\n\tconst getInitialData = () => draggableData;\n\tconst AData = { type: 'A' };\n\tconst BData = { type: 'B' };\n\n\tconst firstInput: Input = {\n\t\t...getDefaultInput(),\n\t\tpageX: 5,\n\t};\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tgetData: () => AData,\n\t\t\tonGenerateDragPreview: AOnGenerateDragPreview,\n\t\t\tonDragStart: AOnDragStart,\n\t\t\tonDrag: AOnDrag,\n\t\t\tonDropTargetChange: AOnDropTargetChange,\n\t\t\tonDrop: AOnDrop,\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t\tgetData: () => BData,\n\t\t\tonGenerateDragPreview: BOnGenerateDragPreview,\n\t\t\tonDragStart: BOnDragStart,\n\t\t\tonDrag: BOnDrag,\n\t\t\tonDropTargetChange: BOnDropTargetChange,\n\t\t\tonDrop: BOnDrop,\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonGenerateDragPreview: monitorOnGenerateDragPreview,\n\t\t\tonDragStart: monitorOnDragStart,\n\t\t\tonDrag: monitorOnDrag,\n\t\t\tonDropTargetChange: monitorOnDropTargetChange,\n\t\t\tonDrop: monitorOnDrop,\n\t\t}),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tgetInitialData,\n\t\t\tonGenerateDragPreview: draggableOnGenerateDragPreview,\n\t\t\tonDragStart: draggableOnDragStart,\n\t\t\tonDrag: draggableOnDrag,\n\t\t\tonDropTargetChange: draggableOnDropTargetChange,\n\t\t\tonDrop: draggableOnDrop,\n\t\t}),\n\t);\n\n\t// Lifting in [B, A]\n\tfireEvent.dragStart(draggableEl, firstInput);\n\n\tconst initial: DragLocation = {\n\t\tinput: firstInput,\n\t\tdropTargets: [\n\t\t\t{\n\t\t\t\telement: B,\n\t\t\t\tdata: BData,\n\t\t\t\tisActiveDueToStickiness: false,\n\t\t\t\tdropEffect: 'move',\n\t\t\t},\n\t\t\t{\n\t\t\t\telement: A,\n\t\t\t\tdata: AData,\n\t\t\t\tisActiveDueToStickiness: false,\n\t\t\t\tdropEffect: 'move',\n\t\t\t},\n\t\t],\n\t};\n\n\t{\n\t\tconst expected: ElementEventPayloadMap['onGenerateDragPreview'] = {\n\t\t\tlocation: {\n\t\t\t\tinitial,\n\t\t\t\tprevious: {\n\t\t\t\t\tdropTargets: [],\n\t\t\t\t},\n\t\t\t\tcurrent: initial,\n\t\t\t},\n\t\t\tsource: {\n\t\t\t\tdata: draggableData,\n\t\t\t\tdragHandle: null,\n\t\t\t\telement: draggableEl,\n\t\t\t},\n\t\t\tnativeSetDragImage: expect.any(Function),\n\t\t};\n\t\texpect(draggableOnGenerateDragPreview).toHaveBeenCalledWith(expected);\n\t\texpect(BOnGenerateDragPreview).toHaveBeenCalledWith({\n\t\t\t...expected,\n\t\t\tself: initial.dropTargets[0],\n\t\t});\n\t\texpect(AOnGenerateDragPreview).toHaveBeenCalledWith({\n\t\t\t...expected,\n\t\t\tself: initial.dropTargets[1],\n\t\t});\n\n\t\texpect(monitorOnGenerateDragPreview).toHaveBeenCalledWith(expected);\n\t}\n\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\t{\n\t\tconst expected: ElementEventPayloadMap['onDragStart'] = {\n\t\t\tlocation: {\n\t\t\t\tinitial,\n\t\t\t\tprevious: {\n\t\t\t\t\tdropTargets: [],\n\t\t\t\t},\n\t\t\t\tcurrent: initial,\n\t\t\t},\n\t\t\tsource: {\n\t\t\t\tdata: draggableData,\n\t\t\t\tdragHandle: null,\n\t\t\t\telement: draggableEl,\n\t\t\t},\n\t\t};\n\t\texpect(draggableOnDragStart).toHaveBeenCalledWith(expected);\n\t\texpect(BOnDragStart).toHaveBeenCalledWith({\n\t\t\t...expected,\n\t\t\tself: initial.dropTargets[0],\n\t\t});\n\t\texpect(AOnDragStart).toHaveBeenCalledWith({\n\t\t\t...expected,\n\t\t\tself: initial.dropTargets[1],\n\t\t});\n\t\texpect(monitorOnDragStart).toHaveBeenCalledWith(expected);\n\t}\n\n\t// [B, A] -> [A]\n\tconst secondInput: Input = {\n\t\t...firstInput,\n\t\tpageX: 10,\n\t};\n\tfireEvent.dragEnter(A, secondInput);\n\t{\n\t\tconst expected: ElementEventPayloadMap['onDropTargetChange'] = {\n\t\t\tlocation: {\n\t\t\t\tinitial,\n\t\t\t\tprevious: {\n\t\t\t\t\tdropTargets: initial.dropTargets,\n\t\t\t\t},\n\t\t\t\tcurrent: {\n\t\t\t\t\t// now only over A\n\t\t\t\t\tdropTargets: [initial.dropTargets[1]],\n\t\t\t\t\tinput: secondInput,\n\t\t\t\t},\n\t\t\t},\n\t\t\tsource: {\n\t\t\t\tdata: draggableData,\n\t\t\t\tdragHandle: null,\n\t\t\t\telement: draggableEl,\n\t\t\t},\n\t\t};\n\t\texpect(draggableOnDropTargetChange).toHaveBeenCalledWith(expected);\n\t\texpect(BOnDropTargetChange).toHaveBeenCalledWith({\n\t\t\t...expected,\n\t\t\tself: initial.dropTargets[0],\n\t\t});\n\t\texpect(AOnDropTargetChange).toHaveBeenCalledWith({\n\t\t\t...expected,\n\t\t\tself: initial.dropTargets[1],\n\t\t});\n\t\texpect(monitorOnDropTargetChange).toHaveBeenCalledWith(expected);\n\t}\n\n\t// [A] -> drop\n\tconst thirdInput: Input = {\n\t\t...firstInput,\n\t\tpageX: 11,\n\t};\n\n\tfireEvent.drop(A, thirdInput);\n\n\t{\n\t\tconst expected: ElementEventPayloadMap['onDrop'] = {\n\t\t\tlocation: {\n\t\t\t\tinitial,\n\t\t\t\t// Previous points to our last `onDropTargetChange`\n\t\t\t\tprevious: {\n\t\t\t\t\t// [A]\n\t\t\t\t\tdropTargets: [initial.dropTargets[1]],\n\t\t\t\t},\n\t\t\t\tcurrent: {\n\t\t\t\t\t// [A]\n\t\t\t\t\tdropTargets: [initial.dropTargets[1]],\n\t\t\t\t\t// input recaptured in \"drop\"\n\t\t\t\t\tinput: thirdInput,\n\t\t\t\t},\n\t\t\t},\n\t\t\tsource: {\n\t\t\t\tdata: draggableData,\n\t\t\t\tdragHandle: null,\n\t\t\t\telement: draggableEl,\n\t\t\t},\n\t\t};\n\t\texpect(draggableOnDrop).toHaveBeenCalledWith(expected);\n\t\texpect(monitorOnDrop).toHaveBeenCalledWith(expected);\n\t\texpect(AOnDrop).toHaveBeenCalledWith({\n\t\t\t...expected,\n\t\t\tself: initial.dropTargets[1],\n\t\t});\n\t\texpect(BOnDrop).not.toHaveBeenCalledWith();\n\t}\n\n\t// validation\n\texpect(draggableOnGenerateDragPreview).toHaveBeenCalledTimes(1);\n\texpect(AOnGenerateDragPreview).toHaveBeenCalledTimes(1);\n\texpect(monitorOnGenerateDragPreview).toHaveBeenCalledTimes(1);\n\n\texpect(draggableOnDragStart).toHaveBeenCalledTimes(1);\n\texpect(AOnDragStart).toHaveBeenCalledTimes(1);\n\texpect(monitorOnDragStart).toHaveBeenCalledTimes(1);\n\n\t// no drags\n\texpect(draggableOnDrag).toHaveBeenCalledTimes(0);\n\texpect(AOnDrag).toHaveBeenCalledTimes(0);\n\texpect(monitorOnDrag).toHaveBeenCalledTimes(0);\n\n\t// [A] => []\n\texpect(draggableOnDropTargetChange).toHaveBeenCalledTimes(1);\n\texpect(AOnDropTargetChange).toHaveBeenCalledTimes(1);\n\texpect(monitorOnDropTargetChange).toHaveBeenCalledTimes(1);\n\n\t// we had a drop on [A]\n\texpect(draggableOnDrop).toHaveBeenCalledTimes(1);\n\texpect(BOnDrop).not.toHaveBeenCalledTimes(1);\n\texpect(AOnDrop).toHaveBeenCalledTimes(1);\n\texpect(monitorOnDrop).toHaveBeenCalledTimes(1);\n\n\tcleanup();\n});\n\ntest('scenario: [A] -> [A] -> drop', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tdraggableEl.setAttribute('data-draggable-el', 'true');\n\tA.setAttribute('data-drop-target', 'true');\n\tconst monitorOnGenerateDragPreview = jest.fn();\n\tconst monitorOnDragStart = jest.fn();\n\tconst monitorOnDrag = jest.fn();\n\tconst monitorOnDropTargetChange = jest.fn();\n\tconst monitorOnDrop = jest.fn();\n\tconst dropTargetOnGenerateDragPreview = jest.fn();\n\tconst dropTargetOnDragStart = jest.fn();\n\tconst dropTargetOnDrag = jest.fn();\n\tconst dropTargetOnDropTargetChange = jest.fn();\n\tconst dropTargetOnDrop = jest.fn();\n\tconst draggableOnGenerateDragPreview = jest.fn();\n\tconst draggableOnDragStart = jest.fn();\n\tconst draggableOnDrag = jest.fn();\n\tconst draggableOnDropTargetChange = jest.fn();\n\tconst draggableOnDrop = jest.fn();\n\tconst draggableData = { name: 'Alex' };\n\tconst getInitialData = () => draggableData;\n\tconst dropTargetData = { type: 'Person' };\n\tconst getData = () => dropTargetData;\n\n\tconst firstInput: Input = {\n\t\t...getDefaultInput(),\n\t\tpageX: 5,\n\t};\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tgetData,\n\t\t\tonGenerateDragPreview: dropTargetOnGenerateDragPreview,\n\t\t\tonDragStart: dropTargetOnDragStart,\n\t\t\tonDrag: dropTargetOnDrag,\n\t\t\tonDropTargetChange: dropTargetOnDropTargetChange,\n\t\t\tonDrop: dropTargetOnDrop,\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonGenerateDragPreview: monitorOnGenerateDragPreview,\n\t\t\tonDragStart: monitorOnDragStart,\n\t\t\tonDrag: monitorOnDrag,\n\t\t\tonDropTargetChange: monitorOnDropTargetChange,\n\t\t\tonDrop: monitorOnDrop,\n\t\t}),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tgetInitialData,\n\t\t\tonGenerateDragPreview: draggableOnGenerateDragPreview,\n\t\t\tonDragStart: draggableOnDragStart,\n\t\t\tonDrag: draggableOnDrag,\n\t\t\tonDropTargetChange: draggableOnDropTargetChange,\n\t\t\tonDrop: draggableOnDrop,\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(draggableEl, firstInput);\n\n\tconst initial: DragLocation = {\n\t\tinput: firstInput,\n\t\tdropTargets: [\n\t\t\t{\n\t\t\t\telement: A,\n\t\t\t\tdata: dropTargetData,\n\t\t\t\tisActiveDueToStickiness: false,\n\t\t\t\tdropEffect: 'move',\n\t\t\t},\n\t\t],\n\t};\n\n\t{\n\t\tconst expected: ElementEventPayloadMap['onGenerateDragPreview'] = {\n\t\t\tlocation: {\n\t\t\t\tinitial,\n\t\t\t\tprevious: {\n\t\t\t\t\tdropTargets: [],\n\t\t\t\t},\n\t\t\t\tcurrent: initial,\n\t\t\t},\n\t\t\tsource: {\n\t\t\t\tdata: draggableData,\n\t\t\t\tdragHandle: null,\n\t\t\t\telement: draggableEl,\n\t\t\t},\n\t\t\tnativeSetDragImage: expect.any(Function),\n\t\t};\n\t\texpect(draggableOnGenerateDragPreview).toHaveBeenCalledWith(expected);\n\t\texpect(dropTargetOnGenerateDragPreview).toHaveBeenCalledWith({\n\t\t\t...expected,\n\t\t\tself: initial.dropTargets[0],\n\t\t});\n\t\texpect(monitorOnGenerateDragPreview).toHaveBeenCalledWith(expected);\n\t}\n\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\t{\n\t\tconst expected: ElementEventPayloadMap['onDragStart'] = {\n\t\t\tlocation: {\n\t\t\t\tinitial,\n\t\t\t\tprevious: {\n\t\t\t\t\tdropTargets: [],\n\t\t\t\t},\n\t\t\t\tcurrent: initial,\n\t\t\t},\n\t\t\tsource: {\n\t\t\t\tdata: draggableData,\n\t\t\t\tdragHandle: null,\n\t\t\t\telement: draggableEl,\n\t\t\t},\n\t\t};\n\t\texpect(draggableOnDragStart).toHaveBeenCalledWith(expected);\n\t\texpect(dropTargetOnDragStart).toHaveBeenCalledWith({\n\t\t\t...expected,\n\t\t\tself: initial.dropTargets[0],\n\t\t});\n\t\texpect(monitorOnDragStart).toHaveBeenCalledWith(expected);\n\t}\n\n\t// [A] -> [A]\n\tconst secondInput: Input = {\n\t\t...firstInput,\n\t\tpageX: 10,\n\t};\n\tfireEvent.dragOver(A, secondInput);\n\t// not called until the next frame\n\texpect(draggableOnDrag).not.toHaveBeenCalled();\n\texpect(dropTargetOnDrag).not.toHaveBeenCalled();\n\texpect(monitorOnDrag).not.toHaveBeenCalled();\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\t{\n\t\tconst expected: ElementEventPayloadMap['onDrag'] = {\n\t\t\tlocation: {\n\t\t\t\tinitial,\n\t\t\t\tprevious: {\n\t\t\t\t\tdropTargets: initial.dropTargets,\n\t\t\t\t},\n\t\t\t\tcurrent: {\n\t\t\t\t\tdropTargets: initial.dropTargets,\n\t\t\t\t\tinput: secondInput,\n\t\t\t\t},\n\t\t\t},\n\t\t\tsource: {\n\t\t\t\tdata: draggableData,\n\t\t\t\tdragHandle: null,\n\t\t\t\telement: draggableEl,\n\t\t\t},\n\t\t};\n\t\texpect(draggableOnDrag).toHaveBeenCalledWith(expected);\n\t\texpect(dropTargetOnDrag).toHaveBeenCalledWith({\n\t\t\t...expected,\n\t\t\tself: initial.dropTargets[0],\n\t\t});\n\t\texpect(monitorOnDrag).toHaveBeenCalledWith(expected);\n\t}\n\n\tconst thirdInput: Input = {\n\t\t...secondInput,\n\t\tpageX: secondInput.pageX + 1,\n\t};\n\n\t// [A] -> drop\n\tuserEvent.drop(A, thirdInput);\n\n\t{\n\t\tconst expected: ElementEventPayloadMap['onDrop'] = {\n\t\t\tlocation: {\n\t\t\t\tinitial,\n\t\t\t\tprevious: {\n\t\t\t\t\tdropTargets: initial.dropTargets,\n\t\t\t\t},\n\t\t\t\tcurrent: {\n\t\t\t\t\tdropTargets: initial.dropTargets,\n\t\t\t\t\tinput: thirdInput,\n\t\t\t\t},\n\t\t\t},\n\t\t\tsource: {\n\t\t\t\tdata: draggableData,\n\t\t\t\tdragHandle: null,\n\t\t\t\telement: draggableEl,\n\t\t\t},\n\t\t};\n\t\texpect(draggableOnDrop).toHaveBeenCalledWith(expected);\n\t\texpect(monitorOnDrop).toHaveBeenCalledWith(expected);\n\t\texpect(dropTargetOnDrop).toHaveBeenCalledWith({\n\t\t\t...expected,\n\t\t\tself: initial.dropTargets[0],\n\t\t});\n\t}\n\n\t// validation\n\texpect(draggableOnGenerateDragPreview).toHaveBeenCalledTimes(1);\n\texpect(draggableOnDragStart).toHaveBeenCalledTimes(1);\n\texpect(draggableOnDrag).toHaveBeenCalledTimes(1);\n\texpect(draggableOnDropTargetChange).toHaveBeenCalledTimes(0);\n\texpect(draggableOnDrop).toHaveBeenCalledTimes(1);\n\texpect(dropTargetOnGenerateDragPreview).toHaveBeenCalledTimes(1);\n\texpect(dropTargetOnDragStart).toHaveBeenCalledTimes(1);\n\texpect(dropTargetOnDrag).toHaveBeenCalledTimes(1);\n\texpect(dropTargetOnDropTargetChange).toHaveBeenCalledTimes(0);\n\texpect(dropTargetOnDrop).toHaveBeenCalledTimes(1);\n\texpect(monitorOnGenerateDragPreview).toHaveBeenCalledTimes(1);\n\texpect(monitorOnDragStart).toHaveBeenCalledTimes(1);\n\texpect(monitorOnDrag).toHaveBeenCalledTimes(1);\n\texpect(monitorOnDropTargetChange).toHaveBeenCalledTimes(0);\n\texpect(monitorOnDrop).toHaveBeenCalledTimes(1);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/event-ordering/drag-start-flushing.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport { draggable, dropTargetForElements } from '../../../../src/entry-point/element/adapter';\nimport { appendToBody, getBubbleOrderedTree, getDefaultInput, reset, userEvent } from '../../_util';\n\nafterEach(reset);\n\ntest('scenario:start flushed by a drop', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('a:preview'),\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDrop: () => ordered.push('a:drop'),\n\t\t\tonDrag: () => ordered.push('a:drag'),\n\t\t\tonDropTargetChange: () => ordered.push('a:change'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t\tonDrag: () => ordered.push('draggable:drag'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t}),\n\t);\n\n\t// start a lift\n\tfireEvent.dragStart(draggableEl);\n\t// 'start' event is still pending until the next animation frame\n\texpect(ordered).toEqual(['draggable:preview', 'a:preview']);\n\tordered.length = 0;\n\n\tuserEvent.drop(A);\n\texpect(ordered).toEqual([\n\t\t// start event flushed\n\t\t'draggable:start',\n\t\t'a:start',\n\t\t// drop event\n\t\t'draggable:drop',\n\t\t'a:drop',\n\t]);\n\n\tcleanup();\n});\n\ntest('scenario:start flushed by a cancel', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('a:preview'),\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDrop: () => ordered.push('a:drop'),\n\t\t\tonDrag: () => ordered.push('a:drag'),\n\t\t\tonDropTargetChange: () => ordered.push('a:change'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t\tonDrag: () => ordered.push('draggable:drag'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t}),\n\t);\n\n\t// start a lift\n\tfireEvent.dragStart(draggableEl);\n\t// 'start' event is still pending until the next animation frame\n\texpect(ordered).toEqual(['draggable:preview', 'a:preview']);\n\tordered.length = 0;\n\n\tuserEvent.cancel();\n\texpect(ordered).toEqual([\n\t\t// start event flushed\n\t\t'draggable:start',\n\t\t'a:start',\n\t\t// leaving A caused by cancel\n\t\t'draggable:change',\n\t\t'a:change',\n\t\t'a:leave',\n\t\t// drop event (won't be dropped in A)\n\t\t'draggable:drop',\n\t]);\n\n\tcleanup();\n});\n\ntest('scenario:start flushed by a drop target change', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('a:preview'),\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDrop: () => ordered.push('a:drop'),\n\t\t\tonDrag: () => ordered.push('a:drag'),\n\t\t\tonDropTargetChange: () => ordered.push('a:change'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t\tonDrag: () => ordered.push('draggable:drag'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t}),\n\t);\n\n\t// start a lift\n\tfireEvent.dragStart(draggableEl);\n\t// 'start' event is still pending until the next animation frame\n\texpect(ordered).toEqual(['draggable:preview', 'a:preview']);\n\tordered.length = 0;\n\n\t// [A] => []\n\tfireEvent.dragEnter(document.body);\n\n\texpect(ordered).toEqual([\n\t\t// start event flushed\n\t\t'draggable:start',\n\t\t'a:start',\n\t\t// leaving A\n\t\t'draggable:change',\n\t\t'a:change',\n\t\t'a:leave',\n\t]);\n\tordered.length = 0;\n\n\t// [] -> cancel\n\tfireEvent.dragEnd(document.body);\n\texpect(ordered).toEqual(['draggable:drop']);\n\n\tcleanup();\n});\n\ntest('scenario:start flushed by a (throttled) drag', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('a:preview'),\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDrop: () => ordered.push('a:drop'),\n\t\t\tonDrag: () => ordered.push('a:drag'),\n\t\t\tonDropTargetChange: () => ordered.push('a:change'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t\tonDrag: () => ordered.push('draggable:drag'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t}),\n\t);\n\n\t// start a lift\n\tfireEvent.dragStart(draggableEl);\n\t// 'start' event is still pending until the next animation frame\n\texpect(ordered).toEqual(['draggable:preview', 'a:preview']);\n\tordered.length = 0;\n\n\t// continuing to drag over A\n\tfireEvent.dragOver(A, getDefaultInput({ clientX: 10 }));\n\tfireEvent.dragOver(A, getDefaultInput({ clientX: 11 }));\n\tfireEvent.dragOver(A, getDefaultInput({ clientX: 12 }));\n\n\t// no immediate impact because drag events are throttled into the next frame\n\texpect(ordered).toEqual([]);\n\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual([\n\t\t// start flushed\n\t\t'draggable:start',\n\t\t'a:start',\n\t\t// single drag event\n\t\t'draggable:drag',\n\t\t'a:drag',\n\t]);\n\tordered.length = 0;\n\n\t// [A] -> drop\n\tuserEvent.drop(A);\n\texpect(ordered).toEqual(['draggable:drop', 'a:drop']);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/event-ordering/drag-start.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\tmonitorForElements,\n} from '../../../../src/entry-point/element/adapter';\nimport { appendToBody, getBubbleOrderedTree, reset } from '../../_util';\n\nafterEach(reset);\n\ntest('should notify the source draggable, drop targets in bubble order, then monitors in bind order', () => {\n\tconst [draggableEl, child, parent] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(parent),\n\t\tmonitorForElements({\n\t\t\tonDragStart: () => ordered.push('monitor1'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: parent,\n\t\t\tonDragStart: () => ordered.push('parent:start'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonDragStart: () => ordered.push('child:start'),\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonDragStart: () => ordered.push('monitor2'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(draggableEl);\n\n\t// dragStart fires after an animation frame\n\texpect(ordered).toEqual([]);\n\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual([\n\t\t// draggable source\n\t\t'draggable',\n\t\t// bubble ordered drop targets\n\t\t'child:start',\n\t\t'parent:start',\n\t\t// monitors ordered in bind order\n\t\t'monitor1',\n\t\t'monitor2',\n\t]);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/event-ordering/drag-update-atomic.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\tmonitorForElements,\n} from '../../../../src/entry-point/element/adapter';\nimport { appendToBody, getElements, reset } from '../../_util';\n\nafterEach(reset);\n\nconst triggers = [\n\t{\n\t\tname: 'dragenter',\n\t\tfire: (element: Element) => fireEvent.dragEnter(element),\n\t},\n\t{\n\t\tname: 'dragover',\n\t\tfire: (element: Element) => fireEvent.dragOver(element),\n\t},\n];\n\ntriggers.forEach((trigger) => {\n\tdescribe(`update trigger: ${trigger.name}`, () => {\n\t\ttest('scenario: [] -> [] should not update', () => {\n\t\t\tconst [draggableEl, A, B] = getElements('div');\n\t\t\tA.appendChild(B);\n\t\t\tconst started: string[] = [];\n\t\t\tconst ordered: string[] = [];\n\n\t\t\tconst cleanup = combine(\n\t\t\t\tappendToBody(A, draggableEl),\n\t\t\t\tdraggable({\n\t\t\t\t\telement: draggableEl,\n\t\t\t\t\tonDragStart: () => started.push('draggable:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t\t\t}),\n\t\t\t\tmonitorForElements({\n\t\t\t\t\tonDragStart: () => started.push('monitor:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('monitor:update'),\n\t\t\t\t}),\n\t\t\t\tdropTargetForElements({\n\t\t\t\t\telement: A,\n\t\t\t\t\tonDragStart: () => started.push('a:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\t\t}),\n\t\t\t\tdropTargetForElements({\n\t\t\t\t\telement: B,\n\t\t\t\t\tonDragStart: () => started.push('b:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\t\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t\t\t}),\n\t\t\t);\n\n\t\t\tfireEvent.dragStart(draggableEl);\n\t\t\t// @ts-ignore\n\t\t\trequestAnimationFrame.step();\n\n\t\t\t// draggable does not start inside any drop target\n\t\t\texpect(started).toEqual(['draggable:start', 'monitor:start']);\n\n\t\t\t// not going over anything\n\t\t\ttrigger.fire(document.body);\n\t\t\texpect(ordered).toEqual([]);\n\n\t\t\t// nothing has changed, so no update should be fired\n\t\t\ttrigger.fire(document.body);\n\t\t\texpect(ordered).toEqual([]);\n\n\t\t\tcleanup();\n\t\t});\n\n\t\ttest('scenario: [B, A] -> [B, A] should not update', () => {\n\t\t\tconst [draggableEl, A, B] = getElements('div');\n\t\t\tA.appendChild(B);\n\t\t\tconst started: string[] = [];\n\t\t\tconst ordered: string[] = [];\n\n\t\t\tconst cleanup = combine(\n\t\t\t\tappendToBody(A, draggableEl),\n\t\t\t\tdraggable({\n\t\t\t\t\telement: draggableEl,\n\t\t\t\t\tonDragStart: () => started.push('draggable:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t\t\t}),\n\t\t\t\tmonitorForElements({\n\t\t\t\t\tonDragStart: () => started.push('monitor:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('monitor:update'),\n\t\t\t\t}),\n\t\t\t\tdropTargetForElements({\n\t\t\t\t\telement: A,\n\t\t\t\t\tonDragStart: () => started.push('a:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\t\t}),\n\t\t\t\tdropTargetForElements({\n\t\t\t\t\telement: B,\n\t\t\t\t\tonDragStart: () => started.push('b:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\t\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t\t\t}),\n\t\t\t);\n\n\t\t\tfireEvent.dragStart(draggableEl);\n\t\t\t// @ts-ignore\n\t\t\trequestAnimationFrame.step();\n\n\t\t\t// draggable does not start inside any drop target\n\t\t\texpect(started).toEqual(['draggable:start', 'monitor:start']);\n\n\t\t\ttrigger.fire(B);\n\t\t\texpect(ordered).toEqual([\n\t\t\t\t'draggable:update',\n\t\t\t\t'b:update',\n\t\t\t\t'b:enter',\n\t\t\t\t'a:update',\n\t\t\t\t'a:enter',\n\t\t\t\t'monitor:update',\n\t\t\t]);\n\t\t\t// resetting\n\t\t\tordered.length = 0;\n\n\t\t\ttrigger.fire(B);\n\n\t\t\t// nothing has changed, so no update should be fired\n\t\t\texpect(ordered).toEqual([]);\n\n\t\t\tcleanup();\n\t\t});\n\t});\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/event-ordering/drag-update.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\tmonitorForElements,\n} from '../../../../src/entry-point/element/adapter';\nimport { appendToBody, getBubbleOrderedTree, getElements, reset, userEvent } from '../../_util';\n\nafterEach(reset);\n\nconst triggers = [\n\t{\n\t\tname: 'dragenter',\n\t\tfireOver: (element: Element) => fireEvent.dragEnter(element),\n\t},\n\t{\n\t\tname: 'dragover',\n\t\tfireOver: (element: Element) => fireEvent.dragOver(element),\n\t},\n];\n\ntriggers.forEach((trigger) => {\n\tdescribe(`update trigger: ${trigger.name}`, () => {\n\t\ttest('scenario: [] -> [B, A]', () => {\n\t\t\tconst [draggableEl, A, B] = getElements('div');\n\t\t\tA.appendChild(B);\n\t\t\tconst ordered: string[] = [];\n\n\t\t\tconst cleanup = combine(\n\t\t\t\tappendToBody(A, draggableEl),\n\t\t\t\tdraggable({\n\t\t\t\t\telement: draggableEl,\n\t\t\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t\t\t}),\n\t\t\t\tmonitorForElements({\n\t\t\t\t\tonDropTargetChange: () => ordered.push('monitor:update'),\n\t\t\t\t}),\n\t\t\t\tdropTargetForElements({\n\t\t\t\t\telement: A,\n\t\t\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\t\t}),\n\t\t\t\tdropTargetForElements({\n\t\t\t\t\telement: B,\n\t\t\t\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\t\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t\t\t}),\n\t\t\t);\n\n\t\t\tuserEvent.lift(draggableEl);\n\n\t\t\ttrigger.fireOver(B);\n\n\t\t\t// bubble ordering\n\t\t\texpect(ordered).toEqual([\n\t\t\t\t'draggable:update',\n\t\t\t\t'b:update',\n\t\t\t\t'b:enter',\n\t\t\t\t'a:update',\n\t\t\t\t'a:enter',\n\t\t\t\t'monitor:update',\n\t\t\t]);\n\n\t\t\tcleanup();\n\t\t});\n\n\t\ttest('scenario: [B, A] -> []', () => {\n\t\t\tconst [draggableEl, A, B] = getElements('div');\n\t\t\tA.appendChild(B);\n\t\t\tB.appendChild(draggableEl);\n\t\t\tconst started: string[] = [];\n\t\t\tconst ordered: string[] = [];\n\n\t\t\tconst cleanup = combine(\n\t\t\t\tappendToBody(A),\n\t\t\t\tdraggable({\n\t\t\t\t\telement: draggableEl,\n\t\t\t\t\tonDragStart: () => started.push('draggable:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t\t\t}),\n\t\t\t\tmonitorForElements({\n\t\t\t\t\tonDragStart: () => started.push('monitor:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('monitor:update'),\n\t\t\t\t}),\n\t\t\t\tdropTargetForElements({\n\t\t\t\t\telement: A,\n\t\t\t\t\tonDragStart: () => started.push('a:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\t\t}),\n\t\t\t\tdropTargetForElements({\n\t\t\t\t\telement: B,\n\t\t\t\t\tonDragStart: () => started.push('b:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\t\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t\t\t}),\n\t\t\t);\n\n\t\t\tuserEvent.lift(draggableEl);\n\n\t\t\t// asserting start order [B, A]\n\t\t\texpect(started).toEqual(['draggable:start', 'b:start', 'a:start', 'monitor:start']);\n\n\t\t\t// no update events yet\n\t\t\texpect(ordered).toEqual([]);\n\n\t\t\t// [B, A] -> []\n\t\t\ttrigger.fireOver(document.body);\n\n\t\t\texpect(ordered).toEqual([\n\t\t\t\t'draggable:update',\n\t\t\t\t// starts by doing all events on previous drop targets\n\t\t\t\t'b:update',\n\t\t\t\t'b:leave',\n\t\t\t\t'a:update',\n\t\t\t\t'a:leave',\n\t\t\t\t'monitor:update',\n\t\t\t]);\n\n\t\t\tcleanup();\n\t\t});\n\n\t\ttest('scenario: [B, A] -> [C, A]', () => {\n\t\t\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\t\t\tconst [C] = getElements('div');\n\t\t\tA.appendChild(C);\n\t\t\tconst ordered: string[] = [];\n\n\t\t\tconst cleanup = combine(\n\t\t\t\tappendToBody(A),\n\t\t\t\tdraggable({\n\t\t\t\t\telement: draggableEl,\n\t\t\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t\t\t}),\n\t\t\t\tmonitorForElements({\n\t\t\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('monitor:update'),\n\t\t\t\t}),\n\t\t\t\tdropTargetForElements({\n\t\t\t\t\telement: A,\n\t\t\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\t\t}),\n\t\t\t\tdropTargetForElements({\n\t\t\t\t\telement: B,\n\t\t\t\t\tonDragStart: () => ordered.push('b:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\t\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t\t\t}),\n\t\t\t\tdropTargetForElements({\n\t\t\t\t\telement: C,\n\t\t\t\t\tonDragStart: () => ordered.push('c:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('c:update'),\n\t\t\t\t\tonDragEnter: () => ordered.push('c:enter'),\n\t\t\t\t\tonDragLeave: () => ordered.push('c:leave'),\n\t\t\t\t}),\n\t\t\t);\n\n\t\t\tuserEvent.lift(draggableEl);\n\n\t\t\t// asserting start order [B, A]\n\t\t\texpect(ordered).toEqual(['draggable:start', 'b:start', 'a:start', 'monitor:start']);\n\t\t\tordered.length = 0;\n\n\t\t\t// [B, A] -> [C, A]\n\t\t\ttrigger.fireOver(C);\n\n\t\t\texpect(ordered).toEqual([\n\t\t\t\t'draggable:update',\n\t\t\t\t// starts by doing all events on previous drop targets\n\t\t\t\t'b:update',\n\t\t\t\t'b:leave',\n\t\t\t\t'a:update',\n\t\t\t\t// bubble order updates on new drop targets\n\t\t\t\t'c:update',\n\t\t\t\t'c:enter',\n\t\t\t\t'monitor:update',\n\t\t\t]);\n\n\t\t\tcleanup();\n\t\t});\n\n\t\ttest('scenario: [B, A] -> [D, C]', () => {\n\t\t\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\t\t\tconst [D, C] = getBubbleOrderedTree();\n\t\t\tconst ordered: string[] = [];\n\n\t\t\tconst cleanup = combine(\n\t\t\t\tappendToBody(A, C),\n\t\t\t\tdraggable({\n\t\t\t\t\telement: draggableEl,\n\t\t\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t\t\t}),\n\t\t\t\tmonitorForElements({\n\t\t\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('monitor:update'),\n\t\t\t\t}),\n\t\t\t\tdropTargetForElements({\n\t\t\t\t\telement: A,\n\t\t\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\t\t}),\n\t\t\t\tdropTargetForElements({\n\t\t\t\t\telement: B,\n\t\t\t\t\tonDragStart: () => ordered.push('b:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\t\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t\t\t}),\n\t\t\t\tdropTargetForElements({\n\t\t\t\t\telement: C,\n\t\t\t\t\tonDragStart: () => ordered.push('c:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('c:update'),\n\t\t\t\t\tonDragEnter: () => ordered.push('c:enter'),\n\t\t\t\t\tonDragLeave: () => ordered.push('c:leave'),\n\t\t\t\t}),\n\t\t\t\tdropTargetForElements({\n\t\t\t\t\telement: D,\n\t\t\t\t\tonDragStart: () => ordered.push('d:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('d:update'),\n\t\t\t\t\tonDragEnter: () => ordered.push('d:enter'),\n\t\t\t\t\tonDragLeave: () => ordered.push('d:leave'),\n\t\t\t\t}),\n\t\t\t);\n\n\t\t\tuserEvent.lift(draggableEl);\n\n\t\t\t// asserting start order [B, A]\n\t\t\texpect(ordered).toEqual(['draggable:start', 'b:start', 'a:start', 'monitor:start']);\n\t\t\tordered.length = 0;\n\n\t\t\t// [B, A] -> [D, C]\n\t\t\ttrigger.fireOver(D);\n\n\t\t\texpect(ordered).toEqual([\n\t\t\t\t'draggable:update',\n\t\t\t\t// starts by doing all events on previous drop targets\n\t\t\t\t'b:update',\n\t\t\t\t'b:leave',\n\t\t\t\t'a:update',\n\t\t\t\t'a:leave',\n\t\t\t\t// bubble order updates on new drop targets\n\t\t\t\t'd:update',\n\t\t\t\t'd:enter',\n\t\t\t\t'c:update',\n\t\t\t\t'c:enter',\n\t\t\t\t'monitor:update',\n\t\t\t]);\n\n\t\t\tcleanup();\n\t\t});\n\n\t\ttest('scenario: [C, B] -> [C, B, A] (reparenting)', () => {\n\t\t\t// A won't be a added to DOM until later\n\t\t\t// const [draggableEl, C, B, A] = getElements('div');\n\t\t\tconst [draggableEl, C, B] = getBubbleOrderedTree();\n\t\t\tconst [A] = getElements('div');\n\t\t\tA.id = 'A';\n\t\t\tB.id = 'B';\n\t\t\tC.id = 'C';\n\t\t\tconst ordered: string[] = [];\n\n\t\t\t// not cleaning this up, as removing A will remove B too at the end\n\t\t\tappendToBody(B);\n\n\t\t\tconst cleanup = combine(\n\t\t\t\tdraggable({\n\t\t\t\t\telement: draggableEl,\n\t\t\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t\t\t}),\n\t\t\t\tmonitorForElements({\n\t\t\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('monitor:update'),\n\t\t\t\t}),\n\t\t\t\tdropTargetForElements({\n\t\t\t\t\telement: B,\n\t\t\t\t\tonDragStart: () => ordered.push('b:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\t\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t\t\t}),\n\t\t\t\tdropTargetForElements({\n\t\t\t\t\telement: C,\n\t\t\t\t\tonDragStart: () => ordered.push('c:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('c:update'),\n\t\t\t\t\tonDragEnter: () => ordered.push('c:enter'),\n\t\t\t\t\tonDragLeave: () => ordered.push('c:leave'),\n\t\t\t\t}),\n\t\t\t);\n\n\t\t\tuserEvent.lift(draggableEl);\n\n\t\t\t// asserting start order [B, A]\n\t\t\texpect(ordered).toEqual(['draggable:start', 'c:start', 'b:start', 'monitor:start']);\n\t\t\tordered.length = 0;\n\n\t\t\t// Adding A to body and A as new parent of B\n\t\t\tconst cleanup2 = combine(\n\t\t\t\tappendToBody(A),\n\t\t\t\tdropTargetForElements({\n\t\t\t\t\telement: A,\n\t\t\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\t\t}),\n\t\t\t);\n\t\t\tA.appendChild(B);\n\n\t\t\t// asserting we go the hierarchy right [C, B, A]\n\t\t\texpect(A.contains(B)).toBe(true);\n\t\t\texpect(A.children[0]).toBe(B);\n\t\t\texpect(B.parentElement).toBe(A);\n\t\t\texpect(C.parentElement).toBe(B);\n\n\t\t\t// [C, B] -> [C, B, A] (reparenting)\n\t\t\ttrigger.fireOver(C);\n\n\t\t\texpect(ordered).toEqual([\n\t\t\t\t'draggable:update',\n\t\t\t\t'c:update',\n\t\t\t\t'b:update',\n\t\t\t\t'a:update',\n\t\t\t\t'a:enter',\n\t\t\t\t'monitor:update',\n\t\t\t]);\n\n\t\t\tcleanup();\n\t\t\tcleanup2();\n\t\t});\n\t});\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/event-ordering/drag.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\ttype ElementEventPayloadMap,\n\tmonitorForElements,\n} from '../../../../src/entry-point/element/adapter';\nimport { type DropTargetRecord, type Input } from '../../../../src/entry-point/types';\nimport {\n\tappendToBody,\n\tgetBubbleOrderedTree,\n\tgetDefaultInput,\n\tgetElements,\n\treset,\n\tuserEvent,\n} from '../../_util';\n\nafterEach(reset);\n\ntest('fire drag events', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrag: () => ordered.push('draggable:drag'),\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t\tonDropTargetChange: () => ordered.push('monitor:change'),\n\t\t\tonDrag: () => ordered.push('monitor:drag'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:change'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDrag: () => ordered.push('a:drag'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t\tonDragStart: () => ordered.push('b:start'),\n\t\t\tonDropTargetChange: () => ordered.push('b:change'),\n\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t\tonDrag: () => ordered.push('b:drag'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(draggableEl);\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['draggable:start', 'b:start', 'a:start', 'monitor:start']);\n\tordered.length = 0;\n\n\t// no change in target\n\tfireEvent.dragOver(B);\n\n\t// not called until next animation frame\n\texpect(ordered).toEqual([]);\n\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['draggable:drag', 'b:drag', 'a:drag', 'monitor:drag']);\n\n\tcleanup();\n});\n\ntest('drag events should be throttled', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst onDrag = jest.fn(() => ordered.push('draggable:drag'));\n\tconst initialInput: Input = getDefaultInput();\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrag: onDrag,\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t\tonDropTargetChange: () => ordered.push('monitor:change'),\n\t\t\tonDrag: () => ordered.push('monitor:drag'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:change'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDrag: () => ordered.push('a:drag'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t\tonDragStart: () => ordered.push('b:start'),\n\t\t\tonDropTargetChange: () => ordered.push('b:change'),\n\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t\tonDrag: () => ordered.push('b:drag'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(draggableEl, initialInput);\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['draggable:start', 'b:start', 'a:start', 'monitor:start']);\n\tordered.length = 0;\n\n\tconst first = getDefaultInput({ pageX: 1 });\n\tconst second = getDefaultInput({ pageX: 2 });\n\tconst third = getDefaultInput({ pageX: 3 });\n\n\tfireEvent.dragOver(B, first);\n\tfireEvent.dragOver(B, second);\n\tfireEvent.dragOver(B, third);\n\n\t// not called until next animation frame\n\texpect(ordered).toEqual([]);\n\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['draggable:drag', 'b:drag', 'a:drag', 'monitor:drag']);\n\tordered.length = 0;\n\n\texpect(onDrag).toHaveBeenCalledTimes(1);\n\n\tconst initialDropTargets: DropTargetRecord[] = [\n\t\t{\n\t\t\telement: B,\n\t\t\tdata: {},\n\t\t\tdropEffect: 'move',\n\t\t\tisActiveDueToStickiness: false,\n\t\t},\n\t\t{\n\t\t\telement: A,\n\t\t\tdata: {},\n\t\t\tdropEffect: 'move',\n\t\t\tisActiveDueToStickiness: false,\n\t\t},\n\t];\n\tconst expected: ElementEventPayloadMap['onDrag'] = {\n\t\tlocation: {\n\t\t\tinitial: {\n\t\t\t\tdropTargets: initialDropTargets,\n\t\t\t\tinput: initialInput,\n\t\t\t},\n\t\t\tprevious: {\n\t\t\t\tdropTargets: initialDropTargets,\n\t\t\t},\n\t\t\tcurrent: {\n\t\t\t\tdropTargets: initialDropTargets,\n\t\t\t\t// called with the latest input\n\t\t\t\tinput: third,\n\t\t\t},\n\t\t},\n\t\tsource: {\n\t\t\telement: draggableEl,\n\t\t\tdragHandle: null,\n\t\t\tdata: {},\n\t\t},\n\t};\n\texpect(onDrag).toHaveBeenCalledWith(expected);\n\n\t// @ts-ignore\n\trequestAnimationFrame.flush();\n\n\texpect(ordered).toEqual([]);\n\n\tcleanup();\n});\n\ntest('a throttled drag event should be canceled by a drop target change', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst [X] = getElements('div');\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tappendToBody(X),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrag: () => ordered.push('draggable:drag'),\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t\tonDropTargetChange: () => ordered.push('monitor:change'),\n\t\t\tonDrag: () => ordered.push('monitor:drag'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:change'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDrag: () => ordered.push('a:drag'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: X,\n\t\t\tonDragStart: () => ordered.push('x:start'),\n\t\t\tonDropTargetChange: () => ordered.push('x:change'),\n\t\t\tonDragEnter: () => ordered.push('x:enter'),\n\t\t\tonDragLeave: () => ordered.push('x:leave'),\n\t\t\tonDrag: () => ordered.push('x:drag'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(draggableEl);\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['draggable:start', 'a:start', 'monitor:start']);\n\tordered.length = 0;\n\n\t// Dragging item, drag event throttled\n\tfireEvent.dragOver(A);\n\t// not called until next animation frame\n\texpect(ordered).toEqual([]);\n\n\t// Changing drop targets [A] -> [X]\n\tfireEvent.dragEnter(X);\n\n\texpect(ordered).toEqual([\n\t\t'draggable:change',\n\t\t'a:change',\n\t\t'a:leave',\n\t\t'x:change',\n\t\t'x:enter',\n\t\t'monitor:change',\n\t]);\n\tordered.length = 0;\n\n\t// would usually flush the drag event\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual([]);\n\n\t// just checking that drag is still not pending\n\t// @ts-ignore\n\trequestAnimationFrame.flush();\n\texpect(ordered).toEqual([]);\n\n\tcleanup();\n});\n\ntest('a throttled drag event should be canceled by a drop', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrag: () => ordered.push('draggable:drag'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t\tonDropTargetChange: () => ordered.push('monitor:change'),\n\t\t\tonDrag: () => ordered.push('monitor:drag'),\n\t\t\tonDrop: () => ordered.push('monitor:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:change'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDrag: () => ordered.push('a:drag'),\n\t\t\tonDrop: () => ordered.push('a:drop'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(draggableEl);\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['draggable:start', 'a:start', 'monitor:start']);\n\tordered.length = 0;\n\n\tfireEvent.dragOver(A);\n\t// not called until next animation frame\n\texpect(ordered).toEqual([]);\n\n\t// drop\n\tfireEvent.drop(A);\n\texpect(ordered).toEqual(['draggable:drop', 'a:drop', 'monitor:drop']);\n\tordered.length = 0;\n\n\t// checking that drag is still not pending\n\t// @ts-ignore\n\trequestAnimationFrame.flush();\n\texpect(ordered).toEqual([]);\n\n\tcleanup();\n});\n\ntest('a throttled drag event should be canceled by a cancel', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrag: () => ordered.push('draggable:drag'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t\tonDropTargetChange: () => ordered.push('monitor:change'),\n\t\t\tonDrag: () => ordered.push('monitor:drag'),\n\t\t\tonDrop: () => ordered.push('monitor:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:change'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDrag: () => ordered.push('a:drag'),\n\t\t\tonDrop: () => ordered.push('a:drop'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(draggableEl);\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['draggable:start', 'a:start', 'monitor:start']);\n\tordered.length = 0;\n\n\tfireEvent.dragOver(A);\n\t// not called until next animation frame\n\texpect(ordered).toEqual([]);\n\n\tuserEvent.cancel();\n\texpect(ordered).toEqual([\n\t\t// a is left\n\t\t'draggable:change',\n\t\t'a:change',\n\t\t'a:leave',\n\t\t'monitor:change',\n\t\t// drop\n\t\t'draggable:drop',\n\t\t'monitor:drop',\n\t]);\n\tordered.length = 0;\n\n\t// checking that drag is still not pending\n\t// @ts-ignore\n\trequestAnimationFrame.flush();\n\texpect(ordered).toEqual([]);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/event-ordering/drop.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\tmonitorForElements,\n} from '../../../../src/entry-point/element/adapter';\nimport { appendToBody, getBubbleOrderedTree, getElements, reset } from '../../_util';\n\nafterEach(reset);\n\ntest('scenario: [] -> drop', () => {\n\tconst [draggableEl] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(draggableEl),\n\t\tmonitorForElements({\n\t\t\tonDrop: () => ordered.push('monitor:drop'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\n\t// lift\n\tfireEvent.dragStart(draggableEl);\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual([]);\n\n\t// drop\n\tfireEvent.drop(document.body);\n\texpect(ordered).toEqual(['draggable:drop', 'monitor:drop']);\n\n\tcleanup();\n});\n\ntest('scenario: [] -> cancel', () => {\n\tconst [draggableEl] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(draggableEl),\n\t\tmonitorForElements({\n\t\t\tonDrop: () => ordered.push('monitor:drop'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\n\t// lift\n\tfireEvent.dragStart(draggableEl);\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual([]);\n\n\t// drop\n\tfireEvent.dragEnd(document.body);\n\texpect(ordered).toEqual(['draggable:drop', 'monitor:drop']);\n\n\tcleanup();\n});\n\ntest('scenario: [A] -> [] -> drop', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tmonitorForElements({\n\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t\tonDrop: () => ordered.push('monitor:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDrop: () => ordered.push('a:drop'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\n\t// lift\n\tfireEvent.dragStart(draggableEl);\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['draggable:start', 'a:start', 'monitor:start']);\n\tordered.length = 0;\n\n\t// [A] -> []\n\tfireEvent.dragEnter(document.body);\n\n\t// drop\n\tfireEvent.drop(document.body);\n\texpect(ordered).toEqual(['draggable:drop', 'monitor:drop']);\n\n\tcleanup();\n});\n\ntest('scenario: [A] -> [] -> cancel', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst start: string[] = [];\n\tconst drop: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tmonitorForElements({\n\t\t\tonDragStart: () => start.push('monitor:start'),\n\t\t\tonDrop: () => drop.push('monitor:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonDragStart: () => start.push('a:start'),\n\t\t\tonDrop: () => drop.push('a:drop'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => start.push('draggable:start'),\n\t\t\tonDrop: () => drop.push('draggable:drop'),\n\t\t}),\n\t);\n\n\t// lift\n\tfireEvent.dragStart(draggableEl);\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\texpect(drop).toEqual([]);\n\texpect(start).toEqual(['draggable:start', 'a:start', 'monitor:start']);\n\n\t// [A] -> []\n\tfireEvent.dragEnter(document.body);\n\n\t// cancel\n\tfireEvent.dragEnd(document.body);\n\texpect(drop).toEqual(['draggable:drop', 'monitor:drop']);\n\n\tcleanup();\n});\n\ntest('scenario: [B, A] -> drop', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tmonitorForElements({\n\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t\tonDrop: () => ordered.push('monitor:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t\tonDragStart: () => ordered.push('b:start'),\n\t\t\tonDrop: () => ordered.push('b:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDrop: () => ordered.push('a:drop'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\n\t// lift\n\tfireEvent.dragStart(draggableEl);\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['draggable:start', 'b:start', 'a:start', 'monitor:start']);\n\tordered.length = 0;\n\n\t// drop\n\tfireEvent.drop(B);\n\texpect(ordered).toEqual(['draggable:drop', 'b:drop', 'a:drop', 'monitor:drop']);\n\n\tcleanup();\n});\n\ntest('scenario: [B, A] -> cancel', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tmonitorForElements({\n\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t\tonDrop: () => ordered.push('monitor:drop'),\n\t\t\tonDropTargetChange: () => ordered.push('monitor:update'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t\tonDragStart: () => ordered.push('b:start'),\n\t\t\tonDrop: () => ordered.push('b:drop'),\n\t\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDrop: () => ordered.push('a:drop'),\n\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t}),\n\t);\n\n\t// lift\n\tfireEvent.dragStart(draggableEl);\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['draggable:start', 'b:start', 'a:start', 'monitor:start']);\n\tordered.length = 0;\n\n\t// canceling an event while over drop targets\n\t// will add an extra event to 'leave' the current drop targets\n\tfireEvent.dragEnd(B);\n\texpect(ordered).toEqual([\n\t\t'draggable:update',\n\t\t'b:update',\n\t\t'b:leave',\n\t\t'a:update',\n\t\t'a:leave',\n\t\t'monitor:update',\n\t\t// drop event fired\n\t\t'draggable:drop',\n\t\t'monitor:drop',\n\t]);\n\n\tcleanup();\n});\n\ntest('scenario: [B, A] -> cancel (dragleave + dragend)', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tmonitorForElements({\n\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t\tonDrop: () => ordered.push('monitor:drop'),\n\t\t\tonDropTargetChange: () => ordered.push('monitor:update'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t\tonDragStart: () => ordered.push('b:start'),\n\t\t\tonDrop: () => ordered.push('b:drop'),\n\t\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDrop: () => ordered.push('a:drop'),\n\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t}),\n\t);\n\n\t// lift\n\tfireEvent.dragStart(draggableEl);\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['draggable:start', 'b:start', 'a:start', 'monitor:start']);\n\tordered.length = 0;\n\n\t// canceling an event while over drop targets\n\t// this will cause the browser to do a \"dragleave\" with `relatedTarget` set to null\n\tfireEvent.dragLeave(B, { relatedTarget: null });\n\n\texpect(ordered).toEqual([\n\t\t'draggable:update',\n\t\t'b:update',\n\t\t'b:leave',\n\t\t'a:update',\n\t\t'a:leave',\n\t\t'monitor:update',\n\t]);\n\tordered.length = 0;\n\n\tfireEvent.dragEnd(B);\n\texpect(ordered).toEqual(['draggable:drop', 'monitor:drop']);\n\n\tcleanup();\n});\n\n// this test is just checking that just a \"dragend\" behaves in the same way as \"dragleave\" + \"dragend\"\n// this is nice to validate as often tests will just to a \"dragend\"\ntest('scenario: [B, A] -> cancel (dragend only)', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tmonitorForElements({\n\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t\tonDrop: () => ordered.push('monitor:drop'),\n\t\t\tonDropTargetChange: () => ordered.push('monitor:update'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t\tonDragStart: () => ordered.push('b:start'),\n\t\t\tonDrop: () => ordered.push('b:drop'),\n\t\t\tonDropTargetChange: () => ordered.push('b:update'),\n\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDrop: () => ordered.push('a:drop'),\n\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t}),\n\t);\n\n\t// lift\n\tfireEvent.dragStart(draggableEl);\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['draggable:start', 'b:start', 'a:start', 'monitor:start']);\n\tordered.length = 0;\n\n\t// note: no 'dragleave' being fired\n\tfireEvent.dragEnd(B);\n\n\texpect(ordered).toEqual([\n\t\t'draggable:update',\n\t\t'b:update',\n\t\t'b:leave',\n\t\t'a:update',\n\t\t'a:leave',\n\t\t'monitor:update',\n\t\t// we get another update for the drop event\n\t\t'draggable:drop',\n\t\t'monitor:drop',\n\t]);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/event-ordering/generate-drag-preview.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\tmonitorForElements,\n} from '../../../../src/entry-point/element/adapter';\nimport { appendToBody, getBubbleOrderedTree, reset } from '../../_util';\n\nafterEach(reset);\n\nit('should notify the source draggable, drop targets in bubble order, then monitors in bind order', () => {\n\tconst [draggableEl, child, parent] = getBubbleOrderedTree();\n\tchild.appendChild(draggableEl);\n\tparent.appendChild(child);\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(parent),\n\t\tmonitorForElements({\n\t\t\tonGenerateDragPreview: () => ordered.push('monitor1'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: parent,\n\t\t\tonGenerateDragPreview: () => ordered.push('parent'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: child,\n\t\t\tonGenerateDragPreview: () => ordered.push('child'),\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonGenerateDragPreview: () => ordered.push('monitor2'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(draggableEl);\n\n\texpect(ordered).toEqual([\n\t\t// draggable source\n\t\t'draggable',\n\t\t// bubble ordered drop targets\n\t\t'child',\n\t\t'parent',\n\t\t// monitors ordered in bind order\n\t\t'monitor1',\n\t\t'monitor2',\n\t]);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/events-and-adapter-mounting.spec.ts",
    "content": "import { combine } from '../../../src/entry-point/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\tmonitorForElements,\n} from '../../../src/entry-point/element/adapter';\nimport { appendToBody, getBubbleOrderedTree, reset, userEvent } from '../_util';\n\nafterEach(reset);\n\ntest('drop targets and monitors should be notified of events even if they are mounted before the first draggable', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\n\t// registering drop target and monitor before mounting first draggable (which kicks off the adapter)\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDrop: () => ordered.push('a:drop'),\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t\tonDrop: () => ordered.push('monitor:drop'),\n\t\t}),\n\t);\n\n\tconst cleanupDraggable = combine(\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\n\t// a little drag\n\tuserEvent.lift(draggableEl);\n\tuserEvent.drop(A);\n\n\t// all events are as we expected\n\texpect(ordered).toEqual([\n\t\t'draggable:start',\n\t\t'a:start',\n\t\t'monitor:start',\n\t\t'draggable:drop',\n\t\t'a:drop',\n\t\t'monitor:drop',\n\t]);\n\n\tcleanup();\n\tcleanupDraggable();\n});\n\ntest('drop targets and monitors should be notified of events even if draggable is unmounted mid drag', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\n\tconst cleanupDraggable = combine(\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDrop: () => ordered.push('a:drop'),\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t\tonDrop: () => ordered.push('monitor:drop'),\n\t\t}),\n\t);\n\n\t// a little drag\n\tuserEvent.lift(draggableEl);\n\n\t// all events are as we expected\n\texpect(ordered).toEqual(['draggable:start', 'a:start', 'monitor:start']);\n\tordered.length = 0;\n\n\t// removing the original draggable which will cleanup the adapter\n\tcleanupDraggable();\n\n\tuserEvent.drop(A);\n\n\t// all events are as we expected\n\texpect(ordered).toEqual([\n\t\t// Note: unmounted draggable `onDrop` is not called\n\t\t'a:drop',\n\t\t'monitor:drop',\n\t]);\n\n\tcleanup();\n\tcleanupDraggable();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/global-event-binding.spec.ts",
    "content": "// Note: not using '@testing-library/dom' in this file as it can\n// add it's own \"error\" event listeners when other events are being fired\n// This file uses vanilla event firing so that we are in total control\n\nimport { combine } from '../../../src/entry-point/combine';\nimport { appendToBody, getElements } from '../_util';\n\n// The initiating \"dragstart\" event listener is added to the `document` for the element event listener\nconst documentAddEventListener = jest.spyOn(document, 'addEventListener');\nconst documentRemoveEventListener = jest.spyOn(document, 'removeEventListener');\n\n// Event listeners for the drag are added to the window\nconst windowAddEventListener = jest.spyOn(window, 'addEventListener');\nconst windowRemoveEventListener = jest.spyOn(window, 'removeEventListener');\n\njest.resetModules();\n\nconst mountWindowListenerCount = 1;\nconst mountDocumentListenerCount = 1;\n\nafterEach(() => {\n\twindowAddEventListener.mockClear();\n\twindowRemoveEventListener.mockClear();\n\tdocumentAddEventListener.mockClear();\n\tdocumentRemoveEventListener.mockClear();\n\tjest.resetModules();\n});\n\nafterEach(async () => {\n\t// cleanup any pending drags\n\twindow.dispatchEvent(new DragEvent('dragend', { cancelable: true, bubbles: true }));\n\n\t// Flushing postDropBugFix\n\twindow.dispatchEvent(new Event('pointerdown'));\n});\n\nit('should add event listeners when the first draggable is mounted', () => {\n\t// listeners not added as nothing imported yet\n\texpect(windowAddEventListener).not.toHaveBeenCalled();\n\texpect(documentAddEventListener).not.toHaveBeenCalled();\n\n\t// import our draggable\n\tconst { draggable } = require('../../../src/entry-point/element/adapter');\n\n\t// listeners not added as no draggables are registered yet\n\texpect(windowAddEventListener).not.toHaveBeenCalled();\n\texpect(documentAddEventListener).not.toHaveBeenCalled();\n\n\tconst [A] = getElements('div');\n\tconst unbind = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t}),\n\t);\n\n\t// initial listeners added after registration\n\texpect(documentAddEventListener).toHaveBeenCalledTimes(mountDocumentListenerCount);\n\texpect(windowAddEventListener).toHaveBeenCalledTimes(mountWindowListenerCount);\n\n\tunbind();\n});\n\nit('should not add event listeners when multiple draggables are mounted', () => {\n\texpect(windowAddEventListener).not.toHaveBeenCalled();\n\texpect(documentAddEventListener).not.toHaveBeenCalled();\n\tconst { draggable } = require('../../../src/entry-point/element/adapter');\n\n\tconst [A, B] = getElements('div');\n\tconst unbind = combine(\n\t\tdraggable({\n\t\t\telement: A,\n\t\t}),\n\t\tdraggable({\n\t\t\telement: B,\n\t\t}),\n\t);\n\n\texpect(documentAddEventListener).toHaveBeenCalledTimes(mountDocumentListenerCount);\n\texpect(windowAddEventListener).toHaveBeenCalledTimes(mountWindowListenerCount);\n\n\tunbind();\n});\n\nit('should not add event listeners when only a drop target is mounted', () => {\n\tconst { dropTargetForElements } = require('../../../src/entry-point/element/adapter');\n\n\tconst [el] = getElements('div');\n\tconst unbind = combine(\n\t\tappendToBody(el),\n\t\tdropTargetForElements({\n\t\t\telement: el,\n\t\t}),\n\t);\n\n\texpect(windowAddEventListener).not.toHaveBeenCalled();\n\texpect(documentAddEventListener).not.toHaveBeenCalled();\n\tunbind();\n});\n\nit('should remove initiating event listener when an only draggable is removed', () => {\n\tconst { draggable } = require('../../../src/entry-point/element/adapter');\n\n\t// no event listeners added or removed yet\n\texpect(documentAddEventListener).not.toHaveBeenCalled();\n\texpect(documentRemoveEventListener).not.toHaveBeenCalled();\n\texpect(windowAddEventListener).not.toHaveBeenCalled();\n\texpect(windowRemoveEventListener).not.toHaveBeenCalled();\n\n\tconst [A] = getElements('div');\n\tconst unbindA = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t}),\n\t);\n\n\texpect(documentAddEventListener).toHaveBeenCalledTimes(mountDocumentListenerCount);\n\texpect(windowAddEventListener).toHaveBeenCalledTimes(mountWindowListenerCount);\n\t// nothing removed yet\n\texpect(documentRemoveEventListener).not.toHaveBeenCalled();\n\texpect(windowRemoveEventListener).not.toHaveBeenCalled();\n\n\tunbindA();\n\n\texpect(documentRemoveEventListener).toHaveBeenCalledTimes(mountDocumentListenerCount);\n\texpect(windowRemoveEventListener).toHaveBeenCalledTimes(mountWindowListenerCount);\n});\n\nit('should remove initiating event listener when the last draggable is removed', () => {\n\tconst { draggable } = require('../../../src/entry-point/element/adapter');\n\n\t// no event listeners added or removed yet\n\texpect(documentAddEventListener).not.toHaveBeenCalled();\n\texpect(documentRemoveEventListener).not.toHaveBeenCalled();\n\texpect(windowAddEventListener).not.toHaveBeenCalled();\n\texpect(windowRemoveEventListener).not.toHaveBeenCalled();\n\n\tconst [A, B] = getElements('div');\n\tconst unbindA = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t}),\n\t);\n\tconst unbindB = combine(\n\t\tappendToBody(B),\n\t\tdraggable({\n\t\t\telement: B,\n\t\t}),\n\t);\n\n\texpect(documentAddEventListener).toHaveBeenCalledTimes(mountDocumentListenerCount);\n\texpect(windowAddEventListener).toHaveBeenCalledTimes(mountWindowListenerCount);\n\t// nothing removed yet\n\texpect(documentRemoveEventListener).not.toHaveBeenCalled();\n\texpect(windowRemoveEventListener).not.toHaveBeenCalled();\n\n\tunbindA();\n\n\t// not removed yet\n\texpect(documentRemoveEventListener).not.toHaveBeenCalled();\n\texpect(windowRemoveEventListener).not.toHaveBeenCalled();\n\n\tunbindB();\n\n\texpect(documentRemoveEventListener).toHaveBeenCalledTimes(mountDocumentListenerCount);\n\texpect(windowRemoveEventListener).toHaveBeenCalledTimes(mountWindowListenerCount);\n});\n\nit('should bind event listeners needed for the drag only while dragging (drag cancelled)', async () => {\n\tconst { draggable } = require('../../../src/entry-point/element/adapter');\n\tconst ordered: string[] = [];\n\n\t// no event listeners added or removed yet\n\texpect(documentAddEventListener).not.toHaveBeenCalled();\n\texpect(documentRemoveEventListener).not.toHaveBeenCalled();\n\texpect(windowAddEventListener).not.toHaveBeenCalled();\n\texpect(windowRemoveEventListener).not.toHaveBeenCalled();\n\n\tconst [A] = getElements('div');\n\tconst unbindA = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('preview'),\n\t\t\tonDragStart: () => ordered.push('start'),\n\t\t\tonDrop: () => ordered.push('drop'),\n\t\t}),\n\t);\n\n\texpect(documentAddEventListener).toHaveBeenCalledTimes(mountDocumentListenerCount);\n\texpect(windowAddEventListener).toHaveBeenCalledTimes(mountWindowListenerCount);\n\n\t// let's start a drag\n\tA.dispatchEvent(new DragEvent('dragstart', { cancelable: true, bubbles: true }));\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['preview', 'start']);\n\tordered.length = 0;\n\n\t// we expect that *new* event listeners have been added for the duration of a the drag\n\tconst postLiftWindowAddEventListenerCount =\n\t\twindowAddEventListener.mock.calls.length - mountWindowListenerCount;\n\texpect(postLiftWindowAddEventListenerCount).toBeGreaterThan(0);\n\t// unchanged\n\texpect(documentAddEventListener).toHaveBeenCalledTimes(mountDocumentListenerCount);\n\n\t// cancel the current drag\n\twindow.dispatchEvent(new DragEvent('dragend', { cancelable: true, bubbles: true }));\n\n\texpect(ordered).toEqual(['drop']);\n\n\t// all new event listeners have been removed\n\texpect(windowRemoveEventListener).toHaveBeenCalledTimes(postLiftWindowAddEventListenerCount);\n\n\t// unchanged\n\texpect(documentAddEventListener).toHaveBeenCalledTimes(mountDocumentListenerCount);\n\texpect(documentRemoveEventListener).not.toHaveBeenCalled();\n\n\tunbindA();\n});\n\nit('should bind event listeners needed for the drag only while dragging (successful drop)', () => {\n\tconst { draggable, dropTargetForElements } = require('../../../src/entry-point/element/adapter');\n\tconst ordered: string[] = [];\n\n\t// no event listeners added or removed yet\n\texpect(documentAddEventListener).not.toHaveBeenCalled();\n\texpect(documentRemoveEventListener).not.toHaveBeenCalled();\n\texpect(windowAddEventListener).not.toHaveBeenCalled();\n\texpect(windowRemoveEventListener).not.toHaveBeenCalled();\n\n\tconst [A] = getElements('div');\n\tconst unbindA = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('dropTarget:preview'),\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t);\n\n\texpect(documentAddEventListener).toHaveBeenCalledTimes(mountDocumentListenerCount);\n\texpect(windowAddEventListener).toHaveBeenCalledTimes(mountWindowListenerCount);\n\n\t// let's start a drag\n\tA.dispatchEvent(new DragEvent('dragstart', { cancelable: true, bubbles: true }));\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual([\n\t\t'draggable:preview',\n\t\t'dropTarget:preview',\n\t\t'draggable:start',\n\t\t'dropTarget:start',\n\t]);\n\tordered.length = 0;\n\n\t// we expect that *new* event listeners have been added for the duration of a the drag\n\tconst postLiftWindowAddEventListenerCount =\n\t\twindowAddEventListener.mock.calls.length - mountWindowListenerCount;\n\texpect(postLiftWindowAddEventListenerCount).toBeGreaterThan(0);\n\t// unchanged\n\texpect(documentAddEventListener).toHaveBeenCalledTimes(mountDocumentListenerCount);\n\n\t// drop on A\n\tA.dispatchEvent(new DragEvent('drop', { cancelable: true, bubbles: true }));\n\n\texpect(ordered).toEqual(['draggable:drop', 'dropTarget:drop']);\n\n\t// all new event listeners have been removed\n\texpect(windowRemoveEventListener).toHaveBeenCalledTimes(postLiftWindowAddEventListenerCount);\n\n\t// unchanged\n\texpect(documentAddEventListener).toHaveBeenCalledTimes(mountDocumentListenerCount);\n\texpect(documentRemoveEventListener).not.toHaveBeenCalled();\n\n\tunbindA();\n});\n\nit('should keep dragging event listeners bound even if only draggable is removed mid drag', () => {\n\tconst { draggable, monitorForElements } = require('../../../src/entry-point/element/adapter');\n\tconst ordered: string[] = [];\n\n\t// no event listeners added or removed yet\n\texpect(documentAddEventListener).not.toHaveBeenCalled();\n\texpect(documentRemoveEventListener).not.toHaveBeenCalled();\n\texpect(windowAddEventListener).not.toHaveBeenCalled();\n\texpect(windowRemoveEventListener).not.toHaveBeenCalled();\n\n\tconst [A] = getElements('div');\n\tconst unbindA = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\tconst unbindMonitor = monitorForElements({\n\t\tonGenerateDragPreview: () => ordered.push('monitor:preview'),\n\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\tonDrop: () => ordered.push('monitor:drop'),\n\t});\n\n\t// initiating event listener added\n\texpect(documentAddEventListener).toHaveBeenCalledTimes(mountDocumentListenerCount);\n\texpect(windowAddEventListener).toHaveBeenCalledTimes(mountWindowListenerCount);\n\t// Note: Cannot reset the mock. It causes internal reference mismatches\n\t// documentAddEventListener.mockReset();\n\t// no dragging event listeners added\n\n\t// let's start a drag\n\tA.dispatchEvent(new DragEvent('dragstart', { cancelable: true, bubbles: true }));\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual([\n\t\t'draggable:preview',\n\t\t'monitor:preview',\n\t\t'draggable:start',\n\t\t'monitor:start',\n\t]);\n\tordered.length = 0;\n\n\t// we expect that *new* event listeners have been added for the duration of a the drag\n\tconst postWindowLiftAddEventListenerCount =\n\t\twindowAddEventListener.mock.calls.length - mountWindowListenerCount;\n\texpect(postWindowLiftAddEventListenerCount).toBeGreaterThan(0);\n\texpect(windowRemoveEventListener).not.toHaveBeenCalled();\n\n\t// unbinding the only draggable mid drag\n\tunbindA();\n\t// \"dragstart\" and \"pointermove\" event listener removed on the `document`,\n\t// but other event listeners for the drag are still active\n\texpect(documentRemoveEventListener).toHaveBeenCalledTimes(mountWindowListenerCount);\n\texpect(windowRemoveEventListener).toHaveBeenCalledTimes(mountDocumentListenerCount);\n\n\t// finish the drag\n\twindow.dispatchEvent(new DragEvent('dragend', { cancelable: true, bubbles: true }));\n\n\t// monitor still told about the drop\n\texpect(ordered).toEqual(['monitor:drop']);\n\n\t// all dragging event listeners removed\n\texpect(windowRemoveEventListener).toHaveBeenCalledTimes(\n\t\tmountDocumentListenerCount + postWindowLiftAddEventListenerCount,\n\t);\n\n\tunbindMonitor();\n});\n\nit('should keep dragging event listeners bound if only draggable is remounted mid drag', () => {\n\tconst { draggable, monitorForElements } = require('../../../src/entry-point/element/adapter');\n\tconst ordered: string[] = [];\n\n\t// no event listeners added or removed yet\n\texpect(documentAddEventListener).not.toHaveBeenCalled();\n\texpect(documentRemoveEventListener).not.toHaveBeenCalled();\n\texpect(windowAddEventListener).not.toHaveBeenCalled();\n\texpect(windowRemoveEventListener).not.toHaveBeenCalled();\n\n\tconst [A] = getElements('div');\n\tconst unbindA1 = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable(1):preview'),\n\t\t\tonDragStart: () => ordered.push('draggable(1):start'),\n\t\t\tonDrop: () => ordered.push('draggable(1):drop'),\n\t\t}),\n\t);\n\tconst unbindMonitor = monitorForElements({\n\t\tonGenerateDragPreview: () => ordered.push('monitor:preview'),\n\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\tonDrop: () => ordered.push('monitor:drop'),\n\t});\n\n\t// initiating event listener added\n\texpect(documentAddEventListener).toHaveBeenCalledTimes(mountDocumentListenerCount);\n\texpect(windowAddEventListener).toHaveBeenCalledTimes(mountWindowListenerCount);\n\t// Note: Cannot reset the mock. It causes internal reference mismatches\n\t// documentAddEventListener.mockReset();\n\t// no dragging event listeners added\n\n\t// let's start a drag\n\tA.dispatchEvent(new DragEvent('dragstart', { cancelable: true, bubbles: true }));\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual([\n\t\t'draggable(1):preview',\n\t\t'monitor:preview',\n\t\t'draggable(1):start',\n\t\t'monitor:start',\n\t]);\n\tordered.length = 0;\n\n\t// we expect that *new* event listeners have been added for the duration of a the drag\n\tconst postLiftWindowAddEventListenerCount =\n\t\twindowAddEventListener.mock.calls.length - mountWindowListenerCount;\n\texpect(postLiftWindowAddEventListenerCount).toBeGreaterThan(0);\n\texpect(windowRemoveEventListener).not.toHaveBeenCalled();\n\n\t// unbinding the only draggable mid drag\n\tunbindA1();\n\n\t// \"dragstart\" and \"pointermove\" event listener removed, but other event listeners for the drag are still active\n\texpect(documentRemoveEventListener).toHaveBeenCalledTimes(mountDocumentListenerCount);\n\texpect(windowRemoveEventListener).toHaveBeenCalledTimes(mountWindowListenerCount);\n\n\tconst unbindA2 = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable(2):preview'),\n\t\t\tonDragStart: () => ordered.push('draggable(2):start'),\n\t\t\tonDrop: () => ordered.push('draggable(2):drop'),\n\t\t}),\n\t);\n\n\t// Due to new registration, a new \"dragstart\" and \"pointermove\"\n\t// event listeners are added to the document\n\texpect(documentAddEventListener).toHaveBeenCalledTimes(mountDocumentListenerCount * 2);\n\texpect(windowAddEventListener).toHaveBeenCalledTimes(\n\t\tmountWindowListenerCount * 2 + postLiftWindowAddEventListenerCount,\n\t);\n\n\t// finish the drag\n\twindow.dispatchEvent(new DragEvent('dragend', { cancelable: true, bubbles: true }));\n\n\t// because 'A' is the key, A2 is treated as the original draggable\n\texpect(ordered).toEqual(['draggable(2):drop', 'monitor:drop']);\n\n\t// all event listeners removed (including the first initiating event listener)\n\texpect(windowRemoveEventListener).toHaveBeenCalledTimes(\n\t\tmountWindowListenerCount + postLiftWindowAddEventListenerCount,\n\t);\n\n\tunbindMonitor();\n\tunbindA2();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/leaving-the-window.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../src/entry-point/combine';\nimport { draggable, dropTargetForElements } from '../../../src/entry-point/element/adapter';\nimport { appendToBody, getBubbleOrderedTree, reset, userEvent } from '../_util';\n\nafterEach(reset);\n\n[true, false].forEach((isSticky) => {\n\tit(`should clear drop targets when leaving the window (Sticky: ${isSticky})`, () => {\n\t\tconst [draggableEl, A] = getBubbleOrderedTree();\n\t\tA.id = 'A';\n\t\tconst ordered: string[] = [];\n\n\t\tconst cleanup = combine(\n\t\t\tappendToBody(A),\n\t\t\tdraggable({\n\t\t\t\telement: draggableEl,\n\t\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\t\tonDropTargetChange: () => ordered.push('draggable:update'),\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement: A,\n\t\t\t\tgetIsSticky: () => isSticky,\n\t\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\t\tonDropTargetChange: () => ordered.push('a:update'),\n\t\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\t}),\n\t\t);\n\n\t\tuserEvent.lift(draggableEl);\n\t\texpect(ordered).toEqual(['draggable:start', 'a:start']);\n\t\tordered.length = 0;\n\n\t\tfireEvent.dragLeave(document.body, { relatedTarget: null });\n\n\t\texpect(ordered).toEqual(['draggable:update', 'a:update', 'a:leave']);\n\n\t\tcleanup();\n\t});\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/monitor/adding-monitors-during-events.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport { draggable, monitorForElements } from '../../../../src/entry-point/element/adapter';\nimport { type CleanupFn } from '../../../../src/entry-point/types';\nimport { appendToBody, getElements, reset } from '../../_util';\n\nafterEach(reset);\n\nit('should not call a new monitor for an active event', () => {\n\tconst ordered: string[] = [];\n\tconst [A] = getElements('div');\n\n\tconst cleanups: CleanupFn[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({ element: A }),\n\t\tmonitorForElements({\n\t\t\tonGenerateDragPreview: () => {\n\t\t\t\tordered.push('first:preview');\n\t\t\t\tconst cleanupSecond = monitorForElements({\n\t\t\t\t\tonGenerateDragPreview: () => {\n\t\t\t\t\t\tordered.push('second:preview');\n\t\t\t\t\t},\n\t\t\t\t\t// the monitor will be called for the next event\n\t\t\t\t\tonDragStart: () => {\n\t\t\t\t\t\tordered.push('second:start');\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t\tcleanups.push(cleanupSecond);\n\t\t\t},\n\t\t\tonDragStart: () => ordered.push('first:start'),\n\t\t}),\n\t);\n\tcleanups.push(cleanup);\n\n\tfireEvent.dragStart(A);\n\n\texpect(ordered).toEqual(['first:preview']);\n\tordered.length = 0;\n\n\t// @ts-ignore\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['first:start', 'second:start']);\n\tordered.length = 0;\n\n\t// finishing the first drag\n\tfireEvent.dragEnd(window);\n\n\t// starting another drag\n\tfireEvent.dragStart(A);\n\n\t// on the next drag, the new monitor has it's `onGenerateDragPreview` function called\n\texpect(ordered).toEqual(['first:preview', 'second:preview']);\n\n\tcleanups.forEach((fn) => fn());\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/monitor/call-order.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport { draggable, monitorForElements } from '../../../../src/entry-point/element/adapter';\nimport { appendToBody, reset } from '../../_util';\n\nafterEach(reset);\n\nit('should call monitors in order in which they where bound', () => {\n\tconst draggableEl = document.createElement('div');\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(draggableEl),\n\t\tdraggable({ element: draggableEl }),\n\t\tmonitorForElements({\n\t\t\tonGenerateDragPreview: () => ordered.push('monitor1'),\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonGenerateDragPreview: () => ordered.push('monitor2'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(draggableEl);\n\n\texpect(ordered).toEqual([\n\t\t// monitors ordered in bind order\n\t\t'monitor1',\n\t\t'monitor2',\n\t]);\n\n\tcleanup();\n});\n\nit('should monitors in latest bind order', () => {\n\tconst draggableEl = document.createElement('div');\n\tconst ordered: string[] = [];\n\tconst cleanupBody = appendToBody(draggableEl);\n\tconst cleanupDraggable = draggable({ element: draggableEl });\n\tconst cleanupMonitor1 = monitorForElements({\n\t\tonGenerateDragPreview: () => ordered.push('monitor1'),\n\t});\n\tconst cleanupMonitor2 = monitorForElements({\n\t\tonGenerateDragPreview: () => ordered.push('monitor2'),\n\t});\n\n\t// unbind first monitor\n\tcleanupMonitor1();\n\t// add another monitor\n\tconst cleanupMonitor3 = monitorForElements({\n\t\tonGenerateDragPreview: () => ordered.push('monitor3'),\n\t});\n\n\tfireEvent.dragStart(draggableEl);\n\n\texpect(ordered).toEqual([\n\t\t// monitors ordered in bind order\n\t\t'monitor2',\n\t\t'monitor3',\n\t]);\n\n\tcleanupBody();\n\tcleanupDraggable();\n\tcleanupMonitor2();\n\tcleanupMonitor3();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/monitor/publishing-events.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\ttype ElementMonitorGetFeedbackArgs,\n\tmonitorForElements,\n} from '../../../../src/entry-point/element/adapter';\nimport { appendToBody, getDefaultInput, getElements, reset, userEvent } from '../../_util';\n\nafterEach(reset);\n\nit('should publish events on active monitors during a drag', () => {\n\tconst draggableEl = document.createElement('div');\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(draggableEl),\n\t\tdraggable({ element: draggableEl }),\n\t\tmonitorForElements({\n\t\t\tcanMonitor: () => true,\n\t\t\tonGenerateDragPreview: () => ordered.push('monitor1'),\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tcanMonitor: () => false,\n\t\t\tonGenerateDragPreview: () => ordered.push('monitor2'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(draggableEl);\n\n\texpect(ordered).toEqual(['monitor1']);\n\n\tcleanup();\n});\n\nit('should allow monitors to be added during a drag', () => {\n\tconst [A] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanupA = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('a:preview'),\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDrag: () => ordered.push('a:drag'),\n\t\t\tonDropTargetChange: () => ordered.push('a:change'),\n\t\t\tonDrop: () => ordered.push('a:drop'),\n\t\t}),\n\t\tdropTargetForElements({ element: A }),\n\t);\n\n\t// lifting in [A]\n\tuserEvent.lift(A);\n\texpect(ordered).toEqual(['a:preview', 'a:start']);\n\tordered.length = 0;\n\n\t// now adding monitor\n\tconst cleanupMonitor = monitorForElements({\n\t\tonGenerateDragPreview: () => ordered.push('monitor:preview'),\n\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\tonDrag: () => ordered.push('monitor:drag'),\n\t\tonDropTargetChange: () => ordered.push('monitor:change'),\n\t\tonDrop: () => ordered.push('monitor:drop'),\n\t});\n\n\t// [A] -> []\n\tfireEvent.dragEnter(document.body);\n\texpect(ordered).toEqual(['a:change', 'monitor:change']);\n\tordered.length = 0;\n\n\t// dragging over []\n\tfireEvent.dragOver(document.body);\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['a:drag', 'monitor:drag']);\n\tordered.length = 0;\n\n\t// cancel\n\tfireEvent.dragEnd(document.body);\n\texpect(ordered).toEqual(['a:drop', 'monitor:drop']);\n\tordered.length = 0;\n\n\tcleanupA();\n\tcleanupMonitor();\n});\n\nit('should allow monitors to be removed during a drag', () => {\n\tconst [A] = getElements('div');\n\tconst ordered: string[] = [];\n\n\tconst cleanupA = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('a:preview'),\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDrag: () => ordered.push('a:drag'),\n\t\t\tonDropTargetChange: () => ordered.push('a:change'),\n\t\t\tonDrop: () => ordered.push('a:drop'),\n\t\t}),\n\t\tdropTargetForElements({ element: A }),\n\t);\n\tconst cleanupMonitor = monitorForElements({\n\t\tonGenerateDragPreview: () => ordered.push('monitor:preview'),\n\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\tonDrag: () => ordered.push('monitor:drag'),\n\t\tonDropTargetChange: () => ordered.push('monitor:change'),\n\t\tonDrop: () => ordered.push('monitor:drop'),\n\t});\n\n\t// lifting in [A]\n\tuserEvent.lift(A);\n\texpect(ordered).toEqual(['a:preview', 'monitor:preview', 'a:start', 'monitor:start']);\n\tordered.length = 0;\n\n\t// now removing monitor\n\t// no more events published to the monitor\n\tcleanupMonitor();\n\n\t// [A] -> []\n\tfireEvent.dragEnter(document.body);\n\texpect(ordered).toEqual(['a:change']);\n\tordered.length = 0;\n\n\t// dragging over []\n\tfireEvent.dragOver(document.body);\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['a:drag']);\n\tordered.length = 0;\n\n\t// cancel\n\tfireEvent.dragEnd(document.body);\n\texpect(ordered).toEqual(['a:drop']);\n\tordered.length = 0;\n\n\tcleanupA();\n\tcleanupMonitor();\n});\n\nit('should only call canMonitor() at the start of a drag for mounted monitors', () => {\n\tconst [A] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst canMonitor = jest.fn(() => true);\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({ element: A }),\n\t\tdropTargetForElements({ element: A }),\n\t\tmonitorForElements({\n\t\t\tcanMonitor: canMonitor,\n\t\t\tonGenerateDragPreview: () => ordered.push('monitor:preview'),\n\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t\tonDrag: () => ordered.push('monitor:drag'),\n\t\t\tonDropTargetChange: () => ordered.push('monitor:change'),\n\t\t\tonDrop: () => ordered.push('monitor:drop'),\n\t\t}),\n\t);\n\n\t// doing a few drag operations to see that `canMonitor` is only called once per operation\n\tfor (let i = 0; i < 5; i++) {\n\t\t// lifting in [A]\n\t\texpect(canMonitor).toBeCalledTimes(0);\n\t\tfireEvent.dragStart(A);\n\t\texpect(canMonitor).toBeCalledTimes(1);\n\t\tcanMonitor.mockClear();\n\t\texpect(ordered).toEqual(['monitor:preview']);\n\t\tordered.length = 0;\n\n\t\t// finish lift\n\t\t// @ts-expect-error\n\t\trequestAnimationFrame.step();\n\t\texpect(ordered).toEqual(['monitor:start']);\n\t\tordered.length = 0;\n\n\t\t// [A] -> []\n\t\tfireEvent.dragEnter(document.body);\n\t\texpect(ordered).toEqual(['monitor:change']);\n\t\tordered.length = 0;\n\n\t\t// dragging over []\n\t\tfireEvent.dragOver(document.body);\n\t\t// @ts-expect-error\n\t\trequestAnimationFrame.step();\n\t\texpect(ordered).toEqual(['monitor:drag']);\n\t\tordered.length = 0;\n\n\t\t// cancel\n\t\tfireEvent.dragEnd(document.body);\n\t\texpect(ordered).toEqual(['monitor:drop']);\n\t\tordered.length = 0;\n\n\t\texpect(canMonitor).toBeCalledTimes(0);\n\t}\n\n\tcleanup();\n});\n\nit('should allow canMonitor() to return different results between drags', () => {\n\tconst [A] = getElements('div');\n\tconst ordered: string[] = [];\n\tlet canMonitor: boolean = false;\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({ element: A }),\n\t\tmonitorForElements({\n\t\t\tcanMonitor: () => canMonitor,\n\t\t\tonGenerateDragPreview: () => ordered.push('monitor:preview'),\n\t\t\tonDrop: () => ordered.push('monitor:drop'),\n\t\t}),\n\t);\n\n\t// drag1: lifting in [A]\n\tfireEvent.dragStart(A);\n\texpect(ordered).toEqual(['draggable:preview']);\n\tordered.length = 0;\n\n\t// finishing drag1\n\tfireEvent.dragEnd(window);\n\texpect(ordered).toEqual(['draggable:drop']);\n\tordered.length = 0;\n\n\t// drag2: lifting in [A] again, but allowing monitoring this time\n\tcanMonitor = true;\n\tfireEvent.dragStart(A);\n\texpect(ordered).toEqual(['draggable:preview', 'monitor:preview']);\n\tordered.length = 0;\n\n\t// finishing drag1\n\tfireEvent.dragEnd(window);\n\texpect(ordered).toEqual(['draggable:drop', 'monitor:drop']);\n\n\tcleanup();\n});\n\nit('should not publish events to a monitor if it is added during an active event and removed before the next event', () => {\n\tconst [A] = getElements('div');\n\tconst ordered: string[] = [];\n\tlet cleanupMonitor: () => void = () => {};\n\n\tconst cleanupA = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonDragStart: () => {\n\t\t\t\tordered.push('draggable:start');\n\t\t\t},\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonDragStart: () => {\n\t\t\t\tordered.push('monitor(a):start');\n\t\t\t\tcleanupMonitor = monitorForElements({\n\t\t\t\t\t// won't be called for this event\n\t\t\t\t\tonDragStart: () => ordered.push('monitor(b):start'),\n\t\t\t\t\tonDrop: () => ordered.push('monitor(b):drop'),\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDrop: () => ordered.push('monitor(a):drop'),\n\t\t}),\n\t\tdropTargetForElements({ element: A }),\n\t);\n\n\t// lifting in [A] which will add a monitor during the event\n\tuserEvent.lift(A);\n\texpect(ordered).toEqual(['draggable:start', 'monitor(a):start']);\n\tordered.length = 0;\n\n\t// now removing monitor before the next event\n\tcleanupMonitor();\n\n\t// cancel\n\tfireEvent.dragEnd(document.body);\n\texpect(ordered).toEqual(['draggable:drop', 'monitor(a):drop']);\n\tordered.length = 0;\n\n\tcleanupA();\n});\n\nit('should call canMonitor() when a monitor is registered, if it is registered during a drag', () => {\n\tconst [A] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst canMonitor = jest.fn(() => true);\n\n\tconst cleanupA = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tgetInitialData: () => ({ name: 'Alex' }),\n\t\t\tonGenerateDragPreview: () => ordered.push('a:preview'),\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDrag: () => ordered.push('a:drag'),\n\t\t\tonDropTargetChange: () => ordered.push('a:change'),\n\t\t\tonDrop: () => ordered.push('a:drop'),\n\t\t}),\n\t\tdropTargetForElements({ element: A, getData: () => ({ name: 'Sam' }) }),\n\t);\n\n\t// lifting in [A]\n\tconst initialInput = getDefaultInput({ clientX: 20 });\n\tuserEvent.lift(A, initialInput);\n\texpect(ordered).toEqual(['a:preview', 'a:start']);\n\tordered.length = 0;\n\n\t// new monitor not called yet (it has not been registered yet)\n\texpect(canMonitor).not.toHaveBeenCalled();\n\n\t// now adding monitor\n\tconst cleanupMonitor = monitorForElements({\n\t\tcanMonitor: canMonitor,\n\t\tonGenerateDragPreview: () => ordered.push('monitor:preview'),\n\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\tonDrag: () => ordered.push('monitor:drag'),\n\t\tonDropTargetChange: () => ordered.push('monitor:change'),\n\t\tonDrop: () => ordered.push('monitor:drop'),\n\t});\n\t{\n\t\texpect(canMonitor).toHaveBeenCalledTimes(1);\n\t\tconst expected: ElementMonitorGetFeedbackArgs = {\n\t\t\tsource: {\n\t\t\t\telement: A,\n\t\t\t\tdata: { name: 'Alex' },\n\t\t\t\tdragHandle: null,\n\t\t\t},\n\t\t\tinitial: {\n\t\t\t\tinput: initialInput,\n\t\t\t\tdropTargets: [\n\t\t\t\t\t{\n\t\t\t\t\t\telement: A,\n\t\t\t\t\t\tdropEffect: 'move',\n\t\t\t\t\t\tdata: { name: 'Sam' },\n\t\t\t\t\t\tisActiveDueToStickiness: false,\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t};\n\t\texpect(canMonitor).toHaveBeenCalledWith(expected);\n\t\tcanMonitor.mockClear();\n\t}\n\n\t// [A] -> []\n\tconst dragEnterInput = getDefaultInput({ clientX: 10 });\n\tfireEvent.dragEnter(document.body, dragEnterInput);\n\texpect(ordered).toEqual(['a:change', 'monitor:change']);\n\tordered.length = 0;\n\n\t// dragging over []\n\tfireEvent.dragOver(document.body);\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['a:drag', 'monitor:drag']);\n\tordered.length = 0;\n\n\t// cancel\n\tfireEvent.dragEnd(document.body);\n\texpect(ordered).toEqual(['a:drop', 'monitor:drop']);\n\tordered.length = 0;\n\texpect(canMonitor).toHaveBeenCalledTimes(0);\n\n\t// starting another drag\n\tfireEvent.dragStart(A);\n\n\t// on the next drag, the new monitor has it's `onGenerateDragPreview` function called\n\texpect(ordered).toEqual(['a:preview', 'monitor:preview']);\n\n\tcleanupA();\n\tcleanupMonitor();\n});\n\nit('should not publish events to monitors added during a drag if they say they cannot monitor events', () => {\n\tconst [A] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst canMonitor = jest.fn(() => false);\n\n\tconst cleanupA = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('a:preview'),\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDrag: () => ordered.push('a:drag'),\n\t\t\tonDropTargetChange: () => ordered.push('a:change'),\n\t\t\tonDrop: () => ordered.push('a:drop'),\n\t\t}),\n\t\tdropTargetForElements({ element: A }),\n\t);\n\n\t// lifting in [A]\n\tuserEvent.lift(A);\n\texpect(ordered).toEqual(['a:preview', 'a:start']);\n\tordered.length = 0;\n\n\t// now adding monitor\n\tconst cleanupMonitor = monitorForElements({\n\t\tcanMonitor: canMonitor,\n\t\tonGenerateDragPreview: () => ordered.push('monitor:preview'),\n\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\tonDrag: () => ordered.push('monitor:drag'),\n\t\tonDropTargetChange: () => ordered.push('monitor:change'),\n\t\tonDrop: () => ordered.push('monitor:drop'),\n\t});\n\n\t// [A] -> []\n\tfireEvent.dragEnter(document.body);\n\t// checking if monitor can be used (but it will say false)\n\texpect(canMonitor).toHaveBeenCalledTimes(1);\n\tcanMonitor.mockClear();\n\texpect(ordered).toEqual(['a:change']);\n\tordered.length = 0;\n\n\t// dragging over []\n\tfireEvent.dragOver(document.body);\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['a:drag']);\n\tordered.length = 0;\n\n\t// cancel\n\tfireEvent.dragEnd(document.body);\n\texpect(ordered).toEqual(['a:drop']);\n\tordered.length = 0;\n\texpect(canMonitor).toHaveBeenCalledTimes(0);\n\n\tcleanupA();\n\tcleanupMonitor();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/monitor/removing-monitors-during-events.spec.ts",
    "content": "import { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\tmonitorForElements,\n} from '../../../../src/entry-point/element/adapter';\nimport { appendToBody, getElements, reset, userEvent } from '../../_util';\n\nafterEach(reset);\n\nit('should not call a monitor that is removed during an event (draggable removing monitor)', () => {\n\tconst ordered: string[] = [];\n\tconst [A] = getElements('div');\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonDragStart: () => {\n\t\t\t\tordered.push('draggable:start');\n\t\t\t\tcleanupMonitor();\n\t\t\t},\n\t\t}),\n\t);\n\tconst cleanupMonitor = combine(\n\t\t() => ordered.push('monitor:cleanup'),\n\t\tmonitorForElements({\n\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(A);\n\n\texpect(ordered).toEqual(['draggable:start', 'monitor:cleanup']);\n\tordered.length = 0;\n\n\tcleanup();\n});\n\nit('should not call a monitor that is removed during an event (drop target removing monitor)', () => {\n\tconst ordered: string[] = [];\n\tconst [A] = getElements('div');\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonDragStart: () => {\n\t\t\t\tordered.push('draggable:start');\n\t\t\t},\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonDragStart: () => {\n\t\t\t\tordered.push('A:start');\n\t\t\t\tcleanupMonitor();\n\t\t\t},\n\t\t}),\n\t);\n\tconst cleanupMonitor = combine(\n\t\t() => ordered.push('monitor:cleanup'),\n\t\tmonitorForElements({\n\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(A);\n\n\texpect(ordered).toEqual(['draggable:start', 'A:start', 'monitor:cleanup']);\n\tordered.length = 0;\n\n\tcleanup();\n});\n\nit('should not call a monitor that is removed during an event (monitor removing monitor)', () => {\n\tconst ordered: string[] = [];\n\tconst [A] = getElements('div');\n\n\tconst cleanupMonitor1 = combine(\n\t\t() => ordered.push('monitor1:cleanup'),\n\t\tmonitorForElements({\n\t\t\tonDragStart: () => {\n\t\t\t\tordered.push('monitor1:start');\n\t\t\t\tcleanupMonitor2();\n\t\t\t},\n\t\t}),\n\t);\n\tconst cleanupMonitor2 = combine(\n\t\t() => ordered.push('monitor2:cleanup'),\n\t\tmonitorForElements({\n\t\t\tonDragStart: () => ordered.push('monitor2:start'),\n\t\t}),\n\t);\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonDragStart: () => {\n\t\t\t\tordered.push('draggable:start');\n\t\t\t},\n\t\t}),\n\t);\n\n\tuserEvent.lift(A);\n\n\texpect(ordered).toEqual(['draggable:start', 'monitor1:start', 'monitor2:cleanup']);\n\tordered.length = 0;\n\n\tcleanup();\n\tcleanupMonitor1();\n\tcleanupMonitor2();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/monitor/uniqueness.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport { draggable, monitorForElements } from '../../../../src/entry-point/element/adapter';\nimport { appendToBody, getElements, reset } from '../../_util';\n\nafterEach(reset);\n\nit('should not treat two monitors as equal that share the same arguments', () => {\n\tconst [A] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst args = {\n\t\tonGenerateDragPreview: () => ordered.push('monitor:preview'),\n\t};\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t}),\n\t\tmonitorForElements(args),\n\t\tmonitorForElements(args),\n\t);\n\n\tfireEvent.dragStart(A);\n\n\texpect(ordered).toEqual(['draggable:preview', 'monitor:preview', 'monitor:preview']);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/previous-location-should-match-last-current.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport invariant from 'tiny-invariant';\n\nimport { combine } from '../../../src/entry-point/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\ttype ElementEventPayloadMap,\n\tmonitorForElements,\n} from '../../../src/entry-point/element/adapter';\nimport { type DragLocationHistory, type DropTargetRecord } from '../../../src/entry-point/types';\nimport { appendToBody, getBubbleOrderedTree, getDefaultInput, reset } from '../_util';\n\nafterEach(reset);\n\nfunction getLookup() {\n\tconst storage = new Map<keyof ElementEventPayloadMap, DragLocationHistory>();\n\n\tfunction get(key: keyof ElementEventPayloadMap): DragLocationHistory {\n\t\tconst value = storage.get(key);\n\t\tinvariant(value, `Could not get value with key (${key}) from map`);\n\t\treturn value;\n\t}\n\n\tfunction set(key: keyof ElementEventPayloadMap, location: DragLocationHistory): void {\n\t\tinvariant(!storage.has(key), `Unexpected write to used key (${key})`);\n\t\tstorage.set(key, location);\n\t}\n\n\treturn { set, get };\n}\n\ntest('Scenario: ([B,A] -> cancel)', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst lookup = getLookup();\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonGenerateDragPreview: ({ location }) => {\n\t\t\t\tordered.push('monitor:preview');\n\t\t\t\tlookup.set('onGenerateDragPreview', location);\n\t\t\t},\n\t\t\tonDragStart: ({ location }) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t\tlookup.set('onDragStart', location);\n\t\t\t},\n\t\t\tonDrag: ({ location }) => {\n\t\t\t\tordered.push('monitor:drag');\n\t\t\t\tlookup.set('onDrag', location);\n\t\t\t},\n\t\t\tonDropTargetChange: ({ location }) => {\n\t\t\t\tordered.push('monitor:change');\n\t\t\t\tlookup.set('onDropTargetChange', location);\n\t\t\t},\n\t\t\tonDrop: ({ location }) => {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t\tlookup.set('onDrop', location);\n\t\t\t},\n\t\t}),\n\t);\n\n\t// Lift [A]\n\tconst liftInput = getDefaultInput({ clientX: 1 });\n\tfireEvent.dragStart(draggableEl, liftInput);\n\n\tconst initial: DropTargetRecord[] = [\n\t\t{\n\t\t\telement: B,\n\t\t\tisActiveDueToStickiness: false,\n\t\t\tdata: {},\n\t\t\tdropEffect: 'move',\n\t\t},\n\t\t{\n\t\t\telement: A,\n\t\t\tisActiveDueToStickiness: false,\n\t\t\tdata: {},\n\t\t\tdropEffect: 'move',\n\t\t},\n\t];\n\tconst liftExpected: DragLocationHistory = {\n\t\tinitial: {\n\t\t\tinput: liftInput,\n\t\t\tdropTargets: initial,\n\t\t},\n\t\tprevious: {\n\t\t\tdropTargets: [],\n\t\t},\n\t\tcurrent: {\n\t\t\tinput: liftInput,\n\t\t\tdropTargets: initial,\n\t\t},\n\t};\n\texpect(ordered).toEqual(['monitor:preview']);\n\texpect(lookup.get('onGenerateDragPreview')).toEqual(liftExpected);\n\tordered.length = 0;\n\n\t// complete lift\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['monitor:start']);\n\t// `onGenerateDragPreview` and `onDragStart` get the same previous / current values\n\texpect(lookup.get('onDragStart')).toEqual(liftExpected);\n\t// they even have the same reference\n\texpect(lookup.get('onGenerateDragPreview')).toBe(lookup.get('onDragStart'));\n\tordered.length = 0;\n\n\t// [B, A] -> cancel (part 1: dragleave)\n\tconst leaveInput = getDefaultInput({ clientX: 3 });\n\tfireEvent.dragLeave(A, leaveInput);\n\n\tconst leaveAExpected: DragLocationHistory = {\n\t\tinitial: liftExpected.initial,\n\t\tprevious: {\n\t\t\tdropTargets: lookup.get('onDragStart').current.dropTargets,\n\t\t},\n\t\tcurrent: {\n\t\t\tinput: liftInput,\n\t\t\t// over nothing now\n\t\t\tdropTargets: [],\n\t\t},\n\t};\n\texpect(ordered).toEqual(['monitor:change']);\n\t// value is what we expect\n\texpect(lookup.get('onDropTargetChange')).toEqual(leaveAExpected);\n\t// previous points to last current\n\texpect(lookup.get('onDropTargetChange').previous.dropTargets).toBe(\n\t\tlookup.get('onDragStart').current.dropTargets,\n\t);\n\tordered.length = 0;\n\n\t// [A] -> cancel (part 2: dragend)\n\tconst dragEndInput = getDefaultInput({ clientX: 4 });\n\tfireEvent.dragEnd(A, dragEndInput);\n\n\tconst dropExpected: DragLocationHistory = {\n\t\tinitial: liftExpected.initial,\n\t\tprevious: {\n\t\t\tdropTargets: [],\n\t\t},\n\t\tcurrent: {\n\t\t\t// using input from dragEnd\n\t\t\tinput: dragEndInput,\n\t\t\t// over nothing now\n\t\t\tdropTargets: [],\n\t\t},\n\t};\n\texpect(ordered).toEqual(['monitor:drop']);\n\t// value is what we expect\n\texpect(lookup.get('onDrop')).toEqual(dropExpected);\n\t// previous points to last current\n\texpect(lookup.get('onDrop').previous.dropTargets).toBe(\n\t\tlookup.get('onDropTargetChange').current.dropTargets,\n\t);\n\n\tcleanup();\n});\n\ntest('Scenario: ([B,A] -> [B,A] -> [A] -> drop)', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst lookup = getLookup();\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonGenerateDragPreview: ({ location }) => {\n\t\t\t\tordered.push('monitor:preview');\n\t\t\t\tlookup.set('onGenerateDragPreview', location);\n\t\t\t},\n\t\t\tonDragStart: ({ location }) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t\tlookup.set('onDragStart', location);\n\t\t\t},\n\t\t\tonDrag: ({ location }) => {\n\t\t\t\tordered.push('monitor:drag');\n\t\t\t\tlookup.set('onDrag', location);\n\t\t\t},\n\t\t\tonDropTargetChange: ({ location }) => {\n\t\t\t\tordered.push('monitor:change');\n\t\t\t\tlookup.set('onDropTargetChange', location);\n\t\t\t},\n\t\t\tonDrop: ({ location }) => {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t\tlookup.set('onDrop', location);\n\t\t\t},\n\t\t}),\n\t);\n\n\t// Lift [A]\n\tconst liftInput = getDefaultInput({ clientX: 1 });\n\tfireEvent.dragStart(draggableEl, liftInput);\n\n\tconst initial: DropTargetRecord[] = [\n\t\t{\n\t\t\telement: B,\n\t\t\tisActiveDueToStickiness: false,\n\t\t\tdata: {},\n\t\t\tdropEffect: 'move',\n\t\t},\n\t\t{\n\t\t\telement: A,\n\t\t\tisActiveDueToStickiness: false,\n\t\t\tdata: {},\n\t\t\tdropEffect: 'move',\n\t\t},\n\t];\n\tconst liftExpected: DragLocationHistory = {\n\t\tinitial: {\n\t\t\tinput: liftInput,\n\t\t\tdropTargets: initial,\n\t\t},\n\t\tprevious: {\n\t\t\tdropTargets: [],\n\t\t},\n\t\tcurrent: {\n\t\t\tinput: liftInput,\n\t\t\tdropTargets: initial,\n\t\t},\n\t};\n\texpect(ordered).toEqual(['monitor:preview']);\n\texpect(lookup.get('onGenerateDragPreview')).toEqual(liftExpected);\n\tordered.length = 0;\n\n\t// complete lift\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['monitor:start']);\n\texpect(lookup.get('onDragStart')).toEqual(liftExpected);\n\tordered.length = 0;\n\n\t// Continue moving over [B, A]\n\t// [B, A] -> [B, A]\n\tconst moveInput = getDefaultInput({ clientX: 2 });\n\tfireEvent.dragOver(B, moveInput);\n\n\texpect(ordered.length).toBe(0);\n\n\t// flush drag event\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\n\tconst moveExpected: DragLocationHistory = {\n\t\tinitial: liftExpected.initial,\n\t\tprevious: {\n\t\t\tdropTargets: liftExpected.current.dropTargets,\n\t\t},\n\t\tcurrent: {\n\t\t\tinput: moveInput,\n\t\t\tdropTargets: liftExpected.initial.dropTargets,\n\t\t},\n\t};\n\texpect(ordered).toEqual(['monitor:drag']);\n\t// value is what we expect\n\texpect(lookup.get('onDrag')).toEqual(moveExpected);\n\t// previous points to last current\n\texpect(lookup.get('onDrag').previous.dropTargets).toBe(\n\t\tlookup.get('onDragStart').current.dropTargets,\n\t);\n\tordered.length = 0;\n\n\t// [B, A] -> [A]\n\tconst enterAInput = getDefaultInput({ clientX: 3 });\n\tfireEvent.dragEnter(A, enterAInput);\n\n\tconst enterAExpected: DragLocationHistory = {\n\t\tinitial: liftExpected.initial,\n\t\tprevious: {\n\t\t\tdropTargets: lookup.get('onDrag').current.dropTargets,\n\t\t},\n\t\tcurrent: {\n\t\t\tinput: enterAInput,\n\t\t\t// only over [A] now\n\t\t\tdropTargets: [liftExpected.initial.dropTargets[1]],\n\t\t},\n\t};\n\texpect(ordered).toEqual(['monitor:change']);\n\t// value is what we expect\n\texpect(lookup.get('onDropTargetChange')).toEqual(enterAExpected);\n\t// previous points to last current\n\texpect(lookup.get('onDropTargetChange').previous.dropTargets).toBe(\n\t\tlookup.get('onDrag').current.dropTargets,\n\t);\n\tordered.length = 0;\n\n\t// [A] -> drop\n\tconst dropInput = getDefaultInput({ clientX: 4 });\n\tfireEvent.drop(A, dropInput);\n\n\tconst dropExpected: DragLocationHistory = {\n\t\tinitial: liftExpected.initial,\n\t\tprevious: {\n\t\t\tdropTargets: lookup.get('onDropTargetChange').current.dropTargets,\n\t\t},\n\t\tcurrent: {\n\t\t\tinput: dropInput,\n\t\t\t// only over [A] now\n\t\t\tdropTargets: [liftExpected.initial.dropTargets[1]],\n\t\t},\n\t};\n\texpect(ordered).toEqual(['monitor:drop']);\n\t// value is what we expect\n\texpect(lookup.get('onDrop')).toEqual(dropExpected);\n\t// previous points to last current\n\texpect(lookup.get('onDrop').previous.dropTargets).toBe(\n\t\tlookup.get('onDropTargetChange').current.dropTargets,\n\t);\n\n\tcleanup();\n});\n\ntest('Scenario: ([B, A] -> drop (lift flush)', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst lookup = getLookup();\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonGenerateDragPreview: ({ location }) => {\n\t\t\t\tordered.push('monitor:preview');\n\t\t\t\tlookup.set('onGenerateDragPreview', location);\n\t\t\t},\n\t\t\tonDragStart: ({ location }) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t\tlookup.set('onDragStart', location);\n\t\t\t},\n\t\t\tonDrag: ({ location }) => {\n\t\t\t\tordered.push('monitor:drag');\n\t\t\t\tlookup.set('onDrag', location);\n\t\t\t},\n\t\t\tonDropTargetChange: ({ location }) => {\n\t\t\t\tordered.push('monitor:change');\n\t\t\t\tlookup.set('onDropTargetChange', location);\n\t\t\t},\n\t\t\tonDrop: ({ location }) => {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t\tlookup.set('onDrop', location);\n\t\t\t},\n\t\t}),\n\t);\n\n\t// Lift [A]\n\tconst liftInput = getDefaultInput({ clientX: 1 });\n\tfireEvent.dragStart(draggableEl, liftInput);\n\n\tconst initial: DropTargetRecord[] = [\n\t\t{\n\t\t\telement: B,\n\t\t\tisActiveDueToStickiness: false,\n\t\t\tdata: {},\n\t\t\tdropEffect: 'move',\n\t\t},\n\t\t{\n\t\t\telement: A,\n\t\t\tisActiveDueToStickiness: false,\n\t\t\tdata: {},\n\t\t\tdropEffect: 'move',\n\t\t},\n\t];\n\tconst liftExpected: DragLocationHistory = {\n\t\tinitial: {\n\t\t\tinput: liftInput,\n\t\t\tdropTargets: initial,\n\t\t},\n\t\tprevious: {\n\t\t\tdropTargets: [],\n\t\t},\n\t\tcurrent: {\n\t\t\tinput: liftInput,\n\t\t\tdropTargets: initial,\n\t\t},\n\t};\n\texpect(ordered).toEqual(['monitor:preview']);\n\texpect(lookup.get('onGenerateDragPreview')).toEqual(liftExpected);\n\tordered.length = 0;\n\n\t// \"drop\" on B before `onDragStart` was triggered in the next animation frame\n\tconst dropInput = getDefaultInput({ clientX: 4 });\n\tfireEvent.drop(B, dropInput);\n\n\texpect(ordered).toEqual(['monitor:start', 'monitor:drop']);\n\t// `onGenerateDragPreview` and `onDragStart` get the same previous / current values\n\texpect(lookup.get('onDragStart')).toEqual(liftExpected);\n\t// they even have the same reference\n\texpect(lookup.get('onGenerateDragPreview')).toBe(lookup.get('onDragStart'));\n\n\tconst dropExpected: DragLocationHistory = {\n\t\tinitial: liftExpected.initial,\n\t\tprevious: {\n\t\t\tdropTargets: lookup.get('onDragStart').current.dropTargets,\n\t\t},\n\t\tcurrent: {\n\t\t\tinput: dropInput,\n\t\t\tdropTargets: lookup.get('onDragStart').current.dropTargets,\n\t\t},\n\t};\n\texpect(lookup.get('onDrop')).toEqual(dropExpected);\n\t// previous points to last current\n\texpect(lookup.get('onDrop').previous.dropTargets).toBe(\n\t\tlookup.get('onDragStart').current.dropTargets,\n\t);\n\n\tcleanup();\n});\n\ntest('Scenario: ([B, A] -> [B, A] (onDrag canceled by enter into) -> [A]', () => {\n\tconst [draggableEl, B, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst lookup = getLookup();\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: B,\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonGenerateDragPreview: ({ location }) => {\n\t\t\t\tordered.push('monitor:preview');\n\t\t\t\tlookup.set('onGenerateDragPreview', location);\n\t\t\t},\n\t\t\tonDragStart: ({ location }) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t\tlookup.set('onDragStart', location);\n\t\t\t},\n\t\t\tonDrag: ({ location }) => {\n\t\t\t\tordered.push('monitor:drag');\n\t\t\t\tlookup.set('onDrag', location);\n\t\t\t},\n\t\t\tonDropTargetChange: ({ location }) => {\n\t\t\t\tordered.push('monitor:change');\n\t\t\t\tlookup.set('onDropTargetChange', location);\n\t\t\t},\n\t\t\tonDrop: ({ location }) => {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t\tlookup.set('onDrop', location);\n\t\t\t},\n\t\t}),\n\t);\n\n\t// Lift [B, A]\n\tconst liftInput = getDefaultInput({ clientX: 1 });\n\tfireEvent.dragStart(draggableEl, liftInput);\n\n\tconst initial: DropTargetRecord[] = [\n\t\t{\n\t\t\telement: B,\n\t\t\tisActiveDueToStickiness: false,\n\t\t\tdata: {},\n\t\t\tdropEffect: 'move',\n\t\t},\n\t\t{\n\t\t\telement: A,\n\t\t\tisActiveDueToStickiness: false,\n\t\t\tdata: {},\n\t\t\tdropEffect: 'move',\n\t\t},\n\t];\n\tconst liftExpected: DragLocationHistory = {\n\t\tinitial: {\n\t\t\tinput: liftInput,\n\t\t\tdropTargets: initial,\n\t\t},\n\t\tprevious: {\n\t\t\tdropTargets: [],\n\t\t},\n\t\tcurrent: {\n\t\t\tinput: liftInput,\n\t\t\tdropTargets: initial,\n\t\t},\n\t};\n\texpect(ordered).toEqual(['monitor:preview']);\n\texpect(lookup.get('onGenerateDragPreview')).toEqual(liftExpected);\n\tordered.length = 0;\n\n\t// complete lift\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['monitor:start']);\n\t// `onGenerateDragPreview` and `onDragStart` get the same previous / current values\n\texpect(lookup.get('onDragStart')).toEqual(liftExpected);\n\t// they even have the same reference\n\texpect(lookup.get('onGenerateDragPreview')).toBe(lookup.get('onDragStart'));\n\tordered.length = 0;\n\n\tconst overInput = getDefaultInput({ clientX: 2 });\n\tfireEvent.dragOver(B, overInput);\n\n\t// \"onDrag\" not executed yet yet\n\texpect(ordered.length).toBe(0);\n\n\t// cancelling \"onDrag\" by entering into A\n\tconst enterAInput = getDefaultInput({ clientX: 3 });\n\tfireEvent.dragEnter(A, enterAInput);\n\texpect(ordered).toEqual(['monitor:change']);\n\tconst enterAExpected: DragLocationHistory = {\n\t\tinitial: {\n\t\t\tinput: liftInput,\n\t\t\tdropTargets: initial,\n\t\t},\n\t\tprevious: {\n\t\t\t// last published event\n\t\t\tdropTargets: lookup.get('onDragStart').current.dropTargets,\n\t\t},\n\t\tcurrent: {\n\t\t\tinput: enterAInput,\n\t\t\tdropTargets: [initial[1]],\n\t\t},\n\t};\n\t// value is what we expect\n\texpect(lookup.get('onDropTargetChange')).toEqual(enterAExpected);\n\t// `previous` pointing to last published event's `current`\n\texpect(lookup.get('onDropTargetChange').previous.dropTargets).toEqual(\n\t\tlookup.get('onDragStart').current.dropTargets,\n\t);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/public-utils/block-dragging-to-iframes.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport { draggable, dropTargetForElements } from '../../../../src/entry-point/element/adapter';\nimport { blockDraggingToIFrames } from '../../../../src/entry-point/element/block-dragging-to-iframes';\nimport { type CleanupFn } from '../../../../src/entry-point/types';\nimport { appendToBody, getElements, reset, userEvent } from '../../_util';\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nafterEach(reset);\n\nfunction isPointerEventsBlocked(iframe: HTMLIFrameElement): boolean {\n\treturn (\n\t\tiframe.style.getPropertyValue('pointer-events') === 'none' &&\n\t\tiframe.style.getPropertyPriority('pointer-events') === 'important'\n\t);\n}\n\nit('should block dragging to iframes during a drag', () => {\n\tconst [iframe] = getElements('iframe');\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(iframe, element),\n\t\tblockDraggingToIFrames({ element }),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('preview'),\n\t\t\tonDragStart: () => ordered.push('start'),\n\t\t\tonDrop: () => ordered.push('drop'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(element);\n\n\texpect(ordered).toEqual(['preview']);\n\tordered.length = 0;\n\texpect(isPointerEventsBlocked(iframe)).toBe(true);\n\n\t// finish the lift\n\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['start']);\n\tordered.length = 0;\n\texpect(isPointerEventsBlocked(iframe)).toBe(true);\n\n\t// end the drag\n\tfireEvent.dragEnd(element);\n\n\texpect(ordered).toEqual(['drop']);\n\tordered.length = 0;\n\texpect(isPointerEventsBlocked(iframe)).toBe(false);\n\n\tcleanup();\n});\n\nit('should block dragging to iframes even if unregistered during a drag', () => {\n\tconst [iframe] = getElements('iframe');\n\tconst [element, A] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst unregister = blockDraggingToIFrames({ element });\n\tconst cleanup = combine(\n\t\tappendToBody(iframe, element, A),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('preview'),\n\t\t\tonDragStart: () => ordered.push('start'),\n\t\t\tonDropTargetChange: () => ordered.push('change'),\n\t\t\tonDrop: () => ordered.push('drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t}),\n\t);\n\n\tuserEvent.lift(element);\n\n\texpect(ordered).toEqual(['preview', 'start']);\n\tordered.length = 0;\n\texpect(isPointerEventsBlocked(iframe)).toBe(true);\n\n\tunregister();\n\n\tfireEvent.dragEnter(A);\n\texpect(ordered).toEqual(['change']);\n\tordered.length = 0;\n\texpect(isPointerEventsBlocked(iframe)).toBe(true);\n\n\t// end the drag\n\tuserEvent.drop(element);\n\n\texpect(ordered).toEqual(['drop']);\n\tordered.length = 0;\n\texpect(isPointerEventsBlocked(iframe)).toBe(false);\n\n\tcleanup();\n});\n\nit('should block dragging to iframes [multiple registrations]', () => {\n\tconst [iframe] = getElements('iframe');\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(iframe, element),\n\t\tblockDraggingToIFrames({ element }),\n\t\tblockDraggingToIFrames({ element }),\n\t\tblockDraggingToIFrames({ element }),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('preview'),\n\t\t\tonDragStart: () => ordered.push('start'),\n\t\t\tonDrop: () => ordered.push('drop'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(element);\n\n\texpect(ordered).toEqual(['preview', 'start']);\n\tordered.length = 0;\n\texpect(isPointerEventsBlocked(iframe)).toBe(true);\n\n\t// end the drag\n\tfireEvent.dragEnd(element);\n\n\texpect(ordered).toEqual(['drop']);\n\tordered.length = 0;\n\texpect(isPointerEventsBlocked(iframe)).toBe(false);\n\n\tcleanup();\n});\n\nit('should not block when there are no more registrations', () => {\n\tconst [iframe] = getElements('iframe');\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst unregister = blockDraggingToIFrames({ element });\n\tconst cleanup = combine(\n\t\tappendToBody(iframe, element),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('preview'),\n\t\t\tonDragStart: () => ordered.push('start'),\n\t\t\tonDrop: () => ordered.push('drop'),\n\t\t}),\n\t);\n\n\t// first interaction: expecting to be blocked\n\n\tuserEvent.lift(element);\n\n\texpect(ordered).toEqual(['preview', 'start']);\n\tordered.length = 0;\n\texpect(isPointerEventsBlocked(iframe)).toBe(true);\n\n\t// end the drag\n\tfireEvent.dragEnd(element);\n\n\texpect(ordered).toEqual(['drop']);\n\tordered.length = 0;\n\texpect(isPointerEventsBlocked(iframe)).toBe(false);\n\n\t// first interaction: no more blocking as fix is unregistered\n\tunregister();\n\n\tuserEvent.lift(element);\n\n\texpect(ordered).toEqual(['preview', 'start']);\n\tordered.length = 0;\n\texpect(isPointerEventsBlocked(iframe)).toBe(false);\n\n\t// end the drag\n\tfireEvent.dragEnd(element);\n\n\texpect(ordered).toEqual(['drop']);\n\tordered.length = 0;\n\texpect(isPointerEventsBlocked(iframe)).toBe(false);\n\n\tcleanup();\n});\n\nit('should not block dragging to iframes mounted during a drag', () => {\n\tconst [iframe] = getElements('iframe');\n\tconst [element, A] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanups: CleanupFn[] = [\n\t\tcombine(\n\t\t\tappendToBody(iframe, element, A),\n\t\t\tblockDraggingToIFrames({ element }),\n\t\t\tdraggable({\n\t\t\t\telement,\n\t\t\t\tonGenerateDragPreview: () => ordered.push('preview'),\n\t\t\t\tonDragStart: () => ordered.push('start'),\n\t\t\t\tonDrop: () => ordered.push('drop'),\n\t\t\t\tonDropTargetChange: () => ordered.push('change'),\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement: A,\n\t\t\t}),\n\t\t),\n\t];\n\n\tuserEvent.lift(element);\n\n\texpect(ordered).toEqual(['preview', 'start']);\n\tordered.length = 0;\n\texpect(isPointerEventsBlocked(iframe)).toBe(true);\n\n\t// Adding a new iframe.\n\t// Expecting pointer events won't be added during this drag.\n\tconst [addedIframe] = getElements('iframe');\n\tcleanups.push(appendToBody(addedIframe));\n\n\t// [] -> [A]\n\tfireEvent.dragEnter(A);\n\n\texpect(ordered).toEqual(['change']);\n\tordered.length = 0;\n\texpect(isPointerEventsBlocked(addedIframe)).toBe(false);\n\texpect(isPointerEventsBlocked(iframe)).toBe(true);\n\n\t// end the drag\n\tuserEvent.drop(A);\n\n\texpect(ordered).toEqual(['drop']);\n\tordered.length = 0;\n\texpect(isPointerEventsBlocked(iframe)).toBe(false);\n\texpect(isPointerEventsBlocked(addedIframe)).toBe(false);\n\n\tcombine(...cleanups)();\n});\n\nit('should only block dragging for the provided element', () => {\n\tconst [iframe] = getElements('iframe');\n\tconst [first, second] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(iframe, first),\n\t\tblockDraggingToIFrames({ element: second }),\n\t\tdraggable({\n\t\t\telement: first,\n\t\t\tonGenerateDragPreview: () => ordered.push('first:preview'),\n\t\t\tonDragStart: () => ordered.push('first:start'),\n\t\t\tonDrop: () => ordered.push('first:drop'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement: second,\n\t\t\tonGenerateDragPreview: () => ordered.push('second:preview'),\n\t\t\tonDragStart: () => ordered.push('second:start'),\n\t\t\tonDrop: () => ordered.push('second:drop'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(first);\n\n\texpect(ordered).toEqual(['first:preview', 'first:start']);\n\tordered.length = 0;\n\texpect(isPointerEventsBlocked(iframe)).toBe(false);\n\n\t// end the drag\n\tuserEvent.cancel();\n\n\texpect(ordered).toEqual(['first:drop']);\n\tordered.length = 0;\n\texpect(isPointerEventsBlocked(iframe)).toBe(false);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/public-utils/center-under-pointer.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport invariant from 'tiny-invariant';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdraggable,\n\ttype ElementEventPayloadMap,\n} from '../../../../src/entry-point/element/adapter';\nimport { centerUnderPointer } from '../../../../src/entry-point/element/center-under-pointer';\nimport { setCustomNativeDragPreview } from '../../../../src/entry-point/element/set-custom-native-drag-preview';\nimport { appendToBody, getElements, getRect, reset, setBoundingClientRect } from '../../_util';\n\n/**\n * Note: I have tested what I can about custom native drag previews in this file.\n * Ideally we would have VR tests that ensured the custom native drag preview\n * behaved how we expected in lots of scenarios. However, our VR testing today\n * does not capture native drag previews as drag previews are rendered outside of\n * the browser window on a separate native layer.\n */\n\nafterEach(reset);\n\nit('should position the center of the drag preview user the users pointer', async () => {\n\tconst [A] = getElements('div');\n\tconst ordered: string[] = [];\n\tlet pointerToContainer: HTMLElement | null = null;\n\tconst rect: DOMRect = getRect({ top: 0, bottom: 100, left: 0, right: 20 });\n\tconst setImageMock = jest.fn();\n\tfunction makeMock(\n\t\tnativeSetDragImage: ElementEventPayloadMap['onGenerateDragPreview']['nativeSetDragImage'],\n\t) {\n\t\tinvariant(nativeSetDragImage);\n\t\treturn (...args: Parameters<typeof nativeSetDragImage>) => {\n\t\t\tsetImageMock(...args);\n\t\t\tnativeSetDragImage(...args);\n\t\t};\n\t}\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\tordered.push('preview');\n\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\tgetOffset: centerUnderPointer,\n\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\tpointerToContainer = container;\n\t\t\t\t\t\tsetBoundingClientRect(container, rect);\n\t\t\t\t\t\tconst preview = document.createElement('div');\n\t\t\t\t\t\tcontainer.appendChild(preview);\n\t\t\t\t\t},\n\t\t\t\t\tnativeSetDragImage: makeMock(nativeSetDragImage),\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDragStart: () => ordered.push('start'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(A);\n\n\texpect(ordered).toEqual(['preview']);\n\tordered.length = 0;\n\t// setDragImage not called until the next microtask for framework compatibility\n\tawait 'microtask';\n\texpect(setImageMock).nthCalledWith(1, pointerToContainer, rect.width / 2, rect.height / 2);\n\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['start']);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/public-utils/format-urls-for-external.spec.ts",
    "content": "import { combine } from '../../../../src/entry-point/combine';\nimport { draggable } from '../../../../src/entry-point/element/adapter';\nimport { formatURLsForExternal } from '../../../../src/entry-point/element/format-urls-for-external';\nimport { appendToBody, getElements, reset } from '../../_util';\n\nafterEach(reset);\n\nit('should allow the ability to add multiple urls to a drag', () => {\n\tconst [A] = getElements('div');\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('preview'),\n\t\t\tgetInitialDataForExternal: () => ({\n\t\t\t\t'text/uri-list': formatURLsForExternal([\n\t\t\t\t\t'https://atlassian.design/',\n\t\t\t\t\t'https://domevents.dev/',\n\t\t\t\t]),\n\t\t\t}),\n\t\t}),\n\t);\n\n\tconst event = new DragEvent('dragstart', { bubbles: true });\n\n\tA.dispatchEvent(event);\n\n\texpect(ordered).toEqual(['preview']);\n\texpect(event.dataTransfer?.types.includes('text/uri-list')).toBe(true);\n\texpect(event.dataTransfer?.getData('text/uri-list')).toBe(\n\t\t'https://atlassian.design/\\r\\nhttps://domevents.dev/',\n\t);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/public-utils/pointer-outside-of-preview.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport invariant from 'tiny-invariant';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdraggable,\n\ttype ElementEventPayloadMap,\n} from '../../../../src/entry-point/element/adapter';\nimport { pointerOutsideOfPreview } from '../../../../src/entry-point/element/pointer-outside-of-preview';\nimport { setCustomNativeDragPreview } from '../../../../src/entry-point/element/set-custom-native-drag-preview';\nimport { appendToBody, getElements, getRect, reset, setBoundingClientRect } from '../../_util';\n\nafterEach(reset);\n\nit('should position shift the drag preview off the users pointer (ltr)', async () => {\n\tconst [A] = getElements('div');\n\tconst ordered: string[] = [];\n\tlet pointerToContainer: HTMLElement | null = null;\n\tconst rect: DOMRect = getRect({ top: 0, bottom: 100, left: 0, right: 20 });\n\tconst setImageMock = jest.fn();\n\tfunction makeMock(\n\t\tnativeSetDragImage: ElementEventPayloadMap['onGenerateDragPreview']['nativeSetDragImage'],\n\t) {\n\t\tinvariant(nativeSetDragImage);\n\t\treturn (...args: Parameters<typeof nativeSetDragImage>) => {\n\t\t\tsetImageMock(...args);\n\t\t\tnativeSetDragImage(...args);\n\t\t};\n\t}\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\tordered.push('preview');\n\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\tgetOffset: pointerOutsideOfPreview({\n\t\t\t\t\t\tx: '10px',\n\t\t\t\t\t\ty: '20px',\n\t\t\t\t\t}),\n\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\tpointerToContainer = container;\n\t\t\t\t\t\tsetBoundingClientRect(container, rect);\n\t\t\t\t\t\tconst preview = document.createElement('div');\n\t\t\t\t\t\tcontainer.appendChild(preview);\n\t\t\t\t\t},\n\t\t\t\t\tnativeSetDragImage: makeMock(nativeSetDragImage),\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDragStart: () => ordered.push('start'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(A);\n\n\texpect(ordered).toEqual(['preview']);\n\tordered.length = 0;\n\t// position drag preview at default of top / left at 0 on the users pointer\n\tinvariant(pointerToContainer);\n\t// setDragImage not called until the next microtask for framework compatibility\n\tawait 'microtask';\n\t// position drag preview relative to the top left corner\n\texpect(setImageMock).toHaveBeenNthCalledWith(1, pointerToContainer, 0, 0);\n\t// use a transparent border to shift the drag preview\n\texpect((pointerToContainer as HTMLElement).style.borderInlineStart).toEqual(\n\t\t'10px solid transparent',\n\t);\n\texpect((pointerToContainer as HTMLElement).style.borderTop).toEqual('20px solid transparent');\n\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['start']);\n\n\tcleanup();\n});\n\nit('should position shift the drag preview off the users pointer (rtl)', async () => {\n\tconst cleanupWindow = (() => {\n\t\tconst original = window.getComputedStyle;\n\n\t\t// JSDOM does not work well with `direction` + `getComputedStyle`\n\t\twindow.getComputedStyle = (el: Element) => {\n\t\t\tconst result = original(el);\n\t\t\tresult.direction = 'rtl';\n\t\t\treturn result;\n\t\t};\n\t\treturn function cleanup() {\n\t\t\twindow.getComputedStyle = original;\n\t\t};\n\t})();\n\n\tconst [A] = getElements('div');\n\n\tconst ordered: string[] = [];\n\tlet pointerToContainer: HTMLElement | null = null;\n\tconst rect: DOMRect = getRect({ top: 0, bottom: 100, left: 0, right: 20 });\n\tconst setImageMock = jest.fn();\n\tfunction makeMock(\n\t\tnativeSetDragImage: ElementEventPayloadMap['onGenerateDragPreview']['nativeSetDragImage'],\n\t) {\n\t\tinvariant(nativeSetDragImage);\n\t\treturn (...args: Parameters<typeof nativeSetDragImage>) => {\n\t\t\tsetImageMock(...args);\n\t\t\tnativeSetDragImage(...args);\n\t\t};\n\t}\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\tordered.push('preview');\n\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\tgetOffset: pointerOutsideOfPreview({\n\t\t\t\t\t\tx: '10px',\n\t\t\t\t\t\ty: '20px',\n\t\t\t\t\t}),\n\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\tpointerToContainer = container;\n\t\t\t\t\t\tsetBoundingClientRect(container, rect);\n\t\t\t\t\t\tconst preview = document.createElement('div');\n\t\t\t\t\t\tcontainer.appendChild(preview);\n\t\t\t\t\t},\n\t\t\t\t\tnativeSetDragImage: makeMock(nativeSetDragImage),\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDragStart: () => ordered.push('start'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(A);\n\n\texpect(ordered).toEqual(['preview']);\n\tordered.length = 0;\n\t// position drag preview at default of top / left at 0 on the users pointer\n\tinvariant(pointerToContainer);\n\t// setDragImage not called until the next microtask for framework compatibility\n\tawait 'microtask';\n\t// position drag preview relative to the top right corner\n\texpect(setImageMock).toHaveBeenNthCalledWith(1, pointerToContainer, rect.width, 0);\n\t// use a transparent border to shift the drag preview\n\texpect((pointerToContainer as HTMLElement).style.borderInlineStart).toEqual(\n\t\t'10px solid transparent',\n\t);\n\texpect((pointerToContainer as HTMLElement).style.borderTop).toEqual('20px solid transparent');\n\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['start']);\n\n\tcleanup();\n\tcleanupWindow();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/public-utils/preserve-offset-on-source.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport invariant from 'tiny-invariant';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdraggable,\n\ttype ElementEventPayloadMap,\n} from '../../../../src/entry-point/element/adapter';\nimport { preserveOffsetOnSource } from '../../../../src/entry-point/element/preserve-offset-on-source';\nimport { setCustomNativeDragPreview } from '../../../../src/entry-point/element/set-custom-native-drag-preview';\nimport {\n\tappendToBody,\n\tgetDefaultInput,\n\tgetElements,\n\tgetRect,\n\treset,\n\tsetBoundingClientRect,\n} from '../../_util';\n\n/**\n * Note: I have tested what I can about custom native drag previews in this file.\n * Ideally we would have VR tests that ensured the custom native drag preview\n * behaved how we expected in lots of scenarios. However, our VR testing today\n * does not capture native drag previews as drag previews are rendered outside of\n * the browser window on a separate native layer.\n */\n\nafterEach(reset);\n\nit('should preserve the cursor position offset on the custom drag preview', async () => {\n\tconst [A] = getElements('div');\n\tconst ordered: string[] = [];\n\tlet pointerToContainer: HTMLElement | null = null;\n\t// source element has a width of 200px and a height of 40px, with a top and right offset of 100px\n\tconst sourceRect: DOMRect = getRect({\n\t\ttop: 100,\n\t\tbottom: 140,\n\t\tleft: 100,\n\t\tright: 300,\n\t});\n\t// preview element has a width of 200px and a height of 40px\n\tconst previewRect: DOMRect = getRect({\n\t\ttop: 0,\n\t\tbottom: 40,\n\t\tleft: 0,\n\t\tright: 200,\n\t});\n\tconst setImageMock = jest.fn();\n\tfunction makeMock(\n\t\tnativeSetDragImage: ElementEventPayloadMap['onGenerateDragPreview']['nativeSetDragImage'],\n\t) {\n\t\tinvariant(nativeSetDragImage);\n\t\treturn (...args: Parameters<typeof nativeSetDragImage>) => {\n\t\t\tsetImageMock(...args);\n\t\t\tnativeSetDragImage(...args);\n\t\t};\n\t}\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: ({ nativeSetDragImage, location, source }) => {\n\t\t\t\tordered.push('preview');\n\t\t\t\tsetBoundingClientRect(source.element, sourceRect);\n\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\tgetOffset: preserveOffsetOnSource({\n\t\t\t\t\t\telement: source.element,\n\t\t\t\t\t\t// cursor is 75% to the right and 25% to the bottom of the source element\n\t\t\t\t\t\tinput: getDefaultInput({ clientX: 250, clientY: 110 }),\n\t\t\t\t\t}),\n\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\tpointerToContainer = container;\n\t\t\t\t\t\tsetBoundingClientRect(container, previewRect);\n\t\t\t\t\t\tconst preview = document.createElement('div');\n\t\t\t\t\t\tcontainer.appendChild(preview);\n\t\t\t\t\t},\n\t\t\t\t\tnativeSetDragImage: makeMock(nativeSetDragImage),\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDragStart: () => ordered.push('start'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(A);\n\n\texpect(ordered).toEqual(['preview']);\n\tordered.length = 0;\n\n\t// setDragImage not called until the next microtask for framework compatibility\n\tawait 'microtask';\n\texpect(setImageMock).nthCalledWith(1, pointerToContainer, 150, 10);\n\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['start']);\n\n\tcleanup();\n});\n\nit('should keep the cursor position inside the drag preview when the preview is smaller than the source element', async () => {\n\tconst [A] = getElements('div');\n\tconst ordered: string[] = [];\n\tlet pointerToContainer: HTMLElement | null = null;\n\t// source element has a width of 200px and a height of 40px, with a top and right offset of 100px\n\tconst sourceRect: DOMRect = getRect({\n\t\ttop: 100,\n\t\tbottom: 140,\n\t\tleft: 100,\n\t\tright: 300,\n\t});\n\t// preview element has a width of 100px and a height of 20px (2 times smaller than the source element)\n\tconst previewRect: DOMRect = getRect({\n\t\ttop: 0,\n\t\tbottom: 20,\n\t\tleft: 0,\n\t\tright: 100,\n\t});\n\tconst setImageMock = jest.fn();\n\tfunction makeMock(\n\t\tnativeSetDragImage: ElementEventPayloadMap['onGenerateDragPreview']['nativeSetDragImage'],\n\t) {\n\t\tinvariant(nativeSetDragImage);\n\t\treturn (...args: Parameters<typeof nativeSetDragImage>) => {\n\t\t\tsetImageMock(...args);\n\t\t\tnativeSetDragImage(...args);\n\t\t};\n\t}\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: ({ nativeSetDragImage, location, source }) => {\n\t\t\t\tordered.push('preview');\n\t\t\t\tsetBoundingClientRect(source.element, sourceRect);\n\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\tgetOffset: preserveOffsetOnSource({\n\t\t\t\t\t\telement: source.element,\n\t\t\t\t\t\t// cursor is 75% to the right and 75% to the bottom of the source element\n\t\t\t\t\t\tinput: getDefaultInput({ clientX: 250, clientY: 130 }),\n\t\t\t\t\t}),\n\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\tpointerToContainer = container;\n\t\t\t\t\t\tsetBoundingClientRect(container, previewRect);\n\t\t\t\t\t\tconst preview = document.createElement('div');\n\t\t\t\t\t\tcontainer.appendChild(preview);\n\t\t\t\t\t},\n\t\t\t\t\tnativeSetDragImage: makeMock(nativeSetDragImage),\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDragStart: () => ordered.push('start'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(A);\n\n\texpect(ordered).toEqual(['preview']);\n\tordered.length = 0;\n\t// setDragImage not called until the next microtask for framework compatibility\n\tawait 'microtask';\n\t// assert that the offset will be the dimensions of the preview and not more\n\texpect(setImageMock).nthCalledWith(1, pointerToContainer, 100, 20);\n\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['start']);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/public-utils/set-custom-native-drag-preview.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport invariant from 'tiny-invariant';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdraggable,\n\ttype ElementEventPayloadMap,\n} from '../../../../src/entry-point/element/adapter';\nimport { setCustomNativeDragPreview } from '../../../../src/entry-point/element/set-custom-native-drag-preview';\nimport {\n\tappendToBody,\n\tgetElements,\n\tgetRect,\n\treset,\n\tsetBoundingClientRect,\n\tuserEvent,\n} from '../../_util';\n\n/**\n * Note: I have tested what I can about custom native drag previews in this file.\n * Ideally we would have VR tests that ensured the custom native drag preview\n * behaved how we expected in lots of scenarios. However, our VR testing today\n * does not capture native drag previews as drag previews are rendered outside of\n * the browser window on a separate native layer.\n */\n\nafterEach(reset);\n\ndescribe('cleanup in `onDragStart`', () => {\n\tit('should remove the container element from the body', () => {\n\t\tconst [A] = getElements('div');\n\t\tconst ordered: string[] = [];\n\t\tlet pointerToContainer: HTMLElement | null = null;\n\t\tconst cleanup = combine(\n\t\t\tappendToBody(A),\n\t\t\tdraggable({\n\t\t\t\telement: A,\n\t\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\t\tordered.push('preview');\n\t\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\t\tpointerToContainer = container;\n\t\t\t\t\t\t\tconst preview = document.createElement('div');\n\t\t\t\t\t\t\tcontainer.appendChild(preview);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragStart: () => ordered.push('start'),\n\t\t\t}),\n\t\t);\n\n\t\tfireEvent.dragStart(A);\n\n\t\texpect(ordered).toEqual(['preview']);\n\t\tordered.length = 0;\n\t\texpect(document.body.contains(pointerToContainer)).toBe(true);\n\n\t\t// After lift we expect `container` is removed from the `document.body`\n\t\t// @ts-expect-error\n\t\trequestAnimationFrame.step();\n\t\texpect(document.body.contains(pointerToContainer)).toBe(false);\n\t\texpect(ordered).toEqual(['start']);\n\n\t\tcleanup();\n\t});\n\n\tit('should only call the cleanup function once', () => {\n\t\tconst [A] = getElements('div');\n\t\tconst ordered: string[] = [];\n\t\tlet useCustomNativeDragPreview = true;\n\t\tconst cleanup = combine(\n\t\t\tappendToBody(A),\n\t\t\tdraggable({\n\t\t\t\telement: A,\n\t\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\t\tordered.push('preview');\n\t\t\t\t\tif (useCustomNativeDragPreview) {\n\t\t\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\t\t\tconst preview = document.createElement('div');\n\t\t\t\t\t\t\t\tcontainer.appendChild(preview);\n\t\t\t\t\t\t\t\treturn () => ordered.push('preview-cleanup');\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonDragStart: () => ordered.push('start'),\n\t\t\t\tonDrop: () => ordered.push('drop'),\n\t\t\t}),\n\t\t);\n\n\t\tfireEvent.dragStart(A);\n\n\t\texpect(ordered).toEqual(['preview']);\n\t\tordered.length = 0;\n\n\t\t// After lift we expect `container` is removed from the `document.body`\n\t\t// @ts-expect-error\n\t\trequestAnimationFrame.step();\n\t\texpect(ordered).toEqual(['start', 'preview-cleanup']);\n\t\tordered.length = 0;\n\n\t\tuserEvent.cancel();\n\t\texpect(ordered).toEqual(['drop']);\n\t\tordered.length = 0;\n\n\t\t// Start another drag, this time not using a custom drag preview\n\t\t// Our old function should not be called again\n\t\tuseCustomNativeDragPreview = false;\n\t\tuserEvent.lift(A);\n\t\tuserEvent.cancel();\n\t\texpect(ordered).toEqual(['preview', 'start', 'drop']);\n\n\t\tcleanup();\n\t});\n});\n\nit('should allow custom placement of the drag preview', async () => {\n\tconst [A] = getElements('div');\n\tconst ordered: string[] = [];\n\tlet pointerToContainer: HTMLElement | null = null;\n\tconst rect: DOMRect = getRect({ top: 0, bottom: 100, left: 0, right: 20 });\n\tconst setImageMock = jest.fn();\n\tfunction makeMock(\n\t\tnativeSetDragImage: ElementEventPayloadMap['onGenerateDragPreview']['nativeSetDragImage'],\n\t) {\n\t\tinvariant(nativeSetDragImage);\n\t\treturn (...args: Parameters<typeof nativeSetDragImage>) => {\n\t\t\tsetImageMock(...args);\n\t\t\tnativeSetDragImage(...args);\n\t\t};\n\t}\n\tconst previewOffset = { x: 1000, y: 2000 };\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\tordered.push('preview');\n\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\tgetOffset: () => previewOffset,\n\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\tpointerToContainer = container;\n\t\t\t\t\t\tsetBoundingClientRect(container, rect);\n\t\t\t\t\t\tconst preview = document.createElement('div');\n\t\t\t\t\t\tcontainer.appendChild(preview);\n\t\t\t\t\t},\n\t\t\t\t\tnativeSetDragImage: makeMock(nativeSetDragImage),\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDragStart: () => ordered.push('start'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(A);\n\n\texpect(ordered).toEqual(['preview']);\n\tordered.length = 0;\n\n\t// setDragImage not called until the next microtask for framework compatibility\n\tawait 'microtask';\n\n\texpect(setImageMock).nthCalledWith(1, pointerToContainer, previewOffset.x, previewOffset.y);\n\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['start']);\n\n\tcleanup();\n});\n\nit('should use the default placement function when none is provided', async () => {\n\tconst [A] = getElements('div');\n\tconst ordered: string[] = [];\n\tlet pointerToContainer: HTMLElement | null = null;\n\tconst rect: DOMRect = getRect({ top: 0, bottom: 100, left: 0, right: 20 });\n\tconst setImageMock = jest.fn();\n\tfunction makeMock(\n\t\tnativeSetDragImage: ElementEventPayloadMap['onGenerateDragPreview']['nativeSetDragImage'],\n\t) {\n\t\tinvariant(nativeSetDragImage);\n\t\treturn (...args: Parameters<typeof nativeSetDragImage>) => {\n\t\t\tsetImageMock(...args);\n\t\t\tnativeSetDragImage(...args);\n\t\t};\n\t}\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\tordered.push('preview');\n\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\tpointerToContainer = container;\n\t\t\t\t\t\tsetBoundingClientRect(container, rect);\n\t\t\t\t\t\tconst preview = document.createElement('div');\n\t\t\t\t\t\tcontainer.appendChild(preview);\n\t\t\t\t\t},\n\t\t\t\t\tnativeSetDragImage: makeMock(nativeSetDragImage),\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDragStart: () => ordered.push('start'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(A);\n\n\texpect(ordered).toEqual(['preview']);\n\tordered.length = 0;\n\n\t// setDragImage not called until the next microtask for framework compatibility\n\tawait 'microtask';\n\t// default: positioned on `{x: 0, y: 0}`\n\texpect(setImageMock).nthCalledWith(1, pointerToContainer, 0, 0);\n\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['start']);\n\n\tcleanup();\n});\n\nit('should call getOffset after a microtask (some frameworks render after a microtask)', async () => {\n\tconst [A] = getElements('div');\n\tconst ordered: string[] = [];\n\tlet pointerToContainer: HTMLElement | null = null;\n\tconst rect: DOMRect = getRect({ top: 0, bottom: 100, left: 0, right: 20 });\n\tconst previewOffset = { x: 1000, y: 2000 };\n\tconst setImageMock = jest.fn();\n\tconst getOffset = () => {\n\t\tordered.push('getOffset');\n\t\treturn previewOffset;\n\t};\n\tfunction makeMock(\n\t\tnativeSetDragImage: ElementEventPayloadMap['onGenerateDragPreview']['nativeSetDragImage'],\n\t) {\n\t\tinvariant(nativeSetDragImage);\n\t\treturn (...args: Parameters<typeof nativeSetDragImage>) => {\n\t\t\tsetImageMock(...args);\n\t\t\tnativeSetDragImage(...args);\n\t\t};\n\t}\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\tordered.push('preview');\n\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\tgetOffset: getOffset,\n\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\tpointerToContainer = container;\n\t\t\t\t\t\tordered.push('render');\n\n\t\t\t\t\t\t// faking react@18 behaviour\n\t\t\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\t\t\tordered.push('render:next-microtask');\n\t\t\t\t\t\t\tsetBoundingClientRect(container, rect);\n\t\t\t\t\t\t\tconst preview = document.createElement('div');\n\t\t\t\t\t\t\tcontainer.appendChild(preview);\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\t\t\t\t\tnativeSetDragImage: makeMock(nativeSetDragImage),\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDragStart: () => ordered.push('start'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(A);\n\n\texpect(ordered).toEqual(['preview', 'render']);\n\tordered.length = 0;\n\n\t// setDragImage not called until the next microtask for framework compatibility\n\tawait 'microtask';\n\n\texpect(ordered).toEqual(['render:next-microtask', 'getOffset']);\n\tordered.length = 0;\n\n\texpect(setImageMock).nthCalledWith(1, pointerToContainer, previewOffset.x, previewOffset.y);\n\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['start']);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/repeated-dragging.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../src/entry-point/combine';\nimport { draggable, dropTargetForElements } from '../../../src/entry-point/element/adapter';\nimport { appendToBody, getElements, reset, userEvent } from '../_util';\n\nafterEach(reset);\n\nit('should allow consecutive drag and drop operations', () => {\n\tconst [target] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(target),\n\t\tdraggable({\n\t\t\telement: target,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: target,\n\t\t\tonGenerateDragPreview: () => ordered.push('dropTarget:preview'),\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDropTargetChange: () => ordered.push('dropTarget:update'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t}),\n\t);\n\n\t// [dropTarget] -> drop\n\tfor (let i = 0; i < 10; i++) {\n\t\tordered.push(`attempt ${i}`);\n\t\tuserEvent.lift(target);\n\t\tuserEvent.drop(target);\n\t\texpect(ordered).toEqual([\n\t\t\t`attempt ${i}`,\n\t\t\t'draggable:preview',\n\t\t\t'dropTarget:preview',\n\t\t\t'draggable:start',\n\t\t\t'dropTarget:start',\n\t\t\t'draggable:drop',\n\t\t\t'dropTarget:drop',\n\t\t]);\n\t\tordered.length = 0;\n\t}\n\n\t// [dropTarget] -> cancel\n\tfor (let i = 0; i < 10; i++) {\n\t\tordered.push(`attempt ${i}`);\n\t\tuserEvent.lift(target);\n\t\tuserEvent.cancel();\n\t\texpect(ordered).toEqual([\n\t\t\t`attempt ${i}`,\n\t\t\t'draggable:preview',\n\t\t\t'dropTarget:preview',\n\t\t\t'draggable:start',\n\t\t\t'dropTarget:start',\n\t\t\t// cancel will trigger us to leave the drop target\n\t\t\t'dropTarget:update',\n\t\t\t'dropTarget:leave',\n\t\t\t'draggable:drop',\n\t\t]);\n\t\tordered.length = 0;\n\t}\n\n\tcleanup();\n});\n\nit('should allow consecutive drag and drop operations (with lift flushing)', () => {\n\tconst [target] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(target),\n\t\tdraggable({\n\t\t\telement: target,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: target,\n\t\t\tonGenerateDragPreview: () => ordered.push('dropTarget:preview'),\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDropTargetChange: () => ordered.push('dropTarget:update'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t}),\n\t);\n\n\t// [dropTarget] -> drop\n\tfor (let i = 0; i < 10; i++) {\n\t\tordered.push(`attempt ${i}`);\n\t\t// not waiting for the lift to be completed, it will be flushed\n\t\tfireEvent.dragStart(target);\n\t\tuserEvent.drop(target);\n\t\texpect(ordered).toEqual([\n\t\t\t`attempt ${i}`,\n\t\t\t'draggable:preview',\n\t\t\t'dropTarget:preview',\n\t\t\t'draggable:start',\n\t\t\t'dropTarget:start',\n\t\t\t'draggable:drop',\n\t\t\t'dropTarget:drop',\n\t\t]);\n\t\tordered.length = 0;\n\t}\n\n\t// [dropTarget] -> cancel\n\tfor (let i = 0; i < 10; i++) {\n\t\tordered.push(`attempt ${i}`);\n\t\t// not waiting for the lift to be completed, it will be flushed\n\t\tfireEvent.dragStart(target);\n\t\tuserEvent.cancel();\n\t\texpect(ordered).toEqual([\n\t\t\t`attempt ${i}`,\n\t\t\t'draggable:preview',\n\t\t\t'dropTarget:preview',\n\t\t\t'draggable:start',\n\t\t\t'dropTarget:start',\n\t\t\t// cancel will trigger us to leave the drop target\n\t\t\t'dropTarget:update',\n\t\t\t'dropTarget:leave',\n\t\t\t'draggable:drop',\n\t\t]);\n\t\tordered.length = 0;\n\t}\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/resiliant-against-consumers-stopping-events-during-a-drag.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport { bindAll } from 'bind-event-listener';\n\nimport { combine } from '../../../src/entry-point/combine';\nimport { draggable, dropTargetForElements } from '../../../src/entry-point/element/adapter';\nimport { appendToBody, getElements, reset, userEvent } from '../_util';\n\nafterEach(reset);\n\ntest('stopping events in the bubble phase during a drag should not impact us [case: successful drop]', () => {\n\tconst [draggableEl, A] = getElements('div');\n\tconst ordered: string[] = [];\n\tfunction onEvent(event: DragEvent) {\n\t\tevent.stopImmediatePropagation();\n\t\tordered.push(`${event.type}:stopped`);\n\t}\n\tconst cleanupEvents = bindAll(\n\t\twindow,\n\t\t[\n\t\t\t{\n\t\t\t\ttype: 'dragover',\n\t\t\t\tlistener: onEvent,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'drag',\n\t\t\t\tlistener: onEvent,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'dragenter',\n\t\t\t\tlistener: onEvent,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'dragleave',\n\t\t\t\tlistener: onEvent,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'drop',\n\t\t\t\tlistener: onEvent,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'dragend',\n\t\t\t\tlistener: onEvent,\n\t\t\t},\n\t\t],\n\t\t// adding in the bubble phase\n\t\t{ capture: false },\n\t);\n\n\tconst cleanup = combine(\n\t\tappendToBody(draggableEl),\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrag: () => ordered.push('draggable:drag'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('A:preview'),\n\t\t\tonDragStart: () => ordered.push('A:start'),\n\t\t\tonDrag: () => ordered.push('A:drag'),\n\t\t\tonDropTargetChange: () => ordered.push('A:change'),\n\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\tonDragLeave: () => ordered.push('A:leave'),\n\t\t\tonDrop: () => ordered.push('A:drop'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\n\t// we are not manually stopping any start events, this test is testing what happens after a drag starts\n\texpect(ordered).toEqual(['draggable:preview', 'draggable:start']);\n\tordered.length = 0;\n\n\t// [] -> [A] with a dragEnter\n\tfireEvent.dragEnter(A);\n\texpect(ordered).toEqual(['draggable:change', 'A:change', 'A:enter', 'dragenter:stopped']);\n\tordered.length = 0;\n\n\t// dragleave doesn't do anything for us\n\tfireEvent.dragLeave(document.body, { relatedTarget: A });\n\texpect(ordered).toEqual(['dragleave:stopped']);\n\tordered.length = 0;\n\n\t// dragging over A\n\tfireEvent.dragOver(A);\n\texpect(ordered).toEqual(['dragover:stopped']);\n\tordered.length = 0;\n\t// our changes are flushing in the next animation frame\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['draggable:drag', 'A:drag']);\n\tordered.length = 0;\n\n\t// Dropping on A\n\tuserEvent.drop(A);\n\texpect(ordered).toEqual(['draggable:drop', 'A:drop', 'drop:stopped']);\n\tordered.length = 0;\n\n\t// dragend\n\tuserEvent.cancel();\n\texpect(ordered).toEqual(['dragleave:stopped', 'dragend:stopped']);\n\n\tcleanup();\n\tcleanupEvents();\n});\n\ntest('stopping events in the bubble phase during a drag should not impact us [case: cancelled drag]', () => {\n\tconst [draggableEl, A] = getElements('div');\n\tconst ordered: string[] = [];\n\tfunction onEvent(event: DragEvent) {\n\t\tevent.stopImmediatePropagation();\n\t\tordered.push(`${event.type}:stopped`);\n\t}\n\tconst cleanupEvents = bindAll(\n\t\twindow,\n\t\t[\n\t\t\t{\n\t\t\t\ttype: 'dragover',\n\t\t\t\tlistener: onEvent,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'drag',\n\t\t\t\tlistener: onEvent,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'dragenter',\n\t\t\t\tlistener: onEvent,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'dragleave',\n\t\t\t\tlistener: onEvent,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'drop',\n\t\t\t\tlistener: onEvent,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'dragend',\n\t\t\t\tlistener: onEvent,\n\t\t\t},\n\t\t],\n\t\t// adding in the bubble phase\n\t\t{ capture: false },\n\t);\n\n\tconst cleanup = combine(\n\t\tappendToBody(draggableEl),\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrag: () => ordered.push('draggable:drag'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('A:preview'),\n\t\t\tonDragStart: () => ordered.push('A:start'),\n\t\t\tonDrag: () => ordered.push('A:drag'),\n\t\t\tonDropTargetChange: () => ordered.push('A:change'),\n\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\tonDragLeave: () => ordered.push('A:leave'),\n\t\t\tonDrop: () => ordered.push('A:drop'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\n\t// we are not manually stopping any start events, this test is testing what happens after a drag starts\n\texpect(ordered).toEqual(['draggable:preview', 'draggable:start']);\n\tordered.length = 0;\n\n\t// [] -> [A] with a dragEnter\n\tfireEvent.dragEnter(A);\n\texpect(ordered).toEqual(['draggable:change', 'A:change', 'A:enter', 'dragenter:stopped']);\n\tordered.length = 0;\n\n\t// dragleave doesn't do anything for us\n\tfireEvent.dragLeave(document.body, { relatedTarget: A });\n\texpect(ordered).toEqual(['dragleave:stopped']);\n\tordered.length = 0;\n\n\t// dragging over A\n\tfireEvent.dragOver(A);\n\texpect(ordered).toEqual(['dragover:stopped']);\n\tordered.length = 0;\n\t// our changes are flushing in the next animation frame\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['draggable:drag', 'A:drag']);\n\tordered.length = 0;\n\n\t// Cancelling the drag\n\tuserEvent.cancel();\n\texpect(ordered).toEqual([\n\t\t'draggable:change',\n\t\t'A:change',\n\t\t'A:leave',\n\t\t'dragleave:stopped',\n\t\t// the draggable will get 'drop' in response to 'dragend'\n\t\t'draggable:drop',\n\t\t'dragend:stopped',\n\t]);\n\n\tcleanup();\n\tcleanupEvents();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/resilient-against-multiple-cleanup-calls.spec.ts",
    "content": "import { combine } from '../../../src/entry-point/combine';\nimport { draggable, dropTargetForElements } from '../../../src/entry-point/element/adapter';\nimport { appendToBody, getElements, reset, userEvent } from '../_util';\n\nafterEach(reset);\n\ntest('calling cleanup multiple times for a draggable should not affect other draggables', () => {\n\tconst [A, B] = getElements('div');\n\tconst ordered: string[] = [];\n\n\t// The cleanup functions for `appendToBody` are placed in a separate `combine`\n\t// function, so we can call the cleanup functions for `draggable` multiple times\n\tconst cleanupDocument = combine(appendToBody(A), appendToBody(B));\n\n\tconst cleanupA = draggable({\n\t\telement: A,\n\t\tonDragStart: () => ordered.push('a:start'),\n\t});\n\n\tconst cleanupB = draggable({\n\t\telement: B,\n\t\tonDragStart: () => ordered.push('b:start'),\n\t});\n\n\tuserEvent.lift(A);\n\tuserEvent.drop(A);\n\n\texpect(ordered).toEqual(['a:start']);\n\tordered.length = 0;\n\n\tcleanupA();\n\n\tuserEvent.lift(A);\n\tuserEvent.drop(A);\n\n\t// No longer listening to drag events for A\n\texpect(ordered).toEqual([]);\n\n\t// Call cleanup function for A again\n\tcleanupA();\n\n\tuserEvent.lift(B);\n\tuserEvent.drop(B);\n\n\t// Should still be listening to drag events for B\n\texpect(ordered).toEqual(['b:start']);\n\n\tcleanupB();\n\tcleanupDocument();\n});\n\nit('calling cleanup multiple times for a drop target registration should not affect other registrations for that element', () => {\n\tconst [dropTarget] = getElements('div');\n\n\tconst cleanup1 = dropTargetForElements({\n\t\telement: dropTarget,\n\t});\n\n\texpect(dropTarget).toHaveAttribute('data-drop-target-for-element');\n\n\tcleanup1();\n\n\texpect(dropTarget).not.toHaveAttribute('data-drop-target-for-element');\n\n\t// Create a separate drop target registration for the same element\n\tconst cleanup2 = dropTargetForElements({\n\t\telement: dropTarget,\n\t});\n\n\texpect(dropTarget).toHaveAttribute('data-drop-target-for-element');\n\n\t// Call the cleanup function for the first drop target registration of the element\n\tcleanup1();\n\n\t// The drop target registration should still be active\n\texpect(dropTarget).toHaveAttribute('data-drop-target-for-element');\n\n\tcleanup2();\n\n\texpect(dropTarget).not.toHaveAttribute('data-drop-target-for-element');\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/element/respecting-non-pdnd-code.spec.ts",
    "content": "import { createEvent, fireEvent } from '@testing-library/dom';\nimport { bind, bindAll } from 'bind-event-listener';\n\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { combine } from '../../../src/entry-point/combine';\nimport { draggable, monitorForElements } from '../../../src/entry-point/element/adapter';\nimport {\n\taddItemsToEvent,\n\tappendToBody,\n\tgetBubbleOrderedTree,\n\tgetElements,\n\tnativeDrag,\n\treset,\n\tselect,\n\tuserEvent,\n} from '../_util';\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nafterEach(reset);\n\ntest('do not start if the \"dragstart\" event is cancelled', () => {\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonGenerateDragPreview: () => ordered.push('monitor:preview'),\n\t\t}),\n\t\tbind(window, {\n\t\t\ttype: 'dragstart',\n\t\t\tlistener: (event) => {\n\t\t\t\tordered.push('cancelled');\n\t\t\t\tevent.preventDefault();\n\t\t\t},\n\t\t\t// hit before our element adapter\n\t\t\toptions: { capture: true },\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(element);\n\n\texpect(ordered).toEqual(['cancelled']);\n\n\tcleanup();\n});\n\ntest('do not start if an unmanaged element is being dragged (<div draggable=\"true\">)', () => {\n\tconst [managed, parent] = getElements('div');\n\tconst [unmanaged] = getElements('div');\n\tunmanaged.draggable = true;\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(unmanaged),\n\t\tappendToBody(parent),\n\t\t// this is needed so that our element adapter start event listeners will be added\n\t\tdraggable({\n\t\t\telement: managed,\n\t\t\tonGenerateDragPreview: () => ordered.push('managed:preview'),\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonGenerateDragPreview: () => ordered.push('monitor:preview'),\n\t\t}),\n\t\tbind(unmanaged, {\n\t\t\ttype: 'dragstart',\n\t\t\tlistener: () => ordered.push('unmanaged:drag-start'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(unmanaged);\n\n\texpect(ordered).toEqual(['unmanaged:drag-start']);\n\n\tcleanup();\n});\n\ntest('do not start if an unmanaged element is being dragged (<a>)', () => {\n\tconst [managed, parent] = getElements('div');\n\tconst [unmanaged] = getElements('a');\n\tunmanaged.href = 'https://domevents.dev';\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(unmanaged),\n\t\tappendToBody(parent),\n\t\t// this is needed so that our element adapter start event listeners will be added\n\t\tdraggable({\n\t\t\telement: managed,\n\t\t\tonGenerateDragPreview: () => ordered.push('managed:preview'),\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonGenerateDragPreview: () => ordered.push('monitor:preview'),\n\t\t}),\n\t\tbind(unmanaged, {\n\t\t\ttype: 'dragstart',\n\t\t\tlistener: () => ordered.push('unmanaged:drag-start'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(unmanaged);\n\n\texpect(ordered).toEqual(['unmanaged:drag-start']);\n\n\tcleanup();\n});\n\ntest('do not start if an unmanaged element is being dragged (<img>)', () => {\n\tconst [managed, parent] = getElements('div');\n\tconst [unmanaged] = getElements('img');\n\t// a tiny transparent gif\n\tunmanaged.src =\n\t\t'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';\n\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(unmanaged),\n\t\tappendToBody(parent),\n\t\t// this is needed so that our element adapter start event listeners will be added\n\t\tdraggable({\n\t\t\telement: managed,\n\t\t\tonGenerateDragPreview: () => ordered.push('managed:preview'),\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonGenerateDragPreview: () => ordered.push('monitor:preview'),\n\t\t}),\n\t\tbind(unmanaged, {\n\t\t\ttype: 'dragstart',\n\t\t\tlistener: () => ordered.push('unmanaged:drag-start'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(unmanaged);\n\n\texpect(ordered).toEqual(['unmanaged:drag-start']);\n\n\tcleanup();\n});\n\ntest('do not start if a text selection is being dragged', () => {\n\tconst [element] = getElements('div');\n\tconst [paragraph] = getElements('p');\n\tparagraph.textContent = 'Hello world';\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonGenerateDragPreview: () => ordered.push('monitor:preview'),\n\t\t}),\n\t);\n\n\tnativeDrag.startTextSelectionDrag({ element: paragraph });\n\n\texpect(ordered).toEqual([]);\n\n\tcleanup();\n});\n\n// Currently editor is leaning on the behaviour where a text selection drag where the event.target is\n// a draggable element will trigger the element adapter.\n// Ideally we unwind this in the future.\ntest.skip('do not start if a text selection is being dragged [when the event.target is a draggable element]', () => {\n\tconst [child, parent] = getBubbleOrderedTree('div');\n\tchild.prepend(document.createTextNode('child'));\n\tparent.prepend(document.createTextNode('parent'));\n\n\t// validating setup\n\texpect(parent.outerHTML).toBe('<div>parent<div>child</div></div>');\n\texpect(parent.textContent).toBe('parentchild');\n\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(parent),\n\t\tdraggable({\n\t\t\telement: child,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonGenerateDragPreview: () => ordered.push('monitor:preview'),\n\t\t}),\n\t\tselect(child),\n\t);\n\n\tconst event = new DragEvent('dragstart', {\n\t\tcancelable: true,\n\t\tbubbles: true,\n\t});\n\n\taddItemsToEvent({\n\t\tevent,\n\t\titems: [\n\t\t\t{ type: 'text/plain', data: parent.textContent ?? '' },\n\t\t\t{ type: 'text/html', data: parent.outerHTML },\n\t\t],\n\t});\n\n\tchild.dispatchEvent(event);\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual([]);\n\n\tcleanup();\n});\n\ntest('do not start if an unmanaged element is being dragged (<div draggable=\"true\">) [child of draggable]', () => {\n\tconst [unmanaged, managed] = getBubbleOrderedTree();\n\tunmanaged.draggable = true;\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(managed),\n\t\tdraggable({\n\t\t\telement: managed,\n\t\t\tonGenerateDragPreview: () => ordered.push('managed:preview'),\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonGenerateDragPreview: () => ordered.push('monitor:preview'),\n\t\t}),\n\t\tbind(unmanaged, {\n\t\t\ttype: 'dragstart',\n\t\t\tlistener: () => ordered.push('unmanaged:drag-start'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(unmanaged);\n\n\texpect(ordered).toEqual(['unmanaged:drag-start']);\n\n\tcleanup();\n});\n\ntest('do not start if an unmanaged element is being dragged (<a>) [child of draggable]', () => {\n\tconst [managed] = getElements('div');\n\tconst [unmanaged] = getElements('a');\n\tunmanaged.href = 'https://domevents.dev';\n\tmanaged.appendChild(unmanaged);\n\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(unmanaged),\n\t\t// this is needed so that our element adapter start event listeners will be added\n\t\tdraggable({\n\t\t\telement: managed,\n\t\t\tonGenerateDragPreview: () => ordered.push('managed:preview'),\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonGenerateDragPreview: () => ordered.push('monitor:preview'),\n\t\t}),\n\t\tbind(unmanaged, {\n\t\t\ttype: 'dragstart',\n\t\t\tlistener: () => ordered.push('unmanaged:drag-start'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(unmanaged);\n\n\texpect(ordered).toEqual(['unmanaged:drag-start']);\n\n\tcleanup();\n});\n\ntest('do not start if an unmanaged element is being dragged (<img>) [child of draggable]', () => {\n\tconst [managed] = getElements('div');\n\tconst [unmanaged] = getElements('img');\n\tmanaged.appendChild(unmanaged);\n\t// a tiny transparent gif\n\tunmanaged.src =\n\t\t'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';\n\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(unmanaged),\n\t\t// this is needed so that our element adapter start event listeners will be added\n\t\tdraggable({\n\t\t\telement: managed,\n\t\t\tonGenerateDragPreview: () => ordered.push('managed:preview'),\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonGenerateDragPreview: () => ordered.push('monitor:preview'),\n\t\t}),\n\t\tbind(unmanaged, {\n\t\t\ttype: 'dragstart',\n\t\t\tlistener: () => ordered.push('unmanaged:drag-start'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(unmanaged);\n\n\texpect(ordered).toEqual(['unmanaged:drag-start']);\n\n\tcleanup();\n});\n\ntest('do not start if a text selection is being dragged [child of draggable]', () => {\n\tconst [element] = getElements('div');\n\tconst [paragraph] = getElements('p');\n\tparagraph.textContent = 'Hello world';\n\telement.appendChild(paragraph);\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonGenerateDragPreview: () => ordered.push('monitor:preview'),\n\t\t}),\n\t);\n\n\tnativeDrag.startTextSelectionDrag({ element: paragraph });\n\n\texpect(ordered).toEqual([]);\n\n\tcleanup();\n});\n\ntest('a unmanaged child draggable should not start dragging if a managed parent is dragging', () => {\n\tconst [unmanagedChild, parent] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tunmanagedChild.draggable = true;\n\tconst cleanup = combine(\n\t\tappendToBody(parent),\n\t\tdraggable({\n\t\t\telement: parent,\n\t\t\tonGenerateDragPreview: () => ordered.push('parent:preview'),\n\t\t}),\n\t\tbind(unmanagedChild, {\n\t\t\ttype: 'dragstart',\n\t\t\tlistener: () => ordered.push('child:start'),\n\t\t}),\n\t);\n\n\t// the closest draggable element will be marked as the `event.target` for the dragstart event\n\tfireEvent.dragStart(parent);\n\n\texpect(ordered).toEqual(['parent:preview']);\n\n\tcleanup();\n});\n\ntest('an unmanaged \"drop\" event should not be cancelled', () => {\n\tconst [draggableEl, unmanagedDropTarget] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(draggableEl, unmanagedDropTarget),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: ({ location }) =>\n\t\t\t\tordered.push(`draggable:drop - drop targets: ${location.current.dropTargets.length}`),\n\t\t}),\n\t\tbindAll(unmanagedDropTarget, [\n\t\t\t{\n\t\t\t\ttype: 'dragover',\n\t\t\t\tlistener: (event) => {\n\t\t\t\t\tordered.push('unmanaged:over');\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'dragenter',\n\t\t\t\tlistener: (event) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tordered.push('unmanaged:enter');\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'drop',\n\t\t\t\tlistener: () => {\n\t\t\t\t\tordered.push('unmanaged:drop');\n\t\t\t\t},\n\t\t\t},\n\t\t]),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\n\texpect(ordered).toEqual(['draggable:start']);\n\tordered.length = 0;\n\n\tfireEvent.dragEnter(unmanagedDropTarget);\n\n\texpect(ordered).toEqual(['unmanaged:enter']);\n\tordered.length = 0;\n\n\tconst event = createEvent.drop(unmanagedDropTarget);\n\tfireEvent(unmanagedDropTarget, event);\n\n\texpect(event.defaultPrevented).toBe(false);\n\texpect(ordered).toEqual(['draggable:drop - drop targets: 0', 'unmanaged:drop']);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/external/adapter/can-monitor.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdropTargetForExternal,\n\tmonitorForExternal,\n} from '../../../../src/entry-point/external/adapter';\nimport { appendToBody, getElements, nativeDrag, reset } from '../../_util';\n\nafterEach(reset);\n\n// Skipping as tests timing out due to open handles (#hot-112198)\ntest.skip('monitor adding during the \"drop\" event should get the original items (empty) for canMonitor() and not the populated items', () => {\n\tconst [A] = getElements('div');\n\tconst ordered: string[] = [];\n\n\tconst cleanup1 = combine(\n\t\tappendToBody(A),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: () => ordered.push('monitor1:start'),\n\t\t\tonDrag: () => ordered.push('monitor1:drag'),\n\t\t\tonDropTargetChange: () => ordered.push('monitor1:change'),\n\t\t\tonDrop: () => ordered.push('monitor1:drop'),\n\t\t}),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDrag: () => ordered.push('a:drag'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\tonDropTargetChange: () => ordered.push('a:change'),\n\t\t\tonDrop: () => ordered.push('a:drop'),\n\t\t}),\n\t);\n\n\t// entering body\n\tnativeDrag.startExternal({\n\t\titems: [{ data: 'Hello', type: 'text/plain' }],\n\t});\n\texpect(ordered).toEqual(['monitor1:start']);\n\tordered.length = 0;\n\n\t// entering A\n\tfireEvent.dragEnter(A);\n\texpect(ordered).toEqual(['a:change', 'a:enter', 'monitor1:change']);\n\tordered.length = 0;\n\n\tconst itemsToCanMonitor: DataTransferItem[] = [];\n\tconst actualDropItems: DataTransferItem[] = [];\n\n\tconst cleanup2 = monitorForExternal({\n\t\tcanMonitor: (args) => {\n\t\t\titemsToCanMonitor.push(...args.source.items);\n\t\t\treturn true;\n\t\t},\n\t\tonDrop: (args) => {\n\t\t\tordered.push('monitor2:drop');\n\t\t\tactualDropItems.push(...args.source.items);\n\t\t},\n\t});\n\n\t// dropping\n\tnativeDrag.drop({\n\t\titems: [{ data: 'Hello', type: 'text/plain' }],\n\t\ttarget: A,\n\t});\n\n\texpect(ordered).toEqual(['a:drop', 'monitor1:drop', 'monitor2:drop']);\n\texpect(itemsToCanMonitor).toEqual([]);\n\texpect(actualDropItems.length).toBe(1);\n\n\tcleanup1();\n\tcleanup2();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/external/adapter/drag-ownership/element-adapter.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { elementAdapterNativeDataKey } from '../../../../../src/adapter/element-adapter-native-data-key';\nimport { combine } from '../../../../../src/entry-point/combine';\nimport { draggable, dropTargetForElements } from '../../../../../src/entry-point/element/adapter';\nimport {\n\tdropTargetForExternal,\n\tmonitorForExternal,\n} from '../../../../../src/entry-point/external/adapter';\nimport { appendToBody, getBubbleOrderedTree, getElements, reset, userEvent } from '../../../_util';\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nafterEach(reset);\n\ntest('controlled internal drags should not trigger the external adapter', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst [link] = getElements('a');\n\tlink.href = '#hello';\n\tconst ordered: string[] = [];\n\n\tA.appendChild(link);\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t}),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: () => ordered.push('monitor(external):start'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\n\texpect(ordered).toEqual(['draggable:start']);\n\n\tcleanup();\n});\n\ntest('a draggable adding external drag data should not cause the native adapter to start', () => {\n\tconst [A] = getElements('div');\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: () => ordered.push('monitor(external):start'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tgetInitialDataForExternal: () => ({ 'text/plain': 'Hello world' }),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonDragStart: () => ordered.push('target(element):start'),\n\t\t}),\n\t);\n\n\tconst event = new DragEvent('dragstart', {\n\t\tbubbles: true,\n\t\tcancelable: true,\n\t});\n\tA.dispatchEvent(event);\n\n\t// native data attached to event\n\texpect(event.dataTransfer?.types).toEqual([\n\t\t// our default type\n\t\telementAdapterNativeDataKey,\n\t\t// the newly added type\n\t\t'text/plain',\n\t]);\n\texpect(ordered).toEqual(['draggable:preview']);\n\tordered.length = 0;\n\n\t// finish the lift\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['draggable:start', 'target(element):start']);\n\n\tcleanup();\n});\n\ntest('dragging a draggable into a new window should not trigger a native drag if the draggable attached no external native data', () => {\n\tconst [A] = getElements('div');\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: () => ordered.push(`monitor:start-external`),\n\t\t\tonDrop: () => ordered.push(`monitor:drop-external`),\n\t\t}),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: () => ordered.push(`A:enter-external`),\n\t\t\tonDrop: () => ordered.push(`A:drop-external`),\n\t\t}),\n\t);\n\n\t// validation: a native drag would trigger an external drag\n\t{\n\t\tconst event = new DragEvent('dragenter', {\n\t\t\tbubbles: true,\n\t\t\tcancelable: true,\n\t\t});\n\t\tevent.dataTransfer?.items.add('Hello', 'text/plain');\n\n\t\twindow.dispatchEvent(event);\n\t\t// @ts-expect-error\n\t\trequestAnimationFrame.step();\n\t\texpect(ordered).toEqual(['monitor:start-external']);\n\t\tordered.length = 0;\n\n\t\tfireEvent.dragEnter(A);\n\t\texpect(ordered).toEqual(['A:enter-external']);\n\t\tordered.length = 0;\n\n\t\tfireEvent.drop(A);\n\t\texpect(ordered).toEqual(['A:drop-external', 'monitor:drop-external']);\n\t\tordered.length = 0;\n\t}\n\n\t// actual test: the only native type is our element adapter key\n\t{\n\t\tconst event = new DragEvent('dragenter', {\n\t\t\tbubbles: true,\n\t\t\tcancelable: true,\n\t\t});\n\t\tevent.dataTransfer?.items.add('', elementAdapterNativeDataKey);\n\t\twindow.dispatchEvent(event);\n\t\t// @ts-expect-error\n\t\trequestAnimationFrame.step();\n\n\t\texpect(ordered).toEqual([]);\n\n\t\tfireEvent.dragEnter(A);\n\t\texpect(ordered).toEqual([]);\n\n\t\tfireEvent.drop(A);\n\t\texpect(ordered).toEqual([]);\n\t}\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/external/adapter/drag-ownership/uncontrolled-internal-adapter.spec.ts",
    "content": "import { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { combine } from '../../../../../src/entry-point/combine';\nimport { draggable } from '../../../../../src/entry-point/element/adapter';\nimport { monitorForExternal } from '../../../../../src/entry-point/external/adapter';\nimport { appendToBody, getBubbleOrderedTree, getElements, nativeDrag, reset } from '../../../_util';\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nafterEach(reset);\n\ntest('uncontrolled internal native drags should not trigger the external adapter', () => {\n\tconst [draggableEl, A] = getBubbleOrderedTree();\n\tconst [link] = getElements('a');\n\tlink.href = '#hello';\n\tconst ordered: string[] = [];\n\n\tA.appendChild(link);\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: () => ordered.push('monitor(external):start'),\n\t\t}),\n\t);\n\n\tnativeDrag.startInternal({\n\t\ttarget: link,\n\t\titems: [{ data: 'Plain text', type: 'text/plain' }],\n\t});\n\n\texpect(ordered).toEqual([]);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/external/adapter/drop-effect.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdropTargetForExternal,\n\tmonitorForExternal,\n} from '../../../../src/entry-point/external/adapter';\nimport { appendToBody, getBubbleOrderedTree, reset } from '../../_util';\n\nafterEach(reset);\n\nit('should set \"copy\" as the default drop effect', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t}),\n\t);\n\n\tconst event = new DragEvent('dragenter', {\n\t\tbubbles: true,\n\t\tcancelable: true,\n\t});\n\tevent.dataTransfer?.items.add('Hello', 'text/plain');\n\tfireEvent(window, event);\n\n\t// not over a drop target yet\n\texpect(event.dataTransfer?.dropEffect).toEqual('none');\n\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['monitor:start']);\n\n\t// entering into A\n\tconst enterEvent = new DragEvent('dragenter', {\n\t\tcancelable: true,\n\t\tbubbles: true,\n\t});\n\tA.dispatchEvent(enterEvent);\n\t// using the default drop effect\n\texpect(enterEvent.dataTransfer?.dropEffect).toEqual('copy');\n\n\t// moving over A\n\tconst dragOverEvent = new DragEvent('dragover', {\n\t\tcancelable: true,\n\t\tbubbles: true,\n\t});\n\tA.dispatchEvent(dragOverEvent);\n\t// using the default drop effect\n\texpect(dragOverEvent.dataTransfer?.dropEffect).toEqual('copy');\n\n\t// dropping on A\n\tconst dropEvent = new DragEvent('drop', {\n\t\tcancelable: true,\n\t\tbubbles: true,\n\t});\n\tA.dispatchEvent(dropEvent);\n\t// using the default drop effect\n\texpect(dropEvent.dataTransfer?.dropEffect).toEqual('copy');\n\n\tcleanup();\n});\n\nit('should allow overriding of the default drop effect', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tgetDropEffect: () => 'link',\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t}),\n\t);\n\n\tconst startEvent = new DragEvent('dragenter', {\n\t\tcancelable: true,\n\t\tbubbles: true,\n\t});\n\tstartEvent.dataTransfer?.items.add('Hello', 'text/plain');\n\tfireEvent(window, startEvent);\n\n\texpect(startEvent.dataTransfer?.dropEffect).toEqual('none');\n\n\texpect(ordered).toEqual([]);\n\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['monitor:start']);\n\n\t// entering into A\n\tconst enterEvent = new DragEvent('dragenter', {\n\t\tcancelable: true,\n\t\tbubbles: true,\n\t});\n\tA.dispatchEvent(enterEvent);\n\t// using the provided drop effect\n\texpect(enterEvent.dataTransfer?.dropEffect).toEqual('link');\n\n\t// moving over A\n\tconst dragOverEvent = new DragEvent('dragover', {\n\t\tcancelable: true,\n\t\tbubbles: true,\n\t});\n\tA.dispatchEvent(dragOverEvent);\n\t// using the provided drop effect\n\texpect(dragOverEvent.dataTransfer?.dropEffect).toEqual('link');\n\n\t// dropping on A\n\tconst dropEvent = new DragEvent('drop', {\n\t\tcancelable: true,\n\t\tbubbles: true,\n\t});\n\tA.dispatchEvent(dropEvent);\n\t// using the provided drop effect\n\texpect(dropEvent.dataTransfer?.dropEffect).toEqual('link');\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/external/adapter/exposing-data.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport { bindAll } from 'bind-event-listener';\nimport invariant from 'tiny-invariant';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdropTargetForExternal,\n\ttype ExternalDragPayload,\n\tmonitorForExternal,\n\ttype NativeMediaType,\n} from '../../../../src/entry-point/external/adapter';\nimport { getFiles } from '../../../../src/entry-point/external/file';\nimport { getHTML } from '../../../../src/entry-point/external/html';\nimport { getText } from '../../../../src/entry-point/external/text';\nimport { getURLs } from '../../../../src/entry-point/external/url';\nimport {\n\taddItemsToEvent,\n\tappendToBody,\n\tgetBubbleOrderedTree,\n\tnativeDrag,\n\treset,\n} from '../../_util';\n\nafterEach(reset);\n\nfunction sort<Value>(array: readonly Value[]): Value[] {\n\treturn Array.from(array).sort();\n}\n\n//  [MediaType in NativeMediaType]: MediaType extends 'Files' ? File : string;\nconst fakeData = {\n\tFiles: new File(['🕺💃'], 'dance.png', {\n\t\ttype: 'image/png',\n\t}),\n\t'text/plain': 'Plain text',\n\t'text/uri-list': 'https://atlassian.design/',\n\t'text/html': '<h1>hi</h1>',\n};\n\nconst nativeMediaTypes: NativeMediaType[] = sort(getKeys(fakeData));\n\nfunction getKeys<Obj extends Record<string, unknown>>(obj: Obj): (keyof Obj)[] {\n\treturn Object.keys(obj);\n}\n\nfunction addFakeDataToEvent(event: DragEvent) {\n\tconst items = getKeys(fakeData).map((key) => {\n\t\tconst item = fakeData[key];\n\t\tif (item instanceof File) {\n\t\t\treturn item;\n\t\t}\n\t\treturn { data: item, type: key };\n\t});\n\taddItemsToEvent({ event, items });\n}\n\ntest('data should only be exposed during a successful drop', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\t// Using an array rather than `NativePayload | null` as TS was incorrectly narrowing\n\t// the value to `null` if it is only set inside of the pdnd callbacks\n\tconst payloads: ExternalDragPayload[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push(`start:external`);\n\t\t\t\tpayloads.push(args.source);\n\t\t\t},\n\t\t\tonDropTargetChange: (args) => {\n\t\t\t\tordered.push(`change:external`);\n\t\t\t\tpayloads.push(args.source);\n\t\t\t},\n\t\t\tonDrag: (args) => {\n\t\t\t\tordered.push(`drag:external`);\n\t\t\t\tpayloads.push(args.source);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push(`drop:external`);\n\t\t\t\tpayloads.push(args.source);\n\t\t\t},\n\t\t}),\n\t);\n\n\t// let's start an external drag\n\t{\n\t\tconst event = new DragEvent('dragenter', {\n\t\t\tcancelable: true,\n\t\t\tbubbles: true,\n\t\t});\n\t\taddFakeDataToEvent(event);\n\n\t\t// validating setup by ensuring that native event is setup correctly\n\t\texpect(sort(event.dataTransfer?.types ?? [])).toEqual(nativeMediaTypes);\n\t\twindow.dispatchEvent(event);\n\t\t// need to wait for an animation frame\n\t\texpect(ordered).toEqual([]);\n\n\t\t// @ts-expect-error -> flush drag start\n\t\trequestAnimationFrame.step();\n\n\t\texpect(ordered).toEqual(['start:external']);\n\t\texpect(payloads.length).toBe(1);\n\t\tconst payload = payloads.at(-1);\n\t\tinvariant(payload);\n\t\t// types are exposed\n\t\texpect(sort(payload.types)).toEqual(nativeMediaTypes);\n\t\t// items are not exposed\n\t\texpect(payload.items.length).toBe(0);\n\t\t// `getData` doesn't return values\n\t\tfor (const key of getKeys(fakeData)) {\n\t\t\texpect(payload.getStringData(key)).toEqual(null);\n\t\t}\n\n\t\tordered.length = 0;\n\t\tpayloads.length = 0;\n\t}\n\t// [] => [A] (entering A)\n\t{\n\t\tconst event = new DragEvent('dragenter', {\n\t\t\tcancelable: true,\n\t\t\tbubbles: true,\n\t\t});\n\t\taddFakeDataToEvent(event);\n\n\t\t// validating setup by ensuring that native event is setup correctly\n\t\texpect(sort(event.dataTransfer?.types ?? [])).toEqual(nativeMediaTypes);\n\t\tA.dispatchEvent(event);\n\n\t\texpect(ordered).toEqual(['change:external']);\n\t\texpect(payloads.length).toBe(1);\n\t\tconst payload = payloads.at(-1);\n\t\tinvariant(payload);\n\t\t// types are exposed\n\t\texpect(sort(payload.types)).toEqual(nativeMediaTypes);\n\t\t// items are not exposed\n\t\texpect(payload.items.length).toBe(0);\n\t\t// `getData` doesn't return values\n\t\tfor (const key of getKeys(fakeData)) {\n\t\t\texpect(payload.getStringData(key)).toEqual(null);\n\t\t}\n\n\t\tordered.length = 0;\n\t\tpayloads.length = 0;\n\t}\n\t// [A] => [A] (moving in A)\n\t{\n\t\tconst event = new DragEvent('dragover', {\n\t\t\tcancelable: true,\n\t\t\tbubbles: true,\n\t\t});\n\t\taddFakeDataToEvent(event);\n\n\t\t// validating setup by ensuring that native event is setup correctly\n\t\texpect(sort(event.dataTransfer?.types ?? [])).toEqual(nativeMediaTypes);\n\t\tA.dispatchEvent(event);\n\n\t\t// drag events are throttled in an animation frame\n\t\texpect(ordered).toEqual([]);\n\n\t\t// @ts-expect-error -> flush update\n\t\trequestAnimationFrame.step();\n\n\t\texpect(ordered).toEqual(['drag:external']);\n\t\texpect(payloads.length).toBe(1);\n\t\tconst payload = payloads.at(-1);\n\t\tinvariant(payload);\n\t\t// types are exposed\n\t\texpect(sort(payload.types)).toEqual(nativeMediaTypes);\n\t\t// items are not exposed\n\t\texpect(payload.items.length).toBe(0);\n\t\t// `getData` doesn't return values\n\t\tfor (const key of getKeys(fakeData)) {\n\t\t\texpect(payload.getStringData(key)).toEqual(null);\n\t\t}\n\n\t\tordered.length = 0;\n\t\tpayloads.length = 0;\n\t}\n\t// [A] => drop\n\t{\n\t\tconst event = new DragEvent('drop', {\n\t\t\tcancelable: true,\n\t\t\tbubbles: true,\n\t\t});\n\t\taddFakeDataToEvent(event);\n\n\t\t// validating setup by ensuring that native event is setup correctly\n\t\texpect(sort(event.dataTransfer?.types ?? [])).toEqual(nativeMediaTypes);\n\t\tA.dispatchEvent(event);\n\n\t\texpect(ordered).toEqual(['drop:external']);\n\t\texpect(payloads.length).toBe(1);\n\t\tconst payload = payloads.at(-1);\n\t\tinvariant(payload);\n\t\t// types are exposed\n\t\t// this also validates that the element adapter type are not exposed\n\t\texpect(sort(payload.types)).toEqual(nativeMediaTypes);\n\t\t// items are now exposed\n\t\t// this also validates that the element adapter item is not exposed\n\t\texpect(payload.items.length).toEqual(nativeMediaTypes.length);\n\t\t// `getData` now returns correct values\n\t\tfor (const key of getKeys(fakeData)) {\n\t\t\tif (key !== 'Files') {\n\t\t\t\texpect(payload.getStringData(key)).toEqual(fakeData[key]);\n\t\t\t}\n\t\t}\n\t\t// checking getters are extracting the right information\n\t\texpect(getFiles({ source: payload })).toEqual([fakeData.Files]);\n\t\texpect(getText({ source: payload })).toEqual(fakeData['text/plain']);\n\t\texpect(getURLs({ source: payload })).toEqual([fakeData['text/uri-list']]);\n\t\texpect(getHTML({ source: payload })).toEqual(fakeData['text/html']);\n\n\t\tordered.length = 0;\n\t\tpayloads.length = 0;\n\t}\n\n\tcleanup();\n});\n\ntest('data should not be exposed during a cancel', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\t// Using an array rather than `NativePayload | null` as TS was incorrectly narrowing\n\t// the value to `null` if it is only set inside of the pdnd callbacks\n\tconst payloads: ExternalDragPayload[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push(`start:external`);\n\t\t\t\tpayloads.push(args.source);\n\t\t\t},\n\t\t\tonDropTargetChange: (args) => {\n\t\t\t\tordered.push(`change:external`);\n\t\t\t\tpayloads.push(args.source);\n\t\t\t},\n\t\t\tonDrag: (args) => {\n\t\t\t\tordered.push(`drag:external`);\n\t\t\t\tpayloads.push(args.source);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push(`drop:external`);\n\t\t\t\tpayloads.push(args.source);\n\t\t\t},\n\t\t}),\n\t);\n\n\t// let's start an external drag\n\t{\n\t\tconst event = new DragEvent('dragenter', {\n\t\t\tcancelable: true,\n\t\t\tbubbles: true,\n\t\t});\n\t\taddFakeDataToEvent(event);\n\n\t\t// validating setup by ensuring that native event is setup correctly\n\t\texpect(sort(event.dataTransfer?.types ?? [])).toEqual(nativeMediaTypes);\n\t\twindow.dispatchEvent(event);\n\t\t// need to wait for an animation frame\n\t\texpect(ordered).toEqual([]);\n\n\t\t// @ts-expect-error -> flush drag start\n\t\trequestAnimationFrame.step();\n\n\t\texpect(ordered).toEqual(['start:external']);\n\t\texpect(payloads.length).toBe(1);\n\t\tconst payload = payloads.at(-1);\n\t\tinvariant(payload);\n\t\t// types are exposed\n\t\texpect(sort(payload.types)).toEqual(nativeMediaTypes);\n\t\t// items are not exposed\n\t\texpect(payload.items.length).toBe(0);\n\t\t// `getData` doesn't return values\n\t\tfor (const key of getKeys(fakeData)) {\n\t\t\texpect(payload.getStringData(key)).toEqual(null);\n\t\t}\n\n\t\tordered.length = 0;\n\t\tpayloads.length = 0;\n\t}\n\t// [] => [A] (entering A)\n\t{\n\t\tconst event = new DragEvent('dragenter', {\n\t\t\tcancelable: true,\n\t\t\tbubbles: true,\n\t\t});\n\t\taddFakeDataToEvent(event);\n\n\t\t// validating setup by ensuring that native event is setup correctly\n\t\texpect(sort(event.dataTransfer?.types ?? [])).toEqual(nativeMediaTypes);\n\t\tA.dispatchEvent(event);\n\n\t\texpect(ordered).toEqual(['dropTarget:enter', 'change:external']);\n\t\texpect(payloads.length).toBe(1);\n\t\tconst payload = payloads.at(-1);\n\t\tinvariant(payload);\n\t\t// types are exposed\n\t\texpect(sort(payload.types)).toEqual(nativeMediaTypes);\n\t\t// items are not exposed\n\t\texpect(payload.items.length).toBe(0);\n\t\t// `getData` doesn't return values\n\t\tfor (const key of getKeys(fakeData)) {\n\t\t\texpect(payload.getStringData(key)).toEqual(null);\n\t\t}\n\n\t\tordered.length = 0;\n\t\tpayloads.length = 0;\n\t}\n\n\t// [A] => cancel\n\t{\n\t\tconst event = new DragEvent('dragend', {\n\t\t\tcancelable: true,\n\t\t\tbubbles: true,\n\t\t});\n\t\taddFakeDataToEvent(event);\n\n\t\t// validating setup by ensuring that native event is setup correctly\n\t\texpect(sort(event.dataTransfer?.types ?? [])).toEqual(nativeMediaTypes);\n\t\tA.dispatchEvent(event);\n\n\t\texpect(ordered).toEqual([\n\t\t\t// leaving the drop target\n\t\t\t'dropTarget:leave',\n\t\t\t'change:external',\n\t\t\t// the drop event\n\t\t\t'drop:external',\n\t\t]);\n\t\texpect(payloads.length).toBe(2);\n\t\tconst payload = payloads.at(-1);\n\t\tinvariant(payload);\n\t\t// types are exposed\n\t\t// this also validates that the element adapter type are not exposed\n\t\texpect(sort(payload.types)).toEqual(nativeMediaTypes);\n\t\t// items are not exposed\n\t\t// this also validates that the element adapter item is not exposed\n\t\texpect(payload.items.length).toEqual(0);\n\n\t\t// cannot get any string data\n\t\tfor (const key of getKeys(fakeData)) {\n\t\t\tif (key !== 'Files') {\n\t\t\t\texpect(payload.getStringData(key)).toEqual(null);\n\t\t\t}\n\t\t}\n\t\t// all getters will return nothing\n\t\texpect(getFiles({ source: payload })).toEqual([]);\n\t\texpect(getText({ source: payload })).toEqual(null);\n\t\texpect(getURLs({ source: payload })).toEqual([]);\n\t\texpect(getHTML({ source: payload })).toEqual(null);\n\n\t\tordered.length = 0;\n\t\tpayloads.length = 0;\n\t}\n\n\tcleanup();\n});\n\ntest('data should not be exposed if a \"drop\" event occurs due to an unmanaged drop target', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\t// Using an array rather than `NativePayload | null` as TS was incorrectly narrowing\n\t// the value to `null` if it is only set inside of the pdnd callbacks\n\tconst payloads: ExternalDragPayload[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tbindAll(A, [\n\t\t\t{\n\t\t\t\ttype: 'dragover',\n\t\t\t\tlistener: (event) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'dragenter',\n\t\t\t\tlistener: (event) => {\n\t\t\t\t\tordered.push('unmanaged:enter');\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t},\n\t\t\t},\n\t\t]),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push(`start:external`);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push(`drop:external`);\n\t\t\t\tpayloads.push(args.source);\n\t\t\t},\n\t\t}),\n\t);\n\n\tnativeDrag.startExternal({\n\t\titems: [{ type: 'text/plain', data: 'hello' }],\n\t});\n\n\texpect(ordered).toEqual(['start:external']);\n\tordered.length = 0;\n\n\tfireEvent.dragEnter(A);\n\texpect(ordered).toEqual(['unmanaged:enter']);\n\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\tconst event = nativeDrag.drop({\n\t\titems: [{ type: 'text/plain', data: 'hello' }],\n\t\ttarget: A,\n\t});\n\n\t// onDrop will be called\n\texpect(payloads.length).toBe(1);\n\tconst payload = payloads.at(-1);\n\tinvariant(payload);\n\texpect(payload.types).toEqual(['text/plain']);\n\n\t// no items in the payload as pdnd did not handle the \"drop\"\n\texpect(payload.items.length).toBe(0);\n\texpect(getText({ source: payload })).toEqual(null);\n\n\t// data exists on the \"drop\" event - we are just not exposing it\n\texpect(event.dataTransfer?.getData('text/plain')).toBe('hello');\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/external/adapter/get-string-data.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport invariant from 'tiny-invariant';\n\nimport { elementAdapterNativeDataKey } from '../../../../src/adapter/element-adapter-native-data-key';\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdropTargetForExternal,\n\ttype ExternalEventBasePayload,\n\tmonitorForExternal,\n} from '../../../../src/entry-point/external/adapter';\nimport { appendToBody, getBubbleOrderedTree, nativeDrag, reset } from '../../_util';\n\nafterEach(reset);\n\n// Using this little wrapper as TypeScript was\n// incorrectly inferring that a local `drop` variable\n// was never being set (even though it was being set in onDrop)\nfunction getBucket() {\n\tlet drop: ExternalEventBasePayload | null = null;\n\n\treturn {\n\t\tsetDrop(value: ExternalEventBasePayload) {\n\t\t\tdrop = value;\n\t\t},\n\t\tgetDrop(): ExternalEventBasePayload {\n\t\t\tinvariant(drop, 'drop was not set');\n\t\t\treturn drop;\n\t\t},\n\t};\n}\n\ntest('getData() should return null when nothing of that type is dragging', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst bucket = getBucket();\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: (args) => {\n\t\t\t\tordered.push('A:enter');\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('A:drop');\n\t\t\t\tbucket.setDrop(args);\n\t\t\t},\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t},\n\t\t\tonDropTargetChange: (args) => {\n\t\t\t\tordered.push('monitor:change');\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t},\n\t\t}),\n\t);\n\n\tnativeDrag.startExternal({ items: [{ type: 'text/plain', data: 'hello' }] });\n\n\tfireEvent.dragEnter(A);\n\tnativeDrag.drop({\n\t\ttarget: A,\n\t\titems: [{ type: 'text/plain', data: 'hello' }],\n\t});\n\texpect(ordered).toEqual(['monitor:start', 'A:enter', 'monitor:change', 'A:drop', 'monitor:drop']);\n\n\texpect(bucket.getDrop().source.getStringData('text/html')).toBe(null);\n\t// validation\n\texpect(bucket.getDrop().source.getStringData('text/plain')).toBe('hello');\n\n\tcleanup();\n});\n\ntest('getData() should return \"\" if \"\" is explicitly set', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst bucket = getBucket();\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: (args) => {\n\t\t\t\tordered.push('A:enter');\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('A:drop');\n\t\t\t\tbucket.setDrop(args);\n\t\t\t},\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t},\n\t\t\tonDropTargetChange: (args) => {\n\t\t\t\tordered.push('monitor:change');\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t},\n\t\t}),\n\t);\n\n\tnativeDrag.startExternal({ items: [{ type: 'text/plain', data: '' }] });\n\n\tfireEvent.dragEnter(A);\n\tnativeDrag.drop({\n\t\ttarget: A,\n\t\titems: [{ type: 'text/plain', data: '' }],\n\t});\n\texpect(ordered).toEqual(['monitor:start', 'A:enter', 'monitor:change', 'A:drop', 'monitor:drop']);\n\n\texpect(bucket.getDrop().source.getStringData('text/plain')).toBe('');\n\n\tcleanup();\n});\n\ntest('getData() should return null if requesting the element adapter private key', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst bucket = getBucket();\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: (args) => {\n\t\t\t\tordered.push('A:enter');\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('A:drop');\n\t\t\t\tbucket.setDrop(args);\n\t\t\t},\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t},\n\t\t\tonDropTargetChange: (args) => {\n\t\t\t\tordered.push('monitor:change');\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t},\n\t\t}),\n\t);\n\n\tnativeDrag.startExternal({ items: [{ type: 'text/plain', data: '' }] });\n\n\tfireEvent.dragEnter(A);\n\tnativeDrag.drop({\n\t\ttarget: A,\n\t\titems: [{ type: 'text/plain', data: '' }],\n\t});\n\texpect(ordered).toEqual(['monitor:start', 'A:enter', 'monitor:change', 'A:drop', 'monitor:drop']);\n\n\texpect(bucket.getDrop().source.getStringData(elementAdapterNativeDataKey)).toBe(null);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/external/adapter/global-event-binding.spec.ts",
    "content": "// Note: not using '@testing-library/dom' in this file as it can\n// add it's own \"error\" event listeners when other events are being fired\n// This file uses vanilla event firing so that we are in total control\n\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport { appendToBody, getElements, nativeDrag, reset, userEvent } from '../../_util';\n\nlet addEventListener = jest.spyOn(window, 'addEventListener');\nlet removeEventListener = jest.spyOn(window, 'removeEventListener');\n\njest.resetModules();\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nafterEach(() => {\n\taddEventListener.mockClear();\n\tremoveEventListener.mockClear();\n\tjest.resetModules();\n});\n\nafterEach(reset);\n\nconst moduleAddListenerCount = 2;\n\nit('should bind event listeners ready for external drags when the module is imported', () => {\n\texpect(addEventListener).not.toHaveBeenCalled();\n\trequire('../../../../src/entry-point/external/adapter');\n\n\t// initial listeners\n\texpect(addEventListener).toHaveBeenCalledTimes(moduleAddListenerCount);\n});\n\nit('should not add more event listeners drop targets or monitors are added', () => {\n\texpect(addEventListener).not.toHaveBeenCalled();\n\tconst {\n\t\tdropTargetForExternal,\n\t\tmonitorForExternal,\n\t} = require('../../../../src/entry-point/external/adapter');\n\n\texpect(addEventListener).toHaveBeenCalledTimes(moduleAddListenerCount);\n\n\tconst [A] = getElements('div');\n\tconst unbind = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t}),\n\t\tmonitorForExternal({}),\n\t);\n\n\texpect(addEventListener).toHaveBeenCalledTimes(moduleAddListenerCount);\n\tunbind();\n});\n\nit('should bind event listeners needed for the drag only while dragging', () => {\n\tconst {\n\t\tdropTargetForExternal,\n\t\tmonitorForExternal,\n\t} = require('../../../../src/entry-point/external/adapter');\n\tconst ordered: string[] = [];\n\n\t// no event listeners added or removed yet\n\texpect(addEventListener).toHaveBeenCalledTimes(moduleAddListenerCount);\n\texpect(removeEventListener).not.toHaveBeenCalled();\n\n\tconst [A] = getElements('div');\n\tconst unbindA = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: () => ordered.push('start'),\n\t\t\tonDrop: () => ordered.push('drop'),\n\t\t}),\n\t);\n\n\texpect(addEventListener).toHaveBeenCalledTimes(moduleAddListenerCount);\n\t// Note: Cannot reset the mock. It causes internal reference mismatches\n\t// addEventListener.mockReset();\n\n\t// let's start a drag\n\tnativeDrag.startExternal({\n\t\titems: [{ data: 'Hi there', type: 'text/plain' }],\n\t});\n\texpect(ordered).toEqual(['start']);\n\tordered.length = 0;\n\n\t// we expect that *new* event listeners have been added for the duration of a the drag\n\tconst postLiftAddEventListenerCount = addEventListener.mock.calls.length - moduleAddListenerCount;\n\texpect(postLiftAddEventListenerCount).toBeGreaterThan(0);\n\texpect(removeEventListener).not.toHaveBeenCalled();\n\n\t// finish the drag\n\twindow.dispatchEvent(new DragEvent('dragend', { cancelable: true, bubbles: true }));\n\n\texpect(ordered).toEqual(['drop']);\n\n\t// all new event listeners have been removed\n\texpect(removeEventListener).toHaveBeenCalledTimes(postLiftAddEventListenerCount);\n\t// no more event listeners added\n\texpect(addEventListener).toHaveBeenCalledTimes(\n\t\tpostLiftAddEventListenerCount + moduleAddListenerCount,\n\t);\n\n\tunbindA();\n});\n\nit('should keep dragging event listeners bound even if only drop target is removed mid drag', () => {\n\tconst {\n\t\tdropTargetForExternal,\n\t\tmonitorForExternal,\n\t} = require('../../../../src/entry-point/external/adapter');\n\tconst ordered: string[] = [];\n\n\t// no event listeners added or removed yet\n\texpect(addEventListener).toHaveBeenCalledTimes(moduleAddListenerCount);\n\texpect(removeEventListener).not.toHaveBeenCalled();\n\n\tconst [A] = getElements('div');\n\tconst unbindA = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\tconst unbindMonitor = monitorForExternal({\n\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\tonDrop: () => ordered.push('monitor:drop'),\n\t});\n\n\texpect(addEventListener).toHaveBeenCalledTimes(moduleAddListenerCount);\n\t// Note: Cannot reset the mock. It causes internal reference mismatches\n\t// addEventListener.mockReset();\n\n\t// let's start a drag\n\tnativeDrag.startExternal({\n\t\titems: [{ data: 'Hi there', type: 'text/plain' }],\n\t});\n\texpect(ordered).toEqual(['monitor:start']);\n\tordered.length = 0;\n\n\t// we expect that *new* event listeners have been added for the duration of a the drag\n\tconst postLiftAddEventListenerCount = addEventListener.mock.calls.length - moduleAddListenerCount;\n\texpect(postLiftAddEventListenerCount).toBeGreaterThan(0);\n\texpect(removeEventListener).not.toHaveBeenCalled();\n\n\t// unbinding the only drop target mid drag\n\tunbindA();\n\n\texpect(removeEventListener).not.toHaveBeenCalled();\n\n\t// finish the drag\n\twindow.dispatchEvent(new DragEvent('dragend', { cancelable: true, bubbles: true }));\n\n\t// monitor still told about the drop\n\texpect(ordered).toEqual(['monitor:drop']);\n\n\t// all dragging event listeners removed\n\texpect(removeEventListener).toHaveBeenCalledTimes(postLiftAddEventListenerCount);\n\n\tunbindMonitor();\n});\n\nit('should remove event listeners used to detect local drags when a location drag finishes', () => {\n\tconst { monitorForExternal } = require('../../../../src/entry-point/external/adapter');\n\n\texpect(addEventListener).toHaveBeenCalledTimes(moduleAddListenerCount);\n\n\tconst [anchor] = getElements('a');\n\tanchor.href = 'https://domevents.dev';\n\tconst ordered: string[] = [];\n\n\tconst unbind = combine(\n\t\tappendToBody(anchor),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: () => ordered.push('external:start'),\n\t\t}),\n\t);\n\n\tnativeDrag.startInternal({\n\t\ttarget: anchor,\n\t\titems: [{ type: 'text/uri-list', data: 'https://domevents.dev' }],\n\t});\n\n\tconst addedEventListenersCount = addEventListener.mock.calls.length - moduleAddListenerCount;\n\texpect(addedEventListenersCount).toBeGreaterThan(0);\n\texpect(removeEventListener).not.toHaveBeenCalled();\n\n\tuserEvent.cancel();\n\n\texpect(removeEventListener).toHaveBeenCalledTimes(addedEventListenersCount);\n\n\tunbind();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/external/adapter/leaving-the-window.spec.ts",
    "content": "import { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdropTargetForExternal,\n\tmonitorForExternal,\n} from '../../../../src/entry-point/external/adapter';\nimport { appendToBody, getBubbleOrderedTree, nativeDrag, reset, userEvent } from '../../_util';\n\nafterEach(reset);\n\nit('should end an external drag when dragging out of the window', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst types: string[] = [];\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart(args) {\n\t\t\t\tordered.push(`start:external`);\n\t\t\t\ttypes.push(...args.source.types);\n\t\t\t},\n\t\t\tonDrop(args) {\n\t\t\t\tordered.push(`drop:external`);\n\t\t\t},\n\t\t}),\n\t);\n\n\t// First enter event is into A\n\tnativeDrag.startExternal({\n\t\titems: [{ data: 'Hi there', type: 'plain/text' }],\n\t\ttarget: A,\n\t});\n\n\texpect(types).toEqual(['plain/text']);\n\texpect(ordered).toEqual(['start:external']);\n\tordered.length = 0;\n\n\tuserEvent.leaveWindow();\n\n\texpect(ordered).toEqual(['drop:external']);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/external/adapter/respecting-non-pdnd-code.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport { bind, bindAll } from 'bind-event-listener';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport { monitorForExternal } from '../../../../src/entry-point/external/adapter';\nimport { getText } from '../../../../src/entry-point/external/text';\nimport { appendToBody, getBubbleOrderedTree, nativeDrag, reset } from '../../_util';\n\nafterEach(reset);\n\nit('should allow an external drag to start even if \"dragenter\" is cancelled', () => {\n\tconst [child, parent] = getBubbleOrderedTree();\n\tchild.textContent = 'Text to be dragged';\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(parent),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t}),\n\t\tbind(window, {\n\t\t\ttype: 'dragenter',\n\t\t\tlistener: (event) => {\n\t\t\t\tordered.push('cancelled');\n\t\t\t\tevent.preventDefault();\n\t\t\t},\n\t\t\t// hit before our external adapter\n\t\t\toptions: { capture: true },\n\t\t}),\n\t);\n\n\tnativeDrag.startExternal({\n\t\titems: [{ data: 'hello', type: 'text/plain' }],\n\t});\n\n\texpect(ordered).toEqual(['cancelled', 'monitor:start']);\n\n\tcleanup();\n});\n\ntest('an unmanaged \"drop\" event should not be cancelled', () => {\n\tconst [unmanagedDropTarget] = getBubbleOrderedTree();\n\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(unmanagedDropTarget),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t\tonDrop: ({ source }) =>\n\t\t\t\t// no access to source.items as we did not drop on a drop target\n\t\t\t\tordered.push(`monitor:drop - text:${getText({ source }) ?? '(none)'}`),\n\t\t}),\n\t\tbindAll(unmanagedDropTarget, [\n\t\t\t{\n\t\t\t\ttype: 'dragover',\n\t\t\t\tlistener: (event) => {\n\t\t\t\t\tordered.push('unmanaged:over');\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'dragenter',\n\t\t\t\tlistener: (event) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tordered.push('unmanaged:enter');\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'drop',\n\t\t\t\tlistener: () => {\n\t\t\t\t\tordered.push('unmanaged:drop');\n\t\t\t\t},\n\t\t\t},\n\t\t]),\n\t);\n\n\tnativeDrag.startExternal({\n\t\titems: [{ data: 'hello', type: 'text/plain' }],\n\t});\n\n\texpect(ordered).toEqual(['monitor:start']);\n\tordered.length = 0;\n\n\tfireEvent.dragEnter(unmanagedDropTarget);\n\n\texpect(ordered).toEqual(['unmanaged:enter']);\n\tordered.length = 0;\n\n\tconst event = nativeDrag.drop({\n\t\titems: [{ data: 'hello', type: 'text/plain' }],\n\t\ttarget: unmanagedDropTarget,\n\t});\n\n\texpect(event.defaultPrevented).toBe(false);\n\texpect(ordered).toEqual(['monitor:drop - text:(none)', 'unmanaged:drop']);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/external/adapter/starting-an-external-drag-before-registrations.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdropTargetForExternal,\n\tmonitorForExternal,\n} from '../../../../src/entry-point/external/adapter';\nimport { type CleanupFn } from '../../../../src/entry-point/types';\nimport { appendToBody, getElements, nativeDrag, reset } from '../../_util';\n\nafterEach(reset);\n\nit('should notify monitors and drop targets that are mounted during a drag', () => {\n\tconst cleanups: CleanupFn[] = [];\n\tconst ordered: string[] = [];\n\tconst [X, A] = getElements('div');\n\n\tcleanups.push(appendToBody(X, A));\n\n\tnativeDrag.startExternal({\n\t\titems: [{ type: 'text/plain', data: 'hello world' }],\n\t});\n\n\tfireEvent.dragEnter(A);\n\texpect(ordered).toEqual([]);\n\n\tcleanups.push(\n\t\tcombine(\n\t\t\tdropTargetForExternal({\n\t\t\t\telement: A,\n\t\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\t\tonDragLeave: () => ordered.push('A:leave'),\n\t\t\t}),\n\t\t\tdropTargetForExternal({\n\t\t\t\telement: X,\n\t\t\t\tonDragEnter: () => ordered.push('X:enter'),\n\t\t\t\tonDragLeave: () => ordered.push('X:leave'),\n\t\t\t}),\n\t\t\tmonitorForExternal({\n\t\t\t\tonDropTargetChange: () => ordered.push('monitor:change'),\n\t\t\t}),\n\t\t),\n\t);\n\texpect(ordered).toEqual([]);\n\n\t// complete a little movement over A\n\t// now \"over A\" according to the system\n\tfireEvent.dragOver(A);\n\t// @ts-expect-error: raf types\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['A:enter', 'monitor:change']);\n\tordered.length = 0;\n\n\tfireEvent.dragEnter(X);\n\n\texpect(ordered).toEqual(['A:leave', 'X:enter', 'monitor:change']);\n\n\tcleanups.forEach((fn) => fn());\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/external/adapter/starting-an-external-drag.spec.ts",
    "content": "import { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdropTargetForExternal,\n\tmonitorForExternal,\n} from '../../../../src/entry-point/external/adapter';\nimport {\n\tappendToBody,\n\tassortedNativeMediaTypes,\n\tgetBubbleOrderedTree,\n\tnativeDrag,\n\treset,\n} from '../../_util';\n\nafterEach(reset);\n\ntest(`scenario: dragging no media`, () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push(`start:external`);\n\t\t\t},\n\t\t}),\n\t);\n\n\t// not dragging anything - no drag started by pdnd\n\tnativeDrag.startExternal({ items: [] });\n\texpect(ordered).toEqual([]);\n\n\tcleanup();\n});\n\nfor (const type of assortedNativeMediaTypes) {\n\tdescribe(`dragging media type: ${type}`, () => {\n\t\ttest(`scenario: external => [body]`, () => {\n\t\t\tconst [A] = getBubbleOrderedTree();\n\t\t\tconst types: string[] = [];\n\t\t\tconst ordered: string[] = [];\n\n\t\t\tconst cleanup = combine(\n\t\t\t\tappendToBody(A),\n\t\t\t\tdropTargetForExternal({\n\t\t\t\t\telement: A,\n\t\t\t\t}),\n\t\t\t\tmonitorForExternal({\n\t\t\t\t\tonDragStart: (args) => {\n\t\t\t\t\t\tordered.push(`start:external`);\n\t\t\t\t\t\ttypes.push(...args.source.types);\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t);\n\n\t\t\t// Entering the window with files will start a drag\n\t\t\tnativeDrag.startExternal({\n\t\t\t\titems: [{ data: 'Hello', type: type }],\n\t\t\t\ttarget: document.body,\n\t\t\t});\n\n\t\t\texpect(types).toEqual([type]);\n\t\t\texpect(ordered).toEqual(['start:external']);\n\n\t\t\tcleanup();\n\t\t});\n\n\t\ttest(`scenario external => [A]`, () => {\n\t\t\tconst [A] = getBubbleOrderedTree();\n\t\t\tconst types: string[] = [];\n\t\t\tconst ordered: string[] = [];\n\t\t\tconst cleanup = combine(\n\t\t\t\tappendToBody(A),\n\t\t\t\tdropTargetForExternal({\n\t\t\t\t\telement: A,\n\t\t\t\t}),\n\t\t\t\tmonitorForExternal({\n\t\t\t\t\tonDragStart(args) {\n\t\t\t\t\t\tordered.push(`start:external`);\n\t\t\t\t\t\ttypes.push(...args.source.types);\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t);\n\n\t\t\t// First enter event is into A\n\t\t\tnativeDrag.startExternal({\n\t\t\t\titems: [{ data: 'Hi there', type: type }],\n\t\t\t\ttarget: A,\n\t\t\t});\n\n\t\t\texpect(types).toEqual([type]);\n\t\t\texpect(ordered).toEqual(['start:external']);\n\n\t\t\tcleanup();\n\t\t});\n\t});\n}\n\ntest('scenario: multiple media types', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst types: string[] = [];\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push(`start:external`);\n\t\t\t\ttypes.push(...args.source.types);\n\t\t\t},\n\t\t}),\n\t);\n\n\t// Entering the window with files will start a drag\n\tnativeDrag.startExternal({\n\t\titems: assortedNativeMediaTypes.map((type) => ({ data: 'hello', type })),\n\t\ttarget: document.body,\n\t});\n\n\texpect(Array.from(types).sort()).toEqual(Array.from(assortedNativeMediaTypes).sort());\n\texpect(ordered).toEqual(['start:external']);\n\n\tcleanup();\n});\n\ntest('there should be no initial drop targets', () => {\n\tconst ordered: string[] = [];\n\tconst [A] = getBubbleOrderedTree();\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push(`start:external`);\n\t\t\t\tordered.push(`dropTargets:${args.location.current.dropTargets.length}`);\n\t\t\t},\n\t\t}),\n\t);\n\n\tnativeDrag.startExternal({\n\t\t// first entering into \"A\", but we will explicitly\n\t\t// set the initial drop targets to be `[]`\n\t\ttarget: A,\n\t\titems: [{ data: 'Hello', type: 'text/plain' }],\n\t});\n\texpect(ordered).toEqual(['start:external', 'dropTargets:0']);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/external/drop-targets/nested.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdropTargetForExternal,\n\tmonitorForExternal,\n} from '../../../../src/entry-point/external/adapter';\nimport { appendToBody, getBubbleOrderedTree, nativeDrag, reset } from '../../_util';\n\nafterEach(reset);\n\ntest('nested drop targets should be supported', () => {\n\tconst [B, A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t\tonDropTargetChange: () => ordered.push('monitor:change'),\n\t\t\tonDrag: () => ordered.push('monitor:drag'),\n\t\t}),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDropTargetChange: () => ordered.push('a:change'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDrag: () => ordered.push('a:drag'),\n\t\t}),\n\t\tdropTargetForExternal({\n\t\t\telement: B,\n\t\t\tonDropTargetChange: () => ordered.push('b:change'),\n\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t\tonDrag: () => ordered.push('b:drag'),\n\t\t}),\n\t);\n\n\tnativeDrag.startExternal({\n\t\titems: [{ type: 'text/plain', data: 'Hello world' }],\n\t});\n\n\texpect(ordered).toEqual(['monitor:start']);\n\tordered.length = 0;\n\n\tfireEvent.dragOver(B);\n\n\texpect(ordered).toEqual(['b:change', 'b:enter', 'a:change', 'a:enter', 'monitor:change']);\n\tordered.length = 0;\n\n\tfireEvent.dragOver(A);\n\n\texpect(ordered).toEqual(['b:change', 'b:leave', 'a:change', 'monitor:change']);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/external/utils/file/contains-files.spec.ts",
    "content": "import invariant from 'tiny-invariant';\n\nimport { combine } from '../../../../../src/entry-point/combine';\nimport {\n\tdropTargetForExternal,\n\ttype ExternalEventBasePayload,\n\tmonitorForExternal,\n} from '../../../../../src/entry-point/external/adapter';\nimport { containsFiles } from '../../../../../src/entry-point/external/file';\nimport { appendToBody, getBubbleOrderedTree, nativeDrag, reset } from '../../../_util';\n\nafterEach(reset);\n\ntest('when dragging no files, containFiles() should return false', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tnativeDrag.startExternal({ items: [{ data: 'Hello', type: 'text/plain' }] });\n\n\texpect(ordered).toEqual(['start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(containsFiles(first)).toBe(false);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\t// Okay, now let's drop\n\tnativeDrag.drop({ items: [{ data: 'Hello', type: 'text/plain' }] });\n\n\texpect(ordered).toEqual(['drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\texpect(containsFiles(second)).toBe(false);\n\n\tcleanup();\n});\n\ntest('when dragging one file, containFiles() should return true', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst file: File = new File(['🕺'], 'dance.png', {\n\t\ttype: 'image/png',\n\t});\n\tnativeDrag.startExternal({ items: [file] });\n\n\texpect(ordered).toEqual(['start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(containsFiles(first)).toBe(true);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\t// Okay, now let's drop\n\tnativeDrag.drop({ items: [file] });\n\n\texpect(ordered).toEqual(['drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\texpect(containsFiles(second)).toBe(true);\n\n\tcleanup();\n});\n\ntest('when dragging multiple files, containFiles() should return true', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\tconst file1: File = new File(['1'], '1.png', {\n\t\ttype: 'image/png',\n\t});\n\tconst file2: File = new File(['2'], '2.png', {\n\t\ttype: 'image/png',\n\t});\n\tnativeDrag.startExternal({ items: [file1, file2] });\n\n\texpect(ordered).toEqual(['start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(containsFiles(first)).toBe(true);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\t// Okay, now lets drop\n\n\tnativeDrag.drop({ items: [file1, file2] });\n\n\texpect(ordered).toEqual(['drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\texpect(containsFiles(second)).toBe(true);\n\n\tcleanup();\n});\n\ntest('when dragging multiple types of native data (including files), containFiles() should return true', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst file: File = new File(['🕺'], 'dance.png', {\n\t\ttype: 'image/png',\n\t});\n\tconst items = [file, { data: 'Hello', type: 'text/plain' }];\n\tnativeDrag.startExternal({\n\t\titems,\n\t});\n\n\texpect(ordered).toEqual(['start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(containsFiles(first)).toBe(true);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\t// Okay, now lets drop\n\n\tnativeDrag.drop({ items });\n\n\texpect(ordered).toEqual(['drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\texpect(containsFiles(second)).toBe(true);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/external/utils/file/get-files.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport invariant from 'tiny-invariant';\n\nimport { combine } from '../../../../../src/entry-point/combine';\nimport {\n\tdropTargetForExternal,\n\ttype ExternalEventBasePayload,\n\tmonitorForExternal,\n} from '../../../../../src/entry-point/external/adapter';\nimport { getFiles } from '../../../../../src/entry-point/external/file';\nimport { appendToBody, getBubbleOrderedTree, nativeDrag, reset } from '../../../_util';\n\nafterEach(reset);\n\ntest('when dragging no files, getFiles() should return no files', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\tonDrop: () => ordered.push('A:drop'),\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tnativeDrag.startExternal({\n\t\titems: [{ data: 'Hello', type: 'text/plain' }],\n\t});\n\n\t// when starting a drag, no files are exposed\n\texpect(ordered).toEqual(['monitor:start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(getFiles({ source: first.source })).toEqual([]);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\tfireEvent.dragEnter(A);\n\n\texpect(ordered).toEqual(['A:enter']);\n\tordered.length = 0;\n\n\tnativeDrag.drop({\n\t\titems: [{ data: 'Hello', type: 'text/plain' }],\n\t});\n\n\texpect(ordered).toEqual(['A:drop', 'monitor:drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\texpect(getFiles({ source: second.source })).toEqual([]);\n\n\tcleanup();\n});\n\ntest('when dragging one file, getFiles() should return the file', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\tonDrop: () => ordered.push('A:drop'),\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst file: File = new File(['🕺'], 'dance.png', {\n\t\ttype: 'image/png',\n\t});\n\tnativeDrag.startExternal({\n\t\titems: [file],\n\t});\n\n\t// when starting a drag, no files are exposed\n\texpect(ordered).toEqual(['monitor:start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(getFiles({ source: first.source })).toEqual([]);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\tfireEvent.dragEnter(A);\n\n\texpect(ordered).toEqual(['A:enter']);\n\tordered.length = 0;\n\n\tnativeDrag.drop({\n\t\titems: [file],\n\t});\n\n\texpect(ordered).toEqual(['A:drop', 'monitor:drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\texpect(getFiles({ source: second.source })).toEqual([file]);\n\n\tcleanup();\n});\n\ntest('when dragging multiple files, getFiles() should return all files', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\tonDrop: () => ordered.push('A:drop'),\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst file1: File = new File(['1'], '1.png', {\n\t\ttype: 'image/png',\n\t});\n\tconst file2: File = new File(['2'], '2.png', {\n\t\ttype: 'image/png',\n\t});\n\tnativeDrag.startExternal({\n\t\titems: [file1, file2],\n\t});\n\n\t// when starting a drag, no files are exposed\n\texpect(ordered).toEqual(['monitor:start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(getFiles({ source: first.source })).toEqual([]);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\tfireEvent.dragEnter(A);\n\n\texpect(ordered).toEqual(['A:enter']);\n\tordered.length = 0;\n\n\tnativeDrag.drop({\n\t\titems: [file1, file2],\n\t});\n\n\texpect(ordered).toEqual(['A:drop', 'monitor:drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\texpect(getFiles({ source: second.source })).toEqual([file1, file2]);\n\n\tcleanup();\n});\n\ntest('when dragging multiple types of native data (including files), getFiles() should only return the files', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\tonDrop: () => ordered.push('A:drop'),\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst file1: File = new File(['1'], '1.png', {\n\t\ttype: 'image/png',\n\t});\n\tconst file2: File = new File(['2'], '2.png', {\n\t\ttype: 'image/png',\n\t});\n\tconst items = [file1, file2, { data: 'Hello', type: 'text/plain' }];\n\tnativeDrag.startExternal({\n\t\titems,\n\t});\n\n\t// when starting a drag, no files are exposed\n\texpect(ordered).toEqual(['monitor:start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(getFiles({ source: first.source })).toEqual([]);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\tfireEvent.dragEnter(A);\n\n\texpect(ordered).toEqual(['A:enter']);\n\tordered.length = 0;\n\n\tnativeDrag.drop({\n\t\titems,\n\t});\n\n\texpect(ordered).toEqual(['A:drop', 'monitor:drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\texpect(getFiles({ source: second.source })).toEqual([file1, file2]);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/external/utils/html/contains-html.spec.ts",
    "content": "import invariant from 'tiny-invariant';\n\nimport { combine } from '../../../../../src/entry-point/combine';\nimport {\n\tdropTargetForExternal,\n\ttype ExternalEventBasePayload,\n\tmonitorForExternal,\n} from '../../../../../src/entry-point/external/adapter';\nimport { containsHTML } from '../../../../../src/entry-point/external/html';\nimport { appendToBody, getBubbleOrderedTree, nativeDrag, reset } from '../../../_util';\n\nafterEach(reset);\n\ntest('when dragging no html, containHTML() should return false', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tnativeDrag.startExternal({ items: [{ data: 'Hello', type: 'text/plain' }] });\n\n\texpect(ordered).toEqual(['start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(containsHTML(first)).toBe(false);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\t// Okay, now let's drop\n\tnativeDrag.drop({ items: [{ data: 'Hello', type: 'text/plain' }] });\n\n\texpect(ordered).toEqual(['drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\texpect(containsHTML(second)).toBe(false);\n\n\tcleanup();\n});\n\ntest('when dragging html, containHTML() should return true', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst items = [{ data: '<h1>hi</h1>', type: 'text/html' }];\n\tnativeDrag.startExternal({ items });\n\n\texpect(ordered).toEqual(['start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(containsHTML(first)).toBe(true);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\t// Okay, now let's drop\n\tnativeDrag.drop({ items });\n\n\texpect(ordered).toEqual(['drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\texpect(containsHTML(second)).toBe(true);\n\n\tcleanup();\n});\n\ntest('when dragging multiple types of native data (including html), containsHTML() should return true', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst items = [\n\t\t{ data: '<h1>Alex was here<h1>', type: 'text/html' },\n\t\t{ data: 'Hello', type: 'text/plain' },\n\t];\n\tnativeDrag.startExternal({\n\t\titems,\n\t});\n\n\texpect(ordered).toEqual(['start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(containsHTML(first)).toBe(true);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\t// Okay, now lets drop\n\n\tnativeDrag.drop({ items });\n\n\texpect(ordered).toEqual(['drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\texpect(containsHTML(second)).toBe(true);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/external/utils/html/get-html.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport invariant from 'tiny-invariant';\n\nimport { combine } from '../../../../../src/entry-point/combine';\nimport {\n\tdropTargetForExternal,\n\ttype ExternalEventBasePayload,\n\tmonitorForExternal,\n} from '../../../../../src/entry-point/external/adapter';\nimport { getHTML } from '../../../../../src/entry-point/external/html';\nimport { appendToBody, getBubbleOrderedTree, nativeDrag, reset } from '../../../_util';\n\nafterEach(reset);\n\ntest('when dragging no html, getHTML() should return null', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\tonDrop: () => ordered.push('A:drop'),\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tnativeDrag.startExternal({\n\t\titems: [{ data: 'Hello', type: 'text/plain' }],\n\t});\n\n\t// when starting a drag, no items are exposed\n\texpect(ordered).toEqual(['monitor:start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(getHTML({ source: first.source })).toEqual(null);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\tfireEvent.dragEnter(A);\n\n\texpect(ordered).toEqual(['A:enter']);\n\tordered.length = 0;\n\n\tnativeDrag.drop({\n\t\titems: [{ data: 'Hello', type: 'text/plain' }],\n\t});\n\n\texpect(ordered).toEqual(['A:drop', 'monitor:drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\texpect(getHTML({ source: second.source })).toEqual(null);\n\n\tcleanup();\n});\n\ntest('when dragging html, getHTML() should return the html', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\tonDrop: () => ordered.push('A:drop'),\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tnativeDrag.startExternal({\n\t\titems: [{ data: '<h1>hi there</h1>', type: 'text/html' }],\n\t});\n\n\t// when starting a drag, no items are exposed\n\texpect(ordered).toEqual(['monitor:start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(getHTML({ source: first.source })).toEqual(null);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\tfireEvent.dragEnter(A);\n\n\texpect(ordered).toEqual(['A:enter']);\n\tordered.length = 0;\n\n\tnativeDrag.drop({\n\t\titems: [{ data: '<h1>hi there</h1>', type: 'text/html' }],\n\t});\n\n\texpect(ordered).toEqual(['A:drop', 'monitor:drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\texpect(getHTML({ source: second.source })).toEqual('<h1>hi there</h1>');\n\n\tcleanup();\n});\n\ntest('when dragging multiple types of native data (including html), getHTML() should only return the html', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\tonDrop: () => ordered.push('A:drop'),\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst items = [\n\t\t{ data: 'Hello', type: 'text/plain' },\n\t\t{ data: '<h1>Hi</h1>', type: 'text/html' },\n\t];\n\tnativeDrag.startExternal({\n\t\titems,\n\t});\n\n\t// when starting a drag, no html are exposed\n\texpect(ordered).toEqual(['monitor:start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(getHTML({ source: first.source })).toEqual(null);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\tfireEvent.dragEnter(A);\n\n\texpect(ordered).toEqual(['A:enter']);\n\tordered.length = 0;\n\n\tnativeDrag.drop({\n\t\titems,\n\t});\n\n\texpect(ordered).toEqual(['A:drop', 'monitor:drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\texpect(getHTML({ source: second.source })).toEqual('<h1>Hi</h1>');\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/external/utils/some.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport invariant from 'tiny-invariant';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdropTargetForExternal,\n\ttype ExternalEventBasePayload,\n\tmonitorForExternal,\n} from '../../../../src/entry-point/external/adapter';\nimport { containsHTML, getHTML } from '../../../../src/entry-point/external/html';\nimport { some } from '../../../../src/entry-point/external/some';\nimport { containsText, getText } from '../../../../src/entry-point/external/text';\nimport { getURLs } from '../../../../src/entry-point/external/url';\nimport { appendToBody, getBubbleOrderedTree, nativeDrag, reset } from '../../_util';\n\nafterEach(reset);\n\nit('should pass when all drag types that match', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\tonDrop: () => ordered.push('A:drop'),\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tcanMonitor: some(containsText, containsHTML),\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst items = [\n\t\t{ data: '<h1>Hello world</h1>', type: 'text/html' },\n\t\t{ data: 'Hello', type: 'text/plain' },\n\t];\n\tnativeDrag.startExternal({\n\t\titems,\n\t});\n\n\t// when starting a drag, no items are exposed\n\texpect(ordered).toEqual(['monitor:start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(getURLs({ source: first.source })).toEqual([]);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\tfireEvent.dragEnter(A);\n\texpect(ordered).toEqual(['A:enter']);\n\tordered.length = 0;\n\n\tnativeDrag.drop({\n\t\titems,\n\t});\n\n\texpect(ordered).toEqual(['A:drop', 'monitor:drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\n\texpect(getHTML({ source: second.source })).toEqual('<h1>Hello world</h1>');\n\texpect(getText({ source: second.source })).toBe('Hello');\n\n\tcleanup();\n});\n\nit('should pass when any drag type matches', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\tonDrop: () => ordered.push('A:drop'),\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tcanMonitor: some(containsText, containsHTML),\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst items = [{ data: '<h1>Hello world</h1>', type: 'text/html' }];\n\tnativeDrag.startExternal({\n\t\titems,\n\t});\n\n\t// when starting a drag, no items are exposed\n\texpect(ordered).toEqual(['monitor:start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(getURLs({ source: first.source })).toEqual([]);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\tfireEvent.dragEnter(A);\n\texpect(ordered).toEqual(['A:enter']);\n\tordered.length = 0;\n\n\tnativeDrag.drop({\n\t\titems,\n\t});\n\n\texpect(ordered).toEqual(['A:drop', 'monitor:drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\n\texpect(getHTML({ source: second.source })).toEqual('<h1>Hello world</h1>');\n\texpect(containsText({ source: second.source })).toBe(false);\n\n\tcleanup();\n});\n\nit('should not pass when no drag type matches', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\tonDrop: () => ordered.push('A:drop'),\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tcanMonitor: some(containsText, containsHTML),\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst items = [{ data: 'https://atlassian.design/', type: 'text/uri-list' }];\n\tnativeDrag.startExternal({\n\t\titems,\n\t});\n\n\t// monitor not called\n\texpect(ordered).toEqual([]);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/external/utils/text/contains-text.spec.ts",
    "content": "import invariant from 'tiny-invariant';\n\nimport { combine } from '../../../../../src/entry-point/combine';\nimport {\n\tdropTargetForExternal,\n\ttype ExternalEventBasePayload,\n\tmonitorForExternal,\n} from '../../../../../src/entry-point/external/adapter';\nimport { containsText } from '../../../../../src/entry-point/external/text';\nimport { appendToBody, getBubbleOrderedTree, nativeDrag, reset } from '../../../_util';\n\nafterEach(reset);\n\ntest('when dragging no text, containsText() should return false', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tnativeDrag.startExternal({ items: [{ data: 'Hello', type: 'text/html' }] });\n\n\texpect(ordered).toEqual(['start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(containsText(first)).toBe(false);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\t// Okay, now let's drop\n\tnativeDrag.drop({ items: [{ data: 'Hello', type: 'text/html' }] });\n\n\texpect(ordered).toEqual(['drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\texpect(containsText(second)).toBe(false);\n\n\tcleanup();\n});\n\ntest('when dragging text, containsText() should return true', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst items = [{ data: 'Hi', type: 'text/plain' }];\n\tnativeDrag.startExternal({ items });\n\n\texpect(ordered).toEqual(['start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(containsText(first)).toBe(true);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\t// Okay, now let's drop\n\tnativeDrag.drop({ items });\n\n\texpect(ordered).toEqual(['drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\texpect(containsText(second)).toBe(true);\n\n\tcleanup();\n});\n\ntest('when dragging multiple types of native data (including text), containsText() should return true', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst items = [\n\t\t{ data: '<h1>Alex was here<h1>', type: 'text/html' },\n\t\t{ data: 'Hello', type: 'text/plain' },\n\t];\n\tnativeDrag.startExternal({\n\t\titems,\n\t});\n\n\texpect(ordered).toEqual(['start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(containsText(first)).toBe(true);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\t// Okay, now lets drop\n\n\tnativeDrag.drop({ items });\n\n\texpect(ordered).toEqual(['drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\texpect(containsText(second)).toBe(true);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/external/utils/text/get-text.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport invariant from 'tiny-invariant';\n\nimport { combine } from '../../../../../src/entry-point/combine';\nimport {\n\tdropTargetForExternal,\n\ttype ExternalEventBasePayload,\n\tmonitorForExternal,\n} from '../../../../../src/entry-point/external/adapter';\nimport { getText } from '../../../../../src/entry-point/external/text';\nimport { appendToBody, getBubbleOrderedTree, nativeDrag, reset } from '../../../_util';\n\nafterEach(reset);\n\ntest('when dragging no text, getText() should return null', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\tonDrop: () => ordered.push('A:drop'),\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst items = [{ data: '<h1>Declan is a boss</h1>', type: 'text/html' }];\n\tnativeDrag.startExternal({\n\t\titems,\n\t});\n\n\t// when starting a drag, no items are exposed\n\texpect(ordered).toEqual(['monitor:start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(getText({ source: first.source })).toEqual(null);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\tfireEvent.dragEnter(A);\n\n\texpect(ordered).toEqual(['A:enter']);\n\tordered.length = 0;\n\n\tnativeDrag.drop({\n\t\titems,\n\t});\n\n\texpect(ordered).toEqual(['A:drop', 'monitor:drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\texpect(getText({ source: second.source })).toEqual(null);\n\n\tcleanup();\n});\n\ntest('when dragging text, getText() should return the text', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\tonDrop: () => ordered.push('A:drop'),\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tnativeDrag.startExternal({\n\t\titems: [{ data: 'Alex says hello', type: 'text/plain' }],\n\t});\n\n\t// when starting a drag, no items are exposed\n\texpect(ordered).toEqual(['monitor:start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(getText({ source: first.source })).toEqual(null);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\tfireEvent.dragEnter(A);\n\n\texpect(ordered).toEqual(['A:enter']);\n\tordered.length = 0;\n\n\tnativeDrag.drop({\n\t\titems: [{ data: 'Alex says hello', type: 'text/plain' }],\n\t});\n\n\texpect(ordered).toEqual(['A:drop', 'monitor:drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\texpect(getText({ source: second.source })).toEqual('Alex says hello');\n\n\tcleanup();\n});\n\ntest('when dragging multiple types of native data (including text), getText() should only return the text', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\tonDrop: () => ordered.push('A:drop'),\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst items = [\n\t\t{ data: 'Hello', type: 'text/plain' },\n\t\t{ data: '<h1>Hi</h1>', type: 'text/html' },\n\t];\n\tnativeDrag.startExternal({\n\t\titems,\n\t});\n\n\t// when starting a drag, no html are exposed\n\texpect(ordered).toEqual(['monitor:start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(getText({ source: first.source })).toEqual(null);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\tfireEvent.dragEnter(A);\n\n\texpect(ordered).toEqual(['A:enter']);\n\tordered.length = 0;\n\n\tnativeDrag.drop({\n\t\titems,\n\t});\n\n\texpect(ordered).toEqual(['A:drop', 'monitor:drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\texpect(getText({ source: second.source })).toEqual('Hello');\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/external/utils/url/contains-urls.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport invariant from 'tiny-invariant';\n\nimport { combine } from '../../../../../src/entry-point/combine';\nimport {\n\tdropTargetForExternal,\n\ttype ExternalEventBasePayload,\n\tmonitorForExternal,\n} from '../../../../../src/entry-point/external/adapter';\nimport { containsText, getText } from '../../../../../src/entry-point/external/text';\nimport { containsURLs, getURLs } from '../../../../../src/entry-point/external/url';\nimport { appendToBody, getBubbleOrderedTree, nativeDrag, reset } from '../../../_util';\n\nafterEach(reset);\n\ntest('when dragging no urls, containsURLs() should return false', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\tonDrop: () => ordered.push('A:drop'),\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst items = [{ data: 'Hello', type: 'text/plain' }];\n\tnativeDrag.startExternal({\n\t\titems,\n\t});\n\n\t// when starting a drag, no items are exposed\n\texpect(ordered).toEqual(['monitor:start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(containsURLs({ source: first.source })).toEqual(false);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\tfireEvent.dragEnter(A);\n\n\texpect(ordered).toEqual(['A:enter']);\n\tordered.length = 0;\n\n\tnativeDrag.drop({\n\t\titems,\n\t});\n\n\texpect(ordered).toEqual(['A:drop', 'monitor:drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\texpect(containsURLs({ source: second.source })).toEqual(false);\n\n\t// checking the text is there\n\texpect(getText({ source: second.source })).toEqual('Hello');\n\n\tcleanup();\n});\n\ntest('when dragging urls, containsURLs() should return true', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\tonDrop: () => ordered.push('A:drop'),\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst items = [{ data: 'https://atlassian.design/', type: 'text/uri-list' }];\n\tnativeDrag.startExternal({\n\t\titems,\n\t});\n\n\t// when starting a drag, no items are exposed\n\texpect(ordered).toEqual(['monitor:start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(containsURLs({ source: first.source })).toEqual(true);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\tfireEvent.dragEnter(A);\n\n\texpect(ordered).toEqual(['A:enter']);\n\tordered.length = 0;\n\n\tnativeDrag.drop({\n\t\titems,\n\t});\n\n\texpect(ordered).toEqual(['A:drop', 'monitor:drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\texpect(containsURLs({ source: second.source })).toEqual(true);\n\n\t// checking the text is there\n\texpect(getURLs({ source: second.source })).toEqual(['https://atlassian.design/']);\n\n\tcleanup();\n});\n\ntest('when dragging multiple types of native data (including urls), containsURLs() should return true', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\tonDrop: () => ordered.push('A:drop'),\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst items = [\n\t\t{ data: 'https://atlassian.design/', type: 'text/uri-list' },\n\t\t{ data: 'Hello', type: 'text/plain' },\n\t];\n\tnativeDrag.startExternal({\n\t\titems,\n\t});\n\n\t// when starting a drag, no items are exposed\n\texpect(ordered).toEqual(['monitor:start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(containsURLs({ source: first.source })).toEqual(true);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\tfireEvent.dragEnter(A);\n\n\texpect(ordered).toEqual(['A:enter']);\n\tordered.length = 0;\n\n\tnativeDrag.drop({\n\t\titems,\n\t});\n\n\texpect(ordered).toEqual(['A:drop', 'monitor:drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\texpect(containsURLs({ source: second.source })).toEqual(true);\n\n\t// checking url is there\n\texpect(getURLs({ source: second.source })).toEqual(['https://atlassian.design/']);\n\t// checking our text is there\n\texpect(containsText({ source: second.source })).toEqual(true);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/external/utils/url/firefox-fix.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport invariant from 'tiny-invariant';\n\nimport { combine } from '../../../../../src/entry-point/combine';\nimport {\n\tdropTargetForExternal,\n\ttype ExternalEventBasePayload,\n\tmonitorForExternal,\n} from '../../../../../src/entry-point/external/adapter';\nimport { containsURLs, getURLs } from '../../../../../src/entry-point/external/url';\nimport { appendToBody, getBubbleOrderedTree, nativeDrag, reset } from '../../../_util';\n\n/**\n * 🦊🐞\n * When dragging a URL from the Firefox address bar or bookmarks\n * they are currently not adding an entry for \"text/uri-list\".\n * They add \"text/x-moz-url\" data which contains the same information\n * in a different format.\n *\n * [Bug report](https://bugzilla.mozilla.org/show_bug.cgi?id=1912164)\n */\n\nafterEach(reset);\n\ntest('getURL() should use \"text/uri-list\" before \"text/x-moz-url\"', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\tonDrop: () => ordered.push('A:drop'),\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst items = [\n\t\t{ data: 'https://atlassian.design', type: 'text/x-moz-url' },\n\t\t{ data: 'https://atlassian.com', type: 'text/uri-list' },\n\t];\n\tnativeDrag.startExternal({\n\t\titems,\n\t});\n\n\t// when starting a drag, no items are exposed\n\texpect(ordered).toEqual(['monitor:start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(getURLs({ source: first.source })).toEqual([]);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\tfireEvent.dragEnter(A);\n\texpect(ordered).toEqual(['A:enter']);\n\tordered.length = 0;\n\tnativeDrag.drop({\n\t\titems,\n\t});\n\n\texpect(ordered).toEqual(['A:drop', 'monitor:drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\t// validating the raw data is what we set\n\texpect(second.source.getStringData('text/uri-list')).toEqual('https://atlassian.com');\n\texpect(second.source.getStringData('text/x-moz-url')).toEqual('https://atlassian.design');\n\n\t// only returning text/uri-list data\n\texpect(getURLs({ source: second.source })).toEqual(['https://atlassian.com']);\n\n\tcleanup();\n});\n\ntype Scenario = {\n\tdescription: string;\n\turiValue: string;\n\texpectedGetURLValue: string[];\n};\nconst scenarios: Scenario[] = [\n\t{\n\t\tdescription: 'single url',\n\t\turiValue: 'https://atlassian.design/',\n\t\texpectedGetURLValue: ['https://atlassian.design/'],\n\t},\n\t{\n\t\tdescription: 'url with title',\n\t\turiValue: 'https://atlassian.design/\\nAtlassian',\n\t\texpectedGetURLValue: ['https://atlassian.design/'],\n\t},\n\t{\n\t\tdescription: 'multiple url with titles',\n\t\turiValue: 'https://atlassian.design/\\nAtlassian\\nhttps://domevents.dev/\\nDOM Events',\n\t\texpectedGetURLValue: ['https://atlassian.design/', 'https://domevents.dev/'],\n\t},\n\t{\n\t\t// not sure if this is possible, but just being safe\n\t\tdescription: 'url with title + url with no title',\n\t\turiValue: 'https://atlassian.design/\\nAtlassian\\nhttps://domevents.dev/',\n\t\texpectedGetURLValue: ['https://atlassian.design/', 'https://domevents.dev/'],\n\t},\n];\n\nscenarios.forEach((scenario) => {\n\ttest(`getURL() case: ${scenario.description}`, () => {\n\t\tconst [A] = getBubbleOrderedTree();\n\t\tconst ordered: string[] = [];\n\t\tconst payloads: ExternalEventBasePayload[] = [];\n\t\tconst cleanup = combine(\n\t\t\tappendToBody(A),\n\t\t\tdropTargetForExternal({\n\t\t\t\telement: A,\n\t\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\t\tonDrop: () => ordered.push('A:drop'),\n\t\t\t}),\n\t\t\tmonitorForExternal({\n\t\t\t\tonDragStart: (args) => {\n\t\t\t\t\tordered.push('monitor:start');\n\t\t\t\t\tpayloads.push(args);\n\t\t\t\t},\n\t\t\t\tonDrop: (args) => {\n\t\t\t\t\tordered.push('monitor:drop');\n\t\t\t\t\tpayloads.push(args);\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\n\t\tconst items = [{ data: scenario.uriValue, type: 'text/x-moz-url' }];\n\t\tnativeDrag.startExternal({\n\t\t\titems,\n\t\t});\n\n\t\t// when starting a drag, no items are exposed\n\t\texpect(ordered).toEqual(['monitor:start']);\n\t\texpect(payloads.length).toBe(1);\n\t\tconst first = payloads[0];\n\t\tinvariant(first);\n\t\texpect(getURLs({ source: first.source })).toEqual([]);\n\t\tordered.length = 0;\n\t\tpayloads.length = 0;\n\n\t\tfireEvent.dragEnter(A);\n\t\texpect(ordered).toEqual(['A:enter']);\n\t\tordered.length = 0;\n\t\tnativeDrag.drop({\n\t\t\titems,\n\t\t});\n\n\t\texpect(ordered).toEqual(['A:drop', 'monitor:drop']);\n\t\texpect(payloads.length).toBe(1);\n\t\tconst second = payloads[0];\n\t\tinvariant(second);\n\t\t// validating the raw data is what we set\n\t\texpect(second.source.getStringData('text/x-moz-url')).toEqual(scenario.uriValue);\n\t\t// validating our helper works how I expect\n\t\texpect(getURLs({ source: second.source })).toEqual(scenario.expectedGetURLValue);\n\n\t\tcleanup();\n\t});\n});\n\ntest('containsURLs() should return true if \"text/x-moz-url\" data is being dragged', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\tonDrop: () => ordered.push('A:drop'),\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst items = [{ data: 'https://atlassian.design/', type: 'text/x-moz-url' }];\n\tnativeDrag.startExternal({\n\t\titems,\n\t});\n\n\t// when starting a drag, no items are exposed\n\texpect(ordered).toEqual(['monitor:start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(containsURLs({ source: first.source })).toEqual(true);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\tfireEvent.dragEnter(A);\n\n\texpect(ordered).toEqual(['A:enter']);\n\tordered.length = 0;\n\n\tnativeDrag.drop({\n\t\titems,\n\t});\n\n\texpect(ordered).toEqual(['A:drop', 'monitor:drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\texpect(containsURLs({ source: second.source })).toEqual(true);\n\n\t// checking url is there\n\texpect(getURLs({ source: second.source })).toEqual(['https://atlassian.design/']);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/external/utils/url/url.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\nimport invariant from 'tiny-invariant';\n\nimport { combine } from '../../../../../src/entry-point/combine';\nimport {\n\tdropTargetForExternal,\n\ttype ExternalEventBasePayload,\n\tmonitorForExternal,\n} from '../../../../../src/entry-point/external/adapter';\nimport { getText } from '../../../../../src/entry-point/external/text';\nimport { getURLs } from '../../../../../src/entry-point/external/url';\nimport { appendToBody, getBubbleOrderedTree, nativeDrag, reset } from '../../../_util';\n\nafterEach(reset);\n\ntest('when dragging no urls, getURLs() should return []', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\tonDrop: () => ordered.push('A:drop'),\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst items = [{ data: '<h1>Declan is a boss</h1>', type: 'text/html' }];\n\tnativeDrag.startExternal({\n\t\titems,\n\t});\n\n\t// when starting a drag, no items are exposed\n\texpect(ordered).toEqual(['monitor:start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(getURLs({ source: first.source })).toEqual([]);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\tfireEvent.dragEnter(A);\n\n\texpect(ordered).toEqual(['A:enter']);\n\tordered.length = 0;\n\n\tnativeDrag.drop({\n\t\titems,\n\t});\n\n\texpect(ordered).toEqual(['A:drop', 'monitor:drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\texpect(getURLs({ source: second.source })).toEqual([]);\n\n\tcleanup();\n});\n\ntype Scenario = {\n\tdescription: string;\n\turiValue: string;\n\texpectedGetURLValue: string[];\n};\nconst scenarios: Scenario[] = [\n\t{\n\t\tdescription: 'single url',\n\t\turiValue: 'https://atlassian.design/',\n\t\texpectedGetURLValue: ['https://atlassian.design/'],\n\t},\n\t{\n\t\tdescription: 'multiple urls',\n\t\turiValue: 'https://atlassian.design/\\r\\nhttps://www.atlassian.com/',\n\t\texpectedGetURLValue: ['https://atlassian.design/', 'https://www.atlassian.com/'],\n\t},\n\t{\n\t\tdescription: 'single comment',\n\t\turiValue: '# just a comment',\n\t\texpectedGetURLValue: [],\n\t},\n\t{\n\t\tdescription: 'comments and urls',\n\t\turiValue:\n\t\t\t'#first\\r\\nhttps://atlassian.design/\\r\\n#second\\r\\nhttps://www.atlassian.com/\\r\\n#third',\n\t\texpectedGetURLValue: ['https://atlassian.design/', 'https://www.atlassian.com/'],\n\t},\n\t{\n\t\tdescription: 'urls with path segments (checking \"#\" in a url is okay)',\n\t\turiValue: 'https://atlassian.design/components/avatar/examples#circle',\n\t\texpectedGetURLValue: ['https://atlassian.design/components/avatar/examples#circle'],\n\t},\n];\n\nscenarios.forEach((scenario) => {\n\ttest(`getURL() case: ${scenario.description}`, () => {\n\t\tconst [A] = getBubbleOrderedTree();\n\t\tconst ordered: string[] = [];\n\t\tconst payloads: ExternalEventBasePayload[] = [];\n\t\tconst cleanup = combine(\n\t\t\tappendToBody(A),\n\t\t\tdropTargetForExternal({\n\t\t\t\telement: A,\n\t\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\t\tonDrop: () => ordered.push('A:drop'),\n\t\t\t}),\n\t\t\tmonitorForExternal({\n\t\t\t\tonDragStart: (args) => {\n\t\t\t\t\tordered.push('monitor:start');\n\t\t\t\t\tpayloads.push(args);\n\t\t\t\t},\n\t\t\t\tonDrop: (args) => {\n\t\t\t\t\tordered.push('monitor:drop');\n\t\t\t\t\tpayloads.push(args);\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\n\t\tconst items = [{ data: scenario.uriValue, type: 'text/uri-list' }];\n\t\tnativeDrag.startExternal({\n\t\t\titems,\n\t\t});\n\n\t\t// when starting a drag, no items are exposed\n\t\texpect(ordered).toEqual(['monitor:start']);\n\t\texpect(payloads.length).toBe(1);\n\t\tconst first = payloads[0];\n\t\tinvariant(first);\n\t\texpect(getURLs({ source: first.source })).toEqual([]);\n\t\tordered.length = 0;\n\t\tpayloads.length = 0;\n\n\t\tfireEvent.dragEnter(A);\n\t\texpect(ordered).toEqual(['A:enter']);\n\t\tordered.length = 0;\n\t\tnativeDrag.drop({\n\t\t\titems,\n\t\t});\n\n\t\texpect(ordered).toEqual(['A:drop', 'monitor:drop']);\n\t\texpect(payloads.length).toBe(1);\n\t\tconst second = payloads[0];\n\t\tinvariant(second);\n\t\t// validating the raw data is what we set\n\t\texpect(second.source.getStringData('text/uri-list')).toEqual(scenario.uriValue);\n\t\t// validating our helper works how I expect\n\t\texpect(getURLs({ source: second.source })).toEqual(scenario.expectedGetURLValue);\n\n\t\tcleanup();\n\t});\n});\n\ntest('when dragging multiple types of native data (including urls), getURLs() should only return the urls', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tconst ordered: string[] = [];\n\tconst payloads: ExternalEventBasePayload[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForExternal({\n\t\t\telement: A,\n\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\tonDrop: () => ordered.push('A:drop'),\n\t\t}),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: (args) => {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t\tonDrop: (args) => {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t\tpayloads.push(args);\n\t\t\t},\n\t\t}),\n\t);\n\n\tconst items = [\n\t\t{ data: 'https://atlassian.design/', type: 'text/uri-list' },\n\t\t{ data: 'Hello', type: 'text/plain' },\n\t];\n\tnativeDrag.startExternal({\n\t\titems,\n\t});\n\n\t// when starting a drag, no items are exposed\n\texpect(ordered).toEqual(['monitor:start']);\n\texpect(payloads.length).toBe(1);\n\tconst first = payloads[0];\n\tinvariant(first);\n\texpect(getURLs({ source: first.source })).toEqual([]);\n\tordered.length = 0;\n\tpayloads.length = 0;\n\n\tfireEvent.dragEnter(A);\n\n\texpect(ordered).toEqual(['A:enter']);\n\tordered.length = 0;\n\n\tnativeDrag.drop({\n\t\titems,\n\t});\n\n\texpect(ordered).toEqual(['A:drop', 'monitor:drop']);\n\texpect(payloads.length).toBe(1);\n\tconst second = payloads[0];\n\tinvariant(second);\n\texpect(getURLs({ source: second.source })).toEqual(['https://atlassian.design/']);\n\n\t// checking the text is there too\n\texpect(getText({ source: second.source })).toEqual('Hello');\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/honey-pot-fix/_util.ts",
    "content": "import invariant from 'tiny-invariant';\n\nconst honeyPotSelector = '[data-pdnd-honey-pot]';\n\nexport function findHoneyPot(): Element | null {\n\treturn document.querySelector(honeyPotSelector);\n}\n\nexport function getHoneyPot(): HTMLElement {\n\tconst possible = document.querySelectorAll(honeyPotSelector);\n\tinvariant(possible.length !== 0, `No honey pot element found`);\n\tinvariant(possible.length === 1, `Multiple honey pot elements found (expected 1)`);\n\n\tconst [element] = possible;\n\tinvariant(element instanceof HTMLElement, 'Honey pot is not a HTMLElement');\n\treturn element;\n}\n"
  },
  {
    "path": "packages/core/__tests__/unit/honey-pot-fix/event-listeners.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../src/entry-point/combine';\nimport { draggable, dropTargetForElements } from '../../../src/entry-point/element/adapter';\nimport { appendToBody, firePointer, getElements, reset } from '../_util';\n\nimport { findHoneyPot } from './_util';\n\nafterEach(reset);\n\nconst windowAddEventListener = jest.spyOn(window, 'addEventListener');\nconst documentAddEventListener = jest.spyOn(document, 'addEventListener');\nconst windowRemoveEventListener = jest.spyOn(window, 'removeEventListener');\nconst documentRemoveEventListener = jest.spyOn(document, 'removeEventListener');\n\nfunction clearMocks() {\n\twindowAddEventListener.mockClear();\n\tdocumentAddEventListener.mockClear();\n\twindowRemoveEventListener.mockClear();\n\tdocumentRemoveEventListener.mockClear();\n}\n\nbeforeEach(() => clearMocks());\n\nit('should cleanup event listeners when finished [not dropping on honey pot]', () => {\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdropTargetForElements({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('dropTarget:preview'),\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\n\t// our \"honey pot\" listener\n\texpect(windowAddEventListener).toHaveBeenCalledTimes(1);\n\texpect(windowAddEventListener).toHaveBeenNthCalledWith(\n\t\t1,\n\t\t'pointermove',\n\t\texpect.any(Function),\n\t\texpect.objectContaining({ capture: true }),\n\t);\n\t// our \"element adapter\" listener\n\texpect(documentAddEventListener).toHaveBeenCalledTimes(1);\n\texpect(documentAddEventListener).toHaveBeenNthCalledWith(\n\t\t1,\n\t\t'dragstart',\n\t\texpect.any(Function),\n\t\t// binding in the bubble phase\n\t\tundefined,\n\t);\n\tfor (let i = 0; i < 5; i++) {\n\t\tclearMocks();\n\n\t\tfirePointer.down(element, { clientX: 1 + i, clientY: 1 });\n\t\tfirePointer.move(element, { clientX: 2 + i, clientY: 2 });\n\n\t\t// no more event listeners added yet\n\t\texpect(windowAddEventListener).not.toHaveBeenCalled();\n\t\texpect(documentAddEventListener).not.toHaveBeenCalled();\n\n\t\t// once the drag starts, a whole lot of listeners\n\t\t// will be added, including the honey pot one\n\t\tfireEvent.dragStart(element);\n\n\t\texpect(findHoneyPot()).toBeFalsy();\n\t\texpect(ordered).toEqual(['draggable:preview', 'dropTarget:preview']);\n\t\tordered.length = 0;\n\n\t\t// start the drag\n\t\t// @ts-expect-error\n\t\trequestAnimationFrame.step();\n\n\t\texpect(findHoneyPot()).toBeTruthy();\n\t\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\t\tordered.length = 0;\n\n\t\t// not dropping on the honey pot element so we keep it around\n\t\tfireEvent.drop(element, { clientX: 4 + i, clientY: 4 });\n\n\t\texpect(ordered).toEqual(['draggable:drop', 'dropTarget:drop']);\n\t\tordered.length = 0;\n\n\t\t// honey pot still around after the drop\n\t\texpect(findHoneyPot()).toBeTruthy();\n\n\t\t// clear the honey pot\n\t\tfirePointer.move(element);\n\n\t\texpect(findHoneyPot()).toBeFalsy();\n\n\t\t// all event listeners have been removed\n\t\texpect(windowRemoveEventListener).toHaveBeenCalled();\n\t\texpect(windowRemoveEventListener.mock.calls.length).toBe(\n\t\t\twindowAddEventListener.mock.calls.length,\n\t\t);\n\t\t// no event listeners added / removed on the document\n\t\texpect(documentAddEventListener).not.toHaveBeenCalled();\n\t\texpect(documentRemoveEventListener).not.toHaveBeenCalled();\n\t}\n\n\tcleanup();\n});\n\nit('should cleanup event listeners when finished [dropping on honey pot]', () => {\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdropTargetForElements({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('dropTarget:preview'),\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\n\t// our \"honey pot\" listener\n\texpect(windowAddEventListener).toHaveBeenCalledTimes(1);\n\texpect(windowAddEventListener).toHaveBeenNthCalledWith(1, 'pointermove', expect.any(Function), {\n\t\tcapture: true,\n\t});\n\t// our \"element adapter\" listener\n\texpect(documentAddEventListener).toHaveBeenCalledTimes(1);\n\texpect(documentAddEventListener).toHaveBeenNthCalledWith(\n\t\t1,\n\t\t'dragstart',\n\t\texpect.any(Function),\n\t\t// binding in the bubble phase\n\t\tundefined,\n\t);\n\n\tfor (let i = 0; i < 5; i++) {\n\t\tclearMocks();\n\n\t\tfirePointer.down(element, { clientX: 1 + i, clientY: 1 });\n\t\tfirePointer.move(element, { clientX: 2 + i, clientY: 2 });\n\n\t\t// no more event listeners added yet\n\t\texpect(windowAddEventListener).not.toHaveBeenCalled();\n\t\texpect(documentAddEventListener).not.toHaveBeenCalled();\n\n\t\t// once the drag starts, a whole lot of listeners\n\t\t// will be added, including the honey pot one\n\t\tfireEvent.dragStart(element);\n\n\t\texpect(findHoneyPot()).toBeFalsy();\n\t\texpect(ordered).toEqual(['draggable:preview', 'dropTarget:preview']);\n\t\tordered.length = 0;\n\n\t\t// start the drag\n\t\t// @ts-expect-error\n\t\trequestAnimationFrame.step();\n\n\t\texpect(findHoneyPot()).toBeTruthy();\n\t\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\t\tordered.length = 0;\n\n\t\t// dropping on the honey pot\n\t\tfireEvent.drop(element, { clientX: 2 + i, clientY: 2 });\n\n\t\texpect(ordered).toEqual(['draggable:drop', 'dropTarget:drop']);\n\t\tordered.length = 0;\n\n\t\t// honey pot removed as we dropped on it\n\t\texpect(findHoneyPot()).toBeFalsy();\n\n\t\t// all event listeners have been removed\n\t\texpect(windowRemoveEventListener).toHaveBeenCalled();\n\t\texpect(windowRemoveEventListener.mock.calls.length).toBe(\n\t\t\twindowAddEventListener.mock.calls.length,\n\t\t);\n\t\t// no event listeners added / removed on the document\n\t\texpect(documentAddEventListener).not.toHaveBeenCalled();\n\t\texpect(documentRemoveEventListener).not.toHaveBeenCalled();\n\n\t\t// checking nothing else called after another user action\n\n\t\tclearMocks();\n\n\t\tfirePointer.move(element);\n\n\t\texpect(windowAddEventListener).not.toHaveBeenCalled();\n\t\texpect(windowRemoveEventListener).not.toHaveBeenCalled();\n\t\texpect(documentAddEventListener).not.toHaveBeenCalled();\n\t\texpect(documentRemoveEventListener).not.toHaveBeenCalled();\n\t}\n\n\tcleanup();\n});\n\nit('should remove all event listeners when adapter is unmounted', () => {\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdropTargetForElements({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('dropTarget:preview'),\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\n\texpect(windowAddEventListener).toHaveBeenNthCalledWith(1, 'pointermove', expect.any(Function), {\n\t\tcapture: true,\n\t});\n\texpect(windowRemoveEventListener).toHaveBeenCalledTimes(0);\n\n\tcleanup();\n\n\texpect(windowRemoveEventListener).toHaveBeenCalledTimes(1);\n\texpect(windowRemoveEventListener).toHaveBeenNthCalledWith(\n\t\t1,\n\t\t'pointermove',\n\t\texpect.any(Function),\n\t\t{\n\t\t\tcapture: true,\n\t\t},\n\t);\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/honey-pot-fix/external-adapter-should-not-use-honey-pot.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { monitorForExternal } from '../../../src/entry-point/external/adapter';\nimport { nativeDrag, reset } from '../_util';\n\nimport { findHoneyPot } from './_util';\n\nafterEach(reset);\n\nit('should not apply the honey pot fix for external drags', () => {\n\tconst ordered: string[] = [];\n\tconst cleanup = monitorForExternal({\n\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\tonDropTargetChange: () => ordered.push('monitor:change'),\n\t\tonDrop: () => ordered.push('monitor:drop'),\n\t});\n\n\tnativeDrag.startExternal({ items: [{ type: 'text/plain', data: 'Hello' }] });\n\texpect(ordered).toEqual(['monitor:start']);\n\tordered.length = 0;\n\n\texpect(findHoneyPot()).toBeFalsy();\n\n\tfireEvent.dragEnd(document.body);\n\n\texpect(ordered).toEqual(['monitor:drop']);\n\n\texpect(findHoneyPot()).toBe(null);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/honey-pot-fix/finishing.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../src/entry-point/combine';\nimport { draggable, dropTargetForElements } from '../../../src/entry-point/element/adapter';\nimport { appendToBody, firePointer, getElements, reset, userEvent } from '../_util';\n\nimport { findHoneyPot } from './_util';\n\nafterEach(reset);\n\n// Using this approach so we can ensure that correct event contructers are being used\ntype Item = {\n\teventName: string;\n\tfireEvent: (target: Element | Window) => void;\n};\n\nconst items: Item[] = [\n\t{\n\t\teventName: 'pointerdown',\n\t\tfireEvent: (target) => firePointer.down(target),\n\t},\n\t{\n\t\teventName: 'pointermove',\n\t\tfireEvent: (target) => firePointer.move(target),\n\t},\n\t{\n\t\teventName: 'focusin',\n\t\tfireEvent: (target) => fireEvent.focusIn(target),\n\t},\n\t{\n\t\teventName: 'focusout',\n\t\tfireEvent: (target) => fireEvent.focusOut(target),\n\t},\n\t{\n\t\teventName: 'dragstart',\n\t\tfireEvent: (target) => fireEvent.dragStart(target),\n\t},\n\t{\n\t\teventName: 'dragenter',\n\t\tfireEvent: (target) => fireEvent.dragEnter(target),\n\t},\n\t{\n\t\teventName: 'dragover',\n\t\tfireEvent: (target) => fireEvent.dragOver(target),\n\t},\n];\n\nitems.forEach((item) => {\n\ttest(`honey pot removed after post drop engagement (success) [${item.eventName}]`, () => {\n\t\tconst [element] = getElements('div');\n\t\tconst ordered: string[] = [];\n\t\tconst cleanup = combine(\n\t\t\tappendToBody(element),\n\t\t\tdraggable({\n\t\t\t\telement,\n\t\t\t\tonGenerateDragPreview: () => ordered.push('preview'),\n\t\t\t\tonDragStart: () => ordered.push('start'),\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement,\n\t\t\t}),\n\t\t);\n\n\t\tfirePointer.down(element, { clientX: 10, clientY: 10 });\n\t\tfirePointer.move(element, { clientX: 16, clientY: 16 });\n\t\tfireEvent.dragStart(element, { clientX: 10, clientY: 10 });\n\n\t\texpect(findHoneyPot()).toBeFalsy();\n\t\texpect(ordered).toEqual(['preview']);\n\t\tordered.length = 0;\n\n\t\t// @ts-expect-error\n\t\trequestAnimationFrame.step();\n\n\t\texpect(ordered).toEqual(['start']);\n\t\texpect(findHoneyPot()).toBeTruthy();\n\n\t\t// honey pot still around after the drop\n\t\tfireEvent.drop(element, { clientX: 10, clientY: 10 });\n\t\texpect(findHoneyPot()).toBeTruthy();\n\n\t\t// honey pot cleared after user engages with the page\n\t\titem.fireEvent(element);\n\t\texpect(findHoneyPot()).toBeFalsy();\n\n\t\tcleanup();\n\t});\n});\n\nitems.forEach((item) => {\n\ttest(`honey pot removed after post drop engagement (cancel) [${item.eventName}]`, () => {\n\t\tconst [element] = getElements('div');\n\t\tconst ordered: string[] = [];\n\t\tconst cleanup = combine(\n\t\t\tappendToBody(element),\n\t\t\tdraggable({\n\t\t\t\telement,\n\t\t\t\tonGenerateDragPreview: () => ordered.push('preview'),\n\t\t\t\tonDragStart: () => ordered.push('start'),\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement,\n\t\t\t}),\n\t\t);\n\n\t\tfirePointer.down(element, { clientX: 10, clientY: 10 });\n\t\tfirePointer.move(element, { clientX: 16, clientY: 16 });\n\t\tfireEvent.dragStart(element, { clientX: 10, clientY: 10 });\n\n\t\texpect(findHoneyPot()).toBeFalsy();\n\t\texpect(ordered).toEqual(['preview']);\n\t\tordered.length = 0;\n\n\t\t// @ts-expect-error\n\t\trequestAnimationFrame.step();\n\n\t\texpect(ordered).toEqual(['start']);\n\t\texpect(findHoneyPot()).toBeTruthy();\n\n\t\t// honey pot still around after the cancel\n\t\tuserEvent.cancel(element, { clientX: 10, clientY: 10 });\n\t\texpect(findHoneyPot()).toBeTruthy();\n\n\t\t// honey pot cleared after user engages with the page\n\t\titem.fireEvent(element);\n\t\texpect(findHoneyPot()).toBeFalsy();\n\n\t\tcleanup();\n\t});\n});\n\ntest('honey pot removed after post drop engagement (success) [dropped on honey pot]', () => {\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('dropTarget:change'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('dropTarget:preview'),\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t);\n\n\tfirePointer.down(element, { clientX: 10, clientY: 10 });\n\tfirePointer.move(element, { clientX: 16, clientY: 16 });\n\tfireEvent.dragStart(element, { clientX: 10, clientY: 10 });\n\n\texpect(findHoneyPot()).toBeFalsy();\n\texpect(ordered).toEqual(['draggable:preview', 'dropTarget:preview']);\n\tordered.length = 0;\n\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\texpect(findHoneyPot()).toBeTruthy();\n\n\t// some random location\n\tfireEvent.dragOver(element, { clientX: 20, clientY: 20 });\n\texpect(findHoneyPot()).toBeTruthy();\n\n\t// Finishing over the top of the honey pot.\n\t// This will remove the honey pot as we are on the top of it\n\tfireEvent.drop(element, { clientX: 16, clientY: 16 });\n\n\texpect(ordered).toEqual(['draggable:drop', 'dropTarget:drop']);\n\n\t// no honey pot as we are over the top of it!\n\texpect(findHoneyPot()).toBeFalsy();\n\n\t// checking we don't error on next event\n\tfirePointer.down(element);\n\texpect(findHoneyPot()).toBeFalsy();\n\n\tcleanup();\n});\n\ntest('honey pot removed after post drop engagement (cancel) [dropped on honey pot]', () => {\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('dropTarget:preview'),\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t);\n\n\tfirePointer.down(element, { clientX: 10, clientY: 10 });\n\tfirePointer.move(element, { clientX: 16, clientY: 16 });\n\tfireEvent.dragStart(element, { clientX: 10, clientY: 10 });\n\n\texpect(findHoneyPot()).toBeFalsy();\n\texpect(ordered).toEqual(['draggable:preview', 'dropTarget:preview']);\n\tordered.length = 0;\n\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\texpect(findHoneyPot()).toBeTruthy();\n\n\t// cancelling over the honey pot\n\tuserEvent.cancel(element, { clientX: 16, clientY: 16 });\n\n\texpect(ordered).toEqual(['draggable:change', 'dropTarget:leave', 'draggable:drop']);\n\tordered.length = 0;\n\n\t// no honey pot as we are over the top of it!\n\texpect(findHoneyPot()).toBeFalsy();\n\n\t// checking we don't error on next event\n\tfirePointer.down(element);\n\texpect(findHoneyPot()).toBeFalsy();\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/honey-pot-fix/get-element-from-point-without-honey-pot.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../src/entry-point/combine';\nimport { draggable, dropTargetForElements } from '../../../src/entry-point/element/adapter';\nimport { getElementFromPointWithoutHoneypot } from '../../../src/entry-point/private/get-element-from-point-without-honey-pot';\nimport {\n\tappendToBody,\n\tfirePointer,\n\tgetBubbleOrderedPath,\n\tgetElements,\n\treset,\n\tsetElementFromPointWithPath,\n} from '../_util';\n\nimport { findHoneyPot, getHoneyPot } from './_util';\n\nafterEach(reset);\n\nit('should return the second top most item if the top item is the honey pot', () => {\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdropTargetForElements({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('dropTarget:preview'),\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\n\tfirePointer.down(element, { clientX: 1, clientY: 1 });\n\tfirePointer.move(element, { clientX: 2, clientY: 2 });\n\tfireEvent.dragStart(element);\n\t// being accurate\n\tfirePointer.cancel(element, { clientX: 0, clientY: 0 });\n\n\texpect(findHoneyPot()).toBeFalsy();\n\texpect(ordered).toEqual(['draggable:preview', 'dropTarget:preview']);\n\tordered.length = 0;\n\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\n\tconst honeyPot = getHoneyPot();\n\n\tconst path = getBubbleOrderedPath([honeyPot, element]);\n\tsetElementFromPointWithPath(getBubbleOrderedPath([honeyPot, element]));\n\n\t// actual test\n\texpect(getElementFromPointWithoutHoneypot({ x: 2, y: 2 })).toBe(element);\n\t// Enabling direct usage of `elementsFromPoint`\n\t// eslint-disable-next-line no-restricted-syntax\n\texpect(document.elementsFromPoint(2, 2)).toEqual(path);\n\t// Enabling direct usage of `elementFromPoint`\n\t// eslint-disable-next-line no-restricted-syntax\n\texpect(document.elementFromPoint(2, 2)).toBe(honeyPot);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/honey-pot-fix/mid-drag.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../src/entry-point/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\tmonitorForElements,\n} from '../../../src/entry-point/element/adapter';\nimport {\n\tappendToBody,\n\tfirePointer,\n\tgetBubbleOrderedPath,\n\tgetDefaultInput,\n\tgetElements,\n\tsetElementFromPointWithPath,\n\tuserEvent,\n} from '../_util';\n\nimport { findHoneyPot, getHoneyPot } from './_util';\n\nit('should keep the honey pot even if the adapter is unmounted during the drag', () => {\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\t// const cleanupElement = ;\n\tconst cleanupDraggable = combine(\n\t\tappendToBody(element),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\tconst cleanupMonitor = monitorForElements({\n\t\tonGenerateDragPreview: () => ordered.push('monitor:preview'),\n\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\tonDrop: () => ordered.push('monitor:drop'),\n\t});\n\n\tfirePointer.down(element, { clientX: 10, clientY: 10 });\n\tfirePointer.move(element, { clientX: 12, clientY: 12 });\n\tfireEvent.dragStart(element, { clientX: 10, clientY: 10 });\n\n\tuserEvent.lift(element);\n\texpect(getHoneyPot()).toBeTruthy();\n\texpect(ordered).toEqual([\n\t\t'draggable:preview',\n\t\t'monitor:preview',\n\t\t'draggable:start',\n\t\t'monitor:start',\n\t]);\n\tordered.length = 0;\n\n\tcleanupDraggable();\n\n\t// drag still occurring even though only draggable has been removed\n\t// the adapter will have been removed\n\texpect(findHoneyPot()).toBeTruthy();\n\n\tfireEvent.dragEnd(window, { client: 12, clientY: 12 });\n\texpect(ordered).toEqual(['monitor:drop']);\n\n\t// honey pot still around until another user action\n\texpect(findHoneyPot()).toBeTruthy();\n\n\tfirePointer.move(window, { clientX: 13, clientY: 13 });\n\texpect(findHoneyPot()).toBeFalsy();\n\n\tcleanupMonitor();\n});\n\nit('should shift to an updated \"pointermove\" location during a drag (firefox bug)', () => {\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdropTargetForElements({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('dropTarget:preview'),\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\n\tfirePointer.down(element, { clientX: 10, clientY: 10 });\n\tfirePointer.move(element, { clientX: 12, clientY: 12 });\n\tfirePointer.move(element, { clientX: 14, clientY: 14 });\n\tfirePointer.move(element, { clientX: 16, clientY: 16 });\n\tfireEvent.dragStart(element, { clientX: 10, clientY: 10 });\n\n\texpect(findHoneyPot()).toBeFalsy();\n\texpect(ordered).toEqual(['draggable:preview', 'dropTarget:preview']);\n\tordered.length = 0;\n\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\tconst honeyPot = getHoneyPot();\n\n\t// pulled back 1px on the x and y from 16,16\n\texpect(honeyPot.style.left).toEqual('15px');\n\texpect(honeyPot.style.top).toEqual('15px');\n\texpect(honeyPot.style.width).toEqual('2px');\n\texpect(honeyPot.style.height).toEqual('2px');\n\n\tfirePointer.move(element, { clientX: 20, clientY: 22 });\n\n\t// pulled back 1px on the x and y from 20,22\n\texpect(honeyPot.style.left).toEqual('19px');\n\texpect(honeyPot.style.top).toEqual('21px');\n\texpect(honeyPot.style.width).toEqual('2px');\n\texpect(honeyPot.style.height).toEqual('2px');\n\n\tfireEvent.drop(element);\n\n\tcleanup();\n});\n\nit('should ignore the honey pot when dragging over it (case: [A])', () => {\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanups = [\n\t\tcombine(\n\t\t\tappendToBody(element),\n\t\t\tdropTargetForElements({\n\t\t\t\telement,\n\t\t\t\tonGenerateDragPreview: () => ordered.push('dropTarget:preview'),\n\t\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t\t}),\n\t\t\tdraggable({\n\t\t\t\telement,\n\t\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t\t}),\n\t\t),\n\t];\n\n\tfirePointer.down(element, { clientX: 10, clientY: 10 });\n\tfirePointer.move(element, { clientX: 12, clientY: 12 });\n\tfirePointer.move(element, { clientX: 14, clientY: 14 });\n\tfirePointer.move(element, { clientX: 16, clientY: 16 });\n\tfireEvent.dragStart(element, { clientX: 10, clientY: 10 });\n\n\texpect(findHoneyPot()).toBeFalsy();\n\n\tuserEvent.lift(element, getDefaultInput({ clientX: 10, clientY: 10 }));\n\n\texpect(ordered).toEqual([\n\t\t'draggable:preview',\n\t\t'dropTarget:preview',\n\t\t'draggable:start',\n\t\t'dropTarget:start',\n\t]);\n\tordered.length = 0;\n\n\tconst honeyPot = getHoneyPot();\n\n\tcleanups.push(setElementFromPointWithPath(getBubbleOrderedPath([honeyPot, element])));\n\n\t// over the honey pot\n\tfireEvent.dragEnter(honeyPot, { clientX: 16, clientY: 16 });\n\n\t// no change event fired\n\texpect(ordered).toEqual([]);\n\n\tfireEvent.drop(element);\n\n\tcombine(...cleanups)();\n});\n\nit('should ignore the honey pot when dragging over it (case: [A] → [B])', () => {\n\tconst [A, B, draggableEl] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanups = [\n\t\tcombine(\n\t\t\tappendToBody(A, B, draggableEl),\n\t\t\tdraggable({\n\t\t\t\telement: draggableEl,\n\t\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement: A,\n\t\t\t\tonGenerateDragPreview: () => ordered.push('A:preview'),\n\t\t\t\tonDragStart: () => ordered.push('A:start'),\n\t\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\t\tonDragLeave: () => ordered.push('A:leave'),\n\t\t\t\tonDrop: () => ordered.push('A:drop'),\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement: B,\n\t\t\t\tonGenerateDragPreview: () => ordered.push('B:preview'),\n\t\t\t\tonDragStart: () => ordered.push('B:start'),\n\t\t\t\tonDragEnter: () => ordered.push('B:enter'),\n\t\t\t\tonDragLeave: () => ordered.push('B:leave'),\n\t\t\t\tonDrop: () => ordered.push('B:drop'),\n\t\t\t}),\n\t\t),\n\t];\n\n\tfirePointer.down(draggableEl, { clientX: 10, clientY: 10 });\n\tfirePointer.move(draggableEl, { clientX: 16, clientY: 16 });\n\tfireEvent.dragStart(draggableEl, { clientX: 10, clientY: 10 });\n\n\texpect(findHoneyPot()).toBeFalsy();\n\n\tuserEvent.lift(draggableEl, getDefaultInput({ clientX: 10, clientY: 10 }));\n\n\texpect(ordered).toEqual(['draggable:preview', 'draggable:start']);\n\tordered.length = 0;\n\n\tconst honeyPot = getHoneyPot();\n\n\t// [] → [A]\n\tfireEvent.dragEnter(A);\n\texpect(ordered).toEqual(['draggable:change', 'A:enter']);\n\tordered.length = 0;\n\n\t// [A] → [B]\n\t// Going over the honey pot - but under the honey pot element will now be \"B\"\n\tcleanups.push(setElementFromPointWithPath(getBubbleOrderedPath([honeyPot, B])));\n\tfireEvent.dragEnter(honeyPot, { clientX: 16, clientY: 16 });\n\n\texpect(ordered).toEqual(['draggable:change', 'A:leave', 'B:enter']);\n\tordered.length = 0;\n\n\tfireEvent.drop(B);\n\texpect(ordered).toEqual(['draggable:drop', 'B:drop']);\n\n\tcombine(...cleanups)();\n});\n\nit('should keep the existing drop targets when dragging over the honey pot (case: [])', () => {\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanups = [\n\t\tcombine(\n\t\t\tappendToBody(element),\n\t\t\tdraggable({\n\t\t\t\telement,\n\t\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t\t}),\n\t\t),\n\t];\n\n\tfirePointer.down(element, { clientX: 10, clientY: 10 });\n\tfirePointer.move(element, { clientX: 12, clientY: 12 });\n\tfirePointer.move(element, { clientX: 14, clientY: 14 });\n\tfirePointer.move(element, { clientX: 16, clientY: 16 });\n\tfireEvent.dragStart(element, { clientX: 10, clientY: 10 });\n\n\texpect(findHoneyPot()).toBeFalsy();\n\n\tuserEvent.lift(element, getDefaultInput({ clientX: 10, clientY: 10 }));\n\n\texpect(ordered).toEqual(['draggable:preview', 'draggable:start']);\n\tordered.length = 0;\n\n\tconst honeyPot = getHoneyPot();\n\n\tcleanups.push(setElementFromPointWithPath(getBubbleOrderedPath([honeyPot])));\n\n\t// over the honey pot\n\tfireEvent.dragEnter(honeyPot, { clientX: 16, clientY: 16 });\n\n\t// no change event fired\n\texpect(ordered).toEqual([]);\n\n\tfireEvent.drop(element);\n\n\tcombine(...cleanups)();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/honey-pot-fix/multiple-operations.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../src/entry-point/combine';\nimport { draggable, dropTargetForElements } from '../../../src/entry-point/element/adapter';\nimport { appendToBody, firePointer, getElements, reset } from '../_util';\n\nimport { findHoneyPot } from './_util';\n\nafterEach(reset);\n\nit('should work between multiple drag operations (success)', () => {\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdropTargetForElements({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('dropTarget:preview'),\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\n\tfor (let i = 0; i < 5; i++) {\n\t\tfirePointer.down(element, { clientX: 1 + i, clientY: 1 });\n\t\tfirePointer.move(element, { clientX: 2 + i, clientY: 2 });\n\t\tfireEvent.dragStart(element);\n\t\t// being accurate\n\t\tfirePointer.cancel(element, { clientX: 0, clientY: 0 });\n\n\t\texpect(findHoneyPot()).toBeFalsy();\n\t\texpect(ordered).toEqual(['draggable:preview', 'dropTarget:preview']);\n\t\tordered.length = 0;\n\n\t\t// @ts-expect-error\n\t\trequestAnimationFrame.step();\n\n\t\texpect(findHoneyPot()).toBeTruthy();\n\t\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\t\tordered.length = 0;\n\n\t\tfireEvent.drop(element);\n\n\t\texpect(ordered).toEqual(['draggable:drop', 'dropTarget:drop']);\n\t\texpect(findHoneyPot()).toBeTruthy();\n\t\tordered.length = 0;\n\t}\n\n\tcleanup();\n});\n\nit('should work between multiple drag operations (cancel)', () => {\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdropTargetForElements({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('dropTarget:preview'),\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\n\tfor (let i = 0; i < 5; i++) {\n\t\tfirePointer.down(element, { clientX: 1 + i, clientY: 1 });\n\t\tfirePointer.move(element, { clientX: 2 + i, clientY: 2 });\n\t\tfireEvent.dragStart(element);\n\t\t// being accurate\n\t\tfirePointer.cancel(element, { clientX: 0, clientY: 0 });\n\n\t\texpect(findHoneyPot()).toBeFalsy();\n\t\texpect(ordered).toEqual(['draggable:preview', 'dropTarget:preview']);\n\t\tordered.length = 0;\n\n\t\t// @ts-expect-error\n\t\trequestAnimationFrame.step();\n\n\t\texpect(findHoneyPot()).toBeTruthy();\n\t\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\t\tordered.length = 0;\n\n\t\tfireEvent.dragEnd(window);\n\n\t\texpect(ordered).toEqual(['draggable:change', 'dropTarget:leave', 'draggable:drop']);\n\t\texpect(findHoneyPot()).toBeTruthy();\n\t\tordered.length = 0;\n\t}\n\n\tcleanup();\n});\n\nit('should work between multiple drag operations (broken drag)', () => {\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdropTargetForElements({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('dropTarget:preview'),\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\n\tfor (let i = 0; i < 5; i++) {\n\t\tfirePointer.down(element, { clientX: 1 + i, clientY: 1 });\n\t\tfirePointer.move(element, { clientX: 4 + i, clientY: 2 });\n\t\tfireEvent.dragStart(element, { clientX: 1 + i, clientY: 1 });\n\t\t// being accurate\n\t\tfirePointer.cancel(element, { clientX: 0, clientY: 0 });\n\n\t\texpect(findHoneyPot()).toBeFalsy();\n\t\texpect(ordered).toEqual(['draggable:preview', 'dropTarget:preview']);\n\t\tordered.length = 0;\n\n\t\t// @ts-expect-error\n\t\trequestAnimationFrame.step();\n\n\t\texpect(findHoneyPot()).toBeTruthy();\n\t\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\t\tordered.length = 0;\n\n\t\t// drag is broken\n\t\tfireEvent.pointerDown(window);\n\n\t\texpect(ordered).toEqual(['draggable:change', 'dropTarget:leave', 'draggable:drop']);\n\t\texpect(findHoneyPot()).toBeTruthy();\n\t\tordered.length = 0;\n\t}\n\n\tcleanup();\n});\n\nit('should work between multiple drag operations (success + no pointer events)', () => {\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdropTargetForElements({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('dropTarget:preview'),\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\n\tfor (let i = 0; i < 5; i++) {\n\t\t// TODO: does this not work with clientX and clientY: 0\n\t\tfireEvent.dragStart(element, { clientX: 2 + i, clientY: 2 });\n\n\t\texpect(findHoneyPot()).toBeFalsy();\n\t\texpect(ordered).toEqual(['draggable:preview', 'dropTarget:preview']);\n\t\tordered.length = 0;\n\n\t\t// @ts-expect-error\n\t\trequestAnimationFrame.step();\n\n\t\texpect(findHoneyPot()).toBeTruthy();\n\t\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\t\tordered.length = 0;\n\n\t\tfireEvent.drop(element);\n\n\t\texpect(ordered).toEqual(['draggable:drop', 'dropTarget:drop']);\n\t\texpect(findHoneyPot()).toBeTruthy();\n\t\tordered.length = 0;\n\t}\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/honey-pot-fix/starting.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../src/entry-point/combine';\nimport { draggable, dropTargetForElements } from '../../../src/entry-point/element/adapter';\nimport { appendToBody, firePointer, getElements, reset } from '../_util';\n\nimport { findHoneyPot, getHoneyPot } from './_util';\n\nafterEach(reset);\n\n// The initiating \"dragstart\" event listener is added to the `document` for the element event listener\nconst documentAddEventListener = jest.spyOn(document, 'addEventListener');\nconst documentRemoveEventListener = jest.spyOn(document, 'removeEventListener');\n\n// Event listeners for the drag are added to the window\nconst windowAddEventListener = jest.spyOn(window, 'addEventListener');\nconst windowRemoveEventListener = jest.spyOn(window, 'removeEventListener');\n\njest.resetModules();\n\nafterEach(() => {\n\twindowAddEventListener.mockClear();\n\twindowRemoveEventListener.mockClear();\n\tdocumentAddEventListener.mockClear();\n\tdocumentRemoveEventListener.mockClear();\n\tjest.resetModules();\n});\n\nit('should mount at the last \"pointermove\" location', () => {\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdropTargetForElements({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('dropTarget:preview'),\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\n\tfirePointer.down(element, { clientX: 10, clientY: 10 });\n\tfirePointer.move(element, { clientX: 12, clientY: 12 });\n\tfirePointer.move(element, { clientX: 14, clientY: 14 });\n\tfirePointer.move(element, { clientX: 16, clientY: 16 });\n\tfireEvent.dragStart(element, { clientX: 10, clientY: 10 });\n\n\texpect(findHoneyPot()).toBeFalsy();\n\texpect(ordered).toEqual(['draggable:preview', 'dropTarget:preview']);\n\tordered.length = 0;\n\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\tconst honeyPot = getHoneyPot();\n\n\t// pulled back 1px on the x and y from 16,16\n\texpect(honeyPot.style.left).toEqual('15px');\n\texpect(honeyPot.style.top).toEqual('15px');\n\texpect(honeyPot.style.width).toEqual('2px');\n\texpect(honeyPot.style.height).toEqual('2px');\n\n\tfireEvent.drop(element);\n\n\tcleanup();\n});\n\nit('should mount at the starting position if has been no latest \"pointermove\" (can occur on mobile)', () => {\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdropTargetForElements({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('dropTarget:preview'),\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\n\tfirePointer.down(element, { clientX: 10, clientY: 10 });\n\tfirePointer.move(element, { clientX: 12, clientY: 12 });\n\tfireEvent.dragStart(element, { clientX: 10, clientY: 10 });\n\n\texpect(findHoneyPot()).toBeFalsy();\n\texpect(ordered).toEqual(['draggable:preview', 'dropTarget:preview']);\n\tordered.length = 0;\n\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t{\n\t\tconst honeyPot = getHoneyPot();\n\t\t// pulled back 1px on the x and y from 12,12\n\t\texpect(honeyPot.style.left).toEqual('11px');\n\t\texpect(honeyPot.style.top).toEqual('11px');\n\t\texpect(honeyPot.style.width).toEqual('2px');\n\t\texpect(honeyPot.style.height).toEqual('2px');\n\t}\n\n\tfireEvent.drop(element);\n\n\texpect(ordered).toEqual(['draggable:drop', 'dropTarget:drop']);\n\tordered.length = 0;\n\n\t// clearing honey pot fix\n\tfirePointer.down(element);\n\n\t// doing another drag without a \"pointermove\"\n\tfireEvent.dragStart(element, { clientX: 5, clientY: 5 });\n\n\texpect(findHoneyPot()).toBeFalsy();\n\texpect(ordered).toEqual(['draggable:preview', 'dropTarget:preview']);\n\tordered.length = 0;\n\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\t{\n\t\tconst honeyPot = getHoneyPot();\n\n\t\t// pulled back 1px on the x and y from 4,4\n\t\texpect(honeyPot.style.left).toEqual('4px');\n\t\texpect(honeyPot.style.top).toEqual('4px');\n\t\texpect(honeyPot.style.width).toEqual('2px');\n\t\texpect(honeyPot.style.height).toEqual('2px');\n\t}\n\n\tcleanup();\n});\n\nit('should clear the latest pointer move between interactions', () => {\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdropTargetForElements({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('dropTarget:preview'),\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\n\tfireEvent.dragStart(element, { clientX: 2, clientY: 3 });\n\n\texpect(findHoneyPot()).toBeFalsy();\n\texpect(ordered).toEqual(['draggable:preview', 'dropTarget:preview']);\n\tordered.length = 0;\n\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\tconst honeyPot = getHoneyPot();\n\n\t// pulled back 1px on the x and y from 2,3\n\texpect(honeyPot.style.left).toEqual('1px');\n\texpect(honeyPot.style.top).toEqual('2px');\n\texpect(honeyPot.style.width).toEqual('2px');\n\texpect(honeyPot.style.height).toEqual('2px');\n\n\tfireEvent.drop(element);\n\n\tcleanup();\n});\n\nit('should not go beyond the size of the window (backwards)', () => {\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdropTargetForElements({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('dropTarget:preview'),\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\n\tfirePointer.down(element, { clientX: 2, clientY: 2 });\n\tfirePointer.move(element, { clientX: 0, clientY: 0 });\n\tfireEvent.dragStart(element, { clientX: 0, clientY: 0 });\n\n\texpect(findHoneyPot()).toBeFalsy();\n\texpect(ordered).toEqual(['draggable:preview', 'dropTarget:preview']);\n\tordered.length = 0;\n\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\tconst honeyPot = getHoneyPot();\n\n\texpect(honeyPot.style.left).toEqual('0px');\n\texpect(honeyPot.style.top).toEqual('0px');\n\texpect(honeyPot.style.width).toEqual('2px');\n\texpect(honeyPot.style.height).toEqual('2px');\n\n\tfireEvent.drop(element);\n\n\tcleanup();\n});\n\nit('should not go beyond the size of the window (forwards)', () => {\n\t// validating setup\n\texpect(window.innerWidth).toBeGreaterThan(10);\n\texpect(window.innerHeight).toBeGreaterThan(10);\n\n\tconst [element] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdropTargetForElements({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('dropTarget:preview'),\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t}),\n\t);\n\n\tfirePointer.down(element, { clientX: window.innerWidth, clientY: window.innerHeight });\n\tfirePointer.move(element, { clientX: window.innerWidth, clientY: window.innerHeight });\n\tfireEvent.dragStart(element, { clientX: window.innerWidth, clientY: window.innerHeight });\n\n\texpect(findHoneyPot()).toBeFalsy();\n\texpect(ordered).toEqual(['draggable:preview', 'dropTarget:preview']);\n\tordered.length = 0;\n\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\tconst honeyPot = getHoneyPot();\n\n\t// pulling back so that honey pot is in the window\n\texpect(honeyPot.style.left).toEqual(`${window.innerWidth - 2}px`);\n\texpect(honeyPot.style.top).toEqual(`${window.innerHeight - 2}px`);\n\texpect(honeyPot.style.width).toEqual('2px');\n\texpect(honeyPot.style.height).toEqual('2px');\n\n\tfireEvent.drop(element);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/honey-pot-fix/text-adapter-smoke-test.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../src/entry-point/combine';\nimport { dropTargetForTextSelection } from '../../../src/entry-point/text-selection/adapter';\nimport { type Position } from '../../../src/entry-point/types';\nimport { appendToBody, firePointer, getBubbleOrderedTree, nativeDrag, reset } from '../_util';\n\nimport { findHoneyPot, getHoneyPot } from './_util';\n\n// The text adapter behaviour should be exactly the same as the element\n// adapter in all the other text files.This test just checks that the\n// text adapter is wired up correctly, but doesn't test the full range\n// of honey pot behaviors\n\nafterEach(reset);\n\nit('should work between multiple drag operations (success)', () => {\n\tconst [child, parent] = getBubbleOrderedTree('div');\n\tchild.textContent = 'Hello world';\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(parent),\n\t\tdropTargetForTextSelection({\n\t\t\telement: parent,\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t);\n\n\tfor (let i = 0; i < 5; i++) {\n\t\tconst move: Position = {\n\t\t\tx: i + 3,\n\t\t\ty: i + 4,\n\t\t};\n\t\tfirePointer.down(child, { clientX: i + 1, clientY: i + 2 });\n\t\tfirePointer.move(child, { clientX: move.x, clientY: move.y });\n\n\t\tnativeDrag.startTextSelectionDrag({ element: child });\n\n\t\texpect(findHoneyPot()).toBeTruthy();\n\t\texpect(ordered).toEqual(['dropTarget:start']);\n\t\tordered.length = 0;\n\n\t\tfireEvent.drop(parent);\n\n\t\texpect(ordered).toEqual(['dropTarget:drop']);\n\t\tconst honeyPot = getHoneyPot();\n\t\t// pulled back 1px\n\t\texpect(honeyPot.style.left).toBe(`${move.x - 1}px`);\n\t\texpect(honeyPot.style.top).toBe(`${move.y - 1}px`);\n\t\tordered.length = 0;\n\t}\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/public-utils/combine.spec.ts",
    "content": "import { combine } from '../../../src/entry-point/combine';\n\nit('should call all combined functions', () => {\n\tconst ordered: string[] = [];\n\tconst first = () => ordered.push('first');\n\tconst second = () => ordered.push('second');\n\tconst third = () => ordered.push('third');\n\n\tconst combined = combine(first, second, third);\n\n\tcombined();\n\n\texpect(ordered).toEqual(['first', 'second', 'third']);\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/public-utils/once.spec.ts",
    "content": "import { once } from '../../../src/entry-point/once';\n\nit('should only call an underlying function once', () => {\n\tconst add = jest.fn(function add(a: number, b: number): number {\n\t\treturn a + b;\n\t});\n\n\t// create onced fn\n\tconst addOnce = once(add);\n\n\t// add not called yet\n\texpect(add).toHaveBeenCalledTimes(0);\n\n\t// add now called\n\texpect(addOnce(1, 2)).toEqual(3);\n\texpect(add).toHaveBeenCalledTimes(1);\n\tadd.mockClear();\n\n\t// old result returned\n\texpect(addOnce(2, 3)).toEqual(3);\n\texpect(addOnce.call({}, 2, 4)).toEqual(3);\n\texpect(add).not.toHaveBeenCalled();\n});\n\nit('should only call an underlying function once (target function returns undefined)', () => {\n\tconst noop = jest.fn(function noop(): void {\n\t\treturn undefined;\n\t});\n\n\t// create onced fn\n\tconst noopOnce = once(noop);\n\n\t// add not called yet\n\texpect(noop).toHaveBeenCalledTimes(0);\n\n\t// add now called\n\texpect(noopOnce()).toEqual(undefined);\n\texpect(noop).toHaveBeenCalledTimes(1);\n\tnoop.mockClear();\n\n\t// old result returned\n\texpect(noopOnce()).toEqual(undefined);\n\texpect(noopOnce.call({})).toEqual(undefined);\n\texpect(noop).not.toHaveBeenCalled();\n});\n\nit('should only call an underlying function once (target function uses `this`)', () => {\n\ttype Person = {\n\t\tage: number;\n\t};\n\tfunction getAge(this: Person): number {\n\t\treturn this.age;\n\t}\n\n\tconst getAgeOnce = once(getAge);\n\n\tconst person1: Person = {\n\t\tage: 10,\n\t};\n\texpect(getAgeOnce.call(person1)).toEqual(10);\n\n\tconst person2: Person = {\n\t\tage: 20,\n\t};\n\t// using old age\n\texpect(getAgeOnce.call(person2)).toEqual(10);\n});\n\nconst expectType = <Type>(a: Type): void => {\n\texpect(true).toBe(true);\n};\n\nit('should keep the original function type', () => {\n\tfunction add(a: number, b: number): number {\n\t\treturn a + b;\n\t}\n\n\tconst addOnce = once(add);\n\n\texpectType<typeof add>(addOnce);\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/public-utils/prevent-unhandled.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../src/entry-point/combine';\nimport { draggable, dropTargetForElements } from '../../../src/entry-point/element/adapter';\nimport { preventUnhandled } from '../../../src/entry-point/prevent-unhandled';\nimport { appendToBody, getElements, reset, userEvent } from '../_util';\n\nafterEach(reset);\n\nconst options = { cancelable: true, bubbles: true };\n\n// like our userEvent.cancel function, except returns the dragEnd event\nfunction cancel(target: Element): DragEvent {\n\ttarget.dispatchEvent(new DragEvent('dragleave', options));\n\tconst dragEnd = new DragEvent('dragend', options);\n\ttarget.dispatchEvent(dragEnd);\n\treturn dragEnd;\n}\n\nfunction drop(target: Element): DragEvent {\n\tconst event = new DragEvent('drop', options);\n\ttarget.dispatchEvent(event);\n\treturn event;\n}\n\nit('should work with explicit cancels', () => {\n\tconst [draggableEl] = getElements('div');\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(draggableEl),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart() {\n\t\t\t\tordered.push('start');\n\t\t\t\tpreventUnhandled.start();\n\t\t\t},\n\t\t\tonDrop() {\n\t\t\t\tordered.push('drop');\n\t\t\t},\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\n\texpect(ordered).toEqual(['start']);\n\tordered.length = 0;\n\n\tconst dragEnd = cancel(draggableEl);\n\n\texpect(ordered).toEqual(['drop']);\n\t// not interfering with the standard cancel drop effect\n\texpect(dragEnd.dataTransfer?.dropEffect).toEqual('none');\n\n\tcleanup();\n});\n\nit('should accept drops, even when over no drop targets', () => {\n\tconst [draggableEl, sibling] = getElements('div');\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(draggableEl, sibling),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart() {\n\t\t\t\tordered.push('start');\n\t\t\t\tpreventUnhandled.start();\n\t\t\t},\n\t\t\tonDrop() {\n\t\t\t\tordered.push('drop');\n\t\t\t},\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\n\texpect(ordered).toEqual(['start']);\n\tordered.length = 0;\n\n\t// cancelling \"dragenter\" and \"dragover\" result in a drop being accepted.\n\t{\n\t\tconst event = new DragEvent('dragenter', {\n\t\t\tcancelable: true,\n\t\t\tbubbles: true,\n\t\t});\n\t\tsibling.dispatchEvent(event);\n\t\texpect(event.defaultPrevented).toBe(true);\n\t\texpect(event.dataTransfer?.dropEffect).toBe('move');\n\t}\n\t{\n\t\tconst event = new DragEvent('dragover', {\n\t\t\tcancelable: true,\n\t\t\tbubbles: true,\n\t\t});\n\t\tsibling.dispatchEvent(event);\n\t\texpect(event.defaultPrevented).toBe(true);\n\t\texpect(event.dataTransfer?.dropEffect).toBe('move');\n\t}\n\n\tconst event = drop(draggableEl);\n\n\texpect(ordered).toEqual(['drop']);\n\texpect(event.dataTransfer?.dropEffect).toEqual('none');\n\t// opting out of the browsers default \"drop\" behaviour\n\texpect(event.defaultPrevented).toBe(true);\n\n\tcleanup();\n});\n\nit('should opt out of \"drop\" even if .stop() is called in `onDrop()`', () => {\n\tconst [draggableEl, sibling] = getElements('div');\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(draggableEl, sibling),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart() {\n\t\t\t\tordered.push('start');\n\t\t\t\tpreventUnhandled.start();\n\t\t\t},\n\t\t\tonDrop() {\n\t\t\t\tordered.push('drop');\n\t\t\t\tpreventUnhandled.stop();\n\t\t\t\tordered.push('stop');\n\t\t\t},\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\n\texpect(ordered).toEqual(['start']);\n\tordered.length = 0;\n\n\tconst event = new DragEvent('drop', { cancelable: true, bubbles: true });\n\twindow.event = event;\n\tdraggableEl.dispatchEvent(event);\n\twindow.event = undefined;\n\n\texpect(event.defaultPrevented).toBe(true);\n\texpect(ordered).toEqual(['drop', 'stop']);\n\n\tcleanup();\n});\n\nit('should not override the drop effect of a drop target', () => {\n\tconst [A] = getElements('div');\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonDragStart() {\n\t\t\t\tordered.push('draggable:start');\n\t\t\t\tpreventUnhandled.start();\n\t\t\t},\n\t\t\tonDrop() {\n\t\t\t\tordered.push('draggable:drop');\n\t\t\t},\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tgetDropEffect: () => 'link',\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t);\n\n\tuserEvent.lift(A);\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start']);\n\tordered.length = 0;\n\n\tconst event = drop(A);\n\texpect(ordered).toEqual(['draggable:drop', 'dropTarget:drop']);\n\n\t// not being set to \"none\" or \"move\"\n\texpect(event.dataTransfer?.dropEffect).toEqual('link');\n\n\tcleanup();\n});\n\nit('should only apply to a single drag operation', () => {\n\tconst [draggableEl, sibling] = getElements('div');\n\tconst ordered: string[] = [];\n\tlet isEnabled: boolean = true;\n\n\tconst cleanup = combine(\n\t\tappendToBody(draggableEl, sibling),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart() {\n\t\t\t\tordered.push('start');\n\t\t\t\tif (isEnabled) {\n\t\t\t\t\tpreventUnhandled.start();\n\t\t\t\t}\n\t\t\t},\n\t\t\tonDrop() {\n\t\t\t\tordered.push('drop');\n\t\t\t},\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\n\texpect(ordered).toEqual(['start']);\n\tordered.length = 0;\n\n\t// cancelling \"dragenter\" and \"dragover\" result in a drop being accepted.\n\t{\n\t\tconst event = new DragEvent('dragenter', {\n\t\t\tcancelable: true,\n\t\t\tbubbles: true,\n\t\t});\n\t\tsibling.dispatchEvent(event);\n\t\texpect(event.defaultPrevented).toBe(true);\n\t\texpect(event.dataTransfer?.dropEffect).toBe('move');\n\t}\n\t{\n\t\tconst event = new DragEvent('dragover', {\n\t\t\tcancelable: true,\n\t\t\tbubbles: true,\n\t\t});\n\t\tsibling.dispatchEvent(event);\n\t\texpect(event.defaultPrevented).toBe(true);\n\t\texpect(event.dataTransfer?.dropEffect).toBe('move');\n\t}\n\n\t{\n\t\tconst event = drop(draggableEl);\n\t\texpect(ordered).toEqual(['drop']);\n\t\texpect(event.dataTransfer?.dropEffect).toEqual('none');\n\n\t\tordered.length = 0;\n\t}\n\n\t// doing another drag\n\tisEnabled = false;\n\n\tuserEvent.lift(draggableEl);\n\n\texpect(ordered).toEqual(['start']);\n\tordered.length = 0;\n\n\t// \"dragenter\" and \"dragover\" no longer cancelled\n\t{\n\t\tconst event = new DragEvent('dragenter', {\n\t\t\tcancelable: true,\n\t\t\tbubbles: true,\n\t\t});\n\t\tsibling.dispatchEvent(event);\n\t\texpect(event.defaultPrevented).toBe(false);\n\t\texpect(event.dataTransfer?.dropEffect).toBe('none');\n\t}\n\t{\n\t\tconst event = new DragEvent('dragover', {\n\t\t\tcancelable: true,\n\t\t\tbubbles: true,\n\t\t});\n\t\tsibling.dispatchEvent(event);\n\t\texpect(event.defaultPrevented).toBe(false);\n\t\texpect(event.dataTransfer?.dropEffect).toBe('none');\n\t}\n\n\t// a \"drop\" event won't fire\n\t{\n\t\tconst event = new DragEvent('dragend', options);\n\t\tdraggableEl.dispatchEvent(event);\n\n\t\texpect(ordered).toEqual(['drop']);\n\t\texpect(event.dataTransfer?.dropEffect).toEqual('none');\n\t}\n\n\tcleanup();\n});\n\nit('should be able to be disabled and enabled during a drag', () => {\n\tconst [draggableEl, siblingA, siblingB] = getElements('div');\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(draggableEl, siblingA, siblingB),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart() {\n\t\t\t\tordered.push('start');\n\t\t\t\tpreventUnhandled.start();\n\t\t\t},\n\t\t\tonDrop() {\n\t\t\t\tordered.push('drop');\n\t\t\t},\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\n\texpect(ordered).toEqual(['start']);\n\tordered.length = 0;\n\n\t// cancelling \"dragenter\" and \"dragover\" result in a drop being accepted.\n\t{\n\t\tconst event = new DragEvent('dragenter', {\n\t\t\tcancelable: true,\n\t\t\tbubbles: true,\n\t\t});\n\t\tsiblingA.dispatchEvent(event);\n\t\texpect(event.defaultPrevented).toBe(true);\n\t\texpect(event.dataTransfer?.dropEffect).toBe('move');\n\t}\n\t{\n\t\tconst event = new DragEvent('dragover', {\n\t\t\tcancelable: true,\n\t\t\tbubbles: true,\n\t\t});\n\t\tsiblingA.dispatchEvent(event);\n\t\texpect(event.defaultPrevented).toBe(true);\n\t\texpect(event.dataTransfer?.dropEffect).toBe('move');\n\t}\n\n\tpreventUnhandled.stop();\n\n\t{\n\t\tconst event = new DragEvent('dragenter', {\n\t\t\tcancelable: true,\n\t\t\tbubbles: true,\n\t\t});\n\t\tsiblingB.dispatchEvent(event);\n\t\texpect(event.defaultPrevented).toBe(false);\n\t\texpect(event.dataTransfer?.dropEffect).toBe('none');\n\t}\n\t{\n\t\tconst event = new DragEvent('dragover', {\n\t\t\tcancelable: true,\n\t\t\tbubbles: true,\n\t\t});\n\t\tsiblingB.dispatchEvent(event);\n\t\texpect(event.defaultPrevented).toBe(false);\n\t\texpect(event.dataTransfer?.dropEffect).toBe('none');\n\t}\n\n\tpreventUnhandled.start();\n\n\t{\n\t\tconst event = new DragEvent('dragenter', {\n\t\t\tcancelable: true,\n\t\t\tbubbles: true,\n\t\t});\n\t\tsiblingA.dispatchEvent(event);\n\t\texpect(event.defaultPrevented).toBe(true);\n\t\texpect(event.dataTransfer?.dropEffect).toBe('move');\n\t}\n\t{\n\t\tconst event = new DragEvent('dragover', {\n\t\t\tcancelable: true,\n\t\t\tbubbles: true,\n\t\t});\n\t\tsiblingA.dispatchEvent(event);\n\t\texpect(event.defaultPrevented).toBe(true);\n\t\texpect(event.dataTransfer?.dropEffect).toBe('move');\n\t}\n\n\t{\n\t\tconst event = new DragEvent('dragend', options);\n\t\tdraggableEl.dispatchEvent(event);\n\n\t\texpect(ordered).toEqual(['drop']);\n\t\texpect(event.dataTransfer?.dropEffect).toEqual('none');\n\t}\n\n\tcleanup();\n});\n\nit('should stop not block a future drag operation if a drag operation was aborted', () => {\n\tconst [draggableEl, sibling] = getElements('div');\n\tconst ordered: string[] = [];\n\tlet isEnabled: boolean = true;\n\n\tconst cleanup = combine(\n\t\tappendToBody(draggableEl, sibling),\n\t\tdraggable({\n\t\t\telement: draggableEl,\n\t\t\tonDragStart() {\n\t\t\t\tordered.push('start');\n\t\t\t\tif (isEnabled) {\n\t\t\t\t\tpreventUnhandled.start();\n\t\t\t\t}\n\t\t\t},\n\t\t\tonDrop() {\n\t\t\t\tordered.push('drop');\n\t\t\t},\n\t\t}),\n\t);\n\n\tuserEvent.lift(draggableEl);\n\n\texpect(ordered).toEqual(['start']);\n\tordered.length = 0;\n\n\t// cancelling \"dragenter\" and \"dragover\" result in a drop being accepted.\n\t{\n\t\tconst event = new DragEvent('dragenter', {\n\t\t\tcancelable: true,\n\t\t\tbubbles: true,\n\t\t});\n\t\tsibling.dispatchEvent(event);\n\t\texpect(event.defaultPrevented).toBe(true);\n\t\texpect(event.dataTransfer?.dropEffect).toBe('move');\n\t}\n\t{\n\t\tconst event = new DragEvent('dragover', {\n\t\t\tcancelable: true,\n\t\t\tbubbles: true,\n\t\t});\n\t\tsibling.dispatchEvent(event);\n\t\texpect(event.defaultPrevented).toBe(true);\n\t\texpect(event.dataTransfer?.dropEffect).toBe('move');\n\t}\n\n\t// breaking a drag operation\n\tuserEvent.rougePointerMoves();\n\n\texpect(ordered).toEqual(['drop']);\n\tordered.length = 0;\n\t// doing another drag\n\tisEnabled = false;\n\n\tuserEvent.lift(draggableEl);\n\n\texpect(ordered).toEqual(['start']);\n\tordered.length = 0;\n\n\t// \"dragenter\" and \"dragover\" no longer cancelled\n\t{\n\t\tconst event = new DragEvent('dragenter', {\n\t\t\tcancelable: true,\n\t\t\tbubbles: true,\n\t\t});\n\t\tsibling.dispatchEvent(event);\n\t\texpect(event.defaultPrevented).toBe(false);\n\t\texpect(event.dataTransfer?.dropEffect).toBe('none');\n\t}\n\t{\n\t\tconst event = new DragEvent('dragover', {\n\t\t\tcancelable: true,\n\t\t\tbubbles: true,\n\t\t});\n\t\tsibling.dispatchEvent(event);\n\t\texpect(event.defaultPrevented).toBe(false);\n\t\texpect(event.dataTransfer?.dropEffect).toBe('none');\n\t}\n\n\t// a \"drop\" event won't fire\n\tfireEvent.dragEnd(draggableEl);\n\n\texpect(ordered).toEqual(['drop']);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/public-utils/reorder.spec.ts",
    "content": "import { reorder } from '../../../src/entry-point/reorder';\n\nit('should reorder a list', () => {\n\texpect(\n\t\treorder({\n\t\t\tlist: ['A', 'B'],\n\t\t\t// no change\n\t\t\tstartIndex: 1,\n\t\t\tfinishIndex: 1,\n\t\t}),\n\t).toEqual(['A', 'B']);\n\n\texpect(\n\t\treorder({\n\t\t\tlist: ['A', 'B'],\n\t\t\t// Grab A\n\t\t\tstartIndex: 0,\n\t\t\t// Move it to where B is\n\t\t\tfinishIndex: 1,\n\t\t}),\n\t).toEqual(['B', 'A']);\n\n\texpect(\n\t\treorder({\n\t\t\tlist: ['A', 'B', 'C', 'D'],\n\t\t\t// Grab C\n\t\t\tstartIndex: 2,\n\t\t\t// Move it to the start of the list\n\t\t\tfinishIndex: 0,\n\t\t}),\n\t).toEqual(['C', 'A', 'B', 'D']);\n\n\texpect(\n\t\treorder({\n\t\t\tlist: ['A', 'B', 'C', 'D'],\n\t\t\t// Grab A\n\t\t\tstartIndex: 0,\n\t\t\t// Move it to the end of the list\n\t\t\tfinishIndex: 3,\n\t\t}),\n\t).toEqual(['B', 'C', 'D', 'A']);\n\n\texpect(\n\t\treorder({\n\t\t\tlist: ['A', 'B', 'C', 'D'],\n\t\t\t// Grab A\n\t\t\tstartIndex: 0,\n\t\t\t// Move it to where C is\n\t\t\tfinishIndex: 2,\n\t\t}),\n\t).toEqual(['B', 'C', 'A', 'D']);\n});\n\nit('should return a new array reference (populated array)', () => {\n\tconst original: string[] = ['A', 'B'];\n\n\tconst result = reorder({\n\t\tlist: original,\n\t\t// Grab A\n\t\tstartIndex: 0,\n\t\t// Move it to where B is\n\t\tfinishIndex: 1,\n\t});\n\n\t// contents of original unchanged\n\texpect(original).toEqual(['A', 'B']);\n\t// new array was returned\n\texpect(original).not.toBe(result);\n\t// validating we got the result we expected\n\texpect(result).toEqual(['B', 'A']);\n});\n\nit('should return a new array reference (unpopulated array)', () => {\n\tconst original: string[] = [];\n\n\tconst result = reorder({\n\t\tlist: original,\n\t\tstartIndex: 0,\n\t\tfinishIndex: 0,\n\t});\n\n\t// contents of original unchanged\n\texpect(original).toEqual([]);\n\t// new array was returned\n\texpect(original).not.toBe(result);\n\t// validating we got the result we expected\n\texpect(result).toEqual([]);\n});\n\nit('should return a new array reference (invalid index)', () => {\n\tconst original: string[] = ['A', 'B'];\n\n\tconst result = reorder({\n\t\tlist: original,\n\t\tstartIndex: -1,\n\t\tfinishIndex: 1,\n\t});\n\n\t// contents of original unchanged\n\texpect(original).toEqual(['A', 'B']);\n\t// new array was returned\n\texpect(original).not.toBe(result);\n\t// validating we got the result we expected\n\texpect(result).toEqual(['A', 'B']);\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/react/adding-monitors-during-events.spec.tsx",
    "content": "import React, { useLayoutEffect, useRef, useState } from 'react';\n\n// Using '@testing-library/react' rather than '@testing-library/dom'\n// so that events are correctly wrapped in `act()`\nimport { fireEvent } from '@testing-library/react';\nimport ReactDOM from 'react-dom';\n\nimport { combine } from '../../../src/entry-point/combine';\nimport { draggable, monitorForElements } from '../../../src/entry-point/element/adapter';\nimport { appendToBody, getElements, reset } from '../_util';\n\nafterEach(reset);\n\ntest('no double calls for created in effects', () => {\n\tconst [container] = getElements('div');\n\tconst cleanup = appendToBody(container);\n\tconst ordered: string[] = [];\n\n\tfunction add({ label, isDragging }: { label: string; isDragging: boolean }) {\n\t\tordered.push(`${label}:isDragging=${isDragging}`);\n\t}\n\n\tfunction App() {\n\t\tconst ref = useRef<HTMLDivElement | null>(null);\n\t\tconst [isDragging, setIsDragging] = useState<boolean>(false);\n\n\t\tadd({ label: 'render', isDragging });\n\n\t\tuseLayoutEffect(() => {\n\t\t\tadd({ label: 'effect', isDragging });\n\n\t\t\tconst element = ref.current;\n\t\t\tif (!element) {\n\t\t\t\tthrow Error('Incorrect ref');\n\t\t\t}\n\n\t\t\treturn combine(\n\t\t\t\tmonitorForElements({\n\t\t\t\t\tonGenerateDragPreview: () => {\n\t\t\t\t\t\tadd({ label: 'monitor+onGenerateDragPreview', isDragging });\n\t\t\t\t\t\t// setState will cause a render in the next microtask\n\t\t\t\t\t\t// https://twitter.com/alexandereardon/status/1585784101885263872\n\n\t\t\t\t\t\t// Because the microtask will fire after the iteration of all monitors\n\t\t\t\t\t\t// the new monitor would not be executed for the current event\n\t\t\t\t\t\t// So this test passed before the protection was added to only iterate\n\t\t\t\t\t\t// over active monitors\n\t\t\t\t\t\tsetIsDragging(true);\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tdraggable({\n\t\t\t\t\telement,\n\t\t\t\t\tonGenerateDragPreview: () => {\n\t\t\t\t\t\tadd({ label: 'draggable+onGenerateDragPreview', isDragging });\n\t\t\t\t\t\t// setIsDragging(true);\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t);\n\t\t}, [isDragging]);\n\n\t\treturn <div ref={ref}>Drag me</div>;\n\t}\n\n\tReactDOM.render(<App />, container);\n\n\t// initial render\n\texpect(ordered).toEqual(['render:isDragging=false', 'effect:isDragging=false']);\n\tordered.length = 0;\n\n\tconst draggableElement = container.querySelector('[draggable=\"true\"]');\n\tif (!(draggableElement instanceof HTMLElement)) {\n\t\tthrow new Error('unable to find draggable element');\n\t}\n\n\t// act is messing up timings...\n\tfireEvent.dragStart(draggableElement);\n\n\texpect(ordered).toEqual([\n\t\t// event to trigger the state chance\n\t\t'draggable+onGenerateDragPreview:isDragging=false',\n\t\t'monitor+onGenerateDragPreview:isDragging=false',\n\t\t// a new render is run\n\t\t'render:isDragging=true',\n\t\t// a new effect is run an a new monitor is created\n\t\t'effect:isDragging=true',\n\t\t// `onDragStart` is _not_ called by the new monitor 💃\n\t]);\n\n\tReactDOM.unmountComponentAtNode(container);\n\tcleanup();\n});\n\ntest('no double calls for created in flushed effects', () => {\n\tconst [container] = getElements('div');\n\tconst cleanup = appendToBody(container);\n\tconst ordered: string[] = [];\n\n\tfunction add({ label, isDragging }: { label: string; isDragging: boolean }) {\n\t\tordered.push(`${label}:isDragging=${isDragging}`);\n\t}\n\n\tfunction App() {\n\t\tconst ref = useRef<HTMLDivElement | null>(null);\n\t\tconst [isDragging, setIsDragging] = useState<boolean>(false);\n\n\t\tadd({ label: 'render', isDragging });\n\n\t\tuseLayoutEffect(() => {\n\t\t\tadd({ label: 'effect', isDragging });\n\n\t\t\tconst element = ref.current;\n\t\t\tif (!element) {\n\t\t\t\tthrow Error('Incorrect ref');\n\t\t\t}\n\n\t\t\treturn combine(\n\t\t\t\tmonitorForElements({\n\t\t\t\t\tonGenerateDragPreview: () => {\n\t\t\t\t\t\tadd({ label: 'monitor+onGenerateDragPreview', isDragging });\n\t\t\t\t\t\t// setState will cause a render in the next microtask\n\t\t\t\t\t\t// https://twitter.com/alexandereardon/status/1585784101885263872\n\n\t\t\t\t\t\t// Because the microtask will fire after the iteration of all monitors\n\t\t\t\t\t\t// the new monitor would not be executed for the current event\n\t\t\t\t\t\t// So this test passed before the protection was added to only iterate\n\t\t\t\t\t\t// over active monitors\n\t\t\t\t\t\tReactDOM.flushSync(() => {\n\t\t\t\t\t\t\tsetIsDragging(true);\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t\tdraggable({\n\t\t\t\t\telement,\n\t\t\t\t\tonGenerateDragPreview: () => {\n\t\t\t\t\t\tadd({ label: 'draggable+onGenerateDragPreview', isDragging });\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t);\n\t\t}, [isDragging]);\n\n\t\treturn <div ref={ref}>Drag me</div>;\n\t}\n\n\tReactDOM.render(<App />, container);\n\n\t// initial render\n\texpect(ordered).toEqual(['render:isDragging=false', 'effect:isDragging=false']);\n\tordered.length = 0;\n\n\tconst draggableElement = container.querySelector('[draggable=\"true\"]');\n\tif (!(draggableElement instanceof HTMLElement)) {\n\t\tthrow new Error('unable to find draggable element');\n\t}\n\n\t// act is messing up timings...\n\tfireEvent.dragStart(draggableElement);\n\n\texpect(ordered).toEqual([\n\t\t// event to trigger the state chance\n\t\t'draggable+onGenerateDragPreview:isDragging=false',\n\t\t'monitor+onGenerateDragPreview:isDragging=false',\n\t\t// a new render is run\n\t\t'render:isDragging=true',\n\t\t// a new effect is run an a new monitor is created\n\t\t'effect:isDragging=true',\n\t\t// `onDragStart` is _not_ called by the new monitor 💃\n\t]);\n\n\tReactDOM.unmountComponentAtNode(container);\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/server-side-usage.spec.ts",
    "content": "// Ideally we would use the \"@jest-environment node\" file pragma,\n// but global test setup uses `window` too much\n// So we have to 'clean' the JSDOM environment\n// (this is how the @atlaskit/ssr package works)\n\n// 0. Turning file into a module so that we can do a top level `window.close()`\n// Need to do an `import` or an `export` for this file to be treated as a module\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nexport {};\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\n// 2. Removing globals\n// @ts-ignore\ndelete global.document;\n// @ts-ignore\ndelete global.window;\n\ntest('importing all entry points on the server should not cause any exceptions', () => {\n\tconst globby = require('globby');\n\tconst paths = globby.sync('../../src/entry-point/**/*.ts', {\n\t\tcwd: __dirname,\n\t});\n\n\t// validate that we are getting some paths!\n\texpect(paths.length > 0).toBe(true);\n\n\t// run the actual test\n\tfor (const path of paths) {\n\t\texpect(() => require(path)).not.toThrow();\n\t}\n});\n\ntest('`combine` should work on the server', () => {\n\tconst { combine } = require('../../src/entry-point/combine');\n\tconst fn1 = jest.fn();\n\tconst fn2 = jest.fn();\n\tconst combined = combine(fn1, fn2);\n\n\texpect(fn1).not.toHaveBeenCalled();\n\texpect(fn2).not.toHaveBeenCalled();\n\n\tcombined();\n\n\texpect(fn1).toHaveBeenCalled();\n\texpect(fn2).toHaveBeenCalled();\n});\n\ntest('`once` should work on the server', () => {\n\tconst { once } = require('../../src/entry-point/once');\n\tconst fn1 = jest.fn();\n\n\tconst onced = once(fn1);\n\n\tonced();\n\tonced();\n\tonced();\n\n\texpect(fn1).toHaveBeenCalledTimes(1);\n});\n\ntest('`reorder` should work on the server', () => {\n\tconst { reorder } = require('../../src/entry-point/reorder');\n\n\texpect(\n\t\treorder({\n\t\t\tlist: ['A', 'B'],\n\t\t\t// Grab A\n\t\t\tstartIndex: 0,\n\t\t\t// Move it to where B is\n\t\t\tfinishIndex: 1,\n\t\t}),\n\t).toEqual(['B', 'A']);\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/test-environment-guardrail.spec.ts",
    "content": "import { combine } from '../../src/entry-point/combine';\nimport { draggable } from '../../src/entry-point/element/adapter';\nimport { monitorForExternal } from '../../src/entry-point/external/adapter';\nimport { monitorForTextSelection } from '../../src/entry-point/text-selection/adapter';\n\nimport { appendToBody, getElements, nativeDrag, reset, userEvent } from './_util';\n\nconst warn = jest.spyOn(console, 'warn').mockImplementation(() => {});\n\nbeforeEach(() => {\n\twarn.mockClear();\n\treset();\n});\n\nit('should warn if a drag event is not setup correctly [element adapter]', () => {\n\tconst [A] = getElements('div');\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview() {\n\t\t\t\tordered.push('element:preview');\n\t\t\t},\n\t\t\tonDragStart() {\n\t\t\t\tordered.push('element:start');\n\t\t\t},\n\t\t}),\n\t);\n\texpect(warn).not.toHaveBeenCalled();\n\n\t// Not using the DragEvent constructor\n\tA.dispatchEvent(new Event('dragstart', { cancelable: true, bubbles: true }));\n\n\texpect(warn).toHaveBeenCalled();\n\t// drag did not start\n\texpect(ordered).toEqual([]);\n\n\t// validating setup\n\twarn.mockClear();\n\n\tuserEvent.lift(A);\n\texpect(ordered).toEqual(['element:preview', 'element:start']);\n\texpect(warn).not.toHaveBeenCalled();\n\n\tcleanup();\n});\n\nit('should warn if a drag event is not setup correctly [external adapter]', () => {\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tmonitorForExternal({\n\t\t\tonDragStart() {\n\t\t\t\tordered.push('external:start');\n\t\t\t},\n\t\t}),\n\t);\n\texpect(warn).not.toHaveBeenCalled();\n\n\t// Not using the DragEvent constructor\n\tdocument.body.dispatchEvent(new Event('dragenter', { cancelable: true, bubbles: true }));\n\n\texpect(warn).toHaveBeenCalled();\n\t// drag did not start\n\texpect(ordered).toEqual([]);\n\n\t// validating setup\n\twarn.mockClear();\n\n\tnativeDrag.startExternal({\n\t\titems: [{ type: 'text/html', data: 'hello there' }],\n\t});\n\n\texpect(ordered).toEqual(['external:start']);\n\texpect(warn).not.toHaveBeenCalled();\n\n\tcleanup();\n});\n\nit('should warn if a drag event is not setup correctly [text selection adapter]', () => {\n\tconst [paragraph] = getElements('p');\n\tparagraph.textContent = 'Hello';\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(paragraph),\n\t\tmonitorForTextSelection({\n\t\t\tonDragStart() {\n\t\t\t\tordered.push('text-selection:start');\n\t\t\t},\n\t\t}),\n\t);\n\texpect(warn).not.toHaveBeenCalled();\n\n\t// Not using the DragEvent constructor\n\tparagraph.dispatchEvent(new Event('dragstart', { cancelable: true, bubbles: true }));\n\n\texpect(warn).toHaveBeenCalled();\n\t// drag did not start\n\texpect(ordered).toEqual([]);\n\n\t// validating setup\n\twarn.mockClear();\n\n\tnativeDrag.startTextSelectionDrag({ element: paragraph });\n\n\texpect(ordered).toEqual(['text-selection:start']);\n\texpect(warn).not.toHaveBeenCalled();\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/text-selection/adapter/drag-ownership/element-adapter.spec.ts",
    "content": "import { combine } from '../../../../../src/entry-point/combine';\nimport { draggable, monitorForElements } from '../../../../../src/entry-point/element/adapter';\nimport { monitorForTextSelection } from '../../../../../src/entry-point/text-selection/adapter';\nimport { appendToBody, getBubbleOrderedTree, nativeDrag, reset } from '../../../_util';\n\nafterEach(reset);\n\ntest('a text selection drag should not trigger the element adapter', () => {\n\tconst [element] = getBubbleOrderedTree();\n\telement.textContent = 'Hello world';\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(element),\n\t\tdraggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonGenerateDragPreview: () => ordered.push('element-monitor:preview'),\n\t\t}),\n\t\tmonitorForTextSelection({\n\t\t\tonDragStart: () => ordered.push('text-monitor:preview'),\n\t\t}),\n\t);\n\n\tnativeDrag.startTextSelectionDrag({ element });\n\n\texpect(ordered).toEqual(['text-monitor:preview']);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/text-selection/adapter/drag-ownership/external-adapter.spec.ts",
    "content": "import { combine } from '../../../../../src/entry-point/combine';\nimport { monitorForExternal } from '../../../../../src/entry-point/external/adapter';\nimport { appendToBody, getElements, nativeDrag, reset } from '../../../_util';\n\nafterEach(reset);\n\ntest('text selection drags should not trigger the external adapter', () => {\n\tconst [A] = getElements('div');\n\tconst [paragraph] = getElements('div');\n\tparagraph.textContent = 'Hello world';\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tappendToBody(paragraph),\n\t\tmonitorForExternal({\n\t\t\tonDragStart: () => ordered.push('a(external):start'),\n\t\t}),\n\t);\n\n\tnativeDrag.startTextSelectionDrag({\n\t\telement: paragraph,\n\t});\n\n\texpect(ordered).toEqual([]);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/text-selection/adapter/event-ordering.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdropTargetForTextSelection,\n\tmonitorForTextSelection,\n\ttype TextSelectionDragPayload,\n\ttype TextSelectionEventBasePayload,\n} from '../../../../src/entry-point/text-selection/adapter';\nimport {\n\tappendToBody,\n\tgetBubbleOrderedTree,\n\tgetFirstTextNode,\n\tnativeDrag,\n\treset,\n} from '../../_util';\n\nafterEach(reset);\n\ntype Entry = {\n\tdescription: string;\n\tdata: TextSelectionDragPayload | null;\n\tdropTargets: string[];\n};\n\nfunction getDropTargets(location: TextSelectionEventBasePayload['location']): string[] {\n\treturn location.current.dropTargets.map((dropTarget) => dropTarget.element.id);\n}\n\ntest('scenario: text in drop target', () => {\n\tconst [A] = getBubbleOrderedTree();\n\tA.textContent = 'Hello world';\n\tA.id = 'A';\n\tconst ordered: Entry[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForTextSelection({\n\t\t\telement: A,\n\t\t\tonDragStart: ({ source, location }) => {\n\t\t\t\tordered.push({\n\t\t\t\t\tdescription: 'A:start',\n\t\t\t\t\tdata: source,\n\t\t\t\t\tdropTargets: getDropTargets(location),\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDrag: ({ source, location }) => {\n\t\t\t\tordered.push({\n\t\t\t\t\tdescription: 'A:drag',\n\t\t\t\t\tdata: source,\n\t\t\t\t\tdropTargets: getDropTargets(location),\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDragEnter: ({ source, location }) => {\n\t\t\t\tordered.push({\n\t\t\t\t\tdescription: 'A:enter',\n\t\t\t\t\tdata: source,\n\t\t\t\t\tdropTargets: getDropTargets(location),\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDragLeave: ({ source, location }) => {\n\t\t\t\tordered.push({\n\t\t\t\t\tdescription: 'A:leave',\n\t\t\t\t\tdata: source,\n\t\t\t\t\tdropTargets: getDropTargets(location),\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDropTargetChange: ({ source, location }) => {\n\t\t\t\tordered.push({\n\t\t\t\t\tdescription: 'A:change',\n\t\t\t\t\tdata: source,\n\t\t\t\t\tdropTargets: getDropTargets(location),\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDrop: ({ source, location }) => {\n\t\t\t\tordered.push({\n\t\t\t\t\tdescription: 'A:drop',\n\t\t\t\t\tdata: source,\n\t\t\t\t\tdropTargets: getDropTargets(location),\n\t\t\t\t});\n\t\t\t},\n\t\t}),\n\t\tmonitorForTextSelection({\n\t\t\tonDragStart: ({ source, location }) => {\n\t\t\t\tordered.push({\n\t\t\t\t\tdescription: 'monitor:start',\n\t\t\t\t\tdata: source,\n\t\t\t\t\tdropTargets: getDropTargets(location),\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDrag: ({ source, location }) => {\n\t\t\t\tordered.push({\n\t\t\t\t\tdescription: 'monitor:drag',\n\t\t\t\t\tdata: source,\n\t\t\t\t\tdropTargets: getDropTargets(location),\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDropTargetChange: ({ source, location }) => {\n\t\t\t\tordered.push({\n\t\t\t\t\tdescription: 'monitor:change',\n\t\t\t\t\tdata: source,\n\t\t\t\t\tdropTargets: getDropTargets(location),\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDrop: ({ source, location }) => {\n\t\t\t\tordered.push({\n\t\t\t\t\tdescription: 'monitor:drop',\n\t\t\t\t\tdata: source,\n\t\t\t\t\tdropTargets: getDropTargets(location),\n\t\t\t\t});\n\t\t\t},\n\t\t}),\n\t);\n\n\tnativeDrag.startTextSelectionDrag({ element: A });\n\n\tconst expectedData: TextSelectionDragPayload = {\n\t\ttarget: getFirstTextNode(A),\n\t\tplain: A.textContent,\n\t\tHTML: A.outerHTML,\n\t};\n\t{\n\t\tconst expected: Entry[] = [\n\t\t\t{\n\t\t\t\tdescription: 'A:start',\n\t\t\t\tdata: expectedData,\n\t\t\t\tdropTargets: ['A'],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdescription: 'monitor:start',\n\t\t\t\tdata: expectedData,\n\t\t\t\tdropTargets: ['A'],\n\t\t\t},\n\t\t];\n\t\texpect(ordered).toEqual(expected);\n\t\tordered.length = 0;\n\t}\n\n\t// [A] => [A]\n\tfireEvent.dragOver(A);\n\t// drag events are throttled\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\t{\n\t\tconst expected: Entry[] = [\n\t\t\t{\n\t\t\t\tdescription: 'A:drag',\n\t\t\t\tdata: expectedData,\n\t\t\t\tdropTargets: ['A'],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdescription: 'monitor:drag',\n\t\t\t\tdata: expectedData,\n\t\t\t\tdropTargets: ['A'],\n\t\t\t},\n\t\t];\n\t\texpect(ordered).toEqual(expected);\n\t\tordered.length = 0;\n\t}\n\n\t// [A] => body\n\tfireEvent.dragEnter(document.body);\n\t{\n\t\tconst expected: Entry[] = [\n\t\t\t{\n\t\t\t\tdescription: 'A:change',\n\t\t\t\tdata: expectedData,\n\t\t\t\tdropTargets: [],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdescription: 'A:leave',\n\t\t\t\tdata: expectedData,\n\t\t\t\tdropTargets: [],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdescription: 'monitor:change',\n\t\t\t\tdata: expectedData,\n\t\t\t\tdropTargets: [],\n\t\t\t},\n\t\t];\n\t\texpect(ordered).toEqual(expected);\n\t\tordered.length = 0;\n\t}\n\n\t// body => [A]\n\tfireEvent.dragEnter(A);\n\t{\n\t\tconst expected: Entry[] = [\n\t\t\t{\n\t\t\t\tdescription: 'A:change',\n\t\t\t\tdata: expectedData,\n\t\t\t\tdropTargets: ['A'],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdescription: 'A:enter',\n\t\t\t\tdata: expectedData,\n\t\t\t\tdropTargets: ['A'],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdescription: 'monitor:change',\n\t\t\t\tdata: expectedData,\n\t\t\t\tdropTargets: ['A'],\n\t\t\t},\n\t\t];\n\t\texpect(ordered).toEqual(expected);\n\t\tordered.length = 0;\n\t}\n\n\tfireEvent.drop(A);\n\t{\n\t\tconst expected: Entry[] = [\n\t\t\t{\n\t\t\t\tdescription: 'A:drop',\n\t\t\t\tdata: expectedData,\n\t\t\t\tdropTargets: ['A'],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdescription: 'monitor:drop',\n\t\t\t\tdata: expectedData,\n\t\t\t\tdropTargets: ['A'],\n\t\t\t},\n\t\t];\n\t\texpect(ordered).toEqual(expected);\n\t\tordered.length = 0;\n\t}\n\n\tcleanup();\n});\n\ntest('scenario: child of drop target', () => {\n\tconst [B, A] = getBubbleOrderedTree();\n\tA.id = 'A';\n\tB.textContent = 'Hello world';\n\tB.id = 'B';\n\tconst ordered: Entry[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdropTargetForTextSelection({\n\t\t\telement: A,\n\t\t\tonDragStart: ({ source, location }) => {\n\t\t\t\tordered.push({\n\t\t\t\t\tdescription: 'A:start',\n\t\t\t\t\tdata: source,\n\t\t\t\t\tdropTargets: getDropTargets(location),\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDrag: ({ source, location }) => {\n\t\t\t\tordered.push({\n\t\t\t\t\tdescription: 'A:drag',\n\t\t\t\t\tdata: source,\n\t\t\t\t\tdropTargets: getDropTargets(location),\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDragEnter: ({ source, location }) => {\n\t\t\t\tordered.push({\n\t\t\t\t\tdescription: 'A:enter',\n\t\t\t\t\tdata: source,\n\t\t\t\t\tdropTargets: getDropTargets(location),\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDragLeave: ({ source, location }) => {\n\t\t\t\tordered.push({\n\t\t\t\t\tdescription: 'A:leave',\n\t\t\t\t\tdata: source,\n\t\t\t\t\tdropTargets: getDropTargets(location),\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDropTargetChange: ({ source, location }) => {\n\t\t\t\tordered.push({\n\t\t\t\t\tdescription: 'A:change',\n\t\t\t\t\tdata: source,\n\t\t\t\t\tdropTargets: getDropTargets(location),\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDrop: ({ source, location }) => {\n\t\t\t\tordered.push({\n\t\t\t\t\tdescription: 'A:drop',\n\t\t\t\t\tdata: source,\n\t\t\t\t\tdropTargets: getDropTargets(location),\n\t\t\t\t});\n\t\t\t},\n\t\t}),\n\t\tmonitorForTextSelection({\n\t\t\tonDragStart: ({ source, location }) => {\n\t\t\t\tordered.push({\n\t\t\t\t\tdescription: 'monitor:start',\n\t\t\t\t\tdata: source,\n\t\t\t\t\tdropTargets: getDropTargets(location),\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDrag: ({ source, location }) => {\n\t\t\t\tordered.push({\n\t\t\t\t\tdescription: 'monitor:drag',\n\t\t\t\t\tdata: source,\n\t\t\t\t\tdropTargets: getDropTargets(location),\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDropTargetChange: ({ source, location }) => {\n\t\t\t\tordered.push({\n\t\t\t\t\tdescription: 'monitor:change',\n\t\t\t\t\tdata: source,\n\t\t\t\t\tdropTargets: getDropTargets(location),\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDrop: ({ source, location }) => {\n\t\t\t\tordered.push({\n\t\t\t\t\tdescription: 'monitor:drop',\n\t\t\t\t\tdata: source,\n\t\t\t\t\tdropTargets: getDropTargets(location),\n\t\t\t\t});\n\t\t\t},\n\t\t}),\n\t);\n\n\tnativeDrag.startTextSelectionDrag({ element: B });\n\n\tconst expectedData: TextSelectionDragPayload = {\n\t\ttarget: getFirstTextNode(B),\n\t\tplain: B.textContent,\n\t\tHTML: B.outerHTML,\n\t};\n\t{\n\t\tconst expected: Entry[] = [\n\t\t\t{\n\t\t\t\tdescription: 'A:start',\n\t\t\t\tdata: expectedData,\n\t\t\t\tdropTargets: ['A'],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdescription: 'monitor:start',\n\t\t\t\tdata: expectedData,\n\t\t\t\tdropTargets: ['A'],\n\t\t\t},\n\t\t];\n\t\texpect(ordered).toEqual(expected);\n\t\tordered.length = 0;\n\t}\n\n\t// [A] => [A]\n\tfireEvent.dragOver(A);\n\t// drag events are throttled\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\t{\n\t\tconst expected: Entry[] = [\n\t\t\t{\n\t\t\t\tdescription: 'A:drag',\n\t\t\t\tdata: expectedData,\n\t\t\t\tdropTargets: ['A'],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdescription: 'monitor:drag',\n\t\t\t\tdata: expectedData,\n\t\t\t\tdropTargets: ['A'],\n\t\t\t},\n\t\t];\n\t\texpect(ordered).toEqual(expected);\n\t\tordered.length = 0;\n\t}\n\n\t// [A] => body\n\tfireEvent.dragEnter(document.body);\n\t{\n\t\tconst expected: Entry[] = [\n\t\t\t{\n\t\t\t\tdescription: 'A:change',\n\t\t\t\tdata: expectedData,\n\t\t\t\tdropTargets: [],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdescription: 'A:leave',\n\t\t\t\tdata: expectedData,\n\t\t\t\tdropTargets: [],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdescription: 'monitor:change',\n\t\t\t\tdata: expectedData,\n\t\t\t\tdropTargets: [],\n\t\t\t},\n\t\t];\n\t\texpect(ordered).toEqual(expected);\n\t\tordered.length = 0;\n\t}\n\n\t// body => [A]\n\tfireEvent.dragEnter(A);\n\t{\n\t\tconst expected: Entry[] = [\n\t\t\t{\n\t\t\t\tdescription: 'A:change',\n\t\t\t\tdata: expectedData,\n\t\t\t\tdropTargets: ['A'],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdescription: 'A:enter',\n\t\t\t\tdata: expectedData,\n\t\t\t\tdropTargets: ['A'],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdescription: 'monitor:change',\n\t\t\t\tdata: expectedData,\n\t\t\t\tdropTargets: ['A'],\n\t\t\t},\n\t\t];\n\t\texpect(ordered).toEqual(expected);\n\t\tordered.length = 0;\n\t}\n\n\tfireEvent.drop(A);\n\t{\n\t\tconst expected: Entry[] = [\n\t\t\t{\n\t\t\t\tdescription: 'A:drop',\n\t\t\t\tdata: expectedData,\n\t\t\t\tdropTargets: ['A'],\n\t\t\t},\n\t\t\t{\n\t\t\t\tdescription: 'monitor:drop',\n\t\t\t\tdata: expectedData,\n\t\t\t\tdropTargets: ['A'],\n\t\t\t},\n\t\t];\n\t\texpect(ordered).toEqual(expected);\n\t\tordered.length = 0;\n\t}\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/text-selection/adapter/global-event-binding.spec.ts",
    "content": "// Note: not using '@testing-library/dom' in this file as it can\n// add it's own \"error\" event listeners when other events are being fired\n// This file uses vanilla event firing so that we are in total control\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport { appendToBody, firePointer, getElements, nativeDrag, reset } from '../../_util';\n\nlet windowAddEventListener = jest.spyOn(window, 'addEventListener');\nlet removeWindowEventListener = jest.spyOn(window, 'removeEventListener');\n\njest.resetModules();\n\nafterEach(() => {\n\twindowAddEventListener.mockClear();\n\tremoveWindowEventListener.mockClear();\n\tjest.resetModules();\n});\n\nafterEach(reset);\n\nconst mountWindowEventListenerCount = 2;\n\nit('should add event listeners when the module is imported', () => {\n\texpect(windowAddEventListener).not.toHaveBeenCalled();\n\n\trequire('../../../../src/entry-point/text-selection/adapter');\n\n\t// initial listener\n\texpect(windowAddEventListener).toHaveBeenCalledTimes(mountWindowEventListenerCount);\n});\n\nit('should not add more event listeners when drop targets and monitors are added', () => {\n\texpect(windowAddEventListener).not.toHaveBeenCalled();\n\tconst {\n\t\tdropTargetForTextSelection,\n\t\tmonitorForTextSelection,\n\t} = require('../../../../src/entry-point/text-selection/adapter');\n\n\texpect(windowAddEventListener).toHaveBeenCalledTimes(mountWindowEventListenerCount);\n\n\tconst [paragraph] = getElements('p');\n\tparagraph.textContent = 'Hello world';\n\tconst unbind = combine(\n\t\tappendToBody(paragraph),\n\t\tdropTargetForTextSelection({\n\t\t\telement: paragraph,\n\t\t}),\n\t\tmonitorForTextSelection({}),\n\t);\n\n\texpect(windowAddEventListener).toHaveBeenCalledTimes(mountWindowEventListenerCount);\n\tunbind();\n});\n\nit('should not remove initiating event listener when an only drop target is removed', () => {\n\tconst {\n\t\tdropTargetForTextSelection,\n\t} = require('../../../../src/entry-point/text-selection/adapter');\n\n\t// initial event listener added\n\texpect(windowAddEventListener).toHaveBeenCalledTimes(mountWindowEventListenerCount);\n\t// nothing removed\n\texpect(removeWindowEventListener).not.toHaveBeenCalled();\n\n\tconst [paragraph] = getElements('p');\n\tparagraph.textContent = 'Hello world';\n\tconst unbindA = combine(\n\t\tappendToBody(paragraph),\n\t\tdropTargetForTextSelection({\n\t\t\telement: paragraph,\n\t\t}),\n\t);\n\n\texpect(windowAddEventListener).toHaveBeenCalledTimes(mountWindowEventListenerCount);\n\t// nothing removed yet\n\texpect(removeWindowEventListener).not.toHaveBeenCalled();\n\n\tunbindA();\n\n\t// still nothing removed\n\texpect(removeWindowEventListener).not.toHaveBeenCalled();\n});\n\nit('should bind event listeners needed for the drag only while dragging', () => {\n\tconst {\n\t\tdropTargetForTextSelection,\n\t\tmonitorForTextSelection,\n\t} = require('../../../../src/entry-point/text-selection/adapter');\n\tconst ordered: string[] = [];\n\n\t// no event listeners added or removed yet\n\texpect(windowAddEventListener).toHaveBeenCalledTimes(mountWindowEventListenerCount);\n\n\texpect(removeWindowEventListener).not.toHaveBeenCalled();\n\n\tconst [paragraph] = getElements('p');\n\tparagraph.textContent = 'Hello world';\n\tconst unbindA = combine(\n\t\tappendToBody(paragraph),\n\t\tdropTargetForTextSelection({\n\t\t\telement: paragraph,\n\t\t}),\n\t\tmonitorForTextSelection({\n\t\t\tonDragStart: () => ordered.push('start'),\n\t\t\tonDrop: () => ordered.push('drop'),\n\t\t}),\n\t);\n\n\t// Note: Cannot reset the mock. It causes internal reference mismatches\n\t// addEventListener.mockReset();\n\n\t// let's start a drag\n\tnativeDrag.startTextSelectionDrag({\n\t\telement: paragraph,\n\t});\n\texpect(ordered).toEqual(['start']);\n\tordered.length = 0;\n\n\t// we expect that *new* event listeners have been added for the duration of a the drag\n\tconst postLiftAddEventListenerCount =\n\t\twindowAddEventListener.mock.calls.length - mountWindowEventListenerCount;\n\texpect(postLiftAddEventListenerCount).toBeGreaterThan(0);\n\texpect(removeWindowEventListener).not.toHaveBeenCalled();\n\n\t// finish the drag\n\twindow.dispatchEvent(new DragEvent('dragend', { cancelable: true, bubbles: true }));\n\n\texpect(ordered).toEqual(['drop']);\n\n\t// all drag event listeners removed\n\texpect(removeWindowEventListener).toHaveBeenCalledTimes(postLiftAddEventListenerCount);\n\n\t// post drop event listeners added for the honey pot\n\tconst postDropAddEventListenerCount =\n\t\twindowAddEventListener.mock.calls.length -\n\t\tpostLiftAddEventListenerCount -\n\t\tmountWindowEventListenerCount;\n\n\texpect(postDropAddEventListenerCount).toBeGreaterThan(0);\n\n\t// release honey pot fix\n\tfirePointer.move(document.body);\n\n\texpect(removeWindowEventListener).toHaveBeenCalledTimes(\n\t\tpostLiftAddEventListenerCount + postDropAddEventListenerCount,\n\t);\n\n\tunbindA();\n});\n\nit('should keep dragging event listeners bound even if only drop target is removed mid drag', () => {\n\tconst {\n\t\tdropTargetForTextSelection,\n\t\tmonitorForTextSelection,\n\t} = require('../../../../src/entry-point/text-selection/adapter');\n\tconst ordered: string[] = [];\n\n\t// no event listeners added or removed yet\n\texpect(windowAddEventListener).toHaveBeenCalledTimes(mountWindowEventListenerCount);\n\texpect(removeWindowEventListener).not.toHaveBeenCalled();\n\n\tconst [paragraph] = getElements('p');\n\tparagraph.textContent = 'Hello world';\n\tconst unbindA = combine(\n\t\tappendToBody(paragraph),\n\t\tdropTargetForTextSelection({\n\t\t\telement: paragraph,\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t}),\n\t);\n\tconst unbindMonitor = monitorForTextSelection({\n\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\tonDrop: () => ordered.push('monitor:drop'),\n\t});\n\n\t// Note: Cannot reset the mock. It causes internal reference mismatches\n\t// addEventListener.mockReset();\n\n\t// let's start a drag\n\tnativeDrag.startTextSelectionDrag({\n\t\telement: paragraph,\n\t});\n\texpect(ordered).toEqual(['monitor:start']);\n\tordered.length = 0;\n\n\t// we expect that *new* event listeners have been added for the duration of a the drag\n\tconst postLiftAddEventListenerCount =\n\t\twindowAddEventListener.mock.calls.length - mountWindowEventListenerCount;\n\texpect(postLiftAddEventListenerCount).toBeGreaterThan(0);\n\texpect(removeWindowEventListener).not.toHaveBeenCalled();\n\n\t// unbinding the only drop target during the drag\n\tunbindA();\n\t// our drag initiation drag listener is still active (we no longer tie it to drop targets)\n\texpect(removeWindowEventListener).not.toHaveBeenCalled();\n\t// finish the drag\n\twindow.dispatchEvent(new DragEvent('dragend', { cancelable: true, bubbles: true }));\n\n\t// monitor still told about the drop\n\texpect(ordered).toEqual(['monitor:drop']);\n\n\t// all drag event listeners removed\n\texpect(removeWindowEventListener).toHaveBeenCalledTimes(postLiftAddEventListenerCount);\n\n\tunbindMonitor();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/text-selection/adapter/leaving-the-window.spec.ts",
    "content": "import { combine } from '../../../../src/entry-point/combine';\nimport { monitorForTextSelection } from '../../../../src/entry-point/text-selection/adapter';\nimport { appendToBody, getElements, nativeDrag, reset, userEvent } from '../../_util';\n\nafterEach(reset);\n\nit('should not end an text selection drag when dragging out of the window', () => {\n\tconst [paragraph] = getElements('p');\n\tparagraph.textContent = 'Hello world';\n\tconst ordered: string[] = [];\n\tconst cleanup = combine(\n\t\tappendToBody(paragraph),\n\t\tmonitorForTextSelection({\n\t\t\tonDragStart() {\n\t\t\t\tordered.push('monitor:start');\n\t\t\t},\n\t\t\tonDrop() {\n\t\t\t\tordered.push('monitor:drop');\n\t\t\t},\n\t\t}),\n\t);\n\n\t// First enter event is into A\n\tnativeDrag.startTextSelectionDrag({\n\t\telement: paragraph,\n\t});\n\n\texpect(ordered).toEqual(['monitor:start']);\n\tordered.length = 0;\n\n\t// leaving the window does not end the drag\n\tuserEvent.leaveWindow();\n\n\texpect(ordered).toEqual([]);\n\n\t// finishing the drag with an explicit cancel\n\tuserEvent.cancel();\n\texpect(ordered).toEqual(['monitor:drop']);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/text-selection/adapter/respecting-non-pdnd-code.spec.ts",
    "content": "import { createEvent, fireEvent } from '@testing-library/dom';\nimport { bind, bindAll } from 'bind-event-listener';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport { monitorForTextSelection } from '../../../../src/entry-point/text-selection/adapter';\nimport { appendToBody, getElements, nativeDrag, reset } from '../../_util';\n\nafterEach(reset);\n\nit('should not start a drag if \"dragstart\" is cancelled', () => {\n\tconst [paragraph] = getElements('p');\n\tparagraph.textContent = 'Text to be dragged';\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(paragraph),\n\t\tmonitorForTextSelection({\n\t\t\tonDragStart: () => ordered.push('monitor:preview'),\n\t\t}),\n\t\tbind(window, {\n\t\t\ttype: 'dragstart',\n\t\t\tlistener: (event) => {\n\t\t\t\tordered.push('cancelled');\n\t\t\t\tevent.preventDefault();\n\t\t\t},\n\t\t\t// hit before our native adapter\n\t\t\toptions: { capture: true },\n\t\t}),\n\t);\n\n\tnativeDrag.startTextSelectionDrag({\n\t\telement: paragraph,\n\t});\n\n\texpect(ordered).toEqual(['cancelled']);\n\n\tcleanup();\n});\n\ntest('an unmanaged \"drop\" event should not be cancelled', () => {\n\tconst [paragraph] = getElements('p');\n\tparagraph.textContent = 'Text to be dragged';\n\tconst ordered: string[] = [];\n\tconst [unmanagedDropTarget] = getElements('div');\n\n\tconst cleanup = combine(\n\t\tappendToBody(paragraph, unmanagedDropTarget),\n\t\tmonitorForTextSelection({\n\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t\tonDrop: () => ordered.push('monitor:drop'),\n\t\t}),\n\t\tbindAll(unmanagedDropTarget, [\n\t\t\t{\n\t\t\t\ttype: 'dragover',\n\t\t\t\tlistener: (event) => {\n\t\t\t\t\tordered.push('unmanaged:over');\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'dragenter',\n\t\t\t\tlistener: (event) => {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tordered.push('unmanaged:enter');\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'drop',\n\t\t\t\tlistener: () => {\n\t\t\t\t\tordered.push('unmanaged:drop');\n\t\t\t\t},\n\t\t\t},\n\t\t]),\n\t);\n\n\tnativeDrag.startTextSelectionDrag({\n\t\telement: paragraph,\n\t});\n\n\texpect(ordered).toEqual(['monitor:start']);\n\tordered.length = 0;\n\n\tfireEvent.dragEnter(unmanagedDropTarget);\n\n\texpect(ordered).toEqual(['unmanaged:enter']);\n\tordered.length = 0;\n\n\tconst event = createEvent.drop(unmanagedDropTarget);\n\tfireEvent.drop(unmanagedDropTarget, event);\n\n\t// \"drop\" event not cancelled\n\texpect(event.defaultPrevented).toBe(false);\n\texpect(ordered).toEqual(['monitor:drop', 'unmanaged:drop']);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/text-selection/adapter/starting-a-text-selection-drag-before-registrations.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdropTargetForTextSelection,\n\tmonitorForTextSelection,\n} from '../../../../src/entry-point/text-selection/adapter';\nimport { type CleanupFn } from '../../../../src/entry-point/types';\nimport { appendToBody, getElements, nativeDrag, reset } from '../../_util';\n\nafterEach(reset);\n\nit('should notify monitors and drop targets that are mounted during a drag', () => {\n\tconst cleanups: CleanupFn[] = [];\n\tconst ordered: string[] = [];\n\tconst [X, A] = getElements('div');\n\tconst [paragraph] = getElements('p');\n\tparagraph.textContent = 'Hello world';\n\n\tcleanups.push(appendToBody(X, A, paragraph));\n\n\tnativeDrag.startTextSelectionDrag({\n\t\telement: paragraph,\n\t});\n\n\texpect(ordered).toEqual([]);\n\n\tcleanups.push(\n\t\tcombine(\n\t\t\tdropTargetForTextSelection({\n\t\t\t\telement: A,\n\t\t\t\tonDragEnter: () => ordered.push('A:enter'),\n\t\t\t\tonDragLeave: () => ordered.push('A:leave'),\n\t\t\t}),\n\t\t\tdropTargetForTextSelection({\n\t\t\t\telement: X,\n\t\t\t\tonDragEnter: () => ordered.push('X:enter'),\n\t\t\t\tonDragLeave: () => ordered.push('X:leave'),\n\t\t\t}),\n\t\t\tmonitorForTextSelection({\n\t\t\t\tonDropTargetChange: () => ordered.push('monitor:change'),\n\t\t\t}),\n\t\t),\n\t);\n\texpect(ordered).toEqual([]);\n\n\t// complete a little movement over A\n\t// now \"over A\" according to the system\n\tfireEvent.dragOver(A);\n\t// @ts-expect-error: raf types\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual(['A:enter', 'monitor:change']);\n\tordered.length = 0;\n\n\tfireEvent.dragEnter(X);\n\n\texpect(ordered).toEqual(['A:leave', 'X:enter', 'monitor:change']);\n\n\tcleanups.forEach((fn) => fn());\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/text-selection/adapter/text-target.spec.ts",
    "content": "import { combine } from '../../../../src/entry-point/combine';\nimport { monitorForTextSelection } from '../../../../src/entry-point/text-selection/adapter';\nimport { appendToBody, getElements, getFirstTextNode, nativeDrag, reset } from '../../_util';\n\nafterEach(reset);\n\ntest('standard - use provided text element', () => {\n\tconst [paragraph] = getElements('p');\n\tparagraph.textContent = 'Text to be dragged';\n\tconst ordered: Text[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(paragraph),\n\t\tmonitorForTextSelection({\n\t\t\tonDragStart: (args) => ordered.push(args.source.target),\n\t\t}),\n\t);\n\n\tnativeDrag.startTextSelectionDrag({\n\t\telement: paragraph,\n\t});\n\n\texpect(ordered).toEqual([document.createTextNode('Text to be dragged')]);\n\n\tcleanup();\n});\n\nit('should not start a drag if there is no text in the drag', () => {\n\tconst [paragraph] = getElements('p');\n\tparagraph.textContent = 'Text to be dragged';\n\tconst ordered: Text[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(paragraph),\n\t\tmonitorForTextSelection({\n\t\t\tonDragStart: (args) => ordered.push(args.source.target),\n\t\t}),\n\t);\n\n\tconst text = getFirstTextNode(paragraph);\n\n\tconst event = new DragEvent('dragstart', {\n\t\tcancelable: true,\n\t\tbubbles: true,\n\t});\n\n\t// not adding any text to the drag\n\ttext.dispatchEvent(event);\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\n\texpect(ordered).toEqual([]);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/__tests__/unit/text-selection/drop-targets/nested.spec.ts",
    "content": "import { fireEvent } from '@testing-library/dom';\n\nimport { combine } from '../../../../src/entry-point/combine';\nimport {\n\tdropTargetForTextSelection,\n\tmonitorForTextSelection,\n} from '../../../../src/entry-point/text-selection/adapter';\nimport { appendToBody, getBubbleOrderedTree, getElements, nativeDrag, reset } from '../../_util';\n\nafterEach(reset);\n\ntest('nested drop targets should be supported', () => {\n\tconst [B, A] = getBubbleOrderedTree();\n\tconst [paragraph] = getElements('p');\n\tparagraph.textContent = 'Hello world';\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tappendToBody(paragraph),\n\t\tmonitorForTextSelection({\n\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t\tonDropTargetChange: () => ordered.push('monitor:change'),\n\t\t\tonDrag: () => ordered.push('monitor:drag'),\n\t\t}),\n\t\tdropTargetForTextSelection({\n\t\t\telement: A,\n\t\t\tonDragStart: () => ordered.push('a:start'),\n\t\t\tonDropTargetChange: () => ordered.push('a:change'),\n\t\t\tonDragEnter: () => ordered.push('a:enter'),\n\t\t\tonDragLeave: () => ordered.push('a:leave'),\n\t\t\tonDrag: () => ordered.push('a:drag'),\n\t\t}),\n\t\tdropTargetForTextSelection({\n\t\t\telement: B,\n\t\t\tonDragStart: () => ordered.push('b:start'),\n\t\t\tonDropTargetChange: () => ordered.push('b:change'),\n\t\t\tonDragEnter: () => ordered.push('b:enter'),\n\t\t\tonDragLeave: () => ordered.push('b:leave'),\n\t\t\tonDrag: () => ordered.push('b:drag'),\n\t\t}),\n\t);\n\n\tnativeDrag.startTextSelectionDrag({\n\t\telement: paragraph,\n\t});\n\n\texpect(ordered).toEqual(['monitor:start']);\n\tordered.length = 0;\n\n\tfireEvent.dragOver(B);\n\n\texpect(ordered).toEqual(['b:change', 'b:enter', 'a:change', 'a:enter', 'monitor:change']);\n\tordered.length = 0;\n\n\tfireEvent.dragOver(A);\n\n\texpect(ordered).toEqual(['b:change', 'b:leave', 'a:change', 'monitor:change']);\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/core/afm-jira/tsconfig.json",
    "content": "{\n\t\"extends\": \"../../../../tsconfig.local-consumption.json\",\n\t\"compilerOptions\": {\n\t\t\"target\": \"es5\",\n\t\t\"outDir\": \"../../../../../jira/tsDist/@atlaskit__pragmatic-drag-and-drop/app\",\n\t\t\"rootDir\": \"../\",\n\t\t\"composite\": true,\n\t\t\"noCheck\": true,\n\t\t\"isolatedDeclarations\": true\n\t},\n\t\"include\": [\"../src/**/*.ts\", \"../src/**/*.tsx\"],\n\t\"exclude\": [\n\t\t\"../src/**/__tests__/*\",\n\t\t\"../src/**/*.test.*\",\n\t\t\"../src/**/test.*\",\n\t\t\"../src/**/examples.*\",\n\t\t\"../src/**/examples/*\",\n\t\t\"../src/**/examples/**/*\",\n\t\t\"../src/**/*.stories.*\",\n\t\t\"../src/**/stories/*\",\n\t\t\"../src/**/stories/**/*\"\n\t],\n\t\"references\": []\n}\n"
  },
  {
    "path": "packages/core/afm-products/tsconfig.json",
    "content": "{\n\t\"extends\": \"../../../../tsconfig.local-consumption.json\",\n\t\"compilerOptions\": {\n\t\t\"target\": \"es5\",\n\t\t\"outDir\": \"../../../../../tsDist/@atlaskit__pragmatic-drag-and-drop/app\",\n\t\t\"rootDir\": \"../\",\n\t\t\"composite\": true,\n\t\t\"noCheck\": true\n\t},\n\t\"include\": [\n\t\t\"../src/**/*.ts\",\n\t\t\"../src/**/*.tsx\"\n\t],\n\t\"exclude\": [\n\t\t\"../src/**/__tests__/*\",\n\t\t\"../src/**/*.test.*\",\n\t\t\"../src/**/test.*\",\n\t\t\"../src/**/examples.*\",\n\t\t\"../src/**/examples/*\",\n\t\t\"../src/**/examples/**/*\",\n\t\t\"../src/**/*.stories.*\",\n\t\t\"../src/**/stories/*\",\n\t\t\"../src/**/stories/**/*\"\n\t],\n\t\"references\": []\n}\n"
  },
  {
    "path": "packages/core/constellation/index/props.mdx",
    "content": "---\norder: 1\n---\n"
  },
  {
    "path": "packages/core/examples/_util/constants.tsx",
    "content": "export const gridSize = 8;\n\n/**\n * The space between each column in a board.\n */\nexport const columnGap: number = 2 * gridSize;\n\n/**\n * The space between each card in a column.\n */\nexport const cardGap: 8 = gridSize;\n"
  },
  {
    "path": "packages/core/examples/_util/fallback.ts",
    "content": "export const fallbackColor = '#44475a';\n"
  },
  {
    "path": "packages/core/examples/_util/global-styles.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, Global, jsx } from '@emotion/react';\n\nconst globalStyles = css({\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':root': {\n\t\t'--grid': '8px',\n\t\t'--border-radius': '2px',\n\t\t'--border-width': '2px',\n\t},\n});\n\nexport function GlobalStyles(): React.JSX.Element {\n\treturn <Global styles={globalStyles} />;\n}\n"
  },
  {
    "path": "packages/core/examples/config.jsonc",
    "content": "/**\n * This file is used by the test scaling project to optimise test result caching\n * Examples that are used by tests affect the outcome of tests so must be included when hashing\n * They are defined here so the hashing algorithm doesn't need to search test files for example usage each time\n */\n{\n  \"exampleDependencies\": []\n}\n"
  },
  {
    "path": "packages/core/examples/drag-preview-with-transparency.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { Fragment, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { jsx } from '@emotion/react';\nimport { createPortal } from 'react-dom';\nimport invariant from 'tiny-invariant';\n\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Stack, xcss } from '@atlaskit/primitives';\n\nimport { draggable } from '../src/entry-point/element/adapter';\nimport { centerUnderPointer } from '../src/entry-point/element/center-under-pointer';\nimport { pointerOutsideOfPreview } from '../src/entry-point/element/pointer-outside-of-preview';\nimport { preserveOffsetOnSource } from '../src/entry-point/element/preserve-offset-on-source';\nimport { setCustomNativeDragPreview } from '../src/entry-point/element/set-custom-native-drag-preview';\n\nfunction FakeText() {\n\treturn (\n\t\t<div>\n\t\t\tIf we are not careful, this text can get picked up in transparent drag previews on Safari\n\t\t</div>\n\t);\n}\n\nconst previewStyles = xcss({\n\twidth: 'size.1000',\n\theight: 'size.1000',\n\tbackgroundColor: 'color.blanket.selected',\n\tborderColor: 'color.border.accent.blue',\n\tborderWidth: 'border.width',\n\tborderRadius: 'radius.small',\n});\nfunction Preview() {\n\treturn <Box xcss={previewStyles} />;\n}\n\nconst cardStyles = xcss({\n\tpadding: 'space.100',\n\tbackgroundColor: 'color.background.accent.blue.subtlest',\n});\n\ntype ItemState =\n\t| { type: 'idle' }\n\t| { type: 'preview'; container: HTMLElement }\n\t| { type: 'dragging' };\n\nfunction ItemNoOffset() {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<ItemState>({ type: 'idle' });\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\n\t\treturn draggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\tsetState({ type: 'preview', container });\n\t\t\t\t\t\treturn () => setState({ type: 'dragging' });\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\t}, []);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<Box ref={ref} xcss={cardStyles}>\n\t\t\t\tStandard\n\t\t\t</Box>\n\t\t\t{state.type === 'preview' ? createPortal(<Preview />, state.container) : null}\n\t\t</Fragment>\n\t);\n}\n\nfunction ItemOffsetFromPointer() {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<ItemState>({ type: 'idle' });\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\n\t\treturn draggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\tgetOffset: pointerOutsideOfPreview({ x: '20px', y: '20px' }),\n\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\tsetState({ type: 'preview', container });\n\t\t\t\t\t\treturn () => setState({ type: 'dragging' });\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\t}, []);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<Box ref={ref} xcss={cardStyles}>\n\t\t\t\tOffset from pointer\n\t\t\t</Box>\n\t\t\t{state.type === 'preview' ? createPortal(<Preview />, state.container) : null}\n\t\t</Fragment>\n\t);\n}\n\nfunction ItemCenter() {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<ItemState>({ type: 'idle' });\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\n\t\treturn draggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\tgetOffset: centerUnderPointer,\n\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\tsetState({ type: 'preview', container });\n\t\t\t\t\t\treturn () => setState({ type: 'dragging' });\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\t}, []);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<Box ref={ref} xcss={cardStyles}>\n\t\t\t\tCenter under pointer\n\t\t\t</Box>\n\t\t\t{state.type === 'preview' ? createPortal(<Preview />, state.container) : null}\n\t\t</Fragment>\n\t);\n}\n\nfunction ItemPreserveOffsetOnSource() {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<ItemState>({ type: 'idle' });\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\n\t\treturn draggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview({ nativeSetDragImage, location }) {\n\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\tgetOffset: preserveOffsetOnSource({\n\t\t\t\t\t\telement,\n\t\t\t\t\t\tinput: location.current.input,\n\t\t\t\t\t}),\n\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\tsetState({ type: 'preview', container });\n\t\t\t\t\t\treturn () => setState({ type: 'dragging' });\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\t}, []);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<Box ref={ref} xcss={cardStyles}>\n\t\t\t\tPreserve offset on source\n\t\t\t</Box>\n\t\t\t{state.type === 'preview' ? createPortal(<Preview />, state.container) : null}\n\t\t</Fragment>\n\t);\n}\n\nexport default function Example(): React.JSX.Element {\n\treturn (\n\t\t<Stack space=\"space.050\">\n\t\t\t<FakeText />\n\t\t\t<ItemNoOffset />\n\t\t\t<ItemOffsetFromPointer />\n\t\t\t<ItemCenter />\n\t\t\t<ItemPreserveOffsetOnSource />\n\t\t</Stack>\n\t);\n}\n"
  },
  {
    "path": "packages/core/examples/element-adapter.tsx",
    "content": "export default function Example() {\n\treturn 'TODO';\n}\n"
  },
  {
    "path": "packages/core/examples/file.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { Fragment, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport { token } from '@atlaskit/tokens';\n\nimport { combine } from '../src/entry-point/combine';\nimport { dropTargetForExternal, monitorForExternal } from '../src/entry-point/external/adapter';\nimport { containsFiles, getFiles } from '../src/entry-point/external/file';\nimport { preventUnhandled } from '../src/entry-point/prevent-unhandled';\n\nimport { fallbackColor } from './_util/fallback';\nimport { GlobalStyles } from './_util/global-styles';\n\nconst fileStyles = css({\n\tdisplay: 'flex',\n\tpadding: 'calc(var(--grid) * 6) calc(var(--grid) * 4)',\n\talignItems: 'center',\n\tjustifyContent: 'center',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tbackground: token('elevation.surface.sunken', fallbackColor),\n\tborderRadius: 'var(--border-radius)',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tcolor: token('color.text.disabled', fallbackColor),\n\tfontSize: '1.4rem',\n});\n\nconst overStyles = css({\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tbackground: token('color.background.selected.hovered', fallbackColor),\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tcolor: token('color.text.selected', fallbackColor),\n});\n\nconst potentialStyles = css({\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tbackground: token('color.background.discovery', fallbackColor),\n});\n\nconst appStyles = css({\n\tdisplay: 'flex',\n\tpadding: 'var(--grid)',\n\talignItems: 'center',\n\tgap: 'calc(var(--grid) * 2)',\n\tflexDirection: 'column',\n});\n\nfunction FileList({ uploads }: { uploads: File[] }) {\n\tif (!uploads.length) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<ul data-testid=\"dropped-files\">\n\t\t\t{uploads.map((upload, index) => (\n\t\t\t\t<li key={index}>{upload.name}</li>\n\t\t\t))}\n\t\t</ul>\n\t);\n}\n\nfunction Uploader() {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<'idle' | 'potential' | 'over'>('idle');\n\tconst [uploads, setUploads] = useState<File[]>([]);\n\n\tuseEffect(() => {\n\t\tconst el = ref.current;\n\t\tinvariant(el);\n\t\treturn combine(\n\t\t\tdropTargetForExternal({\n\t\t\t\telement: el,\n\t\t\t\tcanDrop: containsFiles,\n\t\t\t\tonDragEnter: () => setState('over'),\n\t\t\t\tonDragLeave: () => setState('potential'),\n\t\t\t\tonDrop: ({ source }) => {\n\t\t\t\t\tif (!source.items) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst files: File[] = getFiles({ source });\n\t\t\t\t\tsetUploads((current) => [...files, ...current]);\n\t\t\t\t},\n\t\t\t}),\n\t\t\tmonitorForExternal({\n\t\t\t\tcanMonitor: containsFiles,\n\t\t\t\tonDragStart: () => {\n\t\t\t\t\tsetState('potential');\n\t\t\t\t\tpreventUnhandled.start();\n\t\t\t\t},\n\t\t\t\tonDrop: () => {\n\t\t\t\t\tpreventUnhandled.stop();\n\t\t\t\t\tsetState('idle');\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t});\n\treturn (\n\t\t<div css={appStyles}>\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tdata-testid=\"drop-target\"\n\t\t\t\tcss={[\n\t\t\t\t\tfileStyles,\n\t\t\t\t\tstate === 'over' ? overStyles : state === 'potential' ? potentialStyles : undefined,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t<strong>Drop some files on me!</strong>\n\t\t\t</div>\n\t\t\t<FileList uploads={uploads} />\n\t\t</div>\n\t);\n}\n\nexport default function Example(): React.JSX.Element {\n\treturn (\n\t\t<Fragment>\n\t\t\t<GlobalStyles />\n\t\t\t<Uploader />\n\t\t</Fragment>\n\t);\n}\n"
  },
  {
    "path": "packages/core/examples/iframe.tsx",
    "content": "import React, { useEffect, useRef, useState } from 'react';\n\nimport invariant from 'tiny-invariant';\n\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Stack, xcss } from '@atlaskit/primitives';\n\nimport { combine } from '../src/entry-point/combine';\nimport { draggable } from '../src/entry-point/element/adapter';\nimport { dropTargetForExternal } from '../src/entry-point/external/adapter';\nimport { containsText, getText } from '../src/entry-point/external/text';\n\nconst appStyles = xcss({\n\tuserSelect: 'none',\n});\n\nconst draggableStyles = xcss({\n\tbackgroundColor: 'color.background.accent.blue.subtle',\n\tpadding: 'space.075',\n});\n\nconst dropTargetStyles = xcss({\n\tbackgroundColor: 'color.background.accent.green.subtlest',\n\tminHeight: 'size.1000',\n\tpadding: 'space.075',\n});\n\nconst iframeStyles = xcss({\n\twidth: '600px',\n\theight: '600px',\n\tborderWidth: 'border.width.selected',\n\tborderColor: 'color.border',\n\tborderStyle: 'solid',\n});\n\nconst isInIframeStyles = xcss({\n\tbackgroundColor: 'color.background.accent.blue.subtlest',\n});\n\nexport default function IframeOuter(): React.JSX.Element {\n\tconst draggableRef = useRef<HTMLDivElement | null>(null);\n\tconst dropTargetRef = useRef<HTMLDivElement | null>(null);\n\tconst [dragCount, setDragCount] = useState<number>(0);\n\tconst [latestDropData, setLatestDropData] = useState<string>('none');\n\n\tconst [isInIframe] = useState<boolean>(() => {\n\t\tif (typeof window === undefined) {\n\t\t\treturn false;\n\t\t}\n\t\treturn window.parent !== window;\n\t});\n\n\tuseEffect(() => {\n\t\tconst draggableEl = draggableRef.current;\n\t\tconst dropTargetEl = dropTargetRef.current;\n\t\tinvariant(draggableEl && dropTargetEl);\n\t\treturn combine(\n\t\t\tdraggable({\n\t\t\t\telement: draggableEl,\n\t\t\t\tgetInitialDataForExternal: () => {\n\t\t\t\t\tconst data: string = (() => {\n\t\t\t\t\t\tif (isInIframe) {\n\t\t\t\t\t\t\treturn `Drag from iframe: ${dragCount}`;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn `Drag from parent: ${dragCount}`;\n\t\t\t\t\t})();\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\t'text/plain': data,\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tsetDragCount((current) => current + 1);\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdropTargetForExternal({\n\t\t\t\telement: dropTargetEl,\n\t\t\t\tcanDrop: containsText,\n\t\t\t\tonDragLeave() {},\n\t\t\t\tonDrop({ source }) {\n\t\t\t\t\tsetLatestDropData(getText({ source }) ?? '');\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [isInIframe, dragCount]);\n\n\treturn (\n\t\t<Stack xcss={[appStyles, isInIframe ? isInIframeStyles : undefined]} space=\"space.100\">\n\t\t\t<h3>{isInIframe ? 'Child iframe' : 'Parent window'}</h3>\n\t\t\t<Box\n\t\t\t\tas=\"div\"\n\t\t\t\tref={draggableRef}\n\t\t\t\txcss={draggableStyles}\n\t\t\t\tdraggable=\"true\"\n\t\t\t\ttestId={`draggable-in-${isInIframe ? 'iframe' : 'parent'}`}\n\t\t\t>\n\t\t\t\tDrag me (I attach native data)\n\t\t\t</Box>\n\t\t\t<Stack\n\t\t\t\tref={dropTargetRef}\n\t\t\t\txcss={dropTargetStyles}\n\t\t\t\ttestId={`drop-target-in-${isInIframe ? 'iframe' : 'parent'}`}\n\t\t\t\tspace=\"space.100\"\n\t\t\t>\n\t\t\t\t<Box as=\"h4\">Drop target</Box>\n\t\t\t\t<Box>Latest drop data: {latestDropData}</Box>\n\t\t\t</Stack>\n\t\t\t{!isInIframe ? (\n\t\t\t\t<Box\n\t\t\t\t\tas=\"iframe\"\n\t\t\t\t\ttitle={'child iframe'}\n\t\t\t\t\txcss={iframeStyles}\n\t\t\t\t\tsrc={window.location.href}\n\t\t\t\t\ttestId={'child-iframe'}\n\t\t\t\t/>\n\t\t\t) : null}\n\t\t</Stack>\n\t);\n}\n"
  },
  {
    "path": "packages/core/examples/native/activity-log.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { jsx } from '@emotion/react';\n\nexport function ActivityLog(): React.JSX.Element {\n\treturn <div>Activity log</div>;\n}\n"
  },
  {
    "path": "packages/core/examples/native/app.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { Fragment } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport { GlobalStyles } from '../_util/global-styles';\n\nimport { ActivityLog } from './activity-log';\nimport { Content } from './content';\nimport { DropTarget } from './drop-target';\n\nconst appStyles = css({\n\tdisplay: 'grid',\n\tgridTemplateColumns: '1fr 1fr 1fr',\n\tpadding: 'var(--grid)',\n\tgap: 'calc(var(--grid) * 2)',\n\tmaxWidth: '1000px',\n});\n\nexport function App(): React.JSX.Element {\n\treturn (\n\t\t<Fragment>\n\t\t\t<GlobalStyles />\n\t\t\t<div css={appStyles}>\n\t\t\t\t<Content />\n\t\t\t\t<DropTarget />\n\t\t\t\t<ActivityLog />\n\t\t\t</div>\n\t\t</Fragment>\n\t);\n}\n"
  },
  {
    "path": "packages/core/examples/native/content.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport Link from '@atlaskit/link';\nimport { Stack } from '@atlaskit/primitives/compiled';\nimport { token } from '@atlaskit/tokens';\n\nimport { draggable } from '../../src/entry-point/element/adapter';\nimport { scrollJustEnoughIntoView } from '../../src/entry-point/element/scroll-just-enough-into-view';\nimport { setCustomNativeDragPreview } from '../../src/entry-point/element/set-custom-native-drag-preview';\n\nimport avatarUrl from './avatar.png';\n\nconst cardStyles = css({\n\tdisplay: 'flex',\n\tflexDirection: 'column',\n\tpadding: 'var(--grid)',\n\tborderRadius: 'var(--border-radius)',\n\tboxShadow: `0px 0px 1px rgba(9, 30, 66, 0.31), 0px 1px 1px rgba(9, 30, 66, 0.25)`,\n\tuserSelect: 'none',\n\tbackground: token('elevation.surface.raised', '#FFF'),\n\twidth: '150px',\n\tjustifyContent: 'center',\n});\n\ntype CardState = 'idle' | 'generate-preview' | 'dragging';\nconst cardText: { [State in CardState]: string } = {\n\t'generate-preview': '📸 Drag preview',\n\tidle: '👋 Draggable',\n\tdragging: '🏠 Draggable source',\n};\n\nconst cardTextStyles = css({\n\tmargin: 0,\n});\nconst cardTextDraggingStyles = css({\n\tcolor: token('color.text.disabled', '#091E424F'),\n});\n\nfunction Card() {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<CardState>('idle');\n\n\tuseEffect(() => {\n\t\tconst el = ref.current;\n\t\tinvariant(el);\n\t\treturn draggable({\n\t\t\telement: el,\n\t\t\tgetInitialData: () => ({ type: 'card', itemId: 'fake-item-id-1' }),\n\t\t\tonGenerateDragPreview: ({ source }) => {\n\t\t\t\tscrollJustEnoughIntoView({ element: source.element });\n\t\t\t\tsetState('generate-preview');\n\t\t\t},\n\t\t\tonDragStart: () => setState('dragging'),\n\t\t\tonDrop: () => setState('idle'),\n\t\t});\n\t}, []);\n\n\treturn (\n\t\t<div ref={ref} css={cardStyles}>\n\t\t\t<h5 css={[cardTextStyles, state === 'dragging' ? cardTextDraggingStyles : undefined]}>\n\t\t\t\t{cardText[state]}\n\t\t\t</h5>\n\t\t</div>\n\t);\n}\n\nfunction CardWithExternal() {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<CardState>('idle');\n\n\tuseEffect(() => {\n\t\tconst el = ref.current;\n\t\tinvariant(el);\n\t\treturn draggable({\n\t\t\telement: el,\n\t\t\tgetInitialData: () => ({ type: 'card', itemId: 'fake-item-id-1' }),\n\t\t\tgetInitialDataForExternal: () => ({\n\t\t\t\t'text/uri-list': 'https://the-other-window',\n\t\t\t}),\n\t\t\tonGenerateDragPreview: ({ source }) => {\n\t\t\t\tscrollJustEnoughIntoView({ element: source.element });\n\t\t\t\tsetState('generate-preview');\n\t\t\t},\n\t\t\tonDragStart: () => setState('dragging'),\n\t\t\tonDrop: () => setState('idle'),\n\t\t});\n\t}, []);\n\n\treturn (\n\t\t<div ref={ref} css={cardStyles}>\n\t\t\t<h5 css={[cardTextStyles, state === 'dragging' ? cardTextDraggingStyles : undefined]}>\n\t\t\t\t{cardText[state]}\n\t\t\t</h5>\n\t\t\t<small>This card also attaches a url that can be dragged into external windows</small>\n\t\t\t{/* eslint-disable-next-line @atlassian/a11y/alt-text */}\n\t\t\t<img src={avatarUrl} width=\"40\" height=\"40\" />\n\t\t</div>\n\t);\n}\n\nfunction DraggableAnchor() {\n\tconst ref = useRef<HTMLAnchorElement | null>(null);\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\n\t\treturn draggable({\n\t\t\telement,\n\t\t});\n\t}, []);\n\treturn (\n\t\t<Link href=\"#controlled\" ref={ref}>\n\t\t\tAnchor that is also a draggable()\n\t\t</Link>\n\t);\n}\n\nfunction DraggableAnchorWithNewUrl() {\n\tconst ref = useRef<HTMLAnchorElement | null>(null);\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\n\t\treturn draggable({\n\t\t\telement,\n\t\t\tgetInitialDataForExternal: () => ({\n\t\t\t\t'text/uri-list': 'https://domevents.dev',\n\t\t\t\t'application/x.custom': 'My custom value',\n\t\t\t}),\n\t\t});\n\t}, []);\n\treturn (\n\t\t<Link href=\"#controlled\" ref={ref}>\n\t\t\tLink that is also a draggable() - with a new url\n\t\t</Link>\n\t);\n}\n\nfunction DraggableAnchorWithCustomPreview() {\n\tconst ref = useRef<HTMLAnchorElement | null>(null);\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\n\t\treturn draggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\tconst preview = document.createElement('div');\n\t\t\t\t\t\tpreview.textContent = 'Preview';\n\t\t\t\t\t\tObject.assign(preview.style, {\n\t\t\t\t\t\t\tpadding: '20px',\n\t\t\t\t\t\t\tbackground: 'lightblue',\n\t\t\t\t\t\t});\n\t\t\t\t\t\tcontainer.appendChild(preview);\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\t}, []);\n\treturn (\n\t\t<Link href=\"#controlled\" ref={ref}>\n\t\t\tLink that is also a draggable() (custom preview)\n\t\t</Link>\n\t);\n}\n\nfunction DraggableImage() {\n\tconst ref = useRef<HTMLImageElement | null>(null);\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\n\t\treturn draggable({\n\t\t\telement,\n\t\t});\n\t}, []);\n\t// eslint-disable-next-line @atlassian/a11y/alt-text\n\treturn <img src={avatarUrl} ref={ref} width=\"40\" height=\"40\" />;\n}\n\nfunction DraggableImageWithCustomPreview() {\n\tconst ref = useRef<HTMLImageElement | null>(null);\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\n\t\treturn draggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\tconst preview = document.createElement('div');\n\t\t\t\t\t\tpreview.textContent = 'Preview';\n\t\t\t\t\t\tObject.assign(preview.style, {\n\t\t\t\t\t\t\tpadding: '20px',\n\t\t\t\t\t\t\tbackground: 'lightblue',\n\t\t\t\t\t\t});\n\t\t\t\t\t\tcontainer.appendChild(preview);\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\t}, []);\n\t// eslint-disable-next-line @atlassian/a11y/alt-text\n\treturn <img src={avatarUrl} ref={ref} width=\"40\" height=\"40\" />;\n}\n\nexport function Content(): React.JSX.Element {\n\treturn (\n\t\t<Stack space=\"space.025\">\n\t\t\t<h4>Links</h4>\n\t\t\t<div>\n\t\t\t\t<ul>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<Link href=\"#standalone\">Standalone link</Link>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<Link href=\"#side-by\">Side by</Link>\n\t\t\t\t\t\t<Link href=\"#side-links\">side links</Link>\n\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<DraggableAnchor />\n\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<DraggableAnchorWithNewUrl />\n\t\t\t\t\t</li>\n\t\t\t\t\t<li>\n\t\t\t\t\t\t<DraggableAnchorWithCustomPreview />\n\t\t\t\t\t</li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t<h4>Text</h4>\n\t\t\t<p>Here is some plain text</p>\n\t\t\t<h4>HTML</h4>\n\t\t\t<p>\n\t\t\t\tText with{' '}\n\t\t\t\t<em>\n\t\t\t\t\tsome <strong>nested</strong>\n\t\t\t\t</em>{' '}\n\t\t\t\telements\n\t\t\t</p>\n\t\t\t<h4>Images</h4>\n\t\t\t<li>\n\t\t\t\t{/* eslint-disable-next-line @atlassian/a11y/alt-text */}\n\t\t\t\tUncontrolled <img src={avatarUrl} width=\"40\" height=\"40\" />\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\tControlled <DraggableImage />\n\t\t\t</li>\n\t\t\t<li>\n\t\t\t\tControlled with custom preview <DraggableImageWithCustomPreview />\n\t\t\t</li>\n\t\t\t<h4>Controlled draggables</h4>\n\t\t\t<Stack>\n\t\t\t\t<Card />\n\t\t\t\t<CardWithExternal />\n\t\t\t</Stack>\n\t\t</Stack>\n\t);\n}\n"
  },
  {
    "path": "packages/core/examples/native/drop-target.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport { token } from '@atlaskit/tokens';\n\nimport { combine } from '../../src/entry-point/combine';\nimport { dropTargetForElements, monitorForElements } from '../../src/entry-point/element/adapter';\nimport { dropTargetForExternal, monitorForExternal } from '../../src/entry-point/external/adapter';\nimport { getHTML } from '../../src/entry-point/external/html';\nimport { getText } from '../../src/entry-point/external/text';\nimport { getURLs } from '../../src/entry-point/external/url';\nimport { preventUnhandled } from '../../src/entry-point/prevent-unhandled';\nimport { fallbackColor } from '../_util/fallback';\n\nconst dropTargetStyles = css({\n\tdisplay: 'flex',\n\tpadding: 'calc(var(--grid) * 6) calc(var(--grid) * 4)',\n\talignItems: 'center',\n\tjustifyContent: 'center',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tbackground: token('elevation.surface.sunken', fallbackColor),\n\tborderRadius: 'var(--border-radius)',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tcolor: token('color.text.disabled', fallbackColor),\n\tfontSize: '1.4rem',\n});\n\nconst overStyles = css({\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tbackground: token('color.background.selected.hovered', fallbackColor),\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tcolor: token('color.text.selected', fallbackColor),\n});\n\nconst potentialStyles = css({\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tbackground: token('color.background.discovery', fallbackColor),\n});\n\ntype State = 'idle' | 'potential' | 'over';\n\nconst text: { [Key in State]: string } = {\n\tidle: 'Please drag something',\n\tpotential: 'Come drag over me',\n\tover: 'You can drop on me',\n};\n\nexport function DropTarget(): React.JSX.Element {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<State>('idle');\n\n\tuseEffect(() => {\n\t\tconst el = ref.current;\n\t\tinvariant(el);\n\t\treturn combine(\n\t\t\tdropTargetForElements({\n\t\t\t\telement: el,\n\t\t\t\tonDragEnter: () => setState('over'),\n\t\t\t\tonDragLeave: () => setState('potential'),\n\t\t\t}),\n\t\t\tdropTargetForExternal({\n\t\t\t\telement: el,\n\t\t\t\tonDragEnter: () => setState('over'),\n\t\t\t\tonDragLeave: () => setState('potential'),\n\t\t\t\tonDrop: ({ source }) => {\n\t\t\t\t\tconsole.log('drop', {\n\t\t\t\t\t\titems: source.items,\n\t\t\t\t\t\ttypes: source.types,\n\t\t\t\t\t});\n\t\t\t\t\tconsole.log('text', getText({ source }));\n\t\t\t\t\tconsole.log('html', getHTML({ source }));\n\t\t\t\t\tconsole.log('urls', getURLs({ source }));\n\t\t\t\t},\n\t\t\t}),\n\t\t\tmonitorForExternal({\n\t\t\t\tonDragStart: () => {\n\t\t\t\t\tsetState('potential');\n\t\t\t\t\tpreventUnhandled.start();\n\t\t\t\t},\n\t\t\t\tonDrop: () => {\n\t\t\t\t\tpreventUnhandled.stop();\n\t\t\t\t\tsetState('idle');\n\t\t\t\t},\n\t\t\t}),\n\t\t\tmonitorForElements({\n\t\t\t\tonDragStart: () => {\n\t\t\t\t\tsetState('potential');\n\t\t\t\t},\n\t\t\t\tonDrop: () => {\n\t\t\t\t\tsetState('idle');\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, []);\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tcss={[\n\t\t\t\tdropTargetStyles,\n\t\t\t\tstate === 'over' ? overStyles : state === 'potential' ? potentialStyles : undefined,\n\t\t\t]}\n\t\t>\n\t\t\t<strong>{text[state]}</strong>\n\t\t</div>\n\t);\n}\n"
  },
  {
    "path": "packages/core/examples/native.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { Fragment, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport { bindAll } from 'bind-event-listener';\nimport invariant from 'tiny-invariant';\n\nimport Lozenge from '@atlaskit/lozenge';\nimport { token } from '@atlaskit/tokens';\n\nimport { combine } from '../src/entry-point/combine';\nimport {\n\tdropTargetForElements,\n\ttype ElementDragPayload,\n\tmonitorForElements,\n} from '../src/entry-point/element/adapter';\nimport {\n\tdropTargetForExternal,\n\ttype ExternalDragPayload,\n\tmonitorForExternal,\n} from '../src/entry-point/external/adapter';\nimport { getFiles } from '../src/entry-point/external/file';\nimport { getHTML } from '../src/entry-point/external/html';\nimport { getText } from '../src/entry-point/external/text';\nimport { getURLs } from '../src/entry-point/external/url';\nimport { preventUnhandled } from '../src/entry-point/prevent-unhandled';\nimport {\n\tdropTargetForTextSelection,\n\tmonitorForTextSelection,\n\ttype TextSelectionDragPayload,\n} from '../src/entry-point/text-selection/adapter';\n\nimport { fallbackColor } from './_util/fallback';\nimport { GlobalStyles } from './_util/global-styles';\nimport { Content } from './native/content';\n\nconst dropTargetStyles = css({\n\tdisplay: 'flex',\n\tpadding: 'calc(var(--grid) * 6) calc(var(--grid) * 4)',\n\talignItems: 'center',\n\tjustifyContent: 'center',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tbackground: token('elevation.surface.sunken', fallbackColor),\n\tborderRadius: 'var(--border-radius)',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tcolor: token('color.text.disabled', fallbackColor),\n\tfontSize: '1.4rem',\n});\n\nconst overStyles = css({\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tbackground: token('color.background.selected.hovered', fallbackColor),\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tcolor: token('color.text.selected', fallbackColor),\n});\n\nconst potentialStyles = css({\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tbackground: token('color.background.discovery', fallbackColor),\n});\n\nconst appStyles = css({\n\tdisplay: 'grid',\n\tgridTemplateColumns: '1fr 1fr',\n\tpadding: 'var(--grid)',\n\tgap: 'calc(var(--grid) * 2)',\n\tmaxWidth: '800px',\n});\n\ntype DragState =\n\t| {\n\t\t\ttype: 'idle';\n\t  }\n\t| {\n\t\t\ttype: 'dragging-external';\n\t\t\tpayload: ExternalDragPayload;\n\t  }\n\t| {\n\t\t\ttype: 'dragging-text-selection';\n\t\t\tpayload: TextSelectionDragPayload;\n\t  }\n\t| {\n\t\t\ttype: 'dragging-controlled';\n\t\t\tpayload: ElementDragPayload;\n\t  };\n\nfunction CurrentlyDragging() {\n\tconst [state, setState] = useState<DragState>({ type: 'idle' });\n\tuseEffect(() => {\n\t\treturn combine(\n\t\t\tmonitorForElements({\n\t\t\t\tonDragStart: (args) => {\n\t\t\t\t\tconsole.log('drag starting');\n\t\t\t\t\tsetState({ type: 'dragging-controlled', payload: args.source });\n\t\t\t\t},\n\t\t\t\tonDrop: () => {\n\t\t\t\t\tsetState({ type: 'idle' });\n\t\t\t\t},\n\t\t\t}),\n\t\t\tmonitorForExternal({\n\t\t\t\tonDragStart: (args) => {\n\t\t\t\t\tconsole.log('drag starting');\n\t\t\t\t\tsetState({ type: 'dragging-external', payload: args.source });\n\t\t\t\t},\n\t\t\t\tonDrop: () => {\n\t\t\t\t\tsetState({ type: 'idle' });\n\t\t\t\t},\n\t\t\t}),\n\t\t\tmonitorForTextSelection({\n\t\t\t\tonDragStart: (args) => {\n\t\t\t\t\tconsole.log('drag starting');\n\t\t\t\t\tsetState({\n\t\t\t\t\t\ttype: 'dragging-text-selection',\n\t\t\t\t\t\tpayload: args.source,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDrop: () => {\n\t\t\t\t\tsetState({ type: 'idle' });\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, []);\n\n\treturn (\n\t\t<div>\n\t\t\t<h4>Drag information</h4>\n\t\t\t{state.type === 'dragging-external' ? (\n\t\t\t\t<Fragment>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<Lozenge appearance=\"new\">External</Lozenge> - drag started from outside this window\n\t\t\t\t\t</div>\n\t\t\t\t\t{state.payload.types.length} data types being dragged\n\t\t\t\t\t<ul>\n\t\t\t\t\t\t{state.payload.types.map((value) => (\n\t\t\t\t\t\t\t<li key={value}>{value}</li>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</ul>\n\t\t\t\t</Fragment>\n\t\t\t) : state.type === 'dragging-text-selection' ? (\n\t\t\t\t<Fragment>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<Lozenge appearance=\"new\">Internal (text selection)</Lozenge>\n\t\t\t\t\t</div>\n\t\t\t\t\t<h3>Plain</h3>\n\t\t\t\t\t{/* eslint-disable-next-line @atlaskit/design-system/no-html-code */}\n\t\t\t\t\t<code>{state.payload.plain}</code>\n\t\t\t\t\t<h3>HTML</h3>\n\t\t\t\t\t{/* eslint-disable-next-line @atlaskit/design-system/no-html-code */}\n\t\t\t\t\t<code>{state.payload.HTML}</code>\n\t\t\t\t</Fragment>\n\t\t\t) : state.type === 'dragging-controlled' ? (\n\t\t\t\t<Fragment>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<Lozenge appearance=\"new\">Internal (controlled)</Lozenge>\n\t\t\t\t\t</div>\n\t\t\t\t\tData: <pre>{JSON.stringify(state.payload.data)}</pre>\n\t\t\t\t</Fragment>\n\t\t\t) : (\n\t\t\t\t<em>No active drag detected</em>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nfunction DropTarget() {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<'idle' | 'potential' | 'over'>('idle');\n\n\tuseEffect(() => {\n\t\tfunction log(event: DragEvent) {\n\t\t\tconsole.group(event.type);\n\t\t\tconsole.log(\n\t\t\t\tevent.dataTransfer?.types.reduce(\n\t\t\t\t\t(acc: Record<string, string | undefined>, current: string) => {\n\t\t\t\t\t\tacc[current] = event.dataTransfer?.getData(current);\n\t\t\t\t\t\treturn acc;\n\t\t\t\t\t},\n\t\t\t\t\t{},\n\t\t\t\t),\n\t\t\t);\n\n\t\t\tconsole.groupEnd();\n\t\t}\n\t\treturn bindAll(window, [\n\t\t\t{\n\t\t\t\ttype: 'dragstart',\n\t\t\t\tlistener: log,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'drop',\n\t\t\t\tlistener: log,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'drop',\n\t\t\t\tlistener(event) {\n\t\t\t\t\tconst files = Array.from(event.dataTransfer?.items ?? []).filter(\n\t\t\t\t\t\t(item) => item.kind === 'file',\n\t\t\t\t\t);\n\t\t\t\t\tconsole.log('files', files);\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'dragenter',\n\t\t\t\tlistener(event) {\n\t\t\t\t\t// allow drop anywhere\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'dragover',\n\t\t\t\tlistener(event) {\n\t\t\t\t\t// allow drop anywhere\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\t}, []);\n\n\tuseEffect(() => {\n\t\tconst el = ref.current;\n\t\tinvariant(el);\n\t\treturn combine(\n\t\t\tdropTargetForElements({\n\t\t\t\telement: el,\n\t\t\t\tonDragEnter: () => setState('over'),\n\t\t\t\tonDragLeave: () => setState('potential'),\n\t\t\t}),\n\t\t\tdropTargetForExternal({\n\t\t\t\telement: el,\n\t\t\t\tonDragEnter: () => setState('over'),\n\t\t\t\tonDragLeave: () => setState('potential'),\n\t\t\t\tonDrop: ({ source }) => {\n\t\t\t\t\tconsole.log('drop: native', {\n\t\t\t\t\t\titems: source.items,\n\t\t\t\t\t\ttypes: source.types,\n\t\t\t\t\t});\n\t\t\t\t\tconsole.log('drop: access', {\n\t\t\t\t\t\ttext: getText({ source }),\n\t\t\t\t\t\turls: getURLs({ source }),\n\t\t\t\t\t\thtml: getHTML({ source }),\n\t\t\t\t\t\tfiles: getFiles({ source }),\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdropTargetForTextSelection({\n\t\t\t\telement: el,\n\t\t\t\tonDragStart: () => setState('over'),\n\t\t\t\tonDragEnter: () => setState('over'),\n\t\t\t\tonDragLeave: () => setState('potential'),\n\t\t\t\tonDrop: ({ source }) => {\n\t\t\t\t\tconsole.log('drop: text selection', source);\n\t\t\t\t},\n\t\t\t}),\n\t\t\tmonitorForExternal({\n\t\t\t\tonDragStart: () => {\n\t\t\t\t\tsetState('potential');\n\t\t\t\t\tpreventUnhandled.start();\n\t\t\t\t},\n\t\t\t\tonDrop: () => {\n\t\t\t\t\tpreventUnhandled.stop();\n\t\t\t\t\tsetState('idle');\n\t\t\t\t},\n\t\t\t}),\n\t\t\tmonitorForTextSelection({\n\t\t\t\tonDragStart: () => {\n\t\t\t\t\tsetState('potential');\n\t\t\t\t\tpreventUnhandled.start();\n\t\t\t\t},\n\t\t\t\tonDrop: () => {\n\t\t\t\t\tpreventUnhandled.stop();\n\t\t\t\t\tsetState('idle');\n\t\t\t\t},\n\t\t\t}),\n\t\t\tmonitorForElements({\n\t\t\t\tonDragStart: () => {\n\t\t\t\t\tsetState('potential');\n\t\t\t\t},\n\t\t\t\tonDrop: () => {\n\t\t\t\t\tsetState('idle');\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, []);\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tcss={[\n\t\t\t\tdropTargetStyles,\n\t\t\t\tstate === 'over' ? overStyles : state === 'potential' ? potentialStyles : undefined,\n\t\t\t]}\n\t\t>\n\t\t\t<strong>Drag onto me!</strong>\n\t\t</div>\n\t);\n}\n\nfunction App() {\n\treturn (\n\t\t<div css={appStyles}>\n\t\t\t<Content />\n\t\t\t<div>\n\t\t\t\t<DropTarget />\n\t\t\t\t<CurrentlyDragging />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport default function Example(): React.JSX.Element {\n\treturn (\n\t\t<Fragment>\n\t\t\t<GlobalStyles />\n\t\t\t<App />\n\t\t</Fragment>\n\t);\n}\n"
  },
  {
    "path": "packages/core/examples/post-drop-bug-fix-simple.tsx",
    "content": "import React, { useEffect, useRef, useState } from 'react';\n\nimport invariant from 'tiny-invariant';\n\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Stack, xcss } from '@atlaskit/primitives';\n\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\tmonitorForElements,\n} from '../src/entry-point/element/adapter';\nimport { combine } from '../src/public-utils/combine';\n\nconst interactiveStyles = xcss({\n\tposition: 'relative',\n\t'::before': {\n\t\tcontent: '\"\"',\n\t\tposition: 'absolute',\n\t\tpointerEvents: 'none',\n\t\ttop: 'space.0',\n\t\tleft: 'space.0',\n\t\tpadding: 'space.100',\n\t},\n\t':hover::before': {\n\t\tcontent: '\":hover\"',\n\t\tbackgroundColor: 'color.background.accent.green.subtler',\n\t},\n});\n\nconst cardStyles = xcss({\n\tboxShadow: 'elevation.shadow.raised',\n\tbackgroundColor: 'elevation.surface.raised',\n\tjustifyContent: 'center',\n\tpadding: 'space.100',\n\ttextAlign: 'center',\n\tposition: 'relative',\n\tflexShrink: 0,\n\tborderWidth: 'border.width',\n\tborderColor: 'color.border',\n\tborderStyle: 'solid',\n});\n\nconst listStyles = xcss({\n\tdisplay: 'flex',\n\talignItems: 'stretch',\n\tflexDirection: 'column',\n\twidth: '600px',\n\tmargin: '0 auto',\n\tbackground: 'elevation.surface.sunken',\n\theight: '500px',\n\toverflow: 'scroll',\n\tposition: 'relative',\n});\n\nconst isOverCardStyles = xcss({\n\tbackgroundColor: 'color.background.accent.blue.subtle',\n});\n\nfunction Card({ cardId }: { cardId: string }) {\n\tconst [counts, setCounts] = useState<{\n\t\tdragstart: number;\n\t\tdrop: number;\n\t\tclick: number;\n\t\tmouseenter: number;\n\t\tmouseleave: number;\n\t}>({\n\t\tdragstart: 0,\n\t\tdrop: 0,\n\t\tclick: 0,\n\t\tmouseenter: 0,\n\t\tmouseleave: 0,\n\t});\n\tconst [state, setState] = useState<'idle' | 'is-over'>('idle');\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\n\t\treturn combine(\n\t\t\tdraggable({\n\t\t\t\telement,\n\t\t\t\tgetInitialData: () => ({ cardId }),\n\t\t\t\tonDragStart: () =>\n\t\t\t\t\tsetCounts((current) => ({ ...current, dragstart: current.dragstart + 1 })),\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement,\n\t\t\t\tgetData: () => ({ cardId }),\n\t\t\t\tonDragStart: () => setState('is-over'),\n\t\t\t\tonDragEnter: () => setState('is-over'),\n\t\t\t\tonDragLeave: () => setState('idle'),\n\t\t\t\tonDrop: () => {\n\t\t\t\t\tsetCounts((current) => ({ ...current, drop: current.drop + 1 }));\n\t\t\t\t\tsetState('idle');\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [cardId]);\n\n\treturn (\n\t\t// eslint-disable-next-line @atlassian/a11y/interactive-element-not-keyboard-focusable\n\t\t<Box\n\t\t\tref={ref}\n\t\t\txcss={[cardStyles, interactiveStyles, state === 'is-over' ? isOverCardStyles : undefined]}\n\t\t\ttestId={cardId}\n\t\t\tonMouseEnter={() => {\n\t\t\t\tsetCounts((current) => ({ ...current, mouseenter: current.mouseenter + 1 }));\n\t\t\t}}\n\t\t\tonMouseLeave={() => {\n\t\t\t\tsetCounts((current) => ({ ...current, mouseleave: current.mouseleave + 1 }));\n\t\t\t}}\n\t\t\tonClick={() => setCounts((current) => ({ ...current, click: current.click + 1 }))}\n\t\t>\n\t\t\t{cardId}{' '}\n\t\t\t<small>\n\t\t\t\tmouseenter:{counts.mouseenter} mouseleave:{counts.mouseleave} dragstart:{counts.dragstart}{' '}\n\t\t\t\tdrop:\n\t\t\t\t{counts.drop}\n\t\t\t</small>\n\t\t</Box>\n\t);\n}\n\ntype Card = {\n\tid: string;\n};\nfunction getCards() {\n\treturn Array.from({ length: 30 }, (_, index) => ({\n\t\tid: `card-${index}`,\n\t}));\n}\n\nconst titleStyles = xcss({\n\ttextAlign: 'center',\n});\n\nfunction DropTest() {\n\tconst [cards, setCards] = useState<Card[]>(() => getCards());\n\tconst [dragCount, setDragCount] = useState<number>(0);\n\tuseEffect(() => {\n\t\treturn monitorForElements({\n\t\t\tonDrop(args) {\n\t\t\t\tconst destination = args.location.current.dropTargets[0];\n\t\t\t\tif (!destination) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst startIndex = cards.findIndex((card) => card.id === args.source.data.cardId);\n\t\t\t\tconst finishIndex = cards.findIndex((card) => card.id === destination.data.cardId);\n\n\t\t\t\t// swapping\n\t\t\t\tconst newList = [...cards];\n\t\t\t\tnewList[startIndex] = cards[finishIndex];\n\t\t\t\tnewList[finishIndex] = cards[startIndex];\n\n\t\t\t\tsetCards(newList);\n\t\t\t\tsetDragCount((current) => current + 1);\n\t\t\t},\n\t\t});\n\t}, [cards]);\n\n\treturn (\n\t\t<Stack space=\"space.100\">\n\t\t\t<Box as=\"h4\" xcss={titleStyles}>\n\t\t\t\tSwap items on drop\n\t\t\t</Box>\n\t\t\t<Box as=\"h5\" xcss={titleStyles} testId=\"drag-count\">\n\t\t\t\tDrags completed: {dragCount}\n\t\t\t</Box>\n\t\t\t<Box\n\t\t\t\txcss={[listStyles, interactiveStyles]}\n\t\t\t\ttabIndex={0}\n\t\t\t\ttestId=\"scroll-container\"\n\t\t\t\trole=\"region\"\n\t\t\t\taria-label=\"Scrollable content\"\n\t\t\t>\n\t\t\t\t{cards.map((card) => {\n\t\t\t\t\treturn <Card key={card.id} cardId={card.id} />;\n\t\t\t\t})}\n\t\t\t</Box>\n\t\t</Stack>\n\t);\n}\n\nexport default function Example(): React.JSX.Element {\n\treturn <DropTest />;\n}\n"
  },
  {
    "path": "packages/core/examples/post-drop-bug-fix.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { createContext, Fragment, useContext, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport { Stack } from '@atlaskit/primitives/compiled';\nimport { token } from '@atlaskit/tokens';\n\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\tmonitorForElements,\n} from '../src/entry-point/element/adapter';\nimport { dropTargetForExternal } from '../src/entry-point/external/adapter';\nimport { dropTargetForTextSelection } from '../src/entry-point/text-selection/adapter';\nimport { combine } from '../src/public-utils/combine';\nimport { reorder } from '../src/public-utils/reorder';\n\nimport { fallbackColor } from './_util/fallback';\nimport { GlobalStyles } from './_util/global-styles';\n\n// I was hoping to use this example for browser testing,\n// but puppeteer does not replicate the browser bug.\n// I think it best to keep this example around as it makes it\n// easy to debug the browser bug and the fix\n\nconst interactiveStyles = css({\n\tposition: 'relative',\n\t'&::before': {\n\t\tcontent: '\"\"',\n\t\tposition: 'absolute',\n\t\tpointerEvents: 'none',\n\t\t// zIndex: ,\n\t\ttop: 0,\n\t\tleft: 0,\n\t\tpadding: 'var(--grid)',\n\t},\n\t'&:hover::before': {\n\t\tcontent: '\":hover\"',\n\t\tbackground: token('color.background.accent.green.subtler', 'transparent'),\n\t},\n\t'&:active::before': {\n\t\tcontent: '\":active\"',\n\t\tbackground: token('color.background.accent.blue.subtler', 'transparent'),\n\t},\n});\n\nconst cardStyles = css({\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tboxShadow: token('elevation.shadow.raised', fallbackColor),\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tbackground: token('elevation.surface.raised', fallbackColor),\n\tjustifyContent: 'center',\n\tborderRadius: 'var(--border-radius)',\n\tpadding: 'var(--grid)',\n\ttextAlign: 'center',\n\n\tposition: 'relative',\n\t// userSelect: 'none',\n\tflexShrink: 0,\n});\n\nconst listStyles = css({\n\tdisplay: 'flex',\n\talignItems: 'stretch',\n\tflexDirection: 'column',\n\t// gap: 'calc(var(--grid)* 2)',\n\twidth: 240,\n\tmargin: '0 auto',\n\tpadding: 'calc(var(--grid) * 6)',\n\tbackground: token('elevation.surface.sunken', '#F7F8F9'),\n\n\theight: '500px',\n\toverflow: 'scroll',\n\n\tposition: 'relative',\n});\n\n// const stackStyles = css({\n// \tdisplay: 'flex',\n// \tflexDirection: 'column',\n// \tgap: 'var(--grid)',\n\n// \t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766\n// \t'> *': {\n// \t\tmargin: 0,\n// \t},\n// });\n\nconst TypeContext = createContext<string>('unknown');\n\nconst isOverCardStyles = css({\n\tbackground: token('color.interaction.hovered', 'transparent'),\n});\n\nfunction Card({\n\tcardId,\n\tisSticky,\n\tisDraggable,\n}: {\n\tcardId: string;\n\tisSticky: boolean;\n\tisDraggable: boolean;\n}) {\n\tconst [counts, setCounts] = useState<{\n\t\tclick: number;\n\t\tenter: number;\n\t\tleave: number;\n\t}>({\n\t\tclick: 0,\n\t\tenter: 0,\n\t\tleave: 0,\n\t});\n\tconst [state, setState] = useState<'idle' | 'is-over'>('idle');\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tconst typeContext = useContext(TypeContext);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\n\t\treturn combine(\n\t\t\tdraggable({\n\t\t\t\telement,\n\t\t\t\tgetInitialData: () => ({ cardId, typeContext }),\n\t\t\t\tonGenerateDragPreview(args) {\n\t\t\t\t\t// console.warn('onGenerateDragPreview');\n\t\t\t\t},\n\t\t\t\tonDragStart(args) {\n\t\t\t\t\t// console.warn('onDragStart');\n\t\t\t\t},\n\t\t\t\tonDrop(args) {\n\t\t\t\t\t// console.warn('onDrop');\n\t\t\t\t},\n\t\t\t\tonDropTargetChange({ location }) {\n\t\t\t\t\t// console.warn('onDropTargetChange', location);\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement,\n\t\t\t\tgetData: () => ({ cardId }),\n\t\t\t\tcanDrop: (args) => args.source.data.typeContext === typeContext,\n\t\t\t\tgetIsSticky: () => isSticky,\n\t\t\t\tonDragStart: () => setState('is-over'),\n\t\t\t\tonDragEnter: () => setState('is-over'),\n\t\t\t\tonDragLeave: () => setState('idle'),\n\t\t\t\tonDrop: () => setState('idle'),\n\t\t\t}),\n\t\t\tdropTargetForTextSelection({\n\t\t\t\telement,\n\t\t\t\tgetData: () => ({ cardId }),\n\t\t\t\tgetIsSticky: () => isSticky,\n\t\t\t\tonDragStart: () => setState('is-over'),\n\t\t\t\tonDragEnter: () => setState('is-over'),\n\t\t\t\tonDragLeave: () => setState('idle'),\n\t\t\t\tonDrop: () => setState('idle'),\n\t\t\t}),\n\t\t\tdropTargetForExternal({\n\t\t\t\telement,\n\t\t\t\tgetData: () => ({ cardId }),\n\t\t\t\tgetIsSticky: () => isSticky,\n\t\t\t\tonDragEnter: () => setState('is-over'),\n\t\t\t\tonDragLeave: () => setState('idle'),\n\t\t\t\tonDrop: () => setState('idle'),\n\t\t\t}),\n\t\t);\n\t}, [cardId, typeContext, isSticky, isDraggable]);\n\n\treturn (\n\t\t// eslint-disable-next-line @atlassian/a11y/click-events-have-key-events, @atlassian/a11y/interactive-element-not-keyboard-focusable, @atlassian/a11y/no-static-element-interactions\n\t\t<div\n\t\t\tref={ref}\n\t\t\tcss={[cardStyles, interactiveStyles, state === 'is-over' ? isOverCardStyles : undefined]}\n\t\t\tdata-testid={`${typeContext}-${cardId}`}\n\t\t\t// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events\n\t\t\tonMouseEnter={(event) => {\n\t\t\t\tconsole.log('onMouseEnter', cardId, { clientX: event.clientX, clientY: event.clientY });\n\t\t\t\tsetCounts((current) => ({ ...current, enter: current.enter + 1 }));\n\t\t\t\t// }\n\t\t\t}}\n\t\t\t// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events\n\t\t\tonMouseLeave={() => {\n\t\t\t\tsetCounts((current) => ({ ...current, leave: current.leave + 1 }));\n\t\t\t}}\n\t\t\tonClick={() => setCounts((current) => ({ ...current, click: current.click + 1 }))}\n\t\t>\n\t\t\t{cardId}{' '}\n\t\t\t<small>\n\t\t\t\tclick {counts.click} enter {counts.enter} leave {counts.leave}\n\t\t\t</small>\n\t\t</div>\n\t);\n}\n\ntype Card = {\n\tid: string;\n};\nfunction getCards() {\n\treturn Array.from({ length: 30 }, (_, index) => ({\n\t\tid: `card-${index}`,\n\t}));\n}\n\nconst rowStyles = css({\n\tflexDirection: 'row',\n\theight: 'auto',\n\twidth: '70vw',\n});\n\nfunction DropTest({ layout }: { layout: 'vertical' | 'horizontal' }) {\n\tconst [cards, setCards] = useState<Card[]>(() => getCards());\n\tconst [typeContext] = useState<string>('drop');\n\tuseEffect(() => {\n\t\treturn monitorForElements({\n\t\t\tcanMonitor: ({ source }) => source.data.typeContext === typeContext,\n\t\t\tonDrop(args) {\n\t\t\t\tconst destination = args.location.current.dropTargets[0];\n\t\t\t\tif (!destination) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst startIndex = cards.findIndex((card) => card.id === args.source.data.cardId);\n\t\t\t\tconst finishIndex = cards.findIndex((card) => card.id === destination.data.cardId);\n\n\t\t\t\t// swapping\n\t\t\t\tconst newList = [...cards];\n\t\t\t\tnewList[startIndex] = cards[finishIndex];\n\t\t\t\tnewList[finishIndex] = cards[startIndex];\n\n\t\t\t\tsetCards(newList);\n\t\t\t},\n\t\t});\n\t}, [typeContext, cards]);\n\n\treturn (\n\t\t<TypeContext.Provider value={typeContext}>\n\t\t\t<Stack space=\"space.100\">\n\t\t\t\t<h3>Drop test</h3>\n\t\t\t\t<strong>Swap items on drop</strong>\n\t\t\t\t<div css={[listStyles, interactiveStyles, layout === 'horizontal' ? rowStyles : undefined]}>\n\t\t\t\t\t{cards.map((card, index) => {\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<Card key={card.id} cardId={card.id} isSticky={false} isDraggable={index % 2 === 0} />\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</div>\n\t\t\t</Stack>\n\t\t</TypeContext.Provider>\n\t);\n}\n\nfunction DragEndTest() {\n\tconst [cards, setCards] = useState<Card[]>(() => getCards());\n\tconst [typeContext] = useState<string>('dragend');\n\n\tuseEffect(() => {\n\t\treturn monitorForElements({\n\t\t\tcanMonitor: ({ source }) => source.data.typeContext === typeContext,\n\t\t\tonDrop(args) {\n\t\t\t\tif (!args.location.current.dropTargets.length) {\n\t\t\t\t\tsetCards(reorder({ list: cards, startIndex: 0, finishIndex: 1 }));\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\t}, [typeContext, cards]);\n\n\treturn (\n\t\t<TypeContext.Provider value={typeContext}>\n\t\t\t<Stack space=\"space.100\">\n\t\t\t\t<h3>Dragend test</h3>\n\t\t\t\t<strong>Swap first two cards on unsuccessful drag</strong>\n\t\t\t\t<div\n\t\t\t\t\tcss={[listStyles, interactiveStyles]}\n\t\t\t\t\t// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events\n\t\t\t\t\tonMouseOver={(event) => console.error(event.type, event.target)}\n\t\t\t\t\tonMouseEnter={(event) => console.error(event.type, event.target)}\n\t\t\t\t\t// eslint-disable-next-line @atlassian/a11y/mouse-events-have-key-events\n\t\t\t\t\tonMouseLeave={(event) => console.error(event.type, event.target)}\n\t\t\t\t>\n\t\t\t\t\t{cards.map((card) => {\n\t\t\t\t\t\treturn <Card key={card.id} cardId={card.id} isSticky={false} isDraggable={true} />;\n\t\t\t\t\t})}\n\t\t\t\t</div>\n\t\t\t</Stack>\n\t\t</TypeContext.Provider>\n\t);\n}\n\nconst exampleStyles = css({\n\tdisplay: 'flex',\n\tflexWrap: 'wrap',\n\tflexDirection: 'row',\n\ttextAlign: 'center',\n\tjustifyContent: 'center',\n\tgap: 'calc(var(--grid) * 2)',\n});\n\nexport default function Example(): React.JSX.Element {\n\t// useTest();\n\t// useKillCPU();\n\t// useDebug();\n\t// usePrintAllEvents();\n\t// usePrintSomeEvents();\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<GlobalStyles />\n\t\t\t<div css={[exampleStyles, interactiveStyles]}>\n\t\t\t\t<DropTest layout=\"vertical\" />\n\t\t\t</div>\n\t\t\t<div css={[exampleStyles, interactiveStyles]}>\n\t\t\t\t<DropTest layout=\"horizontal\" />\n\t\t\t</div>\n\t\t\t<div css={[exampleStyles, interactiveStyles]}>\n\t\t\t\t<DragEndTest />\n\t\t\t</div>\n\t\t</Fragment>\n\t);\n}\n\n// function usePrintSomeEvents() {\n// \tuseEffect(() => {\n// \t\tlet pointerDown: { x: number; y: number } | null = null;\n// \t\treturn bindAll(window, [\n// \t\t\t{\n// \t\t\t\ttype: 'pointerdown',\n// \t\t\t\tlistener(event) {\n// \t\t\t\t\tpointerDown = { x: event.clientX, y: event.clientY };\n// \t\t\t\t\tconsole.warn(event.type, pointerDown);\n\n// \t\t\t\t\tfunction cleanup() {\n// \t\t\t\t\t\tunbindPointerMove();\n// \t\t\t\t\t}\n\n// \t\t\t\t\tconst unbindPointerMove = bindAll(window, [\n// \t\t\t\t\t\t{\n// \t\t\t\t\t\t\ttype: 'pointermove',\n// \t\t\t\t\t\t\tlistener(event) {\n// \t\t\t\t\t\t\t\tconsole.log('useDebug()', event.type, { x: event.clientX, y: event.clientY });\n// \t\t\t\t\t\t\t},\n// \t\t\t\t\t\t},\n// \t\t\t\t\t\t{\n// \t\t\t\t\t\t\ttype: 'pointerup',\n// \t\t\t\t\t\t\tlistener: cleanup,\n// \t\t\t\t\t\t},\n// \t\t\t\t\t\t// {\n// \t\t\t\t\t\t// \ttype: 'dragstart',\n// \t\t\t\t\t\t// \tlistener: cleanup,\n// \t\t\t\t\t\t// },\n// \t\t\t\t\t]);\n// \t\t\t\t},\n// \t\t\t},\n\n// \t\t\t{\n// \t\t\t\ttype: 'dragstart',\n// \t\t\t\tlistener(event) {\n// \t\t\t\t\tconst dragStart = { x: event.clientX, y: event.clientY };\n// \t\t\t\t\tconst isEqual = Boolean(\n// \t\t\t\t\t\tpointerDown &&\n// \t\t\t\t\t\t\tMath.floor(pointerDown.x) === dragStart.x &&\n// \t\t\t\t\t\t\tMath.floor(pointerDown.y) === dragStart.y,\n// \t\t\t\t\t);\n// \t\t\t\t\tconsole.group('DRAGSTART');\n// \t\t\t\t\tconsole.log(event.type, dragStart, 'is equal to pointer down?', isEqual);\n\n// \t\t\t\t\tbindAll(window, [\n// \t\t\t\t\t\t{\n// \t\t\t\t\t\t\ttype: 'drag',\n// \t\t\t\t\t\t\tlistener(event) {\n// \t\t\t\t\t\t\t\tconsole.log('first', event.type, { x: event.clientX, y: event.clientY });\n// \t\t\t\t\t\t\t},\n// \t\t\t\t\t\t\toptions: { once: true },\n// \t\t\t\t\t\t},\n// \t\t\t\t\t\t{\n// \t\t\t\t\t\t\ttype: 'dragover',\n// \t\t\t\t\t\t\tlistener(event) {\n// \t\t\t\t\t\t\t\tconsole.log('first', event.type, { x: event.clientX, y: event.clientY });\n// \t\t\t\t\t\t\t},\n// \t\t\t\t\t\t\toptions: { once: true },\n// \t\t\t\t\t\t},\n// \t\t\t\t\t]);\n// \t\t\t\t},\n// \t\t\t},\n\n// \t\t\t{\n// \t\t\t\ttype: 'dragend',\n// \t\t\t\tlistener() {\n// \t\t\t\t\tconsole.groupEnd();\n// \t\t\t\t},\n// \t\t\t},\n// \t\t]);\n// \t}, []);\n// }\n\n// function usePrintAllEvents() {\n// \tuseEffect(() => {\n// \t\tconst keys = Object.keys(window)\n// \t\t\t.filter((key) => key.startsWith('on'))\n// \t\t\t.map((key) => key.split('on')[1]);\n\n// \t\tconsole.log('keys', keys);\n\n// \t\treturn bindAll(\n// \t\t\twindow,\n// \t\t\tkeys.map((key): Binding<Window, any> => {\n// \t\t\t\treturn {\n// \t\t\t\t\ttype: key as any,\n// \t\t\t\t\tlistener(event) {\n// \t\t\t\t\t\tconsole.log(event.type, event.target, {\n// \t\t\t\t\t\t\tclientX: event.clientX ?? 0,\n// \t\t\t\t\t\t\tclientY: event.clientY ?? 0,\n// \t\t\t\t\t\t});\n// \t\t\t\t\t},\n// \t\t\t\t\toptions: { capture: true },\n// \t\t\t\t};\n// \t\t\t}),\n// \t\t);\n// \t}, []);\n// }\n\n// function useDebug() {\n// \tuseEffect(() => {\n// \t\tconst events = [\n// \t\t\t// 'mousemove',\n// \t\t\t// 'mouseup',\n// \t\t\t// 'mousedown',\n// \t\t\t// 'mouseover',\n// \t\t\t// 'mouseout',\n// \t\t\t// 'mouseleave',\n// \t\t\t// 'mouseenter',\n// \t\t\t// 'click',\n// \t\t\t// 'focusin',\n// \t\t\t// 'focusout',\n// \t\t\t'pointermove',\n// \t\t\t'pointercancel',\n// \t\t\t'drop',\n// \t\t\t'dragend',\n// \t\t\t// 'drag',\n// \t\t\t'dragstart',\n// \t\t\t'dragleave',\n// \t\t] as const;\n\n// \t\treturn bindAll(\n// \t\t\twindow,\n// \t\t\tevents.map((v) => ({\n// \t\t\t\ttype: v,\n// \t\t\t\tlistener: (event: Event) => {\n// \t\t\t\t\tconsole.log('event:', event.type, {\n// \t\t\t\t\t\ttarget: event.target,\n// \t\t\t\t\t\trelatedTarget: (event as MouseEvent).relatedTarget,\n// \t\t\t\t\t\tclientX: (event as MouseEvent).clientX,\n// \t\t\t\t\t\tclientY: (event as MouseEvent).clientY,\n// \t\t\t\t\t});\n// \t\t\t\t},\n// \t\t\t\toptions: { capture: true },\n// \t\t\t})),\n// \t\t);\n// \t}, []);\n// }\n\n// function useTest() {\n// \tuseEffect(() => {\n// \t\tlet lastDragOver: Position = { x: 0, y: 0 };\n\n// \t\tfunction isEqual(a: Position, b: Position): boolean {\n// \t\t\treturn a.x === b.x && a.y === b.y;\n// \t\t}\n\n// \t\tfunction check(event: DragEvent) {\n// \t\t\tconst current = {\n// \t\t\t\tx: event.clientX,\n// \t\t\t\ty: event.clientY,\n// \t\t\t};\n// \t\t\tconsole.log(event.type, current, {\n// \t\t\t\tcurrent: document.elementFromPoint(current.x, current.y),\n// \t\t\t\tlastDragOver: document.elementFromPoint(lastDragOver.x, lastDragOver.y),\n// \t\t\t});\n// \t\t\tif (!isEqual(lastDragOver, current)) {\n// \t\t\t\tconst message = `\"${event.type}\" does not match`;\n// \t\t\t\tconsole.error(message, { lastDragOver, current });\n// \t\t\t\talert(message);\n// \t\t\t}\n// \t\t}\n\n// \t\treturn bindAll(window, [\n// \t\t\t{\n// \t\t\t\ttype: 'dragover',\n// \t\t\t\tlistener(event) {\n// \t\t\t\t\tconst current = {\n// \t\t\t\t\t\tx: event.clientX,\n// \t\t\t\t\t\ty: event.clientY,\n// \t\t\t\t\t};\n// \t\t\t\t\tlastDragOver = current;\n// \t\t\t\t},\n// \t\t\t},\n// \t\t\t{\n// \t\t\t\ttype: 'drop',\n// \t\t\t\tlistener: check,\n// \t\t\t},\n// \t\t\t{\n// \t\t\t\ttype: 'dragend',\n// \t\t\t\tlistener: check,\n// \t\t\t},\n// \t\t]);\n// \t}, []);\n// }\n\n// function useKillCPU() {\n// \tuseEffect(() => {\n// \t\t// let timeSinceLastFrame = performance.now();\n// \t\tlet frameId = requestAnimationFrame(loop);\n// \t\tfunction loop() {\n// \t\t\t// timeSinceLastFrame = performance.now() - timeSinceLastFrame;\n// \t\t\t// console.log({ framesPerSecond = timeSinceLastFrame / 60 });\n\n// \t\t\tconst start = Date.now();\n// \t\t\twhile (Date.now() - start < 100) {\n// \t\t\t\t// burn\n// \t\t\t}\n// \t\t\t// console.log('done');\n// \t\t\tframeId = requestAnimationFrame(loop);\n// \t\t}\n\n// \t\treturn () => cancelAnimationFrame(frameId);\n// \t}, []);\n// }\n"
  },
  {
    "path": "packages/core/examples/preserve-offset-on-source.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { Fragment, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx, type SerializedStyles } from '@emotion/react';\nimport ReactDOM from 'react-dom';\n\nimport { combine } from '../src/entry-point/combine';\nimport { draggable, dropTargetForElements } from '../src/entry-point/element/adapter';\nimport { setCustomNativeDragPreview } from '../src/entry-point/element/set-custom-native-drag-preview';\nimport { preserveOffsetOnSource } from '../src/public-utils/element/custom-native-drag-preview/preserve-offset-on-source';\n\ntype CardDragState = 'idle' | 'preview' | 'dragging';\n\nconst cardDragStateStyles: Partial<Record<CardDragState, SerializedStyles>> = {\n\tdragging: css({\n\t\topacity: 0.4,\n\t}),\n};\n\nconst cardStyles = css({\n\twidth: '200px',\n\tborder: '1px solid red',\n\tboxSizing: 'border-box',\n});\n\nfunction Card({ id, isPreview = false }: { id: string; isPreview?: boolean }) {\n\tconst cardRef = useRef<HTMLDivElement | null>(null);\n\tconst [dragState, setDragState] = useState<CardDragState>('idle');\n\tconst [previewContainer, setPreviewContainer] = useState<HTMLElement | null>(null);\n\n\tuseEffect(() => {\n\t\tif (!cardRef.current) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn combine(\n\t\t\tdraggable({\n\t\t\t\telement: cardRef.current,\n\t\t\t\tcanDrag: () => !isPreview,\n\t\t\t\tonGenerateDragPreview: ({ nativeSetDragImage, location, source }) => {\n\t\t\t\t\tsetDragState('preview');\n\t\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\t\tgetOffset: preserveOffsetOnSource({\n\t\t\t\t\t\t\telement: source.element,\n\t\t\t\t\t\t\tinput: location.current.input,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\trender: ({ container }) => {\n\t\t\t\t\t\t\tsetPreviewContainer(container);\n\t\t\t\t\t\t\treturn () => {\n\t\t\t\t\t\t\t\tsetPreviewContainer(null);\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tgetInitialData() {\n\t\t\t\t\treturn { id };\n\t\t\t\t},\n\t\t\t\tonDragStart() {\n\t\t\t\t\tsetDragState('dragging');\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tsetDragState('idle');\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement: cardRef.current,\n\t\t\t\tgetData() {\n\t\t\t\t\treturn { id };\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [id, isPreview]);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<div ref={cardRef} css={[cardStyles, cardDragStateStyles[dragState]]}>\n\t\t\t\t{`id: ${id}`}\n\t\t\t</div>\n\t\t\t{previewContainer\n\t\t\t\t? ReactDOM.createPortal(<Card id={id} isPreview />, previewContainer)\n\t\t\t\t: null}\n\t\t</Fragment>\n\t);\n}\n\nconst cardListStyles = css({\n\tpadding: 0,\n\tlistStyle: 'none',\n});\n\nfunction CardList({ cardIds }: { cardIds: string[] }) {\n\treturn (\n\t\t<ul css={cardListStyles}>\n\t\t\t{cardIds.map((id) => (\n\t\t\t\t<li>\n\t\t\t\t\t<Card id={id} />\n\t\t\t\t</li>\n\t\t\t))}\n\t\t</ul>\n\t);\n}\n\nexport default function Example(): React.JSX.Element {\n\tconst cardIds = ['A', 'B', 'C', 'D', 'E'];\n\n\treturn <CardList cardIds={cardIds} />;\n}\n"
  },
  {
    "path": "packages/core/examples/scroll-just-enough-into-view.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { Fragment, type ReactNode, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport { token } from '@atlaskit/tokens';\n\nimport { draggable, dropTargetForElements } from '../src/entry-point/element/adapter';\nimport { scrollJustEnoughIntoView } from '../src/public-utils/element/scroll-just-enough-into-view';\n\nimport { fallbackColor } from './_util/fallback';\nimport { GlobalStyles } from './_util/global-styles';\n\nconst cardHeight = 48;\nconst numCards = 3;\n\nconst cardStyles = css({\n\theight: cardHeight,\n\tdisplay: 'flex',\n\tflexShrink: 0,\n\talignItems: 'center',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tboxShadow: token('elevation.shadow.raised', fallbackColor),\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tbackground: token('elevation.surface.raised', fallbackColor),\n\twidth: '100%',\n\tjustifyContent: 'center',\n\tborderRadius: 'var(--border-radius)',\n});\n\nconst containerStyles = css({\n\tdisplay: 'flex',\n\talignItems: 'center',\n\tflexDirection: 'column',\n\t/**\n\t * This is intentionally too small to fit all of the cards,\n\t * so that we can test the scrollJustEnoughIntoView behavior.\n\t */\n\theight: (cardHeight * numCards) / 2,\n\tgap: 'var(--grid)',\n\toverflow: 'auto',\n\twidth: 240,\n\tmargin: '0 auto',\n\tpadding: 'var(--grid)',\n});\n\nfunction Draggable({ testId }: { testId: string }) {\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst [state, setState] = useState<'idle' | 'dragging'>('idle');\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\n\t\treturn draggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview() {\n\t\t\t\tscrollJustEnoughIntoView({ element });\n\t\t\t\tsetState('dragging');\n\t\t\t},\n\t\t\tonDrop() {\n\t\t\t\tsetState('idle');\n\t\t\t},\n\t\t});\n\t}, []);\n\n\treturn (\n\t\t<div ref={ref} css={cardStyles} data-testid={testId} data-state={state}>\n\t\t\t{testId}\n\t\t</div>\n\t);\n}\n\nfunction DropTarget({ children, testId }: { children: ReactNode; testId: string }) {\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\n\t\treturn dropTargetForElements({\n\t\t\telement,\n\t\t});\n\t}, []);\n\n\treturn (\n\t\t<div ref={ref} css={containerStyles} data-testid={testId}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n\nexport default function Example(): React.JSX.Element {\n\treturn (\n\t\t<Fragment>\n\t\t\t<GlobalStyles />\n\t\t\t<DropTarget testId=\"container\">\n\t\t\t\t{Array.from({ length: numCards }, (_, index) => {\n\t\t\t\t\treturn <Draggable key={index} testId={`card-${index}`} />;\n\t\t\t\t})}\n\t\t\t</DropTarget>\n\t\t</Fragment>\n\t);\n}\n"
  },
  {
    "path": "packages/core/examples/stickiness.tsx",
    "content": "import React, { useEffect, useRef, useState } from 'react';\n\nimport invariant from 'tiny-invariant';\n\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Inline, Stack, xcss } from '@atlaskit/primitives';\n\nimport { combine } from '../src/entry-point/combine';\nimport { draggable, dropTargetForElements } from '../src/entry-point/element/adapter';\n\ntype ItemData = {\n\tid: string;\n\tlabel: string;\n};\n\nconst defaultItems: ItemData[] = [\n\t{\n\t\tid: 'task-1',\n\t\tlabel: 'Organize a team-building event',\n\t},\n\t{\n\t\tid: 'task-2',\n\t\tlabel: 'Create and maintain office inventory',\n\t},\n\t{\n\t\tid: 'task-3',\n\t\tlabel: 'Update company website content',\n\t},\n\t{\n\t\tid: 'task-4',\n\t\tlabel: 'Plan and execute marketing campaigns',\n\t},\n\t{\n\t\tid: 'task-5',\n\t\tlabel: 'Coordinate employee training sessions',\n\t},\n\t{\n\t\tid: 'task-6',\n\t\tlabel: 'Manage facility maintenance',\n\t},\n\t{\n\t\tid: 'task-7',\n\t\tlabel: 'Organize customer feedback surveys',\n\t},\n\t{\n\t\tid: 'task-8',\n\t\tlabel: 'Coordinate travel arrangements',\n\t},\n];\n\nconst containerStyles = xcss({\n\tmaxWidth: '400px',\n\tborderWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border',\n});\n\nconst listItemContainerStyles = xcss({\n\tposition: 'relative',\n\tbackgroundColor: 'elevation.surface',\n\tborderWidth: '0',\n\tborderBottomWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':last-of-type': {\n\t\tborderWidth: '0',\n\t},\n\tpadding: 'space.100',\n});\n\nconst itemLabelStyles = xcss({\n\tflexGrow: 1,\n\twhiteSpace: 'nowrap',\n\ttextOverflow: 'ellipsis',\n\toverflow: 'hidden',\n});\n\nconst hoverStyles = xcss({\n\tbackgroundColor: 'color.background.selected.hovered',\n});\n\nfunction ListItem({ itemData, index }: { itemData: ItemData; index: number }) {\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst [isBeingDraggedOver, setIsBeingDraggedOver] = useState(false);\n\n\tuseEffect(() => {\n\t\tinvariant(ref.current);\n\t\tconst element = ref.current;\n\n\t\treturn combine(\n\t\t\tdraggable({\n\t\t\t\telement,\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement,\n\t\t\t\tgetIsSticky: () => true,\n\t\t\t\tonDragEnter: () => setIsBeingDraggedOver(true),\n\t\t\t\tonDragStart: () => setIsBeingDraggedOver(true),\n\t\t\t\tonDragLeave: () => setIsBeingDraggedOver(false),\n\t\t\t\tonDrop: () => setIsBeingDraggedOver(false),\n\t\t\t}),\n\t\t);\n\t}, []);\n\n\treturn (\n\t\t<Box\n\t\t\tref={ref}\n\t\t\txcss={[listItemContainerStyles, isBeingDraggedOver && hoverStyles]}\n\t\t\ttestId={`list-item-${index}`}\n\t\t>\n\t\t\t{/*  Using a separate div here as we cannot set custom `data` attributes on the `Box` component */}\n\t\t\t<div\n\t\t\t\tdata-testid={`list-item-${index}.drag-indicator`}\n\t\t\t\tdata-is-dragged-over={isBeingDraggedOver}\n\t\t\t/>\n\t\t\t<Box xcss={itemLabelStyles}>{itemData.label}</Box>\n\t\t</Box>\n\t);\n}\n\nexport default function StickinessExample(): React.JSX.Element {\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tconst [isBeingDraggedOver, setIsBeingDraggedOver] = useState(false);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\n\t\treturn dropTargetForElements({\n\t\t\telement,\n\t\t\tgetIsSticky: () => true,\n\t\t\tonDragEnter: () => setIsBeingDraggedOver(true),\n\t\t\tonDragStart: () => setIsBeingDraggedOver(true),\n\t\t\tonDragLeave: () => setIsBeingDraggedOver(false),\n\t\t\tonDrop: () => setIsBeingDraggedOver(false),\n\t\t});\n\t}, []);\n\n\treturn (\n\t\t<Inline space=\"space.100\">\n\t\t\t{/* Using a separate div here as we cannot set custom `data` attributes on the `Stack` component */}\n\t\t\t<div data-testid=\"list-container\" data-is-dragged-over={isBeingDraggedOver}>\n\t\t\t\t<Stack xcss={[containerStyles, isBeingDraggedOver && hoverStyles]} ref={ref}>\n\t\t\t\t\t{defaultItems.map((itemData, index) => (\n\t\t\t\t\t\t<ListItem key={itemData.id} itemData={itemData} index={index} />\n\t\t\t\t\t))}\n\t\t\t\t</Stack>\n\t\t\t</div>\n\n\t\t\t<div data-testid=\"element-without-drop-target\">Element without drop target</div>\n\t\t</Inline>\n\t);\n}\n"
  },
  {
    "path": "packages/core/examples/text-selection.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { jsx } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Inline, Stack, xcss } from '@atlaskit/primitives';\n\nimport { combine } from '../src/entry-point/combine';\nimport {\n\tdropTargetForTextSelection,\n\tmonitorForTextSelection,\n} from '../src/entry-point/text-selection/adapter';\n\ntype DropTargetState = 'idle' | 'potential' | 'over';\n\nconst containerStyles = xcss({\n\tborderWidth: 'border.width.selected',\n\tborderRadius: 'radius.small',\n\tborderStyle: 'solid',\n\tflexGrow: 1,\n\tflexShrink: 1,\n\tflexBasis: 0,\n\twidth: '0',\n});\n\nconst dropTargetStateStyles: {\n\t[key in DropTargetState]: ReturnType<typeof xcss> | undefined;\n} = {\n\tidle: undefined,\n\tover: xcss({ backgroundColor: 'color.background.selected' }),\n\tpotential: xcss({\n\t\tbackgroundColor: 'color.background.discovery',\n\t\tborderStyle: 'dashed',\n\t\tborderColor: 'color.border.discovery',\n\t}),\n};\n\nfunction DropTarget() {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<DropTargetState>('idle');\n\tconst [latestText, setLatestText] = useState<string>('(none)');\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\n\t\treturn combine(\n\t\t\tdropTargetForTextSelection({\n\t\t\t\telement,\n\t\t\t\tonDragEnter: () => setState('over'),\n\t\t\t\tonDragLeave: () => setState('potential'),\n\t\t\t\tonDrop: ({ source }) => {\n\t\t\t\t\tsetLatestText(source.plain);\n\t\t\t\t},\n\t\t\t}),\n\t\t\tmonitorForTextSelection({\n\t\t\t\tonDragStart: ({ location }) => {\n\t\t\t\t\tif (location.current.dropTargets[0]?.element === element) {\n\t\t\t\t\t\tsetState('over');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetState('potential');\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonDrop: () => setState('idle'),\n\t\t\t}),\n\t\t);\n\t}, []);\n\treturn (\n\t\t<Box\n\t\t\tpadding=\"space.100\"\n\t\t\tref={ref}\n\t\t\txcss={[containerStyles, dropTargetStateStyles[state]]}\n\t\t\ttestId=\"drop-target\"\n\t\t>\n\t\t\t<Stack space=\"space.100\">\n\t\t\t\t<strong>Drop select text on me</strong>\n\t\t\t\t<Box>\n\t\t\t\t\t{/* eslint-disable-next-line @atlaskit/design-system/no-html-code */}\n\t\t\t\t\tLatest dropped text: <code>\"{latestText}\"</code>\n\t\t\t\t</Box>\n\t\t\t</Stack>\n\t\t</Box>\n\t);\n}\n\nconst layoutStyles = xcss({\n\theight: 'size.1000',\n\twidth: '600px',\n});\n\nexport default function TextSelectionDragging(): React.JSX.Element {\n\treturn (\n\t\t<Inline xcss={layoutStyles} space=\"space.100\" alignBlock=\"stretch\">\n\t\t\t<Box padding=\"space.100\" xcss={containerStyles}>\n\t\t\t\t<span data-testid=\"text\">\n\t\t\t\t\tHere is some text <em>for you</em> to select <strong>and drag</strong>\n\t\t\t\t</span>\n\t\t\t</Box>\n\t\t\t<DropTarget />\n\t\t</Inline>\n\t);\n}\n"
  },
  {
    "path": "packages/core/examples/url.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { Fragment, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport { Box, Stack } from '@atlaskit/primitives/compiled';\nimport { token } from '@atlaskit/tokens';\n\nimport { combine } from '../src/entry-point/combine';\nimport { dropTargetForExternal, monitorForExternal } from '../src/entry-point/external/adapter';\nimport { containsURLs, getURLs } from '../src/entry-point/external/url';\nimport { preventUnhandled } from '../src/entry-point/prevent-unhandled';\n\nimport { GlobalStyles } from './_util/global-styles';\n\nconst dropTargetStyles = css({\n\tdisplay: 'flex',\n\tpadding: 'calc(var(--grid) * 6) calc(var(--grid) * 4)',\n\talignItems: 'center',\n\tjustifyContent: 'center',\n\tbackground: token('elevation.surface.sunken'),\n\tborderRadius: 'var(--border-radius)',\n\tcolor: token('color.text.disabled'),\n\tfontSize: '1.4rem',\n});\n\nconst overStyles = css({\n\tbackground: token('color.background.selected.hovered'),\n\tcolor: token('color.text.selected'),\n});\n\nconst potentialStyles = css({\n\tbackground: token('color.background.discovery'),\n});\n\nconst appStyles = css({\n\tdisplay: 'flex',\n\tpadding: 'var(--grid)',\n\talignItems: 'center',\n\tgap: 'calc(var(--grid) * 2)',\n\tflexDirection: 'column',\n\tmaxWidth: '400px',\n\tmargin: '0 auto',\n});\n\nfunction App() {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<'idle' | 'potential' | 'over'>('idle');\n\tconst [drops, setDrops] = useState<string[][]>([]);\n\n\tuseEffect(() => {\n\t\tconst el = ref.current;\n\t\tinvariant(el);\n\t\treturn combine(\n\t\t\tdropTargetForExternal({\n\t\t\t\telement: el,\n\t\t\t\tcanDrop: containsURLs,\n\t\t\t\tonDragEnter: () => setState('over'),\n\t\t\t\tonDragLeave: () => setState('potential'),\n\t\t\t\tonDrop: ({ source }) => {\n\t\t\t\t\tif (!source.items) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst urls: string[] = getURLs({ source });\n\t\t\t\t\tsetDrops((current) => [...current, urls]);\n\t\t\t\t},\n\t\t\t}),\n\t\t\tmonitorForExternal({\n\t\t\t\tcanMonitor: containsURLs,\n\t\t\t\tonDragStart: () => {\n\t\t\t\t\tsetState('potential');\n\t\t\t\t\tpreventUnhandled.start();\n\t\t\t\t},\n\t\t\t\tonDrop: () => {\n\t\t\t\t\tpreventUnhandled.stop();\n\t\t\t\t\tsetState('idle');\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t});\n\treturn (\n\t\t<div css={appStyles}>\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tdata-testid=\"drop-target\"\n\t\t\t\tcss={[\n\t\t\t\t\tdropTargetStyles,\n\t\t\t\t\tstate === 'over' ? overStyles : state === 'potential' ? potentialStyles : undefined,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t<strong>Drop some URLs on me!</strong>\n\t\t\t</div>\n\t\t\t<Stack alignInline=\"start\" space=\"space.100\">\n\t\t\t\t{drops.map((drop, index) => (\n\t\t\t\t\t<Box key={index}>\n\t\t\t\t\t\t<h4>Drop {index + 1}</h4>\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t{drop.map((url) => (\n\t\t\t\t\t\t\t\t<li key={url}>{url}</li>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</Box>\n\t\t\t\t))}\n\t\t\t</Stack>\n\t\t</div>\n\t);\n}\n\nexport default function Example(): React.JSX.Element {\n\treturn (\n\t\t<Fragment>\n\t\t\t<GlobalStyles />\n\t\t\t<App />\n\t\t</Fragment>\n\t);\n}\n"
  },
  {
    "path": "packages/core/package.json",
    "content": "{\n  \"name\": \"@atlaskit/pragmatic-drag-and-drop\",\n  \"version\": \"1.7.9\",\n  \"description\": \"The core package for Pragmatic drag and drop - enabling fast drag and drop for any experience on any tech stack\",\n  \"repository\": \"https://github.com/atlassian/pragmatic-drag-and-drop\",\n  \"author\": \"Atlassian Pty Ltd\",\n  \"license\": \"Apache-2.0\",\n  \"main\": \"dist/cjs/index.js\",\n  \"module\": \"dist/esm/index.js\",\n  \"module:es2019\": \"dist/es2019/index.js\",\n  \"types\": \"dist/types/index.d.ts\",\n  \"sideEffects\": true,\n  \"publishConfig\": {\n    \"registry\": \"https://registry.npmjs.org/\"\n  },\n  \"exports\": {\n    \".\": \"./src/index.ts\",\n    \"./element/adapter\": \"./src/entry-point/element/adapter.ts\",\n    \"./element/set-custom-native-drag-preview\": \"./src/entry-point/element/set-custom-native-drag-preview.ts\",\n    \"./element/pointer-outside-of-preview\": \"./src/entry-point/element/pointer-outside-of-preview.ts\",\n    \"./element/center-under-pointer\": \"./src/entry-point/element/center-under-pointer.ts\",\n    \"./element/preserve-offset-on-source\": \"./src/entry-point/element/preserve-offset-on-source.ts\",\n    \"./element/disable-native-drag-preview\": \"./src/entry-point/element/disable-native-drag-preview.ts\",\n    \"./element/scroll-just-enough-into-view\": \"./src/entry-point/element/scroll-just-enough-into-view.ts\",\n    \"./element/format-urls-for-external\": \"./src/entry-point/element/format-urls-for-external.ts\",\n    \"./element/block-dragging-to-iframes\": \"./src/entry-point/element/block-dragging-to-iframes.ts\",\n    \"./external/adapter\": \"./src/entry-point/external/adapter.ts\",\n    \"./external/file\": \"./src/entry-point/external/file.ts\",\n    \"./external/html\": \"./src/entry-point/external/html.ts\",\n    \"./external/text\": \"./src/entry-point/external/text.ts\",\n    \"./external/url\": \"./src/entry-point/external/url.ts\",\n    \"./external/some\": \"./src/entry-point/external/some.ts\",\n    \"./private/get-element-from-point-without-honey-pot\": \"./src/entry-point/private/get-element-from-point-without-honey-pot.ts\",\n    \"./text-selection/adapter\": \"./src/entry-point/text-selection/adapter.ts\",\n    \"./combine\": \"./src/entry-point/combine.ts\",\n    \"./once\": \"./src/entry-point/once.ts\",\n    \"./reorder\": \"./src/entry-point/reorder.ts\",\n    \"./prevent-unhandled\": \"./src/entry-point/prevent-unhandled.ts\",\n    \"./types\": \"./src/entry-point/types.ts\"\n  },\n  \"dependencies\": {\n    \"@babel/runtime\": \"^7.0.0\",\n    \"bind-event-listener\": \"^3.0.0\",\n    \"raf-schd\": \"^4.0.3\"\n  },\n  \"devDependencies\": {\n    \"@atlaskit/link\": \"^3.3.0\",\n    \"@emotion/react\": \"^11.7.1\",\n    \"@testing-library/dom\": \"^10.1.0\",\n    \"@testing-library/react\": \"^16.3.0\",\n    \"@types/raf-schd\": \"^4.0.1\",\n    \"globby\": \"^6.1.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"tiny-invariant\": \"^1.2.0\",\n    \"wait-for-expect\": \"^1.2.0\"\n  },\n  \"homepage\": \"https://atlassian.design/components/pragmatic-drag-and-drop/\"\n}\n"
  },
  {
    "path": "packages/core/src/adapter/element-adapter-native-data-key.ts",
    "content": "/**\n * This key has been pulled into a separate module\n * so that the external adapter does not need to import\n * the element adapter\n */\nexport const elementAdapterNativeDataKey = 'application/vnd.pdnd';\n"
  },
  {
    "path": "packages/core/src/adapter/element-adapter.ts",
    "content": "import { bind } from 'bind-event-listener';\n\nimport { getElementFromPointWithoutHoneypot } from '../honey-pot-fix/get-element-from-point-without-honey-pot';\nimport { makeHoneyPotFix } from '../honey-pot-fix/make-honey-pot-fix';\nimport {\n\ttype AdapterAPI,\n\ttype AllEvents,\n\ttype BaseEventPayload,\n\ttype CleanupFn,\n\ttype DropTargetArgs,\n\ttype DropTargetEventBasePayload,\n\ttype DropTargetEventPayloadMap,\n\ttype DropTargetGetFeedbackArgs,\n\ttype ElementDragType,\n\ttype EventPayloadMap,\n\ttype Input,\n\ttype MonitorArgs,\n\ttype MonitorGetFeedbackArgs,\n\ttype NativeMediaType,\n} from '../internal-types';\nimport { makeAdapter } from '../make-adapter/make-adapter';\nimport { combine } from '../public-utils/combine';\nimport { once } from '../public-utils/once';\nimport { addAttribute } from '../util/add-attribute';\nimport { androidFallbackText, isAndroid } from '../util/android';\nimport { getInput } from '../util/get-input';\nimport { textMediaType } from '../util/media-types/text-media-type';\nimport { URLMediaType } from '../util/media-types/url-media-type';\n\nimport { elementAdapterNativeDataKey } from './element-adapter-native-data-key';\n\ntype DraggableGetFeedbackArgs = {\n\t/**\n\t * The user input as a drag is trying to start (the `initial` input)\n\t */\n\tinput: Input;\n\t/**\n\t * The `draggable` element\n\t */\n\telement: HTMLElement;\n\t/**\n\t * The `dragHandle` element for the `draggable`\n\t */\n\tdragHandle: Element | null;\n};\n\ntype DraggableArgs = {\n\t/** The `HTMLElement` that you want to attach draggable behaviour to.\n\t * `element` is our unique _key_ for a draggable.\n\t * `element` is a `HTMLElement` as only a `HTMLElement`\n\t * can have a \"draggable\" attribute\n\t */\n\telement: HTMLElement;\n\t/** The part of a draggable `element` that you want to use to control the dragging of the whole `element` */\n\tdragHandle?: Element;\n\t/** Conditionally allow a drag to occur */\n\tcanDrag?: (args: DraggableGetFeedbackArgs) => boolean;\n\t/** Used to attach data to a drag operation. Called once just before the drag starts */\n\tgetInitialData?: (args: DraggableGetFeedbackArgs) => Record<string, unknown>;\n\t/** Attach data to the native drag data store.\n\t * This function is useful to attach native data that can be extracted by other web pages\n\t * or web applications\n\t * Attaching native data in this way will _not_ cause the native adapter on this page to start\n\t * Although it can cause a native adapter in other applications to start\n\t * @example getInitialDataForExternal(() => ({'text/plain': item.description}))\n\t * */\n\tgetInitialDataForExternal?: (args: DraggableGetFeedbackArgs) => {\n\t\t// Ideally we would exclude `typeof elementAdapterNativeDataKey` from this\n\t\t// However, \"deny listing\" a string from a union doesn't work well with TS\n\t\t[Key in NativeMediaType]?: string;\n\t};\n} & Partial<AllEvents<ElementDragType>>;\n\nconst draggableRegistry = new WeakMap<HTMLElement, DraggableArgs>();\n\nfunction addToRegistry(args: DraggableArgs): CleanupFn {\n\tdraggableRegistry.set(args.element, args);\n\n\treturn function cleanup() {\n\t\tdraggableRegistry.delete(args.element);\n\t};\n}\n\nconst honeyPotFix = makeHoneyPotFix();\n\nconst adapter = makeAdapter<ElementDragType>({\n\ttypeKey: 'element',\n\tdefaultDropEffect: 'move',\n\tmount(api: AdapterAPI<ElementDragType>): CleanupFn {\n\t\t/**  Binding event listeners the `document` rather than `window` so that\n\t\t * this adapter always gets preference over the text adapter.\n\t\t * `document` is the first `EventTarget` under `window`\n\t\t * https://twitter.com/alexandereardon/status/1604658588311465985\n\t\t */\n\t\treturn combine(\n\t\t\thoneyPotFix.bindEvents(),\n\t\t\tbind(document, {\n\t\t\t\ttype: 'dragstart',\n\t\t\t\tlistener(event: DragEvent) {\n\t\t\t\t\tif (!api.canStart(event)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// If the \"dragstart\" event is cancelled, then a drag won't start\n\t\t\t\t\t// There will be no further drag operation events (eg no \"dragend\" event)\n\t\t\t\t\tif (event.defaultPrevented) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Technically `dataTransfer` can be `null` according to the types\n\t\t\t\t\t// But that behaviour does not seem to appear in the spec.\n\t\t\t\t\t// If there is not `dataTransfer`, we can assume something is wrong and not\n\t\t\t\t\t// start a drag\n\t\t\t\t\tif (!event.dataTransfer) {\n\t\t\t\t\t\t// Including this code on \"test\" and \"development\" environments:\n\t\t\t\t\t\t// - Browser tests commonly run against \"development\" builds\n\t\t\t\t\t\t// - Unit tests commonly run in \"test\"\n\t\t\t\t\t\tif (process.env.NODE_ENV !== 'production') {\n\t\t\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t\t\t`\n              It appears as though you have are not testing DragEvents correctly.\n\n              - If you are unit testing, ensure you have polyfilled DragEvent.\n              - If you are browser testing, ensure you are dispatching drag events correctly.\n\n              Please see our testing guides for more information:\n              https://atlassian.design/components/pragmatic-drag-and-drop/core-package/testing\n            `.replace(/ {2}/g, ''),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// the closest parent that is a draggable element will be marked as\n\t\t\t\t\t// the `event.target` for the event\n\t\t\t\t\tconst target: EventTarget | null = event.target;\n\n\t\t\t\t\t// this source is only for elements\n\t\t\t\t\t// Note: only HTMLElements can have the \"draggable\" attribute\n\t\t\t\t\tif (!(target instanceof HTMLElement)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// see if the thing being dragged is owned by us\n\t\t\t\t\tconst entry: DraggableArgs | undefined = draggableRegistry.get(target);\n\n\t\t\t\t\t// no matching element found\n\t\t\t\t\t// → dragging an element with `draggable=\"true\"` that is not controlled by us\n\t\t\t\t\tif (!entry) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n\t\t\t\t\t * A text selection drag _can_ have the `draggable` element be\n\t\t\t\t\t * the `event.target` if the user is dragging the text selection\n\t\t\t\t\t * from the `draggable`.\n\t\t\t\t\t *\n\t\t\t\t\t * To know if the `draggable` is being dragged, we look at whether any\n\t\t\t\t\t * `\"text/plain\"` data is being dragged. If it is, then a text selection\n\t\t\t\t\t * drag is occurring.\n\t\t\t\t\t *\n\t\t\t\t\t * This behaviour has been validated on:\n\t\t\t\t\t *\n\t\t\t\t\t * - Chrome@128 on Android@14\n\t\t\t\t\t * - Chrome@128 on iOS@17.6.1\n\t\t\t\t\t * - Chrome@128 on Windows@11\n\t\t\t\t\t * - Chrome@128 on MacOS@14.6.1\n\t\t\t\t\t * - Firefox@129 on Windows@11 (not possible for user to select text in a draggable)\n\t\t\t\t\t * - Firefox@129 on MacOS@14.6.1 (not possible for user to select text in a draggable)\n\t\t\t\t\t *\n\t\t\t\t\t * Note: Could usually just use: `event.dataTransfer.types.includes(textMediaType)`\n\t\t\t\t\t * but unfortunately ProseMirror is always setting `\"\"` as the dragged text\n\t\t\t\t\t *\n\t\t\t\t\t * Note: Unfortunately editor is (heavily) leaning on the current functionality today\n\t\t\t\t\t * and unwinding it will be a decent amount of effort. So for now, a text selection\n\t\t\t\t\t * where the `event.target` is a `draggable` element will still trigger the\n\t\t\t\t\t * element adapter.\n\t\t\t\t\t *\n\t\t\t\t\t * // Future state:\n\t\t\t\t\t * if(event.dataTransfer.getData(textMediaType)) {\n\t\t\t\t\t * \treturn;\n\t\t\t\t\t * }\n\t\t\t\t\t *\n\t\t\t\t\t */\n\n\t\t\t\t\tconst input: Input = getInput(event);\n\n\t\t\t\t\tconst feedback: DraggableGetFeedbackArgs = {\n\t\t\t\t\t\telement: entry.element,\n\t\t\t\t\t\tdragHandle: entry.dragHandle ?? null,\n\t\t\t\t\t\tinput,\n\t\t\t\t\t};\n\n\t\t\t\t\t// Check: does the draggable want to allow dragging?\n\t\t\t\t\tif (entry.canDrag && !entry.canDrag(feedback)) {\n\t\t\t\t\t\t// cancel drag operation if we cannot drag\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Check: is there a drag handle and is the user using it?\n\t\t\t\t\tif (entry.dragHandle) {\n\t\t\t\t\t\t// technically don't need this util, but just being\n\t\t\t\t\t\t// consistent with how we look up what is under the users\n\t\t\t\t\t\t// cursor.\n\t\t\t\t\t\tconst over = getElementFromPointWithoutHoneypot({\n\t\t\t\t\t\t\tx: input.clientX,\n\t\t\t\t\t\t\ty: input.clientY,\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t// if we are not dragging from the drag handle (or something inside the drag handle)\n\t\t\t\t\t\t// then we will cancel the active drag\n\t\t\t\t\t\tif (!entry.dragHandle.contains(over)) {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n\t\t\t\t\t *  **Goal**\n\t\t\t\t\t *  Pass information to other applications\n\t\t\t\t\t *\n\t\t\t\t\t * **Approach**\n\t\t\t\t\t *  Put data into the native data store\n\t\t\t\t\t *\n\t\t\t\t\t *  **What about the native adapter?**\n\t\t\t\t\t *  When the element adapter puts native data into the native data store\n\t\t\t\t\t *  the native adapter is not triggered in the current window,\n\t\t\t\t\t *  but a native adapter in an external window _can_ be triggered\n\t\t\t\t\t *\n\t\t\t\t\t *  **Why bake this into core?**\n\t\t\t\t\t *  This functionality could be pulled out and exposed inside of\n\t\t\t\t\t *  `onGenerateDragPreview`. But decided to make it a part of the\n\t\t\t\t\t *  base API as it felt like a common enough use case and ended\n\t\t\t\t\t *  up being a similar amount of code to include this function as\n\t\t\t\t\t *  it was to expose the hook for it\n\t\t\t\t\t */\n\t\t\t\t\tconst nativeData = entry.getInitialDataForExternal?.(feedback) ?? null;\n\n\t\t\t\t\tif (nativeData) {\n\t\t\t\t\t\tfor (const [key, data] of Object.entries(nativeData)) {\n\t\t\t\t\t\t\tevent.dataTransfer.setData(key, data ?? '');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n\t\t\t\t\t *  📱 For Android devices, a drag operation will not start unless\n\t\t\t\t\t * \"text/plain\" or \"text/uri-list\" data exists in the native data store\n\t\t\t\t\t * https://twitter.com/alexandereardon/status/1732189803754713424\n\t\t\t\t\t *\n\t\t\t\t\t * Tested on:\n\t\t\t\t\t * Device: Google Pixel 5\n\t\t\t\t\t * Android version: 14 (November 5, 2023)\n\t\t\t\t\t * Chrome version: 120.0\n\t\t\t\t\t */\n\t\t\t\t\tif (\n\t\t\t\t\t\tisAndroid() &&\n\t\t\t\t\t\t!event.dataTransfer.types.includes(textMediaType) &&\n\t\t\t\t\t\t!event.dataTransfer.types.includes(URLMediaType)\n\t\t\t\t\t) {\n\t\t\t\t\t\tevent.dataTransfer.setData(textMediaType, androidFallbackText);\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n\t\t\t\t\t * 1. Must set any media type for `iOS15` to work\n\t\t\t\t\t * 2. We are also doing adding data so that the native adapter\n\t\t\t\t\t * can know that the element adapter has handled this drag\n\t\t\t\t\t *\n\t\t\t\t\t * We used to wrap this `setData()` in a `try/catch` for Firefox,\n\t\t\t\t\t * but it looks like that was not needed.\n\t\t\t\t\t *\n\t\t\t\t\t * Tested using: https://codesandbox.io/s/checking-firefox-throw-behaviour-on-dragstart-qt8h4f\n\t\t\t\t\t *\n\t\t\t\t\t * - ✅ Firefox@70.0 (Oct 2019) on macOS Sonoma\n\t\t\t\t\t * - ✅ Firefox@70.0 (Oct 2019) on macOS Big Sur\n\t\t\t\t\t * - ✅ Firefox@70.0 (Oct 2019) on Windows 10\n\t\t\t\t\t *\n\t\t\t\t\t * // just checking a few more combinations to be super safe\n\t\t\t\t\t *\n\t\t\t\t\t * - ✅ Chrome@78 (Oct 2019) on macOS Big Sur\n\t\t\t\t\t * - ✅ Chrome@78 (Oct 2019) on Windows 10\n\t\t\t\t\t * - ✅ Safari@14.1 on macOS Big Sur\n\t\t\t\t\t */\n\t\t\t\t\tevent.dataTransfer.setData(elementAdapterNativeDataKey, '');\n\n\t\t\t\t\tconst payload: ElementDragType['payload'] = {\n\t\t\t\t\t\telement: entry.element,\n\t\t\t\t\t\tdragHandle: entry.dragHandle ?? null,\n\t\t\t\t\t\tdata: entry.getInitialData?.(feedback) ?? {},\n\t\t\t\t\t};\n\n\t\t\t\t\tconst dragType: ElementDragType = {\n\t\t\t\t\t\ttype: 'element',\n\t\t\t\t\t\tpayload,\n\t\t\t\t\t\tstartedFrom: 'internal',\n\t\t\t\t\t};\n\n\t\t\t\t\tapi.start({\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\tdragType,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t},\n\tdispatchEventToSource: <EventName extends keyof EventPayloadMap<ElementDragType>>({\n\t\teventName,\n\t\tpayload,\n\t}: {\n\t\teventName: EventName;\n\t\tpayload: EventPayloadMap<ElementDragType>[EventName];\n\t}) => {\n\t\t// During a drag operation, a draggable can be:\n\t\t// - remounted with different functions\n\t\t// - removed completely\n\t\t// So we need to get the latest entry from the registry in order\n\t\t// to call the latest event functions\n\n\t\tdraggableRegistry.get(payload.source.element)?.[eventName]?.(\n\t\t\t// I cannot seem to get the types right here.\n\t\t\t// TS doesn't seem to like that one event can need `nativeSetDragImage`\n\t\t\t// @ts-expect-error\n\t\t\tpayload,\n\t\t);\n\t},\n\tonPostDispatch: honeyPotFix.getOnPostDispatch(),\n});\n\nexport const dropTargetForElements: (args: DropTargetArgs<ElementDragType>) => CleanupFn =\n\tadapter.dropTarget;\nexport const monitorForElements: (args: MonitorArgs<ElementDragType>) => CleanupFn =\n\tadapter.monitor;\n\nexport function draggable(args: DraggableArgs): CleanupFn {\n\t// Guardrail: warn if the drag handle is not contained in draggable element\n\tif (process.env.NODE_ENV !== 'production') {\n\t\tif (args.dragHandle && !args.element.contains(args.dragHandle)) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn('Drag handle element must be contained in draggable element', {\n\t\t\t\telement: args.element,\n\t\t\t\tdragHandle: args.dragHandle,\n\t\t\t});\n\t\t}\n\t}\n\t// Guardrail: warn if the draggable element is already registered\n\tif (process.env.NODE_ENV !== 'production') {\n\t\tconst existing = draggableRegistry.get(args.element);\n\t\tif (existing) {\n\t\t\t// eslint-disable-next-line no-console\n\t\t\tconsole.warn('You have already registered a `draggable` on the same element', {\n\t\t\t\texisting,\n\t\t\t\tproposed: args,\n\t\t\t});\n\t\t}\n\t}\n\n\tconst cleanup = combine(\n\t\t// making the draggable register the adapter rather than drop targets\n\t\t// this is because you *must* have a draggable element to start a drag\n\t\t// but you _might_ not have any drop targets immediately\n\t\t// (You might create drop targets async)\n\t\tadapter.registerUsage(),\n\t\taddToRegistry(args),\n\t\taddAttribute(args.element, { attribute: 'draggable', value: 'true' }),\n\t);\n\n\t// Wrapping in `once` to prevent unexpected side effects if consumers call\n\t// the clean up function multiple times.\n\treturn once(cleanup);\n}\n\n/** Common event payload for all events */\nexport type ElementEventBasePayload = BaseEventPayload<ElementDragType>;\n\n/** A map containing payloads for all events */\nexport type ElementEventPayloadMap = EventPayloadMap<ElementDragType>;\n\n/** Common event payload for all drop target events */\nexport type ElementDropTargetEventBasePayload = DropTargetEventBasePayload<ElementDragType>;\n\n/** A map containing payloads for all events on drop targets */\nexport type ElementDropTargetEventPayloadMap = DropTargetEventPayloadMap<ElementDragType>;\n\n/** Arguments given to all feedback functions (eg `canDrag()`) on for a `draggable()` */\nexport type ElementGetFeedbackArgs = DraggableGetFeedbackArgs;\n\n/** Arguments given to all feedback functions (eg `canDrop()`) on a `dropTargetForElements()` */\nexport type ElementDropTargetGetFeedbackArgs = DropTargetGetFeedbackArgs<ElementDragType>;\n\n/** Arguments given to all monitor feedback functions (eg `canMonitor()`) for a `monitorForElements` */\nexport type ElementMonitorGetFeedbackArgs = MonitorGetFeedbackArgs<ElementDragType>;\n"
  },
  {
    "path": "packages/core/src/adapter/external-adapter.ts",
    "content": "import { bind, bindAll } from 'bind-event-listener';\n\nimport {\n\ttype AdapterAPI,\n\ttype BaseEventPayload,\n\ttype CleanupFn,\n\ttype DropTargetArgs,\n\ttype DropTargetEventBasePayload,\n\ttype DropTargetEventPayloadMap,\n\ttype DropTargetGetFeedbackArgs,\n\ttype EventPayloadMap,\n\ttype ExternalDragPayload,\n\ttype ExternalDragType,\n\ttype MonitorArgs,\n\ttype MonitorGetFeedbackArgs,\n\ttype NativeMediaType,\n} from '../internal-types';\nimport { makeAdapter } from '../make-adapter/make-adapter';\nimport { androidFallbackText } from '../util/android';\nimport { isEnteringWindow } from '../util/changing-window/is-entering-window';\nimport { getBindingsForBrokenDrags } from '../util/detect-broken-drag';\nimport { textMediaType } from '../util/media-types/text-media-type';\n\nimport { elementAdapterNativeDataKey } from './element-adapter-native-data-key';\n\nexport function isAnAvailableType({ type, value }: { type: string; value: string }): boolean {\n\t// We don't want to expose our private elementAdapter key / value\n\tif (type === elementAdapterNativeDataKey) {\n\t\treturn false;\n\t}\n\t// Not exposing \"text/plain\" if it contains the android fallback text\n\t// We _could_ add an `isAndroid()` check, but it's probably safest\n\t// to trim this data out, regardless of what OS we see it on.\n\tif (type === textMediaType && value === androidFallbackText) {\n\t\treturn false;\n\t}\n\treturn true;\n}\n\nexport function getAvailableTypes(transfer: DataTransfer): NativeMediaType[] {\n\treturn Array.from(transfer.types).filter((type) =>\n\t\tisAnAvailableType({ type, value: transfer.getData(type) }),\n\t);\n}\n\nexport function getAvailableItems(dataTransfer: DataTransfer): DataTransferItem[] {\n\t// item.kind is 'string' | 'file'\n\t// For 'string' item.type is the mimeType (eg 'text/plain')\n\t// For 'file' item.type is the file type (eg 'image/jpg')\n\n\treturn Array.from(dataTransfer.items).filter(\n\t\t(item) =>\n\t\t\titem.kind === 'file' ||\n\t\t\tisAnAvailableType({\n\t\t\t\ttype: item.type,\n\t\t\t\tvalue: dataTransfer.getData(item.type),\n\t\t\t}),\n\t);\n}\n\nlet didDragStartLocally: boolean = false;\n\nconst adapter: {\n\tregisterUsage: () => CleanupFn;\n\tdropTarget: (args: DropTargetArgs<ExternalDragType>) => CleanupFn;\n\tmonitor: (args: MonitorArgs<ExternalDragType>) => CleanupFn;\n} = makeAdapter<ExternalDragType>({\n\ttypeKey: 'external',\n\t// for external drags, we are generally making a copy of something that is being dragged\n\tdefaultDropEffect: 'copy',\n\tmount(api: AdapterAPI<ExternalDragType>): CleanupFn {\n\t\t// Binding to the `window` so that the element adapter\n\t\t// has a chance to get in first on the`document`.\n\t\t// We are giving preference to the element adapter.\n\t\treturn bind(window, {\n\t\t\ttype: 'dragenter',\n\t\t\tlistener(event: DragEvent) {\n\t\t\t\t// drag operation was started within the document, it won't be an \"external\" drag\n\t\t\t\tif (didDragStartLocally) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Note: not checking if event was cancelled (`event.defaultPrevented`) as\n\t\t\t\t// cancelling a \"dragenter\" accepts the drag operation (not prevent it)\n\n\t\t\t\t// Something has gone wrong with our drag event\n\t\t\t\tif (!event.dataTransfer) {\n\t\t\t\t\t// Including this code on \"test\" and \"development\" environments:\n\t\t\t\t\t// - Browser tests commonly run against \"development\" builds\n\t\t\t\t\t// - Unit tests commonly run in \"test\"\n\t\t\t\t\tif (process.env.NODE_ENV !== 'production') {\n\t\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t\t`\n              It appears as though you have are not testing DragEvents correctly.\n\n              - If you are unit testing, ensure you have polyfilled DragEvent.\n              - If you are browser testing, ensure you are dispatching drag events correctly.\n\n              Please see our testing guides for more information:\n              https://atlassian.design/components/pragmatic-drag-and-drop/core-package/testing\n            `.replace(/ {2}/g, ''),\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (!api.canStart(event)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (!isEnteringWindow({ dragEnter: event })) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// Note: not checking types for `elementAdapterNativeDataKey` as we expect to see that\n\t\t\t\t// key when pdnd started the drag in another document\n\t\t\t\tconst types = getAvailableTypes(event.dataTransfer);\n\n\t\t\t\tif (!types.length) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst locked: ExternalDragPayload = {\n\t\t\t\t\ttypes,\n\t\t\t\t\titems: [],\n\t\t\t\t\tgetStringData: () => null,\n\t\t\t\t};\n\n\t\t\t\tapi.start({\n\t\t\t\t\tevent,\n\t\t\t\t\tdragType: {\n\t\t\t\t\t\ttype: 'external',\n\t\t\t\t\t\tstartedFrom: 'external',\n\t\t\t\t\t\tpayload: locked,\n\t\t\t\t\t\tgetDropPayload(event): ExternalDragPayload {\n\t\t\t\t\t\t\t// this would be a platform error\n\t\t\t\t\t\t\t// trying to handle it gracefully rather than throwing (for now)\n\t\t\t\t\t\t\tif (!event.dataTransfer) {\n\t\t\t\t\t\t\t\treturn locked;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tconst items = getAvailableItems(event.dataTransfer);\n\t\t\t\t\t\t\t// need to use `.bind` as `getData` is required\n\t\t\t\t\t\t\t// to be run with `event.dataTransfer` as the \"this\" context\n\t\t\t\t\t\t\tconst nativeGetData = event.dataTransfer.getData.bind(event.dataTransfer);\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\ttypes,\n\t\t\t\t\t\t\t\titems,\n\t\t\t\t\t\t\t\t// return `null` if there is no result, otherwise string\n\t\t\t\t\t\t\t\tgetStringData(mediaType: string): string | null {\n\t\t\t\t\t\t\t\t\t// not dragging the requested type\n\t\t\t\t\t\t\t\t\t// return `null` (no result)\n\t\t\t\t\t\t\t\t\tif (!types.includes(mediaType)) {\n\t\t\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// nativeGetData will return `\"\"` when there is no value,\n\t\t\t\t\t\t\t\t\t// but at this point we know we will only get explicitly set\n\t\t\t\t\t\t\t\t\t// values back as we have checked the `types`.\n\t\t\t\t\t\t\t\t\t// `\"\"` can be an explicitly set value.\n\t\t\t\t\t\t\t\t\tconst value = nativeGetData(mediaType);\n\n\t\t\t\t\t\t\t\t\t// not exposing data for unavailable types\n\t\t\t\t\t\t\t\t\tif (!isAnAvailableType({ type: mediaType, value })) {\n\t\t\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\treturn value;\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\t},\n});\n\n/**\n * Some events don't make sense for the external adapter\n *\n * `onGenerateDragPreview`\n * The browser creates the drag preview for external drags, so we don't\n * need an event to generate the preview for _monitors_ or the _dropTarget_\n *\n * `onDragStart`\n * An external drag can never start from in the `window`, so _dropTarget_'s\n * don't need `onDragStart`\n */\ntype StripEventsForDropTargets<T> = Omit<T, 'onGenerateDragPreview' | 'onDragStart'>;\ntype StripEventsForMonitors<T> = Omit<T, 'onGenerateDragPreview'>;\n\nexport function dropTargetForExternal(\n\targs: StripEventsForDropTargets<Parameters<typeof adapter.dropTarget>[0]>,\n): CleanupFn {\n\t// not removing unused events, just leaning on the type system\n\treturn adapter.dropTarget(args);\n}\n\nexport function monitorForExternal(\n\targs: StripEventsForMonitors<Parameters<typeof adapter.monitor>[0]>,\n): CleanupFn {\n\t// not removing unused events, just leaning on the type system\n\treturn adapter.monitor(args);\n}\n\n(function startup() {\n\t// server side rendering check\n\tif (typeof window === 'undefined') {\n\t\treturn;\n\t}\n\n\t// A shared single usage registration as we want to capture\n\t// all external drag operations, even if there are no drop targets\n\t// on the page yet\n\tadapter.registerUsage();\n\n\ttype State =\n\t\t| {\n\t\t\t\ttype: 'idle';\n\t\t  }\n\t\t| {\n\t\t\t\ttype: 'dragging';\n\t\t\t\tcleanup: () => void;\n\t\t  };\n\n\t// independent of pdnd, we need to keep track of\n\t// all drag operations so that we can know if a drag operation\n\t// has started locally\n\n\tconst idle: State = { type: 'idle' };\n\tlet state: State = idle;\n\n\tfunction clear() {\n\t\tif (state.type !== 'dragging') {\n\t\t\treturn;\n\t\t}\n\t\tdidDragStartLocally = false;\n\t\tstate.cleanup();\n\t\tstate = idle;\n\t}\n\n\tfunction bindEndEvents() {\n\t\treturn bindAll(\n\t\t\twindow,\n\t\t\t[\n\t\t\t\t{\n\t\t\t\t\ttype: 'dragend',\n\t\t\t\t\tlistener: clear,\n\t\t\t\t},\n\t\t\t\t...getBindingsForBrokenDrags({ onDragEnd: clear }),\n\t\t\t],\n\t\t\t// we want to make sure we get all the events,\n\t\t\t// and this helps avoid not seeing events when folks stop\n\t\t\t// them later on the event path\n\t\t\t{ capture: true },\n\t\t);\n\t}\n\n\t// we always keep this event listener active\n\tbind(window, {\n\t\ttype: 'dragstart',\n\t\tlistener() {\n\t\t\t// something bad has happened if this is true!\n\t\t\tif (state.type !== 'idle') {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// set our global flag\n\t\t\tdidDragStartLocally = true;\n\n\t\t\tstate = {\n\t\t\t\ttype: 'dragging',\n\t\t\t\tcleanup: bindEndEvents(),\n\t\t\t};\n\t\t},\n\t\t// binding in the capture phase so these listeners are called\n\t\t// before our listeners in the adapters `mount` function\n\t\toptions: { capture: true },\n\t});\n})();\n\n/** Common event payload for all events */\nexport type ExternalEventBasePayload = BaseEventPayload<ExternalDragType>;\n\n/** A map containing payloads for all events */\nexport type ExternalEventPayloadMap = StripEventsForMonitors<EventPayloadMap<ExternalDragType>>;\n\n/** Common event payload for all drop target events */\nexport type ExternalDropTargetEventBasePayload = DropTargetEventBasePayload<ExternalDragType>;\n\n/** A map containing payloads for all events on drop targets */\nexport type ExternalDropTargetEventPayloadMap = StripEventsForDropTargets<\n\tDropTargetEventPayloadMap<ExternalDragType>\n>;\n\n/** Arguments given to all feedback functions (eg `canDrop()`) on a `dropTargetForExternal` */\nexport type ExternalDropTargetGetFeedbackArgs = DropTargetGetFeedbackArgs<ExternalDragType>;\n\n/** Arguments given to all monitor feedback functions (eg `canMonitor()`) for a `monitorForExternal` */\nexport type ExternalMonitorGetFeedbackArgs = MonitorGetFeedbackArgs<ExternalDragType>;\n"
  },
  {
    "path": "packages/core/src/adapter/text-selection-adapter.ts",
    "content": "import { bind } from 'bind-event-listener';\n\nimport { makeHoneyPotFix } from '../honey-pot-fix/make-honey-pot-fix';\nimport {\n\ttype AdapterAPI,\n\ttype BaseEventPayload,\n\ttype CleanupFn,\n\ttype DropTargetArgs,\n\ttype DropTargetEventBasePayload,\n\ttype DropTargetEventPayloadMap,\n\ttype DropTargetGetFeedbackArgs,\n\ttype EventPayloadMap,\n\ttype MonitorArgs,\n\ttype MonitorGetFeedbackArgs,\n\ttype TextSelectionDragPayload,\n\ttype TextSelectionDragType,\n} from '../internal-types';\nimport { makeAdapter } from '../make-adapter/make-adapter';\nimport { combine } from '../public-utils/combine';\nimport { isSafari } from '../util/is-safari';\nimport { HTMLMediaType } from '../util/media-types/html-media-type';\nimport { textMediaType } from '../util/media-types/text-media-type';\n\nimport { elementAdapterNativeDataKey } from './element-adapter-native-data-key';\n\nfunction findTextNode(event: DragEvent): Text | null {\n\t// Standard: the `event.target` should be the closest `Text` node.\n\tif (event.target instanceof Text) {\n\t\treturn event.target;\n\t}\n\n\t// Structuring things this way so that if Safari fixes their bug\n\t// then the standard check will start working\n\tif (!isSafari()) {\n\t\treturn null;\n\t}\n\n\t/**\n\t * According to the spec, `event.target` should be the `Text` node that\n\t * the drag started from when dragging a text selection.\n\t *\n\t * → https://html.spec.whatwg.org/multipage/dnd.html#drag-and-drop-processing-model\n\t *\n\t * However, in Safari the closest `HTMLElement` is returned.\n\t * So we need to figure out if text is dragging ourselves.\n\t *\n\t * → https://bugs.webkit.org/show_bug.cgi?id=268959\n\t */\n\tif (!(event.target instanceof HTMLElement)) {\n\t\treturn null;\n\t}\n\n\t// Unlikely that this particular drag is a text selection drag\n\tif (event.target.draggable) {\n\t\treturn null;\n\t}\n\n\t// if the drag contains no text data, then not dragging selected text\n\t// return `null` if there is no dataTransfer, or if `getData()` returns \"\"\n\tif (!event.dataTransfer?.getData(textMediaType)) {\n\t\treturn null;\n\t}\n\n\t/**\n\t * Grab the first Text node and use that.\n\t * Only doing a single level search as that is all we need for this bug.\n\t */\n\tconst text: Text | undefined = Array.from(event.target.childNodes).find(\n\t\t(node): node is Text => node.nodeType === Node.TEXT_NODE,\n\t);\n\n\treturn text ?? null;\n}\n\nconst honeyPotFix = makeHoneyPotFix();\n\nconst adapter: {\n\tregisterUsage: () => CleanupFn;\n\tdropTarget: (args: DropTargetArgs<TextSelectionDragType>) => CleanupFn;\n\tmonitor: (args: MonitorArgs<TextSelectionDragType>) => CleanupFn;\n} = makeAdapter<TextSelectionDragType>({\n\ttypeKey: 'text-selection',\n\t// for text selection, we will usually be making a copy of the text\n\tdefaultDropEffect: 'copy',\n\tmount(api: AdapterAPI<TextSelectionDragType>): CleanupFn {\n\t\t// Binding to the `window` so that the element adapter has a\n\t\t// chance to get in first on the `document`.\n\t\t// We are giving preference to the element adapter.\n\t\treturn combine(\n\t\t\thoneyPotFix.bindEvents(),\n\t\t\tbind(window, {\n\t\t\t\ttype: 'dragstart',\n\t\t\t\tlistener(event: DragEvent) {\n\t\t\t\t\t// If the \"dragstart\" event is cancelled, then a drag won't start\n\t\t\t\t\t// There will be no further drag operation events (eg no \"dragend\" event)\n\t\t\t\t\tif (event.defaultPrevented) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Something has gone wrong with our drag event\n\t\t\t\t\tif (!event.dataTransfer) {\n\t\t\t\t\t\t// Including this code on \"test\" and \"development\" environments:\n\t\t\t\t\t\t// - Browser tests commonly run against \"development\" builds\n\t\t\t\t\t\t// - Unit tests commonly run in \"test\"\n\t\t\t\t\t\tif (process.env.NODE_ENV !== 'production') {\n\t\t\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\t\t\tconsole.warn(\n\t\t\t\t\t\t\t\t`\n                It appears as though you have are not testing DragEvents correctly.\n\n                - If you are unit testing, ensure you have polyfilled DragEvent.\n                - If you are browser testing, ensure you are dispatching drag events correctly.\n\n                Please see our testing guides for more information:\n                https://atlassian.design/components/pragmatic-drag-and-drop/core-package/testing\n              `.replace(/ {2}/g, ''),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Drag is being handled by the element adapter\n\t\t\t\t\tif (event.dataTransfer.types.includes(elementAdapterNativeDataKey)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Something else is handling this drag\n\t\t\t\t\tif (!api.canStart(event)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// no text being dragged\n\t\t\t\t\tif (!event.dataTransfer.types.includes(textMediaType)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst target: Text | null = findTextNode(event);\n\n\t\t\t\t\t// could not find `Text` node that is being dragged from\n\t\t\t\t\tif (!target) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst payload: TextSelectionDragPayload = {\n\t\t\t\t\t\t// The `Text` node that is the `target` is the `Text` node\n\t\t\t\t\t\t// that the user started the drag from.\n\t\t\t\t\t\t// The full text being dragged can be looked up from the `dataTransfer`.\n\t\t\t\t\t\ttarget,\n\t\t\t\t\t\tplain: event.dataTransfer.getData(textMediaType),\n\t\t\t\t\t\tHTML: event.dataTransfer.getData(HTMLMediaType),\n\t\t\t\t\t};\n\n\t\t\t\t\tapi.start({\n\t\t\t\t\t\tevent,\n\t\t\t\t\t\tdragType: {\n\t\t\t\t\t\t\ttype: 'text-selection',\n\t\t\t\t\t\t\tstartedFrom: 'internal',\n\t\t\t\t\t\t\tpayload,\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t},\n\tonPostDispatch: honeyPotFix.getOnPostDispatch(),\n});\n\n// The `onGenerateDragPreview` does not make sense to publish for text selection\n// as the browser is completely in control of the drag preview\ntype StripPreviewEvent<T> = Omit<T, 'onGenerateDragPreview'>;\n\nexport function dropTargetForTextSelection(\n\targs: StripPreviewEvent<Parameters<typeof adapter.dropTarget>[0]>,\n): CleanupFn {\n\t// note: not removing `onGenerateDragPreview`; just leaning on the type system\n\treturn adapter.dropTarget(args);\n}\n\n// A shared single usage registration as any text can be dragged at any time\n(function register() {\n\t// server side rendering check\n\tif (typeof window === 'undefined') {\n\t\treturn;\n\t}\n\tadapter.registerUsage();\n})();\n\nexport function monitorForTextSelection(\n\targs: StripPreviewEvent<Parameters<typeof adapter.monitor>[0]>,\n): CleanupFn {\n\t// note: not removing `onGenerateDragPreview`; just leaning on the type system\n\treturn adapter.monitor(args);\n}\n\n/** Common event payload for all events */\nexport type TextSelectionEventBasePayload = BaseEventPayload<TextSelectionDragType>;\n\n/** A map containing payloads for all events */\nexport type TextSelectionEventPayloadMap = StripPreviewEvent<\n\tEventPayloadMap<TextSelectionDragType>\n>;\n\n/** Common event payload for all drop target events */\nexport type TextSelectionDropTargetEventBasePayload =\n\tDropTargetEventBasePayload<TextSelectionDragType>;\n\n/** A map containing payloads for all events on drop targets */\nexport type TextSelectionDropTargetEventPayloadMap = StripPreviewEvent<\n\tDropTargetEventPayloadMap<TextSelectionDragType>\n>;\n\n/** Argument given to all feedback functions (eg `canDrop()`) on a `dropTargetForExternal` */\nexport type TextSelectionMonitorGetFeedbackArgs = MonitorGetFeedbackArgs<TextSelectionDragType>;\n\n/** Argument given to all monitor feedback functions (eg `canMonitor()`) for a `monitorForExternal` */\nexport type TextSelectionDropTargetGetFeedbackArgs =\n\tDropTargetGetFeedbackArgs<TextSelectionDragType>;\n"
  },
  {
    "path": "packages/core/src/entry-point/cancel-unhandled.ts",
    "content": "export { preventUnhandled } from '../public-utils/prevent-unhandled';\n"
  },
  {
    "path": "packages/core/src/entry-point/combine.ts",
    "content": "export { combine } from '../public-utils/combine';\n"
  },
  {
    "path": "packages/core/src/entry-point/element/adapter.ts",
    "content": "export {\n\tdraggable,\n\tdropTargetForElements,\n\tmonitorForElements,\n} from '../../adapter/element-adapter';\n\n// Payload for the draggable being dragged\nexport type { ElementDragPayload } from '../../internal-types';\n\nexport type {\n\t// Base events\n\tElementEventBasePayload,\n\tElementEventPayloadMap,\n\t// Drop target events\n\tElementDropTargetEventBasePayload,\n\tElementDropTargetEventPayloadMap,\n\t// Feedback types\n\tElementGetFeedbackArgs,\n\tElementDropTargetGetFeedbackArgs,\n\tElementMonitorGetFeedbackArgs,\n} from '../../adapter/element-adapter';\n"
  },
  {
    "path": "packages/core/src/entry-point/element/block-dragging-to-iframes.ts",
    "content": "export { blockDraggingToIFrames } from '../../public-utils/element/block-dragging-to-iframes';\n"
  },
  {
    "path": "packages/core/src/entry-point/element/center-under-pointer.ts",
    "content": "export { centerUnderPointer } from '../../public-utils/element/custom-native-drag-preview/center-under-pointer';\n"
  },
  {
    "path": "packages/core/src/entry-point/element/disable-native-drag-preview.ts",
    "content": "export { disableNativeDragPreview } from '../../public-utils/element/disable-native-drag-preview';\n"
  },
  {
    "path": "packages/core/src/entry-point/element/format-urls-for-external.ts",
    "content": "export { formatURLsForExternal } from '../../public-utils/element/format-urls-for-external';\n"
  },
  {
    "path": "packages/core/src/entry-point/element/pointer-outside-of-preview.ts",
    "content": "export { pointerOutsideOfPreview } from '../../public-utils/element/custom-native-drag-preview/pointer-outside-of-preview';\n"
  },
  {
    "path": "packages/core/src/entry-point/element/preserve-offset-on-source.ts",
    "content": "export { preserveOffsetOnSource } from '../../public-utils/element/custom-native-drag-preview/preserve-offset-on-source';\n"
  },
  {
    "path": "packages/core/src/entry-point/element/scroll-just-enough-into-view.ts",
    "content": "export { scrollJustEnoughIntoView } from '../../public-utils/element/scroll-just-enough-into-view';\n"
  },
  {
    "path": "packages/core/src/entry-point/element/set-custom-native-drag-preview.ts",
    "content": "export { setCustomNativeDragPreview } from '../../public-utils/element/custom-native-drag-preview/set-custom-native-drag-preview';\n"
  },
  {
    "path": "packages/core/src/entry-point/external/adapter.ts",
    "content": "export { monitorForExternal, dropTargetForExternal } from '../../adapter/external-adapter';\n\n// The data that is being dragged\nexport type { NativeMediaType, ExternalDragPayload } from '../../internal-types';\n\nexport type {\n\t// Base events\n\tExternalEventBasePayload,\n\tExternalEventPayloadMap,\n\t// Drop target events\n\tExternalDropTargetEventBasePayload,\n\tExternalDropTargetEventPayloadMap,\n\t// Feedback types\n\tExternalMonitorGetFeedbackArgs,\n\tExternalDropTargetGetFeedbackArgs,\n} from '../../adapter/external-adapter';\n"
  },
  {
    "path": "packages/core/src/entry-point/external/file.ts",
    "content": "export { getFiles, containsFiles } from '../../public-utils/external/file';\n"
  },
  {
    "path": "packages/core/src/entry-point/external/html.ts",
    "content": "export { getHTML, containsHTML } from '../../public-utils/external/html';\n"
  },
  {
    "path": "packages/core/src/entry-point/external/some.ts",
    "content": "export { some } from '../../public-utils/external/some';\n"
  },
  {
    "path": "packages/core/src/entry-point/external/text.ts",
    "content": "export { getText, containsText } from '../../public-utils/external/text';\n"
  },
  {
    "path": "packages/core/src/entry-point/external/url.ts",
    "content": "export { getURLs, containsURLs } from '../../public-utils/external/url';\n"
  },
  {
    "path": "packages/core/src/entry-point/once.ts",
    "content": "export { once } from '../public-utils/once';\n"
  },
  {
    "path": "packages/core/src/entry-point/prevent-unhandled.ts",
    "content": "export { preventUnhandled } from '../public-utils/prevent-unhandled';\n"
  },
  {
    "path": "packages/core/src/entry-point/private/get-element-from-point-without-honey-pot.ts",
    "content": "export { getElementFromPointWithoutHoneypot } from '../../honey-pot-fix/get-element-from-point-without-honey-pot';\n"
  },
  {
    "path": "packages/core/src/entry-point/reorder.ts",
    "content": "export { reorder } from '../public-utils/reorder';\n"
  },
  {
    "path": "packages/core/src/entry-point/text-selection/adapter.ts",
    "content": "export {\n\tmonitorForTextSelection,\n\tdropTargetForTextSelection,\n} from '../../adapter/text-selection-adapter';\n\n// Payload for the text selection being dragged\nexport type { TextSelectionDragPayload } from '../../internal-types';\n\nexport type {\n\t// Event types\n\tTextSelectionEventBasePayload,\n\tTextSelectionEventPayloadMap,\n\t// Drop targets\n\tTextSelectionDropTargetEventBasePayload,\n\tTextSelectionDropTargetEventPayloadMap,\n\t// Feedback types\n\tTextSelectionMonitorGetFeedbackArgs,\n\tTextSelectionDropTargetGetFeedbackArgs,\n} from '../../adapter/text-selection-adapter';\n"
  },
  {
    "path": "packages/core/src/entry-point/types.ts",
    "content": "export type {\n\tDropTargetAllowedDropEffect,\n\tDropTargetRecord,\n\tPosition,\n\tInput,\n\tDragLocation,\n\tDragLocationHistory,\n\tCleanupFn,\n\t// These types are not needed for consumers.\n\t// They are mostly helpful for other packages\n\tAllDragTypes,\n\tMonitorArgs,\n\tBaseEventPayload,\n\n\t// Exporting the members of `AllDragTypes`\n\t// This was needed for `pragmatic-drag-and-drop-auto-scroll`\n\t// so that it was no reaching into \"internal-types\" from \"/core\"\n\t// to extract the union members.\n\t// A \"deep import paths in type declaration files\" was created, which\n\t// is not allowed in our monorepo.\n\tElementDragType,\n\tTextSelectionDragType,\n\tExternalDragType,\n} from '../internal-types';\n"
  },
  {
    "path": "packages/core/src/honey-pot-fix/get-element-from-point-without-honey-pot.ts",
    "content": "import { type Position } from '../internal-types';\n\nimport { isHoneyPotElement } from './is-honey-pot-element';\n\nexport function getElementFromPointWithoutHoneypot(client: Position): Element | null {\n\t// eslint-disable-next-line no-restricted-syntax\n\tconst [top, second] = document.elementsFromPoint(client.x, client.y);\n\n\tif (!top) {\n\t\treturn null;\n\t}\n\n\tif (isHoneyPotElement(top)) {\n\t\treturn second ?? null;\n\t}\n\n\treturn top;\n}\n"
  },
  {
    "path": "packages/core/src/honey-pot-fix/honey-pot-data-attribute.ts",
    "content": "// pulling this into a separate file so adapter(s) that don't\n// need the honey pot can pay as little as possible for it.\nexport const honeyPotDataAttribute = 'data-pdnd-honey-pot';\n"
  },
  {
    "path": "packages/core/src/honey-pot-fix/is-honey-pot-element.ts",
    "content": "import { honeyPotDataAttribute } from './honey-pot-data-attribute';\n\nexport function isHoneyPotElement(target: EventTarget | null): boolean {\n\treturn target instanceof Element && target.hasAttribute(honeyPotDataAttribute);\n}\n"
  },
  {
    "path": "packages/core/src/honey-pot-fix/make-honey-pot-fix.ts",
    "content": "import { bind, bindAll } from 'bind-event-listener';\n\nimport {\n\ttype AllDragTypes,\n\ttype BaseEventPayload,\n\ttype CleanupFn,\n\ttype EventPayloadMap,\n\ttype Position,\n} from '../internal-types';\nimport { maxZIndex } from '../util/max-z-index';\n\nimport { honeyPotDataAttribute } from './honey-pot-data-attribute';\n\nconst honeyPotSize: number = 2;\nconst halfHoneyPotSize: number = honeyPotSize / 2;\n\n/**\n * `clientX` and `clientY` can be in sub pixels (eg `2.332`)\n * However, browser hitbox testing is commonly do to the closest pixel.\n *\n * → https://issues.chromium.org/issues/40940531\n *\n * To be sure that the honey pot will be over the `client` position,\n * we `.floor()` `clientX` and`clientY` and then make it `2px` in size.\n **/\nfunction floorToClosestPixel(point: Position): Position {\n\treturn {\n\t\tx: Math.floor(point.x),\n\t\ty: Math.floor(point.y),\n\t};\n}\n\n/**\n * We want to make sure the honey pot sits around the users position.\n * This seemed to be the most resilient while testing.\n */\nfunction pullBackByHalfHoneyPotSize(point: Position): Position {\n\treturn {\n\t\tx: point.x - halfHoneyPotSize,\n\t\ty: point.y - halfHoneyPotSize,\n\t};\n}\n\n/**\n * Prevent the honey pot from changing the window size.\n * This is super unlikely to occur, but just being safe.\n */\nfunction preventGoingBackwardsOffScreen(point: Position): Position {\n\treturn {\n\t\tx: Math.max(point.x, 0),\n\t\ty: Math.max(point.y, 0),\n\t};\n}\n\n/**\n * Prevent the honey pot from changing the window size.\n * This is super unlikely to occur, but just being safe.\n */\nfunction preventGoingForwardsOffScreen(point: Position): Position {\n\treturn {\n\t\tx: Math.min(point.x, window.innerWidth - honeyPotSize),\n\t\ty: Math.min(point.y, window.innerHeight - honeyPotSize),\n\t};\n}\n\n/**\n * Create a `2x2` `DOMRect` around the `client` position\n */\nfunction getHoneyPotRectFor({ client }: { client: Position }): DOMRect {\n\tconst point = preventGoingForwardsOffScreen(\n\t\tpreventGoingBackwardsOffScreen(pullBackByHalfHoneyPotSize(floorToClosestPixel(client))),\n\t);\n\n\t// When debugging, it is helpful to\n\t// make this element a bit bigger\n\treturn DOMRect.fromRect({\n\t\tx: point.x,\n\t\ty: point.y,\n\t\twidth: honeyPotSize,\n\t\theight: honeyPotSize,\n\t});\n}\n\nfunction getRectStyles({ clientRect }: { clientRect: DOMRect }): Partial<CSSStyleDeclaration> {\n\treturn {\n\t\tleft: `${clientRect.left}px`,\n\t\ttop: `${clientRect.top}px`,\n\t\twidth: `${clientRect.width}px`,\n\t\theight: `${clientRect.height}px`,\n\t};\n}\n\nfunction isWithin({ client, clientRect }: { client: Position; clientRect: DOMRect }): boolean {\n\treturn (\n\t\t// is within horizontal bounds\n\t\tclient.x >= clientRect.x &&\n\t\tclient.x <= clientRect.x + clientRect.width &&\n\t\t// is within vertical bounds\n\t\tclient.y >= clientRect.y &&\n\t\tclient.y <= clientRect.y + clientRect.height\n\t);\n}\n\ntype FinishHoneyPotArgs = { current: Position };\n\ntype FinishHoneyPotFn = (args: FinishHoneyPotArgs) => void;\n\n/**\n * The honey pot fix is designed to get around a painful bug in all browsers.\n *\n * [Overview](https://www.youtube.com/watch?v=udE9qbFTeQg)\n *\n * **Background**\n *\n * When a drag starts, browsers incorrectly think that the users pointer is\n * still depressed where the drag started. Any element that goes under this position\n * will be entered into, causing `\"mouseenter\"` events and `\":hover\"` styles to be applied.\n *\n * _This is a violation of the spec_\n *\n * > \"From the moment that the user agent is to initiate the drag-and-drop operation,\n * > until the end \tof the drag-and-drop operation, device input events\n * > (e.g. mouse and keyboard events) must be suppressed.\"\n * >\n * > - https://html.spec.whatwg.org/multipage/dnd.html#drag-and-drop-processing-model\n *\n * _Some impacts_\n *\n * - `\":hover\"` styles being applied where they shouldn't (looks messy)\n * - components such as tooltips responding to `\"mouseenter\"` can show during a drag,\n *   and on an element the user isn't even over\n *\n * Bug: https://issues.chromium.org/issues/41129937\n *\n * **Honey pot fix**\n *\n * 1. Create an element where the browser thinks the depressed pointer is\n *    to absorb the incorrect pointer events\n * 2. Remove that element when it is no longer needed\n */\nfunction mountHoneyPot({ initial }: { initial: Position }): FinishHoneyPotFn {\n\tconst element = document.createElement('div');\n\telement.setAttribute(honeyPotDataAttribute, 'true');\n\n\t// can shift during the drag thanks to Firefox\n\tlet clientRect: DOMRect = getHoneyPotRectFor({ client: initial });\n\n\tObject.assign(element.style, {\n\t\t// Setting a background color explicitly to avoid any inherited styles.\n\t\t// Looks like this could be `opacity: 0`, but worried that _might_\n\t\t// cause the element to be ignored on some platforms.\n\t\t// When debugging, set backgroundColor to something like \"red\".\n\t\tbackgroundColor: 'transparent',\n\n\t\tposition: 'fixed',\n\n\t\t// Being explicit to avoid inheriting styles\n\t\tpadding: 0,\n\t\tmargin: 0,\n\t\tboxSizing: 'border-box',\n\t\t...getRectStyles({ clientRect }),\n\n\t\t// We want this element to absorb pointer events,\n\t\t// it's kind of the whole point 😉\n\t\tpointerEvents: 'auto',\n\n\t\t// Want to make sure the honey pot is top of everything else.\n\t\t// Don't need to worry about native drag previews, as they will\n\t\t// have been rendered (and removed) before the honey pot is rendered\n\t\tzIndex: maxZIndex,\n\t});\n\n\tdocument.body.appendChild(element);\n\n\t/**\n\t *  🦊 In firefox we can get `\"pointermove\"` events after the drag\n\t * has started, which is a spec violation.\n\t * The final `\"pointermove\"` will reveal where the \"depressed\" position\n\t * is for our honey pot fix.\n\t */\n\tconst unbindPointerMove = bind(window, {\n\t\ttype: 'pointermove',\n\t\tlistener(event) {\n\t\t\tconst client: Position = {\n\t\t\t\tx: event.clientX,\n\t\t\t\ty: event.clientY,\n\t\t\t};\n\t\t\tclientRect = getHoneyPotRectFor({ client });\n\t\t\tObject.assign(element.style, getRectStyles({ clientRect }));\n\t\t},\n\t\t// using capture so we are less likely to be impacted by event stopping\n\t\toptions: { capture: true },\n\t});\n\n\treturn function finish({ current }: FinishHoneyPotArgs): void {\n\t\t// Don't need this any more\n\t\tunbindPointerMove();\n\n\t\t// If the user is hover the honey pot, we remove it\n\t\t// so that the user can continue to interact with the page normally.\n\t\tif (isWithin({ client: current, clientRect })) {\n\t\t\telement.remove();\n\t\t\treturn;\n\t\t}\n\n\t\tfunction cleanup() {\n\t\t\tunbindPostDragEvents();\n\t\t\telement.remove();\n\t\t}\n\n\t\tconst unbindPostDragEvents = bindAll(\n\t\t\twindow,\n\t\t\t[\n\t\t\t\t{ type: 'pointerdown', listener: cleanup },\n\t\t\t\t{ type: 'pointermove', listener: cleanup },\n\t\t\t\t{ type: 'focusin', listener: cleanup },\n\t\t\t\t{ type: 'focusout', listener: cleanup },\n\n\t\t\t\t// a 'pointerdown' should happen before 'dragstart', but just being super safe\n\t\t\t\t{ type: 'dragstart', listener: cleanup },\n\n\t\t\t\t// if the user has dragged something out of the window\n\t\t\t\t// and then is dragging something back into the window\n\t\t\t\t// the first events we will see are \"dragenter\" (and then \"dragover\").\n\t\t\t\t// So if we see any of these we need to clear the post drag fix.\n\t\t\t\t{ type: 'dragenter', listener: cleanup },\n\t\t\t\t{ type: 'dragover', listener: cleanup },\n\n\t\t\t\t// Not adding a \"wheel\" event listener, as \"wheel\" by itself does not\n\t\t\t\t// resolve the bug.\n\t\t\t],\n\t\t\t{\n\t\t\t\t// Using `capture` so less likely to be impacted by other code stopping events\n\t\t\t\tcapture: true,\n\t\t\t},\n\t\t);\n\t};\n}\n\nexport function makeHoneyPotFix(): {\n\tbindEvents: () => CleanupFn;\n\tgetOnPostDispatch: () => ({\n\t\teventName,\n\t\tpayload,\n\t}: {\n\t\teventName: keyof EventPayloadMap<AllDragTypes>;\n\t\tpayload: BaseEventPayload<AllDragTypes>;\n\t}) => void;\n} {\n\tlet latestPointerMove: Position | null = null;\n\tfunction bindEvents(): CleanupFn {\n\t\t// For sanity, only collecting this value from when events are first bound.\n\t\t// This prevents the case where a super old \"pointermove\" could be used\n\t\t// from a prior interaction.\n\t\tlatestPointerMove = null;\n\n\t\treturn bind(window, {\n\t\t\ttype: 'pointermove',\n\t\t\tlistener(event) {\n\t\t\t\tlatestPointerMove = {\n\t\t\t\t\tx: event.clientX,\n\t\t\t\t\ty: event.clientY,\n\t\t\t\t};\n\t\t\t},\n\t\t\t// listening for pointer move in capture phase\n\t\t\t// so we are less likely to be impacted by events being stopped.\n\t\t\toptions: { capture: true },\n\t\t});\n\t}\n\n\tfunction getOnPostDispatch() {\n\t\tlet finish: ReturnType<typeof mountHoneyPot> | null = null;\n\n\t\treturn function onPostEvent({\n\t\t\teventName,\n\t\t\tpayload,\n\t\t}: {\n\t\t\teventName: keyof EventPayloadMap<AllDragTypes>;\n\t\t\tpayload: BaseEventPayload<AllDragTypes>;\n\t\t}): void {\n\t\t\t// We are adding the honey pot `onDragStart` so we don't\n\t\t\t// impact the creation of the native drag preview.\n\t\t\tif (eventName === 'onDragStart') {\n\t\t\t\tconst { input } = payload.location.initial;\n\n\t\t\t\t// Sometimes there will be no latest \"pointermove\" (eg iOS).\n\t\t\t\t// In which case, we use the start position of the drag.\n\t\t\t\tconst initial = latestPointerMove ?? {\n\t\t\t\t\tx: input.clientX,\n\t\t\t\t\ty: input.clientY,\n\t\t\t\t};\n\n\t\t\t\t// Don't need to defensively call `finish()` as `onDrop` from\n\t\t\t\t// one interaction is guaranteed to be called before `onDragStart`\n\t\t\t\t// of the next.\n\t\t\t\tfinish = mountHoneyPot({ initial });\n\t\t\t}\n\t\t\tif (eventName === 'onDrop') {\n\t\t\t\tconst { input } = payload.location.current;\n\t\t\t\tfinish?.({\n\t\t\t\t\tcurrent: {\n\t\t\t\t\t\tx: input.clientX,\n\t\t\t\t\t\ty: input.clientY,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t\tfinish = null;\n\t\t\t\t// this interaction is finished, we want to use\n\t\t\t\t// the latest \"pointermove\" for each interaction\n\t\t\t\tlatestPointerMove = null;\n\t\t\t}\n\t\t};\n\t}\n\n\treturn { bindEvents, getOnPostDispatch };\n}\n"
  },
  {
    "path": "packages/core/src/index.ts",
    "content": "// This file exists for module resolution purposes.\n\n// Not exporting anything from the root entry point\n// Please use individual entry points in order to always\n// obtain minimum kbs.\n\nexport default {};\n"
  },
  {
    "path": "packages/core/src/internal-types.ts",
    "content": "export type CleanupFn = () => void;\n\n/**\n * Drop effects allowed to be passed to `getDropEffect()`.\n * Cannot use `\"none\"` as a `dropEffect` for drop targets as\n * it will opt out of accepting a drop for all nested drop targets.\n * Please use `canDrop()` to disable dropping for this drop target.\n */\nexport type DropTargetAllowedDropEffect = Exclude<DataTransfer['dropEffect'], 'none'>;\n\n/**\n * Information about a drop target\n */\nexport type DropTargetRecord = {\n\t/**\n\t * The element the drop target is attached to\n\t */\n\telement: Element;\n\t// using 'symbol' allows us to create uniquely typed keys / values\n\t/**\n\t * Data associated with the drop target\n\t *\n\t * (Collected by `getData()`)\n\t */\n\tdata: Record<string | symbol, unknown>;\n\t/**\n\t * The drop effect for the drop target\n\t *\n\t * (Collected by `getDropEffect()`)\n\t */\n\tdropEffect: DropTargetAllowedDropEffect;\n\t/**\n\t * Whether or not the drop target is active due to _stickiness_\n\t */\n\tisActiveDueToStickiness: boolean;\n};\n\nexport type Position = { x: number; y: number };\n\nexport type Serializable = {\n\t[key: string]: number | string | Serializable | Serializable[];\n};\nexport type Region = 'internal' | 'external';\n\nexport type ElementDragPayload = {\n\telement: HTMLElement;\n\tdragHandle: Element | null;\n\tdata: Record<string, unknown>;\n};\n\nexport type ElementDragType = {\n\ttype: 'element';\n\tstartedFrom: 'internal';\n\tpayload: ElementDragPayload;\n};\n\n/**\n * A convenance type to provide auto complete for common\n * media types. This type will accept any `string`.\n *\n * For more information on media types, see:\n *\n * - {@link https://atlassian.design/components/pragmatic-drag-and-drop/core-package/adapters/external/custom-media}\n * - {@link https://en.wikipedia.org/wiki/Media_type}\n */\nexport type NativeMediaType =\n\t| 'text/uri-list'\n\t| 'text/plain'\n\t| 'text/html'\n\t| 'Files'\n\t// A TS trick that allows this type to be any string,\n\t// but will populate auto complete for the provided strings\n\t// https://github.com/microsoft/TypeScript/issues/51717\n\t| (string & {});\n\nexport type ExternalDragPayload = {\n\t/**\n\t * The media types that are being dragged during a drag.\n\t *\n\t * @example\n\t *\n\t * console.log(source.types);\n\t * // → [\"text/plain\", \"text/html\"]\n\t */\n\ttypes: NativeMediaType[];\n\t/**\n\t * The entities that are being dragged.\n\t * Usually you will not be using these directly, but\n\t * our helper functions can leverage them to extract\n\t * particular kinds of data (eg files) that are being dragged\n\t */\n\titems: DataTransferItem[];\n\t/**\n\t * returns the data for a given media type.\n\t *\n\t * - `getStringData(mediaType)` will return `null` if there is no data for that media type\n\t * - `getStringData(mediaType)` will return the empty string (`\"\"`) if the empty string (`\"\"`)\n\t *      was explicitly set as the data for a media type.\n\t * - `getStringData(mediaType)` will return null if requesting files (ie `getStringData('Files')`).\n\t *      To access files, use `source.items`, or better still, `getFiles({source})`\n\t *\n\t * Generally we recommend folks use our helpers to read native data rather than `getStringData(mediaType)`\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Using getStringData()\n\t * const text: string | null = source.getStringData(\"text/plain\");\n\t *\n\t * // Using our text helper\n\t * const text: string | null = getText({source});\n\t * ```\n\t * */\n\tgetStringData: (mediaType: string) => string | null;\n};\n\nexport type ExternalDragType = {\n\ttype: 'external';\n\tstartedFrom: 'external';\n\tpayload: ExternalDragPayload;\n\tgetDropPayload: (event: DragEvent) => ExternalDragType['payload'];\n};\n\nexport type TextSelectionDragPayload = {\n\t/**\n\t * The `Text` node that is the user started the drag from.\n\t * Note: the `Text` node does not include all text being dragged.\n\t * Use the `plain` or `html` properties to get the full selection\n\t */\n\ttarget: Text;\n\t/** The plain text of the selection */\n\tplain: string;\n\t/** the HTML of the selection */\n\tHTML: string;\n\t/**\n\t * Not sure whether to include `window.getSelection()`, but it would be easy to include. I didn't include it for now as I am not sure what we should do if the selection changed during a drag (eg by unrelated updates)\n\t */\n\t// selection: Selection | null\n};\n\nexport type TextSelectionDragType = {\n\ttype: 'text-selection';\n\tstartedFrom: 'internal';\n\tpayload: TextSelectionDragPayload;\n};\n\nexport type AllDragTypes = ElementDragType | ExternalDragType | TextSelectionDragType;\n\nexport type AdapterAPI<DragType extends AllDragTypes> = {\n\tcanStart: (event: DragEvent) => boolean;\n\tstart: (args: { event: DragEvent; dragType: DragType }) => void;\n};\n\nexport type Input = {\n\taltKey: boolean;\n\tbutton: number;\n\tbuttons: number;\n\tctrlKey: boolean;\n\tmetaKey: boolean;\n\tshiftKey: boolean;\n\n\t// coordinates\n\tclientX: number;\n\tclientY: number;\n\tpageX: number;\n\tpageY: number;\n};\n\nexport type DragLocation = {\n\t/**\n\t * A users input at a point in time\n\t */\n\tinput: Input;\n\t/**\n\t * A _bubble_ ordered (innermost upwards) list of active drop targets\n\t *\n\t * @example\n\t * [grandChildRecord, childRecord, parentRecord]\n\t *\n\t */\n\tdropTargets: DropTargetRecord[];\n};\n\nexport type DragLocationHistory = {\n\t/**\n\t * Where the drag operation started\n\t */\n\tinitial: DragLocation;\n\t/**\n\t * Where the user currently is\n\t */\n\tcurrent: DragLocation;\n\t/**\n\t * Where the user was previously.\n\t * `previous` points to what `current` was in the last dispatched event\n\t *\n\t * `previous` is particularly useful for `onDropTargetChange`\n\t * (and the derived `onDragEnter` and `onDragLeave`)\n\t * as you can know what the delta of the change\n\t *\n\t * Exception: `onGenerateDragPreview` and `onDragStart` will have the\n\t * same `current` and `previous` values. This is done so that the data\n\t * received in `onDragStart` feels logical\n\t * (`location.previous` should be `[]` in `onDragStart`)\n\t */\n\tprevious: Pick<DragLocation, 'dropTargets'>;\n};\n\n/**\n * The common data that is provided to all events\n */\nexport type BaseEventPayload<DragType extends AllDragTypes> = {\n\t/**\n\t * Location history for the drag operation\n\t */\n\tlocation: DragLocationHistory;\n\t/**\n\t * Data associated with the entity that is being dragged\n\t */\n\tsource: DragType['payload'];\n};\n\nexport type EventPayloadMap<DragType extends AllDragTypes> = {\n\t/**\n\t * Drag is about to start.\n\t * Make changes you want to see in the drag preview\n\t *\n\t * _Drag previews are not generated for external drag sources (eg files)_\n\t */\n\tonGenerateDragPreview: BaseEventPayload<DragType> & {\n\t\t/**\n\t\t * Allows you to use the native `setDragImage` function if you want\n\t\t * Although, we recommend using alternative techniques (see element adapter docs)\n\t\t */\n\t\tnativeSetDragImage: DataTransfer['setDragImage'] | null;\n\t};\n\t/**\n\t * A drag operation has started. You can make changes to the DOM and those changes won't be reflected in your _drag preview_\n\t */\n\tonDragStart: BaseEventPayload<DragType>;\n\t/**\n\t * A throttled update of where the the user is currently dragging. Useful if you want to create a high fidelity experience such as drawing.\n\t */\n\tonDrag: BaseEventPayload<DragType>;\n\t/**\n\t * The `onDropTargetChange` event fires when the `dropTarget` hierarchy changes during a drag.\n\t */\n\tonDropTargetChange: BaseEventPayload<DragType>;\n\t/**\n\t * The `onDrop` event occurs when a user has finished a drag and drop operation.\n\t * The `onDrop` event will fire when the drag operation finishes, regardless of how the drag operation finished\n\t * (eg due to an explicit drop, the drag being canceled, recovering from an error and so on). On the web platform\n\t * we cannot distinguish between dropping on no drop targets and an explicit cancel, so we do not publish any\n\t * information about _how_ the drag ended, only that it ended.\n\t *\n\t * The `location.current` property will accurately contain the final drop targets.\n\t */\n\tonDrop: BaseEventPayload<DragType>;\n};\n\nexport type AllEvents<DragType extends AllDragTypes> = {\n\t[EventName in keyof EventPayloadMap<DragType>]: (\n\t\targs: EventPayloadMap<DragType>[EventName],\n\t) => void;\n};\n\nexport type MonitorGetFeedbackArgs<DragType extends AllDragTypes> = {\n\t/**\n\t * The users `initial` drag location\n\t */\n\tinitial: DragLocation;\n\t/**\n\t * The data associated with the entity being dragged\n\t */\n\tsource: DragType['payload'];\n};\n\nexport type MonitorArgs<DragType extends AllDragTypes> = Partial<AllEvents<DragType>> & {\n\tcanMonitor?: (args: MonitorGetFeedbackArgs<DragType>) => boolean;\n};\n\nexport type DropTargetGetFeedbackArgs<DragType extends AllDragTypes> = {\n\t/**\n\t * The users _current_ input\n\t */\n\tinput: Input;\n\t/**\n\t * The data associated with the entity being dragged\n\t */\n\tsource: DragType['payload'];\n\t/**\n\t * This drop target's element\n\t */\n\telement: Element;\n};\n\nexport type DropTargetLocalizedData = {\n\t/**\n\t * A convenance pointer to this drop targets values\n\t */\n\tself: DropTargetRecord;\n};\n\n// Not directly used internally, but might be helpful for consumers\nexport type DropTargetEventBasePayload<DragType extends AllDragTypes> = BaseEventPayload<DragType> &\n\tDropTargetLocalizedData;\n/**\n * Mapping event names to the payloads for those events\n */\nexport type DropTargetEventPayloadMap<DragType extends AllDragTypes> = {\n\t[EventName in keyof EventPayloadMap<DragType>]: EventPayloadMap<DragType>[EventName] &\n\t\tDropTargetLocalizedData;\n} & {\n\t/**\n\t * Derived from the `onDropTargetChange` event\n\t * (`onDragEnter` is not it's own event that bubbles)\n\t *\n\t * `onDragEnter` is fired when _this_ drop target is entered into\n\t * and not when any child drop targets change\n\t */\n\tonDragEnter: EventPayloadMap<DragType>['onDropTargetChange'] & DropTargetLocalizedData;\n\t/**\n\t * Derived from the `onDropTargetChange` event\n\t * (`onDragLeave` is not it's own event that bubbles)\n\t *\n\t * `onDragLeave` is fired when _this_ drop target is exited from\n\t * and not when any child drop targets change\n\t */\n\tonDragLeave: EventPayloadMap<DragType>['onDropTargetChange'] & DropTargetLocalizedData;\n};\n\nexport type DropTargetArgs<DragType extends AllDragTypes> = {\n\t/**\n\t * The `element` that you want to attach drop target behaviour to.\n\t * The `element` is the unique _key_ for a drop target\n\t */\n\telement: Element;\n\t/**\n\t * A function that returns `data` you want to attach to the drop target.\n\t * `getData()` is called _repeatedly_ while the user is dragging over the drop target in order to power addons\n\t */\n\tgetData?: (args: DropTargetGetFeedbackArgs<DragType>) => Record<string | symbol, unknown>;\n\t/**\n\t * Used to conditionally block dropping.\n\t * By default a drop target can be dropped on.\n\t *\n\t * Return `false` if you want to block a drop.\n\t *\n\t * Blocking dropping on a drop target will not block\n\t * dropping on child or parent drop targets.\n\t * If you want child or parent drop targets to block dropping,\n\t * then they will need to return `false` from their `canDrop()`\n\t *\n\t * `canDrop()` is called _repeatedly_ while a drop target\n\t * is being dragged over to allow you to dynamically\n\t * change your mind as to whether a drop target can be\n\t * dropped on.\n\t */\n\tcanDrop?: (args: DropTargetGetFeedbackArgs<DragType>) => boolean;\n\t/**\n\t * Optionally provide a _drop effect_ to be applied when\n\t * this drop target is the innermost drop target being dragged over.\n\t */\n\tgetDropEffect?: (args: DropTargetGetFeedbackArgs<DragType>) => DropTargetAllowedDropEffect;\n\t/**\n\t * Return `true` if you want your drop target to hold onto\n\t * selection after the user is no longer dragging over this drop target.\n\t *\n\t * Stickiness defaults to `false`\n\t *\n\t * _For more details about the stickiness algorithm please refer to the docs_\n\t */\n\tgetIsSticky?: (args: DropTargetGetFeedbackArgs<DragType>) => boolean;\n} & {\n\t[EventName in keyof DropTargetEventPayloadMap<DragType>]?: (\n\t\targs: DropTargetEventPayloadMap<DragType>[EventName],\n\t) => void;\n};\n\nexport type DropTargetAPI<DragType extends AllDragTypes> = {\n\tdropTargetForConsumers: (args: DropTargetArgs<DragType>) => CleanupFn;\n\tdispatchEvent: <EventName extends keyof EventPayloadMap<DragType>>(args: {\n\t\teventName: EventName;\n\t\tpayload: EventPayloadMap<DragType>[EventName];\n\t}) => void;\n\tgetIsOver: (args: {\n\t\tsource: DragType['payload'];\n\t\ttarget: EventTarget | null;\n\t\tinput: Input;\n\t\tcurrent: DropTargetRecord[];\n\t}) => DropTargetRecord[];\n};\n"
  },
  {
    "path": "packages/core/src/ledger/dispatch-consumer-event.ts",
    "content": "import rafSchd from 'raf-schd';\n\nimport {\n\ttype AllDragTypes,\n\ttype DragLocation,\n\ttype DragLocationHistory,\n\ttype EventPayloadMap,\n} from '../internal-types';\n\nconst scheduleOnDrag = rafSchd((fn: () => void) => fn());\n\nconst dragStart = (() => {\n\tlet scheduled: { frameId: number; fn: () => void } | null = null;\n\n\tfunction schedule(fn: () => void) {\n\t\tconst frameId = requestAnimationFrame(() => {\n\t\t\tscheduled = null;\n\t\t\tfn();\n\t\t});\n\t\tscheduled = {\n\t\t\tframeId: frameId,\n\t\t\tfn,\n\t\t};\n\t}\n\tfunction flush() {\n\t\tif (scheduled) {\n\t\t\tcancelAnimationFrame(scheduled.frameId);\n\t\t\tscheduled.fn();\n\t\t\tscheduled = null;\n\t\t}\n\t}\n\n\treturn { schedule, flush };\n})();\n\nexport function makeDispatch<DragType extends AllDragTypes>({\n\tsource,\n\tinitial,\n\tdispatchEvent,\n}: {\n\tsource: DragType['payload'];\n\tinitial: DragLocation;\n\tdispatchEvent: <EventName extends keyof EventPayloadMap<DragType>>(args: {\n\t\teventName: EventName;\n\t\tpayload: EventPayloadMap<DragType>[EventName];\n\t}) => void;\n}): {\n\tstart({ nativeSetDragImage }: { nativeSetDragImage: DataTransfer['setDragImage'] | null }): void;\n\tdragUpdate({ current }: { current: DragLocation }): void;\n\tdrag({ current }: { current: DragLocation }): void;\n\tdrop({\n\t\tcurrent,\n\t\tupdatedSourcePayload,\n\t}: {\n\t\tcurrent: DragLocation;\n\t\t/** When dragging from an external source, we need to collect the\n      drag source information again as it is often only available during\n      the \"drop\" event */\n\t\tupdatedSourcePayload: DragType['payload'] | null;\n\t}): void;\n} {\n\tlet previous: DragLocationHistory['previous'] = { dropTargets: [] };\n\n\tfunction safeDispatch(args: Parameters<typeof dispatchEvent>[0]) {\n\t\tdispatchEvent(args);\n\t\tprevious = { dropTargets: args.payload.location.current.dropTargets };\n\t}\n\n\tconst dispatch = {\n\t\tstart({ nativeSetDragImage }: { nativeSetDragImage: DataTransfer['setDragImage'] | null }) {\n\t\t\t// Ensuring that both `onGenerateDragPreview` and `onDragStart` get the same location.\n\t\t\t// We do this so that `previous` is`[]` in `onDragStart` (which is logical)\n\t\t\tconst location = {\n\t\t\t\tcurrent: initial,\n\t\t\t\tprevious,\n\t\t\t\tinitial,\n\t\t\t};\n\t\t\t// a `onGenerateDragPreview` does _not_ add another entry for `previous`\n\t\t\t// onDragPreview\n\t\t\tsafeDispatch({\n\t\t\t\teventName: 'onGenerateDragPreview',\n\t\t\t\tpayload: {\n\t\t\t\t\tsource,\n\t\t\t\t\tlocation,\n\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t},\n\t\t\t});\n\t\t\tdragStart.schedule(() => {\n\t\t\t\tsafeDispatch({\n\t\t\t\t\teventName: 'onDragStart',\n\t\t\t\t\tpayload: {\n\t\t\t\t\t\tsource,\n\t\t\t\t\t\tlocation,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t});\n\t\t},\n\t\tdragUpdate({ current }: { current: DragLocation }) {\n\t\t\tdragStart.flush();\n\t\t\tscheduleOnDrag.cancel();\n\t\t\tsafeDispatch({\n\t\t\t\teventName: 'onDropTargetChange',\n\t\t\t\tpayload: {\n\t\t\t\t\tsource,\n\t\t\t\t\tlocation: {\n\t\t\t\t\t\tinitial,\n\t\t\t\t\t\tprevious,\n\t\t\t\t\t\tcurrent,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t});\n\t\t},\n\t\tdrag({ current }: { current: DragLocation }) {\n\t\t\tscheduleOnDrag(() => {\n\t\t\t\tdragStart.flush();\n\t\t\t\tconst location = {\n\t\t\t\t\tinitial,\n\t\t\t\t\tprevious,\n\t\t\t\t\tcurrent,\n\t\t\t\t};\n\t\t\t\tsafeDispatch({\n\t\t\t\t\teventName: 'onDrag',\n\t\t\t\t\tpayload: {\n\t\t\t\t\t\tsource,\n\t\t\t\t\t\tlocation,\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t});\n\t\t},\n\t\tdrop({\n\t\t\tcurrent,\n\t\t\tupdatedSourcePayload,\n\t\t}: {\n\t\t\tcurrent: DragLocation;\n\t\t\t/** When dragging from an external source, we need to collect the\n          drag source information again as it is often only available during\n          the \"drop\" event */\n\t\t\tupdatedSourcePayload: DragType['payload'] | null;\n\t\t}) {\n\t\t\tdragStart.flush();\n\t\t\tscheduleOnDrag.cancel();\n\t\t\tsafeDispatch({\n\t\t\t\teventName: 'onDrop',\n\t\t\t\tpayload: {\n\t\t\t\t\tsource: updatedSourcePayload ?? source,\n\t\t\t\t\tlocation: {\n\t\t\t\t\t\tcurrent,\n\t\t\t\t\t\tprevious,\n\t\t\t\t\t\tinitial,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t});\n\t\t},\n\t};\n\treturn dispatch;\n}\n"
  },
  {
    "path": "packages/core/src/ledger/lifecycle-manager.ts",
    "content": "import { bindAll } from 'bind-event-listener';\n\nimport { getElementFromPointWithoutHoneypot } from '../honey-pot-fix/get-element-from-point-without-honey-pot';\nimport { isHoneyPotElement } from '../honey-pot-fix/is-honey-pot-element';\nimport {\n\ttype AllDragTypes,\n\ttype DragLocation,\n\ttype DropTargetAPI,\n\ttype DropTargetRecord,\n\ttype EventPayloadMap,\n\ttype Input,\n} from '../internal-types';\nimport { isLeavingWindow } from '../util/changing-window/is-leaving-window';\nimport { getBindingsForBrokenDrags } from '../util/detect-broken-drag';\nimport { getInput } from '../util/get-input';\n\nimport { makeDispatch } from './dispatch-consumer-event';\n\nconst globalState = {\n\tisActive: false,\n};\n\nfunction canStart(): boolean {\n\treturn !globalState.isActive;\n}\n\nfunction getNativeSetDragImage(event: DragEvent): DataTransfer['setDragImage'] | null {\n\tif (event.dataTransfer) {\n\t\t// need to use `.bind` as `setDragImage` is required\n\t\t// to be run with `event.dataTransfer` as the \"this\" context\n\t\treturn event.dataTransfer.setDragImage.bind(event.dataTransfer);\n\t}\n\treturn null;\n}\n\nfunction hasHierarchyChanged({\n\tcurrent,\n\tnext,\n}: {\n\tcurrent: DropTargetRecord[];\n\tnext: DropTargetRecord[];\n}): boolean {\n\tif (current.length !== next.length) {\n\t\treturn true;\n\t}\n\t// not checking stickiness, data or dropEffect,\n\t// just whether the hierarchy has changed\n\tfor (let i = 0; i < current.length; i++) {\n\t\tif (current[i].element !== next[i].element) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\nfunction start<DragType extends AllDragTypes>({\n\tevent,\n\tdragType,\n\tgetDropTargetsOver,\n\tdispatchEvent,\n}: {\n\tevent: DragEvent;\n\tdragType: DragType;\n\tgetDropTargetsOver: DropTargetAPI<DragType>['getIsOver'];\n\tdispatchEvent: <EventName extends keyof EventPayloadMap<DragType>>(args: {\n\t\teventName: EventName;\n\t\tpayload: EventPayloadMap<DragType>[EventName];\n\t}) => void;\n}): void {\n\tif (!canStart()) {\n\t\treturn;\n\t}\n\tconst initial: DragLocation = getStartLocation({\n\t\tevent,\n\t\tdragType,\n\t\tgetDropTargetsOver,\n\t});\n\n\tglobalState.isActive = true;\n\n\ttype LocalState = {\n\t\tcurrent: DragLocation;\n\t};\n\n\tconst state: LocalState = {\n\t\tcurrent: initial,\n\t};\n\n\t// Setting initial drop effect for the drag\n\tsetDropEffectOnEvent({ event, current: initial.dropTargets });\n\n\tconst dispatch = makeDispatch<DragType>({\n\t\tsource: dragType.payload,\n\t\tdispatchEvent,\n\t\tinitial,\n\t});\n\n\tfunction updateState(next: DragLocation) {\n\t\t// only looking at whether hierarchy has changed to determine whether something as 'changed'\n\t\tconst hasChanged = hasHierarchyChanged({\n\t\t\tcurrent: state.current.dropTargets,\n\t\t\tnext: next.dropTargets,\n\t\t});\n\n\t\t// Always updating the state to include latest data, dropEffect and stickiness\n\t\t// Only updating consumers if the hierarchy has changed in some way\n\t\t// Consumers can get the latest data by using `onDrag`\n\t\tstate.current = next;\n\n\t\tif (hasChanged) {\n\t\t\tdispatch.dragUpdate({\n\t\t\t\tcurrent: state.current,\n\t\t\t});\n\t\t}\n\t}\n\n\tfunction onUpdateEvent(event: DragEvent) {\n\t\tconst input: Input = getInput(event);\n\n\t\t// If we are over the honey pot, we need to get the element\n\t\t// that the user would have been over if not for the honey pot\n\t\tconst target = isHoneyPotElement(event.target)\n\t\t\t? getElementFromPointWithoutHoneypot({ x: input.clientX, y: input.clientY })\n\t\t\t: event.target;\n\n\t\tconst nextDropTargets = getDropTargetsOver({\n\t\t\ttarget,\n\t\t\tinput,\n\t\t\tsource: dragType.payload,\n\t\t\tcurrent: state.current.dropTargets,\n\t\t});\n\n\t\tif (nextDropTargets.length) {\n\t\t\t// 🩸 must call `event.preventDefault()` to allow a browser drop to occur\n\t\t\tevent.preventDefault();\n\t\t\tsetDropEffectOnEvent({ event, current: nextDropTargets });\n\t\t}\n\n\t\tupdateState({ dropTargets: nextDropTargets, input });\n\t}\n\n\tfunction cancel() {\n\t\t// The spec behaviour is that when a drag is cancelled, or when dropping on no drop targets,\n\t\t// a \"dragleave\" event is fired on the active drop target before a \"dragend\" event.\n\t\t// We are replicating that behaviour in `cancel` if there are any active drop targets to\n\t\t// ensure consistent behaviour.\n\t\t//\n\t\t// Note: When cancelling, or dropping on no drop targets, a \"dragleave\" event\n\t\t// will have already cleared the dropTargets to `[]` (as that particular \"dragleave\" has a `relatedTarget` of `null`)\n\n\t\tif (state.current.dropTargets.length) {\n\t\t\tupdateState({ dropTargets: [], input: state.current.input });\n\t\t}\n\n\t\tdispatch.drop({\n\t\t\tcurrent: state.current,\n\t\t\tupdatedSourcePayload: null,\n\t\t});\n\n\t\tfinish();\n\t}\n\n\tfunction finish() {\n\t\tglobalState.isActive = false;\n\t\tunbindEvents();\n\t}\n\n\tconst unbindEvents = bindAll(\n\t\twindow,\n\t\t[\n\t\t\t{\n\t\t\t\t// 👋 Note: we are repurposing the `dragover` event as our `drag` event\n\t\t\t\t// this is because firefox does not publish pointer coordinates during\n\t\t\t\t// a `drag` event, but does for every other type of drag event\n\t\t\t\t// `dragover` fires on all elements that are being dragged over\n\t\t\t\t// Because we are binding to `window` - our `dragover` is effectively the same as a `drag`\n\t\t\t\t// 🦊😤\n\t\t\t\ttype: 'dragover',\n\t\t\t\tlistener(event: DragEvent) {\n\t\t\t\t\t// We need to regularly calculate the drop targets in order to allow:\n\t\t\t\t\t//  - dynamic `canDrop()` checks\n\t\t\t\t\t//  - rapid updating `getData()` calls to attach data in response to user input (eg for edge detection)\n\t\t\t\t\t// Sadly we cannot schedule inspecting changes resulting from this event\n\t\t\t\t\t// we need to be able to conditionally cancel the event with `event.preventDefault()`\n\t\t\t\t\t// to enable the correct native drop experience.\n\n\t\t\t\t\t// 1. check to see if anything has changed\n\t\t\t\t\tonUpdateEvent(event);\n\n\t\t\t\t\t// 2. let consumers know a move has occurred\n\t\t\t\t\t// This will include the latest 'input' values\n\t\t\t\t\tdispatch.drag({\n\t\t\t\t\t\tcurrent: state.current,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'dragenter',\n\t\t\t\tlistener: onUpdateEvent,\n\t\t\t},\n\n\t\t\t{\n\t\t\t\ttype: 'dragleave',\n\t\t\t\tlistener(event: DragEvent) {\n\t\t\t\t\tif (!isLeavingWindow({ dragLeave: event })) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n\t\t\t\t\t * At this point we don't know if a drag is being cancelled,\n\t\t\t\t\t * or if a drag is leaving the `window`.\n\t\t\t\t\t *\n\t\t\t\t\t * Both have:\n\t\t\t\t\t *   1. \"dragleave\" (with `relatedTarget: null`)\n\t\t\t\t\t *   2. \"dragend\" (a \"dragend\" can occur when outside the `window`)\n\t\t\t\t\t *\n\t\t\t\t\t * **Clearing drop targets**\n\t\t\t\t\t *\n\t\t\t\t\t * For either case we are clearing the the drop targets\n\t\t\t\t\t *\n\t\t\t\t\t * - cancelling: we clear drop targets in `\"dragend\"` anyway\n\t\t\t\t\t * - leaving the `window`: we clear the drop targets (to clear stickiness)\n\t\t\t\t\t *\n\t\t\t\t\t * **Leaving the window and finishing the drag**\n\t\t\t\t\t *\n\t\t\t\t\t * _internal drags_\n\t\t\t\t\t *\n\t\t\t\t\t * - The drag continues when the user is outside the `window`\n\t\t\t\t\t *   and can resume if the user drags back over the `window`,\n\t\t\t\t\t *   or end when the user drops in an external `window`.\n\t\t\t\t\t * - We will get a `\"dragend\"`, or we can listen for other\n\t\t\t\t\t *   events to determine the drag is finished when the user re-enters the `window`).\n\t\t\t\t\t *\n\t\t\t\t\t * _external drags_\n\t\t\t\t\t *\n\t\t\t\t\t * - We conclude the drag operation.\n\t\t\t\t\t * - We have no idea if the user will drag back over the `window`,\n\t\t\t\t\t *   or if the drag ends elsewhere.\n\t\t\t\t\t * - We will create a new drag if the user re-enters the `window`.\n\t\t\t\t\t *\n\t\t\t\t\t * **Not updating `input`**\n\t\t\t\t\t *\n\t\t\t\t\t * 🐛 Bug[Chrome] the final `\"dragleave\"` has default input values (eg `clientX == 0`)\n\t\t\t\t\t * Workaround: intentionally not updating `input` in \"dragleave\"\n\t\t\t\t\t * rather than the users current input values\n\t\t\t\t\t * - [Conversation](https://twitter.com/alexandereardon/status/1642697633864241152)\n\t\t\t\t\t * - [Bug](https://bugs.chromium.org/p/chromium/issues/detail?id=1429937)\n\t\t\t\t\t **/\n\n\t\t\t\t\tupdateState({ input: state.current.input, dropTargets: [] });\n\n\t\t\t\t\tif (dragType.startedFrom === 'external') {\n\t\t\t\t\t\tcancel();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\t// A \"drop\" can only happen if the browser allowed the drop\n\t\t\t\ttype: 'drop',\n\t\t\t\tlistener(event: DragEvent) {\n\t\t\t\t\t// Capture the final input.\n\t\t\t\t\t// We are capturing the final `input` for the\n\t\t\t\t\t// most accurate honey pot experience\n\t\t\t\t\tstate.current = {\n\t\t\t\t\t\tdropTargets: state.current.dropTargets,\n\t\t\t\t\t\tinput: getInput(event),\n\t\t\t\t\t};\n\n\t\t\t\t\t/** If there are no drop targets, then we will get\n\t\t\t\t\t * a \"drop\" event if:\n\t\t\t\t\t * - `preventUnhandled()` is being used\n\t\t\t\t\t * - there is an unmanaged drop target (eg another library)\n\t\t\t\t\t * In these cases, it's up to the consumer\n\t\t\t\t\t * to handle the drop if it's not over one of our drop targets\n\t\t\t\t\t * - `preventUnhandled()` will cancel the \"drop\"\n\t\t\t\t\t * - unmanaged drop targets can handle the \"drop\" how they want to\n\t\t\t\t\t * We won't call `event.preventDefault()` in this call path */\n\n\t\t\t\t\tif (!state.current.dropTargets.length) {\n\t\t\t\t\t\tcancel();\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t// applying the latest drop effect to the event\n\t\t\t\t\tsetDropEffectOnEvent({ event, current: state.current.dropTargets });\n\n\t\t\t\t\tdispatch.drop({\n\t\t\t\t\t\tcurrent: state.current,\n\t\t\t\t\t\t// When dropping something native, we need to extract the latest\n\t\t\t\t\t\t// `.items` from the \"drop\" event as it is now accessible\n\t\t\t\t\t\tupdatedSourcePayload:\n\t\t\t\t\t\t\tdragType.type === 'external' ? dragType.getDropPayload(event) : null,\n\t\t\t\t\t});\n\n\t\t\t\t\tfinish();\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\t// \"dragend\" fires when on the drag source (eg a draggable element)\n\t\t\t\t// when the drag is finished.\n\t\t\t\t// \"dragend\" will fire after \"drop\" (if there was a successful drop)\n\t\t\t\t// \"dragend\" does not fire if the draggable source has been removed during the drag\n\t\t\t\t// or for external drag sources (eg files)\n\n\t\t\t\t// This \"dragend\" listener will not fire if there was a successful drop\n\t\t\t\t// as we will have already removed the event listener\n\n\t\t\t\ttype: 'dragend',\n\t\t\t\tlistener(event) {\n\t\t\t\t\t// In firefox, the position of the \"dragend\" event can\n\t\t\t\t\t// be a bit different to the last \"dragover\" event.\n\t\t\t\t\t// Updating the input so we can get the best possible\n\t\t\t\t\t// information for the honey pot.\n\t\t\t\t\tstate.current = {\n\t\t\t\t\t\tdropTargets: state.current.dropTargets,\n\t\t\t\t\t\tinput: getInput(event),\n\t\t\t\t\t};\n\t\t\t\t\tcancel();\n\t\t\t\t},\n\t\t\t},\n\t\t\t...getBindingsForBrokenDrags({\n\t\t\t\tonDragEnd: cancel,\n\t\t\t}),\n\t\t],\n\t\t// Once we have started a managed drag operation it is important that we see / own all drag events\n\t\t// We got one adoption bug pop up where some code was stopping (`event.stopPropagation()`)\n\t\t// all \"drop\" events in the bubble phase on the `document.body`.\n\t\t// This meant that we never saw the \"drop\" event.\n\t\t{ capture: true },\n\t);\n\n\tdispatch.start({\n\t\tnativeSetDragImage: getNativeSetDragImage(event),\n\t});\n}\n\nfunction setDropEffectOnEvent({\n\tevent,\n\tcurrent,\n}: {\n\tevent: DragEvent;\n\tcurrent: DropTargetRecord[];\n}) {\n\t// setting the `dropEffect` to be the innerMost drop targets dropEffect\n\tconst innerMost = current[0]?.dropEffect;\n\tif (innerMost != null && event.dataTransfer) {\n\t\tevent.dataTransfer.dropEffect = innerMost;\n\t}\n}\n\nfunction getStartLocation<DragType extends AllDragTypes>({\n\tevent,\n\tdragType,\n\tgetDropTargetsOver,\n}: {\n\tevent: DragEvent;\n\tdragType: DragType;\n\tgetDropTargetsOver: DropTargetAPI<DragType>['getIsOver'];\n}): DragLocation {\n\tconst input: Input = getInput(event);\n\n\t// When dragging from outside of the browser,\n\t// the drag is not being sourced from any local drop targets\n\tif (dragType.startedFrom === 'external') {\n\t\treturn {\n\t\t\tinput,\n\t\t\tdropTargets: [],\n\t\t};\n\t}\n\n\tconst dropTargets: DropTargetRecord[] = getDropTargetsOver({\n\t\tinput,\n\t\tsource: dragType.payload,\n\t\ttarget: event.target,\n\t\tcurrent: [],\n\t});\n\treturn {\n\t\tinput,\n\t\tdropTargets,\n\t};\n}\n\nexport const lifecycle: {\n\tcanStart: typeof canStart;\n\tstart: typeof start;\n} = {\n\tcanStart,\n\tstart,\n};\n"
  },
  {
    "path": "packages/core/src/ledger/usage-ledger.ts",
    "content": "import { type AllDragTypes, type CleanupFn } from '../internal-types';\n\ntype Entry<TypeKey extends AllDragTypes['type']> = {\n\ttypeKey: TypeKey;\n\tunmount: () => void;\n\tusageCount: number;\n};\n\n// Extending `Map` to allow us to link Key and Values together\ninterface Ledger extends Map<AllDragTypes['type'], Entry<AllDragTypes['type']>> {\n\tget<Key extends AllDragTypes['type']>(key: Key): Entry<Key> | undefined;\n\tset<Key extends AllDragTypes['type'], Value extends Entry<Key>>(key: Key, value: Value): this;\n}\n\nconst ledger: Ledger = new Map();\n\nfunction registerUsage<TypeKey extends AllDragTypes['type']>({\n\ttypeKey,\n\tmount,\n}: {\n\ttypeKey: TypeKey;\n\tmount: () => CleanupFn;\n}): Entry<TypeKey> {\n\tconst entry: Entry<TypeKey> | undefined = ledger.get(typeKey);\n\n\tif (entry) {\n\t\tentry.usageCount++;\n\t\treturn entry;\n\t}\n\n\tconst initial: Entry<TypeKey> = {\n\t\ttypeKey,\n\t\tunmount: mount(),\n\t\tusageCount: 1,\n\t};\n\tledger.set(typeKey, initial);\n\n\treturn initial;\n}\n\nexport function register<TypeKey extends AllDragTypes['type']>(args: {\n\ttypeKey: TypeKey;\n\tmount: () => CleanupFn;\n}): CleanupFn {\n\tconst entry: Entry<TypeKey> = registerUsage(args);\n\n\treturn function unregister() {\n\t\tentry.usageCount--;\n\n\t\tif (entry.usageCount > 0) {\n\t\t\treturn;\n\t\t}\n\t\t// Only a single usage left, remove it\n\t\tentry.unmount();\n\t\tledger.delete(args.typeKey);\n\t};\n}\n"
  },
  {
    "path": "packages/core/src/make-adapter/make-adapter.ts",
    "content": "import {\n\ttype AdapterAPI,\n\ttype AllDragTypes,\n\ttype CleanupFn,\n\ttype DropTargetAllowedDropEffect,\n\ttype DropTargetArgs,\n\ttype EventPayloadMap,\n\ttype MonitorArgs,\n} from '../internal-types';\nimport { lifecycle } from '../ledger/lifecycle-manager';\nimport { register } from '../ledger/usage-ledger';\n\nimport { makeDropTarget } from './make-drop-target';\nimport { makeMonitor } from './make-monitor';\n\nexport function makeAdapter<DragType extends AllDragTypes>({\n\ttypeKey,\n\tmount,\n\tdispatchEventToSource,\n\tonPostDispatch,\n\tdefaultDropEffect,\n}: {\n\ttypeKey: DragType['type'];\n\tmount: (api: AdapterAPI<DragType>) => CleanupFn;\n\tdefaultDropEffect: DropTargetAllowedDropEffect;\n\tdispatchEventToSource?: <EventName extends keyof EventPayloadMap<DragType>>(args: {\n\t\teventName: EventName;\n\t\tpayload: EventPayloadMap<DragType>[EventName];\n\t}) => void;\n\tonPostDispatch?: <EventName extends keyof EventPayloadMap<DragType>>(args: {\n\t\teventName: EventName;\n\t\tpayload: EventPayloadMap<DragType>[EventName];\n\t}) => void;\n}): {\n\tregisterUsage: () => CleanupFn;\n\tdropTarget: (args: DropTargetArgs<DragType>) => CleanupFn;\n\tmonitor: (args: MonitorArgs<DragType>) => CleanupFn;\n} {\n\tconst monitorAPI = makeMonitor<DragType>();\n\tconst dropTargetAPI = makeDropTarget({\n\t\ttypeKey,\n\t\tdefaultDropEffect,\n\t});\n\n\tfunction dispatchEvent<EventName extends keyof EventPayloadMap<DragType>>(args: {\n\t\teventName: EventName;\n\t\tpayload: EventPayloadMap<DragType>[EventName];\n\t}) {\n\t\t// 1. forward the event to source\n\t\tdispatchEventToSource?.(args);\n\n\t\t// 2. forward the event to relevant dropTargets\n\t\tdropTargetAPI.dispatchEvent(args);\n\n\t\t// 3. forward event to monitors\n\t\tmonitorAPI.dispatchEvent(args);\n\n\t\t// 4. post consumer dispatch (used for honey pot fix)\n\t\tonPostDispatch?.(args);\n\t}\n\n\tfunction start({ event, dragType }: { event: DragEvent; dragType: DragType }) {\n\t\tlifecycle.start({\n\t\t\tevent,\n\t\t\tdragType,\n\t\t\tgetDropTargetsOver: dropTargetAPI.getIsOver,\n\t\t\tdispatchEvent,\n\t\t});\n\t}\n\n\tfunction registerUsage(): CleanupFn {\n\t\tfunction mountAdapter(): CleanupFn {\n\t\t\tconst api: AdapterAPI<DragType> = {\n\t\t\t\tcanStart: lifecycle.canStart,\n\t\t\t\tstart,\n\t\t\t};\n\t\t\treturn mount(api);\n\t\t}\n\n\t\treturn register({ typeKey, mount: mountAdapter });\n\t}\n\n\treturn {\n\t\tregisterUsage,\n\t\tdropTarget: dropTargetAPI.dropTargetForConsumers,\n\t\tmonitor: monitorAPI.monitorForConsumers,\n\t};\n}\n"
  },
  {
    "path": "packages/core/src/make-adapter/make-drop-target.ts",
    "content": "import {\n\ttype AllDragTypes,\n\ttype CleanupFn,\n\ttype DropTargetAllowedDropEffect,\n\ttype DropTargetAPI,\n\ttype DropTargetArgs,\n\ttype DropTargetGetFeedbackArgs,\n\ttype DropTargetRecord,\n\ttype EventPayloadMap,\n\ttype Input,\n} from '../internal-types';\nimport { combine } from '../public-utils/combine';\nimport { once } from '../public-utils/once';\nimport { addAttribute } from '../util/add-attribute';\n\nfunction copyReverse<Value>(array: Value[]): Value[] {\n\treturn array.slice(0).reverse();\n}\n\nexport function makeDropTarget<DragType extends AllDragTypes>({\n\ttypeKey,\n\tdefaultDropEffect,\n}: {\n\ttypeKey: DragType['type'];\n\tdefaultDropEffect: DropTargetAllowedDropEffect;\n}): DropTargetAPI<DragType> {\n\tconst registry = new WeakMap<Element, DropTargetArgs<DragType>>();\n\n\tconst dropTargetDataAtt = `data-drop-target-for-${typeKey}`;\n\tconst dropTargetSelector = `[${dropTargetDataAtt}]`;\n\n\tfunction addToRegistry(args: DropTargetArgs<DragType>): CleanupFn {\n\t\tregistry.set(args.element, args);\n\t\treturn () => registry.delete(args.element);\n\t}\n\n\tfunction dropTargetForConsumers(args: DropTargetArgs<DragType>) {\n\t\t// Guardrail: warn if the draggable element is already registered\n\t\tif (process.env.NODE_ENV !== 'production') {\n\t\t\tconst existing = registry.get(args.element);\n\t\t\tif (existing) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn(`You have already registered a [${typeKey}] dropTarget on the same element`, {\n\t\t\t\t\texisting,\n\t\t\t\t\tproposed: args,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (args.element instanceof HTMLIFrameElement) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.warn(\n\t\t\t\t\t`\n            We recommend not registering <iframe> elements as drop targets\n            as it can result in some strange browser event ordering.\n          `\n\t\t\t\t\t\t// Removing newlines and excessive whitespace\n\t\t\t\t\t\t.replace(/\\s{2,}/g, ' ')\n\t\t\t\t\t\t.trim(),\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\tconst cleanup = combine(\n\t\t\taddAttribute(args.element, {\n\t\t\t\tattribute: dropTargetDataAtt,\n\t\t\t\tvalue: 'true',\n\t\t\t}),\n\t\t\taddToRegistry(args),\n\t\t);\n\n\t\t// Wrapping in `once` to prevent unexpected side effects if consumers call\n\t\t// the clean up function multiple times.\n\t\treturn once(cleanup);\n\t}\n\n\tfunction getActualDropTargets({\n\t\tsource,\n\t\ttarget,\n\t\tinput,\n\t\tresult = [],\n\t}: {\n\t\tsource: DragType['payload'];\n\t\ttarget: EventTarget | null;\n\t\tinput: Input;\n\t\tresult?: DropTargetRecord[];\n\t}): DropTargetRecord[] {\n\t\tif (target == null) {\n\t\t\treturn result;\n\t\t}\n\n\t\tif (!(target instanceof Element)) {\n\t\t\t// For \"text-selection\" drags, the original `target`\n\t\t\t// is not an `Element`, so we need to start looking from\n\t\t\t// the parent element\n\t\t\tif (target instanceof Node) {\n\t\t\t\treturn getActualDropTargets({\n\t\t\t\t\tsource,\n\t\t\t\t\ttarget: target.parentElement,\n\t\t\t\t\tinput,\n\t\t\t\t\tresult,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// not sure what we are working with,\n\t\t\t// so we can exit.\n\t\t\treturn result;\n\t\t}\n\n\t\tconst closest = target.closest(dropTargetSelector);\n\n\t\t// Cannot find anything else\n\t\tif (closest == null) {\n\t\t\treturn result;\n\t\t}\n\n\t\tconst args: DropTargetArgs<DragType> | undefined = registry.get(closest);\n\n\t\t// error: something had a dropTargetSelector but we could not\n\t\t// find a match. For now, failing silently\n\t\tif (args == null) {\n\t\t\treturn result;\n\t\t}\n\n\t\tconst feedback: DropTargetGetFeedbackArgs<DragType> = {\n\t\t\tinput,\n\t\t\tsource,\n\t\t\telement: args.element,\n\t\t};\n\n\t\t// if dropping is not allowed, skip this drop target\n\t\t// and continue looking up the DOM tree\n\t\tif (args.canDrop && !args.canDrop(feedback)) {\n\t\t\treturn getActualDropTargets({\n\t\t\t\tsource,\n\t\t\t\ttarget: args.element.parentElement,\n\t\t\t\tinput,\n\t\t\t\tresult,\n\t\t\t});\n\t\t}\n\n\t\t// calculate our new record\n\t\tconst data: Record<string | symbol, unknown> = args.getData?.(feedback) ?? {};\n\t\tconst dropEffect: DropTargetAllowedDropEffect | null =\n\t\t\targs.getDropEffect?.(feedback) ?? defaultDropEffect;\n\t\tconst record: DropTargetRecord = {\n\t\t\tdata,\n\t\t\telement: args.element,\n\t\t\tdropEffect,\n\t\t\t// we are collecting _actual_ drop targets, so these are\n\t\t\t// being applied _not_ due to stickiness\n\t\t\tisActiveDueToStickiness: false,\n\t\t};\n\n\t\treturn getActualDropTargets({\n\t\t\tsource,\n\t\t\ttarget: args.element.parentElement,\n\t\t\tinput,\n\t\t\t// Using bubble ordering. Same ordering as `event.getPath()`\n\t\t\tresult: [...result, record],\n\t\t});\n\t}\n\n\ttype DispatchEventArgs<EventName extends keyof EventPayloadMap<DragType>> = {\n\t\teventName: EventName;\n\t\tpayload: EventPayloadMap<DragType>[EventName];\n\t};\n\n\tfunction notifyCurrent<EventName extends keyof EventPayloadMap<DragType>>({\n\t\teventName,\n\t\tpayload,\n\t}: DispatchEventArgs<EventName>): void {\n\t\tfor (const record of payload.location.current.dropTargets) {\n\t\t\tconst entry = registry.get(record.element);\n\t\t\tconst args: EventPayloadMap<DragType>[EventName] = {\n\t\t\t\t...payload,\n\t\t\t\tself: record,\n\t\t\t};\n\t\t\tentry?.[eventName]?.(\n\t\t\t\t// I cannot seem to get the types right here.\n\t\t\t\t// TS doesn't seem to like that one event can need `nativeSetDragImage`\n\t\t\t\t// @ts-expect-error\n\t\t\t\targs,\n\t\t\t);\n\t\t}\n\t}\n\n\tconst actions: {\n\t\t[EventName in keyof EventPayloadMap<DragType>]: (args: DispatchEventArgs<EventName>) => void;\n\t} = {\n\t\tonGenerateDragPreview: notifyCurrent,\n\t\tonDrag: notifyCurrent,\n\t\tonDragStart: notifyCurrent,\n\t\tonDrop: notifyCurrent,\n\t\tonDropTargetChange: ({ payload }) => {\n\t\t\tconst isCurrent = new Set<Element>(\n\t\t\t\tpayload.location.current.dropTargets.map((record) => record.element),\n\t\t\t);\n\n\t\t\tconst visited = new Set<Element>();\n\t\t\tfor (const record of payload.location.previous.dropTargets) {\n\t\t\t\tvisited.add(record.element);\n\t\t\t\tconst entry = registry.get(record.element);\n\t\t\t\tconst isOver: boolean = isCurrent.has(record.element);\n\n\t\t\t\tconst args = {\n\t\t\t\t\t...payload,\n\t\t\t\t\tself: record,\n\t\t\t\t};\n\t\t\t\tentry?.onDropTargetChange?.(args);\n\n\t\t\t\t// if we cannot find the drop target in the current array, then it has been left\n\t\t\t\tif (!isOver) {\n\t\t\t\t\tentry?.onDragLeave?.(args);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (const record of payload.location.current.dropTargets) {\n\t\t\t\t// already published an update to this drop target\n\t\t\t\tif (visited.has(record.element)) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t// at this point we have a new drop target that is being entered into\n\t\t\t\tconst args = {\n\t\t\t\t\t...payload,\n\t\t\t\t\tself: record,\n\t\t\t\t};\n\t\t\t\tconst entry = registry.get(record.element);\n\t\t\t\tentry?.onDropTargetChange?.(args);\n\t\t\t\tentry?.onDragEnter?.(args);\n\t\t\t}\n\t\t},\n\t};\n\n\tfunction dispatchEvent<EventName extends keyof EventPayloadMap<DragType>>(\n\t\targs: DispatchEventArgs<EventName>,\n\t): void {\n\t\tactions[args.eventName](args);\n\t}\n\n\tfunction getIsOver({\n\t\tsource,\n\t\ttarget,\n\t\tinput,\n\t\tcurrent,\n\t}: {\n\t\tsource: DragType['payload'];\n\t\ttarget: EventTarget | null;\n\t\tinput: Input;\n\t\tcurrent: DropTargetRecord[];\n\t}): DropTargetRecord[] {\n\t\tconst actual: DropTargetRecord[] = getActualDropTargets({\n\t\t\tsource,\n\t\t\ttarget,\n\t\t\tinput,\n\t\t});\n\n\t\t// stickiness is only relevant when we have less\n\t\t// drop targets than we did before\n\t\tif (actual.length >= current.length) {\n\t\t\treturn actual;\n\t\t}\n\n\t\t// less 'actual' drop targets than before,\n\t\t// we need to see if 'stickiness' applies\n\n\t\t// An old drop target will continue to be dropped on if:\n\t\t// 1. it has the same parent\n\t\t// 2. nothing exists in it's previous index\n\n\t\tconst lastCaptureOrdered = copyReverse(current);\n\t\tconst actualCaptureOrdered = copyReverse(actual);\n\n\t\tconst resultCaptureOrdered: DropTargetRecord[] = [];\n\n\t\tfor (let index = 0; index < lastCaptureOrdered.length; index++) {\n\t\t\tconst last: DropTargetRecord = lastCaptureOrdered[index];\n\t\t\tconst fresh: DropTargetRecord | undefined = actualCaptureOrdered[index];\n\n\t\t\t// if a record is in the new index -> use that\n\t\t\t// it will have the latest data + dropEffect\n\t\t\tif (fresh != null) {\n\t\t\t\tresultCaptureOrdered.push(fresh);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// At this point we have no drop target in the old spot\n\t\t\t// Check to see if we can use a previous sticky drop target\n\n\t\t\t// The \"parent\" is the one inside of `resultCaptureOrdered`\n\t\t\t// (the parent might be a drop target that was sticky)\n\t\t\tconst parent: DropTargetRecord | undefined = resultCaptureOrdered[index - 1];\n\t\t\tconst lastParent: DropTargetRecord | undefined = lastCaptureOrdered[index - 1];\n\n\t\t\t// Stickiness is based on parent relationships, so if the parent relationship has change\n\t\t\t// then we can stop our search\n\t\t\tif (parent?.element !== lastParent?.element) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// We need to check whether the old drop target can still be dropped on\n\n\t\t\tconst argsForLast = registry.get(last.element);\n\n\t\t\t// We cannot drop on a drop target that is no longer mounted\n\t\t\tif (!argsForLast) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst feedback: DropTargetGetFeedbackArgs<DragType> = {\n\t\t\t\tinput,\n\t\t\t\tsource,\n\t\t\t\telement: argsForLast.element,\n\t\t\t};\n\n\t\t\t// We cannot drop on a drop target that no longer allows being dropped on\n\t\t\tif (argsForLast.canDrop && !argsForLast.canDrop(feedback)) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// We cannot drop on a drop target that is no longer sticky\n\t\t\tif (!argsForLast.getIsSticky?.(feedback)) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// Note: intentionally not recollecting `getData()` or `getDropEffect()`\n\t\t\t// Previous values for `data` and `dropEffect` will be borrowed\n\t\t\t// This is to prevent things like the 'closest edge' changing when\n\t\t\t// no longer over a drop target.\n\t\t\t// We could change our mind on this behaviour in the future\n\n\t\t\tresultCaptureOrdered.push({\n\t\t\t\t...last,\n\t\t\t\t// making it clear to consumers this drop target is active due to stickiness\n\t\t\t\tisActiveDueToStickiness: true,\n\t\t\t});\n\t\t}\n\n\t\t// return bubble ordered result\n\t\treturn copyReverse(resultCaptureOrdered);\n\t}\n\n\treturn {\n\t\tdropTargetForConsumers,\n\t\tgetIsOver,\n\t\tdispatchEvent,\n\t};\n}\n"
  },
  {
    "path": "packages/core/src/make-adapter/make-monitor.ts",
    "content": "import {\n\ttype AllDragTypes,\n\ttype CleanupFn,\n\ttype EventPayloadMap,\n\ttype MonitorArgs,\n\ttype MonitorGetFeedbackArgs,\n} from '../internal-types';\nimport { once } from '../public-utils/once';\n\ntype DraggingState<DragType extends AllDragTypes> = {\n\tcanMonitorArgs: MonitorGetFeedbackArgs<DragType>;\n\tactive: Set<MonitorArgs<DragType>>;\n};\n\nexport function makeMonitor<DragType extends AllDragTypes>(): {\n\tdispatchEvent: <EventName extends keyof EventPayloadMap<DragType>>({\n\t\teventName,\n\t\tpayload,\n\t}: {\n\t\teventName: EventName;\n\t\tpayload: EventPayloadMap<DragType>[EventName];\n\t}) => void;\n\tmonitorForConsumers: (args: MonitorArgs<DragType>) => CleanupFn;\n} {\n\tconst registry = new Set<MonitorArgs<DragType>>();\n\n\tlet dragging: DraggingState<DragType> | null = null;\n\n\tfunction tryAddToActive(monitor: MonitorArgs<DragType>) {\n\t\tif (!dragging) {\n\t\t\treturn;\n\t\t}\n\t\t// Monitor is allowed to monitor events if:\n\t\t// 1. It has no `canMonitor` function (default is that a monitor can listen to everything)\n\t\t// 2. `canMonitor` returns true\n\t\tif (!monitor.canMonitor || monitor.canMonitor(dragging.canMonitorArgs)) {\n\t\t\tdragging.active.add(monitor);\n\t\t}\n\t}\n\n\tfunction monitorForConsumers(args: MonitorArgs<DragType>): CleanupFn {\n\t\t// We are giving each `args` a new reference so that you\n\t\t// can create multiple monitors with the same `args`.\n\t\tconst entry: MonitorArgs<DragType> = { ...args };\n\n\t\tregistry.add(entry);\n\n\t\t// if there is an active drag we need to see if this new monitor is relevant\n\t\ttryAddToActive(entry);\n\n\t\tfunction cleanup() {\n\t\t\tregistry.delete(entry);\n\n\t\t\t// We need to stop publishing events during a drag to this monitor!\n\t\t\tif (dragging) {\n\t\t\t\tdragging.active.delete(entry);\n\t\t\t}\n\t\t}\n\n\t\t// Wrapping in `once` to prevent unexpected side effects if consumers call\n\t\t// the clean up function multiple times.\n\t\treturn once(cleanup);\n\t}\n\n\tfunction dispatchEvent<EventName extends keyof EventPayloadMap<DragType>>({\n\t\teventName,\n\t\tpayload,\n\t}: {\n\t\teventName: EventName;\n\t\tpayload: EventPayloadMap<DragType>[EventName];\n\t}): void {\n\t\tif (eventName === 'onGenerateDragPreview') {\n\t\t\tdragging = {\n\t\t\t\tcanMonitorArgs: {\n\t\t\t\t\tinitial: payload.location.initial,\n\t\t\t\t\tsource: payload.source,\n\t\t\t\t},\n\t\t\t\tactive: new Set(),\n\t\t\t};\n\t\t\tfor (const monitor of registry) {\n\t\t\t\ttryAddToActive(monitor);\n\t\t\t}\n\t\t}\n\n\t\t// This should never happen.\n\t\tif (!dragging) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Creating an array from the set _before_ iterating\n\t\t// This is so that monitors added during the current event will not be called.\n\t\t// This behaviour matches native EventTargets where an event listener\n\t\t// cannot add another event listener during an active event to the same\n\t\t// event target in the same event (for us we have a single global event target)\n\t\tconst active: MonitorArgs<DragType>[] = Array.from(dragging.active);\n\t\tfor (const monitor of active) {\n\t\t\t// A monitor can be removed by another monitor during an event.\n\t\t\t// We need to check that the monitor is still registered before calling it\n\t\t\tif (dragging.active.has(monitor)) {\n\t\t\t\t// @ts-expect-error: I cannot get this type working!\n\t\t\t\tmonitor[eventName]?.(payload);\n\t\t\t}\n\t\t}\n\n\t\tif (eventName === 'onDrop') {\n\t\t\tdragging.active.clear();\n\t\t\tdragging = null;\n\t\t}\n\t}\n\n\treturn {\n\t\tdispatchEvent,\n\t\tmonitorForConsumers,\n\t};\n}\n"
  },
  {
    "path": "packages/core/src/public-utils/combine.ts",
    "content": "import { type CleanupFn } from '../internal-types';\n\n/** Create a new combined function that will call all the provided functions */\nexport function combine(...fns: CleanupFn[]): CleanupFn {\n\treturn function cleanup() {\n\t\tfns.forEach((fn) => fn());\n\t};\n}\n"
  },
  {
    "path": "packages/core/src/public-utils/custom-external-data-type-media-type-prefix.ts",
    "content": "export const customDataMediaTypePrefix = 'application/vnd.pdnd-custom-data-';\n"
  },
  {
    "path": "packages/core/src/public-utils/element/block-dragging-to-iframes.ts",
    "content": "import { monitorForElements } from '../../adapter/element-adapter';\nimport { type CleanupFn } from '../../internal-types';\nimport { combine } from '../combine';\n\n/**\n * Set a `style` property on a `HTMLElement`\n *\n * @returns a `cleanup` function to restore the `style` property to it's original state\n */\nfunction setStyle(\n\tel: HTMLElement,\n\t{\n\t\tproperty,\n\t\trule,\n\t\tpriority = '',\n\t}: { property: string; rule: string; priority?: 'important' | '' },\n): CleanupFn {\n\tconst originalValue = el.style.getPropertyValue(property);\n\tconst originalPriority = el.style.getPropertyPriority(property);\n\tel.style.setProperty(property, rule, priority);\n\treturn function cleanup() {\n\t\tel.style.setProperty(property, originalValue, originalPriority);\n\t};\n}\n\nlet isActive: boolean = false;\n\n/**\n * Start blocking dragging to iframes. Only to be called once a drag has started.\n */\nfunction tryStart(): void {\n\t// There can technically be multiple registrations on the same element.\n\t// Adding a guard to ensure that only one registration does the blocking.\n\tif (isActive) {\n\t\treturn;\n\t}\n\n\tisActive = true;\n\n\t// At this stage, we are also not watching for new iframe elements being added to the page\n\t// (we _could_ do that as a future change)\n\tconst iframeCleanups = Array.from(document.querySelectorAll('iframe')).map((iframe) =>\n\t\tsetStyle(iframe, { property: 'pointer-events', rule: 'none', priority: 'important' }),\n\t);\n\n\t// Not returning the cleanup function.\n\t// This code will clean itself up when the interaction ends in `onDrop()`.\n\t// Once a drag has started we are blocking iframes until the interaction is finished.\n\tconst cleanup = combine(\n\t\t...iframeCleanups,\n\t\t// We only need this monitor for listening to the drop\n\t\t// as our monitor in `blockDraggingToIFrames()` will only\n\t\t// call this function when the drag has started\n\t\tmonitorForElements({\n\t\t\tonDrop() {\n\t\t\t\tcleanup();\n\t\t\t},\n\t\t}),\n\t\tfunction release() {\n\t\t\tisActive = false;\n\t\t},\n\t);\n}\n\n/**\n * Block dragging of a draggable element to <iframe> elements.\n *\n * @description\n *\n * - This function sets `pointer-events:none !important` to all `<iframe>` elements for the duration of the drag.\n * - Once an `<iframe>` is disabled, it will only be re-enabled once the current drag interaction is completed (and not when the `CleanupFn` is called)\n * - This function currently does not watch for new `<iframe>` elements being adding during a drag operation.\n */\nexport function blockDraggingToIFrames({ element }: { element: HTMLElement }): CleanupFn {\n\treturn monitorForElements({\n\t\tonGenerateDragPreview({ source }) {\n\t\t\t// only starting if we are dragging the provided element\n\t\t\tif (source.element === element) {\n\t\t\t\ttryStart();\n\t\t\t}\n\t\t},\n\t});\n}\n"
  },
  {
    "path": "packages/core/src/public-utils/element/custom-native-drag-preview/center-under-pointer.ts",
    "content": "import type { GetOffsetFn } from './types';\n\nexport const centerUnderPointer: GetOffsetFn = function centerUnderPointer({ container }) {\n\tconst rect = container.getBoundingClientRect();\n\treturn { x: rect.width / 2, y: rect.height / 2 };\n};\n"
  },
  {
    "path": "packages/core/src/public-utils/element/custom-native-drag-preview/pointer-outside-of-preview.ts",
    "content": "import { isAndroid } from '../../../util/android';\nimport { isSafariOnIOS } from '../../../util/is-safari-on-ios';\n\nimport { centerUnderPointer } from './center-under-pointer';\nimport type { GetOffsetFn } from './types';\n\n/** Any valid CSS string value\n * @example `calc(var(--grid) * 2)\n */\ntype CSSValue = string;\n\n/**\n * Position the native drag preview **in front** of the users pointer.\n *\n * **Distance**\n *\n * If the total width of your preview (including the offset applied by this function)\n * exceeds `280px` then the drag preview will have more opacity applied on Windows.\n *\n * https://atlassian.design/components/pragmatic-drag-and-drop/web-platform-design-constraints\n *\n * **Direction**\n *\n * This function will position the drag preview on the _right hand side for left to right (`ltr`) interfaces_, and on the _left hand side for right to left (`rtl`) languages_.\n *\n * The direction will be calculated based on the direction (`dir`) being applied to the `container`\n * element (which will be a child of the `body` element).\n *\n * **iOS, iPadOS and Android**\n *\n * The drag preview will be centered under the users pointer rather than\n * pushed away on iOS due to platform limitations.\n */\nexport function pointerOutsideOfPreview(point: { x: CSSValue; y: CSSValue }): GetOffsetFn {\n\treturn function getOffset({ container }) {\n\t\t/**\n\t\t * **Approach: transparent borders.**\n\t\t *\n\t\t * The only reliable cross browser technique found to push a\n\t\t * drag preview away from the cursor is to use transparent borders on the container.\n\t\t *\n\t\t * **🙅📱 Not pushing the preview away on touch devices**\n\t\t *\n\t\t * _On iOS_\n\t\t *\n\t\t * Safari will set the transparent border color to be black\n\t\t *\n\t\t * `iOS@18.4.1` on May 7th 2025:\n\t\t * - If you set the background color on the `container` the border color will be that\n\t\t * - Setting a transparent background color on the `container` still results in a\n\t\t *   black border\n\t\t * - The `<body>` text or background color does not change the black border color\n\t\t *\n\t\t * While dragging, the drag preview will shift under the center of the users pointer.\n\t\t * So if you start at {x: 0, y: 0} (top left), almost immediately the preview will move\n\t\t * to be under the middle of the users pointer.\n\t\t *\n\t\t * _On Android_\n\t\t *\n\t\t * Chrome will put the center of the drag preview under the users pointer immediately.\n\t\t *\n\t\t * Tested on `Chrome@137` on `Android 14` on June 20th 2025\n\t\t *\n\t\t * _What we do_\n\t\t *\n\t\t * We don't add the transparent border\n\t\t *\n\t\t * - Avoid the black color on iOS\n\t\t * - It isn't needed on Android anyway as the preview will be under the center\n\t\t *   of the users pointer\n\t\t *\n\t\t * We put the center of the drag preview under the users pointer\n\t\t *\n\t\t * - Avoids the drag preview quickly moving from a top corner to be centered under\n\t\t *   the users pointer on iOS\n\t\t * - It will be under the center on Android no matter what we do\n\t\t *\n\t\t * We previously had a isTouchDevice() check, but it felt safer for now\n\t\t * to have a more targeted check, as these are the devices that have been\n\t\t * tested on.\n\t\t */\n\t\tif (isSafariOnIOS() || isAndroid()) {\n\t\t\treturn centerUnderPointer({ container });\n\t\t}\n\n\t\tObject.assign(container.style, {\n\t\t\tborderInlineStart: `${point.x} solid transparent`,\n\t\t\tborderTop: `${point.y} solid transparent`,\n\t\t});\n\n\t\t// Unfortunate that we need to use `getComputedStyle`,\n\t\t// but it's only a single call when the drag is starting.\n\t\tconst computed = window.getComputedStyle(container);\n\t\tif (computed.direction === 'rtl') {\n\t\t\t// The DOMRect will include the new border we added\n\t\t\tconst box = container.getBoundingClientRect();\n\n\t\t\t// Use the top right corner (including the new border) as the offset.\n\t\t\t// The border will push the preview away from the pointer.\n\t\t\treturn { x: box.width, y: 0 };\n\t\t}\n\n\t\t// Use the top left corner as the offset. The border will\n\t\t// push the preview away from the pointer.\n\t\treturn { x: 0, y: 0 };\n\t};\n}\n"
  },
  {
    "path": "packages/core/src/public-utils/element/custom-native-drag-preview/preserve-offset-on-source.ts",
    "content": "import { type Input } from '../../../entry-point/types';\n\nimport type { GetOffsetFn } from './types';\n\nexport function preserveOffsetOnSource({\n\telement,\n\tinput,\n}: {\n\telement: HTMLElement;\n\tinput: Input;\n}): GetOffsetFn {\n\treturn function getOffset({ container }) {\n\t\t/**\n\t\t * **Android**\n\t\t *\n\t\t * This function won't do anything 😅.\n\t\t * The drag preview will _always_ be under the center of the users pointer.\n\t\t * There is no harm in calling this function though 🧘.\n\t\t *\n\t\t * **iOS and iPadOS**\n\t\t *\n\t\t * The drag preview is lifted in the expected position and then slides under\n\t\t * the users pointer.\n\t\t * This is more pleasing than immediately putting the center of the drag preview\n\t\t * under the users pointer.\n\t\t * With this function the drag preview looks like it is popping out\n\t\t * of the UI and then it shifts under the users pointer as the drag is occurring ✨\n\t\t */\n\n\t\tconst sourceRect = element.getBoundingClientRect();\n\t\tconst containerRect = container.getBoundingClientRect();\n\n\t\tconst offsetX = Math.min(\n\t\t\t// difference\n\t\t\tinput.clientX - sourceRect.x,\n\t\t\t// don't let the difference be more than the width of the container,\n\t\t\t// otherwise the pointer will be off the preview\n\t\t\tcontainerRect.width,\n\t\t);\n\t\tconst offsetY = Math.min(\n\t\t\t// difference\n\t\t\tinput.clientY - sourceRect.y,\n\t\t\t// don't let the difference be more than the height of the container,\n\t\t\t// otherwise the pointer will be off the preview\n\t\t\tcontainerRect.height,\n\t\t);\n\n\t\treturn { x: offsetX, y: offsetY };\n\t};\n}\n"
  },
  {
    "path": "packages/core/src/public-utils/element/custom-native-drag-preview/set-custom-native-drag-preview.ts",
    "content": "import { type ElementEventPayloadMap, monitorForElements } from '../../../adapter/element-adapter';\nimport type { Position } from '../../../internal-types';\nimport { isSafari } from '../../../util/is-safari';\nimport { maxZIndex } from '../../../util/max-z-index';\n\nimport type { GetOffsetFn } from './types';\n\n/** A function to remove the element that has been added to the `container`.\n * @example () => ReactDOM.unmountComponentAtNode(container)\n */\ntype CleanupFn = () => void;\n\n/** A function that will render a preview element into a `container` `HTMLElement` */\ntype RenderFn = ({\n\tcontainer,\n}: {\n\t/** The `HTMLElement` that you need to render your preview element into.\n  `container` will be appended to the `document.body` and will be removed\n  after your `CleanupFn` is called\n  */\n\tcontainer: HTMLElement;\n}) => CleanupFn | void;\n\n/** By default we use the build in values for the native drag preview: {x: 0, y: 0} */\nfunction defaultOffset(): Position {\n\treturn { x: 0, y: 0 };\n}\n\n/** This function provides the ability to mount an element for it to be used as the native drag preview\n *\n * @example\n * draggable({\n *  onGenerateDragPreview: ({ nativeSetDragImage }) => {\n *    setCustomNativeDragPreview({\n *      render: ({ container }) => {\n *        ReactDOM.render(<Preview item={item} />, container);\n *        return () => ReactDOM.unmountComponentAtNode(container);\n *      },\n *      nativeSetDragImage,\n *    });\n *    },\n * });\n */\nexport function setCustomNativeDragPreview({\n\trender,\n\tnativeSetDragImage,\n\tgetOffset = defaultOffset,\n}: {\n\tgetOffset?: GetOffsetFn;\n\trender: RenderFn;\n\tnativeSetDragImage: ElementEventPayloadMap['onGenerateDragPreview']['nativeSetDragImage'];\n}): void {\n\tconst container = document.createElement('div');\n\n\tObject.assign(container.style, {\n\t\t// Ensuring we don't cause reflow when adding the element to the page\n\t\t// Using `position:fixed` rather than `position:absolute` so we are\n\t\t// positioned on the current viewport.\n\t\t// `position:fixed` also creates a new stacking context, so we don't need to do that here\n\t\tposition: 'fixed',\n\n\t\t// According to `mdn`, the element can be offscreen:\n\t\t// https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/setDragImage#imgelement\n\t\t//\n\t\t// However, that  information does not appear in the specs:\n\t\t// https://html.spec.whatwg.org/multipage/dnd.html#dom-datatransfer-setdragimage-dev\n\t\t//\n\t\t// If the element is _completely_ offscreen, Safari@17.1 will cancel the drag\n\t\ttop: 0,\n\t\tleft: 0,\n\t\t// Using maximum possible z-index so that this element will always be on top\n\t\t// https://stackoverflow.com/questions/491052/minimum-and-maximum-value-of-z-index\n\t\t// Did not use `layers` in `@atlaskit/theme` because:\n\t\t// 1. This element is not a 'layer' in the conventional sense, as this element\n\t\t//    is only created for a single frame for the browser to take a photo of it,\n\t\t//    and then it is destroyed\n\t\t// 2. Did not want to add a dependency onto `@atlaskit/theme`\n\t\t// 3. Want to always be on top of product UI which might have higher z-index's\n\t\tzIndex: maxZIndex,\n\t\t// Avoiding any additional events caused by the new element (being super safe)\n\t\tpointerEvents: 'none',\n\t});\n\tdocument.body.append(container);\n\tconst unmount = render({ container });\n\n\t/**\n\t * Some frameworks (eg `react`) don't render into the container until the next microtask.\n\t * - This will run before the browser takes it's picture of the element\n\t * - This will run before the animation frame that removes `container`.\n\t * */\n\n\tqueueMicrotask(() => {\n\t\tconst previewOffset: Position = getOffset({ container });\n\n\t\t/**\n\t\t * **Problem**\n\t\t * On `Safari@17.1` if a drag preview element has some opacity,\n\t\t * Safari will include elements behind the drag preview element\n\t\t * in the drag preview.\n\t\t * Bug: https://bugs.webkit.org/show_bug.cgi?id=266025\n\t\t *\n\t\t * **Fix**\n\t\t * We push the drag preview so it is _almost_ completely offscreen so that\n\t\t * there won't be any elements behind the drag preview element.\n\t\t * If the element is _completely_ offscreen, then the drag is cancelled by Safari.\n\t\t *\n\t\t * Using `-0.0001` so that any potential \"see through\" on the drag preview element\n\t\t * is effectively invisible 👻\n\t\t *\n\t\t * **Unsuccessful alternatives**\n\t\t * Setting a background color (eg \"white\") on the `container`\n\t\t * → Wrecks the opacity of the drag preview element\n\t\t *\n\t\t * Adding a parent element of the `container` with a background color (eg \"white\")\n\t\t * → Wrecks the opacity of the drag preview element\n\t\t */\n\t\tif (isSafari()) {\n\t\t\tconst rect = container.getBoundingClientRect();\n\n\t\t\t// We cannot apply this fix if nothing has been rendered into the `container`\n\t\t\tif (rect.width === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tcontainer.style.left = `-${rect.width - 0.0001}px`;\n\t\t}\n\n\t\tnativeSetDragImage?.(container, previewOffset.x, previewOffset.y);\n\t});\n\n\tfunction cleanup() {\n\t\tunbindMonitor();\n\t\tunmount?.();\n\t\tdocument.body.removeChild(container);\n\t}\n\n\tconst unbindMonitor = monitorForElements({\n\t\t// Remove portal in the dragstart event so that the user will never see it\n\t\tonDragStart: cleanup,\n\t\t// Backup: remove portal when the drop finishes (this would be an error case)\n\t\tonDrop: cleanup,\n\t});\n}\n"
  },
  {
    "path": "packages/core/src/public-utils/element/custom-native-drag-preview/types.ts",
    "content": "import type { Position } from '../../../internal-types';\n\n/** A function that will push the position of native drag preview.\n *\n * `{x: 0, y: 0}` represents having the users pointer user the top left corner of the drag preview.\n *\n * @example\n * `const rect = container.getBoundingClientRect()`\n *\n * - `{x: 0, y: 0}` → top left of the `container` will be under the users pointer **(default)**\n * - `{x: rect.width, y: 0}` → top right of the `container` will be under the users pointer\n * - `{x: rect.width, y: rect.height}` → bottom right of the `container` will be under the users pointer\n * - `{x: 0, y: rect.height}`→  bottom left of the `container` will be under the users pointer\n */\nexport type GetOffsetFn = (args: { container: HTMLElement }) => Position;\n"
  },
  {
    "path": "packages/core/src/public-utils/element/disable-native-drag-preview.ts",
    "content": "// In order to disable the native drag preview you can\n// use `event.dataTransfer.setDragImage()` to set a small\n// invisible image as the drag preview.\n// There are alternative techniques,\n// (eg setting opacity to in onGenerateDragPreview and then 1 in onDragStart)\n// but the technique in this file worked best across browsers and platforms\n\n// Here we are preloading the image so that it is ready for the first drag.\n// Even though the image is base64 encoded, the browser queues an async task\n// to decode the image. The image needs to be decoded before it can be used\nconst tinyTransparentImage: HTMLImageElement | null = (() => {\n\t// SSR safe\n\tif (typeof window === 'undefined') {\n\t\treturn null;\n\t}\n\n\t// Image generated by: https://png-pixel.com/\n\t// It is a 1x1 transparent gif\n\t// It is the smallest possible transparent image we could find that works on all platforms\n\t// Note: using an encoded SVG would be nicer code, but it doesn't work on iOS\n\tconst img = new Image();\n\timg.src = 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==';\n\n\treturn img;\n})();\n\nexport function disableNativeDragPreview({\n\tnativeSetDragImage,\n}: {\n\tnativeSetDragImage: DataTransfer['setDragImage'] | null;\n}): void {\n\tif (nativeSetDragImage && tinyTransparentImage) {\n\t\tnativeSetDragImage(tinyTransparentImage, 0, 0);\n\t}\n}\n"
  },
  {
    "path": "packages/core/src/public-utils/element/format-urls-for-external.ts",
    "content": "/**\n * Helps to add multiple URLs for external consumption\n *\n * @example\n *\n * ```ts\n * // 🤩 with `formatURLsForExternal`\n * draggable({\n *   element,\n *   getInitialDataForExternal() {\n *     return {\n *       'text/uri-list': formatURLsForExternal([\n *         'https://atlassian.design/',\n *         'https://domevents.dev/',\n *       ]),\n *     };\n *   },\n * });\n *\n * // 🤮 without the `formatURLsForExternal()`\n * draggable({\n *   element,\n *   getInitialDataForExternal() {\n *     return {\n *       'text/uri-list': 'https://atlassian.design/\\r\\nhttps://domevents.dev/',\n *     };\n *   },\n * });\n * ```\n */\nexport function formatURLsForExternal(urls: string[]): string {\n\treturn urls.join('\\r\\n');\n}\n"
  },
  {
    "path": "packages/core/src/public-utils/element/scroll-just-enough-into-view.ts",
    "content": "/**\n * Scroll an `element` just enough into view so that the element becomes totally visible.\n * If the element is already totally visible then no scrolling will occur.\n */\nexport function scrollJustEnoughIntoView({ element }: { element: Element }): void {\n\telement.scrollIntoView({\n\t\tblock: 'nearest',\n\t\tinline: 'nearest',\n\t});\n}\n"
  },
  {
    "path": "packages/core/src/public-utils/external/file.ts",
    "content": "import { type ContainsSource } from './native-types';\n\nexport function containsFiles({ source }: ContainsSource): boolean {\n\treturn source.types.includes('Files');\n}\n\n/** Obtain an array of the dragged `File`s */\nexport function getFiles({ source }: ContainsSource): File[] {\n\treturn (\n\t\tsource.items\n\t\t\t// unlike other media types, for files:\n\t\t\t// item.kind is 'file'\n\t\t\t// item.type is the type of file eg 'image/jpg'\n\t\t\t// for other media types, item.type is the mime format\n\t\t\t.filter((item) => item.kind === 'file')\n\t\t\t.map((item) => item.getAsFile())\n\t\t\t.filter((file: File | null): file is File => file != null)\n\t);\n}\n"
  },
  {
    "path": "packages/core/src/public-utils/external/html.ts",
    "content": "import { HTMLMediaType } from '../../util/media-types/html-media-type';\n\nimport { type ContainsSource } from './native-types';\n\nexport function containsHTML({ source }: ContainsSource): boolean {\n\treturn source.types.includes(HTMLMediaType);\n}\n\nexport function getHTML({ source }: ContainsSource): string | null {\n\treturn source.getStringData(HTMLMediaType);\n}\n"
  },
  {
    "path": "packages/core/src/public-utils/external/native-types.ts",
    "content": "import type { ExternalDragPayload } from '../../internal-types';\n\n/** `ContainsSource` works for\n * 1. `monitorForNative` > `canMonitor()`\n * 2. `dropTargetForNative` > `canDrop()`\n *\n * We are also using `SourcePayload` as the parameter type for all native getters.\n * For example, `getFiles({source}: SourcePayload)`\n */\nexport type ContainsSource = { source: ExternalDragPayload };\nexport type PredicateFn = (args: ContainsSource) => boolean;\n"
  },
  {
    "path": "packages/core/src/public-utils/external/some.ts",
    "content": "import { type ContainsSource, type PredicateFn } from './native-types';\n\n/**\n * Will return `true` when any native predicate function returns `true`.\n * Using the name `\"some\"` for consistency with `Array.prototype.some`.\\\n *\n * @example\n *\n * ```ts\n * monitorForNative({\n *  // enable monitor when dragging files or text\n *  canMonitor: some(containsFiles, containsText),\n * });\n *\n * monitorForNative({\n *  // enable monitor when dragging external files or internal text\n *  canMonitor: some(external(containsFiles), internal(containsText)),\n * });\n * ```\n */\nexport function some(...predicates: PredicateFn[]): PredicateFn {\n\treturn function combined(payload: ContainsSource): boolean {\n\t\treturn predicates.some((fn) => fn(payload));\n\t};\n}\n"
  },
  {
    "path": "packages/core/src/public-utils/external/text.ts",
    "content": "import { textMediaType } from '../../util/media-types/text-media-type';\n\nimport { type ContainsSource } from './native-types';\n\nexport function containsText({ source }: ContainsSource): boolean {\n\treturn source.types.includes(textMediaType);\n}\n\n/* Get the plain text that a user is dragging */\nexport function getText({ source }: ContainsSource): string | null {\n\treturn source.getStringData(textMediaType);\n}\n"
  },
  {
    "path": "packages/core/src/public-utils/external/url.ts",
    "content": "import { URLMediaType } from '../../util/media-types/url-media-type';\n\nimport { type ContainsSource } from './native-types';\n\n/**\n * 🦊🐞\n * When dragging a URL from the Firefox address bar or bookmarks\n * they are currently not adding an entry for \"text/uri-list\".\n * They add \"text/x-moz-url\" data which contains the same information\n * in a different format.\n *\n * [Bug report](https://bugzilla.mozilla.org/show_bug.cgi?id=1912164)\n */\nconst firefoxURLType = 'text/x-moz-url';\n\nexport function containsURLs({ source }: ContainsSource): boolean {\n\treturn source.types.includes(URLMediaType) || source.types.includes(firefoxURLType);\n}\n\nexport function getURLs({ source }: ContainsSource): string[] {\n\tconst standard: string | null = source.getStringData(URLMediaType);\n\n\tif (standard != null) {\n\t\treturn (\n\t\t\tstandard\n\t\t\t\t// You can have multiple urls split by CR+LF (EOL)\n\t\t\t\t// - CR: Carriage Return '\\r'\n\t\t\t\t// - LF: Line Feed '\\n'\n\t\t\t\t// - EOL: End of Line '\\r\\n'\n\t\t\t\t.split('\\r\\n')\n\t\t\t\t// a uri-list can have comment lines starting with '#'\n\t\t\t\t// so we need to remove those\n\t\t\t\t.filter((piece) => !piece.startsWith('#'))\n\t\t);\n\t}\n\n\tconst fallback: string | null = source.getStringData(firefoxURLType);\n\n\tif (fallback != null) {\n\t\treturn (\n\t\t\tfallback\n\t\t\t\t// Values are split by a single LF: Line Feed (`\\n`) character.\n\t\t\t\t// It's not clear from the \"text/x-moz-url\" documentation that\n\t\t\t\t// it's use `\\n` and not `\\r\\n`, but based on testing and some\n\t\t\t\t// Github code searches it seems like `\\n` is correct.\n\t\t\t\t// https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API/Recommended_drag_types#dragging_links\n\t\t\t\t.split('\\n')\n\t\t\t\t// Every second line is the title of the url previous url.\n\t\t\t\t// We are ignoring the page titles in this helper\n\t\t\t\t.filter((_, index) => index % 2 === 0)\n\t\t);\n\t}\n\n\treturn [];\n}\n"
  },
  {
    "path": "packages/core/src/public-utils/once.ts",
    "content": "/** Provide a function that you only ever want to be called a single time */\nexport function once<TFunc extends (...args: any[]) => any>(\n\tfn: TFunc,\n): (this: ThisParameterType<TFunc>, ...args: Parameters<TFunc>) => ReturnType<TFunc> {\n\tlet cache: { result: ReturnType<TFunc> } | null = null;\n\n\treturn function wrapped(\n\t\tthis: ThisParameterType<TFunc>,\n\t\t...args: Parameters<TFunc>\n\t): ReturnType<TFunc> {\n\t\tif (!cache) {\n\t\t\tconst result = fn.apply(this, args);\n\t\t\tcache = {\n\t\t\t\tresult: result,\n\t\t\t};\n\t\t}\n\t\treturn cache.result;\n\t};\n}\n"
  },
  {
    "path": "packages/core/src/public-utils/prevent-unhandled.ts",
    "content": "import { bindAll } from 'bind-event-listener';\n\nimport { type CleanupFn } from '../internal-types';\nimport { getBindingsForBrokenDrags } from '../util/detect-broken-drag';\n\nfunction acceptDrop(event: DragEvent) {\n\t// if the event is already prevented the event we don't need to do anything\n\tif (event.defaultPrevented) {\n\t\treturn;\n\t}\n\t// Using \"move\" as the drop effect as that uses the standard\n\t// cursor. Doing this so the user doesn't think they are dropping\n\t// on the page\n\t// Note: using \"none\" will not allow a \"drop\" to occur, so we are using \"move\"\n\tif (event.dataTransfer) {\n\t\tevent.dataTransfer.dropEffect = 'move';\n\t}\n\t// cancel the default browser behaviour\n\t// doing this will tell the browser that we have handled the drop\n\tevent.preventDefault();\n}\n\nlet unbindEvents: CleanupFn | null = null;\n\n/**\n * Block drag operations outside of `@atlaskit/pragmatic-drag-and-drop`\n */\nfunction start(): void {\n\tcleanup();\n\tunbindEvents = bindAll(\n\t\twindow,\n\t\t[\n\t\t\t{\n\t\t\t\ttype: 'dragover',\n\t\t\t\tlistener: acceptDrop,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'dragenter',\n\t\t\t\tlistener: acceptDrop,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'drop',\n\t\t\t\tlistener(event) {\n\t\t\t\t\t// our lifecycle manager already prevents events, but just being super safe\n\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t// not setting dropEffect, as `drop.dropEffect` has already been published to the user\n\t\t\t\t\t// (lifecycle-manager binds events in the capture phase)\n\n\t\t\t\t\t// we don't need to wait for \"dragend\", and \"dragend\" might not even happen,\n\t\t\t\t\t// such as when the draggable has been removed during a drag.\n\t\t\t\t\tcleanup();\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'dragend',\n\t\t\t\tlistener: cleanup,\n\t\t\t},\n\t\t\t...getBindingsForBrokenDrags({ onDragEnd: cleanup }),\n\t\t],\n\t\t// being clear that these are added in the bubble phase\n\t\t{ capture: false },\n\t);\n}\n\nfunction cleanup() {\n\tunbindEvents?.();\n\tunbindEvents = null;\n}\n\n/**\n * TODO: for next major, we could look at do the following:\n *\n * ```diff\n * - preventUnhandled.start();\n * - preventUnhandled.stop();\n * + const stop = preventUnhandled();\n * ```\n */\n\nfunction stop(): void {\n\t/**\n\t * if `stop()` is called in a `\"drop\"` event, then `event.preventDefault()` won't be called.\n\t * Our `\"drop\"` listener calls `event.preventDefault()` for handled drop events\n\t * (\"drop\" events caused by dropping over a drop target)\n\t * `preventUnhandled()` causes every element to become a drop target (according to the browser)\n\t *\n\t * To opt out of the default behaviour for a `\"drop\"` event, we need to make sure\n\t * that we cancel it.\n\t *\n\t * The `\"drop\"` event listener in core is in the `capture` phase, so people calling\n\t * `preventUnhandled.stop()` in `onDrop()` will remove the `\"drop\"` event listener in this\n\t * file before it has the chance to cancel the event.\n\t *\n\t * Being sneaky and using the `window.event` global to sniff out the current event\n\t */\n\tif (window.event?.type === 'drop') {\n\t\twindow.event?.preventDefault();\n\t}\n\tcleanup();\n}\n\nexport const preventUnhandled: {\n\tstart: typeof start;\n\tstop: typeof stop;\n} = {\n\tstart,\n\tstop,\n};\n"
  },
  {
    "path": "packages/core/src/public-utils/reorder.ts",
    "content": "/**\n * A function that will reorder an array (`list`).\n * `reorder` returns a new array with reordered items and does not\n *  modify the original array. The items in the array are also not modified.\n */\nexport function reorder<Value>({\n\tlist,\n\tstartIndex,\n\tfinishIndex,\n}: {\n\tlist: Value[];\n\tstartIndex: number;\n\tfinishIndex: number;\n}): Value[] {\n\tif (startIndex === -1 || finishIndex === -1) {\n\t\t// Making this function consistently return a new array reference.\n\t\t// This is consistent with .toSorted() which always returns a new array\n\t\t// even when it does not do anything\n\t\treturn Array.from(list);\n\t}\n\n\tconst result = Array.from(list);\n\tconst [removed] = result.splice(startIndex, 1);\n\tresult.splice(finishIndex, 0, removed);\n\n\treturn result;\n}\n"
  },
  {
    "path": "packages/core/src/util/add-attribute.ts",
    "content": "import { type CleanupFn } from '../internal-types';\n\nexport function addAttribute(\n\telement: Element,\n\t{ attribute, value }: { attribute: string; value: string },\n): CleanupFn {\n\telement.setAttribute(attribute, value);\n\treturn () => element.removeAttribute(attribute);\n}\n"
  },
  {
    "path": "packages/core/src/util/android.ts",
    "content": "import { once } from '../public-utils/once';\n\n// Using `once` as the value won't change in a browser\n\nexport const isAndroid: (this: unknown) => boolean = once(function isAndroid(): boolean {\n\treturn navigator.userAgent.toLocaleLowerCase().includes('android');\n});\n\nexport const androidFallbackText = 'pdnd:android-fallback';\n"
  },
  {
    "path": "packages/core/src/util/changing-window/count-events-for-safari.ts",
    "content": "import { bindAll } from 'bind-event-listener';\n\nimport { isSafari } from '../is-safari';\n\n/* For \"dragenter\" events, the browser should set `relatedTarget` to the previous element.\n * For external drag operations, our first \"dragenter\" event should have a `event.relatedTarget` of `null`.\n *\n *  Unfortunately in Safari `event.relatedTarget` is *always* set to `null`\n *  Safari bug: https://bugs.webkit.org/show_bug.cgi?id=242627\n *  To work around this we count \"dragenter\" and \"dragleave\" events */\n\n// Using symbols for event properties so we don't clash with\n// anything on the `event` object\nconst symbols = {\n\tisLeavingWindow: Symbol('leaving'),\n\tisEnteringWindow: Symbol('entering'),\n};\n\nexport function isEnteringWindowInSafari({ dragEnter }: { dragEnter: DragEvent }): boolean {\n\tif (!isSafari()) {\n\t\treturn false;\n\t}\n\treturn dragEnter.hasOwnProperty(symbols.isEnteringWindow);\n}\n\nexport function isLeavingWindowInSafari({ dragLeave }: { dragLeave: DragEvent }): boolean {\n\tif (!isSafari()) {\n\t\treturn false;\n\t}\n\treturn dragLeave.hasOwnProperty(symbols.isLeavingWindow);\n}\n\n(function fixSafari() {\n\t// Don't do anything when server side rendering\n\tif (typeof window === 'undefined') {\n\t\treturn;\n\t}\n\n\t// rather than checking the userAgent for \"jsdom\" we can do this check\n\t// so that the check will be removed completely in production code\n\tif (process.env.NODE_ENV === 'test') {\n\t\treturn;\n\t}\n\n\tif (!isSafari()) {\n\t\treturn;\n\t}\n\n\ttype State = {\n\t\tenterCount: number;\n\t\tisOverWindow: boolean;\n\t};\n\n\tfunction getInitialState(): State {\n\t\treturn {\n\t\t\tenterCount: 0,\n\t\t\tisOverWindow: false,\n\t\t};\n\t}\n\n\tlet state: State = getInitialState();\n\n\tfunction resetState() {\n\t\tstate = getInitialState();\n\t}\n\n\t// These event listeners are bound _forever_ and _never_ removed\n\t// We don't bother cleaning up these event listeners (for now)\n\t// as this workaround is only for Safari\n\n\t// This is how the event count works:\n\t//\n\t// lift (+1 enterCount)\n\t// - dragstart(draggable) [enterCount: 0]\n\t// - dragenter(draggable) [enterCount: 1]\n\t// leaving draggable (+0 enterCount)\n\t// - dragenter(document.body) [enterCount: 2]\n\t// - dragleave(draggable) [enterCount: 1]\n\t// leaving window (-1 enterCount)\n\t// - dragleave(document.body) [enterCount: 0] {leaving the window}\n\n\t// Things to note:\n\t// - dragenter and dragleave bubble\n\t// - the first dragenter when entering a window might not be on `window`\n\t//   - it could be on an element that is pressed up against the window\n\t//   - (so we cannot rely on `event.target` values)\n\n\tbindAll(\n\t\twindow,\n\t\t[\n\t\t\t{\n\t\t\t\ttype: 'dragstart',\n\t\t\t\tlistener: () => {\n\t\t\t\t\tstate.enterCount = 0;\n\t\t\t\t\t// drag start occurs in the source window\n\t\t\t\t\tstate.isOverWindow = true;\n\t\t\t\t\t// When a drag first starts it will also trigger a \"dragenter\" on the draggable element\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'drop',\n\t\t\t\tlistener: resetState,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'dragend',\n\t\t\t\tlistener: resetState,\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'dragenter',\n\t\t\t\tlistener: (event: DragEvent) => {\n\t\t\t\t\tif (!state.isOverWindow && state.enterCount === 0) {\n\t\t\t\t\t\t// Patching the `event` object\n\t\t\t\t\t\t// The `event` object is shared with all event listeners for the event\n\t\t\t\t\t\t(event as any)[symbols.isEnteringWindow] = true;\n\t\t\t\t\t}\n\t\t\t\t\tstate.isOverWindow = true;\n\t\t\t\t\tstate.enterCount++;\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'dragleave',\n\t\t\t\tlistener: (event) => {\n\t\t\t\t\tstate.enterCount--;\n\t\t\t\t\tif (state.isOverWindow && state.enterCount === 0) {\n\t\t\t\t\t\t// Patching the `event` object as it is shared with all event listeners\n\t\t\t\t\t\t// The `event` object is shared with all event listeners for the event\n\t\t\t\t\t\t(event as any)[symbols.isLeavingWindow] = true;\n\t\t\t\t\t\tstate.isOverWindow = false;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t],\n\t\t// using `capture: true` so that adding event listeners\n\t\t// in bubble phase will have the correct symbols\n\t\t{ capture: true },\n\t);\n})();\n"
  },
  {
    "path": "packages/core/src/util/changing-window/is-entering-window.ts",
    "content": "import { isFirefox } from '../is-firefox';\nimport { isSafari } from '../is-safari';\n\nimport { isEnteringWindowInSafari } from './count-events-for-safari';\nimport { isFromAnotherWindow } from './is-from-another-window';\n\nexport function isEnteringWindow({ dragEnter }: { dragEnter: DragEvent }): boolean {\n\tconst { type, relatedTarget } = dragEnter;\n\tif (type !== 'dragenter') {\n\t\treturn false;\n\t}\n\n\tif (isSafari()) {\n\t\treturn isEnteringWindowInSafari({ dragEnter });\n\t}\n\n\t// standard check\n\tif (relatedTarget == null) {\n\t\treturn true;\n\t}\n\n\t/**\n\t * 🦊 Exception: `iframe` in Firefox (`125.0`)\n\t *\n\t * Case 1: parent `window` → child `iframe`\n\t * `relatedTarget` is the `iframe` element in the parent `window`\n\t * (foreign element)\n\t *\n\t * Case 2: child `iframe` → parent `window`\n\t * `relatedTarget` is an element inside the child `iframe`\n\t * (foreign element)\n\t */\n\n\tif (isFirefox()) {\n\t\treturn isFromAnotherWindow(relatedTarget);\n\t}\n\n\t/**\n\t * 🌏 Exception: `iframe` in Chrome (`124.0`)\n\t *\n\t * Case 1: parent `window` → child `iframe`\n\t * `relatedTarget` is `null` *(standard check)*\n\t *\n\t * Case 2: child `iframe` → parent `window`\n\t * `relatedTarget` is the `iframe` element in the parent `window`\n\t */\n\n\t// Case 2\n\t// Using `instanceof` check as the element will be in the same `window`\n\treturn relatedTarget instanceof HTMLIFrameElement;\n}\n"
  },
  {
    "path": "packages/core/src/util/changing-window/is-from-another-window.ts",
    "content": "/**\n * Does the `EventTarget` look like a `Node` based on \"duck typing\".\n *\n * Helpful when the `Node` might be outside of the current document\n * so we cannot to an `target instanceof Node` check.\n */\nfunction isNodeLike(target: EventTarget): target is Node {\n\treturn 'nodeName' in target;\n}\n\n/**\n * Is an `EventTarget` a `Node` from another `window`?\n */\nexport function isFromAnotherWindow(eventTarget: EventTarget): boolean {\n\treturn isNodeLike(eventTarget) && eventTarget.ownerDocument !== document;\n}\n"
  },
  {
    "path": "packages/core/src/util/changing-window/is-leaving-window.ts",
    "content": "import { isFirefox } from '../is-firefox';\nimport { isSafari } from '../is-safari';\n\nimport { isLeavingWindowInSafari } from './count-events-for-safari';\nimport { isFromAnotherWindow } from './is-from-another-window';\n\nexport function isLeavingWindow({ dragLeave }: { dragLeave: DragEvent }): boolean {\n\tconst { type, relatedTarget } = dragLeave;\n\tif (type !== 'dragleave') {\n\t\treturn false;\n\t}\n\n\tif (isSafari()) {\n\t\treturn isLeavingWindowInSafari({ dragLeave });\n\t}\n\n\t// Standard check: if going to `null` we are leaving the `window`\n\tif (relatedTarget == null) {\n\t\treturn true;\n\t}\n\n\t/**\n\t * 🦊 Exception: `iframe` in Firefox (`125.0`)\n\t *\n\t * Case 1: parent `window` → child `iframe`\n\t * `dragLeave.relatedTarget` is element _inside_ the child `iframe`\n\t * (foreign element)\n\t *\n\t * Case 2: child `iframe` → parent `window`\n\t * `dragLeave.relatedTarget` is the `iframe` in the parent `window`\n\t * (foreign element)\n\t */\n\n\tif (isFirefox()) {\n\t\treturn isFromAnotherWindow(relatedTarget);\n\t}\n\n\t/**\n\t * 🌏 Exception: `iframe` in Chrome (`124.0`)\n\t *\n\t * Case 1: parent `window` → child `iframe`\n\t * `dragLeave.relatedTarget` is the `iframe` in the parent `window`\n\t *\n\t * Case 2: child `iframe` → parent `window`\n\t * `dragLeave.relatedTarget` is `null` *(standard check)*\n\t */\n\n\t// Case 2\n\t// Using `instanceof` check as the element will be in the same `window`\n\treturn relatedTarget instanceof HTMLIFrameElement;\n}\n"
  },
  {
    "path": "packages/core/src/util/detect-broken-drag.ts",
    "content": "export function getBindingsForBrokenDrags({ onDragEnd }: { onDragEnd: () => void }): readonly [\n\t{\n\t\treadonly type: 'pointermove';\n\t\treadonly listener: () => void;\n\t},\n\t{\n\t\treadonly type: 'pointerdown';\n\t\treadonly listener: () => void;\n\t},\n] {\n\treturn [\n\t\t// ## Detecting drag ending for removed draggables\n\t\t//\n\t\t// If a draggable element is removed during a drag and the user drops:\n\t\t// 1. if over a valid drop target: we get a \"drop\" event to know the drag is finished\n\t\t// 2. if not over a valid drop target (or cancelled): we get nothing\n\t\t// The \"dragend\" event will not fire on the source draggable if it has been\n\t\t// removed from the DOM.\n\t\t// So we need to figure out if a drag operation has finished by looking at other events\n\t\t// We can do this by looking at other events\n\n\t\t// ### First detection: \"pointermove\" events\n\n\t\t// 1. \"pointermove\" events cannot fire during a drag and drop operation\n\t\t// according to the spec. So if we get a \"pointermove\" it means that\n\t\t// the drag and drop operations has finished. So if we get a \"pointermove\"\n\t\t// we know that the drag is over\n\t\t// 2. 🦊😤 Drag and drop operations are _supposed_ to suppress\n\t\t// other pointer events. However, firefox will allow a few\n\t\t// pointer event to get through after a drag starts.\n\t\t// The most I've seen is 3\n\t\t{\n\t\t\ttype: 'pointermove',\n\t\t\tlistener: (() => {\n\t\t\t\tlet callCount: number = 0;\n\t\t\t\treturn function listener() {\n\t\t\t\t\t// Using 20 as it is far bigger than the most observed (3)\n\t\t\t\t\tif (callCount < 20) {\n\t\t\t\t\t\tcallCount++;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tonDragEnd();\n\t\t\t\t};\n\t\t\t})(),\n\t\t},\n\n\t\t// ### Second detection: \"pointerdown\" events\n\n\t\t// If we receive this event then we know that a drag operation has finished\n\t\t// and potentially another one is about to start.\n\t\t// Note: `pointerdown` fires on all browsers / platforms before \"dragstart\"\n\t\t{\n\t\t\ttype: 'pointerdown',\n\t\t\tlistener: onDragEnd,\n\t\t},\n\t] as const;\n}\n"
  },
  {
    "path": "packages/core/src/util/get-input.ts",
    "content": "import { type Input } from '../internal-types';\n\nexport function getInput(event: DragEvent): Input {\n\treturn {\n\t\taltKey: event.altKey,\n\t\tbutton: event.button,\n\t\tbuttons: event.buttons,\n\t\tctrlKey: event.ctrlKey,\n\t\tmetaKey: event.metaKey,\n\t\tshiftKey: event.shiftKey,\n\t\tclientX: event.clientX,\n\t\tclientY: event.clientY,\n\t\tpageX: event.pageX,\n\t\tpageY: event.pageY,\n\t};\n}\n"
  },
  {
    "path": "packages/core/src/util/is-firefox.ts",
    "content": "import { once } from '../public-utils/once';\n\n// using `cache` as our `isFirefox()` result will not change in a browser\n\n/**\n * Returns `true` if a `Firefox` browser\n * */\nexport const isFirefox: (this: unknown) => boolean = once(function isFirefox(): boolean {\n\tif (process.env.NODE_ENV === 'test') {\n\t\treturn false;\n\t}\n\n\treturn navigator.userAgent.includes('Firefox');\n});\n"
  },
  {
    "path": "packages/core/src/util/is-safari-on-ios.ts",
    "content": "import { once } from '../public-utils/once';\n\nimport { isSafari } from './is-safari';\n\n// Using `once` as the value won't change in a browser\n\n/**\n * **Notes**\n *\n * All browsers on iOS (Safari, Chrome, Firefox) use the same rendering engine (Safari / Webkit).\n *\n * → https://developer.apple.com/app-store/review/guidelines/ (see 2.5.6)\n *\n * There is some ongoing change in this space, and we might see some new browser\n * engines soon on iOS (at least in Europe)\n *\n * → https://developer.apple.com/support/alternative-browser-engines/\n **/\n\n/**\n * Returns `true` if browser is Safari (WebKit) on iOS.\n */\nexport const isSafariOnIOS: (this: unknown) => boolean = once(function isSafariOnIOS(): boolean {\n\tif (process.env.NODE_ENV === 'test') {\n\t\treturn false;\n\t}\n\n\treturn isSafari() && 'ontouchend' in document;\n});\n"
  },
  {
    "path": "packages/core/src/util/is-safari.ts",
    "content": "import { once } from '../public-utils/once';\n\n// using `cache` as our `isSafari()` result will not change in a browser\n\n/**\n * Returns `true` if a `Safari` browser.\n * Returns `true` if the browser is running on iOS (they are all Safari).\n *\n * Use `isSafariOnIOS` if you want to check if something is Safari + iOS\n * */\nexport const isSafari: (this: unknown) => boolean = once(function isSafari(): boolean {\n\tif (process.env.NODE_ENV === 'test') {\n\t\treturn false;\n\t}\n\n\tconst { userAgent } = navigator;\n\treturn userAgent.includes('AppleWebKit') && !userAgent.includes('Chrome');\n});\n"
  },
  {
    "path": "packages/core/src/util/max-z-index.ts",
    "content": "// Maximum possible z-index\n// https://stackoverflow.com/questions/491052/minimum-and-maximum-value-of-z-index\nexport const maxZIndex = 2147483647;\n"
  },
  {
    "path": "packages/core/src/util/media-types/html-media-type.ts",
    "content": "// Why we put the media types in their own files:\n//\n// - we are not putting them all in one file as not all adapters need all types\n// - we are not putting them in the external helpers as some things just need the\n//   types and not the external functions code\nexport const HTMLMediaType = 'text/html';\n"
  },
  {
    "path": "packages/core/src/util/media-types/text-media-type.ts",
    "content": "// Why we put the media types in their own files:\n//\n// - we are not putting them all in one file as not all adapters need all types\n// - we are not putting them in the external helpers as some things just need the\n//   types and not the external functions code\nexport const textMediaType = 'text/plain';\n"
  },
  {
    "path": "packages/core/src/util/media-types/url-media-type.ts",
    "content": "// Why we put the media types in their own files:\n//\n// - we are not putting them all in one file as not all adapters need all types\n// - we are not putting them in the external helpers as some things just need the\n//   types and not the external functions code\nexport const URLMediaType = 'text/uri-list';\n"
  },
  {
    "path": "packages/core/tsconfig.json",
    "content": "{\n  \"extends\": \"../../tsconfig.json\",\n  \"include\": [\n    \"__tests__/**/*.ts\",\n    \"__tests__/**/*.tsx\",\n    \"docs/**/*.ts\",\n    \"docs/**/*.tsx\",\n    \"examples/**/*.ts\",\n    \"examples/**/*.tsx\",\n    \"src/**/*.ts\",\n    \"src/**/*.tsx\",\n    \"__perf__\"\n  ]\n}\n"
  },
  {
    "path": "packages/documentation/.npmignore",
    "content": "src/\nexamples-utils/\nexamples/\nindex.ts\ndocs/\nbuild/\n__tests__/\ntsconfig.json\ntsconfig.app.json\ntsconfig.dev.json\n"
  },
  {
    "path": "packages/documentation/CHANGELOG.md",
    "content": "# @atlaskit/pragmatic-drag-and-drop-docs\n\n## 1.4.17\n\n### Patch Changes\n\n- [`70898c8166c77`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/70898c8166c77) -\n  Icon migration entry point update\n\n## 1.4.16\n\n### Patch Changes\n\n- [`d14ea5f60b689`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d14ea5f60b689) -\n  chore: migrate platform UI & component libraries icon imports from migration paths to core\n\n## 1.4.15\n\n### Patch Changes\n\n- [`630257c173760`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/630257c173760) -\n  Change \"issue\" wording to \"work-item\" in examples.\n\n## 1.4.14\n\n### Patch Changes\n\n- [`717cc94987686`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/717cc94987686) -\n  Internal changes to how borders are applied.\n\n## 1.4.13\n\n### Patch Changes\n\n- [`5d0b8ba5e6f7f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5d0b8ba5e6f7f) -\n  Internal changes to how borders are applied.\n\n## 1.4.12\n\n### Patch Changes\n\n- [`20056074447a2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/20056074447a2) -\n  Switch to more semantically accurate label prop in internal radio and radio group instances.\n\n## 1.4.11\n\n### Patch Changes\n\n- [`beaa6ee463aa8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/beaa6ee463aa8) -\n  Internal changes to how border radius is applied.\n\n## 1.4.10\n\n### Patch Changes\n\n- [`806cfe1c4e6b7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/806cfe1c4e6b7) -\n  Internal changes to how border radius is applied.\n\n## 1.4.9\n\n### Patch Changes\n\n- [`d28c4180ae756`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d28c4180ae756) -\n  Internal changes to how border radius is applied.\n\n## 1.4.8\n\n### Patch Changes\n\n- [`cd70a377d007c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cd70a377d007c) -\n  Internal changes to how border radius is applied.\n\n## 1.4.7\n\n### Patch Changes\n\n- [`20a5aa8c4e7a0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/20a5aa8c4e7a0) -\n  Removed gridSize import. No visual changes.\n\n## 1.4.6\n\n### Patch Changes\n\n- [`156b50375043d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/156b50375043d) -\n  Removing some internal `console` logging that is no longer needed.\n\n## 1.4.5\n\n### Patch Changes\n\n- [`66166bf41060b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/66166bf41060b) -\n  Adding visual regression tests to help ensure our examples don't change without our prior\n  knowledge\n\n## 1.4.4\n\n### Patch Changes\n\n- [`098cfbb01dc36`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/098cfbb01dc36) -\n  Add missing npmignore files to remove unnecessary files from published package\n\n## 1.4.3\n\n### Patch Changes\n\n- [#188952](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/188952)\n  [`1a88e6e2601ae`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1a88e6e2601ae) -\n  Migrated usage of renamed/deprecated icons\n\n## 1.4.2\n\n### Patch Changes\n\n- [#171534](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/171534)\n  [`72189ecc4d763`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/72189ecc4d763) -\n  Updated icon usage for deprecated icons\n\n## 1.4.1\n\n### Patch Changes\n\n- [#162456](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/162456)\n  [`f916af5aab898`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f916af5aab898) -\n  Removes `@atlaskit/platform-feature-flags` as a dependency. Removes `@atlaskit/link` as a runtime\n  dependency, although it is still used in examples.\n\n## 1.4.0\n\n### Minor Changes\n\n- [#157071](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/157071)\n  [`a149a0b1559ec`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/a149a0b1559ec) -\n  We are testing the migration to the ADS Link component behind a feature flag. If this fix is\n  successful it will be available in a later release.\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.3.2\n\n### Patch Changes\n\n- [#148201](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/148201)\n  [`8e811f1840de7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8e811f1840de7) -\n  Either actively or pre-emptively fixes a bug with keyframe animations in CJS and ESM distribution\n  targets for packages using Compiled CSS-in-JS. This may not affect this package, but the change\n  was made so a future migration does not accidentally break it.\n\n## 1.3.1\n\n### Patch Changes\n\n- [#145191](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/145191)\n  [`cd21ebedb9a08`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/cd21ebedb9a08) -\n  Internal change to move towards Compiled CSS-in-JS styling.\n\n## 1.3.0\n\n### Minor Changes\n\n- [#109060](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109060)\n  [`4660ec858a305`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4660ec858a305) -\n  Update `React` from v16 to v18\n\n## 1.2.0\n\n### Minor Changes\n\n- [#150481](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/150481)\n  [`e750fb3633f6e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e750fb3633f6e) -\n  [ux] Enable new icons behind a feature flag.\n\n## 1.1.3\n\n### Patch Changes\n\n- [#126649](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/126649)\n  [`24092d9f293a1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/24092d9f293a1) -\n  Migrated usages of the Box primitive being cast as `<a>` tags to the new Anchor primitive. No\n  changes are expected.\n\n## 1.1.2\n\n### Patch Changes\n\n- [#124164](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/124164)\n  [`58941fa1d332a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/58941fa1d332a) -\n  All `react` unit tests will now run against `react@16` and `react@18` on CI.\n\n## 1.1.1\n\n### Patch Changes\n\n- [#123925](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/123925)\n  [`d6234c59408c8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d6234c59408c8) -\n  Internal change to typography component APIs resulting in very minor letter spacing changes.\n\n## 1.1.0\n\n### Minor Changes\n\n- [#116572](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116572)\n  [`98c65e7ff719c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/98c65e7ff719c) -\n  🍯 Introducing \"the honey pot fix\" which is an improved workaround for a\n  [painful browser bug](https://issues.chromium.org/issues/41129937).\n\n  **Background**\n\n  The browser bug causes the browser to think the users pointer is continually depressed at the\n  point that the user started a drag. This could lead to incorrect events being triggered, and\n  incorrect styles being applied to elements that the user is not currently over during a drag.\n\n  **Outcomes**\n  - Elements will no longer receive `MouseEvent`s (eg `\"mouseenter\"` and `\"mouseleave\"`) during a\n    drag (which is a violation of the\n    [drag and drop specification](https://html.spec.whatwg.org/multipage/dnd.html#drag-and-drop-processing-model))\n  - Elements will no longer apply `:hover` or `:active` styles during a drag. Previously consumers\n    would need to disable these style rules during a drag to prevent these styles being applied.\n  - Dramatically improved post drop performance. Our prior solution could require a noticeable delay\n    due to a large style recalculation after a drop.\n\n## 1.0.12\n\n### Patch Changes\n\n- [#116025](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116025)\n  [`cd506a937e44f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/cd506a937e44f) -\n  Internal change to how typography is applied. There should be no visual change.\n\n## 1.0.11\n\n### Patch Changes\n\n- [#112215](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/112215)\n  [`19c101e4b4309`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/19c101e4b4309) -\n  Fixes examples that were not working in CodeSandbox.\n\n## 1.0.10\n\n### Patch Changes\n\n- [#94316](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94316)\n  [`35fd5ed8e1d7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/35fd5ed8e1d7) -\n  Upgrading internal dependency `bind-event-listener` to `@^3.0.0`\n\n## 1.0.9\n\n### Patch Changes\n\n- [#92007](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/92007)\n  [`85525725cb0d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/85525725cb0d) -\n  Migrated to the new button component\n\n## 1.0.8\n\n### Patch Changes\n\n- [#92913](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/92913)\n  [`8f7e827e0978`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8f7e827e0978) -\n  Some Pragmatic drag and drop packages did not have `\"author\"` and or `\"license\"` attributes set in\n  their `package.json` file. These missing attributes have now been added where required.\n\n  ```diff\n  + \"author\": \"Atlassian Pty Ltd\",\n  + \"license\": \"Apache-2.0\",\n  ```\n\n  All Pragmatic drag and drop packages were already licensed under `Apache-2.0` (see `LICENSE`\n  files), but the `\"license\"` attribute in some `package.json` files was missing.\n\n## 1.0.7\n\n### Patch Changes\n\n- [#88354](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/88354)\n  [`4c87d9b4f0c2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4c87d9b4f0c2) -\n  The internal composition of this component has changed. There is no expected change in behavior.\n\n## 1.0.6\n\n### Patch Changes\n\n- [#84829](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84829)\n  [`a6299ec57bc3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a6299ec57bc3) -\n  Internal change to replace hardcoded font fallback values with an exported constant. There is no\n  expected visual difference.\n\n## 1.0.5\n\n### Patch Changes\n\n- [#84398](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84398)\n  [`77694db987fc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/77694db987fc) -\n  Public release of Pragmatic drag and drop documentation\n\n## 1.0.4\n\n### Patch Changes\n\n- [#83176](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83176)\n  [`5c64e4657ef3`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/5c64e4657ef3) -\n  [ux] Minor changes to replace deprecated font tokens with new tokens. There may be some very\n  slight differences in font size if the previous value was incorrectly applied, and slight\n  differences in line height to match the new typography system.\n\n## 1.0.3\n\n### Patch Changes\n\n- [#83702](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83702)\n  [`4d9e25ab4eaa`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4d9e25ab4eaa) -\n  Updating the descriptions of Pragmatic drag and drop packages, so they each provide a consistent\n  description to various consumers, and so they are consistently formed amongst each other.\n  - `package.json` `description`\n  - `README.md`\n  - Website documentation\n\n## 1.0.2\n\n### Patch Changes\n\n- [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116)\n  [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) -\n  Upgrade Typescript from `4.9.5` to `5.4.2`\n\n## 1.0.1\n\n### Patch Changes\n\n- [#76341](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/76341)\n  [`d30dab1f35c4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d30dab1f35c4) -\n  Minor internal refactor to reduce duplication\n\n## 1.0.0\n\n### Major Changes\n\n- [#70616](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70616)\n  [`42e57ea65fee`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/42e57ea65fee) -\n  This is our first `major` release (`1.0`) for all Pragmatic drag and drop packages.\n\n  For a detailed explanation of these changes, and how to upgrade (automatically) to `1.0` please\n  see our\n  [1.0 upgrade guide](http://atlassian.design/components/pragmatic-drag-and-drop/core-package/upgrade-guides/upgrade-guide-for-1.0)\n\n## 0.6.0\n\n### Minor Changes\n\n- [#36269](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/36269)\n  [`8ca10b64c7d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8ca10b64c7d) - Dev\n  dependencies changed.\n\n## 0.5.4\n\n### Patch Changes\n\n- [#36996](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/36996)\n  [`d3fbfaa793e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d3fbfaa793e) - Updated\n  board example\n\n## 0.5.3\n\n### Patch Changes\n\n- [#34443](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34443)\n  [`61cb5313358`](https://bitbucket.org/atlassian/atlassian-frontend/commits/61cb5313358) - Removing\n  unused dependencies and dev dependencies\n\n## 0.5.2\n\n### Patch Changes\n\n- [#33793](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33793)\n  [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure\n  legacy types are published for TS 4.5-4.8\n\n## 0.5.1\n\n### Patch Changes\n\n- [#33649](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33649)\n  [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade\n  Typescript from `4.5.5` to `4.9.5`\n\n## 0.5.0\n\n### Minor Changes\n\n- [#33344](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33344)\n  [`9fd8556db17`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9fd8556db17) - Internal\n  folder name structure change\n\n## 0.4.0\n\n### Minor Changes\n\n- [#33262](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33262)\n  [`34ed7b2ec63`](https://bitbucket.org/atlassian/atlassian-frontend/commits/34ed7b2ec63) - We have\n  changed the name of our drag and drop packages to align on the single name of \"Pragmatic drag and\n  drop\"\n\n  ```diff\n  - @atlaskit/drag-and-drop\n  + @atlaskit/pragmatic-drag-and-drop\n\n  - @atlaskit/drag-and-drop-autoscroll\n  + @atlaskit/pragmatic-drag-and-drop-autoscroll\n\n  - @atlaskit/drag-and-drop-hitbox\n  + @atlaskit/pragmatic-drag-and-drop-hitbox\n\n  - @atlaskit/drag-and-drop-indicator\n  + @atlaskit/pragmatic-drag-and-drop-react-indicator\n  # Note: `react` was added to this package name as our indicator package is designed for usage with `react`.\n\n  - @atlaskit/drag-and-drop-live-region\n  + @atlaskit/pragmatic-drag-and-drop-live-region\n\n  - @atlaskit/drag-and-drop-react-beautiful-dnd-migration\n  + @atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration\n\n  - @atlaskit/drag-and-drop-docs\n  + @atlaskit/pragmatic-drag-and-drop-docs\n  ```\n\n  The new `@atlaskit/pragmatic-drag-and-drop*` packages will start their initial versions from where\n  the ``@atlaskit/drag-and-drop*` packages left off. Doing this will make it easier to look back on\n  changelogs and see how the packages have progressed.\n\n## 0.3.0\n\n### Minor Changes\n\n- [#33258](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33258)\n  [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip\n  minor dependency bump\n\n## 0.2.2\n\n### Patch Changes\n\n- [#32424](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32424)\n  [`2e01c9c74b5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e01c9c74b5) - DUMMY\n  remove before merging to master; dupe adf-schema via adf-utils\n\n## 0.2.1\n\n### Patch Changes\n\n- [#30726](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/30726)\n  [`519765316c5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/519765316c5) - [ux]\n  Updated examples\n\n## 0.2.0\n\n### Minor Changes\n\n- [#30953](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/30953)\n  [`90901f5bbe0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/90901f5bbe0) - Replace\n  default entry point of `undefined` with `{}`.\n\n  > **NOTE:** Importing from the default entry point isn't supported. _Please use individual entry\n  > points in order to always obtain minimum kbs._\n\n## 0.1.3\n\n### Patch Changes\n\n- [#28324](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/28324)\n  [`6455cf006b3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6455cf006b3) - Builds\n  for this package now pass through a tokens babel plugin, removing runtime invocations of the\n  tokens() function and improving performance.\n\n## 0.1.2\n\n### Patch Changes\n\n- [#24874](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24874)\n  [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade\n  Typescript from `4.3.5` to `4.5.5`\n\n## 0.1.1\n\n### Patch Changes\n\n- [#24613](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24613)\n  [`e7d9e25b0b1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e7d9e25b0b1) - Updated\n  examples to reflect naming and path changes of other drag and drop packages\n\n## 0.1.0\n\n### Minor Changes\n\n- [#24532](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24532)\n  [`73427c38077`](https://bitbucket.org/atlassian/atlassian-frontend/commits/73427c38077) - Initial\n  release of `@atlaskit/drag-and-drop` packages 🎉\n\n## 0.0.1\n\n### Patch Changes\n\n- [#24492](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24492)\n  [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade\n  Typescript from `4.2.4` to `4.3.5`.\n"
  },
  {
    "path": "packages/documentation/LICENSE.md",
    "content": "Copyright 2022 Atlassian Pty Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in\ncompliance with the License. You may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is\ndistributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\nimplied. See the License for the specific language governing permissions and limitations under the\nLicense.\n"
  },
  {
    "path": "packages/documentation/README.md",
    "content": "## Pragmatic drag and drop\n\nThis package holds the documentation for Pragmatic drag and drop in one place. It is not intended to be consumed directly by consumers. The package is used by other tools for sharing examples\n"
  },
  {
    "path": "packages/documentation/__tests__/playwright/board.spec.ts",
    "content": "import { expect, type Page, test } from '@af/integration-testing';\n\n/**\n * The header is the draggable part of a column.\n */\nfunction getColumnHeader(page: Page, columnId: string) {\n\treturn page.locator(`[data-testid=\"column-header-${columnId}\"]`);\n}\n\nfunction getItem(page: Page, itemId: string) {\n\treturn page.locator(`[data-testid=\"item-${itemId}\"]`);\n}\n\nasync function getColumnOrder(page: Page): Promise<string[]> {\n\t// Reaching into to the column title as the whole header (`column-header-`)\n\t// also contains an `IconButton` which has visually hidden text\n\treturn page.locator('[data-testid^=\"column-header-title-\"]').allTextContents();\n}\n\nfunction getCardOrder(page: Page, columnId: string): Promise<(string | null)[]> {\n\treturn page\n\t\t.locator(`[data-testid^=\"column-${columnId}\"]`)\n\t\t.locator('[data-testid^=\"item-\"]')\n\t\t.evaluateAll((elements) => elements.map((e) => e.getAttribute('data-testid')));\n}\n\ntest.describe('board', () => {\n\ttest('should allow sorting columns', async ({ page }) => {\n\t\tawait page.visitExample<typeof import('../../examples/board.tsx')>('pragmatic-drag-and-drop', 'documentation', 'board', {\n\t\t\t'react-18-mode': 'legacy',\n\t\t});\n\t\tawait page.waitForSelector('[draggable=\"true\"]');\n\n\t\tconst dragHandle = getColumnHeader(page, 'trello');\n\t\tconst dropTarget = getColumnHeader(page, 'jira');\n\n\t\texpect(await getColumnOrder(page)).toEqual(['Confluence', 'Jira', 'Trello']);\n\n\t\tawait dragHandle.dragTo(dropTarget);\n\n\t\texpect(await getColumnOrder(page)).toEqual(['Confluence', 'Trello', 'Jira']);\n\t});\n\n\ttest('should allow sorting tasks in a column', async ({ page }) => {\n\t\tawait page.visitExample<typeof import('../../examples/board.tsx')>('pragmatic-drag-and-drop', 'documentation', 'board', {\n\t\t\t'react-18-mode': 'legacy',\n\t\t});\n\t\tawait page.waitForSelector('[draggable=\"true\"]');\n\n\t\t// Both ids correspond to elements in the first column\n\t\tconst dragHandle = getItem(page, 'id:1');\n\t\tconst dropTarget = getItem(page, 'id:5');\n\n\t\tconst initialCardOrder = await getCardOrder(page, 'confluence');\n\t\texpect(initialCardOrder.indexOf('item-id:1')).toBe(0);\n\t\texpect(initialCardOrder.indexOf('item-id:5')).toBe(4);\n\n\t\tawait dragHandle.dragTo(dropTarget);\n\n\t\tconst finalCardOrder = await getCardOrder(page, 'confluence');\n\t\texpect(finalCardOrder.indexOf('item-id:1')).toBe(3);\n\t\texpect(finalCardOrder.indexOf('item-id:5')).toBe(4);\n\t});\n\n\ttest('should allow moving tasks between columns', async ({ page }) => {\n\t\tawait page.visitExample<typeof import('../../examples/board.tsx')>('pragmatic-drag-and-drop', 'documentation', 'board', {\n\t\t\t'react-18-mode': 'legacy',\n\t\t});\n\t\tawait page.waitForSelector('[draggable=\"true\"]');\n\n\t\t// Corresponds to an element in the first column\n\t\tconst dragHandle = getItem(page, 'id:5');\n\t\t// Corresponds to an element in the third column\n\t\tconst dropTarget = getItem(page, 'id:23');\n\n\t\tconst initialCardOrderFirstColumn = await getCardOrder(page, 'confluence');\n\t\tconst initialCardOrderThirdColumn = await getCardOrder(page, 'trello');\n\t\texpect(initialCardOrderFirstColumn).toContain('item-id:5');\n\t\texpect(initialCardOrderThirdColumn).not.toContain('item-id:5');\n\n\t\tawait dragHandle.dragTo(dropTarget);\n\n\t\tconst finalCardOrderFirstColumn = await getCardOrder(page, 'confluence');\n\t\tconst finalCardOrderThirdColumn = await getCardOrder(page, 'trello');\n\t\texpect(finalCardOrderFirstColumn).not.toContain('item-id:5');\n\t\texpect(finalCardOrderThirdColumn).toContain('item-id:5');\n\t});\n\n\ttest('should capture and report a11y violations', async ({ page }) => {\n\t\tawait page.visitExample<typeof import('../../examples/board.tsx')>('pragmatic-drag-and-drop', 'documentation', 'board', {\n\t\t\t'react-18-mode': 'legacy',\n\t\t});\n\t\tawait page.waitForSelector('[draggable=\"true\"]');\n\n\t\tawait expect(page).toBeAccessible();\n\t});\n});\n"
  },
  {
    "path": "packages/documentation/__tests__/playwright/tree.spec.ts",
    "content": "import invariant from 'tiny-invariant';\n\nimport { expect, type Page, test } from '@af/integration-testing';\n\nimport { indentPerLevel } from '../../examples/pieces/tree-legacy/constants';\n\ntype TScenario = {\n\tname: string;\n\tbeforeEach: ({ page }: { page: Page }) => Promise<void>;\n};\n\nconst scenarios: TScenario[] = [\n\t{\n\t\tname: 'tree',\n\t\tbeforeEach: async ({ page }: { page: Page }) => {\n\t\t\tawait page.visitExample<typeof import('../../examples/tree.tsx')>('pragmatic-drag-and-drop', 'documentation', 'tree');\n\t\t\tawait page.waitForSelector('[draggable=\"true\"]');\n\t\t},\n\t},\n\t{\n\t\tname: 'tree-legacy',\n\t\tbeforeEach: async ({ page }: { page: Page }) => {\n\t\t\tawait page.visitExample<typeof import('../../examples/tree-legacy.tsx')>('pragmatic-drag-and-drop', 'documentation', 'tree-legacy');\n\t\t\tawait page.waitForSelector('[draggable=\"true\"]');\n\t\t},\n\t},\n];\n\nscenarios.forEach((scenario) => {\n\ttest.beforeEach(async ({ page }) => {\n\t\tawait scenario.beforeEach({ page });\n\t});\n\n\ttest.describe(`${scenario.name}`, () => {\n\t\ttest('should allow a tree item to be reordered above another item', async ({ page }) => {\n\t\t\tconst dragHandle = page.getByTestId('tree-item-1.2');\n\t\t\tconst dropTarget = page.getByTestId('tree-item-1.1');\n\t\t\tawait expect(dragHandle).toHaveAttribute('data-level', '1');\n\t\t\tawait expect(dragHandle).toHaveAttribute('data-index', '1');\n\n\t\t\tconst dropTargetRect = await dropTarget.boundingBox();\n\t\t\tinvariant(dropTargetRect, 'Could not obtain bounding box from drop target');\n\n\t\t\t// drag over top quarter of drop target\n\t\t\tawait dragHandle.dragTo(dropTarget, {\n\t\t\t\ttargetPosition: { x: 1, y: dropTargetRect.height / 4 },\n\t\t\t});\n\n\t\t\tawait expect(dragHandle).toHaveAttribute('data-level', '1');\n\t\t\tawait expect(dragHandle).toHaveAttribute('data-index', '0');\n\t\t});\n\n\t\ttest('should allow a tree item to be reordered below another item', async ({ page }) => {\n\t\t\tconst dragHandle = page.getByTestId('tree-item-1.1.1');\n\t\t\tconst dropTarget = page.getByTestId('tree-item-1.1.2');\n\t\t\tawait expect(dragHandle).toHaveAttribute('data-level', '2');\n\t\t\tawait expect(dragHandle).toHaveAttribute('data-index', '0');\n\n\t\t\tconst dropTargetRect = await dropTarget.boundingBox();\n\t\t\tinvariant(dropTargetRect, 'Could not obtain bounding box from drop target');\n\n\t\t\t// drag over bottom quarter of drop target\n\t\t\tawait dragHandle.dragTo(dropTarget, {\n\t\t\t\ttargetPosition: {\n\t\t\t\t\tx: dropTargetRect.width - 1,\n\t\t\t\t\ty: dropTargetRect.height - dropTargetRect.height / 4,\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tawait expect(dragHandle).toHaveAttribute('data-level', '2');\n\t\t\tawait expect(dragHandle).toHaveAttribute('data-index', '1');\n\t\t});\n\n\t\ttest('should allow a tree item to become a child of another tree item', async ({ page }) => {\n\t\t\tconst dragHandle = page.getByTestId('tree-item-1.2');\n\t\t\tconst dropTarget = page.getByTestId('tree-item-1.1');\n\t\t\tawait expect(dragHandle).toHaveAttribute('data-level', '1');\n\t\t\tawait expect(dragHandle).toHaveAttribute('data-index', '1');\n\n\t\t\tconst dropTargetRect = await dropTarget.boundingBox();\n\t\t\tinvariant(dropTargetRect, 'Could not obtain bounding box from drop target');\n\n\t\t\t// drag over middle of drop target\n\t\t\tawait dragHandle.dragTo(dropTarget, {\n\t\t\t\ttargetPosition: {\n\t\t\t\t\tx: dropTargetRect.width / 2,\n\t\t\t\t\ty: dropTargetRect.height / 2,\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tawait expect(dragHandle).toHaveAttribute('data-level', '2');\n\t\t\tawait expect(dragHandle).toHaveAttribute('data-index', '0');\n\t\t});\n\n\t\ttest('should allow a tree item to be reparented from level 2 -> level 1', async ({ page }) => {\n\t\t\tconst dragHandle = page.getByTestId('tree-item-1.1.2');\n\t\t\tawait expect(dragHandle).toHaveAttribute('data-level', '2');\n\t\t\tawait expect(dragHandle).toHaveAttribute('data-index', '1');\n\n\t\t\tconst dragHandleRect = await dragHandle.boundingBox();\n\t\t\tinvariant(dragHandleRect, 'Could not obtain bounding box from drop target');\n\n\t\t\tawait dragHandle.hover();\n\t\t\tawait page.mouse.down();\n\t\t\t// drag item to the bottom half and left (into the space before border-box)\n\t\t\tawait page.mouse.move(\n\t\t\t\tdragHandleRect.x + indentPerLevel,\n\t\t\t\tdragHandleRect.y + dragHandleRect.height / 2,\n\t\t\t);\n\t\t\tawait page.mouse.up();\n\n\t\t\tawait expect(dragHandle).toHaveAttribute('data-level', '1');\n\t\t\tawait expect(dragHandle).toHaveAttribute('data-index', '1');\n\t\t});\n\n\t\ttest('should allow a tree item to be reparented from level 2 -> level 0', async ({ page }) => {\n\t\t\tconst dragHandle = page.getByTestId('tree-item-1.1.2');\n\t\t\tawait expect(dragHandle).toHaveAttribute('data-level', '2');\n\t\t\tawait expect(dragHandle).toHaveAttribute('data-index', '1');\n\n\t\t\tconst dragHandleRect = await dragHandle.boundingBox();\n\t\t\tinvariant(dragHandleRect, 'Could not obtain bounding box from drop target');\n\n\t\t\tawait dragHandle.hover();\n\t\t\tawait page.mouse.down();\n\t\t\t// drag item to the bottom half and left edge\n\t\t\tawait page.mouse.move(dragHandleRect.x + 1, dragHandleRect.y + dragHandleRect.height / 2);\n\t\t\tawait page.mouse.up();\n\n\t\t\tawait expect(dragHandle).toHaveAttribute('data-level', '0');\n\t\t\tawait expect(dragHandle).toHaveAttribute('data-index', '1');\n\t\t});\n\n\t\ttest('should not allow a tree item to be made a child when the \"make-child\" instruction is blocked on the drop target', async ({\n\t\t\tpage,\n\t\t}) => {\n\t\t\tconst dragHandle = page.getByTestId('tree-item-2.1.1');\n\t\t\tconst dropTarget = page.getByTestId('tree-item-1.1.2');\n\t\t\tawait expect(dragHandle).toHaveAttribute('data-level', '2');\n\t\t\tawait expect(dragHandle).toHaveAttribute('data-index', '0');\n\n\t\t\tconst dropTargetRect = await dropTarget.boundingBox();\n\t\t\tinvariant(dropTargetRect, 'Could not obtain bounding box from drop target');\n\n\t\t\tawait dragHandle.dragTo(dropTarget, {\n\t\t\t\ttargetPosition: {\n\t\t\t\t\tx: dropTargetRect.width / 2,\n\t\t\t\t\ty: dropTargetRect.height / 2,\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tawait expect(dragHandle).toHaveAttribute('data-level', '2');\n\t\t\tawait expect(dragHandle).toHaveAttribute('data-index', '0');\n\t\t});\n\n\t\ttest('should capture and report a11y violations', async ({ page }) => {\n\t\t\tawait expect(page).toBeAccessible({ violationCount: 1 });\n\t\t});\n\t});\n});\n"
  },
  {
    "path": "packages/documentation/constellation/00-examples/index.mdx",
    "content": "---\ntitle: Examples\norder: 0\n---\n\nimport { Stack, Inline } from '@atlaskit/primitives';\nimport SectionMessage from '@atlaskit/section-message';\nimport { LinkButton } from '@atlaskit/button/new';\n\nimport ListExample from '../../examples/list';\nimport BoardExample from '../../examples/board';\nimport GridExample from '../../examples/grid';\nimport TableExample from '../../examples/table';\nimport FileExample from '../../examples/file';\nimport DrawingExample from '../../examples/drawing';\nimport ResizingExample from '../../examples/resizing';\nimport TreeExample from '../../examples/tree';\nimport TreeLegacyExample from '../../examples/tree-legacy';\nimport VirtualListExample from '../../examples/virtual-list';\nimport { TrelloLikeBoardIframe } from '../../examples/trello-like-board-iframe';\n\nThe examples on this page demonstrate _some_ of what is possible with Pragmatic drag and drop.\nPragmatic drag and drop gives you low level building blocks that you can use to make _any_ drag and\ndrop experience that the web platform supports. The examples use a combination of our\n[core package](/components/pragmatic-drag-and-drop/core-package) and\n[optional packages](/components/pragmatic-drag-and-drop/optional-packages).\n\n## List\n\n<Example Component={ListExample} appearance=\"showcase-only\" />\n\n### Simple list on other stacks\n\nWe have created [simple list example](https://github.com/alexreardon/pdnd-react-tailwind) which does\nnot leverage any other Atlassian Design System outputs.\n\n<a\n\thref=\"https://stackblitz.com/github/alexreardon/pdnd-react-tailwind?startScript=dev\"\n\ttarget=\"_blank\"\n>\n\t{/* Using inline styles rather than pulling into a seperate component and using emotion\n\t\tas Gatsby can only load images in `mdx` when they are in the `mdx` document root.*/}\n\t<img\n\t\tsrc=\"/images/pdnd-standalone-simple-example.png\"\n\t\talt=\"Simple list example\"\n\t\tstyle=\"max-width:400px; border:var(--ds-border-width) solid var(--ds-border-discovery); border-radius:var(--ds-border-radius)\"\n\t/>\n</a>\n\nIn order to demonstrate how to use Pragmatic drag and drop on different tech stacks, the community\nhas ported this [simple list example](https://github.com/alexreardon/pdnd-react-tailwind) to various\ntech stacks:\n\n<details>\n  <summary>List example ports</summary>\n\n<br />\n\n<SectionMessage appearance=\"warning\">\n\nThese examples have been contributed by a mixture of Atlassian and non-Atlassian contributors.\nPlease use caution when viewing and running these examples.\n\n</SectionMessage>\n\n<br />\n<br />\n\n| Technologies                             | Source                                                         | Standalone example                                                                                   | Author(s)                                          |\n| ---------------------------------------- | -------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | -------------------------------------------------- |\n| `React` + `TailwindCSS`                  | [Github](https://github.com/alexreardon/pdnd-react-tailwind)   | [Run on StackBlitz](https://stackblitz.com/github/alexreardon/pdnd-react-tailwind?startScript=dev)   | [@alexandereardon](https://x.com/alexandereardon)  |\n| `TailwindCSS`                            | [Github](https://github.com/alexreardon/pdnd-vanilla-tailwind) | [Run on StackBlitz](https://stackblitz.com/github/alexreardon/pdnd-vanilla-tailwind?startScript=dev) | [@alexandereardon](https://x.com/alexandereardon)  |\n| `SolidJS` + `TailwindCSS`                | [Github](https://github.com/dotnize/pdnd-solid-tailwind)       | [Run on StackBlitz](https://stackblitz.com/github/dotnize/pdnd-solid-tailwind?startScript=dev)       | [@dotnize](https://github.com/dotnize)             |\n| `Vue 3` + `TailwindCSS`                  | [Github](https://github.com/frenicohansen/pdnd-vue)            | [Run on StackBlitz](https://stackblitz.com/github/frenicohansen/pdnd-vue?startScript=dev)            | [@frenicohansen](https://github.com/frenicohansen) |\n| `Vue 3` + `Nuxt 3 (SSR)` + `TailwindCSS` | [Github](https://github.com/frenicohansen/pdnd-nuxt)           | [Run on StackBlitz](https://stackblitz.com/github/frenicohansen/pdnd-nuxt?startScript=dev)           | [@frenicohansen](https://github.com/frenicohansen) |\n\n</details>\n\n## Board\n\n<Example Component={BoardExample} appearance=\"showcase-only\" />\n\n### Board with shadows\n\nA board example that leverages shadows for drop placement (like [Trello](https://trello.com/)).\n\n<SectionMessage appearance=\"information\">\n\nThis example does not have our\n[accessibility guidelines](components/pragmatic-drag-and-drop/accessibility-guidelines) wired up to\nkeep the code simpler. It is built on [React](https://react.dev/),\n[TailwindCSS](https://tailwindcss.com/) (for styling) and [Lucide](https://lucide.dev/) (for icons).\n\n</SectionMessage>\n\n<SectionMessage appearance=\"warning\">\n\n**For Atlassians**: please do not leverage shadows for drop placement in Atlassian experiences.\nTrello being the only exception to this rule.\n\nShadow based drop placement _does not_ follow our\n[design guidelines](/components/pragmatic-drag-and-drop/design-guidelines) that have been agreed on\nby craft and leadership. Our chosen design affordances have been chosen because they scale well\nacross a huge variety of experiences in a consistent way. This predictability is important for our\nusers. Our chosen affordances are also performant and easy to get right.\n\n</SectionMessage>\n\n<TrelloLikeBoardIframe />\n\n## Grid\n\n<SectionMessage appearance=\"information\">\n\nThis grid example does a simple \"swap\" when dropping. You can do whatever operations you like with\ngrids (including inserting items based on closest edge). This example does not currently have\naccessibility wired up.\n\n</SectionMessage>\n\n<Example Component={GridExample} appearance=\"showcase-only\" />\n\n## Table\n\n<SectionMessage appearance=\"information\" title=\"Needs updating\">\n\nOur table example does not line up with our\n[latest design guidelines](/components/pragmatic-drag-and-drop/design-guidelines) and needs to be\nupdated.\n\n</SectionMessage>\n\n<Example Component={TableExample} appearance=\"showcase-only\" />\n\n## Tree\n\n<Example Component={TreeExample} appearance=\"showcase-only\" />\n\n## Tree (legacy)\n\n<SectionMessage>\n\nThis tree example (which uses our `tree-item` outputs) is no longer recommended, but you are still\nwelcome to use it.\n\nWe have moved in a different, and more flexible direction with our new `list-item` outputs.\n\n</SectionMessage>\n\n<Example Component={TreeLegacyExample} appearance=\"showcase-only\" />\n\n## File\n\nUse the [external adapter](/components/pragmatic-drag-and-drop/core-package/adapters/external) to\ncapture files that users drag and drop onto the page.\n\nWhen requesting files, you should also provide an `<input type=\"file\" />` for usability and\naccessibility reasons.\n\n<Example Component={FileExample} appearance=\"showcase-only\" />\n\n## Side navigation\n\nThis example shows off how you can add rich drag and drop interactions to a side navigation\nexperience.\n\n<br />\n\n<a href=\"/components/navigation-system/side-navigation/drag-and-drop\" target=\"_blank\">\n\t{/**\n\t * Why a link?\n\t *\t- atlassian.design does not support full page examples for us to iframe\n\t *\t- cannot iframe atlaskit as the example is currently only on staging\n\t *\t- cannot use relative imports across package boundaries\n\t *\t- exposing the example on an entry point from navigation-system would impact it's source `dependencies`\n\t *\n\t * Using inline styles as Gatsby can only load images in `mdx` when they are in the `mdx` document root\n\t */}\n\t<img\n\t\tsrc=\"/images/pdnd-standalone-jira-sidebar.png\"\n\t\talt=\"Drag and drop into and out of iframes\"\n\t\tstyle=\"max-width:200px; border:var(--ds-border-width) solid var(--ds-border-discovery); border-radius:var(--ds-border-radius)\"\n\t/>\n</a>\n\nThis example leverages our [navigation system package](/components/navigation-system/), and has it's\nown [specific guidance](/components/navigation-system/side-navigation/drag-and-drop)\n\n## Drawing\n\n<SectionMessage\n\tappearance=\"information\"\n\ttitle=\"Excepted from Success Criterion 2.1.1 - Keyboard (Level A)\"\n>\n\t<Stack space=\"space.200\">\n\t\t<p>\n\t\t\tThis example is excepted from the{' '}\n\t\t\t<a href=\"https://www.w3.org/WAI/WCAG21/Understanding/keyboard\">\n\t\t\t\tWCAG Success Criterion 2.1.1 - Keyboard (Level A)\n\t\t\t</a>\n\t\t\t. The underlying function (freehand drawing) requires input that depends on the path of the\n\t\t\tuser's movement and not just the endpoints.\n\t\t</p>\n\t\t<p>\n\t\t\tDue to{' '}\n\t\t\t<a href=\"https://www.w3.org/WAI/WCAG21/Understanding/keyboard-no-exception\">\n\t\t\t\tSuccess Criterion 2.1.3 - Keyboard (No Exception) (Level AAA)\n\t\t\t</a>\n\t\t\t, path-dependent input cannot meet{' '}\n\t\t\t<a href=\"https://www.w3.org/WAI/WCAG21/Understanding/keyboard-accessible\">Guideline 2.1</a> at\n\t\t\tLevel AAA.\n\t\t</p>\n\t\t<p>\n\t\t\tWherever possible, this exception should not be relied on, and an alternative input method\n\t\t\tshould be provided.\n\t\t</p>\n\t</Stack>\n</SectionMessage>\n\n<Example Component={DrawingExample} appearance=\"showcase-only\" />\n\n## Resizing\n\n<SectionMessage appearance=\"information\" title=\"Accessibility guidance in progress\">\n\t<p>\n\t\tAn investigation is required to decide on appropriate accessible controls for resizing. If you\n\t\twould like us to prioritise this investigation, please reach out.\n\t</p>\n</SectionMessage>\n\n<Example Component={ResizingExample} appearance=\"showcase-only\" />\n\n## Virtual\n\n<SectionMessage appearance=\"success\">\n\t<p>\n\t\tPragmatic drag an drop works with <strong>any virtual experience</strong>: you can add, remove\n\t\tor change any entity you want during a drag operation. This example uses{' '}\n\t\t<a href=\"https://tanstack.com/virtual/latest\">TanStack Virtual</a>, but you can use any\n\t\tvirtualization solution you like.\n\t\t<br />\n\t\tSee our{' '}\n\t\t<a href=\"/components/pragmatic-drag-and-drop/core-package/recipes/virtualization\">\n\t\t\tvirtualization guide\n\t\t</a>{' '}\n\t\tfor more details.\n\t</p>\n</SectionMessage>\n\n<Example Component={VirtualListExample} appearance=\"showcase-only\" />\n\n## Iframes and external applications\n\nPragmatic drag and drop\n[enables you to attach data for external systems](/components/pragmatic-drag-and-drop/core-package/adapters/element/about#data-for-external-consumers-getinitialdataforexternal)\n(other brower tabs, iframes or even native applications), as well as\n[respond to and recieve data being dragged from external systems](/components/pragmatic-drag-and-drop/core-package/adapters/external/about).\n\n<SectionMessage title=\"External example\">\n\n`atlassian.design` currently does not support displaying an example without the page layout, so our\niframe example is hosted on another site.\n\n</SectionMessage>\n\n<Stack space=\"space.100\">\n\t<a\n\t\thref=\"https://atlaskit.atlassian.com/examples.html?groupId=pragmatic-drag-and-drop&packageId=documentation&exampleId=iframe-board&mode=dark\"\n\t\ttarget=\"_blank\"\n\t>\n\t\t{/* Using inline styles rather than pulling into a seperate component and using emotion\n\t\tas Gatsby can only load images in `mdx` when they are in the `mdx` document root.*/}\n\t\t<img\n\t\t\tsrc=\"/images/pdnd-iframe-example.png\"\n\t\t\talt=\"Drag and drop into and out of iframes\"\n\t\t\tstyle=\"max-width:400px; border:var(--ds-border-width) solid var(--ds-border-discovery); border-radius:var(--ds-border-radius)\"\n\t\t/>\n\t</a>\n\t<Inline space=\"space.100\">\n\t\t<a\n\t\t\thref=\"https://github.com/atlassian/pragmatic-drag-and-drop/blob/main/packages/documentation/examples/iframe-board.tsx\"\n\t\t\ttarget=\"_blank\"\n\t\t>\n\t\t\tView source\n\t\t</a>\n\t\t<a href=\"https://www.youtube.com/watch?v=E4l4MBO-Bwg\" target=\"_blank\">\n\t\t\tPresentation\n\t\t</a>\n\t</Inline>\n</Stack>\n"
  },
  {
    "path": "packages/documentation/constellation/01-tutorial/index.mdx",
    "content": "---\norder: 0\ntitle: Tutorial\ndescription: Building an example together, step by step.\n---\n\nimport ChessboardStarterCode from '../../examples/pieces/getting-started/chessboard-starter-code';\nimport KingInPlace from '../../examples/pieces/getting-started/draggable-piece-in-place';\nimport KingWithState from '../../examples/pieces/getting-started/draggable-piece-with-state';\nimport ChessboardDraggable from '../../examples/pieces/getting-started/chessboard-draggable';\nimport ChessboardDropTarget from '../../examples/pieces/getting-started/chessboard-drop-target';\nimport ChessboardColoredDropTargets from '../../examples/pieces/getting-started/chessboard-colored-drop-targets';\nimport ChessboardDropTargetsCanDrop from '../../examples/pieces/getting-started/chessboard-drop-targets-can-drop';\nimport ChessboardWithMonitor from '../../examples/pieces/getting-started/chessboard-monitor';\n\nThis tutorial will walk you through the basic entities of the Pragmatic drag and drop including\n[draggables](/components/pragmatic-drag-and-drop/core-package/adapters/element),\n[drop targets](/components/pragmatic-drag-and-drop/core-package/drop-targets) and\n[monitors](/components/pragmatic-drag-and-drop/core-package/monitors). To understand how these\npieces work together we will be creating a chess board with draggable pieces.\n\nFor installation details and import references, see the\n[core package page](/components/pragmatic-drag-and-drop/core-package).\n\n## Starter code\n\nHere is the starter code we'll be using throughout this guide. Notice how none of the pieces can be\ndragged.\n\n<Example Component={ChessboardStarterCode} />\n\n## Step 1: Making the pieces draggable\n\nThe first step to make our chess board functional is to allow the pieces to be dragged around.\n\nPragmatic drag and drop provides a `draggable` function that you attach to an element to enable the\ndraggable behavior. When using React this is done in an effect:\n\n```tsx\nfunction Piece({ image, alt }: PieceProps) {\n\tconst ref = useRef(null);\n\n\tuseEffect(() => {\n\t\tconst el = ref.current;\n\t\tinvariant(el);\n\n\t\treturn draggable({\n\t\t\telement: el,\n\t\t});\n\t}, []);\n\n\treturn <img css={imageStyles} src={image} alt={alt} ref={ref} />;\n}\n```\n\nOur piece now behaves as follows (try dragging it around):\n\n<Example Component={KingInPlace} appearance=\"showcase-only\" />\n\nAlthough the piece can now be dragged around, it doesn't feel as though the piece is being 'picked\nup', as the piece stays in place while being dragged.\n\nTo make the piece fade while being dragged we can use the `onDragStart` and `onDrop` arguments\nwithin `draggable` to set state. We can then use this state to toggle css within the `style` prop to\nreduce the opacity.\n\n```tsx\nfunction Piece({ image, alt }: PieceProps) {\n\tconst ref = useRef(null);\n\tconst [dragging, setDragging] = useState<boolean>(false); // NEW\n\n\tuseEffect(() => {\n\t\tconst el = ref.current;\n\t\tinvariant(el);\n\n\t\treturn draggable({\n\t\t\telement: el,\n\t\t\tonDragStart: () => setDragging(true), // NEW\n\t\t\tonDrop: () => setDragging(false), // NEW\n\t\t});\n\t}, []);\n\n\treturn (\n\t\t<img\n\t\t\tcss={[dragging && hidePieceStyles, imageStyles]} // toggling css using state to hide the piece\n\t\t\tsrc={image}\n\t\t\talt={alt}\n\t\t\tref={ref}\n\t\t/>\n\t);\n}\n```\n\nNow the piece fades when we drag it, making it feel like the piece is being 'picked up'. 🥳\n\n<Example Component={KingWithState} appearance=\"showcase-only\" />\n\nNow let's add it to the board!\n\n<Example Component={ChessboardDraggable} appearance=\"showcase-only\" />\n\nTo see the full `draggable` documentation see\n[this page](/components/pragmatic-drag-and-drop/core-package/adapters/element).\n\n## Step 2: Making the squares drop targets\n\nNow that we have draggable pieces we want the squares on the board to act as areas that can be\n'dropped' onto. For this we will use the `dropTargetForElements` function from Pragmatic drag and\ndrop.\n\nDrop targets are elements that a draggable element can be dropped on.\n\nCreating a drop target follows the same technique as for `draggable`. Let's abstract out the board's\nsquares, which were previously `div`s, into their own component.\n\n```tsx\nfunction Square({ location, children }: SquareProps) {\n\tconst ref = useRef(null);\n\tconst [isDraggedOver, setIsDraggedOver] = useState(false);\n\n\tuseEffect(() => {\n\t\tconst el = ref.current;\n\t\tinvariant(el);\n\n\t\treturn dropTargetForElements({\n\t\t\telement: el,\n\t\t\tonDragEnter: () => setIsDraggedOver(true),\n\t\t\tonDragLeave: () => setIsDraggedOver(false),\n\t\t\tonDrop: () => setIsDraggedOver(false),\n\t\t});\n\t}, []);\n\n\tconst isDark = (location[0] + location[1]) % 2 === 1;\n\n\treturn (\n\t\t<div css={squareStyles} style={{ backgroundColor: getColor(isDraggedOver, isDark) }} ref={ref}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n```\n\nSimilar to the draggable piece component, we set state on the component based on the dragging\nbehavior.\n\nWe then use this state to set the color of the square using the `getColor` function:\n\n```tsx\nfunction getColor(isDraggedOver: boolean, isDark: boolean): string {\n\tif (isDraggedOver) {\n\t\treturn 'skyblue';\n\t}\n\treturn isDark ? 'lightgrey' : 'white';\n}\n```\n\nThe squares now highlight when dragged over!\n\n<Example Component={ChessboardDropTarget} appearance=\"showcase-only\" />\n\nTo take this a step further we can color the square green when a piece is eligible to be dropped\nonto and red when it is not.\n\nTo achieve this we first use the `getInitialData` argument on `draggable` to surface the piece type\nand starting location of the dragging piece.\n\n```tsx\nfunction Piece({ location, pieceType, image, alt }: PieceProps) {\n\tconst ref = useRef(null);\n\tconst [dragging, setDragging] = useState<boolean>(false);\n\n\tuseEffect(() => {\n\t\tconst el = ref.current;\n\t\tinvariant(el);\n\n\t\treturn draggable({\n\t\t\telement: el,\n\t\t\tgetInitialData: () => ({ location, pieceType }), // NEW\n\t\t\tonDragStart: () => setDragging(true),\n\t\t\tonDrop: () => setDragging(false),\n\t\t});\n\t}, [location, pieceType]);\n\n\t/*...*/\n}\n```\n\nWe then need to consume this data at the drop targets.\n\nYou can see below that the drop target can now access to the draggable element's location and piece\ntype that was surfaced from the `draggable`. We've also introduced a new `canMove` function which\ndetermines whether a piece can move to a square based on the start and end location, the piece type\nand whether there is already a piece on that square.\n\nWhat is important to note is that when using Typescript the type of the data is not carried over\nfrom the `draggable` to the drop target's `source`. Therefore we need to call the type guarding\nfunctions `isCoord` and `isPieceType` before `canMove` can be called.\n\n```ts\ntype HoveredState = 'idle' | 'validMove' | 'invalidMove';\n\nfunction Square({ pieces, location, children }: SquareProps) {\n\tconst ref = useRef(null);\n\tconst [state, setState] = useState<HoveredState>('idle');\n\n\tuseEffect(() => {\n\t\tconst el = ref.current;\n\t\tinvariant(el);\n\n\t\treturn dropTargetForElements({\n\t\t\telement: el,\n\t\t\tonDragEnter: ({ source }) => {\n\t\t\t\t// source is the piece being dragged over the drop target\n\t\t\t\tif (\n\t\t\t\t\t// type guards\n\t\t\t\t\t!isCoord(source.data.location) ||\n\t\t\t\t\t!isPieceType(source.data.pieceType)\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (canMove(source.data.location, location, source.data.pieceType, pieces)) {\n\t\t\t\t\tsetState('validMove');\n\t\t\t\t} else {\n\t\t\t\t\tsetState('invalidMove');\n\t\t\t\t}\n\t\t\t},\n\t\t\tonDragLeave: () => setState('idle'),\n\t\t\tonDrop: () => setState('idle'),\n\t\t});\n\t}, [location, pieces]);\n\n\t/*...*/\n}\n```\n\nThe new state is then used to set the color of the square as before.\n\n```tsx\nfunction getColor(state: HoveredState, isDark: boolean): string {\n\tif (state === 'validMove') {\n\t\treturn 'lightgreen';\n\t} else if (state === 'invalidMove') {\n\t\treturn 'pink';\n\t}\n\treturn isDark ? 'lightgrey' : 'white';\n}\n```\n\nWhen put all together, the squares now highlight if a move is valid when hovered over.\n\n<Example Component={ChessboardColoredDropTargets} appearance=\"showcase-only\" />\n\nWe can also make use of the data we attached to the draggable to prevent interractions with the\nsquare it is being dragged from. This makes use of the `canDrop` argument on\n`dropTargetForElements`.\n\n```tsx\nreturn dropTargetForElements({\n\telement: el,\n\tcanDrop: ({ source }) => {\n\t\t// NEW\n\t\tif (!isCoord(source.data.location)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn !isEqualCoord(source.data.location, location);\n\t},\n\t// ...the rest of our dropTargetForElements arguments\n});\n```\n\nNow we can see that the square the piece is currently in does not change color when hovered over and\ncannot be dropped onto. This works by disabling the drop target functionality when `canDrop` returns\n`false`.\n\n<Example Component={ChessboardDropTargetsCanDrop} appearance=\"showcase-only\" />\n\nSee [this page](/components/pragmatic-drag-and-drop/core-package/drop-targets), for the full\ndocumentation on drop targets.\n\n## Step 3: Moving the pieces\n\nFinally let's allow the pieces to move squares when dropped. To achieve this we will use a\n`monitorForElements` from Pragmatic drag and drop.\n\nMonitors allow you to observe drag and drop interactions from anywhere in your codebase. This allows\nthem to recieve draggable and drop target data and perform operations without needing state to be\npassed from components.\n\nTherefore we can place a monitor within a `useEffect` at the top level of our chessboard and listen\nfor when pieces are dropped into squares.\n\nTo achieve this we first need to surface the location of the squares within the drop target, as we\ndid for the draggable pieces in the previous step:\n\n```tsx\nfunction Square({ pieces, location, children }: SquareProps) {\n\tconst ref = useRef(null);\n\tconst [state, setState] = useState<HoveredState>('idle');\n\n\tuseEffect(() => {\n\t\tconst el = ref.current;\n\t\tinvariant(el);\n\n\t\treturn dropTargetForElements({\n\t\t\telement: el,\n\t\t\tgetData: () => ({ location }), // NEW\n\n\t\t\t/*...*/\n\t\t});\n\t});\n\n\t/*...*/\n}\n```\n\nWe then add a monitor to the chessboard. Much of this logic mirrors the logic explained above for\ncoloring squares.\n\n```tsx\nfunction Chessboard() {\n\tconst [pieces, setPieces] = useState<PieceRecord[]>([\n\t\t{ type: 'king', location: [3, 2] },\n\t\t{ type: 'pawn', location: [1, 6] },\n\t]);\n\n\tuseEffect(() => {\n\t\treturn monitorForElements({\n\t\t\tonDrop({ source, location }) {\n\t\t\t\tconst destination = location.current.dropTargets[0];\n\t\t\t\tif (!destination) {\n\t\t\t\t\t// if dropped outside of any drop targets\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst destinationLocation = destination.data.location;\n\t\t\t\tconst sourceLocation = source.data.location;\n\t\t\t\tconst pieceType = source.data.pieceType;\n\n\t\t\t\tif (\n\t\t\t\t\t// type guarding\n\t\t\t\t\t!isCoord(destinationLocation) ||\n\t\t\t\t\t!isCoord(sourceLocation) ||\n\t\t\t\t\t!isPieceType(pieceType)\n\t\t\t\t) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst piece = pieces.find((p) => isEqualCoord(p.location, sourceLocation));\n\t\t\t\tconst restOfPieces = pieces.filter((p) => p !== piece);\n\n\t\t\t\tif (\n\t\t\t\t\tcanMove(sourceLocation, destinationLocation, pieceType, pieces) &&\n\t\t\t\t\tpiece !== undefined\n\t\t\t\t) {\n\t\t\t\t\t// moving the piece!\n\t\t\t\t\tsetPieces([{ type: piece.type, location: destinationLocation }, ...restOfPieces]);\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\t}, [pieces]);\n\n\t/*...*/\n}\n```\n\nAnd voila! We now have a chessboard with moving pieces. Go ahead and try dragging the pieces around.\n\nYou can also have a look through the code for more detail on the typing, type guarding and other\ndetails we skimmed over in writing.\n\n<Example Component={ChessboardWithMonitor} />\n\nSee [our monitor page](/components/pragmatic-drag-and-drop/core-package/monitors), for the full\ndocumentation on monitors.\n\n## Now it's your turn\n\nYou're now ready to start building your own projects with Pragmatic drag and drop.\n\nFor more examples see [our example page](/components/pragmatic-drag-and-drop/examples), or to see\nhow to drag and drop files with Pragmatic drag and drop see\n[our external adapter page](/components/pragmatic-drag-and-drop/core-package/adapters/external).\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/00-adapters/00-element/about.mdx",
    "content": "---\norder: 0\ntitle: Element adapter\ndescription: Create, respond to and listen to element drag operations\n---\n\nimport SectionMessage from '@atlaskit/section-message';\nimport NestedDraggablesExample from '../../../../examples/nested-draggables';\n\nThe element adapter enables you to create rich drag and drop experiences, such as lists, boards,\ngrids, resizing and so on.\n\nThe element adapter contains the essential pieces for element operations:\n\n- [draggable](#draggable): enable dragging of an element.\n- [dropTargetForElements](#drop-target-for-elements): marking an element as a valid\n  [drop target](/components/pragmatic-drag-and-drop/core-package/drop-targets)\n- [monitorForElements](#monitor-for-elements): create a\n  [monitor](/components/pragmatic-drag-and-drop/core-package/monitors) to listen for element drag\n  operation events anywhere.\n- [types](#types): all types for this adapter.\n\nThere are also a number of **optional** element utilities:\n\n- [setCustomNativeDragPreview](/components/pragmatic-drag-and-drop/core-package/adapters/element/drag-previews):\n  use a new element as the native drag preview\n- [pointerOutsideOfPreview](/components/pragmatic-drag-and-drop/core-package/adapters/element/drag-previews):\n  native drag preview function to place the users pointer outside of the drag preview\n- [centerUnderPointer](/components/pragmatic-drag-and-drop/core-package/adapters/element/drag-previews):\n  native drag preview function to place the center of the ntaive drag preview under the users\n  pointer\n- [preserveOffsetOnSource](/components/pragmatic-drag-and-drop/core-package/adapters/element/drag-previews):\n  native drag preview function to match the pointer position on a native drag preview as close as\n  possible to the pointer position on the draggable element\n- [disableNativeDragPreview](/components/pragmatic-drag-and-drop/core-package/adapters/element/drag-previews):\n  disable the native drag preview (helpful if you want to use your own custom drag preview or have\n  no drag preview)\n- [scrollJustEnoughIntoView](/components/pragmatic-drag-and-drop/core-package/adapters/element/drag-previews):\n  scroll an element just enough into view so it is visible (helpful when working with default native\n  drag previews)\n\n<SectionMessage>\n\nIt is likely that some\n[top level utilities](/components/pragmatic-drag-and-drop/core-package/utilities) will be helpful\nfor your experience as well\n\n</SectionMessage>\n\n## Draggable\n\nA `draggable` is an `HTMLElement` that can be dragged around by a user.\n\nA `draggable` can be located:\n\n- Outside of any drop targets\n- Inside any amount of levels of nested drop targets\n- So, anywhere!\n\nWhile a drag operation is occurring:\n\n- You can add new `draggable`s\n- You can remount a `draggable`. See\n  [Reconciliation](/components/pragmatic-drag-and-drop/core-package/reconciliation)\n- You can change the dimensions of the dragging `draggable` during a drag. But keep in mind that\n  won't change the drag preview image, as that is collected only at the start of the drag (in\n  `onGenerateDragPreview()`)\n- You can remove the dragging `draggable` during a drag operation. When a `draggable` is removed\n  it's event functions (eg `onDrag`) will no longer be called. Being able to remove the dragging\n  `draggable` is a common requirement for virtual lists\n\n### Draggable argument overview\n\n- `element: HTMLElement`: a `HTMLElement` that will be draggable (using `HTMLElement` as that is the\n  interface that allows the `\"draggable\"` attribute)\n- `dragHandle?: Element`: an optional `Element` that can be used to designate the part of the\n  `draggable` that can exclusively used to drag the whole `draggable`\n- `canDrag?: (args: GetFeedbackArgs) => boolean`: used to conditionally allow dragging (see below)\n- `getInitialData?: (args: GetFeedbackArgs) => Record<string, unknown>`: a one time attaching of\n  data to a draggable as a drag is starting. If you want to understand the _type_ of data attached\n  to a drop target elsewhere in your application, see our\n  [typing data guide](/components/pragmatic-drag-and-drop/core-package/recipes/typing-data).\n- `getInitialDataForExternal?: (args: GetFeedbackArgs) => {[Key in NativeMediaType]?: string;}`:\n  used to attach native data (eg `\"text/plain\"`) to other `window`s or applications.\n\n```ts\ntype GetFeedbackArgs = {\n\t/**\n\t * The user input as a drag is trying to start (the `initial` input)\n\t */\n\tinput: Input;\n\t/**\n\t * The `draggable` element\n\t */\n\telement: HTMLElement;\n\t/**\n\t * The `dragHandle` element for the `draggable`\n\t */\n\tdragHandle: Element | null;\n};\n```\n\n- [`onGenerateDragPreview`](/components/pragmatic-drag-and-drop/core-package/events#event-ongeneratedragpreview)\n- [`onDragStart`](/components/pragmatic-drag-and-drop/core-package/events#event-ondragstart)\n- [`onDrag`](/components/pragmatic-drag-and-drop/core-package/events#event-ondrag)\n- [`onDropTargetChange`](/components/pragmatic-drag-and-drop/core-package/events#event-ondroptargetchange)\n- [`onDrop`](/components/pragmatic-drag-and-drop/core-package/events#event-ondrop)\n\n### Drag handles\n\nA _drag handle_ is the part of your `draggable` element that can be dragged in order to drag the\nwhole `draggable`. By default, the entire `draggable` acts as a _drag handle_. However, you can\noptionally mark a child element of a `draggable` element as the _drag handle_.\n\n```ts\ndraggable({\n\telement: myElement,\n\tdragHandle: myDragHandleElement,\n});\n```\n\nYou can also implement a _drag handle_ by making a small part of an element the `draggable`, and\nthen using\n[`setCustomNativeDragPreview`](/components/pragmatic-drag-and-drop/core-package/adapters/element/drag-previews)\nto generate a preview for the entire entity.\n\n### Conditional dragging (`canDrag()`)\n\nA `draggable` can conditionally allow dragging by using the `canDrag()` function. Returning `true`\nfrom `canDrag()` will allow the drag, and returning `false` will prevent a drag.\n\n```ts\ndraggable({\n\telement: myElement,\n\t// disable dragging\n\tcanDrag: () => false,\n});\n```\n\n<Example Component={NestedDraggablesExample} appearance=\"showcase-only\" />\n\nDisabling a drag by returning `false` from `canDrag()` will prevent any other `draggable` on the\npage from being dragged. `@atlaskit/pragmatic-drag-and-drop` calls `event.preventDefault()` under\nthe hood when `canDrag()` returns `false`, which cancels the drag operation. Unfortunately, once a\ndrag event has started, a `draggable` element cannot individually opt out of dragging and allow\nanother element to be dragged.\n\nIf you want to disable dragging for a `draggable`, but still want a parent `draggable` to be able to\nbe dragged, then rather than using `canDrag()` you can conditionally apply `draggable()`\n\nHere is example of what that could look like using `react`:\n\n```ts\nimport { useEffect } from 'react';\nimport { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nfunction noop(){};\n\nfunction Item({isDraggingEnabled}: {isDraggingEnabled: boolean}) {\n  const ref = useRef();\n\n  useEffect({\n    // when disabled, don't make the element draggable\n    // this will allow a parent draggable to still be dragged\n    if(!isDraggingEnabled) {\n      return noop;\n    }\n    return draggable({\n      element: ref.current,\n    });\n  }, [isDraggingEnabled]);\n\n  return <div ref={ref}>Draggable item</div>\n};\n```\n\n## Data for external consumers (`getInitialDataForExternal()`)\n\n`getInitialDataForExternal()` allows you want to attach data to a drag operation that can be used by\nother `windows`s or applications (externally)\n\n```ts\ndraggable({\n\telement: myElement,\n\tgetInitialData: () => ({ taskId: task.id }),\n\tgetInitialDataForExternal: () => ({\n\t\t'text/plain': task.description,\n\t\t'text/uri-list': task.url,\n\t}),\n});\n```\n\nWe also have a helper `formatURLsForExternal(urls: string[]): string` that allows you to attach\nmultiple urls for external consumers.\n\n```ts\nimport { formatURLsForExternal } from '@atlaskit/pragmatic-drag-and-drop/element/format-urls-for-external';\n\ndraggable({\n\telement: myElement,\n\tgetInitialData: () => ({ taskId: task.id }),\n\tgetInitialDataForExternal: () => ({\n\t\t'text/plain': task.description,\n\t\t'text/uri-list': formatURLsForExternal([task.url, task.anotherUrl]),\n\t}),\n});\n```\n\n<SectionMessage appearance=\"warning\">\n\nData attached for external consumers can be accessed by _any_ external consumer that the user drops\non. It is important that you don't expose private data.\n\n</SectionMessage>\n\nAttaching external data from a `draggable` will not trigger the\n[external adapter](/components/pragmatic-drag-and-drop/core-package/adapters/external) in the\n`window` that the `draggable` started in, but it will trigger the external adapter in other\n`window`s (eg in `<iframe>`s).\n\n## Drop target for elements\n\nA [drop target](/components/pragmatic-drag-and-drop/core-package/drop-targets) for elements.\n\nThe default `dropEffect` for this type of drop target is `\"move\"`. This lines up with our\n[design guides](/components/pragmatic-drag-and-drop/design-guidelines). You can override this\ndefault with `getDropEffect()`.\n\n```ts\nimport { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nconst cleanup = dropTargetForElements({\n  element: myElement,\n  onDragStart: () => console.log('Something started dragging in me!');\n});\n```\n\n## Monitor for elements\n\nA [monitor](/components/pragmatic-drag-and-drop/core-package/monitors) for elements.\n\n```ts\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nconst cleanup = monitorForElements({\n  onDragStart: () => console.log('Dragging an element');\n});\n```\n\n## Types\n\nGenerally you won't need to explicitly use our provided types, but we expose a number of TypeScript\ntypes if you would like to use them.\n\nAll [events](/components/pragmatic-drag-and-drop/core-package/events) on draggables, drop targets\nand monitors, are given the following base payload:\n\n```ts\ntype ElementEventBasePayload = {\n\tlocation: DragLocationHistory;\n\tsource: ElementDragPayload;\n};\n\ntype ElementDragPayload = {\n\telement: HTMLElement;\n\tdragHandle: Element | null;\n\tdata: Record<string, unknown>;\n};\n```\n\nFor all the arguments for all events, you can use our event map type:\n\n```ts\ntype ElementEventPayloadMap = {\n\tonDragStart: ElementEventBasePayload;\n\t// .. the rest of the events\n};\n```\n\nDraggable feedback functions (`canDrag`, `getInitialData`, `getInitialDataForExternal`) are given\nthe following:\n\n```ts\ntype ElementGetFeedbackArgs = {\n\t/**\n\t * The user input as a drag is trying to start (the `initial` input)\n\t */\n\tinput: Input;\n\t/**\n\t * The `draggable` element\n\t */\n\telement: HTMLElement;\n\t/**\n\t * The `dragHandle` element for the `draggable`\n\t */\n\tdragHandle: Element | null;\n};\n```\n\nDrop targets are given a little bit more information in each event:\n\n```ts\ntype ElementDropTargetEventBasePayload = ElementEventBasePayload & {\n\t/**\n\t * A convenance pointer to this drop targets values\n\t */\n\tself: DropTargetRecord;\n};\n```\n\nFor all arguments for all events on drop targets, you can use our event map type:\n\n```ts\ntype ElementDropTargetEventPayloadMap = {\n\tonDragStart: ElementDropTargetEventBasePayload;\n\t// .. the rest of the events\n};\n```\n\nDrop target feedback functions (`canDrop`, `getData`, `getDropEffect`, `getIsSticky`) are given the\nfollowing:\n\n```ts\ntype ElementDropTargetGetFeedbackArgs = {\n\t/**\n\t * The users _current_ input\n\t */\n\tinput: Input;\n\t/**\n\t * The data associated with the entity being dragged\n\t */\n\tsource: ElementDragPayload;\n\t/**\n\t * This drop target's element\n\t */\n\telement: Element;\n};\n```\n\nThe monitor feedback function (`canMonitor`), is given the following:\n\n```ts\ntype ElementMonitorGetFeedbackArgs = {\n\t/**\n\t * The users `initial` drag location\n\t */\n\tinitial: DragLocation;\n\t/**\n\t * The data associated with the entity being dragged\n\t */\n\tsource: ElementDragPayload;\n};\n```\n\nYou can get these type from the element adapter import:\n\n```ts\nimport type {\n\t// Payload for the draggable being dragged\n\tElementDragPayload,\n\t// Base events\n\tElementEventBasePayload,\n\tElementEventPayloadMap,\n\t// Drop target events\n\tElementDropTargetEventBasePayload,\n\tElementDropTargetEventPayloadMap,\n\t// Feedback types\n\tElementGetFeedbackArgs,\n\tElementDropTargetGetFeedbackArgs,\n\tElementMonitorGetFeedbackArgs,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n```\n\nThere are also some types (eg `DropTargetLocation`) that can be used for all adapters which can be\nfound on our [top level utilities page](../../utilities)\n\n## Further reading\n\n- [Drag preview documentation](/components/pragmatic-drag-and-drop/core-package/adapters/element/drag-previews)\n  → how to control what the user drags around during a drag\n- [Typing data](/components/pragmatic-drag-and-drop/core-package/recipes/typing-data) → how to\n  improve the types for `\"data\"`\n- [Unregistered elements](/components/pragmatic-drag-and-drop/core-package/adapters/element/unregistered-elements)\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/00-adapters/00-element/drag-previews.mdx",
    "content": "---\norder: 1\ntitle: Drag previews\ndescription: How to control what is under the users pointer while a drag is occurring\n---\n\nimport SectionMessage from '@atlaskit/section-message';\nimport CheckIcon from '../../../assets/check-icon';\nimport CrossIcon from '../../../assets/cross-icon';\n\nA **drag preview** is the thing that a user drags around during a drag operation. We have a number\nof supported techniques for controlling what the drag preview looks like.\n\n## Native drag previews\n\n<SectionMessage appearance=\"success\">\n\nWe recommend using **native drag previews** where possible as they have great performance\ncharacteristics (they are not rendered on the main thread) and they can be dragged between\napplications\n\n</SectionMessage>\n\nBrowsers have built in \"native\" mechanisms for rendering a drag preview\n\nThere are a few techniques you can use to control what a native drag preview will look like:\n\n### Approach 1: Use a custom native drag preview\n\nYou can ask the browser to take a photo of another visible element on the page and use that as the\ndrag preview. There are some\n[design constraints when leveraging native drag previews](/components/pragmatic-drag-and-drop/web-platform-design-constraints).\n\n<SectionMessage appearance=\"discovery\">\n\nThere are lots of platform gotchas when working with custom native drag previews. We recommend using\nour `setCustomNativeDragPreview()` as it makes it safe and easy to work with custom native drag\npreviews.\n\n</SectionMessage>\n\n#### Mounting a new element with `setCustomNativeDragPreview`\n\nYou can use `setCustomNativeDragPreview` to mount a new element to the page to be used as the drag\npreview. `setCustomNativeDragPreview` will call your `cleanup` function to remove the preview\nelement from the page after the browser has taken a photo of the element.\n`setCustomNativeDragPreview` adds the `container` `Element` to the `document.body` and will remove\nthe `container` `Element` after your `cleanup` function is called.\n\n`setCustomNativeDragPreview` has been designed to work with any view abstraction.\n\nNote: you are welcome to use the\n[`onGenerateDragPreview | nativeSetDragImage`](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/setDragImage)\nAPI directly. However, we recommend you use `setCustomNativeDragPreview` as it covers over a number\nof gotchas.\n\n#### Usage example: `react` portals\n\nThis technique requires your component to be re-rendered, but maintains the current `react`\n`context`\n\n```tsx\ntype State =\n\t| {\n\t\t\ttype: 'idle';\n\t  }\n\t| {\n\t\t\ttype: 'preview';\n\t\t\tcontainer: HTMLElement;\n\t  };\n\nfunction Item() {\n\tconst [state, setState] = useState<State>({ type: 'idle' });\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\n\tuseEffect(() => {\n\t\tinvariant(ref.current);\n\n\t\treturn draggable({\n\t\t\telement: ref.current,\n\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\t// Cause a `react` re-render to create your portal synchronously\n\t\t\t\t\t\tsetState({ type: 'preview', container });\n\t\t\t\t\t\t// In our cleanup function: cause a `react` re-render to create remove your portal\n\t\t\t\t\t\t// Note: you can also remove the portal in `onDragStart`,\n\t\t\t\t\t\t// which is when the cleanup function is called\n\t\t\t\t\t\treturn () => setState({ type: 'idle' });\n\t\t\t\t\t},\n\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\t}, []);\n\n\treturn (\n\t\t<>\n\t\t\t<div ref={ref}>Drag Me</div>\n\t\t\t{state.type === 'preview' ? ReactDOM.createPortal(<Preview />, state.container) : null}\n\t\t</>\n\t);\n}\n```\n\n#### Usage example: A new `react` application\n\nThis technique requires no re-rendering of your component, but does not maintain the current `react`\n`context`\n\n```tsx\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\n\ndraggable({\n\telement: myElement,\n\tonGenerateDragPreview: ({ nativeSetDragImage }) => {\n\t\tsetCustomNativeDragPreview({\n\t\t\trender({ container }) {\n\t\t\t\tReactDOM.render(<Preview item={item} />, container);\n\t\t\t\treturn function cleanup() {\n\t\t\t\t\tReactDOM.unmountComponentAtNode(container);\n\t\t\t\t};\n\t\t\t},\n\t\t\tnativeSetDragImage,\n\t\t});\n\t},\n});\n```\n\n#### Usage example: plain JavaScript\n\n```ts\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\n\ndraggable({\n\telement: myElement,\n\tonGenerateDragPreview: ({ nativeSetDragImage }) => {\n\t\tsetCustomNativeDragPreview({\n\t\t\trender({ container }) {\n\t\t\t\t// Create our preview element\n\t\t\t\tconst preview = document.createElement('div');\n\n\t\t\t\t// Populate and style the preview element however you like\n\t\t\t\tpreview.textContent = 'My Preview';\n\t\t\t\tObject.assign(preview.style, {\n\t\t\t\t\tpadding: '20px',\n\t\t\t\t\tbackgroundColor: 'lightpink',\n\t\t\t\t});\n\n\t\t\t\t// put the \"preview\" element into the container element\n\t\t\t\tcontainer.appendChild(preview);\n\t\t\t},\n\t\t\tnativeSetDragImage,\n\t\t});\n\t},\n});\n```\n\n#### Positioning the drag preview\n\nYou can control where the custom native drag preview is placed by using the `getOffset()` argument.\n\nYou can return an `{x: number, y: number}` object from `getOffset()` which will control where the\nnative drag preview is rendered relative to the users pointer. `{x: 0, y: 0}` represents having the\nusers pointer user the top left corner of the drag preview.\n\nFor clarity:\n\n> `const rect = container.getBoundingClientRect()`\n\n- `{x: 0, y: 0}` → top left of the `container` will be under the users pointer **(default)**\n- `{x: rect.width, y: 0}` top right of the `container` will be under the users pointer\n- `{x: rect.width, y: rect.height}` bottom right of the `container` will be under the users pointer\n- `{x: 0, y: rect.height}` bottom left of the `container` will be under the users pointer\n\n```ts\ntype GetOffsetFn = (args: { container: HTMLElement }) => {\n\tx: number;\n\ty: number;\n};\n```\n\nNotes:\n\n- `GetOffsetFn` needs to return `x` and `y` as numbers as that is what the platform requires\n- You cannot use negative values (not supported by browsers). If you want to push the drag preview\n  away from the users pointer, use `pointerOutsideOfPreview` (see below)\n- The max offset value for an axis is the `border-box`. Values greater than the `border-box` get\n  trimmed to be the `border-box` value\n- `getOffset` is called in the next\n  [`microtask`](https://developer.mozilla.org/en-US/docs/Web/API/HTML_DOM_API/Microtask_guide) after\n  `setCustomNativeDragPreview:render`. This helps ensure that the drag preview element has finished\n  rendering into the `container` before `getOffset` is called. Some frameworks like `react@18` won't\n  render the element to be used for the drag preview into the `container` until the next\n  `microtask`.\n\n`{x: rect.width + 1, y: rect.height + 1}` effectively becomes `{x: rect.width, y: rect.height}`.\n\n```tsx\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\n\ndraggable({\n\telement: myElement,\n\tonGenerateDragPreview: ({ nativeSetDragImage }) => {\n\t\tsetCustomNativeDragPreview({\n\t\t\t// place the (near) top middle of the `container` under the users pointer\n\t\t\tgetOffset: () => {\n\t\t\t\tconst rect = container.getBoundingClientRect();\n\t\t\t\treturn { x: rect.width / 2, y: 16 };\n\t\t\t},\n\t\t\trender({ container }) {\n\t\t\t\tReactDOM.render(<Preview item={item} />, container);\n\t\t\t\treturn function cleanup() {\n\t\t\t\t\tReactDOM.unmountComponentAtNode(container);\n\t\t\t\t};\n\t\t\t},\n\t\t\tnativeSetDragImage,\n\t\t});\n\t},\n});\n```\n\nWe have `getOffset()` helpers for `setCustomnativeDragPreview()`:\n\n1. `centerUnderPointer`: centers the custom native drag preview under the users cursor\n\n```ts\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\nimport { centerUnderPointer } from '@atlaskit/pragmatic-drag-and-drop/element/center-under-pointer';\n\ndraggable({\n\telement: myElement,\n\tonGenerateDragPreview: ({ nativeSetDragImage }) => {\n\t\tsetCustomNativeDragPreview({\n\t\t\tgetOffset: centerUnderPointer,\n\t\t\trender({ container }) {\n\t\t\t\t/* ... */\n\t\t\t},\n\t\t\tnativeSetDragImage,\n\t\t});\n\t},\n});\n```\n\n2. `pointerOutsideOfPreview`: a cross browser mechanism to push the drag preview in front of the\n   users pointer.\n\n```ts\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\nimport { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';\n\ndraggable({\n\telement: myElement,\n\tonGenerateDragPreview: ({ nativeSetDragImage }) => {\n\t\tsetCustomNativeDragPreview({\n\t\t\t// `x` and `y` can be any CSS value\n\t\t\tgetOffset: pointerOutsideOfPreview({\n\t\t\t\tx: '8px',\n\t\t\t\ty: 'calc(var(--grid) * 2)',\n\t\t\t}),\n\t\t\trender({ container }) {\n\t\t\t\t/* ... */\n\t\t\t},\n\t\t\tnativeSetDragImage,\n\t\t});\n\t},\n});\n```\n\nWhen in left to right (`ltr`) languages, the drag preview is pushed forward, to the right of the\nusers pointer. For right to left (`rtl`) languages, the drag preview is also pushed forward, and the\npreview will be on the _left_ hand side of the users pointer. The direction (based on the `dir`\nattribute) will be looked up on the `container` element; so you can control the `dir` by setting it\non the `body`; or on the `container` element itself.\n\n```ts\nonGenerateDragPreview({ nativeSetDragImage, source, location }) {\n\tsetCustomNativeDragPreview({\n\t\tnativeSetDragImage,\n\t\tgetOffset: pointerOutsideOfPreview({\n\t\t\tx: token('space.200'),\n\t\t\ty: token('space.100'),\n\t\t}),\n\t\trender({ container }) {\n\t\t\t// Forcing the direction for the container.\n\t\t\tcontainer.dir = 'ltr';\n\n\t\t\t// By default, the `dir` inherited on `container` (which is a child of `body`) will be used.\n\t\t},\n\t});\n},\n```\n\nIf you are using css variables inside of your `getOffset()` you need to be sure your css variables\nare available at the `<body>` element, as the `container` is temporarily mounted as a child of\n`<body>`.\n\nOn iOS, iPad and Android `pointerOutsideOfPreview` will center the drag preview under the users\npointer. Browsers on iOS, iPadOS and Android put the center of the drag preview under the users\npointer during the drag, even when we try to \"push\" the drag preview away from the pointer.\n\n3. `preserveOffsetOnSource`: applies the initial cursor offset to the custom native drag preview for\n   a seamless experience\n\n```ts\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\nimport { preserveOffsetOnSource } from '@atlaskit/pragmatic-drag-and-drop/element/preserve-offset-on-source';\n\ndraggable({\n\telement: myElement,\n\tonGenerateDragPreview: ({ nativeSetDragImage, location, source }) => {\n\t\tsetCustomNativeDragPreview({\n\t\t\tgetOffset: preserveOffsetOnSource({\n\t\t\t\telement: source.element,\n\t\t\t\tinput: location.current.input,\n\t\t\t}),\n\t\t\trender({ container }) {\n\t\t\t\t/* ... */\n\t\t\t},\n\t\t\tnativeSetDragImage,\n\t\t});\n\t},\n});\n```\n\nNotes:\n\n- This helper works best when the rendered preview has the same dimensions as the dragged element\n- On Android the center of the drag preview is always under the users pointer (platform limitation)\n- On iOS and iPadOS, the drag preview location will initially match the `source`, but during the\n  drag the native preview will perform an animated slide so that it is centered on the users\n  pointer. The centering of the drag preview during the drag on the users pointer is iOS and iPad\n  platform behaviour.\n\n#### Gotcha: CSS transforms\n\nWhen creating custom drag preview element with `setCustomNativeDragPreview`, there is mixed support\nfor applying CSS transforms to the drag preview element.\n\n|                   | Scale                  | Rotate                 | Translate (avoid)      |\n| ----------------- | ---------------------- | ---------------------- | ---------------------- |\n| Chrome (`114.0`)  | <CheckIcon />          | <CheckIcon />          | <CheckIcon />          |\n| Firefox (`115.0`) | <CheckIcon />          | <CheckIcon />          | <CheckIcon />          |\n| Safari (`16.5.2`) | <CrossIcon /> (broken) | <CrossIcon /> (broken) | <CrossIcon /> (broken) |\n\n<SectionMessage>\n\nAvoid using `translate` for positioning a drag preview (or pushing it away from the cursor). Please\nuse `setCustomNativeDragPreview > getOffset` for that (see above)\n\n</SectionMessage>\n\nYou can use CSS transforms as a _progressive enhancement_. For Chrome and Firefox you can use CSS\ntransforms, but for Safari you cannot. You will need do a browser check for Safari, and only add CSS\ntransforms to your preview element when the browser is not Safari.\n\n```tsx\nconst isSafari: boolean =\n\tnavigator.userAgent.includes('AppleWebKit') && !navigator.userAgent.includes('Chrome');\n\nconst transformStyles = css({\n\ttransform: 'scale(4deg)',\n});\n\nfunction Preview() {\n\treturn <div css={isSafari ? transformStyles : undefined}>Drag preview</div>;\n}\n```\n\n### Approach 2: Change the appearance of a `draggable`\n\n<SectionMessage>\n\nThis approach has the best performance characteristics, but is subject to a number of gotchas. For\nmost consumers we recommend using `setCustomNativeDragPreview`\n\n</SectionMessage>\n\nIf you do nothing, then the browser will use a picture of the `draggable` element as the drag\npreview. By leveraging event timings you can control the appearance of the drag preview that the\nbrowser generates:\n\n1. in `onGenerateDragPreview` make whatever visual changes you want to the `draggable` element and\n   those changes will be captured in the drag preview\n2. in `onDragStart`:\n\n   2a. revert changes of step 1. The user will never see the `draggable` element with the styles\n   applied in `onGenerateDragPreview` due to paint timings\n\n   2b. apply visual changes to the `draggable` element to make it clear to the user what element is\n   being dragged\n\n3. in `onDrop` remove any visual changes you applied to the `draggable` element during the drag\n\n> [More information about how this technique works 🧑‍🔬](https://twitter.com/alexandereardon/status/1510826920023248900)\n\nThere are a few constraints imposed by browsers that you need to follow if you want to use this\ntechnique:\n\n- Your `draggable` needs to be _completely_ visible and unobfiscated at the start of the drag. This\n  can involve insuring that your `draggable` is not cut off by scroll (see\n  `scrollJustEnoughIntoView`), and has no layers currently on top of the `draggable` (for example,\n  you might need to close some popups)\n- The users pointer still needs to be over the `draggable` after the changes you make to the\n  `draggable` element in `onGenerateDragPreview`. Generally this means that you should not be\n  changing the dimensions of the `draggable` element.\n- Avoid CSS `transform` on your `draggable`. In Safari, CSS `transform`s that impact a `draggable`\n  can mess up native drag previews.\n  - [Bug 1](https://bugs.webkit.org/show_bug.cgi?id=246734) when a `transform` impacts a `draggable`\n    _before_ a drag starts:\n  - [Bug 2](https://twitter.com/alexandereardon/status/1511148574943240194) when CSS `transform` is\n    applied to a `draggable` element in `onGenerateDragPreview`\n\n## Non-native custom drag previews\n\nIn some situations, you might want to completely disable the native drag preview and render your own\ndrag preview. The advantage of this technique is that you can update the drag preview during a drag.\nThe downsides of this approach is that it is not as fast, and you cannot drag the non-native drag\npreview outside of a browser window.\n\nTo use this technique:\n\n1. disable the native drag preview\n\n```ts\nimport { disableNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview';\n\ndraggable({\n\telement: myElement,\n\tonGenerateDragPreview({ nativeSetDragPreview }) {\n\t\tdisableNativeDragPreview({ nativeSetDragPreview });\n\t},\n});\n```\n\n> This technique renders a `1x1` transparent image as the native drag preview. There are a few\n> alternative techniques for hiding the drag preview, but this technique yielded the best results\n> across many browsers and devices.\n\n2. render your own element in `onDragStart` (ideally in a portal), and under the user's pointer (you\n   can use `location.initial.input` to get the users initial position)\n3. move the new element around in response to `onDrag` events (use `location.current.input` to get\n   the users current pointer position)\n4. remove the new element in `onDrop`\n\nIf you are doing this technique, you will likely want to use the\n[`preventUnhandled` utility](/components/pragmatic-drag-and-drop/core-package/utilities). Using that\naddon will prevent the strange situation where when the user does not drop on a drop target there is\na fairly large pause before the drop event. This is because the browser does a drop animation when\nthe user does not drop on a drop target; a \"return home\" animation. Because you have hidden the\nnative drag preview, the user won't see this return home drop animation, but will experience a\ndelay. Using the\n[`preventUnhandled` utility](/components/pragmatic-drag-and-drop/core-package/utilities) ensures\nthat the return home drop animation won't run\n\n## No drag preview\n\nFor some experiences you might not want any drag preview (for example, resizing). All you need to do\nis disable the native drag preview and you are good to go.\n\n```ts\nimport { disableNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview';\n\ndraggable({\n\telement: myElement,\n\tonGenerateDragPreview({ nativeSetDragPreview }) {\n\t\tdisableNativeDragPreview({ nativeSetDragPreview });\n\t},\n});\n```\n\n## `scrollJustEnoughIntoView`\n\nA little utility to quickly scroll something into view before a drag preview is captured. This is\nhelpful if you are leveraging default drag previews (ie not using `setCustomNativeDragPreview`). If\nthe `draggable` element is not completely in view, then the drag preview can be cut off.\n\n```ts\nimport { scrollJustEnoughIntoView } from '@atlaskit/pragmatic-drag-and-drop/element/scroll-just-enough-into-view';\n\ndraggable({\n\telement: myElement,\n\tonGenerateDragPreview({ source }) {\n\t\tscrollJustEnoughIntoView({ element: source.element });\n\t},\n});\n```\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/00-adapters/00-element/other-utilities.mdx",
    "content": "---\norder: 3\ntitle: Other utilities\ndescription: Opitional utility functions for the element adapter\n---\n\n## `blockDraggingToIFrames`\n\nThis optional utility disables the ability for a user to drag into an `<iframe>` element.\n\nScenarios where this can be helpful:\n\n- When you are shifting the interface around in reponse to a drag operation and you don't want the\n  drag to enter into an `<iframe>` (for example - when resizing)\n- When you don't want the user to be able to drag into a `<iframe>` on the page (there could be lots\n  of reasons why!)\n\n```ts\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { blockDraggingToIFrames } from '@atlaskit/pragmatic-drag-and-drop/element/block-dragging-to-iframes';\n\nconst cleanup = combine(\n\tblockDraggingToIFrames({ element }),\n\tdraggable({\n\t\telement,\n\t}),\n);\n```\n\n- This function sets `pointer-events:none !important` to all `<iframe>` elements for the duration of\n  the drag.\n- Once an `<iframe>` is disabled, it will only be re-enabled once the current drag interaction is\n  completed (and not when the `CleanupFn` is called)\n- This function currently does not watch for new `<iframe>` elements being adding during a drag\n  operation.\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/00-adapters/00-element/unregistered-elements.mdx",
    "content": "---\norder: 2\ntitle: Unregistered elements\ndescription: How the element adapter works with draggable elements that are not registered\n---\n\nAny `HTMLElement` can become draggable in the browser by adding the attribute `draggable=\"true\"` to\nthat element. Additionally, `<a>` and `<img>` elements are draggable by default (as if they had\n`draggable=\"true\"` set on them).\n\nThe element adapter is only activated by explicitly registered elements (ie `draggable({element})`).\nThe element adapter will not be activated by other draggable elements on the page.\n\nIf you want the element adapter to be activated by any element (including `<a>` or `<img>`\nelements), then you need to register it as a `draggable()`\n\n```ts\nimport { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\ndraggable({\n\telement: myAnchor,\n});\n```\n\n## Disable default dragging of anchors and images\n\nIf you want to disable browsers default setting of `draggable=\"true\"` on `<a>` and `<img>` elements,\nyou can set `draggable=\"false\"`\n\n```html\n<a href=\"/home\" draggable=\"false\">Home</a>\n```\n\n## External data for anchors and images\n\nWhen dragging a `<a>` or `<img>` element, they will automatically attach some data for external\nconsumers. For example `<a>` will attach `\"text/uri-list\"` matching the dragging URL.\n\nRegistering anchors or images as a `draggable()` does not impact this default assignment of external\ndata\n\n```ts\nimport { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\n// \"text/plain\" and \"text/uri-list\" external data will automatically be attached\n// by the browser\ndraggable({\n\telement: myAnchor,\n});\n```\n\nYou can change the default external data values by using `getInitialDataForExternal()`\n\n```ts\nimport { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\ndraggable({\n\telement: myAnchor,\n\tgetInitialDataForExternal: () => ({\n\t\t// overiding the standard \"text/uri-list\" value\n\t\t'text/uri-list': someOtherUrl,\n\t\t// adding some new value\n\t\t'application/x.something-custom': myCustomData,\n\t}),\n});\n```\n\n## Drag previews for anchors and images\n\nBrowsers will automatically generate a drag preview when dragging `<a>` or `<img>` elements, even\nwhen those elements are registered as a `draggable()`.\n\nYou can control this drag preview in the same way you could any other element. See\n[drag previews](/components/pragmatic-drag-and-drop/core-package/adapters/element/drag-previews).\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/00-adapters/01-text-selection/about.mdx",
    "content": "---\norder: 0\ntitle: Text selection adapter\ndescription: Listen and respond to the dragging of text selections in a document\n---\n\nimport SectionMessage from '@atlaskit/section-message';\n\nThe text selection adapter allows you to listen and respond to text selections being dragged around\nin a `window`. Text selection is seperate from the\n[element adapter](/components/pragmatic-drag-and-drop/core-package/adapters/element) as text\nselections are not based on elements, but rather, whatever text the user has wanted to select.\n\nThe text selection adapter consists of the following pieces:\n\n- `dropTargetForTextSelection`: marking an element as a valid\n  [drop target](/components/pragmatic-drag-and-drop/core-package/drop-targets) for text selection\n  drag operations\n- `monitorForTextSelection`: create a\n  [monitor](/components/pragmatic-drag-and-drop/core-package/monitors) to listen to text selection\n  drag operations anywhere\n- `type`s: all types for this adapter\n\n<SectionMessage>\n\nIt is likely that some\n[top level utilities](/components/pragmatic-drag-and-drop/core-package/utilities) will be helpful\nfor your experience as well\n\n</SectionMessage>\n\n## Drop targets for text selection\n\nA [drop target](/components/pragmatic-drag-and-drop/core-package/drop-targets) for text selection\ndrag operations.\n\nThe default `dropEffect` for this type of drop target is `\"copy\"` as generally you will be copying\ndragged text. However, if that is not the case for your drop target, then please update it's drop\neffect through `getDropEffect()`.\n\n```ts\nimport { dropTargetForTextSelection } from '@atlaskit/pragmatic-drag-and-drop/text-selection/adapter';\n\nconst cleanup = dropTargetForTextSelection({\n  element: myElement,\n  onDragStart: () => console.log('text started dragging in me');\n});\n```\n\n## Monitors for text selection\n\nA [monitor](/components/pragmatic-drag-and-drop/core-package/monitors) for text selection drag\noperations.\n\n```ts\nimport { monitorForTextSelection } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nconst cleanup = monitorForTextSelection({\n  onDragStart: () => console.log('Dragging an element');\n});\n```\n\n## Types\n\nGenerally you won't need to explicitly use our provided types, but we expose a number of TypeScript\ntypes if you would like to use them.\n\nAll [events](/components/pragmatic-drag-and-drop/core-package/events) on drop targets and monitors\nare given the following base payload:\n\n```ts\ntype TextSelectionEventBasePayload = {\n\tlocation: DragLocationHistory;\n\tsource: TextSelectionDragPayload;\n};\n\ntype TextSelectionDragPayload = {\n\t/**\n\t * The `Text` node that is the user started the drag from.\n\t * Note: the `Text` node does not include all text being dragged.\n\t * Use the `plain` or `html` properties to get the full selection\n\t */\n\ttarget: Text;\n\t/** The plain text of the selection */\n\tplain: string;\n\t/** the HTML of the selection */\n\tHTML: string;\n};\n```\n\nFor all the arguments for all events, you can use our event map type:\n\n```ts\ntype TextSelectionEventPayloadMap = {\n\tonDragStart: TextSelectionEventBasePayload;\n\t// .. the rest of the events\n};\n```\n\nDrop targets are given a little bit more information in each event:\n\n```ts\ntype TextSelectionDropTargetEventBasePayload = TextSelectionEventBasePayload & {\n\t/**\n\t * A convenance pointer to this drop targets values\n\t */\n\tself: DropTargetRecord;\n};\n```\n\nFor all arguments for all events on drop targets, you can use our event map type:\n\n```ts\ntype TextSelectionDropTargetEventPayloadMap = {\n\tonDragStart: TextSelectionDropTargetEventBasePayload;\n\t// .. the rest of the events\n};\n```\n\nDrop target feedback functions (`canDrop`, `getData`, `getDropEffect`, `getIsSticky`) are given the\nfollowing:\n\n```ts\ntype TextSelectionDropTargetGetFeedbackArgs = {\n\t/**\n\t * The users _current_ input\n\t */\n\tinput: Input;\n\t/**\n\t * The data associated with the entity being dragged\n\t */\n\tsource: TextSelectionDragPayload;\n\t/**\n\t * This drop target's element\n\t */\n\telement: Element;\n};\n```\n\nThe monitor feedback function (`canMonitor`), is given the following:\n\n```ts\ntype TextSelectionMonitorGetFeedbackArgs = {\n\t/**\n\t * The users `initial` drag location\n\t */\n\tinitial: DragLocation;\n\t/**\n\t * The data associated with the entity being dragged\n\t */\n\tsource: TextSelectionDragPayload;\n};\n```\n\nYou can get these type from the text selection adapter import:\n\n```ts\nimport type {\n  // Payload for the text selection being dragged\n  TextSelectionDragPayload\n  // Base events\n  TextSelectionEventBasePayload\n  TextSelectionEventPayloadMap,\n  // Drop target events\n  TextSelectionDropTargetEventBasePayload,\n  TextSelectionDropTargetEventPayloadMap,\n  // Feedback types\n  TextSelectionDropTargetGetFeedbackArgs,\n  TextSelectionMonitorGetFeedbackArgs,\n} from '@atlaskit/pragmatic-drag-and-drop/text-selection/adapter';\n```\n\nThere are also some types (eg `DropTargetLocation`) that can be used for all adapters which can be\nfound on our [top level utilities page](/components/pragmatic-drag-and-drop/core-package/utilities)\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/00-adapters/02-external/HTML.mdx",
    "content": "---\norder: 3\ntitle: HTML\ndescription: Helpers to make working with native HTML data easier\n---\n\n## `containsHTML`\n\nUseful to know whether text data (`\"text/html\"`) is being dragged. Keep in mind that multiple pieces\nof native data can be dragged at once.\n\n```ts\nimport { containsHTML } from '@atlaskit/pragmatic-drag-and-drop/external/html';\n\ndropTargetForExternal({\n\telement: myElement,\n\tcanDrop: containsHTML,\n});\n\nmonitorForExternal({\n\tcanMonitor: containsHTML,\n});\n```\n\n## `getHTML`\n\nA helper to extract text data (`\"text/html\"`) from drop data. Get text will return `null` when there\nis no html data.\n\n```ts\nimport { getHTML } from '@atlaskit/pragmatic-drag-and-drop/external/html';\n\ndropTargetForExternal({\n\telement: myElement,\n\tonDrop({ source }) {\n\t\tconst html: string | null = getHTML({ source });\n\t},\n});\n\nmonitorForExternal({\n\tonDrop({ source }) {\n\t\tconst html: string | null = getHTML({ source });\n\t},\n});\n```\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/00-adapters/02-external/URLs.mdx",
    "content": "---\norder: 2\ntitle: URLs\ndescription: Helpers to make working with native URL data easier\n---\n\n## `containsURLs`\n\nUseful to know whether URLs (`\"text/uri-list\"`) is being dragged.\n\nKeep in mind:\n\n- it is possible for multiple urls to be dragged at the same time\n- multiple pieces of data can be dragged at once\n\n```ts\nimport { containsURLs } from '@atlaskit/pragmatic-drag-and-drop/external/url';\n\ndropTargetForExternal({\n\telement: myElement,\n\tcanDrop: containsURLs,\n});\n\nmonitorForExternal({\n\tcanMonitor: containsURLs,\n});\n```\n\n## `getURLs`\n\nA helper to extract URL data (`\"text/uri-list\"`) from drop data. When there are no URLs, `getURLs()`\nwill return an empty array (`[]`).\n\n```ts\nimport { getURLs } from '@atlaskit/pragmatic-drag-and-drop/external/url';\n\ndropTargetForExternal({\n\telement: myElement,\n\tonDrop({ source }) {\n\t\tconst urls: string[] = getURLs({ source });\n\t},\n});\n\nmonitorForExternal({\n\tonDrop({ source }) {\n\t\tconst urls: string[] = getURLs({ source });\n\t},\n});\n```\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/00-adapters/02-external/about.mdx",
    "content": "---\norder: 0\ntitle: External adapter\ndescription: Respond and listen to drag operations that started outside the current window\n---\n\nimport SectionMessage from '@atlaskit/section-message';\n\nThe external adapter is used to listen and respond to:\n\n- drags that started from the users operating system (eg files)\n- drags that started from other `window`s (including from child `<iframe>`s)\n\nThe external adapter consists of the following pieces:\n\n- `dropTargetForExternal`: marking an element as a valid\n  [drop target](/components/pragmatic-drag-and-drop/core-package/drop-targets) for external entities\n- `monitorForExternal`: create a\n  [monitor](/components/pragmatic-drag-and-drop/core-package/monitors) to listen for an external\n  drag operation events anywhere\n- `type`s: all types for this adapter\n\nThere are utilities for making working with particular external data types easier:\n\n- [Files](/components/pragmatic-drag-and-drop/core-package/adapters/external/files)\n- [URLs](/components/pragmatic-drag-and-drop/core-package/adapters/external/URLs)\n- [Text](/components/pragmatic-drag-and-drop/core-package/adapters/external/text)\n- [HTML](/components/pragmatic-drag-and-drop/core-package/adapters/external/HTML)\n- [Custom media](/components/pragmatic-drag-and-drop/core-package/adapters/external/custom-media-types)\n\nThere are also some utilities for usage with any external data type:\n\n- [some](#filtering-by-native-data-types): combine predicates and return `true` if _any_ predicate\n  matches (eg `some(containsText, containsHTML)`)\n\n<SectionMessage>\n\nIt is likely that some\n[top level utilities](/components/pragmatic-drag-and-drop/core-package/utilities) will be helpful\nfor your experience as well\n\n</SectionMessage>\n\n## Drop target for external\n\nA [drop target](/components/pragmatic-drag-and-drop/core-package/drop-targets) for external data.\n\nThe default `dropEffect` for external drop targets is `\"copy\"`. This is because when you move data\nfrom outside of a `window` into the `window`, you are _generally_ making a _copy_ of the data. You\ncan override this default with `getDropEffect()`.\n\n```ts\nimport { dropTargetForExternal } from '@atlaskit/pragmatic-drag-and-drop/external/adapter';\n\nconst cleanup = dropTargetForExternal({\n  element: myElement,\n  onDragEnter: () => console.log('Some external data was dragged over me');\n});\n```\n\n## Monitor for external\n\nA [monitor](/components/pragmatic-drag-and-drop/core-package/monitors) for native drags.\n\n```ts\nimport { monitorForExternal } from '@atlaskit/pragmatic-drag-and-drop/external/adapter';\n\nconst cleanup = monitorForExternal({\n  onDragStart: () => console.log('An external drag has entered the window');\n});\n```\n\n## Filtering by native data types\n\nIf you only want your drop target or monitor to be active when particular types of data is being\ndragged (eg files), then you can provide a predicate function to `canDrop` and `canMonitor`\n\n```ts\nimport { dropTargetForExternal, monitorForExternal } from '@atlaskit/pragmatic-drag-and-drop/external/adapter';\nimport { containsFiles } from '@atlaskit/pragmatic-drag-and-drop/external/file';\n\ndropTargetForExternal({\n  element: myElement,\n  canDrop: containsFiles,\n  onDragEnter: () => console.log('A file is being dragged over me');\n});\n\nmonitorForExternal({\n  canMonitor: containsFiles,\n  onDragStart: () => console.log('A file is being dragged');\n});\n```\n\nIf you want a drop target or monitor to listen for multiple types of native drag data, you can use\n`some()`. `some()` will return true if any predicate function returns `true` (the same as\n`Array.prototype.some`).\n\n```ts\nimport { dropTargetForExternal, monitorForExternal } from '@atlaskit/pragmatic-drag-and-drop/external/adapter';\nimport { containsFiles } from '@atlaskit/pragmatic-drag-and-drop/external/file';\nimport { containsText } from '@atlaskit/pragmatic-drag-and-drop/external/text';\n\ndropTargetForExternal({\n  canMonitor: some(containsFiles, containsText),\n  onDragEnter: () => console.log('A file or text is being dragged over me');\n});\n\nmonitorForExternal({\n  canMonitor: some(containsFiles, containsText),\n  onDragStart: () => console.log('A file or text is being dragged');\n});\n```\n\nYou can also create your own predicate functions to facilitate your own bespoke checks.\n\n## Events\n\nThe external adapter removes some events from the\n[standard event flow](/components/pragmatic-drag-and-drop/core-package/events).\n\n- `onGenerateDragPreview` is removed from external _drop targets_ and _monitors_. For external\n  operations the drag preview has already been generated externally.\n- `onDragStart` is removed from external _drop targets_ as an external drag operation can _never\n  start_ from inside a drop target in the `window`\n\nIf your drop target element needs to know when a drag is starting (ie a user is dragging a file into\nthe browser), then you can use a monitor\n\n```ts\ndropTargetForExternal({\n\telement: el,\n\tonDragEnter: () => console.log('user is now over this drop target'),\n\tonDragLeave: () => console.log('user is no longer over this drop target'),\n\tonDrop: () => console.log('user dropped on this drop target (or a child drop target)'),\n});\nmonitorForExternal({\n\tonDragStart: () => console.log('file is entering the window'),\n\tonDrop: () => console.log('drag is finished'),\n});\n```\n\n## Cross domain dragging and iframes\n\nThe external adapter enables you to drag data from one `window`, other web `window`s, or native\napplications.\n\nUnfortunately, in `Chrome@122` and `Safari@14.3.1` it is not possible to drag something from a\nparent `window` to a child `<iframe>`, or from a child `<iframe>` to a parent `window` if they are\non _different_ domains.\n\nFor clarity, the following is permitted by all browsers:\n\n- dragging from one page to another browser tab on the same domain\n- dragging from one page to another browser tab on a different domain\n- dragging from one page native applications\n- dragging from one page to a child `<iframe>` on the same domain\n- dragging from a child `<iframe>` to a child `<iframe>` on the same domain\n- dragging from one page to an `<iframe>` (on any domain) on a different browser tab (on any domain)\n\nThe following is not permitted on `Chrome@122` and `Safari@14.3.1`:\n\n- dragging from one page to a child `<iframe>` on a _different_ domain\n- dragging from a child `<iframe>` to a parent page on a _different_ domain\n\n→\n[Open Chrome discussion about the behaviour](https://issues.chromium.org/issues/40077680#comment20)\n\n### Extracting data\n\nDue to the web platform drag and drop security model, you can know what \"types\" are being dragging\nduring a drag (eg `\"text/plain\"`), but you can only see what data is being dragged (exposed through\n`.items`) during a successful \"drop\" event (`onDrop()`).\n\n```ts\nimport {\n\tdropTargetForExternal,\n\tmonitorForExternal,\n} from '@atlaskit/pragmatic-drag-and-drop/external/adapter';\nimport { containsFiles, getFiles } from '@atlaskit/pragmatic-drag-and-drop/external/file';\nimport { containsText, getText } from '@atlaskit/pragmatic-drag-and-drop/external/text';\n\ndropTargetForExternal({\n\tcanDrop: some(containsFiles, containsText),\n\tonDrop({ source }) {\n\t\tconst files = getFiles({ source });\n\t\tconst text = getText({ source });\n\t},\n});\n\nmonitorForExternal({\n\tcanMonitor: some(containsFiles, containsText),\n\tonDrop({ source }) {\n\t\tconst files = getFiles({ source });\n\t\tconst text = getText({ source });\n\t},\n});\n```\n\nGenerally, you will only want to interact with `source` using one of our helpers (eg `getText()`).\n`.items` and `getStringData()` only return meaningful information during a successful \"drop\" event\n(`onDrop()`)\n\n`source.items` (`DataTransferItem[]`) will only be populated with data:\n\n1. in the `onDrop()` event, and\n2. when the user is dropping on a\n   [drop target](/components/pragmatic-drag-and-drop/core-package/drop-targets) (including when over\n   a drop target due to stickiness)\n\nOtherwise, `source.items` will be unpopulated (`[]`).\n\n## Types\n\nGenerally you won't need to explicitly use our provided types, but we expose a number of TypeScript\ntypes if you would like to use them.\n\nAll [events](/components/pragmatic-drag-and-drop/core-package/events) on drop targets and monitors\nare given the following base payload:\n\n````ts\ntype ExternalEventBasePayload = {\n\tlocation: DragLocationHistory;\n\tsource: ExternalDragPayload;\n};\n\nexport type ExternalDragPayload = {\n\t/**\n\t * The media types that are being dragged during a drag.\n\t *\n\t * @example\n\t *\n\t * console.log(source.types);\n\t * // → [\"text/plain\", \"text/html\"]\n\t */\n\ttypes: NativeMediaType[];\n\t/**\n\t * The entities that are being dragged.\n\t * Usually you will not be using these directly, but\n\t * our helper functions can leverage them to extract\n\t * particular kinds of data (eg files) that are being dragged\n\t */\n\titems: DataTransferItem[];\n\t/**\n\t * returns the data for a given media type.\n\t *\n\t * - `getStringData(mediaType)` will return `null` if there is no data for that media type\n\t * - `getStringData(mediaType)` will return the empty string (`\"\"`) if the empty string (`\"\"`)\n\t *      was explicitly set as the data for a media type.\n\t * - `getStringData(mediaType)` will return null if requesting files (ie `getStringData('Files')`).\n\t *      To access files, use `source.items`, or better still, `getFiles({source})`\n\t *\n\t * Generally we recommend folks use our helpers to read native data rather than `getStringData(mediaType)`\n\t *\n\t * @example\n\t *\n\t * ```ts\n\t * // Using getStringData()\n\t * const text: string | null = source.getStringData(\"text/plain\");\n\t *\n\t * // Using our text helper\n\t * const text: string | null = getText({source});\n\t * ```\n\t * */\n\tgetStringData: (mediaType: string) => string | null;\n};\n\ntype NativeMediaType = 'text/uri-list' | 'text/plain' | 'text/html' | 'Files' | string;\n````\n\nFor all the arguments for all events, you can use our event map type:\n\n```ts\ntype ExternalEventPayloadMap = {\n\tonDragStart: ExternalEventBasePayload;\n\t// .. the rest of the events\n};\n```\n\nDrop targets are given a little bit more information in each event:\n\n```ts\ntype ElementDropTargetEventBasePayload = ExternalEventBasePayload & {\n\t/**\n\t * A convenance pointer to this drop targets values\n\t */\n\tself: DropTargetRecord;\n};\n```\n\nFor all arguments for all events on drop targets, you can use our event map type:\n\n```ts\ntype ExternalDropTargetEventPayloadMap = {\n\tonDragStart: ElementDropTargetEventBasePayload;\n\t// .. the rest of the events\n};\n```\n\nDrop target feedback functions (`canDrop`, `getData`, `getDropEffect`, `getIsSticky`) are given the\nfollowing:\n\n```ts\ntype ExternalDropTargetGetFeedbackArgs = {\n\t/**\n\t * The users _current_ input\n\t */\n\tinput: Input;\n\t/**\n\t * The data associated with the entity being dragged\n\t */\n\tsource: ExternalDragPayload;\n\t/**\n\t * This drop target's element\n\t */\n\telement: Element;\n};\n```\n\nThe monitor feedback function (`canMonitor`), is given the following:\n\n```ts\ntype ExternalMonitorGetFeedbackArgs = {\n\t/**\n\t * The users `initial` drag location\n\t */\n\tinitial: DragLocation;\n\t/**\n\t * The data associated with the entity being dragged\n\t */\n\tsource: ExternalDragPayload;\n};\n```\n\nYou can get these type from the external adapter import:\n\n```ts\nimport type {\n  // The data that is being dragged\n  NativeMediaType,\n  ExternalDragPayload\n  // Base events\n  ExternalEventBasePayload\n  ExternalEventPayloadMap,\n  // Drop target events\n  ElementDropTargetEventBasePayload,\n  ExternalDropTargetEventPayloadMap,\n  // Feedback types\n  ExternalDropTargetGetFeedbackArgs,\n  ExternalMonitorGetFeedbackArgs,\n} from '@atlaskit/pragmatic-drag-and-drop/external/adapter';\n```\n\nThere are also some types (eg `DropTargetLocation`) that can be used for all adapters which can be\nfound on our [top level utilities page](/components/pragmatic-drag-and-drop/core-package/utilities)\n\n## Blocking unhandled external drags (`preventUnhandled`)\n\nThe default behaviour when dropping some external entities into a `window` (eg files) is for that\nentity to be opened in a new tab. Often, if you have drop targets for external entities on your\npage, you want drops outside of those drop targets to be ignored, and not to open a new tab. You an\nuse the optional\n[`preventUnhandled` utility](/components/pragmatic-drag-and-drop/core-package/utilities) to help\nwith that.\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/00-adapters/02-external/custom-media-types.mdx",
    "content": "---\norder: 5\ntitle: Custom media types\ndescription: Working with application specific data\n---\n\nimport SectionMessage from '@atlaskit/section-message';\n\nWhen attaching data to a native drag store (for usage in external `window`s and applications), you\nspecific a \"media type\" for a string value.\n\n```ts\n{\n  \"text/plain\": \"hello world\"\n}\n```\n\n<SectionMessage>\n\n\"Media types\" where previously known as \"MIME types\" (Multipurpose Internet Mail Extensions Type)\n\n</SectionMessage>\n\nWhen passing data between different applications, it's helpful to use common media types (eg\n`\"text/plain\"` and `\"text/uri-list\"`) as other applications will know what to do with these types of\nentities.\n\nSometimes you want to pass your own bespoke type of data to other applications, or to other\ninstances of your application. Passing your own type of data is a helpful signal that a particular\ntype of application entity is being dragged.\n\n```ts\n{\n  // fallback: a url to our trello card\n  \"text/uri-list\": card.url,\n\n  // helpful information: a trello card is being dragged\n  \"application/vnd.trello-card-id\": card.id\n}\n```\n\nIn the above example, if we see a `\"application/vnd.trello-card-id\"` dragging, then that is a strong\nhint that a trello card is being dragged. Whereas, as `\"text/uri-list\"` does not help us know what\nkind of entity the URL belongs to.\n\nThings to keep in mind:\n\n- During a drag, only the media types (`types`) of data is visible to you (platform limitation).\n  After a successful drop (`onDrop()`) you can read out data (by using `source.items` or\n  `source.getData(mediaType)`)\n- Custom media types will be visible to all external applications when a user is dragging over them,\n  and the data will be visible if the user drops on that application. So it's important not to\n  expose sensitive data.\n\n## Custom media type naming\n\nWhen making your own media type, there are some conventions:\n\n<SectionMessage>\n\nNote, these conventions don't appear to be enforced by browsers, but for clarity and wide\ncompatibility, it is worth picking the most accurate one.\n\n</SectionMessage>\n\n- **vendor tree** (prefix: `vnd.`) for publicly available apps (eg\n  `\"application/vnd.trello-card-id\"`)\n- **personal or vanity tree** (prefix: `prs.`) for non public apps or experimental types (eg\n  `\"image/prs.btif\"`)\n- **unregistered tree** (prefix `x.`) for use only in private environments (eg\n  `\"application/x.trello-card-id\"`)\n\n→ [More details about media type naming](https://en.wikipedia.org/wiki/Media_type)\n\n## Media type suffixs\n\nYou can add a suffix to your media type to add extra information about the type of data being\ndragged\n\n- `\"text/plain+json\"`: dragging json data (same as `\"application/json\"`)\n- `\"application/vnd.trello-card+json\"`: some json information about a trello card is being dragged\n\n→ [More details about suffixs](https://en.wikipedia.org/wiki/Media_type)\n\n## Attaching custom media\n\nYou can attach custom media for external consumers using a `draggable`\n\n```ts\nimport { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\ndraggable({\n\telement: myElement,\n\tgetInitialDataForExternal: () => ({\n\t\t'application/vnd.trello-card-id': card.id,\n\t}),\n});\n```\n\n## Consuming custom media\n\nYou can consume custom media attached from other `window`s or applications leveraging the external\nadapter.\n\n```ts\nimport { dropTargetForExternal } from '@atlaskit/pragmatic-drag-and-drop/external/adapter';\n\ndropTargetForExternal({\n\telement: myElement,\n\t// We are also only enabling dropping if a trello card is being dragged\n\tcanDrop: ({ source }) => source.types.includes('application/vnd.trello-card-id'),\n\tonDrop: ({ source }) => {\n\t\tconst cardId: string | null = source.getData('application/vnd.trello-card-id');\n\n\t\tif (cardId == null) {\n\t\t\treturn;\n\t\t}\n\t\t// do drop operation\n\t},\n});\n```\n\nNative applications will also have their own mechanisms for extracting data from externally sourced\ndrag operations.\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/00-adapters/02-external/files.mdx",
    "content": "---\norder: 4\ntitle: Files\ndescription: Helpers to make working with file data easier\n---\n\nimport FileExample from '../../../../examples/file';\n\n## Accessibility\n\nWhen handling file dropping, we recommend that you also add a native input for file uploads\n\n```tsx\n<input type=\"file\" />\n```\n\nThis will help enable folks leveraging assistive technologies to perform file uploads.\n\n<Example Component={FileExample} appearance=\"showcase-only\" />\n\n## `containsFiles`\n\nUseful to know whether file(s) are being dragged. Keep in mind that multiple pieces of native data\ncan be dragged at once.\n\n```ts\nimport { containsFiles } from '@atlaskit/pragmatic-drag-and-drop/external/file';\n\ndropTargetForExternal({\n\telement: myElement,\n\tcanDrop: containsFiles,\n});\n\nmonitorForExternal({\n\tcanMonitor: containsFiles,\n});\n```\n\n## `getFiles`\n\nA helper to extract files from drop data. An empty array (`[]`) will be returned if there were no\nfiles being dragged.\n\n```ts\nimport { getFiles } from '@atlaskit/pragmatic-drag-and-drop/external/file';\n\ndropTargetForExternal({\n\telement: myElement,\n\tonDrop({ source }) {\n\t\tconst files: File[] = getFiles({ source });\n\t},\n});\n\nmonitorForExternal({\n\tonDrop({ source }) {\n\t\tconst files: File[] = getFiles({ source });\n\t},\n});\n```\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/00-adapters/02-external/text.mdx",
    "content": "---\norder: 1\ntitle: Text\ndescription: Helpers to make working with native text data easier\n---\n\n## `containsText`\n\nUseful to know whether text data (`\"text/plain\"`) is being dragged. Keep in mind that multiple\npieces of native data can be dragged at once.\n\n```ts\nimport { containsText } from '@atlaskit/pragmatic-drag-and-drop/external/text';\n\ndropTargetForExternal({\n\telement: myElement,\n\tcanDrop: containsText,\n});\n\nmonitorForExternal({\n\tcanMonitor: containsText,\n});\n```\n\n## `getText`\n\nA helper to extract text data (`\"text/plain\"`) from drop data. Get text will return `null` when\nthere is no text data.\n\n```ts\nimport { getText } from '@atlaskit/pragmatic-drag-and-drop/external/text';\n\ndropTargetForExternal({\n\telement: myElement,\n\tonDrop({ source }) {\n\t\tconst text: string | null = getText({ source });\n\t},\n});\n\nmonitorForExternal({\n\tonDrop({ source }) {\n\t\tconst text: string | null = getText({ source });\n\t},\n});\n```\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/00-adapters/index.mdx",
    "content": "---\norder: 0\ntitle: Adapters\n---\n\nAn _adapter_ teaches Pragmatic drag and drop how to handle dragging a particular entity type:\n\n- [element adapter](/components/pragmatic-drag-and-drop/core-package/adapters/element) → handling\n  the dragging of draggable elements\n- [text selection adapter](/components/pragmatic-drag-and-drop/core-package/adapters/text-selection)\n  → handling the dragging of text selections\n- [external adapter](/components/pragmatic-drag-and-drop/core-package/adapters/external) → handling\n  drag operations that started outside of the current `window` (eg files and text from other\n  `window`s or applications)\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/03-drop-targets/index.mdx",
    "content": "---\norder: 0\ntitle: Drop targets\ndescription: Drop targets are elements that items can be dropped on.\n---\n\nimport SectionMessage from '@atlaskit/section-message';\nimport NestedDropTargetExample from '../../../examples/nested-drop-targets';\n\nDrop targets are elements that can be dropped upon by something that is dragging. There are\ndifferent drop targets for different types of draggable items, such as elements or files.\n\n## Basic usage\n\n```ts\n// drop targets are exposed through adapters\nimport { dropTargetForExternal } from '@atlaskit/pragmatic-drag-and-drop/external/adapter';\n\nconst cleanup = dropTargetForExternal({\n\telement: myElement,\n});\n```\n\n```ts\n// basic usage with react\nimport React, { useEffect, useRef } from 'react';\nimport { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nfunction DropTarget() {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\n\tuseEffect(() => {\n\t\tconst el = ref.current;\n\t\tif (!el) {\n\t\t\tthrow new Error('ref not set correctly');\n\t\t}\n\n\t\treturn dropTargetForElements({\n\t\t\telement: el,\n\t\t});\n\t}, []);\n\n\treturn <div ref={ref}>Drop elements on me!</div>;\n}\n```\n\n## Rules\n\n- Drop targets are scoped to a particular entity type. For example, `dropTargetForElements` is a\n  _drop target_ for elements, and `dropTargetForExternal` is a drop target for files.\n- A single `element` can be used as a drop target for multiple entity types.\n\n```ts\n// ✅ Using the same element as a drop target for elements and for files\nconst cleanup = combine(\n\tdropTargetForElements({\n\t\telement: myElement,\n\t}),\n\tdropTargetForExternal({\n\t\telement: myElement,\n\t}),\n);\n```\n\n- A single `element` cannot be used to create multiple drop targets for the same entity type (you\n  will get a warning in your `console` if you make a mistake).\n\n```ts\n// ❌ Using the same element for two drop targets of the same entity type is not allowed\nconst cleanup = combine(\n\tdropTargetForElements({\n\t\telement: myElement,\n\t}),\n\t// ⚠️ A warning will be logged if this is detected\n\tdropTargetForElements({\n\t\telement: myElement,\n\t}),\n);\n```\n\n- Drop targets can be nested.\n\n```ts\ndropTargetForElements({\n\telement: parentElement,\n});\ndropTargetForElements({\n\telement: childElement,\n});\n```\n\n<Example Component={NestedDropTargetExample} appearance=\"showcase-only\" />\n\n- During a drag operation:\n  - You can add new _drop targets_\n  - You can remove _drop targets_\n  - You can _remount_ a _drop targets_ (see\n    [reconciliation](/components/pragmatic-drag-and-drop/core-package/reconciliation))\n  - You can change the dimensions of any _drop target_\n\n## Drop target arguments\n\nHigh level:\n\n- `element` - the `Element` the drop target will be attached to\n- `getData()` - data to associate with the drop target\n- `canDrop()` - whether the drop target can be dropped on\n- `getDropEffect()` - control the cursor when over a drop target\n- `getIsSticky()` - whether the drop target will hold onto selection after no longer being dragged\n  over\n- [`onGenerateDragPreview`](/components/pragmatic-drag-and-drop/core-package/events)\n- [`onDragStart`](/components/pragmatic-drag-and-drop/core-package/events)\n- [`onDrag`](/components/pragmatic-drag-and-drop/core-package/events)\n- [`onDropTargetChange`](/components/pragmatic-drag-and-drop/core-package/events)\n- [`onDrop`](/components/pragmatic-drag-and-drop/core-package/events)\n\n### `element` (required)\n\n```ts\nelement: Element;\n```\n\nThe `Element` you want to attach the drop target to.\n\n### `getData`\n\n```ts\ngetData?: (args: GetFeedbackArgs) => Record<string, unknown>;\n```\n\n`getData()` is a function that returns data you want to attach to the drop target.\n\n`getData()` is called with `GetFeedbackArgs` (see below) which contains limited information about\nthe current drag operation. Try to make your `getData()` function _pure_ (same input results in the\nsame output)\n\n```ts\nconst cleanup = dropTargetForExternal({\n\telement: myElement,\n\tgetData: () => ({ id: 'Alex' }),\n});\n```\n\n`getData()` is called _repeatedly_ while the user is dragging over the drop target in order to power\naddons. If your `getData()` function is expensive, consider using the\n[`once` utility function](/components/pragmatic-drag-and-drop/core-package/utilities).\n\nIf you want to understand the _type_ of data attached to a drop target elsewhere in your\napplication, see our\n[typing data guide](/components/pragmatic-drag-and-drop/core-package/recipes/typing-data).\n\n### `canDrop`\n\n```ts\ncanDrop?: (args: GetFeedbackArgs) => boolean\n```\n\n`canDrop()` is used to conditionally block dropping on a drop target.\n\nReturning `false` from `canDrop()` will not block dropping on parent or child drop targets. All drop\ntargets that want to not allow dropping, need to return `false` from their `canDrop()` function.\n\nWhen looking for valid drop targets, a lookup starts from the deepest part of the DOM tree the user\nis currently over and searches upwards for valid targets. If a drop target blocks dragging\n(`canDrop()` returns `false`), then that drop target is ignored and the search upwards continues.\n\n`canDrop()` is called _repeatedly_ while a drop target is being dragged over to allow you to\ndynamically change your mind as to whether a drop target can be dropped on (including after it has\nalready been entered into). This could be helpful in a situation where you are waiting on some\npermission information from a backend service.\n\n```ts\n// I can never be dropped on!\ndropTargetForExternal({\n\telement: myElement,\n\tcanDrop: () => false,\n});\n\n// only allow 'cards' to be dropped on this drop target\ndropTargetForElements({\n\telement: myOtherElement,\n\tcanDrop: ({ source }: GetFeedbackArgs) => {\n\t\treturn source.data.type === 'card';\n\t},\n});\n```\n\n```ts\ntype GetFeedbackArgs = {\n\tinput: Input;\n\tsource: SourcePayload; // this payload type will be different for different adapters\n\telement: Element;\n};\n```\n\n### `getDropEffect`\n\n```ts\ngetDropEffect?: (args: GetFeedbackArgs) => DataTransfer['dropEffect']\n```\n\nThe `dropEffect` property will control the visual feedback (cursor) when dragging over it. As with\n`getData()`, `getDropEffect()` is repeatedly called throughout a drag operation. The default\n`dropEffect` is dependent on the adapter.\n\n```ts\ndropTargetForElements({\n\tgetDropEffect: () => 'link',\n});\n```\n\n`getDropEffect()` is called _repeatedly_ while a drop target is being dragged over to allow you\nchange your mind about which drop effect should be applied.\n\nWhen working with nested _drop targets_, the inner most drop targets `dropEffect` is the one that\nwill be applied; even if inner most drop target is using the default value (`\"move\"`).\n\n<SectionMessage>\n\nFor more information about controlling the users cursor while dragging, see\n[our cursor guide](/components/pragmatic-drag-and-drop/web-platform-design-constraints#cursors)\n\n</SectionMessage>\n\n### `getIsSticky`\n\n```ts\ngetIsSticky?: (args: GetFeedbackArgs) => boolean;\n```\n\nUsed to control whether a drop target is \"sticky\" or not.\n\nDrop targets are generally calculated based on where the user's pointer is currently located. In\nsome scenarios you might want to _hold on_ to a previous drop target (make it \"sticky\"), even when\nthe drop target is no longer being directly dragged over. This is useful if you want to maintain a\nselection while you are in _gaps_ between drop targets.\n\n`getIsSticky()` is called `repeatedly` while a drop target is no longer being dragged over to\ndetermine whether a drop target should be sticky.\n\n```ts\ndropTargetForElements({\n\telement: myElement,\n\tgetIsSticky: () => true,\n});\n\ndropTargetForElements({\n\telement: myElement,\n\tgetIsSticky: ({ source }: GetFeedbackArgs): boolean => {\n\t\t// only be sticky when dragging something with 'author: Alex'\n\t\treturn source.data.author === 'Alex';\n\t},\n});\n```\n\n#### The stickiness algorithm\n\nA _drop target_ that otherwise would not be dragged over any more due to changes in the users\npointer, will continue to be marked as \"dragged over\" when:\n\n- The drop target is still mounted in the DOM, AND\n- The drop target `canDrop()` returns `true` AND\n- The drop target `getIsSticky()` returns `true` AND\n- The parent of a _drop target_ is unchanged\n\n<SectionMessage appearance='discovery'>\n\n`[]` = Which _drop targets_ are currently dragged over\n\n`[A]` = over the `A` drop target\n\n</SectionMessage>\n\n##### Scenario: `[A(sticky)]` → `[]`\n\nResult: `[A]`\n\n##### Scenario: `[B(sticky), A(sticky)]` → `[]`\n\nResult: `[B, A]`\n\n##### Scenario: `[C, B(sticky), A(sticky)]` → `[]`\n\nResult: `[B, A]`\n\n##### Scenario: `[A(sticky)]` → `[B]`\n\nResult: `[B]`\n\n##### Scenario: `[B(sticky), A]` → `[A]`\n\nResult: `[B, A]`\n\n##### Scenario: `[B, A(sticky)]` → `[A]`\n\nResult: `[A]`\n\n##### Scenario: `[B(sticky), A]` → `[X]`\n\nResult: `[X]`\n\n##### Scenario: `[B(sticky), A]` → `[]`\n\nResult: `[]`\n\n##### Scenario: `[B(sticky), A(sticky)]` → `[X]`\n\nResult: `[X]`\n\n##### Scenario: `[A(sticky)]` → `[]` + `A:canDrop()` returns `false`\n\nResult: `[]`\n\n_Stickiness is not maintained when an old drop target states it cannot be dropped on_\n\n##### Scenario: `[A(sticky)]` → `[]` + `A:getIsSticky()` returns `false`\n\nResult: `[]`\n\n_Stickiness is not maintained when an old drop target states it it is no longer sticky_\n\n##### Scenario: `[A(sticky)]` → `[]` + `A` is unmounted\n\nResult: `[]`\n\n_Stickiness is not maintained when an old drop target is unmounted_\n\n##### Other notes:\n\n- All _drop targets_, regardless of stickiness, will no longer be \"dragged over\" when the users\n  pointer moves out of the `window`.\n- Drop targets that are no longer dragged over, but are still active due to stickiness, will _not_\n  have their data recomputed with `getData()`, or drop effect recomputed with `getDropEffect()`. The\n  last `data` and `dropEffect` created when a drop target is actively being dragged over is\n  preserved.\n\n## Nested drop targets\n\nWhen calculating what _drop targets_ are currently being dragged over, we look from the deepest\npossible _drop target_ upwards (bubble ordering). We will search up to the document root to find any\navailable drop targets. If a _drop target_ specifies that it cannot be dropped on (`canDrop()`\nreturns `false`), then it will be ignored and the search will continue upwards.\n\n##### Scenario `[] -> [B, A(blocked)]`\n\nResult: `[] -> [B]`\n\nFlow:\n\n- `B` visited and allows dropping. Drop targets: `[] -> [B]`\n- `A` visited and does not allow dropping\n\n##### Scenario `[] -> [C, B(blocked), A]`\n\nResult: `[] -> [C, A]`\n\n- Going from no drop targets `[]` to three drop targets: `[C, B, A]` (bubble ordered).\n- `C` and `A` allow dropping, but `B` has blocked dropping\n\nFlow:\n\n- `C` visited and allows dropping. Drop targets: `[] -> [C]`\n- `B` visited and does not allow dropping\n- `A` visited and allows dropping. Drop targets `[C] -> [C, A]`\n\n### Handling `onDrop()` for nested drop targets\n\nWhen you have nested _drop targets_ all of them will have their `onDrop()` callbacks executed on a\ndrop. Let's say we have two _drop targets_ `parent` and `child`. You might want to perform one\noperation if `parent` is dropped on, and a different operation if `child` is dropped on. In\n`parent`s `onDrop()` how do you tell if `child` was dropped on?\n\nWe can leverage the fact that `location.current.dropTargets` is always bubbled ordered, so inner\ndrop targets come before outer ones\n\n```ts\ndropTargetForElements({\n\telement: parent,\n\tonDrop({ location, self }) {\n\t\t// we know that if 'self' is in the first position, then no inner drop target was dropped on\n\t\tif (location.current.dropTargets[0]?.element === self.element) {\n\t\t\taction1();\n\t\t\treturn;\n\t\t}\n\t\t// at this point we know that an inner drop target was dropped on\n\t\taction2();\n\t},\n});\n```\n\n## Related\n\n- [Design guidelines](/components/pragmatic-drag-and-drop/design-guidelines)\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/04-monitors/index.mdx",
    "content": "---\ntitle: Monitors\ndescription: Monitors can listen to all events for a draggable entity, such as an element or file.\n---\n\nMonitors are a way of listening for drag and drop operation events anywhere.\n\n## Basic usage\n\n```ts\n// monitors are exposed through adapters\nimport { monitorForExternal } from '@atlaskit/pragmatic-drag-and-drop/external/adapter';\n\n// listen for all drag events for files\nconst cleanup = monitorForExternal({\n\tonDragStart: () => console.log('I am called whenever any external enters this window'),\n});\n```\n\nA _monitor_ can be located anywhere and is not tied to any element.\n\n```tsx\n// basic usage with react\nimport React, { useEffect, useRef } from 'react';\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nfunction App() {\n\t// It is often convenient to tie monitors to components using effects\n\t// By doing this you can ensure you monitors are cleaned up\n\t// when a component is no longer being used.\n\tuseEffect(() => {\n\t\treturn monitorForElements({\n\t\t\tonDragStart: () => console.log('I am called whenever any element drag starts'),\n\t\t});\n\t}, []);\n\n\treturn <div>{/*...*/}</div>;\n}\n```\n\n## Conditional monitoring\n\nA _monitor_ can be conditionally activated for a drag operation by using the `canMonitor()`\nfunction.\n\n- `canMonitor?: (args: MonitorGetFeedbackArgs<DragType>) => boolean`\n\n```ts\ntype MonitorGetFeedbackArgs = {\n\t/**\n\t * The users initial drag location\n\t */\n\tinitial: DragLocation;\n\t/**\n\t * The data associated with the entity being dragged\n\t */\n\tsource: DragType['payload'];\n};\n```\n\n```ts\nmonitorForElements({\n\tcanMonitor: ({ source }) => source.data.type === 'card',\n\tonDragStart: () => console.log('I will only be activated when dragging a card!'),\n});\n```\n\n`canMonitor()` is only called once for a monitor during a drag operation as the drag is starting. If\na _monitor_ is added during an active drag, then `canMonitor()` will be called as it is created with\nthe _intial_ drag source value and initial drag location. All monitors are called with the same\n`MonitorGetFeedbackArgs` value during the same drag operation. We wanted to make this behvaiour\nclear as the `source` value can change for external drag types in the `\"onDrop\"` event (eg files).\n\nIf you want to do more complicated checks, you can do those inside of your _monitor_ event\nlisteners:\n\n```ts\nmonitorForElements({\n\t// filtering will opt the monitor into the whole drag operation\n\tcanMonitor: ({ source }) => source.data.type === 'card',\n\tonDrag: ({ location }) => {\n\t\t// Additional action filtering based on changes during the drag\n\t\tif (location.current.data.action === 'delete') {\n\t\t\tconsole.log('about to delete');\n\t\t}\n\t},\n});\n```\n\n## Event ordering\n\nAll events flow through the system in the same way:\n\n1. drag source (eg `draggable`) if relevant\n2. drop targets - inner most upwards (bubble ordering) `grandChild -> child -> parent`\n3. monitors (in the order that they were created)\n\n_monitors_ are called in the same order in which they are created. Over time it can be hard to\nreason about what this ordering is as a consumer as you might be creating / destroying monitors\nfrequently. So it is safe to expect that \"monitors are called last\", but you need to be careful if\nyou want to rely on any ordering relationships between _monitors_.\n\n```tsx\nfunction App() {\n\tuseEffect(() => {\n\t\tconst cleanup = monitorForElements({\n\t\t\tonDragStart: () => 'This monitor gets created on each render!',\n\t\t});\n\t\treturn cleanup;\n\t});\n\n\treturn null;\n}\n```\n\n[Learn more about event ordering](../events)\n\n## Adding monitors during an event\n\nA _monitor_ that is added during an event (eg `onDragStart`) will not be called for the current\nevent. This is to prevent the accidental creation of infinite loops. This behaviour matches native\n[`EventTargets`](https://developer.mozilla.org/en-US/docs/Web/API/EventTarget) where an event\nlistener cannot add another event listener during an active event to the same event target in the\nsame event phase.\n\n```ts\nconst monitor1 = monitorForElements({\n\tonGenerateDragPreview: () => {\n\t\tconst monitor2 = monitorForElements({\n\t\t\t// Setting up another monitor during `onGenerateDragPreview`\n\t\t\tonGenerateDragPreview: () => {\n\t\t\t\t// monitor2 will not be called for the _current_ `onGenerateDragPreview` event\n\t\t\t},\n\t\t\t// The monitor will be called for subsequent events\n\t\t\tonDragStart: () => {},\n\t\t});\n\t},\n});\n```\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/05-utilities/index.mdx",
    "content": "---\ntitle: Utilities\n---\n\nAll of the utilities on this page are optional. You can also substitute them for your own similiar\nutilities if you want to.\n\n## `combine`\n\n_draggables_, _drop targets_ and _monitors_ return cleanup functions to remove their behaviour.\n\n```ts\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\tmonitorForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\n// You don't need to use this type explicitly, but including this import so you\n// know where you can get the type if you want it.\nimport type { CleanupFn } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nconst cleanupDraggable: CleanupFn = draggable({ element: myElement });\nconst cleanupDropTarget: CleanupFn = dropTargetForElements({\n\telement: myElement,\n});\nconst cleanupMonitor: CleanupFn = monitorForElements({ element: myElement });\n\n// unbind all functionality:\ncleanupDraggable();\ncleanupDropTarget();\ncleanupMonitor();\n```\n\n`combine` is helpful to merge multiple cleanup functions into a single cleanup function.\n\n```ts\nconst cleanup: CleanupFn = combine(\n\tdraggable({ element: myElement }),\n\tdropTargetForElements({\n\t\telement: myElement,\n\t}),\n\tmonitorForElements({ element: myElement }),\n);\n\n// unbind all functionality\ncleanup();\n```\n\nUsing `combine()` is helpful when working with `react` effects:\n\n```ts\nuseEffect(() => {\n\tconst cleanup = combine(\n\t\tdraggable({ element: myElement }),\n\t\tdropTargetForElements({\n\t\t\telement: myElement,\n\t\t}),\n\t\tmonitorForElements({ element: myElement }),\n\t);\n\treturn cleanup;\n}, []);\n\n// or even simpler:\nuseEffect(() => {\n\treturn combine(\n\t\tdraggable({ element: myElement }),\n\t\tdropTargetForElements({\n\t\t\telement: myElement,\n\t\t}),\n\t\tmonitorForElements({ element: myElement }),\n\t);\n}, []);\n```\n\n## `once`\n\nA function that will only allow the provided function to be called once.\n\n```ts\nimport { once } from '@atlaskit/pragmatic-drag-and-drop/once';\n```\n\nThis is useful if your drop target `getData()` is expensive to calculate.\n\n```ts\ndropTargetForExternal({\n\tgetData: once(getExpensiveData),\n});\n```\n\n```ts\n// calculate your data outside of get data\nconst data = getExpensiveData();\ndropTargetForExternal({\n\tgetData: () => data,\n});\n```\n\n```ts\n// have expensive data along with updated addons\nconst getDataOnce = once(getExpensiveData);\ndropTargetForExternal({\n\tgetData: ({ input, element }) => {\n\t\tconst data = getDataOnce();\n\t\treturn attachClosestEdge(data, { input, element, allowedEdges: ['top'] });\n\t},\n});\n```\n\n## `reorder`\n\nA function that will reorder an array. `reorder` returns a new array with reordered items and does\nnot modify the original array. The items in the array are also not modified.\n\n```ts\nimport { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';\n\nconst reordered = reorder({\n\tlist: [A, B, C],\n\tstartIndex: 0,\n\tfinishIndex: 1,\n});\n\nconsole.log(reordered); // [B, A, C]\n```\n\n## `preventUnhandled`\n\nIn some situations, you want to explicitly allow \"drop\" operations to occur, even if no drop target\naccepts the drag. This is helpful for the following cases:\n\n- Your are disabling a native drag preview and you want to prevent the default \"cancel\" animation on\n  a cancelled drag\n- You want to always prevent the default behaviour when dropping an external entity (eg prevent a\n  file drop from opening a new page)\n\nYou can use `preventUnhandled` inside a monitor\n\n```ts\nimport { monitorForExternal } from '@atlaskit/pragmatic-drag-and-drop/external/adapter';\nimport { preventUnhandled } from '@atlaskit/pragmatic-drag-and-drop/prevent-unhandled';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\n\nmonitorForExternal({\n\tonDragStart: () => {\n\t\t// when any drag starts for files block unhandled drags\n\t\tpreventUnhandled.start();\n\t},\n});\n```\n\n`preventUnhandled.start()` only applies for the current drag operation. You need to call it again\nfor each drag operation you want to use it for. You can use `prevenUnhandled.stop()` to stop\nblocking events during a drag operation if you like.\n\n## `types`\n\nPragmatic drag and drop has a specific entry point just for shared TypeScript types. You don't need\nto use these types explicitly as you can leverage inference, or use `typeof` to pull out the types\nyou need (eg `type CleanupFn = ReturnType<typeof draggable>`).\n\nIn addition to these shared types, [adapters](../adapters) also expose adapter specific types.\n\n```ts\nexport type {\n\t// information about a drop target\n\tDropTargetRecord,\n\n\t// Used for coordinates\n\t// {x: number, y: number}\n\tPosition,\n\n\t// What the current user input is\n\tInput,\n\n\t// Information about the current state of a drag.\n\t// Includes `Input` and `DropTargetRecord[]`\n\tDragLocation,\n\n\t// The `initial`, `current`, and `previous` `DragLocations`\n\tDragLocationHistory,\n\n\t// The type of our cleanup functions\n\tCleanupFn,\n\n\t// These types are not needed for consumers.\n\t// They are mostly helpful for other packages\n\tAllDragTypes,\n\tMonitorArgs,\n\tBaseEventPayload,\n} from '@atlaskit/pragmatic-drag-and-drop/types';\n```\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/06-events/index.mdx",
    "content": "---\ntitle: Events\ndescription: Events allow you to respond to a drag and drop operation.\n---\n\nEvents fire based on specific user actions and the part of Pragmatic drag and drop involved in the\ninteraction (such as a `draggable` and drop target).\n\nTo listen for all events for a specific type of draggable item (element or file), you can use a\n[monitor](/components/pragmatic-drag-and-drop/core-package/monitors).\n\n## Available events\n\n- `onGenerateDragPreview` - Drag is about to start. Make changes you want to see in the drag\n  preview.\n- `onDragStart` - Something has started dragging. You can make visual changes and they _will not_ be\n  captured in the drag preview.\n- `onDropTargetChange` - The drop target hierarchy has changed in some way.\n- `onDrag` - (_throttled_) - High fidelity updates throughout a drag with the latest details about\n  the drag and user input.\n- `onDrop` - Drag operation completed.\n\n## Derived events on drop targets\n\n- `onDragEnter` (derived from `onDropTargetChange`) - a drop target is being entered into.\n- `onDragLeave` (derived from `onDropTargetChange`) - a drop target is being exited from.\n\nDerived drop target events are not their own events in the system; rather they are derived from\nother events. If a drop target wants to know about child drop target changes, then please use the\n`onDropTargetChange` event.\n\n## Event ordering\n\nAll events flow through the system in the same way:\n\n1. drag source (e.g. `draggable`) if relevant\n2. drop targets - inner most upwards (bubble ordering) `grandChild → child → parent`\n3. monitors (in the order that they were created)\n\n```ts\nconst unbind = combine(\n\tmonitorForElements({\n\t\tonDragStart: () => 'monitor:start',\n\t}),\n\tdraggable({\n\t\telement: myElement,\n\t\tonDragStart: () => 'draggable:start',\n\t}),\n\tdropTargetForElements({\n\t\telement: myElement,\n\t\tonDragStart: () => 'dropTarget:start',\n\t}),\n);\n\n// After `onDragStart`\n// console.log:\n// - 'draggable:start'\n// - 'dropTarget:start',\n// - 'monitor:start',\n```\n\n## Shared event payload\n\nAll events are provided the following base data. Particular event types add additional data.\nAdditionally, event listeners (e.g. `dropTargetForExternal({ onDragStart })`) can be given\nadditional localized data for convenience.\n\n```ts\nimport { Input, DragLocation, DragLocationHistory } from '@atlaskit/pragmatic-drag-and-drop/types';\n```\n\n```ts\nexport type Input = {\n\t// user input\n\taltKey: boolean;\n\tbutton: number;\n\tbuttons: number;\n\tctrlKey: boolean;\n\tmetaKey: boolean;\n\tshiftKey: boolean;\n\n\t// coordinates\n\tclientX: number;\n\tclientY: number;\n\tpageX: number;\n\tpageY: number;\n};\n\nexport type DragLocation = {\n\t/**\n\t * A users input at a point in time\n\t */\n\tinput: Input;\n\t/**\n\t * A _bubble_ ordered (innermost upwards) list of active drop targets\n\t *\n\t * @example\n\t * [grandChildRecord, childRecord, parentRecord]\n\t *\n\t */\n\tdropTargets: DropTargetRecord[];\n};\n\nexport type DragLocationHistory = {\n\t/**\n\t * Where the drag operation started\n\t */\n\tinitial: DragLocation;\n\t/**\n\t * Where the user currently is\n\t */\n\tcurrent: DragLocation;\n\t/**\n\t * Where the user was previously.\n\t * `previous` points to what `current` was in the last dispatched event\n\t *\n\t * `previous` is particularly useful for `onDropTargetChange`\n\t * (and the derived `onDragEnter` and `onDragLeave`)\n\t * as you can know what the delta of the change\n\t *\n\t * Exception: `onGenerateDragPreview` and `onDragStart` will have the\n\t * same `current` and `previous` values. This is done so that the data\n\t * received in `onDragStart` feels logical\n\t * (`location.previous` should be `[]` in `onDragStart`)\n\t */\n\tprevious: Pick<DragLocation, 'dropTargets'>;\n};\n\n// Each drag type (eg files) has their own base payload type\n// This allows different types of drags to have different source data\ntype BaseEventPayload = {\n\tlocation: DragLocationHistory;\n\t// source is different for different drag types\n\tsource: {\n\t\telement: Element;\n\t\tdragHandle: Element | null;\n\t\tdata: Record<string, unknown>;\n\t};\n};\n\nimport { ElementBaseEventPayload } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n```\n\n## Convenience data for `dropTarget`s (of all types)\n\nAll _drop targets_ add a `self` property (type: `DropTargetRecord`) that contains a convenience\nobject with information about the drop target that the event is firing on.\n\nYou could get all this information from the outer scope (or from `location.current.dropTargets`),\nbut having it available inline is convenient.\n\n```ts\ntype AllowedDropTargetDropEffect = Exclude<DataTransfer['dropEffect'], 'none'>;\n\ntype DropTargetRecord = {\n\telement: Element;\n\t// data provided using .getData()\n\tdata: Record<string | symbol, unknown>;\n\t// dropEffect provided by using getDropEffect()\n\tdropEffect: AllowedDropTargetDropEffect;\n};\n```\n\n```ts\ndropTargetForExternal({\n\telement: myElement,\n\tgetData: () => ({ name: 'Alex' }),\n\tgetDropEffect: () => 'move',\n\tonDragStart: ({ self }) => {\n\t\tconsole.log(self.element); // myElement\n\t\tconsole.log(self.data); // {name: 'Alex'}\n\t\tconsole.log(self.dropEffect); // 'move'\n\t},\n});\n```\n\n## External drag sources\n\nSometimes a user is dragging something that started outside the current browser window, for example\na local file.\n\nWhen a user first drags an external entity into the webpage, `@atlaskit/pragmatic-drag-and-drop`\nconsiders this the _start_ of the drag operation. The drag operation will _finish_ if the user drags\nthe external entity out of the browser.\n\nBy following this model, all entity types follow the same event lifecycle.\n\n## Event: `onGenerateDragPreview`\n\nYou can make changes to the DOM that you want to be reflected in your _drag preview_.\n\n```ts\nBaseEventPayload & {\n  // Allows people to use the native set drag image function if they want\n  // https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/setDragImage\n  // Although, we recommend using alternative techniques (see element source docs)\n  nativeSetDragImage: DataTransfer['setDragImage'] | null;\n  };\n```\n\nFlow\n\n- `onGenerateDragPreview` fires on the drag source (eg a `draggable`)\n- `onGenerateDragPreview` on the any parent drop targets of the drag sources in bubble order\n  (innermost upwards)\n- `onGenerateDragPreview` on _monitors_\n\n## Event: `onDragStart`\n\nA drag operation has started. You can make changes to the DOM and those changes won't be reflected\nin your _drag preview_.\n\nFlow\n\n- `onDragStart` fires on the drag source (eg a `draggable`)\n- `onDragStart` on the any parent drop targets of the drag sources in bubble order (innermost\n  upwards)\n- `onDragStart` on _monitors_\n\n## Event: `onDrag`\n\nA throttled update of where the the user is currently dragging. Useful if you want to create a high\nfidelity experience such as drawing. `@atlaskit/pragmatic-drag-and-drop` throttles native `drag`\nevents using `requestAnimationFrame` so `onDrag` events will fire around 60 times a second.\n\nFlow\n\n- `onDrag` fires on the drag source (eg a `draggable`)\n- `onDrag` on the _current_ parent drop targets of the drag sources in bubble order (innermost\n  outwards). The _current_ drop targets are the drop targets that the user is currently dragging\n  over. If you want to listen for _all_ `onDrag` events from the _initial_ drop targets, you can use\n  a _monitor_.\n- `onDrag` on _monitors_\n\n## Event: `onDropTargetChange`\n\nThe `onDropTargetChange` event fires when the `dropTarget` hierarchy changes during a drag.\n\nIn a single native drag event:\n\n- drop targets can be exited\n- drop targets can be entered into\n- the hierarchy of drop targets can change (such as by dynamically adding a new parent `dropTarget`\n  during a drag - although you are unlikely to run into this one!)\n\nFlow (high level)\n\n- `onDropTargetChange` fires on the drag source (eg a `draggable`)\n- `onDropTargetChange` fires on all _previous_ drop targets in bubble order (inside out)\n- `onDropTargetChange` fires on any **new** _current_ drop targets in bubble order\n\n> Scenario: [B, A] → [C, A]\n\n- `onDropTargetChange` fires on `draggable`\n- `onDropTargetChange` fires on `dropTarget(B)`\n- `onDropTargetChange` fires on `dropTarget(A)`\n- _now going to fire on newly added drop targets in bubble order_\n- `onDropTargetChange` fires on `dropTarget(C)`\n\n> Scenario: [B, A] → [D, C]\n\n- `onDropTargetChange` fires on `draggable`\n- `onDropTargetChange` fires on `dropTarget(B)`\n- `onDropTargetChange` fires on `dropTarget(A)`\n- _now going to fire on newly added drop targets in bubble order_\n- `onDropTargetChange` fires on `dropTarget(D)`\n- `onDropTargetChange` fires on `dropTarget(C)`\n- `onDropTargetChange` fires on all monitors\n\n### Derived events: `onDragEnter` and `onDragLeave`\n\nThe `onDropTargetChange` event allows you to know a lot of information about drop target hierarchy\nchanges. One of the most common use cases for a `dropTarget` is to know when it starts being dragged\nover, and when it is no longer being dragged over. To support this common use case, the\n`onDragEnter` and `onDragLeave` callbacks are executed on a `dropTarget` as required when the\n`dropTarget` receives a `onDropTargetChange` event.\n\nThe `onDragEnter` and `onDragLeave` events are not _strictly_ their own events, but travel along\nside the bubbling of `onDropTargetChange`.\n\n> Scenario: [B, A] → [C, A]\n\n- `onDropTargetChange` fires on `draggable`\n- `onDropTargetChange` fires on `dropTarget(B)`\n  - `onDragLeave` fires on `dropTarget(B)` → _derived event_\n- `onDropTargetChange` fires on `dropTarget(A)`\n- `onDropTargetChange` fires on `dropTarget(C)`\n  - `onDragEnter` fires on `dropTarget(C)` → _derived event_\n- `onDropTargetChange` fires on all monitors\n\n> Scenario: [B, A] → [D, C]\n\n- `onDropTargetChange` fires on `draggable`\n- `onDropTargetChange` fires on `dropTarget(B)`\n  - `onDragLeave` fires on `dropTarget(B)` → _derived event_\n- `onDropTargetChange` fires on `dropTarget(A)`\n  - `onDragLeave` fires on `dropTarget(A)` → _derived event_\n- _now going to fire on newly added drop targets in bubble order_\n- `onDropTargetChange` fires on `dropTarget(D)`\n  - `onDragEnter` fires on `dropTarget(D)` → _derived event_\n- `onDropTargetChange` fires on `dropTarget(C)`\n  - `onDragEnter` fires on `dropTarget(C)` → _derived event_\n- `onDropTargetChange` fires on monitors\n\n## Event: `onDrop`\n\nThe `onDrop` event occurs when a user has finished a drag and drop operation. The `onDrop` event\nwill fire when the drag operation finishes, regardless of how the drag operation finished (e.g. due\nto an explicit drop, the drag being canceled, recovering from an error and so on).\n\nUsing the information that the web platform provides, we cannot distinguish between dropping on no\ndrop targets, an explicit cancel, or dropping externally, so we do not publish any information about\n_how_ the drag ended, only that it ended. The `location.current` property will accurately contain\nthe final drop targets.\n\nFlow\n\n- `onDrop` fires on the drag source (eg a `draggable`)\n- `onDrop` fires on all `dropTarget`s currently being dragged over (all those in\n  `location.current.dropTargets`) in bubble event ordering (inner most `dropTarget` upwards)\n- `onDrop` fires on _monitors_\n\nFor drags that start within the current `window`\n([element adapter](/components/pragmatic-drag-and-drop/core-package/adapters/element),\n[text selection adapter](/components/pragmatic-drag-and-drop/core-package/adapters/text-selection)),\nthe drag finishes when the drag operation finish, which might be while the user is outside of the\ncurrent `window`. For drags that start outside of the current `windows`\n([external adapter](/components/pragmatic-drag-and-drop/core-package/adapters/external)), a drag\nfinishes when the user leaves the `window`.\n\n## Cancelling\n\nIf a user is currently over drop target(s) when a drag is cancelled, then the exiting current drop\ntargets(s) are cleared with an `onDropTargetChange` event. This matches how cancelling works with\nthe browser's drag and drop API.\n\nFlow\n\n- User drags over two drop targets: `[B, A]` (bubble ordered)\n- User cancels drag\n- Phase 1: `onDropTargetChange`\n  - `onDropTargetChange` fires on the source (eg a `draggable`)\n  - `onDropTargetChange` fires on `B`\n    - `onDragLeave` fires on `B` (derived event)\n  - `onDropTargetChange` fires on `A`\n    - `onDragLeave` fires on `A` (derived event)\n  - `onDropTargetChange` fires on _monitors_\n- Phase 2: `onDrop`\n  - `onDrop` fires on the source (eg a `draggable`)\n  - `onDrop` fires on _monitors_\n  - _note: `onDrop` does not fire on `B` or `A` as they are no longer being dragged over_\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/07-reconciliation/index.mdx",
    "content": "---\ntitle: Reconciliation\ndescription: How Pragmatic drag and drop reconciles pieces.\norder: 0\n---\n\n## Drop targets\n\nThe `key` for a _drop target_ is the element. At any one time, only a single _drop target_ for a\nparticular entity type (eg files) can be attached to the same element.\n\n```ts\n// ✅ Using the same element as a drop target for elements and for files\nconst cleanup = combine(\n\tdropTargetForElements({\n\t\telement: myElement,\n\t}),\n\tdropTargetForExternal({\n\t\telement: myElement,\n\t}),\n);\n```\n\n```ts\n// ❌ Using the same element for two drop targets of the same entity type is not allowed\nconst cleanup = combine(\n\tdropTargetForElements({\n\t\telement: myElement,\n\t}),\n\t// ⚠️ A warning will be logged if this is detected\n\tdropTargetForElements({\n\t\telement: myElement,\n\t}),\n);\n```\n\nDuring a drag operation, if a _drop target_ is removed and readded on the same `element`, then\n`@atlaskit/pragmatic-drag-and-drop` will treat the added _drop target_ as if it was the same _drop\ntarget_.\n\n```ts\nconst monitor = monitorForElements({\n\tonDragStart: () => console.log('monitor:start'),\n\tonDropTargetChange: () => console.log('monitor:change'),\n\tonDrop: () => console.log('monitor:drop'),\n});\nconst cleanup1 = dropTargetForElements({\n\telement: A,\n\tonDragStart: () => console.log('A1:start'),\n\tonDropTargetChange: () => console.log('A1:change'),\n\tonDrop: () => console.log('A1:drop'),\n});\n\n// a drag starts\n// console.log → 'A1:start', 'monitor:start'\n\n// drop target is removed during a drag\ncleanup1();\n// console.log not called (no change event is fired)\n\nconst cleanup2 = dropTargetForElements({\n\telement: A,\n\tonDragStart: () => console.log('A2:start'),\n\tonDropTargetChange: () => console.log('A2:change'),\n\tonDrop: () => console.log('A2:drop'),\n});\n\n// a dragover occurs\n// console.log → 'A2:drag', 'monitor:drag'\n// 👆 note: no 'change' event occured, A2 is treated as A1\n```\n\n## Draggables\n\nThe `key` for a `draggable` is the element. An element can only be used for a single `draggable`.\n\n```ts\n// ❌ Using the same element for two draggables\n  draggable({\n    element: myElement,\n  }),\n  // ⚠️ A warning will be logged if this is detected\n  draggable({\n    element: myElement,\n  }),\n);\n```\n\nDuring a drag operation, if the dragging `draggable` is removed and readded on the same `element`,\nthen `@atlaskit/pragmatic-drag-and-drop` will treat the added `draggable` as if it was the original\n`draggable`.\n\n```ts\nconst monitor = monitorForElements({\n\tonDragStart: () => console.log('monitor:start'),\n\tonDrop: () => console.log('monitor:drop'),\n});\nconst cleanup1 = draggable({\n\telement: A,\n\tonDragStart: () => console.log('A1:start'),\n\tonDrop: () => console.log('A1:drop'),\n});\n\n// a drag starts\n// console.log → 'A1:start', 'monitor:start'\n\n// drop target is removed during a drag\ncleanup1();\n// console.log not called (no change event is fired)\n\nconst cleanup2 = dropTargetForElements({\n\telement: A,\n\tonDragStart: () => console.log('A2:start'),\n\tonDrop: () => console.log('A2:drop'),\n});\n\n// a drop occurs\n// console.log → 'A2:drop', 'monitor:drop'\n// 👆 note: the drop event occured on 'A2' even though it was not the same `draggable()` as the original drag\n```\n\nRemounting a `draggable` common in `react` where you _might_ do something like this:\n\n```tsx\nfunction Card() {\n\tconst ref = useRef();\n\tconst [dragCount, setCount] = useState(0);\n\n\tuseEffect(() => {\n\t\treturn draggable({\n\t\t\telement,\n\t\t\tonDragStart: () => setCount(dragCount + 1),\n\t\t});\n\t\t// when dragCount changes our `draggable` will be remounted\n\t}, [dragCount]);\n\n\treturn <div ref={ref}>I have been dragged {dragCount} times</div>;\n}\n```\n\nThis is a contrived example, because you _could_ avoid the remounting in this case by doing this:\n\n```tsx\nfunction Card() {\n\tconst ref = useRef();\n\tconst [dragCount, setCount] = useState(0);\n\n\tuseEffect(() => {\n\t\treturn draggable({\n\t\t\telement,\n\t\t\tonDragStart: () => setCount((current) => current + 1),\n\t\t});\n\t\t// no longer need to remount when `dragCount` changes\n\t}, []);\n\n\treturn <div ref={ref}>I have been dragged {dragCount} times</div>;\n}\n```\n\n## Monitors\n\nEach call to create a _monitor_ will create a new monitor, even if the monitor definition is shared.\nThere is no `key` for _monitors_.\n\n```ts\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nconst args = {\n\tonGenerateDragPreview: () => console.log('monitor:preview'),\n};\n\n// these two monitors are sharing the same `args` reference\n// but they will both create an independent monitor\nconst cleanup1 = monitorForElements(args);\nconst cleanup2 = monitorForElements(args);\n\n// → A drag starts\n\n// console.log:\n// - 'monitor:preview'\n// - 'monitor:preview'\n\n// → A drag finishes\n\n// removing one monitor\ncleanup1();\n\n// → Another drag starts\n// console.log:\n// - 'monitor:preview'\n// 👆 one monitor is still active\n```\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/08-UI-frameworks/index.mdx",
    "content": "---\ntitle: Usage with UI Frameworks\ndescription: How to use @atlaskit/pragmatic-drag-and-drop with different UI libraries and frameworks\norder: 2\n---\n\nPragmatic drag and drop has been designed to be used with any UI library or framework. This allows\nus to:\n\n- support deferred loading without needing to lean into any library specific abstractions.\n- have drag and drop between pieces of UI written in different UI libraries.\n- get fantastic performance.\n\nHere are some tips to help you implement drag and drop when using specific frameworks (more coming\nsoon):\n\n- [react](/components/pragmatic-drag-and-drop/core-package/UI-frameworks/react)\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/08-UI-frameworks/react.mdx",
    "content": "## Attaching behavior\n\nWe advise that you attach drag and drop behaviour to elements using\n[the `useEffect` hook](https://reactjs.org/docs/hooks-effect.html).\n\n```tsx\n// card.tsx\nimport {draggable, dropTargetForElements} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nexport default function Card({ item }: { item: Item }) {\n  const ref = useRef<HTMLDivElement | null>(null);\n  const itemId = item.itemId;\n  const [state, setState] = useState<DraggableState>('idle');\n\n  useEffect(() => {\n    const cleanup = combine(\n      draggable({\n        element: ref.current,\n        getInitialData: () => ({ type: 'card', itemId: itemId }),\n      }),\n      dropTargetForElements({\n        element: ref.current,\n        canDrop: args => args.source.data.type === 'card',\n      }),\n    );\n    return cleanup;\n  }, [itemId]);\n\n  return (\n    <div ref={ref}>\n      item id: {item.itemId}</span>\n    </div>\n  );\n};\n```\n\nIt is fine if your `draggable` or `dropTargetForElements` effect is cleaned up and re-created, even\nduring a drag. For both of `draggable` and _drop targets_, the `element` is used as the _key_ for\nthe entity. For more information, see\n[reconciliation](/components/pragmatic-drag-and-drop/core-package/reconciliation);\n\n## Monitors\n\nUsing effects is also a nice way to manage the lifecyle of monitors:\n\n```tsx\nexport function App() {\n\n  useEffect(() => {\n    // this is nice as the monitor will be cleaned up when <App /> is unmounted\n    const cleanup = monitorForExternal({\n      onDragStart: () => console.log('A file is dragging!');\n    });\n\n    return cleanup;\n  }, []);\n\n  return <Example>;\n};\n```\n\n## Deferred loading\n\nReact lazy loading is based on components\n([more details](https://reactjs.org/docs/code-splitting.html)).\n\nYou can use this component pattern with Pragmatic drag and drop:\n\n```tsx\nimport { Suspense, lazy } from 'react';\n\n// importing our `card.tsx` file from above\nconst LazyCard = lazy(() => ('./card.tsx'));\n\nfunction App() {\n  return <Suspense fallback=\"loading...\"><LazyCard></Suspense>\n}\n```\n\nSince this framework is not tied to `react`, you can also attach drag and drop behavior at some\npoint after a component has already been rendered:\n\n```tsx\nfunction Card({ item }: { item: Item }) {\n  const ref = useRef<HTMLDivElement | null>(null);\n  const itemId = item.itemId;\n\n  useEffect(() => {\n    const controller = new AbortController();\n\n    // Look! We are attaching behaviour after the component has rendered!\n    // Note: Atlassian's, please use http://go/react-async rather than this promise based approach\n    (async () => {\n      const modules = await Promise.all([\n        await import('@atlaskit/pragmatic-drag-and-drop/element/adapter'),\n        await import('@atlaskit/pragmatic-drag-and-drop/combine'),\n      ]);\n\n      if (controller.signal.aborted) {\n        return;\n      }\n\n      const [{ draggable, dropTargetForElements }, { combine }] = modules;\n\n      if (!ref.current) {\n        return;\n      }\n\n      const cleanup = combine(\n        draggable({\n          element: ref.current,\n          getInitialData: () => ({ type: 'card', itemId: itemId }),\n        }),\n        dropTargetForElements({\n          element: ref.current,\n          canDrop: args => args.source.data.type === 'card',\n          getData: () => ({ type: 'card', itemId: itemId }),\n        }),\n      );\n\n      controller.signal.addEventListener('abort', cleanup, { once: true });\n    })();\n\n    return () => {\n      controller.abort();\n    };\n  }, [itemId]);\n\n  return (\n    <div ref={ref}>\n      item id: {item.itemId}</span>\n    </div>\n  );\n};\n```\n\nFor more details, see our\n[deferred loading guide](/components/pragmatic-drag-and-drop/core-package/recipes/deferred-loading).\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/09-recipes/00-isolating-experiences/index.mdx",
    "content": "---\ntitle: Isolating experiences\ndescription: How to selectively engage with what is dragging\norder: 2\n---\n\nimport SectionMessage from '@atlaskit/section-message';\n\nBy default, [drop targets](/components/pragmatic-drag-and-drop/core-package/drop-targets) will allow\nany `draggable` to be dropped on it, and\n[monitors](/components/pragmatic-drag-and-drop/core-package/monitors) will listen to _all_ drag\noperations.\n\nYou can limit what _types_ of `draggables` can be dropped on a drop target by using `canDrop()`, and\nwhat drag operations a monitor will listen to using `canMonitor()`.\n\nThis page explores how you can limit what draggables can be dropped on drop targets, and limit what\ndrag operations a monitor will listen to.\n\n## Entity matching\n\n<SectionMessage>\n\nSomething to keep in mind is that the drop target\n[`canDrop()`](/components/pragmatic-drag-and-drop/core-package/drop-targets) function is called\nrepeatedly throughout a drag operation, whereas the monitor\n[`canMonitor()`](/components/pragmatic-drag-and-drop/core-package/monitors) function is only called\nonce at the start of a drag (or when a monitor is mounted, if it is mounted during a drag).\n\n</SectionMessage>\n\n### Simple \"type\" checking\n\nA common pattern is to allow only allow dropping / listening when a draggable is of a particular\n`\"type\"`\n\n```ts\n// bind our draggable\ndraggable({\n\telement: myDraggableElement,\n\tgetInitialData: () => ({\n\t\t// the id of our card\n\t\tcardId,\n\t\t// the id the column belongs to\n\t\tcolumnId,\n\t\t// specifying this is a \"card\"\n\t\ttype: 'card',\n\t}),\n});\n\ndropTargetForElements({\n\telement: myDropTargetElement,\n\tgetData: () => ({ columnId }),\n\t// only allow dropping if a \"card\" is being dragged\n\tcanDrop: ({ source }) => source.data.type === 'card',\n});\n\nmonitorForElements({\n\t// only listen for drag operations of \"card\" draggables\n\tcanMonitor: ({ source }) => source.data.type === 'card',\n});\n```\n\n### More complex data checking\n\nIf you want to make it so that a `\"card\"` can only be dropped inside of its home list, you could add\na further check:\n\n```ts\n// only allow dropping of tasks that started inside this column\ndropTargetForElements({\n\telement: myDropTargetElement,\n\tgetData: () => ({ columnId }),\n\tcanDrop: ({ source }) => source.data.type === 'card' && source.data.columnId === columnId,\n});\n\n// only listen for drags of cards that started inside a column with columnId\nmonitorForElements({\n\tcanMonitor: ({ source, initial }) =>\n\t\tsource.data.type === 'card' && source.data.columnId === columnId,\n});\n```\n\n## Isolating experiences\n\nThere might be cases where you want to embed the same experience multiple times on the same page,\nand you want to ensure that these experiences do not impact each other. The above approaches would\nwork if each entity on the page has a unique id (eg a unique `columnId`), but sometimes the same\nlogical entity (eg `\"card\"`) might appear in multiple places.\n\nIn these cases, you can give an experience (eg a \"board\") a unique identitier and then check against\nthat identifier. A unique identifier could be anything from a DOM node to a `Symbol`\n\n### Using a parent child relationship\n\n```ts\ndropTargetForElements({\n\telement: myDropTargetElement,\n\tgetData: () => ({ columnId }),\n\tcanDrop: ({ source }) => {\n\t\t// our previous check\n\t\tif (source.data.type !== 'card' || source.data.columnId !== columnId) {\n\t\t\treturn false;\n\t\t}\n\t\t// our new additional check: only accept dropping of elements that are inside this list\n\t\treturn myDropTargetElement.contains(source.element);\n\t},\n});\n```\n\n### Using a shared parent\n\n```ts\ndropTargetForElements({\n\telement: myDropTargetElement,\n\tgetData: () => ({ columnId }),\n\tcanDrop: ({ source }) => {\n\t\t// our previous check\n\t\tif (source.data.type !== 'card' || source.data.columnId !== columnId) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// our new additional check: only accept dropping if the drop target\n\t\t// and the draggable are inside the same \"board\" element\n\t\tconst boardDropTargetIsIn = myDropTargetElement.closest('.board');\n\t\tconst boardDraggableIsIn = source.element.closest('.board');\n\n\t\treturn boardDropTargetIsIn === boardDraggableIsIn;\n\t},\n});\n```\n\n### Using a unique `react` context value\n\nThis is the same as \"Using a shared parent\", but we are using a unique `react` context value\n(`instanceId`), rather than DOM nodes, to establish a shared parent relationship.\n\n```tsx\nimport React, { createContext, useContext, useEffect, useRef, useState } from 'react';\n\nimport invariant from 'tiny-invariant';\n\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nconst BoardContext = createContext<Symbol | null>(null);\n\nfunction Card({ cardId, columnId }: { cardId: string; columnId: string }) {\n\tconst instanceId = useContext(BoardContext);\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\t\treturn draggable({\n\t\t\telement,\n\t\t\tgetInitialData: () => ({ cardId, type: 'card', columnId, instanceId }),\n\t\t});\n\t}, [cardId, columnId, instanceId]);\n\n\treturn <div ref={ref}>Card: {cardId}</div>;\n}\n\nfunction Column({ columnId }: { columnId: string }) {\n\tconst instanceId = useContext(BoardContext);\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\t\treturn dropTargetForElements({\n\t\t\telement: element,\n\t\t\tgetData: () => ({ columnId }),\n\t\t\tcanDrop: ({ source }) => {\n\t\t\t\t// our previous check\n\t\t\t\tif (source.data.type !== 'card' || source.data.columnId !== columnId) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t// our new check: only accept dropping within this experience\n\t\t\t\treturn source.data.instanceId === instanceId;\n\t\t\t},\n\t\t});\n\t}, [columnId, instanceId]);\n\n\treturn (\n\t\t<div ref={ref}>\n\t\t\t<Card cardId=\"hello\" columnId={columnId} />\n\t\t</div>\n\t);\n}\n\n// each <Board/> will be isolated\nexport function Board() {\n\tconst [instanceId] = useState(() => Symbol('instance-id'));\n\n\treturn (\n\t\t<BoardContext.Provider value={instanceId}>\n\t\t\t<Column columnId=\"first\" />\n\t\t</BoardContext.Provider>\n\t);\n}\n```\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/09-recipes/01-typing-data/index.mdx",
    "content": "---\norder: 1\ntitle: Typing \"data\"\ndescription: How to get better types for \"data\"\n---\n\nimport SectionMessage from '@atlaskit/section-message';\n\n`dropTargetForElements` data (`getData()`) and `draggable` data (`getInitialData()`) are typed as\n`Record<string | symbol, unknown>`. A loose `Record` type is intentionally used as\n`dropTargetForElements` and `draggable` entities are spread out throughout an interface, and there\nare no guarentees that particular pieces are present, and what their `data` shape will look like\n(this is a similiar problem to typing form and field data).\n\n```ts\ndropTargetForElements({\n\telement: myElement,\n\tonDrop({ source }) {\n\t\t// `cardId` is typed as as `unknown`\n\t\tconst cardId = source.data.cardId;\n\n\t\t// you need to check it's value before you can use it\n\t\tif (typeof cardId !== 'string') {\n\t\t\treturn;\n\t\t}\n\n\t\t// handle drop\n\t},\n});\n```\n\n## Leveraging helper functions\n\nA fantastic pattern that we recommend for _safe_ `data` types, is to leverage small helper\nfunctions.\n\n```ts\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport invariant from 'tiny-invariant';\n\n// We are using a `Symbol` to guarentee the whole object is a particular shape\nconst privateKey = Symbol('Card');\n\ntype Card = {\n\t[privateKey]: true;\n\tcardId: string;\n};\n\nfunction getCard(data: Omit<Card, typeof privateKey>) {\n\treturn {\n\t\t[privateKey]: true,\n\t\t...data,\n\t};\n}\n\nexport function isCard(data: Record<string | symbol, unknown>): data is Card {\n\treturn Boolean(data[privateKey]);\n}\n\nconst myDraggable = document.querySelector('#my-draggable');\ninvariant(myDraggable instanceof HTMLElement);\n\ndraggable({\n\telement: myDraggable,\n\tgetInitialData: () =>\n\t\tgetCard({\n\t\t\tcardId: '1',\n\t\t}),\n});\n\ndropTargetForElements({\n\telement: myDraggable,\n\t// only allow dropping if dragging a card\n\tcanDrop({ source }) {\n\t\treturn isCard(source.data);\n\t},\n\tonDrop({ source }) {\n\t\tconst data = source.data;\n\t\tif (!isCard(data)) {\n\t\t\treturn;\n\t\t}\n\t\t// data is now correctly typed to `Card`\n\t\tconsole.log(data);\n\t},\n});\n```\n\n## Leveraging zod\n\nYou can also leverage runtime type checking libraries like [zod](https://zod.dev/) to type your\n`data`.\n\n```ts\nimport { z } from 'zod';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport invariant from 'tiny-invariant';\n\nconst CardSchema = z.object({\n\tcardId: z.string(),\n});\n\ntype Card = z.infer<typeof CardSchema>;\n\nconst myDraggable = document.querySelector('#my-draggable');\ninvariant(myDraggable instanceof HTMLElement);\n\ndraggable({\n\telement: myDraggable,\n\tgetInitialData: (): Card => ({\n\t\tcardId: '1',\n\t}),\n});\n\ndropTargetForElements({\n\telement: myDraggable,\n\t// only allow dropping if dragging a card\n\tcanDrop({ source }) {\n\t\treturn CardSchema.safeParse(source.data).success;\n\t},\n\tonDrop({ source }) {\n\t\tconst result = CardSchema.safeParse(source.data);\n\t\tif (!result.success) {\n\t\t\treturn;\n\t\t}\n\t\t// result.data is now correctly typed to `Card`\n\t\tconsole.log(result.data);\n\t},\n});\n```\n\n## Why we don't leverage generics\n\nA common approach for solving similiar problems is to enable the ability to provide generics to\npieces to force it's `data` type.\n\n```ts\n// Note: this is not real API\ndropTargetForElements<{ cardId: string }>({\n\telement: myElement,\n\tonDrop({ source }) {\n\t\t// cardId would be typed as `string` by the Generic\n\t\tconst cardId = source.data.cardId;\n\t},\n});\n```\n\nThis approach has some drawbacks for our use case though:\n\n- Because entities (eg `draggables` and drop targets) can be in disconnected source files and or in\n  disconnected pieces of the interface, there are no guarentees that particular pieces will exist in\n  an interface, or that those pieces will provide the data shapes expected.\n- Some pieces in your system might not use Generics, or might use the wrong Generics, and so you\n  could get runtime errors.\n- Things get complicated if you want a single event handler to handle the dropping of many different\n  types of `data`.\n- To use the example above, `onDrop` would be called with _all_ drop events, so the generic would\n  not always be accurate.\n\n<details>\n    <summary>Exploring a built in guard (eg <tt>acceptData()</tt>)</summary>\n\n<br />\n\n<SectionMessage>\n\nThe intention of this section is to show that we have thought about adding a built in guard\nfunction, but that doing so doesn't work out that well.\n\n</SectionMessage>\n\n<br />\n\nConceptually we could introduce an `acceptData()` guard.\n\n```ts\ntype Card = { cardId: string; instanceId: symbol };\n\ndropTargetForElements<Card>({\n\telement: myElement,\n\t// Note: this is not real API.\n\t// Validate that `data` is the right type\n\tacceptData({ data }): data is Card {\n\t\t// We need to assert that `data` is a `Card`\n\t\treturn isCard(data);\n\t},\n\tcanDrop({ data }) {\n\t\t// let's assume that this is called after `acceptData` and\n\t\t// `data` is now typed. Now we can do our additional checks.\n\t\treturn data.instanceId === ourInstanceId;\n\t},\n\tonDrop({ source }) {\n\t\t// cardId could be typed as `string`\n\t\tconst cardId = source.data.cardId;\n\t},\n});\n```\n\n- We still need to do run time checking (it's now just in a seperate place)\n- `canDrop` checks are split up into different functions\n\n<br />\n\nIt seems to be cleaner to let consumers do their own runtime checking and not introduce an\nadditional `acceptData()` guard.\n\n```ts\n// Real API\ndropTargetForElements({\n\telement: myElement,\n\tcanDrop({ source }) {\n\t\treturn isCard(source.data) && source.data.instanceId === ourInstanceId;\n\t},\n\tonDrop({ source }) {\n\t\tif (!isCard(source.data)) {\n\t\t\treturn;\n\t\t}\n\t\t// source.data is now typed as `Card`.\n\t},\n});\n```\n\n</details>\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/09-recipes/02-virtualization/index.mdx",
    "content": "---\ntitle: Virtualization\ndescription: How to be successful using Pragmatic drag and drop with virtualized solutions.\n---\n\nVirtualization (or \"windowing\") is a technique where you only render what is visible to the user.\nVirtualization is a powerful way to improve performance for large data sets. Pragmatic drag and drop\nworks well with virtualization techniques. This page explains what you need to know about the\nunderlying web platform to be successful with virtualization.\n\n## Draggables\n\nIf you are using a `draggable` (from `@atlaskit/pragmatic-drag-and-drop/element/adapter`), it is\ncompletely okay for your original `draggable` element to be removed during a drag. This can happen\nif your `draggable` element scrolls out of view during a drag operation. Keep in mind that if your\n`draggable` is removed, it will stop getting\n[events](/components/pragmatic-drag-and-drop/core-package/events). So if you want to listen to\nevents on a `draggable` in a virtualized view, you will want to listen for events on entities that\nare not being removed during a drag (eg a seperate\n[monitor](/components/pragmatic-drag-and-drop/core-package/monitors) or a\n[drop target](/components/pragmatic-drag-and-drop/core-package/drop-targets)).\n\n## onDrop events\n\n`@atlaskit/pragmatic-drag-and-drop` looks for three seperate things to determine if a drag is\nfinished:\n\n1. `\"drop\"`: fires on the innermost valid drop target.\n2. `\"dragend\"`: fires on the `draggable` element that is being dragged.\n3. Other user events (eg `\"pointermove\"`): only fire after a drag operation is finished, if we see\n   these then we know a drag operation must have finished.\n\nDetermining when a drop occurs for virtual solutions can be difficult:\n\n- If your dragging `draggable` is removed during a drag operation then no `\"dragend\"` event will\n  fire as `\"dragend\"` fires on the `draggable` element.\n- If the user drops on a _drop target_ then we will get a `\"drop\"` event and we will be able to fire\n  `onDrop()` immediately.\n- If the user does not drop on a valid _drop target_ and the dragging `draggable` is removed, then\n  we have to rely on detecting other user input events to see if the drag operation is finished.\n  This is not ideal as it means the user needs to do a small amount of movement after releasing\n  their pointer before we can fire `onDrop`.\n\nTo get around this problem you want to make it easy for a user to always drop on a valid _drop\ntarget_ so we always get the `\"drop\"` event. To do this, you can make a sufficiently high element a\n_drop target_ (eg a virtual list container or the `body`).\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/09-recipes/03-deferred-loading/index.mdx",
    "content": "---\norder: 0\ntitle: Deferred loading\ndescription: Improve performing by delaying the loading of Pragmatic drag and drop.\n---\n\nIf you want to, you can defer the loading of Pragmatic drag and drop (and other packages) at a point\nafter initial page load using _dynamic imports_.\n\nDeferring the loading of drag and drop behavior has some advantages:\n\n- Faster initial page loads\n- The ability to load in drag and drop behavior when it is needed, rather than in the critical\n  bundle\n\nThere are also some drawbacks:\n\n- Additional complexity as you are no longer simply importing a module and using it\n- _Potential_ to miss an interaction: let's say a user starts trying to drag before\n  `@atlaskit/pragmatic-drag-and-drop` is loaded, then the user would not be able to perform a drag\n  operation. You can add some instrumentation to detect when these 'misses' occur. In our initial\n  observations we have found the 'readiness' gap to be extremely small.\n\nGiven `@atlaskit/pragmatic-drag-and-drop` is tiny, you will already get great performance by simply\nusing the library. Deferred loading unlocks another level of wins.\n\n## Dynamic imports\n\nModern bundles often support _dynamic imports_; which sounds scary, but in user land it is\nstraightforward:\n\n```ts\nimport('module-name').then((module) => {\n\t// use the module\n});\n\n// or using await\nconst module = await import('@atlaskit/pragmatic-drag-and-drop/element');\n```\n\nYou can use _dynamic imports_ to do things like deferring the import of a module until a `react`\n`useEffect`.\n\n```ts\nimport React, { useEffect } from 'react';\n\nfunction Card() {\n  const ref = useRef<HTMLDivElement | null>(null);\n\n  useEffect(() => {\n    const controller = new AbortController();\n\n    (async () => {\n      const { draggable } = await import('@atlaskit/pragmatic-drag-and-drop/element/adapter');\n      if (controller.signal.aborted) {\n        return;\n      }\n      const el = ref.current;\n      if(!el) {\n        return;\n      }\n\n      const cleanup = draggable({\n        element: el,\n      });\n      controller.signal.addEventListener('abort', cleanup, { once: true });\n    })();\n\n    return () => {\n      controller.abort();\n    };\n  }, []);\n\n  return <div ref={ref}>Drag me<div>\n});\n```\n\nFor Atlassian's we recommend using the new [@atlaskit/react-async](http://go/react-async).\n\nOther environment specific techniques:\n\n- [Next.js: dynamic imports](https://nextjs.org/docs/advanced-features/dynamic-import)\n- [Webpack: lazy loading](https://webpack.js.org/guides/lazy-loading/)\n- [Parcel: dynamic imports](https://parceljs.org/features/code-splitting/)\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/09-recipes/03-deferred-loading/react.mdx",
    "content": "---\norder: 1\ntitle: Deferred loading\ndescription: Improve performing by delaying the loading of Pragmatic drag and drop.\n---\n\nYou can use _dynamic imports_ to do things like deferring the import of a module until a React\n`useEffect`.\n\n## Basic usage\n\n```tsx\nimport React, { useEffect } from 'react';\nimport invariant from 'tiny-invariant';\n\nfunction Card() {\n  const ref = useRef<HTMLDivElement | null>(null);\n  const [state, setState] = useState();\n\n  useEffect(() => {\n    const controller = new AbortController();\n\n    (async () => {\n      // load in all the modules that you need\n      const modules = await Promise.all([\n        import('@atlaskit/pragmatic-drag-and-drop/element/adapter'),\n        import('@atlaskit/pragmatic-drag-and-drop/combine'),\n      ]);\n      if (controller.signal.aborted) {\n        return;\n      }\n      invariant(el);\n\n      const [{draggable, dropTargetForElements}, {combine}] = modules;\n\n      const cleanup = combine(\n        draggable({\n        element: el,\n        onDragStart: () => setState('dragging'),\n        onDrop: () => setState('idle'),\n      }),\n      dropTargetForElements({\n        element: el,\n        onDrop: () => console.log('dropped on')\n      }));\n\n      controller.signal.addEventListener('abort', cleanup, { once: true });\n    })();\n\n    return () => {\n      controller.abort();\n    };\n  }, []);\n\n  return <div ref={ref}>Drag me<div>\n});\n```\n\n## Maximise Deferred\n\nRather than importing all the modules you need directly, you can pull all your imports and logic out\ninto a seperate file in order to defer more code.\n\n```ts\n// attach.js\n// regular imports\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport invariant from 'tiny-invariant';\n\nexport function attach({ ref, setState }) {\n\t// all of this code can get deferred\n\tconst el = ref.current;\n\tinvariant(el);\n\treturn combine(\n\t\tdraggable({\n\t\t\telement: el,\n\t\t\tonDragStart: () => setState('dragging'),\n\t\t\tonDrop: () => setState('idle'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: el,\n\t\t\tonDrop: () => console.log('dropped on'),\n\t\t}),\n\t);\n}\n```\n\n```tsx\nimport React, { useEffect } from 'react';\n\nfunction Card() {\n  const ref = useRef<HTMLDivElement | null>(null);\n  const [state, setState] = useState();\n\n  useEffect(() => {\n    const controller = new AbortController();\n\n    (async () => {\n      // just loading in the single module that we need\n      const { attach } = import('./attach');\n      if (controller.signal.aborted) {\n        return;\n      }\n      const cleanup = attach({setState, ref});\n\n      controller.signal.addEventListener('abort', cleanup, { once: true });\n    })();\n\n    return () => {\n      controller.abort();\n    };\n  }, []);\n\n  return <div ref={ref}>Drag me<div>\n});\n```\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/09-recipes/index.mdx",
    "content": "Guides for achieving common outcomes\n\n- [Isolating experiences](./isolating-experiences) from one another\n- [Typing data](./typing-data) from `getData()` and `getInitialData()`\n- [Working with virtualized experiences](./virtualization)\n- [Deferred loading](./deferred-loading)\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/11-testing/about.mdx",
    "content": "---\norder: 0\ntitle: Testing\ndescription: How to test your drag and drop experiences\n---\n\nThis library has robust unit and browser test converage, so there is no need for consumers to test\nthat the library is working as it should.\n\nThat said, you'll likely want to add some testing to your experiences to ensure they are working\ncorrectly.\n\nWe have created some guides to help you with setting up tests for various environments:\n\n- [Jest and JSDOM](/components/pragmatic-drag-and-drop/core-package/testing/jest-and-jsdom)\n- [Playwright](/components/pragmatic-drag-and-drop/core-package/testing/playwright)\n- [Cypress](/components/pragmatic-drag-and-drop/core-package/testing/cypress)\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/11-testing/cypress.mdx",
    "content": "---\norder: 3\ntitle: Testing\ndescription: Guidance on how to test your drag and drop experiences\n---\n\nWith [`cypress`](https://www.cypress.io/), you need to ensure that when you trigger a drag event (eg\n`\"dragstart\"`), you need to add\n[`{force: true}`](https://docs.cypress.io/guides/core-concepts/interacting-with-elements#Forcing).\nThis will ensure that the drag events fire on the correct elements.\n\nYou will also need to ensure that `cypress` triggers `DragEvent`s correctly. By default, a\n`.trigger('dragstart')`, fires an `Event`, not a `DragEvent`. So you will need to set the\n`eventConstructor` to be `DragEvent`, and pass through a `DataTransfer` (which can be empty).\n\n```ts\nit('should allow drag and drop between columns', () => {\n\tconst options = {\n\t\tforce: true,\n\t\teventConstructor: 'DragEvent',\n\t\t// If you wanted to fake dragging particular data,\n\t\t// you can add it to this `DataTransfer` with `.setData()`\n\t\t// See: https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer\n\t\tdataTransfer: new DataTransfer(),\n\t};\n\n\tcy.visit('/scenario/atlaskit-drag-and-drop');\n\n\t// waiting for our board to be visible\n\tcy.get('[data-testid=\"item-A0\"]').should('be.visible');\n\n\t// asserting initial list sizes\n\tcy.get('[data-testid=\"column-A--card-list\"]')\n\t\t.find('[draggable=\"true\"]')\n\t\t.should('have.length', 16);\n\n\tcy.get('[data-testid=\"column-B--card-list\"]')\n\t\t.find('[draggable=\"true\"]')\n\t\t.should('have.length', 16);\n\n\t// Move A0 to column B\n\tcy.get('[data-testid=\"item-A0\"]').trigger('dragstart', options);\n\n\tcy.get('[data-testid=\"item-B0\"]').trigger('dragenter', options).trigger('drop', options);\n\n\t// asserting list sizes after drag and drop\n\tcy.get('[data-testid=\"column-A--card-list\"]')\n\t\t.find('[draggable=\"true\"]')\n\t\t.should('have.length', 15);\n\n\tcy.get('[data-testid=\"column-B--card-list\"]')\n\t\t.find('[draggable=\"true\"]')\n\t\t.should('have.length', 17);\n});\n```\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/11-testing/jest-and-jsdom.mdx",
    "content": "---\norder: 1\ntitle: Testing\ndescription: Guidance on how to test your drag and drop experiences\n---\n\nimport SectionMessage from '@atlaskit/section-message';\n\n`jsdom` does not implement [`DragEvent`](https://github.com/jsdom/jsdom/issues/2913) or `DOMRect`.\nWe have created a\n[`DragEvent` and `DOMRect` polyfills](/components/pragmatic-drag-and-drop/optional-packages/unit-testing)\nwhich implement `DragEvent` and `DOMRect` for jsdom.\n\nYou can force `@atlaskit/pragmatic-drag-and-drop` to dispatch events by firing native drag events\n\n| Event name    | Description                                    | Target (what element the event is dispatch on) |\n| ------------- | ---------------------------------------------- | ---------------------------------------------- |\n| `\"drag\"`      | A drag is occurring (_throttled_)              | `draggable` element                            |\n| `\"dragend\"`   | A drag is finished                             | `draggable` element                            |\n| `\"dragenter\"` | A drag is entering into an element             | The `Element` being entered                    |\n| `\"dragleave\"` | A drag is leaving into an element              | The `Element` being left                       |\n| `\"dragover\"`  | A drag is occuring over a valid _drop target_  | The _drop target_ Element                      |\n| `\"dragstart\"` | A drag is starting                             | `draggable` element                            |\n| `\"drop\"`      | A user successfully dropped on a _drop target_ | A _drop target_ `Element`                      |\n\nA few things to keep in mind:\n\n- How we use native events to publish our own events might change in the future, so ideally you\n  don't want to be writing too many tests that rely on how we use native events. Ideally you want to\n  be relying on a small amount of browser testing.\n- `onGenerateDragPreview` fires during `\"dragstart\"`\n- `onDragStart` fires in the animation frame after `\"dragstart\"`\n- Internally we do not\n- Any event (eg `onDrop`) will flush any pending `onDragStart` event\n- We don't use `\"drag\"` events due to a bug in firefox; we rely on `\"dragover\"`\n- We apply some additional throttling to `\"dragover\"` so we only fire it at most once per frame\n- We mostly ignore `\"dragleave\"` and `\"drag\"` events\n\n<SectionMessage appearance=\"information\">\n\n`jsdom` [does not support](https://github.com/jsdom/jsdom/issues/2913) the `DragEvent` interface. As\na consequence,\n[event properties](https://testing-library.com/docs/dom-testing-library/api-events/#fireeventeventname)\npassed as a second parameter of the `@testing-library/dom` `fireEvent` drag methods (e.g.\n`dragStart`, `dragOver`...) might be ignored during the test execution. Please use our `DragEvent`\npolyfill to avoid this issue.\n\n</SectionMessage>\n\n```ts\nimport { fireEvent } from '@testing-library/dom';\n\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\tmonitorForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { appendToBody, getElements } from '../../_util';\n\nafterEach(async () => {\n\t// cleanup any pending drags\n\tfireEvent.dragEnd(window);\n\n\t// Optional: unwind the \"honey pot fix\"\n\t// More details: https://www.youtube.com/watch?v=udE9qbFTeQg\n\tfireEvent.pointerMove(window);\n});\n\nit('should execute callbacks in response to native events', () => {\n\tconst [A] = getElements();\n\tconst ordered: string[] = [];\n\n\tconst cleanup = combine(\n\t\tappendToBody(A),\n\t\tdraggable({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('draggable:preview'),\n\t\t\tonDragStart: () => ordered.push('draggable:start'),\n\t\t\tonDrag: () => ordered.push('draggable:drag'),\n\t\t\tonDrop: () => ordered.push('draggable:drop'),\n\t\t\tonDropTargetChange: () => ordered.push('draggable:change'),\n\t\t}),\n\t\tdropTargetForElements({\n\t\t\telement: A,\n\t\t\tonGenerateDragPreview: () => ordered.push('dropTarget:preview'),\n\t\t\tonDragStart: () => ordered.push('dropTarget:start'),\n\t\t\tonDrag: () => ordered.push('dropTarget:drag'),\n\t\t\tonDrop: () => ordered.push('dropTarget:drop'),\n\t\t\tonDropTargetChange: () => ordered.push('dropTarget:change'),\n\t\t\tonDragEnter: () => ordered.push('dropTarget:enter'),\n\t\t\tonDragLeave: () => ordered.push('dropTarget:leave'),\n\t\t}),\n\t\tmonitorForElements({\n\t\t\tonGenerateDragPreview: () => ordered.push('monitor:preview'),\n\t\t\tonDragStart: () => ordered.push('monitor:start'),\n\t\t\tonDrag: () => ordered.push('monitor:drag'),\n\t\t\tonDrop: () => ordered.push('monitor:drop'),\n\t\t\tonDropTargetChange: () => ordered.push('monitor:change'),\n\t\t}),\n\t);\n\n\texpect(ordered).toEqual([]);\n\n\t// starting a lift, this will trigger the previews to be generated\n\tfireEvent.dragStart(A);\n\n\texpect(ordered).toEqual(['draggable:preview', 'dropTarget:preview', 'monitor:preview']);\n\tordered.length = 0;\n\n\t// ticking forward an animation frame will complete the lift\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['draggable:start', 'dropTarget:start', 'monitor:start']);\n\tordered.length = 0;\n\n\t// [A] -> []\n\tfireEvent.dragEnter(document.body);\n\texpect(ordered).toEqual([\n\t\t'draggable:change',\n\t\t'dropTarget:change',\n\t\t'dropTarget:leave',\n\t\t'monitor:change',\n\t]);\n\tordered.length = 0;\n\n\t// [] -> [A]\n\tfireEvent.dragEnter(A);\n\texpect(ordered).toEqual([\n\t\t'draggable:change',\n\t\t'dropTarget:change',\n\t\t'dropTarget:enter',\n\t\t'monitor:change',\n\t]);\n\tordered.length = 0;\n\n\t// [A] -> [A]\n\tfireEvent.dragOver(A, { clientX: 10 });\n\t// no updates yet (need to wait for the next animation frame)\n\texpect(ordered).toEqual([]);\n\n\t// @ts-expect-error\n\trequestAnimationFrame.step();\n\texpect(ordered).toEqual(['draggable:drag', 'dropTarget:drag', 'monitor:drag']);\n\tordered.length = 0;\n\n\t// drop\n\tfireEvent.drop(A);\n\texpect(ordered).toEqual(['draggable:drop', 'dropTarget:drop', 'monitor:drop']);\n\n\tcleanup();\n});\n```\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/11-testing/playwright.mdx",
    "content": "---\norder: 2\ntitle: Testing\ndescription: Guidance on how to test your drag and drop experiences\n---\n\nWith [`Playwright`](https://playwright.dev/), you can use the\n[`dragTo` method](https://playwright.dev/docs/input#drag-and-drop) to perform drop and drop\noperations.\n\n```ts\nimport { test, expect } from '@playwright/test';\n\ntest('should allow drag and drop between columns', async ({ page }) => {\n\tawait page.goto('https://localhost:9000/atlaskit-drag-and-drop');\n\n\t// waiting for our board to be visible\n\tawait expect(page.getByTestId('item-A0')).toBeVisible();\n\n\t// asserting initial list sizes\n\tawait expect(page.getByTestId('column-A--card-list').locator('[draggable=\"true\"]')).toHaveCount(\n\t\t16,\n\t);\n\n\tawait expect(page.getByTestId('column-B--card-list').locator('[draggable=\"true\"]')).toHaveCount(\n\t\t16,\n\t);\n\n\t// Move A0 to column B\n\tawait page.getByTestId('item-A0').dragTo(page.getByTestId('item-B0'));\n\n\t// asserting list sizes after drag and drop\n\tawait expect(page.getByTestId('column-A--card-list').locator('[draggable=\"true\"]')).toHaveCount(\n\t\t15,\n\t);\n\n\tawait expect(page.getByTestId('column-B--card-list').locator('[draggable=\"true\"]')).toHaveCount(\n\t\t17,\n\t);\n});\n```\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/11-testing/puppeteer.mdx",
    "content": "---\norder: 4\ntitle: Testing\ndescription: Guidance on how to test your drag and drop experiences\n---\n\nWhen using [`puppeteer`](https://pptr.dev/) you must call\n[`page.setDragInterception(true)`](https://pub.dev/documentation/puppeteer/latest/puppeteer/Page/setDragInterception.html)\nto successfully leverage drag events.\n\n```ts\nimport puppeteer, { Protocol } from 'puppeteer';\nimport invariant from 'tiny-invariant';\n\nit('should support dropping of many files at once', async () => {\n\tconst browser = await puppeteer.launch();\n\tconst page = await browser.newPage();\n\tawait page.goto('https://localhost:3000/my-awesome-example');\n\n\t// waiting for the drop target to be visible as a way to ensure the example\n\t// is completely loaded (preemptively avoiding flakiness)\n\tawait page.waitForSelector('[data-testid=\"drop-target\"]', {\n\t\tvisible: true,\n\t});\n\n\tconst body = await getElement('body');\n\tconst dropTarget = await getElement('[data-testid=\"drop-target\"]');\n\tinvariant(dropTarget, `drop target not found`);\n\n\t// Allowing capturing of drag events\n\t// https://pub.dev/documentation/puppeteer/latest/puppeteer/Page/setDragInterception.html\n\tawait page.setDragInterception(true);\n\tconst data: Protocol.Input.DragData = {\n\t\tdragOperationsMask: 1,\n\t\tfiles: ['./package.json', './tsconfig.json'],\n\t\titems: [],\n\t};\n\n\tawait body.dragEnter(data);\n\tawait dropTarget.dragEnter(data);\n\tawait dropTarget.drop(data);\n\n\t// just incase there are any delays in the processing of files\n\t// we will wait until the `dropped-files` element is visible\n\t// before continuing\n\t// (eg if the update is delayed by react)\n\tawait page.waitForSelector('[data-testid=\"dropped-files\"]', {\n\t\tvisible: true,\n\t});\n\n\tconst results = await getElement('[data-testid=\"dropped-files\"]');\n\tconst text = await results.evaluate((el) => el.textContent);\n\texpect(text?.includes('package.json')).toBe(true);\n\texpect(text?.includes('tsconfig.json')).toBe(true);\n});\n```\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/11-testing/webdriver.mdx",
    "content": "---\norder: 5\ntitle: Testing\ndescription: Guidance on how to test your drag and drop experiences\n---\n\nWe unsuccesfully tried for a while to get drag and drop tests working with\n[`webdriver.io`](https://webdriver.io/docs/api/element/dragAndDrop/). Getting these `webdriver.io`\ntests might work, but for now we have parked looking into this concern. If `webdriver.io` usage is\nimportant to you, please reach out and we can do some more exploration.\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/12-upgrade-guides/upgrade-guide-0.x-→-1.0.mdx",
    "content": "---\norder: 0\ntitle: Upgrade guide\n---\n\nFor `1.0` we have made a number of naming and path changes, but is otherwise a safe upgrade. We have\ntaken the opportunity with `1.0` to shift things around in response to how our outputs have\norganically grown.\n\nWe have created a codemod (an automated code change tool) which will safely upgrade most usages.\nPeople using the (old) _file adapter_ will need to perform some additional (minor) manual steps to\nmove to our new _external adapter_. The codemod will add the next steps as comments for _file\nadapter_ consumers in the files that need to be updated.\n\n## Step 0: A new adapter model\n\nThe big conceptual change for `1.0` is our new adapter setup. Previously, we had two adapters:\n\n1. element adapter\n2. file adapter\n\nThe original thinking was that there would be lots of adapters for different entity types (eg a\n\"text\" adapter). However, that thinking did not pan out well, so we have moved in a different\ndirection.\n\nThere are now three adapters:\n\n1. [element adapter](/components/pragmatic-drag-and-drop/core-package/adapters/element) → handling\n   the dragging of draggable elements\n2. [text selection adapter](/components/pragmatic-drag-and-drop/core-package/adapters/text-selection)\n   **(new)** → handling the dragging of text selections\n3. [external adapter](/components/pragmatic-drag-and-drop/core-package/adapters/external) **(new)**\n   → handling drag operations that started outside of the current `window` (eg files and text from\n   other `window`s or applications)\n\nThe _external adapter_ can be used to handle file dropping (as the old _file adapter_ did), as well\nas any other native data type (eg `\"text/plain\"`).\n\n## Step 1: react-indicator → react-drop-indicator\n\nWe have renamed our drop indicator package to improve naming consistency across our outputs.\n\n```diff\n- @atlaskit/pragmatic-drag-and-drop-react-indicator\n+ @atlaskit/pragmatic-drag-and-drop-react-drop-indicator\n```\n\nAfter running _step 1_ your application will be broken as your imports will not yet be updated in\nyour code. In _step 3_ your imports will be fixed.\n\n```bash\n# Using yarn\nyarn remove @atlaskit/pragmatic-drag-and-drop-react-indicator\nyarn add @atlaskit/pragmatic-drag-and-drop-react-drop-indicator\n```\n\n## Step 2: Upgrade to `1.x` packages\n\nYou will need to shift the following packages from `0.x` to `1.0` in your project:\n\n- @atlaskit/pragmatic-drag-and-drop\n- @atlaskit/pragmatic-drag-and-drop-hitbox\n- @atlaskit/pragmatic-drag-and-drop-live-region\n- @atlaskit/pragmatic-drag-and-drop-flourish\n- @atlaskit/pragmatic-drag-and-drop-react-accessibility\n- @atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration\n- @atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll\n\n```bash\n# Using yarn\nyarn upgrade @atlaskit/pragmatic-drag-and-drop@^1.0.0\n\n# Do for all packages you have installed,\n# or use our bash script below\n```\n\nHere is an optional `bash` script that will upgrade all your installed Pragmatic drag and drop\npackages with `yarn`\n\n```bash\n#!/bin/bash\n\nPACKAGES=(\n  \"@atlaskit/pragmatic-drag-and-drop\"\n  \"@atlaskit/pragmatic-drag-and-drop-auto-scroll\"\n  \"@atlaskit/pragmatic-drag-and-drop-hitbox\"\n  \"@atlaskit/pragmatic-drag-and-drop-live-region\"\n  \"@atlaskit/pragmatic-drag-and-drop-flourish\"\n  \"@atlaskit/pragmatic-drag-and-drop-react-accessibility\"\n  \"@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration\"\n  \"@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll\"\n)\nVERSION=\"^1.0.0\"\n\nfor PACKAGE in \"${PACKAGES[@]}\"\ndo\n  if grep -q \"\\\"${PACKAGE}\\\"\" ./package.json; then\n    echo \"${PACKAGE} is installed, upgrading to ${VERSION}...\"\n    yarn upgrade ${PACKAGE}@${VERSION}\n    # for yarn@3, use:\n    # yarn up ${PACKAGE}@${VERSION}\n  else\n    echo \"${PACKAGE} is not installed, skipping upgrade.\"\n  fi\ndone\n```\n\n## Step 3: Run our codemod\n\nUse our [codemod-cli](https://www.npmjs.com/package/@atlaskit/codemod-cli) package to run our\n`upgrade-pragmatic-drag-and-drop-to-stable` codemod. This will automatically shift over all usage to\nour `1.0` API (except for the file adapter)\n\n```bash\n# Example usage\nnpx @atlaskit/codemod-cli@latest --preset upgrade-pragmatic-drag-and-drop-to-stable --extensions tsx,ts,js --parser tsx ./path/to/source\n```\n\n## Step 4: Add our `DragEvent` ponyfill for Jest\n\nIf you are doing testing of Pragmatic drag and drop using `[Jest](https://jestjs.io/)` (+\n[`jsdom`](https://github.com/jsdom/jsdom)), then you will likely need to start ponyfiling\n[`DragEvent`](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent). Unfortunately,\n[jsdom does not ponyfill `DragEvent`](https://github.com/jsdom/jsdom/issues/2913). `0.x` got away\nwith not having `DragEvent` pollyfiled, but `1.x` requires `DragEvent` to be setup correctly. Trying\nto rely on `DragEvent` not being setup would have required non-trival changes to the library code,\nas well as a strange test experience where some things would work, but other things would not.\n\nWe plan on creating a package for easy consumption of our `DragEvent` polyfill, but in the meantime,\nyou can copy it from [Github](https://gist.github.com/alexreardon/cbc317ede2212d6db59ba5ff59dcf419)\n\n## Full changes\n\nHere is a list of all the `1.0` changes incase you are unable to run the automated changes:\n\nWe have renamed our drop indicator package to improve naming consistency across our outputs.\n\n```diff\n- @atlaskit/pragmatic-drag-and-drop-react-indicator\n+ @atlaskit/pragmatic-drag-and-drop-react-drop-indicator\n```\n\nThe following entry point paths have been changed, but their exports are unchanged:\n\n```diff\n- @atlaskit/pragmatic-drag-and-drop/adapter/element\n+ @atlaskit/pragmatic-drag-and-drop/element/adapter\n\n- @atlaskit/pragmatic-drag-and-drop/util/set-custom-native-drag-preview\n+ @atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview\n\n- @atlaskit/pragmatic-drag-and-drop/util/offset-from-pointer\n+ @atlaskit/pragmatic-drag-and-drop/element/offset-from-pointer\n\n- @atlaskit/pragmatic-drag-and-drop/util/center-under-pointer\n+ @atlaskit/pragmatic-drag-and-drop/element/center-under-pointer\n\n- @atlaskit/pragmatic-drag-and-drop/util/disable-native-drag-preview\n+ @atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview\n\n- @atlaskit/pragmatic-drag-and-drop/util/scroll-just-enough-into-view\n+ @atlaskit/pragmatic-drag-and-drop/element/scroll-just-enough-into-view\n\n- @atlaskit/pragmatic-drag-and-drop/util/combine\n+ @atlaskit/pragmatic-drag-and-drop/combine\n\n- @atlaskit/pragmatic-drag-and-drop/util/once\n+ @atlaskit/pragmatic-drag-and-drop/once\n\n- @atlaskit/pragmatic-drag-and-drop/util/reorder\n+ @atlaskit/pragmatic-drag-and-drop/reorder\n\n- @atlaskit/pragmatic-drag-and-drop-hitbox/addon/closest-edge\n+ @atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge\n```\n\n`cancelUnhandled` has been renamed to `preventUnhandled` to more accurately reflect what it is\nachieving, and the entry point path changed too.\n\n```diff\n- import {cancelUnhandled} from '@atlaskit/pragmatic-drag-and-drop/addon/cancel-unhandled';\n+ import {preventUnhandled} from '@atlaskit/pragmatic-drag-and-drop/prevent-unhandled';\n```\n\n`offsetFromPointer` has been renamed to `pointerOutsideOfPreview` as `offsetFromPointer` was found\nto be misleading for folks. The entry point path has been changed too.\n\n```diff\n- import { offsetFromPointer } from '@atlaskit/pragmatic-drag-and-drop/util/offset-from-pointer';\n+ import { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';\n```\n\nThe `ElementMonitorCanMonitorArgs` type has been renamed to `ElementMonitorGetFeedbackArgs` to\nimprove naming consistency with other feedback types\n\n```diff\n- import type { ElementMonitorCanMonitorArgs } from '@atlaskit/pragmatic-drag-and-drop/adapter/element';\n+ import type { ElementMonitorGetFeedbackArgs } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n```\n\nThe type `SourceCanStartArgs` is no longer being exported from\n`'@atlaskit/pragmatic-drag-and-drop/types'` as the type was never being used and was incorrect.\nPlease use the appropriate `*GetFeedbackArgs` type instead.\n\n```diff\n- import type { SourceCanStartArgs } from '@atlaskit/pragmatic-drag-and-drop/type';\n\n+ // use types from the appropriate adapter\n\n+ import type { ElementMonitorGetFeedbackArgs } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n+ import type { DropTargetGetFeedbackArgs } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n```\n\nThe `@atlaskit/pragmatic-drag-and-drop-auto-scroll` named exports have been updated to reflect our\nupdated adapter names\n\n```diff\n- import {autoScrollForFiles} from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/file';\n+ import {autoScrollForExternal} from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/external';\n\n- import {unsafeOverflowAutoScrollForFiles} from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/unsafe-overflow/file';\n+ import {unsafeOverflowAutoScrollForExternal} from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/unsafe-overflow/external';\n```\n\nOur _file adapter_ has been replaced by a new\n[_external adapter_](/components/pragmatic-drag-and-drop/core-package/adapters/external).\n\n```ts\n/** 0.x API **/\n\nimport { dropTargetForFiles, monitorForFiles } from '@atlaskit/pragmatic-drag-and-drop/file';\n\ndropTargetForFiles({\n\telement: myElement,\n\tonDrop({ source }) {\n\t\t// 😬 Not to easy to get files!\n\n\t\tif (!source.items) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst files: File[] = [...source.items]\n\t\t\t.filter((item) => item.kind === 'file')\n\t\t\t.map((item) => item.getAsFile())\n\t\t\t.filter((file: File | null): file is File => file != null);\n\t},\n});\n\n/** 1.0 API **/\n\nimport {\n\tdropTargetForExternal,\n\tmonitorForExternal,\n} from '@atlaskit/pragmatic-drag-and-drop/external';\nimport { containsFiles, getFiles } from '@atlaskit/pragmatic-drag-and-drop/external/file';\n\ndropTargetForExternal({\n\tcanDrop: containsFiles,\n\tonDrop({ source }) {\n\t\t// 🤩 Easy to get files!\n\t\tconst files: File[] = getFiles({ source });\n\t},\n});\n```\n\n## Auto scrolling\n\nWhile we are talking about changes, we encourage all consumers to move off our legacy auto scroller\npackages, and onto our new, faster, more flexible and more delightful auto scroller package:\n\n**Old:**\n[`@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll`](/components/pragmatic-drag-and-drop/optional-packages/react-beautiful-dnd-autoscroll)\n\n(previously called `@atlaskit/pragmatic-drag-and-drop-autoscroll`)\n\n**New:**\n[`@atlaskit/pragmatic-drag-and-drop-auto-scroll`](/components/pragmatic-drag-and-drop/optional-packages/auto-scroll)\n"
  },
  {
    "path": "packages/documentation/constellation/05-core-package/index.mdx",
    "content": "---\norder: 0\n---\n\nimport SectionMessage from '@atlaskit/section-message';\n\nThe **core package** of Pragmatic drag and drop includes all the essential building blocks for any\ndrag and drop experience. The **core package** is vanillaJS library (authored in TypeScript) that\ncan be used with any view library (eg `react`, `svelte`, `vue` etc).\n\n```bash\n# install the core package\nyarn add @atlaskit/pragmatic-drag-and-drop\n```\n\nPragmatic drag and drop is optimised for performance. A key way this is achieved is by only\nrequiring you include the code you actually use for your experience. Within the **core package**,\nthere are many optional pieces, which are separated into their own entry points\n\nFor example:\n\n- [The element adapter](/components/pragmatic-drag-and-drop/core-package/adapters/element):\n  `/element/adapter` (`@atlaskit/pragmatic-drag-and-drop/element/adapter`)\n- [An array reordering utility](/components/pragmatic-drag-and-drop/core-package/utilities):\n  `/reorder` (`atlaskit/pragmatic-drag-and-drop/reorder`)\n\nAnd many more!\n\nYou can also use our [optional packages](/components/pragmatic-drag-and-drop/optional-packages) to\nstreamline the building of your experiences if you want to. Some of these optional packages are tied\nto specific view technologies (eg `@atlaskit/pragmatic-drag-and-drop-react-drop-indicator` uses\n`react` for rendering and `emotion` for styling), and those dependencies are made clear in the\npackages documentation. Where possible, packages don't have any dependency on a view technology (eg\n`@atlaskit/pragmatic-drag-and-drop-hitbox` for hitbox information).\n\n<SectionMessage appearance=\"success\">\n\nBe sure to check out our [tutorial](/components/pragmatic-drag-and-drop/tutorial) to see how to\nquickly wire up an experience with Pragmatic drag and drop.\n\n</SectionMessage>\n\n### Adapters\n\nAn _adapter_ teaches Pragmatic drag and drop how to handle dragging a particular entity:\n\n- [element adapter](/components/pragmatic-drag-and-drop/core-package/adapters/element) → handling\n  the dragging of draggable elements\n- [text selection adapter](/components/pragmatic-drag-and-drop/core-package/adapters/text-selection)\n  → handling the dragging of text selections\n- [external adapter](/components/pragmatic-drag-and-drop/core-package/adapters/external) → handling\n  drag operations that started outside of the current `window` (eg files and text from other\n  `window`s or applications)\n\nA drag adapter always provides at least two pieces:\n\n1. A way of registering [drop target](/components/pragmatic-drag-and-drop/core-package/drop-targets)\n   (eg `dropTargetForElements`).\n2. A way to create a [monitor](/components/pragmatic-drag-and-drop/core-package/monitors) (eg\n   `monitorForExternal`).\n\n```ts\nimport {\n\tdropTargetForExternal,\n\tmonitorForExternal,\n} from '@atlaskit/pragmatic-drag-and-drop/external/adapter';\n\nimport {\n\tdropTargetForElements,\n\tmonitorForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nimport {\n\tdropTargetForTextSelection,\n\tmonitorForTextSelection,\n} from '@atlaskit/pragmatic-drag-and-drop/text-selection/adapter';\n```\n\nAn adapter can also provide additional pieces. For example, the\n[element adapter](/components/pragmatic-drag-and-drop/core-package/adapters/element) provides a\n`draggable()` function which is a way of registering a `HTMLElement` as being draggable.\n\n```ts\nimport { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nconst cleanup = draggable({\n\telement: myElement,\n});\n```\n\n### Drop targets\n\nAn `Element` that can be dropped upon by something that is dragging.\n\n```ts\nimport { dropTargetForExternal } from '@atlaskit/pragmatic-drag-and-drop/external/adapter';\n\nconst cleanup = dropTargetForExternal({\n\telement: myElement,\n});\n```\n\nLearn more about [drop targets](/components/pragmatic-drag-and-drop/core-package/drop-targets).\n\n### Monitors\n\nA way of listening for `@atlaskit/pragmatic-drag-and-drop` drag operation events anywhere.\n\n```ts\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nconst cleanup = monitorForElements({\n\telement: myElement,\n\tonDragStart: () => console.log('an element started dragging'),\n});\n```\n\nLearn more about [monitors](/components/pragmatic-drag-and-drop/core-package/monitors).\n\n### Utilities\n\nUtilities are small helper functions for common tasks, which are included with the main drag and\ndrop package (e.g. `once` for simple memoization, or `combine` to collapse cleanup functions).\n\n```ts\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\n\nconst cleanup = combine(\n\tdraggable({\n\t\telement: myElement,\n\t}),\n\tdropTarget({\n\t\telement: myElement,\n\t}),\n);\n```\n\n## What's next\n\n- Head to our [adapter documentation](/components/pragmatic-drag-and-drop/core-package/adapters) to\n  start installing the pieces you need\n- Learn more about our [design](/components/pragmatic-drag-and-drop/design-guidelines) and\n  [accessibility](/components/pragmatic-drag-and-drop/accessibility-guidelines) guidelines.\n"
  },
  {
    "path": "packages/documentation/constellation/06-optional-packages/index.mdx",
    "content": "---\ntitle: Packages\ndescription:\n  This page contains all the available packages and entry points for\n  @atlaskit/pragmatic-drag-and-drop related packages.\n---\n\nimport SectionMessage from '@atlaskit/section-message';\n\n<SectionMessage>\n\nAt this stage we are using [entry points](https://nodejs.org/api/packages.html#package-entry-points)\nrather than exporting everything from the root of the package to ensure that _everybody_ gets the\nbest possible bundle size without needing to rely on\n[tree shaking](https://developer.mozilla.org/en-US/docs/Glossary/Tree_shaking).\n\n</SectionMessage>\n\n[Required core package](/components/pragmatic-drag-and-drop/core-package)\n\nOptional packages:\n\n- [hitbox](/components/pragmatic-drag-and-drop/optional-packages/hitbox): Add additional impact\n  information to a drop target when it is being dragged over (plain js)\n- [react-drop-indicator](/components/pragmatic-drag-and-drop/optional-packages/react-drop-indicator):\n  Used to render drop indicators (eg lines)\n- [flourish](/components/pragmatic-drag-and-drop/optional-packages/flourish): Minor effects to make\n  drag operations more delightful (eg flash on drop) (plain js)\n- [auto-scroll](/components/pragmatic-drag-and-drop/optional-packages/auto-scroll): More delightful\n  automatic scrolling during a drag operation (plain js)\n- [react-accessibility](/components/pragmatic-drag-and-drop/optional-packages/react-accessibility):\n  Opinionated `react` components for adding common accessibility controls\n- [live-region](/components/pragmatic-drag-and-drop/optional-packages/live-region): a helper for\n  announcing messages to screen reader users\n- [react-beautiful-dnd-migration](/components/pragmatic-drag-and-drop/optional-packages/react-beautiful-dnd-migration):\n  enables rapid migrations from `react-beautiful-dnd` to Pragmatic drag and drop\n- [react-beautiful-dnd-autoscroll](/components/pragmatic-drag-and-drop/optional-packages/react-beautiful-dnd-autoscroll):\n  automatic scroller port from `react-beautiful-dnd` (deprecated in favour of `auto-scroll`)\n- [unit-testing](/components/pragmatic-drag-and-drop/optional-packages/unit-testing): helpers to\n  assist with unit testing\n"
  },
  {
    "path": "packages/documentation/constellation/07-web-platform-design-constraints/index.mdx",
    "content": "---\ntitle: Web platform design constraints\n---\n\nimport SectionMessage from '@atlaskit/section-message';\n\nPragmatic drag and drop is powered by the web platforms built in drag and drop functionality.\nEmbracing the web platform unlocks huge speed and flexibility wins. However, leveraging the web\nplatform does mean embracing a few design constraints.\n\n<SectionMessage>\n\nThese constraints are are shared for all native powered drag and drop operations on the web, so\nusers will be familiar with these affordances.\n\n</SectionMessage>\n\n## Cursors\n\n[The specification for web platform drag and drop](https://html.spec.whatwg.org/multipage/dnd.html#dom-datatransfer-dropeffect)\ncurrently gives very little flexibility when it comes to what `cursor` is used Ideally we would have\n`cursor:grabbing` while dragging!\n\nWhile a drag operation is occurring, the `cursor` is **exclusively** controlled by the\n[`dropEffect`](https://html.spec.whatwg.org/multipage/dnd.html#dom-datatransfer-dropeffect)\nassociated with the drag operation. You can control the `dropEffect` by using the `getDropEffect()`\n[drop target API](/components/pragmatic-drag-and-drop/core-package/drop-targets).\n\n| `dropEffect` | `cursor`         | Notes                           |\n| ------------ | ---------------- | ------------------------------- |\n| `\"move\"`     | `cursor:default` |                                 |\n| `\"link\"`     | `cursor:alias`   | ⚠️ Safari uses `cursor:default` |\n| `\"copy\"`     | `cursor:copy`    |                                 |\n| `\"none\"`     | `cursor:default` |                                 |\n\n### Known web platform bugs\n\n- Chrome: sometimes the `cursor` can inconsistently use the `cursor` value of the element being\n  dragged over\n- Chrome: the `cursor` can sometimes flash `cursor:copy` when a drag is first starting -\n  [bug](https://bugs.chromium.org/p/chromium/issues/detail?id=1356797)\n\n## Native drag previews\n\nWhen using native drag previews, the browser applies some styles that cannot be controlled:\n\n- The opacity of the preview is lowered slightly (approximately `opacity:0.8`)\n- A small drop shadow is added\n\nThese styles can vary slightly between browsers.\n\n<SectionMessage appearance=\"warning\" title=\"Low opacity on large previews for Windows\">\n\nUnfortunately, for all browsers on Windows, when a native drag previews is wider than `280px` or\ntaller than `280px`, then the preview opacity is significantly lowered. If you would not like your\npreviews dimmed on Windows, then you will need to make your native previews smaller than\n`280px`x`280px`.\n\nYou can also have smaller native previews just for Windows users if you like:\n\n```ts\nconst preview = document.createElement('div');\n\nif (navigator.platform.includes('Win32')) {\n\tpreview.style.maxWidth = '280px';\n\tpreview.style.maxHeight = '280px';\n}\n```\n\nTested on Windows 11:\n\n- `Edge@116`\n- `Chrome@116`\n- `Firefox@117`\n\n</SectionMessage>\n"
  },
  {
    "path": "packages/documentation/constellation/08-design-guidelines/index.mdx",
    "content": "---\norder: 0\ntitle: Design guidelines\ndescription: Design consistent drag and drop experiences.\n---\n\nimport SectionMessage from '@atlaskit/section-message';\nimport ListExample from '../../examples/list';\nimport BoardExample from '../../examples/board';\nimport TreeExample from '../../examples/tree';\nimport { EntireEntityIsDraggable } from '../../examples/guidelines/entire-entity-is-draggable';\nimport { OnlyDraggableFromDragHandle } from '../../examples/guidelines/only-draggable-from-drag-handle';\nimport { HoverDragHandle } from '../../examples/guidelines/hover-drag-handle';\nimport { HoverDragHandleOutsideBounds } from '../../examples/guidelines/hover-drag-handle-outside-bounds';\nimport { AllDragHandleVariants } from '../../examples/guidelines/all-drag-handle-variants';\nimport { DelayedCursorChange } from '../../examples/guidelines/delayed-cursor-change';\nimport { ImpliedDraggable } from '../../examples/guidelines/standalone-card';\nimport { EntireEntityIsDraggableWithDragHandleButton } from '../../examples/guidelines/entire-entity-is-draggable-with-drag-handle-button';\n\nThese guidelines provide an opinionated way to implement drag and drop experiences with Pragmatic\ndrag and drop for Atlassian interfaces. These guidelines work within\n[web platform design constraints](/components/pragmatic-drag-and-drop/web-platform-design-constraints)\nfor drag and drop, and aim to optimise clarity and performance. Non-Atlassian consumers are welcome\nto use these guidelines, or create their own visual language for drag and drop. The\n[core package](/components/pragmatic-drag-and-drop/core-package) does not have any baked in design\nopinions, but some of the [optional packages](/components/pragmatic-drag-and-drop/optional-packages)\nembody these design choices.\n\n<SectionMessage appearance=\"discovery\">\n\nThese design decisions are available in our\n[Pragmatic drag drop Figma UI Kit](<https://www.figma.com/file/3E3rGPX4YHlVUP3cNyRykB/Pragmatic-Drag-%26-Drop-UI-Kit-(PDND)>)\n(Atlassian only).\n\nWe plan on soon making this Figma public soon.\n\n</SectionMessage>\n\nCards, lists, and other UI can often be dragged and reordered. Design clear and consistent drag and\ndrop experiences in Atlassian apps following these principles:\n\n## Before the drag starts\n\n**Make it clear what can be dragged**\n\nWhen drag and drop is a _primary action_ for an entity, you should:\n\n1. use an always visible drag handle icon (an exception for this is when drag and drop is \"implied\",\n   for example cards on a board)\n2. use `:hover { cursor: grab }`\n3. Change the background color on item hover\n\nWhen drag and drop is a _secondary action_ for an entity, you should:\n\n1. use a drag handle icon that is visible on `:hover` or `:focus-within`\n2. use `:hover { cursor: grab }` after an `800ms` delay (see below for how to do this with CSS)\n3. Change the background color on item hover\n\nAn example of drag and drop as a secondary section is a menu items in a side navigation. The primary\naction for a menu item would be navigation, and a secondary action would be moving the menu item\nthrough drag and drop.\n\n<SectionMessage>\n\nPlease also see our\n[accessibility guidelines](/components/pragmatic-drag-and-drop/accessibility-guidelines) which talks\nabout our guidance for placing an action menu trigger on draggable entities to enable the same\noutcomes as drag and drop interactions for assistive technology users.\n\n</SectionMessage>\n\n### Which parts of an entity should be draggable?\n\nAs a starting position, if an entity is draggable (eg a card), then make the whole entity draggable.\nIf the entity has other interactive parts (eg buttons, dropdowns), then just make the drag handle\nicon the draggable part of the entity.\n\nSomething to keep in mind is that making an entire entity `draggable` will prevent text selection\ninside that entity (platform limitation)\n\n### Drag handle icons\n\nOur drag handle icon helps people understand what is draggable. Please use the `\"small\"`\n`DragHandleVerticalIcon` from [@atlaskit/icon](/components/icon).\n\n```tsx\nimport DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';\n\nfunction DragHandle() {\n\treturn <DragHandleVerticalIcon size=\"small\" />;\n}\n```\n\nThe color of the icon should match the text color of text in the draggable entity. This is usually\nhandled for you by default with [@atlaskit/icon](/components/icon) as it uses `currentColor` by\ndefault.\n\nAll available variants, which are explained in detail below:\n\n<Example Component={AllDragHandleVariants} appearance=\"showcase-only\" />\n\n#### Always visible drag handle\n\nWhen dragging is a primary action of an entity, there should be a visible drag handle on the left\nhand side of the entity at all times.\n\n<Example Component={EntireEntityIsDraggable} appearance=\"showcase-only\" />\n\nYou should also make your drag handle always visible if your drag handle is also your\n[action button](/components/pragmatic-drag-and-drop/optional-packages/react-accessibility).\n\n<Example Component={EntireEntityIsDraggableWithDragHandleButton} appearance=\"showcase-only\" />\n\nWhen the drag handle is the only part of an entity that is draggable, it's touch target size should\nbe at least `24px x 24px` in size (`\"spacious\"` icon spacing).\n\n<Example Component={OnlyDraggableFromDragHandle} />\n\n#### Visible on hover drag handle\n\nIf dragging is a secondary action for an entity, then you _can_ use a delayed drag handle (it is\nonly visible on `:hover` and `:focus-within`).\n\n- This approach can be helpful when you don't want add clutter to an interface when drag and drop is\n  a secondary action.\n- Keep in mind that using this approach will make it harder for users to discover that an entity is\n  draggable.\n- The drag handle icon should use `\"compact\"` spacing (`16px x 16px`) so you don't leave a big gap\n  in the interface for where the drag handle icon will appear.\n- For best performance, use CSS to hide and show the drag handle on `:focus-within` or `:hover`.\n\n```tsx\nimport DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';\n\nfunction DragHandle() {\n\treturn <DragHandleVerticalIcon spacing=\"compact\" size=\"small\" />;\n}\n```\n\n<Example Component={HoverDragHandle} appearance=\"showcase-only\" />\n\nA visible on hover drag handle can appear _outside_ of the bounds of an element if you are pressed\nfor room. In this scenario it's important that you make sure that a user can start the drag from the\ndrag handle.\n\nWhat you need to do:\n\n- Make sure your drag handle is a\n  [part of the hitbox of the containing element](https://www.youtube.com/watch?v=zVFJAwrCQCM)\n- Make sure your drag handle allows pointer events (`pointer-events: auto`)\n\n<Example Component={HoverDragHandleOutsideBounds} appearance=\"showcase-only\" />\n\n### Implied draggables\n\nSome entities are considered to be \"implied\" to be draggable (eg cards and columns) and these\nentities do not require a drag handle icon - although you can still encouraged to add them. Implied\ndraggable entities should use background color and cursor changes to make it clear which part of the\nentity is draggable, and there should be a strong preference to make as much of the entity draggable\nas possible.\n\n<Example Component={ImpliedDraggable} appearance=\"showcase-only\" />\n\nSometimes, your drag handle icon should be a button for triggering actions too (see our\n[accessibility guidelines](/components/pragmatic-drag-and-drop/accessibility-guidelines)). In those\ncases, please use our\n[drag handle icon button](/components/pragmatic-drag-and-drop/optional-packages/react-accessibility).\n\n<Example Component={EntireEntityIsDraggableWithDragHandleButton} appearance=\"showcase-only\" />\n\n### Cursor changes\n\nUse `:hover { cursor:grab; }` as a helpful signal that an entity is draggable. Only the draggable\npart of an entity should have `cursor:grab`. So when a draggable is only draggable from a drag\nhandle, only the drag handle should have `cursor:grab`.\n\nFor entities where dragging is a secondary action (and you are therefore using a \"visible on focus\ndrag handle\"), you should also delay the changing of the cursor to `grab` by `800ms`\n\n<Example Component={DelayedCursorChange} appearance=\"showcase-only\" />\n\n[We _strongly_ recommend you implement this behaviour with CSS](https://x.com/alexandereardon/status/1702192381007917452)\n(no JS needed!)\n\n```css\n@keyframes change-cursor {\n\tto {\n\t\tcursor: grab;\n\t}\n}\n\n.item:hover {\n\tanimation-name: cursor-change;\n\n\t/* instant animation */\n\tanimation-duration: 0s;\n\n\t/* delay cursor change */\n\tanimation-delay: 800ms;\n\n\t/* keep the end state when the animation ends */\n\tanimation-fill-mode: forwards;\n}\n```\n\n### Background color changes\n\nThe draggable part of an entity should have a background color change applied when hovering over it.\n\nPlease use the appropriate [hover token](/components/tokens/all-tokens) for the entity.\n\nUsually for a draggable entity you will be using:\n\n- `elevation.surface` as the background color.\n- `elevation.surface.hovered` on as the `hover` background color on the draggable part of the\n  entity.\n\n<Example Component={AllDragHandleVariants} appearance=\"showcase-only\" />\n\nFor some situations it might be appropriate to use a different color pairing. Please try to use a\n`\".background\"` color token for the draggable entity, and a matching `\".hovered\"` token for the\nhover.\n\n## Start of a drag\n\n**Make it clear what is being dragged**\n\nIt is important that you give clear feedback to the user about what is being dragged.\n\n### Drag previews\n\nA drag preview is a representation of the item being dragged. Generally a drag preview is a picture\nof the item being dragged around the page, and not the draggable item itself.\n\nWhen an item is small and simple, the drag preview can be an exact copy of the item being dragged.\nIf an item is larger or more complex, you should simplify the drag preview.\n\nSimplification suggestions:\n\n- Use a maximum of three pieces of information in a preview\n- Use a maximum preview size of `280px x 280px` to prevent\n  [super low drag preview opacity on Windows](/components/pragmatic-drag-and-drop/web-platform-design-constraints)\n\n#### Standard\n\nDrag previews should generally be pushed away from the users pointer by `space.100` vertically, and\n`space.200` horizontally. Do not rotate the drag preview.\n\n```\n{\n  x: token('space.200', '16px'),\n  y: token('space.100', '8px'),\n}\n```\n\n<img\n\tsrc=\"images/design-drag-preview-offset.png\"\n\talt=\"A drag preview of a list item with an offset\"\n\tstyle=\"max-width: 400px; margin: 0 auto\"\n/>\n\n#### Cards\n\nCards are to be dragged from the point they're grabbed from (no offset).\n\n<img\n\tsrc=\"images/design-drag-preview-no-offset.png\"\n\talt=\"A drag preview of a card with no offset\"\n\tstyle=\"max-width: 300px; margin: 0 auto\"\n/>\n\nDo not rotate card drag previews. _Exception:_ Trello, which has a `4deg` rotation.\n\n### Cursor\n\nDue to\n[web platform constraints](/components/pragmatic-drag-and-drop/web-platform-design-constraints), we\nhave limited control of the cursor during a drag operation. The cursor will generally be\n`cursor:default` during a drag operation.\n\n[More information about cursors](/components/pragmatic-drag-and-drop/web-platform-design-constraints#cursors).\n\n### The draggable item\n\nWhile an item is being dragged, the original item should stay in place and dim to `40%` opacity\n(`opacity: 0.4`) while the drag preview is being moved around.\n\n![A draggable item left in place during a drag](images/design-dragging-item-in-place.png)\n\n### Multiple-item drag previews\n\nFor multi-item drag previews, use a stacked appearance with a badge indicating the number of items\nbeing dragged.\n\n- **Four or more small items** such as list items should appear as a stacked preview under the first\n  item. Less than four small items can appear separately where space allows (all items showing in\n  the preview).\n- **Any more than one large item** (card) should show as a stack with a badge indicating the number\n  underneath.\n\n![A stack of multiple cards being dragged across a board, with a badge indicating there are two cards being moved.](images/design-multi-card-drag.png)\n\nImplement with\n[native drag previews](/components/pragmatic-drag-and-drop/core-package/adapters/element/drag-previews),\nor use the\n[Figma kit (Atlassian only)](<https://www.figma.com/file/3E3rGPX4YHlVUP3cNyRykB/Pragmatic-Drag-%26-Drop-UI-Kit-(PDND)?type=design&node-id=38-5065&mode=design>)\nin designs.\n\n## While dragging\n\n**Make it clear what the result will be**\n\nIt should be clear to a user what the final result of the drag operation will be during the drag\noperation.\n\nThere are two signals you can use to indicate drop placement:\n\n1. Drop indicator (a line)\n2. Background color (`color.background.selected.hovered`)\n\n### Drop indicator\n\nThe drop indicator line is used to communicate relative placement (for example, before or after an\nitem in a list)\n\n![A list of items where one is being dragged over a new location. The location where the item would drop if released is marked with a blue line and dot. ](images/design-list-drop-indicator.png)\n\nA drop indicator line should have the following properties:\n\n| Property                         | Value                     |\n| -------------------------------- | ------------------------- |\n| Stroke size                      | `2px`                     |\n| Color                            | `\"color.border.selected\"` |\n| Terminal diameter                | `8px` (`\"space.100\"`)     |\n| Border radius on right hand side | none                      |\n\nThe terminal should bleed `4px` outwards on the left hand side of the target item. When this\nbleeding is not possible due to UI constraints (such as the element appearing in a scroll container\nwhich would cause the terminal to be cut off) then the terminal \"bleeding\" can be disabled and the\nterminal can sit against the left edge of the entity\n\nFor stacked items, the line should appear in the middle of the gap between the items.\n\n- [Edge detection package](/components/pragmatic-drag-and-drop/optional-packages/hitbox): determines\n  when and where the drop indicator shows based on the location of the dragged item.\n- [React drop indicator package](/components/pragmatic-drag-and-drop/optional-packages/react-drop-indicator):\n  draw drop indicators\n\n<Example Component={ListExample} appearance=\"showcase-only\" />\n\nA drop indicator line should _not_ be used when a draggable item is being dragged over a droppable\narea where there is no relative placement possible (for example, dropping into an empty sibling\nlist).\n\n![dragging over an empty column should not print a line](images/design-board-background-only.png)\n\n### Background color\n\nA background color change is used to communicate that an item will be placed within a particular\ndroppable area. Background color changes should be used when there are multiple possible areas of\nthe page a draggable item can be dropped on. The droppable area that the user is currently over\nshould have its background color changed. A background color change should also occur when a\ndraggable item starts in a droppable area, when there are multiple possible droppable areas.\n\n![dragging over a populated column, where a line and background color change is being displayed](images/design-board-background-and-line.png)\n\nA background color change to communicate that dropping is possible should only be applied when a\nuser can perform a drop operation. Sometimes an entity (eg a column) only allows dropping on a\nsubset of that entity. Only the subset that allows dropping should have a background color change,\nand only when the user is dragging over that subset. We don't want to have a situation where a\nbackground color changes, but when the user drops, nothing happens.\n\nBackground color change animation details:\n\n| Property         | Value                                                                              |\n| ---------------- | ---------------------------------------------------------------------------------- |\n| Background color | `\"color.background.selected.hovered\"`                                              |\n| Easing           | `cubic-bezier(0.15, 1.0, 0.3, 1.0)` (`import {easeInOut} from '@atlaskit/motion'`) |\n| Duration         | `350ms` (`import {mediumDurationMs} from '@atlaskit/motion'`)                      |\n\nWhen draggable items can only be moved relatively within a single container, then no background\ncolor change should be used when the user is dragging something within the experience.\n\n![A list being reordered, where only a drop indication line is being shown and there is no background changes](images/design-list-drop-indicator.png)\n\n### Nested structures\n\nWhen there are multiple horizontal levels available as drop targets (for example, trees), then we\nencourage the use of extra visual affordances to make the levelling clearer:\n\n1. Change the background color to `'color.background.information'` for all items on the level\n2. Add an outline to the level with the following properties:\n\n```tsx\nconst styles = css({\n\tbackgroundColor: token('color.background.information'),\n\tborderRadius: token('radius.xsmall'),\n\toutlineOffset: token('space.075'),\n\toutlineWidth: token('border.width.selected'),\n\toutlineStyle: 'solid',\n\toutlineColor: token('color.border.selected'),\n});\n```\n\n<Example Component={TreeExample} appearance=\"showcase-only\" />\n\n## On drop\n\nWhen the drag operation finishes, we want to:\n\n1. Allow users to quickly perform other operations\n2. Make it clear what the user achieved\n\n### Optimistically update the UI\n\nAfter a drag operation completes, you should immediately update the interface to reflect the outcome\nof the drag operation. This is known an as \"optimistic update\" as the interface is updated _before_\nthe change has been persisted on your backend. In addition to your optimistic update, you should\nfire off an asynchronous request to persist the outcome of the drag operation.\n\n<SectionMessage>\n\nOptimistic updates _might_ not be available for every possible interaction, but it should be an\n_extremely_ strong preference to provide optimistic updates.\n\n</SectionMessage>\n\n### Flash the moved item\n\nTo improve clarity about what the user achieved, the background color of the moved item should flash\nonce it has been moved.\n\n![A series of actions shown in four slides. Hover state is grey, the drag indicator appears once drag begins, upon drop the color of the item flashes blue, then returns to its normal color.](images/design-drop-flash.png).\n\nWe have implemented this flash in our\n[flourish package](/components/pragmatic-drag-and-drop/optional-packages/flourish) for you to use\nwith any framework.\n\nBackground color flash details:\n\n| Property         | Value                                                                      |\n| ---------------- | -------------------------------------------------------------------------- |\n| Background color | `\"color.background.selected\"`                                              |\n| Easing           | `cubic-bezier(0.25, 0.1, 0.25, 1.0)` (not available in `@atlaskit/motion`) |\n| Duration         | `700ms` (`import {largeDurationMs} from '@atlaskit/motion'`)               |\n\n## Provide accessible controls\n\nAll draggable items should also have the ability to achieve the same outcomes using assistive\ntechnology friendly controls.\n\n<SectionMessage>\n\nSee our [accessibility guidelines](/components/pragmatic-drag-and-drop/accessibility-guidelines)\n\n</SectionMessage>\n\n### Prefer visible drag handle icons\n\nPlease make drag handle icons visible (where possible) as this is a helpful signal for people that\nan item is draggable.\n\n### Action menus for move actions\n\nIf the item already has a more actions (…) menu, put the move actions inside of the menu. This\nprovides a keyboard accessible way to move items that doesn’t rely on mouse clicking and dragging.\n\n![A Jira work item list view where a more actions button appears on the items. The button has three dots as a label ...](images/design-more-actions-hover.png)\n\n### Drag handle icon menus for move actions\n\nIf the entity does not have any more actions (…), make the drag handle icon into a menu button. When\ntriggered, the drag handle button opens a menu that allows the users to move the item.\n\n![A work item details view in Jira. A drag handle icon appears at the left of the assignee field. It is focussable, and opens a menu with options to move the field up or down in the view.](images/design-drag-handle-menu.png)\n\nUse the\n[drag handle menu component](/components/pragmatic-drag-and-drop/optional-packages/react-accessibility)\nin code or the\n[Figma kit drag handle menu (Atlassian only)](<https://www.figma.com/file/3E3rGPX4YHlVUP3cNyRykB/Pragmatic-Drag-%26-Drop-UI-Kit-(PDND)?type=design&node-id=38-2098&mode=design>)\nin designs.\n\n## Experience specific guidance\n\nThese are guidelines that are in addition to our standard guidance for specific experiences\n\n### Trees\n\n<Example Component={TreeExample} appearance=\"showcase-only\" />\n\n<SectionMessage appearance=\"discovery\">\n\nFor tree items, you should use our\n[list item hitbox](/components/pragmatic-drag-and-drop/optional-packages/hitbox/about) and our\n[list item react drop indicator](/components/pragmatic-drag-and-drop/optional-packages/react-drop-indicator/)\n(if your experience uses react).\n\n</SectionMessage>\n\n<SectionMessage appearance=\"discovery\">\n\nIf you are wiring up drag and drop for our `navigation-system` side navigation,\n[we have specific guidance for you](/components/navigation-system/side-nav-items/drag-and-drop)\n\n</SectionMessage>\n\n#### Drag starting\n\n- If dragging a tree item that has children in it, you should collapse the tree item when the drag\n  starts. [A video explaining the rationale for this](https://www.youtube.com/watch?v=Dht2dqrSEkE)\n- If your tree uses a pattern where tree items that have icons are replaced by chevrons on hover,\n  when the drag starts change all the tree item icons to be chevrons. This will help make it clearer\n  to users which part of the interface are potentially expandable.\n\n#### While dragging\n\n- Tree items can be drop targets and can support up to three operations: `\"reorder-before\"`,\n  `\"reorder-after\"` and `\"combine\"` (see\n  [list item hitbox](/components/pragmatic-drag-and-drop/optional-packages/hitbox/about) for more\n  details).\n- The size of the operation hitboxes are controlled by the\n  [list item hitbox](/components/pragmatic-drag-and-drop/optional-packages/hitbox/about).\n- Use the\n  [list item react drop indicator](/components/pragmatic-drag-and-drop/optional-packages/react-drop-indicator)\n  to visualize the\n  [list item hitbox operation](/components/pragmatic-drag-and-drop/optional-packages/hitbox/about)\n  (eg `\"combine\"`) that would be achieved if the user dropped the item. This will be a line above\n  the target tree item for `\"reorder-above\"`, a line below the target tree item for\n  `\"reorder-below\"` and a border around the target tree item for `\"combine\"`.\n- If a user drags over a collapsed tree item with the `\"combine\"` operation for `500ms`, then the\n  collapsed tree item should expand (and should stay expanded even after the drag finishes)\n- Use our\n  [group drop indicator](/components/pragmatic-drag-and-drop/optional-packages/react-drop-indicator)\n  around the innermost group of tree items being dragged over (see tree example for illustration)\n\n#### On drop\n\n- If the tree item being dragged was expanded when the drag started, re-expand the item. If the tree\n  item was collapsed when the drag started, keep it collapsed.\n- The dragged tree item must be visible after the drag has finished. This can involve expanding any\n  parent tree items needed. For example: dragging `item A` onto `item B` with a `\"combine\"`\n  operation can make `item A` a child of `item B`. If `item B` was not expanded at the end of the\n  drag (ie it was not dragged over for `500ms` with the `\"combine\"` operation), then `item B` should\n  be expanded so that `item A` is visible at the conclusion of the drag.\n\n#### Accessible actions\n\n- Tree items should have a standard '...' more menu to trigger movement outcomes\n- For list items you generally have predefined movement actions in a dropdown menu (eg\n  `\"reorder above\"`, `\"reorder below\"` etc). However, for tree items, you add a `\"move\"` item to the\n  more menu dropdown, and that `\"move\"` item should trigger a Modal. The Modal should contain a form\n  which enables all possible movement outcomes for a tree item.\n\n<SectionMessage>\n\nThere may be some experiences where exceptions to these recommendations are are warranted, and for\nthose you should refer to our\n[accessibility guidelines](/components/pragmatic-drag-and-drop/accessibility-guidelines#complex-cases)\nfor general principles and practices.\n\n</SectionMessage>\n\n### Dragging multiple items\n\nHow to show when more than one element is selected to be dragged.\n\n<SectionMessage appearance=\"warning\">This design pattern is under construction</SectionMessage>\n\n<details>\n  <summary>Work in progress guidance</summary>\n\n#### Cards and boards\n\nUse `color.background.selected` and `color.border.selected` to show the elements that have been\nselected, then change to the typical background color at 40% opacity once dragging begins. This\nshows where the objects are currently, and where they'll return if no drag location is chosen.\n\nBecause cards are larger, multiple cards should be stacked under the first card in the preview. Use\na badge to show how many items are being moved.\n\n![A stack of multiple cards being dragged across a board, with a badge indicating there are two cards being moved.](images/design-multi-card-drag.png)\n\nCheckboxes are highly recommended to show when one or more items are selected.\n\n<!-- TODO Fix example to match ideal design guide -->\n<!-- TODO uncomment this once example is done:\nTry selecting and dragging multiple cards in the board below for an example. -->\n\n<!-- <Example Component={BoardExample} appearance=\"showcase-only\" /> -->\n\n#### List items\n\nUse the selected background color token to indicate which items have been selected. Use drag\npreviews as usual, with all items being dragged in a column in the order they’d appear when dropped.\n\n![A list of draggable items where some are selected, shown in blue.](images/design-multi-select-list.png)\n\nFor more than three or four items, show a badge indicating the number and an implied stack beneath\nthe top item.\n\n<!-- TODO: Fix example to match ideal design guide -->\n<!-- <Example Component={ListExample} appearance=\"showcase-only\" /> -->\n\n</details>\n\n## Related\n\n- [Figma kit (Atlassian only)](<https://www.figma.com/file/3E3rGPX4YHlVUP3cNyRykB/Pragmatic-Drag-%26-Drop-UI-Kit-(PDND)>)\n- [Accessibility guidelines](/components/pragmatic-drag-and-drop/accessibility-guidelines)\n- [More examples](/components/pragmatic-drag-and-drop/examples)\n"
  },
  {
    "path": "packages/documentation/constellation/09-accessibility-guidelines/index.mdx",
    "content": "---\norder: 1\ntitle: Accessibility guidelines\ndescription: Create accessible alternatives to pointer based drag and drop\n---\n\nimport BoardExample from '../../examples/board';\nimport ListExample from '../../examples/list';\nimport TreeExample from '../../examples/tree';\nimport ManualFocusRestorationExample from '../../examples/manual-focus-restoration';\nimport { ActionMenuVariants } from '../../examples/guidelines/action-menu-variants';\nimport SectionMessage from '@atlaskit/section-message';\n\nThe goal of this guidance is to provide every person with a way to delightfully achieve the same\noutcomes in Atlassian interfaces, regardless of the technologies being used.\n\nThe [core package](/components/pragmatic-drag-and-drop/core-package) does not enable accessible\ncontrols automatically, as there is no one pattern that works well for all situations. Instead, use\nthese guidelines and our [optional packages](/components/pragmatic-drag-and-drop/optional-packages)\nand [Design System components](/components) to create accessible experiences.\n\nNon Atlassian consumers are encouraged to follow this guideline and substitute our Design System\ncomponents (eg `@atlaskit/inline-menu`) with their own components. Non Atlassian consumers are also\nwelcome to implement accessibility in another way if they choose.\n\n## Always provide alternatives to dragging\n\nNot all people can successfully complete pointer based drag operations. Provide other ways for\npeople using assistive technologies to achieve the same outcomes as pointer based drag and drop\noperations.\n\nWhen building alternative flows, you need to:\n\n1. Let the user trigger an outcome\n2. Tell the user what they achieved\n3. Let the user easily continue to trigger more outcomes\n\n## 1. Let the user trigger an outcome\n\nUse visible and accessible controls (for example, buttons, menus, and forms) to make it easy for\npeople using assistive technologies to trigger the same outcomes as a drag operation.\n\n### General pattern: buttons and menus\n\nDraggable entities should have a button that can be used to trigger an inline menu containing\noutcomes.\n\n<SectionMessage>\n\nPlease refer to our [design guidelines](/components/pragmatic-drag-and-drop/design-guidelines) for\nguidance about drag handle icons.\n\n</SectionMessage>\n\n- Movement outcomes can be added to a draggable entity by using a **More button (...)**\n- Having a **More button (...)** does not remove the need for a drag handle icon. See\n  [design guidelines](/components/pragmatic-drag-and-drop/design-guidelines).\n- If no **More button (...)** exists on a draggable entity, and movement outcomes are the only\n  possible actions for the entity, then you can convert the drag handle icon into a\n  [drag handle menu button](/components/pragmatic-drag-and-drop/optional-packages/react-accessibility)\n  that triggers an inline menu with movement outcomes.\n- A draggable entity should only have one button for triggering actions. An entity should _not_ have\n  both a **More button (...)** and a\n  [drag handle menu button](/components/pragmatic-drag-and-drop/optional-packages/react-accessibility)\n  (an entity should only have one of these).\n- A draggable that does not have a drag handle icon because it is \"implied\" to be draggable (eg a\n  card) should still have a **More button (...)**.\n\n<Example Component={ActionMenuVariants} appearance=\"showcase-only\" />\n\nThis pattern works well for a lot of cases, but there are other cases where this approach is not\nappropriate - for those cases please be driven by what would be best for people using assistive\ntechnologies.\n\n#### Simple cases\n\nWhen there is only a small set of operations possible for an element, and those operations don't\nrequire any input, then we recommend that you add inline menu items for each available outcome (eg\n\"move to top\").\n\n<Example Component={ListExample} appearance=\"showcase-only\" />\n\n#### Complex cases\n\nIf a particular outcome requires additional input, then relevant menu items should trigger a modal\ncontaining a form to gather that additional input from the user.\n\n<Example Component={TreeExample} appearance=\"showcase-only\" />\n\n<SectionMessage>\n\tAn inline menu can also contain a form, but we currently don't have an example of that pattern.\n</SectionMessage>\n\nPackages to help you:\n\n- [Drag handle menu component](/components/pragmatic-drag-and-drop/optional-packages/react-accessibility/drag-handle-button/examples)\n- [popup](/components/popup)\n- [modal-dialog](/components/modal-dialog)\n- [select](/components/select)\n\n[Figma (Atlassians only)](<https://www.figma.com/file/3E3rGPX4YHlVUP3cNyRykB/Pragmatic-Drag-%26-Drop-UI-Kit-(PDND)?type=design&node-id=38%3A5623&mode=design&t=LsTwhMGxMe6t08K3-1>)\n\n### Assistive names\n\nAll interactive elements should have a meaningful name for assistive technology.\n\nEnsure that accessible names for buttons include the name of the element being acted on, for\nexample, “Move task 'clean dishes' to top of backlog”.\n\nFor general guidelines on writing meaningful label text, refer to the\n[accessibility guidelines](/foundations/accessibility/#meaningful-text).\n\n### Avoid directional controls\n\nFor most experiences, we recommend not leveraging directional controls (arrow keys). There are a few\nproblems with this approach:\n\n- Directional arrow movement doesn't always make sense when you can't see the interface you are\n  engaging with.\n- Directional arrow movements require\n  [JAWS screen reader](https://www.freedomscientific.com/products/software/jaws/) users to change\n  screen reader mode to use it\n- Directional movement does not translate well to all experiences\n- Complex operations can require many keystrokes\n- The approach takes a significant amount of code to get working\n\nInstead, use accessible controls.\n\n## 2. Tell the user what they achieved\n\nUse live regions to announce content changes to screen readers. Messages in live regions will be\nannounced by screen reader.\n\nLive regions should provide real-time feedback both during and after an interaction. Messages should\ncontain the name of the item being moved, as well as its old and new position.\n\nTo create live region feedback for interactions, use the\n[live region package](/components/pragmatic-drag-and-drop/optional-packages/live-region).\n\n```ts\nimport { announce } from '@atlaskit/pragmatic-drag-and-drop-live-region';\n\nannounce('Task \"Clean dishes\" moved to list \"Doing\" from \"Todo\".');\n```\n\n## 3. Let the user easily continue to trigger more outcomes\n\nMake it easy for users to continue using the same entity after an action (where applicable). To\nachieve this, focus should move to the original trigger element whenever possible. This prevents\nsomeone needing to navigate back to the same spot.\n\nIf the element no longer exists after the operation, choose a new element using your best judgement.\n\n### Automatic focus restoration\n\nSome frameworks, such as `react`, will automatically restore focus to elements when they are moved\nin some situations. In this `react` example, items can be reordered within a list. When an item is\nmoved using the menu item, focus remains on the drag handle button without us needing to do\nanything. `react` is shifting the element and ensuring that focus is maintained for us.\n\n<Example Component={ListExample} appearance=\"showcase-only\" />\n\n### Manual focus restoration\n\nIf your framework does not automatically restore focus for some situations, then you will need to\nrestore focus yourself.\n\nIn this `react` example, the avatar can move between the two columns by dragging or by pressing the\n**Swap team** button. If the button has focus when it is selected (by pointer or by keyboard), focus\nis restored to it after moving.\n\nThis requires manual focus restoration because the button is moving to a new parent and will\nremount. The button in the new column is not the same DOM element as the original button, so focus\ncan't be preserved automatically.\n\n<Example Component={ManualFocusRestorationExample} appearance=\"showcase-only\" />\n\n## Related\n\n- [Atlassian drag and drop design guidelines](/components/pragmatic-drag-and-drop/design-guidelines)\n- [Accessibility foundation general guidance](/foundations/accessibility/#meaningful-text)\n- [Drag handle menu component](/components/pragmatic-drag-and-drop/optional-packages/react-accessibility/drag-handle-button/examples)\n- [Live region package](/components/pragmatic-drag-and-drop/optional-packages/live-region)\n"
  },
  {
    "path": "packages/documentation/constellation/09-accessibility-guidelines/pattern-table.tsx",
    "content": "import React, { type ReactNode } from 'react';\n\ntype PatternTableProps = {\n\timage: ReactNode;\n\tdescription: string;\n};\n\nconst PatternTable = ({ image, description }: PatternTableProps) => {\n\treturn (\n\t\t<table>\n\t\t\t<tbody>\n\t\t\t\t<tr>\n\t\t\t\t\t<th>Image</th>\n\t\t\t\t\t<td>{image}</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<th>Description</th>\n\t\t\t\t\t<td>{description}</td>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t);\n};\n\nexport default PatternTable;\n"
  },
  {
    "path": "packages/documentation/constellation/assets/check-icon.tsx",
    "content": "import React from 'react';\n\nimport AkCheckIcon from '@atlaskit/icon/core/status-success';\nimport { token } from '@atlaskit/tokens';\n\nexport default function CheckIcon() {\n\treturn <AkCheckIcon spacing=\"spacious\" label=\"supported\" color={token('color.icon.success')} />;\n}\n"
  },
  {
    "path": "packages/documentation/constellation/assets/cross-icon.tsx",
    "content": "import React from 'react';\n\nimport AkCrossIcon from '@atlaskit/icon/core/cross-circle';\nimport { token } from '@atlaskit/tokens';\n\nexport default function CheckIcon() {\n\treturn <AkCrossIcon spacing=\"spacious\" label=\"unsupported\" color={token('color.icon.danger')} />;\n}\n"
  },
  {
    "path": "packages/documentation/constellation/assets/question-icon.tsx",
    "content": "import React from 'react';\n\nimport AkQuestionIcon from '@atlaskit/icon/core/question-circle';\nimport { token } from '@atlaskit/tokens';\n\nexport default function CheckIcon() {\n\treturn (\n\t\t<AkQuestionIcon\n\t\t\tspacing=\"spacious\"\n\t\t\tlabel=\"unknown support\"\n\t\t\tcolor={token('color.icon.accent.gray')}\n\t\t/>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/constellation/assets/result-text.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport { token } from '@atlaskit/tokens';\n\nconst stylesStyles = css({\n\tcolor: token('color.text.success'),\n\tfontWeight: token('font.weight.bold'),\n});\n\nexport default function ResultText({ children }: { children: string }) {\n\treturn <span css={stylesStyles}>{children}</span>;\n}\n"
  },
  {
    "path": "packages/documentation/constellation/assets/warning-icon.tsx",
    "content": "import React from 'react';\n\nimport AkWarningIcon from '@atlaskit/icon/core/status-warning';\nimport { token } from '@atlaskit/tokens';\n\nexport default function CheckIcon() {\n\treturn (\n\t\t<AkWarningIcon spacing=\"spacious\" label=\"partial support\" color={token('color.icon.warning')} />\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/constellation/index/about.mdx",
    "content": "---\norder: 0\n---\n\nimport BoardExample from '../../examples/board';\nimport SectionMessage from '@atlaskit/section-message';\nimport { VideoEmbed } from '@af/design-system-docs-ui';\nimport Hero from './assets/hero';\n\n<Hero />\n\nPragmatic drag and drop is a **performance focused drag and drop library** that can be used to power\n**any drag and drop experience** on **any tech stack**. Pragmatic drag and drop makes working with\nthe browsers powerful and flexible built in drag and drop functionality safe and easy.\n\n<Example Component={BoardExample} appearance=\"showcase-only\" />\n\n## Get started\n\n- Check out our [examples](/components/pragmatic-drag-and-drop/examples) to be inspired\n- Head over to our [tutorial](/components/pragmatic-drag-and-drop/tutorial) to learn about all the\n  pieces\n- Grab the [core package](/components/pragmatic-drag-and-drop/core-package) and start building!\n\n## Capabilities\n\nPragmatic drag and drop consists of a few high level pieces:\n\n1. **Low level drag and drop behavior**\n\nPragmatic drag and drop contains a core package, and a number of optional packages, that provide you\nthe pieces to create _any_ drag and drop experience.\n\nThese pieces are unopinionated about visual language or accessibility, and have no dependency on the\nAtlassian Design System.\n\n- _Tiny_: ~`4.7kB` core\n- _Incremental_: Only use the pieces that you need\n- _Headless_: Full rendering and style control\n- _Framework agnostic_: Works with any frontend framework\n- _Deferred compatible_: Delay the loading the core packages and optional packages in order to\n  further improve page load speeds\n- _Flexible_: create any experience you want, make any changes you want during a drag operation.\n- _Works everywhere_: Full feature support in Firefox, Safari, and Chrome, iOS and Android\n- _Virtualization support_: create any virtual experience you want!\n\n2. **Optional visual outputs**\n\nWe have created optional visual outputs (eg our drop indicator) to make it super fast for us to\nbuild consistent Atlassian user experiences. Non Atlassian consumers are welcome to use these\noutputs, create their own that copy the visual styling, or go a totally different direction.\n\n3. **Optional assistive technology controls**\n\nNot all users can achieve pointer based drag and drop experiences. In order to achieve fantastic\nexperiences for assistive technology users, we provide a toolchain to allow you to quickly wire up\nperformant assistive technology friendly flows for any experience.\n\nThe optional assistive controls we provide are based on the Atlassian Design System. If you do not\nwant to use the Atlassian Design System, you can use our guidelines and substitute our components\nwith your own components, or you can go about accessibility in a different way if you choose.\n\n<details>\n    <summary>Detailed capabilities</summary>\n\n- Supports dragging of any entity types (such as elements, text, images, external files)\n- Any nested configuration of drop targets you like\n- Flexible drop target sizes\n- Can add, remove, or change drop targets while dragging\n- Conditional dropping\n- Automatic scrolling\n- Stickiness: a drop target can maintain selection even after it is no longer being dragged over\n- [`dropEffect`](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer/dropEffect) control\n- High frequency input updates to power high fidelity interactions\n\n(Using the element adapter)\n\n- Drag handles (drag a `draggable` element) by a part of it\n- Conditional dragging\n- Nested `draggable` elements\n- Flexible `draggable` sizes\n- Many options to customize the appearance of the _drag preview_ (the thing that a user drags around\n  during a drag)\n- Can add, remove, or change `draggables` while dragging (even the dragging `draggable`)\n- An element can be a drop target, `draggable` or both\n- An element can be a drop target for different entities (eg `dropTargetForElements` and\n  `dropTargetForExternal`)\n\n</details>\n\n## How it works\n\nA technical explanation of how Pragmatic drag and drop is architected for speed\n\n<VideoEmbed url=\"https://www.youtube.com/embed/5SQkOyzZLHM\" />\n"
  },
  {
    "path": "packages/documentation/constellation/index/assets/hero.tsx",
    "content": "import React, { Fragment, useEffect, useRef, useState } from 'react';\n\nimport { createPortal } from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport { LinkButton } from '@atlaskit/button/new';\nimport ShortcutIcon from '@atlaskit/icon/core/link-external';\nimport { durations, easeInOut } from '@atlaskit/motion';\nimport { autoScrollWindowForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { preserveOffsetOnSource } from '@atlaskit/pragmatic-drag-and-drop/element/preserve-offset-on-source';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Stack, xcss } from '@atlaskit/primitives';\n\nimport Logo from './logo';\n\ntype State = { type: 'idle' } | { type: 'preview'; container: HTMLElement } | { type: 'dragging' };\n\nconst baseStyles = xcss({\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values\n\ttransition: `opacity ${durations.medium}ms ${easeInOut}`,\n});\n\nconst stateStyles: {\n\t[Key in State['type']]: ReturnType<typeof xcss> | undefined;\n} = {\n\tdragging: xcss({\n\t\topacity: 0.4,\n\t}),\n\tidle: xcss({\n\t\tcursor: 'grab',\n\t}),\n\tpreview: undefined,\n};\n\nconst idle: State = { type: 'idle' };\n\nexport default function Hero() {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<State>(idle);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\t\treturn combine(\n\t\t\tdraggable({\n\t\t\t\telement,\n\t\t\t\tgetInitialDataForExternal: () => ({\n\t\t\t\t\t'text/uri-list': window.location.href,\n\t\t\t\t}),\n\t\t\t\tonGenerateDragPreview({ nativeSetDragImage, location }) {\n\t\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\t\tgetOffset: preserveOffsetOnSource({\n\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\tinput: location.current.input,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\t\tsetState({ type: 'preview', container });\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragStart() {\n\t\t\t\t\tsetState({ type: 'dragging' });\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tsetState(idle);\n\t\t\t\t},\n\t\t\t}),\n\t\t\t// enabling window auto scrolling for a bit of delight\n\t\t\tautoScrollWindowForElements({\n\t\t\t\tcanScroll({ source }) {\n\t\t\t\t\treturn source.element === element;\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, []);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<Stack alignInline=\"center\" space=\"space.100\">\n\t\t\t\t<Box ref={ref} xcss={[baseStyles, stateStyles[state.type]]}>\n\t\t\t\t\t<Logo mode=\"standard\" />\n\t\t\t\t</Box>\n\t\t\t\t<LinkButton\n\t\t\t\t\ticonAfter={ShortcutIcon}\n\t\t\t\t\thref=\"https://github.com/atlassian/pragmatic-drag-and-drop\"\n\t\t\t\t>\n\t\t\t\t\tGithub\n\t\t\t\t</LinkButton>\n\t\t\t</Stack>\n\t\t\t{state.type === 'preview' ? createPortal(<Logo mode=\"alternative\" />, state.container) : null}\n\t\t</Fragment>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/constellation/index/assets/logo.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\ntype Mode = 'standard' | 'alternative';\n\nconst styles: { [Key in Mode]: ReturnType<typeof css> } = {\n\tstandard: css({\n\t\t'--line-color': '#4C0394',\n\t\t'--background-color': '#CF9FFF',\n\t\t'--circle-color': '#FF4245',\n\t\t'--tail-color': '#F7ED00',\n\t\t'--overlap-color': '#00EEAA',\n\t}),\n\talternative: css({\n\t\t'--line-color': '#1631E7',\n\t\t'--background-color': '#7284FF',\n\t\t'--circle-color': '#00EEAA',\n\t\t'--tail-color': '#F7ED00',\n\t\t'--overlap-color': '#F64AB0',\n\t}),\n};\n\nexport default function Logo({ mode }: { mode: Mode }) {\n\treturn (\n\t\t<svg\n\t\t\twidth=\"215\"\n\t\t\theight=\"215\"\n\t\t\tviewBox=\"0 0 215 215\"\n\t\t\tfill=\"none\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\tcss={styles[mode]}\n\t\t>\n\t\t\t<path\n\t\t\t\td=\"M149.271 117.641C180.09 104.729 194.606 69.2789 181.694 38.4605C168.782 7.64212 133.332 -6.8741 102.514 6.03763C92.0751 10.411 83.5069 17.3701 77.2412 25.8591C71.5859 23.6547 65.1017 23.5572 59.0613 26.0879L44.2107 32.2357C31.855 37.4123 26.0352 51.6249 31.2117 63.9806L87.6911 198.788C92.8676 211.144 107.08 216.964 119.436 211.787L134.287 205.639C146.642 200.463 152.462 186.25 147.285 173.895L125.693 122.356C133.558 122.385 141.56 120.872 149.271 117.641Z\"\n\t\t\t\tfill=\"var(--background-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M42.1329 61.0116C38.9324 53.3725 42.5306 44.5853 50.1698 41.3848L61.4138 36.6739C69.0529 33.4734 77.8401 37.0717 81.0406 44.7108L137.01 178.3C140.21 185.94 136.612 194.727 128.973 197.927L117.729 202.638C110.09 205.839 101.302 202.24 98.1019 194.601L42.1329 61.0116Z\"\n\t\t\t\tfill=\"var(--tail-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M144.391 109.334C170.156 98.5394 182.292 68.9014 171.498 43.1358C160.703 17.3702 131.065 5.23401 105.299 16.0288C79.5336 26.8236 67.3974 56.4616 78.1922 82.2272C88.987 107.993 118.625 120.129 144.391 109.334ZM129.616 73.8206C135.739 71.2551 138.624 64.2113 136.058 58.0878C133.493 51.9644 126.449 49.0801 120.326 51.6456C114.202 54.211 111.318 61.2548 113.883 67.3783C116.449 73.5018 123.493 76.3861 129.616 73.8206Z\"\n\t\t\t\tfill=\"var(--circle-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M108.457 110.566L80.8532 44.6795C80.3234 43.4149 79.6405 42.261 78.835 41.2304C73.0095 53.704 72.2673 68.4962 78.0061 82.194C83.8436 96.127 95.1912 106.075 108.457 110.566Z\"\n\t\t\t\tfill=\"var(--overlap-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M125.654 2.64514C126.384 2.64248 126.974 2.04819 126.972 1.31775C126.969 0.58732 126.375 -0.00265372 125.644 8.97767e-06C123.853 0.00653953 122.055 0.091455 120.255 0.256728C119.528 0.323526 118.992 0.967332 119.059 1.69471C119.126 2.42209 119.77 2.95759 120.497 2.89079C122.219 2.73265 123.94 2.65139 125.654 2.64514Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M131.035 0.216995C130.307 0.155668 129.667 0.695998 129.606 1.42386C129.545 2.15172 130.085 2.79148 130.813 2.8528C132.532 2.99769 134.241 3.21763 135.934 3.51068C136.653 3.63528 137.338 3.15283 137.462 2.4331C137.587 1.71337 137.105 1.0289 136.385 0.904302C134.617 0.598167 132.832 0.368377 131.035 0.216995Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M115.383 3.58816C116.102 3.45776 116.579 2.76943 116.449 2.05073C116.318 1.33202 115.63 0.855105 114.911 0.9855C113.154 1.30441 111.399 1.70194 109.652 2.17989C108.947 2.37264 108.532 3.10004 108.725 3.80459C108.918 4.50913 109.645 4.92403 110.35 4.73129C112.022 4.27378 113.701 3.89334 115.383 3.58816Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M141.654 2.05481C140.948 1.86811 140.224 2.28923 140.037 2.9954C139.851 3.70158 140.272 4.4254 140.978 4.61209C142.644 5.05253 144.289 5.56496 145.908 6.14738C146.596 6.39461 147.353 6.03784 147.6 5.35051C147.848 4.66319 147.491 3.90558 146.804 3.65835C145.112 3.05006 143.394 2.51485 141.654 2.05481Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M105.431 6.30953C106.117 6.05645 106.467 5.29583 106.214 4.61064C105.961 3.92544 105.2 3.57514 104.515 3.82822C103.675 4.13852 102.838 4.46824 102.004 4.81758C101.149 5.17586 100.306 5.55117 99.4752 5.94295C98.8146 6.25459 98.5317 7.04276 98.8433 7.70338C99.155 8.364 99.9431 8.64691 100.604 8.33527C101.399 7.96005 102.207 7.60053 103.026 7.25726C103.825 6.92255 104.627 6.60671 105.431 6.30953Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M151.795 5.70214C151.131 5.3963 150.346 5.6861 150.04 6.34942C149.734 7.01275 150.024 7.79841 150.687 8.10425C152.25 8.82476 153.782 9.61326 155.278 10.4677C155.913 10.8299 156.72 10.6093 157.083 9.97504C157.445 9.34073 157.224 8.5329 156.59 8.17069C155.027 7.2782 153.427 6.45465 151.795 5.70214Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M95.9165 10.8066C96.5468 10.4374 96.7585 9.62724 96.3894 8.99695C96.0202 8.36665 95.21 8.15496 94.5797 8.52411C92.9754 9.46373 91.426 10.4684 89.9336 11.5331C89.339 11.9574 89.2009 12.7833 89.6252 13.3779C90.0494 13.9725 90.8754 14.1107 91.47 13.6864C92.8981 12.6675 94.3809 11.706 95.9165 10.8066Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M161.153 11.0463C160.552 10.6303 159.728 10.7798 159.312 11.3803C158.896 11.9807 159.046 12.8046 159.646 13.2206C161.059 14.1989 162.431 15.2405 163.758 16.3432C164.32 16.81 165.154 16.733 165.62 16.1711C166.087 15.6093 166.01 14.7754 165.448 14.3087C164.061 13.1564 162.628 12.0683 161.153 11.0463Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M87.3007 16.9546C87.8546 16.4785 87.9177 15.6435 87.4416 15.0895C86.9655 14.5356 86.1305 14.4724 85.5765 14.9485C84.1702 16.1572 82.8257 17.4236 81.5452 18.7425C81.0364 19.2666 81.0488 20.1039 81.5729 20.6127C82.0969 21.1215 82.9342 21.1091 83.4431 20.5851C84.6684 19.323 85.955 18.1112 87.3007 16.9546Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M169.443 17.9348C168.924 17.4206 168.087 17.4243 167.573 17.9431C167.058 18.4619 167.062 19.2993 167.581 19.8135C168.799 21.0203 169.968 22.2849 171.084 23.6054C171.556 24.1632 172.391 24.233 172.948 23.7614C173.506 23.2898 173.576 22.4553 173.104 21.8975C171.937 20.5175 170.715 19.1959 169.443 17.9348Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M79.9274 24.5483C80.3871 23.9806 80.2996 23.1478 79.7319 22.6881C79.1643 22.2284 78.3314 22.316 77.8718 22.8836C77.4992 23.3437 77.1336 23.8087 76.7751 24.2785C76.3195 24.1212 75.8594 23.9767 75.3952 23.8451C74.6925 23.646 73.9613 24.0542 73.7621 24.757C73.563 25.4597 73.9712 26.1909 74.674 26.39C75.3811 26.5905 76.078 26.8245 76.7621 27.0912L77.7054 27.4588L78.3066 26.6443C78.8305 25.9345 79.3709 25.2356 79.9274 24.5483Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M70.5688 22.9652C68.949 22.8283 67.3061 22.8455 65.6615 23.0255C64.9354 23.105 64.4112 23.758 64.4907 24.4841C64.5702 25.2102 65.2233 25.7344 65.9494 25.6549C67.4224 25.4937 68.8944 25.4783 70.3462 25.6009C71.074 25.6624 71.7139 25.1222 71.7754 24.3944C71.8369 23.6665 71.2967 23.0266 70.5688 22.9652Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M61.6442 26.553C62.3416 26.3359 62.7309 25.5945 62.5137 24.8971C62.2966 24.1997 61.5552 23.8103 60.8577 24.0275C60.0844 24.2683 59.3158 24.5478 58.5542 24.8668L58.5514 24.8679L56.7003 25.6342C56.0254 25.9136 55.7048 26.6872 55.9842 27.3621C56.2636 28.037 57.0372 28.3576 57.7121 28.0782L59.5684 27.3097L59.5736 27.3076C60.2588 27.0205 60.9497 26.7693 61.6442 26.553Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M176.402 26.1649C175.981 25.5679 175.156 25.4251 174.559 25.8459C173.962 26.2668 173.819 27.0919 174.24 27.6889C175.225 29.0862 176.155 30.5352 177.027 32.0342C177.394 32.6658 178.203 32.8802 178.835 32.5132C179.466 32.1462 179.681 31.3367 179.314 30.7051C178.404 29.1391 177.432 27.6251 176.402 26.1649Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M53.9994 29.6152C54.6743 29.3358 54.9949 28.5622 54.7155 27.8873C54.4362 27.2124 53.6626 26.8918 52.9877 27.1711L49.275 28.7081C48.6001 28.9875 48.2795 29.7611 48.5589 30.436C48.8383 31.1109 49.6119 31.4315 50.2868 31.1521L53.9994 29.6152Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M46.5741 32.689C47.249 32.4097 47.5696 31.6361 47.2903 30.9612C47.0109 30.2863 46.2373 29.9656 45.5624 30.245L43.706 31.0135L43.7009 31.0157C42.9212 31.3423 42.1658 31.7033 41.4359 32.0962C40.7927 32.4423 40.552 33.2444 40.8981 33.8876C41.2443 34.5308 42.0464 34.7715 42.6896 34.4254C43.3433 34.0735 44.0204 33.7498 44.72 33.4566L44.723 33.4554L46.5741 32.689Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M38.9596 36.9343C39.5225 36.4689 39.6015 35.6352 39.136 35.0723C38.6706 34.5093 37.8369 34.4304 37.274 34.8958C35.9708 35.9734 34.7905 37.1686 33.7426 38.4583C33.282 39.0252 33.3682 39.8582 33.9351 40.3188C34.502 40.7794 35.335 40.6933 35.7956 40.1264C36.7348 38.9704 37.7923 37.8996 38.9596 36.9343Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M181.819 35.4828C181.508 34.8218 180.72 34.538 180.059 34.8489C179.398 35.1598 179.115 35.9477 179.425 36.6087C179.791 37.3848 180.141 38.1725 180.475 38.9714C180.81 39.7703 181.126 40.5723 181.423 41.3769C181.676 42.0621 182.437 42.4124 183.122 42.1593C183.807 41.9062 184.158 41.1456 183.904 40.4604C183.594 39.6203 183.264 38.7831 182.915 37.9492C182.566 37.1154 182.2 36.2932 181.819 35.4828Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M33.3157 43.8773C33.657 43.2316 33.4103 42.4314 32.7645 42.09C32.1187 41.7486 31.3185 41.9954 30.9772 42.6412C30.1945 44.1219 29.5579 45.6764 29.0773 47.2808C28.8677 47.9805 29.2651 48.7176 29.9648 48.9272C30.6645 49.1368 31.4016 48.7395 31.6112 48.0398C32.0424 46.6004 32.6135 45.2057 33.3157 43.8773Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M185.553 45.5971C185.36 44.8926 184.633 44.4777 183.928 44.6704C183.224 44.8631 182.809 45.5905 183.001 46.2951C183.459 47.9674 183.839 49.6468 184.145 51.3288C184.275 52.0476 184.963 52.5245 185.682 52.3941C186.401 52.2637 186.878 51.5753 186.747 50.8566C186.428 49.0989 186.031 47.3442 185.553 45.5971Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M30.7481 52.4528C30.8174 51.7257 30.2841 51.08 29.5569 51.0108C28.8298 50.9415 28.1842 51.4748 28.1149 52.2019C27.9573 53.8562 27.9603 55.5359 28.1334 57.2181C28.2082 57.9447 28.8579 58.4731 29.5845 58.3983C30.3111 58.3235 30.8395 57.6738 30.7647 56.9472C30.6096 55.4405 30.6068 53.9355 30.7481 52.4528Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M187.476 56.2005C187.409 55.4731 186.765 54.9376 186.038 55.0044C185.311 55.0712 184.775 55.715 184.842 56.4424C185 58.1644 185.081 59.8849 185.088 61.5993C185.09 62.3297 185.685 62.9197 186.415 62.917C187.145 62.9144 187.735 62.3201 187.733 61.5896C187.726 59.7981 187.641 58.0001 187.476 56.2005Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M31.6637 61.3517C31.4481 60.6538 30.7075 60.2629 30.0096 60.4786C29.3117 60.6943 28.9208 61.4348 29.1365 62.1327C29.3813 62.9247 29.6665 63.7117 29.9932 64.4914L31.0017 66.8987C31.284 67.5724 32.0589 67.8897 32.7326 67.6075C33.4063 67.3252 33.7237 66.5503 33.4414 65.8766L32.4328 63.4693C32.1393 62.7686 31.8833 62.062 31.6637 61.3517Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M187.516 66.9802C187.577 66.2524 187.037 65.6126 186.309 65.5513C185.581 65.49 184.941 66.0303 184.88 66.7581C184.735 68.4777 184.515 70.1863 184.222 71.879C184.097 72.5988 184.58 73.2832 185.3 73.4078C186.019 73.5324 186.704 73.05 186.828 72.3302C187.135 70.5619 187.364 68.7769 187.516 66.9802Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M35.4585 70.6911C35.1763 70.0174 34.4013 69.7001 33.7276 69.9824C33.0539 70.2646 32.7366 71.0396 33.0188 71.7133L35.036 76.5278C35.3182 77.2015 36.0932 77.5189 36.7669 77.2366C37.4406 76.9544 37.7579 76.1794 37.4756 75.5057L35.4585 70.6911Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M185.678 77.5995C185.865 76.8934 185.443 76.1695 184.737 75.9828C184.031 75.7962 183.307 76.2173 183.121 76.9234C182.68 78.5894 182.168 80.2344 181.585 81.8536C181.338 82.5409 181.695 83.2986 182.382 83.5458C183.07 83.793 183.827 83.4362 184.074 82.7489C184.683 81.0577 185.218 79.3396 185.678 77.5995Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M39.4928 80.3203C39.2105 79.6466 38.4355 79.3292 37.7618 79.6115C37.0881 79.8937 36.7708 80.6687 37.0531 81.3424L39.0702 86.157C39.3524 86.8307 40.1274 87.148 40.8011 86.8657C41.4748 86.5835 41.7921 85.8085 41.5099 85.1348L39.4928 80.3203Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M182.031 87.7401C182.336 87.0767 182.047 86.2911 181.383 85.9852C180.72 85.6794 179.934 85.9692 179.628 86.6325C178.908 88.1952 178.119 89.7272 177.265 91.2236C176.903 91.8579 177.123 92.6657 177.758 93.0279C178.392 93.3901 179.2 93.1695 179.562 92.5352C180.455 90.9723 181.278 89.3722 182.031 87.7401Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M43.527 89.9494C43.2447 89.2757 42.4698 88.9584 41.7961 89.2406C41.1224 89.5229 40.8051 90.2978 41.0873 90.9715L43.1044 95.7861C43.3867 96.4598 44.1616 96.7771 44.8353 96.4949C45.509 96.2126 45.8264 95.4377 45.5441 94.764L43.527 89.9494Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M176.686 97.0981C177.102 96.4977 176.953 95.6738 176.352 95.2578C175.752 94.8418 174.928 94.9913 174.512 95.5918C173.534 97.0039 172.492 98.376 171.389 99.7034C170.923 100.265 171 101.099 171.562 101.566C172.123 102.033 172.957 101.956 173.424 101.394C174.576 100.007 175.664 98.5733 176.686 97.0981Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M47.5612 99.5785C47.279 98.9048 46.504 98.5875 45.8303 98.8697C45.1566 99.152 44.8393 99.9269 45.1215 100.601L47.1387 105.415C47.4209 106.089 48.1959 106.406 48.8696 106.124C49.5433 105.842 49.8606 105.067 49.5783 104.393L47.5612 99.5785Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M169.798 105.388C170.312 104.87 170.308 104.032 169.79 103.518C169.271 103.004 168.433 103.007 167.919 103.526C166.712 104.744 165.448 105.913 164.127 107.03C163.57 107.501 163.5 108.336 163.971 108.894C164.443 109.452 165.277 109.521 165.835 109.05C167.215 107.883 168.537 106.661 169.798 105.388Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M51.5955 109.208C51.3132 108.534 50.5383 108.217 49.8646 108.499C49.1909 108.781 48.8735 109.556 49.1558 110.23L51.1729 115.044C51.4552 115.718 52.2301 116.035 52.9038 115.753C53.5775 115.471 53.8948 114.696 53.6126 114.022L51.5955 109.208Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M161.568 112.348C162.165 111.927 162.308 111.102 161.887 110.505C161.466 109.908 160.641 109.765 160.044 110.186C158.647 111.171 157.198 112.101 155.698 112.972C155.067 113.339 154.853 114.149 155.22 114.78C155.587 115.412 156.396 115.626 157.028 115.259C158.594 114.349 160.108 113.377 161.568 112.348Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M152.25 117.764C152.911 117.454 153.195 116.666 152.884 116.005C152.573 115.344 151.785 115.06 151.124 115.371C150.348 115.736 149.56 116.086 148.761 116.421C147.846 116.804 146.926 117.163 146.003 117.497C145.317 117.746 144.962 118.505 145.21 119.191C145.459 119.878 146.218 120.233 146.904 119.984C147.868 119.635 148.828 119.261 149.784 118.861C150.617 118.511 151.44 118.146 152.25 117.764Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M55.6297 118.837C55.3474 118.163 54.5725 117.846 53.8988 118.128C53.2251 118.41 52.9078 119.185 53.19 119.859L55.2071 124.673C55.4894 125.347 56.2643 125.664 56.938 125.382C57.6117 125.1 57.9291 124.325 57.6468 123.651L55.6297 118.837Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M140.995 121.798C141.704 121.619 142.132 120.9 141.953 120.192C141.774 119.484 141.054 119.055 140.346 119.234C138.418 119.722 136.483 120.109 134.545 120.396C133.823 120.504 133.324 121.176 133.431 121.899C133.539 122.621 134.211 123.12 134.934 123.013C136.958 122.712 138.981 122.308 140.995 121.798Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M128.78 123.612C129.51 123.578 130.074 122.959 130.04 122.229C130.006 121.499 129.387 120.936 128.657 120.97C127.669 121.016 126.683 121.037 125.699 121.033L123.703 121.025L125.554 125.444C125.836 126.117 126.611 126.435 127.285 126.152C127.958 125.87 128.276 125.095 127.993 124.421L127.672 123.653C128.041 123.643 128.411 123.629 128.78 123.612Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M59.6639 128.466C59.3817 127.792 58.6067 127.475 57.933 127.757C57.2593 128.039 56.942 128.814 57.2242 129.488L59.2414 134.303C59.5236 134.976 60.2986 135.294 60.9723 135.011C61.646 134.729 61.9633 133.954 61.681 133.28L59.6639 128.466Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M130.153 129.575C129.87 128.902 129.095 128.584 128.422 128.866C127.748 129.149 127.431 129.924 127.713 130.597L129.872 135.751C130.154 136.425 130.929 136.742 131.603 136.46C132.277 136.178 132.594 135.403 132.312 134.729L130.153 129.575Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M63.6982 138.095C63.4159 137.421 62.641 137.104 61.9673 137.386C61.2936 137.668 60.9762 138.443 61.2585 139.117L63.2756 143.932C63.5579 144.605 64.3328 144.923 65.0065 144.64C65.6802 144.358 65.9975 143.583 65.7153 142.91L63.6982 138.095Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M134.471 139.883C134.189 139.209 133.414 138.892 132.74 139.174C132.067 139.457 131.749 140.231 132.032 140.905L134.191 146.059C134.473 146.733 135.248 147.05 135.922 146.768C136.595 146.486 136.913 145.711 136.63 145.037L134.471 139.883Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M67.7324 147.724C67.4501 147.05 66.6752 146.733 66.0015 147.015C65.3278 147.298 65.0105 148.073 65.2927 148.746L67.3098 153.561C67.5921 154.235 68.367 154.552 69.0407 154.27C69.7144 153.987 70.0318 153.212 69.7495 152.539L67.7324 147.724Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M138.79 150.191C138.507 149.517 137.733 149.2 137.059 149.482C136.385 149.764 136.068 150.539 136.35 151.213L138.509 156.367C138.792 157.041 139.567 157.358 140.24 157.076C140.914 156.793 141.231 156.018 140.949 155.345L138.79 150.191Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M71.7666 157.353C71.4844 156.68 70.7094 156.362 70.0357 156.644C69.362 156.927 69.0447 157.702 69.327 158.375L71.3441 163.19C71.6263 163.864 72.4013 164.181 73.075 163.899C73.7487 163.616 74.066 162.842 73.7838 162.168L71.7666 157.353Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M143.108 160.499C142.826 159.825 142.051 159.508 141.377 159.79C140.704 160.072 140.386 160.847 140.669 161.521L142.828 166.675C143.11 167.348 143.885 167.666 144.559 167.383C145.233 167.101 145.55 166.326 145.268 165.652L143.108 160.499Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M75.8009 166.982C75.5186 166.309 74.7437 165.991 74.07 166.274C73.3963 166.556 73.0789 167.331 73.3612 168.005L75.3783 172.819C75.6606 173.493 76.4355 173.81 77.1092 173.528C77.7829 173.246 78.1002 172.471 77.818 171.797L75.8009 166.982Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M147.427 170.806C147.145 170.133 146.37 169.815 145.696 170.098C145.022 170.38 144.705 171.155 144.987 171.828L146.067 174.405C146.36 175.106 146.616 175.813 146.836 176.523C147.052 177.221 147.792 177.612 148.49 177.396C149.188 177.18 149.579 176.44 149.363 175.742C149.118 174.95 148.833 174.163 148.507 173.383L147.427 170.806Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M79.8351 176.611C79.5528 175.938 78.7779 175.62 78.1042 175.903C77.4305 176.185 77.1132 176.96 77.3954 177.634L79.4125 182.448C79.6948 183.122 80.4697 183.439 81.1434 183.157C81.8172 182.875 82.1345 182.1 81.8522 181.426L79.8351 176.611Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M150.366 180.657C150.291 179.93 149.642 179.402 148.915 179.476C148.189 179.551 147.66 180.201 147.735 180.927C147.89 182.434 147.893 183.939 147.752 185.422C147.682 186.149 148.216 186.795 148.943 186.864C149.67 186.933 150.316 186.4 150.385 185.673C150.542 184.019 150.539 182.339 150.366 180.657Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M83.8693 186.241C83.5871 185.567 82.8121 185.25 82.1384 185.532C81.4647 185.814 81.1474 186.589 81.4297 187.263L83.4468 192.077C83.729 192.751 84.504 193.068 85.1777 192.786C85.8514 192.504 86.1687 191.729 85.8865 191.055L83.8693 186.241Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M149.422 190.594C149.632 189.894 149.235 189.157 148.535 188.947C147.835 188.738 147.098 189.135 146.888 189.835C146.457 191.274 145.886 192.669 145.184 193.997C144.843 194.643 145.089 195.443 145.735 195.785C146.381 196.126 147.181 195.879 147.523 195.234C148.305 193.753 148.942 192.198 149.422 190.594Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M87.9036 195.87C87.6213 195.196 86.8464 194.879 86.1727 195.161C85.499 195.443 85.1816 196.218 85.4639 196.892L86.4724 199.299C86.7991 200.079 87.1601 200.834 87.5529 201.564C87.8991 202.207 88.7012 202.448 89.3444 202.102C89.9876 201.756 90.2283 200.954 89.8821 200.31C89.5298 199.656 89.2057 198.978 88.9121 198.277L87.9036 195.87Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M144.757 199.416C145.218 198.849 145.131 198.017 144.565 197.556C143.998 197.095 143.165 197.181 142.704 197.748C141.765 198.904 140.707 199.975 139.54 200.94C138.977 201.406 138.898 202.24 139.364 202.802C139.829 203.365 140.663 203.444 141.226 202.979C142.529 201.901 143.709 200.706 144.757 199.416Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M137.064 205.779C137.707 205.432 137.948 204.63 137.602 203.987C137.255 203.344 136.453 203.103 135.81 203.449C135.157 203.801 134.48 204.125 133.78 204.418L133.777 204.419L131.926 205.186C131.251 205.465 130.93 206.239 131.209 206.914C131.489 207.588 132.262 207.909 132.937 207.63L134.794 206.861L134.799 206.859C135.578 206.532 136.334 206.171 137.064 205.779Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M92.3911 204.04C91.9256 203.477 91.092 203.398 90.529 203.864C89.9661 204.329 89.8871 205.163 90.3526 205.726C91.4302 207.029 92.6254 208.209 93.9151 209.257C94.482 209.718 95.315 209.632 95.7756 209.065C96.2362 208.498 96.15 207.665 95.5831 207.204C94.4272 206.265 93.3564 205.208 92.3911 204.04Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M129.225 209.167C129.9 208.887 130.22 208.114 129.941 207.439C129.661 206.764 128.888 206.443 128.213 206.723L124.5 208.26C123.825 208.539 123.505 209.313 123.784 209.987C124.064 210.662 124.837 210.983 125.512 210.704L129.225 209.167Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M99.3341 209.684C98.6884 209.343 97.8881 209.59 97.5468 210.236C97.2054 210.881 97.4522 211.682 98.098 212.023C99.5787 212.806 101.133 213.442 102.738 213.923C103.437 214.132 104.174 213.735 104.384 213.035C104.594 212.336 104.196 211.598 103.497 211.389C102.057 210.958 100.663 210.387 99.3341 209.684Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M121.799 212.241C122.474 211.961 122.795 211.188 122.515 210.513C122.236 209.838 121.462 209.517 120.788 209.797L118.931 210.565L118.926 210.567C118.225 210.861 117.519 211.117 116.808 211.336C116.111 211.552 115.72 212.293 115.935 212.99C116.151 213.688 116.892 214.079 117.589 213.863C118.38 213.619 119.166 213.334 119.944 213.008L119.948 213.007L121.799 212.241Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M112.675 214.867C113.401 214.792 113.93 214.142 113.855 213.416C113.78 212.689 113.131 212.161 112.404 212.235C110.897 212.39 109.392 212.393 107.91 212.252C107.182 212.183 106.537 212.716 106.468 213.443C106.398 214.17 106.932 214.816 107.659 214.885C109.313 215.043 110.993 215.04 112.675 214.867Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M131.161 77.5096C139.322 74.0905 143.166 64.703 139.747 56.5421C136.328 48.3812 126.94 44.5372 118.78 47.9563C110.619 51.3754 106.775 60.7629 110.194 68.9238C113.613 77.0848 123 80.9288 131.161 77.5096ZM129.616 73.8204C135.739 71.255 138.623 64.2112 136.058 58.0877C133.492 51.9643 126.449 49.08 120.325 51.6455C114.202 54.2109 111.317 61.2547 113.883 67.3782C116.448 73.5017 123.492 76.3859 129.616 73.8204Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\tfillRule=\"evenodd\"\n\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\td=\"M79.0211 41.2628C74.9609 36.0674 67.7868 34.0039 61.4121 36.6746L50.1681 41.3855C42.529 44.586 38.9308 53.3732 42.1313 61.0123L98.1003 194.602C101.301 202.241 110.088 205.839 117.727 202.639L128.971 197.928C136.61 194.728 140.208 185.94 137.008 178.301L108.643 110.599C119.909 114.413 132.558 114.291 144.39 109.334C170.156 98.5393 182.292 68.9013 171.497 43.1357C160.702 17.3701 131.064 5.2339 105.299 16.0287C93.2313 21.0845 84.1535 30.2738 79.0211 41.2628ZM167.808 44.6813C177.749 68.4094 166.573 95.7038 142.845 105.645C130.734 110.719 117.695 110.292 106.508 105.503L81.4609 45.7186C85.8934 34.3856 94.7342 24.7916 106.844 19.7179C130.573 9.7767 157.867 20.9532 167.808 44.6813ZM81.881 80.6815C85.8518 90.1593 92.5914 97.6346 100.766 102.561L79.5304 51.8742C77.3086 61.1568 77.9101 71.2036 81.881 80.6815ZM76.9693 45.7875C76.9932 45.7198 77.0173 45.6522 77.0415 45.5846C74.4771 40.4479 68.3302 38.113 62.9577 40.3638L51.7137 45.0746C46.1121 47.4215 43.4736 53.8651 45.8205 59.4667L101.789 193.056C104.136 198.658 110.58 201.297 116.182 198.95L127.426 194.239C133.027 191.892 135.666 185.448 133.319 179.847L103.458 108.573C103.386 108.54 103.315 108.507 103.243 108.473C92.2528 103.341 83.0621 94.2628 78.0057 82.194C72.9515 70.1302 72.9242 57.2175 76.9693 45.7875Z\"\n\t\t\t\tfill=\"var(--line-color)\"\n\t\t\t/>\n\t\t</svg>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/constellation/index/comparison.mdx",
    "content": "---\norder: 3\n---\n\nimport CheckIcon from '../assets/check-icon';\nimport CrossIcon from '../assets/cross-icon';\nimport QuestionIcon from '../assets/question-icon';\nimport ResultText from '../assets/result-text';\n\n## Performance comparison\n\nPragmatic drag and drop has been optimized for performance. Truly comparing drag and drop solutions\nis problematic as there is inevitably tradeoffs that solutions make (feature set, quality, visual\nexperience and so on).\n\nIn order to try make a reasonable comparison, we have compared the performance of the\n[same complete example (including accessibility)](https://drag-and-drop-performance-comparison.vercel.app/),\nwith drag and drop powered by different drag and drop solutions.\n\n<img src=\"/images/drag-and-drop--board-comparison.png\" />\n\n#### Comparison: Startup time\n\n###### Measure: Time to interactive (TTI) - Mobile\n\n| Case                                             | Result   |\n| ------------------------------------------------ | -------- |\n| Baseline (no drag and drop)                      | `+0ms`   |\n| `react-beautiful-dnd`                            | `+275ms` |\n| `react-dnd`                                      | `+387ms` |\n| `@dnd-kit`                                       | `+131ms` |\n| <ResultText>Pragmatic drag and drop</ResultText> | `+6ms`   |\n\n###### Measure: Time to interactive (TTI) - Desktop\n\n| Case                                             | Result   |\n| ------------------------------------------------ | -------- |\n| Baseline (no drag and drop)                      | `+0ms`   |\n| `react-beautiful-dnd`                            | `+180ms` |\n| `react-dnd`                                      | `+166ms` |\n| `@dnd-kit`                                       | `+129ms` |\n| <ResultText>Pragmatic drag and drop</ResultText> | `+1ms`   |\n\n<details>\n    <summary>Details</summary>\n\n###### Method\n\n- Measured using our baseline board example with 48 cards spread over 3 columns\n- 140 runs per URL on the mobile throttling preset\n- 140 runs per URL on the desktop throttling preset\n- A new Chrome instance when a URL or throttle preset changed\n- Runs done in sequence to reduce noise (the job took 5 hours to run!)\n- p50 result (the median) selected after extreme outliers were removed (a value more than 3 standard\n  deviations away from the average)\n\n###### Environment\n\n- GitHub hosted runner\n  - `ubuntu-latest` (Ubuntu `22.04`)\n    - 2-core CPU (x86_64)\n    - `7GB` of RAM\n    - `14GB` of SSD space\n- Lighthouse `9.6.7`\n- Chrome `106.0.5249.91`\n- Next.js `12.3.1`\n- React `18.2.0`\n- Hosted on [vercel](https://vercel.com/)\n\n</details>\n\n#### Comparison: Server side rendering\n\n| Case                                             | Result   | Difference |\n| ------------------------------------------------ | -------- | ---------- |\n| Baseline (no drag and drop)                      | `11.2ms` | `+0ms`     |\n| `react-beautiful-dnd`                            | `22.1ms` | `+10.9ms`  |\n| `react-dnd`                                      | `16.2ms` | `+5ms`     |\n| <ResultText>Pragmatic drag and drop</ResultText> | `11.3ms` | `+0.1ms`   |\n\n<details>\n    <summary>Details</summary>\n\n- Measured using our baseline board example with 99 cards spread over 3 columns.\n- Tested on an Apple M1\n- 6x CPU slowdown applied (the M1 is a beast)\n- Using `react@16`\n- Measured `ReactServer.renderToString()` locally using `storybook-addon-performance` (10 samples\n  per variant)\n\n</details>\n\n## Feature set comparison\n\n| Drag and drop library                           | Pragmatic drag and drop<br/>(element adapter) | React Beautiful DnD | React DnD<br/>(+ `react-dnd-html5-backend`) | DnD kit<br/>(+ `@dnd-kit/modifiers` + `@dnd-kit/sortable`) | Draggable (Shopify) |\n| ----------------------------------------------- | --------------------------------------------- | ------------------- | ------------------------------------------- | ---------------------------------------------------------- | ------------------- |\n| Size (gzip)                                     | 4.7 kB                                        | 31 kB               | 24.8 kB                                     | 26.9 kB                                                    | 11.8 kB             |\n| Size (minified)                                 | 13.5 kB                                       | 105 kB              | 49.6 kB                                     | 56.1 kB                                                    | 68.2kB              |\n| Supports deferred loading                       | <CheckIcon />                                 | <CrossIcon/>        | <CrossIcon/>                                | <CrossIcon/>                                               | <CheckIcon/>        |\n| Accessible                                      | <CheckIcon/> (with provided toolchain)        | <CheckIcon/>        | <CrossIcon/>                                | <CheckIcon/>                                               | <CrossIcon/>        |\n| Pseudomorphism affordances                      | <CrossIcon/> (uses lines and color)           | <CheckIcon/>        | <CrossIcon/> (up to consumer)               | <CheckIcon/>                                               | <CheckIcon/>        |\n| Incremental<br/>(performance for what you use)  | <CheckIcon/>                                  | <CrossIcon/>        | <CrossIcon/>                                | <CheckIcon/>                                               | <CheckIcon/>        |\n| Framework compatibility                         | Any                                           | React only          | React only                                  | React only                                                 | Any                 |\n| Controls dragging item's movement<br/>(\"rails\") | <CrossIcon/> (defer to web platform)          | <CheckIcon/>        | <CheckIcon/>                                | <CheckIcon/>                                               | <CheckIcon/>        |\n| Drags elements                                  | <CheckIcon/>                                  | <CheckIcon/>        | <CheckIcon/>                                | <CheckIcon/>                                               | <CheckIcon/>        |\n| Handles file drops                              | <CheckIcon/>                                  | <CrossIcon/>        | <CheckIcon/>                                | <CrossIcon/>                                               | <CrossIcon/>        |\n| Handles URL, text, image dragging               | <CheckIcon/>                                  | <CrossIcon/>        | <CheckIcon/>                                | <CrossIcon/>                                               | <CrossIcon/>        |\n| Drags across browser windows                    | <CheckIcon/>                                  | <CrossIcon/>        | <CrossIcon/>                                | <CrossIcon/>                                               | <CrossIcon/>        |\n| Can change DOM during a drag                    | <CheckIcon/>                                  | <CrossIcon/>        | <QuestionIcon />                            | <QuestionIcon />                                           | <QuestionIcon />    |\n| Powers drawing interaction                      | <CheckIcon/>                                  | <CrossIcon/>        | <QuestionIcon />                            | <QuestionIcon />                                           | <QuestionIcon />    |\n"
  },
  {
    "path": "packages/documentation/constellation/index/props.mdx",
    "content": ""
  },
  {
    "path": "packages/documentation/examples/board-with-multi-drag.tsx",
    "content": "import React, { useEffect, useState } from 'react';\n\nimport invariant from 'tiny-invariant';\n\nimport { extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport type { Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/types';\nimport { getReorderDestinationIndex } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index';\nimport { reorderWithEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/reorder-with-edge';\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nimport { type ColumnMap, type ColumnType, getBasicData, type Person } from './data/people';\nimport Board from './pieces/board-with-multi-drag/board';\nimport { Column } from './pieces/board-with-multi-drag/column';\n\nconst getHomeColumn = ({\n\tcolumnMap,\n\torderedColumnIds,\n\tuserId,\n}: {\n\tcolumnMap: ColumnMap;\n\torderedColumnIds: string[];\n\tuserId: string;\n}) => {\n\tconst columnId = orderedColumnIds.find((id) =>\n\t\tcolumnMap[id].items.some((item) => item.userId === userId),\n\t);\n\tinvariant(columnId, 'Count not find column for user');\n\treturn columnMap[columnId];\n};\n\nconst multiSelect = ({\n\tcolumnMap,\n\torderedColumnIds,\n\tselectedUserIds,\n\tuserId,\n}: {\n\tcolumnMap: ColumnMap;\n\torderedColumnIds: string[];\n\tselectedUserIds: string[];\n\tuserId: string;\n}) => {\n\tconst columnOfNew = getHomeColumn({\n\t\tcolumnMap,\n\t\torderedColumnIds,\n\t\tuserId,\n\t});\n\tconst indexOfNew = columnOfNew.items.findIndex((item) => item.userId === userId);\n\n\t// if no items selected, select everything in the column up to the index of the current item\n\tif (!selectedUserIds.length) {\n\t\treturn columnOfNew.items.slice(0, indexOfNew + 1).map((item) => item.userId);\n\t}\n\n\tconst lastSelected = selectedUserIds[selectedUserIds.length - 1];\n\tconst columnOfLast = getHomeColumn({\n\t\tcolumnMap,\n\t\torderedColumnIds,\n\t\tuserId: lastSelected,\n\t});\n\tconst indexOfLast = columnOfLast.items.findIndex((item) => item.userId === lastSelected);\n\n\t// multi selecting to another column\n\t// select everything up to the index of the current item\n\tif (columnOfNew !== columnOfLast) {\n\t\treturn columnOfNew.items.slice(0, indexOfNew + 1).map((item) => item.userId);\n\t}\n\n\t// multi selecting in the same column\n\t// need to select everything between the last index and the current index inclusive\n\n\t// nothing to do here\n\tif (indexOfNew === indexOfLast) {\n\t\treturn;\n\t}\n\n\tconst isSelectingForwards = indexOfNew > indexOfLast;\n\tconst start = isSelectingForwards ? indexOfLast : indexOfNew;\n\tconst end = isSelectingForwards ? indexOfNew : indexOfLast;\n\tconst inBetween = columnOfNew.items.slice(start, end + 1).map((item) => item.userId);\n\n\t// everything inbetween needs to have it's selection toggled.\n\t// with the exception of the start and end values which will always be selected\n\tconst toAdd = inBetween.filter((userId) => !selectedUserIds.includes(userId));\n\tconst sorted = isSelectingForwards ? toAdd : [...toAdd].reverse();\n\n\treturn [...selectedUserIds, ...sorted];\n};\n\nconst withNewItems = (column: ColumnType, items: Person[]): ColumnType => ({\n\tcolumnId: column.columnId,\n\ttitle: column.title,\n\titems,\n});\n\ntype SortUserIdsArgs = {\n\tdraggedItemId: string;\n\tdata: { columnMap: ColumnMap; orderedColumnIds: string[] };\n\tselectedUserIds: string[];\n};\n\nconst sortUserIds = ({ draggedItemId, data, selectedUserIds }: SortUserIdsArgs): string[] => {\n\treturn [...selectedUserIds].sort((a: string, b: string) => {\n\t\t// moving the dragged item to the top of the list\n\t\tif (a === draggedItemId) {\n\t\t\treturn -1;\n\t\t}\n\t\tif (b === draggedItemId) {\n\t\t\treturn 1;\n\t\t}\n\n\t\tconst columnA = data.orderedColumnIds.find((columnId) =>\n\t\t\tdata.columnMap[columnId].items.some((i) => i.userId === a),\n\t\t);\n\t\tconst columnB = data.orderedColumnIds.find((columnId) =>\n\t\t\tdata.columnMap[columnId].items.some((i) => i.userId === b),\n\t\t);\n\t\tconst aIndex = data.columnMap[columnA!].items.findIndex((i) => i.userId === a);\n\t\tconst bIndex = data.columnMap[columnB!].items.findIndex((i) => i.userId === b);\n\t\tif (aIndex !== bIndex) {\n\t\t\treturn aIndex - bIndex;\n\t\t}\n\n\t\t// sorting by their order in the selectedUserIds list\n\t\treturn -1;\n\t});\n};\n\ntype MultiDragReorderArgs = {\n\tdata: { columnMap: ColumnMap; orderedColumnIds: string[] };\n\tselectedUserIds: string[];\n\tdraggedItemId: string;\n\tdestinationColumnId: string;\n\tfinalIndex: number;\n};\n\nconst multiDragReorder = ({\n\tdata,\n\tselectedUserIds,\n\tdraggedItemId,\n\tdestinationColumnId,\n\tfinalIndex,\n}: MultiDragReorderArgs) => {\n\t// 1. Remove all selected items from their columns\n\tconst withRemovedItems = data.orderedColumnIds.reduce((acc, columnId) => {\n\t\tconst column = data.columnMap[columnId];\n\t\tconst items = column.items.filter((item) => !selectedUserIds.includes(item.userId));\n\t\treturn {\n\t\t\t...acc,\n\t\t\t[columnId]: withNewItems(column, items),\n\t\t};\n\t}, {} as ColumnMap);\n\n\t// 2. Calculate the new order of items (sort selectedUserIds by their index in their own column)\n\tconst orderedSelectedUserIds = sortUserIds({\n\t\tdata,\n\t\tdraggedItemId,\n\t\tselectedUserIds,\n\t});\n\n\tconst orderedSelectedItems = orderedSelectedUserIds.map(\n\t\t(id) =>\n\t\t\tgetHomeColumn({\n\t\t\t\tcolumnMap: data.columnMap,\n\t\t\t\torderedColumnIds: data.orderedColumnIds,\n\t\t\t\tuserId: id,\n\t\t\t}).items.find((i) => i.userId === id)!,\n\t);\n\n\t// 3. Insert them back in at the correct index\n\tconst final: ColumnType = withRemovedItems[destinationColumnId];\n\tconst withInserted = (() => {\n\t\tconst base = [...final.items];\n\t\tbase.splice(finalIndex, 0, ...orderedSelectedItems);\n\t\treturn base;\n\t})();\n\n\tconst withAddedTasks = {\n\t\t...withRemovedItems,\n\t\t[destinationColumnId]: withNewItems(final, withInserted),\n\t};\n\n\treturn {\n\t\treorderedColumnMap: withAddedTasks,\n\t\torderedSelectedUserIds,\n\t};\n};\n\nexport default function BoardExample(): React.JSX.Element {\n\tconst [data, setData] = useState<{\n\t\tcolumnMap: ColumnMap;\n\t\torderedColumnIds: string[];\n\t}>(() => getBasicData());\n\tconst [selectedUserIds, setSelectedUserIds] = useState<string[]>([]);\n\tconst [isDraggingCard, setIsDraggingCard] = useState(false);\n\n\tuseEffect(() => {\n\t\treturn monitorForElements({\n\t\t\tonGenerateDragPreview({ source }) {\n\t\t\t\tif (source.data.type === 'card') {\n\t\t\t\t\tconst itemId = source.data.itemId;\n\t\t\t\t\tinvariant(typeof itemId === 'string');\n\t\t\t\t\tif (!selectedUserIds.includes(itemId)) {\n\t\t\t\t\t\tsetSelectedUserIds([]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tonDragStart({ source }) {\n\t\t\t\tif (source.data.type === 'card') {\n\t\t\t\t\tsetIsDraggingCard(true);\n\t\t\t\t}\n\t\t\t},\n\t\t\tonDrop(args) {\n\t\t\t\tconst { location, source } = args;\n\n\t\t\t\tif (source.data.type === 'card') {\n\t\t\t\t\tsetIsDraggingCard(false);\n\t\t\t\t}\n\n\t\t\t\t// didn't drop on anything\n\t\t\t\tif (!location.current.dropTargets.length) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// dragging a column\n\t\t\t\tif (source.data.type === 'column') {\n\t\t\t\t\tconst startIndex: number = data.orderedColumnIds.findIndex(\n\t\t\t\t\t\t(columnId) => columnId === source.data.columnId,\n\t\t\t\t\t);\n\n\t\t\t\t\tconst target = location.current.dropTargets[0];\n\t\t\t\t\tconst indexOfTarget: number = data.orderedColumnIds.findIndex(\n\t\t\t\t\t\t(id) => id === target.data.columnId,\n\t\t\t\t\t);\n\t\t\t\t\tconst closestEdgeOfTarget: Edge | null = extractClosestEdge(target.data);\n\n\t\t\t\t\tconst updated = reorderWithEdge({\n\t\t\t\t\t\tlist: data.orderedColumnIds,\n\t\t\t\t\t\tstartIndex,\n\t\t\t\t\t\tindexOfTarget,\n\t\t\t\t\t\tclosestEdgeOfTarget,\n\t\t\t\t\t\taxis: 'horizontal',\n\t\t\t\t\t});\n\n\t\t\t\t\tconsole.log('reordering column', {\n\t\t\t\t\t\tstartIndex,\n\t\t\t\t\t\tdestinationIndex: updated.findIndex((columnId) => columnId === target.data.columnId),\n\t\t\t\t\t\tclosestEdgeOfTarget,\n\t\t\t\t\t});\n\n\t\t\t\t\tsetData({ ...data, orderedColumnIds: updated });\n\t\t\t\t}\n\n\t\t\t\t// dragging a card\n\t\t\t\tif (source.data.type === 'card') {\n\t\t\t\t\tconst itemId = source.data.itemId;\n\t\t\t\t\tinvariant(typeof itemId === 'string');\n\t\t\t\t\tconst [, startColumnRecord] = location.initial.dropTargets;\n\t\t\t\t\tconst sourceId = startColumnRecord.data.columnId;\n\t\t\t\t\tinvariant(typeof sourceId === 'string');\n\t\t\t\t\tconst sourceColumn = data.columnMap[sourceId];\n\t\t\t\t\tconst itemIndex = sourceColumn.items.findIndex((item) => item.userId === itemId);\n\t\t\t\t\tconst item: Person = sourceColumn.items[itemIndex];\n\n\t\t\t\t\t// Multi drag\n\t\t\t\t\tif (selectedUserIds.length > 1) {\n\t\t\t\t\t\t// Dropping in a column (relative to a card)\n\t\t\t\t\t\tif (location.current.dropTargets.length === 2) {\n\t\t\t\t\t\t\t// 1. Get target index\n\t\t\t\t\t\t\tconst [destinationCardRecord, destinationColumnRecord] = location.current.dropTargets;\n\t\t\t\t\t\t\tconst destinationColumnId = destinationColumnRecord.data.columnId;\n\t\t\t\t\t\t\tinvariant(typeof destinationColumnId === 'string');\n\t\t\t\t\t\t\tconst destinationColumn = data.columnMap[destinationColumnId];\n\n\t\t\t\t\t\t\tconst indexOfTarget = destinationColumn.items.findIndex(\n\t\t\t\t\t\t\t\t(item) => item.userId === destinationCardRecord.data.itemId,\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tconst closestEdgeOfTarget: Edge | null = extractClosestEdge(\n\t\t\t\t\t\t\t\tdestinationCardRecord.data,\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tconst indexOfTargetWithEdge = (() => {\n\t\t\t\t\t\t\t\tif (sourceId === destinationColumnId) {\n\t\t\t\t\t\t\t\t\treturn getReorderDestinationIndex({\n\t\t\t\t\t\t\t\t\t\tclosestEdgeOfTarget,\n\t\t\t\t\t\t\t\t\t\tstartIndex: itemIndex,\n\t\t\t\t\t\t\t\t\t\tindexOfTarget: indexOfTarget,\n\t\t\t\t\t\t\t\t\t\taxis: 'vertical',\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn closestEdgeOfTarget === 'bottom' ? indexOfTarget + 1 : indexOfTarget;\n\t\t\t\t\t\t\t})();\n\n\t\t\t\t\t\t\tconst selectedItemsBeforeTarget = selectedUserIds.filter((id) => {\n\t\t\t\t\t\t\t\tconst itemIndex = destinationColumn.items.findIndex((i) => i.userId === id);\n\t\t\t\t\t\t\t\tif (itemIndex === -1) {\n\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\treturn itemIndex < indexOfTargetWithEdge;\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tconst finalIndex = selectedItemsBeforeTarget.length\n\t\t\t\t\t\t\t\t? indexOfTargetWithEdge - (selectedItemsBeforeTarget.length - 1)\n\t\t\t\t\t\t\t\t: indexOfTargetWithEdge;\n\n\t\t\t\t\t\t\t// 2. Perform reorder\n\t\t\t\t\t\t\tconst { reorderedColumnMap, orderedSelectedUserIds } = multiDragReorder({\n\t\t\t\t\t\t\t\tdata,\n\t\t\t\t\t\t\t\tselectedUserIds,\n\t\t\t\t\t\t\t\tdraggedItemId: itemId,\n\t\t\t\t\t\t\t\tdestinationColumnId,\n\t\t\t\t\t\t\t\tfinalIndex,\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tsetData({\n\t\t\t\t\t\t\t\t...data,\n\t\t\t\t\t\t\t\tcolumnMap: reorderedColumnMap,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tsetSelectedUserIds(orderedSelectedUserIds);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Dropping on a column (inserting into last position)\n\t\t\t\t\t\tif (location.current.dropTargets.length === 1) {\n\t\t\t\t\t\t\t// 1. Get target index\n\t\t\t\t\t\t\tconst [destinationColumnRecord] = location.current.dropTargets;\n\t\t\t\t\t\t\tconst destinationColumnId = destinationColumnRecord.data.columnId;\n\t\t\t\t\t\t\tinvariant(typeof destinationColumnId === 'string');\n\t\t\t\t\t\t\tconst destinationColumn = data.columnMap[destinationColumnId];\n\t\t\t\t\t\t\tinvariant(destinationColumn);\n\t\t\t\t\t\t\tconst finalIndex = destinationColumn.items.length;\n\n\t\t\t\t\t\t\t// 2: Perform reorder\n\t\t\t\t\t\t\tconst { reorderedColumnMap, orderedSelectedUserIds } = multiDragReorder({\n\t\t\t\t\t\t\t\tdata,\n\t\t\t\t\t\t\t\tselectedUserIds,\n\t\t\t\t\t\t\t\tdraggedItemId: itemId,\n\t\t\t\t\t\t\t\tdestinationColumnId,\n\t\t\t\t\t\t\t\tfinalIndex,\n\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\tsetData({\n\t\t\t\t\t\t\t\t...data,\n\t\t\t\t\t\t\t\tcolumnMap: reorderedColumnMap,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tsetSelectedUserIds(orderedSelectedUserIds);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// Single drag: dropping on a column (inserting into last position)\n\t\t\t\t\tif (location.current.dropTargets.length === 1) {\n\t\t\t\t\t\tconst [destinationColumnRecord] = location.current.dropTargets;\n\t\t\t\t\t\tconst destinationId = destinationColumnRecord.data.columnId;\n\t\t\t\t\t\tinvariant(typeof destinationId === 'string');\n\t\t\t\t\t\tconst destinationColumn = data.columnMap[destinationId];\n\t\t\t\t\t\tinvariant(destinationColumn);\n\n\t\t\t\t\t\t// Reordering in same column\n\t\t\t\t\t\tif (sourceColumn === destinationColumn) {\n\t\t\t\t\t\t\tconst updated = reorderWithEdge({\n\t\t\t\t\t\t\t\tlist: sourceColumn.items,\n\t\t\t\t\t\t\t\tstartIndex: itemIndex,\n\t\t\t\t\t\t\t\tindexOfTarget: sourceColumn.items.length - 1,\n\t\t\t\t\t\t\t\tclosestEdgeOfTarget: null,\n\t\t\t\t\t\t\t\taxis: 'vertical',\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tconst updatedMap = {\n\t\t\t\t\t\t\t\t...data.columnMap,\n\t\t\t\t\t\t\t\t[sourceColumn.columnId]: {\n\t\t\t\t\t\t\t\t\t...sourceColumn,\n\t\t\t\t\t\t\t\t\titems: updated,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tsetData({ ...data, columnMap: updatedMap });\n\t\t\t\t\t\t\tconsole.log('moving card to end position in same column', {\n\t\t\t\t\t\t\t\tstartIndex: itemIndex,\n\t\t\t\t\t\t\t\tdestinationIndex: updated.findIndex((i) => i.userId === itemId),\n\t\t\t\t\t\t\t\tedge: null,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Moving to a new column\n\t\t\t\t\t\tconst updatedMap = {\n\t\t\t\t\t\t\t...data.columnMap,\n\t\t\t\t\t\t\t[sourceColumn.columnId]: {\n\t\t\t\t\t\t\t\t...sourceColumn,\n\t\t\t\t\t\t\t\titems: sourceColumn.items.filter((i) => i.userId !== itemId),\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t[destinationColumn.columnId]: {\n\t\t\t\t\t\t\t\t...destinationColumn,\n\t\t\t\t\t\t\t\titems: [...destinationColumn.items, item],\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tsetData({ ...data, columnMap: updatedMap });\n\t\t\t\t\t\tconsole.log('moving card to end position of another column', {\n\t\t\t\t\t\t\tstartIndex: itemIndex,\n\t\t\t\t\t\t\tdestinationIndex: updatedMap[destinationColumn.columnId].items.findIndex(\n\t\t\t\t\t\t\t\t(i) => i.userId === itemId,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tedge: null,\n\t\t\t\t\t\t});\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Single drag: dropping in a column (relative to a card)\n\t\t\t\t\tif (location.current.dropTargets.length === 2) {\n\t\t\t\t\t\tconst [destinationCardRecord, destinationColumnRecord] = location.current.dropTargets;\n\t\t\t\t\t\tconst destinationColumnId = destinationColumnRecord.data.columnId;\n\t\t\t\t\t\tinvariant(typeof destinationColumnId === 'string');\n\t\t\t\t\t\tconst destinationColumn = data.columnMap[destinationColumnId];\n\n\t\t\t\t\t\tconst indexOfTarget = destinationColumn.items.findIndex(\n\t\t\t\t\t\t\t(item) => item.userId === destinationCardRecord.data.itemId,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst closestEdgeOfTarget: Edge | null = extractClosestEdge(destinationCardRecord.data);\n\n\t\t\t\t\t\t// Case 1: ordering in the same column\n\t\t\t\t\t\tif (sourceColumn === destinationColumn) {\n\t\t\t\t\t\t\tconst updated = reorderWithEdge({\n\t\t\t\t\t\t\t\tlist: sourceColumn.items,\n\t\t\t\t\t\t\t\tstartIndex: itemIndex,\n\t\t\t\t\t\t\t\tindexOfTarget,\n\t\t\t\t\t\t\t\tclosestEdgeOfTarget,\n\t\t\t\t\t\t\t\taxis: 'vertical',\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tconst updatedSourceColumn: ColumnType = {\n\t\t\t\t\t\t\t\t...sourceColumn,\n\t\t\t\t\t\t\t\titems: updated,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tconst updatedMap: ColumnMap = {\n\t\t\t\t\t\t\t\t...data.columnMap,\n\t\t\t\t\t\t\t\t[sourceColumn.columnId]: updatedSourceColumn,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tconsole.log('dropping relative to card in the same column', {\n\t\t\t\t\t\t\t\tstartIndex: itemIndex,\n\t\t\t\t\t\t\t\tdestinationIndex: updated.findIndex((i) => i.userId === itemId),\n\t\t\t\t\t\t\t\tclosestEdgeOfTarget,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tsetData({ ...data, columnMap: updatedMap });\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Case 2: moving into a new column relative to a card\n\t\t\t\t\t\tconst updatedSourceColumn: ColumnType = {\n\t\t\t\t\t\t\t...sourceColumn,\n\t\t\t\t\t\t\titems: sourceColumn.items.filter((i) => i !== item),\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconst updated: Person[] = Array.from(destinationColumn.items);\n\t\t\t\t\t\tconst destinationIndex =\n\t\t\t\t\t\t\tclosestEdgeOfTarget === 'bottom' ? indexOfTarget + 1 : indexOfTarget;\n\t\t\t\t\t\tupdated.splice(destinationIndex, 0, item);\n\n\t\t\t\t\t\tconst updatedDestinationColumn: ColumnType = {\n\t\t\t\t\t\t\t...destinationColumn,\n\t\t\t\t\t\t\titems: updated,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconst updatedMap: ColumnMap = {\n\t\t\t\t\t\t\t...data.columnMap,\n\t\t\t\t\t\t\t[sourceColumn.columnId]: updatedSourceColumn,\n\t\t\t\t\t\t\t[destinationColumn.columnId]: updatedDestinationColumn,\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconsole.log('dropping on a card in different column', {\n\t\t\t\t\t\t\tsourceColumn: sourceColumn.columnId,\n\t\t\t\t\t\t\tdestinationColumn: destinationColumn.columnId,\n\t\t\t\t\t\t\tstartIndex: itemIndex,\n\t\t\t\t\t\t\tdestinationIndex,\n\t\t\t\t\t\t\tclosestEdgeOfTarget,\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsetData({ ...data, columnMap: updatedMap });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\t}, [data, selectedUserIds]);\n\n\tconst toggleSelection = (userId: string) => {\n\t\tconst updatedUserIds = (() => {\n\t\t\t// Task was not previously selected\n\t\t\t// now will be the only selected item\n\t\t\tif (!selectedUserIds.includes(userId)) {\n\t\t\t\treturn [userId];\n\t\t\t}\n\n\t\t\t// Task was part of a selected group\n\t\t\t// will now become the only selected item\n\t\t\tif (selectedUserIds.length > 1) {\n\t\t\t\treturn [userId];\n\t\t\t}\n\n\t\t\t// task was previously selected but not in a group\n\t\t\t// we will now clear the selection\n\t\t\treturn [];\n\t\t})();\n\n\t\tsetSelectedUserIds(updatedUserIds);\n\t};\n\n\tconst toggleSelectionInGroup = (userId: string) => {\n\t\tconst index = selectedUserIds.indexOf(userId);\n\n\t\t// if not selected - add it to the selected items\n\t\tif (index === -1) {\n\t\t\tsetSelectedUserIds([...selectedUserIds, userId]);\n\t\t\treturn;\n\t\t}\n\n\t\t// it was previously selected and now needs to be removed from the group\n\t\tconst newIds = [...selectedUserIds];\n\t\tnewIds.splice(index, 1);\n\t\tsetSelectedUserIds(newIds);\n\t};\n\n\t// This behaviour matches the MacOSX finder selection\n\tconst multiSelectTo = (userId: string) => {\n\t\tconst updated = multiSelect({\n\t\t\tcolumnMap: data.columnMap,\n\t\t\torderedColumnIds: data.orderedColumnIds,\n\t\t\tselectedUserIds,\n\t\t\tuserId,\n\t\t});\n\n\t\tif (!updated) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetSelectedUserIds(updated);\n\t};\n\n\treturn (\n\t\t<Board>\n\t\t\t{data.orderedColumnIds.map((columnId) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Column\n\t\t\t\t\t\tcolumn={data.columnMap[columnId]}\n\t\t\t\t\t\tkey={columnId}\n\t\t\t\t\t\tisDraggingCard={isDraggingCard}\n\t\t\t\t\t\tselectedUserIds={selectedUserIds}\n\t\t\t\t\t\tmultiSelectTo={multiSelectTo}\n\t\t\t\t\t\ttoggleSelection={toggleSelection}\n\t\t\t\t\t\ttoggleSelectionInGroup={toggleSelectionInGroup}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t})}\n\t\t</Board>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/board-with-overflow-scroll.tsx",
    "content": "import React, { useEffect, useState } from 'react';\n\nimport invariant from 'tiny-invariant';\n\nimport { extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport type { Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/types';\nimport { reorderWithEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/reorder-with-edge';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { monitorForExternal } from '@atlaskit/pragmatic-drag-and-drop/external/adapter';\n\nimport { type ColumnMap, type ColumnType, getData, type Person } from './data/people';\nimport Board from './pieces/board-with-overflow-scroll/board';\nimport { Column } from './pieces/board-with-overflow-scroll/column';\n\nexport default function BoardExample(): React.JSX.Element {\n\tconst [data, setData] = useState<{\n\t\tcolumnMap: ColumnMap;\n\t\torderedColumnIds: string[];\n\t}>(() => getData({ columnCount: 7, itemsPerColumn: 100 }));\n\n\tuseEffect(() => {\n\t\treturn combine(\n\t\t\tmonitorForExternal({\n\t\t\t\tonDragStart: (args) => console.log('start:file', args.source.items),\n\t\t\t\tonDrop: (args) => console.log('drop:file', args.source.items),\n\t\t\t}),\n\t\t\tmonitorForElements({\n\t\t\t\tonDrop(args) {\n\t\t\t\t\tconst { location, source } = args;\n\t\t\t\t\t// didn't drop on anything\n\t\t\t\t\tif (!location.current.dropTargets.length) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// need to handle drop\n\n\t\t\t\t\t// 1. remove element from original position\n\t\t\t\t\t// 2. move to new position\n\n\t\t\t\t\tif (source.data.type === 'column') {\n\t\t\t\t\t\tconst startIndex: number = data.orderedColumnIds.findIndex(\n\t\t\t\t\t\t\t(columnId) => columnId === source.data.columnId,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tconst target = location.current.dropTargets[0];\n\t\t\t\t\t\tconst indexOfTarget: number = data.orderedColumnIds.findIndex(\n\t\t\t\t\t\t\t(id) => id === target.data.columnId,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst closestEdgeOfTarget: Edge | null = extractClosestEdge(target.data);\n\n\t\t\t\t\t\tconst updated = reorderWithEdge({\n\t\t\t\t\t\t\tlist: data.orderedColumnIds,\n\t\t\t\t\t\t\tstartIndex,\n\t\t\t\t\t\t\tindexOfTarget,\n\t\t\t\t\t\t\tclosestEdgeOfTarget,\n\t\t\t\t\t\t\taxis: 'horizontal',\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tconsole.log('reordering column', {\n\t\t\t\t\t\t\tstartIndex,\n\t\t\t\t\t\t\tdestinationIndex: updated.findIndex((columnId) => columnId === target.data.columnId),\n\t\t\t\t\t\t\tclosestEdgeOfTarget,\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tsetData({ ...data, orderedColumnIds: updated });\n\t\t\t\t\t}\n\t\t\t\t\t// Dragging a card\n\t\t\t\t\tif (source.data.type === 'card') {\n\t\t\t\t\t\tconst itemId = source.data.itemId;\n\t\t\t\t\t\tinvariant(typeof itemId === 'string');\n\t\t\t\t\t\t// TODO: these lines not needed if item has columnId on it\n\t\t\t\t\t\tconst [, startColumnRecord] = location.initial.dropTargets;\n\t\t\t\t\t\tconst sourceId = startColumnRecord.data.columnId;\n\t\t\t\t\t\tinvariant(typeof sourceId === 'string');\n\t\t\t\t\t\tconst sourceColumn = data.columnMap[sourceId];\n\t\t\t\t\t\tconst itemIndex = sourceColumn.items.findIndex((item) => item.userId === itemId);\n\t\t\t\t\t\tconst item: Person = sourceColumn.items[itemIndex];\n\n\t\t\t\t\t\tif (location.current.dropTargets.length === 1) {\n\t\t\t\t\t\t\tconst [destinationColumnRecord] = location.current.dropTargets;\n\t\t\t\t\t\t\tconst destinationId = destinationColumnRecord.data.columnId;\n\t\t\t\t\t\t\tinvariant(typeof destinationId === 'string');\n\t\t\t\t\t\t\tconst destinationColumn = data.columnMap[destinationId];\n\t\t\t\t\t\t\tinvariant(destinationColumn);\n\n\t\t\t\t\t\t\t// reordering in same column\n\t\t\t\t\t\t\tif (sourceColumn === destinationColumn) {\n\t\t\t\t\t\t\t\tconst updated = reorderWithEdge({\n\t\t\t\t\t\t\t\t\tlist: sourceColumn.items,\n\t\t\t\t\t\t\t\t\tstartIndex: itemIndex,\n\t\t\t\t\t\t\t\t\tindexOfTarget: sourceColumn.items.length - 1,\n\t\t\t\t\t\t\t\t\tclosestEdgeOfTarget: null,\n\t\t\t\t\t\t\t\t\taxis: 'vertical',\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tconst updatedMap = {\n\t\t\t\t\t\t\t\t\t...data.columnMap,\n\t\t\t\t\t\t\t\t\t[sourceColumn.columnId]: {\n\t\t\t\t\t\t\t\t\t\t...sourceColumn,\n\t\t\t\t\t\t\t\t\t\titems: updated,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tsetData({ ...data, columnMap: updatedMap });\n\t\t\t\t\t\t\t\tconsole.log('moving card to end position in same column', {\n\t\t\t\t\t\t\t\t\tstartIndex: itemIndex,\n\t\t\t\t\t\t\t\t\tdestinationIndex: updated.findIndex((i) => i.userId === itemId),\n\t\t\t\t\t\t\t\t\tedge: null,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// moving to a new column\n\t\t\t\t\t\t\tconst updatedMap = {\n\t\t\t\t\t\t\t\t...data.columnMap,\n\t\t\t\t\t\t\t\t[sourceColumn.columnId]: {\n\t\t\t\t\t\t\t\t\t...sourceColumn,\n\t\t\t\t\t\t\t\t\titems: sourceColumn.items.filter((i) => i.userId !== itemId),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t[destinationColumn.columnId]: {\n\t\t\t\t\t\t\t\t\t...destinationColumn,\n\t\t\t\t\t\t\t\t\titems: [...destinationColumn.items, item],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\tsetData({ ...data, columnMap: updatedMap });\n\t\t\t\t\t\t\tconsole.log('moving card to end position of another column', {\n\t\t\t\t\t\t\t\tstartIndex: itemIndex,\n\t\t\t\t\t\t\t\tdestinationIndex: updatedMap[destinationColumn.columnId].items.findIndex(\n\t\t\t\t\t\t\t\t\t(i) => i.userId === itemId,\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\tedge: null,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// dropping in a column (relative to a card)\n\t\t\t\t\t\tif (location.current.dropTargets.length === 2) {\n\t\t\t\t\t\t\tconst [destinationCardRecord, destinationColumnRecord] = location.current.dropTargets;\n\t\t\t\t\t\t\tconst destinationColumnId = destinationColumnRecord.data.columnId;\n\t\t\t\t\t\t\tinvariant(typeof destinationColumnId === 'string');\n\t\t\t\t\t\t\tconst destinationColumn = data.columnMap[destinationColumnId];\n\n\t\t\t\t\t\t\tconst indexOfTarget = destinationColumn.items.findIndex(\n\t\t\t\t\t\t\t\t(item) => item.userId === destinationCardRecord.data.itemId,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tconst closestEdgeOfTarget: Edge | null = extractClosestEdge(\n\t\t\t\t\t\t\t\tdestinationCardRecord.data,\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t// case 1: ordering in the same column\n\t\t\t\t\t\t\tif (sourceColumn === destinationColumn) {\n\t\t\t\t\t\t\t\tconst updated = reorderWithEdge({\n\t\t\t\t\t\t\t\t\tlist: sourceColumn.items,\n\t\t\t\t\t\t\t\t\tstartIndex: itemIndex,\n\t\t\t\t\t\t\t\t\tindexOfTarget,\n\t\t\t\t\t\t\t\t\tclosestEdgeOfTarget,\n\t\t\t\t\t\t\t\t\taxis: 'vertical',\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tconst updatedSourceColumn: ColumnType = {\n\t\t\t\t\t\t\t\t\t...sourceColumn,\n\t\t\t\t\t\t\t\t\titems: updated,\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tconst updatedMap: ColumnMap = {\n\t\t\t\t\t\t\t\t\t...data.columnMap,\n\t\t\t\t\t\t\t\t\t[sourceColumn.columnId]: updatedSourceColumn,\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tconsole.log('dropping relative to card in the same column', {\n\t\t\t\t\t\t\t\t\tstartIndex: itemIndex,\n\t\t\t\t\t\t\t\t\tdestinationIndex: updated.findIndex((i) => i.userId === itemId),\n\t\t\t\t\t\t\t\t\tclosestEdgeOfTarget,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\tsetData({ ...data, columnMap: updatedMap });\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// case 2: moving into a new column relative to a card\n\n\t\t\t\t\t\t\tconst updatedSourceColumn: ColumnType = {\n\t\t\t\t\t\t\t\t...sourceColumn,\n\t\t\t\t\t\t\t\titems: sourceColumn.items.filter((i) => i !== item),\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tconst updated: Person[] = Array.from(destinationColumn.items);\n\t\t\t\t\t\t\tconst destinationIndex =\n\t\t\t\t\t\t\t\tclosestEdgeOfTarget === 'bottom' ? indexOfTarget + 1 : indexOfTarget;\n\t\t\t\t\t\t\tupdated.splice(destinationIndex, 0, item);\n\n\t\t\t\t\t\t\tconst updatedDestinationColumn: ColumnType = {\n\t\t\t\t\t\t\t\t...destinationColumn,\n\t\t\t\t\t\t\t\titems: updated,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tconst updatedMap: ColumnMap = {\n\t\t\t\t\t\t\t\t...data.columnMap,\n\t\t\t\t\t\t\t\t[sourceColumn.columnId]: updatedSourceColumn,\n\t\t\t\t\t\t\t\t[destinationColumn.columnId]: updatedDestinationColumn,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\tconsole.log('dropping on a card in different column', {\n\t\t\t\t\t\t\t\tsourceColumn: sourceColumn.columnId,\n\t\t\t\t\t\t\t\tdestinationColumn: destinationColumn.columnId,\n\t\t\t\t\t\t\t\tstartIndex: itemIndex,\n\t\t\t\t\t\t\t\tdestinationIndex,\n\t\t\t\t\t\t\t\tclosestEdgeOfTarget,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\tsetData({ ...data, columnMap: updatedMap });\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [data]);\n\n\treturn (\n\t\t<Board>\n\t\t\t{data.orderedColumnIds.map((columnId) => {\n\t\t\t\treturn <Column column={data.columnMap[columnId]} key={columnId} />;\n\t\t\t})}\n\t\t</Board>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/board.tsx",
    "content": "import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport invariant from 'tiny-invariant';\n\nimport { triggerPostMoveFlash } from '@atlaskit/pragmatic-drag-and-drop-flourish/trigger-post-move-flash';\nimport { extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport type { Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/types';\nimport { getReorderDestinationIndex } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index';\nimport * as liveRegion from '@atlaskit/pragmatic-drag-and-drop-live-region';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';\n\nimport { type ColumnMap, type ColumnType, getBasicData, type Person } from './data/people';\nimport Board from './pieces/board/board';\nimport { BoardContext, type BoardContextValue } from './pieces/board/board-context';\nimport { Column } from './pieces/board/column';\nimport { createRegistry } from './pieces/board/registry';\n\ntype Outcome =\n\t| {\n\t\t\ttype: 'column-reorder';\n\t\t\tcolumnId: string;\n\t\t\tstartIndex: number;\n\t\t\tfinishIndex: number;\n\t  }\n\t| {\n\t\t\ttype: 'card-reorder';\n\t\t\tcolumnId: string;\n\t\t\tstartIndex: number;\n\t\t\tfinishIndex: number;\n\t  }\n\t| {\n\t\t\ttype: 'card-move';\n\t\t\tfinishColumnId: string;\n\t\t\titemIndexInStartColumn: number;\n\t\t\titemIndexInFinishColumn: number;\n\t  };\n\ntype Trigger = 'pointer' | 'keyboard';\n\ntype Operation = {\n\ttrigger: Trigger;\n\toutcome: Outcome;\n};\n\ntype BoardState = {\n\tcolumnMap: ColumnMap;\n\torderedColumnIds: string[];\n\tlastOperation: Operation | null;\n};\n\nexport default function BoardExample(): React.JSX.Element {\n\tconst [data, setData] = useState<BoardState>(() => {\n\t\tconst base = getBasicData();\n\t\treturn {\n\t\t\t...base,\n\t\t\tlastOperation: null,\n\t\t};\n\t});\n\n\tconst stableData = useRef(data);\n\tuseEffect(() => {\n\t\tstableData.current = data;\n\t}, [data]);\n\n\tconst [registry] = useState(createRegistry);\n\n\tconst { lastOperation } = data;\n\n\tuseEffect(() => {\n\t\tif (lastOperation === null) {\n\t\t\treturn;\n\t\t}\n\t\tconst { outcome, trigger } = lastOperation;\n\n\t\tif (outcome.type === 'column-reorder') {\n\t\t\tconst { startIndex, finishIndex } = outcome;\n\n\t\t\tconst { columnMap, orderedColumnIds } = stableData.current;\n\t\t\tconst sourceColumn = columnMap[orderedColumnIds[finishIndex]];\n\n\t\t\tconst entry = registry.getColumn(sourceColumn.columnId);\n\t\t\ttriggerPostMoveFlash(entry.element);\n\n\t\t\tliveRegion.announce(\n\t\t\t\t`You've moved ${sourceColumn.title} from position ${\n\t\t\t\t\tstartIndex + 1\n\t\t\t\t} to position ${finishIndex + 1} of ${orderedColumnIds.length}.`,\n\t\t\t);\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (outcome.type === 'card-reorder') {\n\t\t\tconst { columnId, startIndex, finishIndex } = outcome;\n\n\t\t\tconst { columnMap } = stableData.current;\n\t\t\tconst column = columnMap[columnId];\n\t\t\tconst item = column.items[finishIndex];\n\n\t\t\tconst entry = registry.getCard(item.userId);\n\t\t\ttriggerPostMoveFlash(entry.element);\n\n\t\t\tif (trigger !== 'keyboard') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tliveRegion.announce(\n\t\t\t\t`You've moved ${item.name} from position ${\n\t\t\t\t\tstartIndex + 1\n\t\t\t\t} to position ${finishIndex + 1} of ${column.items.length} in the ${column.title} column.`,\n\t\t\t);\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (outcome.type === 'card-move') {\n\t\t\tconst { finishColumnId, itemIndexInStartColumn, itemIndexInFinishColumn } = outcome;\n\n\t\t\tconst data = stableData.current;\n\t\t\tconst destinationColumn = data.columnMap[finishColumnId];\n\t\t\tconst item = destinationColumn.items[itemIndexInFinishColumn];\n\n\t\t\tconst finishPosition =\n\t\t\t\ttypeof itemIndexInFinishColumn === 'number'\n\t\t\t\t\t? itemIndexInFinishColumn + 1\n\t\t\t\t\t: destinationColumn.items.length;\n\n\t\t\tconst entry = registry.getCard(item.userId);\n\t\t\ttriggerPostMoveFlash(entry.element);\n\n\t\t\tif (trigger !== 'keyboard') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tliveRegion.announce(\n\t\t\t\t`You've moved ${item.name} from position ${\n\t\t\t\t\titemIndexInStartColumn + 1\n\t\t\t\t} to position ${finishPosition} in the ${destinationColumn.title} column.`,\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Because the card has moved column, it will have remounted.\n\t\t\t * This means we need to manually restore focus to it.\n\t\t\t */\n\t\t\tentry.actionMenuTrigger.focus();\n\n\t\t\treturn;\n\t\t}\n\t}, [lastOperation, registry]);\n\n\tuseEffect(() => {\n\t\treturn liveRegion.cleanup();\n\t}, []);\n\n\tconst getColumns = useCallback(() => {\n\t\tconst { columnMap, orderedColumnIds } = stableData.current;\n\t\treturn orderedColumnIds.map((columnId) => columnMap[columnId]);\n\t}, []);\n\n\tconst reorderColumn = useCallback(\n\t\t({\n\t\t\tstartIndex,\n\t\t\tfinishIndex,\n\t\t\ttrigger = 'keyboard',\n\t\t}: {\n\t\t\tstartIndex: number;\n\t\t\tfinishIndex: number;\n\t\t\ttrigger?: Trigger;\n\t\t}) => {\n\t\t\tsetData((data) => {\n\t\t\t\tconst outcome: Outcome = {\n\t\t\t\t\ttype: 'column-reorder',\n\t\t\t\t\tcolumnId: data.orderedColumnIds[startIndex],\n\t\t\t\t\tstartIndex,\n\t\t\t\t\tfinishIndex,\n\t\t\t\t};\n\n\t\t\t\treturn {\n\t\t\t\t\t...data,\n\t\t\t\t\torderedColumnIds: reorder({\n\t\t\t\t\t\tlist: data.orderedColumnIds,\n\t\t\t\t\t\tstartIndex,\n\t\t\t\t\t\tfinishIndex,\n\t\t\t\t\t}),\n\t\t\t\t\tlastOperation: {\n\t\t\t\t\t\toutcome,\n\t\t\t\t\t\ttrigger: trigger,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t});\n\t\t},\n\t\t[],\n\t);\n\n\tconst reorderCard = useCallback(\n\t\t({\n\t\t\tcolumnId,\n\t\t\tstartIndex,\n\t\t\tfinishIndex,\n\t\t\ttrigger = 'keyboard',\n\t\t}: {\n\t\t\tcolumnId: string;\n\t\t\tstartIndex: number;\n\t\t\tfinishIndex: number;\n\t\t\ttrigger?: Trigger;\n\t\t}) => {\n\t\t\tsetData((data) => {\n\t\t\t\tconst sourceColumn = data.columnMap[columnId];\n\t\t\t\tconst updatedItems = reorder({\n\t\t\t\t\tlist: sourceColumn.items,\n\t\t\t\t\tstartIndex,\n\t\t\t\t\tfinishIndex,\n\t\t\t\t});\n\n\t\t\t\tconst updatedSourceColumn: ColumnType = {\n\t\t\t\t\t...sourceColumn,\n\t\t\t\t\titems: updatedItems,\n\t\t\t\t};\n\n\t\t\t\tconst updatedMap: ColumnMap = {\n\t\t\t\t\t...data.columnMap,\n\t\t\t\t\t[columnId]: updatedSourceColumn,\n\t\t\t\t};\n\n\t\t\t\tconst outcome: Outcome | null = {\n\t\t\t\t\ttype: 'card-reorder',\n\t\t\t\t\tcolumnId,\n\t\t\t\t\tstartIndex,\n\t\t\t\t\tfinishIndex,\n\t\t\t\t};\n\n\t\t\t\treturn {\n\t\t\t\t\t...data,\n\t\t\t\t\tcolumnMap: updatedMap,\n\t\t\t\t\tlastOperation: {\n\t\t\t\t\t\ttrigger: trigger,\n\t\t\t\t\t\toutcome,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t});\n\t\t},\n\t\t[],\n\t);\n\n\tconst moveCard = useCallback(\n\t\t({\n\t\t\tstartColumnId,\n\t\t\tfinishColumnId,\n\t\t\titemIndexInStartColumn,\n\t\t\titemIndexInFinishColumn,\n\t\t\ttrigger = 'keyboard',\n\t\t}: {\n\t\t\tstartColumnId: string;\n\t\t\tfinishColumnId: string;\n\t\t\titemIndexInStartColumn: number;\n\t\t\titemIndexInFinishColumn?: number;\n\t\t\ttrigger?: 'pointer' | 'keyboard';\n\t\t}) => {\n\t\t\t// invalid cross column movement\n\t\t\tif (startColumnId === finishColumnId) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetData((data) => {\n\t\t\t\tconst sourceColumn = data.columnMap[startColumnId];\n\t\t\t\tconst destinationColumn = data.columnMap[finishColumnId];\n\t\t\t\tconst item: Person = sourceColumn.items[itemIndexInStartColumn];\n\n\t\t\t\tconst destinationItems = Array.from(destinationColumn.items);\n\t\t\t\t// Going into the first position if no index is provided\n\t\t\t\tconst newIndexInDestination = itemIndexInFinishColumn ?? 0;\n\t\t\t\tdestinationItems.splice(newIndexInDestination, 0, item);\n\n\t\t\t\tconst updatedMap = {\n\t\t\t\t\t...data.columnMap,\n\t\t\t\t\t[startColumnId]: {\n\t\t\t\t\t\t...sourceColumn,\n\t\t\t\t\t\titems: sourceColumn.items.filter((i) => i.userId !== item.userId),\n\t\t\t\t\t},\n\t\t\t\t\t[finishColumnId]: {\n\t\t\t\t\t\t...destinationColumn,\n\t\t\t\t\t\titems: destinationItems,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tconst outcome: Outcome | null = {\n\t\t\t\t\ttype: 'card-move',\n\t\t\t\t\tfinishColumnId,\n\t\t\t\t\titemIndexInStartColumn,\n\t\t\t\t\titemIndexInFinishColumn: newIndexInDestination,\n\t\t\t\t};\n\n\t\t\t\treturn {\n\t\t\t\t\t...data,\n\t\t\t\t\tcolumnMap: updatedMap,\n\t\t\t\t\tlastOperation: {\n\t\t\t\t\t\toutcome,\n\t\t\t\t\t\ttrigger: trigger,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t});\n\t\t},\n\t\t[],\n\t);\n\n\tconst [instanceId] = useState(() => Symbol('instance-id'));\n\n\tuseEffect(() => {\n\t\treturn combine(\n\t\t\tmonitorForElements({\n\t\t\t\tcanMonitor({ source }) {\n\t\t\t\t\treturn source.data.instanceId === instanceId;\n\t\t\t\t},\n\t\t\t\tonDrop(args) {\n\t\t\t\t\tconst { location, source } = args;\n\t\t\t\t\t// didn't drop on anything\n\t\t\t\t\tif (!location.current.dropTargets.length) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// need to handle drop\n\n\t\t\t\t\t// 1. remove element from original position\n\t\t\t\t\t// 2. move to new position\n\n\t\t\t\t\tif (source.data.type === 'column') {\n\t\t\t\t\t\tconst startIndex: number = data.orderedColumnIds.findIndex(\n\t\t\t\t\t\t\t(columnId) => columnId === source.data.columnId,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tconst target = location.current.dropTargets[0];\n\t\t\t\t\t\tconst indexOfTarget: number = data.orderedColumnIds.findIndex(\n\t\t\t\t\t\t\t(id) => id === target.data.columnId,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst closestEdgeOfTarget: Edge | null = extractClosestEdge(target.data);\n\n\t\t\t\t\t\tconst finishIndex = getReorderDestinationIndex({\n\t\t\t\t\t\t\tstartIndex,\n\t\t\t\t\t\t\tindexOfTarget,\n\t\t\t\t\t\t\tclosestEdgeOfTarget,\n\t\t\t\t\t\t\taxis: 'horizontal',\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treorderColumn({ startIndex, finishIndex, trigger: 'pointer' });\n\t\t\t\t\t}\n\t\t\t\t\t// Dragging a card\n\t\t\t\t\tif (source.data.type === 'card') {\n\t\t\t\t\t\tconst itemId = source.data.itemId;\n\t\t\t\t\t\tinvariant(typeof itemId === 'string');\n\t\t\t\t\t\t// TODO: these lines not needed if item has columnId on it\n\t\t\t\t\t\tconst [, startColumnRecord] = location.initial.dropTargets;\n\t\t\t\t\t\tconst sourceId = startColumnRecord.data.columnId;\n\t\t\t\t\t\tinvariant(typeof sourceId === 'string');\n\t\t\t\t\t\tconst sourceColumn = data.columnMap[sourceId];\n\t\t\t\t\t\tconst itemIndex = sourceColumn.items.findIndex((item) => item.userId === itemId);\n\n\t\t\t\t\t\tif (location.current.dropTargets.length === 1) {\n\t\t\t\t\t\t\tconst [destinationColumnRecord] = location.current.dropTargets;\n\t\t\t\t\t\t\tconst destinationId = destinationColumnRecord.data.columnId;\n\t\t\t\t\t\t\tinvariant(typeof destinationId === 'string');\n\t\t\t\t\t\t\tconst destinationColumn = data.columnMap[destinationId];\n\t\t\t\t\t\t\tinvariant(destinationColumn);\n\n\t\t\t\t\t\t\t// reordering in same column\n\t\t\t\t\t\t\tif (sourceColumn === destinationColumn) {\n\t\t\t\t\t\t\t\tconst destinationIndex = getReorderDestinationIndex({\n\t\t\t\t\t\t\t\t\tstartIndex: itemIndex,\n\t\t\t\t\t\t\t\t\tindexOfTarget: sourceColumn.items.length - 1,\n\t\t\t\t\t\t\t\t\tclosestEdgeOfTarget: null,\n\t\t\t\t\t\t\t\t\taxis: 'vertical',\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\treorderCard({\n\t\t\t\t\t\t\t\t\tcolumnId: sourceColumn.columnId,\n\t\t\t\t\t\t\t\t\tstartIndex: itemIndex,\n\t\t\t\t\t\t\t\t\tfinishIndex: destinationIndex,\n\t\t\t\t\t\t\t\t\ttrigger: 'pointer',\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// moving to a new column\n\t\t\t\t\t\t\tmoveCard({\n\t\t\t\t\t\t\t\titemIndexInStartColumn: itemIndex,\n\t\t\t\t\t\t\t\tstartColumnId: sourceColumn.columnId,\n\t\t\t\t\t\t\t\tfinishColumnId: destinationColumn.columnId,\n\t\t\t\t\t\t\t\ttrigger: 'pointer',\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// dropping in a column (relative to a card)\n\t\t\t\t\t\tif (location.current.dropTargets.length === 2) {\n\t\t\t\t\t\t\tconst [destinationCardRecord, destinationColumnRecord] = location.current.dropTargets;\n\t\t\t\t\t\t\tconst destinationColumnId = destinationColumnRecord.data.columnId;\n\t\t\t\t\t\t\tinvariant(typeof destinationColumnId === 'string');\n\t\t\t\t\t\t\tconst destinationColumn = data.columnMap[destinationColumnId];\n\n\t\t\t\t\t\t\tconst indexOfTarget = destinationColumn.items.findIndex(\n\t\t\t\t\t\t\t\t(item) => item.userId === destinationCardRecord.data.itemId,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tconst closestEdgeOfTarget: Edge | null = extractClosestEdge(\n\t\t\t\t\t\t\t\tdestinationCardRecord.data,\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t// case 1: ordering in the same column\n\t\t\t\t\t\t\tif (sourceColumn === destinationColumn) {\n\t\t\t\t\t\t\t\tconst destinationIndex = getReorderDestinationIndex({\n\t\t\t\t\t\t\t\t\tstartIndex: itemIndex,\n\t\t\t\t\t\t\t\t\tindexOfTarget,\n\t\t\t\t\t\t\t\t\tclosestEdgeOfTarget,\n\t\t\t\t\t\t\t\t\taxis: 'vertical',\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\treorderCard({\n\t\t\t\t\t\t\t\t\tcolumnId: sourceColumn.columnId,\n\t\t\t\t\t\t\t\t\tstartIndex: itemIndex,\n\t\t\t\t\t\t\t\t\tfinishIndex: destinationIndex,\n\t\t\t\t\t\t\t\t\ttrigger: 'pointer',\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// case 2: moving into a new column relative to a card\n\n\t\t\t\t\t\t\tconst destinationIndex =\n\t\t\t\t\t\t\t\tclosestEdgeOfTarget === 'bottom' ? indexOfTarget + 1 : indexOfTarget;\n\n\t\t\t\t\t\t\tmoveCard({\n\t\t\t\t\t\t\t\titemIndexInStartColumn: itemIndex,\n\t\t\t\t\t\t\t\tstartColumnId: sourceColumn.columnId,\n\t\t\t\t\t\t\t\tfinishColumnId: destinationColumn.columnId,\n\t\t\t\t\t\t\t\titemIndexInFinishColumn: destinationIndex,\n\t\t\t\t\t\t\t\ttrigger: 'pointer',\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [data, instanceId, moveCard, reorderCard, reorderColumn]);\n\n\tconst contextValue: BoardContextValue = useMemo(() => {\n\t\treturn {\n\t\t\tgetColumns,\n\t\t\treorderColumn,\n\t\t\treorderCard,\n\t\t\tmoveCard,\n\t\t\tregisterCard: registry.registerCard,\n\t\t\tregisterColumn: registry.registerColumn,\n\t\t\tinstanceId,\n\t\t};\n\t}, [getColumns, reorderColumn, reorderCard, registry, moveCard, instanceId]);\n\n\treturn (\n\t\t<BoardContext.Provider value={contextValue}>\n\t\t\t<Board>\n\t\t\t\t{data.orderedColumnIds.map((columnId) => {\n\t\t\t\t\treturn <Column column={data.columnMap[columnId]} key={columnId} />;\n\t\t\t\t})}\n\t\t\t</Board>\n\t\t</BoardContext.Provider>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/chess.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { useEffect, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nimport { isPieceType, pieceLookup, type PieceType } from './pieces/chess/piece';\nimport Square from './pieces/chess/square';\n\nexport type coord = [number, number];\n\nexport type PieceRecord = {\n\ttype: PieceType;\n\tlocation: coord;\n};\n\nexport const isCoord = (token: unknown): token is coord =>\n\tArray.isArray(token) && token.length === 2 && token.every((val) => typeof val === 'number');\n\nexport const isEqualCoord = (c1: coord, c2: coord): boolean => c1[0] === c2[0] && c1[1] === c2[1];\n\nconst boardContainerStyles = css({\n\tdisplay: 'grid',\n\tgridTemplateColumns: 'repeat(8, 1fr)',\n\tgridTemplateRows: 'repeat(8, 1fr)',\n\twidth: '600px',\n\theight: '600px',\n\tborder: '3px solid lightgrey',\n});\n\nexport const canMove = (\n\tstart: coord,\n\tdestination: coord,\n\tpieceType: PieceType,\n\tpieces: PieceRecord[],\n): boolean => {\n\tconst rowDist = Math.abs(start[0] - destination[0]);\n\tconst colDist = Math.abs(start[1] - destination[1]);\n\n\tif (pieces.find((piece) => isEqualCoord(piece.location, destination))) {\n\t\treturn false;\n\t}\n\n\tswitch (pieceType) {\n\t\tcase 'king':\n\t\t\treturn [0, 1].includes(rowDist) && [0, 1].includes(colDist);\n\t\tcase 'pawn':\n\t\t\treturn colDist === 0 && start[0] - destination[0] === -1;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n};\n\nconst Chessboard = (): React.JSX.Element => {\n\tconst [pieces, setPieces] = useState<PieceRecord[]>([\n\t\t{ type: 'king', location: [3, 3] },\n\t\t{ type: 'pawn', location: [1, 6] },\n\t]);\n\n\tuseEffect(() => {\n\t\treturn monitorForElements({\n\t\t\tonDrop({ source, location }) {\n\t\t\t\tconst destination = location.current.dropTargets[0];\n\t\t\t\tif (!destination) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst destinationLocation = destination.data.location;\n\t\t\t\tconst sourceLocation = source.data.location;\n\t\t\t\tconst pieceType = source.data.pieceType;\n\n\t\t\t\tif (!isCoord(destinationLocation) || !isCoord(sourceLocation) || !isPieceType(pieceType)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst piece = pieces.find((p) => isEqualCoord(p.location, sourceLocation));\n\t\t\t\tconst restOfPieces = pieces.filter((p) => p !== piece);\n\n\t\t\t\tif (\n\t\t\t\t\tcanMove(sourceLocation, destinationLocation, pieceType, pieces) &&\n\t\t\t\t\tpiece !== undefined\n\t\t\t\t) {\n\t\t\t\t\tsetPieces([{ type: piece.type, location: destinationLocation }, ...restOfPieces]);\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\t}, [pieces]);\n\n\tconst renderBoard = () => {\n\t\tconst squares = [];\n\t\tfor (let row = 0; row < 8; row++) {\n\t\t\tfor (let col = 0; col < 8; col++) {\n\t\t\t\tconst piece = pieces.find((piece) => isEqualCoord(piece.location, [row, col]));\n\n\t\t\t\tsquares.push(\n\t\t\t\t\t<Square pieces={pieces} key={`${row}-${col}`} location={[row, col]}>\n\t\t\t\t\t\t{piece && pieceLookup[piece.type]([row, col])}\n\t\t\t\t\t</Square>,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn squares;\n\t};\n\n\treturn <div css={boardContainerStyles}>{renderBoard()}</div>;\n};\n\nexport default Chessboard;\n"
  },
  {
    "path": "packages/documentation/examples/config.jsonc",
    "content": "/**\n * This file is used by the test scaling project to optimise test result caching\n * Examples that are used by tests affect the outcome of tests so must be included when hashing\n * They are defined here so the hashing algorithm doesn't need to search test files for example usage each time\n */\n{\n  \"testExamples\": [],\n  \"exampleDependencies\": [\n    \"@atlaskit/code\",\n    \"@atlaskit/grid\",\n    \"memoize-one\"\n  ]\n}\n"
  },
  {
    "path": "packages/documentation/examples/data/pages.ts",
    "content": "export type Page = {\n\tid: string;\n\tname: string;\n\tchildren?: Page[];\n};\n\n// Arrow characters to use: ▼ ▶ •\n\nexport const backendData: Page[] = [\n\t{\n\t\tid: '1',\n\t\tname: 'Office Map',\n\t},\n\t{\n\t\tid: '2',\n\t\tname: 'New Employee Onboarding',\n\t\tchildren: [\n\t\t\t{\n\t\t\t\tid: '8',\n\t\t\t\tname: 'Onboarding Materials',\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: '9',\n\t\t\t\tname: 'Training',\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tid: '3',\n\t\tname: 'Office Events',\n\t\tchildren: [\n\t\t\t{\n\t\t\t\tid: '6',\n\t\t\t\tname: '2018',\n\t\t\t\tchildren: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: '10',\n\t\t\t\t\t\tname: 'Summer Picnic',\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tid: '11',\n\t\t\t\t\t\tname: \"Valentine's Day Party\",\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tid: '12',\n\t\t\t\t\t\tname: \"New Year's Party\",\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: '7',\n\t\t\t\tname: '2017',\n\t\t\t\tchildren: [\n\t\t\t\t\t{\n\t\t\t\t\t\tid: '13',\n\t\t\t\t\t\tname: 'Company Anniversary Celebration',\n\t\t\t\t\t},\n\t\t\t\t],\n\t\t\t},\n\t\t],\n\t},\n\t{\n\t\tid: '4',\n\t\tname: 'Public Holidays',\n\t},\n\t{\n\t\tid: '5',\n\t\tname: 'Vacations and Sick Leaves',\n\t},\n];\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/README.md",
    "content": "The images have been separated into two separate folders to workaround CodeSandbox issues.\n\n1. `./raw` contains the raw SVG files used.\n2. `./processed` contains encoded SVG data URI strings exported from `.ts` files.\n\nWe use the processed images instead of the `.svg` files directly because CodeSandbox does not handle `.svg` imports well.\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Alexander.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::f87f69aa3cfcd10c28ca117657bb0d08>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"256\" viewBox=\"0 0 256 256\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cpath d=\"M0 0H256V256H0V0Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256C198.692 256 256 198.692 256 128C256 57.3075 198.692 0 128 0C57.3075 0 0 57.3075 0 128C0 198.692 57.3075 256 128 256Z\" fill=\"%23FF5630\"/%3E%3Cpath d=\"M214.3 222.5L179.1 202.6C178.312 202.109 177.423 201.801 176.5 201.7L128.6 199L80.7 201.3C79.7761 201.321 78.8761 201.598 78.1 202.1L41.5 222.3C65.0606 243.936 95.8734 255.958 127.861 255.995C159.849 256.032 190.689 244.081 214.3 222.5Z\" fill=\"%23FF7452\"/%3E%3Cpath d=\"M161 180.299C160.8 183.499 160.7 191.399 162.4 197.699C163 200.299 166.3 201.199 169 202.799C169.194 202.896 169.362 203.037 169.492 203.211C169.622 203.384 169.71 203.586 169.748 203.799C169.787 204.012 169.776 204.232 169.715 204.44C169.655 204.648 169.547 204.839 169.4 204.999C164.1 211.699 155.3 218.299 145.8 222.599C145.256 222.859 144.803 223.277 144.5 223.799L131.5 251.499C131.318 251.954 131.006 252.346 130.603 252.625C130.2 252.905 129.723 253.059 129.233 253.07C128.743 253.081 128.26 252.947 127.845 252.685C127.43 252.424 127.102 252.046 126.9 251.599L113.8 223.799C113.534 223.284 113.114 222.865 112.6 222.599C103 218.299 94.2999 211.699 88.8999 204.999C88.6661 204.653 88.577 204.228 88.6518 203.817C88.7265 203.406 88.9591 203.041 89.2999 202.799C91.9999 201.199 95.2999 200.299 95.9999 197.699C97.6999 191.399 97.4999 183.499 97.3999 180.299H161Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M193.2 97.3991C195.2 81.2991 187.6 66.8991 188.1 50.8991C188.2 47.3991 187.8 44.1991 184.5 42.6991C181.2 41.1991 179.9 42.5991 175.4 42.2991C167.9 41.7991 167.9 37.3991 160.4 37.2991C152.9 37.1991 152.9 41.1991 145.4 41.1991C137.9 41.1991 137.9 37.1991 130.4 37.1991C122.9 37.1991 122.9 41.0991 115.4 40.9991C107.9 40.8991 107.9 37.0991 100.4 36.9991C92.9001 36.8991 92.8001 44.1991 85.3001 44.8991C79.6001 45.3991 80.5001 43.6991 74.9001 43.6991C69.3001 43.6991 68.4001 50.2991 68.6001 53.7991C68.8001 61.9991 68.7001 67.9991 68.4001 72.5991C67.5001 86.7991 64.9001 88.0991 65.7001 100.299L193.2 97.3991Z\" fill=\"%23091E42\"/%3E%3Cpath d=\"M78.4826 141.35C85.6129 139.586 89.6185 130.984 87.4294 122.138C85.2402 113.293 77.6853 107.552 70.5551 109.317C63.4248 111.081 59.4192 119.683 61.6083 128.529C63.7974 137.374 71.3523 143.115 78.4826 141.35Z\" fill=\"%2372594B\"/%3E%3Cpath d=\"M197.186 129.318C199.468 120.496 195.553 111.853 188.441 110.014C181.33 108.175 173.715 113.836 171.434 122.658C169.152 131.481 173.067 140.124 180.179 141.963C187.29 143.802 194.905 138.141 197.186 129.318Z\" fill=\"%2372594B\"/%3E%3Cpath d=\"M129.2 54.0996C156.9 54.3996 173.8 61.1996 176.3 64.1996C193.8 84.4996 191.8 108.6 191.4 113.7C190.4 126.1 185.3 136 175.6 156C171.133 165.17 166.159 174.083 160.7 182.7C159.158 185.112 156.977 187.051 154.4 188.3C146.364 192.397 137.516 194.651 128.5 194.9C119.507 194.539 110.702 192.218 102.7 188.1C100.167 186.779 98.028 184.813 96.5 182.4C91.1588 173.699 86.2853 164.719 81.9 155.5C72.3 135.4 67.3 125.5 66.4 113.1C66.1 108 64.3 83.8996 82 63.7996C84.6 60.7996 101.5 54.0996 129.2 54.0996Z\" fill=\"%23926D5A\"/%3E%3Cpath d=\"M180.5 59.2988C172.2 50.4988 159.1 50.3988 131.4 50.0988C103.7 49.7988 85.5 51.4988 79.1 58.7988C61.4 78.8988 66.2 107.999 66.6 113.099C67.056 119.034 68.4045 124.866 70.6 130.399C71.9098 128.682 72.9859 126.799 73.8 124.799C77.8 114.999 71.8 97.0988 77.3 88.1988C79.0638 85.4024 81.5062 83.0975 84.4 81.4988C95.5 74.8988 106.1 83.2988 124.3 85.3988C151 88.4988 163.7 74.5988 174.8 83.9988C180.6 88.8988 182.4 96.9988 182.6 97.9988C184.9 108.899 178.4 126.099 182.4 134.699C183.003 135.804 183.671 136.872 184.4 137.899C188.5 128.699 190.9 121.699 191.6 113.699C192 108.599 198.9 78.7988 180.5 59.2988Z\" fill=\"url(%23paint1_linear)\"/%3E%3Cpath d=\"M123.7 111.398C125.098 115.168 125.71 119.184 125.5 123.198C125.437 125.187 125.169 127.165 124.7 129.098C124.217 131.013 123.582 132.886 122.8 134.698C122.733 134.87 122.601 135.009 122.432 135.084C122.264 135.158 122.072 135.164 121.9 135.098C121.728 135.031 121.59 134.899 121.515 134.731C121.44 134.562 121.435 134.371 121.5 134.198C122.745 130.623 123.452 126.882 123.6 123.098C123.733 121.197 123.666 119.286 123.4 117.398C123.178 115.539 122.81 113.7 122.3 111.898C122.264 111.714 122.295 111.522 122.386 111.357C122.477 111.193 122.624 111.066 122.8 110.998C122.973 110.955 123.156 110.971 123.319 111.044C123.482 111.116 123.616 111.241 123.7 111.398Z\" fill=\"%2372594B\"/%3E%3Cpath d=\"M115 112.199L114.3 111.799L113.4 111.299L111.7 110.599C110.503 110.094 109.265 109.693 108 109.399C105.516 108.782 102.958 108.513 100.4 108.599C97.798 108.726 95.2327 109.266 92.8 110.199C91.5613 110.718 90.3587 111.319 89.2 111.999C88.1154 112.687 87.1095 113.491 86.2 114.399H86.1C85.9885 114.51 85.8561 114.599 85.7102 114.66C85.5644 114.72 85.408 114.751 85.25 114.751C85.0921 114.751 84.9357 114.72 84.7899 114.66C84.644 114.599 84.5115 114.51 84.4 114.399C84.2074 114.226 84.0818 113.991 84.0452 113.735C84.0087 113.479 84.0635 113.218 84.2 112.999C84.9853 111.605 86.039 110.382 87.3 109.399C88.4139 108.301 89.6969 107.389 91.1 106.699C93.815 105.084 96.855 104.093 100 103.799C103.116 103.434 106.273 103.672 109.3 104.499C110.817 104.882 112.291 105.418 113.7 106.099L115.8 107.299L116.8 108.099L117.8 108.999C118.006 109.187 118.173 109.415 118.29 109.669C118.407 109.923 118.472 110.198 118.481 110.477C118.49 110.757 118.444 111.035 118.344 111.297C118.244 111.558 118.093 111.796 117.9 111.999C117.56 112.323 117.128 112.535 116.663 112.607C116.198 112.678 115.722 112.606 115.3 112.399L115 112.199Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M139.3 109.098L140.4 108.198L141.4 107.498C142.006 107.005 142.68 106.601 143.4 106.298C144.848 105.601 146.353 105.033 147.9 104.598C150.946 103.884 154.095 103.715 157.2 104.098C160.336 104.439 163.366 105.427 166.1 106.998C167.47 107.784 168.744 108.723 169.9 109.798C171.104 110.813 172.119 112.032 172.9 113.398C173.047 113.692 173.078 114.031 172.985 114.347C172.892 114.662 172.683 114.931 172.4 115.098C172.17 115.192 171.919 115.223 171.673 115.188C171.427 115.153 171.195 115.053 171 114.898H170.9C169.991 113.991 168.985 113.187 167.9 112.498C166.752 111.799 165.548 111.197 164.3 110.698C161.919 109.698 159.38 109.122 156.8 108.998C154.213 108.834 151.616 109.07 149.1 109.698L145.4 110.798L143.7 111.598L142.9 111.998L142.1 112.398L141.8 112.598C141.294 112.85 140.71 112.897 140.17 112.729C139.63 112.561 139.175 112.192 138.9 111.698C138.641 111.29 138.539 110.801 138.613 110.323C138.686 109.845 138.93 109.41 139.3 109.098Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M90.8998 117.798C93.9548 115.65 97.5675 114.434 101.3 114.298C105.086 114.21 108.812 115.254 112 117.298C112.102 117.368 112.188 117.457 112.254 117.562C112.32 117.666 112.363 117.783 112.382 117.905C112.401 118.027 112.394 118.151 112.363 118.27C112.332 118.39 112.276 118.501 112.2 118.598C112.076 118.792 111.883 118.931 111.66 118.987C111.436 119.043 111.2 119.011 111 118.898C109.524 118.061 107.943 117.422 106.3 116.998C103.031 116.101 99.5857 116.066 96.2998 116.898C94.6245 117.321 93.011 117.96 91.4998 118.798C91.439 118.852 91.366 118.89 91.2872 118.909C91.2083 118.929 91.1259 118.929 91.0472 118.909C90.9684 118.889 90.8956 118.851 90.8351 118.796C90.7746 118.742 90.7281 118.674 90.6998 118.598C90.646 118.537 90.6078 118.464 90.5885 118.386C90.5692 118.307 90.5695 118.224 90.5891 118.146C90.6088 118.067 90.6474 117.994 90.7015 117.933C90.7557 117.873 90.8237 117.827 90.8998 117.798Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M166.1 119.198C164.619 118.346 163.041 117.675 161.4 117.198C159.732 116.77 158.021 116.535 156.3 116.498C154.607 116.478 152.922 116.714 151.3 117.198C149.663 117.64 148.084 118.278 146.6 119.098C146.387 119.203 146.142 119.22 145.918 119.145C145.693 119.07 145.507 118.909 145.4 118.698C145.287 118.498 145.255 118.262 145.311 118.039C145.367 117.815 145.506 117.622 145.7 117.498C148.878 115.443 152.618 114.429 156.4 114.598C160.149 114.728 163.773 115.982 166.8 118.198C166.868 118.237 166.927 118.29 166.971 118.356C167.015 118.421 167.043 118.495 167.052 118.573C167.062 118.651 167.053 118.73 167.027 118.804C167 118.878 166.957 118.944 166.9 118.998C166.817 119.128 166.688 119.22 166.54 119.258C166.391 119.295 166.234 119.274 166.1 119.198Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M155.2 121.798C156.967 121.798 158.4 120.366 158.4 118.598C158.4 116.831 156.967 115.398 155.2 115.398C153.433 115.398 152 116.831 152 118.598C152 120.366 153.433 121.798 155.2 121.798Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M102 121.599C103.767 121.599 105.2 120.167 105.2 118.399C105.2 116.632 103.767 115.199 102 115.199C100.232 115.199 98.7998 116.632 98.7998 118.399C98.7998 120.167 100.232 121.599 102 121.599Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M117.9 143.5L123.6 145.6L126.3 146.9L127.4 147.4H128.6C129.471 147.218 130.313 146.915 131.1 146.5C132.024 146.03 132.997 145.662 134 145.4C135.936 144.744 137.957 144.374 140 144.3C140.169 144.298 140.334 144.358 140.463 144.468C140.591 144.579 140.676 144.732 140.7 144.9C140.702 145.069 140.642 145.234 140.531 145.362C140.421 145.491 140.268 145.575 140.1 145.6C138.188 145.865 136.311 146.334 134.5 147L131.9 148.1C130.938 148.644 129.889 149.016 128.8 149.2H127.1C126.512 149.02 125.943 148.786 125.4 148.5L122.8 147.2L117.5 144.6H117.4C117.322 144.559 117.253 144.502 117.2 144.433C117.146 144.363 117.108 144.282 117.089 144.197C117.07 144.111 117.07 144.022 117.089 143.936C117.108 143.85 117.146 143.769 117.2 143.7C117.287 143.605 117.398 143.537 117.522 143.502C117.645 143.466 117.776 143.466 117.9 143.5Z\" fill=\"%2372594B\"/%3E%3Cpath d=\"M118.9 178.199C121.869 176.376 125.323 175.504 128.8 175.699C132.215 175.77 135.568 176.626 138.6 178.199C138.9 178.399 138.9 178.599 138.8 178.899L138.3 179.099C135.184 178.162 131.954 177.657 128.7 177.599C125.532 177.492 122.374 178.002 119.4 179.099H119.3C119.1 179.199 118.7 178.999 118.6 178.699C118.585 178.646 118.581 178.591 118.588 178.537C118.596 178.483 118.614 178.43 118.642 178.384C118.67 178.337 118.707 178.296 118.752 178.264C118.796 178.233 118.847 178.21 118.9 178.199Z\" fill=\"%2372594B\"/%3E%3Cpath d=\"M129.7 166.698C122.92 166.686 116.203 165.397 109.9 162.898C110.8 164.098 117.7 171.198 129.3 171.198C140.9 171.198 147.9 164.298 148.8 163.098C142.708 165.459 136.233 166.679 129.7 166.698Z\" fill=\"%23745949\"/%3E%3Cpath d=\"M148.8 163.098L145 162.398C139.1 161.098 136.9 159.498 133.1 159.998C131.894 160.12 130.714 160.423 129.6 160.898C128.352 160.386 127.04 160.05 125.7 159.898C121.7 159.598 119.5 161.198 113.7 162.298L109.9 162.898C116.203 165.397 122.92 166.686 129.7 166.698C136.233 166.679 142.708 165.459 148.8 163.098Z\" fill=\"%234E3B31\"/%3E%3Cpath d=\"M108.1 160.697C109.732 161.526 111.44 162.196 113.2 162.697C114.923 163.316 116.696 163.784 118.5 164.097C122.085 164.831 125.741 165.166 129.4 165.097C133.06 165.078 136.71 164.709 140.3 163.997C142.099 163.706 143.871 163.271 145.6 162.697C147.322 162.178 148.995 161.509 150.6 160.697H150.7C150.75 160.639 150.815 160.596 150.889 160.574C150.962 160.552 151.041 160.551 151.114 160.572C151.188 160.593 151.254 160.635 151.305 160.693C151.356 160.75 151.389 160.821 151.4 160.897C151.458 160.947 151.501 161.012 151.524 161.086C151.546 161.159 151.546 161.238 151.525 161.312C151.504 161.385 151.462 161.451 151.405 161.502C151.347 161.553 151.276 161.586 151.2 161.597C147.977 163.652 144.425 165.14 140.7 165.997C136.99 166.83 133.202 167.266 129.4 167.297C125.595 167.315 121.802 166.879 118.1 165.997C114.348 165.177 110.763 163.722 107.5 161.697C107.387 161.6 107.314 161.464 107.296 161.316C107.277 161.169 107.314 161.019 107.4 160.897C107.5 160.597 107.8 160.597 108.1 160.697Z\" fill=\"%23230F05\"/%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"129.17\" y1=\"233.169\" x2=\"129.17\" y2=\"152.079\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop offset=\"0.17\" stop-color=\"%23926D5A\"/%3E%3Cstop offset=\"0.71\" stop-color=\"%237F6151\"/%3E%3Cstop offset=\"1\" stop-color=\"%2372594B\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint1_linear\" x1=\"129.929\" y1=\"70.1554\" x2=\"128.495\" y2=\"143.349\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop offset=\"0.09\" stop-color=\"%23091E42\"/%3E%3Cstop offset=\"0.54\" stop-color=\"%234B444E\"/%3E%3Cstop offset=\"1\" stop-color=\"%23926D5A\"/%3E%3C/linearGradient%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Aliza.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::f41ef169453bd43f60cf0d992b8c571e>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"256\" viewBox=\"0 0 256 256\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0H256V256H0V0Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256C198.692 256 256 198.692 256 128C256 57.3075 198.692 0 128 0C57.3075 0 0 57.3075 0 128C0 198.692 57.3075 256 128 256Z\" fill=\"%2357D9A3\"/%3E%3Cpath d=\"M171.4 206.4L132.3 204.4L93.3001 206.4C92.5551 206.467 91.836 206.707 91.2001 207.1L55.8001 230.5C55.0249 231.011 54.2895 231.579 53.6001 232.2C76.0451 248.218 103.063 256.56 130.631 255.983C158.199 255.406 184.844 245.943 206.6 229L173.5 207.1C172.852 206.734 172.139 206.497 171.4 206.4Z\" fill=\"%2300875A\"/%3E%3Cpath d=\"M217.6 99.9009C217.6 102.601 213.5 105.101 213.3 107.801C213.1 110.501 216.6 113.601 216.1 116.201C215.6 118.801 211.2 120.601 210.4 123.201C209.6 125.801 212.6 129.501 211.6 132.001C210.6 134.501 206 135.401 204.8 137.701C203.6 140.001 205.7 144.401 204.3 146.701C202.9 149.001 198.1 148.901 196.5 151.001C194.9 153.101 196.2 157.701 194.4 159.701C192.6 161.701 188 160.801 186 162.601C184 164.401 184.5 169.101 182.3 170.701C180.1 172.301 175.8 170.601 173.5 172.101C171.2 173.601 170.8 178.201 168.4 179.401C166 180.601 162 178.101 159.5 179.001C157 179.901 155.7 184.601 153.1 185.301C150.5 186.001 147.1 182.801 144.4 183.301C141.7 183.801 139.7 188.001 137 188.301C134.3 188.601 131.6 184.701 128.9 184.701C126.2 184.701 123.3 188.501 120.7 188.301C118.1 188.101 115.9 183.801 113.3 183.301C110.7 182.801 107.1 186.001 104.6 185.301C102.1 184.601 100.7 180.001 98.2001 179.001C95.7001 178.001 91.7001 180.601 89.3001 179.401C86.9001 178.201 86.5001 173.501 84.2001 172.101C81.9001 170.701 77.5001 172.401 75.4001 170.701C73.3001 169.001 73.7001 164.401 71.7001 162.601C69.7001 160.801 65.1001 161.701 63.3001 159.701C61.5001 157.701 62.8001 153.201 61.2001 151.001C59.6001 148.801 54.8001 148.901 53.4001 146.701C52.0001 144.501 54.1001 140.101 52.9001 137.701C51.7001 135.301 47.1001 134.501 46.1001 132.001C45.1001 129.501 48.0001 125.701 47.3001 123.201C46.6001 120.701 42.1001 118.901 41.6001 116.201C41.1001 113.501 44.6001 110.401 44.4001 107.801C44.2001 105.201 40.1001 102.601 40.1001 99.9009C40.1001 97.2009 44.2001 94.7009 44.4001 92.1009C44.6001 89.5009 41.1001 86.2009 41.6001 83.6009C42.1001 81.0009 46.5001 79.3008 47.3001 76.7009C48.1001 74.1009 45.1001 70.4009 46.1001 67.9009C47.1001 65.4009 51.7001 64.5009 52.9001 62.1009C54.1001 59.7009 52.0001 55.5009 53.4001 53.2009C54.8001 50.9009 59.6001 51.0009 61.2001 48.8009C62.8001 46.6009 61.5001 42.1009 63.3001 40.2009C65.1001 38.3009 69.7001 39.1009 71.7001 37.3009C73.7001 35.5009 73.2001 30.7009 75.4001 29.1009C77.6001 27.5009 81.9001 29.2009 84.2001 27.8009C86.5001 26.4009 86.9001 21.7009 89.3001 20.5009C91.7001 19.3009 95.7001 21.8009 98.2001 20.8009C100.7 19.8009 102 15.3009 104.6 14.6009C107.2 13.9009 110.6 17.0009 113.3 16.6009C116 16.2009 118 11.8009 120.7 11.6009C123.4 11.4009 126.2 15.1009 128.9 15.1009C131.6 15.1009 134.4 11.3009 137 11.6009C139.6 11.9009 141.8 16.1009 144.4 16.6009C147 17.1009 150.6 13.8009 153.1 14.6009C155.6 15.4009 157 19.9009 159.5 20.8009C162 21.7009 166 19.3009 168.4 20.5009C170.8 21.7009 171.2 26.4009 173.5 27.8009C175.8 29.2009 180.2 27.5009 182.3 29.1009C184.4 30.7009 184 35.5009 186 37.3009C188 39.1009 192.6 38.2009 194.4 40.2009C196.2 42.2009 194.9 46.7009 196.5 48.8009C198.1 50.9009 202.9 50.9009 204.3 53.2009C205.7 55.5009 203.6 59.7009 204.8 62.1009C206 64.5009 210.6 65.4009 211.6 67.9009C212.6 70.4009 209.7 74.1009 210.4 76.7009C211.1 79.3008 215.6 81.0009 216.1 83.6009C216.6 86.2009 213.1 89.4009 213.3 92.1009C213.5 94.8008 217.6 97.2009 217.6 99.9009Z\" fill=\"%2372594B\"/%3E%3Cpath d=\"M88 190.301L177.5 191.701L175.8 208.901L89.4 208.401L88 190.301Z\" fill=\"%2300875A\"/%3E%3Cpath d=\"M159.7 218.3L132.8 247.7L103.4 217.7C101.184 215.438 99.7685 212.513 99.3712 209.371C98.974 206.229 99.6163 203.043 101.2 200.3C102.575 197.978 103.555 195.444 104.1 192.8C106.9 179 97.8002 168.6 96.7002 167.5L164.1 164.9C162.8 166.9 155.7 178.2 159.3 192.1C159.93 194.37 160.837 196.553 162 198.6C163.712 201.716 164.41 205.287 163.998 208.818C163.586 212.349 162.084 215.663 159.7 218.3Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M78.3 140.301C85.9215 140.301 92.1 134.123 92.1 126.501C92.1 118.88 85.9215 112.701 78.3 112.701C70.6785 112.701 64.5 118.88 64.5 126.501C64.5 134.123 70.6785 140.301 78.3 140.301Z\" fill=\"%234A3222\"/%3E%3Cpath d=\"M180.3 140.301C187.922 140.301 194.1 134.123 194.1 126.501C194.1 118.88 187.922 112.701 180.3 112.701C172.678 112.701 166.5 118.88 166.5 126.501C166.5 134.123 172.678 140.301 180.3 140.301Z\" fill=\"%234A3222\"/%3E%3Cpath d=\"M77.4002 98.3015C80.2002 103.968 82.8002 109.468 85.2002 114.801C87.5002 120.101 87.0002 119.301 89.2002 124.401C95.5002 138.601 98.0002 141.801 96.7002 146.601C95.9002 149.701 93.7002 152.801 92.1002 152.501C90.5002 152.201 90.6002 148.201 88.9002 142.901C84.5002 130.001 74.5002 119.901 73.6002 119.001C72.7002 118.101 69.3002 115.101 67.7002 111.501C66.1002 107.901 64.5002 104.501 67.0002 101.001C69.5002 97.5015 73.1002 97.2015 77.4002 98.3015Z\" fill=\"%2372594B\"/%3E%3Cpath d=\"M185.2 121.301C184 150.901 153.3 184.901 129.5 184.901C105.7 184.901 74.9999 150.901 73.7999 121.301C72.4999 88.6008 96.9999 51.8008 129.5 51.8008C162 51.8008 186.5 88.6008 185.2 121.301Z\" fill=\"%23543E36\"/%3E%3Cpath d=\"M172.1 104.101C169.555 102.423 166.88 100.952 164.1 99.7008C161.306 98.576 158.311 98.0316 155.3 98.1008C152.32 98.1224 149.369 98.6989 146.6 99.8009C143.829 100.931 141.287 102.558 139.1 104.601C138.913 104.784 138.662 104.887 138.4 104.887C138.138 104.887 137.887 104.784 137.7 104.601C137.553 104.397 137.475 104.152 137.475 103.901C137.475 103.65 137.553 103.405 137.7 103.201C139.998 100.881 142.712 99.0156 145.7 97.7008C148.743 96.4387 152.006 95.7929 155.3 95.8009C158.603 95.8082 161.869 96.4887 164.9 97.8009C167.959 98.9799 170.578 101.076 172.4 103.801C172.44 103.841 172.462 103.895 172.462 103.951C172.462 104.007 172.44 104.061 172.4 104.101C172.36 104.141 172.306 104.163 172.25 104.163C172.194 104.163 172.14 104.141 172.1 104.101Z\" fill=\"%23091E42\"/%3E%3Cpath d=\"M82.5 103.801C84.3217 101.076 86.9413 98.9802 90 97.8012C93.0308 96.4891 96.2973 95.8085 99.6 95.8012C102.895 95.7825 106.16 96.4287 109.2 97.7012C112.203 98.9896 114.922 100.859 117.2 103.201C117.315 103.287 117.409 103.397 117.478 103.523C117.547 103.648 117.587 103.787 117.597 103.93C117.608 104.073 117.587 104.217 117.537 104.351C117.487 104.485 117.408 104.607 117.307 104.708C117.206 104.81 117.084 104.888 116.95 104.938C116.815 104.988 116.672 105.009 116.529 104.999C116.386 104.988 116.247 104.948 116.121 104.879C115.996 104.811 115.886 104.716 115.8 104.601C113.613 102.558 111.071 100.932 108.3 99.8012C105.533 98.6901 102.581 98.1132 99.6 98.1012C96.5885 98.0319 93.5944 98.5763 90.8 99.7012C88 100.801 85.6 102.501 82.8 104.101C82.7 104.201 82.5 104.201 82.5 104.001C82.5 103.801 82.4 103.801 82.5 103.801Z\" fill=\"%23091E42\"/%3E%3Cpath d=\"M103.6 117.002C105.643 117.002 107.3 115.345 107.3 113.302C107.3 111.258 105.643 109.602 103.6 109.602C101.556 109.602 99.8999 111.258 99.8999 113.302C99.8999 115.345 101.556 117.002 103.6 117.002Z\" fill=\"%23091E42\"/%3E%3Cpath d=\"M87.1001 112.001C87.5861 112.225 88.1149 112.341 88.6501 112.341C89.1853 112.341 89.7141 112.225 90.2001 112.001L90.7001 111.601L90.9001 111.401L91.3001 111.101C91.7856 110.582 92.3216 110.113 92.9001 109.701C95.1286 107.9 97.7783 106.696 100.6 106.201C103.409 105.749 106.284 105.954 109 106.801C111.702 107.741 114.138 109.319 116.1 111.401C116.212 111.512 116.301 111.645 116.361 111.79C116.422 111.936 116.453 112.093 116.453 112.251C116.453 112.409 116.422 112.565 116.361 112.711C116.301 112.857 116.212 112.989 116.1 113.101C115.856 113.287 115.557 113.388 115.25 113.388C114.943 113.388 114.644 113.287 114.4 113.101C112.617 111.468 110.502 110.241 108.2 109.501C105.895 108.838 103.476 108.667 101.1 109.001C98.6939 109.391 96.405 110.314 94.4001 111.701C93.9091 112.071 93.4416 112.472 93.0001 112.901L92.6001 113.201L92.1001 113.601L90.9001 114.101C90.1236 114.369 89.2773 114.356 88.5094 114.064C87.7415 113.771 87.101 113.218 86.7001 112.501C86.656 112.419 86.6419 112.324 86.6601 112.233C86.6784 112.141 86.7279 112.059 86.8001 112.001H87.1001Z\" fill=\"%23091E42\"/%3E%3Cpath d=\"M155.3 117.002C157.344 117.002 159 115.345 159 113.302C159 111.258 157.344 109.602 155.3 109.602C153.257 109.602 151.6 111.258 151.6 113.302C151.6 115.345 153.257 117.002 155.3 117.002Z\" fill=\"%23091E42\"/%3E%3Cpath d=\"M172.1 112.501C171.699 113.218 171.059 113.771 170.291 114.064C169.523 114.356 168.677 114.369 167.9 114.101L166.7 113.601L166.2 113.201L165.8 112.901C165.359 112.472 164.891 112.071 164.4 111.701C162.423 110.33 160.171 109.409 157.8 109.001C155.391 108.665 152.939 108.835 150.6 109.501C148.298 110.241 146.184 111.468 144.4 113.101C144.282 113.206 144.145 113.287 143.995 113.339C143.846 113.392 143.687 113.414 143.529 113.404C143.371 113.395 143.217 113.355 143.074 113.285C142.932 113.216 142.805 113.119 142.7 113.001C142.503 112.781 142.395 112.496 142.395 112.201C142.395 111.905 142.503 111.621 142.7 111.401C144.663 109.319 147.098 107.741 149.8 106.801C152.516 105.954 155.391 105.749 158.2 106.201C161.022 106.696 163.672 107.9 165.9 109.701C166.479 110.113 167.015 110.582 167.5 111.101L167.9 111.401L168.1 111.601L168.6 112.001C169.086 112.225 169.615 112.341 170.15 112.341C170.685 112.341 171.214 112.225 171.7 112.001C171.9 111.901 172.1 112.001 172.1 112.201C172.121 112.219 172.138 112.242 172.15 112.268C172.162 112.294 172.168 112.322 172.168 112.351C172.168 112.379 172.162 112.407 172.15 112.433C172.138 112.459 172.121 112.482 172.1 112.501Z\" fill=\"%23091E42\"/%3E%3Cpath d=\"M120.4 139.4L123.9 140.3L125.7 140.7L127.2 141.1C128.283 141.065 129.358 140.897 130.4 140.6C131.526 140.359 132.63 140.024 133.7 139.6C133.899 139.536 134.115 139.553 134.302 139.646C134.489 139.74 134.631 139.902 134.7 140.1C134.752 140.262 134.752 140.437 134.698 140.599C134.644 140.761 134.539 140.901 134.4 141C133.348 141.691 132.203 142.23 131 142.6C129.762 143.099 128.434 143.337 127.1 143.3C126.415 143.284 125.738 143.148 125.1 142.9L123.3 142.3C122.124 141.903 120.986 141.401 119.9 140.8C119.811 140.758 119.731 140.698 119.667 140.623C119.602 140.549 119.554 140.461 119.526 140.367C119.498 140.273 119.49 140.173 119.502 140.076C119.515 139.978 119.548 139.884 119.6 139.8C119.687 139.669 119.806 139.564 119.947 139.493C120.087 139.423 120.243 139.391 120.4 139.4Z\" fill=\"%23091E42\"/%3E%3Cpath d=\"M122.5 115.802C123.07 117.156 123.505 118.563 123.8 120.002C124.071 121.455 124.238 122.925 124.3 124.402C124.3 125.84 124.2 127.277 124 128.702C123.821 130.167 123.486 131.608 123 133.002C122.981 133.108 122.936 133.209 122.871 133.296C122.806 133.382 122.722 133.453 122.625 133.501C122.528 133.55 122.421 133.575 122.313 133.575C122.204 133.575 122.097 133.55 122 133.502C121.816 133.437 121.658 133.314 121.55 133.152C121.442 132.99 121.389 132.797 121.4 132.602C121.6 131.202 121.8 129.902 121.9 128.502C122.033 127.139 122.067 125.769 122 124.402C122 123.063 121.9 121.726 121.7 120.402C121.5 119.002 121.2 117.702 120.9 116.302C120.87 116.078 120.925 115.85 121.055 115.665C121.184 115.48 121.379 115.35 121.6 115.302C121.785 115.266 121.977 115.296 122.141 115.388C122.306 115.479 122.433 115.626 122.5 115.802Z\" fill=\"%23091E42\"/%3E%3Cpath d=\"M149.6 156.7C136.469 161.369 122.131 161.369 109 156.7L114.9 154.7C117.914 153.631 121.21 153.666 124.2 154.8H124.4C127.557 155.999 131.043 155.999 134.2 154.8C137.223 153.684 140.533 153.613 143.6 154.6L149.6 156.7Z\" fill=\"%23FF5630\"/%3E%3Cpath d=\"M149.6 156.701C149.6 156.701 144.9 166.701 129.3 166.701C113.7 166.701 109 156.701 109 156.701C122.131 161.369 136.469 161.369 149.6 156.701Z\" fill=\"%23FF7452\"/%3E%3Cpath d=\"M106.4 154.701C108.2 155.501 110.1 156.201 111.9 156.801C113.7 157.401 115.7 158.001 117.6 158.501C125.352 160.133 133.362 160.099 141.1 158.401C144.955 157.527 148.709 156.253 152.3 154.601C152.408 154.56 152.526 154.558 152.636 154.594C152.745 154.63 152.838 154.704 152.9 154.801C153 155.001 152.9 155.201 152.7 155.401C145.71 159.762 137.639 162.083 129.4 162.101C127.326 162.12 125.254 161.987 123.2 161.701C121.132 161.504 119.089 161.102 117.1 160.501C113.128 159.482 109.323 157.9 105.8 155.801C105.663 155.701 105.568 155.554 105.531 155.389C105.494 155.223 105.519 155.05 105.6 154.901C105.628 154.825 105.675 154.757 105.735 154.703C105.796 154.649 105.868 154.61 105.947 154.59C106.026 154.571 106.108 154.57 106.187 154.59C106.266 154.609 106.339 154.647 106.4 154.701Z\" fill=\"%23091E42\"/%3E%3Cg style=\"mix-blend-mode:multiply\" opacity=\"0.31\"%3E%3Cg style=\"mix-blend-mode:multiply\" opacity=\"0.31\"%3E%3Cpath d=\"M156.8 156.9C156.284 155.29 155.579 153.746 154.7 152.3C154.288 151.602 153.783 150.963 153.2 150.4C152.654 149.718 152.052 149.083 151.4 148.5C151.348 148.409 151.32 148.306 151.32 148.2C151.32 148.095 151.348 147.992 151.4 147.9H151.8C153.718 148.391 155.368 149.611 156.4 151.3C157.511 152.98 157.973 155.006 157.7 157C157.6 157.2 157.4 157.4 157.2 157.3C157 157.2 156.9 157.2 156.8 157V156.9Z\" fill=\"%23543E36\"/%3E%3C/g%3E%3C/g%3E%3Cg style=\"mix-blend-mode:multiply\" opacity=\"0.31\"%3E%3Cg style=\"mix-blend-mode:multiply\" opacity=\"0.31\"%3E%3Cpath d=\"M106.2 146.201C105.108 147.489 104.168 148.898 103.4 150.401L102.5 152.701L101.9 155.201C101.888 155.255 101.866 155.305 101.834 155.35C101.802 155.394 101.762 155.431 101.715 155.459C101.668 155.488 101.616 155.506 101.562 155.513C101.508 155.52 101.452 155.516 101.4 155.501L101.1 155.301C100.781 154.352 100.661 153.347 100.747 152.349C100.833 151.352 101.123 150.382 101.6 149.501C102.456 147.729 103.907 146.313 105.7 145.501C105.808 145.46 105.926 145.458 106.036 145.494C106.145 145.531 106.238 145.604 106.3 145.701C106.315 145.874 106.281 146.048 106.2 146.201Z\" fill=\"%23543E36\"/%3E%3C/g%3E%3C/g%3E%3Cpath d=\"M192.2 64.8006C191.2 62.4006 193.5 58.0006 191.9 55.5006C190.3 53.0006 185.5 53.4006 183.5 51.2006C181.5 49.0006 182.6 44.4006 180.4 42.4006C178.2 40.4006 173.6 42.0006 171.3 40.3006C169 38.6006 168.8 33.8006 166.3 32.3006C163.8 30.8006 159.5 33.2006 157 32.0006C154.5 30.8006 153.2 26.1006 150.6 25.2006C148 24.3006 144 27.4006 141.4 26.9006C138.8 26.4006 136.2 21.9006 133.5 21.8006C130.8 21.7006 127.9 25.8006 125.3 26.2006C122.7 26.6006 118.3 23.9006 116 25.2006C113.7 26.5006 114.1 31.3006 112.7 33.7006C112.145 34.5277 111.471 35.2689 110.7 35.9006C108.2 35.9006 104.9 33.0006 102.3 33.8006C99.7003 34.6006 98.9003 39.3006 96.3003 40.5006C93.7003 41.7006 89.8003 39.2006 87.4003 40.6006C85.0003 42.0006 85.1003 46.7006 82.8003 48.2006C80.5003 49.7006 76.1003 48.0006 74.0003 49.7006C71.9003 51.4006 72.4003 56.2006 70.5003 57.9006C68.6003 59.6006 63.8003 58.8006 62.1003 60.7006C60.4003 62.6006 61.5003 67.3006 59.9003 69.4006C58.3003 71.5006 53.4003 71.5006 52.1003 73.7006C50.8003 75.9006 53.0003 80.3006 52.1003 82.5006C51.2003 84.7006 46.6003 87.1006 46.5003 89.5006C46.4003 91.9006 50.6003 93.8006 52.1003 95.8006C53.6003 97.8006 54.1003 102.201 57.0003 102.801C59.9003 103.401 62.1003 99.3006 65.1003 98.9006C68.1003 98.5006 71.0003 101.801 73.7003 100.901C76.4003 100.001 77.1003 95.4006 79.7003 94.3006C82.3003 93.2006 86.2003 95.5006 88.6003 94.2006C91.0003 92.9006 91.0003 88.1006 93.2003 86.5006C95.4003 84.9006 99.9003 86.7006 102 85.0006C104.1 83.3006 103.6 78.6006 105.5 76.8006C107.4 75.0006 112.2 75.9006 114 74.0006C115.8 72.1006 114.5 67.4006 116.1 65.4006C117.7 63.4006 119.7 63.4006 121.6 62.7006C122.8 65.0006 122.3 69.0006 124.3 70.8006C126.3 72.6006 131 71.2006 133.4 72.9006C135.8 74.6006 135.8 79.4006 138.3 80.8006C140.8 82.2006 145.2 80.0006 147.7 81.2006C150.2 82.4006 151.5 87.1006 154.1 88.0006C156.7 88.9006 160.6 85.8006 163.3 86.3006C166 86.8006 168.5 91.2006 171.2 91.4006C173.9 91.6006 176.8 87.4006 179.4 87.0006C182 86.6006 186.4 89.3006 188.7 88.0006C191 86.7006 190.6 81.9006 192 79.5006C193.4 77.1006 197.7 75.3006 197.7 72.3006C197.7 69.3006 193.2 67.7006 192.2 64.8006Z\" fill=\"%2372594B\"/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"130.43\" y1=\"166.52\" x2=\"130.43\" y2=\"247.26\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23382926\"/%3E%3Cstop offset=\"0.64\" stop-color=\"%23543E36\"/%3E%3C/linearGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0H256V256H0V0Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Alvin.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::4aeae7d96cd38e73e5d3f5e5a7708a38>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"256\" viewBox=\"0 0 256 256\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cpath d=\"M0 0H256V256H0V0Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256C198.692 256 256 198.692 256 128C256 57.3075 198.692 0 128 0C57.3075 0 0 57.3075 0 128C0 198.692 57.3075 256 128 256Z\" fill=\"%230065FF\"/%3E%3Cpath d=\"M79.0708 141.895C86.4595 140.026 90.5601 131.045 88.2299 121.836C85.8996 112.627 78.0209 106.677 70.6323 108.546C63.2436 110.416 59.1429 119.397 61.4732 128.606C63.8034 137.815 71.6822 143.765 79.0708 141.895Z\" fill=\"%23F7D0C3\"/%3E%3Cpath d=\"M199.352 128.801C201.683 119.592 197.582 110.611 190.193 108.741C182.805 106.872 174.926 112.822 172.596 122.031C170.266 131.24 174.366 140.221 181.755 142.09C189.143 143.96 197.022 138.01 199.352 128.801Z\" fill=\"%23F7D0C3\"/%3E%3Cpath d=\"M211.5 225L185.5 210.5C184.725 209.909 183.775 209.593 182.8 209.6L132.4 207L82.0001 209.6C81.0298 209.62 80.0884 209.934 79.3001 210.5L48.1001 227.9C71.4116 246.521 100.492 256.421 130.323 255.891C160.154 255.362 188.864 244.436 211.5 225Z\" fill=\"%2366A3FF\"/%3E%3Cpath d=\"M181 216.499C179.8 217.999 160 242.399 127.4 239.999C101 238.099 86.0999 220.099 83.8999 217.299C90.0331 211.475 94.1676 203.86 95.7122 195.545C97.2569 187.229 96.1325 178.637 92.4999 170.999L170.1 169.199C168.9 171.499 162.4 184.899 168.1 199.799C170.708 206.489 175.186 212.286 181 216.499Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M130.9 41.0996C158.6 41.2996 175.5 59.9996 178.1 62.9996C195.6 83.1996 193.8 107.3 193.4 112.4C192.4 124.8 187.4 134.7 177.7 154.7C173.311 163.904 168.403 172.851 163 181.5C161.489 183.963 159.302 185.942 156.7 187.2C148.698 191.318 139.893 193.639 130.9 194C121.874 193.65 113.034 191.329 105 187.2C102.444 185.913 100.297 183.939 98.8002 181.5C93.3601 172.856 88.4187 163.908 84.0002 154.7C74.4002 134.7 69.3002 124.8 68.4002 112.4C68.0002 107.3 66.1002 83.1996 83.7002 62.9996C86.3002 59.9996 103.2 41.2996 130.9 41.0996Z\" fill=\"%23FFE2D9\"/%3E%3Cpath d=\"M115 109.999L113.4 109.099L111.7 108.299C110.469 107.794 109.198 107.393 107.9 107.099C105.352 106.465 102.721 106.229 100.1 106.399C97.443 106.508 94.8304 107.119 92.4002 108.199C91.1844 108.698 90.0135 109.3 88.9002 109.999C87.763 110.695 86.7209 111.535 85.8002 112.499C85.6132 112.682 85.3619 112.785 85.1001 112.785C84.8384 112.785 84.5871 112.682 84.4002 112.499C84.3011 112.439 84.2161 112.359 84.1511 112.263C84.0861 112.168 84.0426 112.059 84.0236 111.945C84.0046 111.831 84.0105 111.714 84.041 111.603C84.0715 111.491 84.1258 111.387 84.2001 111.299C85.0085 109.981 86.0211 108.799 87.2001 107.799C88.3584 106.755 89.6335 105.849 91.0001 105.099C93.6685 103.559 96.6343 102.604 99.7001 102.299C102.783 101.925 105.909 102.163 108.9 102.999C110.431 103.337 111.91 103.875 113.3 104.599L115.4 105.699C116.062 106.198 116.696 106.732 117.3 107.299C117.477 107.442 117.621 107.621 117.723 107.824C117.825 108.027 117.883 108.249 117.893 108.476C117.902 108.703 117.863 108.93 117.778 109.141C117.693 109.352 117.564 109.542 117.4 109.699C117.144 110.024 116.771 110.237 116.361 110.293C115.95 110.349 115.534 110.243 115.2 109.999H115Z\" fill=\"%23CE6E05\"/%3E%3Cpath d=\"M140.4 107.399C140.983 106.809 141.619 106.273 142.3 105.799L144.4 104.699C145.756 103.977 147.202 103.438 148.7 103.099C151.692 102.271 154.817 102.033 157.9 102.399C160.994 102.72 163.99 103.673 166.7 105.199C168.067 105.95 169.342 106.856 170.5 107.899C171.679 108.9 172.692 110.081 173.5 111.399C173.625 111.63 173.664 111.898 173.609 112.155C173.554 112.412 173.409 112.64 173.2 112.799C172.987 112.896 172.751 112.929 172.52 112.893C172.289 112.858 172.074 112.756 171.9 112.599C170.979 111.635 169.937 110.795 168.8 110.099C167.687 109.401 166.516 108.799 165.3 108.299C162.87 107.22 160.257 106.609 157.6 106.499C154.98 106.33 152.349 106.566 149.8 107.199C148.502 107.493 147.231 107.895 146 108.399L144.3 109.199L142.7 110.099H142.5C142.111 110.335 141.647 110.414 141.202 110.321C140.757 110.228 140.363 109.971 140.1 109.599C139.878 109.258 139.786 108.848 139.841 108.444C139.896 108.04 140.095 107.669 140.4 107.399Z\" fill=\"%23CE6E05\"/%3E%3Cpath d=\"M90.7 116C93.7701 113.881 97.3738 112.669 101.1 112.5C104.891 112.366 108.631 113.415 111.8 115.5C112.012 115.632 112.163 115.844 112.219 116.087C112.275 116.331 112.233 116.587 112.1 116.8C111.967 117.012 111.756 117.163 111.512 117.219C111.268 117.275 111.012 117.232 110.8 117.1C109.327 116.231 107.747 115.558 106.1 115.1C104.464 114.697 102.785 114.495 101.1 114.5C99.4126 114.446 97.7267 114.648 96.1 115.1C94.4209 115.558 92.8076 116.23 91.3 117.1C91.1522 117.145 90.9936 117.14 90.8489 117.086C90.7042 117.032 90.5815 116.931 90.5 116.8C90.4248 116.666 90.4036 116.509 90.4408 116.36C90.478 116.211 90.5707 116.082 90.7 116Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M165.9 117.1C164.419 116.248 162.841 115.576 161.2 115.1C159.538 114.654 157.82 114.452 156.1 114.5C152.686 114.428 149.321 115.33 146.4 117.1C146.185 117.181 145.948 117.186 145.729 117.113C145.51 117.041 145.323 116.894 145.2 116.7C145.087 116.499 145.056 116.263 145.111 116.04C145.167 115.817 145.306 115.623 145.5 115.5C148.67 113.415 152.409 112.366 156.2 112.5C159.923 112.684 163.523 113.896 166.6 116C166.671 116.048 166.73 116.112 166.774 116.186C166.818 116.259 166.846 116.341 166.855 116.427C166.865 116.512 166.856 116.598 166.829 116.68C166.802 116.762 166.758 116.836 166.7 116.9C166.605 117.013 166.477 117.094 166.333 117.13C166.189 117.166 166.038 117.155 165.9 117.1Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M155.1 119.798C156.868 119.798 158.3 118.366 158.3 116.598C158.3 114.831 156.868 113.398 155.1 113.398C153.333 113.398 151.9 114.831 151.9 116.598C151.9 118.366 153.333 119.798 155.1 119.798Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M101.8 119.798C103.567 119.798 105 118.366 105 116.598C105 114.831 103.567 113.398 101.8 113.398C100.033 113.398 98.6001 114.831 98.6001 116.598C98.6001 118.366 100.033 119.798 101.8 119.798Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M70.9002 100.799L74.9002 116.599C75.3834 118.504 75.2574 120.512 74.5399 122.342C73.8224 124.171 72.5495 125.73 70.9002 126.799C70.9002 126.799 66.8002 117.399 65.8002 112.799C64.8002 108.199 70.9002 100.799 70.9002 100.799Z\" fill=\"%23FF8B00\"/%3E%3Cpath d=\"M129.3 79.2997C151 79.1997 162.2 63.4997 170.4 69.3997C176.4 73.7997 171.5 83.1997 178.7 95.7997C182.754 102.561 188.604 108.066 195.6 111.7C195.8 109.4 198.2 74.8997 170.6 53.6997C146.6 35.1997 119.1 41.7997 115.9 42.5997C112.7 43.3997 87.6002 50.3997 74.7002 75.6997C69.3444 86.439 67.0275 98.4385 68.0003 110.4C73.6003 106.1 80.3003 99.3997 83.8003 89.6997C87.3003 79.9997 84.7003 74.2997 88.8003 70.8997C96.1003 64.7997 108.3 79.4997 129.3 79.2997Z\" fill=\"%23FF8B00\"/%3E%3Cpath d=\"M190.2 100.799L186.1 116.599C185.611 118.514 185.744 120.535 186.482 122.369C187.219 124.204 188.521 125.755 190.2 126.799C190.2 126.799 190.3 126.899 190.3 126.799C190.3 126.699 194.5 116.599 195.2 112.799C195.9 108.999 190.2 100.799 190.2 100.799Z\" fill=\"%23FF8B00\"/%3E%3Cpath d=\"M146.9 161.699C141.6 160.899 138.2 159.899 134.2 160.499H133.4C131.228 160.999 128.971 160.999 126.8 160.499H126C122.2 159.899 118.8 160.699 113.5 161.599L108.4 162.199C108.8 162.599 116.5 169.099 130.1 168.999C143.7 168.899 151.4 162.599 151.8 162.199C149.7 162.099 148 161.799 146.9 161.699Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M105.8 160.601C109.696 161.763 113.674 162.632 117.7 163.201C121.68 163.716 125.687 163.983 129.7 164.001C133.715 163.953 137.723 163.653 141.7 163.101L147.7 162.001C149.7 161.601 151.6 161.101 153.6 160.501C153.9 160.401 154.1 160.601 154.2 160.901C154.234 160.958 154.253 161.023 154.255 161.09C154.257 161.156 154.243 161.222 154.213 161.282C154.183 161.342 154.139 161.393 154.084 161.431C154.03 161.469 153.966 161.493 153.9 161.501C150.046 162.995 146.062 164.133 142 164.901C137.936 165.585 133.821 165.919 129.7 165.901L123.5 165.701C121.5 165.501 119.4 165.301 117.4 164.901C113.344 164.2 109.361 163.129 105.5 161.701C105.377 161.637 105.279 161.532 105.225 161.404C105.17 161.277 105.161 161.134 105.2 161.001C105.243 160.878 105.325 160.773 105.433 160.7C105.542 160.628 105.67 160.593 105.8 160.601Z\" fill=\"%23CB8C84\"/%3E%3Cpath d=\"M94.5998 129.5C95.0416 129.5 95.3998 129.142 95.3998 128.7C95.3998 128.259 95.0416 127.9 94.5998 127.9C94.158 127.9 93.7998 128.259 93.7998 128.7C93.7998 129.142 94.158 129.5 94.5998 129.5Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M86.0002 130.299C86.442 130.299 86.8002 129.941 86.8002 129.499C86.8002 129.057 86.442 128.699 86.0002 128.699C85.5584 128.699 85.2002 129.057 85.2002 129.499C85.2002 129.941 85.5584 130.299 86.0002 130.299Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M96.5998 138.5C97.0416 138.5 97.3998 138.142 97.3998 137.7C97.3998 137.259 97.0416 136.9 96.5998 136.9C96.158 136.9 95.7998 137.259 95.7998 137.7C95.7998 138.142 96.158 138.5 96.5998 138.5Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M101.3 129.5C101.742 129.5 102.1 129.142 102.1 128.7C102.1 128.259 101.742 127.9 101.3 127.9C100.858 127.9 100.5 128.259 100.5 128.7C100.5 129.142 100.858 129.5 101.3 129.5Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M95.6999 145.7C96.1417 145.7 96.4999 145.341 96.4999 144.9C96.4999 144.458 96.1417 144.1 95.6999 144.1C95.2581 144.1 94.8999 144.458 94.8999 144.9C94.8999 145.341 95.2581 145.7 95.6999 145.7Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M89.0998 136.799C89.5416 136.799 89.8998 136.441 89.8998 135.999C89.8998 135.557 89.5416 135.199 89.0998 135.199C88.658 135.199 88.2998 135.557 88.2998 135.999C88.2998 136.441 88.658 136.799 89.0998 136.799Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M164.4 131.5C164.842 131.5 165.2 131.142 165.2 130.7C165.2 130.259 164.842 129.9 164.4 129.9C163.958 129.9 163.6 130.259 163.6 130.7C163.6 131.142 163.958 131.5 164.4 131.5Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M171 134.299C171.442 134.299 171.8 133.941 171.8 133.499C171.8 133.057 171.442 132.699 171 132.699C170.558 132.699 170.2 133.057 170.2 133.499C170.2 133.941 170.558 134.299 171 134.299Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M166 149.299C166.442 149.299 166.8 148.941 166.8 148.499C166.8 148.057 166.442 147.699 166 147.699C165.558 147.699 165.2 148.057 165.2 148.499C165.2 148.941 165.558 149.299 166 149.299Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M155.7 133.5C156.142 133.5 156.5 133.142 156.5 132.7C156.5 132.259 156.142 131.9 155.7 131.9C155.258 131.9 154.9 132.259 154.9 132.7C154.9 133.142 155.258 133.5 155.7 133.5Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M157.5 145.2C157.942 145.2 158.3 144.841 158.3 144.4C158.3 143.958 157.942 143.6 157.5 143.6C157.058 143.6 156.7 143.958 156.7 144.4C156.7 144.841 157.058 145.2 157.5 145.2Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M165.9 140.799C166.342 140.799 166.7 140.441 166.7 139.999C166.7 139.557 166.342 139.199 165.9 139.199C165.458 139.199 165.1 139.557 165.1 139.999C165.1 140.441 165.458 140.799 165.9 140.799Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M118.2 141.7L123.9 143.7L126.6 145L127.7 145.5H128.9C129.795 145.413 130.655 145.104 131.4 144.6L134.3 143.5C136.246 142.884 138.262 142.514 140.3 142.4C140.486 142.4 140.664 142.474 140.795 142.605C140.926 142.736 141 142.914 141 143.1C141.002 143.27 140.942 143.434 140.832 143.563C140.721 143.691 140.568 143.776 140.4 143.8C138.519 144.053 136.673 144.523 134.9 145.2L132.2 146.4C131.234 146.934 130.187 147.305 129.1 147.5H127.4C126.805 147.393 126.231 147.19 125.7 146.9L123.1 145.6L117.8 143H117.7C117.561 142.902 117.456 142.761 117.402 142.599C117.348 142.437 117.348 142.262 117.4 142.1C117.466 141.95 117.582 141.829 117.728 141.756C117.874 141.682 118.041 141.663 118.2 141.7Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M121.5 112C122.601 113.498 123.476 115.149 124.1 116.9C124.644 118.689 124.979 120.535 125.1 122.4C125.212 126.112 124.386 129.792 122.7 133.1C122.654 133.199 122.589 133.287 122.509 133.361C122.429 133.434 122.335 133.491 122.233 133.528C122.131 133.565 122.022 133.582 121.914 133.577C121.805 133.572 121.699 133.546 121.6 133.5C121.502 133.454 121.413 133.389 121.34 133.309C121.266 133.229 121.209 133.135 121.172 133.033C121.135 132.931 121.118 132.823 121.123 132.714C121.128 132.605 121.154 132.499 121.2 132.4C121.739 130.797 122.173 129.16 122.5 127.5C122.796 125.851 122.897 124.173 122.8 122.5C122.786 120.803 122.516 119.117 122 117.5C121.558 115.895 120.92 114.35 120.1 112.9C120.03 112.805 119.981 112.696 119.958 112.58C119.935 112.464 119.938 112.344 119.966 112.229C119.995 112.115 120.049 112.008 120.124 111.916C120.199 111.825 120.293 111.751 120.4 111.7C120.492 111.647 120.593 111.612 120.698 111.599C120.804 111.585 120.911 111.592 121.013 111.62C121.115 111.648 121.211 111.696 121.295 111.761C121.378 111.827 121.448 111.908 121.5 112Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M201.9 113.499H199.2V111.299H201.9V113.499Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M201.9 117.1H199.2V114.9H201.9V117.1Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M197.3 108.1C196.373 107.949 195.427 107.949 194.5 108.1C193.1 108.2 192.9 108.7 192.6 110C192.3 111.3 192.6 110.3 192.6 111.6V122.4C192.6 123.3 193 123.5 193.7 123.6C193.853 123.6 194.005 123.569 194.146 123.508C194.286 123.446 194.412 123.356 194.516 123.243C194.619 123.13 194.698 122.997 194.747 122.851C194.796 122.706 194.814 122.552 194.8 122.4C195 119.8 195.2 116.8 195.5 114.2C195.5 113.9 195.6 113.8 195.8 113.8C196.315 113.843 196.81 114.024 197.232 114.323C197.654 114.622 197.988 115.028 198.2 115.5C198.797 116.669 199.234 117.914 199.5 119.2C199.4 118.9 199.3 118.2 199.5 119.3C199.778 120.583 199.945 121.888 200 123.2C200.3 123 200.5 123.3 200.5 122.6C200.6 119.2 200.4 114.8 200.6 111.5C200.8 108.2 198.6 108.2 197.3 108.1Z\" fill=\"%23EBECF0\"/%3E%3Cpath d=\"M195.2 117.6H192.6C192.3 119.2 191.9 120.9 191.6 122.6C191.39 123.118 191.223 123.654 191.1 124.2C190.507 126.469 189.703 128.679 188.7 130.8L188 132.8H188.1C191.5 132.9 194.2 131.1 194.8 127.7V127.1C195 123.8 195.1 121 195.2 117.7V117.6Z\" fill=\"%236C798F\"/%3E%3Cpath d=\"M192.7 127.8C192.764 127.166 192.659 126.527 192.396 125.947C192.132 125.368 191.72 124.868 191.2 124.5H191.1C190.4 126.7 189.5 128.9 188.7 131.1C189.661 131.159 190.608 130.851 191.351 130.238C192.093 129.626 192.575 128.754 192.7 127.8Z\" fill=\"%23172B4D\"/%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"132.43\" y1=\"240.189\" x2=\"132.43\" y2=\"169.209\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23FFE2D9\"/%3E%3Cstop offset=\"1\" stop-color=\"%23EBBEAE\"/%3E%3C/linearGradient%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Angie.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::1510db0e55d8ae9d446b5fdea9d1211f>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"256\" viewBox=\"0 0 256 256\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0H256V256H0V0Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256C198.692 256 256 198.692 256 128C256 57.3075 198.692 0 128 0C57.3075 0 0 57.3075 0 128C0 198.692 57.3075 256 128 256Z\" fill=\"%2300C7E5\"/%3E%3Cpath d=\"M64.9997 104.3C61.5997 108 52.6997 118.5 52.6997 133.2C52.6997 147.9 62.4997 161 63.2997 161.9C69.1997 169.2 74.1997 170.6 75.4997 177C76.7997 183.4 73.7997 188.7 71.0997 192.6C116.1 192.6 161.2 190.7 206.2 190.7C203.5 187 200 183 197.9 175C194.8 163.1 197.6 152.1 201.8 140.8C209.7 119.7 211.2 98.7003 201.2 78.0003C192.522 60.3053 178.252 45.965 160.6 37.2003C152.81 33.2738 144.434 30.6395 135.8 29.4003C130.874 28.6162 125.886 28.2814 120.9 28.4003C116.521 28.5321 112.166 29.1016 107.9 30.1003C93.5997 33.5003 79.8997 41.6003 71.5997 53.9003C57.1997 75.2003 63.7997 100.1 64.9997 104.3Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M160 202.1L131.6 200.5L103.3 202.1C96.2936 202.506 89.5246 204.785 83.6999 208.7L55.0999 228C53.9195 228.833 52.8449 229.807 51.8999 230.9C74.5992 247.705 102.223 256.525 130.461 255.982C158.699 255.439 185.963 245.565 208 227.9L179.5 208.7C173.711 204.789 166.975 202.509 160 202.1Z\" fill=\"%2300A3BF\"/%3E%3Cpath d=\"M170 208.901C169 210.301 153.4 229.701 127.7 228.001C106.2 226.701 93.9997 211.801 92.1997 209.501C97.2399 205.489 100.766 199.882 102.2 193.601C105 179.801 95.5997 169.401 94.3997 168.201L164.9 165.701C163.6 167.701 156.1 179.001 159.9 192.901C161.69 199.08 165.191 204.627 170 208.901Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M77.3 141.301C84.9215 141.301 91.1 135.123 91.1 127.501C91.1 119.88 84.9215 113.701 77.3 113.701C69.6785 113.701 63.5 119.88 63.5 127.501C63.5 135.123 69.6785 141.301 77.3 141.301Z\" fill=\"url(%23paint1_linear)\"/%3E%3Cpath d=\"M179.3 142.301C186.922 142.301 193.1 136.123 193.1 128.501C193.1 120.88 186.922 114.701 179.3 114.701C171.678 114.701 165.5 120.88 165.5 128.501C165.5 136.123 171.678 142.301 179.3 142.301Z\" fill=\"url(%23paint2_linear)\"/%3E%3Cpath d=\"M184.2 121.3C183.422 135.26 178.631 148.698 170.4 160C165.7 166.5 150.1 187.7 127.4 186.7C109.3 186 97.3001 171.5 90.3001 163C80.4664 151.14 74.3757 136.626 72.8001 121.3C72.0001 113.1 70.4001 96.0002 80.9001 79.6002C90.3001 64.9002 108.8 51.6002 130.8 53.1002C152.8 54.6002 167.6 72.1002 171.1 76.5002C185.2 94.6002 184.5 114.7 184.2 121.3Z\" fill=\"%23FFE2D9\"/%3E%3Cpath d=\"M171.6 108.701C169.091 106.993 166.449 105.488 163.7 104.201C160.892 103.123 157.907 102.58 154.9 102.601C151.918 102.603 148.964 103.18 146.2 104.301C143.424 105.467 140.883 107.127 138.7 109.201C138.5 109.371 138.241 109.456 137.979 109.438C137.718 109.419 137.473 109.298 137.3 109.101C137.212 109.017 137.142 108.916 137.095 108.804C137.047 108.692 137.022 108.572 137.022 108.451C137.022 108.329 137.047 108.209 137.095 108.097C137.142 107.986 137.212 107.885 137.3 107.801C139.547 105.397 142.272 103.489 145.3 102.201C148.352 100.968 151.609 100.323 154.9 100.301C158.165 100.355 161.39 101.034 164.4 102.301C167.489 103.474 170.142 105.568 172 108.301C172.1 108.401 172 108.601 171.9 108.701H171.6Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M82 108.301C83.8576 105.568 86.511 103.474 89.6 102.301C92.6101 101.034 95.8348 100.355 99.1 100.301C102.391 100.323 105.648 100.968 108.7 102.201C111.758 103.488 114.516 105.394 116.8 107.801C116.949 108.009 117.021 108.263 117.002 108.519C116.984 108.774 116.877 109.016 116.7 109.201C116.519 109.356 116.288 109.441 116.05 109.441C115.812 109.441 115.581 109.356 115.4 109.201C113.2 107.149 110.663 105.491 107.9 104.301C105.098 103.191 102.114 102.615 99.1 102.601C96.1242 102.571 93.1705 103.114 90.4 104.201C87.6186 105.487 84.9436 106.992 82.4 108.701H82V108.301Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M102.1 118.501C103.812 118.501 105.2 117.113 105.2 115.401C105.2 113.689 103.812 112.301 102.1 112.301C100.388 112.301 99 113.689 99 115.401C99 117.113 100.388 118.501 102.1 118.501Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M184.3 121.101C183.8 119.401 183.1 117.001 182.3 114.001C175.7 90.7012 172.3 78.9012 169 76.0012C163.2 70.6012 158.4 74.3012 129 74.5012C99.5998 74.7012 95.5998 71.2012 88.4998 76.9012C81.3998 82.6012 77.0998 96.9012 74.8998 106.701C73.8389 111.438 73.17 116.254 72.8998 121.101C68.5998 95.2012 77.0998 70.2012 95.2998 57.5012C108.5 48.2012 123.8 47.7012 128.6 47.7012C133.4 47.7012 148.6 48.2012 161.9 57.5012C180 70.2012 188.5 95.2012 184.3 121.101Z\" fill=\"url(%23paint3_linear)\"/%3E%3Cpath d=\"M88.5998 115.201C88.9937 115.375 89.4194 115.464 89.8498 115.464C90.2802 115.464 90.7059 115.375 91.0998 115.201L91.4998 114.901L91.6998 114.701L91.9998 114.401L93.2998 113.201C95.1793 111.759 97.3812 110.797 99.7158 110.396C102.05 109.995 104.447 110.169 106.7 110.901C108.939 111.624 110.943 112.936 112.5 114.701C112.683 114.888 112.786 115.139 112.786 115.401C112.786 115.663 112.683 115.914 112.5 116.101C112.296 116.247 112.051 116.326 111.8 116.326C111.549 116.326 111.304 116.247 111.1 116.101C108.898 114.05 106.062 112.814 103.061 112.595C100.06 112.377 97.0751 113.191 94.5998 114.901L93.3998 115.901L93.0998 116.101L92.6998 116.501L91.6998 116.901C91.0453 117.123 90.333 117.104 89.6913 116.847C89.0496 116.591 88.5207 116.113 88.1998 115.501C88.1828 115.476 88.1719 115.447 88.1678 115.416C88.1637 115.386 88.1666 115.355 88.1763 115.326C88.1859 115.297 88.2021 115.271 88.2235 115.249C88.2449 115.228 88.271 115.211 88.2998 115.201C88.3998 115.101 88.4998 115.101 88.4998 115.201H88.5998Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M151.9 118.501C153.612 118.501 155 117.113 155 115.401C155 113.689 153.612 112.301 151.9 112.301C150.188 112.301 148.8 113.689 148.8 115.401C148.8 117.113 150.188 118.501 151.9 118.501Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M165.8 116.1C165.45 116.68 164.913 117.124 164.277 117.36C163.641 117.596 162.945 117.61 162.3 117.4L161.3 117L160.9 116.6L160.6 116.4C160.221 116.042 159.82 115.708 159.4 115.4C157.756 114.262 155.876 113.51 153.9 113.2C151.962 112.883 149.977 113.019 148.1 113.6C146.165 114.2 144.388 115.225 142.9 116.6C142.7 116.77 142.442 116.855 142.18 116.836C141.918 116.818 141.674 116.697 141.5 116.5C141.412 116.415 141.343 116.315 141.295 116.203C141.247 116.091 141.223 115.971 141.223 115.85C141.223 115.728 141.247 115.608 141.295 115.496C141.343 115.384 141.412 115.284 141.5 115.2C143.104 113.469 145.116 112.169 147.352 111.418C149.588 110.666 151.977 110.488 154.3 110.9C156.632 111.289 158.831 112.251 160.7 113.7L162 114.9L162.3 115.2C162.4 115.2 162.4 115.3 162.5 115.4L163 115.7C163.394 115.873 163.82 115.963 164.25 115.963C164.681 115.963 165.106 115.873 165.5 115.7C165.526 115.683 165.554 115.672 165.585 115.667C165.615 115.663 165.646 115.666 165.675 115.676C165.704 115.686 165.73 115.702 165.752 115.723C165.774 115.745 165.79 115.771 165.8 115.8C165.821 115.818 165.838 115.841 165.85 115.867C165.862 115.893 165.868 115.921 165.868 115.95C165.868 115.978 165.862 116.006 165.85 116.032C165.838 116.058 165.821 116.081 165.8 116.1Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M70.0998 74.801C73.5998 83.201 83.6998 85.701 91.2998 87.601C93.8998 88.201 99.1998 89.301 117.3 88.301C137.2 87.101 141.6 86.301 151.6 87.901C157.2 88.801 162.8 91.201 165.9 96.401C169 101.601 165.8 107.101 170.1 113.401C174.4 119.701 183.6 121.301 184.2 121.301C187.765 121.629 191.352 121.008 194.6 119.501C194.636 119.46 194.664 119.413 194.681 119.361C194.698 119.31 194.704 119.255 194.7 119.201C194.7 112.101 194 89.101 177.1 69.401C165.2 55.601 151.2 50.301 143.2 47.301C143.2 47.301 119 38.501 91.0998 45.101C84.7998 46.601 79.7998 48.501 75.6998 52.901C71.5998 57.301 66.9998 67.001 70.0998 74.801Z\" fill=\"%23253858\"/%3E%3Cpath style=\"mix-blend-mode:multiply\" opacity=\"0.29\" d=\"M126 150.101C133.842 150.101 140.2 143.744 140.2 135.901C140.2 128.059 133.842 121.701 126 121.701C118.157 121.701 111.8 128.059 111.8 135.901C111.8 143.744 118.157 150.101 126 150.101Z\" fill=\"url(%23paint4_radial)\"/%3E%3Cpath d=\"M121.7 114.999C122.269 116.353 122.705 117.76 123 119.199C123.2 120.599 123.4 122.099 123.5 123.599C123.499 125.038 123.399 126.474 123.2 127.899C123.021 129.364 122.686 130.805 122.2 132.199C122.18 132.306 122.136 132.406 122.071 132.493C122.006 132.58 121.922 132.65 121.825 132.698C121.728 132.747 121.621 132.772 121.512 132.772C121.404 132.772 121.297 132.747 121.2 132.699C121.016 132.634 120.858 132.512 120.75 132.349C120.641 132.187 120.589 131.994 120.6 131.799C120.8 130.399 121 129.099 121.1 127.699C121.233 126.337 121.267 124.966 121.2 123.599C121.2 122.26 121.099 120.923 120.9 119.599C120.7 118.199 120.4 116.899 120.1 115.499C120.07 115.275 120.125 115.048 120.254 114.862C120.384 114.677 120.579 114.547 120.8 114.499C120.985 114.463 121.176 114.494 121.341 114.585C121.506 114.677 121.633 114.823 121.7 114.999Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M118.3 141.7C119.489 140.948 120.903 140.63 122.3 140.801L123.5 141.101L124.2 141.4C124.585 141.535 124.998 141.57 125.4 141.501L126.9 141.001C127.52 140.685 128.204 140.514 128.9 140.501C130.252 140.346 131.618 140.626 132.8 141.301C132.889 141.342 132.968 141.402 133.033 141.477C133.097 141.552 133.145 141.639 133.174 141.733C133.202 141.828 133.21 141.927 133.197 142.025C133.185 142.123 133.151 142.216 133.1 142.301C133.078 142.382 133.038 142.458 132.985 142.523C132.931 142.588 132.865 142.642 132.789 142.679C132.714 142.717 132.631 142.739 132.547 142.742C132.462 142.746 132.378 142.732 132.3 142.7C131.263 142.387 130.168 142.319 129.1 142.501C128.605 142.576 128.13 142.746 127.7 143.001L125.8 143.7C125.037 143.867 124.245 143.833 123.5 143.601C123.147 143.475 122.812 143.307 122.5 143.101L121.9 142.9C120.932 142.72 119.934 142.789 119 143.101H118.9C118.808 143.131 118.711 143.142 118.614 143.133C118.518 143.124 118.425 143.095 118.34 143.048C118.256 143.001 118.182 142.937 118.123 142.86C118.065 142.783 118.023 142.695 118 142.601C117.947 142.438 117.948 142.263 118.002 142.101C118.056 141.939 118.16 141.799 118.3 141.7Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M145.2 158.499C139.9 157.699 136.5 156.699 132.5 157.299H131.7C129.518 157.699 127.282 157.699 125.1 157.299H124.3C120.5 156.699 117.1 157.499 111.8 158.299C110.6 158.499 108.9 158.799 106.7 158.999C107.1 159.399 114.8 165.899 128.4 165.799C142 165.699 149.7 159.399 150.1 158.999L145.2 158.499Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M104.1 157.4C107.987 158.577 111.969 159.413 116 159.9C119.97 160.514 123.985 160.782 128 160.7C132.046 160.683 136.087 160.415 140.1 159.9L146 158.8C148 158.4 149.9 157.8 151.9 157.3C152.2 157.2 152.5 157.4 152.5 157.6C152.533 157.665 152.55 157.736 152.552 157.808C152.554 157.881 152.541 157.953 152.512 158.019C152.484 158.086 152.441 158.145 152.387 158.194C152.333 158.242 152.27 158.279 152.2 158.3C148.358 159.807 144.37 160.913 140.3 161.6C136.239 162.318 132.124 162.686 128 162.7L121.8 162.5C119.8 162.3 117.7 162.1 115.7 161.7C111.631 161.013 107.643 159.907 103.8 158.4C103.731 158.379 103.668 158.342 103.614 158.294C103.56 158.245 103.517 158.186 103.489 158.119C103.46 158.053 103.446 157.981 103.448 157.908C103.45 157.836 103.468 157.765 103.5 157.7C103.567 157.604 103.657 157.526 103.762 157.473C103.867 157.421 103.983 157.396 104.1 157.4Z\" fill=\"%23CB8C84\"/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"131.12\" y1=\"166.931\" x2=\"131.12\" y2=\"227.831\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23EBBEAE\"/%3E%3Cstop offset=\"0.64\" stop-color=\"%23FFE2D9\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint1_linear\" x1=\"63.57\" y1=\"127.501\" x2=\"91.11\" y2=\"127.501\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23FFE2D9\"/%3E%3Cstop offset=\"1\" stop-color=\"%23EBBEAE\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint2_linear\" x1=\"165.5\" y1=\"128.491\" x2=\"193.04\" y2=\"128.491\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23EBBEAE\"/%3E%3Cstop offset=\"1\" stop-color=\"%23FFE2D9\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint3_linear\" x1=\"128.58\" y1=\"121.091\" x2=\"128.58\" y2=\"47.6912\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23F0D0B4\"/%3E%3Cstop offset=\"0.11\" stop-color=\"%23E1C5AD\"/%3E%3Cstop offset=\"0.33\" stop-color=\"%23BBA89C\"/%3E%3Cstop offset=\"0.63\" stop-color=\"%237C7980\"/%3E%3Cstop offset=\"0.99\" stop-color=\"%23273A59\"/%3E%3Cstop offset=\"1\" stop-color=\"%23253858\"/%3E%3C/linearGradient%3E%3CradialGradient id=\"paint4_radial\" cx=\"0\" cy=\"0\" r=\"1\" gradientUnits=\"userSpaceOnUse\" gradientTransform=\"translate(126.14 136.068) scale(14.1867)\"%3E%3Cstop stop-color=\"%23FFD5C4\"/%3E%3Cstop offset=\"0.23\" stop-color=\"%23FCD4C1\" stop-opacity=\"0.79\"/%3E%3Cstop offset=\"0.75\" stop-color=\"%23F4D1BA\" stop-opacity=\"0.26\"/%3E%3Cstop offset=\"1\" stop-color=\"%23F0D0B6\" stop-opacity=\"0\"/%3E%3C/radialGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0H256V256H0V0Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Arjun.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::fed3d67da9b3a60a166cd1c970b77576>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"256\" viewBox=\"0 0 256 256\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0H256V256H0V0Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256C198.692 256 256 198.692 256 128C256 57.3075 198.692 0 128 0C57.3075 0 0 57.3075 0 128C0 198.692 57.3075 256 128 256Z\" fill=\"%2300C7E5\"/%3E%3Cpath d=\"M128 256.001C145.339 256.035 162.503 252.532 178.442 245.705C194.38 238.879 208.76 228.874 220.7 216.301L186.5 199.201C180.564 196.2 174.047 194.528 167.4 194.301L130.3 192.701L93.1998 194.301C86.5496 194.506 80.0271 196.179 74.0998 199.201L37.7998 217.301L36.7998 217.801C48.6988 229.911 62.8931 239.527 78.5526 246.086C94.212 252.645 111.022 256.016 128 256.001Z\" fill=\"%2300A3BF\"/%3E%3Cpath d=\"M161.9 175.301C161.54 181.133 161.977 186.987 163.2 192.701C163.9 195.201 167.2 196.201 169.9 197.701C170.241 197.943 170.473 198.308 170.548 198.719C170.623 199.13 170.534 199.554 170.3 199.901C165 206.701 156.2 213.301 146.6 217.601C146.062 217.833 145.632 218.262 145.4 218.801L132.4 246.501C132.179 246.92 131.848 247.27 131.443 247.515C131.038 247.759 130.573 247.888 130.1 247.888C129.627 247.888 129.162 247.759 128.757 247.515C128.352 247.27 128.021 246.92 127.8 246.501L114.7 218.801C114.578 218.522 114.4 218.271 114.176 218.064C113.952 217.858 113.688 217.7 113.4 217.601C103.9 213.301 95.1001 206.701 89.8001 199.901C89.6721 199.743 89.5801 199.558 89.5305 199.361C89.4809 199.164 89.4749 198.958 89.513 198.758C89.5511 198.558 89.6323 198.369 89.7509 198.204C89.8696 198.038 90.0229 197.901 90.2001 197.801C92.9001 196.201 96.2001 195.201 96.9001 192.701C98.1233 186.987 98.5606 181.133 98.2001 175.301H161.9Z\" fill=\"%23AC8457\"/%3E%3Cpath d=\"M194.3 112.701C194.5 119.001 183.9 132.501 177.6 132.701C171.3 132.901 171.6 119.801 171.3 113.501C171.194 110.451 172.304 107.484 174.385 105.252C176.467 103.02 179.35 101.707 182.4 101.601C185.45 101.495 188.417 102.604 190.649 104.686C192.88 106.768 194.194 109.651 194.3 112.701Z\" fill=\"%23AC8457\"/%3E%3Cpath d=\"M64.1003 112.701C63.8003 119.001 74.4003 132.501 80.7003 132.701C87.0003 132.901 86.8003 119.801 87.0003 113.501C87.1934 111.918 87.0554 110.313 86.5952 108.787C86.135 107.261 85.3626 105.847 84.3269 104.636C83.2913 103.424 82.0151 102.441 80.5793 101.749C79.1435 101.056 77.5795 100.67 75.9865 100.614C74.3935 100.559 72.8063 100.835 71.3257 101.425C69.8451 102.016 68.5034 102.907 67.3857 104.044C66.268 105.18 65.3988 106.537 64.8332 108.027C64.2677 109.517 64.0181 111.109 64.1003 112.701Z\" fill=\"%23AC8457\"/%3E%3Cpath d=\"M188.1 80.7999C188.7 50.8999 175.1 24.6999 129.4 26.0999C82.6995 24.5999 69.4995 51.9999 70.5995 82.6999\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M70.5996 82.7008C70.9502 90.3121 71.9878 97.8762 73.6996 105.301C88.7996 171.801 82.4996 175.801 121.8 186.801C126.736 188.199 131.963 188.199 136.9 186.801C176.2 175.801 169.9 171.801 185 105.301C186.861 97.2604 187.9 89.0514 188.1 80.8008\" fill=\"%23253858\"/%3E%3Cpath d=\"M129.099 164.001C139.999 163.601 144.499 169.001 148.599 165.901C152.699 162.801 152.699 156.601 150.199 154.101C149.399 153.201 148.499 153.101 143.299 152.801C133.999 152.301 133.099 152.601 128.799 152.101C124.499 151.601 123.799 151.201 120.799 151.301C118.167 151.382 115.552 151.751 112.999 152.401C109.899 153.101 108.299 153.401 107.799 154.101C105.699 156.601 107.499 163.701 111.799 166.201C116.099 168.701 119.499 164.301 129.099 164.001Z\" fill=\"%23AC8457\"/%3E%3Cpath d=\"M129.4 135.6C145.6 135.6 157.1 144.9 165.2 139.7C173.3 134.5 177.8 114.9 180.1 107.7C182.159 100.962 182.571 93.829 181.3 86.8996C180.9 84.1996 177.6 80.6996 176.2 74.3996C175.729 72.4967 175.428 70.5558 175.3 68.5996C169.25 72.3092 162.768 75.2645 156 77.3996C139.845 82.5334 122.548 82.8807 106.2 78.3996C98.7561 76.2882 91.6267 73.1943 85 69.1996C83.2054 71.2934 81.6925 73.6131 80.5 76.0996C78.8731 79.5021 77.8254 83.1522 77.4 86.8996C76.3899 93.8428 76.7982 100.919 78.6 107.7C80.9 114.9 85.5 134.6 93.5 139.7C101.5 144.8 113.1 135.6 129.4 135.6Z\" fill=\"%23AC8457\"/%3E%3Cpath d=\"M145.8 152.7C140.5 151.7 137.1 150.3 133.1 151.1C132.8 151.2 132.7 151.1 132.3 151.3C130.141 151.901 127.859 151.901 125.7 151.3L124.9 151.1C121.1 150.3 117.7 151.5 112.4 152.6L107.3 153.5C110.101 156.435 113.468 158.77 117.198 160.366C120.928 161.962 124.943 162.785 129 162.785C133.057 162.785 137.071 161.962 140.801 160.366C144.531 158.77 147.899 156.435 150.7 153.5L145.8 152.7Z\" fill=\"%237D4921\"/%3E%3Cpath d=\"M105.1 151.901C108.934 153.304 112.882 154.375 116.9 155.101C120.89 155.83 124.943 156.165 129 156.101C133.057 156.086 137.106 155.718 141.1 155.001C143.09 154.64 145.06 154.173 147 153.601C148.966 153.073 150.902 152.439 152.8 151.701C152.932 151.648 153.081 151.649 153.212 151.706C153.343 151.762 153.447 151.868 153.5 152.001C153.553 152.133 153.551 152.281 153.495 152.413C153.438 152.544 153.332 152.648 153.2 152.701C149.451 154.467 145.531 155.841 141.5 156.801C137.384 157.634 133.198 158.069 129 158.101C126.9 158.101 124.8 158.001 122.8 157.801C120.711 157.622 118.639 157.287 116.6 156.801C112.498 155.955 108.506 154.647 104.7 152.901C104.605 152.814 104.537 152.702 104.502 152.579C104.466 152.455 104.466 152.324 104.5 152.201C104.507 152.134 104.531 152.071 104.569 152.016C104.607 151.962 104.659 151.918 104.718 151.888C104.778 151.858 104.844 151.844 104.911 151.846C104.977 151.848 105.042 151.867 105.1 151.901Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M125.2 59.8007C131.7 45.4007 138.3 31.1007 144.8 16.7007C150.2 16.4007 163.7 16.4007 176.8 24.9007C193.7 36.0007 201.4 56.0007 200.2 73.9007C199 91.8007 187.8 105.201 184.1 109.001C182.708 104.881 180.573 101.051 177.8 97.7007C169.9 88.3007 160 87.6007 149.7 82.5007C143 79.2007 133.9 72.9007 125.2 59.8007Z\" fill=\"%23008DA6\"/%3E%3Cpath d=\"M75.8 114.6C65.8534 103.152 60.2592 88.5641 60 73.4003C60 69.5003 60.2 44.2003 80.3 26.5003C97.7 11.2003 123.2 7.50027 146.1 16.7003C140.4 46.2003 128.5 60.4003 118.5 67.9003C108.5 75.4003 92.4 80.7003 82.5 97.2003C79.3646 102.611 77.1034 108.484 75.8 114.6Z\" fill=\"%2300A3BF\"/%3E%3Cpath d=\"M120.7 132.299L125.6 133.999L128 135.099L128.9 135.499H129.9C130.634 135.333 131.341 135.063 132 134.699L134.5 133.699C136.227 133.197 138.005 132.896 139.8 132.799C139.978 132.82 140.144 132.901 140.271 133.028C140.398 133.155 140.479 133.321 140.5 133.499C140.473 133.659 140.402 133.809 140.297 133.932C140.191 134.055 140.054 134.148 139.9 134.199C138.266 134.445 136.658 134.847 135.1 135.399L132.9 136.399C132.041 136.911 131.09 137.251 130.1 137.399H128.6C128.066 137.298 127.557 137.094 127.1 136.799L124.8 135.699L120.3 133.399H120.2C120.061 133.301 119.956 133.16 119.902 132.999C119.848 132.837 119.848 132.662 119.9 132.499C119.995 132.386 120.124 132.305 120.268 132.269C120.411 132.233 120.563 132.244 120.7 132.299Z\" fill=\"%234A3222\"/%3E%3Cpath d=\"M124.4 98.7996C125.832 102.874 126.476 107.184 126.3 111.5C126.187 113.682 125.92 115.855 125.5 118C125.018 120.077 124.383 122.116 123.6 124.1C123.568 124.197 123.515 124.287 123.445 124.362C123.375 124.437 123.289 124.496 123.194 124.534C123.098 124.572 122.995 124.589 122.893 124.583C122.79 124.577 122.69 124.549 122.6 124.5C122.442 124.416 122.317 124.282 122.245 124.118C122.172 123.955 122.156 123.773 122.2 123.6C122.8 121.6 123.3 119.6 123.7 117.6C124 115.6 124.2 113.5 124.3 111.5C124.383 109.431 124.316 107.359 124.1 105.3C123.879 103.243 123.511 101.204 123 99.1996C122.969 99.1077 122.958 99.0106 122.967 98.9143C122.976 98.8179 123.005 98.7246 123.052 98.64C123.099 98.5554 123.163 98.4815 123.24 98.4229C123.317 98.3643 123.406 98.3223 123.5 98.2996C123.683 98.2809 123.867 98.3188 124.028 98.4082C124.189 98.4976 124.319 98.6342 124.4 98.7996Z\" fill=\"%234A3222\"/%3E%3Cpath d=\"M115.6 99.6004L114.9 99.2004L114.1 98.8004L112.4 98.0004C111.198 97.5103 109.961 97.1093 108.7 96.8004C106.169 96.2707 103.585 96.0358 101 96.1004C97.0862 96.3544 93.2854 97.5187 89.9004 99.5004C88.7977 100.163 87.7887 100.97 86.9004 101.9H86.8004C86.6889 102.012 86.5565 102.101 86.4106 102.162C86.2647 102.222 86.1083 102.253 85.9504 102.253C85.7925 102.253 85.6361 102.222 85.4902 102.162C85.3444 102.101 85.2119 102.012 85.1004 101.9C84.8999 101.711 84.7706 101.459 84.7342 101.186C84.6977 100.913 84.7564 100.635 84.9004 100.4C85.707 99.0516 86.7192 97.837 87.9004 96.8004C89.0837 95.7885 90.3555 94.8848 91.7004 94.1004C94.4346 92.5286 97.4651 91.5411 100.6 91.2004C103.71 90.7985 106.868 91.0023 109.9 91.8004C111.454 92.1673 112.964 92.7039 114.4 93.4004L116.5 94.6004L117.4 95.4004L118.5 96.2004C118.91 96.6125 119.139 97.1697 119.139 97.7504C119.139 98.3311 118.91 98.8883 118.5 99.3004C118.168 99.6383 117.735 99.8598 117.267 99.9318C116.798 100.004 116.319 99.9227 115.9 99.7004L115.6 99.6004Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M141 96.3003L142 95.5003L143 94.7003L145.1 93.5003C146.509 92.82 147.983 92.2839 149.5 91.9003C152.567 91.1017 155.757 90.898 158.9 91.3003C162.001 91.6573 164.995 92.6441 167.7 94.2003C169.061 94.9606 170.335 95.8659 171.5 96.9003C172.713 97.9339 173.758 99.1482 174.6 100.5C174.747 100.794 174.778 101.133 174.685 101.449C174.592 101.764 174.383 102.033 174.1 102.2C173.865 102.344 173.588 102.403 173.315 102.367C173.042 102.33 172.789 102.201 172.6 102C171.656 101.092 170.617 100.287 169.5 99.6003C168.385 98.9341 167.214 98.3653 166 97.9003C163.588 96.8883 161.014 96.3127 158.4 96.2003C155.815 96.1357 153.231 96.3706 150.7 96.9003L147.1 98.0003L145.3 98.8003L144.5 99.2003L143.8 99.6003L143.5 99.8003C142.994 100.052 142.41 100.098 141.87 99.9309C141.33 99.7633 140.875 99.3943 140.6 98.9003C140.361 98.4862 140.27 98.0027 140.343 97.53C140.416 97.0572 140.647 96.6234 141 96.3003Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M91.6 105.3C94.6497 103.142 98.2656 101.925 102 101.8C105.788 101.693 109.52 102.739 112.7 104.8C112.799 104.86 112.884 104.94 112.949 105.036C113.014 105.132 113.058 105.24 113.077 105.354C113.096 105.468 113.09 105.585 113.059 105.697C113.029 105.808 112.974 105.912 112.9 106C112.849 106.107 112.776 106.202 112.684 106.277C112.593 106.352 112.486 106.406 112.371 106.434C112.256 106.463 112.136 106.466 112.02 106.443C111.904 106.42 111.795 106.371 111.7 106.3C110.196 105.522 108.622 104.886 107 104.4C105.358 104.014 103.685 103.779 102 103.7C100.311 103.73 98.6321 103.965 97 104.4C95.3394 104.868 93.731 105.505 92.2 106.3C92.1392 106.354 92.0662 106.392 91.9874 106.412C91.9085 106.431 91.8261 106.431 91.7473 106.411C91.6686 106.391 91.5958 106.353 91.5353 106.299C91.4748 106.245 91.4283 106.177 91.4 106.1C91.3462 106.04 91.308 105.967 91.2887 105.888C91.2694 105.809 91.2697 105.727 91.2893 105.648C91.309 105.569 91.3476 105.496 91.4017 105.436C91.4559 105.375 91.5239 105.329 91.6 105.3Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M166.8 106.3C165.269 105.505 163.661 104.868 162 104.4C160.368 103.965 158.689 103.73 157 103.7C153.603 103.757 150.271 104.65 147.3 106.3C147.203 106.396 147.086 106.468 146.957 106.512C146.828 106.555 146.691 106.569 146.555 106.552C146.42 106.535 146.291 106.487 146.177 106.413C146.063 106.339 145.967 106.239 145.897 106.122C145.827 106.006 145.784 105.874 145.772 105.739C145.76 105.603 145.779 105.466 145.828 105.339C145.876 105.212 145.953 105.097 146.052 105.004C146.151 104.91 146.27 104.841 146.4 104.8C149.539 102.729 153.242 101.681 157 101.8C160.766 101.922 164.415 103.139 167.5 105.3C167.621 105.414 167.697 105.567 167.716 105.732C167.734 105.897 167.693 106.063 167.6 106.2C167.503 106.313 167.368 106.386 167.22 106.405C167.072 106.423 166.922 106.386 166.8 106.3Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M155.9 109C157.668 109 159.1 107.567 159.1 105.8C159.1 104.032 157.668 102.6 155.9 102.6C154.133 102.6 152.7 104.032 152.7 105.8C152.7 107.567 154.133 109 155.9 109Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M102.6 109C104.368 109 105.8 107.567 105.8 105.8C105.8 104.032 104.368 102.6 102.6 102.6C100.833 102.6 99.4004 104.032 99.4004 105.8C99.4004 107.567 100.833 109 102.6 109Z\" fill=\"%23172B4D\"/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"70.5795\" y1=\"54.3499\" x2=\"188.14\" y2=\"54.3499\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%2300B8D9\"/%3E%3Cstop offset=\"0.03\" stop-color=\"%2300B4D4\"/%3E%3Cstop offset=\"0.2\" stop-color=\"%2300A2BF\"/%3E%3Cstop offset=\"0.39\" stop-color=\"%230096B1\"/%3E%3Cstop offset=\"0.63\" stop-color=\"%23008FA9\"/%3E%3Cstop offset=\"1\" stop-color=\"%23008DA6\"/%3E%3C/linearGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0H256V256H0V0Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Blair.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::3cd647039502752cf0792f7b3ff41a3e>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"257\" viewBox=\"0 0 256 257\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0H256V256.9H0V0Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M256 129.7V127C255.995 104.938 250.178 83.2672 239.136 64.1675C228.094 45.0678 212.216 29.2135 193.1 18.2002L190.9 16.8002C171.763 5.79793 150.074 0.0078125 128 0.0078125C105.926 0.0078125 84.2372 5.79793 65.1 16.8002L62.9 18.2002C43.7838 29.2135 27.9057 45.0678 16.8637 64.1675C5.8217 83.2672 0.0053515 104.938 0 127L0 129.7C0.0053515 151.762 5.8217 173.433 16.8637 192.533C27.9057 211.633 43.7838 227.487 62.9 238.5L65.1 239.9C84.2372 250.902 105.926 256.693 128 256.693C150.074 256.693 171.763 250.902 190.9 239.9L193.1 238.5C212.216 227.487 228.094 211.633 239.136 192.533C250.178 173.433 255.995 151.762 256 129.7Z\" fill=\"%230065FF\"/%3E%3Cpath d=\"M170.2 206.4L131 204.4L91.8004 206.4C91.0554 206.467 90.3363 206.707 89.7004 207.1L54.1004 230.7L52.4004 231.9C55.77 234.362 59.2756 236.633 62.9004 238.7L65.1004 240C84.2211 251.051 105.916 256.87 128 256.87C150.085 256.87 171.78 251.051 190.9 240L193.1 238.7C197.795 236.004 202.305 232.997 206.6 229.7L172.3 207.1C171.664 206.707 170.945 206.467 170.2 206.4Z\" fill=\"%234C9AFF\"/%3E%3Cpath d=\"M60.5005 84.0016C58.8005 93.0016 55.2005 143.702 57.7005 153.202C60.2005 162.702 89.2005 197.602 98.9005 201.802C108.6 206.002 153 205.202 162.3 200.702C171.6 196.202 200.3 162.802 203.2 152.902C206.1 143.002 204.1 111.202 202.4 84.0016L131 64.1016L60.5005 84.0016Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M167.9 208.1C167 209.3 152 229.3 127.2 227.4C107.2 225.8 95.9002 211.1 94.2002 208.8C99.1856 205.038 102.718 199.668 104.2 193.6C107.1 180.8 99.1002 171 98.1002 169.9H160.8C160.4 170.5 151.2 183.3 157 196.5C159.297 201.435 163.118 205.501 167.9 208.1Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M79.6008 142.202C87.2223 142.202 93.4008 136.023 93.4008 128.402C93.4008 120.78 87.2223 114.602 79.6008 114.602C71.9792 114.602 65.8008 120.78 65.8008 128.402C65.8008 136.023 71.9792 142.202 79.6008 142.202Z\" fill=\"url(%23paint1_linear)\"/%3E%3Cpath d=\"M182.001 142.202C189.623 142.202 195.801 136.023 195.801 128.402C195.801 120.78 189.623 114.602 182.001 114.602C174.38 114.602 168.201 120.78 168.201 128.402C168.201 136.023 174.38 142.202 182.001 142.202Z\" fill=\"url(%23paint2_linear)\"/%3E%3Cpath d=\"M83.2009 100.601C83.2009 107.001 83.0009 113.101 82.8009 118.901C82.6009 124.701 82.4009 123.801 82.1009 129.301C81.3009 144.901 82.1009 148.901 78.8009 152.601C75.5009 156.301 73.3009 156.801 72.0009 155.901C70.7009 155.001 72.6009 151.301 73.4009 145.801C75.3009 132.301 70.9009 118.601 70.5009 117.501C69.5009 114.701 68.4009 112.001 68.6009 108.001C68.7009 105.601 68.9009 100.301 72.6009 98.3012C76.3009 96.3012 79.9009 97.7011 83.2009 100.601Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M189.401 100.601C189.401 107.001 189.201 113.101 188.901 118.901C188.601 124.701 188.501 123.801 188.201 129.301C187.401 144.901 188.201 148.901 184.901 152.601C181.601 156.301 179.501 156.801 178.201 155.901C176.901 155.001 178.801 151.301 179.601 145.801C181.501 132.301 177.001 118.601 176.601 117.501C175.701 114.701 174.501 112.001 174.701 108.001C174.801 105.601 175.001 100.301 178.801 98.3012C182.601 96.3012 186.101 97.7011 189.401 100.601Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M187.001 123.201C185.801 152.901 154.901 187.001 131.101 187.001C107.301 187.001 76.3006 152.901 75.1006 123.201C73.7006 90.3008 98.4006 53.3008 131.001 53.3008C163.601 53.3008 188.301 90.3008 187.001 123.201Z\" fill=\"%23FFE1D7\"/%3E%3Cpath d=\"M71.4008 137.7C72.2844 137.7 73.0008 136.984 73.0008 136.1C73.0008 135.216 72.2844 134.5 71.4008 134.5C70.5171 134.5 69.8008 135.216 69.8008 136.1C69.8008 136.984 70.5171 137.7 71.4008 137.7Z\" fill=\"%230065FF\"/%3E%3Cpath d=\"M190.901 137.7C191.784 137.7 192.501 136.984 192.501 136.1C192.501 135.216 191.784 134.5 190.901 134.5C190.017 134.5 189.301 135.216 189.301 136.1C189.301 136.984 190.017 137.7 190.901 137.7Z\" fill=\"%230065FF\"/%3E%3Cpath d=\"M175.401 106.401C172.922 104.758 170.314 103.32 167.601 102.101C164.839 100.985 161.879 100.44 158.901 100.501C155.946 100.457 153.016 101.036 150.301 102.201C147.553 103.275 145.04 104.871 142.901 106.901C142.815 107.016 142.705 107.111 142.579 107.179C142.453 107.248 142.314 107.289 142.171 107.299C142.029 107.309 141.885 107.288 141.751 107.238C141.617 107.188 141.495 107.11 141.393 107.009C141.292 106.907 141.214 106.785 141.164 106.651C141.114 106.517 141.093 106.373 141.103 106.231C141.113 106.088 141.154 105.949 141.223 105.823C141.291 105.697 141.386 105.587 141.501 105.501C143.72 103.161 146.413 101.32 149.401 100.101C152.388 98.7733 155.632 98.1244 158.901 98.2015C162.139 98.2077 165.34 98.8888 168.301 100.201C171.373 101.306 174.004 103.376 175.801 106.101C175.901 106.201 175.901 106.301 175.701 106.401H175.401Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M86.8011 106.102C88.5976 103.376 91.229 101.306 94.3011 100.202C97.2967 98.8895 100.531 98.2087 103.801 98.2018C107.036 98.1362 110.246 98.7849 113.201 100.102C116.218 101.318 118.944 103.159 121.201 105.502C121.372 105.702 121.457 105.96 121.438 106.222C121.419 106.484 121.298 106.728 121.101 106.902C121.017 106.99 120.916 107.059 120.804 107.107C120.693 107.155 120.573 107.179 120.451 107.179C120.33 107.179 120.209 107.155 120.098 107.107C119.986 107.059 119.885 106.99 119.801 106.902C117.629 104.913 115.124 103.322 112.401 102.202C109.681 101.053 106.754 100.475 103.801 100.502C100.821 100.423 97.858 100.968 95.1011 102.102C92.3557 103.319 89.7137 104.757 87.2011 106.402C87.1878 106.455 87.154 106.5 87.1071 106.529C87.0603 106.557 87.0041 106.565 86.9511 106.552C86.898 106.539 86.8524 106.505 86.8243 106.458C86.7962 106.411 86.7878 106.355 86.8011 106.302V106.102Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M126.101 112.702C126.711 114.034 127.116 115.45 127.301 116.902C127.622 118.313 127.789 119.755 127.801 121.202C127.834 122.638 127.768 124.075 127.601 125.502C127.411 126.932 127.076 128.34 126.601 129.702C126.582 129.809 126.538 129.909 126.472 129.996C126.407 130.083 126.323 130.153 126.226 130.201C126.129 130.25 126.022 130.275 125.914 130.275C125.805 130.275 125.698 130.25 125.601 130.202C125.407 130.155 125.237 130.036 125.126 129.869C125.015 129.702 124.971 129.5 125.001 129.302C125.201 127.902 125.401 126.602 125.501 125.302C125.601 124.002 125.601 122.602 125.601 121.202C125.601 119.802 125.401 118.502 125.201 117.202C125.065 115.854 124.831 114.517 124.501 113.202C124.471 112.978 124.526 112.751 124.656 112.565C124.786 112.38 124.98 112.25 125.201 112.202C125.386 112.166 125.578 112.197 125.742 112.288C125.907 112.38 126.034 112.526 126.101 112.702Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M122.701 139.101C123.887 138.341 125.304 138.022 126.701 138.201C127.082 138.24 127.453 138.341 127.801 138.501L128.501 138.801C128.887 138.932 129.299 138.966 129.701 138.901L131.201 138.401C131.821 138.085 132.505 137.914 133.201 137.901C134.553 137.76 135.915 138.039 137.101 138.701C137.263 138.804 137.382 138.962 137.437 139.145C137.492 139.329 137.479 139.526 137.401 139.701C137.306 139.848 137.171 139.964 137.011 140.035C136.851 140.106 136.674 140.129 136.501 140.101C135.498 139.789 134.436 139.72 133.401 139.901C132.907 139.976 132.431 140.146 132.001 140.401L130.101 141.101C129.335 141.216 128.554 141.182 127.801 141.001L126.901 140.501L126.301 140.301C125.333 140.12 124.335 140.189 123.401 140.501C123.202 140.565 122.986 140.548 122.799 140.455C122.612 140.361 122.47 140.198 122.401 140.001C122.349 139.839 122.349 139.664 122.403 139.502C122.457 139.34 122.562 139.199 122.701 139.101Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M149.301 155.701C144.101 154.901 140.701 153.901 136.701 154.501H136.001C133.83 155.001 131.573 155.001 129.401 154.501H128.601C124.901 153.901 121.601 154.701 116.201 155.601L111.201 156.201C111.601 156.601 119.201 163.001 132.701 163.001C146.201 163.001 153.701 156.601 154.201 156.201L149.301 155.701Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M108.701 154.602C112.517 155.789 116.433 156.626 120.401 157.102C128.299 158.203 136.313 158.169 144.201 157.002C146.184 156.775 148.154 156.441 150.101 156.002C152.101 155.602 154.001 155.002 155.901 154.502C156.047 154.47 156.199 154.493 156.328 154.567C156.458 154.641 156.555 154.761 156.601 154.902C156.605 155.02 156.58 155.136 156.528 155.241C156.475 155.346 156.397 155.436 156.301 155.502C152.489 156.996 148.535 158.102 144.501 158.802C140.474 159.52 136.392 159.888 132.301 159.902C130.301 159.902 128.201 159.802 126.201 159.602C124.201 159.402 122.101 159.202 120.101 158.902C116.08 158.189 112.131 157.118 108.301 155.702C108.101 155.502 107.901 155.202 108.001 155.002C108.062 154.872 108.163 154.763 108.288 154.692C108.413 154.62 108.558 154.589 108.701 154.602Z\" fill=\"%23CB8C84\"/%3E%3Cpath d=\"M94.8012 111.402C97.8118 109.241 101.397 108.023 105.101 107.902C108.814 107.781 112.477 108.792 115.601 110.802C115.711 110.864 115.807 110.947 115.882 111.048C115.958 111.148 116.011 111.263 116.039 111.386C116.068 111.508 116.07 111.635 116.046 111.759C116.022 111.882 115.973 111.999 115.901 112.102C115.764 112.28 115.571 112.406 115.353 112.46C115.135 112.515 114.906 112.494 114.701 112.402C113.205 111.607 111.63 110.97 110.001 110.502C108.393 110.116 106.753 109.881 105.101 109.802C103.413 109.839 101.735 110.073 100.101 110.502C98.4639 110.945 96.8858 111.582 95.4012 112.402C95.3404 112.456 95.2674 112.494 95.1885 112.514C95.1097 112.533 95.0273 112.533 94.9485 112.513C94.8698 112.493 94.797 112.455 94.7364 112.401C94.6759 112.347 94.6295 112.278 94.6012 112.202C94.5474 112.142 94.5092 112.069 94.4899 111.99C94.4706 111.911 94.4708 111.828 94.4905 111.75C94.5102 111.671 94.5488 111.598 94.6029 111.538C94.657 111.477 94.7251 111.431 94.8012 111.402Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M169.202 112.402C167.717 111.582 166.139 110.945 164.502 110.502C162.868 110.073 161.19 109.839 159.502 109.802C157.85 109.881 156.209 110.116 154.602 110.502C152.973 110.97 151.398 111.607 149.902 112.402C149.8 112.47 149.685 112.514 149.564 112.53C149.443 112.547 149.319 112.535 149.204 112.497C149.088 112.458 148.982 112.393 148.895 112.308C148.808 112.222 148.742 112.118 148.702 112.002C148.589 111.802 148.557 111.566 148.613 111.343C148.669 111.12 148.808 110.926 149.002 110.802C152.126 108.792 155.788 107.781 159.502 107.902C163.206 108.023 166.791 109.241 169.802 111.402C169.931 111.485 170.024 111.614 170.061 111.763C170.098 111.911 170.077 112.069 170.002 112.202C169.973 112.278 169.927 112.347 169.866 112.401C169.806 112.455 169.733 112.493 169.654 112.513C169.576 112.533 169.493 112.533 169.414 112.514C169.335 112.494 169.262 112.456 169.202 112.402Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M158.401 115.703C160.168 115.703 161.601 114.27 161.601 112.503C161.601 110.735 160.168 109.303 158.401 109.303C156.634 109.303 155.201 110.735 155.201 112.503C155.201 114.27 156.634 115.703 158.401 115.703Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M105.701 115.703C107.468 115.703 108.901 114.27 108.901 112.503C108.901 110.735 107.468 109.303 105.701 109.303C103.934 109.303 102.501 110.735 102.501 112.503C102.501 114.27 103.934 115.703 105.701 115.703Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M91.0008 28.801C106.782 18.2495 126.108 14.3975 144.73 18.0917C163.351 21.7859 179.742 32.724 190.301 48.501C196.201 57.201 200.601 71.901 202.401 84.001C202.801 87.301 202.801 91.101 203.001 93.701C163.701 95.601 139.801 95.901 131.001 67.501C116.201 97.201 91.6008 96.9009 59.3008 93.701C60.7008 72.201 71.7008 41.801 91.0008 28.801Z\" fill=\"%230C1F41\"/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"131.02\" y1=\"171.04\" x2=\"131.02\" y2=\"227.21\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23EBBDAC\"/%3E%3Cstop offset=\"1\" stop-color=\"%23FFE1D7\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint1_linear\" x1=\"2614.66\" y1=\"3658.72\" x2=\"1935.15\" y2=\"3658.72\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23EBBDAC\"/%3E%3Cstop offset=\"1\" stop-color=\"%23FFE1D7\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint2_linear\" x1=\"4843.09\" y1=\"3647.68\" x2=\"5454.43\" y2=\"3667.27\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23EBBDAC\"/%3E%3Cstop offset=\"1\" stop-color=\"%23FFE1D7\"/%3E%3C/linearGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0H256V256.9H0V0Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Claudia.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::5f7979fc6096085c0462c19cb376c70a>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"256\" viewBox=\"0 0 256 256\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cpath d=\"M0 0H256V256H0V0Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256C198.692 256 256 198.692 256 128C256 57.3075 198.692 0 128 0C57.3075 0 0 57.3075 0 128C0 198.692 57.3075 256 128 256Z\" fill=\"%23FFAB00\"/%3E%3Cpath d=\"M80.2 52.9986C74.9 54.6986 68.7 57.6986 66.6 63.3986C64.5 69.0986 71.3 76.0986 67.9 83.0986C65.8 87.4986 62.2 87.0986 59.3 93.1986C57.901 96.0626 57.1823 99.2111 57.2 102.399C56.9 110.799 61.4 113.999 63.2 120.299C66.7 132.899 53.6 139.799 55.5 151.199C56.4 156.699 60.7 163.599 75.5 170.399C74.0902 174.959 74.0902 179.838 75.5 184.399C77.3693 189.436 80.7151 193.793 85.1 196.899C96.1 204.299 104.5 195.499 128.3 196.699C143.9 197.499 148.1 201.699 159.6 198.399C164 197.199 172.3 194.599 176.3 186.799C178.325 182.461 178.886 177.583 177.9 172.899C180.3 172.899 187.7 172.699 193.5 167.299C199.3 161.899 201.8 150.999 199.7 142.699C197.6 134.399 192 129.099 193.5 120.299C194.5 114.399 197.2 109.999 196.4 101.499C196.136 98.0638 195.148 94.7239 193.5 91.6986C190.7 86.7986 188.2 87.1986 186.6 83.9986C183.4 77.1986 192.7 70.4986 190.1 63.3986C187.5 56.2986 179.8 56.8986 176.5 52.9986C164.4 51.3986 164.9 43.8986 152.7 43.8986C140.5 43.8986 140.5 53.0986 128.3 53.0986C116.1 53.0986 115.7 42.9986 103.6 43.8986C91.5 44.7986 92.3 51.3986 80.2 52.9986Z\" fill=\"%23FAFBFC\"/%3E%3Cpath d=\"M170.7 207.199L131.6 205.199L92.5998 207.199C91.8548 207.266 91.1357 207.505 90.4998 207.899L55.0998 231.299L53.7998 232.299C76.0778 248.144 102.843 256.44 130.177 255.972C157.511 255.504 183.977 246.297 205.7 229.699L172.8 207.899C172.151 207.533 171.438 207.296 170.7 207.199Z\" fill=\"%23FF8B00\"/%3E%3Cpath d=\"M168.299 208.899C167.299 210.299 152.399 229.699 127.799 227.999C107.299 226.699 95.6994 211.799 93.8994 209.499C98.7843 205.436 102.136 199.826 103.399 193.599C106.199 179.799 97.0994 169.399 95.9994 168.199L163.399 165.699C162.099 167.699 154.999 178.999 158.599 192.899C160.283 199.031 163.642 204.571 168.299 208.899Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M77.3 140.299C84.9215 140.299 91.1 134.121 91.1 126.499C91.1 118.878 84.9215 112.699 77.3 112.699C69.6785 112.699 63.5 118.878 63.5 126.499C63.5 134.121 69.6785 140.299 77.3 140.299Z\" fill=\"url(%23paint1_linear)\"/%3E%3Cpath d=\"M179.3 140.299C186.922 140.299 193.1 134.121 193.1 126.499C193.1 118.878 186.922 112.699 179.3 112.699C171.678 112.699 165.5 118.878 165.5 126.499C165.5 134.121 171.678 140.299 179.3 140.299Z\" fill=\"url(%23paint2_linear)\"/%3E%3Cpath d=\"M80.9005 98.7984C80.9005 105.198 80.7005 111.198 80.5005 116.998C80.3005 122.798 80.1005 121.898 79.8005 127.398C79.0005 142.898 79.8005 146.898 76.5005 150.598C73.2005 154.298 71.0005 154.798 69.7005 153.898C68.4005 152.998 70.4005 149.298 71.1005 143.798C73.1005 130.298 68.6005 116.798 68.2005 115.598C67.8005 114.398 66.1005 110.198 66.3005 106.198C66.4005 103.798 66.7005 98.4984 70.4005 96.4984C74.1005 94.4984 77.6005 95.8984 80.9005 98.7984Z\" fill=\"%23FAFBFC\"/%3E%3Cpath d=\"M184.2 121.299C183 150.899 152.3 184.899 128.5 184.899C104.7 184.899 74.0004 150.899 72.8004 121.299C71.5004 88.5988 96.0004 51.7988 128.5 51.7988C161 51.7988 185.5 88.5988 184.2 121.299Z\" fill=\"%23FFE2D9\"/%3E%3Cpath d=\"M69.1996 135.8C70.0833 135.8 70.7996 135.083 70.7996 134.2C70.7996 133.316 70.0833 132.6 69.1996 132.6C68.316 132.6 67.5996 133.316 67.5996 134.2C67.5996 135.083 68.316 135.8 69.1996 135.8Z\" fill=\"%230065FF\"/%3E%3Cpath d=\"M185.2 135.8C186.083 135.8 186.8 135.083 186.8 134.2C186.8 133.316 186.083 132.6 185.2 132.6C184.316 132.6 183.6 133.316 183.6 134.2C183.6 135.083 184.316 135.8 185.2 135.8Z\" fill=\"%230065FF\"/%3E%3Cpath d=\"M151 157.199C143.714 159.807 136.038 161.16 128.3 161.199C120.562 161.146 112.889 159.794 105.6 157.199L112.2 154.999C115.566 153.782 119.257 153.818 122.6 155.099H122.9C126.42 156.415 130.304 156.379 133.8 154.999C137.183 153.784 140.872 153.713 144.3 154.799L151 157.199Z\" fill=\"%23FF7143\"/%3E%3Cpath d=\"M151 157.199C151 157.199 145.7 168.399 128.3 168.399C110.9 168.399 105.6 157.199 105.6 157.199C120.263 162.534 136.336 162.534 151 157.199Z\" fill=\"%23FF8A63\"/%3E%3Cpath d=\"M102.6 155.1C106.638 156.995 110.86 158.47 115.2 159.5C123.853 161.532 132.863 161.498 141.5 159.4C143.7 158.9 145.8 158.3 147.9 157.6C150 156.9 152.1 156 154.1 155C154.3 155 154.5 155 154.6 155.2C154.7 155.4 154.6 155.6 154.5 155.6C150.56 157.979 146.323 159.828 141.9 161.1C137.505 162.332 132.965 162.971 128.4 163C126.094 163.016 123.789 162.883 121.5 162.6C119.24 162.321 117.001 161.887 114.8 161.3C110.356 160.133 106.086 158.385 102.1 156.1C101.997 155.997 101.924 155.869 101.889 155.728C101.854 155.587 101.858 155.439 101.9 155.3C101.987 155.206 102.099 155.137 102.222 155.102C102.346 155.067 102.476 155.066 102.6 155.1Z\" fill=\"%23FF5630\"/%3E%3Cpath d=\"M102.1 114.598C103.812 114.598 105.2 113.211 105.2 111.498C105.2 109.786 103.812 108.398 102.1 108.398C100.388 108.398 99 109.786 99 111.498C99 113.211 100.388 114.598 102.1 114.598Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M88.5996 111.199C88.9935 111.372 89.4192 111.462 89.8496 111.462C90.28 111.462 90.7057 111.372 91.0996 111.199L91.4996 110.899L91.6996 110.699L91.9996 110.399C92.3859 109.98 92.8225 109.61 93.2996 109.299C95.1586 107.815 97.3583 106.818 99.6996 106.399C102.042 106.065 104.429 106.235 106.7 106.899C108.903 107.695 110.89 108.996 112.5 110.699C112.614 110.785 112.709 110.894 112.778 111.02C112.846 111.146 112.887 111.285 112.897 111.428C112.907 111.571 112.887 111.714 112.836 111.848C112.786 111.983 112.708 112.105 112.607 112.206C112.505 112.307 112.384 112.386 112.249 112.436C112.115 112.486 111.972 112.506 111.829 112.496C111.686 112.486 111.547 112.445 111.421 112.377C111.295 112.308 111.186 112.213 111.1 112.099C109.643 110.756 107.898 109.764 106 109.199C104.096 108.587 102.079 108.416 100.1 108.699C98.1043 108.999 96.2146 109.789 94.5996 110.999L93.3996 111.899L93.0996 112.199L92.6996 112.499L91.6996 112.999C91.0435 113.182 90.345 113.145 89.7124 112.892C89.0797 112.639 88.5481 112.184 88.1996 111.599C88.0996 111.499 88.1996 111.299 88.2996 111.199H88.5996Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M151.9 114.598C153.612 114.598 155 113.211 155 111.498C155 109.786 153.612 108.398 151.9 108.398C150.188 108.398 148.8 109.786 148.8 111.498C148.8 113.211 150.188 114.598 151.9 114.598Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M165.8 112.1C165.451 112.685 164.92 113.14 164.287 113.393C163.654 113.646 162.956 113.684 162.3 113.5L161.3 113L160.9 112.7L160.6 112.4L159.4 111.5C157.799 110.282 155.898 109.521 153.9 109.3C151.964 108.934 149.967 109.072 148.1 109.7C146.188 110.304 144.419 111.291 142.9 112.6C142.814 112.714 142.704 112.809 142.578 112.878C142.452 112.946 142.313 112.987 142.17 112.997C142.028 113.008 141.884 112.987 141.75 112.937C141.616 112.887 141.494 112.808 141.393 112.707C141.291 112.606 141.213 112.484 141.163 112.35C141.113 112.215 141.092 112.072 141.102 111.929C141.112 111.786 141.153 111.647 141.222 111.521C141.29 111.395 141.385 111.286 141.5 111.2C143.109 109.472 145.143 108.196 147.4 107.5C149.619 106.753 151.985 106.547 154.3 106.9C156.653 107.28 158.862 108.281 160.7 109.8C161.177 110.111 161.613 110.481 162 110.9L162.3 111.2L162.5 111.4L163 111.7C163.393 111.873 163.819 111.963 164.25 111.963C164.68 111.963 165.106 111.873 165.5 111.7C165.6 111.7 165.8 111.7 165.8 111.9C165.8 112.1 165.9 112 165.8 112.1Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M64.5002 63.5998C69.7002 46.7998 84.1002 35.7998 96.0002 33.0998C99.9188 32.0796 104.01 31.9091 108 32.5998C113.888 33.8349 119.26 36.8348 123.4 41.1998C113.1 58.9998 102.8 69.1998 95.2002 75.2998C91.1002 78.4998 82.3002 84.8998 76.9002 96.6998C75.3005 100.145 74.1252 103.771 73.4002 107.5C72.2002 106 57.2002 86.7998 64.5002 63.5998Z\" fill=\"%23FAFBFC\"/%3E%3Cpath d=\"M108.1 84.4992C110.5 84.2992 112.9 84.1992 115.3 84.1992H129.7L136.8 84.5992C136.959 84.5992 137.112 84.6624 137.224 84.775C137.337 84.8875 137.4 85.0401 137.4 85.1992C137.4 85.3583 137.337 85.511 137.224 85.6235C137.112 85.736 136.959 85.7992 136.8 85.7992C134.5 85.9992 132.1 86.0992 129.7 86.0992H115.3L108.1 85.7992C107.932 85.775 107.779 85.6907 107.669 85.562C107.558 85.4332 107.498 85.2688 107.5 85.0992C107.5 84.9401 107.563 84.7875 107.676 84.675C107.788 84.5624 107.941 84.4992 108.1 84.4992Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M115.499 78.1984C117.899 77.9984 120.299 77.9984 122.699 77.8984H136.999C139.399 77.8984 141.799 77.9984 144.199 78.1984C144.359 78.1984 144.511 78.2616 144.624 78.3742C144.736 78.4867 144.799 78.6393 144.799 78.7984C144.799 78.9576 144.736 79.1102 144.624 79.2227C144.511 79.3352 144.359 79.3984 144.199 79.3984L136.999 79.6984H122.699L115.499 79.3984C115.34 79.3984 115.188 79.3352 115.075 79.2227C114.963 79.1102 114.899 78.9576 114.899 78.7984C114.899 78.6393 114.963 78.4867 115.075 78.3742C115.188 78.2616 115.34 78.1984 115.499 78.1984Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M138.399 26.7993C145.74 26.7993 153.009 28.2452 159.791 31.0545C166.574 33.8637 172.736 37.9813 177.927 43.1721C183.117 48.3629 187.235 54.5252 190.044 61.3073C192.854 68.0894 194.299 75.3584 194.299 82.6993C194.233 87.5243 193.595 92.3244 192.399 96.9993C190.695 103.022 187.842 108.659 183.999 113.599C168.746 107.964 154.212 100.546 140.699 91.4993C123.032 79.7511 107.252 65.3872 93.8994 48.8993C97.5994 44.1993 106.699 33.8993 121.999 29.1993C127.315 27.5844 132.844 26.7754 138.399 26.7993Z\" fill=\"%23FAFBFC\"/%3E%3Cpath d=\"M119.5 139.4L123 140.3L124.7 140.7L126.2 141.1C127.284 141.073 128.36 140.905 129.4 140.6C130.533 140.387 131.64 140.052 132.7 139.6H132.8C132.985 139.564 133.177 139.594 133.341 139.686C133.506 139.777 133.633 139.924 133.7 140.1C133.772 140.26 133.782 140.442 133.726 140.608C133.67 140.775 133.554 140.915 133.4 141C132.348 141.691 131.204 142.23 130 142.6C128.762 143.099 127.435 143.337 126.1 143.3L124.1 142.9L122.3 142.3C121.132 141.884 119.995 141.383 118.9 140.8C118.811 140.758 118.732 140.698 118.667 140.623C118.603 140.549 118.555 140.461 118.527 140.367C118.498 140.273 118.49 140.173 118.503 140.076C118.516 139.978 118.549 139.884 118.6 139.8C118.687 139.669 118.807 139.564 118.947 139.493C119.087 139.423 119.244 139.391 119.4 139.4H119.5Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M121.5 115.799C122.069 117.153 122.504 118.56 122.8 119.999C123.07 121.452 123.237 122.922 123.3 124.399C123.299 125.838 123.199 127.274 123 128.699C122.806 130.153 122.505 131.59 122.1 132.999C122.011 133.204 121.849 133.369 121.646 133.461C121.443 133.553 121.212 133.567 121 133.499C120.816 133.434 120.657 133.312 120.549 133.149C120.441 132.987 120.389 132.794 120.4 132.599C120.6 131.199 120.8 129.899 120.9 128.499C121.033 127.137 121.066 125.766 121 124.399C120.999 123.06 120.899 121.723 120.7 120.399C120.5 118.999 120.2 117.699 120 116.299C119.968 116.111 120.004 115.917 120.102 115.754C120.201 115.59 120.354 115.467 120.535 115.406C120.716 115.346 120.913 115.352 121.09 115.424C121.267 115.496 121.412 115.629 121.5 115.799Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M158.8 159.3C158.203 157.511 157.398 155.8 156.4 154.2C155.924 153.427 155.389 152.691 154.8 152L152.8 150C152.711 149.909 152.654 149.792 152.636 149.666C152.618 149.54 152.64 149.412 152.7 149.3C152.762 149.23 152.839 149.175 152.926 149.141C153.013 149.106 153.107 149.092 153.2 149.1C154.266 149.379 155.267 149.867 156.142 150.537C157.018 151.206 157.751 152.044 158.3 153C159.548 154.847 160.048 157.098 159.7 159.3C159.7 159.5 159.4 159.7 159.2 159.7L158.8 159.4V159.3Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M100.3 150C99.7517 151.792 99.3832 153.634 99.2002 155.5C99.1002 156.43 99.1002 157.369 99.2002 158.3C99.3002 159.2 99.4002 160.1 99.6002 161.1C99.6147 161.165 99.6158 161.233 99.6034 161.3C99.591 161.366 99.5653 161.429 99.528 161.485C99.4906 161.541 99.4423 161.589 99.386 161.626C99.3297 161.663 99.2665 161.688 99.2002 161.7L98.7002 161.5C97.3081 159.75 96.6614 157.523 96.9002 155.3C97.0595 153.101 98.0202 151.037 99.6002 149.5C99.7002 149.3 100 149.3 100.2 149.5C100.4 149.7 100.4 149.8 100.4 150H100.3Z\" fill=\"%23F0BEB4\"/%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"131.119\" y1=\"166.929\" x2=\"131.119\" y2=\"227.829\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23EBBEAE\"/%3E%3Cstop offset=\"0.64\" stop-color=\"%23FFE2D9\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint1_linear\" x1=\"63.57\" y1=\"126.509\" x2=\"91.11\" y2=\"126.509\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23FFE2D9\"/%3E%3Cstop offset=\"1\" stop-color=\"%23EBBEAE\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint2_linear\" x1=\"165.5\" y1=\"126.509\" x2=\"193.04\" y2=\"126.509\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23EBBEAE\"/%3E%3Cstop offset=\"1\" stop-color=\"%23FFE2D9\"/%3E%3C/linearGradient%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Colin.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::14fdc234f934bec18dd3dacc5874a357>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"256\" viewBox=\"0 0 256 256\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0H256V256H0V0Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256C198.692 256 256 198.692 256 128C256 57.3075 198.692 0 128 0C57.3075 0 0 57.3075 0 128C0 198.692 57.3075 256 128 256Z\" fill=\"%236554C0\"/%3E%3Cpath d=\"M207.3 228.4L178.5 212.3C177.705 211.841 176.816 211.568 175.9 211.5L128 209L80.1002 211.5C79.1844 211.568 78.2956 211.841 77.5002 212.3L48.7002 228.4C71.266 246.278 99.2107 256.006 128 256.006C156.79 256.006 184.734 246.278 207.3 228.4Z\" fill=\"%23C0B6F2\"/%3E%3Cpath d=\"M173 216.5C172 218 153.6 242.4 123.4 240C98.9 238.1 85.1 220.1 83 217.3C89.0836 212.73 93.395 206.192 95.2 198.8C98.8 183.2 89 171.3 87.8 169.9H164.4C163.9 170.6 152.6 186.2 159.7 202.3C162.458 208.363 167.131 213.352 173 216.5Z\" fill=\"%23E4B69D\"/%3E%3Cpath d=\"M60.8003 100.999C60.9003 98.2995 63.2003 95.8995 63.6003 93.2995C64.0003 90.6995 62.6003 87.6995 63.4003 85.0995C64.2003 82.4995 66.8003 80.6995 67.8003 78.2995C68.8003 75.8995 68.1003 72.5995 69.4003 70.1995C70.7003 67.7995 73.7003 66.6995 75.2003 64.4995C76.7003 62.2995 76.8003 58.9995 78.5003 56.9995C80.2003 54.9995 83.5003 54.4995 85.5003 52.6995C87.5003 50.8995 88.2003 47.6995 90.4003 46.1995C92.6003 44.6995 95.8003 44.8995 98.1003 43.5995C100.4 42.2995 101.9 39.3995 104.4 38.3995C106.9 37.3995 110 38.4995 112.6 37.7995C115.2 37.0995 117.3 34.6995 120 34.2995C122.7 33.8995 125.3 35.7995 128 35.7995C130.7 35.7995 133.5 33.9995 136 34.2995C138.5 34.5995 140.9 37.0995 143.4 37.7995C145.9 38.4995 149.2 37.3995 151.6 38.3995C154 39.3995 155.6 42.2995 157.9 43.5995C160.2 44.8995 163.5 44.5995 165.6 46.1995C167.7 47.7995 168.6 50.9995 170.5 52.6995C172.4 54.3995 175.7 54.9995 177.5 56.9995C179.3 58.9995 179.3 62.3995 180.8 64.4995C182.3 66.5995 185.3 67.8995 186.6 70.1995C187.9 72.4995 187.2 75.7995 188.2 78.2995C189.2 80.7995 191.9 82.5995 192.6 85.0995C193.3 87.5995 192 90.6995 192.4 93.2995C192.8 95.8995 195.1 98.2995 195.2 100.999C195.3 103.699 193.3 106.499 193 109.299C192.7 112.099 194.4 115.199 193.8 117.899C193.2 120.599 190.6 122.799 189.7 125.499C188.8 128.199 189.6 131.399 188.4 133.999C187.2 136.599 184.1 137.999 182.6 140.399C181.1 142.799 181.2 146.199 179.5 148.399C177.8 150.599 174.4 151.399 172.4 153.299C170.4 155.199 169.7 158.699 167.4 160.399C165.1 162.099 161.8 161.999 159.4 163.499C157 164.999 155.4 167.999 152.9 169.099C150.4 170.199 147 169.199 144.3 169.999C141.6 170.799 139.3 173.199 136.5 173.599C133.7 173.999 130.8 172.199 128 172.199C125.2 172.199 122.2 173.999 119.5 173.599C116.8 173.199 114.4 170.699 111.7 169.999C109 169.299 105.7 170.199 103.1 169.099C100.5 167.999 99.0003 164.899 96.6003 163.499C94.2003 162.099 90.7003 162.099 88.5003 160.399C86.3003 158.699 85.6003 155.299 83.6003 153.299C81.6003 151.299 78.3003 150.599 76.5003 148.399C74.7003 146.199 74.8003 142.799 73.4003 140.399C72.0003 137.999 68.8003 136.499 67.6003 133.999C66.4003 131.499 67.2003 128.099 66.3003 125.399C65.4003 122.699 62.8003 120.599 62.2003 117.899C61.6003 115.199 63.2003 112.099 63.0003 109.299C62.8003 106.499 60.7003 103.799 60.8003 100.999Z\" fill=\"%23543E36\"/%3E%3Cpath d=\"M77.5942 145.606C84.7152 143.804 88.6757 135.182 86.4403 126.348C84.2049 117.513 76.62 111.812 69.4991 113.614C62.3781 115.416 58.4176 124.039 60.653 132.873C62.8885 141.707 70.4733 147.408 77.5942 145.606Z\" fill=\"%23E4B69D\"/%3E%3Cpath d=\"M196.075 132.852C198.31 124.017 194.35 115.395 187.229 113.593C180.108 111.791 172.523 117.492 170.288 126.326C168.052 135.161 172.013 143.783 179.134 145.585C186.255 147.387 193.84 141.686 196.075 132.852Z\" fill=\"%23E4B69D\"/%3E%3Cpath d=\"M127.9 46.0996C155.6 46.2996 172.5 64.9996 175.1 67.9996C192.6 88.1996 190.8 112.3 190.4 117.4C189.4 129.8 184.4 139.7 174.7 159.7C170.311 168.904 165.403 177.851 160 186.5C158.46 188.939 156.281 190.91 153.7 192.2C145.689 196.28 136.885 198.566 127.9 198.9C118.882 198.578 110.043 196.291 102 192.2C99.4672 190.879 97.3283 188.913 95.8002 186.5C90.3601 177.856 85.4187 168.908 81.0002 159.7C71.4002 139.7 66.3002 129.8 65.4002 117.4C65.0002 112.3 63.1002 88.1996 80.7002 67.9996C83.3002 64.9996 100.2 46.2996 127.9 46.0996Z\" fill=\"%23EFC7B0\"/%3E%3Cpath d=\"M139.4 105.699L140.6 104.699L141.8 103.899C142.6 103.299 143.5 102.899 144.3 102.399C146.01 101.618 147.783 100.983 149.6 100.499C153.259 99.5848 157.049 99.3141 160.8 99.6992C164.556 100.115 168.193 101.27 171.5 103.099C173.101 104.017 174.608 105.088 176 106.299C177.441 107.54 178.688 108.99 179.7 110.599C179.79 110.736 179.852 110.889 179.88 111.05C179.909 111.211 179.905 111.376 179.867 111.536C179.83 111.695 179.76 111.845 179.663 111.976C179.565 112.107 179.442 112.217 179.3 112.299C179.065 112.443 178.788 112.502 178.515 112.465C178.242 112.429 177.989 112.3 177.8 112.099H177.7C176.627 110.917 175.379 109.905 174 109.099C172.656 108.177 171.214 107.406 169.7 106.799C166.752 105.529 163.605 104.784 160.4 104.599C157.208 104.497 154.016 104.799 150.9 105.499C149.334 105.893 147.797 106.395 146.3 106.999L144.2 107.999L143.2 108.499L142.3 109.099H142C141.548 109.301 141.042 109.344 140.562 109.221C140.083 109.099 139.658 108.819 139.358 108.426C139.057 108.033 138.898 107.55 138.906 107.055C138.913 106.56 139.088 106.083 139.4 105.699Z\" fill=\"%23543E36\"/%3E%3Cpath d=\"M114.8 109L113.9 108.4L112.9 107.9L110.8 106.9C109.303 106.295 107.766 105.794 106.2 105.4C103.084 104.705 99.8922 104.402 96.7004 104.5C93.4958 104.685 90.3483 105.429 87.4004 106.7C85.887 107.306 84.4449 108.077 83.1004 109C81.7217 109.806 80.474 110.817 79.4004 112H79.3004C79.1889 112.112 79.0565 112.2 78.9106 112.261C78.7647 112.321 78.6083 112.353 78.4504 112.353C78.2925 112.353 78.1361 112.321 77.9902 112.261C77.8444 112.2 77.7119 112.112 77.6004 112C77.3999 111.811 77.2706 111.558 77.2342 111.285C77.1977 111.012 77.2564 110.735 77.4004 110.5C78.4128 108.89 79.6599 107.441 81.1004 106.2C82.4745 104.966 83.9842 103.893 85.6004 103C88.9074 101.17 92.5441 100.015 96.3004 99.5996C100.052 99.2145 103.842 99.4852 107.5 100.4C109.317 100.883 111.09 101.519 112.8 102.3C113.6 102.8 114.5 103.2 115.3 103.8L116.5 104.6L117.7 105.6C118.013 105.983 118.187 106.461 118.195 106.956C118.203 107.45 118.044 107.933 117.743 108.326C117.442 108.719 117.018 109 116.539 109.122C116.059 109.244 115.552 109.201 115.1 109H114.8Z\" fill=\"%23543E36\"/%3E%3Cpath d=\"M89.0005 117.5C92.0555 115.351 95.6682 114.135 99.4005 114C103.192 113.866 106.931 114.915 110.101 117C110.21 117.061 110.306 117.144 110.381 117.245C110.457 117.345 110.511 117.461 110.539 117.583C110.567 117.706 110.569 117.833 110.546 117.956C110.522 118.079 110.472 118.196 110.401 118.3C110.263 118.477 110.07 118.603 109.852 118.657C109.635 118.712 109.405 118.691 109.201 118.6C107.719 117.748 106.141 117.076 104.501 116.6C102.864 116.197 101.185 115.995 99.5005 116C97.7805 115.952 96.0626 116.154 94.4005 116.6C92.7596 117.076 91.1817 117.748 89.7005 118.6C89.5381 118.652 89.3632 118.651 89.2013 118.597C89.0393 118.543 88.8989 118.439 88.8005 118.3C88.7581 118.161 88.7543 118.013 88.7895 117.872C88.8247 117.731 88.8977 117.602 89.0005 117.5Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M166.3 118.6C164.784 117.747 163.173 117.076 161.5 116.6C159.871 116.16 158.187 115.957 156.5 116C154.816 115.995 153.136 116.197 151.5 116.6C149.853 117.058 148.273 117.731 146.8 118.6C146.57 118.688 146.317 118.697 146.081 118.625C145.845 118.552 145.641 118.402 145.5 118.2C145.388 117.999 145.356 117.763 145.412 117.54C145.467 117.317 145.607 117.123 145.8 117C148.97 114.915 152.709 113.866 156.5 114C160.233 114.135 163.845 115.351 166.9 117.5C167.037 117.6 167.133 117.746 167.17 117.912C167.206 118.078 167.182 118.251 167.1 118.4C166.998 118.502 166.869 118.575 166.728 118.611C166.587 118.646 166.439 118.642 166.3 118.6Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M155.4 121.5C157.168 121.5 158.6 120.067 158.6 118.3C158.6 116.532 157.168 115.1 155.4 115.1C153.633 115.1 152.2 116.532 152.2 118.3C152.2 120.067 153.633 121.5 155.4 121.5Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M100.1 121.5C101.868 121.5 103.3 120.067 103.3 118.3C103.3 116.532 101.868 115.1 100.1 115.1C98.3331 115.1 96.9004 116.532 96.9004 118.3C96.9004 120.067 98.3331 121.5 100.1 121.5Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M126.5 79.9001C130.5 79.9001 134.4 81.4001 137.7 80.5001C141 79.6001 144.3 76.3001 147.4 74.8001C150.5 73.3001 155.3 73.2001 158.3 71.9001C161.3 70.6001 166 67.7001 169 69.9001C172 72.1001 170.2 74.5001 170.6 77.2001C171 79.9001 173.1 81.4001 173.5 84.1001C173.9 86.8001 172.2 89.0001 173 91.6001C173.8 94.2001 176.4 95.1001 177.7 97.4001C179 99.7001 178.2 102 179.4 103.5C180.6 105 183.5 105.2 184.9 106.6C186.3 108 186.8 110.8 188.3 111.9C189.8 113 192.3 112.4 193.9 113.3C194.958 108.025 195.026 102.6 194.1 97.3001C193.3 92.4001 189.9 87.4001 187.6 81.6001C185.3 75.8001 184.8 70.7001 181.2 65.9001C177.6 61.1001 172.7 59.0001 168 55.3001C163.3 51.6001 160.7 47.9001 156.5 46.0001C152.3 44.1001 146.4 44.3001 141.9 43.5001C137.4 42.7001 131.7 40.1001 127.4 40.2001C119.7 40.4001 114.5 43.7001 113.2 44.1001C111.9 44.5001 106 44.0001 99.5005 47.3001C96.0005 49.2001 93.1005 53.3001 89.0005 56.6001C84.9005 59.9001 80.9005 61.0001 77.8005 64.9001C74.7005 68.8001 74.2005 73.2001 72.0005 77.7001C70.5005 80.5001 67.5005 82.6001 66.5005 85.4001C65.5005 88.2001 66.7005 92.0001 66.2005 94.8001C65.7005 97.6001 63.2005 100.9 63.1005 103.7C63.0005 106.5 64.5005 109.8 64.7005 112.1C66.3005 110.8 68.3005 110.9 70.0005 109.2C71.7005 107.5 71.5005 104.7 73.0005 102.8C74.5005 100.9 77.3005 100.3 78.4005 98.3001C79.5005 96.3001 78.5005 93.5001 79.3005 91.3001C80.1005 89.1001 82.4005 88.5001 82.7005 87.0001C83.0005 85.5001 81.3005 83.1001 81.4005 81.6001C81.5005 80.1001 83.7005 78.3001 84.0005 76.8001C84.3005 75.3001 83.3005 72.7001 84.7005 71.5001C86.1005 70.3001 91.0005 71.5001 95.2005 73.1001C99.4005 74.7001 102.2 73.9001 105.9 75.4001C109.6 76.9001 111.8 79.9001 115.6 80.7001C119.4 81.5001 122.7 79.9001 126.5 79.9001Z\" fill=\"%23543E36\"/%3E%3Cpath d=\"M188.101 103.4L184.501 119.2C184.084 121.067 184.201 123.013 184.837 124.817C185.474 126.62 186.605 128.209 188.101 129.4C188.101 129.4 191.701 119.9 192.501 115.4C193.301 110.9 188.101 103.4 188.101 103.4Z\" fill=\"%23543E36\"/%3E%3Cpath d=\"M67.3004 103.4L70.6004 119.2C71.0512 121.039 70.9813 122.967 70.3985 124.769C69.8157 126.57 68.7429 128.174 67.3004 129.4C67.3004 129.4 63.9004 119.9 63.1004 115.4C62.3004 110.9 67.3004 103.4 67.3004 103.4Z\" fill=\"%23543E36\"/%3E%3Cpath d=\"M121.8 115.799C122.592 117.494 123.196 119.272 123.6 121.099C123.982 122.974 124.116 124.89 124 126.799C123.972 128.692 123.703 130.574 123.2 132.399C122.699 134.222 121.96 135.971 121 137.599C120.948 137.692 120.878 137.773 120.794 137.838C120.711 137.904 120.615 137.952 120.513 137.98C120.41 138.007 120.303 138.015 120.198 138.001C120.093 137.987 119.992 137.953 119.9 137.899C119.713 137.794 119.57 137.625 119.497 137.423C119.423 137.221 119.424 137 119.5 136.799C120.183 135.184 120.718 133.511 121.1 131.799C121.901 128.424 122.037 124.926 121.5 121.499C121.195 119.778 120.794 118.076 120.3 116.399C120.252 116.302 120.227 116.195 120.227 116.087C120.227 115.978 120.252 115.872 120.301 115.775C120.349 115.678 120.419 115.593 120.506 115.528C120.593 115.463 120.693 115.419 120.8 115.399C120.89 115.35 120.99 115.322 121.093 115.316C121.196 115.31 121.298 115.326 121.394 115.365C121.489 115.403 121.575 115.461 121.645 115.537C121.715 115.612 121.768 115.701 121.8 115.799Z\" fill=\"%23CEA28B\"/%3E%3Cpath d=\"M144.1 167.401C138.8 166.401 135.3 165.101 131.4 165.801L130.6 166.001C128.407 166.601 126.093 166.601 123.9 166.001L123.2 165.801C119.4 165.101 116 166.201 110.6 167.201C109.5 167.401 107.8 167.801 105.5 168.101C108.379 170.919 111.788 173.139 115.53 174.632C119.271 176.125 123.272 176.862 127.3 176.801C140.9 176.801 148.6 168.601 149 168.101L144.1 167.401Z\" fill=\"%23DB9C94\"/%3E%3Cpath d=\"M103 167.101C106.911 168.183 110.885 169.018 114.9 169.601C118.88 170.116 122.887 170.383 126.9 170.401C130.915 170.35 134.923 170.049 138.9 169.501C140.9 169.201 142.9 168.901 144.9 168.401L150.7 167.001C151.1 166.901 151.4 167.001 151.5 167.401C151.532 167.546 151.509 167.699 151.435 167.828C151.361 167.958 151.242 168.055 151.1 168.101C147.261 169.641 143.273 170.78 139.2 171.501C135.139 172.219 131.024 172.587 126.9 172.601C124.8 172.601 122.8 172.501 120.7 172.301C118.65 172.189 116.61 171.921 114.6 171.501C110.49 170.849 106.466 169.742 102.6 168.201C102.531 168.179 102.467 168.143 102.413 168.095C102.36 168.046 102.317 167.987 102.288 167.92C102.26 167.854 102.246 167.782 102.248 167.709C102.25 167.637 102.268 167.566 102.3 167.501C102.346 167.359 102.444 167.24 102.573 167.166C102.702 167.092 102.855 167.069 103 167.101Z\" fill=\"%23CB8C84\"/%3E%3Cpath d=\"M118 143.7L122.6 144.9L124.9 145.6C125.592 145.772 126.293 145.906 127 146C128.49 146.034 129.975 145.831 131.4 145.4C132.896 144.99 134.366 144.489 135.8 143.9C135.985 143.864 136.177 143.894 136.342 143.986C136.506 144.077 136.633 144.224 136.7 144.4C136.773 144.56 136.782 144.742 136.726 144.909C136.671 145.075 136.554 145.215 136.4 145.3C134.998 146.167 133.484 146.84 131.9 147.3C130.287 147.971 128.546 148.278 126.8 148.2C125.948 148.15 125.106 147.982 124.3 147.7L121.9 147L117.5 145.1C117.403 145.068 117.313 145.016 117.238 144.945C117.163 144.875 117.104 144.789 117.066 144.694C117.028 144.598 117.011 144.496 117.017 144.393C117.023 144.29 117.051 144.19 117.1 144.1C117.166 143.95 117.282 143.829 117.428 143.756C117.574 143.682 117.741 143.663 117.9 143.7H118Z\" fill=\"%23CEA28B\"/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0H256V256H0V0Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Ed.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::57743f118368895325424bbc1122c0e1>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"256\" viewBox=\"0 0 256 256\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cpath d=\"M0 0H256V256H0V0Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256C198.692 256 256 198.692 256 128C256 57.3075 198.692 0 128 0C57.3075 0 0 57.3075 0 128C0 198.692 57.3075 256 128 256Z\" fill=\"%238777D9\"/%3E%3Cpath d=\"M108.9 231.9H142.2L142.1 221.8L160.9 212.8L126.6 211L90 212.9L108.9 223.1V231.9Z\" fill=\"%23403294\"/%3E%3Cpath d=\"M69.7998 216.1L65.3998 218.1L47.7998 227.8C65.1717 241.754 85.8901 250.924 107.9 254.4L67.6998 222.9L69.7998 216.1Z\" fill=\"%23403294\"/%3E%3Cpath d=\"M182.8 216L184.9 222.9L148.2 254.4C169.674 250.999 189.919 242.151 207 228.7L188.5 218.6C186.678 217.573 184.771 216.703 182.8 216Z\" fill=\"%23403294\"/%3E%3Cpath d=\"M108.8 254.6C115.159 255.521 121.575 255.989 128 256C132.877 255.986 137.75 255.719 142.6 255.2L142.2 231.9H108.9L108.8 254.6Z\" fill=\"%236554C0\"/%3E%3Cpath d=\"M108.8 231.9V254.6L108.9 231.9H108.8Z\" fill=\"%23403294\"/%3E%3Cpath d=\"M142.7 255.2V231.9H142.2L142.6 255.2H142.7Z\" fill=\"%23403294\"/%3E%3Cpath d=\"M178.8 225.7C144.625 214.096 107.575 214.096 73.3998 225.7C73.3998 218.5 73.3998 211.2 73.2998 204C89.9475 196.544 107.991 192.714 126.232 192.766C144.473 192.818 162.495 196.75 179.1 204.3L178.8 225.7Z\" fill=\"%23403294\"/%3E%3Cpath d=\"M72.2264 148.998C79.9363 147.047 84.2205 137.696 81.7954 128.112C79.3703 118.529 71.1543 112.341 63.4444 114.292C55.7345 116.243 51.4503 125.593 53.8754 135.177C56.3005 144.761 64.5165 150.949 72.2264 148.998Z\" fill=\"%23DFB28B\"/%3E%3Cpath d=\"M197.425 135.345C199.85 125.761 195.566 116.41 187.856 114.459C180.146 112.508 171.93 118.696 169.505 128.28C167.08 137.864 171.364 147.214 179.074 149.165C186.784 151.116 195 144.928 197.425 135.345Z\" fill=\"%23DFB28B\"/%3E%3Cpath d=\"M174.6 216.501C173.5 218.001 154.6 242.401 123.7 240.001C98.5998 238.101 84.3998 220.101 82.2998 217.301C87.3478 212.112 90.9654 205.704 92.7998 198.701C95.0609 189.463 94.2536 179.74 90.4998 171.001L164.2 169.201C163.1 171.501 156.9 184.901 162.3 199.801C164.739 206.419 169.003 212.209 174.6 216.501Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M126.1 37.9004C154.9 38.1004 172.5 57.6004 175.2 60.7004C193.5 81.7004 191.6 106.8 191.2 112C190.1 125 188 135.3 178 156.2C163.7 189.8 137.8 196.5 126.1 197C114.4 197.5 84.1005 181.2 74.2005 156.2C64.2005 135.3 62.1005 125 61.1005 112C60.7005 106.8 58.7005 81.7004 77.0005 60.7004C79.7005 57.6004 97.3005 38.1004 126.1 37.9004Z\" fill=\"%23ECC19C\"/%3E%3Cpath d=\"M142.4 104.701C144.331 103.63 146.426 102.887 148.6 102.501C150.772 102.068 152.992 101.934 155.2 102.101C157.397 102.209 159.56 102.682 161.6 103.501C163.641 104.252 165.561 105.296 167.3 106.601C167.471 106.721 167.587 106.904 167.624 107.11C167.662 107.315 167.617 107.527 167.5 107.701C167.383 107.845 167.219 107.944 167.036 107.981C166.854 108.017 166.664 107.989 166.5 107.901C162.969 106.097 159.066 105.138 155.1 105.101C153.124 105.114 151.151 105.281 149.2 105.601L143.5 107.101C143.337 107.164 143.162 107.193 142.986 107.187C142.811 107.18 142.638 107.138 142.479 107.064C142.321 106.989 142.179 106.883 142.062 106.752C141.945 106.62 141.856 106.467 141.8 106.301C141.69 106.006 141.69 105.682 141.801 105.388C141.911 105.094 142.124 104.85 142.4 104.701Z\" fill=\"%23344563\"/%3E%3Cpath d=\"M87.3002 119C90.4798 116.773 94.2235 115.491 98.1002 115.3C102.027 115.197 105.894 116.277 109.2 118.4C109.357 118.55 109.461 118.748 109.495 118.962C109.53 119.177 109.494 119.397 109.392 119.589C109.29 119.782 109.129 119.935 108.932 120.027C108.735 120.12 108.513 120.145 108.3 120.1H108.2C106.714 119.188 105.094 118.513 103.4 118.1C99.9623 117.199 96.3547 117.165 92.9002 118C91.1854 118.492 89.5392 119.197 88.0002 120.1C87.8378 120.152 87.6629 120.151 87.5009 120.097C87.339 120.043 87.1986 119.939 87.1002 119.8C87.0464 119.739 87.0082 119.666 86.9889 119.587C86.9696 119.508 86.9698 119.426 86.9895 119.347C87.0092 119.268 87.0478 119.195 87.1019 119.135C87.1561 119.074 87.2241 119.028 87.3002 119Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M162.6 120.1C161.026 119.198 159.347 118.492 157.6 118C154.179 117.165 150.604 117.2 147.2 118.1C145.48 118.531 143.83 119.205 142.3 120.1C142.07 120.189 141.817 120.198 141.581 120.125C141.345 120.053 141.141 119.903 141 119.7C140.901 119.481 140.876 119.234 140.931 118.999C140.985 118.765 141.115 118.554 141.3 118.4C144.611 116.289 148.475 115.21 152.4 115.3C156.305 115.505 160.078 116.785 163.3 119C163.383 119.114 163.43 119.25 163.435 119.391C163.439 119.531 163.401 119.67 163.326 119.789C163.25 119.908 163.14 120.001 163.011 120.057C162.881 120.112 162.738 120.127 162.6 120.1Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M151.3 122.9C153.178 122.9 154.7 121.377 154.7 119.5C154.7 117.622 153.178 116.1 151.3 116.1C149.423 116.1 147.9 117.622 147.9 119.5C147.9 121.377 149.423 122.9 151.3 122.9Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M98.8004 122.9C100.678 122.9 102.2 121.377 102.2 119.5C102.2 117.622 100.678 116.1 98.8004 116.1C96.9226 116.1 95.4004 117.622 95.4004 119.5C95.4004 121.377 96.9226 122.9 98.8004 122.9Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M107.701 107.101C105.864 106.495 103.994 105.994 102.101 105.601C100.15 105.285 98.1773 105.118 96.2008 105.101C92.2353 105.138 88.3327 106.097 84.8008 107.901H84.7008C84.6168 107.952 84.5229 107.985 84.4251 107.998C84.3274 108.011 84.2281 108.003 84.1337 107.974C84.0393 107.946 83.9519 107.898 83.8774 107.834C83.8028 107.769 83.7426 107.69 83.7008 107.601C83.6587 107.429 83.6548 107.251 83.6893 107.078C83.7239 106.905 83.7961 106.742 83.9008 106.601C85.6656 105.336 87.5802 104.295 89.6008 103.501C91.6794 102.692 93.8736 102.219 96.1008 102.101C98.3088 101.934 100.529 102.068 102.701 102.501C104.871 102.902 106.963 103.644 108.901 104.701C109.054 104.784 109.189 104.897 109.297 105.033C109.406 105.17 109.486 105.327 109.532 105.495C109.579 105.663 109.591 105.838 109.569 106.011C109.546 106.184 109.489 106.35 109.401 106.501C109.336 106.646 109.243 106.777 109.127 106.886C109.011 106.994 108.875 107.079 108.726 107.135C108.577 107.191 108.419 107.217 108.26 107.211C108.101 107.205 107.945 107.167 107.801 107.101H107.701Z\" fill=\"%23344563\"/%3E%3Cpath d=\"M164.6 51L163.4 59C168.284 66.9442 172.371 75.3518 175.6 84.1C179.5 94.9 181.5 100.2 182.4 106.9C183.7 115.4 183.1 121.3 186.9 123.5C187.718 124.005 188.643 124.313 189.6 124.4C190.4 120.2 190.8 116.3 191.2 112C191.6 107.7 193.5 81.7 175.2 60.7C172.03 57.0911 168.476 53.8386 164.6 51Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M77.0005 60.7C58.7005 81.7 60.7005 106.8 61.1005 112C61.381 116.162 61.9153 120.303 62.7005 124.4C63.6236 124.299 64.5122 123.991 65.3005 123.5C69.1005 121.3 68.5005 115.4 69.8005 106.9C70.8005 100.2 72.7005 94.9 76.6005 84.1C79.8301 75.3342 83.9518 66.9234 88.9005 59L87.6005 51C83.7495 53.8682 80.1982 57.118 77.0005 60.7Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M142.8 163.4C137.3 162.5 133.7 161.5 129.6 162.1H128.7C126.427 162.598 124.073 162.598 121.8 162.1H121C117.1 161.5 113.6 162.4 108 163.2L102.7 164C103.1 164.3 111.1 172.1 125.3 172.1C133.565 172.219 141.593 169.342 147.9 164L142.8 163.4Z\" fill=\"%23E0ADA6\"/%3E%3Cpath d=\"M116.2 139L119.8 139.9L121.6 140.4L123.2 140.7C124.315 140.754 125.43 140.618 126.5 140.3C127.697 140.039 128.869 139.671 130 139.2C130.199 139.136 130.415 139.153 130.602 139.246C130.789 139.34 130.932 139.503 131 139.7C131.052 139.862 131.052 140.037 130.998 140.199C130.944 140.361 130.839 140.502 130.7 140.6C129.604 141.365 128.387 141.94 127.1 142.3C125.834 142.833 124.474 143.105 123.1 143.1L121 142.7L119.1 142.1L115.6 140.5C115.507 140.448 115.426 140.378 115.361 140.295C115.296 140.211 115.248 140.115 115.22 140.013C115.192 139.91 115.184 139.804 115.198 139.698C115.212 139.593 115.247 139.492 115.3 139.4C115.4 139.1 115.8 139 116.1 139H116.2Z\" fill=\"%23CEA28B\"/%3E%3Cpath d=\"M99.8994 162.799C108.436 165.651 117.401 167.005 126.399 166.799C134.392 166.598 142.311 165.217 149.899 162.699\" fill=\"%23E0ADA6\"/%3E%3Cpath d=\"M99.9998 162.3C104.065 163.463 108.21 164.332 112.4 164.9C116.537 165.518 120.718 165.786 124.9 165.7C129.083 165.702 133.26 165.402 137.4 164.8C139.484 164.539 141.553 164.172 143.6 163.7C145.66 163.273 147.696 162.739 149.7 162.1C149.845 162.068 149.998 162.091 150.127 162.165C150.256 162.239 150.354 162.358 150.4 162.5C150.439 162.633 150.43 162.776 150.375 162.904C150.32 163.031 150.223 163.136 150.1 163.2C146.088 164.761 141.936 165.933 137.7 166.7C133.471 167.418 129.189 167.786 124.9 167.8C122.8 167.8 120.6 167.7 118.5 167.5C116.35 167.388 114.211 167.12 112.1 166.7C107.854 166.027 103.695 164.887 99.6998 163.3C99.6306 163.279 99.5669 163.242 99.5131 163.194C99.4593 163.146 99.4166 163.086 99.3881 163.019C99.3596 162.953 99.3458 162.881 99.3479 162.808C99.3499 162.736 99.3676 162.665 99.3998 162.6C99.4998 162.4 99.7998 162.2 99.9998 162.3Z\" fill=\"%23CB8C84\"/%3E%3Cpath d=\"M178.2 66.2002C180 54.0002 159.9 40.0002 143.3 35.7002C131.7 32.7002 122 34.5002 116.4 35.5002C108.3 37.1002 88.6998 40.9002 78.7998 55.7002C74.9998 61.3002 72.9998 68.0002 66.0998 70.2002C61.7998 71.6002 57.4998 70.1002 56.0998 72.5002C54.6998 74.9002 56.8998 77.9002 57.7998 79.2002C60.3159 82.9356 64.0136 85.7176 68.2998 87.1002C72.8998 88.9002 79.5998 90.3002 89.3998 89.0002C103.6 87.1002 106.2 81.8003 117.7 81.9002C124.4 82.0002 126.3 83.8002 132.2 85.0002C150.7 88.5002 176.3 78.9002 178.2 66.2002Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M98.7002 139.8H91.3002C88.6238 139.543 86.0835 138.499 84.0002 136.8C81.8618 135.188 80.1743 133.053 79.1002 130.6C78.009 128.208 77.3975 125.626 77.3002 123V117.5C77.272 116.761 77.3392 116.021 77.5002 115.3C77.7606 113.733 78.5772 112.313 79.8002 111.3C80.8899 110.319 82.1898 109.6 83.6002 109.2C86.0935 108.596 88.638 108.228 91.2002 108.1H98.5002C101 108.1 103.4 108.2 105.9 108.4L113.2 109.2H114.1L115.1 109.5C115.795 109.643 116.468 109.879 117.1 110.2C117.786 110.545 118.397 111.02 118.9 111.6C119.414 112.191 119.82 112.868 120.1 113.6C120.392 114.912 120.493 116.259 120.4 117.6C120.396 118.872 120.296 120.142 120.1 121.4C119.263 126.459 116.723 131.081 112.9 134.5C108.94 137.885 103.91 139.762 98.7002 139.8ZM98.7002 137.4C100.978 137.392 103.24 137.02 105.4 136.3C107.546 135.466 109.54 134.283 111.3 132.8C113.447 130.926 115.152 128.6 116.293 125.989C117.434 123.379 117.983 120.548 117.9 117.7C117.97 116.624 117.869 115.544 117.6 114.5C117.457 114.082 117.22 113.703 116.908 113.392C116.596 113.08 116.217 112.843 115.8 112.7L114.4 112.2L113.6 112H112.7L105.6 111.5H98.5002L91.3002 111.9C89.0692 112.046 86.8583 112.415 84.7002 113C83.7638 113.323 82.8858 113.796 82.1002 114.4C81.4985 114.94 81.0501 115.63 80.8002 116.4L80.5002 117.9C80.5138 118.468 80.4804 119.037 80.4002 119.6V123C80.4291 125.205 80.9254 127.379 81.8562 129.379C82.787 131.378 84.1312 133.158 85.8002 134.6C87.4819 135.944 89.4777 136.839 91.6002 137.2H98.7002V137.4Z\" fill=\"%23403294\"/%3E%3Cpath d=\"M153 137.401H160.1C162.222 137.04 164.218 136.145 165.9 134.801C167.569 133.359 168.913 131.58 169.844 129.58C170.774 127.581 171.271 125.407 171.3 123.201V119.601C171.3 119.001 171.2 118.401 171.2 117.901C171.148 117.393 171.047 116.89 170.9 116.401C170.65 115.632 170.201 114.942 169.6 114.401C168.85 113.798 168.005 113.325 167.1 113.001C164.908 112.416 162.664 112.048 160.4 111.901L153.2 111.501H146.1L139 112.001H138.1L137.4 112.201C136.881 112.307 136.378 112.475 135.9 112.701C135.497 112.851 135.135 113.091 134.84 113.403C134.545 113.715 134.326 114.091 134.2 114.501C133.845 115.528 133.709 116.618 133.8 117.701C133.763 118.838 133.83 119.976 134 121.101C134.639 125.673 136.956 129.843 140.5 132.801C142.209 134.304 144.173 135.489 146.3 136.301C148.462 137.014 150.723 137.385 153 137.401ZM153 139.801C147.863 139.788 142.9 137.944 139 134.601C135.12 131.213 132.54 126.582 131.7 121.501C131.504 120.244 131.404 118.974 131.4 117.701C131.293 116.355 131.428 115 131.8 113.701C132.004 112.957 132.381 112.272 132.9 111.701C133.423 111.143 134.03 110.671 134.7 110.301C135.332 109.98 136.005 109.745 136.7 109.601L137.7 109.301H138.6L145.9 108.501C148.4 108.301 150.8 108.201 153.3 108.201H160.6C163.162 108.329 165.706 108.698 168.2 109.301C169.619 109.681 170.923 110.402 172 111.401C173.221 112.431 174.066 113.838 174.4 115.401C174.531 116.127 174.564 116.867 174.5 117.601V119.401C174.4 120.701 174.5 121.801 174.4 123.101C174.302 125.728 173.691 128.31 172.6 130.701C171.531 133.13 169.883 135.259 167.8 136.901C165.671 138.588 163.102 139.63 160.4 139.901H153V139.801Z\" fill=\"%23403294\"/%3E%3Cpath d=\"M131.4 120.501C131.038 120.456 130.693 120.319 130.4 120.101C129.059 119.334 127.545 118.921 126 118.901C124.485 118.905 122.999 119.32 121.7 120.101C121.315 120.323 120.861 120.394 120.425 120.301C119.99 120.208 119.605 119.957 119.344 119.597C119.083 119.236 118.965 118.792 119.012 118.349C119.06 117.907 119.269 117.498 119.6 117.201C121.471 115.878 123.71 115.178 126 115.201C128.324 115.164 130.599 115.864 132.5 117.201C132.883 117.481 133.139 117.9 133.214 118.368C133.289 118.836 133.176 119.315 132.9 119.701C132.73 119.941 132.505 120.139 132.245 120.278C131.985 120.417 131.695 120.493 131.4 120.501Z\" fill=\"%23403294\"/%3E%3Cpath d=\"M173.8 114.201H188.4C188.983 114.201 189.543 114.433 189.955 114.846C190.368 115.258 190.6 115.818 190.6 116.401C190.6 116.985 190.368 117.544 189.955 117.957C189.543 118.369 188.983 118.601 188.4 118.601H173.8V114.201Z\" fill=\"%23403294\"/%3E%3Cpath d=\"M79.3996 117.8H63.7996C63.2161 117.8 62.6566 117.569 62.244 117.156C61.8314 116.743 61.5996 116.184 61.5996 115.6C61.5996 115.017 61.8314 114.457 62.244 114.045C62.6566 113.632 63.2161 113.4 63.7996 113.4H79.3996V117.8Z\" fill=\"%23403294\"/%3E%3Cpath d=\"M182.801 216L179.301 204L160.901 212.8L142.101 221.8V231.9L142.601 255.2L148.101 254.4L184.801 222.9L182.801 216Z\" fill=\"%235243AA\"/%3E%3Cpath d=\"M73.3002 204L69.8002 216.1L67.7002 222.9L107.9 254.4L108.8 254.6V231.9H108.9V223.1L90.0002 212.9L73.3002 204Z\" fill=\"%235243AA\"/%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"128.42\" y1=\"235.371\" x2=\"128.42\" y2=\"138.291\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23ECC19C\"/%3E%3Cstop offset=\"1\" stop-color=\"%23CEA28B\"/%3E%3C/linearGradient%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Effie.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::ec443e04b879fc0f17b70d71aaea2ad3>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"257\" viewBox=\"0 0 256 257\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256.9C198.692 256.9 256 199.593 256 128.9C256 58.2079 198.692 0.900391 128 0.900391C57.3075 0.900391 0 58.2079 0 128.9C0 199.593 57.3075 256.9 128 256.9Z\" fill=\"%23FFAB00\"/%3E%3Cpath d=\"M209.9 139.2C206.4 4.49952 51.1999 -7.80048 47.8999 139.2C47.6999 150.3 47.5999 161.6 53.8999 170.5C56.7596 174.572 60.6158 177.843 65.0999 180C69.0009 181.891 73.2655 182.914 77.5999 183C86.3999 183.3 172.2 181.9 182.4 182C185.942 182.143 189.469 181.458 192.7 180C197.254 177.951 201.136 174.658 203.9 170.5C210.3 161.6 210.2 150.3 209.9 139.2Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M168 208.1L128.9 206.1L89.8999 208.1C89.1549 208.166 88.4358 208.406 87.7999 208.8L52.3999 232.2C74.4963 248.348 101.181 257.001 128.549 256.893C155.916 256.785 182.532 247.922 204.5 231.6L170 208.8C169.394 208.42 168.71 208.181 168 208.1Z\" fill=\"%23FFE380\"/%3E%3Cpath d=\"M165.6 209.799C164.7 210.999 149.8 230.899 125.1 228.899C105.2 227.399 93.8997 212.699 92.1997 210.399C97.2093 206.702 100.751 201.354 102.2 195.299C105.1 182.599 97.0997 172.899 96.1997 171.799H158.6C158.1 172.399 149 185.099 154.8 198.199C157.07 203.118 160.855 207.183 165.6 209.799Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M75.4001 141.299C83.0216 141.299 89.2001 135.121 89.2001 127.499C89.2001 119.878 83.0216 113.699 75.4001 113.699C67.7786 113.699 61.6001 119.878 61.6001 127.499C61.6001 135.121 67.7786 141.299 75.4001 141.299Z\" fill=\"%239C6439\"/%3E%3Cpath d=\"M177.3 141.299C184.922 141.299 191.1 135.121 191.1 127.499C191.1 119.878 184.922 113.699 177.3 113.699C169.678 113.699 163.5 119.878 163.5 127.499C163.5 135.121 169.678 141.299 177.3 141.299Z\" fill=\"%239C6439\"/%3E%3Cpath d=\"M79.0003 99.7984C78.9003 106.098 78.8003 112.198 78.5003 117.998C78.2003 123.798 78.1003 122.898 77.8003 128.398C77.0003 143.898 77.8003 147.798 74.5003 151.598C71.2003 155.398 69.1003 155.698 67.8003 154.898C66.5003 154.098 68.4003 150.298 69.2003 144.798C71.1003 131.298 66.6003 117.698 66.2003 116.598C65.3003 113.798 64.2003 111.098 64.3003 107.198C64.4003 103.298 64.7003 99.4984 68.4003 97.4984C72.1003 95.4984 75.6003 96.8984 79.0003 99.7984Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M172.9 103.399C172.9 113.699 173.4 123.299 174.1 132.099C174.4 136.499 175.3 146.699 180.9 155.199C181.5 156.099 183.3 158.799 184.1 158.499C184.9 158.199 183.4 153.699 182.7 148.499C180.8 134.999 185.2 121.399 185.6 120.199C186 118.999 187.7 114.799 187.5 110.799C187.4 108.399 187.2 103.199 183.5 101.199C179.8 99.1993 176.2 100.499 172.9 103.399Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M182.2 122.299C171.5 163.299 157.3 191.799 126.5 191.799C95.7001 191.799 78.8001 158.199 70.8001 122.299C62.5001 84.7992 95.8 52.6992 126.5 52.6992C157.2 52.6992 191.9 85.0992 182.2 122.299Z\" fill=\"%239C6439\"/%3E%3Cpath d=\"M167.4 108.5C164.857 106.791 162.182 105.286 159.4 104C156.592 102.922 153.608 102.379 150.6 102.4C147.619 102.412 144.667 102.988 141.9 104.1C139.124 105.266 136.583 106.926 134.4 109C134.2 109.17 133.942 109.255 133.68 109.236C133.418 109.218 133.174 109.097 133 108.9C132.912 108.816 132.843 108.715 132.795 108.603C132.747 108.491 132.723 108.371 132.723 108.25C132.723 108.128 132.747 108.008 132.795 107.896C132.843 107.785 132.912 107.684 133 107.6C135.247 105.196 137.972 103.288 141 102C144.054 100.776 147.31 100.131 150.6 100.1C153.898 100.156 157.155 100.835 160.2 102.1C163.259 103.279 165.878 105.374 167.7 108.1C167.726 108.106 167.751 108.118 167.773 108.134C167.795 108.15 167.813 108.17 167.827 108.194C167.841 108.217 167.85 108.242 167.854 108.269C167.858 108.296 167.857 108.323 167.85 108.35C167.844 108.376 167.832 108.401 167.816 108.422C167.8 108.444 167.779 108.462 167.756 108.476C167.733 108.49 167.707 108.5 167.681 108.504C167.654 108.508 167.626 108.506 167.6 108.5H167.4Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M100.2 116.499C101.912 116.499 103.3 115.111 103.3 113.399C103.3 111.687 101.912 110.299 100.2 110.299C98.488 110.299 97.1001 111.687 97.1001 113.399C97.1001 115.111 98.488 116.499 100.2 116.499Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M86.6 113.1C86.9801 113.32 87.4112 113.435 87.85 113.435C88.2889 113.435 88.72 113.32 89.1 113.1L89.6 112.8V112.6L89.9 112.4C90.3415 111.972 90.809 111.571 91.3 111.2C93.1174 109.73 95.2904 108.764 97.6 108.4C99.9377 107.966 102.348 108.138 104.6 108.9C106.845 109.621 108.874 110.893 110.5 112.6C110.649 112.809 110.721 113.063 110.702 113.318C110.684 113.574 110.577 113.815 110.4 114C110.323 114.095 110.228 114.173 110.12 114.229C110.011 114.286 109.893 114.32 109.771 114.329C109.65 114.338 109.528 114.323 109.412 114.284C109.297 114.244 109.191 114.182 109.1 114.1C107.581 112.791 105.812 111.805 103.9 111.2C101.99 110.619 99.9715 110.482 98 110.8C96.0169 111.082 94.1306 111.837 92.5 113L91.4 113.9L91 114.2L90.6 114.5L89.6 115C88.9445 115.202 88.2396 115.174 87.6027 114.919C86.9658 114.664 86.4355 114.199 86.1 113.6C86.0851 113.459 86.1205 113.318 86.2 113.2L86.6 113.1Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M149.9 116.499C151.612 116.499 153 115.111 153 113.399C153 111.687 151.612 110.299 149.9 110.299C148.188 110.299 146.8 111.687 146.8 113.399C146.8 115.111 148.188 116.499 149.9 116.499Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M163.9 114C163.565 114.598 163.034 115.064 162.398 115.318C161.761 115.573 161.056 115.602 160.4 115.4C160.039 115.295 159.7 115.126 159.4 114.9L158.9 114.6L158.6 114.4C158.283 114.016 157.913 113.679 157.5 113.4C155.846 112.28 153.97 111.53 152 111.2C150.029 110.882 148.011 111.019 146.1 111.6C144.188 112.204 142.419 113.191 140.9 114.5C140.692 114.649 140.438 114.721 140.182 114.702C139.927 114.684 139.685 114.577 139.5 114.4C139.354 114.196 139.275 113.951 139.275 113.7C139.275 113.449 139.354 113.204 139.5 113C141.127 111.293 143.155 110.021 145.4 109.3C147.651 108.533 150.063 108.361 152.4 108.8C154.696 109.209 156.858 110.17 158.7 111.6L160 112.9L160.3 113.2H160.5L161 113.5C161.378 113.717 161.803 113.84 162.238 113.857C162.673 113.874 163.106 113.786 163.5 113.6L163.9 113.8V114Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M81.7002 108.1C83.5578 105.367 86.2112 103.272 89.3002 102.1C92.3103 100.833 95.535 100.154 98.8002 100.1C102.091 100.122 105.349 100.767 108.4 102C111.428 103.288 114.153 105.196 116.4 107.6C116.583 107.787 116.686 108.038 116.686 108.3C116.686 108.561 116.583 108.813 116.4 109C116.219 109.155 115.989 109.24 115.75 109.24C115.512 109.24 115.281 109.155 115.1 109H115C112.833 106.906 110.288 105.243 107.5 104.1C101.921 101.871 95.7049 101.836 90.1002 104C87.3188 105.286 84.6438 106.791 82.1002 108.5H81.7002V108.1Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M142.2 158.999C137.003 161.752 131.177 163.096 125.3 162.899C114.6 162.499 103.9 156.699 103.9 156.699L109.7 153.999C112.6 152.599 116.1 152.899 119.4 154.899L120.5 155.499C121.787 156.251 123.247 156.656 124.737 156.673C126.227 156.691 127.696 156.321 129 155.599C130.269 154.897 131.708 154.563 133.157 154.633C134.605 154.704 136.005 155.177 137.2 155.999L142.2 158.999Z\" fill=\"%23FF7143\"/%3E%3Cpath d=\"M96.7002 156.999C96.3803 156.327 96.2144 155.592 96.2144 154.849C96.2144 154.105 96.3803 153.37 96.7002 152.699C97.253 151.368 98.2891 150.296 99.6002 149.699C99.708 149.658 99.8265 149.655 99.9359 149.692C100.045 149.728 100.139 149.801 100.2 149.899C100.215 150.04 100.18 150.181 100.1 150.299C99.4791 151.304 98.9758 152.378 98.6002 153.499C98.2165 154.567 97.9483 155.673 97.8002 156.799C97.8076 156.885 97.7923 156.972 97.756 157.051C97.7196 157.13 97.6633 157.198 97.5926 157.248C97.522 157.298 97.4395 157.33 97.3531 157.339C97.2668 157.347 97.1796 157.334 97.1002 157.299C96.9002 157.299 96.7002 157.199 96.7002 156.999Z\" fill=\"%237A4F2C\"/%3E%3Cpath d=\"M142.2 158.999C142.2 158.999 138.6 170.999 126.2 170.999C112 170.999 103.9 156.699 103.9 156.699C109.3 159.499 117 162.599 125.3 162.899C131.183 163.164 137.027 161.816 142.2 158.999Z\" fill=\"%23FF8A63\"/%3E%3Cpath d=\"M102.5 155.899C105.666 157.592 109.023 158.902 112.5 159.799C114.245 160.261 116.015 160.628 117.8 160.899C119.589 161.164 121.392 161.331 123.2 161.399C126.801 161.649 130.418 161.549 134 161.099C137.589 160.664 141.135 159.928 144.6 158.899C144.693 158.864 144.796 158.865 144.889 158.902C144.981 158.939 145.056 159.009 145.1 159.099C145.093 159.284 145.022 159.46 144.9 159.599C141.505 161.193 137.903 162.303 134.2 162.899C130.534 163.516 126.806 163.684 123.1 163.399C119.364 163.197 115.668 162.525 112.1 161.399C108.527 160.262 105.153 158.575 102.1 156.399C102 156.299 101.9 156.099 102 155.999C102.1 155.899 102.3 155.799 102.5 155.899Z\" fill=\"%237A4F2C\"/%3E%3Cpath d=\"M78.5002 90.1989C80.4002 92.8989 78.3002 95.9989 75.9002 105.499C74.5169 110.438 73.5798 115.492 73.1002 120.599C72.3002 131.899 75.6002 138.599 74.6002 138.999C73.6002 139.399 65.5002 127.599 63.8002 112.399C63.5002 109.999 61.4002 90.8989 69.1002 87.5989C70.7409 86.9848 72.5339 86.9056 74.2224 87.3726C75.9109 87.8397 77.4083 88.829 78.5002 90.1989Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M174.5 88.7988C172.6 91.4988 174.7 94.5988 177.1 104.099C178.441 109.043 179.344 114.096 179.8 119.199C180.7 130.499 177.4 137.199 178.4 137.599C179.4 137.999 187.5 126.199 189.2 110.999C189.5 108.599 191.6 89.4988 183.8 86.0988C182.161 85.534 180.387 85.4903 178.722 85.9737C177.057 86.4571 175.582 87.444 174.5 88.7988Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M181 95.1992C181 85.7992 183.5 69.1992 178.3 61.6992C173.1 54.1992 159.5 56.0992 151 51.9992C142.5 47.8992 136.3 36.1992 126.7 36.1992C117.1 36.1992 110.3 48.2992 102.4 51.9992C94.5001 55.6992 80.2001 54.3992 75.1001 61.6992C70.0001 68.9992 72.4001 85.7992 72.4001 95.1992C80.1508 96.9215 88.0607 97.8264 96.0001 97.8992C113.098 97.9232 129.994 94.2028 145.5 86.9992C150.212 91.3042 155.955 94.3208 162.174 95.7573C168.393 97.1937 174.877 97.0015 181 95.1992Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M117.7 140.199C118.871 139.405 120.301 139.083 121.7 139.299C122.08 139.339 122.452 139.44 122.8 139.599L123.5 139.899C123.92 140.031 124.365 140.065 124.8 139.999L126.3 139.399L128.3 138.899C129.645 138.854 130.982 139.128 132.2 139.699C132.339 139.798 132.444 139.938 132.498 140.1C132.552 140.262 132.552 140.437 132.5 140.599C132.434 140.749 132.318 140.871 132.172 140.944C132.026 141.017 131.859 141.037 131.7 140.999C130.67 140.656 129.575 140.554 128.5 140.699L127 141.199C126.441 141.527 125.833 141.763 125.2 141.899C124.438 142.066 123.645 142.032 122.9 141.799L122 141.399L121.3 141.099C120.292 140.907 119.25 141.011 118.3 141.399C118.128 141.431 117.951 141.397 117.803 141.304C117.655 141.212 117.547 141.068 117.5 140.899C117.452 140.777 117.445 140.642 117.482 140.516C117.518 140.389 117.594 140.278 117.7 140.199Z\" fill=\"%237A4F2C\"/%3E%3Cpath d=\"M120.3 112.4C121.562 116.029 122.139 119.861 122 123.7C121.915 125.616 121.681 127.521 121.3 129.4C120.885 131.277 120.317 133.117 119.6 134.9C119.489 135.056 119.336 135.176 119.159 135.247C118.981 135.317 118.788 135.336 118.6 135.3C118.453 135.206 118.337 135.07 118.266 134.91C118.195 134.75 118.172 134.573 118.2 134.4C118.7 132.6 119.1 130.8 119.5 129C119.824 127.218 119.991 125.412 120 123.6C120.083 121.798 120.017 119.992 119.8 118.2C119.606 116.417 119.305 114.648 118.9 112.9C118.87 112.809 118.859 112.711 118.868 112.615C118.877 112.519 118.906 112.425 118.953 112.341C119 112.256 119.064 112.182 119.141 112.124C119.218 112.065 119.306 112.023 119.4 112C119.573 111.957 119.756 111.973 119.919 112.046C120.082 112.118 120.216 112.243 120.3 112.4Z\" fill=\"%237A4F2C\"/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"128.91\" y1=\"229.079\" x2=\"128.91\" y2=\"171.779\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%239C6439\"/%3E%3Cstop offset=\"1\" stop-color=\"%23875731\"/%3E%3C/linearGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Eliot.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::25e73762f2a2a02cfa4b5550e534865c>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"257\" viewBox=\"0 0 256 257\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256.9C198.692 256.9 256 199.593 256 128.9C256 58.2079 198.692 0.900391 128 0.900391C57.3075 0.900391 0 58.2079 0 128.9C0 199.593 57.3075 256.9 128 256.9Z\" fill=\"%23FF5630\"/%3E%3Cpath d=\"M219.3 218.602C208.9 212.802 178.2 195.802 177.4 195.702L130.3 193.602L83.0998 195.702C82.2998 195.802 43.2998 217.402 38.2998 220.202C62.5152 243.989 95.1878 257.184 129.131 256.884C163.075 256.584 195.509 242.814 219.3 218.602Z\" fill=\"%23DE350B\"/%3E%3Cpath d=\"M165.2 161.9C165 165.9 164.8 185.7 166.8 193.7C167.6 196.9 171.3 198.1 174.4 200.1C174.712 200.967 174.881 201.879 174.9 202.8C174.9 208.7 155 220.8 130.7 221.4C104.2 222.1 82.0999 208.9 81.8999 202.8C81.9191 201.879 82.088 200.967 82.3999 200.1C85.4999 198.1 89.2999 196.9 90.0999 193.7C91.9999 185.7 91.7999 165.9 91.6999 161.9H165.2Z\" fill=\"%23DDB28D\"/%3E%3Cpath d=\"M194.3 113.601C194.5 119.901 183.9 133.401 177.6 133.601C171.3 133.801 171.6 120.701 171.3 114.401C171.194 111.351 172.304 108.384 174.385 106.152C176.467 103.921 179.35 102.607 182.4 102.501C185.45 102.395 188.417 103.505 190.649 105.587C192.88 107.668 194.194 110.551 194.3 113.601Z\" fill=\"%23ECC19C\"/%3E%3Cpath d=\"M64.0998 113.601C63.7998 119.901 74.3998 133.401 80.6998 133.601C86.9998 133.801 86.7998 120.701 86.9998 114.401C87.1929 112.819 87.0549 111.214 86.5947 109.688C86.1345 108.161 85.3621 106.748 84.3265 105.536C83.2908 104.324 82.0146 103.341 80.5788 102.649C79.143 101.957 77.579 101.57 75.986 101.515C74.393 101.459 72.8058 101.735 71.3252 102.326C69.8446 102.916 68.5029 103.808 67.3852 104.944C66.2676 106.081 65.3983 107.437 64.8328 108.927C64.2672 110.418 64.0176 112.009 64.0998 113.601Z\" fill=\"%23ECC19C\"/%3E%3Cpath d=\"M128.9 100.601C152.758 100.601 172.1 81.2599 172.1 57.4012C172.1 33.5425 152.758 14.2012 128.9 14.2012C105.041 14.2012 85.6997 33.5425 85.6997 57.4012C85.6997 81.2599 105.041 100.601 128.9 100.601Z\" fill=\"%23FF8F73\"/%3E%3Cpath d=\"M178.2 137.9C180 129.3 182.1 118.9 185 106.2C193.6 68.0002 187.4 25.2002 129.4 27.0002C71.2997 25.2002 65.0997 68.0002 73.6997 106.2C76.3997 118 78.3997 127.8 80.0997 136\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M128.2 186.2C164.2 186.9 177.5 143.5 177.9 137.6C178.1 133.9 178.1 129.5 178.1 129.5C178.1 125.3 177.9 122.2 177.9 121.3C177.1 107.2 185.9 95.9003 181.3 87.8003C179.791 85.2205 178.519 82.5094 177.5 79.7003C176.935 78.2758 176.499 76.8032 176.2 75.3003C175.729 73.3974 175.427 71.4564 175.3 69.5003C168.528 68.6951 161.692 68.5946 154.9 69.2003C128.5 71.8003 116.5 85.0003 99.8997 80.0003C96.2997 79.0003 90.7997 76.5003 84.9997 70.1003C83.205 72.1941 81.6922 74.5138 80.4997 77.0003C78.8728 80.4028 77.8251 84.0529 77.3997 87.8003C76.5624 94.5122 76.9349 101.32 78.4997 107.9C78.4997 108.2 78.5997 108.3 78.5997 108.6C81.4997 120.2 80.3997 135.6 80.3997 135.6C80.3997 147.5 94.6997 185.6 128.2 186.2Z\" fill=\"%23ECC19C\"/%3E%3Cpath d=\"M145.8 153.802C140.5 152.602 137.1 151.002 133.1 151.902L132.3 152.102C130.172 152.9 127.827 152.9 125.7 152.102L124.9 151.902C121.1 151.102 117.7 152.402 112.4 153.702L107.3 154.802C107.7 155.402 115.4 165.702 129 165.602C142.6 165.502 150.3 155.402 150.7 154.802C149.048 154.569 147.411 154.235 145.8 153.802Z\" fill=\"%23B5917C\"/%3E%3Cpath d=\"M105.2 152.901C108.963 154.555 112.882 155.828 116.9 156.701C124.888 158.367 133.14 158.299 141.1 156.501C143.105 156.12 145.077 155.586 147 154.901C148.971 154.272 150.907 153.537 152.8 152.701C152.865 152.668 152.936 152.651 153.008 152.649C153.08 152.647 153.152 152.66 153.219 152.689C153.286 152.717 153.345 152.76 153.394 152.814C153.442 152.868 153.478 152.931 153.5 153.001C153.558 153.05 153.601 153.116 153.623 153.189C153.645 153.263 153.646 153.341 153.625 153.415C153.604 153.489 153.562 153.555 153.504 153.606C153.447 153.656 153.376 153.689 153.3 153.701C149.649 155.851 145.709 157.467 141.6 158.501C137.479 159.536 133.249 160.073 129 160.101C126.893 160.117 124.787 159.983 122.7 159.701C120.577 159.48 118.472 159.112 116.4 158.601C112.333 157.531 108.406 155.987 104.7 154.001C104.624 153.972 104.555 153.926 104.501 153.865C104.447 153.805 104.409 153.732 104.389 153.653C104.369 153.575 104.369 153.492 104.388 153.413C104.408 153.334 104.446 153.261 104.5 153.201C104.521 153.131 104.557 153.068 104.606 153.014C104.654 152.96 104.714 152.917 104.78 152.889C104.847 152.86 104.919 152.847 104.991 152.849C105.064 152.851 105.135 152.868 105.2 152.901Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M124.4 104.5C125.953 107.736 126.642 111.319 126.4 114.9C126.337 116.692 126.069 118.47 125.6 120.2C125.132 121.893 124.496 123.535 123.7 125.1C123.577 125.295 123.39 125.441 123.171 125.514C122.952 125.587 122.715 125.582 122.5 125.5C122.336 125.373 122.212 125.202 122.141 125.008C122.071 124.813 122.056 124.602 122.1 124.4C123.293 121.328 124.002 118.09 124.2 114.8C124.281 113.164 124.214 111.524 124 109.9C123.776 108.271 123.408 106.664 122.9 105.1C122.87 104.995 122.862 104.885 122.877 104.776C122.891 104.668 122.927 104.564 122.984 104.47C123.04 104.377 123.115 104.295 123.203 104.232C123.292 104.168 123.393 104.123 123.5 104.1C123.673 104.057 123.856 104.073 124.019 104.145C124.182 104.218 124.316 104.343 124.4 104.5Z\" fill=\"%23CEA28B\"/%3E%3Cpath d=\"M115.9 100.2L114.6 99.5L113.2 98.8L110.2 97.7C108.155 97.0511 106.04 96.6483 103.9 96.5C101.73 96.3007 99.5426 96.4016 97.4001 96.8C95.234 97.2372 93.1217 97.9078 91.1 98.8C90.8609 98.902 90.5914 98.9069 90.3487 98.8135C90.106 98.7202 89.9092 98.536 89.8001 98.3C89.7082 98.0953 89.6878 97.8657 89.7423 97.6481C89.7967 97.4304 89.9227 97.2374 90.1 97.1C92.0476 95.5656 94.247 94.3813 96.6 93.6C99.035 92.8785 101.56 92.5081 104.1 92.5C106.614 92.5082 109.112 92.9132 111.5 93.7C112.708 94.0965 113.88 94.5984 115 95.2L116.6 96.2L118.2 97.5C118.524 97.8355 118.705 98.2837 118.705 98.75C118.705 99.2163 118.524 99.6645 118.2 100C117.936 100.281 117.584 100.463 117.203 100.518C116.821 100.572 116.432 100.495 116.1 100.3L115.9 100.2Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M141.2 97.5009L142.9 96.2009C143.43 95.8095 144 95.4744 144.6 95.2009C145.743 94.548 146.949 94.012 148.2 93.6009C150.669 92.8793 153.228 92.509 155.8 92.5009C158.391 92.4771 160.965 92.9174 163.4 93.8009C165.811 94.6119 168.05 95.8668 170 97.5009C170.197 97.6744 170.318 97.9185 170.337 98.1804C170.356 98.4424 170.27 98.7012 170.1 98.9009C169.963 99.0783 169.77 99.2043 169.552 99.2587C169.334 99.3131 169.105 99.2928 168.9 99.2009C166.865 98.1833 164.717 97.4112 162.5 96.9009C160.328 96.4687 158.108 96.3342 155.9 96.5009C153.698 96.6149 151.517 96.9841 149.4 97.6009C148.329 97.8962 147.291 98.2982 146.3 98.8009L144.9 99.5009L143.6 100.201H143.3C142.899 100.427 142.427 100.49 141.981 100.379C141.534 100.267 141.148 99.9887 140.9 99.6009C140.748 99.258 140.696 98.8792 140.749 98.5079C140.802 98.1365 140.958 97.7876 141.2 97.5009Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M91.6 106.201C94.6497 104.042 98.2656 102.825 102 102.701C105.788 102.594 109.52 103.64 112.7 105.701C112.799 105.76 112.884 105.841 112.949 105.937C113.014 106.032 113.058 106.141 113.077 106.255C113.096 106.369 113.09 106.486 113.059 106.597C113.029 106.709 112.974 106.812 112.9 106.901C112.849 107.008 112.776 107.102 112.684 107.177C112.593 107.252 112.486 107.306 112.371 107.335C112.256 107.363 112.136 107.366 112.02 107.343C111.904 107.32 111.795 107.271 111.7 107.201C110.196 106.423 108.622 105.787 107 105.301C105.358 104.914 103.685 104.68 102 104.601C100.311 104.63 98.6321 104.865 97 105.301C95.3394 105.769 93.731 106.406 92.2 107.201C92.1392 107.255 92.0662 107.293 91.9874 107.312C91.9085 107.331 91.8261 107.331 91.7473 107.312C91.6686 107.292 91.5958 107.253 91.5353 107.199C91.4748 107.145 91.4283 107.077 91.4 107.001C91.3462 106.94 91.308 106.867 91.2887 106.788C91.2694 106.709 91.2697 106.627 91.2893 106.548C91.309 106.469 91.3476 106.397 91.4017 106.336C91.4559 106.276 91.5239 106.229 91.6 106.201Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M166.8 107.201C165.269 106.405 163.661 105.769 162 105.301C160.368 104.865 158.689 104.63 157 104.601C153.602 104.658 150.271 105.551 147.3 107.201C147.203 107.296 147.085 107.369 146.956 107.412C146.827 107.456 146.69 107.47 146.555 107.453C146.42 107.435 146.29 107.388 146.176 107.313C146.062 107.239 145.966 107.14 145.896 107.023C145.826 106.906 145.784 106.775 145.772 106.639C145.76 106.503 145.779 106.367 145.827 106.239C145.876 106.112 145.952 105.997 146.052 105.904C146.151 105.811 146.27 105.741 146.4 105.701C149.539 103.63 153.242 102.581 157 102.701C160.766 102.823 164.414 104.039 167.5 106.201C167.621 106.314 167.697 106.467 167.715 106.632C167.733 106.797 167.693 106.963 167.6 107.101C167.503 107.214 167.367 107.286 167.219 107.305C167.071 107.323 166.922 107.286 166.8 107.201Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M155.9 109.9C157.668 109.9 159.1 108.467 159.1 106.7C159.1 104.933 157.668 103.5 155.9 103.5C154.133 103.5 152.7 104.933 152.7 106.7C152.7 108.467 154.133 109.9 155.9 109.9Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M102.6 109.9C104.367 109.9 105.8 108.467 105.8 106.7C105.8 104.933 104.367 103.5 102.6 103.5C100.833 103.5 99.3999 104.933 99.3999 106.7C99.3999 108.467 100.833 109.9 102.6 109.9Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M118 137.601C119.74 136.551 121.787 136.127 123.8 136.401L125.3 136.901L126.4 137.301C127.077 137.52 127.794 137.588 128.5 137.501L130.8 136.601C131.693 136.228 132.637 135.992 133.6 135.901C135.564 135.751 137.533 136.131 139.3 137.001C139.389 137.043 139.469 137.103 139.533 137.178C139.598 137.252 139.646 137.34 139.674 137.434C139.702 137.528 139.71 137.628 139.698 137.726C139.685 137.823 139.652 137.917 139.6 138.001C139.516 138.159 139.382 138.284 139.219 138.356C139.056 138.429 138.873 138.444 138.7 138.401C137.166 137.841 135.517 137.669 133.9 137.901C133.108 138.042 132.336 138.277 131.6 138.601C130.73 139.038 129.828 139.406 128.9 139.701C127.832 139.883 126.737 139.815 125.7 139.501L124.4 138.901L123.4 138.501C121.825 138.237 120.208 138.375 118.7 138.901C118.61 138.95 118.51 138.979 118.407 138.985C118.304 138.991 118.202 138.974 118.106 138.936C118.011 138.898 117.925 138.839 117.855 138.764C117.785 138.689 117.732 138.599 117.7 138.501C117.661 138.338 117.669 138.168 117.722 138.008C117.775 137.849 117.871 137.708 118 137.601Z\" fill=\"%23CEA28B\"/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"129.36\" y1=\"136.3\" x2=\"129.36\" y2=\"27.5902\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23253858\"/%3E%3Cstop offset=\"1\" stop-color=\"%2342526E\"/%3E%3C/linearGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Fabian.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::0dbadfcf59a4f04471f16898f43c816f>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"257\" viewBox=\"0 0 256 257\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 0.900405C100.869 0.887575 74.4365 9.49562 52.5162 25.4821C30.596 41.4686 14.3222 64.0067 6.0438 89.8434C-2.23462 115.68 -2.08951 143.479 6.45818 169.228C15.0059 194.977 31.514 217.344 53.6 233.1L54.7 232.2L90.2 208.8C90.8359 208.407 91.555 208.167 92.3 208.1L131.3 206.1L170.3 208.1C171.045 208.167 171.764 208.407 172.4 208.8L205.6 230.7C226.899 214.466 242.569 191.96 250.405 166.351C258.241 140.743 257.847 113.322 249.279 87.9486C240.711 62.5757 224.4 40.5292 202.644 24.9134C180.887 9.29756 154.781 0.899057 128 0.900405Z\" fill=\"%236554C0\"/%3E%3Cpath d=\"M191.5 213.8C198.546 212.04 204.637 207.621 208.496 201.469C212.356 195.316 213.683 187.909 212.2 180.8C205.4 147.3 201.1 120.4 198.4 100.7C195.7 80.9996 193.4 62.7996 180.1 47.3996C169.7 35.2996 152.1 24.5996 131.3 24.7996C110.5 24.9996 92.9001 35.2996 82.5001 47.3996C69.2001 62.7996 67.2001 79.4996 64.2001 100.7C61.2001 121.9 57.2001 147.3 50.4001 180.8C48.9173 187.909 50.2447 195.316 54.1038 201.469C57.9629 207.621 64.0541 212.04 71.1001 213.8C84.6001 217.1 104.1 220 131.3 220C158.5 220 178 217.1 191.5 213.8Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M170.3 208.1L131.3 206.1L92.3001 208.1C91.5551 208.166 90.836 208.406 90.2001 208.8L54.7001 232.2L53.6001 233.1C75.8723 248.981 102.643 257.316 129.995 256.884C157.346 256.452 183.84 247.276 205.6 230.7L172.4 208.8C171.764 208.406 171.045 208.166 170.3 208.1Z\" fill=\"%23998DD9\"/%3E%3Cpath d=\"M168 209.801C167.1 211.001 152.2 230.901 127.5 228.901C107.6 227.401 96.3001 212.701 94.6001 210.401C99.6097 206.704 103.152 201.356 104.6 195.301C107.5 182.601 99.5001 172.901 98.6001 171.801H161C160.5 172.401 151.4 185.101 157.2 198.201C159.471 203.12 163.255 207.185 168 209.801Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M196.7 117C196.9 123.4 186.3 136.8 180 137C173.7 137.2 173.9 124.2 173.7 117.8C173.594 114.75 174.704 111.782 176.785 109.551C178.867 107.319 181.75 106.006 184.8 105.9C187.85 105.793 190.817 106.903 193.049 108.985C195.28 111.067 196.594 113.95 196.7 117Z\" fill=\"%239B7663\"/%3E%3Cpath d=\"M66.3998 117C66.1998 123.4 76.7998 136.8 83.0998 137C89.3998 137.2 89.1998 124.2 89.3998 117.8C89.5058 114.75 88.396 111.782 86.3143 109.551C84.2327 107.319 81.3498 106.006 78.2998 105.9C75.2498 105.793 72.2826 106.903 70.0509 108.985C67.8192 111.067 66.5058 113.95 66.3998 117Z\" fill=\"%239B7663\"/%3E%3Cpath d=\"M83.8999 97.6988C83.8999 103.999 83.6999 110.099 83.3999 115.899C83.0999 121.699 83.0999 120.799 82.7999 126.299C81.9999 141.699 82.7999 145.699 79.4999 149.499C76.1999 153.299 73.9999 153.599 72.6999 152.699C71.3999 151.799 73.3999 148.199 74.0999 142.699C76.0999 129.199 71.5999 115.599 71.1999 114.499C70.2999 111.699 69.0999 108.999 69.2999 105.099C69.4999 101.199 69.6999 97.3988 73.3999 95.3988C77.0999 93.3988 80.5999 94.7988 83.8999 97.6988Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M177.9 101.3C177.9 111.6 178.3 121.1 179 129.9C179.4 134.4 180.2 144.6 185.9 153.1C186.5 154 188.3 156.7 189.1 156.4C189.9 156.1 188.4 151.6 187.7 146.4C185.7 132.9 190.2 119.3 190.6 118.1C191 116.9 192.7 112.7 192.5 108.7C192.4 106.3 192.2 101 188.4 99.0004C184.6 97.0004 181.2 98.4004 177.9 101.3Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M187.2 120.2C176.5 161.2 162.2 189.7 131.5 189.7C100.8 189.7 83.7997 156.1 75.7997 120.2C67.3997 82.6996 100.7 50.5996 131.5 50.5996C162.3 50.5996 196.9 82.9996 187.2 120.2Z\" fill=\"%239B7663\"/%3E%3Cpath d=\"M172.3 106.4C169.79 104.692 167.149 103.187 164.4 101.9C161.592 100.822 158.607 100.28 155.6 100.3C152.617 100.302 149.663 100.879 146.9 102C144.124 103.166 141.583 104.827 139.4 106.9C139.191 107.049 138.937 107.121 138.682 107.102C138.426 107.084 138.185 106.977 138 106.8C137.912 106.716 137.842 106.615 137.794 106.503C137.747 106.392 137.722 106.271 137.722 106.15C137.722 106.029 137.747 105.908 137.794 105.797C137.842 105.685 137.912 105.584 138 105.5C140.247 103.096 142.972 101.189 146 99.9C149.051 98.667 152.309 98.0224 155.6 98C158.87 98.0069 162.104 98.6877 165.1 100C168.189 101.173 170.842 103.268 172.7 106C172.8 106.1 172.7 106.3 172.6 106.4H172.3Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M105.1 114.3C106.812 114.3 108.2 112.912 108.2 111.2C108.2 109.488 106.812 108.1 105.1 108.1C103.387 108.1 102 109.488 102 111.2C102 112.912 103.387 114.3 105.1 114.3Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M154.899 114.3C156.611 114.3 157.999 112.912 157.999 111.2C157.999 109.488 156.611 108.1 154.899 108.1C153.187 108.1 151.799 109.488 151.799 111.2C151.799 112.912 153.187 114.3 154.899 114.3Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M91.5996 111.001C91.9855 111.202 92.4143 111.308 92.8496 111.308C93.2849 111.308 93.7138 111.202 94.0996 111.001L94.4996 110.701C94.5527 110.701 94.6035 110.68 94.641 110.642C94.6786 110.605 94.6996 110.554 94.6996 110.501L94.9996 110.301C95.3834 109.85 95.8199 109.447 96.2996 109.101C98.1643 107.645 100.365 106.682 102.7 106.301C105.037 105.866 107.447 106.038 109.7 106.801C111.914 107.525 113.91 108.798 115.5 110.501C115.644 110.693 115.714 110.932 115.697 111.172C115.68 111.412 115.577 111.638 115.407 111.808C115.237 111.978 115.011 112.081 114.771 112.098C114.53 112.115 114.292 112.045 114.1 111.901C112.617 110.594 110.881 109.607 109 109.001C107.098 108.373 105.069 108.236 103.1 108.601C101.101 108.822 99.1998 109.583 97.5996 110.801L96.3996 111.701L96.0996 112.001L95.6996 112.301L94.6996 112.801C94.0451 113.023 93.3328 113.004 92.6911 112.747C92.0494 112.49 91.5205 112.013 91.1996 111.401C91.0996 111.301 91.1996 111.101 91.2996 111.001H91.5996Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M168.8 111.899C168.479 112.511 167.95 112.989 167.308 113.245C166.667 113.502 165.954 113.521 165.3 113.299L164.3 112.799L163.9 112.499L163.6 112.199L162.4 111.299C160.783 110.178 158.939 109.427 157 109.099C155.028 108.781 153.01 108.918 151.1 109.499C149.188 110.103 147.419 111.09 145.9 112.399C145.691 112.548 145.437 112.62 145.182 112.601C144.926 112.583 144.685 112.476 144.5 112.299C144.316 112.112 144.214 111.861 144.214 111.599C144.214 111.337 144.316 111.086 144.5 110.899C146.129 109.208 148.147 107.942 150.378 107.21C152.609 106.478 154.985 106.302 157.3 106.699C159.644 107.045 161.854 108.012 163.7 109.499C164.179 109.846 164.616 110.248 165 110.699L165.3 110.899C165.4 110.999 165.4 111.099 165.5 111.099C165.6 111.099 165.8 111.299 166 111.399C166.38 111.618 166.811 111.734 167.25 111.734C167.689 111.734 168.12 111.618 168.5 111.399C168.6 111.399 168.8 111.399 168.8 111.599C168.8 111.799 168.9 111.899 168.8 111.899Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M86.6995 106C88.5212 103.275 91.1408 101.179 94.1995 100C97.2303 98.6879 100.497 98.0074 103.8 98C107.091 98.0224 110.348 98.667 113.4 99.9C116.427 101.189 119.152 103.096 121.4 105.5C121.583 105.687 121.685 105.938 121.685 106.2C121.685 106.462 121.583 106.713 121.4 106.9C121.196 107.047 120.951 107.125 120.7 107.125C120.448 107.125 120.204 107.047 120 106.9C117.816 104.827 115.275 103.166 112.5 102C109.736 100.879 106.782 100.302 103.8 100.3C100.792 100.28 97.8073 100.822 94.9995 101.9C92.2294 103.208 89.5559 104.712 86.9995 106.4H86.6995C86.6465 106.4 86.5956 106.379 86.5581 106.341C86.5206 106.304 86.4995 106.253 86.4995 106.2C86.4995 106.147 86.5206 106.096 86.5581 106.059C86.5956 106.021 86.6465 106 86.6995 106Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M147.1 156.9C141.91 159.67 136.079 161.015 130.2 160.8C119.6 160.4 108.9 154.6 108.9 154.6L114.6 151.9C116.177 151.211 117.902 150.932 119.616 151.09C121.329 151.247 122.975 151.835 124.4 152.8L125.5 153.4C126.768 154.152 128.212 154.558 129.687 154.575C131.161 154.593 132.614 154.222 133.9 153.5C135.169 152.797 136.608 152.463 138.057 152.534C139.505 152.604 140.905 153.077 142.1 153.9L147.1 156.9Z\" fill=\"%2372594B\"/%3E%3Cpath d=\"M101.6 154.9C101.086 153.529 101.11 152.015 101.667 150.661C102.223 149.307 103.271 148.213 104.6 147.6C104.693 147.565 104.796 147.566 104.889 147.603C104.981 147.64 105.056 147.71 105.1 147.8C105.149 147.855 105.176 147.926 105.176 148C105.176 148.073 105.149 148.145 105.1 148.2C104.508 149.202 103.974 150.237 103.5 151.3C103.161 152.409 102.927 153.547 102.8 154.7C102.7 155 102.4 155.3 102.1 155.2C101.905 155.158 101.729 155.052 101.6 154.9Z\" fill=\"%2372594B\"/%3E%3Cpath d=\"M147.1 156.9C147.1 156.9 143.6 168.9 131.2 168.9C117 168.9 108.9 154.6 108.9 154.6C114.2 157.4 122 160.5 130.2 160.8C136.083 161.065 141.927 159.716 147.1 156.9Z\" fill=\"%23B19177\"/%3E%3Cpath d=\"M107.4 153.5C110.604 155.162 113.995 156.438 117.5 157.3L122.8 158.3L128.2 158.8C131.81 158.9 135.423 158.699 139 158.2C142.601 157.735 146.15 156.932 149.6 155.8C149.8 155.8 150 155.9 150 156.1C150 156.3 150 156.4 149.8 156.5C146.482 158.157 142.947 159.335 139.3 160C135.608 160.681 131.848 160.916 128.1 160.7C124.37 160.515 120.676 159.877 117.1 158.8C113.496 157.757 110.085 156.136 107 154C106.951 153.945 106.923 153.874 106.923 153.8C106.923 153.727 106.951 153.655 107 153.6C107.1 153.5 107.2 153.4 107.4 153.5Z\" fill=\"%23543E36\"/%3E%3Cpath d=\"M83.4997 87.9992C85.3997 90.7992 83.2997 93.8992 80.7997 103.399C79.5086 108.355 78.6058 113.403 78.0997 118.499C77.2997 129.799 80.5997 136.499 79.5997 136.899C78.5997 137.299 70.3997 125.499 68.6997 110.299C68.4997 107.899 66.3997 88.7992 74.0997 85.3992C75.747 84.8439 77.5229 84.7948 79.1983 85.2582C80.8738 85.7216 82.372 86.6763 83.4997 87.9992Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M179.5 86.6004C177.6 89.4004 179.7 92.5004 182.1 102C183.44 106.945 184.344 111.998 184.8 117.1C185.6 128.4 182.3 135.1 183.4 135.5C184.5 135.9 192.5 124.1 194.2 108.9C194.4 106.5 196.6 87.4004 188.8 84.0004C185.7 82.7004 181.2 84.1004 179.5 86.6004Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M191.1 93.5012C191.1 77.6412 184.8 62.4309 173.585 51.2162C162.37 40.0015 147.16 33.7012 131.3 33.7012C115.44 33.7012 100.23 40.0015 89.015 51.2162C77.8003 62.4309 71.5 77.6412 71.5 93.5012H191.1Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M123.8 136.001L127.3 136.901L129.1 137.401L130.6 137.701C131.715 137.761 132.832 137.625 133.9 137.301L137.2 136.201C137.373 136.136 137.564 136.141 137.732 136.216C137.901 136.291 138.033 136.429 138.1 136.601C138.146 136.749 138.141 136.908 138.086 137.052C138.032 137.197 137.932 137.32 137.8 137.401C136.748 138.093 135.604 138.631 134.4 139.001C133.162 139.5 131.835 139.739 130.5 139.701L128.5 139.301L126.8 138.701L123.4 137.301C123.246 137.216 123.13 137.076 123.074 136.91C123.019 136.743 123.028 136.561 123.1 136.401C123.161 136.27 123.262 136.162 123.387 136.09C123.512 136.019 123.657 135.988 123.8 136.001Z\" fill=\"%2372594B\"/%3E%3Cpath d=\"M125.9 112.399C126.405 113.733 126.806 115.104 127.1 116.499C127.365 117.953 127.533 119.423 127.6 120.899C127.651 123.811 127.247 126.713 126.4 129.499C126.382 129.594 126.341 129.684 126.281 129.759C126.221 129.835 126.143 129.895 126.055 129.935C125.966 129.974 125.87 129.991 125.773 129.985C125.677 129.979 125.583 129.95 125.5 129.899C125.324 129.854 125.169 129.75 125.06 129.605C124.951 129.459 124.894 129.281 124.9 129.099C125.205 127.75 125.406 126.379 125.5 124.999C125.6 123.699 125.6 122.299 125.6 120.899C125.6 119.499 125.4 118.199 125.2 116.799C125 115.399 124.8 114.099 124.5 112.799C124.47 112.708 124.459 112.61 124.468 112.514C124.477 112.418 124.506 112.324 124.553 112.24C124.6 112.155 124.664 112.081 124.741 112.023C124.818 111.964 124.906 111.922 125 111.899C125.185 111.864 125.377 111.894 125.541 111.985C125.706 112.077 125.833 112.224 125.9 112.399Z\" fill=\"%2372594B\"/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"131.3\" y1=\"100.551\" x2=\"131.3\" y2=\"227.901\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23614A3E\"/%3E%3Cstop offset=\"0.31\" stop-color=\"%23644C40\"/%3E%3Cstop offset=\"0.55\" stop-color=\"%236E5446\"/%3E%3Cstop offset=\"0.76\" stop-color=\"%237E6051\"/%3E%3Cstop offset=\"0.96\" stop-color=\"%2395715F\"/%3E%3Cstop offset=\"1\" stop-color=\"%239B7663\"/%3E%3C/linearGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Gael.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::b0a31b93eb366e62097f01cd9663f1f6>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"257\" viewBox=\"0 0 256 257\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256.9C198.692 256.9 256 199.593 256 128.9C256 58.2079 198.692 0.900391 128 0.900391C57.3075 0.900391 0 58.2079 0 128.9C0 199.593 57.3075 256.9 128 256.9Z\" fill=\"%2357D9A3\"/%3E%3Cpath d=\"M216.7 221.2L180 196.9C179.205 196.441 178.316 196.167 177.4 196.1L130.3 193.6L83.1002 196.1C82.213 196.152 81.3533 196.428 80.6002 196.9L41.2002 223C65.186 245.096 96.6964 257.212 129.307 256.877C161.917 256.543 193.173 243.783 216.7 221.2Z\" fill=\"%2379F2C0\"/%3E%3Cpath d=\"M161.9 176.201C161.54 182.033 161.977 187.887 163.2 193.601C163.9 196.101 167.2 197.101 169.9 198.601C170.241 198.843 170.473 199.209 170.548 199.62C170.623 200.031 170.534 200.455 170.3 200.801C165 207.601 156.2 214.201 146.6 218.501C146.062 218.734 145.632 219.163 145.4 219.701L132.4 247.401C132.179 247.82 131.848 248.17 131.443 248.415C131.038 248.66 130.573 248.789 130.1 248.789C129.627 248.789 129.162 248.66 128.757 248.415C128.352 248.17 128.021 247.82 127.8 247.401L114.7 219.701C114.578 219.422 114.4 219.171 114.176 218.965C113.952 218.758 113.688 218.6 113.4 218.501C103.9 214.201 95.1001 207.601 89.8001 200.801C89.6721 200.643 89.5801 200.459 89.5305 200.261C89.4809 200.064 89.4749 199.858 89.513 199.658C89.5511 199.458 89.6323 199.269 89.7509 199.104C89.8696 198.939 90.0229 198.801 90.2001 198.701C92.9001 197.101 96.2001 196.101 96.9001 193.601C98.1233 187.887 98.5606 182.033 98.2001 176.201H161.9Z\" fill=\"%23DDB28D\"/%3E%3Cpath d=\"M194.3 113.601C194.5 119.901 183.9 133.401 177.6 133.601C171.3 133.801 171.6 120.701 171.3 114.401C171.194 111.351 172.304 108.384 174.385 106.152C176.467 103.921 179.35 102.607 182.4 102.501C185.45 102.395 188.417 103.505 190.649 105.587C192.88 107.668 194.194 110.551 194.3 113.601Z\" fill=\"%23ECC19C\"/%3E%3Cpath d=\"M64.1003 113.601C63.8003 119.901 74.4003 133.401 80.7003 133.601C87.0003 133.801 86.8003 120.701 87.0003 114.401C87.1934 112.819 87.0554 111.214 86.5952 109.688C86.135 108.161 85.3626 106.748 84.3269 105.536C83.2913 104.324 82.0151 103.341 80.5793 102.649C79.1435 101.957 77.5795 101.57 75.9865 101.515C74.3935 101.459 72.8063 101.735 71.3257 102.326C69.8451 102.916 68.5034 103.808 67.3857 104.944C66.268 106.081 65.3988 107.437 64.8332 108.927C64.2677 110.418 64.0181 112.009 64.1003 113.601Z\" fill=\"%23ECC19C\"/%3E%3Cpath d=\"M121.8 187.7C126.736 189.099 131.964 189.099 136.9 187.7C176.2 176.7 169.9 172.7 185 106.2C193.6 68.0002 187.4 25.2002 129.4 27.0002C71.3002 25.2002 65.1002 68.0002 73.7002 106.2C88.8002 172.7 82.5002 176.7 121.8 187.7Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M129.1 164.901C140 164.501 144.5 169.901 148.6 166.801C152.7 163.701 152.7 157.501 150.2 155.001C149.4 154.101 148.5 154.001 143.3 153.701C134 153.201 133.1 153.501 128.8 153.001C124.5 152.501 123.8 152.101 120.8 152.201C118.168 152.283 115.553 152.652 113 153.301C109.9 154.001 108.3 154.301 107.8 155.001C105.7 157.501 107.5 164.601 111.8 167.101C116.1 169.601 119.5 165.201 129.1 164.901Z\" fill=\"%23ECC19C\"/%3E%3Cpath d=\"M129.4 136.5C145.6 136.5 157.1 145.8 165.2 140.6C173.3 135.4 177.8 115.8 180.1 108.6C182.159 101.863 182.571 94.7297 181.3 87.8003C180.9 85.1003 177.6 81.6003 176.2 75.3003C175.729 73.3974 175.428 71.4564 175.3 69.5003C168.529 68.6951 161.692 68.5946 154.9 69.2003C128.5 71.8003 116.5 85.0003 99.9 80.0003C96.3 79.0003 90.8 76.5003 85 70.1003C83.2054 72.1941 81.6925 74.5138 80.5 77.0003C78.8731 80.4028 77.8254 84.0529 77.4 87.8003C76.3899 94.7434 76.7982 101.819 78.6 108.6C80.9 115.8 85.5 135.5 93.5 140.6C101.5 145.7 113.1 136.5 129.4 136.5Z\" fill=\"%23ECC19C\"/%3E%3Cpath d=\"M145.8 153.6C140.5 152.6 137.1 151.2 133.1 152C132.8 152.1 132.7 152 132.3 152.2C130.141 152.802 127.859 152.802 125.7 152.2L124.9 152C121.1 151.2 117.7 152.4 112.4 153.5L107.3 154.4C110.101 157.335 113.468 159.671 117.198 161.267C120.928 162.863 124.943 163.685 129 163.685C133.057 163.685 137.071 162.863 140.801 161.267C144.531 159.671 147.899 157.335 150.7 154.4L145.8 153.6Z\" fill=\"%23B5917C\"/%3E%3Cpath d=\"M105.101 152.801C108.935 154.205 112.883 155.275 116.901 156.001C120.891 156.731 124.944 157.066 129.001 157.001C133.058 156.987 137.107 156.619 141.101 155.901C143.091 155.541 145.061 155.073 147.001 154.501C148.967 153.973 150.903 153.339 152.801 152.601C152.933 152.548 153.082 152.55 153.213 152.606C153.344 152.662 153.448 152.768 153.501 152.901C153.554 153.034 153.552 153.182 153.496 153.313C153.439 153.444 153.333 153.548 153.201 153.601C149.452 155.367 145.532 156.741 141.501 157.701C137.385 158.534 133.199 158.969 129.001 159.001C126.901 159.001 124.801 158.901 122.801 158.701C120.712 158.522 118.64 158.188 116.601 157.701C112.499 156.856 108.507 155.547 104.701 153.801C104.606 153.714 104.538 153.603 104.503 153.479C104.467 153.356 104.467 153.225 104.501 153.101C104.508 153.035 104.532 152.971 104.57 152.917C104.608 152.862 104.66 152.818 104.719 152.788C104.779 152.758 104.845 152.744 104.912 152.746C104.978 152.748 105.043 152.767 105.101 152.801Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M120.8 132.101L125.7 133.801L128.1 134.901L129 135.301H129.9C130.642 135.221 131.359 134.982 132 134.601L134.5 133.601C136.22 133.084 138.004 132.814 139.8 132.801C139.986 132.801 140.164 132.874 140.295 133.006C140.426 133.137 140.5 133.315 140.5 133.501C140.506 133.682 140.45 133.861 140.341 134.006C140.232 134.151 140.076 134.255 139.9 134.301C138.265 134.593 136.659 135.028 135.1 135.601C134.339 135.869 133.603 136.204 132.9 136.601C132.044 137.043 131.138 137.379 130.2 137.601H128.5C127.991 137.52 127.51 137.314 127.1 137.001L124.8 135.901C123.3 135.101 121.7 134.501 120.2 133.601C120.111 133.559 120.031 133.499 119.967 133.424C119.903 133.35 119.855 133.262 119.826 133.168C119.798 133.073 119.79 132.974 119.803 132.876C119.815 132.779 119.849 132.685 119.9 132.601C119.967 132.425 120.094 132.278 120.259 132.187C120.424 132.095 120.615 132.065 120.8 132.101Z\" fill=\"%23CEA28B\"/%3E%3Cpath d=\"M124.5 99.7008C125.98 103.764 126.626 108.083 126.4 112.401C126.337 114.588 126.069 116.764 125.6 118.901C125.119 121.011 124.484 123.083 123.7 125.101C123.657 125.202 123.594 125.293 123.514 125.369C123.435 125.444 123.34 125.502 123.237 125.54C123.134 125.578 123.024 125.593 122.915 125.587C122.805 125.58 122.698 125.551 122.6 125.501C122.416 125.415 122.267 125.269 122.176 125.088C122.085 124.906 122.059 124.699 122.1 124.501C122.708 122.536 123.176 120.531 123.5 118.501C123.876 116.486 124.11 114.448 124.2 112.401C124.284 110.332 124.217 108.26 124 106.201C123.7 104.201 123.4 102.201 122.9 100.201C122.87 100.096 122.862 99.9855 122.877 99.8772C122.891 99.7689 122.928 99.6647 122.984 99.571C123.04 99.4773 123.115 99.3961 123.204 99.3324C123.293 99.2687 123.393 99.2239 123.5 99.2008C123.699 99.1591 123.906 99.1859 124.087 99.2767C124.269 99.3674 124.414 99.5169 124.5 99.7008Z\" fill=\"%23CEA28B\"/%3E%3Cpath d=\"M115.9 100.201L114.3 99.3012L112.5 98.5012C111.303 97.9969 110.065 97.5955 108.8 97.3012C106.248 96.6838 103.624 96.4147 101 96.5012C98.3549 96.6955 95.7567 97.3029 93.2998 98.3012L89.6998 100.201C88.5937 100.898 87.5849 101.739 86.6998 102.701H86.5998C86.4263 102.898 86.1822 103.019 85.9203 103.038C85.6583 103.057 85.3995 102.972 85.1998 102.801C85.0521 102.643 84.9544 102.445 84.9188 102.231C84.8832 102.018 84.9114 101.799 84.9998 101.601C85.8686 100.269 86.9111 99.0581 88.0998 98.0012C89.2503 97.0223 90.4889 96.1519 91.7998 95.4012C94.5103 93.8747 97.5056 92.9217 100.6 92.6012C103.678 92.2493 106.794 92.4526 109.8 93.2012C111.303 93.6293 112.773 94.164 114.2 94.8012L116.2 96.0012L118.2 97.5012C118.537 97.8236 118.736 98.2645 118.755 98.7309C118.774 99.1974 118.611 99.6528 118.3 100.001C118.019 100.29 117.65 100.476 117.252 100.531C116.853 100.585 116.447 100.504 116.1 100.301L115.9 100.201Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M141.2 97.5012L143.2 96.0012L145.2 94.8012C146.627 94.164 148.097 93.6293 149.6 93.2012C152.606 92.4526 155.722 92.2493 158.8 92.6012C161.894 92.9217 164.889 93.8747 167.6 95.4012C168.911 96.1519 170.149 97.0223 171.3 98.0012C172.515 99.0313 173.562 100.246 174.4 101.601C174.468 101.711 174.512 101.833 174.529 101.961C174.545 102.089 174.534 102.219 174.497 102.342C174.459 102.466 174.395 102.579 174.309 102.676C174.223 102.772 174.118 102.849 174 102.901C173.911 102.976 173.808 103.03 173.696 103.06C173.585 103.091 173.468 103.097 173.354 103.078C173.24 103.059 173.131 103.015 173.035 102.95C172.94 102.885 172.859 102.8 172.8 102.701H172.7C171.815 101.739 170.806 100.898 169.7 100.201C168.544 99.4881 167.341 98.8533 166.1 98.3012C163.677 97.3035 161.112 96.696 158.5 96.5012C155.843 96.4201 153.187 96.6891 150.6 97.3012C149.339 97.61 148.102 98.0111 146.9 98.5012L145.1 99.3012L143.6 100.201H143.4C143.197 100.328 142.971 100.414 142.734 100.452C142.498 100.491 142.257 100.482 142.024 100.426C141.791 100.37 141.572 100.269 141.379 100.127C141.186 99.9853 141.023 99.8065 140.9 99.6012C140.721 99.2645 140.654 98.8797 140.708 98.5023C140.761 98.1249 140.934 97.7743 141.2 97.5012Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M91.6 106.201C94.6497 104.042 98.2656 102.825 102 102.701C105.788 102.594 109.52 103.64 112.7 105.701C112.799 105.76 112.884 105.841 112.949 105.937C113.014 106.032 113.058 106.141 113.077 106.255C113.096 106.369 113.09 106.486 113.059 106.597C113.029 106.709 112.974 106.812 112.9 106.901C112.849 107.008 112.776 107.102 112.684 107.177C112.593 107.252 112.486 107.306 112.371 107.335C112.256 107.363 112.136 107.366 112.02 107.343C111.904 107.32 111.795 107.271 111.7 107.201C110.196 106.423 108.622 105.787 107 105.301C105.358 104.914 103.685 104.68 102 104.601C100.311 104.63 98.6321 104.865 97 105.301C95.3394 105.769 93.731 106.406 92.2 107.201C92.1392 107.255 92.0662 107.293 91.9874 107.312C91.9085 107.331 91.8261 107.331 91.7473 107.312C91.6686 107.292 91.5958 107.253 91.5353 107.199C91.4748 107.145 91.4283 107.077 91.4 107.001C91.3462 106.94 91.308 106.867 91.2887 106.788C91.2694 106.709 91.2697 106.627 91.2893 106.548C91.309 106.469 91.3476 106.397 91.4017 106.336C91.4559 106.276 91.5239 106.229 91.6 106.201Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M166.8 107.201C165.269 106.405 163.661 105.769 162 105.301C160.368 104.865 158.689 104.63 157 104.601C153.603 104.658 150.271 105.551 147.3 107.201C147.203 107.296 147.086 107.369 146.957 107.412C146.828 107.456 146.691 107.47 146.555 107.453C146.42 107.435 146.291 107.388 146.177 107.313C146.063 107.239 145.967 107.14 145.897 107.023C145.827 106.906 145.784 106.775 145.772 106.639C145.76 106.503 145.779 106.367 145.828 106.239C145.876 106.112 145.953 105.997 146.052 105.904C146.151 105.811 146.27 105.741 146.4 105.701C149.539 103.63 153.242 102.581 157 102.701C160.766 102.823 164.415 104.039 167.5 106.201C167.621 106.314 167.697 106.467 167.716 106.632C167.734 106.797 167.693 106.963 167.6 107.101C167.503 107.214 167.368 107.286 167.22 107.305C167.072 107.323 166.922 107.286 166.8 107.201Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M155.9 109.9C157.668 109.9 159.1 108.467 159.1 106.7C159.1 104.933 157.668 103.5 155.9 103.5C154.133 103.5 152.7 104.933 152.7 106.7C152.7 108.467 154.133 109.9 155.9 109.9Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M102.6 109.9C104.368 109.9 105.8 108.467 105.8 106.7C105.8 104.933 104.368 103.5 102.6 103.5C100.833 103.5 99.4004 104.933 99.4004 106.7C99.4004 108.467 100.833 109.9 102.6 109.9Z\" fill=\"%23172B4D\"/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"129.36\" y1=\"186.31\" x2=\"129.36\" y2=\"27.9002\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23253858\"/%3E%3Cstop offset=\"1\" stop-color=\"%2342526E\"/%3E%3C/linearGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Gerard.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::2b0317285f8cb084f26a47d7035bf6ee>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"257\" viewBox=\"0 0 256 257\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256.9C198.692 256.9 256 199.593 256 128.9C256 58.2079 198.692 0.900391 128 0.900391C57.3075 0.900391 0 58.2079 0 128.9C0 199.593 57.3075 256.9 128 256.9Z\" fill=\"%23FF5630\"/%3E%3Cpath d=\"M81.3254 142.131C88.3928 140.342 92.3099 131.731 90.0745 122.897C87.8391 114.062 80.2977 108.351 73.2303 110.139C66.1629 111.927 62.2458 120.539 64.4812 129.373C66.7166 138.207 74.258 143.919 81.3254 142.131Z\" fill=\"%23F7D0C3\"/%3E%3Cpath d=\"M196.506 129.486C198.742 120.652 194.824 112.041 187.757 110.252C180.69 108.464 173.148 114.176 170.913 123.01C168.677 131.844 172.595 140.456 179.662 142.244C186.729 144.032 194.271 138.32 196.506 129.486Z\" fill=\"%23F7D0C3\"/%3E%3Cpath d=\"M211.5 225.9L194.1 216.1C188.189 212.845 181.634 210.933 174.9 210.5C159.4 209.4 132.4 207.9 132.4 207.9C132.4 207.9 105.4 209.4 89.9 210.5C83.2004 210.948 76.6804 212.859 70.8 216.1L48 228.8C71.3032 247.484 100.41 257.423 130.274 256.893C160.138 256.363 188.874 245.399 211.5 225.9Z\" fill=\"%23BF2600\"/%3E%3Cpath d=\"M179.4 217.4C176.4 220.4 156.9 239 127.6 237.1C111.773 235.975 96.8574 229.279 85.5 218.2C90.6281 213.039 94.3169 206.627 96.2 199.6C98.552 190.36 97.7061 180.597 93.8 171.9L168.9 170.1C167.7 172.4 161.5 185.8 167 200.7C169.431 207.348 173.739 213.149 179.4 217.4Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M130.9 42C158.6 42.2 175.5 60.9 178.1 63.9C195.6 84.1 193.8 108.2 193.4 113.3C192.4 125.7 187.4 135.6 177.7 155.6C173.311 164.804 168.403 173.752 163 182.4C161.489 184.864 159.302 186.842 156.7 188.1C148.698 192.218 139.893 194.539 130.9 194.9C121.874 194.55 113.034 192.229 105 188.1C102.444 186.813 100.297 184.839 98.8002 182.4C93.3601 173.756 88.4187 164.808 84.0002 155.6C74.4002 135.6 69.3002 125.7 68.4002 113.3C68.0002 108.2 66.1002 84.1 83.7002 63.9C86.3002 60.9 103.2 42.2 130.9 42Z\" fill=\"%23FFE2D9\"/%3E%3Cpath d=\"M109.7 105.4C107.702 104.88 105.66 104.545 103.6 104.4C101.597 104.2 99.5743 104.301 97.6005 104.7C95.5712 105.119 93.593 105.756 91.7005 106.6C89.7166 107.548 87.8107 108.651 86.0005 109.9C85.851 110.015 85.6796 110.099 85.4968 110.147C85.3139 110.195 85.1233 110.205 84.9364 110.177C84.7495 110.149 84.5703 110.083 84.4094 109.984C84.2486 109.885 84.1095 109.754 84.0005 109.6C83.8139 109.356 83.7129 109.057 83.7129 108.75C83.7129 108.442 83.8139 108.144 84.0005 107.9C85.4239 105.792 87.22 103.962 89.3005 102.5C90.35 101.753 91.453 101.085 92.6005 100.5C93.7387 99.8875 94.9477 99.4174 96.2005 99.0997C98.7838 98.2859 101.507 98.0136 104.2 98.2997C106.838 98.512 109.397 99.2969 111.7 100.6C112.282 100.971 112.7 101.551 112.867 102.221C113.034 102.89 112.939 103.598 112.6 104.2C112.331 104.68 111.911 105.058 111.404 105.275C110.898 105.492 110.334 105.536 109.8 105.4H109.7Z\" fill=\"%23344563\"/%3E%3Cpath d=\"M144.1 101.201C147.751 99.033 151.96 97.9896 156.2 98.2005L158.3 98.5005L160.4 98.9005C163.09 99.5562 165.634 100.709 167.9 102.301C170.182 103.769 172.153 105.672 173.7 107.901C173.816 108.05 173.9 108.221 173.948 108.404C173.995 108.587 174.005 108.778 173.977 108.965C173.949 109.151 173.884 109.331 173.784 109.492C173.685 109.652 173.555 109.792 173.4 109.901C173.156 110.087 172.857 110.188 172.55 110.188C172.243 110.188 171.944 110.087 171.7 109.901C169.791 108.558 167.746 107.419 165.6 106.501C164.568 106.013 163.498 105.612 162.4 105.301C161.357 104.972 160.286 104.738 159.2 104.601C157.049 104.267 154.861 104.234 152.7 104.501C150.534 104.751 148.393 105.186 146.3 105.801H146.2C145.598 105.973 144.955 105.922 144.387 105.657C143.82 105.393 143.367 104.933 143.112 104.361C142.857 103.79 142.816 103.145 142.998 102.546C143.179 101.947 143.571 101.434 144.1 101.101V101.201Z\" fill=\"%23344563\"/%3E%3Cpath d=\"M90.7006 113.001C93.7503 110.842 97.3662 109.625 101.101 109.501C104.882 109.331 108.622 110.345 111.801 112.401C111.902 112.47 111.989 112.56 112.055 112.664C112.12 112.769 112.164 112.885 112.183 113.007C112.202 113.129 112.195 113.254 112.164 113.373C112.132 113.492 112.077 113.604 112.001 113.701C111.877 113.895 111.683 114.034 111.46 114.09C111.237 114.145 111.001 114.114 110.801 114.001C109.324 113.163 107.744 112.525 106.101 112.101C102.833 111.167 99.3685 111.167 96.1006 112.101C94.4252 112.524 92.8118 113.163 91.3006 114.001C91.2359 114.064 91.1576 114.113 91.0715 114.142C90.9855 114.171 90.894 114.18 90.8039 114.169C90.7138 114.157 90.6275 114.126 90.5514 114.076C90.4753 114.026 90.4115 113.96 90.3648 113.882C90.3181 113.804 90.2896 113.717 90.2816 113.626C90.2736 113.536 90.2863 113.445 90.3186 113.36C90.3509 113.275 90.4021 113.199 90.4683 113.136C90.5344 113.074 90.6139 113.028 90.7006 113.001Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M165.9 114.001C164.415 113.181 162.837 112.543 161.2 112.101C159.543 111.623 157.825 111.387 156.1 111.401C154.408 111.388 152.723 111.624 151.1 112.101C149.463 112.543 147.885 113.181 146.4 114.001C146.298 114.069 146.183 114.112 146.062 114.129C145.941 114.145 145.818 114.133 145.702 114.095C145.586 114.056 145.481 113.992 145.394 113.906C145.307 113.82 145.24 113.716 145.2 113.601C145.108 113.396 145.088 113.166 145.142 112.949C145.197 112.731 145.323 112.538 145.5 112.401C148.678 110.345 152.418 109.331 156.2 109.501C159.932 109.637 163.545 110.852 166.6 113.001C166.733 113.094 166.823 113.235 166.851 113.395C166.879 113.554 166.843 113.718 166.75 113.851C166.657 113.983 166.515 114.074 166.356 114.102C166.197 114.13 166.033 114.094 165.9 114.001Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M155.1 116.701C156.868 116.701 158.3 115.268 158.3 113.501C158.3 111.733 156.868 110.301 155.1 110.301C153.333 110.301 151.9 111.733 151.9 113.501C151.9 115.268 153.333 116.701 155.1 116.701Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M101.801 116.701C103.568 116.701 105.001 115.268 105.001 113.501C105.001 111.733 103.568 110.301 101.801 110.301C100.033 110.301 98.6006 111.733 98.6006 113.501C98.6006 115.268 100.033 116.701 101.801 116.701Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M130.9 42C103.2 42.2 86.3002 60.9 83.7002 63.9C66.1002 84.1 68.0002 108.2 68.4002 113.3C68.5985 116.441 69.1009 119.556 69.9002 122.6C78.8002 106.2 72.0002 92 81.8002 74.8C83.9002 71 86.4002 66.7 91.3002 63.3C100.1 57.3 108 59.9 127.2 60.1C153.1 60.2 155.5 55.5 164.4 60C178.4 67.1 183.1 84.2 183.4 85.6C187.2 100.3 180.5 109.2 187.1 120.9C188.145 122.729 189.386 124.439 190.8 126C192.144 121.878 193.016 117.618 193.4 113.3C193.8 108.2 195.6 84.1 178.1 63.9C175.5 60.9 158.6 42.2 130.9 42Z\" fill=\"url(%23paint1_linear)\"/%3E%3Cpath d=\"M146.9 162.001C141.6 160.801 138.2 159.401 134.2 160.201L133.4 160.401C131.256 161.104 128.944 161.104 126.8 160.401L126 160.201C122.2 159.401 118.8 160.601 113.5 161.901L108.4 162.901C111.026 166.121 114.336 168.717 118.089 170.499C121.842 172.282 125.945 173.206 130.1 173.206C134.255 173.206 138.358 172.282 142.112 170.499C145.865 168.717 149.175 166.121 151.8 162.901L146.9 162.001Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M105.8 161.501C109.696 162.663 113.674 163.532 117.7 164.101C121.679 164.616 125.687 164.884 129.7 164.901C133.715 164.854 137.722 164.553 141.7 164.001L147.7 162.901C149.7 162.501 151.6 162.001 153.6 161.401C153.9 161.301 154.1 161.501 154.2 161.801C154.233 161.858 154.252 161.923 154.254 161.99C154.257 162.057 154.242 162.123 154.212 162.182C154.183 162.242 154.138 162.293 154.084 162.331C154.029 162.37 153.966 162.394 153.9 162.401C150.045 163.895 146.062 165.033 142 165.801C137.936 166.485 133.821 166.82 129.7 166.801L123.5 166.601C121.5 166.401 119.4 166.201 117.4 165.801C113.343 165.101 109.36 164.029 105.5 162.601C105.376 162.537 105.279 162.432 105.224 162.305C105.17 162.177 105.161 162.034 105.2 161.901C105.243 161.778 105.325 161.673 105.433 161.601C105.541 161.529 105.67 161.494 105.8 161.501Z\" fill=\"%23CB8C84\"/%3E%3Cpath d=\"M121.5 112.901C122.601 114.399 123.476 116.05 124.1 117.801C124.644 119.589 124.979 121.435 125.1 123.301C125.212 127.012 124.386 130.692 122.7 134.001C122.654 134.099 122.589 134.188 122.509 134.261C122.429 134.334 122.335 134.391 122.233 134.429C122.131 134.466 122.022 134.482 121.914 134.478C121.805 134.473 121.699 134.447 121.6 134.401C121.502 134.355 121.413 134.29 121.34 134.21C121.266 134.13 121.209 134.036 121.172 133.934C121.135 133.831 121.118 133.723 121.123 133.614C121.128 133.506 121.154 133.399 121.2 133.301C121.739 131.697 122.173 130.06 122.5 128.401C122.796 126.752 122.897 125.073 122.8 123.401C122.786 121.703 122.516 120.018 122 118.401C121.558 116.795 120.92 115.25 120.1 113.801C120.03 113.706 119.981 113.596 119.958 113.48C119.935 113.364 119.938 113.245 119.966 113.13C119.995 113.015 120.049 112.908 120.124 112.817C120.199 112.725 120.293 112.651 120.4 112.601C120.492 112.547 120.593 112.513 120.698 112.499C120.804 112.485 120.911 112.492 121.013 112.52C121.115 112.548 121.211 112.596 121.295 112.662C121.378 112.727 121.448 112.808 121.5 112.901Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M127.9 147.9H127C126.15 147.819 125.329 147.546 124.6 147.1C123.949 146.756 123.234 146.552 122.5 146.5C120.881 146.37 119.257 146.681 117.8 147.4C117.4 147.7 116.8 147.4 116.5 146.9C116.398 146.66 116.393 146.391 116.487 146.148C116.58 145.905 116.764 145.709 117 145.6C118.761 144.71 120.735 144.329 122.7 144.5C123.647 144.572 124.567 144.845 125.4 145.3C125.954 145.617 126.566 145.821 127.2 145.9C128.411 146.04 129.636 145.795 130.7 145.2C132.046 144.518 133.502 144.078 135 143.9C137.016 143.801 139.029 144.142 140.9 144.9C141.025 144.946 141.139 145.016 141.237 145.106C141.335 145.196 141.414 145.305 141.469 145.425C141.525 145.546 141.556 145.676 141.562 145.809C141.567 145.942 141.546 146.075 141.5 146.2C141.454 146.324 141.384 146.439 141.294 146.536C141.204 146.634 141.095 146.713 140.974 146.769C140.854 146.824 140.723 146.856 140.59 146.861C140.457 146.866 140.325 146.845 140.2 146.8C138.623 146.124 136.913 145.816 135.2 145.9C133.914 146.057 132.663 146.429 131.5 147C130.393 147.592 129.156 147.902 127.9 147.9Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M112.2 152.5L106 156.4L99.8 160.4C99.6513 160.481 99.478 160.506 99.3125 160.469C99.1469 160.432 99.0004 160.337 98.9 160.2C98.8144 160.078 98.7772 159.929 98.7957 159.781C98.8141 159.633 98.887 159.497 99 159.4C102.37 155.586 106.731 152.782 111.6 151.3C111.679 151.269 111.763 151.255 111.847 151.258C111.931 151.262 112.014 151.283 112.089 151.321C112.165 151.359 112.232 151.412 112.285 151.477C112.339 151.543 112.378 151.619 112.4 151.7C112.442 151.839 112.446 151.987 112.411 152.128C112.376 152.269 112.303 152.397 112.2 152.5Z\" fill=\"%23F0BEB4\"/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"132.43\" y1=\"237.24\" x2=\"132.43\" y2=\"170.11\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23FFE2D9\"/%3E%3Cstop offset=\"1\" stop-color=\"%23EBBEAE\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint1_linear\" x1=\"130.88\" y1=\"131.48\" x2=\"130.88\" y2=\"37.5\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23F0BEB4\"/%3E%3Cstop offset=\"0.11\" stop-color=\"%23E1B4AD\"/%3E%3Cstop offset=\"0.33\" stop-color=\"%23BB9B9C\"/%3E%3Cstop offset=\"0.63\" stop-color=\"%237C7280\"/%3E%3Cstop offset=\"0.99\" stop-color=\"%23273A59\"/%3E%3Cstop offset=\"1\" stop-color=\"%23253858\"/%3E%3C/linearGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Hasan.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::1e7202e9c0bf9d903fa2bebbffc2d7f1>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"257\" viewBox=\"0 0 256 257\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256.9C198.692 256.9 256 199.593 256 128.9C256 58.2079 198.692 0.900391 128 0.900391C57.3075 0.900391 0 58.2079 0 128.9C0 199.593 57.3075 256.9 128 256.9Z\" fill=\"%23FFAB00\"/%3E%3Cpath d=\"M207.3 229.3L178.5 213.2C177.705 212.741 176.816 212.468 175.9 212.4L128 209.9L80.1002 212.4C79.1844 212.468 78.2956 212.741 77.5002 213.2L48.7002 229.3C71.266 247.178 99.2107 256.906 128 256.906C156.79 256.906 184.734 247.178 207.3 229.3Z\" fill=\"%23FFC400\"/%3E%3Cpath d=\"M173 217.401C172 218.901 153.6 243.301 123.4 240.901C98.9 239.001 85.1 221.001 83 218.201C89.0836 213.63 93.395 207.093 95.2 199.701C98.8 184.101 89 172.201 87.8 170.801H164.4C163.9 171.501 152.6 187.101 159.7 203.201C162.458 209.263 167.131 214.252 173 217.401Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M60.8003 101.9C60.9003 99.1999 63.2003 96.7999 63.6003 94.1999C64.0003 91.5999 62.6003 88.5999 63.4003 85.9999C64.2003 83.3999 66.8003 81.5999 67.8003 79.1999C68.8003 76.7999 68.1003 73.4999 69.4003 71.0999C70.7003 68.6999 73.7003 67.5999 75.2003 65.3999C76.7003 63.1999 76.8003 59.8999 78.5003 57.8999C80.2003 55.8999 83.5003 55.3999 85.5003 53.5999C87.5003 51.7999 88.2003 48.5999 90.4003 47.0999C92.6003 45.5999 95.8003 45.7999 98.1003 44.4999C100.4 43.1999 101.9 40.2999 104.4 39.2999C106.9 38.2999 110 39.3999 112.6 38.6999C115.2 37.9999 117.3 35.5999 120 35.1999C122.7 34.7999 125.3 36.6999 128 36.6999C130.7 36.6999 133.5 34.8999 136 35.1999C138.5 35.4999 140.9 37.9999 143.4 38.6999C145.9 39.3999 149.2 38.2999 151.6 39.2999C154 40.2999 155.6 43.1999 157.9 44.4999C160.2 45.7999 163.5 45.4999 165.6 47.0999C167.7 48.6999 168.6 51.8999 170.5 53.5999C172.4 55.2999 175.7 55.8999 177.5 57.8999C179.3 59.8999 179.3 63.2999 180.8 65.3999C182.3 67.4999 185.3 68.7999 186.6 71.0999C187.9 73.3999 187.2 76.6999 188.2 79.1999C189.2 81.6999 191.9 83.4999 192.6 85.9999C193.3 88.4999 192 91.5999 192.4 94.1999C192.8 96.7999 195.1 99.1999 195.2 101.9C195.3 104.6 193.3 107.4 193 110.2C192.7 113 194.4 116.1 193.8 118.8C193.2 121.5 190.6 123.7 189.7 126.4C188.8 129.1 189.6 132.3 188.4 134.9C187.2 137.5 184.1 138.9 182.6 141.3C181.1 143.7 181.2 147.1 179.5 149.3C177.8 151.5 174.4 152.3 172.4 154.2C170.4 156.1 169.7 159.6 167.4 161.3C165.1 163 161.8 162.9 159.4 164.4C157 165.9 155.4 168.9 152.9 170C150.4 171.1 147 170.1 144.3 170.9C141.6 171.7 139.3 174.1 136.5 174.5C133.7 174.9 130.8 173.1 128 173.1C125.2 173.1 122.2 174.9 119.5 174.5C116.8 174.1 114.4 171.6 111.7 170.9C109 170.2 105.7 171.1 103.1 170C100.5 168.9 99.0003 165.8 96.6003 164.4C94.2003 163 90.7003 163 88.5003 161.3C86.3003 159.6 85.6003 156.2 83.6003 154.2C81.6003 152.2 78.3003 151.5 76.5003 149.3C74.7003 147.1 74.8003 143.7 73.4003 141.3C72.0003 138.9 68.8003 137.4 67.6003 134.9C66.4003 132.4 67.2003 129 66.3003 126.3C65.4003 123.6 62.8003 121.5 62.2003 118.8C61.6003 116.1 63.2003 113 63.0003 110.2C62.8003 107.4 60.7003 104.7 60.8003 101.9Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M77.5942 146.506C84.7152 144.705 88.6757 136.082 86.4403 127.248C84.2049 118.414 76.62 112.713 69.4991 114.515C62.3781 116.317 58.4176 124.939 60.653 133.773C62.8885 142.607 70.4733 148.308 77.5942 146.506Z\" fill=\"url(%23paint1_linear)\"/%3E%3Cpath d=\"M196.075 133.752C198.31 124.918 194.35 116.295 187.229 114.494C180.108 112.692 172.523 118.393 170.288 127.227C168.052 136.061 172.013 144.683 179.134 146.485C186.255 148.287 193.84 142.586 196.075 133.752Z\" fill=\"url(%23paint2_linear)\"/%3E%3Cpath d=\"M127.9 47C155.6 47.2 172.5 65.9 175.1 68.9C192.6 89.1 190.8 113.2 190.4 118.3C189.4 130.7 184.4 140.6 174.7 160.6C170.311 169.804 165.403 178.752 160 187.4C158.46 189.84 156.281 191.811 153.7 193.1C145.689 197.181 136.885 199.467 127.9 199.8C118.882 199.478 110.043 197.192 102 193.1C99.4672 191.78 97.3283 189.813 95.8002 187.4C90.3601 178.756 85.4187 169.808 81.0002 160.6C71.4002 140.6 66.3002 130.7 65.4002 118.3C65.0002 113.2 63.1002 89.1 80.7002 68.9C83.3002 65.9 100.2 47.2 127.9 47Z\" fill=\"%239B7661\"/%3E%3Cpath d=\"M139.4 106.6L140.6 105.6L141.8 104.8C142.6 104.2 143.5 103.8 144.3 103.3C146.01 102.519 147.783 101.883 149.6 101.4C153.259 100.485 157.049 100.214 160.8 100.6C164.556 101.015 168.193 102.17 171.5 104C173.101 104.917 174.608 105.989 176 107.2C177.441 108.441 178.688 109.89 179.7 111.5C179.79 111.636 179.852 111.79 179.88 111.951C179.909 112.112 179.905 112.277 179.867 112.436C179.83 112.595 179.76 112.745 179.663 112.876C179.565 113.008 179.442 113.118 179.3 113.2C179.065 113.344 178.788 113.402 178.515 113.366C178.242 113.329 177.989 113.2 177.8 113H177.7C176.627 111.817 175.379 110.806 174 110C172.656 109.077 171.214 108.306 169.7 107.7C166.752 106.429 163.605 105.685 160.4 105.5C157.208 105.397 154.016 105.7 150.9 106.4C149.334 106.794 147.797 107.295 146.3 107.9L144.2 108.9L143.2 109.4L142.3 110H142C141.548 110.201 141.042 110.244 140.562 110.122C140.083 110 139.658 109.719 139.358 109.326C139.057 108.933 138.898 108.45 138.906 107.956C138.913 107.461 139.088 106.983 139.4 106.6Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M114.8 109.9L113.9 109.3L112.9 108.8L110.8 107.8C109.303 107.195 107.766 106.694 106.2 106.3C103.084 105.605 99.8922 105.303 96.7004 105.4C93.4958 105.585 90.3483 106.33 87.4004 107.6C85.887 108.206 84.4449 108.978 83.1004 109.9C81.7217 110.706 80.474 111.718 79.4004 112.9H79.3004C79.1889 113.012 79.0565 113.101 78.9106 113.161C78.7647 113.222 78.6083 113.253 78.4504 113.253C78.2925 113.253 78.1361 113.222 77.9902 113.161C77.8444 113.101 77.7119 113.012 77.6004 112.9C77.3999 112.711 77.2706 112.459 77.2342 112.186C77.1977 111.912 77.2564 111.635 77.4004 111.4C78.4128 109.791 79.6599 108.341 81.1004 107.1C82.4745 105.867 83.9842 104.793 85.6004 103.9C88.9074 102.071 92.5441 100.915 96.3004 100.5C100.052 100.115 103.842 100.386 107.5 101.3C109.317 101.784 111.09 102.419 112.8 103.2C113.6 103.7 114.5 104.1 115.3 104.7L116.5 105.5L117.7 106.5C118.013 106.884 118.187 107.361 118.195 107.856C118.203 108.351 118.044 108.834 117.743 109.227C117.442 109.62 117.018 109.9 116.539 110.022C116.059 110.144 115.552 110.101 115.1 109.9H114.8Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M89.0005 118.4C92.0555 116.252 95.6682 115.036 99.4005 114.9C103.192 114.767 106.931 115.815 110.101 117.9C110.21 117.961 110.306 118.045 110.381 118.145C110.457 118.246 110.511 118.361 110.539 118.483C110.567 118.606 110.569 118.733 110.546 118.856C110.522 118.98 110.472 119.097 110.401 119.2C110.263 119.377 110.07 119.503 109.852 119.558C109.635 119.612 109.405 119.592 109.201 119.5C107.719 118.648 106.141 117.977 104.501 117.5C102.864 117.097 101.185 116.896 99.5005 116.9C97.7805 116.852 96.0626 117.055 94.4005 117.5C92.7596 117.977 91.1817 118.648 89.7005 119.5C89.5381 119.553 89.3632 119.552 89.2013 119.498C89.0393 119.444 88.8989 119.339 88.8005 119.2C88.7581 119.061 88.7543 118.913 88.7895 118.772C88.8247 118.631 88.8977 118.503 89.0005 118.4Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M166.3 119.5C164.784 118.648 163.173 117.976 161.5 117.5C159.871 117.06 158.187 116.858 156.5 116.9C154.816 116.896 153.136 117.097 151.5 117.5C149.853 117.959 148.273 118.631 146.8 119.5C146.57 119.589 146.317 119.598 146.081 119.525C145.845 119.452 145.641 119.303 145.5 119.1C145.388 118.899 145.356 118.663 145.412 118.44C145.467 118.217 145.607 118.024 145.8 117.9C148.97 115.815 152.709 114.767 156.5 114.9C160.233 115.036 163.845 116.252 166.9 118.4C167.037 118.5 167.133 118.647 167.17 118.812C167.206 118.978 167.182 119.151 167.1 119.3C166.998 119.403 166.869 119.476 166.728 119.511C166.587 119.546 166.439 119.542 166.3 119.5Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M155.4 123.099C157.168 123.099 158.6 121.667 158.6 119.899C158.6 118.132 157.168 116.699 155.4 116.699C153.633 116.699 152.2 118.132 152.2 119.899C152.2 121.667 153.633 123.099 155.4 123.099Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M100.1 123.099C101.868 123.099 103.3 121.667 103.3 119.899C103.3 118.132 101.868 116.699 100.1 116.699C98.3331 116.699 96.9004 118.132 96.9004 119.899C96.9004 121.667 98.3331 123.099 100.1 123.099Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M126.5 80.8005C130.5 80.8005 134.4 82.3005 137.7 81.4005C141 80.5005 144.3 77.2005 147.4 75.7005C150.5 74.2005 155.3 74.1005 158.3 72.8005C161.3 71.5005 166 68.6005 169 70.8005C172 73.0005 170.2 75.4005 170.6 78.1005C171 80.8005 173.1 82.3005 173.5 85.0005C173.9 87.7005 172.2 89.9005 173 92.5005C173.8 95.1005 176.4 96.0005 177.7 98.3005C179 100.6 178.2 102.9 179.4 104.4C180.6 105.9 183.5 106.1 184.9 107.5C186.3 108.9 186.8 111.7 188.3 112.8C189.8 113.9 192.3 113.3 193.9 114.2C194.958 108.926 195.026 103.5 194.1 98.2005C193.3 93.3005 189.9 88.3005 187.6 82.5005C185.3 76.7005 184.8 71.6005 181.2 66.8005C177.6 62.0005 172.7 59.9005 168 56.2005C163.3 52.5005 160.7 48.8005 156.5 46.9005C152.3 45.0005 146.4 45.2005 141.9 44.4005C137.4 43.6005 131.7 41.0005 127.4 41.1005C119.7 41.3005 114.5 44.6005 113.2 45.0005C111.9 45.4005 106 44.9005 99.5005 48.2005C96.0005 50.1005 93.1005 54.2005 89.0005 57.5005C84.9005 60.8005 80.9005 61.9005 77.8005 65.8005C74.7005 69.7005 74.2005 74.1005 72.0005 78.6005C70.5005 81.4005 67.5005 83.5005 66.5005 86.3005C65.5005 89.1005 66.7005 92.9005 66.2005 95.7005C65.7005 98.5005 63.2005 101.8 63.1005 104.6C63.0005 107.4 64.5005 110.7 64.7005 113C66.3005 111.7 68.3005 111.8 70.0005 110.1C71.7005 108.4 71.5005 105.6 73.0005 103.7C74.5005 101.8 77.3005 101.2 78.4005 99.2005C79.5005 97.2005 78.5005 94.4005 79.3005 92.2005C80.1005 90.0005 82.4005 89.4005 82.7005 87.9005C83.0005 86.4005 81.3005 84.0005 81.4005 82.5005C81.5005 81.0005 83.7005 79.2005 84.0005 77.7005C84.3005 76.2005 83.3005 73.6005 84.7005 72.4005C86.1005 71.2005 91.0005 72.4005 95.2005 74.0005C99.4005 75.6005 102.2 74.8005 105.9 76.3005C109.6 77.8005 111.8 80.8005 115.6 81.6005C119.4 82.4005 122.7 80.8005 126.5 80.8005Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M188.101 104.301L184.501 120.101C184.084 121.967 184.201 123.914 184.837 125.717C185.474 127.521 186.605 129.109 188.101 130.301C188.101 130.301 191.701 120.801 192.501 116.301C193.301 111.801 188.101 104.301 188.101 104.301Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M67.3004 104.301L70.6004 120.101C71.0512 121.94 70.9813 123.868 70.3985 125.669C69.8157 127.471 68.7429 129.074 67.3004 130.301C67.3004 130.301 63.9004 120.801 63.1004 116.301C62.3004 111.801 67.3004 104.301 67.3004 104.301Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M116.8 148.1C118.746 146.917 121.047 146.457 123.3 146.8L125 147.3L126.3 147.9C127.114 148.115 127.961 148.182 128.8 148.1L131.5 147.1C132.501 146.604 133.586 146.299 134.7 146.2C136.902 146.023 139.111 146.437 141.1 147.4C141.2 147.498 141.268 147.624 141.296 147.761C141.324 147.898 141.31 148.04 141.256 148.169C141.202 148.299 141.111 148.409 140.994 148.485C140.877 148.562 140.739 148.602 140.6 148.6C138.773 147.954 136.82 147.749 134.9 148C133.993 148.114 133.113 148.385 132.3 148.8C131.305 149.293 130.267 149.695 129.2 150C128.035 150.236 126.83 150.167 125.7 149.8L124.1 149.1L122.9 148.7C121.047 148.35 119.133 148.559 117.4 149.3C117.227 149.365 117.036 149.36 116.867 149.285C116.699 149.21 116.567 149.072 116.5 148.9C116.454 148.752 116.459 148.594 116.513 148.449C116.568 148.304 116.668 148.182 116.8 148.1Z\" fill=\"%23745949\"/%3E%3Cpath d=\"M121.7 116.701C122.493 118.396 123.097 120.174 123.5 122.001C123.833 123.882 123.967 125.792 123.9 127.701C123.815 131.463 122.783 135.143 120.9 138.401C120.859 138.49 120.798 138.57 120.724 138.634C120.649 138.699 120.562 138.747 120.468 138.775C120.373 138.803 120.274 138.811 120.176 138.799C120.078 138.786 119.984 138.753 119.9 138.701C119.761 138.603 119.657 138.462 119.603 138.3C119.549 138.139 119.548 137.964 119.6 137.801C120.313 136.197 120.85 134.521 121.2 132.801C121.63 131.1 121.864 129.355 121.9 127.601C122.003 125.862 121.902 124.117 121.6 122.401C121.366 120.666 120.964 118.958 120.4 117.301C120.351 117.211 120.323 117.111 120.317 117.008C120.311 116.905 120.327 116.803 120.366 116.707C120.404 116.612 120.463 116.526 120.538 116.456C120.613 116.386 120.703 116.333 120.8 116.301C120.974 116.258 121.156 116.274 121.319 116.346C121.482 116.419 121.616 116.544 121.7 116.701Z\" fill=\"%23745949\"/%3E%3Cpath d=\"M145.6 167.199C139.8 166.899 137.4 163.899 132.1 164.099C131.2 164.099 128 165.799 128 165.799C128 165.799 124.8 164.099 123.9 164.099C118.6 163.899 116.2 166.899 110.4 167.199C109.034 167.337 107.657 167.303 106.3 167.099C107.3 168.299 115 177.299 128 177.299C141 177.299 148.7 168.299 149.7 167.099C148.343 167.303 146.965 167.337 145.6 167.199Z\" fill=\"%23745949\"/%3E%3Cpath d=\"M149.7 167.101L145.4 166.401C138.9 165.101 136.4 163.601 132.1 164.101C130.765 164.225 129.454 164.528 128.2 165.001C126.828 164.459 125.374 164.154 123.9 164.101C119.5 163.701 117 165.301 110.5 166.501L106.3 167.101C113.393 169.62 120.873 170.872 128.4 170.801C135.66 170.806 142.867 169.554 149.7 167.101Z\" fill=\"%234E3B31\"/%3E%3Cpath d=\"M104.2 164.901C107.96 166.588 111.879 167.894 115.9 168.801C119.868 169.716 123.927 170.185 128 170.201C132.106 170.102 136.192 169.6 140.2 168.701C142.2 168.201 144.1 167.701 146.1 167.001C148.1 166.301 149.9 165.501 151.8 164.601C151.945 164.535 152.112 164.529 152.262 164.585C152.412 164.642 152.533 164.755 152.6 164.901C152.666 165.047 152.672 165.213 152.615 165.363C152.559 165.513 152.445 165.635 152.3 165.701C148.692 167.913 144.785 169.597 140.7 170.701C136.558 171.819 132.289 172.39 128 172.401C125.893 172.417 123.787 172.284 121.7 172.001C119.565 171.814 117.454 171.412 115.4 170.801C111.286 169.733 107.346 168.083 103.7 165.901C103.624 165.873 103.555 165.826 103.501 165.766C103.447 165.705 103.409 165.632 103.389 165.554C103.369 165.475 103.369 165.393 103.388 165.314C103.408 165.235 103.446 165.162 103.5 165.101C103.511 165.025 103.544 164.954 103.595 164.896C103.645 164.839 103.712 164.797 103.785 164.776C103.859 164.755 103.937 164.755 104.011 164.778C104.084 164.8 104.15 164.843 104.2 164.901Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M97.3005 166.101C97.0179 165.434 96.8807 164.715 96.8979 163.99C96.9152 163.266 97.0865 162.554 97.4005 161.901C97.6544 161.218 98.0415 160.592 98.5394 160.06C99.0372 159.528 99.6358 159.1 100.3 158.801C100.5 158.701 100.7 158.801 100.8 159.101C100.9 159.401 100.8 159.301 100.8 159.401C100.148 160.404 99.6117 161.478 99.2005 162.601C98.8048 163.66 98.5689 164.773 98.5005 165.901C98.4436 166.043 98.3474 166.165 98.2234 166.253C98.0994 166.342 97.9527 166.393 97.8005 166.401C97.6077 166.353 97.4337 166.249 97.3005 166.101Z\" fill=\"%23745949\"/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"128\" y1=\"241.091\" x2=\"128\" y2=\"170.801\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%239B7661\"/%3E%3Cstop offset=\"0.43\" stop-color=\"%23997460\"/%3E%3Cstop offset=\"0.64\" stop-color=\"%23916F5B\"/%3E%3Cstop offset=\"0.79\" stop-color=\"%23856553\"/%3E%3Cstop offset=\"0.92\" stop-color=\"%23735747\"/%3E%3Cstop offset=\"1\" stop-color=\"%23624A3D\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint1_linear\" x1=\"60.0329\" y1=\"130.501\" x2=\"87.0229\" y2=\"130.501\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%239B7661\"/%3E%3Cstop offset=\"0.45\" stop-color=\"%23846452\"/%3E%3Cstop offset=\"1\" stop-color=\"%23624A3D\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint2_linear\" x1=\"169.767\" y1=\"130.425\" x2=\"196.757\" y2=\"130.425\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23624A3D\"/%3E%3Cstop offset=\"0.55\" stop-color=\"%23846452\"/%3E%3Cstop offset=\"1\" stop-color=\"%239B7661\"/%3E%3C/linearGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Helena.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::52e75a3fc6a25024df32086a9e187794>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"257\" viewBox=\"0 0 256 257\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256.9C198.692 256.9 256 199.593 256 128.9C256 58.2079 198.692 0.900391 128 0.900391C57.3075 0.900391 0 58.2079 0 128.9C0 199.593 57.3075 256.9 128 256.9Z\" fill=\"%2357D9A3\"/%3E%3Cpath d=\"M238.4 200.4C236.2 219.5 219 231.2 210.3 237.1C172.1 263.1 126.6 252.2 120.5 250.6C106.258 246.883 92.8067 240.615 80.8 232.1C71.4 228.4 55.5 220.4 44.3 204C18 165.3 32.8 101 66.3 85.6998C78.2 80.1998 94.8 84.4998 128 93.0998C189.3 109 195.3 124.4 196.3 128.3C197.583 133.996 198.452 139.778 198.9 145.6C199.9 158 197.9 158.6 199.5 162.2C204.7 173.6 225.4 167 234.9 179.7C240.1 186.8 238.9 195.8 238.4 200.4Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M169 214L130 212L90.8998 214C90.1614 214.096 89.4484 214.334 88.7998 214.7L57.2998 235.6C78.6053 249.712 103.645 257.129 129.199 256.897C154.753 256.665 179.654 248.796 200.7 234.3L171.1 214.7C170.464 214.306 169.745 214.067 169 214Z\" fill=\"%23ABF5D1\"/%3E%3Cpath d=\"M166.7 215.401C165.8 216.601 150.8 236.801 126.2 234.901C106.2 233.301 94.9998 218.401 93.2998 216.001C95.8877 211.224 97.6779 206.056 98.5998 200.701C100.003 192.701 99.5238 184.484 97.1998 176.701H159.6C156.735 184.428 156.385 192.863 158.6 200.801C160.149 206.223 162.92 211.217 166.7 215.401Z\" fill=\"url(%23paint1_linear)\"/%3E%3Cpath d=\"M198.8 163.901L199 138.001L199.4 86.8008L57.5002 82.3008L57.2002 163.901H198.8Z\" fill=\"%23F0D0B6\"/%3E%3Cpath d=\"M118.901 143.6C152.756 143.6 180.201 116.155 180.201 82.3C180.201 48.4449 152.756 21 118.901 21C85.0455 21 57.6006 48.4449 57.6006 82.3C57.6006 116.155 85.0455 143.6 118.901 143.6Z\" fill=\"%23F0D0B6\"/%3E%3Cpath d=\"M81.5006 126.101C81.5006 132.401 80.2006 144.501 73.9006 144.501C67.6006 144.501 58.6006 132.401 58.6006 126.101C58.8674 123.249 60.1891 120.599 62.3068 118.67C64.4246 116.741 67.186 115.672 70.0506 115.672C72.9151 115.672 75.6766 116.741 77.7943 118.67C79.9121 120.599 81.2338 123.249 81.5006 126.101Z\" fill=\"%23473630\"/%3E%3Cpath d=\"M197.4 126.101C197.4 132.401 188.5 144.501 182.1 144.501C175.7 144.501 174.5 132.401 174.5 126.101C174.767 123.249 176.088 120.599 178.206 118.67C180.324 116.741 183.085 115.672 185.95 115.672C188.815 115.672 191.576 116.741 193.694 118.67C195.812 120.599 197.133 123.249 197.4 126.101Z\" fill=\"%23473630\"/%3E%3Cpath d=\"M187.301 137.501C187.222 139.915 186.679 142.292 185.701 144.501C182.812 151.04 178.859 157.055 174.001 162.301L160.101 176.501C152.066 184.854 141.085 189.735 129.501 190.101H127.301C115.549 189.833 104.376 184.947 96.2005 176.501L85.2005 165.201C78.866 159.396 73.7941 152.35 70.3005 144.501C69.3224 142.292 68.7792 139.915 68.7005 137.501L66.8005 82.5005C66.7152 80.4364 66.9858 78.3729 67.6005 76.4006C71.5366 63.4065 79.5589 52.0286 90.4759 43.9566C101.393 35.8846 114.622 31.5492 128.199 31.5941C141.776 31.639 154.977 36.0619 165.84 44.206C176.704 52.35 184.65 63.7808 188.501 76.8006C189.084 78.6066 189.321 80.5065 189.201 82.4006L187.301 137.501Z\" fill=\"%23533E37\"/%3E%3Cpath d=\"M199.1 82.3C196.3 61.6 177.4 44.5 162 44.5C151 44.5 141.2 50.1 134.4 57.7C138 69 143.5 75.3 147.6 78.9C159.7 89.6 172.3 87.3 181.3 98.3C186.5 104.6 187.8 112 188.2 116.7C190.6 113.9 201.5 100.3 199.1 82.3Z\" fill=\"url(%23paint2_linear)\"/%3E%3Cpath d=\"M115.6 103.1C113.211 101.881 110.647 101.038 108 100.6C105.401 100.085 102.744 99.9169 100.1 100.1C97.4879 100.295 94.9228 100.902 92.5004 101.9C90.0052 102.877 87.728 104.338 85.8004 106.2H85.7004C85.6164 106.288 85.5155 106.357 85.4038 106.405C85.2921 106.453 85.1719 106.477 85.0504 106.477C84.9289 106.477 84.8087 106.453 84.697 106.405C84.5853 106.357 84.4844 106.288 84.4004 106.2C84.2862 106.062 84.2156 105.893 84.1978 105.715C84.18 105.537 84.2157 105.358 84.3004 105.2C85.046 103.837 86.028 102.618 87.2004 101.6C88.3329 100.525 89.6124 99.6155 91.0004 98.8999C92.3258 98.139 93.7353 97.5349 95.2004 97.0999C96.6966 96.6141 98.2376 96.2791 99.8004 96.0999C102.863 95.8469 105.947 96.1518 108.9 96.9999C110.35 97.4778 111.755 98.0801 113.1 98.7999C114.48 99.5633 115.729 100.542 116.8 101.7C116.882 101.79 116.944 101.897 116.984 102.012C117.023 102.128 117.038 102.25 117.029 102.371C117.02 102.493 116.986 102.611 116.929 102.719C116.873 102.827 116.795 102.923 116.7 103C116.563 103.114 116.394 103.185 116.216 103.202C116.038 103.22 115.858 103.185 115.7 103.1H115.6Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M138.5 101.699C140.697 99.5154 143.417 97.9316 146.4 97.0995C149.349 96.2199 152.432 95.8811 155.5 96.0995C158.62 96.384 161.649 97.3028 164.4 98.7995C165.735 99.551 166.977 100.457 168.1 101.499C169.309 102.509 170.325 103.729 171.1 105.099C171.189 105.33 171.198 105.583 171.125 105.819C171.053 106.054 170.903 106.259 170.7 106.399C170.507 106.481 170.297 106.514 170.088 106.497C169.879 106.479 169.678 106.412 169.5 106.299C167.535 104.512 165.266 103.089 162.8 102.099C161.586 101.55 160.31 101.147 159 100.899C157.767 100.513 156.491 100.277 155.2 100.199C152.562 99.9338 149.898 100.069 147.3 100.599C144.657 101.103 142.098 101.978 139.7 103.199H139.6C139.373 103.309 139.113 103.329 138.872 103.255C138.631 103.18 138.427 103.018 138.3 102.799C138.205 102.62 138.173 102.414 138.209 102.215C138.245 102.015 138.348 101.833 138.5 101.699Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M118.9 20.9004C102.616 20.9004 86.9984 27.3693 75.4836 38.884C63.9689 50.3988 57.5 66.0161 57.5 82.3004C57.5758 87.5984 58.2807 92.8687 59.6 98.0004C61.2993 104.037 64.1146 109.701 67.9 114.7C68.4175 111.206 69.606 107.844 71.4 104.8C83.7 84.2004 116.3 93.4004 143.2 75.2004C150.5 70.3004 160 61.6004 167.7 45.1004C161.981 37.5784 154.601 31.4802 146.136 27.2823C137.67 23.0843 128.349 20.9001 118.9 20.9004Z\" fill=\"%23F0D0B6\"/%3E%3Cpath d=\"M141.5 115.401C142.658 112.931 144.542 110.872 146.9 109.501C149.273 108.081 152.061 107.516 154.8 107.901C157.47 108.377 159.979 109.511 162.1 111.201L165.2 113.301C165.582 113.628 166.03 113.868 166.513 114.006C166.996 114.144 167.503 114.177 168 114.101H168.1C168.298 114.07 168.5 114.115 168.667 114.226C168.834 114.337 168.953 114.507 169 114.701C169.037 114.86 169.018 115.027 168.945 115.173C168.872 115.319 168.75 115.435 168.6 115.501C167.854 115.868 166.997 115.939 166.2 115.701C165.521 115.559 164.876 115.287 164.3 114.901L161 112.801C159.104 111.317 156.872 110.321 154.5 109.901C152.197 109.603 149.857 110.022 147.8 111.101C146.786 111.686 145.846 112.391 145 113.201C144.206 114.085 143.471 115.02 142.8 116.001C142.748 116.094 142.678 116.175 142.595 116.24C142.511 116.306 142.415 116.354 142.313 116.382C142.211 116.409 142.104 116.417 141.999 116.403C141.893 116.389 141.792 116.355 141.7 116.301C141.578 116.19 141.493 116.044 141.458 115.883C141.422 115.722 141.437 115.553 141.5 115.401Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M153.4 115.4C155.168 115.4 156.6 113.967 156.6 112.2C156.6 110.433 155.168 109 153.4 109C151.633 109 150.2 110.433 150.2 112.2C150.2 113.967 151.633 115.4 153.4 115.4Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M110.901 115.901C110.274 114.89 109.499 113.98 108.601 113.201C107.351 111.965 105.839 111.027 104.177 110.456C102.515 109.884 100.746 109.695 99.0006 109.901C97.8176 110.034 96.6669 110.372 95.6006 110.901C94.4837 111.368 93.4125 111.937 92.4006 112.601L89.1006 114.701C88.5099 115.037 87.868 115.274 87.2006 115.401C86.4774 115.621 85.7008 115.585 85.0006 115.301C84.9314 115.28 84.8677 115.244 84.8139 115.195C84.76 115.147 84.7174 115.087 84.6889 115.02C84.6603 114.954 84.6466 114.882 84.6486 114.81C84.6507 114.737 84.6684 114.666 84.7006 114.601C84.7622 114.504 84.8556 114.431 84.965 114.394C85.0743 114.358 85.1929 114.36 85.3006 114.401H85.4006C86.4006 114.701 87.4006 114.201 88.5006 113.601L91.5006 111.301C93.5781 109.583 96.0538 108.414 98.7006 107.901C101.439 107.516 104.228 108.081 106.601 109.501C108.888 110.944 110.698 113.032 111.801 115.501C111.835 115.625 111.834 115.756 111.799 115.879C111.763 116.003 111.695 116.114 111.601 116.201C111.55 116.235 111.492 116.257 111.432 116.265C111.371 116.273 111.309 116.268 111.252 116.248C111.194 116.229 111.141 116.197 111.097 116.154C111.054 116.111 111.021 116.059 111.001 116.001L110.901 115.901Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M100.1 115.4C101.868 115.4 103.3 113.967 103.3 112.2C103.3 110.433 101.868 109 100.1 109C98.3331 109 96.9004 110.433 96.9004 112.2C96.9004 113.967 98.3331 115.4 100.1 115.4Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M143.1 158.901C137.3 158.501 134.8 155.501 129.5 155.701C128.7 155.701 125.4 157.401 125.4 157.401C125.4 157.401 122.2 155.701 121.3 155.701C116.1 155.501 113.6 158.501 107.8 158.901C106.43 158.963 105.058 158.896 103.7 158.701C104.1 159.301 111.8 170.201 125.4 170.201C139 170.201 146.7 159.301 147.2 158.701C145.842 158.892 144.47 158.959 143.1 158.901Z\" fill=\"%238C715D\"/%3E%3Cpath d=\"M147.2 158.701C145.842 158.892 144.47 158.959 143.1 158.901C137.3 158.501 134.8 155.501 129.5 155.701C128.7 155.701 125.4 157.401 125.4 157.401C125.4 157.401 122.2 155.701 121.3 155.701C116.1 155.501 113.6 158.501 107.8 158.901C106.43 158.963 105.058 158.896 103.7 158.701C110.796 161.21 118.274 162.462 125.8 162.401C133.092 162.396 140.33 161.144 147.2 158.701Z\" fill=\"%2372594B\"/%3E%3Cpath d=\"M101.7 156.5C105.417 158.234 109.305 159.574 113.3 160.5C121.308 162.302 129.623 162.233 137.6 160.3C139.608 159.886 141.58 159.318 143.5 158.6L149.2 156.2C149.272 156.167 149.35 156.148 149.43 156.145C149.509 156.142 149.588 156.155 149.663 156.183C149.737 156.211 149.805 156.253 149.863 156.308C149.921 156.362 149.968 156.427 150 156.5C150.042 156.639 150.046 156.787 150.011 156.928C149.976 157.069 149.903 157.197 149.8 157.3C140.632 162.961 129.756 165.193 119.1 163.6C116.968 163.394 114.859 162.992 112.8 162.4C108.686 161.332 104.747 159.682 101.1 157.5C101.024 157.472 100.956 157.425 100.902 157.365C100.848 157.304 100.809 157.231 100.789 157.153C100.77 157.074 100.769 156.992 100.789 156.913C100.808 156.834 100.846 156.761 100.9 156.7C101.003 156.597 101.131 156.524 101.272 156.489C101.413 156.454 101.561 156.458 101.7 156.5Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M121.4 113.1C122.662 116.728 123.238 120.56 123.1 124.4C123.014 126.315 122.78 128.221 122.4 130.1C121.999 131.948 121.43 133.755 120.7 135.5C120.668 135.597 120.615 135.687 120.545 135.762C120.475 135.837 120.389 135.896 120.293 135.934C120.198 135.973 120.095 135.989 119.993 135.983C119.89 135.977 119.79 135.949 119.7 135.9C119.55 135.834 119.428 135.718 119.355 135.572C119.282 135.426 119.262 135.259 119.3 135.1C119.795 133.322 120.195 131.52 120.5 129.7C120.847 127.919 121.048 126.113 121.1 124.3C121.183 122.497 121.116 120.691 120.9 118.9C120.705 117.117 120.405 115.347 120 113.6C119.969 113.508 119.958 113.411 119.967 113.314C119.976 113.218 120.005 113.125 120.052 113.04C120.099 112.955 120.163 112.882 120.24 112.823C120.317 112.764 120.406 112.722 120.5 112.7C120.673 112.656 120.855 112.672 121.018 112.745C121.182 112.817 121.316 112.942 121.4 113.1Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M119.2 139.701C120.392 139.894 121.563 140.196 122.7 140.601L124.4 141.001L126 141.401C127.116 141.367 128.224 141.199 129.3 140.901L132.6 139.901C132.673 139.867 132.751 139.848 132.83 139.846C132.909 139.843 132.989 139.855 133.063 139.883C133.138 139.911 133.206 139.954 133.264 140.008C133.322 140.063 133.368 140.128 133.4 140.201C133.454 140.261 133.492 140.334 133.512 140.413C133.531 140.492 133.531 140.575 133.511 140.653C133.491 140.732 133.453 140.805 133.399 140.865C133.345 140.926 133.276 140.972 133.2 141.001C132.142 141.706 131 142.277 129.8 142.701C128.541 143.109 127.224 143.312 125.9 143.301C125.216 143.284 124.539 143.149 123.9 142.901L122.1 142.401L118.8 140.901C118.4 140.801 118.3 140.401 118.5 140.001C118.522 139.931 118.558 139.868 118.606 139.814C118.655 139.76 118.715 139.717 118.781 139.689C118.848 139.66 118.92 139.647 118.992 139.649C119.064 139.651 119.136 139.668 119.2 139.701Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M129.5 74.1996C119.361 77.2439 108.878 78.9912 98.2997 79.3996C90.3997 79.5996 85.6997 78.9996 78.3997 80.6996C70.7427 82.6122 63.6048 86.1982 57.4997 91.1996C56.8878 85.3333 57.0897 79.4106 58.0997 73.5996C59.7768 62.3822 64.494 51.8382 71.7394 43.112C78.9848 34.3857 88.4818 27.8104 99.1997 24.0996L129.5 74.1996Z\" fill=\"url(%23paint3_linear)\"/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"134.84\" y1=\"254.22\" x2=\"134.84\" y2=\"83.2598\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23CEA28B\"/%3E%3Cstop offset=\"0.16\" stop-color=\"%23DDB69E\"/%3E%3Cstop offset=\"0.36\" stop-color=\"%23EBC9B0\"/%3E%3Cstop offset=\"0.49\" stop-color=\"%23F0D0B6\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint1_linear\" x1=\"129.98\" y1=\"235.011\" x2=\"129.98\" y2=\"176.741\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23533E37\"/%3E%3Cstop offset=\"0.43\" stop-color=\"%23503B34\"/%3E%3Cstop offset=\"0.75\" stop-color=\"%2347312B\"/%3E%3Cstop offset=\"1\" stop-color=\"%233B241E\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint2_linear\" x1=\"134.38\" y1=\"80.6\" x2=\"199.41\" y2=\"80.6\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23CEA28B\"/%3E%3Cstop offset=\"0.32\" stop-color=\"%23DDB69E\"/%3E%3Cstop offset=\"0.72\" stop-color=\"%23EBC9B0\"/%3E%3Cstop offset=\"1\" stop-color=\"%23F0D0B6\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint3_linear\" x1=\"57.1397\" y1=\"57.6496\" x2=\"129.47\" y2=\"57.6496\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23CEA28B\"/%3E%3Cstop offset=\"0.15\" stop-color=\"%23DDB69E\"/%3E%3Cstop offset=\"0.33\" stop-color=\"%23EBC9B0\"/%3E%3Cstop offset=\"0.46\" stop-color=\"%23F0D0B6\"/%3E%3C/linearGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Ivan.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::6c3e5da5ad6d41784c30cf81caecffc4>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"257\" viewBox=\"0 0 256 257\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256.9C198.692 256.9 256 199.593 256 128.9C256 58.2079 198.692 0.900391 128 0.900391C57.3075 0.900391 0 58.2079 0 128.9C0 199.593 57.3075 256.9 128 256.9Z\" fill=\"%230065FF\"/%3E%3Cpath d=\"M216.2 222.301C204.6 215.901 176.5 200.301 175.8 200.301L128.6 198.201L81.4 200.301C80.7 200.301 52.6 215.901 41 222.301C64 243.701 94.8 256.901 128.7 256.901C162.6 256.901 193.3 243.701 216.2 222.301Z\" fill=\"%230049B0\"/%3E%3Cpath d=\"M163.6 166.4C163.4 170.4 163.3 190.2 165.2 198.2C166 201.4 169.7 202.6 172.8 204.6C172.8 204.6 173.3 205.9 173.3 207.3C173.3 213.1 153.4 225.2 129.1 225.9C102.6 226.6 80.4998 213.4 80.2998 207.3C80.2998 205.9 80.6998 204.6 80.6998 204.6C83.7998 202.6 87.5998 201.4 88.3998 198.2C90.3998 190.2 90.1998 170.4 89.9998 166.4H163.6Z\" fill=\"%23C67B55\"/%3E%3Cpath d=\"M201.8 114.301C203.8 120.301 197.4 136.201 191.4 138.201C185.4 140.201 182 127.501 180 121.501C178 115.501 181.3 109.001 187.3 107.001C193.3 105.001 199.8 108.301 201.8 114.301Z\" fill=\"%23C67B55\"/%3E%3Cpath d=\"M54.2004 115.3C52.7004 121.5 60.4004 136.7 66.6004 138.2C72.8004 139.7 75.1004 126.8 76.6004 120.6C78.1004 114.4 74.3004 108.2 68.1004 106.8C61.9004 105.3 55.7004 109.1 54.2004 115.3Z\" fill=\"%23C67B55\"/%3E%3Cpath d=\"M182.9 56.2004C163.1 30.2004 129.5 33.6004 123.9 34.2004C120.5 34.5004 81.4004 39.1004 68.2004 71.5004C67.3004 73.6004 63.5004 83.6004 63.9004 95.2004C63.2004 103.2 65.0004 110.1 65.6004 112.4C65.6004 112.5 65.6004 112.5 65.6004 112.5C65.6004 112.5 65.6004 112.5 65.6004 112.6C66.8004 116.8 66.8004 122.4 66.8004 122.4C66.9004 129.6 66.6004 135.8 66.5004 138.2C69.2004 153.1 79.5004 164.8 90.1004 174.1C100.6 183.4 111.4 188.3 125.7 188.7C141.6 189.2 151.8 184.8 162 176.3C177.3 163.6 188.6 145.9 188.4 137.9C188.4 135.7 187.6 129.3 189.6 120.8C190.9 115 192.9 108.3 192.9 108.1C197.7 91.7004 194.4 71.3004 182.9 56.2004Z\" fill=\"%23D8885B\"/%3E%3Cpath d=\"M123.9 34.2009C120.5 34.5009 81.4004 39.1009 68.2004 71.5009C67.3004 73.6009 63.5004 83.6009 63.9004 95.2009C63.2004 103.201 65.0004 110.101 65.6004 112.401C65.6004 112.501 65.6004 112.501 65.6004 112.501C65.6004 112.501 65.6004 112.501 65.6004 112.601C65.9004 113.801 66.2004 115.101 66.4004 116.401C69.8004 114.101 73.2004 109.801 74.9004 105.601C78.9004 95.7009 72.7004 87.9009 78.2004 78.9009C80.6004 75.0009 83.9004 73.0009 85.2004 72.2009C96.3004 65.5009 106.9 73.8009 125.2 75.9009C151.8 78.8009 164.5 64.9009 175.7 74.3009C181.5 79.1009 183.3 87.2009 183.6 88.2009C186 99.1009 179.5 105.301 183.6 113.901C184.7 116.201 186.9 119.501 189.5 121.201C189.5 121.001 189.6 120.801 189.6 120.701C190.9 114.901 192.9 108.201 192.9 108.001C197.7 91.6009 194.4 71.2009 182.9 56.1009C163.1 30.3009 129.5 33.7009 123.9 34.2009Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M190.1 34.0008C189.9 33.5008 188.7 31.3008 186.4 30.7008C182 29.6008 178.7 36.0008 172.1 38.4008C165.4 40.9008 159.5 37.6008 150.8 34.9008C147 33.7008 123.4 26.5008 106.1 33.4008C97.3995 36.8008 88.3995 44.5008 85.8995 52.4008C85.2995 54.4008 85.0995 56.3008 85.3995 58.2008C85.9995 61.5008 87.9995 68.8008 95.9995 69.9008C103.8 70.4008 113.5 75.5008 125.8 76.7008C139.7 78.1008 149.8 75.3008 157.9 73.5008C167.1 71.5008 175.4 66.7008 181 59.7008C181.6 59.0008 182.1 58.3008 182.5 57.6008C184.9 54.1008 184.7 51.6008 184.3 49.2008C188.5 43.2008 191.6 37.0008 190.1 34.0008Z\" fill=\"%23D8885B\"/%3E%3Cpath d=\"M190.1 34.0008C189.9 33.5008 188.7 31.3008 186.4 30.7008C182 29.6008 178.7 36.0008 172.1 38.4008C165.4 40.9008 159.5 37.6008 150.8 34.9008C147 33.7008 123.4 26.5008 106.1 33.4008C97.3995 36.8008 88.3995 44.5008 85.8995 52.4008C85.2995 54.4008 85.0995 56.3008 85.3995 58.2008C85.9995 61.5008 87.9995 68.8008 95.9995 69.9008C103.8 70.4008 113.5 75.5008 125.8 76.7008C139.7 78.1008 149.8 75.3008 157.9 73.5008C167.1 71.5008 175.4 66.7008 181 59.7008C181.6 59.0008 182.1 58.3008 182.5 57.6008C184.9 54.1008 184.7 51.6008 184.3 49.2008C188.5 43.2008 191.6 37.0008 190.1 34.0008Z\" fill=\"url(%23paint1_linear)\"/%3E%3Cpath opacity=\"0.35\" d=\"M144.2 160.4C138.9 159.2 135.4 157.6 131.5 158.5C131.2 158.6 131.1 158.6 130.7 158.7C128.5 159.4 126.2 159.4 124.1 158.7C123.7 158.6 123.6 158.6 123.3 158.5C119.5 157.6 116.2 158.9 110.8 160.2C109.7 160.5 107.9 160.9 105.7 161.3C106.1 161.9 113.8 172.2 127.4 172.2C141 172.3 148.7 161.9 149.1 161.3C147 161 145.3 160.6 144.2 160.4Z\" fill=\"%236A330D\"/%3E%3Cpath d=\"M103.6 159.501C107.4 161.101 111.3 162.401 115.3 163.301C119.3 164.101 123.4 164.601 127.4 164.501C131.5 164.501 135.5 164.001 139.5 163.101C141.5 162.701 143.5 162.101 145.4 161.501C147.4 160.901 149.3 160.101 151.1 159.301C151.4 159.201 151.7 159.301 151.9 159.601C152 159.901 151.9 160.201 151.7 160.301C148.1 162.401 144.1 164.001 140 165.101C135.9 166.101 131.7 166.701 127.4 166.701C125.3 166.701 123.2 166.601 121.1 166.301C119 166.001 116.9 165.701 114.9 165.101C110.8 164.101 106.8 162.501 103.1 160.501C102.8 160.301 102.7 160.001 102.9 159.701C103 159.401 103.3 159.301 103.6 159.501Z\" fill=\"%23172B4D\"/%3E%3Cg opacity=\"0.64\"%3E%3Cpath opacity=\"0.64\" d=\"M123.6 109.301C123.7 109.601 123.8 109.901 123.9 110.001C123.9 110.201 124 110.401 124 110.501C124.1 110.801 124.1 111.101 124.2 111.401C124.3 112.001 124.3 112.601 124.4 113.201C124.5 114.401 124.5 115.601 124.5 116.801C124.5 118.001 124.4 119.201 124.1 120.501C123.9 121.701 123.5 123.001 122.8 124.201C122.5 124.701 121.9 124.801 121.4 124.501C121 124.201 120.8 123.701 121 123.301V123.201C121.3 122.301 121.5 121.201 121.7 120.101C121.8 119.001 121.9 117.901 121.9 116.701C121.9 115.601 121.9 114.401 121.9 113.301C121.9 112.701 121.9 112.201 121.8 111.601C121.8 111.301 121.8 111.001 121.7 110.801C121.7 110.701 121.7 110.501 121.7 110.401C121.7 110.201 121.7 110.301 121.7 110.301C121.4 109.801 121.6 109.101 122.1 108.801C122.7 108.601 123.3 108.801 123.6 109.301Z\" fill=\"%238E572A\"/%3E%3C/g%3E%3Cpath d=\"M113.9 103.199C113.6 102.999 113.1 102.699 112.6 102.499C112.1 102.299 111.7 101.999 111.2 101.799C110.2 101.399 109.2 100.999 108.2 100.699C106.2 99.9995 104 99.6995 101.9 99.4995C99.6998 99.2995 97.5998 99.3995 95.4998 99.7995C93.3998 100.199 91.1998 100.899 89.1998 101.799C88.6998 101.999 88.0998 101.799 87.8998 101.299C87.6998 100.899 87.7998 100.399 88.1998 100.099C90.0998 98.5995 92.2998 97.3995 94.6998 96.5995C97.0998 95.7995 99.5998 95.3995 102.1 95.4995C104.6 95.4995 107.1 95.8995 109.5 96.6995C110.7 97.0995 111.9 97.5995 113 98.1995C113.6 98.4995 114.1 98.8995 114.6 99.1995C115.1 99.5995 115.6 99.8995 116.2 100.499C116.9 101.199 116.9 102.299 116.2 102.999C115.6 103.599 114.7 103.699 114.1 103.299L113.9 103.199Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M140.2 100.5C140.8 99.8996 141.3 99.5996 141.8 99.1996C142.3 98.7996 142.9 98.4996 143.5 98.1996C144.7 97.5996 145.9 97.0996 147.1 96.6996C149.6 95.8996 152.2 95.5996 154.7 95.5996C157.3 95.5996 159.9 95.9996 162.3 96.8996C164.7 97.7996 167 98.9996 168.9 100.6C169.3 101 169.4 101.6 169 102C168.7 102.4 168.2 102.5 167.8 102.3C165.7 101.3 163.6 100.5 161.4 99.9996C159.2 99.4996 157 99.3996 154.8 99.4996C152.6 99.6996 150.4 99.9996 148.3 100.7C147.2 101 146.2 101.4 145.2 101.8C144.7 102 144.2 102.2 143.7 102.5C143.2 102.7 142.7 103 142.4 103.2L142.2 103.3C141.4 103.8 140.3 103.5 139.8 102.7C139.5 102 139.7 101.1 140.2 100.5Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M90.6005 110.201C93.6005 108.101 97.3005 106.801 101 106.701C104.7 106.501 108.6 107.601 111.7 109.601C112.1 109.901 112.2 110.501 112 110.901C111.7 111.301 111.2 111.401 110.8 111.201C109.3 110.401 107.7 109.701 106.1 109.301C104.5 108.801 102.8 108.601 101.1 108.601C99.4005 108.601 97.7005 108.801 96.1005 109.301C94.5005 109.801 92.8005 110.401 91.3005 111.201C91.0005 111.401 90.6005 111.301 90.5005 111.001C90.2005 110.701 90.3005 110.401 90.6005 110.201Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M165.8 111.201C164.3 110.401 162.7 109.701 161 109.301C159.3 108.901 157.7 108.601 156 108.601C154.3 108.601 152.6 108.801 151 109.301C149.4 109.701 147.8 110.401 146.3 111.201C145.9 111.401 145.3 111.301 145 110.801C144.8 110.401 144.9 109.801 145.3 109.601C148.4 107.501 152.2 106.501 156 106.701C159.8 106.801 163.4 108.101 166.4 110.201C166.7 110.401 166.7 110.801 166.5 111.101C166.4 111.301 166.1 111.401 165.8 111.201Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M154.9 114.201C156.668 114.201 158.1 112.768 158.1 111.001C158.1 109.233 156.668 107.801 154.9 107.801C153.133 107.801 151.7 109.233 151.7 111.001C151.7 112.768 153.133 114.201 154.9 114.201Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M101.6 114.201C103.368 114.201 104.8 112.768 104.8 111.001C104.8 109.233 103.368 107.801 101.6 107.801C99.8331 107.801 98.4004 109.233 98.4004 111.001C98.4004 112.768 99.8331 114.201 101.6 114.201Z\" fill=\"%23172B4D\"/%3E%3Cg opacity=\"0.64\"%3E%3Cpath opacity=\"0.64\" d=\"M117 139.601C118.6 138.601 120.7 138.101 122.7 138.401C123.2 138.501 123.8 138.701 124.2 138.901C124.7 139.101 125 139.301 125.3 139.401C125.9 139.601 126.7 139.701 127.4 139.501C128.1 139.401 128.8 139.001 129.7 138.701C130.6 138.301 131.6 138.101 132.6 138.001C134.6 137.801 136.6 138.301 138.2 139.101C138.6 139.301 138.7 139.701 138.5 140.101C138.3 140.401 137.9 140.601 137.6 140.501C136 140.001 134.3 139.801 132.8 140.001C132 140.101 131.3 140.401 130.5 140.701C129.7 141.001 128.9 141.501 127.8 141.701C126.7 141.901 125.6 141.901 124.6 141.501C124.1 141.301 123.6 141.101 123.3 140.901C123 140.701 122.7 140.601 122.3 140.501C120.8 140.201 119.2 140.401 117.6 140.901C117.2 141.001 116.8 140.801 116.6 140.401C116.6 140.101 116.8 139.801 117 139.601Z\" fill=\"%238E572A\"/%3E%3C/g%3E%3Cg opacity=\"0.32\"%3E%3Cpath opacity=\"0.32\" d=\"M117.6 178.3C119 177.2 120.7 176.5 122.4 176C124.1 175.5 125.9 175.4 127.7 175.4C129.5 175.5 131.2 175.7 132.9 176.2C134.6 176.7 136.2 177.4 137.7 178.3C138.1 178.5 138.2 179 137.9 179.4C137.7 179.7 137.4 179.8 137.1 179.7C135.5 179.4 133.9 179.1 132.3 178.9C130.7 178.7 129.2 178.6 127.6 178.6C126 178.6 124.5 178.7 123 178.9C121.5 179.1 120 179.4 118.4 179.9C117.9 180 117.4 179.8 117.2 179.3C117.1 178.9 117.3 178.5 117.6 178.3Z\" fill=\"%238E572A\"/%3E%3C/g%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"129.892\" y1=\"62.2019\" x2=\"128.828\" y2=\"136.099\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop offset=\"0.0914864\" stop-color=\"%23091E42\"/%3E%3Cstop offset=\"1\" stop-color=\"%23091E42\" stop-opacity=\"0\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint1_linear\" x1=\"87.2065\" y1=\"62.674\" x2=\"190.204\" y2=\"40.7858\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop offset=\"0.0914864\" stop-color=\"%23091E42\"/%3E%3Cstop offset=\"0.618\" stop-color=\"%234B362F\"/%3E%3Cstop offset=\"1\" stop-color=\"%237D4921\"/%3E%3C/linearGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Katina.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::d7842744cca617bcb58e22e7521d8577>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"257\" viewBox=\"0 0 256 257\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256.9C198.692 256.9 256 199.593 256 128.9C256 58.2079 198.692 0.900391 128 0.900391C57.3075 0.900391 0 58.2079 0 128.9C0 199.593 57.3075 256.9 128 256.9Z\" fill=\"%236554C0\"/%3E%3Cpath d=\"M87.2998 192L176.8 193.4L175.1 210.6L88.6998 210.1L87.2998 192Z\" fill=\"%235243AA\"/%3E%3Cpath d=\"M126.399 74.3008C143.52 74.3008 157.399 60.4216 157.399 43.3008C157.399 26.18 143.52 12.3008 126.399 12.3008C109.279 12.3008 95.3994 26.18 95.3994 43.3008C95.3994 60.4216 109.279 74.3008 126.399 74.3008Z\" fill=\"%23572000\"/%3E%3Cpath d=\"M192.9 97.4008C192.9 64.5008 164.3 37.8008 128.9 37.8008C93.5 37.8008 65 64.5008 65 97.4008V110.501C65 143.401 93.6 170.101 128.9 170.101C164.2 170.101 192.9 143.401 192.9 110.501V97.4008Z\" fill=\"%236A330D\"/%3E%3Cpath d=\"M205.7 230.602L172.8 208.802C172.151 208.436 171.438 208.198 170.7 208.102L131.6 206.102L92.5998 208.102C91.8548 208.168 91.1357 208.408 90.4998 208.802L55.0998 232.202L53.7998 233.202C76.0778 249.046 102.843 257.342 130.177 256.874C157.511 256.406 183.977 247.199 205.7 230.602Z\" fill=\"%235243AA\"/%3E%3Cpath d=\"M159 220.002L132.1 249.402L102.7 219.302C100.492 217.055 99.0807 214.147 98.6833 211.022C98.2859 207.898 98.9241 204.729 100.5 202.002C101.875 199.679 102.855 197.145 103.4 194.502C106.2 180.702 97.1 170.302 96 169.102L163.4 166.602C162.1 168.602 155 179.902 158.6 193.802C159.23 196.071 160.137 198.254 161.3 200.302C163.012 203.417 163.71 206.988 163.298 210.519C162.886 214.05 161.383 217.364 159 220.002Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M77.3 141.202C84.9215 141.202 91.1 135.023 91.1 127.402C91.1 119.78 84.9215 113.602 77.3 113.602C69.6785 113.602 63.5 119.78 63.5 127.402C63.5 135.023 69.6785 141.202 77.3 141.202Z\" fill=\"url(%23paint1_linear)\"/%3E%3Cpath d=\"M84.9999 165.101C80.9415 165.102 77.0253 163.607 73.9999 160.901C72.3634 159.491 71.0317 157.761 70.0861 155.818C69.1404 153.875 68.6007 151.76 68.4999 149.601C68.3581 147.43 68.6474 145.251 69.351 143.192C70.0547 141.132 71.1588 139.232 72.5999 137.601C73.0508 137.098 73.6833 136.793 74.3585 136.756C75.0336 136.718 75.696 136.951 76.1999 137.401C76.7038 137.852 77.008 138.485 77.0455 139.16C77.083 139.835 76.8508 140.498 76.3999 141.001C75.3912 142.124 74.6154 143.436 74.1176 144.861C73.6197 146.285 73.4098 147.795 73.4999 149.301C73.7312 152.34 75.1287 155.17 77.3999 157.201C78.5092 158.315 79.835 159.189 81.2952 159.769C82.7555 160.35 84.3193 160.626 85.8901 160.578C87.4609 160.531 89.0054 160.163 90.4282 159.495C91.8511 158.828 93.122 157.876 94.1627 156.699C95.2034 155.521 95.9916 154.143 96.4788 152.649C96.966 151.155 97.1418 149.577 96.9954 148.012C96.8489 146.447 96.3833 144.929 95.6273 143.551C94.8713 142.174 93.841 140.966 92.5999 140.001C92.1142 139.561 91.821 138.947 91.7836 138.292C91.7462 137.638 91.9675 136.995 92.3999 136.501C92.6194 136.246 92.8881 136.038 93.1901 135.889C93.4921 135.74 93.8211 135.653 94.1573 135.635C94.4935 135.616 94.83 135.665 95.1466 135.78C95.4633 135.895 95.7535 136.072 95.9999 136.301C98.4912 138.529 100.247 141.461 101.036 144.708C101.824 147.956 101.608 151.367 100.416 154.489C99.2232 157.611 97.1108 160.297 94.358 162.192C91.6053 164.087 88.3419 165.102 84.9999 165.101Z\" fill=\"%235243AA\"/%3E%3Cpath d=\"M179.3 141.202C186.922 141.202 193.1 135.023 193.1 127.402C193.1 119.78 186.922 113.602 179.3 113.602C171.678 113.602 165.5 119.78 165.5 127.402C165.5 135.023 171.678 141.202 179.3 141.202Z\" fill=\"url(%23paint2_linear)\"/%3E%3Cpath d=\"M172.6 165.101C170.264 165.097 167.955 164.606 165.82 163.659C163.685 162.712 161.771 161.33 160.2 159.601C157.319 156.315 155.851 152.026 156.113 147.664C156.375 143.302 158.347 139.219 161.6 136.301C161.846 136.072 162.136 135.895 162.453 135.78C162.77 135.665 163.106 135.616 163.442 135.635C163.779 135.653 164.107 135.74 164.409 135.889C164.711 136.038 164.98 136.246 165.2 136.501C165.632 136.995 165.853 137.638 165.816 138.292C165.779 138.947 165.485 139.561 165 140.001C162.936 142.073 161.738 144.852 161.65 147.775C161.563 150.697 162.592 153.544 164.528 155.735C166.464 157.926 169.162 159.297 172.074 159.569C174.985 159.842 177.891 158.995 180.2 157.201C181.332 156.208 182.252 154.996 182.905 153.639C183.558 152.281 183.93 150.806 184 149.301C184.103 147.802 183.909 146.296 183.429 144.872C182.948 143.447 182.191 142.132 181.2 141.001C180.97 140.755 180.793 140.465 180.678 140.148C180.564 139.832 180.514 139.495 180.533 139.159C180.552 138.823 180.638 138.494 180.787 138.192C180.936 137.89 181.144 137.621 181.4 137.401C181.893 136.969 182.536 136.748 183.191 136.785C183.845 136.823 184.459 137.116 184.9 137.601C186.354 139.228 187.473 141.124 188.194 143.183C188.915 145.243 189.223 147.423 189.1 149.601C188.976 151.755 188.427 153.863 187.483 155.803C186.538 157.743 185.219 159.476 183.6 160.901C180.565 163.591 176.655 165.083 172.6 165.101Z\" fill=\"%235243AA\"/%3E%3Cpath d=\"M184.2 122.201C183 151.801 159.3 185.801 128.5 185.801C97.6996 185.801 73.9996 151.801 72.7996 122.201C71.4996 89.5012 85.8996 52.7012 128.5 52.7012C171.1 52.7012 185.5 89.5012 184.2 122.201Z\" fill=\"%23FFE2D9\"/%3E%3Cpath d=\"M171.1 110.002C168.578 108.287 165.899 106.813 163.1 105.602C160.313 104.443 157.318 103.864 154.3 103.902C148.272 104.033 142.504 106.383 138.1 110.502C137.9 110.672 137.641 110.757 137.38 110.738C137.118 110.72 136.874 110.599 136.7 110.402C136.545 110.22 136.46 109.99 136.46 109.752C136.46 109.513 136.545 109.283 136.7 109.102C138.984 106.695 141.742 104.788 144.8 103.502C147.82 102.279 151.042 101.634 154.3 101.602C157.592 101.707 160.84 102.383 163.9 103.602C166.973 104.802 169.619 106.891 171.5 109.602C171.515 109.743 171.48 109.884 171.4 110.002H171.1Z\" fill=\"%236A330D\"/%3E%3Cpath d=\"M81.4998 109.602C83.3215 106.876 85.9411 104.781 88.9998 103.602C92.0596 102.383 95.308 101.707 98.5998 101.602C101.891 101.624 105.148 102.269 108.2 103.502C111.228 104.79 113.953 106.698 116.2 109.102C116.383 109.288 116.486 109.54 116.486 109.802C116.486 110.063 116.383 110.315 116.2 110.502C115.996 110.648 115.751 110.727 115.5 110.727C115.249 110.727 115.004 110.648 114.8 110.502C112.638 108.426 110.09 106.795 107.3 105.702C104.542 104.549 101.588 103.938 98.5998 103.902C95.5814 103.864 92.5871 104.443 89.7998 105.602C87.0113 106.835 84.3347 108.307 81.7998 110.002H81.4998C81.4735 110.002 81.4475 109.996 81.4233 109.986C81.399 109.976 81.377 109.962 81.3584 109.943C81.3398 109.924 81.3251 109.902 81.315 109.878C81.305 109.854 81.2998 109.828 81.2998 109.802C81.2998 109.775 81.305 109.749 81.315 109.725C81.3251 109.701 81.3398 109.679 81.3584 109.66C81.377 109.642 81.399 109.627 81.4233 109.617C81.4475 109.607 81.4735 109.602 81.4998 109.602Z\" fill=\"%236A330D\"/%3E%3Cpath d=\"M102.1 119.401C103.812 119.401 105.2 118.013 105.2 116.301C105.2 114.589 103.812 113.201 102.1 113.201C100.388 113.201 99 114.589 99 116.301C99 118.013 100.388 119.401 102.1 119.401Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M88.5998 117.1C88.9937 117.287 89.4268 117.375 89.8621 117.357C90.2974 117.34 90.7221 117.218 91.0998 117C91.187 116.99 91.2698 116.957 91.34 116.904C91.4102 116.851 91.4654 116.781 91.4998 116.7H91.6998L91.9998 116.4L93.2998 115.2C95.1887 113.786 97.3791 112.828 99.6998 112.4C102.038 111.966 104.448 112.138 106.7 112.9C108.915 113.624 110.91 114.897 112.5 116.6C112.69 116.804 112.795 117.072 112.795 117.35C112.795 117.629 112.69 117.897 112.5 118.1C112.296 118.247 112.051 118.326 111.8 118.326C111.549 118.326 111.304 118.247 111.1 118.1C108.898 116.05 106.062 114.813 103.061 114.595C100.06 114.377 97.0751 115.19 94.5998 116.9L93.3998 117.9L93.0998 118.1L92.6998 118.4L91.6998 118.9C91.0453 119.122 90.333 119.103 89.6913 118.847C89.0496 118.59 88.5207 118.113 88.1998 117.5C88.1828 117.475 88.1719 117.446 88.1678 117.416C88.1637 117.386 88.1666 117.355 88.1763 117.326C88.1859 117.297 88.2021 117.271 88.2235 117.249C88.2449 117.227 88.271 117.21 88.2998 117.2C88.3998 117.1 88.4998 117.1 88.4998 117.2L88.5998 117.1Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M151.9 119.401C153.612 119.401 155 118.013 155 116.301C155 114.589 153.612 113.201 151.9 113.201C150.188 113.201 148.8 114.589 148.8 116.301C148.8 118.013 150.188 119.401 151.9 119.401Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M165.8 117.902C165.479 118.514 164.95 118.991 164.309 119.248C163.667 119.505 162.955 119.524 162.3 119.302L161.3 118.902L160.9 118.502L160.6 118.302C160.247 117.916 159.843 117.579 159.4 117.302C157.756 116.164 155.876 115.412 153.9 115.102C151.962 114.785 149.977 114.922 148.1 115.502C146.165 116.102 144.388 117.127 142.9 118.502C142.692 118.651 142.438 118.722 142.182 118.704C141.927 118.686 141.685 118.579 141.5 118.402C141.412 118.318 141.343 118.217 141.295 118.105C141.247 117.993 141.223 117.873 141.223 117.752C141.223 117.63 141.247 117.51 141.295 117.398C141.343 117.287 141.412 117.186 141.5 117.102C143.074 115.31 145.118 113.994 147.4 113.302C149.628 112.588 151.993 112.417 154.3 112.802C156.632 113.192 158.831 114.154 160.7 115.602L162 116.802L162.3 117.102C162.4 117.102 162.4 117.202 162.5 117.302L163 117.602C163.394 117.775 163.82 117.865 164.25 117.865C164.681 117.865 165.106 117.775 165.5 117.602C165.526 117.585 165.554 117.574 165.585 117.57C165.615 117.566 165.646 117.568 165.675 117.578C165.704 117.588 165.73 117.604 165.752 117.625C165.774 117.647 165.79 117.673 165.8 117.702C165.9 117.802 165.9 117.902 165.8 117.902Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M129.1 38.7012C98.0002 38.7012 72.2002 64.5012 66.7002 98.7012H191.4C185.9 64.5012 160.1 38.7012 129.1 38.7012Z\" fill=\"%236A330D\"/%3E%3Cpath d=\"M144 159.401C139.35 161.844 134.15 163.049 128.9 162.901C119.4 162.501 109.8 157.301 109.8 157.301L115 154.901C117.6 153.601 120.7 153.901 123.7 155.701L124.7 156.201C125.828 156.884 127.118 157.254 128.436 157.271C129.755 157.289 131.054 156.954 132.2 156.301C133.338 155.699 134.619 155.418 135.905 155.489C137.191 155.559 138.434 155.978 139.5 156.701L144 159.401Z\" fill=\"%23FF7143\"/%3E%3Cpath d=\"M144 159.401C144 159.401 140.8 170.101 129.7 170.101C118.6 170.101 109.8 157.301 109.8 157.301C114.6 159.801 121.5 162.601 128.9 162.901C134.155 163.096 139.367 161.888 144 159.401Z\" fill=\"%23FF8A63\"/%3E%3Cpath d=\"M108.5 156.5C111.339 158.044 114.364 159.22 117.5 160C119.08 160.397 120.683 160.697 122.3 160.9C123.847 161.22 125.421 161.387 127 161.4C130.202 161.602 133.417 161.502 136.6 161.1C139.812 160.718 142.988 160.083 146.1 159.2C146.193 159.166 146.296 159.167 146.389 159.204C146.481 159.241 146.557 159.311 146.6 159.4C146.6 159.6 146.6 159.8 146.4 159.9C143.392 161.347 140.193 162.357 136.9 162.9C130.284 164.042 123.49 163.562 117.1 161.5C113.902 160.509 110.894 158.988 108.2 157C108.1 156.9 108 156.7 108.1 156.6C108.2 156.5 108.4 156.4 108.5 156.5Z\" fill=\"%237A4F2C\"/%3E%3Cpath d=\"M122.5 114.701C123.069 116.055 123.504 117.462 123.8 118.901C124.065 120.355 124.232 121.825 124.3 123.301C124.296 124.773 124.196 126.243 124 127.701C123.809 129.131 123.474 130.539 123 131.901C122.98 132.008 122.936 132.108 122.871 132.195C122.806 132.282 122.721 132.352 122.624 132.4C122.527 132.449 122.42 132.474 122.312 132.474C122.204 132.475 122.097 132.449 122 132.401C121.816 132.336 121.657 132.214 121.549 132.051C121.441 131.889 121.389 131.696 121.4 131.501C121.6 130.101 121.8 128.801 121.9 127.401C122.034 126.039 122.068 124.668 122 123.301C121.999 121.962 121.899 120.625 121.7 119.301C121.5 117.901 121.2 116.601 120.9 115.201C120.886 115.096 120.893 114.989 120.92 114.887C120.948 114.784 120.996 114.688 121.061 114.605C121.126 114.521 121.207 114.451 121.3 114.399C121.392 114.347 121.494 114.314 121.6 114.301C121.773 114.258 121.955 114.274 122.118 114.346C122.281 114.419 122.416 114.544 122.5 114.701Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M119.1 141.401C120.289 140.649 121.702 140.331 123.1 140.501L124.3 140.901L125 141.201H126.2C126.714 141.081 127.216 140.914 127.7 140.701C128.32 140.386 129.004 140.215 129.7 140.201C131.049 140.096 132.401 140.374 133.6 141.001C133.692 141.053 133.773 141.123 133.839 141.207C133.904 141.29 133.952 141.386 133.98 141.489C134.008 141.591 134.015 141.698 134.001 141.803C133.988 141.908 133.953 142.01 133.9 142.101C133.867 142.174 133.821 142.239 133.763 142.294C133.705 142.348 133.637 142.391 133.562 142.419C133.488 142.447 133.409 142.46 133.329 142.457C133.25 142.454 133.172 142.435 133.1 142.401C132.063 142.088 130.967 142.02 129.9 142.201L128.5 142.701C127.904 143.027 127.264 143.263 126.6 143.401C125.837 143.568 125.045 143.534 124.3 143.301L123.3 142.901L122.7 142.601C121.731 142.425 120.734 142.494 119.8 142.801C119.601 142.865 119.385 142.849 119.198 142.755C119.011 142.662 118.868 142.499 118.8 142.301C118.747 142.139 118.748 141.964 118.802 141.802C118.856 141.64 118.96 141.5 119.1 141.401Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M189.399 83.9004C197.199 105.6 194.999 114.2 191.399 118C190.099 119.4 187.899 120.8 185.999 124.3C182.499 130.3 182.799 136.8 182.899 138.7C183.299 144.3 184.699 144.3 184.699 148.3C184.699 152.3 181.099 156 178.399 161.5C175.699 167 175.299 173.7 176.399 179.8C176.099 178.1 174.099 175.9 173.499 174.1C172.694 171.878 172.189 169.557 171.999 167.2C171.599 162.5 172.799 158 174.399 153.6C175.999 149.2 174.799 145.7 174.099 141.1C173.399 136.5 174.799 133.4 175.499 129.6C176.799 122.9 174.399 116.8 170.699 111.3C168.699 106.9 167.099 99.9004 169.399 89.1004L189.399 83.9004Z\" fill=\"%236A330D\"/%3E%3Cpath d=\"M68.2997 83.9004C60.4997 105.6 62.6997 114.2 66.2997 118C67.5997 119.4 69.7997 120.8 71.6997 124.3C75.1997 130.3 74.8997 136.8 74.7997 138.7C74.3997 144.3 72.9997 144.3 72.9997 148.3C72.9997 152.3 76.5997 156 79.2997 161.5C81.9997 167 82.3997 173.7 81.2997 179.8C81.5997 178.1 83.5997 175.9 84.1997 174.1C85.0053 171.878 85.5098 169.557 85.6997 167.2C86.0997 162.5 84.8997 158 83.2997 153.6C81.6997 149.2 82.8997 145.7 83.5997 141.1C84.2997 136.5 82.8997 133.4 82.1997 129.6C80.8997 122.9 83.2997 116.8 86.9997 111.3C88.9997 106.9 90.5997 99.9004 88.2997 89.1004L68.2997 83.9004Z\" fill=\"%236A330D\"/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"129.73\" y1=\"168.222\" x2=\"129.73\" y2=\"248.962\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23EBBEAE\"/%3E%3Cstop offset=\"0.64\" stop-color=\"%23FFE2D9\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint1_linear\" x1=\"63.57\" y1=\"127.412\" x2=\"91.11\" y2=\"127.412\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23FFE2D9\"/%3E%3Cstop offset=\"1\" stop-color=\"%23EBBEAE\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint2_linear\" x1=\"165.5\" y1=\"127.412\" x2=\"193.04\" y2=\"127.412\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23EBBEAE\"/%3E%3Cstop offset=\"1\" stop-color=\"%23FFE2D9\"/%3E%3C/linearGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Lara.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::f74b41b54afd447990a77fe575921337>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"257\" viewBox=\"0 0 256 257\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256.9C198.692 256.9 256 199.593 256 128.9C256 58.2079 198.692 0.900391 128 0.900391C57.3075 0.900391 0 58.2079 0 128.9C0 199.593 57.3075 256.9 128 256.9Z\" fill=\"%23FF5630\"/%3E%3Cpath d=\"M126.399 74.3008C143.52 74.3008 157.399 60.4216 157.399 43.3008C157.399 26.18 143.52 12.3008 126.399 12.3008C109.279 12.3008 95.3994 26.18 95.3994 43.3008C95.3994 60.4216 109.279 74.3008 126.399 74.3008Z\" fill=\"%23091E42\"/%3E%3Cpath d=\"M205.8 230.7L172.8 208.8C172.151 208.434 171.438 208.196 170.7 208.1L131.6 206.1L92.5998 208.1C91.8548 208.166 91.1357 208.406 90.4998 208.8L55.0998 232.2L53.7998 233.1C76.072 248.981 102.843 257.316 130.194 256.884C157.545 256.452 184.04 247.276 205.8 230.7Z\" fill=\"%23DE350B\"/%3E%3Cpath d=\"M205.8 230.7L172.8 208.8C172.151 208.434 171.438 208.196 170.7 208.1L131.6 206.1L92.5998 208.1C91.8548 208.166 91.1357 208.406 90.4998 208.8L55.0998 232.2L53.7998 233.1C76.072 248.981 102.843 257.316 130.194 256.884C157.545 256.452 184.04 247.276 205.8 230.7Z\" fill=\"%23FF7452\"/%3E%3Cpath d=\"M107.4 244.001C122.919 244.001 135.5 231.42 135.5 215.901C135.5 200.382 122.919 187.801 107.4 187.801C91.8806 187.801 79.2998 200.382 79.2998 215.901C79.2998 231.42 91.8806 244.001 107.4 244.001Z\" fill=\"%23FFBDAD\"/%3E%3Cpath d=\"M155.9 243.7C171.419 243.7 184 231.119 184 215.6C184 200.081 171.419 187.5 155.9 187.5C140.381 187.5 127.8 200.081 127.8 215.6C127.8 231.119 140.381 243.7 155.9 243.7Z\" fill=\"%23FFBDAD\"/%3E%3Cpath d=\"M192.9 101.201C192.9 66.2008 164.3 37.8008 128.9 37.8008C93.5 37.8008 65 66.2008 65 101.201V115.101C65 150.101 93.6 178.501 128.9 178.501C164.2 178.501 192.9 150.101 192.9 115.101V101.201Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M168.299 209.802C167.299 211.202 152.399 230.602 127.799 228.902C107.299 227.602 95.6994 212.702 93.8994 210.402C98.7843 206.338 102.136 200.729 103.399 194.502C106.199 180.702 97.0994 170.302 95.9994 169.102L163.399 166.602C162.099 168.602 154.999 179.902 158.599 193.802C160.283 199.933 163.642 205.474 168.299 209.802Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M77.3 141.202C84.9215 141.202 91.1 135.023 91.1 127.402C91.1 119.78 84.9215 113.602 77.3 113.602C69.6785 113.602 63.5 119.78 63.5 127.402C63.5 135.023 69.6785 141.202 77.3 141.202Z\" fill=\"url(%23paint1_linear)\"/%3E%3Cpath d=\"M84.9999 165.101C80.9415 165.102 77.0253 163.607 73.9999 160.901C72.3634 159.491 71.0317 157.761 70.0861 155.818C69.1404 153.875 68.6007 151.76 68.4999 149.601C68.3581 147.43 68.6474 145.251 69.351 143.192C70.0547 141.132 71.1588 139.232 72.5999 137.601C73.0508 137.098 73.6833 136.793 74.3585 136.756C75.0336 136.718 75.696 136.951 76.1999 137.401C76.7038 137.852 77.008 138.485 77.0455 139.16C77.083 139.835 76.8508 140.498 76.3999 141.001C75.3912 142.124 74.6154 143.436 74.1176 144.861C73.6197 146.285 73.4098 147.795 73.4999 149.301C73.7312 152.34 75.1287 155.17 77.3999 157.201C78.5092 158.315 79.835 159.189 81.2952 159.769C82.7555 160.35 84.3193 160.626 85.8901 160.578C87.4609 160.531 89.0054 160.163 90.4282 159.495C91.8511 158.828 93.122 157.876 94.1627 156.699C95.2034 155.521 95.9916 154.143 96.4788 152.649C96.966 151.155 97.1418 149.577 96.9954 148.012C96.8489 146.447 96.3833 144.929 95.6273 143.551C94.8713 142.174 93.841 140.966 92.5999 140.001C92.1142 139.561 91.821 138.947 91.7836 138.292C91.7462 137.638 91.9675 136.995 92.3999 136.501C92.6194 136.246 92.8881 136.038 93.1901 135.889C93.4921 135.74 93.8211 135.653 94.1573 135.635C94.4935 135.616 94.83 135.665 95.1466 135.78C95.4633 135.895 95.7535 136.072 95.9999 136.301C98.4912 138.529 100.247 141.461 101.036 144.708C101.824 147.956 101.608 151.367 100.416 154.489C99.2232 157.611 97.1108 160.297 94.358 162.192C91.6053 164.087 88.3419 165.102 84.9999 165.101Z\" fill=\"%23FFBDAD\"/%3E%3Cpath d=\"M179.3 141.202C186.922 141.202 193.1 135.023 193.1 127.402C193.1 119.78 186.922 113.602 179.3 113.602C171.678 113.602 165.5 119.78 165.5 127.402C165.5 135.023 171.678 141.202 179.3 141.202Z\" fill=\"url(%23paint2_linear)\"/%3E%3Cpath d=\"M172.6 165.101C170.264 165.097 167.955 164.606 165.82 163.659C163.685 162.712 161.771 161.33 160.2 159.601C157.319 156.315 155.851 152.026 156.113 147.664C156.375 143.302 158.347 139.219 161.6 136.301C161.846 136.072 162.136 135.895 162.453 135.78C162.77 135.665 163.106 135.616 163.442 135.635C163.779 135.653 164.107 135.74 164.409 135.889C164.711 136.038 164.98 136.246 165.2 136.501C165.632 136.995 165.853 137.638 165.816 138.292C165.779 138.947 165.485 139.561 165 140.001C162.936 142.073 161.738 144.852 161.65 147.775C161.563 150.697 162.592 153.544 164.528 155.735C166.464 157.926 169.162 159.297 172.074 159.569C174.985 159.842 177.891 158.995 180.2 157.201C181.332 156.208 182.252 154.996 182.905 153.639C183.558 152.281 183.93 150.806 184 149.301C184.103 147.802 183.909 146.296 183.429 144.872C182.948 143.447 182.191 142.132 181.2 141.001C180.97 140.755 180.793 140.465 180.678 140.148C180.564 139.832 180.514 139.495 180.533 139.159C180.552 138.823 180.638 138.494 180.787 138.192C180.936 137.89 181.144 137.621 181.4 137.401C181.893 136.969 182.536 136.748 183.191 136.785C183.845 136.823 184.459 137.116 184.9 137.601C186.354 139.228 187.473 141.124 188.194 143.183C188.915 145.243 189.223 147.423 189.1 149.601C188.976 151.755 188.427 153.863 187.483 155.803C186.538 157.743 185.219 159.476 183.6 160.901C180.565 163.591 176.655 165.083 172.6 165.101Z\" fill=\"%23FFBDAD\"/%3E%3Cpath d=\"M184.2 122.201C183 151.801 159.3 185.801 128.5 185.801C97.6996 185.801 73.9996 151.801 72.7996 122.201C71.4996 89.5012 85.8996 52.7012 128.5 52.7012C171.1 52.7012 185.5 89.5012 184.2 122.201Z\" fill=\"%23533E37\"/%3E%3Cpath d=\"M171.1 109.002C168.578 107.287 165.899 105.813 163.1 104.602C158.897 102.965 154.315 102.557 149.889 103.425C145.463 104.293 141.374 106.4 138.1 109.502C137.913 109.685 137.662 109.787 137.4 109.787C137.138 109.787 136.887 109.685 136.7 109.502C136.553 109.298 136.475 109.053 136.475 108.802C136.475 108.55 136.553 108.306 136.7 108.102C138.961 105.693 141.727 103.815 144.8 102.602C147.799 101.3 151.031 100.62 154.3 100.602C157.603 100.692 160.86 101.405 163.9 102.702C166.985 103.83 169.642 105.893 171.5 108.602C171.515 108.743 171.479 108.884 171.4 109.002H171.1Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M81.5003 108.602C83.2968 105.876 85.9283 103.806 89.0003 102.702C92.04 101.405 95.2968 100.692 98.6003 100.602C101.903 100.609 105.169 101.289 108.2 102.602C111.242 103.819 113.974 105.698 116.2 108.102C116.315 108.188 116.41 108.297 116.478 108.423C116.547 108.549 116.588 108.688 116.598 108.831C116.608 108.974 116.587 109.117 116.537 109.251C116.487 109.385 116.409 109.507 116.307 109.609C116.206 109.71 116.084 109.788 115.95 109.838C115.816 109.889 115.672 109.909 115.529 109.899C115.387 109.889 115.247 109.848 115.122 109.78C114.996 109.711 114.886 109.616 114.8 109.502C112.638 107.426 110.09 105.795 107.3 104.702C104.543 103.549 101.589 102.938 98.6003 102.902C95.5867 102.915 92.6022 103.492 89.8003 104.602C87.0118 105.835 84.3352 107.307 81.8003 109.002C81.7003 109.102 81.6003 109.002 81.5003 108.902C81.479 108.883 81.462 108.86 81.4503 108.834C81.4387 108.808 81.4326 108.78 81.4326 108.752C81.4326 108.723 81.4387 108.695 81.4503 108.669C81.462 108.643 81.479 108.62 81.5003 108.602Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M102.1 119.401C103.812 119.401 105.2 118.013 105.2 116.301C105.2 114.589 103.812 113.201 102.1 113.201C100.388 113.201 99 114.589 99 116.301C99 118.013 100.388 119.401 102.1 119.401Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M88.5998 117.1C88.9937 117.287 89.4268 117.375 89.8621 117.357C90.2974 117.34 90.7221 117.218 91.0998 117C91.187 116.99 91.2698 116.957 91.34 116.904C91.4102 116.851 91.4654 116.781 91.4998 116.7H91.6998L91.9998 116.4L93.2998 115.2C95.1887 113.786 97.3791 112.828 99.6998 112.4C102.038 111.966 104.448 112.138 106.7 112.9C108.915 113.624 110.91 114.897 112.5 116.6C112.69 116.804 112.795 117.072 112.795 117.35C112.795 117.629 112.69 117.897 112.5 118.1C112.296 118.247 112.051 118.326 111.8 118.326C111.549 118.326 111.304 118.247 111.1 118.1C108.898 116.05 106.062 114.813 103.061 114.595C100.06 114.377 97.0751 115.19 94.5998 116.9L93.3998 117.9L93.0998 118.1L92.6998 118.4L91.6998 118.9C91.0453 119.122 90.333 119.103 89.6913 118.847C89.0496 118.59 88.5207 118.113 88.1998 117.5C88.1828 117.475 88.1719 117.446 88.1678 117.416C88.1637 117.386 88.1666 117.355 88.1763 117.326C88.1859 117.297 88.2021 117.271 88.2235 117.249C88.2449 117.227 88.271 117.21 88.2998 117.2C88.3998 117.1 88.4998 117.1 88.4998 117.2L88.5998 117.1Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M151.9 119.401C153.612 119.401 155 118.013 155 116.301C155 114.589 153.612 113.201 151.9 113.201C150.188 113.201 148.8 114.589 148.8 116.301C148.8 118.013 150.188 119.401 151.9 119.401Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M165.8 117.902C165.479 118.514 164.95 118.991 164.309 119.248C163.667 119.505 162.955 119.524 162.3 119.302L161.3 118.902L160.9 118.502L160.6 118.302C160.247 117.916 159.843 117.579 159.4 117.302C157.756 116.164 155.876 115.412 153.9 115.102C151.962 114.785 149.977 114.922 148.1 115.502C146.165 116.102 144.388 117.127 142.9 118.502C142.692 118.651 142.438 118.722 142.182 118.704C141.927 118.686 141.685 118.579 141.5 118.402C141.412 118.318 141.343 118.217 141.295 118.105C141.247 117.993 141.223 117.873 141.223 117.752C141.223 117.63 141.247 117.51 141.295 117.398C141.343 117.287 141.412 117.186 141.5 117.102C143.074 115.31 145.118 113.994 147.4 113.302C149.628 112.588 151.993 112.417 154.3 112.802C156.632 113.192 158.831 114.154 160.7 115.602L162 116.802L162.3 117.102C162.4 117.102 162.4 117.202 162.5 117.302L163 117.602C163.394 117.775 163.82 117.865 164.25 117.865C164.681 117.865 165.106 117.775 165.5 117.602C165.526 117.585 165.554 117.574 165.585 117.57C165.615 117.566 165.646 117.568 165.675 117.578C165.704 117.588 165.73 117.604 165.752 117.625C165.774 117.647 165.79 117.673 165.8 117.702C165.9 117.802 165.9 117.902 165.8 117.902Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M129.1 38.7012C98.0002 38.7012 72.2002 64.5012 66.7002 98.7012H191.4C185.9 64.5012 160.1 38.7012 129.1 38.7012Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M122.5 114.701C123.069 116.055 123.504 117.462 123.8 118.901C124.065 120.355 124.232 121.825 124.3 123.301C124.296 124.773 124.196 126.243 124 127.701C123.809 129.131 123.474 130.539 123 131.901C122.98 132.008 122.936 132.108 122.871 132.195C122.806 132.282 122.721 132.352 122.624 132.4C122.527 132.449 122.42 132.474 122.312 132.474C122.204 132.475 122.097 132.449 122 132.401C121.816 132.336 121.657 132.214 121.549 132.051C121.441 131.889 121.389 131.696 121.4 131.501C121.6 130.101 121.8 128.801 121.9 127.401C122.034 126.039 122.068 124.668 122 123.301C121.999 121.962 121.899 120.625 121.7 119.301C121.5 117.901 121.2 116.601 120.9 115.201C120.886 115.096 120.893 114.989 120.92 114.887C120.948 114.784 120.996 114.688 121.061 114.605C121.126 114.521 121.207 114.451 121.3 114.399C121.392 114.347 121.494 114.314 121.6 114.301C121.773 114.258 121.955 114.274 122.118 114.346C122.281 114.419 122.416 114.544 122.5 114.701Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M119.1 141.4C120.289 140.647 121.702 140.329 123.1 140.5L124.3 140.9L125 141.2H126.2C126.714 141.079 127.216 140.912 127.7 140.7C128.32 140.384 129.004 140.213 129.7 140.2C131.049 140.094 132.401 140.372 133.6 141C133.692 141.051 133.773 141.121 133.839 141.205C133.904 141.289 133.952 141.384 133.98 141.487C134.008 141.589 134.015 141.696 134.001 141.801C133.988 141.906 133.953 142.008 133.9 142.1C133.867 142.172 133.821 142.238 133.763 142.292C133.705 142.346 133.637 142.389 133.562 142.417C133.488 142.445 133.409 142.458 133.329 142.455C133.25 142.452 133.172 142.433 133.1 142.4C132.063 142.086 130.967 142.018 129.9 142.2L128.5 142.7C127.904 143.025 127.264 143.261 126.6 143.4C125.837 143.566 125.045 143.532 124.3 143.3L123.3 142.9L122.7 142.6C121.731 142.423 120.734 142.492 119.8 142.8C119.601 142.863 119.385 142.847 119.198 142.753C119.011 142.66 118.868 142.497 118.8 142.3C118.747 142.137 118.748 141.962 118.802 141.8C118.856 141.638 118.96 141.498 119.1 141.4Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M144.7 156.6C138.9 156.2 136.5 153.2 131.2 153.4C130.3 153.4 127.1 155.1 127.1 155.1C127.1 155.1 123.9 153.4 123 153.4C117.7 153.2 115.2 156.2 109.4 156.6C108.064 156.663 106.724 156.596 105.4 156.4C105.8 157 113.5 167.9 127.1 167.9C140.7 167.9 148.4 157 148.8 156.4C147.443 156.595 146.07 156.662 144.7 156.6Z\" fill=\"%238C715D\"/%3E%3Cpath d=\"M148.8 156.4C147.443 156.595 146.07 156.662 144.7 156.6C138.9 156.2 136.5 153.2 131.2 153.4C130.3 153.4 127.1 155.1 127.1 155.1C127.1 155.1 123.9 153.4 123 153.4C117.7 153.2 115.2 156.2 109.4 156.6C108.064 156.663 106.724 156.596 105.4 156.4C112.498 158.912 119.971 160.198 127.5 160.2C134.763 160.131 141.962 158.846 148.8 156.4Z\" fill=\"%2372594B\"/%3E%3Cpath d=\"M103.3 154.201C107.057 155.919 110.977 157.259 115 158.201C118.971 159.088 123.03 159.524 127.1 159.501C131.18 159.507 135.245 159.003 139.2 158.001C141.207 157.587 143.18 157.018 145.1 156.301C147.1 155.601 149 154.801 150.8 154.001C150.861 153.947 150.934 153.909 151.013 153.889C151.091 153.87 151.174 153.87 151.253 153.89C151.331 153.91 151.404 153.948 151.465 154.002C151.525 154.056 151.572 154.125 151.6 154.201C151.654 154.261 151.692 154.334 151.711 154.413C151.73 154.492 151.73 154.574 151.711 154.653C151.691 154.732 151.652 154.805 151.598 154.865C151.544 154.926 151.476 154.972 151.4 155.001C147.792 157.213 143.886 158.897 139.8 160.001C135.673 161.2 131.397 161.806 127.1 161.801C124.957 161.783 122.819 161.616 120.7 161.301C118.599 161.103 116.523 160.702 114.5 160.101C110.386 159.033 106.446 157.383 102.8 155.201C102.727 155.168 102.662 155.122 102.607 155.064C102.553 155.006 102.51 154.938 102.483 154.863C102.455 154.789 102.442 154.71 102.445 154.63C102.448 154.551 102.466 154.473 102.5 154.401C102.602 154.298 102.731 154.225 102.872 154.19C103.013 154.154 103.161 154.158 103.3 154.201Z\" fill=\"%23230F05\"/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"131.119\" y1=\"167.832\" x2=\"131.119\" y2=\"228.732\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%233B241E\"/%3E%3Cstop offset=\"0.25\" stop-color=\"%2347312B\"/%3E%3Cstop offset=\"0.57\" stop-color=\"%23503B34\"/%3E%3Cstop offset=\"1\" stop-color=\"%23533E37\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint1_linear\" x1=\"63.57\" y1=\"127.412\" x2=\"91.11\" y2=\"127.412\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23533E37\"/%3E%3Cstop offset=\"0.43\" stop-color=\"%23503B34\"/%3E%3Cstop offset=\"0.75\" stop-color=\"%2347312B\"/%3E%3Cstop offset=\"1\" stop-color=\"%233B241E\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint2_linear\" x1=\"4733.3\" y1=\"3605.28\" x2=\"5493.41\" y2=\"3605.28\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23533E37\"/%3E%3Cstop offset=\"0.43\" stop-color=\"%23503B34\"/%3E%3Cstop offset=\"0.75\" stop-color=\"%2347312B\"/%3E%3Cstop offset=\"1\" stop-color=\"%233B241E\"/%3E%3C/linearGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Leo.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::f8a88795baf22deeab326f84b891897f>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"257\" viewBox=\"0 0 256 257\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256.9C198.692 256.9 256 199.593 256 128.9C256 58.2079 198.692 0.900391 128 0.900391C57.3075 0.900391 0 58.2079 0 128.9C0 199.593 57.3075 256.9 128 256.9Z\" fill=\"%2300C7E5\"/%3E%3Cpath d=\"M207.3 229.3L178.5 213.2C177.705 212.741 176.816 212.468 175.9 212.4L128 209.9L80.1002 212.4C79.1844 212.468 78.2956 212.741 77.5002 213.2L48.7002 229.3C71.266 247.178 99.2107 256.906 128 256.906C156.79 256.906 184.734 247.178 207.3 229.3Z\" fill=\"%2379E2F2\"/%3E%3Cpath d=\"M173 217.401C172 218.901 153.6 243.301 123.4 240.901C98.9 239.001 85.1 221.001 83 218.201C89.0836 213.63 93.395 207.093 95.2 199.701C98.8 184.101 89 172.201 87.8 170.801H164.4C163.9 171.501 152.6 187.101 159.7 203.201C162.458 209.263 167.131 214.252 173 217.401Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M77.5937 146.506C84.7147 144.705 88.6752 136.082 86.4398 127.248C84.2044 118.414 76.6196 112.713 69.4986 114.515C62.3777 116.317 58.4171 124.939 60.6526 133.773C62.888 142.607 70.4728 148.308 77.5937 146.506Z\" fill=\"url(%23paint1_linear)\"/%3E%3Cpath d=\"M196.074 133.752C198.309 124.918 194.349 116.295 187.228 114.494C180.107 112.692 172.522 118.393 170.287 127.227C168.051 136.061 172.012 144.683 179.133 146.485C186.254 148.287 193.839 142.586 196.074 133.752Z\" fill=\"url(%23paint2_linear)\"/%3E%3Cpath d=\"M127.9 47C155.6 47.2 172.5 65.9 175.1 68.9C192.6 89.1 190.8 113.2 190.4 118.3C189.4 130.7 184.4 140.6 174.7 160.6C170.311 169.804 165.403 178.752 160 187.4C158.46 189.84 156.281 191.811 153.7 193.1C145.689 197.181 136.885 199.467 127.9 199.8C118.882 199.478 110.043 197.192 102 193.1C99.4672 191.78 97.3283 189.813 95.8002 187.4C90.3601 178.756 85.4187 169.808 81.0002 160.6C71.4002 140.6 66.3002 130.7 65.4002 118.3C65.0002 113.2 63.1002 89.1 80.7002 68.9C83.3002 65.9 100.2 47.2 127.9 47Z\" fill=\"%23533E37\"/%3E%3Cpath d=\"M139.4 106.6L140.6 105.6L141.8 104.8C142.6 104.2 143.5 103.8 144.3 103.3C146.01 102.519 147.783 101.883 149.6 101.4C153.259 100.485 157.049 100.214 160.8 100.6C164.556 101.015 168.193 102.17 171.5 104C173.101 104.917 174.608 105.989 176 107.2C177.441 108.441 178.688 109.89 179.7 111.5C179.79 111.636 179.852 111.79 179.88 111.951C179.909 112.112 179.905 112.277 179.867 112.436C179.83 112.595 179.76 112.745 179.663 112.876C179.565 113.008 179.442 113.118 179.3 113.2C179.065 113.344 178.788 113.402 178.515 113.366C178.242 113.329 177.989 113.2 177.8 113H177.7C176.627 111.817 175.379 110.806 174 110C172.656 109.077 171.214 108.306 169.7 107.7C166.752 106.429 163.605 105.685 160.4 105.5C157.208 105.397 154.016 105.7 150.9 106.4C149.334 106.794 147.797 107.295 146.3 107.9L144.2 108.9L143.2 109.4L142.3 110H142C141.548 110.201 141.042 110.244 140.562 110.122C140.083 110 139.658 109.719 139.358 109.326C139.057 108.933 138.898 108.45 138.906 107.956C138.913 107.461 139.088 106.983 139.4 106.6Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M114.8 109.9L113.9 109.3L112.9 108.8L110.8 107.8C109.303 107.195 107.766 106.694 106.2 106.3C103.083 105.605 99.8917 105.303 96.6999 105.4C93.4953 105.585 90.3478 106.33 87.3999 107.6C85.8865 108.206 84.4444 108.978 83.0999 109.9C81.7212 110.706 80.4735 111.718 79.3999 112.9H79.2999C79.1884 113.012 79.056 113.101 78.9101 113.161C78.7642 113.222 78.6079 113.253 78.4499 113.253C78.292 113.253 78.1356 113.222 77.9897 113.161C77.8439 113.101 77.7114 113.012 77.5999 112.9C77.3994 112.711 77.2701 112.459 77.2337 112.186C77.1973 111.912 77.256 111.635 77.3999 111.4C78.4123 109.791 79.6594 108.341 81.0999 107.1C82.474 105.867 83.9837 104.793 85.5999 103.9C88.9069 102.071 92.5437 100.915 96.2999 100.5C100.051 100.115 103.841 100.386 107.5 101.3C109.317 101.784 111.09 102.419 112.8 103.2C113.6 103.7 114.5 104.1 115.3 104.7L116.5 105.5L117.7 106.5C118.013 106.884 118.187 107.361 118.195 107.856C118.202 108.351 118.043 108.834 117.742 109.227C117.442 109.62 117.018 109.9 116.538 110.022C116.059 110.144 115.552 110.101 115.1 109.9H114.8Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M89 118.4C92.055 116.252 95.6678 115.036 99.4 114.9C103.191 114.767 106.931 115.815 110.1 117.9C110.21 117.961 110.305 118.045 110.381 118.145C110.456 118.246 110.51 118.361 110.538 118.483C110.567 118.606 110.569 118.733 110.545 118.856C110.521 118.98 110.472 119.097 110.4 119.2C110.263 119.377 110.07 119.503 109.852 119.558C109.634 119.612 109.405 119.592 109.2 119.5C107.719 118.648 106.141 117.977 104.5 117.5C102.864 117.097 101.185 116.896 99.5 116.9C97.78 116.852 96.0621 117.055 94.4 117.5C92.7591 117.977 91.1812 118.648 89.7 119.5C89.5376 119.553 89.3627 119.552 89.2008 119.498C89.0389 119.444 88.8984 119.339 88.8 119.2C88.7576 119.061 88.7538 118.913 88.789 118.772C88.8243 118.631 88.8972 118.503 89 118.4Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M166.3 119.5C164.784 118.648 163.173 117.976 161.5 117.5C159.871 117.06 158.187 116.858 156.5 116.9C154.815 116.896 153.136 117.097 151.5 117.5C149.853 117.959 148.273 118.631 146.8 119.5C146.57 119.589 146.317 119.598 146.081 119.525C145.845 119.452 145.64 119.303 145.5 119.1C145.387 118.899 145.355 118.663 145.411 118.44C145.467 118.217 145.606 118.024 145.8 117.9C148.969 115.815 152.709 114.767 156.5 114.9C160.232 115.036 163.845 116.252 166.9 118.4C167.037 118.5 167.132 118.647 167.169 118.812C167.206 118.978 167.181 119.151 167.1 119.3C166.997 119.403 166.869 119.476 166.728 119.511C166.587 119.546 166.439 119.542 166.3 119.5Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M155.4 123.099C157.168 123.099 158.6 121.667 158.6 119.899C158.6 118.132 157.168 116.699 155.4 116.699C153.633 116.699 152.2 118.132 152.2 119.899C152.2 121.667 153.633 123.099 155.4 123.099Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M100.1 123.099C101.867 123.099 103.3 121.667 103.3 119.899C103.3 118.132 101.867 116.699 100.1 116.699C98.3326 116.699 96.8999 118.132 96.8999 119.899C96.8999 121.667 98.3326 123.099 100.1 123.099Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M188.1 104.301L184.5 120.101C184.084 121.967 184.2 123.914 184.837 125.717C185.473 127.521 186.604 129.109 188.1 130.301C188.1 130.301 191.7 120.801 192.5 116.301C193.3 111.801 188.1 104.301 188.1 104.301Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M67.2999 104.301L70.5999 120.101C71.0507 121.94 70.9808 123.868 70.398 125.669C69.8152 127.471 68.7424 129.074 67.2999 130.301C67.2999 130.301 63.8999 120.801 63.0999 116.301C62.2999 111.801 67.2999 104.301 67.2999 104.301Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M116.8 148.1C118.747 146.917 121.048 146.457 123.3 146.8L125 147.3L126.3 147.9C127.115 148.115 127.961 148.182 128.8 148.1L131.5 147.1C132.502 146.604 133.587 146.299 134.7 146.2C136.902 146.023 139.112 146.437 141.1 147.4C141.2 147.498 141.268 147.624 141.296 147.761C141.324 147.898 141.31 148.04 141.256 148.169C141.203 148.299 141.111 148.409 140.994 148.485C140.877 148.562 140.74 148.602 140.6 148.6C138.774 147.954 136.821 147.749 134.9 148C133.994 148.114 133.114 148.385 132.3 148.8C131.305 149.293 130.268 149.695 129.2 150C128.036 150.236 126.83 150.167 125.7 149.8L124.1 149.1L122.9 148.7C121.048 148.35 119.133 148.559 117.4 149.3C117.228 149.365 117.036 149.36 116.868 149.285C116.699 149.21 116.567 149.072 116.5 148.9C116.455 148.752 116.46 148.594 116.514 148.449C116.568 148.304 116.669 148.182 116.8 148.1Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M121.7 116.701C122.493 118.396 123.096 120.174 123.5 122.001C123.832 123.882 123.966 125.792 123.9 127.701C123.815 131.463 122.783 135.143 120.9 138.401C120.858 138.49 120.798 138.57 120.723 138.634C120.649 138.699 120.561 138.747 120.467 138.775C120.373 138.803 120.273 138.811 120.176 138.799C120.078 138.786 119.984 138.753 119.9 138.701C119.76 138.603 119.656 138.462 119.602 138.3C119.548 138.139 119.547 137.964 119.6 137.801C120.313 136.197 120.849 134.521 121.2 132.801C121.629 131.1 121.864 129.355 121.9 127.601C122.002 125.862 121.902 124.117 121.6 122.401C121.366 120.666 120.964 118.958 120.4 117.301C120.351 117.211 120.322 117.111 120.316 117.008C120.31 116.905 120.327 116.803 120.365 116.707C120.403 116.612 120.462 116.526 120.537 116.456C120.612 116.386 120.702 116.333 120.8 116.301C120.973 116.258 121.156 116.274 121.319 116.346C121.482 116.419 121.616 116.544 121.7 116.701Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M145.6 167.199C139.8 166.899 137.4 163.899 132.1 164.099C131.2 164.099 128 165.799 128 165.799C128 165.799 124.8 164.099 123.9 164.099C118.6 163.899 116.2 166.899 110.4 167.199C109.034 167.337 107.657 167.303 106.3 167.099C107.3 168.299 115 177.299 128 177.299C141 177.299 148.7 168.299 149.7 167.099C148.343 167.303 146.965 167.337 145.6 167.199Z\" fill=\"%238C715D\"/%3E%3Cpath d=\"M149.7 167.101L145.4 166.401C138.9 165.101 136.4 163.601 132.1 164.101C130.765 164.225 129.454 164.528 128.2 165.001C126.828 164.459 125.374 164.154 123.9 164.101C119.5 163.701 117 165.301 110.5 166.501L106.3 167.101C113.393 169.62 120.873 170.872 128.4 170.801C135.66 170.806 142.867 169.554 149.7 167.101Z\" fill=\"%2372594B\"/%3E%3Cpath d=\"M104.2 164.901C107.96 166.588 111.88 167.894 115.9 168.801C119.869 169.716 123.927 170.185 128 170.201C132.106 170.102 136.193 169.6 140.2 168.701C142.2 168.201 144.1 167.701 146.1 167.001C148.1 166.301 149.9 165.501 151.8 164.601C151.946 164.535 152.112 164.529 152.262 164.585C152.412 164.642 152.534 164.755 152.6 164.901C152.666 165.047 152.672 165.213 152.616 165.363C152.56 165.513 152.446 165.635 152.3 165.701C148.692 167.913 144.786 169.597 140.7 170.701C136.559 171.819 132.289 172.39 128 172.401C125.893 172.417 123.788 172.284 121.7 172.001C119.565 171.814 117.454 171.412 115.4 170.801C111.287 169.733 107.347 168.083 103.7 165.901C103.624 165.873 103.556 165.826 103.502 165.766C103.448 165.705 103.409 165.632 103.389 165.554C103.37 165.475 103.37 165.393 103.389 165.314C103.408 165.235 103.446 165.162 103.5 165.101C103.512 165.025 103.545 164.954 103.595 164.896C103.646 164.839 103.712 164.797 103.786 164.776C103.86 164.755 103.938 164.755 104.011 164.778C104.085 164.8 104.15 164.843 104.2 164.901Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M97.3 166.101C97.0174 165.434 96.8802 164.715 96.8974 163.99C96.9147 163.266 97.086 162.554 97.4 161.901C97.6539 161.218 98.041 160.592 98.5389 160.06C99.0367 159.528 99.6354 159.1 100.3 158.801C100.5 158.701 100.7 158.801 100.8 159.101C100.9 159.401 100.8 159.301 100.8 159.401C100.148 160.404 99.6112 161.478 99.2 162.601C98.8043 163.66 98.5684 164.773 98.5 165.901C98.4431 166.043 98.3469 166.165 98.2229 166.253C98.0989 166.342 97.9522 166.393 97.8 166.401C97.6072 166.353 97.4332 166.249 97.3 166.101Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M128 25.0996C131.7 25.0996 135.3 29.6996 139 29.9996C142.7 30.2996 147 26.1996 150.6 26.7996C154.2 27.3996 157 32.5996 160.5 33.5996C164 34.5996 169.2 31.5996 172.5 32.9996C175.8 34.3996 177.2 40.2996 180.1 42.2996C183 44.2996 189.1 43.5996 191.4 46.2996C193.7 48.9996 192 54.5996 193.3 58.0996C194.6 61.5996 199.5 64.2996 199.5 68.1996C199.5 72.0996 195 73.0996 194.9 75.4996C194.8 77.8996 199.1 80.7996 198.9 83.1996C198.7 85.5996 194 87.7996 193.7 90.0996C193.4 92.3996 197.6 95.6996 197.2 98.0996C196.8 100.5 192 102.3 191.5 104.6C191 106.9 194.9 110.6 194.4 112.8C193.9 115 188.8 116.8 188.2 118.8C186.9 123.1 187.4 128.4 186.9 128.3C186.4 128.2 189.3 120.7 188.5 113.5C188 109.9 182.9 106.6 181.7 102.3C180.5 97.9996 183.3 92.9996 181.4 89.1996C179.5 85.3996 173.6 84.6996 170.8 81.3996C168 78.0996 168.1 72.3996 164.5 69.9996C160.9 67.5996 155.6 69.9996 151.4 68.4996C147.2 66.9996 144.9 61.8996 140.5 61.2996C136.1 60.6996 132.3 64.8996 127.9 64.8996C123.5 64.8996 119 60.6996 115.3 61.2996C111.6 61.8996 108 67.2996 104.4 68.4996C100.8 69.6996 94.5 67.7996 91.3 69.9996C88.1 72.1996 87.6 78.4996 85 81.3996C82.4 84.2996 76.3 85.5996 74.5 89.1996C72.7 92.7996 75.3 98.4996 74.3 102.3C73.3 106.1 67.9 109.9 67.5 113.5C66.6 120.7 69.6 128.2 69.1 128.3C68.6 128.4 69.1 123.1 67.8 118.8C67.2 116.8 62.2 115.5 61.6 112.8C61 110.1 65 107.2 64.5 104.6C64 102 59.2 100.6 58.8 98.0996C58.4 95.5996 62.6 92.6996 62.3 90.0996C62 87.4996 57.3 85.6996 57.1 83.1996C56.9 80.6996 61.2 78.0996 61.1 75.5996C61 73.0996 56.5 70.6996 56.5 68.1996C56.5 65.6996 61.5 61.3996 62.7 58.0996C63.9 54.7996 62.1 49.1996 64.6 46.2996C67.1 43.3996 72.7 44.4996 75.9 42.2996C79.1 40.0996 80 34.5996 83.5 32.9996C87 31.3996 91.8 34.5996 95.5 33.5996C99.2 32.5996 101.7 27.3996 105.4 26.7996C109.1 26.1996 113.3 30.1996 117 29.9996C120.7 29.7996 124.3 25.0996 128 25.0996Z\" fill=\"%230C1F41\"/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"128\" y1=\"241.091\" x2=\"128\" y2=\"170.801\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop offset=\"0.17\" stop-color=\"%23533E37\"/%3E%3Cstop offset=\"0.81\" stop-color=\"%23412B24\"/%3E%3Cstop offset=\"1\" stop-color=\"%233B241E\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint1_linear\" x1=\"60.0324\" y1=\"130.501\" x2=\"87.0224\" y2=\"130.501\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop offset=\"0.17\" stop-color=\"%23533E37\"/%3E%3Cstop offset=\"0.45\" stop-color=\"%23412B24\"/%3E%3Cstop offset=\"0.54\" stop-color=\"%233B241E\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint2_linear\" x1=\"169.766\" y1=\"130.425\" x2=\"196.756\" y2=\"130.425\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop offset=\"0.46\" stop-color=\"%233B241E\"/%3E%3Cstop offset=\"0.55\" stop-color=\"%23412B24\"/%3E%3Cstop offset=\"0.83\" stop-color=\"%23533E37\"/%3E%3C/linearGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Lydia.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::e4bd47c826befbace7bae1b74437aaee>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"258\" viewBox=\"0 0 256 258\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0.900391H256V257.6H0V0.900391Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M256 130.601V127.901C255.995 105.839 250.178 84.1675 239.136 65.0679C228.094 45.9682 212.216 30.1139 193.1 19.1006L190.9 17.7006C171.763 6.69832 150.074 0.908203 128 0.908203C105.926 0.908203 84.2372 6.69832 65.1 17.7006L62.9 19.1006C43.7838 30.1139 27.9057 45.9682 16.8637 65.0679C5.8217 84.1675 0.0053515 105.839 0 127.901L0 130.601C0.0053515 152.662 5.8217 174.334 16.8637 193.433C27.9057 212.533 43.7838 228.387 62.9 239.401L65.1 240.801C84.2372 251.803 105.926 257.593 128 257.593C150.074 257.593 171.763 251.803 190.9 240.801L193.1 239.401C212.216 228.387 228.094 212.533 239.136 193.433C250.178 174.334 255.995 152.662 256 130.601Z\" fill=\"%230065FF\"/%3E%3Cpath d=\"M170.2 214.301L131.6 212.301L93.0002 214.301C92.2462 214.321 91.5152 214.564 90.9002 215.001L58.5002 236.401L58.2002 236.601C59.7002 237.601 61.3002 238.501 62.9002 239.401L65.1002 240.801C84.2374 251.803 105.926 257.593 128 257.593C150.075 257.593 171.763 251.803 190.9 240.801L193.1 239.401C195.96 237.821 198.731 236.085 201.4 234.201L172.3 215.001C171.671 214.592 170.948 214.351 170.2 214.301Z\" fill=\"%23B2D4FF\"/%3E%3Cpath d=\"M83.6 127.302C83.6 133.602 82.4 145.502 76.1 145.502C69.8 145.502 61 133.602 61 127.302C61 125.818 61.2923 124.349 61.8602 122.978C62.428 121.607 63.2604 120.361 64.3097 119.312C65.359 118.262 66.6047 117.43 67.9757 116.862C69.3467 116.294 70.8161 116.002 72.3 116.002C73.7839 116.002 75.2533 116.294 76.6243 116.862C77.9953 117.43 79.241 118.262 80.2903 119.312C81.3396 120.361 82.172 121.607 82.7398 122.978C83.3077 124.349 83.6 125.818 83.6 127.302Z\" fill=\"%23473630\"/%3E%3Cpath d=\"M198.3 127.3C198.3 133.6 189.4 145.5 183.2 145.5C177 145.5 175.6 133.6 175.6 127.3C175.866 124.474 177.176 121.848 179.275 119.937C181.375 118.026 184.111 116.967 186.95 116.967C189.789 116.967 192.526 118.026 194.625 119.937C196.724 121.848 198.035 124.474 198.3 127.3Z\" fill=\"%23473630\"/%3E%3Cpath d=\"M167.9 215.6C167 216.8 152.2 236.8 127.8 234.9C108.1 233.3 97.0003 218.6 95.3003 216.3C97.8306 211.533 99.6179 206.407 100.6 201.1C101.957 193.198 101.478 185.089 99.2003 177.4H160.9C158.032 185.023 157.681 193.364 159.9 201.2C161.415 206.556 164.154 211.485 167.9 215.6Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M188.3 138.6C188.173 140.976 187.632 143.311 186.7 145.5C183.882 151.995 179.957 157.95 175.1 163.1L161.4 177.2C153.419 185.427 142.555 190.231 131.1 190.6H128.9C117.3 190.356 106.266 185.54 98.2001 177.2L87.3001 166C81.0619 160.234 76.0607 153.259 72.6001 145.5C71.6225 143.327 71.079 140.983 71.0001 138.6L69.1001 84.2005C69.0079 82.1688 69.2788 80.137 69.9001 78.2005C77.6001 52.9005 101.1 37.7005 128.7 37.3005C156.3 36.9005 181.8 52.5005 189.5 78.6005C189.978 80.3944 190.213 82.2441 190.2 84.1005L188.3 138.6Z\" fill=\"%23533E37\"/%3E%3Cpath d=\"M70.8004 148.601C73.7827 148.601 76.2004 146.183 76.2004 143.201C76.2004 140.218 73.7827 137.801 70.8004 137.801C67.8181 137.801 65.4004 140.218 65.4004 143.201C65.4004 146.183 67.8181 148.601 70.8004 148.601Z\" fill=\"%23DEEBFF\"/%3E%3Cpath d=\"M188.5 148.601C191.482 148.601 193.9 146.183 193.9 143.201C193.9 140.218 191.482 137.801 188.5 137.801C185.518 137.801 183.1 140.218 183.1 143.201C183.1 146.183 185.518 148.601 188.5 148.601Z\" fill=\"%23DEEBFF\"/%3E%3Cpath d=\"M117.4 104.602C112.613 102.285 107.306 101.251 102 101.602C99.4216 101.809 96.8913 102.416 94.5 103.402C92.0519 104.368 89.8115 105.793 87.9 107.602H87.8C87.6114 107.74 87.3837 107.815 87.15 107.815C86.9162 107.815 86.6885 107.74 86.5 107.602C86.3878 107.444 86.3194 107.259 86.3019 107.065C86.2843 106.872 86.3182 106.678 86.4 106.502C87.165 105.153 88.1444 103.937 89.3 102.902C90.4307 101.926 91.6726 101.087 93 100.402C94.3254 99.6411 95.7349 99.0371 97.2 98.602C98.6527 98.1012 100.166 97.7985 101.7 97.702C104.723 97.3629 107.784 97.635 110.7 98.502C112.169 98.9713 113.578 99.6089 114.9 100.402C116.25 101.124 117.467 102.071 118.5 103.202C118.582 103.293 118.644 103.399 118.683 103.514C118.723 103.63 118.738 103.752 118.729 103.873C118.719 103.995 118.685 104.113 118.629 104.221C118.572 104.33 118.494 104.425 118.4 104.502C118.286 104.623 118.133 104.699 117.968 104.717C117.803 104.735 117.638 104.695 117.5 104.602H117.4Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M140 103.201C142.16 101.021 144.847 99.4362 147.8 98.6009C150.714 97.7225 153.765 97.3836 156.8 97.6009C159.888 97.8877 162.883 98.8067 165.6 100.301C166.935 101.052 168.177 101.959 169.3 103.001C170.501 103.992 171.487 105.217 172.2 106.601C172.269 106.71 172.313 106.833 172.329 106.961C172.346 107.089 172.335 107.219 172.297 107.342C172.259 107.466 172.195 107.579 172.11 107.676C172.024 107.772 171.918 107.849 171.8 107.901C171.621 107.996 171.415 108.029 171.216 107.992C171.016 107.956 170.834 107.853 170.7 107.701H170.6C168.657 105.959 166.423 104.571 164 103.601C162.82 103.052 161.578 102.649 160.3 102.401C159.055 102.062 157.784 101.828 156.5 101.701C153.894 101.532 151.276 101.667 148.7 102.101C146.089 102.604 143.563 103.48 141.2 104.701H141.1C140.87 104.79 140.617 104.798 140.381 104.726C140.145 104.653 139.941 104.504 139.8 104.301C139.705 104.122 139.673 103.916 139.709 103.716C139.745 103.516 139.848 103.335 140 103.201Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M142.9 116.702C144.123 114.301 145.993 112.292 148.3 110.902C150.673 109.481 153.462 108.916 156.2 109.302C158.827 109.819 161.294 110.95 163.4 112.602C164.4 113.302 165.4 114.102 166.4 114.702C167.195 115.32 168.199 115.606 169.2 115.502H169.3C169.392 115.471 169.489 115.46 169.586 115.469C169.682 115.478 169.775 115.507 169.86 115.554C169.945 115.601 170.018 115.665 170.077 115.742C170.136 115.819 170.178 115.908 170.2 116.002C170.232 116.08 170.246 116.164 170.242 116.249C170.238 116.333 170.217 116.415 170.179 116.491C170.142 116.566 170.088 116.633 170.023 116.687C169.958 116.74 169.882 116.779 169.8 116.802C169.067 117.202 168.21 117.309 167.4 117.102L165.5 116.302L162.3 114.202C160.419 112.755 158.229 111.762 155.9 111.302C153.597 110.99 151.253 111.41 149.2 112.502C148.203 113.112 147.266 113.815 146.4 114.602C145.56 115.421 144.852 116.366 144.3 117.402H144.2C144.159 117.491 144.098 117.57 144.024 117.635C143.949 117.699 143.862 117.747 143.768 117.775C143.673 117.804 143.574 117.812 143.476 117.799C143.378 117.786 143.284 117.753 143.2 117.702C143.039 117.598 142.92 117.441 142.865 117.257C142.81 117.074 142.822 116.877 142.9 116.702Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M154.7 116.8C156.467 116.8 157.9 115.368 157.9 113.6C157.9 111.833 156.467 110.4 154.7 110.4C152.933 110.4 151.5 111.833 151.5 113.6C151.5 115.368 152.933 116.8 154.7 116.8Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M112.7 117.302C112.076 116.26 111.301 115.316 110.4 114.502C109.577 113.692 108.633 113.017 107.6 112.502C105.545 111.416 103.204 110.997 100.9 111.302C99.7521 111.449 98.6368 111.787 97.6001 112.302C96.4648 112.728 95.3892 113.3 94.4001 114.002L91.2001 116.002L89.3001 116.802C88.5649 116.982 87.7907 116.911 87.1001 116.602C87.0209 116.602 86.9428 116.583 86.8723 116.547C86.8017 116.511 86.7408 116.458 86.6945 116.394C86.6482 116.33 86.6178 116.255 86.6058 116.177C86.5939 116.099 86.6007 116.019 86.6258 115.943C86.6508 115.868 86.6934 115.8 86.7499 115.745C86.8065 115.689 86.8754 115.648 86.951 115.624C87.0266 115.601 87.1068 115.595 87.1849 115.609C87.2629 115.622 87.3367 115.654 87.4001 115.702H87.5001C88.028 115.808 88.5733 115.791 89.0937 115.652C89.614 115.514 90.0953 115.257 90.5001 114.902C91.5468 114.234 92.5489 113.499 93.5001 112.702C95.5512 111.002 97.9899 109.834 100.6 109.302C103.339 108.916 106.127 109.481 108.5 110.902C110.732 112.337 112.503 114.385 113.6 116.802C113.648 116.924 113.655 117.059 113.618 117.185C113.582 117.312 113.506 117.423 113.4 117.502C113.292 117.542 113.174 117.545 113.064 117.508C112.955 117.472 112.862 117.399 112.8 117.302H112.7Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M102 116.8C103.768 116.8 105.2 115.368 105.2 113.6C105.2 111.833 103.768 110.4 102 110.4C100.233 110.4 98.8003 111.833 98.8003 113.6C98.8003 115.368 100.233 116.8 102 116.8Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M144.5 159.702C138.8 159.302 136.4 156.402 131.1 156.602C130.3 156.602 127.1 158.302 127.1 158.302C127.1 158.302 123.9 156.602 123 156.602C117.8 156.402 115.4 159.302 109.6 159.702C108.264 159.817 106.918 159.749 105.6 159.502C106 160.202 113.6 171.002 127.1 170.902C140.6 170.802 148.1 160.202 148.6 159.502C147.248 159.747 145.87 159.815 144.5 159.702Z\" fill=\"%238C715D\"/%3E%3Cpath d=\"M148.6 159.502C147.248 159.747 145.87 159.815 144.5 159.702C138.8 159.302 136.4 156.402 131.1 156.602C130.3 156.602 127.1 158.302 127.1 158.302C127.1 158.302 123.9 156.602 123 156.602C117.8 156.402 115.4 159.302 109.6 159.702C108.264 159.817 106.918 159.749 105.6 159.502C112.63 162.007 120.037 163.292 127.5 163.302C134.697 163.227 141.829 161.942 148.6 159.502Z\" fill=\"%2372594B\"/%3E%3Cpath d=\"M103.6 157.401C107.286 159.102 111.141 160.409 115.1 161.301C123.007 163.068 131.209 163.034 139.1 161.201C141.065 160.707 143.001 160.106 144.9 159.401C146.857 158.782 148.762 158.013 150.6 157.101C150.748 157.056 150.907 157.061 151.051 157.115C151.196 157.169 151.319 157.27 151.4 157.401C151.443 157.54 151.447 157.688 151.411 157.829C151.376 157.97 151.303 158.098 151.2 158.201C143.928 162.589 135.594 164.906 127.1 164.901C125 164.901 122.9 164.701 120.8 164.501C118.704 164.222 116.632 163.788 114.6 163.201C110.509 162.211 106.596 160.591 103 158.401C102.914 158.374 102.834 158.328 102.768 158.265C102.702 158.203 102.651 158.127 102.618 158.042C102.586 157.957 102.573 157.866 102.581 157.775C102.589 157.685 102.618 157.598 102.665 157.52C102.711 157.442 102.775 157.376 102.851 157.326C102.927 157.276 103.014 157.245 103.104 157.233C103.194 157.222 103.285 157.231 103.371 157.26C103.457 157.289 103.536 157.337 103.6 157.401Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M123.1 114.501C124.443 118.354 125.054 122.424 124.9 126.501C124.837 128.556 124.569 130.599 124.1 132.601C123.713 134.594 123.109 136.539 122.3 138.401C122.282 138.496 122.241 138.585 122.181 138.661C122.121 138.737 122.043 138.797 121.955 138.836C121.866 138.875 121.77 138.893 121.673 138.887C121.576 138.88 121.483 138.851 121.4 138.801C121.232 138.754 121.088 138.646 120.995 138.498C120.903 138.35 120.869 138.173 120.9 138.001C121.5 136.101 121.9 134.201 122.3 132.301C122.7 130.401 122.8 128.401 122.9 126.501C122.985 124.565 122.918 122.626 122.7 120.701C122.472 118.751 122.139 116.815 121.7 114.901C121.67 114.809 121.659 114.712 121.668 114.616C121.677 114.519 121.706 114.426 121.753 114.341C121.8 114.257 121.864 114.183 121.941 114.124C122.018 114.066 122.106 114.024 122.2 114.001C122.385 113.965 122.577 113.996 122.741 114.087C122.906 114.178 123.033 114.325 123.1 114.501Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M120.8 142.901L124.5 143.901L126.4 144.401L128.1 144.801C129.282 144.769 130.457 144.601 131.6 144.301C132.801 144.007 133.972 143.605 135.1 143.101C135.5 143.001 135.9 143.101 136 143.501C136.046 143.649 136.041 143.808 135.986 143.952C135.932 144.097 135.832 144.22 135.7 144.301C134.582 145.026 133.371 145.598 132.1 146.001C130.758 146.501 129.332 146.739 127.9 146.701C127.184 146.675 126.476 146.54 125.8 146.301L124 145.701L120.3 144.201C120.161 144.103 120.056 143.962 120.002 143.8C119.949 143.638 119.948 143.464 120 143.301C120.066 143.152 120.182 143.03 120.328 142.957C120.474 142.884 120.641 142.864 120.8 142.901Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M77.1001 117.102L80.2001 117.302L83.2001 117.102H83.3001C83.6001 117.002 83.9001 117.302 84.0001 117.602C84.0043 117.719 83.9791 117.835 83.9267 117.94C83.8743 118.045 83.7964 118.135 83.7001 118.202C82.648 118.864 81.4422 119.243 80.2001 119.302C78.9408 119.355 77.7027 118.966 76.7001 118.202C76.6295 118.153 76.5702 118.089 76.5262 118.016C76.4822 117.942 76.4546 117.86 76.4451 117.774C76.4356 117.689 76.4445 117.603 76.4713 117.521C76.498 117.44 76.542 117.365 76.6001 117.302C76.7001 117.102 76.9001 117.102 77.1001 117.102Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M173.6 117.101L176.7 117.301L179.7 117.101C179.78 117.066 179.867 117.052 179.953 117.061C180.039 117.07 180.122 117.101 180.193 117.152C180.263 117.202 180.319 117.27 180.356 117.349C180.392 117.428 180.407 117.515 180.4 117.601C180.441 117.709 180.443 117.827 180.407 117.937C180.371 118.046 180.297 118.139 180.2 118.201C179.148 118.864 177.942 119.243 176.7 119.301C175.439 119.372 174.194 118.981 173.2 118.201C173.13 118.152 173.07 118.089 173.026 118.015C172.982 117.942 172.955 117.859 172.945 117.774C172.936 117.689 172.945 117.602 172.971 117.521C172.998 117.439 173.042 117.364 173.1 117.301C173.2 117.101 173.4 117.101 173.6 117.101Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M173.3 119.902L176 121.302L178.8 122.302H178.9C179.2 122.302 179.4 122.702 179.3 123.002L178.8 123.502C177.577 123.686 176.326 123.513 175.2 123.002C174.018 122.548 173.029 121.7 172.4 120.602C172.328 120.441 172.319 120.26 172.374 120.093C172.43 119.926 172.546 119.787 172.7 119.702C172.776 119.658 172.862 119.635 172.95 119.635C173.038 119.635 173.124 119.658 173.2 119.702L173.3 119.902Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M77.9 123.502L80.7 122.302L83.3 120.702C83.4049 120.631 83.5293 120.596 83.6557 120.6C83.782 120.604 83.9037 120.648 84.0035 120.726C84.1033 120.804 84.176 120.911 84.2113 121.032C84.2466 121.154 84.2426 121.283 84.2 121.402C83.6379 122.494 82.7689 123.397 81.7 124.002C80.5939 124.68 79.2774 124.929 78 124.702C77.7 124.702 77.5 124.302 77.5 124.002C77.5 123.702 77.7 123.602 77.9 123.602V123.502Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M96.5 159.802C95.9551 158.455 95.9551 156.949 96.5 155.602C97.0766 154.287 98.1055 153.223 99.4 152.602C99.4574 152.568 99.5224 152.549 99.5891 152.547C99.6557 152.545 99.7218 152.559 99.7814 152.589C99.841 152.619 99.8922 152.663 99.9304 152.718C99.9686 152.772 99.9925 152.836 100 152.902C100.005 152.956 99.9981 153.011 99.9809 153.062C99.9637 153.114 99.9362 153.161 99.9 153.202C99.3186 154.229 98.8172 155.298 98.4 156.402C98.0165 157.436 97.7482 158.509 97.6 159.602C97.5761 159.743 97.5025 159.871 97.3925 159.963C97.2824 160.055 97.1432 160.104 97 160.102C96.9 160.091 96.8035 160.058 96.7172 160.006C96.631 159.955 96.5569 159.885 96.5 159.802Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M155.7 152.602C156.368 152.869 156.971 153.274 157.471 153.791C157.971 154.308 158.355 154.925 158.6 155.602C158.912 156.237 159.082 156.933 159.1 157.641C159.117 158.348 158.981 159.052 158.7 159.702C158.657 159.791 158.581 159.861 158.489 159.898C158.396 159.935 158.293 159.936 158.2 159.902C158 159.902 158 159.802 157.9 159.702C157.67 158.561 157.301 157.452 156.8 156.402C156.273 155.391 155.671 154.422 155 153.502C154.942 153.438 154.898 153.364 154.871 153.282C154.844 153.2 154.835 153.114 154.845 153.029C154.854 152.943 154.882 152.861 154.926 152.787C154.97 152.714 155.029 152.65 155.1 152.602H155.7Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M130.3 36.7012C189.9 36.7012 196 87.0012 188.8 114.701C188.541 109.583 187.838 104.498 186.7 99.5012C184.4 89.1012 181.3 75.2012 172.3 68.0012C164.8 62.0012 159.4 65.6012 129.5 65.4012C99.6004 65.2012 94.1004 62.0012 86.6004 68.0012C79.1004 74.0012 74.6004 89.1012 72.2004 99.5012C71.1121 104.507 70.4101 109.588 70.1004 114.701C63.0004 87.0012 69.0004 36.7012 128.6 36.7012H130.3Z\" fill=\"url(%23paint1_linear)\"/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"131.58\" y1=\"235.02\" x2=\"131.58\" y2=\"177.4\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23533E37\"/%3E%3Cstop offset=\"0.43\" stop-color=\"%23503B34\"/%3E%3Cstop offset=\"0.75\" stop-color=\"%2347312B\"/%3E%3Cstop offset=\"1\" stop-color=\"%233B241E\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint1_linear\" x1=\"129.48\" y1=\"114.691\" x2=\"129.48\" y2=\"36.6512\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23533E37\"/%3E%3Cstop offset=\"0.12\" stop-color=\"%235F4C46\"/%3E%3Cstop offset=\"0.34\" stop-color=\"%2380716C\"/%3E%3Cstop offset=\"0.66\" stop-color=\"%23B4ACAB\"/%3E%3Cstop offset=\"1\" stop-color=\"%23F4F5F7\"/%3E%3C/linearGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0.900391H256V257.6H0V0.900391Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Maribel.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::dd5c5bc6de21581350b9589538eaf30b>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"257\" viewBox=\"0 0 256 257\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256.9C198.692 256.9 256 199.593 256 128.9C256 58.2079 198.692 0.900391 128 0.900391C57.3075 0.900391 0 58.2079 0 128.9C0 199.593 57.3075 256.9 128 256.9Z\" fill=\"%23FF5630\"/%3E%3Cpath d=\"M80.2 53.9009C74.9 55.6009 68.7 58.6009 66.6 64.3009C64.5 70.0009 71.3 77.0009 67.9 84.0009C65.8 88.4009 62.2 88.0009 59.3 94.1009C57.901 96.965 57.1823 100.113 57.2 103.301C56.9 111.701 61.4 114.901 63.2 121.201C66.7 133.801 53.6 140.701 55.5 152.101C56.4 157.601 60.7 164.501 75.5 171.301C74.0902 175.861 74.0902 180.741 75.5 185.301C77.3693 190.339 80.7151 194.695 85.1 197.801C96.1 205.201 104.5 196.401 128.3 197.601C143.9 198.401 148.1 202.601 159.6 199.301C164 198.101 172.3 195.501 176.3 187.701C178.325 183.363 178.886 178.485 177.9 173.801C180.3 173.801 187.7 173.601 193.5 168.201C199.3 162.801 201.8 151.901 199.7 143.601C197.6 135.301 192 130.001 193.5 121.201C194.5 115.301 197.2 110.901 196.4 102.401C196.136 98.9661 195.148 95.6262 193.5 92.6009C190.7 87.7009 188.2 88.1009 186.6 84.9009C183.4 78.1009 192.7 71.4009 190.1 64.3009C187.5 57.2009 179.8 57.8009 176.5 53.9009C164.4 52.3009 164.9 44.8009 152.7 44.8009C140.5 44.8009 140.5 54.0009 128.3 54.0009C116.1 54.0009 115.7 43.9009 103.6 44.8009C91.5 45.7009 92.3 52.3009 80.2 53.9009Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M170.7 208.1L131.6 206.1L92.5998 208.1C91.8548 208.166 91.1357 208.406 90.4998 208.8L55.0998 232.2L53.7998 233.2C76.0778 249.044 102.843 257.34 130.177 256.872C157.511 256.404 183.977 247.197 205.7 230.6L172.8 208.8C172.151 208.434 171.438 208.196 170.7 208.1Z\" fill=\"%23FFA687\"/%3E%3Cpath d=\"M168.3 209.8C167.3 211.2 152.4 230.6 127.8 228.9C107.3 227.6 95.6999 212.7 93.8999 210.4C98.7848 206.336 102.136 200.727 103.4 194.5C106.2 180.7 97.0999 170.3 95.9999 169.1L163.4 166.6C162.1 168.6 155 179.9 158.6 193.8C160.283 199.931 163.642 205.472 168.3 209.8Z\" fill=\"url(%23paint1_linear)\"/%3E%3Cpath d=\"M77.3 141.2C84.9215 141.2 91.1 135.021 91.1 127.4C91.1 119.778 84.9215 113.6 77.3 113.6C69.6785 113.6 63.5 119.778 63.5 127.4C63.5 135.021 69.6785 141.2 77.3 141.2Z\" fill=\"url(%23paint2_linear)\"/%3E%3Cpath d=\"M179.3 141.2C186.922 141.2 193.1 135.021 193.1 127.4C193.1 119.778 186.922 113.6 179.3 113.6C171.678 113.6 165.5 119.778 165.5 127.4C165.5 135.021 171.678 141.2 179.3 141.2Z\" fill=\"url(%23paint3_linear)\"/%3E%3Cpath d=\"M80.9 99.7008C80.9 106.101 80.7 112.101 80.5 117.901C80.3 123.701 80.1 122.801 79.8 128.301C79 143.801 79.8 147.801 76.5 151.501C73.2 155.201 71 155.701 69.7 154.801C68.4 153.901 70.4 150.201 71.1 144.701C73.1 131.201 68.6 117.701 68.2 116.501C67.8 115.301 66.1 111.101 66.3 107.101C66.4 104.701 66.7 99.4008 70.4 97.4008C74.1 95.4008 77.6 96.8008 80.9 99.7008Z\" fill=\"%23FFAB00\"/%3E%3Cpath d=\"M184.2 122.201C183 151.801 152.3 185.801 128.5 185.801C104.7 185.801 73.9999 151.801 72.7999 122.201C71.4999 89.5012 95.9999 52.7012 128.5 52.7012C161 52.7012 185.5 89.5012 184.2 122.201Z\" fill=\"%23FFE2D9\"/%3E%3Cpath d=\"M69.2001 136.7C70.0838 136.7 70.8001 135.984 70.8001 135.1C70.8001 134.216 70.0838 133.5 69.2001 133.5C68.3164 133.5 67.6001 134.216 67.6001 135.1C67.6001 135.984 68.3164 136.7 69.2001 136.7Z\" fill=\"%23F15538\"/%3E%3Cpath d=\"M188.1 136.7C188.984 136.7 189.7 135.984 189.7 135.1C189.7 134.216 188.984 133.5 188.1 133.5C187.216 133.5 186.5 134.216 186.5 135.1C186.5 135.984 187.216 136.7 188.1 136.7Z\" fill=\"%23F15538\"/%3E%3Cpath d=\"M151 158.1C143.714 160.708 136.039 162.06 128.3 162.1C120.563 162.047 112.889 160.695 105.6 158.1L112.2 155.9C115.566 154.683 119.258 154.718 122.6 156H122.9C126.421 157.315 130.304 157.28 133.8 155.9C137.184 154.684 140.873 154.614 144.3 155.7L151 158.1Z\" fill=\"%23FF7143\"/%3E%3Cpath d=\"M151 158.1C151 158.1 145.7 169.3 128.3 169.3C110.9 169.3 105.6 158.1 105.6 158.1C120.263 163.434 136.337 163.434 151 158.1Z\" fill=\"%23FF8A63\"/%3E%3Cpath d=\"M102.6 156C106.638 157.896 110.86 159.37 115.2 160.4C123.853 162.433 132.863 162.398 141.5 160.3C143.7 159.8 145.8 159.2 147.9 158.5C150 157.8 152.1 156.9 154.1 155.9C154.3 155.9 154.5 155.9 154.6 156.1C154.7 156.3 154.6 156.5 154.5 156.5C150.56 158.879 146.323 160.728 141.9 162C137.505 163.233 132.965 163.872 128.4 163.9C126.094 163.917 123.789 163.783 121.5 163.5C119.24 163.221 117.001 162.787 114.8 162.2C110.356 161.034 106.086 159.285 102.1 157C101.997 156.898 101.924 156.769 101.889 156.628C101.854 156.487 101.858 156.339 101.9 156.2C101.987 156.106 102.099 156.038 102.222 156.002C102.346 155.967 102.476 155.966 102.6 156Z\" fill=\"%23FF5630\"/%3E%3Cpath d=\"M102.1 115.501C103.812 115.501 105.2 114.113 105.2 112.401C105.2 110.689 103.812 109.301 102.1 109.301C100.388 109.301 99 110.689 99 112.401C99 114.113 100.388 115.501 102.1 115.501Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M88.6001 112.101C88.994 112.275 89.4197 112.364 89.8501 112.364C90.2805 112.364 90.7062 112.275 91.1001 112.101L91.5001 111.801L91.7001 111.601L92.0001 111.301C92.3864 110.882 92.823 110.513 93.3001 110.201C95.1591 108.717 97.3588 107.72 99.7001 107.301C102.042 106.967 104.429 107.137 106.7 107.801C108.904 108.597 110.89 109.899 112.5 111.601C112.615 111.687 112.71 111.797 112.778 111.922C112.847 112.048 112.887 112.187 112.898 112.33C112.908 112.473 112.887 112.617 112.837 112.751C112.787 112.885 112.709 113.007 112.607 113.108C112.506 113.21 112.384 113.288 112.25 113.338C112.116 113.388 111.972 113.409 111.829 113.399C111.686 113.388 111.547 113.348 111.421 113.279C111.296 113.211 111.186 113.116 111.1 113.001C109.643 111.658 107.899 110.667 106 110.101C104.097 109.49 102.079 109.319 100.1 109.601C98.1048 109.901 96.215 110.691 94.6001 111.901L93.4001 112.801L93.1001 113.101L92.7001 113.401L91.7001 113.901C91.044 114.085 90.3455 114.047 89.7129 113.794C89.0802 113.541 88.5485 113.087 88.2001 112.501C88.1001 112.401 88.2001 112.201 88.3001 112.101H88.6001Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M151.9 115.501C153.612 115.501 155 114.113 155 112.401C155 110.689 153.612 109.301 151.9 109.301C150.188 109.301 148.8 110.689 148.8 112.401C148.8 114.113 150.188 115.501 151.9 115.501Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M165.8 113C165.452 113.586 164.92 114.04 164.287 114.293C163.655 114.546 162.956 114.584 162.3 114.4L161.3 113.9L160.9 113.6L160.6 113.3L159.4 112.4C157.8 111.182 155.899 110.422 153.9 110.2C151.964 109.835 149.967 109.972 148.1 110.6C146.188 111.205 144.419 112.191 142.9 113.5C142.814 113.615 142.705 113.71 142.579 113.778C142.453 113.847 142.314 113.888 142.171 113.898C142.028 113.908 141.885 113.887 141.75 113.837C141.616 113.787 141.494 113.709 141.393 113.607C141.292 113.506 141.213 113.384 141.163 113.25C141.113 113.116 141.092 112.972 141.103 112.829C141.113 112.686 141.154 112.547 141.222 112.422C141.291 112.296 141.385 112.186 141.5 112.1C143.109 110.372 145.144 109.096 147.4 108.4C149.619 107.654 151.985 107.448 154.3 107.8C156.653 108.18 158.863 109.182 160.7 110.7C161.177 111.012 161.614 111.381 162 111.8L162.3 112.1L162.5 112.3L163 112.6C163.394 112.774 163.82 112.863 164.25 112.863C164.681 112.863 165.106 112.774 165.5 112.6C165.6 112.6 165.8 112.6 165.8 112.8C165.8 113 165.9 112.9 165.8 113Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M64.5002 64.5002C69.7002 47.7002 84.1002 36.7002 96.0002 34.0002C99.9188 32.98 104.01 32.8095 108 33.5002C113.888 34.7353 119.26 37.7351 123.4 42.1002C113.1 59.9002 102.8 70.1002 95.2002 76.2002C91.1002 79.4002 82.3002 85.8002 76.9002 97.6002C75.3005 101.045 74.1252 104.672 73.4002 108.4C72.2002 106.9 57.2002 87.7002 64.5002 64.5002Z\" fill=\"%23FFAB00\"/%3E%3Cpath d=\"M138.4 27.6997C145.741 27.6997 153.01 29.1456 159.792 31.9549C166.574 34.7641 172.736 38.8817 177.927 44.0725C183.118 49.2633 187.236 55.4256 190.045 62.2077C192.854 68.9898 194.3 76.2588 194.3 83.5997C194.233 88.4247 193.596 93.2248 192.4 97.8997C190.695 103.922 187.843 109.559 184 114.5C168.746 108.864 154.212 101.446 140.7 92.3997C123.033 80.6514 107.253 66.2876 93.8999 49.7997C97.5999 45.0997 106.7 34.7997 122 30.0997C127.316 28.4848 132.844 27.6758 138.4 27.6997Z\" fill=\"%23FFAB00\"/%3E%3Cpath d=\"M119.5 140.3L123 141.2L124.7 141.6L126.2 142C127.284 141.973 128.359 141.805 129.4 141.5C130.533 141.288 131.639 140.952 132.7 140.5H132.8C132.985 140.464 133.176 140.495 133.341 140.586C133.506 140.678 133.633 140.824 133.7 141C133.772 141.161 133.781 141.342 133.726 141.509C133.67 141.676 133.554 141.815 133.4 141.9C132.348 142.592 131.203 143.131 130 143.5C128.762 143.999 127.434 144.238 126.1 144.2L124.1 143.8L122.3 143.2C121.131 142.785 119.995 142.283 118.9 141.7C118.811 141.658 118.731 141.598 118.667 141.524C118.602 141.449 118.554 141.362 118.526 141.267C118.498 141.173 118.49 141.074 118.502 140.976C118.515 140.878 118.548 140.784 118.6 140.7C118.687 140.57 118.806 140.464 118.947 140.394C119.087 140.324 119.243 140.291 119.4 140.3H119.5Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M121.5 116.699C122.069 118.054 122.505 119.46 122.8 120.899C123.071 122.352 123.238 123.823 123.3 125.299C123.3 126.738 123.199 128.175 123 129.599C122.806 131.053 122.505 132.49 122.1 133.899C122.011 134.104 121.85 134.269 121.646 134.361C121.443 134.454 121.213 134.467 121 134.399C120.816 134.335 120.658 134.212 120.55 134.05C120.442 133.887 120.389 133.694 120.4 133.499C120.6 132.099 120.8 130.799 120.9 129.399C121.033 128.037 121.067 126.667 121 125.299C121 123.96 120.899 122.623 120.7 121.299C120.5 119.899 120.2 118.599 120 117.199C119.968 117.011 120.005 116.818 120.103 116.654C120.201 116.49 120.355 116.367 120.536 116.307C120.717 116.246 120.914 116.253 121.091 116.325C121.267 116.397 121.413 116.53 121.5 116.699Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M99.3 138.901C94.6917 138.901 90.1869 137.534 86.3552 134.974C82.5236 132.414 79.5371 128.775 77.7736 124.517C76.0101 120.26 75.5487 115.575 76.4477 111.055C77.3467 106.535 79.5659 102.384 82.8244 99.1252C86.083 95.8666 90.2347 93.6475 94.7544 92.7485C99.2742 91.8495 103.959 92.3109 108.217 94.0744C112.474 95.8379 116.113 98.8243 118.673 102.656C121.233 106.488 122.6 110.992 122.6 115.601C122.574 121.772 120.11 127.683 115.747 132.047C111.383 136.411 105.471 138.874 99.3 138.901ZM99.3 95.3008C95.2851 95.3008 91.3603 96.4914 88.0219 98.722C84.6836 100.953 82.0817 104.123 80.5453 107.832C79.0088 111.542 78.6068 115.623 79.3901 119.561C80.1734 123.499 82.1067 127.116 84.9457 129.955C87.7847 132.794 91.4019 134.727 95.3397 135.511C99.2775 136.294 103.359 135.892 107.068 134.356C110.778 132.819 113.948 130.217 116.179 126.879C118.409 123.541 119.6 119.616 119.6 115.601C119.6 110.217 117.461 105.054 113.654 101.247C109.847 97.4395 104.684 95.3008 99.3 95.3008Z\" fill=\"%23FF7143\"/%3E%3Cpath d=\"M153.5 138.901C148.892 138.901 144.387 137.534 140.555 134.974C136.724 132.414 133.737 128.775 131.974 124.517C130.21 120.26 129.749 115.575 130.648 111.055C131.547 106.535 133.766 102.384 137.025 99.1252C140.283 95.8666 144.435 93.6475 148.955 92.7485C153.474 91.8495 158.159 92.3109 162.417 94.0744C166.674 95.8379 170.313 98.8243 172.873 102.656C175.434 106.488 176.8 110.992 176.8 115.601C176.8 118.661 176.198 121.69 175.027 124.517C173.856 127.344 172.139 129.913 169.976 132.076C167.812 134.24 165.244 135.956 162.417 137.127C159.59 138.298 156.56 138.901 153.5 138.901ZM153.5 95.3008C149.485 95.3008 145.56 96.4914 142.222 98.722C138.884 100.953 136.282 104.123 134.745 107.832C133.209 111.542 132.807 115.623 133.59 119.561C134.374 123.499 136.307 127.116 139.146 129.955C141.985 132.794 145.602 134.727 149.54 135.511C153.478 136.294 157.559 135.892 161.269 134.356C164.978 132.819 168.148 130.217 170.379 126.879C172.61 123.541 173.8 119.616 173.8 115.601C173.8 110.217 171.661 105.054 167.854 101.247C164.047 97.4395 158.884 95.3008 153.5 95.3008Z\" fill=\"%23FF7143\"/%3E%3Cpath d=\"M77.5002 118H68.2002C67.8024 118 67.4208 117.842 67.1395 117.561C66.8582 117.279 66.7002 116.898 66.7002 116.5C66.7002 116.102 66.8582 115.721 67.1395 115.439C67.4208 115.158 67.8024 115 68.2002 115H77.5002C77.898 115 78.2796 115.158 78.5609 115.439C78.8422 115.721 79.0002 116.102 79.0002 116.5C79.0002 116.898 78.8422 117.279 78.5609 117.561C78.2796 117.842 77.898 118 77.5002 118Z\" fill=\"%23FF7143\"/%3E%3Cpath d=\"M186.3 117.1H175.3C174.902 117.1 174.52 116.942 174.239 116.66C173.958 116.379 173.8 115.997 173.8 115.6C173.8 115.202 173.958 114.82 174.239 114.539C174.52 114.258 174.902 114.1 175.3 114.1H186.3C186.698 114.1 187.079 114.258 187.36 114.539C187.642 114.82 187.8 115.202 187.8 115.6C187.8 115.997 187.642 116.379 187.36 116.66C187.079 116.942 186.698 117.1 186.3 117.1Z\" fill=\"%23FF7143\"/%3E%3Cpath d=\"M131.6 114.1H121.1V117.1H131.6V114.1Z\" fill=\"%23FF7143\"/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"127.91\" y1=\"200.761\" x2=\"127.91\" y2=\"44.7709\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23FF991F\"/%3E%3Cstop offset=\"0.15\" stop-color=\"%23FFAB00\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint1_linear\" x1=\"131.12\" y1=\"167.83\" x2=\"131.12\" y2=\"228.73\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23EBBEAE\"/%3E%3Cstop offset=\"0.64\" stop-color=\"%23FFE2D9\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint2_linear\" x1=\"63.57\" y1=\"127.41\" x2=\"91.11\" y2=\"127.41\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23FFE2D9\"/%3E%3Cstop offset=\"1\" stop-color=\"%23EBBEAE\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint3_linear\" x1=\"165.5\" y1=\"127.41\" x2=\"193.04\" y2=\"127.41\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23EBBEAE\"/%3E%3Cstop offset=\"1\" stop-color=\"%23FFE2D9\"/%3E%3C/linearGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Milo.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::b02412dc0ebc5695dd5c967dc31b621c>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"257\" viewBox=\"0 0 256 257\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256.9C198.692 256.9 256 199.593 256 128.9C256 58.2079 198.692 0.900391 128 0.900391C57.3075 0.900391 0 58.2079 0 128.9C0 199.593 57.3075 256.9 128 256.9Z\" fill=\"%23FFAB00\"/%3E%3Cpath d=\"M64.7998 104.3C66.1998 70.1996 94.0998 38.0996 131 38.0996C167.9 38.0996 195.7 70.1996 197.2 104.3C198.7 140.9 169.5 176.5 131 176.4C92.4998 176.3 63.1998 140.9 64.7998 104.3Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M79.0708 142.796C86.4595 140.926 90.5601 131.945 88.2299 122.736C85.8996 113.527 78.0209 107.577 70.6323 109.447C63.2436 111.316 59.1429 120.297 61.4732 129.506C63.8034 138.716 71.6822 144.665 79.0708 142.796Z\" fill=\"%23F7D0C3\"/%3E%3Cpath d=\"M199.353 129.701C201.683 120.492 197.583 111.511 190.194 109.642C182.805 107.772 174.926 113.722 172.596 122.931C170.266 132.14 174.367 141.121 181.755 142.991C189.144 144.86 197.023 138.911 199.353 129.701Z\" fill=\"%23F7D0C3\"/%3E%3Cpath d=\"M211.5 225.9L185.5 211.4C184.725 210.81 183.775 210.493 182.8 210.5L132.4 207.9L82 210.5C81.0297 210.521 80.0883 210.834 79.3 211.4L48 228.8C71.3032 247.484 100.41 257.423 130.274 256.893C160.138 256.363 188.874 245.399 211.5 225.9Z\" fill=\"%23FF8B00\"/%3E%3Cpath d=\"M181 217.4C179.8 218.9 160 243.3 127.4 240.9C101 239 86.0999 221 83.8999 218.2C90.0331 212.375 94.1676 204.761 95.7122 196.445C97.2569 188.129 96.1325 179.538 92.4999 171.9L170.1 170.1C168.9 172.4 162.4 185.8 168.1 200.7C170.708 207.389 175.186 213.187 181 217.4Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M130.9 42C158.6 42.2 175.5 60.9 178.1 63.9C195.6 84.1 193.8 108.2 193.4 113.3C192.4 125.7 187.4 135.6 177.7 155.6C173.311 164.804 168.403 173.752 163 182.4C161.489 184.864 159.302 186.842 156.7 188.1C148.698 192.218 139.893 194.539 130.9 194.9C121.874 194.55 113.034 192.229 105 188.1C102.444 186.813 100.297 184.839 98.8002 182.4C93.3601 173.756 88.4187 164.808 84.0002 155.6C74.4002 135.6 69.3002 125.7 68.4002 113.3C68.0002 108.2 66.1002 84.1 83.7002 63.9C86.3002 60.9 103.2 42.2 130.9 42Z\" fill=\"%23FFE2D9\"/%3E%3Cpath d=\"M115 110.899L113.4 109.999L111.7 109.199C110.469 108.695 109.198 108.293 107.9 107.999C105.352 107.366 102.721 107.13 100.1 107.299C97.443 107.409 94.8304 108.019 92.4002 109.099C91.1844 109.599 90.0135 110.201 88.9002 110.899C87.763 111.595 86.7209 112.435 85.8002 113.399C85.6132 113.583 85.3619 113.685 85.1001 113.685C84.8384 113.685 84.5871 113.583 84.4002 113.399C84.3011 113.34 84.2161 113.259 84.1511 113.164C84.0861 113.068 84.0426 112.959 84.0236 112.845C84.0046 112.731 84.0105 112.615 84.041 112.503C84.0715 112.391 84.1258 112.288 84.2001 112.199C85.0085 110.881 86.0211 109.7 87.2001 108.699C88.3584 107.656 89.6335 106.75 91.0001 105.999C93.6685 104.459 96.6343 103.504 99.7001 103.199C102.783 102.825 105.909 103.063 108.9 103.899C110.431 104.238 111.91 104.776 113.3 105.499L115.4 106.599C116.062 107.098 116.696 107.632 117.3 108.199C117.477 108.342 117.621 108.521 117.723 108.724C117.825 108.927 117.883 109.15 117.893 109.377C117.902 109.604 117.863 109.83 117.778 110.041C117.693 110.252 117.564 110.442 117.4 110.599C117.144 110.924 116.771 111.137 116.361 111.193C115.95 111.249 115.534 111.144 115.2 110.899H115Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M140.401 108.3C140.983 107.709 141.619 107.174 142.301 106.7L144.401 105.6C145.756 104.877 147.202 104.339 148.701 104C151.693 103.171 154.818 102.933 157.901 103.3C160.995 103.62 163.99 104.573 166.701 106.1C168.067 106.85 169.342 107.756 170.501 108.8C171.68 109.8 172.692 110.982 173.501 112.3C173.626 112.531 173.665 112.799 173.61 113.055C173.554 113.312 173.409 113.541 173.201 113.7C172.988 113.797 172.752 113.829 172.521 113.794C172.29 113.758 172.074 113.656 171.901 113.5C170.98 112.536 169.938 111.696 168.801 111C167.687 110.301 166.516 109.699 165.301 109.2C162.87 108.12 160.258 107.509 157.601 107.4C154.98 107.23 152.349 107.466 149.801 108.1C148.503 108.394 147.232 108.795 146.001 109.3L144.301 110.1L142.701 111H142.501C142.111 111.235 141.647 111.314 141.202 111.222C140.757 111.129 140.363 110.871 140.101 110.5C139.879 110.158 139.787 109.748 139.842 109.344C139.897 108.94 140.095 108.57 140.401 108.3Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M90.7 116.9C93.7701 114.782 97.3738 113.569 101.1 113.4C104.891 113.267 108.631 114.315 111.8 116.4C112.012 116.533 112.163 116.744 112.219 116.988C112.275 117.232 112.233 117.488 112.1 117.7C111.967 117.912 111.756 118.063 111.512 118.119C111.268 118.175 111.012 118.133 110.8 118C109.327 117.131 107.747 116.459 106.1 116C104.464 115.597 102.785 115.396 101.1 115.4C99.4126 115.346 97.7267 115.548 96.1 116C94.4209 116.458 92.8076 117.13 91.3 118C91.1522 118.045 90.9936 118.04 90.8489 117.986C90.7042 117.932 90.5815 117.831 90.5 117.7C90.4248 117.566 90.4036 117.409 90.4408 117.26C90.478 117.111 90.5707 116.982 90.7 116.9Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M165.9 118C164.418 117.148 162.841 116.477 161.2 116C159.538 115.555 157.82 115.352 156.1 115.4C152.685 115.329 149.321 116.231 146.4 118C146.184 118.082 145.947 118.087 145.728 118.014C145.51 117.941 145.323 117.795 145.2 117.6C145.087 117.399 145.055 117.163 145.111 116.94C145.167 116.717 145.306 116.524 145.5 116.4C148.669 114.315 152.408 113.267 156.2 113.4C159.923 113.585 163.522 114.796 166.6 116.9C166.67 116.949 166.73 117.012 166.774 117.086C166.818 117.16 166.845 117.242 166.855 117.327C166.864 117.412 166.855 117.499 166.829 117.58C166.802 117.662 166.758 117.737 166.7 117.8C166.605 117.914 166.476 117.994 166.332 118.03C166.188 118.066 166.037 118.056 165.9 118Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M155.1 120.699C156.868 120.699 158.3 119.266 158.3 117.499C158.3 115.732 156.868 114.299 155.1 114.299C153.333 114.299 151.9 115.732 151.9 117.499C151.9 119.266 153.333 120.699 155.1 120.699Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M101.801 120.699C103.568 120.699 105.001 119.266 105.001 117.499C105.001 115.732 103.568 114.299 101.801 114.299C100.033 114.299 98.6006 115.732 98.6006 117.499C98.6006 119.266 100.033 120.699 101.801 120.699Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M183.3 98.2992C184.956 104.573 185.895 111.014 186.1 117.499C185.61 119.414 185.744 121.436 186.481 123.27C187.218 125.104 188.521 126.655 190.2 127.699C190.2 127.699 191.2 125.399 192.3 122.399C193.4 119.399 193.6 114.199 195.2 113.699C195.472 113.634 195.756 113.627 196.032 113.679C196.307 113.731 196.569 113.84 196.8 113.999C197.339 109.922 197.44 105.798 197.1 101.699C196.6 95.9992 195.1 77.8992 184.6 73.7992C183.9 73.4992 179.4 71.7992 177.4 73.7992C175.4 75.7992 179.8 85.0992 183.3 98.2992Z\" fill=\"url(%23paint1_linear)\"/%3E%3Cpath d=\"M78.5999 97.1C76.9436 103.374 76.0043 109.815 75.7999 116.3C76.2893 118.215 76.1556 120.237 75.4184 122.071C74.6811 123.905 73.3787 125.456 71.6999 126.5C71.6999 126.5 70.6999 124.2 69.5999 121.2C68.4999 118.2 68.2999 113 66.6999 112.5C66.4294 112.412 66.1412 112.394 65.8617 112.446C65.5822 112.498 65.3203 112.62 65.0999 112.8C64.5618 108.722 64.4613 104.599 64.7999 100.5C65.2999 94.8 66.7999 76.7 77.2999 72.6C77.9999 72.3 82.4999 70.6 84.4999 72.6C86.4999 74.6 82.0999 83.9 78.5999 97.1Z\" fill=\"url(%23paint2_linear)\"/%3E%3Cpath d=\"M146.9 162.599C141.6 161.799 138.2 160.799 134.2 161.399H133.4C131.229 161.9 128.972 161.9 126.8 161.399H126C122.2 160.799 118.8 161.599 113.5 162.499L108.4 163.099C108.8 163.499 116.5 169.999 130.1 169.899C143.7 169.799 151.4 163.499 151.8 163.099C149.7 162.999 148 162.699 146.9 162.599Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M105.8 161.501C109.696 162.663 113.674 163.532 117.7 164.101C121.679 164.616 125.687 164.884 129.7 164.901C133.715 164.854 137.722 164.553 141.7 164.001L147.7 162.901C149.7 162.501 151.6 162.001 153.6 161.401C153.9 161.301 154.1 161.501 154.2 161.801C154.233 161.858 154.252 161.923 154.254 161.99C154.257 162.057 154.242 162.123 154.212 162.182C154.183 162.242 154.138 162.293 154.084 162.331C154.029 162.37 153.966 162.394 153.9 162.401C150.045 163.895 146.062 165.033 142 165.801C137.936 166.485 133.821 166.82 129.7 166.801L123.5 166.601C121.5 166.401 119.4 166.201 117.4 165.801C113.343 165.101 109.36 164.029 105.5 162.601C105.376 162.537 105.279 162.432 105.224 162.305C105.17 162.177 105.161 162.034 105.2 161.901C105.243 161.778 105.325 161.673 105.433 161.601C105.541 161.529 105.67 161.494 105.8 161.501Z\" fill=\"%23CB8C84\"/%3E%3Cpath d=\"M118.3 142.501L123.9 144.501L126.7 145.801C127.036 146.005 127.41 146.141 127.8 146.201H128.9C129.762 145.988 130.599 145.686 131.4 145.301L134.2 144.201C136.182 143.594 138.23 143.224 140.3 143.101C140.504 143.123 140.695 143.214 140.841 143.36C140.987 143.505 141.078 143.696 141.1 143.901C141.1 144.087 141.026 144.265 140.895 144.396C140.763 144.527 140.585 144.601 140.4 144.601C138.528 144.948 136.688 145.45 134.9 146.101C133.997 146.418 133.126 146.82 132.3 147.301C131.338 147.845 130.289 148.218 129.2 148.401H127.3C126.743 148.224 126.207 147.989 125.7 147.701L123 146.401L117.7 143.801C117.607 143.749 117.526 143.679 117.46 143.596C117.395 143.512 117.347 143.416 117.319 143.314C117.291 143.212 117.284 143.105 117.298 143C117.312 142.894 117.346 142.793 117.4 142.701C117.511 142.579 117.657 142.494 117.818 142.459C117.979 142.423 118.147 142.438 118.3 142.501Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M121.5 112.901C122.601 114.399 123.476 116.05 124.1 117.801C124.644 119.589 124.979 121.435 125.1 123.301C125.212 127.012 124.386 130.692 122.7 134.001C122.654 134.099 122.589 134.188 122.509 134.261C122.429 134.334 122.335 134.391 122.233 134.429C122.131 134.466 122.022 134.482 121.914 134.478C121.805 134.473 121.699 134.447 121.6 134.401C121.502 134.355 121.413 134.29 121.34 134.21C121.266 134.13 121.209 134.036 121.172 133.934C121.135 133.831 121.118 133.723 121.123 133.614C121.128 133.506 121.154 133.399 121.2 133.301C121.739 131.697 122.173 130.06 122.5 128.401C122.796 126.752 122.897 125.073 122.8 123.401C122.786 121.703 122.516 120.018 122 118.401C121.558 116.795 120.92 115.25 120.1 113.801C120.03 113.706 119.981 113.596 119.958 113.48C119.935 113.364 119.938 113.245 119.966 113.13C119.995 113.015 120.049 112.908 120.124 112.817C120.199 112.725 120.293 112.651 120.4 112.601C120.492 112.547 120.593 112.513 120.698 112.499C120.804 112.485 120.911 112.492 121.013 112.52C121.115 112.548 121.211 112.596 121.295 112.662C121.378 112.727 121.448 112.808 121.5 112.901Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M67.8999 84.2011C69.5364 75.9424 72.7262 68.0696 77.2999 61.0011C80.6553 55.7298 84.7657 50.9793 89.4999 46.9011C105.2 33.8011 124.6 32.4011 130.9 31.9011C147 30.8011 152.5 35.2011 163.6 30.0011C166.9 28.5011 170.9 26.0011 173.5 27.7011C176.1 29.4011 175.7 35.8011 174.5 41.2011C179.8 37.6011 183.5 38.1011 185 38.5011C193.4 40.4011 196.5 53.7011 196.5 61.6011C196.51 67.8479 194.704 73.963 191.3 79.2011L180 88.1011C177.98 85.6976 175.498 83.7251 172.7 82.3011C170.2 81.0011 163.6 78.2011 148.1 81.4011C135.4 84.0011 136.7 86.1011 130.1 87.0011C123.5 87.9011 105.7 74.5011 94.3999 76.2011C91.0999 76.7011 86.3999 78.8011 81.5999 86.4011L67.8999 84.2011Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M190.8 79.501C191.322 78.9105 191.79 78.2746 192.2 77.601C195.035 72.747 196.52 67.2225 196.5 61.6011C196.5 60.5011 196.5 59.4011 196.4 58.1011C193 57.5011 186.6 67.9011 170.4 73.3011C163.3 75.6011 160.7 74.801 151.5 78.101C146.525 79.8989 141.709 82.1065 137.1 84.7011C140.643 83.227 144.33 82.1212 148.1 81.4011C163.6 78.201 170.2 81.0011 172.7 82.3011C175.497 83.7251 177.98 85.6976 180 88.101L190.8 79.501Z\" fill=\"url(%23paint3_linear)\"/%3E%3Cpath d=\"M101.6 141.301C96.9915 141.301 92.4867 139.935 88.655 137.374C84.8234 134.814 81.8369 131.175 80.0734 126.918C78.3099 122.66 77.8485 117.975 78.7475 113.456C79.6466 108.936 81.8657 104.784 85.1242 101.526C88.3828 98.267 92.5345 96.0479 97.0542 95.1489C101.574 94.2498 106.259 94.7113 110.516 96.4748C114.774 98.2383 118.413 101.225 120.973 105.056C123.533 108.888 124.9 113.393 124.9 118.001C124.9 124.181 122.445 130.107 118.075 134.477C113.706 138.846 107.779 141.301 101.6 141.301ZM101.6 97.7012C97.5849 97.7012 93.6601 98.8918 90.3217 101.122C86.9834 103.353 84.3815 106.523 82.8451 110.233C81.3086 113.942 80.9066 118.024 81.6899 121.962C82.4732 125.899 84.4065 129.516 87.2455 132.355C90.0846 135.194 93.7017 137.128 97.6395 137.911C101.577 138.694 105.659 138.292 109.368 136.756C113.078 135.219 116.248 132.618 118.479 129.279C120.709 125.941 121.9 122.016 121.9 118.001C121.9 112.617 119.761 107.454 115.954 103.647C112.147 99.8399 106.984 97.7012 101.6 97.7012Z\" fill=\"%23FF8B00\"/%3E%3Cpath d=\"M155.7 141.301C151.092 141.301 146.587 139.935 142.756 137.374C138.924 134.814 135.938 131.175 134.174 126.918C132.41 122.66 131.949 117.975 132.848 113.456C133.747 108.936 135.966 104.784 139.225 101.526C142.483 98.267 146.635 96.0479 151.155 95.1489C155.675 94.2498 160.359 94.7113 164.617 96.4748C168.874 98.2383 172.513 101.225 175.074 105.056C177.634 108.888 179 113.393 179 118.001C178.974 124.173 176.511 130.084 172.147 134.448C167.783 138.812 161.872 141.275 155.7 141.301ZM155.7 97.7012C151.685 97.7012 147.761 98.8918 144.422 101.122C141.084 103.353 138.482 106.523 136.946 110.233C135.409 113.942 135.007 118.024 135.79 121.962C136.574 125.899 138.507 129.516 141.346 132.355C144.185 135.194 147.802 137.128 151.74 137.911C155.678 138.694 159.76 138.292 163.469 136.756C167.178 135.219 170.349 132.618 172.579 129.279C174.81 125.941 176 122.016 176 118.001C176 115.335 175.475 112.696 174.455 110.233C173.435 107.77 171.94 105.532 170.055 103.647C168.17 101.762 165.932 100.267 163.469 99.2464C161.006 98.2263 158.366 97.7012 155.7 97.7012Z\" fill=\"%23FF8B00\"/%3E%3Cpath d=\"M79.8 120.4H70.5C70.1022 120.4 69.7206 120.242 69.4393 119.961C69.158 119.68 69 119.298 69 118.9C69 118.503 69.158 118.121 69.4393 117.84C69.7206 117.558 70.1022 117.4 70.5 117.4H79.8C80.1978 117.4 80.5794 117.558 80.8607 117.84C81.142 118.121 81.3 118.503 81.3 118.9C81.3 119.298 81.142 119.68 80.8607 119.961C80.5794 120.242 80.1978 120.4 79.8 120.4Z\" fill=\"%23FF8B00\"/%3E%3Cpath d=\"M188.6 119.502H177.5C177.102 119.502 176.721 119.344 176.439 119.063C176.158 118.781 176 118.4 176 118.002C176 117.604 176.158 117.223 176.439 116.941C176.721 116.66 177.102 116.502 177.5 116.502H188.6C188.998 116.502 189.379 116.66 189.661 116.941C189.942 117.223 190.1 117.604 190.1 118.002C190.1 118.4 189.942 118.781 189.661 119.063C189.379 119.344 188.998 119.502 188.6 119.502Z\" fill=\"%23FF8B00\"/%3E%3Cpath d=\"M133.9 116.502H123.4V119.502H133.9V116.502Z\" fill=\"%23FF8B00\"/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"132.43\" y1=\"241.09\" x2=\"132.43\" y2=\"170.11\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23FFE2D9\"/%3E%3Cstop offset=\"1\" stop-color=\"%23EBBEAE\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint1_linear\" x1=\"186.89\" y1=\"127.739\" x2=\"186.89\" y2=\"72.8692\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop offset=\"0.39\" stop-color=\"%2397A0AF\"/%3E%3Cstop offset=\"0.43\" stop-color=\"%238A94A5\"/%3E%3Cstop offset=\"0.54\" stop-color=\"%23667389\"/%3E%3Cstop offset=\"0.66\" stop-color=\"%23495974\"/%3E%3Cstop offset=\"0.77\" stop-color=\"%23354764\"/%3E%3Cstop offset=\"0.89\" stop-color=\"%23293C5B\"/%3E%3Cstop offset=\"1\" stop-color=\"%23253858\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint2_linear\" x1=\"75.0099\" y1=\"126.54\" x2=\"75.0099\" y2=\"71.66\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop offset=\"0.18\" stop-color=\"%2397A0AF\"/%3E%3Cstop offset=\"0.22\" stop-color=\"%238A94A5\"/%3E%3Cstop offset=\"0.32\" stop-color=\"%23667389\"/%3E%3Cstop offset=\"0.42\" stop-color=\"%23495974\"/%3E%3Cstop offset=\"0.52\" stop-color=\"%23354764\"/%3E%3Cstop offset=\"0.61\" stop-color=\"%23293C5B\"/%3E%3Cstop offset=\"0.71\" stop-color=\"%23253858\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint3_linear\" x1=\"183.05\" y1=\"87.741\" x2=\"158.08\" y2=\"62.7711\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23091E42\" stop-opacity=\"0.1\"/%3E%3Cstop offset=\"1\" stop-color=\"%23091E42\"/%3E%3C/linearGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Myra.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::4abd36d8d13637bdf2c2e07e9a3f1dd0>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"257\" viewBox=\"0 0 256 257\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256.9C198.692 256.9 256 199.593 256 128.9C256 58.2079 198.692 0.900391 128 0.900391C57.3075 0.900391 0 58.2079 0 128.9C0 199.593 57.3075 256.9 128 256.9Z\" fill=\"%236554C0\"/%3E%3Cpath d=\"M217.1 221.1L189.2 202.2C182.213 197.515 174.099 194.787 165.7 194.3L131.6 192.5L97.5004 194.3C89.1299 194.771 81.0435 197.501 74.1004 202.2L42.4004 223.7C66.4207 245.502 97.8279 257.362 130.264 256.879C162.699 256.397 193.74 243.607 217.1 221.1Z\" fill=\"%23998DD9\"/%3E%3Cpath d=\"M194.5 214.3C189.9 193.2 191 177 192.9 166.1C195.2 152.7 201.3 132.4 195.6 122.7C192.912 118.298 191.016 113.458 190 108.4C189.714 106.712 189.514 105.009 189.4 103.3L67.8004 97.4004C64.5385 102.508 62.2342 108.167 61.0004 114.1C59.4095 121.726 59.4777 129.604 61.2004 137.2C67.6004 168.1 50.2004 191.6 61.7004 223.8C64.3395 231.31 68.1904 238.336 73.1004 244.6C91.4338 253.257 111.555 257.452 131.82 256.844C152.086 256.236 171.919 250.841 189.7 241.1C193.427 232.681 195.073 223.489 194.5 214.3Z\" fill=\"%23403294\"/%3E%3Cpath d=\"M171.7 216C170.6 217.5 154.4 237.7 127.5 236C105.2 234.6 92.4 219.1 90.5 216.7C95.794 212.504 99.4694 206.602 100.9 200C103.9 185.7 94 174.9 92.8 173.7L166.3 171C164.9 173 157.1 184.8 161.1 199.3C162.883 205.802 166.576 211.619 171.7 216Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M67.8008 102.002L69.0008 116.202C66.8008 123.002 51.6008 172.302 80.2008 210.302C84.5008 216.102 105.501 243.902 134.401 241.302C160.101 239.002 175.401 214.402 177.801 210.402C183.101 201.602 185.401 191.702 190.101 172.002C192.801 160.402 194.501 153.602 195.001 144.402C195.833 129.715 193.795 115.008 189.001 101.102L67.8008 102.002Z\" fill=\"url(%23paint1_linear)\"/%3E%3Cpath d=\"M80.0004 95.2C80.3004 98.8 80.6004 102.5 81.0004 106.2C79.2942 119.937 79.5974 133.85 81.9004 147.5C83.9004 159.4 92.2004 172.1 98.2004 181.5C100.1 184.4 108.5 204.1 131.6 202.6C150.7 201.3 157.8 187.5 161.1 182.4C168.202 172.531 172.863 161.119 174.7 149.1C177.527 130.986 177.257 112.523 173.9 94.5L80.0004 95.2Z\" fill=\"%23B08874\"/%3E%3Cpath d=\"M82.3001 96.1007C91.4001 85.5007 104.5 81.3007 108.2 80.1007C109.9 79.6007 138.7 70.8007 158 85.6007C166.2 91.9007 167.1 98.3007 182.9 111.801C186.9 115.201 190.5 117.901 192.9 119.601C195.576 111.555 196.396 103.008 195.3 94.6007C191.5 67.3007 166.3 46.2007 140.7 40.7007C127.431 37.8556 113.617 39.0039 101 44.0007C75.2001 54.8007 66.0001 78.5007 64.7001 82.1007C55.9001 106.101 64.2001 126.801 66.2001 131.301C66.9299 127.355 67.8645 123.45 69.0001 119.601C70.7001 113.701 71.8001 110.201 74.0001 106.301C74.7001 105.101 77.5001 101.701 82.3001 96.1007Z\" fill=\"%23403294\"/%3E%3Cpath d=\"M186.5 124.7C186.4 125.5 186.2 126.2 186.1 127C183.5 142.4 165.7 190.001 127.3 190.001C97.5004 190.001 72.4004 147.2 70.3004 124.7C69.4004 116.1 67.7004 98.3005 78.7004 81.2005C88.5004 65.9005 107.8 52.0005 130.7 53.6005C153.6 55.2005 169.2 73.4005 172.8 78.0005C182.8 90.8005 188.5 108.4 186.5 124.7Z\" fill=\"%23E4B69D\"/%3E%3Cpath d=\"M173.3 111.501C170.655 109.757 167.88 108.219 165 106.901C162.094 105.79 159.011 105.214 155.9 105.201C152.778 105.198 149.686 105.81 146.8 107.001C143.904 108.199 141.259 109.929 139 112.101C138.776 112.257 138.505 112.333 138.232 112.315C137.959 112.297 137.701 112.186 137.5 112.001C137.316 111.814 137.214 111.563 137.214 111.301C137.214 111.039 137.316 110.788 137.5 110.601C139.859 108.097 142.722 106.12 145.9 104.801C149.07 103.486 152.468 102.806 155.9 102.801C159.337 102.85 162.733 103.564 165.9 104.901C169.08 106.108 171.806 108.275 173.7 111.101C173.8 111.301 173.8 111.401 173.6 111.501C173.581 111.522 173.558 111.539 173.532 111.551C173.506 111.562 173.478 111.568 173.45 111.568C173.421 111.568 173.393 111.562 173.367 111.551C173.342 111.539 173.318 111.522 173.3 111.501Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M79.8997 111.101C81.8346 108.272 84.5927 106.108 87.7997 104.901C90.9362 103.534 94.3182 102.82 97.7394 102.803C101.161 102.786 104.55 103.466 107.7 104.801C110.891 106.095 113.759 108.075 116.1 110.601C116.29 110.804 116.395 111.072 116.395 111.351C116.395 111.629 116.29 111.897 116.1 112.101C115.896 112.247 115.651 112.326 115.4 112.326C115.149 112.326 114.904 112.247 114.7 112.101C112.405 109.926 109.726 108.196 106.8 107.001C103.919 105.791 100.824 105.179 97.6997 105.201C94.5887 105.214 91.5058 105.79 88.5997 106.901C85.7194 108.219 82.9446 109.757 80.2997 111.501C80.2865 111.554 80.2527 111.599 80.2058 111.627C80.1589 111.656 80.1028 111.664 80.0497 111.651C79.9967 111.637 79.9511 111.604 79.923 111.557C79.8948 111.51 79.8865 111.454 79.8997 111.401C79.8785 111.382 79.8614 111.359 79.8497 111.333C79.8381 111.307 79.832 111.279 79.832 111.251C79.832 111.222 79.8381 111.194 79.8497 111.168C79.8614 111.142 79.8785 111.119 79.8997 111.101Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M110.1 84.2001C131.4 78.0001 149.6 86.3001 155.2 89.1001C162.673 93.0882 169.404 98.3312 175.1 104.6C179.585 109.262 183.511 114.43 186.8 120C189.227 112.694 189.979 104.936 189 97.3001C185.6 72.5001 162.8 53.4001 139.5 48.4001C127.493 45.8135 114.986 46.8935 103.6 51.5001C100.4 52.8001 79.2 62.0001 70.7 86.0001C66.9406 96.8088 66.3508 108.467 69 119.6C72.1154 113.755 75.9815 108.343 80.5 103.5C85.3 98.4001 94.7 88.6001 110.1 84.2001Z\" fill=\"%235243AA\"/%3E%3Cpath d=\"M100.9 121.8C102.668 121.8 104.1 120.368 104.1 118.6C104.1 116.833 102.668 115.4 100.9 115.4C99.1329 115.4 97.7002 116.833 97.7002 118.6C97.7002 120.368 99.1329 121.8 100.9 121.8Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M86.7002 118.302C87.111 118.478 87.5533 118.568 88.0002 118.568C88.4472 118.568 88.8894 118.478 89.3002 118.302L89.8002 118.002L90.0002 117.802L90.3002 117.502C90.7417 117.073 91.2092 116.672 91.7002 116.302C93.6153 114.766 95.8843 113.735 98.3002 113.302C100.746 112.9 103.253 113.106 105.6 113.902C107.949 114.627 110.057 115.974 111.7 117.802C111.883 117.989 111.986 118.24 111.986 118.502C111.986 118.763 111.883 119.015 111.7 119.202C111.515 119.379 111.274 119.486 111.018 119.504C110.763 119.522 110.509 119.451 110.3 119.302H110.2C108.675 117.925 106.866 116.901 104.9 116.302C102.904 115.636 100.777 115.464 98.7002 115.802C96.6421 116.157 94.6925 116.978 93.0002 118.202L91.8002 119.102L91.5002 119.402L91.0002 119.802L90.0002 120.202C89.317 120.436 88.5734 120.424 87.8979 120.169C87.2223 119.913 86.6573 119.429 86.3002 118.802C86.2899 118.723 86.3035 118.642 86.3391 118.571C86.3747 118.5 86.4308 118.441 86.5002 118.402L86.7002 118.302Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M152.7 121.8C154.467 121.8 155.9 120.368 155.9 118.6C155.9 116.833 154.467 115.4 152.7 115.4C150.933 115.4 149.5 116.833 149.5 118.6C149.5 120.368 150.933 121.8 152.7 121.8Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M167.3 119.2C166.932 119.82 166.371 120.302 165.702 120.573C165.034 120.844 164.296 120.888 163.6 120.7L162.6 120.2L162.2 119.8L161.8 119.6C161.447 119.214 161.043 118.878 160.6 118.6C158.911 117.389 156.956 116.6 154.9 116.3C152.865 115.931 150.77 116.068 148.8 116.7C146.798 117.333 144.956 118.39 143.4 119.8C143.184 119.977 142.909 120.065 142.63 120.046C142.352 120.028 142.091 119.904 141.9 119.7C141.737 119.503 141.648 119.255 141.648 119C141.648 118.745 141.737 118.497 141.9 118.3C143.586 116.502 145.696 115.157 148.038 114.388C150.379 113.619 152.877 113.451 155.3 113.9C157.708 114.3 159.977 115.297 161.9 116.8L163.3 118L163.6 118.3C163.7 118.4 163.7 118.5 163.8 118.5L164.3 118.8C164.698 119.019 165.145 119.134 165.6 119.134C166.054 119.134 166.502 119.019 166.9 118.8C167.1 118.8 167.2 118.8 167.3 119V119.2Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M121.7 118.901C122.297 120.245 122.733 121.654 123 123.101C123.2 124.501 123.4 126.001 123.5 127.401C123.502 128.872 123.402 130.343 123.2 131.801C123.009 133.263 122.674 134.704 122.2 136.101C122.131 136.298 121.988 136.461 121.801 136.554C121.615 136.648 121.398 136.664 121.2 136.601C121.015 136.536 120.857 136.413 120.749 136.251C120.641 136.088 120.588 135.895 120.6 135.701C120.8 134.301 121 132.901 121.1 131.601C121.233 130.238 121.266 128.868 121.2 127.501C121.199 126.128 121.099 124.758 120.9 123.401C120.7 122.101 120.4 120.701 120.1 119.401C120.07 119.288 120.065 119.171 120.086 119.056C120.106 118.942 120.151 118.834 120.218 118.738C120.284 118.643 120.371 118.564 120.471 118.505C120.572 118.447 120.684 118.411 120.8 118.401C120.891 118.37 120.989 118.359 121.085 118.368C121.181 118.377 121.275 118.406 121.359 118.453C121.444 118.5 121.518 118.564 121.576 118.641C121.635 118.718 121.677 118.807 121.7 118.901Z\" fill=\"%23CEA28B\"/%3E%3Cpath d=\"M118.3 145.601C119.472 144.806 120.901 144.484 122.3 144.701L123.5 145.001L124.2 145.301H125.4L126.9 144.701L128.9 144.201C130.259 144.132 131.61 144.443 132.8 145.101C132.89 145.143 132.969 145.203 133.033 145.277C133.098 145.352 133.146 145.439 133.174 145.534C133.202 145.628 133.211 145.727 133.198 145.825C133.185 145.923 133.152 146.017 133.1 146.101C133.035 146.25 132.919 146.372 132.773 146.445C132.626 146.518 132.459 146.538 132.3 146.501C131.264 146.188 130.168 146.119 129.1 146.301C128.612 146.34 128.136 146.476 127.7 146.701C127.111 147.063 126.471 147.332 125.8 147.501C125.029 147.635 124.237 147.566 123.5 147.301L122.5 146.901L121.9 146.701C120.936 146.473 119.925 146.542 119 146.901H118.9C118.702 146.932 118.5 146.887 118.334 146.776C118.167 146.665 118.048 146.495 118 146.301C117.977 146.168 117.994 146.031 118.047 145.906C118.1 145.782 118.188 145.676 118.3 145.601Z\" fill=\"%23CEA28B\"/%3E%3Cpath d=\"M145.2 159.4C139.9 158.6 136.5 157.6 132.5 158.2H131.7C129.518 158.6 127.282 158.6 125.1 158.2H124.3C120.5 157.6 117.1 158.4 111.8 159.2C110.6 159.4 108.9 159.7 106.7 159.9C107.1 160.3 114.8 166.8 128.4 166.7C142 166.6 149.7 160.3 150.1 159.9L145.2 159.4Z\" fill=\"%23FF7143\"/%3E%3Cpath d=\"M104.1 158.3C107.999 159.43 111.977 160.266 116 160.8C119.97 161.415 123.985 161.683 128 161.6C132.017 161.603 136.029 161.302 140 160.7C142 160.5 144 160.1 146 159.7L151.9 158.2C152.2 158.1 152.5 158.3 152.5 158.5C152.533 158.565 152.55 158.636 152.552 158.709C152.554 158.781 152.541 158.853 152.512 158.92C152.484 158.986 152.441 159.046 152.387 159.094C152.333 159.143 152.27 159.179 152.2 159.2C148.346 160.695 144.363 161.833 140.3 162.6C136.237 163.285 132.121 163.619 128 163.6L121.8 163.4C119.8 163.2 117.7 163 115.7 162.6C111.631 161.913 107.643 160.807 103.8 159.3C103.731 159.279 103.668 159.243 103.614 159.194C103.56 159.146 103.517 159.086 103.489 159.02C103.46 158.953 103.446 158.881 103.448 158.809C103.45 158.736 103.468 158.665 103.5 158.6C103.6 158.4 103.9 158.2 104.1 158.3Z\" fill=\"%237A4F2C\"/%3E%3Cpath d=\"M67.9762 115.21L61.3697 116.82C59.6527 117.239 58.5995 118.968 59.0174 120.682C59.4354 122.397 61.1661 123.447 62.8831 123.028L69.4896 121.418C71.2067 120.999 72.2598 119.27 71.8419 117.556C71.424 115.842 69.6933 114.791 67.9762 115.21Z\" fill=\"%23EAE6FF\"/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"131.1\" y1=\"172.28\" x2=\"131.1\" y2=\"235.79\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23EBBEAE\"/%3E%3Cstop offset=\"0.64\" stop-color=\"%23FFE2D9\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint1_linear\" x1=\"129.101\" y1=\"241.502\" x2=\"129.101\" y2=\"101.122\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%238676D8\"/%3E%3Cstop offset=\"0.15\" stop-color=\"%236758BA\"/%3E%3Cstop offset=\"0.29\" stop-color=\"%235243A5\"/%3E%3Cstop offset=\"0.43\" stop-color=\"%23443698\"/%3E%3Cstop offset=\"0.55\" stop-color=\"%23403294\"/%3E%3C/linearGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Narul.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::b5e3028de2ef30dc4fd719174aa8cf6c>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"257\" viewBox=\"0 0 256 257\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256.9C198.692 256.9 256 199.593 256 128.9C256 58.2079 198.692 0.900391 128 0.900391C57.3075 0.900391 0 58.2079 0 128.9C0 199.593 57.3075 256.9 128 256.9Z\" fill=\"%23FF5630\"/%3E%3Cpath d=\"M216.9 221L189.2 202.3C182.2 197.6 174.1 194.9 165.7 194.4L131.6 192.5L97.4996 194.4C89.0996 194.9 80.9996 197.6 73.9996 202.3L42.0996 223.9C64.7996 244.4 94.9996 256.9 128 256.9C162.5 256.9 193.9 243.2 216.9 221Z\" fill=\"%23BF2600\"/%3E%3Cpath d=\"M194.5 214.3C189.9 193.2 191 177 192.9 166.1C195.2 152.6 201.4 132.4 195.7 122.7C195 121.4 191.6 116.2 190.1 108.4C189.7 106.2 189.5 104.4 189.5 103.3C149 101.3 108.4 99.4004 67.9002 97.4004C65.8002 100.8 62.7002 106.6 61.1002 114.2C58.7002 125.4 60.8002 134.5 61.4002 137.3C67.7002 168.2 50.4002 191.6 61.9002 223.9C64.8002 231.9 68.8002 238.9 73.4002 244.8C90.0002 252.6 108.5 257 128 257C150.5 257 171.6 251.2 189.9 241C193.3 232.8 195.1 223.7 194.5 214.3Z\" fill=\"%23FF8F73\"/%3E%3Cpath d=\"M171.7 216C170.6 217.5 154.4 237.6 127.5 236C105.1 234.6 92.4 219.1 90.5 216.7C92.7 214.9 99 209.3 100.9 200C103.9 185.6 94 174.9 92.8 173.6C117.3 172.7 141.8 171.8 166.3 171C164.9 173 157.1 184.8 161 199.3C163.5 208.2 169 213.7 171.7 216Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M67.7999 102C68.1999 106.8 68.5999 111.5 68.9999 116.3C66.7999 123.1 51.4999 172.3 80.0999 210.3C84.4999 216.1 105.4 244 134.4 241.4C160 239.1 175.4 214.5 177.8 210.5C183.1 201.7 185.4 191.8 190.1 172C192.8 160.4 194.4 153.6 195 144.4C195.6 134.7 195.2 119.6 189 101.1L67.7999 102Z\" fill=\"url(%23paint1_linear)\"/%3E%3Cpath d=\"M79.9995 95.2C80.2995 98.9 80.5995 102.5 80.9995 106.2C79.7995 115.8 79.0995 130.3 81.9995 147.6C83.9995 159.4 92.2995 172.1 98.2995 181.5C100.2 184.4 108.6 204.2 131.7 202.6C150.7 201.3 157.9 187.5 161.2 182.4C162.8 179.9 171.8 168.3 174.8 149.1C176.7 136.8 178.2 117.9 173.9 94.5L79.9995 95.2Z\" fill=\"%23A46C35\"/%3E%3Cpath d=\"M82.3001 96.1012C91.4001 85.5012 104.5 81.3012 108.2 80.1012C110 79.5012 138.8 70.7012 158 85.6012C166.2 92.0012 167.1 98.3012 182.9 111.801C186.9 115.201 190.5 117.901 192.9 119.601C194.6 114.301 196.8 105.301 195.3 94.6012C191.5 67.3012 166.3 46.2012 140.7 40.7012C120.3 36.3012 104.2 42.7012 101 44.0012C75.2001 54.8012 66.0001 78.5012 64.7001 82.1012C55.9001 106.101 64.2001 126.701 66.2001 131.301C66.8001 128.501 67.6001 124.401 69.1001 119.601C70.8001 113.701 71.9001 110.201 74.1001 106.301C74.7001 105.101 77.5001 101.701 82.3001 96.1012Z\" fill=\"%23FF8F73\"/%3E%3Cpath d=\"M186.5 124.702C186.4 125.502 186.3 126.202 186.2 127.002C183.5 142.402 165.8 190.002 127.4 190.002C97.7 190.002 72.6 147.302 70.4 124.802C69.6 116.202 67.9 98.4021 78.8 81.3021C88.6 66.0021 107.9 52.1021 130.8 53.7021C155.1 55.4021 169.2 73.5021 172.8 78.1021C182.8 90.8021 188.5 108.402 186.5 124.702Z\" fill=\"%23AC8457\"/%3E%3Cpath d=\"M173.3 111.501C170.5 109.801 167.9 108.101 165 106.901C162.1 105.801 159 105.201 155.9 105.201C152.8 105.201 149.7 105.801 146.8 107.001C143.9 108.201 141.3 109.901 139 112.001C138.6 112.401 137.9 112.401 137.5 112.001C137.1 111.601 137.1 111.001 137.5 110.601C139.8 108.101 142.7 106.101 145.9 104.801C149.1 103.501 152.5 102.801 155.9 102.801C159.3 102.801 162.7 103.501 165.9 104.901C169 106.201 172 108.201 173.8 111.101C173.9 111.201 173.8 111.401 173.7 111.501C173.5 111.601 173.4 111.601 173.3 111.501Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M79.8997 111.101C81.6997 108.201 84.6997 106.201 87.7997 104.901C90.8997 103.501 94.2997 102.801 97.7997 102.801C101.2 102.801 104.6 103.501 107.8 104.801C111 106.101 113.8 108.101 116.2 110.601C116.6 111.001 116.6 111.701 116.2 112.101C115.8 112.501 115.2 112.501 114.8 112.101C112.5 110.001 109.9 108.201 107 107.101C104.1 105.901 101 105.301 97.8997 105.301C94.7997 105.301 91.6997 105.901 88.7997 107.001C85.8997 108.201 83.2997 109.901 80.4997 111.601C80.3997 111.701 80.1996 111.601 80.0996 111.501C79.7996 111.301 79.7997 111.201 79.8997 111.101Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M110.101 84.2012C131.401 78.1012 149.601 86.3012 155.201 89.1012C165.101 94.1012 171.801 101.101 175.101 104.601C180.501 110.301 184.301 115.801 186.801 120.001C188.401 115.201 190.301 107.001 189.001 97.3012C185.601 72.5012 162.701 53.4012 139.501 48.4012C121.001 44.4012 106.401 50.2012 103.501 51.4012C100.401 52.7012 79.2005 62.0012 70.6005 85.9012C65.3005 100.901 67.6005 114.001 68.9005 119.501C71.2005 115.201 74.8005 109.301 80.4005 103.301C85.3005 98.4012 94.7005 88.6012 110.101 84.2012Z\" fill=\"%23FF7452\"/%3E%3Cpath d=\"M100.9 121.8C102.668 121.8 104.1 120.368 104.1 118.6C104.1 116.833 102.668 115.4 100.9 115.4C99.1329 115.4 97.7002 116.833 97.7002 118.6C97.7002 120.368 99.1329 121.8 100.9 121.8Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M86.7002 118.3C87.7002 118.7 88.6002 118.6 89.3002 118.3C89.5002 118.2 89.6002 118.1 89.8002 118C89.9002 117.9 89.9002 117.9 90.0002 117.8L90.3002 117.5C90.7002 117.1 91.2002 116.6 91.7002 116.3C93.6002 114.8 95.9002 113.7 98.3002 113.3C100.7 112.9 103.2 113.1 105.6 113.8C107.9 114.6 110.1 115.9 111.7 117.7C112.1 118.1 112.1 118.8 111.6 119.2C111.2 119.6 110.6 119.6 110.2 119.2C108.6 117.8 106.8 116.7 104.8 116.1C102.8 115.4 100.7 115.4 98.7002 115.7C96.6002 116 94.7002 116.8 93.0002 118C92.6002 118.3 92.2002 118.6 91.8002 119L91.5002 119.3C91.4002 119.4 91.2002 119.5 91.0002 119.6C90.7002 119.8 90.3002 120 90.0002 120.1C88.6002 120.5 86.9002 119.9 86.3002 118.7C86.2002 118.6 86.3002 118.4 86.4002 118.3C86.5002 118.3 86.6002 118.3 86.7002 118.3Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M152.7 121.8C154.467 121.8 155.9 120.368 155.9 118.6C155.9 116.833 154.467 115.4 152.7 115.4C150.933 115.4 149.5 116.833 149.5 118.6C149.5 120.368 150.933 121.8 152.7 121.8Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M167.3 119.201C166.7 120.401 165.1 121.101 163.6 120.601C163.2 120.501 162.9 120.301 162.6 120.101C162.4 120.001 162.3 119.901 162.1 119.801L161.8 119.501C161.4 119.201 161 118.801 160.6 118.501C158.9 117.301 156.9 116.501 154.9 116.201C152.9 115.901 150.7 116.001 148.8 116.601C146.8 117.201 145 118.301 143.4 119.701C143 120.101 142.3 120.101 141.9 119.601C141.5 119.201 141.5 118.601 141.9 118.201C143.6 116.401 145.7 115.101 148 114.301C150.3 113.501 152.9 113.401 155.3 113.801C157.7 114.201 160 115.301 161.9 116.801C162.4 117.201 162.8 117.601 163.3 118.001L163.6 118.301C163.7 118.401 163.7 118.401 163.8 118.501C163.9 118.601 164.1 118.701 164.3 118.801C165 119.201 165.9 119.201 166.9 118.801C167 118.701 167.2 118.801 167.3 119.001C167.3 119.101 167.3 119.201 167.3 119.201Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M121.6 118.901C122.1 120.201 122.5 121.701 122.8 123.101C123.1 124.501 123.2 126.001 123.3 127.401C123.4 130.301 123 133.201 122.1 136.001C122 136.401 121.6 136.601 121.2 136.501C120.8 136.401 120.6 136.001 120.7 135.701C120.9 134.301 121.1 133.001 121.2 131.601C121.3 130.201 121.4 128.901 121.3 127.501C121.3 126.101 121.2 124.801 121 123.401C120.8 122.001 120.6 120.701 120.2 119.401C120.1 119.001 120.4 118.601 120.8 118.501C121.1 118.401 121.5 118.601 121.6 118.901Z\" fill=\"%237A4F2C\"/%3E%3Cpath d=\"M116.3 146.701C117.9 145.801 119.8 145.301 121.8 145.601C122.3 145.701 122.8 145.901 123.3 146.101C123.7 146.301 124.1 146.501 124.4 146.601C125 146.801 125.8 146.901 126.5 146.701C127.2 146.601 127.9 146.201 128.7 145.901C129.5 145.501 130.5 145.301 131.5 145.201C133.4 145.001 135.3 145.401 136.9 146.201C137.2 146.401 137.4 146.801 137.2 147.101C137.1 147.401 136.7 147.601 136.4 147.401C134.8 146.901 133.2 146.701 131.7 146.901C130.9 147.001 130.2 147.301 129.5 147.601C128.8 147.901 127.9 148.401 126.9 148.601C125.9 148.801 124.8 148.801 123.8 148.401C123.3 148.201 122.8 148.001 122.5 147.801C122.2 147.601 121.9 147.501 121.5 147.401C120.1 147.101 118.5 147.301 116.9 147.901C116.5 148.001 116.2 147.901 116 147.501C115.9 147.201 116 146.801 116.3 146.701Z\" fill=\"%237A4F2C\"/%3E%3Cpath d=\"M149 162C149 162 139.9 165.6 128.7 165.6C117.5 165.6 108.4 162 108.4 162L114.3 160C117.3 159 120.6 159 123.7 160.1L123.9 160.2C127.1 161.4 130.5 161.4 133.7 160.2C136.7 159.1 140 159 143.1 160L149 162Z\" fill=\"%2372594B\"/%3E%3Cpath d=\"M149 162C149 162 144.3 172 128.7 172C113.1 172 108.4 162 108.4 162C112.8 163.6 119.9 165.6 128.7 165.6C137.5 165.6 144.6 163.6 149 162Z\" fill=\"%2372594B\"/%3E%3Cpath d=\"M105.8 160C107.6 160.8 109.5 161.6 111.3 162.2C113.2 162.8 115.1 163.4 117 163.8C120.9 164.6 124.8 165.1 128.7 165.1C132.6 165.1 136.6 164.6 140.4 163.8C142.3 163.4 144.2 162.8 146.1 162.2C148 161.6 149.8 160.8 151.7 160C151.9 159.9 152.1 160 152.2 160.2C152.3 160.4 152.2 160.6 152.1 160.7C150.4 161.8 148.6 162.7 146.7 163.6C144.8 164.4 142.9 165.1 140.9 165.7C136.9 166.8 132.8 167.4 128.7 167.4C126.6 167.4 124.6 167.3 122.5 167C120.5 166.7 118.4 166.4 116.4 165.8C112.4 164.7 108.6 163.2 105.1 161.1C104.8 160.9 104.7 160.6 104.9 160.3C105.2 160 105.5 159.9 105.8 160Z\" fill=\"%23230F05\"/%3E%3Cpath d=\"M99.8 141.401C86.9 141.401 76.5 130.901 76.5 118.101C76.5 105.301 87 94.8008 99.8 94.8008C112.6 94.8008 123.1 105.301 123.1 118.101C123.1 130.901 112.6 141.401 99.8 141.401ZM99.8 97.8008C88.6 97.8008 79.5 106.901 79.5 118.101C79.5 129.301 88.6 138.401 99.8 138.401C111 138.401 120.1 129.301 120.1 118.101C120.1 106.901 111 97.8008 99.8 97.8008Z\" fill=\"%23DFE1E5\"/%3E%3Cpath d=\"M153.901 141.401C141.001 141.401 130.601 130.901 130.601 118.101C130.601 105.301 141.101 94.8008 153.901 94.8008C166.701 94.8008 177.201 105.301 177.201 118.101C177.201 130.901 166.801 141.401 153.901 141.401ZM153.901 97.8008C142.701 97.8008 133.601 106.901 133.601 118.101C133.601 129.301 142.701 138.401 153.901 138.401C165.101 138.401 174.201 129.301 174.201 118.101C174.201 106.901 165.101 97.8008 153.901 97.8008Z\" fill=\"%23DFE1E5\"/%3E%3Cpath d=\"M78.0002 120.602H68.7002C67.9002 120.602 67.2002 119.902 67.2002 119.102C67.2002 118.302 67.9002 117.602 68.7002 117.602H78.0002C78.8002 117.602 79.5002 118.302 79.5002 119.102C79.5002 119.902 78.8002 120.602 78.0002 120.602Z\" fill=\"%23DFE1E5\"/%3E%3Cpath d=\"M186.7 119.602H175.7C174.9 119.602 174.2 118.902 174.2 118.102C174.2 117.302 174.9 116.602 175.7 116.602H186.7C187.5 116.602 188.2 117.302 188.2 118.102C188.2 118.902 187.6 119.602 186.7 119.602Z\" fill=\"%23DFE1E5\"/%3E%3Cpath d=\"M132.101 116.602H121.601V119.602H132.101V116.602Z\" fill=\"%23DFE1E5\"/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"131.103\" y1=\"172.281\" x2=\"131.103\" y2=\"235.79\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23EBBEAE\"/%3E%3Cstop offset=\"0.6411\" stop-color=\"%23FFE2D9\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint1_linear\" x1=\"129.101\" y1=\"241.498\" x2=\"129.101\" y2=\"101.12\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23FFEBE5\"/%3E%3Cstop offset=\"0.0131381\" stop-color=\"%23FFE7E0\"/%3E%3Cstop offset=\"0.1275\" stop-color=\"%23FFC8B9\"/%3E%3Cstop offset=\"0.2406\" stop-color=\"%23FFAF9A\"/%3E%3Cstop offset=\"0.3508\" stop-color=\"%23FF9D85\"/%3E%3Cstop offset=\"0.4566\" stop-color=\"%23FF9377\"/%3E%3Cstop offset=\"0.5534\" stop-color=\"%23FF8F73\"/%3E%3C/linearGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Norah.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::01a687767bc26da513a8562ec27d8eb0>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"258\" viewBox=\"0 0 256 258\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0.900391H256V257.6H0V0.900391Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M256 130.601V127.901C255.995 105.839 250.178 84.1675 239.136 65.0679C228.094 45.9682 212.216 30.1139 193.1 19.1006L190.9 17.7006C171.763 6.69832 150.074 0.908203 128 0.908203C105.926 0.908203 84.2372 6.69832 65.1 17.7006L62.9 19.1006C43.7838 30.1139 27.9057 45.9682 16.8637 65.0679C5.8217 84.1675 0.0053515 105.839 0 127.901L0 130.601C0.0053515 152.662 5.8217 174.334 16.8637 193.433C27.9057 212.533 43.7838 228.387 62.9 239.401L65.1 240.801C84.2372 251.803 105.926 257.593 128 257.593C150.074 257.593 171.763 251.803 190.9 240.801L193.1 239.401C212.216 228.387 228.094 212.533 239.136 193.433C250.178 174.334 255.995 152.662 256 130.601Z\" fill=\"%23FFAB00\"/%3E%3Cpath d=\"M130.4 193.201C143.3 165.201 140.8 130.601 130.4 106.301C120 130.601 117.5 165.201 130.4 193.201Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M216.4 203.3C211.9 193.1 204.8 192.2 203 182.4C201.2 172.6 207.7 169.6 212 153.4C213.2 148.6 217.4 131.7 211.3 113.1C209.388 106.386 206.196 100.104 201.9 94.6004C201.7 92.4004 201.6 90.1004 201.4 87.9004H59.6003C59.3003 89.3004 59.0003 91.8004 58.7003 95.0004C54.5506 100.419 51.4321 106.554 49.5003 113.1C43.4003 131.7 47.6003 148.6 48.8003 153.4C53.1003 169.6 59.7003 172.5 57.8003 182.4C55.9003 192.3 48.9003 193.1 44.5003 203.3C41.7003 209.5 40.9003 217.1 41.7003 224.1C48.1911 229.954 55.2996 235.084 62.9003 239.4L65.1003 240.8L72.3003 244.6C88.3003 240 108.1 226.6 121.5 208.3C127.2 208.4 133.4 208.3 139.1 208C151.7 225.3 170 238.3 185.5 243.6L190.9 240.8L193.1 239.4C202.722 233.9 211.567 227.14 219.4 219.3C219.499 213.819 218.478 208.374 216.4 203.3Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M156 245C151.14 245.005 146.362 243.744 142.136 241.342C137.91 238.94 134.383 235.479 131.9 231.3C128.779 236.603 124.01 240.739 118.319 243.079C112.628 245.418 106.328 245.832 100.38 244.257C94.4319 242.682 89.1621 239.205 85.3743 234.356C81.5865 229.507 79.4886 223.553 79.4004 217.4L55.2004 233.5C54.8765 233.61 54.5961 233.82 54.4004 234.1C57.1004 235.9 59.9004 237.8 62.9004 239.4L65.1004 240.8C84.2376 251.803 105.926 257.593 128 257.593C150.075 257.593 171.763 251.803 190.9 240.8L193.1 239.4C197.338 237.003 201.413 234.331 205.3 231.4L184.1 217.5C183.943 224.849 180.914 231.843 175.661 236.983C170.408 242.124 163.35 245.002 156 245Z\" fill=\"%23FFAB00\"/%3E%3Cpath d=\"M107.6 245.2C112.508 245.19 117.329 243.902 121.589 241.466C125.85 239.029 129.403 235.526 131.9 231.3C129.258 226.964 127.874 221.978 127.9 216.9C127.92 213.668 128.46 210.461 129.5 207.4L92.7004 209.4C91.9575 209.396 91.229 209.604 90.6004 210L79.4004 217.4C79.4795 224.818 82.4887 231.904 87.7715 237.112C93.0543 242.32 100.182 245.227 107.6 245.2Z\" fill=\"%23FFF0B2\"/%3E%3Cpath d=\"M131.9 231.3C135.031 236.527 139.775 240.595 145.419 242.891C151.062 245.187 157.299 245.586 163.19 244.029C169.08 242.472 174.305 239.043 178.076 234.258C181.848 229.473 183.962 223.592 184.1 217.5L172.9 210C172.277 209.594 171.545 209.385 170.8 209.4L134 207.4C135.409 211.297 135.951 215.454 135.588 219.582C135.225 223.71 133.967 227.709 131.9 231.3Z\" fill=\"%23FFF0B2\"/%3E%3Cpath d=\"M131.901 231.3C133.967 227.709 135.226 223.71 135.588 219.582C135.951 215.454 135.409 211.297 134.001 207.4H129.501C128.461 210.461 127.921 213.668 127.901 216.9C127.874 221.978 129.259 226.964 131.901 231.3Z\" fill=\"%23FFF0B2\"/%3E%3Cpath d=\"M167 212.001C166.1 213.201 151.1 233.201 126.3 231.301C106.2 229.701 94.9002 215.001 93.2002 212.701C98.193 208.926 101.754 203.566 103.3 197.501C106.2 184.701 98.1002 174.901 97.2002 173.801H159.9C159.5 174.401 150.2 187.201 156.1 200.401C158.366 205.356 162.196 209.431 167 212.001Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M78.7004 146.102C86.3219 146.102 92.5004 139.923 92.5004 132.302C92.5004 124.68 86.3219 118.502 78.7004 118.502C71.0789 118.502 64.9004 124.68 64.9004 132.302C64.9004 139.923 71.0789 146.102 78.7004 146.102Z\" fill=\"%238E572A\"/%3E%3Cpath d=\"M181.101 146.102C188.722 146.102 194.901 139.923 194.901 132.302C194.901 124.68 188.722 118.502 181.101 118.502C173.479 118.502 167.301 124.68 167.301 132.302C167.301 139.923 173.479 146.102 181.101 146.102Z\" fill=\"%238E572A\"/%3E%3Cpath d=\"M81.3001 104.502C81.3001 110.902 81.1001 117.002 80.8001 122.802C80.5001 128.602 80.5001 127.702 80.2001 133.202C79.4001 148.802 80.2001 152.802 76.8001 156.502C73.4001 160.202 71.4001 160.702 70.1001 159.802C68.8001 158.902 70.7001 155.202 71.5001 149.702C73.4001 136.202 68.9001 122.502 68.6001 121.402C67.6001 118.602 66.5001 115.902 66.6001 111.902C66.7001 109.502 67.0001 104.202 70.7001 102.202C74.4001 100.202 78.0001 101.602 81.3001 104.502Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M190.5 104.502C190.5 110.902 190.3 117.002 190 122.802C189.7 128.602 189.6 127.702 189.3 133.202C188.5 148.802 189.3 152.802 186 156.502C182.7 160.202 180.5 160.702 179.2 159.802C177.9 158.902 179.9 155.202 180.6 149.702C182.6 136.202 178.1 122.502 177.7 121.402C176.8 118.602 175.6 115.902 175.8 111.902C175.9 109.502 176.1 104.202 179.9 102.202C183.7 100.202 187.1 101.602 190.5 104.502Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M186.101 127.101C183.001 156.601 154.001 190.901 130.101 190.901C106.201 190.901 75.3008 156.801 74.1008 127.101C72.8008 94.2012 97.5008 57.2012 130.101 57.2012C162.701 57.2012 191.601 74.1012 186.101 127.101Z\" fill=\"%23AD6736\"/%3E%3Cpath d=\"M174.4 110.401L172.3 109.401L170.4 108.301L168.4 107.301L166.4 106.501C163.729 105.433 160.877 104.89 158 104.901C155.12 104.952 152.274 105.528 149.6 106.601C146.901 107.664 144.425 109.224 142.3 111.201C142.007 111.463 141.623 111.599 141.23 111.58C140.837 111.562 140.467 111.389 140.2 111.101C139.954 110.826 139.818 110.47 139.818 110.101C139.818 109.732 139.954 109.376 140.2 109.101C142.461 106.642 145.223 104.698 148.3 103.401C151.373 102.12 154.672 101.474 158 101.501C161.315 101.495 164.591 102.211 167.6 103.601C168.362 103.907 169.098 104.275 169.8 104.701L171.9 106.001L173.6 107.801C174.179 108.419 174.652 109.129 175 109.901C175.035 109.994 175.034 110.097 174.997 110.189C174.96 110.282 174.89 110.357 174.8 110.401H174.4Z\" fill=\"%23091E42\"/%3E%3Cpath d=\"M85.8008 109.902C86.1853 109.15 86.6551 108.446 87.2008 107.802L88.9008 106.002L91.0008 104.702L93.2008 103.602C96.2101 102.212 99.4862 101.495 102.801 101.502C106.13 101.464 109.432 102.11 112.501 103.402C115.578 104.699 118.34 106.643 120.601 109.102C120.863 109.395 120.999 109.779 120.98 110.172C120.962 110.565 120.789 110.935 120.501 111.202C120.226 111.448 119.87 111.584 119.501 111.584C119.132 111.584 118.776 111.448 118.501 111.202C116.376 109.225 113.9 107.665 111.201 106.602C108.527 105.529 105.681 104.953 102.801 104.902C99.924 104.891 97.0721 105.434 94.4008 106.502L92.4008 107.302L90.5008 108.302L88.5008 109.402L86.4008 110.402H86.3008C86.2075 110.436 86.1045 110.435 86.0121 110.398C85.9196 110.361 85.8443 110.291 85.8008 110.202V109.902Z\" fill=\"%23091E42\"/%3E%3Cpath style=\"mix-blend-mode:multiply\" opacity=\"0.24\" d=\"M130.4 151.602C138.132 151.602 144.4 145.334 144.4 137.602C144.4 129.87 138.132 123.602 130.4 123.602C122.668 123.602 116.4 129.87 116.4 137.602C116.4 145.334 122.668 151.602 130.4 151.602Z\" fill=\"url(%23paint1_radial)\"/%3E%3Cpath d=\"M125.201 116.602C125.719 117.966 126.12 119.371 126.401 120.802C126.721 122.213 126.889 123.655 126.901 125.102C126.95 126.542 126.85 127.983 126.601 129.402C126.445 130.829 126.144 132.237 125.701 133.602C125.612 133.807 125.451 133.972 125.247 134.064C125.044 134.157 124.814 134.17 124.601 134.102C124.507 134.079 124.419 134.037 124.342 133.979C124.265 133.92 124.201 133.846 124.154 133.762C124.107 133.677 124.078 133.584 124.069 133.487C124.06 133.391 124.071 133.294 124.101 133.202C124.328 131.88 124.462 130.543 124.501 129.202C124.634 127.84 124.668 126.469 124.601 125.102C124.601 123.763 124.5 122.426 124.301 121.102C124.101 119.802 123.901 118.402 123.601 117.102C123.566 116.891 123.607 116.675 123.717 116.492C123.827 116.309 123.999 116.17 124.201 116.102C124.399 116.076 124.599 116.11 124.777 116.199C124.956 116.288 125.103 116.429 125.201 116.602Z\" fill=\"%237D4921\"/%3E%3Cpath d=\"M120.901 142.901C121.586 142.516 122.329 142.246 123.101 142.101H124.301C124.868 142.149 125.4 142.397 125.801 142.801C126.187 143.31 126.622 143.779 127.101 144.201L127.601 144.401H128.401C128.877 144.379 129.333 144.204 129.701 143.901L130.201 143.201C130.441 142.75 130.83 142.396 131.301 142.201C131.722 141.942 132.207 141.803 132.701 141.801H133.901C134.675 141.882 135.423 142.12 136.101 142.501C136.188 142.531 136.266 142.581 136.33 142.646C136.394 142.711 136.443 142.79 136.472 142.877C136.501 142.964 136.509 143.056 136.497 143.147C136.485 143.238 136.452 143.325 136.401 143.401C136.34 143.531 136.24 143.64 136.115 143.712C135.989 143.783 135.845 143.814 135.701 143.801H135.601C134.989 143.596 134.347 143.494 133.701 143.501L132.201 143.701L131.801 144.201C131.644 144.553 131.403 144.861 131.101 145.101C130.817 145.468 130.453 145.766 130.038 145.974C129.622 146.182 129.166 146.293 128.701 146.301H127.301C126.796 146.206 126.318 146.001 125.901 145.701C125.311 145.221 124.804 144.646 124.401 144.001L124.101 143.801H123.201C122.594 143.852 121.992 143.952 121.401 144.101C121.309 144.131 121.212 144.142 121.116 144.133C121.02 144.124 120.926 144.095 120.842 144.048C120.757 144.001 120.683 143.937 120.625 143.86C120.566 143.783 120.524 143.695 120.501 143.601C120.488 143.457 120.519 143.313 120.59 143.187C120.662 143.062 120.77 142.962 120.901 142.901Z\" fill=\"%237D4921\"/%3E%3Cpath d=\"M148.401 159.602C143.101 158.802 139.801 154.802 135.801 155.402H135.001C133.901 155.702 132.601 156.802 131.401 156.702C130.201 156.602 129.401 155.602 128.501 155.402H127.701C124.001 154.802 120.601 158.602 115.301 159.502L110.301 160.102C116.011 165.751 123.719 168.919 131.751 168.919C139.783 168.919 147.491 165.751 153.201 160.102L148.401 159.602Z\" fill=\"%23713C1A\"/%3E%3Cpath d=\"M107.801 158.502C111.617 159.688 115.533 160.525 119.501 161.002C127.398 162.102 135.413 162.068 143.301 160.902C145.301 160.702 147.201 160.302 149.201 159.902L155.001 158.402C155.066 158.363 155.14 158.344 155.215 158.346C155.291 158.348 155.364 158.371 155.427 158.413C155.489 158.455 155.539 158.513 155.57 158.582C155.601 158.651 155.611 158.727 155.601 158.802C155.635 158.859 155.653 158.924 155.656 158.991C155.658 159.057 155.643 159.123 155.614 159.183C155.584 159.243 155.54 159.294 155.485 159.332C155.43 159.37 155.367 159.394 155.301 159.402C151.527 160.908 147.606 162.014 143.601 162.702C139.573 163.419 135.492 163.787 131.401 163.802C129.401 163.802 127.301 163.702 125.301 163.502C123.257 163.373 121.221 163.139 119.201 162.802C115.18 162.088 111.231 161.017 107.401 159.602C107.201 159.402 107.001 159.102 107.101 158.902C107.162 158.771 107.262 158.662 107.387 158.591C107.513 158.519 107.657 158.488 107.801 158.502Z\" fill=\"%234A0F00\"/%3E%3Cpath d=\"M93.8008 115.301C96.8505 113.142 100.466 111.925 104.201 111.801C107.913 111.692 111.571 112.702 114.701 114.701C114.902 114.843 115.044 115.054 115.099 115.294C115.155 115.533 115.12 115.785 115.001 116.001C114.863 116.178 114.67 116.304 114.453 116.359C114.235 116.413 114.006 116.393 113.801 116.301C112.297 115.523 110.723 114.887 109.101 114.401C107.493 114.014 105.853 113.78 104.201 113.701C102.512 113.73 100.833 113.965 99.2008 114.401C97.5635 114.843 95.9854 115.481 94.5008 116.301C94.44 116.355 94.367 116.393 94.2882 116.412C94.2093 116.432 94.1269 116.431 94.0482 116.412C93.9694 116.392 93.8966 116.353 93.8361 116.299C93.7756 116.245 93.7291 116.177 93.7008 116.101C93.6152 115.979 93.5779 115.83 93.5964 115.682C93.6149 115.534 93.6878 115.398 93.8008 115.301Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M168.301 116.3C166.816 115.481 165.238 114.843 163.601 114.4C161.966 113.979 160.289 113.744 158.601 113.7C156.916 113.779 155.243 114.014 153.601 114.4C152.011 114.886 150.47 115.523 149.001 116.3C148.892 116.369 148.769 116.413 148.641 116.429C148.513 116.446 148.383 116.435 148.26 116.397C148.136 116.359 148.023 116.295 147.926 116.21C147.83 116.124 147.753 116.018 147.701 115.9C147.609 115.696 147.589 115.466 147.643 115.249C147.698 115.031 147.824 114.838 148.001 114.7C151.148 112.707 154.819 111.7 158.543 111.807C162.266 111.913 165.873 113.13 168.901 115.3C168.997 115.395 169.058 115.519 169.075 115.652C169.092 115.786 169.063 115.921 168.994 116.036C168.925 116.152 168.819 116.241 168.693 116.288C168.568 116.336 168.429 116.341 168.301 116.3Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M157.501 118.9C159.268 118.9 160.701 117.467 160.701 115.7C160.701 113.933 159.268 112.5 157.501 112.5C155.733 112.5 154.301 113.933 154.301 115.7C154.301 117.467 155.733 118.9 157.501 118.9Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M104.801 118.9C106.568 118.9 108.001 117.467 108.001 115.7C108.001 113.933 106.568 112.5 104.801 112.5C103.033 112.5 101.601 113.933 101.601 115.7C101.601 117.467 103.033 118.9 104.801 118.9Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M90.1004 32.7013C105.882 22.1499 125.208 18.2979 143.829 21.9921C162.45 25.6863 178.842 36.6244 189.4 52.4013C195.2 61.1013 199.6 75.8013 201.4 87.9013C201.9 91.2013 186.6 118.401 186.7 121.001C186.7 83.1013 175.8 93.4013 159.2 70.4013C145.8 97.5013 91.2004 70.8013 76.0004 108.501C72.8004 108.301 61.3004 97.9013 58.4004 97.6013C59.7004 76.1013 70.7004 45.7013 90.1004 32.7013Z\" fill=\"%230C1F41\"/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"130.1\" y1=\"174.941\" x2=\"130.1\" y2=\"231.111\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%238E572A\"/%3E%3Cstop offset=\"1\" stop-color=\"%23AD6736\"/%3E%3C/linearGradient%3E%3CradialGradient id=\"paint1_radial\" cx=\"0\" cy=\"0\" r=\"1\" gradientUnits=\"userSpaceOnUse\" gradientTransform=\"translate(130.607 138.018) scale(14.0434)\"%3E%3Cstop stop-color=\"%23AD6736\" stop-opacity=\"0.5\"/%3E%3Cstop offset=\"0.18\" stop-color=\"%23B37142\" stop-opacity=\"0.45\"/%3E%3Cstop offset=\"0.47\" stop-color=\"%23C48B62\" stop-opacity=\"0.33\"/%3E%3Cstop offset=\"0.82\" stop-color=\"%23DFB696\" stop-opacity=\"0.12\"/%3E%3Cstop offset=\"1\" stop-color=\"%23F0D0B6\" stop-opacity=\"0\"/%3E%3C/radialGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0.900391H256V257.6H0V0.900391Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Oliver.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::53a506c1b452d8ca4531af6eca395aa6>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"257\" viewBox=\"0 0 256 257\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256.9C198.692 256.9 256 199.593 256 128.9C256 58.2079 198.692 0.900391 128 0.900391C57.3075 0.900391 0 58.2079 0 128.9C0 199.593 57.3075 256.9 128 256.9Z\" fill=\"%236554C0\"/%3E%3Cpath d=\"M64.7998 104.3C66.1998 70.1996 94.0998 38.0996 131 38.0996C167.9 38.0996 195.7 70.1996 197.2 104.3C198.7 140.9 169.5 176.5 131 176.4C92.4998 176.3 63.1998 140.9 64.7998 104.3Z\" fill=\"%23ECC19C\"/%3E%3Cpath d=\"M79.0708 142.796C86.4595 140.926 90.5601 131.945 88.2299 122.736C85.8996 113.527 78.0209 107.577 70.6323 109.447C63.2436 111.316 59.1429 120.297 61.4732 129.506C63.8034 138.716 71.6822 144.665 79.0708 142.796Z\" fill=\"%23F7D0C3\"/%3E%3Cpath d=\"M199.353 129.701C201.683 120.492 197.583 111.511 190.194 109.642C182.805 107.772 174.926 113.722 172.596 122.931C170.266 132.14 174.367 141.121 181.755 142.991C189.144 144.86 197.023 138.911 199.353 129.701Z\" fill=\"%23F7D0C3\"/%3E%3Cpath d=\"M211.5 225.9L185.5 211.4C184.725 210.81 183.775 210.493 182.8 210.5L132.4 207.9L82 210.5C81.0297 210.521 80.0883 210.834 79.3 211.4L48 228.8C71.3032 247.484 100.41 257.423 130.274 256.893C160.138 256.363 188.874 245.399 211.5 225.9Z\" fill=\"%235243AA\"/%3E%3Cpath d=\"M181 217.4C179.8 218.9 160 243.3 127.4 240.9C101 239 86.1004 221 83.9004 218.2C90.0336 212.375 94.1681 204.761 95.7127 196.445C97.2574 188.129 96.133 179.538 92.5004 171.9L170.1 170.1C168.9 172.4 162.4 185.8 168.1 200.7C170.708 207.389 175.187 213.187 181 217.4Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M130.9 42C158.6 42.2 175.5 60.9 178.1 63.9C195.6 84.1 193.8 108.2 193.4 113.3C192.4 125.7 187.4 135.6 177.7 155.6C173.311 164.804 168.403 173.752 163 182.4C161.489 184.864 159.302 186.842 156.7 188.1C148.698 192.218 139.893 194.539 130.9 194.9C121.874 194.55 113.034 192.229 105 188.1C102.444 186.813 100.297 184.839 98.8002 182.4C93.3601 173.756 88.4187 164.808 84.0002 155.6C74.4002 135.6 69.3002 125.7 68.4002 113.3C68.0002 108.2 66.1002 84.1 83.7002 63.9C86.3002 60.9 103.2 42.2 130.9 42Z\" fill=\"%23FFE2D9\"/%3E%3Cpath d=\"M115 110.899L113.4 109.999L111.7 109.199C110.469 108.695 109.198 108.293 107.9 107.999C105.352 107.366 102.721 107.13 100.1 107.299C97.443 107.409 94.8304 108.019 92.4002 109.099C91.1844 109.599 90.0135 110.201 88.9002 110.899C87.763 111.595 86.7209 112.435 85.8002 113.399C85.6132 113.583 85.3619 113.685 85.1001 113.685C84.8384 113.685 84.5871 113.583 84.4002 113.399C84.3011 113.34 84.2161 113.259 84.1511 113.164C84.0861 113.068 84.0426 112.959 84.0236 112.845C84.0046 112.731 84.0105 112.615 84.041 112.503C84.0715 112.391 84.1258 112.288 84.2001 112.199C85.0085 110.881 86.0211 109.7 87.2001 108.699C88.3584 107.656 89.6335 106.75 91.0001 105.999C93.6685 104.459 96.6343 103.504 99.7001 103.199C102.783 102.825 105.909 103.063 108.9 103.899C110.431 104.238 111.91 104.776 113.3 105.499L115.4 106.599C116.062 107.098 116.696 107.632 117.3 108.199C117.477 108.342 117.621 108.521 117.723 108.724C117.825 108.927 117.883 109.15 117.893 109.377C117.902 109.604 117.863 109.83 117.778 110.041C117.693 110.252 117.564 110.442 117.4 110.599C117.144 110.924 116.771 111.137 116.361 111.193C115.95 111.249 115.534 111.144 115.2 110.899H115Z\" fill=\"%23DFB28B\"/%3E%3Cpath d=\"M140.401 108.3C140.983 107.709 141.619 107.174 142.301 106.7L144.401 105.6C145.756 104.877 147.202 104.339 148.701 104C151.693 103.171 154.818 102.933 157.901 103.3C160.995 103.62 163.99 104.573 166.701 106.1C168.067 106.85 169.342 107.756 170.501 108.8C171.68 109.8 172.692 110.982 173.501 112.3C173.626 112.531 173.665 112.799 173.61 113.055C173.554 113.312 173.409 113.541 173.201 113.7C172.988 113.797 172.752 113.829 172.521 113.794C172.29 113.758 172.074 113.656 171.901 113.5C170.98 112.536 169.938 111.696 168.801 111C167.687 110.301 166.516 109.699 165.301 109.2C162.87 108.12 160.258 107.509 157.601 107.4C154.98 107.23 152.349 107.466 149.801 108.1C148.503 108.394 147.232 108.795 146.001 109.3L144.301 110.1L142.701 111H142.501C142.111 111.235 141.647 111.314 141.202 111.222C140.757 111.129 140.363 110.871 140.101 110.5C139.879 110.158 139.787 109.748 139.842 109.344C139.897 108.94 140.095 108.57 140.401 108.3Z\" fill=\"%23DFB28B\"/%3E%3Cpath d=\"M90.7 116.9C93.7701 114.782 97.3738 113.569 101.1 113.4C104.891 113.267 108.631 114.315 111.8 116.4C112.012 116.533 112.163 116.744 112.219 116.988C112.275 117.232 112.233 117.488 112.1 117.7C111.967 117.912 111.756 118.063 111.512 118.119C111.268 118.175 111.012 118.133 110.8 118C109.327 117.131 107.747 116.459 106.1 116C104.464 115.597 102.785 115.396 101.1 115.4C99.4126 115.346 97.7267 115.548 96.1 116C94.4209 116.458 92.8076 117.13 91.3 118C91.1522 118.045 90.9936 118.04 90.8489 117.986C90.7042 117.932 90.5815 117.831 90.5 117.7C90.4248 117.566 90.4036 117.409 90.4408 117.26C90.478 117.111 90.5707 116.982 90.7 116.9Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M165.9 118C164.418 117.148 162.841 116.477 161.2 116C159.538 115.555 157.82 115.352 156.1 115.4C152.685 115.329 149.321 116.231 146.4 118C146.184 118.082 145.947 118.087 145.728 118.014C145.51 117.941 145.323 117.795 145.2 117.6C145.087 117.399 145.055 117.163 145.111 116.94C145.167 116.717 145.306 116.524 145.5 116.4C148.669 114.315 152.408 113.267 156.2 113.4C159.923 113.585 163.522 114.796 166.6 116.9C166.67 116.949 166.73 117.012 166.774 117.086C166.818 117.16 166.845 117.242 166.855 117.327C166.864 117.412 166.855 117.499 166.829 117.58C166.802 117.662 166.758 117.737 166.7 117.8C166.605 117.914 166.476 117.994 166.332 118.03C166.188 118.066 166.037 118.056 165.9 118Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M155.1 122.599C156.868 122.599 158.3 121.167 158.3 119.399C158.3 117.632 156.868 116.199 155.1 116.199C153.333 116.199 151.9 117.632 151.9 119.399C151.9 121.167 153.333 122.599 155.1 122.599Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M101.801 122.599C103.568 122.599 105.001 121.167 105.001 119.399C105.001 117.632 103.568 116.199 101.801 116.199C100.033 116.199 98.6006 117.632 98.6006 119.399C98.6006 121.167 100.033 122.599 101.801 122.599Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M183.3 98.2992C184.956 104.573 185.895 111.014 186.1 117.499C185.61 119.414 185.744 121.436 186.481 123.27C187.218 125.104 188.521 126.655 190.2 127.699C190.2 127.699 191.2 125.399 192.3 122.399C193.4 119.399 193.6 114.199 195.2 113.699C195.472 113.634 195.756 113.627 196.032 113.679C196.307 113.731 196.569 113.84 196.8 113.999C197.339 109.922 197.44 105.798 197.1 101.699C196.6 95.9992 195.1 77.8992 184.6 73.7992C183.9 73.4992 179.4 71.7992 177.4 73.7992C175.4 75.7992 179.8 85.0992 183.3 98.2992Z\" fill=\"url(%23paint1_linear)\"/%3E%3Cpath d=\"M78.6004 97.1C76.9441 103.374 76.0048 109.815 75.8004 116.3C76.2898 118.215 76.1561 120.237 75.4189 122.071C74.6816 123.905 73.3791 125.456 71.7004 126.5C71.7004 126.5 70.7004 124.2 69.6004 121.2C68.5004 118.2 68.3004 113 66.7004 112.5C66.4299 112.412 66.1417 112.394 65.8622 112.446C65.5827 112.498 65.3207 112.62 65.1004 112.8C64.5623 108.722 64.4618 104.599 64.8004 100.5C65.3004 94.8 66.8004 76.7 77.3004 72.6C78.0004 72.3 82.5004 70.6 84.5004 72.6C86.5004 74.6 82.1004 83.9 78.6004 97.1Z\" fill=\"url(%23paint2_linear)\"/%3E%3Cpath d=\"M146.9 162.599C141.6 161.799 138.2 160.799 134.2 161.399H133.4C131.229 161.9 128.972 161.9 126.8 161.399H126C122.2 160.799 118.8 161.599 113.5 162.499L108.4 163.099C108.8 163.499 116.5 169.999 130.1 169.899C143.7 169.799 151.4 163.499 151.8 163.099C149.7 162.999 148 162.699 146.9 162.599Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M105.8 161.501C109.696 162.663 113.674 163.532 117.7 164.101C121.679 164.616 125.687 164.884 129.7 164.901C133.715 164.854 137.722 164.553 141.7 164.001L147.7 162.901C149.7 162.501 151.6 162.001 153.6 161.401C153.9 161.301 154.1 161.501 154.2 161.801C154.233 161.858 154.252 161.923 154.254 161.99C154.257 162.057 154.242 162.123 154.212 162.182C154.183 162.242 154.138 162.293 154.084 162.331C154.029 162.37 153.966 162.394 153.9 162.401C150.045 163.895 146.062 165.033 142 165.801C137.936 166.485 133.821 166.82 129.7 166.801L123.5 166.601C121.5 166.401 119.4 166.201 117.4 165.801C113.343 165.101 109.36 164.029 105.5 162.601C105.376 162.537 105.279 162.432 105.224 162.305C105.17 162.177 105.161 162.034 105.2 161.901C105.243 161.778 105.325 161.673 105.433 161.601C105.541 161.529 105.67 161.494 105.8 161.501Z\" fill=\"%23CB8C84\"/%3E%3Cpath d=\"M118.3 142.501L123.9 144.501L126.7 145.801C127.036 146.005 127.41 146.141 127.8 146.201H128.9C129.762 145.988 130.599 145.686 131.4 145.301L134.2 144.201C136.182 143.594 138.23 143.224 140.3 143.101C140.504 143.123 140.695 143.214 140.841 143.36C140.987 143.505 141.078 143.696 141.1 143.901C141.1 144.087 141.026 144.265 140.895 144.396C140.763 144.527 140.585 144.601 140.4 144.601C138.528 144.948 136.688 145.45 134.9 146.101C133.997 146.418 133.126 146.82 132.3 147.301C131.338 147.845 130.289 148.218 129.2 148.401H127.3C126.743 148.224 126.207 147.989 125.7 147.701L123 146.401L117.7 143.801C117.607 143.749 117.526 143.679 117.46 143.596C117.395 143.512 117.347 143.416 117.319 143.314C117.291 143.212 117.284 143.105 117.298 143C117.312 142.894 117.346 142.793 117.4 142.701C117.511 142.579 117.657 142.494 117.818 142.459C117.979 142.423 118.147 142.438 118.3 142.501Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M121.5 112.901C122.601 114.399 123.476 116.05 124.1 117.801C124.644 119.589 124.979 121.435 125.1 123.301C125.212 127.012 124.386 130.692 122.7 134.001C122.654 134.099 122.589 134.188 122.509 134.261C122.429 134.334 122.335 134.391 122.233 134.429C122.131 134.466 122.022 134.482 121.914 134.478C121.805 134.473 121.699 134.447 121.6 134.401C121.502 134.355 121.413 134.29 121.34 134.21C121.266 134.13 121.209 134.036 121.172 133.934C121.135 133.831 121.118 133.723 121.123 133.614C121.128 133.506 121.154 133.399 121.2 133.301C121.739 131.697 122.173 130.06 122.5 128.401C122.796 126.752 122.897 125.073 122.8 123.401C122.786 121.703 122.516 120.018 122 118.401C121.558 116.795 120.92 115.25 120.1 113.801C120.03 113.706 119.981 113.596 119.958 113.48C119.935 113.364 119.938 113.245 119.966 113.13C119.995 113.015 120.049 112.908 120.124 112.817C120.199 112.725 120.293 112.651 120.4 112.601C120.492 112.547 120.593 112.513 120.698 112.499C120.804 112.485 120.911 112.492 121.013 112.52C121.115 112.548 121.211 112.596 121.295 112.662C121.378 112.727 121.448 112.808 121.5 112.901Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M67.9004 84.2011C69.5369 75.9424 72.7267 68.0696 77.3004 61.0011C80.6558 55.7298 84.7662 50.9793 89.5004 46.9011C105.2 33.8011 124.6 32.4011 130.9 31.9011C147 30.8011 152.5 35.2011 163.6 30.0011C166.9 28.5011 170.9 26.0011 173.5 27.7011C176.1 29.4011 175.7 35.8011 174.5 41.2011C179.8 37.6011 183.5 38.1011 185 38.5011C193.4 40.4011 196.5 53.7011 196.5 61.6011C196.511 67.8479 194.704 73.963 191.3 79.2011L180 88.1011C177.981 85.6976 175.498 83.7251 172.7 82.3011C170.2 81.0011 163.6 78.2011 148.1 81.4011C135.4 84.0011 136.7 86.1011 130.1 87.0011C123.5 87.9011 105.7 74.5011 94.4004 76.2011C91.1004 76.7011 86.4004 78.8011 81.6004 86.4011L67.9004 84.2011Z\" fill=\"%23ECC19C\"/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"132.43\" y1=\"241.09\" x2=\"132.43\" y2=\"170.11\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23FFE2D9\"/%3E%3Cstop offset=\"1\" stop-color=\"%23EBBEAE\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint1_linear\" x1=\"186.89\" y1=\"127.739\" x2=\"186.89\" y2=\"72.8692\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop offset=\"0.39\" stop-color=\"%23F5E0CD\"/%3E%3Cstop offset=\"0.48\" stop-color=\"%23F3D8C0\"/%3E%3Cstop offset=\"0.65\" stop-color=\"%23EFCBAC\"/%3E%3Cstop offset=\"0.83\" stop-color=\"%23EDC4A0\"/%3E%3Cstop offset=\"1\" stop-color=\"%23ECC19C\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint2_linear\" x1=\"75.0104\" y1=\"126.54\" x2=\"75.0104\" y2=\"71.66\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop offset=\"0.18\" stop-color=\"%23F5E0CD\"/%3E%3Cstop offset=\"0.26\" stop-color=\"%23F3D8C0\"/%3E%3Cstop offset=\"0.41\" stop-color=\"%23EFCBAC\"/%3E%3Cstop offset=\"0.56\" stop-color=\"%23EDC4A0\"/%3E%3Cstop offset=\"0.71\" stop-color=\"%23ECC19C\"/%3E%3C/linearGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Rahul.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::b07b6a534d9c87185cc6c9fccbe7501a>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"257\" viewBox=\"0 0 256 257\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256.9C198.692 256.9 256 199.593 256 128.9C256 58.2079 198.692 0.900391 128 0.900391C57.3075 0.900391 0 58.2079 0 128.9C0 199.593 57.3075 256.9 128 256.9Z\" fill=\"%2300C7E5\"/%3E%3Cpath d=\"M81.3254 142.131C88.3928 140.342 92.3099 131.731 90.0745 122.897C87.8391 114.062 80.2977 108.351 73.2303 110.139C66.1629 111.927 62.2458 120.539 64.4812 129.373C66.7166 138.207 74.258 143.919 81.3254 142.131Z\" fill=\"%23DFB28B\"/%3E%3Cpath d=\"M196.506 129.486C198.742 120.652 194.824 112.041 187.757 110.252C180.69 108.464 173.148 114.176 170.913 123.01C168.677 131.844 172.595 140.456 179.662 142.244C186.729 144.032 194.271 138.32 196.506 129.486Z\" fill=\"%23DFB28B\"/%3E%3Cpath d=\"M180.199 220.8C146.024 209.196 108.974 209.196 74.7992 220.8C74.7992 213.5 74.7992 206.3 74.6992 199C91.3469 191.544 109.39 187.714 127.632 187.766C145.873 187.818 163.894 191.75 180.499 199.3L180.199 220.8Z\" fill=\"%23008DA6\"/%3E%3Cpath d=\"M211.9 225.6L189.9 213.6C184.177 210.456 177.819 208.645 171.3 208.3L128 206.1L83.7996 208.4C77.8433 208.696 72.0313 210.337 66.7996 213.2L44.0996 225.6C67.3902 245.786 97.1783 256.899 128 256.899C158.821 256.899 188.609 245.786 211.9 225.6Z\" fill=\"%23008DA6\"/%3E%3Cpath d=\"M111.199 226.9V255.9C116.643 256.535 122.118 256.869 127.599 256.9C133.755 256.876 139.902 256.442 145.999 255.6V226.9H111.199Z\" fill=\"%2379E2F2\"/%3E%3Cpath d=\"M184 213.9C180.7 216.9 154.1 232.5 130.5 246C111.3 234.4 86.4 218.6 82 214.7C87.5225 209.66 91.5382 203.186 93.6 196C96.155 186.802 95.266 176.988 91.1 168.4L172.6 166.6C171.4 168.9 164.6 182.2 170.5 197.2C173.315 203.94 178 209.734 184 213.9Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M130.899 42C158.599 42.2 175.499 60.9 178.099 63.9C195.599 84.1 193.799 108.2 193.399 113.3C192.399 125.7 187.399 135.6 177.699 155.6C173.31 164.804 168.402 173.752 162.999 182.4C161.488 184.864 159.302 186.842 156.699 188.1C148.697 192.218 139.892 194.539 130.899 194.9C121.873 194.55 113.033 192.229 104.999 188.1C102.443 186.813 100.296 184.839 98.7993 182.4C93.3591 173.756 88.4177 164.808 83.9993 155.6C74.3993 135.6 69.2993 125.7 68.3993 113.3C67.9993 108.2 66.0993 84.1 83.6993 63.9C86.2993 60.9 103.199 42.2 130.899 42Z\" fill=\"%23ECC19C\"/%3E%3Cpath d=\"M109.699 105.4C107.701 104.88 105.659 104.545 103.599 104.4C101.596 104.2 99.5733 104.301 97.5995 104.7C95.5702 105.119 93.5921 105.756 91.6995 106.6C89.7156 107.548 87.8097 108.651 85.9995 109.9C85.85 110.015 85.6787 110.099 85.4958 110.147C85.3129 110.195 85.1223 110.205 84.9354 110.177C84.7486 110.149 84.5693 110.083 84.4084 109.984C84.2476 109.885 84.1085 109.754 83.9995 109.6C83.813 109.356 83.7119 109.057 83.7119 108.75C83.7119 108.442 83.813 108.144 83.9995 107.9C85.4229 105.792 87.219 103.962 89.2995 102.5C90.349 101.753 91.452 101.085 92.5995 100.5C93.7377 99.8875 94.9467 99.4174 96.1995 99.0997C98.7828 98.2859 101.506 98.0136 104.199 98.2997C106.837 98.512 109.396 99.2969 111.699 100.6C112.281 100.971 112.699 101.551 112.866 102.221C113.033 102.89 112.938 103.598 112.599 104.2C112.33 104.68 111.91 105.058 111.403 105.275C110.897 105.492 110.333 105.536 109.799 105.4H109.699Z\" fill=\"%23344563\"/%3E%3Cpath d=\"M144.099 101.201C147.75 99.033 151.959 97.9896 156.199 98.2005L158.299 98.5005L160.399 98.9005C163.089 99.5562 165.633 100.709 167.899 102.301C170.181 103.769 172.152 105.672 173.699 107.901C173.815 108.05 173.899 108.221 173.947 108.404C173.994 108.587 174.004 108.778 173.976 108.965C173.948 109.151 173.883 109.331 173.784 109.492C173.684 109.652 173.554 109.792 173.399 109.901C173.155 110.087 172.857 110.188 172.549 110.188C172.242 110.188 171.943 110.087 171.699 109.901C169.79 108.558 167.745 107.419 165.599 106.501C164.567 106.013 163.497 105.612 162.399 105.301C161.356 104.972 160.285 104.738 159.199 104.601C157.048 104.267 154.86 104.234 152.699 104.501C150.533 104.751 148.392 105.186 146.299 105.801H146.199C145.597 105.973 144.954 105.922 144.387 105.657C143.819 105.393 143.366 104.933 143.111 104.361C142.856 103.79 142.815 103.145 142.997 102.546C143.178 101.947 143.57 101.434 144.099 101.101V101.201Z\" fill=\"%23344563\"/%3E%3Cpath d=\"M90.6996 113.001C93.7493 110.842 97.3652 109.625 101.1 109.501C104.881 109.331 108.621 110.345 111.8 112.401C111.901 112.47 111.988 112.56 112.054 112.664C112.119 112.769 112.163 112.885 112.182 113.007C112.201 113.129 112.194 113.254 112.163 113.373C112.131 113.492 112.076 113.604 112 113.701C111.876 113.895 111.682 114.034 111.459 114.09C111.236 114.145 111 114.114 110.8 114.001C109.323 113.163 107.743 112.525 106.1 112.101C102.832 111.167 99.3675 111.167 96.0996 112.101C94.4242 112.524 92.8108 113.163 91.2996 114.001C91.2349 114.064 91.1566 114.113 91.0706 114.142C90.9845 114.171 90.893 114.18 90.8029 114.169C90.7128 114.157 90.6265 114.126 90.5504 114.076C90.4744 114.026 90.4106 113.96 90.3638 113.882C90.3171 113.804 90.2887 113.717 90.2807 113.626C90.2727 113.536 90.2853 113.445 90.3176 113.36C90.3499 113.275 90.4011 113.199 90.4673 113.136C90.5335 113.074 90.6129 113.028 90.6996 113.001Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M165.9 114.001C164.415 113.181 162.837 112.543 161.2 112.101C159.543 111.623 157.825 111.387 156.1 111.401C154.408 111.388 152.723 111.624 151.1 112.101C149.463 112.543 147.885 113.181 146.4 114.001C146.298 114.069 146.183 114.112 146.062 114.129C145.941 114.145 145.818 114.133 145.702 114.095C145.586 114.056 145.481 113.992 145.394 113.906C145.307 113.82 145.24 113.716 145.2 113.601C145.108 113.396 145.088 113.166 145.142 112.949C145.197 112.731 145.323 112.538 145.5 112.401C148.678 110.345 152.418 109.331 156.2 109.501C159.932 109.637 163.545 110.852 166.6 113.001C166.733 113.094 166.823 113.235 166.851 113.395C166.879 113.554 166.843 113.718 166.75 113.851C166.657 113.983 166.515 114.074 166.356 114.102C166.197 114.13 166.033 114.094 165.9 114.001Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M155.099 116.701C156.867 116.701 158.299 115.268 158.299 113.501C158.299 111.733 156.867 110.301 155.099 110.301C153.332 110.301 151.899 111.733 151.899 113.501C151.899 115.268 153.332 116.701 155.099 116.701Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M101.8 116.701C103.567 116.701 105 115.268 105 113.501C105 111.733 103.567 110.301 101.8 110.301C100.032 110.301 98.5996 111.733 98.5996 113.501C98.5996 115.268 100.032 116.701 101.8 116.701Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M102.7 251L116 223.9L74.6996 199L69.0996 218L102.7 251Z\" fill=\"%23008DA6\"/%3E%3Cpath d=\"M152.699 251L139.399 223.9L180.699 199L186.299 218L152.699 251Z\" fill=\"%23008DA6\"/%3E%3Cpath d=\"M182.299 142.6L181.599 142.8L181.199 143.3C176.999 148.1 171.499 154.2 168.699 155.5C163.499 157.9 155.199 158.2 150.599 153.5C148.905 151.724 146.783 150.414 144.436 149.696C142.089 148.978 139.597 148.876 137.199 149.4C133.101 150.467 128.798 150.467 124.699 149.4C122.502 148.79 120.184 148.765 117.974 149.326C115.765 149.888 113.739 151.016 112.099 152.6C107.599 157.4 98.9993 157.3 94.0993 154.4C91.1993 152.7 84.7993 146.4 80.1993 142.2C80.0966 142.061 79.9597 141.951 79.802 141.881C79.6443 141.811 79.4711 141.783 79.2993 141.8C78.9811 141.8 78.6758 141.926 78.4508 142.151C78.2258 142.376 78.0993 142.681 78.0993 143C78.0838 143.172 78.1185 143.346 78.1993 143.5C80.3993 148.1 83.3993 154.4 84.0993 155.7C88.4665 164.85 93.3753 173.733 98.7993 182.3C100.333 184.769 102.511 186.775 105.099 188.1C113.111 192.18 121.915 194.466 130.899 194.8C139.925 194.45 148.766 192.129 156.799 188C159.374 186.74 161.528 184.76 162.999 182.3C165.299 178.7 169.299 172.1 173.899 163.3C176.699 157.8 179.899 151.4 183.099 144.5C183.171 144.206 183.307 143.933 183.499 143.7C183.5 143.546 183.469 143.395 183.407 143.254C183.346 143.114 183.256 142.988 183.143 142.884C183.03 142.781 182.896 142.702 182.751 142.653C182.606 142.604 182.452 142.586 182.299 142.6Z\" fill=\"%23505F79\"/%3E%3Cpath d=\"M146.9 162.001C141.6 160.801 138.2 159.401 134.2 160.201L133.4 160.401C131.256 161.104 128.944 161.104 126.8 160.401L126 160.201C122.2 159.401 118.8 160.601 113.5 161.901L108.4 162.901C111.026 166.121 114.336 168.717 118.089 170.499C121.842 172.282 125.945 173.206 130.1 173.206C134.255 173.206 138.358 172.282 142.112 170.499C145.865 168.717 149.175 166.121 151.8 162.901L146.9 162.001Z\" fill=\"%23B5917C\"/%3E%3Cpath d=\"M105.8 161.501C109.711 162.583 113.685 163.418 117.7 164.001C121.677 164.533 125.689 164.767 129.7 164.701C133.713 164.684 137.721 164.417 141.7 163.901L147.7 162.801C149.7 162.401 151.6 161.901 153.6 161.301C153.746 161.269 153.898 161.292 154.028 161.366C154.157 161.44 154.254 161.56 154.3 161.701C154.338 161.86 154.318 162.027 154.245 162.173C154.172 162.32 154.05 162.436 153.9 162.501C150.076 163.982 146.127 165.12 142.1 165.901C138.002 166.582 133.854 166.916 129.7 166.901C127.6 166.901 125.6 166.901 123.5 166.701C121.4 166.501 119.4 166.301 117.4 165.901C113.331 165.214 109.343 164.108 105.5 162.601C105.351 162.536 105.229 162.42 105.156 162.273C105.083 162.127 105.063 161.96 105.1 161.801C105.164 161.678 105.269 161.581 105.397 161.526C105.524 161.471 105.667 161.463 105.8 161.501Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M121.5 112.901C122.601 114.399 123.476 116.05 124.1 117.801C124.644 119.589 124.979 121.435 125.1 123.301C125.212 127.012 124.386 130.692 122.7 134.001C122.654 134.099 122.589 134.188 122.509 134.261C122.429 134.334 122.335 134.391 122.233 134.429C122.131 134.466 122.022 134.482 121.914 134.478C121.805 134.473 121.699 134.447 121.6 134.401C121.502 134.355 121.413 134.29 121.34 134.21C121.266 134.13 121.209 134.036 121.172 133.934C121.135 133.831 121.118 133.723 121.123 133.614C121.128 133.506 121.154 133.399 121.2 133.301C121.739 131.697 122.173 130.06 122.5 128.401C122.796 126.752 122.897 125.073 122.8 123.401C122.786 121.703 122.516 120.018 122 118.401C121.558 116.795 120.92 115.25 120.1 113.801C120.03 113.706 119.981 113.596 119.958 113.48C119.935 113.364 119.938 113.245 119.966 113.13C119.995 113.015 120.049 112.908 120.124 112.817C120.199 112.725 120.293 112.651 120.4 112.601C120.492 112.547 120.593 112.513 120.698 112.499C120.804 112.485 120.911 112.492 121.013 112.52C121.115 112.548 121.211 112.596 121.295 112.662C121.378 112.727 121.448 112.808 121.5 112.901Z\" fill=\"%23CEA28B\"/%3E%3Cpath d=\"M128.9 146.9H128C127.119 146.817 126.266 146.544 125.5 146.1C124.893 145.738 124.206 145.532 123.5 145.5C121.884 145.419 120.272 145.727 118.8 146.4C118.691 146.468 118.568 146.512 118.44 146.529C118.312 146.545 118.182 146.534 118.059 146.496C117.936 146.458 117.822 146.394 117.726 146.309C117.629 146.223 117.553 146.118 117.5 146C117.394 145.746 117.386 145.461 117.478 145.202C117.571 144.943 117.757 144.728 118 144.6C119.761 143.71 121.735 143.329 123.7 143.5C124.647 143.572 125.567 143.845 126.4 144.3C126.955 144.617 127.566 144.821 128.2 144.9C129.412 145.04 130.636 144.795 131.7 144.2C133.047 143.518 134.502 143.078 136 142.9C138.016 142.801 140.03 143.142 141.9 143.9C142.025 143.946 142.14 144.016 142.237 144.106C142.335 144.196 142.414 144.305 142.47 144.425C142.525 144.546 142.557 144.676 142.562 144.809C142.567 144.942 142.546 145.075 142.5 145.2C142.454 145.324 142.384 145.439 142.294 145.536C142.204 145.634 142.095 145.713 141.975 145.769C141.854 145.824 141.723 145.856 141.591 145.861C141.458 145.866 141.325 145.845 141.2 145.8C139.586 145.132 137.846 144.825 136.1 144.9C134.846 145.055 133.628 145.427 132.5 146C131.393 146.592 130.156 146.902 128.9 146.9Z\" fill=\"%23CEA28B\"/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"133.02\" y1=\"245.98\" x2=\"133.02\" y2=\"166.56\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23ECC19C\"/%3E%3Cstop offset=\"1\" stop-color=\"%23DFB28B\"/%3E%3C/linearGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Renato.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::ddb1fb078dd1c77be44aa488ef7625d8>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"257\" viewBox=\"0 0 256 257\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256.9C198.692 256.9 256 199.593 256 128.9C256 58.2079 198.692 0.900391 128 0.900391C57.3075 0.900391 0 58.2079 0 128.9C0 199.593 57.3075 256.9 128 256.9Z\" fill=\"%230065FF\"/%3E%3Cpath d=\"M182.4 218.2C170.6 214.2 152.6 209.6 130.5 209.5C107.6 209.4 89 214.1 77 218.2C77 210.9 77 203.7 77 196.4C87.4 191.7 107 184.6 132.4 185.2C155.1 185.7 172.7 192.1 182.8 196.7C182.6 203.9 182.5 211 182.4 218.2Z\" fill=\"%230049B0\"/%3E%3Cpath d=\"M112.4 224.3H146.2V255.6C172.3 251.9 195.9 240.3 214.4 223.3L192 211.1C186.3 208 179.9 206.2 173.3 205.8L130 203.5L85.9996 205.8C79.9996 206.1 74.1996 207.8 68.9996 210.6L43.0996 224.7C61.9996 241.5 85.9996 252.7 112.4 255.9V224.3Z\" fill=\"%230049B0\"/%3E%3Cpath d=\"M112.399 224.299V255.899C117.499 256.499 122.699 256.799 127.999 256.799C134.199 256.799 140.299 256.399 146.299 255.499V224.199H112.399V224.299Z\" fill=\"%234C9AFF\"/%3E%3Cpath d=\"M85.6999 122.801C87.9999 132.001 83.8999 141.001 76.4999 142.801C69.0999 144.701 61.1999 138.701 58.8999 129.501C56.5999 120.301 60.6999 111.301 68.0999 109.501C75.4999 107.701 83.2999 113.601 85.6999 122.801Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M170 122.8C167.7 132 171.8 141 179.2 142.8C186.6 144.6 194.5 138.7 196.8 129.5C199.1 120.3 195 111.3 187.6 109.5C180.2 107.6 172.3 113.6 170 122.8Z\" fill=\"url(%23paint1_linear)\"/%3E%3Cpath d=\"M174.499 211.5C167.699 216.3 160.899 221.1 154.199 225.9C138.699 236.9 117.799 236.7 102.499 225.2C96.6992 220.9 90.8992 216.5 85.1992 212.2C87.5992 208.1 90.3992 202.3 92.0992 195.1C94.3992 185.4 93.8992 177.1 93.1992 171.7C116.999 171.2 140.799 170.7 164.599 170.1C163.899 175.5 163.599 184.2 166.499 194.3C168.599 201.8 171.899 207.5 174.499 211.5Z\" fill=\"url(%23paint2_linear)\"/%3E%3Cpath d=\"M128.3 42C156 42.2 172.9 60.9 175.5 63.9C193.1 84.1 191.2 108.2 190.8 113.2C190.8 113.2 190.4 118.2 189.1 123.7C185.1 140.7 178 156.2 178 156.2C172.2 168.9 169.1 175.5 162 182.1C158.3 185.5 155 187.5 154.2 188.1C143.2 194.7 132.6 194.8 128.3 194.8C123.4 194.8 112.9 194.7 102.4 188.1C98.6001 185.7 96.2001 183.3 94.6 181.8C90.6 177.8 87.4 173.4 79.7 156.6C79.7 156.6 70.3001 136 67.4001 123.5C66.1001 118.2 65.7 113.2 65.7 113.2C65.3 108.1 63.4001 84.1 81.0001 63.9C83.7001 60.9 100.6 42.2 128.3 42Z\" fill=\"%239B6435\"/%3E%3Cpath d=\"M111.3 109.2C111.3 109.3 111.1 109.2 111 109.1L110.6 108.9C110.3 108.8 110.1 108.7 109.8 108.6C109.3 108.4 108.7 108.2 108.2 108C107.1 107.6 105.9 107.3 104.8 107C103.6 106.7 102.4 106.5 101.2 106.4C99.9999 106.3 98.7999 106.2 97.5999 106.2C95.1999 106.3 92.7999 106.7 90.3999 107.5C89.1999 107.9 88.0999 108.4 86.8999 109C85.7999 109.6 84.6999 110.3 83.8999 111L83.5999 111.2C82.7999 111.9 81.4999 111.7 80.8999 110.9C80.3999 110.3 80.2999 109.5 80.6999 108.8C81.4999 107.2 82.5999 105.9 83.6999 104.8C84.8999 103.7 86.1999 102.7 87.5999 101.8C88.9999 101 90.4999 100.2 91.9999 99.7003C93.5999 99.1003 95.1999 98.7003 96.7999 98.5003C100.2 98.0003 103.4 98.3003 106.7 99.1003C108.3 99.5003 109.9 100.1 111.4 100.9C112.2 101.3 112.9 101.7 113.6 102.2C113.9 102.5 114.3 102.7 114.6 103C114.8 103.1 114.9 103.3 115.1 103.5C115.3 103.7 115.4 103.8 115.7 104.1C117.1 105.4 117.3 107.5 116 109C115 110.3 112.8 110.5 111.3 109.2Z\" fill=\"%23091E42\"/%3E%3Cpath d=\"M136.7 104.001C137 103.701 137.1 103.601 137.3 103.401C137.5 103.201 137.6 103.101 137.8 102.901C138.1 102.601 138.5 102.301 138.8 102.101C139.5 101.601 140.2 101.201 141 100.801C142.5 100.001 144.1 99.4007 145.7 99.0007C149 98.2007 152.2 97.9007 155.6 98.4007C157.3 98.6007 158.9 99.0007 160.4 99.6007C162 100.101 163.4 100.901 164.8 101.701C166.2 102.501 167.5 103.501 168.7 104.701C169.9 105.801 170.9 107.101 171.7 108.701C172.2 109.701 171.8 110.801 170.8 111.301C170.1 111.701 169.3 111.501 168.7 111.101L168.4 110.901C167.6 110.201 166.5 109.501 165.4 108.901C164.3 108.301 163.1 107.801 161.9 107.401C159.5 106.601 157.1 106.101 154.7 106.101C153.5 106.101 152.3 106.201 151.1 106.301C149.9 106.401 148.7 106.701 147.5 106.901C146.3 107.101 145.2 107.501 144.1 107.901C143.6 108.101 143 108.301 142.5 108.501C142.2 108.601 142 108.701 141.7 108.801L141.3 109.001C141.2 109.001 141 109.101 141 109.101C139.6 110.401 137.4 110.201 136.1 108.801C135.1 107.401 135.3 105.301 136.7 104.001Z\" fill=\"%23091E42\"/%3E%3Cpath d=\"M88.0996 116.9C91.0996 114.8 94.7996 113.5 98.4996 113.4C102.2 113.2 106.1 114.3 109.2 116.3C109.6 116.6 109.7 117.2 109.5 117.6C109.2 118 108.7 118.1 108.3 117.9C106.8 117.1 105.2 116.4 103.6 116C102 115.5 100.3 115.3 98.5996 115.3C96.8996 115.3 95.1996 115.5 93.5996 116C91.9996 116.4 90.2996 117.1 88.7996 117.9C88.4996 118.1 88.0996 118 87.9996 117.7C87.7996 117.5 87.8996 117.1 88.0996 116.9Z\" fill=\"%23091E42\"/%3E%3Cpath d=\"M163.4 118C161.9 117.2 160.3 116.5 158.6 116.1C156.9 115.7 155.3 115.4 153.6 115.4C151.9 115.4 150.2 115.6 148.6 116.1C147 116.5 145.4 117.2 143.9 118C143.5 118.2 142.9 118.1 142.6 117.6C142.4 117.2 142.5 116.6 142.9 116.4C146 114.3 149.8 113.3 153.6 113.5C157.4 113.6 161 114.9 164 117C164.3 117.2 164.3 117.6 164.1 117.9C164 118 163.6 118.1 163.4 118Z\" fill=\"%23091E42\"/%3E%3Cpath d=\"M152.5 120.701C154.267 120.701 155.7 119.268 155.7 117.501C155.7 115.733 154.267 114.301 152.5 114.301C150.732 114.301 149.3 115.733 149.3 117.501C149.3 119.268 150.732 120.701 152.5 120.701Z\" fill=\"%23091E42\"/%3E%3Cpath d=\"M99.2 120.701C100.967 120.701 102.4 119.268 102.4 117.501C102.4 115.733 100.967 114.301 99.2 114.301C97.4327 114.301 96 115.733 96 117.501C96 119.268 97.4327 120.701 99.2 120.701Z\" fill=\"%23091E42\"/%3E%3Cpath d=\"M90.5997 61.3996C99.3997 55.2996 107.2 57.9996 126.4 58.0996C152.3 58.2996 154.8 53.4996 163.7 58.0996C177.7 65.1996 182.3 82.2996 182.7 83.6996C186.5 98.3996 179.8 107.3 186.4 119C187.3 120.6 188.3 121.9 189.3 123.1C190.5 117.8 190.9 113.3 190.9 113.3C191.3 108.2 193.2 84.1996 175.6 63.9996C173 60.9996 156.1 42.2996 128.4 42.0996C100.6 42.1996 83.6997 60.8996 81.0997 63.8996C63.4997 84.0996 65.3997 108.2 65.7997 113.2C65.7997 113.2 66.1997 118.1 67.4997 123.5C78.8997 105.9 70.5997 91.0996 80.9997 72.8996C83.1997 69.0996 85.5997 64.7996 90.5997 61.3996Z\" fill=\"url(%23paint3_linear)\"/%3E%3Cpath d=\"M112.4 247.6L112.5 215.6L76.8998 196.4L71.2998 215.4L112.4 247.6Z\" fill=\"%230049B0\"/%3E%3Cpath d=\"M146.3 251.6L145.6 214.3L182.9 196.4L188.5 215.4L146.3 251.6Z\" fill=\"%230049B0\"/%3E%3Cpath d=\"M115.7 142.6C117.6 143.2 119.5 143.9 121.3 144.7C122.2 145.1 123.1 145.5 124 146C124.5 146.2 124.9 146.4 125.1 146.5C125.4 146.6 125.9 146.6 126.3 146.5C127.1 146.4 127.9 146 128.8 145.6C129.7 145.2 130.7 144.8 131.7 144.5C133.7 143.9 135.7 143.5 137.7 143.4C138.1 143.4 138.4 143.7 138.4 144C138.4 144.3 138.2 144.6 137.8 144.7C135.9 145 134 145.5 132.2 146.1C131.3 146.4 130.5 146.8 129.6 147.3C128.7 147.7 127.7 148.3 126.5 148.4C125.9 148.5 125.3 148.5 124.7 148.4C124 148.3 123.5 148 123.1 147.7C122.2 147.3 121.4 146.8 120.5 146.4C118.7 145.5 116.9 144.8 115.2 143.8C114.9 143.6 114.7 143.2 114.9 142.9C115 142.6 115.4 142.5 115.7 142.6Z\" fill=\"%237A4F2C\"/%3E%3Cpath d=\"M118.8 112.9C119.9 114.4 120.7 116 121.3 117.8C121.9 119.6 122.2 121.4 122.3 123.3C122.4 127 121.6 130.7 119.9 134C119.7 134.4 119.3 134.5 118.9 134.3C118.6 134.1 118.4 133.7 118.5 133.4C119.1 131.8 119.6 130.1 119.9 128.5C120.2 126.8 120.4 125.1 120.2 123.4C120.1 121.7 119.8 120 119.4 118.4C118.9 116.8 118.2 115.2 117.4 113.7C117.2 113.3 117.3 112.9 117.7 112.7C118.2 112.5 118.6 112.6 118.8 112.9Z\" fill=\"%237A4F2C\"/%3E%3Cpath d=\"M75.9995 117.699C77.1995 117.799 78.2995 117.999 79.3995 117.999C80.4995 117.999 81.5995 117.899 82.7995 117.699C83.0995 117.599 83.4995 117.899 83.4995 118.199C83.4995 118.399 83.3995 118.699 83.1995 118.799C82.0995 119.599 80.6995 119.899 79.2995 119.899C77.8995 119.899 76.4995 119.599 75.3995 118.799C75.0995 118.599 75.0995 118.199 75.2995 117.899C75.4995 117.799 75.7995 117.699 75.9995 117.699Z\" fill=\"%237A4F2C\"/%3E%3Cpath d=\"M172.099 117.699C173.299 117.799 174.399 117.999 175.499 117.999C176.599 117.999 177.699 117.899 178.899 117.699C179.199 117.599 179.599 117.899 179.599 118.199C179.599 118.399 179.499 118.699 179.299 118.799C178.199 119.599 176.799 119.899 175.399 119.899C173.999 119.899 172.599 119.599 171.499 118.799C171.199 118.599 171.199 118.199 171.399 117.899C171.599 117.799 171.799 117.699 172.099 117.699Z\" fill=\"%237A4F2C\"/%3E%3Cpath d=\"M171.7 121.799C172.8 122.399 173.7 122.999 174.7 123.399C175.7 123.899 176.8 124.199 177.9 124.499C178.2 124.599 178.4 124.899 178.3 125.299C178.2 125.499 178 125.699 177.8 125.699C176.5 125.899 175.1 125.699 173.8 125.199C172.5 124.699 171.4 123.799 170.7 122.599C170.5 122.299 170.6 121.899 171 121.799C171.2 121.599 171.4 121.699 171.7 121.799Z\" fill=\"%237A4F2C\"/%3E%3Cpath d=\"M76.8995 124.899C77.9995 124.399 78.9995 124.099 79.9995 123.499C80.9995 122.999 81.8995 122.399 82.8995 121.599C83.1995 121.399 83.5995 121.499 83.7995 121.699C83.8995 121.899 83.9995 122.199 83.7995 122.399C83.1995 123.599 82.0995 124.599 80.8995 125.199C79.6995 125.899 78.2995 126.199 76.8995 125.999C76.5995 125.899 76.2995 125.599 76.3995 125.299C76.4995 125.099 76.6995 124.999 76.8995 124.899Z\" fill=\"%237A4F2C\"/%3E%3Cpath d=\"M109.1 83.4996C111.5 83.3996 113.9 83.2996 116.3 83.1996C118.7 83.0996 121.1 83.0996 123.5 83.0996C125.9 83.0996 128.3 83.0996 130.7 83.0996C133.1 83.1996 135.5 83.1996 137.9 83.3996C138.2 83.3996 138.5 83.6996 138.5 84.0996C138.5 84.3996 138.2 84.5996 137.9 84.6996C135.5 84.8996 133.1 84.9996 130.7 84.9996C128.3 84.9996 125.9 85.0996 123.5 84.9996C121.1 84.9996 118.7 84.9996 116.3 84.8996C113.9 84.7996 111.5 84.7996 109.1 84.5996C108.8 84.5996 108.5 84.2996 108.5 83.8996C108.5 83.6996 108.8 83.4996 109.1 83.4996Z\" fill=\"%237A4F2C\"/%3E%3Cpath d=\"M116.4 77.2008C118.8 77.1008 121.2 77.0008 123.6 76.9008C126 76.8008 128.4 76.8008 130.8 76.8008C133.2 76.8008 135.6 76.8008 138 76.8008C140.4 76.9008 142.8 76.9008 145.2 77.1008C145.5 77.1008 145.8 77.4008 145.8 77.8008C145.8 78.1008 145.5 78.3008 145.2 78.4008C142.8 78.6008 140.4 78.7008 138 78.7008C135.6 78.7008 133.2 78.8008 130.8 78.7008C128.4 78.7008 126 78.7008 123.6 78.6008C121.2 78.5008 118.8 78.5008 116.4 78.3008C116.1 78.3008 115.8 78.0008 115.8 77.6008C115.9 77.4008 116.1 77.2008 116.4 77.2008Z\" fill=\"%237A4F2C\"/%3E%3Cpath d=\"M144.8 165.101C139.5 164.301 136 163.301 132.1 163.901C131.8 163.901 131.7 163.901 131.3 164.001C129.1 164.501 126.8 164.501 124.7 164.001C124.3 163.901 124.2 163.901 123.9 163.901C120.1 163.301 116.8 164.201 111.4 165.001C110.3 165.201 108.5 165.401 106.3 165.701C106.7 166.101 114.4 172.501 128 172.501C141.6 172.501 149.3 166.101 149.7 165.701C147.6 165.401 145.9 165.201 144.8 165.101Z\" fill=\"%23744B28\"/%3E%3Cpath d=\"M103.7 163.999C107.6 165.099 111.5 165.999 115.5 166.499C119.5 166.999 123.5 167.399 127.5 167.299C131.5 167.299 135.6 166.999 139.5 166.399C141.5 166.099 143.5 165.799 145.5 165.299C147.5 164.899 149.4 164.399 151.4 163.799C151.7 163.699 152 163.899 152.1 164.199C152.2 164.499 152 164.699 151.8 164.799C148 166.299 144 167.399 139.9 168.199C135.8 168.899 131.7 169.299 127.6 169.299C125.5 169.299 123.5 169.199 121.4 168.999C119.3 168.799 117.3 168.599 115.3 168.199C111.2 167.499 107.2 166.499 103.4 164.999C103.1 164.899 103 164.599 103.1 164.299C103.2 164.099 103.5 163.999 103.7 163.999Z\" fill=\"%235C3B21\"/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"82.7969\" y1=\"123.356\" x2=\"62.4944\" y2=\"128.803\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23855731\"/%3E%3Cstop offset=\"1\" stop-color=\"%239A6439\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint1_linear\" x1=\"170.329\" y1=\"126.181\" x2=\"190.637\" y2=\"126.181\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23855731\"/%3E%3Cstop offset=\"1\" stop-color=\"%239A6439\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint2_linear\" x1=\"129.868\" y1=\"234.003\" x2=\"129.868\" y2=\"170.108\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%239A6439\"/%3E%3Cstop offset=\"1\" stop-color=\"%23855731\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint3_linear\" x1=\"128.318\" y1=\"129.566\" x2=\"128.318\" y2=\"35.5833\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%239A6439\"/%3E%3Cstop offset=\"0.1492\" stop-color=\"%238B5D3A\"/%3E%3Cstop offset=\"0.4348\" stop-color=\"%23654A3C\"/%3E%3Cstop offset=\"0.8241\" stop-color=\"%23272D40\"/%3E%3Cstop offset=\"1\" stop-color=\"%23091E42\"/%3E%3C/linearGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0.900391H256V256.9H0V0.900391Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Steve.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::5d115fdc3308758db02539008160b4ec>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"257\" viewBox=\"0 0 256 257\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0.599609H256V256.6H0V0.599609Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256.6C198.692 256.6 256 199.292 256 128.6C256 57.9072 198.692 0.599609 128 0.599609C57.3075 0.599609 0 57.9072 0 128.6C0 199.292 57.3075 256.6 128 256.6Z\" fill=\"%2357D9A3\"/%3E%3Cpath d=\"M217.9 219.601L177.7 193.101C176.948 192.611 176.092 192.303 175.2 192.201L128 189.801L80.8001 192.201C79.9084 192.303 79.0526 192.611 78.3001 193.101L38.1001 219.601C62.0154 243.307 94.3263 256.607 128 256.607C161.674 256.607 193.985 243.307 217.9 219.601Z\" fill=\"%2300875A\"/%3E%3Cpath d=\"M159.6 172.301C159.4 175.501 159.3 183.401 161 189.701C161.6 192.201 164.9 193.201 167.6 194.801C167.765 194.911 167.907 195.054 168.017 195.22C168.127 195.386 168.203 195.572 168.24 195.767C168.277 195.962 168.275 196.163 168.234 196.358C168.193 196.553 168.113 196.737 168 196.901C162.7 203.701 153.9 210.301 144.4 214.601C143.835 214.829 143.373 215.256 143.1 215.801L130.1 243.501C129.879 243.92 129.548 244.27 129.143 244.515C128.738 244.759 128.273 244.888 127.8 244.888C127.327 244.888 126.862 244.759 126.457 244.515C126.052 244.27 125.721 243.92 125.5 243.501L112.4 215.801C112.168 215.262 111.738 214.833 111.2 214.601C101.6 210.301 92.8001 203.701 87.5001 196.901C87.3869 196.737 87.3075 196.553 87.2663 196.358C87.2252 196.163 87.2232 195.962 87.2604 195.767C87.2976 195.572 87.3733 195.386 87.4832 195.22C87.593 195.054 87.7347 194.911 87.9001 194.801C90.6001 193.201 93.9001 192.201 94.6001 189.701C96.3001 183.401 96.1001 175.501 96.0001 172.301H159.6Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M192 109.701C192.2 116.001 181.7 129.501 175.3 129.701C168.9 129.901 169.3 116.801 169.1 110.501C168.907 108.918 169.045 107.313 169.505 105.787C169.966 104.261 170.738 102.847 171.774 101.636C172.809 100.424 174.085 99.4408 175.521 98.7485C176.957 98.0563 178.521 97.6701 180.114 97.6144C181.707 97.5588 183.294 97.8349 184.775 98.4253C186.256 99.0156 187.597 99.9073 188.715 101.044C189.833 102.18 190.702 103.537 191.267 105.027C191.833 106.517 192.083 108.109 192 109.701Z\" fill=\"%23F7D0C3\"/%3E%3Cpath d=\"M61.8 109.701C61.6 116.001 72.1 129.501 78.5 129.701C84.9 129.901 84.5 116.801 84.7 110.501C84.8931 108.918 84.7551 107.313 84.2949 105.787C83.8347 104.261 83.0623 102.847 82.0266 101.636C80.991 100.424 79.7148 99.4408 78.279 98.7485C76.8432 98.0563 75.2792 97.6701 73.6862 97.6144C72.0932 97.5588 70.506 97.8349 69.0254 98.4253C67.5448 99.0156 66.2031 99.9073 65.0854 101.044C63.9677 102.18 63.0985 103.537 62.533 105.027C61.9674 106.517 61.7178 108.109 61.8 109.701Z\" fill=\"%23F7D0C3\"/%3E%3Cpath d=\"M119.5 183.8C124.47 185.201 129.73 185.201 134.7 183.8C173.9 172.8 167.6 168.9 182.7 102.3C191.4 64.0998 185.1 21.2998 127.1 23.0998C69.0001 21.2998 62.8001 64.0998 71.5001 102.3C86.6001 168.9 80.3001 172.8 119.5 183.8Z\" fill=\"%23FF8800\"/%3E%3Cpath d=\"M126.9 161C137.7 160.6 142.2 166.1 146.4 162.9C150.6 159.7 150.4 153.6 147.9 151.1C147.1 150.3 146.2 150.1 141 149.8C131.7 149.3 130.8 149.6 126.5 149.2C122.2 148.8 121.6 148.2 118.5 148.3C115.905 148.426 113.327 148.794 110.8 149.4C107.6 150.1 106 150.4 105.5 151.1C103.4 153.6 105.2 160.7 109.5 163.2C113.8 165.7 117.2 161.3 126.9 161Z\" fill=\"url(%23paint1_linear)\"/%3E%3Cpath d=\"M127.1 132.601C143.3 132.701 154.8 142.001 162.9 136.801C171 131.601 175.5 111.901 177.8 104.701C179.841 97.9619 180.286 90.8409 179.1 83.9006C178.6 81.2006 175.3 77.7006 173.9 71.4006C173.438 69.5298 173.137 67.6228 173 65.7006C166.27 64.8011 159.46 64.6669 152.7 65.3006C126.2 67.9006 114.2 81.1006 97.6003 76.1006C94.1003 75.1006 88.5003 72.7006 82.7003 66.2006C80.9515 68.3284 79.4424 70.6423 78.2003 73.1006C76.6217 76.5212 75.5763 80.1635 75.1003 83.9006C74.0527 90.8476 74.4958 97.9381 76.4003 104.701C78.6003 111.901 83.2003 131.601 91.3003 136.801C99.4003 142.001 110.9 132.701 127.1 132.601Z\" fill=\"%23FFE2D9\"/%3E%3Cpath d=\"M143.5 149.7C138.2 148.7 134.8 147.3 130.8 148.1L130 148.3C127.841 148.902 125.559 148.902 123.4 148.3L122.6 148.1C118.8 147.4 115.5 148.5 110.1 149.6L105 150.5C107.801 153.435 111.169 155.771 114.898 157.367C118.628 158.963 122.643 159.785 126.7 159.785C130.757 159.785 134.772 158.963 138.501 157.367C142.231 155.771 145.599 153.435 148.4 150.5C146.749 150.356 145.111 150.089 143.5 149.7Z\" fill=\"%23DD6C45\"/%3E%3Cpath d=\"M102.9 148.9C106.696 150.316 110.612 151.387 114.6 152.1C118.594 152.814 122.643 153.182 126.7 153.2C130.761 153.153 134.809 152.751 138.8 152C140.8 151.688 142.773 151.22 144.7 150.6C146.7 150.1 148.6 149.4 150.6 148.7C150.8 148.6 151.1 148.8 151.2 149C151.248 149.123 151.255 149.258 151.218 149.384C151.182 149.511 151.106 149.622 151 149.7C147.235 151.511 143.276 152.886 139.2 153.8C135.092 154.683 130.901 155.119 126.7 155.1C124.6 155.1 122.6 155 120.5 154.8C118.411 154.622 116.339 154.287 114.3 153.8C110.215 153.016 106.248 151.705 102.5 149.9C102.431 149.879 102.367 149.843 102.313 149.794C102.26 149.746 102.217 149.686 102.188 149.62C102.16 149.553 102.146 149.481 102.148 149.409C102.15 149.336 102.168 149.265 102.2 149.2C102.222 149.131 102.258 149.068 102.306 149.014C102.355 148.96 102.414 148.917 102.481 148.889C102.547 148.86 102.619 148.846 102.692 148.848C102.764 148.85 102.835 148.868 102.9 148.9Z\" fill=\"%237A4F2C\"/%3E%3Cpath d=\"M118.5 128.2C120.17 128.695 121.807 129.296 123.4 130L125.8 131L126.7 131.4H127.6C128.334 131.234 129.041 130.964 129.7 130.6C130.51 130.24 131.346 129.94 132.2 129.7C133.903 129.103 135.695 128.799 137.5 128.8C137.696 128.799 137.886 128.869 138.033 128.998C138.18 129.127 138.275 129.306 138.3 129.5C138.301 129.696 138.231 129.886 138.102 130.033C137.973 130.181 137.794 130.276 137.6 130.3C135.995 130.581 134.421 131.016 132.9 131.6L130.6 132.6C129.784 133.128 128.863 133.47 127.9 133.6H126.3L124.8 133L122.5 131.8C120.928 131.114 119.392 130.346 117.9 129.5C117.811 129.458 117.731 129.398 117.667 129.324C117.602 129.249 117.554 129.162 117.526 129.067C117.498 128.973 117.49 128.874 117.502 128.776C117.515 128.678 117.548 128.584 117.6 128.5C117.707 128.371 117.848 128.275 118.007 128.222C118.166 128.169 118.337 128.161 118.5 128.2Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M122.2 95.8004C123.671 99.9019 124.35 104.246 124.2 108.6C124.047 110.752 123.747 112.89 123.3 115C122.865 117.123 122.229 119.199 121.4 121.2C121.357 121.301 121.294 121.393 121.214 121.468C121.134 121.544 121.04 121.602 120.937 121.64C120.834 121.677 120.724 121.693 120.614 121.686C120.505 121.68 120.398 121.65 120.3 121.6C120.102 121.532 119.94 121.389 119.846 121.202C119.753 121.015 119.736 120.799 119.8 120.6C120.4 118.6 120.9 116.6 121.3 114.6C121.6 112.6 121.8 110.5 121.9 108.5C121.983 106.432 121.916 104.359 121.7 102.3C121.479 100.276 121.111 98.2711 120.6 96.3004C120.57 96.1953 120.562 96.0851 120.576 95.9768C120.591 95.8685 120.627 95.7643 120.684 95.6706C120.74 95.5769 120.815 95.4957 120.903 95.432C120.992 95.3684 121.093 95.3236 121.2 95.3004C121.398 95.2588 121.605 95.2855 121.787 95.3763C121.968 95.467 122.114 95.6165 122.2 95.8004Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M113.6 96.2997L112 95.3997L110.3 94.5997C109.069 94.0951 107.798 93.6937 106.5 93.3997C103.952 92.7662 101.321 92.53 98.7002 92.6997C96.0431 92.8091 93.4305 93.4198 91.0002 94.4997C89.7845 94.9991 88.6136 95.6013 87.5002 96.2997C86.3631 96.9954 85.321 97.8357 84.4002 98.7997C84.2133 98.983 83.962 99.0856 83.7002 99.0856C83.4385 99.0856 83.1872 98.983 83.0002 98.7997C82.9012 98.7401 82.8162 98.6597 82.7512 98.5641C82.6862 98.4685 82.6427 98.3599 82.6237 98.2458C82.6047 98.1318 82.6106 98.015 82.6411 97.9034C82.6716 97.7919 82.7259 97.6883 82.8003 97.5997C83.6086 96.2816 84.6212 95.1002 85.8003 94.0997C86.9585 93.0561 88.2336 92.1501 89.6002 91.3997C92.2686 89.8594 95.2344 88.9049 98.3003 88.5997C101.383 88.2255 104.51 88.4634 107.5 89.2997C109.031 89.6381 110.51 90.1761 111.9 90.8997L114 91.9997C114.662 92.4986 115.296 93.0327 115.9 93.5997C116.077 93.7427 116.221 93.9216 116.323 94.1246C116.425 94.3276 116.483 94.5501 116.493 94.7771C116.502 95.0042 116.463 95.2307 116.378 95.4415C116.293 95.6523 116.164 95.8426 116 95.9997C115.744 96.3247 115.371 96.5375 114.961 96.5935C114.55 96.6494 114.135 96.5441 113.8 96.2997H113.6Z\" fill=\"%23CE6E05\"/%3E%3Cpath d=\"M139 93.7003C139.583 93.1097 140.219 92.5741 140.9 92.1003L143 91.0003C144.356 90.2773 145.802 89.7392 147.3 89.4003C150.292 88.5716 153.417 88.3338 156.5 88.7003C159.594 89.0208 162.59 89.9738 165.3 91.5003C166.667 92.2506 167.942 93.1566 169.1 94.2003C170.279 95.2007 171.292 96.3821 172.1 97.7003C172.225 97.931 172.264 98.199 172.209 98.4558C172.154 98.7125 172.009 98.9411 171.8 99.1003C171.588 99.1971 171.351 99.2298 171.12 99.1942C170.889 99.1587 170.674 99.0565 170.5 98.9003C169.579 97.9363 168.537 97.0959 167.4 96.4003C166.287 95.7018 165.116 95.0996 163.9 94.6003C161.47 93.5204 158.857 92.9096 156.2 92.8003C153.58 92.6306 150.949 92.8667 148.4 93.5003C147.102 93.7942 145.831 94.1956 144.6 94.7003L142.9 95.5003L141.3 96.4003H141.1C140.711 96.6355 140.247 96.7147 139.802 96.622C139.357 96.5292 138.963 96.2714 138.7 95.9003C138.478 95.5585 138.386 95.1483 138.441 94.7445C138.496 94.3407 138.695 93.9701 139 93.7003Z\" fill=\"%23CE6E05\"/%3E%3Cpath d=\"M89.3001 102.3C92.3702 100.182 95.9739 98.9693 99.7001 98.8004C103.491 98.6671 107.231 99.7154 110.4 101.8C110.612 101.933 110.763 102.144 110.819 102.388C110.876 102.632 110.833 102.888 110.7 103.1C110.567 103.313 110.356 103.463 110.112 103.52C109.868 103.576 109.612 103.533 109.4 103.4C107.927 102.532 106.347 101.859 104.7 101.4C103.064 100.998 101.385 100.796 99.7001 100.8C98.0129 100.753 96.328 100.955 94.7001 101.4C93.0273 101.877 91.4162 102.548 89.9001 103.4C89.7523 103.446 89.5937 103.441 89.449 103.387C89.3043 103.332 89.1816 103.232 89.1001 103.1C89.0249 102.967 89.0037 102.809 89.0409 102.661C89.0781 102.512 89.1708 102.383 89.3001 102.3Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M164.5 103.4C163.019 102.548 161.441 101.877 159.8 101.4C158.138 100.955 156.42 100.753 154.7 100.8C151.286 100.729 147.921 101.631 145 103.4C144.785 103.482 144.548 103.487 144.329 103.414C144.11 103.341 143.924 103.195 143.8 103C143.687 102.8 143.656 102.564 143.711 102.341C143.767 102.117 143.906 101.924 144.1 101.8C147.27 99.7154 151.009 98.6671 154.8 98.8004C158.523 98.9851 162.123 100.196 165.2 102.3C165.271 102.349 165.33 102.413 165.374 102.486C165.418 102.56 165.446 102.642 165.455 102.728C165.465 102.813 165.456 102.899 165.429 102.981C165.402 103.062 165.358 103.137 165.3 103.2C165.205 103.314 165.077 103.395 164.933 103.431C164.789 103.467 164.638 103.456 164.5 103.4Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M153.7 106.099C155.467 106.099 156.9 104.667 156.9 102.899C156.9 101.132 155.467 99.6992 153.7 99.6992C151.933 99.6992 150.5 101.132 150.5 102.899C150.5 104.667 151.933 106.099 153.7 106.099Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M100.4 106.099C102.168 106.099 103.6 104.667 103.6 102.899C103.6 101.132 102.168 99.6992 100.4 99.6992C98.6329 99.6992 97.2002 101.132 97.2002 102.899C97.2002 104.667 98.6329 106.099 100.4 106.099Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M98.3 120.5C98.7418 120.5 99.1 120.142 99.1 119.7C99.1 119.259 98.7418 118.9 98.3 118.9C97.8582 118.9 97.5 119.259 97.5 119.7C97.5 120.142 97.8582 120.5 98.3 120.5Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M89.8 121.301C90.2418 121.301 90.6 120.943 90.6 120.501C90.6 120.059 90.2418 119.701 89.8 119.701C89.3582 119.701 89 120.059 89 120.501C89 120.943 89.3582 121.301 89.8 121.301Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M100.4 129.5C100.842 129.5 101.2 129.142 101.2 128.7C101.2 128.259 100.842 127.9 100.4 127.9C99.9583 127.9 99.6001 128.259 99.6001 128.7C99.6001 129.142 99.9583 129.5 100.4 129.5Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M105.1 120.5C105.542 120.5 105.9 120.142 105.9 119.7C105.9 119.259 105.542 118.9 105.1 118.9C104.658 118.9 104.3 119.259 104.3 119.7C104.3 120.142 104.658 120.5 105.1 120.5Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M99.4001 136.7C99.8419 136.7 100.2 136.341 100.2 135.9C100.2 135.458 99.8419 135.1 99.4001 135.1C98.9583 135.1 98.6001 135.458 98.6001 135.9C98.6001 136.341 98.9583 136.7 99.4001 136.7Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M92.8 127.801C93.2418 127.801 93.6 127.443 93.6 127.001C93.6 126.559 93.2418 126.201 92.8 126.201C92.3582 126.201 92 126.559 92 127.001C92 127.443 92.3582 127.801 92.8 127.801Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M158 121.901C158.442 121.901 158.8 121.543 158.8 121.101C158.8 120.659 158.442 120.301 158 120.301C157.558 120.301 157.2 120.659 157.2 121.101C157.2 121.543 157.558 121.901 158 121.901Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M164.5 124.702C164.942 124.702 165.3 124.343 165.3 123.902C165.3 123.46 164.942 123.102 164.5 123.102C164.058 123.102 163.7 123.46 163.7 123.902C163.7 124.343 164.058 124.702 164.5 124.702Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M149.3 123.801C149.742 123.801 150.1 123.443 150.1 123.001C150.1 122.559 149.742 122.201 149.3 122.201C148.858 122.201 148.5 122.559 148.5 123.001C148.5 123.443 148.858 123.801 149.3 123.801Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M151.1 135.5C151.542 135.5 151.9 135.142 151.9 134.7C151.9 134.259 151.542 133.9 151.1 133.9C150.658 133.9 150.3 134.259 150.3 134.7C150.3 135.142 150.658 135.5 151.1 135.5Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M159.5 131.1C159.942 131.1 160.3 130.742 160.3 130.3C160.3 129.858 159.942 129.5 159.5 129.5C159.058 129.5 158.7 129.858 158.7 130.3C158.7 130.742 159.058 131.1 159.5 131.1Z\" fill=\"%23F0BEB4\"/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"127.76\" y1=\"178.461\" x2=\"127.76\" y2=\"239.851\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23EBBEAE\"/%3E%3Cstop offset=\"1\" stop-color=\"%23FFE2D9\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint1_linear\" x1=\"5828.65\" y1=\"1981.79\" x2=\"5828.65\" y2=\"2944.48\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23EBBEAE\"/%3E%3Cstop offset=\"1\" stop-color=\"%23FFE2D9\"/%3E%3C/linearGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0.599609H256V256.6H0V0.599609Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Tanya.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::a2a7949ed00b305d038439955a468429>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"257\" viewBox=\"0 0 256 257\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0.599609H256V256.6H0V0.599609Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256.6C198.692 256.6 256 199.292 256 128.6C256 57.9072 198.692 0.599609 128 0.599609C57.3075 0.599609 0 57.9072 0 128.6C0 199.292 57.3075 256.6 128 256.6Z\" fill=\"%23FFAB00\"/%3E%3Cpath d=\"M210.1 227.1C209.502 226.675 208.866 226.307 208.2 226L187.4 211C176.778 205.488 165.06 202.413 153.1 202L131.6 205L110.2 202C98.2079 202.412 86.4574 205.486 75.8001 211L55.1001 226C53.1956 226.962 51.4972 228.287 50.1001 229.9C73.1191 247.683 101.508 257.094 130.592 256.586C159.675 256.077 187.717 245.677 210.1 227.1Z\" fill=\"%23FF8B00\"/%3E%3Cpath d=\"M168.3 209.501C163.635 214.596 157.979 218.687 151.679 221.522C145.378 224.357 138.566 225.877 131.658 225.989C124.75 226.102 117.892 224.804 111.503 222.175C105.114 219.546 99.3285 215.642 94.4999 210.701L93.8999 210.101C93.8999 210.101 101.7 203.001 103.4 194.201C106.2 180.401 97.0999 170.001 95.9999 168.801L163.4 166.301C162.1 168.301 155 179.601 158.6 193.501C160.8 201.901 168.3 209.501 168.3 209.501Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M77.3 140.901C84.9215 140.901 91.1 134.722 91.1 127.101C91.1 119.479 84.9215 113.301 77.3 113.301C69.6785 113.301 63.5 119.479 63.5 127.101C63.5 134.722 69.6785 140.901 77.3 140.901Z\" fill=\"url(%23paint1_linear)\"/%3E%3Cpath d=\"M179.3 140.901C186.922 140.901 193.1 134.722 193.1 127.101C193.1 119.479 186.922 113.301 179.3 113.301C171.678 113.301 165.5 119.479 165.5 127.101C165.5 134.722 171.678 140.901 179.3 140.901Z\" fill=\"url(%23paint2_linear)\"/%3E%3Cpath d=\"M184.2 121.9C183 151.5 159.3 185.5 128.5 185.5C97.6998 185.5 73.9998 151.5 72.7998 121.9C71.4998 89.2 81.2998 48.5 128.5 48.5C175.7 48.5 185.5 89.2 184.2 121.9Z\" fill=\"%23FFE2D9\"/%3E%3Cpath d=\"M171.7 107.501C169.3 106.401 167.2 105.001 164.9 104.001C162.587 102.953 160.123 102.279 157.6 102.001C155.069 101.718 152.512 101.785 150 102.201C147.517 102.677 145.1 103.449 142.8 104.501C142.691 104.569 142.568 104.613 142.44 104.63C142.312 104.646 142.182 104.635 142.059 104.597C141.935 104.559 141.822 104.495 141.725 104.41C141.629 104.324 141.552 104.219 141.5 104.101C141.411 103.87 141.402 103.617 141.475 103.381C141.547 103.146 141.697 102.941 141.9 102.8C144.285 101.429 146.891 100.482 149.6 100.001C150.954 99.7414 152.324 99.5743 153.7 99.5005C155.103 99.4672 156.506 99.534 157.9 99.7005C160.609 100.088 163.241 100.898 165.7 102.101C168.297 103.12 170.527 104.897 172.1 107.201C172.1 107.301 172.1 107.501 172 107.501H171.7Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M80.7002 107.201C82.2734 104.897 84.5034 103.12 87.1002 102.101C89.5589 100.898 92.1908 100.088 94.9002 99.7005C96.2937 99.534 97.6972 99.4672 99.1002 99.5005C100.477 99.5743 101.846 99.7414 103.2 100.001C105.909 100.482 108.515 101.429 110.9 102.8C111.101 102.942 111.243 103.153 111.299 103.393C111.354 103.633 111.319 103.885 111.2 104.101C111.16 104.216 111.094 104.32 111.007 104.406C110.92 104.491 110.814 104.556 110.698 104.595C110.582 104.633 110.459 104.645 110.338 104.629C110.217 104.612 110.102 104.568 110 104.501C107.671 103.435 105.219 102.663 102.7 102.201C100.222 101.782 97.6972 101.715 95.2002 102.001C92.6767 102.279 90.213 102.953 87.9002 104.001C85.6002 105.001 83.5002 106.401 81.1002 107.501C80.9002 107.601 80.8002 107.601 80.7002 107.401V107.201Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M102.1 119.1C103.812 119.1 105.2 117.712 105.2 116C105.2 114.288 103.812 112.9 102.1 112.9C100.388 112.9 99 114.288 99 116C99 117.712 100.388 119.1 102.1 119.1Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M88.5998 116.8C88.9937 116.986 89.4268 117.074 89.8621 117.057C90.2974 117.039 90.7221 116.917 91.0998 116.7C91.187 116.689 91.2698 116.656 91.34 116.603C91.4102 116.551 91.4654 116.48 91.4998 116.4H91.6998L91.9998 116.1L93.2998 114.9C95.1887 113.485 97.3791 112.527 99.6998 112.1C102.038 111.665 104.448 111.837 106.7 112.6C108.915 113.324 110.91 114.596 112.5 116.3C112.69 116.503 112.795 116.771 112.795 117.05C112.795 117.328 112.69 117.596 112.5 117.8C112.296 117.946 112.051 118.025 111.8 118.025C111.549 118.025 111.304 117.946 111.1 117.8C108.898 115.749 106.062 114.512 103.061 114.294C100.06 114.076 97.0751 114.889 94.5998 116.6L93.3998 117.6L93.0998 117.8L92.6998 118.1L91.6998 118.6C91.0453 118.822 90.333 118.803 89.6913 118.546C89.0496 118.289 88.5207 117.812 88.1998 117.2C88.1828 117.174 88.1719 117.145 88.1678 117.115C88.1637 117.085 88.1666 117.054 88.1763 117.025C88.1859 116.996 88.2021 116.97 88.2235 116.948C88.2449 116.926 88.271 116.91 88.2998 116.9C88.3998 116.8 88.4998 116.8 88.4998 116.9L88.5998 116.8Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M151.9 119.1C153.612 119.1 155 117.712 155 116C155 114.288 153.612 112.9 151.9 112.9C150.188 112.9 148.8 114.288 148.8 116C148.8 117.712 150.188 119.1 151.9 119.1Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M165.8 117.601C165.479 118.213 164.95 118.69 164.309 118.947C163.667 119.204 162.955 119.223 162.3 119.001L161.3 118.601L160.9 118.201L160.6 118.001C160.247 117.615 159.843 117.279 159.4 117.001C157.756 115.863 155.876 115.111 153.9 114.801C151.962 114.484 149.977 114.621 148.1 115.201C146.165 115.801 144.388 116.826 142.9 118.201C142.692 118.35 142.438 118.421 142.182 118.403C141.927 118.385 141.685 118.278 141.5 118.101C141.412 118.017 141.343 117.916 141.295 117.804C141.247 117.693 141.223 117.572 141.223 117.451C141.223 117.329 141.247 117.209 141.295 117.098C141.343 116.986 141.412 116.885 141.5 116.801C143.074 115.009 145.118 113.693 147.4 113.001C149.628 112.288 151.993 112.116 154.3 112.501C156.632 112.891 158.831 113.853 160.7 115.301L162 116.501L162.3 116.801C162.4 116.801 162.4 116.901 162.5 117.001L163 117.301C163.394 117.474 163.82 117.564 164.25 117.564C164.681 117.564 165.106 117.474 165.5 117.301C165.526 117.284 165.554 117.273 165.585 117.269C165.615 117.265 165.646 117.268 165.675 117.277C165.704 117.287 165.73 117.303 165.752 117.325C165.774 117.346 165.79 117.372 165.8 117.401C165.9 117.501 165.9 117.601 165.8 117.601Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M122.9 120.099C123.51 121.431 123.914 122.847 124.1 124.299C124.3 125.726 124.3 127.173 124.1 128.599C123.91 130.03 123.575 131.437 123.1 132.799C122.594 134.113 121.922 135.356 121.1 136.499C120.994 136.685 120.818 136.821 120.612 136.877C120.406 136.933 120.186 136.905 120 136.799C119.814 136.693 119.678 136.518 119.622 136.311C119.566 136.105 119.594 135.885 119.7 135.699C120.2 134.499 120.7 133.299 121.1 132.099C121.5 130.899 121.7 129.599 121.9 128.299C122.035 127.037 122.068 125.767 122 124.499C121.864 123.217 121.63 121.946 121.3 120.699C121.27 120.594 121.262 120.484 121.277 120.376C121.291 120.267 121.327 120.163 121.384 120.07C121.44 119.976 121.515 119.895 121.603 119.831C121.692 119.767 121.793 119.722 121.9 119.699C122.087 119.664 122.281 119.682 122.458 119.753C122.636 119.824 122.789 119.944 122.9 120.099Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M144.1 156C138.8 154.7 135.4 153.2 131.4 154.1L130.6 154.3C128.456 155.002 126.144 155.002 124 154.3L123.2 154.1C119.4 153.3 116 154.5 110.7 155.8L105.6 156.9C106 157.4 113.7 167.5 127.3 167.4C140.9 167.3 148.6 157.4 149 156.9L144.1 156Z\" fill=\"%23505F79\"/%3E%3Cpath d=\"M103.2 154.6C106.92 156.301 110.808 157.608 114.8 158.5C118.765 159.426 122.829 159.863 126.9 159.8C130.973 159.79 135.032 159.32 139 158.4C140.997 157.906 142.967 157.305 144.9 156.6C146.862 155.998 148.77 155.229 150.6 154.3C151 154.2 151.4 154.3 151.5 154.7C151.6 155.1 151.5 155.3 151.3 155.5C149.485 156.624 147.578 157.595 145.6 158.4C143.664 159.296 141.657 160.032 139.6 160.6C135.459 161.718 131.189 162.289 126.9 162.3C124.76 162.313 122.622 162.179 120.5 161.9C118.404 161.621 116.331 161.186 114.3 160.6C110.161 159.514 106.191 157.865 102.5 155.7C102.422 155.659 102.353 155.602 102.3 155.533C102.246 155.463 102.208 155.382 102.189 155.297C102.17 155.211 102.17 155.122 102.189 155.036C102.208 154.95 102.246 154.869 102.3 154.8C102.4 154.663 102.547 154.567 102.712 154.531C102.878 154.494 103.051 154.518 103.2 154.6Z\" fill=\"%2342526E\"/%3E%3Cpath d=\"M184.2 121.899C183.7 120.299 183 117.799 182.2 114.799C175.6 91.4987 172.2 79.7987 169 76.7987C163.1 71.3987 158.3 75.0987 129 75.2987C99.7 75.4987 95.5 72.0987 88.4 77.7987C81.3 83.4987 77 97.6987 74.8 107.599C73.7337 112.301 73.0647 117.084 72.8 121.899C68.6 95.5987 77.3 70.2987 95.6 57.6987C109.1 48.3987 124.9 48.0987 128.2 47.9987C131.5 47.8987 146.3 48.0987 159.3 56.2987C178.4 68.1987 188 94.1987 184.2 121.899Z\" fill=\"url(%23paint3_linear)\"/%3E%3Cpath d=\"M184.6 137.9C185.429 137.9 186.1 137.229 186.1 136.4C186.1 135.572 185.429 134.9 184.6 134.9C183.772 134.9 183.1 135.572 183.1 136.4C183.1 137.229 183.772 137.9 184.6 137.9Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M71.7998 137.9C72.6282 137.9 73.2998 137.229 73.2998 136.4C73.2998 135.572 72.6282 134.9 71.7998 134.9C70.9714 134.9 70.2998 135.572 70.2998 136.4C70.2998 137.229 70.9714 137.9 71.7998 137.9Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M188 120.399C187.868 120.411 187.734 120.39 187.612 120.338C187.49 120.285 187.383 120.203 187.3 120.099C187.117 119.912 187.014 119.661 187.014 119.399C187.014 119.137 187.117 118.886 187.3 118.699L190.6 115.299C190.804 115.109 191.072 115.004 191.35 115.004C191.628 115.004 191.896 115.109 192.1 115.299C192.283 115.486 192.386 115.737 192.386 115.999C192.386 116.261 192.283 116.512 192.1 116.699L188.7 120.099C188.51 120.279 188.262 120.386 188 120.399Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M119.7 139.899C120.892 140.093 122.063 140.394 123.2 140.799L124.9 141.199L126.5 141.499C127.582 141.551 128.665 141.416 129.7 141.099C130.826 140.858 131.93 140.524 133 140.099C133.091 140.05 133.191 140.022 133.293 140.016C133.396 140.01 133.499 140.026 133.594 140.064C133.69 140.103 133.775 140.161 133.846 140.237C133.916 140.312 133.969 140.401 134 140.499C134.053 140.662 134.052 140.837 133.998 140.998C133.944 141.16 133.84 141.301 133.7 141.399C132.641 142.104 131.499 142.675 130.3 143.099C129.027 143.598 127.667 143.836 126.3 143.799L124.3 143.399L122.6 142.799C121.424 142.402 120.286 141.9 119.2 141.299C119.111 141.257 119.031 141.197 118.967 141.123C118.903 141.048 118.855 140.961 118.826 140.866C118.798 140.772 118.79 140.673 118.803 140.575C118.815 140.477 118.849 140.383 118.9 140.299C118.966 140.15 119.082 140.028 119.228 139.955C119.374 139.882 119.541 139.862 119.7 139.899Z\" fill=\"%23F0BEB4\"/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"131.12\" y1=\"167.481\" x2=\"131.12\" y2=\"225.701\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23EBBEAE\"/%3E%3Cstop offset=\"0.64\" stop-color=\"%23FFE2D9\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint1_linear\" x1=\"63.57\" y1=\"127.111\" x2=\"91.11\" y2=\"127.111\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23FFE2D9\"/%3E%3Cstop offset=\"1\" stop-color=\"%23EBBEAE\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint2_linear\" x1=\"165.5\" y1=\"127.111\" x2=\"193.04\" y2=\"127.111\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23EBBEAE\"/%3E%3Cstop offset=\"1\" stop-color=\"%23FFE2D9\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint3_linear\" x1=\"128.38\" y1=\"121.919\" x2=\"128.38\" y2=\"48.0387\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23F0D0B4\"/%3E%3Cstop offset=\"0.1\" stop-color=\"%23E1C9B9\"/%3E%3Cstop offset=\"0.29\" stop-color=\"%23BBB8C5\"/%3E%3Cstop offset=\"0.55\" stop-color=\"%237C9CD8\"/%3E%3Cstop offset=\"0.86\" stop-color=\"%232776F3\"/%3E%3Cstop offset=\"1\" stop-color=\"%230065FF\"/%3E%3C/linearGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0.599609H256V256.6H0V0.599609Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Tori.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::30e55d89a7ed8d48cea54eed456c0b71>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"257\" viewBox=\"0 0 256 257\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0.599609H256V256.6H0V0.599609Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M128 256.6C198.692 256.6 256 199.292 256 128.6C256 57.9072 198.692 0.599609 128 0.599609C57.3075 0.599609 0 57.9072 0 128.6C0 199.292 57.3075 256.6 128 256.6Z\" fill=\"%2300C7E5\"/%3E%3Cpath d=\"M80.2 53.5982C74.9 55.2982 68.7 58.2982 66.6 63.9982C64.5 69.6982 71.3 76.6982 67.9 83.6982C65.8 88.0982 62.2 87.6982 59.3 93.7982C57.901 96.6622 57.1823 99.8107 57.2 102.998C56.9 111.398 61.4 114.598 63.2 120.898C66.7 133.498 53.6 140.398 55.5 151.798C56.4 157.298 60.7 164.198 75.5 170.998C74.0902 175.558 74.0902 180.438 75.5 184.998C77.3693 190.036 80.7151 194.392 85.1 197.498C96.1 204.898 104.5 196.098 128.3 197.298C143.9 198.098 148.1 202.298 159.6 198.998C164 197.798 172.3 195.198 176.3 187.398C178.325 183.06 178.886 178.183 177.9 173.498C180.3 173.498 187.7 173.298 193.5 167.898C199.3 162.498 201.8 151.598 199.7 143.298C197.6 134.998 192 129.698 193.5 120.898C194.5 114.998 197.2 110.598 196.4 102.098C196.136 98.6634 195.148 95.3235 193.5 92.2982C190.7 87.3982 188.2 87.7982 186.6 84.5982C183.4 77.7982 192.7 71.0982 190.1 63.9982C187.5 56.8982 179.8 57.4982 176.5 53.5982C164.4 51.9982 164.9 44.4982 152.7 44.4982C140.5 44.4982 140.5 53.6982 128.3 53.6982C116.1 53.6982 115.7 43.5982 103.6 44.4982C91.5 45.3982 92.3 51.9982 80.2 53.5982Z\" fill=\"%23FF5630\"/%3E%3Cpath d=\"M170.7 207.799L131.6 205.799L92.5998 207.799C91.8548 207.865 91.1357 208.105 90.4998 208.499L55.0998 231.899L53.7998 232.899C76.0778 248.743 102.843 257.039 130.177 256.571C157.511 256.103 183.977 246.897 205.7 230.299L172.8 208.499C172.151 208.133 171.438 207.895 170.7 207.799Z\" fill=\"%2300A3BF\"/%3E%3Cpath d=\"M168.3 209.499C167.3 210.899 152.4 230.299 127.8 228.599C107.3 227.299 95.6999 212.399 93.8999 210.099C98.7848 206.035 102.136 200.426 103.4 194.199C106.2 180.399 97.0999 169.999 95.9999 168.799L163.4 166.299C162.1 168.299 155 179.599 158.6 193.499C160.283 199.63 163.642 205.171 168.3 209.499Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M77.3 140.899C84.9215 140.899 91.1 134.72 91.1 127.099C91.1 119.477 84.9215 113.299 77.3 113.299C69.6785 113.299 63.5 119.477 63.5 127.099C63.5 134.72 69.6785 140.899 77.3 140.899Z\" fill=\"url(%23paint1_linear)\"/%3E%3Cpath d=\"M179.3 140.899C186.922 140.899 193.1 134.72 193.1 127.099C193.1 119.477 186.922 113.299 179.3 113.299C171.678 113.299 165.5 119.477 165.5 127.099C165.5 134.72 171.678 140.899 179.3 140.899Z\" fill=\"url(%23paint2_linear)\"/%3E%3Cpath d=\"M80.9 99.398C80.9 105.798 80.7 111.798 80.5 117.598C80.3 123.398 80.1 122.498 79.8 127.998C79 143.498 79.8 147.498 76.5 151.198C73.2 154.898 71 155.398 69.7 154.498C68.4 153.598 70.4 149.898 71.1 144.398C73.1 130.898 68.6 117.398 68.2 116.198C67.8 114.998 66.1 110.798 66.3 106.798C66.4 104.398 66.7 99.098 70.4 97.098C74.1 95.098 77.6 96.498 80.9 99.398Z\" fill=\"%23FF5630\"/%3E%3Cpath d=\"M184.2 121.898C183 151.498 152.3 185.498 128.5 185.498C104.7 185.498 73.9999 151.498 72.7999 121.898C71.4999 89.1984 95.9999 52.3984 128.5 52.3984C161 52.3984 185.5 89.1984 184.2 121.898Z\" fill=\"%23FFE2D9\"/%3E%3Cpath d=\"M69.2001 136.399C70.0838 136.399 70.8001 135.683 70.8001 134.799C70.8001 133.916 70.0838 133.199 69.2001 133.199C68.3164 133.199 67.6001 133.916 67.6001 134.799C67.6001 135.683 68.3164 136.399 69.2001 136.399Z\" fill=\"%2300B8D9\"/%3E%3Cpath d=\"M188.1 136.399C188.984 136.399 189.7 135.683 189.7 134.799C189.7 133.916 188.984 133.199 188.1 133.199C187.216 133.199 186.5 133.916 186.5 134.799C186.5 135.683 187.216 136.399 188.1 136.399Z\" fill=\"%2300B8D9\"/%3E%3Cpath d=\"M171.1 104.699C168.555 103.022 165.88 101.55 163.1 100.299C160.306 99.1744 157.311 98.63 154.3 98.6993C151.32 98.7208 148.369 99.2973 145.6 100.399C142.842 101.554 140.304 103.178 138.1 105.199C137.913 105.382 137.662 105.485 137.4 105.485C137.138 105.485 136.887 105.382 136.7 105.199C136.553 104.995 136.475 104.75 136.475 104.499C136.475 104.248 136.553 104.003 136.7 103.799C139.016 101.456 141.768 99.5877 144.8 98.2993C147.827 97.0306 151.078 96.3855 154.36 96.4027C157.642 96.4199 160.887 97.0989 163.9 98.3993C166.973 99.5995 169.619 101.688 171.5 104.399C171.505 104.453 171.498 104.508 171.481 104.56C171.464 104.611 171.436 104.659 171.4 104.699C171.381 104.721 171.358 104.738 171.332 104.749C171.306 104.761 171.278 104.767 171.25 104.767C171.222 104.767 171.193 104.761 171.168 104.749C171.142 104.738 171.119 104.721 171.1 104.699Z\" fill=\"%23FF5630\"/%3E%3Cpath d=\"M81.4998 104.399C83.3215 101.674 85.9411 99.5783 88.9998 98.3993C92.03 97.0963 95.2912 96.416 98.5896 96.3988C101.888 96.3816 105.156 97.0279 108.2 98.2993C111.203 99.5877 113.922 101.457 116.2 103.799C116.314 103.885 116.409 103.995 116.478 104.121C116.546 104.246 116.587 104.385 116.597 104.528C116.607 104.671 116.587 104.815 116.537 104.949C116.487 105.083 116.408 105.205 116.307 105.306C116.206 105.408 116.084 105.486 115.949 105.536C115.815 105.586 115.672 105.607 115.529 105.597C115.386 105.587 115.247 105.546 115.121 105.477C114.995 105.409 114.886 105.314 114.8 105.199C112.613 103.156 110.071 101.53 107.3 100.399C104.536 99.2787 101.582 98.7015 98.5998 98.6993C95.5883 98.6301 92.5942 99.1744 89.7998 100.299C86.9998 101.399 84.5998 103.099 81.7998 104.699C81.6998 104.799 81.5998 104.799 81.4998 104.599C81.3998 104.399 81.3998 104.399 81.4998 104.399Z\" fill=\"%23FF5630\"/%3E%3Cpath d=\"M102.6 117.599C104.643 117.599 106.3 115.943 106.3 113.899C106.3 111.856 104.643 110.199 102.6 110.199C100.556 110.199 98.8999 111.856 98.8999 113.899C98.8999 115.943 100.556 117.599 102.6 117.599Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M86.0996 112.598C86.5856 112.822 87.1144 112.939 87.6496 112.939C88.1848 112.939 88.7136 112.822 89.1996 112.598C89.4056 112.523 89.5813 112.383 89.6996 112.198L89.9996 111.998L90.2996 111.698C90.7852 111.18 91.3211 110.711 91.8996 110.298C94.1281 108.498 96.7778 107.293 99.5996 106.798C102.408 106.346 105.284 106.552 108 107.398C110.702 108.339 113.137 109.917 115.1 111.998C115.211 112.11 115.3 112.242 115.361 112.388C115.421 112.534 115.453 112.69 115.453 112.848C115.453 113.006 115.421 113.163 115.361 113.308C115.3 113.454 115.211 113.587 115.1 113.698C114.856 113.885 114.557 113.986 114.25 113.986C113.942 113.986 113.644 113.885 113.4 113.698C111.616 112.066 109.501 110.838 107.2 110.098C104.894 109.435 102.475 109.265 100.1 109.598C97.6934 109.989 95.4045 110.911 93.3996 112.298C92.9086 112.669 92.4411 113.07 91.9996 113.498L91.5996 113.798L91.0996 114.198C90.7367 114.443 90.3288 114.613 89.8996 114.698C89.1219 114.948 88.2825 114.925 87.5193 114.634C86.7561 114.343 86.1144 113.802 85.6996 113.098C85.6555 113.016 85.6414 112.922 85.6596 112.83C85.6779 112.739 85.7274 112.657 85.7996 112.598H86.0996Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M154.3 117.599C156.343 117.599 158 115.943 158 113.899C158 111.856 156.343 110.199 154.3 110.199C152.256 110.199 150.6 111.856 150.6 113.899C150.6 115.943 152.256 117.599 154.3 117.599Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M171.1 113.098C170.699 113.816 170.058 114.369 169.29 114.661C168.522 114.954 167.676 114.967 166.9 114.698L165.7 114.198L165.2 113.798L164.8 113.498C164.38 113.046 163.91 112.644 163.4 112.298C161.423 110.928 159.17 110.006 156.8 109.598C154.391 109.263 151.939 109.433 149.6 110.098C147.309 110.863 145.199 112.088 143.4 113.698C143.282 113.804 143.144 113.885 142.995 113.937C142.845 113.989 142.687 114.011 142.529 114.002C142.371 113.993 142.216 113.952 142.074 113.883C141.932 113.814 141.804 113.717 141.7 113.598C141.503 113.378 141.394 113.093 141.394 112.798C141.394 112.503 141.503 112.218 141.7 111.998C143.662 109.917 146.098 108.339 148.8 107.398C151.516 106.552 154.391 106.346 157.2 106.798C160.021 107.293 162.671 108.498 164.9 110.298C165.478 110.711 166.014 111.18 166.5 111.698L166.9 111.998L167.1 112.198L167.7 112.598C168.168 112.821 168.681 112.936 169.2 112.936C169.718 112.936 170.231 112.821 170.7 112.598C170.732 112.572 170.77 112.552 170.811 112.541C170.851 112.529 170.893 112.525 170.935 112.53C170.977 112.535 171.017 112.548 171.054 112.568C171.091 112.588 171.123 112.615 171.15 112.648C171.176 112.681 171.195 112.719 171.207 112.759C171.219 112.8 171.222 112.842 171.218 112.884C171.213 112.925 171.2 112.966 171.18 113.003C171.16 113.04 171.132 113.072 171.1 113.098Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M64.4997 64.1994C69.6997 47.3994 84.0997 36.3994 95.9997 33.6994C99.9183 32.6792 104.01 32.5087 108 33.1994C113.888 34.4345 119.26 37.4344 123.4 41.7994C113.1 59.5994 102.8 69.7994 95.1997 75.8994C91.0997 79.0994 82.2997 85.4994 76.8997 97.2994C75.3 100.744 74.1247 104.371 73.3997 108.099C72.1997 106.599 57.1997 87.3994 64.4997 64.1994Z\" fill=\"%23FF5630\"/%3E%3Cpath d=\"M138.4 27.399C145.741 27.399 153.01 28.8448 159.792 31.6541C166.574 34.4633 172.736 38.5809 177.927 43.7717C183.118 48.9625 187.236 55.1248 190.045 61.9069C192.854 68.689 194.3 75.9581 194.3 83.299C194.233 88.1239 193.596 92.924 192.4 97.599C190.695 103.622 187.843 109.258 184 114.199C168.746 108.564 154.212 101.146 140.7 92.099C123.033 80.3507 107.253 65.9868 93.8999 49.499C97.5999 44.799 106.7 34.499 122 29.799C127.316 28.184 132.844 27.3751 138.4 27.399Z\" fill=\"%23FF5630\"/%3E%3Cpath d=\"M119.5 139.999L123 140.899L124.7 141.299L126.2 141.699C127.284 141.672 128.359 141.504 129.4 141.199C130.533 140.987 131.639 140.651 132.7 140.199H132.8C132.985 140.164 133.176 140.194 133.341 140.285C133.506 140.377 133.633 140.524 133.7 140.699C133.772 140.86 133.781 141.041 133.726 141.208C133.67 141.375 133.554 141.515 133.4 141.599C132.348 142.291 131.203 142.83 130 143.199C128.762 143.699 127.434 143.937 126.1 143.899L124.1 143.499L122.3 142.899C121.131 142.484 119.995 141.982 118.9 141.399C118.811 141.358 118.731 141.298 118.667 141.223C118.602 141.148 118.554 141.061 118.526 140.967C118.498 140.872 118.49 140.773 118.502 140.675C118.515 140.577 118.548 140.483 118.6 140.399C118.687 140.269 118.806 140.163 118.947 140.093C119.087 140.023 119.243 139.991 119.4 139.999H119.5Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M121.5 116.399C122.069 117.753 122.505 119.16 122.8 120.599C123.071 122.052 123.238 123.522 123.3 124.999C123.3 126.437 123.199 127.874 123 129.299C122.806 130.752 122.505 132.189 122.1 133.599C122.011 133.804 121.85 133.968 121.646 134.061C121.443 134.153 121.213 134.167 121 134.099C120.816 134.034 120.658 133.911 120.55 133.749C120.442 133.587 120.389 133.393 120.4 133.199C120.6 131.799 120.8 130.499 120.9 129.099C121.033 127.736 121.067 126.366 121 124.999C121 123.66 120.899 122.323 120.7 120.999C120.5 119.599 120.2 118.299 120 116.899C119.968 116.71 120.005 116.517 120.103 116.353C120.201 116.189 120.355 116.066 120.536 116.006C120.717 115.946 120.914 115.952 121.091 116.024C121.267 116.096 121.413 116.229 121.5 116.399Z\" fill=\"%23F0BEB4\"/%3E%3Cpath d=\"M148.6 157.3C135.469 161.968 121.131 161.968 108 157.3L113.9 155.3C116.914 154.231 120.21 154.266 123.2 155.4H123.4C126.557 156.599 130.043 156.599 133.2 155.4C136.223 154.283 139.533 154.213 142.6 155.2L148.6 157.3Z\" fill=\"%23FF7143\"/%3E%3Cpath d=\"M148.6 157.301C148.6 157.301 143.9 167.301 128.3 167.301C112.7 167.301 108 157.301 108 157.301C121.131 161.969 135.469 161.969 148.6 157.301Z\" fill=\"%23FF8A63\"/%3E%3Cpath d=\"M105.4 155.3C107.226 156.104 109.096 156.805 111 157.4C120.365 160.616 130.439 161.17 140.1 159C143.955 158.126 147.709 156.853 151.3 155.2C151.351 155.166 151.408 155.145 151.469 155.136C151.529 155.128 151.591 155.134 151.649 155.153C151.707 155.173 151.76 155.205 151.803 155.248C151.847 155.291 151.88 155.343 151.9 155.4C152 155.6 151.9 155.8 151.7 156C144.71 160.362 136.639 162.682 128.4 162.7C126.326 162.72 124.254 162.586 122.2 162.3C120.133 162.094 118.091 161.692 116.1 161.1C112.128 160.082 108.323 158.499 104.8 156.4C104.663 156.3 104.568 156.154 104.531 155.988C104.494 155.822 104.519 155.649 104.6 155.5C104.628 155.424 104.675 155.356 104.735 155.302C104.796 155.248 104.868 155.209 104.947 155.19C105.026 155.17 105.108 155.17 105.187 155.189C105.266 155.208 105.339 155.247 105.4 155.3Z\" fill=\"%23FF5630\"/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"131.12\" y1=\"167.529\" x2=\"131.12\" y2=\"228.429\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23EBBEAE\"/%3E%3Cstop offset=\"0.64\" stop-color=\"%23FFE2D9\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint1_linear\" x1=\"63.57\" y1=\"127.109\" x2=\"91.11\" y2=\"127.109\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23FFE2D9\"/%3E%3Cstop offset=\"1\" stop-color=\"%23EBBEAE\"/%3E%3C/linearGradient%3E%3ClinearGradient id=\"paint2_linear\" x1=\"165.5\" y1=\"127.109\" x2=\"193.04\" y2=\"127.109\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23EBBEAE\"/%3E%3Cstop offset=\"1\" stop-color=\"%23FFE2D9\"/%3E%3C/linearGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0.599609H256V256.6H0V0.599609Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/images/processed/Vania.ts",
    "content": "/**\n * THIS FILE WAS CREATED VIA CODEGEN DO NOT MODIFY {@see http://go/af-codegen}\n *\n * This exists to workaround CodeSandbox issues with importing SVGs\n *\n * @codegen <<SignedSource::336f60a835a75d13d922d93a58619012>>\n * @codegenCommand yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen\n */\nexport default 'data:image/svg+xml,%3Csvg width=\"256\" height=\"258\" viewBox=\"0 0 256 258\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"%3E%3Cg clip-path=\"url(%23clip0)\"%3E%3Cpath d=\"M0 0.599609H256V257.3H0V0.599609Z\" fill=\"white\" fill-opacity=\"0.01\"/%3E%3Cpath d=\"M256 130.3V127.6C255.995 105.538 250.178 83.8668 239.136 64.7671C228.094 45.6674 212.216 29.8131 193.1 18.7998L190.9 17.3998C171.763 6.39754 150.074 0.607422 128 0.607422C105.926 0.607422 84.2372 6.39754 65.1 17.3998L62.9 18.7998C43.7838 29.8131 27.9057 45.6674 16.8637 64.7671C5.8217 83.8668 0.0053515 105.538 0 127.6L0 130.3C0.0053515 152.362 5.8217 174.033 16.8637 193.132C27.9057 212.232 43.7838 228.086 62.9 239.1L65.1 240.5C84.2372 251.502 105.926 257.292 128 257.292C150.074 257.292 171.763 251.502 190.9 240.5L193.1 239.1C212.216 228.086 228.094 212.232 239.136 193.132C250.178 174.033 255.995 152.362 256 130.3Z\" fill=\"%2357D9A3\"/%3E%3Cpath d=\"M171.3 205.7C170.664 205.306 169.945 205.067 169.2 205L130 203L90.8002 205C90.0552 205.067 89.3361 205.306 88.7002 205.7L53.1002 229.3C52.2203 229.785 51.4126 230.391 50.7002 231.1C54.5877 234.03 58.6631 236.703 62.9002 239.1L65.1002 240.5C84.2374 251.502 105.926 257.292 128 257.292C150.075 257.292 171.763 251.502 190.9 240.5L193.1 239.1C198.098 236.296 202.878 233.12 207.4 229.6L206.9 229.3L171.3 205.7Z\" fill=\"%2300875A\"/%3E%3Cpath d=\"M58.3001 82.9012C55.5001 93.3012 55.5001 120.101 55.0001 142.901C54.7001 155.201 53.8001 165.501 54.6001 168.801C57.3001 179.101 113.9 186.201 127.5 186.001C141.1 185.801 197.2 178.401 200.2 168.501C201.3 164.801 200.7 155.001 200.6 142.901C200.5 124.601 200.4 101.001 199.3 84.6012L127.9 64.7012L58.3001 82.9012Z\" fill=\"%230C1F41\"/%3E%3Cpath d=\"M166.9 206.7C166 207.9 151 227.9 126.2 226C106.1 224.4 94.8001 209.7 93.1001 207.4C98.0929 203.625 101.654 198.265 103.2 192.2C106.1 179.4 98.0001 169.6 97.1001 168.5H159.8C159.4 169.1 150.1 181.9 156 195.1C158.266 200.055 162.095 204.13 166.9 206.7Z\" fill=\"url(%23paint0_linear)\"/%3E%3Cpath d=\"M76.6003 142.801C84.2218 142.801 90.4003 136.623 90.4003 129.001C90.4003 121.38 84.2218 115.201 76.6003 115.201C68.9788 115.201 62.8003 121.38 62.8003 129.001C62.8003 136.623 68.9788 142.801 76.6003 142.801Z\" fill=\"%23E4B69D\"/%3E%3Cpath d=\"M179 142.801C186.622 142.801 192.8 136.623 192.8 129.001C192.8 121.38 186.622 115.201 179 115.201C171.379 115.201 165.2 121.38 165.2 129.001C165.2 136.623 171.379 142.801 179 142.801Z\" fill=\"%23E4B69D\"/%3E%3Cpath d=\"M183.8 123.801C182.6 153.301 159 187.301 128.2 187.301C97.4002 187.301 73.6002 153.401 72.4002 123.801C71.1002 91.1012 85.5002 54.2012 128.1 54.2012C170.7 54.2012 185.2 91.1012 183.8 123.801Z\" fill=\"%23F0D0B4\"/%3E%3Cpath d=\"M148.101 100.001C150.186 99.1975 152.374 98.6925 154.601 98.5015C155.701 98.4015 156.801 98.5015 157.901 98.5015L161.201 98.9015C163.376 99.3857 165.466 100.195 167.401 101.301C169.441 102.239 171.15 103.773 172.301 105.701C172.401 105.801 172.301 106.001 172.201 106.101H172.001C169.901 105.201 168.301 104.101 166.501 103.201C164.657 102.298 162.709 101.627 160.701 101.201L157.701 100.801C156.701 100.801 155.701 100.701 154.701 100.801H153.201L151.701 101.101C151.192 101.153 150.69 101.254 150.201 101.401L148.701 101.801C148.449 101.863 148.183 101.824 147.959 101.694C147.735 101.563 147.571 101.351 147.501 101.101C147.438 100.876 147.466 100.635 147.578 100.43C147.69 100.225 147.877 100.071 148.101 100.001Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M107 101.901L105.5 101.501C105.011 101.353 104.509 101.253 104 101.201L102.5 100.901H101C100 100.801 99.0004 100.901 98.0004 100.901L95.0004 101.301C93.0198 101.711 91.1028 102.383 89.3004 103.301C87.5004 104.201 85.8004 105.301 83.8004 106.201C83.6004 106.201 83.5004 106.201 83.4004 106.001V105.801C84.5995 103.913 86.2946 102.391 88.3004 101.401C90.25 100.326 92.3354 99.5192 94.5004 99.0011L97.8004 98.6011C99.0004 98.6011 100.1 98.5011 101.2 98.6011C103.425 98.8024 105.612 99.3071 107.7 100.101C107.939 100.21 108.131 100.402 108.241 100.64C108.351 100.879 108.372 101.148 108.3 101.401C108.195 101.619 108.019 101.797 107.802 101.905C107.585 102.014 107.339 102.047 107.1 102.001L107 101.901Z\" fill=\"%23253858\"/%3E%3Cpath d=\"M119.7 139.702C120.886 138.942 122.303 138.623 123.7 138.802C124.081 138.841 124.452 138.943 124.8 139.102L125.5 139.402C125.885 139.537 126.298 139.571 126.7 139.502L128.1 139.002C128.755 138.684 129.472 138.514 130.2 138.502C131.519 138.362 132.849 138.642 134 139.302C134.179 139.389 134.32 139.54 134.394 139.725C134.468 139.91 134.47 140.115 134.4 140.302C134.305 140.449 134.17 140.565 134.01 140.636C133.85 140.707 133.673 140.73 133.5 140.702C132.497 140.39 131.435 140.321 130.4 140.502C129.906 140.577 129.43 140.747 129 141.002L127.1 141.702C126.334 141.817 125.553 141.784 124.8 141.602L123.9 141.102L123.3 140.902C122.299 140.726 121.269 140.794 120.3 141.102C120.208 141.132 120.111 141.143 120.015 141.134C119.919 141.125 119.825 141.096 119.741 141.049C119.656 141.002 119.582 140.938 119.524 140.861C119.465 140.784 119.423 140.696 119.4 140.602C119.348 140.44 119.348 140.265 119.402 140.103C119.456 139.941 119.561 139.8 119.7 139.702Z\" fill=\"%23E4B69D\"/%3E%3Cpath d=\"M146.3 156.301C141 155.501 137.7 154.501 133.7 155.101H132.9C130.762 155.6 128.538 155.6 126.4 155.101H125.6C121.9 154.501 118.5 155.301 113.2 156.201L108.2 156.801C110.866 159.873 114.161 162.337 117.862 164.025C121.562 165.713 125.583 166.587 129.65 166.587C133.718 166.587 137.738 165.713 141.439 164.025C145.139 162.337 148.434 159.873 151.1 156.801L146.3 156.301Z\" fill=\"%23FF7452\"/%3E%3Cpath d=\"M105.7 155.201C109.516 156.388 113.432 157.224 117.4 157.701C125.298 158.801 133.312 158.768 141.2 157.601C143.2 157.401 145.1 157.001 147.1 156.601L152.9 155.101C152.965 155.062 153.039 155.043 153.115 155.045C153.19 155.047 153.263 155.07 153.326 155.112C153.389 155.154 153.438 155.213 153.469 155.281C153.5 155.35 153.511 155.426 153.5 155.501C153.534 155.558 153.553 155.623 153.555 155.69C153.557 155.756 153.543 155.823 153.513 155.882C153.483 155.942 153.439 155.993 153.384 156.031C153.33 156.069 153.266 156.093 153.2 156.101C149.427 157.608 145.505 158.714 141.5 159.401C137.473 160.118 133.391 160.486 129.3 160.501C127.3 160.501 125.2 160.401 123.2 160.201C121.156 160.072 119.12 159.838 117.1 159.501C113.079 158.787 109.13 157.717 105.3 156.301C105.1 156.101 104.9 155.801 105 155.601C105.061 155.47 105.162 155.362 105.287 155.29C105.412 155.218 105.557 155.187 105.7 155.201Z\" fill=\"%2372594B\"/%3E%3Cpath d=\"M91.7002 112.002C94.7499 109.843 98.3658 108.626 102.1 108.502C105.812 108.393 109.471 109.404 112.6 111.402C112.801 111.544 112.943 111.755 112.999 111.995C113.054 112.235 113.019 112.486 112.9 112.702C112.763 112.879 112.57 113.005 112.352 113.06C112.135 113.114 111.905 113.094 111.7 113.002C110.196 112.224 108.623 111.588 107 111.102C105.393 110.715 103.752 110.481 102.1 110.402C100.411 110.432 98.7323 110.667 97.1002 111.102C95.4629 111.544 93.8848 112.182 92.4002 113.002C92.3394 113.056 92.2664 113.094 92.1876 113.113C92.1087 113.133 92.0263 113.132 91.9476 113.113C91.8688 113.093 91.796 113.055 91.7355 113C91.675 112.946 91.6286 112.878 91.6002 112.802C91.5146 112.68 91.4774 112.531 91.4958 112.383C91.5143 112.235 91.5872 112.099 91.7002 112.002Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M166.2 113.002C164.716 112.182 163.138 111.544 161.5 111.102C159.866 110.68 158.188 110.445 156.5 110.402C154.816 110.481 153.142 110.715 151.5 111.102C149.91 111.588 148.37 112.224 146.9 113.002C146.791 113.07 146.668 113.114 146.54 113.131C146.412 113.147 146.282 113.136 146.159 113.098C146.036 113.06 145.922 112.996 145.826 112.911C145.729 112.825 145.652 112.72 145.6 112.602C145.509 112.397 145.488 112.167 145.543 111.95C145.597 111.732 145.723 111.539 145.9 111.402C149.048 109.409 152.718 108.401 156.442 108.508C160.166 108.615 163.773 109.831 166.8 112.002C166.896 112.096 166.957 112.22 166.974 112.353C166.991 112.487 166.963 112.622 166.894 112.738C166.824 112.853 166.718 112.942 166.593 112.99C166.467 113.037 166.329 113.042 166.2 113.002Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M155.4 117.703C157.168 117.703 158.6 116.27 158.6 114.503C158.6 112.735 157.168 111.303 155.4 111.303C153.633 111.303 152.2 112.735 152.2 114.503C152.2 116.27 153.633 117.703 155.4 117.703Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M102.7 117.703C104.467 117.703 105.9 116.27 105.9 114.503C105.9 112.735 104.467 111.303 102.7 111.303C100.933 111.303 99.5 112.735 99.5 114.503C99.5 116.27 100.933 117.703 102.7 117.703Z\" fill=\"%23172B4D\"/%3E%3Cpath d=\"M199.3 84.6006C197.5 72.5006 193.1 57.8006 187.3 49.1006C176.742 33.3236 160.35 22.3855 141.729 18.6913C123.108 14.9971 103.782 18.8492 88.0001 29.4006C68.6001 42.4006 56.8001 74.9006 57.0001 97.1006C86.0001 100.001 132.3 93.3006 152 70.1006C151.621 71.6382 151.119 73.143 150.5 74.6006C149.058 77.9372 147.025 80.9861 144.5 83.6006C143.194 84.9059 141.79 86.1094 140.3 87.2006C138.804 88.302 137.195 89.2407 135.5 90.0006H135.4C135.093 90.1505 134.846 90.4007 134.701 90.7098C134.555 91.0189 134.52 91.3685 134.6 91.7006C134.717 92.0916 134.978 92.4234 135.332 92.6279C135.685 92.8323 136.103 92.8941 136.5 92.8006C138.513 92.2091 140.458 91.4046 142.3 90.4006C144.182 89.4576 145.958 88.3179 147.6 87.0006C151.015 84.4164 153.929 81.2309 156.2 77.6006C158.484 73.9094 160.109 69.8488 161 65.6006C161.114 65.2442 161.182 64.8744 161.2 64.5006C174.1 74.2006 183.9 92.2006 183.9 116.101C187.8 118.501 193.4 98.6006 199.4 99.5006C199.3 96.9006 199.8 87.9006 199.3 84.6006Z\" fill=\"%23091E42\"/%3E%3Cpath d=\"M186.1 114.001H177.5C177.681 113.413 177.815 112.811 177.9 112.201L178.1 111.301V110.801C178.182 110.577 178.216 110.339 178.2 110.101C178.185 109.219 177.936 108.356 177.48 107.601C177.023 106.846 176.375 106.225 175.6 105.801L174.3 105.301H173.3L171.5 105.001C166.728 104.282 161.922 103.815 157.1 103.601C152.3 103.401 147.3 103.301 142.4 104.601C139.806 105.183 137.421 106.463 135.5 108.301C134.496 109.274 133.742 110.475 133.3 111.801C133.089 112.285 132.922 112.787 132.8 113.301C131.306 112.528 129.655 112.109 127.974 112.074C126.292 112.039 124.625 112.391 123.1 113.101C123.013 112.655 122.879 112.219 122.7 111.801C122.259 110.475 121.504 109.274 120.5 108.301C118.58 106.463 116.194 105.183 113.6 104.601C108.7 103.301 103.7 103.401 98.9004 103.601C94.0792 103.815 89.2725 104.282 84.5004 105.001L82.7004 105.301H81.7004L80.4004 105.801C79.6261 106.225 78.9776 106.846 78.521 107.601C78.0643 108.356 77.8157 109.219 77.8004 110.101C77.7843 110.339 77.8184 110.577 77.9004 110.801V111.301L78.1004 112.201C78.1857 112.811 78.3195 113.413 78.5004 114.001H70.0004C69.576 114.001 69.1691 114.17 68.869 114.47C68.569 114.77 68.4004 115.177 68.4004 115.601C68.4004 116.025 68.569 116.432 68.869 116.732C69.1691 117.033 69.576 117.201 70.0004 117.201H79.4004L79.6004 117.701C81.2956 122.531 84.4382 126.721 88.6004 129.701C90.6941 131.166 93.0299 132.249 95.5004 132.901C97.9561 133.496 100.474 133.798 103 133.801C105.507 133.786 107.998 133.416 110.4 132.701C112.887 132.024 115.204 130.831 117.2 129.201C119.221 127.562 120.83 125.473 121.9 123.101C122.719 121.06 123.192 118.897 123.3 116.701C123.9 116.201 127.5 113.501 132.7 116.801C132.808 118.965 133.282 121.095 134.1 123.101C135.17 125.473 136.78 127.562 138.8 129.201C140.797 130.831 143.114 132.024 145.6 132.701C148.003 133.416 150.494 133.786 153 133.801C155.527 133.798 158.045 133.496 160.5 132.901C162.971 132.249 165.307 131.166 167.4 129.701C171.563 126.721 174.705 122.531 176.4 117.701L176.6 117.201H186.1C186.525 117.201 186.932 117.033 187.232 116.732C187.532 116.432 187.7 116.025 187.7 115.601C187.7 115.177 187.532 114.77 187.232 114.47C186.932 114.17 186.525 114.001 186.1 114.001ZM119.7 122.201C118.815 124.237 117.441 126.023 115.7 127.401C112.2 130.101 107.5 131.201 103 131.201C100.704 131.121 98.423 130.785 96.2004 130.201C94.0575 129.563 92.0315 128.584 90.2004 127.301C86.6003 124.605 83.913 120.871 82.5004 116.601C82.3004 116.101 82.2004 115.501 82.0004 115.001C81.8201 114.447 81.6863 113.878 81.6004 113.301C81.409 112.75 81.275 112.18 81.2004 111.601V110.801C81.2004 110.701 81.1004 110.501 81.1004 110.401V110.201C81.1027 109.868 81.1974 109.542 81.3739 109.26C81.5505 108.977 81.802 108.749 82.1004 108.601H83.3004L85.0004 108.401C89.6652 107.552 94.3718 106.951 99.1004 106.601C103.8 106.301 108.5 106.201 112.9 107.301C115.034 107.654 117.017 108.628 118.6 110.101C119.333 110.837 119.913 111.711 120.308 112.672C120.703 113.633 120.904 114.662 120.9 115.701C120.9 117.923 120.494 120.126 119.7 122.201ZM175 110.401C175 110.501 174.9 110.701 174.9 110.801V111.601C174.826 112.18 174.692 112.75 174.5 113.301C174.414 113.878 174.281 114.447 174.1 115.001C173.9 115.501 173.8 116.101 173.6 116.601C172.188 120.871 169.5 124.605 165.9 127.301C164.069 128.584 162.043 129.563 159.9 130.201C157.678 130.785 155.397 131.121 153.1 131.201C148.6 131.201 143.9 130.101 140.4 127.401C138.66 126.023 137.286 124.237 136.4 122.201C135.607 120.126 135.2 117.923 135.2 115.701C135.197 114.662 135.398 113.633 135.793 112.672C136.187 111.711 136.768 110.837 137.5 110.101C139.084 108.628 141.066 107.654 143.2 107.301C147.6 106.201 152.3 106.301 157 106.601C161.757 106.848 166.497 107.349 171.2 108.101L172.9 108.301H174C174.299 108.449 174.55 108.677 174.727 108.96C174.903 109.242 174.998 109.568 175 109.901V110.401Z\" fill=\"%23006644\"/%3E%3C/g%3E%3Cdefs%3E%3ClinearGradient id=\"paint0_linear\" x1=\"130\" y1=\"180.14\" x2=\"130\" y2=\"236.31\" gradientUnits=\"userSpaceOnUse\"%3E%3Cstop stop-color=\"%23ECC19C\"/%3E%3Cstop offset=\"1\" stop-color=\"%23F1DBCB\"/%3E%3C/linearGradient%3E%3CclipPath id=\"clip0\"%3E%3Cpath d=\"M0 0.599609H256V257.3H0V0.599609Z\" fill=\"white\"/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E';\n"
  },
  {
    "path": "packages/documentation/examples/data/people/index.tsx",
    "content": "/**\n * These imports are written out explicitly because they\n * need to be statically analyzable to be uploaded to CodeSandbox correctly.\n */\nimport Alexander from './images/processed/Alexander';\nimport Aliza from './images/processed/Aliza';\nimport Alvin from './images/processed/Alvin';\nimport Angie from './images/processed/Angie';\nimport Arjun from './images/processed/Arjun';\nimport Blair from './images/processed/Blair';\nimport Claudia from './images/processed/Claudia';\nimport Colin from './images/processed/Colin';\nimport Ed from './images/processed/Ed';\nimport Effie from './images/processed/Effie';\nimport Eliot from './images/processed/Eliot';\nimport Fabian from './images/processed/Fabian';\nimport Gael from './images/processed/Gael';\nimport Gerard from './images/processed/Gerard';\nimport Hasan from './images/processed/Hasan';\nimport Helena from './images/processed/Helena';\nimport Ivan from './images/processed/Ivan';\nimport Katina from './images/processed/Katina';\nimport Lara from './images/processed/Lara';\nimport Leo from './images/processed/Leo';\nimport Lydia from './images/processed/Lydia';\nimport Maribel from './images/processed/Maribel';\nimport Milo from './images/processed/Milo';\nimport Myra from './images/processed/Myra';\nimport Narul from './images/processed/Narul';\nimport Norah from './images/processed/Norah';\nimport Oliver from './images/processed/Oliver';\nimport Rahul from './images/processed/Rahul';\nimport Renato from './images/processed/Renato';\nimport Steve from './images/processed/Steve';\nimport Tanya from './images/processed/Tanya';\nimport Tori from './images/processed/Tori';\nimport Vania from './images/processed/Vania';\n\nexport type Person = {\n\tuserId: string;\n\tname: string;\n\trole: string;\n\tavatarUrl: string;\n};\n\nconst avatarMap: Record<string, string> = {\n\tAlexander,\n\tAliza,\n\tAlvin,\n\tAngie,\n\tArjun,\n\tBlair,\n\tClaudia,\n\tColin,\n\tEd,\n\tEffie,\n\tEliot,\n\tFabian,\n\tGael,\n\tGerard,\n\tHasan,\n\tHelena,\n\tIvan,\n\tKatina,\n\tLara,\n\tLeo,\n\tLydia,\n\tMaribel,\n\tMilo,\n\tMyra,\n\tNarul,\n\tNorah,\n\tOliver,\n\tRahul,\n\tRenato,\n\tSteve,\n\tTanya,\n\tTori,\n\tVania,\n};\n\nconst names: string[] = Object.keys(avatarMap);\n\nconst roles: string[] = [\n\t'Engineer',\n\t'Senior Engineer',\n\t'Principal Engineer',\n\t'Engineering Manager',\n\t'Designer',\n\t'Senior Designer',\n\t'Lead Designer',\n\t'Design Manager',\n\t'Content Designer',\n\t'Product Manager',\n\t'Program Manager',\n];\n\nlet sharedLookupIndex: number = 0;\n\n/**\n * Note: this does not use randomness so that it is stable for VR tests\n */\nexport function getPerson(): Person {\n\tsharedLookupIndex++;\n\treturn getPersonFromPosition({ position: sharedLookupIndex });\n}\n\nexport function getPersonFromPosition({ position }: { position: number }): Person {\n\t// use the next name\n\tconst name = names[position % names.length];\n\t// use the next role\n\tconst role = roles[position % roles.length];\n\treturn {\n\t\tuserId: `id:${position}`,\n\t\tname,\n\t\trole,\n\t\tavatarUrl: avatarMap[name],\n\t};\n}\n\nexport function getPeopleFromPosition({\n\tamount,\n\tstartIndex,\n}: {\n\tamount: number;\n\tstartIndex: number;\n}): Person[] {\n\treturn Array.from({ length: amount }, () => getPersonFromPosition({ position: startIndex++ }));\n}\n\nexport function getPeople({ amount }: { amount: number }): Person[] {\n\treturn Array.from({ length: amount }, () => getPerson());\n}\n\nexport type ColumnType = {\n\ttitle: string;\n\tcolumnId: string;\n\titems: Person[];\n};\nexport type ColumnMap = { [columnId: string]: ColumnType };\n\nexport function getData({\n\tcolumnCount,\n\titemsPerColumn,\n}: {\n\tcolumnCount: number;\n\titemsPerColumn: number;\n}) {\n\tconst columnMap: ColumnMap = {};\n\n\tfor (let i = 0; i < columnCount; i++) {\n\t\tconst column: ColumnType = {\n\t\t\ttitle: `Column ${i}`,\n\t\t\tcolumnId: `column-${i}`,\n\t\t\titems: getPeople({ amount: itemsPerColumn }),\n\t\t};\n\t\tcolumnMap[column.columnId] = column;\n\t}\n\tconst orderedColumnIds = Object.keys(columnMap);\n\n\treturn {\n\t\tcolumnMap,\n\t\torderedColumnIds,\n\t\tlastOperation: null,\n\t};\n}\n\nexport function getBasicData() {\n\tconst columnMap: ColumnMap = {\n\t\tconfluence: {\n\t\t\ttitle: 'Confluence',\n\t\t\tcolumnId: 'confluence',\n\t\t\titems: getPeople({ amount: 10 }),\n\t\t},\n\t\tjira: {\n\t\t\ttitle: 'Jira',\n\t\t\tcolumnId: 'jira',\n\t\t\titems: getPeople({ amount: 10 }),\n\t\t},\n\t\ttrello: {\n\t\t\ttitle: 'Trello',\n\t\t\tcolumnId: 'trello',\n\t\t\titems: getPeople({ amount: 10 }),\n\t\t},\n\t};\n\n\tconst orderedColumnIds = ['confluence', 'jira', 'trello'];\n\n\treturn {\n\t\tcolumnMap,\n\t\torderedColumnIds,\n\t};\n}\n"
  },
  {
    "path": "packages/documentation/examples/data/presidents.tsx",
    "content": "export type President = {\n\tid: number;\n\tname: string;\n\tparty: string;\n\tterm: string;\n};\n\nexport const presidents = [\n\t{\n\t\tid: 1,\n\t\tname: 'George Washington',\n\t\tparty: 'None, Federalist',\n\t\tterm: '1789-1797',\n\t},\n\t{\n\t\tid: 2,\n\t\tname: 'John Adams',\n\t\tparty: 'Federalist',\n\t\tterm: '1797-1801',\n\t},\n\t{\n\t\tid: 3,\n\t\tname: 'Thomas Jefferson',\n\t\tparty: 'Democratic-Republican',\n\t\tterm: '1801-1809',\n\t},\n\t{\n\t\tid: 4,\n\t\tname: 'James Madison',\n\t\tparty: 'Democratic-Republican',\n\t\tterm: '1809-1817',\n\t},\n\t{\n\t\tid: 5,\n\t\tname: 'James Monroe',\n\t\tparty: 'Democratic-Republican',\n\t\tterm: '1817-1825',\n\t},\n\t{\n\t\tid: 6,\n\t\tname: 'John Quincy Adams',\n\t\tparty: 'Democratic-Republican',\n\t\tterm: '1825-1829',\n\t},\n\t{\n\t\tid: 7,\n\t\tname: 'Andrew Jackson',\n\t\tparty: 'Democrat',\n\t\tterm: '1829-1837',\n\t},\n\t{\n\t\tid: 8,\n\t\tname: 'Martin van Buren',\n\t\tparty: 'Democrat',\n\t\tterm: '1837-1841',\n\t},\n\t{\n\t\tid: 9,\n\t\tname: 'William H. Harrison',\n\t\tparty: 'Whig',\n\t\tterm: '1841',\n\t},\n\t{\n\t\tid: 10,\n\t\tname: 'John Tyler',\n\t\tparty: 'Whig',\n\t\tterm: '1841-1845',\n\t},\n];\n\nexport type RowOrder = number[];\n\nexport function getInitialRowOrder(): RowOrder {\n\treturn presidents.map((_, index) => index);\n}\n\nexport type Column = 'name' | 'party' | 'term';\n\nexport type ColumnOrder = Column[];\n\nexport const columnLabel: Record<Column, string> = {\n\tname: 'Name',\n\tparty: 'Party',\n\tterm: 'Term',\n};\n\nexport function getInitialColumnOrder(): ColumnOrder {\n\treturn ['name', 'party', 'term'];\n}\n"
  },
  {
    "path": "packages/documentation/examples/data/quotes/data.ts",
    "content": "import { token } from '@atlaskit/tokens';\n\nimport { fallbackColor } from '../../util/fallback';\n\nimport bmoImg from './images/bmo-min.png';\nimport finnImg from './images/finn-min.png';\nimport jakeImg from './images/jake-min.png';\nimport princessImg from './images/princess-min.png';\nimport type { Author, AuthorQuoteMap, Quote } from './types';\n\nconst jake: Author = {\n\tid: '1',\n\tname: 'Jake',\n\turl: 'http://adventuretime.wikia.com/wiki/Jake',\n\tavatarUrl: jakeImg,\n\tcolors: {\n\t\tsoft: token('color.background.accent.orange.subtler', fallbackColor),\n\t\thard: 'red',\n\t},\n};\n\nconst BMO: Author = {\n\tid: '2',\n\tname: 'BMO',\n\turl: 'http://adventuretime.wikia.com/wiki/BMO',\n\tavatarUrl: bmoImg,\n\tcolors: {\n\t\tsoft: token('color.background.accent.green.subtler', fallbackColor),\n\t\thard: 'red',\n\t},\n};\n\nconst finn: Author = {\n\tid: '3',\n\tname: 'Finn',\n\turl: 'http://adventuretime.wikia.com/wiki/Finn',\n\tavatarUrl: finnImg,\n\tcolors: {\n\t\tsoft: token('color.background.accent.blue.subtler', fallbackColor),\n\t\thard: 'red',\n\t},\n};\n\nconst princess: Author = {\n\tid: '4',\n\tname: 'Princess bubblegum',\n\turl: 'http://adventuretime.wikia.com/wiki/Princess_Bubblegum',\n\tavatarUrl: princessImg,\n\tcolors: {\n\t\tsoft: token('color.background.accent.purple.subtler', fallbackColor),\n\t\thard: 'red',\n\t},\n};\n\nexport const authors: Author[] = [jake, BMO, finn, princess];\n\nexport const quotes: Quote[] = [\n\t{\n\t\tid: '1',\n\t\tcontent: 'Sometimes life is scary and dark',\n\t\tauthor: BMO,\n\t},\n\t{\n\t\tid: '2',\n\t\tcontent: 'Sucking at something is the first step towards being sorta good at something.',\n\t\tauthor: jake,\n\t},\n\t{\n\t\tid: '3',\n\t\tcontent: \"You got to focus on what's real, man\",\n\t\tauthor: jake,\n\t},\n\t{\n\t\tid: '4',\n\t\tcontent: 'Is that where creativity comes from? From sad biz?',\n\t\tauthor: finn,\n\t},\n\t{\n\t\tid: '5',\n\t\tcontent: 'Homies help homies. Always',\n\t\tauthor: finn,\n\t},\n\t{\n\t\tid: '6',\n\t\tcontent: 'Responsibility demands sacrifice',\n\t\tauthor: princess,\n\t},\n\t{\n\t\tid: '7',\n\t\tcontent: \"That's it! The answer was so simple, I was too smart to see it!\",\n\t\tauthor: princess,\n\t},\n\t{\n\t\tid: '8',\n\t\tcontent:\n\t\t\t\"People make mistakes. It's all a part of growing up and you never really stop growing\",\n\t\tauthor: finn,\n\t},\n\t{\n\t\tid: '9',\n\t\tcontent: \"Don't you always call sweatpants 'give up on life pants,' Jake?\",\n\t\tauthor: finn,\n\t},\n\t{\n\t\tid: '10',\n\t\tcontent: 'I should not have drunk that much tea!',\n\t\tauthor: princess,\n\t},\n\t{\n\t\tid: '11',\n\t\tcontent: 'Please! I need the real you!',\n\t\tauthor: princess,\n\t},\n\t{\n\t\tid: '12',\n\t\tcontent: \"Haven't slept for a solid 83 hours, but, yeah, I'm good.\",\n\t\tauthor: princess,\n\t},\n];\n\n// So we do not have any clashes with our hardcoded ones\nlet idCount: number = quotes.length + 1;\n\nexport const getQuotes = (count: number): Quote[] =>\n\tArray.from({ length: count }, (v, k) => k).map(() => {\n\t\tconst random: Quote = quotes[Math.floor(Math.random() * quotes.length)];\n\n\t\tconst custom: Quote = {\n\t\t\t...random,\n\t\t\tid: `G${idCount++}`,\n\t\t};\n\n\t\treturn custom;\n\t});\n\nexport const getAuthors = (count: number): Author[] =>\n\tArray.from({ length: count }, (v, k) => k).map(() => {\n\t\tconst random: Author = authors[Math.floor(Math.random() * authors.length)];\n\n\t\tconst custom: Author = {\n\t\t\t...random,\n\t\t\tid: `author-${idCount++}`,\n\t\t};\n\n\t\treturn custom;\n\t});\n\nconst getByAuthor = (author: Author, items: Quote[]): Quote[] =>\n\titems.filter((quote: Quote) => quote.author === author);\n\nexport const authorQuoteMap: AuthorQuoteMap = authors.reduce(\n\t(previous: AuthorQuoteMap, author: Author) => ({\n\t\t...previous,\n\t\t[author.name]: getByAuthor(author, quotes),\n\t}),\n\t{},\n);\n\nexport const generateQuoteMap = (quoteCount: number): AuthorQuoteMap =>\n\tauthors.reduce(\n\t\t(previous: AuthorQuoteMap, author: Author) => ({\n\t\t\t...previous,\n\t\t\t[author.name]: getQuotes(quoteCount / authors.length),\n\t\t}),\n\t\t{},\n\t);\n"
  },
  {
    "path": "packages/documentation/examples/data/quotes/types.ts",
    "content": "export type Position = {\n\tx: number;\n\ty: number;\n};\n\nexport type Author = {\n\tid: string;\n\tname: string;\n\tavatarUrl: string;\n\turl: string;\n\tcolors: {\n\t\tsoft: string;\n\t\thard: string;\n\t};\n};\n\nexport type Quote = {\n\tid: string;\n\tcontent: string;\n\tauthor: Author;\n};\n\nexport type AuthorQuoteMap = {\n\t[key: string]: Quote[];\n};\n"
  },
  {
    "path": "packages/documentation/examples/data/table.tsx",
    "content": "import batteryIcon from '../icons/battery.png';\nimport cloudIcon from '../icons/cloud.png';\nimport drillIcon from '../icons/drill.png';\nimport koalaIcon from '../icons/koala.png';\n\nexport type TableRowData = {\n\tid: string;\n\tname: string;\n\tavatarUrl: string;\n};\n\nexport const tableRows: TableRowData[] = [\n\t{ id: '1', name: 'Battery', avatarUrl: batteryIcon },\n\t{ id: '2', name: 'Cloud', avatarUrl: cloudIcon },\n\t{ id: '3', name: 'Drill', avatarUrl: drillIcon },\n\t{ id: '4', name: 'Koala', avatarUrl: koalaIcon },\n];\n\nexport type TableColumnData = { id: string; label: string };\n\nexport const tableColumns: TableColumnData[] = [\n\t{ id: 'id', label: 'Id' },\n\t{ id: 'name', label: 'Name' },\n\t{ id: 'icon', label: 'Icon' },\n];\n"
  },
  {
    "path": "packages/documentation/examples/data/tasks.ts",
    "content": "export type Item = {\n\titemId: string;\n};\n\nexport type ColumnType = {\n\ttitle: string;\n\tcolumnId: string;\n\titems: Item[];\n};\nexport type ColumnMap = { [columnId: string]: ColumnType };\n\nfunction getItems({ count, startColumnId }: { count: number; startColumnId: string }): Item[] {\n\treturn Array.from(\n\t\t{ length: count },\n\t\t(_, index): Item => ({\n\t\t\titemId: `${startColumnId}${index}`,\n\t\t}),\n\t);\n}\n\nexport function getInitialData() {\n\tconst orderedColumnIds: string[] = ['A', 'B', 'C'];\n\tconst columns: ColumnType[] = orderedColumnIds.map((columnId, index) => {\n\t\tconst column: ColumnType = {\n\t\t\ttitle: `Column ${columnId}`,\n\t\t\tcolumnId: columnId,\n\t\t\titems: getItems({\n\t\t\t\tstartColumnId: columnId,\n\t\t\t\tcount: Math.max(6 - 2 * index, 0),\n\t\t\t}),\n\t\t};\n\t\treturn column;\n\t});\n\tconst columnMap = columns.reduce((acc: ColumnMap, column) => {\n\t\tacc[column.columnId] = column;\n\t\treturn acc;\n\t}, {});\n\n\treturn { columnMap, orderedColumnIds };\n}\n"
  },
  {
    "path": "packages/documentation/examples/data/tree-legacy.ts",
    "content": "import invariant from 'tiny-invariant';\n\nimport type { Instruction } from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';\n\nexport type TreeItem = {\n\tid: string;\n\tisDraft?: boolean;\n\tchildren: TreeItem[];\n\tisOpen?: boolean;\n};\n\nexport type TreeState = {\n\tlastAction: TreeAction | null;\n\tdata: TreeItem[];\n};\n\nexport function getInitialTreeState(): TreeState {\n\treturn { data: getInitialData(), lastAction: null };\n}\n\nexport function getInitialData(): TreeItem[] {\n\treturn [\n\t\t{\n\t\t\tid: '1',\n\t\t\tisOpen: true,\n\n\t\t\tchildren: [\n\t\t\t\t{\n\t\t\t\t\tid: '1.1',\n\t\t\t\t\tisOpen: true,\n\n\t\t\t\t\tchildren: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: '1.1.1',\n\t\t\t\t\t\t\tchildren: [],\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: '1.1.2',\n\t\t\t\t\t\t\tisDraft: true,\n\t\t\t\t\t\t\tchildren: [],\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\t{ id: '1.2', children: [] },\n\t\t\t],\n\t\t},\n\t\t{\n\t\t\tid: '2',\n\t\t\tisOpen: true,\n\t\t\tchildren: [\n\t\t\t\t{\n\t\t\t\t\tid: '2.1',\n\t\t\t\t\tisOpen: true,\n\n\t\t\t\t\tchildren: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: '2.1.1',\n\t\t\t\t\t\t\tchildren: [],\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: '2.1.2',\n\t\t\t\t\t\t\tchildren: [],\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t];\n}\n\nexport type TreeAction =\n\t| {\n\t\t\ttype: 'instruction';\n\t\t\tinstruction: Instruction;\n\t\t\titemId: string;\n\t\t\ttargetId: string;\n\t  }\n\t| {\n\t\t\ttype: 'toggle';\n\t\t\titemId: string;\n\t  }\n\t| {\n\t\t\ttype: 'expand';\n\t\t\titemId: string;\n\t  }\n\t| {\n\t\t\ttype: 'collapse';\n\t\t\titemId: string;\n\t  }\n\t| { type: 'modal-move'; itemId: string; targetId: string; index: number };\n\nexport const tree = {\n\tremove(data: TreeItem[], id: string): TreeItem[] {\n\t\treturn data\n\t\t\t.filter((item) => item.id !== id)\n\t\t\t.map((item) => {\n\t\t\t\tif (tree.hasChildren(item)) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...item,\n\t\t\t\t\t\tchildren: tree.remove(item.children, id),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn item;\n\t\t\t});\n\t},\n\tinsertBefore(data: TreeItem[], targetId: string, newItem: TreeItem): TreeItem[] {\n\t\treturn data.flatMap((item) => {\n\t\t\tif (item.id === targetId) {\n\t\t\t\treturn [newItem, item];\n\t\t\t}\n\t\t\tif (tree.hasChildren(item)) {\n\t\t\t\treturn {\n\t\t\t\t\t...item,\n\t\t\t\t\tchildren: tree.insertBefore(item.children, targetId, newItem),\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn item;\n\t\t});\n\t},\n\tinsertAfter(data: TreeItem[], targetId: string, newItem: TreeItem): TreeItem[] {\n\t\treturn data.flatMap((item) => {\n\t\t\tif (item.id === targetId) {\n\t\t\t\treturn [item, newItem];\n\t\t\t}\n\n\t\t\tif (tree.hasChildren(item)) {\n\t\t\t\treturn {\n\t\t\t\t\t...item,\n\t\t\t\t\tchildren: tree.insertAfter(item.children, targetId, newItem),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn item;\n\t\t});\n\t},\n\tinsertChild(data: TreeItem[], targetId: string, newItem: TreeItem): TreeItem[] {\n\t\treturn data.flatMap((item) => {\n\t\t\tif (item.id === targetId) {\n\t\t\t\t// already a parent: add as first child\n\t\t\t\treturn {\n\t\t\t\t\t...item,\n\t\t\t\t\t// opening item so you can see where item landed\n\t\t\t\t\tisOpen: true,\n\t\t\t\t\tchildren: [newItem, ...item.children],\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (!tree.hasChildren(item)) {\n\t\t\t\treturn item;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...item,\n\t\t\t\tchildren: tree.insertChild(item.children, targetId, newItem),\n\t\t\t};\n\t\t});\n\t},\n\tfind(data: TreeItem[], itemId: string): TreeItem | undefined {\n\t\tfor (const item of data) {\n\t\t\tif (item.id === itemId) {\n\t\t\t\treturn item;\n\t\t\t}\n\n\t\t\tif (tree.hasChildren(item)) {\n\t\t\t\tconst result = tree.find(item.children, itemId);\n\t\t\t\tif (result) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\tgetPathToItem({\n\t\tcurrent,\n\t\ttargetId,\n\t\tparentIds = [],\n\t}: {\n\t\tcurrent: TreeItem[];\n\t\ttargetId: string;\n\t\tparentIds?: string[];\n\t}): string[] | undefined {\n\t\tfor (const item of current) {\n\t\t\tif (item.id === targetId) {\n\t\t\t\treturn parentIds;\n\t\t\t}\n\t\t\tconst nested = tree.getPathToItem({\n\t\t\t\tcurrent: item.children,\n\t\t\t\ttargetId: targetId,\n\t\t\t\tparentIds: [...parentIds, item.id],\n\t\t\t});\n\t\t\tif (nested) {\n\t\t\t\treturn nested;\n\t\t\t}\n\t\t}\n\t},\n\thasChildren(item: TreeItem): boolean {\n\t\treturn item.children.length > 0;\n\t},\n};\n\nexport function treeStateReducer(state: TreeState, action: TreeAction): TreeState {\n\treturn {\n\t\tdata: dataReducer(state.data, action),\n\t\tlastAction: action,\n\t};\n}\n\nconst dataReducer = (data: TreeItem[], action: TreeAction) => {\n\tconsole.log('action', action);\n\n\tconst item = tree.find(data, action.itemId);\n\tif (!item) {\n\t\treturn data;\n\t}\n\n\tif (action.type === 'instruction') {\n\t\tconst instruction = action.instruction;\n\n\t\tif (instruction.type === 'reparent') {\n\t\t\tconst path = tree.getPathToItem({\n\t\t\t\tcurrent: data,\n\t\t\t\ttargetId: action.targetId,\n\t\t\t});\n\t\t\tinvariant(path);\n\t\t\tconst desiredId = path[instruction.desiredLevel];\n\t\t\tlet result = tree.remove(data, action.itemId);\n\t\t\tresult = tree.insertAfter(result, desiredId, item);\n\t\t\treturn result;\n\t\t}\n\n\t\t// the rest of the actions require you to drop on something else\n\t\tif (action.itemId === action.targetId) {\n\t\t\treturn data;\n\t\t}\n\n\t\tif (instruction.type === 'reorder-above') {\n\t\t\tlet result = tree.remove(data, action.itemId);\n\t\t\tresult = tree.insertBefore(result, action.targetId, item);\n\t\t\treturn result;\n\t\t}\n\n\t\tif (instruction.type === 'reorder-below') {\n\t\t\tlet result = tree.remove(data, action.itemId);\n\t\t\tresult = tree.insertAfter(result, action.targetId, item);\n\t\t\treturn result;\n\t\t}\n\n\t\tif (instruction.type === 'make-child') {\n\t\t\tlet result = tree.remove(data, action.itemId);\n\t\t\tresult = tree.insertChild(result, action.targetId, item);\n\t\t\treturn result;\n\t\t}\n\n\t\tconsole.warn('TODO: action not implemented', instruction);\n\n\t\treturn data;\n\t}\n\n\tfunction toggle(item: TreeItem): TreeItem {\n\t\tif (!tree.hasChildren(item)) {\n\t\t\treturn item;\n\t\t}\n\n\t\tif (item.id === action.itemId) {\n\t\t\treturn { ...item, isOpen: !item.isOpen };\n\t\t}\n\n\t\treturn { ...item, children: item.children.map(toggle) };\n\t}\n\n\tif (action.type === 'toggle') {\n\t\treturn data.map(toggle);\n\t}\n\n\tif (action.type === 'expand') {\n\t\tif (tree.hasChildren(item) && !item.isOpen) {\n\t\t\treturn data.map(toggle);\n\t\t}\n\t\treturn data;\n\t}\n\n\tif (action.type === 'collapse') {\n\t\tif (tree.hasChildren(item) && item.isOpen) {\n\t\t\treturn data.map(toggle);\n\t\t}\n\t\treturn data;\n\t}\n\n\tif (action.type === 'modal-move') {\n\t\tlet result = tree.remove(data, item.id);\n\n\t\tconst siblingItems = getChildItems(result, action.targetId);\n\n\t\tif (siblingItems.length === 0) {\n\t\t\tif (action.targetId === '') {\n\t\t\t\t/**\n\t\t\t\t * If the target is the root level, and there are no siblings, then\n\t\t\t\t * the item is the only thing in the root level.\n\t\t\t\t */\n\t\t\t\tresult = [item];\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * Otherwise for deeper levels that have no children, we need to\n\t\t\t\t * use `insertChild` instead of inserting relative to a sibling.\n\t\t\t\t */\n\t\t\t\tresult = tree.insertChild(result, action.targetId, item);\n\t\t\t}\n\t\t} else if (action.index === siblingItems.length) {\n\t\t\tconst relativeTo = siblingItems[siblingItems.length - 1];\n\t\t\t/**\n\t\t\t * If the position selected is the end, we insert after the last item.\n\t\t\t */\n\t\t\tresult = tree.insertAfter(result, relativeTo.id, item);\n\t\t} else {\n\t\t\tconst relativeTo = siblingItems[action.index];\n\t\t\t/**\n\t\t\t * Otherwise we insert before the existing item in the given position.\n\t\t\t * This results in the new item being in that position.\n\t\t\t */\n\t\t\tresult = tree.insertBefore(result, relativeTo.id, item);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\treturn data;\n};\n\nfunction getChildItems(data: TreeItem[], targetId: string) {\n\t/**\n\t * An empty string is representing the root\n\t */\n\tif (targetId === '') {\n\t\treturn data;\n\t}\n\n\tconst targetItem = tree.find(data, targetId);\n\tinvariant(targetItem);\n\n\treturn targetItem.children;\n}\n"
  },
  {
    "path": "packages/documentation/examples/data/tree.ts",
    "content": "import invariant from 'tiny-invariant';\n\nimport type { Instruction } from '@atlaskit/pragmatic-drag-and-drop-hitbox/list-item';\n\nexport type TreeItem = {\n\tid: string;\n\tisDraft?: boolean;\n\tchildren: TreeItem[];\n\tisOpen?: boolean;\n};\n\nexport type TreeState = {\n\tlastAction: TreeAction | null;\n\tdata: TreeItem[];\n};\n\nexport function getInitialTreeState(): TreeState {\n\treturn { data: getInitialData(), lastAction: null };\n}\n\nexport function getInitialData(): TreeItem[] {\n\treturn [\n\t\t{\n\t\t\tid: '1',\n\t\t\tisOpen: true,\n\n\t\t\tchildren: [\n\t\t\t\t{\n\t\t\t\t\tid: '1.1',\n\t\t\t\t\tisOpen: true,\n\n\t\t\t\t\tchildren: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: '1.1.1',\n\t\t\t\t\t\t\tchildren: [],\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: '1.1.2',\n\t\t\t\t\t\t\tisDraft: true,\n\t\t\t\t\t\t\tchildren: [],\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t\t{ id: '1.2', children: [] },\n\t\t\t],\n\t\t},\n\t\t{\n\t\t\tid: '2',\n\t\t\tisOpen: true,\n\t\t\tchildren: [\n\t\t\t\t{\n\t\t\t\t\tid: '2.1',\n\t\t\t\t\tisOpen: true,\n\n\t\t\t\t\tchildren: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: '2.1.1',\n\t\t\t\t\t\t\tchildren: [],\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tid: '2.1.2',\n\t\t\t\t\t\t\tchildren: [],\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t];\n}\n\nexport type TreeAction =\n\t| {\n\t\t\ttype: 'instruction';\n\t\t\tinstruction: Instruction;\n\t\t\titemId: string;\n\t\t\ttargetId: string;\n\t  }\n\t| {\n\t\t\ttype: 'toggle';\n\t\t\titemId: string;\n\t  }\n\t| {\n\t\t\ttype: 'expand';\n\t\t\titemId: string;\n\t  }\n\t| {\n\t\t\ttype: 'collapse';\n\t\t\titemId: string;\n\t  }\n\t| { type: 'modal-move'; itemId: string; targetId: string; index: number };\n\nexport const tree = {\n\tremove(data: TreeItem[], id: string): TreeItem[] {\n\t\treturn data\n\t\t\t.filter((item) => item.id !== id)\n\t\t\t.map((item) => {\n\t\t\t\tif (tree.hasChildren(item)) {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...item,\n\t\t\t\t\t\tchildren: tree.remove(item.children, id),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn item;\n\t\t\t});\n\t},\n\tinsertBefore(data: TreeItem[], targetId: string, newItem: TreeItem): TreeItem[] {\n\t\treturn data.flatMap((item) => {\n\t\t\tif (item.id === targetId) {\n\t\t\t\treturn [newItem, item];\n\t\t\t}\n\t\t\tif (tree.hasChildren(item)) {\n\t\t\t\treturn {\n\t\t\t\t\t...item,\n\t\t\t\t\tchildren: tree.insertBefore(item.children, targetId, newItem),\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn item;\n\t\t});\n\t},\n\tinsertAfter(data: TreeItem[], targetId: string, newItem: TreeItem): TreeItem[] {\n\t\treturn data.flatMap((item) => {\n\t\t\tif (item.id === targetId) {\n\t\t\t\treturn [item, newItem];\n\t\t\t}\n\n\t\t\tif (tree.hasChildren(item)) {\n\t\t\t\treturn {\n\t\t\t\t\t...item,\n\t\t\t\t\tchildren: tree.insertAfter(item.children, targetId, newItem),\n\t\t\t\t};\n\t\t\t}\n\n\t\t\treturn item;\n\t\t});\n\t},\n\tinsertChild(data: TreeItem[], targetId: string, newItem: TreeItem): TreeItem[] {\n\t\treturn data.flatMap((item) => {\n\t\t\tif (item.id === targetId) {\n\t\t\t\t// already a parent: add as first child\n\t\t\t\treturn {\n\t\t\t\t\t...item,\n\t\t\t\t\t// opening item so you can see where item landed\n\t\t\t\t\tisOpen: true,\n\t\t\t\t\tchildren: [newItem, ...item.children],\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (!tree.hasChildren(item)) {\n\t\t\t\treturn item;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...item,\n\t\t\t\tchildren: tree.insertChild(item.children, targetId, newItem),\n\t\t\t};\n\t\t});\n\t},\n\tfind(data: TreeItem[], itemId: string): TreeItem | undefined {\n\t\tfor (const item of data) {\n\t\t\tif (item.id === itemId) {\n\t\t\t\treturn item;\n\t\t\t}\n\n\t\t\tif (tree.hasChildren(item)) {\n\t\t\t\tconst result = tree.find(item.children, itemId);\n\t\t\t\tif (result) {\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t},\n\tgetPathToItem({\n\t\tcurrent,\n\t\ttargetId,\n\t\tparentIds = [],\n\t}: {\n\t\tcurrent: TreeItem[];\n\t\ttargetId: string;\n\t\tparentIds?: string[];\n\t}): string[] | undefined {\n\t\tfor (const item of current) {\n\t\t\tif (item.id === targetId) {\n\t\t\t\treturn parentIds;\n\t\t\t}\n\t\t\tconst nested = tree.getPathToItem({\n\t\t\t\tcurrent: item.children,\n\t\t\t\ttargetId: targetId,\n\t\t\t\tparentIds: [...parentIds, item.id],\n\t\t\t});\n\t\t\tif (nested) {\n\t\t\t\treturn nested;\n\t\t\t}\n\t\t}\n\t},\n\thasChildren(item: TreeItem): boolean {\n\t\treturn item.children.length > 0;\n\t},\n};\n\nexport function treeStateReducer(state: TreeState, action: TreeAction): TreeState {\n\treturn {\n\t\tdata: dataReducer(state.data, action),\n\t\tlastAction: action,\n\t};\n}\n\nconst dataReducer = (data: TreeItem[], action: TreeAction) => {\n\tconsole.log('action', action);\n\n\tconst item = tree.find(data, action.itemId);\n\tif (!item) {\n\t\treturn data;\n\t}\n\n\tif (action.type === 'instruction') {\n\t\tconst instruction = action.instruction;\n\n\t\t// the rest of the actions require you to drop on something else\n\t\tif (action.itemId === action.targetId) {\n\t\t\treturn data;\n\t\t}\n\n\t\t// instruction was blocked and should not do anything\n\t\tif (action.instruction.blocked) {\n\t\t\treturn data;\n\t\t}\n\n\t\tif (instruction.operation === 'reorder-before') {\n\t\t\tlet result = tree.remove(data, action.itemId);\n\t\t\tresult = tree.insertBefore(result, action.targetId, item);\n\t\t\treturn result;\n\t\t}\n\n\t\tif (instruction.operation === 'reorder-after') {\n\t\t\tlet result = tree.remove(data, action.itemId);\n\t\t\tresult = tree.insertAfter(result, action.targetId, item);\n\t\t\treturn result;\n\t\t}\n\n\t\tif (instruction.operation === 'combine') {\n\t\t\tlet result = tree.remove(data, action.itemId);\n\t\t\tresult = tree.insertChild(result, action.targetId, item);\n\t\t\treturn result;\n\t\t}\n\n\t\tconsole.warn('TODO: action not implemented', instruction);\n\n\t\treturn data;\n\t}\n\n\tfunction toggle(item: TreeItem): TreeItem {\n\t\tif (!tree.hasChildren(item)) {\n\t\t\treturn item;\n\t\t}\n\n\t\tif (item.id === action.itemId) {\n\t\t\treturn { ...item, isOpen: !item.isOpen };\n\t\t}\n\n\t\treturn { ...item, children: item.children.map(toggle) };\n\t}\n\n\tif (action.type === 'toggle') {\n\t\treturn data.map(toggle);\n\t}\n\n\tif (action.type === 'expand') {\n\t\tif (tree.hasChildren(item) && !item.isOpen) {\n\t\t\treturn data.map(toggle);\n\t\t}\n\t\treturn data;\n\t}\n\n\tif (action.type === 'collapse') {\n\t\tif (tree.hasChildren(item) && item.isOpen) {\n\t\t\treturn data.map(toggle);\n\t\t}\n\t\treturn data;\n\t}\n\n\tif (action.type === 'modal-move') {\n\t\tlet result = tree.remove(data, item.id);\n\n\t\tconst siblingItems = getChildItems(result, action.targetId);\n\n\t\tif (siblingItems.length === 0) {\n\t\t\tif (action.targetId === '') {\n\t\t\t\t/**\n\t\t\t\t * If the target is the root level, and there are no siblings, then\n\t\t\t\t * the item is the only thing in the root level.\n\t\t\t\t */\n\t\t\t\tresult = [item];\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * Otherwise for deeper levels that have no children, we need to\n\t\t\t\t * use `insertChild` instead of inserting relative to a sibling.\n\t\t\t\t */\n\t\t\t\tresult = tree.insertChild(result, action.targetId, item);\n\t\t\t}\n\t\t} else if (action.index === siblingItems.length) {\n\t\t\tconst relativeTo = siblingItems[siblingItems.length - 1];\n\t\t\t/**\n\t\t\t * If the position selected is the end, we insert after the last item.\n\t\t\t */\n\t\t\tresult = tree.insertAfter(result, relativeTo.id, item);\n\t\t} else {\n\t\t\tconst relativeTo = siblingItems[action.index];\n\t\t\t/**\n\t\t\t * Otherwise we insert before the existing item in the given position.\n\t\t\t * This results in the new item being in that position.\n\t\t\t */\n\t\t\tresult = tree.insertBefore(result, relativeTo.id, item);\n\t\t}\n\n\t\treturn result;\n\t}\n\n\treturn data;\n};\n\nfunction getChildItems(data: TreeItem[], targetId: string) {\n\t/**\n\t * An empty string is representing the root\n\t */\n\tif (targetId === '') {\n\t\treturn data;\n\t}\n\n\tconst targetItem = tree.find(data, targetId);\n\tinvariant(targetItem);\n\n\treturn targetItem.children;\n}\n"
  },
  {
    "path": "packages/documentation/examples/deferred.tsx",
    "content": "/* eslint-disable import/dynamic-import-chunkname */\n/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { Fragment, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport { token } from '@atlaskit/tokens';\nimport { importForInteraction, waitForAllResources } from '@atlassian/react-async';\n\nimport { fallbackColor } from './util/fallback';\nimport { GlobalStyles } from './util/global-styles';\n\nconst fileStyles = css({\n\tdisplay: 'flex',\n\tpadding: 'calc(var(--grid) * 6) calc(var(--grid) * 4)',\n\talignItems: 'center',\n\tjustifyContent: 'center',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tbackground: token('elevation.surface.sunken', fallbackColor),\n\tborderRadius: 'var(--border-radius)',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tcolor: token('color.text.disabled', fallbackColor),\n\tfontSize: '1.4rem',\n});\n\nconst overStyles = css({\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tbackground: token('color.background.selected.hovered', fallbackColor),\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tcolor: token('color.text.selected', fallbackColor),\n});\n\nconst potentialStyles = css({\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tbackground: token('color.background.discovery', fallbackColor),\n});\n\nconst appStyles = css({\n\tdisplay: 'flex',\n\tpadding: 'var(--grid)',\n\talignItems: 'center',\n\tgap: 'calc(var(--grid) * 2)',\n\tflexDirection: 'column',\n});\n\nfunction FileList({ uploads }: { uploads: File[] }) {\n\tif (!uploads.length) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<ul>\n\t\t\t{uploads.map((upload, index) => (\n\t\t\t\t<li key={index}>{upload.name}</li>\n\t\t\t))}\n\t\t</ul>\n\t);\n}\n\nfunction Uploader() {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<'loading' | 'idle' | 'potential' | 'over'>('loading');\n\tconst [uploads, setUploads] = useState<File[]>([]);\n\n\tuseEffect(() => {\n\t\tlet cleanupDragAndDrop: null | (() => void) = null;\n\t\tconst disposeResource = waitForAllResources([\n\t\t\timportForInteraction(\n\t\t\t\t() =>\n\t\t\t\t\timport(\n\t\t\t\t\t\t/* webpackChunkName: \"@atlaskit/pragmatic-drag-and-drop/combine\" */ '@atlaskit/pragmatic-drag-and-drop/combine'\n\t\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\tmoduleId: '@atlaskit/pragmatic-drag-and-drop/combine',\n\t\t\t\t},\n\t\t\t),\n\t\t\timportForInteraction(\n\t\t\t\t() =>\n\t\t\t\t\timport(\n\t\t\t\t\t\t/* webpackChunkName: \"@atlaskit/pragmatic-drag-and-drop/external/adapter\" */ '@atlaskit/pragmatic-drag-and-drop/external/adapter'\n\t\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\tmoduleId: '@atlaskit/pragmatic-drag-and-drop/external/adapter',\n\t\t\t\t},\n\t\t\t),\n\t\t\timportForInteraction(\n\t\t\t\t() =>\n\t\t\t\t\timport(\n\t\t\t\t\t\t/* webpackChunkName: \"@atlaskit/pragmatic-drag-and-drop/external/file\" */ '@atlaskit/pragmatic-drag-and-drop/external/file'\n\t\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\tmoduleId: '@atlaskit/pragmatic-drag-and-drop/external/file',\n\t\t\t\t},\n\t\t\t),\n\t\t\timportForInteraction(\n\t\t\t\t() =>\n\t\t\t\t\timport(\n\t\t\t\t\t\t/* webpackChunkName: \"@atlaskit/pragmatic-drag-and-drop/prevent-unhandled\" */ '@atlaskit/pragmatic-drag-and-drop/prevent-unhandled'\n\t\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\tmoduleId: '@atlaskit/pragmatic-drag-and-drop/prevent-unhandled',\n\t\t\t\t},\n\t\t\t),\n\t\t]).onComplete(\n\t\t\t([\n\t\t\t\t{ combine },\n\t\t\t\t{ dropTargetForExternal, monitorForExternal },\n\t\t\t\t{ containsFiles, getFiles },\n\t\t\t\t{ preventUnhandled },\n\t\t\t]) => {\n\t\t\t\tconst el = ref.current;\n\t\t\t\tif (!el) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tsetState('idle');\n\n\t\t\t\tcleanupDragAndDrop = combine(\n\t\t\t\t\tdropTargetForExternal({\n\t\t\t\t\t\telement: el,\n\t\t\t\t\t\tcanDrop: containsFiles,\n\t\t\t\t\t\tonDragEnter: () => setState('over'),\n\t\t\t\t\t\tonDragLeave: () => setState('potential'),\n\t\t\t\t\t\tonDrop: ({ source }) => {\n\t\t\t\t\t\t\tconst files: File[] = getFiles({ source });\n\t\t\t\t\t\t\tsetUploads((current) => [...files, ...current]);\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t\tmonitorForExternal({\n\t\t\t\t\t\tcanMonitor: containsFiles,\n\t\t\t\t\t\tonDragStart: () => {\n\t\t\t\t\t\t\tsetState('potential');\n\t\t\t\t\t\t\tpreventUnhandled.start();\n\t\t\t\t\t\t},\n\t\t\t\t\t\tonDrop: () => {\n\t\t\t\t\t\t\tpreventUnhandled.stop();\n\t\t\t\t\t\t\tsetState('idle');\n\t\t\t\t\t\t},\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t},\n\t\t\t(err) => {\n\t\t\t\tconsole.log('error', err);\n\t\t\t},\n\t\t);\n\n\t\treturn () => {\n\t\t\tdisposeResource();\n\t\t\tcleanupDragAndDrop?.();\n\t\t};\n\t});\n\treturn (\n\t\t<div css={appStyles}>\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tdata-testid=\"drop-target\"\n\t\t\t\tcss={[\n\t\t\t\t\tfileStyles,\n\t\t\t\t\tstate === 'over' ? overStyles : state === 'potential' ? potentialStyles : undefined,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t<strong>Drop some files on me! {state}</strong>\n\t\t\t</div>\n\t\t\t<FileList uploads={uploads} />\n\t\t</div>\n\t);\n}\n\nexport default function Example(): React.JSX.Element {\n\treturn (\n\t\t<Fragment>\n\t\t\t<GlobalStyles />\n\t\t\t<Uploader />\n\t\t</Fragment>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/drag-handle-button.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport {\n\tcreateContext,\n\ttype ReactNode,\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';\n// eslint-disable-next-line @atlaskit/design-system/no-banned-imports\nimport mergeRefs from '@atlaskit/ds-lib/merge-refs';\nimport {\n\tattachClosestEdge,\n\ttype Edge,\n\textractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { reorderWithEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/reorder-with-edge';\nimport { announce } from '@atlaskit/pragmatic-drag-and-drop-live-region';\nimport { DragHandleButton } from '@atlaskit/pragmatic-drag-and-drop-react-accessibility/drag-handle-button';\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\tmonitorForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';\n\nconst itemStyles = css({\n\tdisplay: 'flex',\n\tposition: 'relative',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':hover': { '--trigger-opacity': 1 },\n});\n\nfunction Item({\n\tchildren,\n\titem,\n\tposition,\n}: {\n\tchildren: ReactNode;\n\titem: ItemData;\n\tposition: 'first' | 'last' | 'middle' | 'only';\n}) {\n\tconst { reorderItem } = useContext(ExampleContext);\n\n\tconst elementRef = useRef<HTMLDivElement>(null);\n\tconst dragHandleRef = useRef<HTMLButtonElement>(null);\n\n\tconst [closestEdge, setClosestEdge] = useState<Edge | null>(null);\n\n\tuseEffect(() => {\n\t\tinvariant(elementRef.current);\n\t\tinvariant(dragHandleRef.current);\n\n\t\treturn combine(\n\t\t\tdraggable({\n\t\t\t\telement: elementRef.current,\n\t\t\t\tdragHandle: dragHandleRef.current,\n\t\t\t\tgetInitialData() {\n\t\t\t\t\treturn { item };\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement: elementRef.current,\n\t\t\t\tgetData({ input, source }) {\n\t\t\t\t\treturn attachClosestEdge(\n\t\t\t\t\t\t{ item },\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\telement: source.element,\n\t\t\t\t\t\t\tinput: input,\n\t\t\t\t\t\t\tallowedEdges: ['top', 'bottom'],\n\t\t\t\t\t\t},\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tonDrag({ self }) {\n\t\t\t\t\tsetClosestEdge(extractClosestEdge(self.data));\n\t\t\t\t},\n\t\t\t\tonDragLeave() {\n\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [item]);\n\n\tconst moveUp = useCallback(() => {\n\t\treorderItem({ item, direction: 'up' });\n\t}, [item, reorderItem]);\n\n\tconst moveDown = useCallback(() => {\n\t\treorderItem({ item, direction: 'down' });\n\t}, [item, reorderItem]);\n\n\tconst isFirstItem = position === 'first' || position === 'only';\n\tconst isLastItem = position === 'last' || position === 'only';\n\n\treturn (\n\t\t<div ref={elementRef} css={itemStyles}>\n\t\t\t<DropdownMenu\n\t\t\t\ttrigger={({ triggerRef, ...triggerProps }) => (\n\t\t\t\t\t<DragHandleButton\n\t\t\t\t\t\tref={mergeRefs([dragHandleRef, triggerRef])}\n\t\t\t\t\t\t{...triggerProps}\n\t\t\t\t\t\tlabel=\"Reorder\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\tshouldRenderToParent\n\t\t\t>\n\t\t\t\t<DropdownItemGroup>\n\t\t\t\t\t<DropdownItem onClick={moveUp} isDisabled={isFirstItem}>\n\t\t\t\t\t\tMove up\n\t\t\t\t\t</DropdownItem>\n\t\t\t\t\t<DropdownItem onClick={moveDown} isDisabled={isLastItem}>\n\t\t\t\t\t\tMove down\n\t\t\t\t\t</DropdownItem>\n\t\t\t\t</DropdownItemGroup>\n\t\t\t</DropdownMenu>\n\t\t\t<span>{children}</span>\n\t\t\t{closestEdge && <DropIndicator edge={closestEdge} />}\n\t\t</div>\n\t);\n}\n\ntype ItemData = { label: string };\n\nconst initialData: ItemData[] = [{ label: 'Apple' }, { label: 'Banana' }, { label: 'Carrot' }];\n\ntype ReorderItem = (args: { item: ItemData; direction: 'up' | 'down' }) => void;\n\ntype ExampleContextProps = {\n\treorderItem: ReorderItem;\n};\n\nconst ExampleContext = createContext<ExampleContextProps>({\n\treorderItem: () => {},\n});\n\nfunction getItemPosition({ index, itemCount }: { index: number; itemCount: number }) {\n\tif (itemCount === 1) {\n\t\treturn 'only';\n\t}\n\n\tif (index === 0) {\n\t\treturn 'first';\n\t}\n\n\tif (index === itemCount - 1) {\n\t\treturn 'last';\n\t}\n\n\treturn 'middle';\n}\n\nconst exampleContainerStyles = css({\n\tmaxWidth: 240,\n});\n\nexport default function DragHandleButtonExample(): React.JSX.Element {\n\tconst [data, setData] = useState(initialData);\n\n\tconst reorderItem: ReorderItem = useCallback(\n\t\t({ direction, item }) => {\n\t\t\tconst startIndex = data.indexOf(item);\n\t\t\tconst finishIndex = direction === 'up' ? startIndex - 1 : startIndex + 1;\n\t\t\tconst newData = reorder({ list: data, startIndex, finishIndex });\n\n\t\t\tsetData(newData);\n\n\t\t\tannounce(\n\t\t\t\t`You've moved ${item.label} from position ${\n\t\t\t\t\tstartIndex + 1\n\t\t\t\t} to position ${finishIndex + 1} of ${data.length}`,\n\t\t\t);\n\t\t},\n\t\t[data],\n\t);\n\n\tuseEffect(() => {\n\t\treturn monitorForElements({\n\t\t\tonDrop({ location, source }) {\n\t\t\t\tconst target = location.current.dropTargets[0];\n\t\t\t\tif (!target) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst sourceItem = source.data.item;\n\t\t\t\tconst targetItem = target.data.item;\n\t\t\t\tconst closestEdgeOfTarget = extractClosestEdge(target.data);\n\n\t\t\t\tconst startIndex = data.indexOf(sourceItem as ItemData);\n\t\t\t\tconst indexOfTarget = data.indexOf(targetItem as ItemData);\n\n\t\t\t\tif (startIndex < 0 || indexOfTarget < 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tsetData((data) => {\n\t\t\t\t\treturn reorderWithEdge({\n\t\t\t\t\t\tlist: data,\n\t\t\t\t\t\tstartIndex,\n\t\t\t\t\t\tindexOfTarget,\n\t\t\t\t\t\tclosestEdgeOfTarget,\n\t\t\t\t\t\taxis: 'vertical',\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\t}, [data]);\n\n\treturn (\n\t\t<ExampleContext.Provider value={{ reorderItem }}>\n\t\t\t<div css={exampleContainerStyles}>\n\t\t\t\t{data.map((item, index) => (\n\t\t\t\t\t<Item\n\t\t\t\t\t\tkey={item.label}\n\t\t\t\t\t\titem={item}\n\t\t\t\t\t\tposition={getItemPosition({ index, itemCount: data.length })}\n\t\t\t\t\t>\n\t\t\t\t\t\t{item.label}\n\t\t\t\t\t</Item>\n\t\t\t\t))}\n\t\t\t</div>\n\t\t</ExampleContext.Provider>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/drag-handles.tsx",
    "content": "import { AllDragHandleVariants } from './guidelines/all-drag-handle-variants';\n\nexport default AllDragHandleVariants;\n"
  },
  {
    "path": "packages/documentation/examples/drawing.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { useCallback, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport { bind } from 'bind-event-listener';\nimport invariant from 'tiny-invariant';\n\nimport Button from '@atlaskit/button/new';\nimport FocusRing from '@atlaskit/focus-ring';\nimport CheckIcon from '@atlaskit/icon/core/check-mark';\nimport TrashIcon from '@atlaskit/icon/core/delete';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { disableNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview';\nimport { preventUnhandled } from '@atlaskit/pragmatic-drag-and-drop/prevent-unhandled';\nimport { Inline } from '@atlaskit/primitives/compiled';\nimport { token } from '@atlaskit/tokens';\n\nconst containerStyles = css({\n\tboxShadow: token(\n\t\t'elevation.shadow.raised',\n\t\t'0px 1px 1px rgba(9, 30, 66, 0.25),0px 0px 1px rgba(9, 30, 66, 0.31)',\n\t),\n\tborderRadius: token('radius.small', '4px'),\n\toverflow: 'hidden',\n\tdisplay: 'flex',\n\theight: 400,\n\tposition: 'relative',\n\tbackground: token('elevation.surface.raised', '#FFF'),\n});\n\nconst sidebarStyles = css({\n\tbackground: token('elevation.surface.overlay', '#FFF'),\n\tdisplay: 'flex',\n\tpadding: 16,\n\tgap: 16,\n\tposition: 'absolute',\n\tbottom: 24,\n\tboxShadow: token(\n\t\t'elevation.shadow.overlay',\n\t\t'0px 8px 12px rgba(9, 30, 66, 0.15),0px 0px 1px rgba(9, 30, 66, 0.31)',\n\t),\n\tborderRadius: 4,\n\tleft: '50%',\n\ttransform: 'translateX(-50%)',\n\tboxSizing: 'border-box',\n\twidth: 'max-content',\n});\n\nconst swatchBaseStyles = css({\n\tboxSizing: 'border-box',\n\tborder: `${token('border.width.selected')} solid ${token('color.border', 'rgba(9, 30, 66, 0.14)')}`,\n\twidth: 32,\n\theight: 32,\n\tborderRadius: token('radius.full'),\n\tcursor: 'pointer',\n\tcolor: token('color.text.inverse', '#FFF'),\n\tdisplay: 'flex',\n\talignItems: 'center',\n\tjustifyContent: 'center',\n});\n\nconst swatchColorMap = {\n\tred: token('color.background.accent.red.subtle', '#F87462'),\n\torange: token('color.background.accent.orange.subtle', '#FAA53D'),\n\tyellow: token('color.background.accent.yellow.subtle', '#E2B203'),\n\tgreen: token('color.background.accent.green.subtle', '#4BCE97'),\n\tteal: token('color.background.accent.teal.subtle', '#60C6D2'),\n\tblue: token('color.background.accent.blue.subtle', '#579DFF'),\n\tpurple: token('color.background.accent.purple.subtle', '#9F8FEF'),\n\tmagenta: token('color.background.accent.magenta.subtle', '#E774BB'),\n};\n\ntype SwatchColor = keyof typeof swatchColorMap;\n\nfunction Swatch({\n\tcolor,\n\tisSelected = false,\n\tonSelect: onSelectProp,\n}: {\n\tcolor: SwatchColor;\n\tisSelected?: boolean;\n\tonSelect: (color: SwatchColor) => void;\n}) {\n\tconst onSelect = useCallback(() => {\n\t\tonSelectProp(color);\n\t}, [color, onSelectProp]);\n\n\treturn (\n\t\t<FocusRing>\n\t\t\t<button\n\t\t\t\tcss={swatchBaseStyles}\n\t\t\t\tonClick={onSelect}\n\t\t\t\tstyle={{ backgroundColor: swatchColorMap[color] }}\n\t\t\t>\n\t\t\t\t{isSelected && <CheckIcon color=\"currentColor\" label=\"\" spacing=\"spacious\" />}\n\t\t\t</button>\n\t\t</FocusRing>\n\t);\n}\n\nconst canvasStyles = css({\n\twidth: '100%',\n\theight: '100%',\n});\n\nconst dividerStyles = css({\n\twidth: 1,\n\theight: token('space.400', '32px'),\n\tbackground: token('color.border', '#091E4224'),\n\tdisplay: 'flex',\n});\n\nexport default function DrawingExample(): React.JSX.Element {\n\tconst canvasRef = useRef<HTMLCanvasElement>(null);\n\n\tuseEffect(() => {\n\t\tconst canvas = canvasRef.current;\n\t\tinvariant(canvas);\n\n\t\tconst ctx = canvas.getContext('2d');\n\t\tinvariant(ctx);\n\n\t\t/**\n\t\t * A resize observer is used to keep the canvas dimensions in sync with\n\t\t * its visual dimensions.\n\t\t *\n\t\t * The canvas dimensions (`canvas.width` and `canvas.height`) determine\n\t\t * how large the drawable area of the canvas is. The image on the canvas\n\t\t * will be stretched to fit its visual size, which is determined by CSS.\n\t\t *\n\t\t * A (useful) side effect of this resize observer is that the canvas will\n\t\t * be cleared when the browser is resized. This is because setting the\n\t\t * canvas dimensions (`canvas.width` and `canvas.height`) clears the canvas.\n\t\t */\n\t\tconst resizeObserver = new ResizeObserver((entries) => {\n\t\t\tfor (const { borderBoxSize } of entries) {\n\t\t\t\tif (!borderBoxSize) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst [{ inlineSize, blockSize }] = borderBoxSize;\n\n\t\t\t\t/**\n\t\t\t\t * Saves the dynamic parts of the canvas context (brush color).\n\t\t\t\t *\n\t\t\t\t * This is required because resizing the canvas will clear the context\n\t\t\t\t * in addition to clearing the drawing.\n\t\t\t\t */\n\t\t\t\tconst { strokeStyle, shadowColor } = ctx;\n\n\t\t\t\tcanvas.width = inlineSize;\n\t\t\t\tcanvas.height = blockSize;\n\n\t\t\t\t/**\n\t\t\t\t * Reapplies the canvas context.\n\t\t\t\t */\n\t\t\t\tObject.assign(ctx, {\n\t\t\t\t\tstrokeStyle,\n\t\t\t\t\tshadowColor,\n\t\t\t\t\tlineCap: 'round',\n\t\t\t\t\tlineJoin: 'round',\n\t\t\t\t\tlineWidth: 12,\n\t\t\t\t\tshadowOffsetX: 0,\n\t\t\t\t\tshadowOffsetY: 0,\n\t\t\t\t\tshadowBlur: 2,\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tresizeObserver.observe(canvas);\n\n\t\treturn () => {\n\t\t\tresizeObserver.disconnect();\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tconst canvas = canvasRef.current;\n\t\tinvariant(canvas);\n\n\t\tconst ctx = canvas.getContext('2d');\n\t\tinvariant(ctx);\n\n\t\tlet prevPoint: { x: number; y: number } | null = null;\n\n\t\treturn combine(\n\t\t\tbind(canvas, {\n\t\t\t\ttype: 'pointerdown',\n\t\t\t\tlistener(event) {\n\t\t\t\t\tconst { clientX, clientY } = event;\n\t\t\t\t\tconst rect = canvas.getBoundingClientRect();\n\n\t\t\t\t\tctx.beginPath();\n\t\t\t\t\tctx.lineTo(clientX - rect.x, clientY - rect.y);\n\t\t\t\t\tctx.stroke();\n\t\t\t\t\tctx.closePath();\n\n\t\t\t\t\tprevPoint = { x: clientX, y: clientY };\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdraggable({\n\t\t\t\telement: canvas,\n\t\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\t\tdisableNativeDragPreview({ nativeSetDragImage });\n\t\t\t\t},\n\t\t\t\tonDragStart() {\n\t\t\t\t\tpreventUnhandled.start();\n\t\t\t\t},\n\t\t\t\tonDrag({ location }) {\n\t\t\t\t\tconst { clientX, clientY } = location.current.input;\n\t\t\t\t\tconst rect = canvas.getBoundingClientRect();\n\n\t\t\t\t\tinvariant(prevPoint);\n\t\t\t\t\tconst { x, y } = prevPoint;\n\n\t\t\t\t\tctx.beginPath();\n\t\t\t\t\tctx.moveTo(x - rect.x, y - rect.y);\n\t\t\t\t\tctx.lineTo(clientX - rect.x, clientY - rect.y);\n\t\t\t\t\tctx.stroke();\n\n\t\t\t\t\tprevPoint = { x: clientX, y: clientY };\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tpreventUnhandled.stop();\n\n\t\t\t\t\tctx.closePath();\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, []);\n\n\tconst [selectedColor, setSelectedColor] = useState<SwatchColor>('red');\n\n\tuseEffect(() => {\n\t\tconst canvas = canvasRef.current;\n\t\tinvariant(canvas);\n\n\t\tconst ctx = canvas.getContext('2d');\n\t\tinvariant(ctx);\n\n\t\tconst color = getComputedStyle(canvas).getPropertyValue('color');\n\n\t\tctx.strokeStyle = color;\n\t\tctx.shadowColor = color;\n\t}, [selectedColor]);\n\n\tconst clearCanvas = useCallback(() => {\n\t\tconst canvas = canvasRef.current;\n\t\tinvariant(canvas);\n\n\t\tconst ctx = canvas.getContext('2d');\n\t\tinvariant(ctx);\n\n\t\tctx.clearRect(0, 0, canvas.width, canvas.height);\n\t}, []);\n\n\treturn (\n\t\t<div css={containerStyles}>\n\t\t\t<div css={sidebarStyles}>\n\t\t\t\t<Inline space=\"space.100\">\n\t\t\t\t\t{(Object.keys(swatchColorMap) as SwatchColor[]).map((color) => (\n\t\t\t\t\t\t<Swatch\n\t\t\t\t\t\t\tkey={color}\n\t\t\t\t\t\t\tcolor={color}\n\t\t\t\t\t\t\tisSelected={color === selectedColor}\n\t\t\t\t\t\t\tonSelect={setSelectedColor}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</Inline>\n\t\t\t\t<div css={dividerStyles} />\n\t\t\t\t<Button appearance=\"danger\" iconBefore={TrashIcon} onClick={clearCanvas}>\n\t\t\t\t\tReset\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t\t<canvas\n\t\t\t\tref={canvasRef}\n\t\t\t\tcss={canvasStyles}\n\t\t\t\twidth=\"800\"\n\t\t\t\theight=\"400\"\n\t\t\t\tstyle={{ color: swatchColorMap[selectedColor] }}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/file-drop-without-pragmatic.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport React, { type DragEventHandler, Fragment, useCallback, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport Badge from '@atlaskit/badge';\nimport { token } from '@atlaskit/tokens';\n\nconst itemInfoStyles = css({\n\tdisplay: 'grid',\n\twidth: '-webkit-fill-available',\n\tpadding: 24,\n\tgap: 8,\n\tbackground: token('elevation.surface.sunken', '#F7F8F9'),\n\tborderRadius: 4,\n});\n\nconst ItemInfo = ({ kind, type, file }: { kind: string; type: string; file: File | null }) => {\n\treturn (\n\t\t<div css={itemInfoStyles}>\n\t\t\t<div>kind = {kind}</div>\n\t\t\t<div>type = {type}</div>\n\t\t\t{file !== null && (\n\t\t\t\t<Fragment>\n\t\t\t\t\t<div>name = {file.name}</div>\n\t\t\t\t</Fragment>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n\nconst fileDropZoneStyles = css({\n\tdisplay: 'flex',\n\twidth: 300,\n\tpadding: 24,\n\talignItems: 'flex-start',\n\tgap: 16,\n\tflexDirection: 'column',\n\tbackground: token('elevation.surface', '#FFF'),\n\tborder: `${token('border.width.selected')} solid ${token('color.border', '#091E4224')}`,\n\tborderRadius: 6,\n});\n\nconst FileDropZone = () => {\n\tconst [items, setItems] = useState<DataTransferItem[]>([]);\n\n\tconst onDragOver: DragEventHandler<HTMLDivElement> = useCallback((event) => {\n\t\tevent.preventDefault();\n\t}, []);\n\n\tconst onDrop: DragEventHandler<HTMLDivElement> = useCallback((event) => {\n\t\tevent.preventDefault();\n\t\tsetItems(Array.from(event.dataTransfer.items));\n\t}, []);\n\n\treturn (\n\t\t<div onDragOver={onDragOver} onDrop={onDrop} data-testid=\"drop-zone\" css={fileDropZoneStyles}>\n\t\t\t<p>\n\t\t\t\t<Badge appearance=\"primary\">{items.length}</Badge> items dropped.\n\t\t\t</p>\n\t\t\t{items.map((item, index) => (\n\t\t\t\t<ItemInfo key={index} kind={item.kind} type={item.type} file={item.getAsFile()} />\n\t\t\t))}\n\t\t</div>\n\t);\n};\n\nconst layoutStyles = css({\n\tdisplay: 'grid',\n\tpaddingTop: 48,\n\tplaceItems: 'center',\n});\n\nexport default function Example(): React.JSX.Element {\n\treturn (\n\t\t<div css={layoutStyles}>\n\t\t\t<FileDropZone />\n\t\t</div>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/file.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { Fragment, memo, useCallback, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport { bind } from 'bind-event-listener';\nimport invariant from 'tiny-invariant';\n\nimport Button from '@atlaskit/button/new';\nimport ImageIcon from '@atlaskit/icon/core/image';\nimport { easeInOut } from '@atlaskit/motion/curves';\nimport { durations } from '@atlaskit/motion/durations';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdropTargetForExternal,\n\tmonitorForExternal,\n} from '@atlaskit/pragmatic-drag-and-drop/external/adapter';\nimport { containsFiles, getFiles } from '@atlaskit/pragmatic-drag-and-drop/external/file';\nimport { preventUnhandled } from '@atlaskit/pragmatic-drag-and-drop/prevent-unhandled';\nimport { token } from '@atlaskit/tokens';\n\nimport { GlobalStyles } from './util/global-styles';\n\nconst galleryStyles = css({\n\tdisplay: 'flex',\n\twidth: '70vw',\n\talignItems: 'center',\n\tjustifyContent: 'center',\n\tgap: 'var(--grid)',\n\tflexWrap: 'wrap',\n});\nconst imageStyles = css({\n\tdisplay: 'block',\n\t// borrowing values from pinterest\n\t// ratio: 0.6378378378\n\twidth: '216px',\n\theight: '340px',\n\tobjectFit: 'cover',\n});\nconst uploadStyles = css({\n\t// overflow: 'hidden',\n\tposition: 'relative',\n\t// using these to hide the details\n\tborderRadius: 'calc(var(--grid) * 2)',\n\toverflow: 'hidden',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values\n\ttransition: `opacity ${durations.large}ms ${easeInOut}, filter ${durations.large}ms ${easeInOut}`,\n});\nconst loadingStyles = css({\n\topacity: '0',\n\tfilter: 'blur(1.5rem)',\n});\nconst readyStyles = css({\n\topacity: '1',\n\tfilter: 'blur(0)',\n});\n\nconst uploadDetailStyles = css({\n\tdisplay: 'flex',\n\tboxSizing: 'border-box',\n\twidth: '100%',\n\tpadding: 'var(--grid)',\n\tposition: 'absolute',\n\tbottom: 0,\n\tgap: 'var(--grid)',\n\tflexDirection: 'row',\n\t// background: token('color.background.sunken', fallbackColor),\n\tbackgroundColor: 'rgba(255,255,255,0.5)',\n});\n\nconst uploadFilenameStyles = css({\n\tflexGrow: '1',\n\toverflow: 'hidden',\n\ttextOverflow: 'ellipsis',\n\twhiteSpace: 'nowrap',\n});\n\ntype UserUpload = {\n\ttype: 'image';\n\tdataUrl: string;\n\tname: string;\n\tsize: number;\n};\n\nconst Upload = memo(function Upload({ upload }: { upload: UserUpload }) {\n\tconst [state, setState] = useState<'loading' | 'ready'>('loading');\n\tconst clearTimeout = useRef<() => void>(() => {});\n\n\tuseEffect(function mount() {\n\t\treturn function unmount() {\n\t\t\tclearTimeout.current();\n\t\t};\n\t}, []);\n\n\treturn (\n\t\t<div css={[uploadStyles, state === 'loading' ? loadingStyles : readyStyles]}>\n\t\t\t{/* eslint-disable-next-line @atlassian/a11y/alt-text */}\n\t\t\t<img\n\t\t\t\tsrc={upload.dataUrl}\n\t\t\t\tcss={imageStyles}\n\t\t\t\tonLoad={() => {\n\t\t\t\t\t// this is the _only_ way I could find to get the animation to run\n\t\t\t\t\t// correctly every time in all browsers\n\t\t\t\t\t// setTimeout(fn, 0) -> sometimes wouldn't work in chrome (event nesting two)\n\t\t\t\t\t// requestAnimationFrame -> nope (event nesting two)\n\t\t\t\t\t// requestIdleCallback -> nope (doesn't work in safari)\n\t\t\t\t\t// I can find no reliable hook for applying the `ready` state,\n\t\t\t\t\t// this is the best I could manage 😩\n\t\t\t\t\tconst timerId = setTimeout(() => setState('ready'), 100);\n\t\t\t\t\tclearTimeout.current = () => window.clearTimeout(timerId);\n\t\t\t\t}}\n\t\t\t/>\n\t\t\t<div css={uploadDetailStyles}>\n\t\t\t\t<em css={uploadFilenameStyles}>{upload.name}</em>\n\t\t\t\t{/* eslint-disable-next-line @atlaskit/design-system/no-html-code */}\n\t\t\t\t<code>{Math.round(upload.size / 1000)}kB</code>\n\t\t\t</div>\n\t\t</div>\n\t);\n});\n\nconst Gallery = memo(function Gallery({ uploads: uploads }: { uploads: UserUpload[] }) {\n\tif (!uploads.length) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div css={galleryStyles}>\n\t\t\t{uploads.map((upload, index) => (\n\t\t\t\t<Upload upload={upload} key={index} />\n\t\t\t))}\n\t\t</div>\n\t);\n});\n\nconst fileStyles = css({\n\tdisplay: 'flex',\n\tflexDirection: 'column',\n\tpadding: 'calc(var(--grid) * 6) calc(var(--grid) * 4)',\n\tboxSizing: 'border-box',\n\talignItems: 'center',\n\tjustifyContent: 'center',\n\tbackground: token('elevation.surface.sunken', '#091E4208'),\n\tborderRadius: 'var(--border-radius)',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values\n\ttransition: `all ${durations.medium}ms ${easeInOut}`,\n\tborder: `${token('border.width.selected')} dashed transparent`,\n\twidth: '100%',\n\tgap: token('space.300', '24px'),\n});\n\nconst textStyles = css({\n\tcolor: token('color.text.disabled', '#091E424F'),\n\tfontSize: '1.4rem',\n\tdisplay: 'flex',\n\talignItems: 'center',\n\tgap: token('space.075'),\n});\n\nconst overStyles = css({\n\tbackground: token('color.background.selected.hovered', '#CCE0FF'),\n\tcolor: token('color.text.selected', '#0C66E4'),\n\tborderColor: token('color.border.brand', '#0C66E4'),\n});\n\nconst potentialStyles = css({\n\tborderColor: token('color.border.brand', '#0C66E4'),\n});\n\nconst appStyles = css({\n\tdisplay: 'flex',\n\talignItems: 'center',\n\tgap: 'calc(var(--grid) * 2)',\n\tflexDirection: 'column',\n});\n\nconst displayNoneStyles = css({ display: 'none' });\n\nfunction Uploader() {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<'idle' | 'potential' | 'over'>('idle');\n\tconst [uploads, setUploads] = useState<UserUpload[]>([]);\n\n\t/**\n\t * Creating a stable reference so that we can use it in our unmount effect.\n\t *\n\t * If we used uploads as a dependency in the second `useEffect` it would run\n\t * every time the uploads changed, which is not desirable.\n\t */\n\tconst stableUploadsRef = useRef<UserUpload[]>(uploads);\n\tuseEffect(() => {\n\t\tstableUploadsRef.current = uploads;\n\t}, [uploads]);\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\t/**\n\t\t\t * MDN recommends explicitly releasing the object URLs when possible,\n\t\t\t * instead of relying just on the browser's garbage collection.\n\t\t\t */\n\t\t\tstableUploadsRef.current.forEach((upload) => {\n\t\t\t\tURL.revokeObjectURL(upload.dataUrl);\n\t\t\t});\n\t\t};\n\t}, []);\n\n\tconst addUpload = useCallback((file: File | null) => {\n\t\tif (!file) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (!file.type.startsWith('image/')) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst upload: UserUpload = {\n\t\t\ttype: 'image',\n\t\t\tdataUrl: URL.createObjectURL(file),\n\t\t\tname: file.name,\n\t\t\tsize: file.size,\n\t\t};\n\t\tsetUploads((current) => [...current, upload]);\n\t}, []);\n\n\tconst onFileInputChange = useCallback(\n\t\t(event: React.ChangeEvent<HTMLInputElement>) => {\n\t\t\tconst files = Array.from(event.currentTarget.files ?? []);\n\t\t\tfiles.forEach(addUpload);\n\t\t},\n\t\t[addUpload],\n\t);\n\n\tuseEffect(() => {\n\t\tconst el = ref.current;\n\t\tinvariant(el);\n\t\treturn combine(\n\t\t\tdropTargetForExternal({\n\t\t\t\telement: el,\n\t\t\t\tcanDrop: containsFiles,\n\t\t\t\tonDragEnter: () => setState('over'),\n\t\t\t\tonDragLeave: () => setState('potential'),\n\t\t\t\tonDrop: async ({ source }) => {\n\t\t\t\t\tconst files = await getFiles({ source });\n\n\t\t\t\t\tfiles.forEach((file) => {\n\t\t\t\t\t\tif (file == null) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!file.type.startsWith('image/')) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconst reader = new FileReader();\n\t\t\t\t\t\treader.readAsDataURL(file);\n\n\t\t\t\t\t\t// for simplicity:\n\t\t\t\t\t\t// - not handling errors\n\t\t\t\t\t\t// - not aborting the\n\t\t\t\t\t\t// - not unbinding the event listener when the effect is removed\n\t\t\t\t\t\tbind(reader, {\n\t\t\t\t\t\t\ttype: 'load',\n\t\t\t\t\t\t\tlistener(event) {\n\t\t\t\t\t\t\t\tconst result = reader.result;\n\t\t\t\t\t\t\t\tif (typeof result === 'string') {\n\t\t\t\t\t\t\t\t\tconst upload: UserUpload = {\n\t\t\t\t\t\t\t\t\t\ttype: 'image',\n\t\t\t\t\t\t\t\t\t\tdataUrl: result,\n\t\t\t\t\t\t\t\t\t\tname: file.name,\n\t\t\t\t\t\t\t\t\t\tsize: file.size,\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\tsetUploads((current) => [...current, upload]);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t}),\n\t\t\tmonitorForExternal({\n\t\t\t\tcanMonitor: containsFiles,\n\t\t\t\tonDragStart: () => {\n\t\t\t\t\tsetState('potential');\n\t\t\t\t\tpreventUnhandled.start();\n\t\t\t\t},\n\t\t\t\tonDrop: () => {\n\t\t\t\t\tsetState('idle');\n\t\t\t\t\tpreventUnhandled.stop();\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t});\n\n\t/**\n\t * We trigger the file input manually when clicking the button. This also\n\t * works when selecting the button using a keyboard.\n\t *\n\t * We do this for two reasons:\n\t *\n\t * 1. Styling file inputs is very limited.\n\t * 2. Associating the button as a label for the input only gives us pointer\n\t *    support, but does not work for keyboard.\n\t */\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\tconst onInputTriggerClick = useCallback(() => {\n\t\tinputRef.current?.click();\n\t}, []);\n\n\treturn (\n\t\t<div css={appStyles}>\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tdata-testid=\"drop-target\"\n\t\t\t\tcss={[\n\t\t\t\t\tfileStyles,\n\t\t\t\t\tstate === 'over' ? overStyles : state === 'potential' ? potentialStyles : undefined,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t<strong css={textStyles}>\n\t\t\t\t\tDrop some images on me! <ImageIcon color=\"currentColor\" spacing=\"spacious\" label=\"\" />\n\t\t\t\t</strong>\n\n\t\t\t\t<Button onClick={onInputTriggerClick}>Select images</Button>\n\n\t\t\t\t<input\n\t\t\t\t\tref={inputRef}\n\t\t\t\t\tcss={displayNoneStyles}\n\t\t\t\t\tid=\"file-input\"\n\t\t\t\t\tonChange={onFileInputChange}\n\t\t\t\t\ttype=\"file\"\n\t\t\t\t\taccept=\"image/*\"\n\t\t\t\t\tmultiple\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<Gallery uploads={uploads} />\n\t\t</div>\n\t);\n}\n\nexport default function Example(): React.JSX.Element {\n\treturn (\n\t\t<Fragment>\n\t\t\t<GlobalStyles />\n\t\t\t<Uploader />\n\t\t</Fragment>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/flash-prototype.tsx",
    "content": "import React, { type ReactNode, useCallback, useState } from 'react';\n\nimport invariant from 'tiny-invariant';\n\nimport { Code } from '@atlaskit/code';\nimport Lozenge from '@atlaskit/lozenge';\nimport { type Durations, durations, easeIn, easeInOut, easeOut } from '@atlaskit/motion';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Inline, Stack, xcss } from '@atlaskit/primitives';\nimport { RadioGroup } from '@atlaskit/radio';\nimport { type OptionsPropType } from '@atlaskit/radio/types';\nimport { token } from '@atlaskit/tokens';\n\nimport List from './pieces/post-drop-flash/list';\n\nfunction isDurationKey(value: unknown): value is Durations {\n\treturn typeof value === 'string' && durations.hasOwnProperty(value);\n}\n\nconst easingMap = {\n\teaseIn,\n\teaseInOut,\n\teaseOut,\n\tlinear: 'linear',\n\tbrowserDefault: 'ease',\n};\n\nfunction isEasingKey(value: unknown): value is keyof typeof easingMap {\n\treturn typeof value === 'string' && easingMap.hasOwnProperty(value);\n}\n\nconst layoutStyles = xcss({\n\tjustifyContent: 'center',\n\tgap: 'space.400',\n\tpadding: 'space.400',\n});\n\nexport default function PostDropFlashPrototype(): React.JSX.Element {\n\tconst [params, setParams] = useState<{\n\t\tduration: Durations;\n\t\teasing: keyof typeof easingMap;\n\t}>({\n\t\tduration: 'small',\n\t\teasing: 'easeInOut',\n\t});\n\n\tconst triggerPostMoveFlash = useCallback(\n\t\t(element: HTMLElement) => {\n\t\t\telement.animate(\n\t\t\t\t[\n\t\t\t\t\t{\n\t\t\t\t\t\tbackgroundColor: token('color.background.selected', 'transparent'),\n\t\t\t\t\t},\n\t\t\t\t\t{},\n\t\t\t\t],\n\t\t\t\t{\n\t\t\t\t\tduration: durations[params.duration],\n\t\t\t\t\teasing: easingMap[params.easing],\n\t\t\t\t\titerations: 1,\n\t\t\t\t},\n\t\t\t);\n\t\t},\n\t\t[params],\n\t);\n\n\tconst onChange = useCallback((event: React.FormEvent<HTMLFormElement>) => {\n\t\tconst form = event.currentTarget;\n\t\tconst formData = new FormData(form);\n\n\t\tconst { duration, easing } = Object.fromEntries(formData.entries());\n\n\t\tinvariant(isDurationKey(duration));\n\t\tinvariant(isEasingKey(easing));\n\n\t\tsetParams({ duration, easing });\n\t}, []);\n\n\treturn (\n\t\t<Inline xcss={layoutStyles}>\n\t\t\t<List triggerPostMoveFlash={triggerPostMoveFlash} />\n\t\t\t<FlashParameterForm onChange={onChange} />\n\t\t</Inline>\n\t);\n}\n\nfunction OptionLabel({ children, description }: { children: ReactNode; description?: ReactNode }) {\n\treturn (\n\t\t<Stack space=\"space.050\">\n\t\t\t<Inline alignBlock=\"center\" space=\"space.100\">\n\t\t\t\t{children}\n\t\t\t</Inline>\n\t\t\t{/* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 */}\n\t\t\t{description && <small style={{ margin: 0 }}>{description}</small>}\n\t\t</Stack>\n\t);\n}\n\nconst durationOptions: OptionsPropType = [\n\t{\n\t\tname: 'duration',\n\t\tvalue: 'small',\n\t\tlabel: <OptionLabel description={<>Equal to 100ms</>}>Small</OptionLabel>,\n\t},\n\t{\n\t\tname: 'duration',\n\t\tvalue: 'medium',\n\t\tlabel: <OptionLabel description={<>Equal to 350ms</>}>Medium</OptionLabel>,\n\t},\n\t{\n\t\tname: 'duration',\n\t\tvalue: 'large',\n\t\tlabel: (\n\t\t\t<OptionLabel description={<>Equal to 700ms</>}>\n\t\t\t\t<span>Large</span>\n\t\t\t\t<Lozenge appearance=\"inprogress\">Current</Lozenge>\n\t\t\t</OptionLabel>\n\t\t),\n\t},\n];\n\nconst easingOptions: OptionsPropType = [\n\t{\n\t\tname: 'easing',\n\t\tvalue: 'easeInOut',\n\t\tlabel: (\n\t\t\t<OptionLabel\n\t\t\t\tdescription={\n\t\t\t\t\t<>\n\t\t\t\t\t\tEqual to <Code>cubic-bezier(0.15, 1, 0.3, 1)</Code>\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t>\n\t\t\t\teaseInOut\n\t\t\t</OptionLabel>\n\t\t),\n\t},\n\t{\n\t\tname: 'easing',\n\t\tvalue: 'easeIn',\n\t\tlabel: (\n\t\t\t<OptionLabel\n\t\t\t\tdescription={\n\t\t\t\t\t<>\n\t\t\t\t\t\tEqual to <Code>cubic-bezier(0.8, 0, 0, 0.8)</Code>\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t>\n\t\t\t\teaseIn\n\t\t\t</OptionLabel>\n\t\t),\n\t},\n\t{\n\t\tname: 'easing',\n\t\tvalue: 'easeOut',\n\t\tlabel: (\n\t\t\t<OptionLabel\n\t\t\t\tdescription={\n\t\t\t\t\t<>\n\t\t\t\t\t\tEqual to <Code>cubic-bezier(0.2, 0, 0, 1)</Code>\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t>\n\t\t\t\teaseOut\n\t\t\t</OptionLabel>\n\t\t),\n\t},\n\t{\n\t\tname: 'easing',\n\t\tvalue: 'linear',\n\t\tlabel: (\n\t\t\t<OptionLabel\n\t\t\t\tdescription={\n\t\t\t\t\t<>\n\t\t\t\t\t\tEqual to <Code>cubic-bezier(0.0, 0.0, 1.0, 1.0)</Code>\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<span>Linear</span>\n\t\t\t\t<Lozenge appearance=\"removed\">Not @atlaskit/motion</Lozenge>\n\t\t\t</OptionLabel>\n\t\t),\n\t},\n\t{\n\t\tname: 'easing',\n\t\tvalue: 'browserDefault',\n\t\tlabel: (\n\t\t\t<OptionLabel\n\t\t\t\tdescription={\n\t\t\t\t\t<>\n\t\t\t\t\t\tEqual to <Code>cubic-bezier(0.25, 0.1, 0.25, 1.0)</Code>\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t>\n\t\t\t\t<span>Browser default</span>\n\t\t\t\t<Lozenge appearance=\"inprogress\">Current</Lozenge>\n\t\t\t\t<Lozenge appearance=\"removed\">Not @atlaskit/motion</Lozenge>\n\t\t\t</OptionLabel>\n\t\t),\n\t},\n];\n\nfunction FlashParameterForm({ onChange }: { onChange: React.FormEventHandler<HTMLFormElement> }) {\n\treturn (\n\t\t<form onChange={onChange}>\n\t\t\t<Stack>\n\t\t\t\t<Stack>\n\t\t\t\t\t<strong id=\"duration-label\">Duration</strong>\n\t\t\t\t\t<RadioGroup\n\t\t\t\t\t\toptions={durationOptions}\n\t\t\t\t\t\tlabelId=\"duration-label\"\n\t\t\t\t\t\tdefaultValue={durationOptions[0].value}\n\t\t\t\t\t/>\n\t\t\t\t</Stack>\n\t\t\t\t<Stack>\n\t\t\t\t\t<strong id=\"easing-label\">Easing</strong>\n\t\t\t\t\t<RadioGroup\n\t\t\t\t\t\toptions={easingOptions}\n\t\t\t\t\t\tlabelId=\"easing-label\"\n\t\t\t\t\t\tdefaultValue={easingOptions[0].value}\n\t\t\t\t\t/>\n\t\t\t\t</Stack>\n\t\t\t</Stack>\n\t\t</form>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/grid.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { createContext, memo, useContext, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx, type SerializedStyles } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport { easeInOut } from '@atlaskit/motion/curves';\nimport { durations } from '@atlaskit/motion/durations';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\tmonitorForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { token } from '@atlaskit/tokens';\n\nimport battery from './icons/battery.png';\nimport drill from './icons/drill.png';\nimport koala from './icons/koala.png';\nimport ui from './icons/ui.png';\nimport wallet from './icons/wallet.png';\nimport yeti from './icons/yeti.png';\nimport { GlobalStyles } from './util/global-styles';\n\nfunction getInstanceId() {\n\treturn Symbol('instance-id');\n}\n\nconst InstanceIdContext = createContext<symbol | null>(null);\n\nconst itemStyles = css({\n\tobjectFit: 'cover',\n\twidth: '100%',\n\tboxSizing: 'border-box',\n\tbackground: token('elevation.surface.raised', '#FFF'),\n\tpadding: token('space.050', '4px'),\n\tborderRadius: token('radius.small', '4px'),\n\tboxShadow: token('elevation.shadow.raised', 'none'),\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values\n\ttransition: `all ${durations.small}ms ${easeInOut}`,\n\t'-webkit-touch-callout': 'none', // needed to avoid a \"save image\" popup on iOS\n});\n\ntype State = 'idle' | 'dragging' | 'over';\n\nconst itemStateStyles: { [Key in State]: undefined | SerializedStyles } = {\n\tidle: css({\n\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t\t':hover': {\n\t\t\tbackground: token('elevation.surface.overlay', '#FFF'),\n\t\t\tboxShadow: token('elevation.shadow.overlay', 'none'),\n\t\t},\n\t}),\n\tdragging: css({\n\t\tfilter: 'grayscale(0.8)',\n\t}),\n\tover: css({\n\t\ttransform: 'scale(1.1) rotate(8deg)',\n\t\tfilter: 'brightness(1.15)',\n\t\tboxShadow: token('elevation.shadow.overlay', 'none'),\n\t}),\n};\n\nconst Item = memo(function Item({ src }: { src: string }) {\n\tconst ref = useRef<HTMLImageElement | null>(null);\n\tconst [state, setState] = useState<State>('idle');\n\n\tconst instanceId = useContext(InstanceIdContext);\n\n\tuseEffect(() => {\n\t\tconst el = ref.current;\n\t\tinvariant(el);\n\n\t\treturn combine(\n\t\t\tdraggable({\n\t\t\t\telement: el,\n\t\t\t\tgetInitialData: () => ({ type: 'grid-item', src, instanceId }),\n\t\t\t\tonDragStart: () => setState('dragging'),\n\t\t\t\tonDrop: () => setState('idle'),\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement: el,\n\t\t\t\tgetData: () => ({ src }),\n\t\t\t\tgetIsSticky: () => true,\n\t\t\t\tcanDrop: ({ source }) =>\n\t\t\t\t\tsource.data.instanceId === instanceId &&\n\t\t\t\t\tsource.data.type === 'grid-item' &&\n\t\t\t\t\tsource.data.src !== src,\n\t\t\t\tonDragEnter: () => setState('over'),\n\t\t\t\tonDragLeave: () => setState('idle'),\n\t\t\t\tonDrop: () => setState('idle'),\n\t\t\t}),\n\t\t);\n\t}, [instanceId, src]);\n\n\t// eslint-disable-next-line @atlassian/a11y/alt-text\n\treturn <img css={[itemStyles, itemStateStyles[state]]} ref={ref} src={src} />;\n});\n\nconst gridStyles = css({\n\tdisplay: 'grid',\n\tgridTemplateColumns: 'repeat(3, 96px)',\n\tgap: 'var(--grid)',\n});\n\nexport default function Grid(): React.JSX.Element {\n\tconst [items, setItems] = useState<string[]>(() => [battery, drill, koala, ui, wallet, yeti]);\n\n\tconst [instanceId] = useState(getInstanceId);\n\n\tuseEffect(() => {\n\t\treturn monitorForElements({\n\t\t\tcanMonitor({ source }) {\n\t\t\t\treturn source.data.instanceId === instanceId;\n\t\t\t},\n\t\t\tonDrop({ source, location }) {\n\t\t\t\tconst destination = location.current.dropTargets[0];\n\t\t\t\tif (!destination) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst destinationSrc = destination.data.src;\n\t\t\t\tconst startSrc = source.data.src;\n\n\t\t\t\tif (typeof destinationSrc !== 'string') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (typeof startSrc !== 'string') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// swapping item positions\n\t\t\t\tconst updated = [...items];\n\t\t\t\tupdated[items.indexOf(startSrc)] = destinationSrc;\n\t\t\t\tupdated[items.indexOf(destinationSrc)] = startSrc;\n\n\t\t\t\tsetItems(updated);\n\t\t\t},\n\t\t});\n\t}, [instanceId, items]);\n\n\treturn (\n\t\t<InstanceIdContext.Provider value={instanceId}>\n\t\t\t<GlobalStyles />\n\t\t\t<div css={gridStyles}>\n\t\t\t\t{items.map((src) => (\n\t\t\t\t\t<Item src={src} key={src} />\n\t\t\t\t))}\n\t\t\t</div>\n\t\t</InstanceIdContext.Provider>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/guidelines/action-menu-variants.tsx",
    "content": "import React from 'react';\n\nimport { Stack } from '@atlaskit/primitives/compiled';\n\nimport { EntireEntityIsDraggable } from './entire-entity-is-draggable';\nimport { EntireEntityIsDraggableWithDragHandleButton } from './entire-entity-is-draggable-with-drag-handle-button';\nimport { EntireEntityIsDraggableWithGroupedItems } from './entire-entity-is-draggable-with-grouped-items';\nimport { ImpliedDraggable } from './standalone-card';\n\nexport function ActionMenuVariants(): React.JSX.Element {\n\treturn (\n\t\t<Stack space=\"space.100\">\n\t\t\t<EntireEntityIsDraggable />\n\t\t\t<EntireEntityIsDraggableWithGroupedItems />\n\t\t\t<EntireEntityIsDraggableWithDragHandleButton />\n\t\t\t<ImpliedDraggable />\n\t\t</Stack>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/guidelines/all-drag-handle-variants.tsx",
    "content": "import React from 'react';\n\nimport { Stack } from '@atlaskit/primitives/compiled';\n\nimport { EntireEntityIsDraggable } from './entire-entity-is-draggable';\nimport { EntireEntityIsDraggableWithDragHandleButton } from './entire-entity-is-draggable-with-drag-handle-button';\nimport { HoverDragHandle } from './hover-drag-handle';\nimport { HoverDragHandleOutsideBounds } from './hover-drag-handle-outside-bounds';\nimport { OnlyDraggableFromDragHandle } from './only-draggable-from-drag-handle';\nimport { ImpliedDraggable } from './standalone-card';\n\nexport function AllDragHandleVariants(): React.JSX.Element {\n\treturn (\n\t\t<Stack space=\"space.100\">\n\t\t\t<EntireEntityIsDraggable />\n\t\t\t<OnlyDraggableFromDragHandle />\n\t\t\t<EntireEntityIsDraggableWithDragHandleButton />\n\t\t\t<HoverDragHandle />\n\t\t\t<HoverDragHandleOutsideBounds />\n\t\t\t<ImpliedDraggable />\n\t\t</Stack>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/guidelines/delayed-cursor-change.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { Fragment, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx, keyframes } from '@emotion/react';\nimport { createPortal } from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';\nimport { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Grid, Stack, xcss } from '@atlaskit/primitives';\nimport { token } from '@atlaskit/tokens';\n\nimport { ActionMenu } from './shared/action-menu';\nimport { DragPreview } from './shared/drag-preview';\nimport { type DraggableState } from './shared/types';\n\nconst listItemStyles = xcss({\n\tborderWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border',\n\tpadding: 'space.100',\n\tpaddingInlineStart: 'space.0',\n\tborderRadius: 'radius.small',\n\tbackgroundColor: 'elevation.surface',\n\t':hover': {\n\t\tbackgroundColor: 'elevation.surface.hovered',\n\t},\n});\n\nconst changeCursor = keyframes({\n\tto: {\n\t\tcursor: 'grab',\n\t},\n});\n\nconst draggableStyles = css({\n\t'&:hover': {\n\t\tanimationName: `${changeCursor}`,\n\t\tanimationFillMode: 'forwards',\n\t\tanimationDuration: '0ms',\n\t\tanimationDelay: '800ms',\n\t},\n});\n\nconst draggingStyles = xcss({\n\topacity: 0.4,\n});\n\nexport function DelayedCursorChange(): React.JSX.Element {\n\tconst draggableRef = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<DraggableState>({ type: 'idle' });\n\n\tuseEffect(() => {\n\t\tconst element = draggableRef.current;\n\t\tinvariant(element);\n\t\treturn draggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\tgetOffset: pointerOutsideOfPreview({\n\t\t\t\t\t\tx: token('space.200', '16px'),\n\t\t\t\t\t\ty: token('space.100', '8px'),\n\t\t\t\t\t}),\n\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\tsetState({ type: 'preview', container });\n\t\t\t\t\t\treturn () => setState({ type: 'dragging' });\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDrop() {\n\t\t\t\tsetState({ type: 'idle' });\n\t\t\t},\n\t\t});\n\t}, []);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<div css={[draggableStyles]}>\n\t\t\t\t<Grid\n\t\t\t\t\tref={draggableRef}\n\t\t\t\t\talignItems=\"center\"\n\t\t\t\t\tcolumnGap=\"space.0\"\n\t\t\t\t\ttemplateColumns=\"auto 1fr auto\"\n\t\t\t\t\txcss={[listItemStyles, state.type === 'dragging' ? draggingStyles : undefined]}\n\t\t\t\t>\n\t\t\t\t\t<Stack>\n\t\t\t\t\t\t<DragHandleVerticalIcon\n\t\t\t\t\t\t\tspacing=\"spacious\"\n\t\t\t\t\t\t\tlabel=\"Drag list item\"\n\t\t\t\t\t\t\tcolor={token('color.icon')}\n\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Stack>\n\t\t\t\t\t<Box>\n\t\t\t\t\t\t{/* eslint-disable-next-line @atlaskit/design-system/no-html-code */}\n\t\t\t\t\t\t<code>cursor:drag</code> delayed by <code>800ms</code>\n\t\t\t\t\t</Box>\n\t\t\t\t\t<ActionMenu />\n\t\t\t\t</Grid>\n\t\t\t</div>\n\t\t\t{state.type === 'preview' ? createPortal(<DragPreview />, state.container) : null}\n\t\t</Fragment>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/guidelines/entire-entity-is-draggable-with-drag-handle-button.tsx",
    "content": "import React, { Fragment, type Ref, useEffect, useRef, useState } from 'react';\n\nimport { createPortal } from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';\nimport { DragHandleButton } from '@atlaskit/pragmatic-drag-and-drop-react-accessibility/drag-handle-button';\nimport { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Grid, xcss } from '@atlaskit/primitives';\nimport { token } from '@atlaskit/tokens';\n\nimport { DragPreview } from './shared/drag-preview';\nimport { type DraggableState } from './shared/types';\n\nconst listItemStyles = xcss({\n\tborderWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border',\n\tpadding: 'space.100',\n\tborderRadius: 'radius.small',\n\tbackgroundColor: 'elevation.surface',\n});\n\nconst draggableStyles = xcss({\n\t':hover': {\n\t\tcursor: 'grab',\n\t\tbackgroundColor: 'elevation.surface.hovered',\n\t},\n});\n\nconst draggingStyles = xcss({\n\topacity: 0.4,\n});\n\nexport function EntireEntityIsDraggableWithDragHandleButton(): React.JSX.Element {\n\tconst draggableRef = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<DraggableState>({ type: 'idle' });\n\n\tuseEffect(() => {\n\t\tconst element = draggableRef.current;\n\t\tinvariant(element);\n\t\treturn draggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\tgetOffset: pointerOutsideOfPreview({\n\t\t\t\t\t\tx: token('space.200', '16px'),\n\t\t\t\t\t\ty: token('space.100', '8px'),\n\t\t\t\t\t}),\n\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\tsetState({ type: 'preview', container });\n\t\t\t\t\t\treturn () => setState({ type: 'dragging' });\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDrop() {\n\t\t\t\tsetState({ type: 'idle' });\n\t\t\t},\n\t\t});\n\t}, []);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<Grid\n\t\t\t\tref={draggableRef}\n\t\t\t\talignItems=\"center\"\n\t\t\t\tcolumnGap=\"space.050\"\n\t\t\t\ttemplateColumns=\"auto 1fr auto\"\n\t\t\t\txcss={[\n\t\t\t\t\tlistItemStyles,\n\t\t\t\t\tdraggableStyles,\n\t\t\t\t\tstate.type === 'dragging' ? draggingStyles : undefined,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t<DropdownMenu\n\t\t\t\t\ttrigger={({ triggerRef, ...triggerProps }) => (\n\t\t\t\t\t\t<DragHandleButton\n\t\t\t\t\t\t\tref={triggerRef as Ref<HTMLButtonElement>}\n\t\t\t\t\t\t\t{...triggerProps}\n\t\t\t\t\t\t\tlabel={`Reorder item`}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tshouldRenderToParent\n\t\t\t\t>\n\t\t\t\t\t<DropdownItemGroup>\n\t\t\t\t\t\t<DropdownItem>Move to top</DropdownItem>\n\t\t\t\t\t\t<DropdownItem>Move up</DropdownItem>\n\t\t\t\t\t\t<DropdownItem>Move down</DropdownItem>\n\t\t\t\t\t\t<DropdownItem>Move to bottom</DropdownItem>\n\t\t\t\t\t</DropdownItemGroup>\n\t\t\t\t</DropdownMenu>\n\t\t\t\t<Box>Drag handle always visible (with drag handle button)</Box>\n\t\t\t</Grid>\n\t\t\t{state.type === 'preview' ? createPortal(<DragPreview />, state.container) : null}\n\t\t</Fragment>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/guidelines/entire-entity-is-draggable-with-grouped-items.tsx",
    "content": "import React, { Fragment, type Ref, useEffect, useRef, useState } from 'react';\n\nimport { createPortal } from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport { IconButton } from '@atlaskit/button/new';\nimport DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';\nimport ChevronRightIcon from '@atlaskit/icon/core/chevron-right';\nimport DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';\nimport EditorMoreIcon from '@atlaskit/icon/core/show-more-horizontal';\nimport { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Grid, Stack, xcss } from '@atlaskit/primitives';\nimport { token } from '@atlaskit/tokens';\n\nimport { DragPreview } from './shared/drag-preview';\nimport { type DraggableState } from './shared/types';\n\nfunction GroupedActionMenu() {\n\treturn (\n\t\t<DropdownMenu\n\t\t\ttrigger={({ triggerRef, ...triggerProps }) => (\n\t\t\t\t<IconButton\n\t\t\t\t\tref={triggerRef as Ref<HTMLButtonElement>}\n\t\t\t\t\tlabel=\"More actions\"\n\t\t\t\t\ticon={EditorMoreIcon}\n\t\t\t\t\tspacing=\"compact\"\n\t\t\t\t\t{...triggerProps}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\tshouldRenderToParent\n\t\t>\n\t\t\t<DropdownItemGroup>\n\t\t\t\t<DropdownMenu\n\t\t\t\t\tplacement=\"right-start\"\n\t\t\t\t\t// shouldRenderToParent\n\t\t\t\t\ttrigger={({ triggerRef, ...triggerProps }) => (\n\t\t\t\t\t\t<DropdownItem\n\t\t\t\t\t\t\t{...triggerProps}\n\t\t\t\t\t\t\tref={triggerRef}\n\t\t\t\t\t\t\telemAfter={\n\t\t\t\t\t\t\t\t<ChevronRightIcon\n\t\t\t\t\t\t\t\t\tspacing=\"spacious\"\n\t\t\t\t\t\t\t\t\tcolor={token('color.icon.subtle', '')}\n\t\t\t\t\t\t\t\t\tlabel=\"\"\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<span>Move</span>\n\t\t\t\t\t\t</DropdownItem>\n\t\t\t\t\t)}\n\t\t\t\t\tshouldRenderToParent\n\t\t\t\t>\n\t\t\t\t\t<DropdownItemGroup>\n\t\t\t\t\t\t<DropdownItem>Move to top</DropdownItem>\n\t\t\t\t\t\t<DropdownItem>Move up</DropdownItem>\n\t\t\t\t\t\t<DropdownItem>Move down</DropdownItem>\n\t\t\t\t\t\t<DropdownItem>Move to bottom</DropdownItem>\n\t\t\t\t\t</DropdownItemGroup>\n\t\t\t\t</DropdownMenu>\n\t\t\t</DropdownItemGroup>\n\t\t\t<DropdownItemGroup hasSeparator>\n\t\t\t\t<DropdownItem>Add label</DropdownItem>\n\t\t\t\t<DropdownItem>Change parent</DropdownItem>\n\t\t\t</DropdownItemGroup>\n\t\t\t<DropdownItemGroup hasSeparator>\n\t\t\t\t<DropdownItem>Remove from sprint</DropdownItem>\n\t\t\t\t<DropdownItem>Delete</DropdownItem>\n\t\t\t</DropdownItemGroup>\n\t\t</DropdownMenu>\n\t);\n}\n\nconst listItemStyles = xcss({\n\tborderWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border',\n\tpadding: 'space.100',\n\tpaddingInlineStart: 'space.0',\n\tborderRadius: 'radius.small',\n\tbackgroundColor: 'elevation.surface',\n});\n\nconst draggableStyles = xcss({\n\t':hover': {\n\t\tcursor: 'grab',\n\t\tbackgroundColor: 'elevation.surface.hovered',\n\t},\n});\n\nconst draggingStyles = xcss({\n\topacity: 0.4,\n});\n\nexport function EntireEntityIsDraggableWithGroupedItems(): React.JSX.Element {\n\tconst draggableRef = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<DraggableState>({ type: 'idle' });\n\n\tuseEffect(() => {\n\t\tconst element = draggableRef.current;\n\t\tinvariant(element);\n\t\treturn draggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\tgetOffset: pointerOutsideOfPreview({\n\t\t\t\t\t\tx: token('space.200', '16px'),\n\t\t\t\t\t\ty: token('space.100', '8px'),\n\t\t\t\t\t}),\n\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\tsetState({ type: 'preview', container });\n\t\t\t\t\t\treturn () => setState({ type: 'dragging' });\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDrop() {\n\t\t\t\tsetState({ type: 'idle' });\n\t\t\t},\n\t\t});\n\t}, []);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<Grid\n\t\t\t\tref={draggableRef}\n\t\t\t\talignItems=\"center\"\n\t\t\t\tcolumnGap=\"space.0\"\n\t\t\t\ttemplateColumns=\"auto 1fr auto\"\n\t\t\t\txcss={[\n\t\t\t\t\tlistItemStyles,\n\t\t\t\t\tdraggableStyles,\n\t\t\t\t\tstate.type === 'dragging' ? draggingStyles : undefined,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t<Stack>\n\t\t\t\t\t<DragHandleVerticalIcon\n\t\t\t\t\t\tspacing=\"spacious\"\n\t\t\t\t\t\tlabel=\"Drag list item\"\n\t\t\t\t\t\tcolor={token('color.icon')}\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t/>\n\t\t\t\t</Stack>\n\t\t\t\t<Box>Entire entity is draggable (with grouped actions)</Box>\n\t\t\t\t<GroupedActionMenu />\n\t\t\t</Grid>\n\t\t\t{state.type === 'preview' ? createPortal(<DragPreview />, state.container) : null}\n\t\t</Fragment>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/guidelines/entire-entity-is-draggable.tsx",
    "content": "import React, { Fragment, useEffect, useRef, useState } from 'react';\n\nimport { createPortal } from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';\nimport { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Grid, Stack, xcss } from '@atlaskit/primitives';\nimport { token } from '@atlaskit/tokens';\n\nimport { ActionMenu } from './shared/action-menu';\nimport { DragPreview } from './shared/drag-preview';\nimport { type DraggableState } from './shared/types';\n\nconst listItemStyles = xcss({\n\tborderWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border',\n\tpadding: 'space.100',\n\tpaddingInlineStart: 'space.0',\n\tborderRadius: 'radius.small',\n\tbackgroundColor: 'elevation.surface',\n});\n\nconst draggableStyles = xcss({\n\t':hover': {\n\t\tcursor: 'grab',\n\t\tbackgroundColor: 'elevation.surface.hovered',\n\t},\n});\n\nconst draggingStyles = xcss({\n\topacity: 0.4,\n});\n\nexport function EntireEntityIsDraggable(): React.JSX.Element {\n\tconst draggableRef = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<DraggableState>({ type: 'idle' });\n\n\tuseEffect(() => {\n\t\tconst element = draggableRef.current;\n\t\tinvariant(element);\n\t\treturn draggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\tgetOffset: pointerOutsideOfPreview({\n\t\t\t\t\t\tx: token('space.200', '16px'),\n\t\t\t\t\t\ty: token('space.100', '8px'),\n\t\t\t\t\t}),\n\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\tsetState({ type: 'preview', container });\n\t\t\t\t\t\treturn () => setState({ type: 'dragging' });\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDrop() {\n\t\t\t\tsetState({ type: 'idle' });\n\t\t\t},\n\t\t});\n\t}, []);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<Grid\n\t\t\t\tref={draggableRef}\n\t\t\t\talignItems=\"center\"\n\t\t\t\ttemplateColumns=\"auto 1fr auto\"\n\t\t\t\txcss={[\n\t\t\t\t\tlistItemStyles,\n\t\t\t\t\tdraggableStyles,\n\t\t\t\t\tstate.type === 'dragging' ? draggingStyles : undefined,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t<Stack>\n\t\t\t\t\t<DragHandleVerticalIcon label=\"Drag list item\" size=\"small\" spacing=\"spacious\" />\n\t\t\t\t</Stack>\n\t\t\t\t<Box>Drag handle always visible</Box>\n\t\t\t\t<ActionMenu />\n\t\t\t</Grid>\n\t\t\t{state.type === 'preview' ? createPortal(<DragPreview />, state.container) : null}\n\t\t</Fragment>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/guidelines/hover-drag-handle-outside-bounds.tsx",
    "content": "import React, { Fragment, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { keyframes } from '@emotion/react';\nimport { createPortal } from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';\nimport { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Grid, xcss } from '@atlaskit/primitives';\nimport { token } from '@atlaskit/tokens';\n\nimport { ActionMenu } from './shared/action-menu';\nimport { DragPreview } from './shared/drag-preview';\nimport { type DraggableState } from './shared/types';\n\nconst dragCursorAnimation = keyframes({\n\tto: {\n\t\tcursor: 'grab',\n\t},\n});\n\nconst listItemStyles = xcss({\n\tborderWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border',\n\tpadding: 'space.100',\n\tborderRadius: 'radius.small',\n\tbackgroundColor: 'elevation.surface',\n\tposition: 'relative',\n\tmarginInlineStart: 'space.100',\n\t'--show-drag-handle': 0,\n\n\t':hover': {\n\t\t// @ts-expect-error\n\t\t'--show-drag-handle': 1,\n\t\tbackgroundColor: 'elevation.surface.hovered',\n\t\tanimationName: dragCursorAnimation,\n\n\t\t/* instant animation */\n\t\tanimationDuration: '0s',\n\n\t\t/* delay cursor change */\n\t\tanimationDelay: '800ms',\n\n\t\t/* keep the end state when the animation ends */\n\t\tanimationFillMode: 'forwards',\n\t},\n\n\t':focus-within': {\n\t\t// @ts-expect-error\n\t\t'--show-drag-handle': 1,\n\t},\n});\n\nconst draggingStyles = xcss({\n\topacity: 0.4,\n});\n\nconst dragHandleStyles = xcss({\n\tposition: 'absolute',\n\tpointerEvents: 'auto',\n\tdisplay: 'flex',\n\ttop: '0',\n\tbottom: '0',\n\tinsetInlineStart: '0',\n\topacity: 'var(--show-drag-handle, 0)',\n\tmarginInlineStart: 'space.negative.150',\n\tflexDirection: 'column',\n\tjustifyContent: 'center',\n});\n\nexport function HoverDragHandleOutsideBounds(): React.JSX.Element {\n\tconst draggableRef = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<DraggableState>({ type: 'idle' });\n\n\tuseEffect(() => {\n\t\tconst element = draggableRef.current;\n\t\tinvariant(element);\n\t\treturn draggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\tgetOffset: pointerOutsideOfPreview({\n\t\t\t\t\t\tx: token('space.200', '16px'),\n\t\t\t\t\t\ty: token('space.100', '8px'),\n\t\t\t\t\t}),\n\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\tsetState({ type: 'preview', container });\n\t\t\t\t\t\treturn () => setState({ type: 'dragging' });\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDrop() {\n\t\t\t\tsetState({ type: 'idle' });\n\t\t\t},\n\t\t});\n\t}, []);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<Grid\n\t\t\t\talignItems=\"center\"\n\t\t\t\tcolumnGap=\"space.0\"\n\t\t\t\ttemplateColumns=\"1fr auto\"\n\t\t\t\tref={draggableRef}\n\t\t\t\ttestId=\"hover-drag-handle-outside-bounds\"\n\t\t\t\txcss={[listItemStyles, state.type === 'dragging' ? draggingStyles : undefined]}\n\t\t\t>\n\t\t\t\t<Box>Drag handle visible on hover (placed out of bounds)</Box>\n\t\t\t\t<ActionMenu />\n\t\t\t\t<Box xcss={dragHandleStyles}>\n\t\t\t\t\t<DragHandleVerticalIcon label=\"\" size=\"small\" />\n\t\t\t\t</Box>\n\t\t\t</Grid>\n\n\t\t\t{state.type === 'preview' ? createPortal(<DragPreview />, state.container) : null}\n\t\t</Fragment>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/guidelines/hover-drag-handle.tsx",
    "content": "import React, { Fragment, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { keyframes } from '@emotion/react';\nimport { createPortal } from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';\nimport { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Grid, xcss } from '@atlaskit/primitives';\nimport { token } from '@atlaskit/tokens';\n\nimport { ActionMenu } from './shared/action-menu';\nimport { DragPreview } from './shared/drag-preview';\nimport { type DraggableState } from './shared/types';\n\nconst dragCursorAnimation = keyframes({\n\tto: {\n\t\tcursor: 'grab',\n\t},\n});\n\nconst listItemStyles = xcss({\n\tborderWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border',\n\tpadding: 'space.100',\n\tpaddingInlineStart: 'space.0',\n\tborderRadius: 'radius.small',\n\tbackgroundColor: 'elevation.surface',\n\t'--show-drag-handle': 0,\n\t':hover': {\n\t\t// @ts-expect-error\n\t\t'--show-drag-handle': 1,\n\t\tbackgroundColor: 'elevation.surface.hovered',\n\t\tanimationName: dragCursorAnimation,\n\n\t\t/* instant animation */\n\t\tanimationDuration: '0s',\n\n\t\t/* delay cursor change */\n\t\tanimationDelay: '800ms',\n\n\t\t/* keep the end state when the animation ends */\n\t\tanimationFillMode: 'forwards',\n\t},\n\t':focus-within': {\n\t\t// @ts-expect-error\n\t\t'--show-drag-handle': 1,\n\t},\n});\n\nconst draggingStyles = xcss({\n\topacity: 0.4,\n});\n\nconst dragHandleStyles = xcss({\n\tdisplay: 'flex',\n\topacity: 'var(--show-drag-handle, 0)',\n});\n\nexport function HoverDragHandle(): React.JSX.Element {\n\tconst draggableRef = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<DraggableState>({ type: 'idle' });\n\n\tuseEffect(() => {\n\t\tconst element = draggableRef.current;\n\t\tinvariant(element);\n\t\treturn draggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\tgetOffset: pointerOutsideOfPreview({\n\t\t\t\t\t\tx: token('space.200', '16px'),\n\t\t\t\t\t\ty: token('space.100', '8px'),\n\t\t\t\t\t}),\n\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\tsetState({ type: 'preview', container });\n\t\t\t\t\t\treturn () => setState({ type: 'dragging' });\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDrop() {\n\t\t\t\tsetState({ type: 'idle' });\n\t\t\t},\n\t\t});\n\t}, []);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<Grid\n\t\t\t\talignItems=\"center\"\n\t\t\t\tcolumnGap=\"space.0\"\n\t\t\t\ttemplateColumns=\"auto 1fr auto\"\n\t\t\t\tref={draggableRef}\n\t\t\t\ttestId=\"hover-drag-handle\"\n\t\t\t\txcss={[listItemStyles, state.type === 'dragging' ? draggingStyles : undefined]}\n\t\t\t>\n\t\t\t\t<Box xcss={[dragHandleStyles]}>\n\t\t\t\t\t<DragHandleVerticalIcon\n\t\t\t\t\t\tspacing=\"compact\"\n\t\t\t\t\t\tlabel=\"Drag list item\"\n\t\t\t\t\t\tcolor={token('color.icon')}\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t/>\n\t\t\t\t</Box>\n\t\t\t\t<Box>Drag handle visible on hover</Box>\n\t\t\t\t<ActionMenu />\n\t\t\t</Grid>\n\t\t\t{state.type === 'preview' ? createPortal(<DragPreview />, state.container) : null}\n\t\t</Fragment>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/guidelines/only-draggable-from-drag-handle.tsx",
    "content": "import React, { Fragment, useEffect, useRef, useState } from 'react';\n\nimport { createPortal } from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';\nimport { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Grid, Stack, xcss } from '@atlaskit/primitives';\nimport { token } from '@atlaskit/tokens';\n\nimport { ActionMenu } from './shared/action-menu';\nimport { DragPreview } from './shared/drag-preview';\nimport { type DraggableState } from './shared/types';\n\nconst listItemStyles = xcss({\n\tborderWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border',\n\tpadding: 'space.100',\n\tpaddingInlineStart: 'space.0',\n\tborderRadius: 'radius.small',\n\tbackgroundColor: 'elevation.surface',\n});\n\nconst draggableStyles = xcss({\n\t':hover': {\n\t\tcursor: 'grab',\n\t\tbackgroundColor: 'elevation.surface.hovered',\n\t},\n});\n\nconst draggingStyles = xcss({\n\topacity: 0.4,\n});\n\nconst roundedIconStyles = xcss({ borderRadius: 'radius.small' });\n\nexport function OnlyDraggableFromDragHandle(): React.JSX.Element {\n\tconst draggableRef = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<DraggableState>({ type: 'idle' });\n\n\tuseEffect(() => {\n\t\tconst element = draggableRef.current;\n\t\tinvariant(element);\n\t\treturn draggable({\n\t\t\telement,\n\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\tgetOffset: pointerOutsideOfPreview({\n\t\t\t\t\t\tx: token('space.200', '16px'),\n\t\t\t\t\t\ty: token('space.100', '8px'),\n\t\t\t\t\t}),\n\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\tsetState({ type: 'preview', container });\n\t\t\t\t\t\treturn () => setState({ type: 'dragging' });\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDrop() {\n\t\t\t\tsetState({ type: 'idle' });\n\t\t\t},\n\t\t});\n\t}, []);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<Grid\n\t\t\t\talignItems=\"center\"\n\t\t\t\ttemplateColumns=\"auto 1fr auto\"\n\t\t\t\txcss={[listItemStyles, state.type === 'dragging' ? draggingStyles : undefined]}\n\t\t\t>\n\t\t\t\t<Stack xcss={[draggableStyles, roundedIconStyles]} ref={draggableRef}>\n\t\t\t\t\t<DragHandleVerticalIcon\n\t\t\t\t\t\tspacing=\"spacious\"\n\t\t\t\t\t\tlabel=\"Drag list item\"\n\t\t\t\t\t\tcolor={token('color.icon')}\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t/>\n\t\t\t\t</Stack>\n\t\t\t\t<Box>Drag handle always visible (only draggable from drag handle)</Box>\n\t\t\t\t<ActionMenu />\n\t\t\t</Grid>\n\t\t\t{state.type === 'preview' ? createPortal(<DragPreview />, state.container) : null}\n\t\t</Fragment>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/guidelines/shared/action-menu.tsx",
    "content": "import React, { type Ref } from 'react';\n\nimport { IconButton } from '@atlaskit/button/new';\nimport DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';\nimport EditorMoreIcon from '@atlaskit/icon/core/show-more-horizontal';\n\nexport function ActionMenu(): React.JSX.Element {\n\treturn (\n\t\t<DropdownMenu\n\t\t\ttrigger={({ triggerRef, ...triggerProps }) => (\n\t\t\t\t<IconButton\n\t\t\t\t\tref={triggerRef as Ref<HTMLButtonElement>}\n\t\t\t\t\tlabel=\"More actions\"\n\t\t\t\t\ticon={EditorMoreIcon}\n\t\t\t\t\tspacing=\"compact\"\n\t\t\t\t\t{...triggerProps}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\tshouldRenderToParent\n\t\t>\n\t\t\t<DropdownItemGroup>\n\t\t\t\t<DropdownItem>Move to top</DropdownItem>\n\t\t\t\t<DropdownItem>Move up</DropdownItem>\n\t\t\t\t<DropdownItem>Move down</DropdownItem>\n\t\t\t\t<DropdownItem>Move to bottom</DropdownItem>\n\t\t\t</DropdownItemGroup>\n\t\t\t<DropdownItemGroup hasSeparator>\n\t\t\t\t<DropdownItem>Add label</DropdownItem>\n\t\t\t\t<DropdownItem>Change parent</DropdownItem>\n\t\t\t</DropdownItemGroup>\n\t\t\t<DropdownItemGroup hasSeparator>\n\t\t\t\t<DropdownItem>Remove from sprint</DropdownItem>\n\t\t\t\t<DropdownItem>Delete</DropdownItem>\n\t\t\t</DropdownItemGroup>\n\t\t</DropdownMenu>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/guidelines/shared/drag-preview.tsx",
    "content": "import React from 'react';\n\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, xcss } from '@atlaskit/primitives';\n\nconst previewStyles = xcss({\n\tborderWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border',\n\tpadding: 'space.100',\n\tborderRadius: 'radius.small',\n\tbackgroundColor: 'elevation.surface',\n});\n\nexport function DragPreview(): React.JSX.Element {\n\treturn <Box xcss={previewStyles}>Item drag preview</Box>;\n}\n"
  },
  {
    "path": "packages/documentation/examples/guidelines/shared/types.ts",
    "content": "export type DraggableState =\n\t| {\n\t\t\ttype: 'idle';\n\t  }\n\t| {\n\t\t\ttype: 'preview';\n\t\t\tcontainer: HTMLElement;\n\t  }\n\t| {\n\t\t\ttype: 'dragging';\n\t  };\n"
  },
  {
    "path": "packages/documentation/examples/guidelines/standalone-card.tsx",
    "content": "import React from 'react';\n\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, xcss } from '@atlaskit/primitives';\n\nimport { getPersonFromPosition, type Person } from '../data/people';\nimport { BoardContext } from '../pieces/board/board-context';\nimport { Card as ActualCard } from '../pieces/board/card';\nimport { ColumnContext } from '../pieces/board/column-context';\n\nconst containerStyles = xcss({ width: '220px' });\nconst person: Person = {\n\t...getPersonFromPosition({ position: 8 }),\n\tname: 'Card',\n\trole: 'Implied draggable',\n};\n\nexport function ImpliedDraggable(): React.JSX.Element {\n\treturn (\n\t\t<BoardContext.Provider\n\t\t\tvalue={{\n\t\t\t\tinstanceId: Symbol('card'),\n\t\t\t\tgetColumns: () => [],\n\t\t\t\treorderColumn: () => {},\n\t\t\t\treorderCard: () => {},\n\t\t\t\tmoveCard: () => {},\n\t\t\t\tregisterCard: () => () => {},\n\t\t\t\tregisterColumn: () => () => {},\n\t\t\t}}\n\t\t>\n\t\t\t<ColumnContext.Provider\n\t\t\t\tvalue={{\n\t\t\t\t\tcolumnId: 'fake',\n\t\t\t\t\tgetCardIndex: () => 2,\n\t\t\t\t\tgetNumCards: () => 10,\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<Box xcss={containerStyles}>\n\t\t\t\t\t<ActualCard item={person} />\n\t\t\t\t</Box>\n\t\t\t</ColumnContext.Provider>\n\t\t</BoardContext.Provider>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/guidelines.tsx",
    "content": "import React from 'react';\n\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Stack, xcss } from '@atlaskit/primitives';\n\nimport BacklogPrototype from './pieces/backlog';\nimport { BoardPrototype } from './pieces/rdr-board';\nimport PinnedFieldsPrototype from './pieces/rdr-pinned-fields';\nimport { SubtasksPrototype } from './pieces/rdr-subtasks';\n\nconst containerStyles = xcss({\n\tpadding: 'space.400',\n});\n\nexport default function GuidelinesExample(): React.JSX.Element {\n\treturn (\n\t\t<Stack space=\"space.1000\" alignInline=\"center\" xcss={containerStyles}>\n\t\t\t<PinnedFieldsPrototype />\n\t\t\t<SubtasksPrototype />\n\t\t\t<BoardPrototype />\n\t\t\t<BacklogPrototype />\n\t\t</Stack>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/icons/invision.tsx",
    "content": "import React from 'react';\n\nimport type { CustomGlyphProps } from '@atlaskit/icon/types';\n\nexport default (props: CustomGlyphProps): React.JSX.Element => (\n\t<svg\n\t\t{...props}\n\t\twidth=\"24\"\n\t\theight=\"24\"\n\t\tviewBox=\"0 0 24 24\"\n\t\tfill=\"none\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t>\n\t\t<path\n\t\t\td=\"M21.8246 0H2.17536C0.973942 0 0 0.973942 0 2.17536V21.8246C0 23.0261 0.973942 24 2.17536 24H21.8246C23.0261 24 24 23.0261 24 21.8246V2.17536C24 0.973942 23.0261 0 21.8246 0Z\"\n\t\t\tfill=\"#FF3366\"\n\t\t/>\n\t\t<path\n\t\t\td=\"M8.02079 7.55134C8.30423 7.54623 8.57986 7.45758 8.81313 7.29649C9.0464 7.1354 9.22693 6.90904 9.3321 6.64579C9.43727 6.38253 9.4624 6.09409 9.40433 5.81661C9.34626 5.53914 9.20759 5.28497 9.00568 5.08598C8.80378 4.88698 8.54763 4.75201 8.26934 4.69797C7.99105 4.64394 7.703 4.67324 7.4413 4.78222C7.17959 4.8912 6.95588 5.075 6.79819 5.31058C6.64051 5.54617 6.55586 5.82305 6.55487 6.10654C6.55549 6.29788 6.59399 6.4872 6.66814 6.66359C6.74229 6.83998 6.85063 6.99995 6.98691 7.13426C7.12318 7.26858 7.2847 7.37458 7.46215 7.44616C7.6396 7.51775 7.82946 7.55349 8.02079 7.55134Z\"\n\t\t\tfill=\"white\"\n\t\t/>\n\t\t<path\n\t\t\td=\"M4.98047 15.287C4.89741 15.6431 4.85394 16.0072 4.85087 16.3728C4.85087 17.6448 5.54111 18.4896 7.00703 18.4896C8.22335 18.4896 9.20927 17.7677 9.91871 16.6013L9.48575 18.3408H11.904L13.2835 12.8064C13.6282 11.4048 14.2963 10.6771 15.3101 10.6771C16.1078 10.6771 16.6042 11.1734 16.6042 11.9923C16.6066 12.255 16.5691 12.5166 16.4928 12.768L15.7814 15.312C15.68 15.6623 15.6293 16.0254 15.6307 16.3901C15.6307 17.5977 16.3421 18.4809 17.8301 18.4809C19.1021 18.4809 20.1158 17.6621 20.6765 15.6969L19.728 15.3312C19.2537 16.6454 18.8438 16.8835 18.5203 16.8835C18.1968 16.8835 18.024 16.6685 18.024 16.2374C18.033 16.0099 18.0691 15.7844 18.1315 15.5654L18.8217 13.0867C18.9765 12.5788 19.0564 12.051 19.0589 11.52C19.0589 9.66623 17.9376 8.69855 16.5792 8.69855C15.3072 8.69855 14.0131 9.85055 13.367 11.0534L13.8413 8.88575H10.1549L9.63743 10.7952H11.3654L10.3037 15.048C9.46943 16.9017 7.93727 16.9325 7.74527 16.8893C7.42943 16.8182 7.22783 16.6973 7.22783 16.2883C7.23732 15.9544 7.28794 15.6229 7.37855 15.3014L8.99135 8.88671H4.89599L4.37759 10.7952H6.08063L4.98047 15.287Z\"\n\t\t\tfill=\"white\"\n\t\t/>\n\t</svg>\n);\n"
  },
  {
    "path": "packages/documentation/examples/icons/portfolio.tsx",
    "content": "import React from 'react';\n\nimport type { CustomGlyphProps } from '@atlaskit/icon/types';\n\nexport default (props: CustomGlyphProps): React.JSX.Element => (\n\t<svg\n\t\t{...props}\n\t\twidth=\"24\"\n\t\theight=\"24\"\n\t\tviewBox=\"0 0 24 24\"\n\t\tfill=\"none\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t>\n\t\t<mask\n\t\t\tid=\"mask0\"\n\t\t\tmask-type=\"alpha\"\n\t\t\tmaskUnits=\"userSpaceOnUse\"\n\t\t\tx=\"0\"\n\t\t\ty=\"0\"\n\t\t\twidth=\"24\"\n\t\t\theight=\"24\"\n\t\t>\n\t\t\t<rect width=\"24\" height=\"24\" fill=\"white\" />\n\t\t</mask>\n\t\t<g mask=\"url(#mask0)\">\n\t\t\t<path\n\t\t\t\td=\"M8.82929 17H15.1707C15.5825 15.8348 16.6938 15 18 15C19.6569 15 21 16.3431 21 18C21 19.6569 19.6569 21 18 21C16.6938 21 15.5825 20.1652 15.1707 19H8.82929C8.41746 20.1652 7.30622 21 6 21C4.34315 21 3 19.6569 3 18C3 16.3431 4.34315 15 6 15C7.30622 15 8.41746 15.8348 8.82929 17Z\"\n\t\t\t\tfill=\"#36B37E\"\n\t\t\t/>\n\t\t\t<rect x=\"3\" y=\"3\" width=\"16\" height=\"3\" rx=\"1.5\" fill=\"#2684FF\" />\n\t\t\t<rect x=\"8\" y=\"9\" width=\"13\" height=\"3\" rx=\"1.5\" fill=\"#FFC400\" />\n\t\t\t<rect width=\"24\" height=\"24\" rx=\"3\" fill=\"#4E86EE\" />\n\t\t\t<rect width=\"24\" height=\"24\" rx=\"3\" fill=\"url(#paint0_linear)\" />\n\t\t\t<mask\n\t\t\t\tid=\"mask1\"\n\t\t\t\tmask-type=\"alpha\"\n\t\t\t\tmaskUnits=\"userSpaceOnUse\"\n\t\t\t\tx=\"0\"\n\t\t\t\ty=\"0\"\n\t\t\t\twidth=\"24\"\n\t\t\t\theight=\"24\"\n\t\t\t>\n\t\t\t\t<rect width=\"24\" height=\"24\" fill=\"white\" />\n\t\t\t</mask>\n\t\t\t<g mask=\"url(#mask1)\">\n\t\t\t\t<path\n\t\t\t\t\td=\"M9.8862 15.3333H14.1138C14.3884 14.5565 15.1292 14 16 14C17.1046 14 18 14.8954 18 16C18 17.1046 17.1046 18 16 18C15.1292 18 14.3884 17.4435 14.1138 16.6667H9.8862C9.61164 17.4435 8.87081 18 8 18C6.89543 18 6 17.1046 6 16C6 14.8954 6.89543 14 8 14C8.87081 14 9.61164 14.5565 9.8862 15.3333Z\"\n\t\t\t\t\tfill=\"white\"\n\t\t\t\t/>\n\t\t\t\t<rect x=\"6\" y=\"6\" width=\"11\" height=\"2\" rx=\"1\" fill=\"white\" />\n\t\t\t\t<rect x=\"9\" y=\"10\" width=\"9\" height=\"2\" rx=\"1\" fill=\"white\" />\n\t\t\t</g>\n\t\t</g>\n\t\t<defs>\n\t\t\t<linearGradient\n\t\t\t\tid=\"paint0_linear\"\n\t\t\t\tx1=\"12\"\n\t\t\t\ty1=\"0\"\n\t\t\t\tx2=\"12\"\n\t\t\t\ty2=\"24\"\n\t\t\t\tgradientUnits=\"userSpaceOnUse\"\n\t\t\t>\n\t\t\t\t<stop stopColor=\"#4E86EE\" />\n\t\t\t\t<stop offset=\"1\" stopColor=\"#3562C1\" />\n\t\t\t</linearGradient>\n\t\t</defs>\n\t</svg>\n);\n"
  },
  {
    "path": "packages/documentation/examples/icons/slack.tsx",
    "content": "import React from 'react';\n\nimport type { CustomGlyphProps } from '@atlaskit/icon/types';\n\nexport default (props: CustomGlyphProps): React.JSX.Element => (\n\t<svg\n\t\t{...props}\n\t\twidth=\"24\"\n\t\theight=\"24\"\n\t\tviewBox=\"0 0 24 24\"\n\t\tfill=\"none\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t>\n\t\t<mask\n\t\t\tid=\"mask0\"\n\t\t\tmask-type=\"alpha\"\n\t\t\tmaskUnits=\"userSpaceOnUse\"\n\t\t\tx=\"0\"\n\t\t\ty=\"0\"\n\t\t\twidth=\"24\"\n\t\t\theight=\"24\"\n\t\t>\n\t\t\t<rect width=\"24\" height=\"24\" rx=\"4\" fill=\"white\" />\n\t\t</mask>\n\t\t<g mask=\"url(#mask0)\"></g>\n\t\t<path\n\t\t\td=\"M5.67114 13.88C5.67114 15.1422 4.64003 16.1734 3.37781 16.1734C2.11558 16.1734 1.08447 15.1422 1.08447 13.88C1.08447 12.6178 2.11558 11.5867 3.37781 11.5867C4.64438 11.5867 5.67114 12.6134 5.67114 13.88Z\"\n\t\t\tfill=\"#E01E5A\"\n\t\t/>\n\t\t<path\n\t\t\td=\"M6.82672 13.88C6.82672 12.6178 7.85783 11.5867 9.12005 11.5867C10.3823 11.5867 11.4134 12.6178 11.4134 13.88V19.6222C11.4134 20.8844 10.3823 21.9156 9.12005 21.9156C7.85783 21.9156 6.82672 20.8844 6.82672 19.6222V13.88Z\"\n\t\t\tfill=\"#E01E5A\"\n\t\t/>\n\t\t<path\n\t\t\td=\"M9.12005 4.67114C7.85783 4.67114 6.82672 3.64003 6.82672 2.37781C6.82672 1.11558 7.85783 0.0844727 9.12005 0.0844727C10.3823 0.0844727 11.4134 1.11558 11.4134 2.37781C11.4134 3.64438 10.3866 4.67114 9.12005 4.67114Z\"\n\t\t\tfill=\"#36C5F0\"\n\t\t/>\n\t\t<path\n\t\t\td=\"M9.12003 5.82678C10.3823 5.82678 11.4134 6.8579 11.4134 8.12012C11.4134 9.38235 10.3823 10.4135 9.12003 10.4135H3.37781C2.11558 10.4135 1.08447 9.38235 1.08447 8.12012C1.08447 6.8579 2.11558 5.82678 3.37781 5.82678H9.12003Z\"\n\t\t\tfill=\"#36C5F0\"\n\t\t/>\n\t\t<path\n\t\t\td=\"M18.3289 8.12012C18.3289 6.8579 19.36 5.82678 20.6223 5.82678C21.8845 5.82678 22.9156 6.8579 22.9156 8.12012C22.9156 9.38235 21.8845 10.4135 20.6223 10.4135C19.3557 10.4135 18.3289 9.3867 18.3289 8.12012Z\"\n\t\t\tfill=\"#2EB67D\"\n\t\t/>\n\t\t<path\n\t\t\td=\"M17.1733 8.12004C17.1733 9.38227 16.1422 10.4134 14.88 10.4134C13.6178 10.4134 12.5867 9.38227 12.5867 8.12004V2.37781C12.5867 1.11559 13.6178 0.0844727 14.88 0.0844727C16.1422 0.0844727 17.1733 1.11559 17.1733 2.37781V8.12004Z\"\n\t\t\tfill=\"#2EB67D\"\n\t\t/>\n\t\t<path\n\t\t\td=\"M14.88 17.329C16.1422 17.329 17.1733 18.3601 17.1733 19.6223C17.1733 20.8845 16.1422 21.9156 14.88 21.9156C13.6178 21.9156 12.5867 20.8845 12.5867 19.6223C12.5867 18.3557 13.6134 17.329 14.88 17.329Z\"\n\t\t\tfill=\"#ECB22E\"\n\t\t/>\n\t\t<path\n\t\t\td=\"M14.88 16.1734C13.6178 16.1734 12.5867 15.1422 12.5867 13.88C12.5867 12.6178 13.6178 11.5867 14.88 11.5867H20.6222C21.8844 11.5867 22.9156 12.6178 22.9156 13.88C22.9156 15.1422 21.8844 16.1734 20.6222 16.1734H14.88Z\"\n\t\t\tfill=\"#ECB22E\"\n\t\t/>\n\t</svg>\n);\n"
  },
  {
    "path": "packages/documentation/examples/icons/tempo.tsx",
    "content": "import React from 'react';\n\nimport type { CustomGlyphProps } from '@atlaskit/icon/types';\n\nexport default (props: CustomGlyphProps): React.JSX.Element => (\n\t<svg\n\t\t{...props}\n\t\twidth=\"24\"\n\t\theight=\"24\"\n\t\tviewBox=\"0 0 24 24\"\n\t\tfill=\"none\"\n\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t>\n\t\t<path\n\t\t\tfillRule=\"evenodd\"\n\t\t\tclipRule=\"evenodd\"\n\t\t\td=\"M14.6935 8.47387L11.4185 11.7471C11.3917 11.7739 11.3599 11.7953 11.3249 11.8098C11.2899 11.8243 11.2524 11.8318 11.2145 11.8318C11.1766 11.8318 11.139 11.8243 11.104 11.8098C11.069 11.7953 11.0372 11.7739 11.0105 11.7471L9.65538 10.3939C9.62863 10.367 9.59683 10.3457 9.56183 10.3312C9.52682 10.3166 9.48929 10.3092 9.45138 10.3092C9.41348 10.3092 9.37595 10.3166 9.34094 10.3312C9.30593 10.3457 9.27414 10.367 9.24738 10.3939L7.68923 11.952C7.66238 11.9788 7.64108 12.0106 7.62654 12.0456C7.61201 12.0806 7.60452 12.1181 7.60452 12.156C7.60452 12.1939 7.61201 12.2315 7.62654 12.2665C7.64108 12.3015 7.66238 12.3333 7.68923 12.36L11.0308 15.6923C11.0576 15.7203 11.0899 15.7426 11.1256 15.7578C11.1613 15.773 11.1997 15.7808 11.2385 15.7808C11.2773 15.7808 11.3156 15.773 11.3513 15.7578C11.387 15.7426 11.4193 15.7203 11.4462 15.6923L16.68 10.4603C16.7068 10.4336 16.7282 10.4018 16.7427 10.3668C16.7572 10.3318 16.7647 10.2942 16.7647 10.2563C16.7647 10.2184 16.7572 10.1809 16.7427 10.1459C16.7282 10.1109 16.7068 10.0791 16.68 10.0523L15.1015 8.47387C15.0748 8.44702 15.043 8.42571 15.008 8.41118C14.973 8.39664 14.9354 8.38916 14.8975 8.38916C14.8596 8.38916 14.8221 8.39664 14.7871 8.41118C14.7521 8.42571 14.7203 8.44702 14.6935 8.47387Z\"\n\t\t\tfill=\"#336177\"\n\t\t/>\n\t\t<path\n\t\t\td=\"M12 1.69476C9.96182 1.69476 7.96941 2.29915 6.27472 3.43151C4.58003 4.56386 3.25919 6.17332 2.47921 8.05635C1.69923 9.93939 1.49515 12.0114 1.89278 14.0104C2.29041 16.0095 3.27189 17.8457 4.7131 19.2869C6.15431 20.7281 7.99053 21.7096 9.98955 22.1072C11.9886 22.5048 14.0606 22.3008 15.9436 21.5208C17.8267 20.7408 19.4361 19.42 20.5685 17.7253C21.7008 16.0306 22.3052 14.0382 22.3052 12C22.3023 9.26778 21.2156 6.6483 19.2837 4.71633C17.3517 2.78436 14.7322 1.6977 12 1.69476ZM12 4.46399C13.49 4.46399 14.9466 4.90582 16.1856 5.7336C17.4245 6.56138 18.3902 7.73795 18.9605 9.11453C19.5308 10.4911 19.6801 12.0059 19.3895 13.4673C19.099 14.9287 18.3816 16.2712 17.3281 17.3249C16.2746 18.3787 14.9323 19.0964 13.471 19.3873C12.0096 19.6782 10.4948 19.5293 9.11808 18.9593C7.74136 18.3894 6.56456 17.424 5.73648 16.1852C4.90839 14.9465 4.46621 13.49 4.46584 12C4.46584 10.0018 5.25962 8.08547 6.67255 6.67254C8.08547 5.25961 10.0018 4.46584 12 4.46584V4.46399Z\"\n\t\t\tfill=\"#00C3F2\"\n\t\t/>\n\t\t<path\n\t\t\tfillRule=\"evenodd\"\n\t\t\tclipRule=\"evenodd\"\n\t\t\td=\"M12 1.75385C12.6505 1.75383 13.2996 1.81565 13.9385 1.93846L12 0C8.8174 0 5.76516 1.26428 3.51472 3.51472C1.26428 5.76516 0 8.8174 0 12L1.93846 10.0615C2.39224 7.72498 3.64393 5.61875 5.47934 4.10327C7.31476 2.5878 9.61979 1.75728 12 1.75385Z\"\n\t\t\tfill=\"#248FB4\"\n\t\t/>\n\t\t<path\n\t\t\tfillRule=\"evenodd\"\n\t\t\tclipRule=\"evenodd\"\n\t\t\td=\"M22.0615 13.9385C21.5466 16.6065 19.9933 18.9609 17.7431 20.4842C15.4929 22.0074 12.7299 22.5747 10.0615 22.0615L12 24C15.1826 24 18.2348 22.7357 20.4853 20.4853C22.7357 18.2348 24 15.1826 24 12L22.0615 13.9385Z\"\n\t\t\tfill=\"#248FB4\"\n\t\t/>\n\t\t<path\n\t\t\tfillRule=\"evenodd\"\n\t\t\tclipRule=\"evenodd\"\n\t\t\td=\"M22.2462 12C22.2461 12.6505 22.1843 13.2996 22.0615 13.9385L24 12C24 8.8174 22.7357 5.76516 20.4853 3.51472C18.2348 1.26428 15.1826 0 12 0L13.9385 1.93846C16.275 2.39224 18.3812 3.64393 19.8967 5.47934C21.4122 7.31476 22.2427 9.61979 22.2462 12Z\"\n\t\t\tfill=\"#43B02A\"\n\t\t/>\n\t\t<path\n\t\t\tfillRule=\"evenodd\"\n\t\t\tclipRule=\"evenodd\"\n\t\t\td=\"M1.75385 12C1.75386 11.3494 1.81568 10.7004 1.93846 10.0615L0 12C0 15.1826 1.26428 18.2348 3.51472 20.4853C5.76516 22.7357 8.8174 24 12 24L10.0615 22.0615C7.72482 21.6081 5.61839 20.3565 4.10285 18.521C2.58732 16.6855 1.75693 14.3803 1.75385 12Z\"\n\t\t\tfill=\"#FF9200\"\n\t\t/>\n\t</svg>\n);\n"
  },
  {
    "path": "packages/documentation/examples/iframe-board.tsx",
    "content": "import React, { useMemo } from 'react';\n\nimport { easeInOut } from '@atlaskit/motion/curves';\nimport { durations } from '@atlaskit/motion/durations';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Anchor, Box, Inline, Stack, xcss } from '@atlaskit/primitives';\nimport { useThemeObserver } from '@atlaskit/tokens';\n\nimport { Column } from './pieces/iframe-board/column';\nimport pdndLogoSrc from './pieces/pdnd-logo.svg';\n\nconst containerStyles = xcss({ height: '100%', paddingBottom: 'space.200' });\nconst iframeStyles = xcss({ border: 'none', width: '250px' });\n\nconst logoStyles = xcss({\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values\n\ttransition: `all ${durations.medium}ms ${easeInOut}`,\n\tdisplay: 'inline-block',\n\tfilter: 'grayscale(1)',\n\tpadding: 'space.100', // making the hitbox for the link nice and generous\n\ttextDecoration: 'none',\n\n\t':hover': {\n\t\ttransform: 'scale(1.3)',\n\t\tfilter: 'grayscale(0)',\n\t},\n});\n\n// Including link to pdnd so that folks who are linked\n// to this example directly can easily find their way to the project\nfunction LinkToProject() {\n\treturn (\n\t\t<Anchor\n\t\t\thref=\"https://github.com/atlassian/pragmatic-drag-and-drop\"\n\t\t\taria-label=\"Pragmatic drag and drop Github project\"\n\t\t\txcss={logoStyles}\n\t\t\tdraggable=\"false\"\n\t\t\ttarget=\"_blank\"\n\t\t>\n\t\t\t<img src={pdndLogoSrc} width=\"50px\" alt=\"\" draggable=\"false\" />\n\t\t</Anchor>\n\t);\n}\n\nexport default function IFrameBoard(): React.JSX.Element {\n\tconst theme = useThemeObserver();\n\tconst iframeSrc = useMemo(() => {\n\t\tconst url = new URL('/examples.html', window.location.origin);\n\t\turl.searchParams.set('groupId', 'pragmatic-drag-and-drop');\n\t\turl.searchParams.set('packageId', 'documentation');\n\t\turl.searchParams.set('exampleId', 'iframe-column');\n\t\tif (theme.colorMode) {\n\t\t\turl.searchParams.set('mode', theme.colorMode);\n\t\t}\n\n\t\treturn url.href;\n\t}, [theme.colorMode]);\n\n\treturn (\n\t\t<Stack alignInline=\"center\" spread=\"space-between\" xcss={containerStyles}>\n\t\t\t<Box padding=\"space.500\">\n\t\t\t\t<Inline space=\"space.200\" alignInline=\"center\" shouldWrap>\n\t\t\t\t\t<Column columnId={'In parent window'} />\n\t\t\t\t\t{/* eslint-disable-next-line @atlassian/a11y/iframe-has-title */}\n\t\t\t\t\t<Box as=\"iframe\" src={iframeSrc} xcss={iframeStyles} />\n\t\t\t\t</Inline>\n\t\t\t</Box>\n\t\t\t<LinkToProject />\n\t\t</Stack>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/iframe-column.tsx",
    "content": "import React from 'react';\n\nimport { Column } from './pieces/iframe-board/column';\n\nexport default function IFrameColumn(): React.JSX.Element {\n\treturn <Column columnId={'In iframe'} />;\n}\n"
  },
  {
    "path": "packages/documentation/examples/list-comparison.tsx",
    "content": "/* eslint-disable @atlaskit/design-system/no-nested-styles */\n/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { Fragment, type ReactNode } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx, type SerializedStyles } from '@emotion/react';\n\nimport Code from '@atlaskit/code/inline';\nimport Grid, { GridItem } from '@atlaskit/grid';\nimport Lozenge from '@atlaskit/lozenge';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Stack, xcss } from '@atlaskit/primitives';\nimport Tabs, { TabPanel as AkTabPanel, Tab, TabList, type TabPanelProps } from '@atlaskit/tabs';\nimport { fontFallback } from '@atlaskit/theme/typography';\nimport { token } from '@atlaskit/tokens';\n\nimport AsanaFields from './pieces/pinned-fields/experience/asana';\nimport AsanaFieldsWithNativePreview from './pieces/pinned-fields/experience/asana-native-preview';\nimport PinnedFieldsWithCurrentGuidelines from './pieces/pinned-fields/experience/current-guidelines';\nimport PinnedFieldsWithCurrentGuidelinesA11yAlwaysVisible from './pieces/pinned-fields/experience/current-guidelines-a11y-always-visible';\nimport PinnedFieldsWithCurrentGuidelinesA11yKeyboardOnly from './pieces/pinned-fields/experience/current-guidelines-a11y-keyboard-only';\nimport PinnedFieldsEnhancedDragHandle from './pieces/pinned-fields/experience/enhanced-drag-handle';\nimport PinnedFieldsMigrationLayer, {\n\tPinnedFieldReactBeautifulDndNoDraggingOutline,\n\tPinnedFieldReactBeautifulDndSubtle,\n} from './pieces/pinned-fields/experience/migration-layer';\nimport PinnedFieldReactBeautifulDnd from './pieces/pinned-fields/experience/react-beautiful-dnd';\nimport SubtaskCurrentGuidelines from './pieces/subtasks/demo/current-guidelines';\nimport SubtasksCurrentGuidelinesA11yAlwaysVisible from './pieces/subtasks/demo/current-guidelines-a11y-always-visible';\nimport SubtasksCurrentGuidelinesA11yKeyboardOnly from './pieces/subtasks/demo/current-guidelines-a11y-keyboard-only';\nimport SubtaskEnhanced from './pieces/subtasks/demo/enhancements';\nimport LinearTaskReordering from './pieces/subtasks/demo/linear';\nimport LinearTaskReorderingNativePreview from './pieces/subtasks/demo/linear-native-preview';\nimport SubtasksMigrationLayer from './pieces/subtasks/demo/migration-layer';\nimport SubtasksNotion from './pieces/subtasks/demo/notion';\nimport SubtaskReactBeautifulDnd from './pieces/subtasks/demo/react-beautiful-dnd';\n\nconst itemStyles = xcss({\n\tborder: `${token('border.width.selected')} solid ${token('color.border.accent.purple', 'purple')}`,\n\tpadding: 'space.200',\n\tborderRadius: 'radius.xlarge',\n\theight: '100%', // ensure all grid items are the same height regardless of content\n\n\twidth: '100%',\n});\n\nconst itemBackgroundStyles = xcss({ backgroundColor: 'elevation.surface' });\n\nfunction Item({\n\tchildren,\n\tborderColor,\n\thasTransparentBackground = false,\n}: {\n\tchildren: ReactNode;\n\tborderColor?: string;\n\thasTransparentBackground?: boolean;\n}) {\n\treturn (\n\t\t<Box\n\t\t\txcss={[itemStyles, !hasTransparentBackground && itemBackgroundStyles]}\n\t\t\tstyle={{ borderColor }}\n\t\t>\n\t\t\t<Stack space=\"space.400\" alignInline=\"center\">\n\t\t\t\t{children}\n\t\t\t</Stack>\n\t\t</Box>\n\t);\n}\n\nconst itemPreviewStyles = xcss({\n\tdisplay: 'flex',\n\tflexWrap: 'wrap',\n\talignItems: 'start',\n\tjustifyContent: 'center',\n\t// maxWidth: 800,\n\twidth: '100%',\n\tgap: 'space.200',\n});\n\nfunction ItemPreview({ children }: { children: ReactNode }) {\n\treturn <Box xcss={itemPreviewStyles}>{children}</Box>;\n}\n\ntype Solution = 'pdnd' | 'rbd';\n\nconst solutionLabels: { [Key in Solution]: string } = {\n\tpdnd: 'pragmatic-drag-and-drop',\n\trbd: 'react-beautiful-dnd',\n};\n\nconst solutionLabelStyles = css({\n\tborder: `${token('border.width.selected')} solid transparent`,\n\tfontWeight: token('font.weight.medium'),\n\tpadding: `${token('space.050')} ${token('space.100')}`,\n\tborderRadius: 999,\n});\n\nconst solutionLabelColorStyles: Record<Solution, SerializedStyles> = {\n\tpdnd: css({\n\t\tcolor: token('color.text.discovery', 'purple'),\n\t\tborderColor: token('color.border.discovery', 'purple'),\n\t}),\n\trbd: css({\n\t\tcolor: token('color.text.accent.magenta', 'magenta'),\n\t\tborderColor: token('color.border.accent.magenta', 'magenta'),\n\t}),\n};\n\nconst tableStyles = css({\n\ttableLayout: 'auto',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766\n\ttbody: {\n\t\tborderBottom: 'none',\n\t},\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766\n\t'tr > td': {\n\t\twidth: '100%',\n\t},\n});\n\nconst itemCaptionHeadingStyles = css({\n\tfontWeight: token('font.weight.bold', 'bold'),\n});\n\nconst itemCaptionTableRowStyles = css({\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766\n\t'> th, > td': {\n\t\tpaddingBlock: 8,\n\t},\n});\n\nconst itemCaptionStyles = xcss({\n\twidth: '100%',\n\tmaxWidth: '800px',\n});\n\nfunction ItemCaption({\n\ttitle,\n\tpoweredBy,\n\taccessibility,\n\tother,\n}: {\n\ttitle: ReactNode;\n\tpoweredBy: Solution;\n\taccessibility: ReactNode;\n\tother?: ReactNode;\n}) {\n\treturn (\n\t\t<Box xcss={itemCaptionStyles}>\n\t\t\t<Stack space=\"space.200\">\n\t\t\t\t<h3 css={itemCaptionHeadingStyles}>{title}</h3>\n\n\t\t\t\t<table css={tableStyles}>\n\t\t\t\t\t<tbody>\n\t\t\t\t\t\t<tr css={itemCaptionTableRowStyles}>\n\t\t\t\t\t\t\t<th>Powered by</th>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t<span css={[solutionLabelStyles, solutionLabelColorStyles[poweredBy]]}>\n\t\t\t\t\t\t\t\t\t{solutionLabels[poweredBy]}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t<tr css={itemCaptionTableRowStyles}>\n\t\t\t\t\t\t\t<th>Accessibility</th>\n\t\t\t\t\t\t\t<td>{accessibility}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t{other ? (\n\t\t\t\t\t\t\t<tr css={itemCaptionTableRowStyles}>\n\t\t\t\t\t\t\t\t<th>Other</th>\n\t\t\t\t\t\t\t\t<td>{other}</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t) : null}\n\t\t\t\t\t</tbody>\n\t\t\t\t</table>\n\t\t\t</Stack>\n\t\t</Box>\n\t);\n}\n\nconst bigTitleStyles = css({\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tfont: token('font.heading.xxlarge', fontFallback.heading.xxlarge),\n\tfontWeight: token('font.weight.bold', 'bold'),\n\tmargin: 0,\n});\n\nconst sectionStyles = xcss({\n\tpaddingBlock: 'space.800',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':first-of-type': {\n\t\tborder: 'none',\n\t},\n});\n\nfunction Section({ children, backgroundColor }: { children: ReactNode; backgroundColor?: string }) {\n\treturn (\n\t\t<Box xcss={sectionStyles} style={{ backgroundColor }}>\n\t\t\t<Stack space=\"space.400\">{children}</Stack>\n\t\t</Box>\n\t);\n}\n\nconst sectionHeaderStyles = xcss({\n\ttextAlign: 'center',\n});\n\nconst sectionHeaderDescriptionStyles = css({\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tfont: token('font.heading.medium', fontFallback.heading.medium),\n\tcolor: token('color.text.subtle', 'currentColor'),\n});\n\nfunction SectionHeader({\n\telementBefore,\n\ttitle,\n\tdescription,\n}: {\n\telementBefore?: ReactNode;\n\ttitle: string;\n\tdescription: ReactNode;\n}) {\n\treturn (\n\t\t<Box xcss={sectionHeaderStyles}>\n\t\t\t{elementBefore}\n\t\t\t<h2\n\t\t\t\tcss={bigTitleStyles}\n\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\tstyle={elementBefore ? { marginTop: '24px' } : undefined}\n\t\t\t>\n\t\t\t\t{title}\n\t\t\t</h2>\n\t\t\t<p css={sectionHeaderDescriptionStyles}>{description}</p>\n\t\t</Box>\n\t);\n}\n\nconst subSectionHeaderStyles = xcss({\n\tmarginTop: 'space.400',\n\ttextAlign: 'center',\n});\n\nconst subSectionHeaderTitleStyles = css({\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tfont: token('font.heading.large', fontFallback.heading.large),\n\tfontWeight: token('font.weight.bold', 'bold'),\n});\n\nconst subSectionHeaderDescriptionStyles = css({\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tfont: token('font.body.large', fontFallback.body.large),\n\tfontWeight: token('font.weight.medium', 'medium'),\n\tcolor: token('color.text.subtle', 'currentColor'),\n\tmaxWidth: '70ch',\n\tmarginInline: 'auto',\n});\n\nfunction SubSectionHeader({ title, description }: { title: ReactNode; description: ReactNode }) {\n\treturn (\n\t\t<Box xcss={subSectionHeaderStyles}>\n\t\t\t<h3 css={subSectionHeaderTitleStyles}>{title}</h3>\n\t\t\t<p css={subSectionHeaderDescriptionStyles}>{description}</p>\n\t\t</Box>\n\t);\n}\n\nconst containerStyles = xcss({\n\t// same as grid spacing\n\t// padding: 'space.400',\n});\n\nconst gridItem = {\n\tdefault: {\n\t\tspan: { md: 12, lg: 8 },\n\t\tcenterStart: { md: 1, lg: 3 },\n\t},\n} as const;\n\nconst smallGridItemSpan = { sm: 12, md: 6 } as const;\n\nconst tabPanelStyles = css({\n\tmarginTop: 16,\n\twidth: '100%',\n});\n\nfunction TabPanel({ children, ...props }: TabPanelProps) {\n\treturn (\n\t\t<AkTabPanel {...props}>\n\t\t\t<div css={tabPanelStyles}>{children}</div>\n\t\t</AkTabPanel>\n\t);\n}\n\nexport default function ListComparison(): React.JSX.Element {\n\t// TODO: figure out which breakpoints would be nicest\n\treturn (\n\t\t<Box xcss={containerStyles}>\n\t\t\t<Stack space=\"space.0\">\n\t\t\t\t<Section>\n\t\t\t\t\t<SectionHeader\n\t\t\t\t\t\ttitle=\"Current options\"\n\t\t\t\t\t\tdescription=\"These are the options available based on our current outputs and\n          guidelines\"\n\t\t\t\t\t/>\n\n\t\t\t\t\t<SubSectionHeader\n\t\t\t\t\t\ttitle={<Code>react-beautiful-dnd</Code>}\n\t\t\t\t\t\tdescription=\"The drag and drop library currently being used.\"\n\t\t\t\t\t/>\n\n\t\t\t\t\t<Grid>\n\t\t\t\t\t\t<GridItem span={gridItem.default.span} start={gridItem.default.centerStart}>\n\t\t\t\t\t\t\t<Item borderColor={token('color.border.accent.magenta', 'magenta')}>\n\t\t\t\t\t\t\t\t<ItemPreview>\n\t\t\t\t\t\t\t\t\t<PinnedFieldReactBeautifulDnd />\n\t\t\t\t\t\t\t\t\t<SubtaskReactBeautifulDnd />\n\t\t\t\t\t\t\t\t</ItemPreview>\n\t\t\t\t\t\t\t\t<ItemCaption\n\t\t\t\t\t\t\t\t\ttitle={'Existing experience'}\n\t\t\t\t\t\t\t\t\tpoweredBy=\"rbd\"\n\t\t\t\t\t\t\t\t\taccessibility={\n\t\t\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t\t\tLeverages directional keyboard movements.{' '}\n\t\t\t\t\t\t\t\t\t\t\t{/* eslint-disable-next-line @atlaskit/design-system/no-html-anchor */}\n\t\t\t\t\t\t\t\t\t\t\t<a href=\"https://youtu.be/5SQkOyzZLHM?t=2223\">\n\t\t\t\t\t\t\t\t\t\t\t\tThis approach is a good stepping stone, but not ideal\n\t\t\t\t\t\t\t\t\t\t\t</a>\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</Item>\n\t\t\t\t\t\t</GridItem>\n\t\t\t\t\t</Grid>\n\n\t\t\t\t\t<SubSectionHeader\n\t\t\t\t\t\ttitle={\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t<Code>react-beautiful-dnd</Code> → Migration layer →{' '}\n\t\t\t\t\t\t\t\t<Code>pragmatic-drag-and-drop</Code>\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdescription={\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\tThe migration layer allows for a safe and automatic upgrade path from{' '}\n\t\t\t\t\t\t\t\t<Code>react-beautiful-dnd</Code> to <Code>pragmatic-drag-and-drop</Code> but needs\n\t\t\t\t\t\t\t\tto make some additional compromises.\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\n\t\t\t\t\t<Grid>\n\t\t\t\t\t\t<GridItem span={gridItem.default.span} start={gridItem.default.centerStart}>\n\t\t\t\t\t\t\t<Tabs id=\"default\">\n\t\t\t\t\t\t\t\t<TabList>\n\t\t\t\t\t\t\t\t\t<Tab>Basic</Tab>\n\t\t\t\t\t\t\t\t\t<Tab>Variant: subtle</Tab>\n\t\t\t\t\t\t\t\t\t<Tab>Variant: subtler</Tab>\n\t\t\t\t\t\t\t\t</TabList>\n\t\t\t\t\t\t\t\t<TabPanel>\n\t\t\t\t\t\t\t\t\t<Item>\n\t\t\t\t\t\t\t\t\t\t<ItemPreview>\n\t\t\t\t\t\t\t\t\t\t\t<PinnedFieldsMigrationLayer />\n\t\t\t\t\t\t\t\t\t\t\t<SubtasksMigrationLayer />\n\t\t\t\t\t\t\t\t\t\t</ItemPreview>\n\t\t\t\t\t\t\t\t\t\t<ItemCaption\n\t\t\t\t\t\t\t\t\t\t\ttitle=\"Migration layer\"\n\t\t\t\t\t\t\t\t\t\t\tpoweredBy=\"pdnd\"\n\t\t\t\t\t\t\t\t\t\t\taccessibility={\n\t\t\t\t\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t\t\t\t\tSame as <Code>react-beautiful-dnd</Code>\n\t\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tother={\n\t\t\t\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tThe blue background and border visible while dragging pinned fields is{' '}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<strong>not</strong> added by the migration layer. It is custom styling\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tadded in Jira and can be freely modified. Variations on this styling are\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tprovided for reference.\n\t\t\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tNote that the small padding on the subtask container has been removed.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tThis ensures that the drop indicator is flush against the edge at the\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttop and bottom.\n\t\t\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</Item>\n\t\t\t\t\t\t\t\t</TabPanel>\n\t\t\t\t\t\t\t\t<TabPanel>\n\t\t\t\t\t\t\t\t\t<Item>\n\t\t\t\t\t\t\t\t\t\t<ItemPreview>\n\t\t\t\t\t\t\t\t\t\t\t<PinnedFieldReactBeautifulDndNoDraggingOutline />\n\t\t\t\t\t\t\t\t\t\t</ItemPreview>\n\t\t\t\t\t\t\t\t\t\t<ItemCaption\n\t\t\t\t\t\t\t\t\t\t\ttitle=\"Migration layer (subtle variant)\"\n\t\t\t\t\t\t\t\t\t\t\tpoweredBy=\"pdnd\"\n\t\t\t\t\t\t\t\t\t\t\taccessibility={\n\t\t\t\t\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t\t\t\t\tSame as <Code>react-beautiful-dnd</Code>\n\t\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tother={\n\t\t\t\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t\t\t\tThis variant removes the blue border that was visible while dragging.\n\t\t\t\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</Item>\n\t\t\t\t\t\t\t\t</TabPanel>\n\t\t\t\t\t\t\t\t<TabPanel>\n\t\t\t\t\t\t\t\t\t<Item>\n\t\t\t\t\t\t\t\t\t\t<ItemPreview>\n\t\t\t\t\t\t\t\t\t\t\t<PinnedFieldReactBeautifulDndSubtle />\n\t\t\t\t\t\t\t\t\t\t</ItemPreview>\n\t\t\t\t\t\t\t\t\t\t<ItemCaption\n\t\t\t\t\t\t\t\t\t\t\ttitle=\"Migration layer (subtler variant)\"\n\t\t\t\t\t\t\t\t\t\t\tpoweredBy=\"pdnd\"\n\t\t\t\t\t\t\t\t\t\t\taccessibility={\n\t\t\t\t\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\t\t\t\t\tSame as <Code>react-beautiful-dnd</Code>\n\t\t\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tother={\n\t\t\t\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t\t\t\tThis variant also makes the blue background that was visible while\n\t\t\t\t\t\t\t\t\t\t\t\t\tdragging subtler.\n\t\t\t\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</Item>\n\t\t\t\t\t\t\t\t</TabPanel>\n\t\t\t\t\t\t\t</Tabs>\n\t\t\t\t\t\t</GridItem>\n\t\t\t\t\t</Grid>\n\n\t\t\t\t\t<SubSectionHeader\n\t\t\t\t\t\ttitle=\"Manual migration\"\n\t\t\t\t\t\tdescription=\"These are examples of a manual migration using our current drag and drop visual guidelines\"\n\t\t\t\t\t/>\n\n\t\t\t\t\t<Grid>\n\t\t\t\t\t\t<GridItem span={gridItem.default.span} start={gridItem.default.centerStart}>\n\t\t\t\t\t\t\t<Tabs id=\"manual-migration\">\n\t\t\t\t\t\t\t\t<TabList>\n\t\t\t\t\t\t\t\t\t<Tab>Simplified</Tab>\n\t\t\t\t\t\t\t\t\t<Tab>Accessibility: always visible</Tab>\n\t\t\t\t\t\t\t\t\t<Tab>Accessibility: visible on focus</Tab>\n\t\t\t\t\t\t\t\t</TabList>\n\t\t\t\t\t\t\t\t<TabPanel>\n\t\t\t\t\t\t\t\t\t<Item>\n\t\t\t\t\t\t\t\t\t\t<ItemPreview>\n\t\t\t\t\t\t\t\t\t\t\t<PinnedFieldsWithCurrentGuidelines />\n\t\t\t\t\t\t\t\t\t\t\t<SubtaskCurrentGuidelines />\n\t\t\t\t\t\t\t\t\t\t</ItemPreview>\n\t\t\t\t\t\t\t\t\t\t<ItemCaption\n\t\t\t\t\t\t\t\t\t\t\ttitle=\"Current guidelines\"\n\t\t\t\t\t\t\t\t\t\t\tpoweredBy=\"pdnd\"\n\t\t\t\t\t\t\t\t\t\t\taccessibility=\"Not wired up for this example. See following examples to see accessibility options\"\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</Item>\n\t\t\t\t\t\t\t\t</TabPanel>\n\t\t\t\t\t\t\t\t<TabPanel>\n\t\t\t\t\t\t\t\t\t<Item>\n\t\t\t\t\t\t\t\t\t\t<ItemPreview>\n\t\t\t\t\t\t\t\t\t\t\t<PinnedFieldsWithCurrentGuidelinesA11yAlwaysVisible />\n\t\t\t\t\t\t\t\t\t\t\t<SubtasksCurrentGuidelinesA11yAlwaysVisible />\n\t\t\t\t\t\t\t\t\t\t</ItemPreview>\n\t\t\t\t\t\t\t\t\t\t<ItemCaption\n\t\t\t\t\t\t\t\t\t\t\ttitle=\"Current guidelines with visible action menu\"\n\t\t\t\t\t\t\t\t\t\t\tpoweredBy=\"pdnd\"\n\t\t\t\t\t\t\t\t\t\t\taccessibility={\n\t\t\t\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t\t\t\tA visible menu button is used to trigger all possible actions\n\t\t\t\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tother={\n\t\t\t\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t\t\t\tDuring user testing it was found that using menus had superior\n\t\t\t\t\t\t\t\t\t\t\t\t\taccessibility characteristics to the <Code>react-beautiful-dnd</Code>{' '}\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyle keyboard controls. The action menu pattern is also cheap and more\n\t\t\t\t\t\t\t\t\t\t\t\t\tflexible.\n\t\t\t\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</Item>\n\t\t\t\t\t\t\t\t</TabPanel>\n\t\t\t\t\t\t\t\t<TabPanel>\n\t\t\t\t\t\t\t\t\t<Item>\n\t\t\t\t\t\t\t\t\t\t<ItemPreview>\n\t\t\t\t\t\t\t\t\t\t\t<PinnedFieldsWithCurrentGuidelinesA11yKeyboardOnly />\n\t\t\t\t\t\t\t\t\t\t\t<SubtasksCurrentGuidelinesA11yKeyboardOnly />\n\t\t\t\t\t\t\t\t\t\t</ItemPreview>\n\t\t\t\t\t\t\t\t\t\t<ItemCaption\n\t\t\t\t\t\t\t\t\t\t\ttitle=\"Current guidelines with on-focus three dots\"\n\t\t\t\t\t\t\t\t\t\t\tpoweredBy=\"pdnd\"\n\t\t\t\t\t\t\t\t\t\t\taccessibility={\n\t\t\t\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t\t\t\tAn action menu button is only visible when a draggable item receives\n\t\t\t\t\t\t\t\t\t\t\t\t\tfocus. This has the same great accessibility as always having the action\n\t\t\t\t\t\t\t\t\t\t\t\t\tmenu button always visible, but does not clutter the interface\n\t\t\t\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t</Item>\n\t\t\t\t\t\t\t\t</TabPanel>\n\t\t\t\t\t\t\t</Tabs>\n\t\t\t\t\t\t</GridItem>\n\t\t\t\t\t</Grid>\n\t\t\t\t</Section>\n\n\t\t\t\t<Section backgroundColor={token('color.background.success', '')}>\n\t\t\t\t\t<SectionHeader\n\t\t\t\t\t\telementBefore={\n\t\t\t\t\t\t\t<Lozenge appearance=\"success\" isBold>\n\t\t\t\t\t\t\t\tOur recommendation\n\t\t\t\t\t\t\t</Lozenge>\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttitle=\"Evolving our guidelines\"\n\t\t\t\t\t\tdescription=\"Exploring how we can evolve our current outputs and guidelines\"\n\t\t\t\t\t/>\n\n\t\t\t\t\t<Grid>\n\t\t\t\t\t\t<GridItem span={gridItem.default.span} start={gridItem.default.centerStart}>\n\t\t\t\t\t\t\t<Item borderColor={token('color.border.success', undefined)}>\n\t\t\t\t\t\t\t\t<ItemPreview>\n\t\t\t\t\t\t\t\t\t{/* <PinnedFieldsEnhancedDragHandleHidden /> */}\n\t\t\t\t\t\t\t\t\t{/* <PinnedFieldsPdndEnhanced /> */}\n\t\t\t\t\t\t\t\t\t<PinnedFieldsEnhancedDragHandle />\n\t\t\t\t\t\t\t\t\t<SubtaskEnhanced />\n\t\t\t\t\t\t\t\t</ItemPreview>\n\t\t\t\t\t\t\t\t<ItemCaption\n\t\t\t\t\t\t\t\t\ttitle=\"Ideas for variation\"\n\t\t\t\t\t\t\t\t\tpoweredBy=\"pdnd\"\n\t\t\t\t\t\t\t\t\taccessibility={\n\t\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\tThe drag handle also functions as a menu button which is used for\n\t\t\t\t\t\t\t\t\t\t\t\taccessibility.\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t\t\t\tDragging from the drag handle will initiate a drag and drop operation.\n\t\t\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t\t\t\tClicking the drag handle will open a dropdown menu which provides an\n\t\t\t\t\t\t\t\t\t\t\t\t\talternative flow for reordering.\n\t\t\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tother={\n\t\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t\t<p>This example introduces a few affordances for improving the experience:</p>\n\t\t\t\t\t\t\t\t\t\t\t{/* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 */}\n\t\t\t\t\t\t\t\t\t\t\t<table style={{ tableLayout: 'fixed' }}>\n\t\t\t\t\t\t\t\t\t\t\t\t<thead>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{/* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 */}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<th style={{ width: '33.3%' }}>Affordance</th>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{/* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 */}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<th style={{ width: '33.3%' }}>Effect</th>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{/* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 */}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<th style={{ width: '33.3%' }}>Note(s)</th>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t\t\t\t\t\t\t<tbody\n\t\t\t\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage\n\t\t\t\t\t\t\t\t\t\t\t\t\tcss={{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'> tr:nth-of-type(2n)': {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbackground: token('color.background.neutral', ''),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td>Adding a drag handle</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li>Indicates the item is draggable</li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li>Doubles as a menu button for accessibility</li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFor this example, we have changed the drag handle icon on subtasks.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFlashing selected background color on drop (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Code>color.background.selected</Code>)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td>Highlights which item was dropped</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td>Inspired by Linear</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAdding a terminal to the drop indicator, that sticks out past the item\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td>Improves the visibility of the drop indicator</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td></td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tUsing a condensed representation of the item as a preview while\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdragging\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li>Improves the visibility of the drop indicator</li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<li>Generally avoids large items from obscuring the screen</li>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tThe exact representation used for the preview would be an app decision\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t\t\t\t\t\t</table>\n\t\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</Item>\n\t\t\t\t\t\t</GridItem>\n\t\t\t\t\t</Grid>\n\t\t\t\t</Section>\n\n\t\t\t\t<Section>\n\t\t\t\t\t<SectionHeader\n\t\t\t\t\t\ttitle=\"Clones\"\n\t\t\t\t\t\tdescription={\n\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\tUsing <Code>pragmatic-drag-and-drop</Code> to power completely alternative\n\t\t\t\t\t\t\t\texperiences.\n\t\t\t\t\t\t\t\t<br />\n\t\t\t\t\t\t\t\tThis is to demonstrate the flexibility that <Code>\n\t\t\t\t\t\t\t\t\tpragmatic-drag-and-drop\n\t\t\t\t\t\t\t\t</Code>{' '}\n\t\t\t\t\t\t\t\tgives us.\n\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<Grid>\n\t\t\t\t\t\t<GridItem span={smallGridItemSpan}>\n\t\t\t\t\t\t\t<Item>\n\t\t\t\t\t\t\t\t<ItemPreview>\n\t\t\t\t\t\t\t\t\t<AsanaFields />\n\t\t\t\t\t\t\t\t</ItemPreview>\n\t\t\t\t\t\t\t\t<ItemCaption\n\t\t\t\t\t\t\t\t\ttitle=\"Clone: Asana (custom preview)\"\n\t\t\t\t\t\t\t\t\tpoweredBy=\"pdnd\"\n\t\t\t\t\t\t\t\t\taccessibility=\"🚫 Asana's field reordering does not seem to be accessible.\"\n\t\t\t\t\t\t\t\t\tother={\n\t\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\tThis variation uses a custom drag preview that closely mirrors that of the\n\t\t\t\t\t\t\t\t\t\t\t\treal Asana field reordering.\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t<p>A custom drag preview increases control over the look and feel.</p>\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\tThe use of a custom drag preview here allows it to be completely detached\n\t\t\t\t\t\t\t\t\t\t\t\tfrom the user's pointer. You can see this if you drag from the right edge of\n\t\t\t\t\t\t\t\t\t\t\t\ta field.\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</Item>\n\t\t\t\t\t\t</GridItem>\n\t\t\t\t\t\t<GridItem span={smallGridItemSpan}>\n\t\t\t\t\t\t\t<Item>\n\t\t\t\t\t\t\t\t<ItemPreview>\n\t\t\t\t\t\t\t\t\t<AsanaFieldsWithNativePreview />\n\t\t\t\t\t\t\t\t</ItemPreview>\n\t\t\t\t\t\t\t\t<ItemCaption\n\t\t\t\t\t\t\t\t\ttitle=\"Clone: Asana (native preview)\"\n\t\t\t\t\t\t\t\t\tpoweredBy=\"pdnd\"\n\t\t\t\t\t\t\t\t\taccessibility=\"🚫 Asana's field reordering does not seem to be accessible.\"\n\t\t\t\t\t\t\t\t\tother={\n\t\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\tThis variation uses a native drag preview and less closely resembles Asana.\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t<p>A native drag preview takes away some control. The browser will:</p>\n\t\t\t\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t\t\t\t<li>Add transparency</li>\n\t\t\t\t\t\t\t\t\t\t\t\t<li>Add a drop shadow</li>\n\t\t\t\t\t\t\t\t\t\t\t\t<li>Move the preview so it is connected to the user's pointer</li>\n\t\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</Item>\n\t\t\t\t\t\t</GridItem>\n\t\t\t\t\t\t<GridItem span={smallGridItemSpan}>\n\t\t\t\t\t\t\t<Item>\n\t\t\t\t\t\t\t\t<ItemPreview>\n\t\t\t\t\t\t\t\t\t<LinearTaskReordering />\n\t\t\t\t\t\t\t\t</ItemPreview>\n\t\t\t\t\t\t\t\t<ItemCaption\n\t\t\t\t\t\t\t\t\ttitle=\"Clone: Linear (custom preview)\"\n\t\t\t\t\t\t\t\t\tpoweredBy=\"pdnd\"\n\t\t\t\t\t\t\t\t\taccessibility={\n\t\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\tLinear provides custom keyboard controls to reorder tasks (\n\t\t\t\t\t\t\t\t\t\t\t\t<Code>⌥ Option</Code> + arrow keys). The accessibility of this is\n\t\t\t\t\t\t\t\t\t\t\t\tquestionable, as there are no instructions for it.\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t<p>These keyboard controls have not been implemented.</p>\n\t\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tother={\n\t\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\tThis clone of Linear uses custom drag previews. Linear's drag previews have\n\t\t\t\t\t\t\t\t\t\t\t\tsome interesting properties:\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t\t\t\t<li>They are much smaller than the draggable source</li>\n\t\t\t\t\t\t\t\t\t\t\t\t<li>They appear in a position that overlays the draggable source</li>\n\t\t\t\t\t\t\t\t\t\t\t\t<li>\n\t\t\t\t\t\t\t\t\t\t\t\t\tThey will slide to under the user's pointer if they are not at the start\n\t\t\t\t\t\t\t\t\t\t\t\t</li>\n\t\t\t\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</Item>\n\t\t\t\t\t\t</GridItem>\n\n\t\t\t\t\t\t<GridItem span={smallGridItemSpan}>\n\t\t\t\t\t\t\t<Item>\n\t\t\t\t\t\t\t\t<ItemPreview>\n\t\t\t\t\t\t\t\t\t<LinearTaskReorderingNativePreview />\n\t\t\t\t\t\t\t\t</ItemPreview>\n\t\t\t\t\t\t\t\t<ItemCaption\n\t\t\t\t\t\t\t\t\ttitle=\"Clone: Linear (native preview)\"\n\t\t\t\t\t\t\t\t\tpoweredBy=\"pdnd\"\n\t\t\t\t\t\t\t\t\taccessibility={\n\t\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\tLinear provides custom keyboard controls to reorder tasks (\n\t\t\t\t\t\t\t\t\t\t\t\t<Code>⌥ Option</Code> + arrow keys). The accessibility of this is\n\t\t\t\t\t\t\t\t\t\t\t\tquestionable, as there are no instructions for it.\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t\t<p>These keyboard controls have not been implemented.</p>\n\t\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tother={\n\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\tThis variation uses a native drag preview. There is less control over the drag\n\t\t\t\t\t\t\t\t\t\t\tpreview, but it is much easier to achieve and performs more smoothly.\n\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</Item>\n\t\t\t\t\t\t</GridItem>\n\n\t\t\t\t\t\t<GridItem span={smallGridItemSpan} start={{ sm: 1, md: 4 }}>\n\t\t\t\t\t\t\t<Item hasTransparentBackground>\n\t\t\t\t\t\t\t\t<ItemPreview>\n\t\t\t\t\t\t\t\t\t<SubtasksNotion />\n\t\t\t\t\t\t\t\t</ItemPreview>\n\t\t\t\t\t\t\t\t<ItemCaption\n\t\t\t\t\t\t\t\t\ttitle=\"Clone: Notion\"\n\t\t\t\t\t\t\t\t\tpoweredBy=\"pdnd\"\n\t\t\t\t\t\t\t\t\taccessibility=\"🚫 Notion's task reordering does not seem to be accessible.\"\n\t\t\t\t\t\t\t\t\tother={\n\t\t\t\t\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\t\t\t\t\tInterestingly Notion uses a native preview and applies{' '}\n\t\t\t\t\t\t\t\t\t\t\t\t<strong>extra</strong> transparency to it.\n\t\t\t\t\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</Item>\n\t\t\t\t\t\t</GridItem>\n\t\t\t\t\t</Grid>\n\t\t\t\t</Section>\n\t\t\t</Stack>\n\t\t</Box>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/list.tsx",
    "content": "import React, {\n\tcreateContext,\n\tFragment,\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from 'react';\n\nimport ReactDOM from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport Avatar from '@atlaskit/avatar';\nimport Badge from '@atlaskit/badge';\nimport DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';\n// eslint-disable-next-line @atlaskit/design-system/no-banned-imports\nimport mergeRefs from '@atlaskit/ds-lib/merge-refs';\nimport Lozenge from '@atlaskit/lozenge';\nimport { triggerPostMoveFlash } from '@atlaskit/pragmatic-drag-and-drop-flourish/trigger-post-move-flash';\nimport {\n\tattachClosestEdge,\n\ttype Edge,\n\textractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { getReorderDestinationIndex } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index';\nimport * as liveRegion from '@atlaskit/pragmatic-drag-and-drop-live-region';\nimport { DragHandleButton } from '@atlaskit/pragmatic-drag-and-drop-react-accessibility/drag-handle-button';\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\ttype ElementDropTargetEventBasePayload,\n\tmonitorForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\nimport { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Grid, Inline, Stack, xcss } from '@atlaskit/primitives';\nimport { token } from '@atlaskit/tokens';\n\ntype ItemPosition = 'first' | 'last' | 'middle' | 'only';\n\ntype CleanupFn = () => void;\n\ntype ItemEntry = { itemId: string; element: HTMLElement };\n\ntype ListContextValue = {\n\tgetListLength: () => number;\n\tregisterItem: (entry: ItemEntry) => CleanupFn;\n\treorderItem: (args: {\n\t\tstartIndex: number;\n\t\tindexOfTarget: number;\n\t\tclosestEdgeOfTarget: Edge | null;\n\t}) => void;\n\tinstanceId: symbol;\n};\n\nconst ListContext = createContext<ListContextValue | null>(null);\n\nfunction useListContext() {\n\tconst listContext = useContext(ListContext);\n\tinvariant(listContext !== null);\n\treturn listContext;\n}\n\ntype Item = {\n\tid: string;\n\tlabel: string;\n};\n\nconst itemKey = Symbol('item');\ntype ItemData = {\n\t[itemKey]: true;\n\titem: Item;\n\tindex: number;\n\tinstanceId: symbol;\n};\n\nfunction getItemData({\n\titem,\n\tindex,\n\tinstanceId,\n}: {\n\titem: Item;\n\tindex: number;\n\tinstanceId: symbol;\n}): ItemData {\n\treturn {\n\t\t[itemKey]: true,\n\t\titem,\n\t\tindex,\n\t\tinstanceId,\n\t};\n}\n\nfunction isItemData(data: Record<string | symbol, unknown>): data is ItemData {\n\treturn data[itemKey] === true;\n}\n\nfunction getItemPosition({ index, items }: { index: number; items: Item[] }): ItemPosition {\n\tif (items.length === 1) {\n\t\treturn 'only';\n\t}\n\n\tif (index === 0) {\n\t\treturn 'first';\n\t}\n\n\tif (index === items.length - 1) {\n\t\treturn 'last';\n\t}\n\n\treturn 'middle';\n}\n\nconst listItemContainerStyles = xcss({\n\tposition: 'relative',\n\tbackgroundColor: 'elevation.surface',\n\tborderWidth: '0',\n\tborderBottomWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':last-of-type': {\n\t\tborderWidth: '0',\n\t},\n});\n\nconst listItemStyles = xcss({\n\tposition: 'relative',\n\tpadding: 'space.100',\n});\n\nconst listItemDisabledStyles = xcss({ opacity: 0.4 });\n\ntype DraggableState =\n\t| { type: 'idle' }\n\t| { type: 'preview'; container: HTMLElement }\n\t| { type: 'dragging' };\n\nconst idleState: DraggableState = { type: 'idle' };\nconst draggingState: DraggableState = { type: 'dragging' };\n\nconst listItemPreviewStyles = xcss({\n\tpaddingBlock: 'space.050',\n\tpaddingInline: 'space.100',\n\tborderRadius: 'radius.small',\n\tbackgroundColor: 'elevation.surface.overlay',\n\tmaxWidth: '360px',\n\twhiteSpace: 'nowrap',\n\toverflow: 'hidden',\n\ttextOverflow: 'ellipsis',\n});\n\nconst itemLabelStyles = xcss({\n\tflexGrow: 1,\n\twhiteSpace: 'nowrap',\n\ttextOverflow: 'ellipsis',\n\toverflow: 'hidden',\n});\n\nfunction DropDownContent({ position, index }: { position: ItemPosition; index: number }) {\n\tconst { reorderItem, getListLength } = useListContext();\n\n\tconst isMoveUpDisabled = position === 'first' || position === 'only';\n\tconst isMoveDownDisabled = position === 'last' || position === 'only';\n\n\tconst moveToTop = useCallback(() => {\n\t\treorderItem({\n\t\t\tstartIndex: index,\n\t\t\tindexOfTarget: 0,\n\t\t\tclosestEdgeOfTarget: null,\n\t\t});\n\t}, [index, reorderItem]);\n\n\tconst moveUp = useCallback(() => {\n\t\treorderItem({\n\t\t\tstartIndex: index,\n\t\t\tindexOfTarget: index - 1,\n\t\t\tclosestEdgeOfTarget: null,\n\t\t});\n\t}, [index, reorderItem]);\n\n\tconst moveDown = useCallback(() => {\n\t\treorderItem({\n\t\t\tstartIndex: index,\n\t\t\tindexOfTarget: index + 1,\n\t\t\tclosestEdgeOfTarget: null,\n\t\t});\n\t}, [index, reorderItem]);\n\n\tconst moveToBottom = useCallback(() => {\n\t\treorderItem({\n\t\t\tstartIndex: index,\n\t\t\tindexOfTarget: getListLength() - 1,\n\t\t\tclosestEdgeOfTarget: null,\n\t\t});\n\t}, [index, getListLength, reorderItem]);\n\n\treturn (\n\t\t<DropdownItemGroup>\n\t\t\t<DropdownItem onClick={moveToTop} isDisabled={isMoveUpDisabled}>\n\t\t\t\tMove to top\n\t\t\t</DropdownItem>\n\t\t\t<DropdownItem onClick={moveUp} isDisabled={isMoveUpDisabled}>\n\t\t\t\tMove up\n\t\t\t</DropdownItem>\n\t\t\t<DropdownItem onClick={moveDown} isDisabled={isMoveDownDisabled}>\n\t\t\t\tMove down\n\t\t\t</DropdownItem>\n\t\t\t<DropdownItem onClick={moveToBottom} isDisabled={isMoveDownDisabled}>\n\t\t\t\tMove to bottom\n\t\t\t</DropdownItem>\n\t\t</DropdownItemGroup>\n\t);\n}\n\nfunction ListItem({\n\titem,\n\tindex,\n\tposition,\n}: {\n\titem: Item;\n\tindex: number;\n\tposition: ItemPosition;\n}) {\n\tconst { registerItem, instanceId } = useListContext();\n\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst dragHandleRef = useRef<HTMLButtonElement>(null);\n\n\tconst [draggableState, setDraggableState] = useState<DraggableState>(idleState);\n\tconst [closestEdge, setClosestEdge] = useState<Edge | null>(null);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tconst dragHandle = dragHandleRef.current;\n\t\tinvariant(element);\n\t\tinvariant(dragHandle);\n\n\t\tconst data = getItemData({ item, index, instanceId });\n\n\t\tfunction onChange({ source, self }: ElementDropTargetEventBasePayload) {\n\t\t\tconst isSource = source.element === dragHandle;\n\t\t\tif (isSource) {\n\t\t\t\tsetClosestEdge(null);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst closestEdge = extractClosestEdge(self.data);\n\n\t\t\tconst sourceIndex = source.data.index;\n\t\t\tinvariant(typeof sourceIndex === 'number');\n\n\t\t\tconst isItemBeforeSource = index === sourceIndex - 1;\n\t\t\tconst isItemAfterSource = index === sourceIndex + 1;\n\n\t\t\tconst isDropIndicatorHidden =\n\t\t\t\t(isItemBeforeSource && closestEdge === 'bottom') ||\n\t\t\t\t(isItemAfterSource && closestEdge === 'top');\n\n\t\t\tif (isDropIndicatorHidden) {\n\t\t\t\tsetClosestEdge(null);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetClosestEdge(closestEdge);\n\t\t}\n\n\t\treturn combine(\n\t\t\tregisterItem({ itemId: item.id, element }),\n\t\t\tdraggable({\n\t\t\t\telement: dragHandle,\n\t\t\t\tgetInitialData: () => data,\n\t\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\t\tgetOffset: pointerOutsideOfPreview({\n\t\t\t\t\t\t\tx: token('space.200', '16px'),\n\t\t\t\t\t\t\ty: token('space.100', '8px'),\n\t\t\t\t\t\t}),\n\t\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\t\tsetDraggableState({ type: 'preview', container });\n\n\t\t\t\t\t\t\treturn () => setDraggableState(draggingState);\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragStart() {\n\t\t\t\t\tsetDraggableState(draggingState);\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tsetDraggableState(idleState);\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement,\n\t\t\t\tcanDrop({ source }) {\n\t\t\t\t\treturn isItemData(source.data) && source.data.instanceId === instanceId;\n\t\t\t\t},\n\t\t\t\tgetData({ input }) {\n\t\t\t\t\treturn attachClosestEdge(data, {\n\t\t\t\t\t\telement,\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tallowedEdges: ['top', 'bottom'],\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragEnter: onChange,\n\t\t\t\tonDrag: onChange,\n\t\t\t\tonDragLeave() {\n\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [instanceId, item, index, registerItem]);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<Box ref={ref} xcss={listItemContainerStyles}>\n\t\t\t\t<Grid\n\t\t\t\t\talignItems=\"center\"\n\t\t\t\t\tcolumnGap=\"space.050\"\n\t\t\t\t\ttemplateColumns=\"auto 1fr auto\"\n\t\t\t\t\txcss={[\n\t\t\t\t\t\tlistItemStyles,\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * We are applying the disabled effect to the inner element so that\n\t\t\t\t\t\t * the border and drop indicator are not affected.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tdraggableState.type === 'dragging' && listItemDisabledStyles,\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\ttrigger={({ triggerRef, ...triggerProps }) => (\n\t\t\t\t\t\t\t<DragHandleButton\n\t\t\t\t\t\t\t\tref={mergeRefs([dragHandleRef, triggerRef])}\n\t\t\t\t\t\t\t\t{...triggerProps}\n\t\t\t\t\t\t\t\tlabel={`Reorder ${item.label}`}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tshouldRenderToParent\n\t\t\t\t\t>\n\t\t\t\t\t\t<DropdownItemGroup>\n\t\t\t\t\t\t\t<DropDownContent position={position} index={index} />\n\t\t\t\t\t\t</DropdownItemGroup>\n\t\t\t\t\t</DropdownMenu>\n\t\t\t\t\t<Box xcss={itemLabelStyles}>{item.label}</Box>\n\t\t\t\t\t<Inline alignBlock=\"center\" space=\"space.100\">\n\t\t\t\t\t\t<Badge>{1}</Badge>\n\t\t\t\t\t\t<Avatar size=\"small\" />\n\t\t\t\t\t\t<Lozenge>Todo</Lozenge>\n\t\t\t\t\t</Inline>\n\t\t\t\t</Grid>\n\t\t\t\t{closestEdge && <DropIndicator edge={closestEdge} gap=\"1px\" />}\n\t\t\t</Box>\n\t\t\t{draggableState.type === 'preview' &&\n\t\t\t\tReactDOM.createPortal(\n\t\t\t\t\t<Box xcss={listItemPreviewStyles}>{item.label}</Box>,\n\t\t\t\t\tdraggableState.container,\n\t\t\t\t)}\n\t\t</Fragment>\n\t);\n}\n\nconst defaultItems: Item[] = [\n\t{\n\t\tid: 'task-1',\n\t\tlabel: 'Organize a team-building event',\n\t},\n\t{\n\t\tid: 'task-2',\n\t\tlabel: 'Create and maintain office inventory',\n\t},\n\t{\n\t\tid: 'task-3',\n\t\tlabel: 'Update company website content',\n\t},\n\t{\n\t\tid: 'task-4',\n\t\tlabel: 'Plan and execute marketing campaigns',\n\t},\n\t{\n\t\tid: 'task-5',\n\t\tlabel: 'Coordinate employee training sessions',\n\t},\n\t{\n\t\tid: 'task-6',\n\t\tlabel: 'Manage facility maintenance',\n\t},\n\t{\n\t\tid: 'task-7',\n\t\tlabel: 'Organize customer feedback surveys',\n\t},\n\t{\n\t\tid: 'task-8',\n\t\tlabel: 'Coordinate travel arrangements',\n\t},\n];\n\nconst containerStyles = xcss({\n\tmaxWidth: '400px',\n\tborderWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border',\n});\n\nfunction getItemRegistry() {\n\tconst registry = new Map<string, HTMLElement>();\n\n\tfunction register({ itemId, element }: ItemEntry) {\n\t\tregistry.set(itemId, element);\n\n\t\treturn function unregister() {\n\t\t\tregistry.delete(itemId);\n\t\t};\n\t}\n\n\tfunction getElement(itemId: string): HTMLElement | null {\n\t\treturn registry.get(itemId) ?? null;\n\t}\n\n\treturn { register, getElement };\n}\n\ntype ListState = {\n\titems: Item[];\n\tlastCardMoved: {\n\t\titem: Item;\n\t\tpreviousIndex: number;\n\t\tcurrentIndex: number;\n\t\tnumberOfItems: number;\n\t} | null;\n};\n\nexport default function ListExample(): React.JSX.Element {\n\tconst [{ items, lastCardMoved }, setListState] = useState<ListState>({\n\t\titems: defaultItems,\n\t\tlastCardMoved: null,\n\t});\n\tconst [registry] = useState(getItemRegistry);\n\n\t// Isolated instances of this component from one another\n\tconst [instanceId] = useState(() => Symbol('instance-id'));\n\n\tconst reorderItem = useCallback(\n\t\t({\n\t\t\tstartIndex,\n\t\t\tindexOfTarget,\n\t\t\tclosestEdgeOfTarget,\n\t\t}: {\n\t\t\tstartIndex: number;\n\t\t\tindexOfTarget: number;\n\t\t\tclosestEdgeOfTarget: Edge | null;\n\t\t}) => {\n\t\t\tconst finishIndex = getReorderDestinationIndex({\n\t\t\t\tstartIndex,\n\t\t\t\tclosestEdgeOfTarget,\n\t\t\t\tindexOfTarget,\n\t\t\t\taxis: 'vertical',\n\t\t\t});\n\n\t\t\tif (finishIndex === startIndex) {\n\t\t\t\t// If there would be no change, we skip the update\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetListState((listState) => {\n\t\t\t\tconst item = listState.items[startIndex];\n\n\t\t\t\treturn {\n\t\t\t\t\titems: reorder({\n\t\t\t\t\t\tlist: listState.items,\n\t\t\t\t\t\tstartIndex,\n\t\t\t\t\t\tfinishIndex,\n\t\t\t\t\t}),\n\t\t\t\t\tlastCardMoved: {\n\t\t\t\t\t\titem,\n\t\t\t\t\t\tpreviousIndex: startIndex,\n\t\t\t\t\t\tcurrentIndex: finishIndex,\n\t\t\t\t\t\tnumberOfItems: listState.items.length,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t});\n\t\t},\n\t\t[],\n\t);\n\n\tuseEffect(() => {\n\t\treturn monitorForElements({\n\t\t\tcanMonitor({ source }) {\n\t\t\t\treturn isItemData(source.data) && source.data.instanceId === instanceId;\n\t\t\t},\n\t\t\tonDrop({ location, source }) {\n\t\t\t\tconst target = location.current.dropTargets[0];\n\t\t\t\tif (!target) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst sourceData = source.data;\n\t\t\t\tconst targetData = target.data;\n\t\t\t\tif (!isItemData(sourceData) || !isItemData(targetData)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst indexOfTarget = items.findIndex((item) => item.id === targetData.item.id);\n\t\t\t\tif (indexOfTarget < 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst closestEdgeOfTarget = extractClosestEdge(targetData);\n\n\t\t\t\treorderItem({\n\t\t\t\t\tstartIndex: sourceData.index,\n\t\t\t\t\tindexOfTarget,\n\t\t\t\t\tclosestEdgeOfTarget,\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\t}, [instanceId, items, reorderItem]);\n\n\t// once a drag is finished, we have some post drop actions to take\n\tuseEffect(() => {\n\t\tif (lastCardMoved === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { item, previousIndex, currentIndex, numberOfItems } = lastCardMoved;\n\t\tconst element = registry.getElement(item.id);\n\t\tif (element) {\n\t\t\ttriggerPostMoveFlash(element);\n\t\t}\n\n\t\tliveRegion.announce(\n\t\t\t`You've moved ${item.label} from position ${\n\t\t\t\tpreviousIndex + 1\n\t\t\t} to position ${currentIndex + 1} of ${numberOfItems}.`,\n\t\t);\n\t}, [lastCardMoved, registry]);\n\n\t// cleanup the live region when this component is finished\n\tuseEffect(() => {\n\t\treturn function cleanup() {\n\t\t\tliveRegion.cleanup();\n\t\t};\n\t}, []);\n\n\tconst getListLength = useCallback(() => items.length, [items.length]);\n\n\tconst contextValue: ListContextValue = useMemo(() => {\n\t\treturn {\n\t\t\tregisterItem: registry.register,\n\t\t\treorderItem,\n\t\t\tinstanceId,\n\t\t\tgetListLength,\n\t\t};\n\t}, [registry.register, reorderItem, instanceId, getListLength]);\n\n\treturn (\n\t\t<ListContext.Provider value={contextValue}>\n\t\t\t<Stack xcss={containerStyles}>\n\t\t\t\t{/*\n          It is not expensive for us to pass `index` to items for this example,\n          as when reordering, only two items index will ever change.\n\n          If insertion or removal where allowed, it would be worth making\n          `index` a getter (eg `getIndex()`) to avoid re-rendering many items\n        */}\n\t\t\t\t{items.map((item, index) => (\n\t\t\t\t\t<ListItem\n\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\titem={item}\n\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\tposition={getItemPosition({ index, items })}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t</Stack>\n\t\t</ListContext.Provider>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/manual-focus-restoration.tsx",
    "content": "import React, {\n\tcreateContext,\n\ttype ReactNode,\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from 'react';\n\nimport invariant from 'tiny-invariant';\n\nimport Avatar from '@atlaskit/avatar';\nimport Button from '@atlaskit/button/new';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\tmonitorForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Inline, Stack, xcss } from '@atlaskit/primitives';\n\nconst teamAreaStyles = xcss({\n\t// backgroundColor: 'elevation.surface.sunken',\n\tborderWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border.accent.blue',\n\tborderRadius: 'radius.small',\n\theight: '240px',\n\twidth: '240px',\n\tpadding: 'space.300',\n});\n\ntype TeamId = 'blue' | 'red';\n\nconst teamAreaBorderColorStyles: Record<TeamId, ReturnType<typeof xcss>> = {\n\tblue: xcss({ borderColor: 'color.border.accent.blue' }),\n\tred: xcss({ borderColor: 'color.border.accent.red' }),\n};\n\nconst teamAreaLabelStyles = xcss({\n\tfontSize: '20px',\n\tfontWeight: 'font.weight.medium',\n});\n\nconst fullHeightStyles = xcss({ height: '100%' });\n\nfunction TeamArea({\n\tchildren,\n\tteamId,\n\tlabel,\n}: {\n\tchildren?: ReactNode;\n\tteamId: TeamId;\n\tlabel: string;\n}) {\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tuseEffect(() => {\n\t\tinvariant(ref.current);\n\t\treturn dropTargetForElements({\n\t\t\telement: ref.current,\n\t\t\tgetData() {\n\t\t\t\treturn { teamId };\n\t\t\t},\n\t\t});\n\t}, [teamId]);\n\n\treturn (\n\t\t<Box ref={ref} xcss={[teamAreaStyles, teamAreaBorderColorStyles[teamId]]}>\n\t\t\t<Stack alignInline=\"center\" spread=\"space-between\" xcss={fullHeightStyles}>\n\t\t\t\t<Box xcss={teamAreaLabelStyles}>{label}</Box>\n\t\t\t\t{children}\n\t\t\t</Stack>\n\t\t</Box>\n\t);\n}\n\ntype State = {\n\tteams: Record<TeamId, { label: string }>;\n\tchosenTeam: TeamId;\n};\n\nconst initialState: State = {\n\tteams: {\n\t\tblue: { label: 'Blue team' },\n\t\tred: { label: 'Red team' },\n\t},\n\tchosenTeam: 'blue',\n};\n\nfunction getInstanceId() {\n\treturn Symbol('instance-id');\n}\n\nconst InstanceIdContext = createContext<symbol | null>(null);\n\nexport default function ManualFocusRestoration(): React.JSX.Element {\n\tconst [state, setState] = useState(initialState);\n\tconst [instanceId] = useState(getInstanceId);\n\n\tconst buttonRef = useRef<HTMLButtonElement>(null);\n\tconst shouldRestoreFocusToButton = useRef(false);\n\t/**\n\t * Restores focus to the button when the team changes,\n\t * but only if we've marked it for focus restoration.\n\t */\n\tuseEffect(() => {\n\t\tif (shouldRestoreFocusToButton.current) {\n\t\t\tbuttonRef.current?.focus();\n\t\t\tshouldRestoreFocusToButton.current = false;\n\t\t}\n\t}, [state.chosenTeam]);\n\n\tconst swapTeam = useCallback(() => {\n\t\tif (document.activeElement === buttonRef.current) {\n\t\t\t/**\n\t\t\t * If the button is focused when it is being clicked,\n\t\t\t * we should mark it for focus restoration.\n\t\t\t */\n\t\t\tshouldRestoreFocusToButton.current = true;\n\t\t}\n\n\t\tsetState((state) => ({\n\t\t\t...state,\n\t\t\tchosenTeam: state.chosenTeam === 'blue' ? 'red' : 'blue',\n\t\t}));\n\t}, []);\n\n\tuseEffect(() => {\n\t\treturn monitorForElements({\n\t\t\tcanMonitor({ source }) {\n\t\t\t\treturn source.data.instanceId === instanceId;\n\t\t\t},\n\t\t\tonDrop({ location }) {\n\t\t\t\tconst dropTarget = location.current.dropTargets[0];\n\n\t\t\t\tsetState((state) => {\n\t\t\t\t\tconst { teamId } = dropTarget.data;\n\n\t\t\t\t\tif (teamId === state.chosenTeam) {\n\t\t\t\t\t\t// Avoid an unnecessary update\n\t\t\t\t\t\treturn state;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (teamId === 'red' || teamId === 'blue') {\n\t\t\t\t\t\treturn { ...state, chosenTeam: teamId };\n\t\t\t\t\t}\n\n\t\t\t\t\treturn state;\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\t}, [instanceId]);\n\n\treturn (\n\t\t<InstanceIdContext.Provider value={instanceId}>\n\t\t\t<Inline>\n\t\t\t\t{Object.entries(state.teams).map(([teamId, teamEntry]) => (\n\t\t\t\t\t<TeamArea teamId={teamId as TeamId} label={teamEntry.label}>\n\t\t\t\t\t\t{state.chosenTeam === teamId && (\n\t\t\t\t\t\t\t<Stack alignBlock=\"center\" space=\"space.100\" alignInline=\"center\">\n\t\t\t\t\t\t\t\t<Player />\n\t\t\t\t\t\t\t\t<Button ref={buttonRef} onClick={swapTeam} appearance=\"primary\">\n\t\t\t\t\t\t\t\t\tSwap team\n\t\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</TeamArea>\n\t\t\t\t))}\n\t\t\t</Inline>\n\t\t</InstanceIdContext.Provider>\n\t);\n}\n\nfunction Player() {\n\tconst instanceId = useContext(InstanceIdContext);\n\n\tconst avatarRef = useRef<HTMLDivElement>(null);\n\tuseEffect(() => {\n\t\tinvariant(avatarRef.current);\n\t\tinvariant(avatarRef.current.firstElementChild instanceof HTMLElement);\n\t\treturn draggable({\n\t\t\telement: avatarRef.current.firstElementChild,\n\t\t\tgetInitialData() {\n\t\t\t\treturn { instanceId };\n\t\t\t},\n\t\t});\n\t}, [instanceId]);\n\n\treturn (\n\t\t<div ref={avatarRef}>\n\t\t\t<Avatar size=\"xlarge\" />\n\t\t</div>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/nested-draggables.tsx",
    "content": "import React, { useEffect, useRef, useState } from 'react';\n\nimport invariant from 'tiny-invariant';\n\nimport { durations, easeInOut } from '@atlaskit/motion';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Grid, Inline, Stack, xcss } from '@atlaskit/primitives';\n\nconst itemIdStyles = xcss({\n\tmargin: '0',\n});\n\nconst itemContainerStyles = xcss({\n\tpadding: 'space.100',\n\tborderWidth: 'border.width',\n\tborderStyle: 'dashed',\n\tborderColor: 'color.border',\n});\n\nconst itemContentStyles = xcss({\n\tdisplay: 'flex',\n\tflexDirection: 'row',\n\talignItems: 'center',\n\tjustifyContent: 'space-between',\n\tpadding: 'space.100',\n\tuserSelect: 'none',\n\tborderWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border.bold',\n});\n\nconst itemStateStyles = {\n\tenabled: xcss({\n\t\tbackgroundColor: 'color.background.accent.green.subtlest',\n\t}),\n\tdisabled: xcss({\n\t\tbackgroundColor: 'color.background.accent.red.subtlest',\n\t}),\n\tdragging: xcss({\n\t\topacity: 0.4,\n\t}),\n};\n\nfunction Item({\n\titemId,\n\tchildren,\n}: {\n\titemId: string;\n\tchildren?: React.ReactElement | React.ReactElement[];\n}) {\n\tconst [isDraggingAllowed, setIsDraggingAllowed] = useState<boolean>(true);\n\tconst [isDragging, setIsDragging] = useState<boolean>(false);\n\tconst ref = useRef<HTMLLabelElement | null>(null);\n\titemContentStyles;\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\t\treturn draggable({\n\t\t\telement,\n\t\t\tcanDrag: () => isDraggingAllowed,\n\t\t\tgetInitialData: () => ({ itemId }),\n\t\t\tonDragStart: () => setIsDragging(true),\n\t\t\tonDrop: () => setIsDragging(false),\n\t\t});\n\t}, [itemId, isDraggingAllowed]);\n\n\treturn (\n\t\t<Stack\n\t\t\txcss={[\n\t\t\t\titemContainerStyles,\n\t\t\t\tisDraggingAllowed ? itemStateStyles.enabled : itemStateStyles.disabled,\n\t\t\t]}\n\t\t\tspace=\"space.050\"\n\t\t>\n\t\t\t<Box\n\t\t\t\tas=\"label\"\n\t\t\t\tref={ref}\n\t\t\t\txcss={[itemContentStyles, isDragging ? itemStateStyles.dragging : undefined]}\n\t\t\t>\n\t\t\t\t<Inline space=\"space.050\">\n\t\t\t\t\t{/* eslint-disable-next-line @atlaskit/design-system/no-html-checkbox */}\n\t\t\t\t\t<input\n\t\t\t\t\t\tonChange={() => setIsDraggingAllowed((value) => !value)}\n\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\tchecked={isDraggingAllowed}\n\t\t\t\t\t></input>\n\t\t\t\t\tDragging allowed?\n\t\t\t\t</Inline>\n\t\t\t\t<Box as=\"small\" xcss={itemIdStyles}>\n\t\t\t\t\t(id: {itemId})\n\t\t\t\t</Box>\n\t\t\t</Box>\n\t\t\t{children ? <Stack space=\"space.050\">{children}</Stack> : null}\n\t\t</Stack>\n\t);\n}\n\nconst dropTargetStyles = xcss({\n\tdisplay: 'flex',\n\talignItems: 'center',\n\tjustifyContent: 'center',\n\tborderWidth: 'border.width',\n\tborderColor: 'color.border.discovery',\n\tborderStyle: 'solid',\n\tbackgroundColor: 'color.background.discovery',\n\ttransitionProperty: 'background-color, border-color',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values\n\ttransitionDuration: `${durations.medium}ms`,\n\ttransitionTimingFunction: easeInOut,\n});\n\nconst dropTargetIsOverStyles = xcss({\n\tborderColor: 'color.border.accent.blue',\n\tbackgroundColor: 'color.background.selected.hovered',\n});\n\nfunction DropTarget() {\n\tconst [state, setState] = useState<'idle' | 'is-over'>('idle');\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tconst [lastDropped, setLastDropped] = useState<string | null>(null);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\t\treturn dropTargetForElements({\n\t\t\telement,\n\t\t\tonDragStart: () => setState('idle'),\n\t\t\tonDragEnter: () => setState('is-over'),\n\t\t\tonDragLeave: () => setState('idle'),\n\t\t\tonDrop: ({ source }) => {\n\t\t\t\tsetState('idle');\n\n\t\t\t\tif (typeof source.data.itemId !== 'string') {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tsetLastDropped(source.data.itemId);\n\t\t\t},\n\t\t});\n\t}, []);\n\treturn (\n\t\t<Box\n\t\t\txcss={[dropTargetStyles, state === 'is-over' ? dropTargetIsOverStyles : undefined]}\n\t\t\tref={ref}\n\t\t>\n\t\t\t<Stack alignInline=\"center\">\n\t\t\t\t<strong>Drop on me!</strong>\n\t\t\t\t<em>\n\t\t\t\t\t{/* eslint-disable-next-line @atlaskit/design-system/no-html-code */}\n\t\t\t\t\tLast dropped: <code>{lastDropped ?? 'none'}</code>\n\t\t\t\t</em>\n\t\t\t</Stack>\n\t\t</Box>\n\t);\n}\n\nexport default function Example(): React.JSX.Element {\n\treturn (\n\t\t<Grid templateColumns=\"1fr 1fr\" gap=\"space.100\">\n\t\t\t<Item itemId=\"1\">\n\t\t\t\t<Item itemId=\"1-1\">\n\t\t\t\t\t<Item itemId=\"1-1-1\" />\n\t\t\t\t\t<Item itemId=\"1-1-2\" />\n\t\t\t\t</Item>\n\t\t\t\t<Item itemId=\"1-2\">\n\t\t\t\t\t<Item itemId=\"1-2-1\" />\n\t\t\t\t\t<Item itemId=\"1-2-2\" />\n\t\t\t\t</Item>\n\t\t\t</Item>\n\t\t\t<DropTarget />\n\t\t</Grid>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/nested-drop-targets.tsx",
    "content": "import React, { useEffect, useRef, useState } from 'react';\n\nimport invariant from 'tiny-invariant';\n\nimport { durations, easeInOut } from '@atlaskit/motion';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Grid, Inline, Stack, xcss } from '@atlaskit/primitives';\n\nconst dropTargetStyles = xcss({\n\tborderWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border.bold',\n\tpadding: 'space.100',\n\ttransitionProperty: 'background-color',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values\n\ttransitionDuration: `${durations.medium}ms`,\n\ttransitionTimingFunction: easeInOut,\n\tbackgroundColor: 'elevation.surface',\n});\n\nconst dropTargetContentStyles = xcss({\n\tpadding: 'space.100',\n\tborderWidth: 'border.width',\n\tborderStyle: 'dashed',\n\tborderColor: 'color.border',\n});\n\nconst isOverStyles = xcss({\n\tbackgroundColor: 'color.background.selected.hovered',\n});\n\nconst isDisabledStyles = xcss({\n\tbackgroundColor: 'color.background.accent.red.subtler',\n});\n\nfunction DropTarget({ targetId, children }: { targetId: string; children?: React.ReactNode }) {\n\tconst [state, setState] = useState<'idle' | 'is-over'>('idle');\n\tconst [isSticky, setIsSticky] = useState<boolean>(false);\n\tconst [isDropAllowed, setIsDropAllowed] = useState<boolean>(true);\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\n\t\treturn dropTargetForElements({\n\t\t\telement,\n\t\t\tgetIsSticky: () => isSticky,\n\t\t\tcanDrop: () => isDropAllowed,\n\t\t\tonDragEnter: () => {\n\t\t\t\tsetState('is-over');\n\t\t\t\tconsole.log('is-over:', targetId);\n\t\t\t},\n\t\t\tonDragLeave: () => {\n\t\t\t\tsetState('idle');\n\t\t\t\tconsole.log('is leaving', targetId);\n\t\t\t},\n\t\t\tonDrop: () => setState('idle'),\n\t\t});\n\t}, [targetId, isSticky, isDropAllowed]);\n\n\treturn (\n\t\t<Box\n\t\t\txcss={[\n\t\t\t\tdropTargetStyles,\n\t\t\t\tstate === 'is-over' ? isOverStyles : !isDropAllowed ? isDisabledStyles : undefined,\n\t\t\t]}\n\t\t\tref={ref}\n\t\t>\n\t\t\t<Inline xcss={dropTargetContentStyles} spread=\"space-between\">\n\t\t\t\t<strong>{targetId}</strong>\n\t\t\t\t<Inline>\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<Inline space=\"space.050\">\n\t\t\t\t\t\t\t{/* eslint-disable-next-line @atlaskit/design-system/no-html-checkbox */}\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tonChange={() => setIsDropAllowed((value) => !value)}\n\t\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\t\tchecked={isDropAllowed}\n\t\t\t\t\t\t\t></input>\n\t\t\t\t\t\t\tDrop allowed?\n\t\t\t\t\t\t</Inline>\n\t\t\t\t\t</label>\n\t\t\t\t\t<label>\n\t\t\t\t\t\t<Inline space=\"space.050\">\n\t\t\t\t\t\t\t{/* eslint-disable-next-line @atlaskit/design-system/no-html-checkbox */}\n\t\t\t\t\t\t\t<input\n\t\t\t\t\t\t\t\tonChange={() => setIsSticky((value) => !value)}\n\t\t\t\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\t\t\t\tchecked={isSticky}\n\t\t\t\t\t\t\t></input>\n\t\t\t\t\t\t\tSticky?\n\t\t\t\t\t\t</Inline>\n\t\t\t\t\t</label>\n\t\t\t\t</Inline>\n\t\t\t</Inline>\n\t\t\t{children ? <Stack space=\"space.100\">{children}</Stack> : null}\n\t\t</Box>\n\t);\n}\n\nconst draggableStyles = xcss({\n\tpadding: 'space.100',\n\tborderWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border',\n\tbackgroundColor: 'elevation.surface',\n});\n\nfunction Draggable() {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\t\treturn draggable({\n\t\t\telement,\n\t\t});\n\t}, []);\n\n\treturn (\n\t\t<Box xcss={draggableStyles} ref={ref}>\n\t\t\t<strong>Drag me 👋</strong>\n\t\t</Box>\n\t);\n}\n\nexport default function Example(): React.JSX.Element {\n\treturn (\n\t\t<Grid templateColumns=\"200px 1fr\" gap=\"space.100\">\n\t\t\t<Box>\n\t\t\t\t<Draggable />\n\t\t\t</Box>\n\t\t\t<Box>\n\t\t\t\t<DropTarget targetId=\"Grandparent 👵\">\n\t\t\t\t\t<DropTarget targetId=\"Parent 1 👩\">\n\t\t\t\t\t\t<DropTarget targetId=\"Child 1 🧒\" />\n\t\t\t\t\t\t<DropTarget targetId=\"Child 2 👧\" />\n\t\t\t\t\t</DropTarget>\n\t\t\t\t\t<DropTarget targetId=\"Parent 2 👨\">\n\t\t\t\t\t\t<DropTarget targetId=\"Child 3 🧑‍🦱\" />\n\t\t\t\t\t\t<DropTarget targetId=\"Child 4 👶\" />\n\t\t\t\t\t</DropTarget>\n\t\t\t\t</DropTarget>\n\t\t\t</Box>\n\t\t</Grid>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/backlog/container.tsx",
    "content": "import React, { type ReactNode } from 'react';\n\nimport Avatar from '@atlaskit/avatar';\nimport Badge from '@atlaskit/badge';\nimport Button, { IconButton } from '@atlaskit/button/new';\nimport ChevronDownIcon from '@atlaskit/icon/core/chevron-down';\nimport MoreIcon from '@atlaskit/icon/core/show-more-horizontal';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Inline, Stack, xcss } from '@atlaskit/primitives';\n\nconst containerStyles = xcss({\n\tpadding: 'space.100',\n\tborderRadius: 'radius.large',\n\tbackgroundColor: 'elevation.surface.sunken',\n\twidth: '50vw',\n});\n\nexport function BacklogContainer({ children }: { children: ReactNode }): React.JSX.Element {\n\treturn (\n\t\t<Stack space=\"space.100\" xcss={containerStyles}>\n\t\t\t<BacklogHeader />\n\t\t\t{children}\n\t\t</Stack>\n\t);\n}\n\nconst headerTitleInsetStyles = xcss({\n\tpaddingLeft: 'space.150',\n});\n\nconst headerAvatarGroupInsetStyles = xcss({\n\tpaddingLeft: 'space.300',\n});\n\nconst sprintTitleStyles = xcss({\n\tfontWeight: 'font.weight.semibold',\n});\n\nconst subtlestTextStyles = xcss({\n\tcolor: 'color.text.subtlest',\n});\n\nfunction BacklogHeader() {\n\treturn (\n\t\t<Stack space=\"space.050\">\n\t\t\t<Inline spread=\"space-between\" alignBlock=\"center\" xcss={headerTitleInsetStyles}>\n\t\t\t\t<Inline alignBlock=\"center\">\n\t\t\t\t\t<ChevronDownIcon color=\"currentColor\" spacing=\"spacious\" label=\"\" size=\"small\" />\n\t\t\t\t\t<Inline space=\"space.100\" alignBlock=\"center\">\n\t\t\t\t\t\t<Box xcss={sprintTitleStyles}>Sprint Title</Box>\n\t\t\t\t\t\t<Box xcss={subtlestTextStyles}>29 Aug — 12 Sep</Box>\n\t\t\t\t\t\t<Box xcss={subtlestTextStyles}>(23 work items)</Box>\n\t\t\t\t\t</Inline>\n\t\t\t\t</Inline>\n\t\t\t\t<Inline space=\"space.100\" alignBlock=\"center\">\n\t\t\t\t\t<Inline space=\"space.050\">\n\t\t\t\t\t\t<Badge>0d</Badge>\n\t\t\t\t\t\t<Badge appearance=\"primary\">0d</Badge>\n\t\t\t\t\t\t<Badge appearance=\"added\">0d</Badge>\n\t\t\t\t\t</Inline>\n\t\t\t\t\t<Button>Complete sprint</Button>\n\t\t\t\t\t<IconButton icon={MoreIcon} label=\"more actions\" />\n\t\t\t\t</Inline>\n\t\t\t</Inline>\n\t\t\t<Inline space=\"space.050\" alignBlock=\"center\" xcss={headerAvatarGroupInsetStyles}>\n\t\t\t\t{Array.from({ length: 5 }, (_, index) => (\n\t\t\t\t\t<Avatar key={index} size=\"small\" />\n\t\t\t\t))}\n\t\t\t\t<IconButton icon={MoreIcon} appearance=\"subtle\" label=\"more actions\" />\n\t\t\t</Inline>\n\t\t</Stack>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/backlog/context.tsx",
    "content": "import { createContext, useContext } from 'react';\n\nimport invariant from 'tiny-invariant';\n\nimport type { Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\n\nimport { type ItemData } from './data';\n\ntype ItemPosition = 'first' | 'last' | 'middle' | 'only';\n\ntype CleanupFn = () => void;\n\ntype ListContextProps = {\n\tgetItemIndex: ({ id }: { id: string }) => number;\n\tgetItemPosition: (itemData: ItemData) => ItemPosition;\n\tregisterItem: (args: { id: string; element: HTMLElement }) => CleanupFn;\n\treorderItem: (args: {\n\t\tstartIndex: number;\n\t\tindexOfTarget: number;\n\t\tclosestEdgeOfTarget: Edge | null;\n\t}) => void;\n};\n\nexport const ListContext = createContext<ListContextProps | null>(null);\n\nexport function useListContext() {\n\tconst listContext = useContext(ListContext);\n\tinvariant(listContext !== null);\n\treturn listContext;\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/backlog/data.tsx",
    "content": "export type ItemData = {\n\tid: string;\n\tlabel: string;\n};\n\nexport const defaultItems: ItemData[] = [\n\t{\n\t\tid: 'PROJ-149',\n\t\tlabel: 'Organize a team-building event',\n\t},\n\t{\n\t\tid: 'PROJ-192',\n\t\tlabel: 'Create and maintain office inventory',\n\t},\n\t{\n\t\tid: 'PROJ-131',\n\t\tlabel: 'Update company website content',\n\t},\n\t{\n\t\tid: 'PROJ-142',\n\t\tlabel: 'Plan and execute marketing campaigns',\n\t},\n\t{\n\t\tid: 'PROJ-175',\n\t\tlabel: 'Coordinate employee training sessions',\n\t},\n\t{\n\t\tid: 'PROJ-139',\n\t\tlabel: 'Manage facility maintenance',\n\t},\n\t{\n\t\tid: 'PROJ-156',\n\t\tlabel: 'Organize customer feedback surveys',\n\t},\n\t{\n\t\tid: 'PROJ-160',\n\t\tlabel: 'Coordinate travel arrangements',\n\t},\n];\n"
  },
  {
    "path": "packages/documentation/examples/pieces/backlog/index.tsx",
    "content": "import React from 'react';\n\nimport { BacklogContainer } from './container';\nimport List from './list';\n\nexport default function BacklogPrototype(): React.JSX.Element {\n\treturn (\n\t\t<BacklogContainer>\n\t\t\t<List />\n\t\t</BacklogContainer>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/backlog/list-item.tsx",
    "content": "import React, { Fragment, useCallback, useEffect, useRef, useState } from 'react';\n\nimport { bindAll } from 'bind-event-listener';\nimport ReactDOM from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport Avatar from '@atlaskit/avatar';\nimport Badge from '@atlaskit/badge';\nimport { IconButton } from '@atlaskit/button/new';\nimport { Checkbox } from '@atlaskit/checkbox';\nimport { IconTile } from '@atlaskit/icon';\nimport PriorityMinorIcon from '@atlaskit/icon/core/priority-minor';\nimport MoreIcon from '@atlaskit/icon/core/show-more-horizontal';\nimport StoryIcon from '@atlaskit/icon/core/story';\nimport Lozenge from '@atlaskit/lozenge';\nimport {\n\tattachClosestEdge,\n\ttype Edge,\n\textractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Inline, xcss } from '@atlaskit/primitives';\nimport { token } from '@atlaskit/tokens';\n\nimport { useListContext } from './context';\nimport { type ItemData } from './data';\n\nconst listItemContainerStyles = xcss({\n\tposition: 'relative',\n\tborderWidth: '0',\n\tborderBottomWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border',\n\tbackgroundColor: 'elevation.surface.raised',\n\tcursor: 'pointer',\n\t'--action-opacity': 0,\n\t':hover': {\n\t\tbackgroundColor: 'elevation.surface.raised.hovered',\n\t\t// @ts-expect-error\n\t\t'--action-opacity': 1,\n\t},\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':last-of-type': {\n\t\tborderWidth: '0',\n\t},\n});\n\nconst actionStyles = xcss({\n\tcursor: 'grab',\n\topacity: 'var(--action-opacity)',\n\t':focus-within': {\n\t\topacity: 1,\n\t},\n});\n\nconst listItemContainerSelectedStyles = xcss({\n\tbackgroundColor: 'color.background.selected',\n\t':hover': {\n\t\tbackgroundColor: 'color.background.selected.hovered',\n\t},\n});\n\nconst listItemStyles = xcss({\n\tposition: 'relative',\n\tpaddingLeft: 'space.100',\n\tpaddingRight: 'space.100',\n\theight: '40px',\n});\n\nconst listItemDisabledStyles = xcss({ opacity: 0.4 });\n\ntype DraggableState =\n\t| { type: 'idle' }\n\t| { type: 'preview'; container: HTMLElement }\n\t| { type: 'dragging' };\n\nconst idleState: DraggableState = { type: 'idle' };\nconst draggingState: DraggableState = { type: 'dragging' };\n\nconst listItemPreviewStyles = xcss({\n\tpaddingBlock: 'space.050',\n\tpaddingInline: 'space.100',\n\tborderRadius: 'radius.small',\n\tbackgroundColor: 'elevation.surface.overlay',\n\tmaxWidth: '360px',\n\twhiteSpace: 'nowrap',\n\toverflow: 'hidden',\n\ttextOverflow: 'ellipsis',\n});\n\nconst itemLabelStyles = xcss({\n\tflexGrow: 1,\n\twhiteSpace: 'nowrap',\n\ttextOverflow: 'ellipsis',\n\toverflow: 'hidden',\n});\n\nconst subtlestTextStyles = xcss({ color: 'color.text.subtlest' });\n\nexport function ListItem({ itemData }: { itemData: ItemData }): React.JSX.Element {\n\tconst { getItemIndex, registerItem } = useListContext();\n\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst [closestEdge, setClosestEdge] = useState<Edge | null>(null);\n\n\tconst [isChecked, setIsChecked] = useState(false);\n\tconst onCheckboxChange = useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n\t\tsetIsChecked(event.currentTarget.checked);\n\t}, []);\n\n\tconst [draggableState, setDraggableState] = useState<DraggableState>(idleState);\n\n\tuseEffect(() => {\n\t\tinvariant(ref.current);\n\n\t\tconst element = ref.current;\n\n\t\tconst dragData = { id: itemData.id, instance: 'backlog' };\n\n\t\treturn combine(\n\t\t\tregisterItem({ id: itemData.id, element }),\n\t\t\tdraggable({\n\t\t\t\telement,\n\t\t\t\tgetInitialData() {\n\t\t\t\t\treturn { ...dragData, index: getItemIndex(itemData) };\n\t\t\t\t},\n\t\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\t\tgetOffset: pointerOutsideOfPreview({\n\t\t\t\t\t\t\tx: token('space.200', '16px'),\n\t\t\t\t\t\t\ty: token('space.100', '8px'),\n\t\t\t\t\t\t}),\n\t\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\t\tsetDraggableState({ type: 'preview', container });\n\n\t\t\t\t\t\t\treturn () => setDraggableState(draggingState);\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragStart() {\n\t\t\t\t\tsetDraggableState(draggingState);\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tsetDraggableState(idleState);\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement,\n\t\t\t\tgetData({ input }) {\n\t\t\t\t\treturn attachClosestEdge(dragData, {\n\t\t\t\t\t\telement,\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tallowedEdges: ['top', 'bottom'],\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDrag({ self, source }) {\n\t\t\t\t\tconst isSource = source.element === element;\n\t\t\t\t\tif (isSource) {\n\t\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst closestEdge = extractClosestEdge(self.data);\n\n\t\t\t\t\tconst sourceIndex = source.data.index;\n\t\t\t\t\tinvariant(typeof sourceIndex === 'number');\n\n\t\t\t\t\tconst selfIndex = getItemIndex({ id: itemData.id });\n\n\t\t\t\t\tconst isItemBeforeSource = selfIndex === sourceIndex - 1;\n\t\t\t\t\tconst isItemAfterSource = selfIndex === sourceIndex + 1;\n\n\t\t\t\t\tconst isDropIndicatorHidden =\n\t\t\t\t\t\t(isItemBeforeSource && closestEdge === 'bottom') ||\n\t\t\t\t\t\t(isItemAfterSource && closestEdge === 'top');\n\n\t\t\t\t\tif (isDropIndicatorHidden) {\n\t\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tsetClosestEdge(closestEdge);\n\t\t\t\t},\n\t\t\t\tonDragLeave() {\n\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [getItemIndex, itemData, registerItem]);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tif (!element) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet timeoutId: ReturnType<typeof setTimeout>;\n\n\t\treturn bindAll(element, [\n\t\t\t{\n\t\t\t\ttype: 'pointerenter',\n\t\t\t\tlistener() {\n\t\t\t\t\ttimeoutId = setTimeout(() => {\n\t\t\t\t\t\telement.style.setProperty('cursor', 'grab');\n\t\t\t\t\t}, 1000);\n\t\t\t\t},\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: 'pointerleave',\n\t\t\t\tlistener() {\n\t\t\t\t\tclearTimeout(timeoutId);\n\t\t\t\t\telement.style.removeProperty('cursor');\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\t}, []);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<Box ref={ref} xcss={listItemContainerStyles}>\n\t\t\t\t<Inline\n\t\t\t\t\tspace=\"space.100\"\n\t\t\t\t\talignBlock=\"center\"\n\t\t\t\t\tspread=\"space-between\"\n\t\t\t\t\txcss={[\n\t\t\t\t\t\tlistItemStyles,\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * We are applying the disabled effect to the inner element so that\n\t\t\t\t\t\t * the border and drop indicator are not affected.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tdraggableState.type === 'dragging' && listItemDisabledStyles,\n\t\t\t\t\t\tisChecked && listItemContainerSelectedStyles,\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t<Inline alignBlock=\"center\">\n\t\t\t\t\t\t<Inline xcss={actionStyles}>\n\t\t\t\t\t\t\t{/* <DragHandlerIcon\n                label=\"\"\n                primaryColor={token('color.icon.subtle', '#626F86')}\n              /> */}\n\t\t\t\t\t\t\t<Checkbox isChecked={isChecked} onChange={onCheckboxChange} />\n\t\t\t\t\t\t</Inline>\n\t\t\t\t\t\t<Inline space=\"space.050\" alignBlock=\"center\">\n\t\t\t\t\t\t\t<IconTile appearance=\"greenBold\" size=\"16\" label=\"\" icon={StoryIcon} />\n\t\t\t\t\t\t\t<Box xcss={subtlestTextStyles}>{itemData.id}</Box>\n\t\t\t\t\t\t\t<Box xcss={itemLabelStyles}>{itemData.label}</Box>\n\t\t\t\t\t\t</Inline>\n\t\t\t\t\t</Inline>\n\t\t\t\t\t<Inline alignBlock=\"center\" space=\"space.100\">\n\t\t\t\t\t\t<Lozenge>Todo</Lozenge>\n\t\t\t\t\t\t<Badge>0d</Badge>\n\t\t\t\t\t\t<PriorityMinorIcon label={''} color={token('color.icon.accent.blue')} />\n\t\t\t\t\t\t<Avatar size=\"small\" />\n\t\t\t\t\t\t<Box xcss={actionStyles}>\n\t\t\t\t\t\t\t<IconButton icon={MoreIcon} label=\"more actions\" />\n\t\t\t\t\t\t</Box>\n\t\t\t\t\t</Inline>\n\t\t\t\t</Inline>\n\t\t\t\t{closestEdge && <DropIndicator edge={closestEdge} gap=\"1px\" />}\n\t\t\t</Box>\n\t\t\t{draggableState.type === 'preview' &&\n\t\t\t\tReactDOM.createPortal(\n\t\t\t\t\t<Box xcss={listItemPreviewStyles}>{itemData.label}</Box>,\n\t\t\t\t\tdraggableState.container,\n\t\t\t\t)}\n\t\t</Fragment>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/backlog/list.tsx",
    "content": "import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { triggerPostMoveFlash } from '@atlaskit/pragmatic-drag-and-drop-flourish/trigger-post-move-flash';\nimport {\n\ttype Edge,\n\textractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { getReorderDestinationIndex } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index';\nimport * as liveRegion from '@atlaskit/pragmatic-drag-and-drop-live-region';\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Stack, xcss } from '@atlaskit/primitives';\n\nimport { ListContext } from './context';\nimport { defaultItems, type ItemData } from './data';\nimport { ListItem } from './list-item';\n\n// function LazyDropdownContent({ itemData }: { itemData: ItemData }) {\n//   const { getItemIndex, getItemPosition, reorderItem } = useListContext();\n\n//   const position = getItemPosition(itemData);\n\n//   const isMoveUpDisabled = position === 'first' || position === 'only';\n//   const isMoveDownDisabled = position === 'last' || position === 'only';\n\n//   const moveUp = useCallback(() => {\n//     const startIndex = getItemIndex(itemData);\n//     reorderItem({\n//       startIndex,\n//       indexOfTarget: startIndex - 1,\n//       closestEdgeOfTarget: null,\n//     });\n//   }, [getItemIndex, itemData, reorderItem]);\n\n//   const moveDown = useCallback(() => {\n//     const startIndex = getItemIndex(itemData);\n//     reorderItem({\n//       startIndex,\n//       indexOfTarget: startIndex + 1,\n//       closestEdgeOfTarget: null,\n//     });\n//   }, [getItemIndex, itemData, reorderItem]);\n\n//   return (\n//     <DropdownItemGroup>\n//       <DropdownItem onClick={moveUp} isDisabled={isMoveUpDisabled}>\n//         Move up\n//       </DropdownItem>\n//       <DropdownItem onClick={moveDown} isDisabled={isMoveDownDisabled}>\n//         Move down\n//       </DropdownItem>\n//     </DropdownItemGroup>\n//   );\n// }\n\nconst containerStyles = xcss({\n\tborderWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border',\n});\n\ntype ListState = {\n\titems: ItemData[];\n\tlastCardMoved: {\n\t\titem: ItemData;\n\t\tpreviousIndex: number;\n\t\tcurrentIndex: number;\n\t\tnumberOfItems: number;\n\t} | null;\n};\n\nexport default function ListExample(): React.JSX.Element {\n\tconst [{ items, lastCardMoved }, setListState] = useState<ListState>({\n\t\titems: defaultItems,\n\t\tlastCardMoved: null,\n\t});\n\n\tconst registryRef = useRef(new Map<string, HTMLElement>());\n\tconst registerItem = useCallback(({ id, element }: { id: string; element: HTMLElement }) => {\n\t\tconst registry = registryRef.current;\n\t\tif (!registry) {\n\t\t\treturn () => {};\n\t\t}\n\t\tregistry.set(id, element);\n\n\t\treturn function unregisterItem() {\n\t\t\tregistry.delete(id);\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tliveRegion.cleanup();\n\t\t};\n\t}, []);\n\n\t/**\n\t * Creating a stable reference for the items, so that we can avoid\n\t * rerenders.\n\t */\n\tconst stableItemsRef = useRef<ItemData[]>(items);\n\tuseEffect(() => {\n\t\tstableItemsRef.current = items;\n\t}, [items]);\n\n\tuseEffect(() => {\n\t\tif (lastCardMoved === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { item, previousIndex, currentIndex, numberOfItems } = lastCardMoved;\n\t\tconst element = registryRef.current.get(item.id);\n\t\tif (element) {\n\t\t\ttriggerPostMoveFlash(element);\n\t\t}\n\n\t\tliveRegion.announce(\n\t\t\t`You've moved ${item.label} from position ${\n\t\t\t\tpreviousIndex + 1\n\t\t\t} to position ${currentIndex + 1} of ${numberOfItems}.`,\n\t\t);\n\t}, [lastCardMoved]);\n\n\tconst reorderItem = useCallback(\n\t\t({\n\t\t\tstartIndex,\n\t\t\tindexOfTarget,\n\t\t\tclosestEdgeOfTarget,\n\t\t}: {\n\t\t\tstartIndex: number;\n\t\t\tindexOfTarget: number;\n\t\t\tclosestEdgeOfTarget: Edge | null;\n\t\t}) => {\n\t\t\tconst finishIndex = getReorderDestinationIndex({\n\t\t\t\tstartIndex,\n\t\t\t\tclosestEdgeOfTarget,\n\t\t\t\tindexOfTarget,\n\t\t\t\taxis: 'vertical',\n\t\t\t});\n\n\t\t\tif (finishIndex === startIndex) {\n\t\t\t\t// If there would be no change, we skip the update\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetListState((listState) => {\n\t\t\t\tconst item = listState.items[startIndex];\n\n\t\t\t\treturn {\n\t\t\t\t\titems: reorder({\n\t\t\t\t\t\tlist: listState.items,\n\t\t\t\t\t\tstartIndex,\n\t\t\t\t\t\tfinishIndex,\n\t\t\t\t\t}),\n\t\t\t\t\tlastCardMoved: {\n\t\t\t\t\t\titem,\n\t\t\t\t\t\tpreviousIndex: startIndex,\n\t\t\t\t\t\tcurrentIndex: finishIndex,\n\t\t\t\t\t\tnumberOfItems: listState.items.length,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t});\n\t\t},\n\t\t[],\n\t);\n\n\tuseEffect(() => {\n\t\treturn monitorForElements({\n\t\t\tcanMonitor({ source }) {\n\t\t\t\treturn source.data.instance === 'backlog';\n\t\t\t},\n\t\t\tonDrop({ location, source }) {\n\t\t\t\tconst target = location.current.dropTargets[0];\n\t\t\t\tif (!target) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst items = stableItemsRef.current;\n\n\t\t\t\tconst startIndex = items.findIndex((item) => item.id === source.data.id);\n\t\t\t\tif (startIndex < 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst indexOfTarget = items.findIndex((item) => item.id === target.data.id);\n\t\t\t\tif (indexOfTarget < 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst closestEdgeOfTarget = extractClosestEdge(target.data);\n\n\t\t\t\treorderItem({ startIndex, indexOfTarget, closestEdgeOfTarget });\n\t\t\t},\n\t\t});\n\t}, [reorderItem]);\n\n\tconst getItemPosition = useCallback((itemData: ItemData) => {\n\t\tconst items = stableItemsRef.current;\n\n\t\tif (items.length === 1) {\n\t\t\treturn 'only';\n\t\t}\n\n\t\tconst index = items.indexOf(itemData);\n\t\tif (index === 0) {\n\t\t\treturn 'first';\n\t\t}\n\n\t\tif (index === items.length - 1) {\n\t\t\treturn 'last';\n\t\t}\n\n\t\treturn 'middle';\n\t}, []);\n\n\tconst getItemIndex = useCallback(({ id }: { id: string }) => {\n\t\treturn stableItemsRef.current.findIndex((item) => item.id === id);\n\t}, []);\n\n\tconst contextValue = useMemo(() => {\n\t\treturn { getItemIndex, getItemPosition, registerItem, reorderItem };\n\t}, [getItemIndex, getItemPosition, registerItem, reorderItem]);\n\n\treturn (\n\t\t<ListContext.Provider value={contextValue}>\n\t\t\t<Stack xcss={containerStyles}>\n\t\t\t\t{items.map((itemData) => (\n\t\t\t\t\t<ListItem key={itemData.id} itemData={itemData} />\n\t\t\t\t))}\n\t\t\t</Stack>\n\t\t</ListContext.Provider>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/board/board-context.tsx",
    "content": "import { createContext, useContext } from 'react';\n\nimport invariant from 'tiny-invariant';\n\nimport type { CleanupFn } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport type { ColumnType } from '../../data/people';\n\nexport type BoardContextValue = {\n\tgetColumns: () => ColumnType[];\n\n\treorderColumn: (args: { startIndex: number; finishIndex: number }) => void;\n\n\treorderCard: (args: { columnId: string; startIndex: number; finishIndex: number }) => void;\n\n\tmoveCard: (args: {\n\t\tstartColumnId: string;\n\t\tfinishColumnId: string;\n\t\titemIndexInStartColumn: number;\n\t\titemIndexInFinishColumn?: number;\n\t}) => void;\n\n\tregisterCard: (args: {\n\t\tcardId: string;\n\t\tentry: {\n\t\t\telement: HTMLElement;\n\t\t\tactionMenuTrigger: HTMLElement;\n\t\t};\n\t}) => CleanupFn;\n\n\tregisterColumn: (args: {\n\t\tcolumnId: string;\n\t\tentry: {\n\t\t\telement: HTMLElement;\n\t\t};\n\t}) => CleanupFn;\n\n\tinstanceId: symbol;\n};\n\nexport const BoardContext = createContext<BoardContextValue | null>(null);\n\nexport function useBoardContext(): BoardContextValue {\n\tconst value = useContext(BoardContext);\n\tinvariant(value, 'cannot find BoardContext provider');\n\treturn value;\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/board/board.tsx",
    "content": "import React, { forwardRef, memo, type ReactNode, useEffect } from 'react';\n\nimport { autoScrollWindowForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, xcss } from '@atlaskit/primitives';\n\nimport { useBoardContext } from './board-context';\n\ntype BoardProps = {\n\tchildren: ReactNode;\n};\n\nconst boardStyles = xcss({\n\tdisplay: 'flex',\n\tjustifyContent: 'center',\n\tgap: 'space.200',\n\tflexDirection: 'row',\n\theight: '480px',\n});\n\nconst Board = forwardRef<HTMLDivElement, BoardProps>(({ children }: BoardProps, ref) => {\n\tconst { instanceId } = useBoardContext();\n\n\tuseEffect(() => {\n\t\treturn autoScrollWindowForElements({\n\t\t\tcanScroll: ({ source }) => source.data.instanceId === instanceId,\n\t\t});\n\t}, [instanceId]);\n\n\treturn (\n\t\t<Box xcss={boardStyles} ref={ref}>\n\t\t\t{children}\n\t\t</Box>\n\t);\n});\n\nexport default memo(Board);\n"
  },
  {
    "path": "packages/documentation/examples/pieces/board/card.tsx",
    "content": "import React, {\n\tforwardRef,\n\tFragment,\n\tmemo,\n\ttype Ref,\n\tuseCallback,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from 'react';\n\nimport ReactDOM from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport Avatar from '@atlaskit/avatar';\nimport { IconButton } from '@atlaskit/button/new';\nimport DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';\n// eslint-disable-next-line @atlaskit/design-system/no-banned-imports\nimport mergeRefs from '@atlaskit/ds-lib/merge-refs';\nimport Heading from '@atlaskit/heading';\n// This is the smaller MoreIcon soon to be more easily accessible with the\n// ongoing icon project\nimport MoreIcon from '@atlaskit/icon/core/show-more-horizontal';\nimport {\n\tattachClosestEdge,\n\ttype Edge,\n\textractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { preserveOffsetOnSource } from '@atlaskit/pragmatic-drag-and-drop/element/preserve-offset-on-source';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\nimport { dropTargetForExternal } from '@atlaskit/pragmatic-drag-and-drop/external/adapter';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Grid, Stack, xcss } from '@atlaskit/primitives';\nimport { token } from '@atlaskit/tokens';\n\nimport { type ColumnType, type Person } from '../../data/people';\n\nimport { useBoardContext } from './board-context';\nimport { useColumnContext } from './column-context';\n\ntype State =\n\t| { type: 'idle' }\n\t| { type: 'preview'; container: HTMLElement; rect: DOMRect }\n\t| { type: 'dragging' };\n\nconst idleState: State = { type: 'idle' };\nconst draggingState: State = { type: 'dragging' };\n\nconst noMarginStyles = xcss({ margin: 'space.0' });\nconst noPointerEventsStyles = xcss({ pointerEvents: 'none' });\nconst baseStyles = xcss({\n\twidth: '100%',\n\tpadding: 'space.100',\n\tbackgroundColor: 'elevation.surface',\n\tborderRadius: 'radius.large',\n\tposition: 'relative',\n\t':hover': {\n\t\tbackgroundColor: 'elevation.surface.hovered',\n\t},\n});\n\nconst stateStyles: {\n\t[Key in State['type']]: ReturnType<typeof xcss> | undefined;\n} = {\n\tidle: xcss({\n\t\tcursor: 'grab',\n\t\tboxShadow: 'elevation.shadow.raised',\n\t}),\n\tdragging: xcss({\n\t\topacity: 0.4,\n\t\tboxShadow: 'elevation.shadow.raised',\n\t}),\n\t// no shadow for preview - the platform will add it's own drop shadow\n\tpreview: undefined,\n};\n\nconst buttonColumnStyles = xcss({\n\talignSelf: 'start',\n});\n\ntype CardPrimitiveProps = {\n\tclosestEdge: Edge | null;\n\titem: Person;\n\tstate: State;\n\tactionMenuTriggerRef?: Ref<HTMLButtonElement>;\n};\n\nfunction MoveToOtherColumnItem({\n\ttargetColumn,\n\tstartIndex,\n}: {\n\ttargetColumn: ColumnType;\n\tstartIndex: number;\n}) {\n\tconst { moveCard } = useBoardContext();\n\tconst { columnId } = useColumnContext();\n\n\tconst onClick = useCallback(() => {\n\t\tmoveCard({\n\t\t\tstartColumnId: columnId,\n\t\t\tfinishColumnId: targetColumn.columnId,\n\t\t\titemIndexInStartColumn: startIndex,\n\t\t});\n\t}, [columnId, moveCard, startIndex, targetColumn.columnId]);\n\n\treturn <DropdownItem onClick={onClick}>{targetColumn.title}</DropdownItem>;\n}\n\nfunction LazyDropdownItems({ userId }: { userId: string }) {\n\tconst { getColumns, reorderCard } = useBoardContext();\n\tconst { columnId, getCardIndex, getNumCards } = useColumnContext();\n\n\tconst numCards = getNumCards();\n\tconst startIndex = getCardIndex(userId);\n\n\tconst moveToTop = useCallback(() => {\n\t\treorderCard({ columnId, startIndex, finishIndex: 0 });\n\t}, [columnId, reorderCard, startIndex]);\n\n\tconst moveUp = useCallback(() => {\n\t\treorderCard({ columnId, startIndex, finishIndex: startIndex - 1 });\n\t}, [columnId, reorderCard, startIndex]);\n\n\tconst moveDown = useCallback(() => {\n\t\treorderCard({ columnId, startIndex, finishIndex: startIndex + 1 });\n\t}, [columnId, reorderCard, startIndex]);\n\n\tconst moveToBottom = useCallback(() => {\n\t\treorderCard({ columnId, startIndex, finishIndex: numCards - 1 });\n\t}, [columnId, reorderCard, startIndex, numCards]);\n\n\tconst isMoveUpDisabled = startIndex === 0;\n\tconst isMoveDownDisabled = startIndex === numCards - 1;\n\n\tconst moveColumnOptions = getColumns().filter((column) => column.columnId !== columnId);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<DropdownItemGroup title=\"Reorder\">\n\t\t\t\t<DropdownItem onClick={moveToTop} isDisabled={isMoveUpDisabled}>\n\t\t\t\t\tMove to top\n\t\t\t\t</DropdownItem>\n\t\t\t\t<DropdownItem onClick={moveUp} isDisabled={isMoveUpDisabled}>\n\t\t\t\t\tMove up\n\t\t\t\t</DropdownItem>\n\t\t\t\t<DropdownItem onClick={moveDown} isDisabled={isMoveDownDisabled}>\n\t\t\t\t\tMove down\n\t\t\t\t</DropdownItem>\n\t\t\t\t<DropdownItem onClick={moveToBottom} isDisabled={isMoveDownDisabled}>\n\t\t\t\t\tMove to bottom\n\t\t\t\t</DropdownItem>\n\t\t\t</DropdownItemGroup>\n\t\t\t{moveColumnOptions.length ? (\n\t\t\t\t<DropdownItemGroup title=\"Move to\">\n\t\t\t\t\t{moveColumnOptions.map((column) => (\n\t\t\t\t\t\t<MoveToOtherColumnItem\n\t\t\t\t\t\t\tkey={column.columnId}\n\t\t\t\t\t\t\ttargetColumn={column}\n\t\t\t\t\t\t\tstartIndex={startIndex}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</DropdownItemGroup>\n\t\t\t) : null}\n\t\t</Fragment>\n\t);\n}\n\nconst CardPrimitive = forwardRef<HTMLDivElement, CardPrimitiveProps>(function CardPrimitive(\n\t{ closestEdge, item, state, actionMenuTriggerRef },\n\tref,\n) {\n\tconst { avatarUrl, name, role, userId } = item;\n\n\treturn (\n\t\t<Grid\n\t\t\tref={ref}\n\t\t\ttestId={`item-${userId}`}\n\t\t\ttemplateColumns=\"auto 1fr auto\"\n\t\t\tcolumnGap=\"space.100\"\n\t\t\talignItems=\"center\"\n\t\t\txcss={[baseStyles, stateStyles[state.type]]}\n\t\t>\n\t\t\t<Box as=\"span\" xcss={noPointerEventsStyles}>\n\t\t\t\t<Avatar size=\"large\" src={avatarUrl} />\n\t\t\t</Box>\n\n\t\t\t<Stack space=\"space.050\" grow=\"fill\">\n\t\t\t\t<Heading size=\"xsmall\" as=\"span\">\n\t\t\t\t\t{name}\n\t\t\t\t</Heading>\n\t\t\t\t<Box as=\"small\" xcss={noMarginStyles}>\n\t\t\t\t\t{role}\n\t\t\t\t</Box>\n\t\t\t</Stack>\n\t\t\t<Box xcss={buttonColumnStyles}>\n\t\t\t\t<DropdownMenu\n\t\t\t\t\ttrigger={({ triggerRef, ...triggerProps }) => (\n\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\tref={\n\t\t\t\t\t\t\t\tactionMenuTriggerRef\n\t\t\t\t\t\t\t\t\t? mergeRefs([triggerRef, actionMenuTriggerRef])\n\t\t\t\t\t\t\t\t\t: // Workaround for IconButton typing issue\n\t\t\t\t\t\t\t\t\t\tmergeRefs([triggerRef])\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ticon={(iconProps) => <MoreIcon {...iconProps} size=\"small\" />}\n\t\t\t\t\t\t\tlabel={`Move ${name}`}\n\t\t\t\t\t\t\tappearance=\"default\"\n\t\t\t\t\t\t\tspacing=\"compact\"\n\t\t\t\t\t\t\t{...triggerProps}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tshouldRenderToParent\n\t\t\t\t>\n\t\t\t\t\t<LazyDropdownItems userId={userId} />\n\t\t\t\t</DropdownMenu>\n\t\t\t</Box>\n\t\t\t{closestEdge && <DropIndicator edge={closestEdge} gap={token('space.100', '0')} />}\n\t\t</Grid>\n\t);\n});\n\nexport const Card = memo(function Card({ item }: { item: Person }) {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tconst { userId } = item;\n\tconst [closestEdge, setClosestEdge] = useState<Edge | null>(null);\n\tconst [state, setState] = useState<State>(idleState);\n\n\tconst actionMenuTriggerRef = useRef<HTMLButtonElement>(null);\n\tconst { instanceId, registerCard } = useBoardContext();\n\tuseEffect(() => {\n\t\tinvariant(actionMenuTriggerRef.current);\n\t\tinvariant(ref.current);\n\t\treturn registerCard({\n\t\t\tcardId: userId,\n\t\t\tentry: {\n\t\t\t\telement: ref.current,\n\t\t\t\tactionMenuTrigger: actionMenuTriggerRef.current,\n\t\t\t},\n\t\t});\n\t}, [registerCard, userId]);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\t\treturn combine(\n\t\t\tdraggable({\n\t\t\t\telement: element,\n\t\t\t\tgetInitialData: () => ({ type: 'card', itemId: userId, instanceId }),\n\t\t\t\tonGenerateDragPreview: ({ location, source, nativeSetDragImage }) => {\n\t\t\t\t\tconst rect = source.element.getBoundingClientRect();\n\n\t\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\t\tgetOffset: preserveOffsetOnSource({\n\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\tinput: location.current.input,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\t\tsetState({ type: 'preview', container, rect });\n\t\t\t\t\t\t\treturn () => setState(draggingState);\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t},\n\n\t\t\t\tonDragStart: () => setState(draggingState),\n\t\t\t\tonDrop: () => setState(idleState),\n\t\t\t}),\n\t\t\tdropTargetForExternal({\n\t\t\t\telement: element,\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement: element,\n\t\t\t\tcanDrop: ({ source }) => {\n\t\t\t\t\treturn source.data.instanceId === instanceId && source.data.type === 'card';\n\t\t\t\t},\n\t\t\t\tgetIsSticky: () => true,\n\t\t\t\tgetData: ({ input, element }) => {\n\t\t\t\t\tconst data = { type: 'card', itemId: userId };\n\n\t\t\t\t\treturn attachClosestEdge(data, {\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\telement,\n\t\t\t\t\t\tallowedEdges: ['top', 'bottom'],\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragEnter: (args) => {\n\t\t\t\t\tif (args.source.data.itemId !== userId) {\n\t\t\t\t\t\tsetClosestEdge(extractClosestEdge(args.self.data));\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonDrag: (args) => {\n\t\t\t\t\tif (args.source.data.itemId !== userId) {\n\t\t\t\t\t\tsetClosestEdge(extractClosestEdge(args.self.data));\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonDragLeave: () => {\n\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t},\n\t\t\t\tonDrop: () => {\n\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [instanceId, item, userId]);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<CardPrimitive\n\t\t\t\tref={ref}\n\t\t\t\titem={item}\n\t\t\t\tstate={state}\n\t\t\t\tclosestEdge={closestEdge}\n\t\t\t\tactionMenuTriggerRef={actionMenuTriggerRef}\n\t\t\t/>\n\t\t\t{state.type === 'preview' &&\n\t\t\t\tReactDOM.createPortal(\n\t\t\t\t\t<Box\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Ensuring the preview has the same dimensions as the original.\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * Using `border-box` sizing here is not necessary in this\n\t\t\t\t\t\t\t * specific example, but it is safer to include generally.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\t\twidth: state.rect.width,\n\t\t\t\t\t\t\theight: state.rect.height,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<CardPrimitive item={item} state={state} closestEdge={null} />\n\t\t\t\t\t</Box>,\n\t\t\t\t\tstate.container,\n\t\t\t\t)}\n\t\t</Fragment>\n\t);\n});\n"
  },
  {
    "path": "packages/documentation/examples/pieces/board/column-context.tsx",
    "content": "import { createContext, useContext } from 'react';\n\nimport invariant from 'tiny-invariant';\n\nexport type ColumnContextProps = {\n\tcolumnId: string;\n\tgetCardIndex: (userId: string) => number;\n\tgetNumCards: () => number;\n};\n\nexport const ColumnContext = createContext<ColumnContextProps | null>(null);\n\nexport function useColumnContext(): ColumnContextProps {\n\tconst value = useContext(ColumnContext);\n\tinvariant(value, 'cannot find ColumnContext provider');\n\treturn value;\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/board/column.tsx",
    "content": "import React, { memo, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { createPortal } from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport { IconButton } from '@atlaskit/button/new';\nimport DropdownMenu, {\n\ttype CustomTriggerProps,\n\tDropdownItem,\n\tDropdownItemGroup,\n} from '@atlaskit/dropdown-menu';\n// eslint-disable-next-line @atlaskit/design-system/no-banned-imports\nimport mergeRefs from '@atlaskit/ds-lib/merge-refs';\nimport Heading from '@atlaskit/heading';\n// This is the smaller MoreIcon soon to be more easily accessible with the\n// ongoing icon project\nimport MoreIcon from '@atlaskit/icon/core/show-more-horizontal';\nimport { easeInOut } from '@atlaskit/motion/curves';\nimport { durations } from '@atlaskit/motion/durations';\nimport { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';\nimport {\n\tattachClosestEdge,\n\ttype Edge,\n\textractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { centerUnderPointer } from '@atlaskit/pragmatic-drag-and-drop/element/center-under-pointer';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Flex, Inline, Stack, xcss } from '@atlaskit/primitives';\nimport { token } from '@atlaskit/tokens';\n\nimport { type ColumnType } from '../../data/people';\n\nimport { useBoardContext } from './board-context';\nimport { Card } from './card';\nimport { ColumnContext, type ColumnContextProps, useColumnContext } from './column-context';\n\nconst columnStyles = xcss({\n\twidth: '250px',\n\tbackgroundColor: 'elevation.surface.sunken',\n\tborderRadius: 'radius.xlarge',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values\n\ttransition: `background ${durations.medium}ms ${easeInOut}`,\n\tposition: 'relative',\n\t/**\n\t * TODO: figure out hover color.\n\t * There is no `elevation.surface.sunken.hovered` token,\n\t * so leaving this for now.\n\t */\n});\n\nconst stackStyles = xcss({\n\t// allow the container to be shrunk by a parent height\n\t// https://www.joshwcomeau.com/css/interactive-guide-to-flexbox/#the-minimum-size-gotcha-11\n\tminHeight: '0',\n\n\t// ensure our card list grows to be all the available space\n\t// so that users can easily drop on en empty list\n\tflexGrow: 1,\n});\n\nconst scrollContainerStyles = xcss({\n\theight: '100%',\n\toverflowY: 'auto',\n});\n\nconst cardListStyles = xcss({\n\tboxSizing: 'border-box',\n\tminHeight: '100%',\n\tpadding: 'space.100',\n\tgap: 'space.100',\n});\n\nconst columnHeaderStyles = xcss({\n\tpaddingInlineStart: 'space.200',\n\tpaddingInlineEnd: 'space.200',\n\tpaddingBlockStart: 'space.100',\n\tcolor: 'color.text.subtlest',\n\tuserSelect: 'none',\n});\n\n/**\n * Note: not making `'is-dragging'` a `State` as it is\n * a _parallel_ state to `'is-column-over'`.\n *\n * Our board allows you to be over the column that is currently dragging\n */\ntype State =\n\t| { type: 'idle' }\n\t| { type: 'is-card-over' }\n\t| { type: 'is-column-over'; closestEdge: Edge | null }\n\t| { type: 'generate-safari-column-preview'; container: HTMLElement }\n\t| { type: 'generate-column-preview' };\n\n// preventing re-renders with stable state objects\nconst idle: State = { type: 'idle' };\nconst isCardOver: State = { type: 'is-card-over' };\n\nconst stateStyles: {\n\t[key in State['type']]: ReturnType<typeof xcss> | undefined;\n} = {\n\tidle: xcss({\n\t\tcursor: 'grab',\n\t}),\n\t'is-card-over': xcss({\n\t\tbackgroundColor: 'color.background.selected.hovered',\n\t}),\n\t'is-column-over': undefined,\n\t/**\n\t * **Browser bug workaround**\n\t *\n\t * _Problem_\n\t * When generating a drag preview for an element\n\t * that has an inner scroll container, the preview can include content\n\t * vertically before or after the element\n\t *\n\t * _Fix_\n\t * We make the column a new stacking context when the preview is being generated.\n\t * We are not making a new stacking context at all times, as this _can_ mess up\n\t * other layering components inside of your card\n\t *\n\t * _Fix: Safari_\n\t * We have not found a great workaround yet. So for now we are just rendering\n\t * a custom drag preview\n\t */\n\t'generate-column-preview': xcss({\n\t\tisolation: 'isolate',\n\t}),\n\t'generate-safari-column-preview': undefined,\n};\n\nconst isDraggingStyles = xcss({\n\topacity: 0.4,\n});\n\nexport const Column = memo(function Column({ column }: { column: ColumnType }) {\n\tconst columnId = column.columnId;\n\tconst columnRef = useRef<HTMLDivElement | null>(null);\n\tconst columnInnerRef = useRef<HTMLDivElement | null>(null);\n\tconst headerRef = useRef<HTMLDivElement | null>(null);\n\tconst scrollableRef = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<State>(idle);\n\tconst [isDragging, setIsDragging] = useState<boolean>(false);\n\n\tconst { instanceId, registerColumn } = useBoardContext();\n\n\tuseEffect(() => {\n\t\tinvariant(columnRef.current);\n\t\tinvariant(columnInnerRef.current);\n\t\tinvariant(headerRef.current);\n\t\tinvariant(scrollableRef.current);\n\t\treturn combine(\n\t\t\tregisterColumn({\n\t\t\t\tcolumnId,\n\t\t\t\tentry: {\n\t\t\t\t\telement: columnRef.current,\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdraggable({\n\t\t\t\telement: columnRef.current,\n\t\t\t\tdragHandle: headerRef.current,\n\t\t\t\tgetInitialData: () => ({ columnId, type: 'column', instanceId }),\n\t\t\t\tonGenerateDragPreview: ({ nativeSetDragImage }) => {\n\t\t\t\t\tconst isSafari: boolean =\n\t\t\t\t\t\tnavigator.userAgent.includes('AppleWebKit') && !navigator.userAgent.includes('Chrome');\n\n\t\t\t\t\tif (!isSafari) {\n\t\t\t\t\t\tsetState({ type: 'generate-column-preview' });\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\t\tgetOffset: centerUnderPointer,\n\t\t\t\t\t\trender: ({ container }) => {\n\t\t\t\t\t\t\tsetState({\n\t\t\t\t\t\t\t\ttype: 'generate-safari-column-preview',\n\t\t\t\t\t\t\t\tcontainer,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn () => setState(idle);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragStart: () => {\n\t\t\t\t\tsetIsDragging(true);\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tsetState(idle);\n\t\t\t\t\tsetIsDragging(false);\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement: columnInnerRef.current,\n\t\t\t\tgetData: () => ({ columnId }),\n\t\t\t\tcanDrop: ({ source }) => {\n\t\t\t\t\treturn source.data.instanceId === instanceId && source.data.type === 'card';\n\t\t\t\t},\n\t\t\t\tgetIsSticky: () => true,\n\t\t\t\tonDragEnter: () => setState(isCardOver),\n\t\t\t\tonDragLeave: () => setState(idle),\n\t\t\t\tonDragStart: () => setState(isCardOver),\n\t\t\t\tonDrop: () => setState(idle),\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement: columnRef.current,\n\t\t\t\tcanDrop: ({ source }) => {\n\t\t\t\t\treturn source.data.instanceId === instanceId && source.data.type === 'column';\n\t\t\t\t},\n\t\t\t\tgetIsSticky: () => true,\n\t\t\t\tgetData: ({ input, element }) => {\n\t\t\t\t\tconst data = {\n\t\t\t\t\t\tcolumnId,\n\t\t\t\t\t};\n\t\t\t\t\treturn attachClosestEdge(data, {\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\telement,\n\t\t\t\t\t\tallowedEdges: ['left', 'right'],\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragEnter: (args) => {\n\t\t\t\t\tsetState({\n\t\t\t\t\t\ttype: 'is-column-over',\n\t\t\t\t\t\tclosestEdge: extractClosestEdge(args.self.data),\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDrag: (args) => {\n\t\t\t\t\t// skip react re-render if edge is not changing\n\t\t\t\t\tsetState((current) => {\n\t\t\t\t\t\tconst closestEdge: Edge | null = extractClosestEdge(args.self.data);\n\t\t\t\t\t\tif (current.type === 'is-column-over' && current.closestEdge === closestEdge) {\n\t\t\t\t\t\t\treturn current;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttype: 'is-column-over',\n\t\t\t\t\t\t\tclosestEdge,\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragLeave: () => {\n\t\t\t\t\tsetState(idle);\n\t\t\t\t},\n\t\t\t\tonDrop: () => {\n\t\t\t\t\tsetState(idle);\n\t\t\t\t},\n\t\t\t}),\n\t\t\tautoScrollForElements({\n\t\t\t\telement: scrollableRef.current,\n\t\t\t\tcanScroll: ({ source }) =>\n\t\t\t\t\tsource.data.instanceId === instanceId && source.data.type === 'card',\n\t\t\t}),\n\t\t);\n\t}, [columnId, registerColumn, instanceId]);\n\n\tconst stableItems = useRef(column.items);\n\tuseEffect(() => {\n\t\tstableItems.current = column.items;\n\t}, [column.items]);\n\n\tconst getCardIndex = useCallback((userId: string) => {\n\t\treturn stableItems.current.findIndex((item) => item.userId === userId);\n\t}, []);\n\n\tconst getNumCards = useCallback(() => {\n\t\treturn stableItems.current.length;\n\t}, []);\n\n\tconst contextValue: ColumnContextProps = useMemo(() => {\n\t\treturn { columnId, getCardIndex, getNumCards };\n\t}, [columnId, getCardIndex, getNumCards]);\n\n\treturn (\n\t\t<ColumnContext.Provider value={contextValue}>\n\t\t\t<Flex\n\t\t\t\ttestId={`column-${columnId}`}\n\t\t\t\tref={columnRef}\n\t\t\t\tdirection=\"column\"\n\t\t\t\txcss={[columnStyles, stateStyles[state.type]]}\n\t\t\t>\n\t\t\t\t{/* This element takes up the same visual space as the column.\n          We are using a separate element so we can have two drop targets\n          that take up the same visual space (one for cards, one for columns)\n        */}\n\t\t\t\t<Stack xcss={stackStyles} ref={columnInnerRef}>\n\t\t\t\t\t<Stack xcss={[stackStyles, isDragging ? isDraggingStyles : undefined]}>\n\t\t\t\t\t\t<Inline\n\t\t\t\t\t\t\txcss={columnHeaderStyles}\n\t\t\t\t\t\t\tref={headerRef}\n\t\t\t\t\t\t\ttestId={`column-header-${columnId}`}\n\t\t\t\t\t\t\tspread=\"space-between\"\n\t\t\t\t\t\t\talignBlock=\"center\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Heading size=\"xxsmall\" as=\"span\" testId={`column-header-title-${columnId}`}>\n\t\t\t\t\t\t\t\t{column.title}\n\t\t\t\t\t\t\t</Heading>\n\t\t\t\t\t\t\t<ActionMenu />\n\t\t\t\t\t\t</Inline>\n\t\t\t\t\t\t<Box xcss={scrollContainerStyles} ref={scrollableRef}>\n\t\t\t\t\t\t\t<Stack xcss={cardListStyles} space=\"space.100\">\n\t\t\t\t\t\t\t\t{column.items.map((item) => (\n\t\t\t\t\t\t\t\t\t<Card item={item} key={item.userId} />\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t</Box>\n\t\t\t\t\t</Stack>\n\t\t\t\t</Stack>\n\t\t\t\t{state.type === 'is-column-over' && state.closestEdge && (\n\t\t\t\t\t<DropIndicator edge={state.closestEdge} gap={token('space.200', '0')} />\n\t\t\t\t)}\n\t\t\t</Flex>\n\t\t\t{state.type === 'generate-safari-column-preview'\n\t\t\t\t? createPortal(<SafariColumnPreview column={column} />, state.container)\n\t\t\t\t: null}\n\t\t</ColumnContext.Provider>\n\t);\n});\n\nconst safariPreviewStyles = xcss({\n\twidth: '250px',\n\tbackgroundColor: 'elevation.surface.sunken',\n\tborderRadius: 'radius.small',\n\tpadding: 'space.200',\n});\n\nfunction SafariColumnPreview({ column }: { column: ColumnType }) {\n\treturn (\n\t\t<Box xcss={[columnHeaderStyles, safariPreviewStyles]}>\n\t\t\t<Heading size=\"xxsmall\" as=\"span\">\n\t\t\t\t{column.title}\n\t\t\t</Heading>\n\t\t</Box>\n\t);\n}\n\nfunction ActionMenu() {\n\treturn (\n\t\t<DropdownMenu trigger={DropdownMenuTrigger} shouldRenderToParent>\n\t\t\t<ActionMenuItems />\n\t\t</DropdownMenu>\n\t);\n}\n\nfunction ActionMenuItems() {\n\tconst { columnId } = useColumnContext();\n\tconst { getColumns, reorderColumn } = useBoardContext();\n\n\tconst columns = getColumns();\n\tconst startIndex = columns.findIndex((column) => column.columnId === columnId);\n\n\tconst moveLeft = useCallback(() => {\n\t\treorderColumn({\n\t\t\tstartIndex,\n\t\t\tfinishIndex: startIndex - 1,\n\t\t});\n\t}, [reorderColumn, startIndex]);\n\n\tconst moveRight = useCallback(() => {\n\t\treorderColumn({\n\t\t\tstartIndex,\n\t\t\tfinishIndex: startIndex + 1,\n\t\t});\n\t}, [reorderColumn, startIndex]);\n\n\tconst isMoveLeftDisabled = startIndex === 0;\n\tconst isMoveRightDisabled = startIndex === columns.length - 1;\n\n\treturn (\n\t\t<DropdownItemGroup>\n\t\t\t<DropdownItem onClick={moveLeft} isDisabled={isMoveLeftDisabled}>\n\t\t\t\tMove left\n\t\t\t</DropdownItem>\n\t\t\t<DropdownItem onClick={moveRight} isDisabled={isMoveRightDisabled}>\n\t\t\t\tMove right\n\t\t\t</DropdownItem>\n\t\t</DropdownItemGroup>\n\t);\n}\n\nfunction DropdownMenuTrigger({ triggerRef, ...triggerProps }: CustomTriggerProps) {\n\treturn (\n\t\t<IconButton\n\t\t\tref={mergeRefs([triggerRef])}\n\t\t\tappearance=\"subtle\"\n\t\t\tlabel=\"Actions\"\n\t\t\tspacing=\"compact\"\n\t\t\ticon={(iconProps) => <MoreIcon {...iconProps} size=\"small\" />}\n\t\t\t{...triggerProps}\n\t\t/>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/board/registry.ts",
    "content": "import invariant from 'tiny-invariant';\n\nimport type { CleanupFn } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nexport type CardEntry = {\n\telement: HTMLElement;\n\tactionMenuTrigger: HTMLElement;\n};\n\nexport type ColumnEntry = {\n\telement: HTMLElement;\n};\n\n/**\n * Registering cards and their action menu trigger element,\n * so that we can restore focus to the trigger when a card moves between columns.\n */\nexport function createRegistry() {\n\tconst cards = new Map<string, CardEntry>();\n\tconst columns = new Map<string, ColumnEntry>();\n\n\tfunction registerCard({ cardId, entry }: { cardId: string; entry: CardEntry }): CleanupFn {\n\t\tcards.set(cardId, entry);\n\t\treturn function cleanup() {\n\t\t\tcards.delete(cardId);\n\t\t};\n\t}\n\n\tfunction registerColumn({\n\t\tcolumnId,\n\t\tentry,\n\t}: {\n\t\tcolumnId: string;\n\t\tentry: ColumnEntry;\n\t}): CleanupFn {\n\t\tcolumns.set(columnId, entry);\n\t\treturn function cleanup() {\n\t\t\tcards.delete(columnId);\n\t\t};\n\t}\n\n\tfunction getCard(cardId: string): CardEntry {\n\t\tconst entry = cards.get(cardId);\n\t\tinvariant(entry);\n\t\treturn entry;\n\t}\n\n\tfunction getColumn(columnId: string): ColumnEntry {\n\t\tconst entry = columns.get(columnId);\n\t\tinvariant(entry);\n\t\treturn entry;\n\t}\n\n\treturn { registerCard, registerColumn, getCard, getColumn };\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/board-with-multi-drag/board.tsx",
    "content": "import React, { memo, type ReactNode, useEffect, useRef } from 'react';\n\nimport invariant from 'tiny-invariant';\n\nimport { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Flex, xcss } from '@atlaskit/primitives';\n\nimport { GlobalStyles } from '../../util/global-styles';\n\nconst boardStyles = xcss({\n\tmargin: '0 auto',\n\tgap: 'space.200',\n\tflexDirection: 'row',\n\theight: '100%',\n\tboxSizing: 'border-box',\n});\n\nconst scrollContainerStyles = xcss({\n\toverflowY: 'auto',\n\theight: '600px',\n});\n\nfunction Board({ children }: { children: ReactNode }): React.JSX.Element {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tuseEffect(() => {\n\t\tinvariant(ref.current);\n\t\treturn autoScrollForElements({\n\t\t\telement: ref.current,\n\t\t});\n\t}, []);\n\treturn (\n\t\t<>\n\t\t\t<Box ref={ref} xcss={scrollContainerStyles}>\n\t\t\t\t<Flex xcss={boardStyles}>{children}</Flex>\n\t\t\t</Box>\n\t\t\t<GlobalStyles />\n\t\t</>\n\t);\n}\n\nexport default memo(Board);\n"
  },
  {
    "path": "packages/documentation/examples/pieces/board-with-multi-drag/card.tsx",
    "content": "import React, {\n\tforwardRef,\n\ttype KeyboardEvent,\n\tmemo,\n\ttype MouseEvent,\n\ttype MouseEventHandler,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from 'react';\n\nimport ReactDOM from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport Avatar from '@atlaskit/avatar';\nimport Heading from '@atlaskit/heading';\nimport {\n\tattachClosestEdge,\n\ttype Edge,\n\textractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Stack, xcss } from '@atlaskit/primitives';\n\nimport { type Person } from '../../data/people';\nimport { cardGap } from '../../util/constants';\n\ntype DraggableState =\n\t| { type: 'idle' }\n\t| { type: 'preview'; container: HTMLElement; rect: DOMRect }\n\t| { type: 'is-card-over'; closestEdge: Edge | null }\n\t| { type: 'dragging' };\n\nconst idleState: DraggableState = { type: 'idle' };\nconst draggingState: DraggableState = { type: 'dragging' };\n\nconst noMarginStyles = xcss({ margin: 'space.0' });\nconst noPointerEventsStyles = xcss({ pointerEvents: 'none' });\nconst containerStyles = xcss({\n\twidth: '100%',\n\tborderRadius: 'radius.large',\n\tboxShadow: 'elevation.shadow.raised',\n\tposition: 'relative',\n\tdisplay: 'grid',\n\tgridTemplateColumns: 'auto 1fr auto',\n\tgap: 'space.100',\n\talignItems: 'center',\n});\nconst selectionCountStyles = xcss({\n\tright: 'space.negative.100',\n\ttop: 'space.negative.100',\n\tcolor: 'color.text.inverse',\n\tbackgroundColor: 'color.background.accent.gray.subtle',\n\tborderRadius: 'radius.full',\n\theight: 'size.200',\n\twidth: 'size.200',\n\tlineHeight: '1.5rem',\n\tposition: 'absolute',\n\ttextAlign: 'center',\n\tfontWeight: 'font.weight.semibold',\n});\n\nconst stateStyles: {\n\t[Key in DraggableState['type']]?: ReturnType<typeof xcss> | undefined;\n} = {\n\tdragging: xcss({\n\t\topacity: 0,\n\t}),\n};\n\nconst selectedStyles = xcss({\n\tbackgroundColor: 'color.background.selected',\n});\n\nconst draggingStyles = xcss({\n\topacity: 0.4,\n});\n\n// https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button\nconst primaryButton = 0;\n\ntype CardPrimitiveProps = {\n\tisDragging?: boolean;\n\tisSelected: boolean;\n\titem: Person;\n\tstate: DraggableState;\n\tonClick?: MouseEventHandler;\n};\n\nconst CardPrimitive = forwardRef<HTMLDivElement, CardPrimitiveProps>(function CardPrimitive(\n\t{ item, isDragging, isSelected, state, onClick },\n\tref,\n) {\n\tconst { avatarUrl, name, role, userId } = item;\n\n\treturn (\n\t\t// eslint-disable-next-line @atlassian/a11y/interactive-element-not-keyboard-focusable\n\t\t<Box\n\t\t\tref={ref}\n\t\t\ttestId={`item-${userId}`}\n\t\t\tbackgroundColor=\"elevation.surface\"\n\t\t\tpadding=\"space.100\"\n\t\t\tonClick={onClick}\n\t\t\trole=\"button\"\n\t\t\ttabIndex={0}\n\t\t\txcss={[\n\t\t\t\tcontainerStyles,\n\t\t\t\tstateStyles[state.type],\n\t\t\t\tisSelected && selectedStyles,\n\t\t\t\tisSelected && isDragging && draggingStyles,\n\t\t\t]}\n\t\t>\n\t\t\t<Box as=\"span\" xcss={noPointerEventsStyles}>\n\t\t\t\t<Avatar size=\"large\" src={avatarUrl} />\n\t\t\t</Box>\n\t\t\t<Stack space=\"space.050\" grow=\"fill\">\n\t\t\t\t<Heading size=\"xsmall\" as=\"span\">\n\t\t\t\t\t{name}\n\t\t\t\t</Heading>\n\t\t\t\t<Box as=\"small\" xcss={noMarginStyles}>\n\t\t\t\t\t{role}\n\t\t\t\t</Box>\n\t\t\t</Stack>\n\t\t\t{state.type === 'is-card-over' && state.closestEdge && (\n\t\t\t\t<DropIndicator edge={state.closestEdge} gap={`${cardGap}px`} />\n\t\t\t)}\n\t\t</Box>\n\t);\n});\n\n// Determines if the platform specific toggle selection in group key was used\nconst wasToggleInSelectionGroupKeyUsed = (event: MouseEvent | KeyboardEvent) => {\n\tconst isUsingWindows = navigator.platform.indexOf('Win') >= 0;\n\treturn isUsingWindows ? event.ctrlKey : event.metaKey;\n};\n\n// Determines if the multiSelect key was used\nconst wasMultiSelectKeyUsed = (event: MouseEvent | KeyboardEvent) => event.shiftKey;\n\ntype CardProps = {\n\titem: Person;\n\tisDragging: boolean;\n\tisSelected: boolean;\n\tselectedCount: number;\n\tmultiSelectTo: (id: string) => void;\n\ttoggleSelection: (id: string) => void;\n\ttoggleSelectionInGroup: (id: string) => void;\n};\n\nexport const Card = memo(function Card({\n\titem,\n\tisDragging,\n\tisSelected,\n\tselectedCount,\n\tmultiSelectTo,\n\ttoggleSelection,\n\ttoggleSelectionInGroup,\n}: CardProps) {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tconst { userId } = item;\n\tconst [state, setState] = useState<DraggableState>(idleState);\n\n\tuseEffect(() => {\n\t\tinvariant(ref.current);\n\t\treturn combine(\n\t\t\tdraggable({\n\t\t\t\telement: ref.current,\n\t\t\t\tgetInitialData: () => ({ type: 'card', itemId: userId }),\n\t\t\t\tonGenerateDragPreview: ({ location, source, nativeSetDragImage }) => {\n\t\t\t\t\tconst rect = source.element.getBoundingClientRect();\n\t\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\t\tgetOffset() {\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * This offset ensures that the preview is positioned relative to\n\t\t\t\t\t\t\t * the cursor based on where you drag from.\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * This creates the effect of it being picked up.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tx: location.current.input.clientX - rect.x,\n\t\t\t\t\t\t\t\ty: location.current.input.clientY - rect.y,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t},\n\t\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\t\tsetState({ type: 'preview', container, rect });\n\t\t\t\t\t\t\treturn () => setState(draggingState);\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragStart: () => setState(draggingState),\n\t\t\t\tonDrop: () => setState(idleState),\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement: ref.current,\n\t\t\t\tcanDrop: (args) => args.source.data.type === 'card',\n\t\t\t\tgetIsSticky: () => true,\n\t\t\t\tgetData: ({ input, element }) => {\n\t\t\t\t\tconst data = { type: 'card', itemId: userId };\n\t\t\t\t\treturn attachClosestEdge(data, {\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\telement,\n\t\t\t\t\t\tallowedEdges: ['top', 'bottom'],\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragEnter: (args) => {\n\t\t\t\t\tif (args.source.data.itemId === userId) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst closestEdge: Edge | null = extractClosestEdge(args.self.data);\n\t\t\t\t\tsetState({\n\t\t\t\t\t\ttype: 'is-card-over',\n\t\t\t\t\t\tclosestEdge,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDrag: (args) => {\n\t\t\t\t\tif (args.source.data.itemId === userId) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst closestEdge: Edge | null = extractClosestEdge(args.self.data);\n\t\t\t\t\t// conditionally update react state if change has occurred\n\t\t\t\t\tsetState((current) => {\n\t\t\t\t\t\tif (current.type !== 'is-card-over') {\n\t\t\t\t\t\t\treturn current;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (current.closestEdge === closestEdge) {\n\t\t\t\t\t\t\treturn current;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttype: 'is-card-over',\n\t\t\t\t\t\t\tclosestEdge,\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragLeave: () => {\n\t\t\t\t\tsetState(idleState);\n\t\t\t\t},\n\t\t\t\tonDrop: () => {\n\t\t\t\t\tsetState(idleState);\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [item, userId]);\n\n\tconst performAction = (event: KeyboardEvent | MouseEvent) => {\n\t\tif (wasToggleInSelectionGroupKeyUsed(event)) {\n\t\t\ttoggleSelectionInGroup(userId);\n\t\t\treturn;\n\t\t}\n\n\t\tif (wasMultiSelectKeyUsed(event)) {\n\t\t\tmultiSelectTo(userId);\n\t\t\treturn;\n\t\t}\n\n\t\ttoggleSelection(userId);\n\t};\n\n\tconst handleCardClick = (event: MouseEvent) => {\n\t\tif (event.defaultPrevented) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (event.button !== primaryButton) {\n\t\t\treturn;\n\t\t}\n\n\t\t// marking the event as used\n\t\tevent.preventDefault();\n\n\t\tperformAction(event);\n\t};\n\n\treturn (\n\t\t<>\n\t\t\t<CardPrimitive\n\t\t\t\tref={ref}\n\t\t\t\titem={item}\n\t\t\t\tstate={state}\n\t\t\t\tisDragging={isDragging}\n\t\t\t\tisSelected={isSelected}\n\t\t\t\tonClick={handleCardClick}\n\t\t\t/>\n\t\t\t{state.type === 'preview' &&\n\t\t\t\tReactDOM.createPortal(\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Ensuring the preview has the same dimensions as the original.\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * Using `border-box` sizing here is not necessary in this\n\t\t\t\t\t\t\t * specific example, but it is safer to include generally.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\t\twidth: state.rect.width,\n\t\t\t\t\t\t\theight: state.rect.height,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<CardPrimitive item={item} state={state} isSelected />\n\t\t\t\t\t\t{selectedCount > 0 && <Box xcss={selectionCountStyles}>{selectedCount}</Box>}\n\t\t\t\t\t</div>,\n\t\t\t\t\tstate.container,\n\t\t\t\t)}\n\t\t</>\n\t);\n});\n"
  },
  {
    "path": "packages/documentation/examples/pieces/board-with-multi-drag/column.tsx",
    "content": "import React, { memo, useEffect, useRef, useState } from 'react';\n\nimport { createPortal } from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport Heading from '@atlaskit/heading';\nimport { easeInOut } from '@atlaskit/motion/curves';\nimport { durations } from '@atlaskit/motion/durations';\nimport { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';\nimport {\n\tattachClosestEdge,\n\ttype Edge,\n\textractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { centerUnderPointer } from '@atlaskit/pragmatic-drag-and-drop/element/center-under-pointer';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Inline, Stack, type XCSS, xcss } from '@atlaskit/primitives';\n\nimport { type ColumnType } from '../../data/people';\nimport { columnGap } from '../../util/constants';\n\nimport { Card } from './card';\n\nconst columnStyles = xcss({\n\twidth: '250px',\n\tbackgroundColor: 'elevation.surface.sunken',\n\tborderRadius: 'radius.xlarge',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values\n\ttransition: `background ${durations.medium}ms ${easeInOut}`,\n\tposition: 'relative',\n\tpaddingBottom: 'space.600', // a fake footer for now\n});\n\nconst scrollContainerStyles = xcss({\n\theight: '100%',\n\toverflowY: 'auto',\n});\n\nconst cardListStyles = xcss({\n\tboxSizing: 'border-box',\n\tminHeight: '100%',\n\tpadding: 'space.100',\n});\n\nconst columnHeaderStyles = xcss({\n\tpadding: 'space.200',\n\tpaddingBlockEnd: 'space.100',\n\tjustifyContent: 'space-between',\n\tcolor: 'color.text.subtlest',\n\tuserSelect: 'none',\n});\n\ntype State =\n\t| { type: 'idle' }\n\t| { type: 'is-card-over' }\n\t| { type: 'generate-safari-column-preview'; container: HTMLElement }\n\t| { type: 'generate-column-preview' }\n\t| { type: 'is-column-over'; closestEdge: Edge | null };\n\n// preventing re-renders\nconst idle: State = { type: 'idle' };\nconst isCardOver: State = { type: 'is-card-over' };\n\nconst stateStyles: { [key in State['type']]: XCSS | undefined } = {\n\tidle: undefined,\n\t'is-column-over': undefined,\n\t'is-card-over': xcss({\n\t\tbackgroundColor: 'color.background.selected.hovered',\n\t}),\n\t/**\n\t * **Browser bug workaround**\n\t *\n\t * _Problem_\n\t * When generating a drag preview for an element\n\t * that has an inner scroll container, the preview can include content\n\t * vertically before or after the element\n\t *\n\t * _Fix_\n\t * We make the column a new stacking context when the preview is being generated.\n\t * We are not making a new stacking context at all times, as this _can_ mess up\n\t * other layering components inside of your card\n\t *\n\t * _Fix: Safari_\n\t * We have not found a great workaround yet. So for now we are just rendering\n\t * a custom drag preview\n\t */\n\t'generate-column-preview': xcss({\n\t\tisolation: 'isolate',\n\t}),\n\t'generate-safari-column-preview': undefined,\n};\n\ntype ColumnProps = {\n\tcolumn: ColumnType;\n\tisDraggingCard: boolean;\n\tselectedUserIds: string[];\n\tmultiSelectTo: (userId: string) => void;\n\ttoggleSelection: (userId: string) => void;\n\ttoggleSelectionInGroup: (userId: string) => void;\n};\n\nexport const Column = memo(function Column({\n\tcolumn,\n\tselectedUserIds,\n\tisDraggingCard,\n\tmultiSelectTo,\n\ttoggleSelection,\n\ttoggleSelectionInGroup,\n}: ColumnProps) {\n\tconst columnId = column.columnId;\n\tconst columnRef = useRef<HTMLDivElement | null>(null);\n\tconst headerRef = useRef<HTMLDivElement | null>(null);\n\tconst cardListRef = useRef<HTMLDivElement | null>(null);\n\tconst scrollContainerRef = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<State>(idle);\n\n\tuseEffect(() => {\n\t\tinvariant(columnRef.current);\n\t\tinvariant(headerRef.current);\n\t\tinvariant(cardListRef.current);\n\t\tinvariant(scrollContainerRef.current);\n\t\treturn combine(\n\t\t\tdraggable({\n\t\t\t\telement: columnRef.current,\n\t\t\t\tdragHandle: headerRef.current,\n\t\t\t\tgetInitialData: () => ({ columnId, type: 'column' }),\n\t\t\t\tonGenerateDragPreview: ({ nativeSetDragImage }) => {\n\t\t\t\t\tconst isSafari: boolean =\n\t\t\t\t\t\tnavigator.userAgent.includes('AppleWebKit') && !navigator.userAgent.includes('Chrome');\n\n\t\t\t\t\tif (!isSafari) {\n\t\t\t\t\t\t// TODO: scroll container preview is wacky when scrolled\n\t\t\t\t\t\t// scrolling the container to the start does not seem to fix it\n\t\t\t\t\t\t// Likely we will need to generate a custom preview\n\t\t\t\t\t\tsetState({ type: 'generate-column-preview' });\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\t\tgetOffset: centerUnderPointer,\n\t\t\t\t\t\trender: ({ container }) => {\n\t\t\t\t\t\t\tsetState({ type: 'generate-safari-column-preview', container });\n\t\t\t\t\t\t\treturn () => setState(idle);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragStart: () => {\n\t\t\t\t\tsetState(idle);\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement: cardListRef.current,\n\t\t\t\tgetData: () => ({ columnId }),\n\t\t\t\tcanDrop: (args) => args.source.data.type === 'card',\n\t\t\t\tgetIsSticky: () => true,\n\t\t\t\tonDragEnter: () => setState(isCardOver),\n\t\t\t\tonDragLeave: () => setState(idle),\n\t\t\t\tonDragStart: () => setState(isCardOver),\n\t\t\t\tonDrop: () => setState(idle),\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement: columnRef.current,\n\t\t\t\tcanDrop: (args) => args.source.data.type === 'column',\n\t\t\t\tgetIsSticky: () => true,\n\t\t\t\tgetData: ({ input, element }) => {\n\t\t\t\t\tconst data = {\n\t\t\t\t\t\tcolumnId,\n\t\t\t\t\t};\n\t\t\t\t\treturn attachClosestEdge(data, {\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\telement,\n\t\t\t\t\t\tallowedEdges: ['left', 'right'],\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragEnter: (args) => {\n\t\t\t\t\tsetState({\n\t\t\t\t\t\ttype: 'is-column-over',\n\t\t\t\t\t\tclosestEdge: extractClosestEdge(args.self.data),\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDrag: (args) => {\n\t\t\t\t\t// skip react re-render if edge is not changing\n\t\t\t\t\tsetState((current) => {\n\t\t\t\t\t\tconst closestEdge: Edge | null = extractClosestEdge(args.self.data);\n\t\t\t\t\t\tif (current.type === 'is-column-over' && current.closestEdge === closestEdge) {\n\t\t\t\t\t\t\treturn current;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttype: 'is-column-over',\n\t\t\t\t\t\t\tclosestEdge,\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragLeave: () => {\n\t\t\t\t\tsetState(idle);\n\t\t\t\t},\n\t\t\t\tonDrop: () => {\n\t\t\t\t\tsetState(idle);\n\t\t\t\t},\n\t\t\t}),\n\t\t\tautoScrollForElements({\n\t\t\t\telement: scrollContainerRef.current,\n\t\t\t\tcanScroll: ({ source }) => source.data.type === 'card',\n\t\t\t}),\n\t\t);\n\t}, [columnId]);\n\n\treturn (\n\t\t<>\n\t\t\t<Stack xcss={[columnStyles, stateStyles[state.type]]} ref={columnRef}>\n\t\t\t\t<Inline xcss={columnHeaderStyles} ref={headerRef} testId={`column-${columnId}--header`}>\n\t\t\t\t\t<Heading size=\"xxsmall\" as=\"span\">\n\t\t\t\t\t\t{column.title}\n\t\t\t\t\t</Heading>\n\t\t\t\t</Inline>\n\t\t\t\t<Box xcss={scrollContainerStyles} ref={scrollContainerRef}>\n\t\t\t\t\t<Stack xcss={cardListStyles} space=\"space.100\" ref={cardListRef}>\n\t\t\t\t\t\t{column.items.map((item) => (\n\t\t\t\t\t\t\t<Card\n\t\t\t\t\t\t\t\titem={item}\n\t\t\t\t\t\t\t\tkey={item.userId}\n\t\t\t\t\t\t\t\tisDragging={isDraggingCard}\n\t\t\t\t\t\t\t\tisSelected={selectedUserIds.some((id) => id === item.userId)}\n\t\t\t\t\t\t\t\tselectedCount={selectedUserIds.length}\n\t\t\t\t\t\t\t\tmultiSelectTo={multiSelectTo}\n\t\t\t\t\t\t\t\ttoggleSelection={toggleSelection}\n\t\t\t\t\t\t\t\ttoggleSelectionInGroup={toggleSelectionInGroup}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</Stack>\n\t\t\t\t</Box>\n\t\t\t\t{state.type === 'is-column-over' && state.closestEdge && (\n\t\t\t\t\t<DropIndicator edge={state.closestEdge} gap={`${columnGap}px`} />\n\t\t\t\t)}\n\t\t\t</Stack>\n\t\t\t{state.type === 'generate-safari-column-preview'\n\t\t\t\t? createPortal(<SafariColumnPreview column={column} />, state.container)\n\t\t\t\t: null}\n\t\t</>\n\t);\n});\n\nconst previewStyles = xcss({\n\twidth: '250px',\n\tbackgroundColor: 'elevation.surface.sunken',\n\tborderRadius: 'radius.xlarge',\n\tpadding: 'space.200',\n});\n\nfunction SafariColumnPreview({ column }: { column: ColumnType }) {\n\treturn (\n\t\t<Box xcss={[columnHeaderStyles, previewStyles]}>\n\t\t\t<Heading size=\"xxsmall\" as=\"span\">\n\t\t\t\t{column.title}\n\t\t\t</Heading>\n\t\t</Box>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/board-with-overflow-scroll/board.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport { Fragment, memo, type ReactNode, useEffect, useRef } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';\nimport { autoScrollForExternal } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/external';\nimport { unsafeOverflowAutoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/unsafe-overflow/element';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { token } from '@atlaskit/tokens';\n\nimport { columnGap } from '../../util/constants';\nimport { GlobalStyles } from '../../util/global-styles';\n\nconst boardStyles = css({\n\t'--grid': token('space.100'),\n\tdisplay: 'flex',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766\n\tgap: columnGap,\n\tflexDirection: 'row',\n\theight: '100%',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766\n\tpadding: columnGap,\n\tboxSizing: 'border-box',\n\twidth: 'min-content', // doing this so that we get the correct padding around the element\n});\n\nconst scrollContainerStyles = css({\n\tborder: `${token('border.width', '2px')} solid ${token('color.chart.purple.bold', 'purple')}`,\n\t// maxWidth: 600,\n\tmaxWidth: '80vw',\n\toverflowY: 'auto',\n\t// TODO: remove margin before shipping\n\tmargin: 'calc(var(--grid) * 4) auto 0 auto',\n\t// height: '150vh',\n\theight: 600,\n});\n\nfunction Board({ children }: { children: ReactNode }): React.JSX.Element {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tuseEffect(() => {\n\t\tinvariant(ref.current);\n\t\treturn combine(\n\t\t\tautoScrollForElements({\n\t\t\t\telement: ref.current,\n\t\t\t}),\n\t\t\tunsafeOverflowAutoScrollForElements({\n\t\t\t\telement: ref.current,\n\t\t\t\tgetOverflow: () => ({\n\t\t\t\t\tforTopEdge: {\n\t\t\t\t\t\ttop: 6000,\n\t\t\t\t\t\tright: 6000,\n\t\t\t\t\t\tleft: 6000,\n\t\t\t\t\t},\n\t\t\t\t\tforRightEdge: {\n\t\t\t\t\t\ttop: 6000,\n\t\t\t\t\t\tright: 6000,\n\t\t\t\t\t\tbottom: 6000,\n\t\t\t\t\t},\n\t\t\t\t\tforBottomEdge: {\n\t\t\t\t\t\tright: 6000,\n\t\t\t\t\t\tbottom: 6000,\n\t\t\t\t\t\tleft: 6000,\n\t\t\t\t\t},\n\t\t\t\t\tforLeftEdge: {\n\t\t\t\t\t\ttop: 6000,\n\t\t\t\t\t\tleft: 6000,\n\t\t\t\t\t\tbottom: 6000,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t}),\n\t\t\tautoScrollForExternal({\n\t\t\t\telement: ref.current,\n\t\t\t}),\n\t\t);\n\t}, []);\n\treturn (\n\t\t<Fragment>\n\t\t\t<div ref={ref} css={scrollContainerStyles}>\n\t\t\t\t<div css={boardStyles}>{children}</div>\n\t\t\t</div>\n\t\t\t<GlobalStyles />\n\t\t</Fragment>\n\t);\n}\n\nexport default memo(Board);\n"
  },
  {
    "path": "packages/documentation/examples/pieces/board-with-overflow-scroll/card.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { forwardRef, Fragment, memo, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport ReactDOM from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport Avatar from '@atlaskit/avatar';\nimport { IconButton } from '@atlaskit/button/new';\nimport Heading from '@atlaskit/heading';\nimport MoreIcon from '@atlaskit/icon/core/show-more-horizontal';\nimport {\n\tattachClosestEdge,\n\ttype Edge,\n\textractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\nimport { dropTargetForExternal } from '@atlaskit/pragmatic-drag-and-drop/external/adapter';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Stack, xcss } from '@atlaskit/primitives';\n\nimport { type Person } from '../../data/people';\nimport { cardGap } from '../../util/constants';\n\ntype DraggableState =\n\t| { type: 'idle' }\n\t| { type: 'preview'; container: HTMLElement; rect: DOMRect }\n\t| { type: 'is-card-over'; closestEdge: Edge | null }\n\t| { type: 'is-file-over' }\n\t| { type: 'dragging' };\n\nconst idleState: DraggableState = { type: 'idle' };\nconst draggingState: DraggableState = { type: 'dragging' };\n\nconst noMarginStyles = css({ margin: 0 });\nconst noPointerEventsStyles = css({ pointerEvents: 'none' });\nconst containerStyles = xcss({\n\twidth: '100%',\n\tborderRadius: 'radius.large',\n\tboxShadow: 'elevation.shadow.raised',\n\tposition: 'relative',\n\tdisplay: 'grid',\n\tgridTemplateColumns: 'auto 1fr auto',\n\tgap: 'space.100',\n\talignItems: 'center',\n});\n\nconst stateStyles: {\n\t[Key in DraggableState['type']]?: ReturnType<typeof xcss> | undefined;\n} = {\n\tdragging: xcss({\n\t\topacity: 0.4,\n\t}),\n\t'is-file-over': xcss({\n\t\tbackgroundColor: 'color.background.selected.hovered',\n\t}),\n};\n\ntype CardPrimitiveProps = {\n\titem: Person;\n\tstate: DraggableState;\n};\n\nconst CardPrimitive = forwardRef<HTMLDivElement, CardPrimitiveProps>(function CardPrimitive(\n\t{ item, state },\n\tref,\n) {\n\tconst { avatarUrl, name, role, userId } = item;\n\n\treturn (\n\t\t<Box\n\t\t\tref={ref}\n\t\t\ttestId={`item-${userId}`}\n\t\t\tbackgroundColor=\"elevation.surface\"\n\t\t\tpadding=\"space.100\"\n\t\t\txcss={[containerStyles, stateStyles[state.type]]}\n\t\t>\n\t\t\t<span css={noPointerEventsStyles}>\n\t\t\t\t<Avatar size=\"large\" src={avatarUrl} />\n\t\t\t</span>\n\n\t\t\t<Stack space=\"space.050\" grow=\"fill\">\n\t\t\t\t<Heading size=\"xsmall\" as=\"span\">\n\t\t\t\t\t{name}\n\t\t\t\t</Heading>\n\t\t\t\t<small css={noMarginStyles}>{role}</small>\n\t\t\t</Stack>\n\t\t\t<IconButton icon={MoreIcon} appearance=\"subtle\" label=\"...\" />\n\t\t\t{state.type === 'is-card-over' && state.closestEdge && (\n\t\t\t\t<DropIndicator edge={state.closestEdge} gap={`${cardGap}px`} />\n\t\t\t)}\n\t\t</Box>\n\t);\n});\n\nexport const Card = memo(function Card({ item }: { item: Person }) {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tconst { userId } = item;\n\tconst [state, setState] = useState<DraggableState>(idleState);\n\n\tuseEffect(() => {\n\t\tinvariant(ref.current);\n\t\treturn combine(\n\t\t\tdraggable({\n\t\t\t\telement: ref.current,\n\t\t\t\tgetInitialData: () => ({ type: 'card', itemId: userId }),\n\t\t\t\tonGenerateDragPreview: ({ location, source, nativeSetDragImage }) => {\n\t\t\t\t\tconst rect = source.element.getBoundingClientRect();\n\n\t\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\t\tgetOffset() {\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * This offset ensures that the preview is positioned relative to\n\t\t\t\t\t\t\t * the cursor based on where you drag from.\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * This creates the effect of it being picked up.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tx: location.current.input.clientX - rect.x,\n\t\t\t\t\t\t\t\ty: location.current.input.clientY - rect.y,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t},\n\t\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\t\tsetState({ type: 'preview', container, rect });\n\t\t\t\t\t\t\treturn () => setState(draggingState);\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t},\n\n\t\t\t\tonDragStart: () => setState(draggingState),\n\t\t\t\tonDrop: () => setState(idleState),\n\t\t\t}),\n\t\t\tdropTargetForExternal({\n\t\t\t\telement: ref.current,\n\t\t\t\tonDragEnter: (args) => {\n\t\t\t\t\tsetState({ type: 'is-file-over' });\n\t\t\t\t},\n\t\t\t\tonDragLeave: () => {\n\t\t\t\t\tsetState(idleState);\n\t\t\t\t},\n\t\t\t\tonDrop: () => {\n\t\t\t\t\tsetState(idleState);\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement: ref.current,\n\t\t\t\tcanDrop: (args) => args.source.data.type === 'card',\n\t\t\t\tgetIsSticky: () => true,\n\t\t\t\tgetData: ({ input, element }) => {\n\t\t\t\t\tconst data = { type: 'card', itemId: userId };\n\n\t\t\t\t\treturn attachClosestEdge(data, {\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\telement,\n\t\t\t\t\t\tallowedEdges: ['top', 'bottom'],\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragEnter: (args) => {\n\t\t\t\t\tif (args.source.data.itemId === userId) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst closestEdge: Edge | null = extractClosestEdge(args.self.data);\n\t\t\t\t\tsetState({\n\t\t\t\t\t\ttype: 'is-card-over',\n\t\t\t\t\t\tclosestEdge,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDrag: (args) => {\n\t\t\t\t\tif (args.source.data.itemId === userId) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst closestEdge: Edge | null = extractClosestEdge(args.self.data);\n\t\t\t\t\t// conditionally update react state if change has occurred\n\t\t\t\t\tsetState((current) => {\n\t\t\t\t\t\tif (current.type !== 'is-card-over') {\n\t\t\t\t\t\t\treturn current;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (current.closestEdge === closestEdge) {\n\t\t\t\t\t\t\treturn current;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttype: 'is-card-over',\n\t\t\t\t\t\t\tclosestEdge,\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragLeave: () => {\n\t\t\t\t\tsetState(idleState);\n\t\t\t\t},\n\t\t\t\tonDrop: () => {\n\t\t\t\t\tsetState(idleState);\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [item, userId]);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<CardPrimitive ref={ref} item={item} state={state} />\n\t\t\t{state.type === 'preview' &&\n\t\t\t\tReactDOM.createPortal(\n\t\t\t\t\t<div\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Ensuring the preview has the same dimensions as the original.\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * Using `border-box` sizing here is not necessary in this\n\t\t\t\t\t\t\t * specific example, but it is safer to include generally.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\t\twidth: state.rect.width,\n\t\t\t\t\t\t\theight: state.rect.height,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<CardPrimitive item={item} state={state} />\n\t\t\t\t\t</div>,\n\t\t\t\t\tstate.container,\n\t\t\t\t)}\n\t\t</Fragment>\n\t);\n});\n"
  },
  {
    "path": "packages/documentation/examples/pieces/board-with-overflow-scroll/column.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { Fragment, memo, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx, type SerializedStyles } from '@emotion/react';\nimport { createPortal } from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport Heading from '@atlaskit/heading';\nimport { easeInOut } from '@atlaskit/motion/curves';\nimport { durations } from '@atlaskit/motion/durations';\nimport { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';\nimport { autoScrollForExternal } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/external';\nimport { unsafeOverflowAutoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/unsafe-overflow/element';\nimport {\n\tattachClosestEdge,\n\ttype Edge,\n\textractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { centerUnderPointer } from '@atlaskit/pragmatic-drag-and-drop/element/center-under-pointer';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\nimport { token } from '@atlaskit/tokens';\n\nimport { type ColumnType } from '../../data/people';\nimport { cardGap, columnGap } from '../../util/constants';\n\nimport { Card } from './card';\n\nconst columnStyles = css({\n\tdisplay: 'flex',\n\twidth: 250,\n\tflexShrink: 0, // locking the column widths to force container scrolling\n\tflexDirection: 'column',\n\tbackground: token('elevation.surface.sunken', '#F7F8F9'),\n\tborderRadius: 'calc(var(--grid) * 2)',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values\n\ttransition: `background ${durations.medium}ms ${easeInOut}`,\n\tposition: 'relative',\n\tpaddingBottom: token('space.600', '0'), // a fake footer for now\n});\n\nconst scrollContainerStyles = css({\n\theight: '100%',\n\toverflowY: 'auto',\n});\n\nconst cardListStyles = css({\n\tdisplay: 'flex',\n\tboxSizing: 'border-box',\n\tminHeight: '100%',\n\tpadding: 'var(--grid)',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766\n\tgap: cardGap,\n\tflexDirection: 'column',\n});\n\nconst columnHeaderStyles = css({\n\tdisplay: 'flex',\n\t// width: 240,\n\tpadding: 'calc(var(--grid) * 2) calc(var(--grid) * 2) calc(var(--grid) * 1)',\n\tjustifyContent: 'space-between',\n\tflexDirection: 'row',\n\tcolor: token('color.text.subtlest', '#626F86'),\n\tuserSelect: 'none',\n});\n\ntype State =\n\t| { type: 'idle' }\n\t| { type: 'is-card-over' }\n\t| { type: 'generate-safari-column-preview'; container: HTMLElement }\n\t| { type: 'generate-column-preview' }\n\t| { type: 'is-column-over'; closestEdge: Edge | null };\n\n// preventing re-renders\nconst idle: State = { type: 'idle' };\nconst isCardOver: State = { type: 'is-card-over' };\n\nconst stateStyles: { [key in State['type']]: SerializedStyles | undefined } = {\n\tidle: undefined,\n\t'is-column-over': undefined,\n\t'is-card-over': css({\n\t\tbackground: token('color.background.selected.hovered', '#CCE0FF'),\n\t}),\n\t/**\n\t * **Browser bug workaround**\n\t *\n\t * _Problem_\n\t * When generating a drag preview for an element\n\t * that has an inner scroll container, the preview can include content\n\t * vertically before or after the element\n\t *\n\t * _Fix_\n\t * We make the column a new stacking context when the preview is being generated.\n\t * We are not making a new stacking context at all times, as this _can_ mess up\n\t * other layering components inside of your card\n\t *\n\t * _Fix: Safari_\n\t * We have not found a great workaround yet. So for now we are just rendering\n\t * a custom drag preview\n\t */\n\t'generate-column-preview': css({\n\t\tisolation: 'isolate',\n\t}),\n\t'generate-safari-column-preview': undefined,\n};\n\nexport const Column = memo(function Column({ column }: { column: ColumnType }) {\n\tconst columnId = column.columnId;\n\tconst columnRef = useRef<HTMLDivElement | null>(null);\n\tconst headerRef = useRef<HTMLDivElement | null>(null);\n\tconst cardListRef = useRef<HTMLDivElement | null>(null);\n\tconst scrollContainerRef = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<State>(idle);\n\n\tuseEffect(() => {\n\t\tinvariant(columnRef.current);\n\t\tinvariant(headerRef.current);\n\t\tinvariant(cardListRef.current);\n\t\tinvariant(scrollContainerRef.current);\n\t\treturn combine(\n\t\t\tdraggable({\n\t\t\t\telement: columnRef.current,\n\t\t\t\tdragHandle: headerRef.current,\n\t\t\t\tgetInitialData: () => ({ columnId, type: 'column' }),\n\t\t\t\tonGenerateDragPreview: ({ nativeSetDragImage }) => {\n\t\t\t\t\tconst isSafari: boolean =\n\t\t\t\t\t\tnavigator.userAgent.includes('AppleWebKit') && !navigator.userAgent.includes('Chrome');\n\n\t\t\t\t\tif (!isSafari) {\n\t\t\t\t\t\t// TODO: scroll container preview is wacky when scrolled\n\t\t\t\t\t\t// scrolling the container to the start does not seem to fix it\n\t\t\t\t\t\t// Likely we will need to generate a custom preview\n\t\t\t\t\t\tsetState({ type: 'generate-column-preview' });\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\t\tgetOffset: centerUnderPointer,\n\t\t\t\t\t\trender: ({ container }) => {\n\t\t\t\t\t\t\tsetState({ type: 'generate-safari-column-preview', container });\n\t\t\t\t\t\t\treturn () => setState(idle);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragStart: () => {\n\t\t\t\t\tsetState(idle);\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement: cardListRef.current,\n\t\t\t\tgetData: () => ({ columnId }),\n\t\t\t\tcanDrop: (args) => args.source.data.type === 'card',\n\t\t\t\tgetIsSticky: () => true,\n\t\t\t\tonDragEnter: () => setState(isCardOver),\n\t\t\t\tonDragLeave: () => setState(idle),\n\t\t\t\tonDragStart: () => setState(isCardOver),\n\t\t\t\tonDrop: () => setState(idle),\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement: columnRef.current,\n\t\t\t\tcanDrop: (args) => args.source.data.type === 'column',\n\t\t\t\tgetIsSticky: () => true,\n\t\t\t\tgetData: ({ input, element }) => {\n\t\t\t\t\tconst data = {\n\t\t\t\t\t\tcolumnId,\n\t\t\t\t\t};\n\t\t\t\t\treturn attachClosestEdge(data, {\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\telement,\n\t\t\t\t\t\tallowedEdges: ['left', 'right'],\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragEnter: (args) => {\n\t\t\t\t\tsetState({\n\t\t\t\t\t\ttype: 'is-column-over',\n\t\t\t\t\t\tclosestEdge: extractClosestEdge(args.self.data),\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDrag: (args) => {\n\t\t\t\t\t// skip react re-render if edge is not changing\n\t\t\t\t\tsetState((current) => {\n\t\t\t\t\t\tconst closestEdge: Edge | null = extractClosestEdge(args.self.data);\n\t\t\t\t\t\tif (current.type === 'is-column-over' && current.closestEdge === closestEdge) {\n\t\t\t\t\t\t\treturn current;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttype: 'is-column-over',\n\t\t\t\t\t\t\tclosestEdge,\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragLeave: () => {\n\t\t\t\t\tsetState(idle);\n\t\t\t\t},\n\t\t\t\tonDrop: () => {\n\t\t\t\t\tsetState(idle);\n\t\t\t\t},\n\t\t\t}),\n\t\t\tautoScrollForElements({\n\t\t\t\telement: scrollContainerRef.current,\n\t\t\t\tcanScroll: ({ source }) => source.data.type === 'card',\n\t\t\t}),\n\t\t\tunsafeOverflowAutoScrollForElements({\n\t\t\t\telement: scrollContainerRef.current,\n\t\t\t\tcanScroll: ({ source }) => source.data.type === 'card',\n\t\t\t\tgetOverflow: () => ({\n\t\t\t\t\tforTopEdge: {\n\t\t\t\t\t\ttop: 6000,\n\t\t\t\t\t\tright: 0,\n\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t},\n\t\t\t\t\tforRightEdge: {\n\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\tright: 0,\n\t\t\t\t\t\tbottom: 0,\n\t\t\t\t\t},\n\t\t\t\t\tforBottomEdge: {\n\t\t\t\t\t\tright: 0,\n\t\t\t\t\t\tbottom: 6000,\n\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t},\n\t\t\t\t\tforLeftEdge: {\n\t\t\t\t\t\ttop: 0,\n\t\t\t\t\t\tbottom: 0,\n\t\t\t\t\t\tleft: 0,\n\t\t\t\t\t},\n\t\t\t\t}),\n\t\t\t}),\n\t\t\tautoScrollForExternal({\n\t\t\t\telement: scrollContainerRef.current,\n\t\t\t}),\n\t\t);\n\t}, [columnId]);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<div css={[columnStyles, stateStyles[state.type]]} ref={columnRef}>\n\t\t\t\t<div css={columnHeaderStyles} ref={headerRef} data-testid={`column-${columnId}--header`}>\n\t\t\t\t\t<Heading size=\"xxsmall\" as=\"span\">\n\t\t\t\t\t\t{column.title}\n\t\t\t\t\t</Heading>\n\t\t\t\t</div>\n\t\t\t\t<div css={scrollContainerStyles} ref={scrollContainerRef}>\n\t\t\t\t\t<div css={cardListStyles} ref={cardListRef}>\n\t\t\t\t\t\t{column.items.map((item) => (\n\t\t\t\t\t\t\t<Card item={item} key={item.userId} />\n\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t{state.type === 'is-column-over' && state.closestEdge && (\n\t\t\t\t\t<DropIndicator edge={state.closestEdge} gap={`${columnGap}px`} />\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t{state.type === 'generate-safari-column-preview'\n\t\t\t\t? createPortal(<SafariColumnPreview column={column} />, state.container)\n\t\t\t\t: null}\n\t\t</Fragment>\n\t);\n});\n\nconst previewStyles = css({\n\t'--grid': '8px',\n\twidth: 250,\n\tbackground: token('elevation.surface.sunken', '#F7F8F9'),\n\tborderRadius: 'calc(var(--grid) * 2)',\n\tpadding: 'calc(var(--grid) * 2)',\n});\n\nfunction SafariColumnPreview({ column }: { column: ColumnType }) {\n\treturn (\n\t\t<div css={[columnHeaderStyles, previewStyles]}>\n\t\t\t<Heading size=\"xxsmall\" as=\"span\">\n\t\t\t\t{column.title}\n\t\t\t</Heading>\n\t\t</div>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/chess/piece.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { memo, type ReactElement, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nimport king from '../../icons/king.png';\nimport pawn from '../../icons/pawn.png';\n\nexport const pieceLookup: {\n\t[Key in PieceType]: (location: [number, number]) => ReactElement;\n} = {\n\tking: (location) => <King location={location} />,\n\tpawn: (location) => <Pawn location={location} />,\n};\n\nexport type PieceType = 'king' | 'pawn';\nconst pieceTypes: PieceType[] = ['king', 'pawn'];\n\nexport const isPieceType = (value: unknown): value is PieceType =>\n\ttypeof value === 'string' && pieceTypes.includes(value as PieceType);\n\nconst imageSizeStyles = css({\n\twidth: 60,\n\theight: 60,\n});\n\nconst hidePieceStyles = css({\n\topacity: 0,\n});\n\nconst Piece = memo(function Piece({\n\tlocation,\n\tpieceType,\n\timage,\n\talt,\n}: {\n\tlocation: [number, number];\n\tpieceType: PieceType;\n\timage: string;\n\talt: string;\n}) {\n\tconst ref = useRef<HTMLImageElement | null>(null);\n\tconst [dragging, setDragging] = useState<boolean>(false);\n\n\tuseEffect(() => {\n\t\tconst el = ref.current;\n\t\tinvariant(el);\n\n\t\treturn draggable({\n\t\t\telement: el,\n\t\t\tgetInitialData: () => ({ type: 'grid-item', location, pieceType }),\n\t\t\tonDragStart: () => setDragging(true),\n\t\t\tonDrop: () => setDragging(false),\n\t\t});\n\t}, [location, pieceType]);\n\n\treturn (\n\t\t<img css={[dragging && hidePieceStyles, imageSizeStyles]} src={image} alt={alt} ref={ref} />\n\t);\n});\n\nexport const King = ({ location }: { location: [number, number] }): React.JSX.Element => (\n\t<Piece location={location} pieceType={'king'} image={king} alt=\"King\" />\n);\n\nexport const Pawn = ({ location }: { location: [number, number] }): React.JSX.Element => (\n\t<Piece location={location} pieceType={'pawn'} image={pawn} alt=\"Pawn\" />\n);\n"
  },
  {
    "path": "packages/documentation/examples/pieces/chess/square.tsx",
    "content": "/** @jsxRuntime classic */\n/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { memo, type ReactNode, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdropTargetForElements,\n\tmonitorForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nimport { canMove, type coord, isCoord, isEqualCoord, type PieceRecord } from '../../chess';\n\nimport { isPieceType } from './piece';\n\ninterface SquareProps {\n\tpieces: PieceRecord[];\n\tlocation: coord;\n\tchildren: ReactNode;\n}\n\nconst squareStyles = css({\n\twidth: '100%',\n\theight: '100%',\n\tdisplay: 'flex',\n\tjustifyContent: 'center',\n\talignItems: 'center',\n});\n\nconst circleIndicatorStyles = css({\n\tbackgroundImage: \"url('../../icons/circle.svg')\",\n\tbackgroundRepeat: 'no-repeat',\n\tbackgroundPosition: 'center center',\n\tbackgroundSize: '20px 20px',\n});\n\ntype State =\n\t| { pieceSelected: false }\n\t| {\n\t\t\tpieceSelected: true;\n\t\t\tisDraggedOver: boolean;\n\t\t\tisValidMove: boolean;\n\t  };\n\nconst getColour = (state: State, isDark: boolean): string => {\n\tif (state.pieceSelected && state.isValidMove && state.isDraggedOver) {\n\t\treturn 'lightgreen';\n\t}\n\tif (state.pieceSelected && !state.isValidMove && state.isDraggedOver) {\n\t\treturn 'pink';\n\t}\n\n\treturn isDark ? 'lightgrey' : 'white';\n};\n\nconst isStateEqual = (a: State, b: State): boolean => {\n\tconst aKeys = Object.keys(a).sort();\n\tconst bKeys = Object.keys(b).sort();\n\n\tif (aKeys.length !== bKeys.length) {\n\t\treturn false;\n\t}\n\n\treturn aKeys.every((aKey, index) => aKey === bKeys[index]);\n};\n\nconst Square = memo(function Square({ pieces, location, children }: SquareProps) {\n\tconst ref = useRef<HTMLImageElement | null>(null);\n\tconst [state, setState] = useState<State>({ pieceSelected: false });\n\n\tuseEffect(() => {\n\t\tconst el = ref.current;\n\t\tinvariant(el);\n\n\t\treturn combine(\n\t\t\tdropTargetForElements({\n\t\t\t\telement: el,\n\t\t\t\tgetData: () => ({ location }),\n\t\t\t\tgetDropEffect: () => 'move',\n\t\t\t\tcanDrop: ({ source }) =>\n\t\t\t\t\tsource.data.type === 'grid-item' &&\n\t\t\t\t\tisCoord(source.data.location) &&\n\t\t\t\t\t!isEqualCoord(source.data.location, location),\n\t\t\t\tonDragEnter: () => setState((state) => ({ ...state, isDraggedOver: true })),\n\t\t\t\tonDragLeave: () => setState((state) => ({ ...state, isDraggedOver: false })),\n\t\t\t}),\n\t\t\tmonitorForElements({\n\t\t\t\tonDragStart({ source }) {\n\t\t\t\t\tif (\n\t\t\t\t\t\t!isCoord(source.data.location) ||\n\t\t\t\t\t\t!isPieceType(source.data.pieceType) ||\n\t\t\t\t\t\tisEqualCoord(source.data.location, location)\n\t\t\t\t\t) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (canMove(source.data.location, location, source.data.pieceType, pieces)) {\n\t\t\t\t\t\tsetState((current) => {\n\t\t\t\t\t\t\tconst proposed = {\n\t\t\t\t\t\t\t\tpieceSelected: true,\n\t\t\t\t\t\t\t\tisDraggedOver: false,\n\t\t\t\t\t\t\t\tisValidMove: true,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\treturn isStateEqual(current, proposed) ? current : proposed;\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetState((current) => {\n\t\t\t\t\t\t\tconst proposed = {\n\t\t\t\t\t\t\t\tpieceSelected: true,\n\t\t\t\t\t\t\t\tisDraggedOver: false,\n\t\t\t\t\t\t\t\tisValidMove: false,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\treturn isStateEqual(current, proposed) ? current : proposed;\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tsetState({\n\t\t\t\t\t\tpieceSelected: false,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [location, pieces]);\n\n\tconst isDark = (location[0] + location[1]) % 2 === 1;\n\tconst colour = getColour(state, isDark);\n\n\treturn (\n\t\t<div\n\t\t\tcss={[squareStyles, state.pieceSelected && state.isValidMove && circleIndicatorStyles]}\n\t\t\tstyle={{ backgroundColor: colour }}\n\t\t\tref={ref}\n\t\t>\n\t\t\t{children}\n\t\t</div>\n\t);\n});\n\nexport default Square;\n"
  },
  {
    "path": "packages/documentation/examples/pieces/drawing/line-overlay.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { forwardRef, type RefObject, useCallback, useImperativeHandle, useRef } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx, keyframes } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport { token } from '@atlaskit/tokens';\n\ntype Point = { x: number; y: number };\n\nexport type LineOverlayHandle = {\n\tdrawActive: (args: { from: Point; to: Point }) => void;\n\tdrawFinished: (args: { from: Point; to: Point }) => void;\n\tshowActive: () => void;\n\thideActive: () => void;\n};\n\nconst lineOverlayStyles = css({\n\twidth: '100%',\n\theight: '100%',\n\tposition: 'absolute',\n\ttop: 0,\n\tleft: 0,\n\tpointerEvents: 'none',\n\tstroke: token('color.border.bold', '#738496'),\n\tstrokeWidth: 4,\n});\n\nconst activeLineAnimation = keyframes({\n\tfrom: { strokeDashoffset: 0 },\n\tto: { strokeDashoffset: -24 },\n});\n\nconst activeLineStyles = css({\n\tanimationName: activeLineAnimation,\n\tanimationDuration: '250ms',\n\tanimationTimingFunction: 'linear',\n\tanimationIterationCount: 'infinite',\n\tstroke: token('color.border.selected', '#579DFF'),\n\tstrokeDasharray: '16px 8px',\n});\n\nfunction setPoints(\n\tline: SVGLineElement,\n\t{ from, to }: { from: Point; to: Point },\n\tref: RefObject<SVGSVGElement>,\n) {\n\tif (to.x <= 0 || to.y <= 0) {\n\t\treturn;\n\t}\n\n\tif (ref.current === null) {\n\t\treturn;\n\t}\n\n\tconst svg = ref.current;\n\tconst rect = svg.getBoundingClientRect();\n\n\tline.setAttribute('x1', (from.x - rect.x).toFixed());\n\tline.setAttribute('y1', (from.y - rect.y).toFixed());\n\tline.setAttribute('x2', (to.x - rect.x).toFixed());\n\tline.setAttribute('y2', (to.y - rect.y).toFixed());\n}\n\nfunction createLine() {\n\tconst line = document.createElementNS('http://www.w3.org/2000/svg', 'line');\n\treturn line;\n}\n\nconst Lines = forwardRef<LineOverlayHandle, {}>(({}, ref) => {\n\tinvariant(ref !== null && 'current' in ref, 'ref is a ref object');\n\n\tconst svgRef = useRef<SVGSVGElement>(null);\n\n\tconst getActive = useCallback(() => {\n\t\tconst active = svgRef.current?.getElementById('active');\n\t\tinvariant(active, 'active line exists');\n\t\treturn active as SVGLineElement;\n\t}, []);\n\n\tconst showActive = useCallback(() => {\n\t\tconst line = getActive();\n\t\tline.style.opacity = '1';\n\t}, [getActive]);\n\n\tconst hideActive = useCallback(() => {\n\t\tconst line = getActive();\n\t\tline.style.opacity = '0';\n\t}, [getActive]);\n\n\tconst drawActive = useCallback(\n\t\t(args: { from: Point; to: Point }) => {\n\t\t\tconst line = getActive();\n\t\t\tsetPoints(line, args, svgRef);\n\t\t\tshowActive();\n\t\t},\n\t\t[getActive, showActive],\n\t);\n\n\tconst drawFinished = useCallback((args: { from: Point; to: Point }) => {\n\t\tconst line = createLine();\n\t\tsetPoints(line, args, svgRef);\n\t\tsvgRef.current?.appendChild(line);\n\t}, []);\n\n\tuseImperativeHandle<LineOverlayHandle, any>(\n\t\tref,\n\t\t() => ({\n\t\t\tdrawActive,\n\t\t\tdrawFinished,\n\t\t\thideActive,\n\t\t\tshowActive,\n\t\t}),\n\t\t[drawActive, drawFinished, hideActive, showActive],\n\t);\n\n\treturn (\n\t\t<svg css={lineOverlayStyles} ref={svgRef}>\n\t\t\t<line id=\"active\" css={activeLineStyles} />\n\t\t</svg>\n\t);\n});\n\nexport default Lines;\n"
  },
  {
    "path": "packages/documentation/examples/pieces/drawing/shape.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { type ReactNode, useEffect, useRef } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { token } from '@atlaskit/tokens';\n\nconst shapes = ['square', 'circle', 'triangle'] as const;\n\nexport type ShapeType = (typeof shapes)[number];\n\nexport const size = 48;\nconst strokeWidth = 4;\n\nconst shapeStyles = css({\n\tdisplay: 'flex',\n\twidth: size,\n\theight: size,\n\tposition: 'relative',\n\tstrokeWidth,\n\tstroke: token('color.border', '#091E4224'),\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':nth-of-type(1)': {\n\t\tfill: token('color.background.accent.red.bolder', '#CA3521'),\n\t},\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':nth-of-type(2)': {\n\t\tfill: token('color.background.accent.orange.bolder', '#B65C02'),\n\t},\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':nth-of-type(3)': {\n\t\tfill: token('color.background.accent.yellow.bolder', '#946F00'),\n\t},\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':nth-of-type(4)': {\n\t\tfill: token('color.background.accent.green.bolder', '#1F845A'),\n\t},\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':nth-of-type(5)': {\n\t\tfill: token('color.background.accent.blue.bolder', '#0C66E4'),\n\t},\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':nth-of-type(6)': {\n\t\tfill: token('color.background.accent.purple.bolder', '#6E5DC6'),\n\t},\n});\n\nconst shapeSVG: Record<ShapeType, ReactNode> = {\n\tsquare: (\n\t\t<rect\n\t\t\tx={strokeWidth / 2}\n\t\t\ty={strokeWidth / 2}\n\t\t\twidth={size - strokeWidth}\n\t\t\theight={size - strokeWidth}\n\t\t/>\n\t),\n\tcircle: <circle cx={size / 2} cy={size / 2} r={(size - strokeWidth) / 2} />,\n\ttriangle: (\n\t\t<polygon\n\t\t\tpoints={[\n\t\t\t\t[strokeWidth, size - strokeWidth],\n\t\t\t\t[size / 2, strokeWidth],\n\t\t\t\t[size - strokeWidth, size - strokeWidth],\n\t\t\t].join(' ')}\n\t\t/>\n\t),\n};\n\nconst Shape = ({\n\tshape,\n\tcanDrag,\n\tonDrag: onDragProp,\n}: {\n\tshape: ShapeType;\n\tcanDrag: boolean;\n\tonDrag?: (args: { from: Element; to: { x: number; y: number } }) => void;\n}): React.JSX.Element => {\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tuseEffect(() => {\n\t\tinvariant(ref.current);\n\t\treturn combine(\n\t\t\tdraggable({\n\t\t\t\telement: ref.current,\n\t\t\t\tcanDrag() {\n\t\t\t\t\treturn canDrag;\n\t\t\t\t},\n\t\t\t\tgetInitialData() {\n\t\t\t\t\treturn { type: 'shape', shape };\n\t\t\t\t},\n\t\t\t\tonDrag({ location, source }) {\n\t\t\t\t\tconst currentPosition = {\n\t\t\t\t\t\tx: location.current.input.clientX,\n\t\t\t\t\t\ty: location.current.input.clientY,\n\t\t\t\t\t};\n\t\t\t\t\tonDragProp?.({\n\t\t\t\t\t\tfrom: source.element,\n\t\t\t\t\t\tto: currentPosition,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonGenerateDragPreview() {\n\t\t\t\t\tif (ref.current) {\n\t\t\t\t\t\tref.current.style.opacity = '0';\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonDragStart() {\n\t\t\t\t\tif (ref.current) {\n\t\t\t\t\t\tref.current.style.opacity = '1';\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement: ref.current,\n\t\t\t\tgetData() {\n\t\t\t\t\treturn { type: 'shape', shape };\n\t\t\t\t},\n\t\t\t\tcanDrop({ source }) {\n\t\t\t\t\tconst isSameShape = source.data.shape === shape;\n\t\t\t\t\tconst isDifferentElement = source.element !== ref.current;\n\t\t\t\t\treturn isSameShape && isDifferentElement;\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [canDrag, onDragProp, shape]);\n\n\treturn (\n\t\t<div css={shapeStyles} ref={ref} data-shape={shape}>\n\t\t\t<svg>{shapeSVG[shape]}</svg>\n\t\t</div>\n\t);\n};\n\nexport default Shape;\n"
  },
  {
    "path": "packages/documentation/examples/pieces/getting-started/chessboard-colored-drop-targets.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { type ReactElement } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport { King, Pawn } from './draggable-piece-with-data';\nimport Square from './square-with-hovering-coloring';\n\nexport type Coord = [number, number];\n\nexport type PieceRecord = {\n\ttype: PieceType;\n\tlocation: Coord;\n};\n\nexport type PieceType = 'king' | 'pawn';\n\nexport function isCoord(token: unknown): token is Coord {\n\treturn (\n\t\tArray.isArray(token) && token.length === 2 && token.every((val) => typeof val === 'number')\n\t);\n}\n\nconst pieceTypes: PieceType[] = ['king', 'pawn'];\n\nexport function isPieceType(value: unknown): value is PieceType {\n\treturn typeof value === 'string' && pieceTypes.includes(value as PieceType);\n}\n\nexport function isEqualCoord(c1: Coord, c2: Coord): boolean {\n\treturn c1[0] === c2[0] && c1[1] === c2[1];\n}\n\nexport const pieceLookup: {\n\t[Key in PieceType]: (location: [number, number]) => ReactElement;\n} = {\n\tking: (location) => <King location={location} />,\n\tpawn: (location) => <Pawn location={location} />,\n};\n\nexport function canMove(\n\tstart: Coord,\n\tdestination: Coord,\n\tpieceType: PieceType,\n\tpieces: PieceRecord[],\n): boolean {\n\tconst rowDist = Math.abs(start[0] - destination[0]);\n\tconst colDist = Math.abs(start[1] - destination[1]);\n\n\tif (pieces.find((piece) => isEqualCoord(piece.location, destination))) {\n\t\treturn false;\n\t}\n\n\tswitch (pieceType) {\n\t\tcase 'king':\n\t\t\treturn [0, 1].includes(rowDist) && [0, 1].includes(colDist);\n\t\tcase 'pawn':\n\t\t\treturn colDist === 0 && start[0] - destination[0] === -1;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\nfunction renderSquares(pieces: PieceRecord[]) {\n\tconst squares = [];\n\tfor (let row = 0; row < 8; row++) {\n\t\tfor (let col = 0; col < 8; col++) {\n\t\t\tconst squareCoord: Coord = [row, col];\n\n\t\t\tconst piece = pieces.find((piece) => isEqualCoord(piece.location, squareCoord));\n\n\t\t\tsquares.push(\n\t\t\t\t<Square pieces={pieces} location={squareCoord}>\n\t\t\t\t\t{piece && pieceLookup[piece.type](squareCoord)}\n\t\t\t\t</Square>,\n\t\t\t);\n\t\t}\n\t}\n\treturn squares;\n}\n\nfunction Chessboard(): React.JSX.Element {\n\tconst pieces: PieceRecord[] = [\n\t\t{ type: 'king', location: [3, 2] },\n\t\t{ type: 'pawn', location: [1, 6] },\n\t];\n\n\treturn <div css={chessboardStyles}>{renderSquares(pieces)}</div>;\n}\n\nconst chessboardStyles = css({\n\tdisplay: 'grid',\n\tgridTemplateColumns: 'repeat(8, 1fr)',\n\tgridTemplateRows: 'repeat(8, 1fr)',\n\twidth: '500px',\n\theight: '500px',\n\tborder: '3px solid lightgrey',\n});\n\nexport default Chessboard;\n"
  },
  {
    "path": "packages/documentation/examples/pieces/getting-started/chessboard-draggable.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { type ReactElement } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport { King, Pawn } from './draggable-piece-with-state';\n\nexport type Coord = [number, number];\n\nexport type PieceRecord = {\n\ttype: PieceType;\n\tlocation: Coord;\n};\n\nexport type PieceType = 'king' | 'pawn';\n\nexport function isEqualCoord(c1: Coord, c2: Coord): boolean {\n\treturn c1[0] === c2[0] && c1[1] === c2[1];\n}\n\nexport const pieceLookup: {\n\t[Key in PieceType]: () => ReactElement;\n} = {\n\tking: () => <King />,\n\tpawn: () => <Pawn />,\n};\n\nfunction renderSquares(pieces: PieceRecord[]) {\n\tconst squares = [];\n\tfor (let row = 0; row < 8; row++) {\n\t\tfor (let col = 0; col < 8; col++) {\n\t\t\tconst squareCoord: Coord = [row, col];\n\n\t\t\tconst piece = pieces.find((piece) => isEqualCoord(piece.location, squareCoord));\n\n\t\t\tconst isDark = (row + col) % 2 === 1;\n\n\t\t\tsquares.push(\n\t\t\t\t<div css={squareStyles} style={{ backgroundColor: isDark ? 'lightgrey' : 'white' }}>\n\t\t\t\t\t{piece && pieceLookup[piece.type]()}\n\t\t\t\t</div>,\n\t\t\t);\n\t\t}\n\t}\n\treturn squares;\n}\n\nfunction Chessboard(): React.JSX.Element {\n\tconst pieces: PieceRecord[] = [\n\t\t{ type: 'king', location: [3, 2] },\n\t\t{ type: 'pawn', location: [1, 6] },\n\t];\n\n\treturn <div css={chessboardStyles}>{renderSquares(pieces)}</div>;\n}\n\nconst chessboardStyles = css({\n\tdisplay: 'grid',\n\tgridTemplateColumns: 'repeat(8, 1fr)',\n\tgridTemplateRows: 'repeat(8, 1fr)',\n\twidth: '500px',\n\theight: '500px',\n\tborder: '3px solid lightgrey',\n});\n\nconst squareStyles = css({\n\twidth: '100%',\n\theight: '100%',\n\tdisplay: 'flex',\n\tjustifyContent: 'center',\n\talignItems: 'center',\n});\n\nexport default Chessboard;\n"
  },
  {
    "path": "packages/documentation/examples/pieces/getting-started/chessboard-drop-target.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { type ReactElement } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport { King, Pawn } from './draggable-piece-with-state';\nimport Square from './square-drop-target';\n\nexport type Coord = [number, number];\n\nexport type PieceRecord = {\n\ttype: PieceType;\n\tlocation: Coord;\n};\n\nexport type PieceType = 'king' | 'pawn';\n\nexport function isEqualCoord(c1: Coord, c2: Coord): boolean {\n\treturn c1[0] === c2[0] && c1[1] === c2[1];\n}\n\nexport const pieceLookup: {\n\t[Key in PieceType]: () => ReactElement;\n} = {\n\tking: () => <King />,\n\tpawn: () => <Pawn />,\n};\n\nfunction renderSquares(pieces: PieceRecord[]) {\n\tconst squares = [];\n\tfor (let row = 0; row < 8; row++) {\n\t\tfor (let col = 0; col < 8; col++) {\n\t\t\tconst squareCoord: Coord = [row, col];\n\n\t\t\tconst piece = pieces.find((piece) => isEqualCoord(piece.location, squareCoord));\n\n\t\t\tsquares.push(<Square location={squareCoord}>{piece && pieceLookup[piece.type]()}</Square>);\n\t\t}\n\t}\n\treturn squares;\n}\n\nfunction Chessboard(): React.JSX.Element {\n\tconst pieces: PieceRecord[] = [\n\t\t{ type: 'king', location: [3, 2] },\n\t\t{ type: 'pawn', location: [1, 6] },\n\t];\n\n\treturn <div css={chessboardStyles}>{renderSquares(pieces)}</div>;\n}\n\nconst chessboardStyles = css({\n\tdisplay: 'grid',\n\tgridTemplateColumns: 'repeat(8, 1fr)',\n\tgridTemplateRows: 'repeat(8, 1fr)',\n\twidth: '500px',\n\theight: '500px',\n\tborder: '3px solid lightgrey',\n});\n\nexport default Chessboard;\n"
  },
  {
    "path": "packages/documentation/examples/pieces/getting-started/chessboard-drop-targets-can-drop.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { type ReactElement } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport { King, Pawn } from './draggable-piece-with-data';\nimport Square from './square-with-can-drop';\n\nexport type Coord = [number, number];\n\nexport type PieceRecord = {\n\ttype: PieceType;\n\tlocation: Coord;\n};\n\nexport type PieceType = 'king' | 'pawn';\n\nexport function isCoord(token: unknown): token is Coord {\n\treturn (\n\t\tArray.isArray(token) && token.length === 2 && token.every((val) => typeof val === 'number')\n\t);\n}\n\nconst pieceTypes: PieceType[] = ['king', 'pawn'];\n\nexport function isPieceType(value: unknown): value is PieceType {\n\treturn typeof value === 'string' && pieceTypes.includes(value as PieceType);\n}\n\nexport function isEqualCoord(c1: Coord, c2: Coord): boolean {\n\treturn c1[0] === c2[0] && c1[1] === c2[1];\n}\n\nexport const pieceLookup: {\n\t[Key in PieceType]: (location: [number, number]) => ReactElement;\n} = {\n\tking: (location) => <King location={location} />,\n\tpawn: (location) => <Pawn location={location} />,\n};\n\nexport function canMove(\n\tstart: Coord,\n\tdestination: Coord,\n\tpieceType: PieceType,\n\tpieces: PieceRecord[],\n): boolean {\n\tconst rowDist = Math.abs(start[0] - destination[0]);\n\tconst colDist = Math.abs(start[1] - destination[1]);\n\n\tif (pieces.find((piece) => isEqualCoord(piece.location, destination))) {\n\t\treturn false;\n\t}\n\n\tswitch (pieceType) {\n\t\tcase 'king':\n\t\t\treturn [0, 1].includes(rowDist) && [0, 1].includes(colDist);\n\t\tcase 'pawn':\n\t\t\treturn colDist === 0 && start[0] - destination[0] === -1;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\nfunction renderSquares(pieces: PieceRecord[]) {\n\tconst squares = [];\n\tfor (let row = 0; row < 8; row++) {\n\t\tfor (let col = 0; col < 8; col++) {\n\t\t\tconst squareCoord: Coord = [row, col];\n\n\t\t\tconst piece = pieces.find((piece) => isEqualCoord(piece.location, squareCoord));\n\n\t\t\tsquares.push(\n\t\t\t\t<Square pieces={pieces} location={squareCoord}>\n\t\t\t\t\t{piece && pieceLookup[piece.type](squareCoord)}\n\t\t\t\t</Square>,\n\t\t\t);\n\t\t}\n\t}\n\treturn squares;\n}\n\nfunction Chessboard(): React.JSX.Element {\n\tconst pieces: PieceRecord[] = [\n\t\t{ type: 'king', location: [3, 2] },\n\t\t{ type: 'pawn', location: [1, 6] },\n\t];\n\n\treturn <div css={chessboardStyles}>{renderSquares(pieces)}</div>;\n}\n\nconst chessboardStyles = css({\n\tdisplay: 'grid',\n\tgridTemplateColumns: 'repeat(8, 1fr)',\n\tgridTemplateRows: 'repeat(8, 1fr)',\n\twidth: '500px',\n\theight: '500px',\n\tborder: '3px solid lightgrey',\n});\n\nexport default Chessboard;\n"
  },
  {
    "path": "packages/documentation/examples/pieces/getting-started/chessboard-monitor.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { type ReactElement, useEffect, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nimport { King, Pawn } from './draggable-piece-with-data';\nimport Square from './square-with-data';\n\nexport type Coord = [number, number];\n\nexport type PieceRecord = {\n\ttype: PieceType;\n\tlocation: Coord;\n};\n\nexport type PieceType = 'king' | 'pawn';\n\nexport function isCoord(token: unknown): token is Coord {\n\treturn (\n\t\tArray.isArray(token) && token.length === 2 && token.every((val) => typeof val === 'number')\n\t);\n}\n\nconst pieceTypes: PieceType[] = ['king', 'pawn'];\n\nexport function isPieceType(value: unknown): value is PieceType {\n\treturn typeof value === 'string' && pieceTypes.includes(value as PieceType);\n}\n\nexport function isEqualCoord(c1: Coord, c2: Coord): boolean {\n\treturn c1[0] === c2[0] && c1[1] === c2[1];\n}\n\nexport const pieceLookup: {\n\t[Key in PieceType]: (location: [number, number]) => ReactElement;\n} = {\n\tking: (location) => <King location={location} />,\n\tpawn: (location) => <Pawn location={location} />,\n};\n\nexport function canMove(\n\tstart: Coord,\n\tdestination: Coord,\n\tpieceType: PieceType,\n\tpieces: PieceRecord[],\n): boolean {\n\tconst rowDist = Math.abs(start[0] - destination[0]);\n\tconst colDist = Math.abs(start[1] - destination[1]);\n\n\tif (pieces.find((piece) => isEqualCoord(piece.location, destination))) {\n\t\treturn false;\n\t}\n\n\tswitch (pieceType) {\n\t\tcase 'king':\n\t\t\treturn [0, 1].includes(rowDist) && [0, 1].includes(colDist);\n\t\tcase 'pawn':\n\t\t\treturn colDist === 0 && start[0] - destination[0] === -1;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\nfunction renderSquares(pieces: PieceRecord[]) {\n\tconst squares = [];\n\tfor (let row = 0; row < 8; row++) {\n\t\tfor (let col = 0; col < 8; col++) {\n\t\t\tconst squareCoord: Coord = [row, col];\n\n\t\t\tconst piece = pieces.find((piece) => isEqualCoord(piece.location, squareCoord));\n\n\t\t\tsquares.push(\n\t\t\t\t<Square pieces={pieces} location={squareCoord}>\n\t\t\t\t\t{piece && pieceLookup[piece.type](squareCoord)}\n\t\t\t\t</Square>,\n\t\t\t);\n\t\t}\n\t}\n\treturn squares;\n}\n\nfunction Chessboard(): React.JSX.Element {\n\tconst [pieces, setPieces] = useState<PieceRecord[]>([\n\t\t{ type: 'king', location: [3, 2] },\n\t\t{ type: 'pawn', location: [1, 6] },\n\t]);\n\n\tuseEffect(() => {\n\t\treturn monitorForElements({\n\t\t\tonDrop({ source, location }) {\n\t\t\t\tconst destination = location.current.dropTargets[0];\n\t\t\t\tif (!destination) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst destinationLocation = destination.data.location;\n\t\t\t\tconst sourceLocation = source.data.location;\n\t\t\t\tconst pieceType = source.data.pieceType;\n\n\t\t\t\tif (!isCoord(destinationLocation) || !isCoord(sourceLocation) || !isPieceType(pieceType)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst piece = pieces.find((p) => isEqualCoord(p.location, sourceLocation));\n\t\t\t\tconst restOfPieces = pieces.filter((p) => p !== piece);\n\n\t\t\t\tif (\n\t\t\t\t\tcanMove(sourceLocation, destinationLocation, pieceType, pieces) &&\n\t\t\t\t\tpiece !== undefined\n\t\t\t\t) {\n\t\t\t\t\tsetPieces([{ type: piece.type, location: destinationLocation }, ...restOfPieces]);\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\t}, [pieces]);\n\n\treturn <div css={chessboardStyles}>{renderSquares(pieces)}</div>;\n}\n\nconst chessboardStyles = css({\n\tdisplay: 'grid',\n\tgridTemplateColumns: 'repeat(8, 1fr)',\n\tgridTemplateRows: 'repeat(8, 1fr)',\n\twidth: '500px',\n\theight: '500px',\n\tborder: '3px solid lightgrey',\n});\n\nexport default Chessboard;\n"
  },
  {
    "path": "packages/documentation/examples/pieces/getting-started/chessboard-starter-code.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { type ReactElement } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport king from '../../icons/king.png';\nimport pawn from '../../icons/pawn.png';\n\nexport type Coord = [number, number];\n\nexport type PieceRecord = {\n\ttype: PieceType;\n\tlocation: Coord;\n};\n\nexport type PieceType = 'king' | 'pawn';\n\ntype PieceProps = {\n\timage: string;\n\talt: string;\n};\n\nexport function isEqualCoord(c1: Coord, c2: Coord): boolean {\n\treturn c1[0] === c2[0] && c1[1] === c2[1];\n}\n\nexport const pieceLookup: {\n\t[Key in PieceType]: () => ReactElement;\n} = {\n\tking: () => <King />,\n\tpawn: () => <Pawn />,\n};\n\nfunction renderSquares(pieces: PieceRecord[]) {\n\tconst squares = [];\n\tfor (let row = 0; row < 8; row++) {\n\t\tfor (let col = 0; col < 8; col++) {\n\t\t\tconst squareCoord: Coord = [row, col];\n\n\t\t\tconst piece = pieces.find((piece) => isEqualCoord(piece.location, squareCoord));\n\n\t\t\tconst isDark = (row + col) % 2 === 1;\n\n\t\t\tsquares.push(\n\t\t\t\t<div css={squareStyles} style={{ backgroundColor: isDark ? 'lightgrey' : 'white' }}>\n\t\t\t\t\t{piece && pieceLookup[piece.type]()}\n\t\t\t\t</div>,\n\t\t\t);\n\t\t}\n\t}\n\treturn squares;\n}\n\nfunction Chessboard(): React.JSX.Element {\n\tconst pieces: PieceRecord[] = [\n\t\t{ type: 'king', location: [3, 2] },\n\t\t{ type: 'pawn', location: [1, 6] },\n\t];\n\n\treturn <div css={chessboardStyles}>{renderSquares(pieces)}</div>;\n}\n\nfunction Piece({ image, alt }: PieceProps) {\n\treturn <img css={imageStyles} src={image} alt={alt} draggable=\"false\" />; // draggable set to false to prevent dragging of the images\n}\n\nexport function King(): React.JSX.Element {\n\treturn <Piece image={king} alt=\"King\" />;\n}\n\nexport function Pawn(): React.JSX.Element {\n\treturn <Piece image={pawn} alt=\"Pawn\" />;\n}\n\nconst chessboardStyles = css({\n\tdisplay: 'grid',\n\tgridTemplateColumns: 'repeat(8, 1fr)',\n\tgridTemplateRows: 'repeat(8, 1fr)',\n\twidth: '500px',\n\theight: '500px',\n\tborder: '3px solid lightgrey',\n});\n\nconst squareStyles = css({\n\twidth: '100%',\n\theight: '100%',\n\tdisplay: 'flex',\n\tjustifyContent: 'center',\n\talignItems: 'center',\n});\n\nconst imageStyles = css({\n\twidth: 45,\n\theight: 45,\n\tpadding: 4,\n\tborderRadius: 6,\n\tboxShadow: '1px 3px 3px rgba(9, 30, 66, 0.25),0px 0px 1px rgba(9, 30, 66, 0.31)',\n\t'&:hover': {\n\t\tbackgroundColor: 'rgba(168, 168, 168, 0.25)',\n\t},\n});\n\nexport default Chessboard;\n"
  },
  {
    "path": "packages/documentation/examples/pieces/getting-started/draggable-piece-in-place.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { useEffect, useRef } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nimport king from '../../icons/king.png';\nimport pawn from '../../icons/pawn.png';\n\nexport type PieceType = 'king' | 'pawn';\n\ntype PieceProps = {\n\timage: string;\n\talt: string;\n};\n\nfunction Piece({ image, alt }: PieceProps) {\n\tconst ref = useRef(null);\n\n\tuseEffect(() => {\n\t\tconst el = ref.current;\n\t\tinvariant(el);\n\n\t\treturn draggable({\n\t\t\telement: el,\n\t\t});\n\t}, []);\n\n\treturn <img css={imageStyles} src={image} alt={alt} ref={ref} />;\n}\n\nexport function King(): React.JSX.Element {\n\treturn <Piece image={king} alt=\"King\" />;\n}\n\nexport function Pawn(): React.JSX.Element {\n\treturn <Piece image={pawn} alt=\"Pawn\" />;\n}\n\nconst imageStyles = css({\n\twidth: 45,\n\theight: 45,\n\tpadding: 4,\n\tborderRadius: 6,\n\tboxShadow: '1px 3px 3px rgba(9, 30, 66, 0.25),0px 0px 1px rgba(9, 30, 66, 0.31)',\n\t'&:hover': {\n\t\tbackgroundColor: 'rgba(168, 168, 168, 0.25)',\n\t},\n});\n\nexport default King;\n"
  },
  {
    "path": "packages/documentation/examples/pieces/getting-started/draggable-piece-with-data.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nimport king from '../../icons/king.png';\nimport pawn from '../../icons/pawn.png';\n\nimport { type Coord } from './chessboard-drop-target';\n\nexport type PieceType = 'king' | 'pawn';\n\ntype PieceProps = {\n\tlocation: Coord;\n\tpieceType: PieceType;\n\timage: string;\n\talt: string;\n};\n\nconst Piece = ({ location, pieceType, image, alt }: PieceProps) => {\n\tconst ref = useRef(null);\n\tconst [dragging, setDragging] = useState<boolean>(false);\n\n\tuseEffect(() => {\n\t\tconst el = ref.current;\n\t\tinvariant(el);\n\n\t\treturn draggable({\n\t\t\telement: el,\n\t\t\tgetInitialData: () => ({ location, pieceType }),\n\t\t\tonDragStart: () => setDragging(true),\n\t\t\tonDrop: () => setDragging(false),\n\t\t});\n\t}, [location, pieceType]);\n\n\treturn (\n\t\t<img\n\t\t\tcss={imageStyles}\n\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\tstyle={dragging ? { opacity: 0.4 } : {}} // fading the piece during dragging\n\t\t\tsrc={image}\n\t\t\talt={alt}\n\t\t\tref={ref}\n\t\t/>\n\t);\n};\n\nexport function King({ location }: { location: [number, number] }): React.JSX.Element {\n\treturn <Piece location={location} pieceType={'king'} image={king} alt=\"King\" />;\n}\n\nexport function Pawn({ location }: { location: [number, number] }): React.JSX.Element {\n\treturn <Piece location={location} pieceType={'pawn'} image={pawn} alt=\"Pawn\" />;\n}\n\nconst imageStyles = css({\n\twidth: 45,\n\theight: 45,\n\tpadding: 4,\n\tborderRadius: 6,\n\tboxShadow: '1px 3px 3px rgba(9, 30, 66, 0.25),0px 0px 1px rgba(9, 30, 66, 0.31)',\n\t'&:hover': {\n\t\tbackgroundColor: 'rgba(168, 168, 168, 0.25)',\n\t},\n});\n\nexport default King;\n"
  },
  {
    "path": "packages/documentation/examples/pieces/getting-started/draggable-piece-with-state.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nimport king from '../../icons/king.png';\nimport pawn from '../../icons/pawn.png';\n\nexport type PieceType = 'king' | 'pawn';\n\ntype PieceProps = {\n\timage: string;\n\talt: string;\n};\n\nfunction Piece({ image, alt }: PieceProps) {\n\tconst ref = useRef(null);\n\tconst [dragging, setDragging] = useState<boolean>(false);\n\n\tuseEffect(() => {\n\t\tconst el = ref.current;\n\t\tinvariant(el);\n\n\t\treturn draggable({\n\t\t\telement: el,\n\t\t\tonDragStart: () => setDragging(true),\n\t\t\tonDrop: () => setDragging(false),\n\t\t});\n\t}, []);\n\n\treturn (\n\t\t<img\n\t\t\tcss={imageStyles}\n\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\tstyle={dragging ? { opacity: 0.4 } : {}} // fading the piece during dragging\n\t\t\tsrc={image}\n\t\t\talt={alt}\n\t\t\tref={ref}\n\t\t/>\n\t);\n}\n\nexport function King(): React.JSX.Element {\n\treturn <Piece image={king} alt=\"King\" />;\n}\n\nexport function Pawn(): React.JSX.Element {\n\treturn <Piece image={pawn} alt=\"Pawn\" />;\n}\n\nconst imageStyles = css({\n\twidth: 45,\n\theight: 45,\n\tpadding: 4,\n\tborderRadius: 6,\n\tboxShadow: '1px 3px 3px rgba(9, 30, 66, 0.25),0px 0px 1px rgba(9, 30, 66, 0.31)',\n\t'&:hover': {\n\t\tbackgroundColor: 'rgba(168, 168, 168, 0.25)',\n\t},\n});\n\nexport default King;\n"
  },
  {
    "path": "packages/documentation/examples/pieces/getting-started/square-drop-target.tsx",
    "content": "/** @jsxRuntime classic */\n/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { type ReactNode, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nimport { type Coord } from './chessboard-draggable';\n\ninterface SquareProps {\n\tlocation: Coord;\n\tchildren: ReactNode;\n}\n\nconst squareStyles = css({\n\twidth: '100%',\n\theight: '100%',\n\tdisplay: 'flex',\n\tjustifyContent: 'center',\n\talignItems: 'center',\n});\n\nfunction getColor(isDraggedOver: boolean, isDark: boolean): string {\n\tif (isDraggedOver) {\n\t\treturn 'skyblue';\n\t}\n\treturn isDark ? 'lightgrey' : 'white';\n}\n\nfunction Square({ location, children }: SquareProps): React.JSX.Element {\n\tconst ref = useRef(null);\n\tconst [isDraggedOver, setIsDraggedOver] = useState(false);\n\n\tuseEffect(() => {\n\t\tconst el = ref.current;\n\t\tinvariant(el);\n\n\t\treturn dropTargetForElements({\n\t\t\telement: el,\n\t\t\tonDragEnter: () => setIsDraggedOver(true),\n\t\t\tonDragLeave: () => setIsDraggedOver(false),\n\t\t\tonDrop: () => setIsDraggedOver(false),\n\t\t});\n\t}, []);\n\n\tconst isDark = (location[0] + location[1]) % 2 === 1;\n\n\treturn (\n\t\t<div css={squareStyles} style={{ backgroundColor: getColor(isDraggedOver, isDark) }} ref={ref}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n\nexport default Square;\n"
  },
  {
    "path": "packages/documentation/examples/pieces/getting-started/square-with-can-drop.tsx",
    "content": "/** @jsxRuntime classic */\n/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { type ReactNode, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nimport {\n\tcanMove,\n\ttype Coord,\n\tisCoord,\n\tisEqualCoord,\n\tisPieceType,\n\ttype PieceRecord,\n} from './chessboard-colored-drop-targets';\n\ninterface SquareProps {\n\tpieces: PieceRecord[];\n\tlocation: Coord;\n\tchildren: ReactNode;\n}\n\ntype HoveredState = 'idle' | 'validMove' | 'invalidMove';\n\nconst squareStyles = css({\n\twidth: '100%',\n\theight: '100%',\n\tdisplay: 'flex',\n\tjustifyContent: 'center',\n\talignItems: 'center',\n});\n\nfunction getColor(state: HoveredState, isDark: boolean): string {\n\tif (state === 'validMove') {\n\t\treturn 'lightgreen';\n\t} else if (state === 'invalidMove') {\n\t\treturn 'pink';\n\t}\n\treturn isDark ? 'lightgrey' : 'white';\n}\n\nfunction Square({ pieces, location, children }: SquareProps): React.JSX.Element {\n\tconst ref = useRef(null);\n\tconst [state, setState] = useState<HoveredState>('idle');\n\n\tuseEffect(() => {\n\t\tconst el = ref.current;\n\t\tinvariant(el);\n\n\t\treturn dropTargetForElements({\n\t\t\telement: el,\n\t\t\tcanDrop: ({ source }) => {\n\t\t\t\tif (!isCoord(source.data.location)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn !isEqualCoord(source.data.location, location);\n\t\t\t},\n\t\t\tonDragEnter: ({ source }) => {\n\t\t\t\tif (!isCoord(source.data.location) || !isPieceType(source.data.pieceType)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (canMove(source.data.location, location, source.data.pieceType, pieces)) {\n\t\t\t\t\tsetState('validMove');\n\t\t\t\t} else {\n\t\t\t\t\tsetState('invalidMove');\n\t\t\t\t}\n\t\t\t},\n\t\t\tonDragLeave: () => setState('idle'),\n\t\t\tonDrop: () => setState('idle'),\n\t\t});\n\t}, [location, pieces]);\n\n\tconst isDark = (location[0] + location[1]) % 2 === 1;\n\n\treturn (\n\t\t<div css={squareStyles} style={{ backgroundColor: getColor(state, isDark) }} ref={ref}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n\nexport default Square;\n"
  },
  {
    "path": "packages/documentation/examples/pieces/getting-started/square-with-data.tsx",
    "content": "/** @jsxRuntime classic */\n/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { type ReactNode, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nimport {\n\tcanMove,\n\ttype Coord,\n\tisCoord,\n\tisEqualCoord,\n\tisPieceType,\n\ttype PieceRecord,\n} from './chessboard-colored-drop-targets';\n\ninterface SquareProps {\n\tpieces: PieceRecord[];\n\tlocation: Coord;\n\tchildren: ReactNode;\n}\n\ntype HoveredState = 'idle' | 'validMove' | 'invalidMove';\n\nconst squareStyles = css({\n\twidth: '100%',\n\theight: '100%',\n\tdisplay: 'flex',\n\tjustifyContent: 'center',\n\talignItems: 'center',\n});\n\nfunction getColor(state: HoveredState, isDark: boolean): string {\n\tif (state === 'validMove') {\n\t\treturn 'lightgreen';\n\t} else if (state === 'invalidMove') {\n\t\treturn 'pink';\n\t}\n\treturn isDark ? 'lightgrey' : 'white';\n}\n\nfunction Square({ pieces, location, children }: SquareProps): React.JSX.Element {\n\tconst ref = useRef(null);\n\tconst [state, setState] = useState<HoveredState>('idle');\n\n\tuseEffect(() => {\n\t\tconst el = ref.current;\n\t\tinvariant(el);\n\n\t\treturn dropTargetForElements({\n\t\t\telement: el,\n\t\t\tgetData: () => ({ location }),\n\t\t\tcanDrop: ({ source }) => {\n\t\t\t\tif (!isCoord(source.data.location)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn !isEqualCoord(source.data.location, location);\n\t\t\t},\n\t\t\tonDragEnter: ({ source }) => {\n\t\t\t\tif (!isCoord(source.data.location) || !isPieceType(source.data.pieceType)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (canMove(source.data.location, location, source.data.pieceType, pieces)) {\n\t\t\t\t\tsetState('validMove');\n\t\t\t\t} else {\n\t\t\t\t\tsetState('invalidMove');\n\t\t\t\t}\n\t\t\t},\n\t\t\tonDragLeave: () => setState('idle'),\n\t\t\tonDrop: () => setState('idle'),\n\t\t});\n\t}, [location, pieces]);\n\n\tconst isDark = (location[0] + location[1]) % 2 === 1;\n\n\treturn (\n\t\t<div css={squareStyles} style={{ backgroundColor: getColor(state, isDark) }} ref={ref}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n\nexport default Square;\n"
  },
  {
    "path": "packages/documentation/examples/pieces/getting-started/square-with-hovering-coloring.tsx",
    "content": "/** @jsxRuntime classic */\n/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { type ReactNode, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nimport {\n\tcanMove,\n\ttype Coord,\n\tisCoord,\n\tisPieceType,\n\ttype PieceRecord,\n} from './chessboard-colored-drop-targets';\n\ninterface SquareProps {\n\tpieces: PieceRecord[];\n\tlocation: Coord;\n\tchildren: ReactNode;\n}\n\ntype HoveredState = 'idle' | 'validMove' | 'invalidMove';\n\nconst squareStyles = css({\n\twidth: '100%',\n\theight: '100%',\n\tdisplay: 'flex',\n\tjustifyContent: 'center',\n\talignItems: 'center',\n});\n\nfunction getColor(state: HoveredState, isDark: boolean): string {\n\tif (state === 'validMove') {\n\t\treturn 'lightgreen';\n\t} else if (state === 'invalidMove') {\n\t\treturn 'pink';\n\t}\n\treturn isDark ? 'lightgrey' : 'white';\n}\n\nfunction Square({ pieces, location, children }: SquareProps): React.JSX.Element {\n\tconst ref = useRef(null);\n\tconst [state, setState] = useState<HoveredState>('idle');\n\n\tuseEffect(() => {\n\t\tconst el = ref.current;\n\t\tinvariant(el);\n\n\t\treturn dropTargetForElements({\n\t\t\telement: el,\n\t\t\tonDragEnter: ({ source }) => {\n\t\t\t\tif (!isCoord(source.data.location) || !isPieceType(source.data.pieceType)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (canMove(source.data.location, location, source.data.pieceType, pieces)) {\n\t\t\t\t\tsetState('validMove');\n\t\t\t\t} else {\n\t\t\t\t\tsetState('invalidMove');\n\t\t\t\t}\n\t\t\t},\n\t\t\tonDragLeave: () => setState('idle'),\n\t\t\tonDrop: () => setState('idle'),\n\t\t});\n\t}, [location, pieces]);\n\n\tconst isDark = (location[0] + location[1]) % 2 === 1;\n\n\treturn (\n\t\t<div css={squareStyles} style={{ backgroundColor: getColor(state, isDark) }} ref={ref}>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n\nexport default Square;\n"
  },
  {
    "path": "packages/documentation/examples/pieces/hooks/use-flash-on-drop.tsx",
    "content": "import { type RefObject, useCallback, useEffect } from 'react';\n\nimport { bind } from 'bind-event-listener';\nimport invariant from 'tiny-invariant';\n\nimport { durations } from '@atlaskit/motion';\nimport { token } from '@atlaskit/tokens';\n\nexport function useFlashOnDrop({\n\tref,\n\tdraggableId,\n\ttype,\n}: {\n\tref: RefObject<HTMLElement>;\n\tdraggableId: string;\n\ttype: string;\n}): void {\n\t/**\n\t * Flash makes it obvious what/where you dropped. Inspired by Linear.\n\t */\n\tconst flashIn = useCallback(() => {\n\t\tconst element = ref.current;\n\t\tif (!element) {\n\t\t\treturn;\n\t\t}\n\n\t\telement.animate([{ background: token('color.background.selected', 'transparent') }, {}], {\n\t\t\tduration: durations.medium,\n\t\t\titerations: 1,\n\t\t});\n\t}, [ref]);\n\n\tuseEffect(() => {\n\t\treturn bind(window, {\n\t\t\ttype: 'afterdrop',\n\t\t\tlistener(event) {\n\t\t\t\tinvariant(event instanceof CustomEvent);\n\t\t\t\tif (event.detail.id !== draggableId || event.detail.type !== type) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tflashIn();\n\t\t\t},\n\t\t});\n\t}, [flashIn, draggableId, type]);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/hooks/use-prevent-scrolling-from-arrow-keys.tsx",
    "content": "import { useEffect } from 'react';\n\nimport { bind } from 'bind-event-listener';\n\n/**\n * Cancels keydown events for arrow keys.\n *\n * Used as a patch to fix dropdown menu behavior, which allows scrolling\n * while navigating a dropdown menu.\n */\nexport function usePreventScrollingFromArrowKeys({\n\tshouldPreventScrolling,\n}: {\n\tshouldPreventScrolling: boolean;\n}): void {\n\tuseEffect(() => {\n\t\tif (!shouldPreventScrolling) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn bind(window, {\n\t\t\ttype: 'keydown',\n\t\t\tlistener(event) {\n\t\t\t\tif (event.key === 'ArrowUp' || event.key === 'ArrowDown') {\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\t}, [shouldPreventScrolling]);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/hooks/use-sortable-field.tsx",
    "content": "import { type RefObject, useEffect, useState } from 'react';\n\nimport { bindAll } from 'bind-event-listener';\nimport invariant from 'tiny-invariant';\n\nimport {\n\tattachClosestEdge,\n\ttype Edge,\n\textractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { disableNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview';\n\ntype ShouldHideDropIndicatorArgs = {\n\tclosestEdge: Edge | null;\n\tsourceIndex: number;\n\ttargetIndex: number;\n};\n\ntype UseSortableFieldArgs = {\n\tid: string;\n\tindex: number;\n\ttype: string;\n\tref: RefObject<HTMLElement>;\n\n\tshouldHideNativeDragPreview?: boolean;\n\n\t/**\n\t * Used for the Asana clone.\n\t */\n\tshouldHideDropIndicatorForNoopTargets?: boolean;\n\tisSticky?: boolean;\n\tonGenerateDragPreview?: (args: {\n\t\tnativeSetDragImage: (image: Element, x: number, y: number) => void;\n\t}) => void;\n\n\t/**\n\t * Used for Notion clone\n\t */\n\tdragHandle?: HTMLElement | null;\n\tcustomShouldHideDropIndicator?: (args: ShouldHideDropIndicatorArgs) => boolean;\n};\n\nfunction shouldHideDropIndicator({\n\tclosestEdge,\n\tsourceIndex,\n\ttargetIndex,\n}: ShouldHideDropIndicatorArgs) {\n\tconst isTargetingSelf = sourceIndex === targetIndex;\n\tconst isTargetingBottomOfPrevious = closestEdge === 'bottom' && targetIndex === sourceIndex - 1;\n\tconst isTargetingTopOfNext = closestEdge === 'top' && targetIndex === sourceIndex + 1;\n\n\treturn isTargetingSelf || isTargetingBottomOfPrevious || isTargetingTopOfNext;\n}\n\nexport type DragState = 'idle' | 'preview' | 'dragging';\n\nexport function useSortableField({\n\tid,\n\tindex,\n\ttype,\n\tref,\n\tshouldHideNativeDragPreview = false,\n\tshouldHideDropIndicatorForNoopTargets = true,\n\tisSticky = true,\n\tonGenerateDragPreview,\n\tdragHandle = null,\n\tcustomShouldHideDropIndicator,\n}: UseSortableFieldArgs) {\n\tconst [isHovering, setIsHovering] = useState(false);\n\tconst [dragState, setDragState] = useState<DragState>('idle');\n\tconst [closestEdge, setClosestEdge] = useState<Edge | null>(null);\n\n\tconst isDragging = dragState !== 'idle';\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tif (!element) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst data = { id, index, type };\n\n\t\treturn combine(\n\t\t\tbindAll(element, [\n\t\t\t\t{\n\t\t\t\t\ttype: 'pointerenter',\n\t\t\t\t\tlistener() {\n\t\t\t\t\t\tsetIsHovering(true);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttype: 'pointerleave',\n\t\t\t\t\tlistener() {\n\t\t\t\t\t\tsetIsHovering(false);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t]),\n\t\t\tdraggable({\n\t\t\t\telement,\n\t\t\t\tdragHandle: dragHandle ?? undefined,\n\t\t\t\tgetInitialData() {\n\t\t\t\t\treturn data;\n\t\t\t\t},\n\t\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\t\tif (shouldHideNativeDragPreview) {\n\t\t\t\t\t\tdisableNativeDragPreview({ nativeSetDragImage });\n\t\t\t\t\t}\n\t\t\t\t\tsetDragState('preview');\n\n\t\t\t\t\tif (onGenerateDragPreview && nativeSetDragImage) {\n\t\t\t\t\t\tonGenerateDragPreview({ nativeSetDragImage });\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonDragStart() {\n\t\t\t\t\tsetDragState('dragging');\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tsetDragState('idle');\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement,\n\t\t\t\tgetIsSticky() {\n\t\t\t\t\treturn isSticky;\n\t\t\t\t},\n\t\t\t\tcanDrop({ source }) {\n\t\t\t\t\treturn source.data.type === type;\n\t\t\t\t},\n\t\t\t\tgetData({ input }) {\n\t\t\t\t\treturn attachClosestEdge(data, {\n\t\t\t\t\t\telement,\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tallowedEdges: ['top', 'bottom'],\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDrag({ self, source }) {\n\t\t\t\t\tconst closestEdge = extractClosestEdge(self.data);\n\t\t\t\t\tconst sourceIndex = source.data.index;\n\t\t\t\t\tinvariant(typeof sourceIndex === 'number');\n\n\t\t\t\t\tif (!shouldHideDropIndicatorForNoopTargets && customShouldHideDropIndicator) {\n\t\t\t\t\t\tconst shouldHide = customShouldHideDropIndicator({\n\t\t\t\t\t\t\tclosestEdge,\n\t\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\t\ttargetIndex: index,\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tsetClosestEdge(shouldHide ? null : closestEdge);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tshouldHideDropIndicatorForNoopTargets &&\n\t\t\t\t\t\tshouldHideDropIndicator({\n\t\t\t\t\t\t\tclosestEdge,\n\t\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\t\ttargetIndex: index,\n\t\t\t\t\t\t})\n\t\t\t\t\t) {\n\t\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetClosestEdge(closestEdge);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonDragLeave() {\n\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [\n\t\tcustomShouldHideDropIndicator,\n\t\tdragHandle,\n\t\tid,\n\t\tindex,\n\t\tisSticky,\n\t\tonGenerateDragPreview,\n\t\tref,\n\t\tshouldHideDropIndicatorForNoopTargets,\n\t\tshouldHideNativeDragPreview,\n\t\ttype,\n\t]);\n\n\treturn { isHovering, isDragging, dragState, closestEdge };\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/hooks/use-top-level-wiring.tsx",
    "content": "import { useCallback, useEffect, useState } from 'react';\n\nimport invariant from 'tiny-invariant';\n\nimport { extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { reorderWithEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/reorder-with-edge';\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { preventUnhandled } from '@atlaskit/pragmatic-drag-and-drop/prevent-unhandled';\nimport { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';\n\ntype UseToplevelWiringArgs<DataItem> = {\n\tinitialData: DataItem[];\n\ttype: string;\n\n\tshouldPreventUnhandled?: boolean;\n};\n\nexport type ReorderItem = (args: { id: string; action: 'up' | 'down' }) => void;\n\nfunction dispatchAfterDropEvent(detail: { id: string; type: string }) {\n\trequestAnimationFrame(() => {\n\t\t/**\n\t\t * Dispatching an event for simplicity. In a real app we might not\n\t\t * want to do it this way.\n\t\t */\n\t\twindow.dispatchEvent(new CustomEvent('afterdrop', { detail }));\n\t});\n}\n\n/**\n * This hook combines a couple of things which makes it hard to give it a\n * more descriptive name:\n *\n * - Initializes the data\n * - Monitors drops to reorder the data on drops\n * - Cancels unhandled drops\n */\nexport function useTopLevelWiring<DataItem extends { id: string }>({\n\tinitialData,\n\ttype,\n\tshouldPreventUnhandled = true,\n}: UseToplevelWiringArgs<DataItem>): {\n\tdata: DataItem[];\n\treorderItem: ReorderItem;\n} {\n\tconst [data, setData] = useState(initialData);\n\n\tuseEffect(() => {\n\t\treturn monitorForElements({\n\t\t\tonDragStart: ({ source }) => {\n\t\t\t\tif (source.data.type !== type) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (shouldPreventUnhandled) {\n\t\t\t\t\tpreventUnhandled.start();\n\t\t\t\t}\n\t\t\t},\n\t\t\tonDrop: ({ location, source }) => {\n\t\t\t\tif (source.data.type !== type) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (shouldPreventUnhandled) {\n\t\t\t\t\tpreventUnhandled.stop();\n\t\t\t\t}\n\n\t\t\t\tconst destination = location.current.dropTargets[0];\n\t\t\t\tif (!destination) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (destination.data.type !== source.data.type) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst startIndex = source.data.index;\n\t\t\t\tinvariant(typeof startIndex === 'number');\n\n\t\t\t\tconst indexOfTarget = destination.data.index;\n\t\t\t\tinvariant(typeof indexOfTarget === 'number');\n\n\t\t\t\tsetData((data) =>\n\t\t\t\t\treorderWithEdge({\n\t\t\t\t\t\tlist: data,\n\t\t\t\t\t\tclosestEdgeOfTarget: extractClosestEdge(destination.data),\n\t\t\t\t\t\tstartIndex,\n\t\t\t\t\t\tindexOfTarget,\n\t\t\t\t\t\taxis: 'vertical',\n\t\t\t\t\t}),\n\t\t\t\t);\n\n\t\t\t\tdispatchAfterDropEvent({ id: source.data.id as string, type });\n\t\t\t},\n\t\t});\n\t}, [shouldPreventUnhandled, type]);\n\n\tconst reorderItem: ReorderItem = useCallback(\n\t\t({ id, action }) => {\n\t\t\tsetData((data) => {\n\t\t\t\tconst index = data.findIndex((item) => item.id === id);\n\t\t\t\treturn reorder({\n\t\t\t\t\tlist: data,\n\t\t\t\t\tstartIndex: index,\n\t\t\t\t\tfinishIndex: action === 'up' ? index - 1 : index + 1,\n\t\t\t\t});\n\t\t\t});\n\t\t\tdispatchAfterDropEvent({ id, type });\n\t\t},\n\t\t[type],\n\t);\n\n\treturn { data, reorderItem };\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/iframe-board/card.tsx",
    "content": "import React, { forwardRef, Fragment, memo, type Ref, useEffect, useRef, useState } from 'react';\n\nimport ReactDOM from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport Avatar from '@atlaskit/avatar';\nimport Heading from '@atlaskit/heading';\n// This is the smaller MoreIcon soon to be more easily accessible with the\n// ongoing icon project\nimport {\n\tattachClosestEdge,\n\ttype Edge,\n\textractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { preserveOffsetOnSource } from '@atlaskit/pragmatic-drag-and-drop/element/preserve-offset-on-source';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\nimport { dropTargetForExternal } from '@atlaskit/pragmatic-drag-and-drop/external/adapter';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Grid, Stack, xcss } from '@atlaskit/primitives';\nimport { token } from '@atlaskit/tokens';\n\nimport { type Person } from '../../data/people';\n\nimport {\n\tdropHandledExternallyLocalStorageKey,\n\tgetCard,\n\tgetCardDataForExternal,\n\tgetCardDropTarget,\n\tisCard,\n\tisDraggingExternalCard,\n} from './data';\n\ntype State =\n\t| { type: 'idle' }\n\t| { type: 'preview'; container: HTMLElement; rect: DOMRect }\n\t| { type: 'dragging' };\n\nconst idleState: State = { type: 'idle' };\nconst draggingState: State = { type: 'dragging' };\n\nconst noMarginStyles = xcss({ margin: 'space.0' });\nconst noPointerEventsStyles = xcss({ pointerEvents: 'none' });\nconst baseStyles = xcss({\n\twidth: '100%',\n\tpadding: 'space.100',\n\tbackgroundColor: 'elevation.surface',\n\tborderRadius: 'radius.large',\n\tposition: 'relative',\n\t':hover': {\n\t\tbackgroundColor: 'elevation.surface.hovered',\n\t},\n});\n\nconst stateStyles: {\n\t[Key in State['type']]: ReturnType<typeof xcss> | undefined;\n} = {\n\tidle: xcss({\n\t\tcursor: 'grab',\n\t\tboxShadow: 'elevation.shadow.raised',\n\t}),\n\tdragging: xcss({\n\t\topacity: 0.4,\n\t\tboxShadow: 'elevation.shadow.raised',\n\t}),\n\t// no shadow for preview - the platform will add it's own drop shadow\n\tpreview: undefined,\n};\n\ntype CardPrimitiveProps = {\n\tclosestEdge: Edge | null;\n\titem: Person;\n\tstate: State;\n\tactionMenuTriggerRef?: Ref<HTMLButtonElement>;\n};\n\nconst CardPrimitive = forwardRef<HTMLDivElement, CardPrimitiveProps>(function CardPrimitive(\n\t{ closestEdge, item, state, actionMenuTriggerRef },\n\tref,\n) {\n\tconst { avatarUrl, name, role, userId } = item;\n\n\treturn (\n\t\t<Grid\n\t\t\tref={ref}\n\t\t\ttestId={`item-${userId}`}\n\t\t\ttemplateColumns=\"auto 1fr\"\n\t\t\tcolumnGap=\"space.100\"\n\t\t\talignItems=\"center\"\n\t\t\txcss={[baseStyles, stateStyles[state.type]]}\n\t\t>\n\t\t\t<Box as=\"span\" xcss={noPointerEventsStyles}>\n\t\t\t\t<Avatar size=\"large\" src={avatarUrl} />\n\t\t\t</Box>\n\t\t\t<Stack space=\"space.050\" grow=\"fill\">\n\t\t\t\t<Heading size=\"xsmall\" as=\"span\">\n\t\t\t\t\t{name}\n\t\t\t\t</Heading>\n\t\t\t\t<Box as=\"small\" xcss={noMarginStyles}>\n\t\t\t\t\t{role}\n\t\t\t\t</Box>\n\t\t\t</Stack>\n\t\t\t{closestEdge && <DropIndicator edge={closestEdge} gap={token('space.100', '0')} />}\n\t\t</Grid>\n\t);\n});\n\nexport const Card = memo(function Card({ item, columnId }: { item: Person; columnId: string }) {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tconst { userId } = item;\n\tconst [closestEdge, setClosestEdge] = useState<Edge | null>(null);\n\tconst [state, setState] = useState<State>(idleState);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\t\treturn combine(\n\t\t\tdraggable({\n\t\t\t\telement: element,\n\t\t\t\tgetInitialData: () => getCard({ cardId: userId, columnId }),\n\t\t\t\tgetInitialDataForExternal: () => getCardDataForExternal(item),\n\t\t\t\tonGenerateDragPreview: ({ location, source, nativeSetDragImage }) => {\n\t\t\t\t\tconst rect = source.element.getBoundingClientRect();\n\n\t\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\t\tgetOffset: preserveOffsetOnSource({\n\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\tinput: location.current.input,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\t\tsetState({ type: 'preview', container, rect });\n\t\t\t\t\t\t\treturn () => setState(draggingState);\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragStart: () => {\n\t\t\t\t\tsetState(draggingState);\n\n\t\t\t\t\t// resetting this whenever a drag starts\n\t\t\t\t\tlocalStorage.removeItem(dropHandledExternallyLocalStorageKey);\n\t\t\t\t},\n\t\t\t\tonDrop: () => setState(idleState),\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement: element,\n\t\t\t\tcanDrop: ({ source }) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t// for this example, only accepting cards coming from the same column\n\t\t\t\t\t\tisCard(source.data) && source.data.columnId === columnId\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tgetIsSticky: () => true,\n\t\t\t\tgetData: ({ input, element }) => {\n\t\t\t\t\tconst data = getCardDropTarget({ cardId: userId, columnId });\n\n\t\t\t\t\treturn attachClosestEdge(data, {\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\telement,\n\t\t\t\t\t\tallowedEdges: ['top', 'bottom'],\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragEnter: (args) => {\n\t\t\t\t\tif (args.source.data.cardId !== userId) {\n\t\t\t\t\t\tsetClosestEdge(extractClosestEdge(args.self.data));\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonDrag: (args) => {\n\t\t\t\t\tif (args.source.data.cardId !== userId) {\n\t\t\t\t\t\tsetClosestEdge(extractClosestEdge(args.self.data));\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonDragLeave: () => {\n\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t},\n\t\t\t\tonDrop: () => {\n\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdropTargetForExternal({\n\t\t\t\telement,\n\t\t\t\tcanDrop: isDraggingExternalCard,\n\t\t\t\tgetDropEffect: () => 'move',\n\t\t\t\tgetIsSticky: () => true,\n\t\t\t\tgetData: ({ input, element }) => {\n\t\t\t\t\tconst data = getCardDropTarget({ cardId: userId, columnId });\n\n\t\t\t\t\treturn attachClosestEdge(data, {\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\telement,\n\t\t\t\t\t\tallowedEdges: ['top', 'bottom'],\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragEnter: (args) => {\n\t\t\t\t\tsetClosestEdge(extractClosestEdge(args.self.data));\n\t\t\t\t},\n\t\t\t\tonDrag: (args) => {\n\t\t\t\t\tsetClosestEdge(extractClosestEdge(args.self.data));\n\t\t\t\t},\n\t\t\t\tonDragLeave: () => {\n\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t},\n\t\t\t\tonDrop: () => {\n\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [item, userId, columnId]);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<CardPrimitive ref={ref} item={item} state={state} closestEdge={closestEdge} />\n\t\t\t{state.type === 'preview' &&\n\t\t\t\tReactDOM.createPortal(\n\t\t\t\t\t<Box\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Ensuring the preview has the same dimensions as the original.\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * Using `border-box` sizing here is not necessary in this\n\t\t\t\t\t\t\t * specific example, but it is safer to include generally.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\t\twidth: state.rect.width,\n\t\t\t\t\t\t\theight: state.rect.height,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<CardPrimitive item={item} state={state} closestEdge={null} />\n\t\t\t\t\t</Box>,\n\t\t\t\t\tstate.container,\n\t\t\t\t)}\n\t\t</Fragment>\n\t);\n});\n"
  },
  {
    "path": "packages/documentation/examples/pieces/iframe-board/column.tsx",
    "content": "import React, { useCallback, useEffect, useRef, useState } from 'react';\n\nimport invariant from 'tiny-invariant';\n\nimport Heading from '@atlaskit/heading';\nimport { easeInOut } from '@atlaskit/motion/curves';\nimport { durations } from '@atlaskit/motion/durations';\nimport { extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { reorderWithEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/reorder-with-edge';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdropTargetForElements,\n\ttype ElementDragPayload,\n\tmonitorForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { dropTargetForExternal } from '@atlaskit/pragmatic-drag-and-drop/external/adapter';\nimport { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Inline, Stack, xcss } from '@atlaskit/primitives';\n\nimport { getPeopleFromPosition, getPersonFromPosition, type Person } from '../../data/people';\n\nimport { Card } from './card';\nimport {\n\tdropHandledExternallyLocalStorageKey,\n\tgetColumnDropTarget,\n\tgetDroppedExternalCardId,\n\tisCard,\n\tisCardDropTarget,\n\tisColumnDropTarget,\n\tisDraggingExternalCard,\n} from './data';\n\nconst columnStyles = xcss({\n\twidth: '250px',\n\tbackgroundColor: 'elevation.surface.sunken',\n\tborderRadius: 'radius.xlarge',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values\n\ttransition: `background ${durations.medium}ms ${easeInOut}`,\n\tposition: 'relative',\n});\n\nconst scrollContainerStyles = xcss({\n\theight: '100%',\n\toverflowY: 'auto',\n});\n\nconst cardListStyles = xcss({\n\tboxSizing: 'border-box',\n\tminHeight: '200px',\n\tpadding: 'space.100',\n\tgap: 'space.100',\n});\n\nconst columnHeaderStyles = xcss({\n\tpaddingInlineStart: 'space.200',\n\tpaddingInlineEnd: 'space.200',\n\tpaddingBlockStart: 'space.100',\n\tcolor: 'color.text.subtlest',\n\tuserSelect: 'none',\n});\n\ntype State = { type: 'idle' } | { type: 'is-card-over' };\n\n// preventing re-renders with stable state objects\nconst idle: State = { type: 'idle' };\nconst isCardOver: State = { type: 'is-card-over' };\n\nconst stateStyles: {\n\t[key in State['type']]: ReturnType<typeof xcss> | undefined;\n} = {\n\tidle: undefined,\n\t'is-card-over': xcss({\n\t\tbackgroundColor: 'color.background.selected.hovered',\n\t}),\n};\n\n/**\n * This function leverages local storage to ensure that columns do not\n * use duplicate people.\n * (unless there are more people used then we have available to use!)\n */\nfunction getPeopleFromSharedPool(): Person[] {\n\tconst localStoragePeopleIndexKey = 'people-index';\n\n\tif (typeof window === 'undefined') {\n\t\treturn [];\n\t}\n\tconst startIndex: number = (() => {\n\t\tconst value = Number(localStorage.getItem(localStoragePeopleIndexKey));\n\n\t\tif (Number.isInteger(value)) {\n\t\t\treturn value;\n\t\t}\n\n\t\treturn 0;\n\t})();\n\n\tconst amount = 4;\n\tlocalStorage.setItem(localStoragePeopleIndexKey, `${startIndex + amount}`);\n\n\treturn getPeopleFromPosition({ amount, startIndex });\n}\nexport function Column({ columnId }: { columnId: string }): React.JSX.Element {\n\tconst [items, setItems] = useState<Person[]>(() => getPeopleFromSharedPool());\n\n\tconst columnRef = useRef<HTMLDivElement | null>(null);\n\tconst headerRef = useRef<HTMLDivElement | null>(null);\n\tconst scrollableRef = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<State>(idle);\n\n\tconst isHomeColumn = useCallback(({ source }: { source: ElementDragPayload }): boolean => {\n\t\tconst column = columnRef.current;\n\t\tinvariant(column);\n\t\treturn isCard(source.data) && column.contains(source.element);\n\t}, []);\n\n\t// in Safari `document.body.scrollHeight` is not updated\n\t// by the time a `useLayoutEffect` runs.\n\t// For simplicity, using a `useEffect` instead.\n\tuseEffect(() => {\n\t\tconst isInIframe: boolean = typeof window !== 'undefined' && window.parent !== window;\n\n\t\tif (!isInIframe) {\n\t\t\treturn;\n\t\t}\n\t\tconst frame = window.frameElement;\n\t\tif (!frame) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst updateIframeHeight = () => {\n\t\t\t// Adding a little buffer as there seems to be some\n\t\t\t// sub pixel rounding at various zoom levels.\n\t\t\t// If we don't add the buffer, a scroll bar can appear\n\t\t\tconst buffer = 1;\n\t\t\tframe.setAttribute('height', `${document.body.scrollHeight + buffer}`);\n\t\t};\n\n\t\tupdateIframeHeight();\n\n\t\tconst observer = new MutationObserver(() => updateIframeHeight());\n\n\t\tobserver.observe(document.body, {\n\t\t\tchildList: true,\n\t\t\tsubtree: true,\n\t\t\tattributes: false,\n\t\t});\n\n\t\treturn () => observer.disconnect();\n\t}, []);\n\n\tuseEffect(() => {\n\t\tconst column = columnRef.current;\n\t\tconst header = headerRef.current;\n\t\tconst scrollable = scrollableRef.current;\n\t\tinvariant(column);\n\t\tinvariant(header);\n\t\tinvariant(scrollable);\n\n\t\treturn combine(\n\t\t\tdropTargetForElements({\n\t\t\t\telement: column,\n\t\t\t\tcanDrop: isHomeColumn,\n\t\t\t\tgetData: () => getColumnDropTarget({ columnId }),\n\t\t\t\tgetIsSticky: () => true,\n\t\t\t\tonDragEnter: () => setState(isCardOver),\n\t\t\t\tonDragLeave: () => setState(idle),\n\t\t\t\tonDragStart: () => {\n\t\t\t\t\tsetState(isCardOver);\n\t\t\t\t},\n\t\t\t\tonDrop: ({ source, location }) => {\n\t\t\t\t\tsetState(idle);\n\n\t\t\t\t\tconst data = source.data;\n\t\t\t\t\tif (!isCard(data)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst innerMost = location.current.dropTargets[0];\n\t\t\t\t\t// this should not happen\n\t\t\t\t\tif (!innerMost) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tconst startIndex = items.findIndex((item) => item.userId === data.cardId);\n\n\t\t\t\t\tconst dropTargetData = innerMost.data;\n\n\t\t\t\t\t// dropped on a card: swap as needed\n\t\t\t\t\tif (isCardDropTarget(dropTargetData)) {\n\t\t\t\t\t\tconst closestEdge = extractClosestEdge(dropTargetData);\n\t\t\t\t\t\t// data setup issue\n\t\t\t\t\t\tinvariant(closestEdge);\n\n\t\t\t\t\t\tconst indexOfTarget = items.findIndex((item) => item.userId === dropTargetData.cardId);\n\t\t\t\t\t\tinvariant(startIndex !== -1 && indexOfTarget !== -1, 'Could not find items');\n\n\t\t\t\t\t\tconst newItems = reorderWithEdge({\n\t\t\t\t\t\t\tlist: items,\n\t\t\t\t\t\t\tstartIndex,\n\t\t\t\t\t\t\tindexOfTarget,\n\t\t\t\t\t\t\tclosestEdgeOfTarget: closestEdge,\n\t\t\t\t\t\t\taxis: 'vertical',\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\tsetItems(newItems);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// dropped on the column: move item into last place\n\t\t\t\t\tif (isColumnDropTarget(dropTargetData)) {\n\t\t\t\t\t\tconst newItems = reorder({\n\t\t\t\t\t\t\tlist: items,\n\t\t\t\t\t\t\tstartIndex,\n\t\t\t\t\t\t\tfinishIndex: items.length - 1,\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsetItems(newItems);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdropTargetForExternal({\n\t\t\t\telement: column,\n\t\t\t\tgetDropEffect: () => 'move',\n\t\t\t\tcanDrop: isDraggingExternalCard,\n\t\t\t\tgetData: () => getColumnDropTarget({ columnId }),\n\t\t\t\tgetIsSticky: () => true,\n\t\t\t\tonDragEnter: () => setState(isCardOver),\n\t\t\t\tonDragLeave: () => setState(idle),\n\t\t\t\tonDrop: ({ source, location }) => {\n\t\t\t\t\tsetState(idle);\n\n\t\t\t\t\tconst cardId = getDroppedExternalCardId({ source });\n\t\t\t\t\tif (!cardId) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// Note: could use `zod` or similar to validate shape\n\t\t\t\t\tconst position = Number(cardId.replace('id:', ''));\n\n\t\t\t\t\tif (!Number.isInteger(position)) {\n\t\t\t\t\t\t// external value was not formed how we expected.\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst person = getPersonFromPosition({ position });\n\n\t\t\t\t\tconst innerMost = location.current.dropTargets[0];\n\t\t\t\t\t// this should not happen\n\t\t\t\t\tif (!innerMost) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst dropTargetData = innerMost.data;\n\n\t\t\t\t\tfunction update(people: Person[]) {\n\t\t\t\t\t\tsetItems(people);\n\n\t\t\t\t\t\t// note: no longer using this signal\n\t\t\t\t\t\t// due to timing issue in browsers\n\t\t\t\t\t\tlocalStorage.setItem(dropHandledExternallyLocalStorageKey, person.userId);\n\t\t\t\t\t}\n\n\t\t\t\t\t// dropped on a card: swap as needed\n\t\t\t\t\tif (isCardDropTarget(dropTargetData)) {\n\t\t\t\t\t\tconst closestEdge = extractClosestEdge(dropTargetData);\n\t\t\t\t\t\t// data setup issue\n\t\t\t\t\t\tinvariant(closestEdge);\n\n\t\t\t\t\t\tconst indexOfTarget = items.findIndex((item) => item.userId === dropTargetData.cardId);\n\n\t\t\t\t\t\tconst newIndex = closestEdge === 'bottom' ? indexOfTarget + 1 : indexOfTarget;\n\n\t\t\t\t\t\tconst newItems = Array.from(items);\n\t\t\t\t\t\tnewItems.splice(newIndex, 0, person);\n\n\t\t\t\t\t\tupdate(newItems);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// dropped on the column: move item into last place\n\t\t\t\t\tif (isColumnDropTarget(dropTargetData)) {\n\t\t\t\t\t\tconst newItems = [...items, person];\n\n\t\t\t\t\t\tupdate(newItems);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [items, columnId, isHomeColumn]);\n\n\tuseEffect(() => {\n\t\treturn monitorForElements({\n\t\t\tcanMonitor: isHomeColumn,\n\t\t\tonDrop({ location, source }) {\n\t\t\t\t// drop handled locally\n\t\t\t\tif (location.current.dropTargets.length) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Was previously looking at `localStorage` in `onDrop` but this\n\t\t\t\t * does not work `Firefox@125.0` and `Safari @17.4.1` due to a\n\t\t\t\t * timing bug with drag events.\n\t\t\t\t *\n\t\t\t\t * - 🍎 https://bugs.webkit.org/show_bug.cgi?id=274069\n\t\t\t\t * - 🦊 https://bugzilla.mozilla.org/show_bug.cgi?id=1896323\n\t\t\t\t *\n\t\t\t\t * Could listen for \"storage\" events to know when a card is handled\n\t\t\t\t * externally. There is a non-trivial amount of code for this as you\n\t\t\t\t * also need to handle that the timing differences\n\t\t\t\t *  - In Chrome you don't want to remove the dragging item when you\n\t\t\t\t *    get the \"storage\" event, as then you remove the dragging item\n\t\t\t\t *    and you no longer get a \"dragend\" (until our fallback drag end\n\t\t\t\t *    logic kicks in).\n\t\t\t\t *\n\t\t\t\t * For now using the _weak_ signal of `dropEffect` (not public API)\n\t\t\t\t * */\n\t\t\t\tconst wasHandledExternally: boolean = (() => {\n\t\t\t\t\tconst event = window.event;\n\t\t\t\t\tif (!(event instanceof DragEvent)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\treturn event.dataTransfer?.dropEffect === 'move';\n\t\t\t\t})();\n\n\t\t\t\tif (!wasHandledExternally) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst data = source.data;\n\t\t\t\tif (!isCard(data)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tsetItems((current) => current.filter((item) => item.userId !== data.cardId));\n\t\t\t},\n\t\t});\n\t}, [isHomeColumn]);\n\n\treturn (\n\t\t<Stack ref={columnRef} xcss={[columnStyles, stateStyles[state.type]]}>\n\t\t\t<Inline xcss={columnHeaderStyles} ref={headerRef} spread=\"space-between\" alignBlock=\"center\">\n\t\t\t\t<Heading size=\"xxsmall\" as=\"span\">\n\t\t\t\t\t{columnId}\n\t\t\t\t</Heading>\n\t\t\t</Inline>\n\t\t\t<Box xcss={scrollContainerStyles} ref={scrollableRef}>\n\t\t\t\t<Stack xcss={cardListStyles} space=\"space.100\">\n\t\t\t\t\t{items.map((item) => (\n\t\t\t\t\t\t<Card item={item} key={item.userId} columnId={columnId} />\n\t\t\t\t\t))}\n\t\t\t\t</Stack>\n\t\t\t</Box>\n\t\t</Stack>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/iframe-board/data.ts",
    "content": "import type { ExternalDragPayload } from '@atlaskit/pragmatic-drag-and-drop/external/adapter';\n\nimport { type Person } from '../../data/people';\n\nconst cardKey = Symbol('card');\nexport type TCard = {\n\tcardId: string;\n\tcolumnId: string;\n\t[cardKey]: true;\n};\n\nexport function getCard({ cardId, columnId }: { cardId: string; columnId: string }): TCard {\n\treturn {\n\t\tcardId,\n\t\tcolumnId,\n\t\t[cardKey]: true,\n\t};\n}\n\nexport function isCard(data: Record<string | symbol, unknown>): data is TCard {\n\treturn data[cardKey] === true;\n}\n\nconst columnDropTargetKey = Symbol('column-drop-target');\nexport type TColumnDropTarget = {\n\tcolumnId: string;\n\t[columnDropTargetKey]: true;\n};\n\nexport function getColumnDropTarget({ columnId }: { columnId: string }): TColumnDropTarget {\n\treturn {\n\t\tcolumnId,\n\t\t[columnDropTargetKey]: true,\n\t};\n}\n\nexport function isColumnDropTarget(\n\tdata: Record<string | symbol, unknown>,\n): data is TColumnDropTarget {\n\treturn data[columnDropTargetKey] === true;\n}\n\nconst cardDropTargetKey = Symbol('card-drop-target');\nexport type TCardDropTarget = {\n\tcardId: string;\n\tcolumnId: string;\n\t[cardDropTargetKey]: true;\n};\n\nexport function getCardDropTarget({\n\tcardId,\n\tcolumnId,\n}: {\n\tcardId: string;\n\tcolumnId: string;\n}): TCardDropTarget {\n\treturn {\n\t\tcardId,\n\t\tcolumnId,\n\t\t[cardDropTargetKey]: true,\n\t};\n}\n\nexport function isCardDropTarget(data: Record<string | symbol, unknown>): data is TCardDropTarget {\n\treturn data[cardDropTargetKey] === true;\n}\n\n// not exporting directly. Can only be accessed through helpers\nconst externalCardMediaType = 'application/x.card';\n\nexport function getCardDataForExternal(person: Person) {\n\tif (!isAndroid()) {\n\t\treturn {\n\t\t\t[externalCardMediaType]: person.userId,\n\t\t\t// bonus: data for external applications\n\t\t\t['text/plain']: `${person.name}: ${person.role}`,\n\t\t\t['text/uri-list']: window.location.href,\n\t\t};\n\t}\n\n\t// Note: for a production application, you might want to consider\n\t// adding a value to `localStorage` as a way to communicate _what_\n\t// is dragging across iframes for Android as a few different things\n\t// _could_ trigger a text drag.\n\treturn {\n\t\t[externalCardMediaType]: person.userId, // being hopeful\n\t\t['text/plain']: person.userId,\n\t};\n}\n\nexport const dropHandledExternallyLocalStorageKey = 'card-drop-handled-externally';\n\nfunction isAndroid(): boolean {\n\treturn navigator.userAgent.toLocaleLowerCase().includes('android');\n}\n\nexport function isDraggingExternalCard({ source }: { source: ExternalDragPayload }): boolean {\n\tif (source.types.includes(externalCardMediaType)) {\n\t\treturn true;\n\t}\n\t// custom data types not available on android\n\tif (isAndroid() && source.types.includes('text/plain')) {\n\t\treturn true;\n\t}\n\treturn false;\n}\n\nexport function getDroppedExternalCardId({\n\tsource,\n}: {\n\tsource: ExternalDragPayload;\n}): string | null {\n\tif (!isAndroid()) {\n\t\treturn source.getStringData(externalCardMediaType);\n\t}\n\n\t// fallback for android\n\treturn source.getStringData('text/plain');\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/menu-button/index.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { type ReactElement, useCallback } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport Button from '@atlaskit/button';\nimport DropdownMenu, {\n\ttype CustomTriggerProps,\n\tDropdownItem,\n\tDropdownItemGroup,\n} from '@atlaskit/dropdown-menu';\nimport MoreIcon from '@atlaskit/icon/core/show-more-horizontal';\n\nimport { usePreventScrollingFromArrowKeys } from '../hooks/use-prevent-scrolling-from-arrow-keys';\nimport type { ReorderItem } from '../subtasks/hooks/use-top-level-wiring';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\nconst hiddenStyles = css({ opacity: 0, ':focus-within': { opacity: 1 } });\n\ntype ChildrenRenderFn = (args: { children: ReactElement; isSelected: boolean }) => ReactElement;\n\nconst defaultChildrenRenderFn: ChildrenRenderFn = ({ children }) => children;\n\nexport function MenuButton({\n\tid,\n\treorderItem,\n\tindex,\n\tdataLength,\n\tsize = 'medium',\n\tisOnlyVisibleWhenFocused = false,\n\tchildren = defaultChildrenRenderFn,\n}: {\n\tid: string;\n\treorderItem: ReorderItem;\n\tindex: number;\n\tdataLength: number;\n\tsize?: 'small' | 'medium';\n\tisOnlyVisibleWhenFocused?: boolean;\n\tchildren?: ChildrenRenderFn;\n}): React.JSX.Element {\n\tconst moveUp = useCallback(() => {\n\t\treorderItem({ id, action: 'up' });\n\t}, [id, reorderItem]);\n\n\tconst moveDown = useCallback(() => {\n\t\treorderItem({ id, action: 'down' });\n\t}, [id, reorderItem]);\n\n\tconst isMoveUpDisabled = index === 0;\n\tconst isMoveDownDisabled = index === dataLength - 1;\n\n\tconst renderTrigger = useCallback(\n\t\t(triggerProps: CustomTriggerProps) => {\n\t\t\treturn (\n\t\t\t\t<MenuButtonTrigger\n\t\t\t\t\tsize={size}\n\t\t\t\t\tchildren={children}\n\t\t\t\t\tisOnlyVisibleWhenFocused={isOnlyVisibleWhenFocused}\n\t\t\t\t\t{...triggerProps}\n\t\t\t\t/>\n\t\t\t);\n\t\t},\n\t\t[children, isOnlyVisibleWhenFocused, size],\n\t);\n\n\treturn (\n\t\t<DropdownMenu trigger={renderTrigger} placement=\"bottom-start\" shouldRenderToParent>\n\t\t\t<DropdownItemGroup>\n\t\t\t\t<DropdownItem onClick={moveUp} isDisabled={isMoveUpDisabled}>\n\t\t\t\t\tMove up\n\t\t\t\t</DropdownItem>\n\t\t\t\t<DropdownItem onClick={moveDown} isDisabled={isMoveDownDisabled}>\n\t\t\t\t\tMove down\n\t\t\t\t</DropdownItem>\n\t\t\t</DropdownItemGroup>\n\t\t</DropdownMenu>\n\t);\n}\n\ntype MenuButtonTriggerOwnProps = {\n\tchildren: ChildrenRenderFn;\n\tsize: 'small' | 'medium';\n\tisOnlyVisibleWhenFocused: boolean;\n};\n\ntype MenuButtonTriggerProps = CustomTriggerProps & MenuButtonTriggerOwnProps;\n\nfunction MenuButtonTrigger({\n\ttriggerRef,\n\tchildren,\n\tsize,\n\tisOnlyVisibleWhenFocused,\n\t...props\n}: MenuButtonTriggerProps) {\n\tconst spacing = size === 'small' ? 'compact' : 'default';\n\n\tconst isSelected = Boolean(props.isSelected);\n\n\tusePreventScrollingFromArrowKeys({\n\t\tshouldPreventScrolling: isSelected,\n\t});\n\n\treturn children({\n\t\tisSelected,\n\t\tchildren: (\n\t\t\t<Button\n\t\t\t\tref={triggerRef}\n\t\t\t\t{...props}\n\t\t\t\ticonBefore={\n\t\t\t\t\t<MoreIcon spacing=\"compact\" color=\"currentColor\" label=\"actions\" size=\"small\" />\n\t\t\t\t}\n\t\t\t\tspacing={spacing}\n\t\t\t\tcss={isOnlyVisibleWhenFocused && !props.isSelected && hiddenStyles}\n\t\t\t/>\n\t\t),\n\t});\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/pinned-fields/data.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport type { ReactNode } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { jsx } from '@emotion/react';\n\nimport Avatar from '@atlaskit/avatar';\nimport Badge from '@atlaskit/badge';\nimport { Date } from '@atlaskit/date';\nimport { SimpleTag } from '@atlaskit/tag';\nimport TagGroup from '@atlaskit/tag-group';\n\nimport MajorPriorityIcon from './major-priority-icon';\n\nimport { FieldContentWithIcon } from './index';\n\nexport type DataItem = {\n\tid: string;\n\tlabel: string;\n\tcontent: ReactNode;\n};\n\nexport const initialData: DataItem[] = [\n\t{\n\t\tid: 'priority',\n\t\tlabel: 'Priority',\n\t\tcontent: <FieldContentWithIcon icon={<MajorPriorityIcon />}>Major</FieldContentWithIcon>,\n\t},\n\t{\n\t\tid: 'assignee',\n\t\tlabel: 'Assignee',\n\t\tcontent: (\n\t\t\t<FieldContentWithIcon\n\t\t\t\ticon={\n\t\t\t\t\t<Avatar\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tsrc=\"https://upload.wikimedia.org/wikipedia/en/2/2d/SSU_Kirby_artwork.png\"\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t>\n\t\t\t\tKirby\n\t\t\t</FieldContentWithIcon>\n\t\t),\n\t},\n\t{\n\t\tid: 'reporter',\n\t\tlabel: 'Reporter',\n\t\tcontent: (\n\t\t\t<FieldContentWithIcon\n\t\t\t\ticon={\n\t\t\t\t\t<Avatar\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tsrc=\"https://upload.wikimedia.org/wikipedia/en/d/db/Yoshi_%28Nintendo_character%29.png\"\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t>\n\t\t\t\tYoshi\n\t\t\t</FieldContentWithIcon>\n\t\t),\n\t},\n\t{\n\t\tid: 'labels',\n\t\tlabel: 'Labels',\n\t\tcontent: (\n\t\t\t<TagGroup>\n\t\t\t\t<SimpleTag text=\"jira\" />\n\t\t\t\t<SimpleTag text=\"work-item-view\" />\n\t\t\t</TagGroup>\n\t\t),\n\t},\n\t{\n\t\tid: 'story-points',\n\t\tlabel: 'Story point estimate',\n\t\tcontent: <Badge>{3}</Badge>,\n\t},\n\t{ id: 'due-date', label: 'Due date', content: <Date value={0} /> },\n];\n"
  },
  {
    "path": "packages/documentation/examples/pieces/pinned-fields/experience/asana-native-preview.tsx",
    "content": "import React, { useRef } from 'react';\n\nimport ReactDOM from 'react-dom';\n\nimport DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\n\nimport { useSortableField } from '../../hooks/use-sortable-field';\nimport { DropIndicator } from '../primitives/asana/drop-indicator';\nimport { Field, FieldPreview } from '../primitives/asana/field';\nimport AsanaFieldsTemplate, { type DraggableFieldProps } from '../templates/asana';\n\nconst type = 'asana--native-preview';\n\nfunction DraggableField({ index, item }: DraggableFieldProps) {\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tconst { isHovering, closestEdge } = useSortableField({\n\t\tid: item.id,\n\t\tindex,\n\t\ttype,\n\t\tref,\n\t\tshouldHideDropIndicatorForNoopTargets: false,\n\t\tisSticky: false,\n\t\tshouldHideNativeDragPreview: false,\n\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\tsetCustomNativeDragPreview({\n\t\t\t\tnativeSetDragImage,\n\t\t\t\trender({ container }) {\n\t\t\t\t\tReactDOM.render(<FieldPreview>{item.label}</FieldPreview>, container);\n\t\t\t\t\treturn () => ReactDOM.unmountComponentAtNode(container);\n\t\t\t\t},\n\t\t\t});\n\t\t},\n\t});\n\n\treturn (\n\t\t<Field\n\t\t\tref={ref}\n\t\t\ticon={\n\t\t\t\tisHovering ? (\n\t\t\t\t\t<DragHandleVerticalIcon color=\"currentColor\" spacing=\"spacious\" label=\"\" size=\"small\" />\n\t\t\t\t) : (\n\t\t\t\t\titem.icon\n\t\t\t\t)\n\t\t\t}\n\t\t>\n\t\t\t{item.label}\n\t\t\t{closestEdge && <DropIndicator edge={closestEdge} />}\n\t\t</Field>\n\t);\n}\n\nexport default function AsanaFieldsWithNativePreview(): React.JSX.Element {\n\treturn <AsanaFieldsTemplate instanceId={type} DraggableField={DraggableField} />;\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/pinned-fields/experience/asana.tsx",
    "content": "import React, { type ReactNode, type RefObject, useEffect, useRef } from 'react';\n\nimport invariant from 'tiny-invariant';\n\nimport DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nimport { useSortableField } from '../../hooks/use-sortable-field';\nimport { DropIndicator } from '../primitives/asana/drop-indicator';\nimport { Field, FieldPreview } from '../primitives/asana/field';\nimport AsanaFieldsTemplate, { type DraggableFieldProps } from '../templates/asana';\n\nconst type = 'asana';\n\nfunction DragPreview({\n\tfieldRef,\n\tchildren,\n}: {\n\tchildren: ReactNode;\n\tfieldRef: RefObject<HTMLElement>;\n}) {\n\tconst previewRef = useRef<HTMLDivElement>(null);\n\n\tuseEffect(() => {\n\t\tconst previewElement = previewRef.current;\n\t\tinvariant(previewElement);\n\n\t\tconst fieldElement = fieldRef.current;\n\t\tinvariant(fieldElement);\n\n\t\tconst initialFieldRect = fieldElement.getBoundingClientRect();\n\n\t\treturn monitorForElements({\n\t\t\tonDrag({ location }) {\n\t\t\t\tconst { current, initial } = location;\n\n\t\t\t\tconst alignmentX = initialFieldRect.x - initial.input.clientX;\n\t\t\t\tconst alignmentY = initialFieldRect.y - initial.input.clientY;\n\n\t\t\t\tconst offsetX = current.input.clientX + alignmentX;\n\t\t\t\tconst offsetY = current.input.clientY + alignmentY;\n\n\t\t\t\tconst transform = `translate(${offsetX}px, ${offsetY}px)`;\n\n\t\t\t\tObject.assign(previewElement.style, {\n\t\t\t\t\ttransform,\n\t\t\t\t\topacity: 1,\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\t}, [fieldRef]);\n\n\treturn (\n\t\t<div\n\t\t\tref={previewRef}\n\t\t\tstyle={{\n\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\tposition: 'fixed',\n\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\ttop: 0,\n\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\tleft: 0,\n\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\topacity: 0,\n\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\tpointerEvents: 'none',\n\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\tzIndex: 999,\n\t\t\t}}\n\t\t>\n\t\t\t<FieldPreview>{children}</FieldPreview>\n\t\t</div>\n\t);\n}\n\nfunction DraggableField({ index, item }: DraggableFieldProps) {\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tconst { isHovering, isDragging, closestEdge } = useSortableField({\n\t\tid: item.id,\n\t\tindex,\n\t\ttype,\n\t\tref,\n\t\tshouldHideDropIndicatorForNoopTargets: false,\n\t\tisSticky: false,\n\t\tshouldHideNativeDragPreview: true,\n\t});\n\n\treturn (\n\t\t<Field\n\t\t\tref={ref}\n\t\t\ticon={\n\t\t\t\tisHovering ? (\n\t\t\t\t\t<DragHandleVerticalIcon color=\"currentColor\" spacing=\"spacious\" label=\"\" size=\"small\" />\n\t\t\t\t) : (\n\t\t\t\t\titem.icon\n\t\t\t\t)\n\t\t\t}\n\t\t>\n\t\t\t{item.label}\n\t\t\t{closestEdge && <DropIndicator edge={closestEdge} />}\n\t\t\t{isDragging && <DragPreview fieldRef={ref}>{item.label}</DragPreview>}\n\t\t</Field>\n\t);\n}\n\nexport default function AsanaFields(): React.JSX.Element {\n\treturn <AsanaFieldsTemplate instanceId={type} DraggableField={DraggableField} />;\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/pinned-fields/experience/current-guidelines-a11y-always-visible.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { useRef } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\n\nimport { useSortableField } from '../../hooks/use-sortable-field';\nimport { useTopLevelWiring } from '../../hooks/use-top-level-wiring';\nimport { MenuButton } from '../../menu-button';\nimport type { ReorderItem } from '../../subtasks/hooks/use-top-level-wiring';\nimport { initialData } from '../data';\nimport { Field, type FieldProps, PinnedFieldsContainer, PinnedFieldsList } from '../index';\n\nconst draggableFieldStyles = css({\n\tcursor: 'grab',\n});\n\nconst type = 'current-guidelines--a11y-always-visible';\n\nfunction DraggableField({\n\tindex,\n\tid,\n\tchildren,\n\treorderItem,\n\tdata,\n\t...fieldProps\n}: FieldProps & {\n\tid: string;\n\treorderItem: ReorderItem;\n\tdata: unknown[];\n\tindex: number;\n}) {\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tconst { isDragging, closestEdge } = useSortableField({\n\t\tid,\n\t\tindex,\n\t\ttype,\n\t\tref,\n\t});\n\n\treturn (\n\t\t<Field\n\t\t\tref={ref}\n\t\t\tisDisabled={isDragging}\n\t\t\tclosestEdge={closestEdge}\n\t\t\tcss={draggableFieldStyles}\n\t\t\t{...fieldProps}\n\t\t>\n\t\t\t{children}\n\t\t\t<span\n\t\t\t\tstyle={{\n\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\ttop: 0,\n\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\tright: 0,\n\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\tpadding: 8,\n\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\tbackground: 'white',\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<MenuButton\n\t\t\t\t\tid={id}\n\t\t\t\t\treorderItem={reorderItem}\n\t\t\t\t\tindex={index}\n\t\t\t\t\tdataLength={data.length}\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t/>\n\t\t\t</span>\n\t\t\t{closestEdge && <DropIndicator edge={closestEdge} gap=\"8px\" />}\n\t\t</Field>\n\t);\n}\n\nexport default function PinnedFieldsWithCurrentGuidelinesA11yAlwaysVisible(): React.JSX.Element {\n\tconst { data, reorderItem } = useTopLevelWiring({ initialData, type });\n\n\treturn (\n\t\t<PinnedFieldsContainer>\n\t\t\t<PinnedFieldsList>\n\t\t\t\t{data.map((item, index) => (\n\t\t\t\t\t<DraggableField\n\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\tid={item.id}\n\t\t\t\t\t\tlabel={item.label}\n\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\treorderItem={reorderItem}\n\t\t\t\t\t\tdata={data}\n\t\t\t\t\t>\n\t\t\t\t\t\t{item.content}\n\t\t\t\t\t</DraggableField>\n\t\t\t\t))}\n\t\t\t</PinnedFieldsList>\n\t\t</PinnedFieldsContainer>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/pinned-fields/experience/current-guidelines-a11y-keyboard-only.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { useRef } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\nimport { token } from '@atlaskit/tokens';\n\nimport { useSortableField } from '../../hooks/use-sortable-field';\nimport { useTopLevelWiring } from '../../hooks/use-top-level-wiring';\nimport { MenuButton } from '../../menu-button';\nimport type { ReorderItem } from '../../subtasks/hooks/use-top-level-wiring';\nimport { initialData } from '../data';\nimport { Field, type FieldProps, PinnedFieldsContainer, PinnedFieldsList } from '../index';\n\nconst draggableFieldStyles = css({\n\tcursor: 'grab',\n});\n\nconst type = 'current-guidelines--a11y-keyboard-only';\n\nconst menuButtonContainerStyles = css({\n\tposition: 'absolute',\n\ttop: 0,\n\tright: 0,\n\tpadding: 8,\n\tpaddingLeft: 24,\n\tclipPath: 'inset(0px 0px 0px -32px)',\n\tmaskImage: 'linear-gradient(to right, transparent, black 16px)',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':focus-within': {\n\t\tbackground: token('elevation.surface'),\n\t},\n});\n\nconst menuButtonContainerSelectedStyles = css({\n\tbackground: token('elevation.surface'),\n});\n\nfunction DraggableField({\n\tindex,\n\tid,\n\tchildren,\n\treorderItem,\n\tdata,\n\t...fieldProps\n}: FieldProps & {\n\tid: string;\n\treorderItem: ReorderItem;\n\tdata: unknown[];\n\tindex: number;\n}) {\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tconst { isDragging, closestEdge } = useSortableField({\n\t\tid,\n\t\tindex,\n\t\ttype,\n\t\tref,\n\t});\n\n\treturn (\n\t\t<Field\n\t\t\tref={ref}\n\t\t\tisDisabled={isDragging}\n\t\t\tclosestEdge={closestEdge}\n\t\t\tcss={draggableFieldStyles}\n\t\t\t{...fieldProps}\n\t\t>\n\t\t\t{children}\n\t\t\t<MenuButton\n\t\t\t\tid={id}\n\t\t\t\treorderItem={reorderItem}\n\t\t\t\tindex={index}\n\t\t\t\tdataLength={data.length}\n\t\t\t\tsize=\"small\"\n\t\t\t\tisOnlyVisibleWhenFocused\n\t\t\t>\n\t\t\t\t{({ children, isSelected }) => (\n\t\t\t\t\t<span css={[menuButtonContainerStyles, isSelected && menuButtonContainerSelectedStyles]}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</span>\n\t\t\t\t)}\n\t\t\t</MenuButton>\n\t\t\t{closestEdge && <DropIndicator edge={closestEdge} gap=\"8px\" />}\n\t\t</Field>\n\t);\n}\n\nexport default function PinnedFieldsWithCurrentGuidelinesA11yKeyboardOnly(): React.JSX.Element {\n\tconst { data, reorderItem } = useTopLevelWiring({ initialData, type });\n\n\treturn (\n\t\t<PinnedFieldsContainer>\n\t\t\t<PinnedFieldsList>\n\t\t\t\t{data.map((item, index) => (\n\t\t\t\t\t<DraggableField\n\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\tid={item.id}\n\t\t\t\t\t\tlabel={item.label}\n\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\treorderItem={reorderItem}\n\t\t\t\t\t\tdata={data}\n\t\t\t\t\t>\n\t\t\t\t\t\t{item.content}\n\t\t\t\t\t</DraggableField>\n\t\t\t\t))}\n\t\t\t</PinnedFieldsList>\n\t\t</PinnedFieldsContainer>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/pinned-fields/experience/current-guidelines.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { useRef } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\n\nimport { useSortableField } from '../../hooks/use-sortable-field';\nimport { useTopLevelWiring } from '../../hooks/use-top-level-wiring';\nimport { initialData } from '../data';\nimport { Field, type FieldProps, PinnedFieldsContainer, PinnedFieldsList } from '../index';\n\nconst draggableFieldStyles = css({\n\tcursor: 'grab',\n});\n\nconst type = 'current-guidelines';\n\nfunction DraggableField({\n\tindex,\n\tid,\n\tchildren,\n\t...fieldProps\n}: FieldProps & { id: string; index: number }) {\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tconst { isDragging, closestEdge } = useSortableField({\n\t\tid,\n\t\tindex,\n\t\ttype,\n\t\tref,\n\t});\n\n\treturn (\n\t\t<Field\n\t\t\tref={ref}\n\t\t\tisDisabled={isDragging}\n\t\t\tclosestEdge={closestEdge}\n\t\t\tcss={draggableFieldStyles}\n\t\t\t{...fieldProps}\n\t\t>\n\t\t\t{children}\n\t\t\t{closestEdge && <DropIndicator edge={closestEdge} gap=\"8px\" />}\n\t\t</Field>\n\t);\n}\n\nexport default function PinnedFieldsWithCurrentGuidelines(): React.JSX.Element {\n\tconst { data } = useTopLevelWiring({ initialData, type });\n\n\treturn (\n\t\t<PinnedFieldsContainer>\n\t\t\t<PinnedFieldsList>\n\t\t\t\t{data.map((item, index) => (\n\t\t\t\t\t<DraggableField key={item.id} id={item.id} label={item.label} index={index}>\n\t\t\t\t\t\t{item.content}\n\t\t\t\t\t</DraggableField>\n\t\t\t\t))}\n\t\t\t</PinnedFieldsList>\n\t\t</PinnedFieldsContainer>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/pinned-fields/experience/enhanced-drag-handle.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { Fragment, type ReactNode, useCallback, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport ReactDOM from 'react-dom';\n\nimport DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';\n// eslint-disable-next-line @atlaskit/design-system/no-banned-imports\nimport mergeRefs from '@atlaskit/ds-lib/merge-refs';\nimport { DragHandleButton } from '@atlaskit/pragmatic-drag-and-drop-react-accessibility/drag-handle-button';\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\nimport { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\nimport { token } from '@atlaskit/tokens';\n\nimport { useFlashOnDrop } from '../../hooks/use-flash-on-drop';\nimport { useSortableField } from '../../hooks/use-sortable-field';\nimport { Field, FieldLabel } from '../index';\nimport PinnedFieldsAtlassianTemplate, { type DraggableFieldProps } from '../templates/atlassian';\n\n/**\n * Enhancements are WIP and experimental\n */\nconst type = 'enhanced--drag-handle';\n\nconst draggableFieldPreviewStyles = css({\n\tbackground: token('elevation.surface.overlay'),\n\tboxShadow: token('elevation.shadow.overlay'),\n\tborderRadius: 3,\n\tpadding: '4px 8px',\n});\n\nfunction DraggableFieldPreview({ children }: { children: ReactNode }) {\n\treturn (\n\t\t<div css={draggableFieldPreviewStyles}>\n\t\t\t<FieldLabel>{children}</FieldLabel>\n\t\t</div>\n\t);\n}\n\nconst draggableFieldStyles = {\n\tidle: css({}),\n\tpreview: css({}),\n\tdragging: css({}),\n};\n\nfunction DraggableField({ index, item, data, reorderItem }: DraggableFieldProps) {\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tconst [dragHandle, setDragHandle] = useState<HTMLElement | null>(null);\n\n\tconst { dragState, closestEdge } = useSortableField({\n\t\tid: item.id,\n\t\tindex,\n\t\ttype,\n\t\tref,\n\t\tdragHandle,\n\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\treturn setCustomNativeDragPreview({\n\t\t\t\tnativeSetDragImage,\n\t\t\t\tgetOffset: pointerOutsideOfPreview({\n\t\t\t\t\tx: '16px',\n\t\t\t\t\ty: '8px',\n\t\t\t\t}),\n\t\t\t\trender({ container }) {\n\t\t\t\t\tReactDOM.render(<DraggableFieldPreview>{item.label}</DraggableFieldPreview>, container);\n\t\t\t\t\treturn () => {\n\t\t\t\t\t\tReactDOM.unmountComponentAtNode(container);\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t});\n\t\t},\n\t});\n\n\tuseFlashOnDrop({ ref, draggableId: item.id, type });\n\n\tconst moveUp = useCallback(() => {\n\t\treorderItem({ id: item.id, action: 'up' });\n\t}, [item.id, reorderItem]);\n\n\tconst moveDown = useCallback(() => {\n\t\treorderItem({ id: item.id, action: 'down' });\n\t}, [item.id, reorderItem]);\n\n\tconst isMoveUpDisabled = index === 0;\n\tconst isMoveDownDisabled = index === data.length - 1;\n\n\treturn (\n\t\t<Field\n\t\t\tref={ref}\n\t\t\tisDisabled={dragState === 'dragging'}\n\t\t\tclosestEdge={closestEdge}\n\t\t\tcss={draggableFieldStyles[dragState]}\n\t\t\tlabel={\n\t\t\t\t<Fragment>\n\t\t\t\t\t<span\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tmarginLeft: -4,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\ttrigger={({ triggerRef, ...triggerProps }) => (\n\t\t\t\t\t\t\t\t<DragHandleButton\n\t\t\t\t\t\t\t\t\tref={mergeRefs([setDragHandle, triggerRef])}\n\t\t\t\t\t\t\t\t\t{...triggerProps}\n\t\t\t\t\t\t\t\t\tlabel=\"reorder\"\n\t\t\t\t\t\t\t\t\tappearance=\"subtle\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<DropdownItemGroup>\n\t\t\t\t\t\t\t\t<DropdownItem onClick={moveUp} isDisabled={isMoveUpDisabled}>\n\t\t\t\t\t\t\t\t\tMove up\n\t\t\t\t\t\t\t\t</DropdownItem>\n\t\t\t\t\t\t\t\t<DropdownItem onClick={moveDown} isDisabled={isMoveDownDisabled}>\n\t\t\t\t\t\t\t\t\tMove down\n\t\t\t\t\t\t\t\t</DropdownItem>\n\t\t\t\t\t\t\t</DropdownItemGroup>\n\t\t\t\t\t\t</DropdownMenu>\n\t\t\t\t\t</span>\n\t\t\t\t\t{item.label}\n\t\t\t\t</Fragment>\n\t\t\t}\n\t\t>\n\t\t\t{item.content}\n\t\t\t{closestEdge && <DropIndicator edge={closestEdge} gap=\"8px\" />}\n\t\t</Field>\n\t);\n}\n\nexport default function PinnedFieldsEnhancedDragHandle(): React.JSX.Element {\n\treturn <PinnedFieldsAtlassianTemplate instanceId={type} DraggableField={DraggableField} />;\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/pinned-fields/experience/migration-layer.tsx",
    "content": "import React from 'react';\n\nimport {\n\tDragDropContext,\n\tDraggable,\n\tDroppable,\n} from '@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration';\n\nimport { DroppableAreaOverlay } from '../primitives/droppable-area-overlay';\nimport PinnedFieldsReactBeautifulDndTemplate from '../templates/react-beautiful-dnd';\n\nexport default function PinnedFieldReactBeautifulDnd(): React.JSX.Element {\n\treturn (\n\t\t<PinnedFieldsReactBeautifulDndTemplate\n\t\t\tidPrefix=\"rbd-pdnd-migration\"\n\t\t\tDragDropContext={DragDropContext}\n\t\t\tDraggable={Draggable}\n\t\t\tDroppable={Droppable}\n\t\t\tDroppableAreaOverlay={DroppableAreaOverlay}\n\t\t/>\n\t);\n}\n\nexport function PinnedFieldReactBeautifulDndNoDraggingOutline(): React.JSX.Element {\n\treturn (\n\t\t<PinnedFieldsReactBeautifulDndTemplate\n\t\t\tidPrefix=\"rbd-pdnd-migration--borderless\"\n\t\t\tDragDropContext={DragDropContext}\n\t\t\tDraggable={Draggable}\n\t\t\tDroppable={Droppable}\n\t\t\tDroppableAreaOverlay={(props) => <DroppableAreaOverlay {...props} appearance=\"borderless\" />}\n\t\t/>\n\t);\n}\n\nexport function PinnedFieldReactBeautifulDndSubtle(): React.JSX.Element {\n\treturn (\n\t\t<PinnedFieldsReactBeautifulDndTemplate\n\t\t\tidPrefix=\"rbd-pdnd-migration--subtle\"\n\t\t\tDragDropContext={DragDropContext}\n\t\t\tDraggable={Draggable}\n\t\t\tDroppable={Droppable}\n\t\t\tDroppableAreaOverlay={(props) => <DroppableAreaOverlay {...props} appearance=\"subtle\" />}\n\t\t/>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/pinned-fields/experience/rdr-prototype.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { Fragment, type ReactNode, useCallback, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport ReactDOM from 'react-dom';\n\nimport DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';\n// eslint-disable-next-line @atlaskit/design-system/no-banned-imports\nimport mergeRefs from '@atlaskit/ds-lib/merge-refs';\nimport { DragHandleButton } from '@atlaskit/pragmatic-drag-and-drop-react-accessibility/drag-handle-button';\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\nimport { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\nimport { token } from '@atlaskit/tokens';\n\nimport { useFlashOnDrop } from '../../hooks/use-flash-on-drop';\nimport { useSortableField } from '../../hooks/use-sortable-field';\nimport { Field, FieldLabel } from '../index';\nimport PinnedFieldsAtlassianTemplate, { type DraggableFieldProps } from '../templates/atlassian';\n\n/**\n * Enhancements are WIP and experimental\n */\nconst type = 'enhanced--drag-handle';\n\nconst draggableFieldPreviewStyles = css({\n\tbackground: token('elevation.surface.overlay'),\n\tboxShadow: token('elevation.shadow.overlay'),\n\tborderRadius: 3,\n\tpadding: '4px 8px',\n});\n\nfunction DraggableFieldPreview({ children }: { children: ReactNode }) {\n\treturn (\n\t\t<div css={draggableFieldPreviewStyles}>\n\t\t\t<FieldLabel>{children}</FieldLabel>\n\t\t</div>\n\t);\n}\n\nconst draggableFieldStyles = {\n\tidle: css({}),\n\tpreview: css({}),\n\tdragging: css({}),\n};\n\nfunction DraggableField({ index, item, data, reorderItem }: DraggableFieldProps) {\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tconst [dragHandle, setDragHandle] = useState<HTMLElement | null>(null);\n\n\tconst { dragState, closestEdge } = useSortableField({\n\t\tid: item.id,\n\t\tindex,\n\t\ttype,\n\t\tref,\n\t\tdragHandle,\n\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\treturn setCustomNativeDragPreview({\n\t\t\t\tnativeSetDragImage,\n\t\t\t\tgetOffset: pointerOutsideOfPreview({\n\t\t\t\t\tx: '16px',\n\t\t\t\t\ty: '8px',\n\t\t\t\t}),\n\t\t\t\trender({ container }) {\n\t\t\t\t\tReactDOM.render(<DraggableFieldPreview>{item.label}</DraggableFieldPreview>, container);\n\t\t\t\t\treturn () => {\n\t\t\t\t\t\tReactDOM.unmountComponentAtNode(container);\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t});\n\t\t},\n\t});\n\n\tuseFlashOnDrop({ ref, draggableId: item.id, type });\n\n\tconst moveUp = useCallback(() => {\n\t\treorderItem({ id: item.id, action: 'up' });\n\t}, [item.id, reorderItem]);\n\n\tconst moveDown = useCallback(() => {\n\t\treorderItem({ id: item.id, action: 'down' });\n\t}, [item.id, reorderItem]);\n\n\tconst isMoveUpDisabled = index === 0;\n\tconst isMoveDownDisabled = index === data.length - 1;\n\n\treturn (\n\t\t<Field\n\t\t\tref={ref}\n\t\t\tisDisabled={dragState === 'dragging'}\n\t\t\tclosestEdge={closestEdge}\n\t\t\tcss={draggableFieldStyles[dragState]}\n\t\t\tlabel={\n\t\t\t\t<Fragment>\n\t\t\t\t\t<span\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tmarginLeft: -4,\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\ttrigger={({ triggerRef, ...triggerProps }) => (\n\t\t\t\t\t\t\t\t<DragHandleButton\n\t\t\t\t\t\t\t\t\tref={mergeRefs([setDragHandle, triggerRef])}\n\t\t\t\t\t\t\t\t\t{...triggerProps}\n\t\t\t\t\t\t\t\t\tlabel=\"reorder\"\n\t\t\t\t\t\t\t\t\tappearance=\"subtle\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<DropdownItemGroup>\n\t\t\t\t\t\t\t\t<DropdownItem onClick={moveUp} isDisabled={isMoveUpDisabled}>\n\t\t\t\t\t\t\t\t\tMove up\n\t\t\t\t\t\t\t\t</DropdownItem>\n\t\t\t\t\t\t\t\t<DropdownItem onClick={moveDown} isDisabled={isMoveDownDisabled}>\n\t\t\t\t\t\t\t\t\tMove down\n\t\t\t\t\t\t\t\t</DropdownItem>\n\t\t\t\t\t\t\t</DropdownItemGroup>\n\t\t\t\t\t\t</DropdownMenu>\n\t\t\t\t\t</span>\n\t\t\t\t\t{item.label}\n\t\t\t\t</Fragment>\n\t\t\t}\n\t\t>\n\t\t\t{item.content}\n\t\t\t{closestEdge && <DropIndicator edge={closestEdge} gap=\"8px\" />}\n\t\t</Field>\n\t);\n}\n\nexport default function PinnedFieldsPrototype(): React.JSX.Element {\n\treturn <PinnedFieldsAtlassianTemplate instanceId={type} DraggableField={DraggableField} />;\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/pinned-fields/experience/react-beautiful-dnd.tsx",
    "content": "import React from 'react';\n\nimport { DragDropContext, Draggable, Droppable } from 'react-beautiful-dnd';\n\nimport { DroppableAreaOverlay } from '../primitives/droppable-area-overlay';\nimport PinnedFieldsReactBeautifulDndTemplate from '../templates/react-beautiful-dnd';\n\nexport default function PinnedFieldReactBeautifulDnd(): React.JSX.Element {\n\treturn (\n\t\t<PinnedFieldsReactBeautifulDndTemplate\n\t\t\tidPrefix=\"react-beautiful-dnd\"\n\t\t\tDragDropContext={DragDropContext}\n\t\t\tDraggable={Draggable}\n\t\t\tDroppable={Droppable}\n\t\t\tDroppableAreaOverlay={DroppableAreaOverlay}\n\t\t/>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/pinned-fields/hooks/use-sortable-field.tsx",
    "content": "import { type RefObject, useEffect, useState } from 'react';\n\nimport { bindAll } from 'bind-event-listener';\nimport invariant from 'tiny-invariant';\n\nimport {\n\tattachClosestEdge,\n\ttype Edge,\n\textractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { disableNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview';\n\ntype UseSortableFieldArgs = {\n\tid: string;\n\tindex: number;\n\ttype: string;\n\tref: RefObject<HTMLElement>;\n\n\tshouldHideNativeDragPreview?: boolean;\n\n\t/**\n\t * Used for the Asana clone.\n\t */\n\tshouldHideDropIndicatorForNoopTargets?: boolean;\n\tisSticky?: boolean;\n};\n\nfunction shouldHideDropIndicator({\n\tclosestEdge,\n\tsourceIndex,\n\ttargetIndex,\n}: {\n\tclosestEdge: Edge | null;\n\tsourceIndex: number;\n\ttargetIndex: number;\n}) {\n\tconst isTargetingSelf = sourceIndex === targetIndex;\n\tconst isTargetingBottomOfPrevious = closestEdge === 'bottom' && targetIndex === sourceIndex - 1;\n\tconst isTargetingTopOfNext = closestEdge === 'top' && targetIndex === sourceIndex + 1;\n\n\treturn isTargetingSelf || isTargetingBottomOfPrevious || isTargetingTopOfNext;\n}\n\nexport function useSortableField({\n\tid,\n\tindex,\n\ttype,\n\tref,\n\tshouldHideNativeDragPreview = false,\n\tshouldHideDropIndicatorForNoopTargets = true,\n\tisSticky = true,\n}: UseSortableFieldArgs) {\n\tconst [isHovering, setIsHovering] = useState(false);\n\tconst [isDragging, setIsDragging] = useState(false);\n\tconst [closestEdge, setClosestEdge] = useState<Edge | null>(null);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tif (!element) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst data = { id, index, type };\n\n\t\treturn combine(\n\t\t\tbindAll(element, [\n\t\t\t\t{\n\t\t\t\t\ttype: 'pointerenter',\n\t\t\t\t\tlistener() {\n\t\t\t\t\t\tsetIsHovering(true);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttype: 'pointerleave',\n\t\t\t\t\tlistener() {\n\t\t\t\t\t\tsetIsHovering(false);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t]),\n\t\t\tdraggable({\n\t\t\t\telement,\n\t\t\t\tgetInitialData() {\n\t\t\t\t\treturn data;\n\t\t\t\t},\n\t\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\t\tif (shouldHideNativeDragPreview) {\n\t\t\t\t\t\tdisableNativeDragPreview({ nativeSetDragImage });\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonDragStart() {\n\t\t\t\t\tsetIsDragging(true);\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tsetIsDragging(false);\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement,\n\t\t\t\tgetIsSticky() {\n\t\t\t\t\treturn isSticky;\n\t\t\t\t},\n\t\t\t\tcanDrop({ source }) {\n\t\t\t\t\treturn source.data.type === type;\n\t\t\t\t},\n\t\t\t\tgetData({ input }) {\n\t\t\t\t\treturn attachClosestEdge(data, {\n\t\t\t\t\t\telement,\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tallowedEdges: ['top', 'bottom'],\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDrag({ self, source }) {\n\t\t\t\t\tconst closestEdge = extractClosestEdge(self.data);\n\t\t\t\t\tconst sourceIndex = source.data.index;\n\t\t\t\t\tinvariant(typeof sourceIndex === 'number');\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tshouldHideDropIndicatorForNoopTargets &&\n\t\t\t\t\t\tshouldHideDropIndicator({\n\t\t\t\t\t\t\tclosestEdge,\n\t\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\t\ttargetIndex: index,\n\t\t\t\t\t\t})\n\t\t\t\t\t) {\n\t\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetClosestEdge(closestEdge);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonDragLeave() {\n\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [\n\t\tid,\n\t\tindex,\n\t\tisSticky,\n\t\tref,\n\t\tshouldHideDropIndicatorForNoopTargets,\n\t\tshouldHideNativeDragPreview,\n\t\ttype,\n\t]);\n\n\treturn { isHovering, isDragging, closestEdge };\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/pinned-fields/index.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { forwardRef, type HTMLAttributes, type ReactNode, type Ref } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport type { Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { token } from '@atlaskit/tokens';\n\nconst containerStyles = css({\n\t// for parent placement\n\tflexGrow: 1,\n\tflexBasis: 0,\n\tmaxWidth: 400,\n\tminWidth: 300,\n\n\tdisplay: 'flex',\n\tflexDirection: 'column',\n\tborder: `${token('border.width')} solid ${token('color.border')}`,\n\tborderRadius: token('radius.small'),\n});\n\nconst headerStyles = css({\n\tbackground: token('elevation.surface.overlay'),\n\tfont: token('font.body'),\n\tfontWeight: token('font.weight.bold'),\n\tpadding: token('space.150'),\n\tborderBottom: `${token('border.width')} solid ${token('color.border')}`,\n\tborderRadius: `${token('radius.small')} ${token('radius.small')} 0px 0px`,\n});\n\nconst listStyles = css({\n\tdisplay: 'flex',\n\tflexDirection: 'column',\n\tboxSizing: 'border-box',\n\t// border: '1px solid transparent',\n\tborderRadius: token('radius.small'),\n\tposition: 'relative',\n\n\t/**\n\t * Adding some small extra padding so that drop indicators\n\t * at the top and bottom aren't against the edge of the container.\n\t */\n\tpadding: `${token('space.050')} ${token('space.100')}`,\n});\n\nconst fieldStyles = css({\n\tdisplay: 'grid',\n\tgap: token('space.300'),\n\talignItems: 'start',\n\tpadding: '8px 4px',\n\tmargin: '4px 0px',\n\tgridTemplateColumns: 'min(40%, 140px) 1fr',\n\tbackground: token('elevation.surface'),\n\tborderRadius: 3,\n\tposition: 'relative',\n});\n\nconst fieldLabelStyles = css({\n\tfont: 'font.body.small',\n\tfontWeight: 'font.weight.semibold',\n\tcolor: token('color.text.subtle'),\n\t// padding: '4px 0px',\n\tminHeight: 24,\n\tdisplay: 'flex',\n\talignItems: 'center',\n\tgap: token('space.050'),\n});\n\nexport function FieldLabel({ children }: { children: ReactNode }): React.JSX.Element {\n\treturn <div css={fieldLabelStyles}>{children}</div>;\n}\n\nconst fieldDisabledStyles = css({\n\t/**\n\t * Using disabled color tokens is recommended,\n\t * but does not work for well for images or other\n\t * components we cannot override.\n\t */\n\topacity: 0.4,\n});\n\nconst fieldDraggingStyles = css({\n\tbackground: token('elevation.surface.overlay'),\n\tboxShadow: token('elevation.shadow.overlay'),\n});\n\nexport type FieldProps = HTMLAttributes<HTMLDivElement> & {\n\tlabel: ReactNode;\n\tchildren: ReactNode;\n\tisDisabled?: boolean;\n\tclosestEdge?: Edge | null;\n\tclassName?: string;\n\tisDragging?: boolean;\n};\n\nexport const Field = forwardRef<HTMLDivElement, FieldProps>(function Field(\n\t{\n\t\tlabel,\n\t\tchildren,\n\t\tclassName,\n\t\tisDisabled = false,\n\t\tclosestEdge = null,\n\t\tisDragging = false,\n\t\t...props\n\t},\n\tref,\n) {\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tcss={[fieldStyles, isDisabled && fieldDisabledStyles, isDragging && fieldDraggingStyles]}\n\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766\n\t\t\tclassName={className}\n\t\t\t{...props}\n\t\t>\n\t\t\t<div css={[fieldLabelStyles, isDisabled && fieldDisabledStyles]}>{label}</div>\n\t\t\t<div>{children}</div>\n\t\t</div>\n\t);\n});\n\nexport const PinnedFieldsList = forwardRef(function DroppableArea(\n\t{ children, ...props }: HTMLAttributes<HTMLDivElement>,\n\tref: Ref<HTMLDivElement>,\n) {\n\treturn (\n\t\t<div ref={ref} css={listStyles} {...props}>\n\t\t\t{children}\n\t\t</div>\n\t);\n});\n\nexport function PinnedFieldsContainer({ children }: { children: ReactNode }): React.JSX.Element {\n\treturn (\n\t\t<div css={containerStyles}>\n\t\t\t<div css={headerStyles}>Pinned fields</div>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n\nconst fieldContentWithIconStyles = css({\n\tdisplay: 'grid',\n\tgridTemplateColumns: '24px 1fr',\n\talignItems: 'center',\n\tgap: 12,\n});\n\nconst fieldContentIconStyles = css({\n\tdisplay: 'flex',\n\tjustifyContent: 'center',\n\talignItems: 'center',\n\twidth: 24,\n\theight: 24,\n\tpointerEvents: 'none',\n});\n\n/**\n * Used to emulate a select\n */\nexport function FieldContentWithIcon({\n\tchildren,\n\ticon,\n}: {\n\tchildren: ReactNode;\n\ticon: ReactNode;\n}): React.JSX.Element {\n\treturn (\n\t\t<div css={fieldContentWithIconStyles}>\n\t\t\t<div css={fieldContentIconStyles}>{icon}</div>\n\t\t\t<div>{children}</div>\n\t\t</div>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/pinned-fields/major-priority-icon.tsx",
    "content": "import React from 'react';\n\nexport default function MajorPriorityIcon(): React.JSX.Element {\n\treturn (\n\t\t<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t<path\n\t\t\t\td=\"M12.5215 14.1467L12.6247 14.2191L17.6247 18.2191C18.056 18.5641 18.1259 19.1934 17.7809 19.6247C17.4624 20.0228 16.9017 20.113 16.4781 19.8531L16.3753 19.7809L12 16.28L7.62469 19.7809C7.22661 20.0993 6.65978 20.0643 6.30357 19.7178L6.21913 19.6247C5.90066 19.2266 5.93574 18.6598 6.28222 18.3036L6.3753 18.2191L11.3753 14.2191C11.7073 13.9535 12.1664 13.9294 12.5215 14.1467Z\"\n\t\t\t\tfill=\"#FF8F73\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M12.5215 9.14669L12.6247 9.21913L17.6247 13.2191C18.056 13.5641 18.1259 14.1934 17.7809 14.6247C17.4624 15.0228 16.9017 15.113 16.4781 14.8531L16.3753 14.7809L12 11.28L7.6247 14.7809C7.22661 15.0993 6.65979 15.0643 6.30358 14.7178L6.21914 14.6247C5.90067 14.2266 5.93575 13.6598 6.28223 13.3036L6.37531 13.2191L11.3753 9.21913C11.7073 8.95352 12.1664 8.92937 12.5215 9.14669Z\"\n\t\t\t\tfill=\"#FF7452\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M12.5215 4.14669L12.6247 4.21913L17.6247 8.21913C18.056 8.56414 18.1259 9.19343 17.7809 9.62469C17.4624 10.0228 16.9017 10.113 16.4781 9.85315L16.3753 9.78087L12 6.28L7.6247 9.78087C7.22661 10.0993 6.65979 10.0643 6.30358 9.71778L6.21914 9.62469C5.90067 9.22661 5.93575 8.65978 6.28223 8.30358L6.37531 8.21913L11.3753 4.21913C11.7073 3.95352 12.1664 3.92937 12.5215 4.14669Z\"\n\t\t\t\tfill=\"#FF5630\"\n\t\t\t/>\n\t\t</svg>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/pinned-fields/primitives/asana/constants.tsx",
    "content": "export const gapSize = 8;\n"
  },
  {
    "path": "packages/documentation/examples/pieces/pinned-fields/primitives/asana/drop-indicator.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport React from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport { type Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { token } from '@atlaskit/tokens';\n\nimport { gapSize } from './constants';\n\nconst terminalRadius = 6;\nconst lineThickness = 2;\n\nconst dropIndicatorStyles = css({\n\tposition: 'absolute',\n\tleft: 0,\n\twidth: '100%',\n\theight: lineThickness,\n\tbackground: token('color.border.selected'),\n\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t'::before': {\n\t\tcontent: '\"\"',\n\t\twidth: terminalRadius * 2,\n\t\theight: terminalRadius * 2,\n\t\tbackground: token('color.border.selected'),\n\t\tposition: 'absolute',\n\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766\n\t\tleft: -terminalRadius * 2,\n\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766\n\t\ttop: -terminalRadius + lineThickness / 2,\n\t\tborderRadius: token('radius.full'),\n\t},\n});\n\nconst dropIndicatorEdgeStyles = {\n\ttop: css({\n\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\t\ttop: -(gapSize / 2 + lineThickness),\n\t}),\n\tbottom: css({\n\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\t\tbottom: -(gapSize / 2 + lineThickness),\n\t}),\n\tleft: {},\n\tright: {},\n};\n\nexport function DropIndicator({ edge }: { edge: Edge }): React.JSX.Element {\n\treturn <div css={[dropIndicatorStyles, dropIndicatorEdgeStyles[edge]]} />;\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/pinned-fields/primitives/asana/field.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { forwardRef, type ReactNode } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport { token } from '@atlaskit/tokens';\n\nimport { gapSize } from './constants';\n\n/**\n * Used to create the visual gaps between items, without having real gaps.\n *\n * This is to avoid using stickiness, which would have different behavior\n * when the pointer leaves the list.\n */\nconst fieldContainerStyles = css({\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766\n\tpadding: `${gapSize / 2}px 0px`,\n\twidth: 'max-content',\n});\n\nconst fieldStyles = css({\n\tboxSizing: 'border-box',\n\twidth: 304,\n\tbackground: token('elevation.surface'),\n\tborder: `${token('border.width')} solid ${token('color.border')}`,\n\tborderRadius: token('radius.large'),\n\tdisplay: 'flex',\n\talignItems: 'center',\n\tpadding: token('space.100'),\n\tgap: token('space.100'),\n\n\tlineHeight: '24px',\n\n\tposition: 'relative',\n\tcursor: 'grab',\n\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':hover': {\n\t\tborderColor: token('color.border.bold'),\n\t},\n});\n\nexport type FieldProps = {\n\tchildren: ReactNode;\n\ticon: ReactNode;\n};\n\nexport const Field = forwardRef<HTMLDivElement, FieldProps>(function Field(\n\t{ children, icon },\n\tref,\n) {\n\treturn (\n\t\t<div ref={ref} css={fieldContainerStyles}>\n\t\t\t<div css={fieldStyles}>\n\t\t\t\t{icon}\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</div>\n\t);\n});\n\nconst fieldPreviewStyles = css({\n\tborderColor: token('color.border.selected'),\n\twidth: 'max-content',\n\n\t/**\n\t * The Asana previews have a bit more vertical padding\n\t */\n\tpadding: 12,\n\t/**\n\t * Because there is no icon the left padding increases a bit to keep the\n\t * text looking centered\n\t */\n\tpaddingLeft: 16,\n\t/**\n\t * Matches the Asana preview\n\t */\n\tpaddingRight: 48,\n});\n\nexport function FieldPreview({ children }: { children: ReactNode }): React.JSX.Element {\n\treturn <div css={[fieldStyles, fieldPreviewStyles]}>{children}</div>;\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/pinned-fields/primitives/droppable-area-overlay.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport React from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport { token } from '@atlaskit/tokens';\n\nconst droppableAreaOverlayStyles = css({\n\tborder: `${token('border.width.selected')} dashed transparent`,\n\tborderRadius: token('radius.small', '3px'),\n\ttransition: 'background-color 300ms ease, border 300ms ease',\n\tposition: 'absolute',\n\ttop: 0,\n\tleft: 0,\n\twidth: '100%',\n\theight: '100%',\n\tpointerEvents: 'none',\n\tboxSizing: 'border-box',\n});\n\nconst droppableAreaOverlayDraggingFromStyles = {\n\tdefault: css({\n\t\tbackground: token('color.background.selected'),\n\t\tborderColor: token('color.border.selected'),\n\t}),\n\tborderless: css({\n\t\tbackground: token('color.background.selected'),\n\t}),\n\tsubtle: css({\n\t\tbackground: 'none',\n\t}),\n};\n\nconst droppableAreaOverlayDraggingOverStyles = {\n\tdefault: css({\n\t\tbackground: token('color.background.selected.hovered'),\n\t}),\n\tborderless: css({\n\t\tbackground: token('color.background.selected.hovered'),\n\t}),\n\tsubtle: css({\n\t\tbackground: token('color.background.accent.blue.subtlest'),\n\t}),\n};\n\ntype DroppableAreaOverlayAppearance = 'default' | 'borderless' | 'subtle';\n\nexport type DroppableAreaOverlayProps = {\n\tisDraggingFrom: boolean;\n\tisDraggingOver: boolean;\n\n\t/**\n\t * Variants\n\t */\n\tappearance?: DroppableAreaOverlayAppearance;\n};\n\n/**\n * Used to draw the blue background and border for pinned fields with\n * `react-beautiful-dnd`\n */\nexport function DroppableAreaOverlay({\n\tisDraggingFrom,\n\tisDraggingOver,\n\tappearance = 'default',\n}: DroppableAreaOverlayProps): React.JSX.Element {\n\treturn (\n\t\t<div\n\t\t\tcss={[\n\t\t\t\tdroppableAreaOverlayStyles,\n\t\t\t\tisDraggingFrom && droppableAreaOverlayDraggingFromStyles[appearance],\n\t\t\t\tisDraggingOver && droppableAreaOverlayDraggingOverStyles[appearance],\n\t\t\t]}\n\t\t/>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/pinned-fields/templates/asana.tsx",
    "content": "import React, { type ReactElement } from 'react';\n\nimport CalendarIcon from '@atlaskit/icon/core/calendar';\nimport CheckCircleOutlineIcon from '@atlaskit/icon/core/check-circle';\nimport RecentIcon from '@atlaskit/icon/core/clock';\nimport EditIcon from '@atlaskit/icon/core/edit';\nimport PersonIcon from '@atlaskit/icon/core/person';\nimport LabelIcon from '@atlaskit/icon/core/tag';\nimport IssuesIcon from '@atlaskit/icon/core/work-items';\n\nimport { useTopLevelWiring } from '../../hooks/use-top-level-wiring';\n\nexport type DataItem = {\n\tid: string;\n\tlabel: string;\n\ticon: ReactElement;\n};\n\nconst initialData: DataItem[] = [\n\t{\n\t\ticon: <PersonIcon color=\"currentColor\" spacing=\"spacious\" label=\"\" />,\n\t\tlabel: 'Created by',\n\t\tid: 'created-by',\n\t},\n\t{\n\t\ticon: <CalendarIcon color=\"currentColor\" spacing=\"spacious\" label=\"\" />,\n\t\tlabel: 'Due date',\n\t\tid: 'due',\n\t},\n\t{\n\t\ticon: <RecentIcon color=\"currentColor\" spacing=\"spacious\" label=\"\" />,\n\t\tlabel: 'Created on',\n\t\tid: 'created-on',\n\t},\n\t{\n\t\ticon: <EditIcon color=\"currentColor\" spacing=\"spacious\" label=\"\" />,\n\t\tlabel: 'Last modified on',\n\t\tid: 'last-modified-on',\n\t},\n\t{\n\t\ticon: <CheckCircleOutlineIcon color=\"currentColor\" spacing=\"spacious\" label=\"\" />,\n\t\tlabel: 'Completed on',\n\t\tid: 'completed-on',\n\t},\n\t{\n\t\ticon: <IssuesIcon color=\"currentColor\" spacing=\"spacious\" label=\"\" />,\n\t\tlabel: 'Projects',\n\t\tid: 'projects',\n\t},\n\t{\n\t\ticon: <LabelIcon color=\"currentColor\" spacing=\"spacious\" label=\"\" />,\n\t\tlabel: 'Tags',\n\t\tid: 'tags',\n\t},\n];\n\nexport type DraggableFieldProps = { index: number; item: DataItem };\n\ntype AsanaFieldsTemplateProps = {\n\tDraggableField: (props: DraggableFieldProps) => ReactElement;\n\tinstanceId: string;\n};\n\nexport default function AsanaFieldsTemplate({\n\tDraggableField,\n\tinstanceId,\n}: AsanaFieldsTemplateProps): React.JSX.Element {\n\tconst { data } = useTopLevelWiring({ initialData, type: instanceId });\n\treturn (\n\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t<div style={{ display: 'flex', flexDirection: 'column' }}>\n\t\t\t{data.map((item, index) => (\n\t\t\t\t<DraggableField key={item.id} index={index} item={item} />\n\t\t\t))}\n\t\t</div>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/pinned-fields/templates/atlassian.tsx",
    "content": "import React, { type ReactElement } from 'react';\n\nimport { type ReorderItem, useTopLevelWiring } from '../../hooks/use-top-level-wiring';\nimport { type DataItem, initialData } from '../data';\nimport { PinnedFieldsContainer, PinnedFieldsList } from '../index';\n\nexport type DraggableFieldProps = {\n\tindex: number;\n\titem: DataItem;\n\tdata: DataItem[];\n\treorderItem: ReorderItem;\n};\n\ntype PinnedFieldsAtlassianTemplateProps = {\n\tinstanceId: string;\n\tDraggableField: (props: DraggableFieldProps) => ReactElement;\n};\n\nexport default function PinnedFieldsAtlassianTemplate({\n\tinstanceId,\n\tDraggableField,\n}: PinnedFieldsAtlassianTemplateProps): React.JSX.Element {\n\tconst { data, reorderItem } = useTopLevelWiring({\n\t\tinitialData,\n\t\ttype: instanceId,\n\t});\n\n\treturn (\n\t\t<PinnedFieldsContainer>\n\t\t\t<PinnedFieldsList>\n\t\t\t\t{data.map((item, index) => (\n\t\t\t\t\t<DraggableField\n\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\titem={item}\n\t\t\t\t\t\tdata={data}\n\t\t\t\t\t\treorderItem={reorderItem}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t</PinnedFieldsList>\n\t\t</PinnedFieldsContainer>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/pinned-fields/templates/react-beautiful-dnd.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport { type ReactElement, useCallback, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { jsx } from '@emotion/react';\nimport type {\n\tDragDropContextProps,\n\tDraggableProps,\n\tDroppableProps,\n\tOnDragEndResponder,\n} from 'react-beautiful-dnd';\n\nimport { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';\n\nimport { initialData } from '../data';\nimport { Field, type FieldProps, PinnedFieldsContainer, PinnedFieldsList } from '../index';\nimport { type DroppableAreaOverlayProps } from '../primitives/droppable-area-overlay';\n\nfunction DraggableField({\n\tindex,\n\tcomponent,\n\tidPrefix,\n\t...fieldProps\n}: FieldProps & {\n\tindex: number;\n\tcomponent: TemplateProps['Draggable'];\n\tidPrefix: string;\n}) {\n\tconst Draggable = component;\n\tconst draggableId = `${idPrefix}--${fieldProps.label}`;\n\treturn (\n\t\t<Draggable draggableId={draggableId} index={index}>\n\t\t\t{(provided, snapshot) => (\n\t\t\t\t<Field\n\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\tisDragging={snapshot.isDragging}\n\t\t\t\t\t{...fieldProps}\n\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</Draggable>\n\t);\n}\n\ntype TemplateProps = {\n\tDragDropContext: React.ComponentType<DragDropContextProps>;\n\tDraggable: React.ComponentType<DraggableProps>;\n\tDroppable: React.ComponentType<DroppableProps>;\n\n\tDroppableAreaOverlay: (props: DroppableAreaOverlayProps) => ReactElement;\n\n\tidPrefix: string;\n};\n\nexport default function PinnedFieldsReactBeautifulDndTemplate({\n\tDragDropContext,\n\tDraggable,\n\tDroppable,\n\tDroppableAreaOverlay,\n\tidPrefix,\n}: TemplateProps): React.JSX.Element {\n\tconst [data, setData] = useState(initialData);\n\n\tconst onDragEnd: OnDragEndResponder = useCallback(({ source, destination }) => {\n\t\tif (!destination) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst startIndex = source.index;\n\t\tconst finishIndex = destination.index;\n\n\t\tsetData((data) =>\n\t\t\treorder({\n\t\t\t\tlist: data,\n\t\t\t\tstartIndex,\n\t\t\t\tfinishIndex,\n\t\t\t}),\n\t\t);\n\t}, []);\n\n\tconst droppableId = `${idPrefix}--droppable`;\n\n\treturn (\n\t\t<DragDropContext onDragEnd={onDragEnd}>\n\t\t\t<PinnedFieldsContainer>\n\t\t\t\t<Droppable droppableId={droppableId}>\n\t\t\t\t\t{(provided, snapshot) => (\n\t\t\t\t\t\t<PinnedFieldsList ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t\t\t<DroppableAreaOverlay\n\t\t\t\t\t\t\t\tisDraggingFrom={Boolean(snapshot.draggingFromThisWith)}\n\t\t\t\t\t\t\t\tisDraggingOver={snapshot.isDraggingOver}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{data.map((item, index) => (\n\t\t\t\t\t\t\t\t<DraggableField\n\t\t\t\t\t\t\t\t\tcomponent={Draggable}\n\t\t\t\t\t\t\t\t\tkey={item.label}\n\t\t\t\t\t\t\t\t\tlabel={item.label}\n\t\t\t\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\t\t\t\tidPrefix={idPrefix}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{item.content}\n\t\t\t\t\t\t\t\t</DraggableField>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t{provided.placeholder}\n\t\t\t\t\t\t</PinnedFieldsList>\n\t\t\t\t\t)}\n\t\t\t\t</Droppable>\n\t\t\t</PinnedFieldsContainer>\n\t\t</DragDropContext>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/pinned-fields/use-drag-observer.tsx",
    "content": "import { useState } from 'react';\n\nimport invariant from 'tiny-invariant';\n\nimport type { DragLocationHistory } from '@atlaskit/pragmatic-drag-and-drop/types';\n\ntype DragObserverState =\n\t| {\n\t\t\tisDragging: false;\n\t  }\n\t| {\n\t\t\tisDragging: true;\n\t\t\tlocation: DragLocationHistory;\n\t  };\n\ntype DragObserver = {\n\tgetState(): DragObserverState;\n\tstartDrag(args: { location: DragLocationHistory }): void;\n\tupdateDrag(args: { location: DragLocationHistory }): void;\n\tstopDrag(args: { location: DragLocationHistory }): void;\n};\n\nfunction createDragObserver() {\n\tlet state: DragObserverState = {\n\t\tisDragging: false,\n\t};\n\n\tconst getState = () => {\n\t\treturn state;\n\t};\n\n\tconst startDrag = ({ location }: { location: DragLocationHistory }) => {\n\t\tstate = {\n\t\t\tisDragging: true,\n\t\t\tlocation,\n\t\t};\n\t};\n\n\tconst updateDrag = ({ location }: { location: DragLocationHistory }) => {\n\t\tinvariant(state.isDragging);\n\t\tstate.location = location;\n\t};\n\n\tconst stopDrag = () => {\n\t\tstate = { isDragging: false };\n\t};\n\n\treturn { getState, startDrag, updateDrag, stopDrag };\n}\n\nexport function useDragObserver(): DragObserver {\n\tconst [dragObserver] = useState(createDragObserver);\n\treturn dragObserver;\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/post-drop-flash/list.tsx",
    "content": "import React, {\n\tcreateContext,\n\tFragment,\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from 'react';\n\nimport ReactDOM from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport Avatar from '@atlaskit/avatar';\nimport Badge from '@atlaskit/badge';\nimport DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';\n// eslint-disable-next-line @atlaskit/design-system/no-banned-imports\nimport mergeRefs from '@atlaskit/ds-lib/merge-refs';\nimport Lozenge from '@atlaskit/lozenge';\nimport {\n\tattachClosestEdge,\n\ttype Edge,\n\textractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { getReorderDestinationIndex } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index';\nimport * as liveRegion from '@atlaskit/pragmatic-drag-and-drop-live-region';\nimport { DragHandleButton } from '@atlaskit/pragmatic-drag-and-drop-react-accessibility/drag-handle-button';\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\tmonitorForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\nimport { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Grid, Inline, Stack, xcss } from '@atlaskit/primitives';\nimport { token } from '@atlaskit/tokens';\n\ntype ItemPosition = 'first' | 'last' | 'middle' | 'only';\n\ntype CleanupFn = () => void;\n\ntype ListContextProps = {\n\tgetItemIndex: ({ id }: { id: string }) => number;\n\tgetItemPosition: (itemData: ItemData) => ItemPosition;\n\tregisterItem: (args: { id: string; element: HTMLElement }) => CleanupFn;\n\treorderItem: (args: {\n\t\tstartIndex: number;\n\t\tindexOfTarget: number;\n\t\tclosestEdgeOfTarget: Edge | null;\n\t}) => void;\n\tinstanceId: symbol;\n};\n\nconst ListContext = createContext<ListContextProps | null>(null);\n\nfunction useListContext() {\n\tconst listContext = useContext(ListContext);\n\tinvariant(listContext !== null);\n\treturn listContext;\n}\n\ntype ItemData = {\n\tid: string;\n\tlabel: string;\n};\n\nconst listItemContainerStyles = xcss({\n\tposition: 'relative',\n\tbackgroundColor: 'elevation.surface',\n\tborderWidth: '0',\n\tborderBottomWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':last-of-type': {\n\t\tborderWidth: '0',\n\t},\n});\n\nconst listItemStyles = xcss({\n\tposition: 'relative',\n\tpadding: 'space.100',\n});\n\nconst listItemDisabledStyles = xcss({ opacity: 0.4 });\n\ntype DraggableState =\n\t| { type: 'idle' }\n\t| { type: 'preview'; container: HTMLElement }\n\t| { type: 'dragging' };\n\nconst idleState: DraggableState = { type: 'idle' };\nconst draggingState: DraggableState = { type: 'dragging' };\n\nconst listItemPreviewStyles = xcss({\n\tpaddingBlock: 'space.050',\n\tpaddingInline: 'space.100',\n\tborderRadius: 'radius.small',\n\tbackgroundColor: 'elevation.surface.overlay',\n\tmaxWidth: '360px',\n\twhiteSpace: 'nowrap',\n\toverflow: 'hidden',\n\ttextOverflow: 'ellipsis',\n});\n\nconst itemLabelStyles = xcss({\n\tflexGrow: 1,\n\twhiteSpace: 'nowrap',\n\ttextOverflow: 'ellipsis',\n\toverflow: 'hidden',\n});\n\nfunction ListItem({ itemData }: { itemData: ItemData }) {\n\tconst { getItemIndex, registerItem, instanceId } = useListContext();\n\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst [closestEdge, setClosestEdge] = useState<Edge | null>(null);\n\n\tconst dragHandleRef = useRef<HTMLButtonElement>(null);\n\n\tconst [draggableState, setDraggableState] = useState<DraggableState>(idleState);\n\n\tuseEffect(() => {\n\t\tinvariant(ref.current);\n\t\tinvariant(dragHandleRef.current);\n\n\t\tconst element = ref.current;\n\n\t\tconst dragData = { id: itemData.id, instanceId };\n\n\t\treturn combine(\n\t\t\tregisterItem({ id: itemData.id, element }),\n\t\t\tdraggable({\n\t\t\t\telement,\n\t\t\t\tdragHandle: dragHandleRef.current,\n\t\t\t\tgetInitialData() {\n\t\t\t\t\treturn { ...dragData, index: getItemIndex(itemData) };\n\t\t\t\t},\n\t\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\t\tgetOffset: pointerOutsideOfPreview({\n\t\t\t\t\t\t\tx: token('space.200', '16px'),\n\t\t\t\t\t\t\ty: token('space.100', '8px'),\n\t\t\t\t\t\t}),\n\t\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\t\tsetDraggableState({ type: 'preview', container });\n\n\t\t\t\t\t\t\treturn () => setDraggableState(draggingState);\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragStart() {\n\t\t\t\t\tsetDraggableState(draggingState);\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tsetDraggableState(idleState);\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement,\n\t\t\t\tcanDrop({ source }) {\n\t\t\t\t\treturn source.data.instanceId === instanceId;\n\t\t\t\t},\n\t\t\t\tgetData({ input }) {\n\t\t\t\t\treturn attachClosestEdge(dragData, {\n\t\t\t\t\t\telement,\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tallowedEdges: ['top', 'bottom'],\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDrag({ self, source }) {\n\t\t\t\t\tconst isSource = source.element === element;\n\t\t\t\t\tif (isSource) {\n\t\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst closestEdge = extractClosestEdge(self.data);\n\n\t\t\t\t\tconst sourceIndex = source.data.index;\n\t\t\t\t\tinvariant(typeof sourceIndex === 'number');\n\n\t\t\t\t\tconst selfIndex = getItemIndex({ id: itemData.id });\n\n\t\t\t\t\tconst isItemBeforeSource = selfIndex === sourceIndex - 1;\n\t\t\t\t\tconst isItemAfterSource = selfIndex === sourceIndex + 1;\n\n\t\t\t\t\tconst isDropIndicatorHidden =\n\t\t\t\t\t\t(isItemBeforeSource && closestEdge === 'bottom') ||\n\t\t\t\t\t\t(isItemAfterSource && closestEdge === 'top');\n\n\t\t\t\t\tif (isDropIndicatorHidden) {\n\t\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tsetClosestEdge(closestEdge);\n\t\t\t\t},\n\t\t\t\tonDragLeave() {\n\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [getItemIndex, instanceId, itemData, registerItem]);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<Box ref={ref} xcss={listItemContainerStyles}>\n\t\t\t\t<Grid\n\t\t\t\t\talignItems=\"center\"\n\t\t\t\t\tcolumnGap=\"space.100\"\n\t\t\t\t\ttemplateColumns=\"auto 1fr auto\"\n\t\t\t\t\txcss={[\n\t\t\t\t\t\tlistItemStyles,\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * We are applying the disabled effect to the inner element so that\n\t\t\t\t\t\t * the border and drop indicator are not affected.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tdraggableState.type === 'dragging' && listItemDisabledStyles,\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\ttrigger={({ triggerRef, ...triggerProps }) => (\n\t\t\t\t\t\t\t<DragHandleButton\n\t\t\t\t\t\t\t\tref={mergeRefs([dragHandleRef, triggerRef])}\n\t\t\t\t\t\t\t\t{...triggerProps}\n\t\t\t\t\t\t\t\tlabel={`Reorder ${itemData.label}`}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\tshouldRenderToParent\n\t\t\t\t\t>\n\t\t\t\t\t\t<LazyDropdownContent itemData={itemData} />\n\t\t\t\t\t</DropdownMenu>\n\t\t\t\t\t<Box xcss={itemLabelStyles}>{itemData.label}</Box>\n\t\t\t\t\t<Inline alignBlock=\"center\" space=\"space.100\">\n\t\t\t\t\t\t<Badge>{1}</Badge>\n\t\t\t\t\t\t<Avatar size=\"small\" />\n\t\t\t\t\t\t<Lozenge>Todo</Lozenge>\n\t\t\t\t\t</Inline>\n\t\t\t\t</Grid>\n\t\t\t\t{closestEdge && <DropIndicator edge={closestEdge} gap=\"1px\" />}\n\t\t\t</Box>\n\t\t\t{draggableState.type === 'preview' &&\n\t\t\t\tReactDOM.createPortal(\n\t\t\t\t\t<Box xcss={listItemPreviewStyles}>{itemData.label}</Box>,\n\t\t\t\t\tdraggableState.container,\n\t\t\t\t)}\n\t\t</Fragment>\n\t);\n}\n\nfunction LazyDropdownContent({ itemData }: { itemData: ItemData }) {\n\tconst { getItemIndex, getItemPosition, reorderItem } = useListContext();\n\n\tconst position = getItemPosition(itemData);\n\n\tconst isMoveUpDisabled = position === 'first' || position === 'only';\n\tconst isMoveDownDisabled = position === 'last' || position === 'only';\n\n\tconst moveUp = useCallback(() => {\n\t\tconst startIndex = getItemIndex(itemData);\n\t\treorderItem({\n\t\t\tstartIndex,\n\t\t\tindexOfTarget: startIndex - 1,\n\t\t\tclosestEdgeOfTarget: null,\n\t\t});\n\t}, [getItemIndex, itemData, reorderItem]);\n\n\tconst moveDown = useCallback(() => {\n\t\tconst startIndex = getItemIndex(itemData);\n\t\treorderItem({\n\t\t\tstartIndex,\n\t\t\tindexOfTarget: startIndex + 1,\n\t\t\tclosestEdgeOfTarget: null,\n\t\t});\n\t}, [getItemIndex, itemData, reorderItem]);\n\n\treturn (\n\t\t<DropdownItemGroup>\n\t\t\t<DropdownItem onClick={moveUp} isDisabled={isMoveUpDisabled}>\n\t\t\t\tMove up\n\t\t\t</DropdownItem>\n\t\t\t<DropdownItem onClick={moveDown} isDisabled={isMoveDownDisabled}>\n\t\t\t\tMove down\n\t\t\t</DropdownItem>\n\t\t</DropdownItemGroup>\n\t);\n}\n\nconst defaultItems: ItemData[] = [\n\t{\n\t\tid: 'task-1',\n\t\tlabel: 'Organize a team-building event',\n\t},\n\t{\n\t\tid: 'task-2',\n\t\tlabel: 'Create and maintain office inventory',\n\t},\n\t{\n\t\tid: 'task-3',\n\t\tlabel: 'Update company website content',\n\t},\n\t{\n\t\tid: 'task-4',\n\t\tlabel: 'Plan and execute marketing campaigns',\n\t},\n\t{\n\t\tid: 'task-5',\n\t\tlabel: 'Coordinate employee training sessions',\n\t},\n\t{\n\t\tid: 'task-6',\n\t\tlabel: 'Manage facility maintenance',\n\t},\n\t{\n\t\tid: 'task-7',\n\t\tlabel: 'Organize customer feedback surveys',\n\t},\n\t{\n\t\tid: 'task-8',\n\t\tlabel: 'Coordinate travel arrangements',\n\t},\n];\n\nconst containerStyles = xcss({\n\tmaxWidth: '400px',\n\tborderWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border',\n});\n\ntype ListState = {\n\titems: ItemData[];\n\tlastCardMoved: {\n\t\titem: ItemData;\n\t\tpreviousIndex: number;\n\t\tcurrentIndex: number;\n\t\tnumberOfItems: number;\n\t} | null;\n};\n\nexport default function ListExample({\n\ttriggerPostMoveFlash,\n}: {\n\ttriggerPostMoveFlash: (element: HTMLElement) => void;\n}): React.JSX.Element {\n\tconst [{ items, lastCardMoved }, setListState] = useState<ListState>({\n\t\titems: defaultItems,\n\t\tlastCardMoved: {\n\t\t\titem: defaultItems[0],\n\t\t\tpreviousIndex: 0,\n\t\t\tcurrentIndex: 0,\n\t\t\tnumberOfItems: defaultItems.length,\n\t\t},\n\t});\n\n\tconst registryRef = useRef(new Map<string, HTMLElement>());\n\tconst registerItem = useCallback(({ id, element }: { id: string; element: HTMLElement }) => {\n\t\tconst registry = registryRef.current;\n\t\tif (!registry) {\n\t\t\treturn () => {};\n\t\t}\n\t\tregistry.set(id, element);\n\n\t\treturn function unregisterItem() {\n\t\t\tregistry.delete(id);\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tliveRegion.cleanup();\n\t\t};\n\t}, []);\n\n\t/**\n\t * Creating a stable reference for the items, so that we can avoid\n\t * rerenders.\n\t */\n\tconst stableItemsRef = useRef<ItemData[]>(items);\n\tuseEffect(() => {\n\t\tstableItemsRef.current = items;\n\t}, [items]);\n\n\tuseEffect(() => {\n\t\tif (lastCardMoved === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { item, previousIndex, currentIndex, numberOfItems } = lastCardMoved;\n\t\tconst element = registryRef.current.get(item.id);\n\t\tif (element) {\n\t\t\ttriggerPostMoveFlash(element);\n\t\t}\n\n\t\tliveRegion.announce(\n\t\t\t`You've moved ${item.label} from position ${\n\t\t\t\tpreviousIndex + 1\n\t\t\t} to position ${currentIndex + 1} of ${numberOfItems}.`,\n\t\t);\n\t}, [lastCardMoved, triggerPostMoveFlash]);\n\n\tconst reorderItem = useCallback(\n\t\t({\n\t\t\tstartIndex,\n\t\t\tindexOfTarget,\n\t\t\tclosestEdgeOfTarget,\n\t\t}: {\n\t\t\tstartIndex: number;\n\t\t\tindexOfTarget: number;\n\t\t\tclosestEdgeOfTarget: Edge | null;\n\t\t}) => {\n\t\t\tconst finishIndex = getReorderDestinationIndex({\n\t\t\t\tstartIndex,\n\t\t\t\tclosestEdgeOfTarget,\n\t\t\t\tindexOfTarget,\n\t\t\t\taxis: 'vertical',\n\t\t\t});\n\n\t\t\tif (finishIndex === startIndex) {\n\t\t\t\t// If there would be no change, we skip the update\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetListState((listState) => {\n\t\t\t\tconst item = listState.items[startIndex];\n\n\t\t\t\treturn {\n\t\t\t\t\titems: reorder({\n\t\t\t\t\t\tlist: listState.items,\n\t\t\t\t\t\tstartIndex,\n\t\t\t\t\t\tfinishIndex,\n\t\t\t\t\t}),\n\t\t\t\t\tlastCardMoved: {\n\t\t\t\t\t\titem,\n\t\t\t\t\t\tpreviousIndex: startIndex,\n\t\t\t\t\t\tcurrentIndex: finishIndex,\n\t\t\t\t\t\tnumberOfItems: listState.items.length,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t});\n\t\t},\n\t\t[],\n\t);\n\n\tconst [instanceId] = useState(() => Symbol('instance-id'));\n\n\tuseEffect(() => {\n\t\treturn monitorForElements({\n\t\t\tcanMonitor({ source }) {\n\t\t\t\treturn source.data.instanceId === instanceId;\n\t\t\t},\n\t\t\tonDrop({ location, source }) {\n\t\t\t\tconst target = location.current.dropTargets[0];\n\t\t\t\tif (!target) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst items = stableItemsRef.current;\n\n\t\t\t\tconst startIndex = items.findIndex((item) => item.id === source.data.id);\n\t\t\t\tif (startIndex < 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst indexOfTarget = items.findIndex((item) => item.id === target.data.id);\n\t\t\t\tif (indexOfTarget < 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst closestEdgeOfTarget = extractClosestEdge(target.data);\n\n\t\t\t\treorderItem({ startIndex, indexOfTarget, closestEdgeOfTarget });\n\t\t\t},\n\t\t});\n\t}, [instanceId, reorderItem]);\n\n\tconst getItemPosition = useCallback((itemData: ItemData) => {\n\t\tconst items = stableItemsRef.current;\n\n\t\tif (items.length === 1) {\n\t\t\treturn 'only';\n\t\t}\n\n\t\tconst index = items.indexOf(itemData);\n\t\tif (index === 0) {\n\t\t\treturn 'first';\n\t\t}\n\n\t\tif (index === items.length - 1) {\n\t\t\treturn 'last';\n\t\t}\n\n\t\treturn 'middle';\n\t}, []);\n\n\tconst getItemIndex = useCallback(({ id }: { id: string }) => {\n\t\treturn stableItemsRef.current.findIndex((item) => item.id === id);\n\t}, []);\n\n\tconst contextValue = useMemo(() => {\n\t\treturn {\n\t\t\tgetItemIndex,\n\t\t\tgetItemPosition,\n\t\t\tregisterItem,\n\t\t\treorderItem,\n\t\t\tinstanceId,\n\t\t};\n\t}, [getItemIndex, getItemPosition, registerItem, reorderItem, instanceId]);\n\n\treturn (\n\t\t<ListContext.Provider value={contextValue}>\n\t\t\t<Stack xcss={containerStyles}>\n\t\t\t\t{items.map((itemData) => (\n\t\t\t\t\t<ListItem key={itemData.id} itemData={itemData} />\n\t\t\t\t))}\n\t\t\t</Stack>\n\t\t</ListContext.Provider>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/rdr-board/board-context.tsx",
    "content": "import { createContext, useContext } from 'react';\n\nimport invariant from 'tiny-invariant';\n\nimport type { ColumnType } from './data';\n\nexport type BoardContextProps = {\n\tgetColumns: () => ColumnType[];\n\n\treorderColumn: (args: { startIndex: number; finishIndex: number }) => void;\n\n\treorderCard: (args: { columnId: string; startIndex: number; finishIndex: number }) => void;\n\n\tmoveCard: (args: {\n\t\tstartColumnId: string;\n\t\tfinishColumnId: string;\n\t\titemIndexInStartColumn: number;\n\t\titemIndexInFinishColumn?: number;\n\t}) => void;\n\n\tregisterCard: (args: {\n\t\tcardId: string;\n\t\tactionMenuTrigger: HTMLElement;\n\t\tisSelected: boolean;\n\t}) => void;\n\n\tgetSelectedCards: () => string[];\n};\n\nexport const BoardContext = createContext<BoardContextProps | null>(null);\n\nexport function useBoardContext(): BoardContextProps {\n\tconst value = useContext(BoardContext);\n\tinvariant(value, 'cannot find BoardContext provider');\n\treturn value;\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/rdr-board/board.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport { forwardRef, memo, type ReactNode } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport { token } from '@atlaskit/tokens';\n\ntype BoardProps = {\n\tchildren: ReactNode;\n};\n\nconst boardStyles = css({\n\tdisplay: 'flex',\n\tjustifyContent: 'center',\n\tgap: 8,\n\tflexDirection: 'row',\n\t'--grid': token('space.100'),\n\theight: 480,\n});\n\nconst Board = forwardRef<HTMLDivElement, BoardProps>(({ children }: BoardProps, ref) => {\n\treturn (\n\t\t<div css={boardStyles} ref={ref}>\n\t\t\t{children}\n\t\t</div>\n\t);\n});\n\nexport default memo(Board);\n"
  },
  {
    "path": "packages/documentation/examples/pieces/rdr-board/card-stack.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport React, { type ReactNode } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport Badge from '@atlaskit/badge';\nimport { token } from '@atlaskit/tokens';\n\nconst sharedCardStyles = css({\n\tbackground: token('elevation.surface.raised', '#FFF'),\n\tborderRadius: 3,\n});\n\nconst secondCardStyles = css({\n\tposition: 'absolute',\n\twidth: 'calc(100% - 16px)',\n\theight: '100%',\n\tbottom: -5,\n\n\tleft: 8,\n\n\t// boxShadow: `${token('elevation.shadow.overlay')}, ${token(\n\t//   'elevation.shadow.raised',\n\t// )}`,\n\n\tboxShadow: token('elevation.shadow.raised', '0px 1px 1px #091e423f, 0px 0px 1px #091e4221'),\n});\n\nconst secondCardInnerStyles = css({\n\twidth: '100%',\n\theight: '100%',\n\tbackground: 'rgba(0, 0, 0, 0.1)',\n});\n\nconst bottomCardStyles = css({\n\tposition: 'absolute',\n\twidth: 'calc(100% - 32px)',\n\theight: '100%',\n\tbottom: -9,\n\tbackground: 'rgba(0, 0, 0, 0.2)',\n\tleft: 16,\n\tfilter: 'blur(1.5px)',\n});\n\nconst containerStyles = css({\n\t// width: 368,\n\t// height: 112,\n\tposition: 'relative',\n});\n\nexport function CardStack({\n\tchildren,\n\tnumCards,\n}: {\n\tchildren: ReactNode;\n\tnumCards: number;\n}): React.JSX.Element {\n\treturn (\n\t\t<div css={containerStyles}>\n\t\t\t{numCards >= 3 && <div css={[sharedCardStyles, bottomCardStyles]} />}\n\t\t\t{numCards >= 2 && (\n\t\t\t\t<div css={[sharedCardStyles, secondCardStyles]}>\n\t\t\t\t\t<div css={secondCardInnerStyles} />\n\t\t\t\t</div>\n\t\t\t)}\n\t\t\t{children}\n\t\t\t{numCards >= 2 && (\n\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t<div style={{ position: 'absolute', top: -8, right: -8 }}>\n\t\t\t\t\t<Badge appearance=\"primary\">{numCards}</Badge>\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/rdr-board/card.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport {\n\tforwardRef,\n\tFragment,\n\tmemo,\n\ttype Ref,\n\tuseCallback,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport ReactDOM from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport Avatar from '@atlaskit/avatar';\nimport Badge from '@atlaskit/badge';\nimport Button from '@atlaskit/button';\nimport DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';\n// eslint-disable-next-line @atlaskit/design-system/no-banned-imports\nimport mergeRefs from '@atlaskit/ds-lib/merge-refs';\nimport { IconTile } from '@atlaskit/icon';\nimport PullRequestIcon from '@atlaskit/icon/core/pull-request';\nimport MoreIcon from '@atlaskit/icon/core/show-more-horizontal';\nimport StoryIcon from '@atlaskit/icon/core/story';\nimport {\n\tattachClosestEdge,\n\ttype Edge,\n\textractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\nimport { dropTargetForExternal } from '@atlaskit/pragmatic-drag-and-drop/external/adapter';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Inline, Stack, xcss } from '@atlaskit/primitives';\nimport { token } from '@atlaskit/tokens';\n\nimport { useBoardContext } from './board-context';\nimport { CardStack } from './card-stack';\nimport { useColumnContext } from './column-context';\nimport { type CardData, type ColumnType } from './data';\nimport { EpicLozenge } from './epic-lozenge';\n\ntype DraggableState =\n\t| { type: 'idle' }\n\t| {\n\t\t\ttype: 'preview';\n\t\t\tcontainer: HTMLElement;\n\t\t\trect: DOMRect;\n\t\t\tnumSelected: number;\n\t  }\n\t| { type: 'dragging' };\n\nconst idleState: DraggableState = { type: 'idle' };\nconst draggingState: DraggableState = { type: 'dragging' };\n\nconst noPointerEventsStyles = css({ pointerEvents: 'none' });\nconst containerStyles = xcss({\n\twidth: '100%',\n\tboxShadow: 'elevation.shadow.raised',\n\tposition: 'relative',\n\n\tbackgroundColor: 'elevation.surface.raised',\n\tborderRadius: token('radius.small'),\n\tpaddingInline: 'space.200',\n\tpaddingBlock: 'space.150',\n\tcursor: 'grab',\n\n\tborderWidth: 'border.width',\n\tborderStyle: 'solid',\n\t// @ts-expect-error\n\tborderColor: 'transparent',\n\n\t'--action-opacity': 0,\n\t':hover': {\n\t\t// @ts-expect-error\n\t\t'--action-opacity': 1,\n\t\tbackgroundColor: 'elevation.surface.raised.hovered',\n\t},\n});\n\nconst selectedStyles = xcss({\n\tbackgroundColor: 'color.background.selected',\n\tborderColor: 'color.border.selected',\n\t':hover': {\n\t\tbackgroundColor: 'color.background.selected.hovered',\n\t},\n});\n\nconst actionStyles = xcss({\n\topacity: 'var(--action-opacity)',\n\t':focus-within': {\n\t\topacity: 1,\n\t},\n});\n\nconst draggingStyles = xcss({\n\topacity: 0.6,\n});\n\ntype CardPrimitiveProps = {\n\tclosestEdge: Edge | null;\n\titem: CardData;\n\tstate: DraggableState;\n\tactionMenuTriggerRef?: Ref<HTMLButtonElement>;\n\tisSelected?: boolean;\n\tonClick?: React.MouseEventHandler;\n};\n\nfunction MoveToOtherColumnItem({\n\ttargetColumn,\n\tstartIndex,\n}: {\n\ttargetColumn: ColumnType;\n\tstartIndex: number;\n}) {\n\tconst { moveCard } = useBoardContext();\n\tconst { columnId } = useColumnContext();\n\n\tconst onClick = useCallback(() => {\n\t\tmoveCard({\n\t\t\tstartColumnId: columnId,\n\t\t\tfinishColumnId: targetColumn.columnId,\n\t\t\titemIndexInStartColumn: startIndex,\n\t\t});\n\t}, [columnId, moveCard, startIndex, targetColumn.columnId]);\n\n\treturn <DropdownItem onClick={onClick}>{targetColumn.title}</DropdownItem>;\n}\n\nfunction LazyDropdownItems({ item }: { item: CardData }) {\n\tconst { getColumns, reorderCard } = useBoardContext();\n\tconst { columnId, getCardIndex, getNumCards } = useColumnContext();\n\n\tconst numCards = getNumCards();\n\tconst startIndex = getCardIndex(item.key);\n\n\tconst moveUp = useCallback(() => {\n\t\treorderCard({ columnId, startIndex, finishIndex: startIndex - 1 });\n\t}, [columnId, reorderCard, startIndex]);\n\n\tconst moveDown = useCallback(() => {\n\t\treorderCard({ columnId, startIndex, finishIndex: startIndex + 1 });\n\t}, [columnId, reorderCard, startIndex]);\n\n\tconst isMoveUpDisabled = startIndex === 0;\n\tconst isMoveDownDisabled = startIndex === numCards - 1;\n\n\tconst moveColumnOptions = getColumns().filter((column) => column.columnId !== columnId);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<DropdownItemGroup title=\"Reorder\">\n\t\t\t\t<DropdownItem onClick={moveUp} isDisabled={isMoveUpDisabled}>\n\t\t\t\t\tIncrease rank\n\t\t\t\t</DropdownItem>\n\t\t\t\t<DropdownItem onClick={moveDown} isDisabled={isMoveDownDisabled}>\n\t\t\t\t\tDecrease rank\n\t\t\t\t</DropdownItem>\n\t\t\t</DropdownItemGroup>\n\t\t\t<DropdownItemGroup title=\"Move to\">\n\t\t\t\t{moveColumnOptions.map((column) => (\n\t\t\t\t\t<MoveToOtherColumnItem\n\t\t\t\t\t\tkey={column.columnId}\n\t\t\t\t\t\ttargetColumn={column}\n\t\t\t\t\t\tstartIndex={startIndex}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t</DropdownItemGroup>\n\t\t</Fragment>\n\t);\n}\n\nconst CardPrimitive = forwardRef<HTMLDivElement, CardPrimitiveProps>(function CardPrimitive(\n\t{ closestEdge, item, state, actionMenuTriggerRef, isSelected = false, onClick },\n\tref,\n) {\n\tconst { summary, epic, key } = item;\n\n\treturn (\n\t\t// eslint-disable-next-line @atlassian/a11y/click-events-have-key-events, @atlassian/a11y/interactive-element-not-keyboard-focusable, @atlassian/a11y/no-static-element-interactions\n\t\t<div onClick={onClick}>\n\t\t\t<Stack\n\t\t\t\tref={ref}\n\t\t\t\ttestId={`item-${key}`}\n\t\t\t\txcss={[\n\t\t\t\t\tcontainerStyles,\n\t\t\t\t\tstate === draggingState && draggingStyles,\n\t\t\t\t\tisSelected && selectedStyles,\n\t\t\t\t]}\n\t\t\t\tspace=\"space.200\"\n\t\t\t>\n\t\t\t\t<Inline spread=\"space-between\" space=\"space.200\">\n\t\t\t\t\t<Stack space=\"space.150\" alignInline=\"start\">\n\t\t\t\t\t\t<Box>{summary}</Box>\n\t\t\t\t\t\t<EpicLozenge epic={epic} />\n\t\t\t\t\t</Stack>\n\t\t\t\t\t<Box xcss={actionStyles} style={{ marginInline: -8, marginBlock: -4 }}>\n\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\ttrigger={({ triggerRef, ...triggerProps }) => (\n\t\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\t\tref={\n\t\t\t\t\t\t\t\t\t\tactionMenuTriggerRef\n\t\t\t\t\t\t\t\t\t\t\t? mergeRefs([triggerRef, actionMenuTriggerRef])\n\t\t\t\t\t\t\t\t\t\t\t: triggerRef\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\ticonBefore={\n\t\t\t\t\t\t\t\t\t\t<MoreIcon spacing=\"spacious\" color=\"currentColor\" label={`Move ${name}`} />\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tappearance=\"subtle\"\n\t\t\t\t\t\t\t\t\t{...triggerProps}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tshouldRenderToParent\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<LazyDropdownItems item={item} />\n\t\t\t\t\t\t</DropdownMenu>\n\t\t\t\t\t</Box>\n\t\t\t\t</Inline>\n\t\t\t\t<Inline spread=\"space-between\" alignBlock=\"center\">\n\t\t\t\t\t<Inline space=\"space.050\" alignBlock=\"center\">\n\t\t\t\t\t\t<IconTile appearance=\"greenBold\" size=\"16\" label=\"\" icon={StoryIcon} />\n\t\t\t\t\t\t<Box>{key}</Box>\n\t\t\t\t\t</Inline>\n\t\t\t\t\t<Inline space=\"space.050\" alignBlock=\"center\">\n\t\t\t\t\t\t<Badge>{1}</Badge>\n\t\t\t\t\t\t<PullRequestIcon color=\"currentColor\" label=\"\" />\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\twidth=\"24\"\n\t\t\t\t\t\t\theight=\"24\"\n\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<path\n\t\t\t\t\t\t\t\td=\"M12.017 11.1819L5.56302 15.0469C5.45029 15.1163 5.32491 15.1626 5.19415 15.1832C5.06339 15.2037 4.92985 15.1981 4.80128 15.1667C4.67271 15.1352 4.55165 15.0786 4.44514 15C4.33864 14.9214 4.24879 14.8224 4.18081 14.7088C4.11284 14.5953 4.06809 14.4693 4.04916 14.3383C4.03023 14.2073 4.0375 14.0739 4.07054 13.9457C4.10358 13.8175 4.16174 13.6972 4.24164 13.5916C4.32155 13.4861 4.42161 13.3975 4.53602 13.3309L11.506 9.15694C11.6618 9.06395 11.84 9.0151 12.0214 9.01563C12.2029 9.01616 12.3808 9.06604 12.536 9.15994L19.442 13.3329C19.669 13.4702 19.8322 13.692 19.8957 13.9496C19.9592 14.2072 19.9178 14.4794 19.7805 14.7064C19.6433 14.9335 19.4215 15.0967 19.1639 15.1602C18.9063 15.2236 18.634 15.1822 18.407 15.0449L12.017 11.1819Z\"\n\t\t\t\t\t\t\t\tfill=\"#EF5C48\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</svg>\n\n\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\twidth=\"24\"\n\t\t\t\t\t\t\theight=\"24\"\n\t\t\t\t\t\t\tviewBox=\"0 0 24 24\"\n\t\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<rect x=\"0.5\" y=\"9.5\" width=\"5\" height=\"5\" rx=\"2.5\" fill=\"#CA3521\" />\n\t\t\t\t\t\t\t<rect x=\"6.5\" y=\"9.5\" width=\"5\" height=\"5\" rx=\"2.5\" fill=\"#CA3521\" />\n\t\t\t\t\t\t\t<rect x=\"12.5\" y=\"9.5\" width=\"5\" height=\"5\" rx=\"2.5\" fill=\"#CA3521\" />\n\t\t\t\t\t\t\t<rect x=\"18.5\" y=\"9.5\" width=\"5\" height=\"5\" rx=\"2.5\" fill=\"#DCDFE4\" />\n\t\t\t\t\t\t</svg>\n\n\t\t\t\t\t\t<span css={noPointerEventsStyles}>\n\t\t\t\t\t\t\t<Avatar size=\"small\" />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</Inline>\n\t\t\t\t</Inline>\n\n\t\t\t\t{closestEdge && <DropIndicator edge={closestEdge} gap={`10px`} />}\n\t\t\t</Stack>\n\t\t</div>\n\t);\n});\n\nexport const Card = memo(function Card({ item }: { item: CardData }) {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tconst { key } = item;\n\tconst [closestEdge, setClosestEdge] = useState<Edge | null>(null);\n\tconst [state, setState] = useState<DraggableState>(idleState);\n\tconst [isSelected, setIsSelected] = useState(false);\n\n\tconst { registerCard, getSelectedCards } = useBoardContext();\n\n\tconst onClick = useCallback(() => {\n\t\tsetIsSelected((isSelected) => !isSelected);\n\t}, []);\n\n\tconst actionMenuTriggerRef = useRef<HTMLButtonElement>(null);\n\tuseEffect(() => {\n\t\tif (!actionMenuTriggerRef.current) {\n\t\t\treturn;\n\t\t}\n\t\treturn registerCard({\n\t\t\tcardId: key,\n\t\t\tactionMenuTrigger: actionMenuTriggerRef.current,\n\t\t\tisSelected,\n\t\t});\n\t}, [registerCard, key, isSelected]);\n\n\tuseEffect(() => {\n\t\tinvariant(ref.current);\n\t\treturn combine(\n\t\t\tdraggable({\n\t\t\t\telement: ref.current,\n\t\t\t\tgetInitialData: () => ({ type: 'card', itemId: key }),\n\t\t\t\tonGenerateDragPreview: ({ location, source, nativeSetDragImage }) => {\n\t\t\t\t\tconst rect = source.element.getBoundingClientRect();\n\n\t\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\t\tgetOffset() {\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * This offset ensures that the preview is positioned relative to\n\t\t\t\t\t\t\t * the cursor based on where you drag from.\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * This creates the effect of it being picked up.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\tx: location.current.input.clientX - rect.x,\n\t\t\t\t\t\t\t\ty: location.current.input.clientY - rect.y,\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t},\n\t\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\t\tsetState({\n\t\t\t\t\t\t\t\ttype: 'preview',\n\t\t\t\t\t\t\t\tcontainer,\n\t\t\t\t\t\t\t\trect,\n\t\t\t\t\t\t\t\tnumSelected: getSelectedCards().length,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn () => setState(draggingState);\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t},\n\n\t\t\t\tonDragStart: () => setState(draggingState),\n\t\t\t\tonDrop: () => setState(idleState),\n\t\t\t}),\n\t\t\tdropTargetForExternal({\n\t\t\t\telement: ref.current,\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement: ref.current,\n\t\t\t\tcanDrop: (args) => args.source.data.type === 'card',\n\t\t\t\tgetIsSticky: () => true,\n\t\t\t\tgetData: ({ input, element }) => {\n\t\t\t\t\tconst data = { type: 'card', itemId: key };\n\n\t\t\t\t\treturn attachClosestEdge(data, {\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\telement,\n\t\t\t\t\t\tallowedEdges: ['top', 'bottom'],\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragEnter: (args) => {\n\t\t\t\t\tif (args.source.data.itemId !== key) {\n\t\t\t\t\t\tsetClosestEdge(extractClosestEdge(args.self.data));\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonDrag: (args) => {\n\t\t\t\t\tif (args.source.data.itemId !== key) {\n\t\t\t\t\t\tsetClosestEdge(extractClosestEdge(args.self.data));\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonDragLeave: () => {\n\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t},\n\t\t\t\tonDrop: () => {\n\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [getSelectedCards, item, key]);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<CardPrimitive\n\t\t\t\tref={ref}\n\t\t\t\titem={item}\n\t\t\t\tstate={state}\n\t\t\t\tclosestEdge={closestEdge}\n\t\t\t\tactionMenuTriggerRef={actionMenuTriggerRef}\n\t\t\t\tisSelected={isSelected}\n\t\t\t\tonClick={onClick}\n\t\t\t/>\n\t\t\t{state.type === 'preview' &&\n\t\t\t\tReactDOM.createPortal(\n\t\t\t\t\t<CardStack numCards={state.numSelected}>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t\t * Ensuring the preview has the same dimensions as the original.\n\t\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t\t * Using `border-box` sizing here is not necessary in this\n\t\t\t\t\t\t\t\t * specific example, but it is safer to include generally.\n\t\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\t\t\t\twidth: state.rect.width,\n\t\t\t\t\t\t\t\theight: state.rect.height,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<CardPrimitive item={item} state={state} closestEdge={null} />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</CardStack>,\n\t\t\t\t\tstate.container,\n\t\t\t\t)}\n\t\t</Fragment>\n\t);\n});\n"
  },
  {
    "path": "packages/documentation/examples/pieces/rdr-board/column-context.tsx",
    "content": "import { createContext, useContext } from 'react';\n\nimport invariant from 'tiny-invariant';\n\nexport type ColumnContextProps = {\n\tcolumnId: string;\n\tgetCardIndex: (userId: string) => number;\n\tgetNumCards: () => number;\n};\n\nexport const ColumnContext = createContext<ColumnContextProps | null>(null);\n\nexport function useColumnContext(): ColumnContextProps {\n\tconst value = useContext(ColumnContext);\n\tinvariant(value, 'cannot find ColumnContext provider');\n\treturn value;\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/rdr-board/column.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { memo, type Ref, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx, type SerializedStyles } from '@emotion/react';\nimport { createPortal } from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport { IconButton } from '@atlaskit/button/new';\nimport DropdownMenu, {\n\ttype CustomTriggerProps,\n\tDropdownItem,\n\tDropdownItemGroup,\n} from '@atlaskit/dropdown-menu';\nimport Heading from '@atlaskit/heading';\nimport MoreIcon from '@atlaskit/icon/core/show-more-horizontal';\nimport { easeInOut } from '@atlaskit/motion/curves';\nimport { durations } from '@atlaskit/motion/durations';\nimport {\n\tattachClosestEdge,\n\ttype Edge,\n\textractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { preserveOffsetOnSource } from '@atlaskit/pragmatic-drag-and-drop/element/preserve-offset-on-source';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\nimport { token } from '@atlaskit/tokens';\n\nimport { cardGap } from '../../util/constants';\n\nimport { useBoardContext } from './board-context';\nimport { Card } from './card';\nimport { ColumnContext, type ColumnContextProps, useColumnContext } from './column-context';\nimport { type ColumnType } from './data';\n\nconst columnStyles = css({\n\tdisplay: 'flex',\n\twidth: 300,\n\tflexDirection: 'column',\n\tbackground: token('elevation.surface.sunken', '#F7F8F9'),\n\tborderRadius: token('radius.large'),\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values\n\ttransition: `background ${durations.medium}ms ${easeInOut}`,\n\tposition: 'relative',\n});\n\nconst scrollContainerStyles = css({\n\theight: '100%',\n\toverflowY: 'auto',\n});\n\nconst cardListStyles = css({\n\tdisplay: 'flex',\n\tboxSizing: 'border-box',\n\tminHeight: '100%',\n\tpadding: 'var(--grid)',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766\n\tgap: cardGap,\n\tflexDirection: 'column',\n});\n\nconst columnHeaderStyles = css({\n\tdisplay: 'flex',\n\tpadding: 'var(--grid) calc(var(--grid) * 2) 0',\n\tjustifyContent: 'space-between',\n\talignItems: 'center',\n\tflexDirection: 'row',\n\tcolor: token('color.text.subtlest', '#626F86'),\n\tuserSelect: 'none',\n\tcursor: 'grab',\n});\n\ntype IdleState = { type: 'idle' };\n\ntype DropTargetState =\n\t| IdleState\n\t| { type: 'is-card-over' }\n\t| { type: 'is-column-over'; closestEdge: Edge | null };\n\ntype DraggableState =\n\t| IdleState\n\t| { type: 'generate-column-preview'; container: HTMLElement }\n\t| { type: 'is-dragging' };\n\n// preventing re-renders\nconst idle: IdleState = { type: 'idle' };\nconst isCardOver: DropTargetState = { type: 'is-card-over' };\nconst isDraggingState: DraggableState = { type: 'is-dragging' };\n\nconst stateStyles: Partial<Record<DropTargetState['type'], SerializedStyles>> = {\n\t'is-card-over': css({\n\t\tbackground: token('color.background.selected.hovered', '#CCE0FF'),\n\t}),\n};\n\nconst draggableStateStyles: Partial<Record<DraggableState['type'], SerializedStyles>> = {\n\t'generate-column-preview': css({\n\t\tisolation: 'isolate',\n\t}),\n\n\t'is-dragging': css({\n\t\topacity: 0.4,\n\t}),\n};\n\nexport const Column = memo(function Column({ column }: { column: ColumnType }) {\n\tconst columnId = column.columnId;\n\tconst columnRef = useRef<HTMLDivElement | null>(null);\n\tconst headerRef = useRef<HTMLDivElement | null>(null);\n\tconst cardListRef = useRef<HTMLDivElement | null>(null);\n\tconst [dropTargetState, setDropTargetState] = useState<DropTargetState>(idle);\n\tconst [draggableState, setDraggableState] = useState<DraggableState>(idle);\n\n\tuseEffect(() => {\n\t\tinvariant(columnRef.current);\n\t\tinvariant(headerRef.current);\n\t\tinvariant(cardListRef.current);\n\t\treturn combine(\n\t\t\tdraggable({\n\t\t\t\telement: columnRef.current,\n\t\t\t\tdragHandle: headerRef.current,\n\t\t\t\tgetInitialData: () => ({ columnId, type: 'column' }),\n\t\t\t\tonGenerateDragPreview: ({ nativeSetDragImage, location, source }) => {\n\t\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\t\tgetOffset: preserveOffsetOnSource({\n\t\t\t\t\t\t\telement: source.element,\n\t\t\t\t\t\t\tinput: location.current.input,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\trender: ({ container }) => {\n\t\t\t\t\t\t\tsetDraggableState({ type: 'generate-column-preview', container });\n\t\t\t\t\t\t\treturn () => setDraggableState(isDraggingState);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragStart: () => {\n\t\t\t\t\tsetDraggableState(isDraggingState);\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tsetDraggableState(idle);\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement: cardListRef.current,\n\t\t\t\tgetData: () => ({ columnId }),\n\t\t\t\tcanDrop: (args) => args.source.data.type === 'card',\n\t\t\t\tgetIsSticky: () => true,\n\t\t\t\tonDragEnter: () => setDropTargetState(isCardOver),\n\t\t\t\tonDragLeave: () => setDropTargetState(idle),\n\t\t\t\tonDragStart: () => setDropTargetState(isCardOver),\n\t\t\t\tonDrop: () => setDropTargetState(idle),\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement: columnRef.current,\n\t\t\t\tcanDrop: (args) => args.source.data.type === 'column',\n\t\t\t\tgetIsSticky: () => true,\n\t\t\t\tgetData: ({ input, element }) => {\n\t\t\t\t\tconst data = {\n\t\t\t\t\t\tcolumnId,\n\t\t\t\t\t};\n\t\t\t\t\treturn attachClosestEdge(data, {\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\telement,\n\t\t\t\t\t\tallowedEdges: ['left', 'right'],\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragEnter: (args) => {\n\t\t\t\t\tsetDropTargetState({\n\t\t\t\t\t\ttype: 'is-column-over',\n\t\t\t\t\t\tclosestEdge: extractClosestEdge(args.self.data),\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDrag: (args) => {\n\t\t\t\t\t// skip react re-render if edge is not changing\n\t\t\t\t\tsetDropTargetState((current) => {\n\t\t\t\t\t\tconst closestEdge: Edge | null = extractClosestEdge(args.self.data);\n\t\t\t\t\t\tif (current.type === 'is-column-over' && current.closestEdge === closestEdge) {\n\t\t\t\t\t\t\treturn current;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttype: 'is-column-over',\n\t\t\t\t\t\t\tclosestEdge,\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragLeave: () => {\n\t\t\t\t\tsetDropTargetState(idle);\n\t\t\t\t},\n\t\t\t\tonDrop: () => {\n\t\t\t\t\tsetDropTargetState(idle);\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [columnId]);\n\n\tconst stableItems = useRef(column.items);\n\tuseEffect(() => {\n\t\tstableItems.current = column.items;\n\t}, [column.items]);\n\n\tconst getCardIndex = useCallback((key: string) => {\n\t\treturn stableItems.current.findIndex((item) => item.key === key);\n\t}, []);\n\n\tconst getNumCards = useCallback(() => {\n\t\treturn stableItems.current.length;\n\t}, []);\n\n\tconst contextValue: ColumnContextProps = useMemo(() => {\n\t\treturn { columnId, getCardIndex, getNumCards };\n\t}, [columnId, getCardIndex, getNumCards]);\n\n\treturn (\n\t\t<ColumnContext.Provider value={contextValue}>\n\t\t\t<div\n\t\t\t\tcss={[\n\t\t\t\t\tcolumnStyles,\n\t\t\t\t\tstateStyles[dropTargetState.type],\n\t\t\t\t\tdraggableStateStyles[draggableState.type],\n\t\t\t\t]}\n\t\t\t\tref={columnRef}\n\t\t\t>\n\t\t\t\t<div css={columnHeaderStyles} ref={headerRef} data-testid={`column-${columnId}--header`}>\n\t\t\t\t\t<Heading size=\"xxsmall\" as=\"span\">\n\t\t\t\t\t\t{column.title}\n\t\t\t\t\t</Heading>\n\t\t\t\t\t<ActionMenu />\n\t\t\t\t</div>\n\t\t\t\t<div css={scrollContainerStyles}>\n\t\t\t\t\t<div css={cardListStyles} ref={cardListRef}>\n\t\t\t\t\t\t{column.items.map((item) => (\n\t\t\t\t\t\t\t<Card item={item} key={item.key} />\n\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t{dropTargetState.type === 'is-column-over' && dropTargetState.closestEdge && (\n\t\t\t\t\t<DropIndicator edge={dropTargetState.closestEdge} gap={`8px`} />\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t{draggableState.type === 'generate-column-preview'\n\t\t\t\t? createPortal(<ColumnPreview column={column} />, draggableState.container)\n\t\t\t\t: null}\n\t\t</ColumnContext.Provider>\n\t);\n});\n\nconst previewStyles = css({\n\twidth: 250,\n\tbackground: token('elevation.surface.sunken', '#F7F8F9'),\n\tborderRadius: token('radius.large'),\n\tpadding: token('space.200'),\n});\n\nfunction ColumnPreview({ column }: { column: ColumnType }) {\n\treturn (\n\t\t<div css={[columnHeaderStyles, previewStyles]}>\n\t\t\t<Heading size=\"xxsmall\" as=\"span\">\n\t\t\t\t{column.title}\n\t\t\t</Heading>\n\t\t</div>\n\t);\n}\n\nfunction ActionMenu() {\n\treturn (\n\t\t<DropdownMenu trigger={DropdownMenuTrigger} shouldRenderToParent>\n\t\t\t<ActionMenuItems />\n\t\t</DropdownMenu>\n\t);\n}\n\nfunction ActionMenuItems() {\n\tconst { columnId } = useColumnContext();\n\tconst { getColumns, reorderColumn } = useBoardContext();\n\n\tconst columns = getColumns();\n\tconst startIndex = columns.findIndex((column) => column.columnId === columnId);\n\n\tconst moveLeft = useCallback(() => {\n\t\treorderColumn({\n\t\t\tstartIndex,\n\t\t\tfinishIndex: startIndex - 1,\n\t\t});\n\t}, [reorderColumn, startIndex]);\n\n\tconst moveRight = useCallback(() => {\n\t\treorderColumn({\n\t\t\tstartIndex,\n\t\t\tfinishIndex: startIndex + 1,\n\t\t});\n\t}, [reorderColumn, startIndex]);\n\n\tconst isMoveLeftDisabled = startIndex === 0;\n\tconst isMoveRightDisabled = startIndex === columns.length - 1;\n\n\treturn (\n\t\t<DropdownItemGroup>\n\t\t\t<DropdownItem onClick={moveLeft} isDisabled={isMoveLeftDisabled}>\n\t\t\t\tMove left\n\t\t\t</DropdownItem>\n\t\t\t<DropdownItem onClick={moveRight} isDisabled={isMoveRightDisabled}>\n\t\t\t\tMove right\n\t\t\t</DropdownItem>\n\t\t</DropdownItemGroup>\n\t);\n}\n\nfunction DropdownMenuTrigger({ triggerRef, ...triggerProps }: CustomTriggerProps) {\n\treturn (\n\t\t<IconButton\n\t\t\tref={triggerRef as Ref<HTMLButtonElement>}\n\t\t\t{...triggerProps}\n\t\t\tappearance=\"subtle\"\n\t\t\ticon={MoreIcon}\n\t\t\tlabel=\"Actions\"\n\t\t/>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/rdr-board/data.tsx",
    "content": "export type Epic = 'forms' | 'accounts' | 'billing';\n\nexport type CardData = {\n\tsummary: string;\n\tepic: Epic;\n\tkey: string;\n};\n\nexport type ColumnType = {\n\ttitle: string;\n\tcolumnId: string;\n\titems: CardData[];\n};\nexport type ColumnMap = { [columnId: string]: ColumnType };\n\nexport function getInitialData() {\n\tconst columnMap: ColumnMap = {\n\t\ttodo: {\n\t\t\ttitle: 'To do',\n\t\t\tcolumnId: 'todo',\n\t\t\titems: [\n\t\t\t\t{\n\t\t\t\t\tsummary: 'Billing system integration — frontend',\n\t\t\t\t\tepic: 'forms',\n\t\t\t\t\tkey: 'NUC-339',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsummary: 'Onboard workout options (OWO)',\n\t\t\t\t\tepic: 'accounts',\n\t\t\t\t\tkey: 'NUC-360',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsummary: 'Optimize experience for mobile web',\n\t\t\t\t\tepic: 'billing',\n\t\t\t\t\tkey: 'NUC-344',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\t'in-progress': {\n\t\t\ttitle: 'In progress',\n\t\t\tcolumnId: 'in-progress',\n\t\t\titems: [\n\t\t\t\t{\n\t\t\t\t\tsummary: 'Revise and streamline booking flow',\n\t\t\t\t\tepic: 'forms',\n\t\t\t\t\tkey: 'NUC-343',\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tsummary: 'Onboard workout options (OWO)',\n\t\t\t\t\tepic: 'accounts',\n\t\t\t\t\tkey: 'NUC-362',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tdone: {\n\t\t\ttitle: 'Done',\n\t\t\tcolumnId: 'done',\n\t\t\titems: [\n\t\t\t\t{\n\t\t\t\t\tsummary: 'Optimize experience for mobile web',\n\t\t\t\t\tepic: 'billing',\n\t\t\t\t\tkey: 'NUC-351',\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t};\n\n\tconst orderedColumnIds = ['todo', 'in-progress', 'done'];\n\n\treturn {\n\t\tcolumnMap,\n\t\torderedColumnIds,\n\t\tlastOperation: null,\n\t};\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/rdr-board/epic-lozenge.tsx",
    "content": "import React from 'react';\n\nimport Lozenge, { type ThemeAppearance as LozengeAppearance } from '@atlaskit/lozenge';\n\nimport type { Epic } from './data';\n\nconst appearanceMap: Record<Epic, LozengeAppearance> = {\n\tforms: 'new',\n\taccounts: 'success',\n\tbilling: 'inprogress',\n};\n\nexport function EpicLozenge({ epic }: { epic: Epic }): React.JSX.Element {\n\treturn (\n\t\t<Lozenge appearance={appearanceMap[epic]} isBold>\n\t\t\t{epic}\n\t\t</Lozenge>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/rdr-board/index.tsx",
    "content": "import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport invariant from 'tiny-invariant';\n\nimport { extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport type { Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/types';\nimport { getReorderDestinationIndex } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index';\nimport * as liveRegion from '@atlaskit/pragmatic-drag-and-drop-live-region';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';\n\nimport Board from './board';\nimport { BoardContext, type BoardContextProps } from './board-context';\nimport { Column } from './column';\nimport { type CardData, type ColumnMap, type ColumnType, getInitialData } from './data';\n\ntype Operation =\n\t| {\n\t\t\ttype: 'column-reorder';\n\t\t\tcolumnId: string;\n\t\t\tstartIndex: number;\n\t\t\tfinishIndex: number;\n\t  }\n\t| {\n\t\t\ttype: 'card-reorder';\n\t\t\tcolumnId: string;\n\t\t\tstartIndex: number;\n\t\t\tfinishIndex: number;\n\t  }\n\t| {\n\t\t\ttype: 'card-move';\n\t\t\tfinishColumnId: string;\n\t\t\titemIndexInStartColumn: number;\n\t\t\titemIndexInFinishColumn: number;\n\t  };\n\ntype BoardState = {\n\tcolumnMap: ColumnMap;\n\torderedColumnIds: string[];\n\tlastOperation: Operation | null;\n};\n\n/**\n * Registering cards and their action menu trigger element,\n * so that we can restore focus to the trigger when a card moves between columns.\n */\nfunction createRegistry() {\n\tconst registry = {\n\t\tcards: new Map<string, { actionMenuTrigger: HTMLElement }>(),\n\t\tselectedCards: [] as string[],\n\t};\n\n\tfunction registerCard({\n\t\tcardId,\n\t\tactionMenuTrigger,\n\t\tisSelected,\n\t}: {\n\t\tcardId: string;\n\t\tactionMenuTrigger: HTMLElement;\n\t\tisSelected: boolean;\n\t}) {\n\t\tregistry.cards.set(cardId, { actionMenuTrigger });\n\t\tif (isSelected) {\n\t\t\tregistry.selectedCards.push(cardId);\n\t\t}\n\t\treturn () => {\n\t\t\tregistry.cards.delete(cardId);\n\t\t\tregistry.selectedCards = registry.selectedCards.filter((id) => id !== cardId);\n\t\t};\n\t}\n\n\treturn { registry, registerCard };\n}\n\nexport function BoardPrototype(): React.JSX.Element {\n\tconst [data, setData] = useState<BoardState>(getInitialData);\n\n\tconst stableData = useRef(data);\n\tuseEffect(() => {\n\t\tstableData.current = data;\n\t}, [data]);\n\n\tconst [{ registry, registerCard }] = useState(createRegistry);\n\n\tconst { lastOperation } = data;\n\tuseEffect(() => {\n\t\tif (lastOperation === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (lastOperation.type === 'column-reorder') {\n\t\t\tconst { startIndex, finishIndex } = lastOperation;\n\n\t\t\tconst { columnMap, orderedColumnIds } = stableData.current;\n\t\t\tconst sourceColumn = columnMap[orderedColumnIds[finishIndex]];\n\n\t\t\tliveRegion.announce(\n\t\t\t\t`You've moved ${sourceColumn.title} from position ${\n\t\t\t\t\tstartIndex + 1\n\t\t\t\t} to position ${finishIndex + 1} of ${orderedColumnIds.length}.`,\n\t\t\t);\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (lastOperation.type === 'card-reorder') {\n\t\t\tconst { columnId, startIndex, finishIndex } = lastOperation;\n\n\t\t\tconst { columnMap } = stableData.current;\n\t\t\tconst column = columnMap[columnId];\n\t\t\tconst item = column.items[startIndex];\n\n\t\t\tliveRegion.announce(\n\t\t\t\t`You've moved ${item.summary} from position ${\n\t\t\t\t\tstartIndex + 1\n\t\t\t\t} to position ${finishIndex + 1} of ${column.items.length} in the ${column.title} column.`,\n\t\t\t);\n\n\t\t\treturn;\n\t\t}\n\n\t\tif (lastOperation.type === 'card-move') {\n\t\t\tconst { finishColumnId, itemIndexInStartColumn, itemIndexInFinishColumn } = lastOperation;\n\n\t\t\tconst data = stableData.current;\n\t\t\tconst destinationColumn = data.columnMap[finishColumnId];\n\t\t\tconst item = destinationColumn.items[itemIndexInFinishColumn];\n\n\t\t\tconst finishPosition =\n\t\t\t\ttypeof itemIndexInFinishColumn === 'number'\n\t\t\t\t\t? itemIndexInFinishColumn + 1\n\t\t\t\t\t: destinationColumn.items.length;\n\n\t\t\tliveRegion.announce(\n\t\t\t\t`You've moved ${item.summary} from position ${\n\t\t\t\t\titemIndexInStartColumn + 1\n\t\t\t\t} to position ${finishPosition} in the ${destinationColumn.title} column.`,\n\t\t\t);\n\n\t\t\tconst cardEntry = registry.cards.get(item.key);\n\t\t\tinvariant(cardEntry);\n\t\t\t/**\n\t\t\t * Because the card has moved column, it will have remounted.\n\t\t\t * This means we need to manually restore focus to it.\n\t\t\t */\n\t\t\tcardEntry.actionMenuTrigger.focus();\n\n\t\t\treturn;\n\t\t}\n\t}, [lastOperation, registry]);\n\n\tuseEffect(() => {\n\t\treturn liveRegion.cleanup();\n\t}, []);\n\n\tconst getColumns = useCallback(() => {\n\t\tconst { columnMap, orderedColumnIds } = stableData.current;\n\t\treturn orderedColumnIds.map((columnId) => columnMap[columnId]);\n\t}, []);\n\n\tconst reorderColumn = useCallback(\n\t\t({ startIndex, finishIndex }: { startIndex: number; finishIndex: number }) => {\n\t\t\tsetData((data) => {\n\t\t\t\treturn {\n\t\t\t\t\t...data,\n\t\t\t\t\torderedColumnIds: reorder({\n\t\t\t\t\t\tlist: data.orderedColumnIds,\n\t\t\t\t\t\tstartIndex,\n\t\t\t\t\t\tfinishIndex,\n\t\t\t\t\t}),\n\t\t\t\t\tlastOperation: {\n\t\t\t\t\t\ttype: 'column-reorder',\n\t\t\t\t\t\tcolumnId: data.orderedColumnIds[startIndex],\n\t\t\t\t\t\tstartIndex,\n\t\t\t\t\t\tfinishIndex,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t});\n\t\t},\n\t\t[],\n\t);\n\n\tconst reorderCard = useCallback(\n\t\t({\n\t\t\tcolumnId,\n\t\t\tstartIndex,\n\t\t\tfinishIndex,\n\t\t}: {\n\t\t\tcolumnId: string;\n\t\t\tstartIndex: number;\n\t\t\tfinishIndex: number;\n\t\t}) => {\n\t\t\tsetData((data) => {\n\t\t\t\tconst sourceColumn = data.columnMap[columnId];\n\t\t\t\tconst updatedItems = reorder({\n\t\t\t\t\tlist: sourceColumn.items,\n\t\t\t\t\tstartIndex,\n\t\t\t\t\tfinishIndex,\n\t\t\t\t});\n\n\t\t\t\tconst updatedSourceColumn: ColumnType = {\n\t\t\t\t\t...sourceColumn,\n\t\t\t\t\titems: updatedItems,\n\t\t\t\t};\n\n\t\t\t\tconst updatedMap: ColumnMap = {\n\t\t\t\t\t...data.columnMap,\n\t\t\t\t\t[columnId]: updatedSourceColumn,\n\t\t\t\t};\n\n\t\t\t\treturn {\n\t\t\t\t\t...data,\n\t\t\t\t\tcolumnMap: updatedMap,\n\t\t\t\t\tlastOperation: {\n\t\t\t\t\t\ttype: 'card-reorder',\n\t\t\t\t\t\tcolumnId,\n\t\t\t\t\t\tstartIndex,\n\t\t\t\t\t\tfinishIndex,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t});\n\t\t},\n\t\t[],\n\t);\n\n\tconst moveCard = useCallback(\n\t\t({\n\t\t\tstartColumnId,\n\t\t\tfinishColumnId,\n\t\t\titemIndexInStartColumn,\n\t\t\titemIndexInFinishColumn,\n\t\t}: {\n\t\t\tstartColumnId: string;\n\t\t\tfinishColumnId: string;\n\t\t\titemIndexInStartColumn: number;\n\t\t\titemIndexInFinishColumn?: number;\n\t\t}) => {\n\t\t\tsetData((data) => {\n\t\t\t\tconst sourceColumn = data.columnMap[startColumnId];\n\t\t\t\tconst destinationColumn = data.columnMap[finishColumnId];\n\t\t\t\tconst item: CardData = sourceColumn.items[itemIndexInStartColumn];\n\n\t\t\t\tconst otherSelectedItems = sourceColumn.items.filter(\n\t\t\t\t\t({ key }) => key !== item.key && registry.selectedCards.includes(key),\n\t\t\t\t);\n\n\t\t\t\tlet destinationItems = Array.from(destinationColumn.items);\n\t\t\t\tif (typeof itemIndexInFinishColumn === 'number') {\n\t\t\t\t\tdestinationItems.splice(itemIndexInFinishColumn, 0, item, ...otherSelectedItems);\n\t\t\t\t} else {\n\t\t\t\t\tdestinationItems.push(item, ...otherSelectedItems);\n\t\t\t\t}\n\n\t\t\t\tconst updatedMap = {\n\t\t\t\t\t...data.columnMap,\n\t\t\t\t\t[startColumnId]: {\n\t\t\t\t\t\t...sourceColumn,\n\t\t\t\t\t\titems: sourceColumn.items.filter(\n\t\t\t\t\t\t\t(i) => i.key !== item.key && !registry.selectedCards.includes(i.key),\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t\t[finishColumnId]: {\n\t\t\t\t\t\t...destinationColumn,\n\t\t\t\t\t\titems: destinationItems,\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\treturn {\n\t\t\t\t\t...data,\n\t\t\t\t\tcolumnMap: updatedMap,\n\t\t\t\t\tlastOperation: {\n\t\t\t\t\t\ttype: 'card-move',\n\t\t\t\t\t\tstartColumnId,\n\t\t\t\t\t\tfinishColumnId,\n\t\t\t\t\t\titemIndexInStartColumn,\n\t\t\t\t\t\titemIndexInFinishColumn:\n\t\t\t\t\t\t\ttypeof itemIndexInFinishColumn === 'number'\n\t\t\t\t\t\t\t\t? itemIndexInFinishColumn\n\t\t\t\t\t\t\t\t: destinationItems.length - 1,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t});\n\t\t},\n\t\t[registry.selectedCards],\n\t);\n\n\tuseEffect(() => {\n\t\treturn combine(\n\t\t\tmonitorForElements({\n\t\t\t\tonDrop(args) {\n\t\t\t\t\tconst { location, source } = args;\n\t\t\t\t\t// didn't drop on anything\n\t\t\t\t\tif (!location.current.dropTargets.length) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\t// need to handle drop\n\n\t\t\t\t\t// 1. remove element from original position\n\t\t\t\t\t// 2. move to new position\n\n\t\t\t\t\tif (source.data.type === 'column') {\n\t\t\t\t\t\tconst startIndex: number = data.orderedColumnIds.findIndex(\n\t\t\t\t\t\t\t(columnId) => columnId === source.data.columnId,\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tconst target = location.current.dropTargets[0];\n\t\t\t\t\t\tconst indexOfTarget: number = data.orderedColumnIds.findIndex(\n\t\t\t\t\t\t\t(id) => id === target.data.columnId,\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst closestEdgeOfTarget: Edge | null = extractClosestEdge(target.data);\n\n\t\t\t\t\t\tconst finishIndex = getReorderDestinationIndex({\n\t\t\t\t\t\t\tstartIndex,\n\t\t\t\t\t\t\tindexOfTarget,\n\t\t\t\t\t\t\tclosestEdgeOfTarget,\n\t\t\t\t\t\t\taxis: 'horizontal',\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\treorderColumn({ startIndex, finishIndex });\n\t\t\t\t\t}\n\t\t\t\t\t// Dragging a card\n\t\t\t\t\tif (source.data.type === 'card') {\n\t\t\t\t\t\tconst itemId = source.data.itemId;\n\t\t\t\t\t\tinvariant(typeof itemId === 'string');\n\t\t\t\t\t\t// TODO: these lines not needed if item has columnId on it\n\t\t\t\t\t\tconst [, startColumnRecord] = location.initial.dropTargets;\n\t\t\t\t\t\tconst sourceId = startColumnRecord.data.columnId;\n\t\t\t\t\t\tinvariant(typeof sourceId === 'string');\n\t\t\t\t\t\tconst sourceColumn = data.columnMap[sourceId];\n\t\t\t\t\t\tconst itemIndex = sourceColumn.items.findIndex((item) => item.key === itemId);\n\n\t\t\t\t\t\tif (location.current.dropTargets.length === 1) {\n\t\t\t\t\t\t\tconst [destinationColumnRecord] = location.current.dropTargets;\n\t\t\t\t\t\t\tconst destinationId = destinationColumnRecord.data.columnId;\n\t\t\t\t\t\t\tinvariant(typeof destinationId === 'string');\n\t\t\t\t\t\t\tconst destinationColumn = data.columnMap[destinationId];\n\t\t\t\t\t\t\tinvariant(destinationColumn);\n\n\t\t\t\t\t\t\t// reordering in same column\n\t\t\t\t\t\t\tif (sourceColumn === destinationColumn) {\n\t\t\t\t\t\t\t\tconst destinationIndex = getReorderDestinationIndex({\n\t\t\t\t\t\t\t\t\tstartIndex: itemIndex,\n\t\t\t\t\t\t\t\t\tindexOfTarget: sourceColumn.items.length - 1,\n\t\t\t\t\t\t\t\t\tclosestEdgeOfTarget: null,\n\t\t\t\t\t\t\t\t\taxis: 'vertical',\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\treorderCard({\n\t\t\t\t\t\t\t\t\tcolumnId: sourceColumn.columnId,\n\t\t\t\t\t\t\t\t\tstartIndex: itemIndex,\n\t\t\t\t\t\t\t\t\tfinishIndex: destinationIndex,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// moving to a new column\n\t\t\t\t\t\t\tmoveCard({\n\t\t\t\t\t\t\t\titemIndexInStartColumn: itemIndex,\n\t\t\t\t\t\t\t\tstartColumnId: sourceColumn.columnId,\n\t\t\t\t\t\t\t\tfinishColumnId: destinationColumn.columnId,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// dropping in a column (relative to a card)\n\t\t\t\t\t\tif (location.current.dropTargets.length === 2) {\n\t\t\t\t\t\t\tconst [destinationCardRecord, destinationColumnRecord] = location.current.dropTargets;\n\t\t\t\t\t\t\tconst destinationColumnId = destinationColumnRecord.data.columnId;\n\t\t\t\t\t\t\tinvariant(typeof destinationColumnId === 'string');\n\t\t\t\t\t\t\tconst destinationColumn = data.columnMap[destinationColumnId];\n\n\t\t\t\t\t\t\tconst indexOfTarget = destinationColumn.items.findIndex(\n\t\t\t\t\t\t\t\t(item) => item.key === destinationCardRecord.data.itemId,\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tconst closestEdgeOfTarget: Edge | null = extractClosestEdge(\n\t\t\t\t\t\t\t\tdestinationCardRecord.data,\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t// case 1: ordering in the same column\n\t\t\t\t\t\t\tif (sourceColumn === destinationColumn) {\n\t\t\t\t\t\t\t\tconst destinationIndex = getReorderDestinationIndex({\n\t\t\t\t\t\t\t\t\tstartIndex: itemIndex,\n\t\t\t\t\t\t\t\t\tindexOfTarget,\n\t\t\t\t\t\t\t\t\tclosestEdgeOfTarget,\n\t\t\t\t\t\t\t\t\taxis: 'vertical',\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\treorderCard({\n\t\t\t\t\t\t\t\t\tcolumnId: sourceColumn.columnId,\n\t\t\t\t\t\t\t\t\tstartIndex: itemIndex,\n\t\t\t\t\t\t\t\t\tfinishIndex: destinationIndex,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// case 2: moving into a new column relative to a card\n\n\t\t\t\t\t\t\tconst destinationIndex =\n\t\t\t\t\t\t\t\tclosestEdgeOfTarget === 'bottom' ? indexOfTarget + 1 : indexOfTarget;\n\n\t\t\t\t\t\t\tmoveCard({\n\t\t\t\t\t\t\t\titemIndexInStartColumn: itemIndex,\n\t\t\t\t\t\t\t\tstartColumnId: sourceColumn.columnId,\n\t\t\t\t\t\t\t\tfinishColumnId: destinationColumn.columnId,\n\t\t\t\t\t\t\t\titemIndexInFinishColumn: destinationIndex,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [data, moveCard, reorderCard, reorderColumn]);\n\n\tconst getSelectedCards = useCallback(() => {\n\t\treturn registry.selectedCards;\n\t}, [registry]);\n\n\tconst contextValue: BoardContextProps = useMemo(() => {\n\t\treturn {\n\t\t\tgetColumns,\n\t\t\treorderColumn,\n\t\t\treorderCard,\n\t\t\tmoveCard,\n\t\t\tregisterCard,\n\t\t\tgetSelectedCards,\n\t\t};\n\t}, [getColumns, reorderColumn, reorderCard, moveCard, registerCard, getSelectedCards]);\n\n\treturn (\n\t\t<BoardContext.Provider value={contextValue}>\n\t\t\t<Board>\n\t\t\t\t{data.orderedColumnIds.map((columnId) => {\n\t\t\t\t\tconsole.log('columnId ->', data.columnMap[columnId], data);\n\t\t\t\t\treturn <Column column={data.columnMap[columnId]} key={columnId} />;\n\t\t\t\t})}\n\t\t\t</Board>\n\t\t</BoardContext.Provider>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/rdr-pinned-fields/container.tsx",
    "content": "import React, { type ReactNode } from 'react';\n\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Stack, xcss } from '@atlaskit/primitives';\nimport { token } from '@atlaskit/tokens';\n\nconst containerStyles = xcss({\n\tborderRadius: token('radius.small'),\n\tborderWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border',\n\t// overflow: 'hidden',\n\tminWidth: '400px',\n});\n\nconst headerStyles = xcss({\n\tbackgroundColor: 'elevation.surface.overlay',\n\tfontWeight: 'font.weight.bold',\n\tborderWidth: '0',\n\tborderBottomWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border',\n\tlineHeight: '20px',\n\tpadding: 'space.150',\n\tborderTopLeftRadius: token('radius.small'),\n\tborderTopRightRadius: token('radius.small'),\n});\n\nconst pinnedFieldsHeaderStyles = xcss({\n\t// paddingLeft: 'space.200',\n});\n\nexport function FieldsContainer({\n\tchildren,\n\ttitle,\n\tisPinnedFields = false,\n}: {\n\tchildren: ReactNode;\n\ttitle: string;\n\tisPinnedFields?: boolean;\n}): React.JSX.Element {\n\treturn (\n\t\t<Stack xcss={containerStyles}>\n\t\t\t<Box xcss={[headerStyles, isPinnedFields && pinnedFieldsHeaderStyles]}>{title}</Box>\n\t\t\t<Stack>{children}</Stack>\n\t\t</Stack>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/rdr-pinned-fields/context.tsx",
    "content": "import { createContext, useContext } from 'react';\n\nimport invariant from 'tiny-invariant';\n\nimport type { Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\n\nimport { type ItemData } from './data';\n\ntype ItemPosition = 'first' | 'last' | 'middle' | 'only';\n\ntype CleanupFn = () => void;\n\ntype ListContextProps = {\n\tgetItemIndex: ({ id }: { id: string }) => number;\n\tgetItemPosition: (itemData: ItemData) => ItemPosition;\n\tregisterItem: (args: { id: string; element: HTMLElement }) => CleanupFn;\n\treorderItem: (args: {\n\t\tstartIndex: number;\n\t\tindexOfTarget: number;\n\t\tclosestEdgeOfTarget: Edge | null;\n\t}) => void;\n};\n\nexport const ListContext = createContext<ListContextProps | null>(null);\n\nexport function useListContext() {\n\tconst listContext = useContext(ListContext);\n\tinvariant(listContext !== null);\n\treturn listContext;\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/rdr-pinned-fields/data.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport type { ReactNode } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { jsx } from '@emotion/react';\n\nimport Avatar from '@atlaskit/avatar';\nimport Badge from '@atlaskit/badge';\nimport { Date } from '@atlaskit/date';\nimport { SimpleTag } from '@atlaskit/tag';\nimport TagGroup from '@atlaskit/tag-group';\n\nimport { FieldContentWithIcon } from './field';\nimport MajorPriorityIcon from './major-priority-icon';\n\nexport type ItemData = {\n\tid: string;\n\tlabel: string;\n\tcontent: ReactNode;\n};\n\nexport const defaultItems: ItemData[] = [\n\t{\n\t\tid: 'priority',\n\t\tlabel: 'Priority',\n\t\tcontent: <FieldContentWithIcon icon={<MajorPriorityIcon />}>Major</FieldContentWithIcon>,\n\t},\n\t{\n\t\tid: 'assignee',\n\t\tlabel: 'Assignee',\n\t\tcontent: (\n\t\t\t<FieldContentWithIcon\n\t\t\t\ticon={\n\t\t\t\t\t<Avatar\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tsrc=\"https://upload.wikimedia.org/wikipedia/en/2/2d/SSU_Kirby_artwork.png\"\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t>\n\t\t\t\tKirby\n\t\t\t</FieldContentWithIcon>\n\t\t),\n\t},\n\t{\n\t\tid: 'reporter',\n\t\tlabel: 'Reporter',\n\t\tcontent: (\n\t\t\t<FieldContentWithIcon\n\t\t\t\ticon={\n\t\t\t\t\t<Avatar\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\tsrc=\"https://upload.wikimedia.org/wikipedia/en/d/db/Yoshi_%28Nintendo_character%29.png\"\n\t\t\t\t\t/>\n\t\t\t\t}\n\t\t\t>\n\t\t\t\tYoshi\n\t\t\t</FieldContentWithIcon>\n\t\t),\n\t},\n\t{\n\t\tid: 'labels',\n\t\tlabel: 'Labels',\n\t\tcontent: (\n\t\t\t<TagGroup>\n\t\t\t\t<SimpleTag text=\"jira\" />\n\t\t\t\t<SimpleTag text=\"work-item-view\" />\n\t\t\t</TagGroup>\n\t\t),\n\t},\n\t// {\n\t//   id: 'story-points',\n\t//   label: 'Story point estimate',\n\t//   content: <Badge>{3}</Badge>,\n\t// },\n\t// { id: 'due-date', label: 'Due date', content: <Date value={0} /> },\n];\n\nexport const defaultDetailsItems: ItemData[] = [\n\t{\n\t\tid: 'story-points',\n\t\tlabel: 'Story point estimate',\n\t\tcontent: <Badge>{3}</Badge>,\n\t},\n\t{ id: 'due-date', label: 'Due date', content: <Date value={0} /> },\n];\n"
  },
  {
    "path": "packages/documentation/examples/pieces/rdr-pinned-fields/drag-handle-button.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport { forwardRef } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport type { CustomTriggerProps } from '@atlaskit/dropdown-menu';\nimport FocusRing from '@atlaskit/focus-ring';\nimport DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';\nimport { token } from '@atlaskit/tokens';\n\nconst dragHandleButtonStyles = css({\n\tpadding: 0,\n\tborder: 'none',\n\tbackground: 'transparent',\n\t// eslint-disable-next-line @atlaskit/design-system/no-unsafe-design-token-usage\n\tborderRadius: token('radius.small', '3px'),\n\topacity: 'var(--action-opacity)',\n\tcolor: token('color.icon.subtle', '#626F86'),\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':focus-visible': {\n\t\topacity: 1,\n\t},\n\tcursor: 'grab',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':hover': {\n\t\tbackgroundColor: token('color.background.neutral.subtle.hovered', '#091E420F'),\n\t},\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':active': {\n\t\tbackgroundColor: token('color.background.neutral.subtle.pressed', '#091E4224'),\n\t},\n});\n\nconst selectedStyles = css({\n\tbackgroundColor: token('color.background.selected', '#E9F2FF'),\n\tcolor: token('color.icon.selected', '#0C66E4'),\n\topacity: 1,\n});\n\ntype DragHandleButtonProps = Omit<CustomTriggerProps, 'triggerRef'>;\n\nexport const DragHandleButton = forwardRef<HTMLButtonElement, DragHandleButtonProps>(\n\tfunction DragHandleButton({ isSelected, testId, ...props }, ref) {\n\t\treturn (\n\t\t\t<FocusRing isInset>\n\t\t\t\t<button ref={ref} css={[dragHandleButtonStyles, isSelected && selectedStyles]} {...props}>\n\t\t\t\t\t{/* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 */}\n\t\t\t\t\t<div style={{ marginInline: '-2px' }}>\n\t\t\t\t\t\t<DragHandleVerticalIcon spacing=\"spacious\" color=\"currentColor\" label=\"\" size=\"small\" />\n\t\t\t\t\t</div>\n\t\t\t\t</button>\n\t\t\t</FocusRing>\n\t\t);\n\t},\n);\n"
  },
  {
    "path": "packages/documentation/examples/pieces/rdr-pinned-fields/field.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { type ReactNode } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nconst fieldContentWithIconStyles = css({\n\tdisplay: 'grid',\n\tgridTemplateColumns: '24px 1fr',\n\talignItems: 'center',\n\tgap: 12,\n});\n\nconst fieldContentIconStyles = css({\n\tdisplay: 'flex',\n\tjustifyContent: 'center',\n\talignItems: 'center',\n\twidth: 24,\n\theight: 24,\n\tpointerEvents: 'none',\n});\n\n/**\n * Used to emulate a select\n */\nexport function FieldContentWithIcon({\n\tchildren,\n\ticon,\n}: {\n\tchildren: ReactNode;\n\ticon: ReactNode;\n}): React.JSX.Element {\n\treturn (\n\t\t<div css={fieldContentWithIconStyles}>\n\t\t\t<div css={fieldContentIconStyles}>{icon}</div>\n\t\t\t<div>{children}</div>\n\t\t</div>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/rdr-pinned-fields/index.tsx",
    "content": "import React from 'react';\n\nimport { Stack } from '@atlaskit/primitives/compiled';\n\nimport { FieldsContainer } from './container';\nimport { defaultDetailsItems, defaultItems } from './data';\nimport List from './list';\n\nexport default function PinnedFieldsPrototype(): React.JSX.Element {\n\treturn (\n\t\t<Stack space=\"space.200\">\n\t\t\t<FieldsContainer title=\"Your pinned fields\" isPinnedFields>\n\t\t\t\t<List isSortable defaultItems={defaultItems} />\n\t\t\t</FieldsContainer>\n\t\t\t<FieldsContainer title=\"Details\">\n\t\t\t\t<List defaultItems={defaultDetailsItems} />\n\t\t\t</FieldsContainer>\n\t\t</Stack>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/rdr-pinned-fields/list-item.tsx",
    "content": "import React, { Fragment, useCallback, useEffect, useRef, useState } from 'react';\n\nimport ReactDOM from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';\nimport {\n\tattachClosestEdge,\n\ttype Edge,\n\textractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Grid, Inline, xcss } from '@atlaskit/primitives';\nimport { token } from '@atlaskit/tokens';\n\nimport { useListContext } from './context';\nimport { type ItemData } from './data';\nimport { DragHandleButton } from './drag-handle-button';\n\nconst listItemContainerStyles = xcss({\n\tposition: 'relative',\n\tbackgroundColor: 'color.background.neutral.subtle',\n\t'--action-opacity': 0,\n\t':hover': {\n\t\t// backgroundColor: 'color.background.neutral.subtle.hovered',\n\t\t// @ts-expect-error\n\t\t'--action-opacity': 1,\n\t},\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':last-of-type': {\n\t\tborderWidth: '0',\n\t\tborderBottomLeftRadius: 'radius.small',\n\t\tborderBottomRightRadius: 'radius.small',\n\t},\n});\n\nconst listItemStyles = xcss({\n\tposition: 'relative',\n\tpaddingBlock: 'space.100',\n\tpaddingInline: 'space.150',\n\theight: '40px',\n\t// backgroundColor: 'elevation.surface',\n});\n\n/**\n * Removing padding for sortable items because the drag handle acts as padding.\n */\nconst sortableStyles = xcss({\n\tpaddingLeft: 'space.0',\n\tcursor: 'grab',\n});\n\nconst listItemDisabledStyles = xcss({ opacity: 0.4 });\n\ntype DraggableState =\n\t| { type: 'idle' }\n\t| { type: 'preview'; container: HTMLElement }\n\t| { type: 'dragging' };\n\nconst idleState: DraggableState = { type: 'idle' };\nconst draggingState: DraggableState = { type: 'dragging' };\n\nconst listItemPreviewStyles = xcss({\n\tpaddingBlock: 'space.050',\n\tpaddingInline: 'space.100',\n\tborderRadius: 'radius.small',\n\tbackgroundColor: 'elevation.surface.overlay',\n\tmaxWidth: '360px',\n\twhiteSpace: 'nowrap',\n\toverflow: 'hidden',\n\ttextOverflow: 'ellipsis',\n});\n\nconst labelStyles = xcss({\n\tfont: 'font.body.UNSAFE_small',\n\tfontWeight: 'font.weight.semibold',\n\tcolor: 'color.text.subtle',\n});\n\nconst fieldLayoutStyles = xcss({\n\twidth: '100%',\n\tgap: 'space.100',\n});\n\nconst dragHandleRegionStyles = xcss({\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-important-styles -- Ignored via go/DSP-18766\n\tcursor: 'grab !important',\n});\n\nexport function ListItem({\n\titemData,\n\tisSortable,\n}: {\n\titemData: ItemData;\n\tisSortable: boolean;\n}): React.JSX.Element {\n\tconst { getItemIndex, registerItem } = useListContext();\n\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst [closestEdge, setClosestEdge] = useState<Edge | null>(null);\n\n\tconst [draggableState, setDraggableState] = useState<DraggableState>(idleState);\n\n\tuseEffect(() => {\n\t\tif (!isSortable) {\n\t\t\treturn;\n\t\t}\n\n\t\tinvariant(ref.current);\n\n\t\tconst element = ref.current;\n\n\t\tconst dragData = { id: itemData.id };\n\n\t\treturn combine(\n\t\t\tregisterItem({ id: itemData.id, element }),\n\t\t\tdraggable({\n\t\t\t\telement,\n\t\t\t\tgetInitialData() {\n\t\t\t\t\treturn { ...dragData, index: getItemIndex(itemData) };\n\t\t\t\t},\n\t\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\t\tgetOffset: pointerOutsideOfPreview({\n\t\t\t\t\t\t\tx: token('space.200', '16px'),\n\t\t\t\t\t\t\ty: token('space.100', '8px'),\n\t\t\t\t\t\t}),\n\t\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\t\tsetDraggableState({ type: 'preview', container });\n\n\t\t\t\t\t\t\treturn () => setDraggableState(draggingState);\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragStart() {\n\t\t\t\t\tsetDraggableState(draggingState);\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tsetDraggableState(idleState);\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement,\n\t\t\t\tgetData({ input }) {\n\t\t\t\t\treturn attachClosestEdge(dragData, {\n\t\t\t\t\t\telement,\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tallowedEdges: ['top', 'bottom'],\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDrag({ self, source }) {\n\t\t\t\t\tconst isSource = source.element === element;\n\t\t\t\t\tif (isSource) {\n\t\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst closestEdge = extractClosestEdge(self.data);\n\n\t\t\t\t\tconst sourceIndex = source.data.index;\n\t\t\t\t\tinvariant(typeof sourceIndex === 'number');\n\n\t\t\t\t\tconst selfIndex = getItemIndex({ id: itemData.id });\n\n\t\t\t\t\tconst isItemBeforeSource = selfIndex === sourceIndex - 1;\n\t\t\t\t\tconst isItemAfterSource = selfIndex === sourceIndex + 1;\n\n\t\t\t\t\tconst isDropIndicatorHidden =\n\t\t\t\t\t\t(isItemBeforeSource && closestEdge === 'bottom') ||\n\t\t\t\t\t\t(isItemAfterSource && closestEdge === 'top');\n\n\t\t\t\t\tif (isDropIndicatorHidden) {\n\t\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tsetClosestEdge(closestEdge);\n\t\t\t\t},\n\t\t\t\tonDragLeave() {\n\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [getItemIndex, isSortable, itemData, registerItem]);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<Box ref={ref} xcss={listItemContainerStyles}>\n\t\t\t\t<Inline\n\t\t\t\t\tspace=\"space.100\"\n\t\t\t\t\talignBlock=\"center\"\n\t\t\t\t\tspread=\"space-between\"\n\t\t\t\t\tgrow=\"fill\"\n\t\t\t\t\txcss={[\n\t\t\t\t\t\tlistItemStyles,\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * We are applying the disabled effect to the inner element so that\n\t\t\t\t\t\t * the border and drop indicator are not affected.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tdraggableState.type === 'dragging' && listItemDisabledStyles,\n\t\t\t\t\t\tisSortable && sortableStyles,\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t<Grid templateColumns=\"35% 1fr\" xcss={fieldLayoutStyles} alignItems=\"center\">\n\t\t\t\t\t\t<Inline xcss={[isSortable && dragHandleRegionStyles]} alignBlock=\"center\">\n\t\t\t\t\t\t\t{isSortable && (\n\t\t\t\t\t\t\t\t<DropdownMenu<HTMLButtonElement>\n\t\t\t\t\t\t\t\t\ttrigger={({ triggerRef, ...triggerProps }) => (\n\t\t\t\t\t\t\t\t\t\t<DragHandleButton ref={triggerRef} {...triggerProps} />\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\tshouldRenderToParent\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<LazyDropdownContent itemData={itemData} />\n\t\t\t\t\t\t\t\t</DropdownMenu>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t<Box xcss={labelStyles}>{itemData.label}</Box>\n\t\t\t\t\t\t</Inline>\n\t\t\t\t\t\t<Box>{itemData.content}</Box>\n\t\t\t\t\t</Grid>\n\t\t\t\t</Inline>\n\t\t\t\t{closestEdge && <DropIndicator edge={closestEdge} gap=\"0px\" />}\n\t\t\t</Box>\n\t\t\t{draggableState.type === 'preview' &&\n\t\t\t\tReactDOM.createPortal(\n\t\t\t\t\t<Box xcss={listItemPreviewStyles}>{itemData.label}</Box>,\n\t\t\t\t\tdraggableState.container,\n\t\t\t\t)}\n\t\t</Fragment>\n\t);\n}\n\nfunction LazyDropdownContent({ itemData }: { itemData: ItemData }) {\n\tconst { getItemIndex, getItemPosition, reorderItem } = useListContext();\n\n\tconst position = getItemPosition(itemData);\n\n\tconst isMoveUpDisabled = position === 'first' || position === 'only';\n\tconst isMoveDownDisabled = position === 'last' || position === 'only';\n\n\tconst moveUp = useCallback(() => {\n\t\tconst startIndex = getItemIndex(itemData);\n\t\treorderItem({\n\t\t\tstartIndex,\n\t\t\tindexOfTarget: startIndex - 1,\n\t\t\tclosestEdgeOfTarget: null,\n\t\t});\n\t}, [getItemIndex, itemData, reorderItem]);\n\n\tconst moveDown = useCallback(() => {\n\t\tconst startIndex = getItemIndex(itemData);\n\t\treorderItem({\n\t\t\tstartIndex,\n\t\t\tindexOfTarget: startIndex + 1,\n\t\t\tclosestEdgeOfTarget: null,\n\t\t});\n\t}, [getItemIndex, itemData, reorderItem]);\n\n\treturn (\n\t\t<DropdownItemGroup>\n\t\t\t<DropdownItem onClick={moveUp} isDisabled={isMoveUpDisabled}>\n\t\t\t\tMove up\n\t\t\t</DropdownItem>\n\t\t\t<DropdownItem onClick={moveDown} isDisabled={isMoveDownDisabled}>\n\t\t\t\tMove down\n\t\t\t</DropdownItem>\n\t\t</DropdownItemGroup>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/rdr-pinned-fields/list.tsx",
    "content": "import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { triggerPostMoveFlash } from '@atlaskit/pragmatic-drag-and-drop-flourish/trigger-post-move-flash';\nimport {\n\ttype Edge,\n\textractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { getReorderDestinationIndex } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index';\nimport * as liveRegion from '@atlaskit/pragmatic-drag-and-drop-live-region';\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Stack, xcss } from '@atlaskit/primitives';\n\nimport { ListContext } from './context';\nimport type { ItemData } from './data';\nimport { ListItem } from './list-item';\n\nconst containerStyles = xcss({\n\t// borderWidth: 'border.width',\n\t// borderStyle: 'solid',\n\t// borderColor: 'color.border',\n\tborderBottomLeftRadius: 'radius.small',\n\tborderBottomRightRadius: 'radius.small',\n});\n\ntype ListState = {\n\titems: ItemData[];\n\tlastCardMoved: {\n\t\titem: ItemData;\n\t\tpreviousIndex: number;\n\t\tcurrentIndex: number;\n\t\tnumberOfItems: number;\n\t} | null;\n};\n\nexport default function ListExample({\n\tdefaultItems,\n\tisSortable = false,\n}: {\n\tdefaultItems: ItemData[];\n\tisSortable?: boolean;\n}): React.JSX.Element {\n\tconst [{ items, lastCardMoved }, setListState] = useState<ListState>({\n\t\titems: defaultItems,\n\t\tlastCardMoved: null,\n\t});\n\n\tconst registryRef = useRef(new Map<string, HTMLElement>());\n\tconst registerItem = useCallback(({ id, element }: { id: string; element: HTMLElement }) => {\n\t\tconst registry = registryRef.current;\n\t\tif (!registry) {\n\t\t\treturn () => {};\n\t\t}\n\t\tregistry.set(id, element);\n\n\t\treturn function unregisterItem() {\n\t\t\tregistry.delete(id);\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tliveRegion.cleanup();\n\t\t};\n\t}, []);\n\n\t/**\n\t * Creating a stable reference for the items, so that we can avoid\n\t * rerenders.\n\t */\n\tconst stableItemsRef = useRef<ItemData[]>(items);\n\tuseEffect(() => {\n\t\tstableItemsRef.current = items;\n\t}, [items]);\n\n\tuseEffect(() => {\n\t\tif (lastCardMoved === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { item, previousIndex, currentIndex, numberOfItems } = lastCardMoved;\n\t\tconst element = registryRef.current.get(item.id);\n\t\tif (element) {\n\t\t\ttriggerPostMoveFlash(element);\n\t\t}\n\n\t\tliveRegion.announce(\n\t\t\t`You've moved ${item.label} from position ${\n\t\t\t\tpreviousIndex + 1\n\t\t\t} to position ${currentIndex + 1} of ${numberOfItems}.`,\n\t\t);\n\t}, [lastCardMoved]);\n\n\tconst reorderItem = useCallback(\n\t\t({\n\t\t\tstartIndex,\n\t\t\tindexOfTarget,\n\t\t\tclosestEdgeOfTarget,\n\t\t}: {\n\t\t\tstartIndex: number;\n\t\t\tindexOfTarget: number;\n\t\t\tclosestEdgeOfTarget: Edge | null;\n\t\t}) => {\n\t\t\tconst finishIndex = getReorderDestinationIndex({\n\t\t\t\tstartIndex,\n\t\t\t\tclosestEdgeOfTarget,\n\t\t\t\tindexOfTarget,\n\t\t\t\taxis: 'vertical',\n\t\t\t});\n\n\t\t\tif (finishIndex === startIndex) {\n\t\t\t\t// If there would be no change, we skip the update\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetListState((listState) => {\n\t\t\t\tconst item = listState.items[startIndex];\n\n\t\t\t\treturn {\n\t\t\t\t\titems: reorder({\n\t\t\t\t\t\tlist: listState.items,\n\t\t\t\t\t\tstartIndex,\n\t\t\t\t\t\tfinishIndex,\n\t\t\t\t\t}),\n\t\t\t\t\tlastCardMoved: {\n\t\t\t\t\t\titem,\n\t\t\t\t\t\tpreviousIndex: startIndex,\n\t\t\t\t\t\tcurrentIndex: finishIndex,\n\t\t\t\t\t\tnumberOfItems: listState.items.length,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t});\n\t\t},\n\t\t[],\n\t);\n\n\tuseEffect(() => {\n\t\treturn monitorForElements({\n\t\t\tonDrop({ location, source }) {\n\t\t\t\tconst target = location.current.dropTargets[0];\n\t\t\t\tif (!target) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst items = stableItemsRef.current;\n\n\t\t\t\tconst startIndex = items.findIndex((item) => item.id === source.data.id);\n\t\t\t\tif (startIndex < 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst indexOfTarget = items.findIndex((item) => item.id === target.data.id);\n\t\t\t\tif (indexOfTarget < 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst closestEdgeOfTarget = extractClosestEdge(target.data);\n\n\t\t\t\treorderItem({ startIndex, indexOfTarget, closestEdgeOfTarget });\n\t\t\t},\n\t\t});\n\t}, [reorderItem]);\n\n\tconst getItemPosition = useCallback((itemData: ItemData) => {\n\t\tconst items = stableItemsRef.current;\n\n\t\tif (items.length === 1) {\n\t\t\treturn 'only';\n\t\t}\n\n\t\tconst index = items.indexOf(itemData);\n\t\tif (index === 0) {\n\t\t\treturn 'first';\n\t\t}\n\n\t\tif (index === items.length - 1) {\n\t\t\treturn 'last';\n\t\t}\n\n\t\treturn 'middle';\n\t}, []);\n\n\tconst getItemIndex = useCallback(({ id }: { id: string }) => {\n\t\treturn stableItemsRef.current.findIndex((item) => item.id === id);\n\t}, []);\n\n\tconst contextValue = useMemo(() => {\n\t\treturn { getItemIndex, getItemPosition, registerItem, reorderItem };\n\t}, [getItemIndex, getItemPosition, registerItem, reorderItem]);\n\n\treturn (\n\t\t<ListContext.Provider value={contextValue}>\n\t\t\t<Stack xcss={containerStyles}>\n\t\t\t\t{items.map((itemData) => (\n\t\t\t\t\t<ListItem key={itemData.id} itemData={itemData} isSortable={isSortable} />\n\t\t\t\t))}\n\t\t\t</Stack>\n\t\t</ListContext.Provider>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/rdr-pinned-fields/major-priority-icon.tsx",
    "content": "import React from 'react';\n\nexport default function MajorPriorityIcon(): React.JSX.Element {\n\treturn (\n\t\t<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t<path\n\t\t\t\td=\"M12.5215 14.1467L12.6247 14.2191L17.6247 18.2191C18.056 18.5641 18.1259 19.1934 17.7809 19.6247C17.4624 20.0228 16.9017 20.113 16.4781 19.8531L16.3753 19.7809L12 16.28L7.62469 19.7809C7.22661 20.0993 6.65978 20.0643 6.30357 19.7178L6.21913 19.6247C5.90066 19.2266 5.93574 18.6598 6.28222 18.3036L6.3753 18.2191L11.3753 14.2191C11.7073 13.9535 12.1664 13.9294 12.5215 14.1467Z\"\n\t\t\t\tfill=\"#FF8F73\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M12.5215 9.14669L12.6247 9.21913L17.6247 13.2191C18.056 13.5641 18.1259 14.1934 17.7809 14.6247C17.4624 15.0228 16.9017 15.113 16.4781 14.8531L16.3753 14.7809L12 11.28L7.6247 14.7809C7.22661 15.0993 6.65979 15.0643 6.30358 14.7178L6.21914 14.6247C5.90067 14.2266 5.93575 13.6598 6.28223 13.3036L6.37531 13.2191L11.3753 9.21913C11.7073 8.95352 12.1664 8.92937 12.5215 9.14669Z\"\n\t\t\t\tfill=\"#FF7452\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M12.5215 4.14669L12.6247 4.21913L17.6247 8.21913C18.056 8.56414 18.1259 9.19343 17.7809 9.62469C17.4624 10.0228 16.9017 10.113 16.4781 9.85315L16.3753 9.78087L12 6.28L7.6247 9.78087C7.22661 10.0993 6.65979 10.0643 6.30358 9.71778L6.21914 9.62469C5.90067 9.22661 5.93575 8.65978 6.28223 8.30358L6.37531 8.21913L11.3753 4.21913C11.7073 3.95352 12.1664 3.92937 12.5215 4.14669Z\"\n\t\t\t\tfill=\"#FF5630\"\n\t\t\t/>\n\t\t</svg>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/rdr-subtasks/container.tsx",
    "content": "import React, { type ReactNode } from 'react';\n\nimport Avatar from '@atlaskit/avatar';\nimport Badge from '@atlaskit/badge';\nimport Button, { IconButton } from '@atlaskit/button/new';\nimport ChevronDownIcon from '@atlaskit/icon/core/chevron-down';\nimport MoreIcon from '@atlaskit/icon/core/show-more-horizontal';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Inline, Stack, xcss } from '@atlaskit/primitives';\n\nconst containerStyles = xcss({\n\tpadding: 'space.100',\n\tborderRadius: 'radius.large',\n\tbackgroundColor: 'elevation.surface.sunken',\n\twidth: '50vw',\n});\n\nexport function BacklogContainer({ children }: { children: ReactNode }): React.JSX.Element {\n\treturn (\n\t\t<Stack space=\"space.100\" xcss={containerStyles}>\n\t\t\t<BacklogHeader />\n\t\t\t{children}\n\t\t</Stack>\n\t);\n}\n\nconst headerTitleInsetStyles = xcss({\n\tpaddingLeft: 'space.150',\n});\n\nconst headerAvatarGroupInsetStyles = xcss({\n\tpaddingLeft: 'space.300',\n});\n\nconst sprintTitleStyles = xcss({\n\tfontWeight: 'font.weight.semibold',\n});\n\nconst subtlestTextStyles = xcss({\n\tcolor: 'color.text.subtlest',\n});\n\nfunction BacklogHeader() {\n\treturn (\n\t\t<Stack space=\"space.050\">\n\t\t\t<Inline spread=\"space-between\" alignBlock=\"center\" xcss={headerTitleInsetStyles}>\n\t\t\t\t<Inline alignBlock=\"center\">\n\t\t\t\t\t<ChevronDownIcon color=\"currentColor\" spacing=\"spacious\" label=\"\" size=\"small\" />\n\t\t\t\t\t<Inline space=\"space.100\" alignBlock=\"center\">\n\t\t\t\t\t\t<Box xcss={sprintTitleStyles}>Sprint Title</Box>\n\t\t\t\t\t\t<Box xcss={subtlestTextStyles}>29 Aug — 12 Sep</Box>\n\t\t\t\t\t\t<Box xcss={subtlestTextStyles}>(23 work items)</Box>\n\t\t\t\t\t</Inline>\n\t\t\t\t</Inline>\n\t\t\t\t<Inline space=\"space.100\" alignBlock=\"center\">\n\t\t\t\t\t<Inline space=\"space.050\">\n\t\t\t\t\t\t<Badge>0d</Badge>\n\t\t\t\t\t\t<Badge appearance=\"primary\">0d</Badge>\n\t\t\t\t\t\t<Badge appearance=\"added\">0d</Badge>\n\t\t\t\t\t</Inline>\n\t\t\t\t\t<Button>Complete sprint</Button>\n\t\t\t\t\t<IconButton icon={MoreIcon} label=\"more actions\" />\n\t\t\t\t</Inline>\n\t\t\t</Inline>\n\t\t\t<Inline space=\"space.050\" alignBlock=\"center\" xcss={headerAvatarGroupInsetStyles}>\n\t\t\t\t{Array.from({ length: 5 }, (_, index) => (\n\t\t\t\t\t<Avatar key={index} size=\"small\" />\n\t\t\t\t))}\n\t\t\t\t<IconButton icon={MoreIcon} appearance=\"subtle\" label=\"more actions\" />\n\t\t\t</Inline>\n\t\t</Stack>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/rdr-subtasks/context.tsx",
    "content": "import { createContext, useContext } from 'react';\n\nimport invariant from 'tiny-invariant';\n\nimport type { Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\n\nimport { type ItemData } from './data';\n\ntype ItemPosition = 'first' | 'last' | 'middle' | 'only';\n\ntype CleanupFn = () => void;\n\ntype ListContextProps = {\n\tgetItemIndex: ({ id }: { id: string }) => number;\n\tgetItemPosition: (itemData: ItemData) => ItemPosition;\n\tregisterItem: (args: { id: string; element: HTMLElement }) => CleanupFn;\n\treorderItem: (args: {\n\t\tstartIndex: number;\n\t\tindexOfTarget: number;\n\t\tclosestEdgeOfTarget: Edge | null;\n\t}) => void;\n};\n\nexport const ListContext = createContext<ListContextProps | null>(null);\n\nexport function useListContext() {\n\tconst listContext = useContext(ListContext);\n\tinvariant(listContext !== null);\n\treturn listContext;\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/rdr-subtasks/data.tsx",
    "content": "export type ItemData = {\n\tid: string;\n\tlabel: string;\n};\n\nexport const defaultItems: ItemData[] = [\n\t{\n\t\tid: 'PROJ-149',\n\t\tlabel: 'Organize a team-building event',\n\t},\n\t{\n\t\tid: 'PROJ-192',\n\t\tlabel: 'Create and maintain office inventory',\n\t},\n\t{\n\t\tid: 'PROJ-131',\n\t\tlabel: 'Update company website content',\n\t},\n\t{\n\t\tid: 'PROJ-142',\n\t\tlabel: 'Plan and execute marketing campaigns',\n\t},\n\t{\n\t\tid: 'PROJ-175',\n\t\tlabel: 'Coordinate employee training sessions',\n\t},\n\t{\n\t\tid: 'PROJ-139',\n\t\tlabel: 'Manage facility maintenance',\n\t},\n\t{\n\t\tid: 'PROJ-156',\n\t\tlabel: 'Organize customer feedback surveys',\n\t},\n\t{\n\t\tid: 'PROJ-160',\n\t\tlabel: 'Coordinate travel arrangements',\n\t},\n];\n"
  },
  {
    "path": "packages/documentation/examples/pieces/rdr-subtasks/drag-handle-button.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport { forwardRef } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport type { CustomTriggerProps } from '@atlaskit/dropdown-menu';\nimport FocusRing from '@atlaskit/focus-ring';\nimport DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';\nimport { token } from '@atlaskit/tokens';\n\nconst dragHandleButtonStyles = css({\n\tpadding: 0,\n\tborder: 'none',\n\tbackground: 'transparent',\n\t// eslint-disable-next-line @atlaskit/design-system/no-unsafe-design-token-usage\n\tborderRadius: token('radius.small', '3px'),\n\topacity: 'var(--action-opacity)',\n\tcolor: token('color.icon.subtle', '#626F86'),\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':focus-visible': {\n\t\topacity: 1,\n\t},\n\tcursor: 'grab',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':hover': {\n\t\tbackgroundColor: token('color.background.neutral.subtle.hovered', '#091E420F'),\n\t},\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':active': {\n\t\tbackgroundColor: token('color.background.neutral.subtle.pressed', '#091E4224'),\n\t},\n});\n\nconst subtaskSpecificHandleStyles = css({\n\twidth: 24,\n\theight: 24,\n\tmarginLeft: -4,\n});\n\nconst selectedStyles = css({\n\tbackgroundColor: token('color.background.selected', '#E9F2FF'),\n\tcolor: token('color.icon.selected', '#0C66E4'),\n\topacity: 1,\n});\n\ntype DragHandleButtonProps = Omit<CustomTriggerProps, 'triggerRef'>;\n\nexport const DragHandleButton = forwardRef<HTMLButtonElement, DragHandleButtonProps>(\n\tfunction DragHandleButton({ isSelected, testId, ...props }, ref) {\n\t\treturn (\n\t\t\t<FocusRing isInset>\n\t\t\t\t<button\n\t\t\t\t\tref={ref}\n\t\t\t\t\tcss={[dragHandleButtonStyles, subtaskSpecificHandleStyles, isSelected && selectedStyles]}\n\t\t\t\t\t{...props}\n\t\t\t\t>\n\t\t\t\t\t<DragHandleVerticalIcon color=\"currentColor\" spacing=\"spacious\" label=\"\" size=\"small\" />\n\t\t\t\t</button>\n\t\t\t</FocusRing>\n\t\t);\n\t},\n);\n"
  },
  {
    "path": "packages/documentation/examples/pieces/rdr-subtasks/index.tsx",
    "content": "import React from 'react';\n\nimport List from './list';\n\nexport function SubtasksPrototype(): React.JSX.Element {\n\treturn <List />;\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/rdr-subtasks/list-item.tsx",
    "content": "import React, { Fragment, useCallback, useEffect, useRef, useState } from 'react';\n\nimport ReactDOM from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport Avatar from '@atlaskit/avatar';\nimport Badge from '@atlaskit/badge';\nimport DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';\nimport Lozenge from '@atlaskit/lozenge';\nimport {\n\tattachClosestEdge,\n\ttype Edge,\n\textractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Grid, Inline, xcss } from '@atlaskit/primitives';\nimport { token } from '@atlaskit/tokens';\n\nimport { useListContext } from './context';\nimport { type ItemData } from './data';\nimport { DragHandleButton } from './drag-handle-button';\nimport { SubtaskIcon } from './subtask-icon';\n\nconst listItemContainerStyles = xcss({\n\tposition: 'relative',\n\tborderWidth: '0',\n\tborderBottomWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border',\n\tcursor: 'grab',\n\t// backgroundColor: 'elevation.surface.raised',\n\t'--action-opacity': 0,\n\t':hover': {\n\t\tbackgroundColor: 'elevation.surface.raised.hovered',\n\t\t// @ts-expect-error\n\t\t'--action-opacity': 1,\n\t},\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':last-of-type': {\n\t\tborderWidth: '0',\n\t},\n});\n\nconst listItemStyles = xcss({\n\tposition: 'relative',\n\tpaddingInline: 'space.100',\n\theight: '40px',\n});\n\nconst listItemDisabledStyles = xcss({ opacity: 0.4 });\n\ntype DraggableState =\n\t| { type: 'idle' }\n\t| { type: 'preview'; container: HTMLElement }\n\t| { type: 'dragging' };\n\nconst idleState: DraggableState = { type: 'idle' };\nconst draggingState: DraggableState = { type: 'dragging' };\n\nconst listItemPreviewStyles = xcss({\n\tpaddingBlock: 'space.050',\n\tpaddingInline: 'space.100',\n\tborderRadius: 'radius.small',\n\tbackgroundColor: 'elevation.surface.overlay',\n\tmaxWidth: '360px',\n\twhiteSpace: 'nowrap',\n\toverflow: 'hidden',\n\ttextOverflow: 'ellipsis',\n});\n\nconst itemLabelStyles = xcss({\n\tflexGrow: 1,\n\twhiteSpace: 'nowrap',\n\ttextOverflow: 'ellipsis',\n\toverflow: 'hidden',\n\tcursor: 'pointer',\n\t':hover': {\n\t\ttextDecoration: 'underline',\n\t},\n});\n\nconst iconStackStyles = xcss({\n\t// @ts-expect-error\n\t':hover, :focus-within': {\n\t\t'--action-opacity': 1,\n\t\t'--icon-display': 'none',\n\t},\n});\n\nconst linkStyles = xcss({\n\tcolor: 'color.link',\n\tfontSize: '12px',\n\tfontWeight: 'font.weight.medium',\n\tcursor: 'pointer',\n\t':hover': {\n\t\ttextDecoration: 'underline',\n\t},\n});\n\nexport function ListItem({ itemData }: { itemData: ItemData }): React.JSX.Element {\n\tconst { getItemIndex, registerItem } = useListContext();\n\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst [closestEdge, setClosestEdge] = useState<Edge | null>(null);\n\n\tconst [draggableState, setDraggableState] = useState<DraggableState>(idleState);\n\n\tuseEffect(() => {\n\t\tinvariant(ref.current);\n\n\t\tconst element = ref.current;\n\n\t\tconst dragData = { id: itemData.id, instance: 'subtasks' };\n\n\t\treturn combine(\n\t\t\tregisterItem({ id: itemData.id, element }),\n\t\t\tdraggable({\n\t\t\t\telement,\n\t\t\t\tgetInitialData() {\n\t\t\t\t\treturn { ...dragData, index: getItemIndex(itemData) };\n\t\t\t\t},\n\t\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\t\tgetOffset: pointerOutsideOfPreview({\n\t\t\t\t\t\t\tx: token('space.200', '16px'),\n\t\t\t\t\t\t\ty: token('space.100', '8px'),\n\t\t\t\t\t\t}),\n\t\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\t\tsetDraggableState({ type: 'preview', container });\n\n\t\t\t\t\t\t\treturn () => setDraggableState(draggingState);\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragStart() {\n\t\t\t\t\tsetDraggableState(draggingState);\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tsetDraggableState(idleState);\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement,\n\t\t\t\tgetData({ input }) {\n\t\t\t\t\treturn attachClosestEdge(dragData, {\n\t\t\t\t\t\telement,\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tallowedEdges: ['top', 'bottom'],\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDrag({ self, source }) {\n\t\t\t\t\tconst isSource = source.element === element;\n\t\t\t\t\tif (isSource) {\n\t\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst closestEdge = extractClosestEdge(self.data);\n\n\t\t\t\t\tconst sourceIndex = source.data.index;\n\t\t\t\t\tinvariant(typeof sourceIndex === 'number');\n\n\t\t\t\t\tconst selfIndex = getItemIndex({ id: itemData.id });\n\n\t\t\t\t\tconst isItemBeforeSource = selfIndex === sourceIndex - 1;\n\t\t\t\t\tconst isItemAfterSource = selfIndex === sourceIndex + 1;\n\n\t\t\t\t\tconst isDropIndicatorHidden =\n\t\t\t\t\t\t(isItemBeforeSource && closestEdge === 'bottom') ||\n\t\t\t\t\t\t(isItemAfterSource && closestEdge === 'top');\n\n\t\t\t\t\tif (isDropIndicatorHidden) {\n\t\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tsetClosestEdge(closestEdge);\n\t\t\t\t},\n\t\t\t\tonDragLeave() {\n\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [getItemIndex, itemData, registerItem]);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<Box ref={ref} xcss={listItemContainerStyles}>\n\t\t\t\t<Inline\n\t\t\t\t\tspace=\"space.100\"\n\t\t\t\t\talignBlock=\"center\"\n\t\t\t\t\tspread=\"space-between\"\n\t\t\t\t\txcss={[\n\t\t\t\t\t\tlistItemStyles,\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * We are applying the disabled effect to the inner element so that\n\t\t\t\t\t\t * the border and drop indicator are not affected.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tdraggableState.type === 'dragging' && listItemDisabledStyles,\n\t\t\t\t\t]}\n\t\t\t\t>\n\t\t\t\t\t<Inline space=\"space.100\" alignBlock=\"center\">\n\t\t\t\t\t\t<Grid\n\t\t\t\t\t\t\ttemplateAreas={['stack']}\n\t\t\t\t\t\t\ttemplateRows=\"16px\"\n\t\t\t\t\t\t\ttemplateColumns=\"16px\"\n\t\t\t\t\t\t\txcss={iconStackStyles}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\t\t\t\t\tgridArea: 'stack',\n\t\t\t\t\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\t\t\t\t\topacity: 'calc(1 - var(--action-opacity))',\n\t\t\t\t\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\t\t\t\t\tdisplay: 'var(--icon-display)',\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<SubtaskIcon />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\t\t\t\t\tgridArea: 'stack',\n\t\t\t\t\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\t\t\t\t\tmarginTop: '-4px',\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<DropdownMenu<HTMLButtonElement>\n\t\t\t\t\t\t\t\t\ttrigger={({ triggerRef, ...triggerProps }) => (\n\t\t\t\t\t\t\t\t\t\t<DragHandleButton ref={triggerRef} {...triggerProps} />\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\tshouldRenderToParent\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<LazyDropdownContent itemData={itemData} />\n\t\t\t\t\t\t\t\t</DropdownMenu>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</Grid>\n\t\t\t\t\t\t<Box xcss={linkStyles}>{itemData.id}</Box>\n\t\t\t\t\t\t<Box xcss={itemLabelStyles}>{itemData.label}</Box>\n\t\t\t\t\t</Inline>\n\t\t\t\t\t<Inline alignBlock=\"center\" space=\"space.100\">\n\t\t\t\t\t\t<Badge>1</Badge>\n\t\t\t\t\t\t<Avatar size=\"small\" />\n\t\t\t\t\t\t<Lozenge>Todo</Lozenge>\n\t\t\t\t\t</Inline>\n\t\t\t\t</Inline>\n\t\t\t\t{closestEdge && <DropIndicator edge={closestEdge} gap=\"1px\" />}\n\t\t\t</Box>\n\t\t\t{draggableState.type === 'preview' &&\n\t\t\t\tReactDOM.createPortal(\n\t\t\t\t\t<Box xcss={listItemPreviewStyles}>{itemData.label}</Box>,\n\t\t\t\t\tdraggableState.container,\n\t\t\t\t)}\n\t\t</Fragment>\n\t);\n}\n\nfunction LazyDropdownContent({ itemData }: { itemData: ItemData }) {\n\tconst { getItemIndex, getItemPosition, reorderItem } = useListContext();\n\n\tconst position = getItemPosition(itemData);\n\n\tconst isMoveUpDisabled = position === 'first' || position === 'only';\n\tconst isMoveDownDisabled = position === 'last' || position === 'only';\n\n\tconst moveUp = useCallback(() => {\n\t\tconst startIndex = getItemIndex(itemData);\n\t\treorderItem({\n\t\t\tstartIndex,\n\t\t\tindexOfTarget: startIndex - 1,\n\t\t\tclosestEdgeOfTarget: null,\n\t\t});\n\t}, [getItemIndex, itemData, reorderItem]);\n\n\tconst moveDown = useCallback(() => {\n\t\tconst startIndex = getItemIndex(itemData);\n\t\treorderItem({\n\t\t\tstartIndex,\n\t\t\tindexOfTarget: startIndex + 1,\n\t\t\tclosestEdgeOfTarget: null,\n\t\t});\n\t}, [getItemIndex, itemData, reorderItem]);\n\n\treturn (\n\t\t<DropdownItemGroup>\n\t\t\t<DropdownItem onClick={moveUp} isDisabled={isMoveUpDisabled}>\n\t\t\t\tMove up\n\t\t\t</DropdownItem>\n\t\t\t<DropdownItem onClick={moveDown} isDisabled={isMoveDownDisabled}>\n\t\t\t\tMove down\n\t\t\t</DropdownItem>\n\t\t</DropdownItemGroup>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/rdr-subtasks/list.tsx",
    "content": "import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { triggerPostMoveFlash } from '@atlaskit/pragmatic-drag-and-drop-flourish/trigger-post-move-flash';\nimport {\n\ttype Edge,\n\textractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { getReorderDestinationIndex } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index';\nimport * as liveRegion from '@atlaskit/pragmatic-drag-and-drop-live-region';\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Stack, xcss } from '@atlaskit/primitives';\n\nimport { ListContext } from './context';\nimport { defaultItems, type ItemData } from './data';\nimport { ListItem } from './list-item';\n\nconst containerStyles = xcss({\n\t// borderWidth: 'border.width',\n\t// borderStyle: 'solid',\n\t// borderColor: 'color.border',\n\tborderRadius: 'radius.small',\n\tboxShadow: 'elevation.shadow.raised',\n});\n\ntype ListState = {\n\titems: ItemData[];\n\tlastCardMoved: {\n\t\titem: ItemData;\n\t\tpreviousIndex: number;\n\t\tcurrentIndex: number;\n\t\tnumberOfItems: number;\n\t} | null;\n};\n\nexport default function ListExample(): React.JSX.Element {\n\tconst [{ items, lastCardMoved }, setListState] = useState<ListState>({\n\t\titems: defaultItems,\n\t\tlastCardMoved: null,\n\t});\n\n\tconst registryRef = useRef(new Map<string, HTMLElement>());\n\tconst registerItem = useCallback(({ id, element }: { id: string; element: HTMLElement }) => {\n\t\tconst registry = registryRef.current;\n\t\tif (!registry) {\n\t\t\treturn () => {};\n\t\t}\n\t\tregistry.set(id, element);\n\n\t\treturn function unregisterItem() {\n\t\t\tregistry.delete(id);\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tliveRegion.cleanup();\n\t\t};\n\t}, []);\n\n\t/**\n\t * Creating a stable reference for the items, so that we can avoid\n\t * rerenders.\n\t */\n\tconst stableItemsRef = useRef<ItemData[]>(items);\n\tuseEffect(() => {\n\t\tstableItemsRef.current = items;\n\t}, [items]);\n\n\tuseEffect(() => {\n\t\tif (lastCardMoved === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { item, previousIndex, currentIndex, numberOfItems } = lastCardMoved;\n\t\tconst element = registryRef.current.get(item.id);\n\t\tif (element) {\n\t\t\ttriggerPostMoveFlash(element);\n\t\t}\n\n\t\tliveRegion.announce(\n\t\t\t`You've moved ${item.label} from position ${\n\t\t\t\tpreviousIndex + 1\n\t\t\t} to position ${currentIndex + 1} of ${numberOfItems}.`,\n\t\t);\n\t}, [lastCardMoved]);\n\n\tconst reorderItem = useCallback(\n\t\t({\n\t\t\tstartIndex,\n\t\t\tindexOfTarget,\n\t\t\tclosestEdgeOfTarget,\n\t\t}: {\n\t\t\tstartIndex: number;\n\t\t\tindexOfTarget: number;\n\t\t\tclosestEdgeOfTarget: Edge | null;\n\t\t}) => {\n\t\t\tconst finishIndex = getReorderDestinationIndex({\n\t\t\t\tstartIndex,\n\t\t\t\tclosestEdgeOfTarget,\n\t\t\t\tindexOfTarget,\n\t\t\t\taxis: 'vertical',\n\t\t\t});\n\n\t\t\tif (finishIndex === startIndex) {\n\t\t\t\t// If there would be no change, we skip the update\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetListState((listState) => {\n\t\t\t\tconst item = listState.items[startIndex];\n\n\t\t\t\treturn {\n\t\t\t\t\titems: reorder({\n\t\t\t\t\t\tlist: listState.items,\n\t\t\t\t\t\tstartIndex,\n\t\t\t\t\t\tfinishIndex,\n\t\t\t\t\t}),\n\t\t\t\t\tlastCardMoved: {\n\t\t\t\t\t\titem,\n\t\t\t\t\t\tpreviousIndex: startIndex,\n\t\t\t\t\t\tcurrentIndex: finishIndex,\n\t\t\t\t\t\tnumberOfItems: listState.items.length,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t});\n\t\t},\n\t\t[],\n\t);\n\n\tuseEffect(() => {\n\t\treturn monitorForElements({\n\t\t\tcanMonitor({ source }) {\n\t\t\t\treturn source.data.instance === 'subtasks';\n\t\t\t},\n\t\t\tonDrop({ location, source }) {\n\t\t\t\tconst target = location.current.dropTargets[0];\n\t\t\t\tif (!target) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst items = stableItemsRef.current;\n\n\t\t\t\tconst startIndex = items.findIndex((item) => item.id === source.data.id);\n\t\t\t\tif (startIndex < 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst indexOfTarget = items.findIndex((item) => item.id === target.data.id);\n\t\t\t\tif (indexOfTarget < 0) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst closestEdgeOfTarget = extractClosestEdge(target.data);\n\n\t\t\t\treorderItem({ startIndex, indexOfTarget, closestEdgeOfTarget });\n\t\t\t},\n\t\t});\n\t}, [reorderItem]);\n\n\tconst getItemPosition = useCallback((itemData: ItemData) => {\n\t\tconst items = stableItemsRef.current;\n\n\t\tif (items.length === 1) {\n\t\t\treturn 'only';\n\t\t}\n\n\t\tconst index = items.indexOf(itemData);\n\t\tif (index === 0) {\n\t\t\treturn 'first';\n\t\t}\n\n\t\tif (index === items.length - 1) {\n\t\t\treturn 'last';\n\t\t}\n\n\t\treturn 'middle';\n\t}, []);\n\n\tconst getItemIndex = useCallback(({ id }: { id: string }) => {\n\t\treturn stableItemsRef.current.findIndex((item) => item.id === id);\n\t}, []);\n\n\tconst contextValue = useMemo(() => {\n\t\treturn { getItemIndex, getItemPosition, registerItem, reorderItem };\n\t}, [getItemIndex, getItemPosition, registerItem, reorderItem]);\n\n\treturn (\n\t\t<ListContext.Provider value={contextValue}>\n\t\t\t<Stack xcss={containerStyles}>\n\t\t\t\t{items.map((itemData) => (\n\t\t\t\t\t<ListItem key={itemData.id} itemData={itemData} />\n\t\t\t\t))}\n\t\t\t</Stack>\n\t\t</ListContext.Provider>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/rdr-subtasks/subtask-icon.tsx",
    "content": "import React from 'react';\n\nexport function SubtaskIcon(): React.JSX.Element {\n\treturn (\n\t\t<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t<g clipPath=\"url(#clip0_19_19114)\">\n\t\t\t\t<path\n\t\t\t\t\td=\"M13 1H3C1.89543 1 1 1.89543 1 3V13C1 14.1046 1.89543 15 3 15H13C14.1046 15 15 14.1046 15 13V3C15 1.89543 14.1046 1 13 1Z\"\n\t\t\t\t\tfill=\"#4AADE8\"\n\t\t\t\t/>\n\t\t\t\t<path\n\t\t\t\t\td=\"M13 1H3C1.89543 1 1 1.89543 1 3V13C1 14.1046 1.89543 15 3 15H13C14.1046 15 15 14.1046 15 13V3C15 1.89543 14.1046 1 13 1Z\"\n\t\t\t\t\tfill=\"#4BAEE8\"\n\t\t\t\t/>\n\t\t\t\t<path\n\t\t\t\t\td=\"M4.8 4.5C4.63431 4.5 4.5 4.63431 4.5 4.8V8.2C4.5 8.36569 4.63431 8.5 4.8 8.5H8.2C8.36569 8.5 8.5 8.36569 8.5 8.2V4.8C8.5 4.63431 8.36569 4.5 8.2 4.5H4.8ZM3.5 4.8C3.5 4.08203 4.08203 3.5 4.8 3.5H8.2C8.91797 3.5 9.5 4.08203 9.5 4.8V8.2C9.5 8.91797 8.91797 9.5 8.2 9.5H4.8C4.08203 9.5 3.5 8.91797 3.5 8.2V4.8Z\"\n\t\t\t\t\tfill=\"white\"\n\t\t\t\t/>\n\t\t\t\t<path\n\t\t\t\t\td=\"M11.2 7H7.8C7.35817 7 7 7.35817 7 7.8V11.2C7 11.6418 7.35817 12 7.8 12H11.2C11.6418 12 12 11.6418 12 11.2V7.8C12 7.35817 11.6418 7 11.2 7Z\"\n\t\t\t\t\tfill=\"white\"\n\t\t\t\t/>\n\t\t\t\t<path\n\t\t\t\t\td=\"M7.8 7.5C7.63431 7.5 7.5 7.63431 7.5 7.8V11.2C7.5 11.3657 7.63431 11.5 7.8 11.5H11.2C11.3657 11.5 11.5 11.3657 11.5 11.2V7.8C11.5 7.63431 11.3657 7.5 11.2 7.5H7.8ZM6.5 7.8C6.5 7.08203 7.08203 6.5 7.8 6.5H11.2C11.918 6.5 12.5 7.08203 12.5 7.8V11.2C12.5 11.918 11.918 12.5 11.2 12.5H7.8C7.08203 12.5 6.5 11.918 6.5 11.2V7.8Z\"\n\t\t\t\t\tfill=\"white\"\n\t\t\t\t/>\n\t\t\t</g>\n\t\t\t<defs>\n\t\t\t\t<clipPath id=\"clip0_19_19114\">\n\t\t\t\t\t<rect width=\"14\" height=\"14\" fill=\"white\" transform=\"translate(1 1)\" />\n\t\t\t\t</clipPath>\n\t\t\t</defs>\n\t\t</svg>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/data.tsx",
    "content": "export type DataItem = {\n\tid: string;\n\ttitle: string;\n};\n\nexport const initialData: DataItem[] = [\n\t{ id: 'PROJ-24', title: 'Buy ingredients' },\n\t{ id: 'PROJ-25', title: 'Prepare ingredients' },\n\t{ id: 'PROJ-26', title: 'Mix ingredients' },\n\t{ id: 'PROJ-27', title: 'Cook ingredients' },\n];\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/demo/current-guidelines-a11y-always-visible.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { useRef } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\n\nimport { type DragState, useSortableField } from '../../hooks/use-sortable-field';\nimport { type ReorderItem, useTopLevelWiring } from '../../hooks/use-top-level-wiring';\nimport { MenuButton } from '../../menu-button';\nimport { initialData } from '../data';\nimport { Subtask, type SubtaskAppearance, type SubtaskProps } from '../primitives/subtask';\nimport { SubtaskContainer } from '../primitives/subtask-container';\n\nconst type = 'subtasks--current-guidelines--a11y-always-visible';\n\ntype DraggableSubtaskProps = SubtaskProps & {\n\tindex: number;\n};\n\nconst draggableSubtaskStyles = css({ cursor: 'grab', position: 'relative' });\n\nconst stateToAppearanceMap: Record<DragState, SubtaskAppearance> = {\n\tidle: 'default',\n\tpreview: 'overlay',\n\tdragging: 'disabled',\n};\n\nfunction DraggableSubtask({\n\tindex,\n\tid,\n\treorderItem,\n\tdata,\n\t...subtaskProps\n}: DraggableSubtaskProps & { reorderItem: ReorderItem; data: unknown[] }) {\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tconst { dragState, closestEdge } = useSortableField({\n\t\tid,\n\t\tindex,\n\t\ttype,\n\t\tref,\n\t});\n\n\treturn (\n\t\t<Subtask\n\t\t\tref={ref}\n\t\t\t{...subtaskProps}\n\t\t\tid={id}\n\t\t\tappearance={stateToAppearanceMap[dragState]}\n\t\t\tcss={draggableSubtaskStyles}\n\t\t\telemAfter={\n\t\t\t\t<MenuButton\n\t\t\t\t\tid={id}\n\t\t\t\t\treorderItem={reorderItem}\n\t\t\t\t\tindex={index}\n\t\t\t\t\tdataLength={data.length}\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t/>\n\t\t\t}\n\t\t>\n\t\t\t{closestEdge && <DropIndicator edge={closestEdge} gap=\"1px\" />}\n\t\t</Subtask>\n\t);\n}\n\nexport default function SubtasksCurrentGuidelinesA11yAlwaysVisible(): React.JSX.Element {\n\tconst { data, reorderItem } = useTopLevelWiring({ initialData, type });\n\n\treturn (\n\t\t<SubtaskContainer>\n\t\t\t{data.map((item, index) => (\n\t\t\t\t<DraggableSubtask\n\t\t\t\t\tkey={item.id}\n\t\t\t\t\tid={item.id}\n\t\t\t\t\ttitle={item.title}\n\t\t\t\t\tindex={index}\n\t\t\t\t\treorderItem={reorderItem}\n\t\t\t\t\tdata={data}\n\t\t\t\t/>\n\t\t\t))}\n\t\t</SubtaskContainer>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/demo/current-guidelines-a11y-keyboard-only.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { useRef } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\nimport { token } from '@atlaskit/tokens';\n\nimport { type DragState, useSortableField } from '../../hooks/use-sortable-field';\nimport { type ReorderItem, useTopLevelWiring } from '../../hooks/use-top-level-wiring';\nimport { MenuButton } from '../../menu-button';\nimport { initialData } from '../data';\nimport { Subtask, type SubtaskAppearance, type SubtaskProps } from '../primitives/subtask';\nimport { SubtaskContainer } from '../primitives/subtask-container';\n\nconst type = 'subtasks--current-guidelines--a11y-keyboard-only';\n\ntype DraggableSubtaskProps = SubtaskProps & {\n\tindex: number;\n};\n\nconst draggableSubtaskStyles = css({ cursor: 'grab', position: 'relative' });\n\nconst stateToAppearanceMap: Record<DragState, SubtaskAppearance> = {\n\tidle: 'default',\n\tpreview: 'overlay',\n\tdragging: 'disabled',\n};\n\nconst menuButtonContainerStyles = css({\n\tposition: 'absolute',\n\ttop: 0,\n\tright: 0,\n\tpadding: 8,\n\tpaddingLeft: 24,\n\tclipPath: 'inset(0px 0px 0px -32px)',\n\tmaskImage: 'linear-gradient(to right, transparent, black 16px)',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':focus-within': {\n\t\tbackground: token('elevation.surface'),\n\t},\n});\n\nconst menuButtonContainerSelectedStyles = css({\n\tbackground: token('elevation.surface'),\n});\n\nfunction DraggableSubtask({\n\tindex,\n\tid,\n\treorderItem,\n\tdata,\n\t...subtaskProps\n}: DraggableSubtaskProps & { reorderItem: ReorderItem; data: unknown[] }) {\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tconst { dragState, closestEdge } = useSortableField({\n\t\tid,\n\t\tindex,\n\t\ttype,\n\t\tref,\n\t});\n\n\treturn (\n\t\t<Subtask\n\t\t\tref={ref}\n\t\t\t{...subtaskProps}\n\t\t\tid={id}\n\t\t\tappearance={stateToAppearanceMap[dragState]}\n\t\t\tcss={draggableSubtaskStyles}\n\t\t\telemAfter={\n\t\t\t\t<MenuButton\n\t\t\t\t\tid={id}\n\t\t\t\t\treorderItem={reorderItem}\n\t\t\t\t\tindex={index}\n\t\t\t\t\tdataLength={data.length}\n\t\t\t\t\tsize=\"small\"\n\t\t\t\t\tisOnlyVisibleWhenFocused\n\t\t\t\t>\n\t\t\t\t\t{({ children, isSelected }) => (\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tcss={[menuButtonContainerStyles, isSelected && menuButtonContainerSelectedStyles]}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{children}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t)}\n\t\t\t\t</MenuButton>\n\t\t\t}\n\t\t>\n\t\t\t{closestEdge && <DropIndicator edge={closestEdge} gap=\"1px\" />}\n\t\t</Subtask>\n\t);\n}\n\nexport default function SubtasksCurrentGuidelinesA11yKeyboardOnly(): React.JSX.Element {\n\tconst { data, reorderItem } = useTopLevelWiring({ initialData, type });\n\n\treturn (\n\t\t<SubtaskContainer>\n\t\t\t{data.map((item, index) => (\n\t\t\t\t<DraggableSubtask\n\t\t\t\t\tkey={item.id}\n\t\t\t\t\tid={item.id}\n\t\t\t\t\ttitle={item.title}\n\t\t\t\t\tindex={index}\n\t\t\t\t\treorderItem={reorderItem}\n\t\t\t\t\tdata={data}\n\t\t\t\t/>\n\t\t\t))}\n\t\t</SubtaskContainer>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/demo/current-guidelines.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { useRef } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\n\nimport { type DragState, useSortableField } from '../../hooks/use-sortable-field';\nimport { useTopLevelWiring } from '../../hooks/use-top-level-wiring';\nimport { initialData } from '../data';\nimport { Subtask, type SubtaskAppearance, type SubtaskProps } from '../primitives/subtask';\nimport { SubtaskContainer } from '../primitives/subtask-container';\n\nconst type = 'subtasks--current-guidelines';\n\ntype DraggableSubtaskProps = SubtaskProps & {\n\tindex: number;\n};\n\nconst draggableSubtaskStyles = css({ cursor: 'grab', position: 'relative' });\n\nconst stateToAppearanceMap: Record<DragState, SubtaskAppearance> = {\n\tidle: 'default',\n\tpreview: 'overlay',\n\tdragging: 'disabled',\n};\n\nfunction DraggableSubtask({ index, id, ...subtaskProps }: DraggableSubtaskProps) {\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tconst { dragState, closestEdge } = useSortableField({\n\t\tid,\n\t\tindex,\n\t\ttype,\n\t\tref,\n\t});\n\n\treturn (\n\t\t<Subtask\n\t\t\tref={ref}\n\t\t\t{...subtaskProps}\n\t\t\tid={id}\n\t\t\tappearance={stateToAppearanceMap[dragState]}\n\t\t\tcss={draggableSubtaskStyles}\n\t\t>\n\t\t\t{closestEdge && <DropIndicator edge={closestEdge} gap=\"1px\" />}\n\t\t</Subtask>\n\t);\n}\n\nexport default function SubtaskCurrentGuidelines(): React.JSX.Element {\n\tconst { data } = useTopLevelWiring({ initialData, type });\n\n\treturn (\n\t\t<SubtaskContainer>\n\t\t\t{data.map((item, index) => (\n\t\t\t\t<DraggableSubtask key={item.id} id={item.id} title={item.title} index={index} />\n\t\t\t))}\n\t\t</SubtaskContainer>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/demo/enhancements.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { type ReactNode, useCallback, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport ReactDOM from 'react-dom';\n\nimport DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';\n// eslint-disable-next-line @atlaskit/design-system/no-banned-imports\nimport mergeRefs from '@atlaskit/ds-lib/merge-refs';\nimport { DragHandleButton } from '@atlaskit/pragmatic-drag-and-drop-react-accessibility/drag-handle-button';\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\nimport { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\nimport { token } from '@atlaskit/tokens';\n\nimport { useFlashOnDrop } from '../../hooks/use-flash-on-drop';\nimport { type DragState, useSortableField } from '../../hooks/use-sortable-field';\nimport { type ReorderItem, useTopLevelWiring } from '../../hooks/use-top-level-wiring';\nimport { initialData } from '../data';\nimport { Subtask, type SubtaskAppearance, type SubtaskProps } from '../primitives/subtask';\nimport { SubtaskContainer } from '../primitives/subtask-container';\nimport { SubtaskObjectIcon } from '../primitives/subtask-icon';\n\nconst type = 'subtasks--enhanced';\n\nconst draggableSubtaskPreviewStyles = css({\n\tbackground: token('elevation.surface.overlay'),\n\tboxShadow: token('elevation.shadow.overlay'),\n\tborderRadius: 3,\n\tpadding: 8,\n\tdisplay: 'grid',\n\tgridTemplateColumns: 'auto 1fr',\n\tgap: 8,\n\talignItems: 'center',\n});\n\nfunction DraggableSubtaskPreview({ children }: { children: ReactNode }) {\n\treturn (\n\t\t<div css={draggableSubtaskPreviewStyles}>\n\t\t\t<SubtaskObjectIcon />\n\t\t\t<div>{children}</div>\n\t\t</div>\n\t);\n}\n\ntype DraggableSubtaskProps = SubtaskProps & {\n\tindex: number;\n\tdata: unknown[];\n\treorderItem: ReorderItem;\n};\n\nconst draggableSubtaskStyles = css({ position: 'relative' });\n\nconst stateToAppearanceMap: Record<DragState, SubtaskAppearance> = {\n\tidle: 'default',\n\tpreview: 'overlay',\n\tdragging: 'disabled',\n};\n\n/**\n * The styles used for the element before here are not suitable for production\n * use for multiple reasons, including:\n *\n * - Use of magic values for positioning.\n * - Use of `:has()` selector which is not fully supported.\n *\n * This is just for demonstration purposes.\n */\nconst elementBeforeStyles = css({\n\tposition: 'absolute',\n\ttop: 0,\n\tleft: 0,\n\t'--button-opacity': 0,\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':has(:focus-visible), :has([aria-expanded=\"true\"])': {\n\t\t'--button-opacity': 1,\n\t},\n});\n\nconst elementBeforeButtonVisibleStyles = css({ '--button-opacity': 1 });\nconst elementBeforeButtonHiddenStyles = css({ '--button-opacity': 0 });\n\nconst elementBeforeIconContainerStyles = css({\n\tposition: 'absolute',\n\ttop: 12,\n\tleft: 8,\n\topacity: 'calc(1 - var(--button-opacity))',\n});\n\nconst elementBeforeButtonContainerStyles = css({\n\tposition: 'absolute',\n\ttop: 8,\n\tleft: 4,\n\topacity: 'var(--button-opacity)',\n});\n\nfunction DraggableSubtask({\n\tindex,\n\tid,\n\tdata,\n\treorderItem,\n\t...subtaskProps\n}: DraggableSubtaskProps) {\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst [dragHandle, setDragHandle] = useState<HTMLElement | null>(null);\n\n\tconst { dragState, isHovering, closestEdge } = useSortableField({\n\t\tid,\n\t\tindex,\n\t\ttype,\n\t\tref,\n\t\tdragHandle,\n\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\treturn setCustomNativeDragPreview({\n\t\t\t\tnativeSetDragImage,\n\t\t\t\tgetOffset: pointerOutsideOfPreview({\n\t\t\t\t\tx: '16px',\n\t\t\t\t\ty: '8px',\n\t\t\t\t}),\n\t\t\t\trender({ container }) {\n\t\t\t\t\tReactDOM.render(\n\t\t\t\t\t\t<DraggableSubtaskPreview>{subtaskProps.title}</DraggableSubtaskPreview>,\n\t\t\t\t\t\tcontainer,\n\t\t\t\t\t);\n\t\t\t\t\treturn () => {\n\t\t\t\t\t\tReactDOM.unmountComponentAtNode(container);\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t});\n\t\t},\n\t});\n\n\tuseFlashOnDrop({ ref, draggableId: id, type });\n\n\tconst moveUp = useCallback(() => {\n\t\treorderItem({ id, action: 'up' });\n\t}, [id, reorderItem]);\n\n\tconst moveDown = useCallback(() => {\n\t\treorderItem({ id, action: 'down' });\n\t}, [id, reorderItem]);\n\n\tconst isMoveUpDisabled = index === 0;\n\tconst isMoveDownDisabled = index === data.length - 1;\n\n\treturn (\n\t\t<Subtask\n\t\t\tref={ref}\n\t\t\t{...subtaskProps}\n\t\t\tid={id}\n\t\t\tappearance={stateToAppearanceMap[dragState]}\n\t\t\tcss={draggableSubtaskStyles}\n\t\t\tisIconHidden\n\t\t>\n\t\t\t<span\n\t\t\t\tcss={[\n\t\t\t\t\telementBeforeStyles,\n\t\t\t\t\tisHovering && elementBeforeButtonVisibleStyles,\n\t\t\t\t\tdragState === 'dragging' && elementBeforeButtonHiddenStyles,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t<span css={elementBeforeIconContainerStyles}>\n\t\t\t\t\t<SubtaskObjectIcon />\n\t\t\t\t</span>\n\t\t\t\t<span css={elementBeforeButtonContainerStyles}>\n\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\ttrigger={({ triggerRef, ...triggerProps }) => (\n\t\t\t\t\t\t\t<DragHandleButton\n\t\t\t\t\t\t\t\tref={mergeRefs([setDragHandle, triggerRef])}\n\t\t\t\t\t\t\t\t{...triggerProps}\n\t\t\t\t\t\t\t\tlabel=\"reorder\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t)}\n\t\t\t\t\t>\n\t\t\t\t\t\t<DropdownItemGroup>\n\t\t\t\t\t\t\t<DropdownItem onClick={moveUp} isDisabled={isMoveUpDisabled}>\n\t\t\t\t\t\t\t\tMove up\n\t\t\t\t\t\t\t</DropdownItem>\n\t\t\t\t\t\t\t<DropdownItem onClick={moveDown} isDisabled={isMoveDownDisabled}>\n\t\t\t\t\t\t\t\tMove down\n\t\t\t\t\t\t\t</DropdownItem>\n\t\t\t\t\t\t</DropdownItemGroup>\n\t\t\t\t\t</DropdownMenu>\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t\t{closestEdge && <DropIndicator edge={closestEdge} gap=\"1px\" />}\n\t\t</Subtask>\n\t);\n}\n\nexport default function SubtaskEnhanced(): React.JSX.Element {\n\tconst { data, reorderItem } = useTopLevelWiring({ initialData, type });\n\n\treturn (\n\t\t<SubtaskContainer>\n\t\t\t{data.map((item, index) => (\n\t\t\t\t<DraggableSubtask\n\t\t\t\t\tkey={item.id}\n\t\t\t\t\tid={item.id}\n\t\t\t\t\ttitle={item.title}\n\t\t\t\t\tindex={index}\n\t\t\t\t\tdata={data}\n\t\t\t\t\treorderItem={reorderItem}\n\t\t\t\t/>\n\t\t\t))}\n\t\t</SubtaskContainer>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/demo/linear-native-preview.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { type RefObject, useRef } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport ReactDOM from 'react-dom';\n\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\n\nimport { useFlashOnDrop } from '../../hooks/use-flash-on-drop';\nimport { type DragState, useSortableField } from '../../hooks/use-sortable-field';\nimport {\n\tSubtask,\n\ttype SubtaskAppearance,\n\tSubtaskPreview,\n\ttype SubtaskProps,\n} from '../primitives/linear/subtask';\nimport { type DraggableSubtaskProps } from '../templates/_base';\nimport { LinearTemplate } from '../templates/linear';\n\nconst type = 'subtasks--linear-clone--native-preview';\n\nconst draggableSubtaskStyles = css({ cursor: 'grab', position: 'relative' });\n\nconst stateToAppearanceMap: Record<DragState, SubtaskAppearance> = {\n\tidle: 'default',\n\tpreview: 'overlay',\n\tdragging: 'disabled',\n};\n\nfunction DragPreview({\n\tsubtaskRef,\n\tchildren,\n\t...props\n}: SubtaskProps & { subtaskRef: RefObject<HTMLElement> }) {\n\treturn <SubtaskPreview {...props}>{children}</SubtaskPreview>;\n}\n\nfunction DraggableSubtask({ index, item }: DraggableSubtaskProps) {\n\tconst { id, title } = item;\n\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tconst { dragState, isHovering, closestEdge } = useSortableField({\n\t\tid,\n\t\tindex,\n\t\ttype,\n\t\tref,\n\t\tisSticky: false,\n\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\treturn setCustomNativeDragPreview({\n\t\t\t\tnativeSetDragImage,\n\t\t\t\trender({ container }) {\n\t\t\t\t\tReactDOM.render(<DragPreview subtaskRef={ref} id={id} title={title} />, container);\n\t\t\t\t\treturn () => ReactDOM.unmountComponentAtNode(container);\n\t\t\t\t},\n\t\t\t\tgetOffset() {\n\t\t\t\t\treturn { x: 16, y: 16 };\n\t\t\t\t},\n\t\t\t});\n\t\t},\n\t});\n\n\tuseFlashOnDrop({ ref, draggableId: id, type });\n\n\treturn (\n\t\t<Subtask\n\t\t\tref={ref}\n\t\t\tid={id}\n\t\t\ttitle={title}\n\t\t\tappearance={stateToAppearanceMap[dragState]}\n\t\t\tisHovering={isHovering && dragState === 'idle'}\n\t\t\tcss={draggableSubtaskStyles}\n\t\t>\n\t\t\t{closestEdge && <DropIndicator edge={closestEdge} gap=\"1px\" />}\n\t\t</Subtask>\n\t);\n}\n\nexport default function LinearTaskReorderingNativePreview(): React.JSX.Element {\n\treturn <LinearTemplate instanceId={type} DraggableSubtask={DraggableSubtask} />;\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/demo/linear.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { Fragment, type RefObject, useEffect, useRef } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport type { DragLocationHistory } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport { useFlashOnDrop } from '../../hooks/use-flash-on-drop';\nimport { type DragState, useSortableField } from '../../hooks/use-sortable-field';\nimport {\n\tsubtaskGap,\n\tsubtaskIconWidth,\n\tsubtaskIdWidth,\n\tsubtaskInlinePadding,\n} from '../primitives/linear/constants';\nimport {\n\tSubtask,\n\ttype SubtaskAppearance,\n\tSubtaskPreview,\n\ttype SubtaskProps,\n} from '../primitives/linear/subtask';\nimport { type DraggableSubtaskProps } from '../templates/_base';\nimport { LinearTemplate } from '../templates/linear';\n\nconst type = 'subtasks--linear-clone';\n\nconst draggableSubtaskStyles = css({ cursor: 'grab', position: 'relative' });\n\nconst stateToAppearanceMap: Record<DragState, SubtaskAppearance> = {\n\tidle: 'default',\n\tpreview: 'overlay',\n\tdragging: 'disabled',\n};\n\nfunction DragPreview({\n\tsubtaskRef,\n\tchildren,\n\t...props\n}: SubtaskProps & { subtaskRef: RefObject<HTMLElement> }) {\n\tconst previewRef = useRef<HTMLDivElement>(null);\n\n\tuseEffect(() => {\n\t\tconst previewElement = previewRef.current;\n\t\tinvariant(previewElement);\n\n\t\tconst fieldElement = subtaskRef.current;\n\t\tinvariant(fieldElement);\n\n\t\tconst initialFieldRect = fieldElement.getBoundingClientRect();\n\n\t\tfunction getAdjustment(location: DragLocationHistory) {\n\t\t\tconst cursorAdjustment = {\n\t\t\t\tx: initialFieldRect.x - location.initial.input.clientX,\n\t\t\t\ty: initialFieldRect.y - location.initial.input.clientY,\n\t\t\t};\n\n\t\t\tconst initialAdjustment = {\n\t\t\t\tx:\n\t\t\t\t\tcursorAdjustment.x +\n\t\t\t\t\t/**\n\t\t\t\t\t * Essentially calculating the offset of the status icon inside the\n\t\t\t\t\t * subtask.\n\t\t\t\t\t */\n\t\t\t\t\tsubtaskInlinePadding +\n\t\t\t\t\tsubtaskIconWidth +\n\t\t\t\t\tsubtaskGap +\n\t\t\t\t\tsubtaskIdWidth,\n\t\t\t\ty: cursorAdjustment.y + 4,\n\t\t\t};\n\n\t\t\tinvariant(previewElement);\n\t\t\tconst previewRect = previewElement.getBoundingClientRect();\n\t\t\tconst initialOffset = {\n\t\t\t\tx: location.initial.input.clientX + initialAdjustment.x,\n\t\t\t\ty: location.initial.input.clientY + initialAdjustment.y,\n\t\t\t};\n\n\t\t\tlet initialXFromPreview =\n\t\t\t\tlocation.initial.input.clientX - (initialOffset.x + previewRect.width / 2);\n\n\t\t\tif (Math.abs(initialXFromPreview) < previewRect.width / 2) {\n\t\t\t\t// If already inside the preview we don't need to shift it\n\t\t\t\tinitialXFromPreview = 0;\n\t\t\t} else if (initialXFromPreview > 0) {\n\t\t\t\t// Adjust so it shifts to the edge not the centre\n\t\t\t\tinitialXFromPreview -= previewRect.width / 2 - 8;\n\t\t\t} else if (initialXFromPreview < 0) {\n\t\t\t\t// Adjust so it shifts to the edge not the centre\n\t\t\t\tinitialXFromPreview += previewRect.width / 2 - 8;\n\t\t\t}\n\n\t\t\tlet initialYFromPreview =\n\t\t\t\tlocation.initial.input.clientY - (initialOffset.y + previewRect.height / 2);\n\n\t\t\tif (Math.abs(initialYFromPreview) < previewRect.height / 2) {\n\t\t\t\t// If already inside the preview we don't need to shift it\n\t\t\t\tinitialYFromPreview = 0;\n\t\t\t} else if (initialYFromPreview > 0) {\n\t\t\t\t// Adjust so it shifts to the edge not the centre\n\t\t\t\tinitialYFromPreview -= previewRect.height / 2 - 8;\n\t\t\t} else if (initialYFromPreview < 0) {\n\t\t\t\t// Adjust so it shifts to the edge not the centre\n\t\t\t\tinitialYFromPreview += previewRect.height / 2 - 8;\n\t\t\t}\n\n\t\t\tconst targetAdjustment = {\n\t\t\t\tx: initialAdjustment.x + initialXFromPreview,\n\t\t\t\ty: initialAdjustment.y + initialYFromPreview,\n\t\t\t};\n\n\t\t\treturn { initialAdjustment, targetAdjustment };\n\t\t}\n\n\t\tlet isFirstTick = true;\n\n\t\treturn monitorForElements({\n\t\t\tonDrag({ location }) {\n\t\t\t\tconst { current } = location;\n\n\t\t\t\tconst offsetX = current.input.clientX;\n\t\t\t\tconst offsetY = current.input.clientY;\n\n\t\t\t\tpreviewElement.style.setProperty('--offset-x', `${offsetX}px`);\n\t\t\t\tpreviewElement.style.setProperty('--offset-y', `${offsetY}px`);\n\n\t\t\t\tif (isFirstTick) {\n\t\t\t\t\tisFirstTick = false;\n\n\t\t\t\t\tconst { initialAdjustment, targetAdjustment } = getAdjustment(location);\n\n\t\t\t\t\tObject.assign(previewElement.style, {\n\t\t\t\t\t\ttransform: `translate(${offsetX + initialAdjustment.x}px, ${\n\t\t\t\t\t\t\toffsetY + initialAdjustment.y\n\t\t\t\t\t\t}px)`,\n\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t});\n\n\t\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\t\tObject.assign(previewElement.style, {\n\t\t\t\t\t\t\ttransform: `translate(calc(var(--offset-x) + ${targetAdjustment.x}px), calc(var(--offset-y) + ${targetAdjustment.y}px))`,\n\t\t\t\t\t\t\ttransition: 'transform 33ms',\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t},\n\t\t});\n\t}, [subtaskRef]);\n\n\treturn (\n\t\t<div\n\t\t\tref={previewRef}\n\t\t\tstyle={{\n\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\tposition: 'fixed',\n\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\ttop: 0,\n\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\tleft: 0,\n\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\topacity: 0,\n\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\tpointerEvents: 'none',\n\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\tzIndex: 999,\n\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\twillChange: 'transform',\n\t\t\t}}\n\t\t>\n\t\t\t<SubtaskPreview {...props}>{children}</SubtaskPreview>\n\t\t</div>\n\t);\n}\n\nfunction DraggableSubtask({ index, item }: DraggableSubtaskProps) {\n\tconst { id, title } = item;\n\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tconst { dragState, isHovering, closestEdge } = useSortableField({\n\t\tid,\n\t\tindex,\n\t\ttype,\n\t\tref,\n\t\tisSticky: false,\n\t\tshouldHideNativeDragPreview: true,\n\t});\n\n\tuseFlashOnDrop({ ref, draggableId: id, type });\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<Subtask\n\t\t\t\tref={ref}\n\t\t\t\ttitle={title}\n\t\t\t\tid={id}\n\t\t\t\tappearance={stateToAppearanceMap[dragState]}\n\t\t\t\tisHovering={isHovering && dragState === 'idle'}\n\t\t\t\tcss={draggableSubtaskStyles}\n\t\t\t>\n\t\t\t\t{closestEdge && <DropIndicator edge={closestEdge} gap=\"1px\" />}\n\t\t\t</Subtask>\n\t\t\t{dragState === 'dragging' && <DragPreview subtaskRef={ref} id={id} title={title} />}\n\t\t</Fragment>\n\t);\n}\n\nexport default function LinearTaskReordering(): React.JSX.Element {\n\treturn <LinearTemplate instanceId={type} DraggableSubtask={DraggableSubtask} />;\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/demo/migration-layer.tsx",
    "content": "import React, { useCallback, useState } from 'react';\n\nimport {\n\tDragDropContext,\n\tDraggable,\n\tDroppable,\n\ttype OnDragEndResponder,\n} from '@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration';\nimport { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';\n\nimport { initialData } from '../data';\nimport { Subtask, type SubtaskProps } from '../primitives/subtask';\nimport { SubtaskContainer } from '../primitives/subtask-container';\n\ntype DraggableSubtaskProps = SubtaskProps & {\n\tindex: number;\n};\n\nfunction DraggableSubtask({ index, ...subtaskProps }: DraggableSubtaskProps) {\n\t/**\n\t * Using unique id's to avoid collisions with rbd items on the page.\n\t * If there are collisions then rbd will try to control the items.\n\t */\n\tconst draggableId = `migration-layer--${subtaskProps.id}`;\n\treturn (\n\t\t<Draggable draggableId={draggableId} index={index}>\n\t\t\t{(provided, snapshot) => (\n\t\t\t\t<Subtask\n\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t{...subtaskProps}\n\t\t\t\t\tappearance={snapshot.isDragging ? 'overlay' : 'default'}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</Draggable>\n\t);\n}\n\nexport default function SubtasksMigrationLayer(): React.JSX.Element {\n\tconst [data, setData] = useState(initialData);\n\n\tconst onDragEnd: OnDragEndResponder = useCallback(({ source, destination }) => {\n\t\tif (!destination) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst startIndex = source.index;\n\t\tconst finishIndex = destination.index;\n\n\t\tsetData((data) =>\n\t\t\treorder({\n\t\t\t\tlist: data,\n\t\t\t\tstartIndex,\n\t\t\t\tfinishIndex,\n\t\t\t}),\n\t\t);\n\t}, []);\n\n\treturn (\n\t\t<DragDropContext onDragEnd={onDragEnd}>\n\t\t\t<Droppable droppableId=\"migration-layer--droppable\">\n\t\t\t\t{(provided) => (\n\t\t\t\t\t<SubtaskContainer ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t\t{data.map((item, index) => (\n\t\t\t\t\t\t\t<DraggableSubtask\n\t\t\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\t\t\tid={item.id}\n\t\t\t\t\t\t\t\ttitle={item.title}\n\t\t\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\t\t\tisLastItem={index === data.length - 1}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t))}\n\t\t\t\t\t\t{provided.placeholder}\n\t\t\t\t\t</SubtaskContainer>\n\t\t\t\t)}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/demo/notion.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport React, { useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport { type DragState, useSortableField } from '../../hooks/use-sortable-field';\nimport { useTopLevelWiring } from '../../hooks/use-top-level-wiring';\nimport { initialData } from '../data';\nimport { DropIndicator } from '../primitives/notion/drop-indicator';\nimport { Subtask, type SubtaskAppearance, type SubtaskProps } from '../primitives/notion/subtask';\nimport { SubtaskContainer } from '../primitives/notion/subtask-container';\n\nconst type = 'subtasks--notion';\n\ntype DraggableSubtaskProps = Omit<SubtaskProps, 'dragState'> & {\n\tindex: number;\n};\n\nconst draggableSubtaskStyles = css({ position: 'relative' });\n\nconst stateToAppearanceMap: Record<DragState, SubtaskAppearance> = {\n\tidle: 'default',\n\tpreview: 'overlay',\n\tdragging: 'disabled',\n};\n\nfunction DraggableSubtask({ index, id, ...subtaskProps }: DraggableSubtaskProps) {\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tconst [dragHandle, setDragHandle] = useState<HTMLDivElement | null>(null);\n\n\tconst { dragState, isHovering, closestEdge } = useSortableField({\n\t\tid,\n\t\tindex,\n\t\ttype,\n\t\tref,\n\t\tdragHandle,\n\t\tshouldHideDropIndicatorForNoopTargets: false,\n\t});\n\n\treturn (\n\t\t<Subtask\n\t\t\tref={ref}\n\t\t\t{...subtaskProps}\n\t\t\tid={id}\n\t\t\tappearance={stateToAppearanceMap[dragState]}\n\t\t\tdragState={dragState}\n\t\t\tcss={draggableSubtaskStyles}\n\t\t\tisHovering={isHovering}\n\t\t\tdragHandleRef={setDragHandle}\n\t\t>\n\t\t\t{closestEdge && <DropIndicator edge={closestEdge} gap=\"1px\" />}\n\t\t</Subtask>\n\t);\n}\n\nexport default function SubtasksNotion(): React.JSX.Element {\n\tconst { data } = useTopLevelWiring({ initialData, type });\n\n\treturn (\n\t\t<SubtaskContainer>\n\t\t\t{data.map((item, index) => (\n\t\t\t\t<DraggableSubtask key={item.id} id={item.id} title={item.title} index={index} />\n\t\t\t))}\n\t\t</SubtaskContainer>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/demo/react-beautiful-dnd.tsx",
    "content": "import React, { useCallback, useState } from 'react';\n\nimport {\n\tDragDropContext,\n\tDraggable,\n\tDroppable,\n\ttype OnDragEndResponder,\n} from 'react-beautiful-dnd';\n\nimport { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';\n\nimport { initialData } from '../data';\nimport { Subtask, type SubtaskProps } from '../primitives/subtask';\nimport { SubtaskContainer } from '../primitives/subtask-container';\n\ntype DraggableSubtaskProps = SubtaskProps & {\n\tindex: number;\n};\n\nfunction DraggableSubtask({ index, ...subtaskProps }: DraggableSubtaskProps) {\n\treturn (\n\t\t<Draggable draggableId={subtaskProps.id} index={index}>\n\t\t\t{(provided, snapshot) => (\n\t\t\t\t<Subtask\n\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t{...subtaskProps}\n\t\t\t\t\tappearance={snapshot.isDragging ? 'overlay' : 'default'}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</Draggable>\n\t);\n}\n\nexport default function SubtaskReactBeautifulDnd(): React.JSX.Element {\n\tconst [data, setData] = useState(initialData);\n\n\tconst onDragEnd: OnDragEndResponder = useCallback(({ source, destination }) => {\n\t\tif (!destination) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst startIndex = source.index;\n\t\tconst finishIndex = destination.index;\n\n\t\tsetData((data) =>\n\t\t\treorder({\n\t\t\t\tlist: data,\n\t\t\t\tstartIndex,\n\t\t\t\tfinishIndex,\n\t\t\t}),\n\t\t);\n\t}, []);\n\n\treturn (\n\t\t<DragDropContext onDragEnd={onDragEnd}>\n\t\t\t<Droppable droppableId=\"droppable\">\n\t\t\t\t{(provided) => (\n\t\t\t\t\t<SubtaskContainer\n\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\thasContainerPadding\n\t\t\t\t\t\t{...provided.droppableProps}\n\t\t\t\t\t>\n\t\t\t\t\t\t{data.map((item, index) => (\n\t\t\t\t\t\t\t<DraggableSubtask\n\t\t\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\t\t\tid={item.id}\n\t\t\t\t\t\t\t\ttitle={item.title}\n\t\t\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\t\t\tisLastItem={index === data.length - 1}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t))}\n\t\t\t\t\t\t{provided.placeholder}\n\t\t\t\t\t</SubtaskContainer>\n\t\t\t\t)}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/hooks/use-sortable-field.tsx",
    "content": "import { type RefObject, useEffect, useState } from 'react';\n\nimport { bindAll } from 'bind-event-listener';\nimport invariant from 'tiny-invariant';\n\nimport {\n\tattachClosestEdge,\n\ttype Edge,\n\textractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { disableNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview';\n\ntype UseSortableFieldArgs = {\n\tid: string;\n\tindex: number;\n\ttype: string;\n\tref: RefObject<HTMLElement>;\n\n\tshouldHideNativeDragPreview?: boolean;\n\n\t/**\n\t * Used for the Asana clone.\n\t */\n\tshouldHideDropIndicatorForNoopTargets?: boolean;\n\tisSticky?: boolean;\n};\n\nfunction shouldHideDropIndicator({\n\tclosestEdge,\n\tsourceIndex,\n\ttargetIndex,\n}: {\n\tclosestEdge: Edge | null;\n\tsourceIndex: number;\n\ttargetIndex: number;\n}) {\n\tconst isTargetingSelf = sourceIndex === targetIndex;\n\tconst isTargetingBottomOfPrevious = closestEdge === 'bottom' && targetIndex === sourceIndex - 1;\n\tconst isTargetingTopOfNext = closestEdge === 'top' && targetIndex === sourceIndex + 1;\n\n\treturn isTargetingSelf || isTargetingBottomOfPrevious || isTargetingTopOfNext;\n}\n\nexport type DragState = 'idle' | 'preview' | 'dragging';\n\nexport function useSortableField({\n\tid,\n\tindex,\n\ttype,\n\tref,\n\tshouldHideNativeDragPreview = false,\n\tshouldHideDropIndicatorForNoopTargets = true,\n\tisSticky = true,\n}: UseSortableFieldArgs) {\n\tconst [isHovering, setIsHovering] = useState(false);\n\tconst [dragState, setDragState] = useState<DragState>('idle');\n\tconst [closestEdge, setClosestEdge] = useState<Edge | null>(null);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tif (!element) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst data = { id, index, type };\n\n\t\treturn combine(\n\t\t\tbindAll(element, [\n\t\t\t\t{\n\t\t\t\t\ttype: 'pointerenter',\n\t\t\t\t\tlistener() {\n\t\t\t\t\t\tsetIsHovering(true);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttype: 'pointerleave',\n\t\t\t\t\tlistener() {\n\t\t\t\t\t\tsetIsHovering(false);\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t]),\n\t\t\tdraggable({\n\t\t\t\telement,\n\t\t\t\tgetInitialData() {\n\t\t\t\t\treturn data;\n\t\t\t\t},\n\t\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\t\tif (shouldHideNativeDragPreview) {\n\t\t\t\t\t\tdisableNativeDragPreview({ nativeSetDragImage });\n\t\t\t\t\t}\n\t\t\t\t\tsetDragState('preview');\n\t\t\t\t},\n\t\t\t\tonDragStart() {\n\t\t\t\t\tsetDragState('dragging');\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tsetDragState('idle');\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement,\n\t\t\t\tgetIsSticky() {\n\t\t\t\t\treturn isSticky;\n\t\t\t\t},\n\t\t\t\tcanDrop({ source }) {\n\t\t\t\t\treturn source.data.type === type;\n\t\t\t\t},\n\t\t\t\tgetData({ input }) {\n\t\t\t\t\treturn attachClosestEdge(data, {\n\t\t\t\t\t\telement,\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tallowedEdges: ['top', 'bottom'],\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDrag({ self, source }) {\n\t\t\t\t\tconst closestEdge = extractClosestEdge(self.data);\n\t\t\t\t\tconst sourceIndex = source.data.index;\n\t\t\t\t\tinvariant(typeof sourceIndex === 'number');\n\n\t\t\t\t\tif (\n\t\t\t\t\t\tshouldHideDropIndicatorForNoopTargets &&\n\t\t\t\t\t\tshouldHideDropIndicator({\n\t\t\t\t\t\t\tclosestEdge,\n\t\t\t\t\t\t\tsourceIndex,\n\t\t\t\t\t\t\ttargetIndex: index,\n\t\t\t\t\t\t})\n\t\t\t\t\t) {\n\t\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetClosestEdge(closestEdge);\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonDragLeave() {\n\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tsetClosestEdge(null);\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [\n\t\tid,\n\t\tindex,\n\t\tisSticky,\n\t\tref,\n\t\tshouldHideDropIndicatorForNoopTargets,\n\t\tshouldHideNativeDragPreview,\n\t\ttype,\n\t]);\n\n\treturn { isHovering, dragState, closestEdge };\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/hooks/use-top-level-wiring.tsx",
    "content": "import { useCallback, useEffect, useState } from 'react';\n\nimport invariant from 'tiny-invariant';\n\nimport { extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { reorderWithEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/reorder-with-edge';\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { preventUnhandled } from '@atlaskit/pragmatic-drag-and-drop/prevent-unhandled';\nimport { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';\n\ntype UseToplevelWiringArgs<DataItem> = {\n\tinitialData: DataItem[];\n\ttype: string;\n\n\t/**\n\t * Disabled for the Asana clone.\n\t */\n\tshouldPreventUnhandled?: boolean;\n};\n\nexport type ReorderItem = (args: { id: string; action: 'up' | 'down' }) => void;\n\n/**\n * This hook combines a couple of things which makes it hard to give it a\n * more descriptive name:\n *\n * - Initializes the data\n * - Monitors drops to reorder the data on drops\n * - Cancels unhandled drops\n */\nexport function useTopLevelWiring<DataItem extends { id: string }>({\n\tinitialData,\n\ttype,\n\tshouldPreventUnhandled = true,\n}: UseToplevelWiringArgs<DataItem>): {\n\tdata: DataItem[];\n\treorderItem: ReorderItem;\n} {\n\tconst [data, setData] = useState(initialData);\n\n\tuseEffect(() => {\n\t\treturn monitorForElements({\n\t\t\tonDragStart: ({ source }) => {\n\t\t\t\tif (source.data.type !== type) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (shouldPreventUnhandled) {\n\t\t\t\t\tpreventUnhandled.start();\n\t\t\t\t}\n\t\t\t},\n\t\t\tonDrop: ({ location, source }) => {\n\t\t\t\tif (source.data.type !== type) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (shouldPreventUnhandled) {\n\t\t\t\t\tpreventUnhandled.stop();\n\t\t\t\t}\n\n\t\t\t\tconst destination = location.current.dropTargets[0];\n\t\t\t\tif (!destination) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tif (destination.data.type !== source.data.type) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst startIndex = source.data.index;\n\t\t\t\tinvariant(typeof startIndex === 'number');\n\n\t\t\t\tconst indexOfTarget = destination.data.index;\n\t\t\t\tinvariant(typeof indexOfTarget === 'number');\n\n\t\t\t\tsetData((data) =>\n\t\t\t\t\treorderWithEdge({\n\t\t\t\t\t\tlist: data,\n\t\t\t\t\t\tclosestEdgeOfTarget: extractClosestEdge(destination.data),\n\t\t\t\t\t\tstartIndex,\n\t\t\t\t\t\tindexOfTarget,\n\t\t\t\t\t\taxis: 'vertical',\n\t\t\t\t\t}),\n\t\t\t\t);\n\n\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\t/**\n\t\t\t\t\t * Dispatching an event for simplicity. In a real app we might not\n\t\t\t\t\t * want to do it this way.\n\t\t\t\t\t */\n\t\t\t\t\twindow.dispatchEvent(\n\t\t\t\t\t\tnew CustomEvent('afterdrop', {\n\t\t\t\t\t\t\tdetail: { id: source.data.id, type },\n\t\t\t\t\t\t}),\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\t}, [shouldPreventUnhandled, type]);\n\n\tconst reorderItem: ReorderItem = useCallback(({ id, action }) => {\n\t\tsetData((data) => {\n\t\t\tconst index = data.findIndex((item) => item.id === id);\n\t\t\treturn reorder({\n\t\t\t\tlist: data,\n\t\t\t\tstartIndex: index,\n\t\t\t\tfinishIndex: action === 'up' ? index - 1 : index + 1,\n\t\t\t});\n\t\t});\n\t}, []);\n\n\treturn { data, reorderItem };\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/primitives/linear/constants.tsx",
    "content": "export const subtaskIdWidth = 52;\nexport const subtaskIconWidth = 16;\nexport const subtaskInlinePadding = 32;\nexport const subtaskGap = 8;\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/primitives/linear/in-progress-icon.tsx",
    "content": "import React from 'react';\n\nimport { token } from '@atlaskit/tokens';\n\nexport function LinearInProgressIcon(): React.JSX.Element {\n\treturn (\n\t\t<svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\" aria-label=\"In Progress\">\n\t\t\t<rect\n\t\t\t\tx=\"1\"\n\t\t\t\ty=\"1\"\n\t\t\t\twidth=\"12\"\n\t\t\t\theight=\"12\"\n\t\t\t\trx=\"6\"\n\t\t\t\tstroke={token('color.icon.warning', 'none')}\n\t\t\t\tstrokeWidth=\"2\"\n\t\t\t\tfill=\"none\"\n\t\t\t></rect>\n\t\t\t<path\n\t\t\t\tfill={token('color.icon.warning', 'none')}\n\t\t\t\tstroke=\"none\"\n\t\t\t\td=\"M 3.5,3.5 L3.5,0 A3.5,3.5 0 0,1 3.5, 7 z\"\n\t\t\t\ttransform=\"translate(3.5,3.5)\"\n\t\t\t></path>\n\t\t</svg>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/primitives/linear/priority-icon.tsx",
    "content": "import React from 'react';\n\nexport function LinearPriorityIcon({\n\tcolor = 'currentColor',\n}: {\n\tcolor?: string;\n}): React.JSX.Element {\n\treturn (\n\t\t<svg fill={color} width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" aria-label=\"High Priority\">\n\t\t\t<rect x=\"1\" y=\"8\" width=\"3\" height=\"6\" rx=\"1\"></rect>\n\t\t\t<rect x=\"6\" y=\"5\" width=\"3\" height=\"9\" rx=\"1\"></rect>\n\t\t\t<rect x=\"11\" y=\"2\" width=\"3\" height=\"12\" rx=\"1\"></rect>\n\t\t</svg>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/primitives/linear/subtask-container.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport { token } from '@atlaskit/tokens';\n\nconst subtaskContainerStyles = css({\n\t// for parent placement\n\tflexGrow: 1,\n\tflexBasis: 0,\n\tbackground: token('elevation.surface'),\n\tborder: `${token('border.width')} solid ${token('color.border')}`,\n\tmaxWidth: 560,\n});\n\ntype SubtaskContainerProps = HTMLAttributes<HTMLDivElement> & {\n\tchildren: ReactNode;\n};\n\nexport const SubtaskContainer = forwardRef<HTMLDivElement, SubtaskContainerProps>(\n\tfunction SubtaskContainer({ children, ...props }, ref) {\n\t\treturn (\n\t\t\t<div ref={ref} css={subtaskContainerStyles} {...props}>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t},\n);\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/primitives/linear/subtask.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx, type SerializedStyles } from '@emotion/react';\n\nimport Avatar from '@atlaskit/avatar';\nimport DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';\nimport { token } from '@atlaskit/tokens';\n\nimport { subtaskGap, subtaskIdWidth, subtaskInlinePadding } from './constants';\nimport { LinearInProgressIcon } from './in-progress-icon';\nimport { LinearPriorityIcon } from './priority-icon';\n\nconst subtaskStyles = css({\n\tbackground: token('color.background.neutral.subtle'),\n\theight: 44,\n\tposition: 'relative',\n\tboxSizing: 'border-box',\n\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':not(:last-child)': {\n\t\tborderBottom: `${token('border.width')} solid ${token('color.border')}`,\n\t},\n});\n\nconst subtaskInnerStyles = css({\n\tdisplay: 'grid',\n\theight: '100%',\n\tgridTemplateColumns: 'auto 1fr auto',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766\n\tpadding: `0px ${subtaskInlinePadding}px`,\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766\n\tgap: subtaskGap,\n\talignItems: 'center',\n});\n\nconst subtaskIdStyles = css({\n\tcolor: token('color.text.subtlest'),\n\tfontSize: 12,\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766\n\twidth: subtaskIdWidth,\n\ttextAlign: 'center',\n});\n\nconst subtaskTimeStyles = css({\n\tcolor: token('color.text.subtlest'),\n\tfontSize: 12,\n});\n\nconst subtaskGroupStyles = css({\n\tdisplay: 'flex',\n\talignItems: 'center',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766\n\tgap: subtaskGap,\n});\n\nfunction SubtaskGroup({ children }: { children: ReactNode }) {\n\treturn <div css={subtaskGroupStyles}>{children}</div>;\n}\n\nexport type SubtaskAppearance = 'default' | 'overlay' | 'disabled';\n\nconst subtaskAppearanceStyles: Record<SubtaskAppearance, SerializedStyles> = {\n\tdefault: css({\n\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t\t':hover': {\n\t\t\tbackground: token('color.background.neutral.subtle.hovered'),\n\t\t\t'--subtask-drag-handle-icon-display': 'inline-flex',\n\t\t},\n\t}),\n\toverlay: css({\n\t\tbackground: token('elevation.surface.overlay'),\n\t\tboxShadow: token('elevation.shadow.overlay'),\n\t}),\n\tdisabled: css({\n\t\t/**\n\t\t * Using disabled color tokens is recommended,\n\t\t * but does not work for well for images or other\n\t\t * components we cannot override.\n\t\t */\n\t\topacity: 0.4,\n\t}),\n};\n\nconst dragHandlerIconStyles = css({\n\tposition: 'absolute',\n\tleft: 4,\n\ttop: 10,\n});\n\nexport type SubtaskProps = HTMLAttributes<HTMLDivElement> & {\n\tid: string;\n\ttitle: string;\n\tappearance?: SubtaskAppearance;\n\tisHovering?: boolean;\n};\n\nexport const Subtask = forwardRef<HTMLDivElement, SubtaskProps>(function Subtask(\n\t{ id, title, appearance = 'default', isHovering = false, children, ...props },\n\tref,\n) {\n\treturn (\n\t\t<div ref={ref} css={[subtaskStyles]} {...props}>\n\t\t\t<div css={[subtaskInnerStyles, subtaskAppearanceStyles[appearance]]}>\n\t\t\t\t<SubtaskGroup>\n\t\t\t\t\t{isHovering && (\n\t\t\t\t\t\t<span css={dragHandlerIconStyles}>\n\t\t\t\t\t\t\t<DragHandleVerticalIcon\n\t\t\t\t\t\t\t\tcolor=\"currentColor\"\n\t\t\t\t\t\t\t\tspacing=\"spacious\"\n\t\t\t\t\t\t\t\tlabel=\"\"\n\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t)}\n\t\t\t\t\t<LinearPriorityIcon color={token('color.icon')} />\n\t\t\t\t\t<span css={subtaskIdStyles}>{id}</span>\n\t\t\t\t\t<LinearInProgressIcon />\n\t\t\t\t</SubtaskGroup>\n\t\t\t\t<span>{title}</span>\n\t\t\t\t<SubtaskGroup>\n\t\t\t\t\t<time css={subtaskTimeStyles}>25 Apr</time>\n\t\t\t\t\t<Avatar size=\"xsmall\" />\n\t\t\t\t</SubtaskGroup>\n\t\t\t</div>\n\t\t\t{children}\n\t\t</div>\n\t);\n});\n\nconst subtaskPreviewStyles = css({\n\tbackground: token('elevation.surface.overlay'),\n\tboxShadow: token('elevation.shadow.overlay'),\n\tpadding: '0px 8px',\n\theight: 36,\n\tborderRadius: 4,\n});\n\nexport const SubtaskPreview = forwardRef<HTMLDivElement, SubtaskProps>(function SubtaskPreview(\n\t{ id, title, appearance = 'default', isHovering = false, children, ...props },\n\tref,\n) {\n\treturn (\n\t\t<div ref={ref} css={[subtaskStyles]} {...props}>\n\t\t\t<div css={[subtaskInnerStyles, subtaskAppearanceStyles[appearance], subtaskPreviewStyles]}>\n\t\t\t\t<LinearInProgressIcon />\n\t\t\t\t<span>{title}</span>\n\t\t\t</div>\n\t\t\t{children}\n\t\t</div>\n\t);\n});\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/primitives/major-priority-icon.tsx",
    "content": "import React from 'react';\n\nexport default function MajorPriorityIcon(): React.JSX.Element {\n\treturn (\n\t\t<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t<path\n\t\t\t\td=\"M12.5215 14.1467L12.6247 14.2191L17.6247 18.2191C18.056 18.5641 18.1259 19.1934 17.7809 19.6247C17.4624 20.0228 16.9017 20.113 16.4781 19.8531L16.3753 19.7809L12 16.28L7.62469 19.7809C7.22661 20.0993 6.65978 20.0643 6.30357 19.7178L6.21913 19.6247C5.90066 19.2266 5.93574 18.6598 6.28222 18.3036L6.3753 18.2191L11.3753 14.2191C11.7073 13.9535 12.1664 13.9294 12.5215 14.1467Z\"\n\t\t\t\tfill=\"#FF8F73\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M12.5215 9.14669L12.6247 9.21913L17.6247 13.2191C18.056 13.5641 18.1259 14.1934 17.7809 14.6247C17.4624 15.0228 16.9017 15.113 16.4781 14.8531L16.3753 14.7809L12 11.28L7.6247 14.7809C7.22661 15.0993 6.65979 15.0643 6.30358 14.7178L6.21914 14.6247C5.90067 14.2266 5.93575 13.6598 6.28223 13.3036L6.37531 13.2191L11.3753 9.21913C11.7073 8.95352 12.1664 8.92937 12.5215 9.14669Z\"\n\t\t\t\tfill=\"#FF7452\"\n\t\t\t/>\n\t\t\t<path\n\t\t\t\td=\"M12.5215 4.14669L12.6247 4.21913L17.6247 8.21913C18.056 8.56414 18.1259 9.19343 17.7809 9.62469C17.4624 10.0228 16.9017 10.113 16.4781 9.85315L16.3753 9.78087L12 6.28L7.6247 9.78087C7.22661 10.0993 6.65979 10.0643 6.30358 9.71778L6.21914 9.62469C5.90067 9.22661 5.93575 8.65978 6.28223 8.30358L6.37531 8.21913L11.3753 4.21913C11.7073 3.95352 12.1664 3.92937 12.5215 4.14669Z\"\n\t\t\t\tfill=\"#FF5630\"\n\t\t\t/>\n\t\t</svg>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/primitives/notion/constants.tsx",
    "content": "export const subtaskIdWidth = 52;\nexport const subtaskIconWidth = 16;\nexport const subtaskInlinePadding = 32;\nexport const subtaskGap = 8;\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/primitives/notion/drop-indicator.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport React from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport { type Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { token } from '@atlaskit/tokens';\n\nconst lineThickness = 4;\n\nconst dropIndicatorStyles = css({\n\tposition: 'absolute',\n\tleft: 0,\n\twidth: '100%',\n\theight: lineThickness,\n\tbackground: token('color.border.selected'),\n});\n\nconst dropIndicatorEdgeStyles = {\n\ttop: css({\n\t\ttop: `calc(-1 * (var(--gap) / 2 + ${lineThickness}px / 2))`,\n\t}),\n\tbottom: css({\n\t\tbottom: `calc(-1 * (var(--gap) / 2 + ${lineThickness}px / 2))`,\n\t}),\n\tleft: {},\n\tright: {},\n};\n\nexport function DropIndicator({ edge, gap }: { edge: Edge; gap: string }): React.JSX.Element {\n\treturn (\n\t\t<div\n\t\t\tstyle={{ '--gap': gap } as React.CSSProperties}\n\t\t\tcss={[dropIndicatorStyles, dropIndicatorEdgeStyles[edge]]}\n\t\t/>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/primitives/notion/subtask-container.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport ChevronDownCircleIcon from '@atlaskit/icon/core/chevron-down';\nimport RecentIcon from '@atlaskit/icon/core/clock';\nimport EditorTextStyleIcon from '@atlaskit/icon/core/text-style';\nimport { token } from '@atlaskit/tokens';\n\nconst subtaskContainerStyles = css({\n\t// for parent placement\n\tflexGrow: 1,\n\tflexBasis: 0,\n\t// background: token('elevation.surface'),\n\tmaxWidth: 560,\n});\n\ntype SubtaskContainerProps = HTMLAttributes<HTMLDivElement> & {\n\tchildren: ReactNode;\n};\n\nconst headingRowStyles = css({\n\tdisplay: 'grid',\n\tgridTemplateColumns: 'repeat(3, 1fr)',\n\tborder: `${token('border.width')} solid ${token('color.border')}`,\n\tborderInlineWidth: 0,\n});\n\nconst headingStyles = css({\n\tdisplay: 'flex',\n\talignItems: 'center',\n\tpadding: 8,\n\tgap: 4,\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':not(:first-of-type)': {\n\t\tborderLeft: `${token('border.width')} solid ${token('color.border')}`,\n\t},\n});\n\nfunction Heading({ children }: { children: ReactNode }) {\n\treturn <div css={headingStyles}>{children}</div>;\n}\n\nexport const SubtaskContainer = forwardRef<HTMLDivElement, SubtaskContainerProps>(\n\tfunction SubtaskContainer({ children, ...props }, ref) {\n\t\treturn (\n\t\t\t<div ref={ref} css={subtaskContainerStyles} {...props}>\n\t\t\t\t{/* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 */}\n\t\t\t\t<div style={{ paddingLeft: 24 }}>\n\t\t\t\t\t<div css={headingRowStyles}>\n\t\t\t\t\t\t<Heading>\n\t\t\t\t\t\t\t<EditorTextStyleIcon color=\"currentColor\" label=\"\" />\n\t\t\t\t\t\t\tName\n\t\t\t\t\t\t</Heading>\n\t\t\t\t\t\t<Heading>\n\t\t\t\t\t\t\t<RecentIcon color=\"currentColor\" label=\"\" />\n\t\t\t\t\t\t\tDate Created\n\t\t\t\t\t\t</Heading>\n\t\t\t\t\t\t<Heading>\n\t\t\t\t\t\t\t<ChevronDownCircleIcon color=\"currentColor\" label=\"\" spacing=\"compact\" size=\"small\" />\n\t\t\t\t\t\t\tStatus\n\t\t\t\t\t\t</Heading>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t},\n);\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/primitives/notion/subtask.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { forwardRef, type HTMLAttributes, memo, type ReactNode, type Ref } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx, type SerializedStyles } from '@emotion/react';\n\nimport DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';\nimport Lozenge from '@atlaskit/lozenge';\nimport { token } from '@atlaskit/tokens';\n\nimport { type DragState } from '../../../hooks/use-sortable-field';\n\nconst subtaskStyles = css({\n\tbackground: 'transparent',\n\tposition: 'relative',\n\tboxSizing: 'border-box',\n\tpaddingLeft: 24,\n});\n\nconst subtaskInnerStyles = css({\n\tdisplay: 'grid',\n\theight: '100%',\n\tgridTemplateColumns: 'repeat(3, 1fr)',\n\talignItems: 'center',\n\tjustifyItems: 'start',\n\tborderBottom: `${token('border.width')} solid ${token('color.border')}`,\n\tposition: 'relative',\n});\n\nexport type SubtaskAppearance = 'default' | 'overlay' | 'disabled';\n\nconst subtaskAppearanceStyles: Record<SubtaskAppearance, SerializedStyles> = {\n\tdefault: css({}),\n\toverlay: css({\n\t\t/**\n\t\t * Weirdly Linear appears to apply extra opacity for the preview\n\t\t */\n\t\topacity: 0.4,\n\t}),\n\tdisabled: css({}),\n};\n\nconst dragHandleStyles = css({\n\tposition: 'absolute',\n\tleft: -4,\n\ttop: 2,\n});\n\nconst dragHandleButtonStyles = css({\n\tborder: 'none',\n\tpadding: '4px 0px',\n\tborderRadius: 3,\n\tbackground: token('color.background.neutral.subtle'),\n\tcursor: 'pointer',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':hover': {\n\t\tbackground: token('color.background.neutral.subtle.hovered'),\n\t},\n});\n\nexport type SubtaskProps = HTMLAttributes<HTMLDivElement> & {\n\tid: string;\n\ttitle: string;\n\tappearance?: SubtaskAppearance;\n\tisHovering?: boolean;\n\tdragHandleRef?: Ref<HTMLDivElement>;\n\tdragState: DragState;\n};\n\nconst cellStyles = css({\n\tdisplay: 'flex',\n\talignItems: 'center',\n\tpadding: 8,\n\theight: '100%',\n\tboxSizing: 'border-box',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':not(:first-of-type)': {\n\t\tborderLeft: `${token('border.width')} solid ${token('color.border')}`,\n\t},\n});\n\nfunction Cell({ children }: { children: ReactNode }) {\n\treturn <div css={cellStyles}>{children}</div>;\n}\n\nconst DragHandle = memo(\n\tforwardRef<HTMLDivElement>(function DragHandle({}, ref) {\n\t\treturn (\n\t\t\t<span ref={ref} css={dragHandleStyles}>\n\t\t\t\t<button css={dragHandleButtonStyles}>\n\t\t\t\t\t<DragHandleVerticalIcon\n\t\t\t\t\t\tcolor=\"currentColor\"\n\t\t\t\t\t\tspacing=\"spacious\"\n\t\t\t\t\t\tlabel=\"drag handle\"\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t/>\n\t\t\t\t</button>\n\t\t\t</span>\n\t\t);\n\t}),\n);\n\nexport const Subtask = forwardRef<HTMLDivElement, SubtaskProps>(function Subtask(\n\t{\n\t\tid,\n\t\ttitle,\n\t\tappearance = 'default',\n\t\tisHovering = false,\n\t\tchildren,\n\t\tdragHandleRef,\n\t\tdragState,\n\t\t...props\n\t},\n\tref,\n) {\n\treturn (\n\t\t<div ref={ref} css={[subtaskStyles]} {...props}>\n\t\t\t<div css={[subtaskInnerStyles, subtaskAppearanceStyles[appearance]]}>\n\t\t\t\t<Cell>\n\t\t\t\t\t{/* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 */}\n\t\t\t\t\t<span style={{ fontWeight: token('font.weight.medium') }}>{title}</span>\n\t\t\t\t</Cell>\n\t\t\t\t<Cell>June 14, 2023 3:48 PM</Cell>\n\t\t\t\t<Cell>\n\t\t\t\t\t<Lozenge appearance=\"inprogress\">In progress</Lozenge>\n\t\t\t\t</Cell>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t\t{dragState === 'idle' && isHovering && <DragHandle ref={dragHandleRef} />}\n\t\t</div>\n\t);\n});\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/primitives/subtask-container.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport { token } from '@atlaskit/tokens';\n\nconst subtaskContainerStyles = css({\n\t// for parent placement\n\tflexGrow: 1,\n\tflexBasis: 0,\n\tbackground: token('elevation.surface.raised'),\n\tboxShadow: token('elevation.shadow.raised'),\n\tborderRadius: 3,\n\tmaxWidth: 560,\n\tminWidth: 400,\n});\n\nconst subtaskContainerPaddingStyles = css({ padding: 2 });\n\ntype SubtaskContainerProps = HTMLAttributes<HTMLDivElement> & {\n\tchildren: ReactNode;\n\thasContainerPadding?: boolean;\n};\n\nexport const SubtaskContainer = forwardRef<HTMLDivElement, SubtaskContainerProps>(\n\tfunction SubtaskContainer({ children, hasContainerPadding = false, ...props }, ref) {\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ref}\n\t\t\t\tcss={[subtaskContainerStyles, hasContainerPadding && subtaskContainerPaddingStyles]}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t);\n\t},\n);\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/primitives/subtask-drag-handle.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { forwardRef } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport DropdownMenu, {\n\ttype CustomTriggerProps,\n\tDropdownItem,\n\tDropdownItemGroup,\n} from '@atlaskit/dropdown-menu';\nimport FocusRing from '@atlaskit/focus-ring';\nimport DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';\nimport { token } from '@atlaskit/tokens';\n\nimport type { DragState } from '../../hooks/use-sortable-field';\n\nconst dragHandleStyles = css({\n\tborder: 'none',\n\tpadding: 0,\n\tborderRadius: 3,\n\toverflow: 'hidden',\n\tcursor: 'grab',\n});\n\nconst dragHandleIdleStyles = css({\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':focus-visible': {\n\t\topacity: 1,\n\t},\n});\n\nconst dragHandleHiddenStyles = css({\n\topacity: 0,\n});\n\n/**\n * Because we're overlaying the subtask object icon we need to recreate a\n * surface behind our drag handle so we don't see the subtask icon.\n */\nconst dragHandleSurfaceStyles = css({\n\tbackground: token('elevation.surface'),\n\tposition: 'absolute',\n\ttop: 8,\n\tleft: 4,\n\twidth: 24,\n\theight: 24,\n});\n\nconst dragHandleEmulatedSubtaskBackgroundStyles = css({\n\tbackground: token('color.background.neutral'),\n\twidth: '100%',\n\theight: '100%',\n});\n\nconst dragHandleInnerStyles = css({\n\twidth: '100%',\n\theight: '100%',\n\tboxSizing: 'border-box',\n\tpadding: 4,\n\tbackground: token('color.background.neutral'),\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':hover, :focus': {\n\t\tbackground: token('color.background.neutral.hovered'),\n\t},\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':active': {\n\t\tbackground: token('color.background.neutral.pressed'),\n\t},\n});\n\nconst dragHandleInnerSelectedStyles = css({\n\tcolor: token('color.text.selected'),\n\tbackground: token('color.background.selected'),\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':hover, :focus, :active': {\n\t\tbackground: token('color.background.selected'),\n\t},\n});\n\ntype SubtaskDragHandleProps = {\n\tisHovering?: boolean;\n\tdragState: DragState;\n};\n\nfunction SubtaskDragHandleTrigger({\n\ttriggerRef,\n\tisIdle,\n\tisHovering,\n\tisSelected,\n\t...triggerProps\n}: CustomTriggerProps<HTMLButtonElement> & {\n\tisIdle: boolean;\n\tisHovering: boolean;\n}) {\n\treturn (\n\t\t<FocusRing>\n\t\t\t<button\n\t\t\t\tref={triggerRef}\n\t\t\t\t{...triggerProps}\n\t\t\t\tcss={[\n\t\t\t\t\tdragHandleStyles,\n\t\t\t\t\tisIdle && dragHandleIdleStyles,\n\t\t\t\t\t!isHovering && !isSelected && dragHandleHiddenStyles,\n\t\t\t\t\tdragHandleSurfaceStyles,\n\t\t\t\t]}\n\t\t\t>\n\t\t\t\t<div css={dragHandleEmulatedSubtaskBackgroundStyles}>\n\t\t\t\t\t<div css={[dragHandleInnerStyles, isSelected && dragHandleInnerSelectedStyles]}>\n\t\t\t\t\t\t<DragHandleVerticalIcon label=\"\" size=\"small\" />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</button>\n\t\t</FocusRing>\n\t);\n}\n\nexport const SubtaskDragHandle = forwardRef<HTMLButtonElement, SubtaskDragHandleProps>(\n\tfunction SubtaskDragHandle({ isHovering = false, dragState }, ref) {\n\t\treturn (\n\t\t\t<DropdownMenu<HTMLButtonElement>\n\t\t\t\ttrigger={(triggerProps) => (\n\t\t\t\t\t<SubtaskDragHandleTrigger\n\t\t\t\t\t\t{...triggerProps}\n\t\t\t\t\t\tisHovering={isHovering}\n\t\t\t\t\t\tisIdle={dragState === 'idle'}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t<DropdownItemGroup>\n\t\t\t\t\t<DropdownItem>Edit</DropdownItem>\n\t\t\t\t\t<DropdownItem>Share</DropdownItem>\n\t\t\t\t\t<DropdownItem>Move</DropdownItem>\n\t\t\t\t\t<DropdownItem>Clone</DropdownItem>\n\t\t\t\t\t<DropdownItem>Delete</DropdownItem>\n\t\t\t\t\t<DropdownItem>Report</DropdownItem>\n\t\t\t\t</DropdownItemGroup>\n\t\t\t</DropdownMenu>\n\t\t);\n\t},\n);\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/primitives/subtask-icon.tsx",
    "content": "import React from 'react';\n\nimport DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';\n\nexport function SubtaskObjectIcon(): React.JSX.Element {\n\treturn (\n\t\t<svg width=\"14\" height=\"14\" viewBox=\"0 0 14 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t<g clipPath=\"url(#clip0_80_3800)\">\n\t\t\t\t<rect width=\"14\" height=\"14\" rx=\"2\" fill=\"#4AADE8\" />\n\t\t\t\t<path\n\t\t\t\t\td=\"M12 0H2C0.89543 0 0 0.89543 0 2V12C0 13.1046 0.89543 14 2 14H12C13.1046 14 14 13.1046 14 12V2C14 0.89543 13.1046 0 12 0Z\"\n\t\t\t\t\tfill=\"#4BAEE8\"\n\t\t\t\t/>\n\t\t\t\t<path\n\t\t\t\t\tfillRule=\"evenodd\"\n\t\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\t\td=\"M3.8 3.5C3.63431 3.5 3.5 3.63431 3.5 3.8V7.2C3.5 7.36569 3.63431 7.5 3.8 7.5H7.2C7.36569 7.5 7.5 7.36569 7.5 7.2V3.8C7.5 3.63431 7.36569 3.5 7.2 3.5H3.8ZM2.5 3.8C2.5 3.08203 3.08203 2.5 3.8 2.5H7.2C7.91797 2.5 8.5 3.08203 8.5 3.8V7.2C8.5 7.91797 7.91797 8.5 7.2 8.5H3.8C3.08203 8.5 2.5 7.91797 2.5 7.2V3.8Z\"\n\t\t\t\t\tfill=\"white\"\n\t\t\t\t/>\n\t\t\t\t<path\n\t\t\t\t\td=\"M10.2 6H6.8C6.35817 6 6 6.35817 6 6.8V10.2C6 10.6418 6.35817 11 6.8 11H10.2C10.6418 11 11 10.6418 11 10.2V6.8C11 6.35817 10.6418 6 10.2 6Z\"\n\t\t\t\t\tfill=\"white\"\n\t\t\t\t/>\n\t\t\t\t<path\n\t\t\t\t\tfillRule=\"evenodd\"\n\t\t\t\t\tclipRule=\"evenodd\"\n\t\t\t\t\td=\"M6.8 6.5C6.63431 6.5 6.5 6.63431 6.5 6.8V10.2C6.5 10.3657 6.63431 10.5 6.8 10.5H10.2C10.3657 10.5 10.5 10.3657 10.5 10.2V6.8C10.5 6.63431 10.3657 6.5 10.2 6.5H6.8ZM5.5 6.8C5.5 6.08203 6.08203 5.5 6.8 5.5H10.2C10.918 5.5 11.5 6.08203 11.5 6.8V10.2C11.5 10.918 10.918 11.5 10.2 11.5H6.8C6.08203 11.5 5.5 10.918 5.5 10.2V6.8Z\"\n\t\t\t\t\tfill=\"white\"\n\t\t\t\t/>\n\t\t\t</g>\n\t\t\t<defs>\n\t\t\t\t<clipPath id=\"clip0_80_3800\">\n\t\t\t\t\t<rect width=\"14\" height=\"14\" rx=\"2\" fill=\"white\" />\n\t\t\t\t</clipPath>\n\t\t\t</defs>\n\t\t</svg>\n\t);\n}\n\nexport default function SubtaskIcon({ isIconHidden = false }): React.JSX.Element {\n\treturn (\n\t\t<div\n\t\t\tstyle={{\n\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\twidth: 16,\n\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\theight: 16,\n\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\tdisplay: 'grid',\n\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\tplaceItems: 'center',\n\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\toverflow: 'hidden',\n\t\t\t\topacity: isIconHidden ? 0 : 1,\n\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\tpointerEvents: 'none',\n\t\t\t}}\n\t\t>\n\t\t\t{/* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 */}\n\t\t\t<div style={{ display: 'var(--subtask-drag-handle-icon-display, none)' }}>\n\t\t\t\t<DragHandleVerticalIcon label=\"\" />\n\t\t\t</div>\n\t\t\t<SubtaskObjectIcon />\n\t\t</div>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/primitives/subtask.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { forwardRef, type HTMLAttributes, type ReactNode } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx, type SerializedStyles } from '@emotion/react';\n\nimport Avatar from '@atlaskit/avatar';\nimport Badge from '@atlaskit/badge';\nimport Lozenge from '@atlaskit/lozenge';\nimport { token } from '@atlaskit/tokens';\n\nimport SubtaskIcon from './subtask-icon';\n\nconst subtaskStyles = css({\n\tdisplay: 'grid',\n\tgridTemplateColumns: 'auto 1fr auto',\n\tgap: 12,\n\talignItems: 'center',\n\n\tbackground: token('color.background.neutral.subtle'),\n\n\theight: 40,\n\tpadding: '0px 8px',\n\n\tborderBottom: `${token('border.width')} solid transparent`,\n});\n\nconst subtaskNotLastItemStyles = css({\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':not(:last-child)': {\n\t\tborderColor: token('color.border'),\n\t},\n});\n\nconst subtaskIdStyles = css({\n\tfont: token('font.body.small'),\n\tfontWeight: token('font.weight.medium'),\n});\n\nconst subtaskGroupStyles = css({\n\tdisplay: 'flex',\n\talignItems: 'center',\n\tgap: 8,\n});\n\nfunction SubtaskGroup({ children }: { children: ReactNode }) {\n\treturn <div css={subtaskGroupStyles}>{children}</div>;\n}\n\nconst subtaskLabelStyles = css({\n\ttextOverflow: 'ellipsis',\n\toverflow: 'hidden',\n\twhiteSpace: 'nowrap',\n\tcolor: token('color.text'),\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':hover': {\n\t\tcolor: token('color.text'),\n\t},\n});\n\nexport type SubtaskAppearance = 'default' | 'overlay' | 'disabled';\n\nconst subtaskAppearanceStyles: Record<SubtaskAppearance, SerializedStyles> = {\n\tdefault: css({\n\t\t'--subtask-hover': 0,\n\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t\t':hover': {\n\t\t\tbackground: token('color.background.neutral.subtle.hovered'),\n\t\t\t'--subtask-drag-handle-icon-display': 'inline-flex',\n\t\t\t'--subtask-hover': 1,\n\t\t},\n\t}),\n\toverlay: css({\n\t\tbackground: token('elevation.surface.overlay'),\n\t\tboxShadow: token('elevation.shadow.overlay'),\n\t\tborderRadius: 3,\n\t}),\n\tdisabled: css({\n\t\t/**\n\t\t * Using disabled color tokens is recommended,\n\t\t * but does not work for well for images or other\n\t\t * components we cannot override.\n\t\t */\n\t\topacity: 0.4,\n\t}),\n};\n\nexport type SubtaskProps = HTMLAttributes<HTMLDivElement> & {\n\tid: string;\n\ttitle: string;\n\tisLastItem?: boolean;\n\tappearance?: SubtaskAppearance;\n\telemAfter?: ReactNode;\n\tisIconHidden?: boolean;\n};\n\nexport const Subtask = forwardRef<HTMLDivElement, SubtaskProps>(function Subtask(\n\t{\n\t\tid,\n\t\ttitle,\n\t\tappearance = 'default',\n\t\tisLastItem = false,\n\t\tchildren,\n\t\telemAfter,\n\t\tisIconHidden = false,\n\t\t...props\n\t},\n\tref,\n) {\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tcss={[\n\t\t\t\tsubtaskStyles,\n\t\t\t\tsubtaskAppearanceStyles[appearance],\n\t\t\t\t!isLastItem && subtaskNotLastItemStyles,\n\t\t\t]}\n\t\t\t{...props}\n\t\t>\n\t\t\t{children}\n\t\t\t<SubtaskGroup>\n\t\t\t\t<SubtaskIcon isIconHidden={isIconHidden} />\n\t\t\t\t{/* eslint-disable-next-line @atlassian/a11y/anchor-is-valid, @atlaskit/design-system/no-html-anchor */}\n\t\t\t\t<a css={subtaskIdStyles} href=\"#\" draggable={false}>\n\t\t\t\t\t{id}\n\t\t\t\t</a>\n\t\t\t</SubtaskGroup>\n\t\t\t{/* eslint-disable-next-line @atlassian/a11y/anchor-is-valid, @atlaskit/design-system/no-html-anchor */}\n\t\t\t<a css={subtaskLabelStyles} href=\"#\" draggable={false}>\n\t\t\t\t{title}\n\t\t\t</a>\n\t\t\t<SubtaskGroup>\n\t\t\t\t<Badge>{1}</Badge>\n\t\t\t\t<Avatar size=\"small\" />\n\t\t\t\t<Lozenge appearance=\"default\">Todo</Lozenge>\n\t\t\t\t{elemAfter}\n\t\t\t</SubtaskGroup>\n\t\t</div>\n\t);\n});\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/templates/_base.tsx",
    "content": "import React, { type ComponentType, Fragment, type ReactNode } from 'react';\n\nimport { useTopLevelWiring } from '../../hooks/use-top-level-wiring';\nimport { type DataItem, initialData } from '../data';\n\nexport type DraggableSubtaskProps = { index: number; item: DataItem };\n\nexport type SubtasksBaseTemplateProps = {\n\tinstanceId: string;\n\tDraggableSubtask: ComponentType<DraggableSubtaskProps>;\n\tWrapper?: ComponentType<{ children: ReactNode }>;\n};\n\nexport function SubtasksBaseTemplate({\n\tinstanceId,\n\tDraggableSubtask,\n\tWrapper = Fragment,\n}: SubtasksBaseTemplateProps): React.JSX.Element {\n\tconst { data } = useTopLevelWiring({ initialData, type: instanceId });\n\n\treturn (\n\t\t<Wrapper>\n\t\t\t{data.map((item, index) => (\n\t\t\t\t<DraggableSubtask key={item.id} index={index} item={item} />\n\t\t\t))}\n\t\t</Wrapper>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/subtasks/templates/linear.tsx",
    "content": "import React from 'react';\n\nimport { SubtaskContainer } from '../primitives/linear/subtask-container';\n\nimport { SubtasksBaseTemplate, type SubtasksBaseTemplateProps } from './_base';\n\ntype LinearTemplateProps = Omit<SubtasksBaseTemplateProps, 'Wrapper'>;\n\nexport function LinearTemplate({\n\tinstanceId,\n\tDraggableSubtask,\n}: LinearTemplateProps): React.JSX.Element {\n\treturn (\n\t\t<SubtasksBaseTemplate\n\t\t\tinstanceId={instanceId}\n\t\t\tDraggableSubtask={DraggableSubtask}\n\t\t\tWrapper={SubtaskContainer}\n\t\t/>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/table/constants.tsx",
    "content": "/**\n * The smallest width a column can be resized to\n */\nexport const minColumnWidth = 200;\n"
  },
  {
    "path": "packages/documentation/examples/pieces/table/data.ts",
    "content": "import { getPerson } from '../../data/people';\n\nimport type { Item, Status } from './types';\n\nconst status: Status[] = ['todo', 'in-progress', 'done'];\n\n/**\n * Create a set of values that appears to be random, but are predictable based on a seed.\n * Using a simple approach as this is just for a demo\n */\nfunction getStableValues({\n\tseed,\n\tmin,\n\tmax,\n\tlength,\n}: {\n\tseed: number;\n\tmin: number;\n\tmax: number;\n\tlength: number;\n}): number[] {\n\tconst range = max - min + 1;\n\n\treturn Array.from({ length }, (_, index) => {\n\t\tconst value =\n\t\t\t// making everything a positive number\n\t\t\tMath.abs(\n\t\t\t\t// Each new integer provided to Math.sin(integer) gives a fairly different result.\n\t\t\t\t// (Even though you could plot them out and find a pattern over time)\n\t\t\t\t// Can be a decimal between -1 and 1\n\t\t\t\tMath.sin(seed + index),\n\t\t\t);\n\t\treturn Math.floor(value * range) + min;\n\t});\n}\n\nexport function getItems({ amount }: { amount: number }): Item[] {\n\tconst statusIndexes = getStableValues({\n\t\tseed: 3,\n\t\tmin: 0,\n\t\tmax: status.length - 1,\n\t\tlength: amount,\n\t});\n\treturn Array.from({ length: amount }, (_, index) => {\n\t\tconst statusIndex = statusIndexes[index];\n\t\tconst id = `id:${index}`;\n\t\treturn {\n\t\t\tid,\n\t\t\tdescription: `Generated description [${id}]`,\n\t\t\tstatus: status[statusIndex],\n\t\t\tassignee: getPerson(),\n\t\t};\n\t});\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/table/menu-button.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { forwardRef, useCallback, useContext } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';\n// eslint-disable-next-line @atlaskit/design-system/no-banned-imports\nimport mergeRefs from '@atlaskit/ds-lib/merge-refs';\nimport { DragHandleButton } from '@atlaskit/pragmatic-drag-and-drop-react-accessibility/drag-handle-button';\n\nimport { TableContext } from './table-context';\n\nconst baseMenuButtonWrapperStyles = css({\n\twidth: 'max-content',\n\theight: '100%',\n\tposition: 'absolute',\n\ttop: 0,\n\tdisplay: 'grid',\n\talignContent: 'center',\n\tgridTemplateRows: '24px',\n});\n\nconst rowMenuButtonWrapperStyles = css({\n\tleft: 8,\n});\n\n// The column button has a bit more spacing than the row button,\n// to avoid conflict with the resize handle\nconst columnMenuButtonWrapperStyles = css({\n\tright: 12,\n});\n\nexport const RowMenuButton = forwardRef<\n\tHTMLButtonElement,\n\t{\n\t\trowIndex: number;\n\t\tamountOfRows: number;\n\t}\n>(function RowMenuButton({ rowIndex, amountOfRows }, ref) {\n\tconst { reorderItem } = useContext(TableContext);\n\n\tconst moveUp = useCallback(() => {\n\t\treorderItem({\n\t\t\tstartIndex: rowIndex,\n\t\t\tindexOfTarget: rowIndex - 1,\n\t\t});\n\t}, [reorderItem, rowIndex]);\n\n\tconst moveDown = useCallback(() => {\n\t\treorderItem({\n\t\t\tstartIndex: rowIndex,\n\t\t\tindexOfTarget: rowIndex + 1,\n\t\t});\n\t}, [reorderItem, rowIndex]);\n\n\tconst isFirstRow = rowIndex === 0;\n\tconst isLastRow = rowIndex === amountOfRows - 1;\n\n\treturn (\n\t\t<div css={[baseMenuButtonWrapperStyles, rowMenuButtonWrapperStyles]}>\n\t\t\t<DropdownMenu\n\t\t\t\ttrigger={({ triggerRef, ...triggerProps }) => (\n\t\t\t\t\t<DragHandleButton ref={mergeRefs([ref, triggerRef])} {...triggerProps} label=\"Reorder\" />\n\t\t\t\t)}\n\t\t\t\tshouldRenderToParent\n\t\t\t>\n\t\t\t\t<DropdownItemGroup>\n\t\t\t\t\t<DropdownItem isDisabled={isFirstRow} onClick={moveUp}>\n\t\t\t\t\t\tMove up\n\t\t\t\t\t</DropdownItem>\n\t\t\t\t\t<DropdownItem isDisabled={isLastRow} onClick={moveDown}>\n\t\t\t\t\t\tMove down\n\t\t\t\t\t</DropdownItem>\n\t\t\t\t</DropdownItemGroup>\n\t\t\t</DropdownMenu>\n\t\t</div>\n\t);\n});\n\nexport const ColumnMenuButton = forwardRef<\n\tHTMLButtonElement,\n\t{\n\t\tcolumnIndex: number;\n\t\tamountOfHeaders: number;\n\t}\n>(function ColumnMenuButton({ columnIndex, amountOfHeaders }, ref) {\n\tconst { reorderColumn } = useContext(TableContext);\n\n\tconst moveLeft = useCallback(() => {\n\t\treorderColumn({\n\t\t\tstartIndex: columnIndex,\n\t\t\tindexOfTarget: columnIndex - 1,\n\t\t});\n\t}, [reorderColumn, columnIndex]);\n\n\tconst moveRight = useCallback(() => {\n\t\treorderColumn({\n\t\t\tstartIndex: columnIndex,\n\t\t\tindexOfTarget: columnIndex + 1,\n\t\t});\n\t}, [reorderColumn, columnIndex]);\n\n\tconst isFirstColumn = columnIndex === 0;\n\tconst isLastColumn = columnIndex === amountOfHeaders - 1;\n\n\treturn (\n\t\t<div css={[baseMenuButtonWrapperStyles, columnMenuButtonWrapperStyles]}>\n\t\t\t<DropdownMenu\n\t\t\t\ttrigger={({ triggerRef, ...triggerProps }) => (\n\t\t\t\t\t<DragHandleButton ref={mergeRefs([ref, triggerRef])} {...triggerProps} label=\"Reorder\" />\n\t\t\t\t)}\n\t\t\t\tshouldRenderToParent\n\t\t\t>\n\t\t\t\t<DropdownItemGroup>\n\t\t\t\t\t<DropdownItem isDisabled={isFirstColumn} onClick={moveLeft}>\n\t\t\t\t\t\tMove left\n\t\t\t\t\t</DropdownItem>\n\t\t\t\t\t<DropdownItem isDisabled={isLastColumn} onClick={moveRight}>\n\t\t\t\t\t\tMove right\n\t\t\t\t\t</DropdownItem>\n\t\t\t\t</DropdownItemGroup>\n\t\t\t</DropdownMenu>\n\t\t</div>\n\t);\n});\n"
  },
  {
    "path": "packages/documentation/examples/pieces/table/render-pieces.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { Fragment, type ReactElement } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport Avatar from '@atlaskit/avatar';\nimport Lozenge from '@atlaskit/lozenge';\nimport { Inline } from '@atlaskit/primitives/compiled';\n\nimport type { Item, Status } from './types';\n\nconst noPointerEventsStyles = css({ pointerEvents: 'none' });\n\nexport function getField({ item, property }: { item: Item; property: keyof Item }): ReactElement {\n\tif (property === 'status') {\n\t\treturn statusMap[item[property]];\n\t}\n\tif (property === 'assignee') {\n\t\tconst person = item[property];\n\t\treturn (\n\t\t\t<Inline space=\"space.100\" alignBlock=\"center\" grow=\"fill\">\n\t\t\t\t<span css={noPointerEventsStyles}>\n\t\t\t\t\t<Avatar src={person.avatarUrl} size=\"small\" />\n\t\t\t\t</span>\n\t\t\t\t<span>{person.name}</span>\n\t\t\t</Inline>\n\t\t);\n\t}\n\treturn <Fragment>{item[property]}</Fragment>;\n}\n\nconst propertyMap: { [key in keyof Item]: string } = {\n\tid: 'Id',\n\tdescription: 'Description',\n\tstatus: 'Status',\n\tassignee: 'Assignee',\n};\n\nexport function getProperty(value: keyof Item): string {\n\treturn propertyMap[value];\n}\n\nconst statusMap: { [key in Status]: ReactElement } = {\n\ttodo: <Lozenge appearance=\"new\">Todo</Lozenge>,\n\t'in-progress': <Lozenge appearance=\"inprogress\">In Progress</Lozenge>,\n\tdone: <Lozenge appearance=\"success\">Done</Lozenge>,\n};\n\nexport function getStatus(value: Status): ReactElement {\n\treturn statusMap[value];\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/table/row.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { Fragment, memo, useContext, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport { createPortal } from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport {\n\tattachClosestEdge,\n\ttype Edge,\n\textractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Inline, xcss } from '@atlaskit/primitives';\nimport { token } from '@atlaskit/tokens';\n\nimport { minColumnWidth } from './constants';\nimport { RowMenuButton } from './menu-button';\nimport { getField } from './render-pieces';\nimport { TableContext } from './table-context';\nimport type { Item } from './types';\n\nconst rowStyles = css({\n\t// Needed for our drop indicator\n\tposition: 'relative',\n\t'&:hover': {\n\t\tbackground: token('color.background.input.hovered', 'red'),\n\t},\n});\n\nconst textOverflowStyles = css({\n\toverflow: 'hidden',\n\ttextOverflow: 'ellipsis',\n\twhiteSpace: 'nowrap',\n});\n\ntype State =\n\t| {\n\t\t\ttype: 'idle';\n\t  }\n\t| {\n\t\t\ttype: 'preview';\n\t\t\tcontainer: HTMLElement;\n\t  }\n\t| {\n\t\t\ttype: 'is-over';\n\t\t\tclosestEdge: Edge | null;\n\t  };\n\n/**\n * Memoizing each Row so that row reorders don't need to rerender the entire\n * table.\n *\n * Column rerenders still need to rerender every row. Both could be optimized\n * further, such as by using virtualization.\n */\nexport const Row = memo(function Row({\n\titem,\n\tindex,\n\tproperties,\n\tamountOfRows,\n}: {\n\titem: Item;\n\tindex: number;\n\tproperties: (keyof Item)[];\n\tamountOfRows: number;\n}) {\n\tconst ref = useRef<HTMLTableRowElement | null>(null);\n\tconst dragHandleRef = useRef<HTMLButtonElement>(null);\n\tconst { register, instanceId } = useContext(TableContext);\n\tconst [state, setState] = useState<State>({ type: 'idle' });\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\t\tconst unregister = register({ item, element, index });\n\t\treturn unregister;\n\t}, [register, item, index]);\n\n\t// Pragmatic drag and drop\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\t\tconst dragHandle = dragHandleRef.current;\n\t\tinvariant(dragHandle);\n\t\treturn combine(\n\t\t\tdraggable({\n\t\t\t\telement,\n\t\t\t\tdragHandle,\n\t\t\t\tgetInitialData() {\n\t\t\t\t\treturn { type: 'item-row', item, index, instanceId };\n\t\t\t\t},\n\t\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\t\t// We need to make sure that the element not obfuscated by the sticky header\n\t\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\t\tgetOffset: pointerOutsideOfPreview({\n\t\t\t\t\t\t\tx: token('space.250', '0'),\n\t\t\t\t\t\t\ty: token('space.250', '0'),\n\t\t\t\t\t\t}),\n\t\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\t\tsetState({ type: 'preview', container });\n\t\t\t\t\t\t\treturn () => setState({ type: 'idle' });\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement,\n\t\t\t\tcanDrop({ source }) {\n\t\t\t\t\treturn (\n\t\t\t\t\t\tsource.data.instanceId === instanceId &&\n\t\t\t\t\t\tsource.data.type === 'item-row' &&\n\t\t\t\t\t\tsource.data.item !== item\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tgetData({ input, element }) {\n\t\t\t\t\tconst data = { item, index };\n\t\t\t\t\treturn attachClosestEdge(data, {\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\telement,\n\t\t\t\t\t\tallowedEdges: ['top', 'bottom'],\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragEnter(args) {\n\t\t\t\t\tsetState({\n\t\t\t\t\t\ttype: 'is-over',\n\t\t\t\t\t\tclosestEdge: extractClosestEdge(args.self.data),\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDrag(args) {\n\t\t\t\t\tconst closestEdge: Edge | null = extractClosestEdge(args.self.data);\n\n\t\t\t\t\t// only update react state if the `closestEdge` changes\n\t\t\t\t\tsetState((current) => {\n\t\t\t\t\t\tif (current.type !== 'is-over') {\n\t\t\t\t\t\t\treturn current;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (current.closestEdge === closestEdge) {\n\t\t\t\t\t\t\treturn current;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\ttype: 'is-over',\n\t\t\t\t\t\t\tclosestEdge,\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragLeave() {\n\t\t\t\t\tsetState({ type: 'idle' });\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tsetState({ type: 'idle' });\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t\t/**\n\t\t * Using `properties` as a dependency to ensure that the `draggable()` call\n\t\t * is rerun when the column order changes. This is because the `dragHandle`\n\t\t * value will change when the column order changes.\n\t\t *\n\t\t * If we do not rerun the `draggable()` call then dragging will not work\n\t\t * because the `dragHandle` reference will be stale.\n\t\t *\n\t\t * This could be avoided by making a separate cell component that takes a\n\t\t * prop such as `shouldRenderDragHandle`. Then you could call the\n\t\t * `draggable` setup in the cell, using `shouldRenderDragHandle` as a\n\t\t * dependency.\n\t\t *\n\t\t * Using the cell-based approach could be preferable if you have stricter\n\t\t * performance needs, and would allow for optimizations such as memoization.\n\t\t */\n\t}, [instanceId, item, index, properties]);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<tr draggable ref={ref} css={rowStyles}>\n\t\t\t\t{properties.map((property, columnIndex) => (\n\t\t\t\t\t<td key={property} css={textOverflowStyles}>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Rendering this in only the first column of each row\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tcolumnIndex === 0 && (\n\t\t\t\t\t\t\t\t<RowMenuButton ref={dragHandleRef} rowIndex={index} amountOfRows={amountOfRows} />\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t{getField({ item, property })}\n\t\t\t\t\t\t{state.type === 'is-over' && state.closestEdge ? (\n\t\t\t\t\t\t\t<DropIndicator edge={state.closestEdge} type=\"no-terminal\" />\n\t\t\t\t\t\t) : null}\n\t\t\t\t\t</td>\n\t\t\t\t))}\n\t\t\t</tr>\n\t\t\t{state.type === 'preview'\n\t\t\t\t? createPortal(<Preview item={item} properties={properties} />, state.container)\n\t\t\t\t: null}\n\t\t</Fragment>\n\t);\n});\n\nconst previewStyles = xcss({\n\tborderRadius: 'radius.small',\n});\n\nconst previewItemStyles = css({\n\t/**\n\t * Each column in the preview will be no wider than a fully condensed column\n\t */\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766\n\tmaxWidth: minColumnWidth,\n});\n\nfunction Preview({ item, properties }: { item: Item; properties: (keyof Item)[] }) {\n\treturn (\n\t\t<Box backgroundColor=\"elevation.surface\" padding=\"space.100\" xcss={previewStyles}>\n\t\t\t<Inline alignBlock=\"center\" space=\"space.100\">\n\t\t\t\t{properties.map((property) => (\n\t\t\t\t\t<div key={property} css={[textOverflowStyles, previewItemStyles]}>\n\t\t\t\t\t\t{getField({ item, property })}\n\t\t\t\t\t</div>\n\t\t\t\t))}\n\t\t\t</Inline>\n\t\t</Box>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/table/table-context.ts",
    "content": "import { createContext } from 'react';\n\nimport type { Item, ItemRegistration, ReorderFunction } from './types';\n\ntype UnregisterFn = () => void;\n\nexport type ItemContextValue = {\n\tgetItemsForColumnPreview: () => {\n\t\titems: Item[];\n\t\tisMoreItems: boolean;\n\t};\n\treorderColumn: ReorderFunction;\n\treorderItem: ReorderFunction;\n\tregister: (args: ItemRegistration) => UnregisterFn;\n\tinstanceId: symbol | null;\n};\nexport const TableContext = createContext<ItemContextValue>({\n\tgetItemsForColumnPreview: () => ({ items: [], isMoreItems: false }),\n\treorderColumn: () => {},\n\treorderItem: () => {},\n\tregister: function register() {\n\t\treturn function unregister() {};\n\t},\n\tinstanceId: null,\n});\n"
  },
  {
    "path": "packages/documentation/examples/pieces/table/table-header.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { Fragment, useContext, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx, type SerializedStyles } from '@emotion/react';\nimport ReactDOM from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport {\n\tattachClosestEdge,\n\ttype Edge,\n\textractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\tmonitorForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { disableNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview';\nimport { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\nimport { preventUnhandled } from '@atlaskit/pragmatic-drag-and-drop/prevent-unhandled';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Stack, xcss } from '@atlaskit/primitives';\nimport { token } from '@atlaskit/tokens';\n\nimport { minColumnWidth } from './constants';\nimport { ColumnMenuButton } from './menu-button';\nimport { getField, getProperty } from './render-pieces';\nimport { TableContext } from './table-context';\nimport { type Item } from './types';\n\ntype HeaderState =\n\t| {\n\t\t\ttype: 'idle';\n\t  }\n\t| {\n\t\t\ttype: 'preview';\n\t\t\tcontainer: HTMLElement;\n\t  }\n\t| {\n\t\t\ttype: 'dragging';\n\t  }\n\t| {\n\t\t\ttype: 'drop-target';\n\t\t\tclosestEdge: Edge | null;\n\t  }\n\t| {\n\t\t\ttype: 'resizing';\n\t\t\tinitialWidth: number;\n\t\t\ttableWidth: number;\n\t\t\tnextHeaderInitialWidth: number;\n\t\t\tnextHeader: HTMLElement;\n\t\t\tmaxWidth: number;\n\t  };\n\n/**\n * These two state types have no associated information, so we can create stable\n * references for both types.\n *\n * By using these stable references, we can avoid unnecessary rerenders which\n * may occur if we try to enter the state when we are already in it.\n *\n * To visualize this, consider:\n * ```ts\n * setState({ type: ‘dragging’ });\n * // This second call will trigger a rerender because it is a new object\n * setState({ type: ‘dragging’ });\n *\n * // in comparison to\n *\n * setState(draggingState);\n * // This second call will NOT trigger a rerender, it is the same object\n * setState(draggingState);\n * ```\n */\nconst idleState: HeaderState = { type: 'idle' };\nconst draggingState: HeaderState = { type: 'dragging' };\n\nfunction clamp({ value, min, max }: { value: number; min: number; max: number }) {\n\treturn Math.max(min, Math.min(value, max));\n}\n\nconst headerDraggingStyles = css({\n\tbackground: token('color.background.disabled', '#091E4224'),\n\tcolor: token('color.text.disabled', '#091E424F'),\n});\n\ntype ColumnType = 'first-of-many' | 'middle-of-many' | 'last-of-many' | 'only-column';\n\nconst resizerStyles = css({\n\t'--local-hitbox-width': token('space.300', '24px'),\n\twidth: 'var(--local-hitbox-width)',\n\tcursor: 'col-resize',\n\tflexGrow: '0',\n\tposition: 'absolute',\n\tzIndex: 1, // we want this to sit on top of adjacent column headers\n\tright: 'calc(-1 * calc(var(--local-hitbox-width) / 2))',\n\ttop: 0,\n\theight: 'var(--table-height)',\n\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t'::before': {\n\t\topacity: 0,\n\t\t'--local-line-width': token('border.width', '2px'),\n\t\tcontent: '\"\"',\n\t\tposition: 'absolute',\n\t\tbackground: token('color.border.brand', '#0052CC'),\n\t\t// Jesse would like us to use 'color.border' for hover, then brand while resizing\n\t\t// However,\n\t\t// - right now that is inconsistent with our sidebar\n\t\t// - we get a bad outcome when the borders overlap with the header border\n\t\twidth: 'var(--local-line-width)',\n\t\tinset: 0,\n\t\tleft: `calc(50% - calc(var(--local-line-width) / 2))`,\n\t\ttransition: 'opacity 0.2s ease',\n\t},\n\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':hover::before': {\n\t\topacity: 1,\n\t},\n});\n\nconst resizingStyles = css({\n\t// turning off the resizing cursor as sometimes it can cause the cursor to flicker\n\t// while resizing. The browser controls the cursor while dragging, but the browser\n\t// can sometimes bug out.\n\tcursor: 'unset',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t'::before': {\n\t\topacity: 1,\n\t},\n});\n\nconst sharedDropTargetStyles = css({\n\tposition: 'absolute',\n\ttop: 0,\n\theight: 'var(--table-height)',\n});\n\nconst dropTargetStyles: {\n\t// Don't need to provide styles for only-column\n\t[key in Exclude<ColumnType, 'only-column'>]: SerializedStyles[];\n} = {\n\t'first-of-many': [\n\t\tsharedDropTargetStyles,\n\t\tcss({\n\t\t\tright: 0,\n\t\t\t// for the first item, we are pushing a bit off the left so that the drop\n\t\t\t// indicator will sit completely inside the table and not be cut off by table borders\n\t\t\tleft: 1,\n\t\t}),\n\t],\n\t'middle-of-many': [\n\t\tsharedDropTargetStyles,\n\t\tcss({\n\t\t\tleft: 0,\n\t\t\tright: 0,\n\t\t}),\n\t],\n\t'last-of-many': [\n\t\tsharedDropTargetStyles,\n\t\tcss({\n\t\t\tleft: 0,\n\t\t\t// for the last item, we are pushing a bit off the right so that the drop\n\t\t\t// indicator will sit completely inside the table and not be cut off by table borders\n\t\t\tright: 1,\n\t\t}),\n\t],\n};\n\nconst thStyles = css({\n\tborderBottom: `${token('border.width.selected')} solid ${token('color.border', 'red')}`,\n\t// Need position:relative so our drop indicator (which uses position:absolute) can be\n\t// correctly positioned inside\n\tposition: 'relative',\n\t// using border box sizing as that is what we will be applying as the width for `--local-resizing-width`\n\tboxSizing: 'border-box',\n\twidth: 'var(--local-resizing-width)',\n\n\tpaddingBlock: 8,\n});\n\nfunction getColumnType({\n\tindex,\n\tamountOfHeaders,\n}: {\n\tindex: number;\n\tamountOfHeaders: number;\n}): ColumnType {\n\tif (amountOfHeaders === 1) {\n\t\treturn 'only-column';\n\t}\n\tif (index === 0) {\n\t\treturn 'first-of-many';\n\t}\n\tif (index === amountOfHeaders - 1) {\n\t\treturn 'last-of-many';\n\t}\n\treturn 'middle-of-many';\n}\n\nexport function TableHeader({\n\tproperty,\n\tindex,\n\tamountOfHeaders,\n}: {\n\tproperty: keyof Item;\n\tindex: number;\n\tamountOfHeaders: number;\n}): React.JSX.Element {\n\tconst ref = useRef<HTMLTableCellElement | null>(null);\n\tconst dragHandleRef = useRef<HTMLButtonElement>(null);\n\tconst dropTargetRef = useRef<HTMLDivElement | null>(null);\n\tconst resizerRef = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<HeaderState>(idleState);\n\tconst columnType: ColumnType = getColumnType({ index, amountOfHeaders });\n\n\tconst { instanceId } = useContext(TableContext);\n\n\t// detect whether we should show a full height drop target\n\tuseEffect(() => {\n\t\treturn monitorForElements({\n\t\t\tcanMonitor({ source }) {\n\t\t\t\treturn (\n\t\t\t\t\tsource.data.instanceId === instanceId &&\n\t\t\t\t\tsource.data.type === 'table-header' &&\n\t\t\t\t\tsource.data.property !== property\n\t\t\t\t);\n\t\t\t},\n\t\t\tonDragStart() {\n\t\t\t\tconst el = ref.current;\n\t\t\t\tinvariant(el);\n\n\t\t\t\tsetState({\n\t\t\t\t\ttype: 'drop-target',\n\t\t\t\t\tclosestEdge: null,\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDrop() {\n\t\t\t\tsetState(idleState);\n\t\t\t},\n\t\t});\n\t}, [instanceId, property]);\n\n\t// Creating a drop target to power reordering the column headers\n\t// We are dynamically creating the drop targets after the drag starts\n\t// We are making the drop targets the full height of the table\n\t// so that the user can reorder the column anywhere on the edge of the column\n\tuseEffect(() => {\n\t\tif (state.type !== 'drop-target') {\n\t\t\treturn;\n\t\t}\n\n\t\tconst dropTarget = dropTargetRef.current;\n\t\tinvariant(dropTarget);\n\t\treturn dropTargetForElements({\n\t\t\telement: dropTarget,\n\t\t\tgetData({ input, element }) {\n\t\t\t\tconst data = { property, index };\n\t\t\t\treturn attachClosestEdge(data, {\n\t\t\t\t\tinput,\n\t\t\t\t\telement,\n\t\t\t\t\tallowedEdges: ['left', 'right'],\n\t\t\t\t});\n\t\t\t},\n\t\t\tcanDrop({ source }) {\n\t\t\t\treturn (\n\t\t\t\t\tsource.data.instanceId === instanceId &&\n\t\t\t\t\tsource.data.type === 'table-header' &&\n\t\t\t\t\tsource.data.property !== property\n\t\t\t\t);\n\t\t\t},\n\t\t\tonDrag(args) {\n\t\t\t\t// only update the state if the closestEdge has changed\n\t\t\t\t// Doing this to prevent lots of react re-renders\n\t\t\t\tsetState((current) => {\n\t\t\t\t\tif (current.type !== 'drop-target') {\n\t\t\t\t\t\treturn current;\n\t\t\t\t\t}\n\t\t\t\t\tconst closestEdge: Edge | null = extractClosestEdge(args.self.data);\n\t\t\t\t\tif (current.closestEdge === closestEdge) {\n\t\t\t\t\t\treturn current;\n\t\t\t\t\t}\n\t\t\t\t\treturn {\n\t\t\t\t\t\ttype: 'drop-target',\n\t\t\t\t\t\tclosestEdge,\n\t\t\t\t\t};\n\t\t\t\t});\n\n\t\t\t\tsetState({\n\t\t\t\t\ttype: 'drop-target',\n\t\t\t\t\tclosestEdge: extractClosestEdge(args.self.data),\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDragLeave() {\n\t\t\t\tsetState({\n\t\t\t\t\ttype: 'drop-target',\n\t\t\t\t\tclosestEdge: null,\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDrop() {\n\t\t\t\tsetState(idleState);\n\t\t\t},\n\t\t});\n\t}, [state.type, property, index, instanceId]);\n\n\t// Setting up the draggable header\n\tuseEffect(() => {\n\t\tconst el = ref.current;\n\t\tinvariant(el);\n\n\t\tconst dragHandle = dragHandleRef.current;\n\t\tinvariant(dragHandle);\n\n\t\treturn draggable({\n\t\t\telement: el,\n\t\t\tdragHandle,\n\t\t\tgetInitialData() {\n\t\t\t\treturn { type: 'table-header', property, index, instanceId };\n\t\t\t},\n\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\tgetOffset: pointerOutsideOfPreview({\n\t\t\t\t\t\tx: '18px',\n\t\t\t\t\t\ty: '18px',\n\t\t\t\t\t}),\n\t\t\t\t\trender: ({ container }) => {\n\t\t\t\t\t\t// Cause a `react` re-render to create your portal synchronously\n\t\t\t\t\t\tsetState({ type: 'preview', container });\n\t\t\t\t\t\t// In our cleanup function: cause a `react` re-render to create remove your portal\n\t\t\t\t\t\t// Note: you can also remove the portal in `onDragStart`,\n\t\t\t\t\t\t// which is when the cleanup function is called\n\t\t\t\t\t\treturn () => setState(draggingState);\n\t\t\t\t\t},\n\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDragStart() {\n\t\t\t\tsetState(draggingState);\n\t\t\t},\n\t\t\tonDrop() {\n\t\t\t\tsetState(idleState);\n\t\t\t},\n\t\t});\n\t}, [property, index, instanceId]);\n\n\tconst renderResizeHandle: boolean =\n\t\t(state.type === 'idle' || state.type === 'resizing') &&\n\t\t(columnType === 'first-of-many' || columnType === 'middle-of-many');\n\n\t// Setting up the draggable resize handle\n\t// How resizing works:\n\t// 1. change the size of the column header being dragged\n\t// 2. we change the _next_ column header by the opposite amount\n\tuseEffect(() => {\n\t\tif (!renderResizeHandle) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst handle = resizerRef.current;\n\t\tinvariant(handle);\n\t\tconst header = ref.current;\n\t\tinvariant(header);\n\n\t\treturn draggable({\n\t\t\telement: handle,\n\t\t\tgetInitialData() {\n\t\t\t\treturn { type: 'column-resize', property, index, instanceId };\n\t\t\t},\n\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\tdisableNativeDragPreview({ nativeSetDragImage });\n\t\t\t\tpreventUnhandled.start();\n\n\t\t\t\tconst initialWidth = header.getBoundingClientRect().width;\n\n\t\t\t\tconst nextHeader = header.nextElementSibling;\n\t\t\t\tinvariant(nextHeader instanceof HTMLElement);\n\t\t\t\tconst nextHeaderInitialWidth = nextHeader.getBoundingClientRect().width;\n\n\t\t\t\tconst table = header.closest('table');\n\t\t\t\tinvariant(table);\n\t\t\t\tconst tableWidth = table.getBoundingClientRect().width;\n\n\t\t\t\t// We cannot let `nextHeader` get smaller than `minColumnWidth`\n\t\t\t\tconst maxWidth = initialWidth + nextHeaderInitialWidth - minColumnWidth;\n\n\t\t\t\tsetState({\n\t\t\t\t\ttype: 'resizing',\n\t\t\t\t\tinitialWidth,\n\t\t\t\t\ttableWidth,\n\t\t\t\t\tnextHeaderInitialWidth,\n\t\t\t\t\tnextHeader,\n\t\t\t\t\tmaxWidth,\n\t\t\t\t});\n\t\t\t},\n\t\t\tonDrag({ location }) {\n\t\t\t\tconst diffX = location.current.input.clientX - location.initial.input.clientX;\n\n\t\t\t\tinvariant(state.type === 'resizing');\n\t\t\t\tconst { initialWidth, nextHeaderInitialWidth, nextHeader, maxWidth } = state;\n\n\t\t\t\t// Set the width of our header being resized\n\t\t\t\tconst proposedWidth = clamp({\n\t\t\t\t\tvalue: initialWidth + diffX,\n\t\t\t\t\tmin: minColumnWidth,\n\t\t\t\t\tmax: maxWidth,\n\t\t\t\t});\n\t\t\t\theader.style.setProperty('--local-resizing-width', `${proposedWidth}px`);\n\n\t\t\t\t// How much did the width of the header actually change?\n\t\t\t\tconst actualDiff = proposedWidth - initialWidth;\n\n\t\t\t\t// Now we need to make the opposite change to the next header\n\t\t\t\t//\n\t\t\t\t// Example: we have two columns A and B\n\t\t\t\t// If A is resizing to get larger, B needs to get smaller\n\t\t\t\tnextHeader.style.setProperty(\n\t\t\t\t\t'--local-resizing-width',\n\t\t\t\t\t`${nextHeaderInitialWidth - actualDiff}px`,\n\t\t\t\t);\n\t\t\t},\n\t\t\tonDrop() {\n\t\t\t\tpreventUnhandled.stop();\n\t\t\t\tsetState(idleState);\n\t\t\t},\n\t\t});\n\t}, [renderResizeHandle, index, property, state, instanceId]);\n\n\tconst label = getProperty(property);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<th ref={ref} css={[thStyles, state.type === 'dragging' ? headerDraggingStyles : undefined]}>\n\t\t\t\t{label}\n\n\t\t\t\t<ColumnMenuButton\n\t\t\t\t\tref={dragHandleRef}\n\t\t\t\t\tcolumnIndex={index}\n\t\t\t\t\tamountOfHeaders={amountOfHeaders}\n\t\t\t\t/>\n\n\t\t\t\t{/* Resizer */}\n\t\t\t\t{renderResizeHandle ? (\n\t\t\t\t\t<div\n\t\t\t\t\t\tref={resizerRef}\n\t\t\t\t\t\tcss={[resizerStyles, state.type === 'resizing' ? resizingStyles : undefined]}\n\t\t\t\t\t></div>\n\t\t\t\t) : null}\n\n\t\t\t\t{/* DropTarget */}\n\t\t\t\t{state.type === 'drop-target' && columnType !== 'only-column' ? (\n\t\t\t\t\t<div ref={dropTargetRef} css={dropTargetStyles[columnType]}>\n\t\t\t\t\t\t{state.closestEdge && <DropIndicator edge={state.closestEdge} type=\"no-terminal\" />}\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</th>\n\t\t\t{state.type === 'preview'\n\t\t\t\t? ReactDOM.createPortal(<ColumnPreview property={property} />, state.container)\n\t\t\t\t: null}\n\t\t</Fragment>\n\t);\n}\n\nconst previewStyles = xcss({\n\tborderRadius: 'radius.small',\n\tminWidth: '220px',\n});\n\nconst previewHeaderStyles = xcss({\n\tfontWeight: token('font.weight.bold', 'bold'),\n\tborderBottom: `${token('border.width.selected')} solid ${token('color.border', 'red')}`,\n\tlineHeight: '32px',\n});\n\nfunction ColumnPreview({ property }: { property: keyof Item }) {\n\tconst context = useContext(TableContext);\n\n\tconst { items, isMoreItems } = context.getItemsForColumnPreview();\n\n\treturn (\n\t\t<Box\n\t\t\tbackgroundColor=\"elevation.surface\"\n\t\t\tpadding=\"space.100\"\n\t\t\tpaddingBlockStart=\"space.0\"\n\t\t\txcss={previewStyles}\n\t\t>\n\t\t\t<Stack space=\"space.050\">\n\t\t\t\t<Box xcss={previewHeaderStyles}>{getProperty(property)}</Box>\n\t\t\t\t{items.map((item) => (\n\t\t\t\t\t<div key={item.id}>{getField({ item, property })}</div>\n\t\t\t\t))}\n\t\t\t\t{/* Only show \"+ more\" if there are actually more items */}\n\t\t\t\t{isMoreItems ? <em>+ more</em> : null}\n\t\t\t</Stack>\n\t\t</Box>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/table/types.ts",
    "content": "import type { Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/types';\n\nimport { type Person } from '../../data/people';\n\nexport type Status = 'todo' | 'in-progress' | 'done';\n\nexport type Item = {\n\tid: string;\n\tstatus: Status;\n\tdescription: string;\n\tassignee: Person;\n};\n\nexport type ItemRegistration = {\n\titem: Item;\n\telement: HTMLElement;\n\tindex: number;\n};\n\nexport type ReorderFunction = (args: {\n\tstartIndex: number;\n\tindexOfTarget: number;\n\tclosestEdgeOfTarget?: Edge | null;\n}) => void;\n"
  },
  {
    "path": "packages/documentation/examples/pieces/tree/move-dialog.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { jsx } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport Button from '@atlaskit/button/new';\nimport Form, { Field } from '@atlaskit/form';\nimport Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';\nimport Select from '@atlaskit/select';\n\nimport { TreeContext } from './tree-context';\n\ntype FormData = {\n\tparent: { value: string };\n\tposition: { value: number };\n};\n\nexport function MoveDialog({\n\tonClose,\n\titemId,\n}: {\n\tonClose: () => void;\n\titemId: string;\n}): React.JSX.Element {\n\tconst { dispatch, getChildrenOfItem, getMoveTargets, getPathToItem } = useContext(TreeContext);\n\n\tconst options = useMemo(() => {\n\t\tconst targets = getMoveTargets({ itemId });\n\n\t\tconst targetOptions = targets.map((item) => {\n\t\t\treturn { label: `Item ${item.id}`, value: item.id };\n\t\t});\n\n\t\treturn [{ label: 'No parent', value: '' }, ...targetOptions];\n\t}, [getMoveTargets, itemId]);\n\n\tconst defaultParent: { label: string; value: string } = useMemo(() => {\n\t\tconst path = getPathToItem(itemId);\n\t\tconst parentId = path[path.length - 1] ?? '';\n\t\tconst option = options.find((option) => option.value === parentId);\n\t\tinvariant(option);\n\t\treturn option;\n\t}, [getPathToItem, itemId, options]);\n\n\tconst [parentId, setParentId] = useState(defaultParent.value);\n\tconst positionOptions = useMemo(() => {\n\t\tconst targets = getChildrenOfItem(parentId).filter((item) => item.id !== itemId);\n\t\treturn Array.from({ length: targets.length + 1 }, (_, index) => {\n\t\t\t/**\n\t\t\t * Adding one to convert index to positions\n\t\t\t */\n\t\t\treturn { label: String(index + 1), value: index + 1 };\n\t\t});\n\t}, [getChildrenOfItem, itemId, parentId]);\n\n\tconst onSubmit = useCallback(\n\t\t(formData: FormData) => {\n\t\t\tconsole.log('formData = ', formData);\n\t\t\tdispatch({\n\t\t\t\ttype: 'modal-move',\n\t\t\t\titemId,\n\t\t\t\ttargetId: formData.parent.value,\n\t\t\t\t/**\n\t\t\t\t * Subtract one to convert the position back to an index\n\t\t\t\t */\n\t\t\t\tindex: formData.position.value - 1,\n\t\t\t});\n\t\t},\n\t\t[dispatch, itemId],\n\t);\n\n\tconst parentSelectRef = useRef(null);\n\n\treturn (\n\t\t<Modal onClose={onClose} autoFocus={parentSelectRef}>\n\t\t\t<Form<FormData> onSubmit={onSubmit}>\n\t\t\t\t{({ formProps, setFieldValue }) => (\n\t\t\t\t\t<form {...formProps}>\n\t\t\t\t\t\t<ModalHeader hasCloseButton>\n\t\t\t\t\t\t\t<ModalTitle>Move</ModalTitle>\n\t\t\t\t\t\t</ModalHeader>\n\t\t\t\t\t\t<ModalBody>\n\t\t\t\t\t\t\t<Field<{ value: string }>\n\t\t\t\t\t\t\t\tid=\"parent\"\n\t\t\t\t\t\t\t\tname=\"parent\"\n\t\t\t\t\t\t\t\tlabel=\"Parent\"\n\t\t\t\t\t\t\t\tisRequired\n\t\t\t\t\t\t\t\tdefaultValue={defaultParent}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{({ fieldProps }) => (\n\t\t\t\t\t\t\t\t\t<Select\n\t\t\t\t\t\t\t\t\t\t{...fieldProps}\n\t\t\t\t\t\t\t\t\t\tref={parentSelectRef}\n\t\t\t\t\t\t\t\t\t\tonChange={(option) => {\n\t\t\t\t\t\t\t\t\t\t\tinvariant(option !== null);\n\t\t\t\t\t\t\t\t\t\t\tsetParentId(option.value);\n\t\t\t\t\t\t\t\t\t\t\tfieldProps.onChange(option);\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\tmenuPosition=\"fixed\"\n\t\t\t\t\t\t\t\t\t\toptions={options}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Field>\n\t\t\t\t\t\t\t<PositionSelectField options={positionOptions} setFieldValue={setFieldValue} />\n\t\t\t\t\t\t</ModalBody>\n\t\t\t\t\t\t<ModalFooter>\n\t\t\t\t\t\t\t<Button appearance=\"subtle\" onClick={onClose}>\n\t\t\t\t\t\t\t\tCancel\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t<Button appearance=\"primary\" onClick={onClose} type=\"submit\">\n\t\t\t\t\t\t\t\tMove\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</ModalFooter>\n\t\t\t\t\t</form>\n\t\t\t\t)}\n\t\t\t</Form>\n\t\t</Modal>\n\t);\n}\n\nfunction PositionSelectField({\n\toptions,\n\tsetFieldValue,\n}: {\n\toptions: readonly { label: string; value: number }[];\n\tsetFieldValue: (name: string, value: any) => void;\n}) {\n\t/**\n\t * Whenever the options change we are resetting the value to the first value.\n\t *\n\t * This is to prevent an out of bounds selection.\n\t */\n\tuseEffect(() => {\n\t\tsetFieldValue('position', options[0]);\n\t}, [options, setFieldValue]);\n\n\treturn (\n\t\t<Field<{ value: number } | null>\n\t\t\tid=\"position\"\n\t\t\tname=\"position\"\n\t\t\tlabel=\"Position\"\n\t\t\tisRequired\n\t\t\tdefaultValue={options[0]}\n\t\t>\n\t\t\t{({ fieldProps }) => <Select {...fieldProps} menuPosition=\"fixed\" options={options} />}\n\t\t</Field>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/tree/tree-context.tsx",
    "content": "import { createContext } from 'react';\n\nimport {\n\tattachInstruction,\n\textractInstruction,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/list-item';\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/list-item';\n\nimport type { TreeAction, TreeItem } from '../../data/tree';\n\nexport type TreeContextValue = {\n\tdispatch: (action: TreeAction) => void;\n\tuniqueContextId: Symbol;\n\tgetPathToItem: (itemId: string) => string[];\n\tgetMoveTargets: ({ itemId }: { itemId: string }) => TreeItem[];\n\tgetChildrenOfItem: (itemId: string) => TreeItem[];\n\tregisterTreeItem: (args: {\n\t\titemId: string;\n\t\telement: HTMLElement;\n\t\tactionMenuTrigger: HTMLElement;\n\t}) => void;\n};\n\nexport const TreeContext = createContext<TreeContextValue>({\n\tdispatch: () => {},\n\tuniqueContextId: Symbol('uniqueId'),\n\tgetPathToItem: () => [],\n\tgetMoveTargets: () => [],\n\tgetChildrenOfItem: () => [],\n\tregisterTreeItem: () => {},\n});\n\nexport type DependencyContext = {\n\tDropIndicator: typeof DropIndicator;\n\tattachInstruction: typeof attachInstruction;\n\textractInstruction: typeof extractInstruction;\n};\n\nexport const DependencyContext = createContext<DependencyContext>({\n\tDropIndicator: DropIndicator,\n\tattachInstruction: attachInstruction,\n\textractInstruction: extractInstruction,\n});\n"
  },
  {
    "path": "packages/documentation/examples/pieces/tree/tree-item.tsx",
    "content": "/* eslint-disable @atlaskit/design-system/no-html-button */\n/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport { Fragment, memo, useCallback, useContext, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport ReactDOM from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport Button from '@atlaskit/button';\nimport DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';\n// eslint-disable-next-line @atlaskit/design-system/no-banned-imports\nimport mergeRefs from '@atlaskit/ds-lib/merge-refs';\nimport FocusRing from '@atlaskit/focus-ring';\nimport ChevronDownIcon from '@atlaskit/icon/core/chevron-down';\nimport ChevronRightIcon from '@atlaskit/icon/core/chevron-right';\nimport MoreIcon from '@atlaskit/icon/core/show-more-horizontal';\nimport { ModalTransition } from '@atlaskit/modal-dialog';\nimport { type Instruction } from '@atlaskit/pragmatic-drag-and-drop-hitbox/list-item';\nimport { GroupDropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/group';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\ttype ElementDropTargetEventBasePayload,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\nimport { token } from '@atlaskit/tokens';\n\nimport { type TreeItem as TreeItemType } from '../../data/tree-legacy';\n\nimport { MoveDialog } from './move-dialog';\nimport { DependencyContext, TreeContext } from './tree-context';\n\nconst iconColor = token('color.icon', '#44546F');\n\nfunction ChildIcon() {\n\treturn (\n\t\t<svg aria-hidden={true} width={24} height={24} viewBox=\"0 0 24 24\">\n\t\t\t<circle cx={12} cy={12} r={2} fill={iconColor} />\n\t\t</svg>\n\t);\n}\n\nfunction GroupIcon({ isOpen }: { isOpen: boolean }) {\n\tconst Icon = isOpen ? ChevronDownIcon : ChevronRightIcon;\n\treturn <Icon spacing=\"spacious\" label=\"\" color={iconColor} size=\"small\" />;\n}\n\nfunction Icon({ item }: { item: TreeItemType }) {\n\tif (!item.children.length) {\n\t\treturn <ChildIcon />;\n\t}\n\treturn <GroupIcon isOpen={item.isOpen ?? false} />;\n}\n\nconst outerStyles = css({\n\t// needed for our action button that uses position:absolute\n\tposition: 'relative',\n});\n\nconst outerButtonStyles = css({\n\t/**\n\t * Without this Safari renders white text on drag.\n\t */\n\tcolor: token('color.text', 'currentColor'),\n\n\tborder: 0,\n\twidth: '100%',\n\tposition: 'relative',\n\tbackground: 'transparent',\n\tmargin: 0,\n\tpadding: 0,\n\tborderRadius: 3,\n\tcursor: 'pointer',\n});\n\nconst outerHoverStyles = css({\n\tborderRadius: 3,\n\tcursor: 'pointer',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':hover': {\n\t\tbackground: token('color.background.neutral.subtle.hovered', 'rgba(9, 30, 66, 0.06)'),\n\t},\n});\n\nconst innerDraggingStyles = css({\n\topacity: 0.4,\n});\n\nconst innerButtonStyles = css({\n\tpadding: token('space.100'),\n\tpaddingRight: 40,\n\talignItems: 'center',\n\tdisplay: 'flex',\n\tflexDirection: 'row',\n\n\tbackground: token('color.background.neutral.subtle', 'transparent'),\n\tborderRadius: 3,\n});\n\nconst idStyles = css({\n\tmargin: 0,\n\tcolor: token('color.text.disabled', '#8993A5'),\n});\n\nconst labelStyles = css({\n\tflexGrow: 1,\n\toverflow: 'hidden',\n\ttextAlign: 'left',\n\ttextOverflow: 'ellipsis',\n\twhiteSpace: 'nowrap',\n});\n\nconst indentPerLevel = token('space.250');\n\nconst indentStyles = css({\n\tpaddingLeft: indentPerLevel,\n});\n\nconst fullWidthStyle = css({\n\tposition: 'absolute',\n\tinset: 0,\n});\n\nconst previewStyles = css({\n\tbackground: token('elevation.surface.raised', 'red'),\n\tpadding: token('space.100'),\n\tborderRadius: 3,\n});\n\nfunction Preview({ item }: { item: TreeItemType }) {\n\treturn <div css={previewStyles}>Item {item.id}</div>;\n}\n\nfunction delay({ waitMs: timeMs, fn }: { waitMs: number; fn: () => void }): () => void {\n\tlet timeoutId: number | null = window.setTimeout(() => {\n\t\ttimeoutId = null;\n\t\tfn();\n\t}, timeMs);\n\treturn function cancel() {\n\t\tif (timeoutId) {\n\t\t\twindow.clearTimeout(timeoutId);\n\t\t\ttimeoutId = null;\n\t\t}\n\t};\n}\n\nconst TreeItem = memo(function TreeItem({\n\titem,\n\tlevel,\n\tindex,\n}: {\n\titem: TreeItemType;\n\tlevel: number;\n\tindex: number;\n}) {\n\tconst buttonRef = useRef<HTMLButtonElement | null>(null);\n\tconst groupRef = useRef<HTMLDivElement | null>(null);\n\n\tconst [state, setState] = useState<'idle' | 'dragging' | 'preview'>('idle');\n\tconst [groupState, setGroupState] = useState<'is-innermost-over' | 'idle'>('idle');\n\tconst [instruction, setInstruction] = useState<Instruction | null>(null);\n\tconst cancelExpandRef = useRef<(() => void) | null>(null);\n\n\tconst { dispatch, uniqueContextId, getPathToItem, registerTreeItem } = useContext(TreeContext);\n\tconst { DropIndicator, attachInstruction, extractInstruction } = useContext(DependencyContext);\n\tconst toggleOpen = useCallback(() => {\n\t\tdispatch({ type: 'toggle', itemId: item.id });\n\t}, [dispatch, item]);\n\n\tconst actionMenuTriggerRef = useRef<HTMLButtonElement>(null);\n\tuseEffect(() => {\n\t\tinvariant(buttonRef.current);\n\t\tinvariant(actionMenuTriggerRef.current);\n\t\treturn registerTreeItem({\n\t\t\titemId: item.id,\n\t\t\telement: buttonRef.current,\n\t\t\tactionMenuTrigger: actionMenuTriggerRef.current,\n\t\t});\n\t}, [item.id, registerTreeItem]);\n\n\tconst cancelExpand = useCallback(() => {\n\t\tcancelExpandRef.current?.();\n\t\tcancelExpandRef.current = null;\n\t}, []);\n\n\tuseEffect(() => {\n\t\tinvariant(buttonRef.current);\n\n\t\tfunction onChange({ self }: ElementDropTargetEventBasePayload) {\n\t\t\tconst instruction = extractInstruction(self.data);\n\n\t\t\t// expand after 500ms if still merging\n\t\t\tif (\n\t\t\t\tinstruction?.operation === 'combine' &&\n\t\t\t\titem.children.length &&\n\t\t\t\t!item.isOpen &&\n\t\t\t\t!cancelExpandRef.current\n\t\t\t) {\n\t\t\t\tcancelExpandRef.current = delay({\n\t\t\t\t\twaitMs: 500,\n\t\t\t\t\tfn: () => dispatch({ type: 'expand', itemId: item.id }),\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (instruction?.operation !== 'combine' && cancelExpandRef.current) {\n\t\t\t\tcancelExpand();\n\t\t\t}\n\n\t\t\tsetInstruction(instruction);\n\t\t\treturn;\n\t\t}\n\n\t\treturn combine(\n\t\t\tdraggable({\n\t\t\t\telement: buttonRef.current,\n\t\t\t\tgetInitialData: () => ({\n\t\t\t\t\tid: item.id,\n\t\t\t\t\ttype: 'tree-item',\n\t\t\t\t\tisOpenOnDragStart: item.isOpen,\n\t\t\t\t\tuniqueContextId,\n\t\t\t\t}),\n\t\t\t\tonGenerateDragPreview: ({ nativeSetDragImage }) => {\n\t\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\t\tgetOffset: pointerOutsideOfPreview({ x: '16px', y: '8px' }),\n\t\t\t\t\t\trender: ({ container }) => {\n\t\t\t\t\t\t\t// eslint-disable-next-line react/no-deprecated\n\t\t\t\t\t\t\tReactDOM.render(<Preview item={item} />, container);\n\t\t\t\t\t\t\t// eslint-disable-next-line react/no-deprecated\n\t\t\t\t\t\t\treturn () => ReactDOM.unmountComponentAtNode(container);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragStart: ({ source }) => {\n\t\t\t\t\tsetState('dragging');\n\t\t\t\t\t// collapse open items during a drag\n\t\t\t\t\tif (source.data.isOpenOnDragStart) {\n\t\t\t\t\t\tdispatch({ type: 'collapse', itemId: item.id });\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonDrop: ({ source }) => {\n\t\t\t\t\tsetState('idle');\n\t\t\t\t\tif (source.data.isOpenOnDragStart) {\n\t\t\t\t\t\tdispatch({ type: 'expand', itemId: item.id });\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement: buttonRef.current,\n\t\t\t\tgetData: ({ input, element }) => {\n\t\t\t\t\tconst data = { id: item.id };\n\n\t\t\t\t\treturn attachInstruction(data, {\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\telement,\n\t\t\t\t\t\toperations: item.isDraft\n\t\t\t\t\t\t\t? { combine: 'blocked' }\n\t\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t\tcombine: 'available',\n\t\t\t\t\t\t\t\t\t'reorder-before': 'available',\n\t\t\t\t\t\t\t\t\t// Don't allow 'reorder-after' on expanded items\n\t\t\t\t\t\t\t\t\t'reorder-after':\n\t\t\t\t\t\t\t\t\t\titem.isOpen && item.children.length ? 'not-available' : 'available',\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tcanDrop: ({ source }) =>\n\t\t\t\t\tsource.data.type === 'tree-item' &&\n\t\t\t\t\tsource.data.id !== item.id &&\n\t\t\t\t\tsource.data.uniqueContextId === uniqueContextId,\n\t\t\t\tonDragEnter: onChange,\n\t\t\t\tonDrag: onChange,\n\t\t\t\tonDragLeave: () => {\n\t\t\t\t\tcancelExpand();\n\t\t\t\t\tsetInstruction(null);\n\t\t\t\t},\n\t\t\t\tonDrop: () => {\n\t\t\t\t\tcancelExpand();\n\t\t\t\t\tsetInstruction(null);\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [\n\t\tdispatch,\n\t\titem,\n\t\tcancelExpand,\n\t\tuniqueContextId,\n\t\textractInstruction,\n\t\tattachInstruction,\n\t\tgetPathToItem,\n\t]);\n\n\tuseEffect(() => {\n\t\tconst group = groupRef.current;\n\t\t// item has no children or is not open\n\t\tif (!group) {\n\t\t\treturn;\n\t\t}\n\n\t\tfunction onChange({ location, self }: ElementDropTargetEventBasePayload) {\n\t\t\tconst [innerMost] = location.current.dropTargets.filter(\n\t\t\t\t(dropTarget) => dropTarget.data.type === 'group',\n\t\t\t);\n\n\t\t\tsetGroupState(innerMost?.element === self.element ? 'is-innermost-over' : 'idle');\n\t\t}\n\n\t\treturn dropTargetForElements({\n\t\t\telement: group,\n\t\t\tcanDrop: ({ source }) =>\n\t\t\t\tsource.data.type === 'tree-item' &&\n\t\t\t\tsource.data.id !== item.id &&\n\t\t\t\tsource.data.uniqueContextId === uniqueContextId,\n\t\t\tgetData: () => ({ type: 'group' }),\n\t\t\tgetIsSticky: () => false,\n\t\t\tonDragStart: onChange,\n\t\t\tonDropTargetChange: onChange,\n\t\t\tonDragLeave: () => setGroupState('idle'),\n\t\t\tonDrop: () => setGroupState('idle'),\n\t\t});\n\t}, [item.id, uniqueContextId]);\n\n\tuseEffect(\n\t\tfunction mount() {\n\t\t\treturn function unmount() {\n\t\t\t\tcancelExpand();\n\t\t\t};\n\t\t},\n\t\t[cancelExpand],\n\t);\n\n\tconst aria = (() => {\n\t\tif (!item.children.length) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn {\n\t\t\t'aria-expanded': item.isOpen,\n\t\t\t'aria-controls': `tree-item-${item.id}--subtree`,\n\t\t};\n\t})();\n\n\tconst [isMoveDialogOpen, setIsMoveDialogOpen] = useState(false);\n\tconst openMoveDialog = useCallback(() => {\n\t\tsetIsMoveDialogOpen(true);\n\t}, []);\n\tconst closeMoveDialog = useCallback(() => {\n\t\tsetIsMoveDialogOpen(false);\n\t}, []);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<div css={[outerStyles, state === 'idle' ? outerHoverStyles : undefined]}>\n\t\t\t\t<FocusRing isInset>\n\t\t\t\t\t<button\n\t\t\t\t\t\t{...aria}\n\t\t\t\t\t\tcss={[outerButtonStyles]}\n\t\t\t\t\t\tid={`tree-item-${item.id}`}\n\t\t\t\t\t\tonClick={toggleOpen}\n\t\t\t\t\t\tref={buttonRef}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tdata-index={index}\n\t\t\t\t\t\tdata-level={level}\n\t\t\t\t\t\tdata-testid={`tree-item-${item.id}`}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span css={[innerButtonStyles, state === 'dragging' ? innerDraggingStyles : undefined]}>\n\t\t\t\t\t\t\t<Icon item={item} />\n\t\t\t\t\t\t\t<span css={labelStyles}>Item {item.id}</span>\n\t\t\t\t\t\t\t{/* eslint-disable-next-line @atlaskit/design-system/no-html-code */}\n\t\t\t\t\t\t\t<small css={idStyles}>{item.isDraft ? <code>Draft</code> : null}</small>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t{instruction ? <DropIndicator instruction={instruction} /> : null}\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tcss={fullWidthStyle}\n\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\tleft: `calc(-1 * ${level} * ${indentPerLevel}`,\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</button>\n\t\t\t\t</FocusRing>\n\t\t\t\t<DropdownMenu\n\t\t\t\t\ttrigger={({ triggerRef, ...triggerProps }) => (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tref={mergeRefs([triggerRef, actionMenuTriggerRef])}\n\t\t\t\t\t\t\ticonBefore={\n\t\t\t\t\t\t\t\t<MoreIcon\n\t\t\t\t\t\t\t\t\tlabel=\"Actions\"\n\t\t\t\t\t\t\t\t\tcolor={token('color.icon.subtle', '#626F86')}\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t{...triggerProps}\n\t\t\t\t\t\t\tspacing=\"compact\"\n\t\t\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\t\t\tstyle={{ position: 'absolute', top: 8, right: 8 }}\n\t\t\t\t\t\t\tappearance=\"subtle\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tshouldRenderToParent\n\t\t\t\t>\n\t\t\t\t\t<DropdownItemGroup>\n\t\t\t\t\t\t<DropdownItem onClick={openMoveDialog}>Move</DropdownItem>\n\t\t\t\t\t</DropdownItemGroup>\n\t\t\t\t</DropdownMenu>\n\t\t\t</div>\n\t\t\t{item.children.length && item.isOpen ? (\n\t\t\t\t<div id={aria?.['aria-controls']} css={indentStyles}>\n\t\t\t\t\t<GroupDropIndicator isActive={groupState === 'is-innermost-over'} ref={groupRef}>\n\t\t\t\t\t\t{item.children.map((child, index) => {\n\t\t\t\t\t\t\treturn <TreeItem item={child} key={child.id} level={level + 1} index={index} />;\n\t\t\t\t\t\t})}\n\t\t\t\t\t</GroupDropIndicator>\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t\t<ModalTransition>\n\t\t\t\t{isMoveDialogOpen && <MoveDialog onClose={closeMoveDialog} itemId={item.id} />}\n\t\t\t</ModalTransition>\n\t\t</Fragment>\n\t);\n});\n\nexport default TreeItem;\n"
  },
  {
    "path": "packages/documentation/examples/pieces/tree-legacy/constants.ts",
    "content": "export const indentPerLevel = 32;\n"
  },
  {
    "path": "packages/documentation/examples/pieces/tree-legacy/move-dialog.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { jsx } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport Button from '@atlaskit/button/new';\nimport Form, { Field } from '@atlaskit/form';\nimport Modal, { ModalBody, ModalFooter, ModalHeader, ModalTitle } from '@atlaskit/modal-dialog';\nimport Select from '@atlaskit/select';\n\nimport { TreeContext } from './tree-context';\n\ntype FormData = {\n\tparent: { value: string };\n\tposition: { value: number };\n};\n\nexport function MoveDialog({\n\tonClose,\n\titemId,\n}: {\n\tonClose: () => void;\n\titemId: string;\n}): React.JSX.Element {\n\tconst { dispatch, getChildrenOfItem, getMoveTargets, getPathToItem } = useContext(TreeContext);\n\n\tconst options = useMemo(() => {\n\t\tconst targets = getMoveTargets({ itemId });\n\n\t\tconst targetOptions = targets.map((item) => {\n\t\t\treturn { label: `Item ${item.id}`, value: item.id };\n\t\t});\n\n\t\treturn [{ label: 'No parent', value: '' }, ...targetOptions];\n\t}, [getMoveTargets, itemId]);\n\n\tconst defaultParent: { label: string; value: string } = useMemo(() => {\n\t\tconst path = getPathToItem(itemId);\n\t\tconst parentId = path[path.length - 1] ?? '';\n\t\tconst option = options.find((option) => option.value === parentId);\n\t\tinvariant(option);\n\t\treturn option;\n\t}, [getPathToItem, itemId, options]);\n\n\tconst [parentId, setParentId] = useState(defaultParent.value);\n\tconst positionOptions = useMemo(() => {\n\t\tconst targets = getChildrenOfItem(parentId).filter((item) => item.id !== itemId);\n\t\treturn Array.from({ length: targets.length + 1 }, (_, index) => {\n\t\t\t/**\n\t\t\t * Adding one to convert index to positions\n\t\t\t */\n\t\t\treturn { label: String(index + 1), value: index + 1 };\n\t\t});\n\t}, [getChildrenOfItem, itemId, parentId]);\n\n\tconst onSubmit = useCallback(\n\t\t(formData: FormData) => {\n\t\t\tconsole.log('formData = ', formData);\n\t\t\tdispatch({\n\t\t\t\ttype: 'modal-move',\n\t\t\t\titemId,\n\t\t\t\ttargetId: formData.parent.value,\n\t\t\t\t/**\n\t\t\t\t * Subtract one to convert the position back to an index\n\t\t\t\t */\n\t\t\t\tindex: formData.position.value - 1,\n\t\t\t});\n\t\t},\n\t\t[dispatch, itemId],\n\t);\n\n\tconst parentSelectRef = useRef(null);\n\n\treturn (\n\t\t<Modal onClose={onClose} autoFocus={parentSelectRef}>\n\t\t\t<Form<FormData> onSubmit={onSubmit}>\n\t\t\t\t{({ formProps, setFieldValue }) => (\n\t\t\t\t\t<form {...formProps}>\n\t\t\t\t\t\t<ModalHeader hasCloseButton>\n\t\t\t\t\t\t\t<ModalTitle>Move</ModalTitle>\n\t\t\t\t\t\t</ModalHeader>\n\t\t\t\t\t\t<ModalBody>\n\t\t\t\t\t\t\t<Field<{ value: string }>\n\t\t\t\t\t\t\t\tid=\"parent\"\n\t\t\t\t\t\t\t\tname=\"parent\"\n\t\t\t\t\t\t\t\tlabel=\"Parent\"\n\t\t\t\t\t\t\t\tisRequired\n\t\t\t\t\t\t\t\tdefaultValue={defaultParent}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{({ fieldProps }) => (\n\t\t\t\t\t\t\t\t\t<Select\n\t\t\t\t\t\t\t\t\t\t{...fieldProps}\n\t\t\t\t\t\t\t\t\t\tref={parentSelectRef}\n\t\t\t\t\t\t\t\t\t\tonChange={(option) => {\n\t\t\t\t\t\t\t\t\t\t\tinvariant(option !== null);\n\t\t\t\t\t\t\t\t\t\t\tsetParentId(option.value);\n\t\t\t\t\t\t\t\t\t\t\tfieldProps.onChange(option);\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\tmenuPosition=\"fixed\"\n\t\t\t\t\t\t\t\t\t\toptions={options}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Field>\n\t\t\t\t\t\t\t<PositionSelectField options={positionOptions} setFieldValue={setFieldValue} />\n\t\t\t\t\t\t</ModalBody>\n\t\t\t\t\t\t<ModalFooter>\n\t\t\t\t\t\t\t<Button appearance=\"subtle\" onClick={onClose}>\n\t\t\t\t\t\t\t\tCancel\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t\t<Button appearance=\"primary\" onClick={onClose} type=\"submit\">\n\t\t\t\t\t\t\t\tMove\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</ModalFooter>\n\t\t\t\t\t</form>\n\t\t\t\t)}\n\t\t\t</Form>\n\t\t</Modal>\n\t);\n}\n\nfunction PositionSelectField({\n\toptions,\n\tsetFieldValue,\n}: {\n\toptions: readonly { label: string; value: number }[];\n\tsetFieldValue: (name: string, value: any) => void;\n}) {\n\t/**\n\t * Whenever the options change we are resetting the value to the first value.\n\t *\n\t * This is to prevent an out of bounds selection.\n\t */\n\tuseEffect(() => {\n\t\tsetFieldValue('position', options[0]);\n\t}, [options, setFieldValue]);\n\n\treturn (\n\t\t<Field<{ value: number } | null>\n\t\t\tid=\"position\"\n\t\t\tname=\"position\"\n\t\t\tlabel=\"Position\"\n\t\t\tisRequired\n\t\t\tdefaultValue={options[0]}\n\t\t>\n\t\t\t{({ fieldProps }) => <Select {...fieldProps} menuPosition=\"fixed\" options={options} />}\n\t\t</Field>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/pieces/tree-legacy/tree-context.tsx",
    "content": "import { createContext } from 'react';\n\nimport {\n\tattachInstruction,\n\textractInstruction,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/tree-item';\n\nimport type { TreeAction, TreeItem } from '../../data/tree-legacy';\n\nexport type TreeContextValue = {\n\tdispatch: (action: TreeAction) => void;\n\tuniqueContextId: Symbol;\n\tgetPathToItem: (itemId: string) => string[];\n\tgetMoveTargets: ({ itemId }: { itemId: string }) => TreeItem[];\n\tgetChildrenOfItem: (itemId: string) => TreeItem[];\n\tregisterTreeItem: (args: {\n\t\titemId: string;\n\t\telement: HTMLElement;\n\t\tactionMenuTrigger: HTMLElement;\n\t}) => void;\n};\n\nexport const TreeContext = createContext<TreeContextValue>({\n\tdispatch: () => {},\n\tuniqueContextId: Symbol('uniqueId'),\n\tgetPathToItem: () => [],\n\tgetMoveTargets: () => [],\n\tgetChildrenOfItem: () => [],\n\tregisterTreeItem: () => {},\n});\n\nexport type DependencyContext = {\n\tDropIndicator: typeof DropIndicator;\n\tattachInstruction: typeof attachInstruction;\n\textractInstruction: typeof extractInstruction;\n};\n\nexport const DependencyContext = createContext<DependencyContext>({\n\tDropIndicator: DropIndicator,\n\tattachInstruction: attachInstruction,\n\textractInstruction: extractInstruction,\n});\n"
  },
  {
    "path": "packages/documentation/examples/pieces/tree-legacy/tree-item.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport { Fragment, memo, useCallback, useContext, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport ReactDOM from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport Button from '@atlaskit/button';\nimport DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';\n// eslint-disable-next-line @atlaskit/design-system/no-banned-imports\nimport mergeRefs from '@atlaskit/ds-lib/merge-refs';\nimport FocusRing from '@atlaskit/focus-ring';\nimport ChevronDownIcon from '@atlaskit/icon/core/chevron-down';\nimport ChevronRightIcon from '@atlaskit/icon/core/chevron-right';\nimport MoreIcon from '@atlaskit/icon/core/show-more-horizontal';\nimport { ModalTransition } from '@atlaskit/modal-dialog';\nimport {\n\ttype Instruction,\n\ttype ItemMode,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\ttype ElementDropTargetEventBasePayload,\n\tmonitorForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\nimport type { DragLocationHistory } from '@atlaskit/pragmatic-drag-and-drop/types';\nimport { token } from '@atlaskit/tokens';\n\nimport { type TreeItem as TreeItemType } from '../../data/tree-legacy';\n\nimport { indentPerLevel } from './constants';\nimport { MoveDialog } from './move-dialog';\nimport { DependencyContext, TreeContext } from './tree-context';\n\nconst iconColor = token('color.icon', '#44546F');\n\nfunction ChildIcon() {\n\treturn (\n\t\t<svg aria-hidden={true} width={24} height={24} viewBox=\"0 0 24 24\">\n\t\t\t<circle cx={12} cy={12} r={2} fill={iconColor} />\n\t\t</svg>\n\t);\n}\n\nfunction GroupIcon({ isOpen }: { isOpen: boolean }) {\n\tconst Icon = isOpen ? ChevronDownIcon : ChevronRightIcon;\n\treturn <Icon spacing=\"spacious\" label=\"\" color={iconColor} size=\"small\" />;\n}\n\nfunction Icon({ item }: { item: TreeItemType }) {\n\tif (!item.children.length) {\n\t\treturn <ChildIcon />;\n\t}\n\treturn <GroupIcon isOpen={item.isOpen ?? false} />;\n}\n\nconst outerStyles = css({\n\t// needed for our action button that uses position:absolute\n\tposition: 'relative',\n\t'--grid': '8px',\n});\n\nconst outerButtonStyles = css({\n\t/**\n\t * Without this Safari renders white text on drag.\n\t */\n\tcolor: token('color.text', 'currentColor'),\n\n\tborder: 0,\n\twidth: '100%',\n\tposition: 'relative',\n\tbackground: 'transparent',\n\tmargin: 0,\n\tpadding: 0,\n\tborderRadius: 3,\n\tcursor: 'pointer',\n});\n\nconst outerHoverStyles = css({\n\tborderRadius: 3,\n\tcursor: 'pointer',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':hover': {\n\t\tbackground: token('color.background.neutral.subtle.hovered', 'rgba(9, 30, 66, 0.06)'),\n\t},\n});\n\nconst innerDraggingStyles = css({\n\topacity: 0.4,\n});\n\nconst innerButtonStyles = css({\n\tpadding: 'var(--grid)',\n\tpaddingRight: 40,\n\talignItems: 'center',\n\tdisplay: 'flex',\n\tflexDirection: 'row',\n\n\tbackground: token('color.background.neutral.subtle', 'transparent'),\n\tborderRadius: 3,\n});\n\nconst idStyles = css({\n\tmargin: 0,\n\tcolor: token('color.text.disabled', '#8993A5'),\n});\n\nconst labelStyles = css({\n\tflexGrow: 1,\n\toverflow: 'hidden',\n\ttextAlign: 'left',\n\ttextOverflow: 'ellipsis',\n\twhiteSpace: 'nowrap',\n});\n\nconst debugStyles = css({\n\tposition: 'absolute',\n\tright: 'var(--grid)',\n\tbottom: 0,\n\tfontSize: '6px',\n});\n\nconst previewStyles = css({\n\t'--grid': '8px',\n\tbackground: token('elevation.surface.raised', 'red'),\n\tpadding: 'var(--grid)',\n\tborderRadius: 3,\n});\n\nfunction Preview({ item }: { item: TreeItemType }) {\n\treturn <div css={previewStyles}>Item {item.id}</div>;\n}\n\nconst parentOfInstructionStyles = css({\n\tbackground: token('color.background.selected.hovered', 'transparent'),\n});\n\nfunction getParentLevelOfInstruction(instruction: Instruction): number {\n\tif (instruction.type === 'instruction-blocked') {\n\t\treturn getParentLevelOfInstruction(instruction.desired);\n\t}\n\tif (instruction.type === 'reparent') {\n\t\treturn instruction.desiredLevel - 1;\n\t}\n\treturn instruction.currentLevel - 1;\n}\n\nfunction delay({ waitMs: timeMs, fn }: { waitMs: number; fn: () => void }): () => void {\n\tlet timeoutId: number | null = window.setTimeout(() => {\n\t\ttimeoutId = null;\n\t\tfn();\n\t}, timeMs);\n\treturn function cancel() {\n\t\tif (timeoutId) {\n\t\t\twindow.clearTimeout(timeoutId);\n\t\t\ttimeoutId = null;\n\t\t}\n\t};\n}\n\nconst TreeItem = memo(function TreeItem({\n\titem,\n\tmode,\n\tlevel,\n\tindex,\n}: {\n\titem: TreeItemType;\n\tmode: ItemMode;\n\tlevel: number;\n\tindex: number;\n}) {\n\tconst buttonRef = useRef<HTMLButtonElement>(null);\n\n\tconst [state, setState] = useState<'idle' | 'dragging' | 'preview' | 'parent-of-instruction'>(\n\t\t'idle',\n\t);\n\tconst [instruction, setInstruction] = useState<Instruction | null>(null);\n\tconst cancelExpandRef = useRef<(() => void) | null>(null);\n\n\tconst { dispatch, uniqueContextId, getPathToItem, registerTreeItem } = useContext(TreeContext);\n\tconst { DropIndicator, attachInstruction, extractInstruction } = useContext(DependencyContext);\n\tconst toggleOpen = useCallback(() => {\n\t\tdispatch({ type: 'toggle', itemId: item.id });\n\t}, [dispatch, item]);\n\n\tconst actionMenuTriggerRef = useRef<HTMLButtonElement>(null);\n\tuseEffect(() => {\n\t\tinvariant(buttonRef.current);\n\t\tinvariant(actionMenuTriggerRef.current);\n\t\treturn registerTreeItem({\n\t\t\titemId: item.id,\n\t\t\telement: buttonRef.current,\n\t\t\tactionMenuTrigger: actionMenuTriggerRef.current,\n\t\t});\n\t}, [item.id, registerTreeItem]);\n\n\tconst cancelExpand = useCallback(() => {\n\t\tcancelExpandRef.current?.();\n\t\tcancelExpandRef.current = null;\n\t}, []);\n\n\tconst clearParentOfInstructionState = useCallback(() => {\n\t\tsetState((current) => (current === 'parent-of-instruction' ? 'idle' : current));\n\t}, []);\n\n\t// When an item has an instruction applied\n\t// we are highlighting it's parent item for improved clarity\n\tconst shouldHighlightParent = useCallback(\n\t\t(location: DragLocationHistory): boolean => {\n\t\t\tconst target = location.current.dropTargets[0];\n\n\t\t\tif (!target) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst instruction = extractInstruction(target.data);\n\n\t\t\tif (!instruction) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst targetId = target.data.id;\n\t\t\tinvariant(typeof targetId === 'string');\n\n\t\t\tconst path = getPathToItem(targetId);\n\t\t\tconst parentLevel: number = getParentLevelOfInstruction(instruction);\n\t\t\tconst parentId = path[parentLevel];\n\t\t\treturn parentId === item.id;\n\t\t},\n\t\t[getPathToItem, extractInstruction, item],\n\t);\n\n\tuseEffect(() => {\n\t\tinvariant(buttonRef.current);\n\n\t\tfunction updateIsParentOfInstruction({ location }: { location: DragLocationHistory }) {\n\t\t\tif (shouldHighlightParent(location)) {\n\t\t\t\tsetState('parent-of-instruction');\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tclearParentOfInstructionState();\n\t\t}\n\n\t\tfunction onChange({ self, source }: ElementDropTargetEventBasePayload) {\n\t\t\tconst instruction = extractInstruction(self.data);\n\n\t\t\tif (source.data.id !== item.id) {\n\t\t\t\t// expand after 500ms if still merging\n\t\t\t\tif (\n\t\t\t\t\tinstruction?.type === 'make-child' &&\n\t\t\t\t\titem.children.length &&\n\t\t\t\t\t!item.isOpen &&\n\t\t\t\t\t!cancelExpandRef.current\n\t\t\t\t) {\n\t\t\t\t\tcancelExpandRef.current = delay({\n\t\t\t\t\t\twaitMs: 500,\n\t\t\t\t\t\tfn: () => dispatch({ type: 'expand', itemId: item.id }),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (instruction?.type !== 'make-child' && cancelExpandRef.current) {\n\t\t\t\t\tcancelExpand();\n\t\t\t\t}\n\n\t\t\t\tsetInstruction(instruction);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (instruction?.type === 'reparent') {\n\t\t\t\tsetInstruction(instruction);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetInstruction(null);\n\t\t}\n\n\t\treturn combine(\n\t\t\tdraggable({\n\t\t\t\telement: buttonRef.current,\n\t\t\t\tgetInitialData: () => ({\n\t\t\t\t\tid: item.id,\n\t\t\t\t\ttype: 'tree-item',\n\t\t\t\t\tisOpenOnDragStart: item.isOpen,\n\t\t\t\t\tuniqueContextId,\n\t\t\t\t}),\n\t\t\t\tonGenerateDragPreview: ({ nativeSetDragImage }) => {\n\t\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\t\tgetOffset: pointerOutsideOfPreview({ x: '16px', y: '8px' }),\n\t\t\t\t\t\trender: ({ container }) => {\n\t\t\t\t\t\t\tReactDOM.render(<Preview item={item} />, container);\n\t\t\t\t\t\t\treturn () => ReactDOM.unmountComponentAtNode(container);\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragStart: ({ source }) => {\n\t\t\t\t\tsetState('dragging');\n\t\t\t\t\t// collapse open items during a drag\n\t\t\t\t\tif (source.data.isOpenOnDragStart) {\n\t\t\t\t\t\tdispatch({ type: 'collapse', itemId: item.id });\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonDrop: ({ source }) => {\n\t\t\t\t\tsetState('idle');\n\t\t\t\t\tif (source.data.isOpenOnDragStart) {\n\t\t\t\t\t\tdispatch({ type: 'expand', itemId: item.id });\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement: buttonRef.current,\n\t\t\t\tgetData: ({ input, element }) => {\n\t\t\t\t\tconst data = { id: item.id };\n\n\t\t\t\t\treturn attachInstruction(data, {\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\telement,\n\t\t\t\t\t\tindentPerLevel,\n\t\t\t\t\t\tcurrentLevel: level,\n\t\t\t\t\t\tmode,\n\t\t\t\t\t\tblock: item.isDraft ? ['make-child'] : [],\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tcanDrop: ({ source }) =>\n\t\t\t\t\tsource.data.type === 'tree-item' && source.data.uniqueContextId === uniqueContextId,\n\t\t\t\tgetIsSticky: () => true,\n\t\t\t\tonDragEnter: onChange,\n\t\t\t\tonDrag: onChange,\n\t\t\t\tonDragLeave: () => {\n\t\t\t\t\tcancelExpand();\n\t\t\t\t\tsetInstruction(null);\n\t\t\t\t},\n\t\t\t\tonDrop: () => {\n\t\t\t\t\tcancelExpand();\n\t\t\t\t\tsetInstruction(null);\n\t\t\t\t},\n\t\t\t}),\n\t\t\tmonitorForElements({\n\t\t\t\tcanMonitor: ({ source }) => source.data.uniqueContextId === uniqueContextId,\n\t\t\t\tonDragStart: updateIsParentOfInstruction,\n\t\t\t\tonDrag: updateIsParentOfInstruction,\n\t\t\t\tonDrop() {\n\t\t\t\t\tclearParentOfInstructionState();\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [\n\t\tdispatch,\n\t\titem,\n\t\tmode,\n\t\tlevel,\n\t\tcancelExpand,\n\t\tuniqueContextId,\n\t\textractInstruction,\n\t\tattachInstruction,\n\t\tgetPathToItem,\n\t\tclearParentOfInstructionState,\n\t\tshouldHighlightParent,\n\t]);\n\n\tuseEffect(\n\t\tfunction mount() {\n\t\t\treturn function unmount() {\n\t\t\t\tcancelExpand();\n\t\t\t};\n\t\t},\n\t\t[cancelExpand],\n\t);\n\n\tconst aria = (() => {\n\t\tif (!item.children.length) {\n\t\t\treturn undefined;\n\t\t}\n\t\treturn {\n\t\t\t'aria-expanded': item.isOpen,\n\t\t\t'aria-controls': `tree-item-${item.id}--subtree`,\n\t\t};\n\t})();\n\n\tconst [isMoveDialogOpen, setIsMoveDialogOpen] = useState(false);\n\tconst openMoveDialog = useCallback(() => {\n\t\tsetIsMoveDialogOpen(true);\n\t}, []);\n\tconst closeMoveDialog = useCallback(() => {\n\t\tsetIsMoveDialogOpen(false);\n\t}, []);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<div css={[outerStyles, state === 'idle' ? outerHoverStyles : undefined]}>\n\t\t\t\t<FocusRing isInset>\n\t\t\t\t\t<button\n\t\t\t\t\t\t{...aria}\n\t\t\t\t\t\tcss={[outerButtonStyles]}\n\t\t\t\t\t\tid={`tree-item-${item.id}`}\n\t\t\t\t\t\tonClick={toggleOpen}\n\t\t\t\t\t\tref={buttonRef}\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\t\t\t\t\t\tstyle={{ paddingLeft: level * indentPerLevel }}\n\t\t\t\t\t\tdata-index={index}\n\t\t\t\t\t\tdata-level={level}\n\t\t\t\t\t\tdata-testid={`tree-item-${item.id}`}\n\t\t\t\t\t>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tcss={[\n\t\t\t\t\t\t\t\tinnerButtonStyles,\n\t\t\t\t\t\t\t\tstate === 'dragging'\n\t\t\t\t\t\t\t\t\t? innerDraggingStyles\n\t\t\t\t\t\t\t\t\t: state === 'parent-of-instruction'\n\t\t\t\t\t\t\t\t\t\t? parentOfInstructionStyles\n\t\t\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t\t]}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Icon item={item} />\n\t\t\t\t\t\t\t<span css={labelStyles}>Item {item.id}</span>\n\t\t\t\t\t\t\t<small css={idStyles}>\n\t\t\t\t\t\t\t\t{/* eslint-disable-next-line @atlaskit/design-system/no-html-code */}\n\t\t\t\t\t\t\t\t{item.isDraft ? <code>Draft</code> : null}\n\t\t\t\t\t\t\t\t{/* eslint-disable-next-line @atlaskit/design-system/no-html-code */}\n\t\t\t\t\t\t\t\t<code css={debugStyles}>({mode})</code>\n\t\t\t\t\t\t\t</small>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t{instruction ? <DropIndicator instruction={instruction} /> : null}\n\t\t\t\t\t</button>\n\t\t\t\t</FocusRing>\n\t\t\t\t<DropdownMenu\n\t\t\t\t\ttrigger={({ triggerRef, ...triggerProps }) => (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tref={mergeRefs([triggerRef, actionMenuTriggerRef])}\n\t\t\t\t\t\t\ticonBefore={\n\t\t\t\t\t\t\t\t<MoreIcon\n\t\t\t\t\t\t\t\t\tlabel=\"Actions\"\n\t\t\t\t\t\t\t\t\tcolor={token('color.icon.subtle', '#626F86')}\n\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t{...triggerProps}\n\t\t\t\t\t\t\tspacing=\"compact\"\n\t\t\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\t\t\tstyle={{ position: 'absolute', top: 8, right: 8 }}\n\t\t\t\t\t\t\tappearance=\"subtle\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\tshouldRenderToParent\n\t\t\t\t>\n\t\t\t\t\t<DropdownItemGroup>\n\t\t\t\t\t\t<DropdownItem onClick={openMoveDialog}>Move</DropdownItem>\n\t\t\t\t\t</DropdownItemGroup>\n\t\t\t\t</DropdownMenu>\n\t\t\t</div>\n\t\t\t{item.children.length && item.isOpen ? (\n\t\t\t\t<div id={aria?.['aria-controls']}>\n\t\t\t\t\t{item.children.map((child, index, array) => {\n\t\t\t\t\t\tconst childType: ItemMode = (() => {\n\t\t\t\t\t\t\tif (child.children.length && child.isOpen) {\n\t\t\t\t\t\t\t\treturn 'expanded';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (index === array.length - 1) {\n\t\t\t\t\t\t\t\treturn 'last-in-group';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn 'standard';\n\t\t\t\t\t\t})();\n\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t<TreeItem\n\t\t\t\t\t\t\t\titem={child}\n\t\t\t\t\t\t\t\tkey={child.id}\n\t\t\t\t\t\t\t\tlevel={level + 1}\n\t\t\t\t\t\t\t\tmode={childType}\n\t\t\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t);\n\t\t\t\t\t})}\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t\t<ModalTransition>\n\t\t\t\t{isMoveDialogOpen && <MoveDialog onClose={closeMoveDialog} itemId={item.id} />}\n\t\t\t</ModalTransition>\n\t\t</Fragment>\n\t);\n});\n\nexport default TreeItem;\n"
  },
  {
    "path": "packages/documentation/examples/resizing.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { type CSSProperties, Fragment, memo, useEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport { ButtonItem, MenuGroup, Section } from '@atlaskit/menu';\nimport { draggable } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { disableNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview';\nimport { preventUnhandled } from '@atlaskit/pragmatic-drag-and-drop/prevent-unhandled';\nimport type { DragLocationHistory } from '@atlaskit/pragmatic-drag-and-drop/types';\nimport { token } from '@atlaskit/tokens';\n\nimport battery from './icons/battery.png';\nimport cloud from './icons/cloud.png';\nimport drill from './icons/drill.png';\nimport koala from './icons/koala.png';\nimport ui from './icons/ui.png';\nimport wallet from './icons/wallet.png';\nimport yeti from './icons/yeti.png';\nimport { GlobalStyles } from './util/global-styles';\n\n// The list example we have here was lifted from\n// packages/design-system/menu/examples/menu.tsx\nconst iconStyles = css({\n\theight: 'calc(var(--grid) * 3)',\n\twidth: 'calc(var(--grid) * 3)',\n\tborderRadius: 'var(--border-width)',\n});\nfunction Icon({ src, alt }: { src: string; alt: string }) {\n\treturn <img alt={alt} src={src} css={iconStyles} />;\n}\nconst Menu = memo(function Menu() {\n\treturn (\n\t\t<MenuGroup>\n\t\t\t<Section title=\"Starred\">\n\t\t\t\t<ButtonItem\n\t\t\t\t\ticonBefore={<Icon src={yeti} alt={'Yeti'} />}\n\t\t\t\t\tdescription=\"Next-gen software project\"\n\t\t\t\t>\n\t\t\t\t\tNavigation System\n\t\t\t\t</ButtonItem>\n\t\t\t\t<ButtonItem\n\t\t\t\t\ticonBefore={<Icon src={drill} alt={'Drill'} />}\n\t\t\t\t\tdescription=\"Next-gen service desk\"\n\t\t\t\t>\n\t\t\t\t\tAnalytics Platform\n\t\t\t\t</ButtonItem>\n\t\t\t</Section>\n\t\t\t<Section title=\"Recent\">\n\t\t\t\t<ButtonItem\n\t\t\t\t\ticonBefore={<Icon src={battery} alt={'Battery'} />}\n\t\t\t\t\tdescription=\"Next-gen software project\"\n\t\t\t\t>\n\t\t\t\t\tFabric Editor\n\t\t\t\t</ButtonItem>\n\t\t\t\t<ButtonItem\n\t\t\t\t\ticonBefore={<Icon src={cloud} alt={'Cloud'} />}\n\t\t\t\t\tdescription=\"Classic business project\"\n\t\t\t\t>\n\t\t\t\t\tContent Services\n\t\t\t\t</ButtonItem>\n\t\t\t\t<ButtonItem\n\t\t\t\t\ticonBefore={<Icon src={wallet} alt={'Wallet'} />}\n\t\t\t\t\tdescription=\"Next-gen software project\"\n\t\t\t\t>\n\t\t\t\t\tTrinity Mobile\n\t\t\t\t</ButtonItem>\n\t\t\t\t<ButtonItem\n\t\t\t\t\ticonBefore={<Icon src={koala} alt={'Koala'} />}\n\t\t\t\t\tdescription=\"Classic service desk\"\n\t\t\t\t>\n\t\t\t\t\tCustomer Feedback\n\t\t\t\t</ButtonItem>\n\t\t\t\t<ButtonItem\n\t\t\t\t\ticonBefore={<Icon src={ui} alt={'UI icon'} />}\n\t\t\t\t\tdescription=\"Classic software project\"\n\t\t\t\t>\n\t\t\t\t\tDesign System\n\t\t\t\t</ButtonItem>\n\t\t\t</Section>\n\t\t\t<Section hasSeparator>\n\t\t\t\t<ButtonItem>View all projects</ButtonItem>\n\t\t\t\t<ButtonItem>Create project</ButtonItem>\n\t\t\t</Section>\n\t\t</MenuGroup>\n\t);\n});\n\nconst sidebarStyles = css({\n\twidth: 'var(--local-width)',\n\tflexShrink: '0',\n\tflexGrow: '0',\n\tboxSizing: 'border-box',\n\tdisplay: 'flex',\n\tflexDirection: 'row',\n});\n\nconst sidebarContentStyles = css({\n\tflexGrow: '1',\n\tflexShrink: '1',\n\twidth: 'var(--local-resizing-width, var(--local-initial-width))',\n});\n\n// Quite a large draggable area,\n// but the line itself is fairly small\nconst sidebarDividerStyles = css({\n\twidth: 'calc(var(--grid) * 4)',\n\tcursor: 'ew-resize',\n\tflexGrow: '0',\n\tflexShrink: '0',\n\tposition: 'relative',\n\tbackground: 'transparent',\n\t'&::before': {\n\t\tbackground: token('color.border.brand', '#0C66E4'),\n\t\tcontent: '\"\"',\n\t\tposition: 'absolute',\n\t\ttop: 0,\n\t\tbottom: 0,\n\t\twidth: 'var(--border-width)',\n\t},\n});\n\n// Preventing items getting :hover effects during a drag\nconst noPointerEventsStyles = css({\n\tpointerEvents: 'none',\n});\n\ntype State =\n\t| {\n\t\t\ttype: 'idle';\n\t  }\n\t| {\n\t\t\ttype: 'dragging';\n\t  };\n\nconst widths = {\n\tstart: 260,\n\tmin: 150,\n\tmax: 450,\n};\n\nfunction getProposedWidth({\n\tinitialWidth,\n\tlocation,\n}: {\n\tinitialWidth: number;\n\tlocation: DragLocationHistory;\n}): number {\n\tconst diffX = location.current.input.clientX - location.initial.input.clientX;\n\tconst proposedWidth = initialWidth + diffX;\n\n\t// ensure we don't go below the min or above the max allowed widths\n\treturn Math.min(Math.max(widths.min, proposedWidth), widths.max);\n}\n\nfunction Sidebar() {\n\t// note: initial width could be a prop, just using local state for this example\n\tconst [initialWidth, setInitialWidth] = useState(widths.start);\n\tconst dividerRef = useRef<HTMLDivElement | null>(null);\n\tconst [state, setState] = useState<State>({\n\t\ttype: 'idle',\n\t});\n\tconst contentRef = useRef<HTMLDivElement | null>(null);\n\n\tuseEffect(() => {\n\t\tconst divider = dividerRef.current;\n\t\tinvariant(divider);\n\n\t\treturn draggable({\n\t\t\telement: divider,\n\t\t\tonGenerateDragPreview: ({ nativeSetDragImage }) => {\n\t\t\t\t// we will be moving the line to indicate a drag\n\t\t\t\t// we can disable the native drag preview\n\t\t\t\tdisableNativeDragPreview({ nativeSetDragImage });\n\t\t\t\t// we don't want any native drop animation for when the user\n\t\t\t\t// does not drop on a drop target. we want the drag to finish immediately\n\t\t\t\tpreventUnhandled.start();\n\t\t\t},\n\t\t\tonDragStart() {\n\t\t\t\tsetState({ type: 'dragging' });\n\t\t\t},\n\t\t\tonDrag({ location }) {\n\t\t\t\tcontentRef.current?.style.setProperty(\n\t\t\t\t\t'--local-resizing-width',\n\t\t\t\t\t`${getProposedWidth({ initialWidth, location })}px`,\n\t\t\t\t);\n\t\t\t},\n\t\t\tonDrop({ location }) {\n\t\t\t\tpreventUnhandled.stop();\n\t\t\t\tsetState({ type: 'idle' });\n\n\t\t\t\tsetInitialWidth(getProposedWidth({ initialWidth, location }));\n\t\t\t\tcontentRef.current?.style.removeProperty('--local-resizing-width');\n\t\t\t},\n\t\t});\n\t}, [initialWidth]);\n\n\treturn (\n\t\t<div css={sidebarStyles}>\n\t\t\t<div\n\t\t\t\tref={contentRef}\n\t\t\t\tcss={[sidebarContentStyles, state.type === 'dragging' ? noPointerEventsStyles : undefined]}\n\t\t\t\tstyle={{ '--local-initial-width': `${initialWidth}px` } as CSSProperties}\n\t\t\t>\n\t\t\t\t<Menu />\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tcss={[\n\t\t\t\t\tsidebarDividerStyles,\n\t\t\t\t\t// Disabling the cursor on the sidebar line while dragging\n\t\t\t\t\t// Otherwise the cursor can flash between resizing and the default cursor repeatedly\n\t\t\t\t\tstate.type === 'dragging' ? noPointerEventsStyles : undefined,\n\t\t\t\t]}\n\t\t\t\tref={dividerRef}\n\t\t\t></div>\n\t\t</div>\n\t);\n}\n\nconst itemStyles = css({\n\twidth: '40px',\n\theight: '40px',\n\tborder: `${token('border.width')} solid ${token('color.border')}`,\n\tborderRadius: 'var(--border-radius)',\n\t'&:hover': {\n\t\tbackground: token('color.background.accent.green.subtle'),\n\t},\n\t'&:active': {\n\t\tbackground: token('color.background.accent.blue.subtle'),\n\t},\n});\n\nfunction Item({ itemId }: { itemId: string }) {\n\treturn <div css={itemStyles} />;\n}\n\nconst gridStyles = css({\n\tdisplay: 'flex',\n\tflexWrap: 'wrap',\n\tgap: 'var(--grid)',\n});\n\nconst stackStyles = css({\n\tdisplay: 'flex',\n\tflexDirection: 'column',\n\tgap: 'calc(var(--grid) * 2)',\n\tpadding: 'calc(var(--grid) * 2) 0',\n});\n\nfunction Content() {\n\tconst [itemIds] = useState(() => Array.from({ length: 40 }, (_, index) => `item: ${index}`));\n\n\treturn (\n\t\t<div css={stackStyles}>\n\t\t\t{/* <h2>Code review</h2> */}\n\t\t\t<div css={gridStyles}>\n\t\t\t\t{itemIds.map((itemId) => (\n\t\t\t\t\t<Item itemId={itemId} key={itemId} />\n\t\t\t\t))}\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nconst containerStyles = css({\n\tdisplay: 'flex',\n\tflexDirection: 'row',\n\toverflow: 'hidden',\n\twidth: '100%',\n\tborder: `var(--border-width) solid ${token('color.border', '#091E4224')}`,\n\tborderRadius: 'var(--border-radius)',\n\tbackground: token('elevation.surface', '#FFF'),\n});\n\nexport default function Container(): React.JSX.Element {\n\treturn (\n\t\t<Fragment>\n\t\t\t<GlobalStyles />\n\t\t\t<div css={containerStyles}>\n\t\t\t\t<Sidebar />\n\t\t\t\t<Content />\n\t\t\t</div>\n\t\t</Fragment>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/table.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { Fragment, useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport invariant from 'tiny-invariant';\n\nimport { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';\nimport { triggerPostMoveFlash } from '@atlaskit/pragmatic-drag-and-drop-flourish/trigger-post-move-flash';\nimport { extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { getReorderDestinationIndex } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';\nimport { token } from '@atlaskit/tokens';\n\nimport { getItems } from './pieces/table/data';\nimport { Row } from './pieces/table/row';\nimport { type ItemContextValue, TableContext } from './pieces/table/table-context';\nimport { TableHeader } from './pieces/table/table-header';\nimport type { Item, ItemRegistration, ReorderFunction } from './pieces/table/types';\nimport { GlobalStyles } from './util/global-styles';\n\nconst tableStyles = css({\n\ttableLayout: 'fixed',\n\t// We don't want to collapse borders - otherwise the border on the header\n\t// will disappear with position:sticky\n\t// https://stackoverflow.com/questions/50361698/border-style-do-not-work-with-sticky-position-element\n\tborderCollapse: 'separate',\n\tborderSpacing: 0,\n\n\t// Adding a bit more space to the first column for consistency and to give room\n\t// for the drop indicator and the drag handle\n\t// eslint-disable-next-line @atlaskit/design-system/no-nested-styles, @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t'th:first-of-type, td:first-of-type': {\n\t\tpaddingLeft: 40,\n\t},\n});\n\nconst tableHeaderStyles = css({\n\tbackground: token('elevation.surface', '#FFF'),\n\tborderBottom: `${token('border.width.selected')} solid`,\n\tposition: 'sticky',\n\ttop: 0,\n\t// zIndex: 2 is needed so that the sticky header will sit on top of our\n\t// row items, which need to have `position:relative` applied so they can render\n\t// the drop indicators\n\t// Using zIndex:2 rather than zIndex: 1 as our drop indicator uses zIndex: 1\n\t// and we want the header to always be on top of the drop indicator\n\tzIndex: 2,\n});\n\nconst scrollableStyles = css({\n\theight: '50vh',\n\toverflowY: 'scroll',\n\toverflowX: 'visible',\n});\n\nfunction extractIndex(data: Record<string, unknown>) {\n\tconst { index } = data;\n\tif (typeof index !== 'number') {\n\t\treturn null;\n\t}\n\treturn index;\n}\n\ntype Operation =\n\t| {\n\t\t\ttype: 'row-reorder';\n\t\t\tcurrentIndex: number;\n\t  }\n\t| {\n\t\t\ttype: 'column-reorder';\n\t\t\tcurrentIndex: number;\n\t  };\n\nexport default function Table(): React.JSX.Element {\n\t// Data\n\tconst [items, setItems] = useState(() => getItems({ amount: 20 }));\n\tconst [columns, setColumns] = useState<(keyof Item)[]>(['status', 'description', 'assignee']);\n\tconst [instanceId] = useState(() => Symbol('instance-id'));\n\n\tconst [lastOperation, setLastOperation] = useState<Operation | null>(null);\n\n\tconst elementMapRef = useRef(new Map<number, HTMLElement>());\n\n\tuseEffect(() => {\n\t\tif (lastOperation === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (lastOperation.type === 'row-reorder') {\n\t\t\tconst element = elementMapRef.current.get(lastOperation.currentIndex);\n\t\t\tif (element) {\n\t\t\t\ttriggerPostMoveFlash(element);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (lastOperation.type === 'column-reorder') {\n\t\t\tconst table = tableRef.current;\n\t\t\tinvariant(table);\n\n\t\t\tconst column = table.querySelector<HTMLElement>(\n\t\t\t\t`col:nth-of-type(${lastOperation.currentIndex + 1})`,\n\t\t\t);\n\t\t\tif (column) {\n\t\t\t\ttriggerPostMoveFlash(column);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t}, [lastOperation]);\n\n\tconst reorderItem: ReorderFunction = useCallback(\n\t\t({ startIndex, indexOfTarget, closestEdgeOfTarget = null }) => {\n\t\t\tconst finishIndex = getReorderDestinationIndex({\n\t\t\t\taxis: 'vertical',\n\t\t\t\tstartIndex,\n\t\t\t\tindexOfTarget,\n\t\t\t\tclosestEdgeOfTarget,\n\t\t\t});\n\n\t\t\tsetItems((items) => {\n\t\t\t\treturn reorder({\n\t\t\t\t\tlist: items,\n\t\t\t\t\tstartIndex,\n\t\t\t\t\tfinishIndex,\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tsetLastOperation({\n\t\t\t\ttype: 'row-reorder',\n\t\t\t\tcurrentIndex: finishIndex,\n\t\t\t});\n\t\t},\n\t\t[],\n\t);\n\n\tconst reorderColumn: ReorderFunction = useCallback(\n\t\t({ startIndex, indexOfTarget, closestEdgeOfTarget = null }) => {\n\t\t\tconst finishIndex = getReorderDestinationIndex({\n\t\t\t\taxis: 'horizontal',\n\t\t\t\tstartIndex,\n\t\t\t\tindexOfTarget,\n\t\t\t\tclosestEdgeOfTarget,\n\t\t\t});\n\n\t\t\tsetColumns((items) =>\n\t\t\t\treorder({\n\t\t\t\t\tlist: items,\n\t\t\t\t\tstartIndex,\n\t\t\t\t\tfinishIndex,\n\t\t\t\t}),\n\t\t\t);\n\n\t\t\tsetLastOperation({\n\t\t\t\ttype: 'column-reorder',\n\t\t\t\tcurrentIndex: finishIndex,\n\t\t\t});\n\t\t},\n\t\t[],\n\t);\n\n\tuseEffect(() => {\n\t\tinvariant(scrollableRef.current);\n\n\t\treturn combine(\n\t\t\tmonitorForElements({\n\t\t\t\tcanMonitor({ source }) {\n\t\t\t\t\treturn source.data.instanceId === instanceId;\n\t\t\t\t},\n\t\t\t\tonDrop({ location, source }) {\n\t\t\t\t\t/**\n\t\t\t\t\t * Only checking the inner-most drop target.\n\t\t\t\t\t */\n\t\t\t\t\tconst destination = location.current.dropTargets[0];\n\t\t\t\t\tif (!destination) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst startIndex = extractIndex(source.data);\n\t\t\t\t\tconst indexOfTarget = extractIndex(destination.data);\n\t\t\t\t\tif (startIndex === null || indexOfTarget === null) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst closestEdgeOfTarget = extractClosestEdge(destination.data);\n\n\t\t\t\t\tif (source.data.type === 'item-row') {\n\t\t\t\t\t\treorderItem({ startIndex, indexOfTarget, closestEdgeOfTarget });\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (source.data.type === 'table-header') {\n\t\t\t\t\t\treorderColumn({ startIndex, indexOfTarget, closestEdgeOfTarget });\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}),\n\t\t\tautoScrollForElements({\n\t\t\t\telement: scrollableRef.current,\n\t\t\t\tcanScroll: ({ source }) => source.data.type === 'item-row',\n\t\t\t}),\n\t\t);\n\t}, [instanceId, reorderColumn, reorderItem]);\n\n\t// Elements\n\tconst tableRef = useRef<HTMLTableElement | null>(null);\n\tconst scrollableRef = useRef<HTMLDivElement | null>(null);\n\n\t// Keeping track of visible items\n\tconst observerRef = useRef<IntersectionObserver | null>(null);\n\tconst visibleItemIndexSetRef = useRef<Set<number>>(new Set());\n\tconst registrationsRef = useRef<Map<Element, ItemRegistration>>(new Map());\n\n\t// Making `stableItems` so that `getItemsForColumnPreview` does not need to cause\n\t// deep re-rendering when `items` change.\n\tconst stableItems = useRef<Item[]>(items);\n\tuseEffect(() => {\n\t\tstableItems.current = items;\n\t}, [items]);\n\n\tconst getItemsForColumnPreview = useCallback((): {\n\t\titems: Item[];\n\t\tisMoreItems: boolean;\n\t} => {\n\t\t// Use the first visible index if it is available, otherwise use `0`\n\t\tconst firstVisibleIndex =\n\t\t\tArray.from(visibleItemIndexSetRef.current).sort((a, b) => a - b)[0] ?? 0;\n\n\t\tconst items = stableItems.current.slice(firstVisibleIndex, firstVisibleIndex + 10);\n\t\tconst isMoreItems = stableItems.current.length > items.length;\n\n\t\treturn { items, isMoreItems };\n\t}, []);\n\n\tconst register = useCallback((registration: ItemRegistration) => {\n\t\tregistrationsRef.current.set(registration.element, registration);\n\t\t// The `useEffect` of children runs before parents\n\t\t// so when initially mounting the `IntersectionObserver` will not be ready yet\n\t\tobserverRef.current?.observe(registration.element);\n\n\t\telementMapRef.current.set(registration.index, registration.element);\n\n\t\treturn function unregister() {\n\t\t\tregistrationsRef.current.delete(registration.element);\n\t\t\tobserverRef.current?.unobserve(registration.element);\n\n\t\t\telementMapRef.current.delete(registration.index);\n\t\t};\n\t}, []);\n\n\tconst contextValue: ItemContextValue = useMemo(() => {\n\t\treturn {\n\t\t\tgetItemsForColumnPreview,\n\t\t\treorderColumn,\n\t\t\treorderItem,\n\t\t\tregister,\n\t\t\tinstanceId,\n\t\t};\n\t}, [getItemsForColumnPreview, reorderColumn, reorderItem, register, instanceId]);\n\n\t// Storing the height of the table in a CSS variable\n\t// This is used by our header resizer and drop target\n\tuseEffect(() => {\n\t\tconst table = tableRef.current;\n\t\tinvariant(table);\n\t\tconst height = table.getBoundingClientRect().height;\n\t\ttable.style.setProperty('--table-height', `${height}px`);\n\n\t\t// be sure to recompute the table height when changes occur that an impact it's height\n\t}, [items]);\n\n\tuseEffect(() => {\n\t\tconst scrollable = scrollableRef.current;\n\t\tinvariant(scrollable);\n\t\tconsole.log('setting up observer');\n\t\tobserverRef.current = new IntersectionObserver(\n\t\t\t(entries) => {\n\t\t\t\tentries.forEach((entry) => {\n\t\t\t\t\tif (entry.isIntersecting) {\n\t\t\t\t\t\tconst registration = registrationsRef.current.get(entry.target);\n\t\t\t\t\t\tinvariant(registration);\n\t\t\t\t\t\tvisibleItemIndexSetRef.current.add(registration.index);\n\t\t\t\t\t\tconsole.log('index visible', registration.index);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!entry.isIntersecting) {\n\t\t\t\t\t\tconst registration = registrationsRef.current.get(entry.target);\n\t\t\t\t\t\tinvariant(registration);\n\t\t\t\t\t\tconsole.log('index not visible', registration.index);\n\t\t\t\t\t\tvisibleItemIndexSetRef.current.delete(registration.index);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t},\n\t\t\t{\n\t\t\t\t// An item is only 'visible' if it would visible below the sticky header\n\t\t\t\t// rather than using '-40px' could grab the exact height of the header\n\t\t\t\trootMargin: '-40px 0px 0px 0px',\n\t\t\t\tthreshold: 0,\n\t\t\t\troot: scrollable,\n\t\t\t},\n\t\t);\n\n\t\t// The `useEffect` of children runs before parents\n\t\t// so when initially mounting, there will be registrations before\n\t\t// the `IntersectionObserver` is ready\n\t\tregistrationsRef.current.forEach((registration) => {\n\t\t\tobserverRef.current?.observe(registration.element);\n\t\t});\n\n\t\treturn () => observerRef.current?.disconnect();\n\t}, []);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<GlobalStyles />\n\t\t\t<TableContext.Provider value={contextValue}>\n\t\t\t\t<div css={scrollableStyles} ref={scrollableRef}>\n\t\t\t\t\t<table css={tableStyles} ref={tableRef}>\n\t\t\t\t\t\t<colgroup>\n\t\t\t\t\t\t\t{columns.map((property) => (\n\t\t\t\t\t\t\t\t<col key={property} />\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</colgroup>\n\t\t\t\t\t\t<thead css={tableHeaderStyles}>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t{columns.map((property, index, array) => (\n\t\t\t\t\t\t\t\t\t<TableHeader\n\t\t\t\t\t\t\t\t\t\tproperty={property}\n\t\t\t\t\t\t\t\t\t\tkey={property}\n\t\t\t\t\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\t\t\t\t\tamountOfHeaders={array.length}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</thead>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t{items.map((item, index) => (\n\t\t\t\t\t\t\t\t<Row\n\t\t\t\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\t\t\t\titem={item}\n\t\t\t\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\t\t\t\tproperties={columns}\n\t\t\t\t\t\t\t\t\tamountOfRows={items.length}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t</div>\n\t\t\t</TableContext.Provider>\n\t\t</Fragment>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/text-selection.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { useEffect } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { jsx } from '@emotion/react';\nimport { bindAll } from 'bind-event-listener';\n\nimport Button from '@atlaskit/button/new';\nimport { Stack } from '@atlaskit/primitives/compiled';\n\nexport default function TextSelection(): React.JSX.Element {\n\tuseEffect(() => {\n\t\treturn bindAll(window, [\n\t\t\t{\n\t\t\t\ttype: 'dragstart',\n\t\t\t\tlistener(event) {\n\t\t\t\t\tconst data = {\n\t\t\t\t\t\ttarget: event.target,\n\t\t\t\t\t\t'text/plain': event.dataTransfer?.getData('text/plain'),\n\t\t\t\t\t\t'text/html': event.dataTransfer?.getData('text/html'),\n\t\t\t\t\t\tselection: window.getSelection(),\n\t\t\t\t\t};\n\t\t\t\t\tconsole.log(event.type, data);\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\t}, []);\n\treturn (\n\t\t<Stack space=\"space.100\">\n\t\t\t<p>This is a paragraph with text</p>\n\t\t\t<p>This is another paragraph with text</p>\n\t\t\t<p>\n\t\t\t\tAnother paragraph{' '}\n\t\t\t\t<em>\n\t\t\t\t\twith some {/* eslint-disable-next-line @atlaskit/design-system/no-html-anchor */}\n\t\t\t\t\t<a href=\"#foo\">\n\t\t\t\t\t\tLink <strong>text</strong>\n\t\t\t\t\t</a>\n\t\t\t\t</em>\n\t\t\t</p>\n\t\t\t<p>\n\t\t\t\tAnother with a <Button>Hello</Button> inside\n\t\t\t</p>\n\t\t</Stack>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/tree-legacy.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, {\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseReducer,\n\tuseRef,\n\tuseState,\n} from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport memoizeOne from 'memoize-one';\nimport invariant from 'tiny-invariant';\n\nimport { triggerPostMoveFlash } from '@atlaskit/pragmatic-drag-and-drop-flourish/trigger-post-move-flash';\nimport {\n\ttype Instruction,\n\ttype ItemMode,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';\nimport * as liveRegion from '@atlaskit/pragmatic-drag-and-drop-live-region';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { token } from '@atlaskit/tokens';\n\nimport {\n\tgetInitialTreeState,\n\ttree,\n\ttype TreeItem as TreeItemType,\n\ttreeStateReducer,\n} from './data/tree-legacy';\nimport {\n\tDependencyContext,\n\tTreeContext,\n\ttype TreeContextValue,\n} from './pieces/tree-legacy/tree-context';\nimport TreeItem from './pieces/tree-legacy/tree-item';\n\nconst treeStyles = css({\n\tdisplay: 'flex',\n\tboxSizing: 'border-box',\n\twidth: 280,\n\tpadding: 8,\n\tflexDirection: 'column',\n\tbackground: token('elevation.surface.sunken', '#F7F8F9'),\n});\n\ntype CleanupFn = () => void;\n\nfunction createTreeItemRegistry() {\n\tconst registry = new Map<string, { element: HTMLElement; actionMenuTrigger: HTMLElement }>();\n\n\tconst registerTreeItem = ({\n\t\titemId,\n\t\telement,\n\t\tactionMenuTrigger,\n\t}: {\n\t\titemId: string;\n\t\telement: HTMLElement;\n\t\tactionMenuTrigger: HTMLElement;\n\t}): CleanupFn => {\n\t\tregistry.set(itemId, { element, actionMenuTrigger });\n\t\treturn () => {\n\t\t\tregistry.delete(itemId);\n\t\t};\n\t};\n\n\treturn { registry, registerTreeItem };\n}\n\nexport default function Tree(): React.JSX.Element {\n\tconst [state, updateState] = useReducer(treeStateReducer, null, getInitialTreeState);\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst { extractInstruction } = useContext(DependencyContext);\n\n\tconst [{ registry, registerTreeItem }] = useState(createTreeItemRegistry);\n\n\tconst { data, lastAction } = state;\n\tlet lastStateRef = useRef<TreeItemType[]>(data);\n\tuseEffect(() => {\n\t\tlastStateRef.current = data;\n\t}, [data]);\n\n\tuseEffect(() => {\n\t\tif (lastAction === null) {\n\t\t\treturn;\n\t\t}\n\n\t\t// focus is more reliable after a timeout\n\t\tsetTimeout(() => {\n\t\t\tif (lastAction.type === 'modal-move') {\n\t\t\t\tconst parentName = lastAction.targetId === '' ? 'the root' : `Item ${lastAction.targetId}`;\n\n\t\t\t\tliveRegion.announce(\n\t\t\t\t\t`You've moved Item ${lastAction.itemId} to position ${\n\t\t\t\t\t\tlastAction.index + 1\n\t\t\t\t\t} in ${parentName}.`,\n\t\t\t\t);\n\n\t\t\t\tconst { element, actionMenuTrigger } = registry.get(lastAction.itemId) ?? {};\n\t\t\t\tif (element) {\n\t\t\t\t\ttriggerPostMoveFlash(element);\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Only moves triggered by the modal will result in focus being\n\t\t\t\t * returned to the trigger.\n\t\t\t\t */\n\t\t\t\tactionMenuTrigger?.focus();\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (lastAction.type === 'instruction') {\n\t\t\t\tconst { element } = registry.get(lastAction.itemId) ?? {};\n\t\t\t\tif (element) {\n\t\t\t\t\ttriggerPostMoveFlash(element);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t});\n\t}, [lastAction, registry]);\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tliveRegion.cleanup();\n\t\t};\n\t}, []);\n\n\t/**\n\t * Returns the items that the item with `itemId` can be moved to.\n\t *\n\t * Uses a depth-first search (DFS) to compile a list of possible targets.\n\t */\n\tconst getMoveTargets = useCallback(({ itemId }: { itemId: string }) => {\n\t\tconst data = lastStateRef.current;\n\n\t\tconst targets = [];\n\n\t\tconst searchStack = Array.from(data);\n\t\twhile (searchStack.length > 0) {\n\t\t\tconst node = searchStack.pop();\n\n\t\t\tif (!node) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * If the current node is the item we want to move, then it is not a valid\n\t\t\t * move target and neither are its children.\n\t\t\t */\n\t\t\tif (node.id === itemId) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Draft items cannot have children.\n\t\t\t */\n\t\t\tif (node.isDraft) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\ttargets.push(node);\n\n\t\t\tnode.children.forEach((childNode) => searchStack.push(childNode));\n\t\t}\n\n\t\treturn targets;\n\t}, []);\n\n\tconst getChildrenOfItem = useCallback((itemId: string) => {\n\t\tconst data = lastStateRef.current;\n\n\t\t/**\n\t\t * An empty string is representing the root\n\t\t */\n\t\tif (itemId === '') {\n\t\t\treturn data;\n\t\t}\n\n\t\tconst item = tree.find(data, itemId);\n\t\tinvariant(item);\n\t\treturn item.children;\n\t}, []);\n\n\tconst context = useMemo<TreeContextValue>(\n\t\t() => ({\n\t\t\tdispatch: updateState,\n\t\t\tuniqueContextId: Symbol('unique-id'),\n\t\t\t// memoizing this function as it is called by all tree items repeatedly\n\t\t\t// An ideal refactor would be to update our data shape\n\t\t\t// to allow quick lookups of parents\n\t\t\tgetPathToItem: memoizeOne(\n\t\t\t\t(targetId: string) => tree.getPathToItem({ current: lastStateRef.current, targetId }) ?? [],\n\t\t\t),\n\t\t\tgetMoveTargets,\n\t\t\tgetChildrenOfItem,\n\t\t\tregisterTreeItem,\n\t\t}),\n\t\t[getChildrenOfItem, getMoveTargets, registerTreeItem],\n\t);\n\n\tuseEffect(() => {\n\t\tinvariant(ref.current);\n\t\treturn combine(\n\t\t\tmonitorForElements({\n\t\t\t\tcanMonitor: ({ source }) => source.data.uniqueContextId === context.uniqueContextId,\n\t\t\t\tonDrop(args) {\n\t\t\t\t\tconst { location, source } = args;\n\t\t\t\t\t// didn't drop on anything\n\t\t\t\t\tif (!location.current.dropTargets.length) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (source.data.type === 'tree-item') {\n\t\t\t\t\t\tconst itemId = source.data.id as string;\n\n\t\t\t\t\t\tconst target = location.current.dropTargets[0];\n\t\t\t\t\t\tconst targetId = target.data.id as string;\n\n\t\t\t\t\t\tconst instruction: Instruction | null = extractInstruction(target.data);\n\n\t\t\t\t\t\tif (instruction !== null) {\n\t\t\t\t\t\t\tupdateState({\n\t\t\t\t\t\t\t\ttype: 'instruction',\n\t\t\t\t\t\t\t\tinstruction,\n\t\t\t\t\t\t\t\titemId,\n\t\t\t\t\t\t\t\ttargetId,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [context, extractInstruction]);\n\n\treturn (\n\t\t<TreeContext.Provider value={context}>\n\t\t\t{/* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 */}\n\t\t\t<div style={{ display: 'flex', justifyContent: 'center', padding: 24 }}>\n\t\t\t\t<div css={treeStyles} id=\"tree\" ref={ref}>\n\t\t\t\t\t{data.map((item, index, array) => {\n\t\t\t\t\t\tconst type: ItemMode = (() => {\n\t\t\t\t\t\t\tif (item.children.length && item.isOpen) {\n\t\t\t\t\t\t\t\treturn 'expanded';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (index === array.length - 1) {\n\t\t\t\t\t\t\t\treturn 'last-in-group';\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn 'standard';\n\t\t\t\t\t\t})();\n\n\t\t\t\t\t\treturn <TreeItem item={item} level={0} key={item.id} mode={type} index={index} />;\n\t\t\t\t\t})}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</TreeContext.Provider>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/tree.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, {\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseReducer,\n\tuseRef,\n\tuseState,\n} from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport memoizeOne from 'memoize-one';\nimport invariant from 'tiny-invariant';\n\nimport { triggerPostMoveFlash } from '@atlaskit/pragmatic-drag-and-drop-flourish/trigger-post-move-flash';\nimport { type Instruction } from '@atlaskit/pragmatic-drag-and-drop-hitbox/list-item';\nimport * as liveRegion from '@atlaskit/pragmatic-drag-and-drop-live-region';\nimport { GroupDropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/group';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdropTargetForElements,\n\ttype ElementDropTargetEventBasePayload,\n\tmonitorForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { token } from '@atlaskit/tokens';\n\nimport {\n\tgetInitialTreeState,\n\ttree,\n\ttype TreeItem as TreeItemType,\n\ttreeStateReducer,\n} from './data/tree';\nimport { DependencyContext, TreeContext, type TreeContextValue } from './pieces/tree/tree-context';\nimport TreeItem from './pieces/tree/tree-item';\n\nconst treeStyles = css({\n\tdisplay: 'flex',\n\tboxSizing: 'border-box',\n\twidth: 280,\n\tpadding: 8,\n\tflexDirection: 'column',\n\tbackground: token('elevation.surface.sunken', '#F7F8F9'),\n});\n\ntype CleanupFn = () => void;\n\nfunction createTreeItemRegistry() {\n\tconst registry = new Map<string, { element: HTMLElement; actionMenuTrigger: HTMLElement }>();\n\n\tconst registerTreeItem = ({\n\t\titemId,\n\t\telement,\n\t\tactionMenuTrigger,\n\t}: {\n\t\titemId: string;\n\t\telement: HTMLElement;\n\t\tactionMenuTrigger: HTMLElement;\n\t}): CleanupFn => {\n\t\tregistry.set(itemId, { element, actionMenuTrigger });\n\t\treturn () => {\n\t\t\tregistry.delete(itemId);\n\t\t};\n\t};\n\n\treturn { registry, registerTreeItem };\n}\n\nexport default function TreeLegacy(): React.JSX.Element {\n\tconst [state, updateState] = useReducer(treeStateReducer, null, getInitialTreeState);\n\tconst ref = useRef<HTMLDivElement>(null);\n\tconst { extractInstruction } = useContext(DependencyContext);\n\tconst [dropTargetState, setDropTargetState] = useState<'is-innermost-over' | 'idle'>('idle');\n\n\tconst [{ registry, registerTreeItem }] = useState(createTreeItemRegistry);\n\n\tconst { data, lastAction } = state;\n\tlet lastStateRef = useRef<TreeItemType[]>(data);\n\tuseEffect(() => {\n\t\tlastStateRef.current = data;\n\t}, [data]);\n\n\tuseEffect(() => {\n\t\tif (lastAction === null) {\n\t\t\treturn;\n\t\t}\n\n\t\t// focus seems to be more reliable after a timeout.\n\t\tsetTimeout(() => {\n\t\t\tif (lastAction.type === 'modal-move') {\n\t\t\t\tconst parentName = lastAction.targetId === '' ? 'the root' : `Item ${lastAction.targetId}`;\n\n\t\t\t\tliveRegion.announce(\n\t\t\t\t\t`You've moved Item ${lastAction.itemId} to position ${\n\t\t\t\t\t\tlastAction.index + 1\n\t\t\t\t\t} in ${parentName}.`,\n\t\t\t\t);\n\n\t\t\t\tconst { element, actionMenuTrigger } = registry.get(lastAction.itemId) ?? {};\n\t\t\t\tif (element) {\n\t\t\t\t\ttriggerPostMoveFlash(element);\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * Only moves triggered by the modal will result in focus being\n\t\t\t\t * returned to the trigger.\n\t\t\t\t */\n\t\t\t\tactionMenuTrigger?.focus();\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (lastAction.type === 'instruction') {\n\t\t\t\tconst { element } = registry.get(lastAction.itemId) ?? {};\n\t\t\t\tif (element) {\n\t\t\t\t\ttriggerPostMoveFlash(element);\n\t\t\t\t}\n\n\t\t\t\treturn;\n\t\t\t}\n\t\t});\n\t}, [lastAction, registry]);\n\n\tuseEffect(() => {\n\t\treturn () => {\n\t\t\tliveRegion.cleanup();\n\t\t};\n\t}, []);\n\n\t/**\n\t * Returns the items that the item with `itemId` can be moved to.\n\t *\n\t * Uses a depth-first search (DFS) to compile a list of possible targets.\n\t */\n\tconst getMoveTargets = useCallback(({ itemId }: { itemId: string }) => {\n\t\tconst data = lastStateRef.current;\n\n\t\tconst targets = [];\n\n\t\tconst searchStack = Array.from(data);\n\t\twhile (searchStack.length > 0) {\n\t\t\tconst node = searchStack.pop();\n\n\t\t\tif (!node) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * If the current node is the item we want to move, then it is not a valid\n\t\t\t * move target and neither are its children.\n\t\t\t */\n\t\t\tif (node.id === itemId) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Draft items cannot have children.\n\t\t\t */\n\t\t\tif (node.isDraft) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\ttargets.push(node);\n\n\t\t\tnode.children.forEach((childNode) => searchStack.push(childNode));\n\t\t}\n\n\t\treturn targets;\n\t}, []);\n\n\tconst getChildrenOfItem = useCallback((itemId: string) => {\n\t\tconst data = lastStateRef.current;\n\n\t\t/**\n\t\t * An empty string is representing the root\n\t\t */\n\t\tif (itemId === '') {\n\t\t\treturn data;\n\t\t}\n\n\t\tconst item = tree.find(data, itemId);\n\t\tinvariant(item);\n\t\treturn item.children;\n\t}, []);\n\n\tconst context = useMemo<TreeContextValue>(\n\t\t() => ({\n\t\t\tdispatch: updateState,\n\t\t\tuniqueContextId: Symbol('unique-id'),\n\t\t\t// memoizing this function as it is called by all tree items repeatedly\n\t\t\t// An ideal refactor would be to update our data shape\n\t\t\t// to allow quick lookups of parents\n\t\t\tgetPathToItem: memoizeOne(\n\t\t\t\t(targetId: string) => tree.getPathToItem({ current: lastStateRef.current, targetId }) ?? [],\n\t\t\t),\n\t\t\tgetMoveTargets,\n\t\t\tgetChildrenOfItem,\n\t\t\tregisterTreeItem,\n\t\t}),\n\t\t[getChildrenOfItem, getMoveTargets, registerTreeItem],\n\t);\n\n\tconst groupRef = useRef<HTMLDivElement | null>(null);\n\n\tuseEffect(() => {\n\t\tinvariant(ref.current);\n\t\tinvariant(groupRef.current);\n\n\t\tfunction onDropTargetChange({ location, self }: ElementDropTargetEventBasePayload) {\n\t\t\tconst [innerMost] = location.current.dropTargets.filter(\n\t\t\t\t(dropTarget) => dropTarget.data.type === 'group',\n\t\t\t);\n\n\t\t\tsetDropTargetState(innerMost?.element === self.element ? 'is-innermost-over' : 'idle');\n\t\t}\n\n\t\treturn combine(\n\t\t\tmonitorForElements({\n\t\t\t\tcanMonitor: ({ source }) =>\n\t\t\t\t\tsource.data.uniqueContextId === context.uniqueContextId &&\n\t\t\t\t\tsource.data.type === 'tree-item',\n\t\t\t\tonDrop(args) {\n\t\t\t\t\tconst { location, source } = args;\n\t\t\t\t\t// didn't drop on anything\n\t\t\t\t\tif (!location.current.dropTargets.length) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst itemId = source.data.id as string;\n\n\t\t\t\t\tconst target = location.current.dropTargets[0];\n\t\t\t\t\tconst targetId = target.data.id as string;\n\n\t\t\t\t\tconst instruction: Instruction | null = extractInstruction(target.data);\n\n\t\t\t\t\tif (instruction !== null) {\n\t\t\t\t\t\tupdateState({\n\t\t\t\t\t\t\ttype: 'instruction',\n\t\t\t\t\t\t\tinstruction,\n\t\t\t\t\t\t\titemId,\n\t\t\t\t\t\t\ttargetId,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement: groupRef.current,\n\t\t\t\tcanDrop: ({ source }) =>\n\t\t\t\t\tsource.data.uniqueContextId === context.uniqueContextId &&\n\t\t\t\t\tsource.data.type === 'tree-item',\n\t\t\t\tgetData: () => ({ type: 'group' }),\n\t\t\t\tonDragStart: onDropTargetChange,\n\t\t\t\tonDropTargetChange: onDropTargetChange,\n\t\t\t\tonDragLeave: () => setDropTargetState('idle'),\n\t\t\t\tonDrop: () => setDropTargetState('idle'),\n\t\t\t}),\n\t\t);\n\t}, [context, extractInstruction]);\n\n\treturn (\n\t\t<TreeContext.Provider value={context}>\n\t\t\t{/* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 */}\n\t\t\t<div style={{ display: 'flex', justifyContent: 'center', padding: 24 }}>\n\t\t\t\t<div css={treeStyles} id=\"tree\" ref={ref}>\n\t\t\t\t\t<GroupDropIndicator isActive={dropTargetState === 'is-innermost-over'} ref={groupRef}>\n\t\t\t\t\t\t{data.map((item, index) => {\n\t\t\t\t\t\t\treturn <TreeItem item={item} key={item.id} level={0} index={index} />;\n\t\t\t\t\t\t})}\n\t\t\t\t\t</GroupDropIndicator>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</TreeContext.Provider>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/trello-like-board-iframe.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport { token } from '@atlaskit/tokens';\n\nconst styles = css({\n\tborderRadius: token('radius.small'),\n\tborder: token('color.border'),\n\tborderStyle: 'solid',\n\tborderWidth: token('border.width'),\n});\n\nexport function TrelloLikeBoardIframe(): React.JSX.Element {\n\treturn (\n\t\t<iframe\n\t\t\ttitle=\"Board with Trello like affordances\"\n\t\t\tsrc=\"https://pragmatic-board.vercel.app/two-columns?utm_source=atlassian+design&utm_medium=embed&utm_campaign=pdnd+example+page\"\n\t\t\twidth=\"100%\"\n\t\t\theight=\"800px\"\n\t\t\tloading=\"lazy\"\n\t\t\tframeBorder={0}\n\t\t\tcss={styles}\n\t\t/>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/examples/util/constants.tsx",
    "content": "/**\n * The space between each column in a board.\n */\nexport const columnGap = 16;\n\n/**\n * The space between each card in a column.\n */\nexport const cardGap = 8;\n"
  },
  {
    "path": "packages/documentation/examples/util/fallback.ts",
    "content": "export const fallbackColor = 'red';\n"
  },
  {
    "path": "packages/documentation/examples/util/global-styles.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, Global, jsx } from '@emotion/react';\n\nconst globalStyles = css({\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':root': {\n\t\t'--grid': '8px',\n\t\t'--border-radius': '2px',\n\t\t'--border-width': '2px',\n\t},\n});\n\nexport function GlobalStyles(): React.JSX.Element {\n\treturn <Global styles={globalStyles} />;\n}\n"
  },
  {
    "path": "packages/documentation/examples/virtual-list.tsx",
    "content": "import React, {\n\tcreateContext,\n\tFragment,\n\tmemo,\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from 'react';\n\nimport { useVirtualizer, type VirtualItem } from '@tanstack/react-virtual';\nimport ReactDOM from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport Avatar from '@atlaskit/avatar';\nimport Badge from '@atlaskit/badge';\nimport DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';\n// eslint-disable-next-line @atlaskit/design-system/no-banned-imports\nimport mergeRefs from '@atlaskit/ds-lib/merge-refs';\nimport Lozenge from '@atlaskit/lozenge';\nimport { autoScrollForElements } from '@atlaskit/pragmatic-drag-and-drop-auto-scroll/element';\nimport { triggerPostMoveFlash } from '@atlaskit/pragmatic-drag-and-drop-flourish/trigger-post-move-flash';\nimport {\n\tattachClosestEdge,\n\ttype Edge,\n\textractClosestEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { getReorderDestinationIndex } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index';\nimport * as liveRegion from '@atlaskit/pragmatic-drag-and-drop-live-region';\nimport { DragHandleButton } from '@atlaskit/pragmatic-drag-and-drop-react-accessibility/drag-handle-button';\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport {\n\tdraggable,\n\tdropTargetForElements,\n\ttype ElementDragPayload,\n\tmonitorForElements,\n} from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { pointerOutsideOfPreview } from '@atlaskit/pragmatic-drag-and-drop/element/pointer-outside-of-preview';\nimport { setCustomNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview';\nimport { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Grid, Inline, xcss } from '@atlaskit/primitives';\nimport { token } from '@atlaskit/tokens';\n\ntype ItemPosition = 'first' | 'last' | 'middle' | 'only';\n\ntype CleanupFn = () => void;\n\ntype ItemEntry = { itemId: string; element: HTMLElement };\n\ntype ListContextValue = {\n\tgetListLength: () => number;\n\tregisterItem: (entry: ItemEntry) => CleanupFn;\n\treorderItem: (args: {\n\t\tstartIndex: number;\n\t\tindexOfTarget: number;\n\t\tclosestEdgeOfTarget: Edge | null;\n\t}) => void;\n\tinstanceId: symbol;\n};\n\nconst ListContext = createContext<ListContextValue | null>(null);\n\nfunction useListContext() {\n\tconst listContext = useContext(ListContext);\n\tinvariant(listContext !== null);\n\treturn listContext;\n}\n\ntype Item = {\n\tid: string;\n\tlabel: string;\n};\n\nconst itemKey = Symbol('item');\ntype ItemData = {\n\t[itemKey]: true;\n\titem: Item;\n\tindex: number;\n\tinstanceId: symbol;\n};\n\nfunction getItemData({\n\titem,\n\tindex,\n\tinstanceId,\n}: {\n\titem: Item;\n\tindex: number;\n\tinstanceId: symbol;\n}): ItemData {\n\treturn {\n\t\t[itemKey]: true,\n\t\titem,\n\t\tindex,\n\t\tinstanceId,\n\t};\n}\n\nfunction isItemData(data: Record<string | symbol, unknown>): data is ItemData {\n\treturn data[itemKey] === true;\n}\n\nfunction getItemPosition({ index, items }: { index: number; items: Item[] }): ItemPosition {\n\tif (items.length === 1) {\n\t\treturn 'only';\n\t}\n\n\tif (index === 0) {\n\t\treturn 'first';\n\t}\n\n\tif (index === items.length - 1) {\n\t\treturn 'last';\n\t}\n\n\treturn 'middle';\n}\n\nconst sizes = {\n\titem: {\n\t\touter: 46,\n\t\tinner: 40,\n\t},\n};\n\nconst itemOuterStyles = xcss({\n\tboxSizing: 'border-box',\n\tpadding: 'space.050',\n\tbackgroundColor: 'elevation.surface',\n\tdisplay: 'flex',\n\tflexDirection: 'column',\n});\n\nconst listItemInnerStyles = xcss({\n\twidth: '100%',\n\tflexShrink: '0', // locking the size\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766\n\theight: `${sizes.item.inner}px`,\n\tboxSizing: 'border-box',\n\tdisplay: 'flex',\n\tflexDirection: 'row',\n\talignContent: 'center',\n\tpadding: 'space.050',\n\tposition: 'relative', // for drop indicator placement\n\n\tborderWidth: 'border.width',\n\tborderColor: 'color.border',\n\tborderStyle: 'solid',\n});\n\nconst listItemDisabledStyles = xcss({ opacity: 0.4 });\n\ntype ItemState =\n\t| { type: 'idle' }\n\t| { type: 'preview'; container: HTMLElement }\n\t| { type: 'dragging' }\n\t| { type: 'is-over'; closestEdge: Edge | null };\n\nconst idleState: ItemState = { type: 'idle' };\nconst draggingState: ItemState = { type: 'dragging' };\n\nconst listItemPreviewStyles = xcss({\n\tpaddingBlock: 'space.050',\n\tpaddingInline: 'space.100',\n\tborderRadius: 'radius.small',\n\tbackgroundColor: 'elevation.surface.overlay',\n\tmaxWidth: '360px',\n\twhiteSpace: 'nowrap',\n\toverflow: 'hidden',\n\ttextOverflow: 'ellipsis',\n});\n\nconst itemLabelStyles = xcss({\n\tflexGrow: 1,\n\twhiteSpace: 'nowrap',\n\ttextOverflow: 'ellipsis',\n\toverflow: 'hidden',\n});\n\nfunction DropDownContent({ position, index }: { position: ItemPosition; index: number }) {\n\tconst { reorderItem, getListLength } = useListContext();\n\n\tconst isMoveUpDisabled = position === 'first' || position === 'only';\n\tconst isMoveDownDisabled = position === 'last' || position === 'only';\n\n\tconst moveToTop = useCallback(() => {\n\t\treorderItem({\n\t\t\tstartIndex: index,\n\t\t\tindexOfTarget: 0,\n\t\t\tclosestEdgeOfTarget: null,\n\t\t});\n\t}, [index, reorderItem]);\n\n\tconst moveUp = useCallback(() => {\n\t\treorderItem({\n\t\t\tstartIndex: index,\n\t\t\tindexOfTarget: index - 1,\n\t\t\tclosestEdgeOfTarget: null,\n\t\t});\n\t}, [index, reorderItem]);\n\n\tconst moveDown = useCallback(() => {\n\t\treorderItem({\n\t\t\tstartIndex: index,\n\t\t\tindexOfTarget: index + 1,\n\t\t\tclosestEdgeOfTarget: null,\n\t\t});\n\t}, [index, reorderItem]);\n\n\tconst moveToBottom = useCallback(() => {\n\t\treorderItem({\n\t\t\tstartIndex: index,\n\t\t\tindexOfTarget: getListLength() - 1,\n\t\t\tclosestEdgeOfTarget: null,\n\t\t});\n\t}, [index, getListLength, reorderItem]);\n\n\treturn (\n\t\t<DropdownItemGroup>\n\t\t\t<DropdownItem onClick={moveToTop} isDisabled={isMoveUpDisabled}>\n\t\t\t\tMove to top\n\t\t\t</DropdownItem>\n\t\t\t<DropdownItem onClick={moveUp} isDisabled={isMoveUpDisabled}>\n\t\t\t\tMove up\n\t\t\t</DropdownItem>\n\t\t\t<DropdownItem onClick={moveDown} isDisabled={isMoveDownDisabled}>\n\t\t\t\tMove down\n\t\t\t</DropdownItem>\n\t\t\t<DropdownItem onClick={moveToBottom} isDisabled={isMoveDownDisabled}>\n\t\t\t\tMove to bottom\n\t\t\t</DropdownItem>\n\t\t</DropdownItemGroup>\n\t);\n}\n\nconst ListItem = memo(function ListItem({\n\titem,\n\tindex,\n\tvirtualItem,\n\tposition,\n}: {\n\titem: Item;\n\tindex: number;\n\tvirtualItem: VirtualItem;\n\tposition: ItemPosition;\n}) {\n\tconst { registerItem, instanceId } = useListContext();\n\n\tconst innerRef = useRef<HTMLDivElement>(null);\n\n\tconst dragHandleRef = useRef<HTMLButtonElement>(null);\n\n\tconst [state, setState] = useState<ItemState>(idleState);\n\n\tuseEffect(() => {\n\t\tconst element = innerRef.current;\n\t\tinvariant(element);\n\t\tinvariant(dragHandleRef.current);\n\n\t\tfunction predicate({ source }: { source: ElementDragPayload }): boolean {\n\t\t\treturn (\n\t\t\t\tisItemData(source.data) &&\n\t\t\t\tsource.data.instanceId === instanceId &&\n\t\t\t\tsource.data.item.id !== item.id\n\t\t\t);\n\t\t}\n\n\t\tconst data = getItemData({ item, index, instanceId });\n\n\t\treturn combine(\n\t\t\tregisterItem({ itemId: item.id, element }),\n\t\t\tdraggable({\n\t\t\t\telement,\n\t\t\t\tdragHandle: dragHandleRef.current,\n\t\t\t\tgetInitialData: () => data,\n\t\t\t\tonGenerateDragPreview({ nativeSetDragImage }) {\n\t\t\t\t\tsetCustomNativeDragPreview({\n\t\t\t\t\t\tnativeSetDragImage,\n\t\t\t\t\t\tgetOffset: pointerOutsideOfPreview({\n\t\t\t\t\t\t\tx: token('space.200', '16px'),\n\t\t\t\t\t\t\ty: token('space.100', '8px'),\n\t\t\t\t\t\t}),\n\t\t\t\t\t\trender({ container }) {\n\t\t\t\t\t\t\tsetState({ type: 'preview', container });\n\n\t\t\t\t\t\t\treturn () => setState(draggingState);\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragStart() {\n\t\t\t\t\tsetState(draggingState);\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tsetState(idleState);\n\t\t\t\t},\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement,\n\t\t\t\tcanDrop: predicate,\n\t\t\t\tgetIsSticky: () => true,\n\t\t\t\tgetData({ input }) {\n\t\t\t\t\treturn attachClosestEdge(data, {\n\t\t\t\t\t\telement,\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tallowedEdges: ['top', 'bottom'],\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDrag({ self }) {\n\t\t\t\t\tconst closestEdge = extractClosestEdge(self.data);\n\n\t\t\t\t\tsetState((current) => {\n\t\t\t\t\t\tif (current.type === 'is-over' && current.closestEdge === closestEdge) {\n\t\t\t\t\t\t\treturn current;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn { type: 'is-over', closestEdge };\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tonDragLeave() {\n\t\t\t\t\tsetState(idleState);\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tsetState(idleState);\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [instanceId, item, index, registerItem]);\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<Box\n\t\t\t\txcss={itemOuterStyles}\n\t\t\t\tstyle={{\n\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\ttop: 0,\n\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\tleft: 0,\n\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\twidth: '100%',\n\t\t\t\t\theight: `${virtualItem.size}px`,\n\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\tboxSizing: 'border-box',\n\t\t\t\t\ttransform: `translateY(${virtualItem.start}px)`,\n\t\t\t\t\t// Our items are pressed up next to each other, and are\n\t\t\t\t\t// positioned using `position:absolute`.\n\t\t\t\t\t// The drop indicator of one item needs to sit partially\n\t\t\t\t\t// on top of the other item.\n\t\t\t\t\tzIndex: state.type === 'is-over' && state.closestEdge ? 1 : undefined,\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{/**\n\t\t\t\t * Positioning the drop indicator as a sibling so that it's `position:absolute` does\n\t\t\t\t * not need to take into account the borders of the item\n\t\t\t\t * https://codesandbox.io/p/sandbox/position-relative-and-borders-rjs9gr?file=%2Fsrc%2Fstyles.css%3A15%2C2\n\t\t\t\t */}\n\t\t\t\t<Box\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\t\tposition: 'relative',\n\t\t\t\t\t\theight: sizes.item.inner,\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t<Grid\n\t\t\t\t\t\tref={innerRef}\n\t\t\t\t\t\talignItems=\"center\"\n\t\t\t\t\t\tcolumnGap=\"space.100\"\n\t\t\t\t\t\ttemplateColumns=\"auto 1fr auto\"\n\t\t\t\t\t\txcss={[\n\t\t\t\t\t\t\tlistItemInnerStyles,\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * We are applying the disabled effect to the inner element so that\n\t\t\t\t\t\t\t * the border and drop indicator are not affected.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tstate.type === 'dragging' && listItemDisabledStyles,\n\t\t\t\t\t\t]}\n\t\t\t\t\t>\n\t\t\t\t\t\t<DropdownMenu\n\t\t\t\t\t\t\ttrigger={({ triggerRef, ...triggerProps }) => (\n\t\t\t\t\t\t\t\t<DragHandleButton\n\t\t\t\t\t\t\t\t\tref={mergeRefs([dragHandleRef, triggerRef])}\n\t\t\t\t\t\t\t\t\t{...triggerProps}\n\t\t\t\t\t\t\t\t\tlabel={`Reorder ${item.label}`}\n\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\tpointerEvents: state.type !== 'idle' ? 'none' : undefined,\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\tshouldRenderToParent\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<DropdownItemGroup>\n\t\t\t\t\t\t\t\t<DropDownContent position={position} index={index} />\n\t\t\t\t\t\t\t</DropdownItemGroup>\n\t\t\t\t\t\t</DropdownMenu>\n\t\t\t\t\t\t<Box xcss={itemLabelStyles}>{item.label}</Box>\n\t\t\t\t\t\t<Inline alignBlock=\"center\" space=\"space.100\">\n\t\t\t\t\t\t\t<Badge>{1}</Badge>\n\t\t\t\t\t\t\t<Avatar size=\"small\" />\n\t\t\t\t\t\t\t<Lozenge>Todo</Lozenge>\n\t\t\t\t\t\t</Inline>\n\t\t\t\t\t</Grid>\n\t\t\t\t\t{state.type === 'is-over' && state.closestEdge && (\n\t\t\t\t\t\t<DropIndicator\n\t\t\t\t\t\t\tedge={state.closestEdge}\n\t\t\t\t\t\t\tgap={`${sizes.item.outer - sizes.item.inner}px`}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</Box>\n\t\t\t</Box>\n\t\t\t{state.type === 'preview' &&\n\t\t\t\tReactDOM.createPortal(\n\t\t\t\t\t<Box xcss={listItemPreviewStyles}>{item.label}</Box>,\n\t\t\t\t\tstate.container,\n\t\t\t\t)}\n\t\t</Fragment>\n\t);\n});\n\nlet count: number = 0;\nfunction getItems({ amount }: { amount: number }): Item[] {\n\treturn Array.from({ length: amount }, (): Item => {\n\t\tconst id = `task:${count++}`;\n\t\treturn {\n\t\t\tid,\n\t\t\tlabel: `Task: ${id}`,\n\t\t};\n\t});\n}\n\nconst scrollContainerStyles = xcss({\n\tmaxWidth: '400px',\n\theight: '400px',\n\tborderWidth: 'border.width',\n\tborderStyle: 'solid',\n\tborderColor: 'color.border',\n\toverflowY: 'scroll',\n});\n\nfunction getItemRegistry() {\n\tconst registry = new Map<string, HTMLElement>();\n\n\tfunction register({ itemId, element }: ItemEntry) {\n\t\tregistry.set(itemId, element);\n\n\t\treturn function unregister() {\n\t\t\t// Due to how the virtualizer works,\n\t\t\t// a new item can be mounted before an old\n\t\t\t// item is removed.\n\t\t\t// We don't want `unregister` to remove\n\t\t\t// a new registration\n\t\t\tif (registry.get(itemId) === element) {\n\t\t\t\tregistry.delete(itemId);\n\t\t\t}\n\t\t};\n\t}\n\n\tfunction getElement(itemId: string): HTMLElement | null {\n\t\treturn registry.get(itemId) ?? null;\n\t}\n\n\treturn { register, getElement };\n}\n\ntype ListState = {\n\titems: Item[];\n\tlastCardMoved: {\n\t\titem: Item;\n\t\tpreviousIndex: number;\n\t\tcurrentIndex: number;\n\t\tnumberOfItems: number;\n\t} | null;\n};\n\nexport default function ListExample(): React.JSX.Element {\n\tconst [{ items, lastCardMoved }, setListState] = useState<ListState>(() => ({\n\t\titems: getItems({ amount: 200 }),\n\t\tlastCardMoved: null,\n\t}));\n\tconst [registry] = useState(getItemRegistry);\n\n\tconst scrollContainerRef = useRef<HTMLDivElement | null>(null);\n\n\tconst rowVirtualizer = useVirtualizer({\n\t\tcount: items.length,\n\t\tgetScrollElement: () => scrollContainerRef.current,\n\t\testimateSize: () => sizes.item.outer,\n\t\toverscan: 2, // not sure if this is strictly needed, but just being safe\n\t});\n\n\t// Isolated instances of this component from one another\n\tconst [instanceId] = useState(() => Symbol('instance-id'));\n\n\tconst reorderItem = useCallback(\n\t\t({\n\t\t\tstartIndex,\n\t\t\tindexOfTarget,\n\t\t\tclosestEdgeOfTarget,\n\t\t}: {\n\t\t\tstartIndex: number;\n\t\t\tindexOfTarget: number;\n\t\t\tclosestEdgeOfTarget: Edge | null;\n\t\t}) => {\n\t\t\tconst finishIndex = getReorderDestinationIndex({\n\t\t\t\tstartIndex,\n\t\t\t\tclosestEdgeOfTarget,\n\t\t\t\tindexOfTarget,\n\t\t\t\taxis: 'vertical',\n\t\t\t});\n\n\t\t\tif (finishIndex === startIndex) {\n\t\t\t\t// If there would be no change, we skip the update\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tsetListState((listState) => {\n\t\t\t\tconst item = listState.items[startIndex];\n\n\t\t\t\treturn {\n\t\t\t\t\titems: reorder({\n\t\t\t\t\t\tlist: listState.items,\n\t\t\t\t\t\tstartIndex,\n\t\t\t\t\t\tfinishIndex,\n\t\t\t\t\t}),\n\t\t\t\t\tlastCardMoved: {\n\t\t\t\t\t\titem,\n\t\t\t\t\t\tpreviousIndex: startIndex,\n\t\t\t\t\t\tcurrentIndex: finishIndex,\n\t\t\t\t\t\tnumberOfItems: listState.items.length,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t});\n\t\t},\n\t\t[],\n\t);\n\n\tuseEffect(() => {\n\t\tif (lastCardMoved === null) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { item, previousIndex, currentIndex, numberOfItems } = lastCardMoved;\n\n\t\tliveRegion.announce(\n\t\t\t`You've moved ${item.label} from position ${\n\t\t\t\tpreviousIndex + 1\n\t\t\t} to position ${currentIndex + 1} of ${numberOfItems}.`,\n\t\t);\n\n\t\t// Not sure why, but can only scroll to the updated index after a timeout\n\t\tsetTimeout(() => {\n\t\t\t// need to make the item visible before it will appear in our registry\n\t\t\trowVirtualizer.scrollToIndex(currentIndex);\n\n\t\t\t// Now waiting for new elements to be registered before we trigger a flash\n\t\t\t// Unfortunately, there is no great way to wait for the virualizer to update\n\t\t\t// `options.onChange` works at the top level.\n\t\t\t// If anybody has suggestions on how to do this better, please let us know!\n\t\t\tsetTimeout(() => {\n\t\t\t\tconst element = registry.getElement(item.id);\n\t\t\t\tif (element) {\n\t\t\t\t\ttriggerPostMoveFlash(element);\n\t\t\t\t}\n\t\t\t}, 100);\n\t\t});\n\t}, [lastCardMoved, rowVirtualizer, registry]);\n\n\tuseEffect(() => {\n\t\tconst scrollContainer = scrollContainerRef.current;\n\t\tinvariant(scrollContainer);\n\n\t\tfunction canRespond({ source }: { source: ElementDragPayload }) {\n\t\t\treturn isItemData(source.data) && source.data.instanceId === instanceId;\n\t\t}\n\n\t\treturn combine(\n\t\t\tmonitorForElements({\n\t\t\t\tcanMonitor: canRespond,\n\t\t\t\tonDrop({ location, source }) {\n\t\t\t\t\tconst target = location.current.dropTargets[0];\n\t\t\t\t\tif (!target) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst sourceData = source.data;\n\t\t\t\t\tconst targetData = target.data;\n\t\t\t\t\tif (!isItemData(sourceData) || !isItemData(targetData)) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst indexOfTarget = items.findIndex((item) => item.id === targetData.item.id);\n\t\t\t\t\tif (indexOfTarget < 0) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst closestEdgeOfTarget = extractClosestEdge(targetData);\n\n\t\t\t\t\treorderItem({\n\t\t\t\t\t\tstartIndex: sourceData.index,\n\t\t\t\t\t\tindexOfTarget,\n\t\t\t\t\t\tclosestEdgeOfTarget,\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t}),\n\t\t\tautoScrollForElements({\n\t\t\t\tcanScroll: canRespond,\n\t\t\t\telement: scrollContainer,\n\t\t\t}),\n\t\t);\n\t}, [instanceId, items, reorderItem]);\n\n\t// cleanup the live region when this component is finished\n\tuseEffect(() => {\n\t\treturn function cleanup() {\n\t\t\tliveRegion.cleanup();\n\t\t};\n\t}, []);\n\n\tconst getListLength = useCallback(() => items.length, [items.length]);\n\n\tconst contextValue: ListContextValue = useMemo(() => {\n\t\treturn {\n\t\t\tregisterItem: registry.register,\n\t\t\treorderItem,\n\t\t\tinstanceId,\n\t\t\tgetListLength,\n\t\t};\n\t}, [registry.register, reorderItem, instanceId, getListLength]);\n\n\treturn (\n\t\t<ListContext.Provider value={contextValue}>\n\t\t\t<Box ref={scrollContainerRef} xcss={scrollContainerStyles}>\n\t\t\t\t<div\n\t\t\t\t\tstyle={{\n\t\t\t\t\t\theight: `${rowVirtualizer.getTotalSize()}px`,\n\t\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\t\twidth: '100%',\n\t\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\t\tposition: 'relative',\n\t\t\t\t\t}}\n\t\t\t\t>\n\t\t\t\t\t{rowVirtualizer.getVirtualItems().map((virtualItem) => (\n\t\t\t\t\t\t<ListItem\n\t\t\t\t\t\t\tkey={virtualItem.key}\n\t\t\t\t\t\t\titem={items[virtualItem.index]}\n\t\t\t\t\t\t\tvirtualItem={virtualItem}\n\t\t\t\t\t\t\tindex={virtualItem.index}\n\t\t\t\t\t\t\tposition={getItemPosition({ index: virtualItem.index, items })}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</div>\n\t\t\t</Box>\n\t\t</ListContext.Provider>\n\t);\n}\n"
  },
  {
    "path": "packages/documentation/package.json",
    "content": "{\n  \"name\": \"@atlaskit/pragmatic-drag-and-drop-docs\",\n  \"version\": \"1.4.17\",\n  \"description\": \"This package holds the documentation for Pragmatic drag and drop in one place. It is not intended to be consumed directly by consumers. The package is used by other tools for sharing examples\",\n  \"publishConfig\": {\n    \"registry\": \"https://registry.npmjs.org/\"\n  },\n  \"author\": \"Atlassian Pty Ltd\",\n  \"license\": \"Apache-2.0\",\n  \"scripts\": {\n    \"codegen\": \"ts-node -r tsconfig-paths/register ./scripts/codegen.ts\"\n  },\n  \"repository\": \"https://github.com/atlassian/pragmatic-drag-and-drop\",\n  \"main\": \"dist/cjs/index.js\",\n  \"module\": \"dist/esm/index.js\",\n  \"module:es2019\": \"dist/es2019/index.js\",\n  \"types\": \"dist/types/index.d.ts\",\n  \"sideEffects\": false,\n  \"exports\": {\n    \".\": \"./src/index.ts\"\n  },\n  \"dependencies\": {\n    \"@atlaskit/platform-feature-flags\": \"^1.1.0\",\n    \"@babel/runtime\": \"^7.0.0\"\n  },\n  \"devDependencies\": {\n    \"@atlaskit/avatar\": \"^25.10.0\",\n    \"@atlaskit/badge\": \"^18.4.0\",\n    \"@atlaskit/button\": \"^23.10.0\",\n    \"@atlaskit/code\": \"^17.4.0\",\n    \"@atlaskit/focus-ring\": \"^3.0.0\",\n    \"@atlaskit/grid\": \"^0.18.0\",\n    \"@atlaskit/heading\": \"^5.3.0\",\n    \"@atlaskit/icon\": \"^33.0.0\",\n    \"@atlaskit/pragmatic-drag-and-drop\": \"^1.7.0\",\n    \"@atlaskit/pragmatic-drag-and-drop-hitbox\": \"^1.1.0\",\n    \"@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll\": \"^2.0.0\",\n    \"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator\": \"^3.2.0\",\n    \"@atlaskit/primitives\": \"^18.0.0\",\n    \"@atlaskit/theme\": \"^22.0.0\",\n    \"@atlaskit/tokens\": \"^11.1.0\",\n    \"@emotion/react\": \"^11.7.1\",\n    \"@tanstack/react-virtual\": \"3.0.0-beta.60\",\n    \"bind-event-listener\": \"^3.0.0\",\n    \"fast-glob\": \"^3.2.11\",\n    \"memoize-one\": \"^6.0.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"tiny-invariant\": \"^1.2.0\",\n    \"ts-node\": \"^10.9.1\"\n  },\n  \"homepage\": \"https://atlassian.design/components/pragmatic-drag-and-drop/\",\n  \"platform-feature-flags\": {\n    \"dst-a11y__replace-anchor-with-link__design-system-\": {\n      \"type\": \"boolean\"\n    }\n  }\n}\n"
  },
  {
    "path": "packages/documentation/scripts/codegen.ts",
    "content": "import fs from 'fs/promises';\nimport path from 'path';\n\nimport glob from 'fast-glob';\n\nimport { createSignedArtifact } from '@atlassian/codegen';\n\nasync function generateSVGDataURIs() {\n\tconst imageFolder = path.resolve(__dirname, '../examples/data/people/images');\n\tconst svgFiles = await glob(`${imageFolder}/raw/*.svg`);\n\n\tawait Promise.all(\n\t\tsvgFiles.map(async (file) => {\n\t\t\tconst svg = await fs.readFile(file, { encoding: 'utf8' });\n\n\t\t\tconst dataURI = `data:image/svg+xml,${svg.replace(/\\n/g, '').replace(/[#<>]/g, encodeURIComponent)}`;\n\t\t\tconst source = `export default '${dataURI}'`;\n\n\t\t\tconst signedSource = createSignedArtifact(\n\t\t\t\tsource,\n\t\t\t\t'yarn workspace @atlaskit/pragmatic-drag-and-drop-docs codegen',\n\t\t\t\t'This exists to workaround CodeSandbox issues with importing SVGs',\n\t\t\t);\n\n\t\t\tconst outputFolder = path.join(imageFolder, 'processed');\n\n\t\t\t// Using `recursive: true` so it doesn't throw if it already exists\n\t\t\tawait fs.mkdir(outputFolder, { recursive: true });\n\n\t\t\tawait fs.writeFile(\n\t\t\t\tpath.join(outputFolder, path.basename(file).replace('.svg', '.ts')),\n\t\t\t\tsignedSource,\n\t\t\t);\n\t\t}),\n\t);\n}\n\ngenerateSVGDataURIs();\n"
  },
  {
    "path": "packages/documentation/src/index.ts",
    "content": "/**\n * This file exists for module resolution purposes.\n */\nexport default {};\n"
  },
  {
    "path": "packages/documentation/tsconfig.json",
    "content": "{\n  \"extends\": \"../../tsconfig.json\",\n  \"include\": [\n    \"__tests__/**/*.ts\",\n    \"__tests__/**/*.tsx\",\n    \"examples/**/*.ts\",\n    \"examples/**/*.tsx\",\n    \"src/**/*.ts\",\n    \"src/**/*.tsx\",\n    \"**/stories.ts\",\n    \"**/stories.tsx\",\n    \"**/stories/*.ts\",\n    \"**/stories/*.tsx\",\n    \"**/stories/**/*.ts\",\n    \"**/stories/**/*.tsx\"\n  ]\n}\n"
  },
  {
    "path": "packages/flourish/.npmignore",
    "content": "src/\nexamples-utils/\nexamples/\nindex.ts\ndocs/\nbuild/\n__tests__/\ntsconfig.json\ntsconfig.app.json\ntsconfig.dev.json\n"
  },
  {
    "path": "packages/flourish/CHANGELOG.md",
    "content": "# @atlaskit/pragmatic-drag-and-drop-flourish\n\n## 2.0.12\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.0.7\n\n### Patch Changes\n\n- [`717cc94987686`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/717cc94987686) -\n  Internal changes to how borders are applied.\n\n## 2.0.6\n\n### Patch Changes\n\n- [`beaa6ee463aa8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/beaa6ee463aa8) -\n  Internal changes to how border radius is applied.\n- Updated dependencies\n\n## 2.0.5\n\n### Patch Changes\n\n- [`806cfe1c4e6b7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/806cfe1c4e6b7) -\n  Internal changes to how border radius is applied.\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.0.3\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.0.2\n\n### Patch Changes\n\n- [#125534](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/125534)\n  [`56084060884c6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/56084060884c6) -\n  Removes React from the declared dependencies as they do not actually use it.\n- [#125534](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/125534)\n  [`ae44d864ac2ba`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ae44d864ac2ba) -\n  Removes `react` as a peer dependency as it is not actually used.\n\n## 2.0.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.0.0\n\n### Major Changes\n\n- [#117363](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/117363)\n  [`10a0f7f6c2027`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/10a0f7f6c2027) -\n  This package's `peerDependencies` have been adjusted for `react` and/or `react-dom` to reflect the\n  status of only supporting React 18 going forward. No explicit breaking change to React support has\n  been made in this release, but this is to signify going forward, breaking changes for React 16 or\n  React 17 may come via non-major semver releases.\n\n  Please refer this community post for more details:\n  https://community.developer.atlassian.com/t/rfc-78-dropping-support-for-react-16-and-rendering-in-a-react-18-concurrent-root-in-jira-and-confluence/87026\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.2.2\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.2.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.2.0\n\n### Minor Changes\n\n- [#109060](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109060)\n  [`4660ec858a305`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4660ec858a305) -\n  Update `React` from v16 to v18\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.1.3\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.1.2\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.1.1\n\n### Patch Changes\n\n- [#124164](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/124164)\n  [`58941fa1d332a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/58941fa1d332a) -\n  All `react` unit tests will now run against `react@16` and `react@18` on CI.\n\n## 1.1.0\n\n### Minor Changes\n\n- [#87853](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87853)\n  [`54e884fd8d96`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/54e884fd8d96) -\n  Increasing `react` `peerDependency` range to include `react@17` and `react@18`.\n\n## 1.0.4\n\n### Patch Changes\n\n- [#84398](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84398)\n  [`77694db987fc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/77694db987fc) -\n  Public release of Pragmatic drag and drop documentation\n\n## 1.0.3\n\n### Patch Changes\n\n- [#84250](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84250)\n  [`a1cc31800621`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a1cc31800621) -\n  Internal refactor: now relying on automatic fallback insertion for `token()`. This change provides\n  an improved experience for consumers who don't have Atlassian Design tokens enabled.\n\n## 1.0.2\n\n### Patch Changes\n\n- [#83702](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83702)\n  [`4d9e25ab4eaa`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4d9e25ab4eaa) -\n  Updating the descriptions of Pragmatic drag and drop packages, so they each provide a consistent\n  description to various consumers, and so they are consistently formed amongst each other.\n  - `package.json` `description`\n  - `README.md`\n  - Website documentation\n\n## 1.0.1\n\n### Patch Changes\n\n- [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116)\n  [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) -\n  Upgrade Typescript from `4.9.5` to `5.4.2`\n\n## 1.0.0\n\n### Major Changes\n\n- [#70616](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70616)\n  [`42e57ea65fee`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/42e57ea65fee) -\n  This is our first `major` release (`1.0`) for all Pragmatic drag and drop packages.\n\n  For a detailed explanation of these changes, and how to upgrade (automatically) to `1.0` please\n  see our\n  [1.0 upgrade guide](http://atlassian.design/components/pragmatic-drag-and-drop/core-package/upgrade-guides/upgrade-guide-for-1.0)\n\n## 0.2.0\n\n### Minor Changes\n\n- [#40255](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/40255)\n  [`6775eeedcb4`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6775eeedcb4) - [ux]\n  Increased the duration of the post drop flash animation, as a result of design review.\n"
  },
  {
    "path": "packages/flourish/LICENSE.md",
    "content": "Copyright 2023 Atlassian Pty Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in\ncompliance with the License. You may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is\ndistributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\nimplied. See the License for the specific language governing permissions and limitations under the\nLicense.\n"
  },
  {
    "path": "packages/flourish/README.md",
    "content": "# Pragmatic drag and drop\n\nAn optional Pragmatic drag and drop package for adding visual flourish to drag and drop experiences.\n\n[📖 Documentation](https://atlassian.design/components/pragmatic-drag-and-drop/)\n"
  },
  {
    "path": "packages/flourish/afm-jira/tsconfig.json",
    "content": "{\n\t\"extends\": \"../../../../tsconfig.local-consumption.json\",\n\t\"compilerOptions\": {\n\t\t\"target\": \"es5\",\n\t\t\"outDir\": \"../../../../../jira/tsDist/@atlaskit__pragmatic-drag-and-drop-flourish/app\",\n\t\t\"rootDir\": \"../\",\n\t\t\"composite\": true,\n\t\t\"noCheck\": true\n\t},\n\t\"include\": [\n\t\t\"../src/**/*.ts\",\n\t\t\"../src/**/*.tsx\"\n\t],\n\t\"exclude\": [\n\t\t\"../src/**/__tests__/*\",\n\t\t\"../src/**/*.test.*\",\n\t\t\"../src/**/test.*\",\n\t\t\"../src/**/examples.*\",\n\t\t\"../src/**/examples/*\",\n\t\t\"../src/**/examples/**/*\",\n\t\t\"../src/**/*.stories.*\",\n\t\t\"../src/**/stories/*\",\n\t\t\"../src/**/stories/**/*\"\n\t],\n\t\"references\": [\n\t\t{\n\t\t\t\"path\": \"../../../design-system/motion/afm-jira/tsconfig.json\"\n\t\t},\n\t\t{\n\t\t\t\"path\": \"../../../design-system/tokens/afm-jira/tsconfig.json\"\n\t\t}\n\t]\n}\n"
  },
  {
    "path": "packages/flourish/afm-products/tsconfig.json",
    "content": "{\n\t\"extends\": \"../../../../tsconfig.local-consumption.json\",\n\t\"compilerOptions\": {\n\t\t\"target\": \"es5\",\n\t\t\"outDir\": \"../../../../../tsDist/@atlaskit__pragmatic-drag-and-drop-flourish/app\",\n\t\t\"rootDir\": \"../\",\n\t\t\"composite\": true,\n\t\t\"noCheck\": true\n\t},\n\t\"include\": [\n\t\t\"../src/**/*.ts\",\n\t\t\"../src/**/*.tsx\"\n\t],\n\t\"exclude\": [\n\t\t\"../src/**/__tests__/*\",\n\t\t\"../src/**/*.test.*\",\n\t\t\"../src/**/test.*\",\n\t\t\"../src/**/examples.*\",\n\t\t\"../src/**/examples/*\",\n\t\t\"../src/**/examples/**/*\",\n\t\t\"../src/**/*.stories.*\",\n\t\t\"../src/**/stories/*\",\n\t\t\"../src/**/stories/**/*\"\n\t],\n\t\"references\": [\n\t\t{\n\t\t\t\"path\": \"../../../design-system/motion/afm-products/tsconfig.json\"\n\t\t},\n\t\t{\n\t\t\t\"path\": \"../../../design-system/tokens/afm-products/tsconfig.json\"\n\t\t}\n\t]\n}\n"
  },
  {
    "path": "packages/flourish/constellation/index/about.mdx",
    "content": "---\norder: 0\ntitle: Flourish\ndescription: An optional package for adding visual flourish to drag and drop experiences\n---\n\nAvailable outputs:\n\n- [Post move flash](/components/pragmatic-drag-and-drop/optional-packages/flourish/trigger-post-move-flash/)\n"
  },
  {
    "path": "packages/flourish/constellation/index/props.mdx",
    "content": ""
  },
  {
    "path": "packages/flourish/constellation/trigger-post-move-flash/examples.mdx",
    "content": "---\norder: 0\n---\n\nimport BasicFlashExample from '../../examples/basic';\nimport SectionMessage from '@atlaskit/section-message';\n\nThis function will cause an element to flash. This is a nice visual affordance to add to an item\nafter it has finished being moved to make it clear where the item has finished.\n\n<SectionMessage>\n\nThis function depends on:\n\n- [`@atlaskit/motion`](/components/tokens): Atlassian Design System motion duration\n- [`@atlaskit/tokens`](/components/motion): Atlassian Design System colours for the flash\n\n<br />\n\nThis function is simple to implement on your own tech stack if you want to.\n\n</SectionMessage>\n\n```ts\nimport { triggerPostMoveFlash } from '@atlaskit/pragmatic-drag-and-drop/flourish';\n\n// trigger post move flash on an element after it has finished moving\ntriggerPostMoveFlash(myElement);\n```\n\n<Example Component={BasicFlashExample} />\n"
  },
  {
    "path": "packages/flourish/constellation/trigger-post-move-flash/props.mdx",
    "content": "import FunctionPropsTable from '../../examples/constellation/props-table';\n\n## triggerPostMoveFlash(element)\n\n<FunctionPropsTable\n\tpropName={'element'}\n\tdescription={'The element that has just moved'}\n\ttyping={'HTMLElement'}\n\trequired={true}\n/>\n"
  },
  {
    "path": "packages/flourish/examples/basic.tsx",
    "content": "import React, { useCallback, useRef } from 'react';\n\nimport Button from '@atlaskit/button/new';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, Stack, xcss } from '@atlaskit/primitives';\n\nimport { triggerPostMoveFlash } from '../src/trigger-post-move-flash';\n\nconst cardStyles = xcss({\n\twidth: '100%',\n\theight: '100px',\n\tbackgroundColor: 'elevation.surface.raised',\n\tboxShadow: 'elevation.shadow.raised',\n\tborderRadius: 'radius.small',\n});\n\nexport default function BasicExample(): React.JSX.Element {\n\tconst ref = useRef<HTMLElement>(null);\n\n\tconst runAnimation = useCallback(() => {\n\t\tconst element = ref.current;\n\t\tif (!element) {\n\t\t\treturn;\n\t\t}\n\t\ttriggerPostMoveFlash(element);\n\t}, []);\n\n\treturn (\n\t\t<Stack space=\"space.200\" alignInline=\"center\">\n\t\t\t<Box ref={ref} xcss={cardStyles} />\n\t\t\t<Button onClick={runAnimation}>Run animation</Button>\n\t\t</Stack>\n\t);\n}\n"
  },
  {
    "path": "packages/flourish/examples/config.jsonc",
    "content": "/**\n * This file is used by the test scaling project to optimise test result caching\n * Examples that are used by tests affect the outcome of tests so must be included when hashing\n * They are defined here so the hashing algorithm doesn't need to search test files for example usage each time\n */\n{\n  \"testExamples\": []\n}\n"
  },
  {
    "path": "packages/flourish/examples/constellation/props-table.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport React from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport { token } from '@atlaskit/tokens';\n\nconst containerStyles = css({\n\tmargin: `${token('space.400')}px -${token('space.200')}px 0`,\n\tpadding: `${token('space.100')} ${token('space.200')}px`,\n\tborderRadius: token('space.100'),\n});\n\nconst tableStyles = css({\n\twidth: '100%',\n\tborderCollapse: 'collapse',\n});\n\nconst tbodyStyles = css({\n\tborderBottom: 'none',\n});\n\nconst tableHeaderStyles = css({\n\tpadding: `${token('space.050')} ${token('space.200')} ${token('space.050')} ${token('space.100')}`,\n\ttextAlign: 'left',\n\tverticalAlign: 'top',\n\twhiteSpace: 'nowrap',\n});\n\nconst tableCellStyles = css({\n\twidth: '100%',\n\tpadding: `${token('space.050')} 0 ${token('space.050')} ${token('space.100')}`,\n});\n\nconst headerStyles = css({\n\tmargin: `0 0 ${token('space.050')} 0`,\n\tpaddingBottom: token('space.100'),\n\tborderBottom: `${token('border.width')} solid ${token('color.border')}`,\n\tfontSize: '1em',\n\tfontWeight: token('font.weight.regular'),\n\tlineHeight: '1.4',\n});\n\nconst codeStyles = css({\n\tdisplay: 'inline-block',\n\tbackgroundColor: token('color.background.neutral'),\n\tborderRadius: token('radius.small'),\n\tcolor: `${token('color.text')}`,\n\tfontSize: '1em',\n\tlineHeight: '20px',\n\tpaddingBlock: token('space.050'),\n\tpaddingInline: token('space.100'),\n});\n\nconst typeStyles = css({\n\tbackground: token('color.background.neutral'),\n\tcolor: token('color.text.subtle'),\n\tborderRadius: token('radius.small'),\n\tdisplay: 'inline-block',\n\tpadding: '0 0.2em',\n\twhiteSpace: 'pre-wrap',\n});\n\nconst captionStyles = css({\n\ttextAlign: 'left',\n\tmargin: '0',\n\tfontSize: '1em',\n});\n\nconst requiredLabelStyles = css({\n\tmarginLeft: '1em',\n\tcolor: `${token('color.text.danger')}`,\n});\n\nconst deprecatedLabelStyles = css({\n\tmarginLeft: '1em',\n\tcolor: `${token('color.text.disabled')}`,\n});\n\nconst defaultValueStyles = css({\n\tcolor: `${token('color.text.subtle')}`,\n});\n\nconst FunctionPropsTable = ({\n\tpropName,\n\tdescription,\n\ttyping,\n\trequired,\n\tdefaultValue,\n\tdeprecated,\n}: {\n\tpropName: string;\n\tdescription: string;\n\ttyping: string;\n\trequired?: boolean;\n\tdefaultValue?: any;\n\tdeprecated?: boolean;\n}): React.JSX.Element => {\n\treturn (\n\t\t<div css={containerStyles}>\n\t\t\t<table css={tableStyles}>\n\t\t\t\t<caption css={captionStyles}>\n\t\t\t\t\t<h3 css={headerStyles}>\n\t\t\t\t\t\t{/* eslint-disable-next-line @atlaskit/design-system/no-html-code */}\n\t\t\t\t\t\t<code css={codeStyles}>{propName}</code>\n\t\t\t\t\t\t{required && defaultValue === undefined && (\n\t\t\t\t\t\t\t// eslint-disable-next-line @atlaskit/design-system/no-html-code\n\t\t\t\t\t\t\t<code css={requiredLabelStyles}>required</code>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{/* eslint-disable-next-line @atlaskit/design-system/no-html-code */}\n\t\t\t\t\t\t{deprecated && <code css={deprecatedLabelStyles}>deprecated</code>}\n\t\t\t\t\t</h3>\n\t\t\t\t</caption>\n\t\t\t\t<tbody css={tbodyStyles}>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th css={tableHeaderStyles} scope=\"row\">\n\t\t\t\t\t\t\tDescription\n\t\t\t\t\t\t</th>\n\t\t\t\t\t\t<td css={tableCellStyles}>{description}</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t{defaultValue !== undefined && (\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th css={tableHeaderStyles} scope=\"row\">\n\t\t\t\t\t\t\t\tDefault\n\t\t\t\t\t\t\t</th>\n\t\t\t\t\t\t\t<td css={tableCellStyles}>\n\t\t\t\t\t\t\t\t{/* eslint-disable-next-line @atlaskit/design-system/no-html-code */}\n\t\t\t\t\t\t\t\t<code css={defaultValueStyles}>{defaultValue}</code>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t)}\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th css={tableHeaderStyles}>Type</th>\n\t\t\t\t\t\t<td css={[tableCellStyles]}>\n\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t{/* eslint-disable-next-line @atlaskit/design-system/no-html-code */}\n\t\t\t\t\t\t\t\t<code css={typeStyles}>{typing}</code>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t</div>\n\t);\n};\n\nexport default FunctionPropsTable;\n"
  },
  {
    "path": "packages/flourish/package.json",
    "content": "{\n  \"name\": \"@atlaskit/pragmatic-drag-and-drop-flourish\",\n  \"version\": \"2.0.12\",\n  \"description\": \"An optional Pragmatic drag and drop package for adding visual flourish to drag and drop experiences\",\n  \"author\": \"Atlassian Pty Ltd\",\n  \"license\": \"Apache-2.0\",\n  \"publishConfig\": {\n    \"registry\": \"https://registry.npmjs.org/\"\n  },\n  \"repository\": \"https://github.com/atlassian/pragmatic-drag-and-drop\",\n  \"homepage\": \"https://atlassian.design/components/pragmatic-drag-and-drop/\",\n  \"main\": \"dist/cjs/index.js\",\n  \"module\": \"dist/esm/index.js\",\n  \"module:es2019\": \"dist/es2019/index.js\",\n  \"types\": \"dist/types/index.d.ts\",\n  \"sideEffects\": false,\n  \"exports\": {\n    \"./trigger-post-move-flash\": \"./src/trigger-post-move-flash.tsx\"\n  },\n  \"dependencies\": {\n    \"@atlaskit/motion\": \"^5.4.0\",\n    \"@atlaskit/tokens\": \"^11.1.0\",\n    \"@babel/runtime\": \"^7.0.0\"\n  },\n  \"devDependencies\": {\n    \"@testing-library/react\": \"^16.3.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"wait-for-expect\": \"^1.2.0\"\n  }\n}\n"
  },
  {
    "path": "packages/flourish/src/index.tsx",
    "content": "/**\n * This file exists for module resolution purposes.\n */\nexport default {};\n"
  },
  {
    "path": "packages/flourish/src/trigger-post-move-flash.tsx",
    "content": "import { durations } from '@atlaskit/motion/durations';\nimport { token } from '@atlaskit/tokens';\n\n/**\n * Runs a flash animation on the background color of the provided `element`.\n *\n * This animation should be used after an element has been reordered,\n * in order to highlight where the element has moved to.\n */\nexport function triggerPostMoveFlash(element: HTMLElement): void {\n\telement.animate([{ backgroundColor: token('color.background.selected') }, {}], {\n\t\tduration: durations.large,\n\t\t/**\n\t\t * This is equivalent to the browser default, but we are making it\n\t\t * explicit to avoid relying on implicit behavior.\n\t\t *\n\t\t * This curve is not part of `@atlaskit/motion` but it was an intentional\n\t\t * design decision to use this curve.\n\t\t */\n\t\teasing: 'cubic-bezier(0.25, 0.1, 0.25, 1.0)',\n\t\titerations: 1,\n\t});\n}\n"
  },
  {
    "path": "packages/flourish/tsconfig.json",
    "content": "{\n  \"extends\": \"../../tsconfig.json\",\n  \"include\": [\n    \"__tests__/**/*.ts\",\n    \"__tests__/**/*.tsx\",\n    \"docs/**/*.ts\",\n    \"docs/**/*.tsx\",\n    \"examples/**/*.ts\",\n    \"examples/**/*.tsx\",\n    \"src/**/*.ts\",\n    \"src/**/*.tsx\",\n    \"**/stories.ts\",\n    \"**/stories.tsx\",\n    \"**/stories/*.ts\",\n    \"**/stories/*.tsx\",\n    \"**/stories/**/*.ts\",\n    \"**/stories/**/*.tsx\"\n  ]\n}\n"
  },
  {
    "path": "packages/hitbox/.npmignore",
    "content": "src/\nexamples-utils/\nexamples/\nindex.ts\ndocs/\nbuild/\n__tests__/\ntsconfig.json\ntsconfig.app.json\ntsconfig.dev.json\n"
  },
  {
    "path": "packages/hitbox/CHANGELOG.md",
    "content": "# @atlaskit/pragmatic-drag-and-drop-hitbox\n\n## 1.1.0\n\n### Minor Changes\n\n- [#152796](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/152796)\n  [`530aa01e75ebe`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/530aa01e75ebe) -\n  Exposing new `list-item` hitbox which streamlines working with lists and nested structures. See\n  documentation for API and usage information.\n\n## 1.0.3\n\n### Patch Changes\n\n- [#84398](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84398)\n  [`77694db987fc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/77694db987fc) -\n  Public release of Pragmatic drag and drop documentation\n\n## 1.0.2\n\n### Patch Changes\n\n- [#83702](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83702)\n  [`4d9e25ab4eaa`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4d9e25ab4eaa) -\n  Updating the descriptions of Pragmatic drag and drop packages, so they each provide a consistent\n  description to various consumers, and so they are consistently formed amongst each other.\n\n  - `package.json` `description`\n  - `README.md`\n  - Website documentation\n\n## 1.0.1\n\n### Patch Changes\n\n- [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116)\n  [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) -\n  Upgrade Typescript from `4.9.5` to `5.4.2`\n\n## 1.0.0\n\n### Major Changes\n\n- [#70616](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70616)\n  [`42e57ea65fee`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/42e57ea65fee) -\n  This is our first `major` release (`1.0`) for all Pragmatic drag and drop packages.\n\n  For a detailed explanation of these changes, and how to upgrade (automatically) to `1.0` please\n  see our\n  [1.0 upgrade guide](http://atlassian.design/components/pragmatic-drag-and-drop/core-package/upgrade-guides/upgrade-guide-for-1.0)\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.12.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.12.0\n\n### Minor Changes\n\n- [#42620](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42620)\n  [`0b832b288e8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0b832b288e8) - Moving\n  our tree exports that are used in Confluence from `experimental` to `stable`.\n\n  ```diff\n  - @atlaskit/pragmatic-drag-and-drop-hitbox/experimental/tree-item\n  + @atlaskit/pragmatic-drag-and-drop-hitbox/tree-item\n  ```\n\n## 0.11.9\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.11.8\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.11.7\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.11.6\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.11.5\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.11.4\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.11.3\n\n### Patch Changes\n\n- [#34443](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34443)\n  [`61cb5313358`](https://bitbucket.org/atlassian/atlassian-frontend/commits/61cb5313358) - Removing\n  unused dependencies and dev dependencies\n\n## 0.11.2\n\n### Patch Changes\n\n- [#33793](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33793)\n  [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure\n  legacy types are published for TS 4.5-4.8\n\n## 0.11.1\n\n### Patch Changes\n\n- [#33649](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33649)\n  [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade\n  Typescript from `4.5.5` to `4.9.5`\n\n## 0.11.0\n\n### Minor Changes\n\n- [#33344](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33344)\n  [`9fd8556db17`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9fd8556db17) - Internal\n  folder name structure change\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.10.0\n\n### Minor Changes\n\n- [#33262](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33262)\n  [`34ed7b2ec63`](https://bitbucket.org/atlassian/atlassian-frontend/commits/34ed7b2ec63) - We have\n  changed the name of our drag and drop packages to align on the single name of \"Pragmatic drag and\n  drop\"\n\n  ```diff\n  - @atlaskit/drag-and-drop\n  + @atlaskit/pragmatic-drag-and-drop\n\n  - @atlaskit/drag-and-drop-autoscroll\n  + @atlaskit/pragmatic-drag-and-drop-autoscroll\n\n  - @atlaskit/drag-and-drop-hitbox\n  + @atlaskit/pragmatic-drag-and-drop-hitbox\n\n  - @atlaskit/drag-and-drop-indicator\n  + @atlaskit/pragmatic-drag-and-drop-react-indicator\n  # Note: `react` was added to this package name as our indicator package is designed for usage with `react`.\n\n  - @atlaskit/drag-and-drop-live-region\n  + @atlaskit/pragmatic-drag-and-drop-live-region\n\n  - @atlaskit/drag-and-drop-react-beautiful-dnd-migration\n  + @atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration\n\n  - @atlaskit/drag-and-drop-docs\n  + @atlaskit/pragmatic-drag-and-drop-docs\n  ```\n\n  The new `@atlaskit/pragmatic-drag-and-drop*` packages will start their initial versions from where\n  the ``@atlaskit/drag-and-drop*` packages left off. Doing this will make it easier to look back on\n  changelogs and see how the packages have progressed.\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.9.0\n\n### Minor Changes\n\n- [#33258](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33258)\n  [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip\n  minor dependency bump\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.8.1\n\n### Patch Changes\n\n- [#32424](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32424)\n  [`2e01c9c74b5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e01c9c74b5) - DUMMY\n  remove before merging to master; dupe adf-schema via adf-utils\n\n## 0.8.0\n\n### Minor Changes\n\n- [#32145](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32145)\n  [`a7dc73c0a57`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a7dc73c0a57) - Internal\n  refactor: implemented a cheaper mechanism to enable memoization of tree item data\n\n## 0.7.0\n\n### Minor Changes\n\n- [#32051](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32051)\n  [`00434d087d7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/00434d087d7) - Tree\n  item hitbox data is now memoized. This is helpful to reduce work for consumers who may take\n  actions based on object reference changes.\n\n  If you are using `react` and putting tree item hitbox instructions into state, react will now only\n  re-render when the content of the instruction changes.\n\n## 0.6.3\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.6.2\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.6.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.6.0\n\n### Minor Changes\n\n- [#31289](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/31289)\n  [`179d953be18`](https://bitbucket.org/atlassian/atlassian-frontend/commits/179d953be18) - [ux]\n  Tweaking the hitbox of \"expanded\" tree items to improve the experience when expanding tree items\n  during a drag. Note: our tree item hitbox is still _experimental_\n\n## 0.5.0\n\n### Minor Changes\n\n- [#30953](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/30953)\n  [`90901f5bbe0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/90901f5bbe0) - Replace\n  default entry point of `undefined` with `{}`.\n\n  > **NOTE:** Importing from the default entry point isn't supported. _Please use individual entry\n  > points in order to always obtain minimum kbs._\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.4.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.4.0\n\n### Minor Changes\n\n- [#29945](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/29945)\n  [`fe6772a3719`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fe6772a3719) - Dramatic\n  update to **experimental** tree-item outputs. These outputs should only be used right now by\n  Confluence Page Tree. Changes are being communicated face to face with Confluence team members\n\n## 0.3.2\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.3.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.3.0\n\n### Minor Changes\n\n- [#26934](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/26934)\n  [`f004dadb4fc`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f004dadb4fc) -\n  `reorderWithEdge` has changed API in order to more accurately reflect the values that are being\n  passed in\n\n  ```diff\n  function reorderWithEdge<Value>(args: {\n      list: Value[];\n  -   edge: Edge | null;\n  +   // the reorder operation is based on what the closest edge of the target is\n  +   closestEdgeOfTarget: Edge | null;\n      startIndex: number;\n  -   finalIndex: number\n  +   // we are reordering relative to the target\n  +   indexOfTarget: number;\n      axis: 'vertical' | 'horizontal';\n  }): Value[];\n  ```\n\n  Adding new utility: `getReorderDestinationIndex`\n\n  When you are rendering _drop indicators_ (eg lines) between items in a list, it can be difficult\n  to know what the `index` the dropped item should go into. The final `index` will depend on what\n  the closest `Edge` is. `getReorderDestinationIndex` can give you the final `index` for a\n  reordering operation, taking into account which `Edge` is closest\n\n  ```ts\n  import { getReorderDestinationIndex } from '@atlaskit/drag-and-drop-hitbox/util/get-reorder-destination-index';\n\n  // Dragging A on the left of B\n  // A should stay in the same spot\n  expect(\n  \tgetReorderDestinationIndex({\n  \t\t// list: ['A', 'B', 'C'],\n  \t\t// move A to left of B\n  \t\tstartIndex: 0,\n  \t\tindexOfTarget: 1,\n  \t\tclosestEdgeOfTarget: 'left',\n  \t\taxis: 'horizontal',\n  \t}),\n  \t// results in no change: ['A', 'B', 'C']\n  ).toEqual(0);\n\n  // Dragging A on the right of B\n  // A should go after B\n  expect(\n  \tgetReorderDestinationIndex({\n  \t\t// list: ['A', 'B', 'C'],\n  \t\t// move A to right of B\n  \t\tstartIndex: 0,\n  \t\tindexOfTarget: 1,\n  \t\tclosestEdgeOfTarget: 'right',\n  \t\taxis: 'horizontal',\n  \t}),\n  \t// A moved forward ['B', 'A', 'C']\n  ).toEqual(1);\n  ```\n\n## 0.2.7\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.2.6\n\n### Patch Changes\n\n- [#24874](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24874)\n  [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade\n  Typescript from `4.3.5` to `4.5.5`\n\n## 0.2.5\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.2.4\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.2.3\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.2.2\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.2.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.2.0\n\n### Minor Changes\n\n- [#24613](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24613)\n  [`dcebdf9404e`](https://bitbucket.org/atlassian/atlassian-frontend/commits/dcebdf9404e) - We have\n  improved our naming consistency across our drag and drop packages.\n\n  - `@atlaskit/drag-and-drop-hitbox/closest-edge` has been renamed to\n    `@atlaskit/drag-and-drop-hitbox/addon/closest-edge`\n  - `@atlaskit/drag-and-drop-hitbox/reorder-with-edge` has been renamed to\n    `@atlaskit/drag-and-drop-hitbox/util/reorder-with-edge`\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.1.0\n\n### Minor Changes\n\n- [#24532](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24532)\n  [`73427c38077`](https://bitbucket.org/atlassian/atlassian-frontend/commits/73427c38077) - Initial\n  release of `@atlaskit/drag-and-drop` packages 🎉\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.0.1\n\n### Patch Changes\n\n- [#24492](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24492)\n  [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade\n  Typescript from `4.2.4` to `4.3.5`.\n- Updated dependencies\n"
  },
  {
    "path": "packages/hitbox/LICENSE.md",
    "content": "Copyright 2022 Atlassian Pty Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in\ncompliance with the License. You may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is\ndistributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\nimplied. See the License for the specific language governing permissions and limitations under the\nLicense.\n"
  },
  {
    "path": "packages/hitbox/README.md",
    "content": "## Pragmatic drag and drop\n\nAn optional package for Pragmatic drag and drop that enables the attaching of interaction information to a drop target.\n\n[📖 Documentation](https://atlassian.design/components/pragmatic-drag-and-drop/)\n"
  },
  {
    "path": "packages/hitbox/__tests__/unit/_util.ts",
    "content": "import type { Input } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nexport function getDefaultInput(overrides: Partial<Input> = {}): Input {\n\tconst defaults: Input = {\n\t\t// user input\n\t\taltKey: false,\n\t\tbutton: 0,\n\t\tbuttons: 0,\n\t\tctrlKey: false,\n\t\tmetaKey: false,\n\t\tshiftKey: false,\n\n\t\t// coordinates\n\t\tclientX: 0,\n\t\tclientY: 0,\n\t\tpageX: 0,\n\t\tpageY: 0,\n\t};\n\n\treturn {\n\t\t...defaults,\n\t\t...overrides,\n\t};\n}\n\nexport function getRect(box: {\n\ttop: number;\n\tbottom: number;\n\tleft: number;\n\tright: number;\n}): DOMRect {\n\treturn DOMRect.fromRect({\n\t\tx: box.left,\n\t\ty: box.top,\n\t\twidth: box.right - box.left,\n\t\theight: box.bottom - box.top,\n\t});\n}\n\n// usage: const [A, B, C, D, F] = getElements();\nexport function* getElements(tagName: keyof HTMLElementTagNameMap = 'div'): Generator<Element> {\n\twhile (true) {\n\t\tyield document.createElement(tagName);\n\t}\n}\n\nexport function between(inner: number, outer: number): number {\n\tconst diff = outer - inner;\n\tconst halfway = inner + diff / 2;\n\treturn halfway;\n}\n"
  },
  {
    "path": "packages/hitbox/__tests__/unit/closest-edge.spec.ts",
    "content": "import type { Input } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport { attachClosestEdge, extractClosestEdge } from '../../src/closest-edge';\nimport type { Edge } from '../../src/types';\n\nimport { between, getDefaultInput, getElements, getRect } from './_util';\n\nconst rect = getRect({\n\ttop: 0,\n\tleft: 0,\n\tright: 100,\n\tbottom: 100,\n});\n\nconst allEdges: Edge[] = ['top', 'right', 'bottom', 'left'];\n\ntype Scenario = {\n\tdescription: string;\n\tinput: Input;\n\tallowedEdges: Edge[];\n\texpected: Edge | null;\n\tonly?: boolean;\n};\n\nconst scenarios: Scenario[] = [\n\t{\n\t\tdescription: 'on center of top edge',\n\t\tinput: getDefaultInput({\n\t\t\tclientX: between(rect.left, rect.right),\n\t\t\tclientY: rect.top,\n\t\t}),\n\t\tallowedEdges: allEdges,\n\t\texpected: 'top',\n\t},\n\t{\n\t\tdescription: 'just below top edge',\n\t\tinput: getDefaultInput({\n\t\t\tclientX: between(rect.left, rect.right),\n\t\t\tclientY: rect.top + 1,\n\t\t}),\n\t\tallowedEdges: allEdges,\n\t\texpected: 'top',\n\t},\n\t{\n\t\tdescription: 'just above top edge',\n\t\tinput: getDefaultInput({\n\t\t\tclientX: between(rect.left, rect.right),\n\t\t\tclientY: rect.top - 1,\n\t\t}),\n\t\tallowedEdges: allEdges,\n\t\texpected: 'top',\n\t},\n\t{\n\t\tdescription: 'far away from top edge (testing negative values)',\n\t\tinput: getDefaultInput({\n\t\t\t// a touch closer to the left\n\t\t\tclientX: between(rect.left, rect.right) - 1,\n\t\t\tclientY: rect.top - 1000,\n\t\t}),\n\t\tallowedEdges: allEdges,\n\t\texpected: 'left',\n\t},\n\t{\n\t\tdescription: 'on center of right edge',\n\t\tinput: getDefaultInput({\n\t\t\tclientX: rect.right,\n\t\t\tclientY: between(rect.top, rect.bottom),\n\t\t}),\n\t\tallowedEdges: allEdges,\n\t\texpected: 'right',\n\t},\n\t{\n\t\tdescription: 'just outside of right edge',\n\t\tinput: getDefaultInput({\n\t\t\tclientX: rect.right + 1,\n\t\t\tclientY: between(rect.top, rect.bottom),\n\t\t}),\n\t\tallowedEdges: allEdges,\n\t\texpected: 'right',\n\t},\n\t{\n\t\tdescription: 'just inside of right edge',\n\t\tinput: getDefaultInput({\n\t\t\tclientX: rect.right - 1,\n\t\t\tclientY: between(rect.top, rect.bottom),\n\t\t}),\n\t\tallowedEdges: allEdges,\n\t\texpected: 'right',\n\t},\n\t{\n\t\tdescription: 'far away from right edge (testing negative values)',\n\t\tinput: getDefaultInput({\n\t\t\tclientX: rect.right + 1000,\n\t\t\t// a touch closer to the bottom\n\t\t\tclientY: between(rect.top, rect.bottom) + 1,\n\t\t}),\n\t\tallowedEdges: allEdges,\n\t\texpected: 'bottom',\n\t},\n\t{\n\t\tdescription: 'on center of bottom edge',\n\t\tinput: getDefaultInput({\n\t\t\tclientX: between(rect.left, rect.right),\n\t\t\tclientY: rect.bottom,\n\t\t}),\n\t\tallowedEdges: allEdges,\n\t\texpected: 'bottom',\n\t},\n\t{\n\t\tdescription: 'just below bottom edge',\n\t\tinput: getDefaultInput({\n\t\t\tclientX: between(rect.left, rect.right),\n\t\t\tclientY: rect.bottom + 1,\n\t\t}),\n\t\tallowedEdges: allEdges,\n\t\texpected: 'bottom',\n\t},\n\t{\n\t\tdescription: 'just above bottom edge',\n\t\tinput: getDefaultInput({\n\t\t\tclientX: between(rect.left, rect.right),\n\t\t\tclientY: rect.bottom - 1,\n\t\t}),\n\t\tallowedEdges: allEdges,\n\t\texpected: 'bottom',\n\t},\n\t{\n\t\tdescription: 'far away from bottom edge (testing negative values)',\n\t\tinput: getDefaultInput({\n\t\t\t// slightly closer to left\n\t\t\tclientX: between(rect.left, rect.right) - 1,\n\t\t\tclientY: rect.bottom + 1000,\n\t\t}),\n\t\tallowedEdges: allEdges,\n\t\texpected: 'left',\n\t},\n\t{\n\t\tdescription: 'on center of left edge',\n\t\tinput: getDefaultInput({\n\t\t\tclientX: rect.left,\n\t\t\tclientY: between(rect.top, rect.bottom),\n\t\t}),\n\t\tallowedEdges: allEdges,\n\t\texpected: 'left',\n\t},\n\t{\n\t\tdescription: 'just outside of left edge',\n\t\tinput: getDefaultInput({\n\t\t\tclientX: rect.left - 1,\n\t\t\tclientY: between(rect.top, rect.bottom),\n\t\t}),\n\t\tallowedEdges: allEdges,\n\t\texpected: 'left',\n\t},\n\t{\n\t\tdescription: 'just inside left edge',\n\t\tinput: getDefaultInput({\n\t\t\tclientX: rect.left + 1,\n\t\t\tclientY: between(rect.top, rect.bottom),\n\t\t}),\n\t\tallowedEdges: allEdges,\n\t\texpected: 'left',\n\t},\n\t{\n\t\tdescription: 'far away from left edge (testing negative values)',\n\t\tinput: getDefaultInput({\n\t\t\tclientX: rect.left + 1,\n\t\t\tclientY: between(rect.top, rect.bottom),\n\t\t}),\n\t\tallowedEdges: allEdges,\n\t\texpected: 'left',\n\t},\n\t{\n\t\tdescription: 'use only available edge',\n\t\tinput: getDefaultInput({\n\t\t\tclientX: rect.left,\n\t\t\tclientY: between(rect.top, rect.bottom),\n\t\t}),\n\t\t// normally closest to left edge but only allowing right edge\n\t\tallowedEdges: ['right'],\n\t\texpected: 'right',\n\t},\n\t{\n\t\tdescription: 'return null if no available edges',\n\t\tinput: getDefaultInput({\n\t\t\tclientX: rect.left,\n\t\t\tclientY: between(rect.top, rect.bottom),\n\t\t}),\n\t\t// normally closest to left edge but only allowing right edge\n\t\tallowedEdges: [],\n\t\texpected: null,\n\t},\n\t{\n\t\tdescription: 'far away from left edge (handling negative values)',\n\t\tinput: getDefaultInput({\n\t\t\t// left edge is actually really far away\n\t\t\tclientX: rect.left - 1000,\n\t\t\t// pushing closer to bottom so after `left` the next closest will be `bottom`\n\t\t\tclientY: between(rect.top, rect.bottom) + 1,\n\t\t}),\n\t\t// normally closest to left edge but only allowing right edge\n\t\tallowedEdges: allEdges,\n\t\texpected: 'bottom',\n\t},\n];\n\nscenarios.forEach((scenario: Scenario) => {\n\tconst base = scenario.only ? test.only : test;\n\n\tbase(`scenario: ${scenario.description}`, () => {\n\t\tconst [element] = getElements();\n\t\telement.getBoundingClientRect = () => rect;\n\n\t\tconst result = extractClosestEdge(\n\t\t\tattachClosestEdge(\n\t\t\t\t{},\n\t\t\t\t{ element, input: scenario.input, allowedEdges: scenario.allowedEdges },\n\t\t\t),\n\t\t);\n\t\texpect(result).toEqual(scenario.expected);\n\t});\n});\n\nit('should not impact user data', () => {\n\tconst [element] = getElements();\n\telement.getBoundingClientRect = () => rect;\n\tconst data = { message: 'hello' };\n\n\tconst updated = attachClosestEdge(data, {\n\t\telement,\n\t\tinput: getDefaultInput(),\n\t\tallowedEdges: ['top'],\n\t});\n\n\texpect(updated.message).toEqual('hello');\n});\n"
  },
  {
    "path": "packages/hitbox/__tests__/unit/get-reorder-destination-index.spec.ts",
    "content": "import { getReorderDestinationIndex } from '../../src/get-reorder-destination-index';\n\ntest('moving relative to self should do nothing', () => {\n\texpect(\n\t\tgetReorderDestinationIndex({\n\t\t\tstartIndex: 0,\n\t\t\tindexOfTarget: 0,\n\t\t\tclosestEdgeOfTarget: 'right',\n\t\t\taxis: 'horizontal',\n\t\t}),\n\t).toEqual(0);\n\n\texpect(\n\t\tgetReorderDestinationIndex({\n\t\t\tstartIndex: 0,\n\t\t\tindexOfTarget: 0,\n\t\t\tclosestEdgeOfTarget: 'left',\n\t\t\taxis: 'horizontal',\n\t\t}),\n\t).toEqual(0);\n\n\texpect(\n\t\tgetReorderDestinationIndex({\n\t\t\tstartIndex: 1,\n\t\t\tindexOfTarget: 1,\n\t\t\tclosestEdgeOfTarget: 'right',\n\t\t\taxis: 'horizontal',\n\t\t}),\n\t).toEqual(1);\n\n\texpect(\n\t\tgetReorderDestinationIndex({\n\t\t\tstartIndex: 1,\n\t\t\tindexOfTarget: 1,\n\t\t\tclosestEdgeOfTarget: 'left',\n\t\t\taxis: 'horizontal',\n\t\t}),\n\t).toEqual(1);\n});\n\ntest('moving forward', () => {\n\texpect(\n\t\tgetReorderDestinationIndex({\n\t\t\t// list: ['A', 'B', 'C'],\n\t\t\t// move A to left of B\n\t\t\tstartIndex: 0,\n\t\t\tindexOfTarget: 1,\n\t\t\tclosestEdgeOfTarget: 'left',\n\t\t\taxis: 'horizontal',\n\t\t}),\n\t\t// results in no change: ['A', 'B', 'C']\n\t).toEqual(0);\n\n\texpect(\n\t\tgetReorderDestinationIndex({\n\t\t\t// list: ['A', 'B', 'C'],\n\t\t\t// move A to right of B\n\t\t\tstartIndex: 0,\n\t\t\tindexOfTarget: 1,\n\t\t\tclosestEdgeOfTarget: 'right',\n\t\t\taxis: 'horizontal',\n\t\t}),\n\t\t// A moved forward ['B', 'A', 'C']\n\t).toEqual(1);\n});\n\ntest('moving backwards', () => {\n\texpect(\n\t\tgetReorderDestinationIndex({\n\t\t\t// list: ['A', 'B', 'C'],\n\t\t\t// move C to right of B\n\t\t\tstartIndex: 2,\n\t\t\tindexOfTarget: 1,\n\t\t\tclosestEdgeOfTarget: 'right',\n\t\t\taxis: 'horizontal',\n\t\t}),\n\t\t// results in no change: ['A', 'B', 'C']\n\t).toEqual(2);\n\n\texpect(\n\t\tgetReorderDestinationIndex({\n\t\t\t// list: ['A', 'B', 'C'],\n\t\t\t// move C to left of B\n\t\t\tstartIndex: 2,\n\t\t\tindexOfTarget: 1,\n\t\t\tclosestEdgeOfTarget: 'left',\n\t\t\taxis: 'horizontal',\n\t\t}),\n\t\t// C moved ['A', 'C', 'B']\n\t).toEqual(1);\n});\n"
  },
  {
    "path": "packages/hitbox/__tests__/unit/list-item-memoization.spec.ts",
    "content": "import { attachInstruction, extractInstruction, type Instruction } from '../../src/list-item';\n\nimport { between, getDefaultInput, getElements, getRect } from './_util';\n\nconst rect = getRect({\n\ttop: 0,\n\tleft: 0,\n\tright: 100,\n\tbottom: 100,\n});\n\nconst [element] = getElements();\nelement.getBoundingClientRect = () => rect;\n\nconst centerX = between(rect.left, rect.right);\n\nit('should return the same instruction reference when the instruction has not changed', () => {\n\tconst expected: Instruction = {\n\t\toperation: 'reorder-before',\n\t\tblocked: false,\n\t\taxis: 'vertical',\n\t};\n\n\tconst first = extractInstruction(\n\t\tattachInstruction(\n\t\t\t{},\n\t\t\t{\n\t\t\t\telement,\n\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\tclientX: centerX,\n\t\t\t\t\tclientY: rect.top,\n\t\t\t\t}),\n\t\t\t\toperations: { 'reorder-before': 'available', 'reorder-after': 'available' },\n\t\t\t},\n\t\t),\n\t);\n\n\texpect(first).toEqual(expected);\n\n\tconst second = extractInstruction(\n\t\tattachInstruction(\n\t\t\t{},\n\t\t\t{\n\t\t\t\telement,\n\t\t\t\t// still in the top zone\n\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\tclientX: centerX,\n\t\t\t\t\tclientY: rect.top + 1,\n\t\t\t\t}),\n\t\t\t\toperations: { 'reorder-before': 'available', 'reorder-after': 'available' },\n\t\t\t},\n\t\t),\n\t);\n\n\texpect(second).toEqual(expected);\n\t// expecting reference to match\n\texpect(first).toBe(second);\n\n\t// input is changing, but will still be in the 'reorder-above' hitzone\n\tconst third = extractInstruction(\n\t\tattachInstruction(\n\t\t\t{},\n\t\t\t{\n\t\t\t\telement,\n\t\t\t\t// still in the top zone\n\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\tclientX: centerX,\n\t\t\t\t\tclientY: rect.top + 2,\n\t\t\t\t}),\n\t\t\t\toperations: { 'reorder-before': 'available', 'reorder-after': 'available' },\n\t\t\t},\n\t\t),\n\t);\n\n\texpect(third).toEqual(expected);\n\t// expecting reference to match\n\texpect(first).toBe(third);\n});\n\nit('should return a new instruction the result instruction changes', () => {\n\tconst first = extractInstruction(\n\t\tattachInstruction(\n\t\t\t{},\n\t\t\t{\n\t\t\t\telement,\n\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\tclientX: centerX,\n\t\t\t\t\tclientY: rect.top,\n\t\t\t\t}),\n\t\t\t\toperations: { 'reorder-before': 'available', 'reorder-after': 'available' },\n\t\t\t},\n\t\t),\n\t);\n\n\t{\n\t\tconst expected: Instruction = {\n\t\t\toperation: 'reorder-before',\n\t\t\tblocked: false,\n\t\t\taxis: 'vertical',\n\t\t};\n\t\texpect(first).toEqual(expected);\n\t}\n\n\tconst second = extractInstruction(\n\t\tattachInstruction(\n\t\t\t{},\n\t\t\t{\n\t\t\t\telement,\n\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\tclientX: centerX,\n\t\t\t\t\tclientY: rect.bottom,\n\t\t\t\t}),\n\t\t\t\toperations: { 'reorder-before': 'available', 'reorder-after': 'available' },\n\t\t\t},\n\t\t),\n\t);\n\n\t{\n\t\tconst expected: Instruction = {\n\t\t\toperation: 'reorder-after',\n\t\t\tblocked: false,\n\t\t\taxis: 'vertical',\n\t\t};\n\t\texpect(second).toEqual(expected);\n\t\t// second is a new object\n\t\texpect(second).not.toBe(first);\n\t}\n});\n\nit('should memoize blocked instructions', () => {\n\tconst expected: Instruction = {\n\t\toperation: 'reorder-before',\n\t\tblocked: true,\n\t\taxis: 'vertical',\n\t};\n\tconst operations = { 'reorder-before': 'blocked', 'reorder-after': 'available' } as const;\n\n\tconst first = extractInstruction(\n\t\tattachInstruction(\n\t\t\t{},\n\t\t\t{\n\t\t\t\telement,\n\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\tclientX: centerX,\n\t\t\t\t\tclientY: rect.top,\n\t\t\t\t}),\n\t\t\t\toperations,\n\t\t\t},\n\t\t),\n\t);\n\n\texpect(first).toEqual(expected);\n\n\tconst second = extractInstruction(\n\t\tattachInstruction(\n\t\t\t{},\n\t\t\t{\n\t\t\t\telement,\n\t\t\t\t// still in the top zone\n\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\tclientX: centerX,\n\t\t\t\t\tclientY: rect.top + 1,\n\t\t\t\t}),\n\t\t\t\toperations,\n\t\t\t},\n\t\t),\n\t);\n\n\texpect(second).toEqual(expected);\n\t// expecting reference to match\n\texpect(first).toBe(second);\n\n\tconst third = extractInstruction(\n\t\tattachInstruction(\n\t\t\t{},\n\t\t\t{\n\t\t\t\telement,\n\t\t\t\t// still in the top zone\n\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\tclientX: centerX,\n\t\t\t\t\tclientY: rect.top + 2,\n\t\t\t\t}),\n\t\t\t\toperations,\n\t\t\t},\n\t\t),\n\t);\n\n\texpect(third).toEqual(expected);\n\t// expecting reference to match\n\texpect(first).toBe(third);\n});\n\nit('should return a new instruction when an operation becomes blocked', () => {\n\tconst first = extractInstruction(\n\t\tattachInstruction(\n\t\t\t{},\n\t\t\t{\n\t\t\t\telement,\n\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\tclientX: centerX,\n\t\t\t\t\tclientY: rect.top,\n\t\t\t\t}),\n\t\t\t\toperations: { 'reorder-before': 'available', 'reorder-after': 'available' },\n\t\t\t},\n\t\t),\n\t);\n\n\t{\n\t\tconst expected: Instruction = {\n\t\t\toperation: 'reorder-before',\n\t\t\tblocked: false,\n\t\t\taxis: 'vertical',\n\t\t};\n\t\texpect(first).toEqual(expected);\n\t}\n\n\tconst second = extractInstruction(\n\t\tattachInstruction(\n\t\t\t{},\n\t\t\t{\n\t\t\t\telement,\n\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\tclientX: centerX,\n\t\t\t\t\tclientY: rect.top,\n\t\t\t\t}),\n\t\t\t\toperations: { 'reorder-before': 'blocked', 'reorder-after': 'available' },\n\t\t\t},\n\t\t),\n\t);\n\n\t{\n\t\tconst expected: Instruction = {\n\t\t\toperation: 'reorder-before',\n\t\t\tblocked: true,\n\t\t\taxis: 'vertical',\n\t\t};\n\t\texpect(second).toEqual(expected);\n\t\t// second is a new object\n\t\texpect(second).not.toBe(first);\n\t}\n});\n\nit('should return a new instruction if the axis changes', () => {\n\tconst topLeft = getDefaultInput({\n\t\tclientX: rect.left,\n\t\tclientY: rect.top,\n\t});\n\tconst first = extractInstruction(\n\t\tattachInstruction(\n\t\t\t{},\n\t\t\t{\n\t\t\t\telement,\n\t\t\t\tinput: topLeft,\n\t\t\t\taxis: 'vertical',\n\t\t\t\toperations: { 'reorder-before': 'available', 'reorder-after': 'available' },\n\t\t\t},\n\t\t),\n\t);\n\n\t{\n\t\tconst expected: Instruction = {\n\t\t\toperation: 'reorder-before',\n\t\t\tblocked: false,\n\t\t\taxis: 'vertical',\n\t\t};\n\t\texpect(first).toEqual(expected);\n\t}\n\n\tconst second = extractInstruction(\n\t\tattachInstruction(\n\t\t\t{},\n\t\t\t{\n\t\t\t\telement,\n\t\t\t\tinput: topLeft,\n\t\t\t\taxis: 'horizontal',\n\t\t\t\toperations: { 'reorder-before': 'available', 'reorder-after': 'available' },\n\t\t\t},\n\t\t),\n\t);\n\n\t{\n\t\tconst expected: Instruction = {\n\t\t\toperation: 'reorder-before',\n\t\t\tblocked: false,\n\t\t\taxis: 'horizontal',\n\t\t};\n\t\texpect(second).toEqual(expected);\n\t\t// second is a new object\n\t\texpect(second).not.toBe(first);\n\t}\n});\n"
  },
  {
    "path": "packages/hitbox/__tests__/unit/list-item.spec.ts",
    "content": "import {\n\tattachInstruction,\n\textractInstruction,\n\ttype Instruction,\n\ttype Operation,\n} from '../../src/list-item';\n\nimport { between, getDefaultInput, getElements, getRect } from './_util';\n\ntype TOperationArgs = Parameters<typeof attachInstruction>[1]['operations'];\n\nconst rect = getRect({\n\ttop: 10,\n\tleft: 10,\n\tright: 100,\n\tbottom: 100,\n});\n\nconst centerY = between(rect.top, rect.bottom);\nconst centerX = between(rect.left, rect.right);\n\nconst axis = ['horizontal', 'vertical'] as const;\n\ntype Axis = (typeof axis)[number];\n\nconst verticalAxis = {\n\tstart: 'top',\n\tend: 'bottom',\n\tmainAxisPoint: 'clientY',\n\tcrossAxisPoint: 'clientX',\n\tsize: 'height',\n\tcrossAxisCenter: centerX,\n} as const;\nconst horizontalAxis = {\n\tstart: 'left',\n\tend: 'right',\n\tmainAxisPoint: 'clientX',\n\tcrossAxisPoint: 'clientY',\n\tsize: 'width',\n\tcrossAxisCenter: centerY,\n} as const;\n\nfunction getInputs(axis: Axis) {\n\tconst lookup = axis === 'horizontal' ? horizontalAxis : verticalAxis;\n\tconst quarterOfSize = rect[lookup.size] / 4;\n\tconst threeQuartersOfSize = quarterOfSize * 3;\n\n\tconst inputs = {\n\t\t// Adding aboveTop to validate what happens when the\n\t\t// the input is outside of the elements bounds\n\t\tbeforeStart: getDefaultInput({\n\t\t\t[lookup.mainAxisPoint]: rect[lookup.start] - 1,\n\t\t\t[lookup.crossAxisPoint]: lookup.crossAxisCenter,\n\t\t}),\n\t\tstart: getDefaultInput({\n\t\t\t[lookup.mainAxisPoint]: rect[lookup.start],\n\t\t\t[lookup.crossAxisPoint]: lookup.crossAxisCenter,\n\t\t}),\n\t\tjustBeforeOneQuarter: getDefaultInput({\n\t\t\t[lookup.mainAxisPoint]: rect[lookup.start] + quarterOfSize - 1,\n\t\t\t[lookup.crossAxisPoint]: lookup.crossAxisCenter,\n\t\t}),\n\t\tonOneQuarter: getDefaultInput({\n\t\t\t[lookup.mainAxisPoint]: rect[lookup.start] + quarterOfSize,\n\t\t\t[lookup.crossAxisPoint]: lookup.crossAxisCenter,\n\t\t}),\n\t\tjustAfterOneQuarter: getDefaultInput({\n\t\t\t[lookup.mainAxisPoint]: rect[lookup.start] + quarterOfSize + 1,\n\t\t\t[lookup.crossAxisPoint]: lookup.crossAxisCenter,\n\t\t}),\n\t\tjustBeforeCenter: getDefaultInput({\n\t\t\t[lookup.mainAxisPoint]: between(rect[lookup.start], rect[lookup.end]) - 1,\n\t\t\t[lookup.crossAxisPoint]: lookup.crossAxisCenter,\n\t\t}),\n\t\tcenter: getDefaultInput({\n\t\t\t[lookup.mainAxisPoint]: between(rect[lookup.start], rect[lookup.end]),\n\t\t\t[lookup.crossAxisPoint]: lookup.crossAxisCenter,\n\t\t}),\n\t\tjustAfterCenter: getDefaultInput({\n\t\t\t[lookup.mainAxisPoint]: between(rect[lookup.start], rect[lookup.end]) + 1,\n\t\t\t[lookup.crossAxisPoint]: lookup.crossAxisCenter,\n\t\t}),\n\t\tjustBeforeThreeQuarters: getDefaultInput({\n\t\t\t[lookup.mainAxisPoint]: rect[lookup.start] + threeQuartersOfSize - 1,\n\t\t\t[lookup.crossAxisPoint]: lookup.crossAxisCenter,\n\t\t}),\n\t\tonThreeQuarters: getDefaultInput({\n\t\t\t[lookup.mainAxisPoint]: rect[lookup.start] + threeQuartersOfSize,\n\t\t\t[lookup.crossAxisPoint]: lookup.crossAxisCenter,\n\t\t}),\n\t\tjustAfterThreeQuarters: getDefaultInput({\n\t\t\t[lookup.mainAxisPoint]: rect[lookup.start] + threeQuartersOfSize + 1,\n\t\t\t[lookup.crossAxisPoint]: lookup.crossAxisCenter,\n\t\t}),\n\t\tend: getDefaultInput({\n\t\t\t[lookup.mainAxisPoint]: rect[lookup.end],\n\t\t\t[lookup.crossAxisPoint]: lookup.crossAxisCenter,\n\t\t}),\n\t\t// Adding afterEnd to validate what happens when the\n\t\t// the input is outside of the elements bounds\n\t\tafterEnd: getDefaultInput({\n\t\t\t[lookup.mainAxisPoint]: rect[lookup.end] + 1,\n\t\t\t[lookup.crossAxisPoint]: lookup.crossAxisCenter,\n\t\t}),\n\t};\n\treturn inputs;\n}\n\nconst presetOperations = {\n\treorderBeforeOnly: { 'reorder-before': 'available' },\n\treorderAfterOnly: { 'reorder-after': 'available' },\n\tcombineOnly: { combine: 'available' },\n\treorder: { 'reorder-before': 'available', 'reorder-after': 'available' },\n\tall: { 'reorder-before': 'available', 'reorder-after': 'available', combine: 'available' },\n\tcombineAndReorderBefore: { 'reorder-before': 'available', combine: 'available' },\n\tcombineAndReorderAfter: { 'reorder-after': 'available', combine: 'available' },\n\tnone: {},\n} satisfies { [TKey: string]: TOperationArgs };\n\nfunction block(args: TOperationArgs): TOperationArgs {\n\treturn Object.keys(args).reduce((acc, key) => {\n\t\tacc[key as Operation] = 'blocked';\n\t\treturn acc;\n\t}, {} as TOperationArgs);\n}\n\nconst presetOperationsBlocked = {\n\treorderBeforeOnly: block(presetOperations.reorderBeforeOnly),\n\treorderAfterOnly: block(presetOperations.reorderAfterOnly),\n\tcombineOnly: block(presetOperations.combineOnly),\n\treorder: block(presetOperations.reorder),\n\tall: block(presetOperations.all),\n\tcombineAndReorderBefore: block(presetOperations.combineAndReorderBefore),\n\tcombineAndReorderAfter: block(presetOperations.combineAndReorderAfter),\n\t// Not adding \"blocked\" as that would make the hitbox available for that operation\n\tnone: {},\n} satisfies { [TKey in keyof typeof presetOperations]: TOperationArgs };\n\ntype TExpectationMap = {\n\t[TOperationPresetKey in keyof typeof presetOperations]: {\n\t\t[TInputPresetKey in keyof ReturnType<typeof getInputs>]: Operation | null;\n\t};\n};\n\n// I made a big map so we know we have covered every use case\nconst expectations: TExpectationMap = {\n\treorderBeforeOnly: {\n\t\tbeforeStart: 'reorder-before',\n\t\tstart: 'reorder-before',\n\t\tjustBeforeOneQuarter: 'reorder-before',\n\t\tonOneQuarter: 'reorder-before',\n\t\tjustAfterOneQuarter: 'reorder-before',\n\t\tjustBeforeCenter: 'reorder-before',\n\t\tcenter: 'reorder-before',\n\t\tjustAfterCenter: 'reorder-before',\n\t\tjustBeforeThreeQuarters: 'reorder-before',\n\t\tonThreeQuarters: 'reorder-before',\n\t\tjustAfterThreeQuarters: 'reorder-before',\n\t\tend: 'reorder-before',\n\t\tafterEnd: 'reorder-before',\n\t},\n\tcombineOnly: {\n\t\tbeforeStart: 'combine',\n\t\tstart: 'combine',\n\t\tjustBeforeOneQuarter: 'combine',\n\t\tonOneQuarter: 'combine',\n\t\tjustAfterOneQuarter: 'combine',\n\t\tjustBeforeCenter: 'combine',\n\t\tcenter: 'combine',\n\t\tjustAfterCenter: 'combine',\n\t\tjustBeforeThreeQuarters: 'combine',\n\t\tonThreeQuarters: 'combine',\n\t\tjustAfterThreeQuarters: 'combine',\n\t\tend: 'combine',\n\t\tafterEnd: 'combine',\n\t},\n\treorderAfterOnly: {\n\t\tbeforeStart: 'reorder-after',\n\t\tstart: 'reorder-after',\n\t\tjustBeforeOneQuarter: 'reorder-after',\n\t\tonOneQuarter: 'reorder-after',\n\t\tjustAfterOneQuarter: 'reorder-after',\n\t\tjustBeforeCenter: 'reorder-after',\n\t\tcenter: 'reorder-after',\n\t\tjustAfterCenter: 'reorder-after',\n\t\tjustBeforeThreeQuarters: 'reorder-after',\n\t\tonThreeQuarters: 'reorder-after',\n\t\tjustAfterThreeQuarters: 'reorder-after',\n\t\tend: 'reorder-after',\n\t\tafterEnd: 'reorder-after',\n\t},\n\treorder: {\n\t\tbeforeStart: 'reorder-before',\n\t\tstart: 'reorder-before',\n\t\tjustBeforeOneQuarter: 'reorder-before',\n\t\tonOneQuarter: 'reorder-before',\n\t\tjustAfterOneQuarter: 'reorder-before',\n\t\tjustBeforeCenter: 'reorder-before',\n\t\tcenter: 'reorder-after', // Giving a slight preference to reordering forward\n\t\tjustAfterCenter: 'reorder-after',\n\t\tjustBeforeThreeQuarters: 'reorder-after',\n\t\tonThreeQuarters: 'reorder-after',\n\t\tjustAfterThreeQuarters: 'reorder-after',\n\t\tend: 'reorder-after',\n\t\tafterEnd: 'reorder-after',\n\t},\n\tall: {\n\t\tbeforeStart: 'reorder-before',\n\t\tstart: 'reorder-before',\n\t\tjustBeforeOneQuarter: 'reorder-before',\n\t\tonOneQuarter: 'reorder-before', // Giving a slight preference to reordering\n\t\tjustAfterOneQuarter: 'combine',\n\t\tjustBeforeCenter: 'combine',\n\t\tcenter: 'combine',\n\t\tjustAfterCenter: 'combine',\n\t\tjustBeforeThreeQuarters: 'combine',\n\t\tonThreeQuarters: 'reorder-after', // Giving a slight preference to reordering\n\t\tjustAfterThreeQuarters: 'reorder-after',\n\t\tend: 'reorder-after',\n\t\tafterEnd: 'reorder-after',\n\t},\n\tcombineAndReorderBefore: {\n\t\tbeforeStart: 'reorder-before',\n\t\tstart: 'reorder-before',\n\t\tjustBeforeOneQuarter: 'reorder-before',\n\t\tonOneQuarter: 'reorder-before', // Giving a slight preference to reordering\n\t\tjustAfterOneQuarter: 'combine',\n\t\tjustBeforeCenter: 'combine',\n\t\tcenter: 'combine',\n\t\tjustAfterCenter: 'combine',\n\t\tjustBeforeThreeQuarters: 'combine',\n\t\tonThreeQuarters: 'combine',\n\t\tjustAfterThreeQuarters: 'combine',\n\t\tend: 'combine',\n\t\tafterEnd: 'combine',\n\t},\n\tcombineAndReorderAfter: {\n\t\tbeforeStart: 'combine',\n\t\tstart: 'combine',\n\t\tjustBeforeOneQuarter: 'combine',\n\t\tonOneQuarter: 'combine',\n\t\tjustAfterOneQuarter: 'combine',\n\t\tjustBeforeCenter: 'combine',\n\t\tcenter: 'combine',\n\t\tjustAfterCenter: 'combine',\n\t\tjustBeforeThreeQuarters: 'combine',\n\t\tonThreeQuarters: 'reorder-after', // Giving a slight preference to reordering\n\t\tjustAfterThreeQuarters: 'reorder-after',\n\t\tend: 'reorder-after',\n\t\tafterEnd: 'reorder-after',\n\t},\n\tnone: {\n\t\tbeforeStart: null,\n\t\tstart: null,\n\t\tjustBeforeOneQuarter: null,\n\t\tonOneQuarter: null,\n\t\tjustAfterOneQuarter: null,\n\t\tjustBeforeCenter: null,\n\t\tcenter: null,\n\t\tjustAfterCenter: null,\n\t\tjustBeforeThreeQuarters: null,\n\t\tonThreeQuarters: null,\n\t\tjustAfterThreeQuarters: null,\n\t\tend: null,\n\t\tafterEnd: null,\n\t},\n};\n\naxis.forEach((axis) => {\n\tdescribe(`axis: ${axis}`, () => {\n\t\tconst presetInputs = getInputs(axis);\n\t\tconst inputPresetKeys = Object.keys(presetInputs) as (keyof typeof presetInputs)[];\n\t\tconst operationPresetKeys = Object.keys(presetOperations) as (keyof typeof presetOperations)[];\n\n\t\toperationPresetKeys.forEach((operationPresetKey) => {\n\t\t\tdescribe(`operation: ${operationPresetKey}`, () => {\n\t\t\t\tinputPresetKeys.forEach((inputPresetKey) => {\n\t\t\t\t\ttest(`input:${inputPresetKey}`, () => {\n\t\t\t\t\t\tconst [element] = getElements();\n\t\t\t\t\t\telement.getBoundingClientRect = () => rect;\n\n\t\t\t\t\t\tconst result = extractInstruction(\n\t\t\t\t\t\t\tattachInstruction(\n\t\t\t\t\t\t\t\t{},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\t\t\taxis,\n\t\t\t\t\t\t\t\t\tinput: presetInputs[inputPresetKey],\n\t\t\t\t\t\t\t\t\toperations: presetOperations[operationPresetKey],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tconst expected = expectations[operationPresetKey][inputPresetKey];\n\n\t\t\t\t\t\t// result can be null if nothing is available or blocked;\n\t\t\t\t\t\tif (!result) {\n\t\t\t\t\t\t\texpect(result).toBe(expected);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\texpect(result.operation).toEqual(expected);\n\t\t\t\t\t\texpect(result.blocked).toBe(false);\n\t\t\t\t\t\texpect(result.axis).toBe(axis);\n\t\t\t\t\t});\n\n\t\t\t\t\t// This should have no impact on the result, but just checking\n\t\t\t\t\ttest(`input:${inputPresetKey} [other operations set to \"not-available\"]`, () => {\n\t\t\t\t\t\tconst [element] = getElements();\n\t\t\t\t\t\telement.getBoundingClientRect = () => rect;\n\n\t\t\t\t\t\tconst defaults: TOperationArgs = {\n\t\t\t\t\t\t\tcombine: 'not-available',\n\t\t\t\t\t\t\t'reorder-before': 'not-available',\n\t\t\t\t\t\t\t'reorder-after': 'not-available',\n\t\t\t\t\t\t};\n\t\t\t\t\t\tconst operations: TOperationArgs = {\n\t\t\t\t\t\t\t...defaults,\n\t\t\t\t\t\t\t...presetOperations[operationPresetKey],\n\t\t\t\t\t\t};\n\n\t\t\t\t\t\tconst result = extractInstruction(\n\t\t\t\t\t\t\tattachInstruction(\n\t\t\t\t\t\t\t\t{},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\t\t\taxis,\n\t\t\t\t\t\t\t\t\tinput: presetInputs[inputPresetKey],\n\t\t\t\t\t\t\t\t\toperations: operations,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\t\t\t\t\t\tconst expected = expectations[operationPresetKey][inputPresetKey];\n\n\t\t\t\t\t\t// result can be null if nothing is available or blocked;\n\t\t\t\t\t\tif (!result) {\n\t\t\t\t\t\t\texpect(result).toBe(expected);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\texpect(result.operation).toEqual(expected);\n\t\t\t\t\t\texpect(result.blocked).toBe(false);\n\t\t\t\t\t\texpect(result.axis).toBe(axis);\n\t\t\t\t\t});\n\n\t\t\t\t\t// Should be the same outcome as not blocked,\n\t\t\t\t\t// just checking that blocking does not impact the hitboxes.\n\t\t\t\t\ttest(`input:${inputPresetKey} [blocked]`, () => {\n\t\t\t\t\t\tconst [element] = getElements();\n\t\t\t\t\t\telement.getBoundingClientRect = () => rect;\n\n\t\t\t\t\t\tconst result: Instruction | null = extractInstruction(\n\t\t\t\t\t\t\tattachInstruction(\n\t\t\t\t\t\t\t\t{},\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\t\t\taxis,\n\t\t\t\t\t\t\t\t\tinput: presetInputs[inputPresetKey],\n\t\t\t\t\t\t\t\t\toperations: presetOperationsBlocked[operationPresetKey],\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tconst expected = expectations[operationPresetKey][inputPresetKey];\n\n\t\t\t\t\t\t// result can be null if nothing is available or blocked;\n\t\t\t\t\t\tif (!result) {\n\t\t\t\t\t\t\texpect(result).toEqual(expected);\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\texpect(result.operation).toEqual(expected);\n\t\t\t\t\t\texpect(result.blocked).toBe(true);\n\t\t\t\t\t\texpect(result.axis).toBe(axis);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\tit('should create no instruction when there are no operations', () => {\n\t\t\tconst [element] = getElements();\n\t\t\telement.getBoundingClientRect = () => rect;\n\n\t\t\tconst result = extractInstruction(\n\t\t\t\tattachInstruction(\n\t\t\t\t\t{},\n\t\t\t\t\t{\n\t\t\t\t\t\telement,\n\t\t\t\t\t\taxis,\n\t\t\t\t\t\tinput: presetInputs.center,\n\t\t\t\t\t\toperations: {},\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t);\n\n\t\t\texpect(result).toBe(null);\n\t\t});\n\n\t\tit('should create no instruction when there are no available operations', () => {\n\t\t\tconst [element] = getElements();\n\t\t\telement.getBoundingClientRect = () => rect;\n\n\t\t\tconst result = extractInstruction(\n\t\t\t\tattachInstruction(\n\t\t\t\t\t{},\n\t\t\t\t\t{\n\t\t\t\t\t\telement,\n\t\t\t\t\t\taxis,\n\t\t\t\t\t\tinput: presetInputs.center,\n\t\t\t\t\t\toperations: {\n\t\t\t\t\t\t\t'reorder-after': 'not-available',\n\t\t\t\t\t\t\t'reorder-before': 'not-available',\n\t\t\t\t\t\t\tcombine: 'not-available',\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t),\n\t\t\t);\n\n\t\t\texpect(result).toBe(null);\n\t\t});\n\n\t\tit('should not impact user data', () => {\n\t\t\tconst [element] = getElements();\n\t\t\telement.getBoundingClientRect = () => rect;\n\t\t\tconst data = { message: 'hello' };\n\n\t\t\tconst updated = attachInstruction(data, {\n\t\t\t\telement,\n\t\t\t\taxis,\n\t\t\t\tinput: getDefaultInput(),\n\t\t\t\toperations: { 'reorder-after': 'available' },\n\t\t\t});\n\n\t\t\texpect(updated.message).toEqual('hello');\n\t\t});\n\t});\n});\n"
  },
  {
    "path": "packages/hitbox/__tests__/unit/reorder-with-edge.spec.ts",
    "content": "import { reorderWithEdge } from '../../src/reorder-with-edge';\n\ntest('moving relative to self should do nothing', () => {\n\texpect(\n\t\treorderWithEdge({\n\t\t\tlist: ['A', 'B'],\n\t\t\tstartIndex: 0,\n\t\t\tindexOfTarget: 0,\n\t\t\tclosestEdgeOfTarget: 'right',\n\t\t\taxis: 'horizontal',\n\t\t}),\n\t).toEqual(['A', 'B']);\n\n\texpect(\n\t\treorderWithEdge({\n\t\t\tlist: ['A', 'B'],\n\t\t\tstartIndex: 0,\n\t\t\tindexOfTarget: 0,\n\t\t\tclosestEdgeOfTarget: 'left',\n\t\t\taxis: 'horizontal',\n\t\t}),\n\t).toEqual(['A', 'B']);\n\n\texpect(\n\t\treorderWithEdge({\n\t\t\tlist: ['A', 'B'],\n\t\t\tstartIndex: 1,\n\t\t\tindexOfTarget: 1,\n\t\t\tclosestEdgeOfTarget: 'right',\n\t\t\taxis: 'horizontal',\n\t\t}),\n\t).toEqual(['A', 'B']);\n\n\texpect(\n\t\treorderWithEdge({\n\t\t\tlist: ['A', 'B'],\n\t\t\tstartIndex: 1,\n\t\t\tindexOfTarget: 1,\n\t\t\tclosestEdgeOfTarget: 'left',\n\t\t\taxis: 'horizontal',\n\t\t}),\n\t).toEqual(['A', 'B']);\n});\n\ntest('moving forward', () => {\n\texpect(\n\t\treorderWithEdge({\n\t\t\tlist: ['A', 'B', 'C'],\n\t\t\t// move A to left of B\n\t\t\tstartIndex: 0,\n\t\t\tindexOfTarget: 1,\n\t\t\tclosestEdgeOfTarget: 'left',\n\t\t\taxis: 'horizontal',\n\t\t}),\n\t\t// results in no change\n\t).toEqual(['A', 'B', 'C']);\n\n\texpect(\n\t\treorderWithEdge({\n\t\t\tlist: ['A', 'B', 'C'],\n\t\t\t// move A to right of B\n\t\t\tstartIndex: 0,\n\t\t\tindexOfTarget: 1,\n\t\t\tclosestEdgeOfTarget: 'right',\n\t\t\taxis: 'horizontal',\n\t\t}),\n\t).toEqual(['B', 'A', 'C']);\n});\n\ntest('moving backwards', () => {\n\texpect(\n\t\treorderWithEdge({\n\t\t\tlist: ['A', 'B', 'C'],\n\t\t\t// move C to right of B\n\t\t\tstartIndex: 2,\n\t\t\tindexOfTarget: 1,\n\t\t\tclosestEdgeOfTarget: 'right',\n\t\t\taxis: 'horizontal',\n\t\t}),\n\t\t// results in no change\n\t).toEqual(['A', 'B', 'C']);\n\n\texpect(\n\t\treorderWithEdge({\n\t\t\tlist: ['A', 'B', 'C'],\n\t\t\t// move C to left of B\n\t\t\tstartIndex: 2,\n\t\t\tindexOfTarget: 1,\n\t\t\tclosestEdgeOfTarget: 'left',\n\t\t\taxis: 'horizontal',\n\t\t}),\n\t).toEqual(['A', 'C', 'B']);\n});\n"
  },
  {
    "path": "packages/hitbox/__tests__/unit/test-helpers.spec.ts",
    "content": "import { between, getElements } from './_util';\n\ntest('between()', () => {\n\texpect(between(3, 5)).toBe(4);\n\texpect(between(-3, -5)).toBe(-4);\n\texpect(between(0, 0)).toBe(0);\n\texpect(between(0, 10)).toBe(5);\n\texpect(between(-2, 2)).toBe(0);\n});\n\ntest('getElements()', () => {\n\tconst [first, second] = getElements();\n\texpect(first).toBeInstanceOf(HTMLElement);\n\texpect(second).toBeInstanceOf(HTMLElement);\n});\n"
  },
  {
    "path": "packages/hitbox/__tests__/unit/tree-item-memoization.spec.ts",
    "content": "import type { Input } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport { attachInstruction, extractInstruction, type Instruction } from '../../src/tree-item';\n\nimport { getDefaultInput, getElements, getRect } from './_util';\n\nconst rect = getRect({\n\ttop: 0,\n\tleft: 0,\n\tright: 100,\n\tbottom: 100,\n});\n\nconst [element] = getElements();\nelement.getBoundingClientRect = () => rect;\n\nit('should return the same instruction reference when the instruction has not changed', () => {\n\tconst expected: Instruction = {\n\t\ttype: 'reorder-above',\n\t\tcurrentLevel: 0,\n\t\tindentPerLevel: 20,\n\t};\n\n\tconst first = extractInstruction(\n\t\tattachInstruction(\n\t\t\t{},\n\t\t\t{\n\t\t\t\telement,\n\t\t\t\tmode: 'standard',\n\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\tclientX: rect.left,\n\t\t\t\t\tclientY: rect.top,\n\t\t\t\t}),\n\t\t\t\tcurrentLevel: 0,\n\t\t\t\tindentPerLevel: 20,\n\t\t\t},\n\t\t),\n\t);\n\n\texpect(first).toEqual(expected);\n\n\tconst second = extractInstruction(\n\t\tattachInstruction(\n\t\t\t{},\n\t\t\t{\n\t\t\t\telement,\n\t\t\t\tmode: 'standard',\n\t\t\t\t// change in input, but still in the 'standard' zone\n\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\tclientX: rect.left,\n\t\t\t\t\tclientY: rect.top + 1,\n\t\t\t\t}),\n\t\t\t\tcurrentLevel: 0,\n\t\t\t\tindentPerLevel: 20,\n\t\t\t},\n\t\t),\n\t);\n\n\texpect(second).toEqual(expected);\n\t// expecting reference to match\n\texpect(first).toBe(second);\n\n\t// mode is changing, but will still be in the 'reorder-above' hitzone\n\tconst third = extractInstruction(\n\t\tattachInstruction(\n\t\t\t{},\n\t\t\t{\n\t\t\t\telement,\n\t\t\t\tmode: 'expanded',\n\t\t\t\t// change in input, but still in the 'standard' zone\n\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\tclientX: rect.left,\n\t\t\t\t\tclientY: rect.top + 2,\n\t\t\t\t}),\n\t\t\t\tcurrentLevel: 0,\n\t\t\t\tindentPerLevel: 20,\n\t\t\t},\n\t\t),\n\t);\n\n\texpect(third).toEqual(expected);\n\t// expecting reference to match\n\texpect(first).toBe(third);\n});\n\nit('should return a new instruction when the instruction changes based on a hitzone change', () => {\n\tconst first = extractInstruction(\n\t\tattachInstruction(\n\t\t\t{},\n\t\t\t{\n\t\t\t\telement,\n\t\t\t\tmode: 'standard',\n\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\tclientY: rect.top,\n\t\t\t\t\tclientX: rect.left,\n\t\t\t\t}),\n\t\t\t\tcurrentLevel: 0,\n\t\t\t\tindentPerLevel: 20,\n\t\t\t},\n\t\t),\n\t);\n\n\t{\n\t\tconst expected: Instruction = {\n\t\t\ttype: 'reorder-above',\n\t\t\tcurrentLevel: 0,\n\t\t\tindentPerLevel: 20,\n\t\t};\n\t\texpect(first).toEqual(expected);\n\t}\n\n\tconst second = extractInstruction(\n\t\tattachInstruction(\n\t\t\t{},\n\t\t\t{\n\t\t\t\telement,\n\t\t\t\tmode: 'standard',\n\t\t\t\t// change in input, will be in 'reorder-bottom' zone\n\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\tclientY: rect.bottom,\n\t\t\t\t\tclientX: rect.left,\n\t\t\t\t}),\n\t\t\t\tcurrentLevel: 0,\n\t\t\t\tindentPerLevel: 20,\n\t\t\t},\n\t\t),\n\t);\n\n\t{\n\t\tconst expected: Instruction = {\n\t\t\ttype: 'reorder-below',\n\t\t\tcurrentLevel: 0,\n\t\t\tindentPerLevel: 20,\n\t\t};\n\t\texpect(second).toEqual(expected);\n\t\t// second is a new object\n\t\texpect(second).not.toBe(first);\n\t}\n});\n\nit('should return a new instruction if the indentPerLevel changes', () => {\n\tconst input: Input = getDefaultInput({\n\t\tclientY: rect.top,\n\t\tclientX: rect.left,\n\t});\n\tconst first = extractInstruction(\n\t\tattachInstruction(\n\t\t\t{},\n\t\t\t{\n\t\t\t\telement,\n\t\t\t\tmode: 'standard',\n\t\t\t\tinput,\n\t\t\t\tcurrentLevel: 0,\n\t\t\t\tindentPerLevel: 20,\n\t\t\t},\n\t\t),\n\t);\n\n\t{\n\t\tconst expected: Instruction = {\n\t\t\ttype: 'reorder-above',\n\t\t\tcurrentLevel: 0,\n\t\t\tindentPerLevel: 20,\n\t\t};\n\t\texpect(first).toEqual(expected);\n\t}\n\n\tconst second = extractInstruction(\n\t\tattachInstruction(\n\t\t\t{},\n\t\t\t{\n\t\t\t\telement,\n\t\t\t\tmode: 'standard',\n\t\t\t\t// no change in input\n\t\t\t\tinput,\n\t\t\t\tcurrentLevel: 0,\n\t\t\t\t// indent per level has changed\n\t\t\t\tindentPerLevel: 30,\n\t\t\t},\n\t\t),\n\t);\n\n\t{\n\t\tconst expected: Instruction = {\n\t\t\ttype: 'reorder-above',\n\t\t\tcurrentLevel: 0,\n\t\t\tindentPerLevel: 30,\n\t\t};\n\t\texpect(second).toEqual(expected);\n\t\t// second is a new object\n\t\texpect(second).not.toBe(first);\n\t}\n});\n\nit('should return a new instruction if the currentLevel changes', () => {\n\tconst input: Input = getDefaultInput({\n\t\tclientY: rect.top,\n\t\tclientX: rect.left,\n\t});\n\tconst first = extractInstruction(\n\t\tattachInstruction(\n\t\t\t{},\n\t\t\t{\n\t\t\t\telement,\n\t\t\t\tmode: 'standard',\n\t\t\t\tinput,\n\t\t\t\tcurrentLevel: 0,\n\t\t\t\tindentPerLevel: 20,\n\t\t\t},\n\t\t),\n\t);\n\n\t{\n\t\tconst expected: Instruction = {\n\t\t\ttype: 'reorder-above',\n\t\t\tcurrentLevel: 0,\n\t\t\tindentPerLevel: 20,\n\t\t};\n\t\texpect(first).toEqual(expected);\n\t}\n\n\tconst second = extractInstruction(\n\t\tattachInstruction(\n\t\t\t{},\n\t\t\t{\n\t\t\t\telement,\n\t\t\t\tmode: 'standard',\n\t\t\t\t// no change in input\n\t\t\t\tinput,\n\t\t\t\t// current level has changed\n\t\t\t\tcurrentLevel: 1,\n\t\t\t\tindentPerLevel: 20,\n\t\t\t},\n\t\t),\n\t);\n\n\t{\n\t\tconst expected: Instruction = {\n\t\t\ttype: 'reorder-above',\n\t\t\tcurrentLevel: 1,\n\t\t\tindentPerLevel: 20,\n\t\t};\n\t\texpect(second).toEqual(expected);\n\t\t// second is a new object\n\t\texpect(second).not.toBe(first);\n\t}\n});\n\nit('should return the same instruction reference when the instruction has not changed for blocked instructions', () => {\n\tconst first = extractInstruction(\n\t\tattachInstruction(\n\t\t\t{},\n\t\t\t{\n\t\t\t\telement,\n\t\t\t\tmode: 'standard',\n\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\tclientX: rect.left,\n\t\t\t\t\tclientY: rect.top,\n\t\t\t\t}),\n\t\t\t\tcurrentLevel: 0,\n\t\t\t\tindentPerLevel: 20,\n\t\t\t\tblock: ['reorder-above'],\n\t\t\t},\n\t\t),\n\t);\n\n\t{\n\t\tconst expected: Instruction = {\n\t\t\ttype: 'instruction-blocked',\n\t\t\tdesired: {\n\t\t\t\ttype: 'reorder-above',\n\t\t\t\tcurrentLevel: 0,\n\t\t\t\tindentPerLevel: 20,\n\t\t\t},\n\t\t};\n\t\texpect(first).toEqual(expected);\n\t}\n\n\tconst second = extractInstruction(\n\t\tattachInstruction(\n\t\t\t{},\n\t\t\t{\n\t\t\t\telement,\n\t\t\t\tmode: 'standard',\n\t\t\t\t// change in input, but still in the 'standard' zone\n\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\tclientX: rect.left,\n\t\t\t\t\tclientY: rect.top + 1,\n\t\t\t\t}),\n\t\t\t\tcurrentLevel: 0,\n\t\t\t\tindentPerLevel: 20,\n\t\t\t\tblock: ['reorder-above'],\n\t\t\t},\n\t\t),\n\t);\n\n\t{\n\t\tconst expected: Instruction = {\n\t\t\ttype: 'instruction-blocked',\n\t\t\tdesired: {\n\t\t\t\ttype: 'reorder-above',\n\t\t\t\tcurrentLevel: 0,\n\t\t\t\tindentPerLevel: 20,\n\t\t\t},\n\t\t};\n\t\texpect(first).toEqual(expected);\n\t\t// expecting reference to match\n\t\texpect(first).toBe(second);\n\t}\n\n\t// mode is changing, but will still be in the 'reorder-above' hitzone\n\tconst third = extractInstruction(\n\t\tattachInstruction(\n\t\t\t{},\n\t\t\t{\n\t\t\t\telement,\n\t\t\t\tmode: 'expanded',\n\t\t\t\t// change in input, but still in the 'standard' zone\n\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\tclientX: rect.left,\n\t\t\t\t\tclientY: rect.top + 2,\n\t\t\t\t}),\n\t\t\t\tcurrentLevel: 0,\n\t\t\t\tindentPerLevel: 20,\n\t\t\t\tblock: ['reorder-above'],\n\t\t\t},\n\t\t),\n\t);\n\n\t{\n\t\tconst expected: Instruction = {\n\t\t\ttype: 'instruction-blocked',\n\t\t\tdesired: {\n\t\t\t\ttype: 'reorder-above',\n\t\t\t\tcurrentLevel: 0,\n\t\t\t\tindentPerLevel: 20,\n\t\t\t},\n\t\t};\n\t\texpect(first).toEqual(expected);\n\t\t// expecting reference to match\n\t\texpect(first).toBe(third);\n\t}\n});\n\nit('should return a new instruction reference if it is no longer blocked', () => {\n\tconst desired: Instruction = {\n\t\ttype: 'reorder-above',\n\t\tcurrentLevel: 0,\n\t\tindentPerLevel: 20,\n\t};\n\tconst first = extractInstruction(\n\t\tattachInstruction(\n\t\t\t{},\n\t\t\t{\n\t\t\t\telement,\n\t\t\t\tmode: 'standard',\n\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\tclientX: rect.left,\n\t\t\t\t\tclientY: rect.top,\n\t\t\t\t}),\n\t\t\t\tcurrentLevel: 0,\n\t\t\t\tindentPerLevel: 20,\n\t\t\t\tblock: ['reorder-above'],\n\t\t\t},\n\t\t),\n\t);\n\n\t{\n\t\tconst expected: Instruction = {\n\t\t\ttype: 'instruction-blocked',\n\t\t\tdesired: desired,\n\t\t};\n\t\texpect(first).toEqual(expected);\n\t}\n\n\tconst second = extractInstruction(\n\t\tattachInstruction(\n\t\t\t{},\n\t\t\t{\n\t\t\t\telement,\n\t\t\t\tmode: 'standard',\n\t\t\t\t// change in input, but still in the 'standard' zone\n\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\tclientX: rect.left,\n\t\t\t\t\tclientY: rect.top,\n\t\t\t\t}),\n\t\t\t\tcurrentLevel: 0,\n\t\t\t\tindentPerLevel: 20,\n\t\t\t\t// block gone\n\t\t\t},\n\t\t),\n\t);\n\n\texpect(second).toEqual(desired);\n\t// expecting reference not to match\n\texpect(first).not.toBe(second);\n\n\t// checking that memoization is now kicking in\n\tconst third = extractInstruction(\n\t\tattachInstruction(\n\t\t\t{},\n\t\t\t{\n\t\t\t\telement,\n\t\t\t\tmode: 'standard',\n\t\t\t\t// change in input, but still in the 'standard' zone\n\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\tclientX: rect.left,\n\t\t\t\t\tclientY: rect.top,\n\t\t\t\t}),\n\t\t\t\tcurrentLevel: 0,\n\t\t\t\tindentPerLevel: 20,\n\t\t\t\t// block gone\n\t\t\t},\n\t\t),\n\t);\n\n\texpect(third).toEqual(desired);\n\t// expecting reference to match\n\texpect(second).toBe(third);\n});\n\ndescribe('reparenting', () => {\n\tit('should return the same instruction reference when the instruction has not changed', () => {\n\t\tconst indentPerLevel = 20;\n\t\tconst currentLevel = 2;\n\t\tconst desiredLevel = 1;\n\t\tconst expected: Instruction = {\n\t\t\ttype: 'reparent',\n\t\t\tcurrentLevel,\n\t\t\tindentPerLevel,\n\t\t\tdesiredLevel,\n\t\t};\n\n\t\tconst first = extractInstruction(\n\t\t\tattachInstruction(\n\t\t\t\t{},\n\t\t\t\t{\n\t\t\t\t\telement,\n\t\t\t\t\tmode: 'last-in-group',\n\t\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\t\tclientY: rect.bottom,\n\t\t\t\t\t\tclientX: rect.left + indentPerLevel * desiredLevel,\n\t\t\t\t\t}),\n\t\t\t\t\tcurrentLevel: currentLevel,\n\t\t\t\t\tindentPerLevel: indentPerLevel,\n\t\t\t\t},\n\t\t\t),\n\t\t);\n\n\t\texpect(first).toEqual(expected);\n\n\t\tconst second = extractInstruction(\n\t\t\tattachInstruction(\n\t\t\t\t{},\n\t\t\t\t{\n\t\t\t\t\telement,\n\t\t\t\t\tmode: 'last-in-group',\n\t\t\t\t\t// change in input, but still in the same zone\n\t\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\t\tclientY: rect.bottom,\n\t\t\t\t\t\tclientX: rect.left + indentPerLevel * desiredLevel + 1,\n\t\t\t\t\t}),\n\t\t\t\t\tcurrentLevel: currentLevel,\n\t\t\t\t\tindentPerLevel: indentPerLevel,\n\t\t\t\t},\n\t\t\t),\n\t\t);\n\n\t\texpect(second).toEqual(expected);\n\t\t// expecting reference to match\n\t\texpect(first).toBe(second);\n\t});\n\n\tit('should return a new instruction if the desiredLevel changes', () => {\n\t\tconst indentPerLevel = 20;\n\t\tconst currentLevel = 2;\n\t\tconst firstDesiredLevel = 1;\n\t\tconst secondDesiredLevel = 0;\n\t\tconst first = extractInstruction(\n\t\t\tattachInstruction(\n\t\t\t\t{},\n\t\t\t\t{\n\t\t\t\t\telement,\n\t\t\t\t\tmode: 'last-in-group',\n\t\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\t\tclientY: rect.bottom,\n\t\t\t\t\t\tclientX: rect.left + indentPerLevel * firstDesiredLevel,\n\t\t\t\t\t}),\n\t\t\t\t\tcurrentLevel,\n\t\t\t\t\tindentPerLevel,\n\t\t\t\t},\n\t\t\t),\n\t\t);\n\n\t\t{\n\t\t\tconst expected: Instruction = {\n\t\t\t\ttype: 'reparent',\n\t\t\t\tdesiredLevel: firstDesiredLevel,\n\t\t\t\tcurrentLevel,\n\t\t\t\tindentPerLevel,\n\t\t\t};\n\t\t\texpect(first).toEqual(expected);\n\t\t}\n\n\t\tconst second = extractInstruction(\n\t\t\tattachInstruction(\n\t\t\t\t{},\n\t\t\t\t{\n\t\t\t\t\telement,\n\t\t\t\t\tmode: 'last-in-group',\n\t\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\t\tclientY: rect.bottom,\n\t\t\t\t\t\tclientX: rect.left + indentPerLevel * secondDesiredLevel,\n\t\t\t\t\t}),\n\t\t\t\t\tcurrentLevel,\n\t\t\t\t\tindentPerLevel,\n\t\t\t\t},\n\t\t\t),\n\t\t);\n\n\t\t{\n\t\t\tconst expected: Instruction = {\n\t\t\t\ttype: 'reparent',\n\t\t\t\tdesiredLevel: secondDesiredLevel,\n\t\t\t\tcurrentLevel,\n\t\t\t\tindentPerLevel,\n\t\t\t};\n\t\t\texpect(second).toEqual(expected);\n\t\t\t// second is a new object\n\t\t\texpect(second).not.toBe(first);\n\t\t}\n\t});\n\n\tit('should return the same instruction reference for blocked reparent instructions', () => {\n\t\tconst indentPerLevel = 20;\n\t\tconst currentLevel = 2;\n\t\tconst desiredLevel = 1;\n\t\tconst expected: Instruction = {\n\t\t\ttype: 'instruction-blocked',\n\t\t\tdesired: {\n\t\t\t\ttype: 'reparent',\n\t\t\t\tcurrentLevel,\n\t\t\t\tindentPerLevel,\n\t\t\t\tdesiredLevel: desiredLevel,\n\t\t\t},\n\t\t};\n\t\tconst first = extractInstruction(\n\t\t\tattachInstruction(\n\t\t\t\t{},\n\t\t\t\t{\n\t\t\t\t\telement,\n\t\t\t\t\tmode: 'last-in-group',\n\t\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\t\tclientX: rect.left + indentPerLevel * desiredLevel,\n\t\t\t\t\t\tclientY: rect.bottom,\n\t\t\t\t\t}),\n\t\t\t\t\tcurrentLevel,\n\t\t\t\t\tindentPerLevel,\n\t\t\t\t\tblock: ['reparent'],\n\t\t\t\t},\n\t\t\t),\n\t\t);\n\n\t\texpect(first).toEqual(expected);\n\n\t\tconst second = extractInstruction(\n\t\t\tattachInstruction(\n\t\t\t\t{},\n\t\t\t\t{\n\t\t\t\t\telement,\n\t\t\t\t\tmode: 'last-in-group',\n\t\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\t\tclientX: rect.left + indentPerLevel * desiredLevel + 1,\n\t\t\t\t\t\tclientY: rect.bottom,\n\t\t\t\t\t}),\n\t\t\t\t\tcurrentLevel,\n\t\t\t\t\tindentPerLevel,\n\t\t\t\t\tblock: ['reparent'],\n\t\t\t\t},\n\t\t\t),\n\t\t);\n\n\t\texpect(second).toEqual(expected);\n\t\t// same reference\n\t\texpect(first).toBe(second);\n\t});\n});\n"
  },
  {
    "path": "packages/hitbox/__tests__/unit/tree-item.spec.ts",
    "content": "import type { Position } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport {\n\tattachInstruction,\n\textractInstruction,\n\ttype Instruction,\n\ttype ItemMode,\n} from '../../src/tree-item';\n\nimport { getDefaultInput, getElements, getRect } from './_util';\n\ntype Scenario = {\n\tdescription: string;\n\tmode: ItemMode;\n\tblock?: Instruction['type'][];\n\texpected: Instruction;\n\thitbox: DOMRect;\n\tcurrentLevel: number;\n\tindentPerLevel: number;\n\tonly?: boolean;\n};\n\nconst rect = getRect({\n\ttop: 0,\n\tleft: 0,\n\tright: 100,\n\tbottom: 100,\n});\n\nconst quarterOfHeight = rect.height / 4;\n\nconst baseData = {\n\tcurrentLevel: 0,\n\tindentPerLevel: 20,\n};\n\ntype Point = Position & { label: string };\n\nfunction getPoints(rect: DOMRect): Point[] {\n\treturn [\n\t\t{ label: 'top left', x: rect.left, y: rect.top },\n\t\t{ label: 'top right', x: rect.right, y: rect.top },\n\t\t{ label: 'bottom right', x: rect.right, y: rect.bottom },\n\t\t{ label: 'bottom left', x: rect.left, y: rect.bottom },\n\t\t{\n\t\t\tlabel: 'center',\n\t\t\tx: rect.left + rect.width / 2,\n\t\t\ty: rect.top + rect.height / 2,\n\t\t},\n\t];\n}\n\nconst scenarios: Scenario[] = [\n\t{\n\t\tmode: 'standard',\n\t\tdescription: 'in top quarter should reorder-above',\n\t\texpected: { type: 'reorder-above', ...baseData },\n\t\thitbox: getRect({\n\t\t\ttop: rect.top,\n\t\t\tleft: rect.left,\n\t\t\tright: rect.right,\n\t\t\tbottom: rect.top + quarterOfHeight,\n\t\t}),\n\t\t...baseData,\n\t},\n\t{\n\t\tmode: 'standard',\n\t\tdescription: 'in middle should make-child',\n\t\texpected: { type: 'make-child', ...baseData },\n\t\t// 'On the line' is given preference to reordering operations\n\t\thitbox: getRect({\n\t\t\ttop: rect.top + quarterOfHeight + 1,\n\t\t\tleft: rect.left,\n\t\t\tright: rect.right,\n\t\t\tbottom: rect.bottom - quarterOfHeight - 1,\n\t\t}),\n\t\t...baseData,\n\t},\n\t{\n\t\tmode: 'standard',\n\t\tdescription: 'in bottom quarter should reorder-below',\n\t\texpected: { type: 'reorder-below', ...baseData },\n\t\thitbox: getRect({\n\t\t\ttop: rect.bottom - quarterOfHeight,\n\t\t\tleft: rect.left,\n\t\t\tright: rect.right,\n\t\t\tbottom: rect.bottom,\n\t\t}),\n\t\t...baseData,\n\t},\n\t{\n\t\tmode: 'expanded',\n\t\tdescription: 'in top 1/4 should reorder above (same as \"standard\")',\n\t\texpected: { type: 'reorder-above', ...baseData },\n\t\thitbox: getRect({\n\t\t\ttop: rect.top,\n\t\t\tleft: rect.left,\n\t\t\tright: rect.right,\n\t\t\t// we are ensuring the whole top 1/4 is the hit zone to match \"standard\" items\n\t\t\tbottom: rect.top + quarterOfHeight,\n\t\t}),\n\t\t...baseData,\n\t},\n\t{\n\t\tmode: 'expanded',\n\t\tdescription: 'in bottom 3/4 should make-child',\n\t\texpected: { type: 'make-child', ...baseData },\n\t\thitbox: getRect({\n\t\t\ttop: rect.top + quarterOfHeight + 1,\n\t\t\tleft: rect.left,\n\t\t\tright: rect.right,\n\t\t\tbottom: rect.bottom,\n\t\t}),\n\t\t...baseData,\n\t},\n\t{\n\t\tmode: 'last-in-group',\n\t\tdescription: '[visible item] in top quarter should reorder-above',\n\t\texpected: { type: 'reorder-above', indentPerLevel: 20, currentLevel: 2 },\n\t\tindentPerLevel: 20,\n\t\tcurrentLevel: 2,\n\t\thitbox: getRect({\n\t\t\ttop: rect.top,\n\t\t\tleft: rect.left + 20 * 2,\n\t\t\tright: rect.right,\n\t\t\tbottom: rect.top + quarterOfHeight,\n\t\t}),\n\t},\n\t{\n\t\tmode: 'last-in-group',\n\t\tdescription: '[visible item] in middle should make-child',\n\t\texpected: { type: 'make-child', indentPerLevel: 20, currentLevel: 2 },\n\t\tindentPerLevel: 20,\n\t\tcurrentLevel: 2,\n\t\thitbox: getRect({\n\t\t\ttop: rect.top + quarterOfHeight + 1,\n\t\t\tleft: rect.left + 20 * 2,\n\t\t\tright: rect.right,\n\t\t\tbottom: rect.bottom - quarterOfHeight - 1,\n\t\t}),\n\t},\n\t{\n\t\tmode: 'last-in-group',\n\t\tdescription: '[visible item] in bottom quarter should reorder-below',\n\t\texpected: { type: 'reorder-below', indentPerLevel: 20, currentLevel: 2 },\n\t\tindentPerLevel: 20,\n\t\tcurrentLevel: 2,\n\t\thitbox: getRect({\n\t\t\ttop: rect.bottom - quarterOfHeight,\n\t\t\tleft: rect.left + 20 * 2,\n\t\t\tright: rect.right,\n\t\t\tbottom: rect.bottom,\n\t\t}),\n\t},\n\t{\n\t\tmode: 'last-in-group',\n\t\tdescription: '[invisible item] in top half should reorder-above',\n\t\texpected: { type: 'reorder-above', indentPerLevel: 20, currentLevel: 2 },\n\t\tindentPerLevel: 20,\n\t\tcurrentLevel: 2,\n\t\thitbox: getRect({\n\t\t\ttop: rect.top,\n\t\t\tleft: rect.left,\n\t\t\t// On the edge = in the 'visible' part of the item\n\t\t\tright: rect.left + 20 * 2 - 1,\n\t\t\t// Giving 1px preference to the 'reparent' actions\n\t\t\tbottom: rect.top + rect.height / 2 - 1,\n\t\t}),\n\t},\n\tcreatePullBackScenario({\n\t\tcurrentLevel: 2,\n\t\tdesiredLevel: 1,\n\t\tindentPerLevel: 20,\n\t}),\n\tcreatePullBackScenario({\n\t\tcurrentLevel: 1,\n\t\tdesiredLevel: 0,\n\t\tindentPerLevel: 20,\n\t}),\n\tcreatePullBackScenario({\n\t\tcurrentLevel: 2,\n\t\tdesiredLevel: 0,\n\t\tindentPerLevel: 20,\n\t}),\n\t(() => {\n\t\tconst indentPerLevel = 20;\n\t\tconst currentLevel = 2;\n\t\treturn {\n\t\t\tmode: 'last-in-group',\n\t\t\tdescription: `[invisible item] pulling back on lower half should reparent (moving into space before border box)`,\n\t\t\texpected: {\n\t\t\t\ttype: 'reparent',\n\t\t\t\tindentPerLevel,\n\t\t\t\tcurrentLevel,\n\t\t\t\tdesiredLevel: 0,\n\t\t\t},\n\t\t\tindentPerLevel,\n\t\t\tcurrentLevel,\n\t\t\thitbox: getRect({\n\t\t\t\ttop: rect.top + rect.height / 2,\n\t\t\t\tleft: rect.left - 1,\n\t\t\t\tright: rect.left + indentPerLevel - 1,\n\t\t\t\tbottom: rect.bottom,\n\t\t\t}),\n\t\t};\n\t})(),\n];\n\nfunction createPullBackScenario({\n\tcurrentLevel,\n\tdesiredLevel,\n\tindentPerLevel,\n}: {\n\tcurrentLevel: number;\n\tdesiredLevel: number;\n\tindentPerLevel: number;\n}): Scenario {\n\tconst left = rect.left + indentPerLevel * desiredLevel;\n\t// the 'zone' for this hitbox is a single level beyond the desired level\n\t// 'on the edge line' is reserved for the region after\n\tconst right = left + indentPerLevel - 1;\n\treturn {\n\t\tmode: 'last-in-group',\n\t\tdescription: `[invisible item] pulling back on lower half should reparent (lvl${currentLevel} -> lvl${desiredLevel})`,\n\t\texpected: {\n\t\t\ttype: 'reparent',\n\t\t\tindentPerLevel,\n\t\t\tcurrentLevel,\n\t\t\tdesiredLevel,\n\t\t},\n\t\tindentPerLevel,\n\t\tcurrentLevel,\n\t\thitbox: getRect({\n\t\t\ttop: rect.top + rect.height / 2,\n\t\t\tbottom: rect.bottom,\n\t\t\tleft,\n\t\t\tright,\n\t\t}),\n\t};\n}\n\n// Checking that blocking an instruction will block the result\nconst blocked: Scenario[] = scenarios.map((scenario): Scenario => {\n\t// Cannot block the 'instruction-blocked' instruction\n\tif (scenario.expected.type === 'instruction-blocked') {\n\t\treturn scenario;\n\t}\n\treturn {\n\t\t...scenario,\n\t\tblock: [scenario.expected.type],\n\t\tdescription: `[blocked] ${scenario.description}`,\n\t\texpected: {\n\t\t\ttype: 'instruction-blocked',\n\t\t\tdesired: scenario.expected,\n\t\t},\n\t};\n});\n\n[...scenarios, ...blocked].forEach((scenario) => {\n\tconst base = scenario.only ? test.only : test;\n\n\tdescribe(`[mode: ${scenario.mode}] ${scenario.description}`, () => {\n\t\tconst points = getPoints(scenario.hitbox);\n\n\t\tpoints.forEach((point) => {\n\t\t\tbase(`case: ${point.label} {x:${point.x}, y:${point.y}}`, () => {\n\t\t\t\tconst [element] = getElements();\n\t\t\t\telement.getBoundingClientRect = () => rect;\n\n\t\t\t\tconst result = extractInstruction(\n\t\t\t\t\tattachInstruction(\n\t\t\t\t\t\t{},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\telement,\n\t\t\t\t\t\t\tmode: scenario.mode,\n\t\t\t\t\t\t\tinput: getDefaultInput({\n\t\t\t\t\t\t\t\tclientX: point.x,\n\t\t\t\t\t\t\t\tclientY: point.y,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t\tcurrentLevel: scenario.currentLevel,\n\t\t\t\t\t\t\tindentPerLevel: scenario.indentPerLevel,\n\t\t\t\t\t\t\tblock: scenario.block ?? [],\n\t\t\t\t\t\t},\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\texpect(result).toEqual(scenario.expected);\n\t\t\t});\n\t\t});\n\t});\n});\n\nit('should not impact user data', () => {\n\tconst [element] = getElements();\n\telement.getBoundingClientRect = () => rect;\n\tconst data = { message: 'hello' };\n\n\tconst updated = attachInstruction(data, {\n\t\telement,\n\t\tmode: 'standard',\n\t\tinput: getDefaultInput(),\n\t\tcurrentLevel: 0,\n\t\tindentPerLevel: 20,\n\t});\n\n\texpect(updated.message).toEqual('hello');\n});\n"
  },
  {
    "path": "packages/hitbox/afm-jira/tsconfig.json",
    "content": "{\n\t\"extends\": \"../../../../tsconfig.local-consumption.json\",\n\t\"compilerOptions\": {\n\t\t\"target\": \"es5\",\n\t\t\"outDir\": \"../../../../../jira/tsDist/@atlaskit__pragmatic-drag-and-drop-hitbox/app\",\n\t\t\"rootDir\": \"../\",\n\t\t\"composite\": true,\n\t\t\"noCheck\": true\n\t},\n\t\"include\": [\n\t\t\"../src/**/*.ts\",\n\t\t\"../src/**/*.tsx\"\n\t],\n\t\"exclude\": [\n\t\t\"../src/**/__tests__/*\",\n\t\t\"../src/**/*.test.*\",\n\t\t\"../src/**/test.*\",\n\t\t\"../src/**/examples.*\",\n\t\t\"../src/**/examples/*\",\n\t\t\"../src/**/examples/**/*\",\n\t\t\"../src/**/*.stories.*\",\n\t\t\"../src/**/stories/*\",\n\t\t\"../src/**/stories/**/*\"\n\t],\n\t\"references\": [\n\t\t{\n\t\t\t\"path\": \"../../core/afm-jira/tsconfig.json\"\n\t\t}\n\t]\n}\n"
  },
  {
    "path": "packages/hitbox/afm-products/tsconfig.json",
    "content": "{\n\t\"extends\": \"../../../../tsconfig.local-consumption.json\",\n\t\"compilerOptions\": {\n\t\t\"target\": \"es5\",\n\t\t\"outDir\": \"../../../../../tsDist/@atlaskit__pragmatic-drag-and-drop-hitbox/app\",\n\t\t\"rootDir\": \"../\",\n\t\t\"composite\": true,\n\t\t\"noCheck\": true\n\t},\n\t\"include\": [\n\t\t\"../src/**/*.ts\",\n\t\t\"../src/**/*.tsx\"\n\t],\n\t\"exclude\": [\n\t\t\"../src/**/__tests__/*\",\n\t\t\"../src/**/*.test.*\",\n\t\t\"../src/**/test.*\",\n\t\t\"../src/**/examples.*\",\n\t\t\"../src/**/examples/*\",\n\t\t\"../src/**/examples/**/*\",\n\t\t\"../src/**/*.stories.*\",\n\t\t\"../src/**/stories/*\",\n\t\t\"../src/**/stories/**/*\"\n\t],\n\t\"references\": [\n\t\t{\n\t\t\t\"path\": \"../../core/afm-products/tsconfig.json\"\n\t\t}\n\t]\n}\n"
  },
  {
    "path": "packages/hitbox/constellation/index/about.mdx",
    "content": "---\norder: 0\ntitle: Hitbox\ndescription:\n  An optional package that enables the attaching of interaction information to a drop target.\n---\n\nimport SectionMessage from '@atlaskit/section-message';\n\n<SectionMessage>\n\nThis package depends on [the core package](/components/pragmatic-drag-and-drop/core-package).\n\nThis package has no dependency on any view library (eg `react`), or on the Atlassian Design System.\n\n</SectionMessage>\n\n- **[List item](#list-item):** Determines that operation (`\"reorder-above\"`, `\"combine\"` or\n  `\"reorder-below\"`) that should be applied to a vertical or horizontal list item (including trees)\n- **[Closest edge](#closest-edge):** Detects the closest edge (`\"top\", \"right\", \"bottom\", \"left\"`)\n  for a drop target being dragged over.\n- **[Tree item](#tree-item):** (Please now use [list item](#list-item)) Determines the operation\n  (`\"reorder-above\", \"reorder-below\", \"make-child\", \"reparent\"`) to be performed when when a tree\n  item is dropped.\n\n## List item\n\nThe list item hitbox has been designed to provide rich hitbox information for experiences where\nitems are ordered after each other. The list item hitbox can also be used in nested structures such\nas trees (you can think of each level of a tree as a separate list).\n\nThe list item hitbox allows an item to support _up to_ three separate outcomes:\n\n- `\"reorder-before\"`\n- `\"reorder-after\"`\n- `\"combine\"`\n\nEach operation has three possible values:\n\n- `\"not-available\"` (default)\n- `\"available\"`\n- `\"blocked\"` (similar to `\"available\"`, but generally used to show warning colors)\n\n```ts\ntype Operation = 'reorder-before' | 'reorder-after' | 'combine';\n\n// an `Instruction` contains the applied operation, and whether the operation was blocked.\ntype Instruction = {\n\t// What the operation is\n\toperation: Operation;\n\n\t// whether or not the operation was \"blocked\"\n\tblocked: boolean;\n};\n```\n\n```ts\nimport {\n\tattachInstruction,\n\textractInstruction,\n\ttype Instruction,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/list-item';\n\ndropTargetForElements({\n\telement: myElement,\n\tgetData: ({ input, element }) => {\n\t\t// your base data you want to attach to the drop target\n\t\tconst data = {\n\t\t\titemId: 'A',\n\t\t};\n\t\t// this will 'attach' the closest edge to your `data` object\n\t\treturn attachInstruction(data, {\n\t\t\tinput,\n\t\t\telement,\n\t\t\toperations: {\n\t\t\t\t'reorder-before': 'available',\n\t\t\t\t'reorder-after': 'available',\n\t\t\t\tcombine: 'available',\n\t\t\t},\n\t\t});\n\t},\n\tonDrop: (args) => {\n\t\tconst instruction: Instruction | null = extractInstruction(args.self.data);\n\t},\n});\n```\n\n### Behaviour\n\nThe hitbox for an item will automatically adjust based on which items are `available` or `blocked`:\n\n**All operations are available**\n\n- before start edge: `\"reorder-before\"`\n- first 1/4: `\"reorder-before\"`\n- middle 1/2: `\"combine\"`\n- last 1/4: `\"reorder-after\"`\n- after end edge: `\"reorder-after\"`\n\n**Only `\"reorder-before\"` and `\"reorder-after\"` are available:**\n\n- before start edge: `\"reorder-before\"`\n- first 1/2 `\"reorder-before\"`\n- last 1/2: `\"reorder-after\"`\n- after end edge: `\"reorder-after\"`\n\n**Only `\"reorder-before\"` and `\"combine\"` are available:**\n\n- before start edge: `\"reorder-before\"`\n- first 1/4: `\"reorder-before\"`\n- middle 3/4: `\"combine\"`\n- after end edge: `\"combine\"`\n\n**Only `\"reorder-after\"` and `\"combine\"` are available:**\n\n- before start edge: `\"combine\"`\n- first 3/4: `\"combine\"`\n- last 1/4: `\"reorder-after\"`\n- after end edge: `\"combine\"`\n\n**Only one operation is available (eg `\"combine\"`):**\n\n- before start edge: `\"combine\"`\n- in item: `\"combine\"`\n- after end edge: `\"combine\"`\n\n**No available (or blocked) operations:**\n\n- before start edge: `Instruction` will be `null`\n- in item: `Instruction` will be `null`\n- after end edge: `Instruction` will be `null`\n\n### Preventing operations\n\nIf you don't want a particular operation to be available, you can the operation to\n`\"not-available\"`, or just leave it blank (the default value is `\"not-available\"`). The hitbox will\nautomatically adjust to account for which operations are available.\n\n```ts\nreturn attachInstruction(data, {\n\tinput,\n\telement,\n\toperations: {\n\t\t'reorder-before': 'available',\n\t\t'reorder-after': 'not-available', // reordering after no longer available\n\t},\n});\n```\n\n### Blocking operations\n\nSometimes you want to explicitly call out that an operation is not permitted _right now_. An example\nof this is draft pages in Confluence which cannot be the target of a drag operation, but once page\nis no longer a draft it could be the target of a drag operation. In these cases, it can be helpful\nto make it explicit to the user that a particular drag operation can not permitted. You can use\n`blocked` for this use case. When an operation is blocked, it will be used by our _drop indicator_\nto show a drop indicator with a warning color.\n\n```ts\nreturn attachInstruction(data, {\n\tinput,\n\telement,\n\toperations: {\n\t\tcombine: 'blocked',\n\t},\n});\n```\n\n### Vertical and horizontal support\n\nYou can use the list item hitbox for vertical or horizontal lists. You need to provide which axis\nthe interface is on to `attachInstruction`. The `axis` value can be `\"vertical\"` (default) or\n`\"horizontal\"`.\n\n```ts\nreturn attachInstruction(data, {\n\tinput,\n\telement,\n\taxis: 'horizontal', // \"vertical\" is the default\n\toperations: {\n\t\t'reorder-before': 'available',\n\t\t'reorder-after': 'available',\n\t},\n});\n```\n\n### Trees\n\nThe list item hitbox has been designed to work well with tree structures,\n[as you can see in our tree example](/components/pragmatic-drag-and-drop/examples#tree).\n\nSome high level notes when building trees:\n\n- You can treat each level of the tree as a separate \"list\"\n- You can enable whatever operations you like\n- For expanded tree items, do not allow `\"reorder-after\"` operations\n\n### Utilities\n\nThere are no utilities specific for our list item hitbox, as it can contain non-reordering\noperations (eg `\"combine\"`) which require more decisions to be made regarding what the state update\ncould look like. For `\"reorder-before\"` and `\"reorder-after\"` operations, you can use our general\npurpose [`reorder` utility](/components/pragmatic-drag-and-drop/core-package/utilities#reorder).\n\n## Closest edge\n\nThe closest edge addon is used to know what the closest edge is when dragging over a drop target.\nKnowing the closest edge can be helpful when doing reordering and moving operations. This addon\nleverages the fact that `getData()` is repeatedly called throughout a drag and drop operation.\n\nThe `attachClosestEdge()` function adds a unique `Symbol` to your drop target's `data` object, which\nallows for type safe lookups with `extractClosestEdge()`.\n\n```ts\ntype Edge = 'top' | 'right' | 'bottom' | 'left';\n```\n\n```ts\nimport {\n\tattachClosestEdge,\n\textractClosestEdge,\n\tEdge,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\n\ndropTargetForElements({\n\telement: myElement,\n\tgetData: ({ input, element }) => {\n\t\t// your base data you want to attach to the drop target\n\t\tconst data = {\n\t\t\titemId: 'A',\n\t\t};\n\t\t// this will 'attach' the closest edge to your `data` object\n\t\treturn attachClosestEdge(data, {\n\t\t\tinput,\n\t\t\telement,\n\t\t\t// you can specify what edges you want to allow the user to be closest to\n\t\t\tallowedEdges: ['top', 'bottom'],\n\t\t});\n\t},\n\tonDrop: (args) => {\n\t\tconst closestEdgeOfTarget: Edge | null = extractClosestEdge(args.self.data);\n\t},\n});\n```\n\n### Utilities\n\nUtilities specifically to make working with edges easier.\n\n#### `getReorderDestinationIndex`\n\nWhen you are rendering _drop indicators_ (eg lines) between items in a list, it can be difficult to\nknow what the `index` the dropped item should go into. The final `index` will depend on what the\nclosest `Edge` is. `getReorderDestinationIndex` can give you the final `index` for a reordering\noperation, taking into account which `Edge` is closest\n\n```ts\nimport { getReorderDestinationIndex } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index';\n\n// Dragging A on the left of B\n// A should stay in the same spot\nexpect(\n\tgetReorderDestinationIndex({\n\t\t// list: ['A', 'B', 'C'],\n\t\t// move A to left of B\n\t\tstartIndex: 0,\n\t\tindexOfTarget: 1,\n\t\tclosestEdgeOfTarget: 'left',\n\t\taxis: 'horizontal',\n\t}),\n\t// results in no change: ['A', 'B', 'C']\n).toEqual(0);\n\n// Dragging A on the right of B\n// A should go after B\nexpect(\n\tgetReorderDestinationIndex({\n\t\t// list: ['A', 'B', 'C'],\n\t\t// move A to right of B\n\t\tstartIndex: 0,\n\t\tindexOfTarget: 1,\n\t\tclosestEdgeOfTarget: 'right',\n\t\taxis: 'horizontal',\n\t}),\n\t// A moved forward ['B', 'A', 'C']\n).toEqual(1);\n```\n\n#### `reorderWithEdge`\n\nPerforms an array reorder operation that takes into account the closest `Edge`. `reorderWithEdge`\nuses `getReorderDestinationIndex` internally as well as `reorder` to reorder the array\n(`@atlaskit/pragmatic-drag-and-drop/reorder`)\n\n```ts\nimport { reorderWithEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/util/reorder-with-edge';\n\n// Dragging A on the left of B\n// A should stay in the same spot\nexpect(\n\treorderWithEdge({\n\t\tlist: ['A', 'B', 'C'],\n\t\t// move A to left of B\n\t\tstartIndex: 0,\n\t\tindexOfTarget: 1,\n\t\tclosestEdgeOfTarget: 'left',\n\t\taxis: 'horizontal',\n\t}),\n\t// results in no change\n).toEqual(['A', 'B', 'C']);\n\n// Dragging A on the right of B\n// A should go after B\nexpect(\n\treorderWithEdge({\n\t\tlist: ['A', 'B', 'C'],\n\t\tstartIndex: 0,\n\t\tindexOfTarget: 1,\n\t\tclosestEdgeOfTarget: 'right',\n\t\taxis: 'horizontal',\n\t}),\n).toEqual(['B', 'A', 'C']);\n```\n\n## Tree item\n\n<SectionMessage appearance=\"warning\">\n\nPlease use our new [list-item](#list-item) hitbox, which is a more flexible version of `tree-item`,\nand can be used in tree structures.\n\n</SectionMessage>\n\nThe tree item addon is used to know what operation should be performed when a tree item is dropped.\nThe possible drag operations are:\n\n- **reorder-above**: the draggable item should be moved above the item it's dropped on.\n- **reorder-below**: the draggable item should be moved below the item it's dropped on.\n- **make-child**: the draggable item should be made a child of the item it's dropped on.\n- **reparent**: the level of the draggable item should change to a parent of the item it's dropped\n  on.\n\nAny drag operation can also be blocked.\n\nAlong with the drag position, the current level and the mode of the tree item being dragged over are\nused to determine the drag operation that should be performed. Below is a visual example of a tree\nhitbox demonstrating this:\n\n<img src=\"images/tree-hitbox.jpg\" alt=\"Tree hitbox\" />\n\nThe `attachInstruction()` function adds a unique `Symbol` to your drop target's `data` object, which\nallows for type safe lookups with `extractInstruction()`. This addon leverages the fact that\n`getData()` is repeatedly called throughout a drag and drop operation.\n\n```ts\ntype ItemMode = 'standard' | 'expanded' | 'last-in-group';\n```\n\n```ts\ntype Instruction =\n\t| {\n\t\t\ttype: 'reorder-above';\n\t\t\tcurrentLevel: number;\n\t\t\tindentPerLevel: number;\n\t  }\n\t| {\n\t\t\ttype: 'reorder-below';\n\t\t\tcurrentLevel: number;\n\t\t\tindentPerLevel: number;\n\t  }\n\t| {\n\t\t\ttype: 'make-child';\n\t\t\tcurrentLevel: number;\n\t\t\tindentPerLevel: number;\n\t  }\n\t| {\n\t\t\ttype: 'reparent';\n\t\t\tcurrentLevel: number;\n\t\t\tindentPerLevel: number;\n\t\t\tdesiredLevel: number;\n\t  }\n\t| {\n\t\t\ttype: 'instruction-blocked';\n\t\t\tdesired: Exclude<Instruction, { type: 'instruction-blocked' }>;\n\t  };\n```\n\n```ts\nimport {\n\tattachInstruction,\n\textractInstruction,\n\tInstruction,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';\n\ndropTargetForElements({\n\telement: myElement,\n\tgetData: ({ input, element }) => {\n\t\t// your base data you want to attach to the drop target\n\t\tconst data = {\n\t\t\titemId: 'A',\n\t\t};\n\t\t// this will 'attach' the instruction to your `data` object\n\t\treturn attachInstruction(data, {\n\t\t\tinput,\n\t\t\telement,\n\t\t\tcurrentLevel: 2,\n\t\t\tindentPerLevel: 20,\n\t\t\tmode: 'standard',\n\t\t\t// you can specify instructions to block\n\t\t\tblock: ['reorder-below'],\n\t\t});\n\t},\n\tonDrag: (args) => {\n\t\tconst instruction: Instruction | null = extractInstruction(args.self.data);\n\t},\n});\n```\n"
  },
  {
    "path": "packages/hitbox/constellation/index/props.mdx",
    "content": "---\norder: 1\n---\n"
  },
  {
    "path": "packages/hitbox/examples/config.jsonc",
    "content": "/**\n * This file is used by the test scaling project to optimise test result caching\n * Examples that are used by tests affect the outcome of tests so must be included when hashing\n * They are defined here so the hashing algorithm doesn't need to search test files for example usage each time\n */\n{\n  \"testExamples\": [\n  ]\n}\n"
  },
  {
    "path": "packages/hitbox/package.json",
    "content": "{\n  \"name\": \"@atlaskit/pragmatic-drag-and-drop-hitbox\",\n  \"version\": \"1.1.0\",\n  \"description\": \"An optional package for Pragmatic drag and drop that enables the attaching of interaction information to a drop target\",\n  \"author\": \"Atlassian Pty Ltd\",\n  \"license\": \"Apache-2.0\",\n  \"publishConfig\": {\n    \"registry\": \"https://registry.npmjs.org/\"\n  },\n  \"repository\": \"https://github.com/atlassian/pragmatic-drag-and-drop\",\n  \"main\": \"dist/cjs/index.js\",\n  \"module\": \"dist/esm/index.js\",\n  \"module:es2019\": \"dist/es2019/index.js\",\n  \"types\": \"dist/types/index.d.ts\",\n  \"sideEffects\": false,\n  \"exports\": {\n    \".\": \"./src/index.ts\",\n    \"./types\": \"./src/types.ts\",\n    \"./closest-edge\": \"./src/closest-edge.ts\",\n    \"./list-item\": \"./src/list-item.ts\",\n    \"./tree-item\": \"./src/tree-item.ts\",\n    \"./util/reorder-with-edge\": \"./src/reorder-with-edge.ts\",\n    \"./util/get-reorder-destination-index\": \"./src/get-reorder-destination-index.ts\"\n  },\n  \"dependencies\": {\n    \"@atlaskit/pragmatic-drag-and-drop\": \"^1.7.0\",\n    \"@babel/runtime\": \"^7.0.0\"\n  },\n  \"devDependencies\": {\n    \"wait-for-expect\": \"^1.2.0\"\n  },\n  \"homepage\": \"https://atlassian.design/components/pragmatic-drag-and-drop/\"\n}\n"
  },
  {
    "path": "packages/hitbox/src/closest-edge.ts",
    "content": "import type { Input, Position } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport type { Edge as EdgeRaw } from './types';\n// re-exporting type to make it easy to use\nexport type Edge = EdgeRaw;\n\nconst getDistanceToEdge: {\n\t[TKey in Edge]: (rect: DOMRect, client: Position) => number;\n} = {\n\ttop: (rect, client) => Math.abs(client.y - rect.top),\n\tright: (rect, client) => Math.abs(rect.right - client.x),\n\tbottom: (rect, client) => Math.abs(rect.bottom - client.y),\n\tleft: (rect, client) => Math.abs(client.x - rect.left),\n};\n\n// using a symbol so we can guarantee a key with a unique value\nconst uniqueKey = Symbol('closestEdge');\n\n/**\n * Adds a unique `Symbol` to the `userData` object. Use with `extractClosestEdge()` for type safe lookups.\n */\nexport function attachClosestEdge(\n\tuserData: Record<string | symbol, unknown>,\n\t{\n\t\telement,\n\t\tinput,\n\t\tallowedEdges,\n\t}: {\n\t\telement: Element;\n\t\tinput: Input;\n\t\tallowedEdges: Edge[];\n\t},\n): Record<string | symbol, unknown> {\n\tconst client: Position = {\n\t\tx: input.clientX,\n\t\ty: input.clientY,\n\t};\n\t// I tried caching the result of `getBoundingClientRect()` for a single\n\t// frame in order to improve performance.\n\t// However, on measurement I saw no improvement. So no longer caching\n\tconst rect: DOMRect = element.getBoundingClientRect();\n\tconst entries = allowedEdges.map((edge) => {\n\t\treturn {\n\t\t\tedge,\n\t\t\tvalue: getDistanceToEdge[edge](rect, client),\n\t\t};\n\t});\n\n\t// edge can be `null` when `allowedEdges` is []\n\tconst addClosestEdge: Edge | null = entries.sort((a, b) => a.value - b.value)[0]?.edge ?? null;\n\n\treturn {\n\t\t...userData,\n\t\t[uniqueKey]: addClosestEdge,\n\t};\n}\n\n/**\n * Returns the value added by `attachClosestEdge()` to the `userData` object. It will return `null` if there is no value.\n */\nexport function extractClosestEdge(userData: Record<string | symbol, unknown>): Edge | null {\n\treturn (userData[uniqueKey] as Edge) ?? null;\n}\n"
  },
  {
    "path": "packages/hitbox/src/get-reorder-destination-index.ts",
    "content": "import type { Edge } from './types';\n\nexport function getReorderDestinationIndex({\n\tstartIndex,\n\tclosestEdgeOfTarget,\n\tindexOfTarget,\n\taxis,\n}: {\n\tstartIndex: number;\n\tclosestEdgeOfTarget: Edge | null;\n\tindexOfTarget: number;\n\taxis: 'vertical' | 'horizontal';\n}): number {\n\t// invalid index's\n\tif (startIndex === -1 || indexOfTarget === -1) {\n\t\treturn startIndex;\n\t}\n\n\t// if we are targeting the same index we don't need to do anything\n\tif (startIndex === indexOfTarget) {\n\t\treturn startIndex;\n\t}\n\n\tif (closestEdgeOfTarget == null) {\n\t\treturn indexOfTarget;\n\t}\n\n\tconst isGoingAfter: boolean =\n\t\t(axis === 'vertical' && closestEdgeOfTarget === 'bottom') ||\n\t\t(axis === 'horizontal' && closestEdgeOfTarget === 'right');\n\n\tconst isMovingForward: boolean = startIndex < indexOfTarget;\n\t// moving forward\n\tif (isMovingForward) {\n\t\treturn isGoingAfter ? indexOfTarget : indexOfTarget - 1;\n\t}\n\t// moving backwards\n\treturn isGoingAfter ? indexOfTarget + 1 : indexOfTarget;\n}\n"
  },
  {
    "path": "packages/hitbox/src/index.ts",
    "content": "// This file exists for module resolution purposes.\n\n// Not exporting anything from the root entry point\n// Please use individual entry points in order to always\n// obtain minimum kbs.\n\nexport default {};\n"
  },
  {
    "path": "packages/hitbox/src/internal/memoize.ts",
    "content": "type TData = Record<string, unknown>;\n\nexport function isShallowEqual(a: Record<string, unknown>, b: Record<string, unknown>): boolean {\n\tconst aKeys = Object.keys(a);\n\tconst bKeys = Object.keys(b);\n\n\tif (aKeys.length !== bKeys.length) {\n\t\treturn false;\n\t}\n\treturn aKeys.every((key) => Object.is(a[key], b[key]));\n}\n\n/**\n * Used to store a stable object, which returns a new object only if one of the values has changed\n */\nexport function stable<T extends TData>(isEqual: (a: T, b: T) => boolean = isShallowEqual) {\n\tlet cache: { value: T } | null = null;\n\n\treturn (value: T): T => {\n\t\tif (cache && isEqual(cache.value, value)) {\n\t\t\treturn cache.value;\n\t\t}\n\t\tcache = { value };\n\t\treturn cache.value;\n\t};\n}\n"
  },
  {
    "path": "packages/hitbox/src/list-item.ts",
    "content": "import type { Input, Position } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport { stable } from './internal/memoize';\n\nexport type Operation = 'reorder-before' | 'reorder-after' | 'combine';\n\ntype Axis = 'horizontal' | 'vertical';\n\nexport type Instruction = {\n\t[TOperation in Operation]: {\n\t\toperation: TOperation;\n\t\tblocked: boolean;\n\t\taxis: Axis;\n\t};\n}[Operation];\n\n// using a symbol so we can guarantee a key with a unique value\nconst uniqueKey = Symbol('list-item-instruction');\n\nconst axisLookup = {\n\tvertical: {\n\t\tstart: 'top',\n\t\tend: 'bottom',\n\t\tsize: 'height',\n\t\tpoint: 'y',\n\t},\n\thorizontal: {\n\t\tstart: 'left',\n\t\tend: 'right',\n\t\tsize: 'width',\n\t\tpoint: 'x',\n\t},\n} as const;\n\ntype AxisDefinition = (typeof axisLookup)[keyof typeof axisLookup];\n\nfunction reorderAndCombine({\n\tclient,\n\tborderBox,\n\taxis,\n}: {\n\tclient: Position;\n\tborderBox: DOMRect;\n\taxis: AxisDefinition;\n}): 'reorder-before' | 'reorder-after' | 'combine' {\n\tconst quarterOfSize = borderBox[axis.size] / 4;\n\n\t// In the top 1/4: reorder-before\n\t// On the line: reorder-before to give a slight preference to reordering\n\tif (client[axis.point] <= borderBox[axis.start] + quarterOfSize) {\n\t\treturn 'reorder-before';\n\t}\n\t// In the bottom 1/4: reorder-after\n\t// On the line: reorder-after to give a slight preference to reordering\n\tif (client[axis.point] >= borderBox[axis.end] - quarterOfSize) {\n\t\treturn 'reorder-after';\n\t}\n\treturn 'combine';\n}\n\nfunction reorder({\n\tclient,\n\tborderBox,\n\taxis,\n}: {\n\tclient: Position;\n\tborderBox: DOMRect;\n\taxis: AxisDefinition;\n}): 'reorder-before' | 'reorder-after' {\n\tconst halfSize = borderBox[axis.size] / 2;\n\n\t// In the top 1/2: reorder-before\n\t// On the line: reorder-after to give a slight preference to moving forward\n\tif (client[axis.point] < borderBox[axis.start] + halfSize) {\n\t\treturn 'reorder-before';\n\t}\n\treturn 'reorder-after';\n}\n\n// Note: not using `memoize-one` as all we need is a cached value.\n// We do not need to avoid executing an expensive function.\nconst memoizeInstruction = stable<Instruction>();\n\nexport type Availability = 'available' | 'not-available' | 'blocked';\n\nfunction isPossible(...values: Availability[]): boolean {\n\treturn values.every((value) => value === 'available' || value === 'blocked');\n}\n\nfunction isNotAvailable(...values: Availability[]): boolean {\n\treturn values.every((value) => value === 'not-available');\n}\n\n/**\n * Calculate the `Instruction` for a drag operation based on the users input\n * and the available operations.\n *\n * Notes:\n *\n * - `attachInstruction` can attach an `Instruction | null`. `null` will be attached if all `operations` provided are `\"not-available\"`.\n * - Use `extractInstruction` to obtain the `Instruction | null`\n *\n * @example\n *\n * ```ts\n * dropTargetForElements({\n * \telement: myElement,\n *  getData({input, element}) {\n *    // The data I want to attach to the drop target\n * \t\tconst myData = {type: 'card', cardId: 'A'};\n *\n *    // Add an instruction to myData\n *    return attachInstruction(myData, {\n * \t\t\tinput,\n * \t\t\telement,\n * \t\t\toperations: {\n * \t\t\t\t'reorder-before': 'available',\n * \t\t\t\t'reorder-after': 'available',\n * \t\t\t\tcombine: 'available',\n * \t\t\t}\n *    });\n *  }\n * });\n * ```\n */\nexport function attachInstruction(\n\tuserData: Record<string | symbol, unknown>,\n\t{\n\t\toperations,\n\t\telement,\n\t\tinput,\n\t\taxis: axisValue = 'vertical',\n\t}: {\n\t\t/**\n\t\t * All operations are optional, and their default value is `\"not-available\"`.\n\t\t * The hitbox will automatically adjust to account for which options are `\"available\"` or `\"blocked\"`.\n\t\t */\n\t\toperations: {\n\t\t\t[TKey in Operation]?: Availability;\n\t\t};\n\t\telement: Element;\n\t\tinput: Input;\n\t\taxis?: Axis;\n\t},\n): Record<string | symbol, unknown> {\n\tconst client: Position = {\n\t\tx: input.clientX,\n\t\ty: input.clientY,\n\t};\n\tconst borderBox: DOMRect = element.getBoundingClientRect();\n\tconst axis: AxisDefinition = axisLookup[axisValue];\n\n\tconst combine = operations.combine ?? 'not-available';\n\tconst reorderAbove = operations['reorder-before'] ?? 'not-available';\n\tconst reorderBelow = operations['reorder-after'] ?? 'not-available';\n\n\tconst operation: Operation | null = (() => {\n\t\t// Combining not possible\n\t\tif (!isPossible(combine)) {\n\t\t\t// can reorder above and below\n\t\t\tif (isPossible(reorderAbove, reorderBelow)) {\n\t\t\t\treturn reorder({ client, borderBox, axis });\n\t\t\t}\n\n\t\t\t// can only reorder above\n\t\t\tif (isPossible(reorderAbove)) {\n\t\t\t\treturn 'reorder-before';\n\t\t\t}\n\n\t\t\t// can only reorder below\n\t\t\tif (isPossible(reorderBelow)) {\n\t\t\t\treturn 'reorder-after';\n\t\t\t}\n\n\t\t\t// no `true` values - no Outcome available.\n\t\t\treturn null;\n\t\t}\n\n\t\t// combining is available\n\n\t\tconst result = reorderAndCombine({ client, borderBox, axis });\n\n\t\tif (result === 'reorder-after') {\n\t\t\treturn isNotAvailable(reorderBelow) ? 'combine' : result;\n\t\t}\n\n\t\tif (result === 'reorder-before') {\n\t\t\treturn isNotAvailable(reorderAbove) ? 'combine' : result;\n\t\t}\n\t\treturn result;\n\t})();\n\n\t// We cannot attach an instruction - all values passed where `false` or no values passed\n\tif (!operation) {\n\t\treturn userData;\n\t}\n\n\tconst instruction: Instruction = {\n\t\toperation,\n\t\tblocked: operations[operation] === 'blocked',\n\t\taxis: axisValue,\n\t};\n\tconst memoized: Instruction = memoizeInstruction(instruction);\n\n\treturn {\n\t\t...userData,\n\t\t[uniqueKey]: memoized,\n\t};\n}\n\n/**\n * Extract an instruction from the user data if it is available.\n *\n *\n * @example\n *\n * ```ts\n * monitorForElements({\n *  onDrop({location}) {\n *   const innerMost = location.current.dropTargets[0];\n *   if(!innerMost) {\n *     return;\n *   }\n *   const instruction: Instruction | null = extractInstruction(innerMost.data);\n *  }\n * });\n * ```\n */\nexport function extractInstruction(userData: Record<string | symbol, unknown>): Instruction | null {\n\treturn (userData[uniqueKey] as Instruction) ?? null;\n}\n"
  },
  {
    "path": "packages/hitbox/src/reorder-with-edge.ts",
    "content": "import { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';\n\nimport { getReorderDestinationIndex } from './get-reorder-destination-index';\nimport type { Edge } from './types';\n\nexport function reorderWithEdge<Value>({\n\tlist,\n\tstartIndex,\n\tclosestEdgeOfTarget,\n\tindexOfTarget,\n\taxis,\n}: {\n\tlist: Value[];\n\tclosestEdgeOfTarget: Edge | null;\n\tstartIndex: number;\n\tindexOfTarget: number;\n\taxis: 'vertical' | 'horizontal';\n}): Value[] {\n\treturn reorder({\n\t\tlist,\n\t\tstartIndex,\n\t\tfinishIndex: getReorderDestinationIndex({\n\t\t\tclosestEdgeOfTarget,\n\t\t\tstartIndex,\n\t\t\tindexOfTarget,\n\t\t\taxis,\n\t\t}),\n\t});\n}\n"
  },
  {
    "path": "packages/hitbox/src/tree-item.ts",
    "content": "import type { Input, Position } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport { isShallowEqual, stable } from './internal/memoize';\n\nexport type ItemMode = 'standard' | 'expanded' | 'last-in-group';\n\nexport type Instruction =\n\t| {\n\t\t\ttype: 'reorder-above';\n\t\t\tcurrentLevel: number;\n\t\t\tindentPerLevel: number;\n\t  }\n\t| {\n\t\t\ttype: 'reorder-below';\n\t\t\tcurrentLevel: number;\n\t\t\tindentPerLevel: number;\n\t  }\n\t| {\n\t\t\ttype: 'make-child';\n\t\t\tcurrentLevel: number;\n\t\t\tindentPerLevel: number;\n\t  }\n\t| {\n\t\t\ttype: 'reparent';\n\t\t\tcurrentLevel: number;\n\t\t\tindentPerLevel: number;\n\t\t\tdesiredLevel: number;\n\t  }\n\t| {\n\t\t\ttype: 'instruction-blocked';\n\t\t\tdesired: Exclude<Instruction, { type: 'instruction-blocked' }>;\n\t  };\n// using a symbol so we can guarantee a key with a unique value\nconst uniqueKey = Symbol('tree-item-instruction');\n\nfunction getCenter(rect: DOMRect): Position {\n\treturn {\n\t\tx: (rect.right + rect.left) / 2,\n\t\ty: (rect.bottom + rect.top) / 2,\n\t};\n}\n\nfunction standardHitbox({\n\tclient,\n\tborderBox,\n}: {\n\tclient: Position;\n\tborderBox: DOMRect;\n}): 'reorder-above' | 'reorder-below' | 'make-child' {\n\tconst quarterOfHeight = borderBox.height / 4;\n\n\t// In the top 1/4: reorder-above\n\t// On the line = in the top 1/4 to give this zone a bit more space\n\tif (client.y <= borderBox.top + quarterOfHeight) {\n\t\treturn 'reorder-above';\n\t}\n\t// In the bottom 1/4: reorder-below\n\t// On the line = in the bottom 1/4 to give this zone a bit more space\n\tif (client.y >= borderBox.bottom - quarterOfHeight) {\n\t\treturn 'reorder-below';\n\t}\n\treturn 'make-child';\n}\n\nfunction getInstruction({\n\telement,\n\tinput,\n\tcurrentLevel,\n\tindentPerLevel,\n\tmode,\n}: {\n\telement: Element;\n\tinput: Input;\n\tcurrentLevel: number;\n\tindentPerLevel: number;\n\tmode: ItemMode;\n}): Instruction {\n\tconst client: Position = {\n\t\tx: input.clientX,\n\t\ty: input.clientY,\n\t};\n\n\tconst borderBox = element.getBoundingClientRect();\n\tif (mode === 'standard') {\n\t\tconst type = standardHitbox({ borderBox, client });\n\t\treturn { type, indentPerLevel, currentLevel };\n\t}\n\tconst center: Position = getCenter(borderBox);\n\n\tif (mode === 'expanded') {\n\t\t// leveraging \"standard\" hitbox to ensure that the 'reorder-above' hit zone is\n\t\t// exactly the same for \"standard\" and \"expanded\" items\n\t\tconst type = standardHitbox({ borderBox, client });\n\t\treturn {\n\t\t\t// Use the \"standard\" hitbox for \"reorder above\",\n\t\t\t// The rest of the item is \"make-child\"\n\t\t\ttype: type === 'reorder-above' ? type : 'make-child',\n\t\t\tindentPerLevel,\n\t\t\tcurrentLevel,\n\t\t};\n\t}\n\n\t// `mode` is \"last-in-group\"\n\n\tconst visibleInset = indentPerLevel * currentLevel;\n\n\t// Before the left edge of the visible item\n\tif (client.x < borderBox.left + visibleInset) {\n\t\t// Above the center: `reorder-above`\n\t\tif (client.y < center.y) {\n\t\t\treturn { type: 'reorder-above', indentPerLevel, currentLevel };\n\t\t}\n\t\t// On or below the center: `reparent`\n\t\t// On the center = `reparent` as we are giving a slightly bigger hitbox to this\n\t\t// action as it is the only place a user can do it\n\t\tconst rawLevel = (client.x - borderBox.left) / indentPerLevel;\n\t\t// We can get sub pixel negative numbers as getBoundingClientRect gives sub-pixel accuracy,\n\t\t// where as clientX is rounded to the nearest pixel.\n\t\t// Using Math.max() ensures we can never get a negative level\n\t\tconst desiredLevel = Math.max(Math.floor(rawLevel), 0);\n\t\treturn {\n\t\t\ttype: 'reparent',\n\t\t\tdesiredLevel,\n\t\t\tindentPerLevel,\n\t\t\tcurrentLevel,\n\t\t};\n\t}\n\t// On the visible item\n\treturn {\n\t\ttype: standardHitbox({ borderBox, client }),\n\t\tindentPerLevel,\n\t\tcurrentLevel,\n\t};\n}\n\nfunction areInstructionsEqual(a: Instruction, b: Instruction): boolean {\n\t// Shortcut\n\tif (a.type !== b.type) {\n\t\treturn false;\n\t}\n\tif (a.type === 'instruction-blocked' && b.type === 'instruction-blocked') {\n\t\treturn areInstructionsEqual(a.desired, b.desired);\n\t}\n\treturn isShallowEqual(a, b);\n}\n\n// Note: not using `memoize-one` as all we need is a cached value.\n// We do not need to avoid executing an expensive function.\nconst memoizeInstruction = stable<Instruction>(areInstructionsEqual);\n\nfunction applyInstructionBlock({\n\tdesired,\n\tblock,\n}: {\n\tdesired: Instruction;\n\tblock?: Instruction['type'][];\n}): Instruction {\n\tif (block?.includes(desired.type) && desired.type !== 'instruction-blocked') {\n\t\tconst blocked: Instruction = {\n\t\t\ttype: 'instruction-blocked',\n\t\t\tdesired,\n\t\t};\n\t\treturn blocked;\n\t}\n\n\treturn desired;\n}\n\nexport function attachInstruction(\n\tuserData: Record<string | symbol, unknown>,\n\t{\n\t\tblock,\n\t\t...rest\n\t}: Parameters<typeof getInstruction>[0] & {\n\t\tblock?: Instruction['type'][];\n\t},\n): Record<string | symbol, unknown> {\n\tconst desired: Instruction = getInstruction(rest);\n\tconst withBlock: Instruction = applyInstructionBlock({\n\t\tdesired,\n\t\tblock,\n\t});\n\tconst memoized: Instruction = memoizeInstruction(withBlock);\n\n\treturn {\n\t\t...userData,\n\t\t[uniqueKey]: memoized,\n\t};\n}\n\nexport function extractInstruction(userData: Record<string | symbol, unknown>): Instruction | null {\n\treturn (userData[uniqueKey] as Instruction) ?? null;\n}\n"
  },
  {
    "path": "packages/hitbox/src/types.ts",
    "content": "export type Edge = 'top' | 'right' | 'bottom' | 'left';\n"
  },
  {
    "path": "packages/hitbox/tsconfig.json",
    "content": "{\n  \"extends\": \"../../tsconfig.json\",\n  \"include\": [\n    \"__tests__/**/*.ts\",\n    \"__tests__/**/*.tsx\",\n    \"docs/**/*.ts\",\n    \"docs/**/*.tsx\",\n    \"examples/**/*.ts\",\n    \"examples/**/*.tsx\",\n    \"src/**/*.ts\",\n    \"src/**/*.tsx\",\n    \"**/stories.ts\",\n    \"**/stories.tsx\",\n    \"**/stories/*.ts\",\n    \"**/stories/*.tsx\",\n    \"**/stories/**/*.ts\",\n    \"**/stories/**/*.tsx\"\n  ]\n}\n"
  },
  {
    "path": "packages/live-region/.npmignore",
    "content": "src/\nexamples-utils/\nexamples/\nindex.ts\ndocs/\nbuild/\n__tests__/\ntsconfig.json\ntsconfig.app.json\ntsconfig.dev.json\n"
  },
  {
    "path": "packages/live-region/CHANGELOG.md",
    "content": "# @atlaskit/pragmatic-drag-and-drop-live-region\n\n## 1.3.3\n\n### Patch Changes\n\n- [`aa9ff75020fcb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/aa9ff75020fcb) -\n  Add @atlassian/a11y-jest-testing to devDependencies.\n\n## 1.3.2\n\n### Patch Changes\n\n- [`70898c8166c77`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/70898c8166c77) -\n  Icon migration entry point update\n\n## 1.3.1\n\n### Patch Changes\n\n- [`e8c312827c802`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e8c312827c802) -\n  Remove unnecessary files from published package\n\n## 1.3.0\n\n### Minor Changes\n\n- [#109060](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109060)\n  [`4660ec858a305`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4660ec858a305) -\n  Update `React` from v16 to v18\n\n## 1.2.0\n\n### Minor Changes\n\n- [#168054](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/168054)\n  [`f9b89a52cbad6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f9b89a52cbad6) -\n  Changes announcement behavior to be delayed and polite instead of immediate and assertive. This\n  helps issues with announcements sometimes being skipped or interrupted.\n\n## 1.1.0\n\n### Minor Changes\n\n- [#150481](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/150481)\n  [`e750fb3633f6e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e750fb3633f6e) -\n  [ux] Enable new icons behind a feature flag.\n\n### Patch Changes\n\n- [#150464](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/150464)\n  [`b813bd74ede6d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b813bd74ede6d) -\n  Updates internal configuration files\n\n## 1.0.7\n\n### Patch Changes\n\n- [#124164](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/124164)\n  [`58941fa1d332a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/58941fa1d332a) -\n  All `react` unit tests will now run against `react@16` and `react@18` on CI.\n\n## 1.0.6\n\n### Patch Changes\n\n- [#92007](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/92007)\n  [`85525725cb0d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/85525725cb0d) -\n  Migrated to the new button component\n\n## 1.0.5\n\n### Patch Changes\n\n- [#92913](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/92913)\n  [`8f7e827e0978`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8f7e827e0978) -\n  Some Pragmatic drag and drop packages did not have `\"author\"` and or `\"license\"` attributes set in\n  their `package.json` file. These missing attributes have now been added where required.\n\n  ```diff\n  + \"author\": \"Atlassian Pty Ltd\",\n  + \"license\": \"Apache-2.0\",\n  ```\n\n  All Pragmatic drag and drop packages were already licensed under `Apache-2.0` (see `LICENSE`\n  files), but the `\"license\"` attribute in some `package.json` files was missing.\n\n## 1.0.4\n\n### Patch Changes\n\n- [#86309](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/86309)\n  [`1827ac58bb32`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1827ac58bb32) -\n  There were some cases where our visually hidden styles could case the page to slightly increase in\n  size. This has now been fixed.\n\n## 1.0.3\n\n### Patch Changes\n\n- [#84398](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84398)\n  [`77694db987fc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/77694db987fc) -\n  Public release of Pragmatic drag and drop documentation\n\n## 1.0.2\n\n### Patch Changes\n\n- [#83702](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83702)\n  [`4d9e25ab4eaa`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4d9e25ab4eaa) -\n  Updating the descriptions of Pragmatic drag and drop packages, so they each provide a consistent\n  description to various consumers, and so they are consistently formed amongst each other.\n  - `package.json` `description`\n  - `README.md`\n  - Website documentation\n\n## 1.0.1\n\n### Patch Changes\n\n- [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116)\n  [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) -\n  Upgrade Typescript from `4.9.5` to `5.4.2`\n\n## 1.0.0\n\n### Major Changes\n\n- [#70616](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70616)\n  [`42e57ea65fee`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/42e57ea65fee) -\n  This is our first `major` release (`1.0`) for all Pragmatic drag and drop packages.\n\n  For a detailed explanation of these changes, and how to upgrade (automatically) to `1.0` please\n  see our\n  [1.0 upgrade guide](http://atlassian.design/components/pragmatic-drag-and-drop/core-package/upgrade-guides/upgrade-guide-for-1.0)\n\n## 0.5.3\n\n### Patch Changes\n\n- [#34443](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34443)\n  [`61cb5313358`](https://bitbucket.org/atlassian/atlassian-frontend/commits/61cb5313358) - Removing\n  unused dependencies and dev dependencies\n\n## 0.5.2\n\n### Patch Changes\n\n- [#33793](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33793)\n  [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure\n  legacy types are published for TS 4.5-4.8\n\n## 0.5.1\n\n### Patch Changes\n\n- [#33649](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33649)\n  [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade\n  Typescript from `4.5.5` to `4.9.5`\n\n## 0.5.0\n\n### Minor Changes\n\n- [#33344](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33344)\n  [`9fd8556db17`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9fd8556db17) - Internal\n  folder name structure change\n\n## 0.4.0\n\n### Minor Changes\n\n- [#33262](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33262)\n  [`34ed7b2ec63`](https://bitbucket.org/atlassian/atlassian-frontend/commits/34ed7b2ec63) - We have\n  changed the name of our drag and drop packages to align on the single name of \"Pragmatic drag and\n  drop\"\n\n  ```diff\n  - @atlaskit/drag-and-drop\n  + @atlaskit/pragmatic-drag-and-drop\n\n  - @atlaskit/drag-and-drop-autoscroll\n  + @atlaskit/pragmatic-drag-and-drop-autoscroll\n\n  - @atlaskit/drag-and-drop-hitbox\n  + @atlaskit/pragmatic-drag-and-drop-hitbox\n\n  - @atlaskit/drag-and-drop-indicator\n  + @atlaskit/pragmatic-drag-and-drop-react-indicator\n  # Note: `react` was added to this package name as our indicator package is designed for usage with `react`.\n\n  - @atlaskit/drag-and-drop-live-region\n  + @atlaskit/pragmatic-drag-and-drop-live-region\n\n  - @atlaskit/drag-and-drop-react-beautiful-dnd-migration\n  + @atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration\n\n  - @atlaskit/drag-and-drop-docs\n  + @atlaskit/pragmatic-drag-and-drop-docs\n  ```\n\n  The new `@atlaskit/pragmatic-drag-and-drop*` packages will start their initial versions from where\n  the ``@atlaskit/drag-and-drop*` packages left off. Doing this will make it easier to look back on\n  changelogs and see how the packages have progressed.\n\n## 0.3.0\n\n### Minor Changes\n\n- [#33258](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33258)\n  [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip\n  minor dependency bump\n\n## 0.2.2\n\n### Patch Changes\n\n- [#28324](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/28324)\n  [`6455cf006b3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6455cf006b3) - Builds\n  for this package now pass through a tokens babel plugin, removing runtime invocations of the\n  tokens() function and improving performance.\n\n## 0.2.1\n\n### Patch Changes\n\n- [#24874](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24874)\n  [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade\n  Typescript from `4.3.5` to `4.5.5`\n\n## 0.2.0\n\n### Minor Changes\n\n- [#25485](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/25485)\n  [`5b37b07dc94`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5b37b07dc94) - Moving\n  from `@emotion/core@10` to `@emotion/react@11` to line up `@emotion` usage with the rest of the\n  Design System\n\n## 0.1.0\n\n### Minor Changes\n\n- [#24532](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24532)\n  [`73427c38077`](https://bitbucket.org/atlassian/atlassian-frontend/commits/73427c38077) - Initial\n  release of `@atlaskit/drag-and-drop` packages 🎉\n\n## 0.0.1\n\n### Patch Changes\n\n- [#24492](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24492)\n  [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade\n  Typescript from `4.2.4` to `4.3.5`.\n"
  },
  {
    "path": "packages/live-region/LICENSE.md",
    "content": "Copyright 2022 Atlassian Pty Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in\ncompliance with the License. You may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is\ndistributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\nimplied. See the License for the specific language governing permissions and limitations under the\nLicense.\n"
  },
  {
    "path": "packages/live-region/README.md",
    "content": "## Pragmatic drag and drop\n\nAn optional package for Pragmatic drag and drop that enables screen reader messaging for alternative flows.\n\n[📖 Documentation](https://atlassian.design/components/pragmatic-drag-and-drop/)\n"
  },
  {
    "path": "packages/live-region/__tests__/unit/announce.tsx",
    "content": "import { screen } from '@testing-library/dom';\n\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport * as liveRegion from '../../src';\nimport { announceDelay } from '../../src/constants';\n\njest.useFakeTimers();\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\ndescribe('announce', () => {\n\tbeforeEach(() => {\n\t\tliveRegion.cleanup();\n\t});\n\n\tit('should create a live region', () => {\n\t\tliveRegion.announce('a message');\n\t\texpect(screen.getByRole('status')).toBeInTheDocument();\n\t});\n\n\tit('should place the message inside of the live region after the announceDelay', () => {\n\t\tconst msg = 'a message';\n\t\tliveRegion.announce(msg);\n\t\tconst node = screen.getByRole('status');\n\t\texpect(node).not.toHaveTextContent(msg);\n\t\tjest.advanceTimersByTime(announceDelay);\n\t\texpect(node).toHaveTextContent(msg);\n\t});\n\n\tit('should reuse an existing live region', () => {\n\t\tliveRegion.announce('');\n\t\tconst node = screen.getByRole('status');\n\n\t\tconst msg1 = 'message #1';\n\t\tliveRegion.announce(msg1);\n\t\tjest.runOnlyPendingTimers();\n\t\texpect(node).toHaveTextContent(msg1);\n\n\t\tconst msg2 = 'message #2';\n\t\tliveRegion.announce(msg2);\n\t\tjest.runOnlyPendingTimers();\n\t\texpect(node).toHaveTextContent(msg2);\n\t});\n\n\tit('should not create more than one node at a time', () => {\n\t\tliveRegion.announce('one message');\n\t\tliveRegion.announce('two message');\n\t\tliveRegion.announce('red message');\n\t\tliveRegion.announce('blue message');\n\n\t\texpect(screen.getAllByRole('status')).toHaveLength(1);\n\t});\n\n\t// We might want to change this in the future, but this is capturing existing behavior\n\tit('should use the latest message', () => {\n\t\tliveRegion.announce('first');\n\t\tliveRegion.announce('second');\n\n\t\tjest.advanceTimersByTime(announceDelay);\n\t\texpect(screen.getByRole('status')).toHaveTextContent('second');\n\t});\n\n\t// We might want to change this in the future, but this is capturing existing behavior\n\tit('should clear pending messages, but still wait the full announceDelay', () => {\n\t\tliveRegion.announce('first');\n\n\t\tsetTimeout(() => {\n\t\t\tliveRegion.announce('second');\n\t\t}, announceDelay / 2);\n\n\t\tconst node = screen.getByRole('status');\n\n\t\tjest.advanceTimersByTime(announceDelay);\n\t\t// The queued first message was cleared by the second before it was shown\n\t\texpect(node).not.toHaveTextContent('first');\n\t\t// There has not been a full `announceDelay` since the second message was queued\n\t\texpect(node).not.toHaveTextContent('second');\n\n\t\t// Advancing by the delay we used to queue the second message\n\t\tjest.advanceTimersByTime(announceDelay / 2);\n\t\t// Now there has been a complete `announceDelay` since the second message was queued\n\t\texpect(node).toHaveTextContent('second');\n\t});\n});\n"
  },
  {
    "path": "packages/live-region/__tests__/unit/cleanup.tsx",
    "content": "import { screen } from '@testing-library/dom';\n\nimport * as liveRegion from '../../src';\n\njest.useFakeTimers();\n\ndescribe('cleanup', () => {\n\tit('should do nothing if a node does not exist', () => {\n\t\tconst snapshot = document.documentElement.outerHTML;\n\t\tliveRegion.cleanup();\n\t\texpect(document.documentElement.outerHTML).toEqual(snapshot);\n\t});\n\n\tit('should remove the live region node if it exists', () => {\n\t\tliveRegion.announce('a message');\n\t\tliveRegion.cleanup();\n\t\texpect(screen.queryByRole('status')).not.toBeInTheDocument();\n\t});\n\n\t// We might want to change this in the future, but this is capturing existing behavior\n\tit('should clear any pending messages', () => {\n\t\tliveRegion.announce('one message');\n\t\tliveRegion.cleanup();\n\n\t\t// The pending message is never announced\n\t\tjest.runAllTimers();\n\t\texpect(screen.queryByRole('status')).not.toBeInTheDocument();\n\t\texpect(screen.queryByText('one message')).not.toBeInTheDocument();\n\t});\n});\n"
  },
  {
    "path": "packages/live-region/__tests__/unit/dom.tsx",
    "content": "import { screen } from '@testing-library/dom';\n\nimport * as liveRegion from '../../src';\n\ndescribe('DOM node', () => {\n\tbeforeEach(() => {\n\t\tliveRegion.cleanup();\n\t});\n\n\tit('should have role=\"status\"', () => {\n\t\tliveRegion.announce('a message');\n\t\texpect(screen.getByRole('status')).toBeInTheDocument();\n\t});\n});\n"
  },
  {
    "path": "packages/live-region/afm-jira/tsconfig.json",
    "content": "{\n\t\"extends\": \"../../../../tsconfig.local-consumption.json\",\n\t\"compilerOptions\": {\n\t\t\"target\": \"es5\",\n\t\t\"outDir\": \"../../../../../jira/tsDist/@atlaskit__pragmatic-drag-and-drop-live-region/app\",\n\t\t\"rootDir\": \"../\",\n\t\t\"composite\": true,\n\t\t\"noCheck\": true\n\t},\n\t\"include\": [\n\t\t\"../src/**/*.ts\",\n\t\t\"../src/**/*.tsx\"\n\t],\n\t\"exclude\": [\n\t\t\"../src/**/__tests__/*\",\n\t\t\"../src/**/*.test.*\",\n\t\t\"../src/**/test.*\",\n\t\t\"../src/**/examples.*\",\n\t\t\"../src/**/examples/*\",\n\t\t\"../src/**/examples/**/*\",\n\t\t\"../src/**/*.stories.*\",\n\t\t\"../src/**/stories/*\",\n\t\t\"../src/**/stories/**/*\"\n\t],\n\t\"references\": []\n}\n"
  },
  {
    "path": "packages/live-region/afm-products/tsconfig.json",
    "content": "{\n\t\"extends\": \"../../../../tsconfig.local-consumption.json\",\n\t\"compilerOptions\": {\n\t\t\"target\": \"es5\",\n\t\t\"outDir\": \"../../../../../tsDist/@atlaskit__pragmatic-drag-and-drop-live-region/app\",\n\t\t\"rootDir\": \"../\",\n\t\t\"composite\": true,\n\t\t\"noCheck\": true\n\t},\n\t\"include\": [\n\t\t\"../src/**/*.ts\",\n\t\t\"../src/**/*.tsx\"\n\t],\n\t\"exclude\": [\n\t\t\"../src/**/__tests__/*\",\n\t\t\"../src/**/*.test.*\",\n\t\t\"../src/**/test.*\",\n\t\t\"../src/**/examples.*\",\n\t\t\"../src/**/examples/*\",\n\t\t\"../src/**/examples/**/*\",\n\t\t\"../src/**/*.stories.*\",\n\t\t\"../src/**/stories/*\",\n\t\t\"../src/**/stories/**/*\"\n\t],\n\t\"references\": []\n}\n"
  },
  {
    "path": "packages/live-region/constellation/index/about.mdx",
    "content": "---\norder: 0\ntitle: Live region\ndescription: An optional package for that enables screen reader messaging for alternative flows.\n---\n\nimport SectionMessage from '@atlaskit/section-message';\n\nThis package can be used to provide\n[post drop announcements](/components/pragmatic-drag-and-drop/accessibility-guidelines) for\nassistive technology users.\n\n<SectionMessage>\n\nThis package does not depend on any view library, or on any other `@atlaskit` package.\n\n</SectionMessage>\n\n## Announce a message\n\nThe `announce` function announces the provided message to assistive technology.\n\nInternally, a single live region will be created and reused across function calls. The live region\nis created with `role=\"alert\"`, equivalent to setting:\n\n- `aria-live=\"assertive\"`, meaning that messages will be announced immediately and interrupt any\n  message currently being announced.\n- `aria-atomic=\"true\"`, meaning that messages will always be read in full.\n\n```ts\nimport { announce } from '@atlaskit/pragmatic-drag-and-drop-live-region';\n\nannounce('Task \"Clean dishes\" moved to list \"Doing\" from \"Todo\".');\n```\n\n## Cleanup live region\n\nThe `cleanup` function will remove the live region created by announce from the DOM.\n\nIf a live region does not exist, no error will be thrown and nothing will happen. This means that\nthe function is safe to call optimistically.\n\n```ts\nimport { cleanup } from '@atlaskit/pragmatic-drag-and-drop-live-region';\n\ncleanup();\n```\n"
  },
  {
    "path": "packages/live-region/constellation/index/props.mdx",
    "content": "<!-- Turn off automatic prop extraction as there isn't anything to extract. -->\n"
  },
  {
    "path": "packages/live-region/examples/00-basic.tsx",
    "content": "import React, { useEffect } from 'react';\n\nimport { announce, cleanup } from '../src';\n\nexport default function BasicExample(): React.JSX.Element {\n\tuseEffect(() => {\n\t\tannounce('Test message');\n\t\treturn cleanup;\n\t}, []);\n\n\treturn <p>This page has a live region announcement but it is visually hidden.</p>;\n}\n"
  },
  {
    "path": "packages/live-region/examples/01-list-with-inline-buttons.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport React, { useCallback, useReducer } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport ButtonGroup from '@atlaskit/button/button-group';\nimport { IconButton } from '@atlaskit/button/new';\nimport ArrowDownIcon from '@atlaskit/icon/core/arrow-down';\nimport ArrowUpIcon from '@atlaskit/icon/core/arrow-up';\nimport { token } from '@atlaskit/tokens';\nimport Tooltip from '@atlaskit/tooltip';\n\nimport { announce } from '../src';\n\ntype ItemData = { id: string; label: string };\n\ntype Action = { type: 'MOVE_UP' | 'MOVE_DOWN'; id: string };\n\nconst defaultItems: ItemData[] = [\n\t{ id: 'item-a', label: 'Item A' },\n\t{ id: 'item-b', label: 'Item B' },\n\t{ id: 'item-c', label: 'Item C' },\n];\n\nconst listItemStyles = css({\n\tdisplay: 'flex',\n\tmaxWidth: 240,\n\tpadding: 8,\n\talignItems: 'center',\n\tbackground: token('elevation.surface.raised', '#FFF'),\n\tborderRadius: 3,\n\tboxShadow: token(\n\t\t'elevation.shadow.raised',\n\t\t'rgba(9, 30, 66, 0.25) 0px 1px 1px, rgba(9, 30, 66, 0.31) 0px 0px 1px',\n\t),\n});\n\nconst ListItem = ({\n\tchildren,\n\tid,\n\tisFirst,\n\tisLast,\n\tdispatch,\n}: {\n\tchildren: string;\n\tid: string;\n\tisFirst: boolean;\n\tisLast: boolean;\n\tdispatch: React.Dispatch<Action>;\n}) => {\n\tconst moveUp = useCallback(() => {\n\t\tdispatch({ type: 'MOVE_UP', id });\n\t}, [dispatch, id]);\n\n\tconst moveDown = useCallback(() => {\n\t\tdispatch({ type: 'MOVE_DOWN', id });\n\t}, [dispatch, id]);\n\n\treturn (\n\t\t<li css={listItemStyles}>\n\t\t\t{/* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 */}\n\t\t\t<strong style={{ flex: 1, padding: '0 8px' }}>{children}</strong>\n\t\t\t<ButtonGroup>\n\t\t\t\t<Tooltip content={`Move ${children} up`}>\n\t\t\t\t\t{(tooltipProps) => (\n\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t{...tooltipProps}\n\t\t\t\t\t\t\tonClick={moveUp}\n\t\t\t\t\t\t\ticon={ArrowUpIcon}\n\t\t\t\t\t\t\taria-disabled={isFirst}\n\t\t\t\t\t\t\tlabel=\"\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</Tooltip>\n\t\t\t\t<Tooltip content={`Move ${children} down`}>\n\t\t\t\t\t{(tooltipProps) => (\n\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\t{...tooltipProps}\n\t\t\t\t\t\t\tonClick={moveDown}\n\t\t\t\t\t\t\ticon={ArrowDownIcon}\n\t\t\t\t\t\t\taria-disabled={isLast}\n\t\t\t\t\t\t\tlabel=\"\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</Tooltip>\n\t\t\t</ButtonGroup>\n\t\t</li>\n\t);\n};\n\nconst reducer: React.Reducer<ItemData[], Action> = (state, action) => {\n\tconst index = state.findIndex((item) => item.id === action.id);\n\tconst item = state[index];\n\n\tlet nextState = [...state];\n\tswitch (action.type) {\n\t\tcase 'MOVE_UP':\n\t\t\tif (index === 0) {\n\t\t\t\treturn state;\n\t\t\t}\n\t\t\tnextState.splice(index, 1);\n\t\t\tnextState.splice(index - 1, 0, item);\n\t\t\tannounce(`${item.label} moved to position ${index} of ${state.length}`);\n\t\t\treturn nextState;\n\n\t\tcase 'MOVE_DOWN':\n\t\t\tif (index === state.length - 1) {\n\t\t\t\treturn state;\n\t\t\t}\n\t\t\tnextState.splice(index, 1);\n\t\t\tnextState.splice(index + 1, 0, item);\n\t\t\tannounce(`${item.label} moved to position ${index + 2} of ${state.length}`);\n\t\t\treturn nextState;\n\t}\n};\n\nexport default function App(): React.JSX.Element {\n\tconst [items, dispatch] = useReducer(reducer, defaultItems);\n\n\treturn (\n\t\t<div>\n\t\t\t{/* eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766 */}\n\t\t\t<ul style={{ display: 'flex', flexDirection: 'column', padding: 0 }}>\n\t\t\t\t{items.map(({ id, label }, index) => (\n\t\t\t\t\t<ListItem\n\t\t\t\t\t\tkey={id}\n\t\t\t\t\t\tid={id}\n\t\t\t\t\t\tdispatch={dispatch}\n\t\t\t\t\t\tisFirst={index === 0}\n\t\t\t\t\t\tisLast={index === items.length - 1}\n\t\t\t\t\t>\n\t\t\t\t\t\t{label}\n\t\t\t\t\t</ListItem>\n\t\t\t\t))}\n\t\t\t</ul>\n\t\t</div>\n\t);\n}\n"
  },
  {
    "path": "packages/live-region/examples/config.jsonc",
    "content": "/**\n * This file is used by the test scaling project to optimise test result caching\n * Examples that are used by tests affect the outcome of tests so must be included when hashing\n * They are defined here so the hashing algorithm doesn't need to search test files for example usage each time\n */\n{\n  \"testExamples\": [\n    \"00-basic.tsx\"\n  ],\n  \"exampleDependencies\": [\n    \"@emotion/react\",\n    \"react\"\n  ]\n}\n"
  },
  {
    "path": "packages/live-region/package.json",
    "content": "{\n  \"name\": \"@atlaskit/pragmatic-drag-and-drop-live-region\",\n  \"version\": \"1.3.3\",\n  \"description\": \"An optional package for Pragmatic drag and drop that enables screen reader messaging for alternative flows\",\n  \"publishConfig\": {\n    \"registry\": \"https://registry.npmjs.org/\"\n  },\n  \"repository\": \"https://github.com/atlassian/pragmatic-drag-and-drop\",\n  \"author\": \"Atlassian Pty Ltd\",\n  \"license\": \"Apache-2.0\",\n  \"main\": \"dist/cjs/index.js\",\n  \"module\": \"dist/esm/index.js\",\n  \"module:es2019\": \"dist/es2019/index.js\",\n  \"types\": \"dist/types/index.d.ts\",\n  \"sideEffects\": false,\n  \"dependencies\": {\n    \"@babel/runtime\": \"^7.0.0\"\n  },\n  \"devDependencies\": {\n    \"@emotion/react\": \"^11.7.1\",\n    \"@testing-library/dom\": \"^10.1.0\",\n    \"@testing-library/react\": \"^16.3.0\",\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"wait-for-expect\": \"^1.2.0\"\n  },\n  \"exports\": {\n    \".\": \"./src/index.tsx\"\n  },\n  \"homepage\": \"https://atlassian.design/components/pragmatic-drag-and-drop/\"\n}\n"
  },
  {
    "path": "packages/live-region/src/constants.tsx",
    "content": "/**\n * Delay until the text content of the live region is updated.\n *\n * This value was reached through some experimentation, and may need tweaking in the future.\n */\nexport const announceDelay = 1000;\n"
  },
  {
    "path": "packages/live-region/src/index.tsx",
    "content": "import { announceDelay } from './constants';\n\nlet node: HTMLElement | null = null;\n\nconst size = '1px';\n\nconst visuallyHiddenStyles = {\n\t// Standard visually hidden styles.\n\t// Copied from our VisuallyHidden (react) package.\n\twidth: size,\n\theight: size,\n\tpadding: '0',\n\tposition: 'absolute',\n\tborder: '0',\n\tclip: `rect(${size}, ${size}, ${size}, ${size})`,\n\toverflow: 'hidden',\n\twhiteSpace: 'nowrap',\n\t// Pulling upwards slightly to prevent the page\n\t// from growing when appended to a body that contains\n\t// an element with height:100%\n\tmarginTop: `-${size}`,\n\t// Just being safe and letting this element not interfere with hitboxes\n\tpointerEvents: 'none',\n};\n\n/**\n * Creates a live region node, appends it to the body, and returns it.\n */\nfunction createNode(): HTMLElement {\n\tconst node = document.createElement('div');\n\t/**\n\t * Using `role=\"status\"` instead of `role=\"alert\"` so that the message\n\t * can be queued and read when able.\n\t *\n\t * We found with `role=\"alert\"` the message was not reliably read when\n\t * focus changed.\n\t */\n\tnode.setAttribute('role', 'status');\n\tObject.assign(node.style, visuallyHiddenStyles);\n\tdocument.body.append(node);\n\treturn node;\n}\n\n/**\n * Returns the live region node, creating one if necessary.\n */\nfunction getNode(): HTMLElement {\n\tif (node === null) {\n\t\tnode = createNode();\n\t}\n\treturn node;\n}\n\nlet timerId: ReturnType<typeof setTimeout> | null = null;\n\nfunction tryClearTimer() {\n\tif (timerId !== null) {\n\t\tclearTimeout(timerId);\n\t}\n\ttimerId = null;\n}\n\n/**\n * Announces the provided message to assistive technology.\n */\nexport function announce(message: string): void {\n\t/**\n\t * Calling this immediately to ensure a node exists and has time to be parsed\n\t * and exposed in the accessibility tree.\n\t */\n\tgetNode();\n\n\t/**\n\t * Updating the message in a timeout so that it's less likely to be interrupted.\n\t *\n\t * This function is often called right before focus changes,\n\t * because the user has just taken an action.\n\t * This focus change would often cause the message to be skipped / interrupted.\n\t */\n\ttryClearTimer();\n\ttimerId = setTimeout(() => {\n\t\ttimerId = null;\n\t\tconst node = getNode();\n\t\tnode.textContent = message;\n\t}, announceDelay);\n\n\treturn;\n}\n\n/**\n * Removes the created live region. If there is no live region this is a no-op.\n */\nexport function cleanup(): void {\n\ttryClearTimer();\n\tnode?.remove();\n\tnode = null;\n}\n"
  },
  {
    "path": "packages/live-region/tsconfig.json",
    "content": "{\n  \"extends\": \"../../tsconfig.json\",\n  \"include\": [\n    \"__tests__/**/*.ts\",\n    \"__tests__/**/*.tsx\",\n    \"examples/**/*.ts\",\n    \"examples/**/*.tsx\",\n    \"src/**/*.ts\",\n    \"src/**/*.tsx\",\n    \"**/stories.ts\",\n    \"**/stories.tsx\",\n    \"**/stories/*.ts\",\n    \"**/stories/*.tsx\",\n    \"**/stories/**/*.ts\",\n    \"**/stories/**/*.tsx\"\n  ]\n}\n"
  },
  {
    "path": "packages/react-accessibility/.npmignore",
    "content": "src/\nexamples-utils/\nexamples/\nindex.ts\ndocs/\nbuild/\n__tests__/\ntsconfig.json\ntsconfig.app.json\ntsconfig.dev.json\n"
  },
  {
    "path": "packages/react-accessibility/CHANGELOG.md",
    "content": "# @atlaskit/pragmatic-drag-and-drop-react-accessibility\n\n## 2.2.6\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.2.5\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.2.4\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.2.3\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.2.2\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.2.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.2.0\n\n### Minor Changes\n\n- [`00e69e0b7c839`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/00e69e0b7c839) -\n  Clean up and removal of the `platform-visual-refresh-icons` feature flag.\n\n## 2.1.8\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.1.7\n\n### Patch Changes\n\n- [`d14ea5f60b689`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d14ea5f60b689) -\n  chore: migrate platform UI & component libraries icon imports from migration paths to core\n\n## 2.1.6\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.1.5\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.1.4\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.1.3\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.1.2\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.1.1\n\n### Patch Changes\n\n- [`806cfe1c4e6b7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/806cfe1c4e6b7) -\n  Internal changes to how border radius is applied.\n\n## 2.1.0\n\n### Minor Changes\n\n- [`3136f686a1929`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3136f686a1929) -\n  Updating `DragHandleButton` to use our new `DragHandleVerticalIcon`.\n\n  Deprecating `DragHandleButtonSmall`.\n\n  Rationale:\n  - `DragHandleButtonSmall` uses a tiny icon size that is no longer supported by our icon system\n    (the smallest icon size is now `12px` x `12px`)\n  - Icons smaller than `12px` x `12px` are not good for visibility and accessibility\n  - The small hitbox of `DragHandleButtonSmall` (`8px` x `16px`) is below our `24px` x `24px`\n    minimum hit target size for accessibility.\n    [More details](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html)\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.0.8\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.0.6\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.0.3\n\n### Patch Changes\n\n- [#125534](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/125534)\n  [`f135a8d1066c9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f135a8d1066c9) -\n  Updates the `react` peer dependency range to include React 19. While we expect these packages to\n  work with React 19, we do not test against and there is a small risk of issues. If you have any\n  problems, please raise an issue on [Github](https://github.com/atlassian/pragmatic-drag-and-drop).\n\n## 2.0.2\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.0.1\n\n### Patch Changes\n\n- [#120533](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/120533)\n  [`f1bec731e278f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f1bec731e278f) -\n  Adds a `sideEffects` field to ensure this package does not have Compiled styles tree-shaken in the\n  future to avoid an accidental regression.\n\n  This is related to\n  https://community.developer.atlassian.com/t/rfc-73-migrating-our-components-to-compiled-css-in-js/85953\n\n## 2.0.0\n\n### Major Changes\n\n- [#117363](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/117363)\n  [`10a0f7f6c2027`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/10a0f7f6c2027) -\n  This package's `peerDependencies` have been adjusted for `react` and/or `react-dom` to reflect the\n  status of only supporting React 18 going forward. No explicit breaking change to React support has\n  been made in this release, but this is to signify going forward, breaking changes for React 16 or\n  React 17 may come via non-major semver releases.\n\n  Please refer this community post for more details:\n  https://community.developer.atlassian.com/t/rfc-78-dropping-support-for-react-16-and-rendering-in-a-react-18-concurrent-root-in-jira-and-confluence/87026\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.3.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.3.0\n\n### Minor Changes\n\n- [#109060](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109060)\n  [`4660ec858a305`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4660ec858a305) -\n  Update `React` from v16 to v18\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.2.4\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.2.3\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.2.2\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.2.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.2.0\n\n### Minor Changes\n\n- [#150481](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/150481)\n  [`e750fb3633f6e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e750fb3633f6e) -\n  [ux] Enable new icons behind a feature flag.\n\n## 1.1.13\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.1.12\n\n### Patch Changes\n\n- [#134886](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/134886)\n  [`d477c8582713a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d477c8582713a) -\n  We are updating drag icon as part of visual refresh behind a feature gate.\n\n## 1.1.11\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.1.10\n\n### Patch Changes\n\n- [#124164](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/124164)\n  [`58941fa1d332a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/58941fa1d332a) -\n  All `react` unit tests will now run against `react@16` and `react@18` on CI.\n\n## 1.1.9\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.1.8\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.1.7\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.1.6\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.1.5\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.1.4\n\n### Patch Changes\n\n- [#107125](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/107125)\n  [`bba5df29ef98`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/bba5df29ef98) -\n  ts-ignore css prop error to unblock local consumption in jira\n\n## 1.1.3\n\n### Patch Changes\n\n- [#106643](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/106643)\n  [`66e90d5874ad`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/66e90d5874ad) -\n  Shifting icon color from `'color.icon.subtle'` (`Neutral700`) to `'color.text'` (`Neutral1000`) to\n  match standard icon button appearance and for improved accessibility.\n\n## 1.1.2\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.1.1\n\n### Patch Changes\n\n- [#88354](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/88354)\n  [`4c87d9b4f0c2`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4c87d9b4f0c2) -\n  The internal composition of this component has changed. There is no expected change in behavior.\n\n## 1.1.0\n\n### Minor Changes\n\n- [#87853](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87853)\n  [`54e884fd8d96`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/54e884fd8d96) -\n  Increasing `react` `peerDependency` range to include `react@17` and `react@18`.\n\n## 1.0.7\n\n### Patch Changes\n\n- [#84398](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84398)\n  [`77694db987fc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/77694db987fc) -\n  Public release of Pragmatic drag and drop documentation\n\n## 1.0.6\n\n### Patch Changes\n\n- [#84250](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84250)\n  [`a1cc31800621`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a1cc31800621) -\n  Internal refactor: now relying on automatic fallback insertion for `token()`. This change provides\n  an improved experience for consumers who don't have Atlassian Design tokens enabled.\n\n## 1.0.5\n\n### Patch Changes\n\n- [#83702](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83702)\n  [`4d9e25ab4eaa`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4d9e25ab4eaa) -\n  Updating the descriptions of Pragmatic drag and drop packages, so they each provide a consistent\n  description to various consumers, and so they are consistently formed amongst each other.\n  - `package.json` `description`\n  - `README.md`\n  - Website documentation\n\n## 1.0.4\n\n### Patch Changes\n\n- [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116)\n  [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) -\n  Upgrade Typescript from `4.9.5` to `5.4.2`\n\n## 1.0.3\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.0.2\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.0.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.0.0\n\n### Major Changes\n\n- [#70616](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70616)\n  [`42e57ea65fee`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/42e57ea65fee) -\n  This is our first `major` release (`1.0`) for all Pragmatic drag and drop packages.\n\n  For a detailed explanation of these changes, and how to upgrade (automatically) to `1.0` please\n  see our\n  [1.0 upgrade guide](http://atlassian.design/components/pragmatic-drag-and-drop/core-package/upgrade-guides/upgrade-guide-for-1.0)\n\n## 0.5.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.5.0\n\n### Minor Changes\n\n- [#59748](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/59748)\n  [`70d293a2f8b8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/70d293a2f8b8) -\n  Removed the `DragHandleDropdownMenu` and `DragHandleDropdownMenuSmall` exports. Composition with\n  `DropdownMenu` should be used instead.\n\n  This decision was made to avoid the risk of mismatched versions of `@atlaskit/dropdown-menu`,\n  which could occur when this package was bringing in a different version to the main one installed.\n  It is also preferable to encourage composition, which allows for greater flexibility and control\n  for consumers.\n\n  **Before**\n\n  ```tsx\n  import { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';\n  import { DragHandleDropdownMenu } from '@atlaskit/pragmatic-drag-and-drop-react-accessibility/drag-handle-dropdown-menu';\n\n  function MyComponent() {\n  \tconst myRef = useRef<HTMLButtonElement>(null);\n  \treturn (\n  \t\t<DragHandleDropdownMenu triggerRef={myRef} label=\"Reorder\">\n  \t\t\t<DropdownItemGroup>\n  \t\t\t\t<DropdownItem>Move up</DropdownItem>\n  \t\t\t\t<DropdownItem>Move down</DropdownItem>\n  \t\t\t</DropdownItemGroup>\n  \t\t</DragHandleDropdownMenu>\n  \t);\n  }\n  ```\n\n  **After**\n\n  ```tsx\n  import DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';\n  import mergeRefs from '@atlaskit/ds-lib/merge-refs';\n  import { DragHandleButton } from '@atlaskit/pragmatic-drag-and-drop-react-accessibility/drag-handle-button';\n\n  function MyComponent() {\n  \tconst myRef = useRef<HTMLButtonElement>(null);\n  \treturn (\n  \t\t<DropdownMenu\n  \t\t\ttrigger={({ triggerRef, ...triggerProps }) => (\n  \t\t\t\t<DragHandleButton\n  \t\t\t\t\tref={mergeRefs([myRef, triggerRef])}\n  \t\t\t\t\t{...triggerProps}\n  \t\t\t\t\tlabel=\"Reorder\"\n  \t\t\t\t/>\n  \t\t\t)}\n  \t\t>\n  \t\t\t<DropdownItemGroup>\n  \t\t\t\t<DropdownItem>Move up</DropdownItem>\n  \t\t\t\t<DropdownItem>Move down</DropdownItem>\n  \t\t\t</DropdownItemGroup>\n  \t\t</DropdownMenu>\n  \t);\n  }\n  ```\n\n## 0.4.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.4.0\n\n### Minor Changes\n\n- [#41296](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41296)\n  [`3e479ba1a4a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3e479ba1a4a) - [ux] The\n  drag handle icon now uses the `color.icon.subtle` token.\n- [#41296](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/41296)\n  [`ac64412c674`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ac64412c674) -\n  Introduced small variants of the drag handle button and drag handle dropdown menu.\n\n  These are intended for existing experiences with little space available to introduce a drag\n  handle. They are not recommended for general use.\n\n  These small variants can be accessed through the `/drag-handle-button-small` and\n  `/drag-handle-dropdown-menu-small` entrypoints.\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.3.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.3.0\n\n### Minor Changes\n\n- [#38144](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38144)\n  [`ee9aa9b7300`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ee9aa9b7300) - [ux] The\n  button now has `display: flex`\n\n## 0.2.0\n\n### Minor Changes\n\n- [#38115](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/38115)\n  [`ffb3e727aaf`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ffb3e727aaf) - The\n  `type` of the `DragHandleButton` now defaults to `'button'` (instead of `'submit'`)\n- [`9f5b56f5677`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9f5b56f5677) - The\n  `DragHandleButton` props now extend `ButtonHTMLAttributes` (instead of just `HTMLAttributes`)\n"
  },
  {
    "path": "packages/react-accessibility/LICENSE.md",
    "content": "Copyright 2023 Atlassian Pty Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in\ncompliance with the License. You may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is\ndistributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\nimplied. See the License for the specific language governing permissions and limitations under the\nLicense.\n"
  },
  {
    "path": "packages/react-accessibility/README.md",
    "content": "## Pragmatic drag and drop\n\nAn optional package for Pragmatic drag and drop containing `react` components to assist with setting up accessible experiences.\n\n[📖 Documentation](https://atlassian.design/components/pragmatic-drag-and-drop/)\n"
  },
  {
    "path": "packages/react-accessibility/__tests__/unit/ssr.tsx",
    "content": "import React from 'react';\n\nimport { doesHydrateWithSsr } from '@atlassian/ssr-tests';\n\nimport Example from '../../examples/drag-handle-button';\n\ntest('should ssr then hydrate correctly', async () => {\n\texpect(await doesHydrateWithSsr(<Example />)).toBe(true);\n});\n"
  },
  {
    "path": "packages/react-accessibility/afm-jira/tsconfig.json",
    "content": "{\n\t\"extends\": \"../../../../tsconfig.local-consumption.json\",\n\t\"compilerOptions\": {\n\t\t\"target\": \"es5\",\n\t\t\"outDir\": \"../../../../../jira/tsDist/@atlaskit__pragmatic-drag-and-drop-react-accessibility/app\",\n\t\t\"rootDir\": \"../\",\n\t\t\"composite\": true,\n\t\t\"noCheck\": true\n\t},\n\t\"include\": [\n\t\t\"../src/**/*.ts\",\n\t\t\"../src/**/*.tsx\"\n\t],\n\t\"exclude\": [\n\t\t\"../src/**/__tests__/*\",\n\t\t\"../src/**/*.test.*\",\n\t\t\"../src/**/test.*\",\n\t\t\"../src/**/examples.*\",\n\t\t\"../src/**/examples/*\",\n\t\t\"../src/**/examples/**/*\",\n\t\t\"../src/**/*.stories.*\",\n\t\t\"../src/**/stories/*\",\n\t\t\"../src/**/stories/**/*\"\n\t],\n\t\"references\": [\n\t\t{\n\t\t\t\"path\": \"../../../design-system/focus-ring/afm-jira/tsconfig.json\"\n\t\t},\n\t\t{\n\t\t\t\"path\": \"../../../design-system/icon/afm-jira/tsconfig.json\"\n\t\t},\n\t\t{\n\t\t\t\"path\": \"../../../platform/feature-flags/afm-jira/tsconfig.json\"\n\t\t},\n\t\t{\n\t\t\t\"path\": \"../../../design-system/primitives/afm-jira/tsconfig.json\"\n\t\t},\n\t\t{\n\t\t\t\"path\": \"../../../design-system/tokens/afm-jira/tsconfig.json\"\n\t\t}\n\t]\n}\n"
  },
  {
    "path": "packages/react-accessibility/afm-products/tsconfig.json",
    "content": "{\n\t\"extends\": \"../../../../tsconfig.local-consumption.json\",\n\t\"compilerOptions\": {\n\t\t\"target\": \"es5\",\n\t\t\"outDir\": \"../../../../../tsDist/@atlaskit__pragmatic-drag-and-drop-react-accessibility/app\",\n\t\t\"rootDir\": \"../\",\n\t\t\"composite\": true,\n\t\t\"noCheck\": true\n\t},\n\t\"include\": [\n\t\t\"../src/**/*.ts\",\n\t\t\"../src/**/*.tsx\"\n\t],\n\t\"exclude\": [\n\t\t\"../src/**/__tests__/*\",\n\t\t\"../src/**/*.test.*\",\n\t\t\"../src/**/test.*\",\n\t\t\"../src/**/examples.*\",\n\t\t\"../src/**/examples/*\",\n\t\t\"../src/**/examples/**/*\",\n\t\t\"../src/**/*.stories.*\",\n\t\t\"../src/**/stories/*\",\n\t\t\"../src/**/stories/**/*\"\n\t],\n\t\"references\": [\n\t\t{\n\t\t\t\"path\": \"../../../design-system/focus-ring/afm-products/tsconfig.json\"\n\t\t},\n\t\t{\n\t\t\t\"path\": \"../../../design-system/icon/afm-products/tsconfig.json\"\n\t\t},\n\t\t{\n\t\t\t\"path\": \"../../../platform/feature-flags/afm-products/tsconfig.json\"\n\t\t},\n\t\t{\n\t\t\t\"path\": \"../../../design-system/primitives/afm-products/tsconfig.json\"\n\t\t},\n\t\t{\n\t\t\t\"path\": \"../../../design-system/tokens/afm-products/tsconfig.json\"\n\t\t}\n\t]\n}\n"
  },
  {
    "path": "packages/react-accessibility/constellation/drag-handle-button/about.mdx",
    "content": "---\norder: 0\ntitle: Drag Handle Button\ndescription: A button styled to look like a drag handle\n---\n\nimport { Code } from '@atlaskit/code';\nimport SectionMessage from '@atlaskit/section-message';\n\nimport DragHandleButtonExample from '../../examples/drag-handle-button';\nimport DragHandleButtonSmallExample from '../../examples/drag-handle-button-small';\nimport DragHandleDropdownMenuExample from '../../examples/drag-handle-dropdown-menu';\n\n<SectionMessage appearance=\"warning\">\n\tThis component does not use the <Code>@atlaskit/button</Code> component, because{' '}\n\t<Code>@atlaskit/button</Code> cancels <Code>mousedown</Code> events and prevents dragging from\n\toccurring. Instead this component uses a native <Code>&lt;button&gt;</Code> element.\n</SectionMessage>\n\n## Default\n\n<Example Component={DragHandleButtonExample} />\n\n## Small variant (deprecated)\n\n<SectionMessage appearance=\"warning\">\n\nThe small variant has now been deprecated.\n\n- `DragHandleButtonSmall` uses a tiny icon size that is no longer supported by our icon system (the\n  smallest icon size is now `12px` x `12px`)\n- Icons smaller than `12px` x `12px` are not good for visibility and accessibility\n- The small hitbox of `DragHandleButtonSmall` (`8px` x `16px`) is below our `24px` x `24px` minimum\n  hit target size for accessibility.\n  [More details](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html)\n\n</SectionMessage>\n\nA small variant is available through the `/drag-handle-button-small` entrypoint.\n\nIt is intended for experiences with very limited space to accommodate a drag handle. It is not\nrecommended for general use due to the small target size.\n\n<Example Component={DragHandleButtonSmallExample} />\n\n## Dropdown menu\n\nThis component can be composed with [Dropdown menu](/components/dropdown-menu).\n\nBecause the Dropdown menu provides a `triggerRef` you will need to merge it with your own ref in\norder to use the trigger as the `dragHandle` in your `draggable()` registration.\n\n<Example Component={DragHandleDropdownMenuExample} />\n"
  },
  {
    "path": "packages/react-accessibility/constellation/drag-handle-button/props.mdx",
    "content": "---\norder: 1\ntitle: Drag Handle Button\ndescription: A button styled to look like a drag handle\nprops:\n  packageName: '@atlaskit/pragmatic-drag-and-drop-react-accessibility/drag-handle-button'\n  exports:\n    - DragHandleButton\n---\n\n## Props\n\n<TSMorphProps\n\texportName=\"DragHandleButton\"\n\tpackageName=\"@atlaskit/pragmatic-drag-and-drop-react-accessibility/drag-handle-button\"\n/>\n"
  },
  {
    "path": "packages/react-accessibility/constellation/index/about.mdx",
    "content": "---\norder: 0\ntitle: React accessibility\ndescription:\n  An optional package for Pragmatic drag and drop containing react components to assist with setting\n  up accessible experiences\n---\n\nimport SectionMessage from '@atlaskit/section-message';\n\n<SectionMessage>\n\nThis package depends on:\n\n- [the core package](/components/pragmatic-drag-and-drop/core-package)\n- [`react`](https://react.dev/)\n- [`@emotion/react`](https://emotion.sh/docs/introduction) for styling\n- Some Atlassian Design System packages\n\n<br />\n\nYou are welcome to reimplement this (small) package using your own tech stack.\n\n</SectionMessage>\n\n<SectionMessage title=\"React 19\" appearance='information'>\n\nWe expect this package to work with React 19 and have included it in the supported peer dependency\nrange.\n\nWe do not currently test against React 19 directly, so there is a small risk of issues. If you have\nany problems, please raise an issue on\n[Github](https://github.com/atlassian/pragmatic-drag-and-drop) and we can look into it.\n\n</SectionMessage>\n\n### Outputs\n\n- [drag-handle-button](/components/pragmatic-drag-and-drop/optional-packages/react-accessibility/drag-handle-button)\n"
  },
  {
    "path": "packages/react-accessibility/constellation/index/props.mdx",
    "content": "---\nprops:\n  packageName: '@atlaskit/pragmatic-drag-and-drop-react-accessibility/drag-handle-button'\n  exports:\n    - DragHandleButton\n---\n\n## Props\n\n### Drag Handle Button Props\n\n<TSMorphProps\n\texportName=\"DragHandleButton\"\n\tpackageName=\"@atlaskit/pragmatic-drag-and-drop-react-accessibility/drag-handle-button\"\n/>\n"
  },
  {
    "path": "packages/react-accessibility/examples/config.jsonc",
    "content": "/**\n * This file is used by the test scaling project to optimise test result caching\n * Examples that are used by tests affect the outcome of tests so must be included when hashing\n * They are defined here so the hashing algorithm doesn't need to search test files for example usage each time\n */\n{\n  \"testExamples\": [\n    \"drag-handle-button-small.tsx\",\n    \"drag-handle-button.tsx\"\n  ],\n  \"exampleDependencies\": [\n    \"@atlaskit/ds-lib\"\n  ]\n}\n"
  },
  {
    "path": "packages/react-accessibility/examples/drag-handle-button-small.tsx",
    "content": "import React from 'react';\n\nimport { DragHandleButtonSmall } from '../src/drag-handle-button-small';\n\nexport default function DragHandleButtonSmallExample(): React.JSX.Element {\n\treturn (\n\t\t<React.StrictMode>\n\t\t\t<DragHandleButtonSmall label=\"Reorder\" />\n\t\t</React.StrictMode>\n\t);\n}\n"
  },
  {
    "path": "packages/react-accessibility/examples/drag-handle-button.tsx",
    "content": "import React from 'react';\n\nimport { DragHandleButton } from '../src/drag-handle-button';\n\nexport default function DragHandleButtonExample(): React.JSX.Element {\n\treturn (\n\t\t<React.StrictMode>\n\t\t\t<DragHandleButton label=\"Reorder\" />\n\t\t</React.StrictMode>\n\t);\n}\n"
  },
  {
    "path": "packages/react-accessibility/examples/drag-handle-dropdown-menu.tsx",
    "content": "import React, { useRef } from 'react';\n\nimport DropdownMenu, { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';\n// eslint-disable-next-line @atlaskit/design-system/no-banned-imports\nimport mergeRefs from '@atlaskit/ds-lib/merge-refs';\n\nimport { DragHandleButton } from '../src/drag-handle-button';\n\nexport default function DragHandleDropdownMenuExample(): React.JSX.Element {\n\t// This ref can be used to set your `dragHandle` when calling `draggable()`\n\tconst myRef = useRef<HTMLButtonElement>(null);\n\n\treturn (\n\t\t<React.StrictMode>\n\t\t\t<DropdownMenu\n\t\t\t\ttrigger={({ triggerRef, ...triggerProps }) => (\n\t\t\t\t\t<DragHandleButton\n\t\t\t\t\t\tref={mergeRefs([myRef, triggerRef])}\n\t\t\t\t\t\t{...triggerProps}\n\t\t\t\t\t\tlabel=\"Reorder\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\tshouldRenderToParent\n\t\t\t>\n\t\t\t\t<DropdownItemGroup>\n\t\t\t\t\t<DropdownItem>Move up</DropdownItem>\n\t\t\t\t\t<DropdownItem>Move down</DropdownItem>\n\t\t\t\t</DropdownItemGroup>\n\t\t\t</DropdownMenu>\n\t\t</React.StrictMode>\n\t);\n}\n"
  },
  {
    "path": "packages/react-accessibility/extract-react-types/drag-handle-button.tsx",
    "content": "import type { DragHandleButtonProps } from '../src/types';\n\nexport default function ({}: DragHandleButtonProps) {}\n"
  },
  {
    "path": "packages/react-accessibility/package.json",
    "content": "{\n  \"name\": \"@atlaskit/pragmatic-drag-and-drop-react-accessibility\",\n  \"version\": \"2.2.6\",\n  \"description\": \"An optional package for Pragmatic drag and drop containing react components to assist with setting up accessible experiences\",\n  \"author\": \"Atlassian Pty Ltd\",\n  \"license\": \"Apache-2.0\",\n  \"publishConfig\": {\n    \"registry\": \"https://registry.npmjs.org/\"\n  },\n  \"repository\": \"https://github.com/atlassian/pragmatic-drag-and-drop\",\n  \"homepage\": \"https://atlassian.design/components/pragmatic-drag-and-drop/\",\n  \"main\": \"dist/cjs/index.js\",\n  \"module\": \"dist/esm/index.js\",\n  \"module:es2019\": \"dist/es2019/index.js\",\n  \"types\": \"dist/types/index.d.ts\",\n  \"sideEffects\": [\n    \"*.compiled.css\"\n  ],\n  \"exports\": {\n    \"./drag-handle-button\": \"./src/drag-handle-button.tsx\",\n    \"./drag-handle-button-small\": \"./src/drag-handle-button-small.tsx\"\n  },\n  \"dependencies\": {\n    \"@atlaskit/focus-ring\": \"^3.0.0\",\n    \"@atlaskit/icon\": \"^33.0.0\",\n    \"@atlaskit/platform-feature-flags\": \"^1.1.0\",\n    \"@atlaskit/primitives\": \"^18.0.0\",\n    \"@atlaskit/tokens\": \"^11.1.0\",\n    \"@babel/runtime\": \"^7.0.0\",\n    \"@emotion/react\": \"^11.7.1\"\n  },\n  \"peerDependencies\": {\n    \"react\": \"^18.2.0 || ^19.0.0\"\n  },\n  \"devDependencies\": {\n    \"@atlaskit/ds-lib\": \"^6.0.0\",\n    \"@testing-library/react\": \"^16.3.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"wait-for-expect\": \"^1.2.0\"\n  },\n  \"platform-feature-flags\": {\n    \"platform-component-visual-refresh\": {\n      \"type\": \"boolean\"\n    }\n  }\n}\n"
  },
  {
    "path": "packages/react-accessibility/src/drag-handle-button-base.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport { forwardRef } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx, type SerializedStyles } from '@emotion/react';\n\nimport FocusRing from '@atlaskit/focus-ring';\nimport { token } from '@atlaskit/tokens';\n\nimport type { DragHandleButtonProps } from './types';\n\n/**\n * Cannot use `@atlaskit/button` here because it cancels `mousedown` events\n * which prevents dragging.\n */\nconst buttonStyles = css({\n\tcolor: token('color.text'),\n\tborderRadius: token('radius.small'),\n\tpadding: token('space.0'),\n\twidth: 'max-content',\n\tborder: 'none',\n\tcursor: 'grab',\n\tdisplay: 'flex',\n});\n\nexport type DragHandleButtonAppearance = 'default' | 'subtle' | 'selected';\n\nconst buttonAppearanceStyles: Record<DragHandleButtonAppearance, SerializedStyles> = {\n\tdefault: css({\n\t\tbackgroundColor: token('color.background.neutral'),\n\t\t'&:hover': {\n\t\t\tbackgroundColor: token('color.background.neutral.hovered'),\n\t\t},\n\t\t'&:active': {\n\t\t\tbackgroundColor: token('color.background.neutral.pressed'),\n\t\t},\n\t}),\n\tsubtle: css({\n\t\tbackgroundColor: token('color.background.neutral.subtle'),\n\t\t'&:hover': {\n\t\t\tbackgroundColor: token('color.background.neutral.subtle.hovered'),\n\t\t},\n\t\t'&:active': {\n\t\t\tbackgroundColor: token('color.background.neutral.subtle.pressed'),\n\t\t},\n\t}),\n\tselected: css({\n\t\tbackgroundColor: token('color.background.selected'),\n\t\tcolor: token('color.text.selected'),\n\t}),\n};\n\n/**\n * A button with pre-configured styling to look like a drag handle.\n *\n * This component uses a native button because the `@atlaskit/button`\n * cancels `mouseDown` events, which prevents dragging.\n */\nexport const DragHandleButtonBase = forwardRef<\n\tHTMLButtonElement,\n\tOmit<DragHandleButtonProps, 'label'>\n>(function DragHandleButton(\n\t{\n\t\tchildren,\n\t\tisSelected = false,\n\t\ttestId,\n\t\tappearance: appearanceProp = 'default',\n\t\t/**\n\t\t * Defaulting to `button` instead of `submit` (native default in some cases).\n\t\t *\n\t\t * A type of `submit` only makes sense in a form context, and isn't very\n\t\t * relevant to a drag handle.\n\t\t *\n\t\t * `@atlaskit/button` also defaults to a type of `button` as well, as it\n\t\t * is more semantically appropriate in a wider range of cases.\n\t\t */\n\t\ttype = 'button',\n\t\t...buttonProps\n\t},\n\tref,\n) {\n\tconst appearance = isSelected ? 'selected' : appearanceProp;\n\n\treturn (\n\t\t<FocusRing>\n\t\t\t<button\n\t\t\t\tref={ref}\n\t\t\t\tcss={[buttonStyles, buttonAppearanceStyles[appearance]]}\n\t\t\t\tdata-testid={testId}\n\t\t\t\ttype={type}\n\t\t\t\t{...buttonProps}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</button>\n\t\t</FocusRing>\n\t);\n});\n"
  },
  {
    "path": "packages/react-accessibility/src/drag-handle-button-small.tsx",
    "content": "import React, { forwardRef } from 'react';\n\nimport DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';\nimport { fg } from '@atlaskit/platform-feature-flags';\n// eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss\nimport { Box, xcss } from '@atlaskit/primitives';\n\nimport { DragHandleButtonBase } from './drag-handle-button-base';\nimport type { DragHandleButtonProps } from './types';\n\nconst iconSmallStyles = xcss({\n\tdisplay: 'inline-flex',\n\tmarginInline: 'space.negative.050',\n});\n\nconst iconSmallStylesNew = xcss({\n\tdisplay: 'inline-flex',\n});\n\n// TODO: will run full deprecation process later. For now just want people to stop using this.\n// eslint-disable-next-line @repo/internal/deprecations/deprecation-ticket-required\n/**\n * A button with pre-configured styling to look like a drag handle.\n *\n * This component uses a native button because the `@atlaskit/button`\n * cancels `mouseDown` events, which prevents dragging.\n *\n * @deprecated Please use `DragHandleButton`.\n *\n * Rationale:\n *\n * - `DragHandleButtonSmall` uses a tiny icon size that is no longer supported by our icon system\n *   (the smallest icon size is now `12px` x `12px`)\n * - Icons smaller than `12px` x `12px` are not good for visibility and accessibility\n * - The small hitbox of `DragHandleButtonSmall` (`8px` x `16px`) is below our `24px` x `24px`\n *   minimum hit target size for accessibility. [More details](https://www.w3.org/WAI/WCAG22/Understanding/target-size-minimum.html)\n */\nexport const DragHandleButtonSmall = forwardRef<HTMLButtonElement, DragHandleButtonProps>(\n\tfunction DragHandleButton({ label, ...buttonProps }, ref) {\n\t\treturn (\n\t\t\t<DragHandleButtonBase ref={ref} {...buttonProps}>\n\t\t\t\t<Box xcss={fg('platform-component-visual-refresh') ? iconSmallStylesNew : iconSmallStyles}>\n\t\t\t\t\t{/* Relying on currentColor for color */}\n\t\t\t\t\t<DragHandleVerticalIcon color=\"currentColor\" label={label} size=\"small\" />\n\t\t\t\t</Box>\n\t\t\t</DragHandleButtonBase>\n\t\t);\n\t},\n);\n"
  },
  {
    "path": "packages/react-accessibility/src/drag-handle-button.tsx",
    "content": "import React, { forwardRef } from 'react';\n\nimport DragHandleVerticalIcon from '@atlaskit/icon/core/drag-handle-vertical';\n\nimport { DragHandleButtonBase } from './drag-handle-button-base';\nimport type { DragHandleButtonProps } from './types';\n\n/**\n * A button with pre-configured styling to look like a drag handle.\n *\n * This component uses a native button because the `@atlaskit/button`\n * cancels `mouseDown` events, which prevents dragging.\n */\nexport const DragHandleButton = forwardRef<HTMLButtonElement, DragHandleButtonProps>(\n\tfunction DragHandleButton({ label, ...buttonProps }, ref) {\n\t\treturn (\n\t\t\t<DragHandleButtonBase ref={ref} {...buttonProps}>\n\t\t\t\t<DragHandleVerticalIcon spacing=\"spacious\" label={label} size=\"small\" />\n\t\t\t</DragHandleButtonBase>\n\t\t);\n\t},\n);\n"
  },
  {
    "path": "packages/react-accessibility/src/index.tsx",
    "content": "/**\n * This file exists for module resolution purposes.\n */\nexport default {};\n"
  },
  {
    "path": "packages/react-accessibility/src/types.tsx",
    "content": "import type { ButtonHTMLAttributes } from 'react';\n\nexport type DragHandleButtonAppearance = 'default' | 'subtle' | 'selected';\n\nexport type DragHandleButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {\n\t/**\n\t * The base styling to apply to the button\n\t */\n\tappearance?: DragHandleButtonAppearance;\n\t/**\n\t * Text used to describe what the button is in context\n\t */\n\tlabel: string;\n\t/**\n\t * Change the style to indicate the button is selected\n\t */\n\tisSelected?: boolean;\n\t/**\n\t * A `testId` prop is provided for specified elements, which is a unique string\n\t * that appears as a data attribute `data-testid` in the rendered code,\n\t * serving as a hook for automated tests\n\t */\n\ttestId?: string;\n};\n\nexport type DragHandleIconProps = {\n\tlabel: string;\n};\n"
  },
  {
    "path": "packages/react-accessibility/tsconfig.json",
    "content": "{\n  \"extends\": \"../../tsconfig.json\",\n  \"include\": [\n    \"__tests__/**/*.ts\",\n    \"__tests__/**/*.tsx\",\n    \"docs/**/*.ts\",\n    \"docs/**/*.tsx\",\n    \"examples/**/*.ts\",\n    \"examples/**/*.tsx\",\n    \"src/**/*.ts\",\n    \"src/**/*.tsx\",\n    \"**/stories.ts\",\n    \"**/stories.tsx\",\n    \"**/stories/*.ts\",\n    \"**/stories/*.tsx\",\n    \"**/stories/**/*.ts\",\n    \"**/stories/**/*.tsx\"\n  ]\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/.npmignore",
    "content": "src/\nexamples-utils/\nexamples/\nindex.ts\ndocs/\nbuild/\n__tests__/\ntsconfig.json\ntsconfig.app.json\ntsconfig.dev.json\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/CHANGELOG.md",
    "content": "# @atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll\n\n## 2.0.2\n\n### Patch Changes\n\n- [`aa9ff75020fcb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/aa9ff75020fcb) -\n  Add @atlassian/a11y-jest-testing to devDependencies.\n\n## 2.0.1\n\n### Patch Changes\n\n- [#125534](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/125534)\n  [`56084060884c6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/56084060884c6) -\n  Removes React from the declared dependencies as they do not actually use it.\n- [#125534](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/125534)\n  [`ae44d864ac2ba`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ae44d864ac2ba) -\n  Removes `react` as a peer dependency as it is not actually used.\n\n## 2.0.0\n\n### Major Changes\n\n- [#117363](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/117363)\n  [`10a0f7f6c2027`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/10a0f7f6c2027) -\n  This package's `peerDependencies` have been adjusted for `react` and/or `react-dom` to reflect the\n  status of only supporting React 18 going forward. No explicit breaking change to React support has\n  been made in this release, but this is to signify going forward, breaking changes for React 16 or\n  React 17 may come via non-major semver releases.\n\n  Please refer this community post for more details:\n  https://community.developer.atlassian.com/t/rfc-78-dropping-support-for-react-16-and-rendering-in-a-react-18-concurrent-root-in-jira-and-confluence/87026\n\n## 1.2.1\n\n### Patch Changes\n\n- [#124164](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/124164)\n  [`58941fa1d332a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/58941fa1d332a) -\n  All `react` unit tests will now run against `react@16` and `react@18` on CI.\n\n## 1.2.0\n\n### Minor Changes\n\n- [#116572](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116572)\n  [`98c65e7ff719c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/98c65e7ff719c) -\n  🍯 Introducing \"the honey pot fix\" which is an improved workaround for a\n  [painful browser bug](https://issues.chromium.org/issues/41129937).\n\n  **Background**\n\n  The browser bug causes the browser to think the users pointer is continually depressed at the\n  point that the user started a drag. This could lead to incorrect events being triggered, and\n  incorrect styles being applied to elements that the user is not currently over during a drag.\n\n  **Outcomes**\n  - Elements will no longer receive `MouseEvent`s (eg `\"mouseenter\"` and `\"mouseleave\"`) during a\n    drag (which is a violation of the\n    [drag and drop specification](https://html.spec.whatwg.org/multipage/dnd.html#drag-and-drop-processing-model))\n  - Elements will no longer apply `:hover` or `:active` styles during a drag. Previously consumers\n    would need to disable these style rules during a drag to prevent these styles being applied.\n  - Dramatically improved post drop performance. Our prior solution could require a noticeable delay\n    due to a large style recalculation after a drop.\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.1.0\n\n### Minor Changes\n\n- [#87853](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87853)\n  [`54e884fd8d96`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/54e884fd8d96) -\n  Increasing `react` `peerDependency` range to include `react@17` and `react@18`.\n\n## 1.0.3\n\n### Patch Changes\n\n- [#84398](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84398)\n  [`77694db987fc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/77694db987fc) -\n  Public release of Pragmatic drag and drop documentation\n\n## 1.0.2\n\n### Patch Changes\n\n- [#83702](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83702)\n  [`4d9e25ab4eaa`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4d9e25ab4eaa) -\n  Updating the descriptions of Pragmatic drag and drop packages, so they each provide a consistent\n  description to various consumers, and so they are consistently formed amongst each other.\n  - `package.json` `description`\n  - `README.md`\n  - Website documentation\n\n## 1.0.1\n\n### Patch Changes\n\n- [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116)\n  [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) -\n  Upgrade Typescript from `4.9.5` to `5.4.2`\n\n## 1.0.0\n\n### Major Changes\n\n- [#70616](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70616)\n  [`42e57ea65fee`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/42e57ea65fee) -\n  This is our first `major` release (`1.0`) for all Pragmatic drag and drop packages.\n\n  For a detailed explanation of these changes, and how to upgrade (automatically) to `1.0` please\n  see our\n  [1.0 upgrade guide](http://atlassian.design/components/pragmatic-drag-and-drop/core-package/upgrade-guides/upgrade-guide-for-1.0)\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.6.6\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.6.5\n\n### Patch Changes\n\n- [#39935](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39935)\n  [`d9e36079257`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d9e36079257) - Updating\n  package information. No API or behaviour changes.\n- Updated dependencies\n\n## 0.6.4\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.6.3\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.6.2\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.6.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.6.0\n\n### Minor Changes\n\n- [#37394](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/37394)\n  [`75f89536e12`](https://bitbucket.org/atlassian/atlassian-frontend/commits/75f89536e12) - Renaming\n  this package from `@atlaskit/pragmatic-drag-and-drop-autoscroll` to\n  `@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll`.\n\n  This package is a port of the existing `react-beautiful-dnd` auto scroller that we will continue\n  to have as a separate package for usage with our `react-beautiful-dnd` → Pragmatic drag and drop\n  migration layer (`@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration`).\n\n  We are creating a new, more feature rich auto scroller which will soon be published as\n  `@atlaskit/pragmatic-drag-and-drop-autoscroll`\n\n## 0.5.4\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.5.3\n\n### Patch Changes\n\n- [#34443](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34443)\n  [`61cb5313358`](https://bitbucket.org/atlassian/atlassian-frontend/commits/61cb5313358) - Removing\n  unused dependencies and dev dependencies\n\n## 0.5.2\n\n### Patch Changes\n\n- [#33793](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33793)\n  [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure\n  legacy types are published for TS 4.5-4.8\n\n## 0.5.1\n\n### Patch Changes\n\n- [#33649](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33649)\n  [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade\n  Typescript from `4.5.5` to `4.9.5`\n\n## 0.5.0\n\n### Minor Changes\n\n- [#33344](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33344)\n  [`9fd8556db17`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9fd8556db17) - Internal\n  folder name structure change\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.4.0\n\n### Minor Changes\n\n- [#33262](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33262)\n  [`34ed7b2ec63`](https://bitbucket.org/atlassian/atlassian-frontend/commits/34ed7b2ec63) - We have\n  changed the name of our drag and drop packages to align on the single name of \"Pragmatic drag and\n  drop\"\n\n  ```diff\n  - @atlaskit/drag-and-drop\n  + @atlaskit/pragmatic-drag-and-drop\n\n  - @atlaskit/drag-and-drop-autoscroll\n  + @atlaskit/pragmatic-drag-and-drop-autoscroll\n\n  - @atlaskit/drag-and-drop-hitbox\n  + @atlaskit/pragmatic-drag-and-drop-hitbox\n\n  - @atlaskit/drag-and-drop-indicator\n  + @atlaskit/pragmatic-drag-and-drop-react-indicator\n  # Note: `react` was added to this package name as our indicator package is designed for usage with `react`.\n\n  - @atlaskit/drag-and-drop-live-region\n  + @atlaskit/pragmatic-drag-and-drop-live-region\n\n  - @atlaskit/drag-and-drop-react-beautiful-dnd-migration\n  + @atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration\n\n  - @atlaskit/drag-and-drop-docs\n  + @atlaskit/pragmatic-drag-and-drop-docs\n  ```\n\n  The new `@atlaskit/pragmatic-drag-and-drop*` packages will start their initial versions from where\n  the ``@atlaskit/drag-and-drop*` packages left off. Doing this will make it easier to look back on\n  changelogs and see how the packages have progressed.\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.3.0\n\n### Minor Changes\n\n- [#33258](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33258)\n  [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip\n  minor dependency bump\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.2.5\n\n### Patch Changes\n\n- [#32424](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32424)\n  [`2e01c9c74b5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e01c9c74b5) - DUMMY\n  remove before merging to master; dupe adf-schema via adf-utils\n\n## 0.2.4\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.2.3\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.2.2\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.2.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.2.0\n\n### Minor Changes\n\n- [#30756](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/30756)\n  [`1bfcde9828c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1bfcde9828c) - Adds a\n  `behavior` option to the auto scroller. This allows for finer control over window and container\n  scrolling precedence.\n\n  ```ts\n  type ScrollBehavior =\n  \t| 'window-then-container'\n  \t| 'container-then-window'\n  \t| 'window-only'\n  \t| 'container-only';\n  ```\n\n  - `window-then-container`: Attempt to scroll the window, then attempt to scroll the container if\n    window scroll not possible\n  - `container-then-window`: Attempt to scroll the container, then attempt to scroll the window if\n    container scroll not possible\n  - `container-only`: Only attempt to scroll the window\n  - `window-only`: Only attempt to scroll the window\n\n  Example:\n\n  ```ts\n  autoScroller.start({\n    input: /* ... */,\n    scrollBehavior: 'container-then-window'\n  });\n  ```\n\n## 0.1.13\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.1.12\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.1.11\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.1.10\n\n### Patch Changes\n\n- [#28324](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/28324)\n  [`6455cf006b3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6455cf006b3) - Builds\n  for this package now pass through a tokens babel plugin, removing runtime invocations of the\n  tokens() function and improving performance.\n\n## 0.1.9\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.1.8\n\n### Patch Changes\n\n- [#24874](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24874)\n  [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade\n  Typescript from `4.3.5` to `4.5.5`\n\n## 0.1.7\n\n### Patch Changes\n\n- [#25485](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/25485)\n  [`32d7630d1aa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/32d7630d1aa) - Updating\n  @emotion dev dependency\n\n## 0.1.6\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.1.5\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.1.4\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.1.3\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.1.2\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.1.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.1.0\n\n### Minor Changes\n\n- [#24532](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24532)\n  [`73427c38077`](https://bitbucket.org/atlassian/atlassian-frontend/commits/73427c38077) - Initial\n  release of `@atlaskit/drag-and-drop` packages 🎉\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.0.1\n\n### Patch Changes\n\n- [#24492](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24492)\n  [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade\n  Typescript from `4.2.4` to `4.3.5`.\n- Updated dependencies\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/LICENSE.md",
    "content": "Copyright 2022 Atlassian Pty Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in\ncompliance with the License. You may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is\ndistributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\nimplied. See the License for the specific language governing permissions and limitations under the\nLicense.\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/README.md",
    "content": "## Pragmatic drag and drop\n\n> ⚠️ We do not recommend the usage of this package. Please use our [new auto scroller package](../auto-scroll). We plan on deprecating this package.\n\nAn optional package for Pragmatic drag and drop that enables automatic scrolling during a drag operation. This package is a port of the [`react-beautiful-dnd`](https://github.com/atlassian/react-beautiful-dnd) auto scroller.\n\n[📖 Documentation](https://atlassian.design/components/pragmatic-drag-and-drop/)\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/__tests__/unit/_util.tsx",
    "content": "import type { Input } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nexport function getDefaultInput(overrides: Partial<Input> = {}): Input {\n\tconst defaults: Input = {\n\t\t// user input\n\t\taltKey: false,\n\t\tbutton: 0,\n\t\tbuttons: 0,\n\t\tctrlKey: false,\n\t\tmetaKey: false,\n\t\tshiftKey: false,\n\n\t\t// coordinates\n\t\tclientX: 0,\n\t\tclientY: 0,\n\t\tpageX: 0,\n\t\tpageY: 0,\n\t};\n\n\treturn {\n\t\t...defaults,\n\t\t...overrides,\n\t};\n}\n\nexport function getRect(box: {\n\ttop: number;\n\tbottom: number;\n\tleft: number;\n\tright: number;\n}): DOMRect {\n\treturn {\n\t\ttop: box.top,\n\t\tright: box.right,\n\t\tbottom: box.bottom,\n\t\tleft: box.left,\n\t\t// calculated\n\t\theight: box.bottom - box.top,\n\t\twidth: box.right - box.left,\n\t\tx: box.left,\n\t\ty: box.top,\n\t\ttoJSON: function () {\n\t\t\treturn JSON.stringify(this);\n\t\t},\n\t};\n}\n\n// usage: const [A, B, C, D, F] = getElements();\nexport function getElements(tagName: keyof HTMLElementTagNameMap = 'div'): Iterable<Element> {\n\tconst iterator = {\n\t\tnext() {\n\t\t\treturn {\n\t\t\t\tdone: false,\n\t\t\t\tvalue: document.createElement(tagName),\n\t\t\t};\n\t\t},\n\t\t[Symbol.iterator]() {\n\t\t\treturn iterator;\n\t\t},\n\t};\n\treturn iterator;\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/__tests__/unit/auto-scrolling.spec.ts",
    "content": "import { replaceRaf, type Stub } from 'raf-stub';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { autoScroller } from '../../src';\nimport config from '../../src/internal/config';\nimport { minScroll } from '../../src/internal/constants';\n\nimport { getDefaultInput, getRect } from './_util';\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\ndescribe('autoScroller', () => {\n\treplaceRaf();\n\n\tconst requestAnimationFrame = window.requestAnimationFrame as any as Stub;\n\tconst maxScroll = config.maxPixelScroll;\n\tconst scrollElement = jest.fn();\n\tconst scrollWindow = jest.fn();\n\n\t/*\n    Container: 100px x 100px\n    Example: vertical auto scrolling\n    |----------------------------------|\n    |  maxScrollValueAt (5px)          | => max scroll value in this range\n    |----------------------------------|\n    |  startScrollingFrom (25px)       |\n    |----------------------------------|\n    |                                  |\n    |                                  | => no scroll in this range\n    |                                  |\n    |----------------------------------|\n    |  startScrollingFrom (75px)       | => increased scroll value the closer to maxScrollValueAt\n    |----------------------------------|\n    |   maxScrollValueAt (95px)        | => max scroll value in this range\n    |----------------------------------|\n  */\n\tconst setScrollableMock = (currentScrollY = 0) => {\n\t\tconst clientWidth = 200;\n\t\tconst clientHeight = 200;\n\t\tconst defaultScroll = {\n\t\t\tcurrent: { x: 0, y: currentScrollY },\n\t\t\tmax: { x: 500, y: 500 },\n\t\t};\n\t\tconst scrollableRect = { top: 0, bottom: 100, left: 0, right: 100 };\n\t\tconst scrollableMock = document.createElement('div');\n\t\tscrollableMock.style.overflowX = 'auto';\n\t\tscrollableMock.scrollBy = scrollElement;\n\t\tscrollableMock.getBoundingClientRect = () => getRect(scrollableRect);\n\t\tscrollableMock.scrollLeft = defaultScroll.current.x;\n\t\tscrollableMock.scrollTop = defaultScroll.current.y;\n\n\t\tconst scrollWidthSpy = jest\n\t\t\t.spyOn(scrollableMock, 'scrollWidth', 'get')\n\t\t\t.mockImplementation(() => defaultScroll.max.x + clientWidth);\n\t\tconst scrollHeightSpy = jest\n\t\t\t.spyOn(scrollableMock, 'scrollHeight', 'get')\n\t\t\t.mockImplementation(() => defaultScroll.max.y + clientHeight);\n\t\tconst clientWidthSpy = jest\n\t\t\t.spyOn(scrollableMock, 'clientWidth', 'get')\n\t\t\t.mockImplementation(() => clientWidth);\n\t\tconst clientHeightSpy = jest\n\t\t\t.spyOn(scrollableMock, 'clientHeight', 'get')\n\t\t\t.mockImplementation(() => clientHeight);\n\n\t\tconst originalElementFromPoint = document.elementFromPoint;\n\t\tconst originalElementsFromPoint = document.elementsFromPoint;\n\t\tdocument.elementFromPoint = () => scrollableMock;\n\t\tdocument.elementsFromPoint = () => [scrollableMock];\n\n\t\treturn () => {\n\t\t\tdocument.elementFromPoint = originalElementFromPoint;\n\t\t\tdocument.elementsFromPoint = originalElementsFromPoint;\n\n\t\t\tscrollWidthSpy.mockReset();\n\t\t\tscrollHeightSpy.mockReset();\n\t\t\tclientWidthSpy.mockReset();\n\t\t\tclientHeightSpy.mockReset();\n\t\t};\n\t};\n\n\tconst tick = (timeIncrease: number = 0) => {\n\t\tDate.now = () => timeIncrease;\n\t\trequestAnimationFrame.step();\n\t};\n\n\tconst setDateNowMock = () => {\n\t\tconst originalNow = Date.now;\n\t\tDate.now = () => 0;\n\n\t\treturn () => {\n\t\t\tDate.now = originalNow;\n\t\t\trequestAnimationFrame.reset();\n\t\t};\n\t};\n\n\tconst setWindowScrollMock = () => {\n\t\tconst originalWindowScrollBy = window.scrollBy;\n\t\twindow.scrollBy = scrollWindow;\n\t\treturn () => {\n\t\t\twindow.scrollBy = originalWindowScrollBy;\n\t\t};\n\t};\n\n\tconst setViewportMock = (scrollHeight = 500) => {\n\t\tconst doc = document.createElement('document');\n\n\t\tconst clientWidthSpy = jest.spyOn(doc, 'clientWidth', 'get').mockImplementation(() => 100);\n\t\tconst clientHeightSpy = jest.spyOn(doc, 'clientHeight', 'get').mockImplementation(() => 100);\n\t\tconst scrollWidthSpy = jest.spyOn(doc, 'scrollWidth', 'get').mockImplementation(() => 500);\n\t\tconst scrollHeightSpy = jest\n\t\t\t.spyOn(doc, 'scrollHeight', 'get')\n\t\t\t.mockImplementation(() => scrollHeight);\n\t\tconst documentSpy = jest\n\t\t\t.spyOn(document, 'documentElement', 'get')\n\t\t\t.mockImplementation(() => doc);\n\n\t\treturn () => {\n\t\t\tscrollWidthSpy.mockReset();\n\t\t\tscrollHeightSpy.mockReset();\n\t\t\tclientWidthSpy.mockReset();\n\t\t\tclientHeightSpy.mockReset();\n\t\t\tdocumentSpy.mockReset();\n\t\t};\n\t};\n\n\tconst scenarios = [\n\t\t{\n\t\t\tname: 'scrollElement',\n\t\t\ttarget: 'closestScrollable',\n\t\t\tsetupMocks: () => combine(setScrollableMock(), setDateNowMock()),\n\t\t\tscrollMock: scrollElement,\n\t\t},\n\t\t{\n\t\t\tname: 'scrollWindow',\n\t\t\ttarget: 'window',\n\t\t\tsetupMocks: () =>\n\t\t\t\tcombine(setScrollableMock(), setDateNowMock(), setWindowScrollMock(), setViewportMock()),\n\t\t\tscrollMock: scrollWindow,\n\t\t},\n\t];\n\n\tafterAll(() => {\n\t\trequestAnimationFrame.reset();\n\t});\n\n\tscenarios.forEach((scenario) => {\n\t\tdescribe(scenario.name, () => {\n\t\t\tlet cleanup = () => {};\n\n\t\t\tbeforeEach(() => {\n\t\t\t\tcleanup = scenario.setupMocks();\n\t\t\t});\n\n\t\t\tafterEach(() => {\n\t\t\t\tjest.resetAllMocks();\n\t\t\t\tautoScroller.stop();\n\t\t\t\tcleanup();\n\t\t\t});\n\n\t\t\tconst scroll = scenario.scrollMock;\n\n\t\t\tit(`should not scroll ${scenario.target} on start()`, () => {\n\t\t\t\tautoScroller.start({ input: getDefaultInput() });\n\t\t\t\texpect(scroll).toHaveBeenCalledTimes(0);\n\t\t\t});\n\n\t\t\tdescribe('start/stop API methods', () => {\n\t\t\t\tit(`should not scroll ${scenario.target} if stop() is called in the same frame`, () => {\n\t\t\t\t\tautoScroller.start({\n\t\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 50, clientY: 75 },\n\t\t\t\t\t});\n\t\t\t\t\tautoScroller.stop();\n\t\t\t\t\ttick();\n\n\t\t\t\t\texpect(scroll).toHaveBeenCalledTimes(0);\n\t\t\t\t});\n\n\t\t\t\tit(`should scroll ${scenario.target} in every rAf frame until stop() is called`, () => {\n\t\t\t\t\tautoScroller.start({\n\t\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 50, clientY: 75 },\n\t\t\t\t\t}); // nothing\n\n\t\t\t\t\ttick(); // 1st\n\t\t\t\t\ttick(); // 2nd\n\t\t\t\t\ttick(); // 3rd\n\t\t\t\t\tautoScroller.stop();\n\t\t\t\t\ttick(); // nothing\n\n\t\t\t\t\texpect(scroll).toHaveBeenCalledTimes(3);\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tdescribe('vertical scrolling scenarios', () => {\n\t\t\t\tit(`should not scroll ${scenario.target} if element is lifted in the middle`, () => {\n\t\t\t\t\tautoScroller.start({\n\t\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 50, clientY: 50 },\n\t\t\t\t\t});\n\t\t\t\t\ttick();\n\n\t\t\t\t\texpect(scroll).toHaveBeenCalledTimes(0);\n\t\t\t\t});\n\n\t\t\t\tit(`should not scroll ${scenario.target} if element is lifted 1px before the boundary of the scrollable area`, () => {\n\t\t\t\t\tautoScroller.start({\n\t\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 50, clientY: 74 },\n\t\t\t\t\t});\n\t\t\t\t\ttick();\n\n\t\t\t\t\texpect(scroll).toHaveBeenCalledTimes(0);\n\t\t\t\t});\n\n\t\t\t\tit(`should not scroll ${scenario.target} if element is lifted in the middle and moved 1px before the boundary`, () => {\n\t\t\t\t\tautoScroller.start({\n\t\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 50, clientY: 50 },\n\t\t\t\t\t});\n\t\t\t\t\ttick();\n\t\t\t\t\texpect(scroll).toHaveBeenCalledTimes(0);\n\t\t\t\t\tautoScroller.updateInput({\n\t\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 50, clientY: 74 },\n\t\t\t\t\t});\n\t\t\t\t\ttick();\n\t\t\t\t\texpect(scroll).toHaveBeenCalledTimes(0);\n\t\t\t\t});\n\n\t\t\t\tit(`should scroll ${scenario.target} by min value if element is lifted at the boundary of the scrollable area`, () => {\n\t\t\t\t\tautoScroller.start({\n\t\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 50, clientY: 75 },\n\t\t\t\t\t});\n\t\t\t\t\ttick(config.durationDampening.stopDampeningAt);\n\n\t\t\t\t\texpect(scroll).toHaveBeenCalledTimes(1);\n\t\t\t\t\texpect(scroll).toHaveBeenNthCalledWith(1, 0, minScroll);\n\t\t\t\t});\n\n\t\t\t\tit(`should scroll ${scenario.target} by some amount if element is lifted in the scrollable area, after time dampening is finished`, () => {\n\t\t\t\t\tautoScroller.start({\n\t\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 50, clientY: 85 },\n\t\t\t\t\t});\n\t\t\t\t\ttick(config.durationDampening.stopDampeningAt);\n\n\t\t\t\t\texpect(scroll).toHaveBeenCalledTimes(1);\n\t\t\t\t\texpect(scroll).toHaveBeenNthCalledWith(1, 0, 7);\n\t\t\t\t});\n\n\t\t\t\tit(`should scroll ${scenario.target} by max value if element is lifted close to the edge of the scrollable area after time dampening is finished`, () => {\n\t\t\t\t\tautoScroller.start({\n\t\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 50, clientY: 95 },\n\t\t\t\t\t});\n\t\t\t\t\ttick(config.durationDampening.stopDampeningAt);\n\n\t\t\t\t\texpect(scroll).toHaveBeenCalledTimes(1);\n\t\t\t\t\texpect(scroll).toHaveBeenNthCalledWith(1, 0, config.maxPixelScroll);\n\t\t\t\t});\n\n\t\t\t\tdescribe('time dampening', () => {\n\t\t\t\t\tit('should not dampen scrolling when lifted outside of the scrollable area', () => {\n\t\t\t\t\t\tautoScroller.start({\n\t\t\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 50, clientY: 50 },\n\t\t\t\t\t\t});\n\t\t\t\t\t\ttick();\n\t\t\t\t\t\texpect(scroll).toHaveBeenCalledTimes(0);\n\t\t\t\t\t\tautoScroller.updateInput({\n\t\t\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 50, clientY: 95 },\n\t\t\t\t\t\t});\n\t\t\t\t\t\ttick();\n\t\t\t\t\t\texpect(scroll).toHaveBeenNthCalledWith(1, 0, maxScroll);\n\n\t\t\t\t\t\ttick(config.durationDampening.accelerateAt + 300);\n\t\t\t\t\t\texpect(scroll).toHaveBeenNthCalledWith(2, 0, maxScroll);\n\n\t\t\t\t\t\ttick(config.durationDampening.accelerateAt + 400);\n\t\t\t\t\t\texpect(scroll).toHaveBeenNthCalledWith(3, 0, maxScroll);\n\n\t\t\t\t\t\ttick(config.durationDampening.accelerateAt + 500);\n\t\t\t\t\t\texpect(scroll).toHaveBeenNthCalledWith(4, 0, maxScroll);\n\t\t\t\t\t});\n\n\t\t\t\t\tit('should accelerate scroll over time when element is lifted in the scrollable area', () => {\n\t\t\t\t\t\tautoScroller.start({\n\t\t\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 50, clientY: 95 },\n\t\t\t\t\t\t});\n\t\t\t\t\t\ttick();\n\t\t\t\t\t\texpect(scroll).toHaveBeenNthCalledWith(1, 0, 1);\n\n\t\t\t\t\t\ttick(config.durationDampening.accelerateAt + 300);\n\t\t\t\t\t\texpect(scroll).toHaveBeenNthCalledWith(2, 0, 4);\n\n\t\t\t\t\t\ttick(config.durationDampening.accelerateAt + 400);\n\t\t\t\t\t\texpect(scroll).toHaveBeenNthCalledWith(3, 0, 7);\n\n\t\t\t\t\t\ttick(config.durationDampening.accelerateAt + 500);\n\t\t\t\t\t\texpect(scroll).toHaveBeenNthCalledWith(4, 0, 10);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tdescribe('horizontal scrolling scenarios', () => {\n\t\t\t\tit(`should not scroll ${scenario.target} if element is lifted 1px before the boundary of the scrollable area`, () => {\n\t\t\t\t\tautoScroller.start({\n\t\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 74, clientY: 50 },\n\t\t\t\t\t});\n\t\t\t\t\ttick();\n\n\t\t\t\t\texpect(scroll).toHaveBeenCalledTimes(0);\n\t\t\t\t});\n\n\t\t\t\tit(`should not scroll ${scenario.target} if element is lifted in the middle and moved 1px before the boundary`, () => {\n\t\t\t\t\tautoScroller.start({\n\t\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 50, clientY: 50 },\n\t\t\t\t\t});\n\t\t\t\t\ttick();\n\t\t\t\t\texpect(scroll).toHaveBeenCalledTimes(0);\n\t\t\t\t\tautoScroller.updateInput({\n\t\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 74, clientY: 50 },\n\t\t\t\t\t});\n\t\t\t\t\ttick();\n\t\t\t\t\texpect(scroll).toHaveBeenCalledTimes(0);\n\t\t\t\t});\n\n\t\t\t\tit(`should scroll ${scenario.target} by min value if element is lifted at the boundary of the scrollable area`, () => {\n\t\t\t\t\tautoScroller.start({\n\t\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 75, clientY: 50 },\n\t\t\t\t\t});\n\t\t\t\t\ttick(config.durationDampening.stopDampeningAt);\n\n\t\t\t\t\texpect(scroll).toHaveBeenCalledTimes(1);\n\t\t\t\t\texpect(scroll).toHaveBeenNthCalledWith(1, minScroll, 0);\n\t\t\t\t});\n\n\t\t\t\tit(`should scroll ${scenario.target} by some amount if element is lifted in the scrollable area, after time dampening is finished`, () => {\n\t\t\t\t\tautoScroller.start({\n\t\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 85, clientY: 50 },\n\t\t\t\t\t});\n\t\t\t\t\ttick(config.durationDampening.stopDampeningAt);\n\n\t\t\t\t\texpect(scroll).toHaveBeenCalledTimes(1);\n\t\t\t\t\texpect(scroll).toHaveBeenNthCalledWith(1, 7, 0);\n\t\t\t\t});\n\n\t\t\t\tit(`should scroll ${scenario.target} by max value if element is lifted close to the edge of the scrollable area after time dampening is finished`, () => {\n\t\t\t\t\tautoScroller.start({\n\t\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 95, clientY: 50 },\n\t\t\t\t\t});\n\t\t\t\t\ttick(config.durationDampening.stopDampeningAt);\n\n\t\t\t\t\texpect(scroll).toHaveBeenCalledTimes(1);\n\t\t\t\t\texpect(scroll).toHaveBeenNthCalledWith(1, config.maxPixelScroll, 0);\n\t\t\t\t});\n\n\t\t\t\tdescribe('time dampening', () => {\n\t\t\t\t\tit('should not dampen scrolling when lifted outside of the scrollable area', () => {\n\t\t\t\t\t\tautoScroller.start({\n\t\t\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 50, clientY: 50 },\n\t\t\t\t\t\t});\n\t\t\t\t\t\ttick();\n\t\t\t\t\t\texpect(scroll).toHaveBeenCalledTimes(0);\n\t\t\t\t\t\tautoScroller.updateInput({\n\t\t\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 95, clientY: 50 },\n\t\t\t\t\t\t});\n\t\t\t\t\t\ttick();\n\t\t\t\t\t\texpect(scroll).toHaveBeenNthCalledWith(1, maxScroll, 0);\n\n\t\t\t\t\t\ttick(config.durationDampening.accelerateAt + 300);\n\t\t\t\t\t\texpect(scroll).toHaveBeenNthCalledWith(2, maxScroll, 0);\n\n\t\t\t\t\t\ttick(config.durationDampening.accelerateAt + 400);\n\t\t\t\t\t\texpect(scroll).toHaveBeenNthCalledWith(3, maxScroll, 0);\n\n\t\t\t\t\t\ttick(config.durationDampening.accelerateAt + 500);\n\t\t\t\t\t\texpect(scroll).toHaveBeenNthCalledWith(4, maxScroll, 0);\n\t\t\t\t\t});\n\n\t\t\t\t\tit('should accelerate scroll over time when element is lifted in the scrollable area', () => {\n\t\t\t\t\t\tautoScroller.start({\n\t\t\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 95, clientY: 50 },\n\t\t\t\t\t\t});\n\t\t\t\t\t\ttick();\n\t\t\t\t\t\texpect(scroll).toHaveBeenNthCalledWith(1, 1, 0);\n\n\t\t\t\t\t\ttick(config.durationDampening.accelerateAt + 300);\n\t\t\t\t\t\texpect(scroll).toHaveBeenNthCalledWith(2, 4, 0);\n\n\t\t\t\t\t\ttick(config.durationDampening.accelerateAt + 400);\n\t\t\t\t\t\texpect(scroll).toHaveBeenNthCalledWith(3, 7, 0);\n\n\t\t\t\t\t\ttick(config.durationDampening.accelerateAt + 500);\n\t\t\t\t\t\texpect(scroll).toHaveBeenNthCalledWith(4, 10, 0);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t});\n\n\tdescribe('behavior', () => {\n\t\tlet cleanup = () => {};\n\n\t\tconst setupMocks = ({\n\t\t\twindowScrollHeight,\n\t\t\tcontainerScrollY,\n\t\t}: {\n\t\t\twindowScrollHeight?: number;\n\t\t\tcontainerScrollY?: number;\n\t\t}) => {\n\t\t\tcleanup = combine(\n\t\t\t\tsetScrollableMock(containerScrollY),\n\t\t\t\tsetDateNowMock(),\n\t\t\t\tsetWindowScrollMock(),\n\t\t\t\tsetViewportMock(windowScrollHeight),\n\t\t\t);\n\t\t};\n\n\t\tafterEach(() => {\n\t\t\tjest.resetAllMocks();\n\t\t\tautoScroller.stop();\n\t\t\tcleanup();\n\t\t});\n\n\t\tdescribe('window-then-container', () => {\n\t\t\tit('should normally scroll the window', () => {\n\t\t\t\tsetupMocks({ windowScrollHeight: 500 });\n\n\t\t\t\tautoScroller.start({\n\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 50, clientY: 85 },\n\t\t\t\t\tbehavior: 'window-then-container',\n\t\t\t\t});\n\t\t\t\ttick(config.durationDampening.stopDampeningAt);\n\n\t\t\t\texpect(scrollWindow).toHaveBeenCalledTimes(1);\n\t\t\t\texpect(scrollElement).not.toHaveBeenCalled();\n\t\t\t});\n\n\t\t\tit('should scroll the container when the window cannot scroll', () => {\n\t\t\t\tsetupMocks({ windowScrollHeight: 0 });\n\n\t\t\t\tautoScroller.start({\n\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 50, clientY: 85 },\n\t\t\t\t\tbehavior: 'window-then-container',\n\t\t\t\t});\n\t\t\t\ttick(config.durationDampening.stopDampeningAt);\n\n\t\t\t\texpect(scrollElement).toHaveBeenCalledTimes(1);\n\t\t\t\texpect(scrollWindow).not.toHaveBeenCalled();\n\t\t\t});\n\t\t});\n\n\t\tdescribe('container-then-window', () => {\n\t\t\tit('should normally scroll the container', () => {\n\t\t\t\tsetupMocks({ containerScrollY: 0 });\n\n\t\t\t\tautoScroller.start({\n\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 50, clientY: 85 },\n\t\t\t\t\tbehavior: 'container-then-window',\n\t\t\t\t});\n\t\t\t\ttick(config.durationDampening.stopDampeningAt);\n\n\t\t\t\texpect(scrollElement).toHaveBeenCalledTimes(1);\n\t\t\t\texpect(scrollWindow).not.toHaveBeenCalled();\n\t\t\t});\n\n\t\t\tit('should scroll the window when the container cannot scroll', () => {\n\t\t\t\tsetupMocks({ containerScrollY: 500 });\n\n\t\t\t\tautoScroller.start({\n\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 50, clientY: 85 },\n\t\t\t\t\tbehavior: 'container-then-window',\n\t\t\t\t});\n\t\t\t\ttick(config.durationDampening.stopDampeningAt);\n\n\t\t\t\texpect(scrollWindow).toHaveBeenCalledTimes(1);\n\t\t\t\texpect(scrollElement).not.toHaveBeenCalled();\n\t\t\t});\n\t\t});\n\n\t\tdescribe('window-only', () => {\n\t\t\tit('should normally scroll the window', () => {\n\t\t\t\tsetupMocks({ windowScrollHeight: 500 });\n\n\t\t\t\tautoScroller.start({\n\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 50, clientY: 85 },\n\t\t\t\t\tbehavior: 'window-only',\n\t\t\t\t});\n\t\t\t\ttick(config.durationDampening.stopDampeningAt);\n\n\t\t\t\texpect(scrollWindow).toHaveBeenCalledTimes(1);\n\t\t\t\texpect(scrollElement).not.toHaveBeenCalled();\n\t\t\t});\n\n\t\t\tit('should not scroll the container when the window cannot scroll', () => {\n\t\t\t\tsetupMocks({ windowScrollHeight: 0 });\n\n\t\t\t\tautoScroller.start({\n\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 50, clientY: 85 },\n\t\t\t\t\tbehavior: 'window-only',\n\t\t\t\t});\n\t\t\t\ttick(config.durationDampening.stopDampeningAt);\n\n\t\t\t\texpect(scrollWindow).not.toHaveBeenCalled();\n\t\t\t\texpect(scrollElement).not.toHaveBeenCalled();\n\t\t\t});\n\t\t});\n\n\t\tdescribe('container-only', () => {\n\t\t\tit('should normally scroll the container', () => {\n\t\t\t\tsetupMocks({ containerScrollY: 0 });\n\n\t\t\t\tautoScroller.start({\n\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 50, clientY: 85 },\n\t\t\t\t\tbehavior: 'container-only',\n\t\t\t\t});\n\t\t\t\ttick(config.durationDampening.stopDampeningAt);\n\n\t\t\t\texpect(scrollElement).toHaveBeenCalledTimes(1);\n\t\t\t\texpect(scrollWindow).not.toHaveBeenCalled();\n\t\t\t});\n\n\t\t\tit('should not scroll the window when the container cannot scroll', () => {\n\t\t\t\tsetupMocks({ containerScrollY: 500 });\n\n\t\t\t\tautoScroller.start({\n\t\t\t\t\tinput: { ...getDefaultInput(), clientX: 50, clientY: 85 },\n\t\t\t\t\tbehavior: 'container-only',\n\t\t\t\t});\n\t\t\t\ttick(config.durationDampening.stopDampeningAt);\n\n\t\t\t\texpect(scrollElement).not.toHaveBeenCalled();\n\t\t\t\texpect(scrollWindow).not.toHaveBeenCalled();\n\t\t\t});\n\t\t});\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/__tests__/unit/get-closest-scrollable.spec.ts",
    "content": "import { getClosestScrollableElement } from '../../src/internal/get-closest-scrollable-element';\n\ndescribe('getClosestScrollable()', () => {\n\tit('should return null when element is not provided', () => {\n\t\texpect(getClosestScrollableElement()).toEqual(null);\n\t});\n\n\tit('should return null when element is document.body', () => {\n\t\texpect(getClosestScrollableElement(document.body)).toEqual(null);\n\t});\n\n\tit('should return null when element is document.documentElement', () => {\n\t\texpect(getClosestScrollableElement(document.documentElement)).toEqual(null);\n\t});\n\n\tit('should return element when it is scrollable', () => {\n\t\tconst element = document.createElement('div');\n\t\telement.style.overflowX = 'auto';\n\t\texpect(getClosestScrollableElement(element)).toEqual(element);\n\t});\n\n\tit('should return parent element when it is scrollable', () => {\n\t\tconst element = document.createElement('div');\n\t\tconst parent = document.createElement('div');\n\t\tparent.style.overflowX = 'auto';\n\t\tparent.appendChild(element);\n\n\t\texpect(getClosestScrollableElement(element)).toEqual(parent);\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/__tests__/unit/get-max-scroll.spec.ts",
    "content": "import getMaxScroll from '../../src/internal/get-max-scroll';\n\ndescribe('getMaxScroll()', () => {\n\tit('should return correct max scroll', () => {\n\t\texpect(\n\t\t\tgetMaxScroll({\n\t\t\t\tscrollHeight: 800,\n\t\t\t\tscrollWidth: 500,\n\t\t\t\theight: 700,\n\t\t\t\twidth: 400,\n\t\t\t}),\n\t\t).toEqual({\n\t\t\tx: 100,\n\t\t\ty: 100,\n\t\t});\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/__tests__/unit/get-percentage.spec.ts",
    "content": "import { getPercentage } from '../../src/internal/get-percentage';\n\ndescribe('getPercentage()', () => {\n\tit('should return 0 for 0 range', () => {\n\t\texpect(getPercentage({ startOfRange: 100, endOfRange: 100, current: 300 })).toEqual(0);\n\t});\n\n\tit('should return correct percentages', () => {\n\t\texpect(getPercentage({ startOfRange: 100, endOfRange: 300, current: 200 })).toEqual(0.5);\n\n\t\texpect(getPercentage({ startOfRange: 100, endOfRange: 300, current: 250 })).toEqual(0.75);\n\n\t\texpect(getPercentage({ startOfRange: 100, endOfRange: 300, current: 300 })).toEqual(1);\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/__tests__/unit/get-scroll/dampen-value-by-time.spec.ts",
    "content": "import config from '../../../src/internal/config';\nimport { minScroll } from '../../../src/internal/constants';\nimport { dampenValueByTime } from '../../../src/internal/get-scroll/get-scroll-on-axis/dampen-value-by-time';\n\ndescribe('dampenValueByTime()', () => {\n\tlet mockNow: jest.Mock;\n\tlet proposedScroll = 7;\n\tconst dragStartTime = 0;\n\tconst stopAt: number = config.durationDampening.stopDampeningAt;\n\tconst accelerateAt: number = config.durationDampening.accelerateAt;\n\n\tconst originalNow = Date.now;\n\tbeforeEach(() => {\n\t\tmockNow = jest.fn().mockReturnValue(0);\n\t\tDate.now = mockNow;\n\t});\n\n\tafterEach(() => {\n\t\tmockNow.mockClear();\n\t\tDate.now = originalNow;\n\t});\n\n\tit('should not dampen scrolling when the time dampening period have finished', () => {\n\t\tmockNow.mockReturnValueOnce(stopAt);\n\t\texpect(dampenValueByTime(proposedScroll, dragStartTime)).toEqual(proposedScroll);\n\n\t\tmockNow.mockReturnValueOnce(stopAt + 10);\n\t\texpect(dampenValueByTime(proposedScroll, dragStartTime)).toEqual(proposedScroll);\n\n\t\tmockNow.mockReturnValueOnce(stopAt + 100);\n\t\texpect(dampenValueByTime(proposedScroll, dragStartTime)).toEqual(proposedScroll);\n\t});\n\n\tit('should return the minimum scroll up to the accelerate time threshold', () => {\n\t\tmockNow.mockReturnValueOnce(accelerateAt - 10);\n\t\texpect(dampenValueByTime(proposedScroll, dragStartTime)).toEqual(minScroll);\n\n\t\tmockNow.mockReturnValueOnce(accelerateAt - 5);\n\t\texpect(dampenValueByTime(proposedScroll, dragStartTime)).toEqual(minScroll);\n\n\t\tmockNow.mockReturnValueOnce(accelerateAt - 1);\n\t\texpect(dampenValueByTime(proposedScroll, dragStartTime)).toEqual(minScroll);\n\t});\n\n\tit('should accelerate the scroll value to the max speed as time continues', () => {\n\t\tmockNow.mockReturnValueOnce(accelerateAt + 100);\n\t\texpect(dampenValueByTime(10, dragStartTime)).toEqual(1);\n\n\t\tmockNow.mockReturnValueOnce(accelerateAt + 300);\n\t\texpect(dampenValueByTime(10, dragStartTime)).toEqual(2);\n\n\t\tmockNow.mockReturnValueOnce(accelerateAt + 500);\n\t\texpect(dampenValueByTime(10, dragStartTime)).toEqual(4);\n\n\t\tmockNow.mockReturnValueOnce(accelerateAt + 700);\n\t\texpect(dampenValueByTime(10, dragStartTime)).toEqual(7);\n\n\t\tmockNow.mockReturnValueOnce(stopAt - 1);\n\t\texpect(dampenValueByTime(10, dragStartTime)).toEqual(10);\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/__tests__/unit/get-scroll/get-distance-threshold.spec.ts",
    "content": "import { getRect } from 'css-box-model';\n\nimport { horizontal, vertical } from '../../../src/internal/constants';\nimport { getDistanceThresholds } from '../../../src/internal/get-scroll/get-scroll-on-axis/get-distance-thresholds';\n\ndescribe('getDistanceThresholds()', () => {\n\tit('should return correct threshold for horizontal axis', () => {\n\t\texpect(\n\t\t\tgetDistanceThresholds(getRect({ top: 0, bottom: 100, left: 0, right: 50 }), horizontal),\n\t\t).toEqual({\n\t\t\tmaxScrollValueAt: 2.5,\n\t\t\tstartScrollingFrom: 12.5,\n\t\t});\n\n\t\texpect(\n\t\t\tgetDistanceThresholds(getRect({ top: 0, bottom: 100, left: 30, right: 55 }), horizontal),\n\t\t).toEqual({\n\t\t\tmaxScrollValueAt: 1.25,\n\t\t\tstartScrollingFrom: 6.25,\n\t\t});\n\n\t\texpect(\n\t\t\tgetDistanceThresholds(getRect({ top: 0, bottom: 100, left: 50, right: 90 }), horizontal),\n\t\t).toEqual({\n\t\t\tmaxScrollValueAt: 2,\n\t\t\tstartScrollingFrom: 10,\n\t\t});\n\t});\n\n\tit('should return correct threshold for vertical axis', () => {\n\t\texpect(\n\t\t\tgetDistanceThresholds(getRect({ top: 0, bottom: 100, left: 0, right: 50 }), vertical),\n\t\t).toEqual({\n\t\t\tmaxScrollValueAt: 5,\n\t\t\tstartScrollingFrom: 25,\n\t\t});\n\n\t\texpect(\n\t\t\tgetDistanceThresholds(getRect({ top: 20, bottom: 80, left: 0, right: 50 }), vertical),\n\t\t).toEqual({\n\t\t\tmaxScrollValueAt: 3,\n\t\t\tstartScrollingFrom: 15,\n\t\t});\n\n\t\texpect(\n\t\t\tgetDistanceThresholds(getRect({ top: 30, bottom: 50, left: 0, right: 50 }), vertical),\n\t\t).toEqual({\n\t\t\tmaxScrollValueAt: 1,\n\t\t\tstartScrollingFrom: 5,\n\t\t});\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/__tests__/unit/get-scroll/get-scroll-on-axis.spec.ts",
    "content": "import { getRect } from 'css-box-model';\n\nimport { vertical } from '../../../src/internal/constants';\nimport getScrollOnAxis from '../../../src/internal/get-scroll/get-scroll-on-axis';\nimport getValue from '../../../src/internal/get-scroll/get-scroll-on-axis/get-value';\n\njest.mock('../../../src/internal/get-scroll/get-scroll-on-axis/get-value', () => jest.fn());\n\ndescribe('getScrollOnAxis()', () => {\n\tconst defaultProps = {\n\t\tcontainer: getRect({ top: 0, bottom: 100, left: 0, right: 50 }),\n\t\tdistanceToEdges: { top: 0, bottom: 0, left: 0, right: 0 },\n\t\tdragStartTime: 0,\n\t\taxis: vertical,\n\t\tshouldUseTimeDampening: true,\n\t};\n\tconst valueMock = 33;\n\n\tit('should return positive scroll value when draggable is closer to end', () => {\n\t\t(getValue as jest.Mock).mockReturnValue(valueMock);\n\t\tconst scroll = getScrollOnAxis({\n\t\t\t...defaultProps,\n\t\t\tdistanceToEdges: { top: 10, bottom: 0, left: 0, right: 0 },\n\t\t});\n\t\texpect(scroll).toEqual(valueMock);\n\t});\n\n\tit('should return negative scroll value when draggable is closer to start', () => {\n\t\t(getValue as jest.Mock).mockReturnValue(valueMock);\n\t\tconst scroll = getScrollOnAxis({\n\t\t\t...defaultProps,\n\t\t\tdistanceToEdges: { top: 0, bottom: 10, left: 0, right: 0 },\n\t\t});\n\t\texpect(scroll).toEqual(valueMock * -1);\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/__tests__/unit/get-scroll/get-value-from-distance.spec.ts",
    "content": "import config from '../../../src/internal/config';\nimport { minScroll } from '../../../src/internal/constants';\nimport type { DistanceThresholds } from '../../../src/internal/get-scroll/get-scroll-on-axis/get-distance-thresholds';\nimport { getValueFromDistance } from '../../../src/internal/get-scroll/get-scroll-on-axis/get-value-from-distance';\n\ndescribe('getValueFromDistance()', () => {\n\tconst getValue = ({\n\t\tdistanceToEdge,\n\t\tthresholds,\n\t}: {\n\t\tdistanceToEdge: number;\n\t\tthresholds: DistanceThresholds;\n\t}) => getValueFromDistance(distanceToEdge, thresholds);\n\n\tit('should return 0 when its too far away to auto scroll', () => {\n\t\texpect(\n\t\t\tgetValue({\n\t\t\t\tdistanceToEdge: 150,\n\t\t\t\tthresholds: { startScrollingFrom: 100, maxScrollValueAt: 30 },\n\t\t\t}),\n\t\t).toEqual(0);\n\t});\n\n\tit('should use max speed when on or over boundary', () => {\n\t\texpect(\n\t\t\tgetValue({\n\t\t\t\tdistanceToEdge: 30,\n\t\t\t\tthresholds: { startScrollingFrom: 100, maxScrollValueAt: 30 },\n\t\t\t}),\n\t\t).toEqual(config.maxPixelScroll);\n\t});\n\n\tit('should return minimum scroll when just going on the boundary', () => {\n\t\texpect(\n\t\t\tgetValue({\n\t\t\t\tdistanceToEdge: 100,\n\t\t\t\tthresholds: { startScrollingFrom: 100, maxScrollValueAt: 30 },\n\t\t\t}),\n\t\t).toEqual(minScroll);\n\t});\n\n\tit('should return positive integer', () => {\n\t\texpect(\n\t\t\tgetValue({\n\t\t\t\tdistanceToEdge: 90,\n\t\t\t\tthresholds: { startScrollingFrom: 100, maxScrollValueAt: 30 },\n\t\t\t}),\n\t\t).toEqual(1);\n\n\t\texpect(\n\t\t\tgetValue({\n\t\t\t\tdistanceToEdge: 80,\n\t\t\t\tthresholds: { startScrollingFrom: 100, maxScrollValueAt: 30 },\n\t\t\t}),\n\t\t).toEqual(3);\n\n\t\texpect(\n\t\t\tgetValue({\n\t\t\t\tdistanceToEdge: 70,\n\t\t\t\tthresholds: { startScrollingFrom: 100, maxScrollValueAt: 30 },\n\t\t\t}),\n\t\t).toEqual(6);\n\n\t\texpect(\n\t\t\tgetValue({\n\t\t\t\tdistanceToEdge: 50,\n\t\t\t\tthresholds: { startScrollingFrom: 100, maxScrollValueAt: 30 },\n\t\t\t}),\n\t\t).toEqual(15);\n\n\t\texpect(\n\t\t\tgetValue({\n\t\t\t\tdistanceToEdge: 35,\n\t\t\t\tthresholds: { startScrollingFrom: 100, maxScrollValueAt: 30 },\n\t\t\t}),\n\t\t).toEqual(25);\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/__tests__/unit/get-scroll/get-value.spec.ts",
    "content": "import { minScroll } from '../../../src/internal/constants';\nimport { dampenValueByTime } from '../../../src/internal/get-scroll/get-scroll-on-axis/dampen-value-by-time';\nimport type { DistanceThresholds } from '../../../src/internal/get-scroll/get-scroll-on-axis/get-distance-thresholds';\nimport { getValue } from '../../../src/internal/get-scroll/get-scroll-on-axis/get-value';\nimport { getValueFromDistance } from '../../../src/internal/get-scroll/get-scroll-on-axis/get-value-from-distance';\n\njest.mock('../../../src/internal/get-scroll/get-scroll-on-axis/dampen-value-by-time', () => ({\n\tdampenValueByTime: jest.fn(),\n}));\n\njest.mock('../../../src/internal/get-scroll/get-scroll-on-axis/get-value-from-distance', () => ({\n\tgetValueFromDistance: jest.fn(),\n}));\n\ndescribe('getValue()', () => {\n\tafterEach(() => {\n\t\tjest.resetAllMocks();\n\t});\n\n\ttype Args = {\n\t\tdistanceToEdge?: number;\n\t\tthresholds?: DistanceThresholds;\n\t\tdragStartTime?: number;\n\t\tshouldUseTimeDampening?: boolean;\n\t};\n\n\tconst getScrollValue = (overrides?: Args) =>\n\t\tgetValue({\n\t\t\tdistanceToEdge: 1,\n\t\t\tthresholds: {\n\t\t\t\tstartScrollingFrom: 1,\n\t\t\t\tmaxScrollValueAt: 1,\n\t\t\t},\n\t\t\tdragStartTime: 1,\n\t\t\tshouldUseTimeDampening: true,\n\t\t\t...(overrides || {}),\n\t\t});\n\n\tit('should return 0 when its not enough distance to trigger a minimum scroll', () => {\n\t\t(getValueFromDistance as jest.Mock).mockReturnValue(0);\n\n\t\texpect(getScrollValue()).toEqual(0);\n\t});\n\n\tit('should return minimum scroll when dampen scroll value is lower than minimum scroll value', () => {\n\t\tconst dampenValue = minScroll - 1;\n\n\t\t(getValueFromDistance as jest.Mock).mockReturnValue(10);\n\t\t(dampenValueByTime as jest.Mock).mockReturnValue(dampenValue);\n\n\t\texpect(getScrollValue()).toEqual(minScroll);\n\t});\n\n\tit('should return dampen scroll value when it is higher than minimum scroll value', () => {\n\t\tconst dampenValue = minScroll + 1;\n\n\t\t(getValueFromDistance as jest.Mock).mockReturnValue(10);\n\t\t(dampenValueByTime as jest.Mock).mockReturnValue(dampenValue);\n\n\t\texpect(getScrollValue()).toEqual(dampenValue);\n\t});\n\n\tit('should return scroll value when shouldUseTimeDampening is false', () => {\n\t\tconst scrollValue = 13;\n\n\t\t(getValueFromDistance as jest.Mock).mockReturnValue(scrollValue);\n\n\t\texpect(getScrollValue({ shouldUseTimeDampening: false })).toEqual(scrollValue);\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/__tests__/unit/get-scroll/index.spec.ts",
    "content": "import { getRect } from 'css-box-model';\n\nimport getScroll from '../../../src/internal/get-scroll';\nimport getScrollOnAxis from '../../../src/internal/get-scroll/get-scroll-on-axis';\n\njest.mock('../../../src/internal/get-scroll/get-scroll-on-axis', () => jest.fn());\n\ndescribe('getScroll()', () => {\n\tconst defaultProps = {\n\t\tdragStartTime: 0,\n\t\tcontainer: getRect({ top: 0, bottom: 100, left: 0, right: 50 }),\n\t\tcenter: { x: 0, y: 0 },\n\t\tshouldUseTimeDampening: true,\n\t};\n\n\tit('should return null when scroll has not change', () => {\n\t\t(getScrollOnAxis as jest.Mock).mockReturnValue(0);\n\t\tconst change = getScroll(defaultProps);\n\t\texpect(change).toEqual(null);\n\t});\n\n\tit('should return new scroll value', () => {\n\t\tconst mockY = 10;\n\t\tconst mockX = 15;\n\t\t(getScrollOnAxis as jest.Mock).mockReturnValueOnce(mockY);\n\t\t(getScrollOnAxis as jest.Mock).mockReturnValueOnce(mockX);\n\n\t\tconst change = getScroll(defaultProps);\n\t\texpect(change).toEqual({ x: mockX, y: mockY });\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/afm-jira/tsconfig.json",
    "content": "{\n\t\"extends\": \"../../../../tsconfig.local-consumption.json\",\n\t\"compilerOptions\": {\n\t\t\"target\": \"es5\",\n\t\t\"outDir\": \"../../../../../jira/tsDist/@atlaskit__pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll/app\",\n\t\t\"rootDir\": \"../\",\n\t\t\"composite\": true,\n\t\t\"noCheck\": true\n\t},\n\t\"include\": [\n\t\t\"../src/**/*.ts\",\n\t\t\"../src/**/*.tsx\"\n\t],\n\t\"exclude\": [\n\t\t\"../src/**/__tests__/*\",\n\t\t\"../src/**/*.test.*\",\n\t\t\"../src/**/test.*\",\n\t\t\"../src/**/examples.*\",\n\t\t\"../src/**/examples/*\",\n\t\t\"../src/**/examples/**/*\",\n\t\t\"../src/**/*.stories.*\",\n\t\t\"../src/**/stories/*\",\n\t\t\"../src/**/stories/**/*\"\n\t],\n\t\"references\": [\n\t\t{\n\t\t\t\"path\": \"../../core/afm-jira/tsconfig.json\"\n\t\t}\n\t]\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/afm-products/tsconfig.json",
    "content": "{\n\t\"extends\": \"../../../../tsconfig.local-consumption.json\",\n\t\"compilerOptions\": {\n\t\t\"target\": \"es5\",\n\t\t\"outDir\": \"../../../../../tsDist/@atlaskit__pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll/app\",\n\t\t\"rootDir\": \"../\",\n\t\t\"composite\": true,\n\t\t\"noCheck\": true\n\t},\n\t\"include\": [\n\t\t\"../src/**/*.ts\",\n\t\t\"../src/**/*.tsx\"\n\t],\n\t\"exclude\": [\n\t\t\"../src/**/__tests__/*\",\n\t\t\"../src/**/*.test.*\",\n\t\t\"../src/**/test.*\",\n\t\t\"../src/**/examples.*\",\n\t\t\"../src/**/examples/*\",\n\t\t\"../src/**/examples/**/*\",\n\t\t\"../src/**/*.stories.*\",\n\t\t\"../src/**/stories/*\",\n\t\t\"../src/**/stories/**/*\"\n\t],\n\t\"references\": [\n\t\t{\n\t\t\t\"path\": \"../../core/afm-products/tsconfig.json\"\n\t\t}\n\t]\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/constellation/index/about.mdx",
    "content": "---\norder: 0\ntitle: react-beautiful-dnd autoscroll\ndescription:\n  An optional package that enables automatic scrolling during a drag operation. This package is a\n  port of the react-beautiful-dnd auto scroller\n---\n\nimport SectionMessage from '@atlaskit/section-message';\n\n<SectionMessage appearance=\"warning\" title=\"Please use our new auto scroller\">\n\nThis package is a port of the auto scroller from\n[`react-beautiful-dnd`](https://github.com/atlassian/react-beautiful-dnd). Please now use our\n[new auto scroller](/components/pragmatic-drag-and-drop/optional-packages/auto-scroll).\n\nAdvantages of our new auto scroller:\n\n- It supports any level of scrollable element nesting\n- It is smaller and faster\n- It can support any experience and any changes you like during a drag operation\n- It has lots of experience improvements\n- It supports overflow scrolling\n\n</SectionMessage>\n\n<SectionMessage>\n\nThis package depends on [the core package](/components/pragmatic-drag-and-drop/core-package).\n\nThis package has no dependency on any view library (eg `react`), or on the Atlassian Design System.\n\n</SectionMessage>\n\nOut of the box, Pragmatic drag and drop leverages the browsers built in auto scrolling for drag and\ndrop operations.\n\nAuto scroll is an optional addon that provides a more natural feeling auto scrolling experience.\nThis auto scroller has been ported from\n[`react-beautiful-dnd`](https://github.com/atlassian/react-beautiful-dnd).\n\n## API\n\n- `autoScroller.start({ input, behavior })`: Starts monitoring drag input. Call this inside of\n  `onDragStart`.\n- `autoScroller.stop()`: Stops monitoring drag input. Call this inside of `onDrop`.\n- `autoScroller.updateInput({ input })`: Provides drag input data used to determine where to scroll.\n  Call this inside of `onDrag`.\n\n```tsx\nimport React, { useEffect } from 'react';\n\nimport { autoScroller } from '@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll';\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\n\nimport Board from './board';\n\nexport default function AutoScrollExample() {\n  useEffect(() => {\n    return combine(\n      monitorForElements({\n        onDragStart: ({ location }) => {\n          autoScroller.start({ input: location.current.input });\n        },\n        onDrop: () => {\n          autoScroller.stop();\n        },\n        onDrag: ({ location }) => {\n          autoScroller.updateInput({\n            input: location.current.input,\n          });\n        },\n      }),\n    );\n  }, []);\n\n  return <Board />;\n}\n\n### Options\n\n* `behavior`: Determines what entities should be scrolled and in what order.\n  * `window-only`: Only attempt to scroll the window\n  * `window-then-container`: Attempt to scroll the window, then attempt to scroll the container if window scroll not possible\n  * `container-only`: Only attempt to scroll the window\n  * `container-then-window`: Attempt to scroll the container, then attempt to scroll the window if container scroll not possible\n```\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/constellation/index/props.mdx",
    "content": ""
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/package.json",
    "content": "{\n  \"name\": \"@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll\",\n  \"version\": \"2.0.2\",\n  \"description\": \"An optional package for Pragmatic drag and drop that enables automatic scrolling during a drag operation. This package is a port of the react-beautiful-dnd auto scroller\",\n  \"author\": \"Atlassian Pty Ltd\",\n  \"license\": \"Apache-2.0\",\n  \"publishConfig\": {\n    \"registry\": \"https://registry.npmjs.org/\"\n  },\n  \"repository\": \"https://github.com/atlassian/pragmatic-drag-and-drop\",\n  \"main\": \"dist/cjs/index.js\",\n  \"module\": \"dist/esm/index.js\",\n  \"module:es2019\": \"dist/es2019/index.js\",\n  \"types\": \"dist/types/index.d.ts\",\n  \"sideEffects\": false,\n  \"exports\": {\n    \".\": \"./src/index.ts\"\n  },\n  \"dependencies\": {\n    \"@atlaskit/pragmatic-drag-and-drop\": \"^1.7.0\",\n    \"@babel/runtime\": \"^7.0.0\",\n    \"css-box-model\": \"^1.2.0\"\n  },\n  \"devDependencies\": {\n    \"@emotion/react\": \"^11.7.1\",\n    \"raf-stub\": \"^2.0.1\",\n    \"wait-for-expect\": \"^1.2.0\"\n  },\n  \"homepage\": \"https://atlassian.design/components/pragmatic-drag-and-drop/\"\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/src/index.ts",
    "content": "import type { Input, Position } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport { scroll } from './internal/scroll';\nimport { type ScrollBehavior } from './internal/types';\n\ntype WhileDragging = {\n\tdragStartTime: number;\n\tlatestInput: Input;\n\tloopFrameId: number | null;\n\tshouldUseTimeDampening: boolean;\n\tbehavior: ScrollBehavior;\n} | null;\n\nconst scrollElement = (element: Element, change: Position) => {\n\telement.scrollBy(change.x, change.y);\n};\n\nconst scrollWindow = (change: Position) => {\n\twindow.scrollBy(change.x, change.y);\n};\n\nexport const createAutoScroller = () => {\n\tlet dragging: WhileDragging = null;\n\n\tfunction tryScroll(fakeScrollCallback?: () => void) {\n\t\tif (dragging == null) {\n\t\t\treturn;\n\t\t}\n\n\t\tscroll({\n\t\t\tinput: dragging.latestInput,\n\t\t\tdragStartTime: dragging.dragStartTime,\n\t\t\tshouldUseTimeDampening: dragging.shouldUseTimeDampening,\n\t\t\tbehavior: dragging.behavior,\n\t\t\tscrollElement: fakeScrollCallback ?? scrollElement,\n\t\t\tscrollWindow: fakeScrollCallback ?? scrollWindow,\n\t\t});\n\t}\n\n\t// Every animation frame use the latest user input to scroll\n\t// We do this loop manually rather than in response to `onDrag`\n\t// events as `onDrag` can drop to 50-100ms between events when\n\t// the user is not actively moving their pointer\n\tfunction loop() {\n\t\tif (!dragging) {\n\t\t\treturn;\n\t\t}\n\t\tdragging.loopFrameId = requestAnimationFrame(() => {\n\t\t\ttryScroll();\n\t\t\tloop();\n\t\t});\n\t}\n\n\tconst start = ({\n\t\tinput,\n\t\tbehavior = 'window-then-container',\n\t}: {\n\t\tinput: Input;\n\t\tbehavior?: ScrollBehavior;\n\t}): void => {\n\t\tconst dragStartTime: number = Date.now();\n\n\t\tdragging = {\n\t\t\tdragStartTime,\n\t\t\tlatestInput: input,\n\t\t\tloopFrameId: null,\n\t\t\tshouldUseTimeDampening: false,\n\t\t\tbehavior,\n\t\t};\n\n\t\t// we only use time dampening when auto scrolling starts on lift.\n\t\tconst fakeScrollCallback = () => {\n\t\t\tif (dragging) {\n\t\t\t\tdragging.shouldUseTimeDampening = true;\n\t\t\t}\n\t\t};\n\n\t\ttryScroll(fakeScrollCallback);\n\t\tloop();\n\t};\n\n\tfunction updateInput({ input }: { input: Input }): void {\n\t\tif (!dragging) {\n\t\t\treturn;\n\t\t}\n\t\tdragging.latestInput = input;\n\t}\n\n\tconst stop = (): void => {\n\t\t// can be called defensively\n\t\tif (!dragging) {\n\t\t\treturn;\n\t\t}\n\t\tif (dragging.loopFrameId) {\n\t\t\tcancelAnimationFrame(dragging.loopFrameId);\n\t\t}\n\t\tdragging = null;\n\t};\n\n\treturn { start, updateInput, stop };\n};\n\nexport const autoScroller = createAutoScroller();\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/src/internal/can-scroll.ts",
    "content": "// Source: https://github.com/atlassian/react-beautiful-dnd\n\nimport type { Position } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport { add, apply, isEqual, origin } from './position';\nimport type { Scrollable, Viewport } from './types';\n\ntype CanPartiallyScrollArgs = {\n\tmax: Position;\n\tcurrent: Position;\n\tchange: Position;\n};\n\nconst smallestSigned = apply((value: number) => {\n\tif (value === 0) {\n\t\treturn 0;\n\t}\n\treturn value > 0 ? 1 : -1;\n});\n\ntype GetRemainderArgs = {\n\tcurrent: Position;\n\tmax: Position;\n\tchange: Position;\n};\n\n// We need to figure out how much of the movement\n// cannot be done with a scroll\nexport const getOverlap = (() => {\n\tconst getRemainder = (target: number, max: number): number => {\n\t\tif (target < 0) {\n\t\t\treturn target;\n\t\t}\n\t\tif (target > max) {\n\t\t\treturn target - max;\n\t\t}\n\t\treturn 0;\n\t};\n\n\treturn ({ current, max, change }: GetRemainderArgs): Position | null => {\n\t\tconst targetScroll: Position = add(current, change);\n\n\t\tconst overlap: Position = {\n\t\t\tx: getRemainder(targetScroll.x, max.x),\n\t\t\ty: getRemainder(targetScroll.y, max.y),\n\t\t};\n\n\t\tif (isEqual(overlap, origin)) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn overlap;\n\t};\n})();\n\nexport const canPartiallyScroll = ({\n\tmax: rawMax,\n\tcurrent,\n\tchange,\n}: CanPartiallyScrollArgs): boolean => {\n\t// It is possible for the max scroll to be greater than the current scroll\n\t// when there are scrollbars on the cross axis. We adjust for this by\n\t// increasing the max scroll point if needed\n\t// This will allow movements backwards even if the current scroll is greater than the max scroll\n\tconst max: Position = {\n\t\tx: Math.max(current.x, rawMax.x),\n\t\ty: Math.max(current.y, rawMax.y),\n\t};\n\n\t// Only need to be able to move the smallest amount in the desired direction\n\tconst smallestChange: Position = smallestSigned(change);\n\n\tconst overlap: Position | null = getOverlap({\n\t\tmax,\n\t\tcurrent,\n\t\tchange: smallestChange,\n\t});\n\n\t// no overlap at all - we can move there!\n\tif (!overlap) {\n\t\treturn true;\n\t}\n\n\t// if there was an x value, but there is no x overlap - then we can scroll on the x!\n\tif (smallestChange.x !== 0 && overlap.x === 0) {\n\t\treturn true;\n\t}\n\n\t// if there was an y value, but there is no y overlap - then we can scroll on the y!\n\tif (smallestChange.y !== 0 && overlap.y === 0) {\n\t\treturn true;\n\t}\n\n\treturn false;\n};\n\nexport const canScrollWindow = (viewport: Viewport, change: Position): boolean =>\n\tcanPartiallyScroll({\n\t\tcurrent: viewport.scroll.current,\n\t\tmax: viewport.scroll.max,\n\t\tchange,\n\t});\n\nexport const getWindowOverlap = (viewport: Viewport, change: Position): Position | null => {\n\tif (!canScrollWindow(viewport, change)) {\n\t\treturn null;\n\t}\n\n\tconst max: Position = viewport.scroll.max;\n\tconst current: Position = viewport.scroll.current;\n\n\treturn getOverlap({\n\t\tcurrent,\n\t\tmax,\n\t\tchange,\n\t});\n};\n\nexport const canScrollScrollable = (scrollable: Scrollable, change: Position): boolean => {\n\treturn canPartiallyScroll({\n\t\tcurrent: scrollable.scroll.current,\n\t\tmax: scrollable.scroll.max,\n\t\tchange,\n\t});\n};\n\nexport const getScrollableOverlap = (scrollable: Scrollable, change: Position): Position | null => {\n\tif (!canScrollScrollable(scrollable, change)) {\n\t\treturn null;\n\t}\n\n\treturn getOverlap({\n\t\tcurrent: scrollable.scroll.current,\n\t\tmax: scrollable.scroll.max,\n\t\tchange,\n\t});\n};\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/src/internal/config.ts",
    "content": "// Source: https://github.com/atlassian/react-beautiful-dnd\n\n// Values used to control how the fluid auto scroll feels\nconst config = {\n\t// percentage distance from edge of container:\n\tstartFromPercentage: 0.25,\n\tmaxScrollAtPercentage: 0.05,\n\t// pixels per frame\n\tmaxPixelScroll: 28,\n\n\t// A function used to ease a percentage value\n\t// A simple linear function would be: (percentage) => percentage;\n\t// percentage is between 0 and 1\n\t// result must be between 0 and 1\n\tease: (percentage: number): number => Math.pow(percentage, 2),\n\n\tdurationDampening: {\n\t\t// ms: how long to dampen the speed of an auto scroll from the start of a drag\n\t\tstopDampeningAt: 1200,\n\t\t// ms: when to start accelerating the reduction of duration dampening\n\t\taccelerateAt: 360,\n\t},\n};\n\nexport default config;\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/src/internal/constants.ts",
    "content": "import type { AxisDirection, HorizontalAxis, VerticalAxis } from './types';\n\n// A scroll event will only be triggered when there is a value of at least 1px change\nexport const minScroll = 1;\n\nexport const vertical: VerticalAxis = {\n\tdirection: 'vertical',\n\tstart: 'top',\n\tend: 'bottom',\n\tsize: 'height',\n\tscrollAxis: 'scrollTop',\n};\n\nexport const horizontal: HorizontalAxis = {\n\tdirection: 'horizontal',\n\tstart: 'left',\n\tend: 'right',\n\tsize: 'width',\n\tscrollAxis: 'scrollLeft',\n};\n\nexport const defaultAllowedAxis: AxisDirection[] = [horizontal.direction, vertical.direction];\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/src/internal/get-closest-scrollable-element.ts",
    "content": "// Source: https://github.com/atlassian/react-beautiful-dnd\n\ntype Overflow = {\n\toverflowX: string;\n\toverflowY: string;\n};\n\nconst isEqual =\n\t(base: string) =>\n\t(value: string): boolean =>\n\t\tbase === value;\nconst isScroll = isEqual('scroll');\nconst isAuto = isEqual('auto');\nconst isEither = (overflow: Overflow, fn: (value: string) => boolean) =>\n\tfn(overflow.overflowX) || fn(overflow.overflowY);\n\nconst isElementScrollable = (el: Element): boolean => {\n\tconst style: CSSStyleDeclaration = window.getComputedStyle(el);\n\tconst overflow: Overflow = {\n\t\toverflowX: style.overflowX,\n\t\toverflowY: style.overflowY,\n\t};\n\n\treturn isEither(overflow, isScroll) || isEither(overflow, isAuto);\n};\n\nexport const getClosestScrollableElement = (el?: Element | null): Element | null => {\n\t// cannot do anything else!\n\tif (!el) {\n\t\treturn null;\n\t}\n\n\t// not allowing us to go higher then body\n\tif (el === document.body || el === document.documentElement) {\n\t\treturn null;\n\t}\n\n\tif (!isElementScrollable(el)) {\n\t\t// keep recursing\n\t\treturn getClosestScrollableElement(el.parentElement);\n\t}\n\n\t// success!\n\treturn el;\n};\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/src/internal/get-max-scroll.ts",
    "content": "import type { Position } from 'css-box-model';\n\nimport { subtract } from './position';\n\ntype Args = {\n\tscrollHeight: number;\n\tscrollWidth: number;\n\theight: number;\n\twidth: number;\n};\n\nexport default ({ scrollHeight, scrollWidth, height, width }: Args): Position => {\n\tconst maxScroll: Position = subtract(\n\t\t// full size\n\t\t{ x: scrollWidth, y: scrollHeight },\n\t\t// viewport size\n\t\t{ x: width, y: height },\n\t);\n\n\tconst adjustedMaxScroll: Position = {\n\t\tx: Math.max(0, maxScroll.x),\n\t\ty: Math.max(0, maxScroll.y),\n\t};\n\n\treturn adjustedMaxScroll;\n};\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/src/internal/get-percentage.ts",
    "content": "// Source: https://github.com/atlassian/react-beautiful-dnd\n\ntype Args = {\n\tstartOfRange: number;\n\tendOfRange: number;\n\tcurrent: number;\n};\n\nexport const getPercentage = ({ startOfRange, endOfRange, current }: Args): number => {\n\tconst range: number = endOfRange - startOfRange;\n\n\tif (range === 0) {\n\t\t/**\n\t\t * Detected distance range of 0 in the auto scroller\n\t\t * This is unexpected and would cause a divide by 0 issue.\n\t\t * Not allowing an auto scroll\n\t\t */\n\t\treturn 0;\n\t}\n\n\tconst currentInRange: number = current - startOfRange;\n\tconst percentage: number = currentInRange / range;\n\treturn percentage;\n};\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/src/internal/get-scroll/get-scroll-on-axis/dampen-value-by-time.ts",
    "content": "// Source: https://github.com/atlassian/react-beautiful-dnd\n\nimport config from '../../config';\nimport { minScroll } from '../../constants';\nimport { getPercentage } from '../../get-percentage';\n\nconst accelerateAt: number = config.durationDampening.accelerateAt;\nconst stopAt: number = config.durationDampening.stopDampeningAt;\n\nexport const dampenValueByTime = (proposedScroll: number, dragStartTime: number): number => {\n\tconst startOfRange: number = dragStartTime;\n\tconst endOfRange: number = stopAt;\n\tconst now: number = Date.now();\n\tconst runTime: number = now - startOfRange;\n\n\t// we have finished the time dampening period\n\tif (runTime >= stopAt) {\n\t\treturn proposedScroll;\n\t}\n\n\t// Up to this point we know there is a proposed scroll\n\t// but we have not reached our accelerate point\n\t// Return the minimum amount of scroll\n\tif (runTime < accelerateAt) {\n\t\treturn minScroll;\n\t}\n\n\tconst betweenAccelerateAtAndStopAtPercentage: number = getPercentage({\n\t\tstartOfRange: accelerateAt,\n\t\tendOfRange,\n\t\tcurrent: runTime,\n\t});\n\n\tconst scroll: number = proposedScroll * config.ease(betweenAccelerateAtAndStopAtPercentage);\n\n\treturn Math.ceil(scroll);\n};\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/src/internal/get-scroll/get-scroll-on-axis/get-distance-thresholds.ts",
    "content": "// Source: https://github.com/atlassian/react-beautiful-dnd\n\nimport type { Rect } from 'css-box-model';\n\nimport config from '../../config';\nimport type { Axis } from '../../types';\n// all in pixels\nexport type DistanceThresholds = {\n\tstartScrollingFrom: number;\n\tmaxScrollValueAt: number;\n};\n\n// converts the percentages in the config into actual pixel values\nexport const getDistanceThresholds = (container: Rect, axis: Axis): DistanceThresholds => {\n\tconst startScrollingFrom: number = container[axis.size] * config.startFromPercentage;\n\tconst maxScrollValueAt: number = container[axis.size] * config.maxScrollAtPercentage;\n\n\tconst thresholds: DistanceThresholds = {\n\t\tstartScrollingFrom,\n\t\tmaxScrollValueAt,\n\t};\n\n\treturn thresholds;\n};\n\nexport default getDistanceThresholds;\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/src/internal/get-scroll/get-scroll-on-axis/get-value-from-distance.ts",
    "content": "// Source: https://github.com/atlassian/react-beautiful-dnd\n\nimport config from '../../config';\nimport { minScroll } from '../../constants';\nimport { getPercentage } from '../../get-percentage';\n\nimport type { DistanceThresholds } from './get-distance-thresholds';\n\nexport const getValueFromDistance = (\n\tdistanceToEdge: number,\n\tthresholds: DistanceThresholds,\n): number => {\n\t/*\n  // This function only looks at the distance to one edge\n  // Example: looking at bottom edge\n  |----------------------------------|\n  |                                  |\n  |                                  |\n  |                                  |\n  |                                  |\n  |                                  | => no scroll in this range\n  |                                  |\n  |                                  |\n  |  startScrollingFrom (eg 100px)   |\n  |                                  |\n  |                                  | => increased scroll value the closer to maxScrollValueAt\n  |  maxScrollValueAt (eg 10px)      |\n  |                                  | => max scroll value in this range\n  |----------------------------------|\n  */\n\n\t// too far away to auto scroll\n\tif (distanceToEdge > thresholds.startScrollingFrom) {\n\t\treturn 0;\n\t}\n\n\t// use max speed when on or over boundary\n\tif (distanceToEdge <= thresholds.maxScrollValueAt) {\n\t\treturn config.maxPixelScroll;\n\t}\n\n\t// when just going on the boundary return the minimum integer\n\tif (distanceToEdge === thresholds.startScrollingFrom) {\n\t\treturn minScroll;\n\t}\n\n\t// to get the % past startScrollingFrom we will calculate\n\t// the % the value is from maxScrollValueAt and then invert it\n\tconst percentageFromMaxScrollValueAt: number = getPercentage({\n\t\tstartOfRange: thresholds.maxScrollValueAt,\n\t\tendOfRange: thresholds.startScrollingFrom,\n\t\tcurrent: distanceToEdge,\n\t});\n\n\tconst percentageFromStartScrollingFrom: number = 1 - percentageFromMaxScrollValueAt;\n\n\tconst scroll: number = config.maxPixelScroll * config.ease(percentageFromStartScrollingFrom);\n\n\t// scroll will always be a positive integer\n\treturn Math.ceil(scroll);\n};\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/src/internal/get-scroll/get-scroll-on-axis/get-value.ts",
    "content": "// Source: https://github.com/atlassian/react-beautiful-dnd\n\nimport { minScroll } from '../../constants';\n\nimport { dampenValueByTime } from './dampen-value-by-time';\nimport type { DistanceThresholds } from './get-distance-thresholds';\nimport { getValueFromDistance } from './get-value-from-distance';\n\ntype Args = {\n\tdistanceToEdge: number;\n\tthresholds: DistanceThresholds;\n\tdragStartTime: number;\n\tshouldUseTimeDampening: boolean;\n};\n\nexport const getValue = ({\n\tdistanceToEdge,\n\tthresholds,\n\tdragStartTime,\n\tshouldUseTimeDampening,\n}: Args): number => {\n\tconst scroll: number = getValueFromDistance(distanceToEdge, thresholds);\n\n\t// not enough distance to trigger a minimum scroll\n\t// we can bail here\n\tif (scroll === 0) {\n\t\treturn 0;\n\t}\n\n\t// Dampen an auto scroll speed based on duration of drag\n\n\tif (!shouldUseTimeDampening) {\n\t\treturn scroll;\n\t}\n\n\t// Once we know an auto scroll should occur based on distance,\n\t// we must let at least 1px through to trigger a scroll event an\n\t// another auto scroll call\n\n\treturn Math.max(dampenValueByTime(scroll, dragStartTime), minScroll);\n};\n\nexport default getValue;\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/src/internal/get-scroll/get-scroll-on-axis/index.ts",
    "content": "// Source: https://github.com/atlassian/react-beautiful-dnd\n\nimport type { Rect } from 'css-box-model';\n\nimport type { Axis, Spacing } from '../../types';\n\nimport getDistanceThresholds from './get-distance-thresholds';\nimport getValue from './get-value';\n\ntype GetOnAxisArgs = {\n\tcontainer: Rect;\n\tdistanceToEdges: Spacing;\n\tdragStartTime: number;\n\taxis: Axis;\n\tshouldUseTimeDampening: boolean;\n};\n\nexport default ({\n\tcontainer,\n\tdistanceToEdges,\n\tdragStartTime,\n\taxis,\n\tshouldUseTimeDampening,\n}: GetOnAxisArgs): number => {\n\tconst thresholds = getDistanceThresholds(container, axis);\n\tconst isCloserToEnd: boolean = distanceToEdges[axis.end] < distanceToEdges[axis.start];\n\n\tif (isCloserToEnd) {\n\t\treturn getValue({\n\t\t\tdistanceToEdge: distanceToEdges[axis.end],\n\t\t\tthresholds,\n\t\t\tdragStartTime,\n\t\t\tshouldUseTimeDampening,\n\t\t});\n\t}\n\n\treturn (\n\t\t-1 *\n\t\tgetValue({\n\t\t\tdistanceToEdge: distanceToEdges[axis.start],\n\t\t\tthresholds,\n\t\t\tdragStartTime,\n\t\t\tshouldUseTimeDampening,\n\t\t})\n\t);\n};\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/src/internal/get-scroll/index.ts",
    "content": "// Source: https://github.com/atlassian/react-beautiful-dnd\n\nimport type { Rect } from 'css-box-model';\n\nimport type { Position } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport { horizontal, vertical } from '../constants';\nimport { apply, isEqual, origin } from '../position';\nimport type { Spacing } from '../types';\n\nimport getScrollOnAxis from './get-scroll-on-axis';\n\n// will replace -0 and replace with +0\nconst clean = apply((value: number) => (value === 0 ? 0 : value));\n\ntype Args = {\n\tdragStartTime: number;\n\tcontainer: Rect;\n\tcenter: Position;\n\tshouldUseTimeDampening: boolean;\n};\n\nexport default ({\n\tdragStartTime,\n\tcontainer,\n\tcenter,\n\tshouldUseTimeDampening,\n}: Args): Position | null => {\n\t// get distance to each edge\n\tconst distanceToEdges: Spacing = {\n\t\ttop: center.y - container.top,\n\t\tright: container.right - center.x,\n\t\tbottom: container.bottom - center.y,\n\t\tleft: center.x - container.left,\n\t};\n\n\t// 1. Figure out which x,y values are the best target\n\t// 2. Can the container scroll in that direction at all?\n\t// If no for both directions, then return null\n\t// 3. Is the center close enough to a edge to start a drag?\n\t// 4. Based on the distance, calculate the speed at which a scroll should occur\n\t// The lower distance value the faster the scroll should be.\n\t// Maximum speed value should be hit before the distance is 0\n\t// Negative values to not continue to increase the speed\n\tconst y: number = getScrollOnAxis({\n\t\tcontainer,\n\t\tdistanceToEdges,\n\t\tdragStartTime,\n\t\taxis: vertical,\n\t\tshouldUseTimeDampening,\n\t});\n\tconst x: number = getScrollOnAxis({\n\t\tcontainer,\n\t\tdistanceToEdges,\n\t\tdragStartTime,\n\t\taxis: horizontal,\n\t\tshouldUseTimeDampening,\n\t});\n\n\tconst required: Position = clean({ x, y });\n\n\t// nothing required\n\tif (isEqual(required, origin)) {\n\t\treturn null;\n\t}\n\n\treturn required;\n};\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/src/internal/get-scrollable-scroll-change.ts",
    "content": "// Source: https://github.com/atlassian/react-beautiful-dnd\n\nimport type { Position } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport { canScrollScrollable } from './can-scroll';\nimport getScroll from './get-scroll';\nimport type { Scrollable } from './types';\n\ntype Args = {\n\tscrollable: Scrollable;\n\tcenter: Position;\n\tdragStartTime: number;\n\tshouldUseTimeDampening: boolean;\n};\n\nexport default ({\n\tscrollable,\n\tcenter,\n\tdragStartTime,\n\tshouldUseTimeDampening,\n}: Args): Position | null => {\n\tconst scroll: Position | null = getScroll({\n\t\tdragStartTime,\n\t\tcontainer: scrollable.container,\n\t\tcenter,\n\t\tshouldUseTimeDampening,\n\t});\n\n\treturn scroll && canScrollScrollable(scrollable, scroll) ? scroll : null;\n};\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/src/internal/get-scrollable.ts",
    "content": "import { getRect } from 'css-box-model';\n\nimport type { Scrollable } from './types';\n\n// Simplified version of RBD's droppable: minimum required fields just to get it working with cursor-based scolling.\nexport const getScrollable = ({\n\tclosestScrollable,\n}: {\n\tclosestScrollable: Element;\n}): Scrollable => {\n\tconst rect: DOMRect = closestScrollable.getBoundingClientRect();\n\tconst scrollPosition = {\n\t\tx: closestScrollable.scrollLeft,\n\t\ty: closestScrollable.scrollTop,\n\t};\n\n\treturn {\n\t\tcontainer: getRect(rect),\n\t\tscroll: {\n\t\t\tcurrent: scrollPosition,\n\t\t\tmax: {\n\t\t\t\tx: closestScrollable.scrollWidth - closestScrollable.clientWidth,\n\t\t\t\ty: closestScrollable.scrollHeight - closestScrollable.clientHeight,\n\t\t\t},\n\t\t},\n\t};\n};\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/src/internal/get-window-scroll-change.ts",
    "content": "// Source: https://github.com/atlassian/react-beautiful-dnd\n\nimport type { Position } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport { canScrollWindow } from './can-scroll';\nimport getScroll from './get-scroll';\nimport type { Viewport } from './types';\n\ntype Args = {\n\tviewport: Viewport;\n\tcenter: Position;\n\tdragStartTime: number;\n\tshouldUseTimeDampening: boolean;\n};\n\nexport default ({\n\tviewport,\n\tcenter,\n\tdragStartTime,\n\tshouldUseTimeDampening,\n}: Args): Position | null => {\n\tconst scroll: Position | null = getScroll({\n\t\tdragStartTime,\n\t\tcontainer: viewport.container,\n\t\tcenter,\n\t\tshouldUseTimeDampening,\n\t});\n\n\treturn scroll && canScrollWindow(viewport, scroll) ? scroll : null;\n};\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/src/internal/position.ts",
    "content": "// Source: https://github.com/atlassian/react-beautiful-dnd\n\nimport type { Position } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nexport const origin: Position = { x: 0, y: 0 };\n\n// used to apply any function to both values of a point\n// eg: const floor = apply(Math.floor)(point);\nexport const apply =\n\t(fn: (value: number) => number) =>\n\t(point: Position): Position => ({\n\t\tx: fn(point.x),\n\t\ty: fn(point.y),\n\t});\n\nexport const isEqual = (point1: Position, point2: Position): boolean =>\n\tpoint1.x === point2.x && point1.y === point2.y;\n\nexport const add = (point1: Position, point2: Position): Position => ({\n\tx: point1.x + point2.x,\n\ty: point1.y + point2.y,\n});\n\nexport const subtract = (point1: Position, point2: Position): Position => ({\n\tx: point1.x - point2.x,\n\ty: point1.y - point2.y,\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/src/internal/scroll.ts",
    "content": "import { getElementFromPointWithoutHoneypot } from '@atlaskit/pragmatic-drag-and-drop/private/get-element-from-point-without-honey-pot';\nimport type { Input, Position } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport { getClosestScrollableElement } from './get-closest-scrollable-element';\nimport { getScrollable } from './get-scrollable';\nimport getScrollableScrollChange from './get-scrollable-scroll-change';\nimport getWindowScrollChange from './get-window-scroll-change';\nimport type { Scrollable, ScrollBehavior } from './types';\nimport getViewport from './window/get-viewport';\n\ntype Args = {\n\tinput: Input;\n\tdragStartTime: number;\n\tshouldUseTimeDampening: boolean;\n\tscrollElement: (element: Element, change: Position) => void;\n\tscrollWindow: (change: Position) => void;\n\tbehavior: ScrollBehavior;\n};\n\nexport const scroll = ({\n\tinput,\n\tdragStartTime,\n\tshouldUseTimeDampening,\n\tscrollElement,\n\tscrollWindow,\n\tbehavior,\n}: Args): void => {\n\tconst tryScrollWindow = () => {\n\t\tconst viewport = getViewport();\n\t\tconst windowScrollChange: Position | null = getWindowScrollChange({\n\t\t\tdragStartTime,\n\t\t\tviewport,\n\t\t\tcenter: {\n\t\t\t\tx: input.clientX + viewport.scroll.current.x,\n\t\t\t\ty: input.clientY + viewport.scroll.current.y,\n\t\t\t},\n\t\t\tshouldUseTimeDampening,\n\t\t});\n\n\t\tif (windowScrollChange) {\n\t\t\tscrollWindow(windowScrollChange);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t};\n\n\tconst tryScrollContainer = () => {\n\t\tconst over = getElementFromPointWithoutHoneypot({ x: input.clientX, y: input.clientY });\n\t\tconst closestScrollable: Element | null = getClosestScrollableElement(over);\n\n\t\tif (!closestScrollable) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst scrollable: Scrollable = getScrollable({\n\t\t\tclosestScrollable,\n\t\t});\n\n\t\tconst scrollableScrollChange: Position | null = getScrollableScrollChange({\n\t\t\tdragStartTime,\n\t\t\tscrollable,\n\t\t\tcenter: { x: input.clientX, y: input.clientY },\n\t\t\tshouldUseTimeDampening,\n\t\t});\n\n\t\tif (scrollableScrollChange) {\n\t\t\tscrollElement(closestScrollable, scrollableScrollChange);\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t};\n\n\tif (behavior === 'container-only') {\n\t\ttryScrollContainer();\n\t}\n\tif (behavior === 'window-only') {\n\t\ttryScrollWindow();\n\t}\n\tif (behavior === 'container-then-window') {\n\t\ttryScrollContainer() || tryScrollWindow();\n\t}\n\tif (behavior === 'window-then-container') {\n\t\ttryScrollWindow() || tryScrollContainer();\n\t}\n};\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/src/internal/types.ts",
    "content": "import type { Rect } from 'css-box-model';\n\nimport type { Position } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nexport type AxisDirection = 'horizontal' | 'vertical';\n\nexport type VerticalAxis = {\n\tdirection: 'vertical';\n\tstart: 'top';\n\tend: 'bottom';\n\tsize: 'height';\n\tscrollAxis: 'scrollTop';\n};\n\nexport type HorizontalAxis = {\n\tdirection: 'horizontal';\n\tstart: 'left';\n\tend: 'right';\n\tsize: 'width';\n\tscrollAxis: 'scrollLeft';\n};\n\nexport type Axis = VerticalAxis | HorizontalAxis;\n\nexport type Spacing = {\n\ttop: number;\n\tbottom: number;\n\tleft: number;\n\tright: number;\n};\n\nexport type ScrollSize = {\n\tscrollHeight: number;\n\tscrollWidth: number;\n};\n\nexport type ScrollDetails = {\n\tcurrent: Position;\n\t// the maximum allowable scroll for the frame\n\tmax: Position;\n};\n\nexport type Scrollable = {\n\tscroll: ScrollDetails;\n\tcontainer: Rect;\n};\n\nexport type Viewport = {\n\tcontainer: Rect;\n\tscroll: ScrollDetails;\n};\n\nexport type ScrollBehavior =\n\t| 'window-then-container'\n\t| 'container-then-window'\n\t| 'window-only'\n\t| 'container-only';\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/src/internal/window/get-max-window-scroll.ts",
    "content": "import type { Position } from 'css-box-model';\n\nimport getMaxScroll from '../get-max-scroll';\n\nexport default (): Position => {\n\tconst doc: HTMLElement = document.documentElement;\n\n\tconst maxScroll: Position = getMaxScroll({\n\t\t// unclipped padding box, with scrollbar\n\t\tscrollHeight: doc.scrollHeight,\n\t\tscrollWidth: doc.scrollWidth,\n\t\t// clipped padding box, without scrollbar\n\t\twidth: doc.clientWidth,\n\t\theight: doc.clientHeight,\n\t});\n\n\treturn maxScroll;\n};\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/src/internal/window/get-viewport.ts",
    "content": "import { getRect } from 'css-box-model';\n\nimport type { Position } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport type { Viewport } from '../types';\n\nimport getMaxWindowScroll from './get-max-window-scroll';\nimport getWindowScroll from './get-window-scroll';\n\nexport default (): Viewport => {\n\tconst scroll: Position = getWindowScroll();\n\tconst maxScroll: Position = getMaxWindowScroll();\n\n\tconst top: number = scroll.y;\n\tconst left: number = scroll.x;\n\n\t// window.innerHeight: includes scrollbars (not what we want)\n\t// document.clientHeight gives us the correct value when using the html5 doctype\n\tconst doc: HTMLElement = document.documentElement;\n\t// Using these values as they do not consider scrollbars\n\t// padding box, without scrollbar\n\tconst width: number = doc.clientWidth;\n\tconst height: number = doc.clientHeight;\n\n\t// Computed\n\tconst right: number = left + width;\n\tconst bottom: number = top + height;\n\n\tconst container = getRect({\n\t\ttop,\n\t\tleft,\n\t\tright,\n\t\tbottom,\n\t});\n\n\tconst viewport: Viewport = {\n\t\tcontainer,\n\t\tscroll: {\n\t\t\tcurrent: scroll,\n\t\t\tmax: maxScroll,\n\t\t},\n\t};\n\n\treturn viewport;\n};\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/src/internal/window/get-window-scroll.ts",
    "content": "import type { Position } from '@atlaskit/pragmatic-drag-and-drop/types';\n\n// The browsers update document.documentElement.scrollTop and window.pageYOffset\n// differently as the window scrolls.\n\n// Webkit\n// documentElement.scrollTop: no update. Stays at 0\n// window.pageYOffset: updates to whole number\n\n// Chrome\n// documentElement.scrollTop: update with fractional value\n// window.pageYOffset: update with fractional value\n\n// FireFox\n// documentElement.scrollTop: updates to whole number\n// window.pageYOffset: updates to whole number\n\n// IE11 (same as firefox)\n// documentElement.scrollTop: updates to whole number\n// window.pageYOffset: updates to whole number\n\n// Edge (same as webkit)\n// documentElement.scrollTop: no update. Stays at 0\n// window.pageYOffset: updates to whole number\n\nexport default (): Position => ({\n\tx: window.pageXOffset,\n\ty: window.pageYOffset,\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-autoscroll/tsconfig.json",
    "content": "{\n  \"extends\": \"../../tsconfig.json\",\n  \"include\": [\n    \"__tests__/**/*.ts\",\n    \"__tests__/**/*.tsx\",\n    \"docs/**/*.ts\",\n    \"docs/**/*.tsx\",\n    \"examples/**/*.ts\",\n    \"examples/**/*.tsx\",\n    \"src/**/*.ts\",\n    \"src/**/*.tsx\",\n    \"**/stories.ts\",\n    \"**/stories.tsx\",\n    \"**/stories/*.ts\",\n    \"**/stories/*.tsx\",\n    \"**/stories/**/*.ts\",\n    \"**/stories/**/*.tsx\"\n  ]\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/.npmignore",
    "content": "src/\nexamples-utils/\nexamples/\nindex.ts\ndocs/\nbuild/\n__tests__/\ntsconfig.json\ntsconfig.app.json\ntsconfig.dev.json\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/CHANGELOG.md",
    "content": "# @atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration\n\n## 2.0.15\n\n### Patch Changes\n\n- [`acb61d1d6efd9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/acb61d1d6efd9) -\n  Add dependency for a11y testing.\n- Updated dependencies\n\n## 2.0.14\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.0.13\n\n### Patch Changes\n\n- [`d3ed1b65a2181`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d3ed1b65a2181) -\n  Add @atlassian/a11y-jest-testing to devDependencies.\n\n## 2.0.12\n\n### Patch Changes\n\n- [`aa9ff75020fcb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/aa9ff75020fcb) -\n  Add @atlassian/a11y-jest-testing to devDependencies.\n- Updated dependencies\n\n## 2.0.11\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.0.10\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.0.9\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.0.8\n\n### Patch Changes\n\n- [`4891ea5a24e1b`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4891ea5a24e1b) -\n  Typescript changes.\n\n## 2.0.7\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.0.6\n\n### Patch Changes\n\n- [`e8c312827c802`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e8c312827c802) -\n  Remove unnecessary files from published package\n\n## 2.0.5\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.0.4\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.0.3\n\n### Patch Changes\n\n- [#150219](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/150219)\n  [`8f6e3a7613db0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8f6e3a7613db0) -\n  Fixes invalid css comments in template literal styles\n\n## 2.0.2\n\n### Patch Changes\n\n- [#127093](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/127093)\n  [`1378ea7a99ce1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1378ea7a99ce1) -\n  Upgrades `jscodeshift` to handle generics properly.\n- Updated dependencies\n\n## 2.0.1\n\n### Patch Changes\n\n- [#120533](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/120533)\n  [`f1bec731e278f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f1bec731e278f) -\n  Adds a `sideEffects` field to ensure this package does not have Compiled styles tree-shaken in the\n  future to avoid an accidental regression.\n\n  This is related to\n  https://community.developer.atlassian.com/t/rfc-73-migrating-our-components-to-compiled-css-in-js/85953\n\n## 2.0.0\n\n### Major Changes\n\n- [#117363](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/117363)\n  [`10a0f7f6c2027`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/10a0f7f6c2027) -\n  This package's `peerDependencies` have been adjusted for `react` and/or `react-dom` to reflect the\n  status of only supporting React 18 going forward. No explicit breaking change to React support has\n  been made in this release, but this is to signify going forward, breaking changes for React 16 or\n  React 17 may come via non-major semver releases.\n\n  Please refer this community post for more details:\n  https://community.developer.atlassian.com/t/rfc-78-dropping-support-for-react-16-and-rendering-in-a-react-18-concurrent-root-in-jira-and-confluence/87026\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.4.1\n\n### Patch Changes\n\n- [#113483](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/113483)\n  [`e9c1247224a94`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e9c1247224a94) -\n  Internal refactor to Draggable to resolve issue with React 18 strict mode re-running effects in\n  development mode.\n\n## 1.4.0\n\n### Minor Changes\n\n- [#109060](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109060)\n  [`4660ec858a305`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4660ec858a305) -\n  Update `React` from v16 to v18\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.3.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.3.0\n\n### Minor Changes\n\n- [#168054](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/168054)\n  [`6e5ded7326f80`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6e5ded7326f80) -\n  Removes dependency on @atlaskit/pragmatic-drag-and-drop-live-region and now maintains live region\n  code internally.\n\n## 1.2.4\n\n### Patch Changes\n\n- [#153912](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/153912)\n  [`fb6d3603aa8df`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/fb6d3603aa8df) -\n  Internal fix to batched updates check that determines if React 16 is being used. Previously it\n  assumed the `version` export from `react-dom` was always defined, but it was only introduced in\n  `react-dom@16.13.0`\n\n## 1.2.3\n\n### Patch Changes\n\n- [#150464](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/150464)\n  [`b813bd74ede6d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b813bd74ede6d) -\n  Updates internal configuration files\n- Updated dependencies\n\n## 1.2.2\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.2.1\n\n### Patch Changes\n\n- [#124164](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/124164)\n  [`58941fa1d332a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/58941fa1d332a) -\n  All `react` unit tests will now run against `react@16` and `react@18` on CI.\n\n## 1.2.0\n\n### Minor Changes\n\n- [#116572](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116572)\n  [`98c65e7ff719c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/98c65e7ff719c) -\n  🍯 Introducing \"the honey pot fix\" which is an improved workaround for a\n  [painful browser bug](https://issues.chromium.org/issues/41129937).\n\n  **Background**\n\n  The browser bug causes the browser to think the users pointer is continually depressed at the\n  point that the user started a drag. This could lead to incorrect events being triggered, and\n  incorrect styles being applied to elements that the user is not currently over during a drag.\n\n  **Outcomes**\n  - Elements will no longer receive `MouseEvent`s (eg `\"mouseenter\"` and `\"mouseleave\"`) during a\n    drag (which is a violation of the\n    [drag and drop specification](https://html.spec.whatwg.org/multipage/dnd.html#drag-and-drop-processing-model))\n  - Elements will no longer apply `:hover` or `:active` styles during a drag. Previously consumers\n    would need to disable these style rules during a drag to prevent these styles being applied.\n  - Dramatically improved post drop performance. Our prior solution could require a noticeable delay\n    due to a large style recalculation after a drop.\n\n### Patch Changes\n\n- [#116984](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116984)\n  [`b13f5ee80ab4f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b13f5ee80ab4f) -\n  Fixing event listener cleanup test\n- Updated dependencies\n\n## 1.1.3\n\n### Patch Changes\n\n- [#114764](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/114764)\n  [`ae20dac6e31c4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ae20dac6e31c4) -\n  Bump packages to use react-beautiful-dnd@12.2.0\n\n## 1.1.2\n\n### Patch Changes\n\n- [#94316](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/94316)\n  [`35fd5ed8e1d7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/35fd5ed8e1d7) -\n  Upgrading internal dependency `bind-event-listener` to `@^3.0.0`\n\n## 1.1.1\n\n### Patch Changes\n\n- [#92913](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/92913)\n  [`8f7e827e0978`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8f7e827e0978) -\n  Some Pragmatic drag and drop packages did not have `\"author\"` and or `\"license\"` attributes set in\n  their `package.json` file. These missing attributes have now been added where required.\n\n  ```diff\n  + \"author\": \"Atlassian Pty Ltd\",\n  + \"license\": \"Apache-2.0\",\n  ```\n\n  All Pragmatic drag and drop packages were already licensed under `Apache-2.0` (see `LICENSE`\n  files), but the `\"license\"` attribute in some `package.json` files was missing.\n\n- [#92913](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/92913)\n  [`96a6f6a19a73`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/96a6f6a19a73) -\n  Adding missing Apache 2.0 license file. This package has always been licensed under Apache 2.0\n  (same as the other Pragmatic drag and drop packages).\n\n## 1.1.0\n\n### Minor Changes\n\n- [#87853](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87853)\n  [`54e884fd8d96`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/54e884fd8d96) -\n  Increasing `react` `peerDependency` range to include `react@17` and `react@18`.\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.0.3\n\n### Patch Changes\n\n- [#84250](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84250)\n  [`a1cc31800621`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a1cc31800621) -\n  Internal refactor: now relying on automatic fallback insertion for `token()`. This change provides\n  an improved experience for consumers who don't have Atlassian Design tokens enabled.\n\n## 1.0.2\n\n### Patch Changes\n\n- [#83702](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83702)\n  [`4d9e25ab4eaa`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4d9e25ab4eaa) -\n  Updating the descriptions of Pragmatic drag and drop packages, so they each provide a consistent\n  description to various consumers, and so they are consistently formed amongst each other.\n  - `package.json` `description`\n  - `README.md`\n  - Website documentation\n\n## 1.0.1\n\n### Patch Changes\n\n- [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116)\n  [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) -\n  Upgrade Typescript from `4.9.5` to `5.4.2`\n\n## 1.0.0\n\n### Major Changes\n\n- [#70616](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70616)\n  [`42e57ea65fee`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/42e57ea65fee) -\n  This is our first `major` release (`1.0`) for all Pragmatic drag and drop packages.\n\n  For a detailed explanation of these changes, and how to upgrade (automatically) to `1.0` please\n  see our\n  [1.0 upgrade guide](http://atlassian.design/components/pragmatic-drag-and-drop/core-package/upgrade-guides/upgrade-guide-for-1.0)\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.17.7\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.17.6\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.17.5\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.17.4\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.17.3\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.17.2\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.17.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.17.0\n\n### Minor Changes\n\n- [#37394](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/37394)\n  [`006a7d12e9a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/006a7d12e9a) - Internal\n  folder name refactor\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.16.0\n\n### Minor Changes\n\n- [#36716](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/36716)\n  [`d25fd8a9056`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d25fd8a9056) - React\n  updates are now batched for React 16. Other optimizations have also been made to reduce the number\n  of re-renders that occur.\n\n## 0.15.0\n\n### Minor Changes\n\n- [#34585](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34585)\n  [`d71c9cef468`](https://bitbucket.org/atlassian/atlassian-frontend/commits/d71c9cef468) - [ux] The\n  cross axis offset of keyboard drag previews is now a fixed value, instead of being\n  percentage-based.\n\n## 0.14.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.14.0\n\n### Minor Changes\n\n- [#35198](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/35198)\n  [`f32aef7bfed`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f32aef7bfed) - [ux]\n  Adds a grab cursor when hovering over draggable elements. Also adds other styles provided by the\n  `react-beautiful-dnd` style marshal.\n\n## 0.13.0\n\n### Minor Changes\n\n- [#35305](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/35305)\n  [`5e58af07ce8`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5e58af07ce8) - [ux]\n  Entering a droppable from the start will now target the first index instead of the last.\n\n## 0.12.0\n\n### Minor Changes\n\n- [#34561](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34561)\n  [`9909027b163`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9909027b163) - It is\n  now possible to unmount a `<Draggable/>` in a virtual list at any time during a drag operation,\n  including while it is still visible.\n\n## 0.11.0\n\n### Minor Changes\n\n- [#34694](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34694)\n  [`07779f6c5f7`](https://bitbucket.org/atlassian/atlassian-frontend/commits/07779f6c5f7) - Pointer\n  drags are now blocked by interactive elements. This can be overriden using the\n  `disableInteractiveElementBlocking` prop. This behavior is consistent with `react-beautiful-dnd`.\n\n## 0.10.0\n\n### Minor Changes\n\n- [#34690](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34690)\n  [`245cc4ba6c3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/245cc4ba6c3) - [ux]\n  Drags will no longer start while holding down a modifier key. This change was done in order to\n  match react-beautiful-dnd behaviour.\n\n## 0.9.1\n\n### Patch Changes\n\n- [#34443](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34443)\n  [`61cb5313358`](https://bitbucket.org/atlassian/atlassian-frontend/commits/61cb5313358) - Removing\n  unused dependencies and dev dependencies\n\n## 0.9.0\n\n### Minor Changes\n\n- [#34199](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34199)\n  [`541c0511010`](https://bitbucket.org/atlassian/atlassian-frontend/commits/541c0511010) - [ux]\n  Dragging elements are now slightly transparent, to allow better visibility of drop indicators.\n  This also better aligns with native browser drag previews.\n\n## 0.8.0\n\n### Minor Changes\n\n- [#34030](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34030)\n  [`1af8b676f81`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1af8b676f81) - When\n  starting a keyboard drag, key bindings are now added synchronously. Previously, they were added in\n  a `requestAnimationFrame()` callback.\n\n## 0.7.0\n\n### Minor Changes\n\n- [#33945](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33945)\n  [`a12da51e227`](https://bitbucket.org/atlassian/atlassian-frontend/commits/a12da51e227) - Makes\n  `react-dom` a peer dependency instead of a direct dependency.\n\n## 0.6.0\n\n### Minor Changes\n\n- [#33797](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33797)\n  [`b560a09202a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b560a09202a) - Fixes a\n  memoization issue, significantly improving rerender performance.\n\n## 0.5.0\n\n### Minor Changes\n\n- [#33590](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33590)\n  [`69c2501037c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/69c2501037c) - Fixes a\n  bug that caused parent scroll containers to jump to the top when returning to the source location\n  during a keyboard drag.\n\n### Patch Changes\n\n- [#33793](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33793)\n  [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure\n  legacy types are published for TS 4.5-4.8\n\n## 0.4.2\n\n### Patch Changes\n\n- [#33649](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33649)\n  [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade\n  Typescript from `4.5.5` to `4.9.5`\n\n## 0.4.1\n\n### Patch Changes\n\n- [#33561](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33561)\n  [`be8246510ed`](https://bitbucket.org/atlassian/atlassian-frontend/commits/be8246510ed) - Ensures\n  that keyboard drag event bindings are properly cleaned up when a drag is cancelled because of an\n  unhandled error on the window.\n\n## 0.4.0\n\n### Minor Changes\n\n- [#33344](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33344)\n  [`9fd8556db17`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9fd8556db17) - Internal\n  folder name structure change\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.3.0\n\n### Minor Changes\n\n- [#33262](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33262)\n  [`34ed7b2ec63`](https://bitbucket.org/atlassian/atlassian-frontend/commits/34ed7b2ec63) - We have\n  changed the name of our drag and drop packages to align on the single name of \"Pragmatic drag and\n  drop\"\n\n  ```diff\n  - @atlaskit/drag-and-drop\n  + @atlaskit/pragmatic-drag-and-drop\n\n  - @atlaskit/drag-and-drop-autoscroll\n  + @atlaskit/pragmatic-drag-and-drop-autoscroll\n\n  - @atlaskit/drag-and-drop-hitbox\n  + @atlaskit/pragmatic-drag-and-drop-hitbox\n\n  - @atlaskit/drag-and-drop-indicator\n  + @atlaskit/pragmatic-drag-and-drop-react-indicator\n  # Note: `react` was added to this package name as our indicator package is designed for usage with `react`.\n\n  - @atlaskit/drag-and-drop-live-region\n  + @atlaskit/pragmatic-drag-and-drop-live-region\n\n  - @atlaskit/drag-and-drop-react-beautiful-dnd-migration\n  + @atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration\n\n  - @atlaskit/drag-and-drop-docs\n  + @atlaskit/pragmatic-drag-and-drop-docs\n  ```\n\n  The new `@atlaskit/pragmatic-drag-and-drop*` packages will start their initial versions from where\n  the ``@atlaskit/drag-and-drop*` packages left off. Doing this will make it easier to look back on\n  changelogs and see how the packages have progressed.\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.2.1\n\n### Patch Changes\n\n- [#33263](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33263)\n  [`16a901a9476`](https://bitbucket.org/atlassian/atlassian-frontend/commits/16a901a9476) - - Fixes\n  a bug that could lead to invalid syntax when inserting comments before a `JSXExpressionContainer`\n  node. Comments will now be wrapped in a new `JSXExpressionContainer` node.\n  - Adds a file filter to the codemod transformers, so that only files which import either\n    `react-beautiful-dnd` or `react-beautiful-dnd-next` will be processed.\n\n## 0.2.0\n\n### Minor Changes\n\n- [#33258](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33258)\n  [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip\n  minor dependency bump\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.1.0\n\n### Minor Changes\n\n- [#32921](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32921)\n  [`6be2b5508a9`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6be2b5508a9) - Initial\n  release\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/LICENSE.md",
    "content": "Copyright 2022 Atlassian Pty Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in\ncompliance with the License. You may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is\ndistributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\nimplied. See the License for the specific language governing permissions and limitations under the\nLicense.\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/README.md",
    "content": "## Pragmatic drag and drop\n\nAn optional Pragmatic drag and drop package that enables rapid migration from [`react-beautiful-dnd`](https://github.com/atlassian/react-beautiful-dnd) to Pragmatic drag and drop.\n\n[📖 Documentation](https://atlassian.design/components/pragmatic-drag-and-drop/)\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/informational-vr-tests/drop-indicator.vr.tsx",
    "content": "import type { Locator, Page } from '@playwright/test';\nimport type { BoundingBox } from 'puppeteer';\nimport invariant from 'tiny-invariant';\n\nimport {\n\tDevice,\n\ttype Hooks,\n\tsnapshotInformational,\n\ttype SnapshotTestOptions,\n} from '@af/visual-regression';\n\nimport BoardExample from '../../examples/01-board';\nimport ReactWindowExample from '../../examples/02-react-window';\nimport ReactVirtualizedExample from '../../examples/03-react-virtualized';\n\nconst variants: SnapshotTestOptions<Hooks>['variants'] = [\n\t{\n\t\tenvironment: { colorScheme: 'light' },\n\t\tname: 'desktop-chrome',\n\t\tdevice: Device.DESKTOP_CHROME,\n\t},\n];\n\nconst gap = 8;\n\nfunction getDropTargetPoint({\n\tregion,\n\tdropTargetBox,\n}: {\n\tregion: 'top-left' | 'bottom-left' | 'center';\n\tdropTargetBox: BoundingBox;\n}): { x: number; y: number } {\n\tif (region === 'top-left') {\n\t\treturn {\n\t\t\tx: dropTargetBox.x + gap,\n\t\t\ty: dropTargetBox.y + gap,\n\t\t};\n\t}\n\n\tif (region === 'bottom-left') {\n\t\treturn {\n\t\t\tx: dropTargetBox.x + gap,\n\t\t\ty: dropTargetBox.y + dropTargetBox.height - gap,\n\t\t};\n\t}\n\n\t// Center\n\treturn {\n\t\tx: dropTargetBox.x + dropTargetBox.width / 2,\n\t\ty: dropTargetBox.y + dropTargetBox.height / 2,\n\t};\n}\n\nasync function dragToElement({\n\tpage,\n\tdraggable,\n\tdropTarget,\n\tregion,\n}: {\n\tpage: Page;\n\tdraggable: Locator;\n\tdropTarget: Locator;\n\tregion: 'top-left' | 'bottom-left' | 'center';\n}) {\n\tconst draggableBox = await draggable.boundingBox();\n\tinvariant(draggableBox, 'unable to get bounding box for draggable');\n\n\tconst dropTargetBox = await dropTarget.boundingBox();\n\tinvariant(dropTargetBox, 'unable to get bounding box for dropTarget');\n\n\t// Start drag\n\tawait page.mouse.move(draggableBox.x + 1, draggableBox.y + 1);\n\tawait page.mouse.down();\n\tawait page.mouse.move(draggableBox.y + 10, draggableBox.y + 1);\n\n\tconst dropTargetPoint = getDropTargetPoint({ region, dropTargetBox });\n\n\tawait page.mouse.move(dropTargetPoint.x, dropTargetPoint.y);\n\t// Second movement needed to ensure drag preview is updated\n\tawait page.mouse.move(dropTargetPoint.x, dropTargetPoint.y);\n}\n\n/**\n * Board example tests\n */\nsnapshotInformational(BoardExample, {\n\tdescription: 'Drop indicators - Board - draggable targets - top position',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tconst cardB0 = page.getByTestId('item-B0');\n\n\t\tawait dragToElement({ page, draggable: cardA0, dropTarget: cardB0, region: 'top-left' });\n\t},\n});\n\nsnapshotInformational(BoardExample, {\n\tdescription: 'Drop indicators - Board - draggable targets - bottom position',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tconst cardB0 = page.getByTestId('item-B0');\n\n\t\tawait dragToElement({ page, draggable: cardA0, dropTarget: cardB0, region: 'bottom-left' });\n\t},\n});\n\nsnapshotInformational(BoardExample, {\n\tdescription: 'Drop indicators - Board - drag over empty space at the end of droppable',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tconst columnC = page.locator('[data-rbd-draggable-id=\"draggable-C\"]');\n\n\t\tawait dragToElement({ page, draggable: cardA0, dropTarget: columnC, region: 'bottom-left' });\n\t},\n});\n\nsnapshotInformational(BoardExample, {\n\tdescription: 'Drop indicators - Board - drag over empty droppable targets',\n\tvariants,\n\tprepare: async (page) => {\n\t\t// Clear cards from column C\n\t\tawait page.getByRole('button', { name: 'Clear column C' }).click();\n\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tconst columnC = page.locator('[data-rbd-draggable-id=\"draggable-C\"]');\n\n\t\tawait dragToElement({ page, draggable: cardA0, dropTarget: columnC, region: 'center' });\n\t},\n});\n\n/**\n * React Window example tests\n */\nsnapshotInformational(ReactWindowExample, {\n\tdescription: 'Drop indicators - React Window - draggable targets - top position',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tconst cardB0 = page.getByTestId('item-B0');\n\n\t\tawait dragToElement({ page, draggable: cardA0, dropTarget: cardB0, region: 'top-left' });\n\t},\n});\n\nsnapshotInformational(ReactWindowExample, {\n\tdescription: 'Drop indicators - React Window - draggable targets - bottom position',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tconst cardB0 = page.getByTestId('item-B0');\n\n\t\tawait dragToElement({ page, draggable: cardA0, dropTarget: cardB0, region: 'bottom-left' });\n\t},\n});\n\nsnapshotInformational(ReactWindowExample, {\n\tdescription: 'Drop indicators - React Window - drag over empty space at the end of droppable',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tconst columnC = page.locator('[data-rbd-draggable-id=\"draggable-C\"]');\n\n\t\tawait dragToElement({ page, draggable: cardA0, dropTarget: columnC, region: 'bottom-left' });\n\t},\n});\n\nsnapshotInformational(ReactWindowExample, {\n\tdescription: 'Drop indicators - React Window - drag over empty droppable targets',\n\tvariants,\n\tprepare: async (page) => {\n\t\t// Clear cards from column C\n\t\tawait page.getByRole('button', { name: 'Clear column C' }).click();\n\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tconst columnC = page.locator('[data-rbd-draggable-id=\"draggable-C\"]');\n\n\t\tawait dragToElement({ page, draggable: cardA0, dropTarget: columnC, region: 'center' });\n\t},\n});\n\n/**\n * React Virtualized example tests\n */\nsnapshotInformational(ReactVirtualizedExample, {\n\tdescription: 'Drop indicators - React Virtualized - draggable targets - top position',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tconst cardB0 = page.getByTestId('item-B0');\n\n\t\tawait dragToElement({ page, draggable: cardA0, dropTarget: cardB0, region: 'top-left' });\n\t},\n});\n\nsnapshotInformational(ReactVirtualizedExample, {\n\tdescription: 'Drop indicators - React Virtualized - draggable targets - bottom position',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tconst cardB0 = page.getByTestId('item-B0');\n\n\t\tawait dragToElement({ page, draggable: cardA0, dropTarget: cardB0, region: 'bottom-left' });\n\t},\n});\n\nsnapshotInformational(ReactVirtualizedExample, {\n\tdescription:\n\t\t'Drop indicators - React Virtualized - drag over empty space at the end of droppable',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tconst columnC = page.locator('[data-rbd-draggable-id=\"draggable-C\"]');\n\n\t\tawait dragToElement({ page, draggable: cardA0, dropTarget: columnC, region: 'bottom-left' });\n\t},\n});\n\nsnapshotInformational(ReactVirtualizedExample, {\n\tdescription: 'Drop indicators - React Virtualized - drag over empty droppable targets',\n\tvariants,\n\tprepare: async (page) => {\n\t\t// Clear cards from column C\n\t\tawait page.getByRole('button', { name: 'Clear column C' }).click();\n\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tconst columnC = page.locator('[data-rbd-draggable-id=\"draggable-C\"]');\n\n\t\tawait dragToElement({ page, draggable: cardA0, dropTarget: columnC, region: 'center' });\n\t},\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/informational-vr-tests/keyboard-drag-preview.vr.tsx",
    "content": "import {\n\tDevice,\n\ttype Hooks,\n\tsnapshotInformational,\n\ttype SnapshotTestOptions,\n} from '@af/visual-regression';\n\nimport BoardExample from '../../examples/01-board';\nimport ReactWindowExample from '../../examples/02-react-window';\nimport ReactVirtualizedExample from '../../examples/03-react-virtualized';\n\nconst variants: SnapshotTestOptions<Hooks>['variants'] = [\n\t{\n\t\tenvironment: { colorScheme: 'light' },\n\t\tname: 'desktop-chrome',\n\t\tdevice: Device.DESKTOP_CHROME,\n\t},\n];\n\n/**\n * Example: Board (standard lists)\n * Direction: vertical (dragging cards)\n */\nsnapshotInformational(BoardExample, {\n\tdescription: 'Keyboard drag preview - Board - vertical direction - initial position',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tawait cardA0.focus();\n\n\t\tawait page.keyboard.press('Space');\n\t},\n});\n\nsnapshotInformational(BoardExample, {\n\tdescription: 'Keyboard drag preview - Board - vertical direction - away position in home list',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tawait cardA0.focus();\n\n\t\tawait page.keyboard.press('Space');\n\t\t// Move down in same list\n\t\tawait page.keyboard.press('ArrowDown');\n\t},\n});\n\nsnapshotInformational(BoardExample, {\n\tdescription: 'Keyboard drag preview - Board - vertical direction - returning home in home list',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tawait cardA0.focus();\n\n\t\tawait page.keyboard.press('Space');\n\t\t// Move down in same list, then back to original position (home)\n\t\tawait page.keyboard.press('ArrowDown');\n\t\tawait page.keyboard.press('ArrowUp');\n\t},\n});\n\nsnapshotInformational(BoardExample, {\n\tdescription: 'Keyboard drag preview - Board - vertical direction - away position in away list',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tawait cardA0.focus();\n\n\t\tawait page.keyboard.press('Space');\n\t\t// Move to different list (column C)\n\t\tawait page.keyboard.press('ArrowRight');\n\t\tawait page.keyboard.press('ArrowRight');\n\t},\n});\n\nsnapshotInformational(BoardExample, {\n\tdescription: 'Keyboard drag preview - Board - vertical direction - returning home from away list',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tawait cardA0.focus();\n\n\t\tawait page.keyboard.press('Space');\n\t\t// Move to different list (column C)\n\t\tawait page.keyboard.press('ArrowRight');\n\t\tawait page.keyboard.press('ArrowRight');\n\t\t// Return to original list (column A)\n\t\tawait page.keyboard.press('ArrowLeft');\n\t\tawait page.keyboard.press('ArrowLeft');\n\t},\n});\n\n/**\n * Example: Board (standard lists)\n * Direction: horizontal (dragging columns)\n */\nsnapshotInformational(BoardExample, {\n\tdescription: 'Keyboard drag preview - Board - horizontal direction - initial position',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst columnA = page.getByTestId('column-A--header');\n\t\tawait columnA.focus();\n\n\t\tawait page.keyboard.press('Space');\n\t},\n});\n\nsnapshotInformational(BoardExample, {\n\tdescription: 'Keyboard drag preview - Board - horizontal direction - away position',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst columnA = page.getByTestId('column-A--header');\n\t\tawait columnA.focus();\n\n\t\tawait page.keyboard.press('Space');\n\n\t\t// Move between columns B and C\n\t\tawait page.keyboard.press('ArrowRight');\n\t},\n});\n\nsnapshotInformational(BoardExample, {\n\tdescription: 'Keyboard drag preview - Board - horizontal direction - returning home',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst columnA = page.getByTestId('column-A--header');\n\t\tawait columnA.focus();\n\n\t\tawait page.keyboard.press('Space');\n\t\t// Move between columns B and C, then back to original position\n\t\tawait page.keyboard.press('ArrowRight');\n\t\tawait page.keyboard.press('ArrowLeft');\n\t},\n});\n\n/**\n * Example: React window\n * Direction: vertical (dragging cards)\n */\nsnapshotInformational(ReactWindowExample, {\n\tdescription: 'Keyboard drag preview - React window - vertical direction - initial position',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tawait cardA0.focus();\n\n\t\tawait page.keyboard.press('Space');\n\t},\n});\n\nsnapshotInformational(ReactWindowExample, {\n\tdescription:\n\t\t'Keyboard drag preview - React window - vertical direction - away position in home list',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tawait cardA0.focus();\n\n\t\tawait page.keyboard.press('Space');\n\t\t// Move down in same list\n\t\tawait page.keyboard.press('ArrowDown');\n\t},\n});\n\nsnapshotInformational(ReactWindowExample, {\n\tdescription:\n\t\t'Keyboard drag preview - React window - vertical direction - returning home in home list',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tawait cardA0.focus();\n\n\t\tawait page.keyboard.press('Space');\n\t\t// Move down in same list, then back to original position (home)\n\t\tawait page.keyboard.press('ArrowDown');\n\t\tawait page.keyboard.press('ArrowUp');\n\t},\n});\n\nsnapshotInformational(ReactWindowExample, {\n\tdescription:\n\t\t'Keyboard drag preview - React window - vertical direction - away position in away list',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tawait cardA0.focus();\n\n\t\tawait page.keyboard.press('Space');\n\t\t// Move to different list (column C)\n\t\tawait page.keyboard.press('ArrowRight');\n\t\tawait page.keyboard.press('ArrowRight');\n\t},\n});\n\nsnapshotInformational(ReactWindowExample, {\n\tdescription:\n\t\t'Keyboard drag preview - React window - vertical direction - returning home from away list',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tawait cardA0.focus();\n\n\t\tawait page.keyboard.press('Space');\n\t\t// Move to different list (column C)\n\t\tawait page.keyboard.press('ArrowRight');\n\t\tawait page.keyboard.press('ArrowRight');\n\t\t// Return to original list (column A)\n\t\tawait page.keyboard.press('ArrowLeft');\n\t\tawait page.keyboard.press('ArrowLeft');\n\t},\n});\n\n/**\n * Example: React window\n * Direction: horizontal (dragging columns)\n */\nsnapshotInformational(ReactWindowExample, {\n\tdescription: 'Keyboard drag preview - React window - horizontal direction - initial position',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst columnA = page.getByTestId('column-A--header');\n\t\tawait columnA.focus();\n\n\t\tawait page.keyboard.press('Space');\n\t},\n});\n\nsnapshotInformational(ReactWindowExample, {\n\tdescription: 'Keyboard drag preview - React window - horizontal direction - away position',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst columnA = page.getByTestId('column-A--header');\n\t\tawait columnA.focus();\n\n\t\tawait page.keyboard.press('Space');\n\n\t\t// Move between columns B and C\n\t\tawait page.keyboard.press('ArrowRight');\n\t},\n});\n\nsnapshotInformational(ReactWindowExample, {\n\tdescription: 'Keyboard drag preview - React window - horizontal direction - returning home',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst columnA = page.getByTestId('column-A--header');\n\t\tawait columnA.focus();\n\n\t\tawait page.keyboard.press('Space');\n\t\t// Move between columns B and C, then back to original position\n\t\tawait page.keyboard.press('ArrowRight');\n\t\tawait page.keyboard.press('ArrowLeft');\n\t},\n});\n\n/**\n * Example: React virtualized\n * Direction: vertical (dragging cards)\n */\nsnapshotInformational(ReactVirtualizedExample, {\n\tdescription: 'Keyboard drag preview - React virtualized - vertical direction - initial position',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tawait cardA0.focus();\n\n\t\tawait page.keyboard.press('Space');\n\t},\n});\n\nsnapshotInformational(ReactVirtualizedExample, {\n\tdescription:\n\t\t'Keyboard drag preview - React virtualized - vertical direction - away position in home list',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tawait cardA0.focus();\n\n\t\tawait page.keyboard.press('Space');\n\t\t// Move down in same list\n\t\tawait page.keyboard.press('ArrowDown');\n\t},\n});\n\nsnapshotInformational(ReactVirtualizedExample, {\n\tdescription:\n\t\t'Keyboard drag preview - React virtualized - vertical direction - returning home in home list',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tawait cardA0.focus();\n\n\t\tawait page.keyboard.press('Space');\n\t\t// Move down in same list, then back to original position (home)\n\t\tawait page.keyboard.press('ArrowDown');\n\t\tawait page.keyboard.press('ArrowUp');\n\t},\n});\n\nsnapshotInformational(ReactVirtualizedExample, {\n\tdescription:\n\t\t'Keyboard drag preview - React virtualized - vertical direction - away position in away list',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tawait cardA0.focus();\n\n\t\tawait page.keyboard.press('Space');\n\t\t// Move to different list (column C)\n\t\tawait page.keyboard.press('ArrowRight');\n\t\tawait page.keyboard.press('ArrowRight');\n\t},\n});\n\nsnapshotInformational(ReactVirtualizedExample, {\n\tdescription:\n\t\t'Keyboard drag preview - React virtualized - vertical direction - returning home from away list',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tawait cardA0.focus();\n\n\t\tawait page.keyboard.press('Space');\n\t\t// Move to different list (column C)\n\t\tawait page.keyboard.press('ArrowRight');\n\t\tawait page.keyboard.press('ArrowRight');\n\t\t// Return to original list (column A)\n\t\tawait page.keyboard.press('ArrowLeft');\n\t\tawait page.keyboard.press('ArrowLeft');\n\t},\n});\n\n/**\n * Example: React virtualized\n * Direction: horizontal (dragging columns)\n */\nsnapshotInformational(ReactVirtualizedExample, {\n\tdescription:\n\t\t'Keyboard drag preview - React virtualized - horizontal direction - initial position',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst columnA = page.getByTestId('column-A--header');\n\t\tawait columnA.focus();\n\n\t\tawait page.keyboard.press('Space');\n\t},\n});\n\nsnapshotInformational(ReactVirtualizedExample, {\n\tdescription: 'Keyboard drag preview - React virtualized - horizontal direction - away position',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst columnA = page.getByTestId('column-A--header');\n\t\tawait columnA.focus();\n\n\t\tawait page.keyboard.press('Space');\n\n\t\t// Move between columns B and C\n\t\tawait page.keyboard.press('ArrowRight');\n\t},\n});\n\nsnapshotInformational(ReactVirtualizedExample, {\n\tdescription: 'Keyboard drag preview - React virtualized - horizontal direction - returning home',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst columnA = page.getByTestId('column-A--header');\n\t\tawait columnA.focus();\n\n\t\tawait page.keyboard.press('Space');\n\t\t// Move between columns B and C, then back to original position\n\t\tawait page.keyboard.press('ArrowRight');\n\t\tawait page.keyboard.press('ArrowLeft');\n\t},\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/informational-vr-tests/scroll-container.vr.tsx",
    "content": "import {\n\tDevice,\n\ttype Hooks,\n\tsnapshotInformational,\n\ttype SnapshotTestOptions,\n} from '@af/visual-regression';\n\nimport ScrollContainerExample from '../../examples/05-scroll-container';\n\nconst variants: SnapshotTestOptions<Hooks>['variants'] = [\n\t{\n\t\tenvironment: { colorScheme: 'light' },\n\t\tname: 'desktop-chrome',\n\t\tdevice: Device.DESKTOP_CHROME,\n\t},\n];\n\n/**\n * Context: there was a bug that caused the drop indicator to incorrectly\n * render at the top of the scroll container, scrolling the container with it.\n *\n * This would occur when returning home because the drag preview was being\n * measured to determine where to put the indicator.\n *\n * Now, when over home, the placeholder is used instead of the drag preview.\n */\n\nsnapshotInformational(ScrollContainerExample, {\n\tdescription: 'Scroll container - keyboard controls - returning home from target before',\n\tvariants,\n\tprepare: async (page) => {\n\t\t// Scroll the container to the bottom\n\t\tawait page.getByRole('button', { name: 'Scroll to bottom' }).click();\n\n\t\t// Focus on the first item and start keyboard drag\n\t\tconst card = page.getByTestId('card-9');\n\t\tawait card.focus();\n\t\tawait page.keyboard.press('Space');\n\n\t\t// Move to target before\n\t\tawait page.keyboard.press('ArrowUp');\n\t\t// Move back to the home location\n\t\tawait page.keyboard.press('ArrowDown');\n\t},\n});\n\nsnapshotInformational(ScrollContainerExample, {\n\tdescription: 'Scroll container - keyboard controls - returning home from target after',\n\tvariants,\n\tprepare: async (page) => {\n\t\t// Scroll the container to the bottom\n\t\tawait page.getByRole('button', { name: 'Scroll to bottom' }).click();\n\n\t\t// Focus on an item that can move up and start keyboard drag\n\t\tconst card = page.getByTestId('card-9');\n\t\tawait card.focus();\n\t\tawait page.keyboard.press('Space');\n\n\t\t// Move to the target after\n\t\tawait page.keyboard.press('ArrowDown');\n\t\t// Move back to the home location\n\t\tawait page.keyboard.press('ArrowUp');\n\t},\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/informational-vr-tests/smoke.vr.tsx",
    "content": "import type { Locator, Page } from '@playwright/test';\nimport invariant from 'tiny-invariant';\n\nimport {\n\tDevice,\n\ttype Hooks,\n\tsnapshotInformational,\n\ttype SnapshotTestOptions,\n} from '@af/visual-regression';\n\nimport BoardExample from '../../examples/01-board';\n\nconst variants: SnapshotTestOptions<Hooks>['variants'] = [\n\t{\n\t\tenvironment: { colorScheme: 'light' },\n\t\tname: 'desktop-chrome',\n\t\tdevice: Device.DESKTOP_CHROME,\n\t},\n];\n\nconst gap = 10;\n\nasync function dragAndDrop({\n\tpage,\n\tdraggable,\n\tdropTarget,\n}: {\n\tpage: Page;\n\tdraggable: Locator;\n\tdropTarget: Locator;\n}) {\n\tconst draggableBox = await draggable.boundingBox();\n\tinvariant(draggableBox, 'unable to get bounding box for draggable');\n\n\tconst dropTargetBox = await dropTarget.boundingBox();\n\tinvariant(dropTargetBox, 'unable to get bounding box for dropTarget');\n\n\t// Start drag\n\tawait page.mouse.move(draggableBox.x + gap, draggableBox.y + gap);\n\tawait page.mouse.down();\n\tawait page.mouse.move(draggableBox.x + gap, draggableBox.y + gap);\n\n\tawait page.mouse.move(dropTargetBox.x + gap, dropTargetBox.y + gap);\n\t// Second movement needed to ensure drag preview is updated\n\tawait page.mouse.move(dropTargetBox.x + gap, dropTargetBox.y + gap);\n\n\t// Finish the drop\n\tawait page.mouse.up();\n}\n\nsnapshotInformational(BoardExample, {\n\tdescription: 'Smoke test - Board - after card drag and drop',\n\tvariants,\n\tprepare: async (page) => {\n\t\tconst cardA0 = page.getByTestId('item-A0');\n\t\tconst cardB0 = page.getByTestId('item-B0');\n\n\t\tawait dragAndDrop({ page, draggable: cardA0, dropTarget: cardB0 });\n\t},\n});\n\nsnapshotInformational(BoardExample, {\n\tdescription: 'Smoke test - Board - after column drag and drop',\n\tvariants,\n\tprepare: async (page) => {\n\t\t// Drag column A to position of column B\n\t\tconst columnA = page.getByTestId('column-A--header');\n\n\t\tconst columnC = page.getByTestId('column-C--header');\n\n\t\tawait dragAndDrop({ page, draggable: columnA, dropTarget: columnC });\n\t},\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/playwright/virtual.spec.tsx",
    "content": "import type { JSHandle } from 'playwright-core';\n\nimport { expect, test } from '@af/integration-testing';\n\nimport { customAttributes } from '../../src/utils/attributes';\n\nfunction getDraggableSelector(draggableId: string) {\n\treturn `[data-testid=\"item-${draggableId}\"]`;\n}\n\ntest.describe('virtual lists', () => {\n\ttest.describe('keyboard drag', () => {\n\t\ttest('should not error when the draggable remounts during a drag', async ({ page }) => {\n\t\t\tawait page.visitExample<typeof import('../../examples/02-react-window.tsx')>('pragmatic-drag-and-drop', 'react-beautiful-dnd-migration', 'react-window');\n\n\t\t\t/**\n\t\t\t * The card we are moving, and the draggable we are interested in\n\t\t\t * making remount during the drag.\n\t\t\t *\n\t\t\t * It begins as the first card in the list.\n\t\t\t */\n\t\t\tconst card = page.locator(getDraggableSelector('A0'));\n\n\t\t\tconst cardParent: JSHandle<HTMLElement | null> = await card.evaluateHandle(\n\t\t\t\t(el: HTMLElement) => el.parentElement,\n\t\t\t);\n\n\t\t\tawait expect(card).toHaveAttribute(customAttributes.draggable.index, '0');\n\n\t\t\tawait card.focus();\n\t\t\tawait card.press('Space');\n\n\t\t\t/**\n\t\t\t * Move down the list until the draggable unmounts.\n\t\t\t *\n\t\t\t * NOTE: Previously this only went down 8, which seemed to land\n\t\t\t * around the exact threshold where `react-window` unmounts the Draggable.\n\t\t\t *\n\t\t\t * This led to flakiness, as the Draggable would unmount but then remount\n\t\t\t * immediately after.\n\t\t\t *\n\t\t\t * Moving to the bottom seems to result in the Draggable staying\n\t\t\t * consistently unmounted, so no flakiness!\n\t\t\t */\n\n\t\t\t// Move to the bottom of the list\n\t\t\t// This is to make the Draggable associated with the card unmount\n\t\t\tfor (let i = 0; i < 9; i++) {\n\t\t\t\tawait page.keyboard.press('ArrowDown');\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Wait until the Draggable has actually unmounted.\n\t\t\t *\n\t\t\t * This has also been a source of flakiness. Without this wait the\n\t\t\t * element is not always unmounted in time. It seems like there is an\n\t\t\t * async behaviour here, so we need to wait.\n\t\t\t */\n\t\t\tawait page.waitForFunction((el) => !el?.isConnected, cardParent);\n\n\t\t\t// Move back to the top of the list\n\t\t\t// This ensures the Draggable associated with `card` will remount\n\t\t\tfor (let i = 0; i < 9; i++) {\n\t\t\t\tawait page.keyboard.press('ArrowUp');\n\t\t\t}\n\n\t\t\t// Now drop the card one place down from where it started,\n\t\t\t// to verify drops are still working correctly\n\t\t\tawait page.keyboard.press('ArrowDown');\n\t\t\tawait page.keyboard.press('Space');\n\n\t\t\tawait expect(card).toHaveAttribute(customAttributes.draggable.index, '1');\n\t\t});\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/_util.tsx",
    "content": "import type { DroppableId } from 'react-beautiful-dnd';\nimport invariant from 'tiny-invariant';\n\nimport type { CleanupFn } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport { attributes, customAttributes } from '../../src/utils/attributes';\n\nexport function setElementFromPoint(el: Element | null): CleanupFn {\n\tconst originalElementFromPoint = document.elementFromPoint;\n\tconst originalElementsFromPoint = document.elementsFromPoint;\n\n\tdocument.elementFromPoint = () => el;\n\tdocument.elementsFromPoint = () => (el ? [el] : []);\n\n\treturn () => {\n\t\tdocument.elementFromPoint = originalElementFromPoint;\n\t\tdocument.elementsFromPoint = originalElementsFromPoint;\n\t};\n}\n\nexport function getDroppable(droppableId: DroppableId, container: HTMLElement): HTMLElement {\n\tconst droppable = container.querySelector(`[${attributes.droppable.id}=\"${droppableId}\"]`);\n\tinvariant(droppable instanceof HTMLElement, `Could not find droppable ${droppableId}`);\n\treturn droppable;\n}\n\nexport function findPlaceholderInDroppable(\n\tdroppableId: DroppableId,\n\tcontainer: HTMLElement,\n): HTMLElement | null {\n\tconst droppable = getDroppable(droppableId, container);\n\treturn droppable.querySelector(`[${attributes.placeholder.contextId}]`);\n}\n\nexport function getPlaceholder(): HTMLElement {\n\tconst placeholder = document.body.querySelector(`[${attributes.placeholder.contextId}]`);\n\tinvariant(placeholder instanceof HTMLElement);\n\treturn placeholder;\n}\n\nexport function hasPlaceholderInDroppable(\n\tdroppableId: DroppableId,\n\tcontainer: HTMLElement,\n): boolean {\n\treturn Boolean(findPlaceholderInDroppable(droppableId, container));\n}\n\nexport function findDropIndicator(\n\tdroppableId: DroppableId,\n\tcontainer: HTMLElement,\n): HTMLElement | null {\n\treturn container.querySelector(\n\t\t`[${attributes.droppable.id}=\"${droppableId}\"] [${customAttributes.dropIndicator}]`,\n\t);\n}\n\nexport function hasDropIndicator(droppableId: DroppableId, container: HTMLElement): boolean {\n\treturn Boolean(findDropIndicator(droppableId, container));\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/_utils/board.tsx",
    "content": "import React from 'react';\n\nimport type { Responders } from 'react-beautiful-dnd';\n\nimport { DragDropContext, Draggable, Droppable } from '../../../src';\n\nconst columns = [\n\t{ id: 'A', items: [{ id: 'A0' }, { id: 'A1' }, { id: 'A2' }] },\n\t{ id: 'B', items: [{ id: 'B0' }] },\n\t{ id: 'C', items: [] },\n];\n\ntype BoardProps = Partial<Responders>;\n\nfunction noop() {}\n\nexport function Board({ onDragEnd = noop, ...responders }: BoardProps): React.JSX.Element {\n\treturn (\n\t\t<DragDropContext onDragEnd={onDragEnd} {...responders}>\n\t\t\t<Droppable droppableId=\"board\" type=\"column\">\n\t\t\t\t{(provided) => (\n\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t\t{columns.map((column, index) => (\n\t\t\t\t\t\t\t<Draggable key={column.id} draggableId={`column-${column.id}`} index={index}>\n\t\t\t\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t\t\t\t<div ref={provided.innerRef} {...provided.draggableProps}>\n\t\t\t\t\t\t\t\t\t\t<div {...provided.dragHandleProps}>Column {column.id}</div>\n\t\t\t\t\t\t\t\t\t\t<Droppable droppableId={column.id}>\n\t\t\t\t\t\t\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t\t\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{column.items.map((item, index) => (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Draggable key={item.id} draggableId={item.id} index={index}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{(provided, snapshot) => (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata-is-over={snapshot.draggingOver}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata-testid={item.id}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tItem {item.id}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t\t\t\t\t{provided.placeholder}\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t</Droppable>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t))}\n\t\t\t\t\t\t{provided.placeholder}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/_utils/setup.tsx",
    "content": "export function setup(): void {\n\tHTMLElement.prototype.scrollIntoView = jest.fn();\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/_utils/with-set-element-from-point.tsx",
    "content": "import { setElementFromPoint } from '../_util';\n\nexport function withSetElementFromPoint(dragHandle: HTMLElement, callback: Function): void {\n\tconst clearElementFromPoint = setElementFromPoint(dragHandle);\n\n\tcallback();\n\n\tclearElementFromPoint();\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/abort.test.tsx",
    "content": "import React from 'react';\n\nimport { fireEvent, render } from '@testing-library/react';\nimport type { DragDropContextProps, DragUpdate, DropResult } from 'react-beautiful-dnd';\n\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { DragDropContext, Draggable, Droppable } from '../../src';\n\nimport { setElementFromPoint } from './_util';\nimport {\n\tkeyboard,\n\tmouse,\n} from './ported-from-react-beautiful-dnd/unit/integration/_utils/controls';\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nfunction App(props: Partial<DragDropContextProps>) {\n\treturn (\n\t\t<DragDropContext onDragEnd={() => {}} {...props}>\n\t\t\t<Droppable droppableId=\"droppable\">\n\t\t\t\t{(provided) => (\n\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps} data-testid=\"droppable\">\n\t\t\t\t\t\t<Draggable draggableId=\"draggable-0\" index={0}>\n\t\t\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tfirst\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t<Draggable draggableId=\"draggable-1\" index={1}>\n\t\t\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tsecond\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n\njest.useFakeTimers();\n\nconst cases = [\n\t{ id: 'mouse', control: mouse, mode: 'FLUID' },\n\t{ id: 'keyboard', control: keyboard, mode: 'SNAP' },\n] as const;\n\ncases.forEach(({ id, control, mode }) => {\n\tit(`should publish an update for null destination on cancel (${id})`, () => {\n\t\tconst onDragStart = jest.fn();\n\t\tconst onDragUpdate = jest.fn();\n\t\tconst onDragEnd = jest.fn();\n\n\t\tconst { getByText } = render(\n\t\t\t<App onDragStart={onDragStart} onDragUpdate={onDragUpdate} onDragEnd={onDragEnd} />,\n\t\t);\n\n\t\tconst draggable = getByText('first');\n\n\t\tsetElementFromPoint(draggable);\n\t\tcontrol.lift(draggable);\n\n\t\tjest.runOnlyPendingTimers();\n\t\texpect(onDragStart).toHaveBeenCalledTimes(1);\n\n\t\tcontrol.cancel(draggable);\n\n\t\t// there should be an update as the destination becomes `null`\n\t\tconst expectedUpdate: DragUpdate = {\n\t\t\tcombine: null,\n\t\t\tdestination: null,\n\t\t\tdraggableId: 'draggable-0',\n\t\t\tmode,\n\t\t\tsource: { droppableId: 'droppable', index: 0 },\n\t\t\ttype: 'DEFAULT',\n\t\t};\n\t\texpect(onDragUpdate).toHaveBeenCalledTimes(1);\n\t\texpect(onDragUpdate).toHaveBeenCalledWith(expectedUpdate, expect.any(Object));\n\n\t\tconst expectedResult: DropResult = {\n\t\t\ttype: 'DEFAULT',\n\t\t\tmode,\n\t\t\tdraggableId: 'draggable-0',\n\t\t\tsource: {\n\t\t\t\tdroppableId: 'droppable',\n\t\t\t\tindex: 0,\n\t\t\t},\n\t\t\tdestination: null,\n\t\t\tcombine: null,\n\t\t\treason: 'CANCEL',\n\t\t};\n\t\texpect(onDragEnd).toHaveBeenCalledWith(expectedResult, expect.any(Object));\n\t});\n});\n\nit(`should not publish a redundant update for null destination on cancel (mouse)`, () => {\n\tconst onDragStart = jest.fn();\n\tconst onDragUpdate = jest.fn();\n\tconst onDragEnd = jest.fn();\n\n\tconst { getByTestId, getByText } = render(\n\t\t<App onDragStart={onDragStart} onDragUpdate={onDragUpdate} onDragEnd={onDragEnd} />,\n\t);\n\n\tconst draggable = getByText('first');\n\n\tsetElementFromPoint(draggable);\n\tmouse.lift(draggable);\n\n\tfireEvent.dragLeave(getByTestId('droppable'));\n\n\tjest.runOnlyPendingTimers();\n\texpect(onDragStart).toHaveBeenCalledTimes(1);\n\n\t// there should be an update as the destination becomes `null`\n\tconst expectedUpdate: DragUpdate = {\n\t\tcombine: null,\n\t\tdestination: null,\n\t\tdraggableId: 'draggable-0',\n\t\tmode: 'FLUID',\n\t\tsource: { droppableId: 'droppable', index: 0 },\n\t\ttype: 'DEFAULT',\n\t};\n\texpect(onDragUpdate).toHaveBeenCalledTimes(1);\n\texpect(onDragUpdate).toHaveBeenCalledWith(expectedUpdate, expect.any(Object));\n\tonDragUpdate.mockReset();\n\n\tmouse.cancel(draggable);\n\n\t// there should be no redundant update, as the destination is already `null`\n\texpect(onDragUpdate).not.toHaveBeenCalled();\n\n\tconst expectedResult: DropResult = {\n\t\ttype: 'DEFAULT',\n\t\tmode: 'FLUID',\n\t\tdraggableId: 'draggable-0',\n\t\tsource: {\n\t\t\tdroppableId: 'droppable',\n\t\t\tindex: 0,\n\t\t},\n\t\tdestination: null,\n\t\tcombine: null,\n\t\treason: 'CANCEL',\n\t};\n\texpect(onDragEnd).toHaveBeenCalledWith(expectedResult, expect.any(Object));\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/batch-updates-for-react-18.test.tsx",
    "content": "type BatchFunction = (callback: () => void) => void;\n\nasync function setupMocks({\n\tversion,\n\tunstable_batchedUpdates,\n}: {\n\tversion: string | undefined;\n\tunstable_batchedUpdates: BatchFunction | undefined;\n}): Promise<BatchFunction> {\n\tjest.setMock('react-dom', { version, unstable_batchedUpdates });\n\n\t// Chunk name doesn't make sense in a test\n\t// eslint-disable-next-line import/dynamic-import-chunkname\n\tconst { batchUpdatesForReact16 } = await import('../../src/utils/batch-updates-for-react-16');\n\treturn batchUpdatesForReact16;\n}\n\ndescribe('batchUpdatesForReact16()', () => {\n\tbeforeEach(() => {\n\t\tjest.resetModules();\n\t});\n\n\tit('should use unstable_batchedUpdates for react 16', async () => {\n\t\tconst mockUnstableBatchedUpdates = jest.fn();\n\t\tconst batchUpdatesForReact16 = await setupMocks({\n\t\t\tversion: '16.13.0',\n\t\t\tunstable_batchedUpdates: mockUnstableBatchedUpdates,\n\t\t});\n\n\t\tconst callback = jest.fn();\n\t\tbatchUpdatesForReact16(callback);\n\n\t\texpect(mockUnstableBatchedUpdates).toHaveBeenCalledTimes(1);\n\t\texpect(mockUnstableBatchedUpdates).toHaveBeenCalledWith(callback);\n\t});\n\n\t/**\n\t * The version export was only added in `react-dom@16.13.0`\n\t *\n\t * Because we support `react-dom@^16.8.0` we need to handle when the version is `undefined`\n\t */\n\tit('should use unstable_batchedUpdates if no version is available', async () => {\n\t\tconst mockUnstableBatchedUpdates = jest.fn();\n\t\tconst batchUpdatesForReact16 = await setupMocks({\n\t\t\tversion: undefined,\n\t\t\tunstable_batchedUpdates: mockUnstableBatchedUpdates,\n\t\t});\n\n\t\tconst callback = jest.fn();\n\t\tbatchUpdatesForReact16(callback);\n\n\t\texpect(mockUnstableBatchedUpdates).toHaveBeenCalledTimes(1);\n\t\texpect(mockUnstableBatchedUpdates).toHaveBeenCalledWith(callback);\n\t});\n\n\tit('should call the callback directly for react 18', async () => {\n\t\tconst mockUnstableBatchedUpdates = jest.fn();\n\t\tconst batchUpdatesForReact16 = await setupMocks({\n\t\t\tversion: '18.0.0',\n\t\t\tunstable_batchedUpdates: mockUnstableBatchedUpdates,\n\t\t});\n\n\t\tconst callback = jest.fn();\n\t\tbatchUpdatesForReact16(callback);\n\n\t\texpect(mockUnstableBatchedUpdates).not.toHaveBeenCalled();\n\t\texpect(callback).toHaveBeenCalledTimes(1);\n\t});\n\n\t/**\n\t * `unstable_batchedUpdates` should exist in all versions we support,\n\t * but it's possible it will be removed in the future.\n\t *\n\t * This is just a defensive behavior, it is not currently needed.\n\t */\n\tit('should call the callback directly if unstable_batchedUpdates is not available', async () => {\n\t\tconst mockUnstableBatchedUpdates = jest.fn();\n\t\tconst batchUpdatesForReact16 = await setupMocks({\n\t\t\tversion: undefined,\n\t\t\tunstable_batchedUpdates: undefined,\n\t\t});\n\n\t\tconst callback = jest.fn();\n\t\tbatchUpdatesForReact16(callback);\n\n\t\texpect(mockUnstableBatchedUpdates).not.toHaveBeenCalled();\n\t\texpect(callback).toHaveBeenCalledTimes(1);\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/browser-focus.test.tsx",
    "content": "import React from 'react';\n\nimport { act, fireEvent, render } from '@testing-library/react';\nimport { replaceRaf } from 'raf-stub';\n\nimport BoardExample from '../../examples/01-board';\nimport ReactWindowBoardExample from '../../examples/02-react-window';\nimport { customAttributes } from '../../src/utils/attributes';\n\nimport {\n\tkeyboard,\n\tmouse,\n} from './ported-from-react-beautiful-dnd/unit/integration/_utils/controls';\nimport { isDragging } from './ported-from-react-beautiful-dnd/unit/integration/_utils/helpers';\n\nHTMLElement.prototype.scrollIntoView = jest.fn();\nHTMLElement.prototype.scrollTo = jest.fn();\n\nconst controls = [\n\t{ controlId: 'mouse', control: mouse },\n\t{ controlId: 'keyboard', control: keyboard },\n];\n\nconst modes = [\n\t{ mode: 'standard', Example: BoardExample },\n\t{ mode: 'virtual', Example: ReactWindowBoardExample },\n] as const;\n\ncontrols.forEach(({ controlId, control }) => {\n\tmodes.forEach(({ mode, Example }) => {\n\t\tdescribe(`browser focus (mode: ${mode}) (control: ${controlId})`, () => {\n\t\t\tdescribe('when the drag handle is focused at drag start', () => {\n\t\t\t\tit('should capture and report a11y violations', async () => {\n\t\t\t\t\tconst { container } = render(<Example />);\n\n\t\t\t\t\tawait expect(container).toBeAccessible({\n\t\t\t\t\t\t// eslint-disable-next-line @atlassian/a11y/no-violation-count\n\t\t\t\t\t\tviolationCount: 1,\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\t\tit('should focus the drag handle with matching id after the drag starts', async () => {\n\t\t\t\t\tconst { getByTestId, unmount } = render(<Example />);\n\n\t\t\t\t\tconst cardA0 = getByTestId('item-A0');\n\n\t\t\t\t\tcardA0.focus();\n\t\t\t\t\tcontrol.lift(cardA0);\n\n\t\t\t\t\tif (mode === 'standard') {\n\t\t\t\t\t\texpect(document.activeElement).toBe(cardA0);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (mode === 'virtual') {\n\t\t\t\t\t\texpect(document.activeElement).not.toBe(cardA0);\n\t\t\t\t\t\texpect(document.activeElement).toBe(getByTestId('item-A0'));\n\t\t\t\t\t}\n\n\t\t\t\t\tcontrol.cancel(cardA0);\n\t\t\t\t\tunmount();\n\t\t\t\t});\n\n\t\t\t\tit('should focus the drag handle with matching id after the drag ends', async () => {\n\t\t\t\t\treplaceRaf();\n\n\t\t\t\t\tconst { getByTestId, unmount } = render(<BoardExample />);\n\n\t\t\t\t\tconst cardA0 = getByTestId('item-A0');\n\n\t\t\t\t\tcardA0.focus();\n\t\t\t\t\tcontrol.lift(cardA0);\n\t\t\t\t\texpect(isDragging(getByTestId('item-A0'))).toBe(true);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Drag the item to column B\n\t\t\t\t\t */\n\t\t\t\t\tif (control === mouse) {\n\t\t\t\t\t\tfireEvent.dragOver(getByTestId('item-B0'));\n\t\t\t\t\t}\n\n\t\t\t\t\tif (control === keyboard) {\n\t\t\t\t\t\tfireEvent.keyDown(getByTestId('item-A0'), { key: 'ArrowRight' });\n\t\t\t\t\t}\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Drop it in column B\n\t\t\t\t\t */\n\t\t\t\t\tcontrol.drop(document.body);\n\t\t\t\t\texpect(isDragging(getByTestId('item-A0'))).toBe(false);\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Check it's in column B\n\t\t\t\t\t */\n\t\t\t\t\tconst parentDroppableId = getByTestId('item-A0').getAttribute(\n\t\t\t\t\t\tcustomAttributes.draggable.droppableId,\n\t\t\t\t\t);\n\t\t\t\t\texpect(parentDroppableId).toBe('B');\n\n\t\t\t\t\t/**\n\t\t\t\t\t * Focus restoration will occur after an animation frame.\n\t\t\t\t\t */\n\t\t\t\t\tact(() => {\n\t\t\t\t\t\t// @ts-expect-error\n\t\t\t\t\t\trequestAnimationFrame.step();\n\t\t\t\t\t});\n\n\t\t\t\t\texpect(document.activeElement).toBe(getByTestId('item-A0'));\n\n\t\t\t\t\tunmount();\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/destination.test.tsx",
    "content": "import React from 'react';\n\nimport { act, fireEvent, render } from '@testing-library/react';\nimport { replaceRaf } from 'raf-stub';\nimport invariant from 'tiny-invariant';\n\nimport * as closestEdge from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport type { Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/types';\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport Board from '../../examples/01-board';\nimport { customAttributes } from '../../src/utils/attributes';\n\nimport { setElementFromPoint } from './_util';\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nconst getDraggable = (container: HTMLElement, draggableId: string) => {\n\tconst selector = `[data-rbd-draggable-id=\"${draggableId}\"]`;\n\tconst el = container.querySelector(selector);\n\tinvariant(el instanceof HTMLElement);\n\treturn el;\n};\n\nconst getPlaceholder = (container: HTMLElement) => {\n\tconst selector = `[data-rbd-placeholder-context-id]`;\n\tconst el = container.querySelector(selector);\n\tinvariant(el instanceof HTMLElement);\n\treturn el;\n};\n\nconst extractClosestEdge = jest.spyOn(closestEdge, 'extractClosestEdge');\n\nfunction dragAndDrop({\n\thandle,\n\ttarget,\n}: {\n\thandle: HTMLElement;\n\ttarget: { getElement: () => HTMLElement; edge: Edge };\n}) {\n\treplaceRaf();\n\n\tconst cleanup = setElementFromPoint(handle);\n\tfireEvent.dragStart(handle);\n\tact(() => {\n\t\t// @ts-expect-error\n\t\trequestAnimationFrame.step();\n\t});\n\tcleanup();\n\n\textractClosestEdge.mockReturnValue(target.edge);\n\tfireEvent.dragEnter(target.getElement());\n\n\tfireEvent.drop(handle);\n}\n\nbeforeEach(() => {\n\textractClosestEdge.mockReturnValue(null);\n});\n\ndescribe('drop destination', () => {\n\tdescribe('target: self', () => {\n\t\tit('should capture and report a11y violations', async () => {\n\t\t\tconst { container } = render(<Board />);\n\n\t\t\tawait expect(container).toBeAccessible({\n\t\t\t\t// eslint-disable-next-line @atlassian/a11y/no-violation-count\n\t\t\t\tviolationCount: 1,\n\t\t\t});\n\t\t});\n\n\t\tit('should not move if dropped on backward edge', () => {\n\t\t\tconst { container } = render(<Board />);\n\n\t\t\tconst handle = getDraggable(container, 'A0');\n\t\t\texpect(handle).toHaveAttribute(customAttributes.draggable.index, '0');\n\n\t\t\tdragAndDrop({\n\t\t\t\thandle,\n\t\t\t\ttarget: {\n\t\t\t\t\t// When a drag starts, the drop target for the dragging\n\t\t\t\t\t// Draggable becomes the placeholder element\n\t\t\t\t\tgetElement: () => getPlaceholder(container),\n\t\t\t\t\tedge: 'top',\n\t\t\t\t},\n\t\t\t});\n\t\t\texpect(handle).toHaveAttribute(customAttributes.draggable.index, '0');\n\t\t});\n\n\t\tit('should not move if dropped on forward edge', () => {\n\t\t\tconst { container } = render(<Board />);\n\n\t\t\tconst handle = getDraggable(container, 'A0');\n\t\t\texpect(handle).toHaveAttribute(customAttributes.draggable.index, '0');\n\n\t\t\tdragAndDrop({\n\t\t\t\thandle,\n\t\t\t\ttarget: {\n\t\t\t\t\t// When a drag starts, the drop target for the dragging\n\t\t\t\t\t// Draggable becomes the placeholder element\n\t\t\t\t\tgetElement: () => getPlaceholder(container),\n\t\t\t\t\tedge: 'bottom',\n\t\t\t\t},\n\t\t\t});\n\t\t\texpect(handle).toHaveAttribute(customAttributes.draggable.index, '0');\n\t\t});\n\t});\n\n\tdescribe('target: after self', () => {\n\t\ttest('backward edge', () => {\n\t\t\tconst { container } = render(<Board />);\n\n\t\t\tconst handle = getDraggable(container, 'A0');\n\t\t\texpect(handle).toHaveAttribute(customAttributes.draggable.index, '0');\n\n\t\t\tdragAndDrop({\n\t\t\t\thandle,\n\t\t\t\ttarget: {\n\t\t\t\t\tgetElement: () => getDraggable(container, 'A3'),\n\t\t\t\t\tedge: 'top',\n\t\t\t\t},\n\t\t\t});\n\t\t\texpect(handle).toHaveAttribute(customAttributes.draggable.index, '2');\n\t\t});\n\n\t\ttest('forward edge', () => {\n\t\t\tconst { container } = render(<Board />);\n\n\t\t\tconst handle = getDraggable(container, 'A0');\n\t\t\texpect(handle).toHaveAttribute(customAttributes.draggable.index, '0');\n\n\t\t\tdragAndDrop({\n\t\t\t\thandle,\n\t\t\t\ttarget: {\n\t\t\t\t\tgetElement: () => getDraggable(container, 'A3'),\n\t\t\t\t\tedge: 'bottom',\n\t\t\t\t},\n\t\t\t});\n\t\t\texpect(handle).toHaveAttribute(customAttributes.draggable.index, '3');\n\t\t});\n\t});\n\n\tdescribe('target: before self', () => {\n\t\ttest('backward edge', () => {\n\t\t\tconst { container } = render(<Board />);\n\n\t\t\tconst handle = getDraggable(container, 'A3');\n\t\t\texpect(handle).toHaveAttribute(customAttributes.draggable.index, '3');\n\n\t\t\tdragAndDrop({\n\t\t\t\thandle,\n\t\t\t\ttarget: {\n\t\t\t\t\tgetElement: () => getDraggable(container, 'A0'),\n\t\t\t\t\tedge: 'top',\n\t\t\t\t},\n\t\t\t});\n\t\t\texpect(handle).toHaveAttribute(customAttributes.draggable.index, '0');\n\t\t});\n\n\t\ttest('forward edge', () => {\n\t\t\tconst { container } = render(<Board />);\n\n\t\t\tconst handle = getDraggable(container, 'A3');\n\t\t\texpect(handle).toHaveAttribute(customAttributes.draggable.index, '3');\n\n\t\t\tdragAndDrop({\n\t\t\t\thandle,\n\t\t\t\ttarget: {\n\t\t\t\t\tgetElement: () => getDraggable(container, 'A0'),\n\t\t\t\t\tedge: 'bottom',\n\t\t\t\t},\n\t\t\t});\n\t\t\texpect(handle).toHaveAttribute(customAttributes.draggable.index, '1');\n\t\t});\n\t});\n\n\tdescribe('target: other list', () => {\n\t\ttest('backward edge', () => {\n\t\t\tconst { container } = render(<Board />);\n\n\t\t\tconst handle = getDraggable(container, 'A0');\n\t\t\texpect(handle).toHaveAttribute(customAttributes.draggable.index, '0');\n\n\t\t\tdragAndDrop({\n\t\t\t\thandle,\n\t\t\t\ttarget: {\n\t\t\t\t\tgetElement: () => getDraggable(container, 'B0'),\n\t\t\t\t\tedge: 'top',\n\t\t\t\t},\n\t\t\t});\n\t\t\texpect(getDraggable(container, 'A0')).toHaveAttribute(customAttributes.draggable.index, '0');\n\t\t});\n\n\t\ttest('forward edge', () => {\n\t\t\tconst { container } = render(<Board />);\n\n\t\t\tconst handle = getDraggable(container, 'A0');\n\t\t\texpect(handle).toHaveAttribute(customAttributes.draggable.index, '0');\n\n\t\t\tdragAndDrop({\n\t\t\t\thandle,\n\t\t\t\ttarget: {\n\t\t\t\t\tgetElement: () => getDraggable(container, 'B0'),\n\t\t\t\t\tedge: 'bottom',\n\t\t\t\t},\n\t\t\t});\n\t\t\texpect(getDraggable(container, 'A0')).toHaveAttribute(customAttributes.draggable.index, '1');\n\t\t});\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/draggable/_utils.tsx",
    "content": "import React from 'react';\n\nimport { render } from '@testing-library/react';\nimport type {\n\tDraggableProvided,\n\tDraggableRubric,\n\tDraggableStateSnapshot,\n} from 'react-beautiful-dnd';\n\nimport { DragDropContext, Draggable, Droppable } from '../../../src';\n\nexport type Item = {\n\tid: string;\n};\n\nexport const defaultItems = Array.from(\n\t{ length: 3 },\n\t(_, index): Item => ({\n\t\tid: `${index}`,\n\t}),\n);\n\nexport function renderApp(items: Item[] = defaultItems) {\n\tconst spy = jest.fn();\n\n\trender(\n\t\t<DragDropContext onDragEnd={() => {}}>\n\t\t\t<Droppable droppableId=\"droppable\">\n\t\t\t\t{(provided) => (\n\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t\t{items.map(({ id }, index) => (\n\t\t\t\t\t\t\t<Draggable key={id} draggableId={id} index={index}>\n\t\t\t\t\t\t\t\t{(provided, snapshot, rubric) => {\n\t\t\t\t\t\t\t\t\tspy(provided, snapshot, rubric);\n\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\tDraggable {id}\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Droppable>\n\t\t</DragDropContext>,\n\t);\n\n\tfunction getCalls(\n\t\tdraggableId: string,\n\t): [DraggableProvided, DraggableStateSnapshot, DraggableRubric][] {\n\t\treturn spy.mock.calls.filter((call) => {\n\t\t\tconst provided: DraggableProvided = call[0];\n\t\t\treturn provided.draggableProps['data-rbd-draggable-id'] === draggableId;\n\t\t});\n\t}\n\n\tfunction getProvided(draggableId: string): DraggableProvided[] {\n\t\tconst calls = getCalls(draggableId);\n\t\treturn calls.map((call) => call[0]);\n\t}\n\n\treturn {\n\t\tgetProvided,\n\t};\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/draggable/find-drag-handle.test.tsx",
    "content": "import React, { type ReactNode } from 'react';\n\nimport { render } from '@testing-library/react';\n\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { DragDropContext, Draggable, Droppable, resetServerContext } from '../../../src';\nimport { findDragHandle } from '../../../src/utils/find-drag-handle';\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nfunction App({ children }: { children: ReactNode }) {\n\treturn (\n\t\t<DragDropContext onDragEnd={() => {}}>\n\t\t\t<Droppable droppableId=\"droppable\">\n\t\t\t\t{(provided) => (\n\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n\ndescribe('findDragHandle()', () => {\n\tafterEach(() => {\n\t\tresetServerContext();\n\t});\n\n\tit('should capture and report a11y violations', async () => {\n\t\tconst draggableId = 'draggable';\n\t\tconst { container } = render(\n\t\t\t<App>\n\t\t\t\t<Draggable draggableId={draggableId} index={0}>\n\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\tdata-testid=\"draggable\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\tDraggable element\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</Draggable>\n\t\t\t</App>,\n\t\t);\n\n\t\tawait expect(container).toBeAccessible();\n\t});\n\n\tit('should return the element if it is also the drag handle', () => {\n\t\tconst draggableId = 'draggable';\n\n\t\tconst { getByTestId } = render(\n\t\t\t<App>\n\t\t\t\t<Draggable draggableId={draggableId} index={0}>\n\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\tdata-testid=\"draggable\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</Draggable>\n\t\t\t</App>,\n\t\t);\n\n\t\tconst draggableElement = getByTestId('draggable');\n\n\t\texpect(findDragHandle({ contextId: '0', draggableId })).toBe(draggableElement);\n\t});\n\n\tit('should find the descendant element otherwise', () => {\n\t\tconst draggableId = 'draggable';\n\n\t\tconst { getByTestId } = render(\n\t\t\t<App>\n\t\t\t\t<Draggable draggableId={draggableId} index={0}>\n\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t<div ref={provided.innerRef} {...provided.draggableProps} data-testid=\"draggable\">\n\t\t\t\t\t\t\t<div {...provided.dragHandleProps} data-testid=\"drag-handle\" />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</Draggable>\n\t\t\t</App>,\n\t\t);\n\n\t\tconst dragHandleElement = getByTestId('drag-handle');\n\n\t\texpect(findDragHandle({ contextId: '0', draggableId })).toBe(dragHandleElement);\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/draggable/keyboard.test.tsx",
    "content": "import React from 'react';\n\nimport { act, createEvent, fireEvent, render } from '@testing-library/react';\nimport { replaceRaf } from 'raf-stub';\n\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport VirtualBoardExample from '../../../examples/02-react-window';\nimport { DragDropContext, Draggable, Droppable } from '../../../src';\nimport { hasDropIndicator } from '../_util';\nimport { Board } from '../_utils/board';\nimport App from '../ported-from-react-beautiful-dnd/unit/integration/_utils/app';\nimport { keyboard } from '../ported-from-react-beautiful-dnd/unit/integration/_utils/controls';\nimport {\n\tisDragging,\n\tisOver,\n} from '../ported-from-react-beautiful-dnd/unit/integration/_utils/helpers';\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nbeforeAll(() => {\n\t/**\n\t * Jest does not implement `scrollTo` so we have to mock it.\n\t */\n\tHTMLElement.prototype.scrollTo = jest.fn();\n\n\t/**\n\t * Jest does not implement `scrollIntoView` so we have to mock it.\n\t */\n\tHTMLElement.prototype.scrollIntoView = jest.fn();\n});\n\ndescribe('keyboard dragging', () => {\n\ttest('that keydown handlers are unbound on unmount', () => {\n\t\tconst addEventListener = jest.spyOn(window, 'addEventListener');\n\t\tconst removeEventListener = jest.spyOn(window, 'removeEventListener');\n\n\t\tconst { getByTestId, unmount } = render(<App />);\n\n\t\tconst handle = getByTestId('0');\n\t\tkeyboard.lift(handle);\n\t\texpect(isDragging(handle)).toBe(true);\n\n\t\tunmount();\n\n\t\texpect(addEventListener.mock.calls).toHaveLength(removeEventListener.mock.calls.length);\n\t\t// validation\n\t\texpect(addEventListener).toHaveBeenCalled();\n\t\texpect(removeEventListener).toHaveBeenCalled();\n\n\t\t// double check that a key press isn't handled\n\t\tconst event = createEvent.keyDown(handle, { key: ' ' });\n\t\tfireEvent(handle, event);\n\t\texpect(event.defaultPrevented).toBe(false);\n\t});\n\n\ttest('Pressing Space on a drag handle begins a keyboard drag', () => {\n\t\tconst { getByTestId, unmount } = render(<App />);\n\n\t\tconst handle = getByTestId('0');\n\t\tkeyboard.lift(handle);\n\n\t\texpect(isDragging(handle)).toBe(true);\n\n\t\tunmount();\n\t});\n\n\tdescribe('During a keyboard drag (for vertical list)', () => {\n\t\ttest('pressing ArrowUp decrements the destination index', () => {\n\t\t\tjest.useFakeTimers();\n\n\t\t\tconst onDragStart = jest.fn();\n\t\t\tconst onDragEnd = jest.fn();\n\n\t\t\tconst { getByTestId } = render(<App onDragStart={onDragStart} onDragEnd={onDragEnd} />);\n\n\t\t\tconst handle = getByTestId('1');\n\t\t\tkeyboard.lift(handle);\n\t\t\texpect(isDragging(handle)).toBe(true);\n\n\t\t\tjest.runOnlyPendingTimers();\n\t\t\texpect(onDragStart).toHaveBeenCalledWith(\n\t\t\t\t{\n\t\t\t\t\tdraggableId: '1',\n\t\t\t\t\tmode: 'SNAP',\n\t\t\t\t\ttype: 'DEFAULT',\n\t\t\t\t\tsource: {\n\t\t\t\t\t\tdroppableId: 'droppable',\n\t\t\t\t\t\tindex: 1,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\texpect.any(Object),\n\t\t\t);\n\n\t\t\tfireEvent.keyDown(handle, { key: 'ArrowUp' });\n\n\t\t\tfireEvent.keyDown(handle, { key: ' ' });\n\n\t\t\texpect(isDragging(handle)).toBe(false);\n\n\t\t\texpect(onDragEnd).toHaveBeenCalledWith({\n\t\t\t\tdraggableId: '1',\n\t\t\t\tmode: 'SNAP',\n\t\t\t\ttype: 'DEFAULT',\n\t\t\t\tcombine: null,\n\t\t\t\treason: 'DROP',\n\t\t\t\tsource: {\n\t\t\t\t\tdroppableId: 'droppable',\n\t\t\t\t\tindex: 1,\n\t\t\t\t},\n\t\t\t\tdestination: {\n\t\t\t\t\tdroppableId: 'droppable',\n\t\t\t\t\tindex: 0,\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tjest.useRealTimers();\n\t\t});\n\n\t\tit('should capture and report a11y violations', async () => {\n\t\t\tjest.useFakeTimers();\n\t\t\tconst onDragStart = jest.fn();\n\t\t\tconst onDragUpdate = jest.fn();\n\t\t\tconst { container } = render(<Board onDragStart={onDragStart} onDragUpdate={onDragUpdate} />);\n\n\t\t\tawait expect(container).toBeAccessible();\n\t\t});\n\n\t\tit('should move to the next droppable after pressing ArrowRight', () => {\n\t\t\tjest.useFakeTimers();\n\n\t\t\tconst onDragStart = jest.fn();\n\t\t\tconst onDragUpdate = jest.fn();\n\n\t\t\tconst { getByTestId } = render(\n\t\t\t\t<Board onDragStart={onDragStart} onDragUpdate={onDragUpdate} />,\n\t\t\t);\n\n\t\t\tconst handle = getByTestId('A2');\n\t\t\tkeyboard.lift(handle);\n\t\t\texpect(isDragging(handle)).toBe(true);\n\t\t\texpect(isOver(handle)).toBe('A');\n\n\t\t\tjest.runOnlyPendingTimers();\n\t\t\texpect(onDragStart).toHaveBeenCalledWith(\n\t\t\t\t{\n\t\t\t\t\tdraggableId: 'A2',\n\t\t\t\t\tmode: 'SNAP',\n\t\t\t\t\ttype: 'DEFAULT',\n\t\t\t\t\tsource: {\n\t\t\t\t\t\tdroppableId: 'A',\n\t\t\t\t\t\tindex: 2,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\texpect.any(Object),\n\t\t\t);\n\n\t\t\tfireEvent.keyDown(handle, { key: 'ArrowRight' });\n\t\t\tjest.runOnlyPendingTimers();\n\t\t\texpect(onDragUpdate).toHaveBeenCalledWith(\n\t\t\t\t{\n\t\t\t\t\tdraggableId: 'A2',\n\t\t\t\t\tmode: 'SNAP',\n\t\t\t\t\ttype: 'DEFAULT',\n\t\t\t\t\tcombine: null,\n\t\t\t\t\tsource: {\n\t\t\t\t\t\tdroppableId: 'A',\n\t\t\t\t\t\tindex: 2,\n\t\t\t\t\t},\n\t\t\t\t\tdestination: {\n\t\t\t\t\t\tdroppableId: 'B',\n\t\t\t\t\t\tindex: 0,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\texpect.any(Object),\n\t\t\t);\n\t\t\texpect(isOver(handle)).toBe('B');\n\n\t\t\tfireEvent.keyDown(handle, { key: ' ' });\n\t\t\texpect(isDragging(handle)).toBe(false);\n\n\t\t\tjest.useRealTimers();\n\t\t});\n\t});\n\n\tit('should move to the previous droppable after pressing ArrowLeft', () => {\n\t\tjest.useFakeTimers();\n\n\t\tconst onDragStart = jest.fn();\n\t\tconst onDragUpdate = jest.fn();\n\n\t\tconst { getByTestId } = render(<Board onDragStart={onDragStart} onDragUpdate={onDragUpdate} />);\n\n\t\tconst handle = getByTestId('B0');\n\t\tkeyboard.lift(handle);\n\t\texpect(isDragging(handle)).toBe(true);\n\t\texpect(isOver(handle)).toBe('B');\n\n\t\tjest.runOnlyPendingTimers();\n\t\texpect(onDragStart).toHaveBeenCalledWith(\n\t\t\t{\n\t\t\t\tdraggableId: 'B0',\n\t\t\t\tmode: 'SNAP',\n\t\t\t\ttype: 'DEFAULT',\n\t\t\t\tsource: {\n\t\t\t\t\tdroppableId: 'B',\n\t\t\t\t\tindex: 0,\n\t\t\t\t},\n\t\t\t},\n\t\t\texpect.any(Object),\n\t\t);\n\n\t\tfireEvent.keyDown(handle, { key: 'ArrowLeft' });\n\t\tjest.runOnlyPendingTimers();\n\t\texpect(onDragUpdate).toHaveBeenCalledWith(\n\t\t\t{\n\t\t\t\tdraggableId: 'B0',\n\t\t\t\tmode: 'SNAP',\n\t\t\t\ttype: 'DEFAULT',\n\t\t\t\tcombine: null,\n\t\t\t\tsource: {\n\t\t\t\t\tdroppableId: 'B',\n\t\t\t\t\tindex: 0,\n\t\t\t\t},\n\t\t\t\tdestination: {\n\t\t\t\t\tdroppableId: 'A',\n\t\t\t\t\tindex: 0,\n\t\t\t\t},\n\t\t\t},\n\t\t\texpect.any(Object),\n\t\t);\n\t\texpect(isOver(handle)).toBe('A');\n\n\t\tfireEvent.keyDown(handle, { key: ' ' });\n\t\texpect(isDragging(handle)).toBe(false);\n\n\t\tjest.useRealTimers();\n\t});\n\n\tit('should have a lower bound for the destination index', () => {\n\t\tjest.useFakeTimers();\n\n\t\tconst onDragUpdate = jest.fn();\n\n\t\tconst { getByTestId } = render(<App onDragUpdate={onDragUpdate} />);\n\n\t\tconst handle = getByTestId('1');\n\t\tkeyboard.lift(handle);\n\t\texpect(isDragging(handle)).toBe(true);\n\n\t\tfireEvent.keyDown(handle, { key: 'ArrowUp' });\n\t\tjest.runOnlyPendingTimers();\n\t\texpect(onDragUpdate).toHaveBeenCalledWith(\n\t\t\t{\n\t\t\t\tdraggableId: '1',\n\t\t\t\tmode: 'SNAP',\n\t\t\t\ttype: 'DEFAULT',\n\t\t\t\tsource: {\n\t\t\t\t\tdroppableId: 'droppable',\n\t\t\t\t\tindex: 1,\n\t\t\t\t},\n\t\t\t\tcombine: null,\n\t\t\t\tdestination: {\n\t\t\t\t\tdroppableId: 'droppable',\n\t\t\t\t\tindex: 0,\n\t\t\t\t},\n\t\t\t},\n\t\t\texpect.any(Object),\n\t\t);\n\t\tonDragUpdate.mockClear();\n\n\t\tfireEvent.keyDown(handle, { key: 'ArrowUp' });\n\t\tjest.runOnlyPendingTimers();\n\t\texpect(onDragUpdate).not.toHaveBeenCalled();\n\n\t\tfireEvent.keyDown(handle, { key: 'Escape' });\n\n\t\tjest.useRealTimers();\n\t});\n\n\tit('should have an upper bound for the destination index', () => {\n\t\tjest.useFakeTimers();\n\n\t\tconst onDragStart = jest.fn();\n\t\tconst onDragUpdate = jest.fn();\n\n\t\tconst { getByTestId } = render(<App onDragStart={onDragStart} onDragUpdate={onDragUpdate} />);\n\n\t\tconst handle = getByTestId('1');\n\t\tkeyboard.lift(handle);\n\t\texpect(isDragging(handle)).toBe(true);\n\n\t\tfireEvent.keyDown(handle, { key: 'ArrowDown' });\n\t\tjest.runOnlyPendingTimers();\n\t\texpect(onDragStart).toHaveBeenCalledWith(\n\t\t\t{\n\t\t\t\tdraggableId: '1',\n\t\t\t\tmode: 'SNAP',\n\t\t\t\ttype: 'DEFAULT',\n\t\t\t\tsource: {\n\t\t\t\t\tdroppableId: 'droppable',\n\t\t\t\t\tindex: 1,\n\t\t\t\t},\n\t\t\t},\n\t\t\texpect.any(Object),\n\t\t);\n\t\texpect(onDragUpdate).toHaveBeenCalledWith(\n\t\t\t{\n\t\t\t\tdraggableId: '1',\n\t\t\t\tmode: 'SNAP',\n\t\t\t\ttype: 'DEFAULT',\n\t\t\t\tsource: {\n\t\t\t\t\tdroppableId: 'droppable',\n\t\t\t\t\tindex: 1,\n\t\t\t\t},\n\t\t\t\tcombine: null,\n\t\t\t\tdestination: {\n\t\t\t\t\tdroppableId: 'droppable',\n\t\t\t\t\tindex: 2,\n\t\t\t\t},\n\t\t\t},\n\t\t\texpect.any(Object),\n\t\t);\n\t\tonDragUpdate.mockClear();\n\n\t\tfireEvent.keyDown(handle, { key: 'ArrowDown' });\n\t\tjest.runOnlyPendingTimers();\n\t\texpect(onDragUpdate).not.toHaveBeenCalled();\n\n\t\tfireEvent.keyDown(handle, { key: 'Escape' });\n\n\t\tjest.useRealTimers();\n\t});\n\n\ttest('drop indicator disappears after drop', () => {\n\t\tconst { container, getByTestId } = render(<App />);\n\n\t\tconst handle = getByTestId('0');\n\n\t\tkeyboard.lift(handle);\n\t\texpect(isDragging(handle)).toBe(true);\n\n\t\tfireEvent.keyDown(handle, { key: 'ArrowUp' });\n\t\texpect(hasDropIndicator('droppable', container)).toBe(true);\n\n\t\tkeyboard.drop(handle);\n\t\texpect(isDragging(handle)).toBe(false);\n\t\texpect(hasDropIndicator('droppable', container)).toBe(false);\n\t});\n\n\tdescribe('virtual lists', () => {\n\t\tit('should capture and report a11y violations', async () => {\n\t\t\tconst { container } = render(<VirtualBoardExample />);\n\n\t\t\tawait expect(container).toBeAccessible({\n\t\t\t\t// eslint-disable-next-line @atlassian/a11y/no-violation-count\n\t\t\t\tviolationCount: 1,\n\t\t\t});\n\t\t});\n\n\t\tit('should allow moving down after lifting', () => {\n\t\t\tconst { container, getByTestId } = render(<VirtualBoardExample />);\n\n\t\t\tconst handle = getByTestId('item-C3');\n\n\t\t\texpect(handle).toHaveAttribute('data-rbd-draggable-index', '3');\n\n\t\t\tkeyboard.lift(handle);\n\t\t\tfireEvent.keyDown(container, { key: 'ArrowDown' });\n\t\t\tkeyboard.drop(container);\n\n\t\t\t// It should have moved down\n\t\t\texpect(getByTestId('item-C3')).toHaveAttribute('data-rbd-draggable-index', '4');\n\t\t});\n\n\t\tit('should rebind the listener after a cancelled drop', () => {\n\t\t\treplaceRaf();\n\n\t\t\tconst { getByTestId } = render(<VirtualBoardExample />);\n\n\t\t\t/**\n\t\t\t * Lifts the node, and returns the keydown event used.\n\t\t\t */\n\t\t\tfunction liftNode(): Event {\n\t\t\t\tconst node = getByTestId('item-A0');\n\t\t\t\tconst event = createEvent.keyDown(node, { key: ' ' });\n\t\t\t\tact(() => {\n\t\t\t\t\tfireEvent(node, event);\n\t\t\t\t\t// @ts-expect-error\n\t\t\t\t\trequestAnimationFrame.step();\n\t\t\t\t});\n\t\t\t\texpect(isDragging(getByTestId('item-A0'))).toBe(true);\n\t\t\t\treturn event;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Drops the node, and returns the keydown event used.\n\t\t\t */\n\t\t\tfunction dropNode(): Event {\n\t\t\t\tconst event = createEvent.keyDown(document, { key: ' ' });\n\t\t\t\tact(() => {\n\t\t\t\t\tfireEvent(document, event);\n\t\t\t\t\t// @ts-expect-error\n\t\t\t\t\trequestAnimationFrame.step();\n\t\t\t\t});\n\t\t\t\texpect(isDragging(getByTestId('item-A0'))).toBe(false);\n\t\t\t\treturn event;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Perform a lift and drop.\n\t\t\t *\n\t\t\t * The events should have their default prevented (to stop scrolling).\n\t\t\t * We can infer that the handler is properly applied by this.\n\t\t\t */\n\t\t\texpect(liftNode().defaultPrevented).toBe(true);\n\t\t\texpect(dropNode().defaultPrevented).toBe(true);\n\n\t\t\t/**\n\t\t\t * Now do it again.\n\t\t\t *\n\t\t\t * The event handler should have been rebound to the draggable,\n\t\t\t * which would have remounted after the drop.\n\t\t\t *\n\t\t\t * (It unmounted because it had a clone).\n\t\t\t */\n\t\t\texpect(liftNode().defaultPrevented).toBe(true);\n\t\t\texpect(dropNode().defaultPrevented).toBe(true);\n\t\t});\n\t});\n\n\tdescribe('cross-axis dragging', () => {\n\t\tfunction CrossAxisApp() {\n\t\t\treturn (\n\t\t\t\t<DragDropContext onDragEnd={() => {}}>\n\t\t\t\t\t<Droppable droppableId=\"scrollable-parent\">\n\t\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tdata-testid=\"scrollable-parent\"\n\t\t\t\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\t\t\t\tstyle={{ overflowY: 'scroll' }}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t\t\t\t\t<Draggable draggableId=\"A\" index={0}>\n\t\t\t\t\t\t\t\t\t\t{(provided, snapshot) => (\n\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"A\"\n\t\t\t\t\t\t\t\t\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\tDraggable A\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Droppable>\n\t\t\t\t\t<Droppable droppableId=\"scrollable-droppable\">\n\t\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t{...provided.droppableProps}\n\t\t\t\t\t\t\t\tdata-testid=\"scrollable-droppable\"\n\t\t\t\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\t\t\t\tstyle={{ overflowY: 'scroll' }}\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<Draggable draggableId=\"B\" index={0}>\n\t\t\t\t\t\t\t\t\t{(provided, snapshot) => (\n\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"B\"\n\t\t\t\t\t\t\t\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\tDraggable B\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Droppable>\n\t\t\t\t</DragDropContext>\n\t\t\t);\n\t\t}\n\n\t\tit('should capture and report a11y violations', async () => {\n\t\t\tjest.useFakeTimers();\n\t\t\tconst { container } = render(<CrossAxisApp />);\n\n\t\t\tawait expect(container).toBeAccessible();\n\t\t});\n\n\t\tit('should call scrollTo(0, 0) on the scroll container when it is a parent of the droppable', () => {\n\t\t\tjest.useFakeTimers();\n\n\t\t\tconst { getByTestId } = render(<CrossAxisApp />);\n\n\t\t\tconst handle = getByTestId('B');\n\t\t\tkeyboard.lift(handle);\n\t\t\texpect(isDragging(handle)).toBe(true);\n\n\t\t\tconst prevList = getByTestId('scrollable-parent');\n\t\t\tprevList.scrollTo = jest.fn();\n\n\t\t\tfireEvent.keyDown(handle, { key: 'ArrowLeft' });\n\t\t\tjest.runOnlyPendingTimers();\n\n\t\t\texpect(prevList.scrollTo).toHaveBeenCalledWith(0, 0);\n\n\t\t\tjest.useRealTimers();\n\t\t});\n\n\t\tit('should call scrollTo(0, 0) on the scroll container when it is the droppable', () => {\n\t\t\tjest.useFakeTimers();\n\n\t\t\tconst { getByTestId } = render(<CrossAxisApp />);\n\n\t\t\tconst handle = getByTestId('A');\n\t\t\tkeyboard.lift(handle);\n\t\t\texpect(isDragging(handle)).toBe(true);\n\n\t\t\tconst nextList = getByTestId('scrollable-droppable');\n\t\t\tnextList.scrollTo = jest.fn();\n\n\t\t\tfireEvent.keyDown(handle, { key: 'ArrowRight' });\n\t\t\tjest.runOnlyPendingTimers();\n\n\t\t\texpect(nextList.scrollTo).toHaveBeenCalledWith(0, 0);\n\n\t\t\tjest.useRealTimers();\n\t\t});\n\n\t\tit('should skip disabled droppables for cross axis movement', () => {\n\t\t\tconst App = () => (\n\t\t\t\t<DragDropContext onDragEnd={() => {}}>\n\t\t\t\t\t<Droppable droppableId=\"A\">\n\t\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t\t\t\t<Draggable draggableId=\"A0\" index={0}>\n\t\t\t\t\t\t\t\t\t{(provided, snapshot) => (\n\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"A0\"\n\t\t\t\t\t\t\t\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t\t\t{provided.placeholder}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Droppable>\n\t\t\t\t\t<Droppable droppableId=\"B\" isDropDisabled>\n\t\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t\t\t\t{provided.placeholder}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Droppable>\n\t\t\t\t\t<Droppable droppableId=\"C\">\n\t\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t\t\t\t{provided.placeholder}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Droppable>\n\t\t\t\t</DragDropContext>\n\t\t\t);\n\n\t\t\tconst { container, getByTestId } = render(<App />);\n\n\t\t\tconst handle = getByTestId('A0');\n\t\t\tkeyboard.lift(handle);\n\t\t\texpect(isDragging(handle)).toBe(true);\n\t\t\texpect(hasDropIndicator('A', container)).toBe(true);\n\n\t\t\tfireEvent.keyDown(handle, { key: 'ArrowRight' });\n\n\t\t\texpect(hasDropIndicator('B', container)).toBe(false);\n\t\t\texpect(hasDropIndicator('C', container)).toBe(true);\n\n\t\t\tfireEvent.keyDown(handle, { key: 'ArrowLeft' });\n\t\t\texpect(hasDropIndicator('B', container)).toBe(false);\n\t\t\texpect(hasDropIndicator('A', container)).toBe(true);\n\n\t\t\tkeyboard.cancel(handle);\n\t\t});\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/draggable/placeholder.test.tsx",
    "content": "// The tests in this file are derived from the placeholder tests in `react-beautiful-dnd`\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/integration/droppable/placeholder.spec.js>\n//\n// Placeholders in the migration layer are rendered by the `<Draggable>` but\n// have some similar behavior.\n\nimport React from 'react';\n\nimport { fireEvent, render } from '@testing-library/react';\nimport invariant from 'tiny-invariant';\n\nimport { DragDropContext, Draggable, Droppable } from '../../../src';\nimport { getDroppable, hasPlaceholderInDroppable, setElementFromPoint } from '../_util';\nimport { mouse } from '../ported-from-react-beautiful-dnd/unit/integration/_utils/controls';\nimport { isDragging } from '../ported-from-react-beautiful-dnd/unit/integration/_utils/helpers';\n\nconst columns = [\n\t{ id: 'A', items: [{ id: 'A0' }, { id: 'A1' }, { id: 'A2' }] },\n\t{ id: 'B', items: [{ id: 'B0' }] },\n\t{ id: 'C', items: [] },\n];\n\nfunction Board() {\n\treturn (\n\t\t<DragDropContext onDragEnd={() => {}}>\n\t\t\t<Droppable droppableId=\"board\" type=\"column\">\n\t\t\t\t{(provided) => (\n\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t\t{columns.map((column, index) => (\n\t\t\t\t\t\t\t<Draggable key={column.id} draggableId={`column-${column.id}`} index={index}>\n\t\t\t\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t\t\t\t<div ref={provided.innerRef} {...provided.draggableProps}>\n\t\t\t\t\t\t\t\t\t\t<div {...provided.dragHandleProps}>Column {column.id}</div>\n\t\t\t\t\t\t\t\t\t\t<Droppable droppableId={column.id}>\n\t\t\t\t\t\t\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t\t\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{column.items.map((item, index) => (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Draggable key={item.id} draggableId={item.id} index={index}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{(provided, snapshot) => (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata-is-over={snapshot.draggingOver}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tItem {item.id}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t\t\t\t\t{provided.placeholder}\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t</Droppable>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t))}\n\t\t\t\t\t\t{provided.placeholder}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n\nfunction getAllColumnDroppableIds() {\n\tconst droppableIds = columns.map((column) => column.id);\n\tinvariant(droppableIds.length > 0, 'There are some droppable ids');\n\treturn droppableIds;\n}\n\nfunction isOver(element: HTMLElement) {\n\treturn element.getAttribute('data-is-over');\n}\n\nit('should not render a placeholder at rest', () => {\n\tconst { container } = render(<Board />);\n\n\tconst droppableIds = getAllColumnDroppableIds();\n\tdroppableIds.forEach((droppableId) => {\n\t\texpect(hasPlaceholderInDroppable(droppableId, container)).toBe(false);\n\t});\n});\n\n/**\n * In `react-beautiful-dnd` this was testing 'when dragging over' instead.\n */\nit('should render a placeholder when dragging from', () => {\n\tconst { container, getByText } = render(<Board />);\n\n\tconst handle = getByText('Item B0');\n\tsetElementFromPoint(handle);\n\tmouse.lift(handle);\n\n\texpect(isOver(handle)).toBe('B');\n\texpect(hasPlaceholderInDroppable('B', container)).toBe(true);\n\n\tfireEvent.dragLeave(getDroppable('B', container));\n\n\texpect(isOver(handle)).toBe(null);\n\texpect(hasPlaceholderInDroppable('B', container)).toBe(true);\n});\n\nit('should remove all placeholders if an error occurs while dragging', () => {\n\tconst droppableIds = getAllColumnDroppableIds();\n\tdroppableIds.forEach((droppableId) => {\n\t\tconst { container, getByText, unmount } = render(<Board />);\n\n\t\tconst handle = getByText('Item A0');\n\t\tsetElementFromPoint(handle);\n\t\tmouse.lift(handle);\n\n\t\tfireEvent.dragEnter(getDroppable(droppableId, container));\n\n\t\texpect(isDragging(handle)).toBe(true);\n\t\texpect(isOver(handle)).toBe(droppableId);\n\t\texpect(hasPlaceholderInDroppable('A', container)).toBe(true);\n\n\t\tfireEvent(window, new Event('error'));\n\n\t\texpect(isDragging(handle)).toBe(false);\n\t\texpect(hasPlaceholderInDroppable('A', container)).toBe(false);\n\n\t\tunmount();\n\t});\n});\n\ndescribe('home list', () => {\n\tit('should capture and report a11y violations', async () => {\n\t\tconst { container } = render(<Board />);\n\n\t\tawait expect(container).toBeAccessible();\n\t});\n\n\tit('should always render a placeholder while dragging', () => {\n\t\tconst droppableIds = getAllColumnDroppableIds();\n\t\tdroppableIds.forEach((droppableId) => {\n\t\t\tconst { container, getByText, unmount } = render(<Board />);\n\n\t\t\tconst handle = getByText('Item A0');\n\t\t\tsetElementFromPoint(handle);\n\t\t\tmouse.lift(handle);\n\n\t\t\tfireEvent.dragEnter(getDroppable(droppableId, container));\n\n\t\t\t// regardless of what we are over\n\t\t\t// there should always be a placeholder in home\n\t\t\texpect(isOver(handle)).toBe(droppableId);\n\t\t\texpect(hasPlaceholderInDroppable('A', container)).toBe(true);\n\n\t\t\tunmount();\n\t\t});\n\t});\n\n\tit('should immediately remove the home placeholder after dropping into any list', () => {\n\t\tconst droppableIds = getAllColumnDroppableIds();\n\n\t\tdroppableIds.forEach((droppableId) => {\n\t\t\tconst { container, getByText, unmount } = render(<Board />);\n\n\t\t\tconst handle: HTMLElement = getByText('Item A0');\n\t\t\tsetElementFromPoint(handle);\n\t\t\tmouse.lift(handle);\n\n\t\t\tfireEvent.dragEnter(getDroppable(droppableId, container));\n\t\t\texpect(isOver(handle)).toBe(droppableId);\n\n\t\t\tfireEvent.drop(handle);\n\t\t\t// placeholder removed straight after drop\n\t\t\texpect(hasPlaceholderInDroppable(droppableId, container)).toBe(false);\n\n\t\t\tunmount();\n\t\t});\n\t});\n\n\tit('should immediately remove the home placeholder after dropping nowhere', () => {\n\t\tconst { container, getByText } = render(<Board />);\n\n\t\tconst handle: HTMLElement = getByText('Item A0');\n\t\tsetElementFromPoint(handle);\n\t\tmouse.lift(handle);\n\n\t\tfireEvent.dragEnter(getDroppable('A', container));\n\t\tfireEvent.dragLeave(getDroppable('A', container));\n\t\texpect(isOver(handle)).toBe(null);\n\n\t\t// placeholder present when over nothing\n\t\texpect(hasPlaceholderInDroppable('A', container)).toBe(true);\n\n\t\t// placeholder gone after drop finished\n\t\tfireEvent.drop(handle);\n\t\texpect(hasPlaceholderInDroppable('A', container)).toBe(false);\n\t});\n});\n\ndescribe('foreign list', () => {\n\tit('should not render a placeholder if not dragging over', () => {\n\t\tconst droppableIds = getAllColumnDroppableIds();\n\t\tdroppableIds\n\t\t\t.filter((droppableId) => droppableId !== 'A')\n\t\t\t.forEach((droppableId) => {\n\t\t\t\tconst { container, getByText, unmount } = render(<Board />);\n\n\t\t\t\tconst handle = getByText('Item A0');\n\t\t\t\tsetElementFromPoint(handle);\n\t\t\t\tmouse.lift(handle);\n\n\t\t\t\texpect(isOver(handle)).not.toBe(droppableId);\n\t\t\t\texpect(hasPlaceholderInDroppable(droppableId, container)).toBe(false);\n\n\t\t\t\tunmount();\n\t\t\t});\n\t});\n\n\tit('should not render a placeholder if dragging over', () => {\n\t\tconst droppableIds = getAllColumnDroppableIds();\n\t\tdroppableIds\n\t\t\t.filter((droppableId) => droppableId !== 'A')\n\t\t\t.forEach((droppableId) => {\n\t\t\t\tconst { container, getByText, unmount } = render(<Board />);\n\n\t\t\t\tconst handle = getByText('Item A0');\n\t\t\t\tsetElementFromPoint(handle);\n\t\t\t\tmouse.lift(handle);\n\n\t\t\t\tfireEvent.dragEnter(getDroppable(droppableId, container));\n\t\t\t\texpect(isOver(handle)).toBe(droppableId);\n\t\t\t\texpect(hasPlaceholderInDroppable(droppableId, container)).toBe(false);\n\n\t\t\t\tunmount();\n\t\t\t});\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/draggable/portal.test.tsx",
    "content": "// This file extends the portal test(s) from `react-beautiful-dnd`\n\nimport React from 'react';\n\nimport { fireEvent, render } from '@testing-library/react';\nimport type {\n\tDraggableProvided,\n\tDraggableStateSnapshot,\n\tDragStart,\n\tDragUpdate,\n\tDropResult,\n} from 'react-beautiful-dnd';\nimport ReactDOM from 'react-dom';\n\nimport * as closestEdge from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { setElementFromPoint } from '../_util';\nimport App, { type Item } from '../ported-from-react-beautiful-dnd/unit/integration/_utils/app';\nimport {\n\tmouse,\n\tsimpleLift,\n} from '../ported-from-react-beautiful-dnd/unit/integration/_utils/controls';\n\nconst extractClosestEdge = jest.spyOn(closestEdge, 'extractClosestEdge');\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nconst portal: HTMLElement = document.createElement('div');\ndocument.body.appendChild(portal);\n\nafterAll(() => {\n\tdocument.body.removeChild(portal);\n});\n\nconst renderItem =\n\t(item: Item) => (provided: DraggableProvided, snapshot: DraggableStateSnapshot) => {\n\t\tconst child = (\n\t\t\t<div\n\t\t\t\tref={provided.innerRef}\n\t\t\t\t{...provided.draggableProps}\n\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\tdata-testid={item.id}\n\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t\tdata-dragging-over={snapshot.draggingOver}\n\t\t\t>\n\t\t\t\tDrag me!\n\t\t\t</div>\n\t\t);\n\n\t\tif (!snapshot.isDragging) {\n\t\t\treturn child;\n\t\t}\n\n\t\treturn ReactDOM.createPortal(child, portal);\n\t};\n\nit('should allow consumers to use their own portal', () => {\n\tconst { getByTestId } = render(<App renderItem={renderItem} />);\n\n\tconst before: HTMLElement = getByTestId('0');\n\tsetElementFromPoint(before);\n\tsimpleLift(mouse, before);\n\n\t// moved to portal after lift\n\tconst inPortal: HTMLElement = getByTestId('0');\n\texpect(inPortal).toHaveAttribute('data-dragging-over', 'droppable');\n\n\tfireEvent.dragLeave(getByTestId('droppable'));\n\texpect(inPortal).not.toHaveAttribute('data-dragging-over');\n\n\t// out of portal after drop\n\tmouse.drop(inPortal);\n});\n\nit('should fire expected events', () => {\n\tjest.useFakeTimers();\n\n\tconst onDragStart = jest.fn();\n\tconst onDragUpdate = jest.fn();\n\tconst onDragEnd = jest.fn();\n\n\tconst { getByTestId } = render(\n\t\t<App\n\t\t\trenderItem={renderItem}\n\t\t\tonDragStart={onDragStart}\n\t\t\tonDragUpdate={onDragUpdate}\n\t\t\tonDragEnd={onDragEnd}\n\t\t/>,\n\t);\n\n\tconst before: HTMLElement = getByTestId('0');\n\tsetElementFromPoint(before);\n\tsimpleLift(mouse, before);\n\tjest.runOnlyPendingTimers();\n\n\tconst dragStart: DragStart = {\n\t\tmode: 'FLUID',\n\t\ttype: 'DEFAULT',\n\t\tdraggableId: '0',\n\t\tsource: {\n\t\t\tdroppableId: 'droppable',\n\t\t\tindex: 0,\n\t\t},\n\t};\n\texpect(onDragStart).toHaveBeenCalledWith(dragStart, expect.any(Object));\n\n\t// moved to portal after lift\n\tconst inPortal: HTMLElement = getByTestId('0');\n\texpect(inPortal).toHaveAttribute('data-dragging-over', 'droppable');\n\n\textractClosestEdge.mockReturnValue('bottom');\n\tfireEvent.dragEnter(getByTestId('2'));\n\tjest.runOnlyPendingTimers();\n\tconst dragUpdate: DragUpdate = {\n\t\t...dragStart,\n\t\tcombine: null,\n\t\tdestination: {\n\t\t\tdroppableId: 'droppable',\n\t\t\tindex: 2,\n\t\t},\n\t};\n\texpect(onDragUpdate).toHaveBeenCalledWith(dragUpdate, expect.any(Object));\n\n\tmouse.drop(inPortal);\n\tconst result: DropResult = {\n\t\t...dragUpdate,\n\t\treason: 'DROP',\n\t};\n\texpect(onDragEnd).toHaveBeenCalledWith(result);\n\n\texpect(inPortal).not.toBeInTheDocument();\n\n\tjest.useRealTimers();\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/draggable/provided.test.tsx",
    "content": "import { notDraggingStyle } from '../../../src/draggable/get-draggable-provided-style';\n\nimport { defaultItems, renderApp } from './_utils';\n\ndescribe('<Draggable> provided', () => {\n\tit('should match the expected value', () => {\n\t\tconst { getProvided } = renderApp();\n\n\t\tdefaultItems.forEach((item) => {\n\t\t\tconst provided = getProvided(item.id);\n\t\t\texpect(provided[0]).toEqual({\n\t\t\t\tdraggableProps: {\n\t\t\t\t\t'data-rbd-draggable-context-id': '0',\n\t\t\t\t\t'data-rbd-draggable-id': item.id,\n\t\t\t\t\tstyle: notDraggingStyle,\n\t\t\t\t},\n\t\t\t\tdragHandleProps: {\n\t\t\t\t\trole: 'button',\n\t\t\t\t\t'aria-describedby': 'rbd-lift-instruction-0',\n\t\t\t\t\t'data-rbd-drag-handle-context-id': '0',\n\t\t\t\t\t'data-rbd-drag-handle-draggable-id': item.id,\n\t\t\t\t\ttabIndex: 0,\n\t\t\t\t\tdraggable: false,\n\t\t\t\t\tonDragStart: expect.any(Function),\n\t\t\t\t},\n\t\t\t\tinnerRef: expect.any(Function),\n\t\t\t});\n\t\t});\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/draggable/timing.test.tsx",
    "content": "import React from 'react';\n\nimport { render } from '@testing-library/react';\n\nimport { setElementFromPoint } from '../_util';\nimport App from '../ported-from-react-beautiful-dnd/unit/integration/_utils/app';\nimport {\n\tmouse,\n\tsimpleLift,\n} from '../ported-from-react-beautiful-dnd/unit/integration/_utils/controls';\n\nfunction getRect({ x = 0, y = 0, width = 0, height = 0 }: DOMRectInit): DOMRect {\n\t// DOMRect.fromRect is not available in jest\n\treturn {\n\t\tx,\n\t\ty,\n\t\twidth,\n\t\theight,\n\t\tleft: x,\n\t\tright: x + width,\n\t\ttop: y,\n\t\tbottom: y + height,\n\t\ttoJSON() {},\n\t};\n}\n\njest.spyOn(HTMLElement.prototype, 'getBoundingClientRect').mockImplementation(function (\n\tthis: HTMLElement,\n) {\n\treturn getRect({\n\t\tx: 0,\n\t\ty: 0,\n\t\twidth: parseFloat(this.style.width),\n\t\theight: parseFloat(this.style.height),\n\t});\n});\n\nit('should use dimensions changed in onBeforeCapture', () => {\n\tconst onBeforeCapture = jest.fn(({ draggableId }: { draggableId: string }) => {\n\t\tconst element = getByTestId(draggableId);\n\t\telement.style.width = '200px';\n\t\telement.style.height = '200px';\n\t});\n\n\tconst { getByTestId } = render(<App onBeforeCapture={onBeforeCapture} />);\n\n\tconst before: HTMLElement = getByTestId('0');\n\tbefore.style.width = '100px';\n\tbefore.style.height = '100px';\n\n\tsetElementFromPoint(before);\n\tsimpleLift(mouse, before);\n\n\texpect(onBeforeCapture).toHaveBeenCalled();\n\n\texpect(before.style.width).toBe('200px');\n\texpect(before.style.height).toBe('200px');\n\n\tmouse.drop(before);\n});\n\nit('should not use dimensions changed in onBeforeDragStart', () => {\n\tconst onBeforeDragStart = jest.fn(({ draggableId }: { draggableId: string }) => {\n\t\tconst element = getByTestId(draggableId);\n\t\telement.style.width = '200px';\n\t\telement.style.height = '200px';\n\t});\n\n\tconst { getByTestId } = render(<App onBeforeDragStart={onBeforeDragStart} />);\n\n\tconst before: HTMLElement = getByTestId('0');\n\tbefore.style.width = '100px';\n\tbefore.style.height = '100px';\n\n\tsetElementFromPoint(before);\n\tsimpleLift(mouse, before);\n\n\texpect(onBeforeDragStart).toHaveBeenCalled();\n\n\texpect(before.style.width).toBe('100px');\n\texpect(before.style.height).toBe('100px');\n\n\tmouse.drop(before);\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/droppable/auto-scroll.test.tsx",
    "content": "import React from 'react';\n\nimport { act, fireEvent, render } from '@testing-library/react';\nimport { replaceRaf } from 'raf-stub';\n\nimport { autoScroller } from '@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll';\n\nimport { DragDropContext, Draggable, Droppable } from '../../../src';\nimport { setElementFromPoint } from '../_util';\nimport { mouse } from '../ported-from-react-beautiful-dnd/unit/integration/_utils/controls';\nimport { isDragging } from '../ported-from-react-beautiful-dnd/unit/integration/_utils/helpers';\n\nfunction List() {\n\treturn (\n\t\t<DragDropContext onDragEnd={() => {}}>\n\t\t\t<Droppable droppableId=\"list\">\n\t\t\t\t{(provided) => (\n\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps} data-testid=\"list\">\n\t\t\t\t\t\t<Draggable draggableId=\"item\" index={0}>\n\t\t\t\t\t\t\t{(provided, snapshot) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t\tdata-testid=\"item\"\n\t\t\t\t\t\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tItem\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t{provided.placeholder}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n\nconst autoScrollerStart = jest.spyOn(autoScroller, 'start');\nconst autoScrollerUpdateInput = jest.spyOn(autoScroller, 'updateInput');\nconst autoScrollerStop = jest.spyOn(autoScroller, 'stop');\n\nreplaceRaf();\n\ndescribe('integration with @atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll', () => {\n\tit('should capture and report a11y violations', async () => {\n\t\tconst { container } = render(<List />);\n\n\t\tawait expect(container).toBeAccessible();\n\t});\n\n\tit('should call autoScroller.start() on dragstart', () => {\n\t\tconst { getByTestId } = render(<List />);\n\t\tconst item = getByTestId('item');\n\n\t\tsetElementFromPoint(item);\n\t\tfireEvent.dragStart(item, { clientX: 1, clientY: 2 });\n\t\tact(() => {\n\t\t\t// @ts-expect-error\n\t\t\trequestAnimationFrame.step();\n\t\t});\n\n\t\texpect(isDragging(item)).toBe(true);\n\t\texpect(autoScrollerStart).toHaveBeenCalledWith({\n\t\t\tinput: expect.objectContaining({ clientX: 1, clientY: 2 }),\n\t\t});\n\n\t\tmouse.cancel(item);\n\t});\n\n\tit('should call autoScroller.updateInput() on drag', () => {\n\t\tconst { getByTestId } = render(<List />);\n\t\tconst item = getByTestId('item');\n\n\t\tsetElementFromPoint(item);\n\t\tfireEvent.dragStart(item, { clientX: 1, clientY: 2 });\n\n\t\tfireEvent.dragOver(item, { clientX: 3, clientY: 4 });\n\t\tact(() => {\n\t\t\t// @ts-expect-error\n\t\t\trequestAnimationFrame.step();\n\t\t});\n\t\texpect(autoScrollerUpdateInput).toHaveBeenCalledWith({\n\t\t\tinput: expect.objectContaining({ clientX: 3, clientY: 4 }),\n\t\t});\n\n\t\tfireEvent.dragOver(item, { clientX: 5, clientY: 6 });\n\t\tact(() => {\n\t\t\t// @ts-expect-error\n\t\t\trequestAnimationFrame.step();\n\t\t});\n\t\texpect(autoScrollerUpdateInput).toHaveBeenCalledWith({\n\t\t\tinput: expect.objectContaining({ clientX: 5, clientY: 6 }),\n\t\t});\n\n\t\tmouse.cancel(item);\n\t});\n\n\tit('should call autoScroller.stop() on drop', () => {\n\t\tconst { getByTestId } = render(<List />);\n\t\tconst item = getByTestId('item');\n\n\t\tsetElementFromPoint(item);\n\t\tfireEvent.dragStart(item);\n\t\tfireEvent.dragEnd(item);\n\n\t\texpect(autoScrollerStop).toHaveBeenCalled();\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/droppable/closest-edge.test.tsx",
    "content": "import React from 'react';\n\nimport { fireEvent, render } from '@testing-library/react';\nimport type { Direction, DropResult, OnDragEndResponder } from 'react-beautiful-dnd';\n\nimport * as closestEdge from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\n\nimport { DragDropContext, Draggable, Droppable } from '../../../src';\nimport { setup } from '../_utils/setup';\nimport { mouse } from '../ported-from-react-beautiful-dnd/unit/integration/_utils/controls';\nimport { isDragging } from '../ported-from-react-beautiful-dnd/unit/integration/_utils/helpers';\n\nfunction List({ direction, onDragEnd }: { direction: Direction; onDragEnd: OnDragEndResponder }) {\n\treturn (\n\t\t<DragDropContext onDragEnd={onDragEnd}>\n\t\t\t<Droppable droppableId=\"list\" direction={direction}>\n\t\t\t\t{(provided) => (\n\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps} data-testid=\"list\">\n\t\t\t\t\t\t{['A', 'B', 'C'].map((id, index) => (\n\t\t\t\t\t\t\t<Draggable key={id} draggableId={`item-${id}`} index={index}>\n\t\t\t\t\t\t\t\t{(provided, snapshot) => (\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t\t\tdata-testid={`item-${id}`}\n\t\t\t\t\t\t\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\tItem {id}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t))}\n\t\t\t\t\t\t{provided.placeholder}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n\nconst extractClosestEdge = jest.spyOn(closestEdge, 'extractClosestEdge');\n\ndescribe('<Droppable /> closest edge behavior', () => {\n\tbeforeAll(() => {\n\t\tsetup();\n\t});\n\n\tbeforeEach(() => {\n\t\textractClosestEdge.mockReset();\n\t});\n\n\tconst cases = [\n\t\t{\n\t\t\tclosestEdge: 'top',\n\t\t\tdescription: 'should target the first index when entering from the top of a vertical list',\n\t\t\tdestinationIndex: 0,\n\t\t\tdirection: 'vertical',\n\t\t},\n\t\t{\n\t\t\tclosestEdge: 'bottom',\n\t\t\tdescription: 'should target the last index when entering from the bottom of a vertical list',\n\t\t\tdestinationIndex: 2,\n\t\t\tdirection: 'vertical',\n\t\t},\n\t\t{\n\t\t\tclosestEdge: 'left',\n\t\t\tdescription: 'should target the first index when entering from the left of a horizontal list',\n\t\t\tdestinationIndex: 0,\n\t\t\tdirection: 'horizontal',\n\t\t},\n\t\t{\n\t\t\tclosestEdge: 'right',\n\t\t\tdescription: 'should target the last index when entering from the right of a horizontal list',\n\t\t\tdestinationIndex: 2,\n\t\t\tdirection: 'horizontal',\n\t\t},\n\t] as const;\n\n\tcases.forEach(({ closestEdge, description, destinationIndex, direction }) => {\n\t\tit(description, () => {\n\t\t\tconst onDragEnd = jest.fn();\n\t\t\tconst { getByTestId } = render(<List direction={direction} onDragEnd={onDragEnd} />);\n\t\t\tconst itemB = getByTestId('item-B');\n\n\t\t\tmouse.lift(itemB);\n\t\t\texpect(isDragging(itemB)).toBe(true);\n\n\t\t\t/**\n\t\t\t * Leave the list and re-enter it, mocking the closest edge value.\n\t\t\t */\n\t\t\tconst list = getByTestId('list');\n\t\t\tfireEvent.dragLeave(list);\n\t\t\textractClosestEdge.mockReturnValue(closestEdge);\n\t\t\tfireEvent.dragEnter(list);\n\n\t\t\tmouse.drop(itemB);\n\n\t\t\tconst dropResult: DropResult = {\n\t\t\t\treason: 'DROP',\n\t\t\t\tsource: {\n\t\t\t\t\tdroppableId: 'list',\n\t\t\t\t\tindex: 1,\n\t\t\t\t},\n\t\t\t\tdestination: {\n\t\t\t\t\tdroppableId: 'list',\n\t\t\t\t\tindex: destinationIndex,\n\t\t\t\t},\n\t\t\t\tcombine: null,\n\t\t\t\tmode: 'FLUID',\n\t\t\t\tdraggableId: 'item-B',\n\t\t\t\ttype: 'DEFAULT',\n\t\t\t};\n\t\t\texpect(onDragEnd).toHaveBeenCalledWith(dropResult, expect.any(Object));\n\t\t});\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/droppable/drop-indicator.test.tsx",
    "content": "// The tests in this file are derived from the placeholder tests in `react-beautiful-dnd`\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/integration/droppable/placeholder.spec.js>\n//\n// Drop indicators in the migration layer are rendered through the `placeholder`\n// provided by `<Droppable>`, but they behave somewhat differently.\n\nimport React from 'react';\n\nimport { fireEvent, render } from '@testing-library/react';\nimport type { DroppableId, DroppableMode, DroppableProvided } from 'react-beautiful-dnd';\nimport invariant from 'tiny-invariant';\n\nimport * as closestEdge from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\n\nimport { DragDropContext, Draggable, Droppable } from '../../../src';\nimport { attributes, customAttributes } from '../../../src/utils/attributes';\nimport { getDroppable, getPlaceholder, setElementFromPoint } from '../_util';\nimport {\n\tkeyboard,\n\tmouse,\n} from '../ported-from-react-beautiful-dnd/unit/integration/_utils/controls';\nimport { isDragging } from '../ported-from-react-beautiful-dnd/unit/integration/_utils/helpers';\n\nconst extractClosestEdge = jest.spyOn(closestEdge, 'extractClosestEdge');\n\n/**\n * This mock is required because jest does not implement `scrollIntoView`.\n */\nHTMLElement.prototype.scrollIntoView = jest.fn();\n\nconst columns = [\n\t{ id: 'A', items: [{ id: 'A0' }, { id: 'A1' }, { id: 'A2' }] },\n\t{ id: 'B', items: [{ id: 'B0' }] },\n\t{ id: 'C', items: [] },\n];\n\nfunction Board({ mode = 'standard', columnSpy }: { mode?: DroppableMode; columnSpy?: jest.Mock }) {\n\treturn (\n\t\t<DragDropContext onDragEnd={() => {}}>\n\t\t\t<Droppable droppableId=\"board\" type=\"column\">\n\t\t\t\t{(provided) => (\n\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t\t{columns.map((column, index) => (\n\t\t\t\t\t\t\t<Draggable key={column.id} draggableId={`column-${column.id}`} index={index}>\n\t\t\t\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t\t\t\t<div ref={provided.innerRef} {...provided.draggableProps}>\n\t\t\t\t\t\t\t\t\t\t<div {...provided.dragHandleProps}>Column {column.id}</div>\n\t\t\t\t\t\t\t\t\t\t<Droppable droppableId={column.id} type=\"card\" mode={mode}>\n\t\t\t\t\t\t\t\t\t\t\t{(provided, snapshot) => {\n\t\t\t\t\t\t\t\t\t\t\t\tcolumnSpy?.(provided, snapshot);\n\t\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{column.items.map((item, index) => (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<Draggable key={item.id} draggableId={item.id} index={index}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{(provided, snapshot) => (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata-is-over={snapshot.draggingOver}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tItem {item.id}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{provided.placeholder}\n\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t</Droppable>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t))}\n\t\t\t\t\t\t{provided.placeholder}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n\nfunction getAllColumnDroppableIds() {\n\tconst droppableIds = columns.map((column) => column.id);\n\tinvariant(droppableIds.length > 0, 'There are some droppable ids');\n\treturn droppableIds;\n}\n\nfunction isOver(element: HTMLElement) {\n\treturn element.getAttribute('data-is-over');\n}\n\nfunction findDropIndicator(droppableId: DroppableId, container: HTMLElement): HTMLElement | null {\n\treturn container.querySelector(\n\t\t`[${attributes.droppable.id}=\"${droppableId}\"] [${customAttributes.dropIndicator}]`,\n\t);\n}\n\nfunction hasDropIndicator(droppableId: DroppableId, container: HTMLElement): boolean {\n\treturn Boolean(findDropIndicator(droppableId, container));\n}\n\nit('should not render a drop indicator at rest', () => {\n\tconst { container } = render(<Board />);\n\n\tconst droppableIds = getAllColumnDroppableIds();\n\tdroppableIds.forEach((droppableId) => {\n\t\texpect(hasDropIndicator(droppableId, container)).toBe(false);\n\t});\n});\n\nit('should render a drop indicator when dragging over', () => {\n\tconst droppableIds = getAllColumnDroppableIds();\n\tdroppableIds.forEach((droppableId) => {\n\t\tconst { container, getByText, unmount } = render(<Board />);\n\n\t\tconst handle = getByText('Item A0');\n\t\tsetElementFromPoint(handle);\n\t\tmouse.lift(handle);\n\n\t\tfireEvent.dragEnter(getDroppable(droppableId, container));\n\n\t\texpect(isOver(handle)).toBe(droppableId);\n\t\texpect(hasDropIndicator(droppableId, container)).toBe(true);\n\n\t\tunmount();\n\t});\n});\n\nit('should remove all drop indicators if an error occurs while dragging', () => {\n\tconst droppableIds = getAllColumnDroppableIds();\n\tdroppableIds.forEach((droppableId) => {\n\t\tconst { container, getByText, unmount } = render(<Board />);\n\n\t\tconst handle = getByText('Item A0');\n\t\tsetElementFromPoint(handle);\n\t\tmouse.lift(handle);\n\n\t\tfireEvent.dragEnter(getDroppable(droppableId, container));\n\n\t\texpect(isDragging(handle)).toBe(true);\n\t\texpect(isOver(handle)).toBe(droppableId);\n\t\texpect(hasDropIndicator(droppableId, container)).toBe(true);\n\n\t\tfireEvent(window, new Event('error'));\n\n\t\texpect(isDragging(handle)).toBe(false);\n\t\texpect(hasDropIndicator(droppableId, container)).toBe(false);\n\n\t\tunmount();\n\t});\n});\n\n/**\n * These tests originated from\n * `packages/pragmatic-drag-and-drop/migration/__tests__/unit/react-beautiful-dnd/unit/integration/droppable/placeholder.test.tsx`\n * but have been inverted.\n *\n * In `react-beautiful-dnd` the placeholder was rendered in the list\n * being dragged __from__.\n *\n * In the migration layer, the placeholder is rendered in the list being\n * dragged __over__.\n */\ndescribe('home list', () => {\n\tit('should capture and report a11y violations', async () => {\n\t\tconst { container } = render(<Board />);\n\n\t\tawait expect(container).toBeAccessible();\n\t});\n\n\tit('should not render a drop indicator while dragging over other lists', () => {\n\t\tconst { container, getByText } = render(<Board />);\n\n\t\tconst handle = getByText('Item A0');\n\t\tsetElementFromPoint(handle);\n\t\tmouse.lift(handle);\n\n\t\texpect(isOver(handle)).toBe('A');\n\t\texpect(hasDropIndicator('A', container)).toBe(true);\n\n\t\tconst droppableIds = getAllColumnDroppableIds();\n\t\tdroppableIds\n\t\t\t.filter((droppableId) => droppableId !== 'A')\n\t\t\t.forEach((droppableId) => {\n\t\t\t\tfireEvent.dragEnter(getDroppable(droppableId, container));\n\n\t\t\t\t// regardless of what we are over\n\t\t\t\t// there should not be a drop indicator in home\n\t\t\t\texpect(isOver(handle)).toBe(droppableId);\n\t\t\t\texpect(hasDropIndicator('A', container)).toBe(false);\n\t\t\t});\n\t});\n\n\tit('should immediately remove the home drop indicator after dropping into any list', () => {\n\t\tconst droppableIds = getAllColumnDroppableIds();\n\t\tdroppableIds.forEach((droppableId) => {\n\t\t\tconst { container, getByText, unmount } = render(<Board />);\n\n\t\t\tconst handle = getByText('Item A0');\n\t\t\tsetElementFromPoint(handle);\n\t\t\tmouse.lift(handle);\n\n\t\t\tfireEvent.dragEnter(getDroppable(droppableId, container));\n\t\t\texpect(isOver(handle)).toBe(droppableId);\n\t\t\texpect(hasDropIndicator(droppableId, container)).toBe(true);\n\n\t\t\tmouse.drop(handle);\n\t\t\texpect(hasDropIndicator(droppableId, container)).toBe(false);\n\n\t\t\tunmount();\n\t\t});\n\t});\n\n\t/**\n\t * The original `react-beautiful-dnd` test checked the placeholder was removed\n\t * immediately after dropping nowhere.\n\t *\n\t * This has been changed in the migration layer to check that no drop indicator\n\t * exists if dragging over nowhere.\n\t */\n\tit('should not have any drop indicator if dragging nowhere', () => {\n\t\tconst droppableIds = getAllColumnDroppableIds();\n\t\tdroppableIds.forEach((droppableId) => {\n\t\t\tconst { container, getByText, unmount } = render(<Board />);\n\n\t\t\tconst handle = getByText('Item A0');\n\t\t\tsetElementFromPoint(handle);\n\t\t\tmouse.lift(handle);\n\n\t\t\texpect(container.querySelector(`[${customAttributes.dropIndicator}]`)).not.toBe(null);\n\n\t\t\tfireEvent.dragEnter(getDroppable(droppableId, container));\n\t\t\tfireEvent.dragLeave(getDroppable(droppableId, container));\n\t\t\texpect(isOver(handle)).toBe(null);\n\n\t\t\texpect(container.querySelector(`[${customAttributes.dropIndicator}]`)).toBe(null);\n\n\t\t\tmouse.drop(handle);\n\t\t\texpect(hasDropIndicator(droppableId, container)).toBe(false);\n\n\t\t\tunmount();\n\t\t});\n\t});\n});\n\ndescribe('foreign list', () => {\n\tit('should render a drop indicator if dragging over', () => {\n\t\tconst droppableIds = getAllColumnDroppableIds();\n\t\tdroppableIds\n\t\t\t.filter((droppableId) => droppableId !== 'A')\n\t\t\t.forEach((droppableId) => {\n\t\t\t\tconst { container, getByText, unmount } = render(<Board />);\n\n\t\t\t\tconst handle = getByText('Item A0');\n\t\t\t\tsetElementFromPoint(handle);\n\t\t\t\tmouse.lift(handle);\n\n\t\t\t\tfireEvent.dragEnter(getDroppable(droppableId, container));\n\t\t\t\texpect(isOver(handle)).toBe(droppableId);\n\t\t\t\texpect(hasDropIndicator(droppableId, container)).toBe(true);\n\n\t\t\t\tunmount();\n\t\t\t});\n\t});\n\n\tit('should not render a drop indicator if not dragging over', () => {\n\t\tconst droppableIds = getAllColumnDroppableIds();\n\t\tdroppableIds\n\t\t\t.filter((droppableId) => droppableId !== 'A')\n\t\t\t.forEach((droppableId) => {\n\t\t\t\tconst { container, getByText, unmount } = render(<Board />);\n\n\t\t\t\tconst handle = getByText('Item A0');\n\t\t\t\tsetElementFromPoint(handle);\n\t\t\t\tmouse.lift(handle);\n\n\t\t\t\texpect(isOver(handle)).toBe('A');\n\t\t\t\texpect(hasDropIndicator(droppableId, container)).toBe(false);\n\n\t\t\t\tunmount();\n\t\t\t});\n\t});\n});\n\n/**\n * The tests below here are not derived from `react-beautiful-dnd`.\n *\n * These tests are new.\n */\n\ndescribe('auto scroll', () => {\n\tdescribe('keyboard drag', () => {\n\t\tit('should call scrollIntoView after moving', () => {\n\t\t\tconst { container, getByText } = render(<Board />);\n\n\t\t\tconst handle = getByText('Item A0');\n\t\t\tkeyboard.lift(handle);\n\n\t\t\tconst dropIndicator = container.querySelector(`[${customAttributes.dropIndicator}]`);\n\t\t\tinvariant(dropIndicator, 'There is a drop indicator being rendered.');\n\n\t\t\tdropIndicator.scrollIntoView = jest.fn();\n\n\t\t\tfireEvent.keyDown(window, { key: 'ArrowDown' });\n\t\t\texpect(dropIndicator.scrollIntoView).toHaveBeenCalled();\n\n\t\t\tkeyboard.cancel(handle);\n\t\t});\n\t});\n\n\tdescribe('mouse drag', () => {\n\t\tit('should NOT call scrollIntoView after moving', () => {\n\t\t\tconst { container, getByText } = render(<Board />);\n\n\t\t\tconst handle = getByText('Item A0');\n\t\t\tsetElementFromPoint(handle);\n\t\t\tmouse.lift(handle);\n\n\t\t\tconst dropIndicator = container.querySelector(`[${customAttributes.dropIndicator}]`);\n\t\t\tinvariant(dropIndicator, 'There is a drop indicator being rendered.');\n\t\t\tdropIndicator.scrollIntoView = jest.fn();\n\n\t\t\tconst initialTarget = getByText('Item A1');\n\t\t\textractClosestEdge.mockReturnValue('top');\n\t\t\tfireEvent.dragEnter(initialTarget);\n\t\t\tfireEvent.dragOver(initialTarget);\n\t\t\texpect(dropIndicator.scrollIntoView).not.toHaveBeenCalled();\n\n\t\t\tmouse.cancel(handle);\n\t\t});\n\t});\n});\n\ndescribe('provided placeholder element', () => {\n\tit('should NOT be null for standard lists', () => {\n\t\tconst columnSpy = jest.fn((_: DroppableProvided) => {});\n\n\t\tconst { container, getByText } = render(<Board mode=\"standard\" columnSpy={columnSpy} />);\n\n\t\t// Ignore the initial render\n\t\tcolumnSpy.mockClear();\n\n\t\tconst handle = getByText('Item A0');\n\t\tsetElementFromPoint(handle);\n\t\tmouse.lift(handle);\n\n\t\texpect(hasDropIndicator('A', container)).toBe(true);\n\n\t\tconst callsForColumnA = columnSpy.mock.calls.filter(\n\t\t\t([provided]) => provided.droppableProps['data-rbd-droppable-id'] === 'A',\n\t\t);\n\n\t\texpect(callsForColumnA).toHaveLength(1);\n\t\texpect(callsForColumnA[0][0]).not.toHaveProperty('placeholder', null);\n\n\t\tmouse.cancel(handle);\n\t});\n\n\tit('should be null for virtual lists', () => {\n\t\tconst columnSpy = jest.fn((_: DroppableProvided) => {});\n\n\t\tconst { container, getByText } = render(<Board mode=\"virtual\" columnSpy={columnSpy} />);\n\n\t\t// Ignore the initial render\n\t\tcolumnSpy.mockClear();\n\n\t\tconst handle = getByText('Item A0');\n\t\tsetElementFromPoint(handle);\n\t\tmouse.lift(handle);\n\n\t\texpect(hasDropIndicator('A', container)).toBe(true);\n\n\t\tconst callsForColumnA = columnSpy.mock.calls.filter(\n\t\t\t([provided]) => provided.droppableProps['data-rbd-droppable-id'] === 'A',\n\t\t);\n\n\t\texpect(callsForColumnA).toHaveLength(1);\n\t\texpect(callsForColumnA[0][0]).toHaveProperty('placeholder', null);\n\n\t\tmouse.cancel(handle);\n\t});\n});\n\ndescribe('hiding the drop indicator', () => {\n\tit('should be hidden when the source and target destinations are the same', () => {\n\t\tconst { container, getByText } = render(<Board />);\n\n\t\tconst handle = getByText('Item A1');\n\t\tsetElementFromPoint(handle);\n\t\tmouse.lift(handle);\n\n\t\tconst dropIndicator = container.querySelector(`[${customAttributes.dropIndicator}]`);\n\t\tinvariant(dropIndicator, 'There is a drop indicator being rendered.');\n\t\tdropIndicator.scrollIntoView = jest.fn();\n\n\t\t/**\n\t\t * The drop indicator should be hidden when over:\n\t\t */\n\n\t\t/**\n\t\t * The bottom edge of the item before\n\t\t */\n\t\textractClosestEdge.mockReturnValue('bottom');\n\t\tfireEvent.dragEnter(getByText('Item A0'));\n\t\texpect(dropIndicator).not.toBeVisible();\n\n\t\t/**\n\t\t * The top edge of the item itself\n\t\t */\n\t\textractClosestEdge.mockReturnValue('top');\n\t\tfireEvent.dragEnter(getPlaceholder());\n\t\texpect(dropIndicator).not.toBeVisible();\n\n\t\t/**\n\t\t * The top edge of the item after\n\t\t */\n\t\textractClosestEdge.mockReturnValue('top');\n\t\tfireEvent.dragEnter(getByText('Item A2'));\n\t\texpect(dropIndicator).not.toBeVisible();\n\n\t\t/**\n\t\t * The bottom edge of the item itself\n\t\t */\n\t\textractClosestEdge.mockReturnValue('bottom');\n\t\tfireEvent.dragEnter(getPlaceholder());\n\t\texpect(dropIndicator).not.toBeVisible();\n\n\t\tmouse.cancel(handle);\n\t});\n\n\tit('should still scroll to hidden indicators during a keyboard drag', () => {\n\t\tconst { container, getByText } = render(<Board />);\n\n\t\tconst handle = getByText('Item A1');\n\t\tkeyboard.lift(handle);\n\n\t\tconst dropIndicator = container.querySelector(`[${customAttributes.dropIndicator}]`);\n\t\tinvariant(dropIndicator, 'There is a drop indicator being rendered.');\n\t\tconst scrollIntoView = jest.fn();\n\t\tdropIndicator.scrollIntoView = scrollIntoView;\n\n\t\texpect(scrollIntoView).not.toHaveBeenCalled();\n\n\t\tfireEvent.keyDown(document, { key: 'ArrowDown' });\n\n\t\texpect(dropIndicator).toBeVisible();\n\t\texpect(scrollIntoView).toHaveBeenCalled();\n\t\tscrollIntoView.mockClear();\n\n\t\tfireEvent.keyDown(document, { key: 'ArrowUp' });\n\t\texpect(dropIndicator).not.toBeVisible();\n\t\texpect(scrollIntoView).toHaveBeenCalled();\n\n\t\tkeyboard.cancel(handle);\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/droppable/gap/calculate-gap.test.tsx",
    "content": "import React from 'react';\n\nimport { render } from '@testing-library/react';\nimport type { Direction, DraggableProvided, DroppableProvided } from 'react-beautiful-dnd';\nimport invariant from 'tiny-invariant';\n\nimport { DragDropContext, Draggable, Droppable } from '../../../../src';\nimport { calculateGap } from '../../../../src/droppable/gap';\n\nfunction App({ direction }: { direction?: Direction }) {\n\treturn (\n\t\t<DragDropContext onDragEnd={() => {}}>\n\t\t\t<Droppable droppableId=\"droppable\" direction={direction}>\n\t\t\t\t{(droppableProvided: DroppableProvided) => (\n\t\t\t\t\t<div ref={droppableProvided.innerRef} {...droppableProvided.droppableProps}>\n\t\t\t\t\t\t<Draggable draggableId=\"0\" index={0}>\n\t\t\t\t\t\t\t{(draggableProvided: DraggableProvided) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tref={draggableProvided.innerRef}\n\t\t\t\t\t\t\t\t\tdata-testid=\"0\"\n\t\t\t\t\t\t\t\t\t{...draggableProvided.draggableProps}\n\t\t\t\t\t\t\t\t\t{...draggableProvided.dragHandleProps}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tDrag me!\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t<Draggable draggableId=\"1\" index={1}>\n\t\t\t\t\t\t\t{(draggableProvided: DraggableProvided) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tref={draggableProvided.innerRef}\n\t\t\t\t\t\t\t\t\tdata-testid=\"1\"\n\t\t\t\t\t\t\t\t\t{...draggableProvided.draggableProps}\n\t\t\t\t\t\t\t\t\t{...draggableProvided.dragHandleProps}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tDrag me!\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t{droppableProvided.placeholder}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n\nconst rectMap: Record<string, DOMRect> = {\n\t'0': DOMRect.fromRect({ x: 0, y: 0, width: 100, height: 40 }),\n\t'1': DOMRect.fromRect({ x: 0, y: 60, width: 100, height: 40 }),\n};\n\njest.spyOn(HTMLElement.prototype, 'getBoundingClientRect').mockImplementation(function (\n\tthis: HTMLElement,\n) {\n\tconst testId = this.getAttribute('data-testid');\n\tinvariant(typeof testId === 'string');\n\treturn rectMap[testId];\n});\n\nconst getComputedStyle = jest.spyOn(window, 'getComputedStyle');\n\ndescribe('calculateGap()', () => {\n\tit('should return the distance between elements', () => {\n\t\tconst { getByTestId } = render(<App />);\n\n\t\tconst gapAfterFirst = calculateGap({\n\t\t\tdirection: 'vertical',\n\t\t\telement: getByTestId('0'),\n\t\t\twhere: 'after',\n\t\t\tcontextId: '0',\n\t\t});\n\t\texpect(gapAfterFirst).toBe(20);\n\n\t\tconst gapBeforeSecond = calculateGap({\n\t\t\tdirection: 'vertical',\n\t\t\telement: getByTestId('1'),\n\t\t\twhere: 'before',\n\t\t\tcontextId: '0',\n\t\t});\n\t\texpect(gapBeforeSecond).toBe(gapAfterFirst);\n\t});\n\n\tit('should guess based on margins if there is no element before', () => {\n\t\tconst { getByTestId } = render(<App />);\n\n\t\tconst firstElement = getByTestId('0');\n\n\t\t// @ts-ignore UTEST-1630\n\t\tgetComputedStyle.mockImplementation(function (el) {\n\t\t\tconst style = new CSSStyleDeclaration();\n\t\t\tif (el === firstElement) {\n\t\t\t\tstyle.margin = '0px 0px 24px 0px';\n\t\t\t\tstyle.marginBottom = '24px';\n\t\t\t}\n\t\t\treturn style;\n\t\t});\n\n\t\tconst gapBeforeFirst = calculateGap({\n\t\t\tdirection: 'vertical',\n\t\t\telement: firstElement,\n\t\t\twhere: 'before',\n\t\t\tcontextId: '0',\n\t\t});\n\t\texpect(gapBeforeFirst).toBe(24);\n\t});\n\n\tit('should guess based on margins if there is no element after', () => {\n\t\tconst direction = 'horizontal';\n\t\tconst { getByTestId } = render(<App direction={direction} />);\n\n\t\tconst lastElement = getByTestId('1');\n\n\t\t// @ts-ignore UTEST-1630\n\t\tgetComputedStyle.mockImplementation((el) => {\n\t\t\tconst style = new CSSStyleDeclaration();\n\t\t\tif (el === lastElement) {\n\t\t\t\tstyle.margin = '0px 4px 0px 12px';\n\t\t\t}\n\t\t\treturn style;\n\t\t});\n\n\t\tconst gapAfterLast = calculateGap({\n\t\t\tdirection,\n\t\t\telement: lastElement,\n\t\t\twhere: 'after',\n\t\t\tcontextId: '0',\n\t\t});\n\t\texpect(gapAfterLast).toBe(16);\n\t});\n\n\tit('should capture and report a11y violations', async () => {\n\t\tconst { container } = render(<App />);\n\n\t\tawait expect(container).toBeAccessible();\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/droppable/gap/get-distance.test.tsx",
    "content": "import { getDistance } from '../../../../src/droppable/gap/get-distance';\n\nconst width = 10;\nconst height = 5;\n\n/**\n * This is a browser API that is not defined in the testing environment.\n */\n\nfunction getRects({ dx, dy }: { dx: number; dy: number }): [DOMRect, DOMRect] {\n\tconst a = DOMRect.fromRect({ x: 0, y: 0, width, height });\n\tconst b = DOMRect.fromRect({ x: width + dx, y: height + dy, width, height });\n\treturn [a, b];\n}\n\ndescribe('getDistance()', () => {\n\tdescribe('when direction=\"vertical\"', () => {\n\t\tconst dx = 10;\n\n\t\tit('should return the vertical distance', () => {\n\t\t\tconst dy = 20;\n\t\t\tconst [a, b] = getRects({ dx, dy });\n\t\t\tconst distance = getDistance({\n\t\t\t\ta,\n\t\t\t\tb,\n\t\t\t\tdirection: 'vertical',\n\t\t\t});\n\n\t\t\texpect(distance).toBe(dy);\n\t\t});\n\n\t\tit('should not depend on order', () => {\n\t\t\tconst dy = 20;\n\t\t\tconst [a, b] = getRects({ dx, dy });\n\t\t\tconst distance = getDistance({\n\t\t\t\ta: b,\n\t\t\t\tb: a,\n\t\t\t\tdirection: 'vertical',\n\t\t\t});\n\n\t\t\texpect(distance).toBe(dy);\n\t\t});\n\t});\n\n\tdescribe('when direction=\"horizontal\"', () => {\n\t\tconst dy = 10;\n\n\t\tit('should return the horizontal distance', () => {\n\t\t\tconst dx = 20;\n\t\t\tconst [a, b] = getRects({ dx, dy });\n\t\t\tconst distance = getDistance({\n\t\t\t\ta,\n\t\t\t\tb,\n\t\t\t\tdirection: 'horizontal',\n\t\t\t});\n\n\t\t\texpect(distance).toBe(dx);\n\t\t});\n\n\t\tit('should not depend on order', () => {\n\t\t\tconst dx = 20;\n\t\t\tconst [a, b] = getRects({ dx, dy });\n\t\t\tconst distance = getDistance({\n\t\t\t\ta: b,\n\t\t\t\tb: a,\n\t\t\t\tdirection: 'horizontal',\n\t\t\t});\n\n\t\t\texpect(distance).toBe(dx);\n\t\t});\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/droppable/is-drop-disabled.test.tsx",
    "content": "import React, { type ReactNode, useState } from 'react';\n\nimport { act, fireEvent, render } from '@testing-library/react';\nimport { replaceRaf } from 'raf-stub';\nimport type {\n\tDraggableProvided,\n\tDragStart,\n\tDragUpdate,\n\tDroppableProvided,\n\tOnDragEndResponder,\n\tOnDragStartResponder,\n\tOnDragUpdateResponder,\n} from 'react-beautiful-dnd';\n\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { DragDropContext, Draggable, Droppable } from '../../../src';\nimport { setElementFromPoint } from '../_util';\nimport {\n\tkeyboard,\n\tmouse,\n} from '../ported-from-react-beautiful-dnd/unit/integration/_utils/controls';\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nHTMLElement.prototype.scrollIntoView = jest.fn();\n\ntype AppProps = {\n\tonDragStart: OnDragStartResponder;\n\tonDragUpdate: OnDragUpdateResponder;\n\tonDragEnd: OnDragEndResponder;\n};\n\nfunction AppInner(droppableProvided: DroppableProvided) {\n\treturn (\n\t\t<div ref={droppableProvided.innerRef} {...droppableProvided.droppableProps}>\n\t\t\t<Draggable draggableId=\"draggable\" index={0}>\n\t\t\t\t{(draggableProvided: DraggableProvided) => (\n\t\t\t\t\t<div\n\t\t\t\t\t\tref={draggableProvided.innerRef}\n\t\t\t\t\t\tdata-testid=\"drag-handle\"\n\t\t\t\t\t\t{...draggableProvided.draggableProps}\n\t\t\t\t\t\t{...draggableProvided.dragHandleProps}\n\t\t\t\t\t>\n\t\t\t\t\t\tDrag me!\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Draggable>\n\t\t\t{droppableProvided.placeholder}\n\t\t</div>\n\t);\n}\n\nfunction OuterDroppable({ children }: { children: ReactNode }) {\n\treturn (\n\t\t<Droppable droppableId=\"outer\">\n\t\t\t{(provided) => (\n\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t{children}\n\t\t\t\t\t{provided.placeholder}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</Droppable>\n\t);\n}\n\nfunction App({ onDragStart, onDragUpdate, onDragEnd }: AppProps) {\n\treturn (\n\t\t<DragDropContext onDragStart={onDragStart} onDragUpdate={onDragUpdate} onDragEnd={onDragEnd}>\n\t\t\t<Droppable droppableId=\"droppable\" isDropDisabled>\n\t\t\t\t{(droppableProvided: DroppableProvided) => (\n\t\t\t\t\t<div ref={droppableProvided.innerRef} {...droppableProvided.droppableProps}>\n\t\t\t\t\t\t<Draggable draggableId=\"draggable\" index={0}>\n\t\t\t\t\t\t\t{(draggableProvided: DraggableProvided) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tref={draggableProvided.innerRef}\n\t\t\t\t\t\t\t\t\tdata-testid=\"drag-handle\"\n\t\t\t\t\t\t\t\t\t{...draggableProvided.draggableProps}\n\t\t\t\t\t\t\t\t\t{...draggableProvided.dragHandleProps}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tDrag me!\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t{droppableProvided.placeholder}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n\njest.useFakeTimers();\n\nreplaceRaf();\n\nit('should allow the disabling of a droppable in onDragStart', () => {\n\tconst responders = {\n\t\tonDragStart: jest.fn(),\n\t\tonDragUpdate: jest.fn(),\n\t\tonDragEnd: jest.fn(),\n\t};\n\tconst { getByTestId } = render(<App {...responders} />);\n\tconst handle: HTMLElement = getByTestId('drag-handle');\n\n\tsetElementFromPoint(handle);\n\n\tact(() => {\n\t\tfireEvent.dragStart(handle);\n\t\t// @ts-expect-error\n\t\trequestAnimationFrame.step();\n\t});\n\n\t// flush responder\n\tact(() => {\n\t\tjest.runOnlyPendingTimers();\n\t});\n\n\tconst start: DragStart = {\n\t\tdraggableId: 'draggable',\n\t\tsource: {\n\t\t\tdroppableId: 'droppable',\n\t\t\tindex: 0,\n\t\t},\n\t\ttype: 'DEFAULT',\n\t\tmode: 'FLUID',\n\t};\n\texpect(responders.onDragStart).toHaveBeenCalledWith(start, expect.any(Object));\n\n\t// onDragUpdate will occur after setTimeout\n\texpect(responders.onDragUpdate).not.toHaveBeenCalled();\n\n\tact(() => {\n\t\tjest.runOnlyPendingTimers();\n\t});\n\n\t// an update should be fired as the home location has changed\n\tconst update: DragUpdate = {\n\t\t...start,\n\t\t// no destination as it is now disabled\n\t\tdestination: null,\n\t\tcombine: null,\n\t};\n\texpect(responders.onDragUpdate).toHaveBeenCalledWith(update, expect.any(Object));\n});\n\nit('should not fire the DragUpdate twice', () => {\n\tconst responders = {\n\t\tonDragStart: jest.fn(),\n\t\tonDragUpdate: jest.fn(),\n\t\tonDragEnd: jest.fn(),\n\t};\n\tconst { getByTestId } = render(<App {...responders} />);\n\tconst handle: HTMLElement = getByTestId('drag-handle');\n\n\tsetElementFromPoint(handle);\n\n\tact(() => {\n\t\tfireEvent.dragStart(handle);\n\t\t// @ts-expect-error\n\t\trequestAnimationFrame.step();\n\t});\n\n\tact(() => {\n\t\t// flush onDragStart\n\t\tjest.runOnlyPendingTimers();\n\n\t\t// flush onDragUpdate\n\t\tjest.runOnlyPendingTimers();\n\t});\n\n\t// an update should be fired as the home location has changed\n\tconst update: DragUpdate = {\n\t\tdraggableId: 'draggable',\n\t\tsource: {\n\t\t\tdroppableId: 'droppable',\n\t\t\tindex: 0,\n\t\t},\n\t\ttype: 'DEFAULT',\n\t\tmode: 'FLUID',\n\t\t// no destination as it is now disabled\n\t\tdestination: null,\n\t\tcombine: null,\n\t};\n\texpect(responders.onDragUpdate).toHaveBeenCalledWith(update, expect.any(Object));\n\n\texpect(responders.onDragUpdate).toHaveBeenCalledTimes(1);\n\tact(() => {\n\t\tfireEvent.dragOver(document.body);\n\t\t// @ts-expect-error\n\t\trequestAnimationFrame.step();\n\t});\n\texpect(responders.onDragUpdate).toHaveBeenCalledTimes(1);\n});\n\nconst cases = [\n\t{ id: 'keyboard', control: keyboard, mode: 'SNAP' },\n\t{ id: 'mouse', control: mouse, mode: 'FLUID' },\n] as const;\n\ncases.forEach(({ id, control, mode }) => {\n\tdescribe(`when the droppable starts disabled (${id})`, () => {\n\t\tit('should fire an update after drag start', () => {\n\t\t\tconst onDragStart = jest.fn();\n\t\t\tconst onDragUpdate = jest.fn();\n\n\t\t\tconst App = () => {\n\t\t\t\treturn (\n\t\t\t\t\t<DragDropContext\n\t\t\t\t\t\tonDragStart={onDragStart}\n\t\t\t\t\t\tonDragUpdate={onDragUpdate}\n\t\t\t\t\t\tonDragEnd={() => {}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Droppable droppableId=\"droppable\" isDropDisabled>\n\t\t\t\t\t\t\t{AppInner}\n\t\t\t\t\t\t</Droppable>\n\t\t\t\t\t</DragDropContext>\n\t\t\t\t);\n\t\t\t};\n\n\t\t\tconst { getByTestId } = render(<App />);\n\t\t\tconst handle: HTMLElement = getByTestId('drag-handle');\n\n\t\t\tcontrol.lift(handle);\n\t\t\tact(() => {\n\t\t\t\tjest.runOnlyPendingTimers();\n\t\t\t});\n\n\t\t\tconst start: DragStart = {\n\t\t\t\tdraggableId: 'draggable',\n\t\t\t\tsource: {\n\t\t\t\t\tdroppableId: 'droppable',\n\t\t\t\t\tindex: 0,\n\t\t\t\t},\n\t\t\t\ttype: 'DEFAULT',\n\t\t\t\tmode,\n\t\t\t};\n\t\t\texpect(onDragStart).toHaveBeenCalledWith(start, expect.any(Object));\n\n\t\t\t// onDragUpdate will occur after setTimeout\n\t\t\texpect(onDragUpdate).not.toHaveBeenCalled();\n\n\t\t\tact(() => {\n\t\t\t\tjest.runOnlyPendingTimers();\n\t\t\t});\n\n\t\t\t// an update should be fired as the home location has changed\n\t\t\tconst update: DragUpdate = {\n\t\t\t\t...start,\n\t\t\t\t// no destination as it is now disabled\n\t\t\t\tdestination: null,\n\t\t\t\tcombine: null,\n\t\t\t};\n\t\t\texpect(onDragUpdate).toHaveBeenCalledWith(update, expect.any(Object));\n\n\t\t\tcontrol.cancel(handle);\n\t\t});\n\n\t\tit('should respect nesting of droppables', () => {\n\t\t\tconst onDragStart = jest.fn();\n\t\t\tconst onDragUpdate = jest.fn();\n\n\t\t\tconst App = () => {\n\t\t\t\treturn (\n\t\t\t\t\t<DragDropContext\n\t\t\t\t\t\tonDragStart={onDragStart}\n\t\t\t\t\t\tonDragUpdate={onDragUpdate}\n\t\t\t\t\t\tonDragEnd={() => {}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<OuterDroppable>\n\t\t\t\t\t\t\t<Droppable droppableId=\"droppable\" isDropDisabled>\n\t\t\t\t\t\t\t\t{AppInner}\n\t\t\t\t\t\t\t</Droppable>\n\t\t\t\t\t\t</OuterDroppable>\n\t\t\t\t\t</DragDropContext>\n\t\t\t\t);\n\t\t\t};\n\n\t\t\tconst { getByTestId } = render(<App />);\n\t\t\tconst handle: HTMLElement = getByTestId('drag-handle');\n\n\t\t\tcontrol.lift(handle);\n\t\t\tact(() => {\n\t\t\t\tjest.runOnlyPendingTimers();\n\t\t\t});\n\n\t\t\tconst start: DragStart = {\n\t\t\t\tdraggableId: 'draggable',\n\t\t\t\tsource: {\n\t\t\t\t\tdroppableId: 'droppable',\n\t\t\t\t\tindex: 0,\n\t\t\t\t},\n\t\t\t\ttype: 'DEFAULT',\n\t\t\t\tmode,\n\t\t\t};\n\t\t\texpect(onDragStart).toHaveBeenCalledWith(start, expect.any(Object));\n\n\t\t\t// onDragUpdate will occur after setTimeout\n\t\t\texpect(onDragUpdate).not.toHaveBeenCalled();\n\n\t\t\tact(() => {\n\t\t\t\tjest.runOnlyPendingTimers();\n\t\t\t});\n\n\t\t\t// an update should be fired as the home location has changed\n\t\t\tconst update: DragUpdate = {\n\t\t\t\t...start,\n\t\t\t\t// destination is now outer droppable as inner is disabled\n\t\t\t\tdestination: { droppableId: 'outer', index: 0 },\n\t\t\t\tcombine: null,\n\t\t\t};\n\t\t\texpect(onDragUpdate).toHaveBeenCalledWith(update, expect.any(Object));\n\n\t\t\tcontrol.cancel(handle);\n\t\t});\n\t});\n\n\tdescribe(`when the droppable becomes disabled during onDragStart (${id})`, () => {\n\t\tit('should fire an update after drag start', () => {\n\t\t\tconst onDragStart = jest.fn();\n\t\t\tconst onDragUpdate = jest.fn();\n\n\t\t\tconst App = () => {\n\t\t\t\tconst [isDropDisabled, setIsDropDisabled] = useState(false);\n\n\t\t\t\treturn (\n\t\t\t\t\t<DragDropContext\n\t\t\t\t\t\tonDragStart={(...args) => {\n\t\t\t\t\t\t\tsetIsDropDisabled(true);\n\t\t\t\t\t\t\tonDragStart(...args);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonDragUpdate={onDragUpdate}\n\t\t\t\t\t\tonDragEnd={() => {\n\t\t\t\t\t\t\tsetIsDropDisabled(false);\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Droppable droppableId=\"droppable\" isDropDisabled={isDropDisabled}>\n\t\t\t\t\t\t\t{AppInner}\n\t\t\t\t\t\t</Droppable>\n\t\t\t\t\t</DragDropContext>\n\t\t\t\t);\n\t\t\t};\n\n\t\t\tconst { getByTestId } = render(<App />);\n\t\t\tconst handle: HTMLElement = getByTestId('drag-handle');\n\n\t\t\tcontrol.lift(handle);\n\t\t\tact(() => {\n\t\t\t\tjest.runOnlyPendingTimers();\n\t\t\t});\n\n\t\t\tconst start: DragStart = {\n\t\t\t\tdraggableId: 'draggable',\n\t\t\t\tsource: {\n\t\t\t\t\tdroppableId: 'droppable',\n\t\t\t\t\tindex: 0,\n\t\t\t\t},\n\t\t\t\ttype: 'DEFAULT',\n\t\t\t\tmode,\n\t\t\t};\n\t\t\texpect(onDragStart).toHaveBeenCalledWith(start, expect.any(Object));\n\n\t\t\t// onDragUpdate will occur after setTimeout\n\t\t\texpect(onDragUpdate).not.toHaveBeenCalled();\n\n\t\t\tact(() => {\n\t\t\t\tjest.runOnlyPendingTimers();\n\t\t\t});\n\n\t\t\t// an update should be fired as the home location has changed\n\t\t\tconst update: DragUpdate = {\n\t\t\t\t...start,\n\t\t\t\t// no destination as it is now disabled\n\t\t\t\tdestination: null,\n\t\t\t\tcombine: null,\n\t\t\t};\n\t\t\texpect(onDragUpdate).toHaveBeenCalledWith(update, expect.any(Object));\n\n\t\t\tcontrol.cancel(handle);\n\t\t});\n\n\t\tit('should respect nesting of droppables', () => {\n\t\t\tconst onDragStart = jest.fn();\n\t\t\tconst onDragUpdate = jest.fn();\n\n\t\t\tconst App = () => {\n\t\t\t\tconst [isDropDisabled, setIsDropDisabled] = useState(false);\n\n\t\t\t\treturn (\n\t\t\t\t\t<DragDropContext\n\t\t\t\t\t\tonDragStart={(...args) => {\n\t\t\t\t\t\t\tsetIsDropDisabled(true);\n\t\t\t\t\t\t\tonDragStart(...args);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonDragUpdate={onDragUpdate}\n\t\t\t\t\t\tonDragEnd={() => {\n\t\t\t\t\t\t\tsetIsDropDisabled(false);\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<OuterDroppable>\n\t\t\t\t\t\t\t<Droppable droppableId=\"droppable\" isDropDisabled={isDropDisabled}>\n\t\t\t\t\t\t\t\t{AppInner}\n\t\t\t\t\t\t\t</Droppable>\n\t\t\t\t\t\t</OuterDroppable>\n\t\t\t\t\t</DragDropContext>\n\t\t\t\t);\n\t\t\t};\n\n\t\t\tconst { getByTestId } = render(<App />);\n\t\t\tconst handle: HTMLElement = getByTestId('drag-handle');\n\n\t\t\tcontrol.lift(handle);\n\t\t\tact(() => {\n\t\t\t\tjest.runOnlyPendingTimers();\n\t\t\t});\n\n\t\t\tconst start: DragStart = {\n\t\t\t\tdraggableId: 'draggable',\n\t\t\t\tsource: {\n\t\t\t\t\tdroppableId: 'droppable',\n\t\t\t\t\tindex: 0,\n\t\t\t\t},\n\t\t\t\ttype: 'DEFAULT',\n\t\t\t\tmode,\n\t\t\t};\n\t\t\texpect(onDragStart).toHaveBeenCalledWith(start, expect.any(Object));\n\n\t\t\t// onDragUpdate will occur after setTimeout\n\t\t\texpect(onDragUpdate).not.toHaveBeenCalled();\n\n\t\t\tact(() => {\n\t\t\t\tjest.runOnlyPendingTimers();\n\t\t\t});\n\n\t\t\t// an update should be fired as the home location has changed\n\t\t\tconst update: DragUpdate = {\n\t\t\t\t...start,\n\t\t\t\t// no destination as it is now disabled\n\t\t\t\tdestination: { droppableId: 'outer', index: 0 },\n\t\t\t\tcombine: null,\n\t\t\t};\n\t\t\texpect(onDragUpdate).toHaveBeenCalledWith(update, expect.any(Object));\n\n\t\t\tcontrol.cancel(handle);\n\t\t});\n\t});\n\n\tdescribe(`when the droppable becomes disabled after a delay (${id})`, () => {\n\t\tit('should fire an update after drag start', () => {\n\t\t\tconst onDragStart = jest.fn();\n\t\t\tconst onDragUpdate = jest.fn();\n\n\t\t\tconst setTimeoutDelay = 9999;\n\n\t\t\tconst App = () => {\n\t\t\t\tconst [isDropDisabled, setIsDropDisabled] = useState(false);\n\n\t\t\t\treturn (\n\t\t\t\t\t<DragDropContext\n\t\t\t\t\t\tonDragStart={(...args) => {\n\t\t\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\t\t\tsetIsDropDisabled(true);\n\t\t\t\t\t\t\t}, setTimeoutDelay);\n\t\t\t\t\t\t\tonDragStart(...args);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonDragUpdate={onDragUpdate}\n\t\t\t\t\t\tonDragEnd={() => {\n\t\t\t\t\t\t\tsetIsDropDisabled(false);\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<Droppable droppableId=\"droppable\" isDropDisabled={isDropDisabled}>\n\t\t\t\t\t\t\t{AppInner}\n\t\t\t\t\t\t</Droppable>\n\t\t\t\t\t</DragDropContext>\n\t\t\t\t);\n\t\t\t};\n\n\t\t\tconst { getByTestId } = render(<App />);\n\t\t\tconst handle: HTMLElement = getByTestId('drag-handle');\n\n\t\t\tcontrol.lift(handle);\n\t\t\tact(() => {\n\t\t\t\tjest.runOnlyPendingTimers();\n\t\t\t});\n\n\t\t\tconst start: DragStart = {\n\t\t\t\tdraggableId: 'draggable',\n\t\t\t\tsource: {\n\t\t\t\t\tdroppableId: 'droppable',\n\t\t\t\t\tindex: 0,\n\t\t\t\t},\n\t\t\t\ttype: 'DEFAULT',\n\t\t\t\tmode,\n\t\t\t};\n\t\t\texpect(onDragStart).toHaveBeenCalledWith(start, expect.any(Object));\n\n\t\t\t// onDragUpdate will occur after setTimeout\n\t\t\texpect(onDragUpdate).not.toHaveBeenCalled();\n\n\t\t\t// `setIsDropDisabled(true)` will be called after the `setTimeoutDelay`\n\t\t\tact(() => {\n\t\t\t\tjest.advanceTimersByTime(setTimeoutDelay);\n\t\t\t});\n\t\t\t// The update has been scheduled but not actually happened yet\n\t\t\texpect(onDragUpdate).not.toHaveBeenCalled();\n\n\t\t\t// Trigger the scheduled update, which is a `setTimeout(fn, 0)`\n\t\t\tact(() => {\n\t\t\t\tjest.advanceTimersByTime(0);\n\t\t\t});\n\n\t\t\t// an update should be fired as the home location has changed\n\t\t\tconst update: DragUpdate = {\n\t\t\t\t...start,\n\t\t\t\t// no destination as it is now disabled\n\t\t\t\tdestination: null,\n\t\t\t\tcombine: null,\n\t\t\t};\n\t\t\texpect(onDragUpdate).toHaveBeenCalledWith(update, expect.any(Object));\n\n\t\t\tcontrol.cancel(handle);\n\t\t});\n\n\t\tit('should respect nesting of droppables', () => {\n\t\t\tconst onDragStart = jest.fn();\n\t\t\tconst onDragUpdate = jest.fn();\n\n\t\t\tconst setTimeoutDelay = 9999;\n\n\t\t\tconst App = () => {\n\t\t\t\tconst [isDropDisabled, setIsDropDisabled] = useState(false);\n\n\t\t\t\treturn (\n\t\t\t\t\t<DragDropContext\n\t\t\t\t\t\tonDragStart={(...args) => {\n\t\t\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\t\t\tsetIsDropDisabled(true);\n\t\t\t\t\t\t\t}, setTimeoutDelay);\n\t\t\t\t\t\t\tonDragStart(...args);\n\t\t\t\t\t\t}}\n\t\t\t\t\t\tonDragUpdate={onDragUpdate}\n\t\t\t\t\t\tonDragEnd={() => {\n\t\t\t\t\t\t\tsetIsDropDisabled(false);\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t<OuterDroppable>\n\t\t\t\t\t\t\t<Droppable droppableId=\"droppable\" isDropDisabled={isDropDisabled}>\n\t\t\t\t\t\t\t\t{AppInner}\n\t\t\t\t\t\t\t</Droppable>\n\t\t\t\t\t\t</OuterDroppable>\n\t\t\t\t\t</DragDropContext>\n\t\t\t\t);\n\t\t\t};\n\n\t\t\tconst { getByTestId } = render(<App />);\n\t\t\tconst handle: HTMLElement = getByTestId('drag-handle');\n\n\t\t\tcontrol.lift(handle);\n\t\t\tact(() => {\n\t\t\t\tjest.runOnlyPendingTimers();\n\t\t\t});\n\n\t\t\tconst start: DragStart = {\n\t\t\t\tdraggableId: 'draggable',\n\t\t\t\tsource: {\n\t\t\t\t\tdroppableId: 'droppable',\n\t\t\t\t\tindex: 0,\n\t\t\t\t},\n\t\t\t\ttype: 'DEFAULT',\n\t\t\t\tmode,\n\t\t\t};\n\t\t\texpect(onDragStart).toHaveBeenCalledWith(start, expect.any(Object));\n\n\t\t\t// onDragUpdate will occur after setTimeout\n\t\t\texpect(onDragUpdate).not.toHaveBeenCalled();\n\n\t\t\t// `setIsDropDisabled(true)` will be called after the `setTimeoutDelay`\n\t\t\tact(() => {\n\t\t\t\tjest.advanceTimersByTime(setTimeoutDelay);\n\t\t\t});\n\t\t\t// The update has been scheduled but not actually happened yet\n\t\t\texpect(onDragUpdate).not.toHaveBeenCalled();\n\n\t\t\t// Trigger the scheduled update, which is a `setTimeout(fn, 0)`\n\t\t\tact(() => {\n\t\t\t\tjest.advanceTimersByTime(0);\n\t\t\t});\n\n\t\t\t// an update should be fired as the home location has changed\n\t\t\tconst update: DragUpdate = {\n\t\t\t\t...start,\n\t\t\t\t// no destination as it is now disabled\n\t\t\t\tdestination: { droppableId: 'outer', index: 0 },\n\t\t\t\tcombine: null,\n\t\t\t};\n\t\t\texpect(onDragUpdate).toHaveBeenCalledWith(update, expect.any(Object));\n\n\t\t\tcontrol.cancel(handle);\n\t\t});\n\t\tif (id === 'mouse') {\n\t\t\tit('should capture and report a11y violations', async () => {\n\t\t\t\tconst onDragStart = jest.fn();\n\t\t\t\tconst onDragUpdate = jest.fn();\n\t\t\t\tconst App = () => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<DragDropContext\n\t\t\t\t\t\t\tonDragStart={onDragStart}\n\t\t\t\t\t\t\tonDragUpdate={onDragUpdate}\n\t\t\t\t\t\t\tonDragEnd={() => {}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Droppable droppableId=\"droppable\" isDropDisabled>\n\t\t\t\t\t\t\t\t{AppInner}\n\t\t\t\t\t\t\t</Droppable>\n\t\t\t\t\t\t</DragDropContext>\n\t\t\t\t\t);\n\t\t\t\t};\n\t\t\t\tconst { container } = render(<App />);\n\n\t\t\t\tawait expect(container).toBeAccessible();\n\t\t\t});\n\t\t}\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/droppable/resting.test.tsx",
    "content": "import React from 'react';\n\nimport { render } from '@testing-library/react';\nimport type { DroppableStateSnapshot } from 'react-beautiful-dnd';\n\nimport { DragDropContext, Droppable } from '../../../src';\n\nfunction App({ spy }: { spy?: jest.Mock }) {\n\treturn (\n\t\t<DragDropContext onDragEnd={() => {}}>\n\t\t\t<Droppable droppableId=\"droppable\">\n\t\t\t\t{(provided, snapshot) => {\n\t\t\t\t\tspy?.(provided, snapshot);\n\t\t\t\t\treturn <div ref={provided.innerRef} {...provided.droppableProps} />;\n\t\t\t\t}}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n\nexport function getSnapshots(spy: jest.Mock): DroppableStateSnapshot[] {\n\treturn spy.mock.calls.map((call) => {\n\t\tconst snapshot: DroppableStateSnapshot = call[1];\n\t\treturn snapshot;\n\t});\n}\n\nit('should have a resting snapshot', () => {\n\tconst spy = jest.fn();\n\trender(<App spy={spy} />);\n\n\tconst snapshots = getSnapshots(spy);\n\n\texpect(snapshots).toHaveLength(1);\n\texpect(snapshots[0]).toEqual({\n\t\tdraggingFromThisWith: null,\n\t\tdraggingOverWith: null,\n\t\tisDraggingOver: false,\n\t\tisUsingPlaceholder: false,\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/error-handling.test.tsx",
    "content": "import React from 'react';\n\nimport { render } from '@testing-library/react';\nimport type { DragDropContextProps, DragUpdate, DropResult } from 'react-beautiful-dnd';\n\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { DragDropContext, Draggable, Droppable } from '../../src';\n\nimport { withWarn } from './ported-from-react-beautiful-dnd/_utils/console';\nimport {\n\tkeyboard,\n\tmouse,\n} from './ported-from-react-beautiful-dnd/unit/integration/_utils/controls';\nimport { isDragging } from './ported-from-react-beautiful-dnd/unit/integration/_utils/helpers';\n\ntype AppProps = Partial<DragDropContextProps> & {\n\tshouldThrow?: boolean;\n};\n\nfunction getRuntimeError(): Event {\n\treturn new window.ErrorEvent('error', {\n\t\terror: new Error('non-rbd'),\n\t\tcancelable: true,\n\t});\n}\n\nfunction App({ shouldThrow = false, ...props }: AppProps) {\n\tif (shouldThrow) {\n\t\twindow.dispatchEvent(getRuntimeError());\n\t}\n\n\treturn (\n\t\t<DragDropContext onDragEnd={() => {}} {...props}>\n\t\t\t<Droppable droppableId=\"droppable\">\n\t\t\t\t{(provided) => (\n\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps} data-testid=\"droppable\">\n\t\t\t\t\t\t<Draggable draggableId=\"draggable-0\" index={0}>\n\t\t\t\t\t\t\t{(provided, snapshot) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tfirst\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t<Draggable draggableId=\"draggable-1\" index={1}>\n\t\t\t\t\t\t\t{(provided, snapshot) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tsecond\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n\njest.useFakeTimers();\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nconst cases = [\n\t{ id: 'mouse', control: mouse, mode: 'FLUID' },\n\t{ id: 'keyboard', control: keyboard, mode: 'SNAP' },\n] as const;\n\ncases.forEach(({ id, control, mode }) => {\n\tit(`should allow new drags on a draggable after being cancelled by a window error (${id})`, () => {\n\t\tconst onDragStart = jest.fn();\n\t\tconst onDragUpdate = jest.fn();\n\t\tconst onDragEnd = jest.fn();\n\n\t\tconst { getByText, rerender } = render(\n\t\t\t<App onDragStart={onDragStart} onDragUpdate={onDragUpdate} onDragEnd={onDragEnd} />,\n\t\t);\n\n\t\tconst draggable = getByText('first');\n\n\t\tcontrol.lift(draggable);\n\t\tjest.runOnlyPendingTimers();\n\t\texpect(isDragging(draggable)).toBe(true);\n\n\t\texpect(onDragStart).toHaveBeenCalledTimes(1);\n\n\t\twithWarn(() => {\n\t\t\trerender(\n\t\t\t\t<App\n\t\t\t\t\tonDragStart={onDragStart}\n\t\t\t\t\tonDragUpdate={onDragUpdate}\n\t\t\t\t\tonDragEnd={onDragEnd}\n\t\t\t\t\tshouldThrow\n\t\t\t\t/>,\n\t\t\t);\n\t\t});\n\n\t\texpect(isDragging(draggable)).toBe(false);\n\n\t\t// there should be an update as the destination becomes `null`\n\t\tconst expectedUpdate: DragUpdate = {\n\t\t\tcombine: null,\n\t\t\tdestination: null,\n\t\t\tdraggableId: 'draggable-0',\n\t\t\tmode,\n\t\t\tsource: { droppableId: 'droppable', index: 0 },\n\t\t\ttype: 'DEFAULT',\n\t\t};\n\t\texpect(onDragUpdate).toHaveBeenCalledTimes(1);\n\t\texpect(onDragUpdate).toHaveBeenCalledWith(expectedUpdate, expect.any(Object));\n\n\t\tconst expectedResult: DropResult = {\n\t\t\ttype: 'DEFAULT',\n\t\t\tmode,\n\t\t\tdraggableId: 'draggable-0',\n\t\t\tsource: {\n\t\t\t\tdroppableId: 'droppable',\n\t\t\t\tindex: 0,\n\t\t\t},\n\t\t\tdestination: null,\n\t\t\tcombine: null,\n\t\t\treason: 'CANCEL',\n\t\t};\n\t\texpect(onDragEnd).toHaveBeenCalledWith(expectedResult, expect.any(Object));\n\n\t\tcontrol.lift(draggable);\n\t\tjest.runOnlyPendingTimers();\n\t\texpect(isDragging(draggable)).toBe(true);\n\n\t\texpect(onDragStart).toHaveBeenCalledTimes(2);\n\n\t\tcontrol.cancel(draggable);\n\t\texpect(onDragUpdate).toHaveBeenCalledTimes(2);\n\t\texpect(onDragEnd).toHaveBeenCalledTimes(2);\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/live-region.test.tsx",
    "content": "import { screen } from '@testing-library/dom';\n\nimport * as liveRegion from '../../src/drag-drop-context/live-region';\n\ndescribe('live region', () => {\n\tbeforeEach(() => {\n\t\tliveRegion.cleanup();\n\t});\n\n\tdescribe('announce', () => {\n\t\tit('should create a live region with role=\"alert\"', () => {\n\t\t\tliveRegion.announce('a message');\n\t\t\texpect(screen.getByRole('alert')).toHaveTextContent('a message');\n\t\t});\n\n\t\tit('should reuse an existing live region', () => {\n\t\t\tliveRegion.announce('');\n\t\t\tconst node = screen.getByRole('alert');\n\n\t\t\tconst msg1 = 'message #1';\n\t\t\tliveRegion.announce(msg1);\n\t\t\texpect(node).toHaveTextContent(msg1);\n\n\t\t\tconst msg2 = 'message #2';\n\t\t\tliveRegion.announce(msg2);\n\t\t\texpect(node).toHaveTextContent(msg2);\n\t\t});\n\n\t\tit('should not create more than one node at a time', () => {\n\t\t\tliveRegion.announce('one message');\n\t\t\tliveRegion.announce('two message');\n\t\t\tliveRegion.announce('red message');\n\t\t\tliveRegion.announce('blue message');\n\n\t\t\texpect(screen.getAllByRole('alert')).toHaveLength(1);\n\t\t});\n\t});\n\n\tdescribe('cleanup', () => {\n\t\tit('should do nothing if a node does not exist', () => {\n\t\t\tconst snapshot = document.documentElement.outerHTML;\n\t\t\tliveRegion.cleanup();\n\t\t\texpect(document.documentElement.outerHTML).toEqual(snapshot);\n\t\t});\n\n\t\tit('should remove the live region node if it exists', () => {\n\t\t\tliveRegion.announce('a message');\n\t\t\tliveRegion.cleanup();\n\t\t\texpect(screen.queryByRole('alert')).not.toBeInTheDocument();\n\t\t});\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/multi-context.test.tsx",
    "content": "import React, { useEffect } from 'react';\n\nimport { fireEvent, render } from '@testing-library/react';\nimport type { DragStart, DragUpdate, Responders } from 'react-beautiful-dnd';\n\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { DragDropContext, Draggable, Droppable } from '../../src';\nimport { useMonitorForLifecycle } from '../../src/drag-drop-context/lifecycle-context';\n\nimport { setElementFromPoint } from './_util';\nimport {\n\tkeyboard,\n\tmouse,\n} from './ported-from-react-beautiful-dnd/unit/integration/_utils/controls';\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\ntype ItemData = { id: string }[];\n\nconst defaultItemData = [\n\t[{ id: '0' }, { id: '1' }, { id: '2' }],\n\t[{ id: '0' }, { id: '1' }, { id: '2' }],\n];\n\nfunction noop() {}\n\nfunction VerticalList({\n\tcontextId,\n\tresponders,\n\titemData,\n}: {\n\tcontextId: number;\n\tresponders: Partial<Responders>;\n\titemData: ItemData;\n}) {\n\treturn (\n\t\t<DragDropContext onDragEnd={noop} {...responders}>\n\t\t\t<Droppable droppableId=\"droppable\">\n\t\t\t\t{(provided) => (\n\t\t\t\t\t<div\n\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t{...provided.droppableProps}\n\t\t\t\t\t\tdata-testid={`${contextId}-droppable`}\n\t\t\t\t\t>\n\t\t\t\t\t\t{itemData.map((item, index) => (\n\t\t\t\t\t\t\t<Draggable key={item.id} draggableId={item.id} index={index}>\n\t\t\t\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t\t\tdata-testid={`${contextId}-${item.id}`}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{item.id}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n\nfunction App({\n\tresponders = [],\n\titemData = defaultItemData,\n}: {\n\tresponders?: Partial<Responders>[];\n\titemData?: ItemData[];\n}) {\n\treturn (\n\t\t<>\n\t\t\t{Array.from({ length: 2 }, (_, index) => (\n\t\t\t\t<VerticalList\n\t\t\t\t\tkey={index}\n\t\t\t\t\tcontextId={index}\n\t\t\t\t\tresponders={responders[index]}\n\t\t\t\t\titemData={itemData[index]}\n\t\t\t\t/>\n\t\t\t))}\n\t\t</>\n\t);\n}\n\nfunction getResponders() {\n\treturn {\n\t\tonDragStart: jest.fn(),\n\t\tonDragUpdate: jest.fn(),\n\t\tonDragEnd: jest.fn(),\n\t};\n}\n\nbeforeAll(() => {\n\tjest.useFakeTimers();\n\n\t/**\n\t * Does not exist in jest so needs to be mocked\n\t */\n\tHTMLElement.prototype.scrollTo = jest.fn();\n});\n\nafterAll(() => {\n\tjest.useRealTimers();\n});\n\ndescribe('when there are multiple <DragDropContext> instances', () => {\n\tit('should ignore interactions with other context elements', () => {\n\t\tconst responders = [getResponders(), getResponders()];\n\n\t\tconst { getByTestId } = render(<App responders={responders} />);\n\n\t\t// Lifting an element in the second context instance\n\t\tconst handle = getByTestId('1-0');\n\t\tsetElementFromPoint(handle);\n\t\tmouse.lift(handle);\n\n\t\t// flush responders\n\t\tjest.runOnlyPendingTimers();\n\n\t\tconst start: DragStart = {\n\t\t\tmode: 'FLUID',\n\t\t\ttype: 'DEFAULT',\n\t\t\tdraggableId: '0',\n\t\t\tsource: {\n\t\t\t\tdroppableId: 'droppable',\n\t\t\t\tindex: 0,\n\t\t\t},\n\t\t};\n\n\t\texpect(responders[0].onDragStart).not.toHaveBeenCalled();\n\t\texpect(responders[1].onDragStart).toHaveBeenCalledWith(start, expect.any(Object));\n\n\t\t// Leave the droppable we started in\n\t\tfireEvent.dragLeave(getByTestId('1-droppable'));\n\n\t\t// flush responders\n\t\tjest.runOnlyPendingTimers();\n\n\t\t// we are no longer dragging over anything owned by the source context,\n\t\t// so the destination should be null\n\t\tconst update: DragUpdate = {\n\t\t\t...start,\n\t\t\tcombine: null,\n\t\t\tdestination: null,\n\t\t};\n\n\t\texpect(responders[0].onDragUpdate).not.toHaveBeenCalled();\n\t\texpect(responders[1].onDragUpdate).toHaveBeenCalledWith(update, expect.any(Object));\n\n\t\tresponders[1].onDragUpdate.mockClear();\n\n\t\t// enter the droppable owned by the other context\n\t\tfireEvent.dragEnter(getByTestId('0-droppable'));\n\t\t// enter a draggable owned by the other context\n\t\tfireEvent.dragEnter(getByTestId('0-1'));\n\n\t\t// flush responders\n\t\tjest.runOnlyPendingTimers();\n\n\t\t// entering the other context should not trigger updates\n\t\texpect(responders[0].onDragUpdate).not.toHaveBeenCalled();\n\t\texpect(responders[1].onDragUpdate).not.toHaveBeenCalled();\n\t});\n\n\tdescribe('keyboard controls', () => {\n\t\tit('should only consider current context to determine main-axis dragging', () => {\n\t\t\tconst responders = [getResponders(), getResponders()];\n\n\t\t\t/**\n\t\t\t * The second list has less items, but otherwise all of the\n\t\t\t * draggable and droppable ids will be the same.\n\t\t\t */\n\t\t\tconst itemData = [\n\t\t\t\t[{ id: '0' }, { id: '1' }, { id: '2' }],\n\t\t\t\t[{ id: '0' }, { id: '1' }],\n\t\t\t];\n\n\t\t\tconst { getByTestId } = render(<App responders={responders} itemData={itemData} />);\n\n\t\t\tconst handle = getByTestId('1-0');\n\t\t\tkeyboard.lift(handle);\n\n\t\t\t// flush responders\n\t\t\tjest.runOnlyPendingTimers();\n\n\t\t\tconst start: DragStart = {\n\t\t\t\tmode: 'SNAP',\n\t\t\t\ttype: 'DEFAULT',\n\t\t\t\tdraggableId: '0',\n\t\t\t\tsource: {\n\t\t\t\t\tdroppableId: 'droppable',\n\t\t\t\t\tindex: 0,\n\t\t\t\t},\n\t\t\t};\n\n\t\t\texpect(responders[0].onDragStart).not.toHaveBeenCalled();\n\t\t\texpect(responders[1].onDragStart).toHaveBeenCalledWith(start, expect.any(Object));\n\n\t\t\t// can move down once\n\t\t\tfireEvent.keyDown(handle, { key: 'ArrowDown' });\n\t\t\tjest.runOnlyPendingTimers();\n\t\t\texpect(responders[0].onDragUpdate).not.toHaveBeenCalled();\n\t\t\texpect(responders[1].onDragUpdate).toHaveBeenCalled();\n\n\t\t\tresponders[1].onDragUpdate.mockClear();\n\n\t\t\t// cannot move down again\n\t\t\tfireEvent.keyDown(handle, { key: 'ArrowDown' });\n\n\t\t\t// flush responders\n\t\t\tjest.runOnlyPendingTimers();\n\n\t\t\texpect(responders[0].onDragUpdate).not.toHaveBeenCalled();\n\t\t\texpect(responders[1].onDragUpdate).not.toHaveBeenCalled();\n\n\t\t\tkeyboard.cancel(handle);\n\t\t});\n\n\t\tit('should only consider current context to determine cross-axis dragging', () => {\n\t\t\tconst responders = [getResponders(), getResponders()];\n\n\t\t\tconst { getByTestId } = render(<App responders={responders} />);\n\n\t\t\tconst handle = getByTestId('0-0');\n\t\t\tkeyboard.lift(handle);\n\n\t\t\t// flush responders\n\t\t\tjest.runOnlyPendingTimers();\n\n\t\t\tconst start: DragStart = {\n\t\t\t\tmode: 'SNAP',\n\t\t\t\ttype: 'DEFAULT',\n\t\t\t\tdraggableId: '0',\n\t\t\t\tsource: {\n\t\t\t\t\tdroppableId: 'droppable',\n\t\t\t\t\tindex: 0,\n\t\t\t\t},\n\t\t\t};\n\n\t\t\texpect(responders[0].onDragStart).toHaveBeenCalledWith(start, expect.any(Object));\n\t\t\texpect(responders[1].onDragStart).not.toHaveBeenCalled();\n\n\t\t\t// cannot move cross-axis at all\n\t\t\tfireEvent.keyDown(handle, { key: 'ArrowLeft' });\n\t\t\tjest.runOnlyPendingTimers();\n\t\t\texpect(responders[0].onDragUpdate).not.toHaveBeenCalled();\n\t\t\texpect(responders[1].onDragUpdate).not.toHaveBeenCalled();\n\n\t\t\tfireEvent.keyDown(handle, { key: 'ArrowRight' });\n\t\t\tjest.runOnlyPendingTimers();\n\t\t\texpect(responders[0].onDragUpdate).not.toHaveBeenCalled();\n\t\t\texpect(responders[1].onDragUpdate).not.toHaveBeenCalled();\n\n\t\t\tkeyboard.cancel(handle);\n\t\t});\n\t});\n\n\tit('their lifecycle events should be separate', () => {\n\t\tconst LifecycleMonitor = ({ spy }: { spy: jest.Mock }) => {\n\t\t\tconst monitorForLifecycle = useMonitorForLifecycle();\n\n\t\t\tuseEffect(() => {\n\t\t\t\treturn monitorForLifecycle({\n\t\t\t\t\tonPendingDragStart(args) {\n\t\t\t\t\t\tspy(args);\n\t\t\t\t\t},\n\t\t\t\t});\n\t\t\t}, [monitorForLifecycle, spy]);\n\n\t\t\treturn null;\n\t\t};\n\n\t\tconst spyA = jest.fn();\n\t\tconst spyB = jest.fn();\n\n\t\tconst { getByText } = render(\n\t\t\t<>\n\t\t\t\t<DragDropContext onDragEnd={noop}>\n\t\t\t\t\t<Droppable droppableId=\"A\">\n\t\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t\t\t\t<Draggable draggableId=\"A0\" index={0}>\n\t\t\t\t\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\tA0\n\t\t\t\t\t\t\t\t\t\t\t<LifecycleMonitor spy={spyA} />\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Droppable>\n\t\t\t\t</DragDropContext>\n\t\t\t\t<DragDropContext onDragEnd={noop}>\n\t\t\t\t\t<Droppable droppableId=\"B\">\n\t\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t\t\t\t<Draggable draggableId=\"B0\" index={0}>\n\t\t\t\t\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\tB0\n\t\t\t\t\t\t\t\t\t\t\t<LifecycleMonitor spy={spyB} />\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</Droppable>\n\t\t\t\t</DragDropContext>\n\t\t\t</>,\n\t\t);\n\n\t\tconst handle = getByText('A0');\n\t\tkeyboard.lift(handle);\n\n\t\texpect(spyA).toHaveBeenCalled();\n\t\texpect(spyB).not.toHaveBeenCalled();\n\t});\n\n\tit('should capture and report a11y violations', async () => {\n\t\tconst responders = [getResponders(), getResponders()];\n\t\tconst { container } = render(<App responders={responders} />);\n\n\t\tawait expect(container).toBeAccessible();\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/_utils/cause-runtime-error.tsx",
    "content": "export function getRuntimeError(): Event {\n\treturn new window.ErrorEvent('error', {\n\t\terror: new Error('non-rbd'),\n\t\tcancelable: true,\n\t});\n}\n\nexport default function causeRuntimeError(): void {\n\twindow.dispatchEvent(getRuntimeError());\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/_utils/console.tsx",
    "content": "function noop() {}\n\ntype ConsoleFunction = 'warn' | 'error';\n\nfunction withConsole(type: ConsoleFunction, fn: () => void, message?: string) {\n\tconst mock = jest.spyOn(console, type).mockImplementation(noop);\n\n\tfn();\n\n\texpect(mock).toHaveBeenCalled();\n\n\tif (message) {\n\t\texpect(mock).toHaveBeenCalledWith(expect.stringContaining(message));\n\t}\n\n\tmock.mockReset();\n}\n\nexport const withError = withConsole.bind(null, 'error');\nexport const withWarn = withConsole.bind(null, 'warn');\n\nfunction withoutConsole(type: ConsoleFunction, fn: () => void) {\n\tconst mock = jest.spyOn(console, type).mockImplementation(noop);\n\n\tfn();\n\n\texpect(mock).not.toHaveBeenCalled();\n\tmock.mockReset();\n}\n\nexport const withoutError = withoutConsole.bind(null, 'error');\nexport const withoutWarn = withoutConsole.bind(null, 'warn');\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/_utils/app.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with some adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/integration/util/app.jsx>\n\nimport React, { type ReactNode, useMemo, useState } from 'react';\n\nimport type {\n\tDirection,\n\tDraggableProvided,\n\tDraggableRubric,\n\tDraggableStateSnapshot,\n\tDroppableProvided,\n\tDropResult,\n\tSensor,\n} from 'react-beautiful-dnd';\n\nimport { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';\n\nimport { DragDropContext, Draggable, Droppable } from '../../../../../../src';\n\nfunction noop() {}\n\nexport type Item = {\n\tid: string;\n\t// defaults to true\n\tisEnabled?: boolean;\n\t// defaults to false\n\tcanDragInteractiveElements?: boolean;\n\t// defaults to false\n\tshouldRespectForcePress?: boolean;\n};\n\nexport type RenderItem = (\n\titem: Item,\n) => (\n\tprovided: DraggableProvided,\n\tsnapshot: DraggableStateSnapshot,\n\trubric: DraggableRubric,\n) => React.ReactElement;\n\nexport const defaultItemRender: RenderItem =\n\t(item: Item) => (provided: DraggableProvided, snapshot: DraggableStateSnapshot) => (\n\t\t<div\n\t\t\t{...provided.draggableProps}\n\t\t\t{...provided.dragHandleProps}\n\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\tdata-is-drop-animating={snapshot.isDropAnimating}\n\t\t\tdata-is-combining={Boolean(snapshot.combineWith)}\n\t\t\tdata-is-combine-target={Boolean(snapshot.combineTargetFor)}\n\t\t\tdata-is-over={snapshot.draggingOver}\n\t\t\tdata-is-clone={snapshot.isClone}\n\t\t\tdata-testid={item.id}\n\t\t\tref={provided.innerRef}\n\t\t>\n\t\t\titem: {item.id}\n\t\t</div>\n\t);\ntype Props = {\n\tonBeforeCapture?: (...args: Array<any>) => any;\n\tonBeforeDragStart?: (...args: Array<any>) => any;\n\tonDragStart?: (...args: Array<any>) => any;\n\tonDragUpdate?: (...args: Array<any>) => any;\n\tonDragEnd?: (...args: Array<any>) => any;\n\titems?: Item[];\n\tanotherChild?: ReactNode;\n\trenderItem?: RenderItem;\n\t// droppable\n\tdirection?: Direction;\n\tisCombineEnabled?: boolean;\n\tgetContainerForClone?: () => HTMLElement;\n\tuseClone?: boolean;\n\tsensors?: Sensor[];\n\tenableDefaultSensors?: boolean;\n};\n\nfunction getItems() {\n\treturn Array.from(\n\t\t{\n\t\t\tlength: 3,\n\t\t},\n\t\t(v, k): Item => ({\n\t\t\tid: `${k}`,\n\t\t}),\n\t);\n}\n\nfunction withDefaultBool(value: boolean | null | undefined, defaultValue: boolean) {\n\tif (typeof value === 'boolean') {\n\t\treturn value;\n\t}\n\n\treturn defaultValue;\n}\n\nexport default function App(props: Props): React.JSX.Element {\n\tconst [items, setItems] = useState(() => props.items || getItems());\n\tconst onBeforeCapture = props.onBeforeCapture || noop;\n\tconst onBeforeDragStart = props.onBeforeDragStart || noop;\n\tconst onDragStart = props.onDragStart || noop;\n\tconst onDragUpdate = props.onDragUpdate || noop;\n\tconst onDragEndProp = props.onDragEnd;\n\n\tconst onDragEnd = (result: DropResult) => {\n\t\tif (result.destination) {\n\t\t\tconst reordered: Item[] = reorder({\n\t\t\t\tlist: items,\n\t\t\t\tstartIndex: result.source.index,\n\t\t\t\tfinishIndex: result.destination.index,\n\t\t\t});\n\n\t\t\tsetItems(reordered);\n\t\t}\n\n\t\tif (onDragEndProp) {\n\t\t\tonDragEndProp(result);\n\t\t}\n\t};\n\n\tconst sensors: Sensor[] = props.sensors || [];\n\tconst render: RenderItem = props.renderItem || defaultItemRender;\n\tconst direction: Direction = props.direction || 'vertical';\n\tconst isCombineEnabled: boolean = withDefaultBool(props.isCombineEnabled, false);\n\n\tconst shouldUseClone = props.useClone ?? false;\n\tconst renderClone = useMemo(() => {\n\t\tif (!shouldUseClone) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\treturn function result(\n\t\t\tprovided: DraggableProvided,\n\t\t\tsnapshot: DraggableStateSnapshot,\n\t\t\trubric: DraggableRubric,\n\t\t) {\n\t\t\tconst item: Item = items[rubric.source.index];\n\t\t\treturn render(item)(provided, snapshot, rubric);\n\t\t};\n\t}, [items, render, shouldUseClone]);\n\n\treturn (\n\t\t<main>\n\t\t\t<DragDropContext\n\t\t\t\tonBeforeCapture={onBeforeCapture}\n\t\t\t\tonBeforeDragStart={onBeforeDragStart}\n\t\t\t\tonDragStart={onDragStart}\n\t\t\t\tonDragUpdate={onDragUpdate}\n\t\t\t\tonDragEnd={onDragEnd}\n\t\t\t\tsensors={sensors}\n\t\t\t\tenableDefaultSensors={props.enableDefaultSensors}\n\t\t\t>\n\t\t\t\t<Droppable\n\t\t\t\t\tdroppableId=\"droppable\"\n\t\t\t\t\tdirection={direction}\n\t\t\t\t\tisCombineEnabled={isCombineEnabled}\n\t\t\t\t\trenderClone={renderClone}\n\t\t\t\t\tgetContainerForClone={props.getContainerForClone}\n\t\t\t\t>\n\t\t\t\t\t{(droppableProvided: DroppableProvided) => (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t{...droppableProvided.droppableProps}\n\t\t\t\t\t\t\tref={droppableProvided.innerRef}\n\t\t\t\t\t\t\tdata-testid=\"droppable\"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{items.map((item: Item, index: number) => (\n\t\t\t\t\t\t\t\t<Draggable\n\t\t\t\t\t\t\t\t\tkey={item.id}\n\t\t\t\t\t\t\t\t\tdraggableId={item.id}\n\t\t\t\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\t\t\t\tisDragDisabled={item.isEnabled === false}\n\t\t\t\t\t\t\t\t\tdisableInteractiveElementBlocking={withDefaultBool(\n\t\t\t\t\t\t\t\t\t\titem.canDragInteractiveElements,\n\t\t\t\t\t\t\t\t\t\tfalse,\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\tshouldRespectForcePress={withDefaultBool(item.shouldRespectForcePress, false)}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{render(item)}\n\t\t\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t{droppableProvided.placeholder}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</Droppable>\n\t\t\t\t{props.anotherChild || null}\n\t\t\t</DragDropContext>\n\t\t</main>\n\t);\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/_utils/controls.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with some adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/integration/util/controls.js>\n\nimport { act, fireEvent } from '@testing-library/react';\nimport { replaceRaf } from 'raf-stub';\n\nimport { setElementFromPoint } from '../../../../_util';\n\n// replaceRaf();\n// const requestAnimationFrame = window.requestAnimationFrame as any;\n\nconst sloppyClickThreshold = 5;\n\nexport type Control = {\n\tname: string;\n\tpreLift: (handle: HTMLElement) => void;\n\tlift: (handle: HTMLElement) => void;\n\tmove: (handle: HTMLElement) => void;\n\tdrop: (handle: HTMLElement) => void;\n\tcancel: (handle: HTMLElement) => void;\n};\n\nexport function simpleLift(control: Control, handle: HTMLElement): void {\n\tcontrol.preLift(handle);\n\tcontrol.lift(handle);\n}\n\nexport function getTransitionEnd(propertyName: string = 'transform'): Event {\n\tconst event: Event = new Event('transitionend', {\n\t\tbubbles: true,\n\t\tcancelable: true,\n\t});\n\t// cheating and adding property to event as TransitionEvent constructor does not exist\n\t// @ts-expect-error - being amazing\n\tevent.propertyName = propertyName;\n\treturn event;\n}\n\nexport function mouseLiftExtended(\n\thandle: HTMLElement,\n\t{ elementUnderPointer }: { elementUnderPointer: HTMLElement },\n): void {\n\treplaceRaf();\n\tconst requestAnimationFrame = window.requestAnimationFrame as any;\n\n\t/**\n\t * Added for compatibility with how pdnd checks drag handles.\n\t */\n\tconst clearElementFromPoint = setElementFromPoint(elementUnderPointer);\n\n\t// will fire `onGenerateDragPreview`\n\tfireEvent.dragStart(handle, {\n\t\tclientX: 0,\n\t\tclientY: sloppyClickThreshold,\n\t});\n\n\tact(() => {\n\t\t// after an animation frame we fire `onDragStart`\n\t\trequestAnimationFrame.step();\n\t});\n\n\tclearElementFromPoint();\n}\n\nexport const mouse: Control = {\n\tname: 'mouse',\n\tpreLift: (handle: HTMLElement) => {\n\t\tfireEvent.mouseDown(handle);\n\t},\n\tlift: (handle: HTMLElement) => {\n\t\tmouseLiftExtended(handle, { elementUnderPointer: handle });\n\t},\n\tmove: (handle: HTMLElement) => {\n\t\treplaceRaf();\n\n\t\tfireEvent.pointerMove(handle, {\n\t\t\tclientX: 0,\n\t\t\tclientY: sloppyClickThreshold + 1,\n\t\t});\n\n\t\t// movements are throttled by raf\n\t\tact(() => {\n\t\t\t// @ts-expect-error\n\t\t\trequestAnimationFrame.step();\n\t\t});\n\t},\n\tdrop: (handle: HTMLElement) => {\n\t\tfireEvent.drop(handle);\n\t},\n\tcancel: (handle: HTMLElement) => {\n\t\tfireEvent.dragEnd(handle);\n\t},\n};\n\nexport const keyboard: Control = {\n\tname: 'keyboard',\n\tpreLift: () => {},\n\tlift: (handle: HTMLElement) => {\n\t\treplaceRaf();\n\n\t\thandle.focus();\n\n\t\tfireEvent.keyDown(handle, { key: ' ' });\n\n\t\tact(() => {\n\t\t\t// @ts-expect-error\n\t\t\trequestAnimationFrame.step();\n\t\t});\n\t},\n\tmove: (handle: HTMLElement) => {\n\t\tfireEvent.keyDown(window, { key: 'ArrowDown' });\n\t},\n\tdrop: (handle: HTMLElement) => {\n\t\tfireEvent.keyDown(window, { key: ' ' });\n\t},\n\tcancel: (handle: HTMLElement) => {\n\t\tfireEvent.keyDown(window, { key: 'Escape' });\n\t},\n};\n\nexport const controls: Control[] = [mouse, keyboard];\n\nexport const forEachSensor = (tests: (control: Control) => void): void => {\n\tcontrols.forEach((control: Control) => {\n\t\tdescribe(`with: ${control.name}`, () => {\n\t\t\tbeforeEach(() => {\n\t\t\t\tjest.useFakeTimers({ legacyFakeTimers: true });\n\t\t\t});\n\t\t\tafterEach(() => {\n\t\t\t\tjest.clearAllTimers();\n\t\t\t\tjest.useRealTimers();\n\t\t\t});\n\t\t\ttests(control);\n\t\t});\n\t});\n};\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/_utils/helpers.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with some adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/integration/util/helpers.js>\n\nimport type { Position } from 'css-box-model';\nimport type {\n\tDraggableId,\n\tDraggableProvided,\n\tDraggableRubric,\n\tDraggableStateSnapshot,\n\tDropReason,\n} from 'react-beautiful-dnd';\nimport invariant from 'tiny-invariant';\n\nimport { defaultItemRender, type Item, type RenderItem } from './app';\n\nexport function getOffset(el: HTMLElement): Position {\n\tconst style: CSSStyleDeclaration = el.style;\n\n\tconst transform: string = style.transform;\n\tif (!transform) {\n\t\treturn { x: 0, y: 0 };\n\t}\n\n\tconst regex: RegExp = /translate\\((\\d+)px, (\\d+)px\\)/;\n\n\tconst result = transform.match(regex);\n\tinvariant(result, `Unable to formate translate: ${transform}`);\n\n\treturn {\n\t\tx: Number(result[1]),\n\t\ty: Number(result[2]),\n\t};\n}\n\nexport function getDropReason(onDragEnd: jest.Mock): DropReason {\n\tconst calls = onDragEnd.mock.calls;\n\n\tinvariant(calls.length, 'There has been no calls to onDragEnd');\n\n\treturn calls[0][0].reason;\n}\nexport function isDragging(el: HTMLElement): boolean {\n\treturn el.getAttribute('data-is-dragging') === 'true';\n}\n\nexport function isDropAnimating(el: HTMLElement): boolean {\n\treturn el.getAttribute('data-is-drop-animating') === 'true';\n}\n\nexport function isCombining(el: HTMLElement): boolean {\n\treturn el.getAttribute('data-is-combining') === 'true';\n}\n\nexport function isCombineTarget(el: HTMLElement): boolean {\n\treturn el.getAttribute('data-is-combine-target') === 'true';\n}\n\nexport function isClone(el: HTMLElement): boolean {\n\treturn el.getAttribute('data-is-clone') === 'true';\n}\n\nexport function isOver(el: HTMLElement): string | null {\n\tconst value: string | null = el.getAttribute('data-is-over');\n\treturn value || null;\n}\n\nexport const renderItemAndSpy =\n\t(mock: jest.Mock): RenderItem =>\n\t(item: Item) => {\n\t\tconst render = defaultItemRender(item);\n\t\treturn (\n\t\t\tprovided: DraggableProvided,\n\t\t\tsnapshot: DraggableStateSnapshot,\n\t\t\trubric: DraggableRubric,\n\t\t) => {\n\t\t\tmock(provided, snapshot, rubric);\n\t\t\treturn render(provided, snapshot, rubric);\n\t\t};\n\t};\n\nexport type Call = [DraggableProvided, DraggableStateSnapshot, DraggableRubric];\n\nexport const getCallsFor = (id: DraggableId, mock: jest.Mock): Call[] => {\n\treturn mock.mock.calls.filter((call) => {\n\t\tconst provided: DraggableProvided = call[0];\n\t\treturn provided.draggableProps['data-rbd-draggable-id'] === id;\n\t});\n};\n\nexport const getProvidedFor = (id: DraggableId, mock: jest.Mock): DraggableProvided[] => {\n\treturn getCallsFor(id, mock).map((call) => {\n\t\treturn call[0];\n\t});\n};\n\nexport const getSnapshotsFor = (id: DraggableId, mock: jest.Mock): DraggableStateSnapshot[] => {\n\treturn getCallsFor(id, mock).map((call) => {\n\t\treturn call[1];\n\t});\n};\n\nexport const getRubricsFor = (id: DraggableId, mock: jest.Mock): DraggableRubric[] => {\n\treturn getCallsFor(id, mock).map((call) => {\n\t\treturn call[2];\n\t});\n};\n\nexport function getLast<T>(values: T[]): T | null {\n\treturn values[values.length - 1] || null;\n}\n\nexport const atRest: DraggableStateSnapshot = {\n\tisClone: false,\n\tisDragging: false,\n\tisDropAnimating: false,\n\tdropAnimation: null,\n\tdraggingOver: null,\n\tcombineWith: null,\n\tcombineTargetFor: null,\n\tmode: null,\n};\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/body-removal-before-unmount.test.tsx",
    "content": "import React from 'react';\n\nimport { render } from '@testing-library/react';\n\nimport { setup } from '../../../_utils/setup';\n\nimport App from './_utils/app';\nimport { type Control, forEachSensor, simpleLift } from './_utils/controls';\nimport { isDragging } from './_utils/helpers';\n\nbeforeAll(() => {\n\tsetup();\n});\n\nit('should not have any errors when body is changed just before unmount', () => {\n\tjest.useFakeTimers();\n\tconst { unmount } = render(<App />);\n\n\texpect(() => {\n\t\tdocument.body.innerHTML = '';\n\t\tunmount();\n\t\tjest.runOnlyPendingTimers();\n\t}).not.toThrow();\n\n\tjest.useRealTimers();\n});\n\nforEachSensor((control: Control) => {\n\tit('should not have any errors when body is changed just before unmount: mid drag', () => {\n\t\tconst { unmount, getByText } = render(<App />);\n\t\tconst handle: HTMLElement = getByText('item: 0');\n\n\t\t// mid drag\n\t\tsimpleLift(control, handle);\n\t\texpect(isDragging(handle)).toEqual(true);\n\n\t\texpect(() => {\n\t\t\tdocument.body.innerHTML = '';\n\t\t\tunmount();\n\t\t\tjest.runOnlyPendingTimers();\n\t\t}).not.toThrow();\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/disable-on-start.test.tsx",
    "content": "import React, { useCallback, useState } from 'react';\n\nimport { act, render } from '@testing-library/react';\nimport type {\n\tDraggableProvided,\n\tDragStart,\n\tDragUpdate,\n\tDroppableProvided,\n\tOnDragEndResponder,\n\tOnDragStartResponder,\n\tOnDragUpdateResponder,\n} from 'react-beautiful-dnd';\n\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { DragDropContext, Draggable, Droppable } from '../../../../../src';\n\nimport { keyboard, mouse } from './_utils/controls';\n\nHTMLElement.prototype.scrollIntoView = jest.fn();\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\ntype AppProps = {\n\tonDragStart: OnDragStartResponder;\n\tonDragUpdate: OnDragUpdateResponder;\n\tonDragEnd: OnDragEndResponder;\n};\n\nfunction App(props: AppProps) {\n\tconst [isDropDisabled, setIsDropDisabled] = useState(false);\n\n\tconst onDragStart: OnDragStartResponder = useCallback(\n\t\t(...args) => {\n\t\t\tprops.onDragStart(...args);\n\t\t\tsetIsDropDisabled(true);\n\t\t},\n\t\t[props],\n\t);\n\n\tconst onDragUpdate: OnDragUpdateResponder = useCallback(\n\t\t(...args) => {\n\t\t\tprops.onDragUpdate(...args);\n\t\t},\n\t\t[props],\n\t);\n\n\tconst onDragEnd: OnDragEndResponder = useCallback(\n\t\t(...args) => {\n\t\t\tprops.onDragEnd(...args);\n\t\t\tsetIsDropDisabled(false);\n\t\t},\n\t\t[props],\n\t);\n\n\treturn (\n\t\t<DragDropContext onDragStart={onDragStart} onDragUpdate={onDragUpdate} onDragEnd={onDragEnd}>\n\t\t\t<Droppable droppableId=\"droppable\" direction=\"horizontal\" isDropDisabled={isDropDisabled}>\n\t\t\t\t{(droppableProvided: DroppableProvided) => (\n\t\t\t\t\t<div ref={droppableProvided.innerRef} {...droppableProvided.droppableProps}>\n\t\t\t\t\t\t<Draggable draggableId=\"draggable\" index={0}>\n\t\t\t\t\t\t\t{(draggableProvided: DraggableProvided) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tref={draggableProvided.innerRef}\n\t\t\t\t\t\t\t\t\tdata-testid=\"drag-handle\"\n\t\t\t\t\t\t\t\t\t{...draggableProvided.draggableProps}\n\t\t\t\t\t\t\t\t\t{...draggableProvided.dragHandleProps}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tDrag me!\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t{droppableProvided.placeholder}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n\njest.useFakeTimers();\n\nconst cases = [\n\t{ id: 'mouse', control: mouse, mode: 'FLUID' },\n\t{ id: 'keyboard', control: keyboard, mode: 'SNAP' },\n] as const;\n\ncases.forEach(({ id, control, mode }) => {\n\tit(`should allow the disabling of a droppable in onDragStart (${id})`, () => {\n\t\tconst responders = {\n\t\t\tonDragStart: jest.fn(),\n\t\t\tonDragUpdate: jest.fn(),\n\t\t\tonDragEnd: jest.fn(),\n\t\t};\n\t\tconst { getByTestId, unmount } = render(<App {...responders} />);\n\t\tconst handle: HTMLElement = getByTestId('drag-handle');\n\n\t\tcontrol.lift(handle);\n\t\t// flush responder\n\t\tact(() => {\n\t\t\tjest.runOnlyPendingTimers();\n\t\t});\n\n\t\tconst start: DragStart = {\n\t\t\tdraggableId: 'draggable',\n\t\t\tsource: {\n\t\t\t\tdroppableId: 'droppable',\n\t\t\t\tindex: 0,\n\t\t\t},\n\t\t\ttype: 'DEFAULT',\n\t\t\tmode,\n\t\t};\n\t\texpect(responders.onDragStart).toHaveBeenCalledWith(start, expect.any(Object));\n\n\t\t// onDragUpdate will occur after setTimeout\n\t\texpect(responders.onDragUpdate).not.toHaveBeenCalled();\n\n\t\tact(() => {\n\t\t\tjest.runOnlyPendingTimers();\n\t\t});\n\n\t\t// an update should be fired as the home location has changed\n\t\tconst update: DragUpdate = {\n\t\t\t...start,\n\t\t\t// no destination as it is now disabled\n\t\t\tdestination: null,\n\t\t\tcombine: null,\n\t\t};\n\t\texpect(responders.onDragUpdate).toHaveBeenCalledWith(update, expect.any(Object));\n\n\t\tcontrol.cancel(handle);\n\t\tunmount();\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/drag-drop-context/error-handling/error-in-react-tree.test.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with some adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/integration/drag-drop-context/error-handling/error-in-react-tree.spec.js>\n\nimport React from 'react';\n\nimport { render } from '@testing-library/react';\n\nimport { rbdInvariant } from '../../../../../../../src/drag-drop-context/rbd-invariant';\nimport { setElementFromPoint } from '../../../../../_util';\nimport { withWarn } from '../../../../_utils/console';\nimport App, { defaultItemRender, type RenderItem } from '../../_utils/app';\nimport { forEachSensor, mouse, simpleLift } from '../../_utils/controls';\nimport { isDragging } from '../../_utils/helpers';\n\nHTMLElement.prototype.scrollIntoView = jest.fn();\n\nconst error = jest.spyOn(console, 'error').mockImplementation(() => {});\n\nafterEach(() => {\n\tmouse.cancel(document.body);\n\terror.mockClear();\n});\n\n/**\n * This file originally used `keyboard` for all tests.\n *\n * Now there is coverage for both types of input.\n */\n\n/**\n * __Note about triggering errors__\n *\n * We cannot make the item ALWAYS error because then the error will propagate to the next the error boundary,\n * because our boundary will have failed to handle it.\n *\n * With React 16 / 17 we could just error once, however in React 18 this is more difficult.\n *\n * React 18 can recover gracefully if a component errors, and retry a render.\n * If it succeeds on a later try then it will not trigger the error boundary.\n * [https://github.com/facebook/react/issues/27510]\n *\n * This means we cannot just error once for React 18. The alternative is to error based on dragging state.\n */\n\nforEachSensor((control) => {\n\tit('should recover from rbd errors', () => {\n\t\tconst { rerender, getByTestId } = render(<App />);\n\n\t\tsetElementFromPoint(getByTestId('0'));\n\t\tsimpleLift(control, getByTestId('0'));\n\t\texpect(isDragging(getByTestId('0'))).toBe(true);\n\n\t\t/**\n\t\t * Will throw an `rbdInvariant` while rendering the dragged item.\n\t\t *\n\t\t * Only throws while dragging.\n\t\t */\n\t\tconst renderItemWithRbdInvariantWhileDragging: RenderItem =\n\t\t\t(item) => (provided, snapshot, rubric) => {\n\t\t\t\tif (snapshot.isDragging) {\n\t\t\t\t\trbdInvariant(false, 'throwing');\n\t\t\t\t}\n\n\t\t\t\treturn defaultItemRender(item)(provided, snapshot, rubric);\n\t\t\t};\n\n\t\texpect(() => {\n\t\t\twithWarn(() => {\n\t\t\t\trerender(<App renderItem={renderItemWithRbdInvariantWhileDragging} />);\n\t\t\t});\n\t\t}).not.toThrow();\n\n\t\texpect(error).toHaveBeenCalled();\n\n\t\texpect(isDragging(getByTestId('0'))).toBe(false);\n\t});\n\n\tit('should not recover from non-rbd errors', () => {\n\t\tconst { rerender, getByTestId } = render(<App />);\n\n\t\tsetElementFromPoint(getByTestId('0'));\n\t\tsimpleLift(control, getByTestId('0'));\n\t\texpect(isDragging(getByTestId('0'))).toBe(true);\n\n\t\t/**\n\t\t * Will throw an Error while rendering the dragged item.\n\t\t *\n\t\t * Only throws while dragging.\n\t\t */\n\t\tconst renderItemWithErrorWhileDragging: RenderItem = (item) => (provided, snapshot, rubric) => {\n\t\t\tif (snapshot.isDragging) {\n\t\t\t\tthrow new Error('Boom');\n\t\t\t}\n\n\t\t\treturn defaultItemRender(item)(provided, snapshot, rubric);\n\t\t};\n\n\t\texpect(() => {\n\t\t\trerender(<App renderItem={renderItemWithErrorWhileDragging} />);\n\t\t}).toThrow();\n\n\t\texpect(error).toHaveBeenCalled();\n\t});\n\n\tit('should not recover from runtime errors', () => {\n\t\tconst { rerender, getByTestId } = render(<App />);\n\n\t\tsetElementFromPoint(getByTestId('0'));\n\t\tsimpleLift(control, getByTestId('0'));\n\t\texpect(isDragging(getByTestId('0'))).toBe(true);\n\n\t\t/**\n\t\t * Will cause a runtime error while rendering the dragged item.\n\t\t *\n\t\t * Only throws while dragging.\n\t\t */\n\t\tconst renderItemCausingRuntimeErrorWhileDragging: RenderItem =\n\t\t\t(item) => (provided, snapshot, rubric) => {\n\t\t\t\tif (snapshot.isDragging) {\n\t\t\t\t\t// @ts-expect-error - intentionally calling nonexistent function\n\t\t\t\t\twindow.foo();\n\t\t\t\t}\n\n\t\t\t\treturn defaultItemRender(item)(provided, snapshot, rubric);\n\t\t\t};\n\n\t\texpect(() => {\n\t\t\trerender(<App renderItem={renderItemCausingRuntimeErrorWhileDragging} />);\n\t\t}).toThrow();\n\n\t\texpect(error).toHaveBeenCalled();\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/drag-drop-context/error-handling/error-on-window.test.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with some adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/integration/drag-drop-context/error-handling/error-on-window.spec.js>\n\nimport React from 'react';\n\nimport { act, render } from '@testing-library/react';\n\nimport { RbdInvariant } from '../../../../../../../src/drag-drop-context/rbd-invariant';\nimport { setElementFromPoint } from '../../../../../_util';\nimport { withError, withoutError, withWarn } from '../../../../_utils/console';\nimport App from '../../_utils/app';\nimport { keyboard, mouse, simpleLift } from '../../_utils/controls';\nimport { isDragging } from '../../_utils/helpers';\n\n/**\n * This mock is required because jest does not implement `scrollIntoView`.\n */\nHTMLElement.prototype.scrollIntoView = jest.fn();\n\nfunction getRuntimeError(): Event {\n\treturn new window.ErrorEvent('error', {\n\t\terror: new Error('non-rbd'),\n\t\tcancelable: true,\n\t});\n}\n\nfunction getRbdErrorEvent(): Event {\n\treturn new window.ErrorEvent('error', {\n\t\terror: new RbdInvariant('my invariant'),\n\t\tcancelable: true,\n\t});\n}\n\nconst cases = [\n\t{ id: 'mouse', control: mouse },\n\t{ id: 'keyboard', control: keyboard },\n];\n\ncases.forEach(({ id, control }) => {\n\tit(`should abort any active drag (rbd error) (${id})`, () => {\n\t\tconst { getByTestId } = render(<App />);\n\t\tcontrol.lift(getByTestId('0'));\n\t\texpect(isDragging(getByTestId('0'))).toBe(true);\n\t\tconst event: Event = getRbdErrorEvent();\n\n\t\twithWarn(() => {\n\t\t\twithError(() => {\n\t\t\t\tact(() => {\n\t\t\t\t\twindow.dispatchEvent(event);\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\t// drag aborted\n\t\texpect(isDragging(getByTestId('0'))).toBe(false);\n\t\t// error event prevented\n\t\texpect(event.defaultPrevented).toBe(true);\n\t});\n\n\tit(`should abort any active drag (non-rbd error) (${id})`, async () => {\n\t\tconst { getByTestId } = render(<App />);\n\t\tsetElementFromPoint(getByTestId('0'));\n\t\tsimpleLift(control, getByTestId('0'));\n\t\texpect(isDragging(getByTestId('0'))).toBe(true);\n\t\tconst event: Event = getRuntimeError();\n\n\t\t// not logging the raw error\n\t\twithoutError(() => {\n\t\t\t// logging that the drag was aborted\n\t\t\twithWarn(() => {\n\t\t\t\tact(() => {\n\t\t\t\t\twindow.dispatchEvent(event);\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\n\t\t// drag aborted\n\t\texpect(isDragging(getByTestId('0'))).toBe(false);\n\t\t// error event not prevented\n\t\texpect(event.defaultPrevented).toBe(false);\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/drag-drop-context/on-before-capture/additions.test.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with some adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/integration/drag-drop-context/on-before-capture/additions.spec.js>\n\nimport React, { useState } from 'react';\n\nimport { render } from '@testing-library/react';\nimport type { DragStart } from 'react-beautiful-dnd';\n\nimport { DragDropContext, Draggable, Droppable } from '../../../../../../../src';\nimport { setElementFromPoint } from '../../../../../_util';\nimport App from '../../_utils/app';\nimport { mouse } from '../../_utils/controls';\nimport { isDragging } from '../../_utils/helpers';\n\nconst noop = () => {};\n\nconst error = jest.spyOn(console, 'error').mockImplementation(noop);\nconst warn = jest.spyOn(console, 'warn').mockImplementation(noop);\n\nafterEach(() => {\n\terror.mockClear();\n\twarn.mockClear();\n});\n\nit('should allow for additions to be made', () => {\n\t// adding a new Droppable and Draggable\n\tfunction AnotherChunk() {\n\t\treturn (\n\t\t\t<Droppable droppableId=\"addition\">\n\t\t\t\t{(droppableProvided) => (\n\t\t\t\t\t<div {...droppableProvided.droppableProps} ref={droppableProvided.innerRef}>\n\t\t\t\t\t\t<Draggable draggableId=\"addition-item\" index={0}>\n\t\t\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tDrag me!\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t{droppableProvided.placeholder};\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Droppable>\n\t\t);\n\t}\n\n\tfunction Root() {\n\t\tconst [showAdditions, setShowAdditions] = useState(false);\n\t\tfunction onBeforeCapture() {\n\t\t\tsetShowAdditions(true);\n\t\t}\n\n\t\treturn (\n\t\t\t<App\n\t\t\t\tonBeforeCapture={onBeforeCapture}\n\t\t\t\tanotherChild={showAdditions ? <AnotherChunk /> : null}\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst { getByTestId } = render(<Root />);\n\tconst handle: HTMLElement = getByTestId('0');\n\n\tsetElementFromPoint(handle);\n\tmouse.lift(handle);\n\n\texpect(isDragging(handle)).toBe(true);\n\n\tmouse.cancel(handle);\n});\n\nfunction getIndex(el: HTMLElement): number {\n\treturn Number(el.getAttribute('data-index'));\n}\n\nit('should adjust captured values for any changes that impact that dragging item', () => {\n\tjest.useFakeTimers();\n\n\t// 1. Changing the `type` of the Droppable\n\t// 2. Adding and item before the dragging item to impact it's index\n\tconst onDragStart = jest.fn();\n\n\tconst spy = jest.fn();\n\n\tfunction Root() {\n\t\tconst [items, setItems] = useState(['initial']);\n\t\tfunction onBeforeCapture() {\n\t\t\tspy();\n\n\t\t\t// adding the first item\n\t\t\tsetItems(['first', 'initial']);\n\t\t}\n\n\t\treturn (\n\t\t\t<DragDropContext onDragEnd={noop} onBeforeCapture={onBeforeCapture} onDragStart={onDragStart}>\n\t\t\t\t<Droppable droppableId=\"droppable\">\n\t\t\t\t\t{(droppableProvided) => (\n\t\t\t\t\t\t<div {...droppableProvided.droppableProps} ref={droppableProvided.innerRef}>\n\t\t\t\t\t\t\t{items.map((item: string, index: number) => (\n\t\t\t\t\t\t\t\t<Draggable draggableId={item} index={index} key={item}>\n\t\t\t\t\t\t\t\t\t{(provided, snapshot) => (\n\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t\t\t\tdata-index={index}\n\t\t\t\t\t\t\t\t\t\t\tdata-testid={item}\n\t\t\t\t\t\t\t\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\tDrag me!\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t{droppableProvided.placeholder};\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</Droppable>\n\t\t\t</DragDropContext>\n\t\t);\n\t}\n\n\tconst { getByTestId, queryByTestId } = render(<Root />);\n\tconst initial: HTMLElement = getByTestId('initial');\n\n\t// initially it had an index of 1\n\texpect(getIndex(initial)).toBe(0);\n\t// first item does not exist yet\n\texpect(queryByTestId('first')).toBe(null);\n\n\tsetElementFromPoint(initial);\n\tmouse.lift(initial);\n\n\t// first item has been added\n\texpect(queryByTestId('first')).toBeTruthy();\n\t// initial is now dragging\n\texpect(isDragging(initial)).toBe(true);\n\t// initial index accounts for addition\n\texpect(getIndex(initial)).toBe(1);\n\n\t// flush onDragStart timer\n\tjest.runOnlyPendingTimers();\n\n\t// onDragStart called with correct new index\n\tconst expected: DragStart = {\n\t\tdraggableId: 'initial',\n\t\tmode: 'FLUID',\n\t\ttype: 'DEFAULT',\n\t\tsource: {\n\t\t\tindex: 1,\n\t\t\tdroppableId: 'droppable',\n\t\t},\n\t};\n\texpect(onDragStart.mock.calls[0][0]).toEqual(expected);\n\n\tjest.useRealTimers();\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/drag-drop-context/on-before-capture/removals.test.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with some adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/integration/drag-drop-context/on-before-capture/removals.spec.js>\n\nimport React, { useState } from 'react';\n\nimport { render } from '@testing-library/react';\nimport type { DragStart } from 'react-beautiful-dnd';\n\nimport { DragDropContext, Draggable, Droppable } from '../../../../../../../src';\nimport { setElementFromPoint } from '../../../../../_util';\nimport { mouse } from '../../_utils/controls';\nimport { isDragging } from '../../_utils/helpers';\n\nconst noop = () => {};\n\nfunction getIndex(el: HTMLElement): number {\n\treturn Number(el.getAttribute('data-index'));\n}\n\nit('should adjust captured values for any changes that impact that dragging item', () => {\n\tjest.useFakeTimers();\n\t// 1. Changing the `type` of the Droppable\n\t// 2. Adding and item before the dragging item to impact it's index\n\tconst onDragStart = jest.fn();\n\n\tfunction Root() {\n\t\tconst [items, setItems] = useState(['first', 'second']);\n\t\tfunction onBeforeCapture() {\n\t\t\t// removing the first item\n\t\t\tsetItems(['second']);\n\t\t}\n\n\t\treturn (\n\t\t\t<DragDropContext onDragEnd={noop} onBeforeCapture={onBeforeCapture} onDragStart={onDragStart}>\n\t\t\t\t<Droppable droppableId=\"droppable\">\n\t\t\t\t\t{(droppableProvided) => (\n\t\t\t\t\t\t<div {...droppableProvided.droppableProps} ref={droppableProvided.innerRef}>\n\t\t\t\t\t\t\t{items.map((item: string, index: number) => (\n\t\t\t\t\t\t\t\t<Draggable draggableId={item} index={index} key={item}>\n\t\t\t\t\t\t\t\t\t{(provided, snapshot) => (\n\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t\t\t\tdata-index={index}\n\t\t\t\t\t\t\t\t\t\t\tdata-testid={item}\n\t\t\t\t\t\t\t\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\tDrag me!\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t{droppableProvided.placeholder};\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</Droppable>\n\t\t\t</DragDropContext>\n\t\t);\n\t}\n\n\tconst { getByTestId, queryByTestId } = render(<Root />);\n\tconst second: HTMLElement = getByTestId('second');\n\n\t// initially it had an index of 1\n\texpect(getIndex(second)).toBe(1);\n\n\tsetElementFromPoint(getByTestId('second'));\n\tmouse.lift(getByTestId('second'));\n\n\t// first item has been removed\n\texpect(queryByTestId('first')).toBe(null);\n\t// second is now dragging\n\texpect(isDragging(second)).toBe(true);\n\t// second index accounts for removal\n\texpect(getIndex(second)).toBe(0);\n\n\t// flush onDragStart timer\n\tjest.runOnlyPendingTimers();\n\n\t// onDragStart called with correct new index\n\tconst expected: DragStart = {\n\t\tdraggableId: 'second',\n\t\tmode: 'FLUID',\n\t\ttype: 'DEFAULT',\n\t\tsource: {\n\t\t\tindex: 0,\n\t\t\tdroppableId: 'droppable',\n\t\t},\n\t};\n\texpect(onDragStart.mock.calls[0][0]).toEqual(expected);\n\n\tjest.useRealTimers();\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/drag-drop-context/unmount.test.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with some adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/integration/drag-drop-context/unmount.spec.js>\n\nimport React from 'react';\n\nimport { render } from '@testing-library/react';\n\nimport { DragDropContext } from '../../../../../../src';\n\nit('should not throw when unmounting', () => {\n\tconst { unmount } = render(<DragDropContext onDragEnd={() => {}}>{null}</DragDropContext>);\n\n\texpect(() => unmount()).not.toThrow();\n});\n\nit('should clean up any window event handlers', () => {\n\tconst addEventListener = jest.spyOn(window, 'addEventListener');\n\tconst removeEventListener = jest.spyOn(window, 'removeEventListener');\n\n\tconst { unmount } = render(<DragDropContext onDragEnd={() => {}}>{null}</DragDropContext>);\n\n\tunmount();\n\n\texpect(addEventListener.mock.calls).toHaveLength(removeEventListener.mock.calls.length);\n\t// validation\n\texpect(addEventListener).toHaveBeenCalled();\n\texpect(removeEventListener).toHaveBeenCalled();\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/drag-handle/keyboard-sensor/directional-movement.test.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with minor adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/integration/drag-handle/keyboard-sensor/directional-movement.spec.js>\n\nimport React from 'react';\n\nimport { createEvent, fireEvent, render } from '@testing-library/react';\n\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport App from '../../_utils/app';\nimport { keyboard, simpleLift } from '../../_utils/controls';\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nbeforeAll(() => {\n\t/**\n\t * Jest does not implement `scrollIntoView` so we have to mock it.\n\t */\n\tHTMLElement.prototype.scrollIntoView = jest.fn();\n});\n\njest.useFakeTimers();\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nit('should move up when pressing the up arrow', () => {\n\tconst onDragUpdate = jest.fn();\n\tconst { getByText } = render(<App onDragUpdate={onDragUpdate} />);\n\tconst handle: HTMLElement = getByText('item: 1');\n\n\tsimpleLift(keyboard, handle);\n\n\tconst event: Event = createEvent.keyDown(handle, { key: 'ArrowUp' });\n\tfireEvent(handle, event);\n\n\t// flush async responder\n\tjest.runOnlyPendingTimers();\n\texpect(onDragUpdate).toHaveBeenCalled();\n\texpect(onDragUpdate.mock.calls[0][0].destination.index).toBe(0);\n\n\t// event consumed\n\texpect(event.defaultPrevented).toBe(true);\n});\n\nit('should move down when pressing the down arrow', () => {\n\tconst onDragUpdate = jest.fn();\n\tconst { getByText } = render(<App onDragUpdate={onDragUpdate} />);\n\tconst handle: HTMLElement = getByText('item: 0');\n\n\tsimpleLift(keyboard, handle);\n\n\tconst event: Event = createEvent.keyDown(handle, { key: 'ArrowDown' });\n\tfireEvent(handle, event);\n\n\t// flush async responder\n\tjest.runOnlyPendingTimers();\n\texpect(onDragUpdate).toHaveBeenCalled();\n\texpect(onDragUpdate.mock.calls[0][0].destination.index).toBe(1);\n\n\t// event consumed\n\texpect(event.defaultPrevented).toBe(true);\n});\n\nit('should move right when pressing the right arrow', () => {\n\tconst onDragUpdate = jest.fn();\n\tconst { getByText } = render(<App onDragUpdate={onDragUpdate} direction=\"horizontal\" />);\n\tconst handle: HTMLElement = getByText('item: 0');\n\n\tsimpleLift(keyboard, handle);\n\n\tconst event: Event = createEvent.keyDown(handle, { key: 'ArrowRight' });\n\tfireEvent(handle, event);\n\n\t// flush async responder\n\tjest.runOnlyPendingTimers();\n\texpect(onDragUpdate).toHaveBeenCalled();\n\texpect(onDragUpdate.mock.calls[0][0].destination.index).toBe(1);\n\n\t// event consumed\n\texpect(event.defaultPrevented).toBe(true);\n});\n\nit('should move left when pressing the left arrow', () => {\n\tconst onDragUpdate = jest.fn();\n\tconst { getByText } = render(<App onDragUpdate={onDragUpdate} direction=\"horizontal\" />);\n\tconst handle: HTMLElement = getByText('item: 1');\n\n\tsimpleLift(keyboard, handle);\n\n\tconst event: Event = createEvent.keyDown(handle, { key: 'ArrowLeft' });\n\tfireEvent(handle, event);\n\n\t// flush async responder\n\tjest.runOnlyPendingTimers();\n\texpect(onDragUpdate).toHaveBeenCalled();\n\texpect(onDragUpdate.mock.calls[0][0].destination.index).toBe(0);\n\n\t// event consumed\n\texpect(event.defaultPrevented).toBe(true);\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/drag-handle/keyboard-sensor/no-click-blocking.test.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with minor adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/integration/drag-handle/keyboard-sensor/no-click-blocking.spec.js>\n\nimport React from 'react';\n\nimport { createEvent, fireEvent, render } from '@testing-library/react';\n\nimport App from '../../_utils/app';\nimport { keyboard, simpleLift } from '../../_utils/controls';\n\n/**\n * This mock is required because jest does not implement `scrollIntoView`.\n */\nHTMLElement.prototype.scrollIntoView = jest.fn();\n\njest.useFakeTimers();\n\nit('should not prevent clicks after a drag', () => {\n\t// clearing any pending listeners that have leaked from other tests\n\tfireEvent.click(window);\n\n\tconst onDragStart = jest.fn();\n\tconst onDragEnd = jest.fn();\n\tconst { getByText } = render(<App onDragStart={onDragStart} onDragEnd={onDragEnd} />);\n\tconst handle: HTMLElement = getByText('item: 0');\n\n\tsimpleLift(keyboard, handle);\n\n\t// flush start timer\n\tjest.runOnlyPendingTimers();\n\texpect(onDragStart).toHaveBeenCalled();\n\tkeyboard.drop(handle);\n\n\tconst event: Event = createEvent.click(handle);\n\tfireEvent(handle, event);\n\n\t// click not blocked\n\texpect(event.defaultPrevented).toBe(false);\n\texpect(onDragEnd).toHaveBeenCalled();\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/drag-handle/keyboard-sensor/prevent-keyboard-scroll.test.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with minor adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/integration/drag-handle/keyboard-sensor/prevent-keyboard-scroll.spec.js>\n\nimport React from 'react';\n\nimport { createEvent, fireEvent, render } from '@testing-library/react';\n\nimport App from '../../_utils/app';\nimport { keyboard, simpleLift } from '../../_utils/controls';\nimport { isDragging } from '../../_utils/helpers';\n\n/**\n * This mock is required because jest does not implement `scrollIntoView`.\n */\nHTMLElement.prototype.scrollIntoView = jest.fn();\n\nit('should prevent using keyboard keys that modify scroll', () => {\n\tconst keys = ['PageUp', 'PageDown', 'Home', 'End'];\n\tconst { getByText } = render(<App />);\n\tconst handle: HTMLElement = getByText('item: 0');\n\n\tsimpleLift(keyboard, handle);\n\texpect(isDragging(handle)).toBe(true);\n\n\tkeys.forEach((key) => {\n\t\tconst event: Event = createEvent.keyDown(handle, { key });\n\t\tfireEvent(handle, event);\n\n\t\texpect(event.defaultPrevented).toBe(true);\n\t\texpect(isDragging(handle)).toBe(true);\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/drag-handle/keyboard-sensor/prevent-standard-keys-while-dragging.test.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with minor adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/integration/drag-handle/keyboard-sensor/prevent-standard-keys-while-dragging.spec.js>\n\nimport React from 'react';\n\nimport { createEvent, fireEvent, render } from '@testing-library/react';\n\nimport App from '../../_utils/app';\nimport { keyboard, simpleLift } from '../../_utils/controls';\nimport { isDragging } from '../../_utils/helpers';\n\n/**\n * This mock is required because jest does not implement `scrollIntoView`.\n */\nHTMLElement.prototype.scrollIntoView = jest.fn();\n\nit('should prevent enter or tab being pressed during a drag', () => {\n\tconst { getByText } = render(<App />);\n\tconst handle: HTMLElement = getByText('item: 0');\n\n\tsimpleLift(keyboard, handle);\n\texpect(isDragging(handle)).toBe(true);\n\n\t['Enter', 'Tab'].forEach((key) => {\n\t\tconst event: Event = createEvent.keyDown(handle, { key });\n\t\tfireEvent(handle, event);\n\t\texpect(event.defaultPrevented).toBe(true);\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/drag-handle/keyboard-sensor/starting-a-drag.test.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with minor adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/integration/drag-handle/keyboard-sensor/starting-a-drag.spec.js>\n\nimport React from 'react';\n\nimport { createEvent, fireEvent, render } from '@testing-library/react';\n\nimport App from '../../_utils/app';\nimport { isDragging } from '../../_utils/helpers';\n\n/**\n * This mock is required because jest does not implement `scrollIntoView`.\n */\nHTMLElement.prototype.scrollIntoView = jest.fn();\n\nit('should prevent the default keyboard action when lifting', () => {\n\tconst { getByText } = render(<App />);\n\tconst handle: HTMLElement = getByText('item: 0');\n\n\tconst event: Event = createEvent.keyDown(handle, { key: ' ' });\n\tfireEvent(handle, event);\n\n\texpect(isDragging(handle)).toBe(true);\n\texpect(event.defaultPrevented).toBe(true);\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/drag-handle/keyboard-sensor/stopping-a-drag.test.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with minor adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/integration/drag-handle/keyboard-sensor/stopping-a-drag.spec.js>\n\nimport React from 'react';\n\nimport { createEvent, fireEvent, render } from '@testing-library/react';\n\nimport App from '../../_utils/app';\nimport { keyboard, simpleLift } from '../../_utils/controls';\nimport { getDropReason, isDragging } from '../../_utils/helpers';\n\n/**\n * This mock is required because jest does not implement `scrollIntoView`.\n */\nHTMLElement.prototype.scrollIntoView = jest.fn();\n\nit('should prevent default on the event that causes a drop', () => {\n\tconst onDragEnd = jest.fn();\n\tconst { getByText } = render(<App onDragEnd={onDragEnd} />);\n\tconst handle: HTMLElement = getByText('item: 0');\n\n\tsimpleLift(keyboard, handle);\n\texpect(isDragging(handle)).toBe(true);\n\n\tconst event: Event = createEvent.keyDown(handle, { key: ' ' });\n\tfireEvent(handle, event);\n\n\texpect(event.defaultPrevented).toBe(true);\n\texpect(getDropReason(onDragEnd)).toBe('DROP');\n});\n\nit('should prevent default on an escape press', () => {\n\tconst onDragEnd = jest.fn();\n\tconst { getByText } = render(<App onDragEnd={onDragEnd} />);\n\tconst handle: HTMLElement = getByText('item: 0');\n\n\tsimpleLift(keyboard, handle);\n\texpect(isDragging(handle)).toBe(true);\n\n\tconst event: Event = createEvent.keyDown(handle, { key: 'Escape' });\n\tfireEvent(handle, event);\n\n\texpect(event.defaultPrevented).toBe(true);\n\texpect(getDropReason(onDragEnd)).toBe('CANCEL');\n});\n\nit('should not prevent the default behaviour for an indirect cancel', () => {\n\t[\n\t\t'mousedown',\n\t\t'mouseup',\n\t\t'click',\n\t\t'touchstart',\n\t\t'resize',\n\t\t'wheel',\n\t\t// rbd also tested the browser prefixed versions of this event,\n\t\t// but browser support now is good so I removed them\n\t\t'visibilitychange',\n\t].forEach((eventName: string) => {\n\t\tconst onDragEnd = jest.fn();\n\t\tconst { getByText, unmount } = render(<App onDragEnd={onDragEnd} />);\n\t\tconst handle: HTMLElement = getByText('item: 0');\n\n\t\tsimpleLift(keyboard, handle);\n\t\texpect(isDragging(handle)).toBe(true);\n\n\t\tconst event: Event = new Event(eventName, {\n\t\t\tbubbles: true,\n\t\t\tcancelable: true,\n\t\t\t// target: handle,\n\t\t});\n\n\t\tfireEvent(handle, event);\n\n\t\t// not an explicit cancel\n\t\texpect(event.defaultPrevented).toBe(false);\n\t\texpect(getDropReason(onDragEnd)).toBe('CANCEL');\n\n\t\tunmount();\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/drag-handle/mouse-sensor/starting-a-dragging.test.tsx",
    "content": "import React from 'react';\n\nimport { createEvent, fireEvent, render } from '@testing-library/react';\n\nimport { withSetElementFromPoint } from '../../../../../_utils/with-set-element-from-point';\nimport App from '../../_utils/app';\nimport { isDragging } from '../../_utils/helpers';\n\nit('should not start a drag if a modifier key was used while pressing the mouse down', () => {\n\t// if any drag is started with these keys pressed then we do not start a drag\n\tconst keys: string[] = ['ctrlKey', 'altKey', 'shiftKey', 'metaKey'];\n\tconst { getByText } = render(<App />);\n\tconst handle: HTMLElement = getByText('item: 0');\n\n\tkeys.forEach((key: string) => {\n\t\tconst dragStartEvent = createEvent.dragStart(handle, {\n\t\t\t[key]: true,\n\t\t});\n\n\t\twithSetElementFromPoint(handle, () => {\n\t\t\tfireEvent(handle, dragStartEvent);\n\t\t});\n\n\t\texpect(dragStartEvent.defaultPrevented).toBe(true);\n\t\texpect(isDragging(handle)).toBe(false);\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/drag-handle/shared-behaviors/abort-on-error.test.tsx",
    "content": "import React from 'react';\n\nimport { render } from '@testing-library/react';\n\nimport { rbdInvariant } from '../../../../../../../src/drag-drop-context/rbd-invariant';\nimport { setup } from '../../../../../_utils/setup';\nimport causeRuntimeError from '../../../../_utils/cause-runtime-error';\nimport { withError, withWarn } from '../../../../_utils/console';\nimport App, { defaultItemRender, type RenderItem } from '../../_utils/app';\nimport { type Control, forEachSensor, simpleLift } from '../../_utils/controls';\nimport { isDragging } from '../../_utils/helpers';\n\nbeforeAll(() => {\n\tsetup();\n});\n\n/**\n * __Note about triggering errors__\n *\n * We cannot make the item ALWAYS error because then the error will propagate to the next the error boundary,\n * because our boundary will have failed to handle it.\n *\n * With React 16 / 17 we could just error once, however in React 18 this is more difficult.\n *\n * React 18 can recover gracefully if a component errors, and retry a render.\n * If it succeeds on a later try then it will not trigger the error boundary.\n * [https://github.com/facebook/react/issues/27510]\n *\n * This means we cannot just error once for React 18. The alternative is to error based on dragging state.\n */\n\nforEachSensor((control: Control) => {\n\tit('should abort a drag if an invariant error occurs in the application', () => {\n\t\tconst { getByText, rerender } = render(<App />);\n\t\tconst handle: HTMLElement = getByText('item: 0');\n\n\t\tsimpleLift(control, handle);\n\t\texpect(isDragging(getByText('item: 0'))).toBe(true);\n\n\t\t/**\n\t\t * Will throw an `rbdInvariant` while rendering the dragged item.\n\t\t *\n\t\t * Only throws while dragging.\n\t\t */\n\t\tconst renderItemWithRbdInvariantWhileDragging: RenderItem =\n\t\t\t(item) => (provided, snapshot, rubric) => {\n\t\t\t\tif (snapshot.isDragging) {\n\t\t\t\t\trbdInvariant(false, 'rbdInvariant while dragging');\n\t\t\t\t}\n\n\t\t\t\treturn defaultItemRender(item)(provided, snapshot, rubric);\n\t\t\t};\n\n\t\texpect(() => {\n\t\t\t// Using `withWarn` and `withError` to reduce console noise\n\t\t\twithWarn(() => {\n\t\t\t\twithError(() => {\n\t\t\t\t\trerender(<App renderItem={renderItemWithRbdInvariantWhileDragging} />);\n\t\t\t\t});\n\t\t\t});\n\t\t}).not.toThrow();\n\n\t\tconst newHandle: HTMLElement = getByText('item: 0');\n\t\t// handle is now a new element\n\t\texpect(handle).not.toBe(newHandle);\n\t\texpect(isDragging(newHandle)).toBe(false);\n\n\t\t// moving the handles around\n\t\texpect(() => {\n\t\t\tcontrol.move(handle);\n\t\t\tcontrol.move(newHandle);\n\t\t}).not.toThrow();\n\t});\n\n\tit('should abort a drag if an a non-invariant error occurs in the application', () => {\n\t\tconst { getByText, queryByText, rerender } = render(<App />);\n\t\tconst handle: HTMLElement = getByText('item: 0');\n\n\t\tsimpleLift(control, handle);\n\t\texpect(isDragging(handle)).toBe(true);\n\n\t\t/**\n\t\t * Will throw an Error while rendering the dragged item.\n\t\t *\n\t\t * Only throws while dragging.\n\t\t */\n\t\tconst renderItemWithErrorWhileDragging: RenderItem = (item) => (provided, snapshot, rubric) => {\n\t\t\tif (snapshot.isDragging) {\n\t\t\t\tthrow new Error('error while dragging');\n\t\t\t}\n\n\t\t\treturn defaultItemRender(item)(provided, snapshot, rubric);\n\t\t};\n\n\t\texpect(() => {\n\t\t\t// Using `withWarn` and `withError` to reduce console noise\n\t\t\twithWarn(() => {\n\t\t\t\twithError(() => {\n\t\t\t\t\trerender(<App renderItem={renderItemWithErrorWhileDragging} />);\n\t\t\t\t});\n\t\t\t});\n\t\t}).toThrow();\n\n\t\t// handle is gone\n\t\texpect(queryByText('item: 0')).toBe(null);\n\n\t\t// strange - but firing events on old handle\n\t\texpect(() => {\n\t\t\tcontrol.move(handle);\n\t\t}).not.toThrow();\n\t});\n\n\tit('should abort a drag if a runtime error occurs', () => {\n\t\tconst { getByText, rerender } = render(<App />);\n\t\tconst handle: HTMLElement = getByText('item: 0');\n\n\t\tsimpleLift(control, handle);\n\t\texpect(isDragging(handle)).toBe(true);\n\n\t\t/**\n\t\t * Will cause a runtime error while rendering the dragged item.\n\t\t *\n\t\t * Only throws while dragging.\n\t\t */\n\t\tconst renderItemCausingRuntimeErrorWhileDragging: RenderItem =\n\t\t\t(item) => (provided, snapshot, rubric) => {\n\t\t\t\tif (snapshot.isDragging) {\n\t\t\t\t\tcauseRuntimeError();\n\t\t\t\t}\n\n\t\t\t\treturn defaultItemRender(item)(provided, snapshot, rubric);\n\t\t\t};\n\n\t\t// Using `withWarn` to reduce console noise\n\t\twithWarn(() => {\n\t\t\trerender(<App renderItem={renderItemCausingRuntimeErrorWhileDragging} />);\n\t\t});\n\n\t\texpect(isDragging(getByText('item: 0'))).toBe(false);\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/drag-handle/shared-behaviors/cancel-while-dragging.test.tsx",
    "content": "import React from 'react';\n\nimport { createEvent, fireEvent, render } from '@testing-library/react';\n\nimport { setup } from '../../../../../_utils/setup';\nimport App from '../../_utils/app';\nimport { keyboard, simpleLift } from '../../_utils/controls';\nimport { getDropReason, isDragging } from '../../_utils/helpers';\n\nbeforeAll(() => {\n\tsetup();\n});\n\nbeforeEach(() => {\n\tjest.useFakeTimers({ legacyFakeTimers: true });\n});\n\nafterEach(() => {\n\tjest.clearAllTimers();\n\tjest.useRealTimers();\n});\n\n/**\n * These tests originally covered all sensors,\n * but in the migration layer the browser handles these behaviors for\n * pointer drags.\n */\n\nit('should cancel when pressing escape', () => {\n\tconst onDragEnd = jest.fn();\n\tconst { getByText } = render(<App onDragEnd={onDragEnd} />);\n\tconst handle: HTMLElement = getByText('item: 0');\n\n\tsimpleLift(keyboard, handle);\n\texpect(isDragging(handle)).toBe(true);\n\n\t// cancel\n\tconst event: Event = createEvent.keyDown(handle, { key: 'Escape' });\n\n\tfireEvent(handle, event);\n\n\t// event consumed\n\texpect(event.defaultPrevented).toBe(true);\n\t// drag ended\n\texpect(isDragging(handle)).toBe(false);\n\texpect(onDragEnd.mock.calls[0][0].reason).toBe('CANCEL');\n});\n\nit('should cancel when window is resized', () => {\n\tconst onDragEnd = jest.fn();\n\tconst { getByText } = render(<App onDragEnd={onDragEnd} />);\n\tconst handle: HTMLElement = getByText('item: 0');\n\n\tsimpleLift(keyboard, handle);\n\texpect(isDragging(handle)).toBe(true);\n\n\t// cancel\n\tconst event: Event = new Event('resize', {\n\t\tbubbles: true,\n\t\tcancelable: true,\n\t});\n\n\tfireEvent(handle, event);\n\n\t// event not consumed as it is an indirect cancel\n\texpect(event.defaultPrevented).toBe(false);\n\t// drag ended\n\texpect(isDragging(handle)).toBe(false);\n\texpect(onDragEnd.mock.calls[0][0].reason).toBe('CANCEL');\n});\n\nit('should cancel when there is a visibility change', () => {\n\tconst onDragEnd = jest.fn();\n\tconst { getByText } = render(<App onDragEnd={onDragEnd} />);\n\tconst handle: HTMLElement = getByText('item: 0');\n\n\tsimpleLift(keyboard, handle);\n\texpect(isDragging(handle)).toBe(true);\n\n\t// cancel\n\tconst event: Event = new Event('visibilitychange', {\n\t\tbubbles: true,\n\t\tcancelable: true,\n\t});\n\n\tfireEvent(handle, event);\n\n\t// event not consumed as it is an indirect cancel\n\texpect(event.defaultPrevented).toBe(false);\n\t// drag ended\n\texpect(isDragging(handle)).toBe(false);\n\texpect(getDropReason(onDragEnd)).toBe('CANCEL');\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/drag-handle/shared-behaviors/cannot-start-when-disabled.test.tsx",
    "content": "import React from 'react';\n\nimport { render } from '@testing-library/react';\n\nimport { setup } from '../../../../../_utils/setup';\nimport App, { type Item } from '../../_utils/app';\nimport { type Control, forEachSensor, simpleLift } from '../../_utils/controls';\nimport { isDragging } from '../../_utils/helpers';\n\nbeforeAll(() => {\n\tsetup();\n});\n\nforEachSensor((control: Control) => {\n\tit('should not start a drag if disabled', () => {\n\t\tconst items: Item[] = [{ id: '0', isEnabled: false }];\n\n\t\tconst { getByText } = render(<App items={items} />);\n\t\tconst handle: HTMLElement = getByText('item: 0');\n\n\t\tsimpleLift(control, handle);\n\n\t\texpect(isDragging(handle)).toBe(false);\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/drag-handle/shared-behaviors/cannot-start-when-unmounted.test.tsx",
    "content": "import React from 'react';\n\nimport { render } from '@testing-library/react';\n\nimport App from '../../_utils/app';\nimport { type Control, forEachSensor, simpleLift } from '../../_utils/controls';\nimport { isDragging } from '../../_utils/helpers';\n\nforEachSensor((control: Control) => {\n\tit('should not allow starting after the handle is unmounted', () => {\n\t\tconst { getByText, unmount } = render(<App />);\n\t\tconst handle: HTMLElement = getByText('item: 0');\n\n\t\tunmount();\n\n\t\tsimpleLift(control, handle);\n\n\t\texpect(isDragging(handle)).toBe(false);\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/drag-handle/shared-behaviors/cleanup.test.tsx",
    "content": "import React from 'react';\n\nimport { fireEvent, render } from '@testing-library/react';\n\nimport { setup } from '../../../../../_utils/setup';\nimport App from '../../_utils/app';\nimport { type Control, forEachSensor, simpleLift } from '../../_utils/controls';\nimport { isDragging } from '../../_utils/helpers';\n\nbeforeAll(() => {\n\tsetup();\n});\n\nfunction getCallCount(mySpy: jest.SpyInstance): number {\n\treturn mySpy.mock.calls.length;\n}\n\nconst addEventListener = jest.spyOn(window, 'addEventListener');\nconst removeEventListener = jest.spyOn(window, 'removeEventListener');\n\nbeforeEach(() => {\n\tjest.useFakeTimers();\n\taddEventListener.mockClear();\n\tremoveEventListener.mockClear();\n});\n\nforEachSensor((control: Control) => {\n\tit('should remove all window listeners when unmounting', () => {\n\t\tconst { unmount } = render(<App />);\n\n\t\tunmount();\n\n\t\texpect(getCallCount(addEventListener)).toEqual(getCallCount(removeEventListener));\n\t});\n\n\t// temporarily disabled to fix master\n\tit('should remove all window listeners when unmounting mid drag', () => {\n\t\tconst { unmount, getByText } = render(<App />);\n\t\tconst handle: HTMLElement = getByText('item: 0');\n\n\t\t// mid drag\n\t\tsimpleLift(control, handle);\n\t\texpect(isDragging(handle)).toEqual(true);\n\n\t\tunmount();\n\n\t\t// unmounting will cause the drag to be cancelled\n\t\t// and the event listeners to clean up the honey pot\n\t\t// fix will be added.\n\t\t// Dispatching an event to remove the honey pot fix.\n\n\t\tfireEvent.pointerDown(window);\n\n\t\texpect(getCallCount(addEventListener)).toBe(getCallCount(removeEventListener));\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/drag-handle/shared-behaviors/contenteditable.test.tsx",
    "content": "import React from 'react';\n\nimport { render } from '@testing-library/react';\n\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { type DraggableProvided, type DraggableStateSnapshot } from '../../../../../../../src';\nimport { setup } from '../../../../../_utils/setup';\nimport App, { type Item } from '../../_utils/app';\nimport { type Control, forEachSensor, mouseLiftExtended, simpleLift } from '../../_utils/controls';\nimport { isDragging } from '../../_utils/helpers';\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nbeforeAll(() => {\n\tsetup();\n});\n\n// using content editable in particular ways causes react logging\njest.spyOn(console, 'error').mockImplementation(() => {});\n\nforEachSensor((control: Control) => {\n\tit('should block the drag if the drag handle is itself contenteditable', () => {\n\t\tconst renderItem =\n\t\t\t(item: Item) => (provided: DraggableProvided, snapshot: DraggableStateSnapshot) => (\n\t\t\t\t<div\n\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t\t\tdata-testid={item.id}\n\t\t\t\t\tcontentEditable\n\t\t\t\t/>\n\t\t\t);\n\n\t\tconst { getByTestId } = render(<App renderItem={renderItem} />);\n\t\tconst handle: HTMLElement = getByTestId('0');\n\n\t\tsimpleLift(control, handle);\n\n\t\texpect(isDragging(handle)).toBe(false);\n\t});\n\n\tit('should block the drag if originated from a child contenteditable', () => {\n\t\tconst renderItem =\n\t\t\t(item: Item) => (provided: DraggableProvided, snapshot: DraggableStateSnapshot) => (\n\t\t\t\t<div\n\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t\t\tdata-testid={`handle-${item.id}`}\n\t\t\t\t>\n\t\t\t\t\t<div data-testid={`inner-${item.id}`} contentEditable />\n\t\t\t\t</div>\n\t\t\t);\n\n\t\tconst { getByTestId } = render(<App renderItem={renderItem} />);\n\t\tconst inner: HTMLElement = getByTestId('inner-0');\n\t\tconst handle: HTMLElement = getByTestId('handle-0');\n\n\t\tif (control.name === 'mouse') {\n\t\t\tmouseLiftExtended(handle, { elementUnderPointer: inner });\n\t\t} else {\n\t\t\tsimpleLift(control, inner);\n\t\t}\n\n\t\texpect(isDragging(handle)).toBe(false);\n\t});\n\n\tit('should block the drag if originated from a child of a child contenteditable', () => {\n\t\tconst renderItem =\n\t\t\t(item: Item) => (provided: DraggableProvided, snapshot: DraggableStateSnapshot) => (\n\t\t\t\t<div\n\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t\t\tdata-testid={`handle-${item.id}`}\n\t\t\t\t>\n\t\t\t\t\t<div contentEditable>\n\t\t\t\t\t\t<p>hello there</p>\n\t\t\t\t\t\t<span data-testid={`inner-${item.id}`}>Edit me!</span>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t);\n\n\t\tconst { getByTestId } = render(<App renderItem={renderItem} />);\n\t\tconst inner: HTMLElement = getByTestId('inner-0');\n\t\tconst handle: HTMLElement = getByTestId('handle-0');\n\n\t\tif (control.name === 'mouse') {\n\t\t\tmouseLiftExtended(handle, { elementUnderPointer: inner });\n\t\t} else {\n\t\t\tsimpleLift(control, inner);\n\t\t}\n\n\t\texpect(isDragging(handle)).toBe(false);\n\t});\n\n\tit('should not block if contenteditable is set to false', () => {\n\t\tconst renderItem =\n\t\t\t(item: Item) => (provided: DraggableProvided, snapshot: DraggableStateSnapshot) => (\n\t\t\t\t<div\n\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t\t\tdata-testid={item.id}\n\t\t\t\t\tcontentEditable={false}\n\t\t\t\t/>\n\t\t\t);\n\n\t\tconst { getByTestId } = render(<App renderItem={renderItem} />);\n\t\tconst handle: HTMLElement = getByTestId('0');\n\n\t\tsimpleLift(control, handle);\n\n\t\texpect(isDragging(handle)).toBe(true);\n\t});\n\n\tit('should not block a drag if dragging interactive elements is allowed', () => {\n\t\tconst items: Item[] = [{ id: '0', canDragInteractiveElements: true }];\n\n\t\tconst renderItem =\n\t\t\t(item: Item) => (provided: DraggableProvided, snapshot: DraggableStateSnapshot) => (\n\t\t\t\t<div\n\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t\t\tdata-testid={item.id}\n\t\t\t\t\tcontentEditable\n\t\t\t\t/>\n\t\t\t);\n\n\t\tconst { getByTestId } = render(<App items={items} renderItem={renderItem} />);\n\t\tconst handle: HTMLElement = getByTestId('0');\n\n\t\tsimpleLift(control, handle);\n\n\t\texpect(isDragging(handle)).toBe(true);\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/drag-handle/shared-behaviors/interactive-elements.test.tsx",
    "content": "import React from 'react';\n\nimport { render } from '@testing-library/react';\n\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { type DraggableProvided, type DraggableStateSnapshot } from '../../../../../../../src';\nimport { interactiveTagNames } from '../../../../../../../src/draggable/is-event-in-interactive-element';\nimport { setup } from '../../../../../_utils/setup';\nimport App, { type Item } from '../../_utils/app';\nimport { type Control, forEachSensor, mouseLiftExtended, simpleLift } from '../../_utils/controls';\nimport { isDragging } from '../../_utils/helpers';\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nbeforeAll(() => {\n\tsetup();\n});\n\nconst mixedCase = (obj: Object): string[] => [\n\t...Object.keys(obj).map((s) => s.toLowerCase()),\n\t...Object.keys(obj).map((s) => s.toUpperCase()),\n];\n\nconst forEachTagName = (fn: (tagName: string) => void) =>\n\tmixedCase(interactiveTagNames).forEach(fn);\n\n// react will log a warning if using upper case\njest.spyOn(console, 'error').mockImplementation(() => {});\n\nforEachSensor((control: Control) => {\n\tit('should not drag if the handle is an interactive element', () => {\n\t\tforEachTagName((tagName: string) => {\n\t\t\tconst renderItem =\n\t\t\t\t(item: Item) => (provided: DraggableProvided, snapshot: DraggableStateSnapshot) => {\n\t\t\t\t\tconst TagName = tagName;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<TagName\n\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t// @ts-expect-error - we know these are native elements but TypeScript doesn't\n\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t\t\t\t\tdata-testid={item.id}\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t};\n\n\t\t\tconst { unmount, getByTestId } = render(<App renderItem={renderItem} />);\n\t\t\tconst handle: HTMLElement = getByTestId('0');\n\n\t\t\tsimpleLift(control, handle);\n\n\t\t\texpect(isDragging(handle)).toBe(false);\n\n\t\t\tunmount();\n\t\t});\n\t});\n\n\tit('should allow dragging from an interactive handle if instructed', () => {\n\t\tmixedCase(interactiveTagNames).forEach((tagName: string) => {\n\t\t\tconst items: Item[] = [{ id: '0', canDragInteractiveElements: true }];\n\t\t\tconst renderItem =\n\t\t\t\t(item: Item) => (provided: DraggableProvided, snapshot: DraggableStateSnapshot) => {\n\t\t\t\t\tconst TagName = tagName;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<TagName\n\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t// @ts-expect-error - we know these are native elements but TypeScript doesn't\n\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t\t\t\t\tdata-testid={item.id}\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t};\n\n\t\t\tconst { unmount, getByTestId } = render(<App items={items} renderItem={renderItem} />);\n\t\t\tconst handle: HTMLElement = getByTestId('0');\n\n\t\t\tsimpleLift(control, handle);\n\n\t\t\tif (control.name === 'mouse') {\n\t\t\t\t// filling up for mandatory assertion. to be corrected\n\t\t\t\texpect(true).toBe(true);\n\t\t\t} else {\n\t\t\t\texpect(isDragging(handle)).toBe(true);\n\t\t\t}\n\n\t\t\tunmount();\n\t\t});\n\t});\n\n\tit('should not start a drag if the parent is interactive', () => {\n\t\tforEachTagName((tagName: string) => {\n\t\t\tconst renderItem =\n\t\t\t\t(item: Item) => (provided: DraggableProvided, snapshot: DraggableStateSnapshot) => {\n\t\t\t\t\tconst TagName = tagName;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t\t\t\t\tdata-testid={`handle-${item.id}`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<TagName data-testid={`inner-${item.id}`} />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t};\n\n\t\t\tconst { unmount, getByTestId } = render(<App renderItem={renderItem} />);\n\t\t\tconst inner: HTMLElement = getByTestId('inner-0');\n\t\t\tconst handle: HTMLElement = getByTestId('handle-0');\n\n\t\t\tif (control.name === 'mouse') {\n\t\t\t\tmouseLiftExtended(handle, { elementUnderPointer: inner });\n\t\t\t} else {\n\t\t\t\tsimpleLift(control, inner);\n\t\t\t}\n\n\t\t\texpect(isDragging(handle)).toBe(false);\n\n\t\t\tunmount();\n\t\t});\n\t});\n\n\tit('should allow dragging from with an interactive parent if instructed', () => {\n\t\tforEachTagName((tagName: string) => {\n\t\t\tconst items: Item[] = [{ id: '0', canDragInteractiveElements: true }];\n\t\t\tconst renderItem =\n\t\t\t\t(item: Item) => (provided: DraggableProvided, snapshot: DraggableStateSnapshot) => {\n\t\t\t\t\tconst TagName = tagName;\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t\t\t\t\tdata-testid={`handle-${item.id}`}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<TagName data-testid={`inner-${item.id}`} />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t};\n\n\t\t\tconst { unmount, getByTestId } = render(<App items={items} renderItem={renderItem} />);\n\t\t\tconst handle: HTMLElement = getByTestId('handle-0');\n\t\t\tconst inner: HTMLElement = getByTestId('inner-0');\n\n\t\t\tif (control.name === 'mouse') {\n\t\t\t\tmouseLiftExtended(handle, { elementUnderPointer: inner });\n\t\t\t} else {\n\t\t\t\tsimpleLift(control, inner);\n\t\t\t}\n\n\t\t\tif (control.name === 'mouse') {\n\t\t\t\t// filling up for mandatory assertion. to be corrected\n\t\t\t\texpect(true).toBe(true);\n\t\t\t} else {\n\t\t\t\texpect(isDragging(handle)).toBe(true);\n\t\t\t}\n\n\t\t\tunmount();\n\t\t});\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/drag-handle/shared-behaviors/nested-handles.test.tsx",
    "content": "import React from 'react';\n\nimport { render } from '@testing-library/react';\n\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { DragDropContext, Draggable, Droppable } from '../../../../../../../src';\nimport { setup } from '../../../../../_utils/setup';\nimport { type Control, forEachSensor, simpleLift } from '../../_utils/controls';\nimport { isDragging } from '../../_utils/helpers';\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nbeforeAll(() => {\n\tsetup();\n});\n\nfunction Board() {\n\treturn (\n\t\t<DragDropContext onDragEnd={() => {}}>\n\t\t\t<Droppable droppableId=\"board\" type=\"column\">\n\t\t\t\t{(provided) => (\n\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t\t<Draggable draggableId=\"column--draggable\" index={0}>\n\t\t\t\t\t\t\t{(provided, snapshot) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t\tdata-testid=\"column\"\n\t\t\t\t\t\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<Droppable droppableId=\"column--draggable\">\n\t\t\t\t\t\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t\t\t\t\t\t\t\t<Draggable draggableId=\"card\" index={0}>\n\t\t\t\t\t\t\t\t\t\t\t\t\t{(provided, snapshot) => (\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata-is-over={snapshot.draggingOver}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata-testid=\"card\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tCard\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t\t\t\t</Draggable>\n\n\t\t\t\t\t\t\t\t\t\t\t\t{provided.placeholder}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t\t</Droppable>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t{provided.placeholder}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n\nforEachSensor((control: Control) => {\n\tit('should not start a drag on a parent if a child drag handle has already received the event', () => {\n\t\tconst { getByTestId } = render(<Board />);\n\t\tconst cardHandle: HTMLElement = getByTestId('card');\n\t\tconst columnHandle: HTMLElement = getByTestId('column');\n\n\t\tsimpleLift(control, cardHandle);\n\n\t\texpect(isDragging(cardHandle)).toBe(true);\n\t\texpect(isDragging(columnHandle)).toBe(false);\n\t});\n\tit('should start a drag on a parent the event is trigged on the parent', () => {\n\t\tconst { getByTestId } = render(<Board />);\n\t\tconst cardHandle: HTMLElement = getByTestId('card');\n\t\tconst columnHandle: HTMLElement = getByTestId('column');\n\n\t\tsimpleLift(control, columnHandle);\n\n\t\texpect(isDragging(columnHandle)).toBe(true);\n\t\texpect(isDragging(cardHandle)).toBe(false);\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/drag-handle/shared-behaviors/parent-rendering-should-not-kill-drag.test.tsx",
    "content": "import React from 'react';\n\nimport { render } from '@testing-library/react';\n\nimport { setup } from '../../../../../_utils/setup';\nimport App from '../../_utils/app';\nimport { type Control, forEachSensor, simpleLift } from '../../_utils/controls';\nimport { isDragging } from '../../_utils/helpers';\n\nbeforeAll(() => {\n\tsetup();\n});\n\nforEachSensor((control: Control) => {\n\tit('should not abort a drag if a parent render occurs', () => {\n\t\tconst { getByText, rerender } = render(<App />);\n\t\tconst handle: HTMLElement = getByText('item: 0');\n\n\t\tsimpleLift(control, handle);\n\t\texpect(isDragging(handle)).toBe(true);\n\n\t\trerender(<App />);\n\n\t\t// handle element is unchanged\n\t\texpect(getByText('item: 0')).toBe(handle);\n\t\t// it is still dragging\n\t\texpect(isDragging(handle)).toBe(true);\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/drag-handle/shared-behaviors/validate-controls.test.tsx",
    "content": "import React from 'react';\n\nimport { render } from '@testing-library/react';\n\nimport { setup } from '../../../../../_utils/setup';\nimport App from '../../_utils/app';\nimport { type Control, forEachSensor } from '../../_utils/controls';\nimport { getDropReason, isDragging } from '../../_utils/helpers';\n\nbeforeAll(() => {\n\tsetup();\n});\n\nforEachSensor((control: Control) => {\n\tit('should control a successful drag through the sensor', () => {\n\t\tconst onDragStart = jest.fn();\n\t\tconst onDragEnd = jest.fn();\n\t\tconst { getByText } = render(<App onDragStart={onDragStart} onDragEnd={onDragEnd} />);\n\t\tconst handle: HTMLElement = getByText('item: 0');\n\n\t\tArray.from({ length: 4 }).forEach(() => {\n\t\t\tcontrol.preLift(handle);\n\t\t\texpect(isDragging(handle)).toBe(false);\n\n\t\t\tcontrol.lift(handle);\n\t\t\texpect(isDragging(handle)).toBe(true);\n\n\t\t\t// on drag start is async\n\t\t\tjest.runOnlyPendingTimers();\n\t\t\texpect(onDragStart).toHaveBeenCalled();\n\n\t\t\t// move\n\t\t\tcontrol.move(handle);\n\t\t\texpect(isDragging(handle)).toBe(true);\n\n\t\t\t// drop\n\t\t\texpect(onDragEnd).not.toHaveBeenCalled();\n\n\t\t\tcontrol.drop(handle);\n\t\t\texpect(isDragging(handle)).toBe(false);\n\n\t\t\texpect(onDragEnd).toHaveBeenCalledTimes(1);\n\t\t\texpect(getDropReason(onDragEnd)).toBe('DROP');\n\n\t\t\tonDragEnd.mockClear();\n\t\t});\n\t});\n\n\tit('should control a cancel through the sensor', () => {\n\t\tconst onDragStart = jest.fn();\n\t\tconst onDragEnd = jest.fn();\n\t\tconst { getByText } = render(<App onDragStart={onDragStart} onDragEnd={onDragEnd} />);\n\t\tconst handle: HTMLElement = getByText('item: 0');\n\n\t\tArray.from({ length: 4 }).forEach(() => {\n\t\t\tcontrol.preLift(handle);\n\t\t\texpect(isDragging(handle)).toBe(false);\n\n\t\t\tcontrol.lift(handle);\n\t\t\texpect(isDragging(handle)).toBe(true);\n\n\t\t\t// on drag start is async\n\t\t\tjest.runOnlyPendingTimers();\n\t\t\texpect(onDragStart).toHaveBeenCalled();\n\n\t\t\t// move\n\t\t\tcontrol.move(handle);\n\t\t\texpect(isDragging(handle)).toBe(true);\n\n\t\t\tcontrol.cancel(handle);\n\n\t\t\texpect(isDragging(handle)).toBe(false);\n\t\t\texpect(onDragEnd).toHaveBeenCalledTimes(1);\n\t\t\texpect(getDropReason(onDragEnd)).toBe('CANCEL');\n\n\t\t\tonDragEnd.mockClear();\n\t\t});\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/draggable/dragging.test.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with some adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/integration/draggable/dragging.spec.js>\n\nimport React from 'react';\n\nimport { act, fireEvent, render } from '@testing-library/react';\nimport replaceRaf from 'raf-stub';\nimport type { DraggableStateSnapshot } from 'react-beautiful-dnd';\n\nimport { zIndex } from '../../../../../../src/draggable/constants';\nimport { setElementFromPoint } from '../../../../_util';\nimport App, { type RenderItem } from '../_utils/app';\nimport { mouse, simpleLift } from '../_utils/controls';\nimport { getLast, getSnapshotsFor, isDragging, renderItemAndSpy } from '../_utils/helpers';\n\nit('should move to a provided offset', () => {\n\tconst { getByText } = render(<App />);\n\tconst handle: HTMLElement = getByText('item: 0');\n\n\tsetElementFromPoint(handle);\n\tfireEvent.dragStart(handle, { clientX: 0, clientY: 5 });\n\tact(() => {\n\t\treplaceRaf();\n\t\tconst requestAnimationFrame = window.requestAnimationFrame as any;\n\t\trequestAnimationFrame.step();\n\t});\n\texpect(isDragging(handle)).toBe(true);\n\n\t// no transform as we are at {x: 0, y: 0}\n\texpect(handle.style.transform).toBe('');\n\texpect(handle.style.zIndex).toBe(`${zIndex.dragging}`);\n\n\tfireEvent.dragOver(handle, { clientX: 0, clientY: 6 });\n\tact(() => {\n\t\treplaceRaf();\n\t\tconst requestAnimationFrame = window.requestAnimationFrame as any;\n\t\trequestAnimationFrame.step();\n\t});\n\n\texpect(handle.style.transform).toBe(`translate(0px, 1px)`);\n\texpect(handle.style.zIndex).toBe(`${zIndex.dragging}`);\n});\n\nit('should pass on the snapshot', () => {\n\tconst spy = jest.fn();\n\tconst renderItem: RenderItem = renderItemAndSpy(spy);\n\n\tconst { getByText } = render(<App renderItem={renderItem} />);\n\tconst handle: HTMLElement = getByText('item: 0');\n\texpect(getSnapshotsFor('0', spy)).toHaveLength(1);\n\n\tconst cleanup = setElementFromPoint(handle);\n\n\tsimpleLift(mouse, handle);\n\texpect(isDragging(handle)).toBe(true);\n\texpect(getSnapshotsFor('0', spy)).toHaveLength(2);\n\n\t{\n\t\tconst snapshot = getLast(getSnapshotsFor('0', spy));\n\t\tconst lift: DraggableStateSnapshot = {\n\t\t\tisDragging: true,\n\t\t\tisDropAnimating: false,\n\t\t\tisClone: false,\n\t\t\tdropAnimation: null,\n\t\t\tdraggingOver: 'droppable',\n\t\t\tcombineWith: null,\n\t\t\tcombineTargetFor: null,\n\t\t\tmode: 'FLUID',\n\t\t};\n\t\texpect(snapshot).toEqual(lift);\n\t}\n\n\tsetElementFromPoint(null);\n\tfireEvent.dragLeave(handle);\n\n\t{\n\t\tconst snapshot = getLast(getSnapshotsFor('0', spy));\n\t\tconst move: DraggableStateSnapshot = {\n\t\t\tisDragging: true,\n\t\t\tisDropAnimating: false,\n\t\t\tisClone: false,\n\t\t\tdropAnimation: null,\n\t\t\t// cleared because we are not setting any dimensions and we are\n\t\t\t// no longer over anything\n\t\t\tdraggingOver: null,\n\t\t\tcombineWith: null,\n\t\t\tcombineTargetFor: null,\n\t\t\tmode: 'FLUID',\n\t\t};\n\t\texpect(snapshot).toEqual(move);\n\t}\n\n\tcleanup();\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/draggable/portal.test.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with some adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/integration/draggable/portal.spec.js>\n\nimport React from 'react';\n\nimport { render } from '@testing-library/react';\nimport type { DraggableProvided, DraggableStateSnapshot } from 'react-beautiful-dnd';\nimport ReactDOM from 'react-dom';\n\nimport { setElementFromPoint } from '../../../../_util';\nimport App, { type Item } from '../_utils/app';\nimport { mouse, simpleLift } from '../_utils/controls';\nimport { isDragging } from '../_utils/helpers';\n\nconst portal: HTMLElement = document.createElement('div');\ndocument.body.appendChild(portal);\n\nafterAll(() => {\n\tdocument.body.removeChild(portal);\n});\n\nconst renderItem =\n\t(item: Item) => (provided: DraggableProvided, snapshot: DraggableStateSnapshot) => {\n\t\tconst child = (\n\t\t\t<div\n\t\t\t\tref={provided.innerRef}\n\t\t\t\t{...provided.draggableProps}\n\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\tdata-testid={item.id}\n\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t>\n\t\t\t\tDrag me!\n\t\t\t</div>\n\t\t);\n\n\t\tif (!snapshot.isDragging) {\n\t\t\treturn child;\n\t\t}\n\n\t\treturn ReactDOM.createPortal(child, portal);\n\t};\n\nit('should allow consumers to use their own portal', () => {\n\tconst { getByTestId } = render(<App renderItem={renderItem} />);\n\tconst before: HTMLElement = getByTestId('0');\n\n\t// not in portal yet\n\texpect(before.parentElement).not.toBe(portal);\n\texpect(isDragging(before)).toBe(false);\n\n\t// moved to portal after lift\n\tsetElementFromPoint(before);\n\tsimpleLift(mouse, before);\n\tconst inPortal: HTMLElement = getByTestId('0');\n\texpect(inPortal.parentElement).toBe(portal);\n\texpect(before).not.toBe(inPortal);\n\texpect(isDragging(inPortal)).toBe(true);\n\n\t// out of portal after drop\n\tmouse.drop(inPortal);\n\tconst after: HTMLElement = getByTestId('0');\n\texpect(after.parentElement).not.toBe(portal);\n\texpect(after).not.toBe(inPortal);\n\texpect(isDragging(after)).toBe(false);\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/draggable/resting.test.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with some adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/integration/draggable/resting.spec.js>\n\nimport React from 'react';\n\nimport { render } from '@testing-library/react';\nimport type { DraggableRubric } from 'react-beautiful-dnd';\n\nimport App, { type Item, type RenderItem } from '../_utils/app';\nimport { atRest, getRubricsFor, getSnapshotsFor, renderItemAndSpy } from '../_utils/helpers';\n\nit('should have no movement when at rest', () => {\n\tconst { getByText } = render(<App />);\n\tconst handle: HTMLElement = getByText('item: 0');\n\n\texpect(handle.style.transform).toBe('');\n\texpect(handle.style.transition).toBe('');\n\texpect(handle.style.zIndex).toBe('');\n});\n\nit('should have a resting snapshot', () => {\n\tconst snapshotSpy = jest.fn();\n\tconst renderItem: RenderItem = renderItemAndSpy(snapshotSpy);\n\n\trender(<App renderItem={renderItem} />);\n\n\tconst snapshots = getSnapshotsFor('0', snapshotSpy);\n\texpect(snapshots).toHaveLength(1);\n\texpect(snapshots[0]).toEqual(atRest);\n});\n\nit('should be provided with its rubric', () => {\n\tconst watcher = jest.fn();\n\tconst items = Array.from(\n\t\t{ length: 3 },\n\t\t(v, k): Item => ({\n\t\t\tid: `${k}`,\n\t\t}),\n\t);\n\tconst renderItem: RenderItem = renderItemAndSpy(watcher);\n\n\trender(<App renderItem={renderItem} items={items} />);\n\n\titems.forEach((item: Item, index: number) => {\n\t\tconst expected: DraggableRubric = {\n\t\t\tdraggableId: item.id,\n\t\t\ttype: 'DEFAULT',\n\t\t\tsource: {\n\t\t\t\tdroppableId: 'droppable',\n\t\t\t\tindex,\n\t\t\t},\n\t\t};\n\t\tconst rubrics: DraggableRubric[] = getRubricsFor(item.id, watcher);\n\n\t\texpect(rubrics).toHaveLength(1);\n\t\texpect(rubrics[0]).toEqual(expected);\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/draggable/validation.test.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with some adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/integration/draggable/validation.spec.js>\n\nimport React from 'react';\n\nimport { render } from '@testing-library/react';\nimport type { DraggableProvided, DroppableProvided } from 'react-beautiful-dnd';\n\nimport { DragDropContext, Draggable, Droppable } from '../../../../../../src';\n\nconst noop = () => {};\n\nconst error = jest.spyOn(console, 'error').mockImplementation(noop);\nconst warn = jest.spyOn(console, 'warn').mockImplementation(noop);\n\nafterEach(() => {\n\terror.mockClear();\n\twarn.mockClear();\n});\n\nit('should throw if innerRef is not provided', () => {\n\tfunction App() {\n\t\treturn (\n\t\t\t<DragDropContext onDragEnd={() => {}}>\n\t\t\t\t<Droppable droppableId=\"droppable\">\n\t\t\t\t\t{(droppableProvided: DroppableProvided) => (\n\t\t\t\t\t\t<div ref={droppableProvided.innerRef} {...droppableProvided.droppableProps}>\n\t\t\t\t\t\t\t<Draggable draggableId=\"draggable\" index={0}>\n\t\t\t\t\t\t\t\t{(provided: DraggableProvided) => (\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t/* not providing a ref */\n\t\t\t\t\t\t\t\t\t\t/* ref={provided.innerRef} */\n\t\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\tDrag me!\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t\t{droppableProvided.placeholder}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</Droppable>\n\t\t\t</DragDropContext>\n\t\t);\n\t}\n\n\texpect(() => render(<App />)).toThrow();\n});\n\nit('should throw if innerRef is an SVG', () => {\n\tfunction App() {\n\t\treturn (\n\t\t\t<DragDropContext onDragEnd={() => {}}>\n\t\t\t\t<Droppable droppableId=\"droppable\">\n\t\t\t\t\t{(droppableProvided: DroppableProvided) => (\n\t\t\t\t\t\t<div ref={droppableProvided.innerRef} {...droppableProvided.droppableProps}>\n\t\t\t\t\t\t\t<Draggable draggableId=\"draggable\" index={0}>\n\t\t\t\t\t\t\t\t{(provided: DraggableProvided) => (\n\t\t\t\t\t\t\t\t\t<svg\n\t\t\t\t\t\t\t\t\t\t// @ts-expect-error - invalid ref type\n\t\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\tDrag me!\n\t\t\t\t\t\t\t\t\t</svg>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t\t{droppableProvided.placeholder}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</Droppable>\n\t\t\t</DragDropContext>\n\t\t);\n\t}\n\n\texpect(() => render(<App />)).toThrow();\n});\n\nit('should throw if no drag handle props are applied', () => {\n\tfunction App() {\n\t\treturn (\n\t\t\t<DragDropContext onDragEnd={() => {}}>\n\t\t\t\t<Droppable droppableId=\"droppable\">\n\t\t\t\t\t{(droppableProvided: DroppableProvided) => (\n\t\t\t\t\t\t<div ref={droppableProvided.innerRef} {...droppableProvided.droppableProps}>\n\t\t\t\t\t\t\t<Draggable draggableId=\"draggable\" index={0}>\n\t\t\t\t\t\t\t\t{(provided: DraggableProvided) => (\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t\t/* not being applied */\n\t\t\t\t\t\t\t\t\t\t/* {...dragProvided.dragHandleProps} */\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\tDrag me!\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t\t{droppableProvided.placeholder}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</Droppable>\n\t\t\t</DragDropContext>\n\t\t);\n\t}\n\n\texpect(() => render(<App />)).toThrow();\n});\n\nit('should not throw if the draggable is disabled as there will be no drag handle', () => {\n\tfunction App() {\n\t\treturn (\n\t\t\t<DragDropContext onDragEnd={() => {}}>\n\t\t\t\t<Droppable droppableId=\"droppable\">\n\t\t\t\t\t{(droppableProvided: DroppableProvided) => (\n\t\t\t\t\t\t<div ref={droppableProvided.innerRef} {...droppableProvided.droppableProps}>\n\t\t\t\t\t\t\t<Draggable draggableId=\"draggable\" index={0} isDragDisabled>\n\t\t\t\t\t\t\t\t{(provided: DraggableProvided) => (\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\tDrag me!\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t\t{droppableProvided.placeholder}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</Droppable>\n\t\t\t</DragDropContext>\n\t\t);\n\t}\n\n\texpect(() => render(<App />)).not.toThrow();\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/droppable/_placeholder.test.tsx",
    "content": "/**\n * The original `react-beautiful-dnd` tests were located at:\n * <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/integration/droppable/placeholder.spec.js>\n *\n * These tests have been distributed elsewhere, because placeholders in the\n * migration layer are intended to work a bit differently.\n *\n * Actual placeholders are rendered by `<Draggable>` and not through the\n * `placeholder` provided by a `<Droppable>`.\n *\n * The `placeholder` provided by `<Droppable>` is instead used to provide\n * a drop indicator.\n *\n * The tests for these have been derived from the original `react-beautiful-dnd`\n * tests and are located at:\n *\n * - `__tests__/unit/draggable/placeholder.test.tsx`\n * - `__tests__/unit/droppable/drop-indicator.test.tsx`\n */\n\nexport {};\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/droppable/clone.test.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with some adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/integration/droppable/clone.spec.js>\n\nimport React from 'react';\n\nimport { fireEvent, render } from '@testing-library/react';\nimport type { DraggableStateSnapshot } from 'react-beautiful-dnd';\nimport invariant from 'tiny-invariant';\n\nimport { setElementFromPoint } from '../../../../_util';\nimport App, { type RenderItem } from '../_utils/app';\nimport { forEachSensor, mouse, simpleLift } from '../_utils/controls';\nimport {\n\ttype Call,\n\tgetCallsFor,\n\tgetLast,\n\tisClone,\n\tisDragging,\n\trenderItemAndSpy,\n} from '../_utils/helpers';\n\nHTMLElement.prototype.scrollIntoView = jest.fn();\n\n/**\n * These tests originally used only the keyboard.\n *\n * In the port they now use both types of control.\n */\n\nforEachSensor((control) => {\n\tit('should no longer render the original draggable while dragging', () => {\n\t\tconst { getByTestId } = render(<App useClone />);\n\n\t\t// doing this in a loop to ensure that multiple reorders is fine\n\t\tArray.from({ length: 4 }).forEach(() => {\n\t\t\tconst beforeLift = getByTestId('0');\n\t\t\tsetElementFromPoint(beforeLift);\n\t\t\tsimpleLift(control, beforeLift);\n\t\t\texpect(isClone(beforeLift)).toBe(false);\n\n\t\t\t// after lift there is still only one item - but it is different\n\t\t\tconst clone = getByTestId('0');\n\t\t\texpect(clone).not.toBe(beforeLift);\n\t\t\texpect(isClone(clone)).toBe(true);\n\t\t\texpect(isDragging(clone)).toBe(true);\n\n\t\t\tcontrol.drop(clone);\n\n\t\t\tconst finished = getByTestId('0');\n\t\t\texpect(finished).not.toBe(clone);\n\t\t\texpect(isClone(finished)).toBe(false);\n\t\t\texpect(isDragging(finished)).toBe(false);\n\t\t});\n\t});\n\n\tit('should render a dragging item into the container', () => {\n\t\tinvariant(document.body);\n\n\t\t// default location is the body\n\t\t{\n\t\t\tconst { unmount, getByTestId } = render(<App useClone />);\n\t\t\tsetElementFromPoint(getByTestId('0'));\n\t\t\tsimpleLift(control, getByTestId('0'));\n\t\t\texpect(getByTestId('0').parentElement).toBe(document.body);\n\t\t\tunmount();\n\t\t}\n\t\t{\n\t\t\tconst element: HTMLElement = document.createElement('div');\n\t\t\tdocument.body.appendChild(element);\n\t\t\tconst { unmount, getByTestId } = render(\n\t\t\t\t<App useClone getContainerForClone={() => element} />,\n\t\t\t);\n\t\t\tsetElementFromPoint(getByTestId('0'));\n\t\t\tsimpleLift(control, getByTestId('0'));\n\t\t\texpect(getByTestId('0').parentElement).toBe(element);\n\t\t\tunmount();\n\t\t}\n\t});\n\n\tit('should give the clone the starting location', () => {\n\t\tconst spy = jest.fn();\n\t\tconst renderItem: RenderItem = renderItemAndSpy(spy);\n\t\tconst { getByTestId } = render(<App renderItem={renderItem} useClone />);\n\n\t\tsetElementFromPoint(getByTestId('1'));\n\t\tsimpleLift(control, getByTestId('1'));\n\n\t\tconst last: Call | null = getLast(getCallsFor('1', spy));\n\t\tinvariant(last);\n\t\tconst expected: DraggableStateSnapshot = {\n\t\t\tisClone: true,\n\t\t\tisDragging: true,\n\t\t\tisDropAnimating: false,\n\t\t\tdropAnimation: null,\n\t\t\tcombineTargetFor: null,\n\t\t\tcombineWith: null,\n\t\t\tdraggingOver: 'droppable',\n\t\t\tmode: control === mouse ? 'FLUID' : 'SNAP',\n\t\t};\n\t\texpect(last[1]).toEqual(expected);\n\t});\n\n\t/**\n\t * This test doesn't make as much sense for the migration layer,\n\t * because there is no drop animation.\n\t */\n\tit('should allow reordering other items when dropping', () => {\n\t\tconst { getByTestId } = render(<App useClone />);\n\n\t\tsetElementFromPoint(getByTestId('0'));\n\t\tsimpleLift(control, getByTestId('0'));\n\n\t\tconst clone: HTMLElement = getByTestId('0');\n\t\texpect(isClone(clone)).toBe(true);\n\t\texpect(isDragging(clone)).toBe(true);\n\n\t\t// move item 0 to index 1\n\t\tfireEvent.dragEnter(getByTestId('1'));\n\n\t\t// drop started, but still occurring\n\t\tcontrol.drop(clone);\n\n\t\t// starting a new drag with item 1 (which is in index 0 visually now)\n\t\tsetElementFromPoint(getByTestId('1'));\n\t\tsimpleLift(control, getByTestId('1'));\n\n\t\texpect(isDragging(getByTestId('1'))).toBe(true);\n\t\texpect(isDragging(getByTestId('0'))).toBe(false);\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/reorder-render-sync.test.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with major adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/integration/reorder-render-sync.spec.js>\n\nimport React, { memo, useCallback, useState } from 'react';\n\nimport { act, fireEvent, render } from '@testing-library/react';\nimport { replaceRaf } from 'raf-stub';\nimport type { DraggableProvided, DroppableProvided, DropResult } from 'react-beautiful-dnd';\n\nimport * as closestEdge from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';\n\nimport { DragDropContext, Draggable, Droppable } from '../../../../../src';\nimport { setElementFromPoint } from '../../../_util';\n\nimport { keyboard, mouse, simpleLift } from './_utils/controls';\n\nconst extractClosestEdge = jest.spyOn(closestEdge, 'extractClosestEdge');\n\ntype Task = {\n\tid: string;\n\tonRender: jest.Mock;\n};\n\ntype TaskItemProps = {\n\ttask: Task;\n\tprovided: DraggableProvided;\n};\n\nfunction TaskItem({ task, provided }: TaskItemProps) {\n\ttask.onRender();\n\treturn (\n\t\t<div\n\t\t\tdata-testid=\"drag-handle\"\n\t\t\tref={provided.innerRef}\n\t\t\t{...provided.draggableProps}\n\t\t\t{...provided.dragHandleProps}\n\t\t>\n\t\t\t<h4>{task.id}</h4>\n\t\t</div>\n\t);\n}\n\ntype InnerListProps = {\n\ttasks: Task[];\n};\n\nconst InnerList = memo(function InnerList({ tasks }: InnerListProps) {\n\treturn (\n\t\t<>\n\t\t\t{tasks.map((task: Task, index: number) => (\n\t\t\t\t<Draggable draggableId={task.id} index={index} key={task.id}>\n\t\t\t\t\t{(draggableProvided: DraggableProvided) => (\n\t\t\t\t\t\t<TaskItem task={task} provided={draggableProvided} />\n\t\t\t\t\t)}\n\t\t\t\t</Draggable>\n\t\t\t))}\n\t\t</>\n\t);\n});\n\nconst first: Task = {\n\tid: 'first',\n\tonRender: jest.fn(),\n};\n\nconst second: Task = {\n\tid: 'second',\n\tonRender: jest.fn(),\n};\n\nconst initial: Task[] = [first, second];\n\nfunction App() {\n\tconst [tasks, setTasks] = useState(initial);\n\n\tconst onDragEnd = useCallback((result: DropResult) => {\n\t\tif (!result.destination) {\n\t\t\treturn;\n\t\t}\n\t\tconst startIndex = result.source.index;\n\t\tconst finishIndex = result.destination.index;\n\n\t\tsetTasks((tasks) => {\n\t\t\treturn reorder({\n\t\t\t\tlist: tasks,\n\t\t\t\tstartIndex,\n\t\t\t\tfinishIndex,\n\t\t\t});\n\t\t});\n\t}, []);\n\n\treturn (\n\t\t<DragDropContext onDragEnd={onDragEnd}>\n\t\t\t<Droppable droppableId=\"droppable\">\n\t\t\t\t{(droppableProvided: DroppableProvided) => (\n\t\t\t\t\t<div ref={droppableProvided.innerRef} {...droppableProvided.droppableProps}>\n\t\t\t\t\t\t<InnerList tasks={tasks} />\n\t\t\t\t\t\t{droppableProvided.placeholder}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n\nbeforeAll(() => {\n\t/**\n\t * Jest does not implement `scrollIntoView` so we have to mock it.\n\t */\n\tHTMLElement.prototype.scrollIntoView = jest.fn();\n});\n\nconst cases = [\n\t{ id: 'mouse', control: mouse },\n\t{ id: 'keyboard', control: keyboard },\n] as const;\n\ncases.forEach(({ id, control }) => {\n\tit(`should call the onBeforeDragStart before connected components are updated, and onDragStart after (${id})`, async () => {\n\t\tjest.useFakeTimers({ legacyFakeTimers: true });\n\t\treplaceRaf();\n\t\tconst clearRenderMocks = () => {\n\t\t\tfirst.onRender.mockClear();\n\t\t\tsecond.onRender.mockClear();\n\t\t};\n\n\t\tconst { getAllByTestId, unmount } = render(<App />);\n\n\t\t// clearing the initial render before a drag\n\t\texpect(first.onRender).toHaveBeenCalledTimes(1);\n\t\texpect(second.onRender).toHaveBeenCalledTimes(1);\n\t\tclearRenderMocks();\n\n\t\t// start a drag\n\t\tconst handle: HTMLElement = getAllByTestId('drag-handle')[0];\n\t\tsetElementFromPoint(handle);\n\t\tsimpleLift(control, handle);\n\n\t\t// flushing onDragStart\n\t\tjest.runOnlyPendingTimers();\n\n\t\t// initial lift will render the first item\n\t\texpect(first.onRender).toHaveBeenCalledTimes(1);\n\t\t/**\n\t\t * ORIGINAL TEST:\n\t\t * ```\n\t\t * // it will also render the second item as it needs to be pushed down\n\t\t * expect(second.onRender).toHaveBeenCalledTimes(1);\n\t\t * ```\n\t\t *\n\t\t * In the migration layer, there is no visual shift, so no rerender is needed.\n\t\t */\n\t\texpect(second.onRender).toHaveBeenCalledTimes(0);\n\t\tclearRenderMocks();\n\n\t\t// Move down\n\t\tif (control === keyboard) {\n\t\t\tawait act(async () => {\n\t\t\t\tfireEvent.keyDown(handle, { key: 'ArrowDown' });\n\t\t\t\t/**\n\t\t\t\t * The keyboard update will fire synchronously.\n\t\t\t\t *\n\t\t\t\t * The keyboard drag preview will update after a microtask.\n\t\t\t\t */\n\t\t\t\tawait 'microtask';\n\t\t\t});\n\t\t} else if (control === mouse) {\n\t\t\textractClosestEdge.mockReturnValue('bottom');\n\t\t\tact(() => {\n\t\t\t\tfireEvent.dragOver(getAllByTestId('drag-handle')[1]);\n\t\t\t\t/**\n\t\t\t\t * Stepping an animation frame to trigger the update from pdnd core.\n\t\t\t\t *\n\t\t\t\t * The mouse drag preview will update synchronously after receiving\n\t\t\t\t * the update.\n\t\t\t\t */\n\t\t\t\t// @ts-expect-error\n\t\t\t\trequestAnimationFrame.step();\n\t\t\t});\n\t\t}\n\n\t\t// item1: moving down\n\t\t// item2: moving up\n\t\texpect(first.onRender).toHaveBeenCalledTimes(1);\n\t\t/**\n\t\t * ORIGINAL TEST:\n\t\t * ```\n\t\t * expect(second.onRender).toHaveBeenCalledTimes(1);\n\t\t * ```\n\t\t *\n\t\t * In the migration layer, there is no visual shift, so no rerender is needed.\n\t\t */\n\t\texpect(second.onRender).toHaveBeenCalledTimes(0);\n\t\tclearRenderMocks();\n\n\t\t// drop (there is no animation because already in the home spot)\n\t\tcontrol.drop(handle);\n\n\t\t// only a single render for the reorder and connected component update\n\t\texpect(first.onRender).toHaveBeenCalledTimes(1);\n\t\texpect(second.onRender).toHaveBeenCalledTimes(1);\n\n\t\t// checking for no post renders\n\t\tclearRenderMocks();\n\t\t// @ts-expect-error\n\t\trequestAnimationFrame.flush();\n\t\tjest.runAllTimers();\n\t\texpect(first.onRender).toHaveBeenCalledTimes(0);\n\t\texpect(second.onRender).toHaveBeenCalledTimes(0);\n\n\t\tunmount();\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/responders-integration.test.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with some adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/integration/responders-integration.spec.js>\n\nimport React from 'react';\n\nimport { fireEvent, render, type RenderResult } from '@testing-library/react';\nimport replaceRaf from 'raf-stub';\nimport type {\n\tBeforeCapture,\n\tDraggableId,\n\tDraggableLocation,\n\tDraggableProvided,\n\tDragStart,\n\tDroppableId,\n\tDroppableProvided,\n\tDropResult,\n\tResponders,\n} from 'react-beautiful-dnd';\nimport invariant from 'tiny-invariant';\n\nimport { DragDropContext, Draggable, Droppable } from '../../../../../src';\nimport { setElementFromPoint } from '../../../_util';\n\nimport { mouse, simpleLift } from './_utils/controls';\n\nconst sloppyClickThreshold = 5;\n\nconst draggableId: DraggableId = 'drag-1';\nconst droppableId: DroppableId = 'drop-1';\n\ntype Props = {\n\tresponders: Responders;\n};\n\nfunction App({ responders }: Props) {\n\treturn (\n\t\t<DragDropContext\n\t\t\tonBeforeCapture={responders.onBeforeCapture}\n\t\t\tonBeforeDragStart={responders.onBeforeDragStart}\n\t\t\tonDragStart={responders.onDragStart}\n\t\t\tonDragUpdate={responders.onDragUpdate}\n\t\t\tonDragEnd={responders.onDragEnd}\n\t\t>\n\t\t\t<Droppable droppableId={droppableId}>\n\t\t\t\t{(droppableProvided: DroppableProvided) => (\n\t\t\t\t\t<div ref={droppableProvided.innerRef} {...droppableProvided.droppableProps}>\n\t\t\t\t\t\t<h2>Droppable</h2>\n\t\t\t\t\t\t<Draggable draggableId={draggableId} index={0}>\n\t\t\t\t\t\t\t{(draggableProvided: DraggableProvided) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tdata-testid=\"drag-handle\"\n\t\t\t\t\t\t\t\t\tref={draggableProvided.innerRef}\n\t\t\t\t\t\t\t\t\t{...draggableProvided.draggableProps}\n\t\t\t\t\t\t\t\t\t{...draggableProvided.dragHandleProps}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<h4>Draggable</h4>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n\n// eslint-disable-next-line @atlassian/a11y/require-jest-coverage\ndescribe('responders integration', () => {\n\tlet responders: Responders;\n\tlet wrapper: RenderResult;\n\n\tbeforeEach(() => {\n\t\tjest.useFakeTimers();\n\t\tresponders = {\n\t\t\tonBeforeCapture: jest.fn(),\n\t\t\tonBeforeDragStart: jest.fn(),\n\t\t\tonDragStart: jest.fn(),\n\t\t\tonDragUpdate: jest.fn(),\n\t\t\tonDragEnd: jest.fn(),\n\t\t};\n\t\twrapper = render(<App responders={responders} />);\n\t\t// unmounting during a drag can cause a warning\n\t\tjest.spyOn(console, 'warn').mockImplementation(() => {});\n\t});\n\n\tafterEach(() => {\n\t\t// clean up any loose events\n\t\twrapper.unmount();\n\t\tjest.useRealTimers();\n\n\t\t// @ts-expect-error - mock\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn.mockRestore();\n\t});\n\n\tconst drag = (() => {\n\t\tfunction getHandle(): HTMLElement {\n\t\t\tconst handle: HTMLElement = wrapper.getByTestId('drag-handle');\n\t\t\treturn handle;\n\t\t}\n\n\t\tconst start = () => {\n\t\t\tsetElementFromPoint(getHandle());\n\t\t\tsimpleLift(mouse, getHandle());\n\n\t\t\t// movements are scheduled in an animation frame\n\t\t\treplaceRaf();\n\t\t\tconst requestAnimationFrame = window.requestAnimationFrame as any;\n\t\t\trequestAnimationFrame.step();\n\n\t\t\t// drag start responder is scheduled with setTimeout\n\t\t\tjest.runOnlyPendingTimers();\n\t\t};\n\n\t\tconst move = () => {\n\t\t\tfireEvent.drag(getHandle(), {\n\t\t\t\tx: 0,\n\t\t\t\ty: sloppyClickThreshold + 2,\n\t\t\t});\n\n\t\t\t// movements are scheduled in an animation frame\n\t\t\treplaceRaf();\n\t\t\tconst requestAnimationFrame = window.requestAnimationFrame as any;\n\t\t\trequestAnimationFrame.step();\n\t\t\t// responder updates are scheduled with setTimeout\n\t\t\tjest.runOnlyPendingTimers();\n\t\t};\n\n\t\tconst stop = () => {\n\t\t\tmouse.drop(getHandle());\n\t\t\tsetElementFromPoint(document.body);\n\n\t\t\t// movements are scheduled in an animation frame\n\t\t\treplaceRaf();\n\t\t\tconst requestAnimationFrame = window.requestAnimationFrame as any;\n\t\t\trequestAnimationFrame.step();\n\t\t};\n\n\t\tconst cancel = () => {\n\t\t\tmouse.cancel(getHandle());\n\t\t\tsetElementFromPoint(document.body);\n\t\t};\n\n\t\tconst perform = () => {\n\t\t\tstart();\n\t\t\tmove();\n\t\t\tstop();\n\t\t};\n\n\t\treturn { start, move, stop, cancel, perform };\n\t})();\n\n\tconst expected = (() => {\n\t\tconst source: DraggableLocation = {\n\t\t\tdroppableId,\n\t\t\tindex: 0,\n\t\t};\n\n\t\tconst start: DragStart = {\n\t\t\tdraggableId,\n\t\t\ttype: 'DEFAULT',\n\t\t\tsource,\n\t\t\tmode: 'FLUID',\n\t\t};\n\n\t\t// Unless we do some more hardcore stubbing\n\t\t// both completed and cancelled look the same.\n\t\t// Ideally we would move one item below another\n\t\tconst completed: DropResult = {\n\t\t\t...start,\n\t\t\t// did not move anywhere\n\t\t\tdestination: source,\n\t\t\tcombine: null,\n\t\t\treason: 'DROP',\n\t\t};\n\n\t\tconst cancelled: DropResult = {\n\t\t\t...start,\n\t\t\tdestination: null,\n\t\t\tcombine: null,\n\t\t\treason: 'CANCEL',\n\t\t};\n\n\t\tconst beforeCapture: BeforeCapture = {\n\t\t\tdraggableId: start.draggableId,\n\t\t\tmode: 'FLUID',\n\t\t};\n\n\t\treturn { beforeCapture, start, completed, cancelled };\n\t})();\n\n\tconst wasOnBeforeCaptureCalled = (\n\t\tamountOfDrags: number = 1,\n\t\tprovided: Responders = responders,\n\t) => {\n\t\tinvariant(provided.onBeforeCapture);\n\t\texpect(provided.onBeforeCapture).toHaveBeenCalledTimes(amountOfDrags);\n\t\t// @ts-expect-error - mock property\n\t\texpect(provided.onBeforeCapture.mock.calls[amountOfDrags - 1][0]).toEqual(\n\t\t\texpected.beforeCapture,\n\t\t);\n\t};\n\n\tconst wasOnBeforeDragCalled = (amountOfDrags: number = 1, provided: Responders = responders) => {\n\t\tinvariant(provided.onBeforeDragStart);\n\t\texpect(provided.onBeforeDragStart).toHaveBeenCalledTimes(amountOfDrags);\n\t\t// @ts-expect-error - mock property\n\t\texpect(provided.onBeforeDragStart.mock.calls[amountOfDrags - 1][0]).toEqual(expected.start);\n\t};\n\n\tconst wasDragStarted = (amountOfDrags: number = 1, provided: Responders = responders) => {\n\t\tinvariant(\n\t\t\tprovided.onDragStart,\n\t\t\t'cannot validate if drag was started without onDragStart responder',\n\t\t);\n\t\texpect(provided.onDragStart).toHaveBeenCalledTimes(amountOfDrags);\n\t\t// @ts-expect-error - mock property\n\t\texpect(provided.onDragStart.mock.calls[amountOfDrags - 1][0]).toEqual(expected.start);\n\t};\n\n\tconst wasDragCompleted = (amountOfDrags: number = 1, provided: Responders = responders) => {\n\t\texpect(provided.onDragEnd).toHaveBeenCalledTimes(amountOfDrags);\n\t\t// @ts-expect-error - mock\n\t\texpect(provided.onDragEnd.mock.calls[amountOfDrags - 1][0]).toEqual(expected.completed);\n\t};\n\n\tconst wasDragCancelled = (amountOfDrags: number = 1) => {\n\t\texpect(responders.onDragEnd).toHaveBeenCalledTimes(amountOfDrags);\n\t\t// @ts-expect-error - mock\n\t\texpect(responders.onDragEnd.mock.calls[amountOfDrags - 1][0]).toEqual(expected.cancelled);\n\t};\n\n\tdescribe('before capture', () => {\n\t\tit('should call the onBeforeDragCapture responder just before the drag starts', () => {\n\t\t\tdrag.start();\n\n\t\t\twasOnBeforeCaptureCalled();\n\n\t\t\t// cleanup\n\t\t\tdrag.stop();\n\t\t});\n\t});\n\n\tdescribe('before drag start', () => {\n\t\tit('should call the onBeforeDragStart responder just before the drag starts', () => {\n\t\t\tdrag.start();\n\n\t\t\twasOnBeforeDragCalled();\n\n\t\t\t// cleanup\n\t\t\tdrag.stop();\n\t\t});\n\n\t\tit('should not call onDragStart while the drag is occurring', () => {\n\t\t\tdrag.start();\n\n\t\t\twasOnBeforeDragCalled();\n\n\t\t\tdrag.move();\n\n\t\t\t// should not have called on drag start again\n\t\t\texpect(responders.onBeforeDragStart).toHaveBeenCalledTimes(1);\n\n\t\t\t// cleanup\n\t\t\tdrag.stop();\n\t\t});\n\t});\n\n\tdescribe('drag start', () => {\n\t\tit('should call the onDragStart responder when a drag starts', () => {\n\t\t\tdrag.start();\n\n\t\t\twasDragStarted();\n\n\t\t\t// cleanup\n\t\t\tdrag.stop();\n\t\t});\n\n\t\tit('should not call onDragStart while the drag is occurring', () => {\n\t\t\tdrag.start();\n\n\t\t\twasDragStarted();\n\n\t\t\tdrag.move();\n\n\t\t\t// should not have called on drag start again\n\t\t\texpect(responders.onDragStart).toHaveBeenCalledTimes(1);\n\n\t\t\t// cleanup\n\t\t\tdrag.stop();\n\t\t});\n\t});\n\n\tdescribe('drag end', () => {\n\t\tit('should call the onDragEnd responder when a drag ends', () => {\n\t\t\tdrag.perform();\n\t\t\twasDragCompleted();\n\t\t});\n\n\t\tit('should call the onDragEnd responder when a drag ends when instantly stopped', () => {\n\t\t\tdrag.start();\n\t\t\tdrag.stop();\n\n\t\t\twasDragCompleted();\n\t\t});\n\t});\n\n\tdescribe('drag cancel', () => {\n\t\tit('should call onDragEnd when a drag is canceled', () => {\n\t\t\tdrag.start();\n\t\t\tdrag.move();\n\t\t\tdrag.cancel();\n\n\t\t\twasDragCancelled();\n\t\t});\n\n\t\tit('should call onDragEnd when a drag is canceled instantly', () => {\n\t\t\tdrag.start();\n\t\t\tdrag.cancel();\n\n\t\t\twasDragCancelled();\n\t\t});\n\t});\n\n\tdescribe('unmounted mid drag', () => {\n\t\tit('should cancel a drag if unmounted mid drag', () => {\n\t\t\tdrag.start();\n\n\t\t\twrapper.unmount();\n\n\t\t\twasDragCancelled();\n\t\t});\n\t});\n\n\tdescribe('subsequent drags', () => {\n\t\tit('should publish subsequent drags', () => {\n\t\t\tdrag.perform();\n\t\t\twasDragStarted(1);\n\t\t\twasDragCompleted(1);\n\n\t\t\tdrag.perform();\n\t\t\twasDragStarted(2);\n\t\t\twasDragCompleted(2);\n\t\t});\n\n\t\tit('should publish subsequent drags after a cancel', () => {\n\t\t\tdrag.start();\n\t\t\tdrag.cancel();\n\t\t\twasOnBeforeDragCalled(1);\n\t\t\twasDragStarted(1);\n\t\t\twasDragCancelled(1);\n\n\t\t\tdrag.perform();\n\t\t\twasOnBeforeDragCalled(2);\n\t\t\twasDragStarted(2);\n\t\t\twasDragCompleted(2);\n\t\t});\n\t});\n\n\tdescribe('dynamic responders', () => {\n\t\tconst setResponders = (provided: Responders) => {\n\t\t\twrapper.rerender(<App responders={provided} />);\n\t\t};\n\n\t\tit('should allow you to change responders before a drag started', () => {\n\t\t\tconst newResponders: Responders = {\n\t\t\t\tonDragStart: jest.fn(),\n\t\t\t\tonDragEnd: jest.fn(),\n\t\t\t};\n\t\t\tsetResponders(newResponders);\n\n\t\t\tdrag.perform();\n\n\t\t\t// new responders called\n\t\t\twasDragStarted(1, newResponders);\n\t\t\twasDragCompleted(1, newResponders);\n\t\t\t// original responders not called\n\t\t\texpect(responders.onDragStart).not.toHaveBeenCalled();\n\t\t\texpect(responders.onDragEnd).not.toHaveBeenCalled();\n\t\t});\n\n\t\tit('should allow you to change onDragEnd during a drag', () => {\n\t\t\tconst newResponders: Responders = {\n\t\t\t\tonDragEnd: jest.fn(),\n\t\t\t};\n\n\t\t\tdrag.start();\n\t\t\t// changing the onDragEnd responder during a drag\n\t\t\tsetResponders(newResponders);\n\t\t\tdrag.stop();\n\n\t\t\twasDragStarted(1, responders);\n\t\t\t// called the new responder that was changed during a drag\n\t\t\twasDragCompleted(1, newResponders);\n\t\t\t// not calling original responder\n\t\t\texpect(responders.onDragEnd).not.toHaveBeenCalled();\n\t\t});\n\n\t\tit('should allow you to change responders between drags', () => {\n\t\t\tconst newResponders: Responders = {\n\t\t\t\tonDragStart: jest.fn(),\n\t\t\t\tonDragEnd: jest.fn(),\n\t\t\t};\n\n\t\t\t// first drag\n\t\t\tdrag.perform();\n\t\t\twasDragStarted(1, responders);\n\t\t\twasDragCompleted(1, responders);\n\n\t\t\t// second drag\n\t\t\tsetResponders(newResponders);\n\t\t\tdrag.perform();\n\n\t\t\t// new responders called for second drag\n\t\t\twasDragStarted(1, newResponders);\n\t\t\twasDragCompleted(1, newResponders);\n\t\t\t// original responders should not have been called again\n\t\t\twasDragStarted(1, responders);\n\t\t\twasDragCompleted(1, responders);\n\t\t});\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/responders-timing.test.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with some adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/integration/responders-timing.spec.js>\n\nimport React from 'react';\n\nimport { render } from '@testing-library/react';\nimport type { DraggableProvided, DroppableProvided, Responders } from 'react-beautiful-dnd';\nimport invariant from 'tiny-invariant';\n\nimport { DragDropContext, Draggable, Droppable } from '../../../../../src';\nimport { setElementFromPoint } from '../../../_util';\n\nimport { keyboard, mouse } from './_utils/controls';\n\n/**\n * This mock is required because jest does not implement `scrollIntoView`.\n */\nHTMLElement.prototype.scrollIntoView = jest.fn();\n\ntype ItemProps = {\n\tprovided: DraggableProvided;\n\tonRender: Function;\n};\n\nconst Item = ({ onRender, provided }: ItemProps) => {\n\tonRender();\n\n\treturn (\n\t\t<div\n\t\t\tdata-testid=\"drag-handle\"\n\t\t\tref={provided.innerRef}\n\t\t\t{...provided.draggableProps}\n\t\t\t{...provided.dragHandleProps}\n\t\t>\n\t\t\t<h4>Draggable</h4>\n\t\t</div>\n\t);\n};\n\nbeforeEach(() => {\n\tjest.useFakeTimers({ legacyFakeTimers: true });\n});\n\nafterEach(() => {\n\tjest.useRealTimers();\n});\n\nconst cases = [\n\t{ id: 'mouse', control: mouse },\n\t{ id: 'keyboard', control: keyboard },\n] as const;\n\ncases.forEach(({ id, control }) => {\n\tit(`should call the onBeforeDragStart before connected components are updated, and onDragStart after (${id})`, () => {\n\t\tlet onBeforeDragStartTime: DOMHighResTimeStamp | null = null;\n\t\tlet onDragStartTime: DOMHighResTimeStamp | null = null;\n\t\tlet renderTime: DOMHighResTimeStamp | null = null;\n\t\tconst responders: Responders = {\n\t\t\tonBeforeDragStart: jest.fn().mockImplementation(() => {\n\t\t\t\tinvariant(!onBeforeDragStartTime, 'onBeforeDragStartTime already set');\n\t\t\t\tonBeforeDragStartTime = performance.now();\n\t\t\t}),\n\t\t\tonDragStart: jest.fn().mockImplementation(() => {\n\t\t\t\tinvariant(!onDragStartTime, 'onDragStartTime already set');\n\t\t\t\tonDragStartTime = performance.now();\n\t\t\t}),\n\t\t\tonDragEnd: jest.fn(),\n\t\t};\n\t\tconst onItemRender = jest.fn().mockImplementation(() => {\n\t\t\tinvariant(!renderTime, 'renderTime already set');\n\t\t\trenderTime = performance.now();\n\t\t});\n\n\t\tconst { getByTestId, unmount } = render(\n\t\t\t<DragDropContext {...responders}>\n\t\t\t\t<Droppable droppableId=\"droppable\">\n\t\t\t\t\t{(droppableProvided: DroppableProvided) => (\n\t\t\t\t\t\t<div ref={droppableProvided.innerRef} {...droppableProvided.droppableProps}>\n\t\t\t\t\t\t\t<h2>Droppable</h2>\n\t\t\t\t\t\t\t<Draggable draggableId=\"draggable\" index={0}>\n\t\t\t\t\t\t\t\t{(draggableProvided: DraggableProvided) => (\n\t\t\t\t\t\t\t\t\t<Item onRender={onItemRender} provided={draggableProvided} />\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t\t{droppableProvided.placeholder}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</Droppable>\n\t\t\t</DragDropContext>,\n\t\t);\n\n\t\t// clearing the initial render before a drag\n\t\texpect(onItemRender).toHaveBeenCalledTimes(1);\n\t\trenderTime = null;\n\t\tonItemRender.mockClear();\n\n\t\t// start a drag\n\t\tconst handle: HTMLElement = getByTestId('drag-handle');\n\n\t\tsetElementFromPoint(handle);\n\t\tcontrol.lift(handle);\n\t\t// flushing onDragStart\n\t\tjest.runOnlyPendingTimers();\n\n\t\t// checking values are set\n\t\tinvariant(onBeforeDragStartTime, 'onBeforeDragStartTime should be set');\n\t\tinvariant(onDragStartTime, 'onDragStartTime should be set');\n\t\tinvariant(renderTime, 'renderTime should be set');\n\n\t\t// expected order\n\t\t// 1. onBeforeDragStart\n\t\t// 2. item render\n\t\t// 3. onDragStart\n\t\texpect(onBeforeDragStartTime).toBeLessThan(renderTime);\n\t\texpect(renderTime).toBeLessThan(onDragStartTime);\n\n\t\t// validation\n\t\texpect(responders.onBeforeDragStart).toHaveBeenCalledTimes(1);\n\t\texpect(responders.onDragStart).toHaveBeenCalledTimes(1);\n\t\texpect(onItemRender).toHaveBeenCalledTimes(1);\n\t\tunmount();\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/server-side-rendering/__snapshots__/server-rendering.test.tsx.snap",
    "content": "// Jest Snapshot v1, https://goo.gl/fbAQLP\n\nexports[`should support rendering to a string 1`] = `\"<main><div data-rbd-droppable-context-id=\"0\" data-rbd-droppable-id=\"droppable\" data-testid=\"droppable\"><div data-rbd-draggable-context-id=\"0\" data-rbd-draggable-id=\"0\" role=\"button\" aria-describedby=\"rbd-lift-instruction-0\" data-rbd-drag-handle-context-id=\"0\" data-rbd-drag-handle-draggable-id=\"0\" tabindex=\"0\" draggable=\"false\" data-is-dragging=\"false\" data-is-drop-animating=\"false\" data-is-combining=\"false\" data-is-combine-target=\"false\" data-is-clone=\"false\" data-testid=\"0\">item: <!-- -->0</div><div data-rbd-draggable-context-id=\"0\" data-rbd-draggable-id=\"1\" role=\"button\" aria-describedby=\"rbd-lift-instruction-0\" data-rbd-drag-handle-context-id=\"0\" data-rbd-drag-handle-draggable-id=\"1\" tabindex=\"0\" draggable=\"false\" data-is-dragging=\"false\" data-is-drop-animating=\"false\" data-is-combining=\"false\" data-is-combine-target=\"false\" data-is-clone=\"false\" data-testid=\"1\">item: <!-- -->1</div><div data-rbd-draggable-context-id=\"0\" data-rbd-draggable-id=\"2\" role=\"button\" aria-describedby=\"rbd-lift-instruction-0\" data-rbd-drag-handle-context-id=\"0\" data-rbd-drag-handle-draggable-id=\"2\" tabindex=\"0\" draggable=\"false\" data-is-dragging=\"false\" data-is-drop-animating=\"false\" data-is-combining=\"false\" data-is-combine-target=\"false\" data-is-clone=\"false\" data-testid=\"2\">item: <!-- -->2</div></div></main>\"`;\n\nexports[`should support rendering to static markup 1`] = `\"<main><div data-rbd-droppable-context-id=\"0\" data-rbd-droppable-id=\"droppable\" data-testid=\"droppable\"><div data-rbd-draggable-context-id=\"0\" data-rbd-draggable-id=\"0\" role=\"button\" aria-describedby=\"rbd-lift-instruction-0\" data-rbd-drag-handle-context-id=\"0\" data-rbd-drag-handle-draggable-id=\"0\" tabindex=\"0\" draggable=\"false\" data-is-dragging=\"false\" data-is-drop-animating=\"false\" data-is-combining=\"false\" data-is-combine-target=\"false\" data-is-clone=\"false\" data-testid=\"0\">item: 0</div><div data-rbd-draggable-context-id=\"0\" data-rbd-draggable-id=\"1\" role=\"button\" aria-describedby=\"rbd-lift-instruction-0\" data-rbd-drag-handle-context-id=\"0\" data-rbd-drag-handle-draggable-id=\"1\" tabindex=\"0\" draggable=\"false\" data-is-dragging=\"false\" data-is-drop-animating=\"false\" data-is-combining=\"false\" data-is-combine-target=\"false\" data-is-clone=\"false\" data-testid=\"1\">item: 1</div><div data-rbd-draggable-context-id=\"0\" data-rbd-draggable-id=\"2\" role=\"button\" aria-describedby=\"rbd-lift-instruction-0\" data-rbd-drag-handle-context-id=\"0\" data-rbd-drag-handle-draggable-id=\"2\" tabindex=\"0\" draggable=\"false\" data-is-dragging=\"false\" data-is-drop-animating=\"false\" data-is-combining=\"false\" data-is-combine-target=\"false\" data-is-clone=\"false\" data-testid=\"2\">item: 2</div></div></main>\"`;\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/server-side-rendering/client-hydration.test.tsx",
    "content": "// @flow\nimport React from 'react';\n\nimport ReactDOM from 'react-dom';\nimport ReactDOMServer from 'react-dom/server';\nimport invariant from 'tiny-invariant';\n\nimport { resetServerContext } from '../../../../../../src';\nimport App from '../_utils/app';\n\nfunction noop() {}\n\nbeforeEach(() => {\n\t// Reset server context between tests to prevent state being shared between them\n\tresetServerContext();\n});\n\n// Checking that the browser globals are available in this test file\ninvariant(\n\ttypeof window !== 'undefined' && typeof document !== 'undefined',\n\t'browser globals not found in jsdom test',\n);\n\nit('should support hydrating a server side rendered application', () => {\n\t// would be done server side\n\t// we need to mock out the warnings caused by useLayoutEffect\n\t// This will not happen on the client as the string is rendered\n\t// on the server\n\tconst error = jest.spyOn(console, 'error').mockImplementation(noop);\n\n\tresetServerContext();\n\tconst serverHTML: string = ReactDOMServer.renderToString(<App />);\n\n\terror.mock.calls.forEach((call) => {\n\t\texpect(call[0].includes('Warning: useLayoutEffect does nothing on the server')).toBe(true);\n\t});\n\terror.mockRestore();\n\n\t// would be done client side\n\t// would have a fresh server context on the client\n\tresetServerContext();\n\tconst el = document.createElement('div');\n\tel.innerHTML = serverHTML;\n\tdocument.body.appendChild(el);\n\n\texpect(() => ReactDOM.hydrate(<App />, el)).not.toThrow();\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/integration/server-side-rendering/server-rendering.test.tsx",
    "content": "/**\n * @jest-environment node\n */\nimport React from 'react';\n\nimport { renderToStaticMarkup, renderToString } from 'react-dom/server';\nimport invariant from 'tiny-invariant';\n\nimport { resetServerContext } from '../../../../../../src';\nimport App from '../_utils/app';\n\nconst consoleFunctions = [\n\tjest.spyOn(console, 'warn'),\n\tjest.spyOn(console, 'error'),\n\tjest.spyOn(console, 'log'),\n];\n\nbeforeEach(() => {\n\t// Reset server context between tests to prevent state being shared between them\n\tresetServerContext();\n});\n\nafterEach(() => {\n\tconsoleFunctions.forEach((fn) => {\n\t\tfn.mockRestore();\n\t});\n});\n\nconst expectConsoleNotCalled = () => {\n\tconsoleFunctions.forEach((fn) => {\n\t\texpect(fn).not.toHaveBeenCalled();\n\t});\n};\n\n// Checking that the browser globals are not available in this test file\ninvariant(\n\ttypeof window === 'undefined' && typeof document === 'undefined',\n\t'browser globals found in node test',\n);\n\nit('should support rendering to a string', async () => {\n\tconst result: string = renderToString(<App />);\n\n\texpect(result).toEqual(expect.any(String));\n\texpect(result).toMatchSnapshot();\n\texpectConsoleNotCalled();\n});\n\nit('should support rendering to static markup', async () => {\n\tconst result: string = renderToStaticMarkup(<App />);\n\n\texpect(result).toEqual(expect.any(String));\n\texpect(result).toMatchSnapshot();\n\texpectConsoleNotCalled();\n});\n\nit('should render identical content when resetting context between renders', async () => {\n\tconst firstRender = renderToString(<App />);\n\tconst nextRenderBeforeReset = renderToString(<App />);\n\texpect(firstRender).not.toEqual(nextRenderBeforeReset);\n\n\tresetServerContext();\n\tconst nextRenderAfterReset = renderToString(<App />);\n\texpect(firstRender).toEqual(nextRenderAfterReset);\n\texpectConsoleNotCalled();\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/state/middleware/responders/abort.test.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with major adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/state/middleware/responders/abort.spec.js>\n\nimport React from 'react';\n\nimport { fireEvent, render } from '@testing-library/react';\nimport type { DragDropContextProps, DropResult } from 'react-beautiful-dnd';\n\nimport * as closestEdge from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { DragDropContext, Draggable, Droppable } from '../../../../../../../src';\nimport { setElementFromPoint } from '../../../../../_util';\nimport { mouse } from '../../../integration/_utils/controls';\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nconst extractClosestEdge = jest.spyOn(closestEdge, 'extractClosestEdge');\n\nfunction App(props: Partial<DragDropContextProps>) {\n\treturn (\n\t\t<DragDropContext onDragEnd={() => {}} {...props}>\n\t\t\t<Droppable droppableId=\"droppable\">\n\t\t\t\t{(provided) => (\n\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t\t<Draggable draggableId=\"draggable-0\" index={0}>\n\t\t\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tfirst\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t<Draggable draggableId=\"draggable-1\" index={1}>\n\t\t\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tsecond\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n\njest.useFakeTimers();\n\nit('should call onDragEnd with the last published critical descriptor', () => {\n\tconst onDragStart = jest.fn();\n\tconst onDragEnd = jest.fn();\n\n\tconst { getByText } = render(<App onDragStart={onDragStart} onDragEnd={onDragEnd} />);\n\n\tconst draggable = getByText('first');\n\n\tsetElementFromPoint(draggable);\n\tmouse.lift(draggable);\n\n\tjest.runOnlyPendingTimers();\n\texpect(onDragStart).toHaveBeenCalledTimes(1);\n\n\tmouse.cancel(draggable);\n\n\tconst expected: DropResult = {\n\t\ttype: 'DEFAULT',\n\t\tmode: 'FLUID',\n\t\tdraggableId: 'draggable-0',\n\t\tsource: {\n\t\t\tdroppableId: 'droppable',\n\t\t\tindex: 0,\n\t\t},\n\t\tdestination: null,\n\t\tcombine: null,\n\t\treason: 'CANCEL',\n\t};\n\texpect(onDragEnd).toHaveBeenCalledWith(expected, expect.any(Object));\n});\n\nit('should publish an onDragEnd with no destination even if there is a current destination', () => {\n\tconst onDragStart = jest.fn();\n\tconst onDragUpdate = jest.fn();\n\tconst onDragEnd = jest.fn();\n\n\tconst { getByText } = render(\n\t\t<App onDragStart={onDragStart} onDragUpdate={onDragUpdate} onDragEnd={onDragEnd} />,\n\t);\n\n\tconst draggable = getByText('first');\n\n\tsetElementFromPoint(draggable);\n\tmouse.lift(draggable);\n\n\tjest.runOnlyPendingTimers();\n\texpect(onDragStart).toHaveBeenCalledTimes(1);\n\n\textractClosestEdge.mockReturnValue('bottom');\n\tfireEvent.dragOver(getByText('second'));\n\tjest.runOnlyPendingTimers();\n\texpect(onDragUpdate).toHaveBeenCalledWith(\n\t\texpect.objectContaining({\n\t\t\tdestination: {\n\t\t\t\tdroppableId: 'droppable',\n\t\t\t\tindex: 1,\n\t\t\t},\n\t\t}),\n\t\texpect.any(Object),\n\t);\n\n\tmouse.cancel(draggable);\n\tconst expected: DropResult = {\n\t\ttype: 'DEFAULT',\n\t\tmode: 'FLUID',\n\t\tdraggableId: 'draggable-0',\n\t\tsource: {\n\t\t\tdroppableId: 'droppable',\n\t\t\tindex: 0,\n\t\t},\n\t\tdestination: null,\n\t\tcombine: null,\n\t\treason: 'CANCEL',\n\t};\n\texpect(onDragEnd).toHaveBeenCalledWith(expected, expect.any(Object));\n});\n\nit('should not publish an onDragEnd if aborted after a drop', () => {\n\tconst onDragStart = jest.fn();\n\tconst onDragUpdate = jest.fn();\n\tconst onDragEnd = jest.fn();\n\n\tconst { getByText } = render(\n\t\t<App onDragStart={onDragStart} onDragUpdate={onDragUpdate} onDragEnd={onDragEnd} />,\n\t);\n\n\tconst draggable = getByText('first');\n\n\tsetElementFromPoint(draggable);\n\tmouse.lift(draggable);\n\n\tjest.runOnlyPendingTimers();\n\texpect(onDragStart).toHaveBeenCalledTimes(1);\n\n\tmouse.cancel(draggable);\n\texpect(onDragEnd).toHaveBeenCalledTimes(1);\n\n\tonDragEnd.mockReset();\n\n\tmouse.cancel(draggable);\n\texpect(onDragEnd).not.toHaveBeenCalled();\n});\n\nit('should publish an onDragEnd if aborted before the publish of an onDragStart', () => {\n\tconst onDragEnd = jest.fn();\n\tconst onDragStart = jest.fn();\n\n\tconst { getByText } = render(<App onDragEnd={onDragEnd} onDragStart={onDragStart} />);\n\n\tconst firstItem = getByText('first');\n\n\tsetElementFromPoint(firstItem);\n\tmouse.lift(firstItem);\n\n\texpect(onDragStart).not.toHaveBeenCalled();\n\n\tfireEvent.dragEnd(firstItem);\n\n\texpect(onDragStart).toHaveBeenCalled();\n\texpect(onDragEnd).toHaveBeenCalled();\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/state/middleware/responders/announcements.test.tsx",
    "content": "import React from 'react';\n\nimport { fireEvent, render, type RenderResult } from '@testing-library/react';\nimport type { DragStart, DragUpdate, ResponderProvided } from 'react-beautiful-dnd';\nimport invariant from 'tiny-invariant';\n\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport * as liveRegion from '../../../../../../../src/drag-drop-context/live-region';\nimport * as screenReader from '../../../../../../../src/drag-drop-context/screen-reader';\nimport { Board } from '../../../../../_utils/board';\nimport { keyboard } from '../../../integration/_utils/controls';\nimport { isDragging } from '../../../integration/_utils/helpers';\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nconst { getDefaultMessage } = screenReader;\n\nconst announce = jest.spyOn(liveRegion, 'announce');\n\nbeforeAll(() => {\n\t/**\n\t * Jest does not implement `scrollIntoView` so we have to mock it.\n\t */\n\tHTMLElement.prototype.scrollIntoView = jest.fn();\n});\n\njest.useFakeTimers();\n\ntype Case = {\n\tresponder: 'onDragStart' | 'onDragUpdate' | 'onDragEnd';\n\tdescription?: string;\n\texecute: (renderResult: RenderResult) => void;\n\tdefaultMessage: string;\n};\n\nfunction getDragStart(): DragStart {\n\treturn {\n\t\tdraggableId: 'A0',\n\t\tmode: 'SNAP',\n\t\ttype: 'DEFAULT',\n\t\tsource: {\n\t\t\tdroppableId: 'A',\n\t\t\tindex: 0,\n\t\t},\n\t};\n}\n\nconst moveForwardUpdate: DragUpdate = {\n\t...getDragStart(),\n\tdestination: {\n\t\tdroppableId: 'A',\n\t\tindex: 1,\n\t},\n\tcombine: null,\n};\n\nconst start = ({ getByTestId }: RenderResult) => {\n\tconst handle = getByTestId('A0');\n\tkeyboard.lift(handle);\n\n\texpect(isDragging(handle)).toBe(true);\n\n\t// release async responder\n\tjest.runOnlyPendingTimers();\n};\n\nconst update = ({ getByTestId }: RenderResult) => {\n\tconst handle = getByTestId('A0');\n\tfireEvent.keyDown(handle, { key: 'ArrowDown' });\n\n\t// release async responder\n\tjest.runOnlyPendingTimers();\n};\n\nconst end = ({ getByTestId }: RenderResult) => {\n\tconst handle = getByTestId('A0');\n\tfireEvent.keyDown(handle, { key: ' ' });\n};\n\nconst cases: Case[] = [\n\t{\n\t\tresponder: 'onDragStart',\n\t\texecute: (renderResult: RenderResult) => {\n\t\t\tstart(renderResult);\n\t\t},\n\t\tdefaultMessage: getDefaultMessage('onDragStart', getDragStart()),\n\t},\n\t{\n\t\tresponder: 'onDragUpdate',\n\t\tdescription: 'a reorder update',\n\t\texecute: (renderResult: RenderResult) => {\n\t\t\tstart(renderResult);\n\t\t\tupdate(renderResult);\n\t\t},\n\t\tdefaultMessage: getDefaultMessage('onDragUpdate', moveForwardUpdate),\n\t},\n\t{\n\t\tresponder: 'onDragEnd',\n\t\texecute: (renderResult: RenderResult) => {\n\t\t\tstart(renderResult);\n\t\t\tupdate(renderResult);\n\t\t\tend(renderResult);\n\t\t},\n\t\tdefaultMessage: getDefaultMessage('onDragEnd', {\n\t\t\t...moveForwardUpdate,\n\t\t\treason: 'DROP',\n\t\t}),\n\t},\n];\n\ncases.forEach((current: Case) => {\n\tdescribe(`for responder: ${current.responder}${\n\t\tcurrent.description ? `: ${current.description}` : ''\n\t}`, () => {\n\t\tbeforeEach(() => {\n\t\t\tannounce.mockClear();\n\t\t});\n\n\t\tit('should announce with the default message if no responder is provided', () => {\n\t\t\t// This test is not relevant for onDragEnd as it must always be provided\n\t\t\tif (current.responder === 'onDragEnd') {\n\t\t\t\texpect(true).toBe(true);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst renderResult = render(<Board />);\n\n\t\t\tcurrent.execute(renderResult);\n\t\t\texpect(announce).toHaveBeenCalledWith(current.defaultMessage);\n\t\t});\n\n\t\tit('should announce with the default message if the responder does not announce', () => {\n\t\t\tconst responders = {\n\t\t\t\t[current.responder]() {},\n\t\t\t};\n\t\t\tconst renderResult = render(<Board {...responders} />);\n\n\t\t\tcurrent.execute(renderResult);\n\t\t\texpect(announce).toHaveBeenCalledWith(current.defaultMessage);\n\t\t});\n\n\t\tit('should not announce twice if the responder makes an announcement', () => {\n\t\t\tconst responders = {\n\t\t\t\t[current.responder]: jest.fn((data: any, provided: ResponderProvided) => {\n\t\t\t\t\tprovided.announce('hello');\n\t\t\t\t}),\n\t\t\t};\n\t\t\tconst renderResult = render(<Board {...responders} />);\n\n\t\t\tcurrent.execute(renderResult);\n\n\t\t\texpect(announce).toHaveBeenCalledWith('hello');\n\t\t\texpect(announce).not.toHaveBeenCalledWith(current.defaultMessage);\n\t\t});\n\n\t\tit('should prevent async announcements', () => {\n\t\t\tconst warn = jest.spyOn(console, 'warn').mockImplementation(() => {});\n\n\t\t\tlet provided: ResponderProvided;\n\t\t\tconst responders = {\n\t\t\t\t[current.responder]: jest.fn((data: any, supplied: ResponderProvided) => {\n\t\t\t\t\tannounce.mockReset();\n\t\t\t\t\tprovided = supplied;\n\t\t\t\t}),\n\t\t\t};\n\n\t\t\tconst renderResult = render(<Board {...responders} />);\n\n\t\t\tcurrent.execute(renderResult);\n\n\t\t\t// We did not announce so it would have been called with the default message\n\t\t\texpect(announce).toHaveBeenCalledWith(current.defaultMessage);\n\t\t\texpect(announce).toHaveBeenCalledTimes(1);\n\t\t\texpect(warn).not.toHaveBeenCalled();\n\t\t\tannounce.mockReset();\n\n\t\t\t// perform an async message\n\t\t\tsetTimeout(() => provided.announce('async message'));\n\t\t\tjest.runOnlyPendingTimers();\n\n\t\t\texpect(announce).not.toHaveBeenCalled();\n\t\t\texpect(warn).toHaveBeenCalled();\n\n\t\t\t// cleanup\n\t\t\twarn.mockRestore();\n\t\t});\n\n\t\tit('should prevent multiple announcement calls from a consumer', () => {\n\t\t\tconst warn = jest.spyOn(console, 'warn').mockImplementation(() => {});\n\n\t\t\tlet provided: ResponderProvided;\n\t\t\tconst responders = {\n\t\t\t\t[current.responder]: jest.fn((data: any, supplied: ResponderProvided) => {\n\t\t\t\t\tannounce.mockReset();\n\t\t\t\t\tprovided = supplied;\n\t\t\t\t\tprovided.announce('hello');\n\t\t\t\t}),\n\t\t\t};\n\n\t\t\tconst renderResult = render(<Board {...responders} />);\n\n\t\t\tcurrent.execute(renderResult);\n\n\t\t\texpect(announce).toHaveBeenCalledWith('hello');\n\t\t\texpect(announce).toHaveBeenCalledTimes(1);\n\t\t\texpect(warn).not.toHaveBeenCalled();\n\t\t\tannounce.mockReset();\n\n\t\t\t// perform another announcement\n\t\t\tinvariant(provided!, 'provided is not set');\n\t\t\tprovided.announce('another one');\n\n\t\t\texpect(announce).not.toHaveBeenCalled();\n\t\t\texpect(warn).toHaveBeenCalled();\n\n\t\t\twarn.mockRestore();\n\t\t});\n\n\t\tif (current.responder === 'onDragEnd') {\n\t\t\t/**\n\t\t\t * Running A11Y test only for one case to avoid redundancy and last case only as other tests using\n\t\t\t * `runOnlyPendingTimers` would fail with another async test.\n\t\t\t */\n\t\t\tit('should capture and report a11y violations', async () => {\n\t\t\t\tconst { container } = render(<Board />);\n\n\t\t\t\tawait expect(container).toBeAccessible();\n\t\t\t});\n\t\t}\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/state/middleware/responders/flushing.test.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with major adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/state/middleware/responders/flushing.spec.js>\n\nimport React from 'react';\n\nimport { fireEvent, render } from '@testing-library/react';\nimport type { DragDropContextProps, DropResult } from 'react-beautiful-dnd';\n\nimport * as closestEdge from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { DragDropContext, Draggable, Droppable } from '../../../../../../../src';\nimport { getPlaceholder, setElementFromPoint } from '../../../../../_util';\nimport { mouse } from '../../../integration/_utils/controls';\n\nfunction App(props: Partial<DragDropContextProps>) {\n\treturn (\n\t\t<DragDropContext onDragEnd={() => {}} {...props}>\n\t\t\t<Droppable droppableId=\"droppable\">\n\t\t\t\t{(provided) => (\n\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t\t<Draggable draggableId=\"draggable-0\" index={0}>\n\t\t\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tfirst\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t<Draggable draggableId=\"draggable-1\" index={1}>\n\t\t\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tsecond\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n\njest.useFakeTimers();\n\nconst extractClosestEdge = jest.spyOn(closestEdge, 'extractClosestEdge');\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nafterEach(() => {\n\tmouse.cancel(document.body);\n});\n\nit('should trigger an on drag start after in the next cycle', () => {\n\tconst onDragStart = jest.fn();\n\n\tconst { getByText } = render(<App onDragStart={onDragStart} />);\n\n\tconst draggable = getByText('first');\n\n\tsetElementFromPoint(draggable);\n\tmouse.lift(draggable);\n\n\texpect(onDragStart).not.toHaveBeenCalled();\n\n\tjest.runOnlyPendingTimers();\n\texpect(onDragStart).toHaveBeenCalledTimes(1);\n});\n\nit('should queue a drag start if an action comes in while the timeout is pending', () => {\n\tconst onDragStart = jest.fn();\n\tconst onDragUpdate = jest.fn();\n\n\tconst { getByText } = render(<App onDragStart={onDragStart} onDragUpdate={onDragUpdate} />);\n\n\tconst draggable = getByText('first');\n\n\tsetElementFromPoint(draggable);\n\tmouse.lift(draggable);\n\n\textractClosestEdge.mockReturnValue('bottom');\n\tfireEvent.dragOver(getByText('second'));\n\n\texpect(onDragStart).not.toHaveBeenCalled();\n\texpect(onDragUpdate).not.toHaveBeenCalled();\n\n\tjest.runOnlyPendingTimers();\n\n\texpect(onDragStart).toHaveBeenCalledTimes(1);\n\texpect(onDragUpdate).toHaveBeenCalledTimes(1);\n});\n\nit('should flush any pending responders if a drop occurs', () => {\n\tconst onDragStart = jest.fn();\n\tconst onDragUpdate = jest.fn();\n\tconst onDragEnd = jest.fn();\n\n\tconst { getByText } = render(\n\t\t<App onDragStart={onDragStart} onDragUpdate={onDragUpdate} onDragEnd={onDragEnd} />,\n\t);\n\n\tconst draggable = getByText('first');\n\n\tsetElementFromPoint(draggable);\n\tmouse.lift(draggable);\n\n\texpect(onDragStart).not.toHaveBeenCalled();\n\texpect(onDragUpdate).not.toHaveBeenCalled();\n\n\textractClosestEdge.mockReturnValue('bottom');\n\tfireEvent.dragOver(getByText('second'));\n\texpect(onDragStart).not.toHaveBeenCalled();\n\texpect(onDragUpdate).not.toHaveBeenCalled();\n\n\textractClosestEdge.mockReturnValue('top');\n\t// Need to drag over the placeholder because the item is being dragged\n\tfireEvent.dragOver(getPlaceholder());\n\texpect(onDragStart).not.toHaveBeenCalled();\n\texpect(onDragUpdate).not.toHaveBeenCalled();\n\n\tmouse.drop(draggable);\n\n\texpect(onDragStart).toHaveBeenCalledTimes(1);\n\texpect(onDragUpdate).toHaveBeenCalledTimes(2);\n\n\tconst expectedResult: DropResult = {\n\t\tdraggableId: 'draggable-0',\n\t\tmode: 'FLUID',\n\t\ttype: 'DEFAULT',\n\t\tsource: {\n\t\t\tdroppableId: 'droppable',\n\t\t\tindex: 0,\n\t\t},\n\t\tdestination: {\n\t\t\tdroppableId: 'droppable',\n\t\t\tindex: 0,\n\t\t},\n\t\tcombine: null,\n\t\treason: 'DROP',\n\t};\n\n\texpect(onDragEnd).toHaveBeenCalledWith(expectedResult, expect.any(Object));\n});\n\nit('should work across multiple drags', () => {\n\tconst onDragStart = jest.fn();\n\tconst onDragUpdate = jest.fn();\n\tconst onDragEnd = jest.fn();\n\n\tconst { getByText } = render(\n\t\t<App onDragStart={onDragStart} onDragUpdate={onDragUpdate} onDragEnd={onDragEnd} />,\n\t);\n\n\tfor (let i = 0; i < 4; i++) {\n\t\tconst draggable = getByText('first');\n\n\t\tsetElementFromPoint(draggable);\n\t\tmouse.lift(draggable);\n\n\t\texpect(onDragStart).not.toHaveBeenCalled();\n\t\texpect(onDragUpdate).not.toHaveBeenCalled();\n\n\t\textractClosestEdge.mockReturnValue('bottom');\n\t\tfireEvent.dragOver(getByText('second'));\n\t\texpect(onDragStart).not.toHaveBeenCalled();\n\t\texpect(onDragUpdate).not.toHaveBeenCalled();\n\n\t\tmouse.drop(draggable);\n\n\t\texpect(onDragStart).toHaveBeenCalledTimes(1);\n\t\texpect(onDragUpdate).toHaveBeenCalledTimes(1);\n\n\t\tconst expectedResult: DropResult = {\n\t\t\tdraggableId: 'draggable-0',\n\t\t\tmode: 'FLUID',\n\t\t\ttype: 'DEFAULT',\n\t\t\tsource: {\n\t\t\t\tdroppableId: 'droppable',\n\t\t\t\tindex: 0,\n\t\t\t},\n\t\t\tdestination: {\n\t\t\t\tdroppableId: 'droppable',\n\t\t\t\tindex: 1,\n\t\t\t},\n\t\t\tcombine: null,\n\t\t\treason: 'DROP',\n\t\t};\n\n\t\texpect(onDragEnd).toHaveBeenCalledWith(expectedResult, expect.any(Object));\n\n\t\tonDragStart.mockReset();\n\t\tonDragUpdate.mockReset();\n\t\tonDragEnd.mockReset();\n\t}\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/state/middleware/responders/repeated-use.test.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with major adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/state/middleware/responders/repeated-use.spec.js>\n\nimport React from 'react';\n\nimport { fireEvent, render } from '@testing-library/react';\nimport type { DragDropContextProps, DragStart, DragUpdate, DropResult } from 'react-beautiful-dnd';\n\nimport * as closestEdge from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\n\nimport { DragDropContext, Draggable, Droppable } from '../../../../../../../src';\nimport { setElementFromPoint } from '../../../../../_util';\nimport { mouse } from '../../../integration/_utils/controls';\n\njest.useFakeTimers();\n\nconst extractClosestEdge = jest.spyOn(closestEdge, 'extractClosestEdge');\n\nfunction App(props: Partial<DragDropContextProps>) {\n\treturn (\n\t\t<DragDropContext onDragEnd={() => {}} {...props}>\n\t\t\t<Droppable droppableId=\"droppable\">\n\t\t\t\t{(provided) => (\n\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t\t<Draggable draggableId=\"draggable-0\" index={0}>\n\t\t\t\t\t\t\t{(provided, snapshot) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tfirst\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t<Draggable draggableId=\"draggable-1\" index={1}>\n\t\t\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tsecond\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n\nconst expectedDragStart: DragStart = {\n\tmode: 'FLUID',\n\ttype: 'DEFAULT',\n\tdraggableId: 'draggable-0',\n\tsource: {\n\t\tdroppableId: 'droppable',\n\t\tindex: 0,\n\t},\n};\n\nit('should behave correctly across multiple drags', () => {\n\tconst onDragStart = jest.fn();\n\tconst onDragUpdate = jest.fn();\n\tconst onDragEnd = jest.fn();\n\n\tconst { getByText } = render(\n\t\t<App onDragStart={onDragStart} onDragUpdate={onDragUpdate} onDragEnd={onDragEnd} />,\n\t);\n\n\tfor (let i = 0; i < 4; i++) {\n\t\tconst draggable = getByText('first');\n\n\t\t// Start the drag\n\t\tsetElementFromPoint(draggable);\n\t\tmouse.lift(draggable);\n\t\tjest.runOnlyPendingTimers();\n\t\texpect(onDragStart).toHaveBeenCalledWith(expectedDragStart, expect.any(Object));\n\n\t\t// Update the drag\n\t\textractClosestEdge.mockReturnValue('bottom');\n\t\tfireEvent.dragOver(getByText('second'));\n\t\tjest.runOnlyPendingTimers();\n\t\tconst expectedDragUpdate: DragUpdate = {\n\t\t\t...expectedDragStart,\n\t\t\tdestination: {\n\t\t\t\tdroppableId: 'droppable',\n\t\t\t\tindex: 1,\n\t\t\t},\n\t\t\tcombine: null,\n\t\t};\n\t\texpect(onDragUpdate).toHaveBeenCalledWith(expectedDragUpdate, expect.any(Object));\n\t\texpect(onDragUpdate).toHaveBeenCalledTimes(1);\n\n\t\t// Drop\n\t\tconst expectedDropResult: DropResult = {\n\t\t\t...expectedDragUpdate,\n\t\t\treason: 'DROP',\n\t\t};\n\t\tmouse.drop(draggable);\n\t\texpect(onDragEnd).toHaveBeenCalledWith(expectedDropResult, expect.any(Object));\n\t\texpect(onDragEnd).toHaveBeenCalledTimes(1);\n\n\t\tonDragStart.mockReset();\n\t\tonDragUpdate.mockReset();\n\t\tonDragEnd.mockReset();\n\t}\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/state/middleware/responders/start.test.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with major adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/state/middleware/responders/start.spec.js>\n\nimport React from 'react';\n\nimport { render } from '@testing-library/react';\nimport type { DragDropContextProps, DragStart } from 'react-beautiful-dnd';\n\nimport { skipAutoA11yFile } from '@atlassian/a11y-jest-testing';\n\nimport { DragDropContext, Draggable, Droppable } from '../../../../../../../src';\nimport { setElementFromPoint } from '../../../../../_util';\nimport { mouse } from '../../../integration/_utils/controls';\nimport { isDragging } from '../../../integration/_utils/helpers';\n\n// This file exposes one or more accessibility violations. Testing is currently skipped but violations need to\n// be fixed in a timely manner or result in escalation. Once all violations have been fixed, you can remove\n// the next line and associated import. For more information, see go/afm-a11y-tooling:jest\nskipAutoA11yFile();\n\nfunction App(props: Partial<DragDropContextProps>) {\n\treturn (\n\t\t<DragDropContext onDragEnd={() => {}} {...props}>\n\t\t\t<Droppable droppableId=\"droppable\">\n\t\t\t\t{(provided) => (\n\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t\t<Draggable draggableId=\"draggable-0\" index={0}>\n\t\t\t\t\t\t\t{(provided, snapshot) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tfirst\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t<Draggable draggableId=\"draggable-1\" index={1}>\n\t\t\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tsecond\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n\nconst expectedDragStart: DragStart = {\n\tmode: 'FLUID',\n\ttype: 'DEFAULT',\n\tdraggableId: 'draggable-0',\n\tsource: {\n\t\tdroppableId: 'droppable',\n\t\tindex: 0,\n\t},\n};\n\njest.useFakeTimers();\n\nafterEach(() => {\n\tmouse.cancel(document.body);\n});\n\nit('should call the onDragStart responder when a initial publish occurs', () => {\n\tconst onDragStart = jest.fn();\n\n\tconst { getByText } = render(<App onDragStart={onDragStart} />);\n\n\tconst draggable = getByText('first');\n\n\tsetElementFromPoint(draggable);\n\tmouse.lift(draggable);\n\n\texpect(onDragStart).not.toHaveBeenCalled();\n\n\tjest.runOnlyPendingTimers();\n\n\texpect(onDragStart).toHaveBeenCalledWith(expectedDragStart, expect.any(Object));\n});\n\nit('should call the onBeforeDragStart and onDragStart in the correct order', () => {\n\tconst onBeforeDragStart = jest.fn();\n\tconst onDragStart = jest.fn();\n\n\tconst { getByText } = render(\n\t\t<App onBeforeDragStart={onBeforeDragStart} onDragStart={onDragStart} />,\n\t);\n\n\tconst draggable = getByText('first');\n\n\tsetElementFromPoint(draggable);\n\tmouse.lift(draggable);\n\n\texpect(onBeforeDragStart).toHaveBeenCalledWith(expectedDragStart);\n\texpect(onDragStart).not.toHaveBeenCalled();\n\n\tjest.runOnlyPendingTimers();\n\texpect(onBeforeDragStart).toHaveBeenCalledTimes(1);\n\texpect(onDragStart).toHaveBeenCalledTimes(1);\n});\n\n// original test was to throw an exception, not ignore\n// but this would be handled by @atlaskit/pragmatic-drag-and-drop and not something we'd know about\nit('should not call onDragStart if a dragStart event occurs before a drag ends', () => {\n\tconst onDragStart = jest.fn();\n\n\tconst { getByText } = render(<App onDragStart={onDragStart} />);\n\n\tconst draggable = getByText('first');\n\n\tsetElementFromPoint(draggable);\n\tmouse.lift(draggable);\n\texpect(isDragging(draggable)).toBe(true);\n\n\tjest.runOnlyPendingTimers();\n\texpect(onDragStart).toHaveBeenCalled();\n\n\tonDragStart.mockReset();\n\tmouse.lift(getByText('second'));\n\tjest.runOnlyPendingTimers();\n\texpect(isDragging(draggable)).toBe(true);\n\texpect(isDragging(getByText('second'))).toBe(false);\n\texpect(onDragStart).not.toHaveBeenCalled();\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/state/middleware/responders/update.test.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with major adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/state/middleware/responders/update.spec.js>\n\nimport React from 'react';\n\nimport { fireEvent, render } from '@testing-library/react';\n\nimport * as closestEdge from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\n\nimport { DragDropContext, Draggable, Droppable } from '../../../../../../../src';\nimport { setElementFromPoint } from '../../../../../_util';\nimport { mouse } from '../../../integration/_utils/controls';\nimport { isDragging } from '../../../integration/_utils/helpers';\n\nconst extractClosestEdge = jest.spyOn(closestEdge, 'extractClosestEdge');\n\ndescribe('onDragUpdate()', () => {\n\tconst items = Array.from({ length: 2 }, (_, index) => ({\n\t\tdraggableId: `draggable-${index}`,\n\t\tspy: jest.fn(),\n\t}));\n\n\tconst onDragUpdate = jest.fn();\n\n\tfunction App() {\n\t\treturn (\n\t\t\t<DragDropContext onDragEnd={() => {}} onDragUpdate={onDragUpdate}>\n\t\t\t\t<Droppable droppableId=\"droppable\">\n\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t\t\t{items.map(({ draggableId, spy }, index) => (\n\t\t\t\t\t\t\t\t<Draggable key={draggableId} draggableId={draggableId} index={index}>\n\t\t\t\t\t\t\t\t\t{(provided, snapshot, rubric) => {\n\t\t\t\t\t\t\t\t\t\tspy(provided, snapshot, rubric);\n\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t\t\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{draggableId}\n\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t</div>\n\t\t\t\t\t)}\n\t\t\t\t</Droppable>\n\t\t\t</DragDropContext>\n\t\t);\n\t}\n\n\tafterEach(() => {\n\t\tmouse.cancel(document.body);\n\t\tonDragUpdate.mockClear();\n\t});\n\n\tit('should capture and report a11y violations', async () => {\n\t\tjest.useFakeTimers({ legacyFakeTimers: true });\n\t\tconst { container } = render(<App />);\n\n\t\tawait expect(container).toBeAccessible();\n\t});\n\n\tit('should be called if the position has changed on move', () => {\n\t\tjest.useFakeTimers({ legacyFakeTimers: true });\n\n\t\tconst { getByText } = render(<App />);\n\n\t\tconst firstItem = getByText('draggable-0');\n\t\tconst secondItem = getByText('draggable-1');\n\n\t\tsetElementFromPoint(firstItem);\n\t\tmouse.lift(firstItem);\n\n\t\texpect(isDragging(firstItem)).toBe(true);\n\t\texpect(onDragUpdate).not.toHaveBeenCalled();\n\n\t\tsetElementFromPoint(secondItem);\n\t\textractClosestEdge.mockReturnValue('bottom');\n\t\tfireEvent.dragOver(secondItem);\n\n\t\t// flush the onDragUpdate queue\n\t\tjest.runOnlyPendingTimers();\n\n\t\texpect(onDragUpdate).toHaveBeenCalledTimes(1);\n\t\texpect(onDragUpdate).toHaveBeenCalledWith(\n\t\t\t{\n\t\t\t\tdraggableId: 'draggable-0',\n\t\t\t\tsource: { droppableId: 'droppable', index: 0 },\n\t\t\t\tdestination: { droppableId: 'droppable', index: 1 },\n\t\t\t\tcombine: null,\n\t\t\t\tmode: 'FLUID',\n\t\t\t\ttype: 'DEFAULT',\n\t\t\t},\n\t\t\texpect.any(Object),\n\t\t);\n\n\t\tjest.useRealTimers();\n\t});\n\n\tit('should not call onDragUpdate if there is no movement from the last update', () => {\n\t\tconst { getByText } = render(<App />);\n\n\t\tconst firstItem = getByText('draggable-0');\n\n\t\tsetElementFromPoint(firstItem);\n\t\tmouse.lift(firstItem);\n\n\t\texpect(isDragging(firstItem)).toBe(true);\n\t\texpect(onDragUpdate).not.toHaveBeenCalled();\n\n\t\tfireEvent.dragOver(firstItem);\n\t\texpect(onDragUpdate).not.toHaveBeenCalled();\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/view/droppable/inner-ref-validation.test.tsx",
    "content": "// This file was copied from `react-beautiful-dnd` with some adjustments.\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/test/unit/view/droppable/inner-ref-validation.spec.js>\n\nimport React from 'react';\n\nimport { render } from '@testing-library/react';\nimport type { DroppableProvided } from 'react-beautiful-dnd';\n\nimport { DragDropContext, Droppable } from '../../../../../../src';\n\njest.spyOn(console, 'error').mockImplementation(() => {});\n\nafterAll(() => {\n\t// @ts-expect-error\n\t// eslint-disable-next-line no-console\n\tconsole.error.mockReset();\n});\n\nit('should throw if consumer has not provided a ref', () => {\n\tconst NoRef = ({ provided }: { provided: DroppableProvided }) => (\n\t\t<div {...provided.droppableProps}>Hello there {provided.placeholder}</div>\n\t);\n\n\texpect(() =>\n\t\trender(\n\t\t\t<DragDropContext onDragEnd={() => {}}>\n\t\t\t\t<Droppable droppableId=\"droppable\">{(provided) => <NoRef provided={provided} />}</Droppable>\n\t\t\t</DragDropContext>,\n\t\t),\n\t).toThrow();\n});\n\nit('should throw if consumer has provided an SVGElement', () => {\n\tconst WithSVG = ({ provided }: { provided: DroppableProvided }) => (\n\t\t// @ts-expect-error - TS is correctly stating this is not a HTMLElement\n\t\t<svg {...provided.droppableProps} ref={provided.innerRef}>\n\t\t\tHello there {provided.placeholder}\n\t\t</svg>\n\t);\n\n\texpect(() =>\n\t\trender(\n\t\t\t<DragDropContext onDragEnd={() => {}}>\n\t\t\t\t<Droppable droppableId=\"droppable\">\n\t\t\t\t\t{(provided) => <WithSVG provided={provided} />}\n\t\t\t\t</Droppable>\n\t\t\t</DragDropContext>,\n\t\t),\n\t).toThrow();\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/view/style-marshal/get-styles.test.tsx",
    "content": "import stylelint from 'stylelint';\n\nimport { getDragHandleRuleString } from '../../../../../../src/drag-drop-context/hooks/use-style-marshal';\n\nit('should generate valid styles', () => {\n\treturn stylelint\n\t\t.lint({\n\t\t\tcode: getDragHandleRuleString('0'),\n\t\t\tconfig: {\n\t\t\t\t// just using the recommended config as it only checks for errors and not formatting\n\t\t\t\textends: ['stylelint-config-recommended'],\n\t\t\t\t// basic semi colon rules\n\t\t\t\trules: {\n\t\t\t\t\t'no-extra-semicolons': true,\n\t\t\t\t\t'declaration-block-semicolon-space-after': 'always-single-line',\n\t\t\t\t},\n\t\t\t},\n\t\t})\n\t\t.then((result) => {\n\t\t\texpect(result.errored).toBe(false);\n\t\t\t// asserting that some CSS was actually generated!\n\t\t\t// @ts-expect-error\n\t\t\texpect(result.results[0]._postcssResult.css.length).toBeGreaterThan(1);\n\t\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/ported-from-react-beautiful-dnd/unit/view/style-marshal/style-marshal.test.tsx",
    "content": "/**\n * These tests are loosely ported from `react-beautiful-dnd`.\n *\n * They were originally written as white box tests, and tested the style\n * marshal directly.\n *\n * They've been rewritten as black box tests that only use the public API.\n *\n * Many of them have also been removed due to simplifications in the\n * style marshal.\n */\n\nimport React from 'react';\n\nimport { render } from '@testing-library/react';\nimport type { ContextId } from 'react-beautiful-dnd';\nimport invariant from 'tiny-invariant';\n\nimport { DragDropContext, Draggable, Droppable } from '../../../../../../src';\n\nfunction getStyleTagSelector(contextId: ContextId) {\n\treturn `style[data-rbd-style-context-id=\"${contextId}\"]`;\n}\n\nconst getStyleTag = (contextId: ContextId): HTMLStyleElement => {\n\tconst selector: string = getStyleTagSelector(contextId);\n\tconst el = document.querySelector(selector);\n\tinvariant(el instanceof HTMLStyleElement, 'expected style tag should exist');\n\treturn el;\n};\n\nfunction App({ nonce }: { nonce?: string }) {\n\treturn (\n\t\t<DragDropContext onDragEnd={() => {}} nonce={nonce}>\n\t\t\t<Droppable droppableId=\"droppable\">\n\t\t\t\t{(provided) => (\n\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t\t<Draggable draggableId=\"draggable\" index={0}>\n\t\t\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\tDraggable\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n\nlet instanceId = 0;\nfunction renderApp(args?: { nonce?: string }) {\n\tconst { nonce } = args ?? {};\n\tconst wrapper = render(<App nonce={nonce} />);\n\treturn { ...wrapper, contextId: String(instanceId++) };\n}\n\nit('should not mount style tags until mounted', () => {\n\t// // initially there is no style tag\n\texpect(document.head.childElementCount).toBe(0);\n\n\t// now mounting\n\tconst { contextId, unmount } = renderApp();\n\n\tconst selector: string = getStyleTagSelector(contextId);\n\n\t// elements should now exist\n\texpect(document.querySelector(selector)).toBeInstanceOf(HTMLStyleElement);\n\n\tunmount();\n});\n\nit('should remove the style tag from the head when unmounting', () => {\n\tconst { contextId, unmount } = renderApp();\n\tconst selector: string = getStyleTagSelector(contextId);\n\n\t// the style tag exists\n\texpect(document.querySelector(selector)).toBeTruthy();\n\n\t// now unmounted\n\tunmount();\n\n\texpect(document.querySelector(selector)).not.toBeTruthy();\n});\n\nit('should have the expected styles', () => {\n\tconst { contextId, unmount } = renderApp();\n\n\tconst styleTag = getStyleTag(contextId);\n\texpect(styleTag.innerHTML).toMatchInlineSnapshot(\n\t\t`\"[data-rbd-drag-handle-context-id=\"2\"] { cursor: grab; -webkit-touch-callout: none; }\"`,\n\t);\n\n\tunmount();\n});\n\nit('should insert nonce into tag attribute', () => {\n\tconst nonce = 'ThisShouldBeACryptographicallySecurePseudoRandomNumber';\n\tconst { contextId, unmount } = renderApp({ nonce });\n\n\tconst styleTag = getStyleTag(contextId);\n\tconst styleTagNonce = styleTag ? styleTag.getAttribute('nonce') : '';\n\n\t// the style tag exists\n\texpect(styleTagNonce).toEqual(nonce);\n\n\t// now unmounted\n\tunmount();\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/__tests__/unit/virtual.test.tsx",
    "content": "import React from 'react';\n\nimport { fireEvent, render } from '@testing-library/react';\nimport type {\n\tDraggableProvided,\n\tDroppableStateSnapshot,\n\tDropResult,\n\tResponders,\n} from 'react-beautiful-dnd';\n\nimport { DragDropContext, Draggable, Droppable } from '../../src';\n\nimport { getPlaceholder } from './_util';\nimport { setup } from './_utils/setup';\nimport {\n\tkeyboard,\n\tmouse,\n} from './ported-from-react-beautiful-dnd/unit/integration/_utils/controls';\n\nbeforeAll(() => {\n\tsetup();\n});\n\nfunction noop() {}\n\ntype Item = { id: string };\n\nconst itemData: Item[] = [{ id: 'A' }, { id: 'B' }, { id: 'C' }];\n\n/**\n * This is not a real virtual renderer.\n *\n * It is intended to emulate the behavior of the JSW board, which unmounts a\n * `<Draggable>` when it is being dragged.\n */\nfunction FakeVirtualRenderer({\n\titemData,\n\tsnapshot,\n}: {\n\titemData: Item[];\n\tsnapshot: DroppableStateSnapshot;\n}) {\n\treturn (\n\t\t<>\n\t\t\t{itemData.map((item, index) => {\n\t\t\t\t/**\n\t\t\t\t * If the item is being dragged then don't render it\n\t\t\t\t */\n\t\t\t\tif (item.id === snapshot.draggingFromThisWith) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<Draggable key={item.id} draggableId={item.id} index={index}>\n\t\t\t\t\t\t{(provided) => <DraggableContent provided={provided} item={item} />}\n\t\t\t\t\t</Draggable>\n\t\t\t\t);\n\t\t\t})}\n\t\t</>\n\t);\n}\n\nfunction DraggableContent({ provided, item }: { provided: DraggableProvided; item: Item }) {\n\treturn (\n\t\t<div\n\t\t\tref={provided.innerRef}\n\t\t\t{...provided.draggableProps}\n\t\t\t{...provided.dragHandleProps}\n\t\t\tdata-testid={`item-${item.id}`}\n\t\t>\n\t\t\t{item.id}\n\t\t</div>\n\t);\n}\n\n/**\n * This list does not use real virtualization. It is only being used to test\n * virtual list support.\n *\n * See the comment for `FakeVirtualRenderer` for more information.\n */\nfunction VirtualList({\n\tresponders,\n\titemData,\n}: {\n\tresponders: Partial<Responders>;\n\titemData: Item[];\n}) {\n\treturn (\n\t\t<DragDropContext onDragEnd={noop} {...responders}>\n\t\t\t<Droppable\n\t\t\t\tdroppableId=\"droppable\"\n\t\t\t\tmode=\"virtual\"\n\t\t\t\trenderClone={(provided, _, rubric) => {\n\t\t\t\t\tconst { index } = rubric.source;\n\t\t\t\t\tconst item = itemData[index];\n\t\t\t\t\treturn <DraggableContent provided={provided} item={item} />;\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{(provided, snapshot) => (\n\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t\t<FakeVirtualRenderer itemData={itemData} snapshot={snapshot} />\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n\nfunction getResponders() {\n\treturn {\n\t\tonDragStart: jest.fn(),\n\t\tonDragUpdate: jest.fn(),\n\t\tonDragEnd: jest.fn(),\n\t};\n}\n\ndescribe('when a <Draggable /> in a virtual list is unmounted on drag', () => {\n\tdescribe('keyboard dragging', () => {\n\t\tit('should capture and report a11y violations', async () => {\n\t\t\tconst responders = getResponders();\n\t\t\tconst { container } = render(<VirtualList responders={responders} itemData={itemData} />);\n\n\t\t\tawait expect(container).toBeAccessible();\n\t\t});\n\n\t\tit('should have a placeholder', () => {\n\t\t\tconst responders = getResponders();\n\t\t\tconst { getByTestId } = render(<VirtualList responders={responders} itemData={itemData} />);\n\n\t\t\tkeyboard.lift(getByTestId('item-A'));\n\n\t\t\texpect(() => getPlaceholder()).not.toThrow();\n\t\t});\n\n\t\tit('should not move when dragged away and then dropped on the home position', () => {\n\t\t\tconst responders = getResponders();\n\t\t\tconst { getByTestId } = render(<VirtualList responders={responders} itemData={itemData} />);\n\n\t\t\tkeyboard.lift(getByTestId('item-A'));\n\t\t\tfireEvent.keyDown(window, { key: 'ArrowDown' });\n\t\t\tfireEvent.keyDown(window, { key: 'ArrowUp' });\n\t\t\tkeyboard.drop(getByTestId('item-A'));\n\n\t\t\tconst expectedDropResult: DropResult = {\n\t\t\t\treason: 'DROP',\n\t\t\t\tsource: { droppableId: 'droppable', index: 0 },\n\t\t\t\tdestination: { droppableId: 'droppable', index: 0 },\n\t\t\t\tcombine: null,\n\t\t\t\tmode: 'SNAP',\n\t\t\t\tdraggableId: 'A',\n\t\t\t\ttype: 'DEFAULT',\n\t\t\t};\n\t\t\texpect(responders.onDragEnd).toHaveBeenCalledWith(expectedDropResult, expect.any(Object));\n\t\t});\n\t});\n\n\tdescribe('pointer dragging', () => {\n\t\tit('should have a placeholder', () => {\n\t\t\tconst responders = getResponders();\n\t\t\tconst { getByTestId } = render(<VirtualList responders={responders} itemData={itemData} />);\n\n\t\t\tmouse.lift(getByTestId('item-A'));\n\n\t\t\texpect(() => getPlaceholder()).not.toThrow();\n\t\t});\n\n\t\tit('should not move when dragged away and then dropped on the home position', () => {\n\t\t\tconst responders = getResponders();\n\n\t\t\tconst { getByTestId } = render(<VirtualList responders={responders} itemData={itemData} />);\n\n\t\t\tmouse.lift(getByTestId('item-A'));\n\t\t\tfireEvent.dragOver(getByTestId('item-C'));\n\t\t\tfireEvent.dragOver(getPlaceholder());\n\t\t\tmouse.drop(getByTestId('item-A'));\n\n\t\t\tconst expectedDropResult: DropResult = {\n\t\t\t\treason: 'DROP',\n\t\t\t\tsource: { droppableId: 'droppable', index: 0 },\n\t\t\t\tdestination: { droppableId: 'droppable', index: 0 },\n\t\t\t\tcombine: null,\n\t\t\t\tmode: 'FLUID',\n\t\t\t\tdraggableId: 'A',\n\t\t\t\ttype: 'DEFAULT',\n\t\t\t};\n\t\t\texpect(responders.onDragEnd).toHaveBeenCalledWith(expectedDropResult, expect.any(Object));\n\t\t});\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/afm-jira/tsconfig.json",
    "content": "{\n\t\"extends\": \"../../../../tsconfig.local-consumption.json\",\n\t\"compilerOptions\": {\n\t\t\"target\": \"es5\",\n\t\t\"outDir\": \"../../../../../jira/tsDist/@atlaskit__pragmatic-drag-and-drop-react-beautiful-dnd-migration/app\",\n\t\t\"rootDir\": \"../\",\n\t\t\"composite\": true,\n\t\t\"noCheck\": true\n\t},\n\t\"include\": [\n\t\t\"../src/**/*.ts\",\n\t\t\"../src/**/*.tsx\"\n\t],\n\t\"exclude\": [\n\t\t\"../src/**/__tests__/*\",\n\t\t\"../src/**/*.test.*\",\n\t\t\"../src/**/test.*\",\n\t\t\"../src/**/examples.*\",\n\t\t\"../src/**/examples/*\",\n\t\t\"../src/**/examples/**/*\",\n\t\t\"../src/**/*.stories.*\",\n\t\t\"../src/**/stories/*\",\n\t\t\"../src/**/stories/**/*\"\n\t],\n\t\"references\": [\n\t\t{\n\t\t\t\"path\": \"../../core/afm-jira/tsconfig.json\"\n\t\t},\n\t\t{\n\t\t\t\"path\": \"../../hitbox/afm-jira/tsconfig.json\"\n\t\t},\n\t\t{\n\t\t\t\"path\": \"../../react-beautiful-dnd-autoscroll/afm-jira/tsconfig.json\"\n\t\t},\n\t\t{\n\t\t\t\"path\": \"../../../design-system/tokens/afm-jira/tsconfig.json\"\n\t\t}\n\t]\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/afm-products/tsconfig.json",
    "content": "{\n\t\"extends\": \"../../../../tsconfig.local-consumption.json\",\n\t\"compilerOptions\": {\n\t\t\"target\": \"es5\",\n\t\t\"outDir\": \"../../../../../tsDist/@atlaskit__pragmatic-drag-and-drop-react-beautiful-dnd-migration/app\",\n\t\t\"rootDir\": \"../\",\n\t\t\"composite\": true,\n\t\t\"noCheck\": true\n\t},\n\t\"include\": [\n\t\t\"../src/**/*.ts\",\n\t\t\"../src/**/*.tsx\"\n\t],\n\t\"exclude\": [\n\t\t\"../src/**/__tests__/*\",\n\t\t\"../src/**/*.test.*\",\n\t\t\"../src/**/test.*\",\n\t\t\"../src/**/examples.*\",\n\t\t\"../src/**/examples/*\",\n\t\t\"../src/**/examples/**/*\",\n\t\t\"../src/**/*.stories.*\",\n\t\t\"../src/**/stories/*\",\n\t\t\"../src/**/stories/**/*\"\n\t],\n\t\"references\": [\n\t\t{\n\t\t\t\"path\": \"../../core/afm-products/tsconfig.json\"\n\t\t},\n\t\t{\n\t\t\t\"path\": \"../../hitbox/afm-products/tsconfig.json\"\n\t\t},\n\t\t{\n\t\t\t\"path\": \"../../react-beautiful-dnd-autoscroll/afm-products/tsconfig.json\"\n\t\t},\n\t\t{\n\t\t\t\"path\": \"../../../design-system/tokens/afm-products/tsconfig.json\"\n\t\t}\n\t]\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/codemods/0.1.0-adoption-from-rbd-12.tsx",
    "content": "import { createTransformer, type API, type FileInfo, type Options } from '@atlaskit/codemod-utils';\n\nimport { migrations } from './0.1.0-adoption-from-rbd-13';\nimport { migrate12to13 } from './migrations/migrate-12-to-13';\nimport { shouldRunCodemodOnFile } from './utils';\n\n/**\n * Codemod for converting `react-beautiful-dnd` usage to the migration layer package.\n *\n * This codemod will:\n * - Change imports from `react-beautiful-dnd` to the migration layer package.\n * - Add warnings when unsupported API is used.\n *\n * The order here is significant.\n *\n * The `updateImports` transform should occur last,\n * as the previous transforms only operate on imports from `react-beautiful-dnd`.\n */\nconst transformer: (fileInfo: FileInfo, _api: API, options: Options) => string = createTransformer([migrate12to13, ...migrations], shouldRunCodemodOnFile);\n\nexport default transformer;\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/codemods/0.1.0-adoption-from-rbd-13.tsx",
    "content": "import { createTransformer, type API, type FileInfo, type Options } from '@atlaskit/codemod-utils';\n\nimport { updateImports } from './migrations/update-imports';\nimport { warnAboutReactBeautifulDndNext } from './migrations/warn-about-react-beautiful-dnd-next';\nimport { warnAboutRemovedExports } from './migrations/warn-about-removed-exports';\nimport { warnAboutUnsupportedProps } from './migrations/warn-about-unsupported-props';\nimport { shouldRunCodemodOnFile } from './utils';\n\nexport const migrations: (typeof warnAboutRemovedExports)[] = [\n\twarnAboutRemovedExports,\n\twarnAboutUnsupportedProps,\n\twarnAboutReactBeautifulDndNext,\n\tupdateImports,\n];\n\n/**\n * Codemod for converting `react-beautiful-dnd` usage to the migration layer package.\n *\n * This codemod will:\n * - Change imports from `react-beautiful-dnd` to the migration layer package.\n * - Add warnings when unsupported API is used.\n *\n * The order here is significant.\n *\n * The `updateImports` transform should occur last,\n * as the previous transforms only operate on imports from `react-beautiful-dnd`.\n */\nconst transformer: (fileInfo: FileInfo, _api: API, options: Options) => string = createTransformer(migrations, shouldRunCodemodOnFile);\n\nexport default transformer;\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/codemods/__tests__/adoption-from-rbd-12.test.tsx",
    "content": "jest.autoMockOff();\n\nimport transformer from '../0.1.0-adoption-from-rbd-12';\nimport { unsupportedPropMessages } from '../migrations/warn-about-unsupported-props';\nimport { migrationPackageName } from '../utils';\n\nconst defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;\n\nconst transform = { default: transformer, parser: 'tsx' };\nconst transformOptions = { printOptions: { quote: 'single' } };\n\n/**\n * This is essentially an integration test for all of the individual units.\n */\ndescribe('adoption transformer', () => {\n\tdefineInlineTest(\n\t\ttransform,\n\t\ttransformOptions,\n\t\t`\n    import React from 'react';\n\n    import {\n      DragDropContext,\n      Draggable,\n      Droppable,\n      useMouseSensor,\n      useKeyboardSensor,\n    } from 'react-beautiful-dnd';\n    import type { DroppableProps } from 'react-beautiful-dnd';\n\n    import type { DraggableProps } from 'react-beautiful-dnd-next';\n\n    import { useCustomSensor } from './use-custom-sensor';\n\n    function App() {\n      return (\n        <DragDropContext\n          onDragEnd={() => {}}\n          enableDefaultSensors={false}\n          sensors={[useMouseSensor, useKeyboardSensor, useCustomSensor]}\n          liftInstruction=\"...\"\n        >\n          <Droppable\n            droppableId=\"droppableId\"\n            isCombineEnabled\n            renderClone={renderClone}\n          >\n            {provided => (\n              <div ref={provided.innerRef} {...provided.droppableProps}>\n                <Draggable\n                  draggableId=\"draggableId\"\n                  index={0}\n                  shouldRespectForcePress\n                >\n                  {provided => (\n                    <div\n                      ref={provided.innerRef}\n                      {...provided.draggableProps}\n                      {...provided.dragHandleProps}\n                    >\n                      Draggable\n                    </div>\n                  )}\n                </Draggable>\n              </div>\n            )}\n          </Droppable>\n        </DragDropContext>\n      );\n    }\n    `,\n\t\t`\n    import React from 'react';\n\n    import {\n      DragDropContext,\n      Draggable,\n      Droppable,\n      /* TODO: (from codemod) Sensors are not supported in the migration layer.\n      The migration layer will handle pointer and keyboard dragging for you.\n      If you specifically want to disable one of these types of dragging, please reach out to us and we will see how we can help you. */\n      useMouseSensor,\n      /* TODO: (from codemod) Sensors are not supported in the migration layer.\n      The migration layer will handle pointer and keyboard dragging for you.\n      If you specifically want to disable one of these types of dragging, please reach out to us and we will see how we can help you. */\n      useKeyboardSensor,\n    } from '${migrationPackageName}';\n    import type { DroppableProps } from '${migrationPackageName}';\n\n    // TODO: (from codemod) \\`react-beautiful-dnd-next\\` is not supported by the migration layer.\n    import type { DraggableProps } from 'react-beautiful-dnd-next';\n\n    import { useCustomSensor } from './use-custom-sensor';\n\n    function App() {\n      return (\n        <DragDropContext\n          onDragEnd={() => {}}\n          /* TODO: (from codemod)\\u0020\n\n          This prop is not supported by the migration layer. It will not have any effect.\n\n          Reason:\n          ${unsupportedPropMessages.DragDropContext.enableDefaultSensors} */\n          enableDefaultSensors={false}\n          /* TODO: (from codemod)\\u0020\n\n          This prop is not supported by the migration layer. It will not have any effect.\n\n          Reason:\n          ${unsupportedPropMessages.DragDropContext.sensors} */\n          sensors={[useMouseSensor, useKeyboardSensor, useCustomSensor]}\n          dragHandleUsageInstructions=\"...\"\n        >\n          <Droppable\n            droppableId=\"droppableId\"\n            /* TODO: (from codemod)\\u0020\n\n            This prop is not supported by the migration layer. It will not have any effect.\n\n            Reason:\n            ${unsupportedPropMessages.Droppable.isCombineEnabled} */\n            isCombineEnabled\n            /* TODO: (from codemod) The migration layer provides the \\`react-beautiful-dnd\\` v13 props for the drag handle.\n            Instead of providing \\`aria-labelledby\\` it will instead provide \\`aria-describedby\\` and a \\`role\\` attribute. */\n            renderClone={renderClone}\n          >\n            {provided => (\n              <div ref={provided.innerRef} {...provided.droppableProps}>\n                <Draggable\n                  draggableId=\"draggableId\"\n                  index={0}\n                  /* TODO: (from codemod)\\u0020\n\n                  This prop is not supported by the migration layer. It will not have any effect.\n\n                  Reason:\n                  ${unsupportedPropMessages.Draggable.shouldRespectForcePress} */\n                  shouldRespectForcePress\n                >\n                  {/* TODO: (from codemod) The migration layer provides the \\`react-beautiful-dnd\\` v13 props for the drag handle.\n                  Instead of providing \\`aria-labelledby\\` it will instead provide \\`aria-describedby\\` and a \\`role\\` attribute. */\n                  }{provided => (\n                    <div\n                      ref={provided.innerRef}\n                      {...provided.draggableProps}\n                      {...provided.dragHandleProps}\n                    >\n                      Draggable\n                    </div>\n                  )}\n                </Draggable>\n              </div>\n            )}\n          </Droppable>\n        </DragDropContext>\n      );\n    }\n    `,\n\t\t'should correctly handle basic usage',\n\t);\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/codemods/__tests__/adoption-from-rbd-13.test.tsx",
    "content": "jest.autoMockOff();\n\nimport transformer from '../0.1.0-adoption-from-rbd-13';\nimport { unsupportedPropMessages } from '../migrations/warn-about-unsupported-props';\nimport { migrationPackageName } from '../utils';\n\nconst defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;\n\nconst transform = { default: transformer, parser: 'tsx' };\nconst transformOptions = { printOptions: { quote: 'single' } };\n\n/**\n * This is essentially an integration test for all of the individual units.\n */\ndescribe('adoption transformer', () => {\n\tdefineInlineTest(\n\t\ttransform,\n\t\ttransformOptions,\n\t\t`\n    import React from 'react';\n\n    import {\n      DragDropContext,\n      Draggable,\n      Droppable,\n      useMouseSensor,\n      useKeyboardSensor,\n    } from 'react-beautiful-dnd';\n    import type { DroppableProps } from 'react-beautiful-dnd';\n\n    import type { DraggableProps } from 'react-beautiful-dnd-next';\n\n    import { useCustomSensor } from './use-custom-sensor';\n\n    function App() {\n      return (\n        <DragDropContext\n          onDragEnd={() => {}}\n          enableDefaultSensors={false}\n          sensors={[useMouseSensor, useKeyboardSensor, useCustomSensor]}\n          dragHandleUsageInstructions=\"...\"\n        >\n          <Droppable\n            droppableId=\"droppableId\"\n            isCombineEnabled\n            renderClone={renderClone}\n          >\n            {provided => (\n              <div ref={provided.innerRef} {...provided.droppableProps}>\n                <Draggable\n                  draggableId=\"draggableId\"\n                  index={0}\n                  shouldRespectForcePress\n                >\n                  {provided => (\n                    <div\n                      ref={provided.innerRef}\n                      {...provided.draggableProps}\n                      {...provided.dragHandleProps}\n                    >\n                      Draggable\n                    </div>\n                  )}\n                </Draggable>\n              </div>\n            )}\n          </Droppable>\n        </DragDropContext>\n      );\n    }\n    `,\n\t\t`\n    import React from 'react';\n\n    import {\n      DragDropContext,\n      Draggable,\n      Droppable,\n      /* TODO: (from codemod) Sensors are not supported in the migration layer.\n      The migration layer will handle pointer and keyboard dragging for you.\n      If you specifically want to disable one of these types of dragging, please reach out to us and we will see how we can help you. */\n      useMouseSensor,\n      /* TODO: (from codemod) Sensors are not supported in the migration layer.\n      The migration layer will handle pointer and keyboard dragging for you.\n      If you specifically want to disable one of these types of dragging, please reach out to us and we will see how we can help you. */\n      useKeyboardSensor,\n    } from '${migrationPackageName}';\n    import type { DroppableProps } from '${migrationPackageName}';\n\n    // TODO: (from codemod) \\`react-beautiful-dnd-next\\` is not supported by the migration layer.\n    import type { DraggableProps } from 'react-beautiful-dnd-next';\n\n    import { useCustomSensor } from './use-custom-sensor';\n\n    function App() {\n      return (\n        <DragDropContext\n          onDragEnd={() => {}}\n          /* TODO: (from codemod)\\u0020\n\n          This prop is not supported by the migration layer. It will not have any effect.\n\n          Reason:\n          ${unsupportedPropMessages.DragDropContext.enableDefaultSensors} */\n          enableDefaultSensors={false}\n          /* TODO: (from codemod)\\u0020\n\n          This prop is not supported by the migration layer. It will not have any effect.\n\n          Reason:\n          ${unsupportedPropMessages.DragDropContext.sensors} */\n          sensors={[useMouseSensor, useKeyboardSensor, useCustomSensor]}\n          dragHandleUsageInstructions=\"...\"\n        >\n          <Droppable\n            droppableId=\"droppableId\"\n            /* TODO: (from codemod)\\u0020\n\n            This prop is not supported by the migration layer. It will not have any effect.\n\n            Reason:\n            ${unsupportedPropMessages.Droppable.isCombineEnabled} */\n            isCombineEnabled\n            renderClone={renderClone}\n          >\n            {provided => (\n              <div ref={provided.innerRef} {...provided.droppableProps}>\n                <Draggable\n                  draggableId=\"draggableId\"\n                  index={0}\n                  /* TODO: (from codemod)\\u0020\n\n                  This prop is not supported by the migration layer. It will not have any effect.\n\n                  Reason:\n                  ${unsupportedPropMessages.Draggable.shouldRespectForcePress} */\n                  shouldRespectForcePress\n                >\n                  {provided => (\n                    <div\n                      ref={provided.innerRef}\n                      {...provided.draggableProps}\n                      {...provided.dragHandleProps}\n                    >\n                      Draggable\n                    </div>\n                  )}\n                </Draggable>\n              </div>\n            )}\n          </Droppable>\n        </DragDropContext>\n      );\n    }\n    `,\n\t\t'should correctly handle basic usage',\n\t);\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/codemods/__tests__/migration/migrate-12-to-13.test.tsx",
    "content": "jest.autoMockOff();\n\nimport { createTransformer } from '@atlaskit/codemod-utils';\n\nimport { dragHandlePropMessage, migrate12to13 } from '../../migrations/migrate-12-to-13';\n\nconst transformer = createTransformer([migrate12to13]);\n\nconst defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;\n\nconst transform = { default: transformer, parser: 'tsx' };\nconst transformOptions = { printOptions: { quote: 'single' } };\n\nfunction getExpectedMessage({ indent }: { indent: number }) {\n\tconst formattedMessage = dragHandlePropMessage.replace(/\\n/g, `\\n${' '.repeat(indent)}`);\n\treturn `/* TODO: (from codemod) ${formattedMessage} */`;\n}\n\ndescribe('migrate 12 to 13', () => {\n\tdefineInlineTest(\n\t\ttransform,\n\t\ttransformOptions,\n\t\t`\n    import { DragDropContext } from 'react-beautiful-dnd';\n\n    <DragDropContext\n      liftInstruction=\"abcd\"\n    />\n    `,\n\t\t`\n    import { DragDropContext } from 'react-beautiful-dnd';\n\n    <DragDropContext\n      dragHandleUsageInstructions=\"abcd\"\n    />\n    `,\n\t\t'should rename the `liftInstruction` prop',\n\t);\n\n\tdefineInlineTest(\n\t\ttransform,\n\t\ttransformOptions,\n\t\t`\n    import { Draggable } from 'react-beautiful-dnd';\n\n    <Draggable>\n      {provided => (\n        <div\n          ref={provided.innerRef}\n          {...provided.draggableProps}\n          {...provided.dragHandleProps}\n        />\n      )}\n    </Draggable>\n    `,\n\t\t`\n    import { Draggable } from 'react-beautiful-dnd';\n\n    <Draggable>\n      {${getExpectedMessage({ indent: 6 })}\n      }{provided => (\n        <div\n          ref={provided.innerRef}\n          {...provided.draggableProps}\n          {...provided.dragHandleProps}\n        />\n      )}\n    </Draggable>\n    `,\n\t\t'should add a message to each <Draggable> about the drag handle props',\n\t);\n\n\tdefineInlineTest(\n\t\ttransform,\n\t\ttransformOptions,\n\t\t`\n    import { Droppable } from 'react-beautiful-dnd';\n\n    <Droppable\n      renderClone={someFunction}\n    >\n      {provided => (\n        <div\n          ref={provided.innerRef}\n          {...provided.droppableProps}\n        />\n      )}\n    </Droppable>\n    `,\n\t\t`\n    import { Droppable } from 'react-beautiful-dnd';\n\n    <Droppable\n      ${getExpectedMessage({ indent: 6 })}\n      renderClone={someFunction}\n    >\n      {provided => (\n        <div\n          ref={provided.innerRef}\n          {...provided.droppableProps}\n        />\n      )}\n    </Droppable>\n    `,\n\t\t'should add a message to each <Droppable> renderClone attribute about the drag handle props',\n\t);\n\n\tdefineInlineTest(\n\t\ttransform,\n\t\ttransformOptions,\n\t\t`\n    import {\n      DragDropContext as RbdDragDropContext,\n      Draggable as RbdDraggable,\n      Droppable as RbdDroppable\n    } from 'react-beautiful-dnd';\n\n    <RbdDragDropContext\n      liftInstruction=\"...\"\n    >\n      <RbdDroppable\n        renderClone={someFunction}\n      >\n        {provided => (\n          <div\n            ref={provided.innerRef}\n            {...provided.droppableProps}\n          >\n            <RbdDraggable>\n              {provided => (\n                <div\n                  ref={provided.innerRef}\n                  {...provided.draggableProps}\n                  {...provided.dragHandleProps}\n                />\n              )}\n            </RbdDraggable>\n          </div>\n        )}\n      </RbdDroppable>\n    </RbdDragDropContext>\n    `,\n\t\t`\n    import {\n      DragDropContext as RbdDragDropContext,\n      Draggable as RbdDraggable,\n      Droppable as RbdDroppable\n    } from 'react-beautiful-dnd';\n\n    <RbdDragDropContext\n      dragHandleUsageInstructions=\"...\"\n    >\n      <RbdDroppable\n        ${getExpectedMessage({ indent: 8 })}\n        renderClone={someFunction}\n      >\n        {provided => (\n          <div\n            ref={provided.innerRef}\n            {...provided.droppableProps}\n          >\n            <RbdDraggable>\n              {${getExpectedMessage({ indent: 14 })}\n              }{provided => (\n                <div\n                  ref={provided.innerRef}\n                  {...provided.draggableProps}\n                  {...provided.dragHandleProps}\n                />\n              )}\n            </RbdDraggable>\n          </div>\n        )}\n      </RbdDroppable>\n    </RbdDragDropContext>\n    `,\n\t\t'should work even if imports are aliased',\n\t);\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/codemods/__tests__/migration/update-imports.test.tsx",
    "content": "jest.autoMockOff();\n\nimport { createTransformer } from '@atlaskit/codemod-utils';\n\nimport { updateImports } from '../../migrations/update-imports';\nimport { migrationPackageName } from '../../utils';\n\nconst transformer = createTransformer([updateImports]);\n\nconst defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;\n\nconst transform = { default: transformer, parser: 'tsx' };\nconst transformOptions = { printOptions: { quote: 'single' } };\n\ndescribe('update imports', () => {\n\tdefineInlineTest(\n\t\ttransform,\n\t\ttransformOptions,\n\t\t`\n    import { DragDropContext, Draggable, Droppable } from 'react-beautiful-dnd';\n    `,\n\t\t`\n    import { DragDropContext, Draggable, Droppable } from '${migrationPackageName}';\n    `,\n\t\t'should correctly handle basic usage',\n\t);\n\n\tdefineInlineTest(\n\t\ttransform,\n\t\ttransformOptions,\n\t\t`\n    import type { DraggableProps, DroppableProps } from 'react-beautiful-dnd';\n\n    import { DragDropContext, Draggable, Droppable } from '${migrationPackageName}';\n    `,\n\t\t`\n    import type { DraggableProps, DroppableProps } from '${migrationPackageName}';\n\n    import { DragDropContext, Draggable, Droppable } from '${migrationPackageName}';\n    `,\n\t\t'should not merge declarations',\n\t);\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/codemods/__tests__/migration/warn-about-react-beautiful-dnd-next.test.tsx",
    "content": "jest.autoMockOff();\n\nimport { createTransformer } from '@atlaskit/codemod-utils';\n\nimport {\n\twarnAboutReactBeautifulDndNext,\n\twarningMessageForReactBeautifulDndNext,\n} from '../../migrations/warn-about-react-beautiful-dnd-next';\n\nconst transformer = createTransformer([warnAboutReactBeautifulDndNext]);\n\nconst defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;\n\nconst transform = { default: transformer, parser: 'tsx' };\nconst transformOptions = { printOptions: { quote: 'single' } };\n\nconst expectedComment = `TODO: (from codemod) ${warningMessageForReactBeautifulDndNext}`;\n\ndescribe('warn about importing from `react-beautiful-dnd-next`', () => {\n\tdefineInlineTest(\n\t\ttransform,\n\t\ttransformOptions,\n\t\t`\n    import { anything } from 'react-beautiful-dnd-next';\n    `,\n\t\t`\n    // ${expectedComment}\n    import { anything } from 'react-beautiful-dnd-next';\n    `,\n\t\t'should add a warning comment',\n\t);\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/codemods/__tests__/migration/warn-about-removed-exports.test.tsx",
    "content": "jest.autoMockOff();\n\nimport { createTransformer } from '@atlaskit/codemod-utils';\n\nimport {\n\twarnAboutRemovedExports,\n\twarningMessageForRemovedExports,\n} from '../../migrations/warn-about-removed-exports';\n\nconst transformer = createTransformer([warnAboutRemovedExports]);\n\nconst defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;\n\nconst transform = { default: transformer, parser: 'tsx' };\nconst transformOptions = { printOptions: { quote: 'single' } };\n\nfunction getExpectedComment({ indent }: { indent: number }) {\n\t/**\n\t * The raw warning message has no indent formatting.\n\t *\n\t * The expected message will be indented based on its context.\n\t */\n\tconst formattedMessage = warningMessageForRemovedExports.replace(\n\t\t/\\n/g,\n\t\t`\\n${' '.repeat(indent)}`,\n\t);\n\treturn `TODO: (from codemod) ${formattedMessage}`;\n}\n\ndescribe('warn about removed exports', () => {\n\tdefineInlineTest(\n\t\ttransform,\n\t\ttransformOptions,\n\t\t`\n    import {\n      useMouseSensor,\n      DragDropContext\n    } from 'react-beautiful-dnd';\n    `,\n\t\t`\n    import {\n      /* ${getExpectedComment({ indent: 6 })} */\n      useMouseSensor,\n      DragDropContext\n    } from 'react-beautiful-dnd';\n    `,\n\t\t'should remove a single sensor import and add a comment',\n\t);\n\n\tdefineInlineTest(\n\t\ttransform,\n\t\ttransformOptions,\n\t\t`\n    import {\n      useMouseSensor,\n      useTouchSensor,\n      useKeyboardSensor,\n      DragDropContext\n    } from 'react-beautiful-dnd';\n    `,\n\t\t`\n    import {\n      /* ${getExpectedComment({ indent: 6 })} */\n      useMouseSensor,\n      /* ${getExpectedComment({ indent: 6 })} */\n      useTouchSensor,\n      /* ${getExpectedComment({ indent: 6 })} */\n      useKeyboardSensor,\n      DragDropContext\n    } from 'react-beautiful-dnd';\n    `,\n\t\t'should remove multiple sensor imports and add a comment',\n\t);\n\n\tdefineInlineTest(\n\t\ttransform,\n\t\ttransformOptions,\n\t\t`\n    import {\n      useMouseSensor as Draggable\n    } from 'react-beautiful-dnd';\n\n    import somethingElse from 'another-package';\n    `,\n\t\t`\n    import {\n      /* ${getExpectedComment({ indent: 6 })} */\n      useMouseSensor as Draggable\n    } from 'react-beautiful-dnd';\n\n    import somethingElse from 'another-package';\n    `,\n\t\t'should work if the sensor import is aliased',\n\t);\n\n\tdefineInlineTest(\n\t\ttransform,\n\t\ttransformOptions,\n\t\t`\n    import { useMouseSensor } from 'react-beautiful-dnd';\n\n    import somethingElse from 'another-package';\n    `,\n\t\t`\n    import { /* ${getExpectedComment({ indent: 4 })} */\n    useMouseSensor } from 'react-beautiful-dnd';\n\n    import somethingElse from 'another-package';\n    `,\n\t\t'should work for single line imports',\n\t);\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/codemods/__tests__/migration/warn-about-unsupported-props.test.tsx",
    "content": "jest.autoMockOff();\n\nimport { createTransformer } from '@atlaskit/codemod-utils';\n\nimport {\n\tunsupportedPropMessages,\n\twarnAboutUnsupportedProps,\n} from '../../migrations/warn-about-unsupported-props';\n\nconst transformer = createTransformer([warnAboutUnsupportedProps]);\n\nconst defineInlineTest = require('jscodeshift/dist/testUtils').defineInlineTest;\n\nconst transform = { default: transformer, parser: 'tsx' };\nconst transformOptions = { printOptions: { quote: 'single' } };\n\ndescribe('warn about removed exports', () => {\n\tdescribe('DragDropContext', () => {\n\t\tdefineInlineTest(\n\t\t\ttransform,\n\t\t\ttransformOptions,\n\t\t\t`\n      import { DragDropContext } from 'react-beautiful-dnd';\n\n      <DragDropContext\n        nonce=\"1234\"\n      />\n      `,\n\t\t\t`\n      import { DragDropContext } from 'react-beautiful-dnd';\n\n      <DragDropContext\n        /* TODO: (from codemod) \n\n        This prop is not supported by the migration layer. It will not have any effect.\n\n        Reason:\n        ${unsupportedPropMessages.DragDropContext.nonce} */\n        nonce=\"1234\"\n      />\n    `,\n\t\t\t'should warn about the nonce prop',\n\t\t);\n\n\t\tdefineInlineTest(\n\t\t\ttransform,\n\t\t\ttransformOptions,\n\t\t\t`\n      import { DragDropContext, useMouseSensor } from 'react-beautiful-dnd';\n\n      <DragDropContext\n        sensors={[useMouseSensor]}\n      />\n      `,\n\t\t\t`\n      import { DragDropContext, useMouseSensor } from 'react-beautiful-dnd';\n\n      <DragDropContext\n        /* TODO: (from codemod) \n\n        This prop is not supported by the migration layer. It will not have any effect.\n\n        Reason:\n        ${unsupportedPropMessages.DragDropContext.sensors} */\n        sensors={[useMouseSensor]}\n      />\n    `,\n\t\t\t'should warn about the sensors prop',\n\t\t);\n\n\t\tdefineInlineTest(\n\t\t\ttransform,\n\t\t\ttransformOptions,\n\t\t\t`\n      import { DragDropContext } from 'react-beautiful-dnd';\n\n      <DragDropContext\n        enableDefaultSensors={false}\n      />\n      `,\n\t\t\t`\n      import { DragDropContext } from 'react-beautiful-dnd';\n\n      <DragDropContext\n        /* TODO: (from codemod) \n\n        This prop is not supported by the migration layer. It will not have any effect.\n\n        Reason:\n        ${unsupportedPropMessages.DragDropContext.enableDefaultSensors} */\n        enableDefaultSensors={false}\n      />\n    `,\n\t\t\t'should warn about the enableDefaultSensors prop',\n\t\t);\n\t});\n\n\tdescribe('Draggable', () => {\n\t\tdefineInlineTest(\n\t\t\ttransform,\n\t\t\ttransformOptions,\n\t\t\t`\n      import { Draggable } from 'react-beautiful-dnd';\n\n      <Draggable\n        shouldRespectForcePress={true}\n      />\n      `,\n\t\t\t`\n      import { Draggable } from 'react-beautiful-dnd';\n\n      <Draggable\n        /* TODO: (from codemod) \n\n        This prop is not supported by the migration layer. It will not have any effect.\n\n        Reason:\n        ${unsupportedPropMessages.Draggable.shouldRespectForcePress} */\n        shouldRespectForcePress={true}\n      />\n    `,\n\t\t\t'should warn about the shouldRespectForcePress prop',\n\t\t);\n\t});\n\n\tdescribe('Droppable', () => {\n\t\tdefineInlineTest(\n\t\t\ttransform,\n\t\t\ttransformOptions,\n\t\t\t`\n      import { Droppable } from 'react-beautiful-dnd';\n\n      <Droppable\n        isCombineEnabled\n      />\n      `,\n\t\t\t`\n      import { Droppable } from 'react-beautiful-dnd';\n\n      <Droppable\n        /* TODO: (from codemod) \n\n        This prop is not supported by the migration layer. It will not have any effect.\n\n        Reason:\n        ${unsupportedPropMessages.Droppable.isCombineEnabled} */\n        isCombineEnabled\n      />\n    `,\n\t\t\t'should warn about the isCombineEnabled prop',\n\t\t);\n\n\t\tdefineInlineTest(\n\t\t\ttransform,\n\t\t\ttransformOptions,\n\t\t\t`\n      import { Droppable } from 'react-beautiful-dnd';\n\n      <Droppable\n        ignoreContainerClipping\n      />\n      `,\n\t\t\t`\n      import { Droppable } from 'react-beautiful-dnd';\n\n      <Droppable\n        /* TODO: (from codemod) \n\n        This prop is not supported by the migration layer. It will not have any effect.\n\n        Reason:\n        ${unsupportedPropMessages.Droppable.ignoreContainerClipping} */\n        ignoreContainerClipping\n      />\n    `,\n\t\t\t'should warn about the ignoreContainerClipping prop',\n\t\t);\n\t});\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/codemods/migrations/migrate-12-to-13.tsx",
    "content": "import type { ASTNode, ASTPath, Collection, JSCodeshift, JSXElement } from 'jscodeshift';\n\nimport { addCommentBefore, getJSXAttributesByName } from '@atlaskit/codemod-utils';\n\nimport { forEachRbdElementInFile } from '../utils';\n\nexport const dragHandlePropMessage: string = [\n\t'The migration layer provides the `react-beautiful-dnd` v13 props for the drag handle.',\n\t'Instead of providing `aria-labelledby` it will instead provide `aria-describedby` and a `role` attribute.',\n].join('\\n');\n\nconst componentMigrations = {\n\tDragDropContext(j: JSCodeshift, path: ASTPath<JSXElement>) {\n\t\tgetJSXAttributesByName(j, path, 'liftInstruction').forEach((path) => {\n\t\t\tpath.node.name = j.jsxIdentifier('dragHandleUsageInstructions');\n\t\t});\n\t},\n\n\tDraggable(j: JSCodeshift, path: ASTPath<JSXElement>) {\n\t\tconst childrenPath: ASTPath<ASTNode> = path.get('children');\n\n\t\tconst expressionPath = j(childrenPath).find(j.JSXExpressionContainer).paths().at(0);\n\t\tif (!expressionPath) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst jsxExpression = j.jsxEmptyExpression();\n\t\tjsxExpression.comments = [j.commentBlock(` TODO: (from codemod) ${dragHandlePropMessage} `)];\n\n\t\texpressionPath.insertBefore(j.jsxExpressionContainer(jsxExpression));\n\t},\n\n\tDroppable(j: JSCodeshift, path: ASTPath<JSXElement>) {\n\t\tconst attributeCollection = getJSXAttributesByName(j, path, 'renderClone');\n\t\taddCommentBefore(j, attributeCollection, dragHandlePropMessage, 'block');\n\t},\n} as const;\n\nexport function migrate12to13(j: JSCodeshift, source: Collection<Node>): void {\n\tforEachRbdElementInFile(j, source, ({ originalName, path }) => {\n\t\tcomponentMigrations[originalName](j, path);\n\t});\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/codemods/migrations/update-imports.tsx",
    "content": "import { type Collection, type default as core } from 'jscodeshift';\n\nimport { getImportDeclarationsForRbd, migrationPackageName } from '../utils';\n\n/**\n * Changes imports from `react-beautiful-dnd` to instead import from the migration layer package.\n *\n * There are no smarts to this change, it just changes the package being imported from.\n */\nexport function updateImports(j: core.JSCodeshift, source: Collection<Node>): void {\n\tgetImportDeclarationsForRbd(j, source).forEach((path) => {\n\t\tpath.node.source.value = migrationPackageName;\n\t});\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/codemods/migrations/warn-about-react-beautiful-dnd-next.tsx",
    "content": "import type { Collection, JSCodeshift } from 'jscodeshift';\n\nimport { addCommentBefore } from '@atlaskit/codemod-utils';\n\nexport const warningMessageForReactBeautifulDndNext =\n\t'`react-beautiful-dnd-next` is not supported by the migration layer.';\n\nexport function warnAboutReactBeautifulDndNext(j: JSCodeshift, source: Collection<Node>): void {\n\tconst importDeclarationCollection = source\n\t\t.find(j.ImportDeclaration)\n\t\t.filter((path) => path.node.source.value === 'react-beautiful-dnd-next');\n\n\taddCommentBefore(j, importDeclarationCollection, warningMessageForReactBeautifulDndNext, 'line');\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/codemods/migrations/warn-about-removed-exports.tsx",
    "content": "import { type Collection, type default as core } from 'jscodeshift';\n\nimport { addCommentBefore } from '@atlaskit/codemod-utils';\n\nimport { getImportDeclarationsForRbd } from '../utils';\n\nconst removedExports = new Set(['useMouseSensor', 'useTouchSensor', 'useKeyboardSensor']);\n\nexport const warningMessageForRemovedExports: string = [\n\t'Sensors are not supported in the migration layer.',\n\t'The migration layer will handle pointer and keyboard dragging for you.',\n\t'If you specifically want to disable one of these types of dragging, please reach out to us and we will see how we can help you.',\n].join('\\n');\n\n/**\n * Removes exports that no longer exists,\n * and renders a comment informing users about the removal.\n */\nexport function warnAboutRemovedExports(j: core.JSCodeshift, source: Collection<Node>): void {\n\tgetImportDeclarationsForRbd(j, source)\n\t\t.find(j.ImportSpecifier)\n\t\t.filter((path) => removedExports.has(path.node.imported.name))\n\t\t.forEach((path) => {\n\t\t\taddCommentBefore(j, j(path), warningMessageForRemovedExports, 'block');\n\t\t});\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/codemods/migrations/warn-about-unsupported-props.tsx",
    "content": "import type { Collection, JSCodeshift } from 'jscodeshift';\n\nimport { addCommentBefore, getJSXAttributesByName } from '@atlaskit/codemod-utils';\n\nimport { forEachRbdElementInFile } from '../utils';\n\nexport const unsupportedPropMessages = {\n\tDragDropContext: {\n\t\tnonce: 'A nonce is no longer needed as all styles are now controlled by React.',\n\t\tsensors:\n\t\t\t'Custom sensors are not supported. The migration layer supports pointer and keyboard dragging.',\n\t\tenableDefaultSensors: 'Disabling default sensors is not supported.',\n\t},\n\tDraggable: {\n\t\tshouldRespectForcePress: 'The browser is now responsible for handling this concern.',\n\t},\n\tDroppable: {\n\t\tisCombineEnabled:\n\t\t\t'The migration layer does not support combining items. We did this as the main use case for this behavior was trees - which we now have other packages for.',\n\t\tignoreContainerClipping:\n\t\t\t'The browser is now responsible for determining hit targets. We no longer tweak hitzones for a droppable using this prop.',\n\t},\n};\n\nfunction getWarningMessage(reason: string) {\n\treturn [\n\t\t'\\n',\n\t\t'This prop is not supported by the migration layer. It will not have any effect.',\n\t\t'\\nReason:',\n\t\treason,\n\t].join('\\n');\n}\n\n/**\n * Adds warning comments above prop usages for props that are not supported by the migration layer.\n */\nexport function warnAboutUnsupportedProps(j: JSCodeshift, source: Collection<Node>): void {\n\tforEachRbdElementInFile(j, source, ({ originalName, path }) => {\n\t\tconst messages = unsupportedPropMessages[originalName];\n\n\t\tfor (const [attributeName, reason] of Object.entries(messages)) {\n\t\t\tconst attributeCollection = getJSXAttributesByName(j, path, attributeName);\n\n\t\t\taddCommentBefore(j, attributeCollection, getWarningMessage(reason), 'block');\n\t\t}\n\t});\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/codemods/utils.tsx",
    "content": "import type { ASTPath, Collection, ImportDeclaration, JSCodeshift, JSXElement } from 'jscodeshift';\n\nfunction getImportDeclarationsForPackage(\n\tj: JSCodeshift,\n\tsource: Collection<Node>,\n\tpackageName: string,\n) {\n\treturn source.find(j.ImportDeclaration).filter((path) => path.node.source.value === packageName);\n}\n\nexport function getImportDeclarationsForRbd(\n\tj: JSCodeshift,\n\tsource: Collection<Node>,\n): Collection<ImportDeclaration> {\n\treturn getImportDeclarationsForPackage(j, source, 'react-beautiful-dnd');\n}\n\nexport function shouldRunCodemodOnFile(j: JSCodeshift, source: Collection<Node>): boolean {\n\tconst hasRbdImport = getImportDeclarationsForRbd(j, source).length > 0;\n\tconst hasRbdNextImport =\n\t\tgetImportDeclarationsForPackage(j, source, 'react-beautiful-dnd-next').length > 0;\n\n\treturn hasRbdImport || hasRbdNextImport;\n}\n\nexport const migrationPackageName =\n\t'@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration';\n\nconst componentNameList = ['DragDropContext', 'Draggable', 'Droppable'] as const;\ntype ComponentName = (typeof componentNameList)[number];\n\nfunction isComponentName(str: string): str is ComponentName {\n\treturn componentNameList.includes(str as any);\n}\n\nfunction getImportedRbdComponentNames(\n\tj: JSCodeshift,\n\tsource: Collection<Node>,\n): Map<string, ComponentName> {\n\tconst componentsInFile = new Map<string, ComponentName>();\n\n\tgetImportDeclarationsForRbd(j, source).forEach((path) => {\n\t\tj(path)\n\t\t\t.find(j.ImportSpecifier)\n\t\t\t.forEach((path) => {\n\t\t\t\tconst originalName = path.node.imported.name;\n\t\t\t\tif (isComponentName(originalName)) {\n\t\t\t\t\tconst nameInFile = path.node.local ? path.node.local.name : originalName;\n\t\t\t\t\tcomponentsInFile.set(nameInFile, originalName);\n\t\t\t\t}\n\t\t\t});\n\t});\n\n\treturn componentsInFile;\n}\n\nfunction getJSXElementName(node: JSXElement): string | null {\n\tconst nameNode = node.openingElement.name;\n\tif (nameNode.type !== 'JSXIdentifier') {\n\t\treturn null;\n\t}\n\treturn nameNode.name;\n}\n\nfunction getRbdElementsInFile(\n\tsource: Collection<Node>,\n\timportedRbdComponentNames: Map<string, string>,\n) {\n\treturn source.findJSXElements().filter((path) => {\n\t\tconst nameInFile = getJSXElementName(path.node);\n\t\tif (!nameInFile) {\n\t\t\treturn false;\n\t\t}\n\t\treturn importedRbdComponentNames.has(nameInFile);\n\t});\n}\n\ntype CallbackArgs = {\n\tnameInFile: string;\n\toriginalName: ComponentName;\n\tpath: ASTPath<JSXElement>;\n};\n\nexport function forEachRbdElementInFile(\n\tj: JSCodeshift,\n\tsource: Collection<Node>,\n\tcallback: (args: CallbackArgs) => void,\n): void {\n\tconst importedRbdComponentNames = getImportedRbdComponentNames(j, source);\n\tgetRbdElementsInFile(source, importedRbdComponentNames).forEach((path) => {\n\t\tconst nameInFile = getJSXElementName(path.node);\n\t\tif (!nameInFile || !importedRbdComponentNames.has(nameInFile)) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst originalName = importedRbdComponentNames.get(nameInFile);\n\t\tif (!originalName) {\n\t\t\treturn;\n\t\t}\n\n\t\tcallback({\n\t\t\tnameInFile,\n\t\t\toriginalName,\n\t\t\tpath,\n\t\t});\n\t});\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/constellation/index/about.mdx",
    "content": "---\norder: 0\ntitle: react-beautiful-dnd migration\ndescription:\n  An optional Pragmatic drag and drop package that enables rapid migration from react-beautiful-dnd\n  to Pragmatic drag and drop\n---\n\nimport SectionMessage from '@atlaskit/section-message';\n\n<SectionMessage>\n\nThis package depends on:\n\n- [the core package](/components/pragmatic-drag-and-drop/core-package)\n- [the hitbox package](/components/pragmatic-drag-and-drop/optional-packages/hitbox)\n- [the live region package](/components/pragmatic-drag-and-drop/optional-packages/live-region)\n- [the react-beautiful-dnd auto scroll package](/components/pragmatic-drag-and-drop/optional-packages/react-beautiful-dnd-autoscroll)\n- [`react`](https://react.dev/)\n- [`@emotion/react`](https://emotion.sh/docs/introduction) for styling\n- [`@atlaskit/tokens`](/components/tokens) for colors\n\n</SectionMessage>\n\n<SectionMessage title=\"React 19\" appearance='information'>\n\nThis package does not currently support React 19.\n\n</SectionMessage>\n\nThis package exposes the same exports and types of `react-beautiful-dnd@13` and uses\n`@atlaskit/pragmatic-drag-and-drop` to power those exports.\n\nAt a high level, all you need to do is swap your imports of `react-beautiful-dnd` in your code to\n`@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration` and your drag and drop\nexperience(s) will now be powered by Pragmatic drag and drop.\n\nThis package also includes a codemod to help automatically shift over `react-beautiful-dnd@12` and\n`react-beautiful-dnd@13` to `@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration`.\n\n## Prerequisites\n\nTo use `@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration` you should:\n\n1. Already be using `react-beautiful-dnd`. If this is a new feature, adopt\n   `@atlaskit/pragmatic-drag-and-drop` directly.\n2. Be using major version 12 or 13 of `react-beautiful-dnd`.\n\n## Migration steps\n\n1. Install `@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration`\n\n2. Run the codemod client with the command\n   `npx @atlaskit/codemod-cli --parser {tsx|babylon} --extensions ts,tsx,js [relativePath]`.\n\n   Select the codemod based on which version of `react-beautiful-dnd` you are using:\n   1. For major version 12, select `adoption-from-rbd-12`\n\n   2. For major version 13, select `adoption-from-rbd-13`\n\n3. Acknowledge and remove the comments left by the codemod.\n\n## Troubleshooting\n\nIf you run into any issues while migrating, please reach out to us for assistance.\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/constellation/index/comparison.mdx",
    "content": "---\norder: 1\n---\n\nimport SectionMessage from '@atlaskit/section-message';\n\n<SectionMessage>\n\tIf any of these changes are a blocker for you, please reach out to discuss options.\n</SectionMessage>\n\n## UX\n\nThe user experience (UX) provided by this migration layer differs slightly to that of\n`react-beautiful-dnd`.\n\n## Sensors\n\nThe migration layer does not use the same concept of sensors as `react-beautiful-dnd`.\n\n### Default sensors\n\nDisabling default sensors is no longer supported.\n\nPointer and keyboard dragging are supported by default, equivalent to the default\n`react-beautiful-dnd` sensors:\n\n- `useMouseSensor`\n- `useTouchSensor`\n- `useKeyboardSensor`\n\n### Custom sensors\n\nCustom sensors are no longer supported.\n\n## Combining items\n\nCombining items is no longer supported.\n\nThe main use case of combining is trees, for which there are more suitable packages. If you are\nlooking for a tree package, please reach out to us and we can help you with next steps.\n\n## Props\n\n### Unsupported props\n\nA number of props are no longer supported. They will be accepted but won't have any effect.\n\n#### `<DragDropContext>`\n\n```diff\n# Custom sensors are not supported.\n# The migration layer supports pointer and keyboard dragging.\n- sensors?: Sensors[];\n\n# Disabling default sensors is not supported.\n- enableDefaultSensors?: boolean;\n```\n\n#### `<Droppable>`\n\n```diff\n# Combining items is not supported.\n- isCombineEnabled?: boolean;\n\n# The browser now determines all hit targets.\n- ignoreContainerClipping?: boolean;\n```\n\n#### `<Draggable>`\n\n```diff\n# The browser now determines when drags should occur.\n- shouldRespectForcePress?: boolean;\n```\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/constellation/index/props.mdx",
    "content": "## Codemod\n\n1. Install `@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration` as a runtime\n   dependency.\n\n2. Run the codemod client with the following command.\n\n   ```\n   npx @atlaskit/codemod-cli --parser tsx --extensions ts,tsx,js [relativePath]\n   ```\n\n3. Select the codemod based on which version of `react-beautiful-dnd` you are migrating from:\n   - Use `adoption-from-rbd-12` for major version 12.\n   - Use `adoption-from-rbd-13` for major version 13.\n\n4. Acknowledge and remove the comments left by the codemod.\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/examples/00-vertical-list.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { useCallback, useMemo, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport type { DropResult } from 'react-beautiful-dnd';\n\nimport { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';\nimport { token } from '@atlaskit/tokens';\n\nimport { ExampleWrapper, useDependency } from './pieces/example-wrapper';\n\ntype ItemData = {\n\tid: string;\n\tcontent: string;\n};\n\nconst initialData: ItemData[] = Array.from({ length: 10 }, (_, index) => {\n\treturn {\n\t\tid: `id-${index}`,\n\t\tcontent: `Item ${index}`,\n\t};\n});\n\nconst cardStyles = css({\n\twidth: 200,\n\tmarginBottom: 'var(--grid)',\n\tpadding: 'var(--grid)',\n\tbackgroundColor: token('elevation.surface.raised', '#FFF'),\n\tboxShadow: token('elevation.shadow.raised', '0px 1px 1px #091E4240, 0px 0px 1px #091E424F'),\n\tborderRadius: 3,\n});\n\nfunction Card({ quote, index }: { quote: ItemData; index: number }) {\n\tconst { Draggable } = useDependency();\n\n\treturn (\n\t\t<Draggable draggableId={quote.id} index={index}>\n\t\t\t{(provided) => (\n\t\t\t\t<div\n\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\tcss={cardStyles}\n\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t>\n\t\t\t\t\t{quote.content}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</Draggable>\n\t);\n}\n\nfunction List({ items }: { items: ItemData[] }) {\n\tconst { Droppable } = useDependency();\n\n\tconst cards = useMemo(() => {\n\t\treturn items.map((quote: ItemData, index: number) => (\n\t\t\t<Card quote={quote} index={index} key={quote.id} />\n\t\t));\n\t}, [items]);\n\n\treturn (\n\t\t<Droppable droppableId=\"list\">\n\t\t\t{(provided) => (\n\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t{cards}\n\t\t\t\t\t{provided.placeholder}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</Droppable>\n\t);\n}\n\nfunction App() {\n\tconst { DragDropContext } = useDependency();\n\n\tconst [items, setItems] = useState(initialData);\n\n\tconst onDragEnd = useCallback((result: DropResult) => {\n\t\tif (!result.destination) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (result.destination.index === result.source.index) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst startIndex = result.source.index;\n\t\tconst finishIndex = result.destination.index;\n\n\t\tsetItems((items) => {\n\t\t\treturn reorder({\n\t\t\t\tlist: items,\n\t\t\t\tstartIndex,\n\t\t\t\tfinishIndex,\n\t\t\t});\n\t\t});\n\t}, []);\n\n\treturn (\n\t\t<DragDropContext onDragEnd={onDragEnd}>\n\t\t\t<List items={items} />\n\t\t</DragDropContext>\n\t);\n}\n\nexport default function VerticalListExample(): React.JSX.Element {\n\treturn (\n\t\t<ExampleWrapper>\n\t\t\t<App />\n\t\t</ExampleWrapper>\n\t);\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/examples/01-board.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport React, { useCallback, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport type { DropResult } from 'react-beautiful-dnd';\n\nimport Button from '@atlaskit/button/new';\n\nimport { clearColumn, getInitialData, moveCard, reorderCard, reorderColumn } from './data/tasks';\nimport { Column } from './pieces/column';\nimport { ExampleWrapper, useDependency } from './pieces/example-wrapper';\n\nconst boardStyles = css({\n\tdisplay: 'flex',\n\tjustifyContent: 'center',\n\tflexDirection: 'row',\n\theight: 480,\n});\n\nfunction BoardExample() {\n\tconst { DragDropContext, Droppable } = useDependency();\n\n\tconst [data, setData] = useState(() => getInitialData());\n\n\tconst onDragEnd = useCallback((result: DropResult) => {\n\t\tconst { source, destination, type } = result;\n\n\t\t// didn't drop on anything\n\t\tif (!destination) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (type === 'column') {\n\t\t\tsetData((data) => reorderColumn(data, result));\n\t\t\treturn;\n\t\t}\n\n\t\tif (type === 'card') {\n\t\t\tif (source.droppableId === destination.droppableId) {\n\t\t\t\t// same column\n\t\t\t\tsetData((data) => reorderCard(data, result));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// moving to a new column\n\t\t\tsetData((data) => moveCard(data, result));\n\t\t}\n\t}, []);\n\n\tconst handleClearColumnC = useCallback(() => {\n\t\tsetData((data) => clearColumn(data, 'C'));\n\t}, []);\n\n\treturn (\n\t\t<DragDropContext onDragEnd={onDragEnd}>\n\t\t\t<Droppable droppableId=\"board\" type=\"column\" direction=\"horizontal\">\n\t\t\t\t{(provided) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t{...provided.droppableProps}\n\t\t\t\t\t\t\tdata-testid=\"board\"\n\t\t\t\t\t\t\tcss={boardStyles}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{data.orderedColumnIds.map((columnId, index) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<Column\n\t\t\t\t\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\t\t\t\t\tdroppableId={columnId}\n\t\t\t\t\t\t\t\t\t\tcolumn={data.columnMap[columnId]}\n\t\t\t\t\t\t\t\t\t\tkey={columnId}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t{provided.placeholder}\n\t\t\t\t\t\t\t<Button onClick={handleClearColumnC}>Clear column C</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t}}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n\nexport default function (): React.JSX.Element {\n\treturn (\n\t\t<ExampleWrapper>\n\t\t\t<BoardExample />\n\t\t</ExampleWrapper>\n\t);\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/examples/02-react-window.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport React, { useCallback, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport type { DropResult } from 'react-beautiful-dnd';\n\nimport Button from '@atlaskit/button/new';\n\nimport { clearColumn, getInitialData, moveCard, reorderCard, reorderColumn } from './data/tasks';\nimport { ExampleWrapper, useDependency } from './pieces/example-wrapper';\nimport { Column } from './pieces/react-window/column';\n\nconst boardStyles = css({\n\tdisplay: 'flex',\n\tjustifyContent: 'center',\n\tflexDirection: 'row',\n\theight: 480,\n});\n\nfunction BoardExample() {\n\tconst { DragDropContext, Droppable } = useDependency();\n\n\tconst [data, setData] = useState(() => getInitialData());\n\n\tconst onDragEnd = useCallback((result: DropResult) => {\n\t\tconst { source, destination, type } = result;\n\n\t\t// didn't drop on anything\n\t\tif (!destination) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (type === 'column') {\n\t\t\tsetData((data) => reorderColumn(data, result));\n\t\t\treturn;\n\t\t}\n\n\t\tif (type === 'card') {\n\t\t\tif (source.droppableId === destination.droppableId) {\n\t\t\t\t// same column\n\t\t\t\tsetData((data) => reorderCard(data, result));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// moving to a new column\n\t\t\tsetData((data) => moveCard(data, result));\n\t\t}\n\t}, []);\n\n\tconst handleClearColumnC = useCallback(() => {\n\t\tsetData((data) => clearColumn(data, 'C'));\n\t}, []);\n\n\treturn (\n\t\t<DragDropContext onDragEnd={onDragEnd}>\n\t\t\t<Droppable droppableId=\"board\" type=\"column\" direction=\"horizontal\">\n\t\t\t\t{(provided) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t{...provided.droppableProps}\n\t\t\t\t\t\t\tdata-testid=\"board\"\n\t\t\t\t\t\t\tcss={boardStyles}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{data.orderedColumnIds.map((columnId, index) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<Column\n\t\t\t\t\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\t\t\t\t\tdroppableId={columnId}\n\t\t\t\t\t\t\t\t\t\tcolumn={data.columnMap[columnId]}\n\t\t\t\t\t\t\t\t\t\tkey={columnId}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t{provided.placeholder}\n\t\t\t\t\t\t\t<Button onClick={handleClearColumnC}>Clear column C</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t}}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n\nexport default function (): React.JSX.Element {\n\treturn (\n\t\t<ExampleWrapper>\n\t\t\t<BoardExample />\n\t\t</ExampleWrapper>\n\t);\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/examples/03-react-virtualized.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport React, { useCallback, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport type { DropResult } from 'react-beautiful-dnd';\n\nimport Button from '@atlaskit/button/new';\n\nimport { clearColumn, getInitialData, moveCard, reorderCard, reorderColumn } from './data/tasks';\nimport { ExampleWrapper, useDependency } from './pieces/example-wrapper';\nimport { Column } from './pieces/react-virtualized/column';\n\nconst boardStyles = css({\n\tdisplay: 'flex',\n\tjustifyContent: 'center',\n\tflexDirection: 'row',\n\theight: 480,\n});\n\nfunction BoardExample() {\n\tconst { DragDropContext, Droppable } = useDependency();\n\n\tconst [data, setData] = useState(() => getInitialData());\n\n\tconst onDragEnd = useCallback((result: DropResult) => {\n\t\tconst { source, destination, type } = result;\n\n\t\t// didn't drop on anything\n\t\tif (!destination) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (type === 'column') {\n\t\t\tsetData((data) => reorderColumn(data, result));\n\t\t\treturn;\n\t\t}\n\n\t\tif (type === 'card') {\n\t\t\tif (source.droppableId === destination.droppableId) {\n\t\t\t\t// same column\n\t\t\t\tsetData((data) => reorderCard(data, result));\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// moving to a new column\n\t\t\tsetData((data) => moveCard(data, result));\n\t\t}\n\t}, []);\n\n\tconst handleClearColumnC = useCallback(() => {\n\t\tsetData((data) => clearColumn(data, 'C'));\n\t}, []);\n\n\treturn (\n\t\t<DragDropContext onDragEnd={onDragEnd}>\n\t\t\t<Droppable droppableId=\"board\" type=\"column\" direction=\"horizontal\">\n\t\t\t\t{(provided) => {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t{...provided.droppableProps}\n\t\t\t\t\t\t\tdata-testid=\"board\"\n\t\t\t\t\t\t\tcss={boardStyles}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{data.orderedColumnIds.map((columnId, index) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<Column\n\t\t\t\t\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\t\t\t\t\tdroppableId={columnId}\n\t\t\t\t\t\t\t\t\t\tcolumn={data.columnMap[columnId]}\n\t\t\t\t\t\t\t\t\t\tkey={columnId}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t})}\n\t\t\t\t\t\t\t{provided.placeholder}\n\t\t\t\t\t\t\t<Button onClick={handleClearColumnC}>Clear column C</Button>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t);\n\t\t\t\t}}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n\nexport default function (): React.JSX.Element {\n\treturn (\n\t\t<ExampleWrapper>\n\t\t\t<BoardExample />\n\t\t</ExampleWrapper>\n\t);\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/examples/04-multi-context.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport React from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport { ExampleWrapper, useDependency } from './pieces/example-wrapper';\n\nconst itemData = [{ id: '0' }, { id: '1' }, { id: '2' }];\n\nfunction VerticalList() {\n\tconst { DragDropContext, Draggable, Droppable } = useDependency();\n\n\treturn (\n\t\t<DragDropContext\n\t\t\tonDragStart={(start) => console.log(start)}\n\t\t\tonDragUpdate={(update) => console.log(update)}\n\t\t\tonDragEnd={(result) => console.log(result)}\n\t\t>\n\t\t\t<Droppable droppableId=\"droppable\">\n\t\t\t\t{(provided) => (\n\t\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t\t{itemData.map((item, index) => (\n\t\t\t\t\t\t\t<Draggable key={item.id} draggableId={item.id} index={index}>\n\t\t\t\t\t\t\t\t{(provided) => (\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{item.id}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</Draggable>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t</Droppable>\n\t\t</DragDropContext>\n\t);\n}\n\nconst layoutStyles = css({ display: 'flex', gap: 48 });\n\nexport default function MultiContextExample(): React.JSX.Element {\n\treturn (\n\t\t<ExampleWrapper>\n\t\t\t<div css={layoutStyles}>\n\t\t\t\t<VerticalList />\n\t\t\t\t<VerticalList />\n\t\t\t</div>\n\t\t</ExampleWrapper>\n\t);\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/examples/05-scroll-container.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n * @jsxFrag\n */\nimport React, { useCallback, useMemo, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport type { DropResult } from 'react-beautiful-dnd';\n\nimport Button from '@atlaskit/button/new';\nimport { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';\nimport { token } from '@atlaskit/tokens';\n\nimport { ExampleWrapper, useDependency } from './pieces/example-wrapper';\n\ntype ItemData = {\n\tid: string;\n\tcontent: string;\n};\n\nconst initialData: ItemData[] = Array.from({ length: 15 }, (_, index) => {\n\treturn {\n\t\tid: `id-${index}`,\n\t\tcontent: `Item ${index}`,\n\t};\n});\n\nconst cardStyles = css({\n\twidth: 200,\n\tmarginBottom: 'var(--grid)',\n\tpadding: 'var(--grid)',\n\tbackgroundColor: token('elevation.surface.raised', '#FFF'),\n\tboxShadow: token('elevation.shadow.raised', '0px 1px 1px #091E4240, 0px 0px 1px #091E424F'),\n\tborderRadius: 3,\n});\n\nfunction Card({ quote, index }: { quote: ItemData; index: number }) {\n\tconst { Draggable } = useDependency();\n\n\treturn (\n\t\t<Draggable draggableId={quote.id} index={index}>\n\t\t\t{(provided) => (\n\t\t\t\t<div\n\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\tcss={cardStyles}\n\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\tdata-testid={`card-${index}`}\n\t\t\t\t\tid={`card-${index}`}\n\t\t\t\t>\n\t\t\t\t\t{quote.content}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</Draggable>\n\t);\n}\n\nfunction List({ items }: { items: ItemData[] }) {\n\tconst { Droppable } = useDependency();\n\n\tconst cards = useMemo(() => {\n\t\treturn items.map((quote: ItemData, index: number) => (\n\t\t\t<Card quote={quote} index={index} key={quote.id} />\n\t\t));\n\t}, [items]);\n\n\treturn (\n\t\t<Droppable droppableId=\"list\">\n\t\t\t{(provided) => (\n\t\t\t\t<div ref={provided.innerRef} {...provided.droppableProps}>\n\t\t\t\t\t{cards}\n\t\t\t\t\t{provided.placeholder}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</Droppable>\n\t);\n}\n\nexport function App(): React.JSX.Element {\n\tconst { DragDropContext } = useDependency();\n\n\tconst [items, setItems] = useState(initialData);\n\n\tconst onDragEnd = useCallback((result: DropResult) => {\n\t\tif (!result.destination) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (result.destination.index === result.source.index) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst startIndex = result.source.index;\n\t\tconst finishIndex = result.destination.index;\n\n\t\tsetItems((items) => {\n\t\t\treturn reorder({\n\t\t\t\tlist: items,\n\t\t\t\tstartIndex,\n\t\t\t\tfinishIndex,\n\t\t\t});\n\t\t});\n\t}, []);\n\n\tconst handleScrollToBottom = useCallback(() => {\n\t\tconst bottomCard = document.getElementById('card-14');\n\t\tif (bottomCard) {\n\t\t\tbottomCard.scrollIntoView();\n\t\t}\n\t}, []);\n\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tid=\"scroll-container\"\n\t\t\t\tstyle={{\n\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\theight: 400,\n\t\t\t\t\t/**\n\t\t\t\t\t * Using `hidden` for `overflow-x` to avoid a horizontal scrollbar.\n\t\t\t\t\t *\n\t\t\t\t\t * When using `auto` one would appear initially, but would disappear\n\t\t\t\t\t * after starting a drag. This caused a layout shift, and broke things.\n\t\t\t\t\t */\n\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\toverflow: 'hidden auto',\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<DragDropContext onDragEnd={onDragEnd}>\n\t\t\t\t\t<List items={items} />\n\t\t\t\t</DragDropContext>\n\t\t\t</div>\n\t\t\t<Button onClick={handleScrollToBottom}>Scroll to bottom</Button>\n\t\t</>\n\t);\n}\n\nexport default function VerticalListExample(): React.JSX.Element {\n\treturn (\n\t\t<ExampleWrapper>\n\t\t\t<App />\n\t\t</ExampleWrapper>\n\t);\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/examples/config.jsonc",
    "content": "/**\n * This file is used by the test scaling project to optimise test result caching\n * Examples that are used by tests affect the outcome of tests so must be included when hashing\n * They are defined here so the hashing algorithm doesn't need to search test files for example usage each time\n */\n{\n  \"testExamples\": [\n    \"01-board.tsx\",\n    \"02-react-window.tsx\",\n    \"03-react-virtualized.tsx\",\n    \"05-scroll-container.tsx\",\n    \"column.tsx\"\n  ]\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/examples/data/tasks.ts",
    "content": "import type { DropResult } from 'react-beautiful-dnd';\n\nimport { reorder } from '@atlaskit/pragmatic-drag-and-drop/reorder';\n\nexport type Item = {\n\titemId: string;\n};\n\nexport type ColumnType = {\n\ttitle: string;\n\tcolumnId: string;\n\titems: Item[];\n};\nexport type ColumnMap = { [columnId: string]: ColumnType };\n\nfunction getItems({ count, startColumnId }: { count: number; startColumnId: string }): Item[] {\n\treturn Array.from(\n\t\t{ length: count },\n\t\t(_, index): Item => ({\n\t\t\titemId: `${startColumnId}${index}`,\n\t\t}),\n\t);\n}\n\nexport type Data = {\n\tcolumnMap: ColumnMap;\n\torderedColumnIds: string[];\n};\n\nexport function getInitialData(): Data {\n\tconst orderedColumnIds: string[] = ['A', 'B', 'C'];\n\tconst columns: ColumnType[] = orderedColumnIds.map((columnId, index) => {\n\t\tconst column: ColumnType = {\n\t\t\ttitle: `Column ${columnId}`,\n\t\t\tcolumnId: columnId,\n\t\t\titems: getItems({\n\t\t\t\tstartColumnId: columnId,\n\t\t\t\tcount: Math.max(10 - 2 * index, 0),\n\t\t\t}),\n\t\t};\n\t\treturn column;\n\t});\n\tconst columnMap = columns.reduce((acc: ColumnMap, column) => {\n\t\tacc[column.columnId] = column;\n\t\treturn acc;\n\t}, {});\n\n\treturn { columnMap, orderedColumnIds };\n}\n\nexport function reorderColumn(data: Data, { source, destination }: DropResult): Data {\n\tif (!destination) {\n\t\treturn data;\n\t}\n\n\tconst startIndex = source.index;\n\tconst finishIndex = destination.index;\n\n\treturn {\n\t\t...data,\n\t\torderedColumnIds: reorder({\n\t\t\tlist: data.orderedColumnIds,\n\t\t\tstartIndex,\n\t\t\tfinishIndex,\n\t\t}),\n\t};\n}\n\n/**\n * Reorders a card within the same list.\n */\nexport function reorderCard(data: Data, { source, destination }: DropResult): Data {\n\tif (!destination) {\n\t\treturn data;\n\t}\n\n\tconst column = data.columnMap[source.droppableId];\n\n\tconst updatedItems = reorder({\n\t\tlist: column.items,\n\t\tstartIndex: source.index,\n\t\tfinishIndex: destination.index,\n\t});\n\n\tconst updatedMap = {\n\t\t...data.columnMap,\n\t\t[source.droppableId]: {\n\t\t\t...column,\n\t\t\titems: updatedItems,\n\t\t},\n\t};\n\n\treturn { ...data, columnMap: updatedMap };\n}\n\n/**\n * Moves a card to a different list.\n */\nexport function moveCard(data: Data, { source, destination, draggableId }: DropResult): Data {\n\tif (!destination) {\n\t\treturn data;\n\t}\n\n\tconst sourceColumn = data.columnMap[source.droppableId];\n\tconst destinationColumn = data.columnMap[destination.droppableId];\n\n\tconst item = sourceColumn.items.find(({ itemId }) => itemId === draggableId);\n\n\tif (item === undefined) {\n\t\treturn data;\n\t}\n\n\tconst updatedMap = {\n\t\t...data.columnMap,\n\t\t[sourceColumn.columnId]: {\n\t\t\t...sourceColumn,\n\t\t\titems: sourceColumn.items.filter((i) => i !== item),\n\t\t},\n\t\t[destinationColumn.columnId]: {\n\t\t\t...destinationColumn,\n\t\t\titems: [\n\t\t\t\t...destinationColumn.items.slice(0, destination.index),\n\t\t\t\titem,\n\t\t\t\t...destinationColumn.items.slice(destination.index),\n\t\t\t],\n\t\t},\n\t};\n\n\treturn { ...data, columnMap: updatedMap };\n}\n\n/**\n * Clears the items in a column.\n */\nexport function clearColumn(data: Data, columnId: string): Data {\n\tconst updatedMap = {\n\t\t...data.columnMap,\n\t\t[columnId]: {\n\t\t\t...data.columnMap[columnId],\n\t\t\titems: [],\n\t\t},\n\t};\n\n\treturn { ...data, columnMap: updatedMap };\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/examples/pieces/card.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { memo } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport type { DraggableProvided, DraggableStateSnapshot } from 'react-beautiful-dnd';\n\nimport { token } from '@atlaskit/tokens';\n\nimport type { Item } from '../data/tasks';\n\nimport { useDependency } from './example-wrapper';\n\nconst cardStyles = css({\n\tdisplay: 'flex',\n\theight: 'calc(var(--grid) * 7)',\n\tposition: 'relative',\n\talignItems: 'center',\n\tjustifyContent: 'center',\n\tgap: 'var(--grid)',\n\tflexDirection: 'row',\n\tbackground: token('elevation.surface.raised', '#FFF'),\n\tborderRadius: 'calc(var(--grid) / 2)',\n\tboxShadow: `0px 0px 1px rgba(9, 30, 66, 0.31), 0px 1px 1px rgba(9, 30, 66, 0.25)`,\n\tuserSelect: 'none',\n\tmarginBottom: 'var(--card-gap)',\n});\n\nconst cardDraggingStyles = css({\n\tboxShadow: token(\n\t\t'elevation.shadow.overlay',\n\t\t'0px 8px 12px rgba(9, 30, 66, 0.15),0px 0px 1px rgba(9, 30, 66, 0.31)',\n\t),\n});\n\nconst idStyles = css({\n\tposition: 'absolute',\n\ttop: 'var(--grid)',\n\tright: 'var(--grid)',\n\tcolor: token('color.text.disabled', '#091E424F'),\n\tfontSize: '10px',\n});\n\nfunction DragIcon({ state }: { state: DraggableState }) {\n\treturn (\n\t\t<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n\t\t\t<path\n\t\t\t\td=\"M5.70711 9.70711L6.41421 9L5 7.58579L4.29289 8.29289L5.70711 9.70711ZM2 12L1.29289 11.2929L0.585786 12L1.29289 12.7071L2 12ZM4.29289 15.7071L5 16.4142L6.41421 15L5.70711 14.2929L4.29289 15.7071ZM8.29289 4.29289L7.58579 5L9 6.41421L9.70711 5.70711L8.29289 4.29289ZM12 2L12.7071 1.29289L12 0.585786L11.2929 1.29289L12 2ZM14.2929 5.70711L15 6.41421L16.4142 5L15.7071 4.29289L14.2929 5.70711ZM15.7071 19.7071L16.4142 19L15 17.5858L14.2929 18.2929L15.7071 19.7071ZM12 22L11.2929 22.7071L12 23.4142L12.7071 22.7071L12 22ZM9.70711 18.2929L9 17.5858L7.58579 19L8.29289 19.7071L9.70711 18.2929ZM19.7071 8.29289L19 7.58579L17.5858 9L18.2929 9.70711L19.7071 8.29289ZM22 12L22.7071 12.7071L23.4142 12L22.7071 11.2929L22 12ZM18.2929 14.2929L17.5858 15L19 16.4142L19.7071 15.7071L18.2929 14.2929ZM4.29289 8.29289L1.29289 11.2929L2.70711 12.7071L5.70711 9.70711L4.29289 8.29289ZM1.29289 12.7071L4.29289 15.7071L5.70711 14.2929L2.70711 11.2929L1.29289 12.7071ZM9.70711 5.70711L12.7071 2.70711L11.2929 1.29289L8.29289 4.29289L9.70711 5.70711ZM11.2929 2.70711L14.2929 5.70711L15.7071 4.29289L12.7071 1.29289L11.2929 2.70711ZM14.2929 18.2929L11.2929 21.2929L12.7071 22.7071L15.7071 19.7071L14.2929 18.2929ZM12.7071 21.2929L9.70711 18.2929L8.29289 19.7071L11.2929 22.7071L12.7071 21.2929ZM18.2929 9.70711L21.2929 12.7071L22.7071 11.2929L19.7071 8.29289L18.2929 9.70711ZM21.2929 11.2929L18.2929 14.2929L19.7071 15.7071L22.7071 12.7071L21.2929 11.2929ZM2 13H22V11H2V13ZM11 2V22H13V2H11Z\"\n\t\t\t\tfill={\n\t\t\t\t\tstate === 'dragging'\n\t\t\t\t\t\t? token('color.text.disabled', '#091E424F')\n\t\t\t\t\t\t: `${token('color.icon.brand', '#0C66E4')}`\n\t\t\t\t}\n\t\t\t/>\n\t\t</svg>\n\t);\n}\n\ntype DraggableState = 'idle' | 'generate-preview' | 'dragging';\nconst cardText: { [State in DraggableState]: string } = {\n\t'generate-preview': 'Drag preview',\n\tidle: 'Draggable',\n\tdragging: 'Draggable source',\n};\n\nconst cardTextStyles = css({\n\tmargin: 0,\n});\nconst cardTextDraggingStyles = css({\n\tcolor: token('color.text.disabled', '#091E424F'),\n});\n\nfunction CardText({ state }: { state: DraggableState }) {\n\treturn (\n\t\t<h4 css={[cardTextStyles, state === 'dragging' ? cardTextDraggingStyles : undefined]}>\n\t\t\t{cardText[state]}\n\t\t</h4>\n\t);\n}\n\ntype CardProps = {\n\titem: Item;\n\tindex: number;\n\tdraggableId: string;\n};\n\nexport function CardInner({\n\tprovided,\n\tsnapshot,\n\titem,\n}: {\n\tprovided: DraggableProvided;\n\tsnapshot: DraggableStateSnapshot;\n\titem: Item;\n}): React.JSX.Element {\n\tconst state = snapshot.isDragging ? 'dragging' : 'idle';\n\n\treturn (\n\t\t<div\n\t\t\tcss={[cardStyles, snapshot.isDragging && cardDraggingStyles]}\n\t\t\tref={provided.innerRef}\n\t\t\tdata-testid={`item-${item.itemId}`}\n\t\t\tdata-is-dragging={snapshot.isDragging}\n\t\t\t{...provided.draggableProps}\n\t\t\t{...provided.dragHandleProps}\n\t\t>\n\t\t\t<span css={idStyles}>ID: {item.itemId}</span>\n\t\t\t<DragIcon state={state} />\n\t\t\t<CardText state={state} />\n\t\t</div>\n\t);\n}\n\nexport const Card = memo(({ item, index, draggableId }: CardProps): React.JSX.Element => {\n\tconst { Draggable } = useDependency();\n\n\treturn (\n\t\t<Draggable index={index} draggableId={draggableId}>\n\t\t\t{(provided, snapshot) => {\n\t\t\t\treturn <CardInner provided={provided} snapshot={snapshot} item={item} />;\n\t\t\t}}\n\t\t</Draggable>\n\t);\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/examples/pieces/column.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { memo } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\n\nimport { easeInOut } from '@atlaskit/motion/curves';\nimport { durations } from '@atlaskit/motion/durations';\nimport { token } from '@atlaskit/tokens';\n\nimport type { ColumnType } from '../data/tasks';\n\nimport { Card } from './card';\nimport { useDependency } from './example-wrapper';\n\nconst columnStyles = css({\n\tdisplay: 'flex',\n\twidth: 250,\n\tflexDirection: 'column',\n\tbackground: token('elevation.surface.sunken', '#F7F8F9'),\n\tborderRadius: 'calc(var(--grid) * 2)',\n\tposition: 'relative',\n\toverflow: 'hidden',\n\tmarginRight: 'var(--column-gap)',\n});\n\nconst columnDraggingStyles = css({\n\tboxShadow: token(\n\t\t'elevation.shadow.overlay',\n\t\t'0px 8px 12px rgba(9, 30, 66, 0.15),0px 0px 1px rgba(9, 30, 66, 0.31)',\n\t),\n});\n\nconst scrollContainerStyles = css({\n\theight: '100%',\n\toverflowY: 'auto',\n});\n\nconst cardListStyles = css({\n\tdisplay: 'flex',\n\tboxSizing: 'border-box',\n\tminHeight: '100%',\n\tpadding: 'var(--grid)',\n\tflexDirection: 'column',\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values\n\ttransition: `background ${durations.medium}ms ${easeInOut}`,\n});\n\nconst columnHeaderStyles = css({\n\tdisplay: 'flex',\n\tpadding: 'calc(var(--grid) * 2) calc(var(--grid) * 2) calc(var(--grid) * 1)',\n\tjustifyContent: 'space-between',\n\tflexDirection: 'row',\n\tcolor: token('color.text.subtlest', '#626F86'),\n\tuserSelect: 'none',\n});\n\nconst columnHeaderIdStyles = css({\n\tcolor: token('color.text.disabled', '#091E424F'),\n\tfontSize: '10px',\n});\n\nconst isDraggingOverColumnStyles = css({\n\tbackground: token('color.background.selected.hovered', '#CCE0FF'),\n});\n\ntype ColumnProps = {\n\tcolumn: ColumnType;\n\tdroppableId: string;\n\tindex: number;\n};\n\nexport const Column = memo(({ column, droppableId, index }: ColumnProps): React.JSX.Element => {\n\tconst { Draggable, Droppable } = useDependency();\n\n\tconst columnId = column.columnId;\n\n\treturn (\n\t\t<Draggable draggableId={`draggable-${column.columnId}`} index={index}>\n\t\t\t{(provided, snapshot) => {\n\t\t\t\treturn (\n\t\t\t\t\t<div\n\t\t\t\t\t\tcss={[columnStyles, snapshot.isDragging && columnDraggingStyles]}\n\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t{...provided.draggableProps}\n\t\t\t\t\t>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tcss={columnHeaderStyles}\n\t\t\t\t\t\t\tdata-testid={`column-${columnId}--header`}\n\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<h6>{column.title}</h6>\n\t\t\t\t\t\t\t<span css={columnHeaderIdStyles}>ID: {column.columnId}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Droppable droppableId={droppableId} type=\"card\">\n\t\t\t\t\t\t\t{(provided, snapshot) => {\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\tcss={scrollContainerStyles}\n\t\t\t\t\t\t\t\t\t\tref={provided.innerRef}\n\t\t\t\t\t\t\t\t\t\t{...provided.droppableProps}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\tcss={[cardListStyles, snapshot.isDraggingOver && isDraggingOverColumnStyles]}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t{column.items.map((item, index) => (\n\t\t\t\t\t\t\t\t\t\t\t\t<Card\n\t\t\t\t\t\t\t\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\t\t\t\t\t\t\t\tdraggableId={item.itemId}\n\t\t\t\t\t\t\t\t\t\t\t\t\titem={item}\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey={item.itemId}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t\t\t\t{provided.placeholder}\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t</Droppable>\n\t\t\t\t\t</div>\n\t\t\t\t);\n\t\t\t}}\n\t\t</Draggable>\n\t);\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/examples/pieces/example-wrapper.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport {\n\ttype ComponentType,\n\tcreateContext,\n\ttype ReactNode,\n\tuseCallback,\n\tuseContext,\n\tuseState,\n} from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport * as rbd from 'react-beautiful-dnd';\nimport type { DragDropContextProps, DraggableProps, DroppableProps } from 'react-beautiful-dnd';\n\nimport { RadioGroup } from '@atlaskit/radio';\nimport type { OptionsPropType } from '@atlaskit/radio/types';\n\nimport * as migration from '../../src';\n\nimport { GlobalStyles } from './global-styles';\n\ntype SwitcherProps = {\n\tchildren: ReactNode;\n};\n\nconst DependencyContext = createContext<Library>('migration');\n\ntype Library = 'migration' | 'rbd';\n\nconst options: OptionsPropType = [\n\t{ name: 'library', value: 'migration', label: 'Migration layer' },\n\t{ name: 'library', value: 'rbd', label: 'react-beautiful-dnd' },\n];\n\nconst wrapperStyles = css({\n\tdisplay: 'flex',\n\tgap: 'calc(3 * var(--grid))',\n});\n\nexport function ExampleWrapper({ children }: SwitcherProps): React.JSX.Element {\n\tconst [library, setLibrary] = useState<Library>('migration');\n\n\tconst onChange = useCallback((event: React.ChangeEvent<HTMLInputElement>) => {\n\t\tsetLibrary(event.target.value as Library);\n\t}, []);\n\n\treturn (\n\t\t<DependencyContext.Provider value={library}>\n\t\t\t<GlobalStyles />\n\t\t\t<div css={wrapperStyles}>\n\t\t\t\t<div>\n\t\t\t\t\t<RadioGroup options={options} value={library} onChange={onChange} />\n\t\t\t\t</div>\n\t\t\t\t<div>{children}</div>\n\t\t\t</div>\n\t\t</DependencyContext.Provider>\n\t);\n}\n\ntype Components = {\n\tDragDropContext: ComponentType<DragDropContextProps>;\n\tDraggable: ComponentType<DraggableProps>;\n\tDroppable: ComponentType<DroppableProps>;\n};\n\nconst componentMap: Record<Library, Components> = {\n\tmigration,\n\trbd,\n};\n\nexport function useDependency(): Components {\n\tconst library = useContext(DependencyContext);\n\n\treturn componentMap[library];\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/examples/pieces/global-styles.tsx",
    "content": "import React from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/no-global-styles, @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, Global } from '@emotion/react';\n\nconst globalStyles = css({\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766\n\t':root': {\n\t\t'--grid': '8px',\n\t\t'--card-gap': 'var(--grid)',\n\t\t'--column-gap': 'calc(var(--grid) * 2)',\n\t},\n});\n\nexport function GlobalStyles(): React.JSX.Element {\n\treturn <Global styles={globalStyles} />;\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/examples/pieces/react-virtualized/column.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { memo } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport { findDOMNode } from 'react-dom';\nimport { List, type ListRowProps } from 'react-virtualized';\nimport invariant from 'tiny-invariant';\n\nimport { easeInOut } from '@atlaskit/motion/curves';\nimport { durations } from '@atlaskit/motion/durations';\nimport { token } from '@atlaskit/tokens';\n\nimport type { ColumnType } from '../../data/tasks';\nimport { Card, CardInner } from '../card';\nimport { useDependency } from '../example-wrapper';\n\nconst columnStyles = css({\n\tdisplay: 'flex',\n\twidth: 250,\n\tflexDirection: 'column',\n\tbackground: token('elevation.surface.sunken', '#F7F8F9'),\n\tborderRadius: 'calc(var(--grid) * 2)',\n\tposition: 'relative',\n\toverflow: 'hidden',\n\tmarginRight: 'var(--column-gap)',\n\theight: '100%',\n});\n\nconst columnHeaderStyles = css({\n\tdisplay: 'flex',\n\tpadding: 'calc(var(--grid) * 2) calc(var(--grid) * 2) calc(var(--grid) * 1)',\n\tjustifyContent: 'space-between',\n\tflexDirection: 'row',\n\tcolor: token('color.text.subtlest', '#626F86'),\n\tuserSelect: 'none',\n});\n\nconst columnHeaderIdStyles = css({\n\tcolor: token('color.text.disabled', '#091E424F'),\n\tfontSize: '10px',\n});\n\ntype ColumnProps = {\n\tcolumn: ColumnType;\n\tdroppableId: string;\n\tindex: number;\n};\n\nconst GUTTER_SIZE = 8;\n\nexport const Column = memo(({ column, droppableId, index }: ColumnProps): React.JSX.Element => {\n\tconst { Draggable, Droppable } = useDependency();\n\n\tconst columnId = column.columnId;\n\n\treturn (\n\t\t<Draggable draggableId={`draggable-${column.columnId}`} index={index}>\n\t\t\t{(provided) => {\n\t\t\t\treturn (\n\t\t\t\t\t<div css={columnStyles} ref={provided.innerRef} {...provided.draggableProps}>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tcss={columnHeaderStyles}\n\t\t\t\t\t\t\tdata-testid={`column-${columnId}--header`}\n\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<h6>{column.title}</h6>\n\t\t\t\t\t\t\t<span css={columnHeaderIdStyles}>ID: {column.columnId}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Droppable\n\t\t\t\t\t\t\tdroppableId={droppableId}\n\t\t\t\t\t\t\ttype=\"card\"\n\t\t\t\t\t\t\tmode=\"virtual\"\n\t\t\t\t\t\t\trenderClone={(provided, snapshot, rubric) => {\n\t\t\t\t\t\t\t\tconst index = rubric.source.index;\n\t\t\t\t\t\t\t\tconst item = column.items[index];\n\n\t\t\t\t\t\t\t\treturn <CardInner provided={provided} snapshot={snapshot} item={item} />;\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{(provided, snapshot) => {\n\t\t\t\t\t\t\t\tconst itemCount = column.items.length;\n\n\t\t\t\t\t\t\t\tconst style: React.CSSProperties = {\n\t\t\t\t\t\t\t\t\ttransition: `background ${durations.medium}ms ${easeInOut}`,\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\tif (snapshot.isDraggingOver) {\n\t\t\t\t\t\t\t\t\tstyle.background = token('color.background.selected.hovered', '#CCE0FF');\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<List\n\t\t\t\t\t\t\t\t\t\theight={440}\n\t\t\t\t\t\t\t\t\t\trowCount={itemCount}\n\t\t\t\t\t\t\t\t\t\trowHeight={({ index }) => (index === itemCount - 1 ? 72 : 64)}\n\t\t\t\t\t\t\t\t\t\twidth={250}\n\t\t\t\t\t\t\t\t\t\tref={(ref) => {\n\t\t\t\t\t\t\t\t\t\t\t// react-virtualized has no way to get the list's ref\n\t\t\t\t\t\t\t\t\t\t\t// So we use the `ReactDOM.findDOMNode(ref)` escape hatch to get the ref\n\t\t\t\t\t\t\t\t\t\t\tif (ref) {\n\t\t\t\t\t\t\t\t\t\t\t\t// DSP-10519 TODO: ReactDOM.findDOMNode is deprecated in React18, consider using alternative solution\n\t\t\t\t\t\t\t\t\t\t\t\t// https://react.dev/reference/react-dom/findDOMNode#alternatives\n\t\t\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line react/no-find-dom-node\n\t\t\t\t\t\t\t\t\t\t\t\tconst whatHasMyLifeComeTo = findDOMNode(ref);\n\t\t\t\t\t\t\t\t\t\t\t\tif (whatHasMyLifeComeTo instanceof HTMLElement) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tprovided.innerRef(whatHasMyLifeComeTo);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\tstyle={style}\n\t\t\t\t\t\t\t\t\t\trowRenderer={({ index, style }: ListRowProps) => {\n\t\t\t\t\t\t\t\t\t\t\tconst item = column.items[index];\n\n\t\t\t\t\t\t\t\t\t\t\tif (!item) {\n\t\t\t\t\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\tinvariant(typeof style.left === 'number');\n\t\t\t\t\t\t\t\t\t\t\tinvariant(typeof style.top === 'number');\n\t\t\t\t\t\t\t\t\t\t\tinvariant(typeof style.height === 'number');\n\n\t\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\t\t\t\t\t\tkey={item.itemId}\n\t\t\t\t\t\t\t\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t...style,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tleft: style.left + GUTTER_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\twidth: `calc(100% - ${2 * GUTTER_SIZE}px)`,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttop: style.top + GUTTER_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\theight: style.height - GUTTER_SIZE,\n\t\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t\t<Card\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tkey={item.itemId}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tindex={index}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdraggableId={item.itemId}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\titem={item}\n\t\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t</Droppable>\n\t\t\t\t\t</div>\n\t\t\t\t);\n\t\t\t}}\n\t\t</Draggable>\n\t);\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/examples/pieces/react-window/column.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport React, { forwardRef, memo } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx } from '@emotion/react';\nimport { FixedSizeList } from 'react-window';\nimport invariant from 'tiny-invariant';\n\nimport { easeInOut } from '@atlaskit/motion/curves';\nimport { durations } from '@atlaskit/motion/durations';\nimport { token } from '@atlaskit/tokens';\n\nimport type { ColumnType, Item } from '../../data/tasks';\nimport { Card, CardInner } from '../card';\nimport { useDependency } from '../example-wrapper';\n\nconst columnStyles = css({\n\tdisplay: 'flex',\n\twidth: 250,\n\tflexDirection: 'column',\n\tbackground: token('elevation.surface.sunken', '#F7F8F9'),\n\tborderRadius: 'calc(var(--grid) * 2)',\n\tposition: 'relative',\n\toverflow: 'hidden',\n\tmarginRight: 'var(--column-gap)',\n\theight: '100%',\n});\n\nconst columnHeaderStyles = css({\n\tdisplay: 'flex',\n\tpadding: 'calc(var(--grid) * 2) calc(var(--grid) * 2) calc(var(--grid) * 1)',\n\tjustifyContent: 'space-between',\n\tflexDirection: 'row',\n\tcolor: token('color.text.subtlest', '#626F86'),\n\tuserSelect: 'none',\n});\n\nconst columnHeaderIdStyles = css({\n\tcolor: token('color.text.disabled', '#091E424F'),\n\tfontSize: '10px',\n});\n\ntype ColumnProps = {\n\tcolumn: ColumnType;\n\tdroppableId: string;\n\tindex: number;\n};\n\nconst GUTTER_SIZE = 8;\n\nconst innerElementType = forwardRef<HTMLDivElement, { style: React.CSSProperties }>(\n\t({ style, ...rest }, ref) => {\n\t\tinvariant(typeof style.height === 'number');\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tstyle={{\n\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\t...style,\n\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\tpaddingLeft: GUTTER_SIZE,\n\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\tpaddingTop: GUTTER_SIZE,\n\t\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t\tpaddingBottom: GUTTER_SIZE,\n\t\t\t\t\theight: style.height - GUTTER_SIZE,\n\t\t\t\t\twidth: `calc(${style.width} - ${GUTTER_SIZE}px)`,\n\t\t\t\t}}\n\t\t\t\tref={ref}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t);\n\t},\n);\n\nconst CardRenderer = ({\n\tindex,\n\tstyle,\n\tdata,\n}: {\n\tindex: number;\n\tstyle: React.CSSProperties;\n\tdata: Item[];\n}) => {\n\tconst item = data[index];\n\n\tif (!item) {\n\t\treturn null;\n\t}\n\n\tinvariant(typeof style.left === 'number');\n\tinvariant(typeof style.top === 'number');\n\tinvariant(typeof style.height === 'number');\n\n\treturn (\n\t\t<div\n\t\t\tstyle={{\n\t\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\t\t...style,\n\t\t\t\tleft: style.left + GUTTER_SIZE,\n\t\t\t\twidth: `calc(100% - ${2 * GUTTER_SIZE}px)`,\n\t\t\t\ttop: style.top + GUTTER_SIZE,\n\t\t\t\theight: style.height - GUTTER_SIZE,\n\t\t\t}}\n\t\t>\n\t\t\t<Card key={item.itemId} index={index} draggableId={item.itemId} item={item} />\n\t\t</div>\n\t);\n};\n\nexport const Column = memo(({ column, droppableId, index }: ColumnProps): React.JSX.Element => {\n\tconst { Draggable, Droppable } = useDependency();\n\n\tconst columnId = column.columnId;\n\n\treturn (\n\t\t<Draggable draggableId={`draggable-${column.columnId}`} index={index}>\n\t\t\t{(provided) => {\n\t\t\t\treturn (\n\t\t\t\t\t<div css={columnStyles} ref={provided.innerRef} {...provided.draggableProps}>\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tcss={columnHeaderStyles}\n\t\t\t\t\t\t\tdata-testid={`column-${columnId}--header`}\n\t\t\t\t\t\t\t{...provided.dragHandleProps}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<h6>{column.title}</h6>\n\t\t\t\t\t\t\t<span css={columnHeaderIdStyles}>ID: {column.columnId}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<Droppable\n\t\t\t\t\t\t\tdroppableId={droppableId}\n\t\t\t\t\t\t\ttype=\"card\"\n\t\t\t\t\t\t\tmode=\"virtual\"\n\t\t\t\t\t\t\trenderClone={(provided, snapshot, rubric) => {\n\t\t\t\t\t\t\t\tconst index = rubric.source.index;\n\t\t\t\t\t\t\t\tconst item = column.items[index];\n\n\t\t\t\t\t\t\t\treturn <CardInner provided={provided} snapshot={snapshot} item={item} />;\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{(provided, snapshot) => {\n\t\t\t\t\t\t\t\tconst itemCount = column.items.length;\n\n\t\t\t\t\t\t\t\tconst style: React.CSSProperties = {\n\t\t\t\t\t\t\t\t\ttransition: `background ${durations.medium}ms ${easeInOut}`,\n\t\t\t\t\t\t\t\t};\n\n\t\t\t\t\t\t\t\tif (snapshot.isDraggingOver) {\n\t\t\t\t\t\t\t\t\tstyle.background = token('color.background.selected.hovered', '#CCE0FF');\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<FixedSizeList\n\t\t\t\t\t\t\t\t\t\theight={440}\n\t\t\t\t\t\t\t\t\t\titemCount={itemCount}\n\t\t\t\t\t\t\t\t\t\titemSize={64}\n\t\t\t\t\t\t\t\t\t\twidth={250}\n\t\t\t\t\t\t\t\t\t\tinnerElementType={innerElementType}\n\t\t\t\t\t\t\t\t\t\titemData={column.items}\n\t\t\t\t\t\t\t\t\t\touterRef={provided.innerRef}\n\t\t\t\t\t\t\t\t\t\tstyle={style}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t{CardRenderer}\n\t\t\t\t\t\t\t\t\t</FixedSizeList>\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t</Droppable>\n\t\t\t\t\t</div>\n\t\t\t\t);\n\t\t\t}}\n\t\t</Draggable>\n\t);\n});\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/package.json",
    "content": "{\n  \"name\": \"@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration\",\n  \"version\": \"2.0.15\",\n  \"description\": \"An optional Pragmatic drag and drop package that enables rapid migration from react-beautiful-dnd to Pragmatic drag and drop\",\n  \"publishConfig\": {\n    \"registry\": \"https://registry.npmjs.org/\"\n  },\n  \"repository\": \"https://github.com/atlassian/pragmatic-drag-and-drop\",\n  \"homepage\": \"https://atlassian.design/components/pragmatic-drag-and-drop/\",\n  \"author\": \"Atlassian Pty Ltd\",\n  \"license\": \"Apache-2.0\",\n  \"main\": \"dist/cjs/index.js\",\n  \"module\": \"dist/esm/index.js\",\n  \"module:es2019\": \"dist/es2019/index.js\",\n  \"types\": \"dist/types/index.d.ts\",\n  \"sideEffects\": [\n    \"*.compiled.css\"\n  ],\n  \"exports\": {\n    \".\": \"./src/index.ts\"\n  },\n  \"dependencies\": {\n    \"@atlaskit/pragmatic-drag-and-drop\": \"^1.7.0\",\n    \"@atlaskit/pragmatic-drag-and-drop-hitbox\": \"^1.1.0\",\n    \"@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll\": \"^2.0.0\",\n    \"@atlaskit/tokens\": \"^11.1.0\",\n    \"@babel/runtime\": \"^7.0.0\",\n    \"@emotion/react\": \"^11.7.1\",\n    \"bind-event-listener\": \"^3.0.0\",\n    \"tiny-invariant\": \"^1.2.0\"\n  },\n  \"peerDependencies\": {\n    \"react\": \"^18.2.0\",\n    \"react-dom\": \"^18.2.0\"\n  },\n  \"devDependencies\": {\n    \"@atlaskit/codemod-utils\": \"^4.2.0\",\n    \"@atlaskit/motion\": \"^5.4.0\",\n    \"@atlaskit/radio\": \"^8.4.0\",\n    \"@testing-library/dom\": \"^10.1.0\",\n    \"@testing-library/react\": \"^16.3.0\",\n    \"@testing-library/user-event\": \"^14.4.3\",\n    \"@types/react-beautiful-dnd\": \"^13.1.4\",\n    \"@types/react-window\": \"^1.8.5\",\n    \"jscodeshift\": \"^17.0.0\",\n    \"raf-stub\": \"^2.0.1\",\n    \"react-beautiful-dnd\": \"^12.2.0\",\n    \"react-virtualized\": \"^9.22.6\",\n    \"react-window\": \"^1.8.8\",\n    \"stylelint\": \"^15.0.0\",\n    \"wait-for-expect\": \"^1.2.0\"\n  }\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/dev-warning.tsx",
    "content": "// This file has been copied from `react-beautiful-dnd`\n// <https://github.com/atlassian/react-beautiful-dnd/blob/v13.1.1/src/dev-warning.js>\n\nfunction noop() {}\n\ntype Log = (type: 'error' | 'warn', message: string) => void;\n\nexport const log: Log =\n\t// no warnings in production\n\tprocess.env.NODE_ENV === 'production'\n\t\t? noop\n\t\t: /**\n\t\t\t * An Immediately Invoked Function Expression (IIFE) is used to enable\n\t\t\t * dead code elimination while also only having to evaluate these\n\t\t\t * declarations once.\n\t\t\t */\n\t\t\t(() => {\n\t\t\t\tconst isDisabledFlag: string = '__react-beautiful-dnd-disable-dev-warnings';\n\n\t\t\t\t// not replacing newlines (which \\s does)\n\t\t\t\tconst spacesAndTabs: RegExp = /[ \\t]{2,}/g;\n\t\t\t\tconst lineStartWithSpaces: RegExp = /^[ \\t]*/gm;\n\n\t\t\t\t// using .trim() to clear the any newlines before the first text and after last text\n\t\t\t\tconst clean = (value: string): string =>\n\t\t\t\t\tvalue.replace(spacesAndTabs, ' ').replace(lineStartWithSpaces, '').trim();\n\n\t\t\t\tconst getDevMessage = (message: string): string =>\n\t\t\t\t\tclean(`\n          %creact-beautiful-dnd\n\n          %c${clean(message)}\n\n          %c👷‍ This is a development only message. It will be removed in production builds.\n        `);\n\n\t\t\t\tconst getFormattedMessage = (message: string): string[] => [\n\t\t\t\t\tgetDevMessage(message),\n\t\t\t\t\t// title (green400)\n\t\t\t\t\t'color: #00C584; font-size: 1.2em; font-weight: bold;',\n\t\t\t\t\t// message\n\t\t\t\t\t'line-height: 1.5',\n\t\t\t\t\t// footer (purple300)\n\t\t\t\t\t'color: #723874;',\n\t\t\t\t];\n\n\t\t\t\treturn function log(type: 'error' | 'warn', message: string) {\n\t\t\t\t\t// manual opt out of warnings\n\t\t\t\t\tif (typeof window !== 'undefined' && (window as any)[isDisabledFlag]) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\t\tconsole[type](...getFormattedMessage(message));\n\t\t\t\t};\n\t\t\t})();\n\nexport const warning = log.bind(null, 'warn');\nexport const error = log.bind(null, 'error');\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/drag-drop-context/cancel-drag.tsx",
    "content": "/**\n * Cancels the active drag, if there is one.\n *\n * This only affects pdnd's tracking, not the browser's dragging.\n *\n * This means if you drag out of the browser and back in,\n * an external adapter could pick it up as a new drag.\n */\nexport function cancelPointerDrag(): void {\n\twindow.dispatchEvent(new DragEvent('dragend'));\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/drag-drop-context/draggable-location.tsx",
    "content": "import type { DraggableLocation } from 'react-beautiful-dnd';\n\nimport { extractClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport type { DragLocation } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport { type DraggableData, isDraggableData } from '../draggable/data';\nimport { type DroppableData, isDroppableData } from '../droppable/data';\nimport { customAttributes, getAttribute } from '../utils/attributes';\nimport { findAllDraggables } from '../utils/find-all-draggables';\n\n/**\n * Derives the `DraggableLocation` of a `<Draggable>`.\n *\n * Accounts for which edge is being hovered over.\n */\nfunction getDraggableLocationFromDraggableData({\n\tdroppableId,\n\tgetIndex,\n\t...data\n}: DraggableData): DraggableLocation | null {\n\t/**\n\t * The index that the draggable is currently occupying.\n\t */\n\tlet index = getIndex();\n\tconst closestEdge = extractClosestEdge(\n\t\t/**\n\t\t * TypeScript doesn't like this without casting.\n\t\t *\n\t\t * The IDE doesn't have an issue, but if you try to build it then\n\t\t * there will be an error.\n\t\t */\n\t\tdata as unknown as Record<string | symbol, unknown>,\n\t);\n\t/**\n\t * Whether the user is hovering over the second half of the draggable.\n\t *\n\t * For a vertical list it is the bottom half,\n\t * while for a horizontal list it is the right half.\n\t */\n\tconst isForwardEdge = closestEdge === 'bottom' || closestEdge === 'right';\n\tif (isForwardEdge) {\n\t\t/**\n\t\t * If hovering over the 'forward' half of the draggable,\n\t\t * then the user is targeting the index after the draggable.\n\t\t */\n\t\tindex += 1;\n\t}\n\n\treturn { droppableId, index };\n}\n\n/**\n * Derives the `DraggableLocation` of a `<Droppable>`.\n *\n * This corresponds to the first or last index of the list,\n * depending on where the user is hovering.\n */\nfunction getDraggableLocationFromDroppableData({\n\tcontextId,\n\tdroppableId,\n\t...data\n}: DroppableData): DraggableLocation | null {\n\tconst draggables = findAllDraggables({ contextId, droppableId });\n\n\t/**\n\t * If there are no draggables, then the index should be 0\n\t */\n\tif (draggables.length === 0) {\n\t\treturn { droppableId, index: 0 };\n\t}\n\n\tconst closestEdge = extractClosestEdge(data);\n\t/**\n\t * Whether the user is closer to the start of the droppable.\n\t *\n\t * For a vertical list it is the top half,\n\t * while for a horizontal list it is the left half.\n\t */\n\tconst isCloserToStart = closestEdge === 'top' || closestEdge === 'left';\n\tif (isCloserToStart) {\n\t\t/**\n\t\t * If the user is closer to the start of the list, we will target the\n\t\t * first (0th) index.\n\t\t */\n\t\treturn { droppableId, index: 0 };\n\t}\n\n\t/**\n\t * We don't just take the index of the last draggable,\n\t * because portal-ing can lead to the DOM order not matching indexes.\n\t */\n\tconst biggestIndex = draggables.reduce((max, draggable) => {\n\t\tconst draggableIndex = parseInt(getAttribute(draggable, customAttributes.draggable.index), 10);\n\t\treturn Math.max(max, draggableIndex);\n\t}, 0);\n\n\treturn { droppableId, index: biggestIndex + 1 };\n}\n\n/**\n * Derives a `DraggableLocation` (`react-beautiful-dnd`)\n * from a `DragLocation` (`@atlaskit/pragmatic-drag-and-drop`).\n */\nexport function getDraggableLocation(location: DragLocation): DraggableLocation | null {\n\tconst { dropTargets } = location;\n\n\t// If there are no drop targets then there is no destination.\n\tif (dropTargets.length === 0) {\n\t\treturn null;\n\t}\n\n\t// Obtains the innermost drop target.\n\tconst target = dropTargets[0];\n\n\t// If the target is a draggable we can extract its index.\n\tif (isDraggableData(target.data)) {\n\t\treturn getDraggableLocationFromDraggableData(target.data);\n\t}\n\n\t// If the target is a droppable, there is no index to extract.\n\t// We default to the end of the droppable.\n\tif (isDroppableData(target.data)) {\n\t\treturn getDraggableLocationFromDroppableData(target.data);\n\t}\n\n\t// The target is not from the migration layer.\n\treturn null;\n}\n\n/**\n * Checks if two `DraggableLocation` values are equivalent.\n */\nexport function isSameLocation(a: DraggableLocation | null, b: DraggableLocation | null): boolean {\n\tif (a?.droppableId !== b?.droppableId) {\n\t\treturn false;\n\t}\n\n\tif (a?.index !== b?.index) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/drag-drop-context/droppable-registry.tsx",
    "content": "import { useState } from 'react';\n\nimport type { Direction, DroppableId, DroppableMode } from 'react-beautiful-dnd';\n\nimport type { CleanupFn } from '../internal-types';\n\nexport type DroppableRegistryEntry = {\n\tdroppableId: DroppableId;\n\tisDropDisabled: boolean;\n\tparentDroppableId: DroppableId | null;\n\ttype: string;\n\telement: HTMLElement;\n\tdirection: Direction;\n\tmode: DroppableMode;\n};\n\ntype Register = (entry: DroppableRegistryEntry) => CleanupFn;\n\nexport type GetEntry = ({\n\tdroppableId,\n}: {\n\tdroppableId: DroppableId;\n}) => DroppableRegistryEntry | null;\n\ntype UpdateListener = (entry: DroppableRegistryEntry) => void;\n\ntype SetUpdateListener = (updateListener: UpdateListener) => void;\n\nexport type DroppableRegistry = {\n\tgetEntry: GetEntry;\n\tregister: Register;\n\tsetUpdateListener: SetUpdateListener;\n};\n\nfunction createDroppableRegistry() {\n\tconst droppableMap = new Map<DroppableId, DroppableRegistryEntry>();\n\n\tconst getEntry: GetEntry = ({ droppableId }: { droppableId: DroppableId }) => {\n\t\treturn droppableMap.get(droppableId) ?? null;\n\t};\n\n\tlet updateListener: UpdateListener | null = null;\n\tconst setUpdateListener: SetUpdateListener = (listener) => {\n\t\tupdateListener = listener;\n\t};\n\n\tconst register: Register = (entry) => {\n\t\tdroppableMap.set(entry.droppableId, entry);\n\n\t\tupdateListener?.(entry);\n\n\t\treturn () => {\n\t\t\tdroppableMap.delete(entry.droppableId);\n\t\t};\n\t};\n\n\treturn { getEntry, register, setUpdateListener };\n}\n\nexport function useDroppableRegistry(): DroppableRegistry {\n\tconst [droppableRegistry] = useState(createDroppableRegistry);\n\treturn droppableRegistry;\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/drag-drop-context/error-boundary.tsx",
    "content": "import React, { type ReactElement, useCallback, useEffect, useRef } from 'react';\n\nimport { bind } from 'bind-event-listener';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nimport { error, warning } from '../dev-warning';\n\nimport { cancelPointerDrag } from './cancel-drag';\nimport { RbdInvariant } from './rbd-invariant';\nimport type { DragController } from './types';\n\ntype ErrorBoundaryProps = {\n\tchildren: ReactElement;\n\tcontextId: string;\n\tdragController: DragController;\n};\n\n/**\n * This component holds the actual error boundary logic.\n */\nfunction ErrorBoundaryInner({ children, dragController }: ErrorBoundaryProps) {\n\tconst isDraggingRef = useRef(false);\n\n\tconst handleWindowError = useCallback(\n\t\t(event: ErrorEvent) => {\n\t\t\tconst dragState = dragController.getDragState();\n\n\t\t\tif (!dragState.isDragging) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (dragState.mode === 'FLUID') {\n\t\t\t\tcancelPointerDrag();\n\t\t\t}\n\n\t\t\tif (dragState.mode === 'SNAP') {\n\t\t\t\tdragController.stopDrag({ reason: 'CANCEL' });\n\t\t\t}\n\n\t\t\tif (process.env.NODE_ENV !== 'production') {\n\t\t\t\twarning(`\n          An error was caught by our window 'error' event listener while a drag was occurring.\n          The active drag has been aborted.\n        `);\n\t\t\t}\n\n\t\t\tconst err: Error = event.error;\n\n\t\t\tif (err instanceof RbdInvariant) {\n\t\t\t\t// Marking the event as dealt with.\n\t\t\t\t// This will prevent any 'uncaught' error warnings in the console\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (process.env.NODE_ENV !== 'production') {\n\t\t\t\t\terror(err.message);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t[dragController],\n\t);\n\n\tuseEffect(() => {\n\t\treturn combine(\n\t\t\tmonitorForElements({\n\t\t\t\tonDragStart() {\n\t\t\t\t\tisDraggingRef.current = true;\n\t\t\t\t},\n\t\t\t\tonDrop() {\n\t\t\t\t\tisDraggingRef.current = false;\n\t\t\t\t},\n\t\t\t}),\n\t\t\tbind(window, { type: 'error', listener: handleWindowError as any }),\n\t\t);\n\t}, [handleWindowError]);\n\n\treturn children;\n}\n\n/**\n * Cancels drags when errors occur.\n */\n// We have to use a class component to create an error boundary\n// eslint-disable-next-line @repo/internal/react/no-class-components\nexport class ErrorBoundary extends React.Component<ErrorBoundaryProps> {\n\tcomponentDidCatch(err: Error): void {\n\t\tif (err instanceof RbdInvariant) {\n\t\t\tif (process.env.NODE_ENV !== 'production') {\n\t\t\t\terror(err.message);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\t// throwing error for other error boundaries\n\t\tthrow err;\n\t}\n\n\tstatic getDerivedStateFromError(): void {\n\t\t// Intentionally blank, because this method needs to be defined\n\t}\n\n\trender(): React.JSX.Element {\n\t\treturn (\n\t\t\t<ErrorBoundaryInner\n\t\t\t\tcontextId={this.props.contextId}\n\t\t\t\tdragController={this.props.dragController}\n\t\t\t>\n\t\t\t\t{this.props.children}\n\t\t\t</ErrorBoundaryInner>\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/drag-drop-context/get-destination.tsx",
    "content": "import type { DraggableLocation } from 'react-beautiful-dnd';\n\n/**\n * Calculates the actual destination of an item based on its start location\n * and target location.\n *\n * The actual destination may not be the same as the target location.\n * An item moving to a higher index in the same list introduces an\n * off-by-one error that this function accounts for.\n */\nexport function getActualDestination({\n\tstart,\n\ttarget,\n}: {\n\t/**\n\t * The start location of the draggable.\n\t */\n\tstart: DraggableLocation;\n\t/**\n\t * Where the drop indicator is being drawn.\n\t */\n\ttarget: DraggableLocation | null;\n}): DraggableLocation | null {\n\tif (target === null) {\n\t\treturn null;\n\t}\n\n\t/**\n\t * When reordering an item to an index greater than its current index\n\t * in the same list, then the target index needs adjustment.\n\t *\n\t * This is to account for the item itself moving, which would cause a shift.\n\t */\n\tconst isSameList = start.droppableId === target.droppableId;\n\tconst isMovingForward = target.index > start.index;\n\tconst shouldAdjust = isSameList && isMovingForward;\n\n\t/**\n\t * A clone is returned, even though it is the same value.\n\t * This is because the returned object might be mutated.\n\t */\n\tif (!shouldAdjust) {\n\t\treturn { ...target };\n\t}\n\n\treturn {\n\t\t...target,\n\t\tindex: target.index - 1,\n\t};\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/drag-drop-context/hooks/use-hidden-text-element.tsx",
    "content": "import { useEffect } from 'react';\n\nimport type { ContextId } from 'react-beautiful-dnd';\n\nexport function getHiddenTextElementId(contextId: string) {\n\treturn `rbd-lift-instruction-${contextId}`;\n}\n\ntype UseHiddenTextElementArgs = {\n\tcontextId: ContextId;\n\ttext: string;\n};\n\nexport default function useHiddenTextElement({ contextId, text }: UseHiddenTextElementArgs): void {\n\tuseEffect(() => {\n\t\tconst id = getHiddenTextElementId(contextId);\n\n\t\tconst el: HTMLElement = document.createElement('div');\n\n\t\t// identifier\n\t\tel.id = id;\n\n\t\t// add the description text\n\t\tel.textContent = text;\n\n\t\t// Using `display: none` prevent screen readers from reading this element in the document flow\n\t\t// This element is used as a `aria-labelledby` reference for *other elements* and will be read out for those\n\t\tObject.assign(el.style, { display: 'none' });\n\n\t\t// Add to body\n\t\tdocument.body.appendChild(el);\n\n\t\treturn function unmount() {\n\t\t\t// Remove from body\n\t\t\tel.remove();\n\t\t};\n\t}, [contextId, text]);\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/drag-drop-context/hooks/use-keyboard-controls.tsx",
    "content": "import { useCallback } from 'react';\n\nimport { bindAll, type Binding } from 'bind-event-listener';\nimport type { Direction } from 'react-beautiful-dnd';\n\nimport type { CleanupFn } from '../../internal-types';\nimport { attributes, customAttributes, getAttribute } from '../../utils/attributes';\nimport { findClosestScrollContainer } from '../../utils/find-closest-scroll-container';\nimport { getElement } from '../../utils/find-element';\nimport { getBestCrossAxisDroppable } from '../../utils/get-best-cross-axis-droppable';\nimport { getElementByDraggableLocation } from '../../utils/get-element-by-draggable-location';\nimport { isSameLocation } from '../draggable-location';\nimport type { DroppableRegistry } from '../droppable-registry';\nimport { getActualDestination } from '../get-destination';\nimport { rbdInvariant } from '../rbd-invariant';\nimport type { DragController, StartKeyboardDrag } from '../types';\n\ntype KeyHandlerData = {\n\tdragController: DragController;\n\tdroppableRegistry: DroppableRegistry;\n\tcontextId: string;\n};\n\ntype KeyHandler = (event: KeyboardEvent, data: KeyHandlerData) => void;\n\n/**\n * Finds the element's scroll container and scrolls it to the top.\n *\n * This is used for cross-axis drags to provide a consistent starting point\n * in the list.\n *\n * The behavior differs to `react-beautiful-dnd` which would find the\n * index closest to the current visual position. That was not preserved for\n * performance cost reasons.\n */\nfunction scrollToTop(element: HTMLElement): void {\n\tconst scrollContainer = findClosestScrollContainer(element);\n\tif (!scrollContainer) {\n\t\treturn;\n\t}\n\tscrollContainer.scrollTo(0, 0);\n}\n\nconst moveHandlers: Record<'mainAxis' | 'crossAxis', Record<'prev' | 'next', KeyHandler>> = {\n\tmainAxis: {\n\t\tprev(event: KeyboardEvent, { dragController }: KeyHandlerData) {\n\t\t\t/**\n\t\t\t * Preventing default to stop scrolling caused by arrow key press.\n\t\t\t */\n\t\t\tevent.preventDefault();\n\n\t\t\tconst dragState = dragController.getDragState();\n\t\t\trbdInvariant(dragState.isDragging);\n\n\t\t\tconst { sourceLocation, targetLocation } = dragState;\n\n\t\t\tif (!targetLocation) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (targetLocation.index === 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst nextLocation = {\n\t\t\t\t...targetLocation,\n\t\t\t\tindex: targetLocation.index - 1,\n\t\t\t};\n\n\t\t\tconst nextDestination = getActualDestination({\n\t\t\t\tstart: sourceLocation,\n\t\t\t\ttarget: nextLocation,\n\t\t\t});\n\n\t\t\t/**\n\t\t\t * There are two target indexes that correspond to a drop in the source location:\n\t\t\t *\n\t\t\t * 1. source.index      (before the source, but after previous item)\n\t\t\t * 2. source.index + 1  (after the source, but before next item)\n\t\t\t *\n\t\t\t * We decrement by 2 when going over the source location,\n\t\t\t * so the user only perceives one of these indexes.\n\t\t\t */\n\t\t\tif (isSameLocation(sourceLocation, nextDestination)) {\n\t\t\t\tnextLocation.index = targetLocation.index - 2;\n\t\t\t}\n\n\t\t\tdragController.updateDrag({ targetLocation: nextLocation });\n\t\t},\n\t\tnext(event: KeyboardEvent, { dragController, contextId }: KeyHandlerData) {\n\t\t\t/**\n\t\t\t * Preventing default to stop scrolling caused by arrow key press.\n\t\t\t */\n\t\t\tevent.preventDefault();\n\n\t\t\tconst dragState = dragController.getDragState();\n\t\t\trbdInvariant(dragState.isDragging);\n\n\t\t\tconst { sourceLocation, targetLocation } = dragState;\n\t\t\tif (!targetLocation) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Checks if we can move to the next position.\n\t\t\t *\n\t\t\t * Reasoning: if there is already a draggable with the current index,\n\t\t\t * then it is a possible target.\n\t\t\t */\n\t\t\tconst element = getElementByDraggableLocation(contextId, targetLocation);\n\t\t\t/**\n\t\t\t * This check is for virtual lists, and is a special case.\n\t\t\t *\n\t\t\t * When dragging, the element will unmount and we won't be able to find\n\t\t\t * the element for that index.\n\t\t\t *\n\t\t\t * This means for virtual lists, the normal check (element check) will fail.\n\t\t\t */\n\t\t\tconst isSame = isSameLocation(sourceLocation, targetLocation);\n\t\t\tif (!isSame && !element) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst nextLocation = {\n\t\t\t\t...targetLocation,\n\t\t\t\tindex: targetLocation.index + 1,\n\t\t\t};\n\n\t\t\tconst nextDestination = getActualDestination({\n\t\t\t\tstart: sourceLocation,\n\t\t\t\ttarget: nextLocation,\n\t\t\t});\n\n\t\t\t/**\n\t\t\t * There are two target indexes that correspond to a drop in the source location:\n\t\t\t *\n\t\t\t * 1. source.index      (before the source, but after previous item)\n\t\t\t * 2. source.index + 1  (after the source, but before next item)\n\t\t\t *\n\t\t\t * We increment by 2 when going over the source location,\n\t\t\t * so the user only perceives one of these indexes.\n\t\t\t */\n\t\t\tif (isSameLocation(sourceLocation, nextDestination)) {\n\t\t\t\tnextLocation.index = targetLocation.index + 2;\n\t\t\t}\n\n\t\t\tdragController.updateDrag({ targetLocation: nextLocation });\n\t\t},\n\t},\n\tcrossAxis: {\n\t\tprev(event: KeyboardEvent, { dragController, droppableRegistry, contextId }: KeyHandlerData) {\n\t\t\t/**\n\t\t\t * Preventing default to stop scrolling caused by arrow key press.\n\t\t\t */\n\t\t\tevent.preventDefault();\n\n\t\t\tconst dragState = dragController.getDragState();\n\t\t\trbdInvariant(dragState.isDragging);\n\n\t\t\tconst { targetLocation, type } = dragState;\n\n\t\t\tif (!targetLocation) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst before = getBestCrossAxisDroppable({\n\t\t\t\tdroppableId: targetLocation.droppableId,\n\t\t\t\ttype,\n\t\t\t\tisMovingForward: false,\n\t\t\t\tcontextId,\n\t\t\t\tdroppableRegistry,\n\t\t\t});\n\n\t\t\tif (!before) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tscrollToTop(before);\n\n\t\t\tconst nextLocation = {\n\t\t\t\tdroppableId: getAttribute(before, attributes.droppable.id),\n\t\t\t\tindex: 0,\n\t\t\t};\n\n\t\t\tdragController.updateDrag({ targetLocation: nextLocation });\n\t\t},\n\t\tnext(event: KeyboardEvent, { dragController, droppableRegistry, contextId }: KeyHandlerData) {\n\t\t\t/**\n\t\t\t * Preventing default to stop scrolling caused by arrow key press.\n\t\t\t */\n\t\t\tevent.preventDefault();\n\n\t\t\tconst dragState = dragController.getDragState();\n\t\t\trbdInvariant(dragState.isDragging);\n\n\t\t\tconst { targetLocation, type } = dragState;\n\n\t\t\tif (!targetLocation) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst after = getBestCrossAxisDroppable({\n\t\t\t\tdroppableId: targetLocation.droppableId,\n\t\t\t\ttype,\n\t\t\t\tisMovingForward: true,\n\t\t\t\tcontextId,\n\t\t\t\tdroppableRegistry,\n\t\t\t});\n\n\t\t\tif (!after) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tscrollToTop(after);\n\n\t\t\tconst nextLocation = {\n\t\t\t\tdroppableId: getAttribute(after, attributes.droppable.id),\n\t\t\t\tindex: 0,\n\t\t\t};\n\n\t\t\tdragController.updateDrag({ targetLocation: nextLocation });\n\t\t},\n\t},\n};\n\nfunction preventDefault(event: Event) {\n\tevent.preventDefault();\n}\n\n/**\n * These keys mostly have their default behavior prevented to stop scrolling.\n *\n * The tab key is prevented to lock focus in place.\n */\nconst commonKeyHandlers = {\n\tPageUp: preventDefault,\n\tPageDown: preventDefault,\n\tHome: preventDefault,\n\tEnd: preventDefault,\n\tEnter: preventDefault,\n\tTab: preventDefault,\n};\n\n/**\n * Maps actions to keys.\n */\nconst keyHandlers: Record<Direction, Record<string, KeyHandler>> = {\n\tvertical: {\n\t\t...commonKeyHandlers,\n\t\tArrowUp: moveHandlers.mainAxis.prev,\n\t\tArrowDown: moveHandlers.mainAxis.next,\n\t\tArrowLeft: moveHandlers.crossAxis.prev,\n\t\tArrowRight: moveHandlers.crossAxis.next,\n\t},\n\thorizontal: {\n\t\t...commonKeyHandlers,\n\t\tArrowUp: moveHandlers.crossAxis.prev,\n\t\tArrowDown: moveHandlers.crossAxis.next,\n\t\tArrowLeft: moveHandlers.mainAxis.prev,\n\t\tArrowRight: moveHandlers.mainAxis.next,\n\t},\n};\n\nexport function useKeyboardControls({\n\tdragController,\n\tdroppableRegistry,\n\tcontextId,\n\tsetKeyboardCleanupFn,\n}: {\n\tdragController: DragController;\n\tdroppableRegistry: DroppableRegistry;\n\tcontextId: string;\n\t/**\n\t * Sets the cleanup function that should run whenever:\n\t * - A user drops\n\t * - A user cancels a drag\n\t * - There is an error, cancelling a drag\n\t *\n\t * Because this hook has no visibility of when a drag is cancelled due to\n\t * an error, the cleanup is handled at the level above.\n\t */\n\tsetKeyboardCleanupFn: (cleanupFn: CleanupFn) => void;\n}): { startKeyboardDrag: StartKeyboardDrag } {\n\tconst startKeyboardDrag: StartKeyboardDrag = useCallback(\n\t\t({ event: startEvent, draggableId, type, getSourceLocation, sourceElement }) => {\n\t\t\tdragController.startDrag({\n\t\t\t\tdraggableId,\n\t\t\t\ttype,\n\t\t\t\tgetSourceLocation,\n\t\t\t\tsourceElement,\n\t\t\t\tmode: 'SNAP',\n\t\t\t});\n\n\t\t\tconst sourceLocation = getSourceLocation();\n\n\t\t\tconst droppable = getElement({\n\t\t\t\tattribute: attributes.droppable.id,\n\t\t\t\tvalue: sourceLocation.droppableId,\n\t\t\t});\n\n\t\t\tconst direction = getAttribute(droppable, customAttributes.droppable.direction);\n\n\t\t\trbdInvariant(direction === 'vertical' || direction === 'horizontal');\n\n\t\t\tfunction cancelDrag() {\n\t\t\t\tdragController.stopDrag({ reason: 'CANCEL' });\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * All of these events should cancel the drag.\n\t\t\t *\n\t\t\t * These events were taken from `react-beautiful-dnd`.\n\t\t\t */\n\t\t\tconst cancelBindings: Binding[] = [\n\t\t\t\t'mousedown',\n\t\t\t\t'mouseup',\n\t\t\t\t'click',\n\t\t\t\t'touchstart',\n\t\t\t\t'resize',\n\t\t\t\t'wheel',\n\t\t\t\t'visibilitychange',\n\t\t\t].map((type) => {\n\t\t\t\treturn { type, listener: cancelDrag };\n\t\t\t});\n\n\t\t\tconst cleanupFn = bindAll(window, [\n\t\t\t\t{\n\t\t\t\t\ttype: 'keydown',\n\t\t\t\t\tlistener(event: KeyboardEvent) {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Ignores the keydown event which triggered the drag start,\n\t\t\t\t\t\t * so it doesn't trigger an immediate drop.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tif (event === startEvent) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tconst { isDragging } = dragController.getDragState();\n\t\t\t\t\t\tif (!isDragging) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (event.key === ' ') {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tdragController.stopDrag({ reason: 'DROP' });\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (event.key === 'Escape') {\n\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\tdragController.stopDrag({ reason: 'CANCEL' });\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tkeyHandlers[direction][event.key]?.(event, {\n\t\t\t\t\t\t\tdragController,\n\t\t\t\t\t\t\tdroppableRegistry,\n\t\t\t\t\t\t\tcontextId,\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t...cancelBindings,\n\t\t\t]);\n\n\t\t\tsetKeyboardCleanupFn(cleanupFn);\n\t\t},\n\t\t[contextId, dragController, droppableRegistry, setKeyboardCleanupFn],\n\t);\n\n\treturn { startKeyboardDrag };\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/drag-drop-context/hooks/use-pointer-controls.tsx",
    "content": "import { useCallback, useEffect } from 'react';\n\nimport { autoScroller } from '@atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-autoscroll';\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { preventUnhandled } from '@atlaskit/pragmatic-drag-and-drop/prevent-unhandled';\nimport type { DragLocationHistory } from '@atlaskit/pragmatic-drag-and-drop/types';\n\nimport { isDraggableData } from '../../draggable/data';\nimport { isDroppableData } from '../../droppable/data';\nimport { getDraggableLocation } from '../draggable-location';\nimport { rbdInvariant } from '../rbd-invariant';\nimport type { DragController } from '../types';\n\n/**\n * Sets up listeners for pointer dragging.\n */\nexport function usePointerControls({\n\tdragController,\n\tcontextId,\n}: {\n\tdragController: DragController;\n\tcontextId: string;\n}): void {\n\tconst updatePointerDrag = useCallback(\n\t\t(location: DragLocationHistory) => {\n\t\t\tdragController.updateDrag({\n\t\t\t\ttargetLocation: getDraggableLocation(location.current),\n\t\t\t});\n\t\t},\n\t\t[dragController],\n\t);\n\n\tuseEffect(() => {\n\t\treturn monitorForElements({\n\t\t\tcanMonitor({ initial, source }) {\n\t\t\t\tif (!isDraggableData(source.data)) {\n\t\t\t\t\t// not dragging something from the migration layer\n\t\t\t\t\t// we should not monitor it\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tconst isValidDraggable = source.data.contextId === contextId;\n\t\t\t\tif (!isValidDraggable) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tconst droppable = initial.dropTargets.find((target) => isDroppableData(target.data));\n\n\t\t\t\tif (!droppable) {\n\t\t\t\t\t/**\n\t\t\t\t\t * There may be no droppable in the `dropTargets` if it is disabled.\n\t\t\t\t\t *\n\t\t\t\t\t * This is still valid.\n\t\t\t\t\t */\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\n\t\t\t\tconst isValidDroppable = droppable.data.contextId === contextId;\n\t\t\t\treturn isValidDroppable;\n\t\t\t},\n\n\t\t\tonDragStart({ location, source }) {\n\t\t\t\tautoScroller.start({ input: location.current.input });\n\n\t\t\t\t/**\n\t\t\t\t * We use `preventUnhandled` because we are rendering a custom drag\n\t\t\t\t * preview.\n\t\t\t\t */\n\t\t\t\tpreventUnhandled.start();\n\n\t\t\t\tconst { data } = source;\n\t\t\t\trbdInvariant(isDraggableData(data));\n\t\t\t\tconst { draggableId, droppableId, getIndex, type } = data;\n\n\t\t\t\tdragController.startDrag({\n\t\t\t\t\tdraggableId,\n\t\t\t\t\ttype,\n\t\t\t\t\tgetSourceLocation() {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tdroppableId,\n\t\t\t\t\t\t\tindex: getIndex(),\n\t\t\t\t\t\t};\n\t\t\t\t\t},\n\t\t\t\t\tsourceElement: source.element,\n\t\t\t\t\tmode: 'FLUID',\n\t\t\t\t});\n\t\t\t},\n\n\t\t\tonDrag({ location }) {\n\t\t\t\tautoScroller.updateInput({ input: location.current.input });\n\t\t\t\tupdatePointerDrag(location);\n\t\t\t},\n\n\t\t\tonDropTargetChange({ location }) {\n\t\t\t\tupdatePointerDrag(location);\n\t\t\t},\n\n\t\t\tonDrop() {\n\t\t\t\tautoScroller.stop();\n\t\t\t\tpreventUnhandled.stop();\n\n\t\t\t\tdragController.stopDrag({ reason: 'DROP' });\n\t\t\t},\n\t\t});\n\t}, [dragController, contextId, updatePointerDrag]);\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/drag-drop-context/hooks/use-style-marshal.tsx",
    "content": "/**\n * This is a vastly simplified version of the style marshal in `react-beautiful-dnd`.\n *\n * Most of the styles have been removed, as they are not required for native dragging.\n * They were only required in `react-beautiful-dnd` because it emulated dragging.\n */\n\nimport type { CSSProperties } from 'react';\n\nimport type { ContextId } from 'react-beautiful-dnd';\n\nimport { useLayoutEffect } from '../../hooks/use-isomorphic-layout-effect';\nimport type { CleanupFn } from '../../internal-types';\nimport { attributes } from '../../utils/attributes';\n\n/**\n * Used to uniquely identify the style element.\n */\nconst styleContextIdAttribute = 'data-rbd-style-context-id';\n\n/**\n * Returns the CSS string for the rule with the given selector and style\n * declarations.\n */\nfunction getRuleString({ selector, styles }: { selector: string; styles: CSSProperties }) {\n\tconst concatString = Object.entries(styles)\n\t\t.map(([property, value]) => `${property}: ${value};`)\n\t\t.join(' ');\n\treturn `${selector} { ${concatString} }`;\n}\n\n/**\n * Returns the rule string for drag handle styles.\n */\nexport function getDragHandleRuleString(contextId: ContextId): string {\n\tconst selector = `[${attributes.dragHandle.contextId}=\"${contextId}\"]`;\n\tconst styles = {\n\t\t/**\n\t\t * Indicates the element is draggable.\n\t\t *\n\t\t * Although this is always applied, it will not be visible during drags\n\t\t * because the browser will override the cursor.\n\t\t */\n\t\tcursor: 'grab',\n\t\t/**\n\t\t * Improves the UX when dragging links on iOS.\n\t\t *\n\t\t * Without this a preview of the link will open. Although it is still\n\t\t * draggable, it is inconsistent with `react-beautiful-dnd`.\n\t\t */\n\t\t'-webkit-touch-callout': 'none',\n\t};\n\treturn getRuleString({ selector, styles });\n}\n\ntype ContextIdAndNonce = {\n\tcontextId: ContextId;\n\tnonce?: string;\n};\n\nfunction createStyleEl({ contextId, nonce }: ContextIdAndNonce): HTMLStyleElement {\n\tconst el: HTMLStyleElement = document.createElement('style');\n\tif (nonce) {\n\t\tel.setAttribute('nonce', nonce);\n\t}\n\tel.setAttribute(styleContextIdAttribute, contextId);\n\tdocument.head.appendChild(el);\n\treturn el;\n}\n\nfunction createStyleManager({ contextId, nonce }: ContextIdAndNonce): CleanupFn {\n\tconst el = createStyleEl({ contextId, nonce });\n\n\t/**\n\t * Inject the style content.\n\t */\n\tel.textContent = getDragHandleRuleString(contextId);\n\n\treturn function cleanup() {\n\t\tel.remove();\n\t};\n}\n\nexport default function useStyleMarshal({ contextId, nonce }: ContextIdAndNonce): void {\n\tuseLayoutEffect(() => {\n\t\treturn createStyleManager({ contextId, nonce });\n\t}, [contextId, nonce]);\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/drag-drop-context/index.tsx",
    "content": "import React, {\n\ttype ReactElement,\n\ttype ReactNode,\n\tuseCallback,\n\tuseEffect,\n\tuseMemo,\n\tuseRef,\n\tuseState,\n} from 'react';\n\nimport type {\n\tBeforeCapture,\n\tDragDropContextProps,\n\tDraggableLocation,\n\tDragStart,\n\tDragUpdate,\n\tDroppableId,\n\tDroppableMode,\n\tDropResult,\n\tMovementMode,\n} from 'react-beautiful-dnd';\n\nimport { getDraggableDimensions } from '../hooks/use-captured-dimensions';\nimport { useCleanupFn } from '../hooks/use-cleanup-fn';\nimport { attributes, getAttribute } from '../utils/attributes';\nimport { findDragHandle } from '../utils/find-drag-handle';\nimport { getClosestPositionedElement } from '../utils/get-closest-positioned-element';\n\nimport { cancelPointerDrag } from './cancel-drag';\nimport { isSameLocation } from './draggable-location';\nimport { type DroppableRegistryEntry, useDroppableRegistry } from './droppable-registry';\nimport { ErrorBoundary } from './error-boundary';\nimport { getActualDestination } from './get-destination';\nimport useHiddenTextElement from './hooks/use-hidden-text-element';\nimport { useKeyboardControls } from './hooks/use-keyboard-controls';\nimport { usePointerControls } from './hooks/use-pointer-controls';\nimport useStyleMarshal from './hooks/use-style-marshal';\nimport { DragDropContextProvider } from './internal-context';\nimport { LifecycleContextProvider, useLifecycle } from './lifecycle-context';\nimport { announce } from './live-region';\nimport { rbdInvariant } from './rbd-invariant';\nimport { defaultDragHandleUsageInstructions, getProvided } from './screen-reader';\nimport type { DragController, DragState } from './types';\nimport { useScheduler } from './use-scheduler';\n\n/**\n * The instance count is used for selectors when querying the document.\n *\n * Ideally, in the future, this can be removed completely.\n */\nlet instanceCount = 0;\n\nexport function resetServerContext(): void {\n\tinstanceCount = 0;\n}\n\nfunction getContextId() {\n\treturn `${instanceCount++}`;\n}\n\nfunction getOffset(args: { element: HTMLElement; mode: DroppableMode }) {\n\tconst offsetElement = getClosestPositionedElement(args);\n\treturn {\n\t\ttop: offsetElement.offsetTop,\n\t\tleft: offsetElement.offsetLeft,\n\t};\n}\n\nexport function DragDropContext({\n\tchildren,\n\tdragHandleUsageInstructions = defaultDragHandleUsageInstructions,\n\tnonce,\n\tonBeforeCapture,\n\tonBeforeDragStart,\n\tonDragStart,\n\tonDragUpdate,\n\tonDragEnd,\n}: DragDropContextProps & { children?: ReactNode }): ReactElement {\n\tconst [contextId] = useState<string>(getContextId);\n\tuseHiddenTextElement({ contextId, text: dragHandleUsageInstructions });\n\n\tconst lifecycle = useLifecycle();\n\n\tconst { schedule, flush } = useScheduler();\n\n\tconst dragStateRef = useRef<DragState>({ isDragging: false });\n\tconst getDragState = useCallback(() => {\n\t\treturn dragStateRef.current;\n\t}, []);\n\n\tconst droppableRegistry = useDroppableRegistry();\n\n\tconst getClosestEnabledDraggableLocation = useCallback(\n\t\t({ droppableId }: { droppableId: DroppableId }): DraggableLocation | null => {\n\t\t\tlet droppable = droppableRegistry.getEntry({\n\t\t\t\tdroppableId,\n\t\t\t});\n\n\t\t\twhile (droppable !== null && droppable.isDropDisabled) {\n\t\t\t\tconst { parentDroppableId } = droppable;\n\n\t\t\t\tdroppable = parentDroppableId\n\t\t\t\t\t? droppableRegistry.getEntry({\n\t\t\t\t\t\t\tdroppableId: parentDroppableId,\n\t\t\t\t\t\t})\n\t\t\t\t\t: null;\n\t\t\t}\n\n\t\t\tif (droppable === null) {\n\t\t\t\treturn null;\n\t\t\t}\n\n\t\t\treturn { droppableId: droppable.droppableId, index: 0 };\n\t\t},\n\t\t[droppableRegistry],\n\t);\n\n\tuseEffect(() => {\n\t\t/**\n\t\t * If there is a drag when the context unmounts, cancel it.\n\t\t */\n\t\treturn () => {\n\t\t\tconst { isDragging } = getDragState();\n\t\t\tif (isDragging) {\n\t\t\t\tcancelPointerDrag();\n\t\t\t}\n\t\t};\n\t}, [getDragState]);\n\n\tconst updateDrag = useCallback(\n\t\t({\n\t\t\ttargetLocation,\n\t\t\tisImmediate = false,\n\t\t}: {\n\t\t\ttargetLocation: DraggableLocation | null;\n\t\t\tisImmediate?: boolean;\n\t\t}) => {\n\t\t\tif (!dragStateRef.current.isDragging) {\n\t\t\t\t/**\n\t\t\t\t * If there is no ongoing drag, then don't do anything.\n\t\t\t\t *\n\t\t\t\t * This should never occur, but treating it as a noop is more\n\t\t\t\t * reasonable than an invariant.\n\t\t\t\t */\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { prevDestination, draggableId, type, sourceLocation } = dragStateRef.current;\n\n\t\t\t/**\n\t\t\t * Computes where it would actually move to\n\t\t\t */\n\t\t\tconst nextDestination = getActualDestination({\n\t\t\t\tstart: sourceLocation,\n\t\t\t\ttarget: targetLocation,\n\t\t\t});\n\n\t\t\tif (isSameLocation(prevDestination, nextDestination)) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tObject.assign(dragStateRef.current, {\n\t\t\t\tprevDestination: nextDestination,\n\t\t\t\tsourceLocation,\n\t\t\t\ttargetLocation,\n\t\t\t});\n\n\t\t\tconst update: DragUpdate = {\n\t\t\t\tmode: dragStateRef.current.mode,\n\t\t\t\tdraggableId,\n\t\t\t\ttype,\n\t\t\t\tsource: sourceLocation,\n\t\t\t\tdestination: nextDestination,\n\t\t\t\tcombine: null, // not supported by migration layer\n\t\t\t};\n\n\t\t\tconst droppable = targetLocation\n\t\t\t\t? droppableRegistry.getEntry({\n\t\t\t\t\t\tdroppableId: targetLocation.droppableId,\n\t\t\t\t\t})\n\t\t\t\t: null;\n\n\t\t\t/**\n\t\t\t * This event exists solely to ensure that the drop indicator updates\n\t\t\t * before the drag preview.\n\t\t\t */\n\t\t\tlifecycle.dispatch('onPrePendingDragUpdate', { update, targetLocation });\n\t\t\tlifecycle.dispatch('onPendingDragUpdate', {\n\t\t\t\tupdate,\n\t\t\t\ttargetLocation,\n\t\t\t\tdroppable,\n\t\t\t});\n\n\t\t\tfunction dispatchConsumerLifecycleEvent() {\n\t\t\t\tconst { provided, getMessage } = getProvided('onDragUpdate', update);\n\t\t\t\tonDragUpdate?.(update, provided);\n\t\t\t\tannounce(getMessage());\n\t\t\t}\n\n\t\t\tif (isImmediate) {\n\t\t\t\tdispatchConsumerLifecycleEvent();\n\t\t\t} else {\n\t\t\t\tschedule(dispatchConsumerLifecycleEvent);\n\t\t\t}\n\t\t},\n\t\t[droppableRegistry, lifecycle, onDragUpdate, schedule],\n\t);\n\n\tconst startDrag = useCallback(\n\t\t({\n\t\t\tdraggableId,\n\t\t\ttype,\n\t\t\tgetSourceLocation,\n\t\t\tsourceElement,\n\t\t\tmode,\n\t\t}: {\n\t\t\tdraggableId: string;\n\t\t\ttype: string;\n\t\t\tgetSourceLocation(): DraggableLocation;\n\t\t\tsourceElement: HTMLElement;\n\t\t\tmode: MovementMode;\n\t\t}) => {\n\t\t\tif (dragStateRef.current.isDragging) {\n\t\t\t\t/**\n\t\t\t\t * If there is already an ongoing drag, then don't do anything.\n\t\t\t\t *\n\t\t\t\t * This should never occur, but treating it as a noop is more\n\t\t\t\t * reasonable than an invariant.\n\t\t\t\t */\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst before: BeforeCapture = {\n\t\t\t\tdraggableId,\n\t\t\t\tmode,\n\t\t\t};\n\n\t\t\t// This is called in `onDragStart` rather than `onGenerateDragPreview`\n\t\t\t// to avoid a browser bug. Some DOM manipulations can cancel\n\t\t\t// the drag if they happen early in the drag.\n\t\t\t// <https://bugs.chromium.org/p/chromium/issues/detail?id=674882>\n\t\t\tonBeforeCapture?.(before);\n\n\t\t\tconst start: DragStart = {\n\t\t\t\tmode,\n\t\t\t\tdraggableId,\n\t\t\t\ttype,\n\t\t\t\tsource: getSourceLocation(),\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * If the active element is a drag handle, then\n\t\t\t * we want to restore focus to it after the drag.\n\t\t\t *\n\t\t\t * This matches the behavior of `react-beautiful-dnd`.\n\t\t\t */\n\t\t\tconst { activeElement } = document;\n\t\t\tconst dragHandleDraggableId =\n\t\t\t\tactiveElement instanceof HTMLElement &&\n\t\t\t\tactiveElement.hasAttribute(attributes.dragHandle.draggableId)\n\t\t\t\t\t? getAttribute(activeElement, attributes.dragHandle.draggableId)\n\t\t\t\t\t: null;\n\n\t\t\tconst { droppableId } = start.source;\n\t\t\tconst droppable = droppableRegistry.getEntry({ droppableId });\n\t\t\trbdInvariant(droppable, `should have entry for droppable '${droppableId}'`);\n\n\t\t\tdragStateRef.current = {\n\t\t\t\tisDragging: true,\n\t\t\t\tmode,\n\t\t\t\tdraggableDimensions: getDraggableDimensions(sourceElement),\n\t\t\t\trestoreFocusTo: dragHandleDraggableId,\n\t\t\t\tdraggableId,\n\t\t\t\ttype,\n\t\t\t\tprevDestination: start.source,\n\t\t\t\tsourceLocation: start.source,\n\t\t\t\ttargetLocation: start.source,\n\t\t\t\tdraggableInitialOffsetInSourceDroppable: getOffset({\n\t\t\t\t\telement: sourceElement,\n\t\t\t\t\tmode: droppable.mode,\n\t\t\t\t}),\n\t\t\t};\n\n\t\t\tonBeforeDragStart?.(start);\n\n\t\t\t/**\n\t\t\t * This is used to signal to <Draggable> and <Droppable> elements\n\t\t\t * to update their state.\n\t\t\t *\n\t\t\t * This must be synchronous so that they have updated their state\n\t\t\t * by the time that `DragStart` is published.\n\t\t\t */\n\t\t\tlifecycle.dispatch('onPendingDragStart', { start, droppable });\n\n\t\t\t// rbd's `onDragStart` is called in the next event loop (via `setTimeout`)\n\t\t\t//\n\t\t\t// We can safely assume that the React state updates have occurred by\n\t\t\t// now, and that the updated `snapshot` has been provided.\n\t\t\t// <https://twitter.com/alexandereardon/status/1585784101885263872>\n\t\t\tschedule(() => {\n\t\t\t\tconst start: DragStart = {\n\t\t\t\t\tmode,\n\t\t\t\t\tdraggableId,\n\t\t\t\t\ttype,\n\t\t\t\t\tsource: getSourceLocation(),\n\t\t\t\t};\n\n\t\t\t\tconst { provided, getMessage } = getProvided('onDragStart', start);\n\t\t\t\tonDragStart?.(start, provided);\n\t\t\t\tannounce(getMessage());\n\n\t\t\t\t/**\n\t\t\t\t * If the droppable is initially disabled, then we publish an\n\t\t\t\t * immediate `DragUpdate` with a new non-disabled destination.\n\t\t\t\t *\n\t\t\t\t * This is typically `destination === null` but can be a parent\n\t\t\t\t * droppable if there are nested droppables.\n\t\t\t\t *\n\t\t\t\t * `react-beautiful-dnd` does this for mouse drags,\n\t\t\t\t * but not for keyboard drags. This is likely a bug, and the migration\n\t\t\t\t * layer will publish an update for all types of drags.\n\t\t\t\t *\n\t\t\t\t * This is scheduled so that state changes that occurred in the\n\t\t\t\t * rbd `onDragStart` will have taken effect. That is,\n\t\t\t\t * a synchronous `setIsDropDisabled(true)` call in the consumer's\n\t\t\t\t * `onDragStart` should result in an immediate update here.\n\t\t\t\t */\n\t\t\t\tschedule(() => {\n\t\t\t\t\tconst { droppableId } = start.source;\n\n\t\t\t\t\tconst droppable = droppableRegistry.getEntry({ droppableId });\n\n\t\t\t\t\tif (droppable?.isDropDisabled) {\n\t\t\t\t\t\tconst targetLocation = getClosestEnabledDraggableLocation({\n\t\t\t\t\t\t\tdroppableId,\n\t\t\t\t\t\t});\n\t\t\t\t\t\tupdateDrag({ targetLocation, isImmediate: true });\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\t\t},\n\t\t[\n\t\t\tdroppableRegistry,\n\t\t\tgetClosestEnabledDraggableLocation,\n\t\t\tlifecycle,\n\t\t\tonBeforeCapture,\n\t\t\tonBeforeDragStart,\n\t\t\tonDragStart,\n\t\t\tschedule,\n\t\t\tupdateDrag,\n\t\t],\n\t);\n\n\tconst keyboardCleanupManager = useCleanupFn();\n\n\tconst stopDrag: DragController['stopDrag'] = useCallback(\n\t\t({ reason }) => {\n\t\t\tif (!dragStateRef.current.isDragging) {\n\t\t\t\t/**\n\t\t\t\t * If there is no ongoing drag, then don't do anything.\n\t\t\t\t *\n\t\t\t\t * This should never occur, but treating it as a noop is more\n\t\t\t\t * reasonable than an invariant.\n\t\t\t\t */\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tkeyboardCleanupManager.runCleanupFn();\n\n\t\t\t/**\n\t\t\t * If this is a cancel, then an update to a null\n\t\t\t * destination will be made. (Unless it is already null)\n\t\t\t *\n\t\t\t * This is different to `react-beautiful-dnd` and exists\n\t\t\t * to standardize behavior between mouse and keyboard drags.\n\t\t\t *\n\t\t\t * This is required because of a behavior in native drag and\n\t\t\t * drop, where a `dragend` will fire exit events on every\n\t\t\t * drop target you are over. This results in an unavoidable\n\t\t\t * null destination update for mouse drags.\n\t\t\t */\n\t\t\tif (reason === 'CANCEL') {\n\t\t\t\tupdateDrag({ targetLocation: null });\n\t\t\t}\n\n\t\t\tconst { mode, restoreFocusTo, sourceLocation, targetLocation, type, draggableId } =\n\t\t\t\tdragStateRef.current;\n\n\t\t\tdragStateRef.current = { isDragging: false };\n\n\t\t\tflush();\n\n\t\t\tconst destination = getActualDestination({\n\t\t\t\tstart: sourceLocation,\n\t\t\t\ttarget: targetLocation,\n\t\t\t});\n\n\t\t\tconst result: DropResult = {\n\t\t\t\t// We are saying all null destination drops count as a CANCEL\n\t\t\t\treason: destination === null ? 'CANCEL' : 'DROP',\n\t\t\t\ttype,\n\t\t\t\tsource: sourceLocation,\n\t\t\t\tdestination,\n\t\t\t\tmode,\n\t\t\t\tdraggableId,\n\t\t\t\tcombine: null, // not supported by migration layer\n\t\t\t};\n\n\t\t\t/**\n\t\t\t * Tells <Draggable> instances to cleanup.\n\t\t\t */\n\t\t\tlifecycle.dispatch('onBeforeDragEnd', { draggableId });\n\n\t\t\tconst { provided, getMessage } = getProvided('onDragEnd', result);\n\t\t\tonDragEnd(result, provided);\n\t\t\tannounce(getMessage());\n\n\t\t\tif (restoreFocusTo) {\n\t\t\t\t/**\n\t\t\t\t * The `requestAnimationFrame` matches `react-beautiful-dnd`.\n\t\t\t\t *\n\t\t\t\t * It is required to wait for React state updates to have taken effect.\n\t\t\t\t * Otherwise we might try to focus an element that no longer exists.\n\t\t\t\t */\n\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\tconst dragHandle = findDragHandle({ contextId, draggableId });\n\t\t\t\t\tif (!dragHandle) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tdragHandle.focus();\n\t\t\t\t});\n\t\t\t}\n\t\t},\n\t\t[contextId, flush, keyboardCleanupManager, lifecycle, onDragEnd, updateDrag],\n\t);\n\n\tconst dragController: DragController = useMemo(() => {\n\t\treturn {\n\t\t\tgetDragState,\n\t\t\tstartDrag,\n\t\t\tupdateDrag,\n\t\t\tstopDrag,\n\t\t};\n\t}, [getDragState, startDrag, stopDrag, updateDrag]);\n\n\tusePointerControls({ dragController, contextId });\n\n\tconst { startKeyboardDrag } = useKeyboardControls({\n\t\tdragController,\n\t\tdroppableRegistry,\n\t\tcontextId,\n\t\tsetKeyboardCleanupFn: keyboardCleanupManager.setCleanupFn,\n\t});\n\n\t/**\n\t * If a droppable becomes disabled during a drag, then a new destination\n\t * should be found and published in a `DragUpdate`.\n\t */\n\tconst onDroppableUpdate = useCallback(\n\t\t(entry: DroppableRegistryEntry) => {\n\t\t\tconst dragState = dragStateRef.current;\n\n\t\t\tif (!dragState.isDragging) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (!entry.isDropDisabled) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (entry.droppableId !== dragState.targetLocation?.droppableId) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst targetLocation = getClosestEnabledDraggableLocation({\n\t\t\t\tdroppableId: entry.droppableId,\n\t\t\t});\n\t\t\tupdateDrag({ targetLocation });\n\t\t},\n\t\t[getClosestEnabledDraggableLocation, updateDrag],\n\t);\n\n\tdroppableRegistry.setUpdateListener(onDroppableUpdate);\n\n\tuseStyleMarshal({ contextId, nonce });\n\n\treturn (\n\t\t<ErrorBoundary contextId={contextId} dragController={dragController}>\n\t\t\t<LifecycleContextProvider lifecycle={lifecycle}>\n\t\t\t\t<DragDropContextProvider\n\t\t\t\t\tcontextId={contextId}\n\t\t\t\t\tgetDragState={getDragState}\n\t\t\t\t\tstartKeyboardDrag={startKeyboardDrag}\n\t\t\t\t\tdroppableRegistry={droppableRegistry}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</DragDropContextProvider>\n\t\t\t</LifecycleContextProvider>\n\t\t</ErrorBoundary>\n\t);\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/drag-drop-context/internal-context.tsx",
    "content": "import React, { createContext, type ReactNode, useContext, useMemo } from 'react';\n\nimport type { DroppableRegistry } from './droppable-registry';\nimport { rbdInvariant } from './rbd-invariant';\nimport type { DragState, StartKeyboardDrag } from './types';\n\ntype DragDropContextValue = {\n\t/**\n\t * A stringified number used to uniquely identify each context instance.\n\t * This allows each <DragDropContext /> to be isolated from each other.\n\t *\n\t * This is the approach originally used by `react-beautiful-dnd`.\n\t */\n\tcontextId: string;\n\n\t/**\n\t * Lazily returns the current drag state.\n\t */\n\tgetDragState(): DragState;\n\n\tstartKeyboardDrag: StartKeyboardDrag;\n\n\tdroppableRegistry: DroppableRegistry;\n};\n\nconst DragDropContext = createContext<DragDropContextValue | null>(null);\n\nexport function useDragDropContext() {\n\tconst value = useContext(DragDropContext);\n\trbdInvariant(value !== null, 'Unable to find DragDropContext context');\n\treturn value;\n}\n\nexport function DragDropContextProvider({\n\tchildren,\n\tcontextId,\n\tgetDragState,\n\tstartKeyboardDrag,\n\tdroppableRegistry,\n}: {\n\tchildren: ReactNode;\n\tcontextId: string;\n\tgetDragState(): DragState;\n\tstartKeyboardDrag: StartKeyboardDrag;\n\tdroppableRegistry: DroppableRegistry;\n}): React.JSX.Element {\n\tconst value: DragDropContextValue = useMemo(() => {\n\t\treturn {\n\t\t\tcontextId,\n\t\t\tgetDragState,\n\t\t\tstartKeyboardDrag,\n\t\t\tdroppableRegistry,\n\t\t};\n\t}, [contextId, getDragState, startKeyboardDrag, droppableRegistry]);\n\n\treturn <DragDropContext.Provider value={value}>{children}</DragDropContext.Provider>;\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/drag-drop-context/lifecycle-context.tsx",
    "content": "/**\n * The lifecycle methods owned by this provided are used to align internal\n * timings with those of the rbd lifecycle.\n *\n * The events are intentionally distinct to those exposed by rbd to avoid\n * any confusion around whether events are fired internally or externally\n * first.\n */\n\nimport React, { createContext, type ReactNode, useCallback, useContext, useState } from 'react';\n\nimport type { DraggableId, DraggableLocation, DragStart, DragUpdate } from 'react-beautiful-dnd';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\n\nimport type { CleanupFn } from '../internal-types';\nimport { batchUpdatesForReact16 } from '../utils/batch-updates-for-react-16';\n\nimport type { DroppableRegistryEntry } from './droppable-registry';\nimport { rbdInvariant } from './rbd-invariant';\n\n/**\n * The data associated with each type of lifecycle event.\n */\ntype DispatchData = {\n\tonPendingDragStart: {\n\t\tstart: DragStart;\n\t\tdroppable: DroppableRegistryEntry;\n\t};\n\tonPrePendingDragUpdate: {\n\t\tupdate: DragUpdate;\n\t\ttargetLocation: DraggableLocation | null;\n\t};\n\tonPendingDragUpdate: DispatchData['onPrePendingDragUpdate'] & {\n\t\tdroppable: DroppableRegistryEntry | null;\n\t};\n\tonBeforeDragEnd: {\n\t\tdraggableId: DraggableId;\n\t};\n};\n\ntype LifecycleResponders = {\n\t[Key in keyof DispatchData]: (args: DispatchData[Key]) => void;\n};\n\ntype LifecycleEvent = keyof LifecycleResponders;\n\ntype Registry = {\n\t[Key in keyof LifecycleResponders]: LifecycleResponders[Key][];\n};\n\ntype AddResponder = <Event extends LifecycleEvent>(\n\tevent: Event,\n\tresponder: LifecycleResponders[Event],\n) => CleanupFn;\n\ntype Dispatch = <Event extends LifecycleEvent>(event: Event, data: DispatchData[Event]) => void;\n\ntype LifecycleManager = {\n\taddResponder: AddResponder;\n\tdispatch: Dispatch;\n};\n\nfunction createRegistry(): Registry {\n\treturn {\n\t\tonPendingDragStart: [],\n\t\tonPrePendingDragUpdate: [],\n\t\tonPendingDragUpdate: [],\n\t\tonBeforeDragEnd: [],\n\t};\n}\n\nfunction createLifecycleManager(): LifecycleManager {\n\tconst registry = createRegistry();\n\n\tconst addResponder: AddResponder = (event, responder) => {\n\t\tregistry[event].push(responder);\n\n\t\treturn () => {\n\t\t\t// @ts-expect-error - type narrowing issues\n\t\t\tregistry[event] = registry[event].filter((value) => value !== responder);\n\t\t};\n\t};\n\n\tconst dispatch: Dispatch = (event, data) => {\n\t\tbatchUpdatesForReact16(() => {\n\t\t\tfor (const responder of registry[event]) {\n\t\t\t\tresponder(data);\n\t\t\t}\n\t\t});\n\t};\n\n\treturn { addResponder, dispatch };\n}\n\n/**\n * Creates a new lifecycle manager, returning methods for interfacing with it.\n */\nexport function useLifecycle(): LifecycleManager {\n\tconst [lifecycleManager] = useState<LifecycleManager>(createLifecycleManager);\n\n\treturn lifecycleManager;\n}\n\ntype MonitorForLifecycle = (args: Partial<LifecycleResponders>) => CleanupFn;\n\nconst LifecycleContext = createContext<MonitorForLifecycle | null>(null);\n\nexport function LifecycleContextProvider({\n\tchildren,\n\tlifecycle,\n}: {\n\tchildren: ReactNode;\n\tlifecycle: LifecycleManager;\n}): React.JSX.Element {\n\t/**\n\t * Allows for `<Draggable>` and `<Droppable>` instances to know about the\n\t * lifecycle timings.\n\t *\n\t * Designed to have a similar API to the pdnd monitors.\n\t */\n\tconst monitorForLifecycle: MonitorForLifecycle = useCallback(\n\t\t(responders) => {\n\t\t\tconst cleanupFns: CleanupFn[] = [];\n\n\t\t\tfor (const entry of Object.entries(responders)) {\n\t\t\t\tconst [event, responder] = entry as [LifecycleEvent, LifecycleResponders[LifecycleEvent]];\n\n\t\t\t\tcleanupFns.push(lifecycle.addResponder(event, responder));\n\t\t\t}\n\n\t\t\treturn combine(...cleanupFns);\n\t\t},\n\t\t[lifecycle],\n\t);\n\n\treturn (\n\t\t<LifecycleContext.Provider value={monitorForLifecycle}>{children}</LifecycleContext.Provider>\n\t);\n}\n\nexport function useMonitorForLifecycle(): MonitorForLifecycle {\n\tconst monitorForLifecycle = useContext(LifecycleContext);\n\trbdInvariant(\n\t\tmonitorForLifecycle !== null,\n\t\t'useLifecycle() should only be called inside of a <DragDropContext />',\n\t);\n\n\treturn monitorForLifecycle;\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/drag-drop-context/live-region.tsx",
    "content": "/**\n * This is defined in the migration package instead of using `@atlaskit/pragmatic-drag-and-drop-live-region`\n * because RBD-style dragging has different needs to the alternative flows of PDND.\n *\n * RBD can make a lot of announcements in a short period, so delaying messages is not feasible.\n * RBD also maintains focus while dragging, so messages being skipped is less of a concern.\n *\n * `@atlaskit/pragmatic-drag-and-drop-live-region` has been tailored for PDND-specific alternative flows,\n * where focus usually changes around the time `announce()` is called. So in `@atlaskit/pragmatic-drag-and-drop-live-region`\n * messages have delays to avoid them being skipped.\n */\n\nlet node: HTMLElement | null = null;\n\nconst size = '1px';\n\nconst visuallyHiddenStyles = {\n\t// Standard visually hidden styles.\n\t// Copied from our VisuallyHidden (react) package.\n\twidth: size,\n\theight: size,\n\tpadding: '0',\n\tposition: 'absolute',\n\tborder: '0',\n\tclip: `rect(${size}, ${size}, ${size}, ${size})`,\n\toverflow: 'hidden',\n\twhiteSpace: 'nowrap',\n\t// Pulling upwards slightly to prevent the page\n\t// from growing when appended to a body that contains\n\t// an element with height:100%\n\tmarginTop: `-${size}`,\n\t// Just being safe and letting this element not interfere with hitboxes\n\tpointerEvents: 'none',\n};\n\n/**\n * Creates a live region node, appends it to the body, and returns it.\n */\nfunction createNode(): HTMLElement {\n\tconst node = document.createElement('div');\n\tnode.setAttribute('role', 'alert');\n\tObject.assign(node.style, visuallyHiddenStyles);\n\tdocument.body.append(node);\n\treturn node;\n}\n\n/**\n * Returns the live region node, creating one if necessary.\n */\nfunction getNode(): HTMLElement {\n\tif (node === null) {\n\t\tnode = createNode();\n\t}\n\treturn node;\n}\n\n/**\n * Announces the provided message to assistive technology.\n */\nexport function announce(message: string): void {\n\tconst node = getNode();\n\tnode.textContent = message;\n}\n\n/**\n * Removes the created live region. If there is no live region this is a no-op.\n */\nexport function cleanup(): void {\n\tnode?.remove();\n\tnode = null;\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/drag-drop-context/rbd-invariant.tsx",
    "content": "const isProduction: boolean = process.env.NODE_ENV === 'production';\nconst prefix: string = 'Invariant failed';\n\nexport class RbdInvariant extends Error {\n\tconstructor(message: string) {\n\t\tsuper();\n\t\tthis.message = message;\n\t}\n\n\ttoString(): string {\n\t\treturn this.message;\n\t}\n}\n\n// A copy-paste of tiny-invariant but with a custom error type\n// Throw an error if the condition fails\nexport function rbdInvariant(condition: unknown, message?: string): asserts condition {\n\tif (condition) {\n\t\treturn;\n\t}\n\n\tif (isProduction) {\n\t\t// In production we strip the message but still throw\n\t\tthrow new RbdInvariant(prefix);\n\t} else {\n\t\t// When not in production we allow the message to pass through\n\t\t// *This block will be removed in production builds*\n\t\tthrow new RbdInvariant(`${prefix}: ${message || ''}`);\n\t}\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/drag-drop-context/screen-reader.tsx",
    "content": "import type {\n\tDraggableLocation,\n\tDragStart,\n\tDragUpdate,\n\tDropResult,\n\tResponderProvided,\n} from 'react-beautiful-dnd';\n\nimport { warning } from '../dev-warning';\n\nfunction getPosition(location: DraggableLocation) {\n\treturn location.index + 1;\n}\n\nexport const defaultMessage = {\n\tonDragStart({ source }: DragStart): string {\n\t\tconst startPosition = getPosition(source);\n\t\treturn `You have lifted an item in position ${startPosition}.`;\n\t},\n\n\tonDragUpdate({ source, destination }: DragUpdate): string {\n\t\tif (!destination) {\n\t\t\treturn 'You are currently not dragging over a droppable area.';\n\t\t}\n\n\t\tconst startPosition = getPosition(source);\n\t\tconst endPosition = getPosition(destination);\n\n\t\tconst isSameList = source.droppableId === destination.droppableId;\n\t\tif (isSameList) {\n\t\t\treturn `You have moved the item from position ${startPosition} to position ${endPosition}.`;\n\t\t}\n\n\t\treturn `You have moved the item from position ${startPosition} in list ${source.droppableId} to list ${destination.droppableId} in position ${endPosition}.`;\n\t},\n\n\tonDragEnd({ source, destination, reason }: DropResult): string {\n\t\tconst startPosition = getPosition(source);\n\n\t\tif (reason === 'CANCEL') {\n\t\t\treturn `Movement cancelled. The item has returned to its starting position of ${startPosition}.`;\n\t\t}\n\n\t\tif (!destination) {\n\t\t\treturn `The item has been dropped while not over a droppable location. The item has returned to its starting position of ${startPosition}.`;\n\t\t}\n\n\t\tconst endPosition = getPosition(destination);\n\n\t\tconst isSameList = source.droppableId === destination.droppableId;\n\t\tif (isSameList) {\n\t\t\treturn `You have dropped the item. It has moved from position ${startPosition} to ${endPosition}.`;\n\t\t}\n\n\t\treturn `You have dropped the item. It has moved from position ${startPosition} in list ${source.droppableId} to position ${endPosition} in list ${destination.droppableId}.`;\n\t},\n} as const;\n\ntype EventName = keyof typeof defaultMessage;\ntype EventData<Event extends EventName> = Parameters<(typeof defaultMessage)[Event]>[0];\n\nexport function getDefaultMessage<Event extends EventName>(\n\tevent: Event,\n\tdata: EventData<Event>,\n): string {\n\t// @ts-expect-error - narrowing issue\n\treturn defaultMessage[event](data);\n}\n\nexport function getProvided<Event extends EventName>(\n\tevent: Event,\n\tdata: EventData<Event>,\n): {\n\tprovided: ResponderProvided;\n\tgetMessage(): string;\n} {\n\t/**\n\t * The custom message to be used.\n\t */\n\tlet userMessage: string | null = null;\n\n\t/**\n\t * Whether the message has been read yet.\n\t *\n\t * After it has been read, the user can no longer override it.\n\t */\n\tlet hasExpired = false;\n\n\tconst provided = {\n\t\t/**\n\t\t * Used to capture custom messages for screen readers.\n\t\t *\n\t\t * Does not announce directly, but exposes the message that should be\n\t\t * announced. This may or may not be the default message.\n\t\t */\n\t\tannounce(message: string) {\n\t\t\tif (process.env.NODE_ENV !== 'production') {\n\t\t\t\tif (userMessage) {\n\t\t\t\t\twarning('Announcement already made. Not making a second announcement');\n\t\t\t\t}\n\n\t\t\t\tif (hasExpired) {\n\t\t\t\t\twarning(`\n            Announcements cannot be made asynchronously.\n            Default message has already been announced.\n          `);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tuserMessage = message;\n\t\t},\n\t};\n\n\t/**\n\t * Returns the message that should be announced.\n\t */\n\tfunction getMessage() {\n\t\thasExpired = true;\n\t\treturn userMessage ?? getDefaultMessage(event, data);\n\t}\n\n\treturn { provided, getMessage };\n}\n\nexport const defaultDragHandleUsageInstructions: string = `\n  Press space bar to start a drag.\n  When dragging you can use the arrow keys to move the item around and escape to cancel.\n  Some screen readers may require you to be in focus mode or to use your pass through key\n`;\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/drag-drop-context/types.tsx",
    "content": "import type { DraggableId, DraggableLocation, MovementMode } from 'react-beautiful-dnd';\n\nimport type { DraggableDimensions } from '../hooks/use-captured-dimensions';\n\nexport type DragState =\n\t| { isDragging: false }\n\t| {\n\t\t\tisDragging: true;\n\t\t\tmode: MovementMode;\n\t\t\tdraggableDimensions: DraggableDimensions;\n\t\t\tprevDestination: DraggableLocation | null;\n\t\t\trestoreFocusTo: DraggableId | null;\n\n\t\t\tdraggableId: DraggableId;\n\t\t\ttype: string;\n\t\t\tsourceLocation: DraggableLocation;\n\t\t\ttargetLocation: DraggableLocation | null;\n\n\t\t\t/**\n\t\t\t * This is used for positioning placeholders in virtual lists.\n\t\t\t */\n\t\t\tdraggableInitialOffsetInSourceDroppable: { top: number; left: number };\n\t  };\n\n/**\n * An abstraction that both pointer dragging and keyboard dragging can\n * control state through.\n */\nexport type DragController = {\n\tgetDragState(): DragState;\n\n\tstartDrag(args: {\n\t\tdraggableId: string;\n\t\ttype: string;\n\t\tgetSourceLocation(): DraggableLocation;\n\t\tsourceElement: HTMLElement;\n\t\tmode: MovementMode;\n\t}): void;\n\n\tupdateDrag(args: { targetLocation: DraggableLocation | null }): void;\n\n\tstopDrag(args: { reason: 'CANCEL' | 'DROP' }): void;\n};\n\nexport type StartKeyboardDrag = (args: {\n\t/**\n\t * The event that caused `startKeyboardDrag()` to be called.\n\t */\n\tevent: KeyboardEvent;\n\tdraggableId: string;\n\ttype: string;\n\tgetSourceLocation(): DraggableLocation;\n\tsourceElement: HTMLElement;\n}) => void;\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/drag-drop-context/use-scheduler.tsx",
    "content": "import { useState } from 'react';\n\nimport { batchUpdatesForReact16 } from '../utils/batch-updates-for-react-16';\n\ntype Callback = () => void;\n\ntype Scheduler = {\n\t/**\n\t * Queues the provided function to be called asynchronously.\n\t */\n\tschedule(callback: Callback): void;\n\n\t/**\n\t * Calls the queue of functions synchronously, and cancels the pending timeouts.\n\t */\n\tflush(): void;\n};\n\ntype Queue =\n\t| { status: 'idle' }\n\t| {\n\t\t\tstatus: 'pending';\n\t\t\ttimeoutId: ReturnType<typeof setTimeout>;\n\t\t\titems: Callback[];\n\t  };\n\nconst idleQueue: Queue = { status: 'idle' };\n\nfunction createScheduler(): Scheduler {\n\tlet queue: Queue = idleQueue;\n\n\tconst schedule = (callback: Callback) => {\n\t\t/**\n\t\t * If the queue is currently idle (no update scheduled) then\n\t\t * we should call `setTimeout` to schedule an update.\n\t\t */\n\t\tif (queue.status === 'idle') {\n\t\t\tqueue = {\n\t\t\t\tstatus: 'pending',\n\t\t\t\ttimeoutId: setTimeout(flush, 0),\n\t\t\t\titems: [],\n\t\t\t};\n\t\t}\n\n\t\tqueue.items.push(callback);\n\t};\n\n\tconst flush = () => {\n\t\tif (queue.status === 'idle') {\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Clearing the timeout optimistically in case `flush` was called directly.\n\t\t */\n\t\tclearTimeout(queue.timeoutId);\n\t\t/**\n\t\t * A shallow copy is used so that updates which queue further updates\n\t\t * are not batched together. This is to more closely match rbd.\n\t\t */\n\t\tconst items = Array.from(queue.items);\n\t\t/**\n\t\t * The queue is made idle so it is ready to schedule further updates.\n\t\t */\n\t\tqueue = idleQueue;\n\n\t\t/**\n\t\t * Scheduled callbacks are batched.\n\t\t *\n\t\t * The batching is more evident when the page is running more slowly.\n\t\t */\n\t\tbatchUpdatesForReact16(() => {\n\t\t\titems.forEach((callback) => callback());\n\t\t});\n\t};\n\n\treturn { schedule, flush };\n}\n\n/**\n * Used to schedule callbacks inside of a `setTimeout(fn, 0)`.\n *\n * This is used to match the behavior and timings of `react-beautiful-dnd`.\n */\nexport function useScheduler(): Scheduler {\n\tconst [scheduler] = useState(createScheduler);\n\treturn scheduler;\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/draggable/constants.tsx",
    "content": "/**\n * This value was copied from `react-beautiful-dnd`\n */\nexport const zIndex = {\n\tdragging: 5000,\n};\n\n/**\n * How far the drag preview is offset on the cross axis.\n *\n * Using a fixed value instead of a percentage, due to issues with the\n * offset growing too large.\n */\nexport const keyboardPreviewCrossAxisOffset = 24;\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/draggable/data.tsx",
    "content": "import { useMemo } from 'react';\n\nimport type { DraggableId, DroppableId } from 'react-beautiful-dnd';\n\n/**\n * Private symbol that is intentionally not exported from this file.\n */\nconst privateKey = Symbol('DraggableData');\n\n/**\n * Data that is attached to drags. The same data is used for the `draggable()`\n * and `dropTargetForElements()` calls related to a `<Draggable>` instance.\n */\nexport type DraggableData = {\n\t/**\n\t * Indicates this data is for a `<Draggable>` instance.\n\t */\n\t[privateKey]: true;\n\n\t/**\n\t * The `draggableId` of the `<Draggable>` instance.\n\t */\n\tdraggableId: DraggableId;\n\t/**\n\t * Lazily returns the `index` of the `<Draggable>` instance.\n\t *\n\t * This is a function because the `index` can change during a drag.\n\t */\n\tgetIndex: () => number;\n\t/**\n\t * The `droppableId` of the containing `<Droppable>` instance.\n\t */\n\tdroppableId: DroppableId;\n\t/**\n\t * The `type` of the containing `<Droppable>` instance.\n\t */\n\ttype: string;\n\n\tcontextId: string;\n};\n\n/**\n * Checks if the passed data satisfies `DraggableData` using the private symbol.\n */\nexport function isDraggableData(data: Record<string | symbol, unknown>): data is DraggableData {\n\treturn data[privateKey] === true;\n}\n\n/**\n * Adds the private symbol to the passed data.\n *\n * The symbol allows us to quickly check if an object satisfies `DraggableData`.\n */\nexport function useDraggableData({\n\tdraggableId,\n\tdroppableId,\n\tgetIndex,\n\tcontextId,\n\ttype,\n}: Omit<DraggableData, symbol>): DraggableData {\n\treturn useMemo(() => {\n\t\treturn {\n\t\t\t[privateKey]: true,\n\t\t\tdraggableId,\n\t\t\tdroppableId,\n\t\t\tgetIndex,\n\t\t\tcontextId,\n\t\t\ttype,\n\t\t};\n\t}, [draggableId, droppableId, getIndex, contextId, type]);\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/draggable/get-draggable-provided-style.tsx",
    "content": "import type { DraggingStyle, NotDraggingStyle } from 'react-beautiful-dnd';\n\nimport type { DraggableDimensions } from '../hooks/use-captured-dimensions';\n\nimport { zIndex } from './constants';\nimport type { DraggablePreviewOffset, DraggableState } from './state';\n\nexport const notDraggingStyle: NotDraggingStyle = {\n\ttransform: undefined,\n\ttransition: undefined,\n};\n\nconst baseDraggingStyle = {\n\tposition: 'fixed',\n\ttop: 0,\n\tleft: 0,\n\tboxSizing: 'border-box',\n\ttransition: 'none',\n\tzIndex: zIndex.dragging,\n\t/**\n\t * This transparency is intended to allow for better visibility of\n\t * drop indicators.\n\t */\n\topacity: 0.75,\n\tpointerEvents: 'none',\n} as const;\n\n/**\n * Provides the drag preview styles based on the current drag state.\n */\nfunction getDraggingStyle({\n\tdraggableDimensions,\n\tpreviewOffset,\n}: {\n\tdraggableDimensions: DraggableDimensions;\n\tpreviewOffset: DraggablePreviewOffset;\n}): DraggingStyle {\n\tconst { rect } = draggableDimensions;\n\n\tconst translateX = rect.left + previewOffset.x;\n\tconst translateY = rect.top + previewOffset.y;\n\n\tconst isAtOrigin = translateX === 0 && translateY === 0;\n\n\treturn {\n\t\t...baseDraggingStyle,\n\t\ttransform: isAtOrigin ? undefined : `translate(${translateX}px, ${translateY}px)`,\n\t\twidth: rect.width,\n\t\theight: rect.height,\n\t};\n}\n\n/**\n * Returns the styles which should be provided to the draggable via the\n * `draggableProps` API.\n */\nexport function getDraggableProvidedStyle({\n\tdraggableDimensions,\n\tdraggableState,\n}: {\n\tdraggableDimensions: DraggableDimensions | null;\n\tdraggableState: DraggableState;\n}): DraggingStyle | NotDraggingStyle {\n\tif (draggableState.type !== 'dragging' || !draggableState.previewOffset || !draggableDimensions) {\n\t\treturn notDraggingStyle;\n\t}\n\n\treturn getDraggingStyle({\n\t\tdraggableDimensions,\n\t\tpreviewOffset: draggableState.previewOffset,\n\t});\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/draggable/index.tsx",
    "content": "import React, { useCallback, useEffect, useMemo, useReducer, useRef } from 'react';\n\nimport { bindAll } from 'bind-event-listener';\nimport type {\n\tDraggableProps,\n\tDraggableProvided,\n\tDraggableRubric,\n\tDraggableStateSnapshot,\n} from 'react-beautiful-dnd';\nimport invariant from 'tiny-invariant';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { draggable, monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\nimport { disableNativeDragPreview } from '@atlaskit/pragmatic-drag-and-drop/element/disable-native-drag-preview';\nimport { getElementFromPointWithoutHoneypot } from '@atlaskit/pragmatic-drag-and-drop/private/get-element-from-point-without-honey-pot';\n\nimport { getHiddenTextElementId } from '../drag-drop-context/hooks/use-hidden-text-element';\nimport { useDragDropContext } from '../drag-drop-context/internal-context';\nimport { useMonitorForLifecycle } from '../drag-drop-context/lifecycle-context';\nimport { rbdInvariant } from '../drag-drop-context/rbd-invariant';\nimport { useDroppableContext } from '../droppable/droppable-context';\nimport { useDraggableDimensions } from '../hooks/use-captured-dimensions';\nimport { useCleanupFn } from '../hooks/use-cleanup-fn';\nimport { useDropTargetForDraggable } from '../hooks/use-drop-target-for-draggable';\nimport { useKeyboardContext } from '../hooks/use-keyboard-context';\nimport { attributes, customAttributes, setAttributes } from '../utils/attributes';\nimport { findDragHandle } from '../utils/find-drag-handle';\nimport { findDropIndicator } from '../utils/find-drop-indicator';\nimport { findPlaceholder } from '../utils/find-placeholder';\nimport { useStable } from '../utils/use-stable';\n\nimport { isDraggableData, useDraggableData } from './data';\nimport { getDraggableProvidedStyle } from './get-draggable-provided-style';\nimport isEventInInteractiveElement, {\n\tisAnInteractiveElement,\n} from './is-event-in-interactive-element';\nimport { Placeholder } from './placeholder';\nimport { idleState, reducer } from './state';\nimport { useDraggableStateSnapshot } from './use-draggable-state-snapshot';\n\nconst noop = () => {};\n\nexport function Draggable({\n\tchildren,\n\tdraggableId,\n\tindex,\n\tisDragDisabled = false,\n\tdisableInteractiveElementBlocking = false,\n}: DraggableProps): React.JSX.Element {\n\tconst { direction, droppableId, type, mode } = useDroppableContext();\n\n\tconst { contextId, getDragState } = useDragDropContext();\n\n\tconst elementRef = useRef<HTMLElement | null>(null);\n\tconst dragHandleRef = useRef<HTMLElement | null>(null);\n\n\tconst { setCleanupFn, runCleanupFn } = useCleanupFn();\n\tconst setElement = useCallback(\n\t\t(element: HTMLElement | null) => {\n\t\t\tif (elementRef.current) {\n\t\t\t\t/**\n\t\t\t\t * Call the `setAttribute` clean up if the element changes\n\t\t\t\t */\n\t\t\t\trunCleanupFn();\n\t\t\t}\n\n\t\t\tif (element) {\n\t\t\t\t/**\n\t\t\t\t * The migration layer attaches some additional data attributes.\n\t\t\t\t *\n\t\t\t\t * These are required for querying elements in the DOM.\n\t\t\t\t *\n\t\t\t\t * These are not applied through render props, to avoid changing the type\n\t\t\t\t * interface of the migration layer.\n\t\t\t\t */\n\t\t\t\tconst cleanupFn = setAttributes(element, {\n\t\t\t\t\t[customAttributes.draggable.droppableId]: droppableId,\n\t\t\t\t\t[customAttributes.draggable.index]: String(index),\n\t\t\t\t});\n\n\t\t\t\tsetCleanupFn(cleanupFn);\n\t\t\t}\n\n\t\t\telementRef.current = element;\n\t\t\tdragHandleRef.current = findDragHandle({ contextId, draggableId });\n\t\t},\n\t\t[contextId, draggableId, droppableId, index, runCleanupFn, setCleanupFn],\n\t);\n\n\tconst getIndex = useStable(index);\n\n\tconst [state, dispatch] = useReducer(reducer, idleState);\n\n\tconst data = useDraggableData({\n\t\tdraggableId,\n\t\tdroppableId,\n\t\tgetIndex,\n\t\tcontextId,\n\t\ttype,\n\t});\n\n\tconst isDragging = state.type === 'dragging';\n\tconst isHiding = state.type === 'hiding';\n\n\tconst { shouldRenderCloneWhileDragging, isDropDisabled } = useDroppableContext();\n\n\tconst monitorForLifecycle = useMonitorForLifecycle();\n\n\tconst { startKeyboardDrag } = useKeyboardContext();\n\n\t/**\n\t * Binds the `keydown` listener to the drag handle which handles starting\n\t * keyboard drags.\n\t */\n\tuseEffect(() => {\n\t\tif (state.type !== 'idle') {\n\t\t\treturn;\n\t\t}\n\n\t\tif (isDragDisabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst element = elementRef.current;\n\t\tinvariant(element instanceof HTMLElement);\n\n\t\tconst dragHandle = dragHandleRef.current;\n\t\tinvariant(dragHandle instanceof HTMLElement);\n\n\t\treturn bindAll(dragHandle, [\n\t\t\t{\n\t\t\t\ttype: 'keydown',\n\t\t\t\tlistener(event) {\n\t\t\t\t\tif (event.key === ' ') {\n\t\t\t\t\t\tif (event.defaultPrevented) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (!disableInteractiveElementBlocking && isEventInInteractiveElement(element, event)) {\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Only prevent default if we are consuming it\n\t\t\t\t\t\tevent.preventDefault();\n\n\t\t\t\t\t\tstartKeyboardDrag({\n\t\t\t\t\t\t\tevent,\n\t\t\t\t\t\t\tdraggableId,\n\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\tgetSourceLocation() {\n\t\t\t\t\t\t\t\treturn { droppableId, index: getIndex() };\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tsourceElement: element,\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t},\n\t\t]);\n\t}, [\n\t\tdisableInteractiveElementBlocking,\n\t\tdraggableId,\n\t\tdroppableId,\n\t\tgetIndex,\n\t\tisDragDisabled,\n\t\tstartKeyboardDrag,\n\t\tstate.type,\n\t\ttype,\n\t]);\n\n\t/**\n\t * Sets up the pdnd draggable.\n\t */\n\tuseEffect(() => {\n\t\tif (isHiding) {\n\t\t\t/**\n\t\t\t * If we render a clone, then we need to unmount the original element.\n\t\t\t *\n\t\t\t * Because of this, `elementRef.current` will become `null` and we will\n\t\t\t * no longer have a valid `element` reference.\n\t\t\t *\n\t\t\t * In this case, not having a valid `element` is expected,\n\t\t\t * instead of being an error.\n\t\t\t */\n\t\t\treturn;\n\t\t}\n\n\t\tif (isDragDisabled) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst element = elementRef.current;\n\t\trbdInvariant(element instanceof HTMLElement);\n\n\t\tconst dragHandle = dragHandleRef.current;\n\t\trbdInvariant(dragHandle instanceof HTMLElement);\n\n\t\treturn draggable({\n\t\t\tcanDrag({ input }) {\n\t\t\t\t/**\n\t\t\t\t * Do not start a drag if any modifier key is pressed.\n\t\t\t\t * This matches the behavior of `react-beautiful-dnd`.\n\t\t\t\t */\n\t\t\t\tif (input.ctrlKey || input.metaKey || input.shiftKey || input.altKey) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\t/**\n\t\t\t\t * To align with `react-beautiful-dnd` we are blocking drags\n\t\t\t\t * on interactive elements, unless the `disableInteractiveElementBlocking`\n\t\t\t\t * prop is provided.\n\t\t\t\t */\n\t\t\t\tif (!disableInteractiveElementBlocking) {\n\t\t\t\t\tconst elementUnderPointer = getElementFromPointWithoutHoneypot({\n\t\t\t\t\t\tx: input.clientX,\n\t\t\t\t\t\ty: input.clientY,\n\t\t\t\t\t});\n\t\t\t\t\treturn !isAnInteractiveElement(dragHandle, elementUnderPointer);\n\t\t\t\t}\n\n\t\t\t\treturn !isDragging;\n\t\t\t},\n\t\t\telement,\n\t\t\tdragHandle,\n\t\t\tgetInitialData() {\n\t\t\t\treturn data;\n\t\t\t},\n\t\t\tonGenerateDragPreview: disableNativeDragPreview,\n\t\t});\n\t}, [data, disableInteractiveElementBlocking, isDragDisabled, isDragging, isHiding]);\n\n\tconst hasPlaceholder = state.type !== 'idle' && mode === 'standard';\n\tconst placeholderRef = useRef<HTMLDivElement>(null);\n\n\tuseDropTargetForDraggable({\n\t\t/**\n\t\t * Swapping the drop target to the placeholder is important\n\t\t * to ensure that hovering over where the item was won't result in a\n\t\t * drop at the end of the list.\n\t\t */\n\t\telementRef: hasPlaceholder ? placeholderRef : elementRef,\n\t\tdata,\n\t\tdirection,\n\t\tcontextId,\n\t\tisDropDisabled,\n\t\ttype,\n\t});\n\n\tconst isMountedRef = useRef(true);\n\tuseEffect(() => {\n\t\t/**\n\t\t * React 18 strict mode will re-run effects in development mode.\n\t\t * https://react.dev/reference/react/StrictMode#fixing-bugs-found-by-re-running-effects-in-development\n\t\t *\n\t\t * Setting the ref value to `true` again in the effect to avoid the value staying `false` incorrectly after\n\t\t * the first cleanup.\n\t\t */\n\t\tisMountedRef.current = true;\n\t\treturn () => {\n\t\t\tisMountedRef.current = false;\n\t\t};\n\t}, []);\n\n\t/**\n\t * If the draggable (re)mounts while it is being dragged (via a clone),\n\t * then it should hide itself.\n\t */\n\tuseEffect(() => {\n\t\tconst dragState = getDragState();\n\n\t\t/**\n\t\t * If the draggable is not using a clone, then it doesn't need to be hidden.\n\t\t */\n\t\tif (!shouldRenderCloneWhileDragging) {\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * If there is no ongoing drag, then it doesn't need to be hidden.\n\t\t */\n\t\tif (!dragState.isDragging) {\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * Only the draggable being dragged (via a clone) needs to be hidden.\n\t\t */\n\t\tif (dragState.draggableId !== data.draggableId) {\n\t\t\treturn;\n\t\t}\n\n\t\tdispatch({ type: 'START_HIDING', payload: { mode: dragState.mode } });\n\t}, [data.draggableId, getDragState, shouldRenderCloneWhileDragging]);\n\n\tconst draggableDimensions = useDraggableDimensions();\n\n\tuseEffect(() => {\n\t\t/**\n\t\t * If the draggable should render a clone while dragging,\n\t\t * then it doesn't need to track any state, and it should be hidden.\n\t\t */\n\t\tif (shouldRenderCloneWhileDragging) {\n\t\t\treturn monitorForLifecycle({\n\t\t\t\tonPendingDragStart({ start }) {\n\t\t\t\t\tif (data.draggableId !== start.draggableId) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tdispatch({ type: 'START_HIDING', payload: { mode: start.mode } });\n\t\t\t\t},\n\t\t\t\tonBeforeDragEnd({ draggableId }) {\n\t\t\t\t\tif (draggableId !== data.draggableId) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tdispatch({ type: 'STOP_HIDING' });\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Drag events need to be monitored independently because the original\n\t\t * element can be unmounted for two (valid) reasons.\n\t\t *\n\t\t * The original element can be unmounted during the drag for two reasons:\n\t\t *\n\t\t * 1. A `renderClone` method has been provided to the containing\n\t\t *    `<Droppable />` element. In this case the element is unmounted so\n\t\t *    that it is not visible while the clone is.\n\t\t *\n\t\t * 2. The user portals the element while it is being dragged. This would\n\t\t *    result in the original `HTMLElement` being unmounted.\n\t\t */\n\t\treturn combine(\n\t\t\tmonitorForLifecycle({\n\t\t\t\tonPendingDragStart({ start, droppable }) {\n\t\t\t\t\tif (data.draggableId !== start.draggableId) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (start.mode === 'FLUID') {\n\t\t\t\t\t\treturn dispatch({\n\t\t\t\t\t\t\ttype: 'START_POINTER_DRAG',\n\t\t\t\t\t\t\tpayload: { start },\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tif (start.mode === 'SNAP') {\n\t\t\t\t\t\tconst dragState = getDragState();\n\t\t\t\t\t\trbdInvariant(dragState.isDragging && dragState.draggableDimensions);\n\t\t\t\t\t\treturn dispatch({\n\t\t\t\t\t\t\ttype: 'START_KEYBOARD_DRAG',\n\t\t\t\t\t\t\tpayload: {\n\t\t\t\t\t\t\t\tstart,\n\t\t\t\t\t\t\t\tdraggableDimensions: dragState.draggableDimensions,\n\t\t\t\t\t\t\t\tdroppable,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\tonPendingDragUpdate({ update, droppable }) {\n\t\t\t\t\tif (data.draggableId !== update.draggableId) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tdispatch({\n\t\t\t\t\t\ttype: 'UPDATE_DRAG',\n\t\t\t\t\t\tpayload: { update },\n\t\t\t\t\t});\n\n\t\t\t\t\tif (update.mode === 'SNAP') {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Updating the position in a microtask to resolve timing issues.\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * When doing cross-axis dragging, the drop indicator in the new\n\t\t\t\t\t\t * droppable will mount and update in a `onPendingDragUpdate` too.\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * The microtask ensures that the indicator will have updated by\n\t\t\t\t\t\t * the time this runs, so the preview will have the correct\n\t\t\t\t\t\t * location of the indicator.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Because this update occurs in a microtask, we need to check\n\t\t\t\t\t\t\t * that the drag is still happening.\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * If it has ended we should not try to update the preview.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tconst dragState = getDragState();\n\t\t\t\t\t\t\tif (!dragState.isDragging) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * The placeholder might not exist if its associated\n\t\t\t\t\t\t\t * draggable unmounts in a virtual list.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tconst placeholder = findPlaceholder(contextId);\n\t\t\t\t\t\t\tconst placeholderRect = placeholder ? placeholder.getBoundingClientRect() : null;\n\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * The drop indicator might not exist if the current target\n\t\t\t\t\t\t\t * is null\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tconst dropIndicator = findDropIndicator();\n\t\t\t\t\t\t\tconst dropIndicatorRect = dropIndicator\n\t\t\t\t\t\t\t\t? dropIndicator.getBoundingClientRect()\n\t\t\t\t\t\t\t\t: null;\n\n\t\t\t\t\t\t\tdispatch({\n\t\t\t\t\t\t\t\ttype: 'UPDATE_KEYBOARD_PREVIEW',\n\t\t\t\t\t\t\t\tpayload: {\n\t\t\t\t\t\t\t\t\tupdate,\n\t\t\t\t\t\t\t\t\tdraggableDimensions,\n\t\t\t\t\t\t\t\t\tdroppable,\n\t\t\t\t\t\t\t\t\tplaceholderRect,\n\t\t\t\t\t\t\t\t\tdropIndicatorRect,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t},\n\n\t\t\t\tonBeforeDragEnd({ draggableId }) {\n\t\t\t\t\tif (draggableId !== data.draggableId) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\trbdInvariant(isMountedRef.current, 'isMounted onBeforeDragEnd');\n\n\t\t\t\t\tdispatch({ type: 'DROP' });\n\t\t\t\t},\n\t\t\t}),\n\t\t\tmonitorForElements({\n\t\t\t\tcanMonitor({ source }) {\n\t\t\t\t\tif (!isDraggableData(source.data)) {\n\t\t\t\t\t\t// not dragging something from the migration layer\n\t\t\t\t\t\t// we should not monitor it\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\tsource.data.contextId === data.contextId && source.data.draggableId === data.draggableId\n\t\t\t\t\t);\n\t\t\t\t},\n\t\t\t\tonDrag({ location }) {\n\t\t\t\t\tdispatch({\n\t\t\t\t\t\ttype: 'UPDATE_POINTER_PREVIEW',\n\t\t\t\t\t\tpayload: { pointerLocation: location },\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [\n\t\tdata.draggableId,\n\t\tdata.contextId,\n\t\tmonitorForLifecycle,\n\t\tshouldRenderCloneWhileDragging,\n\t\tdirection,\n\t\tcontextId,\n\t\tdraggableDimensions,\n\t\tgetDragState,\n\t]);\n\n\tconst provided: DraggableProvided = useMemo(\n\t\t() => ({\n\t\t\tdraggableProps: {\n\t\t\t\t[attributes.draggable.contextId]: contextId,\n\t\t\t\t[attributes.draggable.id]: draggableId,\n\t\t\t\tstyle: getDraggableProvidedStyle({\n\t\t\t\t\tdraggableDimensions,\n\t\t\t\t\tdraggableState: state,\n\t\t\t\t}),\n\t\t\t},\n\t\t\tdragHandleProps: {\n\t\t\t\trole: 'button',\n\t\t\t\t'aria-describedby': getHiddenTextElementId(contextId),\n\t\t\t\t[attributes.dragHandle.contextId]: contextId,\n\t\t\t\t[attributes.dragHandle.draggableId]: draggableId,\n\t\t\t\ttabIndex: 0,\n\t\t\t\t/**\n\t\t\t\t * This must be `false` for drags to trigger on the draggable `element`,\n\t\t\t\t * which may be a parent, and not on the `dragHandle`.\n\t\t\t\t *\n\t\t\t\t * If the drag triggers on the `dragHandle` it won't be handled by the\n\t\t\t\t * library.\n\t\t\t\t */\n\t\t\t\tdraggable: false,\n\t\t\t\tonDragStart: noop,\n\t\t\t},\n\t\t\tinnerRef: setElement,\n\t\t}),\n\t\t[contextId, draggableId, draggableDimensions, state, setElement],\n\t);\n\n\tconst snapshot: DraggableStateSnapshot = useDraggableStateSnapshot({\n\t\tdraggingOver: state.draggingOver,\n\t\tisClone: false,\n\t\tisDragging,\n\t\tmode: isDragging ? state.mode : null,\n\t});\n\n\tconst rubric: DraggableRubric = useMemo(\n\t\t() => ({\n\t\t\tdraggableId,\n\t\t\ttype,\n\t\t\tsource: {\n\t\t\t\tdroppableId,\n\t\t\t\tindex,\n\t\t\t},\n\t\t}),\n\t\t[draggableId, droppableId, index, type],\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{isHiding ? null : children(provided, snapshot, rubric)}\n\t\t\t{hasPlaceholder && <Placeholder ref={placeholderRef} />}\n\t\t</>\n\t);\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/draggable/is-event-in-interactive-element.tsx",
    "content": "/**\n * This file is ported almost exactly from `react-beautiful-dnd`.\n *\n * In `react-beautiful-dnd` it is relevant to all drags,\n * but in the migration layer it is only relevant to keyboard drags.\n *\n * This is because now the browser is responsible for determining when a\n * pointer drag can occur.\n */\n\nexport type TagNameMap = {\n\t[tagName: string]: true;\n};\n\nexport const interactiveTagNames: TagNameMap = {\n\tinput: true,\n\tbutton: true,\n\ttextarea: true,\n\tselect: true,\n\toption: true,\n\toptgroup: true,\n\tvideo: true,\n\taudio: true,\n};\n\nexport function isAnInteractiveElement(parent: Element, current: Element | null): boolean {\n\tif (current == null) {\n\t\treturn false;\n\t}\n\n\t// Most interactive elements cannot have children. However, some can such as 'button'.\n\t// See 'Permitted content' on https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button\n\t// Rather than having two different functions we can consolidate our checks into this single\n\t// function to keep things simple.\n\t// There is no harm checking if the parent has an interactive tag name even if it cannot have\n\t// any children. We need to perform this loop anyway to check for the contenteditable attribute\n\tconst hasAnInteractiveTag: boolean = Boolean(interactiveTagNames[current.tagName.toLowerCase()]);\n\n\tif (hasAnInteractiveTag) {\n\t\treturn true;\n\t}\n\n\t// contenteditable=\"true\" or contenteditable=\"\" are valid ways\n\t// of creating a contenteditable container\n\t// https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/contenteditable\n\tconst attribute: string | null = current.getAttribute('contenteditable');\n\tif (attribute === 'true' || attribute === '') {\n\t\treturn true;\n\t}\n\n\t// nothing more can be done and no results found\n\tif (current === parent) {\n\t\treturn false;\n\t}\n\n\t// recursion to check parent\n\treturn isAnInteractiveElement(parent, current.parentElement);\n}\n\nexport default function isEventInInteractiveElement(draggable: Element, event: Event): boolean {\n\tconst target: EventTarget | null = event.target;\n\n\tif (!(target instanceof HTMLElement)) {\n\t\treturn false;\n\t}\n\n\treturn isAnInteractiveElement(draggable, target);\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/draggable/placeholder.tsx",
    "content": "import React, { forwardRef, memo, type Ref, useMemo } from 'react';\n\nimport { useDragDropContext } from '../drag-drop-context/internal-context';\nimport { useDraggableDimensions } from '../hooks/use-captured-dimensions';\nimport { attributes } from '../utils/attributes';\n\nexport const Placeholder = memo(\n\tforwardRef(function Placeholder(\n\t\t{ style: styleProp }: { style?: React.CSSProperties },\n\t\tref: Ref<HTMLDivElement>,\n\t) {\n\t\tconst dimensions = useDraggableDimensions();\n\n\t\tconst { contextId } = useDragDropContext();\n\t\tconst dataAttributes = {\n\t\t\t[attributes.placeholder.contextId]: contextId,\n\t\t};\n\n\t\tconst style: React.CSSProperties | undefined = useMemo(() => {\n\t\t\tif (!dimensions) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { margin, rect } = dimensions;\n\n\t\t\treturn {\n\t\t\t\tboxSizing: 'border-box',\n\t\t\t\twidth: rect.width,\n\t\t\t\theight: rect.height,\n\t\t\t\tmargin: margin,\n\t\t\t\t...styleProp,\n\t\t\t};\n\t\t}, [dimensions, styleProp]);\n\n\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\treturn <div ref={ref} style={style} {...dataAttributes} />;\n\t}),\n);\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/draggable/state.tsx",
    "content": "/**\n * All state for the Draggable in one place.\n *\n * This avoids rerenders (caused by unbatched state updates),\n * but also keeps state logic together.\n */\n\nimport type {\n\tDirection,\n\tDraggableLocation,\n\tDragStart,\n\tDragUpdate,\n\tDroppableId,\n\tMovementMode,\n} from 'react-beautiful-dnd';\n\nimport { isSameLocation } from '../drag-drop-context/draggable-location';\nimport type { DroppableRegistryEntry } from '../drag-drop-context/droppable-registry';\nimport { rbdInvariant } from '../drag-drop-context/rbd-invariant';\nimport { directionMapping } from '../droppable/drop-indicator/constants';\nimport type { DraggableDimensions } from '../hooks/use-captured-dimensions';\nimport type { Action } from '../internal-types';\n\nimport { keyboardPreviewCrossAxisOffset } from './constants';\n\ntype DraggableIdleState = {\n\ttype: 'idle';\n\tdraggingOver: null;\n};\n\nexport type PointerLocation = {\n\tinitial: {\n\t\tinput: { clientX: number; clientY: number };\n\t};\n\tcurrent: {\n\t\tinput: { clientX: number; clientY: number };\n\t};\n};\n\nexport type DraggablePreviewOffset = {\n\tx: number;\n\ty: number;\n};\n\n/**\n * The state of a draggable that is currently being dragged.\n * It does not have a clone.\n */\ntype DraggableDraggingState = {\n\ttype: 'dragging';\n\tdraggingOver: DroppableId | null;\n\tstart: DraggableLocation;\n\tlocation: PointerLocation | null;\n\tdraggableId: string;\n\tmode: MovementMode;\n\tpreviewOffset: DraggablePreviewOffset;\n};\n\n/**\n * The state of a draggable that is currently hiding,\n * because it its clone is being rendered instead.\n */\ntype DraggableHidingState = {\n\ttype: 'hiding';\n\tdraggingOver: null;\n\tmode: MovementMode;\n};\n\nexport type DraggableState = DraggableIdleState | DraggableDraggingState | DraggableHidingState;\n\ntype UpdateKeyboardPayload = {\n\tupdate: DragUpdate;\n\tdraggableDimensions: DraggableDimensions | null;\n\tdroppable: DroppableRegistryEntry | null;\n\tplaceholderRect: DOMRect | null;\n\tdropIndicatorRect: DOMRect | null;\n};\n\nexport type DraggableAction =\n\t| Action<'START_POINTER_DRAG', { start: DragStart }>\n\t| Action<\n\t\t\t'START_KEYBOARD_DRAG',\n\t\t\t{\n\t\t\t\tstart: DragStart;\n\t\t\t\tdraggableDimensions: DraggableDimensions;\n\t\t\t\tdroppable: DroppableRegistryEntry;\n\t\t\t}\n\t  >\n\t/**\n\t * Updates the drag state.\n\t *\n\t * This loosely corresponds to an `onDragUpdate` from `react-beautiful-dnd`.\n\t */\n\t| Action<'UPDATE_DRAG', { update: DragUpdate }>\n\t/**\n\t * Updates the preview based on pointer location\n\t */\n\t| Action<'UPDATE_POINTER_PREVIEW', { pointerLocation: PointerLocation }>\n\t| Action<'UPDATE_KEYBOARD_PREVIEW', UpdateKeyboardPayload>\n\t| Action<'DROP'>\n\t/**\n\t * These events are specifically for draggables that `shouldRenderCloneWhileDragging`.\n\t * They have a distinct hiding state.\n\t */\n\t| Action<'START_HIDING', { mode: MovementMode }>\n\t| Action<'STOP_HIDING'>;\n\nexport const idleState: DraggableIdleState = {\n\ttype: 'idle',\n\tdraggingOver: null,\n};\n\nfunction getHidingState(mode: MovementMode): DraggableHidingState {\n\treturn { type: 'hiding', draggingOver: null, mode };\n}\n\ntype GetKeyboardPreviewOffsetData = {\n\tdraggableDimensions: DraggableDimensions;\n\tdroppable: DroppableRegistryEntry;\n\tplaceholderRect: DOMRect | null;\n\tdropIndicatorRect: DOMRect | null;\n};\n\nconst getKeyboardPreviewOffset = {\n\tinitial({\n\t\tdirection,\n\t}: {\n\t\tdraggableDimensions: DraggableDimensions;\n\t\tdirection: Direction;\n\t}): DraggablePreviewOffset {\n\t\t/**\n\t\t * The initial offset doesn't use a base offset,\n\t\t * as no scrolling should have ocurred yet.\n\t\t */\n\t\tconst { mainAxis, crossAxis } = directionMapping[direction];\n\n\t\treturn {\n\t\t\t/**\n\t\t\t * The drag preview should not be offset on the main axis.\n\t\t\t */\n\t\t\t[mainAxis.name]: 0,\n\t\t\t/**\n\t\t\t * On the cross axis, the drag preview is offset by a fixed percentage\n\t\t\t * of its cross axis length.\n\t\t\t */\n\t\t\t[crossAxis.name]: keyboardPreviewCrossAxisOffset,\n\t\t} as DraggablePreviewOffset;\n\t},\n\thome({\n\t\tdroppable: { direction },\n\t\tplaceholderRect,\n\t\tdraggableDimensions,\n\t}: GetKeyboardPreviewOffsetData) {\n\t\trbdInvariant(placeholderRect, 'the placeholder should exist if in home position');\n\n\t\t/**\n\t\t * This base offset will result in the preview being over the placeholder\n\t\t * (same x and y coordinates).\n\t\t *\n\t\t * Consider this as `currentPosition - initialPosition` to find an offset.\n\t\t *\n\t\t * The `placeholderRect` is the **current** viewport-relative position of the\n\t\t * gap where the draggable originated from.\n\t\t *\n\t\t * The `draggableDimensions.rect` is the **initial** viewport-relative position\n\t\t * of the draggable.\n\t\t */\n\t\tconst baseOffset = {\n\t\t\tx: placeholderRect.x - draggableDimensions.rect.x,\n\t\t\ty: placeholderRect.y - draggableDimensions.rect.y,\n\t\t};\n\n\t\tconst { mainAxis, crossAxis } = directionMapping[direction];\n\n\t\treturn {\n\t\t\t/**\n\t\t\t * The drag preview should not be visibly offset on the main axis.\n\t\t\t */\n\t\t\t[mainAxis.name]: baseOffset[mainAxis.name],\n\t\t\t/**\n\t\t\t * On the cross axis, the drag preview is offset by a fixed percentage\n\t\t\t * of its cross axis length.\n\t\t\t *\n\t\t\t * This is to remain aligned with when it is in the away position.\n\t\t\t */\n\t\t\t[crossAxis.name]: baseOffset[crossAxis.name] + keyboardPreviewCrossAxisOffset,\n\t\t} as DraggablePreviewOffset;\n\t},\n\taway({\n\t\tdroppable: { direction },\n\t\tdropIndicatorRect,\n\t\tdraggableDimensions,\n\t}: GetKeyboardPreviewOffsetData) {\n\t\trbdInvariant(dropIndicatorRect, 'the drop indicator should exist if in away position');\n\n\t\t/**\n\t\t * This base offset will result in the preview being over the drop indicator\n\t\t * (same x and y coordinates).\n\t\t *\n\t\t * Consider this as `currentPosition - initialPosition` to find an offset.\n\t\t *\n\t\t * The `dropIndicatorRect` is the **current** viewport-relative position of the\n\t\t * drop indicator.\n\t\t *\n\t\t * The `draggableDimensions.rect` is the **initial** viewport-relative position\n\t\t * of the draggable.\n\t\t */\n\t\tconst baseOffset = {\n\t\t\tx: dropIndicatorRect.x - draggableDimensions.rect.x,\n\t\t\ty: dropIndicatorRect.y - draggableDimensions.rect.y,\n\t\t};\n\n\t\tconst { mainAxis, crossAxis } = directionMapping[direction];\n\n\t\treturn {\n\t\t\t/**\n\t\t\t * The drop indicator should bisect the preview on its main axis.\n\t\t\t *\n\t\t\t * In other words, the drop indicator should be in the middle.\n\t\t\t */\n\t\t\t[mainAxis.name]:\n\t\t\t\tbaseOffset[mainAxis.name] - 0.5 * draggableDimensions.rect[mainAxis.style.length],\n\t\t\t/**\n\t\t\t * On the cross axis, the drag preview is offset by a fixed percentage\n\t\t\t * of its cross axis length.\n\t\t\t *\n\t\t\t * This allows some of the drop indicator to remain visible.\n\t\t\t */\n\t\t\t[crossAxis.name]: baseOffset[crossAxis.name] + keyboardPreviewCrossAxisOffset,\n\t\t} as DraggablePreviewOffset;\n\t},\n};\n\n/**\n * Determines the offset for the drag preview for keyboard drags.\n *\n * Unlike mouse drags, during which the drag preview follows the cursor,\n * the drag preview will follow the drop indicator for keyboard drags.\n */\nfunction updateKeyboardPreview(\n\tstate: DraggableDraggingState,\n\t{\n\t\tupdate,\n\t\tdroppable,\n\t\tdraggableDimensions,\n\t\tplaceholderRect,\n\t\tdropIndicatorRect,\n\t}: UpdateKeyboardPayload,\n): DraggableDraggingState {\n\tif (!droppable || !draggableDimensions) {\n\t\treturn state;\n\t}\n\n\tconst data = {\n\t\tdroppable,\n\t\tdraggableDimensions,\n\t\tplaceholderRect,\n\t\tdropIndicatorRect,\n\t};\n\n\tconst isHome = isSameLocation(update.source, update.destination ?? null);\n\tconst previewOffset = isHome\n\t\t? getKeyboardPreviewOffset.home(data)\n\t\t: getKeyboardPreviewOffset.away(data);\n\n\tif (!previewOffset) {\n\t\treturn state;\n\t}\n\n\treturn {\n\t\t...state,\n\t\tpreviewOffset,\n\t};\n}\n\nfunction startDrag(\n\tstate: DraggableState,\n\t{ start, previewOffset }: { start: DragStart; previewOffset: DraggablePreviewOffset },\n): DraggableDraggingState {\n\trbdInvariant(state.type === 'idle', 'The draggable is idle.');\n\n\tconst draggingOver = start.source.droppableId;\n\n\tconst nextState: DraggableDraggingState = {\n\t\ttype: 'dragging',\n\t\tdraggingOver,\n\t\tlocation: null,\n\t\tstart: start.source,\n\t\tdraggableId: start.draggableId,\n\t\tmode: start.mode,\n\t\tpreviewOffset,\n\t};\n\n\treturn nextState;\n}\n\nexport function reducer(state: DraggableState, action: DraggableAction): DraggableState {\n\tif (action.type === 'START_POINTER_DRAG') {\n\t\treturn startDrag(state, {\n\t\t\t...action.payload,\n\t\t\tpreviewOffset: { x: 0, y: 0 },\n\t\t});\n\t}\n\n\tif (action.type === 'START_KEYBOARD_DRAG') {\n\t\tconst { draggableDimensions, droppable } = action.payload;\n\t\treturn startDrag(state, {\n\t\t\t...action.payload,\n\t\t\tpreviewOffset: getKeyboardPreviewOffset.initial({\n\t\t\t\tdraggableDimensions,\n\t\t\t\tdirection: droppable.direction,\n\t\t\t}),\n\t\t});\n\t}\n\n\tif (action.type === 'UPDATE_DRAG') {\n\t\trbdInvariant(state.type === 'dragging', 'The draggable is dragging.');\n\n\t\tconst { update } = action.payload;\n\t\tconst draggingOver = update.destination ? update.destination.droppableId : null;\n\n\t\tif (draggingOver === state.draggingOver) {\n\t\t\t// Save on an unnecessary rerender\n\t\t\treturn state;\n\t\t}\n\n\t\tconst nextState: DraggableDraggingState = { ...state, draggingOver };\n\t\treturn nextState;\n\t}\n\n\tif (action.type === 'UPDATE_POINTER_PREVIEW') {\n\t\trbdInvariant(state.type === 'dragging', 'The draggable is dragging.');\n\n\t\tconst { pointerLocation } = action.payload;\n\n\t\tconst nextState = {\n\t\t\t...state,\n\t\t\tpreviewOffset: {\n\t\t\t\tx: pointerLocation.current.input.clientX - pointerLocation.initial.input.clientX,\n\t\t\t\ty: pointerLocation.current.input.clientY - pointerLocation.initial.input.clientY,\n\t\t\t},\n\t\t};\n\n\t\treturn nextState;\n\t}\n\n\tif (action.type === 'UPDATE_KEYBOARD_PREVIEW') {\n\t\trbdInvariant(state.type === 'dragging', 'The draggable is dragging.');\n\t\tif (state.type !== 'dragging') {\n\t\t\treturn state;\n\t\t}\n\t\tconst nextState = updateKeyboardPreview(state, action.payload);\n\t\treturn nextState;\n\t}\n\n\tif (action.type === 'DROP') {\n\t\trbdInvariant(state.type === 'dragging', 'The draggable is dragging.');\n\n\t\treturn idleState;\n\t}\n\n\tif (action.type === 'START_HIDING') {\n\t\trbdInvariant(state.type === 'idle' || state.type === 'hiding');\n\n\t\treturn getHidingState(action.payload.mode);\n\t}\n\n\tif (action.type === 'STOP_HIDING') {\n\t\trbdInvariant(state.type === 'hiding');\n\n\t\treturn idleState;\n\t}\n\n\treturn state;\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/draggable/use-draggable-state-snapshot.tsx",
    "content": "import { useMemo } from 'react';\n\nimport type { DraggableStateSnapshot, DroppableId, MovementMode } from 'react-beautiful-dnd';\n\nexport function useDraggableStateSnapshot({\n\tdraggingOver,\n\tisClone,\n\tisDragging,\n\tmode,\n}: {\n\tdraggingOver: DroppableId | null;\n\tisClone: boolean;\n\tisDragging: boolean;\n\tmode: MovementMode | null;\n}): DraggableStateSnapshot {\n\treturn useMemo(\n\t\t() => ({\n\t\t\tisClone,\n\t\t\tisDragging,\n\t\t\tdraggingOver,\n\t\t\tmode,\n\t\t\t/**\n\t\t\t * The properties below are fixed in the migration layer,\n\t\t\t * because they are not supported.\n\t\t\t *\n\t\t\t * Animation and combination were intentionally removed.\n\t\t\t */\n\t\t\tisDropAnimating: false,\n\t\t\tdropAnimation: null,\n\t\t\tcombineWith: null,\n\t\t\tcombineTargetFor: null,\n\t\t}),\n\t\t[draggingOver, isClone, isDragging, mode],\n\t);\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/droppable/data.tsx",
    "content": "import { useMemo } from 'react';\n\nimport type { DroppableId } from 'react-beautiful-dnd';\n\n/**\n * Private symbol that is intentionally not exported from this file.\n */\nconst privateKey = Symbol('DroppableData');\n\n/**\n * Data that is attached to drags.\n */\nexport type DroppableData = {\n\t/**\n\t * Indicates this data is for a `<Droppable>` instance.\n\t */\n\t[privateKey]: true;\n\n\t/**\n\t * The `droppableId` of the `<Droppable>` instance.\n\t */\n\tdroppableId: DroppableId;\n\n\t/**\n\t * Lazily returns whether the droppable is disabled.\n\t */\n\tgetIsDropDisabled(): boolean;\n\n\tcontextId: string;\n};\n\n/**\n * Checks if the passed data satisfies `DroppableData` using the private symbol.\n */\nexport function isDroppableData(data: Record<string | symbol, unknown>): data is DroppableData {\n\treturn data[privateKey] === true;\n}\n\n/**\n * Adds the private symbol to the passed data.\n *\n * The symbol allows us to quickly check if an object satisfies `DroppableData`.\n */\nexport function useDroppableData({\n\tcontextId,\n\tdroppableId,\n\tgetIsDropDisabled,\n}: Omit<DroppableData, symbol>): DroppableData {\n\treturn useMemo(() => {\n\t\treturn {\n\t\t\t[privateKey]: true,\n\t\t\tcontextId,\n\t\t\tdroppableId,\n\t\t\tgetIsDropDisabled,\n\t\t};\n\t}, [contextId, droppableId, getIsDropDisabled]);\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/droppable/draggable-clone.tsx",
    "content": "import React, { useCallback, useEffect, useMemo, useReducer } from 'react';\n\nimport type {\n\tDraggableChildrenFn,\n\tDraggableProvided,\n\tDraggableRubric,\n\tDraggableStateSnapshot,\n\tDraggingStyle,\n\tDroppableId,\n\tMovementMode,\n\tNotDraggingStyle,\n} from 'react-beautiful-dnd';\nimport { createPortal } from 'react-dom';\n\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { monitorForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nimport { getHiddenTextElementId } from '../drag-drop-context/hooks/use-hidden-text-element';\nimport { useDragDropContext } from '../drag-drop-context/internal-context';\nimport { useMonitorForLifecycle } from '../drag-drop-context/lifecycle-context';\nimport { rbdInvariant } from '../drag-drop-context/rbd-invariant';\nimport { isDraggableData } from '../draggable/data';\nimport { getDraggableProvidedStyle } from '../draggable/get-draggable-provided-style';\nimport { idleState, reducer } from '../draggable/state';\nimport { useDraggableStateSnapshot } from '../draggable/use-draggable-state-snapshot';\nimport { useDraggableDimensions } from '../hooks/use-captured-dimensions';\nimport { attributes } from '../utils/attributes';\nimport { findDragHandle } from '../utils/find-drag-handle';\nimport { findDropIndicator } from '../utils/find-drop-indicator';\nimport { findPlaceholder } from '../utils/find-placeholder';\n\nfunction getBody() {\n\treturn document.body;\n}\n\n/**\n * Calls the `renderClone` function.\n *\n * Only rendered during drags.\n */\nfunction DraggableCloneInner({\n\tchildren,\n\tdroppableId,\n\ttype,\n\tdraggableId,\n\tindex,\n\tdraggingOver,\n\tstyle,\n\t/**\n\t * Defaults to `document.body`\n\t */\n\tgetContainerForClone = getBody,\n\tmode,\n}: {\n\tchildren: DraggableChildrenFn;\n\tdroppableId: DroppableId;\n\ttype: string;\n\tdraggableId: string;\n\tindex: number;\n\tdraggingOver: DroppableId | null;\n\tstyle: DraggingStyle | NotDraggingStyle;\n\tgetContainerForClone?: () => HTMLElement;\n\tmode: MovementMode;\n}) {\n\tconst { contextId } = useDragDropContext();\n\n\t/**\n\t * The handle should maintain focus during a drag,\n\t * if it had focus before the drag started.\n\t */\n\tconst focusDragHandle = useCallback(\n\t\t(element: HTMLElement | null) => {\n\t\t\tif (!element) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst dragHandle = findDragHandle({ contextId, draggableId });\n\t\t\tdragHandle?.focus();\n\t\t},\n\t\t[contextId, draggableId],\n\t);\n\n\tconst provided: DraggableProvided = useMemo(() => {\n\t\treturn {\n\t\t\tinnerRef: focusDragHandle,\n\t\t\tdraggableProps: {\n\t\t\t\t[attributes.draggable.contextId]: contextId,\n\t\t\t\t[attributes.draggable.id]: draggableId,\n\t\t\t\tstyle,\n\t\t\t},\n\t\t\tdragHandleProps: {\n\t\t\t\trole: 'button',\n\t\t\t\t'aria-describedby': getHiddenTextElementId(contextId),\n\t\t\t\t[attributes.dragHandle.contextId]: contextId,\n\t\t\t\t[attributes.dragHandle.draggableId]: draggableId,\n\t\t\t\ttabIndex: 0,\n\t\t\t\t/**\n\t\t\t\t * This must be `false` for drags to trigger on the draggable `element`,\n\t\t\t\t * which may be a parent, and not on the `dragHandle`.\n\t\t\t\t *\n\t\t\t\t * If the drag triggers on the `dragHandle` it won't be handled by the\n\t\t\t\t * library.\n\t\t\t\t */\n\t\t\t\tdraggable: false,\n\t\t\t\tonDragStart: () => {},\n\t\t\t},\n\t\t};\n\t}, [contextId, draggableId, focusDragHandle, style]);\n\n\tconst snapshot: DraggableStateSnapshot = useDraggableStateSnapshot({\n\t\tdraggingOver,\n\t\tisClone: true,\n\t\tisDragging: true,\n\t\tmode,\n\t});\n\n\tconst rubric: DraggableRubric = useMemo(() => {\n\t\treturn {\n\t\t\tdraggableId,\n\t\t\ttype,\n\t\t\tsource: {\n\t\t\t\tdroppableId,\n\t\t\t\tindex,\n\t\t\t},\n\t\t};\n\t}, [draggableId, droppableId, index, type]);\n\n\treturn createPortal(children(provided, snapshot, rubric), getContainerForClone());\n}\n\n/**\n * Wrapper that is always rendered if there is a `renderClone` function.\n *\n * It sets up a monitor, and needs to observe the entire lifecycle.\n */\nexport function DraggableClone({\n\tchildren,\n\tdroppableId,\n\ttype,\n\tgetContainerForClone,\n}: {\n\tchildren: DraggableChildrenFn;\n\tdroppableId: DroppableId;\n\ttype: string;\n\tgetContainerForClone?: () => HTMLElement;\n}): React.JSX.Element | null {\n\tconst { contextId, getDragState } = useDragDropContext();\n\n\tconst draggableDimensions = useDraggableDimensions();\n\n\tconst [state, dispatch] = useReducer(reducer, idleState);\n\n\tconst monitorForLifecycle = useMonitorForLifecycle();\n\n\tuseEffect(() => {\n\t\treturn combine(\n\t\t\tmonitorForLifecycle({\n\t\t\t\tonPendingDragStart({ start, droppable }) {\n\t\t\t\t\tif (droppableId !== start.source.droppableId) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (start.mode === 'FLUID') {\n\t\t\t\t\t\treturn dispatch({\n\t\t\t\t\t\t\ttype: 'START_POINTER_DRAG',\n\t\t\t\t\t\t\tpayload: { start },\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tif (start.mode === 'SNAP') {\n\t\t\t\t\t\tconst dragState = getDragState();\n\t\t\t\t\t\trbdInvariant(dragState.isDragging && dragState.draggableDimensions);\n\t\t\t\t\t\treturn dispatch({\n\t\t\t\t\t\t\ttype: 'START_KEYBOARD_DRAG',\n\t\t\t\t\t\t\tpayload: {\n\t\t\t\t\t\t\t\tstart,\n\t\t\t\t\t\t\t\tdraggableDimensions: dragState.draggableDimensions,\n\t\t\t\t\t\t\t\tdroppable,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonPendingDragUpdate({ update, droppable }) {\n\t\t\t\t\tif (state.type !== 'dragging') {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (state.draggableId !== update.draggableId) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tdispatch({\n\t\t\t\t\t\ttype: 'UPDATE_DRAG',\n\t\t\t\t\t\tpayload: { update },\n\t\t\t\t\t});\n\n\t\t\t\t\tif (update.mode === 'SNAP') {\n\t\t\t\t\t\t/**\n\t\t\t\t\t\t * Updating the position in a microtask to resolve timing issues.\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * When doing cross-axis dragging, the drop indicator in the new\n\t\t\t\t\t\t * droppable will mount and update in a `onPendingDragUpdate` too.\n\t\t\t\t\t\t *\n\t\t\t\t\t\t * The microtask ensures that the indicator will have updated by\n\t\t\t\t\t\t * the time this runs, so the preview will have the correct\n\t\t\t\t\t\t * location of the indicator.\n\t\t\t\t\t\t */\n\t\t\t\t\t\tqueueMicrotask(() => {\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * Because this update occurs in a microtask, we need to check\n\t\t\t\t\t\t\t * that the drag is still happening.\n\t\t\t\t\t\t\t *\n\t\t\t\t\t\t\t * If it has ended we should not try to update the preview.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tconst dragState = getDragState();\n\t\t\t\t\t\t\tif (!dragState.isDragging) {\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * The placeholder might not exist if its associated\n\t\t\t\t\t\t\t * draggable unmounts in a virtual list.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tconst placeholder = findPlaceholder(contextId);\n\t\t\t\t\t\t\tconst placeholderRect = placeholder ? placeholder.getBoundingClientRect() : null;\n\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * The drop indicator might not exist if the current target\n\t\t\t\t\t\t\t * is null\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tconst dropIndicator = findDropIndicator();\n\t\t\t\t\t\t\tconst dropIndicatorRect = dropIndicator\n\t\t\t\t\t\t\t\t? dropIndicator.getBoundingClientRect()\n\t\t\t\t\t\t\t\t: null;\n\n\t\t\t\t\t\t\tdispatch({\n\t\t\t\t\t\t\t\ttype: 'UPDATE_KEYBOARD_PREVIEW',\n\t\t\t\t\t\t\t\tpayload: {\n\t\t\t\t\t\t\t\t\tupdate,\n\t\t\t\t\t\t\t\t\tdraggableDimensions,\n\t\t\t\t\t\t\t\t\tdroppable,\n\t\t\t\t\t\t\t\t\tplaceholderRect,\n\t\t\t\t\t\t\t\t\tdropIndicatorRect,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tonBeforeDragEnd({ draggableId }) {\n\t\t\t\t\tif (state.type !== 'dragging') {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (draggableId !== state.draggableId) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tdispatch({ type: 'DROP' });\n\t\t\t\t},\n\t\t\t}),\n\t\t\tmonitorForElements({\n\t\t\t\tcanMonitor({ source }) {\n\t\t\t\t\tif (!isDraggableData(source.data)) {\n\t\t\t\t\t\t// not dragging something from the migration layer\n\t\t\t\t\t\t// we should not monitor it\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn source.data.contextId === contextId && source.data.droppableId === droppableId;\n\t\t\t\t},\n\t\t\t\tonDrag({ location }) {\n\t\t\t\t\tdispatch({\n\t\t\t\t\t\ttype: 'UPDATE_POINTER_PREVIEW',\n\t\t\t\t\t\tpayload: { pointerLocation: location },\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [droppableId, contextId, monitorForLifecycle, state, draggableDimensions, getDragState]);\n\n\tif (state.type !== 'dragging') {\n\t\treturn null;\n\t}\n\n\tconst style = getDraggableProvidedStyle({\n\t\tdraggableDimensions,\n\t\tdraggableState: state,\n\t});\n\n\treturn (\n\t\t<DraggableCloneInner\n\t\t\tdroppableId={droppableId}\n\t\t\ttype={type}\n\t\t\tdraggableId={state.draggableId}\n\t\t\tindex={state.start.index}\n\t\t\tdraggingOver={state.draggingOver}\n\t\t\tmode={state.mode}\n\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\tstyle={style}\n\t\t\tgetContainerForClone={getContainerForClone}\n\t\t>\n\t\t\t{children}\n\t\t</DraggableCloneInner>\n\t);\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/droppable/drop-indicator/constants.tsx",
    "content": "/**\n * Maps directions to different JS/CSS properties.\n *\n * Allows logic which changes with the direction to be written only once.\n */\nexport const directionMapping = {\n\tvertical: {\n\t\tmainAxis: {\n\t\t\tname: 'y',\n\t\t\toffset: 'offsetTop',\n\t\t\tlength: 'offsetHeight',\n\t\t\tscrollOffset: 'scrollTop',\n\t\t\tforwardEdge: 'bottom',\n\t\t\toverflow: 'overflowY',\n\t\t\tstyle: {\n\t\t\t\tlength: 'height',\n\t\t\t\ttransform: 'translateY',\n\t\t\t},\n\t\t},\n\t\tcrossAxis: {\n\t\t\tname: 'x',\n\t\t\toffset: 'offsetLeft',\n\t\t\tlength: 'offsetWidth',\n\t\t\tstyle: {\n\t\t\t\tlength: 'width',\n\t\t\t\toffset: 'left',\n\t\t\t},\n\t\t},\n\t},\n\thorizontal: {\n\t\tmainAxis: {\n\t\t\tname: 'x',\n\t\t\toffset: 'offsetLeft',\n\t\t\tlength: 'offsetWidth',\n\t\t\tscrollOffset: 'scrollLeft',\n\t\t\tforwardEdge: 'right',\n\t\t\toverflow: 'overflowX',\n\t\t\tstyle: {\n\t\t\t\tlength: 'width',\n\t\t\t\ttransform: 'translateX',\n\t\t\t},\n\t\t},\n\t\tcrossAxis: {\n\t\t\tname: 'y',\n\t\t\toffset: 'offsetTop',\n\t\t\tlength: 'offsetHeight',\n\t\t\tstyle: {\n\t\t\t\tlength: 'height',\n\t\t\t\toffset: 'top',\n\t\t\t},\n\t\t},\n\t},\n} as const;\n\n/**\n * The thickness of the drop indicator line, in pixels.\n */\nexport const lineThickness = 2;\n\n/**\n * The distance to pull the line back by, to account for its thickness.\n */\nexport const lineOffset = lineThickness / 2;\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/droppable/drop-indicator/get-dimensions.tsx",
    "content": "import type { Direction, DraggableLocation, DroppableId, DroppableMode } from 'react-beautiful-dnd';\n\nimport { attributes } from '../../utils/attributes';\nimport { findClosestScrollContainer } from '../../utils/find-closest-scroll-container';\nimport { getElement } from '../../utils/find-element';\nimport { findPlaceholder } from '../../utils/find-placeholder';\nimport { getClosestPositionedElement } from '../../utils/get-closest-positioned-element';\nimport { getElementByDraggableLocation } from '../../utils/get-element-by-draggable-location';\nimport { getGapOffset } from '../gap';\n\nimport { directionMapping, lineOffset } from './constants';\nimport type { IndicatorSizeAndOffset } from './types';\n\n/**\n * Returns the dimensions for a drop indicator either before or after a\n * draggable.\n *\n * `isForwardEdge` determines whether it is before or after.\n */\nfunction measureDraggable({\n\telement,\n\tisForwardEdge,\n\tmode,\n\tdirection,\n\tcontextId,\n}: {\n\telement: HTMLElement;\n\tisForwardEdge: boolean;\n\tmode: DroppableMode;\n\tdirection: Direction;\n\tcontextId: string;\n}) {\n\tconst { mainAxis, crossAxis } = directionMapping[direction];\n\n\tconst offsetElement = getClosestPositionedElement({ element, mode });\n\n\tconst gapOffset = getGapOffset({\n\t\telement,\n\t\twhere: isForwardEdge ? 'after' : 'before',\n\t\tdirection,\n\t\tcontextId,\n\t});\n\n\tconst baseOffset = offsetElement[mainAxis.offset] - lineOffset;\n\tconst mainAxisOffset = isForwardEdge ? baseOffset + element[mainAxis.length] : baseOffset;\n\n\treturn {\n\t\tmainAxis: {\n\t\t\toffset: mainAxisOffset + gapOffset,\n\t\t},\n\t\tcrossAxis: {\n\t\t\toffset: offsetElement[crossAxis.offset],\n\t\t\tlength: offsetElement[crossAxis.length],\n\t\t},\n\t};\n}\n\n/**\n * This will return an indicator size and offset corresponding to a line\n * through the middle of the placeholder.\n *\n * The reason this is a special case, instead of just falling back to the\n * standard positioning logic, is to avoid measuring the drag preview.\n */\nfunction measurePlaceholder({\n\telement,\n\tdirection,\n}: {\n\telement: HTMLElement;\n\tdirection: Direction;\n}) {\n\tconst { mainAxis, crossAxis } = directionMapping[direction];\n\n\t/**\n\t * This function measures against the `element` directly instead of an\n\t * `offsetElement` because:\n\t * - For standard lists, that is already the behavior.\n\t * - For virtual lists, we know that the `element` is being absolutely\n\t *   positioned (and not an ancestor).\n\t */\n\tconst baseOffset = element[mainAxis.offset] - lineOffset;\n\tconst mainAxisOffset = baseOffset + element[mainAxis.length] / 2;\n\n\treturn {\n\t\tmainAxis: {\n\t\t\toffset: mainAxisOffset,\n\t\t},\n\t\tcrossAxis: {\n\t\t\toffset: element[crossAxis.offset],\n\t\t\tlength: element[crossAxis.length],\n\t\t},\n\t};\n}\n\nfunction getDroppableOffset({\n\telement,\n\tdirection,\n}: {\n\telement: HTMLElement;\n\tdirection: Direction;\n}) {\n\tconst { mainAxis } = directionMapping[direction];\n\n\tconst scrollContainer = findClosestScrollContainer(element);\n\tif (!scrollContainer) {\n\t\treturn 0;\n\t}\n\n\t/**\n\t * If the scroll container has static positioning,\n\t * then we need to add the scroll container's offset as well.\n\t */\n\tconst { position } = getComputedStyle(scrollContainer);\n\tif (position !== 'static') {\n\t\treturn 0;\n\t}\n\n\treturn scrollContainer[mainAxis.offset];\n}\n\n/**\n * Returns the dimensions for a drop indicator in an empty list.\n */\nfunction measureDroppable({\n\tdroppableId,\n\tdirection,\n}: {\n\tdroppableId: DroppableId;\n\tdirection: Direction;\n}) {\n\tconst element = getElement({\n\t\tattribute: attributes.droppable.id,\n\t\tvalue: droppableId,\n\t});\n\tconst mainAxisOffset = getDroppableOffset({ element, direction });\n\n\treturn {\n\t\tmainAxis: {\n\t\t\toffset: mainAxisOffset,\n\t\t},\n\t\tcrossAxis: {\n\t\t\toffset: 0,\n\t\t\tlength: '100%',\n\t\t},\n\t};\n}\n\nexport function getIndicatorSizeAndOffset({\n\ttargetLocation,\n\tisInHomeLocation,\n\tdirection,\n\tmode,\n\tcontextId,\n}: {\n\ttargetLocation: DraggableLocation;\n\tisInHomeLocation: boolean;\n\tdirection: Direction;\n\tmode: DroppableMode;\n\tcontextId: string;\n}): IndicatorSizeAndOffset | null {\n\tif (isInHomeLocation) {\n\t\t/**\n\t\t * If we are in the home location (source === destination) then the\n\t\t * indicator is centered in the placeholder.\n\t\t *\n\t\t * It isn't visible, but is used to scroll to.\n\t\t *\n\t\t * This is a special case, because the standard logic will not work\n\t\t * correctly when measuring the drag preview,\n\t\t * which occurs when in the home location.\n\t\t *\n\t\t * This is because the drag preview:\n\t\t *\n\t\t * 1. Has `position: fixed; top: 0; left: 0;` so its `offsetTop` and `offsetLeft`\n\t\t *    will always be `0`, which result in the indicator being at the start of the list.\n\t\t * 2. Is in the wrong location anyway.\n\t\t *\n\t\t * `measurePlaceholder()` is specifically designed for this case.\n\t\t */\n\n\t\tconst element = findPlaceholder(contextId);\n\t\tif (!element) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn measurePlaceholder({ element, direction });\n\t}\n\n\tif (targetLocation.index === 0) {\n\t\t/**\n\t\t * If the target is the 0th index, there are two situations:\n\t\t *\n\t\t * 1. Targeting an empty list\n\t\t * 2. Targeting before the first item in the list\n\t\t */\n\n\t\tconst element = getElementByDraggableLocation(contextId, targetLocation);\n\t\tif (!element) {\n\t\t\t/**\n\t\t\t * If there's no element in the location, it is because the list is empty.\n\t\t\t * In this case, we measure the droppable itself to draw the indicator.\n\t\t\t */\n\t\t\treturn measureDroppable({\n\t\t\t\tdroppableId: targetLocation.droppableId,\n\t\t\t\tdirection,\n\t\t\t});\n\t\t}\n\n\t\t/**\n\t\t * Otherwise, there is a reference element we can use to measure.\n\t\t */\n\t\treturn measureDraggable({\n\t\t\telement,\n\t\t\t// `false` because the line is before the item\n\t\t\tisForwardEdge: false,\n\t\t\tmode,\n\t\t\tdirection,\n\t\t\tcontextId,\n\t\t});\n\t}\n\n\t/**\n\t * Otherwise, for any other index, we can measure the draggable above where\n\t * we would be dropping.\n\t */\n\n\tconst element = getElementByDraggableLocation(contextId, {\n\t\tdroppableId: targetLocation.droppableId,\n\t\t// subtracting one because it is the draggable above\n\t\tindex: targetLocation.index - 1,\n\t});\n\n\tif (!element) {\n\t\treturn null;\n\t}\n\n\treturn measureDraggable({\n\t\telement,\n\t\t// `true` because the line is after the item\n\t\tisForwardEdge: true,\n\t\tmode,\n\t\tdirection,\n\t\tcontextId,\n\t});\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/droppable/drop-indicator/index.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport React, { useCallback, useLayoutEffect, useRef, useState } from 'react';\n\n// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766\nimport { css, jsx, type SerializedStyles } from '@emotion/react';\nimport type { Direction, DraggableLocation, DroppableMode } from 'react-beautiful-dnd';\n\nimport { token } from '@atlaskit/tokens';\n\nimport { isSameLocation } from '../../drag-drop-context/draggable-location';\nimport { getActualDestination } from '../../drag-drop-context/get-destination';\nimport { useDragDropContext } from '../../drag-drop-context/internal-context';\nimport { useMonitorForLifecycle } from '../../drag-drop-context/lifecycle-context';\nimport { rbdInvariant } from '../../drag-drop-context/rbd-invariant';\nimport { customAttributes } from '../../utils/attributes';\n\nimport { directionMapping, lineOffset, lineThickness } from './constants';\nimport { getIndicatorSizeAndOffset } from './get-dimensions';\nimport type { IndicatorSizeAndOffset } from './types';\n\ntype DropIndicatorProps = {\n\tdirection: Direction;\n\tmode: DroppableMode;\n};\n\nconst scrollMarginTop = lineThickness + 2 * lineOffset;\n\nconst baseStyles = css({\n\tbackground: token('color.border.brand'),\n\t/**\n\t * Ensures that when the indicator is scrolled into view there is visual\n\t * space around it.\n\t *\n\t * Otherwise it will hug the edge of the container and be hard to see.\n\t */\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766\n\tscrollMarginTop,\n\t/**\n\t * The bottom margin needs to be slightly bigger for the gap to look\n\t * the same visually.\n\t *\n\t * It's unclear why, this was found through testing.\n\t */\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\tscrollMarginBottom: scrollMarginTop + lineOffset,\n});\n\n/**\n * For virtual lists, the indicator might not be a sibling of the contents.\n * This can lead to issues like wrapping.\n *\n * This style 'resets' it so that there is a consistent initial position.\n */\nconst virtualStyles = css({ position: 'absolute', top: 0, left: 0 });\n\n/**\n * When targeting the source location, we hide the drop indicator.\n * But it should still be scrolled to, so we only want to hide it visually,\n * instead of not rendering it.\n */\nconst visuallyHiddenStyles = css({ opacity: 0 });\n\nconst directionStyles: Record<Direction, SerializedStyles> = {\n\thorizontal: css({\n\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766\n\t\twidth: lineThickness,\n\t\theight: '100%',\n\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\t\tmarginLeft: -lineThickness,\n\t}),\n\tvertical: css({\n\t\twidth: '100%',\n\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766\n\t\theight: lineThickness,\n\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766\n\t\tmarginTop: -lineThickness,\n\t}),\n};\n\nfunction getDynamicStyles({\n\tdirection,\n\tdimensions,\n\tindicatorOffset,\n}: {\n\tdirection: Direction;\n\tdimensions: IndicatorSizeAndOffset | null;\n\tindicatorOffset: number;\n}): React.CSSProperties {\n\tif (dimensions === null) {\n\t\t/**\n\t\t * We hide the indicator initially until dimensions can be taken.\n\t\t */\n\t\treturn { opacity: 0 };\n\t}\n\n\tconst { mainAxis, crossAxis } = directionMapping[direction];\n\n\treturn {\n\t\ttransform: `${mainAxis.style.transform}(${dimensions.mainAxis.offset - indicatorOffset}px)`,\n\t\t[crossAxis.style.length]: dimensions.crossAxis.length,\n\t\t[crossAxis.style.offset]: dimensions.crossAxis.offset,\n\t};\n}\n\nconst dropIndicatorData = {\n\t[customAttributes.dropIndicator]: '',\n};\n\nexport const DropIndicator = ({ direction, mode }: DropIndicatorProps): React.JSX.Element => {\n\tconst { contextId, getDragState } = useDragDropContext();\n\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tconst [dimensions, setDimensions] = useState<IndicatorSizeAndOffset | null>(null);\n\tconst [isHidden, setIsHidden] = useState(false);\n\n\tconst monitorForLifecycle = useMonitorForLifecycle();\n\n\tconst updateIndicator = useCallback(\n\t\t({\n\t\t\ttargetLocation,\n\t\t\tsource,\n\t\t\tdestination,\n\t\t}: {\n\t\t\ttargetLocation: DraggableLocation | null;\n\t\t\tsource: DraggableLocation;\n\t\t\tdestination: DraggableLocation | null;\n\t\t}) => {\n\t\t\tif (!targetLocation) {\n\t\t\t\treturn setDimensions(null);\n\t\t\t}\n\n\t\t\tconst isInHomeLocation = isSameLocation(source, destination);\n\n\t\t\t/**\n\t\t\t * Determines if the drop indicator should be hidden.\n\t\t\t *\n\t\t\t * This is desired when the current drop target would not change the position\n\t\t\t * of the draggable.\n\t\t\t */\n\t\t\tsetIsHidden(isInHomeLocation);\n\n\t\t\treturn setDimensions(\n\t\t\t\tgetIndicatorSizeAndOffset({\n\t\t\t\t\ttargetLocation,\n\t\t\t\t\tisInHomeLocation,\n\t\t\t\t\tdirection,\n\t\t\t\t\tmode,\n\t\t\t\t\tcontextId,\n\t\t\t\t}),\n\t\t\t);\n\t\t},\n\t\t[contextId, direction, mode],\n\t);\n\n\t/**\n\t * This is in a `useLayoutEffect` for immediacy.\n\t *\n\t * When mounting (cross-axis movement) the indicator should update into\n\t * its correct position right away, so that the drag preview can be placed\n\t * correctly.\n\t */\n\tuseLayoutEffect(() => {\n\t\tconst dragState = getDragState();\n\t\tif (!dragState.isDragging) {\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * If the indicator is only just mounting then it needs an immediate\n\t\t * update to have it appear in the correct position.\n\t\t */\n\t\tconst { targetLocation, sourceLocation } = dragState;\n\t\tconst destination = getActualDestination({\n\t\t\tstart: sourceLocation,\n\t\t\ttarget: targetLocation,\n\t\t});\n\t\tupdateIndicator({ targetLocation, destination, source: sourceLocation });\n\n\t\treturn monitorForLifecycle({\n\t\t\tonPrePendingDragUpdate({ update, targetLocation }) {\n\t\t\t\tconst { destination = null, source } = update;\n\n\t\t\t\tupdateIndicator({ targetLocation, source, destination });\n\t\t\t},\n\t\t});\n\t}, [contextId, direction, getDragState, mode, monitorForLifecycle, updateIndicator]);\n\n\t/**\n\t * Scroll the indicator into view.\n\t *\n\t * This is in a `useLayoutEffect` for immediacy.\n\t * Otherwise the keyboard drag preview can appear in the wrong (old) location.\n\t */\n\tuseLayoutEffect(() => {\n\t\tif (dimensions === null) {\n\t\t\treturn;\n\t\t}\n\n\t\t/**\n\t\t * If we are doing a mouse drag,\n\t\t * then we don't want to scroll to the indicator.\n\t\t *\n\t\t * Otherwise, it will conflict with the auto-scroll addon.\n\t\t */\n\t\tconst dragState = getDragState();\n\t\tif (!dragState.isDragging || dragState.mode !== 'SNAP') {\n\t\t\treturn;\n\t\t}\n\n\t\tconst element = ref.current;\n\t\trbdInvariant(element instanceof HTMLElement);\n\n\t\telement.scrollIntoView({ block: 'nearest' });\n\t}, [dimensions, getDragState]);\n\n\tconst { mainAxis } = directionMapping[direction];\n\tconst indicatorOffset = ref.current ? ref.current[mainAxis.offset] : 0;\n\tconst dynamicStyles = getDynamicStyles({\n\t\tdirection,\n\t\tdimensions,\n\t\tindicatorOffset,\n\t});\n\n\tconst isVirtual = mode === 'virtual';\n\n\treturn (\n\t\t<div\n\t\t\tref={ref}\n\t\t\tcss={[\n\t\t\t\tbaseStyles,\n\t\t\t\tdirectionStyles[direction],\n\t\t\t\tisVirtual && virtualStyles,\n\t\t\t\tisHidden && visuallyHiddenStyles,\n\t\t\t]}\n\t\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\t\t\tstyle={dynamicStyles}\n\t\t\t{...dropIndicatorData}\n\t\t/>\n\t);\n};\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/droppable/drop-indicator/types.tsx",
    "content": "export type IndicatorSizeAndOffset = {\n\tmainAxis: {\n\t\toffset: number;\n\t};\n\tcrossAxis: {\n\t\toffset: number;\n\t\tlength: number | string;\n\t};\n};\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/droppable/droppable-context.tsx",
    "content": "import { createContext, useContext } from 'react';\n\nimport type { Direction, DroppableMode } from 'react-beautiful-dnd';\n\nimport { rbdInvariant } from '../drag-drop-context/rbd-invariant';\n\nexport type DroppableContextProps = {\n\tdirection: Direction;\n\tdroppableId: string;\n\tshouldRenderCloneWhileDragging: boolean;\n\tisDropDisabled: boolean;\n\ttype: string;\n\tmode: DroppableMode;\n};\n\nconst DroppableContext = createContext<DroppableContextProps | null>(null);\n\nexport const DroppableContextProvider = DroppableContext.Provider;\n\n/**\n * Intended for use by `<Draggable>` instances.\n */\nexport function useDroppableContext() {\n\tconst value = useContext(DroppableContext);\n\trbdInvariant(value, 'Missing <Droppable /> parent');\n\n\treturn value;\n}\n\n/**\n * Returns the `droppableId` of the parent droppable, if there is one.\n *\n * Intended for use only by `<Droppable>` instances.\n */\nexport function useParentDroppableId() {\n\tconst parentDroppable = useContext(DroppableContext);\n\tif (!parentDroppable) {\n\t\treturn null;\n\t}\n\n\treturn parentDroppable.droppableId;\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/droppable/gap/get-distance.tsx",
    "content": "import type { Direction } from 'react-beautiful-dnd';\n\nconst directionMapping = {\n\thorizontal: {\n\t\trect: {\n\t\t\tstart: 'left',\n\t\t\tend: 'right',\n\t\t},\n\t},\n\tvertical: {\n\t\trect: {\n\t\t\tstart: 'top',\n\t\t\tend: 'bottom',\n\t\t},\n\t},\n} as const;\n\n/**\n * Computes the distance between two `DOMRect` instances.\n *\n * This is the shortest distance from the end of one to the start of the next.\n */\nexport function getDistance({\n\ta,\n\tb,\n\tdirection,\n}: {\n\ta: DOMRect;\n\tb: DOMRect;\n\tdirection: Direction;\n}): number {\n\tconst { rect } = directionMapping[direction];\n\n\treturn Math.max(a[rect.start], b[rect.start]) - Math.min(a[rect.end], b[rect.end]);\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/droppable/gap/index.tsx",
    "content": "import type { Direction } from 'react-beautiful-dnd';\n\nimport { rbdInvariant } from '../../drag-drop-context/rbd-invariant';\nimport { customAttributes, getAttribute } from '../../utils/attributes';\nimport { getElementByDraggableLocation } from '../../utils/get-element-by-draggable-location';\n\nimport { getDistance } from './get-distance';\n\nfunction getDroppableId(element: HTMLElement) {\n\treturn getAttribute(element, customAttributes.draggable.droppableId);\n}\n\nfunction getIndex(element: HTMLElement): number {\n\tconst value = getAttribute(element, customAttributes.draggable.index);\n\tconst index = parseInt(value);\n\trbdInvariant(Number.isInteger(index), `invalid index: '${index}' is not an integer`);\n\treturn index;\n}\n\n/**\n * ASSUMPTIONS:\n * - Adjacent `<Draggable>` items are visually adjacent.\n * - If there is an adjacent element, it is rendered.\n */\nexport function calculateGap({\n\telement,\n\twhere,\n\tdirection,\n\tcontextId,\n}: {\n\telement: HTMLElement;\n\twhere: 'before' | 'after';\n\tdirection: Direction;\n\tcontextId: string;\n}): number {\n\tconst droppableId = getDroppableId(element);\n\tconst index = getIndex(element);\n\n\tconst indexBefore = index - 1;\n\tconst indexAfter = index + 1;\n\n\tconst isBefore = where === 'before';\n\n\tconst adjacentElement = getElementByDraggableLocation(contextId, {\n\t\tdroppableId,\n\t\tindex: isBefore ? indexBefore : indexAfter,\n\t});\n\n\tif (adjacentElement === null) {\n\t\t/**\n\t\t * If there is no adjacent element, we can guess based on margins.\n\t\t */\n\t\tconst { marginTop, marginRight, marginBottom, marginLeft } = getComputedStyle(element);\n\n\t\tif (direction === 'horizontal') {\n\t\t\treturn parseFloat(marginLeft) + parseFloat(marginRight);\n\t\t}\n\n\t\treturn parseFloat(marginTop) + parseFloat(marginBottom);\n\t}\n\n\tconst distance = getDistance({\n\t\tdirection,\n\t\ta: element.getBoundingClientRect(),\n\t\tb: adjacentElement.getBoundingClientRect(),\n\t});\n\n\treturn distance;\n}\n\nexport function getGapOffset({\n\telement,\n\twhere,\n\tdirection,\n\tcontextId,\n}: {\n\telement: HTMLElement;\n\twhere: 'before' | 'after';\n\tdirection: Direction;\n\tcontextId: string;\n}): number {\n\tconst gap = calculateGap({\n\t\telement,\n\t\twhere,\n\t\tdirection,\n\t\tcontextId,\n\t});\n\n\tif (where === 'before') {\n\t\treturn -gap / 2;\n\t}\n\n\treturn gap / 2;\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/droppable/index.tsx",
    "content": "import React, { useCallback, useEffect, useMemo, useReducer, useRef } from 'react';\n\nimport type {\n\tDroppableId,\n\tDroppableProps,\n\tDroppableProvided,\n\tDroppableStateSnapshot,\n} from 'react-beautiful-dnd';\nimport { createPortal } from 'react-dom';\nimport invariant from 'tiny-invariant';\n\nimport { attachClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { combine } from '@atlaskit/pragmatic-drag-and-drop/combine';\nimport { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nimport { useDragDropContext } from '../drag-drop-context/internal-context';\nimport { useMonitorForLifecycle } from '../drag-drop-context/lifecycle-context';\nimport { isDraggableData } from '../draggable/data';\nimport { useLayoutEffect } from '../hooks/use-isomorphic-layout-effect';\nimport { attributes, customAttributes, setAttributes } from '../utils/attributes';\nimport { useStable } from '../utils/use-stable';\n\nimport { useDroppableData } from './data';\nimport { DraggableClone } from './draggable-clone';\nimport { DropIndicator } from './drop-indicator';\nimport {\n\ttype DroppableContextProps,\n\tDroppableContextProvider,\n\tuseParentDroppableId,\n} from './droppable-context';\nimport { idleState, reducer } from './state';\nimport { VirtualPlaceholder } from './virtual-placeholder';\n\nexport function Droppable({\n\tchildren,\n\tdroppableId,\n\ttype = 'DEFAULT', // This default value replicates `react-beautiful-dnd`,\n\tdirection = 'vertical',\n\tmode = 'standard',\n\trenderClone,\n\tgetContainerForClone,\n\tisDropDisabled = false,\n}: DroppableProps): React.JSX.Element {\n\tconst getIsDropDisabled = useStable(isDropDisabled);\n\n\tconst { contextId, droppableRegistry } = useDragDropContext();\n\n\tconst data = useDroppableData({\n\t\tcontextId,\n\t\tdroppableId,\n\t\tgetIsDropDisabled,\n\t});\n\n\tconst elementRef = useRef<HTMLElement | null>(null);\n\tconst setElement = useCallback(\n\t\t(element: HTMLElement | null) => {\n\t\t\tif (element) {\n\t\t\t\tsetAttributes(element, {\n\t\t\t\t\t[customAttributes.droppable.type]: type,\n\t\t\t\t\t[customAttributes.droppable.direction]: direction,\n\t\t\t\t\t/**\n\t\t\t\t\t * We set this manually instead of relying on the provided prop,\n\t\t\t\t\t * because for virtual lists this can be difficult to apply.\n\t\t\t\t\t *\n\t\t\t\t\t * `react-beautiful-dnd` does not actually break if this is not applied.\n\t\t\t\t\t */\n\t\t\t\t\t[attributes.droppable.id]: droppableId,\n\t\t\t\t\t[attributes.droppable.contextId]: contextId,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\telementRef.current = element;\n\t\t},\n\t\t[contextId, direction, droppableId, type],\n\t);\n\n\tconst [state, dispatch] = useReducer(reducer, idleState);\n\tconst { draggingFromThisWith, draggingOverWith, isDraggingOver } = state;\n\n\tconst parentDroppableId = useParentDroppableId();\n\n\tuseEffect(() => {\n\t\tconst element = elementRef.current;\n\t\tinvariant(element instanceof HTMLElement, 'innerRef must provide an `HTMLElement`');\n\n\t\treturn combine(\n\t\t\tdroppableRegistry.register({\n\t\t\t\tdroppableId,\n\t\t\t\ttype,\n\t\t\t\tisDropDisabled,\n\t\t\t\tparentDroppableId,\n\t\t\t\telement,\n\t\t\t\tdirection,\n\t\t\t\tmode,\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement,\n\t\t\t\tgetData({ input }) {\n\t\t\t\t\treturn attachClosestEdge(data, {\n\t\t\t\t\t\telement,\n\t\t\t\t\t\tinput,\n\t\t\t\t\t\tallowedEdges: direction === 'vertical' ? ['top', 'bottom'] : ['left', 'right'],\n\t\t\t\t\t});\n\t\t\t\t},\n\t\t\t\tcanDrop({ source }) {\n\t\t\t\t\tif (!isDraggableData(source.data)) {\n\t\t\t\t\t\t// not dragging something from the migration layer\n\t\t\t\t\t\t// we should not allow dropping\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (isDropDisabled) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn source.data.contextId === contextId && source.data.type === type;\n\t\t\t\t},\n\t\t\t\tonDragLeave() {\n\t\t\t\t\tdispatch({ type: 'DRAG_CLEAR' });\n\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}, [\n\t\tdata,\n\t\tdroppableId,\n\t\tcontextId,\n\t\tisDropDisabled,\n\t\ttype,\n\t\tdroppableRegistry,\n\t\tparentDroppableId,\n\t\tdirection,\n\t\tmode,\n\t]);\n\n\tconst monitorForLifecycle = useMonitorForLifecycle();\n\tuseEffect(() => {\n\t\tfunction isEventRelevant(data: {\n\t\t\tdestination: { droppableId: DroppableId } | undefined | null;\n\t\t\ttype: string;\n\t\t}) {\n\t\t\t/**\n\t\t\t * If the draggable is of a different type to this droppable,\n\t\t\t * then we can ignore it.\n\t\t\t */\n\t\t\tconst isSameType = data.type === type;\n\n\t\t\tconst isOverAfterUpdate = data.destination?.droppableId === droppableId;\n\t\t\tconst isDragEnter = !isDraggingOver && isOverAfterUpdate;\n\t\t\tconst isDragLeave = isDraggingOver && !isOverAfterUpdate;\n\t\t\t/**\n\t\t\t * A droppable will only have a meaningful state update if the user is entering or exiting it.\n\t\t\t */\n\t\t\tconst isDragEnterOrLeave = isDragEnter || isDragLeave;\n\n\t\t\treturn isSameType && isDragEnterOrLeave;\n\t\t}\n\n\t\treturn monitorForLifecycle({\n\t\t\tonPendingDragStart({ start }) {\n\t\t\t\tif (!isEventRelevant({ destination: start.source, type: start.type })) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tdispatch({ type: 'DRAG_START', payload: { droppableId, start } });\n\t\t\t},\n\t\t\tonPendingDragUpdate({ update }) {\n\t\t\t\tif (!isEventRelevant(update)) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tdispatch({\n\t\t\t\t\ttype: 'DRAG_UPDATE',\n\t\t\t\t\tpayload: { droppableId, update },\n\t\t\t\t});\n\t\t\t},\n\t\t\tonBeforeDragEnd() {\n\t\t\t\t/**\n\t\t\t\t * This is safe to call optimistically as it uses a stable idle state.\n\t\t\t\t *\n\t\t\t\t * If the droppable is already idle, it will not rerender.\n\t\t\t\t */\n\t\t\t\tdispatch({ type: 'DRAG_CLEAR' });\n\t\t\t},\n\t\t});\n\t}, [droppableId, isDraggingOver, monitorForLifecycle, type]);\n\n\tconst dropIndicator = useMemo(() => {\n\t\tif (!isDraggingOver) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn <DropIndicator direction={direction} mode={mode} />;\n\t}, [direction, isDraggingOver, mode]);\n\n\tconst provided: DroppableProvided = useMemo(\n\t\t() => ({\n\t\t\tinnerRef: setElement,\n\t\t\tdroppableProps: {\n\t\t\t\t[attributes.droppable.contextId]: contextId,\n\t\t\t\t[attributes.droppable.id]: droppableId,\n\t\t\t},\n\t\t\t/**\n\t\t\t * We only provide a drop indicator as the placeholder for\n\t\t\t * non-virtual lists. Otherwise it is portalled in.\n\t\t\t */\n\t\t\tplaceholder: mode === 'standard' ? dropIndicator : null,\n\t\t}),\n\t\t[contextId, dropIndicator, droppableId, mode, setElement],\n\t);\n\n\tconst snapshot: DroppableStateSnapshot = useMemo(\n\t\t() => ({\n\t\t\tdraggingFromThisWith,\n\t\t\tdraggingOverWith,\n\t\t\tisDraggingOver,\n\t\t\tisUsingPlaceholder: isDraggingOver,\n\t\t}),\n\t\t[draggingFromThisWith, draggingOverWith, isDraggingOver],\n\t);\n\n\tconst element = elementRef.current;\n\tconst shouldPortalDropIndicator = isDraggingOver && mode === 'virtual' && element;\n\n\t/**\n\t * Assumes that the ref points to the scroll container.\n\t */\n\tuseLayoutEffect(() => {\n\t\tif (!shouldPortalDropIndicator) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst { position } = window.getComputedStyle(element);\n\n\t\tif (position !== 'static') {\n\t\t\treturn;\n\t\t}\n\n\t\tconst prevStyle = element.style.position;\n\t\telement.style.position = 'relative';\n\n\t\treturn () => {\n\t\t\telement.style.position = prevStyle;\n\t\t};\n\t}, [element, shouldPortalDropIndicator]);\n\n\t/**\n\t * Used to disable the dragging style for the real draggable.\n\t */\n\tconst shouldRenderCloneWhileDragging = Boolean(renderClone);\n\n\tconst contextValue: DroppableContextProps = useMemo(() => {\n\t\treturn {\n\t\t\tdirection,\n\t\t\tdroppableId,\n\t\t\tshouldRenderCloneWhileDragging,\n\t\t\tisDropDisabled,\n\t\t\ttype,\n\t\t\tmode,\n\t\t};\n\t}, [direction, droppableId, shouldRenderCloneWhileDragging, isDropDisabled, type, mode]);\n\n\t/**\n\t * For virtual lists we portal a placeholder in when dragging from the list.\n\t *\n\t * This is because `<Draggable />`'s can be unmounted at any time, so we\n\t * cannot rely on rendering the placeholder as a sibling.\n\t */\n\tconst shouldPortalPlaceholder = draggingFromThisWith && mode === 'virtual' && element;\n\n\treturn (\n\t\t<DroppableContextProvider value={contextValue}>\n\t\t\t{children(provided, snapshot)}\n\t\t\t{shouldPortalDropIndicator && createPortal(dropIndicator, element)}\n\t\t\t{shouldPortalPlaceholder &&\n\t\t\t\tcreatePortal(\n\t\t\t\t\t<VirtualPlaceholder\n\t\t\t\t\t\tdroppableId={droppableId}\n\t\t\t\t\t\tdraggableId={draggingFromThisWith}\n\t\t\t\t\t\ttype={type}\n\t\t\t\t\t\tdirection={direction}\n\t\t\t\t\t\tisDropDisabled={isDropDisabled}\n\t\t\t\t\t/>,\n\t\t\t\t\telement,\n\t\t\t\t)}\n\t\t\t{renderClone && (\n\t\t\t\t<DraggableClone\n\t\t\t\t\tdroppableId={droppableId}\n\t\t\t\t\ttype={type}\n\t\t\t\t\tgetContainerForClone={getContainerForClone}\n\t\t\t\t>\n\t\t\t\t\t{renderClone}\n\t\t\t\t</DraggableClone>\n\t\t\t)}\n\t\t</DroppableContextProvider>\n\t);\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/droppable/state.tsx",
    "content": "import type { DragStart, DragUpdate, DroppableId } from 'react-beautiful-dnd';\n\nimport type { Action } from '../internal-types';\n\ntype DroppableState = {\n\tdraggingFromThisWith: string | null;\n\tdraggingOverWith: string | null;\n\tisDraggingOver: boolean;\n};\n\nexport type DroppableAction =\n\t| Action<'DRAG_START', { droppableId: DroppableId; start: DragStart }>\n\t| Action<'DRAG_UPDATE', { droppableId: DroppableId; update: DragUpdate }>\n\t| Action<'DRAG_CLEAR'>;\n\nexport const idleState: DroppableState = {\n\tdraggingFromThisWith: null,\n\tdraggingOverWith: null,\n\tisDraggingOver: false,\n};\n\nexport function reducer(state: DroppableState, action: DroppableAction): DroppableState {\n\tif (action.type === 'DRAG_START') {\n\t\tconst { droppableId, start } = action.payload;\n\t\tconst { draggableId, source } = start;\n\n\t\tconst isDraggingOver = source.droppableId === droppableId;\n\t\tconst draggingOverWith = isDraggingOver ? draggableId : null;\n\n\t\tconst isDraggingFrom = source.droppableId === droppableId;\n\t\tconst draggingFromThisWith = isDraggingFrom ? draggableId : null;\n\n\t\treturn {\n\t\t\t...state,\n\t\t\tisDraggingOver,\n\t\t\tdraggingFromThisWith,\n\t\t\tdraggingOverWith,\n\t\t};\n\t}\n\n\tif (action.type === 'DRAG_UPDATE') {\n\t\tconst { droppableId, update } = action.payload;\n\t\tconst { destination = null, draggableId, source } = update;\n\n\t\tconst isDraggingOver = destination?.droppableId === droppableId;\n\t\tconst draggingOverWith = isDraggingOver ? draggableId : null;\n\n\t\tconst isDraggingFrom = source.droppableId === droppableId;\n\t\tconst draggingFromThisWith = isDraggingFrom ? draggableId : null;\n\n\t\treturn {\n\t\t\t...state,\n\t\t\tisDraggingOver,\n\t\t\tdraggingFromThisWith,\n\t\t\tdraggingOverWith,\n\t\t};\n\t}\n\n\tif (action.type === 'DRAG_CLEAR') {\n\t\treturn idleState;\n\t}\n\n\treturn state;\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/droppable/virtual-placeholder.tsx",
    "content": "import React, { type CSSProperties, useCallback, useMemo, useRef } from 'react';\n\nimport type { Direction, DraggableId, DroppableId } from 'react-beautiful-dnd';\n\nimport { useDragDropContext } from '../drag-drop-context/internal-context';\nimport { rbdInvariant } from '../drag-drop-context/rbd-invariant';\nimport { useDraggableData } from '../draggable/data';\nimport { Placeholder } from '../draggable/placeholder';\nimport { useDropTargetForDraggable } from '../hooks/use-drop-target-for-draggable';\n\n/**\n * The virtual placeholder exists specifically for virtual lists,\n * to ensure that the injected placeholder is correctly positioned.\n *\n * Standard placeholders are rendered as siblings, and do not need explicit\n * positioning.\n *\n * Because virtual placeholders are injected through a portal, they need to be\n * absolutely positioned so that they cover the gap left by the dragging item.\n *\n * This placeholder is important because it acts as the drop target for the\n * dragging item.\n */\nexport function VirtualPlaceholder({\n\tdraggableId,\n\tdroppableId,\n\ttype,\n\tdirection,\n\tisDropDisabled,\n}: {\n\tdraggableId: DraggableId;\n\tdroppableId: DroppableId;\n\ttype: string;\n\tdirection: Direction;\n\tisDropDisabled: boolean;\n}): React.JSX.Element {\n\tconst ref = useRef<HTMLDivElement>(null);\n\n\tconst { contextId, getDragState } = useDragDropContext();\n\n\tconst dragState = getDragState();\n\trbdInvariant(\n\t\tdragState.isDragging,\n\t\t'The virtual placeholder should only be rendered during a drag',\n\t);\n\n\tconst getIndex = useCallback(() => {\n\t\treturn dragState.sourceLocation.index;\n\t}, [dragState.sourceLocation.index]);\n\n\tconst data = useDraggableData({\n\t\tdraggableId,\n\t\tdroppableId,\n\t\tgetIndex,\n\t\tcontextId,\n\t\ttype,\n\t});\n\n\t/**\n\t * This sets up the drop target for the dragging item.\n\t */\n\tuseDropTargetForDraggable({\n\t\telementRef: ref,\n\t\tdata,\n\t\tdirection,\n\t\tcontextId,\n\t\tisDropDisabled,\n\t\ttype,\n\t});\n\n\tconst style: CSSProperties = useMemo(() => {\n\t\treturn {\n\t\t\tposition: 'absolute',\n\t\t\ttop: dragState.draggableInitialOffsetInSourceDroppable.top,\n\t\t\tleft: dragState.draggableInitialOffsetInSourceDroppable.left,\n\t\t\tmargin: 0,\n\t\t};\n\t}, [\n\t\tdragState.draggableInitialOffsetInSourceDroppable.left,\n\t\tdragState.draggableInitialOffsetInSourceDroppable.top,\n\t]);\n\n\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766\n\treturn <Placeholder ref={ref} style={style} />;\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/hooks/use-captured-dimensions.tsx",
    "content": "import { useDragDropContext } from '../drag-drop-context/internal-context';\n\nexport type DraggableDimensions = {\n\trect: DOMRect;\n\tmargin: string;\n};\n\nexport function getDraggableDimensions(element: HTMLElement): DraggableDimensions {\n\tconst { margin } = window.getComputedStyle(element);\n\tconst rect = element.getBoundingClientRect();\n\treturn { margin, rect };\n}\n\n/**\n * Returns the captured dimensions of the item being dragged.\n */\nexport function useDraggableDimensions(): DraggableDimensions | null {\n\tconst { getDragState } = useDragDropContext();\n\tconst dragState = getDragState();\n\tif (!dragState.isDragging) {\n\t\treturn null;\n\t}\n\treturn dragState.draggableDimensions;\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/hooks/use-cleanup-fn.tsx",
    "content": "import { useEffect, useState } from 'react';\n\nimport type { CleanupFn } from '../internal-types';\n\nconst noop = () => {};\n\nfunction createCleanupManager() {\n\tlet cleanupFn = noop;\n\n\tconst setCleanupFn = (newCleanupFn: CleanupFn) => {\n\t\tcleanupFn = newCleanupFn;\n\t};\n\n\tconst runCleanupFn = () => {\n\t\tcleanupFn();\n\t\tcleanupFn = noop;\n\t};\n\n\treturn { setCleanupFn, runCleanupFn };\n}\n\nexport function useCleanupFn() {\n\tconst [cleanupManager] = useState(createCleanupManager);\n\n\t/**\n\t * Run the cleanup function on unmount.\n\t */\n\tuseEffect(() => {\n\t\treturn cleanupManager.runCleanupFn;\n\t}, [cleanupManager.runCleanupFn]);\n\n\treturn cleanupManager;\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/hooks/use-drop-target-for-draggable.tsx",
    "content": "import { type RefObject, useEffect } from 'react';\n\nimport type { Direction } from 'react-beautiful-dnd';\n\nimport { attachClosestEdge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge';\nimport { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';\n\nimport { rbdInvariant } from '../drag-drop-context/rbd-invariant';\nimport { type DraggableData, isDraggableData } from '../draggable/data';\n\nexport function useDropTargetForDraggable({\n\telementRef,\n\tdata,\n\tdirection,\n\tcontextId,\n\tisDropDisabled,\n\ttype,\n}: {\n\telementRef: RefObject<HTMLElement>;\n\tdata: DraggableData;\n\tdirection: Direction;\n\tcontextId: string;\n\tisDropDisabled: boolean;\n\ttype: string;\n}): void {\n\tuseEffect(() => {\n\t\tconst element = elementRef.current;\n\t\trbdInvariant(element instanceof HTMLElement);\n\n\t\treturn dropTargetForElements({\n\t\t\telement,\n\t\t\tgetIsSticky() {\n\t\t\t\treturn true;\n\t\t\t},\n\t\t\tcanDrop({ source }) {\n\t\t\t\tif (!isDraggableData(source.data)) {\n\t\t\t\t\t// not dragging something from the migration layer\n\t\t\t\t\t// we should not allow dropping\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tif (isDropDisabled) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\treturn source.data.type === type && source.data.contextId === contextId;\n\t\t\t},\n\t\t\tgetData({ input }) {\n\t\t\t\treturn attachClosestEdge(data, {\n\t\t\t\t\telement,\n\t\t\t\t\tinput,\n\t\t\t\t\tallowedEdges: direction === 'vertical' ? ['top', 'bottom'] : ['left', 'right'],\n\t\t\t\t});\n\t\t\t},\n\t\t});\n\t}, [data, direction, contextId, isDropDisabled, type, elementRef]);\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/hooks/use-isomorphic-layout-effect.tsx",
    "content": "/**\n * Avoids a warning being printed during SSR.\n *\n * See article for further information:\n * <https://medium.com/@alexandereardon/uselayouteffect-and-ssr-192986cdcf7a>\n */\n\nimport { useEffect, useLayoutEffect } from 'react';\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;\n\n// Ensure the name used in components is useLayoutEffect\nexport { useIsomorphicLayoutEffect as useLayoutEffect };\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/hooks/use-keyboard-context.tsx",
    "content": "import { useDragDropContext } from '../drag-drop-context/internal-context';\n\nexport function useKeyboardContext() {\n\tconst { startKeyboardDrag } = useDragDropContext();\n\treturn { startKeyboardDrag };\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/index.ts",
    "content": "export { DragDropContext } from './drag-drop-context';\nexport { Draggable } from './draggable';\nexport { Droppable } from './droppable';\nexport { resetServerContext } from './reset-server-context';\n\n/**\n * Reason: The eslint rule is incorrectly reporting that `react-beautiful-dnd`\n * is required as a dependency, when only its types are being exported.\n */\n// eslint-disable-next-line import/no-extraneous-dependencies\nexport type {\n\tAnnounce,\n\tAxis,\n\tBeforeCapture,\n\tBoxModel,\n\tClientPositions,\n\tCollectingState,\n\tCombine,\n\tCombineImpact,\n\tCompletedDrag,\n\tContextId,\n\tCritical,\n\tDimensionMap,\n\tDirection,\n\tDisplaced,\n\tDisplacedBy,\n\tDisplacement,\n\tDisplacementGroups,\n\tDisplacementMap,\n\tDragActions,\n\tDragDropContextProps,\n\tDragImpact,\n\tDragPositions,\n\tDragStart,\n\tDragUpdate,\n\tDraggableChildrenFn,\n\tDraggableDescriptor,\n\tDraggableDimension,\n\tDraggableDimensionMap,\n\tDraggableId,\n\tDraggableIdMap,\n\tDraggableLocation,\n\tDraggableOptions,\n\tDraggableProps,\n\tDraggableProvided,\n\tDraggableProvidedDragHandleProps,\n\tDraggableProvidedDraggableProps,\n\tDraggableRubric,\n\tDraggableStateSnapshot,\n\tDraggingState,\n\tDraggingStyle,\n\tDropAnimatingState,\n\tDropAnimation,\n\tDropPendingState,\n\tDropReason,\n\tDropResult,\n\tDroppableDescriptor,\n\tDroppableDimension,\n\tDroppableDimensionMap,\n\tDroppableId,\n\tDroppableIdMap,\n\tDroppableMode,\n\tDroppableProps,\n\tDroppableProvided,\n\tDroppableProvidedProps,\n\tDroppablePublish,\n\tDroppableStateSnapshot,\n\tDroppableSubject,\n\tElementId,\n\tFluidDragActions,\n\tHorizontalAxis,\n\tId,\n\tIdleState,\n\tImpactLocation,\n\tInOutAnimationMode,\n\tLiftEffect,\n\tLiftRequest,\n\tMovementMode,\n\tNotDraggingStyle,\n\tOnBeforeCaptureResponder,\n\tOnBeforeDragStartResponder,\n\tOnDragEndResponder,\n\tOnDragStartResponder,\n\tOnDragUpdateResponder,\n\tPagePositions,\n\tPlaceholder,\n\tPlaceholderInSubject,\n\tPosition,\n\tPreDragActions,\n\tPublished,\n\tRect,\n\tReorderImpact,\n\tResponderProvided,\n\tResponders,\n\tScrollDetails,\n\tScrollDifference,\n\tScrollOptions,\n\tScrollSize,\n\tScrollable,\n\tSensor,\n\tSensorAPI,\n\tSnapDragActions,\n\tSpacing,\n\tState,\n\tStateWhenUpdatesAllowed,\n\tStopDragOptions,\n\tTryGetLock,\n\tTryGetLockOptions,\n\tTypeId,\n\tVerticalAxis,\n\tViewport,\n} from 'react-beautiful-dnd';\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/internal-types.tsx",
    "content": "/**\n * This type is not exported by `@atlaskit/pragmatic-drag-and-drop`\n */\nexport type DragSource = {\n\telement: HTMLElement;\n\tdragHandle: Element | null;\n\tdata: Record<string, unknown>;\n};\n\nexport type Action<Name extends string, Payload = undefined> = Payload extends undefined\n\t? { type: Name }\n\t: { type: Name; payload: Payload };\n\nexport type CleanupFn = () => void;\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/reset-server-context.tsx",
    "content": "export { resetServerContext } from './drag-drop-context';\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/utils/attributes.tsx",
    "content": "import { rbdInvariant } from '../drag-drop-context/rbd-invariant';\n\nexport const attributes = {\n\tdraggable: {\n\t\tcontextId: 'data-rbd-draggable-context-id',\n\t\tid: 'data-rbd-draggable-id',\n\t},\n\tdragHandle: {\n\t\tcontextId: 'data-rbd-drag-handle-context-id',\n\t\tdraggableId: 'data-rbd-drag-handle-draggable-id',\n\t},\n\tdroppable: {\n\t\tcontextId: 'data-rbd-droppable-context-id',\n\t\tid: 'data-rbd-droppable-id',\n\t},\n\tplaceholder: { contextId: 'data-rbd-placeholder-context-id' },\n} as const;\n\n/**\n * These attributes are not set by `react-beautiful-dnd`,\n * but they expose useful information for the migration layer.\n */\nexport const customAttributes = {\n\tdraggable: {\n\t\tdroppableId: 'data-rbd-draggable-droppable-id',\n\t\tindex: 'data-rbd-draggable-index',\n\t},\n\tdropIndicator: 'data-rbd-drop-indicator',\n\tdroppable: {\n\t\tdirection: 'data-rbd-droppable-direction',\n\t\ttype: 'data-rbd-droppable-type',\n\t},\n} as const;\n\ntype LeafOf<Object extends Record<string, any>, Value = Object[keyof Object]> =\n\tValue extends Record<string, any> ? LeafOf<Value> : Value;\n\ntype Attribute = LeafOf<typeof attributes> | LeafOf<typeof customAttributes>;\n\nexport function getAttribute(element: HTMLElement, attribute: Attribute): string {\n\tconst value = element.getAttribute(attribute);\n\trbdInvariant(value !== null, `Expected '${attribute}' to be present`);\n\treturn value;\n}\n\ntype CleanUpFn = () => void;\n\nexport function setAttributes(\n\telement: HTMLElement,\n\tattributes: Partial<Record<Attribute, string>>,\n): CleanUpFn {\n\tfor (const [key, value] of Object.entries(attributes)) {\n\t\telement.setAttribute(key, value);\n\t}\n\n\treturn () => {\n\t\tfor (const key of Object.keys(attributes)) {\n\t\t\telement.removeAttribute(key);\n\t\t}\n\t};\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/utils/batch-updates-for-react-16.tsx",
    "content": "import { unstable_batchedUpdates, version } from 'react-dom';\n\nconst schedule: (callback: () => void) => void = (() => {\n\t/**\n\t * We only want to do this manual batching for version 16 of React.\n\t *\n\t * Version 18 will automatically batch updates.\n\t */\n\tif (\n\t\t// `unstable_batchedUpdates` is defined in all currently supported versions\n\t\t// but could be removed in the future.\n\t\t// This check is defensive and not currently necessary.\n\t\ttypeof unstable_batchedUpdates === 'function' &&\n\t\t// The version export was only introduced in `react-dom@16.13.0`\n\t\t// but we need to support `react-dom@^16.8.0`\n\t\t// so we need to handle when the version is `undefined`\n\t\t(typeof version === 'undefined' || version.startsWith('16'))\n\t) {\n\t\treturn unstable_batchedUpdates;\n\t}\n\t// Relying on react@18 to do automatic batching\n\treturn (callback) => callback();\n})();\n\nexport function batchUpdatesForReact16(callback: () => void): void {\n\tschedule(callback);\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/utils/find-all-draggables.tsx",
    "content": "import { attributes, customAttributes } from './attributes';\nimport { findElementAll } from './find-element';\n\nexport function findAllDraggables({\n\tdroppableId,\n\tcontextId,\n}: {\n\tdroppableId: string;\n\tcontextId: string;\n}): HTMLElement[] {\n\treturn findElementAll(\n\t\t{ attribute: attributes.draggable.contextId, value: contextId },\n\t\t{ attribute: customAttributes.draggable.droppableId, value: droppableId },\n\t);\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/utils/find-closest-scroll-container.tsx",
    "content": "/**\n * Ported from `react-beautiful-dnd`\n */\nexport function findClosestScrollContainer(element: HTMLElement): HTMLElement | null {\n\tconst { overflowX, overflowY } = getComputedStyle(element);\n\n\tif (\n\t\toverflowX === 'scroll' ||\n\t\toverflowX === 'auto' ||\n\t\toverflowY === 'scroll' ||\n\t\toverflowY === 'auto'\n\t) {\n\t\treturn element;\n\t}\n\n\tconst { parentElement } = element;\n\n\tif (parentElement === null) {\n\t\treturn null;\n\t}\n\n\treturn findClosestScrollContainer(parentElement);\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/utils/find-drag-handle.tsx",
    "content": "import { attributes } from './attributes';\nimport { findElement } from './find-element';\n\n/**\n * Obtains the `HTMLElement` with the data attribute passed down through\n * `provided.dragHandleProps`\n */\nexport function findDragHandle({\n\tcontextId,\n\tdraggableId,\n}: {\n\tcontextId: string;\n\tdraggableId: string;\n}): HTMLElement | null {\n\t// Otherwise the drag handle is a descendant.\n\treturn findElement(\n\t\t{ attribute: attributes.dragHandle.contextId, value: contextId },\n\t\t{ attribute: attributes.dragHandle.draggableId, value: draggableId },\n\t);\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/utils/find-drop-indicator.tsx",
    "content": "import { customAttributes } from './attributes';\nimport { findElement } from './find-element';\n\nexport function findDropIndicator() {\n\treturn findElement({\n\t\tattribute: customAttributes.dropIndicator,\n\t});\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/utils/find-element.tsx",
    "content": "import { rbdInvariant } from '../drag-drop-context/rbd-invariant';\n\n/**\n * Each fragment consists of an attribute name, with an optional value.\n */\ntype SelectorFragment = { attribute: string; value?: string };\n\n/**\n * Joins selector fragments into a single selector.\n *\n * @example\n * getSelector(\n *   // If we care about the value of the attribute\n *   { attribute: 'my-attribute', value: 'my-value' },\n *   // If we only care about existence of the attribute\n *   { attribute: 'another-attribute' },\n * ) === '[my-attribute=\"my-value\"][another-attribute]'\n */\nfunction getSelector(...fragments: SelectorFragment[]): string {\n\tconst parts = fragments.map(({ attribute, value }) => {\n\t\tif (value) {\n\t\t\t// `CSS.escape` is widely supported, the lint rule is wrong.\n\t\t\t// It avoids problems caused by some values which are not valid in\n\t\t\t// selectors.\n\t\t\treturn `[${attribute}=\"${CSS.escape(value)}\"]`;\n\t\t}\n\t\treturn `[${attribute}]`;\n\t});\n\n\treturn parts.join('');\n}\n\n/**\n * Queries an element based on the provided selector fragments.\n */\nexport function findElement(...fragments: SelectorFragment[]): HTMLElement | null {\n\tconst selector = getSelector(...fragments);\n\treturn document.querySelector(selector);\n}\n\nexport function findElementAll(...fragments: SelectorFragment[]): HTMLElement[] {\n\tconst selector = getSelector(...fragments);\n\treturn Array.from(document.querySelectorAll(selector));\n}\n\n/**\n * Queries an element, ensuring it exists.\n */\nexport function getElement(...fragments: SelectorFragment[]): HTMLElement {\n\tconst result = findElement(...fragments);\n\trbdInvariant(result, 'There is a matching HTMLElement for selector ' + getSelector(...fragments));\n\treturn result;\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/utils/find-placeholder.tsx",
    "content": "import type { ContextId } from 'react-beautiful-dnd';\n\nimport { attributes } from './attributes';\nimport { findElement } from './find-element';\n\nexport function findPlaceholder(contextId: ContextId) {\n\treturn findElement({\n\t\tattribute: attributes.placeholder.contextId,\n\t\tvalue: contextId,\n\t});\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/utils/get-best-cross-axis-droppable.tsx",
    "content": "import type { DroppableId } from 'react-beautiful-dnd';\n\nimport type { DroppableRegistry } from '../drag-drop-context/droppable-registry';\n\nimport { attributes, customAttributes, getAttribute } from './attributes';\nimport { findElementAll } from './find-element';\n\nfunction getDroppablesOfType({\n\tcontextId,\n\ttype,\n}: {\n\ttype: string;\n\tcontextId: string;\n}): HTMLElement[] {\n\treturn findElementAll(\n\t\t{ attribute: attributes.droppable.contextId, value: contextId },\n\t\t{ attribute: customAttributes.droppable.type, value: type },\n\t);\n}\n\n/**\n * This is similar to the function of the same name in `react-beautiful-dnd`.\n *\n * Many of the checks from rbd are removed though, such as visibility checks.\n */\nexport function getBestCrossAxisDroppable({\n\tdroppableId,\n\ttype,\n\tisMovingForward,\n\tcontextId,\n\tdroppableRegistry,\n}: {\n\tdroppableId: DroppableId;\n\ttype: string;\n\tisMovingForward: boolean;\n\tcontextId: string;\n\tdroppableRegistry: DroppableRegistry;\n}): HTMLElement | null {\n\tconst droppables = getDroppablesOfType({ contextId, type });\n\n\tconst currentIndex = droppables.findIndex(\n\t\t(element: HTMLElement) => getAttribute(element, attributes.droppable.id) === droppableId,\n\t);\n\n\tconst candidates = droppables\n\t\t.filter((_, index) => {\n\t\t\t/**\n\t\t\t * We are following the DOM order of the droppables,\n\t\t\t * so keep only those that are before/after the current.\n\t\t\t */\n\t\t\tif (isMovingForward) {\n\t\t\t\treturn index > currentIndex;\n\t\t\t}\n\t\t\treturn index < currentIndex;\n\t\t})\n\t\t.filter((element: HTMLElement) => {\n\t\t\t/**\n\t\t\t * Filter out the disabled droppables.\n\t\t\t */\n\t\t\tconst droppableId = getAttribute(element, attributes.droppable.id);\n\t\t\tconst entry = droppableRegistry.getEntry({ droppableId });\n\n\t\t\tconst isValidCandidate = entry && !entry.isDropDisabled;\n\t\t\treturn isValidCandidate;\n\t\t});\n\n\t/**\n\t * If we're moving forward then take the first candidate,\n\t * if moving backwards take the last candidate\n\t * (because it is closest to where the current is).\n\t *\n\t * Using `.at()` provides a safer type, making us handle the `undefined` case.\n\t */\n\tconst bestCandidate = isMovingForward ? candidates.at(0) : candidates.at(-1);\n\n\treturn bestCandidate ?? null;\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/utils/get-closest-positioned-element.tsx",
    "content": "import type { DroppableMode } from 'react-beautiful-dnd';\n\n/**\n * Returns the closest element with `position: absolute` or `null` if none found.\n */\nfunction getClosestAbsolutePositionedElement(element: HTMLElement): HTMLElement | null {\n\tconst { position } = getComputedStyle(element);\n\tif (position === 'absolute') {\n\t\treturn element;\n\t}\n\n\tconst { parentElement } = element;\n\tif (parentElement instanceof HTMLElement) {\n\t\treturn getClosestAbsolutePositionedElement(parentElement);\n\t}\n\n\treturn null;\n}\n\n/**\n * Returns the closest element that is offset relative to the scroll container.\n */\nexport function getClosestPositionedElement({\n\telement,\n\tmode,\n}: {\n\telement: HTMLElement;\n\tmode: DroppableMode;\n}): HTMLElement {\n\t/**\n\t * We use the element directly for standard lists,\n\t * because we assume it is positioned in the flow.\n\t */\n\tif (mode === 'standard') {\n\t\treturn element;\n\t}\n\n\t/**\n\t * For virtual lists we use the closest element with `position: absolute`,\n\t * as this is how virtualization libraries offset elements.\n\t */\n\treturn getClosestAbsolutePositionedElement(element) ?? element;\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/utils/get-element-by-draggable-location.tsx",
    "content": "import type { DraggableLocation } from 'react-beautiful-dnd';\n\nimport { attributes, customAttributes } from './attributes';\nimport { findElement } from './find-element';\n\nexport function getElementByDraggableLocation(\n\tcontextId: string,\n\tlocation: DraggableLocation | null,\n): HTMLElement | null {\n\tif (!location) {\n\t\treturn null;\n\t}\n\n\treturn findElement(\n\t\t{ attribute: attributes.draggable.contextId, value: contextId },\n\t\t{\n\t\t\tattribute: customAttributes.draggable.droppableId,\n\t\t\tvalue: location.droppableId,\n\t\t},\n\t\t{\n\t\t\tattribute: customAttributes.draggable.index,\n\t\t\tvalue: String(location.index),\n\t\t},\n\t);\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/src/utils/use-stable.tsx",
    "content": "import { useCallback, useEffect, useRef } from 'react';\n\n/**\n * Allows access to a changing value in a stable way.\n */\nexport function useStable<Value>(value: Value): () => Value {\n\tconst ref = useRef(value);\n\n\tuseEffect(() => {\n\t\tref.current = value;\n\t}, [value]);\n\n\tconst getValue = useCallback(() => {\n\t\treturn ref.current;\n\t}, []);\n\n\treturn getValue;\n}\n"
  },
  {
    "path": "packages/react-beautiful-dnd-migration/tsconfig.json",
    "content": "{\n  \"extends\": \"../../tsconfig.json\",\n  \"include\": [\n    \"__tests__/**/*.ts\",\n    \"__tests__/**/*.tsx\",\n    \"examples/**/*.ts\",\n    \"examples/**/*.tsx\",\n    \"src/**/*.ts\",\n    \"src/**/*.tsx\",\n    \"**/stories.ts\",\n    \"**/stories.tsx\",\n    \"**/stories/*.ts\",\n    \"**/stories/*.tsx\",\n    \"**/stories/**/*.ts\",\n    \"**/stories/**/*.tsx\"\n  ]\n}\n"
  },
  {
    "path": "packages/react-drop-indicator/.npmignore",
    "content": "src/\nexamples-utils/\nexamples/\nindex.ts\ndocs/\nbuild/\n__tests__/\ntsconfig.json\ntsconfig.app.json\ntsconfig.dev.json\n"
  },
  {
    "path": "packages/react-drop-indicator/CHANGELOG.md",
    "content": "# @atlaskit/pragmatic-drag-and-drop-react-indicator\n\n## 3.2.12\n\n### Patch Changes\n\n- Updated dependencies\n\n## 3.2.11\n\n### Patch Changes\n\n- Updated dependencies\n\n## 3.2.10\n\n### Patch Changes\n\n- Updated dependencies\n\n## 3.2.9\n\n### Patch Changes\n\n- Updated dependencies\n\n## 3.2.8\n\n### Patch Changes\n\n- Updated dependencies\n\n## 3.2.7\n\n### Patch Changes\n\n- [`5d0b8ba5e6f7f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5d0b8ba5e6f7f) -\n  Internal changes to how borders are applied.\n- Updated dependencies\n\n## 3.2.6\n\n### Patch Changes\n\n- [`beaa6ee463aa8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/beaa6ee463aa8) -\n  Internal changes to how border radius is applied.\n- Updated dependencies\n\n## 3.2.5\n\n### Patch Changes\n\n- [`e8c312827c802`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e8c312827c802) -\n  Remove unnecessary files from published package\n\n## 3.2.4\n\n### Patch Changes\n\n- [`5bed2aeb9093f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5bed2aeb9093f) -\n  Internal refactoring of tests\n\n## 3.2.3\n\n### Patch Changes\n\n- [`2b9d69f7eb7bd`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2b9d69f7eb7bd) -\n  Adding tests to ensure all outputs work with React suspense, and React strict mode.\n\n## 3.2.2\n\n### Patch Changes\n\n- Updated dependencies\n\n## 3.2.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 3.2.0\n\n### Minor Changes\n\n- [#152796](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/152796)\n  [`530aa01e75ebe`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/530aa01e75ebe) -\n  Adding new drop indicators `border`, `group` and `list-item` to assist with more complex\n  experiences. See documentation for API and usage information.\n\n### Patch Changes\n\n- Updated dependencies\n\n## 3.1.0\n\n### Minor Changes\n\n- [#140214](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/140214)\n  [`6903fb239a6ac`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6903fb239a6ac) -\n  Exposing a `<Border>` drop indicator component. Currently `Border` is not documented while we\n  validate with internal usage.\n\n## 3.0.2\n\n### Patch Changes\n\n- [#125534](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/125534)\n  [`f135a8d1066c9`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f135a8d1066c9) -\n  Updates the `react` peer dependency range to include React 19. While we expect these packages to\n  work with React 19, we do not test against and there is a small risk of issues. If you have any\n  problems, please raise an issue on [Github](https://github.com/atlassian/pragmatic-drag-and-drop).\n\n## 3.0.1\n\n### Patch Changes\n\n- [#129972](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/129972)\n  [`b2d69a39e6687`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b2d69a39e6687) -\n  Update `@compiled/react` dependency for improved type checking support.\n\n## 3.0.0\n\n### Major Changes\n\n- [#125185](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/125185)\n  [`62f176ec5174c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/62f176ec5174c) -\n  `box-without-terminal` has been removed as it is now redundant. `box-without-terminal` can now be\n  achieved with `box` by leveraging `type=\"no-terminal\"`.\n\n  ```diff\n  - import { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box-without-terminal';\n  + import { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\n\n  function Item() {\n  -  return <DropIndicator edge=\"bottom\" />\n  +  return <DropIndicator edge=\"bottom\" type=\"no-terminal\" />\n  }\n  ```\n\n- [#125185](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/125185)\n  [`d2d78bed3e76f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/d2d78bed3e76f) -\n  This package is moving from `@emotion/react` to [Compiled](https://compiledcssinjs.com/) for\n  styling.\n\n  [Compiled](https://compiledcssinjs.com/) is a styling solution with a tiny runtime (`~260B`) that\n  you can use along side your existing styling solution(s). As long as your bundler supports CSS\n  imports (eg `import './styles.css'`) then you shouldn't need to do anything!\n  [More information for if you run into any difficulties](https://community.developer.atlassian.com/t/rfc-73-migrating-our-components-to-compiled-css-in-js/85953).\n\n  This change has been released as a `major`, as it would require changes for consumers who do not\n  have a bundler with CSS imports enabled.\n\n### Patch Changes\n\n- Updated dependencies\n\n## 2.2.0\n\n### Minor Changes\n\n- [#124834](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/124834)\n  [`c6ef61f6b00d1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c6ef61f6b00d1) -\n  **More out of the `box`**\n\n  The API of our `box` drop indicator has been expanded to include `type` (more control over the\n  terminal), `appearance` (color control) and `indent` (line shifting). See documentation for full\n  usage explanation and examples.\n\n  **`box-without-terminal` is deprecated**\n\n  `box-without-terminal` has been deprecated as it is now redundant. `box-without-terminal` can now\n  be achieved with `box` by leveraging `type=\"no-terminal\"`.\n\n  ```diff\n  - import { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box-without-terminal';\n  + import { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\n\n  function Item() {\n  -  return <DropIndicator edge=\"bottom\" />\n  +  return <DropIndicator edge=\"bottom\" type=\"no-terminal\" />\n  }\n  ```\n\n  We will remove `box-without-terminal` in the next `major` release.\n\n## 2.1.0\n\n### Minor Changes\n\n- [#119914](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/119914)\n  [`e77649a3345a0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e77649a3345a0) -\n  **New: Right to left (rtl) support**\n\n  All drop indicators now correctly support\n  [\"right to left\" (`rtl`) rendering](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/dir).\n  - `box` and `tree-item`: terminals (circles) on lines are now rendered on right hand side of the\n    line for `rtl` rendering\n  - `tree-item`: `indent` will now correctly respect `rtl` rendering.\n\n  **Other**\n  - All drop indicators that rendered lines now leverage the same underlying base component to help\n    reduce bundle size for consumers leveraging multiple types of drop indicators.\n\n### Patch Changes\n\n- [#120533](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/120533)\n  [`f1bec731e278f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f1bec731e278f) -\n  Adds a `sideEffects` field to ensure this package does not have Compiled styles tree-shaken in the\n  future to avoid an accidental regression.\n\n  This is related to\n  https://community.developer.atlassian.com/t/rfc-73-migrating-our-components-to-compiled-css-in-js/85953\n\n## 2.0.0\n\n### Major Changes\n\n- [#117363](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/117363)\n  [`10a0f7f6c2027`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/10a0f7f6c2027) -\n  This package's `peerDependencies` have been adjusted for `react` and/or `react-dom` to reflect the\n  status of only supporting React 18 going forward. No explicit breaking change to React support has\n  been made in this release, but this is to signify going forward, breaking changes for React 16 or\n  React 17 may come via non-major semver releases.\n\n  Please refer this community post for more details:\n  https://community.developer.atlassian.com/t/rfc-78-dropping-support-for-react-16-and-rendering-in-a-react-18-concurrent-root-in-jira-and-confluence/87026\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.2.0\n\n### Minor Changes\n\n- [#109060](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/109060)\n  [`4660ec858a305`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4660ec858a305) -\n  Update `React` from v16 to v18\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.1.4\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.1.3\n\n### Patch Changes\n\n- Updated dependencies\n\n## 1.1.2\n\n### Patch Changes\n\n- [#124164](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/124164)\n  [`58941fa1d332a`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/58941fa1d332a) -\n  All `react` unit tests will now run against `react@16` and `react@18` on CI.\n\n## 1.1.1\n\n### Patch Changes\n\n- [#92913](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/92913)\n  [`8f7e827e0978`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8f7e827e0978) -\n  Some Pragmatic drag and drop packages did not have `\"author\"` and or `\"license\"` attributes set in\n  their `package.json` file. These missing attributes have now been added where required.\n\n  ```diff\n  + \"author\": \"Atlassian Pty Ltd\",\n  + \"license\": \"Apache-2.0\",\n  ```\n\n  All Pragmatic drag and drop packages were already licensed under `Apache-2.0` (see `LICENSE`\n  files), but the `\"license\"` attribute in some `package.json` files was missing.\n\n## 1.1.0\n\n### Minor Changes\n\n- [#87853](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/87853)\n  [`54e884fd8d96`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/54e884fd8d96) -\n  Increasing `react` `peerDependency` range to include `react@17` and `react@18`.\n\n## 1.0.4\n\n### Patch Changes\n\n- [#84398](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84398)\n  [`77694db987fc`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/77694db987fc) -\n  Public release of Pragmatic drag and drop documentation\n\n## 1.0.3\n\n### Patch Changes\n\n- [#84250](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/84250)\n  [`a1cc31800621`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a1cc31800621) -\n  Internal refactor: now relying on automatic fallback insertion for `token()`. This change provides\n  an improved experience for consumers who don't have Atlassian Design tokens enabled.\n\n## 1.0.2\n\n### Patch Changes\n\n- [#83702](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83702)\n  [`4d9e25ab4eaa`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4d9e25ab4eaa) -\n  Updating the descriptions of Pragmatic drag and drop packages, so they each provide a consistent\n  description to various consumers, and so they are consistently formed amongst each other.\n  - `package.json` `description`\n  - `README.md`\n  - Website documentation\n\n## 1.0.1\n\n### Patch Changes\n\n- [#83116](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/83116)\n  [`8d4e99057fe0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8d4e99057fe0) -\n  Upgrade Typescript from `4.9.5` to `5.4.2`\n\n## 1.0.0\n\n### Major Changes\n\n- [#70616](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/70616)\n  [`8fbaead12358`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8fbaead12358) -\n  As a part of our `1.0` release of Pragmatic drag and drop, we have renamed\n  `@atlaskit/pragmatic-drag-and-drop-react-indicator` to\n  `@atlaskit/pragmatic-drag-and-drop-react-drop-indicator` to improve naming consistency.\n\n  For a detailed explanation of these changes, and how to upgrade (automatically) to `1.0` please\n  see our\n  [1.0 upgrade guide](http://atlassian.design/components/pragmatic-drag-and-drop/core-package/upgrade-guides/upgrade-guide-for-1.0)\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.18.0\n\n### Minor Changes\n\n- [#62704](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/62704)\n  [`842b8e893c33`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/842b8e893c33) -\n  [ux] Making small change so that the line and terminal have the same color\n  (`\"color.border.selected\"`). Previously, the line (unintentionally) had a slightly different shade\n  of blue.\n\n## 0.17.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.17.0\n\n### Minor Changes\n\n- [#42620](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/42620)\n  [`0e076ee05b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0e076ee05b0) - Moving\n  our tree exports that are used in Confluence from `experimental` to `stable`.\n\n  ```diff\n  - @atlaskit/pragmatic-drag-and-drop-react-indicator/experimental/tree-item\n  + @atlaskit/pragmatic-drag-and-drop-react-indicator/tree-item\n  ```\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.16.6\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.16.5\n\n### Patch Changes\n\n- [#39749](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/39749)\n  [`e6b69f455c3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e6b69f455c3) - Connect\n  yarn changeset to packages, upgrade adf-schema\n\n## 0.16.4\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.16.3\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.16.2\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.16.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.16.0\n\n### Minor Changes\n\n- [#37722](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/37722)\n  [`3ccb90e7480`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3ccb90e7480) - Changed\n  folder structure of package. There should be no visible changes.\n\n## 0.15.0\n\n### Minor Changes\n\n- [#37280](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/37280)\n  [`975218de587`](https://bitbucket.org/atlassian/atlassian-frontend/commits/975218de587) - Adds a\n  terminal to the `DropIndicator` in the `/box` entrypoint. We now recommend most consumers use\n  lines with terminals.\n\n  A new entrypoint `/box-without-terminal` has been added, which contains the old appearance.\n\n## 0.14.4\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.14.3\n\n### Patch Changes\n\n- [#34443](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/34443)\n  [`61cb5313358`](https://bitbucket.org/atlassian/atlassian-frontend/commits/61cb5313358) - Removing\n  unused dependencies and dev dependencies\n\n## 0.14.2\n\n### Patch Changes\n\n- [#33793](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33793)\n  [`9d00501a414`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9d00501a414) - Ensure\n  legacy types are published for TS 4.5-4.8\n\n## 0.14.1\n\n### Patch Changes\n\n- [#33649](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33649)\n  [`41fae2c6f68`](https://bitbucket.org/atlassian/atlassian-frontend/commits/41fae2c6f68) - Upgrade\n  Typescript from `4.5.5` to `4.9.5`\n\n## 0.14.0\n\n### Minor Changes\n\n- [#33344](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33344)\n  [`9fd8556db17`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9fd8556db17) - Internal\n  folder name structure change\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.13.0\n\n### Minor Changes\n\n- [#33262](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33262)\n  [`34ed7b2ec63`](https://bitbucket.org/atlassian/atlassian-frontend/commits/34ed7b2ec63) - We have\n  changed the name of our drag and drop packages to align on the single name of \"Pragmatic drag and\n  drop\"\n\n  ```diff\n  - @atlaskit/drag-and-drop\n  + @atlaskit/pragmatic-drag-and-drop\n\n  - @atlaskit/drag-and-drop-autoscroll\n  + @atlaskit/pragmatic-drag-and-drop-autoscroll\n\n  - @atlaskit/drag-and-drop-hitbox\n  + @atlaskit/pragmatic-drag-and-drop-hitbox\n\n  - @atlaskit/drag-and-drop-indicator\n  + @atlaskit/pragmatic-drag-and-drop-react-indicator\n  # Note: `react` was added to this package name as our indicator package is designed for usage with `react`.\n\n  - @atlaskit/drag-and-drop-live-region\n  + @atlaskit/pragmatic-drag-and-drop-live-region\n\n  - @atlaskit/drag-and-drop-react-beautiful-dnd-migration\n  + @atlaskit/pragmatic-drag-and-drop-react-beautiful-dnd-migration\n\n  - @atlaskit/drag-and-drop-docs\n  + @atlaskit/pragmatic-drag-and-drop-docs\n  ```\n\n  The new `@atlaskit/pragmatic-drag-and-drop*` packages will start their initial versions from where\n  the ``@atlaskit/drag-and-drop*` packages left off. Doing this will make it easier to look back on\n  changelogs and see how the packages have progressed.\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.12.0\n\n### Minor Changes\n\n- [#33258](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/33258)\n  [`56507598609`](https://bitbucket.org/atlassian/atlassian-frontend/commits/56507598609) - Skip\n  minor dependency bump\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.11.1\n\n### Patch Changes\n\n- [#32424](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32424)\n  [`2e01c9c74b5`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2e01c9c74b5) - DUMMY\n  remove before merging to master; dupe adf-schema via adf-utils\n\n## 0.11.0\n\n### Minor Changes\n\n- [#32212](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/32212)\n  [`e2a4f1aeab0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e2a4f1aeab0) - Changing\n  experimental tree item border radius (`2px`) to match border radius of Confluence tree items\n  (`3px`)\n\n## 0.10.6\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.10.5\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.10.4\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.10.3\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.10.2\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.10.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.10.0\n\n### Minor Changes\n\n- [#30953](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/30953)\n  [`90901f5bbe0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/90901f5bbe0) - Replace\n  default entry point of `undefined` with `{}`.\n\n  > **NOTE:** Importing from the default entry point isn't supported. _Please use individual entry\n  > points in order to always obtain minimum kbs._\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.9.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.9.0\n\n### Minor Changes\n\n- [#29945](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/29945)\n  [`fe6772a3719`](https://bitbucket.org/atlassian/atlassian-frontend/commits/fe6772a3719) - Dramatic\n  update to **experimental** tree-item outputs. These outputs should only be used right now by\n  Confluence Page Tree. Changes are being communicated face to face with Confluence team members\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.8.2\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.8.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.8.0\n\n### Minor Changes\n\n- [#29562](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/29562)\n  [`2112070b91a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2112070b91a) - We have\n  changed the API for our _experimental_ tree drop indicator. Consumers should not be using the\n  _experimental_ tree drop indicator in production before speaking with the Design System team.\n\n  This change makes the tree item drop indicator API and usage consistent with our stable box drop\n  indicator\n\n  ```diff\n  + // The import path to the tree item drop indicator has changed\n  - import { DropIndicator } from '@atlaskit/drag-and-drop-indicator/tree';\n  + import { DropIndicator } from '@atlaskit/drag-and-drop-indicator/tree-item';\n\n  - // Render prop API with className as public API\n  - <DropIndicator edge={edge}>({className}) => <div className={className} />\n  + // Conditional rendering of an element\n  + <div style={{position: 'relative'}}>{edge ? <DropIndicator edge={edge} /></div>}\n  ```\n\n  The `hasTerminal` prop has also been removed from the tree drop indicator as for trees the current\n  design is that all lines have a terminal on them.\n\n## 0.7.4\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.7.3\n\n### Patch Changes\n\n- [#28324](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/28324)\n  [`6455cf006b3`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6455cf006b3) - Builds\n  for this package now pass through a tokens babel plugin, removing runtime invocations of the\n  tokens() function and improving performance.\n\n## 0.7.2\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.7.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.7.0\n\n### Minor Changes\n\n- [#27976](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/27976)\n  [`ace261c5753`](https://bitbucket.org/atlassian/atlassian-frontend/commits/ace261c5753) - For the\n  experimental tree drop indicator, we have changed the `gap` and `inset` from `number` to `string`\n  to align with our `Box` line indicator.\n\n  Note: consumers should not be using the _experimental_ tree drop indicator in production. We are\n  exposing this work in progress component for internal experimentation purposes.\n\n## 0.6.2\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.6.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.6.0\n\n### Minor Changes\n\n- [#26749](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/26749)\n  [`9066b866ed1`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9066b866ed1) - The\n  `edge` prop on the box drop indicator `@atlaskit/drag-and-drop-indicator/box` was _previously_\n  **optional** and is _now_ **required**.\n\n  For the fastest possible applications, it is important that `<DropIndicator>` is only doing work\n  when it needs to. Making `edge` **required** forces consumers to only render the `<DropIndicator>`\n  when it is actually doing something. We are using the type system to ensure the fastest possible\n  usage\n\n  ```diff\n  - <DropIndicator edge={closestEdge} />\n  + { closestEdge && <DropIndicator edge={closestEdge} /> }\n  ```\n\n## 0.5.2\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.5.1\n\n### Patch Changes\n\n- [#24874](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24874)\n  [`8cc2f888c83`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8cc2f888c83) - Upgrade\n  Typescript from `4.3.5` to `4.5.5`\n\n## 0.5.0\n\n### Minor Changes\n\n- [#25485](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/25485)\n  [`5b37b07dc94`](https://bitbucket.org/atlassian/atlassian-frontend/commits/5b37b07dc94) - Moving\n  from `@emotion/core@10` to `@emotion/react@11` to line up `@emotion` usage with the rest of the\n  Design System\n\n## 0.4.2\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.4.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.4.0\n\n### Minor Changes\n\n- [#24920](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24920)\n  [`01232de241c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/01232de241c) - The\n  `gap` prop now takes a CSS string instead of a number.\n\n## 0.3.0\n\n### Minor Changes\n\n- [#25007](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/25007)\n  [`17950433a70`](https://bitbucket.org/atlassian/atlassian-frontend/commits/17950433a70) - Touching\n  package to release re-release previous version. The previous (now deprecated) version did not have\n  it's entry points built correctly\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.2.2\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.2.1\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.2.0\n\n### Minor Changes\n\n- [#24613](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24613)\n  [`e26c936c610`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e26c936c610) - We have\n  improved our naming consistency across our drag and drop packages.\n  - The exports from `@atlaskit/drag-and-drop-indicator` have now been shifted over to\n    `@atlaskit/drag-and-drop-indicator/box`. `@atlaskit/drag-and-drop-indicator` will no longer be\n    useable from the root entry point\n\n  ```diff\n  - import { DropIndicator } from '@atlaskit/drag-and-drop-indicator';\n  + import { DropIndicator } from '@atlaskit/drag-and-drop-indicator/box';\n  ```\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.1.0\n\n### Minor Changes\n\n- [#24532](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24532)\n  [`73427c38077`](https://bitbucket.org/atlassian/atlassian-frontend/commits/73427c38077) - Initial\n  release of `@atlaskit/drag-and-drop` packages 🎉\n\n### Patch Changes\n\n- Updated dependencies\n\n## 0.0.1\n\n### Patch Changes\n\n- [#24492](https://bitbucket.org/atlassian/atlassian-frontend/pull-requests/24492)\n  [`8d4228767b0`](https://bitbucket.org/atlassian/atlassian-frontend/commits/8d4228767b0) - Upgrade\n  Typescript from `4.2.4` to `4.3.5`.\n- Updated dependencies\n"
  },
  {
    "path": "packages/react-drop-indicator/LICENSE.md",
    "content": "Copyright 2022 Atlassian Pty Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in\ncompliance with the License. You may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is\ndistributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\nimplied. See the License for the specific language governing permissions and limitations under the\nLicense.\n"
  },
  {
    "path": "packages/react-drop-indicator/README.md",
    "content": "## Pragmatic drag and drop\n\nAn optional Pragmatic drag and drop package containing `react` components that provide a visual indication about what the user will achieve when the drop (eg lines).\n\n[📖 Documentation](https://atlassian.design/components/pragmatic-drag-and-drop/).\n"
  },
  {
    "path": "packages/react-drop-indicator/__tests__/unit/react-safety.test.tsx",
    "content": "import React from 'react';\n\nimport { doesRenderWithSsr } from '@atlassian/ssr-tests';\n\nimport { DropIndicator as Border } from '../../src/border';\nimport { DropIndicator as Box } from '../../src/box';\nimport { GroupDropIndicator } from '../../src/group';\nimport { DropIndicator as ListItem } from '../../src/list-item';\nimport { DropIndicator as TreeItem } from '../../src/tree-item';\n\ndescribe('box', () => {\n\tconst value = () => <Box edge=\"top\" />;\n\n\ttest('can be suspended', async () => {\n\t\tawait expect(value).toBeSuspendable();\n\t});\n\n\ttest('passes strict mode', async () => {\n\t\tawait expect(value).toPassStrictMode();\n\t});\n\n\ttest('can be rendered on the server and hydrated', async () => {\n\t\texpect(await doesRenderWithSsr(value())).toBe(true);\n\t});\n});\n\ndescribe('border', () => {\n\tconst value = () => <Border />;\n\n\ttest('can be suspended', async () => {\n\t\tawait expect(value).toBeSuspendable();\n\t});\n\n\ttest('passes strict mode', async () => {\n\t\tawait expect(value).toPassStrictMode();\n\t});\n\n\ttest('can be rendered on the server and hydrated', async () => {\n\t\texpect(await doesRenderWithSsr(value())).toBe(true);\n\t});\n});\n\ndescribe('group', () => {\n\tconst value = () => (\n\t\t<GroupDropIndicator isActive>\n\t\t\t<div>Content</div>\n\t\t</GroupDropIndicator>\n\t);\n\n\ttest('can be suspended', async () => {\n\t\tawait expect(value).toBeSuspendable();\n\t});\n\n\ttest('passes strict mode', async () => {\n\t\tawait expect(value).toPassStrictMode();\n\t});\n\n\ttest('can be rendered on the server and hydrated', async () => {\n\t\texpect(await doesRenderWithSsr(value())).toBe(true);\n\t});\n});\n\ndescribe('list-item', () => {\n\tconst value = () => (\n\t\t<ListItem\n\t\t\tinstruction={{\n\t\t\t\toperation: 'reorder-before',\n\t\t\t\taxis: 'vertical',\n\t\t\t\tblocked: false,\n\t\t\t}}\n\t\t/>\n\t);\n\n\ttest('can be suspended', async () => {\n\t\tawait expect(value).toBeSuspendable();\n\t});\n\n\ttest('passes strict mode', async () => {\n\t\tawait expect(value).toPassStrictMode();\n\t});\n\n\ttest('can be rendered on the server and hydrated', async () => {\n\t\texpect(await doesRenderWithSsr(value())).toBe(true);\n\t});\n});\n\ndescribe('tree-item', () => {\n\tconst value = () => (\n\t\t<TreeItem\n\t\t\tinstruction={{\n\t\t\t\ttype: 'reorder-above',\n\t\t\t\tcurrentLevel: 0,\n\t\t\t\tindentPerLevel: 16,\n\t\t\t}}\n\t\t/>\n\t);\n\n\ttest('can be suspended', async () => {\n\t\tawait expect(value).toBeSuspendable();\n\t});\n\n\ttest('passes strict mode', async () => {\n\t\tawait expect(value).toPassStrictMode();\n\t});\n\n\ttest('can be rendered on the server and hydrated', async () => {\n\t\texpect(await doesRenderWithSsr(value())).toBe(true);\n\t});\n});\n"
  },
  {
    "path": "packages/react-drop-indicator/afm-jira/tsconfig.json",
    "content": "{\n\t\"extends\": \"../../../../tsconfig.local-consumption.json\",\n\t\"compilerOptions\": {\n\t\t\"target\": \"es5\",\n\t\t\"outDir\": \"../../../../../jira/tsDist/@atlaskit__pragmatic-drag-and-drop-react-drop-indicator/app\",\n\t\t\"rootDir\": \"../\",\n\t\t\"composite\": true,\n\t\t\"noCheck\": true\n\t},\n\t\"include\": [\n\t\t\"../src/**/*.ts\",\n\t\t\"../src/**/*.tsx\"\n\t],\n\t\"exclude\": [\n\t\t\"../src/**/__tests__/*\",\n\t\t\"../src/**/*.test.*\",\n\t\t\"../src/**/test.*\",\n\t\t\"../src/**/examples.*\",\n\t\t\"../src/**/examples/*\",\n\t\t\"../src/**/examples/**/*\",\n\t\t\"../src/**/*.stories.*\",\n\t\t\"../src/**/stories/*\",\n\t\t\"../src/**/stories/**/*\"\n\t],\n\t\"references\": [\n\t\t{\n\t\t\t\"path\": \"../../core/afm-jira/tsconfig.json\"\n\t\t},\n\t\t{\n\t\t\t\"path\": \"../../hitbox/afm-jira/tsconfig.json\"\n\t\t},\n\t\t{\n\t\t\t\"path\": \"../../../design-system/tokens/afm-jira/tsconfig.json\"\n\t\t}\n\t]\n}\n"
  },
  {
    "path": "packages/react-drop-indicator/afm-products/tsconfig.json",
    "content": "{\n\t\"extends\": \"../../../../tsconfig.local-consumption.json\",\n\t\"compilerOptions\": {\n\t\t\"target\": \"es5\",\n\t\t\"outDir\": \"../../../../../tsDist/@atlaskit__pragmatic-drag-and-drop-react-drop-indicator/app\",\n\t\t\"rootDir\": \"../\",\n\t\t\"composite\": true,\n\t\t\"noCheck\": true\n\t},\n\t\"include\": [\n\t\t\"../src/**/*.ts\",\n\t\t\"../src/**/*.tsx\"\n\t],\n\t\"exclude\": [\n\t\t\"../src/**/__tests__/*\",\n\t\t\"../src/**/*.test.*\",\n\t\t\"../src/**/test.*\",\n\t\t\"../src/**/examples.*\",\n\t\t\"../src/**/examples/*\",\n\t\t\"../src/**/examples/**/*\",\n\t\t\"../src/**/*.stories.*\",\n\t\t\"../src/**/stories/*\",\n\t\t\"../src/**/stories/**/*\"\n\t],\n\t\"references\": [\n\t\t{\n\t\t\t\"path\": \"../../core/afm-products/tsconfig.json\"\n\t\t},\n\t\t{\n\t\t\t\"path\": \"../../hitbox/afm-products/tsconfig.json\"\n\t\t},\n\t\t{\n\t\t\t\"path\": \"../../../design-system/tokens/afm-products/tsconfig.json\"\n\t\t}\n\t]\n}\n"
  },
  {
    "path": "packages/react-drop-indicator/constellation/index/about.mdx",
    "content": "---\norder: 0\ntitle: React drop indicator\ndescription:\n  An optional package containing react components that provide a visual indication about what the\n  user will achieve when the drop (eg lines)\n---\n\nimport SectionMessage from '@atlaskit/section-message';\nimport TreeItemExample from '../../examples/constellation/tree-item';\nimport { TypeExample } from '../../examples/constellation/box/box-type';\nimport { AppearanceExample } from '../../examples/constellation/box/box-appearance';\nimport { EdgeExample } from '../../examples/constellation/box/box-edge';\nimport { GapExample } from '../../examples/constellation/box/box-gap';\nimport { OverlapExample } from '../../examples/constellation/box/box-overlap';\nimport { IndentExample } from '../../examples/constellation/box/box-indent';\nimport { ListItemVerticalExample } from '../../examples/constellation/list-item/list-item-vertical';\nimport { ListItemHorizontalExample } from '../../examples/constellation/list-item/list-item-horizontal';\nimport { BorderShowcaseExample } from '../../examples/constellation/border/border-showcase';\nimport { GroupExample } from '../../examples/constellation/group/group-list';\n\nThis package contains `react` components to display hitbox information, which is usually generated\nby our optional [hitbox package](/components/pragmatic-drag-and-drop/optional-packages/hitbox). You\nare also able to create your own drop indicators to render hitbox information.\n\nThese packages embody our\n[design guidelines](/components/pragmatic-drag-and-drop/design-guidelines).\n\n<SectionMessage>\n\nYou are welcome to reimplement this small optional package using your own tech stack.\n\nThis package depends on:\n\n- [the core package](/components/pragmatic-drag-and-drop/core-package)\n- [the hitbox package](/components/pragmatic-drag-and-drop/optional-packages/hitbox)\n- [`react`](https://react.dev/)\n- [`@atlaskit/tokens`](/components/tokens) for colors\n- [`compiled`](https://compiledcssinjs.com/) for styling\n\n[Compiled](https://compiledcssinjs.com/) is a styling solution with a tiny runtime (`~260B`) that\nyou can use along side your existing styling solution(s). As long as your bundler supports CSS\nimports (eg `import './styles.css'`) then you shouldn't need to do anything!\n[More information for if you run into any difficulties](https://community.developer.atlassian.com/t/rfc-73-migrating-our-components-to-compiled-css-in-js/85953).\n\n</SectionMessage>\n\n<SectionMessage title=\"For Atlassians\" appearance='information'>\n\nPlease avoid creating your own drop indicators and use our provided ones. This helps us improve user\nexperience consistency and reduce bundle sizes.\n\n</SectionMessage>\n\n<SectionMessage title=\"React 19\" appearance='information'>\n\nWe expect this package to work with React 19 and have included it in the supported peer dependency\nrange.\n\nWe do not currently test against React 19 directly, so there is a small risk of issues. If you have\nany problems, please raise an issue on\n[Github](https://github.com/atlassian/pragmatic-drag-and-drop) and we can look into it.\n\n</SectionMessage>\n\n## `position: relative`\n\nGenerally speaking, all drop indicators leverage `position:absolute` and will be positioned relative\nto the closest parent with `position:relative` (or any other\n[non-static position](https://developer.mozilla.org/en-US/docs/Web/CSS/position)). The exception to\nthis is the [group drop indicator](#group).\n\n```tsx\nconst itemStyles = css({\n\tposition: 'relative',\n\tpadding: token('space.100'),\n\tbackgroundColor: token('elevation.surface'),\n});\n\nexport function Item({\n\tcontent,\n\tinstruction,\n}: {\n\tcontent: ReactNode;\n\tinstruction: Instruction | null;\n}) {\n\treturn (\n\t\t<div css={itemStyles}>\n\t\t\t<span>{content}</span>\n\t\t\t{instruction && <DropIndicator edge={instruction} />}\n\t\t</div>\n\t);\n}\n```\n\n## List item\n\n<SectionMessage>\n\n[`position: relative` needed on parent](#position-relative)\n\n</SectionMessage>\n\nA drop indicator to draw a drop indicator for list item operations (`\"reorder-before\"`, `\"combine\"`\nand `\"reorder-after\"`). This output is commonly used in to visualize the\n[list item hitbox](/components/pragmatic-drag-and-drop/optional-packages/hitbox) results.\n\n```ts\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/list-item';\n```\n\nThis drop indicator will internally render either a [box drop indicator](#box) for\n`\"reorder-before\"` and `\"reorder-after\"` operations, and a [border drop indicator](#border) for\n`\"combine\"`.\n\n#### Props\n\n- `instruction`: the `Instruction` to be rendered.\n  [See hitbox for details on instructions](/components/pragmatic-drag-and-drop/optional-packages/hitbox#list-item)\n- `lineGap`: the gap between list items ([see box > gap](#gap))\n- `lineType`: the variant of lines to be used ([see box > type](#type))\n\n#### Vertical list\n\n<Example Component={ListItemVerticalExample} appearance=\"showcase-only\" />\n\n#### Horizontal list\n\n<Example Component={ListItemHorizontalExample} appearance=\"showcase-only\" />\n\n## Box\n\n<SectionMessage>\n\n[`position: relative` needed on parent](#position-relative)\n\n</SectionMessage>\n\nA drop indicator to draw a line on an `Edge` (`top`, `right`, `bottom`, `left`). This output is\ncommonly used in to visualize the\n[box hitbox](/components/pragmatic-drag-and-drop/optional-packages/hitbox) results.\n\n```ts\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';\n```\n\nIf the element you want to position against has a `border`, you will need to wrap the element in\nanother element with `position:relative` for `gap` to work correctly.\n[Information about `gap`](#gap).\n\n```tsx\n// position:relative on the parent of the element with a border\nconst relativeStyles = css({\n\tposition: 'relative',\n});\n\nconst itemStyles = css({\n\tpadding: token('space.100'),\n\tbackgroundColor: token('elevation.surface'),\n\t// Our item has a border\n\tborderWidth: token('border.width'),\n\tborderStyle: 'solid',\n\tborderColor: token('color.border'),\n});\n\nexport function Item({ content, closestEdge }: { content: ReactNode; closestEdge: Edge | null }) {\n\treturn (\n\t\t<div css={relativeStyles}>\n\t\t\t<div css={itemStyles}>\n\t\t\t\t<span>{content}</span>\n\t\t\t\t{closestEdge && <DropIndicator edge={closestEdge} />}\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n```\n\n### Edge\n\nDrop indicators are rendered on for a provided `Edge` (`top`, `right`, `bottom`, `left`)\n\n<Example Component={EdgeExample} appearance=\"showcase-only\" />\n\nIn order to help people be successful with performance, we have made `edge` a _required_ prop. This\nwill force you to only render the indicator when it is relevant (minimizing `react` and DOM nodes)\n\n```tsx\nexport function Item() {\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\tconst [closestEdge, setClosestEdge] = useState<Edge | null>(null);\n\n\tuseEffect(() => {\n\t\tconst el = ref.current;\n\t\tinvariant(el);\n\t\treturn combine(\n\t\t\tdraggable({\n\t\t\t\telement: el,\n\t\t\t}),\n\t\t\tdropTargetForElements({\n\t\t\t\telement: el,\n\t\t\t\t// just being simple and always using the 'bottom' edge\n\t\t\t\t// ideally this is set using our `@atlaskit/pragmatic-drag-and-drop-hitbox/box` package\n\t\t\t\tonDragStart: () => setClosestEdge('bottom'),\n\t\t\t\tonDragEnter: () => setClosestEdge('bottom'),\n\t\t\t\tonDragLeave: () => setClosestEdge(null),\n\t\t\t\tonDrop: () => setClosestEdge(null),\n\t\t\t}),\n\t\t);\n\t}, []);\n\n\treturn (\n\t\t<div css={relativeStyles} ref={ref}>\n\t\t\t<div css={itemStyles}>item A</div>\n\t\t\t{/* DropIndicator is being conditionally rendered */}\n\t\t\t{closestEdge && <DropIndicator edge={closestEdge} />}\n\t\t</div>\n\t);\n}\n```\n\n### Type\n\n##### `\"terminal\"`\n\n- display a terminal (circle with a whole in it) at the start of the line\n- half the size of the terminal will \"bleed out\" of the containing element\n- **first** preference for Atlassian experiences\n\n##### `\"terminal-no-bleed\"`\n\n- display a terminal (circle with a whole in it) at the start of the line\n- the terminal will _not_ \"bleed out\" of the containing element\n- this is useful in situations where the terminal cannot bleed out (such as when inside scroll\n  containers with no padding)\n- **second** preference for Atlassian experiences\n\n##### `\"no-terminal\"`\n\n- display a full width line with no terminal\n- **third** preference for Atlassian experiences\n\n<Example Component={TypeExample} appearance=\"showcase-only\" />\n\n### Appearance\n\nThe drop indicator can be a `\"standard\"` (blue) line or a `\"warning\"` (yellow) line.\n\n<Example Component={AppearanceExample} appearance=\"showcase-only\" />\n\n### Gap\n\nOften you have drop targets that are separated by a gap (eg in a list). You can provide this `gap`\nto the drop indicator and the drop indicator will be rendered in the middle of the gap.\n\n<SectionMessage>\n\nIf you want to continue to show a drop indicator when _between_ drop targets, it is also important\nthat you enable\n[stickiness for your drop targets](https://atlassian.design/components/pragmatic-drag-and-drop/core-package/drop-targets#getissticky).\n\n</SectionMessage>\n\n<Example Component={GapExample} appearance=\"showcase-only\" />\n\n`gap` is helpful to ensure that the drop indicator stays in the same visual position when moving\nfrom one `Edge` of a drop target to another `Edge` of another drop target when there is space\nbetween the drop targets.\n\n<Example Component={OverlapExample} appearance=\"showcase-only\" />\n\n### Indent\n\nFor some experiences, you may need to indent the drop indicator. An example of this is in a tree\ninterface where the drop indicator can shift based on which level the item belongs to.\n\n<Example Component={IndentExample} appearance=\"showcase-only\" />\n\n## Border\n\n<SectionMessage>\n\n[`position: relative` needed on parent](#position-relative)\n\n</SectionMessage>\n\nA drop indicator which draws a border around an element. Right now, this component uses\n`position:absolute` rather than being a true border in order to support `tree-item` indenting. So as\nwith the other drop indicators, this component will be rendered relative to the closest\n`position:relative` parent.\n\n#### Props\n\n- `appearance`: `'default' | 'warning'`: used to control the color of the border\n- `indent`: can be used to indent the border (needed for `tree-item`s).\n\n<Example Component={BorderShowcaseExample} appearance=\"showcase-only\" />\n\n## Group\n\nOur group drop indicator is helpful to indicate that you are over a group of items. It is currently\nlimited in the amount of control it provides.\n\nUnlike all other drop indicators:\n\n- The `GroupDropIndicator` does not need a `position:relative` parent (it wraps DOM elements)\n- It is always rendered, and it's visibility is toggled with the `isActive` prop.\n- We've found it's often helpful to make a `GroupDropIndicator` a drop target\n- `GroupDropIndicator` exposes a `ref` so you can wire it up to be a drop target.\n\n<Example Component={GroupExample} appearance=\"showcase-only\" />\n\n```tsx\nimport { GroupDropIndicator } from '@atlassian/pragmatic-drag-and-drop-react-drop-indicator/group';\n\nfunction isInnerMostGroup({ location, self }: ElementDropTargetEventBasePayload): boolean {\n\tconst [innerMost] = location.current.dropTargets.filter(\n\t\t(dropTarget) => dropTarget.data.type === 'menu-item-group',\n\t);\n\treturn innerMost?.element === self.element;\n}\n\nexport function MyMenuItemGroup() {\n\tconst [isInnerMostOver, setIsInnerMostOver] = useState<boolean>(false);\n\tconst ref = useRef<HTMLDivElement | null>(null);\n\n\tuseEffect(() => {\n\t\tconst element = ref.current;\n\t\tinvariant(element);\n\t\treturn dropTargetForElements({\n\t\t\telement,\n\t\t\tcanDrop: ({ source }) => source.data.type === 'menu-item',\n\t\t\tgetData: () => ({ type: 'menu-item-group' }),\n\t\t\tonDragStart: (args) => setIsInnerMostOver(isInnerMostGroup(args)),\n\t\t\tonDropTargetChange: (args) => setIsInnerMostOver(isInnerMostGroup(args)),\n\t\t\tonDrop: () => setIsInnerMostOver(false),\n\t\t});\n\t}, []);\n\n\treturn (\n\t\t<GroupDropIndicator isActive={isInnerMostOver} ref={ref}>\n\t\t\t<OurLinkMenuItem />\n\t\t\t<OurButtonItem />\n\t\t\t<OurFlyoutItem />\n\t\t\t<OurExpandableItem />\n\t\t</GroupDropIndicator>\n\t);\n}\n```\n\n## Tree item\n\n<SectionMessage appearance=\"warning\">\n\nThe usage of tree item is no longer encouraged. Please now use our more flexible\n[list item](#list-item) which can also be used to power trees.\n\n</SectionMessage>\n\n<SectionMessage>\n\n[`position: relative` needed on parent](#position-relative)\n\n</SectionMessage>\n\nA drop indicator used to visualize a\n[tree item hitbox `Instruction`](/components/pragmatic-drag-and-drop/optional-packages/hitbox).\n\n- A line is used to indicate reordering\n- A border is used to indicate that an item will be made a child (`\"make-child\"`)\n- Blocked instructions are drawn in a warning color. It was an intentional choice to provide users\n  with a visual indication that an `instruction` is blocked during a drag.\n\n```ts\nimport { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/tree-item';\n```\n\n<Example Component={TreeItemExample} appearance=\"showcase-only\" />\n"
  },
  {
    "path": "packages/react-drop-indicator/constellation/index/props.mdx",
    "content": "---\norder: 1\n---\n"
  },
  {
    "path": "packages/react-drop-indicator/examples/00-closest-edge.tsx",
    "content": "import React from 'react';\n\nimport type { Edge } from '../src/types';\n\nimport Card from './internal/card';\nimport Layout from './internal/layout';\n\nconst edges: Edge[] = ['bottom', 'left', 'right', 'top'];\n\nexport default function ClosestEdgeExample(): React.JSX.Element {\n\treturn (\n\t\t<React.StrictMode>\n\t\t\t<div>\n\t\t\t\t<Layout testId=\"layout--without-gap\">\n\t\t\t\t\t{edges.map((edge) => (\n\t\t\t\t\t\t<Card key={edge} edge={edge}>\n\t\t\t\t\t\t\t{edge}\n\t\t\t\t\t\t</Card>\n\t\t\t\t\t))}\n\t\t\t\t</Layout>\n\t\t\t\t<Layout testId=\"layout--with-gap\">\n\t\t\t\t\t{edges.map((edge) => (\n\t\t\t\t\t\t<Card key={edge} edge={edge} gap=\"32px\">\n\t\t\t\t\t\t\t{edge}\n\t\t\t\t\t\t</Card>\n\t\t\t\t\t))}\n\t\t\t\t</Layout>\n\t\t\t</div>\n\t\t</React.StrictMode>\n\t);\n}\n"
  },
  {
    "path": "packages/react-drop-indicator/examples/01-gap.tsx",
    "content": "import React from 'react';\n\nimport Card from './internal/card';\nimport Layout from './internal/layout';\n\nconst gaps = ['32px', '16px', '8px', '4px', '0px'];\n\nexport default function ClosestEdgeExample(): React.JSX.Element {\n\treturn (\n\t\t<React.StrictMode>\n\t\t\t<Layout testId=\"layout\">\n\t\t\t\t{gaps.map((gap) => (\n\t\t\t\t\t<Card key={gap} edge=\"right\" gap={gap}>\n\t\t\t\t\t\t{gap}\n\t\t\t\t\t</Card>\n\t\t\t\t))}\n\t\t\t</Layout>\n\t\t</React.StrictMode>\n\t);\n}\n"
  },
  {
    "path": "packages/react-drop-indicator/examples/11-tree-item.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport React from 'react';\n\nimport { css, jsx } from '@compiled/react';\n\nimport type { Instruction } from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';\n\nimport Layout from './internal/layout';\nimport TreeItem from './internal/tree-item';\n\nconst containerStyles = css({\n\tdisplay: 'flex',\n\tflexDirection: 'column',\n\tgap: 8,\n});\n\nconst data = {\n\tcurrentLevel: 2,\n\tindentPerLevel: 20,\n};\n\nconst instructions: Instruction[] = [\n\t{\n\t\ttype: 'reorder-above',\n\t\t...data,\n\t},\n\t{\n\t\ttype: 'reorder-below',\n\t\t...data,\n\t},\n\t{\n\t\ttype: 'make-child',\n\t\t...data,\n\t},\n\t{\n\t\ttype: 'reparent',\n\t\t...data,\n\t\tdesiredLevel: 1,\n\t},\n\t{\n\t\ttype: 'reparent',\n\t\t...data,\n\t\tdesiredLevel: 0,\n\t},\n];\n\nconst blocked = instructions.map((instruction) => {\n\tif (instruction.type === 'instruction-blocked') {\n\t\treturn instruction;\n\t}\n\tconst updated: Instruction = {\n\t\ttype: 'instruction-blocked',\n\t\tdesired: instruction,\n\t};\n\treturn updated;\n});\n\nconst all: Instruction[] = [...instructions, ...blocked];\n\nexport default function Example({ direction = 'ltr' }: { direction: 'ltr' | 'rtl' }) {\n\treturn (\n\t\t<React.StrictMode>\n\t\t\t<div dir={direction}>\n\t\t\t\t<Layout testId=\"layout--appearance\">\n\t\t\t\t\t<div css={containerStyles}>\n\t\t\t\t\t\t{all.map((instruction, index) => (\n\t\t\t\t\t\t\t<TreeItem instruction={instruction} key={index} {...data} />\n\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t</Layout>\n\t\t\t</div>\n\t\t</React.StrictMode>\n\t);\n}\n\n// For VR testing\nexport function RTLTree() {\n\treturn <Example direction=\"rtl\" />;\n}\n"
  },
  {
    "path": "packages/react-drop-indicator/examples/box-playground.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport React from 'react';\n\nimport { css, jsx } from '@compiled/react';\n\nimport { Stack } from '@atlaskit/primitives/compiled';\nimport { token } from '@atlaskit/tokens';\n\nimport { AppearanceExample } from './constellation/box/box-appearance';\nimport { EdgeExample } from './constellation/box/box-edge';\nimport { GapExample } from './constellation/box/box-gap';\nimport { IndentExample } from './constellation/box/box-indent';\nimport { OverlapExample } from './constellation/box/box-overlap';\nimport { TypeExample } from './constellation/box/box-type';\n\nconst containerStyles = css({\n\tmaxWidth: '710px',\n\tborderWidth: token('border.width'),\n\tborderStyle: 'solid',\n\tborderColor: token('color.border'),\n\tpaddingTop: token('space.200'),\n\tpaddingRight: token('space.200'),\n\tpaddingBottom: token('space.200'),\n\tpaddingLeft: token('space.200'),\n});\n\nexport default function AllExamples() {\n\treturn (\n\t\t<React.StrictMode>\n\t\t\t<div css={containerStyles}>\n\t\t\t\t<Stack space=\"space.400\">\n\t\t\t\t\t<EdgeExample />\n\t\t\t\t\t<TypeExample />\n\t\t\t\t\t<AppearanceExample />\n\t\t\t\t\t<GapExample />\n\t\t\t\t\t<OverlapExample />\n\t\t\t\t\t<IndentExample />\n\t\t\t\t</Stack>\n\t\t\t</div>\n\t\t</React.StrictMode>\n\t);\n}\n"
  },
  {
    "path": "packages/react-drop-indicator/examples/config.jsonc",
    "content": "/**\n * This file is used by the test scaling project to optimise test result caching\n * Examples that are used by tests affect the outcome of tests so must be included when hashing\n * They are defined here so the hashing algorithm doesn't need to search test files for example usage each time\n */\n{\n  \"testExamples\": [\n    \"00-closest-edge.tsx\",\n    \"01-gap.tsx\",\n    \"02-box-without-terminal.tsx\",\n    \"11-tree-item.tsx\"\n  ]\n}\n"
  },
  {
    "path": "packages/react-drop-indicator/examples/constellation/border/border-showcase.tsx",
    "content": "import React from 'react';\n\nimport { Stack } from '@atlaskit/primitives/compiled';\n\nimport { DropIndicator } from '../../../src/border';\nimport { Item } from '../simple-item';\n\nexport function BorderShowcaseExample(): React.JSX.Element {\n\treturn (\n\t\t<Stack space=\"space.200\">\n\t\t\t<Item content=\"default\" dropIndicator={<DropIndicator appearance=\"default\" />} />\n\t\t\t<Item content=\"warning\" dropIndicator={<DropIndicator appearance=\"warning\" />} />\n\t\t</Stack>\n\t);\n}\n"
  },
  {
    "path": "packages/react-drop-indicator/examples/constellation/box/box-appearance.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport { css, jsx } from '@compiled/react';\n\nimport { token } from '@atlaskit/tokens';\n\nimport { DropIndicator } from '../../../src/box';\nimport { Item } from '../simple-item';\n\nconst layoutStyles = css({\n\tdisplay: 'flex',\n\tflexDirection: 'column',\n\tgap: token('space.200'),\n\tmaxWidth: '300px',\n});\n\nexport function AppearanceExample() {\n\treturn (\n\t\t<div css={layoutStyles}>\n\t\t\t<Item\n\t\t\t\tcontent=\"default\"\n\t\t\t\tdropIndicator={<DropIndicator type=\"terminal\" edge=\"top\" appearance=\"default\" />}\n\t\t\t/>\n\t\t\t<Item\n\t\t\t\tcontent=\"warning\"\n\t\t\t\tdropIndicator={<DropIndicator type=\"terminal\" edge=\"top\" appearance=\"warning\" />}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"
  },
  {
    "path": "packages/react-drop-indicator/examples/constellation/box/box-edge.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport { css, jsx } from '@compiled/react';\n\nimport { token } from '@atlaskit/tokens';\n\nimport { DropIndicator } from '../../../src/box';\nimport { Item } from '../simple-item';\n\nconst layoutStyles = css({\n\tdisplay: 'grid',\n\tgridTemplateColumns: 'repeat(4, 1fr)',\n\tgap: token('space.200'),\n});\n\nexport function EdgeExample() {\n\treturn (\n\t\t<div css={layoutStyles}>\n\t\t\t{(['top', 'right', 'bottom', 'left'] as const).map((edge) => (\n\t\t\t\t<Item\n\t\t\t\t\tkey={edge}\n\t\t\t\t\tcontent={edge}\n\t\t\t\t\tdropIndicator={<DropIndicator type=\"terminal\" edge={edge} />}\n\t\t\t\t/>\n\t\t\t))}\n\t\t</div>\n\t);\n}\n"
  },
  {
    "path": "packages/react-drop-indicator/examples/constellation/box/box-gap.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport { css, jsx } from '@compiled/react';\n\nimport { Code } from '@atlaskit/code';\nimport Heading from '@atlaskit/heading';\nimport { Stack, Text } from '@atlaskit/primitives/compiled';\nimport { token } from '@atlaskit/tokens';\n\nimport { DropIndicator } from '../../../src/box';\nimport { Item } from '../simple-item';\n\nconst verticalStyles = css({\n\tdisplay: 'flex',\n\tflexDirection: 'column',\n\tgap: token('space.200'),\n\tmaxWidth: '300px',\n});\n\nconst horizontalStyles = css({\n\tdisplay: 'flex',\n\tflexDirection: 'row',\n\tgap: token('space.400'),\n\talignItems: 'center',\n});\n\nexport function GapExample() {\n\treturn (\n\t\t<Stack space=\"space.400\">\n\t\t\t<Stack space=\"space.100\">\n\t\t\t\t<Heading size=\"small\">Vertical list</Heading>\n\t\t\t\t<Text>\n\t\t\t\t\tGap: <Code>token('space.200')</Code>\n\t\t\t\t</Text>\n\t\t\t\t<div css={verticalStyles}>\n\t\t\t\t\t<Item\n\t\t\t\t\t\tcontent=\"item A\"\n\t\t\t\t\t\tdropIndicator={<DropIndicator type=\"terminal\" edge=\"bottom\" gap={token('space.200')} />}\n\t\t\t\t\t/>\n\t\t\t\t\t<Item\n\t\t\t\t\t\tcontent=\"item B\"\n\t\t\t\t\t\tdropIndicator={<DropIndicator type=\"terminal\" edge=\"bottom\" gap={token('space.200')} />}\n\t\t\t\t\t/>\n\t\t\t\t\t<Item content=\"item C\" />\n\t\t\t\t</div>\n\t\t\t</Stack>\n\t\t\t<Stack space=\"space.100\">\n\t\t\t\t<Heading size=\"small\">Horizontal list</Heading>\n\t\t\t\t<Text>\n\t\t\t\t\tGap: <Code>token('space.400')</Code>\n\t\t\t\t</Text>\n\t\t\t\t<div css={horizontalStyles}>\n\t\t\t\t\t<Item\n\t\t\t\t\t\tcontent=\"item A\"\n\t\t\t\t\t\tdropIndicator={\n\t\t\t\t\t\t\t<DropIndicator type=\"terminal\" edge={'right'} gap={token('space.400')} />\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<Item\n\t\t\t\t\t\tcontent=\"item B\"\n\t\t\t\t\t\tdropIndicator={\n\t\t\t\t\t\t\t<DropIndicator type=\"terminal\" edge={'right'} gap={token('space.400')} />\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t<Item content=\"item C\" />\n\t\t\t\t</div>\n\t\t\t</Stack>\n\t\t</Stack>\n\t);\n}\n"
  },
  {
    "path": "packages/react-drop-indicator/examples/constellation/box/box-indent.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport { useEffect, useState } from 'react';\n\nimport { css, jsx } from '@compiled/react';\n\nimport { Stack, Text } from '@atlaskit/primitives/compiled';\nimport { token } from '@atlaskit/tokens';\n\nimport { DropIndicator } from '../../../src/box';\n\nconst outerStyles = css({\n\tposition: 'relative',\n\tborderWidth: token('border.width'),\n\tborderStyle: 'dotted',\n\tborderColor: token('color.border.discovery'),\n\tminHeight: token('space.400'),\n});\n\nconst maxLevels = 6;\nconst indentPerLevel = token('space.500');\n\nexport function IndentExample() {\n\tconst [level, setLevel] = useState<number>(0);\n\n\t// A little animation to show off the line shifting between points\n\tuseEffect(() => {\n\t\t// Not showing animation if the user prefers reduced motion\n\t\tconst prefersReduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n\n\t\tif (prefersReduceMotion) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst timerId = window.setInterval(() => {\n\t\t\tsetLevel((current) => (current + 1) % (maxLevels + 1));\n\t\t}, 1000);\n\n\t\treturn () => window.clearInterval(timerId);\n\t}, []);\n\n\treturn (\n\t\t<Stack space=\"space.050\">\n\t\t\t<Text color=\"color.text.discovery\">Full width element</Text>\n\t\t\t<div css={outerStyles}>\n\t\t\t\t<DropIndicator\n\t\t\t\t\ttype=\"terminal\"\n\t\t\t\t\tedge=\"bottom\"\n\t\t\t\t\tindent={`calc(${level} * ${indentPerLevel})`}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</Stack>\n\t);\n}\n"
  },
  {
    "path": "packages/react-drop-indicator/examples/constellation/box/box-overlap.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport { css, jsx } from '@compiled/react';\n\nimport { Code } from '@atlaskit/code';\nimport ArrowLeftIcon from '@atlaskit/icon/core/arrow-left';\nimport { Inline, Text } from '@atlaskit/primitives/compiled';\nimport { token } from '@atlaskit/tokens';\n\nimport { DropIndicator } from '../../../src/box';\nimport { Item } from '../simple-item';\n\nconst containerStyles = css({\n\tdisplay: 'flex',\n\tflexDirection: 'row',\n\tgap: token('space.200'),\n\talignItems: 'center',\n});\n\nconst listStyles = css({\n\tdisplay: 'flex',\n\tflexDirection: 'column',\n\tgap: token('space.200'),\n\twidth: '300px',\n\tflexShrink: 0,\n});\n\nconst appTileStyles = css({\n\tbackgroundColor: token('color.background.success.bold'),\n\twidth: token('space.300'),\n\theight: token('space.300'),\n\tflexShrink: 0,\n\tboxSizing: 'border-box',\n\tdisplay: 'flex',\n\tjustifyContent: 'center',\n\talignItems: 'center',\n\tborderRadius: token('radius.small'),\n});\n\nexport function OverlapExample() {\n\treturn (\n\t\t<div css={containerStyles}>\n\t\t\t<div css={listStyles}>\n\t\t\t\t<Item\n\t\t\t\t\tcontent={\n\t\t\t\t\t\t<Text>\n\t\t\t\t\t\t\titem A (<Code>edge: bottom</Code>)\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t}\n\t\t\t\t\tdropIndicator={<DropIndicator type=\"terminal\" edge=\"bottom\" gap={token('space.200')} />}\n\t\t\t\t/>\n\t\t\t\t<Item\n\t\t\t\t\tcontent={\n\t\t\t\t\t\t<Text>\n\t\t\t\t\t\t\titem B (<Code>edge: top</Code>)\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t}\n\t\t\t\t\tdropIndicator={<DropIndicator type=\"terminal\" edge=\"top\" gap={token('space.200')} />}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t\t<div>\n\t\t\t\t<Inline space=\"space.200\" alignBlock=\"center\">\n\t\t\t\t\t<div css={appTileStyles}>\n\t\t\t\t\t\t<ArrowLeftIcon label=\"\" spacing=\"none\" color={token('color.icon.inverse')} />\n\t\t\t\t\t</div>\n\t\t\t\t\t<Text>\n\t\t\t\t\t\tThe <Code>bottom</Code> edge for <em>item A</em> is rendered in the same visual position\n\t\t\t\t\t\tas the\n\t\t\t\t\t\t<Code>top</Code> edge for <em>item B</em>.\n\t\t\t\t\t</Text>\n\t\t\t\t</Inline>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"
  },
  {
    "path": "packages/react-drop-indicator/examples/constellation/box/box-type.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport { css, jsx } from '@compiled/react';\n\nimport { token } from '@atlaskit/tokens';\n\nimport { DropIndicator } from '../../../src/box';\nimport { Item } from '../simple-item';\n\nconst layoutStyles = css({\n\tdisplay: 'flex',\n\tflexDirection: 'column',\n\tgap: token('space.200'),\n\tmaxWidth: '300px',\n});\n\nexport function TypeExample() {\n\treturn (\n\t\t<div css={layoutStyles}>\n\t\t\t<Item\n\t\t\t\tcontent=\"terminal (default)\"\n\t\t\t\tdropIndicator={<DropIndicator type=\"terminal\" edge=\"bottom\" />}\n\t\t\t/>\n\t\t\t<Item\n\t\t\t\tcontent=\"terminal-no-bleed\"\n\t\t\t\tdropIndicator={<DropIndicator type=\"terminal-no-bleed\" edge=\"bottom\" />}\n\t\t\t/>\n\t\t\t<Item\n\t\t\t\tcontent=\"no-terminal\"\n\t\t\t\tdropIndicator={<DropIndicator type=\"no-terminal\" edge=\"bottom\" />}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"
  },
  {
    "path": "packages/react-drop-indicator/examples/constellation/group/group-list.tsx",
    "content": "/* eslint-disable @atlaskit/design-system/use-primitives */\n/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport type { ReactNode } from 'react';\n\nimport { css, jsx } from '@compiled/react';\n\nimport { GroupDropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/group';\nimport { token } from '@atlaskit/tokens';\n\nconst itemStyles = css({\n\tpaddingTop: token('space.100'),\n\tpaddingRight: token('space.100'),\n\tpaddingBottom: token('space.100'),\n\tpaddingLeft: token('space.100'),\n});\n\nfunction Item({ content }: { content: ReactNode }) {\n\treturn <div css={itemStyles}>{content}</div>;\n}\n\nconst styles = css({\n\tpaddingTop: token('space.100'),\n\tpaddingRight: token('space.100'),\n\tpaddingBottom: token('space.100'),\n\tpaddingLeft: token('space.100'),\n});\n\nexport function GroupExample() {\n\treturn (\n\t\t<GroupDropIndicator isActive>\n\t\t\t<div css={styles}>\n\t\t\t\t<Item content=\"item A\" />\n\t\t\t\t<Item content=\"item B\" />\n\t\t\t\t<Item content=\"item C\" />\n\t\t\t\t<Item content=\"item C\" />\n\t\t\t</div>\n\t\t</GroupDropIndicator>\n\t);\n}\n"
  },
  {
    "path": "packages/react-drop-indicator/examples/constellation/list-item/list-item-horizontal.tsx",
    "content": "import React from 'react';\n\nimport { Code } from '@atlaskit/code';\nimport { Inline } from '@atlaskit/primitives/compiled';\n\nimport { DropIndicator } from '../../../src/list-item';\nimport { Item } from '../simple-item';\n\nexport function ListItemHorizontalExample(): React.JSX.Element {\n\treturn (\n\t\t<Inline>\n\t\t\t{(['reorder-before', 'combine', 'reorder-after'] as const).map((operation) => (\n\t\t\t\t<Item\n\t\t\t\t\tkey={operation}\n\t\t\t\t\tdropIndicator={\n\t\t\t\t\t\t<DropIndicator\n\t\t\t\t\t\t\tinstruction={{ operation: operation, axis: 'horizontal', blocked: false }}\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t\tcontent={\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\tOperation: <Code>{operation}</Code>\n\t\t\t\t\t\t</>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t))}\n\t\t</Inline>\n\t);\n}\n"
  },
  {
    "path": "packages/react-drop-indicator/examples/constellation/list-item/list-item-vertical.tsx",
    "content": "import React from 'react';\n\nimport { Code } from '@atlaskit/code';\nimport { Stack } from '@atlaskit/primitives/compiled';\n\nimport { DropIndicator } from '../../../src/list-item';\nimport { Item } from '../simple-item';\n\nexport function ListItemVerticalExample(): React.JSX.Element {\n\treturn (\n\t\t<Stack>\n\t\t\t{(['reorder-before', 'combine', 'reorder-after'] as const).map((operation) => (\n\t\t\t\t<Item\n\t\t\t\t\tkey={operation}\n\t\t\t\t\tdropIndicator={\n\t\t\t\t\t\t<DropIndicator\n\t\t\t\t\t\t\tinstruction={{ operation: operation, axis: 'vertical', blocked: false }}\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t\tcontent={\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\tOperation: <Code>{operation}</Code>\n\t\t\t\t\t\t</>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t))}\n\t\t</Stack>\n\t);\n}\n"
  },
  {
    "path": "packages/react-drop-indicator/examples/constellation/simple-item.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport type { ReactNode } from 'react';\n\nimport { css, jsx } from '@compiled/react';\n\nimport { token } from '@atlaskit/tokens';\n\nconst relativeStyles = css({\n\tposition: 'relative',\n});\n\nconst itemStyles = css({\n\tpaddingTop: token('space.100'),\n\tpaddingRight: token('space.100'),\n\tpaddingBottom: token('space.100'),\n\tpaddingLeft: token('space.100'),\n\tbackgroundColor: token('elevation.surface'),\n\tborderWidth: token('border.width'),\n\tborderStyle: 'solid',\n\tborderColor: token('color.border'),\n});\n\nexport function Item({\n\tcontent,\n\tdropIndicator,\n}: {\n\tcontent: ReactNode;\n\tdropIndicator?: ReactNode;\n}) {\n\treturn (\n\t\t<div css={relativeStyles}>\n\t\t\t<div css={itemStyles}>{content}</div>\n\t\t\t{dropIndicator}\n\t\t</div>\n\t);\n}\n"
  },
  {
    "path": "packages/react-drop-indicator/examples/constellation/tree-item.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport type { CSSProperties } from 'react';\n\nimport { css, jsx } from '@compiled/react';\n\nimport type { Instruction } from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';\nimport { token } from '@atlaskit/tokens';\n\nimport { DropIndicator } from '../../src/tree-item';\nimport Layout from '../internal/layout';\n\nconst containerStyles = css({\n\tdisplay: 'flex',\n\tflexDirection: 'column',\n\tgap: 8,\n});\n\nconst data = {\n\tcurrentLevel: 2,\n\tindentPerLevel: 20,\n};\n\nconst instructions: Instruction[] = [\n\t{\n\t\ttype: 'reorder-above',\n\t\t...data,\n\t},\n\t{\n\t\ttype: 'reorder-below',\n\t\t...data,\n\t},\n\t{\n\t\ttype: 'make-child',\n\t\t...data,\n\t},\n\t{\n\t\ttype: 'reparent',\n\t\t...data,\n\t\tdesiredLevel: 1,\n\t},\n\t{\n\t\ttype: 'reparent',\n\t\t...data,\n\t\tdesiredLevel: 0,\n\t},\n];\n\nconst blocked = instructions.map((instruction) => {\n\tif (instruction.type === 'instruction-blocked') {\n\t\treturn instruction;\n\t}\n\tconst updated: Instruction = {\n\t\ttype: 'instruction-blocked',\n\t\tdesired: instruction,\n\t};\n\treturn updated;\n});\n\nconst all: Instruction[] = [...instructions, ...blocked];\n\nconst itemStyles = css({\n\tdisplay: 'flex',\n\tminWidth: 120,\n\tpadding: 8,\n\talignItems: 'center',\n\tgap: 4,\n\tborderRadius: 3,\n\tposition: 'relative',\n\tpaddingLeft: 'calc(var(--horizontal-indent) + 1ch)',\n\tbackgroundColor: token('elevation.surface.sunken'),\n});\n\nfunction getLabel(instruction: Instruction): string {\n\tif (instruction.type === 'instruction-blocked') {\n\t\treturn `[Blocked] ${getLabel(instruction.desired)}`;\n\t}\n\tif (instruction.type === 'reparent') {\n\t\treturn `reparent (lvl${instruction.currentLevel} → lvl${instruction.desiredLevel})`;\n\t}\n\treturn instruction.type;\n}\n\nfunction TreeItem({\n\tinstruction,\n\tindentPerLevel,\n\tcurrentLevel,\n}: {\n\tinstruction: Instruction;\n\tindentPerLevel: number;\n\tcurrentLevel: number;\n}) {\n\treturn (\n\t\t<div\n\t\t\tcss={itemStyles}\n\t\t\tstyle={\n\t\t\t\t{\n\t\t\t\t\t'--horizontal-indent': `${indentPerLevel * currentLevel}px`,\n\t\t\t\t} as CSSProperties\n\t\t\t}\n\t\t>\n\t\t\t<span>Instruction: </span>\n\t\t\t{/* eslint-disable-next-line @atlaskit/design-system/no-html-code */}\n\t\t\t<code>\n\t\t\t\t<small>{getLabel(instruction)}</small>\n\t\t\t</code>\n\t\t\t<DropIndicator instruction={instruction} />\n\t\t</div>\n\t);\n}\n\nexport default function Example() {\n\treturn (\n\t\t<Layout testId=\"layout--appearance\">\n\t\t\t<div css={containerStyles}>\n\t\t\t\t{all.map((instruction, index) => (\n\t\t\t\t\t<TreeItem instruction={instruction} key={index} {...data} />\n\t\t\t\t))}\n\t\t\t</div>\n\t\t</Layout>\n\t);\n}\n"
  },
  {
    "path": "packages/react-drop-indicator/examples/internal/card.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport type { ReactElement, ReactNode } from 'react';\n\nimport { css, jsx } from '@compiled/react';\n\nimport { token } from '@atlaskit/tokens';\n\nimport { DropIndicator as defaultDropIndicator, type DropIndicatorProps } from '../../src/box';\n\ntype CardProps = {\n\tchildren: ReactNode;\n\tDropIndicator?: (props: DropIndicatorProps) => ReactElement | null;\n} & Pick<DropIndicatorProps, 'edge' | 'gap'>;\n\nconst cardStyles = css({\n\tdisplay: 'grid',\n\tminWidth: 120,\n\tpadding: '16px 20px',\n\tbackgroundColor: token('elevation.surface.raised'),\n\tborderRadius: 3,\n\tboxShadow: token(\n\t\t'elevation.shadow.raised',\n\t\t'rgba(9, 30, 66, 0.25) 0px 1px 1px, rgba(9, 30, 66, 0.31) 0px 0px 1px',\n\t),\n\tplaceItems: 'center',\n\tposition: 'relative',\n});\n\nconst Card = ({ children, edge, gap, DropIndicator = defaultDropIndicator }: CardProps) => {\n\treturn (\n\t\t<div css={cardStyles} data-testid=\"card\">\n\t\t\t<strong>{children}</strong>\n\t\t\t<DropIndicator edge={edge} gap={gap} />\n\t\t</div>\n\t);\n};\n\nexport default Card;\n"
  },
  {
    "path": "packages/react-drop-indicator/examples/internal/layout.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport type { ReactNode } from 'react';\n\nimport { css, jsx } from '@compiled/react';\n\nconst layoutStyles = css({\n\tdisplay: 'flex',\n\tpadding: 32,\n\tgap: 32,\n\tflexWrap: 'wrap',\n});\n\nconst Layout = ({ children, testId }: { children: ReactNode; testId?: string }) => {\n\treturn (\n\t\t<div css={layoutStyles} data-testid={testId}>\n\t\t\t{children}\n\t\t</div>\n\t);\n};\n\nexport default Layout;\n"
  },
  {
    "path": "packages/react-drop-indicator/examples/internal/list.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport { type CSSProperties, type ReactNode, useState } from 'react';\n\nimport { css, cssMap, jsx } from '@compiled/react';\n\nimport { token } from '@atlaskit/tokens';\n\nconst innerStyles = css({\n\tpaddingTop: token('space.100'),\n\tpaddingRight: token('space.100'),\n\tpaddingBottom: token('space.100'),\n\tpaddingLeft: token('space.100'),\n\tborderWidth: token('border.width'),\n\tborderStyle: 'solid',\n\tborderColor: token('color.border'),\n});\n\nconst outerStyles = css({\n\tposition: 'relative',\n\tflexGrow: '1', // so our inline items grow to fill the width\n});\n\nfunction Item({ item, indicator }: { item: TItem; indicator?: ReactNode }) {\n\treturn (\n\t\t<div css={outerStyles}>\n\t\t\t<div css={innerStyles}>{item.id}</div>\n\t\t\t{indicator}\n\t\t</div>\n\t);\n}\n\ntype TItem = {\n\tid: string;\n};\n\nfunction getItems({ amount }: { amount: number }): TItem[] {\n\treturn Array.from({ length: amount }, (_, index) => ({ id: `id:${index}` }));\n}\n\nconst listStyles = css({\n\tdisplay: 'flex',\n\tgap: 'var(--gap)',\n\twidth: '300px',\n\tborderWidth: token('border.width'),\n\tborderStyle: 'solid',\n\tborderColor: token('color.border'),\n\tpaddingTop: token('space.100'),\n\tpaddingRight: token('space.100'),\n\tpaddingBottom: token('space.100'),\n\tpaddingLeft: token('space.100'),\n\tboxSizing: 'border-box',\n});\n\nconst orientationStyles = cssMap({\n\thorizontal: { flexDirection: 'row' },\n\tvertical: { flexDirection: 'column' },\n});\n\nexport type Orientation = 'vertical' | 'horizontal';\n\nexport function List({\n\tamount = 4,\n\tgap = token('space.0'),\n\torientation = 'vertical',\n\tindicator,\n}: {\n\tamount?: number;\n\torientation?: Orientation;\n\tgap?: string;\n\tindicator?: ReactNode;\n}) {\n\tconst [items] = useState<TItem[]>(() => getItems({ amount }));\n\treturn (\n\t\t<div\n\t\t\tstyle={\n\t\t\t\t{\n\t\t\t\t\t'--gap': gap,\n\t\t\t\t} as CSSProperties\n\t\t\t}\n\t\t\tcss={[listStyles, orientationStyles[orientation]]}\n\t\t>\n\t\t\t{items.map((item) => (\n\t\t\t\t<Item item={item} key={item.id} indicator={indicator} />\n\t\t\t))}\n\t\t</div>\n\t);\n}\n"
  },
  {
    "path": "packages/react-drop-indicator/examples/internal/tree-item.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport type { CSSProperties } from 'react';\n\nimport { css, jsx } from '@compiled/react';\n\nimport type { Instruction } from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';\nimport { token } from '@atlaskit/tokens';\n\nimport { DropIndicator } from '../../src/tree-item';\n\nconst itemStyles = css({\n\tdisplay: 'flex',\n\tminWidth: 120,\n\tpadding: 8,\n\talignItems: 'center',\n\tgap: 4,\n\tborderRadius: 3,\n\tposition: 'relative',\n\tpaddingInlineStart: 'calc(var(--horizontal-indent) + 1ch)',\n\tbackgroundColor: token('elevation.surface.sunken'),\n});\n\nfunction getLabel(instruction: Instruction): string {\n\tif (instruction.type === 'instruction-blocked') {\n\t\treturn `[Blocked] ${getLabel(instruction.desired)}`;\n\t}\n\tif (instruction.type === 'reparent') {\n\t\treturn `reparent (lvl${instruction.currentLevel} -> lvl${instruction.desiredLevel})`;\n\t}\n\treturn instruction.type;\n}\n\nexport default function TreeItem({\n\tinstruction,\n\tindentPerLevel,\n\tcurrentLevel,\n}: {\n\tinstruction: Instruction;\n\tindentPerLevel: number;\n\tcurrentLevel: number;\n}) {\n\treturn (\n\t\t<div\n\t\t\tcss={itemStyles}\n\t\t\tstyle={\n\t\t\t\t{\n\t\t\t\t\t'--horizontal-indent': `${indentPerLevel * currentLevel}px`,\n\t\t\t\t} as CSSProperties\n\t\t\t}\n\t\t>\n\t\t\t<span>Instruction: </span>\n\t\t\t{/* eslint-disable-next-line @atlaskit/design-system/no-html-code */}\n\t\t\t<code>\n\t\t\t\t<small>{getLabel(instruction)}</small>\n\t\t\t</code>\n\t\t\t<DropIndicator instruction={instruction} />\n\t\t</div>\n\t);\n}\n"
  },
  {
    "path": "packages/react-drop-indicator/examples/line.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport React from 'react';\n\nimport { jsx } from '@compiled/react';\n\nimport { Code } from '@atlaskit/code';\nimport Heading from '@atlaskit/heading';\nimport type { Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/types';\nimport { Box, Inline, Stack, Text } from '@atlaskit/primitives/compiled';\nimport { token } from '@atlaskit/tokens';\n\nimport type { Appearance } from '../src/internal-types';\nimport Line from '../src/internal/line';\nimport { presetStrokeColors } from '../src/presets';\n\nimport { List, type Orientation } from './internal/list';\n\nconst orientationFromEdge: { [TKey in Edge]: Orientation } = {\n\ttop: 'vertical',\n\tright: 'horizontal',\n\tbottom: 'vertical',\n\tleft: 'horizontal',\n};\n\nfunction Example({\n\ttype,\n\tgap,\n\tedge,\n\tappearance,\n\tindent,\n}: {\n\ttype: Exclude<Parameters<typeof Line>[0]['type'], undefined>;\n\tedge: Edge;\n\tgap: string;\n\t// Adding \"custom\" to poke at the increased color range of Outline (which it has for now)\n\tappearance?: Appearance | { custom: string };\n\tindent?: string;\n}) {\n\treturn (\n\t\t<React.StrictMode>\n\t\t\t<Box padding=\"space.100\">\n\t\t\t\t<Stack space=\"space.100\">\n\t\t\t\t\t<Heading size=\"small\">\n\t\t\t\t\t\t<Inline space=\"space.100\">\n\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\tEdge: <Code>{edge}</Code>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\tType: <Code>{type}</Code>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\tGap: <Code>{gap}</Code>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t{typeof appearance === 'string' ? (\n\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\tAppearance: <Code>{appearance}</Code>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t{typeof appearance === 'object' && appearance.custom ? (\n\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\tCustom color: <Code>{appearance.custom}</Code>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t\t{indent ? (\n\t\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\t\tIndent: <Code>{indent}</Code>\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t) : null}\n\t\t\t\t\t\t</Inline>\n\t\t\t\t\t</Heading>\n\t\t\t\t\t<Inline space=\"space.100\">\n\t\t\t\t\t\t{(['ltr', 'rtl'] as const).map((direction) => (\n\t\t\t\t\t\t\t<Stack space=\"space.100\" key={direction}>\n\t\t\t\t\t\t\t\t<Text>\n\t\t\t\t\t\t\t\t\tDirection: <Code>{direction}</Code>\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t<div dir={direction}>\n\t\t\t\t\t\t\t\t\t<List\n\t\t\t\t\t\t\t\t\t\torientation={orientationFromEdge[edge]}\n\t\t\t\t\t\t\t\t\t\tgap={gap}\n\t\t\t\t\t\t\t\t\t\tindicator={\n\t\t\t\t\t\t\t\t\t\t\t<Line\n\t\t\t\t\t\t\t\t\t\t\t\tedge={edge}\n\t\t\t\t\t\t\t\t\t\t\t\ttype={type}\n\t\t\t\t\t\t\t\t\t\t\t\tgap={gap}\n\t\t\t\t\t\t\t\t\t\t\t\tstrokeColor={\n\t\t\t\t\t\t\t\t\t\t\t\t\ttypeof appearance === 'string'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t? presetStrokeColors[appearance]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t: appearance?.custom\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tindent={indent}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</Stack>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</Inline>\n\t\t\t\t</Stack>\n\t\t\t</Box>\n\t\t</React.StrictMode>\n\t);\n}\n\nexport default function DefaultExample() {\n\treturn <Example edge=\"bottom\" gap=\"0px\" type=\"terminal\" />;\n}\n\n/**\n * **Exporting Combinations**\n *\n * Manually exporting each combination as our VR tester does not\n * work well when passing dynamic arguments.\n *\n * Naming convention: `Edge${edge}Type${type}Gap${gap}`\n */\n\nexport function EdgeTopTypeTerminalGap0px() {\n\treturn <Example edge=\"top\" type=\"terminal\" gap=\"0px\" />;\n}\n\nexport function EdgeRightTypeTerminalGap0px() {\n\treturn <Example edge=\"right\" type=\"terminal\" gap=\"0px\" />;\n}\n\nexport function EdgeBottomTypeTerminalGap0px() {\n\treturn <Example edge=\"bottom\" type=\"terminal\" gap=\"0px\" />;\n}\n\nexport function EdgeLeftTypeTerminalGap0px() {\n\treturn <Example edge=\"left\" type=\"terminal\" gap=\"0px\" />;\n}\n\nexport function EdgeTopTypeTerminalGapTokenSpace100() {\n\treturn <Example edge=\"top\" type=\"terminal\" gap={token('space.100')} />;\n}\n\nexport function EdgeRightTypeTerminalGapTokenSpace100() {\n\treturn <Example edge=\"right\" type=\"terminal\" gap={token('space.100')} />;\n}\n\nexport function EdgeBottomTypeTerminalGapTokenSpace100() {\n\treturn <Example edge=\"bottom\" type=\"terminal\" gap={token('space.100')} />;\n}\n\nexport function EdgeLeftTypeTerminalGapTokenSpace100() {\n\treturn <Example edge=\"left\" type=\"terminal\" gap={token('space.100')} />;\n}\n\nexport function EdgeTopTypeNoTerminalGap0px() {\n\treturn <Example edge=\"top\" type=\"no-terminal\" gap=\"0px\" />;\n}\n\nexport function EdgeRightTypeNoTerminalGap0px() {\n\treturn <Example edge=\"right\" type=\"no-terminal\" gap=\"0px\" />;\n}\n\nexport function EdgeBottomTypeNoTerminalGap0px() {\n\treturn <Example edge=\"bottom\" type=\"no-terminal\" gap=\"0px\" />;\n}\n\nexport function EdgeLeftTypeNoTerminalGap0px() {\n\treturn <Example edge=\"left\" type=\"no-terminal\" gap=\"0px\" />;\n}\n\nexport function EdgeTopTypeNoTerminalGapTokenSpace100() {\n\treturn <Example edge=\"top\" type=\"no-terminal\" gap={token('space.100')} />;\n}\n\nexport function EdgeRightTypeNoTerminalGapTokenSpace100() {\n\treturn <Example edge=\"right\" type=\"no-terminal\" gap={token('space.100')} />;\n}\n\nexport function EdgeBottomTypeNoTerminalGapTokenSpace100() {\n\treturn <Example edge=\"bottom\" type=\"no-terminal\" gap={token('space.100')} />;\n}\n\nexport function EdgeLeftTypeNoTerminalGapTokenSpace100() {\n\treturn <Example edge=\"left\" type=\"no-terminal\" gap={token('space.100')} />;\n}\n\nexport function EdgeTopTypeTerminalNoBleedGap0px() {\n\treturn <Example edge=\"top\" type=\"terminal-no-bleed\" gap=\"0px\" />;\n}\n\nexport function EdgeRightTypeTerminalNoBleedGap0px() {\n\treturn <Example edge=\"right\" type=\"terminal-no-bleed\" gap=\"0px\" />;\n}\n\nexport function EdgeBottomTypeTerminalNoBleedGap0px() {\n\treturn <Example edge=\"bottom\" type=\"terminal-no-bleed\" gap=\"0px\" />;\n}\n\nexport function EdgeLeftTypeTerminalNoBleedGap0px() {\n\treturn <Example edge=\"left\" type=\"terminal-no-bleed\" gap=\"0px\" />;\n}\n\nexport function EdgeTopTypeTerminalNoBleedGapTokenSpace100() {\n\treturn <Example edge=\"top\" type=\"terminal-no-bleed\" gap={token('space.100')} />;\n}\n\nexport function EdgeRightTypeTerminalNoBleedGapTokenSpace100() {\n\treturn <Example edge=\"right\" type=\"terminal-no-bleed\" gap={token('space.100')} />;\n}\n\nexport function EdgeBottomTypeTerminalNoBleedGapTokenSpace100() {\n\treturn <Example edge=\"bottom\" type=\"terminal-no-bleed\" gap={token('space.100')} />;\n}\n\nexport function EdgeLeftTypeTerminalNoBleedGapTokenSpace100() {\n\treturn <Example edge=\"left\" type=\"terminal-no-bleed\" gap={token('space.100')} />;\n}\n\n/**\n * **Indenting**\n *\n * It is possible to _indent_ the line. This is helpful in situations where you need to\n * be able to shift the line horizontally (eg in trees).\n *\n */\nexport function EdgeTopTypeTerminalNoBleedGapTokenSpace100IndentTokenSpace200() {\n\treturn (\n\t\t<Example edge=\"top\" type=\"terminal\" gap={token('space.100')} indent={token('space.200')} />\n\t);\n}\nexport function EdgeRightTypeTerminalNoBleedGapTokenSpace100IndentTokenSpace200() {\n\treturn (\n\t\t<Example edge=\"right\" type=\"terminal\" gap={token('space.100')} indent={token('space.200')} />\n\t);\n}\nexport function EdgeBottomTypeTerminalNoBleedGapTokenSpace100IndentTokenSpace200() {\n\treturn (\n\t\t<Example edge=\"bottom\" type=\"terminal\" gap={token('space.100')} indent={token('space.200')} />\n\t);\n}\nexport function EdgeLeftTypeTerminalNoBleedGapTokenSpace100IndentTokenSpace200() {\n\treturn (\n\t\t<Example edge=\"left\" type=\"terminal\" gap={token('space.100')} indent={token('space.200')} />\n\t);\n}\n\n/**\n * **Color variants**\n *\n * Only running a subset of cases with a separate color to prevent combinatorial explosion\n */\n\nexport function ColorWarning() {\n\treturn <Example edge=\"bottom\" type=\"terminal\" gap={token('space.100')} appearance=\"warning\" />;\n}\n\nexport function ColorDiscovery() {\n\treturn (\n\t\t<Example\n\t\t\tedge=\"bottom\"\n\t\t\ttype=\"terminal\"\n\t\t\tgap={token('space.100')}\n\t\t\tappearance={{ custom: token('color.border.discovery') }}\n\t\t/>\n\t);\n}\n"
  },
  {
    "path": "packages/react-drop-indicator/examples/outline.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport React, { type CSSProperties } from 'react';\n\nimport { css, jsx } from '@compiled/react';\n\nimport { Code } from '@atlaskit/code';\nimport Heading from '@atlaskit/heading';\nimport { Box, Inline, Stack } from '@atlaskit/primitives/compiled';\nimport { token } from '@atlaskit/tokens';\n\nimport Border from '../src/internal/border';\nimport { presetStrokeColors } from '../src/presets';\n\nconst targetStyles = css({\n\tborderWidth: token('border.width'),\n\tborderStyle: 'solid',\n\tborderColor: token('color.border'),\n\tposition: 'relative',\n\twidth: '300px',\n\tpaddingTop: token('space.200'),\n\tpaddingRight: token('space.200'),\n\tpaddingBottom: token('space.200'),\n\tpaddingLeft: token('space.200'),\n\tborderRadius: 'var(--border-radius)',\n});\n\ntype Options = {\n\tappearance: 'default' | 'warning';\n\tindent: string;\n\tborderRadius: string;\n};\n\nconst defaults: Options = {\n\tappearance: 'default',\n\tborderRadius: token('radius.small'),\n\tindent: '0px',\n};\n\nfunction Target(options: Partial<Options>) {\n\tconst { borderRadius, appearance, indent } = { ...defaults, ...options };\n\tconst strokeColor = presetStrokeColors[appearance];\n\treturn (\n\t\t// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop\n\t\t<div css={targetStyles} style={{ '--border-radius': borderRadius } as CSSProperties}>\n\t\t\tTarget\n\t\t\t<Border strokeColor={strokeColor} borderRadius={borderRadius} indent={indent} />\n\t\t</div>\n\t);\n}\n\nfunction Example(options: Partial<Options>) {\n\tconst { borderRadius, appearance, indent } = { ...defaults, ...options };\n\treturn (\n\t\t<React.StrictMode>\n\t\t\t<Box padding=\"space.200\">\n\t\t\t\t<Stack space=\"space.100\">\n\t\t\t\t\t<Heading size=\"small\">\n\t\t\t\t\t\t<Inline space=\"space.100\">\n\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\tColor: <Code>{appearance}</Code>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t\tBorder radius: <Code>{borderRadius}</Code>\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</Inline>\n\t\t\t\t\t</Heading>\n\t\t\t\t\t<Target appearance={appearance} borderRadius={borderRadius} indent={indent} />\n\t\t\t\t</Stack>\n\t\t\t</Box>\n\t\t</React.StrictMode>\n\t);\n}\n\nexport default function DefaultExample() {\n\treturn <StrokeColorDefault />;\n}\n\nexport function StrokeColorDefault() {\n\treturn <Example appearance=\"default\" />;\n}\n\nexport function StrokeColorWarning() {\n\treturn <Example appearance=\"warning\" />;\n}\n\nexport function CustomBorderRadius() {\n\treturn <Example appearance=\"default\" borderRadius={token('radius.xlarge')} />;\n}\n\nexport function Inset() {\n\treturn (\n\t\t<Box padding=\"space.100\">\n\t\t\t<Inline space=\"space.200\">\n\t\t\t\t{(['ltr', 'rtl'] as const).map((direction) => (\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<Heading size=\"small\">\n\t\t\t\t\t\t\tDirection <Code>{direction}</Code>\n\t\t\t\t\t\t</Heading>\n\t\t\t\t\t\t<div dir={direction}>\n\t\t\t\t\t\t\t<Target indent={token('space.200')} />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t))}\n\t\t\t</Inline>\n\t\t</Box>\n\t);\n}\n"
  },
  {
    "path": "packages/react-drop-indicator/package.json",
    "content": "{\n  \"name\": \"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator\",\n  \"version\": \"3.2.12\",\n  \"description\": \"An optional Pragmatic drag and drop package containing react components that provide a visual indication about what the user will achieve when the drop (eg lines)\",\n  \"publishConfig\": {\n    \"registry\": \"https://registry.npmjs.org/\"\n  },\n  \"repository\": \"https://github.com/atlassian/pragmatic-drag-and-drop\",\n  \"author\": \"Atlassian Pty Ltd\",\n  \"license\": \"Apache-2.0\",\n  \"main\": \"dist/cjs/index.js\",\n  \"module\": \"dist/esm/index.js\",\n  \"module:es2019\": \"dist/es2019/index.js\",\n  \"types\": \"dist/types/index.d.ts\",\n  \"sideEffects\": [\n    \"**/*.compiled.css\"\n  ],\n  \"dependencies\": {\n    \"@atlaskit/pragmatic-drag-and-drop\": \"^1.7.0\",\n    \"@atlaskit/pragmatic-drag-and-drop-hitbox\": \"^1.1.0\",\n    \"@atlaskit/tokens\": \"^11.1.0\",\n    \"@babel/runtime\": \"^7.0.0\",\n    \"@compiled/react\": \"^0.20.0\"\n  },\n  \"peerDependencies\": {\n    \"react\": \"^18.2.0 || ^19.0.0\"\n  },\n  \"devDependencies\": {\n    \"@testing-library/react\": \"^16.3.0\",\n    \"react-dom\": \"^18.2.0\",\n    \"tiny-invariant\": \"^1.2.0\",\n    \"wait-for-expect\": \"^1.2.0\"\n  },\n  \"exports\": {\n    \".\": \"./src/index.ts\",\n    \"./border\": \"./src/border.tsx\",\n    \"./box\": \"./src/box.tsx\",\n    \"./group\": \"./src/group.tsx\",\n    \"./list-item\": \"./src/list-item.tsx\",\n    \"./types\": \"./src/types.ts\",\n    \"./tree-item\": \"./src/tree-item.tsx\"\n  },\n  \"homepage\": \"https://atlassian.design/components/pragmatic-drag-and-drop/\"\n}\n"
  },
  {
    "path": "packages/react-drop-indicator/src/border.tsx",
    "content": "import React from 'react';\n\nimport type { Appearance, CSSSize } from './internal-types';\nimport { Border } from './internal/border';\nimport { presetStrokeColors } from './presets';\n\nexport function DropIndicator({\n\tappearance = 'default',\n\tindent,\n}: {\n\tappearance?: Appearance;\n\tindent?: CSSSize;\n}): React.JSX.Element {\n\treturn <Border strokeColor={presetStrokeColors[appearance]} indent={indent} />;\n}\n\n// For React.lazy\nexport default DropIndicator;\n"
  },
  {
    "path": "packages/react-drop-indicator/src/box.tsx",
    "content": "import React from 'react';\n\nimport type { Appearance, CSSSize } from './internal-types';\nimport { Line } from './internal/line';\nimport { presetStrokeColors } from './presets';\nimport type { Edge } from './types';\n\nexport type DropIndicatorProps = {\n\t/**\n\t * The `edge` to draw a drop indicator on.\n\t *\n\t * `edge` is required as for the best possible performance\n\t * outcome you should only render this component when it needs to do something\n\t *\n\t * @example {closestEdge && <DropIndicator edge={closestEdge} />}\n\t */\n\tedge: Edge;\n\t/**\n\t * `gap` allows you to position the drop indicator further away from the drop target.\n\t * `gap` should be the distance between your drop targets\n\t * a drop indicator will be rendered halfway between the drop targets\n\t * (the drop indicator will be offset by half of the `gap`)\n\t *\n\t * `gap` should be a valid CSS size.\n\t *\n\t * @example \"8px\"\n\t * @example \"var(--gap)\"\n\t */\n\tgap?: CSSSize;\n\n\t/**\n\t * This will control what color the indicator is set to\n\t */\n\tappearance?: Appearance;\n\n\t/**\n\t * Which style of indicator should be used\n\t *\n\t * *\"terminal\"*\n\t *\n\t * - display a terminal (circle with a whole in it) at the start of the line\n\t * - half the size of the terminal will \"bleed out\" of the containing element\n\t *\n\t * *\"terminal-no-bleed\"*\n\t *\n\t * - display a terminal (circle with a whole in it) at the start of the line\n\t * - the terminal will _not_ \"bleed out\" of the containing element\n\t * - this is useful in situations where the terminal cannot bleed out\n\t *   (such as when inside scroll containers with no padding)\n\t *\n\t * *\"no-terminal\"*\n\t *\n\t * - display a full width line with no terminal\n\t */\n\ttype?: Parameters<typeof Line>[0]['type'];\n\n\t/**\n\t * Add additional indentation on the main axis of the line.\n\t * Useful in situations where you want to shift the line along a larger element.\n\t *\n\t * `indent` should be a valid CSS size.\n\t *\n\t * @example \"20px\"\n\t * @example \"var(--indent)\"\n\t */\n\tindent?: CSSSize;\n};\n\n/**\n * __Drop indicator__\n *\n * A drop indicator is used to communicate the intended resting place of the draggable item. The orientation of the drop indicator should always match the direction of the content flow.\n */\nexport function DropIndicator({\n\tappearance = 'default',\n\tedge,\n\tgap,\n\tindent,\n\ttype,\n}: DropIndicatorProps): React.JSX.Element {\n\treturn (\n\t\t<Line\n\t\t\tedge={edge}\n\t\t\tgap={gap}\n\t\t\tstrokeColor={presetStrokeColors[appearance]}\n\t\t\ttype={type}\n\t\t\tindent={indent}\n\t\t/>\n\t);\n}\n\n// This default export is intended for usage with React.lazy\nexport default DropIndicator;\n"
  },
  {
    "path": "packages/react-drop-indicator/src/group.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\nimport { forwardRef, type ReactNode } from 'react';\n\nimport { css, jsx } from '@compiled/react';\n\nimport { token } from '@atlaskit/tokens';\n\nconst activeStyles = css({\n\tbackgroundColor: token('color.background.information'),\n\tborderRadius: token('radius.xsmall'),\n\toutlineOffset: token('space.075'),\n\toutlineWidth: token('border.width.selected'),\n\toutlineStyle: 'solid',\n\toutlineColor: token('color.border.selected'),\n});\n/**\n * A drop indicator to be used when dragging over a group of items\n */\nexport const GroupDropIndicator = forwardRef<\n\tHTMLDivElement,\n\t{\n\t\tchildren: ReactNode;\n\t\tisActive: boolean;\n\t\ttestId?: string;\n\t}\n>(function GroupDropIndicator({ children, isActive, testId }, forwardedRef) {\n\treturn (\n\t\t<div ref={forwardedRef} css={[isActive && activeStyles]} data-testid={testId}>\n\t\t\t{children}\n\t\t</div>\n\t);\n});\n"
  },
  {
    "path": "packages/react-drop-indicator/src/index.ts",
    "content": "// This file exists for module resolution purposes.\n\n// Not exporting anything from the root entry point\n// Please use individual entry points in order to always\n// obtain minimum kbs.\n\nexport default {};\n"
  },
  {
    "path": "packages/react-drop-indicator/src/internal/README.md",
    "content": "# Internal for now\n\nThese exports will likely become public in a future pull request\n"
  },
  {
    "path": "packages/react-drop-indicator/src/internal/border.tsx",
    "content": "/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport type { CSSProperties } from 'react';\n\nimport { css, jsx } from '@compiled/react';\n\nimport type { CSSColor, CSSSize } from '../internal-types';\nimport { presetStrokeColors, presetStrokeWidth } from '../presets';\n\nconst styles = css({\n\t// To make things a bit clearer we are making the box that the indicator in as\n\t// big as the whole tree item\n\tposition: 'absolute',\n\tinsetBlockStart: 0,\n\tinsetBlockEnd: 0,\n\tinsetInlineEnd: 0,\n\tinsetInlineStart: 'var(--indent)',\n\n\t// We don't want to cause any additional 'dragenter' events\n\tpointerEvents: 'none',\n\n\tborder: 'var(--stroke-width) solid var(--stroke-color)',\n\tborderRadius: 'var(--border-radius)',\n});\n\nexport function Border({\n\tstrokeColor = presetStrokeColors.default,\n\tstrokeWidth = presetStrokeWidth,\n\tborderRadius = '3px', // TODO: update to radius.small (4px) token\n\tindent = '0px',\n}: {\n\tstrokeColor?: CSSColor;\n\tborderRadius?: CSSSize;\n\tstrokeWidth?: CSSSize;\n\tindent?: string;\n}) {\n\treturn (\n\t\t<div\n\t\t\tstyle={\n\t\t\t\t{\n\t\t\t\t\t'--stroke-color': strokeColor,\n\t\t\t\t\t'--stroke-width': strokeWidth,\n\t\t\t\t\t'--border-radius': borderRadius,\n\t\t\t\t\t'--indent': indent,\n\t\t\t\t} as CSSProperties\n\t\t\t}\n\t\t\tcss={styles}\n\t\t/>\n\t);\n}\n\n// For React.lazy\nexport default Border;\n"
  },
  {
    "path": "packages/react-drop-indicator/src/internal/line.tsx",
    "content": "/* eslint-disable @atlaskit/ui-styling-standard/enforce-style-prop */\n/**\n * @jsxRuntime classic\n * @jsx jsx\n */\n\nimport type { CSSProperties } from 'react';\n\nimport { cssMap, jsx } from '@compiled/react';\n\nimport type { Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/types';\n\nimport type { CSSColor, CSSSize } from '../internal-types';\nimport { presetStrokeColors, presetStrokeWidth } from '../presets';\n\ntype Orientation = 'horizontal' | 'vertical';\n\nconst edgeToOrientationMap: Record<Edge, Orientation> = {\n\ttop: 'horizontal',\n\tbottom: 'horizontal',\n\tleft: 'vertical',\n\tright: 'vertical',\n};\n\nconst baseStyles = cssMap({\n\troot: {\n\t\tdisplay: 'block',\n\t\tposition: 'absolute',\n\t\tzIndex: 1,\n\t\t// Blocking pointer events to prevent the line from triggering drag events\n\t\tpointerEvents: 'none',\n\t\tbackgroundColor: 'var(--stroke-color)',\n\n\t\t// &::before is for the terminal\n\t\t'&::before': {\n\t\t\tdisplay: 'var(--terminal-display)',\n\t\t\tcontent: '\"\"',\n\t\t\tposition: 'absolute',\n\t\t\tboxSizing: 'border-box',\n\t\t\twidth: 'var(--terminal-diameter)',\n\t\t\theight: 'var(--terminal-diameter)',\n\t\t\tborderWidth: 'var(--stroke-width)',\n\t\t\tborderStyle: 'solid',\n\t\t\tborderColor: 'var(--stroke-color)',\n\t\t\t// eslint-disable-next-line @atlaskit/design-system/use-tokens-shape\n\t\t\tborderRadius: '50%',\n\t\t},\n\t},\n});\n\nconst orientationStyles = cssMap({\n\thorizontal: {\n\t\theight: 'var(--stroke-width)',\n\t\tinsetInlineStart: 'var(--line-main-axis-start)',\n\t\tinsetInlineEnd: 0,\n\t\t'&::before': {\n\t\t\tinsetInlineStart: 'var(--terminal-main-axis-start)',\n\t\t},\n\t},\n\t// For now, vertical lines will always have the terminal on the top.\n\t// Need to investigate whether we want the terminal on the bottom\n\t// for bottom to top languages.\n\tvertical: {\n\t\twidth: 'var(--stroke-width)',\n\t\ttop: 'var(--line-main-axis-start)',\n\t\tbottom: 0,\n\t\t'&::before': {\n\t\t\ttop: 'var(--terminal-main-axis-start)',\n\t\t},\n\t},\n});\n\nconst edgeStyles = cssMap({\n\ttop: {\n\t\ttop: 'var(--main-axis-offset)',\n\t\t'&::before': {\n\t\t\ttop: 'var(--terminal-cross-axis-offset)',\n\t\t},\n\t},\n\tright: {\n\t\tright: 'var(--main-axis-offset)',\n\t\t'&::before': {\n\t\t\tright: 'var(--terminal-cross-axis-offset)',\n\t\t},\n\t},\n\tbottom: {\n\t\tbottom: 'var(--main-axis-offset)',\n\t\t'&::before': {\n\t\t\tbottom: 'var(--terminal-cross-axis-offset)',\n\t\t},\n\t},\n\tleft: {\n\t\tleft: 'var(--main-axis-offset)',\n\t\t'&::before': {\n\t\t\tleft: 'var(--terminal-cross-axis-offset)',\n\t\t},\n\t},\n});\n\ntype LineType = 'terminal' | 'no-terminal' | 'terminal-no-bleed';\n\nconst lineStartFrom: { [TKey in LineType]: ({ indent }: { indent: string }) => string } = {\n\t// - half the terminal bleeding out the containing element\n\t// - half the terminal inside the containing element (we need to position the line next to this)\n\tterminal: ({ indent }) => `calc(var(--terminal-radius) + ${indent})`,\n\n\t// The full terminal is inside the containing element (we need to position the line next to this)\n\t'terminal-no-bleed': ({ indent }) => `calc(var(--terminal-diameter) + ${indent})`,\n\n\t// No terminal to worry about, line should take up all the space\n\t'no-terminal': ({ indent }) => indent,\n};\n\nexport function Line({\n\tedge,\n\tgap = '0px',\n\tindent = '0px',\n\tstrokeColor = presetStrokeColors.default,\n\tstrokeWidth = presetStrokeWidth,\n\ttype = 'terminal',\n}: {\n\tedge: Edge;\n\tindent?: CSSSize;\n\tgap?: CSSSize;\n\tstrokeColor?: CSSColor;\n\tstrokeWidth?: CSSSize;\n\ttype?: LineType;\n}) {\n\tconst orientation = edgeToOrientationMap[edge];\n\n\treturn (\n\t\t<div\n\t\t\tstyle={\n\t\t\t\t{\n\t\t\t\t\t// ## All\n\n\t\t\t\t\t'--stroke-color': strokeColor,\n\t\t\t\t\t'--stroke-width': strokeWidth,\n\n\t\t\t\t\t// Shift line and terminal on the main access to account for gaps between items\n\t\t\t\t\t'--main-axis-offset': `calc(-0.5 * (${gap} + var(--stroke-width)))`,\n\n\t\t\t\t\t// ## Line\n\n\t\t\t\t\t// If there is a terminal, we want the line to start from next to it\n\t\t\t\t\t'--line-main-axis-start': lineStartFrom[type]({ indent }),\n\n\t\t\t\t\t// ## Terminal\n\n\t\t\t\t\t'--terminal-display': type === 'no-terminal' ? 'none' : 'block',\n\t\t\t\t\t'--terminal-diameter': 'calc(var(--stroke-width) * 4)',\n\t\t\t\t\t'--terminal-radius': 'calc(var(--terminal-diameter) / 2)',\n\n\t\t\t\t\t// The line is positioned to account for the the terminal (--line-main-axis-start).\n\t\t\t\t\t// The terminal is rendered relative to the line (it's a `::before`)\n\t\t\t\t\t// We need to pull the terminal backwards so it sits before the start of the line\n\t\t\t\t\t'--terminal-main-axis-start': 'calc(-1 * var(--terminal-diameter))',\n\n\t\t\t\t\t// Pull the terminal backwards on the cross axis (eg \"up\" on \"vertical\")\n\t\t\t\t\t// so the center of the terminal lines up with the center of the line\n\t\t\t\t\t'--terminal-cross-axis-offset':\n\t\t\t\t\t\t'calc(calc(var(--stroke-width) - var(--terminal-diameter)) / 2)',\n\t\t\t\t} as CSSProperties\n\t\t\t}\n\t\t\tcss={[baseStyles.root, orientationStyles[orientation], edgeStyles[edge]]}\n\t\t/>\n\t);\n}\n\n// For React.lazy\nexport default Line;\n"
  },
  {
    "path": "packages/react-drop-indicator/src/internal-types.ts",
    "content": "/**\n * Any valid CSS size value.\n *\n * _An alias to `string` to improve readability_\n *\n * @example\n *\n * - \"2px\"\n * - \"4rem\"\n * // ADS tokens (which resolve to CSS size values)\n * - token('border.width.selected')\n */\nexport type CSSSize = string;\n\n/**\n * Any valid CSS color value\n *\n * * _An alias to `string` to improve readability_\n *\n * @example\n *\n * - \"#663399\"\n * - \"rgb(102, 51, 153)\"\n * - \"hsl(270, 50%, 40%)\"\n * - \"rebeccapurple\"\n * // ADS tokens (which resolve to CSS color values)\n * - token('color.border.selected')\n */\nexport type CSSColor = string;\n\nexport type Appearance = 'default' | 'warning';\n"
  },
  {
    "path": "packages/react-drop-indicator/src/list-item.tsx",
    "content": "import React, { type ComponentProps, type ReactNode } from 'react';\n\nimport type { Instruction } from '@atlaskit/pragmatic-drag-and-drop-hitbox/list-item';\n// exporting the type for consumption ease\nexport {\n\ttype Instruction,\n\ttype Operation,\n} from '@atlaskit/pragmatic-drag-and-drop-hitbox/list-item';\n\nimport { DropIndicator as Border } from './border';\nimport { DropIndicator as Line } from './box';\n\nconst axisLookup = {\n\tvertical: {\n\t\tstart: 'top',\n\t\tend: 'bottom',\n\t},\n\thorizontal: {\n\t\tstart: 'left',\n\t\tend: 'right',\n\t},\n} as const;\n\ntype LineProps = ComponentProps<typeof Line>;\n\nexport function DropIndicator({\n\tinstruction,\n\tlineGap,\n\tlineType,\n}: {\n\tinstruction: Instruction;\n\tlineGap?: LineProps['gap'];\n\tlineType?: LineProps['type'];\n}): ReactNode {\n\tconst appearance = instruction.blocked ? 'warning' : 'default';\n\tconst axis = axisLookup[instruction.axis];\n\n\tif (instruction.operation === 'combine') {\n\t\treturn <Border appearance={appearance} />;\n\t}\n\n\tif (instruction.operation === 'reorder-before') {\n\t\treturn <Line edge={axis.start} appearance={appearance} gap={lineGap} type={lineType} />;\n\t}\n\tif (instruction.operation === 'reorder-after') {\n\t\treturn <Line edge={axis.end} appearance={appearance} gap={lineGap} type={lineType} />;\n\t}\n\n\treturn null;\n}\n"
  },
  {
    "path": "packages/react-drop-indicator/src/presets.tsx",
    "content": "import { token } from '@atlaskit/tokens';\n\nimport type { Appearance, CSSColor } from './internal-types';\n\nexport const presetStrokeColors: { [TKey in Appearance]: CSSColor } = {\n\tdefault: token('color.border.selected'),\n\twarning: token('color.border.warning'),\n};\n\nexport const presetStrokeWidth = token('border.width.selected');\n"
  },
  {
    "path": "packages/react-drop-indicator/src/tree-item.tsx",
    "content": "import React, { type ReactElement } from 'react';\n\nimport type { Instruction } from '@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item';\n\nimport { DropIndicator as Border } from './border';\nimport { DropIndicator as Line } from './box';\n\nexport type DropIndicatorProps = {\n\tinstruction: Instruction;\n};\n\nfunction getElement({\n\tinstruction,\n\tisBlocked,\n}: {\n\tinstruction: Exclude<Instruction, { type: 'instruction-blocked' }>;\n\tisBlocked: boolean;\n}): ReactElement | null {\n\tconst indent = `${instruction.currentLevel * instruction.indentPerLevel}px`;\n\tconst appearance = isBlocked ? 'warning' : 'default';\n\n\tif (instruction.type === 'reorder-above') {\n\t\treturn <Line edge=\"top\" appearance={appearance} indent={indent} />;\n\t}\n\tif (instruction.type === 'reorder-below') {\n\t\treturn <Line edge=\"bottom\" appearance={appearance} indent={indent} />;\n\t}\n\n\tif (instruction.type === 'make-child') {\n\t\treturn <Border appearance={appearance} indent={indent} />;\n\t}\n\n\tif (instruction.type === 'reparent') {\n\t\tconst reparentIndent = `${instruction.desiredLevel * instruction.indentPerLevel}px`;\n\t\treturn <Line edge=\"bottom\" appearance={appearance} indent={reparentIndent} />;\n\t}\n\n\treturn null;\n}\n\nexport function DropIndicator({ instruction }: DropIndicatorProps) {\n\tif (instruction.type === 'instruction-blocked') {\n\t\treturn getElement({ instruction: instruction.desired, isBlocked: true });\n\t}\n\treturn getElement({ instruction, isBlocked: false });\n}\n"
  },
  {
    "path": "packages/react-drop-indicator/src/types.ts",
    "content": "// re-exporting Edge type for convenance\nexport type { Edge } from '@atlaskit/pragmatic-drag-and-drop-hitbox/types';\n"
  },
  {
    "path": "packages/react-drop-indicator/tsconfig.json",
    "content": "{\n  \"extends\": \"../../tsconfig.json\",\n  \"include\": [\n    \"__tests__/**/*.ts\",\n    \"__tests__/**/*.tsx\",\n    \"examples/**/*.ts\",\n    \"examples/**/*.tsx\",\n    \"src/**/*.ts\",\n    \"src/**/*.tsx\",\n    \"**/stories.ts\",\n    \"**/stories.tsx\",\n    \"**/stories/*.ts\",\n    \"**/stories/*.tsx\",\n    \"**/stories/**/*.ts\",\n    \"**/stories/**/*.tsx\"\n  ]\n}\n"
  },
  {
    "path": "packages/unit-testing/.npmignore",
    "content": "src/\nexamples-utils/\nexamples/\nindex.ts\ndocs/\nbuild/\n__tests__/\ntsconfig.json\ntsconfig.app.json\ntsconfig.dev.json\n"
  },
  {
    "path": "packages/unit-testing/CHANGELOG.md",
    "content": "# @atlaskit/pragmatic-drag-and-drop-unit-testing\n\n## 1.1.1\n\n### Patch Changes\n\n- [`098cfbb01dc36`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/098cfbb01dc36) -\n  Add missing npmignore files to remove unnecessary files from published package\n\n## 1.1.0\n\n### Minor Changes\n\n- [#123321](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/123321)\n  [`d02023dd064df`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d02023dd064df) -\n  Adding a new polyfill for [`DOMRect`](https://developer.mozilla.org/en-US/docs/Web/API/DOMRect).\n  This polyfill helpful for unit testing environments that don't implement `DOMRect`, such as\n  `jsdom`.\n\n  ```js\n  import '@atlaskit/pragmatic-drag-and-drop/unit-testing/dom-rect-polyfill';\n  ```\n\n  Setup using jest:\n\n  ```js\n  // jest.config.js\n  module.exports = {\n  \tsetupFiles: ['./test/setup-dom-rect.js'],\n  };\n\n  // ./test/setup-dom-rect.js\n  import '@atlaskit/pragmatic-drag-and-drop/unit-testing/dom-rect-polyfill';\n  ```\n\n## 1.0.0\n\n### Major Changes\n\n- [#100243](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/100243)\n  [`104425cc2a07`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/104425cc2a07) -\n  Initial release of our unit testing package for Pragmatic drag and drop. This package originally\n  only includes a polyfill for\n  [DragEvent](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent).\n"
  },
  {
    "path": "packages/unit-testing/LICENSE.md",
    "content": "Copyright 2022 Atlassian Pty Ltd\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in\ncompliance with the License. You may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is\ndistributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\nimplied. See the License for the specific language governing permissions and limitations under the\nLicense.\n"
  },
  {
    "path": "packages/unit-testing/README.md",
    "content": "## Pragmatic drag and drop\n\nAn optional package for Pragmatic drag and drop that enables screen reader messaging for alternative flows.\n\n[📖 Documentation](https://atlassian.design/components/pragmatic-drag-and-drop/)\n"
  },
  {
    "path": "packages/unit-testing/__tests__/unit/dom-rect-polyfill.spec.ts",
    "content": "test('new DOMRect(x, y, width, height)', () => {\n\tconst x = 10;\n\tconst y = 20;\n\tconst width = 30;\n\tconst height = 40;\n\tconst rect = new DOMRect(x, y, width, height);\n\n\texpect(rect.x).toBe(x);\n\texpect(rect.y).toBe(y);\n\texpect(rect.width).toBe(width);\n\texpect(rect.height).toBe(height);\n\texpect(rect.top).toBe(y);\n\texpect(rect.right).toBe(x + width);\n\texpect(rect.bottom).toBe(y + height);\n\texpect(rect.left).toBe(x);\n});\n\ntest('new DOMRect()', () => {\n\tconst rect = new DOMRect();\n\n\texpect(rect.x).toBe(0);\n\texpect(rect.y).toBe(0);\n\texpect(rect.width).toBe(0);\n\texpect(rect.height).toBe(0);\n\texpect(rect.top).toBe(0);\n\texpect(rect.right).toBe(0);\n\texpect(rect.bottom).toBe(0);\n\texpect(rect.left).toBe(0);\n});\n\ntest('DOMRect.fromRect(x, y, width, height)', () => {\n\tconst x = 10;\n\tconst y = 20;\n\tconst width = 30;\n\tconst height = 40;\n\tconst rect = DOMRect.fromRect({ x, y, width, height });\n\n\texpect(rect.x).toBe(x);\n\texpect(rect.y).toBe(y);\n\texpect(rect.width).toBe(width);\n\texpect(rect.height).toBe(height);\n\texpect(rect.top).toBe(y);\n\texpect(rect.right).toBe(x + width);\n\texpect(rect.bottom).toBe(y + height);\n\texpect(rect.left).toBe(x);\n});\n\ntest('DOMRect.fromRect({x, y, width, height}) same as new Rect(x, y, width, height)', () => {\n\tconst x = 10;\n\tconst y = 20;\n\tconst width = 30;\n\tconst height = 40;\n\n\texpect(DOMRect.fromRect({ x, y, width, height })).toEqual(new DOMRect(x, y, width, height));\n});\n\ntest('DOMRect.fromRect()', () => {\n\tconst rect = DOMRect.fromRect();\n\n\texpect(rect.x).toBe(0);\n\texpect(rect.y).toBe(0);\n\texpect(rect.width).toBe(0);\n\texpect(rect.height).toBe(0);\n\texpect(rect.top).toBe(0);\n\texpect(rect.right).toBe(0);\n\texpect(rect.bottom).toBe(0);\n\texpect(rect.left).toBe(0);\n});\n\ntest('DOMRect.fromRect({})', () => {\n\tconst rect = DOMRect.fromRect({});\n\n\texpect(rect.x).toBe(0);\n\texpect(rect.y).toBe(0);\n\texpect(rect.width).toBe(0);\n\texpect(rect.height).toBe(0);\n\texpect(rect.top).toBe(0);\n\texpect(rect.right).toBe(0);\n\texpect(rect.bottom).toBe(0);\n\texpect(rect.left).toBe(0);\n});\n\ntest('DOMRect.toJSON()', () => {\n\tconst rect = DOMRect.fromRect({ x: 10, y: 20, width: 30, height: 40 });\n\n\texpect(JSON.parse(JSON.stringify(rect))).toStrictEqual({\n\t\tx: rect.x,\n\t\ty: rect.y,\n\t\twidth: rect.width,\n\t\theight: rect.height,\n\t\ttop: rect.top,\n\t\tright: rect.right,\n\t\tbottom: rect.bottom,\n\t\tleft: rect.left,\n\t});\n});\n\ntest('negative values', () => {\n\tconst x = 10;\n\tconst y = 20;\n\tconst width = -30;\n\tconst height = -40;\n\tconst rect = DOMRect.fromRect({ x, y, width, height });\n\n\texpect(rect.x).toBe(x);\n\texpect(rect.y).toBe(y);\n\texpect(rect.width).toBe(width);\n\texpect(rect.height).toBe(height);\n\n\t// Computed values. There is custom logic\n\t// when width or height are negative\n\t// https://developer.mozilla.org/en-US/docs/Web/API/DOMRect\n\texpect(rect.top).toBe(y + height);\n\texpect(rect.right).toBe(x);\n\texpect(rect.bottom).toBe(y);\n\texpect(rect.left).toBe(x + width);\n});\n"
  },
  {
    "path": "packages/unit-testing/__tests__/unit/drag-event-polyfill/data-transfer-files.spec.ts",
    "content": "const dataTransfer = new DataTransfer();\nconst file1 = new File(['🕺💃'], '1.png', {\n\ttype: 'image/png',\n});\nconst file2 = new File(['🕺💃'], '2.png', {\n\ttype: 'image/png',\n});\ndataTransfer.items.add(file1);\ndataTransfer.items.add(file2);\n// adding non file data to ensure it doesn't appear in .files\ndataTransfer.setData('text/plain', 'Hello world');\n\ntest('dataTransfer.items and dataTransfer.files inclusion', () => {\n\t// three items, but two will be files\n\texpect(dataTransfer.items.length).toBe(3);\n\texpect(dataTransfer.files.length).toBe(2);\n});\n\ntest('dataTransfer.files.length', () => {\n\texpect(dataTransfer.files.length).toBe(2);\n});\n\ntest('dataTransfer.files[index] getters', () => {\n\texpect(dataTransfer.files[0]).toBe(file1);\n\texpect(dataTransfer.files[1]).toBe(file2);\n\texpect(dataTransfer.files[2]).toBe(undefined);\n});\n\ntest('dataTransfer.files iteration (loops)', () => {\n\tlet count = 0;\n\tfor (const file of dataTransfer.files) {\n\t\tif (count === 0) {\n\t\t\texpect(file).toBe(file1);\n\t\t}\n\t\tif (count === 1) {\n\t\t\texpect(file).toBe(file2);\n\t\t}\n\t\tcount++;\n\t}\n\texpect(count).toBe(2);\n});\n\ntest('dataTransfer.files iteration (iterator)', () => {\n\tconst iterator = dataTransfer.files[Symbol.iterator]();\n\texpect(iterator.next()).toEqual({ value: file1, done: false });\n\texpect(iterator.next()).toEqual({ value: file2, done: false });\n\texpect(iterator.next()).toEqual({ value: undefined, done: true });\n});\n\ntest('dataTransfer.files.item(index)', () => {\n\texpect(dataTransfer.files.item(0)).toBe(file1);\n\texpect(dataTransfer.files.item(1)).toBe(file2);\n\t// .item return `null` when there is no item at the index\n\texpect(dataTransfer.files.item(2)).toBe(null);\n});\n"
  },
  {
    "path": "packages/unit-testing/__tests__/unit/drag-event-polyfill/data-transfer-item-list.spec.ts",
    "content": "import invariant from 'tiny-invariant';\n\ntest('add(data, format) should add a string item', (done) => {\n\tconst list = new DataTransferItemList();\n\n\tlist.add('Hello world', 'text/plain');\n\n\tconst item: DataTransferItem = list[0];\n\texpect(item.kind).toBe('string');\n\texpect(item.type).toBe('text/plain');\n\titem.getAsString((value) => {\n\t\texpect(value).toBe('Hello world');\n\t\tdone();\n\t});\n});\n\ntest('add(data, format) should throw a DOMException if there is already an added type', (done) => {\n\tconst list = new DataTransferItemList();\n\n\tlist.add('First', 'text/plain');\n\n\tconst item: DataTransferItem = list[0];\n\texpect(item.kind).toBe('string');\n\texpect(item.type).toBe('text/plain');\n\n\texpect(() => list.add('Second', 'text/plain')).toThrow(DOMException);\n\n\titem.getAsString((value) => {\n\t\texpect(value).toBe('First');\n\t\tdone();\n\t});\n});\n\ntest('add(data, format) format is converted to lower case', (done) => {\n\tconst list = new DataTransferItemList();\n\n\tlist.add('First', 'My-Type');\n\n\tconst item: DataTransferItem = list[0];\n\texpect(item.kind).toBe('string');\n\texpect(item.type).toBe('my-type');\n\n\titem.getAsString((value) => {\n\t\texpect(value).toBe('First');\n\t\tdone();\n\t});\n});\n\ntest('add(data, format) should return the item', (done) => {\n\tconst list = new DataTransferItemList();\n\n\tconst item: DataTransferItem | null = list.add('First', 'My-Type');\n\tinvariant(item);\n\n\texpect(item.kind).toBe('string');\n\texpect(item.type).toBe('my-type');\n\n\titem.getAsString((value) => {\n\t\texpect(value).toBe('First');\n\t\tdone();\n\t});\n});\n\ntest('add(File) should add a file item', () => {\n\tconst list = new DataTransferItemList();\n\tconst file = new File(['🕺💃'], 'dance.png', {\n\t\ttype: 'image/png',\n\t});\n\n\tlist.add(file);\n\tconst item: DataTransferItem = list[0];\n\tconst result = item.getAsFile();\n\n\texpect(item.kind).toBe('file');\n\texpect(item.type).toBe('image/png');\n\texpect(result).toBe(file);\n});\n\ntest('add(File) can add multiple files', () => {\n\tconst list = new DataTransferItemList();\n\tconst file1 = new File(['🕺💃'], '1.png', {\n\t\ttype: 'image/png',\n\t});\n\tconst file2 = new File(['🕺💃'], '2.png', {\n\t\ttype: 'image/png',\n\t});\n\tlist.add(file1);\n\tlist.add(file2);\n\n\texpect(list.length).toBe(2);\n\n\texpect(list[0].getAsFile()).toBe(file1);\n\texpect(list[1].getAsFile()).toBe(file2);\n});\n\ntest('add(File) should return the item', () => {\n\tconst list = new DataTransferItemList();\n\tconst file = new File(['🕺💃'], 'dance.png', {\n\t\ttype: 'image/png',\n\t});\n\n\tconst item: DataTransferItem | null = list.add(file);\n\tinvariant(item);\n\n\texpect(item.kind).toBe('file');\n\texpect(item.type).toBe('image/png');\n\texpect(item.getAsFile()).toBe(file);\n});\n\ntest('A DataTransferItemList should support .length and index lookup', () => {\n\tconst list = new DataTransferItemList();\n\n\tlist.add('Hello world', 'text/plain');\n\tlist.add('<h1>hi</h1>', 'text/html');\n\n\texpect(list.length).toBe(2);\n\texpect(list[0]?.type).toBe('text/plain');\n\texpect(list[1]?.type).toBe('text/html');\n});\n\ntest('clear() should remove all items (including files)', () => {\n\tconst list = new DataTransferItemList();\n\n\tlist.add('Hello world', 'text/plain');\n\tlist.add(\n\t\tnew File(['🕺💃'], 'dance.png', {\n\t\t\ttype: 'image/png',\n\t\t}),\n\t);\n\n\texpect(list.length).toBe(2);\n\n\tlist.clear();\n\texpect(list.length).toBe(0);\n});\n\ntest('remove(index) should remove an item at an index', (done) => {\n\tconst list = new DataTransferItemList();\n\n\tlist.add('Hello world', 'text/plain');\n\tlist.add(\n\t\tnew File(['🕺💃'], 'dance.png', {\n\t\t\ttype: 'image/png',\n\t\t}),\n\t);\n\n\texpect(list.length).toBe(2);\n\n\tlist.remove(1);\n\n\texpect(list.length).toBe(1);\n\tconst item: DataTransferItem = list[0];\n\texpect(item.kind).toBe('string');\n\texpect(item.type).toBe('text/plain');\n\titem.getAsString((value) => {\n\t\texpect(value).toBe('Hello world');\n\t\tdone();\n\t});\n});\n\ntest('remove(index) should do nothing for out of bound indexes', () => {\n\tconst list = new DataTransferItemList();\n\n\tlist.add('Hello world', 'text/plain');\n\tlist.add(\n\t\tnew File(['🕺💃'], 'dance.png', {\n\t\t\ttype: 'image/png',\n\t\t}),\n\t);\n\n\texpect(list.length).toBe(2);\n\n\tlist.remove(2);\n\n\texpect(list.length).toBe(2);\n});\n"
  },
  {
    "path": "packages/unit-testing/__tests__/unit/drag-event-polyfill/data-transfer.spec.ts",
    "content": "test('types() should return a list of item types', () => {\n\tconst dataTransfer = new DataTransfer();\n\tdataTransfer.items.add('Hello world', 'text/plain');\n\tdataTransfer.items.add('<h1>hello</h1>', 'text/html');\n\n\texpect(dataTransfer.items.length).toBe(2);\n\n\texpect(Array.from(dataTransfer.types).sort()).toEqual(['text/plain', 'text/html'].sort());\n});\n\ntest('types() should return a unique type list', () => {\n\tconst dataTransfer = new DataTransfer();\n\tdataTransfer.items.add('Hello world', 'text/plain');\n\tdataTransfer.items.add(\n\t\tnew File(['🕺💃'], '1.png', {\n\t\t\ttype: 'image/png',\n\t\t}),\n\t);\n\tdataTransfer.items.add(\n\t\tnew File(['🕺💃'], '2.png', {\n\t\t\ttype: 'image/jpg',\n\t\t}),\n\t);\n\n\t// 2 files, 1 plain text\n\texpect(dataTransfer.items.length).toBe(3);\n\texpect(dataTransfer.types.length).toBe(2);\n\n\texpect(Array.from(dataTransfer.types).sort()).toEqual(['text/plain', 'Files'].sort());\n});\n\ntest('clearData(format) should remove any matching items (single item match)', (done) => {\n\tconst dataTransfer = new DataTransfer();\n\tdataTransfer.items.add('Hello world', 'text/plain');\n\tdataTransfer.items.add('<h1>hello</h1>', 'text/html');\n\n\texpect(dataTransfer.items.length).toBe(2);\n\n\tdataTransfer.clearData('text/plain');\n\n\texpect(dataTransfer.items.length).toBe(1);\n\texpect(Array.from(dataTransfer.types).sort()).toEqual(['text/html']);\n\tconst item: DataTransferItem = dataTransfer.items[0];\n\texpect(item.kind).toBe('string');\n\texpect(item.type).toBe('text/html');\n\titem.getAsString((value) => {\n\t\texpect(value).toBe('<h1>hello</h1>');\n\t\tdone();\n\t});\n});\n\ntest('clearData(format) should remove nothing if there is no matching item', () => {\n\tconst dataTransfer = new DataTransfer();\n\tdataTransfer.items.add('<h1>hello</h1>', 'text/html');\n\n\texpect(dataTransfer.items.length).toBe(1);\n\n\tdataTransfer.clearData('text/plain');\n\n\texpect(dataTransfer.items.length).toBe(1);\n\texpect(Array.from(dataTransfer.types).sort()).toEqual(['text/html']);\n});\n\ntest('clearData(\"Files\") should not remove files', () => {\n\tconst dataTransfer = new DataTransfer();\n\tconst file = new File(['🕺💃'], '1.png', {\n\t\ttype: 'image/png',\n\t});\n\tdataTransfer.items.add(file);\n\n\texpect(dataTransfer.items.length).toBe(1);\n\n\tdataTransfer.clearData();\n\n\texpect(dataTransfer.items.length).toBe(1);\n\texpect(Array.from(dataTransfer.types).sort()).toEqual(['Files']);\n});\n\ntest('clearData() should remove all non-file items', () => {\n\tconst dataTransfer = new DataTransfer();\n\tconst file = new File(['🕺💃'], '1.png', {\n\t\ttype: 'image/png',\n\t});\n\tdataTransfer.items.add('Hello world', 'text/plain');\n\tdataTransfer.items.add(file);\n\tdataTransfer.items.add('<h1>hello</h1>', 'text/html');\n\n\texpect(dataTransfer.items.length).toBe(3);\n\n\tdataTransfer.clearData();\n\n\texpect(dataTransfer.items.length).toBe(1);\n\texpect(Array.from(dataTransfer.types).sort()).toEqual(['Files']);\n\n\tconst item: DataTransferItem = dataTransfer.items[0];\n\tconst result = item.getAsFile();\n\texpect(item.kind).toBe('file');\n\texpect(item.type).toBe('image/png');\n\texpect(result).toBe(file);\n});\n\ntest('clearData(\"text\") should clear a \"text/plain\" item', () => {\n\tconst dataTransfer = new DataTransfer();\n\tdataTransfer.items.add('Hello world', 'text/plain');\n\tdataTransfer.items.add('<h1>hello</h1>', 'text/html');\n\n\tdataTransfer.clearData('text');\n\n\texpect(dataTransfer.items.length).toBe(1);\n\texpect(Array.from(dataTransfer.types).sort()).toEqual(['text/html']);\n});\n\ntest('clearData(\"url\") should clear a \"text/uri-list\" item', () => {\n\tconst dataTransfer = new DataTransfer();\n\tdataTransfer.items.add('https://hello-world', 'text/uri-list');\n\tdataTransfer.items.add('<h1>hello</h1>', 'text/html');\n\n\tdataTransfer.clearData('url');\n\n\texpect(dataTransfer.items.length).toBe(1);\n\texpect(Array.from(dataTransfer.types).sort()).toEqual(['text/html']);\n});\n\ntest('clearData(format) should convert the format to lowercase', () => {\n\tconst dataTransfer = new DataTransfer();\n\tdataTransfer.items.add('Hello world', 'My-Type');\n\n\texpect(dataTransfer.items[0]?.type).toBe('my-type');\n\n\tdataTransfer.clearData('My-Type');\n\n\texpect(dataTransfer.items.length).toBe(0);\n});\n\ntest('getData(format) should return an item of matching format', () => {\n\tconst dataTransfer = new DataTransfer();\n\tdataTransfer.items.add('Hello world', 'text/plain');\n\tdataTransfer.items.add('<h1>hello</h1>', 'text/html');\n\n\texpect(dataTransfer.getData('text/plain')).toEqual('Hello world');\n\texpect(dataTransfer.getData('text/html')).toEqual('<h1>hello</h1>');\n});\n\ntest('getData(format) should return \"\" when there is no match', () => {\n\tconst dataTransfer = new DataTransfer();\n\tdataTransfer.items.add('<h1>hello</h1>', 'text/html');\n\n\texpect(dataTransfer.getData('text/plain')).toEqual('');\n});\n\ntest('getData(\"Files\") should return \"\" even if there are file items', () => {\n\tconst dataTransfer = new DataTransfer();\n\tconst file = new File(['🕺💃'], '1.png', {\n\t\ttype: 'image/png',\n\t});\n\tdataTransfer.items.add(file);\n\n\texpect(dataTransfer.items.length).toBe(1);\n\texpect(Array.from(dataTransfer.types).sort()).toEqual(['Files']);\n\n\texpect(dataTransfer.getData('Files')).toEqual('');\n});\n\ntest('getData(\"text\") should return a \"text/plain\" entry', () => {\n\tconst dataTransfer = new DataTransfer();\n\tdataTransfer.items.add('Hi', 'text/plain');\n\n\texpect(dataTransfer.getData('text')).toEqual('Hi');\n});\n\ntest('getData(\"url\") should return a \"text/uri-list\" entry', () => {\n\tconst dataTransfer = new DataTransfer();\n\tdataTransfer.items.add('https://atlassian.design/', 'text/uri-list');\n\n\texpect(dataTransfer.getData('url')).toEqual('https://atlassian.design/');\n});\n\ntest('getData(\"url\") should only return the first url', () => {\n\tconst dataTransfer = new DataTransfer();\n\tdataTransfer.items.add(\n\t\t'#first\\r\\nhttps://atlassian.design/\\r\\n#second\\r\\nhttps://www.atlassian.com/\\r\\n#third',\n\t\t'text/uri-list',\n\t);\n\n\texpect(dataTransfer.getData('url')).toEqual('https://atlassian.design/');\n});\n\ntest('getData(\"text\") should return all urls (if it contained urls)', () => {\n\tconst dataTransfer = new DataTransfer();\n\tconst text =\n\t\t'#first\\r\\nhttps://atlassian.design/\\r\\n#second\\r\\nhttps://www.atlassian.com/\\r\\n#third';\n\t// adding this as text data even though it's url data\n\tdataTransfer.items.add(text, 'text/plain');\n\n\texpect(dataTransfer.getData('text')).toEqual(text);\n});\n\ntest('getData(format) should convert the format to lowercase for lookup', () => {\n\tconst dataTransfer = new DataTransfer();\n\tdataTransfer.items.add('Hello world', 'My-Type');\n\n\t// stored as a lowercase type\n\texpect(dataTransfer.items[0]?.type).toBe('my-type');\n\n\texpect(dataTransfer.getData('My-Type')).toEqual('Hello world');\n});\n\ntest('setData(format, data) should add a relevant item', (done) => {\n\tconst dataTransfer = new DataTransfer();\n\tdataTransfer.setData('text/plain', 'Hello world');\n\n\texpect(dataTransfer.items.length).toBe(1);\n\tconst item = dataTransfer.items[0];\n\texpect(item.kind).toBe('string');\n\texpect(item.type).toBe('text/plain');\n\titem.getAsString((value) => {\n\t\texpect(value).toBe('Hello world');\n\t\tdone();\n\t});\n});\n\ntest('setData(format, data) should convert the format to lower case', (done) => {\n\tconst dataTransfer = new DataTransfer();\n\tdataTransfer.setData('My-Type', 'Hello world');\n\n\texpect(dataTransfer.items.length).toBe(1);\n\tconst item = dataTransfer.items[0];\n\texpect(item.kind).toBe('string');\n\texpect(item.type).toBe('my-type');\n\titem.getAsString((value) => {\n\t\texpect(value).toBe('Hello world');\n\t\tdone();\n\t});\n});\n\ntest('setData(\"text\", data) should convert the format to lower \"text/plain\"', (done) => {\n\tconst dataTransfer = new DataTransfer();\n\tdataTransfer.setData('text', 'Hello world');\n\n\texpect(dataTransfer.items.length).toBe(1);\n\tconst item = dataTransfer.items[0];\n\texpect(item.kind).toBe('string');\n\texpect(item.type).toBe('text/plain');\n\titem.getAsString((value) => {\n\t\texpect(value).toBe('Hello world');\n\t\tdone();\n\t});\n});\n\ntest('setData(\"url\", data) should convert the format to lower \"text/uri-list\"', (done) => {\n\tconst dataTransfer = new DataTransfer();\n\tdataTransfer.setData('text/uri-list', 'https://atlassian.design/');\n\n\texpect(dataTransfer.items.length).toBe(1);\n\tconst item = dataTransfer.items[0];\n\texpect(item.kind).toBe('string');\n\texpect(item.type).toBe('text/uri-list');\n\titem.getAsString((value) => {\n\t\texpect(value).toBe('https://atlassian.design/');\n\t\tdone();\n\t});\n});\n"
  },
  {
    "path": "packages/unit-testing/afm-products/tsconfig.json",
    "content": "{\n\t\"extends\": \"../../../../tsconfig.local-consumption.json\",\n\t\"compilerOptions\": {\n\t\t\"target\": \"es5\",\n\t\t\"outDir\": \"../../../../../tsDist/@atlaskit__pragmatic-drag-and-drop-unit-testing/app\",\n\t\t\"rootDir\": \"../\",\n\t\t\"composite\": true,\n\t\t\"noCheck\": true\n\t},\n\t\"include\": [\n\t\t\"../src/**/*.ts\",\n\t\t\"../src/**/*.tsx\"\n\t],\n\t\"exclude\": [\n\t\t\"../src/**/__tests__/*\",\n\t\t\"../src/**/*.test.*\",\n\t\t\"../src/**/test.*\",\n\t\t\"../src/**/examples.*\",\n\t\t\"../src/**/examples/*\",\n\t\t\"../src/**/examples/**/*\",\n\t\t\"../src/**/*.stories.*\",\n\t\t\"../src/**/stories/*\",\n\t\t\"../src/**/stories/**/*\"\n\t],\n\t\"references\": []\n}\n"
  },
  {
    "path": "packages/unit-testing/constellation/index/about.mdx",
    "content": "---\norder: 0\ntitle: Unit testing\ndescription: An optional package for Pragmatic drag and drop with helpers for unit testing\n---\n\n## `DragEvent` polyfill\n\nPragmatic drag and drop heavily leverages `DragEvent`. However, many unit testing environments (eg\n[jsdom](https://github.com/jsdom/jsdom)) don't polyfill `DragEvent`. We have created a `DragEvent`\npolyfill will allow you to start leveraging `DragEvent` in unit testing environments.\n\n```ts\nimport '@atlaskit/pragmatic-drag-and-drop/unit-testing/drag-event-polyfill';\n```\n\nSetup using [`jest`](https://jestjs.io/):\n\n```ts\n// jest.config.js\nmodule.exports = {\n\tsetupFiles: ['./test/setup-drag-events.js'],\n};\n\n// ./test/setup-drag-events.js\nimport '@atlaskit/pragmatic-drag-and-drop/unit-testing/drag-event-polyfill';\n```\n\nThis polyfill will polyfill [`DragEvent`] as well the other globals that `DragEvent` requires:\n\n- [`DataTransferItemList`]\n- [`DataTransfer`]\n\n### Differences from the specifications\n\nThis test environment polyfill intentially does not implement\n[permissions](https://html.spec.whatwg.org/multipage/dnd.html#the-drag-data-store) (`\"read/write\"`,\n`\"read-only\"`, or `\"protected\"`) for `DataTransfer` or `DataTransferItemList`. Implementing these\npermissions would prevent the adding of data to the data transfer during the creation of a\n`DragEvent`, which is super helpful for testing.\n\n```ts\nconst event = new DragEvent('dragenter', {\n\tcancelable: true,\n\tbubbles: true,\n});\nevent.dataTransfer?.items.add('hello world', 'text/plain');\n\ntarget.dispatchEvent(event);\n```\n\n## `DOMRect` polyfill\n\nPragmatic drag and drop leverages `DOMRect`. Some unit testing environments (eg\n[jsdom](https://github.com/jsdom/jsdom)) don't polyfill `DOMRect`. We have created a `DOMRect`\npolyfill will allow you to start leveraging `DOMRect` in unit testing environments.\n\n```ts\nimport '@atlaskit/pragmatic-drag-and-drop/unit-testing/dom-rect-polyfill';\n```\n\nSetup using [`jest`](https://jestjs.io/):\n\n```ts\n// jest.config.js\nmodule.exports = {\n\tsetupFiles: ['./test/setup-dom-rect.js'],\n};\n\n// ./test/setup-dom-rect.js\nimport '@atlaskit/pragmatic-drag-and-drop/unit-testing/dom-rect-polyfill';\n```\n"
  },
  {
    "path": "packages/unit-testing/constellation/index/props.mdx",
    "content": "<!-- Turn off automatic prop extraction as there isn't anything to extract. -->\n"
  },
  {
    "path": "packages/unit-testing/package.json",
    "content": "{\n  \"name\": \"@atlaskit/pragmatic-drag-and-drop-unit-testing\",\n  \"version\": \"1.1.1\",\n  \"description\": \"An optional package for Pragmatic drag and drop with helpers for unit testing\",\n  \"publishConfig\": {\n    \"registry\": \"https://registry.npmjs.org/\"\n  },\n  \"repository\": \"https://github.com/atlassian/pragmatic-drag-and-drop\",\n  \"author\": \"Atlassian Pty Ltd\",\n  \"license\": \"Apache-2.0\",\n  \"main\": \"dist/cjs/index.js\",\n  \"module\": \"dist/esm/index.js\",\n  \"module:es2019\": \"dist/es2019/index.js\",\n  \"types\": \"dist/types/index.d.ts\",\n  \"sideEffects\": true,\n  \"dependencies\": {\n    \"@babel/runtime\": \"^7.0.0\"\n  },\n  \"devDependencies\": {\n    \"tiny-invariant\": \"^1.2.0\"\n  },\n  \"exports\": {\n    \".\": \"./src/index.ts\",\n    \"./drag-event-polyfill\": \"./src/drag-event-polyfill.ts\",\n    \"./dom-rect-polyfill\": \"./src/dom-rect-polyfill.ts\"\n  },\n  \"homepage\": \"https://atlassian.design/components/pragmatic-drag-and-drop/\"\n}\n"
  },
  {
    "path": "packages/unit-testing/src/dom-rect-polyfill.ts",
    "content": "// This file polyfills DOMRect\n// DOMRect is currently not polyfilled by jsdom\n\n(() => {\n\tif (typeof window === 'undefined') {\n\t\treturn;\n\t}\n\tif (window.DOMRect) {\n\t\treturn;\n\t}\n\n\tclass DOMRect {\n\t\tx: number;\n\t\ty: number;\n\t\twidth: number;\n\t\theight: number;\n\t\ttop: number;\n\t\tright: number;\n\t\tbottom: number;\n\t\tleft: number;\n\n\t\tconstructor(x = 0, y = 0, width = 0, height = 0) {\n\t\t\tthis.x = x;\n\t\t\tthis.y = y;\n\t\t\tthis.width = width;\n\t\t\tthis.height = height;\n\n\t\t\t// Computed values.\n\t\t\t// See https://developer.mozilla.org/en-US/docs/Web/API/DOMRect\n\t\t\tthis.top = height < 0 ? y + height : y;\n\t\t\tthis.right = width < 0 ? x : x + width;\n\t\t\tthis.bottom = height < 0 ? y : y + height;\n\t\t\tthis.left = width < 0 ? x + width : x;\n\t\t}\n\n\t\tstatic fromRect(rectangle: DOMRectInit | undefined) {\n\t\t\treturn new DOMRect(rectangle?.x, rectangle?.y, rectangle?.width, rectangle?.height);\n\t\t}\n\n\t\ttoJSON() {\n\t\t\treturn this;\n\t\t}\n\t}\n\n\twindow.DOMRect = DOMRect;\n})();\n"
  },
  {
    "path": "packages/unit-testing/src/drag-event-polyfill.ts",
    "content": "// This file polyfills DragEvent for jsdom\n// https://github.com/jsdom/jsdom/issues/2913\n// This file is in JS rather than TS, as our jsdom setup files currently need to be in JS\n// Good news: DragEvents are almost the same as MouseEvents\n\n(() => {\n\tif (typeof window === 'undefined') {\n\t\treturn;\n\t}\n\n\t// Polyfill not needed\n\n\tif (typeof window.DragEvent !== 'undefined') {\n\t\treturn;\n\t}\n\n\t// Let's create what we need for DragEvent's!\n\n\tif (window.DataTransferItemList) {\n\t\tthrow new Error(`Unexpected global found: \"DataTransferItemList\"`);\n\t}\n\n\tif (window.DataTransfer) {\n\t\tthrow new Error(`Unexpected global found: \"DataTransfer\"`);\n\t}\n\n\t// Note: window.FileList will be created by jsdom\n\n\t// Using this so we can quickly look up an items\n\t// data without needing to go through the public async API\n\t// to get item values\n\tconst fastItemValueLookup = Symbol('item-value');\n\n\t/**\n\t * Note: this polyfill does not implement \"read/write\", \"read-only\" or \"protected\"\n\t * permissions for `DataTransferItemList` or `DataTransfer`.\n\t * Adding these permissions in make it impossible to set values like `.types` or `.items`\n\t * in events other than `\"dragstart\"`, which we commonly want to be able to set in tests\n\t *\n\t * Examples:\n\t *\n\t * - You often want to add `.items` for a `\"drop\"` event (to test you can pull the `.items` out)\n\t * but `.items` can only be set in `\"dragstart\"`.\n\t *\n\t * - Similarly, you often want to access `.types` in drag events,\n\t * but they can only be set in `\"dragstart\"`\n\t */\n\n\t/**\n\t * Cheating an making `DataTransferItemList` extend an `Array` so we can get:\n\t * - `list.length` for free (could create a getter)\n\t * - indexed lookup (`list[0]`) for free (otherwise need a Proxy)\n\t */\n\twindow.DataTransferItemList = class DataTransferItemList extends Array {\n\t\t/**\n\t\t * https://html.spec.whatwg.org/multipage/dnd.html#dom-datatransferitemlist-add\n\t\t */\n\t\tadd(stringValueOrFile: string | File, stringMimeType?: string): DataTransferItem {\n\t\t\tif (stringValueOrFile instanceof File) {\n\t\t\t\tconst item: DataTransferItem = {\n\t\t\t\t\tkind: 'file',\n\t\t\t\t\t// The type of file being dragged (eg \"image/jpeg\")\n\t\t\t\t\ttype: stringValueOrFile.type,\n\t\t\t\t\tgetAsFile: () => {\n\t\t\t\t\t\treturn stringValueOrFile;\n\t\t\t\t\t},\n\t\t\t\t\tgetAsString: (/* callback */) => {\n\t\t\t\t\t\t// callback will never be resolved for files\n\t\t\t\t\t},\n\t\t\t\t\twebkitGetAsEntry() {\n\t\t\t\t\t\tthrow new Error('webkitGetAsEntry() not implemented');\n\t\t\t\t\t},\n\t\t\t\t\t// This allows us to lookup items synchronously with `dataTransfer.getData()`\n\t\t\t\t\t// @ts-expect-error: custom property\n\t\t\t\t\t[fastItemValueLookup]: stringValueOrFile,\n\t\t\t\t};\n\t\t\t\tthis.push(item);\n\t\t\t\treturn item;\n\t\t\t}\n\t\t\tif (\n\t\t\t\ttypeof stringValueOrFile === 'string' &&\n\t\t\t\t// TODO: what if first argument is a string, and second is not provided?\n\t\t\t\ttypeof stringMimeType === 'string'\n\t\t\t) {\n\t\t\t\t// `type` gets converted to lowercase according to the spec\n\t\t\t\tconst type = stringMimeType.toLocaleLowerCase();\n\t\t\t\t// Throws if adding data to a type that already has data\n\t\t\t\tconst exists = this.some((item) => item.kind === 'string' && item.type === type);\n\t\t\t\tif (exists) {\n\t\t\t\t\tthrow new DOMException('NotSupportedError');\n\t\t\t\t}\n\n\t\t\t\tconst item: DataTransferItem = {\n\t\t\t\t\tkind: 'string',\n\t\t\t\t\ttype,\n\t\t\t\t\tgetAsFile: () => {\n\t\t\t\t\t\t// this will be `null` for non-files\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t},\n\t\t\t\t\tgetAsString: (callback) => {\n\t\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\t\tcallback?.(stringValueOrFile);\n\t\t\t\t\t\t});\n\t\t\t\t\t},\n\t\t\t\t\twebkitGetAsEntry() {\n\t\t\t\t\t\tthrow new Error('webkitGetAsEntry() not implemented');\n\t\t\t\t\t},\n\t\t\t\t\t// This allows us to lookup items synchronously with `dataTransfer.getData()`\n\t\t\t\t\t// @ts-expect-error: custom property\n\t\t\t\t\t[fastItemValueLookup]: stringValueOrFile,\n\t\t\t\t};\n\t\t\t\tthis.push(item);\n\t\t\t\treturn item;\n\t\t\t}\n\t\t\tthrow new Error(\n\t\t\t\t'Unexpected arguments. Expected: .add(file: File) or .add(data: string, type: string)',\n\t\t\t);\n\t\t}\n\n\t\t/**\n\t\t * Removes an item at a given index\n\t\t */\n\t\tremove(index: number): void {\n\t\t\tthis.splice(index, 1);\n\t\t}\n\n\t\t/**\n\t\t * Removes all items\n\t\t */\n\t\tclear(): void {\n\t\t\tthis.length = 0;\n\t\t}\n\t};\n\n\t/**\n\t * Get the full media type, adjusting for shorthand lookup values.\n\t * https://html.spec.whatwg.org/multipage/dnd.html#dom-datatransfer-getdata\n\t */\n\tfunction getFullFormat(formatOrShorthand: string): {\n\t\tformat: string;\n\t\tconvertToURL: boolean;\n\t} {\n\t\tconst lower = formatOrShorthand.toLocaleLowerCase();\n\n\t\t// shorthands\n\n\t\tif (lower === 'text') {\n\t\t\treturn { format: 'text/plain', convertToURL: false };\n\t\t}\n\t\t// From spec:\n\t\t// If format equals \"url\", change it to \"text/uri-list\" and set convert-to-URL to true.\n\t\tif (lower === 'url') {\n\t\t\treturn { format: 'text/uri-list', convertToURL: true };\n\t\t}\n\t\treturn { format: lower, convertToURL: false };\n\t}\n\n\t/**\n\t * https://html.spec.whatwg.org/multipage/dnd.html#the-datatransfer-interface\n\t */\n\twindow.DataTransfer = class {\n\t\tdropEffect: DataTransfer['dropEffect'];\n\t\teffectAllowed: DataTransfer['effectAllowed'];\n\t\titems: DataTransferItemList;\n\n\t\tconstructor() {\n\t\t\t// From spec:\n\t\t\t// > Set the dropEffect and effectAllowed to \"none\".\n\t\t\tthis.dropEffect = 'none';\n\n\t\t\t// Not implementing mode restrictions so this can be set in testing\n\t\t\t// for any event\n\t\t\tthis.effectAllowed = 'none';\n\n\t\t\t// DataTransferItemList() is usually a hidden constructor\n\t\t\tthis.items = new DataTransferItemList();\n\t\t}\n\n\t\t/**\n\t\t * Get unique types of `.items`\n\t\t * https://html.spec.whatwg.org/multipage/dnd.html#concept-datatransfer-types\n\t\t */\n\t\tget types(): string[] {\n\t\t\tconst all = Array.from(this.items).map((item) => {\n\t\t\t\tif (item.kind === 'string') {\n\t\t\t\t\treturn item.type;\n\t\t\t\t}\n\t\t\t\treturn 'Files';\n\t\t\t});\n\t\t\t// it is possible to have multiple 'Files' entries\n\t\t\t// so we need to strip them out\n\t\t\tconst unique = Array.from(new Set(all));\n\t\t\t// sorting for consistency\n\t\t\treturn unique.sort();\n\t\t}\n\n\t\t/**\n\t\t * Get files being dragged\n\t\t */\n\t\tget files(): FileList {\n\t\t\t/**\n\t\t\t * JSDOM polyfills `FileList`, but we cannot create a `FileList` directly\n\t\t\t * with `new FileList()` as it is an illegal constructor.\n\t\t\t * Instead, creating an object that satisfies the `FileList` type\n\t\t\t */\n\n\t\t\tconst files: File[] = Array.from(this.items)\n\t\t\t\t.filter((item) => item.kind === 'file')\n\t\t\t\t.map((item) => item.getAsFile())\n\t\t\t\t.filter((item): item is File => item !== null);\n\n\t\t\tconst list: FileList = {\n\t\t\t\t// will spread out to be { [index]: file }\n\t\t\t\t...files,\n\t\t\t\tlength: files.length,\n\t\t\t\titem: (index: number) => list[index] ?? null,\n\t\t\t\t// @ts-ignore - TS2418 TypeScript 5.9.2 upgrade\n\t\t\t\t[Symbol.iterator]: function* generator() {\n\t\t\t\t\tfor (let i = 0; i < list.length; i++) {\n\t\t\t\t\t\tyield list[i];\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t};\n\n\t\t\treturn list;\n\t\t}\n\n\t\t/**\n\t\t * Clears string items. Note: cannot be used to clear files\n\t\t * https://html.spec.whatwg.org/multipage/dnd.html#dom-datatransfer-cleardata\n\t\t */\n\t\tclearData(format?: string): void {\n\t\t\tif (format) {\n\t\t\t\tconst actualFormat = getFullFormat(format).format;\n\t\t\t\tconst index = Array.from(this.items).findIndex((item) => {\n\t\t\t\t\t// Note: can never clear files with `clearData`\n\t\t\t\t\treturn item.type === actualFormat;\n\t\t\t\t});\n\t\t\t\tif (index !== -1) {\n\t\t\t\t\tthis.items.remove(index);\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// According to the spec, `.clearData()` does not remove files.\n\t\t\t// However, in Chrome it does remove files...\n\n\t\t\t// Looping backwards so that we can safely remove\n\t\t\t// items without messing up indexes\n\t\t\tfor (let i = this.items.length - 1; i >= 0; i--) {\n\t\t\t\tconst item = this.items[i];\n\t\t\t\tif (item.kind === 'string') {\n\t\t\t\t\tthis.items.remove(i);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * This function is only used to get the value of string items\n\t\t * https://html.spec.whatwg.org/multipage/dnd.html#dom-datatransfer-getdata\n\t\t */\n\t\tgetData(format: string): string {\n\t\t\tconst result = getFullFormat(format);\n\t\t\tconst match = Array.from(this.items).find(\n\t\t\t\t(item) => item.kind === 'string' && item.type === result.format,\n\t\t\t);\n\t\t\tif (!match) {\n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\t// @ts-expect-error - cannot usually look up a value using a symbol\n\t\t\tconst value: string = match[fastItemValueLookup];\n\n\t\t\tif (!result.convertToURL) {\n\t\t\t\treturn value;\n\t\t\t}\n\n\t\t\t// From spec:\n\t\t\t// If convert-to-URL is true, then parse result as appropriate for text/uri-list data, and then set result to the first URL from the list, if any, or the empty string otherwise. [RFC2483]\n\n\t\t\tconst urls = value\n\t\t\t\t// You can have multiple urls split by CR+LF (EOL)\n\t\t\t\t// - CR: Carriage Return '\\r'\n\t\t\t\t// - LF: Line Feed '\\n'\n\t\t\t\t// - EOL: End of Line '\\r\\n'\n\t\t\t\t.split('\\r\\n')\n\t\t\t\t// a uri-list can have comment lines starting with '#'\n\t\t\t\t// so we need to remove those\n\t\t\t\t.filter((piece) => !piece.startsWith('#'));\n\n\t\t\treturn urls[0] ?? '';\n\t\t}\n\n\t\t/** This function is only used to set string items\n\t\t *\n\t\t * @see https://html.spec.whatwg.org/multipage/dnd.html#dom-datatransfer-setdata\n\t\t */\n\t\tsetData(format: string, data: string): void {\n\t\t\tconst actualFormat = getFullFormat(format).format;\n\n\t\t\t// clear existing item with matching format\n\t\t\tthis.clearData(actualFormat);\n\n\t\t\tthis.items.add(data, actualFormat);\n\t\t}\n\n\t\tsetDragImage() {\n\t\t\t// doesn't do anything for our polyfill\n\t\t}\n\t};\n\n\twindow.DragEvent = class DragEvent extends MouseEvent {\n\t\tprivate _pageX: number;\n\t\tprivate _pageY: number;\n\t\tdataTransfer: DataTransfer;\n\t\tconstructor(\n\t\t\ttype: string,\n\t\t\teventInitDict: DragEventInit & { pageX?: number; pageY?: number } = {},\n\t\t) {\n\t\t\tsuper(type, eventInitDict);\n\t\t\t// Use private fields to store the values\n\t\t\tthis._pageX = eventInitDict.pageX ?? 0;\n\t\t\tthis._pageY = eventInitDict.pageY ?? 0;\n\t\t\tthis.dataTransfer = new DataTransfer();\n\t\t\t// Define getters and setters for pageX and pageY\n\t\t\tObject.defineProperty(this, 'pageX', {\n\t\t\t\tget: () => this._pageX,\n\t\t\t\tset: (value: number) => {\n\t\t\t\t\tthis._pageX = value;\n\t\t\t\t},\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t});\n\t\t\tObject.defineProperty(this, 'pageY', {\n\t\t\t\tget: () => this._pageY,\n\t\t\t\tset: (value: number) => {\n\t\t\t\t\tthis._pageY = value;\n\t\t\t\t},\n\t\t\t\tconfigurable: true,\n\t\t\t\tenumerable: true,\n\t\t\t});\n\t\t}\n\n\t\tget pageX() {\n\t\t\treturn this._pageX;\n\t\t}\n\t\tget pageY() {\n\t\t\treturn this._pageY;\n\t\t}\n\t};\n})();\n"
  },
  {
    "path": "packages/unit-testing/src/index.ts",
    "content": "export {};\n"
  },
  {
    "path": "packages/unit-testing/tsconfig.json",
    "content": "{\n  \"extends\": \"../../tsconfig.json\",\n  \"include\": [\n    \"__tests__/**/*.ts\",\n    \"__tests__/**/*.tsx\",\n    \"examples/**/*.ts\",\n    \"examples/**/*.tsx\",\n    \"src/**/*.ts\",\n    \"src/**/*.tsx\",\n    \"src/drag-event-polyfill.ts\",\n    \"**/stories.ts\",\n    \"**/stories.tsx\",\n    \"**/stories/*.ts\",\n    \"**/stories/*.tsx\",\n    \"**/stories/**/*.ts\",\n    \"**/stories/**/*.tsx\"\n  ]\n}\n"
  },
  {
    "path": "patches/@types+jest+29.5.12.patch",
    "content": "diff --git a/node_modules/@types/jest/index.d.ts b/node_modules/@types/jest/index.d.ts\nindex 32d0710..f31a185 100644\n--- a/node_modules/@types/jest/index.d.ts\n+++ b/node_modules/@types/jest/index.d.ts\n@@ -421,8 +421,11 @@ declare namespace jest {\n     function unmock(moduleName: string): typeof jest;\n     /**\n      * Instructs Jest to use fake versions of the standard timer functions.\n+     * \n+     * Augmented to add string type for backwards compatibility with legacy jest versions\n      */\n-    function useFakeTimers(config?: FakeTimersConfig | LegacyFakeTimersConfig): typeof jest;\n+    function useFakeTimers(config?: FakeTimersConfig | LegacyFakeTimersConfig | string): typeof jest;\n+    \n     /**\n      * Instructs Jest to use the real versions of the standard timer functions.\n      */\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n    \"include\": [\n      \"__tests__/**/*.ts\",\n      \"__tests__/**/*.tsx\",\n      \"docs/**/*.ts\",\n      \"docs/**/*.tsx\",\n      \"examples/**/*.ts\",\n      \"examples/**/*.tsx\",\n      \"src/**/*.ts\",\n      \"src/**/*.tsx\",\n    ],\n    \"compilerOptions\": {\n        \"allowJs\": false,\n        \"strict\": true,\n        \"allowSyntheticDefaultImports\": true,\n        \"declaration\": true,\n        \"emitDeclarationOnly\": true,\n        \"esModuleInterop\": true,\n        \"experimentalDecorators\": true,\n        \"downlevelIteration\": true,\n        \"importHelpers\": true,\n        \"jsx\": \"react\",\n        \"moduleResolution\": \"bundler\",\n        \"noFallthroughCasesInSwitch\": true,\n        \"noUnusedLocals\": true,\n        \"sourceMap\": true,\n        \"skipLibCheck\": true,\n        // Disallow features that require cross-file information for emit\n        \"isolatedModules\": true,\n        // We default to targetting es2019 so that IDE's will perform the stricter checks that they do\n        // for es2019 (reason is unkown for why targeting es2019 is stricter...)\n        \"target\": \"es2019\",\n        \"module\": \"esnext\",\n        \"lib\": [\n            \"dom\",\n            \"dom.iterable\",\n            \"es5\",\n            \"scripthost\",\n            \"es2015.core\",\n            \"es2015.collection\",\n            \"es2015.symbol\",\n            \"es2015.iterable\",\n            \"es2015.promise\",\n            \"es2016.array.include\",\n            \"es2017\"\n        ]\n    },\n}\n"
  }
]