@ztwoint/z-ui 0.1.61 → 0.1.62
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.
- package/dist/_virtual/bind-all.js +4 -0
- package/dist/_virtual/bind.js +4 -0
- package/dist/_virtual/index.js +5 -0
- package/dist/_virtual/index2.js +4 -0
- package/dist/components/assets/icons/drag-handle.js +18 -0
- package/dist/components/assets/icons/minus.js +28 -0
- package/dist/components/column-reorder/column-reorder.hook.js +47 -0
- package/dist/components/column-reorder/column-reorder.js +26 -0
- package/dist/components/column-reorder/components/column-item/column-item.hook.js +78 -0
- package/dist/components/column-reorder/components/column-item/column-item.js +79 -0
- package/dist/components/column-reorder/components/column-item/column-item.util.js +12 -0
- package/dist/components/table/components/cell/avatar-cell.js +9 -6
- package/dist/components/table/table-provider.js +3 -0
- package/dist/components/table-card/table-card.js +32 -29
- package/dist/index.d.ts +1 -0
- package/dist/index.js +37 -35
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/adapter/element-adapter-native-data-key.js +4 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/adapter/element-adapter.js +127 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/get-element-from-point-without-honey-pot.js +9 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/honey-pot-data-attribute.js +4 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/is-honey-pot-element.js +7 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/honey-pot-fix/make-honey-pot-fix.js +226 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/dispatch-consumer-event.js +107 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/lifecycle-manager.js +195 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/ledger/usage-ledger.js +21 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-adapter.js +43 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-drop-target.js +253 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/make-adapter/make-monitor.js +121 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/combine.js +12 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/element/custom-native-drag-preview/center-under-pointer.js +10 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/element/custom-native-drag-preview/pointer-outside-of-preview.js +31 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/element/custom-native-drag-preview/set-custom-native-drag-preview.js +66 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/once.js +17 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/public-utils/reorder.js +11 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/add-attribute.js +9 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/android.js +8 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/count-events-for-safari.js +57 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/is-from-another-window.js +9 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/changing-window/is-leaving-window.js +13 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/detect-broken-drag.js +47 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/get-input.js +17 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/is-firefox.js +7 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/is-safari-on-ios.js +8 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/is-safari.js +10 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/max-z-index.js +4 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/media-types/text-media-type.js +4 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/util/media-types/url-media-type.js +4 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop-flourish/dist/esm/trigger-post-move-flash.js +20 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop-flourish/node_modules/@atlaskit/motion/dist/esm/utils/durations.js +6 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop-hitbox/dist/esm/closest-edge.js +58 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop-hitbox/dist/esm/get-reorder-destination-index.js +12 -0
- package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop-hitbox/dist/esm/reorder-with-edge.js +18 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js +8 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js +6 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js +7 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/defineProperty.js +12 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/iterableToArray.js +6 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js +24 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/nonIterableRest.js +7 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js +7 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/slicedToArray.js +10 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/toConsumableArray.js +10 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/toPrimitive.js +14 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/toPropertyKey.js +9 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/typeof.js +11 -0
- package/dist/node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js +11 -0
- package/dist/node_modules/bind-event-listener/dist/bind-all.js +45 -0
- package/dist/node_modules/bind-event-listener/dist/bind.js +16 -0
- package/dist/node_modules/bind-event-listener/dist/index.js +20 -0
- package/dist/node_modules/raf-schd/dist/raf-schd.esm.js +15 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
import { Alert as p, AlertDescription as n, AlertTitle as l } from "./components/alert/alert.js";
|
|
3
3
|
import { AlertCirclesIcon as f } from "./components/alert/icons/circles-icon.js";
|
|
4
4
|
import { Button as i, buttonVariants as Z } from "./components/button/button.js";
|
|
5
|
-
import { Z2SideNavBarProvider as
|
|
5
|
+
import { Z2SideNavBarProvider as u } from "./components/collapsible-side-nav-bar/side-nav-bar-provider.js";
|
|
6
6
|
import { Z2SideNavBar as D, Z2SidebarVariants as b } from "./components/collapsible-side-nav-bar/side-nav-bar.js";
|
|
7
|
-
import { Z2SideNavBarHeader as
|
|
7
|
+
import { Z2SideNavBarHeader as T } from "./components/collapsible-side-nav-bar/side-nav-bar-header.js";
|
|
8
8
|
import { Z2SideNavBarContent as c } from "./components/collapsible-side-nav-bar/side-nav-bar-content.js";
|
|
9
9
|
import { Z2SideNavBarFooter as s } from "./components/collapsible-side-nav-bar/side-nav-bar-footer.js";
|
|
10
10
|
import { Z2SideNavBarGroup as v } from "./components/collapsible-side-nav-bar/side-nav-bar-group.js";
|
|
@@ -14,7 +14,7 @@ import { useZ2SideNavBar as N } from "./components/collapsible-side-nav-bar/cont
|
|
|
14
14
|
import { Z2Popover as F } from "./components/collapsible-side-nav-bar/popover/popover.js";
|
|
15
15
|
import { ChevronUpIcon as _ } from "./components/assets/icons/chevron-up-icon.js";
|
|
16
16
|
import { default as y } from "./components/assets/icons/sub-nav-indicator.js";
|
|
17
|
-
import { default as
|
|
17
|
+
import { default as G } from "./components/assets/icons/circles-icon.js";
|
|
18
18
|
import { default as V } from "./components/assets/icons/database-copy.js";
|
|
19
19
|
import { default as k } from "./components/assets/icons/window-left-copy.js";
|
|
20
20
|
import { default as J } from "./components/assets/icons/sidebar-left-show-copy.js";
|
|
@@ -22,9 +22,9 @@ import { SIDEBAR_WIDTH as Y, SIDEBAR_WIDTH_COLLAPSED as j } from "./components/c
|
|
|
22
22
|
import { CountryFlags as z } from "./components/country-flags/country-flags.js";
|
|
23
23
|
import { Z2Checkbox as X } from "./components/checkbox/checkbox.js";
|
|
24
24
|
import { Z2Dialog as oo, Z2DialogClose as ro, Z2DialogContent as eo, Z2DialogDescription as to, Z2DialogFooter as ao, Z2DialogHeader as po, Z2DialogOverlay as no, Z2DialogPortal as lo, Z2DialogTitle as mo, Z2DialogTrigger as fo } from "./components/dialog/dialog.js";
|
|
25
|
-
import { DropdownContext as io, Z2Dropdown as Zo, Z2DropdownContent as
|
|
25
|
+
import { DropdownContext as io, Z2Dropdown as Zo, Z2DropdownContent as uo, Z2DropdownInput as So, Z2DropdownItem as Do, Z2DropdownSub as bo, Z2DropdownSubContent as Co, Z2DropdownSubItem as To, Z2DropdownSubTrigger as go } from "./components/dropdown/z2-dropdown.js";
|
|
26
26
|
import { Z2DropdownMenu as wo, Z2DropdownMenuCheckboxItem as so, Z2DropdownMenuContent as Io, Z2DropdownMenuGroup as vo, Z2DropdownMenuItem as Bo, Z2DropdownMenuLabel as Mo, Z2DropdownMenuPortal as Ao, Z2DropdownMenuRadioGroup as Lo, Z2DropdownMenuRadioItem as Po, Z2DropdownMenuSeparator as No, Z2DropdownMenuShortcut as Eo, Z2DropdownMenuSub as Fo, Z2DropdownMenuSubContent as Ho, Z2DropdownMenuSubTrigger as _o, Z2DropdownMenuTrigger as ho } from "./components/dropdown-menu/z2-dropdown-menu.js";
|
|
27
|
-
import { FileUploadArea as
|
|
27
|
+
import { FileUploadArea as Ro } from "./components/file-upload-area/file-upload-area.js";
|
|
28
28
|
import { DEFAULT_ACCEPT as Uo } from "./components/file-upload-area/file-upload-area.const.js";
|
|
29
29
|
import { Input as Wo } from "./components/input/input.js";
|
|
30
30
|
import { NavHeader as Oo } from "./components/nav-header/nav-header.js";
|
|
@@ -33,9 +33,9 @@ import { Z2Select as jo, Z2SelectContent as qo, Z2SelectGroup as zo, Z2SelectIte
|
|
|
33
33
|
import { Z2Stepper as pr } from "./components/stepper/stepper.js";
|
|
34
34
|
import { Z2StepperItem as lr } from "./components/stepper-item/stepper-item.js";
|
|
35
35
|
import { Z2Tabs as fr, Z2TabsContent as xr, Z2TabsList as ir, Z2TabsTrigger as Zr } from "./components/tab/tab.js";
|
|
36
|
-
import { Table as
|
|
36
|
+
import { Table as ur, TableProvider as Sr } from "./components/table/table-provider.js";
|
|
37
37
|
import { TableBody as br } from "./components/table/table.js";
|
|
38
|
-
import { extractCellValue as
|
|
38
|
+
import { extractCellValue as Tr } from "./components/table/table.utils.js";
|
|
39
39
|
import { DEFAULT_EMPTY_MESSAGE as cr, TABLE_CSS_CLASSES as wr } from "./components/table/table.const.js";
|
|
40
40
|
import { TableContext as Ir, useTableContext as vr } from "./components/table/table.context.js";
|
|
41
41
|
import { TableCell as Mr } from "./components/table/components/table-cell.js";
|
|
@@ -44,7 +44,7 @@ import { BooleanCell as Nr } from "./components/table/components/cell/boolean-ce
|
|
|
44
44
|
import { LinkCell as Fr } from "./components/table/components/cell/link-cell.js";
|
|
45
45
|
import { DescriptionCell as _r } from "./components/table/components/cell/description-cell.js";
|
|
46
46
|
import { AvatarCell as yr } from "./components/table/components/cell/avatar-cell.js";
|
|
47
|
-
import { LabelCell as
|
|
47
|
+
import { LabelCell as Gr } from "./components/table/components/cell/label-cell.js";
|
|
48
48
|
import { TableHeader as Vr } from "./components/table/components/table-header/table-header.js";
|
|
49
49
|
import "react/jsx-runtime";
|
|
50
50
|
import { TableRow as kr } from "./components/table/components/table-row.js";
|
|
@@ -61,37 +61,39 @@ import { PaginationQuickJumper as fe } from "./components/table/components/pagin
|
|
|
61
61
|
import "react";
|
|
62
62
|
import { Z2Tooltip as ie } from "./components/tooltip/tooltip.js";
|
|
63
63
|
import { default as de } from "./components/table-card/table-card.js";
|
|
64
|
-
import { Badge as
|
|
65
|
-
import { Avatar as
|
|
64
|
+
import { Badge as Se, badgeVariants as De } from "./components/badge/badge.js";
|
|
65
|
+
import { Avatar as Ce, AvatarWithLabel as Te } from "./components/avatar/avatar.js";
|
|
66
66
|
import { Z2TextPreset as ce } from "./components/text-preset/text-preset.js";
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
import {
|
|
67
|
+
import { ColumnReOrder as se } from "./components/column-reorder/column-reorder.js";
|
|
68
|
+
import { InfoIcon as ve } from "./components/assets/icons/info-icon.js";
|
|
69
|
+
import { useTheme as Me } from "./lib/theme.hook.js";
|
|
70
|
+
import { cn as Le } from "./lib/utils.js";
|
|
71
|
+
import { Z2PopoverTrigger as Ne } from "./components/collapsible-side-nav-bar/popover/popover-trigger.js";
|
|
72
|
+
import { Z2PopoverContent as Fe } from "./components/collapsible-side-nav-bar/popover/popover-content.js";
|
|
72
73
|
export {
|
|
73
74
|
p as Alert,
|
|
74
75
|
f as AlertCirclesIcon,
|
|
75
76
|
n as AlertDescription,
|
|
76
77
|
l as AlertTitle,
|
|
77
|
-
|
|
78
|
+
Ce as Avatar,
|
|
78
79
|
yr as AvatarCell,
|
|
79
|
-
|
|
80
|
-
|
|
80
|
+
Te as AvatarWithLabel,
|
|
81
|
+
Se as Badge,
|
|
81
82
|
Nr as BooleanCell,
|
|
82
83
|
i as Button,
|
|
83
84
|
_ as ChevronUpIcon,
|
|
84
|
-
|
|
85
|
+
G as CirclesIcon,
|
|
86
|
+
se as ColumnReOrder,
|
|
85
87
|
z as CountryFlags,
|
|
86
88
|
Uo as DEFAULT_ACCEPT,
|
|
87
89
|
cr as DEFAULT_EMPTY_MESSAGE,
|
|
88
90
|
V as DatabaseCopy,
|
|
89
91
|
_r as DescriptionCell,
|
|
90
92
|
io as DropdownContext,
|
|
91
|
-
|
|
92
|
-
|
|
93
|
+
Ro as FileUploadArea,
|
|
94
|
+
ve as InfoIcon,
|
|
93
95
|
Wo as Input,
|
|
94
|
-
|
|
96
|
+
Gr as LabelCell,
|
|
95
97
|
Fr as LinkCell,
|
|
96
98
|
pe as MagnifierIcon,
|
|
97
99
|
Oo as NavHeader,
|
|
@@ -104,7 +106,7 @@ export {
|
|
|
104
106
|
J as SidebarLeftShowCopy,
|
|
105
107
|
y as SubNavIndicator,
|
|
106
108
|
wr as TABLE_CSS_CLASSES,
|
|
107
|
-
|
|
109
|
+
ur as Table,
|
|
108
110
|
br as TableBody,
|
|
109
111
|
de as TableCard,
|
|
110
112
|
Mr as TableCell,
|
|
@@ -117,7 +119,7 @@ export {
|
|
|
117
119
|
Kr as TableHeaderWrapper,
|
|
118
120
|
Yr as TableLoadingState,
|
|
119
121
|
qr as TablePagination,
|
|
120
|
-
|
|
122
|
+
Sr as TableProvider,
|
|
121
123
|
kr as TableRow,
|
|
122
124
|
k as WindowLeftCopy,
|
|
123
125
|
X as Z2Checkbox,
|
|
@@ -132,8 +134,8 @@ export {
|
|
|
132
134
|
mo as Z2DialogTitle,
|
|
133
135
|
fo as Z2DialogTrigger,
|
|
134
136
|
Zo as Z2Dropdown,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
+
uo as Z2DropdownContent,
|
|
138
|
+
So as Z2DropdownInput,
|
|
137
139
|
Do as Z2DropdownItem,
|
|
138
140
|
wo as Z2DropdownMenu,
|
|
139
141
|
so as Z2DropdownMenuCheckboxItem,
|
|
@@ -151,12 +153,12 @@ export {
|
|
|
151
153
|
_o as Z2DropdownMenuSubTrigger,
|
|
152
154
|
ho as Z2DropdownMenuTrigger,
|
|
153
155
|
bo as Z2DropdownSub,
|
|
154
|
-
|
|
155
|
-
|
|
156
|
+
Co as Z2DropdownSubContent,
|
|
157
|
+
To as Z2DropdownSubItem,
|
|
156
158
|
go as Z2DropdownSubTrigger,
|
|
157
159
|
F as Z2Popover,
|
|
158
|
-
|
|
159
|
-
|
|
160
|
+
Fe as Z2PopoverContent,
|
|
161
|
+
Ne as Z2PopoverTrigger,
|
|
160
162
|
jo as Z2Select,
|
|
161
163
|
qo as Z2SelectContent,
|
|
162
164
|
zo as Z2SelectGroup,
|
|
@@ -171,9 +173,9 @@ export {
|
|
|
171
173
|
c as Z2SideNavBarContent,
|
|
172
174
|
s as Z2SideNavBarFooter,
|
|
173
175
|
v as Z2SideNavBarGroup,
|
|
174
|
-
|
|
176
|
+
T as Z2SideNavBarHeader,
|
|
175
177
|
M as Z2SideNavBarItem,
|
|
176
|
-
|
|
178
|
+
u as Z2SideNavBarProvider,
|
|
177
179
|
L as Z2SideNavBarSeparator,
|
|
178
180
|
b as Z2SidebarVariants,
|
|
179
181
|
pr as Z2Stepper,
|
|
@@ -186,9 +188,9 @@ export {
|
|
|
186
188
|
ie as Z2Tooltip,
|
|
187
189
|
De as badgeVariants,
|
|
188
190
|
Z as buttonVariants,
|
|
189
|
-
|
|
190
|
-
|
|
191
|
+
Le as cn,
|
|
192
|
+
Tr as extractCellValue,
|
|
191
193
|
vr as useTableContext,
|
|
192
|
-
|
|
194
|
+
Me as useTheme,
|
|
193
195
|
N as useZ2SideNavBar
|
|
194
196
|
};
|
package/dist/node_modules/@atlaskit/pragmatic-drag-and-drop/dist/esm/adapter/element-adapter.js
ADDED
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import P from "../../../../../@babel/runtime/helpers/esm/slicedToArray.js";
|
|
2
|
+
import { d as k } from "../../../../../../_virtual/index.js";
|
|
3
|
+
import { getElementFromPointWithoutHoneypot as _ } from "../honey-pot-fix/get-element-from-point-without-honey-pot.js";
|
|
4
|
+
import { makeHoneyPotFix as w } from "../honey-pot-fix/make-honey-pot-fix.js";
|
|
5
|
+
import { makeAdapter as A } from "../make-adapter/make-adapter.js";
|
|
6
|
+
import { combine as H } from "../public-utils/combine.js";
|
|
7
|
+
import { once as R } from "../public-utils/once.js";
|
|
8
|
+
import { addAttribute as $ } from "../util/add-attribute.js";
|
|
9
|
+
import { isAndroid as M, androidFallbackText as O } from "../util/android.js";
|
|
10
|
+
import { getInput as S } from "../util/get-input.js";
|
|
11
|
+
import { textMediaType as h } from "../util/media-types/text-media-type.js";
|
|
12
|
+
import { URLMediaType as V } from "../util/media-types/url-media-type.js";
|
|
13
|
+
import { elementAdapterNativeDataKey as K } from "./element-adapter-native-data-key.js";
|
|
14
|
+
var i = /* @__PURE__ */ new WeakMap();
|
|
15
|
+
function L(t) {
|
|
16
|
+
return i.set(t.element, t), function() {
|
|
17
|
+
i.delete(t.element);
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
var b = w(), v = A({
|
|
21
|
+
typeKey: "element",
|
|
22
|
+
defaultDropEffect: "move",
|
|
23
|
+
mount: function(r) {
|
|
24
|
+
return H(b.bindEvents(), k.bind(document, {
|
|
25
|
+
type: "dragstart",
|
|
26
|
+
listener: function(e) {
|
|
27
|
+
var l, o, d, u, m, s;
|
|
28
|
+
if (r.canStart(e) && !e.defaultPrevented) {
|
|
29
|
+
if (!e.dataTransfer) {
|
|
30
|
+
process.env.NODE_ENV !== "production" && console.warn(`
|
|
31
|
+
It appears as though you have are not testing DragEvents correctly.
|
|
32
|
+
|
|
33
|
+
- If you are unit testing, ensure you have polyfilled DragEvent.
|
|
34
|
+
- If you are browser testing, ensure you are dispatching drag events correctly.
|
|
35
|
+
|
|
36
|
+
Please see our testing guides for more information:
|
|
37
|
+
https://atlassian.design/components/pragmatic-drag-and-drop/core-package/testing
|
|
38
|
+
`.replace(/ {2}/g, ""));
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
var y = e.target;
|
|
42
|
+
if (!(y instanceof HTMLElement))
|
|
43
|
+
return null;
|
|
44
|
+
var a = i.get(y);
|
|
45
|
+
if (!a)
|
|
46
|
+
return null;
|
|
47
|
+
var g = S(e), p = {
|
|
48
|
+
element: a.element,
|
|
49
|
+
dragHandle: (l = a.dragHandle) !== null && l !== void 0 ? l : null,
|
|
50
|
+
input: g
|
|
51
|
+
};
|
|
52
|
+
if (a.canDrag && !a.canDrag(p))
|
|
53
|
+
return e.preventDefault(), null;
|
|
54
|
+
if (a.dragHandle) {
|
|
55
|
+
var I = _({
|
|
56
|
+
x: g.clientX,
|
|
57
|
+
y: g.clientY
|
|
58
|
+
});
|
|
59
|
+
if (!a.dragHandle.contains(I))
|
|
60
|
+
return e.preventDefault(), null;
|
|
61
|
+
}
|
|
62
|
+
var D = (o = (d = a.getInitialDataForExternal) === null || d === void 0 ? void 0 : d.call(a, p)) !== null && o !== void 0 ? o : null;
|
|
63
|
+
if (D)
|
|
64
|
+
for (var c = 0, E = Object.entries(D); c < E.length; c++) {
|
|
65
|
+
var T = P(E[c], 2), N = T[0], f = T[1];
|
|
66
|
+
e.dataTransfer.setData(N, f ?? "");
|
|
67
|
+
}
|
|
68
|
+
M() && !e.dataTransfer.types.includes(h) && !e.dataTransfer.types.includes(V) && e.dataTransfer.setData(h, O), e.dataTransfer.setData(K, "");
|
|
69
|
+
var x = {
|
|
70
|
+
element: a.element,
|
|
71
|
+
dragHandle: (u = a.dragHandle) !== null && u !== void 0 ? u : null,
|
|
72
|
+
data: (m = (s = a.getInitialData) === null || s === void 0 ? void 0 : s.call(a, p)) !== null && m !== void 0 ? m : {}
|
|
73
|
+
}, F = {
|
|
74
|
+
type: "element",
|
|
75
|
+
payload: x,
|
|
76
|
+
startedFrom: "internal"
|
|
77
|
+
};
|
|
78
|
+
r.start({
|
|
79
|
+
event: e,
|
|
80
|
+
dragType: F
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}));
|
|
85
|
+
},
|
|
86
|
+
dispatchEventToSource: function(r) {
|
|
87
|
+
var n, e, l = r.eventName, o = r.payload;
|
|
88
|
+
(n = i.get(o.source.element)) === null || n === void 0 || (e = n[l]) === null || e === void 0 || e.call(
|
|
89
|
+
n,
|
|
90
|
+
// I cannot seem to get the types right here.
|
|
91
|
+
// TS doesn't seem to like that one event can need `nativeSetDragImage`
|
|
92
|
+
// @ts-expect-error
|
|
93
|
+
o
|
|
94
|
+
);
|
|
95
|
+
},
|
|
96
|
+
onPostDispatch: b.getOnPostDispatch()
|
|
97
|
+
}), ee = v.dropTarget, te = v.monitor;
|
|
98
|
+
function ae(t) {
|
|
99
|
+
if (process.env.NODE_ENV !== "production" && t.dragHandle && !t.element.contains(t.dragHandle) && console.warn("Drag handle element must be contained in draggable element", {
|
|
100
|
+
element: t.element,
|
|
101
|
+
dragHandle: t.dragHandle
|
|
102
|
+
}), process.env.NODE_ENV !== "production") {
|
|
103
|
+
var r = i.get(t.element);
|
|
104
|
+
r && console.warn("You have already registered a `draggable` on the same element", {
|
|
105
|
+
existing: r,
|
|
106
|
+
proposed: t
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
var n = H(
|
|
110
|
+
// making the draggable register the adapter rather than drop targets
|
|
111
|
+
// this is because you *must* have a draggable element to start a drag
|
|
112
|
+
// but you _might_ not have any drop targets immediately
|
|
113
|
+
// (You might create drop targets async)
|
|
114
|
+
v.registerUsage(),
|
|
115
|
+
L(t),
|
|
116
|
+
$(t.element, {
|
|
117
|
+
attribute: "draggable",
|
|
118
|
+
value: "true"
|
|
119
|
+
})
|
|
120
|
+
);
|
|
121
|
+
return R(n);
|
|
122
|
+
}
|
|
123
|
+
export {
|
|
124
|
+
ae as draggable,
|
|
125
|
+
ee as dropTargetForElements,
|
|
126
|
+
te as monitorForElements
|
|
127
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import m from "../../../../../@babel/runtime/helpers/esm/slicedToArray.js";
|
|
2
|
+
import { isHoneyPotElement as l } from "./is-honey-pot-element.js";
|
|
3
|
+
function d(t) {
|
|
4
|
+
var r = document.elementsFromPoint(t.x, t.y), n = m(r, 2), e = n[0], o = n[1];
|
|
5
|
+
return e ? l(e) ? o ?? null : e : null;
|
|
6
|
+
}
|
|
7
|
+
export {
|
|
8
|
+
d as getElementFromPointWithoutHoneypot
|
|
9
|
+
};
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import b from "../../../../../@babel/runtime/helpers/esm/defineProperty.js";
|
|
2
|
+
import { d as y } from "../../../../../../_virtual/index.js";
|
|
3
|
+
import { maxZIndex as h } from "../util/max-z-index.js";
|
|
4
|
+
import { honeyPotDataAttribute as w } from "./honey-pot-data-attribute.js";
|
|
5
|
+
function d(t, n) {
|
|
6
|
+
var e = Object.keys(t);
|
|
7
|
+
if (Object.getOwnPropertySymbols) {
|
|
8
|
+
var r = Object.getOwnPropertySymbols(t);
|
|
9
|
+
n && (r = r.filter(function(o) {
|
|
10
|
+
return Object.getOwnPropertyDescriptor(t, o).enumerable;
|
|
11
|
+
})), e.push.apply(e, r);
|
|
12
|
+
}
|
|
13
|
+
return e;
|
|
14
|
+
}
|
|
15
|
+
function v(t) {
|
|
16
|
+
for (var n = 1; n < arguments.length; n++) {
|
|
17
|
+
var e = arguments[n] != null ? arguments[n] : {};
|
|
18
|
+
n % 2 ? d(Object(e), !0).forEach(function(r) {
|
|
19
|
+
b(t, r, e[r]);
|
|
20
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(e)) : d(Object(e)).forEach(function(r) {
|
|
21
|
+
Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(e, r));
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
}
|
|
26
|
+
var l = 2, m = l / 2;
|
|
27
|
+
function O(t) {
|
|
28
|
+
return {
|
|
29
|
+
x: Math.floor(t.x),
|
|
30
|
+
y: Math.floor(t.y)
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function P(t) {
|
|
34
|
+
return {
|
|
35
|
+
x: t.x - m,
|
|
36
|
+
y: t.y - m
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function j(t) {
|
|
40
|
+
return {
|
|
41
|
+
x: Math.max(t.x, 0),
|
|
42
|
+
y: Math.max(t.y, 0)
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function R(t) {
|
|
46
|
+
return {
|
|
47
|
+
x: Math.min(t.x, window.innerWidth - l),
|
|
48
|
+
y: Math.min(t.y, window.innerHeight - l)
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function x(t) {
|
|
52
|
+
var n = t.client, e = R(j(P(O(n))));
|
|
53
|
+
return DOMRect.fromRect({
|
|
54
|
+
x: e.x,
|
|
55
|
+
y: e.y,
|
|
56
|
+
width: l,
|
|
57
|
+
height: l
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
function g(t) {
|
|
61
|
+
var n = t.clientRect;
|
|
62
|
+
return {
|
|
63
|
+
left: "".concat(n.left, "px"),
|
|
64
|
+
top: "".concat(n.top, "px"),
|
|
65
|
+
width: "".concat(n.width, "px"),
|
|
66
|
+
height: "".concat(n.height, "px")
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
function D(t) {
|
|
70
|
+
var n = t.client, e = t.clientRect;
|
|
71
|
+
return (
|
|
72
|
+
// is within horizontal bounds
|
|
73
|
+
n.x >= e.x && n.x <= e.x + e.width && // is within vertical bounds
|
|
74
|
+
n.y >= e.y && n.y <= e.y + e.height
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
function S(t) {
|
|
78
|
+
var n = t.initial, e = document.createElement("div");
|
|
79
|
+
e.setAttribute(w, "true");
|
|
80
|
+
var r = x({
|
|
81
|
+
client: n
|
|
82
|
+
});
|
|
83
|
+
Object.assign(e.style, v(v({
|
|
84
|
+
// Setting a background color explicitly to avoid any inherited styles.
|
|
85
|
+
// Looks like this could be `opacity: 0`, but worried that _might_
|
|
86
|
+
// cause the element to be ignored on some platforms.
|
|
87
|
+
// When debugging, set backgroundColor to something like "red".
|
|
88
|
+
backgroundColor: "transparent",
|
|
89
|
+
position: "fixed",
|
|
90
|
+
// Being explicit to avoid inheriting styles
|
|
91
|
+
padding: 0,
|
|
92
|
+
margin: 0,
|
|
93
|
+
boxSizing: "border-box"
|
|
94
|
+
}, g({
|
|
95
|
+
clientRect: r
|
|
96
|
+
})), {}, {
|
|
97
|
+
// We want this element to absorb pointer events,
|
|
98
|
+
// it's kind of the whole point 😉
|
|
99
|
+
pointerEvents: "auto",
|
|
100
|
+
// Want to make sure the honey pot is top of everything else.
|
|
101
|
+
// Don't need to worry about native drag previews, as they will
|
|
102
|
+
// have been rendered (and removed) before the honey pot is rendered
|
|
103
|
+
zIndex: h
|
|
104
|
+
})), document.body.appendChild(e);
|
|
105
|
+
var o = y.bind(window, {
|
|
106
|
+
type: "pointermove",
|
|
107
|
+
listener: function(c) {
|
|
108
|
+
var a = {
|
|
109
|
+
x: c.clientX,
|
|
110
|
+
y: c.clientY
|
|
111
|
+
};
|
|
112
|
+
r = x({
|
|
113
|
+
client: a
|
|
114
|
+
}), Object.assign(e.style, g({
|
|
115
|
+
clientRect: r
|
|
116
|
+
}));
|
|
117
|
+
},
|
|
118
|
+
// using capture so we are less likely to be impacted by event stopping
|
|
119
|
+
options: {
|
|
120
|
+
capture: !0
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
return function(c) {
|
|
124
|
+
var a = c.current;
|
|
125
|
+
if (o(), D({
|
|
126
|
+
client: a,
|
|
127
|
+
clientRect: r
|
|
128
|
+
})) {
|
|
129
|
+
e.remove();
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
function i() {
|
|
133
|
+
s(), e.remove();
|
|
134
|
+
}
|
|
135
|
+
var s = y.bindAll(window, [
|
|
136
|
+
{
|
|
137
|
+
type: "pointerdown",
|
|
138
|
+
listener: i
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
type: "pointermove",
|
|
142
|
+
listener: i
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
type: "focusin",
|
|
146
|
+
listener: i
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
type: "focusout",
|
|
150
|
+
listener: i
|
|
151
|
+
},
|
|
152
|
+
// a 'pointerdown' should happen before 'dragstart', but just being super safe
|
|
153
|
+
{
|
|
154
|
+
type: "dragstart",
|
|
155
|
+
listener: i
|
|
156
|
+
},
|
|
157
|
+
// if the user has dragged something out of the window
|
|
158
|
+
// and then is dragging something back into the window
|
|
159
|
+
// the first events we will see are "dragenter" (and then "dragover").
|
|
160
|
+
// So if we see any of these we need to clear the post drag fix.
|
|
161
|
+
{
|
|
162
|
+
type: "dragenter",
|
|
163
|
+
listener: i
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
type: "dragover",
|
|
167
|
+
listener: i
|
|
168
|
+
}
|
|
169
|
+
// Not adding a "wheel" event listener, as "wheel" by itself does not
|
|
170
|
+
// resolve the bug.
|
|
171
|
+
], {
|
|
172
|
+
// Using `capture` so less likely to be impacted by other code stopping events
|
|
173
|
+
capture: !0
|
|
174
|
+
});
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
function z() {
|
|
178
|
+
var t = null;
|
|
179
|
+
function n() {
|
|
180
|
+
return t = null, y.bind(window, {
|
|
181
|
+
type: "pointermove",
|
|
182
|
+
listener: function(o) {
|
|
183
|
+
t = {
|
|
184
|
+
x: o.clientX,
|
|
185
|
+
y: o.clientY
|
|
186
|
+
};
|
|
187
|
+
},
|
|
188
|
+
// listening for pointer move in capture phase
|
|
189
|
+
// so we are less likely to be impacted by events being stopped.
|
|
190
|
+
options: {
|
|
191
|
+
capture: !0
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
function e() {
|
|
196
|
+
var r = null;
|
|
197
|
+
return function(u) {
|
|
198
|
+
var c = u.eventName, a = u.payload;
|
|
199
|
+
if (c === "onDragStart") {
|
|
200
|
+
var i = a.location.initial.input, s = t ?? {
|
|
201
|
+
x: i.clientX,
|
|
202
|
+
y: i.clientY
|
|
203
|
+
};
|
|
204
|
+
r = S({
|
|
205
|
+
initial: s
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
if (c === "onDrop") {
|
|
209
|
+
var p, f = a.location.current.input;
|
|
210
|
+
(p = r) === null || p === void 0 || p({
|
|
211
|
+
current: {
|
|
212
|
+
x: f.clientX,
|
|
213
|
+
y: f.clientY
|
|
214
|
+
}
|
|
215
|
+
}), r = null, t = null;
|
|
216
|
+
}
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
return {
|
|
220
|
+
bindEvents: n,
|
|
221
|
+
getOnPostDispatch: e
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
export {
|
|
225
|
+
z as makeHoneyPotFix
|
|
226
|
+
};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import p from "../../../../../raf-schd/dist/raf-schd.esm.js";
|
|
2
|
+
var s = p(function(a) {
|
|
3
|
+
return a();
|
|
4
|
+
}), d = /* @__PURE__ */ function() {
|
|
5
|
+
var a = null;
|
|
6
|
+
function n(l) {
|
|
7
|
+
var o = requestAnimationFrame(function() {
|
|
8
|
+
a = null, l();
|
|
9
|
+
});
|
|
10
|
+
a = {
|
|
11
|
+
frameId: o,
|
|
12
|
+
fn: l
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function t() {
|
|
16
|
+
a && (cancelAnimationFrame(a.frameId), a.fn(), a = null);
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
schedule: n,
|
|
20
|
+
flush: t
|
|
21
|
+
};
|
|
22
|
+
}();
|
|
23
|
+
function g(a) {
|
|
24
|
+
var n = a.source, t = a.initial, l = a.dispatchEvent, o = {
|
|
25
|
+
dropTargets: []
|
|
26
|
+
};
|
|
27
|
+
function u(c) {
|
|
28
|
+
l(c), o = {
|
|
29
|
+
dropTargets: c.payload.location.current.dropTargets
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
var v = {
|
|
33
|
+
start: function(r) {
|
|
34
|
+
var i = r.nativeSetDragImage, e = {
|
|
35
|
+
current: t,
|
|
36
|
+
previous: o,
|
|
37
|
+
initial: t
|
|
38
|
+
};
|
|
39
|
+
u({
|
|
40
|
+
eventName: "onGenerateDragPreview",
|
|
41
|
+
payload: {
|
|
42
|
+
source: n,
|
|
43
|
+
location: e,
|
|
44
|
+
nativeSetDragImage: i
|
|
45
|
+
}
|
|
46
|
+
}), d.schedule(function() {
|
|
47
|
+
u({
|
|
48
|
+
eventName: "onDragStart",
|
|
49
|
+
payload: {
|
|
50
|
+
source: n,
|
|
51
|
+
location: e
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
},
|
|
56
|
+
dragUpdate: function(r) {
|
|
57
|
+
var i = r.current;
|
|
58
|
+
d.flush(), s.cancel(), u({
|
|
59
|
+
eventName: "onDropTargetChange",
|
|
60
|
+
payload: {
|
|
61
|
+
source: n,
|
|
62
|
+
location: {
|
|
63
|
+
initial: t,
|
|
64
|
+
previous: o,
|
|
65
|
+
current: i
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
},
|
|
70
|
+
drag: function(r) {
|
|
71
|
+
var i = r.current;
|
|
72
|
+
s(function() {
|
|
73
|
+
d.flush();
|
|
74
|
+
var e = {
|
|
75
|
+
initial: t,
|
|
76
|
+
previous: o,
|
|
77
|
+
current: i
|
|
78
|
+
};
|
|
79
|
+
u({
|
|
80
|
+
eventName: "onDrag",
|
|
81
|
+
payload: {
|
|
82
|
+
source: n,
|
|
83
|
+
location: e
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
},
|
|
88
|
+
drop: function(r) {
|
|
89
|
+
var i = r.current, e = r.updatedSourcePayload;
|
|
90
|
+
d.flush(), s.cancel(), u({
|
|
91
|
+
eventName: "onDrop",
|
|
92
|
+
payload: {
|
|
93
|
+
source: e ?? n,
|
|
94
|
+
location: {
|
|
95
|
+
current: i,
|
|
96
|
+
previous: o,
|
|
97
|
+
initial: t
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
return v;
|
|
104
|
+
}
|
|
105
|
+
export {
|
|
106
|
+
g as makeDispatch
|
|
107
|
+
};
|