Skip to content

Visualize Your Ideas With Code

docs: fix default values (#453)

Jacob25bb3496ce1e
diff --git a/packages/2d/src/components/Circle.ts b/packages/2d/src/components/Circle.ts
index 513a6916..5b8cfa6c 100644
--- a/packages/2d/src/components/Circle.ts
+++ b/packages/2d/src/components/Circle.ts
@@ -69,7 +69,7 @@ export class Circle extends Shape {
* This property can be used together with {@link startAngle} to turn this
* circle into a sector (when using fill) or an arc (when using stroke).
*
- * @default 0
+ * @defaultValue 0
*/
@initial(0)
@signal()
@@ -82,7 +82,7 @@ export class Circle extends Shape {
* This property can be used together with {@link endAngle} to turn this
* circle into a sector (when using fill) or an arc (when using stroke).
*
- * @default 360
+ * @defaultValue 360
*/
@initial(360)
@signal()
@@ -116,7 +116,7 @@ export class Circle extends Shape {
* />
* ```
*
- * @default false
+ * @defaultValue false
*/
@initial(false)
@signal()
diff --git a/packages/2d/src/components/Icon.ts b/packages/2d/src/components/Icon.ts
index de3b036a..800d5f98 100644
--- a/packages/2d/src/components/Icon.ts
+++ b/packages/2d/src/components/Icon.ts
@@ -44,7 +44,7 @@ export class Icon extends Img {
* Value can be either RGB or RGBA: `#bada55`, `#bada55aa` (latter is partially transparent)
* The shorthand version (e.g. `#abc` for `#aabbcc` is also possible.)
*
- * @default 'white'
+ * @defaultValue 'white'
*/
@initial('white')
@colorSignal()
diff --git a/packages/docs/src/components/Api/Comment/index.tsx b/packages/docs/src/components/Api/Comment/index.tsx
index 9b1b1bb2..b131ec66 100644
--- a/packages/docs/src/components/Api/Comment/index.tsx
+++ b/packages/docs/src/components/Api/Comment/index.tsx
@@ -31,6 +31,10 @@ function FullComment({comment}: {comment: JSONOutput.Comment}) {
() => comment?.blockTags?.filter(({tag}) => tag === '@example') ?? [],
[comment],
);
+ const defaultValue = useMemo(
+ () => comment?.blockTags?.find(({tag}) => tag === '@defaultValue'),
+ [comment],
+ );
const deprecated = useMemo(
() => comment?.blockTags?.find(({tag}) => tag === '@deprecated'),
[comment],
@@ -67,6 +71,12 @@ function FullComment({comment}: {comment: JSONOutput.Comment}) {
<div className={clsx(styles.clearFix, styles.inverse)}></div>
</>
)}
+ {defaultValue && (
+ <>
+ Default Value:{' '}
+ <code>{defaultValue.content.map(part => part.text).join('')}</code>
+ </>
+ )}
{deprecated && (
<>
<h4>Deprecated</h4>
diff --git a/packages/docs/static/img/ui.svg b/packages/docs/static/img/ui.svg
index 54d71502..b1549f32 100644
--- a/packages/docs/static/img/ui.svg
+++ b/packages/docs/static/img/ui.svg
@@ -58,9 +58,9 @@
<g id="scene1" serif:id="scene" transform="matrix(14,0,0,14,145,109.11)"></g>
<text x="103px" y="109.11px"
style="font-family:'JetBrainsMono-Regular', 'JetBrains Mono', monospace;font-size:14px;fill:#fff;fill-opacity:0.6;">scene</text></g>
- <g id="range"><path d="M640,48l-557,0c-2.208,0 -4,1.792 -4,4l-0,22c-0,2.208 1.792,4 4,4l557,0l0,-30Z" style="fill:#1e3a4f;"/>
- <path d="M79,73.9l0,0.002c0,2.263 1.835,4.098 4.098,4.098c50.804,0 556.902,0 556.902,0"
- style="fill:none;stroke:#32a1f6;stroke-width:2px;"/></g>
+ <g id="range">
+ <path d="M740,48l-657,0c-2.208,0 -4,1.792 -4,4l-0,22c-0,2.208 1.792,4 4,4l557,0" fill="#242424" stroke="#444" stroke-width="2"/>
+ </g>
<g id="event"><path d="M407,144c-0,-6.627 -5.373,-12 -12,-12c-26.121,0 -87.879,0 -114,0c-6.627,0 -12,5.373 -12,12c0,0 0,0 0,0c0,6.627 5.373,12 12,12c26.121,0 87.879,0 114,0c6.627,-0 12,-5.373 12,-12c0,0 0,0 0,-0Z" style="fill:#274358;"/>
<path d="M431,144c-0,-6.627 -5.373,-12 -12,-12l-48,0l0,12c0,3.183 1.264,6.235 3.515,8.485c2.25,2.251 5.302,3.515 8.485,3.515l36,0c6.627,0 12,-5.373 12,-12l0,-0Z"
style="fill:#33a6ff;"/>
diff --git a/packages/vite-plugin/src/main.ts b/packages/vite-plugin/src/main.ts
index bb4b942d..abb45b55 100644
--- a/packages/vite-plugin/src/main.ts
+++ b/packages/vite-plugin/src/main.ts
@@ -27,13 +27,13 @@ export interface MotionCanvasPluginConfig {
* })
* ```
*
- * @default './src/project.ts'
+ * @defaultValue './src/project.ts'
*/
project?: string | string[];
/**
* A directory path to which the animation will be rendered.
*
- * @default './output'
+ * @defaultValue './output'
*/
output?: string;
/**
@@ -49,7 +49,7 @@ export interface MotionCanvasPluginConfig {
* there. This leaves the original files open for modification with hot module
* replacement still working.
*
- * @default /\.(wav|ogg)$/
+ * @defaultValue /\.(wav|ogg)$/
*/
bufferedAssets?: RegExp | false;
/**
@@ -68,7 +68,7 @@ export interface MotionCanvasPluginConfig {
* - `index` - Receives a list of all projects as its first argument and
* creates the initial page for selecting a project.
*
- * @default '\@motion-canvas/ui'
+ * @defaultValue '\@motion-canvas/ui'
*/
editor?: string;
/**
diff --git a/packages/vite-plugin/src/proxy-middleware.ts b/packages/vite-plugin/src/proxy-middleware.ts
index d51dd6ae..e33ad84a 100644
--- a/packages/vite-plugin/src/proxy-middleware.ts
+++ b/packages/vite-plugin/src/proxy-middleware.ts
@@ -31,7 +31,7 @@ export interface MotionCanvasCorsProxyOptions {
* Pass an empty Array to allow all types of resources, although this is not
* recommended.
*
- * @default ["image/*", "video/*"]
+ * @defaultValue ["image/*", "video/*"]
*/
allowedMimeTypes?: string[];
/**
diff --git a/tsdoc.json b/tsdoc.json
index 2913be0c..8592d23c 100644
--- a/tsdoc.json
+++ b/tsdoc.json
@@ -33,7 +33,7 @@
"@typeParam": true,
"@ignore": true,
"@inheritDoc": true,
- "@default": true,
+ "@defaultValue": true,
"@see": true
}
}