Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
CyberDex committed Mar 26, 2024
1 parent 15bcd15 commit 18f4d7a
Show file tree
Hide file tree
Showing 29 changed files with 336 additions and 2,021 deletions.
2,186 changes: 250 additions & 1,936 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/Layout.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Container } from '@pixi/display';
import { Content, LayoutOptions, Styles } from './utils/types';
import { TextStyle } from '@pixi/text';
import { AlignController } from './controllers/AlignController';
import { StyleController } from './controllers/StyleController';
import { SizeController } from './controllers/SizeController';
import { ContentController } from './controllers/ContentController';
import { TextStyle } from '@pixi/text';
import { SizeController } from './controllers/SizeController';
import { StyleController } from './controllers/StyleController';
import { Content, LayoutOptions, Styles } from './utils/types';

/**
* Layout controller class for any PixiJS Container based instance.
Expand Down
2 changes: 1 addition & 1 deletion src/controllers/AlignController.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Layout, LayoutSystem } from '../Layout';
import { Text } from '@pixi/text';
import { Layout, LayoutSystem } from '../Layout';
import { isItJustAText } from '../utils/helpers';

/** Align controller manages {@link LayoutSystem} and it's content alignment. */
Expand Down
8 changes: 4 additions & 4 deletions src/controllers/ContentController.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/* eslint-disable no-case-declarations */
import { Layout, LayoutSystem } from '../Layout';
import { Content, ContentList, ContentType, LayoutOptions, LayoutStyles } from '../utils/types';
import { Container, DisplayObject } from '@pixi/display';
import { Text, TextStyle } from '@pixi/text';
import { Sprite } from '@pixi/sprite';
import { Graphics } from '@pixi/graphics';
import { Sprite } from '@pixi/sprite';
import { Text, TextStyle } from '@pixi/text';
import { Layout, LayoutSystem } from '../Layout';
import { stylesToPixiTextStyles } from '../utils/helpers';
import { Content, ContentList, ContentType, LayoutOptions, LayoutStyles } from '../utils/types';

/** Controls all {@link LayoutSystem} children sizing. */
export class ContentController
Expand Down
10 changes: 5 additions & 5 deletions src/controllers/SizeController.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/* eslint-disable no-case-declarations */
import { getColor, getNumber, isItJustAText } from '../utils/helpers';
import { LayoutSystem } from '../Layout';
import { Text } from '@pixi/text';
import { Container } from '@pixi/display';
import { FlexNumber, SizeControl } from '../utils/types';
import { Sprite } from '@pixi/sprite';
import { Graphics } from '@pixi/graphics';
import { NineSlicePlane } from '@pixi/mesh-extras';
import { Sprite } from '@pixi/sprite';
import { TilingSprite } from '@pixi/sprite-tiling';
import { Text } from '@pixi/text';
import { LayoutSystem } from '../Layout';
import { getColor, getNumber, isItJustAText } from '../utils/helpers';
import { FlexNumber, SizeControl } from '../utils/types';

/** Size controller manages {@link LayoutSystem} and it's content size. */
export class SizeController
Expand Down
9 changes: 5 additions & 4 deletions src/controllers/StyleController.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
import { TilingSprite } from '@pixi/sprite-tiling';
import { NineSlicePlane } from '@pixi/mesh-extras';
import type { ConditionalStyles, GradeToOne, Styles } from '../utils/types';
import { TilingSprite } from '@pixi/sprite-tiling';
import { TextStyle } from '@pixi/text';
import { stylesToPixiTextStyles } from '../utils/helpers';
import { BACKGROUND_SIZE, OVERFLOW, VERTICAL_ALIGN } from '../utils/constants';
import { LayoutSystem } from '../Layout';
import { BACKGROUND_SIZE, OVERFLOW, VERTICAL_ALIGN } from '../utils/constants';
import { stylesToPixiTextStyles } from '../utils/helpers';

import type { ConditionalStyles, GradeToOne, Styles } from '../utils/types';

/** Style controller manages {@link LayoutSystem} styles. */
export class StyleController
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export * from './controllers/AlignController';
export * from './controllers/ContentController';
export * from './controllers/SizeController';
export * from './controllers/StyleController';
export * from './controllers/AlignController';
export * from './Layout';
export * from './utils/constants';
export * from './utils/types';
export * from './Layout';
6 changes: 3 additions & 3 deletions src/stories/autoSize/ByBackground.stories.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Layout } from '../../Layout';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { Container } from '@pixi/display';
import { preloadAssets } from '../utils/helpers';
import { Sprite } from '@pixi/sprite';
import { Layout } from '../../Layout';
import { ALIGN } from '../../utils/constants';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { preloadAssets } from '../utils/helpers';

const assets = {
horizontal: 'Window/SmallSubstrate.png',
Expand Down
8 changes: 4 additions & 4 deletions src/stories/autoSize/ByContent.stories.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Layout } from '../../Layout';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { Container } from '@pixi/display';
import { toolTip } from '../components/ToolTip';
import { preloadAssets } from '../utils/helpers';
import { Sprite } from '@pixi/sprite';
import { Layout } from '../../Layout';
import { Content } from '../../utils/types';
import { toolTip } from '../components/ToolTip';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { preloadAssets } from '../utils/helpers';

const testAssets = {
energy: 'Icons/EnergyIcon.png',
Expand Down
8 changes: 4 additions & 4 deletions src/stories/autoSize/BySetSize.stories.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Texture } from '@pixi/core';
import { Container } from '@pixi/display';
import { NineSlicePlane } from '@pixi/mesh-extras';
import { Sprite } from '@pixi/sprite';
import { Layout } from '../../Layout';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { Container } from '@pixi/display';
import { ALIGN, BACKGROUND_SIZE } from '../../utils/constants';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { preloadAssets } from '../utils/helpers';
import { Sprite } from '@pixi/sprite';
import { Texture } from '@pixi/core';

const TEXTS = ['Width and height values are set in pixels.',
'Text will adapt to the layout size.',
Expand Down
2 changes: 1 addition & 1 deletion src/stories/autoSize/ByText.stories.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Container } from '@pixi/display';
import { Layout } from '../../Layout';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { ALIGN } from '../../utils/constants';
import { argTypes, getDefaultArgs } from '../utils/argTypes';

const args = {
text:
Expand Down
6 changes: 3 additions & 3 deletions src/stories/basic/Anchor.stories.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Layout } from '../../Layout';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { Container } from '@pixi/display';
import { Sprite } from '@pixi/sprite';
import { preloadAssets } from '../utils/helpers';
import { Layout } from '../../Layout';
import { POSITION } from '../../utils/constants';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { preloadAssets } from '../utils/helpers';

const assets = {
avatar: 'avatar-01.png'
Expand Down
6 changes: 3 additions & 3 deletions src/stories/basic/Basic.stories.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Layout } from '../../Layout';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { Container } from '@pixi/display';
import { Text } from '@pixi/text';
import { CSS_COLOR_NAMES, LOREM_TEXT, POSITION, ALIGN } from '../../utils/constants';
import { Layout } from '../../Layout';
import { ALIGN, CSS_COLOR_NAMES, LOREM_TEXT, POSITION } from '../../utils/constants';
import { argTypes, getDefaultArgs } from '../utils/argTypes';

const color = Object.keys(CSS_COLOR_NAMES).map((key) => key);

Expand Down
8 changes: 4 additions & 4 deletions src/stories/basic/ContentAdd.stories.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Layout } from '../../Layout';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { Container } from '@pixi/display';
import { CSS_COLOR_NAMES } from '../../utils/constants';
import { Text } from '@pixi/text';
import { Graphics } from '@pixi/graphics';
import { Text } from '@pixi/text';
import { Layout } from '../../Layout';
import { CSS_COLOR_NAMES } from '../../utils/constants';
import { LayoutStyles } from '../../utils/types';
import { argTypes, getDefaultArgs } from '../utils/argTypes';

const color = Object.keys(CSS_COLOR_NAMES).map((key) => key);

Expand Down
6 changes: 3 additions & 3 deletions src/stories/basic/TransformContainer.stories.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { Container } from '@pixi/display';
import { CSS_COLOR_NAMES, LOREM_TEXT, POSITION, ALIGN } from '../../utils/constants';
import { toolTip } from '../components/ToolTip';
import { Layout } from '../../Layout';
import { ALIGN, CSS_COLOR_NAMES, LOREM_TEXT, POSITION } from '../../utils/constants';
import { toolTip } from '../components/ToolTip';
import { argTypes, getDefaultArgs } from '../utils/argTypes';

const color = Object.keys(CSS_COLOR_NAMES).map((key) => key);

Expand Down
6 changes: 3 additions & 3 deletions src/stories/complex/AppLayout.stories.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Layout } from '../../Layout';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { Container } from '@pixi/display';
import { VERTICAL_ALIGN, ALIGN, POSITION, CSS_COLOR_NAMES } from '../../utils/constants';
import { Layout } from '../../Layout';
import { ALIGN, CSS_COLOR_NAMES, POSITION, VERTICAL_ALIGN } from '../../utils/constants';
import { LayoutStyles } from '../../utils/types';
import { argTypes, getDefaultArgs } from '../utils/argTypes';

const args = {
color: '#000000',
Expand Down
9 changes: 4 additions & 5 deletions src/stories/complex/NineSlicePlane.stories.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Layout } from '../../Layout';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { Container } from '@pixi/display';
import { preloadAssets } from '../utils/helpers';
import { Texture } from '@pixi/core';

import { Container } from '@pixi/display';
import { NineSlicePlane } from '@pixi/mesh-extras';
import { Layout } from '../../Layout';
import { LOREM_TEXT } from '../../utils/constants';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { preloadAssets } from '../utils/helpers';

const args = {
width: 97,
Expand Down
2 changes: 1 addition & 1 deletion src/stories/components/ToolTip.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Layout } from '../../Layout';
import { FancyButton } from '@pixi/ui';
import { Layout } from '../../Layout';
import { preloadAssets } from '../utils/helpers';

export async function toolTip(text: string): Promise<Layout>
Expand Down
8 changes: 4 additions & 4 deletions src/stories/dynamic/AddRemoveContent.stories.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Layout } from '../../Layout';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { Container } from '@pixi/display';
import { toolTip } from '../components/ToolTip';
import { preloadAssets } from '../utils/helpers';
import { Sprite } from '@pixi/sprite';
import { FancyButton } from '@pixi/ui';
import { Layout } from '../../Layout';
import { toolTip } from '../components/ToolTip';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { preloadAssets } from '../utils/helpers';

const testAssets = {
energy: 'Icons/EnergyIcon.png',
Expand Down
8 changes: 4 additions & 4 deletions src/stories/dynamic/ResizePixiInstance.stories.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Layout } from '../../Layout';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { Container } from '@pixi/display';
import { toolTip } from '../components/ToolTip';
import { preloadAssets } from '../utils/helpers';
import { Sprite } from '@pixi/sprite';
import { FancyButton } from '@pixi/ui';
import { Layout } from '../../Layout';
import { toolTip } from '../components/ToolTip';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { preloadAssets } from '../utils/helpers';

const assets = {
energy: 'Icons/EnergyIcon.png',
Expand Down
8 changes: 4 additions & 4 deletions src/stories/dynamic/UpdateStyles.stories.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Layout } from '../../Layout';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { Container } from '@pixi/display';
import { toolTip } from '../components/ToolTip';
import { preloadAssets } from '../utils/helpers';
import { Sprite } from '@pixi/sprite';
import { FancyButton } from '@pixi/ui';
import { Layout } from '../../Layout';
import { toolTip } from '../components/ToolTip';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { preloadAssets } from '../utils/helpers';

const assets = {
energy: 'Icons/EnergyIcon.png',
Expand Down
4 changes: 2 additions & 2 deletions src/stories/fit/Contain.stories.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Container } from '@pixi/display';
import { Sprite } from '@pixi/sprite';
import { Layout } from '../../Layout';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { Container } from '@pixi/display';
import { preloadAssets } from '../utils/helpers';
import { Sprite } from '@pixi/sprite';

const assets = {
bg: 'bg.png'
Expand Down
4 changes: 2 additions & 2 deletions src/stories/fit/ContainAndPosition.stories.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Container } from '@pixi/display';
import { Sprite } from '@pixi/sprite';
import { Layout } from '../../Layout';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { Container } from '@pixi/display';
import { preloadAssets } from '../utils/helpers';
import { Sprite } from '@pixi/sprite';

const assets = {
bg: 'bg.png',
Expand Down
4 changes: 2 additions & 2 deletions src/stories/fit/Fit.stories.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Container } from '@pixi/display';
import { Sprite } from '@pixi/sprite';
import { Layout } from '../../Layout';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { Container } from '@pixi/display';
import { preloadAssets } from '../utils/helpers';
import { Sprite } from '@pixi/sprite';

const assets = {
bg: 'bg.png'
Expand Down
4 changes: 2 additions & 2 deletions src/stories/fit/FitAndPosition.stories.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Container } from '@pixi/display';
import { Sprite } from '@pixi/sprite';
import { Layout } from '../../Layout';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { Container } from '@pixi/display';
import { preloadAssets } from '../utils/helpers';
import { Sprite } from '@pixi/sprite';

const assets = {
bg: 'verticalBG.png',
Expand Down
6 changes: 3 additions & 3 deletions src/stories/styles/ConditionalAppLayout.stories.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Layout } from '../../Layout';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { Container } from '@pixi/display';
import { VERTICAL_ALIGN, ALIGN, POSITION, CSS_COLOR_NAMES } from '../../utils/constants';
import { Layout } from '../../Layout';
import { ALIGN, CSS_COLOR_NAMES, POSITION, VERTICAL_ALIGN } from '../../utils/constants';
import { LayoutStyles } from '../../utils/types';
import { argTypes, getDefaultArgs } from '../utils/argTypes';

const args = {
color: '#000000',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Layout } from '../../Layout';
import { argTypes, getDefaultArgs } from '../utils/argTypes';
import { Container } from '@pixi/display';
import { Layout } from '../../Layout';
import { toolTip } from '../components/ToolTip';
import { argTypes, getDefaultArgs } from '../utils/argTypes';

const args = {
portraitColor: 'white',
Expand Down
6 changes: 3 additions & 3 deletions src/utils/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { CSS_COLOR_NAMES } from './constants';
import { Color, CSSColor, FlexColor, FlexNumber, Styles } from './types';
import { utils } from '@pixi/core';
import { TextStyle, Text } from '@pixi/text';
import { Text, TextStyle } from '@pixi/text';
import { LayoutSystem } from '../Layout';
import { CSS_COLOR_NAMES } from './constants';
import { Color, CSSColor, FlexColor, FlexNumber, Styles } from './types';

export function rgba2Hex([r, g, b]: number[]): number
{
Expand Down
7 changes: 4 additions & 3 deletions src/utils/types.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { BACKGROUND_SIZE, CSS_COLOR_NAMES, DISPLAY, OVERFLOW, POSITION, VERTICAL_ALIGN } from './constants';

import type { Container } from '@pixi/display';
import type { NineSlicePlane } from '@pixi/mesh-extras';
import type { TilingSprite } from '@pixi/sprite-tiling';
import type { TextStyle, TextStyleAlign } from '@pixi/text';
import type { Container } from '@pixi/display';
import { CSS_COLOR_NAMES, POSITION, DISPLAY, OVERFLOW, VERTICAL_ALIGN, BACKGROUND_SIZE } from './constants';
import type { Layout } from '../Layout';
import type { NineSlicePlane } from '@pixi/mesh-extras';

export type GradeToOne = 0 | 0.1 | 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9 | 1;

Expand Down

0 comments on commit 18f4d7a

Please sign in to comment.