diff --git a/.github/workflows/deploy-docs.yaml b/.github/workflows/deploy-docs.yaml index 1265f3f4..cbdeb54c 100644 --- a/.github/workflows/deploy-docs.yaml +++ b/.github/workflows/deploy-docs.yaml @@ -4,8 +4,6 @@ on: push: branches: - main - - beta - - alpha - docs concurrency: diff --git a/docs/docs/about.jsx b/docs/docs/about.jsx index 6340e099..6261d60d 100644 --- a/docs/docs/about.jsx +++ b/docs/docs/about.jsx @@ -1,36 +1,25 @@ -import React, { useMemo } from 'react'; -import { Container, Sprite, Stage, Text } from '@pixi/react'; -import { BlurFilter, TextStyle } from 'pixi.js'; +import { Application, extend } from '@pixi/react'; +import { Container, Graphics } from 'pixi.js'; +import { useCallback } from 'react'; + +extend({ + Container, + Graphics, +}); export default function App() { - const blurFilter = useMemo(() => new BlurFilter(2), []); - const bunnyUrl = 'https://pixijs.io/pixi-react/img/bunny.png'; - return ( - - - - + const drawCallback = useCallback((graphics) => { + graphics.clear(); + graphics.setFillStyle({ color: 'red' }); + graphics.rect(0, 0, 100, 100); + graphics.fill(); + }, []); - - - - + return ( + + + + + ); } diff --git a/docs/docs/about.mdx b/docs/docs/about.mdx index 0773efd9..d54368b4 100644 --- a/docs/docs/about.mdx +++ b/docs/docs/about.mdx @@ -1,11 +1,11 @@ --- slug: /about sidebar_position: 1 +hide_title: true --- -import { EmbeddedEditor } from "@site/src/components/Editor/EmbeddedEditor"; -import IndexFile from '!!raw-loader!./about'; -# About +import { EmbeddedEditor } from '@site/src/components/Editor/EmbeddedEditor'; +import IndexFile from '!!raw-loader!./about';
@@ -20,12 +20,11 @@ import IndexFile from '!!raw-loader!./about';
- Simply the best way to write PixiJS applications in React -
- - Write PixiJS applications using React - declarative style 👌 - + Simply the best way to write PixiJS applications in React +
+ + Write PixiJS applications using React declarative style 👌 +
![release](https://img.shields.io/github/v/release/pixijs/pixi-react)    ![downloads](https://img.shields.io/npm/dm/@pixi/react)    ![pixi](https://img.shields.io/badge/pixi-v6/v7-E72264.svg) @@ -34,139 +33,302 @@ import IndexFile from '!!raw-loader!./about'; ## Features -- React 17 and 18 support -- PixiJS v6 and v7 support -- `react-spring` compatible animated components +- React v19 support +- PixiJS v8 support + +## Getting Started -## Quick start +### Quick Start -If you want to start a new React project from scratch, we recommend [Vite](https://vitejs.dev/guide/). -To add to an existing React application, just install the dependencies. +If you want to start a new React project from scratch then we recommend [Create React App](https://github.com/facebook/create-react-app), but `@pixi/react` should work with any React application (Remix, Next.js, etc). +To add `@pixi/react` to an existing React application, just install the dependencies: -### 1. Create a new React project with Vite: +#### Install Dependencies ```bash -# for typescript use "--template react-ts" -npx create-vite@latest --template react my-app -cd my-app -npm install +npm install pixi.js@^8.2.6 @pixi/react@beta ``` -### 2. Install Pixi-React dependencies: +#### Pixie React Usage -```bash -npm install pixi.js@7 @pixi/react@7 + + +## Docs + +### `extend` + +One of the most important concepts to understand with v8 is `extend`. Normally `@pixi/react` would have to import all pf Pixi.js to be able to provide the full library as JSX components. Instead, we use an internal catalogue of components populated by the `extend` API. This allows you to define exactly which parts of Pixi.js you want to import, keeping your bundle sizes small. + +To allow `@pixi/react` to use a Pixi.js component, pass it to the `extend` API: + +```jsx +import { Container } from 'pixi.js'; +import { extend } from '@pixi/react'; + +extend({ Container }); + +const MyComponent = () => ; ``` -### 3. Replace App.jsx with the following: +> [!CAUTION] +> Attempting to use components that haven't been passed to the `extend` API **will result in errors**. + +### Components + +#### `` + +The `` component is used to wrap your `@pixi/react` app. The `` component can take [all props that can be set](https://pixijs.download/release/docs/app.ApplicationOptions.html) on [`PIXI.Application`](https://pixijs.download/release/docs/app.Application.html). + +##### Example Usage ```jsx -import './App.css'; -import { useMemo } from 'react'; +import { Application } from '@pixi/react'; -import { BlurFilter, TextStyle } from 'pixi.js'; -import { Stage, Container, Sprite, Text } from '@pixi/react'; +const MyComponent = () => { + return ; +}; +``` -const App = () => { - const blurFilter = useMemo(() => new BlurFilter(2), []); - const bunnyUrl = 'https://pixijs.io/pixi-react/v7/img/bunny.png'; - return ( - - - - - - - - - - ); +###### `defaultTextStyle` + +`defaultTextStyle` is a convenience property. Whatever is passed will automatically be assigned to Pixi.js's [`TextStyle.defaultTextStyle`](https://pixijs.download/release/docs/text.TextStyle.html#defaultTextStyle). + +> [!NOTE] +> This property **is not retroactive**. It will only apply to text components created after `defaultTextStyle` is set. Any text components created before setting `defaultTextStyle` will retain the base styles they had before `defaultTextStyle` was changed. + +###### `extensions` + +`extensions` is an array of extensions to be loaded. Adding and removing items from this array will automatically load/unload the extensions. The first time this is handled happens before the application is initialised. See Pixi.js's [`extensions`](https://pixijs.download/release/docs/extensions.html) documentation for more info on extensions. + +###### `resizeTo` + +The `` component supports the `resizeTo` property, with some additional functionality: it can accept any HTML element **or** it can take a React `ref` directly. + +```jsx +import { Application } from '@pixi/react'; +import { useRef } from 'react'; +const MyComponent = () => { + const parentRef = useRef(null); + return ( +
+ +
+ ); }; +``` -export default App; +#### Pixi Components + +All other components should be included in your IDE's intellisense/autocomplete once you've installed/imported `@pixi/react`. If it's exported from Pixi.js, it's supported as a component with the `pixi` prefix. Here's a selection of commonly used components: + +```jsx + + + + + + ``` -### 4. Run the app: +##### `` -```bash -npm run dev +The `pixiGraphics` component has a special `draw` property. `draw` takes a callback which receives the `Graphics` context, allowing drawing to happen on every tick. + +```jsx +const MyComponent = () => { + return ( + { + graphics.clear(); + graphics.setFillStyle({ color: 'red' }); + graphics.rect(0, 0, 100, 100); + graphics.fill(); + }} + /> + ); +}; ``` -The final result should look like this: +#### Custom Components -
- Screenshot of the quick start 'my-app' project -
+`@pixi/react` supports custom components via the `extend` API. For example, you can create a `` component using the [`pixi-viewport`](https://github.com/davidfig/pixi-viewport) library: -
+```jsx +import { extend } from '@pixi/react'; +import { Viewport } from 'pixi-viewport'; + +extend({ Viewport }); + +const MyComponent = () => { + + + ; +}; +``` -See the [Codepen examples](https://codepen.io/collection/XPpGdb/) +The `extend` API will teach `@pixi/react` about your components, but TypeScript won't know about them nor their props. If you're using Typescript, check out our [docs for Typescript Users](#for-typescript-users). -## Example +### Hooks - +#### `useApplication` -## Components +`useApplication` allows access to the parent `PIXI.Application` created by the `` component. This hook _will not work_ outside of an `` component. Additionally, the parent application is passed via [React Context](https://react.dev/reference/react/useContext). This means `useApplication` will only work appropriately in _child components_, and in the same component that creates the ``. -Pass PixiJS properties directly as component props, example: +For example, the following example `useApplication` **will not** be able to access the parent application: ```jsx -import { Sprite } from '@pixi/react'; -import { BLEND_MODES, BlurFilter } from 'pixi.js'; -import { useMemo } from 'react'; - -const MyComponent = () => ( - const blurFilter = useMemo(() => new BlurFilter(4), []); - - ; +import { Application, useApplication } from '@pixi/react'; + +const ParentComponent = () => { + // This will cause an invariant violation. + const { app } = useApplication(); + + return ; +}; +``` + +Here's a working example where `useApplication` **will** be able to access the parent application: + +```jsx +import { Application, useApplication } from '@pixi/react'; + +const ChildComponent = () => { + const { app } = useApplication(); + + console.log(app); + + return ; +}; + +const ParentComponent = () => ( + + + ); ``` -## FAQ +#### `useExtend` + +`useExtend` allows the `extend` API to be used as a React hook. Additionally, the `useExtend` hook is memoised, while the `extend` function is not. + +```jsx +import { Container } from 'pixi.js'; +import { useExtend } from '@pixi/react'; + +const MyComponent = () => { + useExtend({ Container }); + + return ; +}; +``` + +#### `useTick` + +`useTick` allows a callback to be attached to the [`Ticker`](https://pixijs.download/release/docs/ticker.Ticker.html) on the parent application. + +```jsx +import { useTick } from '@pixi/react'; + +const MyComponent = () => { + useTick(() => console.log('This will be logged on every tick')); +}; +``` + +`useTick` optionally takes an options object. This allows control of all [`ticker.add`](https://pixijs.download/release/docs/ticker.Ticker.html#add) options, as well as adding the `isEnabled` option. Setting `isEnabled` to `false` will cause the callback to be disabled until the argument is changed to true again. + +```jsx +import { useState } from 'react' +import { useTick } from '@pixi/react' + +const MyComponent = () => { + const [isEnabled, setIsEnabled] = useState(false) + + useTick(() => console.log('This will be logged on every tick as long as `isEnabled` is `true`'), isEnabled) + + return ( + !previousState)}> + ) +} +``` + +> [!CAUTION] +> The callback passed to `useTick` **is not memoised**. This can cause issues where your callback is being removed and added back to the ticker on every frame if you're mutating state in a component where `useTick` is using a non-memoised function. For example, this issue would affect the component below because we are mutating the state, causing the component to re-render constantly: +> +> ```jsx +> import { useState } from 'react'; +> import { useTick } from '@pixi/react'; +> +> const MyComponent = () => { +> const [count, setCount] = useState(0); +> +> useTick(() => setCount((previousCount) => previousCount + 1)); +> +> return null; +> }; +> ``` +> +> This issue can be solved by memoising the callback passed to `useTick`: +> +> ```jsx +> import { useCallback, useState } from 'react'; +> import { useTick } from '@pixi/react'; +> +> const MyComponent = () => { +> const [count, setCount] = useState(0); +> +> const updateCount = useCallback(() => setCount((previousCount) => previousCount + 1), []); +> +> useTick(updateCount); +> }; +> ``` + +### For Typescript Users + +#### Custom Components + +`@pixi/react` already offers types for built-in components, but custom components need to be added to the library's type catalogue so it knows how to handle them. This can be achieved by adding your custom components to the `PixiElements` interface. Here's what it may look like to add the `viewport` component from our earlier `extend` example: + +```ts +// global.d.ts +import { type PixiReactElementProps } from '@pixi/react'; +import { type Viewport } from 'pixi-viewport'; + +declare module '@pixi/react' { + interface PixiElements { + viewport: PixiReactElementProps; + } +} +``` + +Now you'll be able to use your custom component in your project without any type errors! + +#### Unprefixed Elements -
- Interaction does not work -
+If you like to live life on the wild side, you can enable unprefixed Pixi elements (i.e. `` instead of ``) by adding the `UnprefixedPixiElements` interface to the `PixiElements` interface. - If you are using PixiJS without the `pixi.js` package and are instead using scoped packages like `@pixi/app`, `@pixi/sprite` etc, you will need to import the `@pixi/events` package to enable interaction. +```ts +// global.d.ts +import { type UnprefixedPixiElements } from '@pixi/react'; - ```js - import '@pixi/events'; - ``` -
-
+declare module '@pixi/react' { + interface PixiElements extends UnprefixedPixiElements {} +} +``` -## Join us +The prefixed and unprefixed elements have the same functionality, but we recommend sticking to the prefixed components to avoid collisions with other libraries that add intrinsic elements to JSX (such as [`react-dom`](https://www.npmjs.com/package/react-dom) and [`@react-three/fiber`](https://www.npmjs.com/package/@react-three/fiber)). -You're missing an amazing feature? Or just want to get in touch with fellow developers -and have a chat? Feel free to join our Discord channel. +> [!IMPORTANT] +> Some components conflict with other libaries, such as `` in `react-dom` and `` in `@react-three/fiber`. To address this the `pixi` prefixed elements are always available, even after injecting the unprefixed elements. -[Join us on Discord](https://discord.gg/zqbXQAADuM) +#### Extending Built-in Components + +The props for built-in components are available on the `PixiElements` type and can be used to extend the built-in types. + +```ts +import { type PixiElements } from '@pixi/react'; + +export type TilingSpriteProps = PixiElements['pixiTilingSprite'] & { + image?: string; + texture?: Texture; +}; +``` diff --git a/docs/docusaurus.config.ts b/docs/docusaurus.config.ts index 02a15804..9f64c7ee 100644 --- a/docs/docusaurus.config.ts +++ b/docs/docusaurus.config.ts @@ -46,6 +46,22 @@ const config: Config = { // Remove this to remove the "edit this page" links. editUrl: 'https://github.com/pixijs/pixi-react/tree/main/docs/', + lastVersion: 'current', + versions: { + '7.x': { + label: 'v7.x', + path: '7.x', + banner: 'none', + badge: true, + }, + current: { + label: 'v8.x', + path: '/', + banner: 'none', + badge: false, + }, + }, + breadcrumbs: false }, blog: { showReadingTime: true, @@ -82,6 +98,11 @@ const config: Config = { position: 'left', label: 'Guides', }, + { + type: 'docsVersionDropdown', + position: 'right', + dropdownActiveClassDisabled: true, + }, { href: 'https://opencollective.com/pixijs', className: 'header-link header-open-col-link', diff --git a/docs/src/components/Editor/Editor.tsx b/docs/src/components/Editor/Editor.tsx index 8df19cf5..06ddcf92 100644 --- a/docs/src/components/Editor/Editor.tsx +++ b/docs/src/components/Editor/Editor.tsx @@ -13,18 +13,34 @@ export interface EditorProps showConsole?: boolean; width?: number | string; height?: number | string; + version?: 'v7' | 'v8'; dependencies?: Record; files?: Record; fontSize?: number; handleEditorCodeChanged?: (nextSourceCode: string | undefined) => void; } +const v7Dependencies = { + 'pixi.js': '^7', + '@pixi/react': '^7', + react: '^18', + 'react-dom': '^18', +}; + +const v8Dependencies = { + 'pixi.js': '^8', + '@pixi/react': 'beta', + react: '^19', + 'react-dom': '^19', +}; + export function Editor({ viewType = 'both', showConsole = false, width = '100%', height = '100%', - dependencies = { 'pixi.js': '^7', '@pixi/react': 'latest', react: '^18', 'react-dom': '^18' }, + version = 'v8', + dependencies, files = { 'App.js': '// Your code here' }, fontSize = 12, handleEditorCodeChanged, @@ -43,11 +59,39 @@ export function Editor({ code: (files['App.js'] as string) ?? '// Your code here', hidden: false, active: true, + }, + '/public/index.html': { + code: ` + + + + + Document + + +
+ + `, + hidden: true, + }, + '/index.js': { + code: `import React from "react"; + import { createRoot } from "react-dom/client"; + import "./styles.css"; + + import App from "./App"; + const root = createRoot(document.getElementById("root")); + root.render( + + );`, + hidden: true, }, ...filesWithoutIndexJs, }); + dependencies ??= version === 'v7' ? v7Dependencies : v8Dependencies; + return ( {() => ( @@ -55,7 +99,7 @@ export function Editor({ template="react" theme={colorMode === 'dark' ? dracula : githubLight} files={filesState} - customSetup={{ dependencies, entry: 'index.html' }} + customSetup={{ dependencies }} style={{ height, width, margin: '0 auto', maxWidth: '100%' }} options={{ recompileDelay: 500, diff --git a/docs/versioned_docs/version-7.x/about.jsx b/docs/versioned_docs/version-7.x/about.jsx new file mode 100644 index 00000000..6340e099 --- /dev/null +++ b/docs/versioned_docs/version-7.x/about.jsx @@ -0,0 +1,36 @@ +import React, { useMemo } from 'react'; +import { Container, Sprite, Stage, Text } from '@pixi/react'; +import { BlurFilter, TextStyle } from 'pixi.js'; + +export default function App() { + const blurFilter = useMemo(() => new BlurFilter(2), []); + const bunnyUrl = 'https://pixijs.io/pixi-react/img/bunny.png'; + return ( + + + + + + + + + + ); +} diff --git a/docs/versioned_docs/version-7.x/about.mdx b/docs/versioned_docs/version-7.x/about.mdx new file mode 100644 index 00000000..d9bc7801 --- /dev/null +++ b/docs/versioned_docs/version-7.x/about.mdx @@ -0,0 +1,172 @@ +--- +slug: /about +sidebar_position: 1 +--- +import { EmbeddedEditor } from "@site/src/components/Editor/EmbeddedEditor"; +import IndexFile from '!!raw-loader!./about'; + +# About + +
+
+

+ Pixi React +

+ pixi-react +
+ +
+ Simply the best way to write PixiJS applications in React +
+ + Write PixiJS applications using React + declarative style 👌 + +
+ +![release](https://img.shields.io/github/v/release/pixijs/pixi-react)    ![downloads](https://img.shields.io/npm/dm/@pixi/react)    ![pixi](https://img.shields.io/badge/pixi-v6/v7-E72264.svg) + +
+ +## Features + +- React 17 and 18 support +- PixiJS v6 and v7 support +- `react-spring` compatible animated components + +## Quick start + +If you want to start a new React project from scratch, we recommend [Vite](https://vitejs.dev/guide/). +To add to an existing React application, just install the dependencies. + +### 1. Create a new React project with Vite: + +```bash +# for typescript use "--template react-ts" +npx create-vite@latest --template react my-app +cd my-app +npm install +``` + +### 2. Install Pixi-React dependencies: + +```bash +npm install pixi.js@7 @pixi/react@7 +``` + +### 3. Replace App.jsx with the following: + +```jsx +import './App.css'; +import { useMemo } from 'react'; + +import { BlurFilter, TextStyle } from 'pixi.js'; +import { Stage, Container, Sprite, Text } from '@pixi/react'; + +const App = () => { + const blurFilter = useMemo(() => new BlurFilter(2), []); + const bunnyUrl = 'https://pixijs.io/pixi-react/v7/img/bunny.png'; + return ( + + + + + + + + + + ); +}; + +export default App; +``` + +### 4. Run the app: + +```bash +npm run dev +``` + +The final result should look like this: + +
+ Screenshot of the quick start 'my-app' project +
+ +
+ +See the [Codepen examples](https://codepen.io/collection/XPpGdb/) + +## Example + + + +## Components + +Pass PixiJS properties directly as component props, example: + +```jsx +import { Sprite } from '@pixi/react'; +import { BLEND_MODES, BlurFilter } from 'pixi.js'; +import { useMemo } from 'react'; + +const MyComponent = () => ( + const blurFilter = useMemo(() => new BlurFilter(4), []); + + ; +); +``` + +## FAQ + +
+ Interaction does not work +
+ + If you are using PixiJS without the `pixi.js` package and are instead using scoped packages like `@pixi/app`, `@pixi/sprite` etc, you will need to import the `@pixi/events` package to enable interaction. + + ```js + import '@pixi/events'; + ``` +
+
+ +## Join us + +You're missing an amazing feature? Or just want to get in touch with fellow developers +and have a chat? Feel free to join our Discord channel. + +[Join us on Discord](https://discord.gg/zqbXQAADuM) diff --git a/docs/docs/components/AnimatedSprite.mdx b/docs/versioned_docs/version-7.x/components/AnimatedSprite.mdx similarity index 90% rename from docs/docs/components/AnimatedSprite.mdx rename to docs/versioned_docs/version-7.x/components/AnimatedSprite.mdx index 9f50f1a1..855084b8 100644 --- a/docs/docs/components/AnimatedSprite.mdx +++ b/docs/versioned_docs/version-7.x/components/AnimatedSprite.mdx @@ -20,7 +20,7 @@ https://pixijs.download/v7.x/docs/PIXI.AnimatedSprite.html ## Usage - + ## Example diff --git a/docs/docs/components/AnimatedSprite/index.jsx b/docs/versioned_docs/version-7.x/components/AnimatedSprite/index.jsx similarity index 100% rename from docs/docs/components/AnimatedSprite/index.jsx rename to docs/versioned_docs/version-7.x/components/AnimatedSprite/index.jsx diff --git a/docs/docs/components/AnimatedSprite/makeAnimatedSpriteTextures.js b/docs/versioned_docs/version-7.x/components/AnimatedSprite/makeAnimatedSpriteTextures.js similarity index 100% rename from docs/docs/components/AnimatedSprite/makeAnimatedSpriteTextures.js rename to docs/versioned_docs/version-7.x/components/AnimatedSprite/makeAnimatedSpriteTextures.js diff --git a/docs/docs/components/BitmapText.jsx b/docs/versioned_docs/version-7.x/components/BitmapText.jsx similarity index 100% rename from docs/docs/components/BitmapText.jsx rename to docs/versioned_docs/version-7.x/components/BitmapText.jsx diff --git a/docs/docs/components/BitmapText.mdx b/docs/versioned_docs/version-7.x/components/BitmapText.mdx similarity index 88% rename from docs/docs/components/BitmapText.mdx rename to docs/versioned_docs/version-7.x/components/BitmapText.mdx index 7fb661c6..ce1bf614 100644 --- a/docs/docs/components/BitmapText.mdx +++ b/docs/versioned_docs/version-7.x/components/BitmapText.mdx @@ -10,7 +10,7 @@ https://pixijs.download/v7.x/docs/PIXI.BitmapText.html ## Usage - + ## Example diff --git a/docs/docs/components/Container.jsx b/docs/versioned_docs/version-7.x/components/Container.jsx similarity index 100% rename from docs/docs/components/Container.jsx rename to docs/versioned_docs/version-7.x/components/Container.jsx diff --git a/docs/docs/components/Container.mdx b/docs/versioned_docs/version-7.x/components/Container.mdx similarity index 86% rename from docs/docs/components/Container.mdx rename to docs/versioned_docs/version-7.x/components/Container.mdx index bdcdfafc..11005f72 100644 --- a/docs/docs/components/Container.mdx +++ b/docs/versioned_docs/version-7.x/components/Container.mdx @@ -9,7 +9,7 @@ https://pixijs.download/v7.x/docs/PIXI.Container.html ## Usage - + ## Example diff --git a/docs/docs/components/ExampleAssetLoader.jsx b/docs/versioned_docs/version-7.x/components/ExampleAssetLoader.jsx similarity index 100% rename from docs/docs/components/ExampleAssetLoader.jsx rename to docs/versioned_docs/version-7.x/components/ExampleAssetLoader.jsx diff --git a/docs/docs/components/Graphics.jsx b/docs/versioned_docs/version-7.x/components/Graphics.jsx similarity index 100% rename from docs/docs/components/Graphics.jsx rename to docs/versioned_docs/version-7.x/components/Graphics.jsx diff --git a/docs/docs/components/Graphics.mdx b/docs/versioned_docs/version-7.x/components/Graphics.mdx similarity index 96% rename from docs/docs/components/Graphics.mdx rename to docs/versioned_docs/version-7.x/components/Graphics.mdx index addb45d8..5630caaf 100644 --- a/docs/docs/components/Graphics.mdx +++ b/docs/versioned_docs/version-7.x/components/Graphics.mdx @@ -14,7 +14,7 @@ https://pixijs.download/v7.x/docs/PIXI.Graphics.html ## Usage - + ### The `draw` prop diff --git a/docs/docs/components/NineSlicePlane.jsx b/docs/versioned_docs/version-7.x/components/NineSlicePlane.jsx similarity index 100% rename from docs/docs/components/NineSlicePlane.jsx rename to docs/versioned_docs/version-7.x/components/NineSlicePlane.jsx diff --git a/docs/docs/components/NineSlicePlane.mdx b/docs/versioned_docs/version-7.x/components/NineSlicePlane.mdx similarity index 86% rename from docs/docs/components/NineSlicePlane.mdx rename to docs/versioned_docs/version-7.x/components/NineSlicePlane.mdx index c7a642a3..a6d6fbc6 100644 --- a/docs/docs/components/NineSlicePlane.mdx +++ b/docs/versioned_docs/version-7.x/components/NineSlicePlane.mdx @@ -9,7 +9,7 @@ https://pixijs.download/v7.x/docs/PIXI.NineSlicePlane.html ## Usage - + ## Example diff --git a/docs/docs/components/ParticleContainer.jsx b/docs/versioned_docs/version-7.x/components/ParticleContainer.jsx similarity index 100% rename from docs/docs/components/ParticleContainer.jsx rename to docs/versioned_docs/version-7.x/components/ParticleContainer.jsx diff --git a/docs/docs/components/ParticleContainer.mdx b/docs/versioned_docs/version-7.x/components/ParticleContainer.mdx similarity index 95% rename from docs/docs/components/ParticleContainer.mdx rename to docs/versioned_docs/version-7.x/components/ParticleContainer.mdx index f545a113..8da5dfbd 100644 --- a/docs/docs/components/ParticleContainer.mdx +++ b/docs/versioned_docs/version-7.x/components/ParticleContainer.mdx @@ -40,7 +40,7 @@ If true, container allocates more batches in case there are more than `maxSize` ## Usage - + ## Example diff --git a/docs/docs/components/SimpleMesh.mdx b/docs/versioned_docs/version-7.x/components/SimpleMesh.mdx similarity index 83% rename from docs/docs/components/SimpleMesh.mdx rename to docs/versioned_docs/version-7.x/components/SimpleMesh.mdx index 685d9349..78e6770a 100644 --- a/docs/docs/components/SimpleMesh.mdx +++ b/docs/versioned_docs/version-7.x/components/SimpleMesh.mdx @@ -10,7 +10,7 @@ https://pixijs.download/v7.x/docs/PIXI.SimpleMesh.html ## Usage - + ## Example diff --git a/docs/docs/components/SimpleMesh/index.jsx b/docs/versioned_docs/version-7.x/components/SimpleMesh/index.jsx similarity index 100% rename from docs/docs/components/SimpleMesh/index.jsx rename to docs/versioned_docs/version-7.x/components/SimpleMesh/index.jsx diff --git a/docs/docs/components/SimpleMesh/makeSimpleMeshData.js b/docs/versioned_docs/version-7.x/components/SimpleMesh/makeSimpleMeshData.js similarity index 100% rename from docs/docs/components/SimpleMesh/makeSimpleMeshData.js rename to docs/versioned_docs/version-7.x/components/SimpleMesh/makeSimpleMeshData.js diff --git a/docs/docs/components/SimpleRope.jsx b/docs/versioned_docs/version-7.x/components/SimpleRope.jsx similarity index 100% rename from docs/docs/components/SimpleRope.jsx rename to docs/versioned_docs/version-7.x/components/SimpleRope.jsx diff --git a/docs/docs/components/SimpleRope.mdx b/docs/versioned_docs/version-7.x/components/SimpleRope.mdx similarity index 85% rename from docs/docs/components/SimpleRope.mdx rename to docs/versioned_docs/version-7.x/components/SimpleRope.mdx index 670e93b9..939f1ccb 100644 --- a/docs/docs/components/SimpleRope.mdx +++ b/docs/versioned_docs/version-7.x/components/SimpleRope.mdx @@ -9,7 +9,7 @@ https://pixijs.download/v7.x/docs/PIXI.SimpleRope.html ## Usage - + ## Example diff --git a/docs/docs/components/Sprite.jsx b/docs/versioned_docs/version-7.x/components/Sprite.jsx similarity index 100% rename from docs/docs/components/Sprite.jsx rename to docs/versioned_docs/version-7.x/components/Sprite.jsx diff --git a/docs/docs/components/Sprite.mdx b/docs/versioned_docs/version-7.x/components/Sprite.mdx similarity index 85% rename from docs/docs/components/Sprite.mdx rename to docs/versioned_docs/version-7.x/components/Sprite.mdx index 317bc681..4ba39391 100644 --- a/docs/docs/components/Sprite.mdx +++ b/docs/versioned_docs/version-7.x/components/Sprite.mdx @@ -9,7 +9,7 @@ https://pixijs.download/v7.x/docs/PIXI.Sprite.html ## Usage - + ## Example diff --git a/docs/docs/components/Text.jsx b/docs/versioned_docs/version-7.x/components/Text.jsx similarity index 100% rename from docs/docs/components/Text.jsx rename to docs/versioned_docs/version-7.x/components/Text.jsx diff --git a/docs/docs/components/Text.mdx b/docs/versioned_docs/version-7.x/components/Text.mdx similarity index 93% rename from docs/docs/components/Text.mdx rename to docs/versioned_docs/version-7.x/components/Text.mdx index fd2432dd..02d184fa 100644 --- a/docs/docs/components/Text.mdx +++ b/docs/versioned_docs/version-7.x/components/Text.mdx @@ -21,7 +21,7 @@ Note: isSprite establishes how the Text is rendered during its whole lifecycle a ## Usage - + ## Example diff --git a/docs/docs/components/TilingSprite.jsx b/docs/versioned_docs/version-7.x/components/TilingSprite.jsx similarity index 100% rename from docs/docs/components/TilingSprite.jsx rename to docs/versioned_docs/version-7.x/components/TilingSprite.jsx diff --git a/docs/docs/components/TilingSprite.mdx b/docs/versioned_docs/version-7.x/components/TilingSprite.mdx similarity index 86% rename from docs/docs/components/TilingSprite.mdx rename to docs/versioned_docs/version-7.x/components/TilingSprite.mdx index d474e44f..abdb6e1e 100644 --- a/docs/docs/components/TilingSprite.mdx +++ b/docs/versioned_docs/version-7.x/components/TilingSprite.mdx @@ -9,7 +9,7 @@ https://pixijs.download/dev/docs/PIXI.TilingSprite.html ## Usage - + ## Example diff --git a/docs/docs/components/_category_.json b/docs/versioned_docs/version-7.x/components/_category_.json similarity index 100% rename from docs/docs/components/_category_.json rename to docs/versioned_docs/version-7.x/components/_category_.json diff --git a/docs/docs/context-bridge.mdx b/docs/versioned_docs/version-7.x/context-bridge.mdx similarity index 100% rename from docs/docs/context-bridge.mdx rename to docs/versioned_docs/version-7.x/context-bridge.mdx diff --git a/docs/docs/custom-component.mdx b/docs/versioned_docs/version-7.x/custom-component.mdx similarity index 100% rename from docs/docs/custom-component.mdx rename to docs/versioned_docs/version-7.x/custom-component.mdx diff --git a/docs/docs/fallback-to-canvas.mdx b/docs/versioned_docs/version-7.x/fallback-to-canvas.mdx similarity index 100% rename from docs/docs/fallback-to-canvas.mdx rename to docs/versioned_docs/version-7.x/fallback-to-canvas.mdx diff --git a/docs/docs/hoc/_category_.json b/docs/versioned_docs/version-7.x/hoc/_category_.json similarity index 100% rename from docs/docs/hoc/_category_.json rename to docs/versioned_docs/version-7.x/hoc/_category_.json diff --git a/docs/docs/hoc/with-filters.mdx b/docs/versioned_docs/version-7.x/hoc/with-filters.mdx similarity index 100% rename from docs/docs/hoc/with-filters.mdx rename to docs/versioned_docs/version-7.x/hoc/with-filters.mdx diff --git a/docs/docs/hooks/Hooks.mdx b/docs/versioned_docs/version-7.x/hooks/Hooks.mdx similarity index 100% rename from docs/docs/hooks/Hooks.mdx rename to docs/versioned_docs/version-7.x/hooks/Hooks.mdx diff --git a/docs/docs/react-spring-tint.jsx b/docs/versioned_docs/version-7.x/react-spring-tint.jsx similarity index 100% rename from docs/docs/react-spring-tint.jsx rename to docs/versioned_docs/version-7.x/react-spring-tint.jsx diff --git a/docs/docs/react-spring.jsx b/docs/versioned_docs/version-7.x/react-spring.jsx similarity index 100% rename from docs/docs/react-spring.jsx rename to docs/versioned_docs/version-7.x/react-spring.jsx diff --git a/docs/docs/react-spring.mdx b/docs/versioned_docs/version-7.x/react-spring.mdx similarity index 94% rename from docs/docs/react-spring.mdx rename to docs/versioned_docs/version-7.x/react-spring.mdx index beec46ab..d6135512 100644 --- a/docs/docs/react-spring.mdx +++ b/docs/versioned_docs/version-7.x/react-spring.mdx @@ -27,7 +27,7 @@ const App = () => ( Click anywhere to animate -, document.getElementById('root')) ## Example - Disable `raf` and enable `renderOnComponentChange`: - + ### Update stage manually > Disable `raf` and `renderOnComponentChange`: - + ## Accessing Application diff --git a/docs/docs/stage/raf.jsx b/docs/versioned_docs/version-7.x/stage/raf.jsx similarity index 100% rename from docs/docs/stage/raf.jsx rename to docs/versioned_docs/version-7.x/stage/raf.jsx diff --git a/docs/docs/stage/raf2.jsx b/docs/versioned_docs/version-7.x/stage/raf2.jsx similarity index 100% rename from docs/docs/stage/raf2.jsx rename to docs/versioned_docs/version-7.x/stage/raf2.jsx diff --git a/docs/docs/typescript.mdx b/docs/versioned_docs/version-7.x/typescript.mdx similarity index 100% rename from docs/docs/typescript.mdx rename to docs/versioned_docs/version-7.x/typescript.mdx diff --git a/docs/versioned_sidebars/version-7.x-sidebars.json b/docs/versioned_sidebars/version-7.x-sidebars.json new file mode 100644 index 00000000..f6a9ddb9 --- /dev/null +++ b/docs/versioned_sidebars/version-7.x-sidebars.json @@ -0,0 +1,8 @@ +{ + "guides": [ + { + "type": "autogenerated", + "dirName": "." + } + ] +} diff --git a/docs/versions.json b/docs/versions.json new file mode 100644 index 00000000..c1b84e1f --- /dev/null +++ b/docs/versions.json @@ -0,0 +1,3 @@ +[ + "7.x" +]