@gravity-ui/page-constructor 2.1.1 → 2.2.1-alpha.0
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/CHANGELOG.md +14 -0
- package/build/cjs/blocks/index.d.ts +0 -2
- package/build/cjs/blocks/index.js +1 -5
- package/build/cjs/blocks/validators.d.ts +0 -2
- package/build/cjs/blocks/validators.js +0 -2
- package/build/cjs/components/HTML/HTML.d.ts +1 -1
- package/build/cjs/components/ReactPlayer/ReactPlayer.js +3 -1
- package/build/cjs/components/ReactPlayer/utils.d.ts +1 -0
- package/build/cjs/components/ReactPlayer/utils.js +24 -0
- package/build/cjs/constructor-items.d.ts +0 -6
- package/build/cjs/constructor-items.js +0 -6
- package/build/cjs/hooks/index.d.ts +0 -1
- package/build/cjs/hooks/index.js +1 -3
- package/build/cjs/models/constructor-items/blocks.d.ts +2 -23
- package/build/cjs/models/constructor-items/blocks.js +0 -2
- package/build/cjs/models/constructor-items/common.d.ts +0 -14
- package/build/cjs/models/constructor-items/common.js +1 -6
- package/build/cjs/models/constructor-items/sub-blocks.d.ts +9 -25
- package/build/cjs/models/constructor-items/sub-blocks.js +6 -7
- package/build/cjs/schema/index.js +2 -4
- package/build/cjs/schema/validators/blocks.d.ts +0 -2
- package/build/cjs/schema/validators/blocks.js +0 -2
- package/build/cjs/schema/validators/sub-blocks.d.ts +0 -1
- package/build/cjs/schema/validators/sub-blocks.js +0 -1
- package/build/cjs/sub-blocks/HubspotForm/HubspotForm.css +0 -1
- package/build/cjs/sub-blocks/index.d.ts +0 -1
- package/build/cjs/sub-blocks/index.js +1 -3
- package/build/cjs/text-transform/blocks.js +0 -32
- package/build/cjs/utils/index.d.ts +0 -1
- package/build/cjs/utils/index.js +0 -1
- package/build/esm/blocks/index.d.ts +0 -2
- package/build/esm/blocks/index.js +0 -2
- package/build/esm/blocks/validators.d.ts +0 -2
- package/build/esm/blocks/validators.js +0 -2
- package/build/esm/components/HTML/HTML.d.ts +1 -1
- package/build/esm/components/ReactPlayer/ReactPlayer.js +3 -1
- package/build/esm/components/ReactPlayer/utils.d.ts +1 -0
- package/build/esm/components/ReactPlayer/utils.js +20 -0
- package/build/esm/constructor-items.d.ts +0 -6
- package/build/esm/constructor-items.js +2 -8
- package/build/esm/hooks/index.d.ts +0 -1
- package/build/esm/hooks/index.js +0 -1
- package/build/esm/models/constructor-items/blocks.d.ts +2 -23
- package/build/esm/models/constructor-items/blocks.js +0 -2
- package/build/esm/models/constructor-items/common.d.ts +0 -14
- package/build/esm/models/constructor-items/common.js +0 -5
- package/build/esm/models/constructor-items/sub-blocks.d.ts +9 -25
- package/build/esm/models/constructor-items/sub-blocks.js +6 -7
- package/build/esm/schema/index.js +4 -6
- package/build/esm/schema/validators/blocks.d.ts +0 -2
- package/build/esm/schema/validators/blocks.js +0 -2
- package/build/esm/schema/validators/sub-blocks.d.ts +0 -1
- package/build/esm/schema/validators/sub-blocks.js +0 -1
- package/build/esm/sub-blocks/HubspotForm/HubspotForm.css +0 -1
- package/build/esm/sub-blocks/index.d.ts +0 -1
- package/build/esm/sub-blocks/index.js +0 -1
- package/build/esm/text-transform/blocks.js +0 -32
- package/build/esm/utils/index.d.ts +0 -1
- package/build/esm/utils/index.js +0 -1
- package/package.json +5 -2
- package/server/models/constructor-items/blocks.d.ts +2 -23
- package/server/models/constructor-items/blocks.js +0 -2
- package/server/models/constructor-items/common.d.ts +0 -14
- package/server/models/constructor-items/common.js +1 -6
- package/server/models/constructor-items/sub-blocks.d.ts +9 -25
- package/server/models/constructor-items/sub-blocks.js +6 -7
- package/server/text-transform/blocks.js +0 -32
- package/server/utils/index.d.ts +0 -1
- package/server/utils/index.js +0 -1
- package/build/cjs/blocks/Preview/MediaContent/MediaContent.css +0 -50
- package/build/cjs/blocks/Preview/MediaContent/MediaContent.d.ts +0 -13
- package/build/cjs/blocks/Preview/MediaContent/MediaContent.js +0 -49
- package/build/cjs/blocks/Preview/MediaContent/PreviewContent.css +0 -106
- package/build/cjs/blocks/Preview/MediaContent/PreviewContent.d.ts +0 -11
- package/build/cjs/blocks/Preview/MediaContent/PreviewContent.js +0 -17
- package/build/cjs/blocks/Preview/MediaContent/PreviewMedia.css +0 -54
- package/build/cjs/blocks/Preview/MediaContent/PreviewMedia.d.ts +0 -9
- package/build/cjs/blocks/Preview/MediaContent/PreviewMedia.js +0 -13
- package/build/cjs/blocks/Preview/Preview.css +0 -50
- package/build/cjs/blocks/Preview/Preview.d.ts +0 -3
- package/build/cjs/blocks/Preview/Preview.js +0 -130
- package/build/cjs/blocks/Preview/schema.d.ts +0 -40
- package/build/cjs/blocks/Preview/schema.js +0 -53
- package/build/cjs/blocks/Simple/Simple.css +0 -22
- package/build/cjs/blocks/Simple/Simple.d.ts +0 -3
- package/build/cjs/blocks/Simple/Simple.js +0 -22
- package/build/cjs/blocks/Simple/schema.d.ts +0 -68
- package/build/cjs/blocks/Simple/schema.js +0 -14
- package/build/cjs/context/breakpointContext/breakpointContext.d.ts +0 -2
- package/build/cjs/context/breakpointContext/breakpointContext.js +0 -7
- package/build/cjs/context/breakpointContext/index.d.ts +0 -1
- package/build/cjs/context/breakpointContext/index.js +0 -4
- package/build/cjs/hooks/useIntersection.d.ts +0 -1
- package/build/cjs/hooks/useIntersection.js +0 -21
- package/build/cjs/sub-blocks/CardWithImage/CardWithImage.css +0 -19
- package/build/cjs/sub-blocks/CardWithImage/CardWithImage.d.ts +0 -3
- package/build/cjs/sub-blocks/CardWithImage/CardWithImage.js +0 -16
- package/build/cjs/sub-blocks/CardWithImage/schema.d.ts +0 -154
- package/build/cjs/sub-blocks/CardWithImage/schema.js +0 -46
- package/build/cjs/utils/scroll.d.ts +0 -15
- package/build/cjs/utils/scroll.js +0 -34
- package/build/esm/blocks/Preview/MediaContent/MediaContent.css +0 -50
- package/build/esm/blocks/Preview/MediaContent/MediaContent.d.ts +0 -14
- package/build/esm/blocks/Preview/MediaContent/MediaContent.js +0 -47
- package/build/esm/blocks/Preview/MediaContent/PreviewContent.css +0 -106
- package/build/esm/blocks/Preview/MediaContent/PreviewContent.d.ts +0 -12
- package/build/esm/blocks/Preview/MediaContent/PreviewContent.js +0 -15
- package/build/esm/blocks/Preview/MediaContent/PreviewMedia.css +0 -54
- package/build/esm/blocks/Preview/MediaContent/PreviewMedia.d.ts +0 -10
- package/build/esm/blocks/Preview/MediaContent/PreviewMedia.js +0 -11
- package/build/esm/blocks/Preview/Preview.css +0 -50
- package/build/esm/blocks/Preview/Preview.d.ts +0 -4
- package/build/esm/blocks/Preview/Preview.js +0 -126
- package/build/esm/blocks/Preview/schema.d.ts +0 -40
- package/build/esm/blocks/Preview/schema.js +0 -50
- package/build/esm/blocks/Simple/Simple.css +0 -22
- package/build/esm/blocks/Simple/Simple.d.ts +0 -4
- package/build/esm/blocks/Simple/Simple.js +0 -18
- package/build/esm/blocks/Simple/schema.d.ts +0 -68
- package/build/esm/blocks/Simple/schema.js +0 -11
- package/build/esm/context/breakpointContext/breakpointContext.d.ts +0 -2
- package/build/esm/context/breakpointContext/breakpointContext.js +0 -3
- package/build/esm/context/breakpointContext/index.d.ts +0 -1
- package/build/esm/context/breakpointContext/index.js +0 -1
- package/build/esm/hooks/useIntersection.d.ts +0 -1
- package/build/esm/hooks/useIntersection.js +0 -17
- package/build/esm/sub-blocks/CardWithImage/CardWithImage.css +0 -19
- package/build/esm/sub-blocks/CardWithImage/CardWithImage.d.ts +0 -4
- package/build/esm/sub-blocks/CardWithImage/CardWithImage.js +0 -14
- package/build/esm/sub-blocks/CardWithImage/schema.d.ts +0 -154
- package/build/esm/sub-blocks/CardWithImage/schema.js +0 -43
- package/build/esm/utils/scroll.d.ts +0 -15
- package/build/esm/utils/scroll.js +0 -30
- package/server/utils/scroll.d.ts +0 -15
- package/server/utils/scroll.js +0 -34
package/server/utils/scroll.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare enum ScrollDirection {
|
|
2
|
-
HORIZONTAL = "scrollLeft",
|
|
3
|
-
VERTICAL = "scrollTop"
|
|
4
|
-
}
|
|
5
|
-
export interface ScrollReverseParams {
|
|
6
|
-
distance?: number;
|
|
7
|
-
}
|
|
8
|
-
export interface ScrollOptions {
|
|
9
|
-
distance: number;
|
|
10
|
-
timeSeconds: number;
|
|
11
|
-
speed: number;
|
|
12
|
-
direction?: ScrollDirection;
|
|
13
|
-
reverseParams?: ScrollReverseParams;
|
|
14
|
-
}
|
|
15
|
-
export declare function doSmoothScroll(element: HTMLDivElement, startPosition: number, scrollOptions: ScrollOptions): void;
|
package/server/utils/scroll.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.doSmoothScroll = exports.ScrollDirection = void 0;
|
|
4
|
-
var ScrollDirection;
|
|
5
|
-
(function (ScrollDirection) {
|
|
6
|
-
ScrollDirection["HORIZONTAL"] = "scrollLeft";
|
|
7
|
-
ScrollDirection["VERTICAL"] = "scrollTop";
|
|
8
|
-
})(ScrollDirection = exports.ScrollDirection || (exports.ScrollDirection = {}));
|
|
9
|
-
function doSmoothScroll(element, startPosition, scrollOptions) {
|
|
10
|
-
const { distance, timeSeconds, speed, direction = ScrollDirection.HORIZONTAL, reverseParams, } = scrollOptions;
|
|
11
|
-
let scrollShift = 0;
|
|
12
|
-
let currentTimeChanges = 0;
|
|
13
|
-
const changeScrollFunction = getChangeScrollFunction(direction, Boolean(reverseParams));
|
|
14
|
-
const scrollDistance = (reverseParams === null || reverseParams === void 0 ? void 0 : reverseParams.distance) || distance;
|
|
15
|
-
const timeChanges = getTimeChanges(scrollDistance, timeSeconds, speed);
|
|
16
|
-
while (scrollShift < scrollDistance) {
|
|
17
|
-
window.setTimeout(changeScrollFunction, currentTimeChanges, element, scrollShift, startPosition);
|
|
18
|
-
currentTimeChanges += timeChanges;
|
|
19
|
-
scrollShift++;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
exports.doSmoothScroll = doSmoothScroll;
|
|
23
|
-
function getChangeScrollFunction(direction, isReverse) {
|
|
24
|
-
return (element, scrollPosition, startPosition) => {
|
|
25
|
-
element[direction] = isReverse
|
|
26
|
-
? startPosition - scrollPosition
|
|
27
|
-
: startPosition + scrollPosition;
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
function getTimeChanges(distance, timeSeconds, acceleration) {
|
|
31
|
-
const physicalSpeed = distance / timeSeconds;
|
|
32
|
-
const programSpeedMilliseconds = (1 / physicalSpeed) * 1000;
|
|
33
|
-
return programSpeedMilliseconds / acceleration;
|
|
34
|
-
}
|