mirror of
https://github.com/zadam/trilium.git
synced 2025-12-12 18:34:24 +01:00
chore(ribbon): hide basic properties from the ribbon on new layout
This commit is contained in:
parent
db42bb603b
commit
58bc5dc66a
@ -1,41 +1,39 @@
|
||||
import { NoteType, ToggleInParentResponse } from "@triliumnext/commons";
|
||||
import { ComponentChildren } from "preact";
|
||||
import { createPortal } from "preact/compat";
|
||||
import { Dispatch, StateUpdater, useCallback, useEffect, useMemo, useState } from "preact/hooks";
|
||||
import Dropdown from "../react/Dropdown";
|
||||
import { NOTE_TYPES } from "../../services/note_types";
|
||||
import { FormDropdownDivider, FormListBadge, FormListItem } from "../react/FormList";
|
||||
import { getAvailableLocales, t } from "../../services/i18n";
|
||||
import { useNoteLabel, useNoteLabelBoolean, useNoteProperty, useTriliumEvent, useTriliumOption } from "../react/hooks";
|
||||
import mime_types from "../../services/mime_types";
|
||||
import { Locale, LOCALES, NoteType, ToggleInParentResponse } from "@triliumnext/commons";
|
||||
import server from "../../services/server";
|
||||
import dialog from "../../services/dialog";
|
||||
import FormToggle from "../react/FormToggle";
|
||||
|
||||
import FNote from "../../entities/fnote";
|
||||
import protected_session from "../../services/protected_session";
|
||||
import FormDropdownList from "../react/FormDropdownList";
|
||||
import toast from "../../services/toast";
|
||||
import branches from "../../services/branches";
|
||||
import dialog from "../../services/dialog";
|
||||
import { getAvailableLocales, t } from "../../services/i18n";
|
||||
import mime_types from "../../services/mime_types";
|
||||
import { NOTE_TYPES } from "../../services/note_types";
|
||||
import protected_session from "../../services/protected_session";
|
||||
import server from "../../services/server";
|
||||
import sync from "../../services/sync";
|
||||
import toast from "../../services/toast";
|
||||
import Dropdown from "../react/Dropdown";
|
||||
import FormDropdownList from "../react/FormDropdownList";
|
||||
import { FormDropdownDivider, FormListBadge, FormListItem } from "../react/FormList";
|
||||
import FormToggle from "../react/FormToggle";
|
||||
import HelpButton from "../react/HelpButton";
|
||||
import { TabContext } from "./ribbon-interface";
|
||||
import { useNoteLabel, useNoteLabelBoolean, useNoteProperty, useTriliumEvent, useTriliumOption } from "../react/hooks";
|
||||
import Modal from "../react/Modal";
|
||||
import { CodeMimeTypesList } from "../type_widgets/options/code_notes";
|
||||
import { ContentLanguagesList } from "../type_widgets/options/i18n";
|
||||
import { LocaleSelector } from "../type_widgets/options/components/LocaleSelector";
|
||||
import { isExperimentalFeatureEnabled } from "../../services/experimental_features";
|
||||
import { createPortal } from "preact/compat";
|
||||
import { ComponentChildren } from "preact";
|
||||
|
||||
const isNewLayout = isExperimentalFeatureEnabled("new-layout");
|
||||
import { ContentLanguagesList } from "../type_widgets/options/i18n";
|
||||
import { TabContext } from "./ribbon-interface";
|
||||
|
||||
export default function BasicPropertiesTab({ note }: TabContext) {
|
||||
return (
|
||||
<div className="basic-properties-widget">
|
||||
{!isNewLayout && <NoteTypeWidget note={note} />}
|
||||
{!isNewLayout && <ProtectedNoteSwitch note={note} />}
|
||||
{!isNewLayout && <EditabilitySelect note={note} />}
|
||||
{!isNewLayout && <BookmarkSwitch note={note} />}
|
||||
{!isNewLayout && <SharedSwitch note={note} />}
|
||||
{!isNewLayout && <TemplateSwitch note={note} />}
|
||||
<NoteTypeWidget note={note} />
|
||||
<ProtectedNoteSwitch note={note} />
|
||||
<EditabilitySelect note={note} />
|
||||
<BookmarkSwitch note={note} />
|
||||
<SharedSwitch note={note} />
|
||||
<TemplateSwitch note={note} />
|
||||
<NoteLanguageSwitch note={note} />
|
||||
</div>
|
||||
);
|
||||
|
||||
@ -1,22 +1,24 @@
|
||||
import ScriptTab from "./ScriptTab";
|
||||
import EditedNotesTab from "./EditedNotesTab";
|
||||
import NotePropertiesTab from "./NotePropertiesTab";
|
||||
import NoteInfoTab from "./NoteInfoTab";
|
||||
import SimilarNotesTab from "./SimilarNotesTab";
|
||||
import FilePropertiesTab from "./FilePropertiesTab";
|
||||
import ImagePropertiesTab from "./ImagePropertiesTab";
|
||||
import NotePathsTab from "./NotePathsTab";
|
||||
import NoteMapTab from "./NoteMapTab";
|
||||
import OwnedAttributesTab from "./OwnedAttributesTab";
|
||||
import InheritedAttributesTab from "./InheritedAttributesTab";
|
||||
import CollectionPropertiesTab from "./CollectionPropertiesTab";
|
||||
import SearchDefinitionTab from "./SearchDefinitionTab";
|
||||
import BasicPropertiesTab from "./BasicPropertiesTab";
|
||||
import FormattingToolbar from "./FormattingToolbar";
|
||||
import options from "../../services/options";
|
||||
import { t } from "../../services/i18n";
|
||||
import { TabConfiguration } from "./ribbon-interface";
|
||||
import { isExperimentalFeatureEnabled } from "../../services/experimental_features";
|
||||
import { t } from "../../services/i18n";
|
||||
import options from "../../services/options";
|
||||
import BasicPropertiesTab from "./BasicPropertiesTab";
|
||||
import CollectionPropertiesTab from "./CollectionPropertiesTab";
|
||||
import EditedNotesTab from "./EditedNotesTab";
|
||||
import FilePropertiesTab from "./FilePropertiesTab";
|
||||
import FormattingToolbar from "./FormattingToolbar";
|
||||
import ImagePropertiesTab from "./ImagePropertiesTab";
|
||||
import InheritedAttributesTab from "./InheritedAttributesTab";
|
||||
import NoteInfoTab from "./NoteInfoTab";
|
||||
import NoteMapTab from "./NoteMapTab";
|
||||
import NotePathsTab from "./NotePathsTab";
|
||||
import NotePropertiesTab from "./NotePropertiesTab";
|
||||
import OwnedAttributesTab from "./OwnedAttributesTab";
|
||||
import { TabConfiguration } from "./ribbon-interface";
|
||||
import ScriptTab from "./ScriptTab";
|
||||
import SearchDefinitionTab from "./SearchDefinitionTab";
|
||||
import SimilarNotesTab from "./SimilarNotesTab";
|
||||
|
||||
const isNewLayout = isExperimentalFeatureEnabled("new-layout");
|
||||
|
||||
export const RIBBON_TAB_DEFINITIONS: TabConfiguration[] = [
|
||||
{
|
||||
@ -28,7 +30,7 @@ export const RIBBON_TAB_DEFINITIONS: TabConfiguration[] = [
|
||||
toggleCommand: "toggleRibbonTabClassicEditor",
|
||||
content: FormattingToolbar,
|
||||
activate: ({ note }) => !options.is("editedNotesOpenInRibbon") || !note?.hasOwnedLabel("dateNote"),
|
||||
stayInDom: !isExperimentalFeatureEnabled("new-layout"),
|
||||
stayInDom: !isNewLayout,
|
||||
avoidInNewLayout: true
|
||||
},
|
||||
{
|
||||
@ -85,11 +87,10 @@ export const RIBBON_TAB_DEFINITIONS: TabConfiguration[] = [
|
||||
activate: true,
|
||||
},
|
||||
{
|
||||
// BasicProperties
|
||||
title: t("basic_properties.basic_properties"),
|
||||
icon: "bx bx-slider",
|
||||
content: BasicPropertiesTab,
|
||||
show: ({note}) => !note?.isLaunchBarConfig(),
|
||||
show: ({note}) => !isNewLayout && !note?.isLaunchBarConfig(),
|
||||
toggleCommand: "toggleRibbonTabBasicProperties"
|
||||
},
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user