Add supporting themes required for Lotusdocs
This commit is contained in:
60
themes/hugo-mod-jslibs-dist/alpinejs/packages/intersect/dist/cdn.js
vendored
Normal file
60
themes/hugo-mod-jslibs-dist/alpinejs/packages/intersect/dist/cdn.js
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
(() => {
|
||||
// packages/intersect/src/index.js
|
||||
function src_default(Alpine) {
|
||||
Alpine.directive("intersect", Alpine.skipDuringClone((el, { value, expression, modifiers }, { evaluateLater, cleanup }) => {
|
||||
let evaluate = evaluateLater(expression);
|
||||
let options = {
|
||||
rootMargin: getRootMargin(modifiers),
|
||||
threshold: getThreshold(modifiers)
|
||||
};
|
||||
let observer = new IntersectionObserver((entries) => {
|
||||
entries.forEach((entry) => {
|
||||
if (entry.isIntersecting === (value === "leave"))
|
||||
return;
|
||||
evaluate();
|
||||
modifiers.includes("once") && observer.disconnect();
|
||||
});
|
||||
}, options);
|
||||
observer.observe(el);
|
||||
cleanup(() => {
|
||||
observer.disconnect();
|
||||
});
|
||||
}));
|
||||
}
|
||||
function getThreshold(modifiers) {
|
||||
if (modifiers.includes("full"))
|
||||
return 0.99;
|
||||
if (modifiers.includes("half"))
|
||||
return 0.5;
|
||||
if (!modifiers.includes("threshold"))
|
||||
return 0;
|
||||
let threshold = modifiers[modifiers.indexOf("threshold") + 1];
|
||||
if (threshold === "100")
|
||||
return 1;
|
||||
if (threshold === "0")
|
||||
return 0;
|
||||
return Number(`.${threshold}`);
|
||||
}
|
||||
function getLengthValue(rawValue) {
|
||||
let match = rawValue.match(/^(-?[0-9]+)(px|%)?$/);
|
||||
return match ? match[1] + (match[2] || "px") : void 0;
|
||||
}
|
||||
function getRootMargin(modifiers) {
|
||||
const key = "margin";
|
||||
const fallback = "0px 0px 0px 0px";
|
||||
const index = modifiers.indexOf(key);
|
||||
if (index === -1)
|
||||
return fallback;
|
||||
let values = [];
|
||||
for (let i = 1; i < 5; i++) {
|
||||
values.push(getLengthValue(modifiers[index + i] || ""));
|
||||
}
|
||||
values = values.filter((v) => v !== void 0);
|
||||
return values.length ? values.join(" ").trim() : fallback;
|
||||
}
|
||||
|
||||
// packages/intersect/builds/cdn.js
|
||||
document.addEventListener("alpine:init", () => {
|
||||
window.Alpine.plugin(src_default);
|
||||
});
|
||||
})();
|
||||
1
themes/hugo-mod-jslibs-dist/alpinejs/packages/intersect/dist/cdn.min.js
vendored
Normal file
1
themes/hugo-mod-jslibs-dist/alpinejs/packages/intersect/dist/cdn.min.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
(()=>{function o(e){e.directive("intersect",e.skipDuringClone((t,{value:i,expression:l,modifiers:n},{evaluateLater:r,cleanup:c})=>{let s=r(l),a={rootMargin:x(n),threshold:f(n)},u=new IntersectionObserver(d=>{d.forEach(h=>{h.isIntersecting!==(i==="leave")&&(s(),n.includes("once")&&u.disconnect())})},a);u.observe(t),c(()=>{u.disconnect()})}))}function f(e){if(e.includes("full"))return .99;if(e.includes("half"))return .5;if(!e.includes("threshold"))return 0;let t=e[e.indexOf("threshold")+1];return t==="100"?1:t==="0"?0:Number(`.${t}`)}function p(e){let t=e.match(/^(-?[0-9]+)(px|%)?$/);return t?t[1]+(t[2]||"px"):void 0}function x(e){let t="margin",i="0px 0px 0px 0px",l=e.indexOf(t);if(l===-1)return i;let n=[];for(let r=1;r<5;r++)n.push(p(e[l+r]||""));return n=n.filter(r=>r!==void 0),n.length?n.join(" ").trim():i}document.addEventListener("alpine:init",()=>{window.Alpine.plugin(o)});})();
|
||||
86
themes/hugo-mod-jslibs-dist/alpinejs/packages/intersect/dist/module.cjs.js
vendored
Normal file
86
themes/hugo-mod-jslibs-dist/alpinejs/packages/intersect/dist/module.cjs.js
vendored
Normal file
@@ -0,0 +1,86 @@
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// packages/intersect/builds/module.js
|
||||
var module_exports = {};
|
||||
__export(module_exports, {
|
||||
default: () => module_default,
|
||||
intersect: () => src_default
|
||||
});
|
||||
module.exports = __toCommonJS(module_exports);
|
||||
|
||||
// packages/intersect/src/index.js
|
||||
function src_default(Alpine) {
|
||||
Alpine.directive("intersect", Alpine.skipDuringClone((el, { value, expression, modifiers }, { evaluateLater, cleanup }) => {
|
||||
let evaluate = evaluateLater(expression);
|
||||
let options = {
|
||||
rootMargin: getRootMargin(modifiers),
|
||||
threshold: getThreshold(modifiers)
|
||||
};
|
||||
let observer = new IntersectionObserver((entries) => {
|
||||
entries.forEach((entry) => {
|
||||
if (entry.isIntersecting === (value === "leave"))
|
||||
return;
|
||||
evaluate();
|
||||
modifiers.includes("once") && observer.disconnect();
|
||||
});
|
||||
}, options);
|
||||
observer.observe(el);
|
||||
cleanup(() => {
|
||||
observer.disconnect();
|
||||
});
|
||||
}));
|
||||
}
|
||||
function getThreshold(modifiers) {
|
||||
if (modifiers.includes("full"))
|
||||
return 0.99;
|
||||
if (modifiers.includes("half"))
|
||||
return 0.5;
|
||||
if (!modifiers.includes("threshold"))
|
||||
return 0;
|
||||
let threshold = modifiers[modifiers.indexOf("threshold") + 1];
|
||||
if (threshold === "100")
|
||||
return 1;
|
||||
if (threshold === "0")
|
||||
return 0;
|
||||
return Number(`.${threshold}`);
|
||||
}
|
||||
function getLengthValue(rawValue) {
|
||||
let match = rawValue.match(/^(-?[0-9]+)(px|%)?$/);
|
||||
return match ? match[1] + (match[2] || "px") : void 0;
|
||||
}
|
||||
function getRootMargin(modifiers) {
|
||||
const key = "margin";
|
||||
const fallback = "0px 0px 0px 0px";
|
||||
const index = modifiers.indexOf(key);
|
||||
if (index === -1)
|
||||
return fallback;
|
||||
let values = [];
|
||||
for (let i = 1; i < 5; i++) {
|
||||
values.push(getLengthValue(modifiers[index + i] || ""));
|
||||
}
|
||||
values = values.filter((v) => v !== void 0);
|
||||
return values.length ? values.join(" ").trim() : fallback;
|
||||
}
|
||||
|
||||
// packages/intersect/builds/module.js
|
||||
var module_default = src_default;
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
intersect
|
||||
});
|
||||
60
themes/hugo-mod-jslibs-dist/alpinejs/packages/intersect/dist/module.esm.js
vendored
Normal file
60
themes/hugo-mod-jslibs-dist/alpinejs/packages/intersect/dist/module.esm.js
vendored
Normal file
@@ -0,0 +1,60 @@
|
||||
// packages/intersect/src/index.js
|
||||
function src_default(Alpine) {
|
||||
Alpine.directive("intersect", Alpine.skipDuringClone((el, { value, expression, modifiers }, { evaluateLater, cleanup }) => {
|
||||
let evaluate = evaluateLater(expression);
|
||||
let options = {
|
||||
rootMargin: getRootMargin(modifiers),
|
||||
threshold: getThreshold(modifiers)
|
||||
};
|
||||
let observer = new IntersectionObserver((entries) => {
|
||||
entries.forEach((entry) => {
|
||||
if (entry.isIntersecting === (value === "leave"))
|
||||
return;
|
||||
evaluate();
|
||||
modifiers.includes("once") && observer.disconnect();
|
||||
});
|
||||
}, options);
|
||||
observer.observe(el);
|
||||
cleanup(() => {
|
||||
observer.disconnect();
|
||||
});
|
||||
}));
|
||||
}
|
||||
function getThreshold(modifiers) {
|
||||
if (modifiers.includes("full"))
|
||||
return 0.99;
|
||||
if (modifiers.includes("half"))
|
||||
return 0.5;
|
||||
if (!modifiers.includes("threshold"))
|
||||
return 0;
|
||||
let threshold = modifiers[modifiers.indexOf("threshold") + 1];
|
||||
if (threshold === "100")
|
||||
return 1;
|
||||
if (threshold === "0")
|
||||
return 0;
|
||||
return Number(`.${threshold}`);
|
||||
}
|
||||
function getLengthValue(rawValue) {
|
||||
let match = rawValue.match(/^(-?[0-9]+)(px|%)?$/);
|
||||
return match ? match[1] + (match[2] || "px") : void 0;
|
||||
}
|
||||
function getRootMargin(modifiers) {
|
||||
const key = "margin";
|
||||
const fallback = "0px 0px 0px 0px";
|
||||
const index = modifiers.indexOf(key);
|
||||
if (index === -1)
|
||||
return fallback;
|
||||
let values = [];
|
||||
for (let i = 1; i < 5; i++) {
|
||||
values.push(getLengthValue(modifiers[index + i] || ""));
|
||||
}
|
||||
values = values.filter((v) => v !== void 0);
|
||||
return values.length ? values.join(" ").trim() : fallback;
|
||||
}
|
||||
|
||||
// packages/intersect/builds/module.js
|
||||
var module_default = src_default;
|
||||
export {
|
||||
module_default as default,
|
||||
src_default as intersect
|
||||
};
|
||||
Reference in New Issue
Block a user