@wix/site-service-interactions 1.0.26 → 1.0.28
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/cjs/build/implementations/v2/configCss.d.ts +11 -0
- package/cjs/build/implementations/v2/configCss.js +49 -2
- package/cjs/build/implementations/v2/configCss.js.map +1 -1
- package/cjs/build/implementations/v2/motionPresets.d.ts +0 -11
- package/cjs/build/implementations/v2/motionPresets.js +1 -48
- package/cjs/build/implementations/v2/motionPresets.js.map +1 -1
- package/dist/implementations/v2/configCss.d.ts +11 -0
- package/dist/implementations/v2/configCss.js +15 -1
- package/dist/implementations/v2/configCss.js.map +1 -1
- package/dist/implementations/v2/motionPresets.d.ts +0 -11
- package/dist/implementations/v2/motionPresets.js +0 -14
- package/dist/implementations/v2/motionPresets.js.map +1 -1
- package/package.json +3 -3
- package/src/implementations/v2/configCss.ts +28 -1
- package/src/implementations/v2/motionPresets.ts +0 -27
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
import type { InteractConfig } from '@wix/interact';
|
|
2
|
+
type EffectModule = {
|
|
3
|
+
web: unknown;
|
|
4
|
+
style?: unknown;
|
|
5
|
+
getNames: unknown;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Both preset packages under one registry, mirroring what the client loader registers. The legacy
|
|
9
|
+
* names carry the prefix so a preset published by both packages doesn't shadow its counterpart.
|
|
10
|
+
*/
|
|
11
|
+
export declare const motionPresets: Record<string, EffectModule>;
|
|
2
12
|
/** Emit animation FOUC CSS and click-trigger cursor rules. */
|
|
3
13
|
export declare const getV2ConfigCss: (config: InteractConfig) => string;
|
|
14
|
+
export {};
|
|
@@ -1,12 +1,59 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getV2ConfigCss = void 0;
|
|
36
|
+
exports.getV2ConfigCss = exports.motionPresets = void 0;
|
|
37
|
+
const allLegacyPresets = __importStar(require("@wix/wix-motion-presets"));
|
|
38
|
+
const allPresets = __importStar(require("@wix/motion-presets"));
|
|
4
39
|
const interact_1 = require("@wix/interact");
|
|
5
40
|
const clickTriggerCss_1 = require("./clickTriggerCss");
|
|
6
41
|
const motionPresets_1 = require("./motionPresets");
|
|
42
|
+
const isEffectModule = (value) => typeof value === 'object' && value !== null && 'web' in value && 'getNames' in value;
|
|
43
|
+
const getPresetModules = (namespace, prefix = '') => Object.fromEntries(Object.entries(namespace)
|
|
44
|
+
.filter(([, value]) => isEffectModule(value))
|
|
45
|
+
.map(([name, value]) => [`${prefix}${name}`, value]));
|
|
46
|
+
/**
|
|
47
|
+
* Both preset packages under one registry, mirroring what the client loader registers. The legacy
|
|
48
|
+
* names carry the prefix so a preset published by both packages doesn't shadow its counterpart.
|
|
49
|
+
*/
|
|
50
|
+
exports.motionPresets = {
|
|
51
|
+
...getPresetModules(allPresets),
|
|
52
|
+
...getPresetModules(allLegacyPresets, motionPresets_1.LEGACY_PREFIX),
|
|
53
|
+
};
|
|
7
54
|
// Interact's registry is process-global. This module is only pulled into the server bundle
|
|
8
55
|
// (`process.env.browser` DCE), so both namespaces are registered once per Node process.
|
|
9
|
-
interact_1.Interact.registerEffects(
|
|
56
|
+
interact_1.Interact.registerEffects(exports.motionPresets);
|
|
10
57
|
/** Emit animation FOUC CSS and click-trigger cursor rules. */
|
|
11
58
|
const getV2ConfigCss = (config) => {
|
|
12
59
|
const animationCss = (0, interact_1.generate)(config, true).trim();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configCss.js","sourceRoot":"","sources":["../../../../src/implementations/v2/configCss.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"configCss.js","sourceRoot":"","sources":["../../../../src/implementations/v2/configCss.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,MAAY,gBAAgB,oDAA+B;AAC3D,MAAY,UAAU,gDAA2B;AACjD,4CAAkD;AAElD,uDAAsD;AACtD,mDAA+C;AAU/C,MAAM,cAAc,GAAG,CAAC,KAAc,EAAyB,EAAE,CAChE,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,IAAI,KAAK,IAAI,UAAU,IAAI,KAAK,CAAA;AAErF,MAAM,gBAAgB,GAAG,CAAC,SAAiB,EAAE,MAAM,GAAW,EAAE,EAAgC,EAAE,CACjG,MAAM,CAAC,WAAW,CACjB,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;KACvB,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;KAC5C,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,MAAM,GAAG,IAAI,EAAE,EAAE,KAAqB,CAAC,CAAC,CACrE,CAAA;AAEF;;;GAGG;AACU,QAAA,aAAa,GAAiC;IAC1D,GAAG,gBAAgB,CAAC,UAAU,CAAC;IAC/B,GAAG,gBAAgB,CAAC,gBAAgB,EAAE,6BAAa,CAAC;CACpD,CAAA;AAED,2FAA2F;AAC3F,wFAAwF;AACxF,mBAAQ,CAAC,eAAe,CAAC,QAAA,aAA0C,CAAC,CAAA;AAEpE,8DAA8D;AACvD,MAAM,cAAc,GAAG,CAAC,MAAsB,EAAU,EAAE;IAChE,MAAM,YAAY,GAAG,IAAA,mBAAQ,EAAC,MAAM,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,CAAA;IAClD,MAAM,QAAQ,GAAG,IAAA,oCAAkB,EAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAA;IAElD,OAAO,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC3D,CAAC,CAAA;AALY,QAAA,cAAc,GAAd,cAAc,CAK1B"}
|
|
@@ -1,14 +1,3 @@
|
|
|
1
1
|
import type { InteractConfig } from '@wix/interact';
|
|
2
|
-
type EffectModule = {
|
|
3
|
-
web: unknown;
|
|
4
|
-
style?: unknown;
|
|
5
|
-
getNames: unknown;
|
|
6
|
-
};
|
|
7
2
|
export declare const LEGACY_PREFIX = "LEGACY_";
|
|
8
|
-
/**
|
|
9
|
-
* Both preset packages under one registry, mirroring what the client loader registers. The legacy
|
|
10
|
-
* names carry the prefix so a preset published by both packages doesn't shadow its counterpart.
|
|
11
|
-
*/
|
|
12
|
-
export declare const motionPresets: Record<string, EffectModule>;
|
|
13
3
|
export declare const aliasLegacyNamedEffects: (interact: InteractConfig) => InteractConfig;
|
|
14
|
-
export {};
|
|
@@ -1,54 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.aliasLegacyNamedEffects = exports.
|
|
37
|
-
const allLegacyPresets = __importStar(require("@wix/wix-motion-presets"));
|
|
38
|
-
const allPresets = __importStar(require("@wix/motion-presets"));
|
|
3
|
+
exports.aliasLegacyNamedEffects = exports.LEGACY_PREFIX = void 0;
|
|
39
4
|
exports.LEGACY_PREFIX = 'LEGACY_';
|
|
40
|
-
const isEffectModule = (value) => typeof value === 'object' && value !== null && 'web' in value && 'getNames' in value;
|
|
41
|
-
const getPresetModules = (namespace, prefix = '') => Object.fromEntries(Object.entries(namespace)
|
|
42
|
-
.filter(([, value]) => isEffectModule(value))
|
|
43
|
-
.map(([name, value]) => [`${prefix}${name}`, value]));
|
|
44
|
-
/**
|
|
45
|
-
* Both preset packages under one registry, mirroring what the client loader registers. The legacy
|
|
46
|
-
* names carry the prefix so a preset published by both packages doesn't shadow its counterpart.
|
|
47
|
-
*/
|
|
48
|
-
exports.motionPresets = {
|
|
49
|
-
...getPresetModules(allPresets),
|
|
50
|
-
...getPresetModules(allLegacyPresets, exports.LEGACY_PREFIX),
|
|
51
|
-
};
|
|
52
5
|
const aliasEffect = (effect) => {
|
|
53
6
|
const { namedEffect } = effect;
|
|
54
7
|
if (!namedEffect?.type) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"motionPresets.js","sourceRoot":"","sources":["../../../../src/implementations/v2/motionPresets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"motionPresets.js","sourceRoot":"","sources":["../../../../src/implementations/v2/motionPresets.ts"],"names":[],"mappings":";;;AAIa,QAAA,aAAa,GAAG,SAAS,CAAA;AAEtC,MAAM,WAAW,GAAG,CAAmB,MAAS,EAAK,EAAE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AC,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;QACzD,GAAG,WAAW;QACd,GAAG,CAAC,WAAW,CAAC,OAAO,IAAI,EAAE,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;QAC7E,GAAG,CAAC,WAAW,CAAC,SAAS,IAAI,EAAE,SAAS,EAAE,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;KACrF,CAAC,CAAC;CACH,CAAC,CAAA;AATW,QAAA,uBAAuB,GAAvB,uBAAuB,CASlC"}
|
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
import type { InteractConfig } from '@wix/interact';
|
|
2
|
+
type EffectModule = {
|
|
3
|
+
web: unknown;
|
|
4
|
+
style?: unknown;
|
|
5
|
+
getNames: unknown;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Both preset packages under one registry, mirroring what the client loader registers. The legacy
|
|
9
|
+
* names carry the prefix so a preset published by both packages doesn't shadow its counterpart.
|
|
10
|
+
*/
|
|
11
|
+
export declare const motionPresets: Record<string, EffectModule>;
|
|
2
12
|
/** Emit animation FOUC CSS and click-trigger cursor rules. */
|
|
3
13
|
export declare const getV2ConfigCss: (config: InteractConfig) => string;
|
|
14
|
+
export {};
|
|
@@ -1,6 +1,20 @@
|
|
|
1
|
+
import * as allLegacyPresets from '@wix/wix-motion-presets';
|
|
2
|
+
import * as allPresets from '@wix/motion-presets';
|
|
1
3
|
import { generate, Interact } from '@wix/interact';
|
|
2
4
|
import { getClickTriggerCss } from './clickTriggerCss';
|
|
3
|
-
import {
|
|
5
|
+
import { LEGACY_PREFIX } from './motionPresets';
|
|
6
|
+
const isEffectModule = (value) => typeof value === 'object' && value !== null && 'web' in value && 'getNames' in value;
|
|
7
|
+
const getPresetModules = (namespace, prefix = '') => Object.fromEntries(Object.entries(namespace)
|
|
8
|
+
.filter(([, value]) => isEffectModule(value))
|
|
9
|
+
.map(([name, value]) => [`${prefix}${name}`, value]));
|
|
10
|
+
/**
|
|
11
|
+
* Both preset packages under one registry, mirroring what the client loader registers. The legacy
|
|
12
|
+
* names carry the prefix so a preset published by both packages doesn't shadow its counterpart.
|
|
13
|
+
*/
|
|
14
|
+
export const motionPresets = {
|
|
15
|
+
...getPresetModules(allPresets),
|
|
16
|
+
...getPresetModules(allLegacyPresets, LEGACY_PREFIX),
|
|
17
|
+
};
|
|
4
18
|
// Interact's registry is process-global. This module is only pulled into the server bundle
|
|
5
19
|
// (`process.env.browser` DCE), so both namespaces are registered once per Node process.
|
|
6
20
|
Interact.registerEffects(motionPresets);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configCss.js","sourceRoot":"","sources":["../../../src/implementations/v2/configCss.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"configCss.js","sourceRoot":"","sources":["../../../src/implementations/v2/configCss.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAA;AAC3D,OAAO,KAAK,UAAU,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAU/C,MAAM,cAAc,GAAG,CAAC,KAAc,EAAyB,EAAE,CAChE,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,KAAK,IAAI,KAAK,IAAI,UAAU,IAAI,KAAK,CAAA;AAErF,MAAM,gBAAgB,GAAG,CAAC,SAAiB,EAAE,MAAM,GAAW,EAAE,EAAgC,EAAE,CACjG,MAAM,CAAC,WAAW,CACjB,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC;KACvB,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;KAC5C,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,MAAM,GAAG,IAAI,EAAE,EAAE,KAAqB,CAAC,CAAC,CACrE,CAAA;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAiC;IAC1D,GAAG,gBAAgB,CAAC,UAAU,CAAC;IAC/B,GAAG,gBAAgB,CAAC,gBAAgB,EAAE,aAAa,CAAC;CACpD,CAAA;AAED,2FAA2F;AAC3F,wFAAwF;AACxF,QAAQ,CAAC,eAAe,CAAC,aAA0C,CAAC,CAAA;AAEpE,8DAA8D;AAC9D,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAsB,EAAU,EAAE;IAChE,MAAM,YAAY,GAAG,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,CAAA;IAClD,MAAM,QAAQ,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAA;IAElD,OAAO,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC3D,CAAC,CAAA"}
|
|
@@ -1,14 +1,3 @@
|
|
|
1
1
|
import type { InteractConfig } from '@wix/interact';
|
|
2
|
-
type EffectModule = {
|
|
3
|
-
web: unknown;
|
|
4
|
-
style?: unknown;
|
|
5
|
-
getNames: unknown;
|
|
6
|
-
};
|
|
7
2
|
export declare const LEGACY_PREFIX = "LEGACY_";
|
|
8
|
-
/**
|
|
9
|
-
* Both preset packages under one registry, mirroring what the client loader registers. The legacy
|
|
10
|
-
* names carry the prefix so a preset published by both packages doesn't shadow its counterpart.
|
|
11
|
-
*/
|
|
12
|
-
export declare const motionPresets: Record<string, EffectModule>;
|
|
13
3
|
export declare const aliasLegacyNamedEffects: (interact: InteractConfig) => InteractConfig;
|
|
14
|
-
export {};
|
|
@@ -1,18 +1,4 @@
|
|
|
1
|
-
import * as allLegacyPresets from '@wix/wix-motion-presets';
|
|
2
|
-
import * as allPresets from '@wix/motion-presets';
|
|
3
1
|
export const LEGACY_PREFIX = 'LEGACY_';
|
|
4
|
-
const isEffectModule = (value) => typeof value === 'object' && value !== null && 'web' in value && 'getNames' in value;
|
|
5
|
-
const getPresetModules = (namespace, prefix = '') => Object.fromEntries(Object.entries(namespace)
|
|
6
|
-
.filter(([, value]) => isEffectModule(value))
|
|
7
|
-
.map(([name, value]) => [`${prefix}${name}`, value]));
|
|
8
|
-
/**
|
|
9
|
-
* Both preset packages under one registry, mirroring what the client loader registers. The legacy
|
|
10
|
-
* names carry the prefix so a preset published by both packages doesn't shadow its counterpart.
|
|
11
|
-
*/
|
|
12
|
-
export const motionPresets = {
|
|
13
|
-
...getPresetModules(allPresets),
|
|
14
|
-
...getPresetModules(allLegacyPresets, LEGACY_PREFIX),
|
|
15
|
-
};
|
|
16
2
|
const aliasEffect = (effect) => {
|
|
17
3
|
const { namedEffect } = effect;
|
|
18
4
|
if (!namedEffect?.type) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"motionPresets.js","sourceRoot":"","sources":["../../../src/implementations/v2/motionPresets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"motionPresets.js","sourceRoot":"","sources":["../../../src/implementations/v2/motionPresets.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAA;AAEtC,MAAM,WAAW,GAAG,CAAmB,MAAS,EAAK,EAAE;IACtD,MAAM,EAAE,WAAW,EAAE,GAAG,MAAuC,CAAA;IAC/D,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC;QACx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,EAAE,OAAO,EAAE,WAAW,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE,CAAC;QAC7E,GAAG,CAAC,WAAW,CAAC,SAAS,IAAI,EAAE,SAAS,EAAE,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,aAAa,CAAC,EAAE,CAAC;KACrF,CAAC,CAAC;CACH,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wix/site-service-interactions",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.28",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@wix/site-service-device-info": "1.0.8",
|
|
65
65
|
"@wix/site-service-experiments": "1.0.8",
|
|
66
66
|
"@wix/site-service-head-appender": "1.0.7",
|
|
67
|
-
"@wix/site-service-provide-css": "1.0.
|
|
67
|
+
"@wix/site-service-provide-css": "1.0.8",
|
|
68
68
|
"@wix/static-service": "1.0.22",
|
|
69
69
|
"@wix/viewer-service-pages": "1.0.18",
|
|
70
70
|
"@wix/wix-motion-presets": "1.3.0"
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
]
|
|
98
98
|
}
|
|
99
99
|
},
|
|
100
|
-
"falconPackageHash": "
|
|
100
|
+
"falconPackageHash": "c69fe8dce710010e3e2de527cc1be507d28dc3eb36dfd4d839ec2e62"
|
|
101
101
|
}
|
|
@@ -1,10 +1,37 @@
|
|
|
1
|
+
import * as allLegacyPresets from '@wix/wix-motion-presets'
|
|
2
|
+
import * as allPresets from '@wix/motion-presets'
|
|
1
3
|
import { generate, Interact } from '@wix/interact'
|
|
2
4
|
import type { InteractConfig } from '@wix/interact'
|
|
3
5
|
import { getClickTriggerCss } from './clickTriggerCss'
|
|
4
|
-
import {
|
|
6
|
+
import { LEGACY_PREFIX } from './motionPresets'
|
|
5
7
|
|
|
6
8
|
type PresetRegistry = Parameters<typeof Interact.registerEffects>[0]
|
|
7
9
|
|
|
10
|
+
type EffectModule = {
|
|
11
|
+
web: unknown
|
|
12
|
+
style?: unknown
|
|
13
|
+
getNames: unknown
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const isEffectModule = (value: unknown): value is EffectModule =>
|
|
17
|
+
typeof value === 'object' && value !== null && 'web' in value && 'getNames' in value
|
|
18
|
+
|
|
19
|
+
const getPresetModules = (namespace: object, prefix: string = ''): Record<string, EffectModule> =>
|
|
20
|
+
Object.fromEntries(
|
|
21
|
+
Object.entries(namespace)
|
|
22
|
+
.filter(([, value]) => isEffectModule(value))
|
|
23
|
+
.map(([name, value]) => [`${prefix}${name}`, value as EffectModule])
|
|
24
|
+
)
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Both preset packages under one registry, mirroring what the client loader registers. The legacy
|
|
28
|
+
* names carry the prefix so a preset published by both packages doesn't shadow its counterpart.
|
|
29
|
+
*/
|
|
30
|
+
export const motionPresets: Record<string, EffectModule> = {
|
|
31
|
+
...getPresetModules(allPresets),
|
|
32
|
+
...getPresetModules(allLegacyPresets, LEGACY_PREFIX),
|
|
33
|
+
}
|
|
34
|
+
|
|
8
35
|
// Interact's registry is process-global. This module is only pulled into the server bundle
|
|
9
36
|
// (`process.env.browser` DCE), so both namespaces are registered once per Node process.
|
|
10
37
|
Interact.registerEffects(motionPresets as unknown as PresetRegistry)
|
|
@@ -1,36 +1,9 @@
|
|
|
1
|
-
import * as allLegacyPresets from '@wix/wix-motion-presets'
|
|
2
|
-
import * as allPresets from '@wix/motion-presets'
|
|
3
1
|
import type { Effect, EffectRef, InteractConfig } from '@wix/interact'
|
|
4
2
|
|
|
5
|
-
type EffectModule = {
|
|
6
|
-
web: unknown
|
|
7
|
-
style?: unknown
|
|
8
|
-
getNames: unknown
|
|
9
|
-
}
|
|
10
|
-
|
|
11
3
|
type NamedEffect = { type: string } & Record<string, unknown>
|
|
12
4
|
|
|
13
5
|
export const LEGACY_PREFIX = 'LEGACY_'
|
|
14
6
|
|
|
15
|
-
const isEffectModule = (value: unknown): value is EffectModule =>
|
|
16
|
-
typeof value === 'object' && value !== null && 'web' in value && 'getNames' in value
|
|
17
|
-
|
|
18
|
-
const getPresetModules = (namespace: object, prefix: string = ''): Record<string, EffectModule> =>
|
|
19
|
-
Object.fromEntries(
|
|
20
|
-
Object.entries(namespace)
|
|
21
|
-
.filter(([, value]) => isEffectModule(value))
|
|
22
|
-
.map(([name, value]) => [`${prefix}${name}`, value as EffectModule])
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Both preset packages under one registry, mirroring what the client loader registers. The legacy
|
|
27
|
-
* names carry the prefix so a preset published by both packages doesn't shadow its counterpart.
|
|
28
|
-
*/
|
|
29
|
-
export const motionPresets: Record<string, EffectModule> = {
|
|
30
|
-
...getPresetModules(allPresets),
|
|
31
|
-
...getPresetModules(allLegacyPresets, LEGACY_PREFIX),
|
|
32
|
-
}
|
|
33
|
-
|
|
34
7
|
const aliasEffect = <T extends object>(effect: T): T => {
|
|
35
8
|
const { namedEffect } = effect as { namedEffect?: NamedEffect }
|
|
36
9
|
if (!namedEffect?.type) {
|