@histoire/vendors 0.8.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.
@@ -0,0 +1 @@
1
+ export { default as scrollIntoView } from '../../node_modules/scroll-into-view-if-needed';
@@ -0,0 +1,64 @@
1
+ function t(t){return "object"==typeof t&&null!=t&&1===t.nodeType}function e(t,e){return (!e||"hidden"!==t)&&"visible"!==t&&"clip"!==t}function n(t,n){if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){var r=getComputedStyle(t,null);return e(r.overflowY,n)||e(r.overflowX,n)||function(t){var e=function(t){if(!t.ownerDocument||!t.ownerDocument.defaultView)return null;try{return t.ownerDocument.defaultView.frameElement}catch(t){return null}}(t);return !!e&&(e.clientHeight<t.scrollHeight||e.clientWidth<t.scrollWidth)}(t)}return !1}function r(t,e,n,r,i,o,l,d){return o<t&&l>e||o>t&&l<e?0:o<=t&&d<=n||l>=e&&d>=n?o-t-r:l>e&&d<n||o<t&&d>n?l-e+i:0}function compute(e,i){var o=window,l=i.scrollMode,d=i.block,u=i.inline,h=i.boundary,a=i.skipOverflowHiddenElements,c="function"==typeof h?h:function(t){return t!==h};if(!t(e))throw new TypeError("Invalid target");for(var f=document.scrollingElement||document.documentElement,s=[],p=e;t(p)&&c(p);){if((p=p.parentElement)===f){s.push(p);break}null!=p&&p===document.body&&n(p)&&!n(document.documentElement)||null!=p&&n(p,a)&&s.push(p);}for(var m=o.visualViewport?o.visualViewport.width:innerWidth,g=o.visualViewport?o.visualViewport.height:innerHeight,w=window.scrollX||pageXOffset,v=window.scrollY||pageYOffset,W=e.getBoundingClientRect(),b=W.height,H=W.width,y=W.top,E=W.right,M=W.bottom,V=W.left,x="start"===d||"nearest"===d?y:"end"===d?M:y+b/2,I="center"===u?V+H/2:"end"===u?E:V,C=[],T=0;T<s.length;T++){var k=s[T],B=k.getBoundingClientRect(),D=B.height,O=B.width,R=B.top,X=B.right,Y=B.bottom,L=B.left;if("if-needed"===l&&y>=0&&V>=0&&M<=g&&E<=m&&y>=R&&M<=Y&&V>=L&&E<=X)return C;var S=getComputedStyle(k),j=parseInt(S.borderLeftWidth,10),q=parseInt(S.borderTopWidth,10),z=parseInt(S.borderRightWidth,10),A=parseInt(S.borderBottomWidth,10),F=0,G=0,J="offsetWidth"in k?k.offsetWidth-k.clientWidth-j-z:0,K="offsetHeight"in k?k.offsetHeight-k.clientHeight-q-A:0;if(f===k)F="start"===d?x:"end"===d?x-g:"nearest"===d?r(v,v+g,g,q,A,v+x,v+x+b,b):x-g/2,G="start"===u?I:"center"===u?I-m/2:"end"===u?I-m:r(w,w+m,m,j,z,w+I,w+I+H,H),F=Math.max(0,F+v),G=Math.max(0,G+w);else {F="start"===d?x-R-q:"end"===d?x-Y+A+K:"nearest"===d?r(R,Y,D,q,A+K,x,x+b,b):x-(R+D/2)+K/2,G="start"===u?I-L-j:"center"===u?I-(L+O/2)+J/2:"end"===u?I-X+z+J:r(L,X,O,j,z+J,I,I+H,H);var N=k.scrollLeft,P=k.scrollTop;x+=P-(F=Math.max(0,Math.min(P+F,k.scrollHeight-D+K))),I+=N-(G=Math.max(0,Math.min(N+G,k.scrollWidth-O+J)));}C.push({el:k,top:F,left:G});}return C}
2
+
3
+ function isOptionsObject(options) {
4
+ return options === Object(options) && Object.keys(options).length !== 0;
5
+ }
6
+
7
+ function defaultBehavior(actions, behavior) {
8
+ if (behavior === void 0) {
9
+ behavior = 'auto';
10
+ }
11
+
12
+ var canSmoothScroll = ('scrollBehavior' in document.body.style);
13
+ actions.forEach(function (_ref) {
14
+ var el = _ref.el,
15
+ top = _ref.top,
16
+ left = _ref.left;
17
+
18
+ if (el.scroll && canSmoothScroll) {
19
+ el.scroll({
20
+ top: top,
21
+ left: left,
22
+ behavior: behavior
23
+ });
24
+ } else {
25
+ el.scrollTop = top;
26
+ el.scrollLeft = left;
27
+ }
28
+ });
29
+ }
30
+
31
+ function getOptions(options) {
32
+ if (options === false) {
33
+ return {
34
+ block: 'end',
35
+ inline: 'nearest'
36
+ };
37
+ }
38
+
39
+ if (isOptionsObject(options)) {
40
+ return options;
41
+ }
42
+
43
+ return {
44
+ block: 'start',
45
+ inline: 'nearest'
46
+ };
47
+ }
48
+
49
+ function scrollIntoView(target, options) {
50
+ var isTargetAttached = target.isConnected || target.ownerDocument.documentElement.contains(target);
51
+
52
+ if (isOptionsObject(options) && typeof options.behavior === 'function') {
53
+ return options.behavior(isTargetAttached ? compute(target, options) : []);
54
+ }
55
+
56
+ if (!isTargetAttached) {
57
+ return;
58
+ }
59
+
60
+ var computeOptions = getOptions(options);
61
+ return defaultBehavior(compute(target, computeOptions), computeOptions.behavior);
62
+ }
63
+
64
+ export { scrollIntoView };
@@ -0,0 +1 @@
1
+ export * from '../../node_modules/shiki';