@bynder/compact-view 5.2.3 → 5.2.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.
Files changed (253) hide show
  1. package/AccessToken2.js +1 -1
  2. package/ActiveFilters.js +49 -50
  3. package/AddMedia.js +19 -18
  4. package/Advanced.js +13 -13
  5. package/App.js +60 -59
  6. package/Arrow.js +1 -1
  7. package/AssetFilter.js +38 -38
  8. package/AssetItem.js +10 -17
  9. package/AssetList.js +5 -5
  10. package/AssetTypeItem.js +21 -21
  11. package/AssetsView.js +13 -13
  12. package/Axios2.js +82 -76
  13. package/AxiosError.js +36 -35
  14. package/ButtonAction.js +1 -1
  15. package/CanceledError.js +15 -8
  16. package/Card.js +1 -1
  17. package/Chip.js +1 -1
  18. package/CollectionCard.js +22 -22
  19. package/CollectionItem.js +9 -9
  20. package/CollectionList.js +5 -5
  21. package/CollectionView.js +11 -11
  22. package/ColorPicker.js +1 -1
  23. package/ColorPickerSolid.js +3 -3
  24. package/ColorPickerWithOpacity.js +3 -3
  25. package/Component.js +158 -0
  26. package/Component2.js +4 -0
  27. package/ConfigContext.js +7 -8
  28. package/Container.js +1 -1
  29. package/ContextAction.js +1 -1
  30. package/ControlGroup.js +6 -6
  31. package/Dat.js +33 -32
  32. package/DatDropdownItem.js +1 -1
  33. package/DesignSystemProvider.js +7 -7
  34. package/DirectionSelect.js +11 -10
  35. package/DomainInput.js +19 -11
  36. package/Draggable.js +337 -0
  37. package/Draggable2.js +4 -0
  38. package/DraggableCore.js +312 -0
  39. package/DraggableCore2.js +4 -0
  40. package/Dropdown.js +37 -37
  41. package/Dropdown2.js +1 -1
  42. package/DropdownListItem.js +1 -1
  43. package/FieldSelect.js +19 -17
  44. package/FileSelector.js +38 -37
  45. package/FontPicker.js +1 -1
  46. package/Form.js +1 -1
  47. package/Header.js +5 -4
  48. package/HttpStatusCode.js +7 -1
  49. package/InfiniteScroll.js +1 -1
  50. package/InlineBanner.js +1 -1
  51. package/Input.js +1 -1
  52. package/InterceptorManager.js +2 -1
  53. package/Item.js +8 -8
  54. package/Item4.js +2 -2
  55. package/LeftArrow.js +1 -1
  56. package/ListItem2.js +1 -1
  57. package/ModalBase.js +15 -15
  58. package/NoResults.js +1 -1
  59. package/Option_new.js +36 -29
  60. package/ReactPropTypesSecret.js +10 -0
  61. package/RightArrow.js +1 -1
  62. package/SearchInput.js +1 -1
  63. package/SearchInput2.js +1 -1
  64. package/SelectionFooter.js +41 -31
  65. package/Shield.js +2 -2
  66. package/Smartfilters_new.js +107 -98
  67. package/StatefulAssetList.js +50 -50
  68. package/StoreInitializer.js +32 -16
  69. package/SwitchNLS.js +1 -1
  70. package/TagItem.js +15 -15
  71. package/Tags.js +1 -1
  72. package/Toolbar.js +23 -20
  73. package/Tooltip2.js +1 -1
  74. package/ViewSwitch.js +17 -15
  75. package/_commonjsHelpers.js +28 -3
  76. package/adapters.js +54 -42
  77. package/api/filterAssets.d.ts +1 -1
  78. package/api/getAssets.d.ts +1 -1
  79. package/api/getFilters.d.ts +1 -1
  80. package/api/rest/index.d.ts +1 -1
  81. package/api/rest/types.d.ts +1 -1
  82. package/api2.js +1 -1
  83. package/asset.type.js +1 -1
  84. package/autocomplete.js +1 -1
  85. package/axios.js +1 -1
  86. package/bodyScrollLock.esm.js +68 -0
  87. package/buildURL.js +13 -15
  88. package/checkGlobals.js +1 -1
  89. package/cjs.js +7 -0
  90. package/cjs2.js +15 -0
  91. package/cjs3.js +4 -0
  92. package/clsx.m.js +6 -0
  93. package/clsx.m2.js +15 -0
  94. package/combineMetaproperties.js +3 -1
  95. package/composeSignals.js +1 -1
  96. package/cookieStore.js +1 -1
  97. package/cookies.js +13 -11
  98. package/currentScopes.js +1 -1
  99. package/data.js +1 -1
  100. package/devUtils.js +1 -1
  101. package/dispatchRequest.js +5 -5
  102. package/domFns.js +151 -0
  103. package/domFns2.js +4 -0
  104. package/factoryWithThrowingShims.js +52 -0
  105. package/fetch2.js +156 -128
  106. package/filter/AssetFilterContext.d.ts +3 -3
  107. package/filterAssets.js +1 -1
  108. package/getAsset.js +1 -1
  109. package/getAssetCounts.js +1 -1
  110. package/getAssets.js +1 -1
  111. package/getCollections.js +1 -1
  112. package/getFilterOptions.js +1 -1
  113. package/getFilters.js +1 -1
  114. package/getFilters_new.js +1 -1
  115. package/getPrefix.js +35 -0
  116. package/getPrefix2.js +4 -0
  117. package/getSimilarityAssets.js +1 -1
  118. package/goober.modern.js +75 -0
  119. package/handlers.js +1 -1
  120. package/iconBase.js +56 -0
  121. package/iconContext.js +12 -0
  122. package/iconsManifest.js +222 -0
  123. package/index-esm.js +1 -4
  124. package/index.browser.js +1 -1
  125. package/index.m.js +9 -0
  126. package/index.m2.js +17 -0
  127. package/index10.js +18 -2
  128. package/index11.js +181 -15
  129. package/index112.js +1 -1
  130. package/index12.js +313 -36
  131. package/index13.js +5 -2430
  132. package/index14.js +3 -557
  133. package/index15.js +15 -55
  134. package/index16.js +3 -2
  135. package/index17.js +3 -87
  136. package/index18.js +36 -60
  137. package/index19.js +3 -7
  138. package/index20.js +2429 -12
  139. package/index21.js +557 -10
  140. package/index22.js +1 -1
  141. package/index23.js +119 -6
  142. package/index24.js +39 -7
  143. package/index25.js +2 -5
  144. package/index26.js +86 -9
  145. package/index27.js +55 -8
  146. package/index28.js +6 -636
  147. package/index29.js +8692 -74
  148. package/index3.js +1684 -5
  149. package/index30.js +2 -5
  150. package/index31.js +4 -20
  151. package/index310.js +2 -0
  152. package/index32.js +11 -2
  153. package/index33.js +5083 -4
  154. package/index34.js +2 -18
  155. package/index35.js +59 -5
  156. package/index36.js +2 -2
  157. package/index37.js +13 -11
  158. package/index38.js +46 -10
  159. package/index39.js +6 -12
  160. package/index4.js +5 -1684
  161. package/index40.js +8 -11
  162. package/index41.js +26 -18
  163. package/index42.js +2 -64
  164. package/index43.js +63 -5
  165. package/index44.js +9 -55
  166. package/index45.js +7 -67
  167. package/index46.js +8 -31
  168. package/index47.js +5 -11
  169. package/index48.js +10 -121
  170. package/index49.js +9 -86
  171. package/index5.js +215 -23
  172. package/index50.js +636 -7
  173. package/index51.js +74 -11
  174. package/index52.js +4 -13
  175. package/index53.js +19 -13
  176. package/index54.js +4 -6
  177. package/index55.js +18 -7
  178. package/index56.js +5 -14
  179. package/index57.js +10 -28
  180. package/index58.js +10 -15
  181. package/index59.js +15 -0
  182. package/index6.js +250 -299
  183. package/index60.js +13 -0
  184. package/index61.js +21 -0
  185. package/index62.js +8 -0
  186. package/index63.js +57 -0
  187. package/index64.js +4 -0
  188. package/index65.js +69 -0
  189. package/index66.js +33 -0
  190. package/index67.js +13 -0
  191. package/index68.js +123 -0
  192. package/index69.js +88 -0
  193. package/index7.js +22 -5047
  194. package/index70.js +10 -0
  195. package/index71.js +13 -0
  196. package/index72.js +13 -225
  197. package/index73.js +16 -0
  198. package/index74.js +9 -0
  199. package/index75.js +228 -0
  200. package/index76.js +9 -0
  201. package/index77.js +17 -0
  202. package/index78.js +31 -0
  203. package/index79.js +18 -0
  204. package/index8.js +5044 -47
  205. package/index9.js +50 -15
  206. package/isAbsoluteURL.js +1 -1
  207. package/isURLSameOrigin.js +1 -1
  208. package/localization.js +15 -15
  209. package/log.js +14 -0
  210. package/log2.js +4 -0
  211. package/matchRequestUrl.js +1 -1
  212. package/mergeConfig.js +37 -32
  213. package/notify.js +2 -2
  214. package/package.json +1 -1
  215. package/positionFns.js +101 -0
  216. package/positionFns2.js +4 -0
  217. package/react-laag.esm.js +957 -0
  218. package/react.js +8 -8
  219. package/react2.js +9 -9
  220. package/resolveConfig.js +23 -23
  221. package/select/add-media/AddMedia.d.ts +3 -1
  222. package/select/current-selection/SelectedItems.d.ts +1 -1
  223. package/shims.js +29 -0
  224. package/shims2.js +4 -0
  225. package/store/StoreInitializer.d.ts +5 -1
  226. package/store/useAssetFilterStore.d.ts +55 -0
  227. package/store/useSelectionStore.d.ts +47 -0
  228. package/styled-components.browser.esm.js +2 -2
  229. package/throttle.js +1 -1
  230. package/toURLEncodedForm.js +11 -10
  231. package/tokenExpirationHelper.js +1 -1
  232. package/transformData.js +1 -1
  233. package/transitional.js +4 -3
  234. package/useAssetFilterStore.js +152 -0
  235. package/useDatStore.js +1 -1
  236. package/useEffectEvent.js +7 -7
  237. package/useFonts.js +2 -2
  238. package/useOrderingStore.js +1 -1
  239. package/useRouterStore.js +1 -1
  240. package/useSearchStore.js +1 -1
  241. package/useSelectionStore.js +131 -0
  242. package/useSimilaritySearchStore.js +1 -1
  243. package/useTranslate.js +1 -1
  244. package/utils/combineMetaproperties.d.ts +2 -0
  245. package/utils6.js +160 -118
  246. package/utils7.js +7 -68
  247. package/utils8.js +68 -7
  248. package/xhr.js +47 -46
  249. package/AssetFilterContext.js +0 -161
  250. package/SelectionContext.js +0 -143
  251. package/select/SelectionContext.d.ts +0 -30
  252. /package/{Middleware.js → Middleware2.js} +0 -0
  253. /package/{middleware2.js → middleware.js} +0 -0
package/Draggable.js ADDED
@@ -0,0 +1,337 @@
1
+ import { __exports as _ } from "./Draggable2.js";
2
+ import G from "react";
3
+ import { __require as V } from "./index39.js";
4
+ import W from "react-dom";
5
+ import $ from "./clsx.m.js";
6
+ import { __require as B } from "./domFns.js";
7
+ import { __require as U } from "./positionFns.js";
8
+ import { __require as I } from "./shims.js";
9
+ import { __require as A } from "./DraggableCore.js";
10
+ import { __require as K } from "./log.js";
11
+ var M;
12
+ function ne() {
13
+ return M ? _ : (M = 1, (function(p) {
14
+ Object.defineProperty(p, "__esModule", {
15
+ value: !0
16
+ }), Object.defineProperty(p, "DraggableCore", {
17
+ enumerable: !0,
18
+ get: function() {
19
+ return m.default;
20
+ }
21
+ }), p.default = void 0;
22
+ var c = X(G), s = d(/* @__PURE__ */ V()), T = d(W), R = d($), S = B(), l = U(), b = I(), m = d(A()), h = d(K());
23
+ function d(e) {
24
+ return e && e.__esModule ? e : { default: e };
25
+ }
26
+ function P(e) {
27
+ if (typeof WeakMap != "function") return null;
28
+ var t = /* @__PURE__ */ new WeakMap(), r = /* @__PURE__ */ new WeakMap();
29
+ return (P = function(a) {
30
+ return a ? r : t;
31
+ })(e);
32
+ }
33
+ function X(e, t) {
34
+ if (e && e.__esModule)
35
+ return e;
36
+ if (e === null || typeof e != "object" && typeof e != "function")
37
+ return { default: e };
38
+ var r = P(t);
39
+ if (r && r.has(e))
40
+ return r.get(e);
41
+ var a = {}, o = Object.defineProperty && Object.getOwnPropertyDescriptor;
42
+ for (var n in e)
43
+ if (n !== "default" && Object.prototype.hasOwnProperty.call(e, n)) {
44
+ var i = o ? Object.getOwnPropertyDescriptor(e, n) : null;
45
+ i && (i.get || i.set) ? Object.defineProperty(a, n, i) : a[n] = e[n];
46
+ }
47
+ return a.default = e, r && r.set(e, a), a;
48
+ }
49
+ function v() {
50
+ return v = Object.assign ? Object.assign.bind() : function(e) {
51
+ for (var t = 1; t < arguments.length; t++) {
52
+ var r = arguments[t];
53
+ for (var a in r)
54
+ Object.prototype.hasOwnProperty.call(r, a) && (e[a] = r[a]);
55
+ }
56
+ return e;
57
+ }, v.apply(this, arguments);
58
+ }
59
+ function u(e, t, r) {
60
+ return t = Y(t), t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
61
+ }
62
+ function Y(e) {
63
+ var t = E(e, "string");
64
+ return typeof t == "symbol" ? t : String(t);
65
+ }
66
+ function E(e, t) {
67
+ if (typeof e != "object" || e === null) return e;
68
+ var r = e[Symbol.toPrimitive];
69
+ if (r !== void 0) {
70
+ var a = r.call(e, t);
71
+ if (typeof a != "object") return a;
72
+ throw new TypeError("@@toPrimitive must return a primitive value.");
73
+ }
74
+ return (t === "string" ? String : Number)(e);
75
+ }
76
+ class y extends c.Component {
77
+ // React 16.3+
78
+ // Arity (props, state)
79
+ static getDerivedStateFromProps(t, r) {
80
+ let {
81
+ position: a
82
+ } = t, {
83
+ prevPropsPosition: o
84
+ } = r;
85
+ return a && (!o || a.x !== o.x || a.y !== o.y) ? ((0, h.default)("Draggable: getDerivedStateFromProps %j", {
86
+ position: a,
87
+ prevPropsPosition: o
88
+ }), {
89
+ x: a.x,
90
+ y: a.y,
91
+ prevPropsPosition: {
92
+ ...a
93
+ }
94
+ }) : null;
95
+ }
96
+ constructor(t) {
97
+ super(t), u(this, "onDragStart", (r, a) => {
98
+ if ((0, h.default)("Draggable: onDragStart: %j", a), this.props.onStart(r, (0, l.createDraggableData)(this, a)) === !1) return !1;
99
+ this.setState({
100
+ dragging: !0,
101
+ dragged: !0
102
+ });
103
+ }), u(this, "onDrag", (r, a) => {
104
+ if (!this.state.dragging) return !1;
105
+ (0, h.default)("Draggable: onDrag: %j", a);
106
+ const o = (0, l.createDraggableData)(this, a), n = {
107
+ x: o.x,
108
+ y: o.y,
109
+ slackX: 0,
110
+ slackY: 0
111
+ };
112
+ if (this.props.bounds) {
113
+ const {
114
+ x: g,
115
+ y: f
116
+ } = n;
117
+ n.x += this.state.slackX, n.y += this.state.slackY;
118
+ const [D, x] = (0, l.getBoundPosition)(this, n.x, n.y);
119
+ n.x = D, n.y = x, n.slackX = this.state.slackX + (g - n.x), n.slackY = this.state.slackY + (f - n.y), o.x = n.x, o.y = n.y, o.deltaX = n.x - this.state.x, o.deltaY = n.y - this.state.y;
120
+ }
121
+ if (this.props.onDrag(r, o) === !1) return !1;
122
+ this.setState(n);
123
+ }), u(this, "onDragStop", (r, a) => {
124
+ if (!this.state.dragging || this.props.onStop(r, (0, l.createDraggableData)(this, a)) === !1) return !1;
125
+ (0, h.default)("Draggable: onDragStop: %j", a);
126
+ const n = {
127
+ dragging: !1,
128
+ slackX: 0,
129
+ slackY: 0
130
+ };
131
+ if (!!this.props.position) {
132
+ const {
133
+ x: g,
134
+ y: f
135
+ } = this.props.position;
136
+ n.x = g, n.y = f;
137
+ }
138
+ this.setState(n);
139
+ }), this.state = {
140
+ // Whether or not we are currently dragging.
141
+ dragging: !1,
142
+ // Whether or not we have been dragged before.
143
+ dragged: !1,
144
+ // Current transform x and y.
145
+ x: t.position ? t.position.x : t.defaultPosition.x,
146
+ y: t.position ? t.position.y : t.defaultPosition.y,
147
+ prevPropsPosition: {
148
+ ...t.position
149
+ },
150
+ // Used for compensating for out-of-bounds drags
151
+ slackX: 0,
152
+ slackY: 0,
153
+ // Can only determine if SVG after mounting
154
+ isElementSVG: !1
155
+ }, t.position && !(t.onDrag || t.onStop) && console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.");
156
+ }
157
+ componentDidMount() {
158
+ typeof window.SVGElement < "u" && this.findDOMNode() instanceof window.SVGElement && this.setState({
159
+ isElementSVG: !0
160
+ });
161
+ }
162
+ componentWillUnmount() {
163
+ this.setState({
164
+ dragging: !1
165
+ });
166
+ }
167
+ // React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
168
+ // the underlying DOM node ourselves. See the README for more information.
169
+ findDOMNode() {
170
+ var t, r;
171
+ return (t = (r = this.props) === null || r === void 0 || (r = r.nodeRef) === null || r === void 0 ? void 0 : r.current) !== null && t !== void 0 ? t : T.default.findDOMNode(this);
172
+ }
173
+ render() {
174
+ const {
175
+ axis: t,
176
+ bounds: r,
177
+ children: a,
178
+ defaultPosition: o,
179
+ defaultClassName: n,
180
+ defaultClassNameDragging: i,
181
+ defaultClassNameDragged: g,
182
+ position: f,
183
+ positionOffset: D,
184
+ scale: x,
185
+ ...k
186
+ } = this.props;
187
+ let O = {}, w = null;
188
+ const q = !!!f || this.state.dragging, C = f || o, N = {
189
+ // Set left if horizontal drag is enabled
190
+ x: (0, l.canDragX)(this) && q ? this.state.x : C.x,
191
+ // Set top if vertical drag is enabled
192
+ y: (0, l.canDragY)(this) && q ? this.state.y : C.y
193
+ };
194
+ this.state.isElementSVG ? w = (0, S.createSVGTransform)(N, D) : O = (0, S.createCSSTransform)(N, D);
195
+ const F = (0, R.default)(a.props.className || "", n, {
196
+ [i]: this.state.dragging,
197
+ [g]: this.state.dragged
198
+ });
199
+ return /* @__PURE__ */ c.createElement(m.default, v({}, k, {
200
+ onStart: this.onDragStart,
201
+ onDrag: this.onDrag,
202
+ onStop: this.onDragStop
203
+ }), /* @__PURE__ */ c.cloneElement(c.Children.only(a), {
204
+ className: F,
205
+ style: {
206
+ ...a.props.style,
207
+ ...O
208
+ },
209
+ transform: w
210
+ }));
211
+ }
212
+ }
213
+ p.default = y, u(y, "displayName", "Draggable"), u(y, "propTypes", {
214
+ // Accepts all props <DraggableCore> accepts.
215
+ ...m.default.propTypes,
216
+ /**
217
+ * `axis` determines which axis the draggable can move.
218
+ *
219
+ * Note that all callbacks will still return data as normal. This only
220
+ * controls flushing to the DOM.
221
+ *
222
+ * 'both' allows movement horizontally and vertically.
223
+ * 'x' limits movement to horizontal axis.
224
+ * 'y' limits movement to vertical axis.
225
+ * 'none' limits all movement.
226
+ *
227
+ * Defaults to 'both'.
228
+ */
229
+ axis: s.default.oneOf(["both", "x", "y", "none"]),
230
+ /**
231
+ * `bounds` determines the range of movement available to the element.
232
+ * Available values are:
233
+ *
234
+ * 'parent' restricts movement within the Draggable's parent node.
235
+ *
236
+ * Alternatively, pass an object with the following properties, all of which are optional:
237
+ *
238
+ * {left: LEFT_BOUND, right: RIGHT_BOUND, bottom: BOTTOM_BOUND, top: TOP_BOUND}
239
+ *
240
+ * All values are in px.
241
+ *
242
+ * Example:
243
+ *
244
+ * ```jsx
245
+ * let App = React.createClass({
246
+ * render: function () {
247
+ * return (
248
+ * <Draggable bounds={{right: 300, bottom: 300}}>
249
+ * <div>Content</div>
250
+ * </Draggable>
251
+ * );
252
+ * }
253
+ * });
254
+ * ```
255
+ */
256
+ bounds: s.default.oneOfType([s.default.shape({
257
+ left: s.default.number,
258
+ right: s.default.number,
259
+ top: s.default.number,
260
+ bottom: s.default.number
261
+ }), s.default.string, s.default.oneOf([!1])]),
262
+ defaultClassName: s.default.string,
263
+ defaultClassNameDragging: s.default.string,
264
+ defaultClassNameDragged: s.default.string,
265
+ /**
266
+ * `defaultPosition` specifies the x and y that the dragged item should start at
267
+ *
268
+ * Example:
269
+ *
270
+ * ```jsx
271
+ * let App = React.createClass({
272
+ * render: function () {
273
+ * return (
274
+ * <Draggable defaultPosition={{x: 25, y: 25}}>
275
+ * <div>I start with transformX: 25px and transformY: 25px;</div>
276
+ * </Draggable>
277
+ * );
278
+ * }
279
+ * });
280
+ * ```
281
+ */
282
+ defaultPosition: s.default.shape({
283
+ x: s.default.number,
284
+ y: s.default.number
285
+ }),
286
+ positionOffset: s.default.shape({
287
+ x: s.default.oneOfType([s.default.number, s.default.string]),
288
+ y: s.default.oneOfType([s.default.number, s.default.string])
289
+ }),
290
+ /**
291
+ * `position`, if present, defines the current position of the element.
292
+ *
293
+ * This is similar to how form elements in React work - if no `position` is supplied, the component
294
+ * is uncontrolled.
295
+ *
296
+ * Example:
297
+ *
298
+ * ```jsx
299
+ * let App = React.createClass({
300
+ * render: function () {
301
+ * return (
302
+ * <Draggable position={{x: 25, y: 25}}>
303
+ * <div>I start with transformX: 25px and transformY: 25px;</div>
304
+ * </Draggable>
305
+ * );
306
+ * }
307
+ * });
308
+ * ```
309
+ */
310
+ position: s.default.shape({
311
+ x: s.default.number,
312
+ y: s.default.number
313
+ }),
314
+ /**
315
+ * These properties should be defined on the child, not here.
316
+ */
317
+ className: b.dontSetMe,
318
+ style: b.dontSetMe,
319
+ transform: b.dontSetMe
320
+ }), u(y, "defaultProps", {
321
+ ...m.default.defaultProps,
322
+ axis: "both",
323
+ bounds: !1,
324
+ defaultClassName: "react-draggable",
325
+ defaultClassNameDragging: "react-draggable-dragging",
326
+ defaultClassNameDragged: "react-draggable-dragged",
327
+ defaultPosition: {
328
+ x: 0,
329
+ y: 0
330
+ },
331
+ scale: 1
332
+ });
333
+ })(_), _);
334
+ }
335
+ export {
336
+ ne as __require
337
+ };
package/Draggable2.js ADDED
@@ -0,0 +1,4 @@
1
+ var a = {};
2
+ export {
3
+ a as __exports
4
+ };
@@ -0,0 +1,312 @@
1
+ import { __exports as m } from "./DraggableCore2.js";
2
+ import P from "react";
3
+ import { __require as O } from "./index39.js";
4
+ import q from "react-dom";
5
+ import { __require as T } from "./domFns.js";
6
+ import { __require as U } from "./positionFns.js";
7
+ import { __require as R } from "./shims.js";
8
+ import { __require as X } from "./log.js";
9
+ var M;
10
+ function G() {
11
+ if (M) return m;
12
+ M = 1, Object.defineProperty(m, "__esModule", {
13
+ value: !0
14
+ }), m.default = void 0;
15
+ var S = C(P), i = _(/* @__PURE__ */ O()), b = _(q), n = T(), c = U(), y = R(), g = _(X());
16
+ function _(t) {
17
+ return t && t.__esModule ? t : { default: t };
18
+ }
19
+ function w(t) {
20
+ if (typeof WeakMap != "function") return null;
21
+ var e = /* @__PURE__ */ new WeakMap(), r = /* @__PURE__ */ new WeakMap();
22
+ return (w = function(o) {
23
+ return o ? r : e;
24
+ })(t);
25
+ }
26
+ function C(t, e) {
27
+ if (t && t.__esModule)
28
+ return t;
29
+ if (t === null || typeof t != "object" && typeof t != "function")
30
+ return { default: t };
31
+ var r = w(e);
32
+ if (r && r.has(t))
33
+ return r.get(t);
34
+ var o = {}, d = Object.defineProperty && Object.getOwnPropertyDescriptor;
35
+ for (var a in t)
36
+ if (a !== "default" && Object.prototype.hasOwnProperty.call(t, a)) {
37
+ var f = d ? Object.getOwnPropertyDescriptor(t, a) : null;
38
+ f && (f.get || f.set) ? Object.defineProperty(o, a, f) : o[a] = t[a];
39
+ }
40
+ return o.default = t, r && r.set(t, o), o;
41
+ }
42
+ function s(t, e, r) {
43
+ return e = E(e), e in t ? Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : t[e] = r, t;
44
+ }
45
+ function E(t) {
46
+ var e = N(t, "string");
47
+ return typeof e == "symbol" ? e : String(e);
48
+ }
49
+ function N(t, e) {
50
+ if (typeof t != "object" || t === null) return t;
51
+ var r = t[Symbol.toPrimitive];
52
+ if (r !== void 0) {
53
+ var o = r.call(t, e);
54
+ if (typeof o != "object") return o;
55
+ throw new TypeError("@@toPrimitive must return a primitive value.");
56
+ }
57
+ return (e === "string" ? String : Number)(t);
58
+ }
59
+ const h = {
60
+ touch: {
61
+ start: "touchstart",
62
+ move: "touchmove",
63
+ stop: "touchend"
64
+ },
65
+ mouse: {
66
+ start: "mousedown",
67
+ move: "mousemove",
68
+ stop: "mouseup"
69
+ }
70
+ };
71
+ let p = h.mouse, v = class extends S.Component {
72
+ constructor() {
73
+ super(...arguments), s(this, "dragging", !1), s(this, "lastX", NaN), s(this, "lastY", NaN), s(this, "touchIdentifier", null), s(this, "mounted", !1), s(this, "handleDragStart", (e) => {
74
+ if (this.props.onMouseDown(e), !this.props.allowAnyClick && typeof e.button == "number" && e.button !== 0) return !1;
75
+ const r = this.findDOMNode();
76
+ if (!r || !r.ownerDocument || !r.ownerDocument.body)
77
+ throw new Error("<DraggableCore> not mounted on DragStart!");
78
+ const {
79
+ ownerDocument: o
80
+ } = r;
81
+ if (this.props.disabled || !(e.target instanceof o.defaultView.Node) || this.props.handle && !(0, n.matchesSelectorAndParentsTo)(e.target, this.props.handle, r) || this.props.cancel && (0, n.matchesSelectorAndParentsTo)(e.target, this.props.cancel, r))
82
+ return;
83
+ e.type === "touchstart" && e.preventDefault();
84
+ const d = (0, n.getTouchIdentifier)(e);
85
+ this.touchIdentifier = d;
86
+ const a = (0, c.getControlPosition)(e, d, this);
87
+ if (a == null) return;
88
+ const {
89
+ x: f,
90
+ y: l
91
+ } = a, u = (0, c.createCoreData)(this, f, l);
92
+ (0, g.default)("DraggableCore: handleDragStart: %j", u), (0, g.default)("calling", this.props.onStart), !(this.props.onStart(e, u) === !1 || this.mounted === !1) && (this.props.enableUserSelectHack && (0, n.addUserSelectStyles)(o), this.dragging = !0, this.lastX = f, this.lastY = l, (0, n.addEvent)(o, p.move, this.handleDrag), (0, n.addEvent)(o, p.stop, this.handleDragStop));
93
+ }), s(this, "handleDrag", (e) => {
94
+ const r = (0, c.getControlPosition)(e, this.touchIdentifier, this);
95
+ if (r == null) return;
96
+ let {
97
+ x: o,
98
+ y: d
99
+ } = r;
100
+ if (Array.isArray(this.props.grid)) {
101
+ let l = o - this.lastX, u = d - this.lastY;
102
+ if ([l, u] = (0, c.snapToGrid)(this.props.grid, l, u), !l && !u) return;
103
+ o = this.lastX + l, d = this.lastY + u;
104
+ }
105
+ const a = (0, c.createCoreData)(this, o, d);
106
+ if ((0, g.default)("DraggableCore: handleDrag: %j", a), this.props.onDrag(e, a) === !1 || this.mounted === !1) {
107
+ try {
108
+ this.handleDragStop(new MouseEvent("mouseup"));
109
+ } catch {
110
+ const u = document.createEvent("MouseEvents");
111
+ u.initMouseEvent("mouseup", !0, !0, window, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, null), this.handleDragStop(u);
112
+ }
113
+ return;
114
+ }
115
+ this.lastX = o, this.lastY = d;
116
+ }), s(this, "handleDragStop", (e) => {
117
+ if (!this.dragging) return;
118
+ const r = (0, c.getControlPosition)(e, this.touchIdentifier, this);
119
+ if (r == null) return;
120
+ let {
121
+ x: o,
122
+ y: d
123
+ } = r;
124
+ if (Array.isArray(this.props.grid)) {
125
+ let u = o - this.lastX || 0, D = d - this.lastY || 0;
126
+ [u, D] = (0, c.snapToGrid)(this.props.grid, u, D), o = this.lastX + u, d = this.lastY + D;
127
+ }
128
+ const a = (0, c.createCoreData)(this, o, d);
129
+ if (this.props.onStop(e, a) === !1 || this.mounted === !1) return !1;
130
+ const l = this.findDOMNode();
131
+ l && this.props.enableUserSelectHack && (0, n.removeUserSelectStyles)(l.ownerDocument), (0, g.default)("DraggableCore: handleDragStop: %j", a), this.dragging = !1, this.lastX = NaN, this.lastY = NaN, l && ((0, g.default)("DraggableCore: Removing handlers"), (0, n.removeEvent)(l.ownerDocument, p.move, this.handleDrag), (0, n.removeEvent)(l.ownerDocument, p.stop, this.handleDragStop));
132
+ }), s(this, "onMouseDown", (e) => (p = h.mouse, this.handleDragStart(e))), s(this, "onMouseUp", (e) => (p = h.mouse, this.handleDragStop(e))), s(this, "onTouchStart", (e) => (p = h.touch, this.handleDragStart(e))), s(this, "onTouchEnd", (e) => (p = h.touch, this.handleDragStop(e)));
133
+ }
134
+ componentDidMount() {
135
+ this.mounted = !0;
136
+ const e = this.findDOMNode();
137
+ e && (0, n.addEvent)(e, h.touch.start, this.onTouchStart, {
138
+ passive: !1
139
+ });
140
+ }
141
+ componentWillUnmount() {
142
+ this.mounted = !1;
143
+ const e = this.findDOMNode();
144
+ if (e) {
145
+ const {
146
+ ownerDocument: r
147
+ } = e;
148
+ (0, n.removeEvent)(r, h.mouse.move, this.handleDrag), (0, n.removeEvent)(r, h.touch.move, this.handleDrag), (0, n.removeEvent)(r, h.mouse.stop, this.handleDragStop), (0, n.removeEvent)(r, h.touch.stop, this.handleDragStop), (0, n.removeEvent)(e, h.touch.start, this.onTouchStart, {
149
+ passive: !1
150
+ }), this.props.enableUserSelectHack && (0, n.removeUserSelectStyles)(r);
151
+ }
152
+ }
153
+ // React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find
154
+ // the underlying DOM node ourselves. See the README for more information.
155
+ findDOMNode() {
156
+ var e, r;
157
+ return (e = this.props) !== null && e !== void 0 && e.nodeRef ? (r = this.props) === null || r === void 0 || (r = r.nodeRef) === null || r === void 0 ? void 0 : r.current : b.default.findDOMNode(this);
158
+ }
159
+ render() {
160
+ return /* @__PURE__ */ S.cloneElement(S.Children.only(this.props.children), {
161
+ // Note: mouseMove handler is attached to document so it will still function
162
+ // when the user drags quickly and leaves the bounds of the element.
163
+ onMouseDown: this.onMouseDown,
164
+ onMouseUp: this.onMouseUp,
165
+ // onTouchStart is added on `componentDidMount` so they can be added with
166
+ // {passive: false}, which allows it to cancel. See
167
+ // https://developers.google.com/web/updates/2017/01/scrolling-intervention
168
+ onTouchEnd: this.onTouchEnd
169
+ });
170
+ }
171
+ };
172
+ return m.default = v, s(v, "displayName", "DraggableCore"), s(v, "propTypes", {
173
+ /**
174
+ * `allowAnyClick` allows dragging using any mouse button.
175
+ * By default, we only accept the left button.
176
+ *
177
+ * Defaults to `false`.
178
+ */
179
+ allowAnyClick: i.default.bool,
180
+ children: i.default.node.isRequired,
181
+ /**
182
+ * `disabled`, if true, stops the <Draggable> from dragging. All handlers,
183
+ * with the exception of `onMouseDown`, will not fire.
184
+ */
185
+ disabled: i.default.bool,
186
+ /**
187
+ * By default, we add 'user-select:none' attributes to the document body
188
+ * to prevent ugly text selection during drag. If this is causing problems
189
+ * for your app, set this to `false`.
190
+ */
191
+ enableUserSelectHack: i.default.bool,
192
+ /**
193
+ * `offsetParent`, if set, uses the passed DOM node to compute drag offsets
194
+ * instead of using the parent node.
195
+ */
196
+ offsetParent: function(t, e) {
197
+ if (t[e] && t[e].nodeType !== 1)
198
+ throw new Error("Draggable's offsetParent must be a DOM Node.");
199
+ },
200
+ /**
201
+ * `grid` specifies the x and y that dragging should snap to.
202
+ */
203
+ grid: i.default.arrayOf(i.default.number),
204
+ /**
205
+ * `handle` specifies a selector to be used as the handle that initiates drag.
206
+ *
207
+ * Example:
208
+ *
209
+ * ```jsx
210
+ * let App = React.createClass({
211
+ * render: function () {
212
+ * return (
213
+ * <Draggable handle=".handle">
214
+ * <div>
215
+ * <div className="handle">Click me to drag</div>
216
+ * <div>This is some other content</div>
217
+ * </div>
218
+ * </Draggable>
219
+ * );
220
+ * }
221
+ * });
222
+ * ```
223
+ */
224
+ handle: i.default.string,
225
+ /**
226
+ * `cancel` specifies a selector to be used to prevent drag initialization.
227
+ *
228
+ * Example:
229
+ *
230
+ * ```jsx
231
+ * let App = React.createClass({
232
+ * render: function () {
233
+ * return(
234
+ * <Draggable cancel=".cancel">
235
+ * <div>
236
+ * <div className="cancel">You can't drag from here</div>
237
+ * <div>Dragging here works fine</div>
238
+ * </div>
239
+ * </Draggable>
240
+ * );
241
+ * }
242
+ * });
243
+ * ```
244
+ */
245
+ cancel: i.default.string,
246
+ /* If running in React Strict mode, ReactDOM.findDOMNode() is deprecated.
247
+ * Unfortunately, in order for <Draggable> to work properly, we need raw access
248
+ * to the underlying DOM node. If you want to avoid the warning, pass a `nodeRef`
249
+ * as in this example:
250
+ *
251
+ * function MyComponent() {
252
+ * const nodeRef = React.useRef(null);
253
+ * return (
254
+ * <Draggable nodeRef={nodeRef}>
255
+ * <div ref={nodeRef}>Example Target</div>
256
+ * </Draggable>
257
+ * );
258
+ * }
259
+ *
260
+ * This can be used for arbitrarily nested components, so long as the ref ends up
261
+ * pointing to the actual child DOM node and not a custom component.
262
+ */
263
+ nodeRef: i.default.object,
264
+ /**
265
+ * Called when dragging starts.
266
+ * If this function returns the boolean false, dragging will be canceled.
267
+ */
268
+ onStart: i.default.func,
269
+ /**
270
+ * Called while dragging.
271
+ * If this function returns the boolean false, dragging will be canceled.
272
+ */
273
+ onDrag: i.default.func,
274
+ /**
275
+ * Called when dragging stops.
276
+ * If this function returns the boolean false, the drag will remain active.
277
+ */
278
+ onStop: i.default.func,
279
+ /**
280
+ * A workaround option which can be passed if onMouseDown needs to be accessed,
281
+ * since it'll always be blocked (as there is internal use of onMouseDown)
282
+ */
283
+ onMouseDown: i.default.func,
284
+ /**
285
+ * `scale`, if set, applies scaling while dragging an element
286
+ */
287
+ scale: i.default.number,
288
+ /**
289
+ * These properties should be defined on the child, not here.
290
+ */
291
+ className: y.dontSetMe,
292
+ style: y.dontSetMe,
293
+ transform: y.dontSetMe
294
+ }), s(v, "defaultProps", {
295
+ allowAnyClick: !1,
296
+ // by default only accept left click
297
+ disabled: !1,
298
+ enableUserSelectHack: !0,
299
+ onStart: function() {
300
+ },
301
+ onDrag: function() {
302
+ },
303
+ onStop: function() {
304
+ },
305
+ onMouseDown: function() {
306
+ },
307
+ scale: 1
308
+ }), m;
309
+ }
310
+ export {
311
+ G as __require
312
+ };
@@ -0,0 +1,4 @@
1
+ var r = {};
2
+ export {
3
+ r as __exports
4
+ };