Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
131 lines
3.2 KiB
Plaintext
131 lines
3.2 KiB
Plaintext
"use client";
|
|
"use strict";
|
|
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);
|
|
|
|
// src/overlays/utils.ts
|
|
var utils_exports = {};
|
|
__export(utils_exports, {
|
|
getArrowPlacement: () => getArrowPlacement,
|
|
getShouldUseAxisPlacement: () => getShouldUseAxisPlacement,
|
|
getTransformOrigins: () => getTransformOrigins,
|
|
toOverlayPlacement: () => toOverlayPlacement,
|
|
toReactAriaPlacement: () => toReactAriaPlacement
|
|
});
|
|
module.exports = __toCommonJS(utils_exports);
|
|
var getTransformOrigins = (placement) => {
|
|
const origins = {
|
|
top: {
|
|
originY: 1
|
|
},
|
|
bottom: {
|
|
originY: 0
|
|
},
|
|
left: {
|
|
originX: 1
|
|
},
|
|
right: {
|
|
originX: 0
|
|
},
|
|
"top-start": {
|
|
originX: 0,
|
|
originY: 1
|
|
},
|
|
"top-end": {
|
|
originX: 1,
|
|
originY: 1
|
|
},
|
|
"bottom-start": {
|
|
originX: 0,
|
|
originY: 0
|
|
},
|
|
"bottom-end": {
|
|
originX: 1,
|
|
originY: 0
|
|
},
|
|
"right-start": {
|
|
originX: 0,
|
|
originY: 0
|
|
},
|
|
"right-end": {
|
|
originX: 0,
|
|
originY: 1
|
|
},
|
|
"left-start": {
|
|
originX: 1,
|
|
originY: 0
|
|
},
|
|
"left-end": {
|
|
originX: 1,
|
|
originY: 1
|
|
}
|
|
};
|
|
return (origins == null ? void 0 : origins[placement]) || {};
|
|
};
|
|
var toReactAriaPlacement = (placement) => {
|
|
const mapPositions = {
|
|
top: "top",
|
|
bottom: "bottom",
|
|
left: "left",
|
|
right: "right",
|
|
"top-start": "top start",
|
|
"top-end": "top end",
|
|
"bottom-start": "bottom start",
|
|
"bottom-end": "bottom end",
|
|
"left-start": "left top",
|
|
"left-end": "left bottom",
|
|
"right-start": "right top",
|
|
"right-end": "right bottom"
|
|
};
|
|
return mapPositions[placement];
|
|
};
|
|
var toOverlayPlacement = (placement) => {
|
|
const mapPositions = {
|
|
top: "top",
|
|
bottom: "bottom",
|
|
left: "left",
|
|
right: "right",
|
|
center: "top"
|
|
};
|
|
return mapPositions[placement];
|
|
};
|
|
var getShouldUseAxisPlacement = (axisPlacement, overlayPlacement) => {
|
|
if (overlayPlacement.includes("-")) {
|
|
const [position] = overlayPlacement.split("-");
|
|
if (position.includes(axisPlacement)) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
};
|
|
var getArrowPlacement = (dynamicPlacement, placement) => {
|
|
if (placement.includes("-")) {
|
|
const [, position] = placement.split("-");
|
|
return `${dynamicPlacement}-${position}`;
|
|
}
|
|
return dynamicPlacement;
|
|
};
|
|
// Annotate the CommonJS export names for ESM import in node:
|
|
0 && (module.exports = {
|
|
getArrowPlacement,
|
|
getShouldUseAxisPlacement,
|
|
getTransformOrigins,
|
|
toOverlayPlacement,
|
|
toReactAriaPlacement
|
|
});
|