@septkit/ui 0.0.64 → 0.0.65
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/dist/diagram-layout/diagram-node-card.js +1 -1
- package/dist/diagram-layout/diagram-node-card.vue_vue_type_script_setup_true_lang.js +60 -48
- package/dist/explorer/explorer.js +1 -1
- package/dist/explorer/explorer.vue_vue_type_script_setup_true_lang.js +45 -39
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Tooltip/TooltipContent.js +90 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Tooltip/TooltipContentHoverable.js +84 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Tooltip/TooltipContentImpl.js +136 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Tooltip/TooltipPortal.js +33 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Tooltip/TooltipProvider.js +68 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Tooltip/TooltipRoot.js +99 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Tooltip/TooltipTrigger.js +88 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Tooltip/utils.js +4 -0
- package/dist/external/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/shared/useGraceArea.js +156 -0
- package/dist/index.d.ts +342 -63
- package/dist/index.js +33 -31
- package/dist/tooltip/floating-tooltip.js +5 -0
- package/dist/tooltip/floating-tooltip.vue_vue_type_script_setup_true_lang.js +76 -0
- package/dist/tooltip/index.js +2 -0
- package/dist/ui.css +1 -1
- package/package.json +1 -2
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Teleport_default as e } from "../Teleport/Teleport.js";
|
|
2
|
+
import { createBlock as t, defineComponent as n, guardReactiveProps as r, normalizeProps as i, openBlock as a, renderSlot as o, unref as s, withCtx as c } from "vue";
|
|
3
|
+
//#region node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Tooltip/TooltipPortal.js
|
|
4
|
+
var l = /* @__PURE__ */ n({
|
|
5
|
+
__name: "TooltipPortal",
|
|
6
|
+
props: {
|
|
7
|
+
to: {
|
|
8
|
+
type: null,
|
|
9
|
+
required: !1
|
|
10
|
+
},
|
|
11
|
+
disabled: {
|
|
12
|
+
type: Boolean,
|
|
13
|
+
required: !1
|
|
14
|
+
},
|
|
15
|
+
defer: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
required: !1
|
|
18
|
+
},
|
|
19
|
+
forceMount: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
required: !1
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
setup(n) {
|
|
25
|
+
let l = n;
|
|
26
|
+
return (n, u) => (a(), t(s(e), i(r(l)), {
|
|
27
|
+
default: c(() => [o(n.$slots, "default")]),
|
|
28
|
+
_: 3
|
|
29
|
+
}, 16));
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
//#endregion
|
|
33
|
+
export { l as TooltipPortal_default };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { useTimeoutFn as e } from "../../../../../@vueuse_shared@14.3.0_vue@3.5.39_typescript@5.8.3_/node_modules/@vueuse/shared/dist/index.js";
|
|
2
|
+
import { createContext as t } from "../shared/createContext.js";
|
|
3
|
+
import { useForwardExpose as n } from "../shared/useForwardExpose.js";
|
|
4
|
+
import { defineComponent as r, ref as i, renderSlot as a, toRefs as o } from "vue";
|
|
5
|
+
//#region node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Tooltip/TooltipProvider.js
|
|
6
|
+
var [s, c] = /*#__PURE__*/ t("TooltipProvider"), l = /* @__PURE__ */ r({
|
|
7
|
+
inheritAttrs: !1,
|
|
8
|
+
__name: "TooltipProvider",
|
|
9
|
+
props: {
|
|
10
|
+
delayDuration: {
|
|
11
|
+
type: Number,
|
|
12
|
+
required: !1,
|
|
13
|
+
default: 700
|
|
14
|
+
},
|
|
15
|
+
skipDelayDuration: {
|
|
16
|
+
type: Number,
|
|
17
|
+
required: !1,
|
|
18
|
+
default: 300
|
|
19
|
+
},
|
|
20
|
+
disableHoverableContent: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
required: !1,
|
|
23
|
+
default: !1
|
|
24
|
+
},
|
|
25
|
+
disableClosingTrigger: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
required: !1
|
|
28
|
+
},
|
|
29
|
+
disabled: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
required: !1
|
|
32
|
+
},
|
|
33
|
+
ignoreNonKeyboardFocus: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
required: !1,
|
|
36
|
+
default: !1
|
|
37
|
+
},
|
|
38
|
+
content: {
|
|
39
|
+
type: Object,
|
|
40
|
+
required: !1
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
setup(t) {
|
|
44
|
+
let { delayDuration: r, skipDelayDuration: s, disableHoverableContent: l, disableClosingTrigger: u, ignoreNonKeyboardFocus: d, disabled: f, content: p } = o(t);
|
|
45
|
+
n();
|
|
46
|
+
let m = i(!0), h = i(!1), { start: g, stop: _ } = e(() => {
|
|
47
|
+
m.value = !0;
|
|
48
|
+
}, s, { immediate: !1 });
|
|
49
|
+
return c({
|
|
50
|
+
isOpenDelayed: m,
|
|
51
|
+
delayDuration: r,
|
|
52
|
+
onOpen() {
|
|
53
|
+
_(), m.value = !1;
|
|
54
|
+
},
|
|
55
|
+
onClose() {
|
|
56
|
+
g();
|
|
57
|
+
},
|
|
58
|
+
isPointerInTransitRef: h,
|
|
59
|
+
disableHoverableContent: l,
|
|
60
|
+
disableClosingTrigger: u,
|
|
61
|
+
disabled: f,
|
|
62
|
+
ignoreNonKeyboardFocus: d,
|
|
63
|
+
content: p
|
|
64
|
+
}), (e, t) => a(e.$slots, "default");
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
//#endregion
|
|
68
|
+
export { l as TooltipProvider_default, s as injectTooltipProviderContext };
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { useTimeoutFn as e } from "../../../../../@vueuse_shared@14.3.0_vue@3.5.39_typescript@5.8.3_/node_modules/@vueuse/shared/dist/index.js";
|
|
2
|
+
import { useVModel as t } from "../../../../../@vueuse_core@14.3.0_vue@3.5.39_typescript@5.8.3_/node_modules/@vueuse/core/dist/index.js";
|
|
3
|
+
import { createContext as n } from "../shared/createContext.js";
|
|
4
|
+
import { useForwardExpose as r } from "../shared/useForwardExpose.js";
|
|
5
|
+
import { PopperRoot_default as i } from "../Popper/PopperRoot.js";
|
|
6
|
+
import { injectTooltipProviderContext as a } from "./TooltipProvider.js";
|
|
7
|
+
import { TOOLTIP_OPEN as o } from "./utils.js";
|
|
8
|
+
import { computed as s, createBlock as c, defineComponent as l, openBlock as u, ref as d, renderSlot as f, unref as p, watch as m, withCtx as h } from "vue";
|
|
9
|
+
//#region node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Tooltip/TooltipRoot.js
|
|
10
|
+
var [g, _] = /*#__PURE__*/ n("TooltipRoot"), v = /* @__PURE__ */ l({
|
|
11
|
+
__name: "TooltipRoot",
|
|
12
|
+
props: {
|
|
13
|
+
defaultOpen: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
required: !1,
|
|
16
|
+
default: !1
|
|
17
|
+
},
|
|
18
|
+
open: {
|
|
19
|
+
type: Boolean,
|
|
20
|
+
required: !1,
|
|
21
|
+
default: void 0
|
|
22
|
+
},
|
|
23
|
+
delayDuration: {
|
|
24
|
+
type: Number,
|
|
25
|
+
required: !1,
|
|
26
|
+
default: void 0
|
|
27
|
+
},
|
|
28
|
+
disableHoverableContent: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
required: !1,
|
|
31
|
+
default: void 0
|
|
32
|
+
},
|
|
33
|
+
disableClosingTrigger: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
required: !1,
|
|
36
|
+
default: void 0
|
|
37
|
+
},
|
|
38
|
+
disabled: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
required: !1,
|
|
41
|
+
default: void 0
|
|
42
|
+
},
|
|
43
|
+
ignoreNonKeyboardFocus: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
required: !1,
|
|
46
|
+
default: void 0
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
emits: ["update:open"],
|
|
50
|
+
setup(n, { emit: l }) {
|
|
51
|
+
let g = n, v = l;
|
|
52
|
+
r();
|
|
53
|
+
let y = a(), b = s(() => g.disableHoverableContent ?? y.disableHoverableContent.value), x = s(() => g.disableClosingTrigger ?? y.disableClosingTrigger.value), S = s(() => g.disabled ?? y.disabled.value), C = s(() => g.delayDuration ?? y.delayDuration.value), w = s(() => g.ignoreNonKeyboardFocus ?? y.ignoreNonKeyboardFocus.value), T = t(g, "open", v, {
|
|
54
|
+
defaultValue: g.defaultOpen,
|
|
55
|
+
passive: g.open === void 0
|
|
56
|
+
});
|
|
57
|
+
m(T, (e) => {
|
|
58
|
+
y.onClose && (e ? (y.onOpen(), document.dispatchEvent(new CustomEvent(o))) : y.onClose());
|
|
59
|
+
});
|
|
60
|
+
let E = d(!1), D = d(), O = s(() => T.value ? E.value ? "delayed-open" : "instant-open" : "closed"), { start: k, stop: A } = e(() => {
|
|
61
|
+
E.value = !0, T.value = !0;
|
|
62
|
+
}, C, { immediate: !1 });
|
|
63
|
+
function j() {
|
|
64
|
+
A(), E.value = !1, T.value = !0;
|
|
65
|
+
}
|
|
66
|
+
function M() {
|
|
67
|
+
A(), T.value = !1;
|
|
68
|
+
}
|
|
69
|
+
function N() {
|
|
70
|
+
k();
|
|
71
|
+
}
|
|
72
|
+
return _({
|
|
73
|
+
contentId: "",
|
|
74
|
+
open: T,
|
|
75
|
+
stateAttribute: O,
|
|
76
|
+
trigger: D,
|
|
77
|
+
onTriggerChange(e) {
|
|
78
|
+
D.value = e;
|
|
79
|
+
},
|
|
80
|
+
onTriggerEnter() {
|
|
81
|
+
y.isOpenDelayed.value ? N() : j();
|
|
82
|
+
},
|
|
83
|
+
onTriggerLeave() {
|
|
84
|
+
b.value ? M() : A();
|
|
85
|
+
},
|
|
86
|
+
onOpen: j,
|
|
87
|
+
onClose: M,
|
|
88
|
+
disableHoverableContent: b,
|
|
89
|
+
disableClosingTrigger: x,
|
|
90
|
+
disabled: S,
|
|
91
|
+
ignoreNonKeyboardFocus: w
|
|
92
|
+
}), (e, t) => (u(), c(p(i), null, {
|
|
93
|
+
default: h(() => [f(e.$slots, "default", { open: p(T) })]),
|
|
94
|
+
_: 3
|
|
95
|
+
}));
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
//#endregion
|
|
99
|
+
export { v as TooltipRoot_default, g as injectTooltipRootContext };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { useForwardExpose as e } from "../shared/useForwardExpose.js";
|
|
2
|
+
import { useId as t } from "../shared/useId.js";
|
|
3
|
+
import { Primitive as n } from "../Primitive/Primitive.js";
|
|
4
|
+
import { PopperAnchor_default as r } from "../Popper/PopperAnchor.js";
|
|
5
|
+
import { injectTooltipProviderContext as i } from "./TooltipProvider.js";
|
|
6
|
+
import { injectTooltipRootContext as a } from "./TooltipRoot.js";
|
|
7
|
+
import { computed as o, createBlock as s, createVNode as c, defineComponent as l, mergeProps as u, onMounted as d, openBlock as f, ref as p, renderSlot as m, toHandlers as h, unref as g, withCtx as _ } from "vue";
|
|
8
|
+
//#region node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/Tooltip/TooltipTrigger.js
|
|
9
|
+
var v = /* @__PURE__ */ l({
|
|
10
|
+
__name: "TooltipTrigger",
|
|
11
|
+
props: {
|
|
12
|
+
reference: {
|
|
13
|
+
type: null,
|
|
14
|
+
required: !1
|
|
15
|
+
},
|
|
16
|
+
asChild: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
required: !1
|
|
19
|
+
},
|
|
20
|
+
as: {
|
|
21
|
+
type: null,
|
|
22
|
+
required: !1,
|
|
23
|
+
default: "button"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
setup(l) {
|
|
27
|
+
let v = l, y = a(), b = i();
|
|
28
|
+
y.contentId ||= t(void 0, "reka-tooltip-content");
|
|
29
|
+
let { forwardRef: x, currentElement: S } = e(), C = p(!1), w = p(!1), T = o(() => y.disabled.value ? {} : {
|
|
30
|
+
click: M,
|
|
31
|
+
focus: A,
|
|
32
|
+
pointermove: O,
|
|
33
|
+
pointerleave: k,
|
|
34
|
+
pointerdown: D,
|
|
35
|
+
blur: j
|
|
36
|
+
});
|
|
37
|
+
d(() => {
|
|
38
|
+
y.onTriggerChange(S.value);
|
|
39
|
+
});
|
|
40
|
+
function E() {
|
|
41
|
+
setTimeout(() => {
|
|
42
|
+
C.value = !1;
|
|
43
|
+
}, 1);
|
|
44
|
+
}
|
|
45
|
+
function D() {
|
|
46
|
+
y.open && !y.disableClosingTrigger.value && y.onClose(), C.value = !0, document.addEventListener("pointerup", E, { once: !0 });
|
|
47
|
+
}
|
|
48
|
+
function O(e) {
|
|
49
|
+
e.pointerType !== "touch" && !w.value && !b.isPointerInTransitRef.value && (y.onTriggerEnter(), w.value = !0);
|
|
50
|
+
}
|
|
51
|
+
function k() {
|
|
52
|
+
y.onTriggerLeave(), w.value = !1;
|
|
53
|
+
}
|
|
54
|
+
function A(e) {
|
|
55
|
+
C.value || y.ignoreNonKeyboardFocus.value && !e.target.matches?.(":focus-visible") || y.onOpen();
|
|
56
|
+
}
|
|
57
|
+
function j() {
|
|
58
|
+
y.onClose();
|
|
59
|
+
}
|
|
60
|
+
function M() {
|
|
61
|
+
y.disableClosingTrigger.value || y.onClose();
|
|
62
|
+
}
|
|
63
|
+
return (e, t) => (f(), s(g(r), {
|
|
64
|
+
"as-child": "",
|
|
65
|
+
reference: e.reference
|
|
66
|
+
}, {
|
|
67
|
+
default: _(() => [c(g(n), u({
|
|
68
|
+
ref: g(x),
|
|
69
|
+
"aria-describedby": g(y).open.value ? g(y).contentId : void 0,
|
|
70
|
+
"data-state": g(y).stateAttribute.value,
|
|
71
|
+
as: e.as,
|
|
72
|
+
"as-child": v.asChild,
|
|
73
|
+
"data-grace-area-trigger": ""
|
|
74
|
+
}, h(T.value)), {
|
|
75
|
+
default: _(() => [m(e.$slots, "default")]),
|
|
76
|
+
_: 3
|
|
77
|
+
}, 16, [
|
|
78
|
+
"aria-describedby",
|
|
79
|
+
"data-state",
|
|
80
|
+
"as",
|
|
81
|
+
"as-child"
|
|
82
|
+
])]),
|
|
83
|
+
_: 3
|
|
84
|
+
}, 8, ["reference"]));
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
//#endregion
|
|
88
|
+
export { v as TooltipTrigger_default };
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { createEventHook as e, refAutoReset as t, tryOnScopeDispose as n } from "../../../../../@vueuse_shared@14.3.0_vue@3.5.39_typescript@5.8.3_/node_modules/@vueuse/shared/dist/index.js";
|
|
2
|
+
import { ref as r, watchEffect as i } from "vue";
|
|
3
|
+
//#region node_modules/.pnpm/reka-ui@2.10.1_vue@3.5.39_typescript@5.8.3_/node_modules/reka-ui/dist/shared/useGraceArea.js
|
|
4
|
+
function a(a, d) {
|
|
5
|
+
let f = t(!1, 300);
|
|
6
|
+
n(() => {
|
|
7
|
+
f.value = !1;
|
|
8
|
+
});
|
|
9
|
+
let p = r(null), m = e();
|
|
10
|
+
function h() {
|
|
11
|
+
p.value = null, f.value = !1;
|
|
12
|
+
}
|
|
13
|
+
function g(e, t) {
|
|
14
|
+
if (!t) return;
|
|
15
|
+
let n = e.currentTarget, r = {
|
|
16
|
+
x: e.clientX,
|
|
17
|
+
y: e.clientY
|
|
18
|
+
}, i = s(r, o(r, n.getBoundingClientRect()), 1), a = c(t.getBoundingClientRect()), l = u([...i, ...a]);
|
|
19
|
+
p.value = l, f.value = !0;
|
|
20
|
+
}
|
|
21
|
+
return i((e) => {
|
|
22
|
+
if (a.value && d.value) {
|
|
23
|
+
let t = (e) => g(e, d.value), n = (e) => g(e, a.value);
|
|
24
|
+
a.value.addEventListener("pointerleave", t), d.value.addEventListener("pointerleave", n), e(() => {
|
|
25
|
+
a.value?.removeEventListener("pointerleave", t), d.value?.removeEventListener("pointerleave", n);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
}), i((e) => {
|
|
29
|
+
if (p.value) {
|
|
30
|
+
let t = (e) => {
|
|
31
|
+
if (!p.value || !(e.target instanceof Element)) return;
|
|
32
|
+
let t = e.target, n = {
|
|
33
|
+
x: e.clientX,
|
|
34
|
+
y: e.clientY
|
|
35
|
+
}, r = a.value?.contains(t) || d.value?.contains(t), i = !l(n, p.value), o = !!t.closest("[data-grace-area-trigger]");
|
|
36
|
+
r ? h() : (i || o) && (h(), m.trigger());
|
|
37
|
+
};
|
|
38
|
+
a.value?.ownerDocument.addEventListener("pointermove", t), e(() => a.value?.ownerDocument.removeEventListener("pointermove", t));
|
|
39
|
+
}
|
|
40
|
+
}), {
|
|
41
|
+
isPointerInTransit: f,
|
|
42
|
+
onPointerExit: m.on
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function o(e, t) {
|
|
46
|
+
let n = Math.abs(t.top - e.y), r = Math.abs(t.bottom - e.y), i = Math.abs(t.right - e.x), a = Math.abs(t.left - e.x);
|
|
47
|
+
switch (Math.min(n, r, i, a)) {
|
|
48
|
+
case a: return "left";
|
|
49
|
+
case i: return "right";
|
|
50
|
+
case n: return "top";
|
|
51
|
+
case r: return "bottom";
|
|
52
|
+
default: throw Error("unreachable");
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
function s(e, t, n = 5) {
|
|
56
|
+
let r = [];
|
|
57
|
+
switch (t) {
|
|
58
|
+
case "top":
|
|
59
|
+
r.push({
|
|
60
|
+
x: e.x - n,
|
|
61
|
+
y: e.y + n
|
|
62
|
+
}, {
|
|
63
|
+
x: e.x + n,
|
|
64
|
+
y: e.y + n
|
|
65
|
+
});
|
|
66
|
+
break;
|
|
67
|
+
case "bottom":
|
|
68
|
+
r.push({
|
|
69
|
+
x: e.x - n,
|
|
70
|
+
y: e.y - n
|
|
71
|
+
}, {
|
|
72
|
+
x: e.x + n,
|
|
73
|
+
y: e.y - n
|
|
74
|
+
});
|
|
75
|
+
break;
|
|
76
|
+
case "left":
|
|
77
|
+
r.push({
|
|
78
|
+
x: e.x + n,
|
|
79
|
+
y: e.y - n
|
|
80
|
+
}, {
|
|
81
|
+
x: e.x + n,
|
|
82
|
+
y: e.y + n
|
|
83
|
+
});
|
|
84
|
+
break;
|
|
85
|
+
case "right":
|
|
86
|
+
r.push({
|
|
87
|
+
x: e.x - n,
|
|
88
|
+
y: e.y - n
|
|
89
|
+
}, {
|
|
90
|
+
x: e.x - n,
|
|
91
|
+
y: e.y + n
|
|
92
|
+
});
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
return r;
|
|
96
|
+
}
|
|
97
|
+
function c(e) {
|
|
98
|
+
let { top: t, right: n, bottom: r, left: i } = e;
|
|
99
|
+
return [
|
|
100
|
+
{
|
|
101
|
+
x: i,
|
|
102
|
+
y: t
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
x: n,
|
|
106
|
+
y: t
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
x: n,
|
|
110
|
+
y: r
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
x: i,
|
|
114
|
+
y: r
|
|
115
|
+
}
|
|
116
|
+
];
|
|
117
|
+
}
|
|
118
|
+
function l(e, t) {
|
|
119
|
+
let { x: n, y: r } = e, i = !1;
|
|
120
|
+
for (let e = 0, a = t.length - 1; e < t.length; a = e++) {
|
|
121
|
+
let o = t[e].x, s = t[e].y, c = t[a].x, l = t[a].y;
|
|
122
|
+
s > r != l > r && n < (c - o) * (r - s) / (l - s) + o && (i = !i);
|
|
123
|
+
}
|
|
124
|
+
return i;
|
|
125
|
+
}
|
|
126
|
+
function u(e) {
|
|
127
|
+
let t = e.slice();
|
|
128
|
+
return t.sort((e, t) => e.x < t.x ? -1 : e.x > t.x ? 1 : e.y < t.y ? -1 : +(e.y > t.y)), d(t);
|
|
129
|
+
}
|
|
130
|
+
function d(e) {
|
|
131
|
+
if (e.length <= 1) return e.slice();
|
|
132
|
+
let t = [];
|
|
133
|
+
for (let n = 0; n < e.length; n++) {
|
|
134
|
+
let r = e[n];
|
|
135
|
+
for (; t.length >= 2;) {
|
|
136
|
+
let e = t.at(-1), n = t[t.length - 2];
|
|
137
|
+
if ((e.x - n.x) * (r.y - n.y) >= (e.y - n.y) * (r.x - n.x)) t.pop();
|
|
138
|
+
else break;
|
|
139
|
+
}
|
|
140
|
+
t.push(r);
|
|
141
|
+
}
|
|
142
|
+
t.pop();
|
|
143
|
+
let n = [];
|
|
144
|
+
for (let t = e.length - 1; t >= 0; t--) {
|
|
145
|
+
let r = e[t];
|
|
146
|
+
for (; n.length >= 2;) {
|
|
147
|
+
let e = n.at(-1), t = n[n.length - 2];
|
|
148
|
+
if ((e.x - t.x) * (r.y - t.y) >= (e.y - t.y) * (r.x - t.x)) n.pop();
|
|
149
|
+
else break;
|
|
150
|
+
}
|
|
151
|
+
n.push(r);
|
|
152
|
+
}
|
|
153
|
+
return n.pop(), t.length === 1 && n.length === 1 && t[0].x === n[0].x && t[0].y === n[0].y ? t : t.concat(n);
|
|
154
|
+
}
|
|
155
|
+
//#endregion
|
|
156
|
+
export { a as useGraceArea };
|