@flamingo-stack/openframe-frontend-core 0.0.248 → 0.0.249
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/{chunk-AGU44B7B.js → chunk-2FCXJTOV.js} +55 -357
- package/dist/chunk-2FCXJTOV.js.map +1 -0
- package/dist/{chunk-QHYCWQBH.cjs → chunk-3DZ7QYNA.cjs} +166 -15
- package/dist/chunk-3DZ7QYNA.cjs.map +1 -0
- package/dist/{chunk-4VSPLMB6.cjs → chunk-3VTHSACO.cjs} +34 -32
- package/dist/chunk-3VTHSACO.cjs.map +1 -0
- package/dist/{chunk-PMYD4WKR.cjs → chunk-4EED3YEI.cjs} +1550 -5971
- package/dist/chunk-4EED3YEI.cjs.map +1 -0
- package/dist/{chunk-RV2PYHCJ.js → chunk-4HHYUEMD.js} +3 -3
- package/dist/{chunk-UECRKCKH.js → chunk-4RDJZIHW.js} +115 -279
- package/dist/chunk-4RDJZIHW.js.map +1 -0
- package/dist/{chunk-672QV33W.js → chunk-5ZVPKTXM.js} +167 -16
- package/dist/chunk-5ZVPKTXM.js.map +1 -0
- package/dist/chunk-6JINAOI7.cjs +311 -0
- package/dist/chunk-6JINAOI7.cjs.map +1 -0
- package/dist/chunk-6LK4VEXE.cjs +4514 -0
- package/dist/chunk-6LK4VEXE.cjs.map +1 -0
- package/dist/chunk-DAAFVOTL.cjs +172 -0
- package/dist/chunk-DAAFVOTL.cjs.map +1 -0
- package/dist/{chunk-27VVOBDB.cjs → chunk-ELF4OOHC.cjs} +16 -180
- package/dist/chunk-ELF4OOHC.cjs.map +1 -0
- package/dist/{chunk-OZKPUBKX.cjs → chunk-LHZYI23D.cjs} +32 -30
- package/dist/chunk-LHZYI23D.cjs.map +1 -0
- package/dist/chunk-LKI3YCAX.js +4514 -0
- package/dist/chunk-LKI3YCAX.js.map +1 -0
- package/dist/{chunk-2Q5GVNXP.cjs → chunk-LZL6P7SN.cjs} +12 -12
- package/dist/{chunk-2Q5GVNXP.cjs.map → chunk-LZL6P7SN.cjs.map} +1 -1
- package/dist/chunk-M2OCXTNT.js +311 -0
- package/dist/chunk-M2OCXTNT.js.map +1 -0
- package/dist/{chunk-OTFJKBDW.js → chunk-PCXI7ZB2.js} +4928 -9349
- package/dist/chunk-PCXI7ZB2.js.map +1 -0
- package/dist/{chunk-PJT6RRSP.js → chunk-PVAYXHYF.js} +7 -5
- package/dist/{chunk-PJT6RRSP.js.map → chunk-PVAYXHYF.js.map} +1 -1
- package/dist/{chunk-GRTZ23GL.cjs → chunk-TU26IZPO.cjs} +16 -318
- package/dist/chunk-TU26IZPO.cjs.map +1 -0
- package/dist/{chunk-NFUXCXYN.js → chunk-VAKBNCV6.js} +7 -5
- package/dist/{chunk-NFUXCXYN.js.map → chunk-VAKBNCV6.js.map} +1 -1
- package/dist/chunk-ZXZJSTNV.js +172 -0
- package/dist/chunk-ZXZJSTNV.js.map +1 -0
- package/dist/components/chat/index.cjs +11 -7
- package/dist/components/chat/index.cjs.map +1 -1
- package/dist/components/chat/index.js +53 -49
- package/dist/components/contact/index.cjs +11 -8
- package/dist/components/contact/index.cjs.map +1 -1
- package/dist/components/contact/index.js +10 -7
- package/dist/components/features/index.cjs +11 -7
- package/dist/components/features/index.cjs.map +1 -1
- package/dist/components/features/index.js +26 -22
- package/dist/components/index.cjs +112 -109
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +134 -131
- package/dist/components/index.js.map +1 -1
- package/dist/components/navigation/index.cjs +10 -7
- package/dist/components/navigation/index.cjs.map +1 -1
- package/dist/components/navigation/index.js +9 -6
- package/dist/components/onboarding-guides/index.cjs +43 -53
- package/dist/components/onboarding-guides/index.cjs.map +1 -1
- package/dist/components/onboarding-guides/index.js +25 -35
- package/dist/components/onboarding-guides/index.js.map +1 -1
- package/dist/components/onboarding-guides/onboarding-guides-catalog-skeleton.d.ts +11 -11
- package/dist/components/onboarding-guides/onboarding-guides-catalog-skeleton.d.ts.map +1 -1
- package/dist/components/related-content/index.cjs +11 -8
- package/dist/components/related-content/index.cjs.map +1 -1
- package/dist/components/related-content/index.js +10 -7
- package/dist/components/tickets/index.cjs +96 -93
- package/dist/components/tickets/index.cjs.map +1 -1
- package/dist/components/tickets/index.js +21 -18
- package/dist/components/tickets/index.js.map +1 -1
- package/dist/components/ui/file-manager/index.cjs +52 -50
- package/dist/components/ui/file-manager/index.cjs.map +1 -1
- package/dist/components/ui/file-manager/index.js +6 -4
- package/dist/components/ui/file-manager/index.js.map +1 -1
- package/dist/components/ui/index.cjs +16 -11
- package/dist/components/ui/index.cjs.map +1 -1
- package/dist/components/ui/index.js +102 -97
- package/dist/contexts/index.cjs +2 -2
- package/dist/contexts/index.js +5 -5
- package/dist/hooks/index.cjs +6 -4
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.js +8 -6
- package/dist/index.cjs +17 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +157 -151
- package/package.json +1 -1
- package/src/components/onboarding-guides/onboarding-guides-catalog-skeleton.tsx +28 -33
- package/dist/chunk-27VVOBDB.cjs.map +0 -1
- package/dist/chunk-4VSPLMB6.cjs.map +0 -1
- package/dist/chunk-672QV33W.js.map +0 -1
- package/dist/chunk-AGU44B7B.js.map +0 -1
- package/dist/chunk-GRTZ23GL.cjs.map +0 -1
- package/dist/chunk-OTFJKBDW.js.map +0 -1
- package/dist/chunk-OZKPUBKX.cjs.map +0 -1
- package/dist/chunk-PMYD4WKR.cjs.map +0 -1
- package/dist/chunk-QHYCWQBH.cjs.map +0 -1
- package/dist/chunk-QWYJETDL.cjs +0 -162
- package/dist/chunk-QWYJETDL.cjs.map +0 -1
- package/dist/chunk-UECRKCKH.js.map +0 -1
- package/dist/chunk-WTTLEGEO.js +0 -162
- package/dist/chunk-WTTLEGEO.js.map +0 -1
- /package/dist/{chunk-RV2PYHCJ.js.map → chunk-4HHYUEMD.js.map} +0 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
|
|
2
|
+
|
|
3
|
+
// src/hooks/ui/use-auto-limit-tags.ts
|
|
4
|
+
var _react = require('react');
|
|
5
|
+
function useAutoLimitTags({
|
|
6
|
+
count,
|
|
7
|
+
limitTags = "auto",
|
|
8
|
+
placeholder = "",
|
|
9
|
+
reserveInputWidth = true
|
|
10
|
+
}) {
|
|
11
|
+
const middleRef = _react.useRef.call(void 0, null);
|
|
12
|
+
const measureRef = _react.useRef.call(void 0, null);
|
|
13
|
+
const textMeasureRef = _react.useRef.call(void 0, null);
|
|
14
|
+
const badgeRef = _react.useRef.call(void 0, null);
|
|
15
|
+
const inputRef = _react.useRef.call(void 0, null);
|
|
16
|
+
const [visibleCount, setVisibleCount] = _react.useState.call(void 0, count);
|
|
17
|
+
const recalculate = _react.useCallback.call(void 0, () => {
|
|
18
|
+
if (limitTags !== "auto") {
|
|
19
|
+
setVisibleCount(Math.min(limitTags, count));
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
const middle = middleRef.current;
|
|
23
|
+
const measure = measureRef.current;
|
|
24
|
+
if (!middle || !measure) {
|
|
25
|
+
setVisibleCount(count);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (count === 0) {
|
|
29
|
+
setVisibleCount(0);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const cs = getComputedStyle(middle);
|
|
33
|
+
const padL = parseFloat(cs.paddingLeft) || 0;
|
|
34
|
+
const padR = parseFloat(cs.paddingRight) || 0;
|
|
35
|
+
const gap = parseFloat(cs.gap) || 0;
|
|
36
|
+
const middleW = middle.clientWidth;
|
|
37
|
+
let inputReservedW = 0;
|
|
38
|
+
let trailingGap = 0;
|
|
39
|
+
if (reserveInputWidth) {
|
|
40
|
+
const textW = _nullishCoalesce(_optionalChain([textMeasureRef, 'access', _ => _.current, 'optionalAccess', _2 => _2.offsetWidth]), () => ( 60));
|
|
41
|
+
const inputMinW = inputRef.current ? parseFloat(getComputedStyle(inputRef.current).minWidth) || 60 : 60;
|
|
42
|
+
inputReservedW = Math.max(textW + 8, inputMinW);
|
|
43
|
+
trailingGap = gap;
|
|
44
|
+
}
|
|
45
|
+
const available = middleW - padL - padR - inputReservedW - trailingGap;
|
|
46
|
+
const tagEls = Array.from(measure.children);
|
|
47
|
+
const widths = tagEls.map((el) => el.offsetWidth);
|
|
48
|
+
let total = 0;
|
|
49
|
+
for (let i = 0; i < widths.length; i++) {
|
|
50
|
+
total += widths[i] + (i > 0 ? gap : 0);
|
|
51
|
+
}
|
|
52
|
+
if (total <= available) {
|
|
53
|
+
setVisibleCount(count);
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
const badgeW = _nullishCoalesce(_optionalChain([badgeRef, 'access', _3 => _3.current, 'optionalAccess', _4 => _4.offsetWidth]), () => ( 40));
|
|
57
|
+
const spaceWithBadge = available - badgeW - gap;
|
|
58
|
+
let used = 0;
|
|
59
|
+
let fitCount = 0;
|
|
60
|
+
for (let i = 0; i < widths.length; i++) {
|
|
61
|
+
const need = widths[i] + (i > 0 ? gap : 0);
|
|
62
|
+
if (used + need > spaceWithBadge) break;
|
|
63
|
+
used += need;
|
|
64
|
+
fitCount++;
|
|
65
|
+
}
|
|
66
|
+
setVisibleCount(Math.max(0, fitCount));
|
|
67
|
+
}, [count, limitTags, placeholder, reserveInputWidth]);
|
|
68
|
+
_react.useEffect.call(void 0, () => {
|
|
69
|
+
recalculate();
|
|
70
|
+
}, [recalculate]);
|
|
71
|
+
_react.useEffect.call(void 0, () => {
|
|
72
|
+
const el = middleRef.current;
|
|
73
|
+
if (!el) return;
|
|
74
|
+
const ro = new ResizeObserver(recalculate);
|
|
75
|
+
ro.observe(el);
|
|
76
|
+
return () => ro.disconnect();
|
|
77
|
+
}, [recalculate]);
|
|
78
|
+
return { visibleCount, middleRef, measureRef, textMeasureRef, badgeRef, inputRef };
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// src/hooks/ui/use-debounce.ts
|
|
82
|
+
|
|
83
|
+
function useDebounce(value, delay = 500) {
|
|
84
|
+
const [debouncedValue, setDebouncedValue] = _react.useState.call(void 0, value);
|
|
85
|
+
_react.useEffect.call(void 0, () => {
|
|
86
|
+
const timer = setTimeout(() => {
|
|
87
|
+
setDebouncedValue(value);
|
|
88
|
+
}, delay);
|
|
89
|
+
return () => {
|
|
90
|
+
clearTimeout(timer);
|
|
91
|
+
};
|
|
92
|
+
}, [value, delay]);
|
|
93
|
+
return debouncedValue;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
// src/hooks/use-near-viewport.ts
|
|
97
|
+
|
|
98
|
+
var observers = /* @__PURE__ */ new Map();
|
|
99
|
+
var subscribers = /* @__PURE__ */ new WeakMap();
|
|
100
|
+
function getObserverFor(rootMargin) {
|
|
101
|
+
const existing = observers.get(rootMargin);
|
|
102
|
+
if (existing) return existing;
|
|
103
|
+
const io = new IntersectionObserver(
|
|
104
|
+
(entries) => {
|
|
105
|
+
entries.forEach((entry) => {
|
|
106
|
+
if (!entry.isIntersecting) return;
|
|
107
|
+
const cb = subscribers.get(entry.target);
|
|
108
|
+
if (cb) {
|
|
109
|
+
cb();
|
|
110
|
+
io.unobserve(entry.target);
|
|
111
|
+
subscribers.delete(entry.target);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
},
|
|
115
|
+
{ rootMargin }
|
|
116
|
+
);
|
|
117
|
+
observers.set(rootMargin, io);
|
|
118
|
+
return io;
|
|
119
|
+
}
|
|
120
|
+
function useNearViewport(rootMargin = "500px") {
|
|
121
|
+
const [isNear, setIsNear] = _react.useState.call(void 0, false);
|
|
122
|
+
const elRef = _react.useRef.call(void 0, null);
|
|
123
|
+
const ref = _react.useCallback.call(void 0,
|
|
124
|
+
(node) => {
|
|
125
|
+
const prev = elRef.current;
|
|
126
|
+
if (prev) {
|
|
127
|
+
const stillOurs = subscribers.get(prev);
|
|
128
|
+
if (stillOurs) {
|
|
129
|
+
subscribers.delete(prev);
|
|
130
|
+
_optionalChain([observers, 'access', _5 => _5.get, 'call', _6 => _6(rootMargin), 'optionalAccess', _7 => _7.unobserve, 'call', _8 => _8(prev)]);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
elRef.current = node;
|
|
134
|
+
if (!node) return;
|
|
135
|
+
const cb = () => setIsNear(true);
|
|
136
|
+
subscribers.set(node, cb);
|
|
137
|
+
getObserverFor(rootMargin).observe(node);
|
|
138
|
+
},
|
|
139
|
+
[rootMargin]
|
|
140
|
+
);
|
|
141
|
+
_react.useEffect.call(void 0, () => {
|
|
142
|
+
return () => {
|
|
143
|
+
const el = elRef.current;
|
|
144
|
+
if (!el) return;
|
|
145
|
+
if (subscribers.get(el)) {
|
|
146
|
+
subscribers.delete(el);
|
|
147
|
+
_optionalChain([observers, 'access', _9 => _9.get, 'call', _10 => _10(rootMargin), 'optionalAccess', _11 => _11.unobserve, 'call', _12 => _12(el)]);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
}, [rootMargin]);
|
|
151
|
+
return { ref, isNear };
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
// src/hooks/use-og-placeholder.ts
|
|
155
|
+
|
|
156
|
+
function useOgPlaceholder(buildUrl, title, siteName = "", enabled = true, aspect = "wide") {
|
|
157
|
+
return _react.useMemo.call(void 0, () => {
|
|
158
|
+
if (!enabled || !title) return null;
|
|
159
|
+
const options = {};
|
|
160
|
+
if (siteName) options.site = siteName;
|
|
161
|
+
if (aspect === "square") options.aspect = "square";
|
|
162
|
+
return buildUrl(title, options);
|
|
163
|
+
}, [buildUrl, title, siteName, enabled, aspect]);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
exports.useAutoLimitTags = useAutoLimitTags; exports.useDebounce = useDebounce; exports.useNearViewport = useNearViewport; exports.useOgPlaceholder = useOgPlaceholder;
|
|
172
|
+
//# sourceMappingURL=chunk-DAAFVOTL.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-DAAFVOTL.cjs","../src/hooks/ui/use-auto-limit-tags.ts","../src/hooks/ui/use-debounce.ts","../src/hooks/use-near-viewport.ts","../src/hooks/use-og-placeholder.ts"],"names":["useState","useEffect","useRef","useCallback"],"mappings":"AAAA,6rBAAY;AACZ;AACA;ACAA,8BAAyD;AA2ClD,SAAS,gBAAA,CAAiB;AAAA,EAC/B,KAAA;AAAA,EACA,UAAA,EAAY,MAAA;AAAA,EACZ,YAAA,EAAc,EAAA;AAAA,EACd,kBAAA,EAAoB;AACtB,CAAA,EAAoD;AAClD,EAAA,MAAM,UAAA,EAAY,2BAAA,IAA2B,CAAA;AAC7C,EAAA,MAAM,WAAA,EAAa,2BAAA,IAA2B,CAAA;AAC9C,EAAA,MAAM,eAAA,EAAiB,2BAAA,IAA4B,CAAA;AACnD,EAAA,MAAM,SAAA,EAAW,2BAAA,IAA8B,CAAA;AAC/C,EAAA,MAAM,SAAA,EAAW,2BAAA,IAA6B,CAAA;AAC9C,EAAA,MAAM,CAAC,YAAA,EAAc,eAAe,EAAA,EAAI,6BAAA,KAAc,CAAA;AAEtD,EAAA,MAAM,YAAA,EAAc,gCAAA,CAAY,EAAA,GAAM;AAEpC,IAAA,GAAA,CAAI,UAAA,IAAc,MAAA,EAAQ;AACxB,MAAA,eAAA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EACnB,QAAA,EAAmB,IAAA,EACnB,OAAA,EAA4B,MAAA,EACb;AACf,EAAA,OAAO,4BAAA,CAAQ,EAAA,GAAM;AACnB,IAAA,GAAA,CAAI,CAAC,QAAA,GAAW,CAAC,KAAA,EAAO,OAAO,IAAA;AAC/B,IAAA,MAAM,QAAA,EAAyD,CAAC,CAAA;AAChE,IAAA,GAAA,CAAI,QAAA,EAAU,OAAA,CAAQ,KAAA,EAAO,QAAA;AAC7B,IAAA,GAAA,CAAI,OAAA,IAAW,QAAA,EAAU,OAAA,CAAQ,OAAA,EAAS,QAAA;AAC1C,IAAA,OAAO,QAAA,CAAS,KAAA,EAAO,OAAO,CAAA;AAAA,EAChC,CAAA,EAAG,CAAC,QAAA,EAAU,KAAA,EAAO,QAAA,EAAU,OAAA,EAAS,MAAM,CAAC,CAAA;AACjD;AJwHA;AACA;AACE;AACA;AACA;AACA;AACF,uKAAC","file":"/home/runner/work/openframe-oss-lib/openframe-oss-lib/openframe-frontend-core/dist/chunk-DAAFVOTL.cjs","sourcesContent":[null,"\"use client\"\n\nimport { useCallback, useEffect, useRef, useState } from \"react\"\n\nexport interface UseAutoLimitTagsOptions {\n /** Total number of tags */\n count: number\n /** Fixed limit or \"auto\" for DOM-based measurement. Default \"auto\" */\n limitTags?: number | \"auto\"\n /** Placeholder text used to reserve input width (only used in \"auto\" mode) */\n placeholder?: string\n /**\n * Reserve trailing space for a text input (the autocomplete combobox). Set\n * `false` for a pure chip row that has no input — then only the chips and the\n * \"+N\" / \"⋯\" overflow badge compete for the available width. Default `true`.\n */\n reserveInputWidth?: boolean\n}\n\nexport interface UseAutoLimitTagsReturn {\n /** How many tags to show */\n visibleCount: number\n /** Ref for the zone that contains tags + input (must have overflow-hidden, gap, padding) */\n middleRef: React.RefObject<HTMLDivElement | null>\n /** Ref for the off-screen container that holds measurement copies of ALL tags */\n measureRef: React.RefObject<HTMLDivElement | null>\n /** Ref for the hidden span that measures placeholder text width */\n textMeasureRef: React.RefObject<HTMLSpanElement | null>\n /** Ref for the \"+N\" badge element (used to measure its width) */\n badgeRef: React.RefObject<HTMLButtonElement | null>\n /** Ref for the input element (used to read its min-width) */\n inputRef: React.RefObject<HTMLInputElement | null>\n}\n\n/**\n * Calculates how many tags fit in a single-line container.\n *\n * Requires three off-screen measurement elements rendered by the consumer:\n * 1. A `<div ref={measureRef}>` containing Tag copies for every item (to measure widths)\n * 2. A `<span ref={textMeasureRef}>` containing the placeholder text (to reserve input width)\n * 3. The `<button ref={badgeRef}>` for the \"+N\" badge (to measure badge width)\n *\n * The hook reads real CSS values (padding, gap) from the middleRef container,\n * so it works regardless of responsive breakpoints or custom styling.\n */\nexport function useAutoLimitTags({\n count,\n limitTags = \"auto\",\n placeholder = \"\",\n reserveInputWidth = true,\n}: UseAutoLimitTagsOptions): UseAutoLimitTagsReturn {\n const middleRef = useRef<HTMLDivElement>(null)\n const measureRef = useRef<HTMLDivElement>(null)\n const textMeasureRef = useRef<HTMLSpanElement>(null)\n const badgeRef = useRef<HTMLButtonElement>(null)\n const inputRef = useRef<HTMLInputElement>(null)\n const [visibleCount, setVisibleCount] = useState(count)\n\n const recalculate = useCallback(() => {\n // Fixed limit — skip DOM measurement\n if (limitTags !== \"auto\") {\n setVisibleCount(Math.min(limitTags, count))\n return\n }\n\n const middle = middleRef.current\n const measure = measureRef.current\n if (!middle || !measure) {\n setVisibleCount(count)\n return\n }\n if (count === 0) {\n setVisibleCount(0)\n return\n }\n\n // Read real CSS metrics from the middle zone\n const cs = getComputedStyle(middle)\n const padL = parseFloat(cs.paddingLeft) || 0\n const padR = parseFloat(cs.paddingRight) || 0\n const gap = parseFloat(cs.gap) || 0\n const middleW = middle.clientWidth\n\n // Reserve trailing space for the input (autocomplete only). A pure chip row\n // (`reserveInputWidth: false`) has no input, so nothing — and no gap before\n // it — is reserved.\n let inputReservedW = 0\n let trailingGap = 0\n if (reserveInputWidth) {\n const textW = textMeasureRef.current?.offsetWidth ?? 60\n const inputMinW = inputRef.current\n ? parseFloat(getComputedStyle(inputRef.current).minWidth) || 60\n : 60\n inputReservedW = Math.max(textW + 8, inputMinW)\n trailingGap = gap\n }\n\n // Available = middle zone − padding − input reserved − gap before input\n const available = middleW - padL - padR - inputReservedW - trailingGap\n\n // Measure every tag from the off-screen container\n const tagEls = Array.from(measure.children) as HTMLElement[]\n const widths = tagEls.map((el) => el.offsetWidth)\n\n // Fast check: do ALL tags fit?\n let total = 0\n for (let i = 0; i < widths.length; i++) {\n total += widths[i] + (i > 0 ? gap : 0)\n }\n if (total <= available) {\n setVisibleCount(count)\n return\n }\n\n // Not all fit → reserve space for the \"+N\" badge\n const badgeW = badgeRef.current?.offsetWidth ?? 40\n const spaceWithBadge = available - badgeW - gap\n\n let used = 0\n let fitCount = 0\n for (let i = 0; i < widths.length; i++) {\n const need = widths[i] + (i > 0 ? gap : 0)\n if (used + need > spaceWithBadge) break\n used += need\n fitCount++\n }\n\n setVisibleCount(Math.max(0, fitCount))\n }, [count, limitTags, placeholder, reserveInputWidth])\n\n // Recalculate when inputs change\n useEffect(() => {\n recalculate()\n }, [recalculate])\n\n // Recalculate on container resize\n useEffect(() => {\n const el = middleRef.current\n if (!el) return\n const ro = new ResizeObserver(recalculate)\n ro.observe(el)\n return () => ro.disconnect()\n }, [recalculate])\n\n return { visibleCount, middleRef, measureRef, textMeasureRef, badgeRef, inputRef }\n}\n","\"use client\"\n\nimport { useState, useEffect } from \"react\"\n\n/**\n * Hook to debounce a value\n * @param value - Value to debounce\n * @param delay - Delay in milliseconds\n * @returns Debounced value\n */\nexport function useDebounce<T>(value: T, delay = 500): T {\n const [debouncedValue, setDebouncedValue] = useState<T>(value)\n\n useEffect(() => {\n // Set up timeout to update debounced value\n const timer = setTimeout(() => {\n setDebouncedValue(value)\n }, delay)\n\n // Clean up timeout on value change or unmount\n return () => {\n clearTimeout(timer)\n }\n }, [value, delay])\n\n return debouncedValue\n}\n","/**\n * useNearViewport — module-level shared IntersectionObserver in hook form.\n *\n * Single IO instance per `rootMargin` value, shared across every component\n * that mounts the hook. Reduces overhead vs. one IO per component on\n * grid/list pages where many subscribers observe the viewport with the same\n * margin. Promoted from the inline singleton at\n * `multi-platform-hub/components/shared/video-bites-display.tsx:21-43`,\n * which is the only IO pattern in either repo today.\n *\n * Usage:\n * ```tsx\n * function MyCard() {\n * const { ref, isNear } = useNearViewport('500px');\n * return <div ref={ref}>{isNear ? <HeavyChild /> : <Placeholder />}</div>;\n * }\n * ```\n *\n * StrictMode safety: cleanup uses an identity check on the registered\n * callback so React's dev double-mount (mount → cleanup → re-mount) does\n * not drop the second mount's freshly-set subscription. The IO callback\n * also checks `subscribers.get(target)` before invoking so a fire that\n * races with unmount cannot crash on a torn-down component.\n *\n * The hook fires once — on first intersection it sets `isNear=true` and\n * unobserves the element. Callers that need re-observation should\n * unmount and remount (or fork the hook for two-way behavior).\n */\n\nimport { useEffect, useRef, useState, useCallback } from 'react';\n\n// Per-rootMargin IO map. Multiple call sites with different margins each\n// get their own singleton observer.\nconst observers = new Map<string, IntersectionObserver>();\nconst subscribers = new WeakMap<Element, () => void>();\n\nfunction getObserverFor(rootMargin: string): IntersectionObserver {\n const existing = observers.get(rootMargin);\n if (existing) return existing;\n\n const io = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n if (!entry.isIntersecting) return;\n // Race-safe: re-read the callback at fire time. A late IO firing\n // after cleanup must not invoke a stale callback.\n const cb = subscribers.get(entry.target);\n if (cb) {\n cb();\n io.unobserve(entry.target);\n subscribers.delete(entry.target);\n }\n });\n },\n { rootMargin }\n );\n observers.set(rootMargin, io);\n return io;\n}\n\nexport interface UseNearViewportResult<T extends Element = HTMLElement> {\n /** Ref to attach to the element you want to gate on visibility. */\n ref: (node: T | null) => void;\n /** Flips to `true` once the element enters within `rootMargin` of the viewport. Never flips back. */\n isNear: boolean;\n}\n\n/**\n * @param rootMargin Margin around the viewport (CSS-style string).\n * '500px' = element starts mounting 500px before scroll-in.\n * '1000px' = a full viewport's worth of lookahead.\n * '0px' = strict on-screen detection.\n */\nexport function useNearViewport<T extends Element = HTMLElement>(\n rootMargin: string = '500px'\n): UseNearViewportResult<T> {\n const [isNear, setIsNear] = useState(false);\n const elRef = useRef<T | null>(null);\n\n // Subscribe/unsubscribe on element change.\n const ref = useCallback(\n (node: T | null) => {\n const prev = elRef.current;\n\n // Unsubscribe previous, if any. Identity-check the callback so a\n // StrictMode re-mount that has already re-registered keeps its sub.\n if (prev) {\n const stillOurs = subscribers.get(prev);\n if (stillOurs) {\n subscribers.delete(prev);\n observers.get(rootMargin)?.unobserve(prev);\n }\n }\n\n elRef.current = node;\n if (!node) return;\n\n const cb = () => setIsNear(true);\n subscribers.set(node, cb);\n getObserverFor(rootMargin).observe(node);\n },\n [rootMargin]\n );\n\n // Unsubscribe on unmount. Identity check guards the StrictMode race.\n useEffect(() => {\n return () => {\n const el = elRef.current;\n if (!el) return;\n if (subscribers.get(el)) {\n subscribers.delete(el);\n observers.get(rootMargin)?.unobserve(el);\n }\n };\n }, [rootMargin]);\n\n return { ref, isNear };\n}\n","'use client'\n\nimport { useMemo } from 'react'\n\n/**\n * Hook that generates a branded placeholder image URL using the\n * host's `/api/og-placeholder` server-side image generator (or any\n * builder the caller supplies).\n *\n * THIS HOOK IS A THIN CLIENT-SIDE WRAPPER. The hub-side wrapper\n * (`hooks/use-og-placeholder.ts` in multi-platform-hub) injects its\n * canonical `buildOgPlaceholderUrl` from `lib/utils/entity-image.ts`.\n * The lib version takes the builder as an argument so the lib has no\n * hub dependency.\n *\n * @param buildUrl - Function that builds the placeholder URL from a\n * title + options object (`{ site?, aspect? }`).\n * Hub passes `buildOgPlaceholderUrl` from\n * `lib/utils/entity-image.ts`. Embedded apps can\n * wire any equivalent that hits their own placeholder\n * route.\n * @param title - Text to display on the placeholder\n * @param siteName - Site name shown below the title (optional —\n * defaults to empty)\n * @param enabled - Whether to generate the URL (default: true)\n * @param aspect - `'wide'` (1200×630 social-card; default) or `'square'`\n * (1024×1024 — used by compact chat-inline card slots\n * so `object-cover` doesn't crop the title off).\n * @returns Placeholder image URL or null if disabled / no title\n */\nexport function useOgPlaceholder(\n buildUrl: (title: string, options: { site?: string; aspect?: 'wide' | 'square' }) => string,\n title: string | undefined | null,\n siteName: string = '',\n enabled: boolean = true,\n aspect: 'wide' | 'square' = 'wide',\n): string | null {\n return useMemo(() => {\n if (!enabled || !title) return null\n const options: { site?: string; aspect?: 'wide' | 'square' } = {}\n if (siteName) options.site = siteName\n if (aspect === 'square') options.aspect = 'square'\n return buildUrl(title, options)\n }, [buildUrl, title, siteName, enabled, aspect])\n}\n"]}
|
|
@@ -4,6 +4,12 @@
|
|
|
4
4
|
var _chunk27APPAJNcjs = require('./chunk-27APPAJN.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
var _chunkOZ3GH6OQcjs = require('./chunk-OZ3GH6OQ.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
var _chunkDAAFVOTLcjs = require('./chunk-DAAFVOTL.cjs');
|
|
11
|
+
|
|
12
|
+
|
|
7
13
|
|
|
8
14
|
|
|
9
15
|
var _chunkG7UE6RKVcjs = require('./chunk-G7UE6RKV.cjs');
|
|
@@ -27,26 +33,8 @@ var _chunkFIG2RKZFcjs = require('./chunk-FIG2RKZF.cjs');
|
|
|
27
33
|
|
|
28
34
|
var _chunkC6ASEPZLcjs = require('./chunk-C6ASEPZL.cjs');
|
|
29
35
|
|
|
30
|
-
|
|
31
|
-
var _chunkOZ3GH6OQcjs = require('./chunk-OZ3GH6OQ.cjs');
|
|
32
|
-
|
|
33
|
-
// src/hooks/ui/use-debounce.ts
|
|
34
|
-
var _react = require('react'); var React = _interopRequireWildcard(_react);
|
|
35
|
-
function useDebounce(value, delay = 500) {
|
|
36
|
-
const [debouncedValue, setDebouncedValue] = _react.useState.call(void 0, value);
|
|
37
|
-
_react.useEffect.call(void 0, () => {
|
|
38
|
-
const timer = setTimeout(() => {
|
|
39
|
-
setDebouncedValue(value);
|
|
40
|
-
}, delay);
|
|
41
|
-
return () => {
|
|
42
|
-
clearTimeout(timer);
|
|
43
|
-
};
|
|
44
|
-
}, [value, delay]);
|
|
45
|
-
return debouncedValue;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
36
|
// src/hooks/ui/use-local-storage.ts
|
|
49
|
-
|
|
37
|
+
var _react = require('react'); var React = _interopRequireWildcard(_react);
|
|
50
38
|
function useLocalStorage(key, initialValue) {
|
|
51
39
|
const [storedValue, setStoredValue] = _react.useState.call(void 0, () => {
|
|
52
40
|
try {
|
|
@@ -666,7 +654,7 @@ function useSearch(config) {
|
|
|
666
654
|
const [results, setResults] = _react.useState.call(void 0, []);
|
|
667
655
|
const [isLoading, setIsLoading] = _react.useState.call(void 0, false);
|
|
668
656
|
const [error, setError] = _react.useState.call(void 0, null);
|
|
669
|
-
const debouncedQuery = useDebounce(query, debounceMs);
|
|
657
|
+
const debouncedQuery = _chunkDAAFVOTLcjs.useDebounce.call(void 0, query, debounceMs);
|
|
670
658
|
const clearResults = _react.useCallback.call(void 0, () => {
|
|
671
659
|
setResults([]);
|
|
672
660
|
setError(null);
|
|
@@ -706,84 +694,6 @@ function useSearch(config) {
|
|
|
706
694
|
return { query, setQuery, results, isLoading, error, clearResults };
|
|
707
695
|
}
|
|
708
696
|
|
|
709
|
-
// src/hooks/ui/use-auto-limit-tags.ts
|
|
710
|
-
|
|
711
|
-
function useAutoLimitTags({
|
|
712
|
-
count,
|
|
713
|
-
limitTags = "auto",
|
|
714
|
-
placeholder = "",
|
|
715
|
-
reserveInputWidth = true
|
|
716
|
-
}) {
|
|
717
|
-
const middleRef = _react.useRef.call(void 0, null);
|
|
718
|
-
const measureRef = _react.useRef.call(void 0, null);
|
|
719
|
-
const textMeasureRef = _react.useRef.call(void 0, null);
|
|
720
|
-
const badgeRef = _react.useRef.call(void 0, null);
|
|
721
|
-
const inputRef = _react.useRef.call(void 0, null);
|
|
722
|
-
const [visibleCount, setVisibleCount] = _react.useState.call(void 0, count);
|
|
723
|
-
const recalculate = _react.useCallback.call(void 0, () => {
|
|
724
|
-
if (limitTags !== "auto") {
|
|
725
|
-
setVisibleCount(Math.min(limitTags, count));
|
|
726
|
-
return;
|
|
727
|
-
}
|
|
728
|
-
const middle = middleRef.current;
|
|
729
|
-
const measure = measureRef.current;
|
|
730
|
-
if (!middle || !measure) {
|
|
731
|
-
setVisibleCount(count);
|
|
732
|
-
return;
|
|
733
|
-
}
|
|
734
|
-
if (count === 0) {
|
|
735
|
-
setVisibleCount(0);
|
|
736
|
-
return;
|
|
737
|
-
}
|
|
738
|
-
const cs = getComputedStyle(middle);
|
|
739
|
-
const padL = parseFloat(cs.paddingLeft) || 0;
|
|
740
|
-
const padR = parseFloat(cs.paddingRight) || 0;
|
|
741
|
-
const gap = parseFloat(cs.gap) || 0;
|
|
742
|
-
const middleW = middle.clientWidth;
|
|
743
|
-
let inputReservedW = 0;
|
|
744
|
-
let trailingGap = 0;
|
|
745
|
-
if (reserveInputWidth) {
|
|
746
|
-
const textW = _nullishCoalesce(_optionalChain([textMeasureRef, 'access', _2 => _2.current, 'optionalAccess', _3 => _3.offsetWidth]), () => ( 60));
|
|
747
|
-
const inputMinW = inputRef.current ? parseFloat(getComputedStyle(inputRef.current).minWidth) || 60 : 60;
|
|
748
|
-
inputReservedW = Math.max(textW + 8, inputMinW);
|
|
749
|
-
trailingGap = gap;
|
|
750
|
-
}
|
|
751
|
-
const available = middleW - padL - padR - inputReservedW - trailingGap;
|
|
752
|
-
const tagEls = Array.from(measure.children);
|
|
753
|
-
const widths = tagEls.map((el) => el.offsetWidth);
|
|
754
|
-
let total = 0;
|
|
755
|
-
for (let i = 0; i < widths.length; i++) {
|
|
756
|
-
total += widths[i] + (i > 0 ? gap : 0);
|
|
757
|
-
}
|
|
758
|
-
if (total <= available) {
|
|
759
|
-
setVisibleCount(count);
|
|
760
|
-
return;
|
|
761
|
-
}
|
|
762
|
-
const badgeW = _nullishCoalesce(_optionalChain([badgeRef, 'access', _4 => _4.current, 'optionalAccess', _5 => _5.offsetWidth]), () => ( 40));
|
|
763
|
-
const spaceWithBadge = available - badgeW - gap;
|
|
764
|
-
let used = 0;
|
|
765
|
-
let fitCount = 0;
|
|
766
|
-
for (let i = 0; i < widths.length; i++) {
|
|
767
|
-
const need = widths[i] + (i > 0 ? gap : 0);
|
|
768
|
-
if (used + need > spaceWithBadge) break;
|
|
769
|
-
used += need;
|
|
770
|
-
fitCount++;
|
|
771
|
-
}
|
|
772
|
-
setVisibleCount(Math.max(0, fitCount));
|
|
773
|
-
}, [count, limitTags, placeholder, reserveInputWidth]);
|
|
774
|
-
_react.useEffect.call(void 0, () => {
|
|
775
|
-
recalculate();
|
|
776
|
-
}, [recalculate]);
|
|
777
|
-
_react.useEffect.call(void 0, () => {
|
|
778
|
-
const el = middleRef.current;
|
|
779
|
-
if (!el) return;
|
|
780
|
-
const ro = new ResizeObserver(recalculate);
|
|
781
|
-
ro.observe(el);
|
|
782
|
-
return () => ro.disconnect();
|
|
783
|
-
}, [recalculate]);
|
|
784
|
-
return { visibleCount, middleRef, measureRef, textMeasureRef, badgeRef, inputRef };
|
|
785
|
-
}
|
|
786
|
-
|
|
787
697
|
// src/hooks/platform/use-platform-config.ts
|
|
788
698
|
|
|
789
699
|
|
|
@@ -1085,7 +995,7 @@ var toolIconMap = {
|
|
|
1085
995
|
[ToolTypeValues.OSQUERY]: (size, className) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkC6ASEPZLcjs.OsqueryLogoGreyIcon, { size, className }),
|
|
1086
996
|
[ToolTypeValues.SYSTEM]: () => null
|
|
1087
997
|
};
|
|
1088
|
-
var ToolIcon = ({ toolType, size = 16, className }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: _nullishCoalesce(_optionalChain([toolIconMap, 'access',
|
|
998
|
+
var ToolIcon = ({ toolType, size = 16, className }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, { children: _nullishCoalesce(_optionalChain([toolIconMap, 'access', _2 => _2[toolType], 'optionalCall', _3 => _3(size, className)]), () => ( null)) });
|
|
1089
999
|
ToolIcon.displayName = "ToolIcon";
|
|
1090
1000
|
|
|
1091
1001
|
// src/components/ui/toaster.tsx
|
|
@@ -1204,11 +1114,11 @@ function CommandApprovalToast({
|
|
|
1204
1114
|
}) {
|
|
1205
1115
|
const [expanded, setExpanded] = React.useState(defaultExpanded);
|
|
1206
1116
|
const handleApprove = () => {
|
|
1207
|
-
_optionalChain([onApprove, 'optionalCall',
|
|
1117
|
+
_optionalChain([onApprove, 'optionalCall', _4 => _4()]);
|
|
1208
1118
|
_sonner.toast.dismiss(id);
|
|
1209
1119
|
};
|
|
1210
1120
|
const handleReject = () => {
|
|
1211
|
-
_optionalChain([onReject, 'optionalCall',
|
|
1121
|
+
_optionalChain([onReject, 'optionalCall', _5 => _5()]);
|
|
1212
1122
|
_sonner.toast.dismiss(id);
|
|
1213
1123
|
};
|
|
1214
1124
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
@@ -2062,7 +1972,7 @@ function setNestedValue(obj, path, value) {
|
|
|
2062
1972
|
}
|
|
2063
1973
|
function getNestedValue(obj, path) {
|
|
2064
1974
|
return path.split(".").reduce((current, key) => {
|
|
2065
|
-
return _optionalChain([current, 'optionalAccess',
|
|
1975
|
+
return _optionalChain([current, 'optionalAccess', _6 => _6[key]]);
|
|
2066
1976
|
}, obj);
|
|
2067
1977
|
}
|
|
2068
1978
|
function mergeVariables(currentVariables, updates, schema) {
|
|
@@ -2795,64 +2705,6 @@ function useNatsClient(clientOptions, options = {}) {
|
|
|
2795
2705
|
};
|
|
2796
2706
|
}
|
|
2797
2707
|
|
|
2798
|
-
// src/hooks/use-near-viewport.ts
|
|
2799
|
-
|
|
2800
|
-
var observers = /* @__PURE__ */ new Map();
|
|
2801
|
-
var subscribers = /* @__PURE__ */ new WeakMap();
|
|
2802
|
-
function getObserverFor(rootMargin) {
|
|
2803
|
-
const existing = observers.get(rootMargin);
|
|
2804
|
-
if (existing) return existing;
|
|
2805
|
-
const io = new IntersectionObserver(
|
|
2806
|
-
(entries) => {
|
|
2807
|
-
entries.forEach((entry) => {
|
|
2808
|
-
if (!entry.isIntersecting) return;
|
|
2809
|
-
const cb = subscribers.get(entry.target);
|
|
2810
|
-
if (cb) {
|
|
2811
|
-
cb();
|
|
2812
|
-
io.unobserve(entry.target);
|
|
2813
|
-
subscribers.delete(entry.target);
|
|
2814
|
-
}
|
|
2815
|
-
});
|
|
2816
|
-
},
|
|
2817
|
-
{ rootMargin }
|
|
2818
|
-
);
|
|
2819
|
-
observers.set(rootMargin, io);
|
|
2820
|
-
return io;
|
|
2821
|
-
}
|
|
2822
|
-
function useNearViewport(rootMargin = "500px") {
|
|
2823
|
-
const [isNear, setIsNear] = _react.useState.call(void 0, false);
|
|
2824
|
-
const elRef = _react.useRef.call(void 0, null);
|
|
2825
|
-
const ref = _react.useCallback.call(void 0,
|
|
2826
|
-
(node) => {
|
|
2827
|
-
const prev = elRef.current;
|
|
2828
|
-
if (prev) {
|
|
2829
|
-
const stillOurs = subscribers.get(prev);
|
|
2830
|
-
if (stillOurs) {
|
|
2831
|
-
subscribers.delete(prev);
|
|
2832
|
-
_optionalChain([observers, 'access', _11 => _11.get, 'call', _12 => _12(rootMargin), 'optionalAccess', _13 => _13.unobserve, 'call', _14 => _14(prev)]);
|
|
2833
|
-
}
|
|
2834
|
-
}
|
|
2835
|
-
elRef.current = node;
|
|
2836
|
-
if (!node) return;
|
|
2837
|
-
const cb = () => setIsNear(true);
|
|
2838
|
-
subscribers.set(node, cb);
|
|
2839
|
-
getObserverFor(rootMargin).observe(node);
|
|
2840
|
-
},
|
|
2841
|
-
[rootMargin]
|
|
2842
|
-
);
|
|
2843
|
-
_react.useEffect.call(void 0, () => {
|
|
2844
|
-
return () => {
|
|
2845
|
-
const el = elRef.current;
|
|
2846
|
-
if (!el) return;
|
|
2847
|
-
if (subscribers.get(el)) {
|
|
2848
|
-
subscribers.delete(el);
|
|
2849
|
-
_optionalChain([observers, 'access', _15 => _15.get, 'call', _16 => _16(rootMargin), 'optionalAccess', _17 => _17.unobserve, 'call', _18 => _18(el)]);
|
|
2850
|
-
}
|
|
2851
|
-
};
|
|
2852
|
-
}, [rootMargin]);
|
|
2853
|
-
return { ref, isNear };
|
|
2854
|
-
}
|
|
2855
|
-
|
|
2856
2708
|
// src/hooks/use-access-code-integration.ts
|
|
2857
2709
|
|
|
2858
2710
|
|
|
@@ -2955,18 +2807,6 @@ function useAccessCodeIntegration() {
|
|
|
2955
2807
|
};
|
|
2956
2808
|
}
|
|
2957
2809
|
|
|
2958
|
-
// src/hooks/use-og-placeholder.ts
|
|
2959
|
-
|
|
2960
|
-
function useOgPlaceholder(buildUrl, title, siteName = "", enabled = true, aspect = "wide") {
|
|
2961
|
-
return _react.useMemo.call(void 0, () => {
|
|
2962
|
-
if (!enabled || !title) return null;
|
|
2963
|
-
const options = {};
|
|
2964
|
-
if (siteName) options.site = siteName;
|
|
2965
|
-
if (aspect === "square") options.aspect = "square";
|
|
2966
|
-
return buildUrl(title, options);
|
|
2967
|
-
}, [buildUrl, title, siteName, enabled, aspect]);
|
|
2968
|
-
}
|
|
2969
|
-
|
|
2970
2810
|
// src/hooks/use-humanity-signals.ts
|
|
2971
2811
|
|
|
2972
2812
|
|
|
@@ -2988,7 +2828,7 @@ function evaluateHumanitySignals(body, opts) {
|
|
|
2988
2828
|
if (elapsedMs !== null && elapsedMs < opts.minFillMs) return { ok: false, reason: "too_fast" };
|
|
2989
2829
|
return { ok: true };
|
|
2990
2830
|
}
|
|
2991
|
-
var splitCsvEnv = (s) => _nullishCoalesce(_optionalChain([s, 'optionalAccess',
|
|
2831
|
+
var splitCsvEnv = (s) => _nullishCoalesce(_optionalChain([s, 'optionalAccess', _7 => _7.split, 'call', _8 => _8(","), 'access', _9 => _9.map, 'call', _10 => _10((t) => t.trim()), 'access', _11 => _11.filter, 'call', _12 => _12(Boolean)]), () => ( []));
|
|
2992
2832
|
|
|
2993
2833
|
// src/hooks/use-humanity-signals.ts
|
|
2994
2834
|
function useHumanitySignals() {
|
|
@@ -2996,7 +2836,7 @@ function useHumanitySignals() {
|
|
|
2996
2836
|
const mountedAt = _react.useRef.call(void 0, typeof performance !== "undefined" ? performance.now() : 0);
|
|
2997
2837
|
const getSignals = _react.useCallback.call(void 0,
|
|
2998
2838
|
() => ({
|
|
2999
|
-
[HONEYPOT_FIELD]: _nullishCoalesce(_optionalChain([ref, 'access',
|
|
2839
|
+
[HONEYPOT_FIELD]: _nullishCoalesce(_optionalChain([ref, 'access', _13 => _13.current, 'optionalAccess', _14 => _14.value]), () => ( "")),
|
|
3000
2840
|
[ELAPSED_MS_FIELD]: typeof performance !== "undefined" ? Math.round(performance.now() - mountedAt.current) : 0
|
|
3001
2841
|
}),
|
|
3002
2842
|
[]
|
|
@@ -3098,9 +2938,5 @@ function useHumanitySignals() {
|
|
|
3098
2938
|
|
|
3099
2939
|
|
|
3100
2940
|
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
exports.useAutoLimitTags = useAutoLimitTags; exports.useDebounce = useDebounce; exports.useLocalStorage = useLocalStorage; exports.useMediaQuery = useMediaQuery; exports.breakpoints = breakpoints; exports.useSmUp = useSmUp; exports.useMdUp = useMdUp; exports.useLgUp = useLgUp; exports.useMemoizedCallback = useMemoizedCallback; exports.useOnboardingState = useOnboardingState; exports.useTablePagination = useTablePagination; exports.useThrottle = useThrottle; exports.useWindowSize = useWindowSize; exports.useHorizontalScrollbar = useHorizontalScrollbar; exports.useImageEdgeColor = useImageEdgeColor; exports.useSearch = useSearch; exports.platformIcons = platformIcons; exports.platformColors = platformColors; exports.platformDisplayNames = platformDisplayNames; exports.platformDescriptions = platformDescriptions; exports.platformSlogans = platformSlogans; exports.platformHexColors = platformHexColors; exports.platformIconNames = platformIconNames; exports.getDefaultColorForPlatform = getDefaultColorForPlatform; exports.getDefaultIconForPlatform = getDefaultIconForPlatform; exports.transformPlatformConfigsToOptions = transformPlatformConfigsToOptions; exports.getPlatformIcon = getPlatformIcon; exports.getPlatformColor = getPlatformColor; exports.getPlatformDisplayName = getPlatformDisplayName; exports.getPlatformDescription = getPlatformDescription; exports.getPlatformSlogan = getPlatformSlogan; exports.getSmallPlatformIcon = getSmallPlatformIcon; exports.getPlatformIconComponent = getPlatformIconComponent; exports.usePlatformConfig = usePlatformConfig; exports.usePlatformByValue = usePlatformByValue; exports.useValidatePlatform = useValidatePlatform; exports.ToolTypeValues = ToolTypeValues; exports.toolLabels = toolLabels; exports.ToolIcon = ToolIcon; exports.dotColorByVariant = dotColorByVariant; exports.progressColorByVariant = progressColorByVariant; exports.ToastCard = ToastCard; exports.CommandApprovalToast = CommandApprovalToast; exports.Toaster = Toaster; exports.showToast = showToast; exports.showCommandApprovalToast = showCommandApprovalToast; exports.toast = toast; exports.useToast = useToast; exports.useContactSubmission = useContactSubmission; exports.useQuickActionHint = useQuickActionHint; exports.useCopyToClipboard = useCopyToClipboard; exports.configureBatchImageFetch = configureBatchImageFetch; exports.batchFetchAuthenticatedImages = batchFetchAuthenticatedImages; exports.useBatchImages = useBatchImages; exports.configureAuthenticatedImage = configureAuthenticatedImage; exports.useAuthenticatedImage = useAuthenticatedImage; exports.extractVariablesFromQuery = extractVariablesFromQuery; exports.isScalarType = isScalarType; exports.isInputObjectType = isInputObjectType; exports.flattenQueryVariables = flattenQueryVariables; exports.mergeDefaults = mergeDefaults; exports.validateSchema = validateSchema; exports.getArrayParams = getArrayParams; exports.getRequiredParams = getRequiredParams; exports.shouldIncludeInUrl = shouldIncludeInUrl; exports.urlParamsToVariables = urlParamsToVariables; exports.variablesToUrlParams = variablesToUrlParams; exports.coerceValue = coerceValue; exports.setNestedValue = setNestedValue; exports.getNestedValue = getNestedValue; exports.mergeVariables = mergeVariables; exports.clearParams = clearParams; exports.validateVariables = validateVariables; exports.GraphQLIntrospector = GraphQLIntrospector; exports.introspector = introspector; exports.useQueryParams = useQueryParams; exports.useApiParams = useApiParams; exports.createSearchParams = createSearchParams; exports.useCursorPaginationState = useCursorPaginationState; exports.useNatsClient = useNatsClient; exports.useNearViewport = useNearViewport; exports.validateAccessCode = validateAccessCode; exports.consumeAccessCode = consumeAccessCode; exports.validateAndConsumeAccessCode = validateAndConsumeAccessCode; exports.useAccessCodeIntegration = useAccessCodeIntegration; exports.useOgPlaceholder = useOgPlaceholder; exports.HONEYPOT_FIELD = HONEYPOT_FIELD; exports.ELAPSED_MS_FIELD = ELAPSED_MS_FIELD; exports.DEFAULT_MIN_FILL_MS = DEFAULT_MIN_FILL_MS; exports.extractHumanitySignals = extractHumanitySignals; exports.evaluateHumanitySignals = evaluateHumanitySignals; exports.splitCsvEnv = splitCsvEnv; exports.useHumanitySignals = useHumanitySignals;
|
|
3106
|
-
//# sourceMappingURL=chunk-27VVOBDB.cjs.map
|
|
2941
|
+
exports.useLocalStorage = useLocalStorage; exports.useMediaQuery = useMediaQuery; exports.breakpoints = breakpoints; exports.useSmUp = useSmUp; exports.useMdUp = useMdUp; exports.useLgUp = useLgUp; exports.useMemoizedCallback = useMemoizedCallback; exports.useOnboardingState = useOnboardingState; exports.useTablePagination = useTablePagination; exports.useThrottle = useThrottle; exports.useWindowSize = useWindowSize; exports.useHorizontalScrollbar = useHorizontalScrollbar; exports.useImageEdgeColor = useImageEdgeColor; exports.useSearch = useSearch; exports.platformIcons = platformIcons; exports.platformColors = platformColors; exports.platformDisplayNames = platformDisplayNames; exports.platformDescriptions = platformDescriptions; exports.platformSlogans = platformSlogans; exports.platformHexColors = platformHexColors; exports.platformIconNames = platformIconNames; exports.getDefaultColorForPlatform = getDefaultColorForPlatform; exports.getDefaultIconForPlatform = getDefaultIconForPlatform; exports.transformPlatformConfigsToOptions = transformPlatformConfigsToOptions; exports.getPlatformIcon = getPlatformIcon; exports.getPlatformColor = getPlatformColor; exports.getPlatformDisplayName = getPlatformDisplayName; exports.getPlatformDescription = getPlatformDescription; exports.getPlatformSlogan = getPlatformSlogan; exports.getSmallPlatformIcon = getSmallPlatformIcon; exports.getPlatformIconComponent = getPlatformIconComponent; exports.usePlatformConfig = usePlatformConfig; exports.usePlatformByValue = usePlatformByValue; exports.useValidatePlatform = useValidatePlatform; exports.ToolTypeValues = ToolTypeValues; exports.toolLabels = toolLabels; exports.ToolIcon = ToolIcon; exports.dotColorByVariant = dotColorByVariant; exports.progressColorByVariant = progressColorByVariant; exports.ToastCard = ToastCard; exports.CommandApprovalToast = CommandApprovalToast; exports.Toaster = Toaster; exports.showToast = showToast; exports.showCommandApprovalToast = showCommandApprovalToast; exports.toast = toast; exports.useToast = useToast; exports.useContactSubmission = useContactSubmission; exports.useQuickActionHint = useQuickActionHint; exports.useCopyToClipboard = useCopyToClipboard; exports.configureBatchImageFetch = configureBatchImageFetch; exports.batchFetchAuthenticatedImages = batchFetchAuthenticatedImages; exports.useBatchImages = useBatchImages; exports.configureAuthenticatedImage = configureAuthenticatedImage; exports.useAuthenticatedImage = useAuthenticatedImage; exports.extractVariablesFromQuery = extractVariablesFromQuery; exports.isScalarType = isScalarType; exports.isInputObjectType = isInputObjectType; exports.flattenQueryVariables = flattenQueryVariables; exports.mergeDefaults = mergeDefaults; exports.validateSchema = validateSchema; exports.getArrayParams = getArrayParams; exports.getRequiredParams = getRequiredParams; exports.shouldIncludeInUrl = shouldIncludeInUrl; exports.urlParamsToVariables = urlParamsToVariables; exports.variablesToUrlParams = variablesToUrlParams; exports.coerceValue = coerceValue; exports.setNestedValue = setNestedValue; exports.getNestedValue = getNestedValue; exports.mergeVariables = mergeVariables; exports.clearParams = clearParams; exports.validateVariables = validateVariables; exports.GraphQLIntrospector = GraphQLIntrospector; exports.introspector = introspector; exports.useQueryParams = useQueryParams; exports.useApiParams = useApiParams; exports.createSearchParams = createSearchParams; exports.useCursorPaginationState = useCursorPaginationState; exports.useNatsClient = useNatsClient; exports.validateAccessCode = validateAccessCode; exports.consumeAccessCode = consumeAccessCode; exports.validateAndConsumeAccessCode = validateAndConsumeAccessCode; exports.useAccessCodeIntegration = useAccessCodeIntegration; exports.HONEYPOT_FIELD = HONEYPOT_FIELD; exports.ELAPSED_MS_FIELD = ELAPSED_MS_FIELD; exports.DEFAULT_MIN_FILL_MS = DEFAULT_MIN_FILL_MS; exports.extractHumanitySignals = extractHumanitySignals; exports.evaluateHumanitySignals = evaluateHumanitySignals; exports.splitCsvEnv = splitCsvEnv; exports.useHumanitySignals = useHumanitySignals;
|
|
2942
|
+
//# sourceMappingURL=chunk-ELF4OOHC.cjs.map
|