mirror of
https://github.com/zadam/trilium.git
synced 2025-12-06 07:24:25 +01:00
Compare commits
14 Commits
441a1a5921
...
d6b21d48fe
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d6b21d48fe | ||
|
|
32c16021c4 | ||
|
|
7713c1173a | ||
|
|
8018f400c3 | ||
|
|
79c8293881 | ||
|
|
db5652623b | ||
|
|
0f7a48b323 | ||
|
|
415d2826c6 | ||
|
|
7787e7085e | ||
|
|
4ab8417168 | ||
|
|
a81e8adde7 | ||
|
|
5aec9229d4 | ||
|
|
0c954322e4 | ||
|
|
9580d636cf |
@ -30,6 +30,7 @@ import ScrollingContainer from "../widgets/containers/scrolling_container.js";
|
|||||||
import ScrollPadding from "../widgets/scroll_padding.js";
|
import ScrollPadding from "../widgets/scroll_padding.js";
|
||||||
import SearchResult from "../widgets/search_result.jsx";
|
import SearchResult from "../widgets/search_result.jsx";
|
||||||
import SharedInfo from "../widgets/shared_info.jsx";
|
import SharedInfo from "../widgets/shared_info.jsx";
|
||||||
|
import OriginInfo from "../widgets/note_origin.jsx";
|
||||||
import SpacerWidget from "../widgets/spacer.js";
|
import SpacerWidget from "../widgets/spacer.js";
|
||||||
import SplitNoteContainer from "../widgets/containers/split_note_container.js";
|
import SplitNoteContainer from "../widgets/containers/split_note_container.js";
|
||||||
import SqlResults from "../widgets/sql_result.js";
|
import SqlResults from "../widgets/sql_result.js";
|
||||||
@ -139,6 +140,7 @@ export default class DesktopLayout {
|
|||||||
.filling()
|
.filling()
|
||||||
.child(new ContentHeader()
|
.child(new ContentHeader()
|
||||||
.child(<ReadOnlyNoteInfoBar />)
|
.child(<ReadOnlyNoteInfoBar />)
|
||||||
|
.child(<OriginInfo />)
|
||||||
.child(<SharedInfo />)
|
.child(<SharedInfo />)
|
||||||
)
|
)
|
||||||
.child(<PromotedAttributes />)
|
.child(<PromotedAttributes />)
|
||||||
|
|||||||
@ -27,6 +27,9 @@
|
|||||||
--bs-body-bg: var(--main-background-color) !important;
|
--bs-body-bg: var(--main-background-color) !important;
|
||||||
--ck-mention-list-max-height: 500px;
|
--ck-mention-list-max-height: 500px;
|
||||||
--tn-modal-max-height: 90vh;
|
--tn-modal-max-height: 90vh;
|
||||||
|
|
||||||
|
--tree-item-light-theme-max-color-lightness: 50;
|
||||||
|
--tree-item-dark-theme-min-color-lightness: 75;
|
||||||
}
|
}
|
||||||
|
|
||||||
body#trilium-app.motion-disabled *,
|
body#trilium-app.motion-disabled *,
|
||||||
@ -2579,4 +2582,12 @@ iframe.print-iframe {
|
|||||||
position: relative;
|
position: relative;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Calendar collection */
|
||||||
|
|
||||||
|
.calendar-view a.fc-timegrid-event,
|
||||||
|
.calendar-view a.fc-daygrid-event {
|
||||||
|
/* Workaround: set font weight only if the theme-next is not active */
|
||||||
|
font-weight: var(--root-background, 800);
|
||||||
}
|
}
|
||||||
@ -76,6 +76,9 @@
|
|||||||
|
|
||||||
--mermaid-theme: dark;
|
--mermaid-theme: dark;
|
||||||
--native-titlebar-background: #00000000;
|
--native-titlebar-background: #00000000;
|
||||||
|
|
||||||
|
--calendar-coll-event-background-saturation: 30%;
|
||||||
|
--calendar-coll-event-background-lightness: 30%;
|
||||||
}
|
}
|
||||||
|
|
||||||
body ::-webkit-calendar-picker-indicator {
|
body ::-webkit-calendar-picker-indicator {
|
||||||
|
|||||||
@ -80,6 +80,9 @@ html {
|
|||||||
|
|
||||||
--mermaid-theme: default;
|
--mermaid-theme: default;
|
||||||
--native-titlebar-background: #ffffff00;
|
--native-titlebar-background: #ffffff00;
|
||||||
|
|
||||||
|
--calendar-coll-event-background-lightness: 95%;
|
||||||
|
--calendar-coll-event-background-saturation: 80%;
|
||||||
}
|
}
|
||||||
|
|
||||||
#left-pane .fancytree-node.tinted {
|
#left-pane .fancytree-node.tinted {
|
||||||
|
|||||||
@ -271,11 +271,12 @@
|
|||||||
--ck-editor-toolbar-button-on-shadow: 1px 1px 2px rgba(0, 0, 0, .75);
|
--ck-editor-toolbar-button-on-shadow: 1px 1px 2px rgba(0, 0, 0, .75);
|
||||||
--ck-editor-toolbar-dropdown-button-open-background: #ffffff14;
|
--ck-editor-toolbar-dropdown-button-open-background: #ffffff14;
|
||||||
|
|
||||||
--calendar-coll-event-background-saturation: 12%;
|
--calendar-coll-event-background-saturation: 25%;
|
||||||
--calendar-coll-event-background-lightness: 21%;
|
--calendar-coll-event-background-lightness: 20%;
|
||||||
--calendar-coll-event-background-color: #3c3c3c;
|
--calendar-coll-event-background-color: #3c3c3c;
|
||||||
--calendar-coll-event-text-color: white;
|
--calendar-coll-event-text-color: white;
|
||||||
--calendar-cell-event-hover-filter: brightness(1.25);
|
--calendar-cell-event-hover-filter: brightness(1.25);
|
||||||
|
--calendar-coll-today-background-color: #ffffff08;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -274,6 +274,7 @@
|
|||||||
--calendar-coll-event-background-color: #eaeaea;
|
--calendar-coll-event-background-color: #eaeaea;
|
||||||
--calendar-coll-event-text-color: black;
|
--calendar-coll-event-text-color: black;
|
||||||
--calendar-cell-event-hover-filter: brightness(.95) saturate(1.25);
|
--calendar-cell-event-hover-filter: brightness(.95) saturate(1.25);
|
||||||
|
--calendar-coll-today-background-color: #00000006;
|
||||||
}
|
}
|
||||||
|
|
||||||
#left-pane .fancytree-node.tinted {
|
#left-pane .fancytree-node.tinted {
|
||||||
|
|||||||
@ -511,7 +511,7 @@
|
|||||||
"title": "الملاحظات المعدلة"
|
"title": "الملاحظات المعدلة"
|
||||||
},
|
},
|
||||||
"note_properties": {
|
"note_properties": {
|
||||||
"info": "معلومات"
|
"this_note_was_originally_taken_from": ""
|
||||||
},
|
},
|
||||||
"backend_log": {
|
"backend_log": {
|
||||||
"refresh": "تحديث"
|
"refresh": "تحديث"
|
||||||
|
|||||||
@ -840,8 +840,7 @@
|
|||||||
"search": "搜索"
|
"search": "搜索"
|
||||||
},
|
},
|
||||||
"note_properties": {
|
"note_properties": {
|
||||||
"this_note_was_originally_taken_from": "笔记来源:",
|
"this_note_was_originally_taken_from": "笔记来源:"
|
||||||
"info": "信息"
|
|
||||||
},
|
},
|
||||||
"owned_attribute_list": {
|
"owned_attribute_list": {
|
||||||
"owned_attributes": "拥有的属性"
|
"owned_attributes": "拥有的属性"
|
||||||
|
|||||||
@ -837,8 +837,7 @@
|
|||||||
"search": "Suchen"
|
"search": "Suchen"
|
||||||
},
|
},
|
||||||
"note_properties": {
|
"note_properties": {
|
||||||
"this_note_was_originally_taken_from": "Diese Notiz stammt ursprünglich aus:",
|
"this_note_was_originally_taken_from": "Diese Notiz stammt ursprünglich aus:"
|
||||||
"info": "Info"
|
|
||||||
},
|
},
|
||||||
"owned_attribute_list": {
|
"owned_attribute_list": {
|
||||||
"owned_attributes": "Eigene Attribute"
|
"owned_attributes": "Eigene Attribute"
|
||||||
|
|||||||
@ -841,8 +841,7 @@
|
|||||||
"search": "Search"
|
"search": "Search"
|
||||||
},
|
},
|
||||||
"note_properties": {
|
"note_properties": {
|
||||||
"this_note_was_originally_taken_from": "This note was originally taken from:",
|
"this_note_was_originally_taken_from": "This note was originally taken from:"
|
||||||
"info": "Info"
|
|
||||||
},
|
},
|
||||||
"owned_attribute_list": {
|
"owned_attribute_list": {
|
||||||
"owned_attributes": "Owned Attributes"
|
"owned_attributes": "Owned Attributes"
|
||||||
|
|||||||
@ -840,8 +840,7 @@
|
|||||||
"search": "Buscar"
|
"search": "Buscar"
|
||||||
},
|
},
|
||||||
"note_properties": {
|
"note_properties": {
|
||||||
"this_note_was_originally_taken_from": "Esta nota fue tomada originalmente de:",
|
"this_note_was_originally_taken_from": "Esta nota fue tomada originalmente de:"
|
||||||
"info": "Información"
|
|
||||||
},
|
},
|
||||||
"owned_attribute_list": {
|
"owned_attribute_list": {
|
||||||
"owned_attributes": "Atributos propios"
|
"owned_attributes": "Atributos propios"
|
||||||
|
|||||||
@ -834,8 +834,7 @@
|
|||||||
"search": "Recherche"
|
"search": "Recherche"
|
||||||
},
|
},
|
||||||
"note_properties": {
|
"note_properties": {
|
||||||
"this_note_was_originally_taken_from": "Cette note est initialement extraite de :",
|
"this_note_was_originally_taken_from": "Cette note est initialement extraite de :"
|
||||||
"info": "Infos"
|
|
||||||
},
|
},
|
||||||
"owned_attribute_list": {
|
"owned_attribute_list": {
|
||||||
"owned_attributes": "Attributs propres"
|
"owned_attributes": "Attributs propres"
|
||||||
|
|||||||
@ -1409,8 +1409,7 @@
|
|||||||
"search": "Ricerca"
|
"search": "Ricerca"
|
||||||
},
|
},
|
||||||
"note_properties": {
|
"note_properties": {
|
||||||
"this_note_was_originally_taken_from": "Questa nota è stata originariamente tratta da:",
|
"this_note_was_originally_taken_from": "Questa nota è stata originariamente tratta da:"
|
||||||
"info": "Informazioni"
|
|
||||||
},
|
},
|
||||||
"owned_attribute_list": {
|
"owned_attribute_list": {
|
||||||
"owned_attributes": "Attributi posseduti"
|
"owned_attributes": "Attributi posseduti"
|
||||||
|
|||||||
@ -693,7 +693,6 @@
|
|||||||
"outside_hoisted": "このパスはホイストされたノートの外側にあるため、ホイストを解除する必要があります。"
|
"outside_hoisted": "このパスはホイストされたノートの外側にあるため、ホイストを解除する必要があります。"
|
||||||
},
|
},
|
||||||
"note_properties": {
|
"note_properties": {
|
||||||
"info": "情報",
|
|
||||||
"this_note_was_originally_taken_from": "このノートは元々以下から引用したものです:"
|
"this_note_was_originally_taken_from": "このノートは元々以下から引用したものです:"
|
||||||
},
|
},
|
||||||
"similar_notes": {
|
"similar_notes": {
|
||||||
|
|||||||
@ -447,8 +447,7 @@
|
|||||||
"search": "Szukaj"
|
"search": "Szukaj"
|
||||||
},
|
},
|
||||||
"note_properties": {
|
"note_properties": {
|
||||||
"this_note_was_originally_taken_from": "Ta notatka oryginalnie została wzięta z:",
|
"this_note_was_originally_taken_from": "Ta notatka oryginalnie została wzięta z:"
|
||||||
"info": "Info"
|
|
||||||
},
|
},
|
||||||
"owned_attribute_list": {
|
"owned_attribute_list": {
|
||||||
"owned_attributes": "Posiadane atrybuty"
|
"owned_attributes": "Posiadane atrybuty"
|
||||||
|
|||||||
@ -809,8 +809,7 @@
|
|||||||
"search": "Pesquisar"
|
"search": "Pesquisar"
|
||||||
},
|
},
|
||||||
"note_properties": {
|
"note_properties": {
|
||||||
"this_note_was_originally_taken_from": "Esta nota foi originalmente obtida de:",
|
"this_note_was_originally_taken_from": "Esta nota foi originalmente obtida de:"
|
||||||
"info": "Informações"
|
|
||||||
},
|
},
|
||||||
"owned_attribute_list": {
|
"owned_attribute_list": {
|
||||||
"owned_attributes": "Atributos próprios"
|
"owned_attributes": "Atributos próprios"
|
||||||
|
|||||||
@ -1075,8 +1075,7 @@
|
|||||||
"outside_hoisted": "Este caminho está fora de uma nota fixada e você teria que desafixar."
|
"outside_hoisted": "Este caminho está fora de uma nota fixada e você teria que desafixar."
|
||||||
},
|
},
|
||||||
"note_properties": {
|
"note_properties": {
|
||||||
"this_note_was_originally_taken_from": "Esta nota foi originalmente obtida de:",
|
"this_note_was_originally_taken_from": "Esta nota foi originalmente obtida de:"
|
||||||
"info": "Informações"
|
|
||||||
},
|
},
|
||||||
"promoted_attributes": {
|
"promoted_attributes": {
|
||||||
"promoted_attributes": "Atributos Promovidos",
|
"promoted_attributes": "Atributos Promovidos",
|
||||||
|
|||||||
@ -910,7 +910,6 @@
|
|||||||
"title": "Căile notiței"
|
"title": "Căile notiței"
|
||||||
},
|
},
|
||||||
"note_properties": {
|
"note_properties": {
|
||||||
"info": "Informații",
|
|
||||||
"this_note_was_originally_taken_from": "Această notiță a fost preluată original de la:"
|
"this_note_was_originally_taken_from": "Această notiță a fost preluată original de la:"
|
||||||
},
|
},
|
||||||
"note_type_chooser": {
|
"note_type_chooser": {
|
||||||
|
|||||||
@ -1066,7 +1066,6 @@
|
|||||||
"archived": "Архивировано"
|
"archived": "Архивировано"
|
||||||
},
|
},
|
||||||
"note_properties": {
|
"note_properties": {
|
||||||
"info": "Информация",
|
|
||||||
"this_note_was_originally_taken_from": "Эта заметка была первоначально взята из:"
|
"this_note_was_originally_taken_from": "Эта заметка была первоначально взята из:"
|
||||||
},
|
},
|
||||||
"promoted_attributes": {
|
"promoted_attributes": {
|
||||||
|
|||||||
@ -837,8 +837,7 @@
|
|||||||
"search": "搜尋"
|
"search": "搜尋"
|
||||||
},
|
},
|
||||||
"note_properties": {
|
"note_properties": {
|
||||||
"this_note_was_originally_taken_from": "筆記來源:",
|
"this_note_was_originally_taken_from": "筆記來源:"
|
||||||
"info": "資訊"
|
|
||||||
},
|
},
|
||||||
"owned_attribute_list": {
|
"owned_attribute_list": {
|
||||||
"owned_attributes": "自有屬性"
|
"owned_attributes": "自有屬性"
|
||||||
|
|||||||
@ -938,8 +938,7 @@
|
|||||||
"outside_hoisted": "Цей шлях знаходиться поза межами закріпленої нотатки і вам доведеться відкріпити."
|
"outside_hoisted": "Цей шлях знаходиться поза межами закріпленої нотатки і вам доведеться відкріпити."
|
||||||
},
|
},
|
||||||
"note_properties": {
|
"note_properties": {
|
||||||
"this_note_was_originally_taken_from": "Цю нотатку було спочатку взято з:",
|
"this_note_was_originally_taken_from": "Цю нотатку було спочатку взято з:"
|
||||||
"info": "Інформація"
|
|
||||||
},
|
},
|
||||||
"owned_attribute_list": {
|
"owned_attribute_list": {
|
||||||
"owned_attributes": "Власні Атрибути"
|
"owned_attributes": "Власні Атрибути"
|
||||||
|
|||||||
@ -81,7 +81,6 @@ export async function buildEventsForCalendar(note: FNote, e: EventSourceFuncArg)
|
|||||||
export async function buildEvent(note: FNote, { startDate, endDate, startTime, endTime, isArchived }: Event) {
|
export async function buildEvent(note: FNote, { startDate, endDate, startTime, endTime, isArchived }: Event) {
|
||||||
const customTitleAttributeName = note.getLabelValue("calendar:title");
|
const customTitleAttributeName = note.getLabelValue("calendar:title");
|
||||||
const titles = await parseCustomTitle(customTitleAttributeName, note);
|
const titles = await parseCustomTitle(customTitleAttributeName, note);
|
||||||
const color = note.getLabelValue("calendar:color") ?? note.getLabelValue("color");
|
|
||||||
const colorClass = note.getColorClass();
|
const colorClass = note.getColorClass();
|
||||||
const events: EventInput[] = [];
|
const events: EventInput[] = [];
|
||||||
|
|
||||||
@ -110,7 +109,6 @@ export async function buildEvent(note: FNote, { startDate, endDate, startTime, e
|
|||||||
start: startDate,
|
start: startDate,
|
||||||
url: `#${note.noteId}?popup`,
|
url: `#${note.noteId}?popup`,
|
||||||
noteId: note.noteId,
|
noteId: note.noteId,
|
||||||
color: color ?? undefined,
|
|
||||||
iconClass: note.getLabelValue("iconClass"),
|
iconClass: note.getLabelValue("iconClass"),
|
||||||
promotedAttributes: displayedAttributesData,
|
promotedAttributes: displayedAttributesData,
|
||||||
className: clsx({archived: isArchived}, colorClass)
|
className: clsx({archived: isArchived}, colorClass)
|
||||||
|
|||||||
@ -1,8 +1,19 @@
|
|||||||
|
:root {
|
||||||
|
/* Default values to be overridden by themes */
|
||||||
|
--calendar-coll-event-background-lightness: 95%;
|
||||||
|
--calendar-coll-event-background-saturation: 80%;
|
||||||
|
--calendar-coll-event-background-color: var(--accented-background-color);
|
||||||
|
--calendar-coll-event-text-color: var(--primary-button-text-color);
|
||||||
|
--calendar-cell-event-hover-filter: none;
|
||||||
|
--calendar-coll-today-background-color: var(--more-accented-background-color);
|
||||||
|
}
|
||||||
|
|
||||||
.calendar-view {
|
.calendar-view {
|
||||||
--fc-event-border-color: var(--calendar-coll-event-text-color);
|
--fc-event-border-color: var(--calendar-coll-event-text-color);
|
||||||
--fc-event-bg-color: var(--calendar-coll-event-background-color);
|
--fc-event-bg-color: var(--calendar-coll-event-background-color);
|
||||||
--fc-event-text-color: var(--calendar-coll-event-text-color);
|
--fc-event-text-color: var(--calendar-coll-event-text-color);
|
||||||
--fc-event-selected-overlay-color: transparent;
|
--fc-event-selected-overlay-color: transparent;
|
||||||
|
--fc-today-bg-color: var(--calendar-coll-today-background-color);
|
||||||
|
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
@ -12,8 +23,9 @@
|
|||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.calendar-view a {
|
.calendar-view a,
|
||||||
color: unset;
|
:root .calendar-view a.fc-daygrid-event:hover {
|
||||||
|
color: var(--fc-event-text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
.search-result-widget-content .calendar-view {
|
.search-result-widget-content .calendar-view {
|
||||||
@ -85,17 +97,25 @@ body.desktop:not(.zen) .calendar-view .calendar-header {
|
|||||||
/* #region Events */
|
/* #region Events */
|
||||||
|
|
||||||
.calendar-view a.fc-timegrid-event,
|
.calendar-view a.fc-timegrid-event,
|
||||||
.calendar-view a.fc-daygrid-event {
|
.calendar-view a.fc-daygrid-event,
|
||||||
|
.fc-daygrid-dot-event .fc-event-title {
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
}
|
}
|
||||||
|
|
||||||
.calendar-view a.fc-timegrid-event,
|
.calendar-view a.fc-timegrid-event:focus-visible,
|
||||||
.calendar-view a.fc-daygrid-event:not(.fc-daygrid-dot-event) {
|
.calendar-view a.fc-daygrid-event:focus-visible {
|
||||||
--border-color: transparent;
|
outline: none;
|
||||||
|
}
|
||||||
|
|
||||||
border-width: 2px 2px 2px 4px;
|
.calendar-view a.fc-timegrid-event,
|
||||||
|
.calendar-view a.fc-daygrid-event {
|
||||||
|
--border-color: transparent;
|
||||||
|
|
||||||
|
border: 2px solid;
|
||||||
|
border-left-width: 4px;
|
||||||
border-color: var(--border-color) var(--border-color) var(--border-color)
|
border-color: var(--border-color) var(--border-color) var(--border-color)
|
||||||
var(--fc-event-text-color) !important;
|
var(--fc-event-text-color) !important;
|
||||||
|
background: var(--fc-event-bg-color) !important;
|
||||||
|
|
||||||
padding-left: 8px;
|
padding-left: 8px;
|
||||||
}
|
}
|
||||||
@ -115,8 +135,8 @@ body.desktop:not(.zen) .calendar-view .calendar-header {
|
|||||||
color: currentColor;
|
color: currentColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fc-timegrid-event.with-hue,
|
.calendar-view .fc-timegrid-event.with-hue,
|
||||||
.fc-daygrid-event:not(.fc-daygrid-dot-event).with-hue {
|
.calendar-view .fc-daygrid-event.with-hue {
|
||||||
--fc-event-text-color: var(--custom-color);
|
--fc-event-text-color: var(--custom-color);
|
||||||
|
|
||||||
background: hsl(var(--custom-color-hue),
|
background: hsl(var(--custom-color-hue),
|
||||||
@ -124,8 +144,12 @@ body.desktop:not(.zen) .calendar-view .calendar-header {
|
|||||||
var(--calendar-coll-event-background-lightness)) !important;
|
var(--calendar-coll-event-background-lightness)) !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fc-event-time {
|
.calendar-view .fc-event-time {
|
||||||
opacity: .75;
|
opacity: .75;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.fc-daygrid-event-dot {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
/* #endregion */
|
/* #endregion */
|
||||||
43
apps/client/src/widgets/note_origin.tsx
Normal file
43
apps/client/src/widgets/note_origin.tsx
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
import { t } from "../services/i18n";
|
||||||
|
import { useNoteContext, useTriliumEvent, useTriliumOption } from "./react/hooks";
|
||||||
|
import { useEffect, useState } from "preact/hooks";
|
||||||
|
import attributes from "../services/attributes";
|
||||||
|
import InfoBar from "./react/InfoBar";
|
||||||
|
import RawHtml from "./react/RawHtml";
|
||||||
|
import FNote from "../entities/fnote";
|
||||||
|
|
||||||
|
export default function OriginInfo() {
|
||||||
|
const { note } = useNoteContext();
|
||||||
|
const [link, setLink] = useState<string>();
|
||||||
|
|
||||||
|
function refresh() {
|
||||||
|
if (!note) return;
|
||||||
|
const pageUrl = getPageUrl(note);
|
||||||
|
if (!pageUrl) {
|
||||||
|
setLink(undefined);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setLink(`<a href="${pageUrl}" class="external tn-link">${pageUrl}</a>`);
|
||||||
|
}
|
||||||
|
|
||||||
|
useEffect(refresh, [note]);
|
||||||
|
useTriliumEvent("entitiesReloaded", ({ loadResults }) => {
|
||||||
|
if (loadResults.getAttributeRows().find((attr) => attr.type === "label" && attr.name?.toString() === "pageUrl" && attributes.isAffecting(attr, note))) {
|
||||||
|
refresh();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<InfoBar className="origin-info-widget" type="subtle" style={{ display: (!link) ? "none" : undefined }}>
|
||||||
|
{link && (
|
||||||
|
<RawHtml
|
||||||
|
html={`${t("note_properties.this_note_was_originally_taken_from")} ${link}`}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
|
</InfoBar>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
function getPageUrl(note: FNote) {
|
||||||
|
return note.getOwnedLabelValue("pageUrl");
|
||||||
|
}
|
||||||
@ -1,20 +0,0 @@
|
|||||||
import { t } from "../../services/i18n";
|
|
||||||
import { useNoteLabel } from "../react/hooks";
|
|
||||||
import { TabContext } from "./ribbon-interface";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO: figure out better name or conceptualize better.
|
|
||||||
*/
|
|
||||||
export default function NotePropertiesTab({ note }: TabContext) {
|
|
||||||
const [ pageUrl ] = useNoteLabel(note, "pageUrl");
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="note-properties-widget" style={{ padding: "12px", color: "var(--muted-text-color)" }}>
|
|
||||||
{ pageUrl && (
|
|
||||||
<div style={{ overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
|
||||||
{t("note_properties.this_note_was_originally_taken_from")} <a href={pageUrl} class="page-url external">{pageUrl}</a>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
@ -1,6 +1,5 @@
|
|||||||
import ScriptTab from "./ScriptTab";
|
import ScriptTab from "./ScriptTab";
|
||||||
import EditedNotesTab from "./EditedNotesTab";
|
import EditedNotesTab from "./EditedNotesTab";
|
||||||
import NotePropertiesTab from "./NotePropertiesTab";
|
|
||||||
import NoteInfoTab from "./NoteInfoTab";
|
import NoteInfoTab from "./NoteInfoTab";
|
||||||
import SimilarNotesTab from "./SimilarNotesTab";
|
import SimilarNotesTab from "./SimilarNotesTab";
|
||||||
import FilePropertiesTab from "./FilePropertiesTab";
|
import FilePropertiesTab from "./FilePropertiesTab";
|
||||||
@ -59,13 +58,6 @@ export const RIBBON_TAB_DEFINITIONS: TabConfiguration[] = [
|
|||||||
show: ({ note }) => note?.type === "book" || note?.type === "search",
|
show: ({ note }) => note?.type === "book" || note?.type === "search",
|
||||||
toggleCommand: "toggleRibbonTabBookProperties"
|
toggleCommand: "toggleRibbonTabBookProperties"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: t("note_properties.info"),
|
|
||||||
icon: "bx bx-info-square",
|
|
||||||
content: NotePropertiesTab,
|
|
||||||
show: ({ note }) => !!note?.getLabelValue("pageUrl"),
|
|
||||||
activate: true
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: t("file_properties.title"),
|
title: t("file_properties.title"),
|
||||||
icon: "bx bx-file",
|
icon: "bx bx-file",
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
import path from "path";
|
import path, { join } from "path";
|
||||||
import fs from "fs-extra";
|
import fs from "fs-extra";
|
||||||
import { LOCALES } from "@triliumnext/commons";
|
import { LOCALES } from "@triliumnext/commons";
|
||||||
import { PRODUCT_NAME } from "../src/app-info.js";
|
import { PRODUCT_NAME } from "../src/app-info.js";
|
||||||
import type { ForgeConfig } from "@electron-forge/shared-types";
|
import type { ForgeConfig } from "@electron-forge/shared-types";
|
||||||
|
import { existsSync } from "fs";
|
||||||
|
|
||||||
const ELECTRON_FORGE_DIR = __dirname;
|
const ELECTRON_FORGE_DIR = __dirname;
|
||||||
|
|
||||||
@ -228,8 +229,22 @@ const config: ForgeConfig = {
|
|||||||
// Ensure all locales that should be kept are actually present.
|
// Ensure all locales that should be kept are actually present.
|
||||||
for (const locale of localesToKeep) {
|
for (const locale of localesToKeep) {
|
||||||
if (!keptLocales.has(locale)) {
|
if (!keptLocales.has(locale)) {
|
||||||
console.error(`Locale ${locale} was not found in the packaged app.`);
|
throw new Error(`Locale ${locale} was not found in the packaged app.`);
|
||||||
process.exit(1);
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check that the bettersqlite3 binary has the right architecture.
|
||||||
|
if (packageResult.platform === "linux" && packageResult.arch === "arm64") {
|
||||||
|
for (const outputPath of packageResult.outputPaths) {
|
||||||
|
const binaryPath = join(outputPath, "resources/app.asar.unpacked/node_modules/better-sqlite3/build/Release/better_sqlite3.node");
|
||||||
|
if (!existsSync(binaryPath)) {
|
||||||
|
throw new Error(`[better-sqlite3] Unable to find .node file at ${binaryPath}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const actualArch = getELFArch(binaryPath);
|
||||||
|
if (actualArch !== "ARM64") {
|
||||||
|
throw new Error(`[better-sqlite3] Expected ARM64 architecture but got ${actualArch} at: ${binaryPath}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -284,4 +299,20 @@ function getExtraResourcesForPlatform() {
|
|||||||
return resources;
|
return resources;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getELFArch(file: string) {
|
||||||
|
const buf = fs.readFileSync(file);
|
||||||
|
|
||||||
|
if (buf[0] !== 0x7f || buf[1] !== 0x45 || buf[2] !== 0x4c || buf[3] !== 0x46) {
|
||||||
|
throw new Error("Not an ELF file");
|
||||||
|
}
|
||||||
|
|
||||||
|
const eiClass = buf[4]; // 1=32-bit, 2=64-bit
|
||||||
|
const eiMachine = buf[18]; // architecture code
|
||||||
|
|
||||||
|
if (eiMachine === 0x3E) return 'x86-64';
|
||||||
|
if (eiMachine === 0xB7) return 'ARM64';
|
||||||
|
return 'other';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export default config;
|
export default config;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user