@vx-oss/docs-story 1.0.7 → 1.0.8
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/client/arg-form.js +3 -3
- package/dist/client/compiled.d.ts +1 -1
- package/dist/client/compiled.js +1 -1
- package/dist/client/with-control.js +3 -3
- package/dist/i18n.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/next/index.js +2 -2
- package/dist/node_modules/.pnpm/{react-error-boundary@6.1.4_@types_react@19.2.18_react@19.2.8 → react-error-boundary@6.1.5_@types_react@19.2.18_react@19.2.8}/node_modules/react-error-boundary/dist/react-error-boundary.js +1 -1
- package/dist/utils/transform.js +1 -1
- package/dist/vite/index.js +1 -1
- package/dist/webpack/story.js +1 -1
- package/package.json +9 -9
package/dist/client/arg-form.js
CHANGED
|
@@ -7,11 +7,11 @@ import { typeToString } from "../type-tree/stringify.js";
|
|
|
7
7
|
import { formatDateForInput } from "../utils/date.js";
|
|
8
8
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { useState } from "react";
|
|
10
|
-
import { useArray, useDataEngine, useFieldValue, useNamespace, useObject } from "@
|
|
10
|
+
import { useArray, useDataEngine, useFieldValue, useNamespace, useObject } from "@fumari/stf";
|
|
11
11
|
import { ChevronRight, Plus, Trash2, X } from "lucide-react";
|
|
12
12
|
import { cva } from "class-variance-authority";
|
|
13
|
-
import { buttonVariants } from "
|
|
14
|
-
import { stringifyFieldKey } from "@
|
|
13
|
+
import { buttonVariants } from "fumadocs-ui/components/ui/button";
|
|
14
|
+
import { stringifyFieldKey } from "@fumari/stf/lib/utils";
|
|
15
15
|
import { useTranslations } from "@fuma-translate/react";
|
|
16
16
|
//#region src/client/arg-form.tsx
|
|
17
17
|
const labelVariants = cva("text-xs font-mono font-medium text-fd-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-70");
|
|
@@ -10,7 +10,7 @@ interface StoryOptions<C extends FC<any>> {
|
|
|
10
10
|
*/
|
|
11
11
|
args?: ArgsOptions<C> | (ArgsOptions<C> & VariantInfo)[];
|
|
12
12
|
/**
|
|
13
|
-
* Controls & data generated at build time by `@
|
|
13
|
+
* Controls & data generated at build time by `@fumadocs/story/vite` or `@fumadocs/story/next`.
|
|
14
14
|
*
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
package/dist/client/compiled.js
CHANGED
|
@@ -24,7 +24,7 @@ function defineStoryFactory() {
|
|
|
24
24
|
else if (_generated) {
|
|
25
25
|
generatedControls ??= deserialize(_generated.controls);
|
|
26
26
|
controls = generatedControls;
|
|
27
|
-
} else throw new Error(`[@
|
|
27
|
+
} else throw new Error(`[@fumadocs/story] No generated data for story, make sure the Vite plugin or Turbopack loader is configured correctly`);
|
|
28
28
|
return {
|
|
29
29
|
variant: preset.variant,
|
|
30
30
|
description: preset.description,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn } from "../utils/cn.js";
|
|
3
3
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "./components/select.js";
|
|
4
|
-
import { ErrorBoundary as m } from "../node_modules/.pnpm/react-error-boundary@6.1.
|
|
4
|
+
import { ErrorBoundary as m } from "../node_modules/.pnpm/react-error-boundary@6.1.5_@types_react@19.2.18_react@19.2.8/node_modules/react-error-boundary/dist/react-error-boundary.js";
|
|
5
5
|
import { FieldSet } from "./arg-form.js";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { Suspense, createElement, useDeferredValue, useRef, useState } from "react";
|
|
8
|
-
import { StfProvider, useDataEngine, useListener, useStf } from "@
|
|
8
|
+
import { StfProvider, useDataEngine, useListener, useStf } from "@fumari/stf";
|
|
9
9
|
import { AlertCircle } from "lucide-react";
|
|
10
|
-
import { buttonVariants } from "
|
|
10
|
+
import { buttonVariants } from "fumadocs-ui/components/ui/button";
|
|
11
11
|
import { useTranslations } from "@fuma-translate/react";
|
|
12
12
|
//#region src/client/with-control.tsx
|
|
13
13
|
function WithControl({ presets, displayName, Component }) {
|
package/dist/i18n.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Translations } from "./.translations/index.js";
|
|
2
|
-
import { TranslationExtension } from "
|
|
2
|
+
import { TranslationExtension } from "fumadocs-core/i18n";
|
|
3
3
|
//#region src/i18n.d.ts
|
|
4
4
|
declare function storyTranslations(): TranslationExtension<keyof Translations>;
|
|
5
5
|
//#endregion
|
package/dist/index.js
CHANGED
|
@@ -26,7 +26,7 @@ function defineStoryFactory(factoryOptions = {}) {
|
|
|
26
26
|
const fileContent = await fs$1.readFile(filePath, "utf-8");
|
|
27
27
|
return cached(cache, getHash(`controls:${filePath}:${name}:${fileContent}`), async () => {
|
|
28
28
|
const project = await initProject();
|
|
29
|
-
return generateControls("@
|
|
29
|
+
return generateControls("@fumadocs/story/next/client", project, filePath, name, fileContent);
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
32
|
return { defineStory(urlOrPath, { Component, name = "story", displayName, args = {} }) {
|
package/dist/next/index.js
CHANGED
|
@@ -9,7 +9,7 @@ function createNextStory(createOptions = {}) {
|
|
|
9
9
|
rules: {
|
|
10
10
|
...nextConfig.turbopack?.rules,
|
|
11
11
|
[filter]: { loaders: [{
|
|
12
|
-
loader: "@
|
|
12
|
+
loader: "@fumadocs/story/webpack/story",
|
|
13
13
|
options: loaderOptions
|
|
14
14
|
}] }
|
|
15
15
|
}
|
|
@@ -24,7 +24,7 @@ function createNextStory(createOptions = {}) {
|
|
|
24
24
|
test: filter,
|
|
25
25
|
enforce: "pre",
|
|
26
26
|
use: [{
|
|
27
|
-
loader: "@
|
|
27
|
+
loader: "@fumadocs/story/webpack/story",
|
|
28
28
|
options: loaderOptions
|
|
29
29
|
}]
|
|
30
30
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Component, createContext, createElement } from "react";
|
|
3
|
-
//#region ../../node_modules/.pnpm/react-error-boundary@6.1.
|
|
3
|
+
//#region ../../node_modules/.pnpm/react-error-boundary@6.1.5_@types+react@19.2.18_react@19.2.8/node_modules/react-error-boundary/dist/react-error-boundary.js
|
|
4
4
|
const h = createContext(null);
|
|
5
5
|
const c = {
|
|
6
6
|
didCatch: !1,
|
package/dist/utils/transform.js
CHANGED
|
@@ -50,7 +50,7 @@ function transformStoryFile(mode, code, id, project) {
|
|
|
50
50
|
const edits = [];
|
|
51
51
|
for (const parsed of calls) {
|
|
52
52
|
const [optionsArg] = parsed.call.arguments;
|
|
53
|
-
if (!isObjectLiteralExpression(optionsArg)) throw new Error("defineStory() options must be an object literal to inject controls from @
|
|
53
|
+
if (!isObjectLiteralExpression(optionsArg)) throw new Error("defineStory() options must be an object literal to inject controls from @fumadocs/story.");
|
|
54
54
|
const controls = generateControls(mode, project, id, parsed.exportName, content);
|
|
55
55
|
edits.push(injectControls(loaded.sourceFile, optionsArg, parsed.exportName, controls));
|
|
56
56
|
}
|
package/dist/vite/index.js
CHANGED
|
@@ -16,7 +16,7 @@ function story(pluginOptions = {}) {
|
|
|
16
16
|
filter: { id: filter },
|
|
17
17
|
async handler(code, id) {
|
|
18
18
|
projectPromise ??= createControlsProject(tsconfigPath);
|
|
19
|
-
return transformStoryFile("@
|
|
19
|
+
return transformStoryFile("@fumadocs/story/vite/client", code, id, await projectPromise);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
};
|
package/dist/webpack/story.js
CHANGED
|
@@ -13,7 +13,7 @@ const loader = function(source) {
|
|
|
13
13
|
projectPromise = createControlsProject(resolvedTsconfig);
|
|
14
14
|
}
|
|
15
15
|
try {
|
|
16
|
-
const transformed = transformStoryFile("@
|
|
16
|
+
const transformed = transformStoryFile("@fumadocs/story/next/client", source, this.resourcePath, await projectPromise);
|
|
17
17
|
callback(void 0, transformed ?? source);
|
|
18
18
|
} catch (error) {
|
|
19
19
|
if (!(error instanceof Error)) throw error;
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vx-oss/docs-story",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "Story integration to Fumadocs.",
|
|
5
5
|
"keywords": [],
|
|
6
|
+
"homepage": "https://vezham.com",
|
|
6
7
|
"license": "MIT",
|
|
7
8
|
"author": "Fuma Nama",
|
|
8
9
|
"repository": {
|
|
@@ -37,8 +38,7 @@
|
|
|
37
38
|
"cn": "^0.2.4",
|
|
38
39
|
"lucide-react": "^1.39.0",
|
|
39
40
|
"typescript": "~7.0.2",
|
|
40
|
-
"
|
|
41
|
-
"@vx-oss/docs-stf": "1.0.7"
|
|
41
|
+
"@fumari/stf": "npm:@vx-oss/docs-stf@1.0.8"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@fastify/deepmerge": "^3.2.1",
|
|
@@ -54,14 +54,14 @@
|
|
|
54
54
|
"tsdown": "0.22.14",
|
|
55
55
|
"vite": "^8.2.2",
|
|
56
56
|
"webpack": "^5.110.3",
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"tsconfig": "0.0.
|
|
57
|
+
"fumadocs-core": "npm:@vx-oss/docs-core@1.0.8",
|
|
58
|
+
"fumadocs-ui": "npm:@vx-oss/docs-base-ui@1.0.8",
|
|
59
|
+
"tsconfig": "0.0.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
62
|
"@types/react": "*",
|
|
63
|
-
"
|
|
64
|
-
"
|
|
63
|
+
"fumadocs-core": "*",
|
|
64
|
+
"fumadocs-ui": "*",
|
|
65
65
|
"next": "^15.3.0 || ^16.0.0",
|
|
66
66
|
"react": "^19.2.0",
|
|
67
67
|
"react-dom": "^19.2.0",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"inlinedDependencies": {
|
|
86
86
|
"@fastify/deepmerge": "3.2.1",
|
|
87
87
|
"@ungap/structured-clone": "1.4.0",
|
|
88
|
-
"react-error-boundary": "6.1.
|
|
88
|
+
"react-error-boundary": "6.1.5"
|
|
89
89
|
},
|
|
90
90
|
"scripts": {
|
|
91
91
|
"build": "tsdown",
|