Skip to content

Commit

Permalink
refactor(playground): clean up settings (#5225)
Browse files Browse the repository at this point in the history
  • Loading branch information
agriffis committed Nov 14, 2023
1 parent ae7c783 commit 3a1a18b
Showing 1 changed file with 5 additions and 20 deletions.
25 changes: 5 additions & 20 deletions packages/lexical-playground/src/appSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,31 +6,12 @@
*
*/

export type SettingName =
| 'disableBeforeInput'
| 'measureTypingPerf'
| 'isRichText'
| 'isCollab'
| 'isCharLimit'
| 'isMaxLength'
| 'isCharLimitUtf8'
| 'isAutocomplete'
| 'shouldUseLexicalContextMenu'
| 'showTreeView'
| 'showNestedEditorTreeView'
| 'emptyEditor'
| 'showTableOfContents'
| 'tableCellMerge'
| 'tableCellBackgroundColor';

export type Settings = Record<SettingName, boolean>;

const hostName = window.location.hostname;
export const isDevPlayground: boolean =
hostName !== 'playground.lexical.dev' &&
hostName !== 'lexical-playground.vercel.app';

export const DEFAULT_SETTINGS: Settings = {
export const DEFAULT_SETTINGS = {
disableBeforeInput: false,
emptyEditor: isDevPlayground,
isAutocomplete: false,
Expand All @@ -47,3 +28,7 @@ export const DEFAULT_SETTINGS: Settings = {
tableCellBackgroundColor: true,
tableCellMerge: true,
};

export type SettingName = keyof typeof DEFAULT_SETTINGS;

export type Settings = typeof DEFAULT_SETTINGS;

2 comments on commit 3a1a18b

@vercel
Copy link

@vercel vercel bot commented on 3a1a18b Nov 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lexical – ./packages/lexical-website

lexical-fbopensource.vercel.app
lexical.dev
www.lexical.dev
lexicaljs.com
lexical-git-main-fbopensource.vercel.app
lexicaljs.org

@vercel
Copy link

@vercel vercel bot commented on 3a1a18b Nov 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

lexical-playground – ./packages/lexical-playground

lexical-playground-fbopensource.vercel.app
lexical-playground-git-main-fbopensource.vercel.app
playground.lexical.dev
lexical-playground.vercel.app

Please sign in to comment.