zudoku 0.82.0 → 0.82.2

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/cli/cli.js CHANGED
@@ -1,7 +1,12 @@
1
1
  var __defProp = Object.defineProperty;
2
2
  var __getOwnPropNames = Object.getOwnPropertyNames;
3
- var __esm = (fn, res) => function __init() {
4
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
3
+ var __esm = (fn, res, err) => function __init() {
4
+ if (err) throw err[0];
5
+ try {
6
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
7
+ } catch (e) {
8
+ throw err = [e], e;
9
+ }
5
10
  };
6
11
  var __export = (target, all) => {
7
12
  for (var name in all)
@@ -1 +1,2 @@
1
- export { domAnimation as default } from "motion/react";
1
+ import { domAnimation } from "motion/react";
2
+ export default domAnimation;
@@ -143,7 +143,10 @@ type NavigationCategory = {
143
143
  collapsible?: boolean;
144
144
  collapsed?: boolean;
145
145
  stack?: boolean; // open the category's items as a stacked sub-nav
146
- link?: string | { type: "doc"; file: string; label?: string; path?: string };
146
+ link?:
147
+ | string
148
+ | { type: "doc"; file: string; label?: string; path?: string }
149
+ | { type: "link"; to: string; label?: string };
147
150
  display?:
148
151
  | "auth"
149
152
  | "anon"
@@ -158,9 +161,11 @@ type NavigationCategory = {
158
161
  #### Category links
159
162
 
160
163
  A category can have a `link` property that makes the category label itself clickable, navigating to
161
- a document. This is useful when you want a category that acts as both a group and a landing page.
164
+ a document, a path, or an external URL. This is useful when you want a category that acts as both a
165
+ group and a landing page.
162
166
 
163
- The `link` can be a simple string pointing to a file path, or an object for more control:
167
+ The `link` can be a simple string pointing to a file path, a `doc` object for more control, or a
168
+ `link` object that points the category label at an arbitrary path or external URL:
164
169
 
165
170
  ```tsx title="String shorthand"
166
171
  {
@@ -190,7 +195,7 @@ The `link` can be a simple string pointing to a file path, or an object for more
190
195
  }
191
196
  ```
192
197
 
193
- The object form supports these properties:
198
+ The `doc` object form supports these properties:
194
199
 
195
200
  | Property | Type | Description |
196
201
  | -------- | -------- | -------------------------------------------------------- |
@@ -199,6 +204,29 @@ The object form supports these properties:
199
204
  | `label` | `string` | Override the label (defaults to the document title) |
200
205
  | `path` | `string` | Custom URL path (overrides the default file-based route) |
201
206
 
207
+ ```tsx title="Link form pointing to a path or external URL"
208
+ {
209
+ type: "category",
210
+ label: "API Reference",
211
+ link: {
212
+ type: "link",
213
+ to: "/api",
214
+ },
215
+ items: [
216
+ "guides/authentication",
217
+ "guides/rate-limits",
218
+ ],
219
+ }
220
+ ```
221
+
222
+ The `link` object form supports these properties:
223
+
224
+ | Property | Type | Description |
225
+ | -------- | -------- | ----------------------------------- |
226
+ | `type` | `"link"` | Must be `"link"` |
227
+ | `to` | `string` | Path or external URL to navigate to |
228
+ | `label` | `string` | Override the category label |
229
+
202
230
  ### `type: doc`
203
231
 
204
232
  Doc is used to reference markdown files. The `label` is the text that will be displayed, and the
package/package.json CHANGED
@@ -1,7 +1,10 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.82.0",
3
+ "version": "0.82.2",
4
4
  "type": "module",
5
+ "engines": {
6
+ "node": ">=20.19.0 <21.0.0 || >=22.12.0"
7
+ },
5
8
  "sideEffects": [
6
9
  "**/*.css",
7
10
  "**/polyfills.ts"
@@ -172,7 +175,7 @@
172
175
  "@apidevtools/json-schema-ref-parser": "15.3.5",
173
176
  "@base-ui/react": "^1.4.1",
174
177
  "@envelop/core": "5.5.1",
175
- "@graphiql/toolkit": "0.12.0",
178
+ "@graphiql/toolkit": "0.12.1",
176
179
  "@graphql-typed-document-node/core": "3.2.0",
177
180
  "@hono/node-server": "2.0.3",
178
181
  "@lekoarts/rehype-meta-as-attributes": "3.0.3",
@@ -226,7 +229,7 @@
226
229
  "cmdk": "1.1.1",
227
230
  "dotenv": "17.4.2",
228
231
  "embla-carousel-react": "8.6.0",
229
- "esbuild": "^0.28.0",
232
+ "esbuild": "^0.28.1",
230
233
  "estree-util-is-identifier-name": "3.0.0",
231
234
  "estree-util-value-to-estree": "3.5.0",
232
235
  "fast-equals": "6.0.0",
@@ -234,7 +237,7 @@
234
237
  "glob-parent": "6.0.2",
235
238
  "graphql": "16.14.0",
236
239
  "graphql-type-json": "0.3.2",
237
- "graphql-yoga": "5.21.0",
240
+ "graphql-yoga": "5.21.2",
238
241
  "gray-matter": "4.0.3",
239
242
  "hast-util-heading-rank": "3.0.0",
240
243
  "hast-util-to-jsx-runtime": "2.3.6",
@@ -257,7 +260,7 @@
257
260
  "openapi-types": "12.1.3",
258
261
  "pagefind": "1.5.2",
259
262
  "picocolors": "1.1.1",
260
- "piscina": "5.1.4",
263
+ "piscina": "5.2.0",
261
264
  "posthog-node": "5.36.2",
262
265
  "quick-lru": "7.3.0",
263
266
  "react-error-boundary": "6.1.1",
@@ -285,11 +288,11 @@
285
288
  "unist-util-visit": "5.1.0",
286
289
  "vaul": "1.1.2",
287
290
  "vfile": "6.0.3",
288
- "vite": "8.0.13",
291
+ "vite": "8.0.16",
289
292
  "yaml": "2.9.0",
290
293
  "yargs": "18.0.0",
291
294
  "zod": "4.4.3",
292
- "zustand": "5.0.13"
295
+ "zustand": "5.0.14"
293
296
  },
294
297
  "devDependencies": {
295
298
  "@graphql-codegen/cli": "7.1.1",
@@ -310,9 +313,10 @@
310
313
  "@types/semver": "7.7.1",
311
314
  "@types/unist": "3.0.3",
312
315
  "@types/yargs": "17.0.35",
316
+ "@typescript/native-preview": "7.0.0-dev.20260610.1",
313
317
  "@vitest/coverage-v8": "4.1.8",
314
318
  "happy-dom": "20.10.2",
315
- "oxc-parser": "^0.133.0",
319
+ "oxc-parser": "^0.135.0",
316
320
  "react": "19.2.7",
317
321
  "react-dom": "19.2.7",
318
322
  "tsx": "4.22.4",
@@ -347,7 +351,7 @@
347
351
  "scripts": {
348
352
  "build": "tsx scripts/build.ts",
349
353
  "postbuild": "tsx scripts/check-external-deps.ts",
350
- "typecheck": "tsc --project tsconfig.app.json --noEmit",
354
+ "typecheck": "tsgo --project tsconfig.app.json --noEmit",
351
355
  "generate:types": "tsx scripts/generate-types.js && tsx scripts/generate-flat-config.js",
352
356
  "generate:sri": "tsx scripts/generate-graphiql-sri.ts",
353
357
  "build:standalone": "vite build --mode standalone --config vite.standalone.config.ts --log-level=error",
@@ -104,6 +104,7 @@ const NavigationCategoryInner = ({
104
104
  defaultOpen={isDefaultOpen}
105
105
  open={open}
106
106
  onOpenChange={(value) => {
107
+ if (!isCollapsible) return;
107
108
  // Categories with a link navigate on row click, so they only open here
108
109
  // (closing is done via the chevron). Without a link the row toggles.
109
110
  const nextOpen = category.link ? true : value;
@@ -1,2 +1,5 @@
1
- // Lazy-loaded animation features for LazyMotion (keeps the main bundle small).
2
- export { domAnimation as default } from "motion/react";
1
+ // Lazy load motion features
2
+ // See: https://motion.dev/docs/react-lazy-motion
3
+ import { domAnimation } from "motion/react";
4
+
5
+ export default domAnimation;
@@ -24,6 +24,7 @@ import { Popover, PopoverContent, PopoverTrigger } from "zudoku/ui/Popover.js";
24
24
  import type { TocEntry } from "../../../vite/mdx/rehype-extract-toc-with-jsx.js";
25
25
  import { AiAssistantMenuItems } from "../../components/AiAssistantMenuItems.js";
26
26
  import { CategoryHeading } from "../../components/CategoryHeading.js";
27
+ import { useIsClient } from "../../components/ClientOnly.js";
27
28
  import { useViewportAnchor } from "../../components/context/ViewportAnchorContext.js";
28
29
  import { useZudoku } from "../../components/context/ZudokuContext.js";
29
30
  import { DeveloperHint } from "../../components/DeveloperHint.js";
@@ -193,6 +194,8 @@ export const MdxPage = ({
193
194
  ? new Date(frontmatter.lastModifiedTime)
194
195
  : null;
195
196
 
197
+ const isClient = useIsClient();
198
+
196
199
  const editConfig =
197
200
  frontmatter.suggestEdit !== false &&
198
201
  (frontmatter.suggestEdit ?? defaultOptions?.suggestEdit);
@@ -273,7 +276,7 @@ export const MdxPage = ({
273
276
  centered && "xl:mx-auto",
274
277
  )}
275
278
  >
276
- <header className="flow-root">
279
+ <header className="flow-root isolate">
277
280
  {showTocSidebar && (
278
281
  <>
279
282
  <Slot.Source name="top-navigation-side" type="append">
@@ -289,7 +292,7 @@ export const MdxPage = ({
289
292
  )}
290
293
  {(copyMarkdownConfig || showTocPopover) && (
291
294
  <div
292
- className="float-end ms-4 mt-1 flex items-center gap-2"
295
+ className="relative z-10 float-end ms-4 mt-1 flex items-center gap-2"
293
296
  role="group"
294
297
  aria-label="Page actions"
295
298
  >
@@ -400,15 +403,27 @@ export const MdxPage = ({
400
403
  <div>
401
404
  {showLastModified && lastModifiedDate && (
402
405
  <div
403
- title={lastModifiedDate.toLocaleString(undefined, {
404
- dateStyle: "full",
405
- timeStyle: "medium",
406
- })}
406
+ // Render the tooltip (full date + time in the viewer's local
407
+ // timezone) only on the client. It's omitted on the server and
408
+ // the first client render, so there's no hydration mismatch,
409
+ // then added after mount.
410
+ title={
411
+ isClient
412
+ ? lastModifiedDate.toLocaleString("en-US", {
413
+ dateStyle: "full",
414
+ timeStyle: "medium",
415
+ })
416
+ : undefined
417
+ }
407
418
  >
408
419
  Last modified on{" "}
409
420
  <time dateTime={lastModifiedDate.toISOString()}>
410
421
  {lastModifiedDate.toLocaleDateString("en-US", {
411
422
  dateStyle: "long",
423
+ // Pinned to UTC so the prerendered day matches the client
424
+ // render; a local timezone would shift the day near a UTC
425
+ // boundary and cause a hydration error (#418).
426
+ timeZone: "UTC",
412
427
  })}
413
428
  </time>
414
429
  </div>