You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
9 months ago
|
/**
|
||
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
||
|
*
|
||
|
* This source code is licensed under the MIT license found in the
|
||
|
* LICENSE file in the root directory of this source tree.
|
||
|
*
|
||
|
*/
|
||
|
|
||
|
const hostName = window.location.hostname;
|
||
|
export const isDevPlayground: boolean =
|
||
|
hostName !== 'playground.lexical.dev' &&
|
||
|
hostName !== 'lexical-playground.vercel.app';
|
||
|
|
||
|
export const DEFAULT_SETTINGS = {
|
||
|
disableBeforeInput: false,
|
||
|
emptyEditor: isDevPlayground,
|
||
|
isAutocomplete: false,
|
||
|
isCharLimit: false,
|
||
|
isCharLimitUtf8: false,
|
||
|
isCollab: false,
|
||
|
isMaxLength: false,
|
||
|
isRichText: true,
|
||
|
measureTypingPerf: false,
|
||
|
shouldPreserveNewLinesInMarkdown: false,
|
||
|
shouldUseLexicalContextMenu: false,
|
||
|
showNestedEditorTreeView: false,
|
||
|
showTableOfContents: false,
|
||
|
showTreeView: true,
|
||
|
tableCellBackgroundColor: true,
|
||
|
tableCellMerge: true,
|
||
|
} as const;
|
||
|
|
||
|
// These are mutated in setupEnv
|
||
|
export const INITIAL_SETTINGS: Record<SettingName, boolean> = {
|
||
|
...DEFAULT_SETTINGS,
|
||
|
};
|
||
|
|
||
|
export type SettingName = keyof typeof DEFAULT_SETTINGS;
|
||
|
|
||
|
export type Settings = typeof INITIAL_SETTINGS;
|