Comparing version 2.7.3 to 2.8.0
@@ -8,3 +8,3 @@ import * as React from 'react'; | ||
children?: React.ReactNode; | ||
}): JSX.Element; | ||
}): React.JSX.Element; | ||
export {}; |
import * as React from 'react'; | ||
import type { MotionEndEventHandler, MotionEventHandler, MotionPrepareEventHandler, MotionStatus } from './interface'; | ||
export declare type CSSMotionConfig = boolean | { | ||
export type CSSMotionConfig = boolean | { | ||
transitionSupport?: boolean; | ||
@@ -8,3 +8,3 @@ /** @deprecated, no need this anymore since `rc-motion` only support latest react */ | ||
}; | ||
export declare type MotionName = string | { | ||
export type MotionName = string | { | ||
appear?: string; | ||
@@ -11,0 +11,0 @@ enter?: string; |
@@ -15,5 +15,5 @@ import _extends from "@babel/runtime/helpers/esm/extends"; | ||
import OriginCSSMotion from "./CSSMotion"; | ||
import { diffKeys, parseKeys, STATUS_ADD, STATUS_KEEP, STATUS_REMOVE, STATUS_REMOVED } from "./util/diff"; | ||
import { supportTransition } from "./util/motion"; | ||
import { STATUS_ADD, STATUS_KEEP, STATUS_REMOVE, STATUS_REMOVED, diffKeys, parseKeys } from "./util/diff"; | ||
var MOTION_PROP_NAMES = ['eventProps', 'visible', 'children', 'motionName', 'motionAppear', 'motionEnter', 'motionLeave', 'motionLeaveImmediately', 'motionDeadline', 'removeOnLeave', 'leavedClassName', 'onAppearStart', 'onAppearActive', 'onAppearEnd', 'onEnterStart', 'onEnterActive', 'onEnterEnd', 'onLeaveStart', 'onLeaveActive', 'onLeaveEnd']; | ||
var MOTION_PROP_NAMES = ['eventProps', 'visible', 'children', 'motionName', 'motionAppear', 'motionEnter', 'motionLeave', 'motionLeaveImmediately', 'motionDeadline', 'removeOnLeave', 'leavedClassName', 'onAppearPrepare', 'onAppearStart', 'onAppearActive', 'onAppearEnd', 'onEnterStart', 'onEnterActive', 'onEnterEnd', 'onLeaveStart', 'onLeaveActive', 'onLeaveEnd']; | ||
/** | ||
@@ -39,2 +39,3 @@ * Generate a CSSMotionList component with config | ||
}); | ||
// ZombieJ: Return the count of rest keys. It's safe to refactor if need more info. | ||
_defineProperty(_assertThisInitialized(_this), "removeKey", function (removeKey) { | ||
@@ -120,4 +121,2 @@ var keyEntities = _this.state.keyEntities; | ||
} | ||
// ZombieJ: Return the count of rest keys. It's safe to refactor if need more info. | ||
}]); | ||
@@ -124,0 +123,0 @@ return CSSMotionList; |
@@ -0,3 +1,3 @@ | ||
import canUseDom from "rc-util/es/Dom/canUseDom"; | ||
import { useEffect, useLayoutEffect } from 'react'; | ||
import canUseDom from "rc-util/es/Dom/canUseDom"; | ||
@@ -4,0 +4,0 @@ // It's safe to use `useLayoutEffect` but the warning is annoying |
@@ -0,3 +1,3 @@ | ||
import raf from "rc-util/es/raf"; | ||
import * as React from 'react'; | ||
import raf from "rc-util/es/raf"; | ||
export default (function () { | ||
@@ -4,0 +4,0 @@ var nextFrameRef = React.useRef(null); |
@@ -0,6 +1,6 @@ | ||
import type { CSSMotionProps } from './CSSMotion'; | ||
import CSSMotion from './CSSMotion'; | ||
import type { CSSMotionListProps } from './CSSMotionList'; | ||
import CSSMotionList from './CSSMotionList'; | ||
import type { CSSMotionProps } from './CSSMotion'; | ||
import type { CSSMotionListProps } from './CSSMotionList'; | ||
import type { MotionEventHandler, MotionEndEventHandler } from './interface'; | ||
import type { MotionEndEventHandler, MotionEventHandler } from './interface'; | ||
export { default as Provider } from './context'; | ||
@@ -7,0 +7,0 @@ export { CSSMotionList }; |
@@ -6,3 +6,3 @@ /// <reference types="react" /> | ||
export declare const STATUS_LEAVE: "leave"; | ||
export declare type MotionStatus = typeof STATUS_NONE | typeof STATUS_APPEAR | typeof STATUS_ENTER | typeof STATUS_LEAVE; | ||
export type MotionStatus = typeof STATUS_NONE | typeof STATUS_APPEAR | typeof STATUS_ENTER | typeof STATUS_LEAVE; | ||
export declare const STEP_NONE: "none"; | ||
@@ -18,8 +18,8 @@ export declare const STEP_PREPARE: "prepare"; | ||
export declare const STEP_PREPARED: "prepared"; | ||
export declare type StepStatus = typeof STEP_NONE | typeof STEP_PREPARE | typeof STEP_START | typeof STEP_ACTIVE | typeof STEP_ACTIVATED | typeof STEP_PREPARED; | ||
export declare type MotionEvent = (TransitionEvent | AnimationEvent) & { | ||
export type StepStatus = typeof STEP_NONE | typeof STEP_PREPARE | typeof STEP_START | typeof STEP_ACTIVE | typeof STEP_ACTIVATED | typeof STEP_PREPARED; | ||
export type MotionEvent = (TransitionEvent | AnimationEvent) & { | ||
deadline?: boolean; | ||
}; | ||
export declare type MotionPrepareEventHandler = (element: HTMLElement) => Promise<any> | void; | ||
export declare type MotionEventHandler = (element: HTMLElement, event: MotionEvent) => React.CSSProperties | void; | ||
export declare type MotionEndEventHandler = (element: HTMLElement, event: MotionEvent) => boolean | void; | ||
export type MotionPrepareEventHandler = (element: HTMLElement) => Promise<any> | void; | ||
export type MotionEventHandler = (element: HTMLElement, event: MotionEvent) => React.CSSProperties | void; | ||
export type MotionEndEventHandler = (element: HTMLElement, event: MotionEvent) => boolean | void; |
@@ -6,3 +6,3 @@ /// <reference types="react" /> | ||
export declare const STATUS_REMOVED: "removed"; | ||
export declare type DiffStatus = typeof STATUS_ADD | typeof STATUS_KEEP | typeof STATUS_REMOVE | typeof STATUS_REMOVED; | ||
export type DiffStatus = typeof STATUS_ADD | typeof STATUS_KEEP | typeof STATUS_REMOVE | typeof STATUS_REMOVED; | ||
export interface KeyObject { | ||
@@ -9,0 +9,0 @@ key: React.Key; |
@@ -8,3 +8,3 @@ import * as React from 'react'; | ||
children?: React.ReactNode; | ||
}): JSX.Element; | ||
}): React.JSX.Element; | ||
export {}; |
import * as React from 'react'; | ||
import type { MotionEndEventHandler, MotionEventHandler, MotionPrepareEventHandler, MotionStatus } from './interface'; | ||
export declare type CSSMotionConfig = boolean | { | ||
export type CSSMotionConfig = boolean | { | ||
transitionSupport?: boolean; | ||
@@ -8,3 +8,3 @@ /** @deprecated, no need this anymore since `rc-motion` only support latest react */ | ||
}; | ||
export declare type MotionName = string | { | ||
export type MotionName = string | { | ||
appear?: string; | ||
@@ -11,0 +11,0 @@ enter?: string; |
@@ -21,9 +21,10 @@ "use strict"; | ||
var _CSSMotion = _interopRequireDefault(require("./CSSMotion")); | ||
var _diff = require("./util/diff"); | ||
var _motion = require("./util/motion"); | ||
var _diff = require("./util/diff"); | ||
var _excluded = ["component", "children", "onVisibleChanged", "onAllRemoved"], | ||
_excluded2 = ["status"]; | ||
/* eslint react/prop-types: 0 */ | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
var MOTION_PROP_NAMES = ['eventProps', 'visible', 'children', 'motionName', 'motionAppear', 'motionEnter', 'motionLeave', 'motionLeaveImmediately', 'motionDeadline', 'removeOnLeave', 'leavedClassName', 'onAppearStart', 'onAppearActive', 'onAppearEnd', 'onEnterStart', 'onEnterActive', 'onEnterEnd', 'onLeaveStart', 'onLeaveActive', 'onLeaveEnd']; | ||
var MOTION_PROP_NAMES = ['eventProps', 'visible', 'children', 'motionName', 'motionAppear', 'motionEnter', 'motionLeave', 'motionLeaveImmediately', 'motionDeadline', 'removeOnLeave', 'leavedClassName', 'onAppearPrepare', 'onAppearStart', 'onAppearActive', 'onAppearEnd', 'onEnterStart', 'onEnterActive', 'onEnterEnd', 'onLeaveStart', 'onLeaveActive', 'onLeaveEnd']; | ||
/** | ||
@@ -49,2 +50,3 @@ * Generate a CSSMotionList component with config | ||
}); | ||
// ZombieJ: Return the count of rest keys. It's safe to refactor if need more info. | ||
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "removeKey", function (removeKey) { | ||
@@ -130,4 +132,2 @@ var keyEntities = _this.state.keyEntities; | ||
} | ||
// ZombieJ: Return the count of rest keys. It's safe to refactor if need more info. | ||
}]); | ||
@@ -134,0 +134,0 @@ return CSSMotionList; |
@@ -8,4 +8,4 @@ "use strict"; | ||
exports.default = void 0; | ||
var _canUseDom = _interopRequireDefault(require("rc-util/lib/Dom/canUseDom")); | ||
var _react = require("react"); | ||
var _canUseDom = _interopRequireDefault(require("rc-util/lib/Dom/canUseDom")); | ||
// It's safe to use `useLayoutEffect` but the warning is annoying | ||
@@ -12,0 +12,0 @@ var useIsomorphicLayoutEffect = (0, _canUseDom.default)() ? _react.useLayoutEffect : _react.useEffect; |
@@ -9,4 +9,4 @@ "use strict"; | ||
exports.default = void 0; | ||
var _raf = _interopRequireDefault(require("rc-util/lib/raf")); | ||
var React = _interopRequireWildcard(require("react")); | ||
var _raf = _interopRequireDefault(require("rc-util/lib/raf")); | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
@@ -13,0 +13,0 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } |
@@ -0,6 +1,6 @@ | ||
import type { CSSMotionProps } from './CSSMotion'; | ||
import CSSMotion from './CSSMotion'; | ||
import type { CSSMotionListProps } from './CSSMotionList'; | ||
import CSSMotionList from './CSSMotionList'; | ||
import type { CSSMotionProps } from './CSSMotion'; | ||
import type { CSSMotionListProps } from './CSSMotionList'; | ||
import type { MotionEventHandler, MotionEndEventHandler } from './interface'; | ||
import type { MotionEndEventHandler, MotionEventHandler } from './interface'; | ||
export { default as Provider } from './context'; | ||
@@ -7,0 +7,0 @@ export { CSSMotionList }; |
@@ -6,3 +6,3 @@ /// <reference types="react" /> | ||
export declare const STATUS_LEAVE: "leave"; | ||
export declare type MotionStatus = typeof STATUS_NONE | typeof STATUS_APPEAR | typeof STATUS_ENTER | typeof STATUS_LEAVE; | ||
export type MotionStatus = typeof STATUS_NONE | typeof STATUS_APPEAR | typeof STATUS_ENTER | typeof STATUS_LEAVE; | ||
export declare const STEP_NONE: "none"; | ||
@@ -18,8 +18,8 @@ export declare const STEP_PREPARE: "prepare"; | ||
export declare const STEP_PREPARED: "prepared"; | ||
export declare type StepStatus = typeof STEP_NONE | typeof STEP_PREPARE | typeof STEP_START | typeof STEP_ACTIVE | typeof STEP_ACTIVATED | typeof STEP_PREPARED; | ||
export declare type MotionEvent = (TransitionEvent | AnimationEvent) & { | ||
export type StepStatus = typeof STEP_NONE | typeof STEP_PREPARE | typeof STEP_START | typeof STEP_ACTIVE | typeof STEP_ACTIVATED | typeof STEP_PREPARED; | ||
export type MotionEvent = (TransitionEvent | AnimationEvent) & { | ||
deadline?: boolean; | ||
}; | ||
export declare type MotionPrepareEventHandler = (element: HTMLElement) => Promise<any> | void; | ||
export declare type MotionEventHandler = (element: HTMLElement, event: MotionEvent) => React.CSSProperties | void; | ||
export declare type MotionEndEventHandler = (element: HTMLElement, event: MotionEvent) => boolean | void; | ||
export type MotionPrepareEventHandler = (element: HTMLElement) => Promise<any> | void; | ||
export type MotionEventHandler = (element: HTMLElement, event: MotionEvent) => React.CSSProperties | void; | ||
export type MotionEndEventHandler = (element: HTMLElement, event: MotionEvent) => boolean | void; |
@@ -6,3 +6,3 @@ /// <reference types="react" /> | ||
export declare const STATUS_REMOVED: "removed"; | ||
export declare type DiffStatus = typeof STATUS_ADD | typeof STATUS_KEEP | typeof STATUS_REMOVE | typeof STATUS_REMOVED; | ||
export type DiffStatus = typeof STATUS_ADD | typeof STATUS_KEEP | typeof STATUS_REMOVE | typeof STATUS_REMOVED; | ||
export interface KeyObject { | ||
@@ -9,0 +9,0 @@ key: React.Key; |
{ | ||
"name": "rc-motion", | ||
"version": "2.7.3", | ||
"version": "2.8.0", | ||
"description": "React lifecycle controlled motion library", | ||
@@ -35,2 +35,3 @@ "keywords": [ | ||
"now-build": "npm run docs:build", | ||
"prepare": "husky install", | ||
"prepublishOnly": "npm run compile && np --yolo --no-publish", | ||
@@ -42,2 +43,8 @@ "prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"", | ||
}, | ||
"lint-staged": { | ||
"**/*.{js,jsx,tsx,ts,md,json}": [ | ||
"prettier --write", | ||
"git add" | ||
] | ||
}, | ||
"dependencies": { | ||
@@ -53,3 +60,2 @@ "@babel/runtime": "^7.11.1", | ||
"@types/classnames": "^2.2.9", | ||
"@types/enzyme": "^3.10.5", | ||
"@types/jest": "^26.0.8", | ||
@@ -63,2 +69,4 @@ "@types/react": "^16.9.2", | ||
"father": "^4.1.2", | ||
"husky": "^8.0.3", | ||
"lint-staged": "^14.0.1", | ||
"np": "^6.2.4", | ||
@@ -65,0 +73,0 @@ "prettier": "^2.1.1", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
107484
2214
20
1
0