@pie-lib/drag 4.0.3-next.37 → 4.0.3-next.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import e from "./placeholder.js";
1
+ import { PlaceHolder as e } from "./placeholder.js";
2
2
  import "react";
3
3
  import { styled as t } from "@mui/material/styles";
4
4
  import n from "prop-types";
@@ -41,4 +41,4 @@ o.propTypes = {
41
41
  instanceId: n.string
42
42
  };
43
43
  //#endregion
44
- export { o as default };
44
+ export { o as DragInTheBlankDroppable, o as default };
@@ -8,22 +8,34 @@
8
8
  */
9
9
  import React from 'react';
10
10
  import PropTypes from 'prop-types';
11
- export declare function DragProvider({ children, onDragEnd, onDragStart, collisionDetection, modifiers, autoScroll }: {
11
+ export declare function DragProvider({ children, onDragEnd, onDragStart, onDragCancel, collisionDetection, modifiers, autoScroll, keyboardCoordinateGetter, keyboardCodes, accessibility, }: {
12
12
  children: any;
13
13
  onDragEnd: any;
14
14
  onDragStart: any;
15
+ onDragCancel: any;
15
16
  collisionDetection: any;
16
17
  modifiers: any;
17
18
  autoScroll: any;
19
+ keyboardCoordinateGetter: any;
20
+ keyboardCodes: any;
21
+ accessibility: any;
18
22
  }): React.JSX.Element;
19
23
  export declare namespace DragProvider {
20
24
  var propTypes: {
21
25
  children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
22
26
  onDragEnd: PropTypes.Requireable<(...args: any[]) => any>;
23
27
  onDragStart: PropTypes.Requireable<(...args: any[]) => any>;
28
+ onDragCancel: PropTypes.Requireable<(...args: any[]) => any>;
24
29
  collisionDetection: PropTypes.Requireable<(...args: any[]) => any>;
25
30
  modifiers: PropTypes.Requireable<(((...args: any[]) => any) | null | undefined)[]>;
26
31
  autoScroll: PropTypes.Requireable<object>;
32
+ keyboardCoordinateGetter: PropTypes.Requireable<(...args: any[]) => any>;
33
+ keyboardCodes: PropTypes.Requireable<PropTypes.InferProps<{
34
+ start: PropTypes.Requireable<(string | null | undefined)[]>;
35
+ cancel: PropTypes.Requireable<(string | null | undefined)[]>;
36
+ end: PropTypes.Requireable<(string | null | undefined)[]>;
37
+ }>>;
38
+ accessibility: PropTypes.Requireable<object>;
27
39
  };
28
40
  }
29
41
  export default DragProvider;
@@ -3,19 +3,26 @@ import t from "prop-types";
3
3
  import { jsx as n } from "react/jsx-runtime";
4
4
  import { DndContext as r, KeyboardSensor as i, PointerSensor as a, useSensor as o, useSensors as s } from "@dnd-kit/core";
5
5
  //#region src/drag-provider.tsx
6
- function c({ children: t, onDragEnd: c, onDragStart: l, collisionDetection: u, modifiers: d, autoScroll: f }) {
7
- let [p, m] = e(null);
6
+ function c({ children: t, onDragEnd: c, onDragStart: l, onDragCancel: u, collisionDetection: d, modifiers: f, autoScroll: p, keyboardCoordinateGetter: m, keyboardCodes: h, accessibility: g }) {
7
+ let [_, v] = e(null), y = m || h ? {
8
+ coordinateGetter: m,
9
+ keyboardCodes: h
10
+ } : void 0;
8
11
  return /* @__PURE__ */ n(r, {
9
- sensors: s(o(a, { activationConstraint: { distance: 8 } }), o(i)),
12
+ sensors: s(o(a, { activationConstraint: { distance: 8 } }), o(i, y)),
10
13
  onDragStart: (e) => {
11
- m(e.active.id), l && l(e);
14
+ v(e.active.id), l && l(e);
12
15
  },
13
16
  onDragEnd: (e) => {
14
- m(null), c && c(e);
17
+ v(null), c && c(e);
15
18
  },
16
- collisionDetection: u,
17
- modifiers: d,
18
- autoScroll: f,
19
+ onDragCancel: (e) => {
20
+ v(null), u && u(e);
21
+ },
22
+ collisionDetection: d,
23
+ modifiers: f,
24
+ autoScroll: p,
25
+ accessibility: g,
19
26
  children: t
20
27
  });
21
28
  }
@@ -23,9 +30,17 @@ c.propTypes = {
23
30
  children: t.node.isRequired,
24
31
  onDragEnd: t.func,
25
32
  onDragStart: t.func,
33
+ onDragCancel: t.func,
26
34
  collisionDetection: t.func,
27
35
  modifiers: t.arrayOf(t.func),
28
- autoScroll: t.object
36
+ autoScroll: t.object,
37
+ keyboardCoordinateGetter: t.func,
38
+ keyboardCodes: t.shape({
39
+ start: t.arrayOf(t.string),
40
+ cancel: t.arrayOf(t.string),
41
+ end: t.arrayOf(t.string)
42
+ }),
43
+ accessibility: t.object
29
44
  };
30
45
  //#endregion
31
- export { c as default };
46
+ export { c as DragProvider, c as default };
@@ -60,4 +60,4 @@ o.propTypes = {
60
60
  id: t.string
61
61
  };
62
62
  //#endregion
63
- export { o as default };
63
+ export { o as DraggableChoice, o as default };
@@ -1,4 +1,4 @@
1
- import e from "./placeholder.js";
1
+ import { PlaceHolder as e } from "./placeholder.js";
2
2
  import "react";
3
3
  import t from "prop-types";
4
4
  import { jsx as n } from "react/jsx-runtime";
@@ -33,4 +33,4 @@ a.propTypes = {
33
33
  minHeight: t.number
34
34
  };
35
35
  //#endregion
36
- export { a as default };
36
+ export { a as DroppablePlaceholder, a as default };
package/dist/ica-dp.js CHANGED
@@ -1,4 +1,4 @@
1
- import e from "./droppable-placeholder.js";
1
+ import { DroppablePlaceholder as e } from "./droppable-placeholder.js";
2
2
  import "react";
3
3
  import t from "prop-types";
4
4
  import { jsx as n } from "react/jsx-runtime";
@@ -17,4 +17,4 @@ r.propTypes = {
17
17
  disabled: t.bool
18
18
  };
19
19
  //#endregion
20
- export { r as default };
20
+ export { r as ICADroppable, r as default };
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
- import e from "./placeholder.js";
2
- import t from "./draggable-choice.js";
3
- import n from "./drag-provider.js";
1
+ import { PlaceHolder as e } from "./placeholder.js";
2
+ import { DraggableChoice as t } from "./draggable-choice.js";
3
+ import { DragProvider as n } from "./drag-provider.js";
4
4
  import r from "./swap.js";
5
5
  import { uid_context_exports as i } from "./uid-context.js";
6
- import a from "./match-list-dp.js";
7
- import o from "./drag-in-the-blank-dp.js";
8
- import s from "./ica-dp.js";
6
+ import { MatchListDroppable as a } from "./match-list-dp.js";
7
+ import { DragInTheBlankDroppable as o } from "./drag-in-the-blank-dp.js";
8
+ import { ICADroppable as s } from "./ica-dp.js";
9
9
  export { o as DragDroppablePlaceholder, n as DragProvider, t as DraggableChoice, s as ICADroppablePlaceholder, a as MatchDroppablePlaceholder, e as PlaceHolder, r as swap, i as uid };
@@ -1,4 +1,4 @@
1
- import e from "./droppable-placeholder.js";
1
+ import { DroppablePlaceholder as e } from "./droppable-placeholder.js";
2
2
  import "react";
3
3
  import t from "prop-types";
4
4
  import { jsx as n } from "react/jsx-runtime";
@@ -18,4 +18,4 @@ r.propTypes = {
18
18
  onRemoveAnswer: t.func
19
19
  };
20
20
  //#endregion
21
- export { r as default };
21
+ export { r as MatchListDroppable, r as default };
@@ -13,4 +13,4 @@ function t() {
13
13
  return i;
14
14
  }
15
15
  //#endregion
16
- export { t as default };
16
+ export { t as clsx, t as default };
@@ -1,4 +1,4 @@
1
- import e from "./node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
1
+ import { clsx as e } from "./node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js";
2
2
  import "react";
3
3
  import { styled as t } from "@mui/material/styles";
4
4
  import n from "prop-types";
@@ -25,7 +25,7 @@ var o = t("div")(({ theme: e }) => ({
25
25
  padding: e.spacing(1),
26
26
  border: `2px dashed ${r.black()}`
27
27
  },
28
- "&.disabled": {
28
+ "&.placeholderDisabled": {
29
29
  boxShadow: "none",
30
30
  background: e.palette.background.paper
31
31
  },
@@ -60,7 +60,7 @@ var o = t("div")(({ theme: e }) => ({
60
60
  flexFlow: "column wrap"
61
61
  }
62
62
  })), s = (t) => {
63
- let { children: n, className: i, isOver: s, type: c, grid: l, disabled: u, choiceBoard: d, isCategorize: f, isVerticalPool: p, minHeight: m, extraStyles: h } = t, g = e("placeholder", u && "disabled", s && "over", c, i), _ = {};
63
+ let { children: n, className: i, isOver: s, type: c, grid: l, disabled: u, choiceBoard: d, isCategorize: f, isVerticalPool: p, minHeight: m, extraStyles: h } = t, g = e("placeholder", u && "placeholderDisabled", s && "over", c, i), _ = {};
64
64
  if (l && l.columns && (_.gridTemplateColumns = `repeat(${l.columns}, 1fr)`), l && l.rows) {
65
65
  let e = l.rowsRepeatValue || "1fr";
66
66
  _.gridTemplateRows = `repeat(${l.rows}, ${e})`;
@@ -95,4 +95,4 @@ s.propTypes = {
95
95
  minHeight: n.number
96
96
  };
97
97
  //#endregion
98
- export { s as default };
98
+ export { s as PlaceHolder, s as default };
@@ -12,4 +12,4 @@ var r = /* @__PURE__ */ e({
12
12
  uid: r
13
13
  }) });
14
14
  //#endregion
15
- export { r as uid_context_exports };
15
+ export { i as Consumer, a as Provider, o as generateId, r as uid_context_exports, s as withUid };
package/package.json CHANGED
@@ -1,20 +1,25 @@
1
1
  {
2
2
  "name": "@pie-lib/drag",
3
- "version": "4.0.3-next.37",
3
+ "version": "4.0.3-next.39",
4
4
  "description": "",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/pie-framework/pie-elements-ng.git",
8
+ "directory": "packages/lib-react/drag"
9
+ },
5
10
  "dependencies": {
6
11
  "@dnd-kit/core": "6.3.1",
7
12
  "@dnd-kit/sortable": "10.0.0",
8
13
  "@dnd-kit/utilities": "3.2.2",
9
14
  "@emotion/react": "^11.14.0",
10
- "@emotion/style": "^0.8.0",
15
+ "@emotion/styled": "^11.14.1",
11
16
  "@mui/icons-material": "^7.3.4",
12
17
  "@mui/material": "^7.3.4",
13
- "@pie-lib/render-ui": "6.1.1-next.37",
18
+ "@pie-lib/render-ui": "6.1.1-next.39",
14
19
  "prop-types": "^15.7.2",
15
20
  "clsx": "^2.1.1",
16
21
  "@pie-element/shared-math-rendering-mathjax": "0.1.1-next.0",
17
- "@pie-element/shared-lodash": "0.1.1-next.0"
22
+ "@pie-element/shared-lodash": "0.1.1-next.1"
18
23
  },
19
24
  "type": "module",
20
25
  "main": "./dist/index.js",