@prismicio/editor-support
Advanced tools
Comparing version 0.4.49-alpha.feat-onboarding-guide.6 to 0.4.49-alpha.feat-onboarding-guide.7
@@ -1,1 +0,1 @@ | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react");var y={};Object.defineProperty(y,"__esModule",{value:!0});var M=y.confetti=D,x=["#a864fd","#29cdff","#78ff44","#ff718d","#fdff6a"];function F(e,a,t,r,s){return Array.from({length:a}).map(function(c,i){var n=document.createElement("div"),l=t[i%t.length];return n.style["background-color"]=l,n.style.width=r,n.style.height=s,n.style.position="absolute",n.style.willChange="transform, opacity",n.style.visibility="hidden",e.appendChild(n),n})}function P(e,a,t,r){var s=e*(Math.PI/180),c=a*(Math.PI/180);return{x:0,y:0,z:0,wobble:r()*10,wobbleSpeed:.1+r()*.1,velocity:t*.5+r()*t,angle2D:-s+(.5*c-r()*c),angle3D:-(Math.PI/4)+r()*(Math.PI/2),tiltAngle:r()*Math.PI,tiltAngleSpeed:.1+r()*.3}}function A(e,a,t,r){e.physics.x+=Math.cos(e.physics.angle2D)*e.physics.velocity,e.physics.y+=Math.sin(e.physics.angle2D)*e.physics.velocity,e.physics.z+=Math.sin(e.physics.angle3D)*e.physics.velocity,e.physics.wobble+=e.physics.wobbleSpeed,r?e.physics.velocity*=r:e.physics.velocity-=e.physics.velocity*t,e.physics.y+=3,e.physics.tiltAngle+=e.physics.tiltAngleSpeed;var s=e.physics,c=s.x,i=s.y,n=s.z,l=s.tiltAngle,o=s.wobble,p=c+10*Math.cos(o),h=i+10*Math.sin(o),u="translate3d("+p+"px, "+h+"px, "+n+"px) rotate3d(1, 1, 1, "+l+"rad)";e.element.style.visibility="visible",e.element.style.transform=u,e.element.style.opacity=1-a}function E(e,a,t,r,s,c){var i=void 0;return new Promise(function(n){function l(o){i||(i=o);var p=o-i,h=i===o?0:(o-i)/s;a.slice(0,Math.ceil(p/c)).forEach(function(u){A(u,h,t,r)}),o-i<s?requestAnimationFrame(l):(a.forEach(function(u){if(u.element.parentNode===e)return e.removeChild(u.element)}),n())}requestAnimationFrame(l)})}var S={angle:90,spread:45,startVelocity:45,elementCount:50,width:"10px",height:"10px",perspective:"",colors:x,duration:3e3,stagger:0,dragFriction:.1,random:Math.random};function _(e){return!e.stagger&&e.delay&&(e.stagger=e.delay),e}function D(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=Object.assign({},S,_(a)),r=t.elementCount,s=t.colors,c=t.width,i=t.height,n=t.perspective,l=t.angle,o=t.spread,p=t.startVelocity,h=t.decay,u=t.dragFriction,f=t.duration,v=t.stagger,m=t.random;e.style.perspective=n;var b=F(e,r,s,c,i),C=b.map(function(w){return{element:w,physics:P(l,o,p,m)}});return E(e,C,u,h,f,v)}const g={colors:["var(--purple10, #8E44EC)","var(--purple5, #E8C7FF)","var(--indigo8, #59B5F8)","var(--indigo5, #C3EEFE)"],elementCount:300,width:"8px",height:"8px",stagger:.2,startVelocity:35,spread:90,duration:3e3};function I(e){const{config:a,onAnimationEnd:t}=e??{},r=d.useRef(null),s=d.useRef(null);return{throwConfetti:d.useCallback(()=>{const i=r.current,n=s.current,l={...g,...a};if(i){if(n||t){const o=n&&n.style.overflow;n&&(n.style.overflow="hidden"),setTimeout(()=>{n&&o&&(n.style.overflow=o),t==null||t()},l.duration)}M(i,l)}},[a]),confettiCannonRef:r,confettiContainerRef:s}}exports.defaultConfettiConfig=g;exports.useConfetti=I; | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("react");var d={};Object.defineProperty(d,"__esModule",{value:!0});var M=d.confetti=D,x=["#a864fd","#29cdff","#78ff44","#ff718d","#fdff6a"];function F(e,a,t,r,s){return Array.from({length:a}).map(function(c,o){var n=document.createElement("div"),l=t[o%t.length];return n.style["background-color"]=l,n.style.width=r,n.style.height=s,n.style.position="absolute",n.style.willChange="transform, opacity",n.style.visibility="hidden",e.appendChild(n),n})}function P(e,a,t,r){var s=e*(Math.PI/180),c=a*(Math.PI/180);return{x:0,y:0,z:0,wobble:r()*10,wobbleSpeed:.1+r()*.1,velocity:t*.5+r()*t,angle2D:-s+(.5*c-r()*c),angle3D:-(Math.PI/4)+r()*(Math.PI/2),tiltAngle:r()*Math.PI,tiltAngleSpeed:.1+r()*.3}}function A(e,a,t,r){e.physics.x+=Math.cos(e.physics.angle2D)*e.physics.velocity,e.physics.y+=Math.sin(e.physics.angle2D)*e.physics.velocity,e.physics.z+=Math.sin(e.physics.angle3D)*e.physics.velocity,e.physics.wobble+=e.physics.wobbleSpeed,r?e.physics.velocity*=r:e.physics.velocity-=e.physics.velocity*t,e.physics.y+=3,e.physics.tiltAngle+=e.physics.tiltAngleSpeed;var s=e.physics,c=s.x,o=s.y,n=s.z,l=s.tiltAngle,i=s.wobble,h=c+10*Math.cos(i),p=o+10*Math.sin(i),u="translate3d("+h+"px, "+p+"px, "+n+"px) rotate3d(1, 1, 1, "+l+"rad)";e.element.style.visibility="visible",e.element.style.transform=u,e.element.style.opacity=1-a}function E(e,a,t,r,s,c){var o=void 0;return new Promise(function(n){function l(i){o||(o=i);var h=i-o,p=o===i?0:(i-o)/s;a.slice(0,Math.ceil(h/c)).forEach(function(u){A(u,p,t,r)}),i-o<s?requestAnimationFrame(l):(a.forEach(function(u){if(u.element.parentNode===e)return e.removeChild(u.element)}),n())}requestAnimationFrame(l)})}var S={angle:90,spread:45,startVelocity:45,elementCount:50,width:"10px",height:"10px",perspective:"",colors:x,duration:3e3,stagger:0,dragFriction:.1,random:Math.random};function _(e){return!e.stagger&&e.delay&&(e.stagger=e.delay),e}function D(e){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=Object.assign({},S,_(a)),r=t.elementCount,s=t.colors,c=t.width,o=t.height,n=t.perspective,l=t.angle,i=t.spread,h=t.startVelocity,p=t.decay,u=t.dragFriction,f=t.duration,v=t.stagger,b=t.random;e.style.perspective=n;var m=F(e,r,s,c,o),C=m.map(function(w){return{element:w,physics:P(l,i,h,b)}});return E(e,C,u,p,f,v)}const g={colors:["var(--logo-purple, #8E44EC)","var(--logo-blue, #E8C7FF)","var(--logo-yellow, #59B5F8)","var(--logo-red, #C3EEFE)"],elementCount:300,width:"8px",height:"8px",stagger:.2,startVelocity:35,spread:90,duration:3e3};function I(e){const{config:a,onAnimationEnd:t}=e??{},r=y.useRef(null),s=y.useRef(null);return{throwConfetti:y.useCallback(()=>{const o=r.current,n=s.current,l={...g,...a};if(o){if(n||t){const i=n&&n.style.overflow;n&&(n.style.overflow="hidden"),setTimeout(()=>{n&&i&&(n.style.overflow=i),t==null||t()},l.duration)}M(o,l)}},[a]),confettiCannonRef:r,confettiContainerRef:s}}exports.defaultConfettiConfig=g;exports.useConfetti=I; |
@@ -1,2 +0,2 @@ | ||
import { useRef as y, useCallback as C } from "react"; | ||
import { useRef as u, useCallback as C } from "react"; | ||
var d = {}; | ||
@@ -7,4 +7,4 @@ Object.defineProperty(d, "__esModule", { | ||
var M = d.confetti = I, x = ["#a864fd", "#29cdff", "#78ff44", "#ff718d", "#fdff6a"]; | ||
function F(e, i, t, r, s) { | ||
return Array.from({ length: i }).map(function(c, a) { | ||
function F(e, o, t, r, s) { | ||
return Array.from({ length: o }).map(function(c, a) { | ||
var n = document.createElement("div"), l = t[a % t.length]; | ||
@@ -14,4 +14,4 @@ return n.style["background-color"] = l, n.style.width = r, n.style.height = s, n.style.position = "absolute", n.style.willChange = "transform, opacity", n.style.visibility = "hidden", e.appendChild(n), n; | ||
} | ||
function A(e, i, t, r) { | ||
var s = e * (Math.PI / 180), c = i * (Math.PI / 180); | ||
function A(e, o, t, r) { | ||
var s = e * (Math.PI / 180), c = o * (Math.PI / 180); | ||
return { | ||
@@ -30,16 +30,16 @@ x: 0, | ||
} | ||
function E(e, i, t, r) { | ||
function E(e, o, t, r) { | ||
e.physics.x += Math.cos(e.physics.angle2D) * e.physics.velocity, e.physics.y += Math.sin(e.physics.angle2D) * e.physics.velocity, e.physics.z += Math.sin(e.physics.angle3D) * e.physics.velocity, e.physics.wobble += e.physics.wobbleSpeed, r ? e.physics.velocity *= r : e.physics.velocity -= e.physics.velocity * t, e.physics.y += 3, e.physics.tiltAngle += e.physics.tiltAngleSpeed; | ||
var s = e.physics, c = s.x, a = s.y, n = s.z, l = s.tiltAngle, o = s.wobble, h = c + 10 * Math.cos(o), u = a + 10 * Math.sin(o), p = "translate3d(" + h + "px, " + u + "px, " + n + "px) rotate3d(1, 1, 1, " + l + "rad)"; | ||
e.element.style.visibility = "visible", e.element.style.transform = p, e.element.style.opacity = 1 - i; | ||
var s = e.physics, c = s.x, a = s.y, n = s.z, l = s.tiltAngle, i = s.wobble, h = c + 10 * Math.cos(i), y = a + 10 * Math.sin(i), p = "translate3d(" + h + "px, " + y + "px, " + n + "px) rotate3d(1, 1, 1, " + l + "rad)"; | ||
e.element.style.visibility = "visible", e.element.style.transform = p, e.element.style.opacity = 1 - o; | ||
} | ||
function P(e, i, t, r, s, c) { | ||
function P(e, o, t, r, s, c) { | ||
var a = void 0; | ||
return new Promise(function(n) { | ||
function l(o) { | ||
a || (a = o); | ||
var h = o - a, u = a === o ? 0 : (o - a) / s; | ||
i.slice(0, Math.ceil(h / c)).forEach(function(p) { | ||
E(p, u, t, r); | ||
}), o - a < s ? requestAnimationFrame(l) : (i.forEach(function(p) { | ||
function l(i) { | ||
a || (a = i); | ||
var h = i - a, y = a === i ? 0 : (i - a) / s; | ||
o.slice(0, Math.ceil(h / c)).forEach(function(p) { | ||
E(p, y, t, r); | ||
}), i - a < s ? requestAnimationFrame(l) : (o.forEach(function(p) { | ||
if (p.element.parentNode === e) | ||
@@ -70,3 +70,3 @@ return e.removeChild(p.element); | ||
function I(e) { | ||
var i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = Object.assign({}, _, D(i)), r = t.elementCount, s = t.colors, c = t.width, a = t.height, n = t.perspective, l = t.angle, o = t.spread, h = t.startVelocity, u = t.decay, p = t.dragFriction, g = t.duration, v = t.stagger, f = t.random; | ||
var o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, t = Object.assign({}, _, D(o)), r = t.elementCount, s = t.colors, c = t.width, a = t.height, n = t.perspective, l = t.angle, i = t.spread, h = t.startVelocity, y = t.decay, p = t.dragFriction, g = t.duration, v = t.stagger, f = t.random; | ||
e.style.perspective = n; | ||
@@ -76,13 +76,13 @@ var m = F(e, r, s, c, a), b = m.map(function(w) { | ||
element: w, | ||
physics: A(l, o, h, f) | ||
physics: A(l, i, h, f) | ||
}; | ||
}); | ||
return P(e, b, p, u, g, v); | ||
return P(e, b, p, y, g, v); | ||
} | ||
const S = { | ||
colors: [ | ||
"var(--purple10, #8E44EC)", | ||
"var(--purple5, #E8C7FF)", | ||
"var(--indigo8, #59B5F8)", | ||
"var(--indigo5, #C3EEFE)" | ||
"var(--logo-purple, #8E44EC)", | ||
"var(--logo-blue, #E8C7FF)", | ||
"var(--logo-yellow, #59B5F8)", | ||
"var(--logo-red, #C3EEFE)" | ||
], | ||
@@ -98,11 +98,11 @@ elementCount: 300, | ||
function O(e) { | ||
const { config: i, onAnimationEnd: t } = e ?? {}, r = y(null), s = y(null); | ||
const { config: o, onAnimationEnd: t } = e ?? {}, r = u(null), s = u(null); | ||
return { | ||
throwConfetti: C(() => { | ||
const a = r.current, n = s.current, l = { ...S, ...i }; | ||
const a = r.current, n = s.current, l = { ...S, ...o }; | ||
if (a) { | ||
if (n || t) { | ||
const o = n && n.style.overflow; | ||
const i = n && n.style.overflow; | ||
n && (n.style.overflow = "hidden"), setTimeout(() => { | ||
n && o && (n.style.overflow = o), t == null || t(); | ||
n && i && (n.style.overflow = i), t == null || t(); | ||
}, l.duration); | ||
@@ -112,3 +112,3 @@ } | ||
} | ||
}, [i]), | ||
}, [o]), | ||
confettiCannonRef: r, | ||
@@ -115,0 +115,0 @@ confettiContainerRef: s |
@@ -68,3 +68,3 @@ { | ||
}, | ||
"version": "0.4.49-alpha.feat-onboarding-guide.6" | ||
"version": "0.4.49-alpha.feat-onboarding-guide.7" | ||
} |
70298