Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.
TypeScript agentaiai-agentsall-in-onecrmcrm-systememaillinearmcpmessagingnotesnotionofficerustslackslack-alternativestartupstartup-toolstypescriptworkspace
fix: document mention split activation switching focus (#74)
gbirmanc0434e050e89
diff --git a/js/app/biome.jsonc b/js/app/biome.jsoncindex aded7cfe16..c9c3b278f1 100644--- a/js/app/biome.jsonc+++ b/js/app/biome.jsonc@@ -4,7 +4,7 @@"clientKind": "git","enabled": true,"useIgnoreFile": true,- "defaultBranch": "main"+ "defaultBranch": "origin/main"},"files": {"includes": [diff --git a/js/app/packages/app/component/Root.tsx b/js/app/packages/app/component/Root.tsxindex c29eb800c9..c3f9101e41 100644--- a/js/app/packages/app/component/Root.tsx+++ b/js/app/packages/app/component/Root.tsx@@ -44,8 +44,12 @@ import {Show,Suspense,} from 'solid-js';-import { currentThemeId, darkModeTheme, lightModeTheme, systemMode, themeShouldMatchSystem } from '../../block-theme/signals/themeSignals';-import { applyTheme, ensureMinimalThemeContrast, systemThemeEffect } from '../../block-theme/utils/themeUtils';+import { currentThemeId } from '../../block-theme/signals/themeSignals';+import {+ applyTheme,+ ensureMinimalThemeContrast,+ systemThemeEffect,+} from '../../block-theme/utils/themeUtils';import { useNotificationState } from '../../notification-provider/src/NotificationProvider';import { TauriRouteListener } from '../../tauri/src/TauriProvider';import { updateCookie } from '../util/updateCookie';diff --git a/js/app/packages/app/component/UnifiedListView.tsx b/js/app/packages/app/component/UnifiedListView.tsxindex bf13084154..9d623c0087 100644--- a/js/app/packages/app/component/UnifiedListView.tsx+++ b/js/app/packages/app/component/UnifiedListView.tsx@@ -118,7 +118,7 @@ import {type SortOptions,VIEWCONFIG_BASE,VIEWCONFIG_DEFAULTS_NAMES,- ViewConfigBase,+ type ViewConfigBase,} from './ViewConfig';const sortOptions = [diff --git a/js/app/packages/app/component/dock/CreateMenu.tsx b/js/app/packages/app/component/dock/CreateMenu.tsxindex 2690e6b34d..275d84715b 100644--- a/js/app/packages/app/component/dock/CreateMenu.tsx+++ b/js/app/packages/app/component/dock/CreateMenu.tsx@@ -18,14 +18,7 @@ import { ok } from '@core/util/maybeResult';import { DropdownMenu } from '@kobalte/core/dropdown-menu';import MacroCreateIcon from '@macro-icons/macro-create-b.svg';import { useCreateProject } from '@service-storage/projects';-import {- createEffect,- createMemo,- createSignal,- For,- onMount,- Show,-} from 'solid-js';+import { createMemo, For, onMount, Show } from 'solid-js';import { useSplitLayout } from '../split-layout/layout';export const [createMenuOpen, setCreateMenuOpen] = createControlledOpenSignal();@@ -318,9 +311,7 @@ export function CreateMenu() {// onMount(() => setCreateMenuOpen(true))return (<DropdownMenu open={createMenuOpen()} onOpenChange={setCreateMenuOpen}>- <DropdownMenu.Trigger- class="relative flex justify-between items-center gap-2 data-expanded:bg-accent px-3 py-2 border border-edge-muted data-expanded:border-accent **:border-none! font-medium text-ink-muted data-expanded:text-default-bg hover:text-accent text-base bracket-never"- >+ <DropdownMenu.Trigger class="relative flex justify-between items-center gap-2 data-expanded:bg-accent px-3 py-2 border border-edge-muted data-expanded:border-accent **:border-none! font-medium text-ink-muted data-expanded:text-default-bg hover:text-accent text-base bracket-never"><span class="flex items-center"><MacroCreateIconclass={`h-2.5 ${createMenuOpen() ? 'fill-dialog/70' : 'fill-accent/70 transition-all duration-300'}`}diff --git a/js/app/packages/app/component/dock/Dock.tsx b/js/app/packages/app/component/dock/Dock.tsxindex a4a88ac370..4609ea966e 100644--- a/js/app/packages/app/component/dock/Dock.tsx+++ b/js/app/packages/app/component/dock/Dock.tsx@@ -24,7 +24,7 @@ import { isRightPanelOpen, useToggleRightPanel } from '@core/signal/layout';import IconQuestion from '@icon/regular/question.svg';import IconAtom from '@macro-icons/macro-atom.svg';import IconGear from '@macro-icons/macro-gear.svg';-import { createMemo, createSignal, For, Show } from 'solid-js';+import { createMemo, createSignal, Show } from 'solid-js';import { setKonsoleOpen } from '../command/state';import { useGlobalNotificationSource } from '../GlobalAppState';import { BasicTierLimit } from './BasicTierLimit';@@ -105,9 +105,9 @@ export function Dock() {Debug</h3><ol class="flex flex-col bg-ink/50 px-[1ch] py-[1lh] list-decimal list-inside">- <li class="whitespace-nowrap list-item">- <span class="bg-ink px-1 py-px">{activeScope()}</span>- </li>+ <li class="whitespace-nowrap list-item">+ <span class="bg-ink px-1 py-px">{activeScope()}</span>+ </li></ol></div></Show>diff --git a/js/app/packages/app/component/rightbar/Rightbar.tsx b/js/app/packages/app/component/rightbar/Rightbar.tsxindex 6b3f3694a0..5ddc890c53 100644--- a/js/app/packages/app/component/rightbar/Rightbar.tsx+++ b/js/app/packages/app/component/rightbar/Rightbar.tsx@@ -356,7 +356,7 @@ export function Rightbar(props: {} else {globalSplitManager()?.returnFocus();}- }+ };createEffect(() => {if (props.isBig) {diff --git a/js/app/packages/app/signal/emailAuth.ts b/js/app/packages/app/signal/emailAuth.tsindex 6d29c9f767..22a74d80c3 100644--- a/js/app/packages/app/signal/emailAuth.ts+++ b/js/app/packages/app/signal/emailAuth.ts@@ -1,9 +1,8 @@import { updateUserAuth } from '@core/auth';import { toast } from '@core/component/Toast/Toast';import { SERVER_HOSTS } from '@core/constant/servers';-import { isErr, isOk, ok } from '@core/util/maybeResult';+import { isErr, ok } from '@core/util/maybeResult';import { queryKeys } from '@macro-entity';-import { authServiceClient } from '@service-auth/client';import { emailClient } from '@service-email/client';import { updateUserInfo } from '@service-gql/client';import { createSingletonRoot } from '@solid-primitives/rootless';diff --git a/js/app/packages/block-channel/component/UserIconWithContact.tsx b/js/app/packages/block-channel/component/UserIconWithContact.tsxindex 2f6a90cd95..aafba7b722 100644--- a/js/app/packages/block-channel/component/UserIconWithContact.tsx+++ b/js/app/packages/block-channel/component/UserIconWithContact.tsx@@ -1,5 +1,6 @@import { UserIcon } from '@core/component/UserIcon';import { idToEmail } from '@core/user';+import { useSplitNavigationHandler } from '@core/util/useSplitNavigationHandler';import type { Component } from 'solid-js';import { useSplitLayout } from '../../app/component/split-layout/layout';@@ -25,8 +26,10 @@ export const UserIconWithContact: Component<UserIconWithContactProps> = (replaceOrInsertSplit({ type: 'contact', id: email });};+ const navHandlers = useSplitNavigationHandler(handleClick);+return (- <div onClick={handleClick} class="cursor-pointer" title="View contact">+ <div {...navHandlers} class="cursor-pointer" title="View contact"><UserIcon id={props.userId} size={props.size} isDeleted={false} /></div>);diff --git a/js/app/packages/block-email/component/Block.tsx b/js/app/packages/block-email/component/Block.tsxindex 2440d97349..f50929b623 100644--- a/js/app/packages/block-email/component/Block.tsx+++ b/js/app/packages/block-email/component/Block.tsx@@ -3,9 +3,9 @@ import { withAnalytics } from '@coparse/analytics';import { DocumentBlockContainer } from '@core/component/DocumentBlockContainer';import { EmailDebouncedReadMarker } from '@notifications/components/DebouncedNotificationReadMarker';import { createEffect, createMemo, onMount, Show } from 'solid-js';-import { markThreadAsSeen } from '../util/markThreadAsSeen';import { blockDataSignal } from '../signal/emailBlockData';import { createThreadMessagesResource } from '../signal/threadMessages';+import { markThreadAsSeen } from '../util/markThreadAsSeen';import { Email } from './Email';const { track, TrackingEvents } = withAnalytics();diff --git a/js/app/packages/block-md/component/MarkdownEditor.tsx b/js/app/packages/block-md/component/MarkdownEditor.tsxindex 1db43cd71d..38b4c966ee 100644--- a/js/app/packages/block-md/component/MarkdownEditor.tsx+++ b/js/app/packages/block-md/component/MarkdownEditor.tsx@@ -665,7 +665,7 @@ export function MarkdownEditor() {autoRegister(registerRootEventListener(editor, 'focusin', (e) => {e.preventDefault();- editor.focus(undefined, {defaultSelection: 'rootStart'});+ editor.focus(undefined, { defaultSelection: 'rootStart' });}));diff --git a/js/app/packages/block-theme/components/ThemeEditorAdvanced.tsx b/js/app/packages/block-theme/components/ThemeEditorAdvanced.tsxindex 01d42b5ad5..71d55d6472 100644--- a/js/app/packages/block-theme/components/ThemeEditorAdvanced.tsx+++ b/js/app/packages/block-theme/components/ThemeEditorAdvanced.tsx@@ -1,6 +1,6 @@+import { For } from 'solid-js';import { themeReactive } from '../signals/themeReactive';import { ColorSwatch } from './ColorSwatch';-import { For } from 'solid-js';// function setInput(){// get content colorValuediff --git a/js/app/packages/block-theme/components/ThemeEditorBasic.tsx b/js/app/packages/block-theme/components/ThemeEditorBasic.tsxindex e18240fec5..5e2dbc0b96 100644--- a/js/app/packages/block-theme/components/ThemeEditorBasic.tsx+++ b/js/app/packages/block-theme/components/ThemeEditorBasic.tsx@@ -1,4 +1,10 @@-import { batch, createEffect, createSignal, onCleanup, onMount } from 'solid-js';+import {+ batch,+ createEffect,+ createSignal,+ onCleanup,+ onMount,+} from 'solid-js';import { themeReactive } from '../signals/themeReactive';function setLightness(lightness: number) {@@ -27,8 +33,8 @@ function setChroma(chroma: number, saturation: number) {function setHue(hue: number) {batch(() => {themeReactive.a0.h[1](hue);- themeReactive.a1.h[1](hue + 40);- themeReactive.a2.h[1](hue + 80);+ themeReactive.a1.h[1](hue + 40);+ themeReactive.a2.h[1](hue + 80);themeReactive.a3.h[1](hue + 120);themeReactive.a4.h[1](hue + 160);@@ -422,13 +428,18 @@ export function ThemeEditorBasic() {></div><div- style={{left: `${themeReactive.a0.c[0]() * (100 / 0.37)}%`, 'background-color': 'var(--a0)'}}+ style={{+ left: `${themeReactive.a0.c[0]() * (100 / 0.37)}%`,+ 'background-color': 'var(--a0)',+ }}class="thumb"/><inputvalue={themeReactive.a0.c[0]().toString()}- onInput={(e) => {handleChromaChange(e)}}+ onInput={(e) => {+ handleChromaChange(e);+ }}class="slider"step="0.001"type="range"@@ -438,12 +449,23 @@ export function ThemeEditorBasic() {</div><div class="slider-container">- <div class="slider-track wrapper-saturation"><- div/><div/><div/><div/><div/><div/><div/><div/><div/><div/>+ <div class="slider-track wrapper-saturation">+ <div />+ <div />+ <div />+ <div />+ <div />+ <div />+ <div />+ <div />+ <div />+ <div /></div><div- style={{left: `${(themeReactive.b0.c[0]() / (themeReactive.a0.c[0]() * 0.8) / 0.37) * 100}%`}}+ style={{+ left: `${(themeReactive.b0.c[0]() / (themeReactive.a0.c[0]() * 0.8) / 0.37) * 100}%`,+ }}class="thumb"/>@@ -461,7 +483,9 @@ export function ThemeEditorBasic() {*/}<input- onInput={(e) => {handleSaturationChange(e)}}+ onInput={(e) => {+ handleSaturationChange(e);+ }}ref={sliderSaturationRef}class="slider"step="0.001"@@ -474,11 +498,26 @@ export function ThemeEditorBasic() {<div class="slider-container"><div class="slider-track wrapper-contrast">- <div/><div/><div/><div/><div/><div/><div/><div/><div/><div/><div/><div/><div/><div/>+ <div />+ <div />+ <div />+ <div />+ <div />+ <div />+ <div />+ <div />+ <div />+ <div />+ <div />+ <div />+ <div />+ <div /></div><div- style={{left: `${getContrastFromY(themeReactive.b0.l[0]()) * 100}%`}}+ style={{+ left: `${getContrastFromY(themeReactive.b0.l[0]()) * 100}%`,+ }}class="thumb"/>@@ -497,7 +536,9 @@ export function ThemeEditorBasic() {*/}<input- onInput={(e) => {handleContrastChange(e)}}+ onInput={(e) => {+ handleContrastChange(e);+ }}ref={sliderContrastRef}class="slider"type="range"diff --git a/js/app/packages/block-theme/components/ThemeList.tsx b/js/app/packages/block-theme/components/ThemeList.tsxindex fb7ebc8f4b..a4743bd552 100644--- a/js/app/packages/block-theme/components/ThemeList.tsx+++ b/js/app/packages/block-theme/components/ThemeList.tsx@@ -1,7 +1,7 @@-import { isThemeSaved, currentThemeId, themes } from '../signals/themeSignals';+import { For } from 'solid-js';+import { currentThemeId, isThemeSaved, themes } from '../signals/themeSignals';import { applyTheme } from '../utils/themeUtils';import { ColorSwatch } from './ColorSwatch';-import { For } from 'solid-js';export function ThemeList() {return (diff --git a/js/app/packages/block-theme/components/ThemeTools.tsx b/js/app/packages/block-theme/components/ThemeTools.tsxindex c2c20941c9..62f091ad8e 100644--- a/js/app/packages/block-theme/components/ThemeTools.tsx+++ b/js/app/packages/block-theme/components/ThemeTools.tsx@@ -1,16 +1,21 @@-import { exportTheme, deleteTheme, invertTheme, saveTheme } from '../utils/themeUtils';-import { currentThemeId, themes, isThemeSaved } from '../signals/themeSignals';-import { createEffect, createMemo, createSignal, Show } from 'solid-js';-import IconLightDark from '@macro-icons/macro-light-dark.svg';-import IconClipboard from '@macro-icons/macro-clipboard.svg';-import { DEV_MODE_ENV } from '@core/constant/featureFlags';import { IconButton } from '@core/component/IconButton';-// import IconFigma from '@macro-icons/macro-figma.svg';-import IconTrash from '@macro-icons/macro-trash.svg';-import { randomizeTheme } from './ThemeEditorBasic';+import { DEV_MODE_ENV } from '@core/constant/featureFlags';+import IconClipboard from '@macro-icons/macro-clipboard.svg';import IconDice from '@macro-icons/macro-dice.svg';+import IconLightDark from '@macro-icons/macro-light-dark.svg';import IconSave from '@macro-icons/macro-save.svg';+// import IconFigma from '@macro-icons/macro-figma.svg';+import IconTrash from '@macro-icons/macro-trash.svg';+import { createEffect, createMemo, createSignal, Show } from 'solid-js';import { DEFAULT_THEMES } from '../constants';+import { currentThemeId, isThemeSaved, themes } from '../signals/themeSignals';+import {+ deleteTheme,+ exportTheme,+ invertTheme,+ saveTheme,+} from '../utils/themeUtils';+import { randomizeTheme } from './ThemeEditorBasic';// import { copyTokens } from './ComputeTokens';export function ThemeTools() {@@ -18,22 +23,37 @@ export function ThemeTools() {const currentThemeName = createMemo(() => {const theme = themes().find((theme) => theme.id === currentThemeId());- if (isThemeSaved()) { return theme?.name }- else { return 'Theme Name' }+ if (isThemeSaved()) {+ return theme?.name;+ } else {+ return 'Theme Name';+ }});const [showTrash, setShowTrash] = createSignal<boolean>(true);createEffect(() => {- if ( isThemeSaved() && !DEFAULT_THEMES.find((t) => t.id === currentThemeId()) ) { setShowTrash(true) }- else { setShowTrash(false) }+ if (+ isThemeSaved() &&+ !DEFAULT_THEMES.find((t) => t.id === currentThemeId())+ ) {+ setShowTrash(true);+ } else {+ setShowTrash(false);+ }});const [columnCount, setColumnCount] = createSignal(0);createEffect(() => {let count = 3;- if (!isThemeSaved()) { count++ }- if (DEV_MODE_ENV) { count++ }- if (showTrash()) { count++ }+ if (!isThemeSaved()) {+ count++;+ }+ if (DEV_MODE_ENV) {+ count++;+ }+ if (showTrash()) {+ count++;+ }setColumnCount(count);});@@ -41,26 +61,30 @@ export function ThemeTools() {<divstyle={{'grid-template-columns': `min-content 1fr repeat(${columnCount()}, min-content)`,- 'padding': '0 12px 0 20px' /* (41 - 32) / 2 */,- 'gap': '4.5px' /* (41 - 32) / 2 */,+ padding: '0 12px 0 20px' /* (41 - 32) / 2 */,+ gap: '4.5px' /* (41 - 32) / 2 */,'font-family': '"Forma DJR Mono"',- 'border': '1px solid var(--b4)',+ border: '1px solid var(--b4)','scrollbar-width': 'none','align-items': 'center',- 'overflow': 'hidden',+ overflow: 'hidden','font-size': '14px',- 'display': 'grid',- 'height': '43px',- 'width': '100%',+ display: 'grid',+ height: '43px',+ width: '100%',}}>- <div ref={themeName} contentEditable style="white-space: nowrap;">{currentThemeName()}</div>+ <div ref={themeName} contentEditable style="white-space: nowrap;">+ {currentThemeName()}+ </div><hr /><Show when={showTrash()}><IconButton- onPointerDown={() => { deleteTheme(currentThemeId()) }}+ onPointerDown={() => {+ deleteTheme(currentThemeId());+ }}icon={IconTrash}theme="base"/>@@ -68,7 +92,9 @@ export function ThemeTools() {<Show when={!isThemeSaved()}><IconButton- onPointerDown={() => { saveTheme(themeName.innerText) }}+ onPointerDown={() => {+ saveTheme(themeName.innerText);+ }}icon={IconSave}theme="base"/>@@ -92,11 +118,7 @@ export function ThemeTools() {theme="base"/>- <IconButton- onPointerDown={randomizeTheme}- icon={IconDice}- theme="base"- />+ <IconButton onPointerDown={randomizeTheme} icon={IconDice} theme="base" /></div>);}diff --git a/js/app/packages/block-theme/constants.ts b/js/app/packages/block-theme/constants.tsindex 2f5b57cb7f..3ca08ea492 100644--- a/js/app/packages/block-theme/constants.ts+++ b/js/app/packages/block-theme/constants.ts@@ -159,27 +159,27 @@ export const DEFAULT_THEMES = [},},{- id:"Spell",- name:"Spell",- version:1,- tokens:{+ id: 'Spell',+ name: 'Spell',+ version: 1,+ tokens: {a0: { l: 0.88, c: 0.1427, h: 71 },a1: { l: 0.88, c: 0.1427, h: 111 },a2: { l: 0.88, c: 0.1427, h: 151 },a3: { l: 0.88, c: 0.1427, h: 191 },a4: { l: 0.88, c: 0.1427, h: 231 },- b0: { l: 0.34, c: 0.1000, h: 287 },+ b0: { l: 0.34, c: 0.1, h: 287 },b1: { l: 0.27, c: 0.05, h: 287 },b2: { l: 0.24, c: 0.0697, h: 287 },- b3: { l: 0.20, c: 0.05, h: 287 },+ b3: { l: 0.2, c: 0.05, h: 287 },b4: { l: 0.6, c: 0.2, h: 287 },- c0:{ l: 0.90, c: 0.192, h: 287 },- c1:{ l: 0.83, c: 0.22, h: 287 },- c2:{ l: 0.78, c: 0.192, h: 287 },- c3:{ l: 0.63, c: 0.192, h: 287 },- c4:{ l: 0.63, c: 0.192, h: 287 }- }-}+ c0: { l: 0.9, c: 0.192, h: 287 },+ c1: { l: 0.83, c: 0.22, h: 287 },+ c2: { l: 0.78, c: 0.192, h: 287 },+ c3: { l: 0.63, c: 0.192, h: 287 },+ c4: { l: 0.63, c: 0.192, h: 287 },+ },+ },] as const satisfies ReadonlyArray<ThemeV1>;type DefaultTheme = (typeof DEFAULT_THEMES)[number]['id'];diff --git a/js/app/packages/block-theme/signals/themeReactive.ts b/js/app/packages/block-theme/signals/themeReactive.tsindex 615627017c..2e7e929fad 100644--- a/js/app/packages/block-theme/signals/themeReactive.ts+++ b/js/app/packages/block-theme/signals/themeReactive.ts@@ -1,6 +1,6 @@-import { themeUpdate, setThemeUpdate, setIsThemeSaved } from './themeSignals';-import type { ThemeReactive, ThemePrevious } from '../types/themeTypes';import { createEffect, createSignal, on } from 'solid-js';+import type { ThemePrevious, ThemeReactive } from '../types/themeTypes';+import { setIsThemeSaved, setThemeUpdate, themeUpdate } from './themeSignals';export const themeReactive: ThemeReactive = {a0: { l: createSignal(0), c: createSignal(0), h: createSignal(0) },@@ -54,70 +54,370 @@ function jamTransition(): void {createEffect(on([- themeReactive.a0.l[0], themeReactive.a0.c[0], themeReactive.a0.h[0],- themeReactive.a1.l[0], themeReactive.a1.c[0], themeReactive.a1.h[0],- themeReactive.a2.l[0], themeReactive.a2.c[0], themeReactive.a2.h[0],- themeReactive.a3.l[0], themeReactive.a3.c[0], themeReactive.a3.h[0],- themeReactive.a4.l[0], themeReactive.a4.c[0], themeReactive.a4.h[0],- themeReactive.b0.l[0], themeReactive.b0.c[0], themeReactive.b0.h[0],- themeReactive.b1.l[0], themeReactive.b1.c[0], themeReactive.b1.h[0],- themeReactive.b2.l[0], themeReactive.b2.c[0], themeReactive.b2.h[0],- themeReactive.b3.l[0], themeReactive.b3.c[0], themeReactive.b3.h[0],- themeReactive.b4.l[0], themeReactive.b4.c[0], themeReactive.b4.h[0],- themeReactive.c0.l[0], themeReactive.c0.h[0], themeReactive.c0.c[0],- themeReactive.c1.l[0], themeReactive.c1.c[0], themeReactive.c1.h[0],- themeReactive.c2.l[0], themeReactive.c2.c[0], themeReactive.c2.h[0],- themeReactive.c3.l[0], themeReactive.c3.c[0], themeReactive.c3.h[0],- themeReactive.c4.l[0], themeReactive.c4.c[0], themeReactive.c4.h[0],+ themeReactive.a0.l[0],+ themeReactive.a0.c[0],+ themeReactive.a0.h[0],+ themeReactive.a1.l[0],+ themeReactive.a1.c[0],+ themeReactive.a1.h[0],+ themeReactive.a2.l[0],+ themeReactive.a2.c[0],+ themeReactive.a2.h[0],+ themeReactive.a3.l[0],+ themeReactive.a3.c[0],+ themeReactive.a3.h[0],+ themeReactive.a4.l[0],+ themeReactive.a4.c[0],+ themeReactive.a4.h[0],+ themeReactive.b0.l[0],+ themeReactive.b0.c[0],+ themeReactive.b0.h[0],+ themeReactive.b1.l[0],+ themeReactive.b1.c[0],+ themeReactive.b1.h[0],+ themeReactive.b2.l[0],+ themeReactive.b2.c[0],+ themeReactive.b2.h[0],+ themeReactive.b3.l[0],+ themeReactive.b3.c[0],+ themeReactive.b3.h[0],+ themeReactive.b4.l[0],+ themeReactive.b4.c[0],+ themeReactive.b4.h[0],+ themeReactive.c0.l[0],+ themeReactive.c0.h[0],+ themeReactive.c0.c[0],+ themeReactive.c1.l[0],+ themeReactive.c1.c[0],+ themeReactive.c1.h[0],+ themeReactive.c2.l[0],+ themeReactive.c2.c[0],+ themeReactive.c2.h[0],+ themeReactive.c3.l[0],+ themeReactive.c3.c[0],+ themeReactive.c3.h[0],+ themeReactive.c4.l[0],+ themeReactive.c4.c[0],+ themeReactive.c4.h[0],],() => {jamTransition();- if (themeReactive.a0.l[0]() !== previousTheme.a0.l) { document.documentElement.style.setProperty( '--a0l', `${themeReactive.a0.l[0]()}` ); previousTheme.a0.l = themeReactive.a0.l[0](); }- if (themeReactive.a0.c[0]() !== previousTheme.a0.c) { document.documentElement.style.setProperty( '--a0c', `${themeReactive.a0.c[0]()}` ); previousTheme.a0.c = themeReactive.a0.c[0](); }- if (themeReactive.a0.h[0]() !== previousTheme.a0.h) { document.documentElement.style.setProperty( '--a0h', `${themeReactive.a0.h[0]()}deg` ); previousTheme.a0.h = themeReactive.a0.h[0](); }- if (themeReactive.a1.l[0]() !== previousTheme.a1.l) { document.documentElement.style.setProperty( '--a1l', `${themeReactive.a1.l[0]()}` ); previousTheme.a1.l = themeReactive.a1.l[0](); }- if (themeReactive.a1.c[0]() !== previousTheme.a1.c) { document.documentElement.style.setProperty( '--a1c', `${themeReactive.a1.c[0]()}` ); previousTheme.a1.c = themeReactive.a1.c[0](); }- if (themeReactive.a1.h[0]() !== previousTheme.a1.h) { document.documentElement.style.setProperty( '--a1h', `${themeReactive.a1.h[0]()}deg` ); previousTheme.a1.h = themeReactive.a1.h[0](); }- if (themeReactive.a2.l[0]() !== previousTheme.a2.l) { document.documentElement.style.setProperty( '--a2l', `${themeReactive.a2.l[0]()}` ); previousTheme.a2.l = themeReactive.a2.l[0](); }- if (themeReactive.a2.c[0]() !== previousTheme.a2.c) { document.documentElement.style.setProperty( '--a2c', `${themeReactive.a2.c[0]()}` ); previousTheme.a2.c = themeReactive.a2.c[0](); }- if (themeReactive.a2.h[0]() !== previousTheme.a2.h) { document.documentElement.style.setProperty( '--a2h', `${themeReactive.a2.h[0]()}deg` ); previousTheme.a2.h = themeReactive.a2.h[0](); }- if (themeReactive.a3.l[0]() !== previousTheme.a3.l) { document.documentElement.style.setProperty( '--a3l', `${themeReactive.a3.l[0]()}` ); previousTheme.a3.l = themeReactive.a3.l[0](); }- if (themeReactive.a3.c[0]() !== previousTheme.a3.c) { document.documentElement.style.setProperty( '--a3c', `${themeReactive.a3.c[0]()}` ); previousTheme.a3.c = themeReactive.a3.c[0](); }- if (themeReactive.a3.h[0]() !== previousTheme.a3.h) { document.documentElement.style.setProperty( '--a3h', `${themeReactive.a3.h[0]()}deg` ); previousTheme.a3.h = themeReactive.a3.h[0](); }- if (themeReactive.a4.l[0]() !== previousTheme.a4.l) { document.documentElement.style.setProperty( '--a4l', `${themeReactive.a4.l[0]()}` ); previousTheme.a4.l = themeReactive.a4.l[0](); }- if (themeReactive.a4.c[0]() !== previousTheme.a4.c) { document.documentElement.style.setProperty( '--a4c', `${themeReactive.a4.c[0]()}` ); previousTheme.a4.c = themeReactive.a4.c[0](); }- if (themeReactive.a4.h[0]() !== previousTheme.a4.h) { document.documentElement.style.setProperty( '--a4h', `${themeReactive.a4.h[0]()}deg` ); previousTheme.a4.h = themeReactive.a4.h[0](); }- if (themeReactive.b0.l[0]() !== previousTheme.b0.l) { document.documentElement.style.setProperty( '--b0l', `${themeReactive.b0.l[0]()}` ); previousTheme.b0.l = themeReactive.b0.l[0](); }- if (themeReactive.b0.c[0]() !== previousTheme.b0.c) { document.documentElement.style.setProperty( '--b0c', `${themeReactive.b0.c[0]()}` ); previousTheme.b0.c = themeReactive.b0.c[0](); }- if (themeReactive.b0.h[0]() !== previousTheme.b0.h) { document.documentElement.style.setProperty( '--b0h', `${themeReactive.b0.h[0]()}deg` ); previousTheme.b0.h = themeReactive.b0.h[0](); }- if (themeReactive.b1.l[0]() !== previousTheme.b1.l) { document.documentElement.style.setProperty( '--b1l', `${themeReactive.b1.l[0]()}` ); previousTheme.b1.l = themeReactive.b1.l[0](); }- if (themeReactive.b1.c[0]() !== previousTheme.b1.c) { document.documentElement.style.setProperty( '--b1c', `${themeReactive.b1.c[0]()}` ); previousTheme.b1.c = themeReactive.b1.c[0](); }- if (themeReactive.b1.h[0]() !== previousTheme.b1.h) { document.documentElement.style.setProperty( '--b1h', `${themeReactive.b1.h[0]()}deg` ); previousTheme.b1.h = themeReactive.b1.h[0](); }- if (themeReactive.b2.l[0]() !== previousTheme.b2.l) { document.documentElement.style.setProperty( '--b2l', `${themeReactive.b2.l[0]()}` ); previousTheme.b2.l = themeReactive.b2.l[0](); }- if (themeReactive.b2.c[0]() !== previousTheme.b2.c) { document.documentElement.style.setProperty( '--b2c', `${themeReactive.b2.c[0]()}` ); previousTheme.b2.c = themeReactive.b2.c[0](); }- if (themeReactive.b2.h[0]() !== previousTheme.b2.h) { document.documentElement.style.setProperty( '--b2h', `${themeReactive.b2.h[0]()}deg` ); previousTheme.b2.h = themeReactive.b2.h[0](); }- if (themeReactive.b3.l[0]() !== previousTheme.b3.l) { document.documentElement.style.setProperty( '--b3l', `${themeReactive.b3.l[0]()}` ); previousTheme.b3.l = themeReactive.b3.l[0](); }- if (themeReactive.b3.c[0]() !== previousTheme.b3.c) { document.documentElement.style.setProperty( '--b3c', `${themeReactive.b3.c[0]()}` ); previousTheme.b3.c = themeReactive.b3.c[0](); }- if (themeReactive.b3.h[0]() !== previousTheme.b3.h) { document.documentElement.style.setProperty( '--b3h', `${themeReactive.b3.h[0]()}deg` ); previousTheme.b3.h = themeReactive.b3.h[0](); }- if (themeReactive.b4.l[0]() !== previousTheme.b4.l) { document.documentElement.style.setProperty( '--b4l', `${themeReactive.b4.l[0]()}` ); previousTheme.b4.l = themeReactive.b4.l[0](); }- if (themeReactive.b4.c[0]() !== previousTheme.b4.c) { document.documentElement.style.setProperty( '--b4c', `${themeReactive.b4.c[0]()}` ); previousTheme.b4.c = themeReactive.b4.c[0](); }- if (themeReactive.b4.h[0]() !== previousTheme.b4.h) { document.documentElement.style.setProperty( '--b4h', `${themeReactive.b4.h[0]()}deg` ); previousTheme.b4.h = themeReactive.b4.h[0](); }- if (themeReactive.c0.l[0]() !== previousTheme.c0.l) { document.documentElement.style.setProperty( '--c0l', `${themeReactive.c0.l[0]()}` ); previousTheme.c0.l = themeReactive.c0.l[0](); }- if (themeReactive.c0.c[0]() !== previousTheme.c0.c) { document.documentElement.style.setProperty( '--c0c', `${themeReactive.c0.c[0]()}` ); previousTheme.c0.c = themeReactive.c0.c[0](); }- if (themeReactive.c0.h[0]() !== previousTheme.c0.h) { document.documentElement.style.setProperty( '--c0h', `${themeReactive.c0.h[0]()}deg` ); previousTheme.c0.h = themeReactive.c0.h[0](); }- if (themeReactive.c1.l[0]() !== previousTheme.c1.l) { document.documentElement.style.setProperty( '--c1l', `${themeReactive.c1.l[0]()}` ); previousTheme.c1.l = themeReactive.c1.l[0](); }- if (themeReactive.c1.c[0]() !== previousTheme.c1.c) { document.documentElement.style.setProperty( '--c1c', `${themeReactive.c1.c[0]()}` ); previousTheme.c1.c = themeReactive.c1.c[0](); }- if (themeReactive.c1.h[0]() !== previousTheme.c1.h) { document.documentElement.style.setProperty( '--c1h', `${themeReactive.c1.h[0]()}deg` ); previousTheme.c1.h = themeReactive.c1.h[0](); }- if (themeReactive.c2.l[0]() !== previousTheme.c2.l) { document.documentElement.style.setProperty( '--c2l', `${themeReactive.c2.l[0]()}` ); previousTheme.c2.l = themeReactive.c2.l[0](); }- if (themeReactive.c2.c[0]() !== previousTheme.c2.c) { document.documentElement.style.setProperty( '--c2c', `${themeReactive.c2.c[0]()}` ); previousTheme.c2.c = themeReactive.c2.c[0](); }- if (themeReactive.c2.h[0]() !== previousTheme.c2.h) { document.documentElement.style.setProperty( '--c2h', `${themeReactive.c2.h[0]()}deg` ); previousTheme.c2.h = themeReactive.c2.h[0](); }- if (themeReactive.c3.l[0]() !== previousTheme.c3.l) { document.documentElement.style.setProperty( '--c3l', `${themeReactive.c3.l[0]()}` ); previousTheme.c3.l = themeReactive.c3.l[0](); }- if (themeReactive.c3.c[0]() !== previousTheme.c3.c) { document.documentElement.style.setProperty( '--c3c', `${themeReactive.c3.c[0]()}` ); previousTheme.c3.c = themeReactive.c3.c[0](); }- if (themeReactive.c3.h[0]() !== previousTheme.c3.h) { document.documentElement.style.setProperty( '--c3h', `${themeReactive.c3.h[0]()}deg` ); previousTheme.c3.h = themeReactive.c3.h[0](); }- if (themeReactive.c4.l[0]() !== previousTheme.c4.l) { document.documentElement.style.setProperty( '--c4l', `${themeReactive.c4.l[0]()}` ); previousTheme.c4.l = themeReactive.c4.l[0](); }- if (themeReactive.c4.c[0]() !== previousTheme.c4.c) { document.documentElement.style.setProperty( '--c4c', `${themeReactive.c4.c[0]()}` ); previousTheme.c4.c = themeReactive.c4.c[0](); }- if (themeReactive.c4.h[0]() !== previousTheme.c4.h) { document.documentElement.style.setProperty( '--c4h', `${themeReactive.c4.h[0]()}deg` ); previousTheme.c4.h = themeReactive.c4.h[0](); }+ if (themeReactive.a0.l[0]() !== previousTheme.a0.l) {+ document.documentElement.style.setProperty(+ '--a0l',+ `${themeReactive.a0.l[0]()}`+ );+ previousTheme.a0.l = themeReactive.a0.l[0]();+ }+ if (themeReactive.a0.c[0]() !== previousTheme.a0.c) {+ document.documentElement.style.setProperty(+ '--a0c',+ `${themeReactive.a0.c[0]()}`+ );+ previousTheme.a0.c = themeReactive.a0.c[0]();+ }+ if (themeReactive.a0.h[0]() !== previousTheme.a0.h) {+ document.documentElement.style.setProperty(+ '--a0h',+ `${themeReactive.a0.h[0]()}deg`+ );+ previousTheme.a0.h = themeReactive.a0.h[0]();+ }+ if (themeReactive.a1.l[0]() !== previousTheme.a1.l) {+ document.documentElement.style.setProperty(+ '--a1l',+ `${themeReactive.a1.l[0]()}`+ );+ previousTheme.a1.l = themeReactive.a1.l[0]();+ }+ if (themeReactive.a1.c[0]() !== previousTheme.a1.c) {+ document.documentElement.style.setProperty(+ '--a1c',+ `${themeReactive.a1.c[0]()}`+ );+ previousTheme.a1.c = themeReactive.a1.c[0]();+ }+ if (themeReactive.a1.h[0]() !== previousTheme.a1.h) {+ document.documentElement.style.setProperty(+ '--a1h',+ `${themeReactive.a1.h[0]()}deg`+ );+ previousTheme.a1.h = themeReactive.a1.h[0]();+ }+ if (themeReactive.a2.l[0]() !== previousTheme.a2.l) {+ document.documentElement.style.setProperty(+ '--a2l',+ `${themeReactive.a2.l[0]()}`+ );+ previousTheme.a2.l = themeReactive.a2.l[0]();+ }+ if (themeReactive.a2.c[0]() !== previousTheme.a2.c) {+ document.documentElement.style.setProperty(+ '--a2c',+ `${themeReactive.a2.c[0]()}`+ );+ previousTheme.a2.c = themeReactive.a2.c[0]();+ }+ if (themeReactive.a2.h[0]() !== previousTheme.a2.h) {+ document.documentElement.style.setProperty(+ '--a2h',+ `${themeReactive.a2.h[0]()}deg`+ );+ previousTheme.a2.h = themeReactive.a2.h[0]();+ }+ if (themeReactive.a3.l[0]() !== previousTheme.a3.l) {+ document.documentElement.style.setProperty(+ '--a3l',+ `${themeReactive.a3.l[0]()}`+ );+ previousTheme.a3.l = themeReactive.a3.l[0]();+ }+ if (themeReactive.a3.c[0]() !== previousTheme.a3.c) {+ document.documentElement.style.setProperty(+ '--a3c',+ `${themeReactive.a3.c[0]()}`+ );+ previousTheme.a3.c = themeReactive.a3.c[0]();+ }+ if (themeReactive.a3.h[0]() !== previousTheme.a3.h) {+ document.documentElement.style.setProperty(+ '--a3h',+ `${themeReactive.a3.h[0]()}deg`+ );+ previousTheme.a3.h = themeReactive.a3.h[0]();+ }+ if (themeReactive.a4.l[0]() !== previousTheme.a4.l) {+ document.documentElement.style.setProperty(+ '--a4l',+ `${themeReactive.a4.l[0]()}`+ );+ previousTheme.a4.l = themeReactive.a4.l[0]();+ }+ if (themeReactive.a4.c[0]() !== previousTheme.a4.c) {+ document.documentElement.style.setProperty(+ '--a4c',+ `${themeReactive.a4.c[0]()}`+ );+ previousTheme.a4.c = themeReactive.a4.c[0]();+ }+ if (themeReactive.a4.h[0]() !== previousTheme.a4.h) {+ document.documentElement.style.setProperty(+ '--a4h',+ `${themeReactive.a4.h[0]()}deg`+ );+ previousTheme.a4.h = themeReactive.a4.h[0]();+ }+ if (themeReactive.b0.l[0]() !== previousTheme.b0.l) {+ document.documentElement.style.setProperty(+ '--b0l',+ `${themeReactive.b0.l[0]()}`+ );+ previousTheme.b0.l = themeReactive.b0.l[0]();+ }+ if (themeReactive.b0.c[0]() !== previousTheme.b0.c) {+ document.documentElement.style.setProperty(+ '--b0c',+ `${themeReactive.b0.c[0]()}`+ );+ previousTheme.b0.c = themeReactive.b0.c[0]();+ }+ if (themeReactive.b0.h[0]() !== previousTheme.b0.h) {+ document.documentElement.style.setProperty(+ '--b0h',+ `${themeReactive.b0.h[0]()}deg`+ );+ previousTheme.b0.h = themeReactive.b0.h[0]();+ }+ if (themeReactive.b1.l[0]() !== previousTheme.b1.l) {+ document.documentElement.style.setProperty(+ '--b1l',+ `${themeReactive.b1.l[0]()}`+ );+ previousTheme.b1.l = themeReactive.b1.l[0]();+ }+ if (themeReactive.b1.c[0]() !== previousTheme.b1.c) {+ document.documentElement.style.setProperty(+ '--b1c',+ `${themeReactive.b1.c[0]()}`+ );+ previousTheme.b1.c = themeReactive.b1.c[0]();+ }+ if (themeReactive.b1.h[0]() !== previousTheme.b1.h) {+ document.documentElement.style.setProperty(+ '--b1h',+ `${themeReactive.b1.h[0]()}deg`+ );+ previousTheme.b1.h = themeReactive.b1.h[0]();+ }+ if (themeReactive.b2.l[0]() !== previousTheme.b2.l) {+ document.documentElement.style.setProperty(+ '--b2l',+ `${themeReactive.b2.l[0]()}`+ );+ previousTheme.b2.l = themeReactive.b2.l[0]();+ }+ if (themeReactive.b2.c[0]() !== previousTheme.b2.c) {+ document.documentElement.style.setProperty(+ '--b2c',+ `${themeReactive.b2.c[0]()}`+ );+ previousTheme.b2.c = themeReactive.b2.c[0]();+ }+ if (themeReactive.b2.h[0]() !== previousTheme.b2.h) {+ document.documentElement.style.setProperty(+ '--b2h',+ `${themeReactive.b2.h[0]()}deg`+ );+ previousTheme.b2.h = themeReactive.b2.h[0]();+ }+ if (themeReactive.b3.l[0]() !== previousTheme.b3.l) {+ document.documentElement.style.setProperty(+ '--b3l',+ `${themeReactive.b3.l[0]()}`+ );+ previousTheme.b3.l = themeReactive.b3.l[0]();+ }+ if (themeReactive.b3.c[0]() !== previousTheme.b3.c) {+ document.documentElement.style.setProperty(+ '--b3c',+ `${themeReactive.b3.c[0]()}`+ );+ previousTheme.b3.c = themeReactive.b3.c[0]();+ }+ if (themeReactive.b3.h[0]() !== previousTheme.b3.h) {+ document.documentElement.style.setProperty(+ '--b3h',+ `${themeReactive.b3.h[0]()}deg`+ );+ previousTheme.b3.h = themeReactive.b3.h[0]();+ }+ if (themeReactive.b4.l[0]() !== previousTheme.b4.l) {+ document.documentElement.style.setProperty(+ '--b4l',+ `${themeReactive.b4.l[0]()}`+ );+ previousTheme.b4.l = themeReactive.b4.l[0]();+ }+ if (themeReactive.b4.c[0]() !== previousTheme.b4.c) {+ document.documentElement.style.setProperty(+ '--b4c',+ `${themeReactive.b4.c[0]()}`+ );+ previousTheme.b4.c = themeReactive.b4.c[0]();+ }+ if (themeReactive.b4.h[0]() !== previousTheme.b4.h) {+ document.documentElement.style.setProperty(+ '--b4h',+ `${themeReactive.b4.h[0]()}deg`+ );+ previousTheme.b4.h = themeReactive.b4.h[0]();+ }+ if (themeReactive.c0.l[0]() !== previousTheme.c0.l) {+ document.documentElement.style.setProperty(+ '--c0l',+ `${themeReactive.c0.l[0]()}`+ );+ previousTheme.c0.l = themeReactive.c0.l[0]();+ }+ if (themeReactive.c0.c[0]() !== previousTheme.c0.c) {+ document.documentElement.style.setProperty(+ '--c0c',+ `${themeReactive.c0.c[0]()}`+ );+ previousTheme.c0.c = themeReactive.c0.c[0]();+ }+ if (themeReactive.c0.h[0]() !== previousTheme.c0.h) {+ document.documentElement.style.setProperty(+ '--c0h',+ `${themeReactive.c0.h[0]()}deg`+ );+ previousTheme.c0.h = themeReactive.c0.h[0]();+ }+ if (themeReactive.c1.l[0]() !== previousTheme.c1.l) {+ document.documentElement.style.setProperty(+ '--c1l',+ `${themeReactive.c1.l[0]()}`+ );+ previousTheme.c1.l = themeReactive.c1.l[0]();+ }+ if (themeReactive.c1.c[0]() !== previousTheme.c1.c) {+ document.documentElement.style.setProperty(+ '--c1c',+ `${themeReactive.c1.c[0]()}`+ );+ previousTheme.c1.c = themeReactive.c1.c[0]();+ }+ if (themeReactive.c1.h[0]() !== previousTheme.c1.h) {+ document.documentElement.style.setProperty(+ '--c1h',+ `${themeReactive.c1.h[0]()}deg`+ );+ previousTheme.c1.h = themeReactive.c1.h[0]();+ }+ if (themeReactive.c2.l[0]() !== previousTheme.c2.l) {+ document.documentElement.style.setProperty(+ '--c2l',+ `${themeReactive.c2.l[0]()}`+ );+ previousTheme.c2.l = themeReactive.c2.l[0]();+ }+ if (themeReactive.c2.c[0]() !== previousTheme.c2.c) {+ document.documentElement.style.setProperty(+ '--c2c',+ `${themeReactive.c2.c[0]()}`+ );+ previousTheme.c2.c = themeReactive.c2.c[0]();+ }+ if (themeReactive.c2.h[0]() !== previousTheme.c2.h) {+ document.documentElement.style.setProperty(+ '--c2h',+ `${themeReactive.c2.h[0]()}deg`+ );+ previousTheme.c2.h = themeReactive.c2.h[0]();+ }+ if (themeReactive.c3.l[0]() !== previousTheme.c3.l) {+ document.documentElement.style.setProperty(+ '--c3l',+ `${themeReactive.c3.l[0]()}`+ );+ previousTheme.c3.l = themeReactive.c3.l[0]();+ }+ if (themeReactive.c3.c[0]() !== previousTheme.c3.c) {+ document.documentElement.style.setProperty(+ '--c3c',+ `${themeReactive.c3.c[0]()}`+ );+ previousTheme.c3.c = themeReactive.c3.c[0]();+ }+ if (themeReactive.c3.h[0]() !== previousTheme.c3.h) {+ document.documentElement.style.setProperty(+ '--c3h',+ `${themeReactive.c3.h[0]()}deg`+ );+ previousTheme.c3.h = themeReactive.c3.h[0]();+ }+ if (themeReactive.c4.l[0]() !== previousTheme.c4.l) {+ document.documentElement.style.setProperty(+ '--c4l',+ `${themeReactive.c4.l[0]()}`+ );+ previousTheme.c4.l = themeReactive.c4.l[0]();+ }+ if (themeReactive.c4.c[0]() !== previousTheme.c4.c) {+ document.documentElement.style.setProperty(+ '--c4c',+ `${themeReactive.c4.c[0]()}`+ );+ previousTheme.c4.c = themeReactive.c4.c[0]();+ }+ if (themeReactive.c4.h[0]() !== previousTheme.c4.h) {+ document.documentElement.style.setProperty(+ '--c4h',+ `${themeReactive.c4.h[0]()}deg`+ );+ previousTheme.c4.h = themeReactive.c4.h[0]();+ }setThemeUpdate(themeUpdate() * -1);setIsThemeSaved(false);diff --git a/js/app/packages/block-theme/signals/themeSignals.ts b/js/app/packages/block-theme/signals/themeSignals.tsindex 5ebfbea32b..16eb03f5e1 100644--- a/js/app/packages/block-theme/signals/themeSignals.ts+++ b/js/app/packages/block-theme/signals/themeSignals.ts@@ -1,8 +1,12 @@+import { makePersisted } from '@solid-primitives/storage';import { createEffect, createMemo, createSignal } from 'solid-js';-import { convertThemev0v1 } from '../utils/themeMigrations';+import {+ DEFAULT_DARK_THEME,+ DEFAULT_LIGHT_THEME,+ DEFAULT_THEMES,+} from '../constants';import type { ThemeV0, ThemeV1 } from '../types/themeTypes';-import { makePersisted } from '@solid-primitives/storage';-import { DEFAULT_DARK_THEME, DEFAULT_LIGHT_THEME, DEFAULT_THEMES } from '../constants';+import { convertThemev0v1 } from '../utils/themeMigrations';export const [isThemeSaved, setIsThemeSaved] = createSignal<boolean>(true);@@ -13,17 +17,26 @@ export const [htmlColor, setHtmlColor] = makePersisted({ name: 'html-color-theme' });-export const [userThemes, setUserThemes] = makePersisted(createSignal<ThemeV1[]>([]), {name: 'macro-user-themes'});+export const [userThemes, setUserThemes] = makePersisted(+ createSignal<ThemeV1[]>([]),+ { name: 'macro-user-themes' }+);setUserThemes(userThemes().map((theme) => {- if (!theme.version) { return convertThemev0v1(theme as unknown as ThemeV0) }- else { return theme }+ if (!theme.version) {+ return convertThemev0v1(theme as unknown as ThemeV0);+ } else {+ return theme;+ }}));let convertedDefaultThemes = DEFAULT_THEMES.map((theme) => {- if (!theme.version) { return convertThemev0v1(theme as unknown as ThemeV0) }- else { return theme }+ if (!theme.version) {+ return convertThemev0v1(theme as unknown as ThemeV0);+ } else {+ return theme;+ }});export const [currentThemeId, setCurrentThemeId_] = makePersisted(@@ -33,12 +46,16 @@ export const [currentThemeId, setCurrentThemeId_] = makePersisted(// If theme should match system, when we set current theme, we also set the corresponding mode's theme// This avoids the issue where a user sets a theme, and then refreshes, and gets reverted to their preferred mode's theme.-export const setCurrentThemeId = (...args: Parameters<typeof setCurrentThemeId_>) => {+export const setCurrentThemeId = (+ ...args: Parameters<typeof setCurrentThemeId_>+) => {setCurrentThemeId_(...args);if (themeShouldMatchSystem()) {- systemMode() === 'dark' ? setDarkModeTheme(...args) : setLightModeTheme(...args);+ systemMode() === 'dark'+ ? setDarkModeTheme(...args)+ : setLightModeTheme(...args);}-}+};export const themes = createMemo(() => [...convertedDefaultThemes,@@ -55,12 +72,14 @@ export const [darkModeTheme, setDarkModeTheme] = makePersisted({ name: 'macro-dark-mode-theme' });-export const [themeShouldMatchSystem, setThemeShouldMatchSystem] = makePersisted(- createSignal<boolean>(true),- {name: 'macro-theme-should-match-system'}-);+export const [themeShouldMatchSystem, setThemeShouldMatchSystem] =+ makePersisted(createSignal<boolean>(true), {+ name: 'macro-theme-should-match-system',+ });-export const [systemMode, setSystemMode] = createSignal<'dark' | 'light'>(window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');+export const [systemMode, setSystemMode] = createSignal<'dark' | 'light'>(+ window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'+);const darkModeQuery = window.matchMedia('(prefers-color-scheme: dark)');darkModeQuery.addEventListener('change', (e: MediaQueryListEvent) => {@@ -74,30 +93,62 @@ export const [monochromeIcons, setMonochromeIcons] = makePersisted(createEffect(() => {if (monochromeIcons()) {- document.documentElement.style.setProperty( '--theme-contact', 'var(--c0)' );- document.documentElement.style.setProperty( '--theme-canvas' , 'var(--c0)' );- document.documentElement.style.setProperty( '--theme-folder' , 'var(--c0)' );- document.documentElement.style.setProperty( '--theme-image' , 'var(--c0)' );- document.documentElement.style.setProperty( '--theme-write' , 'var(--c0)' );- document.documentElement.style.setProperty( '--theme-video' , 'var(--c0)' );- document.documentElement.style.setProperty( '--theme-html' , 'var(--c0)' );- document.documentElement.style.setProperty( '--theme-note' , 'var(--c0)' );- document.documentElement.style.setProperty( '--theme-code' , 'var(--c0)' );- document.documentElement.style.setProperty( '--theme-chat' , 'var(--c0)' );- document.documentElement.style.setProperty( '--theme-pdf' , 'var(--c0)' );- document.documentElement.style.setProperty( '--theme-rss' , 'var(--c0)' );- }- else {- document.documentElement.style.setProperty( '--theme-folder', 'oklch(var(--a0l) var(--a0c) 240)' );- document.documentElement.style.setProperty( '--theme-canvas', 'oklch(var(--a0l) var(--a0c) 60)' );- document.documentElement.style.setProperty( '--theme-write' , 'oklch(var(--a0l) var(--a0c) 260)' );- document.documentElement.style.setProperty( '--theme-video' , 'oklch(var(--a0l) var(--a0c) 277)' );- document.documentElement.style.setProperty( '--theme-note' , 'oklch(var(--a0l) var(--a0c) 293)' );- document.documentElement.style.setProperty( '--theme-code' , 'oklch(var(--a0l) var(--a0c) 162)' );- document.documentElement.style.setProperty( '--theme-chat' , 'oklch(var(--a0l) var(--a0c) 220)' );- document.documentElement.style.setProperty( '--theme-image' , 'oklch(var(--a0l) var(--a0c) 95)' );- document.documentElement.style.setProperty( '--theme-html' , 'oklch(var(--a0l) var(--a0c) 47)' );- document.documentElement.style.setProperty( '--theme-rss' , 'oklch(var(--a0l) var(--a0c) 260)' );- document.documentElement.style.setProperty( '--theme-pdf' , 'oklch(var(--a0l) var(--a0c) 25)' );+ document.documentElement.style.setProperty('--theme-contact', 'var(--c0)');+ document.documentElement.style.setProperty('--theme-canvas', 'var(--c0)');+ document.documentElement.style.setProperty('--theme-folder', 'var(--c0)');+ document.documentElement.style.setProperty('--theme-image', 'var(--c0)');+ document.documentElement.style.setProperty('--theme-write', 'var(--c0)');+ document.documentElement.style.setProperty('--theme-video', 'var(--c0)');+ document.documentElement.style.setProperty('--theme-html', 'var(--c0)');+ document.documentElement.style.setProperty('--theme-note', 'var(--c0)');+ document.documentElement.style.setProperty('--theme-code', 'var(--c0)');+ document.documentElement.style.setProperty('--theme-chat', 'var(--c0)');+ document.documentElement.style.setProperty('--theme-pdf', 'var(--c0)');+ document.documentElement.style.setProperty('--theme-rss', 'var(--c0)');+ } else {+ document.documentElement.style.setProperty(+ '--theme-folder',+ 'oklch(var(--a0l) var(--a0c) 240)'+ );+ document.documentElement.style.setProperty(+ '--theme-canvas',+ 'oklch(var(--a0l) var(--a0c) 60)'+ );+ document.documentElement.style.setProperty(+ '--theme-write',+ 'oklch(var(--a0l) var(--a0c) 260)'+ );+ document.documentElement.style.setProperty(+ '--theme-video',+ 'oklch(var(--a0l) var(--a0c) 277)'+ );+ document.documentElement.style.setProperty(+ '--theme-note',+ 'oklch(var(--a0l) var(--a0c) 293)'+ );+ document.documentElement.style.setProperty(+ '--theme-code',+ 'oklch(var(--a0l) var(--a0c) 162)'+ );+ document.documentElement.style.setProperty(+ '--theme-chat',+ 'oklch(var(--a0l) var(--a0c) 220)'+ );+ document.documentElement.style.setProperty(+ '--theme-image',+ 'oklch(var(--a0l) var(--a0c) 95)'+ );+ document.documentElement.style.setProperty(+ '--theme-html',+ 'oklch(var(--a0l) var(--a0c) 47)'+ );+ document.documentElement.style.setProperty(+ '--theme-rss',+ 'oklch(var(--a0l) var(--a0c) 260)'+ );+ document.documentElement.style.setProperty(+ '--theme-pdf',+ 'oklch(var(--a0l) var(--a0c) 25)'+ );}});diff --git a/js/app/packages/block-theme/utils/themeMigrations.ts b/js/app/packages/block-theme/utils/themeMigrations.tsindex 4b163e2797..c69152e6dc 100644--- a/js/app/packages/block-theme/utils/themeMigrations.ts+++ b/js/app/packages/block-theme/utils/themeMigrations.ts@@ -6,21 +6,81 @@ export function convertThemev0v1(theme: ThemeV0): ThemeV1 {name: theme.name,version: 1,tokens: {- a0: { l: theme.specification['--accent-l' ], c: theme.specification['--accent-c' ], h: (theme.specification['--accent-h' ] + 30) % 360 },- a1: { l: theme.specification['--accent-l' ], c: theme.specification['--accent-c' ], h: (theme.specification['--accent-h' ] + 30) % 360 },- a2: { l: theme.specification['--accent-l' ], c: theme.specification['--accent-c' ], h: (theme.specification['--accent-h' ] + 30) % 360 },- a3: { l: theme.specification['--accent-l' ], c: theme.specification['--accent-c' ], h: (theme.specification['--accent-h' ] + 30) % 360 },- a4: { l: theme.specification['--accent-l' ], c: theme.specification['--accent-c' ], h: (theme.specification['--accent-h' ] + 30) % 360 },- b0: { l: theme.specification['--surface-l' ], c: theme.specification['--surface-c' ], h: theme.specification['--surface-h' ] },- b1: { l: theme.specification['--surface-l-1' ], c: theme.specification['--surface-c' ], h: theme.specification['--surface-h' ] },- b2: { l: theme.specification['--surface-l-2' ], c: theme.specification['--surface-c' ], h: theme.specification['--surface-h' ] },- b3: { l: theme.specification['--surface-l-3' ], c: theme.specification['--surface-c' ], h: theme.specification['--surface-h' ] },- b4: { l: theme.specification['--surface-l-4' ], c: theme.specification['--surface-c' ], h: theme.specification['--surface-h' ] },- c0: { l: theme.specification['--contrast-l' ], c: theme.specification['--contrast-c'], h: theme.specification['--contrast-h'] },- c1: { l: theme.specification['--contrast-l-1'], c: theme.specification['--contrast-c'], h: theme.specification['--contrast-h'] },- c2: { l: theme.specification['--contrast-l-2'], c: theme.specification['--contrast-c'], h: theme.specification['--contrast-h'] },- c3: { l: theme.specification['--contrast-l-3'], c: theme.specification['--contrast-c'], h: theme.specification['--contrast-h'] },- c4: { l: theme.specification['--contrast-l-4'], c: theme.specification['--contrast-c'], h: theme.specification['--contrast-h'] },+ a0: {+ l: theme.specification['--accent-l'],+ c: theme.specification['--accent-c'],+ h: (theme.specification['--accent-h'] + 30) % 360,+ },+ a1: {+ l: theme.specification['--accent-l'],+ c: theme.specification['--accent-c'],+ h: (theme.specification['--accent-h'] + 30) % 360,+ },+ a2: {+ l: theme.specification['--accent-l'],+ c: theme.specification['--accent-c'],+ h: (theme.specification['--accent-h'] + 30) % 360,+ },+ a3: {+ l: theme.specification['--accent-l'],+ c: theme.specification['--accent-c'],+ h: (theme.specification['--accent-h'] + 30) % 360,+ },+ a4: {+ l: theme.specification['--accent-l'],+ c: theme.specification['--accent-c'],+ h: (theme.specification['--accent-h'] + 30) % 360,+ },+ b0: {+ l: theme.specification['--surface-l'],+ c: theme.specification['--surface-c'],+ h: theme.specification['--surface-h'],+ },+ b1: {+ l: theme.specification['--surface-l-1'],+ c: theme.specification['--surface-c'],+ h: theme.specification['--surface-h'],+ },+ b2: {+ l: theme.specification['--surface-l-2'],+ c: theme.specification['--surface-c'],+ h: theme.specification['--surface-h'],+ },+ b3: {+ l: theme.specification['--surface-l-3'],+ c: theme.specification['--surface-c'],+ h: theme.specification['--surface-h'],+ },+ b4: {+ l: theme.specification['--surface-l-4'],+ c: theme.specification['--surface-c'],+ h: theme.specification['--surface-h'],+ },+ c0: {+ l: theme.specification['--contrast-l'],+ c: theme.specification['--contrast-c'],+ h: theme.specification['--contrast-h'],+ },+ c1: {+ l: theme.specification['--contrast-l-1'],+ c: theme.specification['--contrast-c'],+ h: theme.specification['--contrast-h'],+ },+ c2: {+ l: theme.specification['--contrast-l-2'],+ c: theme.specification['--contrast-c'],+ h: theme.specification['--contrast-h'],+ },+ c3: {+ l: theme.specification['--contrast-l-3'],+ c: theme.specification['--contrast-c'],+ h: theme.specification['--contrast-h'],+ },+ c4: {+ l: theme.specification['--contrast-l-4'],+ c: theme.specification['--contrast-c'],+ h: theme.specification['--contrast-h'],+ },},};}diff --git a/js/app/packages/block-theme/utils/themeUtils.ts b/js/app/packages/block-theme/utils/themeUtils.tsindex 38ebe05ac8..05452e64ed 100644--- a/js/app/packages/block-theme/utils/themeUtils.ts+++ b/js/app/packages/block-theme/utils/themeUtils.ts@@ -1,23 +1,42 @@-import { themes, currentThemeId, setCurrentThemeId, setIsThemeSaved, userThemes, setUserThemes, themeShouldMatchSystem, systemMode, lightModeTheme, darkModeTheme } from '../signals/themeSignals';-import type { ThemeV1, ThemeV1Tokens } from '../types/themeTypes';-import { themeReactive } from '../signals/themeReactive';-import { setHtmlColor } from '../signals/themeSignals';+import { toast } from '@core/component/Toast/Toast';import { batch, createEffect, on } from 'solid-js';import { DEFAULT_DARK_THEME } from '../constants';-import { toast } from '@core/component/Toast/Toast';+import { themeReactive } from '../signals/themeReactive';+import {+ currentThemeId,+ darkModeTheme,+ lightModeTheme,+ setCurrentThemeId,+ setHtmlColor,+ setIsThemeSaved,+ setUserThemes,+ systemMode,+ themeShouldMatchSystem,+ themes,+ userThemes,+} from '../signals/themeSignals';+import type { ThemeV1, ThemeV1Tokens } from '../types/themeTypes';-export function exportTheme(){+export function exportTheme() {let id = currentThemeId();let theme = JSON.stringify(themes().find((t) => t.id === id));navigator.clipboard.writeText(theme);}export function systemThemeEffect() {- createEffect(on([themeShouldMatchSystem, systemMode, darkModeTheme, lightModeTheme], () => {- if (themeShouldMatchSystem()) {- applyTheme(systemMode() === 'dark' ? darkModeTheme() : lightModeTheme());- }- }, {defer: true}))+ createEffect(+ on(+ [themeShouldMatchSystem, systemMode, darkModeTheme, lightModeTheme],+ () => {+ if (themeShouldMatchSystem()) {+ applyTheme(+ systemMode() === 'dark' ? darkModeTheme() : lightModeTheme()+ );+ }+ },+ { defer: true }+ )+ );}export function applyTheme(id: string): void {@@ -38,9 +57,12 @@ export function applyTheme(id: string): void {});});- queueMicrotask(() => { /* scuffed af */+ queueMicrotask(() => {+ /* scuffed af */setIsThemeSaved(true);- setHtmlColor({ color: `oklch(${themeReactive.b0.l[0]()} ${themeReactive.b0.c[0]()} ${themeReactive.b0.h[0]()}deg)` });+ setHtmlColor({+ color: `oklch(${themeReactive.b0.l[0]()} ${themeReactive.b0.c[0]()} ${themeReactive.b0.h[0]()}deg)`,+ });});});}@@ -62,21 +84,81 @@ export function invertTheme(): void {function getCurrentTokens(): ThemeV1Tokens {const themeTokens: ThemeV1Tokens = {- a0: { l: themeReactive.a0.l[0](), c: themeReactive.a0.c[0](), h: themeReactive.a0.h[0]() },- a1: { l: themeReactive.a1.l[0](), c: themeReactive.a1.c[0](), h: themeReactive.a1.h[0]() },- a2: { l: themeReactive.a2.l[0](), c: themeReactive.a2.c[0](), h: themeReactive.a2.h[0]() },- a3: { l: themeReactive.a3.l[0](), c: themeReactive.a3.c[0](), h: themeReactive.a3.h[0]() },- a4: { l: themeReactive.a4.l[0](), c: themeReactive.a4.c[0](), h: themeReactive.a4.h[0]() },- b0: { l: themeReactive.b0.l[0](), c: themeReactive.b0.c[0](), h: themeReactive.b0.h[0]() },- b1: { l: themeReactive.b1.l[0](), c: themeReactive.b1.c[0](), h: themeReactive.b1.h[0]() },- b2: { l: themeReactive.b2.l[0](), c: themeReactive.b2.c[0](), h: themeReactive.b2.h[0]() },- b3: { l: themeReactive.b3.l[0](), c: themeReactive.b3.c[0](), h: themeReactive.b3.h[0]() },- b4: { l: themeReactive.b4.l[0](), c: themeReactive.b4.c[0](), h: themeReactive.b4.h[0]() },- c0: { l: themeReactive.c0.l[0](), c: themeReactive.c0.c[0](), h: themeReactive.c0.h[0]() },- c1: { l: themeReactive.c1.l[0](), c: themeReactive.c1.c[0](), h: themeReactive.c1.h[0]() },- c2: { l: themeReactive.c2.l[0](), c: themeReactive.c2.c[0](), h: themeReactive.c2.h[0]() },- c3: { l: themeReactive.c3.l[0](), c: themeReactive.c3.c[0](), h: themeReactive.c3.h[0]() },- c4: { l: themeReactive.c4.l[0](), c: themeReactive.c4.c[0](), h: themeReactive.c4.h[0]() }+ a0: {+ l: themeReactive.a0.l[0](),+ c: themeReactive.a0.c[0](),+ h: themeReactive.a0.h[0](),+ },+ a1: {+ l: themeReactive.a1.l[0](),+ c: themeReactive.a1.c[0](),+ h: themeReactive.a1.h[0](),+ },+ a2: {+ l: themeReactive.a2.l[0](),+ c: themeReactive.a2.c[0](),+ h: themeReactive.a2.h[0](),+ },+ a3: {+ l: themeReactive.a3.l[0](),+ c: themeReactive.a3.c[0](),+ h: themeReactive.a3.h[0](),+ },+ a4: {+ l: themeReactive.a4.l[0](),+ c: themeReactive.a4.c[0](),+ h: themeReactive.a4.h[0](),+ },+ b0: {+ l: themeReactive.b0.l[0](),+ c: themeReactive.b0.c[0](),+ h: themeReactive.b0.h[0](),+ },+ b1: {+ l: themeReactive.b1.l[0](),+ c: themeReactive.b1.c[0](),+ h: themeReactive.b1.h[0](),+ },+ b2: {+ l: themeReactive.b2.l[0](),+ c: themeReactive.b2.c[0](),+ h: themeReactive.b2.h[0](),+ },+ b3: {+ l: themeReactive.b3.l[0](),+ c: themeReactive.b3.c[0](),+ h: themeReactive.b3.h[0](),+ },+ b4: {+ l: themeReactive.b4.l[0](),+ c: themeReactive.b4.c[0](),+ h: themeReactive.b4.h[0](),+ },+ c0: {+ l: themeReactive.c0.l[0](),+ c: themeReactive.c0.c[0](),+ h: themeReactive.c0.h[0](),+ },+ c1: {+ l: themeReactive.c1.l[0](),+ c: themeReactive.c1.c[0](),+ h: themeReactive.c1.h[0](),+ },+ c2: {+ l: themeReactive.c2.l[0](),+ c: themeReactive.c2.c[0](),+ h: themeReactive.c2.h[0](),+ },+ c3: {+ l: themeReactive.c3.l[0](),+ c: themeReactive.c3.c[0](),+ h: themeReactive.c3.h[0](),+ },+ c4: {+ l: themeReactive.c4.l[0](),+ c: themeReactive.c4.c[0](),+ h: themeReactive.c4.h[0](),+ },};return themeTokens;}@@ -106,10 +188,11 @@ export function ensureMinimalThemeContrast() {const spec = themes().find((t) => t.id === currentThemeId())?.tokens;if (!spec) return;// Check if the contrast is too low, so that users can't get stuck with an unreadable theme- const lowContrastTheme =- Math.abs((spec.c0.l) - (spec.b0.l)) < 0.2;+ const lowContrastTheme = Math.abs(spec.c0.l - spec.b0.l) < 0.2;if (lowContrastTheme) {applyTheme(DEFAULT_DARK_THEME);- toast.alert('Tried to load a theme with low contrast, applying a readable theme.');+ toast.alert(+ 'Tried to load a theme with low contrast, applying a readable theme.'+ );}}diff --git a/js/app/packages/core/component/AI/component/input/useChatInput.tsx b/js/app/packages/core/component/AI/component/input/useChatInput.tsxindex 47b017d660..434b5dbd81 100644--- a/js/app/packages/core/component/AI/component/input/useChatInput.tsx+++ b/js/app/packages/core/component/AI/component/input/useChatInput.tsx@@ -21,7 +21,7 @@ import { isMobileWidth } from '@core/mobile/mobileWidth';import PlusIcon from '@icon/regular/plus.svg';import XIcon from '@icon/regular/x.svg';import { createCallback } from '@solid-primitives/rootless';-import { LexicalEditor } from 'lexical';+import type { LexicalEditor } from 'lexical';import type { Accessor, Component, Setter } from 'solid-js';import { createEffect, createSignal, Match, Show, Switch } from 'solid-js';import { ActiveTabAttachment } from './ActiveTabAttachment';diff --git a/js/app/packages/core/component/AI/component/input/useChatMarkdownArea.tsx b/js/app/packages/core/component/AI/component/input/useChatMarkdownArea.tsxindex 2c0a0aac8e..9c8ac55ad0 100644--- a/js/app/packages/core/component/AI/component/input/useChatMarkdownArea.tsx+++ b/js/app/packages/core/component/AI/component/input/useChatMarkdownArea.tsx@@ -58,7 +58,7 @@ import {COMMAND_PRIORITY_HIGH,FORMAT_TEXT_COMMAND,KEY_ENTER_COMMAND,- LexicalEditor,+ type LexicalEditor,type TextFormatType,} from 'lexical';import {diff --git a/js/app/packages/core/component/ItemPreview.tsx b/js/app/packages/core/component/ItemPreview.tsxindex 56895b49cf..f3ca00b462 100644--- a/js/app/packages/core/component/ItemPreview.tsx+++ b/js/app/packages/core/component/ItemPreview.tsx@@ -2,6 +2,7 @@ import { fileTypeToBlockName } from '@core/constant/allBlocks';import { isAccessiblePreviewItem, useItemPreview } from '@core/signal/preview';import { matches } from '@core/util/match';import { truncateString } from '@core/util/string';+import { useSplitNavigationHandler } from '@core/util/useSplitNavigationHandler';import BuildingIcon from '@icon/duotone/building-office-duotone.svg';import EyeSlash from '@icon/duotone/eye-slash-duotone.svg';import GlobeIcon from '@icon/duotone/globe-duotone.svg';@@ -204,6 +205,15 @@ export function ItemPreview(props: ItemPreviewProps) {{(accessibleItem) => {const itemData = accessibleItem();const fileType = itemData.fileType;+ const navHandlers =+ useSplitNavigationHandler<HTMLButtonElement>((e) =>+ onPreviewClick(+ itemData.type,+ itemData.id,+ fileType,+ e.altKey+ )+ );return (<TextButtontheme="base"@@ -228,14 +238,7 @@ export function ItemPreview(props: ItemPreviewProps) {/>);}}- onClick={(e) =>- onPreviewClick(- itemData.type,- itemData.id,- fileType,- e.altKey- )- }+ {...navHandlers}text={truncateString(name(), 80)}width="min-w-0"/>diff --git a/js/app/packages/core/component/LexicalMarkdown/component/core/BlockLink.tsx b/js/app/packages/core/component/LexicalMarkdown/component/core/BlockLink.tsxindex 1c0973fc45..a990ac3367 100644--- a/js/app/packages/core/component/LexicalMarkdown/component/core/BlockLink.tsx+++ b/js/app/packages/core/component/LexicalMarkdown/component/core/BlockLink.tsx@@ -1,9 +1,10 @@import { useGlobalBlockOrchestrator } from '@app/component/GlobalAppState';+import { useSplitLayout } from '@app/component/split-layout/layout';import { useMaybeBlockId } from '@core/block';import { fileTypeToBlockName } from '@core/constant/allBlocks';+import { useSplitNavigationHandler } from '@core/util/useSplitNavigationHandler';import { createCallback } from '@solid-primitives/rootless';import type { ParentProps } from 'solid-js';-import { useSplitLayout } from '../../../../../app/component/split-layout/layout';export const blockNamesWithLocations = ['pdf',@@ -80,5 +81,6 @@ export function BlockLink(let newSplit = e.altKey;openDocument(props.blockOrFileName, props.id, props.params, newSplit);});- return <span onClick={open}>{props.children}</span>;+ const navHandlers = useSplitNavigationHandler<HTMLSpanElement>(open);+ return <span {...navHandlers}>{props.children}</span>;}diff --git a/js/app/packages/core/component/LexicalMarkdown/component/decorator/ContactMention.tsx b/js/app/packages/core/component/LexicalMarkdown/component/decorator/ContactMention.tsxindex 064d025707..b890268769 100644--- a/js/app/packages/core/component/LexicalMarkdown/component/decorator/ContactMention.tsx+++ b/js/app/packages/core/component/LexicalMarkdown/component/decorator/ContactMention.tsx@@ -1,10 +1,10 @@+import { useSplitNavigationHandler } from '@core/util/useSplitNavigationHandler';import BuildingIcon from '@icon/regular/buildings.svg';import UserIcon from '@icon/regular/user.svg';import type { ContactMentionDecoratorProps } from '@lexical-core';import { COMMAND_PRIORITY_NORMAL, KEY_ENTER_COMMAND } from 'lexical';import { createSignal, Show, useContext } from 'solid-js';import { Portal } from 'solid-js/web';-import { useSplitLayout } from '../../../../../app/component/split-layout/layout';import { LexicalWrapperContext } from '../../context/LexicalWrapperContext';import { floatWithElement } from '../../directive/floatWithElement';@@ -102,6 +102,8 @@ export function ContactMention(props: ContactMentionDecoratorProps) {);}+ const navHandlers = useSplitNavigationHandler(openContact);+return (<><span@@ -110,7 +112,7 @@ export function ContactMention(props: ContactMentionDecoratorProps) {classList={{'bracket-offset-2': isSelectedAsNode(),}}- onClick={openContact}+ {...navHandlers}onMouseEnter={() => setPopupOpen(true)}onMouseLeave={() => setPopupOpen(false)}>diff --git a/js/app/packages/core/component/LexicalMarkdown/component/decorator/DocumentMention.tsx b/js/app/packages/core/component/LexicalMarkdown/component/decorator/DocumentMention.tsxindex f86c1af32c..0c919a2c80 100644--- a/js/app/packages/core/component/LexicalMarkdown/component/decorator/DocumentMention.tsx+++ b/js/app/packages/core/component/LexicalMarkdown/component/decorator/DocumentMention.tsx@@ -25,6 +25,7 @@ import {useItemPreview,} from '@core/signal/preview';import { matches } from '@core/util/match';+import { useSplitNavigationHandler } from '@core/util/useSplitNavigationHandler';import EyeSlashDuo from '@icon/duotone/eye-slash-duotone.svg';import TrashSimple from '@icon/duotone/trash-simple-duotone.svg';import LoadingSpinner from '@icon/regular/spinner.svg';@@ -313,6 +314,13 @@ export function DocumentMention(props: DocumentMentionDecoratorProps) {});};+ const navHandlers = useSplitNavigationHandler<HTMLSpanElement>((e) => {+ e.stopPropagation();+ if (matches(item(), (i) => !i.loading && i.access === 'access')) {+ open(e);+ }+ });+return (<><span class="relative">@@ -349,12 +357,7 @@ export function DocumentMention(props: DocumentMentionDecoratorProps) {}}}}- on:click={(e) => {- e.stopPropagation();- if (matches(item(), (i) => !i.loading && i.access === 'access')) {- open(e);- }- }}+ {...navHandlers}><Switch><Match when={item().loading}>diff --git a/js/app/packages/core/component/Notifications.tsx b/js/app/packages/core/component/Notifications.tsxindex 51cbebeb41..e6c5bc184e 100644--- a/js/app/packages/core/component/Notifications.tsx+++ b/js/app/packages/core/component/Notifications.tsx@@ -3,6 +3,7 @@ import { useSplitLayout } from '@app/component/split-layout/layout';import { NotificationRenderer } from '@core/component/NotificationRenderer';import type { Entity } from '@core/types';import { formatDate } from '@core/util/date';+import { useSplitNavigationHandler } from '@core/util/useSplitNavigationHandler';import { notificationWithMetadata } from '@notifications/notificationMetadata';import { navigateToNotification } from '@notifications/notificationNavigation';import {@@ -76,13 +77,16 @@ export function Notifications(props: NotificationsProps) {<For each={notifications()}>{(notification) => {const isUnread = !notification.viewedAt;+ const navHandlers = useSplitNavigationHandler(() =>+ handleNotificationClick(notification)+ );return (<buttonclass={`w-full p-2 pb-3 border-b border-edge-muted hover:bg-hover text-left ${isUnread ? 'bg-menu-hover' : 'bg-menu'}`}- onClick={() => handleNotificationClick(notification)}+ {...navHandlers}><div class="flex justify-start items-center gap-2 mb-4 font-mono text-ink-muted text-xs uppercase"><divdiff --git a/js/app/packages/core/component/References.tsx b/js/app/packages/core/component/References.tsxindex 8081a5743f..4e3aabc9ae 100644--- a/js/app/packages/core/component/References.tsx+++ b/js/app/packages/core/component/References.tsx@@ -11,6 +11,7 @@ import {} from '@core/signal/preview';import { useDisplayName } from '@core/user';import { isErr } from '@core/util/maybeResult';+import { useSplitNavigationHandler } from '@core/util/useSplitNavigationHandler';import { commsServiceClient } from '@service-comms/client';import type { EntityReference } from '@service-comms/generated/models/entityReference';import type { GenericReference } from '@service-comms/generated/models/genericReference';@@ -166,12 +167,14 @@ export function References(props: ReferenceProps) {const hasMessageContent =ref.message_content && ref.message_content.trim().length > 0;+ const navHandlers = useSplitNavigationHandler(() =>+ navigateToMessage(ref.channel_id, ref.message_id)+ );+return (<buttonclass="bg-menu hover:bg-hover p-2 pb-3 border-edge-muted border-b w-full text-left"- onClick={() =>- navigateToMessage(ref.channel_id, ref.message_id)- }+ {...navHandlers}><div class="flex justify-start items-center gap-2 mb-4 font-mono text-ink-muted text-xs uppercase"><div class="bg-ink-extra-muted size-2" />@@ -208,10 +211,14 @@ export function References(props: ReferenceProps) {type: ref.source_entity_type as any,});+ const navHandlers = useSplitNavigationHandler(() =>+ navigateToGenericReference(item())+ );+return (<buttonclass="bg-menu hover:bg-hover p-2 pb-3 border-edge-muted border-b w-full text-left"- onClick={() => navigateToGenericReference(item())}+ {...navHandlers}><div class="flex justify-start items-center gap-2 mb-4 font-mono text-ink-muted text-xs uppercase"><div class="bg-ink-extra-muted size-2" />diff --git a/js/app/packages/core/hotkey/hotkeys.ts b/js/app/packages/core/hotkey/hotkeys.tsindex a083fb3cfe..6657f2d298 100644--- a/js/app/packages/core/hotkey/hotkeys.ts+++ b/js/app/packages/core/hotkey/hotkeys.ts@@ -19,10 +19,10 @@ import {hotkeysAwaitingKeyUp,hotkeyTokenMap,pressedKeys,+ setActiveScope,setExecutedTokens,setHotkeyTokenMap,setPressedKeys,- setActiveScope,} from './state';import type { HotkeyToken } from './tokens';import {diff --git a/js/app/packages/core/mobile/isTouchDevice.ts b/js/app/packages/core/mobile/isTouchDevice.tsindex 28f62ec9fe..26f9acd5e4 100644--- a/js/app/packages/core/mobile/isTouchDevice.ts+++ b/js/app/packages/core/mobile/isTouchDevice.ts@@ -1,5 +1,6 @@const isTouchDevice = (() => {- if (typeof window === 'undefined' || typeof window.matchMedia !== 'function') return false;+ if (typeof window === 'undefined' || typeof window.matchMedia !== 'function')+ return false;// Check if primary input is coarse (finger/stylus) rather than fine (mouse)const hasCoarsePointer = window.matchMedia('(pointer: coarse)').matches;diff --git a/js/app/packages/core/tests/date.test.ts b/js/app/packages/core/tests/date.test.tsindex 507790c387..b7caec81e7 100644--- a/js/app/packages/core/tests/date.test.ts+++ b/js/app/packages/core/tests/date.test.ts@@ -23,7 +23,9 @@ describe('Date Utilities (core/utils/date.ts)', () => {it('should format time for today', () => {// Today at 8:15 AM UTCconst todayMorning = epochTime('2025-06-14T08:15:00.000Z');- expect(formatDate(todayMorning, mockNowEpochSeconds, 'UTC')).toBe('8:15 AM');+ expect(formatDate(todayMorning, mockNowEpochSeconds, 'UTC')).toBe(+ '8:15 AM'+ );});it('should format "Yesterday at {time}" for yesterday (UTC day boundary)', () => {@@ -47,7 +49,9 @@ describe('Date Utilities (core/utils/date.ts)', () => {// Reference time: June 14, 2:15 PM UTC// Same day at 1:00 AM UTC (13.25 hours earlier, but same UTC day)const earlyToday = epochTime('2025-06-14T01:00:00.000Z');- expect(formatDate(earlyToday, mockNowEpochSeconds, 'UTC')).toBe('1:00 AM');+ expect(formatDate(earlyToday, mockNowEpochSeconds, 'UTC')).toBe(+ '1:00 AM'+ );});it('should handle yesterday even with more than 24 hour difference', () => {diff --git a/js/app/packages/core/util/createControlledOpenSignal.ts b/js/app/packages/core/util/createControlledOpenSignal.tsindex 9756e517fa..dab143b88c 100644--- a/js/app/packages/core/util/createControlledOpenSignal.ts+++ b/js/app/packages/core/util/createControlledOpenSignal.ts@@ -17,25 +17,25 @@ export const createControlledOpenSignal = (value?: boolean) => {} else {// has to fire two tasks after to prevent Kobalte menus stealing focus and opening menu on up/down keypress// i guess not - until it does once again- setTimeout(() => {- if (previouslyFocusedElement instanceof HTMLElement) {- if (previouslyFocusedElement.isConnected) {- previouslyFocusedElement.focus();- } else {- // This only works for restoring previously focused entity in UnifiedList, this a workaround previous focused Entity nodes being removed from the dom and focusing to body+ setTimeout(() => {+ if (previouslyFocusedElement instanceof HTMLElement) {+ if (previouslyFocusedElement.isConnected) {+ previouslyFocusedElement.focus();+ } else {+ // This only works for restoring previously focused entity in UnifiedList, this a workaround previous focused Entity nodes being removed from the dom and focusing to body- // attributeToSelector still doesn't guarentee node is unique for all cases- // new rendered node might have different arribute value- previouslyFocusedElement = document.querySelector(- attributesToSelector(previouslyFocusedElement)- ) as HTMLElement;- if (previouslyFocusedElement instanceof HTMLElement) {- previouslyFocusedElement.focus();- if (DEV_MODE_ENV)- console.info('returning focus to', previouslyFocusedElement);- }+ // attributeToSelector still doesn't guarentee node is unique for all cases+ // new rendered node might have different arribute value+ previouslyFocusedElement = document.querySelector(+ attributesToSelector(previouslyFocusedElement)+ ) as HTMLElement;+ if (previouslyFocusedElement instanceof HTMLElement) {+ previouslyFocusedElement.focus();+ if (DEV_MODE_ENV)+ console.info('returning focus to', previouslyFocusedElement);}}+ }});}};diff --git a/js/app/packages/core/util/useSplitNavigationHandler.ts b/js/app/packages/core/util/useSplitNavigationHandler.tsnew file mode 100644index 0000000000..f1bbfd49b5--- /dev/null+++ b/js/app/packages/core/util/useSplitNavigationHandler.ts@@ -0,0 +1,21 @@+import type { JSX } from 'solid-js';++/**+ * Wraps an onClick handler to prevent focus changes on mousedown that would+ * cause split activation flashing. This is needed when clicking on links that+ * navigate to different splits - without this, the source split briefly+ * activates on mousedown before the navigation completes.+ */+export function useSplitNavigationHandler<T extends HTMLElement>(+ onClick: JSX.EventHandler<T, MouseEvent>+): {+ onMouseDown: JSX.EventHandler<T, MouseEvent>;+ onClick: JSX.EventHandler<T, MouseEvent>;+} {+ return {+ onMouseDown: (e) => {+ e.preventDefault();+ },+ onClick,+ };+}diff --git a/js/app/packages/macro-entity/src/components/Entity.tsx b/js/app/packages/macro-entity/src/components/Entity.tsxindex 1aa96499d5..e3ae327c06 100644--- a/js/app/packages/macro-entity/src/components/Entity.tsx+++ b/js/app/packages/macro-entity/src/components/Entity.tsx@@ -7,10 +7,9 @@ import { Dynamic } from 'solid-js/web';import { createProfilePictureQuery } from '../queries/auth';import type { EntityData } from '../types/entity';-export type EntityClickEvent = MouseEvent & {- currentTarget: HTMLDivElement;- target: Element;-};+export type EntityClickEvent = Parameters<+ JSX.EventHandler<HTMLDivElement, MouseEvent>+>[0];export type EntityClickHandler<T extends EntityData> = (entity: T,event: EntityClickEventdiff --git a/js/app/packages/macro-entity/src/components/EntityWithEverything.tsx b/js/app/packages/macro-entity/src/components/EntityWithEverything.tsxindex a2eaeca95a..611b5440f9 100644--- a/js/app/packages/macro-entity/src/components/EntityWithEverything.tsx+++ b/js/app/packages/macro-entity/src/components/EntityWithEverything.tsx@@ -6,6 +6,7 @@ import { StaticMarkdown } from 'core/component/LexicalMarkdown/component/core/Stimport { unifiedListMarkdownTheme } from 'core/component/LexicalMarkdown/theme';import { useDisplayName } from 'core/user';import { onKeyDownClick, onKeyUpClick } from 'core/util/click';+import { useSplitNavigationHandler } from 'core/util/useSplitNavigationHandler';import { notificationWithMetadata } from 'notifications/notificationMetadata';import type { ParentProps, Ref } from 'solid-js';import {@@ -90,7 +91,7 @@ export function EntityWithEverything<createSignal(false);const { keydownDataDuringTask } = trackKeydownDuringTask();- let tabbableEl!: HTMLDivElement;+ let _tabbableEl!: HTMLDivElement;// onMount(() => {// if (document.activeElement === document.body) {@@ -196,14 +197,9 @@ export function EntityWithEverything<});const userName = createMemo(() => {- const [userName] = useDisplayName(notification()?.senderId!);+ const [userName] = useDisplayName(notification()?.senderId);return userName();});- const _isNameEmailAddress = createMemo(() => {- return !!userName().match(- /^(?!\.)(?!.*\.\.)([a-z0-9_'+\-\.]*)[a-z0-9_'+\-]@([a-z0-9][a-z0-9\-]*\.)+[a-z]{2,}$/i- );- });return (<div class="flex gap-2 items-center min-w-0 w-fit max-w-full overflow-hidden">@@ -256,6 +252,14 @@ export function EntityWithEverything<const { didCursorMove } = useCursorMove();+ const navHandlers = createMemo(() => {+ const onClick = props.onClick;+ if (!onClick) return;+ return useSplitNavigationHandler<HTMLDivElement>((e) =>+ onClick(props.entity, e)+ );+ });+return (<divuse:draggable@@ -265,11 +269,6 @@ export function EntityWithEverything<'bg-hover': props.highlighted,bracket: props.selected,}}- onMouseDown={(e) => {- // Prevent focus change on mousedown to avoid split activation flash- // The click handler will properly handle navigation- e.preventDefault();- }}onMouseOver={(e) => {if (!didCursorMove(e)) {return;@@ -305,7 +304,7 @@ export function EntityWithEverything<'grid-cols-[auto_1fr_auto]': props.showLeftColumnIndicator,'grid-cols-[1fr_auto]': !props.showLeftColumnIndicator,}}- onClick={props.onClick ? [props.onClick, props.entity] : undefined}+ {...navHandlers()}// Action List is also rendered based on focus, but when focused via Shift+Tab, parent is focused due to Action List dom not present. Here we check if current browser task has captured Shift+Tab focus on Action ListonFocusIn={(e) => {if (@@ -327,7 +326,7 @@ export function EntityWithEverything<role="button"tabIndex={0}ref={mergeRefs(props.ref, (el) => {- tabbableEl = el;+ _tabbableEl = el;})}>{/* Left Column Indicator(s) */}