diff --git a/_regroup/package.json b/_regroup/package.json index 90d904504..d52334b97 100644 --- a/_regroup/package.json +++ b/_regroup/package.json @@ -143,7 +143,6 @@ "@stylistic/eslint-plugin": "4.2.0", "@types/archiver": "6.0.3", "@types/better-sqlite3": "7.6.13", - "@types/bootstrap": "5.2.10", "@types/cheerio": "0.22.35", "@types/cls-hooked": "4.3.9", "@types/compression": "1.7.5", @@ -178,7 +177,6 @@ "@types/xml2js": "0.4.14", "@types/yargs": "17.0.33", "@vitest/coverage-v8": "3.1.1", - "bootstrap": "5.3.5", "cross-env": "7.0.3", "css-loader": "7.1.2", "electron": "35.1.5", diff --git a/_regroup/src/services/i18n.ts b/_regroup/src/services/i18n.ts index fc8316494..5d3c93050 100644 --- a/_regroup/src/services/i18n.ts +++ b/_regroup/src/services/i18n.ts @@ -5,17 +5,7 @@ import sql_init from "./sql_init.js"; import { join } from "path"; import { getResourceDir } from "./utils.js"; import hidden_subtree from "./hidden_subtree.js"; - -export interface Locale { - id: string; - name: string; - /** `true` if the language is a right-to-left one, or `false` if it's left-to-right. */ - rtl?: boolean; - /** `true` if the language is not supported by the application as a display language, but it is selectable by the user for the content. */ - contentOnly?: boolean; - /** The value to pass to `--lang` for the Electron instance in order to set it as a locale. Not setting it will hide it from the list of supported locales. */ - electronLocale?: string; -} +import type { Locale } from "@triliumnext/commons"; const LOCALES: Locale[] = [ { diff --git a/apps/client/package.json b/apps/client/package.json index 5379c1f38..b90eae9aa 100644 --- a/apps/client/package.json +++ b/apps/client/package.json @@ -67,6 +67,8 @@ "electron": "35.1.5", "debounce": "2.2.0", "draggabilly": "3.0.0", - "vitest": "3.1.1" + "vitest": "3.1.1", + "@types/bootstrap": "5.2.10", + "bootstrap": "5.3.5" } } diff --git a/apps/client/src/widgets/type_widgets/options/advanced/database_anonymization.ts b/apps/client/src/widgets/type_widgets/options/advanced/database_anonymization.ts index 2726a489b..edef0e4d4 100644 --- a/apps/client/src/widgets/type_widgets/options/advanced/database_anonymization.ts +++ b/apps/client/src/widgets/type_widgets/options/advanced/database_anonymization.ts @@ -2,7 +2,7 @@ import OptionsWidget from "../options_widget.js"; import toastService from "../../../../services/toast.js"; import server from "../../../../services/server.js"; import { t } from "../../../../services/i18n.js"; -import type { OptionMap } from "../../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; const TPL = /*html*/`
diff --git a/apps/client/src/widgets/type_widgets/options/advanced/sync.ts b/apps/client/src/widgets/type_widgets/options/advanced/sync.ts index 39eee0f97..503ad1b3a 100644 --- a/apps/client/src/widgets/type_widgets/options/advanced/sync.ts +++ b/apps/client/src/widgets/type_widgets/options/advanced/sync.ts @@ -2,7 +2,7 @@ import OptionsWidget from "../options_widget.js"; import server from "../../../../services/server.js"; import toastService from "../../../../services/toast.js"; import { t } from "../../../../services/i18n.js"; -import type { OptionMap } from "../../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; const TPL = /*html*/`
diff --git a/apps/client/src/widgets/type_widgets/options/ai_settings/ai_settings_widget.ts b/apps/client/src/widgets/type_widgets/options/ai_settings/ai_settings_widget.ts index 269b958ba..8f76eac4b 100644 --- a/apps/client/src/widgets/type_widgets/options/ai_settings/ai_settings_widget.ts +++ b/apps/client/src/widgets/type_widgets/options/ai_settings/ai_settings_widget.ts @@ -1,7 +1,7 @@ import OptionsWidget from "../options_widget.js"; import { TPL } from "./template.js"; import { t } from "../../../../services/i18n.js"; -import type { OptionDefinitions, OptionMap } from "../../../../../../services/options_interface.js"; +import type { OptionDefinitions, OptionMap } from "@triliumnext/commons"; import server from "../../../../services/server.js"; import toastService from "../../../../services/toast.js"; import type { EmbeddingStats, FailedEmbeddingNotes } from "./interfaces.js"; diff --git a/apps/client/src/widgets/type_widgets/options/appearance/code_block.ts b/apps/client/src/widgets/type_widgets/options/appearance/code_block.ts index 2ed221088..44182fdae 100644 --- a/apps/client/src/widgets/type_widgets/options/appearance/code_block.ts +++ b/apps/client/src/widgets/type_widgets/options/appearance/code_block.ts @@ -1,4 +1,4 @@ -import type { OptionMap } from "../../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; import { t } from "../../../../services/i18n.js"; import library_loader from "../../../../services/library_loader.js"; import server from "../../../../services/server.js"; diff --git a/apps/client/src/widgets/type_widgets/options/appearance/electron_integration.ts b/apps/client/src/widgets/type_widgets/options/appearance/electron_integration.ts index 2a0181dd4..b49a7503b 100644 --- a/apps/client/src/widgets/type_widgets/options/appearance/electron_integration.ts +++ b/apps/client/src/widgets/type_widgets/options/appearance/electron_integration.ts @@ -1,7 +1,7 @@ import OptionsWidget from "../options_widget.js"; import { t } from "../../../../services/i18n.js"; import utils from "../../../../services/utils.js"; -import type { OptionMap } from "../../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; const TPL = /*html*/`
diff --git a/apps/client/src/widgets/type_widgets/options/appearance/fonts.ts b/apps/client/src/widgets/type_widgets/options/appearance/fonts.ts index d9f68f5b7..7d4fa3ce0 100644 --- a/apps/client/src/widgets/type_widgets/options/appearance/fonts.ts +++ b/apps/client/src/widgets/type_widgets/options/appearance/fonts.ts @@ -1,7 +1,7 @@ import OptionsWidget from "../options_widget.js"; import utils from "../../../../services/utils.js"; import { t } from "../../../../services/i18n.js"; -import type { FontFamily, OptionMap, OptionNames } from "../../../../../../services/options_interface.js"; +import type { FontFamily, OptionMap, OptionNames } from "@triliumnext/commons"; interface FontFamilyEntry { value: FontFamily; diff --git a/apps/client/src/widgets/type_widgets/options/appearance/max_content_width.ts b/apps/client/src/widgets/type_widgets/options/appearance/max_content_width.ts index 7b6bccff1..1cf576034 100644 --- a/apps/client/src/widgets/type_widgets/options/appearance/max_content_width.ts +++ b/apps/client/src/widgets/type_widgets/options/appearance/max_content_width.ts @@ -1,7 +1,7 @@ import OptionsWidget from "../options_widget.js"; import utils from "../../../../services/utils.js"; import { t } from "../../../../services/i18n.js"; -import type { OptionMap } from "../../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; const MIN_VALUE = 640; diff --git a/apps/client/src/widgets/type_widgets/options/appearance/ribbon.ts b/apps/client/src/widgets/type_widgets/options/appearance/ribbon.ts index 257dac0ee..861410790 100644 --- a/apps/client/src/widgets/type_widgets/options/appearance/ribbon.ts +++ b/apps/client/src/widgets/type_widgets/options/appearance/ribbon.ts @@ -1,4 +1,4 @@ -import type { OptionMap } from "../../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; import { t } from "../../../../services/i18n.js"; import OptionsWidget from "../options_widget.js"; diff --git a/apps/client/src/widgets/type_widgets/options/appearance/theme.ts b/apps/client/src/widgets/type_widgets/options/appearance/theme.ts index 17a88c3b6..a46408d78 100644 --- a/apps/client/src/widgets/type_widgets/options/appearance/theme.ts +++ b/apps/client/src/widgets/type_widgets/options/appearance/theme.ts @@ -2,7 +2,7 @@ import OptionsWidget from "../options_widget.js"; import server from "../../../../services/server.js"; import utils from "../../../../services/utils.js"; import { t } from "../../../../services/i18n.js"; -import type { OptionMap } from "../../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; const TPL = /*html*/`
diff --git a/apps/client/src/widgets/type_widgets/options/backup.ts b/apps/client/src/widgets/type_widgets/options/backup.ts index 808f91e92..9fd79803f 100644 --- a/apps/client/src/widgets/type_widgets/options/backup.ts +++ b/apps/client/src/widgets/type_widgets/options/backup.ts @@ -3,7 +3,7 @@ import { t } from "../../../services/i18n.js"; import OptionsWidget from "./options_widget.js"; import server from "../../../services/server.js"; import toastService from "../../../services/toast.js"; -import type { OptionMap } from "../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; const TPL = /*html*/`
diff --git a/apps/client/src/widgets/type_widgets/options/code_notes/code_auto_read_only_size.ts b/apps/client/src/widgets/type_widgets/options/code_notes/code_auto_read_only_size.ts index 17cd0bb35..b3b7bad0f 100644 --- a/apps/client/src/widgets/type_widgets/options/code_notes/code_auto_read_only_size.ts +++ b/apps/client/src/widgets/type_widgets/options/code_notes/code_auto_read_only_size.ts @@ -1,4 +1,4 @@ -import type { OptionMap } from "../../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; import { t } from "../../../../services/i18n.js"; import OptionsWidget from "../options_widget.js"; diff --git a/apps/client/src/widgets/type_widgets/options/code_notes/code_editor.ts b/apps/client/src/widgets/type_widgets/options/code_notes/code_editor.ts index 728a58f81..f99b12b50 100644 --- a/apps/client/src/widgets/type_widgets/options/code_notes/code_editor.ts +++ b/apps/client/src/widgets/type_widgets/options/code_notes/code_editor.ts @@ -1,6 +1,6 @@ import OptionsWidget from "../options_widget.js"; import { t } from "../../../../services/i18n.js"; -import type { OptionMap } from "../../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; const TPL = /*html*/`
diff --git a/apps/client/src/widgets/type_widgets/options/code_notes/code_mime_types.ts b/apps/client/src/widgets/type_widgets/options/code_notes/code_mime_types.ts index b8250f67d..7bb4ecac8 100644 --- a/apps/client/src/widgets/type_widgets/options/code_notes/code_mime_types.ts +++ b/apps/client/src/widgets/type_widgets/options/code_notes/code_mime_types.ts @@ -1,7 +1,7 @@ import { t } from "../../../../services/i18n.js"; import OptionsWidget from "../options_widget.js"; import mimeTypesService from "../../../../services/mime_types.js"; -import type { OptionMap } from "../../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; const TPL = /*html*/`
diff --git a/apps/client/src/widgets/type_widgets/options/i18n/i18n.ts b/apps/client/src/widgets/type_widgets/options/i18n/i18n.ts index b75c99fc2..48fb29546 100644 --- a/apps/client/src/widgets/type_widgets/options/i18n/i18n.ts +++ b/apps/client/src/widgets/type_widgets/options/i18n/i18n.ts @@ -2,8 +2,7 @@ import OptionsWidget from "../options_widget.js"; import server from "../../../../services/server.js"; import utils from "../../../../services/utils.js"; import { getAvailableLocales, t } from "../../../../services/i18n.js"; -import type { OptionMap } from "../../../../../../services/options_interface.js"; -import type { Locale } from "../../../../../../services/i18n.js"; +import type { OptionMap, Locale } from "@triliumnext/commons"; const TPL = /*html*/`
diff --git a/apps/client/src/widgets/type_widgets/options/i18n/language.ts b/apps/client/src/widgets/type_widgets/options/i18n/language.ts index 4ccf18550..7a10e0a15 100644 --- a/apps/client/src/widgets/type_widgets/options/i18n/language.ts +++ b/apps/client/src/widgets/type_widgets/options/i18n/language.ts @@ -1,5 +1,5 @@ import OptionsWidget from "../options_widget.js"; -import type { OptionMap } from "../../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; import { getAvailableLocales } from "../../../../services/i18n.js"; import { t } from "i18next"; diff --git a/apps/client/src/widgets/type_widgets/options/images/images.ts b/apps/client/src/widgets/type_widgets/options/images/images.ts index da2005fef..d74cd4b70 100644 --- a/apps/client/src/widgets/type_widgets/options/images/images.ts +++ b/apps/client/src/widgets/type_widgets/options/images/images.ts @@ -1,6 +1,6 @@ import OptionsWidget from "../options_widget.js"; import { t } from "../../../../services/i18n.js"; -import type { OptionMap } from "../../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; const TPL = /*html*/`
diff --git a/apps/client/src/widgets/type_widgets/options/multi_factor_authentication.ts b/apps/client/src/widgets/type_widgets/options/multi_factor_authentication.ts index d75a6a7bc..211a4941d 100644 --- a/apps/client/src/widgets/type_widgets/options/multi_factor_authentication.ts +++ b/apps/client/src/widgets/type_widgets/options/multi_factor_authentication.ts @@ -1,7 +1,7 @@ import server from "../../../services/server.js"; import toastService from "../../../services/toast.js"; import OptionsWidget from "./options_widget.js"; -import type { OptionMap } from "../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; import { t } from "../../../services/i18n.js"; import utils from "../../../services/utils.js"; import dialogService from "../../../services/dialog.js"; diff --git a/apps/client/src/widgets/type_widgets/options/options_widget.ts b/apps/client/src/widgets/type_widgets/options/options_widget.ts index 5d614a42e..331358995 100644 --- a/apps/client/src/widgets/type_widgets/options/options_widget.ts +++ b/apps/client/src/widgets/type_widgets/options/options_widget.ts @@ -1,4 +1,4 @@ -import type { FilterOptionsByType, OptionMap, OptionNames } from "../../../../../services/options_interface.js"; +import type { FilterOptionsByType, OptionMap, OptionNames } from "@triliumnext/commons"; import type { EventData, EventListener } from "../../../components/app_context.js"; import type FNote from "../../../entities/fnote.js"; import { t } from "../../../services/i18n.js"; diff --git a/apps/client/src/widgets/type_widgets/options/other/html_import_tags.ts b/apps/client/src/widgets/type_widgets/options/other/html_import_tags.ts index 61542ea62..5bb626965 100644 --- a/apps/client/src/widgets/type_widgets/options/other/html_import_tags.ts +++ b/apps/client/src/widgets/type_widgets/options/other/html_import_tags.ts @@ -1,6 +1,6 @@ import OptionsWidget from "../options_widget.js"; import { t } from "../../../../services/i18n.js"; -import type { OptionMap } from "../../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; // TODO: Deduplicate with src/services/html_sanitizer once there is a commons project between client and server. export const DEFAULT_ALLOWED_TAGS = [ diff --git a/apps/client/src/widgets/type_widgets/options/other/network_connections.ts b/apps/client/src/widgets/type_widgets/options/other/network_connections.ts index 90f0bbb78..529b9959e 100644 --- a/apps/client/src/widgets/type_widgets/options/other/network_connections.ts +++ b/apps/client/src/widgets/type_widgets/options/other/network_connections.ts @@ -1,6 +1,6 @@ import OptionsWidget from "../options_widget.js"; import { t } from "../../../../services/i18n.js"; -import type { OptionMap } from "../../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; const TPL = /*html*/`
diff --git a/apps/client/src/widgets/type_widgets/options/other/note_erasure_timeout.ts b/apps/client/src/widgets/type_widgets/options/other/note_erasure_timeout.ts index 343834006..96292ab37 100644 --- a/apps/client/src/widgets/type_widgets/options/other/note_erasure_timeout.ts +++ b/apps/client/src/widgets/type_widgets/options/other/note_erasure_timeout.ts @@ -2,7 +2,7 @@ import OptionsWidget from "../options_widget.js"; import server from "../../../../services/server.js"; import toastService from "../../../../services/toast.js"; import { t } from "../../../../services/i18n.js"; -import type { OptionMap } from "../../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; import TimeSelector from "../time_selector.js"; const TPL = /*html*/` diff --git a/apps/client/src/widgets/type_widgets/options/other/revision_snapshots_limit.ts b/apps/client/src/widgets/type_widgets/options/other/revision_snapshots_limit.ts index 62781de9f..55f734818 100644 --- a/apps/client/src/widgets/type_widgets/options/other/revision_snapshots_limit.ts +++ b/apps/client/src/widgets/type_widgets/options/other/revision_snapshots_limit.ts @@ -2,7 +2,7 @@ import OptionsWidget from "../options_widget.js"; import { t } from "../../../../services/i18n.js"; import server from "../../../../services/server.js"; import toastService from "../../../../services/toast.js"; -import type { OptionMap } from "../../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; const TPL = /*html*/`
diff --git a/apps/client/src/widgets/type_widgets/options/other/search_engine.ts b/apps/client/src/widgets/type_widgets/options/other/search_engine.ts index 345d3dc47..b512a3cae 100644 --- a/apps/client/src/widgets/type_widgets/options/other/search_engine.ts +++ b/apps/client/src/widgets/type_widgets/options/other/search_engine.ts @@ -1,7 +1,7 @@ import OptionsWidget from "../options_widget.js"; import utils from "../../../../services/utils.js"; import { t } from "../../../../services/i18n.js"; -import type { OptionMap } from "../../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; const TPL = /*html*/`
diff --git a/apps/client/src/widgets/type_widgets/options/other/share_settings.ts b/apps/client/src/widgets/type_widgets/options/other/share_settings.ts index 1b1eba047..7d51bb499 100644 --- a/apps/client/src/widgets/type_widgets/options/other/share_settings.ts +++ b/apps/client/src/widgets/type_widgets/options/other/share_settings.ts @@ -1,7 +1,7 @@ import OptionsWidget from "../options_widget.js"; import options from "../../../../services/options.js"; import { t } from "../../../../services/i18n.js"; -import type { OptionMap, OptionNames } from "../../../../../../services/options_interface.js"; +import type { OptionMap, OptionNames } from "@triliumnext/commons"; import searchService from "../../../../services/search.js"; const TPL = /*html*/` diff --git a/apps/client/src/widgets/type_widgets/options/other/tray.ts b/apps/client/src/widgets/type_widgets/options/other/tray.ts index e314dd777..3760fe6d6 100644 --- a/apps/client/src/widgets/type_widgets/options/other/tray.ts +++ b/apps/client/src/widgets/type_widgets/options/other/tray.ts @@ -1,7 +1,7 @@ import OptionsWidget from "../options_widget.js"; import { t } from "../../../../services/i18n.js"; import utils from "../../../../services/utils.js"; -import type { OptionMap } from "../../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; const TPL = /*html*/`
diff --git a/apps/client/src/widgets/type_widgets/options/password/password.ts b/apps/client/src/widgets/type_widgets/options/password/password.ts index e61f5e92a..c23b3a7a0 100644 --- a/apps/client/src/widgets/type_widgets/options/password/password.ts +++ b/apps/client/src/widgets/type_widgets/options/password/password.ts @@ -3,7 +3,7 @@ import server from "../../../../services/server.js"; import protectedSessionHolder from "../../../../services/protected_session_holder.js"; import toastService from "../../../../services/toast.js"; import OptionsWidget from "../options_widget.js"; -import type { OptionMap } from "../../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; const TPL = /*html*/`
diff --git a/apps/client/src/widgets/type_widgets/options/shortcuts.ts b/apps/client/src/widgets/type_widgets/options/shortcuts.ts index c25cbebf4..04d75262d 100644 --- a/apps/client/src/widgets/type_widgets/options/shortcuts.ts +++ b/apps/client/src/widgets/type_widgets/options/shortcuts.ts @@ -3,8 +3,7 @@ import utils from "../../../services/utils.js"; import dialogService from "../../../services/dialog.js"; import OptionsWidget from "./options_widget.js"; import { t } from "../../../services/i18n.js"; -import type { KeyboardShortcut } from "../../../../../services/keyboard_actions_interface.js"; -import type { OptionNames } from "../../../../../services/options_interface.js"; +import type { OptionNames, KeyboardShortcut } from "@triliumnext/commons"; const TPL = /*html*/`
diff --git a/apps/client/src/widgets/type_widgets/options/spellcheck.ts b/apps/client/src/widgets/type_widgets/options/spellcheck.ts index 87994909d..43aca1c69 100644 --- a/apps/client/src/widgets/type_widgets/options/spellcheck.ts +++ b/apps/client/src/widgets/type_widgets/options/spellcheck.ts @@ -1,7 +1,7 @@ import utils from "../../../services/utils.js"; import OptionsWidget from "./options_widget.js"; import { t } from "../../../services/i18n.js"; -import type { OptionMap } from "../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; const TPL_WEB = `
diff --git a/apps/client/src/widgets/type_widgets/options/sync.ts b/apps/client/src/widgets/type_widgets/options/sync.ts index f2be3f40d..0fd94a4f9 100644 --- a/apps/client/src/widgets/type_widgets/options/sync.ts +++ b/apps/client/src/widgets/type_widgets/options/sync.ts @@ -2,7 +2,7 @@ import server from "../../../services/server.js"; import toastService from "../../../services/toast.js"; import OptionsWidget from "./options_widget.js"; import { t } from "../../../services/i18n.js"; -import type { OptionMap } from "../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; const TPL = /*html*/`
diff --git a/apps/client/src/widgets/type_widgets/options/text_notes/editor.ts b/apps/client/src/widgets/type_widgets/options/text_notes/editor.ts index dc5ef53da..d55a704a5 100644 --- a/apps/client/src/widgets/type_widgets/options/text_notes/editor.ts +++ b/apps/client/src/widgets/type_widgets/options/text_notes/editor.ts @@ -1,4 +1,4 @@ -import type { OptionMap } from "../../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; import { t } from "../../../../services/i18n.js"; import utils from "../../../../services/utils.js"; import OptionsWidget from "../options_widget.js"; diff --git a/apps/client/src/widgets/type_widgets/options/text_notes/heading_style.ts b/apps/client/src/widgets/type_widgets/options/text_notes/heading_style.ts index c45ce08ca..a82a57c50 100644 --- a/apps/client/src/widgets/type_widgets/options/text_notes/heading_style.ts +++ b/apps/client/src/widgets/type_widgets/options/text_notes/heading_style.ts @@ -1,6 +1,6 @@ import OptionsWidget from "../options_widget.js"; import { t } from "../../../../services/i18n.js"; -import type { OptionMap } from "../../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; const TPL = /*html*/`
diff --git a/apps/client/src/widgets/type_widgets/options/text_notes/highlights_list.ts b/apps/client/src/widgets/type_widgets/options/text_notes/highlights_list.ts index 555cdf6eb..b54bd635a 100644 --- a/apps/client/src/widgets/type_widgets/options/text_notes/highlights_list.ts +++ b/apps/client/src/widgets/type_widgets/options/text_notes/highlights_list.ts @@ -1,6 +1,6 @@ import OptionsWidget from "../options_widget.js"; import { t } from "../../../../services/i18n.js"; -import type { OptionMap } from "../../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; const TPL = /*html*/`
diff --git a/apps/client/src/widgets/type_widgets/options/text_notes/table_of_contents.ts b/apps/client/src/widgets/type_widgets/options/text_notes/table_of_contents.ts index 3ca009426..aa20e6998 100644 --- a/apps/client/src/widgets/type_widgets/options/text_notes/table_of_contents.ts +++ b/apps/client/src/widgets/type_widgets/options/text_notes/table_of_contents.ts @@ -1,6 +1,6 @@ import OptionsWidget from "../options_widget.js"; import { t } from "../../../../services/i18n.js"; -import type { OptionMap } from "../../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; const TPL = /*html*/`
diff --git a/apps/client/src/widgets/type_widgets/options/text_notes/text_auto_read_only_size.ts b/apps/client/src/widgets/type_widgets/options/text_notes/text_auto_read_only_size.ts index f69db7a9e..ef48abaaa 100644 --- a/apps/client/src/widgets/type_widgets/options/text_notes/text_auto_read_only_size.ts +++ b/apps/client/src/widgets/type_widgets/options/text_notes/text_auto_read_only_size.ts @@ -1,6 +1,6 @@ import OptionsWidget from "../options_widget.js"; import { t } from "../../../../services/i18n.js"; -import type { OptionMap } from "../../../../../../services/options_interface.js"; +import type { OptionMap } from "@triliumnext/commons"; const TPL = /*html*/`
diff --git a/apps/client/src/widgets/type_widgets/options/time_selector.ts b/apps/client/src/widgets/type_widgets/options/time_selector.ts index 71115a45c..b9de25014 100644 --- a/apps/client/src/widgets/type_widgets/options/time_selector.ts +++ b/apps/client/src/widgets/type_widgets/options/time_selector.ts @@ -1,7 +1,7 @@ import OptionsWidget from "./options_widget.js"; import toastService from "../../../services/toast.js"; import { t } from "../../../services/i18n.js"; -import type { OptionDefinitions, OptionMap } from "../../../../../services/options_interface.js"; +import type { OptionDefinitions, OptionMap } from "@triliumnext/commons"; import optionsService from "../../../services/options.js"; type TimeSelectorConstructor = { diff --git a/package-lock.json b/package-lock.json index 9854bb652..b502029d9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6242,19 +6242,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "apps/client/node_modules/typescript": { - "version": "5.8.3", - "dev": true, - "license": "Apache-2.0", - "peer": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=14.17" - } - }, "apps/client/node_modules/ufo": { "version": "1.6.1", "dev": true, @@ -6877,10 +6864,27 @@ "resolved": "packages/commons", "link": true }, + "node_modules/typescript": { + "version": "5.8.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", + "integrity": "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, "packages/commons": { "name": "@triliumnext/commons", "version": "0.0.1", - "license": "AGPL-3.0-only" + "license": "AGPL-3.0-only", + "devDependencies": { + "typescript": "5.8.3" + } } } } diff --git a/packages/commons/.gitignore b/packages/commons/.gitignore new file mode 100644 index 000000000..c795b054e --- /dev/null +++ b/packages/commons/.gitignore @@ -0,0 +1 @@ +build \ No newline at end of file diff --git a/packages/commons/package.json b/packages/commons/package.json index 759ff99a8..4191be150 100644 --- a/packages/commons/package.json +++ b/packages/commons/package.json @@ -17,8 +17,12 @@ "url": "https://github.com/TriliumNext/Notes" }, "type": "module", - "main": "index.js", + "main": "build/index.js", + "types": "build/index.d.ts", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "build": "tsc" + }, + "devDependencies": { + "typescript": "5.8.3" } } diff --git a/packages/commons/src/i18n.ts b/packages/commons/src/i18n.ts new file mode 100644 index 000000000..43fa82eb8 --- /dev/null +++ b/packages/commons/src/i18n.ts @@ -0,0 +1,10 @@ +export interface Locale { + id: string; + name: string; + /** `true` if the language is a right-to-left one, or `false` if it's left-to-right. */ + rtl?: boolean; + /** `true` if the language is not supported by the application as a display language, but it is selectable by the user for the content. */ + contentOnly?: boolean; + /** The value to pass to `--lang` for the Electron instance in order to set it as a locale. Not setting it will hide it from the list of supported locales. */ + electronLocale?: string; +} \ No newline at end of file diff --git a/packages/commons/src/index.ts b/packages/commons/src/index.ts new file mode 100644 index 000000000..b5c128e89 --- /dev/null +++ b/packages/commons/src/index.ts @@ -0,0 +1,3 @@ +export * from "./i18n.js"; +export * from "./options_interface.js"; +export * from "./keyboard_actions_interface.js"; \ No newline at end of file diff --git a/packages/commons/tsconfig.json b/packages/commons/tsconfig.json new file mode 100644 index 000000000..917a4a20c --- /dev/null +++ b/packages/commons/tsconfig.json @@ -0,0 +1,8 @@ +{ + "compilerOptions": { + "module": "ESNext", + "declaration": true, + "outDir": "build", + }, + "include": [ "./src/**/*.ts" ] +} \ No newline at end of file