publ-echo-test 0.0.1

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 (68) hide show
  1. package/README.md +29 -0
  2. package/css/gle-styles.css +169 -0
  3. package/css/resizable-styles.css +76 -0
  4. package/dist/external-lib/classnames/index.d.ts +5 -0
  5. package/dist/external-lib/classnames/index.js +60 -0
  6. package/dist/external-lib/lodash.isEqual/index.d.ts +30 -0
  7. package/dist/external-lib/lodash.isEqual/index.js +1661 -0
  8. package/dist/lib/Draggable/Draggable.d.ts +17 -0
  9. package/dist/lib/Draggable/Draggable.js +192 -0
  10. package/dist/lib/Draggable/DraggableCore.d.ts +5 -0
  11. package/dist/lib/Draggable/DraggableCore.js +266 -0
  12. package/dist/lib/Draggable/constants.d.ts +12 -0
  13. package/dist/lib/Draggable/constants.js +12 -0
  14. package/dist/lib/Draggable/index.d.ts +2 -0
  15. package/dist/lib/Draggable/index.js +2 -0
  16. package/dist/lib/Draggable/types.d.ts +55 -0
  17. package/dist/lib/Draggable/types.js +1 -0
  18. package/dist/lib/Draggable/utils/domHelpers.d.ts +22 -0
  19. package/dist/lib/Draggable/utils/domHelpers.js +222 -0
  20. package/dist/lib/Draggable/utils/getPrefix.d.ts +5 -0
  21. package/dist/lib/Draggable/utils/getPrefix.js +41 -0
  22. package/dist/lib/Draggable/utils/positionHelpers.d.ts +7 -0
  23. package/dist/lib/Draggable/utils/positionHelpers.js +32 -0
  24. package/dist/lib/Draggable/utils/types.d.ts +30 -0
  25. package/dist/lib/Draggable/utils/types.js +1 -0
  26. package/dist/lib/Draggable/utils/validationHelpers.d.ts +4 -0
  27. package/dist/lib/Draggable/utils/validationHelpers.js +16 -0
  28. package/dist/lib/GridItem/GridItem.d.ts +5 -0
  29. package/dist/lib/GridItem/GridItem.js +350 -0
  30. package/dist/lib/GridItem/index.d.ts +1 -0
  31. package/dist/lib/GridItem/index.js +1 -0
  32. package/dist/lib/GridItem/types.d.ts +107 -0
  33. package/dist/lib/GridItem/types.js +1 -0
  34. package/dist/lib/GridItem/utils/calculateUtils.d.ts +30 -0
  35. package/dist/lib/GridItem/utils/calculateUtils.js +108 -0
  36. package/dist/lib/GridLayoutEditor/ReactGridLayout.d.ts +6 -0
  37. package/dist/lib/GridLayoutEditor/ReactGridLayout.js +456 -0
  38. package/dist/lib/GridLayoutEditor/ResponsiveGridLayout.d.ts +4 -0
  39. package/dist/lib/GridLayoutEditor/ResponsiveGridLayout.js +117 -0
  40. package/dist/lib/GridLayoutEditor/index.d.ts +3 -0
  41. package/dist/lib/GridLayoutEditor/index.js +2 -0
  42. package/dist/lib/GridLayoutEditor/types.d.ts +133 -0
  43. package/dist/lib/GridLayoutEditor/types.js +1 -0
  44. package/dist/lib/GridLayoutEditor/utils/renderHelpers.d.ts +165 -0
  45. package/dist/lib/GridLayoutEditor/utils/renderHelpers.js +566 -0
  46. package/dist/lib/GridLayoutEditor/utils/responsiveUtils.d.ts +26 -0
  47. package/dist/lib/GridLayoutEditor/utils/responsiveUtils.js +77 -0
  48. package/dist/lib/Resizable/Resizable.d.ts +6 -0
  49. package/dist/lib/Resizable/Resizable.js +215 -0
  50. package/dist/lib/Resizable/ResizableBox.d.ts +7 -0
  51. package/dist/lib/Resizable/ResizableBox.js +57 -0
  52. package/dist/lib/Resizable/index.d.ts +1 -0
  53. package/dist/lib/Resizable/index.js +1 -0
  54. package/dist/lib/Resizable/types.d.ts +63 -0
  55. package/dist/lib/Resizable/types.js +1 -0
  56. package/dist/lib/Resizable/utils/cloneElement.d.ts +2 -0
  57. package/dist/lib/Resizable/utils/cloneElement.js +21 -0
  58. package/dist/lib/components/WidthProvider.d.ts +9 -0
  59. package/dist/lib/components/WidthProvider.js +65 -0
  60. package/dist/lib/components/index.d.ts +1 -0
  61. package/dist/lib/components/index.js +1 -0
  62. package/dist/lib/components/types.d.ts +13 -0
  63. package/dist/lib/components/types.js +1 -0
  64. package/dist/lib/index.d.ts +5 -0
  65. package/dist/lib/index.js +5 -0
  66. package/dist/lib/types.d.ts +4 -0
  67. package/dist/lib/types.js +1 -0
  68. package/package.json +56 -0
@@ -0,0 +1,222 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ /* eslint-disable @typescript-eslint/no-unused-vars */
13
+ import browserPrefix, { browserPrefixToKey } from "./getPrefix";
14
+ import { findInArray, int, isFunction } from "./validationHelpers";
15
+ export var matchSelector = function (el, selector) {
16
+ var matchedSelector = "";
17
+ var selectors = [
18
+ "matches",
19
+ "webkitMatchesSelector",
20
+ // "mozMatchesSelector",
21
+ // "msMatchesSelector",
22
+ // "oMatchesSelector",
23
+ ];
24
+ var callback = function (method) {
25
+ return isFunction(el[method]);
26
+ };
27
+ if (!matchedSelector) {
28
+ matchedSelector = findInArray(selectors, callback);
29
+ if (matchedSelector === "matches" ||
30
+ matchedSelector === "webkitMatchesSelector") {
31
+ return el[matchedSelector](selector);
32
+ }
33
+ }
34
+ return false;
35
+ };
36
+ export var matchSelectorAndParentsTo = function (el, selector, baseNode) {
37
+ var node = el;
38
+ do {
39
+ if (matchSelector(node, selector))
40
+ return true;
41
+ if (node === baseNode)
42
+ return false;
43
+ if (node.parentNode)
44
+ node = node.parentNode;
45
+ } while (node);
46
+ return false;
47
+ };
48
+ export var addEvent = function (el, eventType, handler, inputOptions) {
49
+ if (!el)
50
+ return;
51
+ var options = __assign({ capture: true }, inputOptions);
52
+ if (el.addEventListener) {
53
+ el.addEventListener(eventType, handler, options);
54
+ }
55
+ // if (el.addEventListener) {
56
+ // el.addEventListener(eventType, handler, options);
57
+ // } else {
58
+ // (el as { [key: string]: any })['on' + eventType] = handler;
59
+ // }
60
+ };
61
+ export var removeEvent = function (el, eventType, handler, inputOptions) {
62
+ if (!el)
63
+ return;
64
+ var options = __assign({ capture: true }, inputOptions);
65
+ if (el.removeEventListener) {
66
+ el.removeEventListener(eventType, handler, options);
67
+ }
68
+ // if (el.removeEventListener) {
69
+ // el.removeEventListener(eventType, handler, options);
70
+ // } else {
71
+ // (el as { [key: string]: any })['on' + eventType] = null;
72
+ // }
73
+ };
74
+ export var outerHeight = function (node) {
75
+ var _a;
76
+ var height = node.clientHeight;
77
+ var computedStyle = (_a = node.ownerDocument.defaultView) === null || _a === void 0 ? void 0 : _a.getComputedStyle(node);
78
+ if (computedStyle) {
79
+ height += int(computedStyle.borderTopWidth);
80
+ height += int(computedStyle.borderBottomWidth);
81
+ return height;
82
+ }
83
+ else {
84
+ return height;
85
+ }
86
+ };
87
+ export var outerWidth = function (node) {
88
+ var _a;
89
+ var width = node.clientWidth;
90
+ var computedStyle = (_a = node.ownerDocument.defaultView) === null || _a === void 0 ? void 0 : _a.getComputedStyle(node);
91
+ if (computedStyle) {
92
+ width += int(computedStyle.borderLeftWidth);
93
+ width += int(computedStyle.borderRightWidth);
94
+ return width;
95
+ }
96
+ else {
97
+ return width;
98
+ }
99
+ };
100
+ export var innerHeight = function (node) {
101
+ var _a;
102
+ var height = node.clientHeight;
103
+ var computedStyle = (_a = node.ownerDocument.defaultView) === null || _a === void 0 ? void 0 : _a.getComputedStyle(node);
104
+ if (computedStyle) {
105
+ height -= int(computedStyle.paddingTop);
106
+ height -= int(computedStyle.paddingBottom);
107
+ return height;
108
+ }
109
+ else {
110
+ return height;
111
+ }
112
+ };
113
+ export var innerWidth = function (node) {
114
+ var _a;
115
+ var width = node.clientWidth;
116
+ var computedStyle = (_a = node.ownerDocument.defaultView) === null || _a === void 0 ? void 0 : _a.getComputedStyle(node);
117
+ if (computedStyle) {
118
+ width -= int(computedStyle.paddingLeft);
119
+ width -= int(computedStyle.paddingRight);
120
+ return width;
121
+ }
122
+ else {
123
+ return width;
124
+ }
125
+ };
126
+ export var offsetXYFromParent = function (evt, offsetParent, scale) {
127
+ var isBody = offsetParent.ownerDocument.body;
128
+ var offsetParentRect = isBody
129
+ ? { left: 0, top: 0 }
130
+ : offsetParent.getBoundingClientRect();
131
+ var x = (evt.clientX + offsetParent.scrollLeft - offsetParentRect.left) / scale;
132
+ var y = (evt.clientY + offsetParent.scrollTop - offsetParentRect.top) / scale;
133
+ return { x: x, y: y };
134
+ };
135
+ export var createCSSTransform = function (controlPos, positionOffset) {
136
+ var _a;
137
+ var translation = getTranslation(controlPos, "px", positionOffset);
138
+ return _a = {}, _a[browserPrefixToKey("transform", browserPrefix)] = translation, _a;
139
+ };
140
+ export var createSVGTransform = function (controlPos, positionOffset) {
141
+ var translation = getTranslation(controlPos, "", positionOffset);
142
+ return translation;
143
+ };
144
+ export var getTranslation = function (_a, unitSuffix, positionOffset) {
145
+ var x = _a.x, y = _a.y;
146
+ var translation = "translate(".concat(x).concat(unitSuffix, ",").concat(y).concat(unitSuffix, ")");
147
+ if (positionOffset) {
148
+ var defaultX = "".concat(typeof positionOffset.x === "string"
149
+ ? positionOffset.x
150
+ : positionOffset.x + unitSuffix);
151
+ var defaultY = "".concat(typeof positionOffset.y === "string"
152
+ ? positionOffset.y
153
+ : positionOffset.y + unitSuffix);
154
+ translation = "translate(".concat(defaultX, ", ").concat(defaultY, ")") + translation;
155
+ }
156
+ return translation;
157
+ };
158
+ export var getTouch = function (e, identifier) {
159
+ return ((e.targetTouches &&
160
+ findInArray(e.targetTouches, function (t) { return identifier === t.identifier; })) ||
161
+ (e.changedTouches &&
162
+ findInArray(e.changedTouches, function (t) { return identifier === t.identifier; })));
163
+ };
164
+ export var getTouchIdentifier = function (e) {
165
+ if (e.targetTouches && e.targetTouches[0]) {
166
+ return e.targetTouches[0].identifier;
167
+ }
168
+ if (e.changedTouches && e.changedTouches[0]) {
169
+ return e.changedTouches[0].identifier;
170
+ }
171
+ };
172
+ export var addUserSelectStyles = function (doc) {
173
+ if (!doc)
174
+ return;
175
+ var styleEl = doc.getElementById("react-draggable-style-el");
176
+ if (!styleEl) {
177
+ styleEl = doc.createElement("style");
178
+ styleEl.id = "react-draggable-style-el";
179
+ styleEl.innerHTML =
180
+ ".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n";
181
+ styleEl.innerHTML +=
182
+ ".react-draggable-transparent-selection *::selection {all: inherit;}\n";
183
+ doc.getElementsByTagName("head")[0].appendChild(styleEl);
184
+ }
185
+ if (doc.body)
186
+ addClassName(doc.body, "react-draggable-transparent-selection");
187
+ };
188
+ export var removeUserSelectStyles = function (doc) {
189
+ var _a;
190
+ if (!doc)
191
+ return;
192
+ if (doc.body) {
193
+ removeClassName(doc.body, "react-draggable-transparent-selection");
194
+ }
195
+ if (doc.getSelection()) {
196
+ (_a = doc.getSelection()) === null || _a === void 0 ? void 0 : _a.empty();
197
+ }
198
+ else {
199
+ var selection = (doc.defaultView || window).getSelection();
200
+ if (selection && selection.type !== "Caret") {
201
+ selection.removeAllRanges();
202
+ }
203
+ }
204
+ };
205
+ export var addClassName = function (el, className) {
206
+ if (el.classList) {
207
+ el.classList.add(className);
208
+ }
209
+ else {
210
+ if (!el.className.match(new RegExp("(?:^|\\s)".concat(className, "(?!\\S)")))) {
211
+ el.className += " ".concat(className);
212
+ }
213
+ }
214
+ };
215
+ export var removeClassName = function (el, className) {
216
+ if (el.classList) {
217
+ el.classList.remove(className);
218
+ }
219
+ else {
220
+ el.className = el.className.replace(new RegExp("(?:^|\\s)".concat(className, "(?!\\S)"), "g"), "");
221
+ }
222
+ };
@@ -0,0 +1,5 @@
1
+ export declare function getPrefix(prop?: string): string;
2
+ export declare function browserPrefixToKey(prop: string, prefix: string): string;
3
+ export declare function browserPrefixToStyle(prop: string, prefix: string): string;
4
+ declare const _default: string;
5
+ export default _default;
@@ -0,0 +1,41 @@
1
+ var prefixes = ["Moz", "Webkit", "O", "ms"];
2
+ export function getPrefix(prop) {
3
+ var _a, _b;
4
+ if (prop === void 0) { prop = "transform"; }
5
+ if (typeof window === "undefined")
6
+ return "";
7
+ var style = (_b = (_a = window.document) === null || _a === void 0 ? void 0 : _a.documentElement) === null || _b === void 0 ? void 0 : _b.style;
8
+ if (!style)
9
+ return "";
10
+ if (prop in style)
11
+ return "";
12
+ for (var i = 0; i < prefixes.length; i++) {
13
+ if (browserPrefixToKey(prop, prefixes[i]) in style)
14
+ return prefixes[i];
15
+ }
16
+ return "";
17
+ }
18
+ export function browserPrefixToKey(prop, prefix) {
19
+ return prefix ? "".concat(prefix).concat(kebabToTitleCase(prop)) : prop;
20
+ }
21
+ export function browserPrefixToStyle(prop, prefix) {
22
+ return prefix ? "-".concat(prefix.toLowerCase(), "-").concat(prop) : prop;
23
+ }
24
+ function kebabToTitleCase(str) {
25
+ var out = "";
26
+ var shouldCapitalize = true;
27
+ for (var i = 0; i < str.length; i++) {
28
+ if (shouldCapitalize) {
29
+ out += str[i].toUpperCase();
30
+ shouldCapitalize = false;
31
+ }
32
+ else if (str[i] === "-") {
33
+ shouldCapitalize = true;
34
+ }
35
+ else {
36
+ out += str[i];
37
+ }
38
+ }
39
+ return out;
40
+ }
41
+ export default getPrefix();
@@ -0,0 +1,7 @@
1
+ import { AxisType, DraggableData, DraggableState } from "./../types";
2
+ import type { Bounds } from "./types";
3
+ export declare function snapToGrid(grid: [number, number], pendingX: number, pendingY: number): [number, number];
4
+ export declare function canDragX(axis: AxisType): boolean;
5
+ export declare function canDragY(axis: AxisType): boolean;
6
+ export declare const cloneBounds: (bounds: Bounds) => Bounds;
7
+ export declare const createDraggableData: (draggableState: DraggableState, scale: number, coreData: DraggableData) => DraggableData;
@@ -0,0 +1,32 @@
1
+ export function snapToGrid(grid, pendingX, pendingY) {
2
+ var x = Math.round(pendingX / grid[0]) * grid[0];
3
+ var y = Math.round(pendingY / grid[1]) * grid[1];
4
+ return [x, y];
5
+ }
6
+ export function canDragX(axis) {
7
+ return axis === "both" || axis === "x";
8
+ }
9
+ export function canDragY(axis) {
10
+ return axis === "both" || axis === "y";
11
+ }
12
+ export var cloneBounds = function (bounds) {
13
+ return {
14
+ left: bounds.left,
15
+ top: bounds.top,
16
+ right: bounds.right,
17
+ bottom: bounds.bottom,
18
+ };
19
+ };
20
+ export var createDraggableData = function (draggableState, scale, coreData) {
21
+ var deltaX = coreData.deltaX / scale;
22
+ var deltaY = coreData.deltaY / scale;
23
+ return {
24
+ node: coreData.node,
25
+ x: draggableState.x + deltaX,
26
+ y: draggableState.y + deltaY,
27
+ deltaX: deltaX,
28
+ deltaY: deltaY,
29
+ lastX: draggableState.x,
30
+ lastY: draggableState.y,
31
+ };
32
+ };
@@ -0,0 +1,30 @@
1
+ /// <reference types="react" />
2
+ import { DraggableData } from "../types";
3
+ export type DraggableEvent = React.MouseEvent<HTMLElement | SVGElement> | React.TouchEvent<HTMLElement | SVGElement> | MouseEvent | TouchEvent;
4
+ export type DraggableEventHandler = (e: MouseEvent, data: DraggableData, el?: HTMLElement | null) => void | false;
5
+ export type Bounds = {
6
+ left: number;
7
+ top: number;
8
+ right: number;
9
+ bottom: number;
10
+ };
11
+ export type ControlPosition = {
12
+ x: number;
13
+ y: number;
14
+ };
15
+ export type PositionOffsetControlPosition = {
16
+ x: number | string;
17
+ y: number | string;
18
+ };
19
+ export type EventHandler<T> = (e: T) => void | false;
20
+ export interface SVGElement extends HTMLElement {
21
+ }
22
+ export interface TouchEvent2 extends TouchEvent {
23
+ changedTouches: TouchList;
24
+ targetTouches: TouchList;
25
+ }
26
+ export type MouseTouchEvent = MouseEvent & TouchEvent2;
27
+ export type EventWithOffset = {
28
+ clientX: number;
29
+ clientY: number;
30
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare const findInArray: (array: Array<any> | TouchList, callback: Function) => any;
2
+ export declare const isFunction: (func: any) => boolean;
3
+ export declare const isNum: (num: any) => boolean;
4
+ export declare const int: (a: string) => number;
@@ -0,0 +1,16 @@
1
+ export var findInArray = function (array, callback) {
2
+ for (var i = 0, length_1 = array.length; i < length_1; i++) {
3
+ if (callback.apply(callback, [array[i], i, array]))
4
+ return array[i];
5
+ }
6
+ };
7
+ export var isFunction = function (func) {
8
+ return (typeof func === "function" ||
9
+ Object.prototype.toString.call(func) === "[object Function]");
10
+ };
11
+ export var isNum = function (num) {
12
+ return typeof num === "number" && !isNaN(num);
13
+ };
14
+ export var int = function (a) {
15
+ return parseInt(a, 10);
16
+ };
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import { GridItemProps } from "./types";
3
+ import { PropsWithChildren } from "../types";
4
+ declare const GridItem: ({ children, ...props }: PropsWithChildren<GridItemProps>) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
5
+ export default GridItem;