@pega/cosmos-react-dnd 10.0.0-build.4.2 → 10.0.0-build.4.4
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,8 +1,19 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
2
|
export interface DragDropManagerProps {
|
|
3
3
|
children: ReactNode;
|
|
4
|
+
/**
|
|
5
|
+
* Scopes the HTML5 drag-and-drop backend's event listeners to this element instead of `window`.
|
|
6
|
+
* Useful for shadow DOM scenarios where events would not otherwise bubble to `window`.
|
|
7
|
+
*
|
|
8
|
+
* **Warning:** Due to the global singleton architecture of `dnd-multi-backend` (only one active
|
|
9
|
+
* backend is allowed at a time), this value is only applied when the very first `DragDropManager`
|
|
10
|
+
* mounts for the lifetime of the page. If multiple `DragDropManager` instances are rendered —
|
|
11
|
+
* including across page navigation — all subsequent `rootElement` values are silently ignored
|
|
12
|
+
* and the first one wins. Omit this prop unless you specifically need shadow DOM support and can
|
|
13
|
+
* guarantee a single, stable mount.
|
|
14
|
+
*/
|
|
4
15
|
rootElement?: Node;
|
|
5
16
|
}
|
|
6
|
-
declare const DragDropManager:
|
|
17
|
+
declare const DragDropManager: ({ children, rootElement }: DragDropManagerProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
18
|
export default DragDropManager;
|
|
8
19
|
//# sourceMappingURL=DragDropManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DragDropManager.d.ts","sourceRoot":"","sources":["../../../src/components/DragDropManager/DragDropManager.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"DragDropManager.d.ts","sourceRoot":"","sources":["../../../src/components/DragDropManager/DragDropManager.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;;;;;;;OAUG;IACH,WAAW,CAAC,EAAE,IAAI,CAAC;CACpB;AAED,QAAA,MAAM,eAAe,GAAI,2BAA2B,oBAAoB,4CAevE,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DragDropManager.js","sourceRoot":"","sources":["../../../src/components/DragDropManager/DragDropManager.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"DragDropManager.js","sourceRoot":"","sources":["../../../src/components/DragDropManager/DragDropManager.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAkBrD,MAAM,eAAe,GAAG,CAAC,EAAE,QAAQ,EAAE,WAAW,EAAwB,EAAE,EAAE;IAC1E,MAAM,OAAO,GAAG,OAAO,CACrB,GAAG,EAAE,CAAC,CAAC;QACL,QAAQ,EAAE,CAAC,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CACjD,OAAO,CAAC,EAAE,KAAK,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAC5E;KACF,CAAC,EACF,CAAC,WAAW,CAAC,CACd,CAAC;IAEF,OAAO,CACL,KAAC,WAAW,IAAC,OAAO,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,YAClE,QAAQ,GACG,CACf,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC","sourcesContent":["import { useMemo } from 'react';\nimport type { ReactNode } from 'react';\nimport { DndProvider } from 'react-dnd';\nimport { MultiBackend } from 'react-dnd-multi-backend';\nimport { HTML5toTouch } from 'rdndmb-html5-to-touch';\n\nexport interface DragDropManagerProps {\n children: ReactNode;\n /**\n * Scopes the HTML5 drag-and-drop backend's event listeners to this element instead of `window`.\n * Useful for shadow DOM scenarios where events would not otherwise bubble to `window`.\n *\n * **Warning:** Due to the global singleton architecture of `dnd-multi-backend` (only one active\n * backend is allowed at a time), this value is only applied when the very first `DragDropManager`\n * mounts for the lifetime of the page. If multiple `DragDropManager` instances are rendered —\n * including across page navigation — all subsequent `rootElement` values are silently ignored\n * and the first one wins. Omit this prop unless you specifically need shadow DOM support and can\n * guarantee a single, stable mount.\n */\n rootElement?: Node;\n}\n\nconst DragDropManager = ({ children, rootElement }: DragDropManagerProps) => {\n const options = useMemo(\n () => ({\n backends: [...HTML5toTouch.backends].map(backend =>\n backend.id === 'html5' ? { ...backend, options: { rootElement } } : backend\n )\n }),\n [rootElement]\n );\n\n return (\n <DndProvider backend={MultiBackend} options={options} context={window}>\n {children}\n </DndProvider>\n );\n};\n\nexport default DragDropManager;\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pega/cosmos-react-dnd",
|
|
3
|
-
"version": "10.0.0-build.4.
|
|
3
|
+
"version": "10.0.0-build.4.4",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"author": "Pegasystems",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"build": "tsc -b tsconfig.build.json"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@pega/cosmos-react-core": "10.0.0-build.4.
|
|
17
|
+
"@pega/cosmos-react-core": "10.0.0-build.4.4",
|
|
18
18
|
"@types/react": "^17.0.62 || ^18.3.3",
|
|
19
19
|
"@types/react-dom": "^17.0.20 || ^18.3.0",
|
|
20
20
|
"dnd-core": "14.0.1",
|