@betterstore/react 0.3.20 → 0.3.21
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 +6 -0
- package/dist/index.cjs.js +13 -11
- package/dist/index.mjs +13 -11
- package/package.json +2 -2
- package/tailwind.config.js +13 -0
package/CHANGELOG.md
CHANGED
package/dist/index.cjs.js
CHANGED
|
@@ -8234,12 +8234,10 @@ class JSAnimation extends WithPromise {
|
|
|
8234
8234
|
* This method is bound to the instance to fix a pattern where
|
|
8235
8235
|
* animation.stop is returned as a reference from a useEffect.
|
|
8236
8236
|
*/
|
|
8237
|
-
this.stop = (
|
|
8238
|
-
|
|
8239
|
-
|
|
8240
|
-
|
|
8241
|
-
this.tick(time.now());
|
|
8242
|
-
}
|
|
8237
|
+
this.stop = () => {
|
|
8238
|
+
const { motionValue } = this.options;
|
|
8239
|
+
if (motionValue && motionValue.updatedAt !== time.now()) {
|
|
8240
|
+
this.tick(time.now());
|
|
8243
8241
|
}
|
|
8244
8242
|
this.isStopped = true;
|
|
8245
8243
|
if (this.state === "idle")
|
|
@@ -12122,7 +12120,6 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
12122
12120
|
this.resumingFrom = this.resumeFrom;
|
|
12123
12121
|
this.resumingFrom.resumingFrom = undefined;
|
|
12124
12122
|
}
|
|
12125
|
-
this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged);
|
|
12126
12123
|
const animationOptions = {
|
|
12127
12124
|
...getValueTransition(layoutTransition, "layout"),
|
|
12128
12125
|
onPlay: onLayoutAnimationStart,
|
|
@@ -12134,6 +12131,11 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
12134
12131
|
animationOptions.type = false;
|
|
12135
12132
|
}
|
|
12136
12133
|
this.startAnimation(animationOptions);
|
|
12134
|
+
/**
|
|
12135
|
+
* Set animation origin after starting animation to avoid layout jump
|
|
12136
|
+
* caused by stopping previous layout animation
|
|
12137
|
+
*/
|
|
12138
|
+
this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged);
|
|
12137
12139
|
}
|
|
12138
12140
|
else {
|
|
12139
12141
|
/**
|
|
@@ -12857,8 +12859,8 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
12857
12859
|
}
|
|
12858
12860
|
startAnimation(options) {
|
|
12859
12861
|
this.notifyListeners("animationStart");
|
|
12860
|
-
this.currentAnimation?.stop(
|
|
12861
|
-
this.resumingFrom?.currentAnimation?.stop(
|
|
12862
|
+
this.currentAnimation?.stop();
|
|
12863
|
+
this.resumingFrom?.currentAnimation?.stop();
|
|
12862
12864
|
if (this.pendingAnimation) {
|
|
12863
12865
|
cancelFrame(this.pendingAnimation);
|
|
12864
12866
|
this.pendingAnimation = undefined;
|
|
@@ -12907,7 +12909,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
12907
12909
|
finishAnimation() {
|
|
12908
12910
|
if (this.currentAnimation) {
|
|
12909
12911
|
this.mixTargetDelta && this.mixTargetDelta(animationTarget);
|
|
12910
|
-
this.currentAnimation.stop(
|
|
12912
|
+
this.currentAnimation.stop();
|
|
12911
12913
|
}
|
|
12912
12914
|
this.completeAnimation();
|
|
12913
12915
|
}
|
|
@@ -13172,7 +13174,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
13172
13174
|
}
|
|
13173
13175
|
// Only run on root
|
|
13174
13176
|
resetTree() {
|
|
13175
|
-
this.root.nodes.forEach((node) => node.currentAnimation?.stop(
|
|
13177
|
+
this.root.nodes.forEach((node) => node.currentAnimation?.stop());
|
|
13176
13178
|
this.root.nodes.forEach(clearMeasurements);
|
|
13177
13179
|
this.root.sharedNodes.clear();
|
|
13178
13180
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -8211,12 +8211,10 @@ class JSAnimation extends WithPromise {
|
|
|
8211
8211
|
* This method is bound to the instance to fix a pattern where
|
|
8212
8212
|
* animation.stop is returned as a reference from a useEffect.
|
|
8213
8213
|
*/
|
|
8214
|
-
this.stop = (
|
|
8215
|
-
|
|
8216
|
-
|
|
8217
|
-
|
|
8218
|
-
this.tick(time.now());
|
|
8219
|
-
}
|
|
8214
|
+
this.stop = () => {
|
|
8215
|
+
const { motionValue } = this.options;
|
|
8216
|
+
if (motionValue && motionValue.updatedAt !== time.now()) {
|
|
8217
|
+
this.tick(time.now());
|
|
8220
8218
|
}
|
|
8221
8219
|
this.isStopped = true;
|
|
8222
8220
|
if (this.state === "idle")
|
|
@@ -12099,7 +12097,6 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
12099
12097
|
this.resumingFrom = this.resumeFrom;
|
|
12100
12098
|
this.resumingFrom.resumingFrom = undefined;
|
|
12101
12099
|
}
|
|
12102
|
-
this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged);
|
|
12103
12100
|
const animationOptions = {
|
|
12104
12101
|
...getValueTransition(layoutTransition, "layout"),
|
|
12105
12102
|
onPlay: onLayoutAnimationStart,
|
|
@@ -12111,6 +12108,11 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
12111
12108
|
animationOptions.type = false;
|
|
12112
12109
|
}
|
|
12113
12110
|
this.startAnimation(animationOptions);
|
|
12111
|
+
/**
|
|
12112
|
+
* Set animation origin after starting animation to avoid layout jump
|
|
12113
|
+
* caused by stopping previous layout animation
|
|
12114
|
+
*/
|
|
12115
|
+
this.setAnimationOrigin(delta, hasOnlyRelativeTargetChanged);
|
|
12114
12116
|
}
|
|
12115
12117
|
else {
|
|
12116
12118
|
/**
|
|
@@ -12834,8 +12836,8 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
12834
12836
|
}
|
|
12835
12837
|
startAnimation(options) {
|
|
12836
12838
|
this.notifyListeners("animationStart");
|
|
12837
|
-
this.currentAnimation?.stop(
|
|
12838
|
-
this.resumingFrom?.currentAnimation?.stop(
|
|
12839
|
+
this.currentAnimation?.stop();
|
|
12840
|
+
this.resumingFrom?.currentAnimation?.stop();
|
|
12839
12841
|
if (this.pendingAnimation) {
|
|
12840
12842
|
cancelFrame(this.pendingAnimation);
|
|
12841
12843
|
this.pendingAnimation = undefined;
|
|
@@ -12884,7 +12886,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
12884
12886
|
finishAnimation() {
|
|
12885
12887
|
if (this.currentAnimation) {
|
|
12886
12888
|
this.mixTargetDelta && this.mixTargetDelta(animationTarget);
|
|
12887
|
-
this.currentAnimation.stop(
|
|
12889
|
+
this.currentAnimation.stop();
|
|
12888
12890
|
}
|
|
12889
12891
|
this.completeAnimation();
|
|
12890
12892
|
}
|
|
@@ -13149,7 +13151,7 @@ function createProjectionNode({ attachResizeListener, defaultParent, measureScro
|
|
|
13149
13151
|
}
|
|
13150
13152
|
// Only run on root
|
|
13151
13153
|
resetTree() {
|
|
13152
|
-
this.root.nodes.forEach((node) => node.currentAnimation?.stop(
|
|
13154
|
+
this.root.nodes.forEach((node) => node.currentAnimation?.stop());
|
|
13153
13155
|
this.root.nodes.forEach(clearMeasurements);
|
|
13154
13156
|
this.root.sharedNodes.clear();
|
|
13155
13157
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@betterstore/react",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.21",
|
|
4
4
|
"description": "E-commerce for Developers",
|
|
5
5
|
"private": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"author": "Better Store",
|
|
20
20
|
"license": "MIT",
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@betterstore/sdk": "^0.3.
|
|
22
|
+
"@betterstore/sdk": "^0.3.75",
|
|
23
23
|
"@changesets/cli": "^2.28.1",
|
|
24
24
|
"@rollup/plugin-commonjs": "^28.0.3",
|
|
25
25
|
"@rollup/plugin-json": "^6.1.0",
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** @type {import('tailwindcss').Config} */
|
|
2
|
+
module.exports = {
|
|
3
|
+
prefix: "betterstore-",
|
|
4
|
+
content: ["./src/**/*.{js,jsx,ts,tsx}"],
|
|
5
|
+
corePlugins: {
|
|
6
|
+
preflight: false, // Disable Tailwind's base styles to prevent conflicts
|
|
7
|
+
},
|
|
8
|
+
important: true, // This ensures your styles take precedence
|
|
9
|
+
theme: {
|
|
10
|
+
extend: {},
|
|
11
|
+
},
|
|
12
|
+
plugins: [],
|
|
13
|
+
};
|