diff --git a/src/types/app.ts b/src/types/app.ts index ea8334b2..10f88dbd 100644 --- a/src/types/app.ts +++ b/src/types/app.ts @@ -1,5 +1,3 @@ -import { HighlightStatus } from './management' - export interface Feature { name: string description: string @@ -41,6 +39,21 @@ export type PlanStatus = 'UNPAID' | 'PAID' | 'NOT_SUPPORTED' export type TrialStatus = 'UNUSED' | 'PENDING' | 'EXPIRED' +export type FetchStatus = + | 'UNLOADED' + | 'LOADING' + | 'LOADED' + | 'ERROR' + | 'EMPTY' + | 'COMPLETE' + | 'SIGN_IN_FIRST' + | 'NO_RESULT' + +export type HighlightStatus = + | 'NO_HIGHLIGHT' + | 'DISPLAY_HIGHLIGHT_NOTIFICATION' + | 'DISPLAY_HIGHLIGHT_DIALOG' + export type Language = 'en-US' export interface windowSize { @@ -52,3 +65,48 @@ export interface HighlightDigest { version: string status: HighlightStatus } + +export interface SelectedColor { + id: string | undefined + position: number +} + +export interface HoveredColor extends SelectedColor { + hasGuideAbove: boolean + hasGuideBelow: boolean +} + +export type PriorityContext = + | 'EMPTY' + | 'FEEDBACK' + | 'TRIAL_FEEDBACK' + | 'HIGHLIGHT' + | 'WELCOME_TO_PRO' + | 'WELCOME_TO_TRIAL' + | 'TRY' + | 'ABOUT' + | 'PUBLICATION' + | 'REPORT' + +export type ThirdParty = 'COOLORS' | 'REALTIME_COLORS' | 'COLOUR_LOVERS' + +export type Easing = 'LINEAR' | 'EASE_IN' | 'EASE_OUT' | 'EASE_IN_OUT' + +export interface ImportUrl { + value: string + state: 'DEFAULT' | 'ERROR' | undefined + canBeSubmitted: boolean + helper: + | { + type: 'INFO' | 'ERROR' + message: string + } + | undefined +} + +export interface ContextItem { + label: string + id: Context + isUpdated: boolean + isActive: boolean +} diff --git a/src/types/configurations.ts b/src/types/configurations.ts index f83958e5..6eb1a9d1 100644 --- a/src/types/configurations.ts +++ b/src/types/configurations.ts @@ -1,6 +1,6 @@ import { HexModel } from '@a_ng_d/figmug-ui' -import { ThirdParty } from './management' +import { ThirdParty } from './app' import { RgbModel, TextColorsThemeHexModel } from './models' export interface SourceColorConfiguration { diff --git a/src/types/content.ts b/src/types/content.ts deleted file mode 100644 index 2633293c..00000000 --- a/src/types/content.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface ReleaseNote { - version: string - isMostRecent: boolean - title: Array - image: Array - content: Array - numberOfNotes: number - learnMore: Array<`https://${string}`> -} diff --git a/src/types/events.ts b/src/types/events.ts index 972c9187..a0579cf5 100644 --- a/src/types/events.ts +++ b/src/types/events.ts @@ -1,9 +1,8 @@ -import { EditorType } from './app' +import { Easing, EditorType } from './app' import { ColorSpaceConfiguration, NamingConventionConfiguration, } from './configurations' -import { Easing } from './management' export interface EditorEvent { editor: EditorType diff --git a/src/types/management.ts b/src/types/management.ts deleted file mode 100644 index a3165b8a..00000000 --- a/src/types/management.ts +++ /dev/null @@ -1,61 +0,0 @@ -import { Context } from './app' - -export interface SelectedColor { - id: string | undefined - position: number -} - -export interface HoveredColor extends SelectedColor { - hasGuideAbove: boolean - hasGuideBelow: boolean -} - -export type PriorityContext = - | 'EMPTY' - | 'FEEDBACK' - | 'TRIAL_FEEDBACK' - | 'HIGHLIGHT' - | 'WELCOME_TO_PRO' - | 'WELCOME_TO_TRIAL' - | 'TRY' - | 'ABOUT' - | 'PUBLICATION' - | 'REPORT' - -export type ThirdParty = 'COOLORS' | 'REALTIME_COLORS' | 'COLOUR_LOVERS' - -export type Easing = 'LINEAR' | 'EASE_IN' | 'EASE_OUT' | 'EASE_IN_OUT' - -export interface ImportUrl { - value: string - state: 'DEFAULT' | 'ERROR' | undefined - canBeSubmitted: boolean - helper: - | { - type: 'INFO' | 'ERROR' - message: string - } - | undefined -} - -export interface ContextItem { - label: string - id: Context - isUpdated: boolean - isActive: boolean -} - -export type FetchStatus = - | 'UNLOADED' - | 'LOADING' - | 'LOADED' - | 'ERROR' - | 'EMPTY' - | 'COMPLETE' - | 'SIGN_IN_FIRST' - | 'NO_RESULT' - -export type HighlightStatus = - | 'NO_HIGHLIGHT' - | 'DISPLAY_HIGHLIGHT_NOTIFICATION' - | 'DISPLAY_HIGHLIGHT_DIALOG' diff --git a/src/ui/App.tsx b/src/ui/App.tsx index c23de048..5d609d8e 100644 --- a/src/ui/App.tsx +++ b/src/ui/App.tsx @@ -13,6 +13,7 @@ import { HighlightDigest, Language, PlanStatus, + PriorityContext, Service, TrialStatus, } from '../types/app' @@ -33,7 +34,6 @@ import { ViewConfiguration, VisionSimulationModeConfiguration, } from '../types/configurations' -import { PriorityContext } from '../types/management' import { ActionsList, TextColorsThemeHexModel } from '../types/models' import { UserSession } from '../types/user' import features, { diff --git a/src/ui/components/Slider.tsx b/src/ui/components/Slider.tsx index 8a196220..acc255db 100644 --- a/src/ui/components/Slider.tsx +++ b/src/ui/components/Slider.tsx @@ -1,8 +1,8 @@ import { doMap } from '@a-ng-d/figmug.modules.do-map' import React from 'react' +import { Easing } from '../../types/app' import { ScaleConfiguration } from '../../types/configurations' -import { Easing } from '../../types/management' import doLightnessScale from '../../utils/doLightnessScale' import { palette } from '../../utils/palettePackage' import addStop from './../handlers/addStop' diff --git a/src/ui/contexts/Colors.tsx b/src/ui/contexts/Colors.tsx index 572fa039..465a72ad 100644 --- a/src/ui/contexts/Colors.tsx +++ b/src/ui/contexts/Colors.tsx @@ -10,9 +10,14 @@ import React from 'react' import { uid } from 'uid' import { locals } from '../../content/locals' -import { EditorType, Language, PlanStatus } from '../../types/app' +import { + EditorType, + HoveredColor, + Language, + PlanStatus, + SelectedColor, +} from '../../types/app' import { ColorConfiguration } from '../../types/configurations' -import { HoveredColor, SelectedColor } from '../../types/management' import { ColorsMessage } from '../../types/messages' import { ActionsList, DispatchProcess } from '../../types/models' import { Identity } from '../../types/user' diff --git a/src/ui/contexts/CommunityPalettes.tsx b/src/ui/contexts/CommunityPalettes.tsx index 24989a83..db7a0368 100644 --- a/src/ui/contexts/CommunityPalettes.tsx +++ b/src/ui/contexts/CommunityPalettes.tsx @@ -10,7 +10,7 @@ import React from 'react' import { supabase } from '../../bridges/publication/authentication' import { locals } from '../../content/locals' -import { Context, Language, PlanStatus } from '../../types/app' +import { Context, FetchStatus, Language, PlanStatus } from '../../types/app' import { ColorConfiguration, MetaConfiguration, @@ -19,7 +19,6 @@ import { ThemeConfiguration, } from '../../types/configurations' import { ExternalPalettes } from '../../types/data' -import { FetchStatus } from '../../types/management' import { ActionsList } from '../../types/models' import { UserSession } from '../../types/user' import { pageSize, palettesDbTableName } from '../../utils/config' @@ -412,16 +411,11 @@ export default class CommunityPalettes extends React.Component< ) }} onCleared={(e) => { - this.props.onChangeSearchQuery( - e - ) + this.props.onChangeSearchQuery(e) this.props.onChangeStatus('LOADING') this.props.onChangeCurrentPage(1) this.props.onLoadPalettesList([]) - this.callUICPAgent( - 1, - e - ) + this.callUICPAgent(1, e) }} /> } diff --git a/src/ui/contexts/Explore.tsx b/src/ui/contexts/Explore.tsx index 35370526..5a00d2b7 100644 --- a/src/ui/contexts/Explore.tsx +++ b/src/ui/contexts/Explore.tsx @@ -15,10 +15,14 @@ import React from 'react' import { uid } from 'uid' import { locals } from '../../content/locals' -import { FilterOptions, Language } from '../../types/app' +import { + FetchStatus, + FilterOptions, + Language, + ThirdParty, +} from '../../types/app' import { SourceColorConfiguration } from '../../types/configurations' import { ColourLovers } from '../../types/data' -import { FetchStatus, ThirdParty } from '../../types/management' import { pageSize } from '../../utils/config' import { trackImportEvent } from '../../utils/eventsTracker' import PaletteItem from '../components/PaletteItem' diff --git a/src/ui/contexts/MyPalettes.tsx b/src/ui/contexts/MyPalettes.tsx index de02b937..c120085e 100644 --- a/src/ui/contexts/MyPalettes.tsx +++ b/src/ui/contexts/MyPalettes.tsx @@ -13,7 +13,7 @@ import { signIn, supabase } from '../../bridges/publication/authentication' import sharePalette from '../../bridges/publication/sharePalette' import unpublishPalette from '../../bridges/publication/unpublishPalette' import { locals } from '../../content/locals' -import { Context, Language, PlanStatus } from '../../types/app' +import { Context, FetchStatus, Language, PlanStatus } from '../../types/app' import { ColorConfiguration, MetaConfiguration, @@ -22,7 +22,6 @@ import { ThemeConfiguration, } from '../../types/configurations' import { ExternalPalettes } from '../../types/data' -import { FetchStatus } from '../../types/management' import { ActionsList } from '../../types/models' import { UserSession } from '../../types/user' import { pageSize, palettesDbTableName } from '../../utils/config' @@ -643,16 +642,11 @@ export default class MyPalettes extends React.Component< ) }} onCleared={(e) => { - this.props.onChangeSearchQuery( - e - ) + this.props.onChangeSearchQuery(e) this.props.onChangeStatus('LOADING') this.props.onChangeCurrentPage(1) this.props.onLoadPalettesList([]) - this.callUICPAgent( - 1, - e - ) + this.callUICPAgent(1, e) }} /> } diff --git a/src/ui/contexts/Overview.tsx b/src/ui/contexts/Overview.tsx index b1fbc404..2f6a0c9e 100644 --- a/src/ui/contexts/Overview.tsx +++ b/src/ui/contexts/Overview.tsx @@ -12,9 +12,8 @@ import React from 'react' import { uid } from 'uid' import { locals } from '../../content/locals' -import { Language, PlanStatus } from '../../types/app' +import { ImportUrl, Language, PlanStatus, ThirdParty } from '../../types/app' import { SourceColorConfiguration } from '../../types/configurations' -import { ImportUrl, ThirdParty } from '../../types/management' import features from '../../utils/config' import { trackImportEvent } from '../../utils/eventsTracker' import isBlocked from '../../utils/isBlocked' diff --git a/src/ui/contexts/Palettes.tsx b/src/ui/contexts/Palettes.tsx index c731ede3..3ad8dc3c 100644 --- a/src/ui/contexts/Palettes.tsx +++ b/src/ui/contexts/Palettes.tsx @@ -1,9 +1,8 @@ import { Bar, ConsentConfiguration, HexModel, Tabs } from '@a_ng_d/figmug-ui' import React from 'react' -import { Language, PlanStatus } from '../../types/app' +import { ContextItem, FetchStatus, Language, PlanStatus } from '../../types/app' import { ExternalPalettes } from '../../types/data' -import { ContextItem, FetchStatus } from '../../types/management' import { UserSession } from '../../types/user' import { setContexts } from '../../utils/setContexts' import CommunityPalettes from './CommunityPalettes' diff --git a/src/ui/contexts/Scale.tsx b/src/ui/contexts/Scale.tsx index 6cdd689b..c3a3afd4 100644 --- a/src/ui/contexts/Scale.tsx +++ b/src/ui/contexts/Scale.tsx @@ -12,14 +12,13 @@ import { import React from 'react' import { locals } from '../../content/locals' -import { EditorType, Language, PlanStatus } from '../../types/app' +import { Easing, EditorType, Language, PlanStatus } from '../../types/app' import { NamingConventionConfiguration, PresetConfiguration, ScaleConfiguration, SourceColorConfiguration, } from '../../types/configurations' -import { Easing } from '../../types/management' import { ScaleMessage } from '../../types/messages' import { ActionsList, DispatchProcess } from '../../types/models' import { Identity } from '../../types/user' diff --git a/src/ui/contexts/Source.tsx b/src/ui/contexts/Source.tsx index 3b59eacf..938ad86c 100644 --- a/src/ui/contexts/Source.tsx +++ b/src/ui/contexts/Source.tsx @@ -2,14 +2,15 @@ import { Bar, ConsentConfiguration, Tabs } from '@a_ng_d/figmug-ui' import React from 'react' import { + ContextItem, EditorType, FilterOptions, Language, PlanStatus, + ThirdParty, } from '../../types/app' import { SourceColorConfiguration } from '../../types/configurations' import { ColourLovers } from '../../types/data' -import { ContextItem, ThirdParty } from '../../types/management' import features from '../../utils/config' import { setContexts } from '../../utils/setContexts' import Feature from '../components/Feature' diff --git a/src/ui/contexts/Themes.tsx b/src/ui/contexts/Themes.tsx index 188c9493..a328bab7 100644 --- a/src/ui/contexts/Themes.tsx +++ b/src/ui/contexts/Themes.tsx @@ -9,13 +9,18 @@ import React from 'react' import { uid } from 'uid' import { locals } from '../../content/locals' -import { EditorType, Language, PlanStatus } from '../../types/app' +import { + EditorType, + HoveredColor, + Language, + PlanStatus, + SelectedColor, +} from '../../types/app' import { PresetConfiguration, ScaleConfiguration, ThemeConfiguration, } from '../../types/configurations' -import { HoveredColor, SelectedColor } from '../../types/management' import { ThemesMessage } from '../../types/messages' import { ActionsList, DispatchProcess } from '../../types/models' import { Identity } from '../../types/user' diff --git a/src/ui/modules/PriorityContainer.tsx b/src/ui/modules/PriorityContainer.tsx index 1a1ceff5..73feef32 100644 --- a/src/ui/modules/PriorityContainer.tsx +++ b/src/ui/modules/PriorityContainer.tsx @@ -1,22 +1,26 @@ -import * as Sentry from '@sentry/browser'; -import { ConsentConfiguration, Dialog, FormItem, Input, texts } from '@a_ng_d/figmug-ui'; -import React from 'react'; - - +import * as Sentry from '@sentry/browser' +import { + ConsentConfiguration, + Dialog, + FormItem, + Input, + texts, +} from '@a_ng_d/figmug-ui' +import React from 'react' -import { signIn } from '../../bridges/publication/authentication'; -import cp from '../../content/images/choose_plan.webp'; -import pp from '../../content/images/pro_plan.webp'; -import p from '../../content/images/publication.webp'; -import t from '../../content/images/trial.webp'; -import { locals } from '../../content/locals'; +import { signIn } from '../../bridges/publication/authentication' +import cp from '../../content/images/choose_plan.webp' +import pp from '../../content/images/pro_plan.webp' +import p from '../../content/images/publication.webp' +import t from '../../content/images/trial.webp' +import { locals } from '../../content/locals' import { HighlightDigest, Language, PlanStatus, + PriorityContext, TrialStatus, } from '../../types/app' -import { PriorityContext } from '../../types/management' import { UserSession } from '../../types/user' import features from '../../utils/config' import { trackSignInEvent } from '../../utils/eventsTracker' @@ -504,4 +508,4 @@ export default class PriorityContainer extends React.Component< ) } -} \ No newline at end of file +} diff --git a/src/ui/services/CreatePalette.tsx b/src/ui/services/CreatePalette.tsx index 47fb1125..f7b3d2f2 100644 --- a/src/ui/services/CreatePalette.tsx +++ b/src/ui/services/CreatePalette.tsx @@ -3,7 +3,7 @@ import chroma from 'chroma-js' import React from 'react' import { uid } from 'uid' -import { Language, PlanStatus } from '../../types/app' +import { ContextItem, Language, PlanStatus, ThirdParty } from '../../types/app' import { ColorSpaceConfiguration, NamingConventionConfiguration, @@ -13,7 +13,6 @@ import { ViewConfiguration, VisionSimulationModeConfiguration, } from '../../types/configurations' -import { ContextItem, ThirdParty } from '../../types/management' import { TextColorsThemeHexModel } from '../../types/models' import { UserSession } from '../../types/user' import doLightnessScale from '../../utils/doLightnessScale' diff --git a/src/ui/services/EditPalette.tsx b/src/ui/services/EditPalette.tsx index b5310f96..37fc9695 100644 --- a/src/ui/services/EditPalette.tsx +++ b/src/ui/services/EditPalette.tsx @@ -6,7 +6,7 @@ import JSZip from 'jszip' import React from 'react' import { locals } from '../../content/locals' -import { EditorType, Language, PlanStatus } from '../../types/app' +import { ContextItem, EditorType, Language, PlanStatus } from '../../types/app' import { AlgorithmVersionConfiguration, ColorConfiguration, @@ -18,7 +18,6 @@ import { ViewConfiguration, VisionSimulationModeConfiguration, } from '../../types/configurations' -import { ContextItem } from '../../types/management' import { ThemesMessage } from '../../types/messages' import { TextColorsThemeHexModel } from '../../types/models' import { Identity } from '../../types/user' diff --git a/src/utils/config.ts b/src/utils/config.ts index 145a941f..a7fb4d40 100644 --- a/src/utils/config.ts +++ b/src/utils/config.ts @@ -2,7 +2,6 @@ import { Feature } from '../types/app' export const trialTime = 72 export const oldTrialTime = 48 -export const releaseNotesVersion = '4.0.0' export const pageSize = 20 export const authWorkerUrl = diff --git a/src/utils/doLightnessScale.ts b/src/utils/doLightnessScale.ts index fea59fd7..93be1b8f 100644 --- a/src/utils/doLightnessScale.ts +++ b/src/utils/doLightnessScale.ts @@ -1,7 +1,7 @@ import { doMap } from '@a-ng-d/figmug.modules.do-map' +import { Easing } from '../types/app' import { ScaleConfiguration } from '../types/configurations' -import { Easing } from '../types/management' const doLightnessScale = ( stops: Array,