zudoku 0.3.0-dev.106 → 0.3.0-dev.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/lib/components/Header.js +3 -2
- package/dist/lib/components/Header.js.map +1 -1
- package/dist/lib/components/SlotletProvider.d.ts +2 -2
- package/dist/lib/components/SlotletProvider.js +7 -2
- package/dist/lib/components/SlotletProvider.js.map +1 -1
- package/lib/SlotletProvider-BG2PU1Mf.js +262 -0
- package/lib/SlotletProvider-BG2PU1Mf.js.map +1 -0
- package/lib/zudoku.components.js +491 -489
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +1 -1
- package/package.json +1 -1
- package/src/lib/components/Header.tsx +3 -0
- package/src/lib/components/SlotletProvider.tsx +10 -5
- package/lib/SlotletProvider-CzMAO73_.js +0 -82
- package/lib/SlotletProvider-CzMAO73_.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-B6kdoens.js";
|
|
2
|
-
import {
|
|
2
|
+
import { S as p, R as f } from "./SlotletProvider-BG2PU1Mf.js";
|
|
3
3
|
import { u as g, a as u, I as j, S as k, b as v, c as w, d as b, e as K, f as y } from "./Input-HmAaR6kw.js";
|
|
4
4
|
import { b as N, L as x, O as E } from "./index-7kcHaXD6.js";
|
|
5
5
|
import { u as h, t as A, j as S } from "./ZudokuContext-BIZ8zHbZ.js";
|
package/package.json
CHANGED
|
@@ -21,6 +21,7 @@ import { cn } from "../util/cn.js";
|
|
|
21
21
|
import { useTheme } from "./context/ThemeContext.js";
|
|
22
22
|
import { useZudoku } from "./context/ZudokuContext.js";
|
|
23
23
|
import { Search } from "./Search.js";
|
|
24
|
+
import { Slotlet } from "./SlotletProvider.js";
|
|
24
25
|
import { TopNavigation } from "./TopNavigation.js";
|
|
25
26
|
|
|
26
27
|
const RecursiveMenu = ({ item }: { item: ProfileNavigationItem }) => {
|
|
@@ -94,6 +95,7 @@ export const Header = memo(function HeaderInner() {
|
|
|
94
95
|
</div>
|
|
95
96
|
|
|
96
97
|
<div className="items-center justify-self-end text-sm hidden lg:flex gap-2">
|
|
98
|
+
<Slotlet name="head-navigation-start" />
|
|
97
99
|
{isAuthEnabled && !isAuthenticated ? (
|
|
98
100
|
<Button variant="ghost" asChild>
|
|
99
101
|
<Link
|
|
@@ -132,6 +134,7 @@ export const Header = memo(function HeaderInner() {
|
|
|
132
134
|
>
|
|
133
135
|
<ThemeIcon size={18} />
|
|
134
136
|
</button>
|
|
137
|
+
<Slotlet name="head-navigation-end" />
|
|
135
138
|
</div>
|
|
136
139
|
</div>
|
|
137
140
|
</div>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, { ReactNode, useContext } from "react";
|
|
2
|
-
|
|
3
|
-
export type Slotlets = Record<string, ReactNode>;
|
|
1
|
+
import React, { type ReactElement, ReactNode, useContext } from "react";
|
|
2
|
+
import { isValidElementType } from "react-is";
|
|
3
|
+
export type Slotlets = Record<string, ReactNode | ReactElement>;
|
|
4
4
|
|
|
5
5
|
const SlotletContext = React.createContext<Slotlets | undefined>({});
|
|
6
6
|
|
|
@@ -19,7 +19,12 @@ export const SlotletProvider = ({
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
export const Slotlet = ({ name }: { name: string }) => {
|
|
22
|
-
const
|
|
22
|
+
const context = useContext(SlotletContext);
|
|
23
|
+
const componentOrElement = context?.[name];
|
|
24
|
+
|
|
25
|
+
if (isValidElementType(componentOrElement)) {
|
|
26
|
+
return React.createElement(componentOrElement);
|
|
27
|
+
}
|
|
23
28
|
|
|
24
|
-
return
|
|
29
|
+
return componentOrElement;
|
|
25
30
|
};
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { j as t } from "./jsx-runtime-B6kdoens.js";
|
|
2
|
-
import { f as a, L as r, g as i } from "./index-7kcHaXD6.js";
|
|
3
|
-
import { C as l } from "./CategoryHeading-BWq12Bfa.js";
|
|
4
|
-
import { D as c } from "./DeveloperHint-BQSFXH01.js";
|
|
5
|
-
import { c as m, P as x, H as d } from "./Markdown-B_Gax7at.js";
|
|
6
|
-
import { i as p } from "./router-BiRCp01d.js";
|
|
7
|
-
import h, { useContext as u } from "react";
|
|
8
|
-
/**
|
|
9
|
-
* @license lucide-react v0.378.0 - ISC
|
|
10
|
-
*
|
|
11
|
-
* This source code is licensed under the ISC license.
|
|
12
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
13
|
-
*/
|
|
14
|
-
const g = m("Unlink", [
|
|
15
|
-
[
|
|
16
|
-
"path",
|
|
17
|
-
{
|
|
18
|
-
d: "m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71",
|
|
19
|
-
key: "yqzxt4"
|
|
20
|
-
}
|
|
21
|
-
],
|
|
22
|
-
[
|
|
23
|
-
"path",
|
|
24
|
-
{
|
|
25
|
-
d: "m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71",
|
|
26
|
-
key: "4qinb0"
|
|
27
|
-
}
|
|
28
|
-
],
|
|
29
|
-
["line", { x1: "8", x2: "8", y1: "2", y2: "5", key: "1041cp" }],
|
|
30
|
-
["line", { x1: "2", x2: "5", y1: "8", y2: "8", key: "14m1p5" }],
|
|
31
|
-
["line", { x1: "16", x2: "16", y1: "19", y2: "22", key: "rzdirn" }],
|
|
32
|
-
["line", { x1: "19", x2: "22", y1: "16", y2: "16", key: "ox905f" }]
|
|
33
|
-
]), f = () => {
|
|
34
|
-
const e = a();
|
|
35
|
-
return /* @__PURE__ */ t.jsxs("div", { className: x + " h-full pt-[--padding-content-top]", children: [
|
|
36
|
-
/* @__PURE__ */ t.jsx(l, { children: "404" }),
|
|
37
|
-
/* @__PURE__ */ t.jsxs(d, { level: 1, className: "flex gap-3.5 items-center", children: [
|
|
38
|
-
"Page not found",
|
|
39
|
-
/* @__PURE__ */ t.jsx(g, { size: 24 })
|
|
40
|
-
] }),
|
|
41
|
-
/* @__PURE__ */ t.jsxs(c, { children: [
|
|
42
|
-
"Start by adding a file at",
|
|
43
|
-
" ",
|
|
44
|
-
/* @__PURE__ */ t.jsxs("code", { children: [
|
|
45
|
-
"{PROJECT_ROOT}",
|
|
46
|
-
"/",
|
|
47
|
-
e["*"],
|
|
48
|
-
".mdx"
|
|
49
|
-
] }),
|
|
50
|
-
" ",
|
|
51
|
-
"and add some content to make this error go away."
|
|
52
|
-
] }),
|
|
53
|
-
/* @__PURE__ */ t.jsx("p", { children: "It seems that the page you are looking for does not exist or may have been moved. Please check the URL for any typos or use the navigation menu to find the correct page." }),
|
|
54
|
-
/* @__PURE__ */ t.jsx(r, { to: "/", children: "Go back home" })
|
|
55
|
-
] });
|
|
56
|
-
};
|
|
57
|
-
function y({ error: e }) {
|
|
58
|
-
const s = (e == null ? void 0 : e.message) ?? "Something went wrong", n = e == null ? void 0 : e.stack;
|
|
59
|
-
return /* @__PURE__ */ t.jsx("div", { className: "flex h-screen max-h-screen min-h-full items-center justify-center bg-primary-background px-4 py-16 lg:px-8", children: /* @__PURE__ */ t.jsxs("div", { className: "mx-auto max-w-[85%] sm:max-w-[50%]", children: [
|
|
60
|
-
/* @__PURE__ */ t.jsx("h1", { className: "text-4xl font-bold tracking-tight text-h1-text sm:text-5xl", children: "Something went wrong" }),
|
|
61
|
-
/* @__PURE__ */ t.jsx("p", { className: "mt-5 text-h1-text", children: s }),
|
|
62
|
-
n ? /* @__PURE__ */ t.jsx("pre", { className: "mt-5 max-h-[400px] w-full overflow-scroll rounded-md border border-input-border bg-input-background p-3 text-property-name-text text-red-700", children: n }) : null
|
|
63
|
-
] }) });
|
|
64
|
-
}
|
|
65
|
-
function N() {
|
|
66
|
-
const e = i();
|
|
67
|
-
return p(e) && e.status === 404 ? /* @__PURE__ */ t.jsx(f, {}) : /* @__PURE__ */ t.jsx(y, { error: e });
|
|
68
|
-
}
|
|
69
|
-
const o = h.createContext({}), C = ({
|
|
70
|
-
slotlets: e,
|
|
71
|
-
children: s
|
|
72
|
-
}) => /* @__PURE__ */ t.jsx(o.Provider, { value: e, children: s }), E = ({ name: e }) => {
|
|
73
|
-
const s = u(o);
|
|
74
|
-
return s == null ? void 0 : s[e];
|
|
75
|
-
};
|
|
76
|
-
export {
|
|
77
|
-
y as E,
|
|
78
|
-
N as R,
|
|
79
|
-
C as S,
|
|
80
|
-
E as a
|
|
81
|
-
};
|
|
82
|
-
//# sourceMappingURL=SlotletProvider-CzMAO73_.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SlotletProvider-CzMAO73_.js","sources":["../../../node_modules/.pnpm/lucide-react@0.378.0_react@18.3.1/node_modules/lucide-react/dist/esm/icons/unlink.js","../src/lib/components/NotFoundPage.tsx","../src/lib/errors/ErrorAlert.tsx","../src/lib/errors/RouterError.tsx","../src/lib/components/SlotletProvider.tsx"],"sourcesContent":["/**\n * @license lucide-react v0.378.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst Unlink = createLucideIcon(\"Unlink\", [\n [\n \"path\",\n {\n d: \"m18.84 12.25 1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71\",\n key: \"yqzxt4\"\n }\n ],\n [\n \"path\",\n {\n d: \"m5.17 11.75-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71\",\n key: \"4qinb0\"\n }\n ],\n [\"line\", { x1: \"8\", x2: \"8\", y1: \"2\", y2: \"5\", key: \"1041cp\" }],\n [\"line\", { x1: \"2\", x2: \"5\", y1: \"8\", y2: \"8\", key: \"14m1p5\" }],\n [\"line\", { x1: \"16\", x2: \"16\", y1: \"19\", y2: \"22\", key: \"rzdirn\" }],\n [\"line\", { x1: \"19\", x2: \"22\", y1: \"16\", y2: \"16\", key: \"ox905f\" }]\n]);\n\nexport { Unlink as default };\n//# sourceMappingURL=unlink.js.map\n","import { UnlinkIcon } from \"lucide-react\";\nimport { Link, useParams } from \"react-router-dom\";\nimport { CategoryHeading } from \"./CategoryHeading.js\";\nimport { DeveloperHint } from \"./DeveloperHint.js\";\nimport { Heading } from \"./Heading.js\";\nimport { ProseClasses } from \"./Markdown.js\";\n\nexport const NotFoundPage = () => {\n const params = useParams();\n\n return (\n <div className={ProseClasses + \" h-full pt-[--padding-content-top]\"}>\n <CategoryHeading>404</CategoryHeading>\n <Heading level={1} className=\"flex gap-3.5 items-center\">\n Page not found\n <UnlinkIcon size={24} />\n </Heading>\n <DeveloperHint>\n Start by adding a file at{\" \"}\n <code>\n {\"{PROJECT_ROOT}\"}/{params[\"*\"]}.mdx\n </code>{\" \"}\n and add some content to make this error go away.\n </DeveloperHint>\n <p>\n It seems that the page you are looking for does not exist or may have\n been moved. Please check the URL for any typos or use the navigation\n menu to find the correct page.\n </p>\n <Link to=\"/\">Go back home</Link>\n </div>\n );\n};\n","// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function ErrorAlert({ error }: { error: any }) {\n const message = error?.message ?? \"Something went wrong\";\n const stack = error?.stack;\n\n return (\n <div className=\"flex h-screen max-h-screen min-h-full items-center justify-center bg-primary-background px-4 py-16 lg:px-8\">\n <div className=\"mx-auto max-w-[85%] sm:max-w-[50%]\">\n <h1 className=\"text-4xl font-bold tracking-tight text-h1-text sm:text-5xl\">\n Something went wrong\n </h1>\n <p className=\"mt-5 text-h1-text\">{message}</p>\n {stack ? (\n <pre className=\"mt-5 max-h-[400px] w-full overflow-scroll rounded-md border border-input-border bg-input-background p-3 text-property-name-text text-red-700\">\n {stack}\n </pre>\n ) : null}\n </div>\n </div>\n );\n}\n","import { isRouteErrorResponse, useRouteError } from \"react-router-dom\";\nimport { NotFoundPage } from \"../components/NotFoundPage.js\";\nimport { ErrorAlert } from \"./ErrorAlert.js\";\n\nexport function RouterError() {\n const error = useRouteError();\n\n if (isRouteErrorResponse(error) && error.status === 404) {\n return <NotFoundPage />;\n }\n\n return <ErrorAlert error={error} />;\n}\n","import React, { ReactNode, useContext } from \"react\";\n\nexport type Slotlets = Record<string, ReactNode>;\n\nconst SlotletContext = React.createContext<Slotlets | undefined>({});\n\nexport const SlotletProvider = ({\n slotlets,\n children,\n}: {\n children: ReactNode;\n slotlets?: Slotlets;\n}) => {\n return (\n <SlotletContext.Provider value={slotlets}>\n {children}\n </SlotletContext.Provider>\n );\n};\n\nexport const Slotlet = ({ name }: { name: string }) => {\n const x = useContext(SlotletContext);\n\n return x?.[name];\n};\n"],"names":["Unlink","createLucideIcon","NotFoundPage","params","useParams","jsxs","ProseClasses","jsx","CategoryHeading","Heading","UnlinkIcon","DeveloperHint","Link","ErrorAlert","error","message","stack","RouterError","useRouteError","isRouteErrorResponse","SlotletContext","React","SlotletProvider","slotlets","children","Slotlet","name","x","useContext"],"mappings":";;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAASC,EAAiB,UAAU;AAAA,EACxC;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACN;AAAA,EACF;AAAA,EACD;AAAA,IACE;AAAA,IACA;AAAA,MACE,GAAG;AAAA,MACH,KAAK;AAAA,IACN;AAAA,EACF;AAAA,EACD,CAAC,QAAQ,EAAE,IAAI,KAAK,IAAI,KAAK,IAAI,KAAK,IAAI,KAAK,KAAK,SAAQ,CAAE;AAAA,EAC9D,CAAC,QAAQ,EAAE,IAAI,KAAK,IAAI,KAAK,IAAI,KAAK,IAAI,KAAK,KAAK,SAAQ,CAAE;AAAA,EAC9D,CAAC,QAAQ,EAAE,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,KAAK,SAAQ,CAAE;AAAA,EAClE,CAAC,QAAQ,EAAE,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,IAAI,MAAM,KA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