@nivaro/react 0.3.106 → 0.3.108
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/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +193 -0
- package/dist/index.js +779 -770
- package/dist/shared/components/CollectionBrowserView.js +410 -416
- package/dist/shared/components/EnvironmentNotice.js +127 -0
- package/dist/shared/components/ItemEditForm.js +1927 -1915
- package/dist/shared/components/collections-directory/CollectionHoverCard.js +177 -0
- package/dist/shared/components/collections-directory/CollectionRow.js +359 -0
- package/dist/shared/components/collections-directory/CollectionRowMenu.js +213 -0
- package/dist/shared/components/collections-directory/CollectionsDirectory.js +543 -0
- package/dist/shared/components/collections-directory/CollectionsToolbar.js +287 -0
- package/dist/shared/components/collections-directory/PinnedSection.js +97 -0
- package/dist/shared/components/collections-directory/directory-data.js +159 -0
- package/dist/shared/components/collections-directory/page-model.js +122 -0
- package/dist/shared/components/collections-directory/sections.js +108 -0
- package/dist/shared/components/collections-directory/shared-pins.js +70 -0
- package/dist/shared/lib/template-paths.js +17 -0
- package/package.json +1 -1
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
import { jsxs as l, jsx as s, Fragment as f } from "react/jsx-runtime";
|
|
2
|
+
import { FlaskConical as x, ArrowUpRight as g } from "lucide-react";
|
|
3
|
+
import { useState as h, useEffect as u } from "react";
|
|
4
|
+
const c = /* @__PURE__ */ new Map();
|
|
5
|
+
function b(i) {
|
|
6
|
+
let e = c.get(i);
|
|
7
|
+
return e || (e = fetch(`${i}/api/app-info`, { credentials: "omit" }).then((t) => t.ok ? t.json() : null).then((t) => {
|
|
8
|
+
const n = t == null ? void 0 : t.environment_notice;
|
|
9
|
+
if (!n || typeof n != "object") return null;
|
|
10
|
+
const r = typeof n.label == "string" ? n.label.trim().slice(0, 40) : "";
|
|
11
|
+
if (!r) return null;
|
|
12
|
+
const m = typeof n.message == "string" ? n.message.trim().slice(0, 200) : "", o = typeof n.production_url == "string" ? n.production_url : null;
|
|
13
|
+
return {
|
|
14
|
+
label: r,
|
|
15
|
+
message: m,
|
|
16
|
+
productionUrl: o && /^https:\/\//.test(o) ? o : null,
|
|
17
|
+
inAdminApp: n.in_admin_app !== !1
|
|
18
|
+
};
|
|
19
|
+
}).catch(() => null), c.set(i, e)), e;
|
|
20
|
+
}
|
|
21
|
+
function d(i = "") {
|
|
22
|
+
const [e, t] = h(null);
|
|
23
|
+
return u(() => {
|
|
24
|
+
let n = !0;
|
|
25
|
+
return b(i).then((r) => {
|
|
26
|
+
n && t(r);
|
|
27
|
+
}), () => {
|
|
28
|
+
n = !1;
|
|
29
|
+
};
|
|
30
|
+
}, [i]), e;
|
|
31
|
+
}
|
|
32
|
+
function p(i) {
|
|
33
|
+
u(() => {
|
|
34
|
+
if (!i || typeof document > "u") return;
|
|
35
|
+
const e = `${i} · `, t = () => {
|
|
36
|
+
document.title.startsWith(e) || (document.title = e + document.title);
|
|
37
|
+
};
|
|
38
|
+
t();
|
|
39
|
+
const n = document.querySelector("title"), r = n ? new MutationObserver(t) : null;
|
|
40
|
+
return n && r && r.observe(n, { childList: !0, characterData: !0, subtree: !0 }), () => {
|
|
41
|
+
r == null || r.disconnect(), document.title.startsWith(e) && (document.title = document.title.slice(e.length));
|
|
42
|
+
};
|
|
43
|
+
}, [i]);
|
|
44
|
+
}
|
|
45
|
+
const a = "repeating-linear-gradient(-45deg, #111827 0 9px, #facc15 9px 18px)";
|
|
46
|
+
function N({ apiBase: i = "" }) {
|
|
47
|
+
const e = d(i);
|
|
48
|
+
return p(e ? e.label : null), e ? /* @__PURE__ */ l(f, { children: [
|
|
49
|
+
/* @__PURE__ */ s(
|
|
50
|
+
v,
|
|
51
|
+
{
|
|
52
|
+
label: e.label,
|
|
53
|
+
message: e.message,
|
|
54
|
+
productionUrl: e.productionUrl
|
|
55
|
+
}
|
|
56
|
+
),
|
|
57
|
+
/* @__PURE__ */ s(
|
|
58
|
+
"div",
|
|
59
|
+
{
|
|
60
|
+
"aria-hidden": !0,
|
|
61
|
+
"data-environment-frame": !0,
|
|
62
|
+
className: "pointer-events-none fixed inset-0 z-40",
|
|
63
|
+
style: { border: "6px solid transparent", borderImage: `${a} 6` }
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
] }) : null;
|
|
67
|
+
}
|
|
68
|
+
function v({
|
|
69
|
+
label: i,
|
|
70
|
+
message: e,
|
|
71
|
+
productionUrl: t,
|
|
72
|
+
preview: n = !1
|
|
73
|
+
}) {
|
|
74
|
+
return /* @__PURE__ */ l(
|
|
75
|
+
"div",
|
|
76
|
+
{
|
|
77
|
+
role: n ? void 0 : "alert",
|
|
78
|
+
"data-environment-banner": !0,
|
|
79
|
+
className: "relative z-30 flex min-h-[84px] w-full shrink-0 items-stretch bg-[#facc15] text-[#111827] shadow-[0_3px_16px_rgba(17,24,39,0.4)]",
|
|
80
|
+
children: [
|
|
81
|
+
/* @__PURE__ */ s("div", { "aria-hidden": !0, className: "w-8 shrink-0 sm:w-28", style: { backgroundImage: a } }),
|
|
82
|
+
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 flex-wrap items-center justify-center gap-x-6 gap-y-1.5 px-5 py-3 text-center", children: [
|
|
83
|
+
/* @__PURE__ */ l("span", { className: "inline-flex items-center gap-2.5 text-[22px] font-black uppercase leading-none tracking-[0.16em] sm:text-[28px]", children: [
|
|
84
|
+
/* @__PURE__ */ s(x, { className: "h-6 w-6 sm:h-7 sm:w-7", strokeWidth: 2.6 }),
|
|
85
|
+
i
|
|
86
|
+
] }),
|
|
87
|
+
e && /* @__PURE__ */ s("span", { className: "max-w-[52ch] text-[14px] font-semibold leading-snug sm:text-[15.5px]", children: e }),
|
|
88
|
+
t && /* @__PURE__ */ l(
|
|
89
|
+
"a",
|
|
90
|
+
{
|
|
91
|
+
href: t,
|
|
92
|
+
onClick: n ? (r) => r.preventDefault() : void 0,
|
|
93
|
+
className: "inline-flex items-center gap-1.5 rounded-md bg-[#111827] px-3.5 py-2 text-[13.5px] font-bold text-[#facc15] transition-colors hover:bg-[#1f2937] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#111827] focus-visible:ring-offset-2 focus-visible:ring-offset-[#facc15]",
|
|
94
|
+
children: [
|
|
95
|
+
"Go to production",
|
|
96
|
+
/* @__PURE__ */ s(g, { className: "h-3.5 w-3.5", strokeWidth: 2.4 })
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
)
|
|
100
|
+
] }),
|
|
101
|
+
/* @__PURE__ */ s("div", { "aria-hidden": !0, className: "w-8 shrink-0 sm:w-28", style: { backgroundImage: a } })
|
|
102
|
+
]
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
function _({ apiBase: i = "" }) {
|
|
107
|
+
const e = d(i), t = e != null && e.inAdminApp ? e : null;
|
|
108
|
+
return p(t ? t.label : null), t ? /* @__PURE__ */ l(
|
|
109
|
+
"div",
|
|
110
|
+
{
|
|
111
|
+
"aria-hidden": !0,
|
|
112
|
+
"data-environment-edge": !0,
|
|
113
|
+
className: "pointer-events-none fixed inset-x-0 top-0 z-[60] flex justify-center",
|
|
114
|
+
children: [
|
|
115
|
+
/* @__PURE__ */ s("div", { className: "absolute inset-x-0 top-0 h-[4px]", style: { backgroundImage: a } }),
|
|
116
|
+
/* @__PURE__ */ s("span", { className: "relative mt-[4px] rounded-b-md bg-[#facc15] px-2.5 pb-[3px] pt-[1px] text-[10.5px] font-extrabold uppercase leading-[14px] tracking-[0.14em] text-[#111827] shadow-[0_2px_6px_rgba(17,24,39,0.3)]", children: t.label })
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
) : null;
|
|
120
|
+
}
|
|
121
|
+
export {
|
|
122
|
+
v as EnvironmentBand,
|
|
123
|
+
_ as EnvironmentEdge,
|
|
124
|
+
N as EnvironmentLoginBanner,
|
|
125
|
+
b as readEnvironment,
|
|
126
|
+
d as useInstanceEnvironment
|
|
127
|
+
};
|