planning
All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s

This commit is contained in:
2024-10-14 09:15:30 +02:00
parent bcba00a730
commit 6e64e138e2
21059 changed files with 2317811 additions and 1 deletions

562
node_modules/@dnd-kit/sortable/CHANGELOG.md generated vendored Normal file
View File

@@ -0,0 +1,562 @@
# @dnd-kit/sortable
## 7.0.2
### Patch Changes
- [#788](https://github.com/clauderic/dnd-kit/pull/788) [`da94c02`](https://github.com/clauderic/dnd-kit/commit/da94c02a26986b8816b7b31e318f68e9e1b9a1d2) Thanks [@clauderic](https://github.com/clauderic)! - Bug fixes for React 18 Strict Mode
- Updated dependencies [[`da94c02`](https://github.com/clauderic/dnd-kit/commit/da94c02a26986b8816b7b31e318f68e9e1b9a1d2)]:
- @dnd-kit/core@6.0.7
## 7.0.1
### Patch Changes
- [#792](https://github.com/clauderic/dnd-kit/pull/792) [`b6970e7`](https://github.com/clauderic/dnd-kit/commit/b6970e78da868ea5c9f49368e88401d5b4cae765) Thanks [@clauderic](https://github.com/clauderic)! - The `hasSortableData` type-guard that is exported by @dnd-kit/sortable has been updated to also accept the `Active` and `Over` interfaces so it can be used in events such as `onDragStart`, `onDragOver`, and `onDragEnd`.
- Updated dependencies [[`eaa6e12`](https://github.com/clauderic/dnd-kit/commit/eaa6e126b8e4141b87d92d23478c47f5ba204f25)]:
- @dnd-kit/core@6.0.4
## 7.0.0
### Major Changes
- [#755](https://github.com/clauderic/dnd-kit/pull/755) [`33e6dd2`](https://github.com/clauderic/dnd-kit/commit/33e6dd2dc954f1f2da90d8f8af995021031b6b41) Thanks [@clauderic](https://github.com/clauderic)! - The `UniqueIdentifier` type has been updated to now accept either `string` or `number` identifiers. As a result, the `id` property of `useDraggable`, `useDroppable` and `useSortable` and the `items` prop of `<SortableContext>` now all accept either `string` or `number` identifiers.
#### Migration steps
For consumers that are using TypeScript, import the `UniqueIdentifier` type to have strongly typed local state:
```diff
+ import type {UniqueIdentifier} from '@dnd-kit/core';
function MyComponent() {
- const [items, setItems] = useState(['A', 'B', 'C']);
+ const [items, setItems] = useState<UniqueIdentifier>(['A', 'B', 'C']);
}
```
Alternatively, consumers can cast or convert the `id` property to a `string` when reading the `id` property of interfaces such as `Active`, `Over`, `DroppableContainer` and `DraggableNode`.
The `draggableNodes` object has also been converted to a map. Consumers that were reading from the `draggableNodes` property that is available on the public context of `<DndContext>` should follow these migration steps:
```diff
- draggableNodes[someId];
+ draggableNodes.get(someId);
```
- [#660](https://github.com/clauderic/dnd-kit/pull/660) [`30bbd12`](https://github.com/clauderic/dnd-kit/commit/30bbd12f9606c2e99523cb9ece465041cb37e916) Thanks [@clauderic](https://github.com/clauderic)! - Changes to the default `sortableKeyboardCoordinates` KeyboardSensor coordinate getter.
#### Better handling of variable sizes
The default `sortableKeyboardCoordinates` function now has better handling of lists that have items of variable sizes. We recommend that consumers re-order lists `onDragOver` instead of `onDragEnd` when sorting lists of variable sizes via the keyboard for optimal compatibility.
#### Better handling of overlapping droppables
The default `sortableKeyboardCoordinates` function that is exported from the `@dnd-kit/sortable` package has been updated to better handle cases where the collision rectangle is overlapping droppable rectangles. For example, for `down` arrow key, the default function had logic that would only consider collisions against droppables that were below the `bottom` edge of the collision rect. This was problematic when the collision rect was overlapping droppable rects, because it meant that it's bottom edge was below the top edge of the droppable, and that resulted in that droppable being skipped.
```diff
- collisionRect.bottom > droppableRect.top
+ collisionRect.top > droppableRect.top
```
This change should be backwards compatible for most consumers, but may introduce regressions in some use-cases, especially for consumers that may have copied the multiple containers examples. There is now a custom sortable keyboard coordinate getter [optimized for multiple containers that you can refer to](https://github.com/clauderic/dnd-kit/tree/master/stories/2%20-%20Presets/Sortable/multipleContainersKeyboardCoordinates.ts).
### Minor Changes
- [#748](https://github.com/clauderic/dnd-kit/pull/748) [`59ca82b`](https://github.com/clauderic/dnd-kit/commit/59ca82b9f228f34c7731ece87aef5d9633608b57) Thanks [@clauderic](https://github.com/clauderic)! - Automatic focus management and activator node refs.
#### Introducing activator node refs
Introducing the concept of activator node refs for `useDraggable` and `useSortable`. This allows @dnd-kit to handle common use-cases such as restoring focus on the activator node after dragging via the keyboard or only allowing the activator node to instantiate the keyboard sensor.
Consumers of `useDraggable` and `useSortable` may now optionally set the activator node ref on the element that receives listeners:
```diff
import {useDraggable} from '@dnd-kit/core';
function Draggable(props) {
const {
listeners,
setNodeRef,
+ setActivatorNodeRef,
} = useDraggable({id: props.id});
return (
<div ref={setNodeRef}>
Draggable element
<button
{...listeners}
+ ref={setActivatorNodeRef}
>
:: Drag Handle
</button>
</div>
)
}
```
It's common for the activator element (the element that receives the sensor listeners) to differ from the draggable node. When this happens, @dnd-kit has no reliable way to get a reference to the activator node after dragging ends, as the original `event.target` that instantiated the sensor may no longer be mounted in the DOM or associated with the draggable node that was previously active.
#### Automatically restoring focus
Focus management is now automatically handled by @dnd-kit. When the activator event is a Keyboard event, @dnd-kit will now attempt to automatically restore focus back to the first focusable node of the activator node or draggable node.
If no activator node is specified via the `setActivatorNodeRef` setter function of `useDraggble` and `useSortable`, @dnd-kit will automatically restore focus on the first focusable node of the draggable node set via the `setNodeRef` setter function of `useDraggable` and `useSortable`.
If you were previously managing focus manually and would like to opt-out of automatic focus management, use the newly introduced `restoreFocus` property of the `accessibility` prop of `<DndContext>`:
```diff
<DndContext
accessibility={{
+ restoreFocus: false
}}
```
- [#672](https://github.com/clauderic/dnd-kit/pull/672) [`10f6836`](https://github.com/clauderic/dnd-kit/commit/10f683631103b1d919f2fbca1177141b9369d2cf) Thanks [@clauderic](https://github.com/clauderic)! - `SortableContext` now always requests measuring of droppable containers when its `items` prop changes, regardless of whether or not dragging is in progress. Measuring will occur if the measuring configuration allows for it.
- [#754](https://github.com/clauderic/dnd-kit/pull/754) [`224201a`](https://github.com/clauderic/dnd-kit/commit/224201a2a5611f0efeb57c9b273eddf23c28e01f) Thanks [@clauderic](https://github.com/clauderic)! - The `<SortableContext>` component now optionally accepts a `disabled` prop to globally disable `useSortable` hooks rendered within it.
The `disabled` prop accepts either a boolean or an object with the following shape:
```ts
interface Disabled {
draggable?: boolean;
droppable?: boolean;
}
```
The `useSortable` hook has now been updated to also optionally accept the `disabled` configuration object to conditionally disable the `useDraggable` and/or `useDroppable` hooks used internally.
Like the `strategy` prop, the `disabled` prop defined on the `useSortable` hook takes precedence over the `disabled` prop defined on the parent `<SortableContext>`.
### Patch Changes
- [#757](https://github.com/clauderic/dnd-kit/pull/757) [`e6d544f`](https://github.com/clauderic/dnd-kit/commit/e6d544f3f775e6a43de25d1aee67efeec0d5db58) Thanks [@clauderic](https://github.com/clauderic)! - The `wasDragging` property of `animateLayoutChanges` now remains true for longer than a single re-render. Before this change, it was possible for the component where `useSortable` is used to re-render before @dnd-kit is ready to perform the layout animation, causing the animation to be skipped entirely.
- [#749](https://github.com/clauderic/dnd-kit/pull/749) [`188a450`](https://github.com/clauderic/dnd-kit/commit/188a4507b99d8e8fdaa50bd26deb826c86608e18) Thanks [@clauderic](https://github.com/clauderic)! - Faster (and safer) equal implementation.
- Updated dependencies [[`4173087`](https://github.com/clauderic/dnd-kit/commit/417308704454c50f88ab305ab450a99bde5034b0), [`59ca82b`](https://github.com/clauderic/dnd-kit/commit/59ca82b9f228f34c7731ece87aef5d9633608b57), [`7161f70`](https://github.com/clauderic/dnd-kit/commit/7161f702c9fe06f8dafa6449d48b918070ca46fb), [`a52fba1`](https://github.com/clauderic/dnd-kit/commit/a52fba1ccff8a8f40e2cb8dcc15236cfd9e8fbec), [`40707ce`](https://github.com/clauderic/dnd-kit/commit/40707ce6f388957203d6df4ccbeef460450ffd7d), [`a41e5b8`](https://github.com/clauderic/dnd-kit/commit/a41e5b8eff84f0528ffc8b3455b94b95ab60a4a9), [`bf30718`](https://github.com/clauderic/dnd-kit/commit/bf30718bc22584a47053c14f5920e317ac45cd50), [`a41e5b8`](https://github.com/clauderic/dnd-kit/commit/a41e5b8eff84f0528ffc8b3455b94b95ab60a4a9), [`a41e5b8`](https://github.com/clauderic/dnd-kit/commit/a41e5b8eff84f0528ffc8b3455b94b95ab60a4a9), [`035021a`](https://github.com/clauderic/dnd-kit/commit/035021aac51161e2bf9715f087a6dd1b46647bfc), [`77e3d44`](https://github.com/clauderic/dnd-kit/commit/77e3d44502383d2f9a9f9af014b053619b3e37b3), [`5811986`](https://github.com/clauderic/dnd-kit/commit/5811986e7544a5e80039870a015e38df805eaad1), [`e302bd4`](https://github.com/clauderic/dnd-kit/commit/e302bd4488bdfb6735c97ac42c1f4a0b1e8bfdf9), [`188a450`](https://github.com/clauderic/dnd-kit/commit/188a4507b99d8e8fdaa50bd26deb826c86608e18), [`59ca82b`](https://github.com/clauderic/dnd-kit/commit/59ca82b9f228f34c7731ece87aef5d9633608b57), [`750d726`](https://github.com/clauderic/dnd-kit/commit/750d72655922363b2218d7b41e028f9dceaef013), [`5f3c700`](https://github.com/clauderic/dnd-kit/commit/5f3c7009698d15936fd20f30f11ad3b23cd7886f), [`035021a`](https://github.com/clauderic/dnd-kit/commit/035021aac51161e2bf9715f087a6dd1b46647bfc), [`e6e242c`](https://github.com/clauderic/dnd-kit/commit/e6e242cbc718ed687a26f5c622eeed4dbd6c2425), [`035021a`](https://github.com/clauderic/dnd-kit/commit/035021aac51161e2bf9715f087a6dd1b46647bfc), [`33e6dd2`](https://github.com/clauderic/dnd-kit/commit/33e6dd2dc954f1f2da90d8f8af995021031b6b41), [`10f6836`](https://github.com/clauderic/dnd-kit/commit/10f683631103b1d919f2fbca1177141b9369d2cf), [`c1b3b5a`](https://github.com/clauderic/dnd-kit/commit/c1b3b5a0be5759b707e22c4e1b1236aaa82773a2), [`035021a`](https://github.com/clauderic/dnd-kit/commit/035021aac51161e2bf9715f087a6dd1b46647bfc)]:
- @dnd-kit/core@6.0.0
- @dnd-kit/utilities@3.2.0
## 6.0.1
### Patch Changes
- [#642](https://github.com/clauderic/dnd-kit/pull/642) [`15a6017`](https://github.com/clauderic/dnd-kit/commit/15a6017c4c2dd66911751877cc448456d0e5c96f) Thanks [@vosatom](https://github.com/vosatom)! - Fixed an issue that affected `SortableContext` performance. The `sortedRects` property of the `SortableContext` provider were being recomputed whenever coordinates changed rather than only when the order of the items changed.
- Updated dependencies [[`b3b185d`](https://github.com/clauderic/dnd-kit/commit/b3b185dc675b61fe2e3d1a8462728c81c3150b99)]:
- @dnd-kit/core@5.0.2
## 6.0.0
### Major Changes
- [#518](https://github.com/clauderic/dnd-kit/pull/518) [`6310227`](https://github.com/clauderic/dnd-kit/commit/63102272d0d63dae349e2e9f638277e16a7d5970) Thanks [@clauderic](https://github.com/clauderic)! - Major internal refactor of measuring and collision detection.
### Summary of changes
Previously, all collision detection algorithms were relative to the top and left points of the document. While this approach worked in most situations, it broke down in a number of different use-cases, such as fixed position droppable containers and trying to drag between containers that had different scroll positions.
This new approach changes the frame of comparison to be relative to the viewport. This is a major breaking change, and will need to be released under a new major version bump.
### Breaking changes:
- By default, `@dnd-kit` now ignores only the transforms applied to the draggable / droppable node itself, but considers all the transforms applied to its ancestors. This should provide the right balance of flexibility for most consumers.
- Transforms applied to the droppable and draggable nodes are ignored by default, because the recommended approach for moving items on the screen is to use the transform property, which can interfere with the calculation of collisions.
- Consumers can choose an alternate approach that does consider transforms for specific use-cases if needed by configuring the measuring prop of <DndContext>. Refer to the <Switch> example.
- Reduced the number of concepts related to measuring from `ViewRect`, `LayoutRect` to just a single concept of `ClientRect`.
- The `ClientRect` interface no longer holds the `offsetTop` and `offsetLeft` properties. For most use-cases, you can replace `offsetTop` with `top` and `offsetLeft` with `left`.
- Replaced the following exports from the `@dnd-kit/core` package with `getClientRect`:
- `getBoundingClientRect`
- `getViewRect`
- `getLayoutRect`
- `getViewportLayoutRect`
- Removed `translatedRect` from the `SensorContext` interface. Replace usage with `collisionRect`.
- Removed `activeNodeClientRect` on the `DndContext` interface. Replace with `activeNodeRect`.
- [#569](https://github.com/clauderic/dnd-kit/pull/569) [`e7ac3d4`](https://github.com/clauderic/dnd-kit/commit/e7ac3d45699dcc7b47191a67044a516929ac439c) Thanks [@clauderic](https://github.com/clauderic)! - Separated context into public and internal context providers. Certain properties that used to be available on the public `DndContextDescriptor` interface have been moved to the internal context provider and are no longer exposed to consumers:
```ts
interface DndContextDescriptor {
- dispatch: React.Dispatch<Actions>;
- activators: SyntheticListeners;
- ariaDescribedById: {
- draggable: UniqueIdentifier;
- };
}
```
Having two distinct context providers will allow to keep certain internals such as `dispatch` hidden from consumers.
It also serves as an optimization until context selectors are implemented in React, properties that change often, such as the droppable containers and droppable rects, the transform value and array of collisions should be stored on a different context provider to limit un-necessary re-renders in `useDraggable`, `useDroppable` and `useSortable`.
The `<InternalContext.Provider>` is also reset to its default values within `<DragOverlay>`. This paves the way towards being able to seamlessly use components that use hooks such as `useDraggable` and `useDroppable` as children of `<DragOverlay>` without causing interference or namespace collisions.
Consumers can still make calls to `useDndContext()` to get the `active` or `over` properties if they wish to re-render the component rendered within `DragOverlay` in response to user interaction, since those use the `PublicContext`
### Minor Changes
- [#558](https://github.com/clauderic/dnd-kit/pull/558) [`f3ad20d`](https://github.com/clauderic/dnd-kit/commit/f3ad20d5b2c2f2ca7b82c193c9af5eef38c5ce11) Thanks [@clauderic](https://github.com/clauderic)! - Refactor of the `CollisionDetection` interface to return an array of `Collision`s:
```diff
+export interface Collision {
+ id: UniqueIdentifier;
+ data?: Record<string, any>;
+}
export type CollisionDetection = (args: {
active: Active;
collisionRect: ClientRect;
droppableContainers: DroppableContainer[];
pointerCoordinates: Coordinates | null;
-}) => UniqueIdentifier;
+}) => Collision[];
```
This is a breaking change that requires all collision detection strategies to be updated to return an array of `Collision` rather than a single `UniqueIdentifier`
The `over` property remains a single `UniqueIdentifier`, and is set to the first item in returned in the collisions array.
Consumers can also access the `collisions` property which can be used to implement use-cases such as combining droppables in user-land.
The `onDragMove`, `onDragOver` and `onDragEnd` callbacks are also updated to receive the collisions array property.
Built-in collision detections such as rectIntersection, closestCenter, closestCorners and pointerWithin adhere to the CollisionDescriptor interface, which extends the Collision interface:
```ts
export interface CollisionDescriptor extends Collision {
data: {
droppableContainer: DroppableContainer;
value: number;
[key: string]: any;
};
}
```
Consumers can also access the array of collisions in components wrapped by `<DndContext>` via the `useDndContext()` hook:
```ts
import {useDndContext} from '@dnd-kit/core';
function MyComponent() {
const {collisions} = useDndContext();
}
```
- [#561](https://github.com/clauderic/dnd-kit/pull/561) [`02edd26`](https://github.com/clauderic/dnd-kit/commit/02edd2691b24bb49f2e7c9f9a3f282031bf658b7) Thanks [@clauderic](https://github.com/clauderic)! - Droppable containers now observe the node they are attached to via `setNodeRef` using `ResizeObserver` while dragging.
This behaviour can be configured using the newly introduced `resizeObserverConfig` property.
```ts
interface ResizeObserverConfig {
/** Whether the ResizeObserver should be disabled entirely */
disabled?: boolean;
/** Resize events may affect the layout and position of other droppable containers.
* Specify an array of `UniqueIdentifier` of droppable containers that should also be re-measured
* when this droppable container resizes. Specifying an empty array re-measures all droppable containers.
*/
updateMeasurementsFor?: UniqueIdentifier[];
/** Represents the debounce timeout between when resize events are observed and when elements are re-measured */
timeout?: number;
}
```
By default, only the current droppable is scheduled to be re-measured when a resize event is observed. However, this may not be suitable for all use-cases. When an element resizes, it can affect the layout and position of other elements, such that it may be necessary to re-measure other droppable nodes in response to that single resize event. The `recomputeIds` property can be used to specify which droppable `id`s should be re-measured in response to resize events being observed.
For example, the `useSortable` preset re-computes the measurements of all sortable elements after the element that resizes, so long as they are within the same `SortableContext` as the element that resizes, since it's highly likely that their layout will also shift.
Specifying an empty array for `recomputeIds` forces all droppable containers to be re-measured.
For consumers that were relyings on the internals of `DndContext` using `useDndContext()`, the `willRecomputeLayouts` property has been renamed to `measuringScheduled`, and the `recomputeLayouts` method has been renamed to `measureDroppableContainers`, and now optionally accepts an array of droppable `UniqueIdentifier` that should be scheduled to be re-measured.
- [#570](https://github.com/clauderic/dnd-kit/pull/570) [`1ade2f3`](https://github.com/clauderic/dnd-kit/commit/1ade2f34403ba1d5a87cbd3ce1cff62860860501) Thanks [@clauderic](https://github.com/clauderic)! - Use `transition` for the active draggable node when keyboard sorting without a `<DragOverlay />`.
### Patch Changes
- [#566](https://github.com/clauderic/dnd-kit/pull/566) [`d315df0`](https://github.com/clauderic/dnd-kit/commit/d315df07022178460a52d6021a41227878b876b8) Thanks [@clauderic](https://github.com/clauderic)! - Fixed a bug where sortable item position was not updated when quickly dragging different sortable items.
- Updated dependencies [[`f3ad20d`](https://github.com/clauderic/dnd-kit/commit/f3ad20d5b2c2f2ca7b82c193c9af5eef38c5ce11), [`02edd26`](https://github.com/clauderic/dnd-kit/commit/02edd2691b24bb49f2e7c9f9a3f282031bf658b7), [`c6c67cb`](https://github.com/clauderic/dnd-kit/commit/c6c67cb9cbc6e61027f7bb084fd2232160037d5e), [`6310227`](https://github.com/clauderic/dnd-kit/commit/63102272d0d63dae349e2e9f638277e16a7d5970), [`e7ac3d4`](https://github.com/clauderic/dnd-kit/commit/e7ac3d45699dcc7b47191a67044a516929ac439c), [`528c67e`](https://github.com/clauderic/dnd-kit/commit/528c67e4c617dfc0ce5221496aa8b222ffc82ddb), [`02edd26`](https://github.com/clauderic/dnd-kit/commit/02edd2691b24bb49f2e7c9f9a3f282031bf658b7)]:
- @dnd-kit/core@5.0.0
- @dnd-kit/utilities@3.1.0
## 5.1.0
### Minor Changes
- [#486](https://github.com/clauderic/dnd-kit/pull/486) [`d86529c`](https://github.com/clauderic/dnd-kit/commit/d86529cde6daa650e9c9edce7f26fb691d71d723) Thanks [@clauderic](https://github.com/clauderic)! - Improvements to better support swappable strategies:
- Now exporting an `arraySwap` helper to be used instead of `arrayMove` `onDragEnd`.
- Added the `getNewIndex` prop on `useSortable`. By default, `useSortable` assumes that items will be moved to their new index using `arrayMove()`, but this isn't always the case, especially when using strategies like `rectSwappingStrategy`. For those scenarios, consumers can now define custom logic that should be used to get the new index for an item on drop, for example, by computing the new order of items using `arraySwap`.
### Patch Changes
- Updated dependencies [[`d973cc6`](https://github.com/clauderic/dnd-kit/commit/d973cc6f5aaca8a01e6da4a958164eb623c4ce9d)]:
- @dnd-kit/core@4.0.2
## 5.0.0
### Major Changes
- [#427](https://github.com/clauderic/dnd-kit/pull/427) [`f96cb5d`](https://github.com/clauderic/dnd-kit/commit/f96cb5d5e45a1000104892244201a70cbe8e6553) Thanks [@clauderic](https://github.com/clauderic)! - - Using transform-agnostic measurements for the DragOverlay node.
- Renamed the `overlayNode` property to `dragOverlay` on the `DndContextDescriptor` interface.
- [`9cfac05`](https://github.com/clauderic/dnd-kit/commit/9cfac057689ae1a91b663ac2eb04c47dadb9b4db) Thanks [@clauderic](https://github.com/clauderic)! - Renamed the `wasSorting` property to `wasDragging` on the `SortableContext` and `AnimateLayoutChanges` interfaces.
### Minor Changes
- [#433](https://github.com/clauderic/dnd-kit/pull/433) [`c447880`](https://github.com/clauderic/dnd-kit/commit/c447880656b6bee2915d5a5f01d3ddfbd5705fa2) Thanks [@clauderic](https://github.com/clauderic)! - Fix unwanted animations when items in sortable context change
### Patch Changes
- [#372](https://github.com/clauderic/dnd-kit/pull/372) [`dbc9601`](https://github.com/clauderic/dnd-kit/commit/dbc9601c922e1d6944a63f66ee647f203abee595) Thanks [@clauderic](https://github.com/clauderic)! - Refactored `DroppableContainers` type from `Record<UniqueIdentifier, DroppableContainer` to a custom instance that extends the [`Map` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) and adds a few other methods such as `toArray()`, `getEnabled()` and `getNodeFor(id)`.
A unique `key` property was also added to the `DraggableNode` and `DroppableContainer` interfaces. This prevents potential race conditions in the mount and cleanup effects of `useDraggable` and `useDroppable`. It's possible for the clean-up effect to run after another React component using `useDraggable` or `useDroppable` mounts, which causes the newly mounted element to accidentally be un-registered.
- [#350](https://github.com/clauderic/dnd-kit/pull/350) [`a13dbb6`](https://github.com/clauderic/dnd-kit/commit/a13dbb66586edbf2998c7b251e236604255fd227) Thanks [@wmain](https://github.com/wmain)! - Breaking change: The `CollisionDetection` interface has been refactored. It now receives an object that contains the `active` draggable node, along with the `collisionRect` and an array of `droppableContainers`.
If you've built custom collision detection algorithms, you'll need to update them. Refer to [this PR](https://github.com/clauderic/dnd-kit/pull/350) for examples of how to refactor collision detection functions to the new `CollisionDetection` interface.
The `sortableKeyboardCoordinates` method has also been updated since it relies on the `closestCorners` collision detection algorithm. If you were using collision detection strategies in a custom `sortableKeyboardCoordinates` method, you'll need to update those as well.
- [`86d1f27`](https://github.com/clauderic/dnd-kit/commit/86d1f27f45fb60db6a34cd258227371595e00435) Thanks [@clauderic](https://github.com/clauderic)! - Fixed a bug in the `horizontalListSortingStrategy` where it did not check if the `currentRect` was undefined.
- [`e42a711`](https://github.com/clauderic/dnd-kit/commit/e42a711a26186c08fc888f8acbf4635ed855f2a2) Thanks [@clauderic](https://github.com/clauderic)! - Fixed a bug with the default layout animation function where it could return `true` initially even if the list had not been sorted yet. Now checking the `wasDragging` property to ensure no layout animation occurs if `wasDragging` is false.
- [#341](https://github.com/clauderic/dnd-kit/pull/341) [`e02b737`](https://github.com/clauderic/dnd-kit/commit/e02b737a3ce94f57592ac2ffe67d5bc8fabe1d43) Thanks [@clauderic](https://github.com/clauderic)! - Return `undefined` instead of `null` for `transition` in `useSortable`
- Updated dependencies [[`13be602`](https://github.com/clauderic/dnd-kit/commit/13be602229c6d5723b3ae98bca7b8f45f0773366), [`aede2cc`](https://github.com/clauderic/dnd-kit/commit/aede2cc42d488435cf65f19b63ba6bb7702b3fde), [`05d6a78`](https://github.com/clauderic/dnd-kit/commit/05d6a78a17cbaacd8dffed685dfea5a6ea3d38a8), [`a32a4c5`](https://github.com/clauderic/dnd-kit/commit/a32a4c5f6228b9f03bf460b8403a38b8c3de493f), [`f96cb5d`](https://github.com/clauderic/dnd-kit/commit/f96cb5d5e45a1000104892244201a70cbe8e6553), [`dea715c`](https://github.com/clauderic/dnd-kit/commit/dea715c342b2d998a9f1562cacb5e70c77562c92), [`dbc9601`](https://github.com/clauderic/dnd-kit/commit/dbc9601c922e1d6944a63f66ee647f203abee595), [`46ec5e4`](https://github.com/clauderic/dnd-kit/commit/46ec5e4c6e3ca9fa849666f90fef426b3c465cf0), [`7006464`](https://github.com/clauderic/dnd-kit/commit/700646468683e4820269534c6352cca93bb5a987), [`0e628bc`](https://github.com/clauderic/dnd-kit/commit/0e628bce53fb1a7223cdedd203cb07b6e62e5ec1), [`c447880`](https://github.com/clauderic/dnd-kit/commit/c447880656b6bee2915d5a5f01d3ddfbd5705fa2), [`2ba6dfe`](https://github.com/clauderic/dnd-kit/commit/2ba6dfe6b080b90b13aa8d9eb07331515a0d2faa), [`8d70540`](https://github.com/clauderic/dnd-kit/commit/8d70540771d1455c326310b438a198d2516e1d04), [`13be602`](https://github.com/clauderic/dnd-kit/commit/13be602229c6d5723b3ae98bca7b8f45f0773366), [`422d083`](https://github.com/clauderic/dnd-kit/commit/422d0831173a893099ba924bf7bbc465640fc15d), [`c4b21b4`](https://github.com/clauderic/dnd-kit/commit/c4b21b4ee17cba31c10928eb227848026f54222a), [`5a41340`](https://github.com/clauderic/dnd-kit/commit/5a41340e6561c3784da2a9266e1b852ba370918c), [`a13dbb6`](https://github.com/clauderic/dnd-kit/commit/a13dbb66586edbf2998c7b251e236604255fd227), [`e2ee0dc`](https://github.com/clauderic/dnd-kit/commit/e2ee0dccb12794c419587019defddfd82ba5d297), [`1fe9b5c`](https://github.com/clauderic/dnd-kit/commit/1fe9b5c9d34237aae6ab22d54478c419d44a079a), [`1fe9b5c`](https://github.com/clauderic/dnd-kit/commit/1fe9b5c9d34237aae6ab22d54478c419d44a079a), [`1f5ca27`](https://github.com/clauderic/dnd-kit/commit/1f5ca27b17879861c2c545160c2046a747544846)]:
- @dnd-kit/core@4.0.0
- @dnd-kit/utilities@3.0.0
## 4.0.0
### Patch Changes
- Updated dependencies [[`d39ab11`](https://github.com/clauderic/dnd-kit/commit/d39ab1112f9be78d467b2dfe488a7ea931d93767)]:
- @dnd-kit/core@3.1.0
## 3.1.0
### Minor Changes
- [`68960c4`](https://github.com/clauderic/dnd-kit/commit/68960c490f50962b47a57663ee0625d7704173ec) [#295](https://github.com/clauderic/dnd-kit/pull/295) Thanks [@akhmadullin](https://github.com/akhmadullin)! - `@dnd-kit/core` is now a `peerDependency` rather than a `dependency` for other `@dnd-kit` packages that depend on it, such as `@dnd-kit/sortable` and `@dnd-kit/modifiers`. This is done to avoid issues with multiple versions of `@dnd-kit/core` being installed by some package managers such as Yarn 2.
### Patch Changes
- Updated dependencies [[`ae398de`](https://github.com/clauderic/dnd-kit/commit/ae398de012aee28f5e3bec10b438153d00f65630), [`8b938ce`](https://github.com/clauderic/dnd-kit/commit/8b938ceb158c67e9fdc4616351d1a3291ac614c3)]:
- @dnd-kit/core@3.0.4
## 3.0.1
### Patch Changes
- [`a178857`](https://github.com/clauderic/dnd-kit/commit/a1788579ee12d1c1af8244bdf6a17f3f5ba388a1) [#214](https://github.com/clauderic/dnd-kit/pull/214) Thanks [@clauderic](https://github.com/clauderic)! - Ensure that consumer defined data passed to `useSortable` is passed down to both `useDraggable` and `useDroppable`.
The `data` object that is passed to `useDraggable` and `useDroppable` within `useSortable` also contains the `sortable` property, which holds a reference to the index of the item, along with the `containerId` and the `items` of its parent `SortableContext`.
## 3.0.0
### Major Changes
- [`a9d92cf`](https://github.com/clauderic/dnd-kit/commit/a9d92cf1fa35dd957e6c5915a13dfd2af134c103) [#174](https://github.com/clauderic/dnd-kit/pull/174) Thanks [@clauderic](https://github.com/clauderic)! - Distributed assets now only target modern browsers. [Browserlist](https://github.com/browserslist/browserslist) config:
```
defaults
last 2 version
not IE 11
not dead
```
If you need to support older browsers, include the appropriate polyfills in your project's build process.
### Minor Changes
- [`b7355d1`](https://github.com/clauderic/dnd-kit/commit/b7355d19d9e15bb1972627bb622c2487ddec82ad) [#207](https://github.com/clauderic/dnd-kit/pull/207) Thanks [@clauderic](https://github.com/clauderic)! - The `data` argument for `useDraggable` and `useDroppable` is now exposed in event handlers and on the `active` and `over` objects.
**Example usage:**
```tsx
import {DndContext, useDraggable, useDroppable} from '@dnd-kit/core';
function Draggable() {
const {attributes, listeners, setNodeRef, transform} = useDraggable({
id: 'draggable',
data: {
type: 'type1',
},
});
/* ... */
}
function Droppable() {
const {setNodeRef} = useDroppable({
id: 'droppable',
data: {
accepts: ['type1', 'type2'],
},
});
/* ... */
}
function App() {
return (
<DndContext
onDragEnd={({active, over}) => {
if (over?.data.current.accepts.includes(active.data.current.type)) {
// do stuff
}
}}
/>
);
}
```
### Patch Changes
- [`fb2db94`](https://github.com/clauderic/dnd-kit/commit/fb2db941d00d1f876a62751c6ac9d79143876598) [#212](https://github.com/clauderic/dnd-kit/pull/212) Thanks [@clauderic](https://github.com/clauderic)! - Allow consumers of `SortableContext` to provide items of shape `{id: string}[]` or `string[]`
- Updated dependencies [[`b7355d1`](https://github.com/clauderic/dnd-kit/commit/b7355d19d9e15bb1972627bb622c2487ddec82ad), [`a9d92cf`](https://github.com/clauderic/dnd-kit/commit/a9d92cf1fa35dd957e6c5915a13dfd2af134c103), [`b406cb9`](https://github.com/clauderic/dnd-kit/commit/b406cb9251beef8677d05c45ec42bab7581a86dc)]:
- @dnd-kit/core@3.0.0
- @dnd-kit/utilities@2.0.0
## 2.0.1
### Patch Changes
- [`92afb0f`](https://github.com/clauderic/dnd-kit/commit/92afb0f6bcb9dd91f7e487ef44c43c8d28241f6f) [#168](https://github.com/clauderic/dnd-kit/pull/168) Thanks [@clauderic](https://github.com/clauderic)! - Make sure that the `wasSorting` argument of the `animateLayoutChanges` prop of `useSortable` always receives the latest value.
- Updated dependencies [[`bdb1aa2`](https://github.com/clauderic/dnd-kit/commit/bdb1aa2b62f855a4ccd048d452d4dd93529af563)]:
- @dnd-kit/core@2.1.0
## 2.0.0
### Major Changes
- [`8583825`](https://github.com/clauderic/dnd-kit/commit/8583825380bc4d7c36e076be30bb5ca3fd20a26b) [#140](https://github.com/clauderic/dnd-kit/pull/140) Thanks [@clauderic](https://github.com/clauderic)! - Auto-scrolling defaults have been updated, which should generally lead to improved user experience for most consumers.
The auto-scroller now bases its calculations based on the position of the pointer rather than the edges of the draggable element's rect by default. This change is aligned with how the native HTML 5 Drag & Drop auto-scrolling behaves.
This behaviour can be customized using the `activator` option of the `autoScroll` prop:
```tsx
import {AutoScrollActivator, DndContext} from '@dnd-kit/core';
<DndContext autoScroll={{activator: AutoScrollActivator.DraggableRect}} />;
```
The auto-scroller now also looks at scrollable ancestors in order of appearance in the DOM tree, meaning it will first attempt to scroll the window, and narrow its focus down rather than the old behaviour of looking at scrollable ancestors in order of closeness to the draggable element in the DOM tree (reversed tree order).
This generally leads to an improved user experience, but can be customized by passing a configuration object to the `autoScroll` prop that sets the `order` option to `TraversalOrder.ReversedTreeOrder` instead of the new default value of `TraversalOrder.TreeOrder`:
```tsx
import {DndContext, TraversalOrder} from '@dnd-kit/core';
<DndContext autoScroll={{order: TraversalOrder.ReversedTreeOrder}} />;
```
The autoscrolling `thresholds`, `acceleration` and `interval` can now also be customized using the `autoScroll` prop:
```tsx
import {DndContext} from '@dnd-kit/core';
<DndContext
autoScroll={{
thresholds: {
// Left and right 10% of the scroll container activate scrolling
x: 0.1,
// Top and bottom 25% of the scroll container activate scrolling
y: 0.25,
},
// Accelerate slower than the default value (10)
acceleration: 5,
// Auto-scroll every 10ms instead of the default value of 5ms
interval: 10,
}}
/>;
```
Finally, consumers can now conditionally opt out of scrolling certain scrollable ancestors using the `canScroll` option of the `autoScroll` prop:
```tsx
import {DndContext} from '@dnd-kit/core';
<DndContext
autoScroll={{
canScroll(element) {
if (element === document.scrollingElement) {
return false;
}
return true;
},
}}
/>;
```
### Patch Changes
- Updated dependencies [[`8583825`](https://github.com/clauderic/dnd-kit/commit/8583825380bc4d7c36e076be30bb5ca3fd20a26b)]:
- @dnd-kit/core@2.0.0
## 1.1.0
### Minor Changes
- [`79f6088`](https://github.com/clauderic/dnd-kit/commit/79f6088dab2d4e7443743f85b329a25a023ecd87) [#144](https://github.com/clauderic/dnd-kit/pull/144) Thanks [@clauderic](https://github.com/clauderic)! - Allow consumers to determine whether to animate layout changes and when to measure nodes. Consumers can now use the `animateLayoutChanges` prop of `useSortable` to determine whether layout animations should occur. Consumers can now also decide when to measure layouts, and at what frequency using the `layoutMeasuring` prop of `DndContext`. By default, `DndContext` will measure layouts just-in-time after sorting has begun. Consumers can override this behaviour to either only measure before dragging begins (on mount and after dragging), or always (on mount, before dragging, after dragging). Pairing the `layoutMeasuring` prop on `DndContext` and the `animateLayoutChanges` prop of `useSortable` opens up a number of new possibilities for consumers, such as animating insertion and removal of items in a sortable list.
### Patch Changes
- Updated dependencies [[`adb7bd5`](https://github.com/clauderic/dnd-kit/commit/adb7bd58d7d95db5e450a1518541d3d71704529d), [`79f6088`](https://github.com/clauderic/dnd-kit/commit/79f6088dab2d4e7443743f85b329a25a023ecd87), [`a76cd5a`](https://github.com/clauderic/dnd-kit/commit/a76cd5abcc0b17eae20d4a6256d95b47f2e9d050)]:
- @dnd-kit/core@1.2.0
## 1.0.2
### Patch Changes
- [`423610c`](https://github.com/clauderic/dnd-kit/commit/423610ca48c5e5ca95545fdb5c5cfcfbd3d233ba) [#56](https://github.com/clauderic/dnd-kit/pull/56) Thanks [@clauderic](https://github.com/clauderic)! - Add MIT license to package.json and distributed files
- Updated dependencies [[`423610c`](https://github.com/clauderic/dnd-kit/commit/423610ca48c5e5ca95545fdb5c5cfcfbd3d233ba), [`594a24e`](https://github.com/clauderic/dnd-kit/commit/594a24e61e2fb559bceab8b50a07ceeeadf86417), [`fd25eaf`](https://github.com/clauderic/dnd-kit/commit/fd25eaf7c114f73918bf83801890d970c9b56d18)]:
- @dnd-kit/core@1.0.2
- @dnd-kit/utilities@1.0.2
## 1.0.1
### Patch Changes
- [`0b343c7`](https://github.com/clauderic/dnd-kit/commit/0b343c7e88a68351f8a39f643e9f26b8e046ef48) [#52](https://github.com/clauderic/dnd-kit/pull/52) Thanks [@clauderic](https://github.com/clauderic)! - Add repository entry to package.json files
- [`78a7b67`](https://github.com/clauderic/dnd-kit/commit/78a7b672e856c911e7cfdd4ec8f6e4d0e7c36531) Thanks [@clauderic](https://github.com/clauderic)! - Fix an issue with the sortable keyboard coordinate getter not excluding disabled droppables.
- Updated dependencies [[`0b343c7`](https://github.com/clauderic/dnd-kit/commit/0b343c7e88a68351f8a39f643e9f26b8e046ef48), [`5194696`](https://github.com/clauderic/dnd-kit/commit/5194696b4b91f26379cd3e6c11b2d66c92d32c5b), [`310bbd6`](https://github.com/clauderic/dnd-kit/commit/310bbd6370e85f8fb16cad149e6254600a5beb3a)]:
- @dnd-kit/utilities@1.0.1
- @dnd-kit/core@1.0.1
## 1.0.0
### Major Changes
- [`2912350`](https://github.com/clauderic/dnd-kit/commit/2912350c5008c2b0edda3bae30b5075a852dea63) Thanks [@clauderic](https://github.com/clauderic)! - Initial public release.
### Patch Changes
- Updated dependencies [[`2912350`](https://github.com/clauderic/dnd-kit/commit/2912350c5008c2b0edda3bae30b5075a852dea63)]:
- @dnd-kit/core@1.0.0
- @dnd-kit/utilities@1.0.0
## 0.1.0
### Minor Changes
- [`7bd4568`](https://github.com/clauderic/dnd-kit/commit/7bd4568e9f339552fd73a9a4c888460b11195a5e) [#30](https://github.com/clauderic/dnd-kit/pull/30) - Initial beta release, authored by [@clauderic](https://github.com/clauderic).
### Patch Changes
- Updated dependencies [[`7bd4568`](https://github.com/clauderic/dnd-kit/commit/7bd4568e9f339552fd73a9a4c888460b11195a5e)]:
- @dnd-kit/core@0.1.0
- @dnd-kit/utilities@0.1.0

21
node_modules/@dnd-kit/sortable/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021, Claudéric Demers
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

28
node_modules/@dnd-kit/sortable/README.md generated vendored Normal file
View File

@@ -0,0 +1,28 @@
# @dnd-kit/sortable
[![Stable release](https://img.shields.io/npm/v/@dnd-kit/sortable.svg)](https://npm.im/@dnd-kit/sortable)
The sortable preset provides the building blocks to build sortable interfaces with @dnd-kit.
## Installation
To get started, install the sortable preset via npm or yarn:
```
npm install @dnd-kit/sortable
```
## Architecture
The sortable preset builds on top of the primitives exposed by `@dnd-kit/core` to help building sortable interfaces.
The sortable preset exposes two main concepts: `SortableContext` and the `useSortable` hook:
- The SortableContext provides information via context that is consumed by the `useSortable` hook.
- The useSortable hook is an abstraction that composes the `useDroppable` and `useDraggable` hooks.
![The useSortable hook is an abstraction that composes the useDroppable and useDraggable hooks](/.github/assets/use-sortable.png)
## Usage
Visit [docs.dndkit.com](https://docs.dndkit.com/presets/sortable) to learn how to use the Sortable preset.

View File

@@ -0,0 +1,26 @@
import React from 'react';
import { ClientRect, UniqueIdentifier } from '@dnd-kit/core';
import type { Disabled, SortingStrategy } from '../types';
export interface Props {
children: React.ReactNode;
items: (UniqueIdentifier | {
id: UniqueIdentifier;
})[];
strategy?: SortingStrategy;
id?: string;
disabled?: boolean | Disabled;
}
interface ContextDescriptor {
activeIndex: number;
containerId: string;
disabled: Disabled;
disableTransforms: boolean;
items: UniqueIdentifier[];
overIndex: number;
useDragOverlay: boolean;
sortedRects: ClientRect[];
strategy: SortingStrategy;
}
export declare const Context: React.Context<ContextDescriptor>;
export declare function SortableContext({ children, id, items: userDefinedItems, strategy, disabled: disabledProp, }: Props): JSX.Element;
export {};

View File

@@ -0,0 +1,2 @@
export { SortableContext, Context } from './SortableContext';
export type { Props as SortableContextProps } from './SortableContext';

View File

@@ -0,0 +1,9 @@
import type { AnimateLayoutChanges, NewIndexGetter, SortableTransition } from './types';
export declare const defaultNewIndexGetter: NewIndexGetter;
export declare const defaultAnimateLayoutChanges: AnimateLayoutChanges;
export declare const defaultTransition: SortableTransition;
export declare const transitionProperty = "transform";
export declare const disabledTransition: string;
export declare const defaultAttributes: {
roleDescription: string;
};

4
node_modules/@dnd-kit/sortable/dist/hooks/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
export { useSortable } from './useSortable';
export type { Arguments as UseSortableArguments } from './useSortable';
export { defaultAnimateLayoutChanges, defaultNewIndexGetter } from './defaults';
export type { AnimateLayoutChanges, NewIndexGetter } from './types';

24
node_modules/@dnd-kit/sortable/dist/hooks/types.d.ts generated vendored Normal file
View File

@@ -0,0 +1,24 @@
import type { Active, UniqueIdentifier } from '@dnd-kit/core';
import type { Transition } from '@dnd-kit/utilities';
export declare type SortableTransition = Pick<Transition, 'easing' | 'duration'>;
export declare type AnimateLayoutChanges = (args: {
active: Active | null;
containerId: UniqueIdentifier;
isDragging: boolean;
isSorting: boolean;
id: UniqueIdentifier;
index: number;
items: UniqueIdentifier[];
previousItems: UniqueIdentifier[];
previousContainerId: UniqueIdentifier;
newIndex: number;
transition: SortableTransition | null;
wasDragging: boolean;
}) => boolean;
export interface NewIndexGetterArguments {
id: UniqueIdentifier;
items: UniqueIdentifier[];
activeIndex: number;
overIndex: number;
}
export declare type NewIndexGetter = (args: NewIndexGetterArguments) => number;

View File

@@ -0,0 +1,36 @@
/// <reference types="react" />
import { UseDraggableArguments, UseDroppableArguments } from '@dnd-kit/core';
import type { Disabled, SortableData, SortingStrategy } from '../types';
import type { AnimateLayoutChanges, NewIndexGetter, SortableTransition } from './types';
export interface Arguments extends Omit<UseDraggableArguments, 'disabled'>, Pick<UseDroppableArguments, 'resizeObserverConfig'> {
animateLayoutChanges?: AnimateLayoutChanges;
disabled?: boolean | Disabled;
getNewIndex?: NewIndexGetter;
strategy?: SortingStrategy;
transition?: SortableTransition | null;
}
export declare function useSortable({ animateLayoutChanges, attributes: userDefinedAttributes, disabled: localDisabled, data: customData, getNewIndex, id, strategy: localStrategy, resizeObserverConfig, transition, }: Arguments): {
active: import("@dnd-kit/core").Active | null;
activeIndex: number;
attributes: import("@dnd-kit/core").DraggableAttributes;
data: SortableData & {
[x: string]: any;
};
rect: import("react").MutableRefObject<import("@dnd-kit/core").ClientRect | null>;
index: number;
newIndex: number;
items: import("@dnd-kit/core").UniqueIdentifier[];
isOver: boolean;
isSorting: boolean;
isDragging: boolean;
listeners: import("@dnd-kit/core/dist/hooks/utilities").SyntheticListenerMap | undefined;
node: import("react").MutableRefObject<HTMLElement | null>;
overIndex: number;
over: import("@dnd-kit/core").Over | null;
setNodeRef: (node: HTMLElement | null) => void;
setActivatorNodeRef: (element: HTMLElement | null) => void;
setDroppableNodeRef: (element: HTMLElement | null) => void;
setDraggableNodeRef: (element: HTMLElement | null) => void;
transform: import("@dnd-kit/utilities").Transform | null;
transition: string | undefined;
};

View File

@@ -0,0 +1 @@
export { useDerivedTransform } from './useDerivedTransform';

View File

@@ -0,0 +1,11 @@
/// <reference types="react" />
import { ClientRect } from '@dnd-kit/core';
import { Transform } from '@dnd-kit/utilities';
interface Arguments {
rect: React.MutableRefObject<ClientRect | null>;
disabled: boolean;
index: number;
node: React.MutableRefObject<HTMLElement | null>;
}
export declare function useDerivedTransform({ disabled, index, node, rect }: Arguments): Transform | null;
export {};

9
node_modules/@dnd-kit/sortable/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,9 @@
export { SortableContext } from './components';
export type { SortableContextProps } from './components';
export { useSortable, defaultAnimateLayoutChanges, defaultNewIndexGetter, } from './hooks';
export type { UseSortableArguments, AnimateLayoutChanges, NewIndexGetter, } from './hooks';
export { horizontalListSortingStrategy, rectSortingStrategy, rectSwappingStrategy, verticalListSortingStrategy, } from './strategies';
export { sortableKeyboardCoordinates } from './sensors';
export { arrayMove, arraySwap } from './utilities';
export { hasSortableData } from './types';
export type { SortableData, SortingStrategy } from './types';

8
node_modules/@dnd-kit/sortable/dist/index.js generated vendored Normal file
View File

@@ -0,0 +1,8 @@
'use strict'
if (process.env.NODE_ENV === 'production') {
module.exports = require('./sortable.cjs.production.min.js')
} else {
module.exports = require('./sortable.cjs.development.js')
}

View File

@@ -0,0 +1 @@
export * from './keyboard';

View File

@@ -0,0 +1 @@
export { sortableKeyboardCoordinates } from './sortableKeyboardCoordinates';

View File

@@ -0,0 +1,2 @@
import { KeyboardCoordinateGetter } from '@dnd-kit/core';
export declare const sortableKeyboardCoordinates: KeyboardCoordinateGetter;

View File

@@ -0,0 +1,801 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var React = require('react');
var React__default = _interopDefault(React);
var core = require('@dnd-kit/core');
var utilities = require('@dnd-kit/utilities');
/**
* Move an array item to a different position. Returns a new array with the item moved to the new position.
*/
function arrayMove(array, from, to) {
const newArray = array.slice();
newArray.splice(to < 0 ? newArray.length + to : to, 0, newArray.splice(from, 1)[0]);
return newArray;
}
/**
* Swap an array item to a different position. Returns a new array with the item swapped to the new position.
*/
function arraySwap(array, from, to) {
const newArray = array.slice();
newArray[from] = array[to];
newArray[to] = array[from];
return newArray;
}
function getSortedRects(items, rects) {
return items.reduce((accumulator, id, index) => {
const rect = rects.get(id);
if (rect) {
accumulator[index] = rect;
}
return accumulator;
}, Array(items.length));
}
function isValidIndex(index) {
return index !== null && index >= 0;
}
function itemsEqual(a, b) {
if (a === b) {
return true;
}
if (a.length !== b.length) {
return false;
}
for (let i = 0; i < a.length; i++) {
if (a[i] !== b[i]) {
return false;
}
}
return true;
}
function normalizeDisabled(disabled) {
if (typeof disabled === 'boolean') {
return {
draggable: disabled,
droppable: disabled
};
}
return disabled;
}
// To-do: We should be calculating scale transformation
const defaultScale = {
scaleX: 1,
scaleY: 1
};
const horizontalListSortingStrategy = _ref => {
var _rects$activeIndex;
let {
rects,
activeNodeRect: fallbackActiveRect,
activeIndex,
overIndex,
index
} = _ref;
const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect;
if (!activeNodeRect) {
return null;
}
const itemGap = getItemGap(rects, index, activeIndex);
if (index === activeIndex) {
const newIndexRect = rects[overIndex];
if (!newIndexRect) {
return null;
}
return {
x: activeIndex < overIndex ? newIndexRect.left + newIndexRect.width - (activeNodeRect.left + activeNodeRect.width) : newIndexRect.left - activeNodeRect.left,
y: 0,
...defaultScale
};
}
if (index > activeIndex && index <= overIndex) {
return {
x: -activeNodeRect.width - itemGap,
y: 0,
...defaultScale
};
}
if (index < activeIndex && index >= overIndex) {
return {
x: activeNodeRect.width + itemGap,
y: 0,
...defaultScale
};
}
return {
x: 0,
y: 0,
...defaultScale
};
};
function getItemGap(rects, index, activeIndex) {
const currentRect = rects[index];
const previousRect = rects[index - 1];
const nextRect = rects[index + 1];
if (!currentRect || !previousRect && !nextRect) {
return 0;
}
if (activeIndex < index) {
return previousRect ? currentRect.left - (previousRect.left + previousRect.width) : nextRect.left - (currentRect.left + currentRect.width);
}
return nextRect ? nextRect.left - (currentRect.left + currentRect.width) : currentRect.left - (previousRect.left + previousRect.width);
}
const rectSortingStrategy = _ref => {
let {
rects,
activeIndex,
overIndex,
index
} = _ref;
const newRects = arrayMove(rects, overIndex, activeIndex);
const oldRect = rects[index];
const newRect = newRects[index];
if (!newRect || !oldRect) {
return null;
}
return {
x: newRect.left - oldRect.left,
y: newRect.top - oldRect.top,
scaleX: newRect.width / oldRect.width,
scaleY: newRect.height / oldRect.height
};
};
const rectSwappingStrategy = _ref => {
let {
activeIndex,
index,
rects,
overIndex
} = _ref;
let oldRect;
let newRect;
if (index === activeIndex) {
oldRect = rects[index];
newRect = rects[overIndex];
}
if (index === overIndex) {
oldRect = rects[index];
newRect = rects[activeIndex];
}
if (!newRect || !oldRect) {
return null;
}
return {
x: newRect.left - oldRect.left,
y: newRect.top - oldRect.top,
scaleX: newRect.width / oldRect.width,
scaleY: newRect.height / oldRect.height
};
};
// To-do: We should be calculating scale transformation
const defaultScale$1 = {
scaleX: 1,
scaleY: 1
};
const verticalListSortingStrategy = _ref => {
var _rects$activeIndex;
let {
activeIndex,
activeNodeRect: fallbackActiveRect,
index,
rects,
overIndex
} = _ref;
const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect;
if (!activeNodeRect) {
return null;
}
if (index === activeIndex) {
const overIndexRect = rects[overIndex];
if (!overIndexRect) {
return null;
}
return {
x: 0,
y: activeIndex < overIndex ? overIndexRect.top + overIndexRect.height - (activeNodeRect.top + activeNodeRect.height) : overIndexRect.top - activeNodeRect.top,
...defaultScale$1
};
}
const itemGap = getItemGap$1(rects, index, activeIndex);
if (index > activeIndex && index <= overIndex) {
return {
x: 0,
y: -activeNodeRect.height - itemGap,
...defaultScale$1
};
}
if (index < activeIndex && index >= overIndex) {
return {
x: 0,
y: activeNodeRect.height + itemGap,
...defaultScale$1
};
}
return {
x: 0,
y: 0,
...defaultScale$1
};
};
function getItemGap$1(clientRects, index, activeIndex) {
const currentRect = clientRects[index];
const previousRect = clientRects[index - 1];
const nextRect = clientRects[index + 1];
if (!currentRect) {
return 0;
}
if (activeIndex < index) {
return previousRect ? currentRect.top - (previousRect.top + previousRect.height) : nextRect ? nextRect.top - (currentRect.top + currentRect.height) : 0;
}
return nextRect ? nextRect.top - (currentRect.top + currentRect.height) : previousRect ? currentRect.top - (previousRect.top + previousRect.height) : 0;
}
const ID_PREFIX = 'Sortable';
const Context = /*#__PURE__*/React__default.createContext({
activeIndex: -1,
containerId: ID_PREFIX,
disableTransforms: false,
items: [],
overIndex: -1,
useDragOverlay: false,
sortedRects: [],
strategy: rectSortingStrategy,
disabled: {
draggable: false,
droppable: false
}
});
function SortableContext(_ref) {
let {
children,
id,
items: userDefinedItems,
strategy = rectSortingStrategy,
disabled: disabledProp = false
} = _ref;
const {
active,
dragOverlay,
droppableRects,
over,
measureDroppableContainers
} = core.useDndContext();
const containerId = utilities.useUniqueId(ID_PREFIX, id);
const useDragOverlay = Boolean(dragOverlay.rect !== null);
const items = React.useMemo(() => userDefinedItems.map(item => typeof item === 'object' && 'id' in item ? item.id : item), [userDefinedItems]);
const isDragging = active != null;
const activeIndex = active ? items.indexOf(active.id) : -1;
const overIndex = over ? items.indexOf(over.id) : -1;
const previousItemsRef = React.useRef(items);
const itemsHaveChanged = !itemsEqual(items, previousItemsRef.current);
const disableTransforms = overIndex !== -1 && activeIndex === -1 || itemsHaveChanged;
const disabled = normalizeDisabled(disabledProp);
utilities.useIsomorphicLayoutEffect(() => {
if (itemsHaveChanged && isDragging) {
measureDroppableContainers(items);
}
}, [itemsHaveChanged, items, isDragging, measureDroppableContainers]);
React.useEffect(() => {
previousItemsRef.current = items;
}, [items]);
const contextValue = React.useMemo(() => ({
activeIndex,
containerId,
disabled,
disableTransforms,
items,
overIndex,
useDragOverlay,
sortedRects: getSortedRects(items, droppableRects),
strategy
}), // eslint-disable-next-line react-hooks/exhaustive-deps
[activeIndex, containerId, disabled.draggable, disabled.droppable, disableTransforms, items, overIndex, droppableRects, useDragOverlay, strategy]);
return React__default.createElement(Context.Provider, {
value: contextValue
}, children);
}
const defaultNewIndexGetter = _ref => {
let {
id,
items,
activeIndex,
overIndex
} = _ref;
return arrayMove(items, activeIndex, overIndex).indexOf(id);
};
const defaultAnimateLayoutChanges = _ref2 => {
let {
containerId,
isSorting,
wasDragging,
index,
items,
newIndex,
previousItems,
previousContainerId,
transition
} = _ref2;
if (!transition || !wasDragging) {
return false;
}
if (previousItems !== items && index === newIndex) {
return false;
}
if (isSorting) {
return true;
}
return newIndex !== index && containerId === previousContainerId;
};
const defaultTransition = {
duration: 200,
easing: 'ease'
};
const transitionProperty = 'transform';
const disabledTransition = /*#__PURE__*/utilities.CSS.Transition.toString({
property: transitionProperty,
duration: 0,
easing: 'linear'
});
const defaultAttributes = {
roleDescription: 'sortable'
};
/*
* When the index of an item changes while sorting,
* we need to temporarily disable the transforms
*/
function useDerivedTransform(_ref) {
let {
disabled,
index,
node,
rect
} = _ref;
const [derivedTransform, setDerivedtransform] = React.useState(null);
const previousIndex = React.useRef(index);
utilities.useIsomorphicLayoutEffect(() => {
if (!disabled && index !== previousIndex.current && node.current) {
const initial = rect.current;
if (initial) {
const current = core.getClientRect(node.current, {
ignoreTransform: true
});
const delta = {
x: initial.left - current.left,
y: initial.top - current.top,
scaleX: initial.width / current.width,
scaleY: initial.height / current.height
};
if (delta.x || delta.y) {
setDerivedtransform(delta);
}
}
}
if (index !== previousIndex.current) {
previousIndex.current = index;
}
}, [disabled, index, node, rect]);
React.useEffect(() => {
if (derivedTransform) {
setDerivedtransform(null);
}
}, [derivedTransform]);
return derivedTransform;
}
function useSortable(_ref) {
let {
animateLayoutChanges = defaultAnimateLayoutChanges,
attributes: userDefinedAttributes,
disabled: localDisabled,
data: customData,
getNewIndex = defaultNewIndexGetter,
id,
strategy: localStrategy,
resizeObserverConfig,
transition = defaultTransition
} = _ref;
const {
items,
containerId,
activeIndex,
disabled: globalDisabled,
disableTransforms,
sortedRects,
overIndex,
useDragOverlay,
strategy: globalStrategy
} = React.useContext(Context);
const disabled = normalizeLocalDisabled(localDisabled, globalDisabled);
const index = items.indexOf(id);
const data = React.useMemo(() => ({
sortable: {
containerId,
index,
items
},
...customData
}), [containerId, customData, index, items]);
const itemsAfterCurrentSortable = React.useMemo(() => items.slice(items.indexOf(id)), [items, id]);
const {
rect,
node,
isOver,
setNodeRef: setDroppableNodeRef
} = core.useDroppable({
id,
data,
disabled: disabled.droppable,
resizeObserverConfig: {
updateMeasurementsFor: itemsAfterCurrentSortable,
...resizeObserverConfig
}
});
const {
active,
activatorEvent,
activeNodeRect,
attributes,
setNodeRef: setDraggableNodeRef,
listeners,
isDragging,
over,
setActivatorNodeRef,
transform
} = core.useDraggable({
id,
data,
attributes: { ...defaultAttributes,
...userDefinedAttributes
},
disabled: disabled.draggable
});
const setNodeRef = utilities.useCombinedRefs(setDroppableNodeRef, setDraggableNodeRef);
const isSorting = Boolean(active);
const displaceItem = isSorting && !disableTransforms && isValidIndex(activeIndex) && isValidIndex(overIndex);
const shouldDisplaceDragSource = !useDragOverlay && isDragging;
const dragSourceDisplacement = shouldDisplaceDragSource && displaceItem ? transform : null;
const strategy = localStrategy != null ? localStrategy : globalStrategy;
const finalTransform = displaceItem ? dragSourceDisplacement != null ? dragSourceDisplacement : strategy({
rects: sortedRects,
activeNodeRect,
activeIndex,
overIndex,
index
}) : null;
const newIndex = isValidIndex(activeIndex) && isValidIndex(overIndex) ? getNewIndex({
id,
items,
activeIndex,
overIndex
}) : index;
const activeId = active == null ? void 0 : active.id;
const previous = React.useRef({
activeId,
items,
newIndex,
containerId
});
const itemsHaveChanged = items !== previous.current.items;
const shouldAnimateLayoutChanges = animateLayoutChanges({
active,
containerId,
isDragging,
isSorting,
id,
index,
items,
newIndex: previous.current.newIndex,
previousItems: previous.current.items,
previousContainerId: previous.current.containerId,
transition,
wasDragging: previous.current.activeId != null
});
const derivedTransform = useDerivedTransform({
disabled: !shouldAnimateLayoutChanges,
index,
node,
rect
});
React.useEffect(() => {
if (isSorting && previous.current.newIndex !== newIndex) {
previous.current.newIndex = newIndex;
}
if (containerId !== previous.current.containerId) {
previous.current.containerId = containerId;
}
if (items !== previous.current.items) {
previous.current.items = items;
}
}, [isSorting, newIndex, containerId, items]);
React.useEffect(() => {
if (activeId === previous.current.activeId) {
return;
}
if (activeId && !previous.current.activeId) {
previous.current.activeId = activeId;
return;
}
const timeoutId = setTimeout(() => {
previous.current.activeId = activeId;
}, 50);
return () => clearTimeout(timeoutId);
}, [activeId]);
return {
active,
activeIndex,
attributes,
data,
rect,
index,
newIndex,
items,
isOver,
isSorting,
isDragging,
listeners,
node,
overIndex,
over,
setNodeRef,
setActivatorNodeRef,
setDroppableNodeRef,
setDraggableNodeRef,
transform: derivedTransform != null ? derivedTransform : finalTransform,
transition: getTransition()
};
function getTransition() {
if ( // Temporarily disable transitions for a single frame to set up derived transforms
derivedTransform || // Or to prevent items jumping to back to their "new" position when items change
itemsHaveChanged && previous.current.newIndex === index) {
return disabledTransition;
}
if (shouldDisplaceDragSource && !utilities.isKeyboardEvent(activatorEvent) || !transition) {
return undefined;
}
if (isSorting || shouldAnimateLayoutChanges) {
return utilities.CSS.Transition.toString({ ...transition,
property: transitionProperty
});
}
return undefined;
}
}
function normalizeLocalDisabled(localDisabled, globalDisabled) {
var _localDisabled$dragga, _localDisabled$droppa;
if (typeof localDisabled === 'boolean') {
return {
draggable: localDisabled,
// Backwards compatibility
droppable: false
};
}
return {
draggable: (_localDisabled$dragga = localDisabled == null ? void 0 : localDisabled.draggable) != null ? _localDisabled$dragga : globalDisabled.draggable,
droppable: (_localDisabled$droppa = localDisabled == null ? void 0 : localDisabled.droppable) != null ? _localDisabled$droppa : globalDisabled.droppable
};
}
function hasSortableData(entry) {
if (!entry) {
return false;
}
const data = entry.data.current;
if (data && 'sortable' in data && typeof data.sortable === 'object' && 'containerId' in data.sortable && 'items' in data.sortable && 'index' in data.sortable) {
return true;
}
return false;
}
const directions = [core.KeyboardCode.Down, core.KeyboardCode.Right, core.KeyboardCode.Up, core.KeyboardCode.Left];
const sortableKeyboardCoordinates = (event, _ref) => {
let {
context: {
active,
collisionRect,
droppableRects,
droppableContainers,
over,
scrollableAncestors
}
} = _ref;
if (directions.includes(event.code)) {
event.preventDefault();
if (!active || !collisionRect) {
return;
}
const filteredContainers = [];
droppableContainers.getEnabled().forEach(entry => {
if (!entry || entry != null && entry.disabled) {
return;
}
const rect = droppableRects.get(entry.id);
if (!rect) {
return;
}
switch (event.code) {
case core.KeyboardCode.Down:
if (collisionRect.top < rect.top) {
filteredContainers.push(entry);
}
break;
case core.KeyboardCode.Up:
if (collisionRect.top > rect.top) {
filteredContainers.push(entry);
}
break;
case core.KeyboardCode.Left:
if (collisionRect.left > rect.left) {
filteredContainers.push(entry);
}
break;
case core.KeyboardCode.Right:
if (collisionRect.left < rect.left) {
filteredContainers.push(entry);
}
break;
}
});
const collisions = core.closestCorners({
active,
collisionRect: collisionRect,
droppableRects,
droppableContainers: filteredContainers,
pointerCoordinates: null
});
let closestId = core.getFirstCollision(collisions, 'id');
if (closestId === (over == null ? void 0 : over.id) && collisions.length > 1) {
closestId = collisions[1].id;
}
if (closestId != null) {
const activeDroppable = droppableContainers.get(active.id);
const newDroppable = droppableContainers.get(closestId);
const newRect = newDroppable ? droppableRects.get(newDroppable.id) : null;
const newNode = newDroppable == null ? void 0 : newDroppable.node.current;
if (newNode && newRect && activeDroppable && newDroppable) {
const newScrollAncestors = core.getScrollableAncestors(newNode);
const hasDifferentScrollAncestors = newScrollAncestors.some((element, index) => scrollableAncestors[index] !== element);
const hasSameContainer = isSameContainer(activeDroppable, newDroppable);
const isAfterActive = isAfter(activeDroppable, newDroppable);
const offset = hasDifferentScrollAncestors || !hasSameContainer ? {
x: 0,
y: 0
} : {
x: isAfterActive ? collisionRect.width - newRect.width : 0,
y: isAfterActive ? collisionRect.height - newRect.height : 0
};
const rectCoordinates = {
x: newRect.left,
y: newRect.top
};
const newCoordinates = offset.x && offset.y ? rectCoordinates : utilities.subtract(rectCoordinates, offset);
return newCoordinates;
}
}
}
return undefined;
};
function isSameContainer(a, b) {
if (!hasSortableData(a) || !hasSortableData(b)) {
return false;
}
return a.data.current.sortable.containerId === b.data.current.sortable.containerId;
}
function isAfter(a, b) {
if (!hasSortableData(a) || !hasSortableData(b)) {
return false;
}
if (!isSameContainer(a, b)) {
return false;
}
return a.data.current.sortable.index < b.data.current.sortable.index;
}
exports.SortableContext = SortableContext;
exports.arrayMove = arrayMove;
exports.arraySwap = arraySwap;
exports.defaultAnimateLayoutChanges = defaultAnimateLayoutChanges;
exports.defaultNewIndexGetter = defaultNewIndexGetter;
exports.hasSortableData = hasSortableData;
exports.horizontalListSortingStrategy = horizontalListSortingStrategy;
exports.rectSortingStrategy = rectSortingStrategy;
exports.rectSwappingStrategy = rectSwappingStrategy;
exports.sortableKeyboardCoordinates = sortableKeyboardCoordinates;
exports.useSortable = useSortable;
exports.verticalListSortingStrategy = verticalListSortingStrategy;
//# sourceMappingURL=sortable.cjs.development.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

783
node_modules/@dnd-kit/sortable/dist/sortable.esm.js generated vendored Normal file
View File

@@ -0,0 +1,783 @@
import React, { useMemo, useRef, useEffect, useState, useContext } from 'react';
import { useDndContext, getClientRect, useDroppable, useDraggable, closestCorners, getFirstCollision, getScrollableAncestors, KeyboardCode } from '@dnd-kit/core';
import { useUniqueId, useIsomorphicLayoutEffect, CSS, useCombinedRefs, isKeyboardEvent, subtract } from '@dnd-kit/utilities';
/**
* Move an array item to a different position. Returns a new array with the item moved to the new position.
*/
function arrayMove(array, from, to) {
const newArray = array.slice();
newArray.splice(to < 0 ? newArray.length + to : to, 0, newArray.splice(from, 1)[0]);
return newArray;
}
/**
* Swap an array item to a different position. Returns a new array with the item swapped to the new position.
*/
function arraySwap(array, from, to) {
const newArray = array.slice();
newArray[from] = array[to];
newArray[to] = array[from];
return newArray;
}
function getSortedRects(items, rects) {
return items.reduce((accumulator, id, index) => {
const rect = rects.get(id);
if (rect) {
accumulator[index] = rect;
}
return accumulator;
}, Array(items.length));
}
function isValidIndex(index) {
return index !== null && index >= 0;
}
function itemsEqual(a, b) {
if (a === b) {
return true;
}
if (a.length !== b.length) {
return false;
}
for (let i = 0; i < a.length; i++) {
if (a[i] !== b[i]) {
return false;
}
}
return true;
}
function normalizeDisabled(disabled) {
if (typeof disabled === 'boolean') {
return {
draggable: disabled,
droppable: disabled
};
}
return disabled;
}
// To-do: We should be calculating scale transformation
const defaultScale = {
scaleX: 1,
scaleY: 1
};
const horizontalListSortingStrategy = _ref => {
var _rects$activeIndex;
let {
rects,
activeNodeRect: fallbackActiveRect,
activeIndex,
overIndex,
index
} = _ref;
const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect;
if (!activeNodeRect) {
return null;
}
const itemGap = getItemGap(rects, index, activeIndex);
if (index === activeIndex) {
const newIndexRect = rects[overIndex];
if (!newIndexRect) {
return null;
}
return {
x: activeIndex < overIndex ? newIndexRect.left + newIndexRect.width - (activeNodeRect.left + activeNodeRect.width) : newIndexRect.left - activeNodeRect.left,
y: 0,
...defaultScale
};
}
if (index > activeIndex && index <= overIndex) {
return {
x: -activeNodeRect.width - itemGap,
y: 0,
...defaultScale
};
}
if (index < activeIndex && index >= overIndex) {
return {
x: activeNodeRect.width + itemGap,
y: 0,
...defaultScale
};
}
return {
x: 0,
y: 0,
...defaultScale
};
};
function getItemGap(rects, index, activeIndex) {
const currentRect = rects[index];
const previousRect = rects[index - 1];
const nextRect = rects[index + 1];
if (!currentRect || !previousRect && !nextRect) {
return 0;
}
if (activeIndex < index) {
return previousRect ? currentRect.left - (previousRect.left + previousRect.width) : nextRect.left - (currentRect.left + currentRect.width);
}
return nextRect ? nextRect.left - (currentRect.left + currentRect.width) : currentRect.left - (previousRect.left + previousRect.width);
}
const rectSortingStrategy = _ref => {
let {
rects,
activeIndex,
overIndex,
index
} = _ref;
const newRects = arrayMove(rects, overIndex, activeIndex);
const oldRect = rects[index];
const newRect = newRects[index];
if (!newRect || !oldRect) {
return null;
}
return {
x: newRect.left - oldRect.left,
y: newRect.top - oldRect.top,
scaleX: newRect.width / oldRect.width,
scaleY: newRect.height / oldRect.height
};
};
const rectSwappingStrategy = _ref => {
let {
activeIndex,
index,
rects,
overIndex
} = _ref;
let oldRect;
let newRect;
if (index === activeIndex) {
oldRect = rects[index];
newRect = rects[overIndex];
}
if (index === overIndex) {
oldRect = rects[index];
newRect = rects[activeIndex];
}
if (!newRect || !oldRect) {
return null;
}
return {
x: newRect.left - oldRect.left,
y: newRect.top - oldRect.top,
scaleX: newRect.width / oldRect.width,
scaleY: newRect.height / oldRect.height
};
};
// To-do: We should be calculating scale transformation
const defaultScale$1 = {
scaleX: 1,
scaleY: 1
};
const verticalListSortingStrategy = _ref => {
var _rects$activeIndex;
let {
activeIndex,
activeNodeRect: fallbackActiveRect,
index,
rects,
overIndex
} = _ref;
const activeNodeRect = (_rects$activeIndex = rects[activeIndex]) != null ? _rects$activeIndex : fallbackActiveRect;
if (!activeNodeRect) {
return null;
}
if (index === activeIndex) {
const overIndexRect = rects[overIndex];
if (!overIndexRect) {
return null;
}
return {
x: 0,
y: activeIndex < overIndex ? overIndexRect.top + overIndexRect.height - (activeNodeRect.top + activeNodeRect.height) : overIndexRect.top - activeNodeRect.top,
...defaultScale$1
};
}
const itemGap = getItemGap$1(rects, index, activeIndex);
if (index > activeIndex && index <= overIndex) {
return {
x: 0,
y: -activeNodeRect.height - itemGap,
...defaultScale$1
};
}
if (index < activeIndex && index >= overIndex) {
return {
x: 0,
y: activeNodeRect.height + itemGap,
...defaultScale$1
};
}
return {
x: 0,
y: 0,
...defaultScale$1
};
};
function getItemGap$1(clientRects, index, activeIndex) {
const currentRect = clientRects[index];
const previousRect = clientRects[index - 1];
const nextRect = clientRects[index + 1];
if (!currentRect) {
return 0;
}
if (activeIndex < index) {
return previousRect ? currentRect.top - (previousRect.top + previousRect.height) : nextRect ? nextRect.top - (currentRect.top + currentRect.height) : 0;
}
return nextRect ? nextRect.top - (currentRect.top + currentRect.height) : previousRect ? currentRect.top - (previousRect.top + previousRect.height) : 0;
}
const ID_PREFIX = 'Sortable';
const Context = /*#__PURE__*/React.createContext({
activeIndex: -1,
containerId: ID_PREFIX,
disableTransforms: false,
items: [],
overIndex: -1,
useDragOverlay: false,
sortedRects: [],
strategy: rectSortingStrategy,
disabled: {
draggable: false,
droppable: false
}
});
function SortableContext(_ref) {
let {
children,
id,
items: userDefinedItems,
strategy = rectSortingStrategy,
disabled: disabledProp = false
} = _ref;
const {
active,
dragOverlay,
droppableRects,
over,
measureDroppableContainers
} = useDndContext();
const containerId = useUniqueId(ID_PREFIX, id);
const useDragOverlay = Boolean(dragOverlay.rect !== null);
const items = useMemo(() => userDefinedItems.map(item => typeof item === 'object' && 'id' in item ? item.id : item), [userDefinedItems]);
const isDragging = active != null;
const activeIndex = active ? items.indexOf(active.id) : -1;
const overIndex = over ? items.indexOf(over.id) : -1;
const previousItemsRef = useRef(items);
const itemsHaveChanged = !itemsEqual(items, previousItemsRef.current);
const disableTransforms = overIndex !== -1 && activeIndex === -1 || itemsHaveChanged;
const disabled = normalizeDisabled(disabledProp);
useIsomorphicLayoutEffect(() => {
if (itemsHaveChanged && isDragging) {
measureDroppableContainers(items);
}
}, [itemsHaveChanged, items, isDragging, measureDroppableContainers]);
useEffect(() => {
previousItemsRef.current = items;
}, [items]);
const contextValue = useMemo(() => ({
activeIndex,
containerId,
disabled,
disableTransforms,
items,
overIndex,
useDragOverlay,
sortedRects: getSortedRects(items, droppableRects),
strategy
}), // eslint-disable-next-line react-hooks/exhaustive-deps
[activeIndex, containerId, disabled.draggable, disabled.droppable, disableTransforms, items, overIndex, droppableRects, useDragOverlay, strategy]);
return React.createElement(Context.Provider, {
value: contextValue
}, children);
}
const defaultNewIndexGetter = _ref => {
let {
id,
items,
activeIndex,
overIndex
} = _ref;
return arrayMove(items, activeIndex, overIndex).indexOf(id);
};
const defaultAnimateLayoutChanges = _ref2 => {
let {
containerId,
isSorting,
wasDragging,
index,
items,
newIndex,
previousItems,
previousContainerId,
transition
} = _ref2;
if (!transition || !wasDragging) {
return false;
}
if (previousItems !== items && index === newIndex) {
return false;
}
if (isSorting) {
return true;
}
return newIndex !== index && containerId === previousContainerId;
};
const defaultTransition = {
duration: 200,
easing: 'ease'
};
const transitionProperty = 'transform';
const disabledTransition = /*#__PURE__*/CSS.Transition.toString({
property: transitionProperty,
duration: 0,
easing: 'linear'
});
const defaultAttributes = {
roleDescription: 'sortable'
};
/*
* When the index of an item changes while sorting,
* we need to temporarily disable the transforms
*/
function useDerivedTransform(_ref) {
let {
disabled,
index,
node,
rect
} = _ref;
const [derivedTransform, setDerivedtransform] = useState(null);
const previousIndex = useRef(index);
useIsomorphicLayoutEffect(() => {
if (!disabled && index !== previousIndex.current && node.current) {
const initial = rect.current;
if (initial) {
const current = getClientRect(node.current, {
ignoreTransform: true
});
const delta = {
x: initial.left - current.left,
y: initial.top - current.top,
scaleX: initial.width / current.width,
scaleY: initial.height / current.height
};
if (delta.x || delta.y) {
setDerivedtransform(delta);
}
}
}
if (index !== previousIndex.current) {
previousIndex.current = index;
}
}, [disabled, index, node, rect]);
useEffect(() => {
if (derivedTransform) {
setDerivedtransform(null);
}
}, [derivedTransform]);
return derivedTransform;
}
function useSortable(_ref) {
let {
animateLayoutChanges = defaultAnimateLayoutChanges,
attributes: userDefinedAttributes,
disabled: localDisabled,
data: customData,
getNewIndex = defaultNewIndexGetter,
id,
strategy: localStrategy,
resizeObserverConfig,
transition = defaultTransition
} = _ref;
const {
items,
containerId,
activeIndex,
disabled: globalDisabled,
disableTransforms,
sortedRects,
overIndex,
useDragOverlay,
strategy: globalStrategy
} = useContext(Context);
const disabled = normalizeLocalDisabled(localDisabled, globalDisabled);
const index = items.indexOf(id);
const data = useMemo(() => ({
sortable: {
containerId,
index,
items
},
...customData
}), [containerId, customData, index, items]);
const itemsAfterCurrentSortable = useMemo(() => items.slice(items.indexOf(id)), [items, id]);
const {
rect,
node,
isOver,
setNodeRef: setDroppableNodeRef
} = useDroppable({
id,
data,
disabled: disabled.droppable,
resizeObserverConfig: {
updateMeasurementsFor: itemsAfterCurrentSortable,
...resizeObserverConfig
}
});
const {
active,
activatorEvent,
activeNodeRect,
attributes,
setNodeRef: setDraggableNodeRef,
listeners,
isDragging,
over,
setActivatorNodeRef,
transform
} = useDraggable({
id,
data,
attributes: { ...defaultAttributes,
...userDefinedAttributes
},
disabled: disabled.draggable
});
const setNodeRef = useCombinedRefs(setDroppableNodeRef, setDraggableNodeRef);
const isSorting = Boolean(active);
const displaceItem = isSorting && !disableTransforms && isValidIndex(activeIndex) && isValidIndex(overIndex);
const shouldDisplaceDragSource = !useDragOverlay && isDragging;
const dragSourceDisplacement = shouldDisplaceDragSource && displaceItem ? transform : null;
const strategy = localStrategy != null ? localStrategy : globalStrategy;
const finalTransform = displaceItem ? dragSourceDisplacement != null ? dragSourceDisplacement : strategy({
rects: sortedRects,
activeNodeRect,
activeIndex,
overIndex,
index
}) : null;
const newIndex = isValidIndex(activeIndex) && isValidIndex(overIndex) ? getNewIndex({
id,
items,
activeIndex,
overIndex
}) : index;
const activeId = active == null ? void 0 : active.id;
const previous = useRef({
activeId,
items,
newIndex,
containerId
});
const itemsHaveChanged = items !== previous.current.items;
const shouldAnimateLayoutChanges = animateLayoutChanges({
active,
containerId,
isDragging,
isSorting,
id,
index,
items,
newIndex: previous.current.newIndex,
previousItems: previous.current.items,
previousContainerId: previous.current.containerId,
transition,
wasDragging: previous.current.activeId != null
});
const derivedTransform = useDerivedTransform({
disabled: !shouldAnimateLayoutChanges,
index,
node,
rect
});
useEffect(() => {
if (isSorting && previous.current.newIndex !== newIndex) {
previous.current.newIndex = newIndex;
}
if (containerId !== previous.current.containerId) {
previous.current.containerId = containerId;
}
if (items !== previous.current.items) {
previous.current.items = items;
}
}, [isSorting, newIndex, containerId, items]);
useEffect(() => {
if (activeId === previous.current.activeId) {
return;
}
if (activeId && !previous.current.activeId) {
previous.current.activeId = activeId;
return;
}
const timeoutId = setTimeout(() => {
previous.current.activeId = activeId;
}, 50);
return () => clearTimeout(timeoutId);
}, [activeId]);
return {
active,
activeIndex,
attributes,
data,
rect,
index,
newIndex,
items,
isOver,
isSorting,
isDragging,
listeners,
node,
overIndex,
over,
setNodeRef,
setActivatorNodeRef,
setDroppableNodeRef,
setDraggableNodeRef,
transform: derivedTransform != null ? derivedTransform : finalTransform,
transition: getTransition()
};
function getTransition() {
if ( // Temporarily disable transitions for a single frame to set up derived transforms
derivedTransform || // Or to prevent items jumping to back to their "new" position when items change
itemsHaveChanged && previous.current.newIndex === index) {
return disabledTransition;
}
if (shouldDisplaceDragSource && !isKeyboardEvent(activatorEvent) || !transition) {
return undefined;
}
if (isSorting || shouldAnimateLayoutChanges) {
return CSS.Transition.toString({ ...transition,
property: transitionProperty
});
}
return undefined;
}
}
function normalizeLocalDisabled(localDisabled, globalDisabled) {
var _localDisabled$dragga, _localDisabled$droppa;
if (typeof localDisabled === 'boolean') {
return {
draggable: localDisabled,
// Backwards compatibility
droppable: false
};
}
return {
draggable: (_localDisabled$dragga = localDisabled == null ? void 0 : localDisabled.draggable) != null ? _localDisabled$dragga : globalDisabled.draggable,
droppable: (_localDisabled$droppa = localDisabled == null ? void 0 : localDisabled.droppable) != null ? _localDisabled$droppa : globalDisabled.droppable
};
}
function hasSortableData(entry) {
if (!entry) {
return false;
}
const data = entry.data.current;
if (data && 'sortable' in data && typeof data.sortable === 'object' && 'containerId' in data.sortable && 'items' in data.sortable && 'index' in data.sortable) {
return true;
}
return false;
}
const directions = [KeyboardCode.Down, KeyboardCode.Right, KeyboardCode.Up, KeyboardCode.Left];
const sortableKeyboardCoordinates = (event, _ref) => {
let {
context: {
active,
collisionRect,
droppableRects,
droppableContainers,
over,
scrollableAncestors
}
} = _ref;
if (directions.includes(event.code)) {
event.preventDefault();
if (!active || !collisionRect) {
return;
}
const filteredContainers = [];
droppableContainers.getEnabled().forEach(entry => {
if (!entry || entry != null && entry.disabled) {
return;
}
const rect = droppableRects.get(entry.id);
if (!rect) {
return;
}
switch (event.code) {
case KeyboardCode.Down:
if (collisionRect.top < rect.top) {
filteredContainers.push(entry);
}
break;
case KeyboardCode.Up:
if (collisionRect.top > rect.top) {
filteredContainers.push(entry);
}
break;
case KeyboardCode.Left:
if (collisionRect.left > rect.left) {
filteredContainers.push(entry);
}
break;
case KeyboardCode.Right:
if (collisionRect.left < rect.left) {
filteredContainers.push(entry);
}
break;
}
});
const collisions = closestCorners({
active,
collisionRect: collisionRect,
droppableRects,
droppableContainers: filteredContainers,
pointerCoordinates: null
});
let closestId = getFirstCollision(collisions, 'id');
if (closestId === (over == null ? void 0 : over.id) && collisions.length > 1) {
closestId = collisions[1].id;
}
if (closestId != null) {
const activeDroppable = droppableContainers.get(active.id);
const newDroppable = droppableContainers.get(closestId);
const newRect = newDroppable ? droppableRects.get(newDroppable.id) : null;
const newNode = newDroppable == null ? void 0 : newDroppable.node.current;
if (newNode && newRect && activeDroppable && newDroppable) {
const newScrollAncestors = getScrollableAncestors(newNode);
const hasDifferentScrollAncestors = newScrollAncestors.some((element, index) => scrollableAncestors[index] !== element);
const hasSameContainer = isSameContainer(activeDroppable, newDroppable);
const isAfterActive = isAfter(activeDroppable, newDroppable);
const offset = hasDifferentScrollAncestors || !hasSameContainer ? {
x: 0,
y: 0
} : {
x: isAfterActive ? collisionRect.width - newRect.width : 0,
y: isAfterActive ? collisionRect.height - newRect.height : 0
};
const rectCoordinates = {
x: newRect.left,
y: newRect.top
};
const newCoordinates = offset.x && offset.y ? rectCoordinates : subtract(rectCoordinates, offset);
return newCoordinates;
}
}
}
return undefined;
};
function isSameContainer(a, b) {
if (!hasSortableData(a) || !hasSortableData(b)) {
return false;
}
return a.data.current.sortable.containerId === b.data.current.sortable.containerId;
}
function isAfter(a, b) {
if (!hasSortableData(a) || !hasSortableData(b)) {
return false;
}
if (!isSameContainer(a, b)) {
return false;
}
return a.data.current.sortable.index < b.data.current.sortable.index;
}
export { SortableContext, arrayMove, arraySwap, defaultAnimateLayoutChanges, defaultNewIndexGetter, hasSortableData, horizontalListSortingStrategy, rectSortingStrategy, rectSwappingStrategy, sortableKeyboardCoordinates, useSortable, verticalListSortingStrategy };
//# sourceMappingURL=sortable.esm.js.map

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,2 @@
import type { SortingStrategy } from '../types';
export declare const horizontalListSortingStrategy: SortingStrategy;

View File

@@ -0,0 +1,4 @@
export { horizontalListSortingStrategy } from './horizontalListSorting';
export { rectSortingStrategy } from './rectSorting';
export { rectSwappingStrategy } from './rectSwapping';
export { verticalListSortingStrategy } from './verticalListSorting';

View File

@@ -0,0 +1,2 @@
import type { SortingStrategy } from '../types';
export declare const rectSortingStrategy: SortingStrategy;

View File

@@ -0,0 +1,2 @@
import type { SortingStrategy } from '../types';
export declare const rectSwappingStrategy: SortingStrategy;

View File

@@ -0,0 +1,2 @@
import type { SortingStrategy } from '../types';
export declare const verticalListSortingStrategy: SortingStrategy;

8
node_modules/@dnd-kit/sortable/dist/types/data.d.ts generated vendored Normal file
View File

@@ -0,0 +1,8 @@
import type { UniqueIdentifier } from '@dnd-kit/core';
export declare type SortableData = {
sortable: {
containerId: UniqueIdentifier;
items: UniqueIdentifier[];
index: number;
};
};

View File

@@ -0,0 +1,4 @@
export interface Disabled {
draggable?: boolean;
droppable?: boolean;
}

4
node_modules/@dnd-kit/sortable/dist/types/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,4 @@
export type { Disabled } from './disabled';
export type { SortableData } from './data';
export type { SortingStrategy } from './strategies';
export { hasSortableData } from './type-guard';

View File

@@ -0,0 +1,9 @@
import type { ClientRect } from '@dnd-kit/core';
import type { Transform } from '@dnd-kit/utilities';
export declare type SortingStrategy = (args: {
activeNodeRect: ClientRect | null;
activeIndex: number;
index: number;
rects: ClientRect[];
overIndex: number;
}) => Transform | null;

View File

@@ -0,0 +1,7 @@
import type { Active, Data, DroppableContainer, DraggableNode, Over } from '@dnd-kit/core';
import type { SortableData } from './data';
export declare function hasSortableData<T extends Active | Over | DraggableNode | DroppableContainer>(entry: T | null | undefined): entry is T & {
data: {
current: Data<SortableData>;
};
};

View File

@@ -0,0 +1,4 @@
/**
* Move an array item to a different position. Returns a new array with the item moved to the new position.
*/
export declare function arrayMove<T>(array: T[], from: number, to: number): T[];

View File

@@ -0,0 +1,4 @@
/**
* Swap an array item to a different position. Returns a new array with the item swapped to the new position.
*/
export declare function arraySwap<T>(array: T[], from: number, to: number): T[];

View File

@@ -0,0 +1,2 @@
import type { ClientRect, UniqueIdentifier, UseDndContextReturnValue } from '@dnd-kit/core';
export declare function getSortedRects(items: UniqueIdentifier[], rects: UseDndContextReturnValue['droppableRects']): ClientRect[];

View File

@@ -0,0 +1,6 @@
export { arrayMove } from './arrayMove';
export { arraySwap } from './arraySwap';
export { getSortedRects } from './getSortedRects';
export { isValidIndex } from './isValidIndex';
export { itemsEqual } from './itemsEqual';
export { normalizeDisabled } from './normalizeDisabled';

View File

@@ -0,0 +1 @@
export declare function isValidIndex(index: number | null): index is number;

View File

@@ -0,0 +1,2 @@
import type { UniqueIdentifier } from '@dnd-kit/core';
export declare function itemsEqual(a: UniqueIdentifier[], b: UniqueIdentifier[]): boolean;

View File

@@ -0,0 +1,2 @@
import type { Disabled } from '../types';
export declare function normalizeDisabled(disabled: boolean | Disabled): Disabled;

View File

@@ -0,0 +1,15 @@
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */

View File

@@ -0,0 +1,12 @@
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.

View File

@@ -0,0 +1,164 @@
# tslib
This is a runtime library for [TypeScript](https://www.typescriptlang.org/) that contains all of the TypeScript helper functions.
This library is primarily used by the `--importHelpers` flag in TypeScript.
When using `--importHelpers`, a module that uses helper functions like `__extends` and `__assign` in the following emitted file:
```ts
var __assign = (this && this.__assign) || Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
exports.x = {};
exports.y = __assign({}, exports.x);
```
will instead be emitted as something like the following:
```ts
var tslib_1 = require("tslib");
exports.x = {};
exports.y = tslib_1.__assign({}, exports.x);
```
Because this can avoid duplicate declarations of things like `__extends`, `__assign`, etc., this means delivering users smaller files on average, as well as less runtime overhead.
For optimized bundles with TypeScript, you should absolutely consider using `tslib` and `--importHelpers`.
# Installing
For the latest stable version, run:
## npm
```sh
# TypeScript 3.9.2 or later
npm install tslib
# TypeScript 3.8.4 or earlier
npm install tslib@^1
# TypeScript 2.3.2 or earlier
npm install tslib@1.6.1
```
## yarn
```sh
# TypeScript 3.9.2 or later
yarn add tslib
# TypeScript 3.8.4 or earlier
yarn add tslib@^1
# TypeScript 2.3.2 or earlier
yarn add tslib@1.6.1
```
## bower
```sh
# TypeScript 3.9.2 or later
bower install tslib
# TypeScript 3.8.4 or earlier
bower install tslib@^1
# TypeScript 2.3.2 or earlier
bower install tslib@1.6.1
```
## JSPM
```sh
# TypeScript 3.9.2 or later
jspm install tslib
# TypeScript 3.8.4 or earlier
jspm install tslib@^1
# TypeScript 2.3.2 or earlier
jspm install tslib@1.6.1
```
# Usage
Set the `importHelpers` compiler option on the command line:
```
tsc --importHelpers file.ts
```
or in your tsconfig.json:
```json
{
"compilerOptions": {
"importHelpers": true
}
}
```
#### For bower and JSPM users
You will need to add a `paths` mapping for `tslib`, e.g. For Bower users:
```json
{
"compilerOptions": {
"module": "amd",
"importHelpers": true,
"baseUrl": "./",
"paths": {
"tslib" : ["bower_components/tslib/tslib.d.ts"]
}
}
}
```
For JSPM users:
```json
{
"compilerOptions": {
"module": "system",
"importHelpers": true,
"baseUrl": "./",
"paths": {
"tslib" : ["jspm_packages/npm/tslib@2.x.y/tslib.d.ts"]
}
}
}
```
## Deployment
- Choose your new version number
- Set it in `package.json` and `bower.json`
- Create a tag: `git tag [version]`
- Push the tag: `git push --tags`
- Create a [release in GitHub](https://github.com/microsoft/tslib/releases)
- Run the [publish to npm](https://github.com/microsoft/tslib/actions?query=workflow%3A%22Publish+to+NPM%22) workflow
Done.
# Contribute
There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript.
* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in.
* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls).
* Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript).
* Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter.
* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md).
# Documentation
* [Quick tutorial](http://www.typescriptlang.org/Tutorial)
* [Programming handbook](http://www.typescriptlang.org/Handbook)
* [Homepage](http://www.typescriptlang.org/)

View File

@@ -0,0 +1,41 @@
<!-- BEGIN MICROSOFT SECURITY.MD V0.0.7 BLOCK -->
## Security
Microsoft takes the security of our software products and services seriously, which includes all source code repositories managed through our GitHub organizations, which include [Microsoft](https://github.com/Microsoft), [Azure](https://github.com/Azure), [DotNet](https://github.com/dotnet), [AspNet](https://github.com/aspnet), [Xamarin](https://github.com/xamarin), and [our GitHub organizations](https://opensource.microsoft.com/).
If you believe you have found a security vulnerability in any Microsoft-owned repository that meets [Microsoft's definition of a security vulnerability](https://aka.ms/opensource/security/definition), please report it to us as described below.
## Reporting Security Issues
**Please do not report security vulnerabilities through public GitHub issues.**
Instead, please report them to the Microsoft Security Response Center (MSRC) at [https://msrc.microsoft.com/create-report](https://aka.ms/opensource/security/create-report).
If you prefer to submit without logging in, send email to [secure@microsoft.com](mailto:secure@microsoft.com). If possible, encrypt your message with our PGP key; please download it from the [Microsoft Security Response Center PGP Key page](https://aka.ms/opensource/security/pgpkey).
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Additional information can be found at [microsoft.com/msrc](https://aka.ms/opensource/security/msrc).
Please include the requested information listed below (as much as you can provide) to help us better understand the nature and scope of the possible issue:
* Type of issue (e.g. buffer overflow, SQL injection, cross-site scripting, etc.)
* Full paths of source file(s) related to the manifestation of the issue
* The location of the affected source code (tag/branch/commit or direct URL)
* Any special configuration required to reproduce the issue
* Step-by-step instructions to reproduce the issue
* Proof-of-concept or exploit code (if possible)
* Impact of the issue, including how an attacker might exploit the issue
This information will help us triage your report more quickly.
If you are reporting for a bug bounty, more complete reports can contribute to a higher bounty award. Please visit our [Microsoft Bug Bounty Program](https://aka.ms/opensource/security/bounty) page for more details about our active programs.
## Preferred Languages
We prefer all communications to be in English.
## Policy
Microsoft follows the principle of [Coordinated Vulnerability Disclosure](https://aka.ms/opensource/security/cvd).
<!-- END MICROSOFT SECURITY.MD BLOCK -->

View File

@@ -0,0 +1,37 @@
// Note: named reexports are used instead of `export *` because
// TypeScript itself doesn't resolve the `export *` when checking
// if a particular helper exists.
export {
__extends,
__assign,
__rest,
__decorate,
__param,
__esDecorate,
__runInitializers,
__propKey,
__setFunctionName,
__metadata,
__awaiter,
__generator,
__exportStar,
__values,
__read,
__spread,
__spreadArrays,
__spreadArray,
__await,
__asyncGenerator,
__asyncDelegator,
__asyncValues,
__makeTemplateObject,
__importStar,
__importDefault,
__classPrivateFieldGet,
__classPrivateFieldSet,
__classPrivateFieldIn,
__createBinding,
__addDisposableResource,
__disposeResources,
} from '../tslib.js';
export * as default from '../tslib.js';

View File

@@ -0,0 +1,68 @@
import tslib from '../tslib.js';
const {
__extends,
__assign,
__rest,
__decorate,
__param,
__esDecorate,
__runInitializers,
__propKey,
__setFunctionName,
__metadata,
__awaiter,
__generator,
__exportStar,
__createBinding,
__values,
__read,
__spread,
__spreadArrays,
__spreadArray,
__await,
__asyncGenerator,
__asyncDelegator,
__asyncValues,
__makeTemplateObject,
__importStar,
__importDefault,
__classPrivateFieldGet,
__classPrivateFieldSet,
__classPrivateFieldIn,
__addDisposableResource,
__disposeResources,
} = tslib;
export {
__extends,
__assign,
__rest,
__decorate,
__param,
__esDecorate,
__runInitializers,
__propKey,
__setFunctionName,
__metadata,
__awaiter,
__generator,
__exportStar,
__createBinding,
__values,
__read,
__spread,
__spreadArrays,
__spreadArray,
__await,
__asyncGenerator,
__asyncDelegator,
__asyncValues,
__makeTemplateObject,
__importStar,
__importDefault,
__classPrivateFieldGet,
__classPrivateFieldSet,
__classPrivateFieldIn,
__addDisposableResource,
__disposeResources,
};
export default tslib;

View File

@@ -0,0 +1,3 @@
{
"type": "module"
}

View File

@@ -0,0 +1,47 @@
{
"name": "tslib",
"author": "Microsoft Corp.",
"homepage": "https://www.typescriptlang.org/",
"version": "2.7.0",
"license": "0BSD",
"description": "Runtime library for TypeScript helper functions",
"keywords": [
"TypeScript",
"Microsoft",
"compiler",
"language",
"javascript",
"tslib",
"runtime"
],
"bugs": {
"url": "https://github.com/Microsoft/TypeScript/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/tslib.git"
},
"main": "tslib.js",
"module": "tslib.es6.js",
"jsnext:main": "tslib.es6.js",
"typings": "tslib.d.ts",
"sideEffects": false,
"exports": {
".": {
"module": {
"types": "./modules/index.d.ts",
"default": "./tslib.es6.mjs"
},
"import": {
"node": "./modules/index.js",
"default": {
"types": "./modules/index.d.ts",
"default": "./tslib.es6.mjs"
}
},
"default": "./tslib.js"
},
"./*": "./*",
"./": "./"
}
}

View File

@@ -0,0 +1,453 @@
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/**
* Used to shim class extends.
*
* @param d The derived class.
* @param b The base class.
*/
export declare function __extends(d: Function, b: Function): void;
/**
* Copy the values of all of the enumerable own properties from one or more source objects to a
* target object. Returns the target object.
*
* @param t The target object to copy to.
* @param sources One or more source objects from which to copy properties
*/
export declare function __assign(t: any, ...sources: any[]): any;
/**
* Performs a rest spread on an object.
*
* @param t The source value.
* @param propertyNames The property names excluded from the rest spread.
*/
export declare function __rest(t: any, propertyNames: (string | symbol)[]): any;
/**
* Applies decorators to a target object
*
* @param decorators The set of decorators to apply.
* @param target The target object.
* @param key If specified, the own property to apply the decorators to.
* @param desc The property descriptor, defaults to fetching the descriptor from the target object.
* @experimental
*/
export declare function __decorate(decorators: Function[], target: any, key?: string | symbol, desc?: any): any;
/**
* Creates an observing function decorator from a parameter decorator.
*
* @param paramIndex The parameter index to apply the decorator to.
* @param decorator The parameter decorator to apply. Note that the return value is ignored.
* @experimental
*/
export declare function __param(paramIndex: number, decorator: Function): Function;
/**
* Applies decorators to a class or class member, following the native ECMAScript decorator specification.
* @param ctor For non-field class members, the class constructor. Otherwise, `null`.
* @param descriptorIn The `PropertyDescriptor` to use when unable to look up the property from `ctor`.
* @param decorators The decorators to apply
* @param contextIn The `DecoratorContext` to clone for each decorator application.
* @param initializers An array of field initializer mutation functions into which new initializers are written.
* @param extraInitializers An array of extra initializer functions into which new initializers are written.
*/
export declare function __esDecorate(ctor: Function | null, descriptorIn: object | null, decorators: Function[], contextIn: object, initializers: Function[] | null, extraInitializers: Function[]): void;
/**
* Runs field initializers or extra initializers generated by `__esDecorate`.
* @param thisArg The `this` argument to use.
* @param initializers The array of initializers to evaluate.
* @param value The initial value to pass to the initializers.
*/
export declare function __runInitializers(thisArg: unknown, initializers: Function[], value?: any): any;
/**
* Converts a computed property name into a `string` or `symbol` value.
*/
export declare function __propKey(x: any): string | symbol;
/**
* Assigns the name of a function derived from the left-hand side of an assignment.
* @param f The function to rename.
* @param name The new name for the function.
* @param prefix A prefix (such as `"get"` or `"set"`) to insert before the name.
*/
export declare function __setFunctionName(f: Function, name: string | symbol, prefix?: string): Function;
/**
* Creates a decorator that sets metadata.
*
* @param metadataKey The metadata key
* @param metadataValue The metadata value
* @experimental
*/
export declare function __metadata(metadataKey: any, metadataValue: any): Function;
/**
* Converts a generator function into a pseudo-async function, by treating each `yield` as an `await`.
*
* @param thisArg The reference to use as the `this` value in the generator function
* @param _arguments The optional arguments array
* @param P The optional promise constructor argument, defaults to the `Promise` property of the global object.
* @param generator The generator function
*/
export declare function __awaiter(thisArg: any, _arguments: any, P: Function, generator: Function): any;
/**
* Creates an Iterator object using the body as the implementation.
*
* @param thisArg The reference to use as the `this` value in the function
* @param body The generator state-machine based implementation.
*
* @see [./docs/generator.md]
*/
export declare function __generator(thisArg: any, body: Function): any;
/**
* Creates bindings for all enumerable properties of `m` on `exports`
*
* @param m The source object
* @param o The `exports` object.
*/
export declare function __exportStar(m: any, o: any): void;
/**
* Creates a value iterator from an `Iterable` or `ArrayLike` object.
*
* @param o The object.
* @throws {TypeError} If `o` is neither `Iterable`, nor an `ArrayLike`.
*/
export declare function __values(o: any): any;
/**
* Reads values from an `Iterable` or `ArrayLike` object and returns the resulting array.
*
* @param o The object to read from.
* @param n The maximum number of arguments to read, defaults to `Infinity`.
*/
export declare function __read(o: any, n?: number): any[];
/**
* Creates an array from iterable spread.
*
* @param args The Iterable objects to spread.
* @deprecated since TypeScript 4.2 - Use `__spreadArray`
*/
export declare function __spread(...args: any[][]): any[];
/**
* Creates an array from array spread.
*
* @param args The ArrayLikes to spread into the resulting array.
* @deprecated since TypeScript 4.2 - Use `__spreadArray`
*/
export declare function __spreadArrays(...args: any[][]): any[];
/**
* Spreads the `from` array into the `to` array.
*
* @param pack Replace empty elements with `undefined`.
*/
export declare function __spreadArray(to: any[], from: any[], pack?: boolean): any[];
/**
* Creates an object that signals to `__asyncGenerator` that it shouldn't be yielded,
* and instead should be awaited and the resulting value passed back to the generator.
*
* @param v The value to await.
*/
export declare function __await(v: any): any;
/**
* Converts a generator function into an async generator function, by using `yield __await`
* in place of normal `await`.
*
* @param thisArg The reference to use as the `this` value in the generator function
* @param _arguments The optional arguments array
* @param generator The generator function
*/
export declare function __asyncGenerator(thisArg: any, _arguments: any, generator: Function): any;
/**
* Used to wrap a potentially async iterator in such a way so that it wraps the result
* of calling iterator methods of `o` in `__await` instances, and then yields the awaited values.
*
* @param o The potentially async iterator.
* @returns A synchronous iterator yielding `__await` instances on every odd invocation
* and returning the awaited `IteratorResult` passed to `next` every even invocation.
*/
export declare function __asyncDelegator(o: any): any;
/**
* Creates a value async iterator from an `AsyncIterable`, `Iterable` or `ArrayLike` object.
*
* @param o The object.
* @throws {TypeError} If `o` is neither `AsyncIterable`, `Iterable`, nor an `ArrayLike`.
*/
export declare function __asyncValues(o: any): any;
/**
* Creates a `TemplateStringsArray` frozen object from the `cooked` and `raw` arrays.
*
* @param cooked The cooked possibly-sparse array.
* @param raw The raw string content.
*/
export declare function __makeTemplateObject(cooked: string[], raw: string[]): TemplateStringsArray;
/**
* Used to shim default and named imports in ECMAScript Modules transpiled to CommonJS.
*
* ```js
* import Default, { Named, Other } from "mod";
* // or
* import { default as Default, Named, Other } from "mod";
* ```
*
* @param mod The CommonJS module exports object.
*/
export declare function __importStar<T>(mod: T): T;
/**
* Used to shim default imports in ECMAScript Modules transpiled to CommonJS.
*
* ```js
* import Default from "mod";
* ```
*
* @param mod The CommonJS module exports object.
*/
export declare function __importDefault<T>(mod: T): T | { default: T };
/**
* Emulates reading a private instance field.
*
* @param receiver The instance from which to read the private field.
* @param state A WeakMap containing the private field value for an instance.
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
*
* @throws {TypeError} If `state` doesn't have an entry for `receiver`.
*/
export declare function __classPrivateFieldGet<T extends object, V>(
receiver: T,
state: { has(o: T): boolean, get(o: T): V | undefined },
kind?: "f"
): V;
/**
* Emulates reading a private static field.
*
* @param receiver The object from which to read the private static field.
* @param state The class constructor containing the definition of the static field.
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
* @param f The descriptor that holds the static field value.
*
* @throws {TypeError} If `receiver` is not `state`.
*/
export declare function __classPrivateFieldGet<T extends new (...args: any[]) => unknown, V>(
receiver: T,
state: T,
kind: "f",
f: { value: V }
): V;
/**
* Emulates evaluating a private instance "get" accessor.
*
* @param receiver The instance on which to evaluate the private "get" accessor.
* @param state A WeakSet used to verify an instance supports the private "get" accessor.
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
* @param f The "get" accessor function to evaluate.
*
* @throws {TypeError} If `state` doesn't have an entry for `receiver`.
*/
export declare function __classPrivateFieldGet<T extends object, V>(
receiver: T,
state: { has(o: T): boolean },
kind: "a",
f: () => V
): V;
/**
* Emulates evaluating a private static "get" accessor.
*
* @param receiver The object on which to evaluate the private static "get" accessor.
* @param state The class constructor containing the definition of the static "get" accessor.
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
* @param f The "get" accessor function to evaluate.
*
* @throws {TypeError} If `receiver` is not `state`.
*/
export declare function __classPrivateFieldGet<T extends new (...args: any[]) => unknown, V>(
receiver: T,
state: T,
kind: "a",
f: () => V
): V;
/**
* Emulates reading a private instance method.
*
* @param receiver The instance from which to read a private method.
* @param state A WeakSet used to verify an instance supports the private method.
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
* @param f The function to return as the private instance method.
*
* @throws {TypeError} If `state` doesn't have an entry for `receiver`.
*/
export declare function __classPrivateFieldGet<T extends object, V extends (...args: any[]) => unknown>(
receiver: T,
state: { has(o: T): boolean },
kind: "m",
f: V
): V;
/**
* Emulates reading a private static method.
*
* @param receiver The object from which to read the private static method.
* @param state The class constructor containing the definition of the static method.
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
* @param f The function to return as the private static method.
*
* @throws {TypeError} If `receiver` is not `state`.
*/
export declare function __classPrivateFieldGet<T extends new (...args: any[]) => unknown, V extends (...args: any[]) => unknown>(
receiver: T,
state: T,
kind: "m",
f: V
): V;
/**
* Emulates writing to a private instance field.
*
* @param receiver The instance on which to set a private field value.
* @param state A WeakMap used to store the private field value for an instance.
* @param value The value to store in the private field.
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
*
* @throws {TypeError} If `state` doesn't have an entry for `receiver`.
*/
export declare function __classPrivateFieldSet<T extends object, V>(
receiver: T,
state: { has(o: T): boolean, set(o: T, value: V): unknown },
value: V,
kind?: "f"
): V;
/**
* Emulates writing to a private static field.
*
* @param receiver The object on which to set the private static field.
* @param state The class constructor containing the definition of the private static field.
* @param value The value to store in the private field.
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
* @param f The descriptor that holds the static field value.
*
* @throws {TypeError} If `receiver` is not `state`.
*/
export declare function __classPrivateFieldSet<T extends new (...args: any[]) => unknown, V>(
receiver: T,
state: T,
value: V,
kind: "f",
f: { value: V }
): V;
/**
* Emulates writing to a private instance "set" accessor.
*
* @param receiver The instance on which to evaluate the private instance "set" accessor.
* @param state A WeakSet used to verify an instance supports the private "set" accessor.
* @param value The value to store in the private accessor.
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
* @param f The "set" accessor function to evaluate.
*
* @throws {TypeError} If `state` doesn't have an entry for `receiver`.
*/
export declare function __classPrivateFieldSet<T extends object, V>(
receiver: T,
state: { has(o: T): boolean },
value: V,
kind: "a",
f: (v: V) => void
): V;
/**
* Emulates writing to a private static "set" accessor.
*
* @param receiver The object on which to evaluate the private static "set" accessor.
* @param state The class constructor containing the definition of the static "set" accessor.
* @param value The value to store in the private field.
* @param kind Either `"f"` for a field, `"a"` for an accessor, or `"m"` for a method.
* @param f The "set" accessor function to evaluate.
*
* @throws {TypeError} If `receiver` is not `state`.
*/
export declare function __classPrivateFieldSet<T extends new (...args: any[]) => unknown, V>(
receiver: T,
state: T,
value: V,
kind: "a",
f: (v: V) => void
): V;
/**
* Checks for the existence of a private field/method/accessor.
*
* @param state The class constructor containing the static member, or the WeakMap or WeakSet associated with a private instance member.
* @param receiver The object for which to test the presence of the private member.
*/
export declare function __classPrivateFieldIn(
state: (new (...args: any[]) => unknown) | { has(o: any): boolean },
receiver: unknown,
): boolean;
/**
* Creates a re-export binding on `object` with key `objectKey` that references `target[key]`.
*
* @param object The local `exports` object.
* @param target The object to re-export from.
* @param key The property key of `target` to re-export.
* @param objectKey The property key to re-export as. Defaults to `key`.
*/
export declare function __createBinding(object: object, target: object, key: PropertyKey, objectKey?: PropertyKey): void;
/**
* Adds a disposable resource to a resource-tracking environment object.
* @param env A resource-tracking environment object.
* @param value Either a Disposable or AsyncDisposable object, `null`, or `undefined`.
* @param async When `true`, `AsyncDisposable` resources can be added. When `false`, `AsyncDisposable` resources cannot be added.
* @returns The {@link value} argument.
*
* @throws {TypeError} If {@link value} is not an object, or if either `Symbol.dispose` or `Symbol.asyncDispose` are not
* defined, or if {@link value} does not have an appropriate `Symbol.dispose` or `Symbol.asyncDispose` method.
*/
export declare function __addDisposableResource<T>(env: { stack: { value?: unknown, dispose?: Function, async: boolean }[]; error: unknown; hasError: boolean; }, value: T, async: boolean): T;
/**
* Disposes all resources in a resource-tracking environment object.
* @param env A resource-tracking environment object.
* @returns A {@link Promise} if any resources in the environment were marked as `async` when added; otherwise, `void`.
*
* @throws {SuppressedError} if an error thrown during disposal would have suppressed a prior error from disposal or the
* error recorded in the resource-tracking environment object.
* @seealso {@link __addDisposableResource}
*/
export declare function __disposeResources(env: { stack: { value?: unknown, dispose?: Function, async: boolean }[]; error: unknown; hasError: boolean; }): any;

View File

@@ -0,0 +1 @@
<script src="tslib.es6.js"></script>

View File

@@ -0,0 +1,379 @@
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
export function __extends(d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
export var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
}
return __assign.apply(this, arguments);
}
export function __rest(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
}
export function __decorate(decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
}
export function __param(paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
}
export function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
var _, done = false;
for (var i = decorators.length - 1; i >= 0; i--) {
var context = {};
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
if (kind === "accessor") {
if (result === void 0) continue;
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
if (_ = accept(result.get)) descriptor.get = _;
if (_ = accept(result.set)) descriptor.set = _;
if (_ = accept(result.init)) initializers.unshift(_);
}
else if (_ = accept(result)) {
if (kind === "field") initializers.unshift(_);
else descriptor[key] = _;
}
}
if (target) Object.defineProperty(target, contextIn.name, descriptor);
done = true;
};
export function __runInitializers(thisArg, initializers, value) {
var useValue = arguments.length > 2;
for (var i = 0; i < initializers.length; i++) {
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
}
return useValue ? value : void 0;
};
export function __propKey(x) {
return typeof x === "symbol" ? x : "".concat(x);
};
export function __setFunctionName(f, name, prefix) {
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
};
export function __metadata(metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}
export function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
export function __generator(thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
}
export var __createBinding = Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
});
export function __exportStar(m, o) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
}
export function __values(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
export function __read(o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
}
/** @deprecated */
export function __spread() {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
}
/** @deprecated */
export function __spreadArrays() {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
}
export function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
}
export function __await(v) {
return this instanceof __await ? (this.v = v, this) : new __await(v);
}
export function __asyncGenerator(thisArg, _arguments, generator) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = [];
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
function fulfill(value) { resume("next", value); }
function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}
export function __asyncDelegator(o) {
var i, p;
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
}
export function __asyncValues(o) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator], i;
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}
export function __makeTemplateObject(cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
};
var __setModuleDefault = Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
};
export function __importStar(mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
}
export function __importDefault(mod) {
return (mod && mod.__esModule) ? mod : { default: mod };
}
export function __classPrivateFieldGet(receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}
export function __classPrivateFieldSet(receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
}
export function __classPrivateFieldIn(state, receiver) {
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
return typeof state === "function" ? receiver === state : state.has(receiver);
}
export function __addDisposableResource(env, value, async) {
if (value !== null && value !== void 0) {
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
var dispose, inner;
if (async) {
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
dispose = value[Symbol.asyncDispose];
}
if (dispose === void 0) {
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
dispose = value[Symbol.dispose];
if (async) inner = dispose;
}
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
env.stack.push({ value: value, dispose: dispose, async: async });
}
else if (async) {
env.stack.push({ async: true });
}
return value;
}
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
export function __disposeResources(env) {
function fail(e) {
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
env.hasError = true;
}
var r, s = 0;
function next() {
while (r = env.stack.pop()) {
try {
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
if (r.dispose) {
var result = r.dispose.call(r.value);
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
}
else s |= 1;
}
catch (e) {
fail(e);
}
}
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
if (env.hasError) throw env.error;
}
return next();
}
export default {
__extends: __extends,
__assign: __assign,
__rest: __rest,
__decorate: __decorate,
__param: __param,
__metadata: __metadata,
__awaiter: __awaiter,
__generator: __generator,
__createBinding: __createBinding,
__exportStar: __exportStar,
__values: __values,
__read: __read,
__spread: __spread,
__spreadArrays: __spreadArrays,
__spreadArray: __spreadArray,
__await: __await,
__asyncGenerator: __asyncGenerator,
__asyncDelegator: __asyncDelegator,
__asyncValues: __asyncValues,
__makeTemplateObject: __makeTemplateObject,
__importStar: __importStar,
__importDefault: __importDefault,
__classPrivateFieldGet: __classPrivateFieldGet,
__classPrivateFieldSet: __classPrivateFieldSet,
__classPrivateFieldIn: __classPrivateFieldIn,
__addDisposableResource: __addDisposableResource,
__disposeResources: __disposeResources,
};

View File

@@ -0,0 +1,378 @@
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
var extendStatics = function(d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
export function __extends(d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
}
export var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
}
return __assign.apply(this, arguments);
}
export function __rest(s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
}
export function __decorate(decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
}
export function __param(paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
}
export function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
var _, done = false;
for (var i = decorators.length - 1; i >= 0; i--) {
var context = {};
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
if (kind === "accessor") {
if (result === void 0) continue;
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
if (_ = accept(result.get)) descriptor.get = _;
if (_ = accept(result.set)) descriptor.set = _;
if (_ = accept(result.init)) initializers.unshift(_);
}
else if (_ = accept(result)) {
if (kind === "field") initializers.unshift(_);
else descriptor[key] = _;
}
}
if (target) Object.defineProperty(target, contextIn.name, descriptor);
done = true;
};
export function __runInitializers(thisArg, initializers, value) {
var useValue = arguments.length > 2;
for (var i = 0; i < initializers.length; i++) {
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
}
return useValue ? value : void 0;
};
export function __propKey(x) {
return typeof x === "symbol" ? x : "".concat(x);
};
export function __setFunctionName(f, name, prefix) {
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
};
export function __metadata(metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
}
export function __awaiter(thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
}
export function __generator(thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
}
export var __createBinding = Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
});
export function __exportStar(m, o) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
}
export function __values(o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
}
export function __read(o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
}
/** @deprecated */
export function __spread() {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
}
/** @deprecated */
export function __spreadArrays() {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
}
export function __spreadArray(to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
}
export function __await(v) {
return this instanceof __await ? (this.v = v, this) : new __await(v);
}
export function __asyncGenerator(thisArg, _arguments, generator) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = [];
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
function fulfill(value) { resume("next", value); }
function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
}
export function __asyncDelegator(o) {
var i, p;
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
}
export function __asyncValues(o) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator], i;
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
}
export function __makeTemplateObject(cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
};
var __setModuleDefault = Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
};
export function __importStar(mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
}
export function __importDefault(mod) {
return (mod && mod.__esModule) ? mod : { default: mod };
}
export function __classPrivateFieldGet(receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
}
export function __classPrivateFieldSet(receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
}
export function __classPrivateFieldIn(state, receiver) {
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
return typeof state === "function" ? receiver === state : state.has(receiver);
}
export function __addDisposableResource(env, value, async) {
if (value !== null && value !== void 0) {
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
var dispose, inner;
if (async) {
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
dispose = value[Symbol.asyncDispose];
}
if (dispose === void 0) {
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
dispose = value[Symbol.dispose];
if (async) inner = dispose;
}
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
env.stack.push({ value: value, dispose: dispose, async: async });
}
else if (async) {
env.stack.push({ async: true });
}
return value;
}
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
export function __disposeResources(env) {
function fail(e) {
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
env.hasError = true;
}
var r, s = 0;
function next() {
while (r = env.stack.pop()) {
try {
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
if (r.dispose) {
var result = r.dispose.call(r.value);
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
}
else s |= 1;
}
catch (e) {
fail(e);
}
}
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
if (env.hasError) throw env.error;
}
return next();
}
export default {
__extends,
__assign,
__rest,
__decorate,
__param,
__metadata,
__awaiter,
__generator,
__createBinding,
__exportStar,
__values,
__read,
__spread,
__spreadArrays,
__spreadArray,
__await,
__asyncGenerator,
__asyncDelegator,
__asyncValues,
__makeTemplateObject,
__importStar,
__importDefault,
__classPrivateFieldGet,
__classPrivateFieldSet,
__classPrivateFieldIn,
__addDisposableResource,
__disposeResources,
};

View File

@@ -0,0 +1 @@
<script src="tslib.js"></script>

View File

@@ -0,0 +1,429 @@
/******************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
/* global global, define, Symbol, Reflect, Promise, SuppressedError, Iterator */
var __extends;
var __assign;
var __rest;
var __decorate;
var __param;
var __esDecorate;
var __runInitializers;
var __propKey;
var __setFunctionName;
var __metadata;
var __awaiter;
var __generator;
var __exportStar;
var __values;
var __read;
var __spread;
var __spreadArrays;
var __spreadArray;
var __await;
var __asyncGenerator;
var __asyncDelegator;
var __asyncValues;
var __makeTemplateObject;
var __importStar;
var __importDefault;
var __classPrivateFieldGet;
var __classPrivateFieldSet;
var __classPrivateFieldIn;
var __createBinding;
var __addDisposableResource;
var __disposeResources;
(function (factory) {
var root = typeof global === "object" ? global : typeof self === "object" ? self : typeof this === "object" ? this : {};
if (typeof define === "function" && define.amd) {
define("tslib", ["exports"], function (exports) { factory(createExporter(root, createExporter(exports))); });
}
else if (typeof module === "object" && typeof module.exports === "object") {
factory(createExporter(root, createExporter(module.exports)));
}
else {
factory(createExporter(root));
}
function createExporter(exports, previous) {
if (exports !== root) {
if (typeof Object.create === "function") {
Object.defineProperty(exports, "__esModule", { value: true });
}
else {
exports.__esModule = true;
}
}
return function (id, v) { return exports[id] = previous ? previous(id, v) : v; };
}
})
(function (exporter) {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
__extends = function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
__assign = Object.assign || function (t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
__rest = function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
__decorate = function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
__param = function (paramIndex, decorator) {
return function (target, key) { decorator(target, key, paramIndex); }
};
__esDecorate = function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
var _, done = false;
for (var i = decorators.length - 1; i >= 0; i--) {
var context = {};
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
if (kind === "accessor") {
if (result === void 0) continue;
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
if (_ = accept(result.get)) descriptor.get = _;
if (_ = accept(result.set)) descriptor.set = _;
if (_ = accept(result.init)) initializers.unshift(_);
}
else if (_ = accept(result)) {
if (kind === "field") initializers.unshift(_);
else descriptor[key] = _;
}
}
if (target) Object.defineProperty(target, contextIn.name, descriptor);
done = true;
};
__runInitializers = function (thisArg, initializers, value) {
var useValue = arguments.length > 2;
for (var i = 0; i < initializers.length; i++) {
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
}
return useValue ? value : void 0;
};
__propKey = function (x) {
return typeof x === "symbol" ? x : "".concat(x);
};
__setFunctionName = function (f, name, prefix) {
if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : "";
return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name });
};
__metadata = function (metadataKey, metadataValue) {
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
};
__awaiter = function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
__generator = function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
__exportStar = function(m, o) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
};
__createBinding = Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
});
__values = function (o) {
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
if (m) return m.call(o);
if (o && typeof o.length === "number") return {
next: function () {
if (o && i >= o.length) o = void 0;
return { value: o && o[i++], done: !o };
}
};
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
__read = function (o, n) {
var m = typeof Symbol === "function" && o[Symbol.iterator];
if (!m) return o;
var i = m.call(o), r, ar = [], e;
try {
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
}
catch (error) { e = { error: error }; }
finally {
try {
if (r && !r.done && (m = i["return"])) m.call(i);
}
finally { if (e) throw e.error; }
}
return ar;
};
/** @deprecated */
__spread = function () {
for (var ar = [], i = 0; i < arguments.length; i++)
ar = ar.concat(__read(arguments[i]));
return ar;
};
/** @deprecated */
__spreadArrays = function () {
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
for (var r = Array(s), k = 0, i = 0; i < il; i++)
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
r[k] = a[j];
return r;
};
__spreadArray = function (to, from, pack) {
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
if (ar || !(i in from)) {
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
ar[i] = from[i];
}
}
return to.concat(ar || Array.prototype.slice.call(from));
};
__await = function (v) {
return this instanceof __await ? (this.v = v, this) : new __await(v);
};
__asyncGenerator = function (thisArg, _arguments, generator) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var g = generator.apply(thisArg, _arguments || []), i, q = [];
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;
function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }
function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
function fulfill(value) { resume("next", value); }
function reject(value) { resume("throw", value); }
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
};
__asyncDelegator = function (o) {
var i, p;
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }
};
__asyncValues = function (o) {
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
var m = o[Symbol.asyncIterator], i;
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
};
__makeTemplateObject = function (cooked, raw) {
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
return cooked;
};
var __setModuleDefault = Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
};
__importStar = function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
__importDefault = function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
__classPrivateFieldGet = function (receiver, state, kind, f) {
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
};
__classPrivateFieldSet = function (receiver, state, value, kind, f) {
if (kind === "m") throw new TypeError("Private method is not writable");
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
};
__classPrivateFieldIn = function (state, receiver) {
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
return typeof state === "function" ? receiver === state : state.has(receiver);
};
__addDisposableResource = function (env, value, async) {
if (value !== null && value !== void 0) {
if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected.");
var dispose, inner;
if (async) {
if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined.");
dispose = value[Symbol.asyncDispose];
}
if (dispose === void 0) {
if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined.");
dispose = value[Symbol.dispose];
if (async) inner = dispose;
}
if (typeof dispose !== "function") throw new TypeError("Object not disposable.");
if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };
env.stack.push({ value: value, dispose: dispose, async: async });
}
else if (async) {
env.stack.push({ async: true });
}
return value;
};
var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
var e = new Error(message);
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
};
__disposeResources = function (env) {
function fail(e) {
env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e;
env.hasError = true;
}
var r, s = 0;
function next() {
while (r = env.stack.pop()) {
try {
if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);
if (r.dispose) {
var result = r.dispose.call(r.value);
if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });
}
else s |= 1;
}
catch (e) {
fail(e);
}
}
if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();
if (env.hasError) throw env.error;
}
return next();
};
exporter("__extends", __extends);
exporter("__assign", __assign);
exporter("__rest", __rest);
exporter("__decorate", __decorate);
exporter("__param", __param);
exporter("__esDecorate", __esDecorate);
exporter("__runInitializers", __runInitializers);
exporter("__propKey", __propKey);
exporter("__setFunctionName", __setFunctionName);
exporter("__metadata", __metadata);
exporter("__awaiter", __awaiter);
exporter("__generator", __generator);
exporter("__exportStar", __exportStar);
exporter("__createBinding", __createBinding);
exporter("__values", __values);
exporter("__read", __read);
exporter("__spread", __spread);
exporter("__spreadArrays", __spreadArrays);
exporter("__spreadArray", __spreadArray);
exporter("__await", __await);
exporter("__asyncGenerator", __asyncGenerator);
exporter("__asyncDelegator", __asyncDelegator);
exporter("__asyncValues", __asyncValues);
exporter("__makeTemplateObject", __makeTemplateObject);
exporter("__importStar", __importStar);
exporter("__importDefault", __importDefault);
exporter("__classPrivateFieldGet", __classPrivateFieldGet);
exporter("__classPrivateFieldSet", __classPrivateFieldSet);
exporter("__classPrivateFieldIn", __classPrivateFieldIn);
exporter("__addDisposableResource", __addDisposableResource);
exporter("__disposeResources", __disposeResources);
});

42
node_modules/@dnd-kit/sortable/package.json generated vendored Normal file
View File

@@ -0,0 +1,42 @@
{
"name": "@dnd-kit/sortable",
"version": "7.0.2",
"description": "Official sortable preset and sensors for dnd kit",
"author": "Claudéric Demers",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/clauderic/dnd-kit.git",
"directory": "packages/sortable"
},
"scripts": {
"start": "tsdx watch --tsconfig tsconfig.build.json --verbose --noClean",
"build": "tsdx build --tsconfig tsconfig.build.json",
"test": "tsdx test",
"lint": "tsdx lint",
"prepublish": "npm run build"
},
"main": "dist/index.js",
"module": "dist/sortable.esm.js",
"typings": "dist/index.d.ts",
"files": [
"README.md",
"CHANGELOG.md",
"LICENSE",
"dist"
],
"dependencies": {
"@dnd-kit/utilities": "^3.2.0",
"tslib": "^2.0.0"
},
"peerDependencies": {
"react": ">=16.8.0",
"@dnd-kit/core": "^6.0.7"
},
"devDependencies": {
"@dnd-kit/core": "^6.0.7"
},
"publishConfig": {
"access": "public"
}
}